diff --git a/libmupen64plus/mupen64plus-audio-sdl/INSTALL b/libmupen64plus/mupen64plus-audio-sdl/INSTALL new file mode 100644 index 0000000000..48986f1063 --- /dev/null +++ b/libmupen64plus/mupen64plus-audio-sdl/INSTALL @@ -0,0 +1,26 @@ +Mupen64Plus-Audio-SDL INSTALL +----------------------------- + +This text file was written to explain the installation process of the +Mupen64Plus-Audio-SDL module. + +If this module is part of a Mupen64Plus source code bundle, the user should run +the "m64p_install.sh" script in the root of the unzipped bundle to install all +of the included modules in the bundle. + +If this module is a standalone source code release, you should build the library +from source code and install it via the makefile, like this: + +$ cd projects/unix +$ make all +$ sudo make install + +If you want to build the Mupen64Plus-Audio-SDL module for installation in a +home folder for a single user, you may build it like this (replacing + with your desired local installation path): + +$ cd projects/unix +$ make all +$ make install LIBDIR= + + diff --git a/libmupen64plus/mupen64plus-audio-sdl/LICENSES b/libmupen64plus/mupen64plus-audio-sdl/LICENSES new file mode 100644 index 0000000000..b5cf836ac1 --- /dev/null +++ b/libmupen64plus/mupen64plus-audio-sdl/LICENSES @@ -0,0 +1,368 @@ +Mupen64Plus-audio-sdl LICENSE +----------------------------- + +Mupen64Plus-audio-sdl is licensed under the GNU General Public License version 2. + +The authors of Mupen64Plus are: + * Richard Goedeken (Richard42) + * John Chadwick (NMN) + * James Hood (Ebenblues) + * Scott Gorman (okaygo) + * Scott Knauert (Tillin9) + * Jesse Dean (DarkJezter) + * Louai Al-Khanji (slougi) + * Bob Forder (orbitaldecay) + * Jason Espinosa (hasone) + * HyperHacker + * and others. + +Mupen64Plus is based on GPL-licensed source code from Mupen64 v0.5, originally written by: + * Hacktarux + * Dave2001 + * Zilmar + * Gregor Anich (Blight) + * Juha Luotio (JttL) + * and others. + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, 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 + + + Appendix: 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. + + + Copyright (C) 19yy + + 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., 675 Mass Ave, Cambridge, MA 02139, 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) 19yy 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. + + , 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. + diff --git a/libmupen64plus/mupen64plus-audio-sdl/RELEASE b/libmupen64plus/mupen64plus-audio-sdl/RELEASE new file mode 100644 index 0000000000..fe1a388524 --- /dev/null +++ b/libmupen64plus/mupen64plus-audio-sdl/RELEASE @@ -0,0 +1,103 @@ +SDL Audio plugin for Mupen64Plus +--------------------------------- + +Mupen64Plus-audio-sdl - LATEST REVISION +--------------------------------------- + - Bugfix: Don't assume OSS is installed in all linux systems. + - Bugfix: Some combinations of VolumeSetLevel and VolumeMute caused VolumeGetString to return "Mute" when not muted + - Make SDL volume handling the default, since OSS is no longer included in the kernel. + - Minor refactoring of volume handling code. + +Mupen64Plus-audio-sdl v1.99.5 - March 10, 2012 +-------------------------------------------------- + - added version number to SDL-audio plugin config parameters, to support future changes + - updated audio plugin for new Mupen64plus 2.0 API versioning scheme + - makefile fixes and improvements + +Mupen64Plus-audio-sdl v1.99.4 - November 22, 2010 +-------------------------------------------------- + - Bugfix: Plugin should write default config values at startup time + - Bugfix: fixed fast-forward for banjo-kazooie and other games which was broken due to limitation in basic resampling algorithm + - many makefile fixes and improvements + +Mupen64Plus-audio-sdl v1.99.3 - February 13, 2010 +-------------------------------------------------- + - sync with core<-->plugin API change for RomOpen() + - bugfix: logical error in previous audio refactoring causing slowdown/lockup on loading savestate or re-initializing audio + - Makefile improvements: + - 'sdl-config --libs' can give "-Wl,-rpath", so plugin must be linked with CC instead of LD + - issue #257: added to makefile OS type GNU/kFreeBSD + +Mupen64Plus-audio-sdl v1.99.2 - January 6, 2010 +------------------------------------------------- + - new feature: Completely re-wrote buffering/synchronization code: + - Buffer parameters now work as advertised and all use the same units + - Bugfix: previous defaults and algorithm behavior caused audio choppiness on slower PCs + - Bugfix: maximum speed was previously limited to low value by constraints from primary buffer size + - bugfix: SDL volume control will always be used on systems without OSS support + - new feature: added MSVC8 project file, minor code refactoring to build in Windows + - Makefile improvements: + - throw error if OS/CPU not supported + - use DESTDIR in install/uninstall paths + - Allow user-specified CC/CXX/LD paths + +Mupen64Plus-audio-sdl v1.99.1 - December 14, 2009 +------------------------------------------------- + - Converted to new Mupen64Plus 2.0 API + - Code cleanup to remove non-standard data types + - Refactored build system to separate source and object files + - bugfix #269: jttl_audio segfaults on exit due to incorrectly ordered shutdown code + + Mupen64plus 1.5: + +Additional SDL modulation option for volume control. + +New Gtk GUI for plugin configuration. + +Improved no GUI support. + + Mupen64plus 1.4: + +Extended plugin API to allow all for runtime volume changes via OSS. + + 1.4: + +Use only standard frequency for higher compatibility + +Fast resample algorithm (use only integers) + +Slight improvements in buffer management : pausing audio when buffer underrun occur + + 1.2: + +Added possibility to swap channels + +Some more optimizations + +Calling RomOpen() is not required anymore. Plugin should now follow Zilmar's specs. + +Added test functions. + +Added support for config file + + 1.1.1: + +Fixed the bug that was causing terrible noise (thanks Law) + +Much more debugging data appears now if DEBUG is defined + +Few more error checks + + 1.1: + +Audio device is opened now with native byte ordering of the machine. Just + for compatibility (thanks Flea). + +Fixed possible double freeing bug (thanks Flea) + +Optimizations in AiLenChanged + +Fixed segmentation fault when changing rom. + +Syncronization redone + + 1.0.1.3: + +Smarter versioning. No more betas. + +More cleaning up done. + +Buffer underrun and overflow messages appear now at stderr (if DEBUG is + defined) + +Many things are now precalculated (this should bring a small performance + boost) + +Buffer underrun bug fixed. + +Segmentation fault when closing rom fixed (at least I think so) + + 1.0 beta 2: + +Makefile fixed to get rid of annoying warning messages + +Cleaned up some old code + +Default frequency set to 33600Hz (for Master Quest compatibility) + +Better syncronization (needs some work still though) + + 1.0 beta 1: + +First public release + + diff --git a/libmupen64plus/mupen64plus-audio-sdl/projects/msvc11/mupen64plus-audio-sdl.vcxproj b/libmupen64plus/mupen64plus-audio-sdl/projects/msvc11/mupen64plus-audio-sdl.vcxproj new file mode 100644 index 0000000000..d88be6f0ca --- /dev/null +++ b/libmupen64plus/mupen64plus-audio-sdl/projects/msvc11/mupen64plus-audio-sdl.vcxproj @@ -0,0 +1,105 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {96969748-EA54-43FC-8103-A346E9AD98E7} + mupen64plusaudiosdl + Win32Proj + + + + DynamicLibrary + MultiByte + true + + + DynamicLibrary + MultiByte + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + true + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + Default + + + ..\..\..\mupen64plus-win32-deps\SDL-1.2.14\lib\SDL.lib;%(AdditionalDependencies) + true + Windows + MachineX86 + + + + + ..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + Default + + + ..\..\..\mupen64plus-win32-deps\SDL-1.2.14\lib\SDL.lib;%(AdditionalDependencies) + true + Windows + true + true + MachineX86 + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libmupen64plus/mupen64plus-audio-sdl/projects/msvc8/mupen64plus-audio-sdl.vcproj b/libmupen64plus/mupen64plus-audio-sdl/projects/msvc8/mupen64plus-audio-sdl.vcproj new file mode 100644 index 0000000000..7757871b57 --- /dev/null +++ b/libmupen64plus/mupen64plus-audio-sdl/projects/msvc8/mupen64plus-audio-sdl.vcproj @@ -0,0 +1,209 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libmupen64plus/mupen64plus-audio-sdl/projects/unix/Makefile b/libmupen64plus/mupen64plus-audio-sdl/projects/unix/Makefile new file mode 100644 index 0000000000..129fb8d676 --- /dev/null +++ b/libmupen64plus/mupen64plus-audio-sdl/projects/unix/Makefile @@ -0,0 +1,374 @@ +#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# * Mupen64plus-audio-sdl - Makefile * +# * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * +# * Copyright (C) 2007-2009 Richard Goedeken * +# * Copyright (C) 2007-2008 Tillin9 * +# * * +# * 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. * +# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +# Makefile for SDL Audio plugin in Mupen64plus + +# detect operation system +UNAME ?= $(shell uname -s) +OS := NONE +ifeq ("$(UNAME)","Linux") + OS = LINUX + SHARED = -shared + SO_EXTENSION = so +endif +ifeq ("$(UNAME)","linux") + OS = LINUX + SHARED = -shared + SO_EXTENSION = so +endif +ifneq ("$(filter GNU hurd,$(UNAME))","") + OS = LINUX + SHARED = -shared + SO_EXTENSION = so +endif +ifeq ("$(UNAME)","Darwin") + OS = OSX + SHARED = -bundle + SO_EXTENSION = dylib +endif +ifeq ("$(UNAME)","FreeBSD") + OS = FREEBSD + SHARED = -shared + SO_EXTENSION = so +endif +ifeq ("$(UNAME)","OpenBSD") + OS = FREEBSD + SHARED = -shared + SO_EXTENSION = so + $(warning OS type "$(UNAME)" not officially supported.') +endif +ifneq ("$(filter GNU/kFreeBSD kfreebsd,$(UNAME))","") + OS = LINUX + SHARED = -shared + SO_EXTENSION = so +endif +ifeq ("$(patsubst MINGW%,MINGW,$(UNAME))","MINGW") + OS = MINGW + SHARED = -shared + SO_EXTENSION = dll + PIC = 0 + NO_OSS = 1 +endif +ifeq ("$(OS)","NONE") + $(error OS type "$(UNAME)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') +endif + +# detect system architecture +HOST_CPU ?= $(shell uname -m) +NO_ASM ?= 1 +CPU := NONE +ifneq ("$(filter x86_64 amd64,$(HOST_CPU))","") + CPU := X86 + ifeq ("$(BITS)", "32") + ARCH_DETECTED := 64BITS_32 + PIC ?= 0 + else + ARCH_DETECTED := 64BITS + PIC ?= 1 + endif +endif +ifneq ("$(filter pentium i%86,$(HOST_CPU))","") + CPU := X86 + ARCH_DETECTED := 32BITS + PIC ?= 0 +endif +ifneq ("$(filter ppc macppc socppc powerpc,$(HOST_CPU))","") + CPU := PPC + ARCH_DETECTED := 32BITS + BIG_ENDIAN := 1 + PIC ?= 1 + $(warning Architecture "$(HOST_CPU)" not officially supported.') +endif +ifneq ("$(filter ppc64 powerpc64,$(HOST_CPU))","") + CPU := PPC + ARCH_DETECTED := 64BITS + BIG_ENDIAN := 1 + PIC ?= 1 + $(warning Architecture "$(HOST_CPU)" not officially supported.') +endif +ifneq ("$(filter arm%,$(HOST_CPU))","") + ifeq ("$(filter arm%b,$(HOST_CPU))","") + CPU := ARM + ARCH_DETECTED := 32BITS + PIC ?= 1 + $(warning Architecture "$(HOST_CPU)" not officially supported.') + endif +endif +ifeq ("$(CPU)","NONE") + $(error CPU type "$(HOST_CPU)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') +endif + +# base CFLAGS, LDLIBS, and LDFLAGS +OPTFLAGS ?= -O3 +WARNFLAGS ?= -Wall +CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src +LDFLAGS += $(SHARED) + +# default configuration programs +SDL_CONFIG = $(CROSS_COMPILE)sdl-config +PKG_CONFIG = $(CROSS_COMPILE)pkg-config + +# Since we are building a shared library, we must compile with -fPIC on some architectures +# On 32-bit x86 systems we do not want to use -fPIC because we don't have to and it has a big performance penalty on this arch +ifeq ($(PIC), 1) + CFLAGS += -fPIC + LDFLAGS += -fPIC +else + CFLAGS += -fno-PIC + LDFLAGS += -fno-PIC +endif + +ifeq ($(BIG_ENDIAN), 1) + CFLAGS += -DM64P_BIG_ENDIAN +endif + +# tweak flags for 32-bit build on 64-bit system +ifeq ($(ARCH_DETECTED), 64BITS_32) + ifeq ($(OS), FREEBSD) + $(error Do not use the BITS=32 option with FreeBSD, use -m32 and -m elf_i386) + endif + CFLAGS += -m32 + LDFLAGS += -m32 -Wl,-m,elf_i386 +endif + +# set special flags per-system +ifeq ($(OS), LINUX) + LDLIBS += -ldl +endif +ifeq ($(OS), OSX) + # Select the proper SDK + # Also, SDKs are stored in a different location since XCode 4.3 + OSX_SDK ?= $(shell sw_vers -productVersion | cut -f1 -f2 -d .) + OSX_XCODEMAJ = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f1 -d .) + OSX_XCODEMIN = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f2 -d .) + OSX_XCODEGE43 = $(shell echo "`expr $(OSX_XCODEMAJ) \>= 4``expr $(OSX_XCODEMIN) \>= 3`") + ifeq ($(OSX_XCODEGE43), 11) + OSX_SYSROOT := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs + else + OSX_SYSROOT := /Developer/SDKs + endif + + ifeq ($(CPU), X86) + ifeq ($(ARCH_DETECTED), 64BITS) + CFLAGS += -pipe -arch x86_64 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk + LDFLAGS += -arch x86_64 + LDLIBS += -ldl + else + CFLAGS += -pipe -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk + LDFLAGS += -arch i686 + LDLIBS += -ldl -read_only_relocs suppress + endif + endif +endif + +# test for presence of SDL +ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),) + $(error No SDL development libraries found!) +endif +ifeq ($(OS),FREEBSD) + CFLAGS += $(shell $(SDL_CONFIG) --cflags) + LDLIBS += $(shell $(SDL_CONFIG) --libs) +endif +ifeq ($(OS),OSX) + CFLAGS += $(shell $(SDL_CONFIG) --cflags) + LDLIBS += $(shell $(SDL_CONFIG) --libs) +endif +ifeq ($(OS),LINUX) + CFLAGS += $(shell $(SDL_CONFIG) --cflags) + LDLIBS += $(shell $(SDL_CONFIG) --libs) +endif +ifeq ($(OS),MINGW) + CFLAGS += $(shell $(SDL_CONFIG) --cflags) + LDLIBS += $(shell $(SDL_CONFIG) --libs) +endif + +# test for presence of speexdsp +ifneq ($(strip $(shell $(PKG_CONFIG) speexdsp --modversion 2> /dev/null)),) + ifneq ($(NO_SPEEX), 1) + # set speexdsp flags and libraries + CFLAGS += $(shell $(PKG_CONFIG) speexdsp --cflags) -DUSE_SPEEX + LDLIBS += $(shell $(PKG_CONFIG) speexdsp --libs) + endif +else + # warn user + $(warning No libspeexdsp development libraries found. Mupen64plus-sdl-audio will be built without speex-* resampler.) +endif + +# test for presence of libsamplerate +ifneq ($(strip $(shell $(PKG_CONFIG) samplerate --modversion 2> /dev/null)),) + ifneq ($(NO_SRC), 1) + # set libsamplerate flags and libraries + CFLAGS += $(shell $(PKG_CONFIG) samplerate --cflags) -DUSE_SRC + LDLIBS += $(shell $(PKG_CONFIG) samplerate --libs) + endif +else + # warn user + $(warning No libsamplerate development libraries found. Mupen64plus-sdl-audio will be built without src-* resampler.) +endif + +# test for the presence of OSS +ifneq ($(wildcard /dev/mixer),) + ifneq ($(NO_OSS), 1) + CFLAGS += -DHAS_OSS_SUPPORT + endif +endif + +# set mupen64plus core API header path +ifneq ("$(APIDIR)","") + CFLAGS += "-I$(APIDIR)" +else + TRYDIR = ../../../mupen64plus-core/src/api + ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") + CFLAGS += -I$(TRYDIR) + else + TRYDIR = /usr/local/include/mupen64plus + ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") + CFLAGS += -I$(TRYDIR) + else + TRYDIR = /usr/include/mupen64plus + ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") + CFLAGS += -I$(TRYDIR) + else + $(error Mupen64Plus API header files not found! Use makefile parameter APIDIR to force a location.) + endif + endif + endif +endif + +# reduced compile output when running make without V=1 +ifneq ($(findstring $(MAKEFLAGS),s),s) +ifndef V + Q_CC = @echo ' CC '$@; + Q_LD = @echo ' LD '$@; +endif +endif + +# set base program pointers and flags +CC = $(CROSS_COMPILE)gcc +RM ?= rm -f +INSTALL ?= install +MKDIR ?= mkdir -p +COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c +LINK.o = $(Q_LD)$(CC) $(LDFLAGS) $(TARGET_ARCH) + +# set special flags for given Makefile parameters +ifeq ($(DEBUG),1) + CFLAGS += -g + INSTALL_STRIP_FLAG ?= +else + ifneq ($(OS),OSX) + INSTALL_STRIP_FLAG ?= -s + endif +endif + +# set installation options +ifeq ($(PREFIX),) + PREFIX := /usr/local +endif +ifeq ($(LIBDIR),) + LIBDIR := $(PREFIX)/lib +endif +ifeq ($(PLUGINDIR),) + PLUGINDIR := $(LIBDIR)/mupen64plus +endif + +SRCDIR = ../../src +OBJDIR = _obj$(POSTFIX) + +# list of source files to compile +SOURCE = \ + $(SRCDIR)/main.c \ + $(SRCDIR)/volume.c + +ifeq ($(OS),MINGW) +SOURCE += $(SRCDIR)/osal_dynamiclib_win32.c +else +SOURCE += $(SRCDIR)/osal_dynamiclib_unix.c +endif + +# generate a list of object files build, make a temporary directory for them +OBJECTS := $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(filter %.c, $(SOURCE))) +OBJDIRS = $(dir $(OBJECTS)) +$(shell $(MKDIR) $(OBJDIRS)) + +# build targets +TARGET = mupen64plus-audio-sdl$(POSTFIX).$(SO_EXTENSION) + +targets: + @echo "Mupen64Plus-audio-sdl makefile. " + @echo " Targets:" + @echo " all == Build Mupen64Plus SDL audio plugin" + @echo " clean == remove object files" + @echo " rebuild == clean and re-build all" + @echo " install == Install Mupen64Plus SDL audio plugin" + @echo " uninstall == Uninstall Mupen64Plus SDL audio plugin" + @echo " Options:" + @echo " BITS=32 == build 32-bit binaries on 64-bit machine" + @echo " APIDIR=path == path to find Mupen64Plus Core headers" + @echo " OPTFLAGS=flag == compiler optimization (default: -O3)" + @echo " WARNFLAGS=flag == compiler warning levels (default: -Wall)" + @echo " PIC=(1|0) == Force enable/disable of position independent code" + @echo " NO_SRC=1 == build without libsamplerate; disables src-* high-quality audio resampling" + @echo " NO_SPEEX=1 == build without libspeexdsp; disables speex-* high-quality audio resampling" + @echo " NO_OSS=1 == build without OSS; disables Open Sound System support" + @echo " POSTFIX=name == String added to the name of the the build (default: '')" + @echo " Install Options:" + @echo " PREFIX=path == install/uninstall prefix (default: /usr/local)" + @echo " LIBDIR=path == library prefix (default: PREFIX/lib)" + @echo " PLUGINDIR=path == path to install plugin libraries (default: LIBDIR/mupen64plus)" + @echo " DESTDIR=path == path to prepend to all installation paths (only for packagers)" + @echo " Debugging Options:" + @echo " DEBUG=1 == add debugging symbols" + @echo " LTO=1 == enable experimental build with link-time optimization" + @echo " V=1 == show verbose compiler output" + + +all: $(TARGET) + +install: $(TARGET) + $(INSTALL) -d "$(DESTDIR)$(PLUGINDIR)" + $(INSTALL) -m 0644 $(INSTALL_STRIP_FLAG) $(TARGET) "$(DESTDIR)$(PLUGINDIR)" + +uninstall: + $(RM) "$(DESTDIR)$(PLUGINDIR)/$(TARGET)" + +clean: + $(RM) -r $(OBJDIR) $(TARGET) + +rebuild: clean all + +# build dependency files +CFLAGS += -MD +-include $(OBJECTS:.o=.d) + +ifeq ($(LTO), 1) + CFLAGS += -flto + LDFLAGS += -fuse-linker-plugin $(CFLAGS) +endif + +# standard build rules +$(OBJDIR)/%.o: $(SRCDIR)/%.c + $(COMPILE.c) -o $@ $< + +$(TARGET): $(OBJECTS) + $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@ + +.PHONY: all clean install uninstall targets diff --git a/libmupen64plus/mupen64plus-audio-sdl/src/main.c b/libmupen64plus/mupen64plus-audio-sdl/src/main.c new file mode 100644 index 0000000000..ff5e31983f --- /dev/null +++ b/libmupen64plus/mupen64plus-audio-sdl/src/main.c @@ -0,0 +1,1011 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-sdl-audio - main.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2007-2009 Richard Goedeken * + * Copyright (C) 2007-2008 Ebenblues * + * Copyright (C) 2003 JttL * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include + +#include +#include + +#ifdef USE_SRC +#include +#endif +#ifdef USE_SPEEX +#include +#endif + +#define M64P_PLUGIN_PROTOTYPES 1 +#include "m64p_types.h" +#include "m64p_plugin.h" +#include "m64p_common.h" +#include "m64p_config.h" + +#include "main.h" +#include "volume.h" +#include "osal_dynamiclib.h" + +/* Default start-time size of primary buffer (in equivalent output samples). + This is the buffer where audio is loaded after it's extracted from n64's memory. + This value must be larger than PRIMARY_BUFFER_TARGET */ +#define PRIMARY_BUFFER_SIZE 16384 + +/* this is the buffer fullness level (in equivalent output samples) which is targeted + for the primary audio buffer (by inserting delays) each time data is received from + the running N64 program. This value must be larger than the SECONDARY_BUFFER_SIZE. + Decreasing this value will reduce audio latency but requires a faster PC to avoid + choppiness. Increasing this will increase audio latency but reduce the chance of + drop-outs. The default value 10240 gives a 232ms maximum A/V delay at 44.1khz */ +#define PRIMARY_BUFFER_TARGET 10240 + +/* Size of secondary buffer, in output samples. This is the requested size of SDL's + hardware buffer, and the size of the mix buffer for doing SDL volume control. The + SDL documentation states that this should be a power of two between 512 and 8192. */ +#define SECONDARY_BUFFER_SIZE 2048 + +/* This sets default frequency what is used if rom doesn't want to change it. + Probably only game that needs this is Zelda: Ocarina Of Time Master Quest + *NOTICE* We should try to find out why Demos' frequencies are always wrong + They tend to rely on a default frequency, apparently, never the same one ;)*/ +#define DEFAULT_FREQUENCY 33600 + +/* number of bytes per sample */ +#define N64_SAMPLE_BYTES 4 +#define SDL_SAMPLE_BYTES 4 + +/* volume mixer types */ +#define VOLUME_TYPE_SDL 1 +#define VOLUME_TYPE_OSS 2 + +/* local variables */ +static void (*l_DebugCallback)(void *, int, const char *) = NULL; +static void *l_DebugCallContext = NULL; +static int l_PluginInit = 0; +static int l_PausedForSync = 1; /* Audio is started in paused state after SDL initialization */ +static m64p_handle l_ConfigAudio; + +enum resampler_type { + RESAMPLER_TRIVIAL, +#ifdef USE_SRC + RESAMPLER_SRC, +#endif +#ifdef USE_SPEEX + RESAMPLER_SPEEX, +#endif +}; + +/* Read header for type definition */ +static AUDIO_INFO AudioInfo; +/* The hardware specifications we are using */ +static SDL_AudioSpec *hardware_spec; +/* Pointer to the primary audio buffer */ +static unsigned char *primaryBuffer = NULL; +static unsigned int primaryBufferBytes = 0; +/* Pointer to the mixing buffer for voume control*/ +static unsigned char *mixBuffer = NULL; +/* Position in buffer array where next audio chunk should be placed */ +static unsigned int buffer_pos = 0; +/* Audio frequency, this is usually obtained from the game, but for compatibility we set default value */ +static int GameFreq = DEFAULT_FREQUENCY; +/* timestamp for the last time that our audio callback was called */ +static unsigned int last_callback_ticks = 0; +/* SpeedFactor is used to increase/decrease game playback speed */ +static unsigned int speed_factor = 100; +// If this is true then left and right channels are swapped */ +static int SwapChannels = 0; +// Size of Primary audio buffer in equivalent output samples +static unsigned int PrimaryBufferSize = PRIMARY_BUFFER_SIZE; +// Fullness level target for Primary audio buffer, in equivalent output samples +static unsigned int PrimaryBufferTarget = PRIMARY_BUFFER_TARGET; +// Size of Secondary audio buffer in output samples +static unsigned int SecondaryBufferSize = SECONDARY_BUFFER_SIZE; +// Resample type +static enum resampler_type Resample = RESAMPLER_TRIVIAL; +// Resampler specific quality +static int ResampleQuality = 3; +// volume to scale the audio by, range of 0..100 +// if muted, this holds the volume when not muted +static int VolPercent = 80; +// how much percent to increment/decrement volume by +static int VolDelta = 5; +// the actual volume passed into SDL, range of 0..SDL_MIX_MAXVOLUME +static int VolSDL = SDL_MIX_MAXVOLUME; +// Muted or not +static int VolIsMuted = 0; +//which type of volume control to use +static int VolumeControlType = VOLUME_TYPE_SDL; + +static int OutputFreq; + +// Prototype of local functions +static void my_audio_callback(void *userdata, unsigned char *stream, int len); +static void InitializeAudio(int freq); +static void ReadConfig(void); +static void InitializeSDL(void); + +static int critical_failure = 0; + +/* definitions of pointers to Core config functions */ +ptr_ConfigOpenSection ConfigOpenSection = NULL; +ptr_ConfigDeleteSection ConfigDeleteSection = NULL; +ptr_ConfigSaveSection ConfigSaveSection = NULL; +ptr_ConfigSetParameter ConfigSetParameter = NULL; +ptr_ConfigGetParameter ConfigGetParameter = NULL; +ptr_ConfigGetParameterHelp ConfigGetParameterHelp = NULL; +ptr_ConfigSetDefaultInt ConfigSetDefaultInt = NULL; +ptr_ConfigSetDefaultFloat ConfigSetDefaultFloat = NULL; +ptr_ConfigSetDefaultBool ConfigSetDefaultBool = NULL; +ptr_ConfigSetDefaultString ConfigSetDefaultString = NULL; +ptr_ConfigGetParamInt ConfigGetParamInt = NULL; +ptr_ConfigGetParamFloat ConfigGetParamFloat = NULL; +ptr_ConfigGetParamBool ConfigGetParamBool = NULL; +ptr_ConfigGetParamString ConfigGetParamString = NULL; + +/* Global functions */ +static void DebugMessage(int level, const char *message, ...) +{ + char msgbuf[1024]; + va_list args; + + if (l_DebugCallback == NULL) + return; + + va_start(args, message); + vsprintf(msgbuf, message, args); + + (*l_DebugCallback)(l_DebugCallContext, level, msgbuf); + + va_end(args); +} + +/* Mupen64Plus plugin functions */ +EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle CoreLibHandle, void *Context, + void (*DebugCallback)(void *, int, const char *)) +{ + ptr_CoreGetAPIVersions CoreAPIVersionFunc; + + int ConfigAPIVersion, DebugAPIVersion, VidextAPIVersion, bSaveConfig; + float fConfigParamsVersion = 0.0f; + + if (l_PluginInit) + return M64ERR_ALREADY_INIT; + + /* first thing is to set the callback function for debug info */ + l_DebugCallback = DebugCallback; + l_DebugCallContext = Context; + + /* attach and call the CoreGetAPIVersions function, check Config API version for compatibility */ + CoreAPIVersionFunc = (ptr_CoreGetAPIVersions) osal_dynlib_getproc(CoreLibHandle, "CoreGetAPIVersions"); + if (CoreAPIVersionFunc == NULL) + { + DebugMessage(M64MSG_ERROR, "Core emulator broken; no CoreAPIVersionFunc() function found."); + return M64ERR_INCOMPATIBLE; + } + + (*CoreAPIVersionFunc)(&ConfigAPIVersion, &DebugAPIVersion, &VidextAPIVersion, NULL); + if ((ConfigAPIVersion & 0xffff0000) != (CONFIG_API_VERSION & 0xffff0000)) + { + DebugMessage(M64MSG_ERROR, "Emulator core Config API (v%i.%i.%i) incompatible with plugin (v%i.%i.%i)", + VERSION_PRINTF_SPLIT(ConfigAPIVersion), VERSION_PRINTF_SPLIT(CONFIG_API_VERSION)); + return M64ERR_INCOMPATIBLE; + } + + /* Get the core config function pointers from the library handle */ + ConfigOpenSection = (ptr_ConfigOpenSection) osal_dynlib_getproc(CoreLibHandle, "ConfigOpenSection"); + ConfigDeleteSection = (ptr_ConfigDeleteSection) osal_dynlib_getproc(CoreLibHandle, "ConfigDeleteSection"); + ConfigSaveSection = (ptr_ConfigSaveSection) osal_dynlib_getproc(CoreLibHandle, "ConfigSaveSection"); + ConfigSetParameter = (ptr_ConfigSetParameter) osal_dynlib_getproc(CoreLibHandle, "ConfigSetParameter"); + ConfigGetParameter = (ptr_ConfigGetParameter) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParameter"); + ConfigSetDefaultInt = (ptr_ConfigSetDefaultInt) osal_dynlib_getproc(CoreLibHandle, "ConfigSetDefaultInt"); + ConfigSetDefaultFloat = (ptr_ConfigSetDefaultFloat) osal_dynlib_getproc(CoreLibHandle, "ConfigSetDefaultFloat"); + ConfigSetDefaultBool = (ptr_ConfigSetDefaultBool) osal_dynlib_getproc(CoreLibHandle, "ConfigSetDefaultBool"); + ConfigSetDefaultString = (ptr_ConfigSetDefaultString) osal_dynlib_getproc(CoreLibHandle, "ConfigSetDefaultString"); + ConfigGetParamInt = (ptr_ConfigGetParamInt) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParamInt"); + ConfigGetParamFloat = (ptr_ConfigGetParamFloat) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParamFloat"); + ConfigGetParamBool = (ptr_ConfigGetParamBool) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParamBool"); + ConfigGetParamString = (ptr_ConfigGetParamString) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParamString"); + + if (!ConfigOpenSection || !ConfigDeleteSection || !ConfigSetParameter || !ConfigGetParameter || + !ConfigSetDefaultInt || !ConfigSetDefaultFloat || !ConfigSetDefaultBool || !ConfigSetDefaultString || + !ConfigGetParamInt || !ConfigGetParamFloat || !ConfigGetParamBool || !ConfigGetParamString) + return M64ERR_INCOMPATIBLE; + + /* ConfigSaveSection was added in Config API v2.1.0 */ + if (ConfigAPIVersion >= 0x020100 && !ConfigSaveSection) + return M64ERR_INCOMPATIBLE; + + /* get a configuration section handle */ + if (ConfigOpenSection("Audio-SDL", &l_ConfigAudio) != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_ERROR, "Couldn't open config section 'Audio-SDL'"); + return M64ERR_INPUT_NOT_FOUND; + } + + /* check the section version number */ + bSaveConfig = 0; + if (ConfigGetParameter(l_ConfigAudio, "Version", M64TYPE_FLOAT, &fConfigParamsVersion, sizeof(float)) != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_WARNING, "No version number in 'Audio-SDL' config section. Setting defaults."); + ConfigDeleteSection("Audio-SDL"); + ConfigOpenSection("Audio-SDL", &l_ConfigAudio); + bSaveConfig = 1; + } + else if (((int) fConfigParamsVersion) != ((int) CONFIG_PARAM_VERSION)) + { + DebugMessage(M64MSG_WARNING, "Incompatible version %.2f in 'Audio-SDL' config section: current is %.2f. Setting defaults.", fConfigParamsVersion, (float) CONFIG_PARAM_VERSION); + ConfigDeleteSection("Audio-SDL"); + ConfigOpenSection("Audio-SDL", &l_ConfigAudio); + bSaveConfig = 1; + } + else if ((CONFIG_PARAM_VERSION - fConfigParamsVersion) >= 0.0001f) + { + /* handle upgrades */ + float fVersion = CONFIG_PARAM_VERSION; + ConfigSetParameter(l_ConfigAudio, "Version", M64TYPE_FLOAT, &fVersion); + DebugMessage(M64MSG_INFO, "Updating parameter set version in 'Audio-SDL' config section to %.2f", fVersion); + bSaveConfig = 1; + } + + /* set the default values for this plugin */ + ConfigSetDefaultFloat(l_ConfigAudio, "Version", CONFIG_PARAM_VERSION, "Mupen64Plus SDL Audio Plugin config parameter version number"); + ConfigSetDefaultInt(l_ConfigAudio, "DEFAULT_FREQUENCY", DEFAULT_FREQUENCY, "Frequency which is used if rom doesn't want to change it"); + ConfigSetDefaultBool(l_ConfigAudio, "SWAP_CHANNELS", 0, "Swaps left and right channels"); + ConfigSetDefaultInt(l_ConfigAudio, "PRIMARY_BUFFER_SIZE", PRIMARY_BUFFER_SIZE, "Size of primary buffer in output samples. This is where audio is loaded after it's extracted from n64's memory."); + ConfigSetDefaultInt(l_ConfigAudio, "PRIMARY_BUFFER_TARGET", PRIMARY_BUFFER_TARGET, "Fullness level target for Primary audio buffer, in equivalent output samples"); + ConfigSetDefaultInt(l_ConfigAudio, "SECONDARY_BUFFER_SIZE", SECONDARY_BUFFER_SIZE, "Size of secondary buffer in output samples. This is SDL's hardware buffer."); + ConfigSetDefaultString(l_ConfigAudio, "RESAMPLE", "trivial", "Audio resampling algorithm. src-sinc-best-quality, src-sinc-medium-quality, src-sinc-fastest, src-zero-order-hold, src-linear, speex-fixed-{10-0}, trivial"); + ConfigSetDefaultInt(l_ConfigAudio, "VOLUME_CONTROL_TYPE", VOLUME_TYPE_SDL, "Volume control type: 1 = SDL (only affects Mupen64Plus output) 2 = OSS mixer (adjusts master PC volume)"); + ConfigSetDefaultInt(l_ConfigAudio, "VOLUME_ADJUST", 5, "Percentage change each time the volume is increased or decreased"); + ConfigSetDefaultInt(l_ConfigAudio, "VOLUME_DEFAULT", 80, "Default volume when a game is started. Only used if VOLUME_CONTROL_TYPE is 1"); + + if (bSaveConfig && ConfigAPIVersion >= 0x020100) + ConfigSaveSection("Audio-SDL"); + + l_PluginInit = 1; + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL PluginShutdown(void) +{ + if (!l_PluginInit) + return M64ERR_NOT_INIT; + + /* reset some local variables */ + l_DebugCallback = NULL; + l_DebugCallContext = NULL; + + /* make sure our buffer is freed */ + if (mixBuffer != NULL) + { + free(mixBuffer); + mixBuffer = NULL; + } + + l_PluginInit = 0; + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL PluginGetVersion(m64p_plugin_type *PluginType, int *PluginVersion, int *APIVersion, const char **PluginNamePtr, int *Capabilities) +{ + /* set version info */ + if (PluginType != NULL) + *PluginType = M64PLUGIN_AUDIO; + + if (PluginVersion != NULL) + *PluginVersion = SDL_AUDIO_PLUGIN_VERSION; + + if (APIVersion != NULL) + *APIVersion = AUDIO_PLUGIN_API_VERSION; + + if (PluginNamePtr != NULL) + *PluginNamePtr = "Mupen64Plus SDL Audio Plugin"; + + if (Capabilities != NULL) + { + *Capabilities = 0; + } + + return M64ERR_SUCCESS; +} + +/* ----------- Audio Functions ------------- */ +EXPORT void CALL AiDacrateChanged( int SystemType ) +{ + int f = GameFreq; + + if (!l_PluginInit) + return; + + switch (SystemType) + { + case SYSTEM_NTSC: + f = 48681812 / (*AudioInfo.AI_DACRATE_REG + 1); + break; + case SYSTEM_PAL: + f = 49656530 / (*AudioInfo.AI_DACRATE_REG + 1); + break; + case SYSTEM_MPAL: + f = 48628316 / (*AudioInfo.AI_DACRATE_REG + 1); + break; + } + InitializeAudio(f); +} + + +EXPORT void CALL AiLenChanged( void ) +{ + unsigned int LenReg; + unsigned char *p; + unsigned int CurrLevel, CurrTime, ExpectedLevel, ExpectedTime; + + if (critical_failure == 1) + return; + if (!l_PluginInit) + return; + + LenReg = *AudioInfo.AI_LEN_REG; + p = AudioInfo.RDRAM + (*AudioInfo.AI_DRAM_ADDR_REG & 0xFFFFFF); + + if (buffer_pos + LenReg < primaryBufferBytes) + { + unsigned int i; + + SDL_LockAudio(); + for ( i = 0 ; i < LenReg ; i += 4 ) + { + + if(SwapChannels == 0) + { + // Left channel + primaryBuffer[ buffer_pos + i ] = p[ i + 2 ]; + primaryBuffer[ buffer_pos + i + 1 ] = p[ i + 3 ]; + + // Right channel + primaryBuffer[ buffer_pos + i + 2 ] = p[ i ]; + primaryBuffer[ buffer_pos + i + 3 ] = p[ i + 1 ]; + } else { + // Left channel + primaryBuffer[ buffer_pos + i ] = p[ i ]; + primaryBuffer[ buffer_pos + i + 1 ] = p[ i + 1 ]; + + // Right channel + primaryBuffer[ buffer_pos + i + 2 ] = p[ i + 2]; + primaryBuffer[ buffer_pos + i + 3 ] = p[ i + 3 ]; + } + } + buffer_pos += i; + SDL_UnlockAudio(); + } + else + { + DebugMessage(M64MSG_WARNING, "AiLenChanged(): Audio buffer overflow."); + } + + /* Now we need to handle synchronization, by inserting time delay to keep the emulator running at the correct speed */ + /* Start by calculating the current Primary buffer fullness in terms of output samples */ + CurrLevel = (unsigned int) (((long long) (buffer_pos/N64_SAMPLE_BYTES) * OutputFreq * 100) / (GameFreq * speed_factor)); + /* Next, extrapolate to the buffer level at the expected time of the next audio callback, assuming that the + buffer is filled at the same rate as the output frequency */ + CurrTime = SDL_GetTicks(); + ExpectedTime = last_callback_ticks + ((1000 * SecondaryBufferSize) / OutputFreq); + ExpectedLevel = CurrLevel; + if (CurrTime < ExpectedTime) + ExpectedLevel += (ExpectedTime - CurrTime) * OutputFreq / 1000; + /* If the expected value of the Primary Buffer Fullness at the time of the next audio callback is more than 10 + milliseconds ahead of our target buffer fullness level, then insert a delay now */ + DebugMessage(M64MSG_VERBOSE, "%03i New audio bytes: %i Time to next callback: %i Current/Expected buffer level: %i/%i", + CurrTime % 1000, LenReg, (int) (ExpectedTime - CurrTime), CurrLevel, ExpectedLevel); + if (ExpectedLevel >= PrimaryBufferTarget + OutputFreq / 100) + { + unsigned int WaitTime = (ExpectedLevel - PrimaryBufferTarget) * 1000 / OutputFreq; + DebugMessage(M64MSG_VERBOSE, " AiLenChanged(): Waiting %ims", WaitTime); + if (l_PausedForSync) + SDL_PauseAudio(0); + l_PausedForSync = 0; + SDL_Delay(WaitTime); + } + /* Or if the expected level of the primary buffer is less than the secondary buffer size + (ie, predicting an underflow), then pause the audio to let the emulator catch up to speed */ + else if (ExpectedLevel < SecondaryBufferSize) + { + DebugMessage(M64MSG_VERBOSE, " AiLenChanged(): Possible underflow at next audio callback; pausing playback"); + if (!l_PausedForSync) + SDL_PauseAudio(1); + l_PausedForSync = 1; + } + /* otherwise the predicted buffer level is within our tolerance, so everything is okay */ + else + { + if (l_PausedForSync) + SDL_PauseAudio(0); + l_PausedForSync = 0; + } +} + +EXPORT int CALL InitiateAudio( AUDIO_INFO Audio_Info ) +{ + if (!l_PluginInit) + return 0; + + AudioInfo = Audio_Info; + return 1; +} + +static int underrun_count = 0; + +#ifdef USE_SRC +static float *_src = NULL; +static unsigned int _src_len = 0; +static float *_dest = NULL; +static unsigned int _dest_len = 0; +static int error; +static SRC_STATE *src_state; +static SRC_DATA src_data; +#endif +#ifdef USE_SPEEX +SpeexResamplerState* spx_state = NULL; +static int error; +#endif + +static int resample(unsigned char *input, int input_avail, int oldsamplerate, unsigned char *output, int output_needed, int newsamplerate) +{ + int *psrc = (int*)input; + int *pdest = (int*)output; + int i = 0, j = 0; + +#ifdef USE_SPEEX + spx_uint32_t in_len, out_len; + if(Resample == RESAMPLER_SPEEX) + { + if(spx_state == NULL) + { + spx_state = speex_resampler_init(2, oldsamplerate, newsamplerate, ResampleQuality, &error); + if(spx_state == NULL) + { + memset(output, 0, output_needed); + return 0; + } + } + speex_resampler_set_rate(spx_state, oldsamplerate, newsamplerate); + in_len = input_avail / 4; + out_len = output_needed / 4; + + if ((error = speex_resampler_process_interleaved_int(spx_state, (const spx_int16_t *)input, &in_len, (spx_int16_t *)output, &out_len))) + { + memset(output, 0, output_needed); + return input_avail; // number of bytes consumed + } + return in_len * 4; + } +#endif +#ifdef USE_SRC + if(Resample == RESAMPLER_SRC) + { + // the high quality resampler needs more input than the samplerate ratio would indicate to work properly + if (input_avail > output_needed * 3 / 2) + input_avail = output_needed * 3 / 2; // just to avoid too much short-float-short conversion time + if (_src_len < input_avail*2 && input_avail > 0) + { + if(_src) free(_src); + _src_len = input_avail*2; + _src = malloc(_src_len); + } + if (_dest_len < output_needed*2 && output_needed > 0) + { + if(_dest) free(_dest); + _dest_len = output_needed*2; + _dest = malloc(_dest_len); + } + memset(_src,0,_src_len); + memset(_dest,0,_dest_len); + if(src_state == NULL) + { + src_state = src_new (ResampleQuality, 2, &error); + if(src_state == NULL) + { + memset(output, 0, output_needed); + return 0; + } + } + src_short_to_float_array ((short *) input, _src, input_avail/2); + src_data.end_of_input = 0; + src_data.data_in = _src; + src_data.input_frames = input_avail/4; + src_data.src_ratio = (float) newsamplerate / oldsamplerate; + src_data.data_out = _dest; + src_data.output_frames = output_needed/4; + if ((error = src_process (src_state, &src_data))) + { + memset(output, 0, output_needed); + return input_avail; // number of bytes consumed + } + src_float_to_short_array (_dest, (short *) output, output_needed/2); + return src_data.input_frames_used * 4; + } +#endif + // RESAMPLE == TRIVIAL + if (newsamplerate >= oldsamplerate) + { + int sldf = oldsamplerate; + int const2 = 2*sldf; + int dldf = newsamplerate; + int const1 = const2 - 2*dldf; + int criteria = const2 - dldf; + for (i = 0; i < output_needed/4; i++) + { + pdest[i] = psrc[j]; + if(criteria >= 0) + { + ++j; + criteria += const1; + } + else criteria += const2; + } + return j * 4; //number of bytes consumed + } + // newsamplerate < oldsamplerate, this only happens when speed_factor > 1 + for (i = 0; i < output_needed/4; i++) + { + j = i * oldsamplerate / newsamplerate; + pdest[i] = psrc[j]; + } + return j * 4; //number of bytes consumed +} + +static void my_audio_callback(void *userdata, unsigned char *stream, int len) +{ + int oldsamplerate, newsamplerate; + + if (!l_PluginInit) + return; + + /* mark the time, for synchronization on the input side */ + last_callback_ticks = SDL_GetTicks(); + + newsamplerate = OutputFreq * 100 / speed_factor; + oldsamplerate = GameFreq; + + if (buffer_pos > (unsigned int) (len * oldsamplerate) / newsamplerate) + { + int input_used; +#if defined(HAS_OSS_SUPPORT) + if (VolumeControlType == VOLUME_TYPE_OSS) + { + input_used = resample(primaryBuffer, buffer_pos, oldsamplerate, stream, len, newsamplerate); + } + else +#endif + { +#if SDL_VERSION_ATLEAST(1,3,0) +#warning Mixing disabled with SDL >= 1.3 because it creates distorted audio + input_used = resample(primaryBuffer, buffer_pos, oldsamplerate, stream, len, newsamplerate); +#else + input_used = resample(primaryBuffer, buffer_pos, oldsamplerate, mixBuffer, len, newsamplerate); + SDL_MixAudio(stream, mixBuffer, len, VolSDL); +#endif + } + memmove(primaryBuffer, &primaryBuffer[input_used], buffer_pos - input_used); + buffer_pos -= input_used; + DebugMessage(M64MSG_VERBOSE, "%03i my_audio_callback: used %i samples", + last_callback_ticks % 1000, len / SDL_SAMPLE_BYTES); + } + else + { + unsigned int SamplesNeeded = (len * oldsamplerate) / (newsamplerate * SDL_SAMPLE_BYTES); + unsigned int SamplesPresent = buffer_pos / N64_SAMPLE_BYTES; + underrun_count++; + DebugMessage(M64MSG_VERBOSE, "%03i Buffer underflow (%i). %i samples present, %i needed", + last_callback_ticks % 1000, underrun_count, SamplesPresent, SamplesNeeded); + memset(stream , 0, len); + } +} +EXPORT int CALL RomOpen(void) +{ + if (!l_PluginInit) + return 0; + + ReadConfig(); + InitializeAudio(GameFreq); + return 1; +} + +static void InitializeSDL(void) +{ + DebugMessage(M64MSG_INFO, "Initializing SDL audio subsystem..."); + + if(SDL_Init(SDL_INIT_AUDIO | SDL_INIT_TIMER) < 0) + { + DebugMessage(M64MSG_ERROR, "Failed to initialize SDL audio subsystem; forcing exit.\n"); + critical_failure = 1; + return; + } + critical_failure = 0; + +} + +static void CreatePrimaryBuffer(void) +{ + unsigned int newPrimaryBytes = (unsigned int) ((long long) PrimaryBufferSize * GameFreq * speed_factor / + (OutputFreq * 100)) * N64_SAMPLE_BYTES; + if (primaryBuffer == NULL) + { + DebugMessage(M64MSG_VERBOSE, "Allocating memory for audio buffer: %i bytes.", newPrimaryBytes); + primaryBuffer = (unsigned char*) malloc(newPrimaryBytes); + memset(primaryBuffer, 0, newPrimaryBytes); + primaryBufferBytes = newPrimaryBytes; + } + else if (newPrimaryBytes > primaryBufferBytes) /* primary buffer only grows; there's no point in shrinking it */ + { + unsigned char *newPrimaryBuffer = (unsigned char*) malloc(newPrimaryBytes); + unsigned char *oldPrimaryBuffer = primaryBuffer; + SDL_LockAudio(); + memcpy(newPrimaryBuffer, oldPrimaryBuffer, primaryBufferBytes); + memset(newPrimaryBuffer + primaryBufferBytes, 0, newPrimaryBytes - primaryBufferBytes); + primaryBuffer = newPrimaryBuffer; + primaryBufferBytes = newPrimaryBytes; + SDL_UnlockAudio(); + free(oldPrimaryBuffer); + } +} + +static void InitializeAudio(int freq) +{ + SDL_AudioSpec *desired, *obtained; + + if(SDL_WasInit(SDL_INIT_AUDIO|SDL_INIT_TIMER) == (SDL_INIT_AUDIO|SDL_INIT_TIMER) ) + { + DebugMessage(M64MSG_VERBOSE, "InitializeAudio(): SDL Audio sub-system already initialized."); + SDL_PauseAudio(1); + SDL_CloseAudio(); + } + else + { + DebugMessage(M64MSG_VERBOSE, "InitializeAudio(): Initializing SDL Audio"); + DebugMessage(M64MSG_VERBOSE, "Primary buffer: %i output samples.", PrimaryBufferSize); + DebugMessage(M64MSG_VERBOSE, "Primary target fullness: %i output samples.", PrimaryBufferTarget); + DebugMessage(M64MSG_VERBOSE, "Secondary buffer: %i output samples.", SecondaryBufferSize); + InitializeSDL(); + } + if (critical_failure == 1) + return; + GameFreq = freq; // This is important for the sync + if(hardware_spec != NULL) free(hardware_spec); + + // Allocate space for SDL_AudioSpec + desired = malloc(sizeof(SDL_AudioSpec)); + obtained = malloc(sizeof(SDL_AudioSpec)); + + if(freq < 11025) OutputFreq = 11025; + else if(freq < 22050) OutputFreq = 22050; + else OutputFreq = 44100; + + desired->freq = OutputFreq; + + DebugMessage(M64MSG_VERBOSE, "Requesting frequency: %iHz.", desired->freq); + /* 16-bit signed audio */ + desired->format=AUDIO_S16SYS; + DebugMessage(M64MSG_VERBOSE, "Requesting format: %i.", desired->format); + /* Stereo */ + desired->channels=2; + /* reload these because they gets re-assigned from SDL data below, and InitializeAudio can be called more than once */ + PrimaryBufferSize = ConfigGetParamInt(l_ConfigAudio, "PRIMARY_BUFFER_SIZE"); + PrimaryBufferTarget = ConfigGetParamInt(l_ConfigAudio, "PRIMARY_BUFFER_TARGET"); + SecondaryBufferSize = ConfigGetParamInt(l_ConfigAudio, "SECONDARY_BUFFER_SIZE"); + desired->samples = SecondaryBufferSize; + /* Our callback function */ + desired->callback = my_audio_callback; + desired->userdata = NULL; + + /* Open the audio device */ + l_PausedForSync = 1; + if (SDL_OpenAudio(desired, obtained) < 0) + { + DebugMessage(M64MSG_ERROR, "Couldn't open audio: %s", SDL_GetError()); + critical_failure = 1; + return; + } + if (desired->format != obtained->format) + { + DebugMessage(M64MSG_WARNING, "Obtained audio format differs from requested."); + } + if (desired->freq != obtained->freq) + { + DebugMessage(M64MSG_WARNING, "Obtained frequency differs from requested."); + } + + /* desired spec is no longer needed */ + free(desired); + hardware_spec=obtained; + + /* allocate memory for audio buffers */ + OutputFreq = hardware_spec->freq; + SecondaryBufferSize = hardware_spec->samples; + if (PrimaryBufferTarget < SecondaryBufferSize) + PrimaryBufferTarget = SecondaryBufferSize; + if (PrimaryBufferSize < PrimaryBufferTarget) + PrimaryBufferSize = PrimaryBufferTarget; + if (PrimaryBufferSize < SecondaryBufferSize * 2) + PrimaryBufferSize = SecondaryBufferSize * 2; + CreatePrimaryBuffer(); + if (mixBuffer != NULL) + free(mixBuffer); + mixBuffer = (unsigned char*) malloc(SecondaryBufferSize * SDL_SAMPLE_BYTES); + + /* preset the last callback time */ + if (last_callback_ticks == 0) + last_callback_ticks = SDL_GetTicks(); + + DebugMessage(M64MSG_VERBOSE, "Frequency: %i", hardware_spec->freq); + DebugMessage(M64MSG_VERBOSE, "Format: %i", hardware_spec->format); + DebugMessage(M64MSG_VERBOSE, "Channels: %i", hardware_spec->channels); + DebugMessage(M64MSG_VERBOSE, "Silence: %i", hardware_spec->silence); + DebugMessage(M64MSG_VERBOSE, "Samples: %i", hardware_spec->samples); + DebugMessage(M64MSG_VERBOSE, "Size: %i", hardware_spec->size); + + /* set playback volume */ +#if defined(HAS_OSS_SUPPORT) + if (VolumeControlType == VOLUME_TYPE_OSS) + { + VolPercent = volGet(); + } + else +#endif + { + VolSDL = SDL_MIX_MAXVOLUME * VolPercent / 100; + } + +} +EXPORT void CALL RomClosed( void ) +{ + if (!l_PluginInit) + return; + if (critical_failure == 1) + return; + DebugMessage(M64MSG_VERBOSE, "Cleaning up SDL sound plugin..."); + + // Shut down SDL Audio output + SDL_PauseAudio(1); + SDL_CloseAudio(); + + // Delete the buffer, as we are done producing sound + if (primaryBuffer != NULL) + { + primaryBufferBytes = 0; + free(primaryBuffer); + primaryBuffer = NULL; + } + if (mixBuffer != NULL) + { + free(mixBuffer); + mixBuffer = NULL; + } + + // Delete the hardware spec struct + if(hardware_spec != NULL) free(hardware_spec); + hardware_spec = NULL; + + // Shutdown the respective subsystems + if(SDL_WasInit(SDL_INIT_AUDIO) != 0) SDL_QuitSubSystem(SDL_INIT_AUDIO); + if(SDL_WasInit(SDL_INIT_TIMER) != 0) SDL_QuitSubSystem(SDL_INIT_TIMER); +} + +EXPORT void CALL ProcessAList(void) +{ +} + +EXPORT void CALL SetSpeedFactor(int percentage) +{ + if (!l_PluginInit) + return; + if (percentage >= 10 && percentage <= 300) + speed_factor = percentage; + // we need a different size primary buffer to store the N64 samples when the speed changes + CreatePrimaryBuffer(); +} + +static void ReadConfig(void) +{ + const char *resampler_id; + + /* read the configuration values into our static variables */ + GameFreq = ConfigGetParamInt(l_ConfigAudio, "DEFAULT_FREQUENCY"); + SwapChannels = ConfigGetParamBool(l_ConfigAudio, "SWAP_CHANNELS"); + PrimaryBufferSize = ConfigGetParamInt(l_ConfigAudio, "PRIMARY_BUFFER_SIZE"); + PrimaryBufferTarget = ConfigGetParamInt(l_ConfigAudio, "PRIMARY_BUFFER_TARGET"); + SecondaryBufferSize = ConfigGetParamInt(l_ConfigAudio, "SECONDARY_BUFFER_SIZE"); + resampler_id = ConfigGetParamString(l_ConfigAudio, "RESAMPLE"); + VolumeControlType = ConfigGetParamInt(l_ConfigAudio, "VOLUME_CONTROL_TYPE"); + VolDelta = ConfigGetParamInt(l_ConfigAudio, "VOLUME_ADJUST"); + VolPercent = ConfigGetParamInt(l_ConfigAudio, "VOLUME_DEFAULT"); + + if (!resampler_id) { + Resample = RESAMPLER_TRIVIAL; + DebugMessage(M64MSG_WARNING, "Could not find RESAMPLE configuration; use trivial resampler"); + return; + } + if (strcmp(resampler_id, "trivial") == 0) { + Resample = RESAMPLER_TRIVIAL; + return; + } +#ifdef USE_SPEEX + if (strncmp(resampler_id, "speex-fixed-", strlen("speex-fixed-")) == 0) { + int i; + static const char *speex_quality[] = { + "speex-fixed-0", + "speex-fixed-1", + "speex-fixed-2", + "speex-fixed-3", + "speex-fixed-4", + "speex-fixed-5", + "speex-fixed-6", + "speex-fixed-7", + "speex-fixed-8", + "speex-fixed-9", + "speex-fixed-10", + }; + Resample = RESAMPLER_SPEEX; + for (i = 0; i < sizeof(speex_quality) / sizeof(*speex_quality); i++) { + if (strcmp(speex_quality[i], resampler_id) == 0) { + ResampleQuality = i; + return; + } + } + DebugMessage(M64MSG_WARNING, "Unknown RESAMPLE configuration %s; use speex-fixed-4 resampler", resampler_id); + ResampleQuality = 4; + return; + } +#endif +#ifdef USE_SRC + if (strncmp(resampler_id, "src-", strlen("src-")) == 0) { + Resample = RESAMPLER_SRC; + if (strcmp(resampler_id, "src-sinc-best-quality") == 0) { + ResampleQuality = SRC_SINC_BEST_QUALITY; + return; + } + if (strcmp(resampler_id, "src-sinc-medium-quality") == 0) { + ResampleQuality = SRC_SINC_MEDIUM_QUALITY; + return; + } + if (strcmp(resampler_id, "src-sinc-fastest") == 0) { + ResampleQuality = SRC_SINC_FASTEST; + return; + } + if (strcmp(resampler_id, "src-zero-order-hold") == 0) { + ResampleQuality = SRC_ZERO_ORDER_HOLD; + return; + } + if (strcmp(resampler_id, "src-linear") == 0) { + ResampleQuality = SRC_LINEAR; + return; + } + DebugMessage(M64MSG_WARNING, "Unknown RESAMPLE configuration %s; use src-sinc-medium-quality resampler", resampler_id); + ResampleQuality = SRC_SINC_MEDIUM_QUALITY; + return; + } +#endif + DebugMessage(M64MSG_WARNING, "Unknown RESAMPLE configuration %s; use trivial resampler", resampler_id); + Resample = RESAMPLER_TRIVIAL; +} + +// Returns the most recent ummuted volume level. +static int VolumeGetUnmutedLevel(void) +{ +#if defined(HAS_OSS_SUPPORT) + // reload volume if we're using OSS + if (!VolIsMuted && VolumeControlType == VOLUME_TYPE_OSS) + { + return volGet(); + } +#endif + + return VolPercent; +} + +// Sets the volume level based on the contents of VolPercent and VolIsMuted +static void VolumeCommit(void) +{ + int levelToCommit = VolIsMuted ? 0 : VolPercent; + +#if defined(HAS_OSS_SUPPORT) + if (VolumeControlType == VOLUME_TYPE_OSS) + { + //OSS mixer volume + volSet(levelToCommit); + } + else +#endif + { + VolSDL = SDL_MIX_MAXVOLUME * levelToCommit / 100; + } +} + +EXPORT void CALL VolumeMute(void) +{ + if (!l_PluginInit) + return; + + // Store the volume level in order to restore it later + if (!VolIsMuted) + VolPercent = VolumeGetUnmutedLevel(); + + // Toogle mute + VolIsMuted = !VolIsMuted; + VolumeCommit(); +} + +EXPORT void CALL VolumeUp(void) +{ + if (!l_PluginInit) + return; + + VolumeSetLevel(VolumeGetUnmutedLevel() + VolDelta); +} + +EXPORT void CALL VolumeDown(void) +{ + if (!l_PluginInit) + return; + + VolumeSetLevel(VolumeGetUnmutedLevel() - VolDelta); +} + +EXPORT int CALL VolumeGetLevel(void) +{ + return VolIsMuted ? 0 : VolumeGetUnmutedLevel(); +} + +EXPORT void CALL VolumeSetLevel(int level) +{ + if (!l_PluginInit) + return; + + //if muted, unmute first + VolIsMuted = 0; + + // adjust volume + VolPercent = level; + if (VolPercent < 0) + VolPercent = 0; + else if (VolPercent > 100) + VolPercent = 100; + + VolumeCommit(); +} + +EXPORT const char * CALL VolumeGetString(void) +{ + static char VolumeString[32]; + + if (VolIsMuted) + { + strcpy(VolumeString, "Mute"); + } + else + { + sprintf(VolumeString, "%i%%", VolPercent); + } + + return VolumeString; +} + diff --git a/libmupen64plus/mupen64plus-audio-sdl/src/main.h b/libmupen64plus/mupen64plus-audio-sdl/src/main.h new file mode 100644 index 0000000000..c46bdc3c39 --- /dev/null +++ b/libmupen64plus/mupen64plus-audio-sdl/src/main.h @@ -0,0 +1,48 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - main.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2008-2012 Tillin9, Richard42 * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* version info */ +#define SDL_AUDIO_PLUGIN_VERSION 0x016305 +#define AUDIO_PLUGIN_API_VERSION 0x020000 +#define CONFIG_API_VERSION 0x020100 +#define CONFIG_PARAM_VERSION 1.00 + +#define VERSION_PRINTF_SPLIT(x) (((x) >> 16) & 0xffff), (((x) >> 8) & 0xff), ((x) & 0xff) + +/* declarations of pointers to Core config functions */ +extern ptr_ConfigListSections ConfigListSections; +extern ptr_ConfigOpenSection ConfigOpenSection; +extern ptr_ConfigDeleteSection ConfigDeleteSection; +extern ptr_ConfigSaveSection ConfigSaveSection; +extern ptr_ConfigListParameters ConfigListParameters; +extern ptr_ConfigSaveFile ConfigSaveFile; +extern ptr_ConfigSetParameter ConfigSetParameter; +extern ptr_ConfigGetParameter ConfigGetParameter; +extern ptr_ConfigGetParameterHelp ConfigGetParameterHelp; +extern ptr_ConfigSetDefaultInt ConfigSetDefaultInt; +extern ptr_ConfigSetDefaultFloat ConfigSetDefaultFloat; +extern ptr_ConfigSetDefaultBool ConfigSetDefaultBool; +extern ptr_ConfigSetDefaultString ConfigSetDefaultString; +extern ptr_ConfigGetParamInt ConfigGetParamInt; +extern ptr_ConfigGetParamFloat ConfigGetParamFloat; +extern ptr_ConfigGetParamBool ConfigGetParamBool; +extern ptr_ConfigGetParamString ConfigGetParamString; + diff --git a/libmupen64plus/mupen64plus-audio-sdl/src/osal_dynamiclib.h b/libmupen64plus/mupen64plus-audio-sdl/src/osal_dynamiclib.h new file mode 100644 index 0000000000..daef1541c0 --- /dev/null +++ b/libmupen64plus/mupen64plus-audio-sdl/src/osal_dynamiclib.h @@ -0,0 +1,30 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - osal/dynamiclib.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#if !defined(OSAL_DYNAMICLIB_H) +#define OSAL_DYNAMICLIB_H + +#include "m64p_types.h" + +void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName); + +#endif /* #define OSAL_DYNAMICLIB_H */ + diff --git a/libmupen64plus/mupen64plus-audio-sdl/src/osal_dynamiclib_unix.c b/libmupen64plus/mupen64plus-audio-sdl/src/osal_dynamiclib_unix.c new file mode 100644 index 0000000000..b3b7ba52dc --- /dev/null +++ b/libmupen64plus/mupen64plus-audio-sdl/src/osal_dynamiclib_unix.c @@ -0,0 +1,37 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - osal/dynamiclib_unix.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include + +#include "m64p_types.h" +#include "osal_dynamiclib.h" + +void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName) +{ + if (pccProcedureName == NULL) + return NULL; + + return dlsym(LibHandle, pccProcedureName); +} + + diff --git a/libmupen64plus/mupen64plus-audio-sdl/src/osal_dynamiclib_win32.c b/libmupen64plus/mupen64plus-audio-sdl/src/osal_dynamiclib_win32.c new file mode 100644 index 0000000000..4455cee52b --- /dev/null +++ b/libmupen64plus/mupen64plus-audio-sdl/src/osal_dynamiclib_win32.c @@ -0,0 +1,74 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-ui-console - osal_dynamiclib_win32.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include + +#include "m64p_types.h" +#include "osal_dynamiclib.h" + +m64p_error osal_dynlib_open(m64p_dynlib_handle *pLibHandle, const char *pccLibraryPath) +{ + if (pLibHandle == NULL || pccLibraryPath == NULL) + return M64ERR_INPUT_ASSERT; + + *pLibHandle = LoadLibrary(pccLibraryPath); + + if (*pLibHandle == NULL) + { + char *pchErrMsg; + DWORD dwErr = GetLastError(); + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pchErrMsg, 0, NULL); + fprintf(stderr, "LoadLibrary('%s') error: %s\n", pccLibraryPath, pchErrMsg); + LocalFree(pchErrMsg); + return M64ERR_INPUT_NOT_FOUND; + } + + return M64ERR_SUCCESS; +} + +void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName) +{ + if (pccProcedureName == NULL) + return NULL; + + return GetProcAddress(LibHandle, pccProcedureName); +} + +m64p_error osal_dynlib_close(m64p_dynlib_handle LibHandle) +{ + int rval = FreeLibrary(LibHandle); + + if (rval == 0) + { + char *pchErrMsg; + DWORD dwErr = GetLastError(); + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pchErrMsg, 0, NULL); + fprintf(stderr, "FreeLibrary() error: %s\n", pchErrMsg); + LocalFree(pchErrMsg); + return M64ERR_INTERNAL; + } + + return M64ERR_SUCCESS; +} diff --git a/libmupen64plus/mupen64plus-audio-sdl/src/volume.c b/libmupen64plus/mupen64plus-audio-sdl/src/volume.c new file mode 100644 index 0000000000..1c6e25cda6 --- /dev/null +++ b/libmupen64plus/mupen64plus-audio-sdl/src/volume.c @@ -0,0 +1,88 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-sdl-audio - volume.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2007-2008 Richard42 Ebenblues * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#if defined(HAS_OSS_SUPPORT) + +/* Sound volume functions. */ +#include +#include +#include +#include +#include /* close() */ +#include +#include +#include + +#include "volume.h" + +/* volSet + * Sets volume of left and right PCM channels to given percentage (0-100) value. + */ +void volSet(int percent) +{ + int ret, vol; + int mixerfd = open("/dev/mixer", O_RDONLY); + + if(mixerfd < 0) + { + perror("/dev/mixer"); + return; + } + + if(percent > 100) + percent = 100; + else if(percent < 0) + percent = 0; + + vol = (percent << 8) + percent; // set both left/right channels to same vol + ret = ioctl(mixerfd, MIXER_WRITE(SOUND_MIXER_PCM), &vol); + if(ret < 0) + perror("Setting PCM volume"); + + close(mixerfd); +} + +/* volGet + * Returns volume of PCM channel as a percentage (0-100). + * Returns 0 on error. + */ +int volGet(void) +{ + int vol, ret; + int mixerfd = open("/dev/mixer", O_RDONLY); + + if(mixerfd < 0) + { + perror("/dev/mixer"); + return 0; + } + + ret = ioctl(mixerfd, MIXER_READ(SOUND_MIXER_PCM), &vol); + if(ret < 0) + perror("Reading PCM volume"); + + close(mixerfd); + + return vol & 0xff; // just return the left channel +} + +#endif /* defined(HAS_OSS_SUPPORT) */ diff --git a/libmupen64plus/mupen64plus-audio-sdl/src/volume.h b/libmupen64plus/mupen64plus-audio-sdl/src/volume.h new file mode 100644 index 0000000000..c1179cf4c9 --- /dev/null +++ b/libmupen64plus/mupen64plus-audio-sdl/src/volume.h @@ -0,0 +1,33 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - nogui.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2007-2008 Richard42 Ebenblues * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* Sound volume functions. + */ + +#ifndef __VOLUME_H__ +#define __VOLUME_H__ + +void volSet(int); +int volGet(void); + +#endif // __VOLUME_H__ + diff --git a/libmupen64plus/mupen64plus-core/INSTALL b/libmupen64plus/mupen64plus-core/INSTALL new file mode 100644 index 0000000000..1101a6ea34 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/INSTALL @@ -0,0 +1,26 @@ +Mupen64Plus-Core INSTALL +------------------------ + +This text file was written to explain the installation process of the +Mupen64Plus-Core module. + +If this module is part of a Mupen64Plus source code bundle, the user should run +the "m64p_install.sh" script in the root of the unzipped bundle to install all +of the included modules in the bundle. + +If this module is a standalone source code release, you should build the library +from source code and install it via the makefile, like this: + +$ cd projects/unix +$ make all +$ sudo make install + +If you want to build the Mupen64Plus-Core module for installation in a home +folder for a single user, you may build it like this (replacing +with your desired local installation path): + +$ cd projects/unix +$ make all SHAREDIR= +$ make install LIBDIR= SHAREDIR= + + diff --git a/libmupen64plus/mupen64plus-core/LICENSES b/libmupen64plus/mupen64plus-core/LICENSES new file mode 100644 index 0000000000..4e9f0affba --- /dev/null +++ b/libmupen64plus/mupen64plus-core/LICENSES @@ -0,0 +1,48 @@ +Mupen64Plus-Core LICENSES +------------------------- + +Mupen64Plus-Core is licensed under the GNU General Public License version 2. Please see the +included doc/gpl-license file for the terms and conditions of the GNU General Public License. +The authors of Mupen64Plus are: + * Richard Goedeken (Richard42) + * John Chadwick (NMN) + * James Hood (Ebenblues) + * Scott Gorman (okaygo) + * Scott Knauert (Tillin9) + * Jesse Dean (DarkJezter) + * Louai Al-Khanji (slougi) + * Bob Forder (orbitaldecay) + * Jason Espinosa (hasone) + * HyperHacker + * and others. + +The Mupen64Plus API documentation (located in doc/emuwiki-api-doc/*) is Copyright(C) 2009-2011 +by Richard Goedeken and is licensed under the GNU General Public License version 2. + +Mupen64Plus is based on GPL-licensed source code from Mupen64 v0.5, originally written by: + * Hacktarux + * Dave2001 + * Zilmar + * Gregor Anich (Blight) + * Juha Luotio (JttL) + * and others. + +The OGLFT library used for the On-Screen Display is based on GPL/LGPL-licensed code Copyright 2002 lignum Computing. Please see the included doc/lgpl-license file for the terms and conditions of the GNU Lesser General Public License. More information about this library is available at the following websites: + - http://oglft.sourceforge.net/index.html + - http://directory.fsf.org/project/OGLFT/ + +Additionally, mupen includes a number of components licensed under other OSI approved licenses: + +The BSD license: + * minizip by Gilles Vollant and others, ftp://ftp.info-zip.org/pub/infozip/license.html + * src/memory/n64_cic_nus_6105.c/.h, by X-Scale + +The zlib/libpng license: + * Adler-32 by Mark Adler + * libpng by Glenn Randers-Pehrson, Peter Deutsch, and Guy Eric Schalnat + * MD5 hasing code by Peter Deutsch + +The Bitstream license: + * The TrueType font (data/font.ttf) is licensed by the Bitstream license. Please see the included doc/font-license file for the terms and conditions of the Bitstream license. + + diff --git a/libmupen64plus/mupen64plus-core/README b/libmupen64plus/mupen64plus-core/README new file mode 100644 index 0000000000..6679b4603b --- /dev/null +++ b/libmupen64plus/mupen64plus-core/README @@ -0,0 +1,146 @@ +Mupen64Plus-Core README +----------------------- + +The most current version of this README and more documentation can be found on +the Mupen64Plus wiki: + +http://code.google.com/p/mupen64plus/wiki/README + +Mupen64Plus is based off of mupen64, originally created by Hacktarux. This +package contains the only the Mupen64Plus core library. For a fully functional +emulator, the user must also install graphics, sound, input, and RSP plugins, +as well as a user interface program (called a front-end). + +README Sections + 1. Requirements for building or running Mupen64Plus + 2. Building From Source + 3. Installation + 4. Key Commands In Emulator + +1. Requirements and Pre-requisites +---------------------------------- + +*Binary Package Requirements* + + - SDL 1.2 + - libpng + - freetype 2 + - zlib + +*Source Build Requirements* + +In addition to the binary libraries, the following packages are required if you +build Mupen64Plus from source: + + - GNU C and C++ compiler, libraries, and headers + - GNU make + - Development packages for all the libraries above + +2. Building From Source +----------------------- + +If you downloaded the binary distribution of Mupen64Plus, skip to the +Installation section. To build the source distribution, unzip and cd into the +projects/unix directory, then build using make: + + $ unzip mupen64plus-core-x-y-z-src.zip + $ cd mupen64plus-core-x-y-z-src/projects/unix + $ make all + +Type 'make' by itself to view all available build options: + + $ make + Mupen64Plus makefile. + Targets: + all == Build Mupen64Plus and all plugins + clean == remove object files + install == Install Mupen64Plus and all plugins + uninstall == Uninstall Mupen64Plus and all plugins + Options: + BITS=32 == build 32-bit binaries on 64-bit machine + LIRC=1 == enable LIRC support + NO_ASM=1 == build without assembly (no dynamic recompiler or MMX/SSE code) + SHAREDIR=path == extra path to search for shared data files + OPTFLAGS=flag == compiler optimization (default: -O3) + PIC=(1|0) == Force enable/disable of position independent code + Install Options: + PREFIX=path == install/uninstall prefix (default: /usr/local/) + SHAREDIR=path == path to install shared data (default: PREFIX/share/mupen64plus/) + LIBDIR=path == path to install plugin libs (default: PREFIX/lib) + INCDIR=path == path to install core header files (default: PREFIX/include/mupen64plus) + DESTDIR=path == path to prepend to all installation paths (only for packagers) + Debugging Options: + PROFILE=1 == build gprof instrumentation into binaries for profiling + DEBUG=1 == add debugging symbols to binaries + DEBUGGER=1 == build graphical debugger + DBG_CORE=1 == print debugging info in r4300 core + DBG_COUNT=1 == print R4300 instruction count totals (64-bit dynarec only) + DBG_COMPARE=1 == enable core-synchronized r4300 debugging + DBG_PROFILE=1 == dump profiling data for r4300 dynarec to data file + V=1 == show verbose compiler output + +3. Installation +--------------- + +*Binary Distribution* + +To install the binary distribution of Mupen64Plus, su to root and run the +provided install.sh script: + + $ su + # ./install.sh + # exit + $ + +The install script will copy the executable to /usr/local/bin and a directory +called /usr/local/share/mupen64plus will be created to hold plugins and other +files used by mupen64plus. + +NOTE: By default, install.sh uses /usr/local for the install prefix. Although +the user can specify an alternate prefix to install.sh at the commandline, the +mupen64plus binary was compiled to look for the install directory in /usr/local, +so specifying an alternate prefix to install.sh will cause problems (mupen64plus +will not find the install directory). If you want to use a prefix other than +/usr/local, you will have to download the source package and build with the +PREFIX option (see below). + +*Source Distribution* + +After building mupen64plus and all plugins, su to root and type 'make install' +to install Mupen64Plus. The install process will copy the executable to +$PREFIX/bin and a directory called $PREFIX/share/mupen64plus will be created +to hold plugins and other files used by mupen64plus. By default, PREFIX is set +to /usr/local. This can be changed by passing the PREFIX option to make. NOTE: +you must pass the prefix, when building AND installing. For example, to install +mupen64plus to /usr, do this: + + $ make all + $ sudo make PREFIX=/usr install + $ + +4. Key Commands In Emulator +--------------------------- +The keys or joystick/mouse inputs which will be mapped to the N64 controller +for playing the games are determined by the input plugin. The emulator core +also supports several key commands during emulation, which may be configured by +editing the ~/.config/mupen64plus/mupen64plus.cfg file. They are: + + Escape == Quit the emulator + 0-9 == Select virtual 'slot' for save/load state (F5 and F7) commands + F5 == Save emulator state + F7 == Load emulator state + F9 == Reset emulator + F10 == slow down emulator by 5% + F11 == speed up emulator by 5% + F12 == take screenshot +Alt-Enter == Toggle between windowed and fullscreen (may not be supported by all video plugins) + p or P == Pause on/off + m or M == Mute/unmute sound + g or G == Press "Game Shark" button (only if cheats are enabled) + / or ? == single frame advance while paused + F == Fast Forward (playback at 250% normal speed while F key is pressed) + [ == Decrease volume + ] == Increase volume + + + diff --git a/libmupen64plus/mupen64plus-core/RELEASE b/libmupen64plus/mupen64plus-core/RELEASE new file mode 100644 index 0000000000..6ecd337c1d --- /dev/null +++ b/libmupen64plus/mupen64plus-core/RELEASE @@ -0,0 +1,572 @@ +Mupen64Plus-Core Emulator Library RELEASE +----------------------------------------- + +Mupen64Plus v1.99.5 - March 10, 2012 +------------------------------------ + - New feature: support for N64 internal real-time clock + - use X-Scale's PIF-CIC algorithm instead of the hard-coded challenge-response pairs + - New config parameter for path to save SRAM/EEPROM/MPK files, so they can be separated from emulator snapshots + - updated core for new Mupen64plus 2.0 API versioning scheme + - split core configuration data into 2 sections: Core and CoreEvents. Added version numbers and upgrade handling to both + - Accurately emulate the RSP DMA operation (from Bobby Smiles) + - bugfix: #290 - OnScreenDisplay text is sometimes captured in screenshots + - bugfix: when the front-end specifies an override for the configuration directory, always use this path, so that we don't load the config from there and then save it back to the default user path + - bugfix: #468 - On-screen-display problem under OSX + - bugfix: Use option SaveStatePath from config file + - bugfix: don't call SDL_Quit() until the core library is being unloaded. fixes some front-end use cases + - bugfix: #410 - segfault in dma_pi_write()-->strlen() if /home/username/.local/share/mupen64plus/ owned by root + - bugfix: for Interpreter cores, use proper math functions for ceil/floor/round/trunc instead of x87 rounding modes + - many makefile fixes and improvements + +Mupen64Plus v1.99.4 - February 22, 2010 +--------------------------------------- + - Added some type checking to ConfigGetParameter() function, and a new error type + - Bugfix: avoid segfault in the video extension code if SDL initialization fails (because video plugin fails) + - Added new CoreGetRomSettings() function for front-ends + - Allow to run dynarec in hardware DEP protected windows + - Allow core .cfg parser to accept strings without quotes around them + - API change: use new ReadScreen2() video plugin function + - New re-entrant R4300 disassembler, from tty68k/zzt32, a man who loves MIPS processors + - makefile fixes and improvements, code cleanups + +Mupen64Plus v1.99.3 - February 13, 2010 +--------------------------------------- + - New feature: configuration function ConfigGetParameterType() + - New feature: up to 1000 screenshots per ROM are allowed + - New feature: support for Gameshark 3.3 patch codes + - Bugfix: Use Dynarec by default when core supports it. If dynarec is selected but unavailable, fall back to cached interpreter + - Bugfix: screenshot directory handling code used unix-specific path separators; now is platform-independent + - Bugfix: #313 - 64-bit inline assembly code in r4300/x86_64/rjump.c needs to have underscores before the symbols names in OSX + - Bugfix: old bug in the core - hang if a ROM *without* a 16kb EEPROM type is loaded after a ROM *with* a 16kb EEPROM type + - Bugfix: rumble feature caused memory corruption + - Bugfix: Problem with zilmar API: the plugin RomOpen() functions had no way of returning errors to the core, causing crashes + - Replaced api documentation .tar.gz file with the mediawiki text + - Build script improvements: + - new feature: m64p_update.sh script can take an input argument to update to a tag or revision + - new feature: added bash script for building source packages of individual modules + - Makefile improvements: + - dont run ldconfig on make install unless user is root + - added OS type GNU/kFreeBSD + +Mupen64Plus v1.99.2 - January 6, 2010 +--------------------------------------- + - doc: added tarball of emuwiki api documentation from 2010-01-06 for backup purposes + - clean-up: removed almost all of the ifdef WIN32 statements + - bugfix: stop spamming console with "Core: couldn't open memory pack file '...' for reading" messages + - bugfix: stop spamming console with "Core: couldn't open eeprom file '...' for reading" messages + - new feature: MSVC8 project file for mupen64plus-core, refactored code for VC8 compatibility + - Makefile improvements: + - throw error if OS/CPU not supported + - use DESTDIR in install/uninstall paths + - Allow user-specified CC/CXX/LD paths + - makefile needs to install Core header files so that plugins can be built later + +Mupen64Plus v1.99.1 - December 14, 2009 +--------------------------------------- +New 2.0 architecture advantages: + - Simplified emulator Core, making it much more portable + - Removed all GUI code from plugins, making them simpler and more portable + - User interface development is not tied to Core emulator releases + - All messages from core/plugins can be filtered and shown in GUI instead of only on console + - Video Extension allows Front-end to override some video functions, ie to support embedded render window + - Startup in Fullscreen mode, instead of always starting in windowed mode and switching to FS after few seconds + - video resolution can be given via command-line parameter + - all configuration options for core and plugins are in a single config file, can be configured with a single GUI + - dummy plugins are automatically used if plugin loading fails for any reason + - core and plugins all use the same conventions for where to put data/config files +Mupen64Plus core: + - New feature: cheat code support + - New feature: Keyboard shortcuts for Core commands are now user-configurable + - New feature: can load/save PJ64 state files + - Major code cleanup, refactored build system to separate source and object files + - Removed many dependencies to simplify porting to other platforms + - Moved all of the SDL event-related stuff into a new source file eventloop.c + - Use XDG directory convention for file locations on Unix + - bugfix: frame advance feature should advance every frame, instead of every vertical interrupt (every field) + - bugfix: allow diagonal hat movements for core joystick commands + - bugfix: modified SDL event loop joystick code so that gameshark button press is captured, and joystick commands that are level-triggered instead of edge-triggered (such as fast foward) can be accommodated + - bugfix: fixed the outstanding SDL event issues by re-writing the code which handles the joystick-event-driven core commands. Now the axis-based commands use hysteresis and there is a single global event function for determining if the gameshark button is pressed + - bugfix: OSD crash after pause-stop-start-pause of emulator + - bugfix: Set video width and status, aiDacrate during savestate load + - bugfix: in pure interpreter, Dont allow to override r0 register + - bugfix #52: PJ64 load state patch from olejl77 + - bugfix #268: use aligned malloc and mprotect to set executable status for dynarec emitted code + - bugfix #51: Floating Point Register data was not correctly converted when switching between 32-bit (MIPS-I) mode and 64-bit (MIPS III). + New code more closely emulates behavior of r4300 hardware. Fixes collision problems in Banjo-Tooie + - bugfix #272: rounding mode for x86 FPU not being set correctly in interpreter and pure interpreter cores + - bugfix: many games need different ScreenUpdateSetting to work properly with Rice Video + + +Mupen64Plus v1.5 - January 4, 2009 +---------------------------------- +Major New Features: + - support for Macintosh OSX platform with Intel CPUs + - Qt4 GUI by slougi, Tillin9, and others + - Rom Cache System (r636, others), by Tillin9, Okaygo, and Hasone. +Minor New Features: + - r1235: Debugger: memory breakpoint speedup + - r1170-1178,1181: QT GUI: translations for English, Norwegian, German, and Dutch + - r1155: Use configurable key commands for special emulator functions + - r1134: got our own custom test ROM, courtesy of Marshallh + - r1046: debugger: new r4300 disassembler from ZZT32 + - r829: jttl_audio: added GTK GUI configuration dialog + - r793: soft reset (hit F9) + - r782: jttl_audio: both SDL-based and OSS-based volume control methods are now supported + - r765: added savestate conversion tool to be able to load pre-v1.5 savestate files + - r711: 7-zip support + - r692: Multi-file Zip support + - r667: GTK GUI: user-configurable columns in ROM browser + - r659: LZMA archive support + - r638: BZip2 archive support + - r629,634: LIRC - added support for speedup, slowdown, pause, and frame advance +Updates: + - r1007,1032: GTK GUI improvements + - r970, 1019: use SDL threading support instead of pthreads + - r935,938,940: Gtk GUI updates for core and Jttl + - r642,655-657,663,664,747,759,761-763,768-770,774,775,780,781,783,786,787,825,828,931: mupen64plus.ini updates: Good Names, stars, EEPROM types, players, rumble support +Bugfixes: + - r1247: rsp_hle: memory overwrite bug with Zelda:OOT + - r1234: out of bound array bug in memory access function handlers + - r1222,1223,1228,1229: Debugger fixes + - r1183: Blight Input: sometimes the axis direction would flip + - r1133: Added stop rumble to load savestate, fixes issue 165 + - r1077: GTK GUI bugfixes + - r1063: rice video: crash in MMX/SSE checking functions + - r800: logical error in strcpy loop in util.c + - r798: small bugfixes in blight_input: 1. only save config file after running config dialog, not every time DLL is closed. 2. If rumble is not available on a controller, don't allow user to switch between rumble and mempack. 3. If rumble is selected in config file but not available on a controller, select mempack instead. + - r789: 3 glN64 bugfixes (segfaults on a 64-bit system in Perfect Dark): prevent clamp values from being negative, handle TMEM wrap-arounds from wacky height/line values in texture cache load and texture CRC functions + - r788: rice video: add checks for uint32 height/width parameters which can be negative, causing segfault on 64-bit systems + - r784: 64-bit problem causing GUI crashes - gotta save/restore all the callee-saved registers around the dynarec + - r758: fixed some savestate problems + - r748: Fixed 64-bit dynarec crash in genj_idle() and genjal_idle() + - r715: Bugfixes thanks to Valgrind. Two using strcpy with source and destination overlay, i.e. strcpy(p,p+1) + - r700: set ScreenUpdateSetting=1 in rice video ini file for Conkers BFD + - r694: require bash shell scripting for install.sh + - r686: fixed OSD crash bug after running a game, disabling OSD, then running another game + - r684: OGLFT measuring functions were taking a huge chunk of CPU time. Refactored code to measure only once and store the line size and the message sizes instead of re-measuring all the time. This eliminated nearly all of the OSD overhead on my PC + - r681: Refactored OGLFT to do color setting outside of glyph compiling, so the OSD fading doesnt force bitmaps to be continually recreated with calls to renderGlyph. Seems to have cut the excessive cpu usage of the OSD about by half + - r680: removed many unused classes from OGLFT font library code + - r676: bugfix in my BYTESWAP macros + - r674: Removed glide64/Tmem_nasm.asm source file and the project dependency on nasm/yasm assemblers + - r673: removed inline assembly sections in rdp_loadblock and rdp_loadtile, including their dependency on functions in Tmem_nasm.asm. Replaced with new C code. This fixes a segfault on some 64-bit source builds + - r669: string function causing crash on 64-bit linux + - r667: issue #88 - added basic view menu in GTK GUI + - r628,633: Small patch to get glide64.so to compile with O3 optimizations + - r622: Fixed segfault in Glide64 as per issue 133 + - r619: fix LIRC build to integrate w/ new screenshot mechanism + - r608: another couple of memory leak fixes from Tub, in main/config.c + - r605: fix from Tub for free() bug in main/util.c/list_delete() + - r587: issue #111: close screenshot file after saving + +Mupen64Plus v1.4 - June 14, 2008 +----------------------------------- + - New feature: Graphical debugger for R4300 core + - New feature: On Screen Display + - New feature: KDE4 GUI (experimental) + - New feature: cheat system with Gameshark codes + - New feature: search/filter box in GTK GUI + - New feature: Single frame advance + - New feature: adjust emulator playback speed up or down in 5% increments + - New feature: Rumble Pak support with force feedback + - New feature: Map emulator functions (fullscreen, stop emulation, etc) to joystick buttons or axis movements. + - New feature: Volume up/down + - Blight Input: Individually configure each direction of X and Y axis, which allows inverting the axis + - JTTL_Audio: libsamplerate support for high quality audio resampling + - GTK GUI: Removed second status bar which was not used + - GTK GUI: Implemented accelerator keys + - GTK GUI: Replaced custom directory browser with GTK file chooser + - GTK GUI: numerous small changes and fixes + - Added Mupen64Plus 'man' (manual) page + - Removed mupen64_audio plugin, as it was unnecessary and mostly broken + - Added NoMemoryExpansion parameter to emulate 4MB console; fixes some games + - Overhaul of rom handling functions; numerous small fixes + - Bugfix: Removed NoAudioDelay core option to resolve issue #48 + - Bugfix: check for stopped state in dynarec jump function, to fix unresponsive emulator when game gets stuck in loop + - Bugfix: GTK GUI: #6 - if a ROM is selected in the ROM browser and 'play' is pressed, emulation will start + - Bugfix: GTK GUI: #62 - ROM browser column sorting works + - Bugfix: Rice Video: Support hi-res textures with different scale factors for X and Y + - Bugfix: Blight Input: don't use 100% CPU in configuration dialog + +Mupen64Plus v1.3 - March 29th, 2008 +----------------------------------- + - New feature: Glide64 video plugin for 32-bit and 64-bit, renamed project Mupen64Plus + - New feature: Combine mupen64 and mupen64_nogui into a single binary + - New feature: ability to change icon size + - New feature: support different directories for install (plugins, icons, etc) and config (save games, config files) + - New feature: support for creating/using ~/.mupen64plus dir for storing user data + - New feature: support for installation via "make install" or "./install.sh" + - New feature: support for plugins given via command line option in GUI mode + - New feature: config dialog checkbox to toggle "noask" setting + - New feature: pause/continue functionality with LIRC + - Removed messagebox utility and replaced it with cleaner alert_message/confirm_message calls + - GTK GUI: Set parent window for all popups so WM will center popup windows over the main gui window + - Added README file with information about usage of Mupen64Plus and plugins + - Removed mupen64_soft_gfx, as it didn't work + - Removed Win32 code from RSP HLE plugin, + - Change fullscreen hotkey to Alt+Enter + - Only plugin filenames (not paths) are stored in the mupen64plus.conf file + - Modified pre.mk and glide64 makefile to auto-select yasm or nasm + - Bugfix: Rice Video: Make configuration during gameplay possible again + - Bugfix: many compiler warnings and errors in Glide64 + - Bugfix: segfault in Goldeneye and Perfect Dark for 64-bit dynarec + - Bugfix: 64-bit dynarec bug in genld() + - Bugfix: buffer overflow allocating temp strings for basename/dirname + - Bugfix: GTK GUI: Exiting via File -> Exit wasn't writing out config file to disk + - Bugfix: GTK GUI: "About" menu does not pop up while emulation is running + - Bugfix: Glide64: Refactored a bunch of inline asm code with potential bugs + - Bugfix: Added plugin error checking before emulator is started + - Bugfix: Logo not loading in "about" window + - Bugfix: Segfault in plugin_scan_directory() + - Bugfix: ROM pause/continue while playing + - Bugfix: Too many dialog windows when loading a bad dump or hacked rom + - Bugfix: Closing emulation window now stops emulator + - Bugfix: Rice Video: config dialog bug, now it displays proper resolution + - Bugfix: GTK GUI: "Toolbar Style" now works + - Bugfix: Glide64: changed inline asm label syntax, for compatibility with gcc 4.3.0 + - Bugfix: Many other minor bug fixes, GTK warnings fixes, translation corrections, etc + +Mupen64-amd64 v1.2 - February 10th, 2008 +---------------------------------------- + - New feature: Dynamic Recompiler for 64-bit + - New feature: New ROM Browser for Mupen64 GUI build + - New feature: LIRC remote control integration for NOGUI build + - Added R4300 instruction counting capability to 64-bit Dynarec + - Added R4300 profile data output for 32-bit and 64-bit dynamic recompilers + - TLB Optimization / bugfix + - Revised makefiles to support PPC builds + - Bugfix: memory leaks in mupenIniApi.c + - Bugfix: corrupted filenames being saved to disk for mupen64.ini + - Bugfix: crash in jttl_audio + - Bugfix: crash when running game from gui after first time + - Bugfix: spurious noise blip when running game from gui after first time + +RiceVideoLinux v1.2 - February 10th, 2008 +----------------------------------------- + - Revised makefiles to support PPC builds + - Added more logging to hi-res texture loading + - Bugfix: Texture dumping now works + +Mupen64-amd64 v1.1 - December 9th, 2007 +---------------------------------------- + - New icons for GTK GUI + - Removed GTK 1.2 GUI build; GTK 2.0 is required now + - Added file pointer checking for frwite() calls and error logging + - Added scrolling to the the rom list widget + - Added main/version.h file to store Mupen64-amd64 package version + - Print joystick numbers along with names in blight input to tell multiple devices apart + - Merged okaygo's TLB hack for Goldeneye from Mupen64++ + - Rework GTK GUI config dialog; fixed bugs in ROM directory list + - Bugfix: segfault from playing same game twice in a row from GUI + - Bugfix: segfault from fwrite() failure in dma_pi_read in memory/dma.c + - Bugfix: exit properly instead of segfault after dyna_stop is called + - Bugfix: blight input: SDL_PumpEvents must be called from thread which initialized SDL video mode + - Bugfix: blight_input: joystick handling caused glitch in config dialog + - Bugfix: makefile: 32-bit CFLAGS must be used when doing 32-bit build on 64-bit machine + - Bugfix: Added makefile to root folder for building releases + +RiceVideoLinux v1.1 - December 9th, 2007 +----------------------------------------- + - Removed configure script and config.h; added SDL and GTK library checking and handling in main makefile + - Added capability to load 24-bit PNG files into 32-bit texture buffer + - Added more error logging to hi-res texture code + - Added combiner type logging to DeviceBuilder class + - Bugfix: added quotes around BUILD_NUMBER to prevent segfault on About box + - Bugfix: SSE vertex lighting inline ASM code was incorrect + - Bugfix: makefile: 32-bit CFLAGS must be used when doing 32-bit build on 64-bit machine + - Bugfix: segfault with hi-res textures (incorrect scale factor used when creating memory buffer) + - Bugfix: modified DrawSprite function in RenderExt.cpp to eliminate gaps between textures in Puyo Puyo 4 + - Bugfix: opengl error in ApplyTextureFilter due to wrong enum type + - Bugfix: Simplified fragment program and removed ATTRIB parameters to fix problems on Intel X3100 hardware + + +Mupen64-amd64 v1.0 - November 12th, 2007 +---------------------------------------- + - Forked from Mupen64 v0.5 + - Ported to 64-bit architecture by NMN/SirRichard42 + - Fixed texture cache problem in glN64 + - Print more information during plugin loading process + - Added blight input config file for logitech dual-action style controllers + - Added SDL_GL_SWAP_CONTROL attribute in glN64 to prevent tearing + - Changed glVoids to voids due to strange compilation bug that occurs on certain systems + - Totally refactored makefiles; now plugins are built as sub-modules + - Better logging for R4300 core selection, disallow Dynamic Recompilation for 64-bit builds at compile time + - Set execstack attribute for all mupen64 binaries, to prevent segfault when Dynamic Recompilation is used + - Lots of code cleanup + - Removed 'multi-user' mode of operation + - Removed 'configure' script and config.h file + - Refactored plugin loading code in _nogui build, much more user-friendly now + - Added comments and SDL shutdown code to main.c + - Bugfix: fixed memory leaks in plugin.c + - Bugfix: strcpy in main/gui_gtk/config.c should not copy overlapping strings + - Bugfix: blight audio: only close down audio and timer sub-systems when exiting + +RiceVideoLinux v1.0 - November 12th, 2007 +----------------------------------------- + - Forked from RiceVideo 6.1.1 beta 10 + - Ported to Linux by Hacktarux + - Ported to 64-bit architecture by SirRichard42 + - Added rudimentary debug support for Linux + - Merged all Non-Win32 changes from Mudlord's RiceVideo SVN 6.1.3.2 (mostly hi-res texture load/save) + - Added more logging information + - Tweaked Z-Buffer and Z-Bias (Decal Z-mode) handling to be like that of D3D renderer + - Added screenshot capability for Linux build + - Cleaned up Makefile, added 32-bit and debug build modes, help info + - Removed all Win32 code, massive cleanup + - Fixed uninitialized data members in several places + - Bugfix: crash in Banjo Kazooie - dont delete cached texture if its currently loaded in the g_textures array + - Bugfix: crash in Carmaggedon caused by illegal values in texture loading function + - Bugfix: screen flashes in Mario Kart and Kirby64, tweaked .ini ScreenUpdateSetting + + +what's new in 0.5: + - Core + + detection of invalid code cache for ambiguous region now use + adler32 (faster than previous algorithm) + + fixed a bug in ini file compression + + added support for framebuffer effects functions : these functions + are there to help the plugins that support framebuffer extension + to zilmar's spec. These functions are based on rice's idea. I've + worked closely with Gonetz to implement these and the only plugin + that support this feature is Glide64 0.8 (when option is enabled). + Many hard to emulate framebuffer effects are supported by this + feature. Mariokart's monitor in first race running fullspeed and + puzzle effect in banjo's intro are two examples that i can think + about but there are many more. + + detection of VI interupt rate works on weird country codes + + better detection of self modifying code in dma + + warnings fixed on new gcc versions + + rsp's dmem and imem are now contiguous in PC's memory (some windows + plugins were requiring this) + + slightly improved audio timing + + better detection of self modifying code when accessing memory + through TLB + + fixed a bug in RSP memory write + + reading from ai_current_delay register should work even when + Count register is looping + + in interpreter code : fixed a bug in jump opcodes (detection + of exceptions in delay slot in some rare conditions) + + the event scheduler has better support for Count register loops + + better AI interrupt handling (for musyx games for example) + + jump opcodes changed in pure interpreter core so that they are + timed exactly like on the other cores (easier to debug this way) + + fixed a bug when accessing memory through invalid TLB in LDL, LDR, + LWL, LWR, SWL, SDL, SDR, SWR opcodes + + added LL, SC opcodes + + two consecutive jump opcodes doesn't crash in the dynarec (result + is undefined according to the r4300 manual but some games are doing + it). + + basic implementation of fpu opcodes in dynarec + + division by 0 in FPU opcodes is returning NaN + + all jump opcodes implemented in the dynarec + + faster inside function loop with dynarec (register cache) + + various bug fixes in dynarec opcodes + + memory access improvements in dynarec + - Linux version + + GUI and all plugins have been switched to GKT2 (all old plugins + should be recompiled for GTK2) + + detection of GTK 1.2 or GTK 2 in the configure script : if both + are detected, the user can choose which one to use + + configure script rewritten so that it's compatible with standard + unix shells instead of bash + + much improved multi-user install support : if multi-user is choosen + in configure script, mupen64 should be compiled ("make") and installed + ("make install"). Then, when a user launch mupen64, it will create + automatically a .mupen64 folder in his home and put all required files + there. + + language saved and restored correctly when quitting mupen64 + + the console version (mupen64_nogui) has command line support and can + read settings from the gui version config file thanks to jogibear's patch + + autoincrement save slot option when quick saving (thanks to jdratlif's + patch) + + speed limiter in the core + + support for plugin configuration changes when a rom is running + - Windows version + + autoincrement save slot option when quick saving (thanks to jdratlif's + patch) + + stabilty improvements on the GUI (when closing a rom for example) + + added support for readScreen function to support avi recording feature + on plugins that don't use opengl or directx (ie: glide64...) + - Sound plugin + + thread synchronisation improvements + +what's new in 0.4: + - A totally new core based on a dynamic recompiler with register caching, + it doesn't compile the fpu yet but it's already much faster compared + to older versions of mupen64 :) + - Self mod code detection has been improved and emulation is faster now + - A lot of little fixes that should improve compaibitlity quite a bit + - A new video recording feature (record in own mupen64 movie format that + can be converted later into a standard avi file) + - The windows GUI has been redesigned by linker + - A lot of other things i forgot... sorry :P + +what's new in 0.3: + - All versions + + General speed up, 10-20 in most games + Save states long loading time fixed, now it should load in less than + a second + + sound sync is far more accurate now (thanks to Azimer) + it makes some additionnal games booting + + 64dd detection to fix F-zero + + a little idle loops bug has been fixed + - Windows port + + Configuration and initialisation of plugins now can be done prior + running a rom. It fixes numerous configuration issues with plugins as + well + + Recent roms menu with option to clear and freeze + + Command line arguments support with option to run in GUIless mode, + compatible with 1964 options, read more about it in pdf + + Choosing and saving of plugins used per game, access it from Rom + Properties + + Reset rom menu added + + Speed Modifier to allow game to run at any speed between 1-200% of + original + Use + and - to increase, decrease it, while in the game. And . to + return to 100%. + + Start game in fullscreen option + + Pause emulation when idle fixes + + Global plugin settings (should be unchecked if you want to use plugins + per game option from rom properties) + + Switch on/off ToolBar (ALT+T) and Status Bar (ALT+S), useful when + plugin sets wrong resolution in windowed mode, and for those who hate + toolbars :) + + Selection of columns to show in rom browser + + English language template updated + + Support for debugview by linker + Put dll in the main folder, if you want to see log output + + Tonnes of little fixes... + - RSP hle plugin + + mario kart sound fixed + +what's new in 0.2: + - Core + + better sound plugin integration + + optimizations in interrupt handling + + a totally new interpreter core (half of a compiler => far much faster) + it caches the opcodes when they're decoded + + self modifying code detection code for the new interpreter and the + compiler when it'll be implemented + + RSP plugin integration + + pif2 implemented for banjo tooie + - RSP hle plugin + + the first version of this plugin based on uhle sound code + + 3 main audio ucode implemented (based on uhle) + + mp3 ucode implemented (direct asm to c translation) + + jpeg ucode (direct asm to c translation) + + boot code for btooie and dk + + on windows: ability to use the hle part of a sound plugin while using another + to output the sound (example: using hle from Azimer's plugin and + ouputing with Jabo's plugin) + This option doesn't work with azimer's audio plugin 0.3 version + Please see more info about RSP and this feature in + readme.pdf in chapter "3.3.2 Configuration" + - Sound Plugin for linux + + a new lle sound plugin that's using the OSS api + - Windows port + + Major cleanup of gui code and bug fixes + + Gui improvements in rombrowser + + Gui changes in configuration sheets and about dialog + + Updates in language support and template + Dialog with proper credits to translators ,send us your translations now :) + + Support for screenshots from menu (depends on video plugin) (F3 key) + + Added some shortcuts for gui functions to accelerators + + Option to choose directories of plugins,screenshots and save states in sheets + + Auto limit VI/s according to game region (60 or 50) + + Ini updated with latest N64 releases + + ... + +what's new in 0.1: + - Core + + sram bug zelda oot fixed + + flashram is working + + a new interupt system that'll enabled + more accurate timing in the future but can cause + some compatibility issues right now + + bug in DMULT/DMULTU opcode fixed + + some optimizations in jump instructions + + sound plugins support implemented but not well supported + use sound at your own risk :D + + a clean tlb implementation + + tlb exception handled correctly + + compressed save states with slots + + the whole memory map has been almost completes + + newly emulated games include goldeneye, conker's bad fur day + and perfect dark :) + + - Windows port + + Zipped Cache to Rom Browser + + Multy slot save states + + Md5 based Ini + + Rom properties dialog + + Sound support + + Config plugins dialog + Allows you to chose and configure plugins + + Multy directories in rom browser + with recursion as an option + + Audit roms dialog + + Many bugs fixed and minor features added + + ... + - Linux port + + A new gui made by Blight very similar to the windows one + Everything in the gui is new so one line many new things ;) + +what's new in 0.0.90: + - this is a huge update many games are playable now :) but only pure + interpreter work on this release it will be fixed in the future + but currently i am only working on compatibility + - i have totally rewritten the pure interpreter core + - nearly all missing opcodes have been added + - interrupt code has been totally rewritten and should never crash now + - tlb code rewritten, it's faster even if it's not perfect yet + - some fpu opcodes have been debugged + - fpu precision emulation improvements (only for x86 processors) + - many bugs to allow port to big endian processors + - fixed endianness when cpu write directly to pif ram + - rewritten dma code for pure interpreter (with this core it always + work now ) + - update dp status register when a display list has been processed + it fixed a lot of roms + - implemented 8Mb RDRAM + - implemented memory pack, eeprom, sram (thanks to Jabo and Zilmar + for the pj64 source code on this part) + - flashram is partially implemented (it's enough to get zelda2 starting) + - a new debugger for linux was made by DavFR (it's for linux and + it uses gtk library) + - zip file support + - a new gui for windows port has been made by ShadowPri, it features + a rom browser with *classic* UHLE look,multy directories support , + a toolbar (thx Schibo for help on it :), multy languages support, + saving of configuration, .... + - and much more ;) + +what's new in 0.0.4: + - a new pure interpreter core (better compatibility but really slow, + will help to debug in the future) + - input plugins (a basic keyboard plugin is included and the obsidian + joystick plugin ) + - coprocessor unusable exception implemented + - gui for windows + - again many little bugs i can't remember fixed + - automatic comparison between two cores via a pipe (for debugging) + - .... + +what's new in 0.0.3: + - unaligned dma exception fix + - a little gui in gtk + - new opcodes implemented + - memory map fixes + - better initial registers (this was find in the pj64 source code + thanks Zilmar and Jabo) + - implemented Zilmar spec Gfx plugins + - included : a linux port of the tr64 plugin v0.5c + +what's new in 0.0.2: + - MARIO64 works!!! + - sound temporarly disabled (Just to not hurt your ears because + hle audio doesn't work :) + - various speed improvements + - various stupid bugs removed + +what's new in 0.0.1: + - everything it's the first public release :) + diff --git a/libmupen64plus/mupen64plus-core/data/font.ttf b/libmupen64plus/mupen64plus-core/data/font.ttf new file mode 100644 index 0000000000..58cd6b5e61 Binary files /dev/null and b/libmupen64plus/mupen64plus-core/data/font.ttf differ diff --git a/libmupen64plus/mupen64plus-core/data/mupen64plus.cht b/libmupen64plus/mupen64plus-core/data/mupen64plus.cht new file mode 100644 index 0000000000..2f34bb12eb --- /dev/null +++ b/libmupen64plus/mupen64plus-core/data/mupen64plus.cht @@ -0,0 +1,15366 @@ +// /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +// * Mupen64plus - mupen64plus.cht * +// * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * +// * Copyright (C) 2008 Gent * +// * * +// * 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. * +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +// Used and relicensed GPL with permission from Gent + +// Start Original Header +// PJ64 1.7 Official Cheats Database (Project64.cht) Beta Version 1.7.0.13 +// All Region Cheat Codes By Gent. +// ---------------------------------------------------- +// +// This Cheat file is only to be used with Project64 version 1.7 +// +// ---------------------------------------------------- +// End Original Header + +[Meta] +Author=Gent +Version=Official Beta Version 1.7.0.13 +Date=30th April 2008 +Homepage=http://www.pj64.net + +//--------------- (J) Region Cheat Codes --------------- + + +[80F41131-384645F6-C:4A] +Name=AeroGauge (J) (V1.1) +Cheat0="No Damage\Player 1",50000402 0000,8113D058 0000 +Cheat1="No Damage\Player 2",50000402 0000,8113F0E8 0000 +Cheat2="Unlock All Tracks and Vehicles",8008D1FC 0001 +Cheat3="Freeze All Lap Timers",8013CD21 0001,8013CD25 0001,8013CD29 0001 +Cheat4="Freeze Overall Timer",8013CD15 0001 +Cheat5="Laps Of Race",8013CD0E 00?? +Cheat6="Play As\Player 1",8013D015 00?? +Cheat7="Level Select",8013D01B 00?? +Cheat8="Play As\Player 2",8013D016 00?? +Cheat9="Always 1st",8013CD60 0001 +Cheat10="Music Modifier",80106CCC 00?? +Cheat5_O=$01 1 Lap,$02 2 Laps,$03 3 Laps,$04 4 Laps,$05 5 Laps,$06 Never Ending Laps +Cheat6_O=$00 N64 Control Pad,$01 Interceptor,$02 Hornet,$03 Avenger,$04 Shredder,$05 Black Lightning,$06 Vengeance,$07 Prowler,$08 Reaper,$09 Dominator +Cheat7_O=$00 Canyon Rush,$01 Bikini Island,$02 China Town,$03 Neo Arena,$04 China Town Jam,$05 Neo Speed Way +Cheat8_O=$00 N64 Control Pad,$01 Interceptor,$02 Hornet,$03 Avenger,$04 Shredder,$05 Black Lightning,$06 Vengeance,$07 Prowler,$08 Reaper,$09 Dominator +Cheat10_O=$FF Music On,$00 Music Off +Cheat4_N=All of the Freeze All Lap Timers must be on. These codes will Stop the others from racing against you in Grand Prix mode. To win a race in Grand Prix you must finish at least one lap in the qualify round, then complete all laps in race for first. +Cheat7_N=For this cheat to work,as soon as you put the cheat on you must turn it back off,if not you wont beable to quit a Race or even finish one. + +//---- + +[B00903C9-3916C146-C:4A] +Name=AeroGauge - Kiosk (J) (V1.0) +Cheat0="No Damage\Player 1",50000402 0000,8113CF08 0000 +Cheat1="No Damage\Player 2",50000402 0000,8113EF98 0000 +Cheat2="Unlock All Tracks and Vehicles",8008D0AC 0001 +Cheat3="Freeze All Lap Timers",8013CBD1 0001,8013CBD5 0001,8013CBD9 0001 +Cheat4="Freeze Overall Timer",8013CBC5 0001 +Cheat5="Laps Of Race",8013CBBE 00?? +Cheat6="Play As\Player 1",8013CEC5 00?? +Cheat7="Level Select",8013CECB 00?? +Cheat8="Play As\Player 2",8013CEC6 00?? +Cheat9="Always 1st",8013CC10 0001 +Cheat10="Music Modifier",80106B7C 00?? +Cheat5_O=$01 1 Lap,$02 2 Laps,$03 3 Laps,$04 4 Laps,$05 5 Laps,$06 Never Ending Laps +Cheat6_O=$00 N64 Control Pad,$01 Interceptor,$02 Hornet,$03 Avenger,$04 Shredder,$05 Black Lightning,$06 Vengeance,$07 Prowler,$08 Reaper,$09 Dominator +Cheat7_O=$00 Canyon Rush,$01 Bikini Island,$02 China Town,$03 Neo Arena,$04 China Town Jam,$05 Neo Speed Way +Cheat8_O=$00 N64 Control Pad,$01 Interceptor,$02 Hornet,$03 Avenger,$04 Shredder,$05 Black Lightning,$06 Vengeance,$07 Prowler,$08 Reaper,$09 Dominator +Cheat10_O=$FF Music On,$00 Music Off +Cheat4_N=All of the Freeze All Lap Timers must be on. These codes will Stop the others from racing against you in Grand Prix mode. To win a race in Grand Prix you must finish at least one lap in the qualify round, then complete all laps in race for first. +Cheat7_N=For this cheat to work,as soon as you put the cheat on you must turn it back off,if not you wont beable to quit a Race or even finish one. + +//---- + +[B6951A94-63C849AF-C:4A] +Name=Akumajou Dracula Mokushiroku - Real Action Adventure (J) +Cheat0="Infinite\Health",81389C3E 0064 +Cheat1="Infinite\Throwing Weapon",81389C48 0064 +Cheat2="Throwing Weapon Modifier",81389C42 00?? +Cheat3="Press L To Levitate",D0387D7F 0020,81350810 3FCB +Cheat4="Have\All Items",50000501 0000,80389C4A 0001,50000301 0000,80389C51 0001,80389C5A 0001,80389C5B 0001,80389C5D 0001,50000E01 0000,80389C60 0001 +Cheat5="Have\Invincibility",80342BFE 000B +Cheat6="Infinite\Red Jewels",80389C49 0063 +Cheat7="Status",80389C88 00?? +Cheat7_O=$01 Good,$08 Vamp,$11 Poison,$22 Good but depressed,$66 Sto,$1F V+P +Cheat8="Open All Doors and Gates,No Bosses",50002A02 0000,81389BD0 FFFF +Cheat9="Infinite\Energy",80389C3F 0064 +Cheat10="Infinite\Funds",80389C45 0001,81389C46 869F +Cheat11="Have\Exp Points",80389C49 0063 +Cheat12="Max Power Up",80389CED 0002 +Cheat13="Never Get Poisoned",81389C88 0000 +Cheat2_O=$00 Nothing,$01 Knives,$02 Exploding Potions,$03 Cross,$04 Axes +Cheat14="Level Select",89389C90 ????,89389C92 0000 +Cheat14_O=$0000 Forest of Silence,$0002 Castle Wall,$0003 Villa,$0004 Inside Villa,$0006 Garden Maze,$0007 Tunnel,$0008 Underground Waterway,$0009 Castle Center,$0010 Tower of Execution,$0011 - Tower of Sorcery,$0012 - Tower of Science,$0013 - Duel Tower,$0014 - Fight With Death/Actrise,$0015 - Castle Keep,$0016 - Intro (Glitch),$0017 - Clock Tower,$0018 - Final Dracula,$001A - Fight With Maze Boss,$001B - Room of Clocks,$001C - ??,$001D - ?? +Cheat14_N=You must use this code on a saved game, because the intro to the first level will mess up the game. Now select the saved game, and hold down the GS button until the level loads. Some of the boss stages will not let you fight the boss unless you re-enter the area. Also, with the part of stage modifier, the second code modifies the part of the level that you are in, and 0000 is the level's start. +Cheat15="Switch From",80389C3D 00?? +Cheat15_O=$00 Carrie to Reindhart,$01 Reindhart to Carrie +Cheat15_N=This Switch From Cheat lets you switch characters on a saved game For example, if you are Reindhart and you want to be Carrie in the middle of your game save it and then enable this Cheat and press F1. when you start your saved game back up you'll be Carrie instead of Reindhart. + +//---- + +[A5533106-B9F25E5B-C:4A] +Name=Akumajou Dracula Mokushiroku Gaiden-Legend of Cornell (J) +Cheat0="Infinite\Keys\Clocktower A",801CC51F 000A +Cheat1="Infinite\Keys\Clocktower B",801CC520 000A +Cheat2="Infinite\Keys\Storeroom",801CC510 000A +Cheat3="Infinite\Keys\Garden",801CC511 000A +Cheat4="Infinite\Keys\Copper",801CC512 000A +Cheat5="Infinite\Keys\Chamber",801CC513 000A +Cheat6="Infinite\Keys\Execution",801CC514 000A +Cheat7="Infinite\Keys\Deck",801CC515 000A +Cheat8="Infinite\Keys\Rose Garden",801CC516 000A +Cheat9="Infinite\Keys\Thorn",801CC517 000A +Cheat10="Infinite\Keys\Clocktower C",801CC518 000A +Cheat11="Infinite\Keys\Clocktower D",801CC519 000A +Cheat12="Infinite\Keys\Art Tower 1",801CC51A 000A +Cheat13="Infinite\Keys\Art Tower 2",801CC51B 000A +Cheat14="Infinite\Keys\Control Room",801CC51C 000A +Cheat15="Infinite\Keys\Wall",801CC51D 000A +Cheat16="Infinite\Keys\Clocktower E",801CC51E 000A +Cheat17="Infinite\Keys\Archives",801CC50E 000A +Cheat18="Infinite\Keys\Left Tower",801CC50F 000A +Cheat19="Infinite\Health",811CC4EA 2710 +Cheat20="Infinite\Gold",811CC4F2 2710 +Cheat21="Infinite\Specials\Special 1",801CC4F7 000A +Cheat22="Infinite\Specials\Special 2",801CC4F8 000A +Cheat23="Infinite\Specials\Special 3",801CC4F9 000A +Cheat24="Infinite\Items\Roast Chicken",801CC4FA 000A +Cheat25="Infinite\Items\Roast Beef",801CC4FB 000A +Cheat26="Infinite\Items\Healing Kit",801CC4FC 000A +Cheat27="Infinite\Items\Purifying",801CC4FD 000A +Cheat28="Infinite\Items\Cure Ampoule",801CC4FE 000A +Cheat29="Infinite\Items\Powerup",801CC4FF 000A +Cheat30="Infinite\Items\The Contract",801CC504 000A +Cheat31="Infinite\Items\Magical Nitro",801CC505 000A +Cheat32="Infinite\Items\Mandragora",801CC506 000A +Cheat33="Infinite\Items\Sun Card",801CC507 000A +Cheat34="Infinite\Items\Moon Card",801CC508 000A +Cheat35="Infinite\Items\Winch Lever",801CC509 000A +Cheat36="Infinite\Items\Oldrey's Diary",801CC50A 000A +Cheat37="Infinite\Items\Crest Half A",801CC50B 000A +Cheat38="Infinite\Items\Crest Half B",801CC50C 000A +Cheat39="Infinite\Items\Rose Brooch",801CC50D 000A +Cheat40="Infinite\Items\Throwing Weapons",801CC4F5 0064 +Cheat41="Infinite\Items\Red Jewels on Pick-Up",801CC4F5 0068 +Cheat42="Infinite\Bullets",801D5753 0006 +Cheat43="Wolfman Can Use Weapons",801CC4E7 0002 +Cheat44="Wolfman Can't Use Weapons",801CC4E7 0004 +Cheat45="Rapid Fire Gun (Henry-Hold B)",D11CA1A6 0040,801D5753 0006 +Cheat46="Max Powerups",801CC7D3 0002 +Cheat47="Stop Timer Input",811CC4D2 0001 +Cheat48="Hard Mode Selected In A New Game",8032630F 0002 +Cheat49="Weapon Modifier",811CC4EE 00?? +Cheat50="Level Modifier",801CC829 00?? +Cheat51="Inter-Level Modifier",801CC82B 00?? +Cheat52="Cut Scene Modifier",801CC843 0009,801CC83B 00?? +Cheat53="Enable All Characters",8031CBF3 0004 +Cheat54="Character Modifier",8031CBDB 00?? +Cheat55="Status Modifier",801CC534 00?? +Cheat56="Max Weapon Power-Up",801CC7D7 0002 +Cheat57="Day Modifier For Adult Henry",801CC4CF 00?? +Cheat58="Infinite\Health Young Henry",D11CA1A6 0010,813A6D10 2800 +Cheat42_N=For Henry +Cheat43_N=For Cornell +Cheat44_N=For Cornell (Default) +Cheat45_N=For Henry, Hold B +Cheat48_N=With this code, you will not see the hard level status until you save and restart the game file. No special items are required to access this feature with this code turned on. +Cheat52_N=With this code, you must use the appropiate level mod before you attemp to run these cut scenes. Not doing so will ruin the cut scene as the graphics will be glitched. +Cheat49_O=$00 Nothing,$01 Knife,$02 Potion,$03 Cross,$04 Axe +Cheat50_O=$00 Forest Of Silence,$01 Left Tower,$02 Castle Wall,$03 Villa,$04 Villa,$05 Villa,$06 Villa,$1A Villa,$07 Tunnel,$08 Underground Waterway,$09 Castle Center,$0A Castle Center,$0B Castle Center,$0C Castle Center,$0D Castle Center,$0E Castle Center,$0F Castle Center,$10 Foggy Lake,$11 Foggy Lake,$12 Foggy Lake,$13 Cave Of Spiderwomen,$14 Castle Keep,$15 Castle Keep,$16 Falls Into Space(?),$17 Clock Tower,$18 Final Battle Site,$19 Castle Center,$1B Room Of Clocks,$1C Countryside Where Carrie's Mom Is Buried.(Fall Through Ground),$2B Countryside Where Carrie's Mom Is Buried.(Fall Through Ground),$1D Tower Of Sorcery,$1E Tower Of Execution,$1F Tower Of Execution,$20 Tower Of Execution,$21 Tower Of Science,$22 Tower Of Science,$23 Tower Of Ruins,$24 Tower Of Ruins,$25 Art Tower,$26 Art Tower,$27 Dual Tower,$28 Clock Tower,$29 Clock Tower,$2A Outer Wall,$2C Fall From Sky Ouside Of Castlevania Opening,$2D Another Free Fall. Forest Where Girl Runs In Opening,$2E Black Room(?) +Cheat51_O=$00 Forest Of Silence,$01 Left Tower,$02 Castle Wall,$03 Villa,$04 Villa,$05 Villa,$06 Villa,$1A Villa,$07 Tunnel,$08 Underground Waterway,$09 Castle Center,$0A Castle Center,$0B Castle Center,$0C Castle Center,$0D Castle Center,$0E Castle Center,$0F Castle Center,$10 Foggy Lake,$11 Foggy Lake,$12 Foggy Lake,$13 Cave Of Spiderwomen,$14 Castle Keep,$15 Castle Keep,$16 Falls Into Space(?),$17 Clock Tower,$18 Final Battle Site,$19 Castle Center,$1B Room Of Clocks,$1C Countryside Where Carrie's Mom Is Buried.(Fall Through Ground),$2B Countryside Where Carrie's Mom Is Buried.(Fall Through Ground),$1D Tower Of Sorcery,$1E Tower Of Execution,$1F Tower Of Execution,$20 Tower Of Execution,$21 Tower Of Science,$22 Tower Of Science,$23 Tower Of Ruins,$24 Tower Of Ruins,$25 Art Tower,$26 Art Tower,$27 Dual Tower,$28 Clock Tower,$29 Clock Tower,$2A Outer Wall,$2C Fall From Sky Ouside Of Castlevania Opening,$2D Another Free Fall. Forest Where Girl Runs In Opening,$2E Black Room(?) +Cheat52_O=$03 Castle Drawbridge Lowers,$04 Character Enters Castle,$05 (?),$0A (?),$0C (?),$20 (?),$21 (?),$22 (?),$06 Vampire In Main Entrance Hall Of Villa,$07 One Of The Working Gears Cut Scenes,$08 "I Smell Poison" From Underground Waterway,$09 Castle Gate Closes In Villa Upon Entering Villa,$0B Renon Appears For First Time,$0D Village Vampire In Upstairs Villa,$0E Malus Appears For The First Time,$0F Malus Leaves Garden,$10 Character In Boat On Foggy Lake,$11 Seal Removed From Wall In Arena,$12 Bleeding Statue,$13 Cosmic Lights,$14 Explosion At Wall In Arena,$15 Explosion At Wall In Castle That Leads To Hidden Room,$16 Malus Appears Again In Upstairs Room Of Castle,$17 Bull Awakens,$18 Vincent The Vampire,$19 One Of The Working Gears Cut Scenes,$1A Gate Opens In Forest Of Silence,$1B Meet Renon For The Last Time In Castle Keep.,$1C This Cut Scene Runs Cut Scene 27 And 2E,$1E Castle Keep Destructs,$1F Malus On Flying Horse Outside Castle Keep,$24 Spider People In Tunnel,$25 Rosa In Garden,$27 Castel Destruction,$28 Space Warp,$29 Castle Destruction,$2A Malus Is Saved By Reinhardt,$2B Malus And Reinhardt On Horse,$2E Rosa Returns,$30 Ada, Henry And Cornell At Game End,$31 Scrolling Text About Castle And Henry,$33 Vampire In Basement,$34 Vampire In Villa Basement Destroyed, Woman Vampire Rises,$35 Finds Hidden Path In Villa Basement,$37 Lever & Gear In Castle,$38 Harpie,$39 Harpie Destroyed,$44 Death(Grim Reaper),$45 Death Is Destroyed,$46 Castle Drawbridge Closes And Ortega Appears,$47 Thirsty Man,$48 Cornell Meets Henry In Garden,$49 Cornell And Henry Part In Garden,$51 Monster Dracula Appears,$52 Actrise Appears In Castle Center,$54 Actrise Appears Again With Cousin Fernandes Before Fight With Carrie,$55 Cousin Fernandes Is Destroyed,$56 Actrise Appears Again Before Fight With Carrie,$57 Actrise Defeated By Carrie +Cheat54_O=$05 Henry,$06 Reinhardt,$07 Carrie +Cheat55_O=$00 Never Get Poisoned or Vamped,$01 Normal,$04 Vamp,$08 Poison,$0C Vamped & Poisoned,$FF Instant Death +Cheat57_O=$00 7 Days,$01 6 Days,$02 5 Days,$03 4 Days,$04 3 Days,$05 2 Days,$06 1 Day,$07 0 Days + +//--- + +[6C45B60C-DCE50E30-C:4A] +Name=Airboarder 64 (J) +Cheat0="Infinite Turbo\Player 1",80166019 0009 +Cheat1="Infinite Turbo\Player2",80167991 0009 +Cheat2="Infinite Time\Street Work & Coin",801137E9 0028 +Cheat3="Infinite Time\Attack Time Time 000000",811137EA 0000 +Cheat4="Infinite Time\Time Attack",801137EB 0000 +Cheat5="Access All Boards & Characters",800500C1 000C +Cheat6="Maxed Out Turbo Bar",811656E8 429F,80166017 0051 +Cheat7="Class Score Select",8016609E 00?? +Cheat7_O=$20 Class C,$40 Class B,$64 Class A,$FF Class S +Cheat8="Coin Perfect Select",801660B3 00?? +Cheat8_O=$14 Green Park Level 1,$1A Green park Level 2,$2B Green park Level 3,$4A Lost Forest Level 1,$59 Lost Forest Level 2,$80 Lost Forest Level 3,$7D Snow Festival 64 Levels 1 2 & 3,$6F Sunset Island Level 1,$74 Sunset Island Level 2,$81 Sunset Island Level 3,$6E Giant House Level 1,$77 Giant House Level 2,$72 Giant House Level 3 +Cheat9="Options\Music Modifier",800500A9 00?? +Cheat9_O=$FF BGM On,$00 BGM Off +Cheat10="Options\Sound Effects Modifier",810500AA 00?? +Cheat10_O=$FF SE On,$00 SE Off +Cheat11="Options\Camera Type Modifier",810500A6 00?? +Cheat11_O=$00 Roll On Near,$01 Roll On Mid,$02 Roll On Far,$03 Roll Off Near,$04 Roll Off Mid,$05 Roll Off Far +Cheat12="Options\DJ Function Modifier",810500AC 00?? +Cheat12_O=$01 DJ Function On,$00 DJ Function Off +Cheat13="All Street Work Levels Unlocked",50007801 0000,80050170 00?? +Cheat13_O=$01 Courses unlocked,$03 Courses unlocked with C rank,$04 Courses unlocked with B rank,$05 Courses unlocked with A rank,$06 Courses unlocked with S rank +Cheat8_N=this is for Coin Mode to get Perfect Coin Collection Score straight away when you enter the level + +//---- + +[E340A49C-74318D41-C:4A] +Name=Baku Bomberman (J) +Cheat0="Invincible\Player 1",800AEE01 0001 +Cheat1="Have\Pumped up Red Remote Bombs",802AC653 0004 +Cheat2="Infinite\Lives",802AB857 0063 +Cheat3="Infinite\Gems",802AB85F 0063 +Cheat4="Infinite\Credits",802AB85B 0009 +Cheat5="Infinite\Time",802AB873 0001 +Cheat6="Carry 20 Bombs At A Time",800AEE0F 0014 +Cheat7="Infinite\Energy\Player 1",800AEE07 0002 +Cheat8="Infinite\Energy\Player 2",800AEECF 0002 +Cheat9="Infinite\Energy\Player 3",800AEF97 0002 +Cheat10="Infinite\Energy\Player 4",800AF05F 0002 + +//---- + +[E73C7C4F-AF93B838-C:4A] +Name=Baku Bomberman 2 (J) +Cheat0="Infinite\Money",810A9BB2 FFFF +Cheat1="Infinite\Bombs",800AB5B8 0003 +Cheat2="Have\Max Fire Level",800AB593 0003 +Cheat3="Infinite\Health",800AB5BF 0005 +Cheat4="Infinite\Continue Time",810B3B36 0090 +Cheat5="Have\Fire Bombs",800AB59B 0003 +Cheat6="Have\Kick Bombs Anytime",800AB5A3 0003 +Cheat7="Flashing Invincible",800AB5C7 000A +Cheat7_N=This cheat Makes you Flash But you cant be harmed,Once out of danger Turn the cheat off to stop the flashing.also do not put this on if you have already been hurt or you will stay on the floor. + +//---- + +[5168D520-CA5FCD0D-C:4A] +Name=Banjo to Kazooie no Dai Bouken (J) +Cheat0="Infinite\Eggs",80386AA7 00FF +Cheat1="Infinite\Lives",80386ACB 00FF +Cheat2="Infinite\Jiggies",80386B0B 00FF +Cheat3="Infinite\Notes",80386B32 00FF,80386AA2 0001 +Cheat4="Infinite\Health",80386AC3 0008,80386AC7 0008 +Cheat5="Infinite\Air",81386ACE 0E10 +Cheat6="Infinite\Gold Feathers",80386AB3 00FF +Cheat7="Infinite\Red Feathers",80386AAF 00FF +Cheat8="Infinite\Always Have All Jinjos",80386ABB 00FF +Cheat9="Have Zero Time all Levels",50000B04 0000,81386B44 3000 +Cheat10="Infinite\Mumbo Tokens",80386B07 00FF +Cheat3_N=Just collect one Note to Have 255 Notes in all Worlds. + +//---- + +[514B6900-B4B19881-C:4A] +Name=Banjo to Kazooie no Dai Bouken 2 (J) +Cheat0="Infinite\Energy\Banjo and Kazooie",80115329 0063,81115A04 0A0A +Cheat1="Infinite\Air",80125222 42C8 +Cheat2="Infinite\Energy\Snowball",80115329 0063,80115907 0005 +Cheat3="Infinite\Energy\Bee",80115329 0063,80115913 000A,80115914 000A +Cheat4="Infinite\Energy\Washing Machine",80115329 0063,81115916 0A0A +Cheat5="Infinite\Energy\Stony",80115329 0063,80115919 000A,8011591A 000A +Cheat6="Infinite\Energy\Banjo",80115329 0063,8011591F 000A,80115920 000A +Cheat7="Infinite\Energy\Kazooie",80115329 0063,81115922 0A0A +Cheat8="Infinite\Energy\Submarine",80115329 0063,80115925 000A,80115926 000A +Cheat9="Infinite\Energy\Mumbo",80115329 0063,81115928 0A0A +Cheat10="Infinite\Energy\Detonator",80115329 0063,8111592E 0A0A +Cheat11="Infinite\Energy\T-Rex Baby",80115329 0063,8011593F 000A,80115940 000A +Cheat12="Play As",D0080845 0020,801211FC 00?? +Cheat12_O=$01 Banjo and Kazooie,$02 Snowball,$06 Bee,$07 Washing machine,$08 Stony,$0A Banjo,$0B Kazooie,$0C Submarine,$0D Mumbo,$0E Golden Goliath,$0F Detonator,$10 Truck,$12 T-rex baby,$13 T-rex daddy +Cheat13="Instant Warp\Options\Spiral Mountain",D1080844 0000,811217F0 00??,801217F3 0001 +Cheat13_O=$00 AD Grunty's Old Lair,$00 AE Behind The Waterfall,$00 AF Top Of Castle,$01 73 Banjo's house +Cheat14="Instant Warp\Options\Jinjo Village",D1080844 0000,811217F0 00??,801217F3 0001 +Cheat14_O=$01 42 Jinjo Village,$01 44 King Jingalings throne room,$01 43 Bottles house,$01 45 Green Jinjo's House,$01 46 Black Jinjo's House,$01 47 Yellow Jinjo's House,$01 48 Blue Jinjo's House,$01 4A Brown Jinjo's House,$01 4B Orange Jinjo's House,$01 4C Purple Jinjo's House,$01 4D Red Jinjo's House,$01 4E White Jinjo's House +Cheat15="Instant Warp\Options\Mayahem Temple",D1080844 0000,811217F0 00??,801217F3 0001 +Cheat15_O=$00 B6 Humba's Wigwam,$00 B7 Mumbo's skull,$00 B8 The Temple,$00 B9 Prison Compound,$00 BC Code chamber,$00 C4 Jade Snake Grove,$00 C5 Treasure Chamber,$00 C6 Kickball Arena,$01 77 Targitzan's Slighty Sacred Temple,$01 78 Inside Targitzans Temple,$01 79 Targitzan Temple Lobby,$01 7A Targitzan's Temple Boss,$01 7F Mayan Kickball Arena,$01 66 Multi,$01 67 Still,$00 C8 Kickball Arena,$00 C9 Kickball Arena +Cheat16="Instant Warp\Options\Glitter Gulch Mine",D1080844 0000,811217F0 00??,801217F3 0001 +Cheat16_O=$00 C7 Mine,$00 CA Fuel depot,$00 CB Crushing shed,$00 CC Flooded caves,$00 CD Water storage,$00 CE Waterfall cavern,$00 CF Power hut basement,$00 D0 Chuffy's cab,$00 D1 Inside chuffy's boiler boss,$00 D2 Gloomy caverns,$00 D3 Generator caverns,$00 D4 Power hut,$00 D5 Wumba's wigwam,$00 D7 Train station,$00 D8 Prospectors hut,$00 D9 Mumbo's hut,$00 DA Toxic gas cave,$00 DB Canary cave,$00 DC Ordnance storage,$00 E9 Humba,$01 26 Water supply pipe,$01 63 Ordnance Storage entrance,$01 64 Ordnance Storage game,$01 65 Ordnance Storage game Multi,$01 6F Testing,$01 70 Testing,$01 71 Mumbo's skull +Cheat17="Instant Warp\Options\Witchy World",D1080844 0000,811217F0 00??,801217F3 0001 +Cheat17_O=$00 D6 Witcy World,$00 DD Dodgem dome lobby,$00 DE Dodgem challenge "1 vs 1",$00 DF Dodgem challenge "2 vs 1",$00 E0 Dodgem challenge "3 vs 1",$00 E1 Crazy castle stockade,$00 E2 Crazy castle lobby,$00 E3 Crazy castle pump room,$00 E4 Balloon burst game,$00 E5 Hoop hurry game,$00 E6 Star spinner,$00 E7 The inferno,$00 EA Cave of horrors,$00 EB Haunted cavern,$00 EC Train station,$01 24 Saucer of Peril,$01 3B Crazy castle stockade "sop",$01 3C Star spinner "sop",$01 76 Mumbo's skull +Cheat18="Instant Warp\Options\Jolly Roger's Lagoon",D1080844 0000,811217F0 00??,801217F3 0001 +Cheat18_O=$00 ED Jolly's,$00 EE Pawno's emporium,$00 EF mumbo's skull,$00 F4 Ancient Swimming Baths,$00 F6 Electric Eels lair,$00 F7 Seaweed Sanctum,$00 F8 Inside the big fish,$00 FA temple of the fishes,$01 A8 Atlantis,$01 A9 Seabottom,$01 81 sea bottom cavern,$01 82 submarine multi,$01 A7 Jolly Roger's Lagoon,$00 FF Blubber's wave race hire +Cheat19="Instant Warp\Options\Terrydacty Land",D1080844 0000,811217F0 00??,801217F3 0001 +Cheat19_O=$01 12 Terrydacty Land,$01 13 Terry's nest,$01 14 Train station,$01 15 Oogle boogles cave,$01 16 Inside the mountain,$01 17 River passage,$01 18 Styracosaurus family cave,$01 19 Unga bunga's cave,$01 1A Stomping plains,$01 1B Bonfire caverns,$01 1E Humba's Wigwam,$01 23 Inside chompa's belly,$01 83 Chompa's belly multi +Cheat20="Instant Warp\Options\Grunty Industries",D1080844 0000,811217F0 00??,801217F3 0001 +Cheat20_O=$01 00 Outside,$01 01 Inside,$01 02 Train station,$01 03 Workers quarters,$01 04 Trash compactor,$01 05 Elevator shaft,$01 06 Floor 2,$01 07 Floor 2 "electromagnet chamber",$01 08 Floor 3,$01 09 Floor 3 "boiler plant",$01 0A Floor 3 "packing room",$01 0B Floor 4,$01 0C Floor 4 "cable room",$01 0D Floor 4 "quality control",$01 0E Floor 5,$01 0F Basement,$01 10 Basement "repair depot,$01 11 Basement "waste disposal",$01 25 Water supply pipe,$01 72 Mumbo's skull,$01 62 Floor 4 "clinkers cavern",$01 87 Sewer entrance +Cheat21="Instant Warp\Options\Hailfire Peaks",D1080844 0000,811217F0 00??,801217F3 0001 +Cheat21_O=$01 27 Lava side,$01 28 Icy side,$01 29 Lava train station,$01 2A Ice train station,$01 2B Chilli billi,$01 2C Chilly willy,$01 2D Colosseum kickball stadium lobby,$01 31 Boggy's igloo,$01 32 Icicle grotto,$01 33 Inside the volcano,$01 68 Icy side still +Cheat22="Instant Warp\Options\Cloud Cuckoo Land",D1080844 0000,811217F0 00??,801217F3 0001 +Cheat22_O=$01 36 Cloud Cuckoo Land 1,$01 37 Inside the trashcan,$01 38 Inside the cheesewedge,$01 39 Zubba's nest,$01 3A Central cavern,$01 3D Inside the pot o gold,$01 3E Mumbo's skull,$01 3F Mingy jongo's skull,$01 40 Humba wumba's wigwam,$01 61 Cloud Cuckoo Land 2,$01 88 Zubba's nest multi,$01 85 Trash can mini +Cheat23="Instant Warp\Options\Isle O Hags",D1080844 0000,811217F0 00??,801217F3 0001 +Cheat23_O=$01 4F Wooded Hollow,$01 50 Heggy's egg shed,$01 51 Jiggywiggy's temple,$01 52 Plateau,$01 53 Plateau "Honey B's Hive",$01 54 Pine Grove,$01 55 Cliff top,$01 56 Cliff top Mumbo's skull,$01 5A wasteland,$01 5B inside another digger tunnel,$01 5C Quagmire +Cheat24="Instant Warp\Options\Cauldron Keep",D1080844 0000,811217F0 00??,801217F3 0001 +Cheat24_O=$01 5D Cauldron Keep,$01 5E The gatehouse,$01 5F Tower of Tragedy Quiz,$01 60 Gun chamber,$01 6A Gun room still,$01 7B Crazy Castle Stockade balloon burst multi,$01 7C Crazy Castle Stockade Jump the hoops multi,$01 7D Grunty Industries packing game,$01 80 Colosseum kickball arena,$01 86 Dodgems +Cheat25="Instant Warp\Options\Not sure",D1080844 0000,811217F0 00??,801217F3 0001 +Cheat25_O=$00 FC Lord woo fak fak,$00 F9 Mr Patch,$01 21 Inside Chuffy's wagon,$01 34 Mumbo's Skull,$01 35 Humba Wumba's wigwam 1,$01 57 Humba Wumba's wigwam 2,$01 9B Jingalings Zombified Palace,$01 A6 Smuggler cavern,$01 41 Inside the digger tunnel,$01 43 Bottles house,$01 69 Bottles house still,$01 8A HAG Inside,$01 9A HAG1 Final Boss +Cheat0_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat2_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat3_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat4_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat5_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat6_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat7_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat8_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat9_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat10_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat11_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat12_N=To use this cheat, put the cheat on, then press L as you walk through a door to become that chosen character +Cheat13_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat14_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat15_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat16_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat17_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat18_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat19_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat20_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat21_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat22_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat23_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat24_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat25_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat26="Beta Bottles Revenge Mode",801255C2 0001,80080881 0002 +Cheat26_N=Bottles Revenge is a Beta mode from Banjo Tooie that the RWP team recently uncovered after an extraordinary amount of effort. Bottles the Spirit transforms into Bottles the Devil and posses enemies nearby and allows a second player hooked up to Pad 2 to play as that Posses character to try to foil Banjos Plans. As player one goes about its business, player two uses every enemy nearby to try to nab Banjo and take away some life. This mode is incredible, and you can control almost every enemy in the game: slot machines, flying creatures, uggers, zubbas...and this is just the beginning. (Congrats Rare Witch Project) + +//---- + +[91691C3D-F4AC5B4D-C:4A] +Name=Transformers - Beast Wars Metals 64 (J) +Cheat0="Infinite\Health\Player 1",8112A576 270F +Cheat1="Infinite\Stun Meter\Player 1",8012A579 00FF +Cheat2="Infinite\Health\Player 2",8114AAF6 270F +Cheat3="Infinite\Stun Meter\Player 2",8014AAF9 00FF +Cheat4="Play As\Player 1",801BBA54 00?? +Cheat4_O=$00 Optimus Primal,$01 Rattrap,$02 Cheetor,$03 Airazor,$04 Megatron,$05 Tarantulas,$06 Waspinator,$07 Terrorsaur +Cheat5="Play As\Player 2",801BBA55 00?? +Cheat5_O=$00 Optimus Primal,$01 Rattrap,$02 Cheetor,$03 Airazor,$04 Megatron,$05 Tarantulas,$06 Waspinator,$07 Terrorsaur + +//---- + +[65234451-EBD3346F-C:4A] +Name=Blast Dozer (J) +Cheat0="Infinite\Hydraulics Sidesweeper",803EDCE1 0063 +Cheat1="Infinite\Missiles Motor Bike",803F8C53 0063 +Cheat2="Infinite\Boosts Buggy Vehicle",803EE491 0064 +Cheat3="Sideswipe\Can Go In Water",803EDCE2 0063 +Cheat4="Sidesweep\Can Go Through Anything",803EDCE2 FFFF +Cheat5="J-Bomb Floats Through Anything",803F7C5A 0001 +Cheat6="Rapid Fire\Ballista",803F8C5D 0000 +Cheat7="Rapid Fire\Sideswipe",803EDCE6 0000 +Cheat8="Drive Through Anything\Ballista",803F8BF8 0001 +Cheat9="Drive Through Anything\Dump Truck",813EEBE8 0101 +Cheat10="Drive Through Anything\Red, White, & Blue Car",813EEFC8 0101 +Cheat11="Drive Through Anything\Skyfall",813EE438 0101 +Cheat12="Drive Through Anything\Police Car",813F8FD8 0101 +Cheat13="Drive Through Anything\Red Car",813FC658 0101 +Cheat14="Drive Through Anything\Van",813F93A8 0101 + +//---- + +[DF6FF0F4-29D14238-C:4A] +Name=Bomberman 64 - Arcade Edition (J) +Cheat0="Have\Max Fire",8024A39E 00FF +Cheat1="Have\Max Bombs",8024A39F 00FF +Cheat2="Bomb Select",8024A3A1 00?? +Cheat2_O=$02 Power Bomb,$03 Jelly Bomb,$04 Shock Wave Bomb,$05 Blue Remote Bomb,$06 Red Beem Bomb,$07 Invisible Mine Bomb,$1D Crazy Bomb,$00 Clear All Special Bombs. +Cheat3="Walk through\Blocks",8024A3A5 00?? +Cheat3_O=$00 Off,$01 On +Cheat3_N=Walk through Blocks like they are not there.Turn cheat to off to go back to normal. +Cheat4="Bomberman Speed",8024A3A0 00?? +Cheat4_O=$04 Slow,$08 Normal,$0E Fast,$10 Turbo +Cheat5="Have\Infinite\Kick",8024A3A6 0002 +Cheat6="Invincible",8024A3A8 00?? +Cheat6_O=$00 Off,$01 On +Cheat6_N=Enemies & Bomb Blasts cant harm you.But if you walk & keep laying Bombs it will most likly freeze.so try to avoid constant bombing while walking.Turn cheat to off to go back to normal. +Cheat7="Walk through\Bombs",8024A3A6 00?? +Cheat7_O=$00 Off,$01 On +Cheat7_N=Walk through Bombs like they are not there.Turn cheat to off to go back to normal. +Cheat8="Infinite\Health Hearts",8024A3AE 00FF +Cheat9="Infinite\Lives",802E1CE7 00FF +Cheat10="Infinite\Timer",800FDD72 002A + +//---- + +[67FF12CC-76BF0212-C:4A] +Name=Bomberman Hero (J) +Cheat0="Full\Bomb Power",80165239 0003 +Cheat1="Full\Fire Power",8016523A 0003 +Cheat2="Infinite\Health",8016523E 0004 +Cheat3="Infinite\Lives",8016523D 0009 +Cheat4="Extra Gems",D016523B 0000,8016523B 004B +Cheat5="Max\Bombs",80165239 0008 +Cheat6="Press L to Levitate",D005A2F5 0020,81154178 41CB,D005A2F5 0020,D0154154 0000,80154154 0040 +Cheat6_N=Press L to levitate & let go to come back down +Cheat7="Max\Score",80177601 00FF,80177602 00FF +Cheat8="Max\Explosion",8016523A 0008 + +//---- + +[D7C762B6-F83D9642-C:4A] +Name=Buck Bumble (J) +Cheat0="Have All\Guns & Infinite Ammo",81101DFA 0001,50000B04 0000,810EB156 03E7 +Cheat0_N=Press C Left to receive all Guns +Cheat1="Infinite\Health",810EB148 42D8 +Cheat1_N=If you fall into Water just turn off the Infinite Health & put back on after. +Cheat2="Infinite\99 Lives",810EB4C0 0005 +Cheat3="Have All\Keys",810EB150 0101,800EB152 0001 +Cheat4="Max Bonus",810EB4BA 270F + +//--- + +[A4F2F521-F0EB168E-C:4A] +Name=Chameleon Twist (J) +Cheat0="Extra Crowns",8024790B 0015 +Cheat1="Infinite Health",80168E73 000A +Cheat2="Extended Tongue",8132790E FFFF +Cheat3="Level Select",8029BF7B 00?? +Cheat3_O=$00 Stage 1,$01 Stage 2,$02 Stage 3,$03 Stage 4,$04 Stage 5,$05 Stage 6,$06 Stage 7 +Cheat3_N=When you press Pause in-game and Stage Quit yo will go to the Stage Screen this cheat lets you choose what Stage you would like to go to but make sure you turn the cheat off and press A to continue to that stage. + +//--- + +[0549765A-93B9D042-C:4A] +Name=Chameleon Twist 2 (J) +Cheat0="Infinite Health",80187BBD 000F +Cheat1="Max Collectable Items",80160641 0014 +Cheat2="Have 6 Carrots",80160659 007E +Cheat3="Have All\Levels",80160648 003F +Cheat4="Have All\Costumes",8016065A 00FE +Cheat5="Have All\Collectibles\Stage 1",80160650 0014 +Cheat6="Have All\Collectibles\Stage 2",80160651 0014 +Cheat7="Have All\Collectibles\Stage 3",80160652 0014 +Cheat8="Have All\Collectibles\Stage 4",80160653 0014 +Cheat9="Have All\Collectibles\Stage 5",80160654 0014 +Cheat10="Have All\Collectibles\Stage 6",80160655 0014 +Cheat11="Press L To levitate",D0187BF5 0020,81187B20 4200 +Cheat11_N=Press L To Levitate & Let go to land + +//---- + +[2BCCF9C4-403D9F6F-C:4A] +Name=Choro Q 64 (J) +Cheat1="Always 1st",802133B6 0001 +Cheat2="Class Select",80206857 00?? +Cheat2_O=$00 Class C,$01 Class B,$03 Class AA,$04 1 Play,$05 2 Play,$06 3 Play,$07 4 Play +Cheat2_N=This code is useful because you can play Class AA without having to beat a level! +Cheat0="Super Speed",81213568 4800 +Cheat0_N=This is Turbo fast,So to slow it down a little more keep the B button pressed down + +//---- + +[079501B9-AB0232AB-C:4A] +Cheat0="All Stuff Available For Player 1",50003802 0000,810F4230 FFFF +Cheat0_N=This modifies your save file. That will make all the multiplayer stages available, as well as unlocking every part. The actual breakdown is: +Cheat1="All Equipment Unlocked",50001402 0000,810F40B0 FFFF +Cheat2="All Equipment Registered",50001402 0000,810F40D8 FFFF +Cheat3="All Equipment Unhighlighted",50001402 0000,810F4100 FFFF +Cheat4="All Help Notes Available For Player 1",50000602 0000,810F409C FFFF +Cheat5="Side Invincible\Player 1",811FC00C 447A +Cheat6="Side Invincible\Player 2",811FC034 447A + +//---- + +[7188F445-84410A68-C:4A] +Name=Dance Dance Revolution - Disney Dancing Museum +Cheat0="Maximum Song Score\Player 1",8108A260 3B9A,8108A262 C9FF +Cheat1="Maximum Song Score\Player 2",8108A264 3B9A,8108A266 C9FF +Cheat2="Maximum Total Score\Player 1",810854E0 3B9A,810854E2 C9FF +Cheat3="Maximum Total Score\Player 2",81085518 3B9A,8101551A C9FF +Cheat4="Maximum Dance Gauge\Player 1",810854DC 03E8 +Cheat5="Maximum Dance Gauge\Player 2",81085514 03E8 +Cheat6="Unlock All Songs",8015621D 00FF,8115621E FFFF +Cheat7="Unlock All Puzzles",50001902 0000,81156228 FFFF +Cheat8="Can Skip End Credits",8015627F 0001 +Cheat9="Endless Mode",800854CD 0000 +Cheat10="Results\999 Perfect Steps\Player 1",8108A21E 03E7 +Cheat11="Results\999 Perfect Steps\Player 2",8108A236 03E7 +Cheat12="Results\999 Great Steps\Player 1",8108A222 03E7 +Cheat13="Results\999 Great Steps\Player 2",8108A23A 03E7 +Cheat14="Results\0 Good Steps\Player 1",8108A226 0000 +Cheat15="Results\0 Good Steps\Player 2",8108A23E 0000 +Cheat16="Results\0 Boo Steps\Player 1",8108A22A 0000 +Cheat17="Results\0 Boo Steps\Player 2",8108A242 0000 +Cheat18="Results\0 Miss Steps\Player 1",8108A22E 0000 +Cheat19="Results\0 Miss Steps\Player 2",8108A246 0000 + +//---- + +[8979169C-F189F6A0-C:4A] +Name=Dezaemon 3D (J) +Cheat0="Infinite\99 Lives",8023648D 0063 +Cheat1="Unlock Ramsie Mini-Game",801FF43E 0001 +Cheat2="Max Score",80249F91 00FF +Cheat3="Infinite\Speed",8024B6BC 00?? +Cheat3_O=$00 Normal,$01 Slow,$02 Medium,$03 Fast,$07 Warp Drive +Cheat4="Infinite\Stream Laser",80236CD0 00?? +Cheat4_O=$00 2 Stream Laser,$01 4 Stream Laser,$02 6 Stream Laser +Cheat5="Infinite\Shield",80250971 00?? +Cheat5_O=$01 On,$00 Off +Cheat6="Infinite\99 R Button Bombs",8024BD89 0063 + +//--- + +[7AA65B36-FDCEE5AD-C:4A] +Name=Doom 64 (J) +Cheat0="Always Have\Gun",80063B33 0001 +Cheat1="Always Have\Shotgun",80063B37 0001 +Cheat2="Always Have\Double Shotgun",80063B3B 0001 +Cheat3="Always Have\Chain Gun",80063B3F 0001 +Cheat4="Always Have\Missile Launcher",80063B43 0001 +Cheat5="Always Have\Chainsaw",80063B2B 0001 +Cheat6="Always Have\Plasma Rifle",80063B47 0001 +Cheat7="Always Have\BFG 9000",80063B4B 0001 +Cheat8="Always Have\Have Rocket Launcher",80063B41 0001 +Cheat9="Always Have\Laser Weapon",80063B4D 0001 +Cheat10="Always Have\Bio Suite",80063AF3 00?? +Cheat10_O=$FF On,$00 Off +Cheat11="Infinite\Armor",80063ADF 00FF +Cheat12="Always Have\Rapid Fire",81063BAA 0B94 +Cheat13="Invincible",80063B7B 0002 +Cheat14="Turn Map Markers On",80063B7B 0004 +Cheat15="Invincible And Map Markers",80063B7B 0006 +Cheat16="Berserk Mode",80063AEB 00FF +Cheat17="[Max Brightness]",8005B598 0064 +Cheat17_N=Enable this cheat on rom load to have Max Brightness (internal) and then put Jabo d3d8 on 160% Max for a extra brightness Boost. +Cheat18="Have All\Weapons",50000A04 0000,81063B2A 0001 +Cheat19="Infinite\Ammo All Weapons",50000404 0000,81063B52 013C +Cheat20="Have All\Keys",50000504 0000,81063AFE FFFF +Cheat21="Enable Cheat Menu",8005B043 0001 + +//---- + +[BFF7B1C2-AEBF148E-C:4A] +Name=Doraemon - Mittsu no Seireiseki (J) +Cheat0="Infinite\Lives",800F38C5 000A +Cheat1="Infinite\Energy",800FB897 00FF +Cheat2="Infinite\Bells",800F38C3 00?? +Cheat2_O=$63 99 Bells,$00 No Bells + +//--- + +[BD8E206D-98C35E1C-C:4A] +Name=Dobutsu no Mori (J) +Cheat0="Hours",80136FBE 00?? +Cheat0_O=$00 00 AM,$01 01 AM,$02 02 AM,$03 03 AM,$04 04 AM,$05 05 AM,$06 06 AM,$07 07 AM,$08 08 AM,$09 09 AM,$0A 10 AM,$0B 11 AM,$0C 00 PM,$0D 01 PM,$0E 02 PM,$0F 03 PM,$10 04 PM,$11 05 PM,$12 06 PM,$13 07 PM,$14 08 PM,$15 09 PM,$16 10 PM,$17 11 PM +Cheat1="Minutes",80136FBD 00?? +Cheat1_O=$00 00,$05 05,$0A 10,$0F 15,$14 20,$19 25,$1E 30,$23 35,$28 40,$2D 45,$32 50,$37 55,$3B 59 +Cheat2="Day",80136FBF 00?? +Cheat2_O=$01 Monday 1st,$02 Tuesday 2nd,$03 Wednesday 3rd,$04 Thursday 4th,$05 Friday 5th,$06 Saturday 6th,$07 Sunday 7th,$08 Monday 8th,$09 Tuesday 9th,$0A Wednesday 10th,$0B Thursday 11th,$0C Friday 12th,$0D Saturday 13th,$0E Sunday 14th,$0F Monday 15th,$10 Tuesday 16th,$11 Wednesday 17th,$12 Thursday 18th,$13 Friday 19th,$14 Saturday 30th,$15 Sunday 21st,$16 Monday 22nd,$17 Tuesday 23rd,$18 Wednesday 24th,$19 Thursday 25th,$1A Friday 26th,$1B Saturday 27th,$1C Sunday 28th,$1D Monday 29th,$1E Tuesday 30th,$1F Wednesday 31st +Cheat3="Month",80136FC1 00?? +Cheat3_O=$01 Jan,$02 Feb,$03 March,$04 April,$05 May,$06 June,$07 July,$08 Aug,$09 Sept,$0A Oct,$0B Nov,$0C Dec +Cheat4="Time Passes",80136FD2 00?? +Cheat4_O=$00 Time Normal,$01 Mins Like Seconds,$05 Hours & Mins Medium,$10 Hours & Mins Fast,$FF Time Zooms By +Cheat5="Max Cash",813BC34C FFFF +Cheat6="Item Select",81126EE8 ???? +Cheat6_O=$1011 Tall Red Cupboard,$1C00 Pet Cage,$1CA6 Fish Tank (Fish Included!),$1D2B Orange NES Game,$1D2F Grey NES Game,$1D33 Red NES Game,$1D37 Light Blue NES Game,$1D3A Yellow NES Game,$1D3E Purple NES Game,$1D42 Blue NES Game,$1D47 Stereo NES Colour,$1D4C Record Player,$1D50 JukeBox,$1DA0 Grandfather Clock,$1DA6 Stereo Kinda Thing,$1DA9 Stereo,$1DAC CD Player,$1DB3 Alarm Clock,$1EA1 Lamp,$1EA5 Snowman Fridge,$1EAB Round Snowman Table,$1EAF Snowman Bed,$1EB0 Snowman Seat,$2100 1000 Bag,$2100 1000 Bag,$2101 10000 Bag,$2101 10000 Bag,$2102 30000 Bag,$2102 30000 Bag,$2103 100 Bag,$2103 100 Bag,$2410 Nook's Shirt,$2410 Nook's Shirt,$2514 Flat Shell,$2514 Flat Shell,$2515 Pointy Shell,$2515 Pointy Shell,$2804 Orange,2804 Orange + +//---- + +[056EAB63-C215FCD5-C:4A] +Name=Dual Heroes (J) +Cheat0="Infinite\Energy\Player 1",81224DC4 00FF +Cheat1="Infinite\Energy\Player 2",81224DC6 00FF +Cheat2="Infinite\Time",81224DCC 00FF +Cheat3="Never Wins\Player 1",80224DB5 0000 +Cheat4="Never Wins\Player 2",80224DB7 0000 + +//---- + +[E13AE2DC-4FB65CE8-C:4A] +Name=Eltale Monsters (J) +Cheat0="Have All Elements",8107A9F4 3232,8107A9F6 3232 +Cheat1="Infinite Health",8107A9D4 01F4,8107A9D6 01F4 +Cheat2="Infinite Magic Points",8107A9D8 01F4,8107A9DA 01F4 +Cheat3="Super Agility",8107A9DE 01F4 +Cheat4="Super Defense",8107A9DC 01F4 + +//---- + +[399B9B81-D533AD11-C:4A] +Name=Extreme-G XG2 (J) +Cheat0="Max Points",80183DD3 0064 +Cheat1="Infinite\Nitros",81170F02 0003,81170F06 0003 +Cheat2="Infinite\Shield",81170F2C 42C8 +Cheat3="Access\All Tracks",50000BD8 0000,80183327 0001 +Cheat4="Access\All Superbikes",50000304 0000,80183D6F 0001 +Cheat5="Access\All Secret Characters",50000C04 0000,80183D6F 0001 +Cheat6="Always 1st",80171063 0001 +Cheat7="[Screen Hud Clear]",80092D1B 0004 +Cheat7_N=This Fixes the Problem on all Plugins that have Hud covering the Screen.Let the game load 1st before Putting this code on,Or it will give an error and Freeze + +//---- + +[147E0EDB-36C5B12C-C:4A] +Name=Neon Genesis Evangelion (J) +Cheat0="(Press GS)\To Refill Health",891F0F18 42C8,891F0F1A 0000 +Cheat0_N=Don't Press GS after the Enemy is killed, only during the fight! +Cheat1="(Press GS)\To Kill Enemy",891F2454 0000,891F2456 0000,891F2458 0000,891F245A 0000 +Cheat1_N=Don't Press GS after the Enemy is killed, only during the fight! and only use on Press GS Cheat at a time +Cheat2="(Press L)\ For One Hit Kill",D0149DD5 0020,811F2458 0000,D0149DD5 0020,811F245A 0000 +Cheat2_N=Don't Press L after the Enemy is killed, only during the fight! +Cheat4="Secret Beta 2 Player Test Mode",D00D5115 0015,800D5115 0055 +Cheat4_N=Press Reset and enjoy! Secret 2 Player Test Mode? The Second Player doesn't move ;( +Cheat3="(Press R)\For Level Warp",D00D5115 0015,800D5115 00?? +Cheat3_O=$2B Level 01,$2F Level 02,$33 Level 03,$37 Level 04,$3B Level 05,$3D Level 06,$40 Level 07,$43 Level 08,$46 Level 09,$49 Level 10,$4C Level 11,$4F Level 12,$51 Level 12.5,$53 Level 13,$18 Credits 1,$19 Credits 2,$1A Credits 3 +Cheat3_N=Press Reset and enjoy! + +//---- + +[4D3E622E-9B828B4E-C:4A] +Name=F-Zero X (J) +Cheat0="Always 1st Place",802C4BC2 0001 +Cheat1="Infinite Lives",800E5AA9 0005 +Cheat2="Unlock Everything",800CD428 0001 +Cheat3="Player 1\Infinite Shield",812C4B48 4336,812C4B4C 4336 +Cheat4="Have Boost From Start",D02C4DAC 003F,802C4925 0050 +Cheat5="Time Always 00.00.00 1st Place",802C4BC0 0000,802C4BC2 0001 + +//--- + +[49E46C2D-7B1A110C-C:4A] +Name=Fighting Cup (J) +Cheat0="Start with Stars Modifier\Player 1",D0208E17 0000,80208E17 00?? +Cheat0_O=$00 No Stars,$06 Max Stars +Cheat1="Start with Stars Modifier\Player 2",D020ACDF 0000,8020ACDF 00?? +Cheat1_O=$00 No Stars,$06 Max Stars +Cheat2="Have 1 Star\Ryuji",80306A0E 0001 +Cheat3="Have 1 Star\Bob",80306A0F 0001 +Cheat4="Have 1 Star\Pierre",80306A10 0001 +Cheat5="Have 1 Star\Meiling",80306A11 0001 +Cheat6="Have 1 Star\Leon",80306A12 0001 +Cheat7="Have 1 Star\Abdul",80306A13 0001 +Cheat8="Have 1 Star\Ninja",80306A14 0001 +Cheat9="Have 1 Star\Tomahawk",80306A15 0001 +Cheat10="Have 1 Star\Valerie",80306A16 0001 +Cheat11="Infinite Health\Player 1",80208F61 0000,80203E83 0000 +Cheat12="Infinite Health\Player 2",80203E87 0000,8020AE29 0000 +Cheat13="Start on stage 100 on Survival to get Joker",802EED3B 0063 +Cheat14="Stop timer for Fastest to get Robot",810AD29C 3F80 + +//---- + +[28D5562D-E4D5AE50-C:4A] +Name=Fire Electric Pen (J) +Cheat0="Freeze Timer",800760CB 0001 +Cheat0_N=Only enable this cheat once the Timer Go moves to 80. Once the level has ended or you have died disable and enable on 80. + +//---- + +[70B0260E-6716D04C-C:4A] +Name=GAUNTLET LEGENDS +Cheat0="Infinite\Max Health",810C5C54 0000,810C5C56 270F,810C5C64 0000,810C5C66 270F +Cheat1="Infinite\Money",810C5CF6 FFFF +Cheat2="Max Strength",810C5C04 0000,810C5C06 FFFF +Cheat3="Max Speed",810C5C14 0000,810C5C16 FFFF +Cheat4="Max Magic",810C5C24 0000,810C5C26 FFFF +Cheat5="Max Armour",810C5C34 0000,810C5C36 FFFF +Cheat6="Infinite\Turbo",800FD30F 0064 +Cheat7="Level 99",810C5C44 0000,810C5C46 0063 +Cheat9="Always Shoot 5-Way",800FD198 0200 +Cheat10="Always Shoot 3-Way",800FD19A 0002 +Cheat11="Always Shoot Rapid Fire",800FD19A 1000 +Cheat12="Have Window Schards",8104EFCA 000F +Cheat13="Have Rune Stones",8104EFC6 1FFF +Cheat14="Infinite\Item On Pickup",50010100 0000,810C5BF6 FFFF +Cheat15="Infinite\Keys On Pickup",800C5C97 0006 +Cheat8="Infinite\Special Weapons",800C5FF7 0009,800C5D37 0009,800C5D67 0009,800C5DE7 0009,800C5EB7 0009 + +//---- + +[0DE2CE36-D41D29E6-C:4A] +Name=Hybrid Heaven (J) +Cheat0="Have All\Keys",50000410 0000,80181C70 0063,50000410 0000,80181C78 0063 +Cheat1="Infinite\Weapons & Items",50000610 0000,80181C10 0063,50000610 0000,80181C18 0063 +Cheat2="Infinite\Refresh Items",50000D10 0000,80181B48 0063,50000C10 0000,80181B50 0063 +Cheat3="Infinite\Max Body Stats",81181788 270F,811817C8 0063,50000C02 0000,81181790 270F,50000502 0000,811817C0 270F,50000602 0000,811817E8 270F,50000602 0000,811817F6 270F +Cheat4="Infinite\Max Health",81181780 270F,81181782 270F +Cheat5="Level 999",811817C8 270F +Cheat6="Press L To Levitate",D005D8D1 0020,8124C710 3FCB + +//---- + +[519EA4E1-EB7584E8-C:4A] +Name=KING HILL 64 +Cheat0="Max\50000 Stunt Points",8108C978 C350 +Cheat2="Have\All Characters",8108C9B8 07FF +Cheat3="Have\All Difficulties",8108C9B0 0700 +Cheat4="Have\All Tracks",8108C9BC BFFE +Cheat5="Have\All Boards",8108C9C4 0003,8108C9C6 FFFF +Cheat1="Low Timer",8008C8A4 0000,8008C8A6 0000 + +//---- + +[6BFF4758-E5FF5D5E-C:4A] +Name=Mario Kart 64 (J) (1.0) +Cheat0="Infinite Items\2 player Mode\Player 1",80163655 00??,80163682 00?? +Cheat0_O=$0D Double Mushroom,$09 Fake Item Box,$0B Ghost,$0A Invincible Star,$08 Lightning,$01 Single Banana,$03 Single Green Shell,$0C Single Mushroom,$05 Single Red Shell,$0F Super Mushroom,$04 Triple Green Shell,$0E Triple Mushroom,$06 Triple Red Shell,$02 Banana Bunch,$07 Blue Spiny Shell +Cheat1="Infinite Items\2 player Mode\Player 2",80163735 00??,80163762 00?? +Cheat1_O=$0D Double Mushroom,$09 Fake Item Box,$0B Ghost,$0A Invincible Star,$08 Lightning,$01 Single Banana,$03 Single Green Shell,$0C Single Mushroom,$05 Single Red Shell,$0F Super Mushroom,$04 Triple Green Shell,$0E Triple Mushroom,$06 Triple Red Shell,$02 Banana Bunch,$07 Blue Spiny Shell +Cheat2="Infinite Items\3-4 player Mode\Player 1",80163815 00??,80163842 00?? +Cheat2_O=$0D Double Mushroom,$09 Fake Item Box,$0B Ghost,$0A Invincible Star,$08 Lightning,$01 Single Banana,$03 Single Green Shell,$0C Single Mushroom,$05 Single Red Shell,$0F Super Mushroom,$04 Triple Green Shell,$0E Triple Mushroom,$06 Triple Red Shell,$02 Banana Bunch,$07 Blue Spiny Shell +Cheat3="Infinite Items\3-4 player Mode\Player 2",801638F5 00??,80163922 00?? +Cheat3_O=$0D Double Mushroom,$09 Fake Item Box,$0B Ghost,$0A Invincible Star,$08 Lightning,$01 Single Banana,$03 Single Green Shell,$0C Single Mushroom,$05 Single Red Shell,$0F Super Mushroom,$04 Triple Green Shell,$0E Triple Mushroom,$06 Triple Red Shell,$02 Banana Bunch,$07 Blue Spiny Shell +Cheat4="Infinite Items\3-4 player Mode\Player 3",801639D5 00??,80163A02 00?? +Cheat4_O=$0D Double Mushroom,$09 Fake Item Box,$0B Ghost,$0A Invincible Star,$08 Lightning,$01 Single Banana,$03 Single Green Shell,$0C Single Mushroom,$05 Single Red Shell,$0F Super Mushroom,$04 Triple Green Shell,$0E Triple Mushroom,$06 Triple Red Shell,$02 Banana Bunch,$07 Blue Spiny Shell +Cheat5="Infinite Items\3-4 player Mode\Player 4",80163AB5 00??,80163AE2 00?? +Cheat5_O=$0D Double Mushroom,$09 Fake Item Box,$0B Ghost,$0A Invincible Star,$08 Lightning,$01 Single Banana,$03 Single Green Shell,$0C Single Mushroom,$05 Single Red Shell,$0F Super Mushroom,$04 Triple Green Shell,$0E Triple Mushroom,$06 Triple Red Shell,$02 Banana Bunch,$07 Blue Spiny Shell +Cheat6="Have Bonus Mode and All Gold Cups",8018C728 00??,8018C729 00??,8018C72A 00??,8018C72B 00?? +Cheat6_O=$00 Off,$FF On +Cheat7="Press GS\For Full Debug Menu",8818C80F 0002 +Cheat7_N=Press GS at the Press Start Menu to access the Debug Menu +Cheat8="Press L To Levitate\Player 1",D00F73C5 0020,810F7478 4000 +Cheat9="Press L To Levitate\Player 2",D00F73D5 0020,810F8250 4000 +Cheat10="Press L To Levitate\Player 3",D00F73E5 0020,810F9028 4000 +Cheat11="Press L To Levitate\Player 4",D00F73F5 0020,810F9E00 4000 + +//---- + +[C9C3A987-5810344C-C:4A] +Name=Mario Kart 64 (J) (1.1) +Cheat0="Have Bonus Mode and All Gold Cups",8018B4D8 00??,8018B4D9 00??,8018B4DA 00??,8018B4DB 00?? +Cheat0_O=$00 Off,$FF On +Cheat1="Press GS\For Full Debug Menu",8818B5BF 0002 +Cheat1_N=Press GS at the Press Start Menu to access the Debug Menu +Cheat2="Press L To Levitate\Player 1",D00F61B5 0020,810F6268 4000 +Cheat3="Press L To Levitate\Player 2",D00F61C5 0020,810F7040 4000 +Cheat4="Press L To Levitate\Player 3",D00F61D5 0020,810F7E18 4000 +Cheat5="Press L To Levitate\Player 4",D00F61E5 0020,810F8BF0 4000 + +//---- + +[ADA815BE-6028622F-C:4A] +Name=Mario Party (J) +Cheat0="Top Left Character\Coin Options",800F2709 00?? +Cheat1="Top Left Character\Star Options",800F270D 00?? +Cheat2="Top Right Character\Coin Options",800F2739 00?? +Cheat3="Top Right Character\Star Options",800F273D 00?? +Cheat4="Lower Left Character\Coin Options",800F2769 00?? +Cheat5="Lower Left Character\Star Options",800F276D 00?? +Cheat6="Lower Right Character\Coin Options",800F2799 00?? +Cheat7="Lower Right Character\Star Options",800F279D 00?? +Cheat8="Top Left Character\Dice Always",800D5782 00?? +Cheat9="Top Right Character\Dice Always",800D57C6 00?? +Cheat10="Lower Left Character\Dice Always",800D580A 00?? +Cheat11="Lower Right Character\Dice Always",800D584E 00?? +Cheat12="Mini Game\Unlimited 99 lives",800F2C03 0063 +Cheat13="Mini Game\Max 99 Coins",800F2C0C 0063 +Cheat0_O=$00 0 Coins,$0A 10 Coins,$64 100 Coins,$FF 255 Coins +Cheat1_O=$00 0 Stars,$64 99 Stars +Cheat2_O=$00 0 Coins,$0A 10 Coins,$64 100 Coins,$FF 255 Coins +Cheat3_O=$00 0 Stars,$64 99 Stars +Cheat4_O=$00 0 Coins,$0A 10 Coins,$64 100 Coins,$FF 255 Coins +Cheat5_O=$00 0 Stars,$64 99 Stars +Cheat6_O=$00 0 Coins,$0A 10 Coins,$64 100 Coins,$FF 255 Coins +Cheat7_O=$00 0 Stars,$64 99 Stars +Cheat8_O=$00 Rolls In Random,$01 Rolls In 1,$02 Rolls In 2,$03 Rolls In 3,$04 Rolls In 4,$05 Rolls In 5,$06 Rolls In 6,$07 Rolls In 7,$08 Rolls In 8,$09 Rolls In 9,$0A Rolls In 10 +Cheat9_O=$00 Rolls In Random,$01 Rolls In 1,$02 Rolls In 2,$03 Rolls In 3,$04 Rolls In 4,$05 Rolls In 5,$06 Rolls In 6,$07 Rolls In 7,$08 Rolls In 8,$09 Rolls In 9,$0A Rolls In 10 +Cheat10_O=$00 Rolls In Random,$01 Rolls In 1,$02 Rolls In 2,$03 Rolls In 3,$04 Rolls In 4,$05 Rolls In 5,$06 Rolls In 6,$07 Rolls In 7,$08 Rolls In 8,$09 Rolls In 9,$0A Rolls In 10 +Cheat11_O=$00 Rolls In Random,$01 Rolls In 1,$02 Rolls In 2,$03 Rolls In 3,$04 Rolls In 4,$05 Rolls In 5,$06 Rolls In 6,$07 Rolls In 7,$08 Rolls In 8,$09 Rolls In 9,$0A Rolls In 10 +Cheat0_N=If you want to have full 255 Coins,1st use the 100 Option then put on 255. this will stop the numbers from changing & spoiling the result. +Cheat8_N=With this option you can calculate exactly how many you need to get on the position of your choice. +Cheat9_N=With this option you can calculate exactly how many you need to get on the position of your choice. +Cheat10_N=With this option you can calculate exactly how many you need to get on the position of your choice. +Cheat11_N=With this option you can calculate exactly how many you need to get on the position of your choice. + +//---- + +[3A6C42B5-1ACADA1B-C:4A] +Name= Mario Tennis 64 (J) +Cheat0="Have All\Characters Available",8105DEB8 FFFF +Cheat1="Have All\Courts Available",8105DEBC FFFF +Cheat2="Score\Player 1",8014B1DA 00?? +Cheat3="Score\Player 2",8014B1DB 00?? +Cheat2_O=$00 0,$01 15,$02 30,$03 40 +Cheat3_O=$00 0,$01 15,$02 30,$03 40 + +//---- + +[736AE6AF-4117E9C7-C:4A] +Name=Mickey no Racing Challenge USA (J) +Cheat0="Play As",800D3161 00?? +Cheat0_O=$00 Mickey Mouse,$01 Daisy Duck,$02 Goofy,$03 Pete,$04 Minnie Mouse,$05 Donald Duck,$06 Huey,$07 Dewey,$08 Louie,$09 Lugwig Von Drake +Cheat1="Traffic Troubles\Indianapolis\Max Tokens",8018E892 0063 +Cheat2="Traffic Troubles\San Fransisco\Max Tokens",80191B62 0063 +Cheat3="Traffic Troubles\New Mexico\Max Tokens",8018FD52 0063 +Cheat4="Traffic Troubles\Grand Canyon\Max Tokens",80193252 0063 +Cheat5="Motor Way Mania\Los Angeles\Max Tokens",8018DCF2 0063 +Cheat6="Motor Way Mania\Alaska\Max Tokens",8018E482 0063 +Cheat7="Motor Way Mania\Las Vegas\Max Tokens",80192B12 0063 +Cheat8="Motor Way Mania\Philadelphia\Max Tokens",80193992 0063 +Cheat9="Freewayphobia\Dakota\Max Tokens",8018D212 0063 +Cheat10="Freewayphobia\Seattle\Max Tokens",8018FDF2 0063 +Cheat11="Freewayphobia\New York\Max Tokens",8018F512 0063 +Cheat12="Freewayphobia\Chicago\Max Tokens",80192042 0063 +Cheat13="Victory Vehicles\Yellowstone\Max Tokens",8018D4C2 0063 +Cheat14="Victory Vehicles\Washington DC\Max Tokens",80197662 0063 +Cheat15="Victory Vehicles\Everglades\Max Tokens",8018FC22 0063 +Cheat16="Victory Vehicles\Malibu\Max Tokens",801916B2 0063 +Cheat17="Frantic Finale\Hawaii\Max Tokens",80192072 0063 +Cheat18="Frantic Finale\Oregon\Max Tokens",8018EA42 0063 +Cheat19="Frantic Finale\Texas\Max Tokens",8018F1E2 0063 +Cheat20="Frantic Finale\Colorado\Max Tokens",80191992 0063 +Cheat21="Level Select",801876B9 00?? +Cheat21_O=$00 Traffic Troubles,$01 Motor Way Mania,$02 Freewayphobia,$03 Vitory Vehicles,$04 Frantic Finale,$05 Time Trial,$06 Practice,$07 Contest,$08 Options +Cheat22="Difficulty Select",8007C000 00?? +Cheat22_O=$00 Amateur,$01 Intermediate,$02 Professional,$03 Mirror Mode +Cheat24="Always 1st & final time 00:00.00",50000301 0000,801CE6E9 0000 +Cheat24_N=All Levels +Cheat23="Unlock Everything",800D3208 008F,800D3209 0094,800D320A 0003,800D320C 0001,800D320F 0080,50000502 0000,800D3210 0009,50000502 0000,800D3211 0024,800D321A 0015,800D321B 007F,800D321C 0001,800D321D 00FF,800D321E 0004,800D321F 0022 +Cheat23_N=This will unlock all characters, tracks, mirror mode, all in-game cheats, postcards, pluto's collar and give you all Trophies for every track and difficulties. To have this cheat save to mempak, enable it and then go into the Options Menu and disable the cheat. Go to the Wide-Screen Settings and Change it to Wide-Screen [16.9] and then the B button to get back to Wide-Screen Settings, now go back into Wide-Screen [16.9] and change it back to Normal [4.3].and press the B button until you come back to the main Options Menu.Close the game and load it again to see everything saved to the Mempak and unlocked. +Cheat1_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat2_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat3_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat4_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat5_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat6_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat7_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat8_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat9_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat10_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat11_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat12_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat13_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat14_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat15_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat16_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat17_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat18_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat19_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat20_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + +//---- + +[96747EB4-104BB243-C:4A] +Name=Perfect Dark (J) +Cheat0="Have All Weapons\Player 1",80206B60 0007,801EDB60 0007,801D4B60 0007 +Cheat1="Infinite\Ammo\Player 1",802062EF 00FF,801ED2EF 00FF,801D42EF 00FF,80205B4B 00FF,801ECB4B 00FF,801D3B4B 00FF +Cheat2="Infinite\Health\Player 1",812053CC 3F80,811EC3CC 3F80,811D33CC 3F80 +Cheat3="Infinite\Shield\Player 1",812053E0 3F80,811E35A0 3F80,811CA5A0 3F80 +Cheat4="Have All\Weapons\Player 2",802087D0 0007,801EF7D0 0007,801D67D0 0007 +Cheat5="Infinite\Ammo\Player 2",80207F5F 00FF,801EEF5F 00FF,801D5F5F 00FF,802077BB 00FF,801EE7BB 00FF,801D57BB 00FF +Cheat6="Infinite\Health\Player 2",8120703C 3F80,811EE03C 3F80,811D503C 3F80 +Cheat7="Infinite\Shield\Player 2",811FE210 3F80,811E5210 3F80,811CC210 3F80 +Cheat8="All levels Compleate",50003201 0000,800A2940 0001,50003201 0000,800A2972 0001,50003201 0000,800A29A4 0001 +Cheat0_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat1_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat2_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat3_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat4_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat5_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat6_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat7_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat8_N=This activate's solo missions, give all medals on solo missions, activate cheats, activate cinemas, and who knows what else. I just don't have the time to identify these codes. I know that some of this is creditted to Zap2. I don't have the time to cut those codes out. + +//---- + +[09CC4801-E42EE491-C:4A] +Name=Pilot Wings64 (J) + +//---- + +[EC0F690D-32A7438C-C:4A] +Name=Pocket Monsters Snap (J) +Cheat0="[Enable All Levels]",810C18E2 0006 +Cheat0_N=This is needed to be able to Play all Levels of the Game + +//---- + +[94807E6B-60CC62E4-C:4A] +Name=Puyo Puyo Sun 64 (J) +Cheat0="Maximum Score\Player 1",811632CC 05F5,811632CE E0FF +Cheat1="Maximum Score\Player 2",811632D0 05F5,811632D2 E0FF +Cheat2="No Warning Icons\Player 1",80164EA3 0000 +Cheat3="No Warning Icons\Player 2",80164EA7 0000 +Cheat4="Instant 7th Step of Chain\Player 1",D0163A2B 0001,80163A2B 0007 +Cheat5="Instant 7th Step of Chain\Player 2",D0163E5B 0001,80163E5B 0007 +Cheat6="Options Complete Demo Viewer",8016320B 0007,8116320C FFFF,8116320E FFFF +Cheat7="Mode Total Continues 0",801632AF 0000,801632C7 0000 +Cheat8="Endless Mode\Player Level 99 Player 1",801632E7 0063 +Cheat9="Endless Mode\Player Level 99 Player 2",801632EB 0063 +Cheat10="Nazo Puyo Mode\All Practice Stages Cleared 4",50000402 0000,811631E8 FFFF +Cheat11="1P Mode\Stage Select",D0162FEB 0001,80162FEB 00?? +Cheat11_O=$0D Satan Arle game,$08 Satan Schezo game,$0E Car-kun Arle game,$09 Car-kun Schezo game + +//---- + +[9F1ECAF0-EEC48A0E-C:4A] +Name=Rakuga Kids (J) +Cheat0="Infinite Energy\Player 1",800AC339 00?? +Cheat0_O=$00 None,$40 Max +Cheat1="Infinite Energy\Player 2",800AC429 00?? +Cheat1_O=$00 None,$3F Max +Cheat2="Super Attacks\Player 1",800AC33D 00?? +Cheat2_O=$00 None,$03 3 +Cheat3="Super Attacks\Player 2",800AC42D 00?? +Cheat3_O=$00 None,$03 3 +Cheat4="Infinite Match Time",800AB433 0000 +Cheat5="Unlock Extras",800ACA05 00FF,800ACA07 00FF + +//---- + +[B6BC0FB0-E3812198-C:4A] +Name=Sin and Punishment - Tsumi To Batsu (J) +Cheat0="All Levels\Unlock All\Levels - Options Menu",80075DD6 FFFF,80075DD7 FFFF +Cheat1="All Levels\Unlock All\Option Menu Items",80075DD8 FFFF,80075DD9 FFFF +Cheat2="All Levels\Infinite\Energy",800D5A9B 00FF +Cheat3="All Levels\Infinite\Time",800D5A97 0063 +Cheat4="All Levels\Infinite\Max Credits",80075DDC 00FF +Cheat5="Level\0-0\Invincible",8010BB2B 0001 +Cheat6="Level\1-1\Invincible",801657FB 0001 +Cheat7="Level\1-2\Invincible",801BCFBB 0001 +Cheat8="Level\1-3\Invincible",8011270B 0001 +Cheat9="Level\2-1\Invincible",801BD2BB 0001 +Cheat10="Level\2-2\Invincible",801B913B 0001 +Cheat11="Level\2-3\Invincible",801A7D0B 0001 +Cheat12="Level\3-1\Invincible",8015890B 0001 +Cheat13="Level\3-2\Invincible",801B938B 0001 +Cheat14="Level\3-3\Invincible",81100E08 C350 +Cheat15="Level\0-0\Infinite Air Jumping",8010BB0C 0000 +Cheat16="Level\1-1\Infinite Air Jumping",801657DC 0000 +Cheat17="Level\1-2\Infinite Air Jumping",801BCF9C 0000 +Cheat18="Level\1-3\Infinite Air Jumping",801126EC 0000 +Cheat19="Level\2-1\Infinite Air Jumping",801BD29C 0000 +Cheat20="Level\2-2\Infinite Air Jumping",801B911C 0000 +Cheat21="Level\2-3\Infinite Air Jumping",801A7CEC 0000 +Cheat22="Level\3-1\Infinite Air Jumping",801588EC 0000 +Cheat23="Level\3-2\Infinite Air Jumping",801B936C 0000 +Cheat24="Level\3-3\Infinite Air Jumping",801013CC 0000 +Cheat5_N=Only use one Ivincible level Code at a time for that specific level and only use for that specific level Cheat +Cheat6_N=Only use one Ivincible level Code at a time for that specific level and only use for that specific level Cheat +Cheat7_N=Only use one Ivincible level Code at a time for that specific level and only use for that specific level Cheat +Cheat8_N=Only use one Ivincible level Code at a time for that specific level and only use for that specific level Cheat +Cheat10_N=Only use one Ivincible level Code at a time for that specific level and only use for that specific level Cheat +Cheat11_N=Only use one Ivincible level Code at a time for that specific level and only use for that specific level Cheat +Cheat12_N=Only use one Ivincible level Code at a time for that specific level and only use for that specific level Cheat +Cheat13_N=Only use one Ivincible level Code at a time for that specific level and only use for that specific level Cheat +Cheat14_N=Only use one Ivincible level Code at a time for that specific level and only use for that specific level Cheat +Cheat15_N=Only use one Infinite Air Jumping level Code at a time and only use for that specific level Cheat +Cheat16_N=Only use one Infinite Air Jumping level Code at a time for that specific level and only use for that specific level Cheat +Cheat17_N=Only use one Infinite Air Jumping level Code at a time for that specific level and only use for that specific level Cheat +Cheat18_N=Only use one Infinite Air Jumping level Code at a time for that specific level and only use for that specific level Cheat +Cheat19_N=Only use one Infinite Air Jumping level Code at a time for that specific level and only use for that specific level Cheat +Cheat20_N=Only use one Infinite Air Jumping level Code at a time for that specific level and only use for that specific level Cheat +Cheat21_N=Only use one Infinite Air Jumping level Code at a time for that specific level and only use for that specific level Cheat +Cheat22_N=Only use one Infinite Air Jumping level Code at a time for that specific level and only use for that specific level Cheat +Cheat23_N=Only use one Infinite Air Jumping level Code at a time for that specific level and only use for that specific level Cheat +Cheat24_N=Only use one Infinite Air Jumping level Code at a time for that specific level and only use for that specific level Cheat + +//---- + +[66572080-28E348E1-C:4A] +Name=Super Robot Spirits (J) +Cheat1="Infinite Sp",802016AB 005A +Cheat2="Infinite Time",80260BDE 0000 +Cheat0="Infinite Hp",802016A7 0000 +Cheat3="Player 2 Health Mod",80206AF7 00?? +Cheat3_O=$00 Infinite Health,$C8 Instant Death +Cheat4="Play As",801B9D5C 00?? +Cheat4_O=$00 FINAL BOSS,$01 R1,$02 DAITARN 3,$03 DANCOUGAR,$04 SHINING GUNDAM,$05 DUNBINE,$06 WALKER GALLIER,$07 VOLTES V,$08 1st BOSS + +//---- + +[67D20729-F696774C-C:4A] +Name=All Star! Dairantou Smash Brothers (J) +Cheat0="Give Kirby A Wierd Blow-Up",8025C118 000A +Cheat1="Story Mode\Skip Straight To Master Hand",800A2AA7 000D +Cheat2="Story Mode\Infinite Time",810A2AEE 43CB +Cheat3="Story Mode\Player 1\Infinite Lives",800A2B03 0004 +Cheat4="Story Mode\Player 2\Infinite Lives",800A2B77 0004 +Cheat5="Story Mode\Player 3\Infinite Lives",800A2BEB 0004 +Cheat6="Story Mode\Player 4\Infinite Lives",800A2C5F 0004 +Cheat7="Story Mode\Player 1\Low % Health",810A2B46 0000 +Cheat8="Story Mode\Player 2\Low % Health",810A2BBA 0000 +Cheat9="Story Mode\Player 3\Low % Health",810A2C2E 0000 +Cheat10="Story Mode\Player 4\Low % Health",810A2CA2 0000 +Cheat11="Story Mode\Player 1\Character Modifier",800A2AFB 00?? +Cheat12="Story Mode\Player 2\Character Modifier",800A2B6F 00?? +Cheat13="Story Mode\Player 3\Character Modifier",800A2BE3 00?? +Cheat14="Story Mode\Player 4\Character Modifier",800A2C57 00?? +Cheat15="Story Mode\Player 1\Kirby B Button Move\Hyrule Castle",80266ACF 00?? +Cheat16="Story Mode\Player 1\Kirby B Button Move\Yoshi's Island",80266E0F 00?? +Cheat17="Story Mode\Player 1\Kirby B Button Move\Sector Z",8026F0B7 00?? +Cheat18="Story Mode\Player 1\Kirby B Button Move\Peach's Castle",80261D5F 00?? +Cheat19="Story Mode\Player 1\Kirby B Button Move\Saffron City",80271A57 00?? +Cheat20="Story Mode\Player 1\Kirby B Button Move\Congo Jungle",8026EA8F 00?? +Cheat21="Story Mode\Player 1\Kirby B Button Move\Kirby's Dreamland",8026BAFF 00?? +Cheat22="Story Mode\Player 1\Kirby B Button Move\Planet Zebes",8026DF67 00?? +Cheat23="Story Mode\Player 1\Kirby B Button Move\Metal Mario Stage",80261557 00?? +Cheat24="Story Mode\Player 1\Kirby B Button Move\Fighting Polygon Team",802606DF 00?? +Cheat25="Story Mode\Player 1\Kirby B Button Move\Master Hand Stage",8026FC0F 00?? +Cheat26="VS. Mode\Infinite Time",810A2CDE 43CB +Cheat27="VS. Mode\Player 1\Low % Health",810A2D36 0000 +Cheat28="VS. Mode\Player 2\Low % Health",810A2DAA 0000 +Cheat29="VS. Mode\Player 3\Low % Health",810A2E1E 0000 +Cheat30="VS. Mode\Player 4\Low % Health",810A2E92 0000 +Cheat31="VS. Mode\Player 1\Character Modifier",800A2CEB 00?? +Cheat32="VS. Mode\Player 2\Character Modifier",800A2D5F 00?? +Cheat33="VS. Mode\Player 3\Character Modifier",800A2DD3 00?? +Cheat34="VS. Mode\Player 4\Character Modifier",800A2E47 00?? +Cheat35="VS. Mode\Player 1\Kirby B Button Move\Hyrule Castle",802619AF 00?? +Cheat36="VS. Mode\Player 1\Kirby B Button Move\Yoshi's Island",8026C277 00?? +Cheat37="VS. Mode\Player 1\Kirby B Button Move\Sector Z",80269F47 00?? +Cheat38="P1 Press Down On D-Pad To Make Items Appear In Random Spots",D109CF64 0400,8118B062 0001 +Cheat39="Have All Characters",810A28F8 0FF0 +Cheat40="VS. Mode\Have Mushroom Kindom",800A28F7 00FF +Cheat41="Story Mode\Always Get Pacifist (60,000 Points)",810A2B2E 0000 +Cheat42="Bonus Stage Character Modifier (Training Mode)",8018D193 00?? +Cheat11_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat12_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat13_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat14_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat15_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat16_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat17_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat18_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat19_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat20_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat21_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat22_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat23_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat24_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat25_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat31_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat32_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat33_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat34_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat35_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat36_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat37_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat42_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat11_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code could also result freezing at the end of the Level. +Cheat12_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat13_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat14_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat31_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat32_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat33_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat34_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat42_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + +//---- + +[84FC04FF-B1253CE9-C:4A] +Name=Snowbow Kids (J) +Cheat0="Infinite\Tools Options",801215B5 00?? +Cheat0_O=$01 Fan,$02 Ghost,$03 Pan,$04 Rock,$05 Mouse,$06 Board +Cheat1="Infinite\Lucky Dip",801215B4 0003 +Cheat2="999 Trick Game Pts",81121360 03E7 +Cheat3="1 Lap Race",D01215A8 0000,801215A8 0009 +Cheat4="Infinite\Cash",8012160A C350 +Cheat5="Enable Sinobin",8110A17E 0100 +Cheat6="Access Gold Medals",50006002 0000,810EBD42 0101 +Cheat1_N="Lucky Dip is Infinite Usage Of What Ever You Get From Each Red Box" +Cheat2_N=Press the A Button to stop Count,or it will continue to grow without stoping. + +//---- + +[A7941528-61F1199D-C:4A] +Name=Chou Snowbow Kids (J) +Cheat0="All Gold Medals",50000502 0000,81259130 0101 +Cheat1="Max Coins",8125A5BE 270F,8025A5BF 00C8 +Cheat2="Infinite\Trick Game 300 Points",8125A7F2 012C +Cheat3="Infinite\Tools Options",8025A624 00?? +Cheat3_O=$01 Frying Pan,$02 Ghost,$03 Super Ghost,$04 Fan,$05 Rocket,$06 Invisible,$07 Rock,$08 Rat Face,$09 Super Rat Face,$0A Wings +Cheat4="Infinite\Weapons Options",8025A622 00??,8025A623 0009 +Cheat4_O=$01 Slap Stick,$02 Parachute,$03 Freeze Shot,$04 Snowman,$05 Bomb,$06 Whirlwind +Cheat5="Open Extra Characters & Snowboards",8125916E 0101,80259170 0001,8025915C 0001,8125915E 0101,81259160 0101 +Cheat5_N=Battle Mode Only + +//---- + +[61F5B152-046122AB-C:4A] +Name=Star Wars Episode I - Racer (J) +Cheat0="No Damage",800A8047 0001 +Cheat1="Always 1st",8011C25D 0001 +Cheat2="Have All Tracks Completed",811170DA FFFF,811170DC 3FFF,811170DE 3FFF,811170E0 3FFF,811170E2 00FF +Cheat3="Have All Characters",801170E2 007D,811170E4 FFFF +Cheat4="Unlock All Tracks",801170D8 00FF,801170D9 00FF,801170DA 00FF,801170DB 00FF,811170D8 FFFF + +//---- + +[4EAA3D0E-74757C24-C:4A] +Name=Super Mario 64 (J) +Cheat0="Mario's Cap\Off Options",80339E07 00?? +Cheat0_N=Here you can Choose Options with Mario without His Cap on,Do not use with any other Mario with/without Options,Use only one at a time +Cheat0_O=$01 Mario No Cap,$02 Invisible Mario,$04 Metal Mario,$08 Flying Mario,$0A Invisible Flying Mario,$0D Metal Flying Mario,$0F Invisible Metal Flying Mario +Cheat1="Mario's Cap\On Options",80339E07 00?? +Cheat1_N=Here you can Choose Options with Mario with His Cap on,Do not use with any other Mario with/without Options,Use only one at a time +Cheat1_O=$12 Invisible Mario,$15 Metal Mario,$16 Invisible Metal Mario,$19 Flying Mario +Cheat2="Funny Mario Options\Mario's Cap\Off & in His Hand",80339E07 00?? +Cheat2_O=$20 Cap In Hand,$22 Invisible Mario Cap In Hand,$24 Metal Mario Cap In Hand,$26 Invisible Metal Mario Cap In Hand,$28 Flying Mario Cap In Hand +Cheat2_N=Here you can Choose Options with Mario with His Cap off & in His Hand,Do not use with any other Mario with/without Options,Use only one at a time +Cheat3="Funny Mario Options\Mario's Cap\On & An Extra in His Hand",80339E07 00?? +Cheat3_O=$30 Cap In Hand,$32 Invisible Mario Cap In Hand,$34 Metal Mario Cap In Hand,$36 Invisible Metal Mario Cap In Hand,$38 Flying Mario Cap In Hand +Cheat3_N=Here you can Choose Options with Mario with His Cap on & An Extra in His Hand,Do not use with any other Mario with/without Options,Use only one at a time +Cheat4="Infinite\Energy & Breath",80339EAE 0008 +Cheat5="Infinite\Lives",80339EAD 0064 +Cheat6="Have\Level Select",8032C64C 0001 +Cheat7="Don't Hurt Mario\Monsters",A0339E27 0001 +Cheat8="Have\Debug Mode",8032C658 00?? +Cheat8_O=$01 On,$00 Off +Cheat9="Press GS for 255 Coins",89339EA8 00FF +Cheat10="Press L To Levitate",D0339C31 0020,81339E4C 4220,D0339E4D 0020,81339E0C 0300,D0339E4D 0020,81339E0E 0880 +Cheat10_N=Press L to levitate & Let go to land +Cheat11="Have All\175 Stars",80207B0B 00FF,50000D02 0000,81207B0C FFFF +Cheat11_N=I have Managed to put a Have 175 Stars Option in for you,once the Code is activated, you will see it as a new option in Save Slot A. +Cheat12="Have All\Maxed Out Coin Records For All Levels",80207B25 00FF,81207B26 FFFF,81207B28 FFFF,81207B2A FFFF,81207B2C FFFF,81207B2E FFFF,81207B30 FFFF,81207B32 FFFF + +//---- + +[D6FBA4A8-6326AA2C-C:4A] +Name=Super Mario 64 Shindou Edition (J) +Cheat0="Funny Mario Options\Limbo Mario",8031DC0C 00C0 +Cheat1="Funny Mario Options\Runs Backwards",8031DC0E 0080 +Cheat2="Mario's Cap\Off Options",8031D9C7 00?? +Cheat2_N=Here you can Choose Options with Mario without His Cap on,Do not use with any other Mario with/without Options,Use only one at a time +Cheat2_O=$01 Mario No Cap,$02 Invisible Mario,$04 Metal Mario,$08 Flying Mario,$0A Invisible Flying Mario,$0D Metal Flying Mario,$0F Invisible Metal Flying Mario +Cheat3="Mario's Cap\On Options",8031D9C7 00?? +Cheat3_N=Here you can Choose Options with Mario with His Cap on,Do not use with any other Mario with/without Options,Use only one at a time +Cheat3_O=$12 Invisible Mario,$15 Metal Mario,$16 Invisible Metal Mario,$19 Flying Mario +Cheat4="Funny Mario Options\Mario's Cap\Off & in His Hand",8031D9C7 00?? +Cheat4_N=Here you can Choose Options with Mario with His Cap off & in His Hand,Do not use with any other Mario with/without Options,Use only one at a time +Cheat4_O=$20 Cap In Hand,$22 Invisible Mario Cap In Hand,$24 Metal Mario Cap In Hand,$26 Invisible Metal Mario Cap In Hand,$28 Flying Mario Cap In Hand +Cheat5="Funny Mario Options\Mario's Cap\On & An Extra in His Hand",8031D9C7 00?? +Cheat5_N=Here you can Choose Options with Mario with His Cap on & An Extra in His Hand,Do not use with any other Mario with/without Options,Use only one at a time +Cheat5_O=$30 Cap In Hand,$32 Invisible Mario Cap In Hand,$34 Metal Mario Cap In Hand,$36 Invisible Metal Mario Cap In Hand,$38 Flying Mario Cap In Hand +Cheat6="Infinite\Energy & Breath",8031DA6E 0008 +Cheat7="Infinite\Lives",8031DA6D 0064 +Cheat8="Don't Hurt Mario\Monsters ",A031D9E7 0001 +Cheat9="Funny Mario Options\Ostrich Mario",8031DC0C 0070 +Cheat10="Press GS For 255 Coins",8931DA68 00FF +Cheat0_N=Only Use This Code On Its Own,Do not use with any other Funny Mario Options. +Cheat1_N=Only Use This Code On Its Own,Do not use with any other Funny Mario Options. +Cheat9_N=Only Use This Code On Its Own,Do not use with any other Funny Mario Options. +Cheat10_N=Press GS Once on a Level To Get that amount of Coins +Cheat11="Have All\175 Stars",80203F0B 00FF,50000D02 0000,81203F0C FFFF +Cheat11_N=I have Managed to put a Have 175 Stars Option in for you,once the Code is activated, you will see it as a new option in Save Slot A. +Cheat12="Have All\Maxed Out Coin Records For All Levels",80203F25 00FF,50000702 0000,81203F26 FFFF +Cheat13="Have\Level Select",8030CCBC 0001 + +//---- + +[9CE02E22-206EF1B0-C:4A] +Name=Super Speed Race 64 (J) +Cheat0="Always 1st Place",81098A58 0001 +Cheat1="Freeze\Lap Timer",800967E5 0000,800967E7 0000 +Cheat1_N=Single and Chapionship Race Modes +Cheat2="Freeze\Pit Timer",800968A5 0000,800968A7 0000 +Cheat2_N=Single and Chapionship Race Modes +Cheat3="Car Select",800C50B1 00?? +Cheat3_O=$00 Car 1,$01 Car 2,$02 Car 3,$03 Car 4,$04 Car 5,$05 Car 6,$06 Car 7,$07 Car 8,$08 Car 9,$09 Car 10,$0A Car 11,$0B Car 12,$0C Car 13,$0D Car 14,$0E Car 15,$0F Car 16,$10 Car 17,$11 Car 18 +Cheat4="1 Lap To Race",80098A5D 00?? +Cheat4_O=$03 3 of 3 Laps,$06 6 of 6 Laps,$09 9 of 9 Laps,$0C 12 of 12 Laps,$0F 15 of 15 Laps,$12 18 of 18 Laps,$15 21 of 21 Laps,$18 24 of 24 Laps,$1B 27 of 27 Laps,$1E 30 of 30 Laps +Cheat4_N=In Single and Chapionship Modes use the Laps In Race Cheat or use the in game setting to choose how many laps you want per race and them use this cheat and amount of Laps to have only have 1 left if needed. +Cheat5="Freeze\Timer Challenge Timer",800C4F87 0050 +Cheat5_N=Timer Challenge +Cheat6="Laps\In Race\Chapionship Race Mode",800C4ED3 00?? +Cheat6_O=$03 3 Laps In Race,$06 6 Laps In Race,$09 9 Laps In Race,$0C 12 Laps In Race,$0F 15 Laps In Race,$12 18 Laps In Race,$15 21 Laps In Race,$18 24 Laps In Race,$1B 27 Laps In Race,$1E 30 Laps In Race +Cheat7="Laps\In Race\Single Race Mode",800C4ED1 00?? +Cheat7_O=$03 3 Laps In Race,$06 6 Laps In Race,$09 9 Laps In Race,$0C 12 Laps In Race,$0F 15 Laps In Race,$12 18 Laps In Race,$15 21 Laps In Race,$18 24 Laps In Race,$1B 27 Laps In Race,$1E 30 Laps In Race +Cheat8="Pit Stops\Championship",800C4F13 00?? +Cheat8_O=$00 Off,$01 On +Cheat9="Pit Stops\Single Race Mode",800C4F11 00?? +Cheat9_O=$00 Off,$01 On +Cheat10="Weather\Championship",800C4F33 00?? +Cheat10_O=$00 Dry,$01 Wet,$03 Night +Cheat11="Weather\Single Race Mode",800C4F31 00?? +Cheat11_O=$00 Dry,$01 Wet,$03 Night +Cheat12="Track Direction\Championship",800C4EF3 00?? +Cheat12_O=$00 Normal,$01 Reverse + +//---- + +[916AE6B8-8817AB22-C:4A] +Name=Tokisora Senshi Turok (J) +Cheat0="Infinite\Body Armor",8112FD96 5B23,8012FDD7 0001 +Cheat1="Infinite\Air",81129030 AAE1,811E85EA F1FF +Cheat2="Have All\Level Keys",8012FDE3 0007,8012FDE7 0007,8012FDEB 0007,8012FDEF 0007,8012FDF3 0007,8012FDF7 0007,8012FDFB 0007 +Cheat3="Have All\Weapons",8012FDA7 0001,8012FDAB 0001,8012FDAF 0001,8012FDB3 0001,8012FDB7 0001,8012FDBB 0001,8012FDBF 0001,8012FDC3 0001,8012FDC7 0001,8012FDCB 0001,8012FDCF 0001,8012FDD3 0001 +Cheat4="Infinite\Ammo",8012FD7F 00FF,8012FD93 00FF,8012FD83 00FF,8012FD63 00FF,8012FD8B 00FF,8012FD67 00FF,8012FD8F 00FF,8012FD6B 00FF +Cheat5="Diffuculty Modifier",8011252F 00?? +Cheat5_O=$00 Easy,$01 Normal,$02 Hard +Cheat6="Infinite\Health",812C15F4 013C +Cheat7="Have\Backpack",8012FD9B 0001,8012FDDB 0001 +Cheat8="Infinite\Lives",8012FF0B 00FF +Cheat9="Have\Cheat Menu",811205F0 FFFF,811205F2 FFFF +Cheat10="Have All\Gems",8012FF07 00FF + +//---- + +[5C9191D6-B30AC306-C:4A] +Name=Wave Race 64 (J) +Cheat0="Misses Don't Count",801D053F 0000 +Cheat1="Infinite Time Stunt Mode",801D06CE 00FF +Cheat2="Super Speed",801D0537 0005,D0161DC1 0010,801D0537 0020 +Cheat3="99 Points",801D8E13 0063 +Cheat4="Infinite Course Out Time",801D06F3 00FF +Cheat5="Maximum Power\Player 1",801D0537 0005 +Cheat6="Maximum Power\Player 2",801D0B5A 0005,801D0DFA 0005 +Cheat7="Only Play Glacier Coast",800E84C3 0007 +Cheat8="Always First Place",801D040F 0000 + +//---- + +[535DF3E2-609789F1-C:4A] +Name=Wave Race 64 Shindou Edition (J) (V1.2) +Cheat0="Misses Don't Count",801C399F 0000 +Cheat1="Infinite Time Stunt Mode",801C3B2E 00FF +Cheat2="Super Speed",801C3997 0005,D0155221 0010,801C3997 0020 +Cheat3="99 Points",801CC273 0063 +Cheat4="Infinite Course Out Time",801C3B53 00FF +Cheat5="Maximum Power\Player 1",801C3997 0005 +Cheat6="Maximum Power\Player 2",801C3FBA 0005,801C425A 0005 +Cheat7="Always First Place",801C386F 0000 + +//---- + +[DCB6EAFA-C6BBCFA3-C:4A] +Name=Wetrix (J) +Cheat0="Infinite Lakes",811AC9FE 0009 +Cheat1="Mega Score",801ACA18 00FF,801DBDC4 00FF +Cheat2="Always Empty Drain",801ACA51 0000,811ACA52 0000,811ACA54 0000 +Cheat3="Always Berserk Mode",801ACA6F 00FF +Cheat4="Stop Level Timer",801ACA72 00FF +Cheat5="Practice Lessons Open",810C3AEA 0008 +Cheat6="Always Drop\Player 1",801ACA7B 00?? +Cheat6_O=$00 Bar,$01 T,$02 Corner,$03 Square,$04 Down Square,$05 Down Bar,$06 Big Water,$07 Medium Water,$08 Small Water,$09 Smallest Water,$0A Bomb,$0B Fireball +Cheat7="Always Drop\Player 2",801DD1FB 00?? +Cheat7_O=$00 Bar,$01 T,$02 Corner,$03 Square,$04 Down Square,$05 Down Bar,$06 Big Water,$07 Medium Water,$08 Small Water,$09 Smallest Water,$0A Bomb,$0B Fireball +Cheat8="Infinite Ducks",801ACA0B 0009 + +//---- + +[12737DA5-23969159-C:4A] +Name=WWF Wrestlemania 2000 (J) +Cheat0="Have All Characters",81094BDA FFFF +Cheat1="Infinite Create-A-Wrestler Attribute Points",8011069B 001E +Cheat2="Timer Is Always 00:00",80164F2F 0000 +Cheat3="Max Attributes",80110691 0032,80110693 0032,80110695 0032,80110697 0032,80110699 0032 +Cheat4="Weapon Select\Player 1",8115D0B6 0300,8115CC10 ????,8115CC12 0000,8015CCD0 0000 +Cheat5="Weapon Select\Player 2",8115D54A 0300,8115CC40 ????,8015CC42 0001,8015CCD1 0001 +Cheat6="Weapon Select\Player 3",8115D9DE 0300,8115CC70 ????,8015CC72 0002,8015CCD2 0002 +Cheat7="Weapon Select\Player 4",8115DE72 0300,8115CC98 ????,8115CC9A 0003,8015CCD3 0003 +Cheat8="Always Special\Player 1",8015D0B5 0004 +Cheat9="Always Special\Player 2",8015D549 0004 +Cheat10="Always Special\Player 3",8015D9DD 0004 +Cheat11="Always Special\Player 4",8015DE71 0004 +Cheat12="Specials Don't Run Out",81120C14 2400 +Cheat13="Max Spirit\Player 1",8015D075 00FF +Cheat14="Always Normal Spirit\Player 1",8015D075 0032 +Cheat15="No Spirit\Player 1",8015D075 0000 +Cheat16="Max Spirit\Player 2",8015D509 00FF +Cheat17="Always Normal Spirit\Player 2",8015D509 0032 +Cheat18="No Spirit\Player 2",8015D509 0000 +Cheat19="Max Spirit\Player 3",8015D99D 00FF +Cheat20="Always Normal Spirit\Player 3",8015D99D 0032 +Cheat21="No Spirit\Player 3",8015D99D 0000 +Cheat22="Max Spirit\Player 4",8015DE31 00FF +Cheat23="Always Normal Spirit\Player 4",8015DE31 0032 +Cheat24="No Spirit\Player 4",8015DE31 0000 +Cheat25="Ultimate Codes\Player 1",8015D074 0064 +Cheat26="Ultimate Codes\Player 2",8015D508 0064 +Cheat27="Ultimate Codes\Player 3",8015D99C 0064 +Cheat28="Ultimate Codes\Player 4",8015DE30 0064 +Cheat39="Easy Pins & Longer Submissions\Player 1",8015D074 0064 +Cheat30="Easy Pins & Longer Submissions\Player 2",8015D508 0064 +Cheat31="Easy Pins & Longer Submissions\Player 3",8015D99C 0064 +Cheat32="Easy Pins & Longer Submissions\Player 4",8015DE30 0064 +Cheat4_O=$0000 Broom,$0101 Shovel,$0202 Red And White Hockey Stick,$0303 Guitar,$0404 Night Stick,$0505 Head,$0606 Black Hockey Stick,$0707 Bottle,$0808 2x4,$0909 Big Purple Sheet,$0A0A White Jug,$0B0B Suit Case,$0C0C Stick,$0D0D Head,$0E0E Big Mallot,$0F0F Black Microphone,$1010 BaseBall Bat,$1111 Folding Chair,$1212 Board,$1313 Stairs,$1414 Trashcan,$FFFF Nothing +Cheat5_O=$0000 Broom,$0101 Shovel,$0202 Red And White Hockey Stick,$0303 Guitar,$0404 Night Stick,$0505 Head,$0606 Black Hockey Stick,$0707 Bottle,$0808 2x4,$0909 Big Purple Sheet,$0A0A White Jug,$0B0B Suit Case,$0C0C Stick,$0D0D Head,$0E0E Big Mallot,$0F0F Black Microphone,$1010 BaseBall Bat,$1111 Folding Chair,$1212 Board,$1313 Stairs,$1414 Trashcan,$FFFF Nothing +Cheat6_O=$0000 Broom,$0101 Shovel,$0202 Red And White Hockey Stick,$0303 Guitar,$0404 Night Stick,$0505 Head,$0606 Black Hockey Stick,$0707 Bottle,$0808 2x4,$0909 Big Purple Sheet,$0A0A White Jug,$0B0B Suit Case,$0C0C Stick,$0D0D Head,$0E0E Big Mallot,$0F0F Black Microphone,$1010 BaseBall Bat,$1111 Folding Chair,$1212 Board,$1313 Stairs,$1414 Trashcan,$FFFF Nothing +Cheat7_O=$0000 Broom,$0101 Shovel,$0202 Red And White Hockey Stick,$0303 Guitar,$0404 Night Stick,$0505 Head,$0606 Black Hockey Stick,$0707 Bottle,$0808 2x4,$0909 Big Purple Sheet,$0A0A White Jug,$0B0B Suit Case,$0C0C Stick,$0D0D Head,$0E0E Big Mallot,$0F0F Black Microphone,$1010 BaseBall Bat,$1111 Folding Chair,$1212 Board,$1313 Stairs,$1414 Trashcan,$FFFF Nothing + +//---- + +[EC417312-EB31DE5F-C:4A] +Name=Zelda no Densetsu 2 - Mujura no Kamen (J) (v1.0) +Cheat0="Have All\Quest Status Items",801EF51D 0005,811EF51E F7CF +Cheat1="Infinite\Rupees",811EF49A 03E7 +Cheat2="Infinite\Max & Double Magic Meter",801EF499 0060,811EF4A0 0101 +Cheat3="Infinite\Arrows",801EF501 0063 +Cheat4="Infinite\Bombs",801EF506 0063 +Cheat5="Infinite\Bombchus",801EF507 0063 +Cheat6="Infinite\Deku Sticks",801EF508 0063 +Cheat7="Infinite\Deku Nuts",801EF509 0063 +Cheat8="Infinite\Magic Beans",801EF50A 0063 +Cheat9="Infinite\Powder Kegs",801EF50C 0063 +Cheat10="Have\Ocarina of Time",801EF4D0 0000 +Cheat11="Have\Hero's Bow",801EF4D1 0001 +Cheat12="Have\Arrows\Fire Arrow",801EF4D2 0002 +Cheat13="Have\Arrows\Ice Arrow",801EF4D3 0003 +Cheat14="Have\Arrows\Light Arrow",801EF4D4 0004 +Cheat15="Have\Bombs",801EF4D6 0006 +Cheat16="Have\Bombchu",801EF4D7 0007 +Cheat17="Have\Deku Sticks",801EF4D8 0008 +Cheat18="Have\Deku Nuts",801EF4D9 0009 +Cheat19="Have\Magic Beans",801EF4DA 000A +Cheat20="Have\Powder Kegs",801EF4DC 000C +Cheat21="Have\Pictograph",801EF4DD 000D +Cheat22="Have\Lens of Truth",801EF4DE 000E +Cheat23="Have\Hookshot",801EF4DF 000F +Cheat24="Have\Great Fairy's Sword",801EF4E0 0010 +Cheat25="Have\Bottle Modifier\1",801EF4E2 00?? +Cheat26="Have\Bottle Modifier\2",801EF4E3 00?? +Cheat27="Have\Bottle Modifier\3",801EF4E4 00?? +Cheat28="Have\Bottle Modifier\4",801EF4E5 00?? +Cheat29="Have\Bottle Modifier\5",801EF4E6 00?? +Cheat30="Have\Bottle Modifier\6",801EF4E7 00?? +Cheat31="All Equipment Upgrades",801EF4CD 0023,811EF51A 201B +Cheat32="Have All\Masks",801EF4E8 005A,801EF4E9 0055,801EF4EA 0063,801EF4EB 0061,801EF4EC 005C,801EF4ED 004E,801EF4EE 0056,801EF4EF 0062,801EF4F0 0054,801EF4F1 005E,801EF4F2 0064,801EF4F3 004F,801EF4F4 0058,801EF4F5 0059,801EF4F6 0053,801EF4F7 005B,801EF4F8 0052,801EF4F9 0050,801EF4FA 005F,801EF4FB 005D,801EF4FC 0057,801EF4FD 0060,801EF4FE 0065,801EF4FF 0051 +Cheat33="Replace Sword With",801EF4AC 00?? +Cheat34="Infinite\Health",811EF496 0140 +Cheat35="Infinite\Hearts Options",811EF494 ???? +Cheat36="Beta World 1",D01FB9E1 0000,801EF462 00?? +Cheat37="Press L To Levitate",D03E6D0B 0020,81400008 40CB +Cheat37_N=Press L To Levitate & Let go to land +Cheat38="Play As",801EF480 00?? +Cheat38_O=$00 Fierce Deity Link,$01 Goron Link,$02 Zora Link,$03 Deku Link,$04 Normal Link +Cheat39="Warp Modifier",D05EC55A 0000,803FF545 0001,813FF54A ???? +Cheat39_O=$0010 Mayors Residence,$0008 Magic Hags Potion Shop,$000A Romani Ranch Barn,$000B Mama's House,$000E Honey & Darlings Shop,$0015 Final Boss Arena,$001F Beneath the Graveyard (left entrance),$002F Beneath the Graveyard (right entrance),$0030 Southern Swamp (Reg Entrance),$004F Southern Swamp (from tour house),$006E Southern Swamp (from Woodfall),$006F Southern Swamp (from Deku Palace),$0078 Path to Ikana Canyon,$009E Southern Swamp (from Deku Place 2),$009F Southern Swamp (From Potion Shop),$00AF Boat Cruise (picture taking),$00CD Southern Swamp (From Woods of Mystery),$00CE Southern Swamp (From Spider House),$00CF Southern Swamp (From Ikana Canyon),$00FE Southern Swamp (From Owl Warp),$0E00 Curiosity Shop,$0E38 Ikana Canyon Entrance,$1500 Lens of Truth Cave (get it),$2600 Stone Tower Temple (Upside down),$2609 Stone Tower Temple (Boss Room Entrance),$2604 Treasure Chest Shop,$2605 Treausre Chest Shop (counter),$260E Clock Tower (w/ skull kid, silent),$2610 Stone Tower Temple (endless fall),$6214 Romani Ranch,$9214 Zora Shop,$B214 Snowhead (Path to temple, warp in),$D214 East Clock Down +Cheat39_N=Put this code on and press the start button and it will now take where you wanted to go, turn it back off after you have got there. +Cheat36_O=$00 Mama's House non Beta,$01 Fearful Spider House,$02 Beneaf the Graveyard,$03 Southern Swamp Mr Tingle Entry,$06 Outside Tourist Information Southern Swamp,$08 Outside Magic Hag's Potion Shop,$0A Southern Swamp Woods Of Mystery Entry,$24 Counter Of The Tresure Chest Shop,$2E Woodfall Temple non Beta,$32 Spider Hand,$35 Statue outside Gorman Track,$36 Statue outside Lair Of The Temples Boss,$38 Path to Romani Ranch non Beta,$4A outside The Royal Palace of the Deku Kingdom,$4C Ledge in The Royal Palace of the Deku Kingdom,$4E inside The Royal Palace of the Deku Kingdom 1,$71 Green Blobs,$74 Cave Portal to Last Boss Field,$7F Waterfall Sothern Swamp,$8A Giant Turtle In the Temple non beta,$8B Room of Miau & Tijo Zora Great Hall,$94 Recieving Gorans Mask non Beta,$95 ?,$96 Hungry Goran in the Snow,$A2 Statue in Stone Tower,$A6 Stone Tower non Beta,$B9 Recieving Deku Mask non Beta,$D9 Giant Lizards in a Cave,$DA Cave with Steaming Water,$FF Vamps House In Ikana Canyon +Cheat36_N=Put on the code on load up,After the Nintendo logo you will be in that place of Choice.you can also choose another place & then press F1 (reset) to go to that place this is for beta interest only it will not assist you in playing the game. +Cheat25_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat26_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat27_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat28_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat29_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat30_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat33_O=$02 Fire Arrow w/ Bow,$03 Ice Arrow w/ Bow,$04 Light Arrow w/ Bow,$00 Hero's Bow,$10 Deity Link's Sword +Cheat35_O=$0140 Max Hearts,$0063 6 Hearts,$0043 4 Hearts + +//---- + +[69AE0438-2C63F3F3-C:4A] +Name=Zelda no Densetsu 2 - Mujura no Kamen (J) (V1.1) +Cheat0="Have All\Quest Status Items",801EF7CD 0005,811EF7CE F7CF +Cheat1="Infinite\Rupees",811EF74A 03E7 +Cheat2="Infinite\Max & Double Magic Meter",801EF749 0060,811EF750 0101 +Cheat3="Infinite\Arrows",801EF7B1 0063 +Cheat4="Infinite\Bombs",801EF7B6 0063 +Cheat5="Infinite\Bombchus",801EF7B7 0063 +Cheat6="Infinite\Deku Sticks",801EF7B8 0063 +Cheat7="Infinite\Deku Nuts",801EF7B9 0063 +Cheat8="Infinite\Magic Beans",801EF7BA 0063 +Cheat9="Infinite\Powder Kegs",801EF7BC 0063 +Cheat10="Have\Ocarina of Time",801EF780 0000 +Cheat11="Have\Hero's Bow",801EF781 0001 +Cheat12="Have\Arrows\Fire Arrow",801EF782 0002 +Cheat13="Have\Arrows\Ice Arrow",801EF783 0003 +Cheat14="Have\Arrows\Light Arrow",801EF784 0004 +Cheat15="Have\Bombs",801EF786 0006 +Cheat16="Have\Bombchu",801EF787 0007 +Cheat17="Have\Deku Sticks",801EF788 0008 +Cheat18="Have\Deku Nuts",801EF789 0009 +Cheat19="Have\Magic Beans",801EF78A 000A +Cheat20="Have\Powder Kegs",801EF78C 000C +Cheat21="Have\Pictograph",801EF78D 000D +Cheat22="Have\Lens of Truth",801EF78E 000E +Cheat23="Have\Hookshot",801EF78F 000F +Cheat24="Have\Great Fairy's Sword",801EF790 0010 +Cheat25="Have\Bottle Modifier\1",801EF792 00?? +Cheat26="Have\Bottle Modifier\2",801EF793 00?? +Cheat27="Have\Bottle Modifier\3",801EF794 00?? +Cheat28="Have\Bottle Modifier\4",801EF795 00?? +Cheat29="Have\Bottle Modifier\5",801EF796 00?? +Cheat30="Have\Bottle Modifier\6",801EF797 00?? +Cheat31="All Equipment Upgrades",801EF77D 0023,811EF7CA 201B +Cheat32="Have All\Masks",801EF798 005A,801EF799 0055,801EF79A 0063,801EF79B 0061,801EF79C 005C,801EF79D 004E,801EF79E 0056,801EF79F 0062,801EF7A0 0054,801EF7A1 005E,801EF7A2 0064,801EF7A3 004F,801EF7A4 0058,801EF7A5 0059,801EF7A6 0053,801EF7A7 005B,801EF7A8 0052,801EF7A9 0050,801EF7AA 005F,801EF7AB 005D,801EF7AC 0057,801EF7AD 0060,801EF7AE 0065,801EF7AF 0051 +Cheat33="Replace Sword With",801EF75C 00?? +Cheat34="Infinite\Health",811EF746 0140 +Cheat35="Infinite\Hearts Options",811EF744 ???? +Cheat36="Beta World 1",D01FBC91 0000,801EF712 00?? +Cheat36_O=$00 Mama's House non Beta,$01 Fearful Spider House,$02 Beneaf the Graveyard,$03 Southern Swamp Mr Tingle Entry,$06 Outside Tourist Information Southern Swamp,$08 Outside Magic Hag's Potion Shop,$0A Southern Swamp Woods Of Mystery Entry,$24 Counter Of The Tresure Chest Shop,$2E Woodfall Temple non Beta,$32 Spider Hand,$35 Statue outside Gorman Track,$36 Statue outside Lair Of The Temples Boss,$38 Path to Romani Ranch non Beta,$4A outside The Royal Palace of the Deku Kingdom,$4C Ledge in The Royal Palace of the Deku Kingdom,$4E inside The Royal Palace of the Deku Kingdom 1,$71 Green Blobs,$74 Cave Portal to Last Boss Field,$7F Waterfall Sothern Swamp,$8A Giant Turtle In the Temple non beta,$8B Room of Miau & Tijo Zora Great Hall,$94 Recieving Gorans Mask non Beta,$95 ?,$96 Hungry Goran in the Snow,$A2 Statue in Stone Tower,$A6 Stone Tower non Beta,$B9 Recieving Deku Mask non Beta,$D9 Giant Lizards in a Cave,$DA Cave with Steaming Water,$FF Vamps House In Ikana Canyon +Cheat37="Press L To Levitate",D03E6FCB 0020,814002C8 40CB +Cheat37_N=Press L To Levitate & Let go to land +Cheat38="Play As",801EF730 00?? +Cheat38_O=$00 Fierce Deity Link,$01 Goron Link,$02 Zora Link,$03 Deku Link,$04 Normal Link +Cheat39="Warp Modifier",D03E6FCA 0000,803FF805 0001,813FF80A ???? +Cheat39_O=$0010 Mayors Residence,$0008 Magic Hags Potion Shop,$000A Romani Ranch Barn,$000B Mama's House,$000E Honey & Darlings Shop,$0015 Final Boss Arena,$001F Beneath the Graveyard (left entrance),$002F Beneath the Graveyard (right entrance),$0030 Southern Swamp (Reg Entrance),$004F Southern Swamp (from tour house),$006E Southern Swamp (from Woodfall),$006F Southern Swamp (from Deku Palace),$0078 Path to Ikana Canyon,$009E Southern Swamp (from Deku Place 2),$009F Southern Swamp (From Potion Shop),$00AF Boat Cruise (picture taking),$00CD Southern Swamp (From Woods of Mystery),$00CE Southern Swamp (From Spider House),$00CF Southern Swamp (From Ikana Canyon),$00FE Southern Swamp (From Owl Warp),$0E00 Curiosity Shop,$0E38 Ikana Canyon Entrance,$1500 Lens of Truth Cave (get it),$2600 Stone Tower Temple (Upside down),$2609 Stone Tower Temple (Boss Room Entrance),$2604 Treasure Chest Shop,$2605 Treausre Chest Shop (counter),$260E Clock Tower (w/ skull kid, silent),$2610 Stone Tower Temple (endless fall),$6214 Romani Ranch,$9214 Zora Shop,$B214 Snowhead (Path to temple, warp in),$D214 East Clock Down +Cheat39_N=Put this code on and press the start button and it will now take where you wanted to go, turn it back off after you have got there. +Cheat36_N=Put on the code on load up,After the Nintendo logo you will be in that place of Choice.you can also choose another place & then press F1 (reset) to go to that place this is for beta interest only it will not assist you in playing the game. +Cheat25_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat26_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat27_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat28_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat29_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat30_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat33_O=$02 Fire Arrow w/ Bow,$03 Ice Arrow w/ Bow,$04 Light Arrow w/ Bow,$00 Hero's Bow,$10 Deity Link's Sword +Cheat35_O=$0140 Max Hearts,$0063 6 Hearts,$0043 4 Hearts + +//---- + +[8473D0C1-23120666-C:4A] +Name=Zelda no Densetsu 2 - Mujura no Kamen - Zelda Collection Version (J) (GC Version) [!] +Cheat0="Infinite\Rupees",811ED85A 03E7 +Cheat1="Infinite\Health",811ED856 03E7 +Cheat2="Infinite\Max & Double Magic Meter",801ED859 0060,811ED860 0101 +Cheat3="Infinite\Items",801ED8C1 0063,50000801 0000,801ED8C6 0063 +Cheat3_N=This is Infinite use of Bombs,Bombchus,Deku Sticks,Deku Nuts,Magic Beans,& Powder Kegs. But you must also put it's Have on to work. +Cheat4="Have\All Masks",811ED8A8 3E39,811ED8AA 4745,811ED8AC 4032,811ED8AE 3A46,811ED8B0 3842,811ED8B2 4833,811ED8B4 3C3D,811ED8B6 373F,811ED8B8 3634,811ED8BA 4341,811ED8BC 3B44,811ED8BE 4935 +Cheat5="Use all C Buttons",811F1738 0000,811F173A 0000 +Cheat6="Event Item\Modifier 1",801ED895 00?? +Cheat7="Event Item\Modifier 2",801ED89B 00?? +Cheat8="Event Item\Modifier 3",801ED8A1 00?? +Cheat9="Have Item Modifier",801ED8A0 00?? +Cheat10="Have Bottle\Modifier 1",801ED8A2 00?? +Cheat11="Have Bottle\Modifier 2",801ED8A3 00?? +Cheat12="Have Bottle\Modifier 3",801ED8A4 00?? +Cheat13="Have Bottle\Modifier 4",801ED8A5 00?? +Cheat14="Have Bottle\Modifier 5",801ED8A6 00?? +Cheat15="Have Bottle\Modifier 6",801ED8A7 00?? +Cheat16="Have\Great Fairy's Sword",801ED8A0 0010 +Cheat17="Have\QuestStatus Items",801ED8DD 0005,811ED8DE F7CF +Cheat18="Have\Have Ocarina of Time",801ED890 0000 +Cheat19="Have\Hero's Bow",801ED891 0001 +Cheat20="Have\Fire Arrow",801ED892 0002 +Cheat21="Have\Ice Arrow",801ED893 0003 +Cheat22="Have\Light Arrow",801ED894 0004 +Cheat23="Have\Bombs",801ED896 0006 +Cheat24="Have\Bombchu",801ED897 0007 +Cheat25="Have\Deku Sticks",801ED898 0008 +Cheat26="Have\Deku Nuts",801ED899 0009 +Cheat27="Have\Magic Beans",801ED89A 000A +Cheat28="Have\Powder Kegs",801ED89C 000C +Cheat29="Have\Pictograph",801ED89D 000D +Cheat30="Have\Lens of Truth",801ED89E 000E +Cheat31="Have\Hookshot",801ED89F 000F +Cheat32="All Equipment Upgrades",801ED88D 0023,811ED8DA 201B,801ED86C 004F +Cheat33="Replace Sword With",801ED86C 00?? +Cheat33_O=$4A Fire Arrow w/ Bow,$4B Ice Arrow w/ Bow,$4C Light Arrow w/ Bow,$4D Kokiri Sword,$4E Razor Sword,$4F Guilded Sword,$50 Deity Link's Sword +Cheat34="Play As",801ED840 00?? +Cheat35="Infinite\Hearts Options",811ED854 ???? +Cheat35_O=$0140 Max Hearts,$0063 6 Hearts,$0043 4 Hearts +Cheat35_N=If you need to clear the Infinite Max Hearts from the screen just choose the 6 or 4 Heart Options, take off the cheat & then make a save. +Cheat36="Beta World 1",D03E4CAB 0000,801ED822 00?? +Cheat36_O=$00 Mama's House non Beta,$01 Fearful Spider House,$02 Beneaf the Graveyard,$03 Southern Swamp Mr Tingle Entry,$06 Outside Tourist Information Southern Swamp,$08 Outside Magic Hag's Potion Shop,$0A Southern Swamp Woods Of Mystery Entry,$24 Counter Of The Tresure Chest Shop,$2E Woodfall Temple non Beta,$32 Spider Hand,$35 Statue outside Gorman Track,$36 Statue outside Lair Of The Temples Boss,$38 Path to Romani Ranch non Beta,$4A outside The Royal Palace of the Deku Kingdom,$4C Ledge in The Royal Palace of the Deku Kingdom,$4E inside The Royal Palace of the Deku Kingdom 1,$71 Green Blobs,$74 Cave Portal to Last Boss Field,$7F Waterfall Sothern Swamp,$8A Giant Turtle In the Temple non beta,$8B Room of Miau & Tijo Zora Great Hall,$94 Recieving Gorans Mask non Beta,$95 ?,$96 Hungry Goran in the Snow,$A2 Statue in Stone Tower,$A6 Stone Tower non Beta,$B9 Recieving Deku Mask non Beta,$D9 Giant Lizards in a Cave,$DA Cave with Steaming Water,$FF Vamps House In Ikana Canyon +Cheat36_N=Put on the code on load up,After the Nintendo logo you will be in that place of Choice.you can also choose another place & then press F1 (reset) to go to that place this is for beta interest only it will not assist you in playing the game. +Cheat37="Warp Modifier",803E4CAA 0000,803FD505 0001,813FD50A ???? +Cheat37_O=$0010 Mayors Residence,$0008 Magic Hags Potion Shop,$000A Romani Ranch Barn,$000B Mama's House,$000E Honey & Darlings Shop,$0015 Final Boss Arena,$001F Beneath the Graveyard (left entrance),$002F Beneath the Graveyard (right entrance),$0030 Southern Swamp (Reg Entrance),$004F Southern Swamp (from tour house),$006E Southern Swamp (from Woodfall),$006F Southern Swamp (from Deku Palace),$0078 Path to Ikana Canyon,$009E Southern Swamp (from Deku Place 2),$009F Southern Swamp (From Potion Shop),$00AF Boat Cruise (picture taking),$00CD Southern Swamp (From Woods of Mystery),$00CE Southern Swamp (From Spider House),$00CF Southern Swamp (From Ikana Canyon),$00FE Southern Swamp (From Owl Warp),$0E00 Curiosity Shop,$0E38 Ikana Canyon Entrance,$1500 Lens of Truth Cave (get it),$2600 Stone Tower Temple (Upside down),$2609 Stone Tower Temple (Boss Room Entrance),$2604 Treasure Chest Shop,$2605 Treausre Chest Shop (counter),$260E Clock Tower (w/ skull kid, silent),$2610 Stone Tower Temple (endless fall),$6214 Romani Ranch,$9214 Zora Shop,$B214 Snowhead (Path to temple, warp in),$D214 East Clock Down +Cheat37_N=Put this code on and it will now take where you wanted to go, turn it back off or it will infinite loop entering all the time. +Cheat6_O=$28 Moon's Tear,$29 Land Title Deed,$2A Swap Title Deed,$2B Mountain Title Deed,$2C Ocean Title Deed,$2D Room Key,$2E Special Delivery To Mama,$2F Letter To Kafei,$30 Pendant Of Memories +Cheat7_O=$28 Moon's Tear,$29 Land Title Deed,$2A Swap Title Deed,$2B Mountain Title Deed,$2C Ocean Title Deed,$2D Room Key,$2E Special Delivery To Mama,$2F Letter To Kafei,$30 Pendant Of Memories +Cheat8_O=$28 Moon's Tear,$29 Land Title Deed,$2A Swap Title Deed,$2B Mountain Title Deed,$2C Ocean Title Deed,$2D Room Key,$2E Special Delivery To Mama,$2F Letter To Kafei,$30 Pendant Of Memories +Cheat9_O=$05 Japanese Flute?,$0B Japanese Item?,$10 Great Fairy's Sword,$11 Japanese Hookshot?,$31 Japanese Scroll?,$4A Japanese Bow? +Cheat10_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat11_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat12_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat13_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat14_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat15_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat33_N=Only put the Deity Link's Sword on, if using The Play As Fierce Deity Link Code, if not it will turn Fierce Deity Link into a crazed slashing Machine. You have been warned. +Cheat34_O=$00 Fierce Deity Link,$01 Goron Link,$02 Zora Link,$03 Deku Link,$04 Normal Link +Cheat49="All Items (Normal Ram Pak Version)",FF1E0000 0000,50002402 0202,810EC350 0001 + +//---- + +[EC7011B7-7616D72B-C:4A] +Name=Zelda no Densetsu - Toki no Ocarina (J) (v1.0) +Cheat0="Infinite\Rupees",8111B99C 0001 +Cheat1="Press R\For Old Or Young Link",D01C84B5 0010,8011A5D7 00?? +Cheat1_O=$01 Link Young,$00 Link Old +Cheat1_N=To Activate this Cheat Hold The R Button when walking through a Doorway this will change you to the option on the other side, Disable this Cheat straight away after getting to the other side, in some places you might even get Access Violations. Just press ok untill you can carry on. +Cheat2="Use Any Item In Any House",8111B7F2 0000,8111B7F4 0000 +Cheat3="Have\All Equipment",8111A66C 7777 +Cheat4="Have\All Quest/Status Items",8111A674 30FF,8111A676 FFFF +Cheat5="Max\Heart Containers",8111A5FE 0140 +Cheat6="Max\Gold Skulltulas Killed",8011A6A1 0064 +Cheat7="Time of Day Modifier",8111A5DC ???? +Cheat8="Infinite\Energy",8111A600 0140 +Cheat9="Infinite\Magic",D011A609 0008,8011A60A 0001,8011A60C 0001,8011A603 0060 +Cheat10="Tunic & Boot Options",8011A640 00?? +Cheat11="Infinite\Deku Sticks",8011A65C 0009 +Cheat12="Infinite\Deku Nuts",8011A65D 0009 +Cheat13="Infinite\Bombs",8011A65E 0009 +Cheat14="Infinite\Arrows",8011A65F 0009 +Cheat15="Infinite\Deku Seeds",8011A662 0009 +Cheat16="Infinite\Bombchu's",8011A664 0009 +Cheat17="Infinite\Magic Beans",8011A66A 0009 +Cheat18="Infinite\Big Key,Small Keys,Compass,& Map",8011A678 0007,8011A679 0007,8011A67A 0007,8011A67B 0007,8011A67C 0007,8011A67D 0007,8011A67E 0007,8011A67F 0007,8011A680 0007,8011A681 0007,8011A682 0007,8011A68F 0009,8011A690 0009,8011A691 0009,8011A692 0009,8011A693 0009,8011A699 0009,8011A69C 0009,8011A697 0009 +Cheat19="Have\Ocarina",8011A64B 00?? +Cheat20="Have\Boomerang",8011A650 000E +Cheat21="Have\Lens of Truth",8011A651 000F +Cheat22="Have\Megaton Hammer",8011A653 0011 +Cheat23="Have\Deku Stick",8011A644 0000 +Cheat24="Have\Deku Nut",8011A645 0001 +Cheat25="Have\Bombs",8011A646 0002 +Cheat26="Have\Fairy Bow",8011A647 0003 +Cheat27="Have\Fairy Slingshot",8011A64A 0006 +Cheat28="Have\Bombchu",8011A64C 0009 +Cheat29="Have\Arrows\Fire Arrow",8011A648 0004 +Cheat30="Have\Arrows\Ice Arrow",8011A64E 000C +Cheat31="Have\Arrows\Light Arrow",8011A654 0012 +Cheat32="Have\Hookshot",8011A64D 00?? +Cheat33="Have\Magic Beans",8011A652 0010 +Cheat34="Have\Magic\Fairie's Wind",8011A64F 000D +Cheat35="Have\Magic\Nayru's Love",8011A655 0013 +Cheat36="Have\Magic\Din's Fire",8011A649 0005 +Cheat37="Bottles\Bottle 1 Modifier",8011A656 00?? +Cheat38="Bottles\Bottle 2 Modifier",8011A657 00?? +Cheat39="Bottles\Bottle 3 Modifier",8011A658 00?? +Cheat40="Bottles\Bottle 4 Modifier",8011A659 00?? +Cheat41="Trading\Adult Link Item",8011A65A 00?? +Cheat42="Trading\Young Link Item",8011A65B 00?? +Cheat43="Turn Giant's Knife Into Biggoron's Sword",8011A60E 0001 +Cheat44="Have Quiver (Holds 30)",8011A671 0001 +Cheat45="Equipment Modifier 1",8011A672 00?? +Cheat46="Equipment Modifier 2",8011A673 00?? +Cheat47="Press L To Levitate",D01C84B5 0020,811DAA90 40CB +Cheat47_N=Press L To Levitate & Let go to land +Cheat48="Press L For infinite Hover Boots,",D01C84B5 0020,811DB2B2 000D +Cheat48_N=Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on +Cheat49="Instant Step Hoover Boots",D01C84B5 0020,811DAA90 40CB,D01C84B5 0000,811DB2B2 000D,8011A640 00?? +Cheat49_O=$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat49_N=Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. +Cheat50="Beta\Play Beta Quest Worlds",D01C84B5 0000,8011B9E3 00?? +Cheat50_O=$00 World 01,$01 World 02,$02 World 03,$03 World 04,$04 World 05,$07 World 06,$08 World 07,$16 World 08 +Cheat50_N=Put on the code on load up,After the Nintendo logo you will be in Beta Mode,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. +Cheat51="Warp Song Location\Minuet of Forest & Serenade of Water",8011B965 00?? +Cheat51="Warp Song Location\Minuet of Forest & Serenade of Water",8011B965 00?? +Cheat51_O=$00 Sacred Forest Meadow,$04 Lake Hylia,$15 Inside Jabu Jabu's Belly,$18 Dodongo's Cavern,$68 Inside The Deku Tree +Cheat51_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat52="Warp Song Location\Prelude of Light & Nocturne of Shadow",8011B965 00?? +Cheat52_O=$03 Kakariko Windmill,$07 Bombchu Bowling Alley,$0F Zelda & Impa Flee,$14 Kakariko Village,$17 Ganon,Final Battle,$1D Top of Ganon's Tower,$28 Bombchu Shop,$2C Bazaar,$30 Happy Mask Shop,$34 Ganon's Tower,$38 Ganon's Castle,$4C Inside Spirit Door,$6C Burning Castle,$50 House of Skulltula,$64 Death Mountain Trail,$68 Graveyard,$70 Thieves' Hideout,$74 Royal Family's Tomb,$78 Great Fairy Fountain 1,$84 Forest Temple,Room With Falling Floor,$88 Great Fairy Fountain 2,$99 Grotto 01,$9D Grotto 02,$A4 Grotto 04,$A8 Grotto 05,$B3 Grotto 06,$B0 Grotto 07,$B4 Grotto 08,$B8 Grotto 09,$C3 Grotto 10,$C0 Grotto 11,$C4 Grotto 12,$FC Grotto 13,$D3 Bottom of the Well,$D0 Lon Lon Ranch Shed,$D3 Lon Lon Ranch Outside Shed,$D8 Ice Cavern,$E3 Outside Cow Pen,$E0 Lost Woods Bridge,$E4 Lon Lon Ranch Chicken Room,$E8 In Front of Deku Tree,$EB Spirit Temple Boss,$F1 Castle Courtyard,In Front of Zelda,$F4 Temple of Time,$F8 Gerudo Fortress Jail +Cheat52_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat53="Warp Song Location\Bolero of Fire",8011B965 00?? +Cheat53_O=$03 Castle Courtyard,$0B Dodongo's Cavern Boss,$10 Inside The Deku Tree Boss,$14 Shadow Temple Boss,$17 Water Temple Boss,$1C Ganon's Castle Tower,$1F Ganon First Battle,$28 Ganon's Castle Room Before Ganon,$2B Inside Ganon's Castle Room With Pillar,$2F Lon Lon Ranch,$33 Mido's House,$37 Saria's House,$4B Bearded Man's House,$40 Top of Ganon's Castle,$47 Outside Saria's House,$4F Dampe's Race,$57 Kokiri Forest,$5B Top of Death Mountain,$5F Fishing Pond,$68 Inside Ganon's Castle,$7F Hyrule Castle Gate,$BA Top of Ganon's Tower,$C2 Great Fairy Fountain,$D6 Lost Woods Goron Entrance,$DA Lost Woods River Entrance,$DE Lost Woods Bridge Field Entrance,$E3 Goron City Lost Woods Entrance,$F6 Death Mountain Crater,$FD Ganon's Castle +Cheat53_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat54="Warp Song Location\Requiem of Spirit",8011B965 00?? +Cheat54_O=$05 Lake Hylia,08 Zora's Domain,$18 Gerudo Valley,$1E Lost Woods,$28 Gerudo Fortress,$30 Haunted Wasteland,$34 Ganon's Castle Inside Burning Castle,$38 Hyrule Castle,$3A Ganon's Castle,$3D Death Mountain Trail,$4D Goron City,$65 Fire Temple,$69 Forest Temple,$6E Shooting Gallery,$79 Ganon's Castle Inside Burning Castle,$7E Kakariko Village Entrance,$7B Zora's River Entrance,$85 Kokiri Forest Entrance,$8A Lake Hyrule Entrance,$8E Gerudo Valley Entrance,$92 Death Mountain Trail Entrance,$95 Graveyard Entrance,$9E Zora's Domain Entrance,$A2 Zora's Fountain Entrance,$BA Goron City Entrance,$BE Death Mountain Trail,$C1 Goron City,$C5 Lakeside Laboratory,$C9 Top of Ganon's Castle,$CD Hyrule Market (Child Link's),$CF Hyrule Market (Adult Link's),$F1 Desert Colossus,$FA Lon Lon Ranch Entrance,$FD Hyrule Field +Cheat54_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat55="Max\Double Defense Power",8011A69F 0014 +Cheat55_N=This gives you White Border Hearts +Cheat56="Nayru's Love is Always",8111B998 ???? +Cheat56_O=$0000 OFF,$FFFF ON +Cheat56_N=For this to work On Or off, you have to walk through a Doorway to activate the Change. +Cheat57="Infinite\Timers\All other Timers",8011B9A1 0032 +Cheat57_N=This cheat works on all Race Timers.Under Water with iron Boots etc. +Cheat58="Epona\Max Carrots\Lon Lon Raunch",801D8BCA 0006,801F2208 0001,801EEC88 0001 +Cheat58_N=This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona +Cheat59="Infinite\Timers\Escape From Gannons Tower",8011B9A5 00B4 +Cheat59_N=This cheat works only on The Final Boss. +Cheat60="Beta\Specific things lean",80025614 0001 +Cheat60_N=This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest 01). +Cheat61="Beta\Appear in Strange Places (Hold R)",D01C84B5 0010,8111B936 0001 +Cheat61_N=If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. +Cheat62="Beta\Interface always off/on",8011B4B9 00FF,8011B92F 00?? +Cheat62_O=$00 Off,$01 On +Cheat62_N=If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset. +Cheat63="Always Have Wallet Size",8011A672 00?? +Cheat63_O=$47 Kid Wallet (Holds 99),$57 Adult Wallet (Holds 200),$67 Giant Wallet (Holds 500) +Cheat7_O=$4000 At Sunrise,$5800 Daylight Out,$7000 Very Bright Out,$C000 At Sunset,$D000 Fairly Dark +Cheat10_O=$11 Kokiri Tunic & Kokiri Boots,$12 Goron Tunic & Kokiri Boots,$13 Zora Tunic & Kokiri Boots,$14 Black Tunic & Kokiri Boots,$15 White Tunic & Kokiri Boots,$16 Yellow Tunic & Kokiri Boots,$21 Kokiri Tunic & Iron Boots,$22 Goron Tunic & Iron Boots,$23 Zora Tunic & Iron Boots,$24 Black Tunic & Iron Boots,$25 White Tunic & Iron Boots,$26 Yellow Tunic & Iron Boots,$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat19_O=$07 Fairy Ocarina,$08 Ocarina Of Time +Cheat32_O=$0A Hookshot,$0B Longshot +Cheat37_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat38_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat39_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat40_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat41_O=$2D Pocket Egg,$2E Pocket Cucco,$2F Cojiro,$30 Odd Mushroom,$31 Odd Potion,$32 Poacher's Saw,$33 Goron's Sword (Broken),$34 Prescription,$35 Eyeball Frog,$36 Eye Drops,$37 Claim Check +Cheat42_O=$21 Weird Egg,$22 Chicken,$23 Zelda's Letter,$24 Keaton Mask,$25 Skull Mask,$26 Spooky Mask,$27 Bunny Hood,$28 Goron Mask,$29 Zora Mask,$2A Gerudo Mask,$2B Mask of Truth,$2C SOLD OUT +Cheat45_O=$02 Silver Scale,$04 Golden Scale,$06 Giant's Knife (Broken),$35 Black Gauntlets,$40 Bullet Bag (Holds 30),$80 Bullet Bag (Holds 40),$C0 Bullet Bag (Holds 50) +Cheat46_O=$08 Bomb Bag (Holds 20),$10 Bomb Bag (Holds 30),$18 Bomb Bag (Holds 40),$20 Goron's Bracelet,$28 Silver Gauntlets,$30 Golden Gauntlets +Cheat0_N=This cheat allows you to have the max Rupees to the Wallet you currently Hold +Cheat2_N=do not use under or in water +Cheat3_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal +Cheat4_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal +Cheat10_N=This changes what you are wearing,once you have enabled the code press Start & then start again. +Cheat45_N=This modifies the equipment you are carrying.If you Use Black Gauntlets,They are as strong as the Golden Gauntlets. This code also gives you the Silver Scale and the Golden Scale and unlimited rupees. +Cheat46_N=This modifies the equipment you are carrying. +Cheat47_N=Use this cheat to levitate. You have to deactivate it to come back down. Useful for passing obstacles that usually can be passed only at a later point! + +//---- + +[D43DA81F-021E1E19-C:4A] +Name=Zelda no Densetsu - Toki no Ocarina (J) (v1.1) +Cheat0="Infinite\Rupees",8111BB5C 0001 +Cheat1="Press R\For Old Or Young Link",D01C8675 0010,8011A797 00?? +Cheat1_O=$01 Link Young,$00 Link Old +Cheat1_N=To Activate this Cheat Hold The R Button when walking through a Doorway this will change you to the option on the other side, Disable this Cheat straight away after getting to the other side, in some places you might even get Access Violations. Just press ok untill you can carry on. +Cheat2="Use Any Item In Any House",8111B9B2 0000,8111B9B4 0000 +Cheat3="Have\All Equipment",8111A82C 7777 +Cheat4="Have\All Quest/Status Items",8111A834 30FF,8111A836 FFFF +Cheat5="Max\Heart Containers",8111A7BE 0140 +Cheat6="Max\Gold Skulltulas Killed",8011A861 0064 +Cheat7="Time of Day Modifier",8111A79C ???? +Cheat8="Infinite\Energy",8111A7C0 0140 +Cheat9="Infinite\Magic",D011A7C9 0008,8011A7CA 0001,8011A7CC 0001,8011A7C3 0060 +Cheat10="Tunic & Boot Options",8011A800 00?? +Cheat11="Infinite\Deku Sticks",8011A81C 0009 +Cheat12="Infinite\Deku Nuts",8011A81D 0009 +Cheat13="Infinite\Bombs",8011A81E 0009 +Cheat14="Infinite\Arrows",8011A81F 0009 +Cheat15="Infinite\Deku Seeds",8011A822 0009 +Cheat16="Infinite\Bombchu's",8011A824 0009 +Cheat17="Infinite\Magic Beans",8011A82A 0009 +Cheat18="Infinite\Big Key,Small Keys,Compass,& Map",8011A838 0007,8011A839 0007,8011A83A 0007,8011A83B 0007,8011A83C 0007,8011A83D 0007,8011A83E 0007,8011A83F 0007,8011A840 0007,8011A841 0007,8011A842 0007,8011A84F 0009,8011A850 0009,8011A851 0009,8011A852 0009,8011A853 0009,8011A859 0009,8011A85C 0009,8011A857 0009 +Cheat19="Have\Ocarina",8011A80B 00?? +Cheat20="Have\Boomerang",8011A810 000E +Cheat21="Have\Lens of Truth",8011A811 000F +Cheat22="Have\Megaton Hammer",8011A813 0011 +Cheat23="Have\Deku Stick",8011A804 0000 +Cheat24="Have\Deku Nut",8011A805 0001 +Cheat25="Have\Bombs",8011A806 0002 +Cheat26="Have\Fairy Bow",8011A807 0003 +Cheat27="Have\Fairy Slingshot",8011A80A 0006 +Cheat28="Have\Bombchu",8011A80C 0009 +Cheat29="Have\Arrows\Fire Arrow",8011A808 0004 +Cheat30="Have\Arrows\Ice Arrow",8011A80E 000C +Cheat31="Have\Arrows\Light Arrow",8011A814 0012 +Cheat32="Have\Hookshot",8011A80D 00?? +Cheat33="Have\Magic Beans",8011A812 0010 +Cheat34="Have\Magic\Fairie's Wind",8011A80F 000D +Cheat35="Have\Magic\Nayru's Love",8011A815 0013 +Cheat36="Have\Magic\Din's Fire",8011A809 0005 +Cheat37="Bottles\Bottle 1 Modifier",8011A816 00?? +Cheat38="Bottles\Bottle 2 Modifier",8011A817 00?? +Cheat39="Bottles\Bottle 3 Modifier",8011A818 00?? +Cheat40="Bottles\Bottle 4 Modifier",8011A819 00?? +Cheat41="Trading\Adult Link Item",8011A81A 00?? +Cheat42="Trading\Young Link Item",8011A81B 00?? +Cheat43="Turn Giant's Knife Into Biggoron's Sword",8011A7CE 0001 +Cheat44="Have Quiver (Holds 30)",8011A831 0001 +Cheat45="Equipment Modifier 1",8011A832 00?? +Cheat46="Equipment Modifier 2",8011A833 00?? +Cheat47="Press L To Levitate",D01C8675 0020,811DAC50 40CB +Cheat47_N=Press L To Levitate & Let go to land +Cheat48="Press L For infinite Hover Boots,",D01C8675 0020,811DB472 000D +Cheat48_N=Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on +Cheat49="Instant Step Hoover Boots",D01C8675 0020,811DAC50 40CB,D01C8675 0000,811DB472 000D,8011A800 00?? +Cheat49_O=$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat49_N=Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. +Cheat50="Beta\Play Beta Quest Worlds",D01C8675 0000,8011BBA3 00?? +Cheat50_O=$00 World 01,$01 World 02,$02 World 03,$03 World 04,$04 World 05,$07 World 06,$08 World 07,$16 World 08 +Cheat50_N=Put on the code on load up,After the Nintendo logo you will be in Beta Mode,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. +Cheat51="Warp Song Location\Minuet of Forest & Serenade of Water",8011BB25 00?? +Cheat51="Warp Song Location\Minuet of Forest & Serenade of Water",8011BB25 00?? +Cheat51_O=$00 Sacred Forest Meadow,$04 Lake Hylia,$15 Inside Jabu Jabu's Belly,$18 Dodongo's Cavern,$68 Inside The Deku Tree +Cheat51_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat52="Warp Song Location\Prelude of Light & Nocturne of Shadow",8011BB25 00?? +Cheat52_O=$03 Kakariko Windmill,$07 Bombchu Bowling Alley,$0F Zelda & Impa Flee,$14 Kakariko Village,$17 Ganon,Final Battle,$1D Top of Ganon's Tower,$28 Bombchu Shop,$2C Bazaar,$30 Happy Mask Shop,$34 Ganon's Tower,$38 Ganon's Castle,$4C Inside Spirit Door,$6C Burning Castle,$50 House of Skulltula,$64 Death Mountain Trail,$68 Graveyard,$70 Thieves' Hideout,$74 Royal Family's Tomb,$78 Great Fairy Fountain 1,$84 Forest Temple,Room With Falling Floor,$88 Great Fairy Fountain 2,$99 Grotto 01,$9D Grotto 02,$A4 Grotto 04,$A8 Grotto 05,$B3 Grotto 06,$B0 Grotto 07,$B4 Grotto 08,$B8 Grotto 09,$C3 Grotto 10,$C0 Grotto 11,$C4 Grotto 12,$FC Grotto 13,$D3 Bottom of the Well,$D0 Lon Lon Ranch Shed,$D3 Lon Lon Ranch Outside Shed,$D8 Ice Cavern,$E3 Outside Cow Pen,$E0 Lost Woods Bridge,$E4 Lon Lon Ranch Chicken Room,$E8 In Front of Deku Tree,$EB Spirit Temple Boss,$F1 Castle Courtyard,In Front of Zelda,$F4 Temple of Time,$F8 Gerudo Fortress Jail +Cheat52_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat53="Warp Song Location\Bolero of Fire",8011BB25 00?? +Cheat53_O=$03 Castle Courtyard,$0B Dodongo's Cavern Boss,$10 Inside The Deku Tree Boss,$14 Shadow Temple Boss,$17 Water Temple Boss,$1C Ganon's Castle Tower,$1F Ganon First Battle,$28 Ganon's Castle Room Before Ganon,$2B Inside Ganon's Castle Room With Pillar,$2F Lon Lon Ranch,$33 Mido's House,$37 Saria's House,$4B Bearded Man's House,$40 Top of Ganon's Castle,$47 Outside Saria's House,$4F Dampe's Race,$57 Kokiri Forest,$5B Top of Death Mountain,$5F Fishing Pond,$68 Inside Ganon's Castle,$7F Hyrule Castle Gate,$BA Top of Ganon's Tower,$C2 Great Fairy Fountain,$D6 Lost Woods Goron Entrance,$DA Lost Woods River Entrance,$DE Lost Woods Bridge Field Entrance,$E3 Goron City Lost Woods Entrance,$F6 Death Mountain Crater,$FD Ganon's Castle +Cheat53_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat54="Warp Song Location\Requiem of Spirit",8011BB25 00?? +Cheat54_O=$05 Lake Hylia,08 Zora's Domain,$18 Gerudo Valley,$1E Lost Woods,$28 Gerudo Fortress,$30 Haunted Wasteland,$34 Ganon's Castle Inside Burning Castle,$38 Hyrule Castle,$3A Ganon's Castle,$3D Death Mountain Trail,$4D Goron City,$65 Fire Temple,$69 Forest Temple,$6E Shooting Gallery,$79 Ganon's Castle Inside Burning Castle,$7E Kakariko Village Entrance,$7B Zora's River Entrance,$85 Kokiri Forest Entrance,$8A Lake Hyrule Entrance,$8E Gerudo Valley Entrance,$92 Death Mountain Trail Entrance,$95 Graveyard Entrance,$9E Zora's Domain Entrance,$A2 Zora's Fountain Entrance,$BA Goron City Entrance,$BE Death Mountain Trail,$C1 Goron City,$C5 Lakeside Laboratory,$C9 Top of Ganon's Castle,$CD Hyrule Market (Child Link's),$CF Hyrule Market (Adult Link's),$F1 Desert Colossus,$FA Lon Lon Ranch Entrance,$FD Hyrule Field +Cheat54_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat55="Max\Double Defense Power",8011A85F 0014 +Cheat55_N=This gives you White Border Hearts +Cheat56="Nayru's Love is Always",8111BB58 ???? +Cheat56_O=$0000 OFF,$FFFF ON +Cheat56_N=For this to work On Or off, you have to walk through a Doorway to activate the Change. +Cheat57="Infinite\Timers\All other Timers",8011BB61 0032 +Cheat57_N=This cheat works on all Race Timers.Under Water with iron Boots etc. +Cheat58="Epona\Max Carrots\Lon Lon Raunch",801D8D8A 0006,801F23C8 0001,801EEE48 0001 +Cheat58_N=This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona +Cheat59="Infinite\Timers\Escape From Gannons Tower",8011BB65 00B4 +Cheat59_N=This cheat works only on The Final Boss. +Cheat60="Beta\Specific things lean",800257D4 0001 +Cheat60_N=This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest 01). +Cheat61="Beta\Appear in Strange Places (Hold R)",D01C8675 0010,8111BAF6 0001 +Cheat61_N=If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. +Cheat62="Beta\Interface always off/on",8011B679 00FF,8011BAEF 00?? +Cheat62_O=$00 Off,$01 On +Cheat62_N=If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset. +Cheat63="Always Have Wallet Size",8011A832 00?? +Cheat63_O=$47 Kid Wallet (Holds 99),$57 Adult Wallet (Holds 200),$67 Giant Wallet (Holds 500) +Cheat7_O=$4000 At Sunrise,$5800 Daylight Out,$7000 Very Bright Out,$C000 At Sunset,$D000 Fairly Dark +Cheat10_O=$11 Kokiri Tunic & Kokiri Boots,$12 Goron Tunic & Kokiri Boots,$13 Zora Tunic & Kokiri Boots,$14 Black Tunic & Kokiri Boots,$15 White Tunic & Kokiri Boots,$16 Yellow Tunic & Kokiri Boots,$21 Kokiri Tunic & Iron Boots,$22 Goron Tunic & Iron Boots,$23 Zora Tunic & Iron Boots,$24 Black Tunic & Iron Boots,$25 White Tunic & Iron Boots,$26 Yellow Tunic & Iron Boots,$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat19_O=$07 Fairy Ocarina,$08 Ocarina Of Time +Cheat32_O=$0A Hookshot,$0B Longshot +Cheat37_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat38_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat39_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat40_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat41_O=$2D Pocket Egg,$2E Pocket Cucco,$2F Cojiro,$30 Odd Mushroom,$31 Odd Potion,$32 Poacher's Saw,$33 Goron's Sword (Broken),$34 Prescription,$35 Eyeball Frog,$36 Eye Drops,$37 Claim Check +Cheat42_O=$21 Weird Egg,$22 Chicken,$23 Zelda's Letter,$24 Keaton Mask,$25 Skull Mask,$26 Spooky Mask,$27 Bunny Hood,$28 Goron Mask,$29 Zora Mask,$2A Gerudo Mask,$2B Mask of Truth,$2C SOLD OUT +Cheat45_O=$02 Silver Scale,$04 Golden Scale,$06 Giant's Knife (Broken),$35 Black Gauntlets,$40 Bullet Bag (Holds 30),$80 Bullet Bag (Holds 40),$C0 Bullet Bag (Holds 50) +Cheat46_O=$08 Bomb Bag (Holds 20),$10 Bomb Bag (Holds 30),$18 Bomb Bag (Holds 40),$20 Goron's Bracelet,$28 Silver Gauntlets,$30 Golden Gauntlets +Cheat0_N=This cheat allows you to have the max Rupees to the Wallet you currently Hold +Cheat2_N=do not use under or in water +Cheat3_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal +Cheat4_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal +Cheat10_N=This changes what you are wearing,once you have enabled the code press Start & then start again. +Cheat45_N=This modifies the equipment you are carrying.If you Use Black Gauntlets,They are as strong as the Golden Gauntlets. This code also gives you the Silver Scale and the Golden Scale and unlimited rupees. +Cheat46_N=This modifies the equipment you are carrying. +Cheat47_N=Use this cheat to levitate. You have to deactivate it to come back down. Useful for passing obstacles that usually can be passed only at a later point! + +//---- + +[693BA2AE-B7F14E9F-C:4A] +Name=Zelda no Densetsu - Toki no Ocarina (J) (v1.2) +Cheat0="Infinite\Rupees",8111C04C 0001 +Cheat1="Press R\For Old Or Young Link",D01C8D75 0010,8011AC87 00?? +Cheat1_O=$01 Link Young,$00 Link Old +Cheat1_N=To Activate this Cheat Hold The R Button when walking through a Doorway this will change you to the option on the other side, Disable this Cheat straight away after getting to the other side, in some places you might even get Access Violations. Just press ok untill you can carry on. +Cheat2="Use Any Item In Any House",8111BEA2 0000,8111BEA4 0000 +Cheat3="Have\All Equipment",8111AD1C 7777 +Cheat4="Have\All Quest/Status Items",8111AD24 30FF,8111AD26 FFFF +Cheat5="Max\Heart Containers",8111ACAE 0140 +Cheat6="Max\Gold Skulltulas Killed",8011AD51 0064 +Cheat7="Time of Day Modifier",8111AC8C ???? +Cheat8="Infinite\Energy",8111ACB0 0140 +Cheat9="Infinite\Magic",D011ACB9 0008,8011ACBA 0001,8011ACBC 0001,8011ACB3 0060 +Cheat10="Tunic & Boot Options",8011ACF0 00?? +Cheat11="Infinite\Deku Sticks",8011AD0C 0009 +Cheat12="Infinite\Deku Nuts",8011AD0D 0009 +Cheat13="Infinite\Bombs",8011AD0E 0009 +Cheat14="Infinite\Arrows",8011AD0F 0009 +Cheat15="Infinite\Deku Seeds",8011AD12 0009 +Cheat16="Infinite\Bombchu's",8011AD14 0009 +Cheat17="Infinite\Magic Beans",8011AD1A 0009 +Cheat18="Infinite\Big Key,Small Keys,Compass,& Map",8011AD28 0007,8011AD29 0007,8011AD2A 0007,8011AD2B 0007,8011AD2C 0007,8011AD2D 0007,8011AD2E 0007,8011AD2F 0007,8011AD30 0007,8011AD31 0007,8011AD32 0007,8011AD3F 0009,8011AD40 0009,8011AD41 0009,8011AD42 0009,8011AD43 0009,8011AD49 0009,8011AD4C 0009,8011AD47 0009 +Cheat19="Have\Ocarina",8011ACFB 00?? +Cheat20="Have\Boomerang",8011AD00 000E +Cheat21="Have\Lens of Truth",8011AD01 000F +Cheat22="Have\Megaton Hammer",8011AD03 0011 +Cheat23="Have\Deku Stick",8011ACF4 0000 +Cheat24="Have\Deku Nut",8011ACF5 0001 +Cheat25="Have\Bombs",8011ACF6 0002 +Cheat26="Have\Fairy Bow",8011ACF7 0003 +Cheat27="Have\Fairy Slingshot",8011ACFA 0006 +Cheat28="Have\Bombchu",8011ACFC 0009 +Cheat29="Have\Arrows\Fire Arrow",8011ACF8 0004 +Cheat30="Have\Arrows\Ice Arrow",8011ACFE 000C +Cheat31="Have\Arrows\Light Arrow",8011AD04 0012 +Cheat32="Have\Hookshot",8011ACFD 00?? +Cheat33="Have\Magic Beans",8011AD02 0010 +Cheat34="Have\Magic\Fairie's Wind",8011ACFF 000D +Cheat35="Have\Magic\Nayru's Love",8011AD05 0013 +Cheat36="Have\Magic\Din's Fire",8011ACF9 0005 +Cheat37="Bottles\Bottle 1 Modifier",8011AD06 00?? +Cheat38="Bottles\Bottle 2 Modifier",8011AD07 00?? +Cheat39="Bottles\Bottle 3 Modifier",8011AD08 00?? +Cheat40="Bottles\Bottle 4 Modifier",8011AD09 00?? +Cheat41="Trading\Adult Link Item",8011AD0A 00?? +Cheat42="Trading\Young Link Item",8011AD0B 00?? +Cheat43="Turn Giant's Knife Into Biggoron's Sword",8011ACBE 0001 +Cheat44="Have Quiver (Holds 30)",8011AD21 0001 +Cheat45="Equipment Modifier 1",8011AD22 00?? +Cheat46="Equipment Modifier 2",8011AD23 00?? +Cheat47="Press L To Levitate",D01C8D75 0020,811DB350 40CB +Cheat47_N=Press L To Levitate & Let go to land +Cheat48="Press L For infinite Hover Boots,",D01C8D75 0020,811DBB72 000D +Cheat48_N=Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on +Cheat49="Instant Step Hoover Boots",D01C8D75 0020,811DB350 40CB,D01C8D75 0000,811DBB72 000D,8011ACF0 00?? +Cheat49_O=$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat49_N=Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. +Cheat50="Beta\Play Beta Quest Worlds",D01C8D75 0000,8011C093 00?? +Cheat50_O=$00 World 01,$01 World 02,$02 World 03,$03 World 04,$04 World 05,$07 World 06,$08 World 07,$16 World 08 +Cheat50_N=Put on the code on load up,After the Nintendo logo you will be in Beta Mode,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. +Cheat51="Warp Song Location\Minuet of Forest & Serenade of Water",8011C015 00?? +Cheat51="Warp Song Location\Minuet of Forest & Serenade of Water",8011C015 00?? +Cheat51_O=$00 Sacred Forest Meadow,$04 Lake Hylia,$15 Inside Jabu Jabu's Belly,$18 Dodongo's Cavern,$68 Inside The Deku Tree +Cheat51_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat52="Warp Song Location\Prelude of Light & Nocturne of Shadow",8011C015 00?? +Cheat52_O=$03 Kakariko Windmill,$07 Bombchu Bowling Alley,$0F Zelda & Impa Flee,$14 Kakariko Village,$17 Ganon,Final Battle,$1D Top of Ganon's Tower,$28 Bombchu Shop,$2C Bazaar,$30 Happy Mask Shop,$34 Ganon's Tower,$38 Ganon's Castle,$4C Inside Spirit Door,$6C Burning Castle,$50 House of Skulltula,$64 Death Mountain Trail,$68 Graveyard,$70 Thieves' Hideout,$74 Royal Family's Tomb,$78 Great Fairy Fountain 1,$84 Forest Temple,Room With Falling Floor,$88 Great Fairy Fountain 2,$99 Grotto 01,$9D Grotto 02,$A4 Grotto 04,$A8 Grotto 05,$B3 Grotto 06,$B0 Grotto 07,$B4 Grotto 08,$B8 Grotto 09,$C3 Grotto 10,$C0 Grotto 11,$C4 Grotto 12,$FC Grotto 13,$D3 Bottom of the Well,$D0 Lon Lon Ranch Shed,$D3 Lon Lon Ranch Outside Shed,$D8 Ice Cavern,$E3 Outside Cow Pen,$E0 Lost Woods Bridge,$E4 Lon Lon Ranch Chicken Room,$E8 In Front of Deku Tree,$EB Spirit Temple Boss,$F1 Castle Courtyard,In Front of Zelda,$F4 Temple of Time,$F8 Gerudo Fortress Jail +Cheat52_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat53="Warp Song Location\Bolero of Fire",8011C015 00?? +Cheat53_O=$03 Castle Courtyard,$0B Dodongo's Cavern Boss,$10 Inside The Deku Tree Boss,$14 Shadow Temple Boss,$17 Water Temple Boss,$1C Ganon's Castle Tower,$1F Ganon First Battle,$28 Ganon's Castle Room Before Ganon,$2B Inside Ganon's Castle Room With Pillar,$2F Lon Lon Ranch,$33 Mido's House,$37 Saria's House,$4B Bearded Man's House,$40 Top of Ganon's Castle,$47 Outside Saria's House,$4F Dampe's Race,$57 Kokiri Forest,$5B Top of Death Mountain,$5F Fishing Pond,$68 Inside Ganon's Castle,$7F Hyrule Castle Gate,$BA Top of Ganon's Tower,$C2 Great Fairy Fountain,$D6 Lost Woods Goron Entrance,$DA Lost Woods River Entrance,$DE Lost Woods Bridge Field Entrance,$E3 Goron City Lost Woods Entrance,$F6 Death Mountain Crater,$FD Ganon's Castle +Cheat53_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat54="Warp Song Location\Requiem of Spirit",8011C015 00?? +Cheat54_O=$05 Lake Hylia,08 Zora's Domain,$18 Gerudo Valley,$1E Lost Woods,$28 Gerudo Fortress,$30 Haunted Wasteland,$34 Ganon's Castle Inside Burning Castle,$38 Hyrule Castle,$3A Ganon's Castle,$3D Death Mountain Trail,$4D Goron City,$65 Fire Temple,$69 Forest Temple,$6E Shooting Gallery,$79 Ganon's Castle Inside Burning Castle,$7E Kakariko Village Entrance,$7B Zora's River Entrance,$85 Kokiri Forest Entrance,$8A Lake Hyrule Entrance,$8E Gerudo Valley Entrance,$92 Death Mountain Trail Entrance,$95 Graveyard Entrance,$9E Zora's Domain Entrance,$A2 Zora's Fountain Entrance,$BA Goron City Entrance,$BE Death Mountain Trail,$C1 Goron City,$C5 Lakeside Laboratory,$C9 Top of Ganon's Castle,$CD Hyrule Market (Child Link's),$CF Hyrule Market (Adult Link's),$F1 Desert Colossus,$FA Lon Lon Ranch Entrance,$FD Hyrule Field +Cheat54_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat55="Max\Double Defense Power",8011AD4F 0014 +Cheat55_N=This gives you White Border Hearts +Cheat56="Nayru's Love is Always",8111C048 ???? +Cheat56_O=$0000 OFF,$FFFF ON +Cheat56_N=For this to work On Or off, you have to walk through a Doorway to activate the Change. +Cheat57="Infinite\Timers\All other Timers",8011C051 0032 +Cheat57_N=This cheat works on all Race Timers.Under Water with iron Boots etc. +Cheat58="Epona\Max Carrots\Lon Lon Raunch",801D927A 0006,801F28B8 0001,801EF338 0001 +Cheat58_N=This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona +Cheat59="Infinite\Timers\Escape From Gannons Tower",8011C055 00B4 +Cheat59_N=This cheat works only on The Final Boss. +Cheat60="Beta\Specific things lean",80025CC4 0001 +Cheat60_N=This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest 01). +Cheat61="Beta\Appear in Strange Places (Hold R)",D01C8B65 0010,8111BFE6 0001 +Cheat61_N=If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. +Cheat62="Beta\Interface always off/on",8011BB69 00FF,8011BFDF 00?? +Cheat62_O=$00 Off,$01 On +Cheat62_N=If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset. +Cheat63="Always Have Wallet Size",8011AD22 00?? +Cheat63_O=$47 Kid Wallet (Holds 99),$57 Adult Wallet (Holds 200),$67 Giant Wallet (Holds 500) +Cheat7_O=$4000 At Sunrise,$5800 Daylight Out,$7000 Very Bright Out,$C000 At Sunset,$D000 Fairly Dark +Cheat10_O=$11 Kokiri Tunic & Kokiri Boots,$12 Goron Tunic & Kokiri Boots,$13 Zora Tunic & Kokiri Boots,$14 Black Tunic & Kokiri Boots,$15 White Tunic & Kokiri Boots,$16 Yellow Tunic & Kokiri Boots,$21 Kokiri Tunic & Iron Boots,$22 Goron Tunic & Iron Boots,$23 Zora Tunic & Iron Boots,$24 Black Tunic & Iron Boots,$25 White Tunic & Iron Boots,$26 Yellow Tunic & Iron Boots,$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat19_O=$07 Fairy Ocarina,$08 Ocarina Of Time +Cheat32_O=$0A Hookshot,$0B Longshot +Cheat37_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat38_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat39_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat40_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat41_O=$2D Pocket Egg,$2E Pocket Cucco,$2F Cojiro,$30 Odd Mushroom,$31 Odd Potion,$32 Poacher's Saw,$33 Goron's Sword (Broken),$34 Prescription,$35 Eyeball Frog,$36 Eye Drops,$37 Claim Check +Cheat42_O=$21 Weird Egg,$22 Chicken,$23 Zelda's Letter,$24 Keaton Mask,$25 Skull Mask,$26 Spooky Mask,$27 Bunny Hood,$28 Goron Mask,$29 Zora Mask,$2A Gerudo Mask,$2B Mask of Truth,$2C SOLD OUT +Cheat45_O=$02 Silver Scale,$04 Golden Scale,$06 Giant's Knife (Broken),$35 Black Gauntlets,$40 Bullet Bag (Holds 30),$80 Bullet Bag (Holds 40),$C0 Bullet Bag (Holds 50) +Cheat46_O=$08 Bomb Bag (Holds 20),$10 Bomb Bag (Holds 30),$18 Bomb Bag (Holds 40),$20 Goron's Bracelet,$28 Silver Gauntlets,$30 Golden Gauntlets +Cheat0_N=This cheat allows you to have the max Rupees to the Wallet you currently Hold +Cheat2_N=do not use under or in water +Cheat3_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal +Cheat4_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal +Cheat10_N=This changes what you are wearing,once you have enabled the code press Start & then start again. +Cheat45_N=This modifies the equipment you are carrying.If you Use Black Gauntlets,They are as strong as the Golden Gauntlets. This code also gives you the Silver Scale and the Golden Scale and unlimited rupees. +Cheat46_N=This modifies the equipment you are carrying. +Cheat47_N=Use this cheat to levitate. You have to deactivate it to come back down. Useful for passing obstacles that usually can be passed only at a later point! + + +//--------------- (JU) Region Cheat Codes --------------- + + +[1FBAF161-2C1C54F1-C:41] +Name=1080 SNOWBOARDING +Cheat0="Infinite Damage All Players & Levels",803F4C3D 0000 +Cheat1="Infinite Lives & Continues",8026B1CB 0003 +Cheat2="Enable All Levels & Boarders",80255089 00FF,8025508B 0005,81255096 FCFF,80255098 0007 +Cheat3="Stop Timer\Time Attack\Air Make",8031AB5A 0000 +Cheat4="Stop Timer\Time Attack\Half Pipe",802F649A 0000 +Cheat5="Stop Timer\Time Attack\Crystal Lake",802A593A 0000 +Cheat6="Stop Timer\Time Attack\Crystal Peak",802B2CDA 0000 +Cheat7="Stop Timer\Time Attack\Golden Forrest",802B146A 0000 +Cheat8="Stop Timer\Time Attack\Mountain Village",802CBA6A 0000 +Cheat9="Stop Timer\Time Attack\Dragon Cave",802C148A 0000 +Cheat10="Stop Timer\Time Attack\Deadly Fall",802CF67A 0000 +Cheat11="Stop Timer\Trick Attack\Air Make",8031ABCA 00C5 +Cheat12="Stop Timer\Trick Attack\Half Pipe",802F650A 00C5 +Cheat13="Stop Timer\Trick Attack\Crystal Lake",8029F77A 00C5 +Cheat14="Stop Timer\Trick Attack\Crystal Peak",802AC9FA 00C5 +Cheat15="Stop Timer\Trick Attack\Golden Forrest",802AB06A 00C5 +Cheat16="Stop Timer\Trick Attack\Mountain Village",802C51EA 00C5 +Cheat17="Stop Timer\Trick Attack\Dragon Cave",802BAE4A 00C5 +Cheat18="Stop Timer\Trick Attack\Deadly Fall",802C8F1A 00C5 +Cheat19="Stop Timer\Contest\Crystal Lake",8029C1EA 00C5 +Cheat20="Stop Timer\Contest\Crystal Peak",802A89AA 00C5 +Cheat21="Stop Timer\Contest\Golden Forest",802A6E4A 00C5 +Cheat22="Stop Timer\Contest\Air Make",80319CCA 00C5 +Cheat23="Stop Timer\Contest\Half Pipe",802F530A 00C5 +Cheat24="Have All\Match Levels Completed",8025508A 0005 +Cheat25="Have All\Contest First Place Done",80244098 0007 +Cheat26="Open Level Character Select",8125508A 00?? +Cheat26_O=$01 Easy Level,$02 Easy & Normal Level,$03 Easy Normal & Hard Levels,$04 Easy Normal Hard Levels & Crystal Boarder,$05 Easy Normal Hard Levels & Crystal & Metal Boarders +Cheat26_N=With these codes, you have to press the buttons listed below when you are viewing a certain boarders stats. Highlight Akari Hayami's stats, and then hold down the C-Left button and then press the A button to be the Crystal Boarder. Highlight Kensuke Kimachi's stats, and then hold down the C-Up button and then press the A button to be the Metal Boarder. Hightlight Rob Haywood's stats, and then hold down the C-Right button and then press the A button to be the Panda Boarder +Cheat27="Play As",800200E7 00?? +Cheat27_O=$00 Dion Blaster,$01 Kensuke Kimachi,$02 Akari Hayami,$03 Ricky Winterborn,$04 Rob Haywood,$05 Silver Boarder,$06 Gold Boarder,$07 Panda Boarder +Cheat28="Have All\Trick Attacks Done",81255096 FCFF + +//--------------- (U) Region Cheat Codes --------------- + + +[82DC04FD-CF2D82F4-C:45] +Name=A Bug's Life (J) +Cheat0="Infinite\Lives",801E1A38 0009 +Cheat1="Infinite\Health",801E1A2D 0004 +Cheat2="Always Have\Super Jump",811E1A28 0020 +Cheat3="Always Have\50 pieces of corn",801E1A39 0032 +Cheat4="Have F-L-I-K",801E1A3A 000F +Cheat5="Levitate",D008F2C1 0010,801E199E 0001,D008F2C1 0010,801E19AE 0001 +Cheat5_N="Press R To Levitate & Let go to land (:" +Cheat6="Unlock All Levels",81099150 000F +Cheat7="Have All Goldberry Tokens",801E1A26 0000 +Cheat8="Start with Berry Weapon",811E1A2E 00?? +Cheat8_O=$01 Blueberry,$02 Homing Berry,$03 Goldberry,$04 Super Berry ? + +//---- + +[1B598BF1-ECA29B45-C:45] +Name=Aerofighter's Assault (U) +Cheat0="Ultra Fast Missile Recharge",8027E300 0001 +Cheat1="Rocket Squad",8027E107 0001 +Cheat2="Tomahawk Squad",8027E109 0001 +Cheat3="Extra Points",D027A20C 0000,8027A20C 00FF +Cheat4="Extra Planes",8127CCEC FFFF +Cheat5="99 Bonus",80130B87 0063 +Cheat6="99 Accuracy",80130B80 0063 +Cheat7="Gun Select",8027E023 00?? +Cheat8="Infinite\Chaffs",8027E017 000A +Cheat9="Infinite\Gun",8027E110 0001 +Cheat10="Infinite\Special Weapons",8027E4D2 0002 +Cheat11="Infinite\Armor",8127CFF4 44A0,8127CFF8 44A0 +Cheat12="Infinite\Health",8027CFF5 00C8,8027CFF9 00C8 +Cheat13="Always Have\F-15J Eagle",8027CCEC 0010 +Cheat14="Always Have\X-29A A.T.D.",8027CCED 0020 +Cheat15="Infinite\99 Lives",80348B98 0063 +Cheat7_O=$00 Chaff,$01 Jammings,$02 Air Mines,$03 Mahibishi,$0A 22mm BB Shot,$0B 22mm,$0C Hunai Shot,$0D Fireball,$0E Sabre,$14 Fire,$15 Tomahawk,$16 Ninja Glitch,$17 Fire Wave,$1E Rocket,$1F Phoenix,$20 Star,$21 Fire Arrow,$28 Ninjabeam + +//---- + +[AEBE463E-CC71464B-C:45] +Name=AEROGAUGE +Cheat0="No Damage\Player 1",50000402 0000,8113FFD8 0000 +Cheat1="No Damage\Player 2",50000402 0000,81142078 0000 +Cheat2="Unlock Hidden Tracks & Cars",8008F29C 0001 +Cheat3="Freeze All Lap Timers",8013FCA1 0001,8013FCA5 0001,8013FCA9 0001 +Cheat4="Freeze Overall Timer",8013FC95 0001 +Cheat5="Laps Of Race",8013FC8E 00?? +Cheat6="Play As\Player 1",8013FF95 00?? +Cheat7="Play As\Player 2",8013FF96 00?? +Cheat9="Always 1st",8013FCE0 0001 +Cheat10="Music Modifier",80109BDC 00?? +Cheat5_O=$01 1 Lap,$02 2 Laps,$03 3 Laps,$04 4 Laps,$05 5 Laps,$06 Never Ending Laps +Cheat6_O=$00 N64 Control Pad,$01 Interceptor,$02 Hornet,$03 Avenger,$04 Shredder,$05 Black Lightning,$06 Vengeance,$07 Prowler,$08 Reaper,$09 Dominator +Cheat7_O=$00 N64 Control Pad,$01 Interceptor,$02 Hornet,$03 Avenger,$04 Shredder,$05 Black Lightning,$06 Vengeance,$07 Prowler,$08 Reaper,$09 Dominator +Cheat10_O=$FF Music On,$00 Music Off +Cheat4_N=All of the Freeze All Lap Timers must be on. These codes will Stop the others from racing against you in Grand Prix mode. To win a race in Grand Prix you must finish at least one lap in the qualify round, then complete all laps in race for first. +Cheat8="Level Select",8013FF9B 00?? +Cheat8_O=$00 Canyon Rush,$01 Bikini Island,$02 China Town,$03 Neo Arena,$04 China Town Jam,$05 Neo Speed Way + +//---- + +[E6A95A4F-BAD2EA23-C:45] +Name=Aidyn Chronicles - The First Mage (U) +Cheat0="Infinite\Max Health",80278B98 001E +Cheat1="Infinite\99 Health Potions",802785CB 0063 +Cheat1_N=Do Not put this cheat on until you have collected your 1st Health Potion from the 1st Cheat or you will not be able to get into the Sub menu and Continue the game. +Cheat2="Have\Max Gold",50000401 0000,80277335 00FF +Cheat3="Have\Max Total XP",50000401 0000,80278BAD 00FF +Cheat4="Have\Max Total XP Remaning to Start",50000401 0000,80278BB1 00FF +Cheat4_N=This will give you 16777215 Total XP Remaning to start with and after your 1st batle will allow you to buy your Max Stats + +//---- + +[C43E23A7-40B1681A-C:45] +Name=All-Star Baseball 99 (U) +Cheat0="Infinite\Character Creation Points",800E2C31 00B0 +Cheat1="Infinite\Strikes",800ABFB9 0000 +Cheat2="Infinite\Balls",800ABFB7 0000 +Cheat3="Infinite\Outs",800ABFBB 0000 +Cheat4="Max\Character Creation Accuracy",810E2BF0 4170 +Cheat5="Max\Character Creation Clutch",810E2BF4 4170 +Cheat6="Max\Character Creation Contact",810E2BFC 4170 +Cheat7="Max\Character Creation Power",810E2C00 4170 +Cheat8="Max\Character Creation VS. LHP",810E2C04 4170 +Cheat9="Max\Character Creation VS. RHP",810E2C08 4170 +Cheat10="Max\Character Creation Bunting",810E2C0C 4170 +Cheat11="Max\Character Creation VS LHB",810E2C10 4170 +Cheat12="Max\Character Creation VS RHB",810E2C14 4170 +Cheat13="Max\Character Creation Speed",810E2C18 4170 +Cheat14="Max\Character Creation Defense",810E2C1C 4170 +Cheat15="Max\Character Creation Arm Strength",810E2C20 4170 +Cheat16="Max\Character Creation Streak",810E2C24 4170 +Cheat17="Max\Character Creation Clutch",810E2C28 4170 + +//---- + +[5E547A4D-90E60795-C:45] +Name=All-Star Baseball 2000 (U) +Cheat0="Infinite\Strikes",8006E4E1 0000 +Cheat1="Infinite\Balls",8006E4DF 0000 +Cheat2="Infinite\Outs",8006E4E3 0000 +Cheat3="Infinite\Character Creation Points",81103350 4170 +Cheat4="Infinite\Pitch Type Creation Points",811039BC 4170,811039C0 4170 +Cheat5="Character Creation\Max\Accuracy",81115A20 4170 +Cheat6="Character Creation\Max\Stamina",81115A24 4170 +Cheat7="Character Creation\Max\Contact",81115A28 4170 +Cheat8="Character Creation\Max\Power",81115A2C 4170 +Cheat9="Character Creation\Max\VS LHP",81115A30 4170 +Cheat10="Character Creation\Max\VS RHP",81115A34 4170 +Cheat11="Character Creation\Max\Bunting",81115A38 4170 +Cheat12="Character Creation\Max\VS LHB",81115A3C 4170 +Cheat13="Character Creation\Max\VS RHB",81115A40 4170 +Cheat14="Character Creation\Max\Speed",81115A44 4170 +Cheat15="Character Creation\Max\Defense",81115A48 4170 +Cheat16="Character Creation\Max\Arm Str.",81115A4C 4170 +Cheat17="Character Creation\Max\Streak",81115A50 4170 +Cheat18="Character Creation\Max\Clutch",81115A54 4170 + +//---- + +[E185E291-4E50766D-C:45] +Name=All Star Tennis '99 (U) +Cheat0="Game Win Select\Player 1",801BBFA1 00?? +Cheat0_O=$00 0 Games Won,$01 1 Game Won,$02 2 Games Won,$03 3 Games Won,$04 4 Games Won,$05 5 Games Won,$06 For Game Set & Match +Cheat1="Game Win Select\Player 2",801BBFA2 00?? +Cheat1_O=$00 0 Games Won,$01 1 Game Won,$02 2 Games Won,$03 3 Games Won,$04 4 Games Won,$05 5 Games Won,$06 For Game Set & Match +Cheat2="Points Select\Player 1",801C7260 00?? +Cheat2_O=$00 0 Points,$15 15 Points,$30 30 Points,$40 40 Points +Cheat3="Points Select\Player 2",801C7261 00?? +Cheat3_O=$00 0 Points,$15 15 Points,$30 30 Points,$40 40 Points +Cheat4="Play As\Player 1",800BFFA5 00?? +Cheat5="Play As\Player 2",800BFFA6 00?? +Cheat4_O=$00 Zoe Taylor,$01 Vanessa Child,$02 Amanda Coetzer,$03 Jana Novotna,$04 Conchita Martinez,$05 Leon Rodez,$06 Michael Chang,$07 Gustavo Kuerten,$08 Jonas Bjorkman,$09 Mark Philippoussis,$0A Randy Powell,$0B Richard Krajicek +Cheat5_O=$00 Zoe Taylor,$01 Vanessa Child,$02 Amanda Coetzer,$03 Jana Novotna,$04 Conchita Martinez,$05 Leon Rodez,$06 Michael Chang,$07 Gustavo Kuerten,$08 Jonas Bjorkman,$09 Mark Philippoussis,$0A Randy Powell,$0B Richard Krajicek + +//---- + +[4C52BBB2-CEAB0F6B-C:45] +Name=Army Men - Air Combat (U) +Cheat0="Co-Pilot Modifier",800B245C 00?? +Cheat1="Helicopter Modifier",800B2534 00?? +Cheat2="Always Play Level Modifier",800B254C 00?? +Cheat3="Start On Play Level Modifier",D00B254C 0000,800B254C 00?? +Cheat0_O=$00 Lt. James Marshall "Woodstock",$01 Lt. John Lawless "Hardcore",$02 Lt. Dave Parker "Rawhide",$03 Lt. Felicity Wannamaker "Bombshell",$04 Sergeant Hawk "Sarge" (Hidden Character) +Cheat1_O=$01 Huey,$02 Chinook (Hidden),$03 Super Stallion (Hidden),$04 Apache (Hidden) +Cheat2_O=$00 Mission 1-Plastic Pandemonium,$01 Mission 2-Going Car-razy,$02 Mission 3-The Train That Could,$03 Mission 4-Tan Terror-Tory,$04 Mission 5-Bug Bath,$05 Mission 6-Uninvited Guests,$06 Mission 7-Ants In The Pants,$07 Mission 8-Saucer Attack,$08 Mission 9-The Heat is On,$09 Mission 10-The Melting Pot,$0A Mission 11-River Rapids Riot,$0B Mission 12-Nighttime Teddy,$0C Mission 13-Demolition Time,$0D Mission 14-Pick Up The Pieces,$0E Mission 15-Have An Ice Day,$0F Mission 16-Plastro's Revenge,$10 Mission 17-Bug Hunt: Chew Chew Bug-B-Q,$11 Mission 18-Bug Hunt: Crispy Critters,$12 Mission 19-Flag-Nab-It: Fort Frenzy,$13 Mission 20-Flag-Nab-it: Freezer Burn,$14 Mission 21-Food Fight: Picnic Panic,$15 Mission 22-Food Fight: Cherry Surprise,$16 Mission 23-Rescue: Don't Feed The Crabs,$17 Mission 24-Rescue: Tide Pool Terror +Cheat3_O=$00 Mission 1-Plastic Pandemonium,$01 Mission 2-Going Car-razy,$02 Mission 3-The Train That Could,$03 Mission 4-Tan Terror-Tory,$04 Mission 5-Bug Bath,$05 Mission 6-Uninvited Guests,$06 Mission 7-Ants In The Pants,$07 Mission 8-Saucer Attack,$08 Mission 9-The Heat is On,$09 Mission 10-The Melting Pot,$0A Mission 11-River Rapids Riot,$0B Mission 12-Nighttime Teddy,$0C Mission 13-Demolition Time,$0D Mission 14-Pick Up The Pieces,$0E Mission 15-Have An Ice Day,$0F Mission 16-Plastro's Revenge,$10 Mission 17-Bug Hunt: Chew Chew Bug-B-Q,$11 Mission 18-Bug Hunt: Crispy Critters,$12 Mission 19-Flag-Nab-It: Fort Frenzy,$13 Mission 20-Flag-Nab-it: Freezer Burn,$14 Mission 21-Food Fight: Picnic Panic,$15 Mission 22-Food Fight: Cherry Surprise,$16 Mission 23-Rescue: Don't Feed The Crabs,$17 Mission 24-Rescue: Tide Pool Terror +Cheat4="Unlock All Planes",810B252A 0105 + +//---- + +[862C0657-8DFD896D-C:45] +Name=Army Men - Sarge's Heroes (U) +Cheat0="Incendiary Bullets",80054C94 0001 +Cheat1="All Weapons",8115969E 0001 +Cheat2="Start With Max Ammo",8115FCBE 0001 +Cheat3="Invincible",8115FCEE 0001 +Cheat4="Infinite Continues",81159692 0001 +Cheat5="Invisible",81159682 0001 +Cheat6="Tin Solider",811596A2 0001 +Cheat7="Maximum Visibility",80070F52 0001 +Cheat8="Flamethrowers Fire In All Directions",8006BD79 0020 +Cheat9="No Flamethrowers Will Work",8006D69D 0001 +Cheat10="Multiplayer Cheats\Incendiary Bullets",80054C81 0001 +Cheat11="Enemies Don't Recongnize You Easily",8005742D 0001 +Cheat12="Play As",811609A2 00?? +Cheat13="Play Level",81163FFA 0001,8116403E ???? +Cheat14="You Move Faster",800ABD69 00FF,800ABDA9 00FF +Cheat15="Press Start For Other Debug Info",8115FCE2 0001 +Cheat16="Enemies Fight Themselves",800585D8 0020 +Cheat17="No Enemies In Levels",80056D4C 0020 +Cheat18="Less Enemies In Levels",80056688 0020 +Cheat19="Enemies Can't Aim",8006D14C 0020 +Cheat20="Enemies Have To Reload Their Guns",8006D16A 0020 +Cheat21="Walls Off For Enemies When Hit",800566D8 0020 +Cheat22="Bullets Only Damage At Extremely Short Range",8006D15A 0020 +Cheat23="Improved Gun Handling",8009C014 003E +Cheat24="Can't Fail Missions",810A04FA ED40 +Cheat25="Everyone Has Dark Camoflauge On",50000804 0000,81098F22 FAE4 +Cheat26="Flamethrower Has Air Buster Flame",810A536A 5008,810A5372 5008 +Cheat27="Flamethrower Has Cloud Flame",810A536A 5224,810A5372 5224 +Cheat28="Flamethrower Has Invisible Flame",810A536A 52A0,810A5372 52A0 +Cheat29="Max Kills Multiplayer\Player 1",8033B9BC FFFF +Cheat30="Max Kills Multiplayer\Player 2",8033BB78 FFFF +Cheat12_O=$07 The Big Green One,$08 Vikki,$09 Plastro +Cheat13_O=$88A0 Spy Blue,$88B4 Bathroom,$88C8 Riff Mission,$88E0 Forest 81163FFA,$88F0 Hoover Mission,$8908 Thick Mission,$8920 Snow Mission,$8938 Shrap Mission,$8950 Fort Plastro,$8968 Scorch Mission,$8980 Showdown,$8994 Sandbox,$89A4 Kitchen,$89B4 Living Room,$89C8 The Way Home + +//---- + +[B20F73B6-2975FC34-C:45] +Name=Army Men - Sarge's Heroes 2 (U) +Cheat0="Invincible",8135C516 0600 +Cheat1="All Weapons & Ammo",8115D06E 0001,8116368E 0001 +Cheat2="Max Ammo",8116368E 0001 +Cheat3="Continues",8115D062 0001 +Cheat4="Invisible",8115D052 0001 +Cheat5="Test Info",8115D3B6 0001 +Cheat6="Living Large",811636AE 0001 +Cheat7="Mini Mode",8115D06A 0001 +Cheat8="Play as",81164372 00?? +Cheat9="Enemies Fight Themselves",8005EE9C 0020 +Cheat10="Move Faster",800B9705 00FF,800B9749 00FF +Cheat8_O=$07 Big Green One,$08 Vikki,$09 Plastro,$0B Mystery Women,$0C Hail Mendheimicus,$0D Mini Soldier + +//---- + +[1FB5D932-3BA9481B-C:45] +Name=Armorines - Project S.W.A.R.M. (U) +Cheat0="Enable In-Game Cheat Menu & Level Select",81115936 014F +Cheat1="Infinite Lewis Laser Rifle",802E1D6F 0170 +Cheat2="Infinite Lewis Explosive Projectile Weapon",802E1D69 0030 +Cheat3="Infinite Jungle Chemical Gun",802E1D7B 0160 +Cheat1_N=The infinite ammo will not work with these codes if you have the expansion pak inserted into your console. +Cheat2_N=The infinite ammo will not work with these codes if you have the expansion pak inserted into your console. +Cheat3_N=The infinite ammo will not work with these codes if you have the expansion pak inserted into your console. +Cheat4="Level Select",81115932 0008 +Cheat5="Infinite Ammo (All Guns)",810496D0 2400 +Cheat6="Don't Take Any Damage",8104A260 2400 +Cheat7="Invincible",81048CA0 2400 +Cheat8="Sound Modifier\Music Volume",80115944 00?? +Cheat8_O=$00 Off,$3C Low (5),$78 Medium (1.0),$BC Defualt (1.5),$F0 Max (2.0) +Cheat9="Sound Modifier\SFX Volume",80115945 00?? +Cheat9_O=$00 Off,$3C Low (5),$78 Medium (1.0),$BC Defualt (1.5),$F0 Max (2.0) + +//---- + +[D1F7D8AB-293B0446-C:45] +Name=Asteroids Hyper 64 (U) +Cheat0="Extra Lives",8007F90E 0063 +Cheat1="Extra Points",8107F8FE FFFF +Cheat2="Infinite Armageddon",8107F892 0001 +Cheat3="Infinite Items On Pickup",8107F8A2 270F +Cheat4="Unlock Classic Asteroids",8106DF5A 0001 +Cheat5="Infinite Lives (Classic Asteroids)",8007F90F 002F + +//---- + +[41B25DC4-1B726786-C:45] +Name=Automobili Lamborghini (U) +Cheat0="Extra Vehicles",50000302 0000,800985C3 0001,50000302 0000,800985CB 0001 +Cheat1="Max Points",800CE743 FFFF +Cheat2="Infinite Time",810CE76E 02F4 +Cheat3="Difficulty Modifier",810CE7A4 00?? +Cheat4="Speeds In Modifier",800CE803 00?? +Cheat5="Always 1st Place",810A5F70 0001 +Cheat3_O=$00 Novice,$01 Expert +Cheat4_O=$00 KM/H,$01 MPH + +//---- + +[A4BF9306-BF0CDFD1-C:45] +Name=Banjo-Kazooie +Cheat0="Infinite\Eggs",80385F67 00FF +Cheat1="Infinite\Lives",80385F8B 00FF +Cheat2="Infinite\Jiggies",80385FCB 00FF +Cheat3="Press L To Levitate",D0281251 0020,8137C4BC 43E0 +Cheat4="Infinite\Notes",80385FF2 00FF,80385F62 0001 +Cheat5="Infinite\Health",80385F83 0008,80385F87 0008 +Cheat6="Infinite\Air",81385F8E 0E10 +Cheat7="Infinite\Gold Feathers",80385F73 00FF +Cheat8="Infinite\Red Feathers",80385F6F 00FF +Cheat9="Infinite\Always Have All Jinjos",80385F7B 00FF +Cheat11="Character Select",D0281251 0008,8037C2D3 0002,D0281251 0001,8037C2D3 0003,D0281251 0004,8037C2D3 0004,D0281251 0002,8037C2D3 0005,D0281251 0010,8037C2D3 0006,D0281251 0020,8037C2D3 0007 +Cheat14="Access All Moves",8037C3A0 0001,8037C3A1 007F,8037C3A2 00FF,8037C3A3 00FF +Cheat15="Game 100% Complete",8137C3A0 001F,50000302 0000,8137C3A2 FFFF,50000602 0000,813832C0 FFFF,81383FCA 0064,81383FDC 0064,50000802 0000,813832F0 FFFF,81385FA0 0063,81385FC4 0063,81385FF0 0064,50000602 0000,81385FF2 6464,50001002 0000,813831A8 FFFF,813831B0 FF7F,813831B2 FFB0,813831B4 3DA6,813831B6 F264,813831C6 FF7F +Cheat16="Secret Items ",81283400 ???? +Cheat16_O=$FFFF Have All Collected,$0000 Have None +Cheat10="Have Zero Time all Levels",50000B04 0000,81386004 3000 +Cheat13="Take Off And Fly From Anywhere",8037C1D1 0002 +Cheat17="Do Shock Spring Jump From Anywhere",8037C1D2 0002 +Cheat4_N=Just collect one Note to Have 255 Notes in all Worlds. +Cheat3_N=Press L To Levitate & Let go to land +Cheat11_N=When Mumbo transforms you hold:C-Up for the Termite,C-Right for the Pumpkin,C-Down for the Walrus,C-Left for the Crocc,R for the Bumble Bee,L for the Washing Machine,Press nothing to turn into Banjo +Cheat13_N=Press A Button. Do not use with Do Shock Spring Jump From Anywhere +Cheat17_N=Press A Button. Do not use with Take Off And Fly From Anywhere +Cheat12="Infinite\Mumbo Tokens",80385FC6 00FF,80385FA2 00FF + +//---- + +[C2E9AA9A-475D70AA-C:45] +Name=Banjo-Tooie (U) +Cheat0="Infinite\Energy\Banjo and Kazooie",8011B069 0063,8111B644 0A0A +Cheat1="Infinite\Air",8112B052 42C8 +Cheat2="Have\AllMoves",D1081084 0800,8112C770 8029,D1081084 0800,8112C772 0000,81290018 FFFF,8129001A FFFF,8129001C FFFF,8129001E FFFF +Cheat2_N=Press Top D-pad Up +Cheat3="Have Most of the Game Finished",5000AC01 0000,80290000 00FF,8029002B 007F,80290063 00FB,80290073 005F,D1081084 0800,8112C770 8029,D1081084 0800,8112C772 0000 +Cheat3_N=Start a new game,when you appear in Spiral Mountain press Top D-Pad. Go to the menu and you will notice all eggs, all moves are available. All the jiggies have been collected. Simply Save and Restart. +Cheat4="Infinite\Energy\Snowball",8011B069 0063,8011B647 0005 +Cheat5="Infinite\Energy\Bee",8011B069 0063,8011B653 000A,8011B654 000A +Cheat6="Infinite\Energy\Washing Machine",8011B069 0063,8111B656 0A0A +Cheat7="Infinite\Energy\Stony",8011B069 0063,8011B659 000A,8011B65A 000A +Cheat8="Infinite\Energy\Banjo",8011B069 0063,8011B65F 000A,8011B660 000A +Cheat9="Infinite\Energy\Kazooie",8011B069 0063,8111B662 0A0A +Cheat10="Infinite\Energy\Submarine",8011B069 0063,8011B665 000A,8011B666 000A +Cheat11="Infinite\Energy\Mumbo",8011B069 0063,8111B668 0A0A +Cheat12="Infinite\Energy\Detonator",8011B069 0063,8111B66E 0A0A +Cheat13="Infinite\Energy\T-Rex Baby",8011B069 0063,8011B67F 000A,8011B680 000A +Cheat14="Have\All Moves & Dragon Kazooie",D1081084 0800,8112C770 8029,D1081084 0800,8112C772 0000,81290018 FFFF,8129001A FFFF,8129001C FFFF,8129001E FFFF,81290078 FFFF,8129007A FFFF +Cheat15="Have\Dragon Kazooie",D1081084 0800,8112C770 8029,D1081084 0800,8112C772 0000,81290078 FFFF,8129007A FFFF +Cheat17="Instant Warp\Options\Spiral Mountain",D0081084 0000,81127640 ????,80127643 0001 +Cheat17_O=$00AD Grunty's Old Lair,$00AE Behind The Waterfall,$00AF Top Of Castle,$0173 Banjo's house +Cheat18="Instant Warp\Options\Jinjo Village",D0081084 0000,81127640 ????,80127643 0001 +Cheat18_O=$0142 Jinjo Village,$0144 King Jingalings throne room,$0143 Bottles house,$0145 Green Jinjo's House,$0146 Black Jinjo's House,$0147 Yellow Jinjo's House,$0148 Blue Jinjo's House,$014A Brown Jinjo's House,$014B Orange Jinjo's House,$014C Purple Jinjo's House,$014D Red Jinjo's House,$014E White Jinjo's House +Cheat19="Instant Warp\Options\Mayahem Temple",D0081084 0000,81127640 ????,80127643 0001 +Cheat19_O=$00B6 Humba's Wigwam,$00B7 Mumbo's skull,$00B8 The Temple,$00B9 Prison Compound,$00BC Code chamber,$00C4 Jade Snake Grove,$00C5 Treasure Chamber,$00C6 Kickball Arena,$0177 Targitzan's Slighty Sacred Temple,$0178 Inside Targitzans Temple,$0179 Targitzan Temple Lobby,$017A Targitzan's Temple Boss,$017F Mayan Kickball Arena,$0166 Multi,$0167 Still,$00C8 Kickball Arena,$00C9 Kickball Arena +Cheat20="Instant Warp\Options\Glitter Gulch Mine",D0081084 0000,81127640 ????,80127643 0001 +Cheat20_O=$00C7 Mine,$00CA Fuel depot,$00CB Crushing shed,$00CC Flooded caves,$00CD Water storage,$00CE Waterfall cavern,$00CF Power hut basement,$00D0 Chuffy's cab,$00D1 Inside chuffy's boiler boss,$00D2 Gloomy caverns,$00D3 Generator caverns,$00D4 Power hut,$00D5 Wumba's wigwam,$00D7 Train station,$00D8 Prospectors hut,$00D9 Mumbo's hut,$00DA Toxic gas cave,$00DB Canary cave,$00DC Ordnance storage,$00E9 Humba,$0126 Water supply pipe,$0163 Ordnance Storage entrance,$0164 Ordnance Storage game,$0165 Ordnance Storage game Multi,$016F Testing,$0170 Testing,$0171 Mumbo's skull +Cheat21="Instant Warp\Options\Witchy World",D0081084 0000,81127640 ????,80127643 0001 +Cheat21_O=$00D6 Witcy World,$00DD Dodgem dome lobby,$00DE Dodgem challenge "1 vs 1",$00DF Dodgem challenge "2 vs 1",$00E0 Dodgem challenge "3 vs 1",$00E1 Crazy castle stockade,$00E2 Crazy castle lobby,$00E3 Crazy castle pump room,$00E4 Balloon burst game,$00E5 Hoop hurry game,$00E6 Star spinner,$00E7 The inferno,$00EA Cave of horrors,$00EB Haunted cavern,$00EC Train station,$0124 Saucer of Peril,$013B Crazy castle stockade "sop",$013C Star spinner "sop",$0176 Mumbo's skull +Cheat22="Instant Warp\Options\Jolly Roger's Lagoon",D0081084 0000,81127640 ????,80127643 0001 +Cheat22_O=$00ED Jolly's,$00EE Pawno's emporium,$00EF mumbo's skull,$00F4 Ancient Swimming Baths,$00F6 Electric Eels lair,$00F7 Seaweed Sanctum,$00F8 Inside the big fish,$00FA temple of the fishes,$01A8 Atlantis,$01A9 Seabottom,$0181 sea bottom cavern,$0182 submarine multi,$01A7 Jolly Roger's Lagoon,$00FF Blubber's wave race hire +Cheat23="Instant Warp\Options\Terrydacty Land",D0081084 0000,81127640 ????,80127643 0001 +Cheat23_O=$0112 Terrydacty Land,$0113 Terry's nest,$0114 Train station,$0115 Oogle boogles cave,$0116 Inside the mountain,$0117 River passage,$0118 Styracosaurus family cave,$0119 Unga bunga's cave,$011A Stomping plains,$011B Bonfire caverns,$011E Humba's Wigwam,$0123 Inside chompa's belly,$0183 Chompa's belly multi +Cheat24="Instant Warp\Options\Grunty Industries",D0081084 0000,81127640 ????,80127643 0001 +Cheat24_O=$0100 Outside,$0101 Inside,$0102 Train station,$0103 Workers quarters,$0104 Trash compactor,$0105 Elevator shaft,$0106 Floor 2,$0107 Floor 2 "electromagnet chamber",$0108 Floor 3,$0109 Floor 3 "boiler plant",$010A Floor 3 "packing room",$010B Floor 4,$010C Floor 4 "cable room",$010D Floor 4 "quality control",$010E Floor 5,$010F Basement,$0110 Basement "repair depot,$0111 Basement "waste disposal",$0125 Water supply pipe,$0172 Mumbo's skull,$0162 Floor 4 "clinkers cavern",$0187 Sewer entrance +Cheat25="Instant Warp\Options\Hailfire Peaks",D0081084 0000,81127640 ????,80127643 0001 +Cheat25_O=$0127 Lava side,$0128 Icy side,$0129 Lava train station,$012A Ice train station,$012B Chilli billi,$012C Chilly willy,$012D Colosseum kickball stadium lobby,$0131 Boggy's igloo,$0132 Icicle grotto,$0133 Inside the volcano,$0168 Icy side still +Cheat26="Instant Warp\Options\Cloud Cuckoo Land",D0081084 0000,81127640 ????,80127643 0001 +Cheat26_O=$0136 Cloud Cuckoo Land 1,$0137 Inside the trashcan,$0138 Inside the cheesewedge,$0139 Zubba's nest,$013A Central cavern,$013D Inside the pot o gold,$013E Mumbo's skull,$013F Mingy jongo's skull,$0140 Humba wumba's wigwam,$0161 Cloud Cuckoo Land 2,$0188 Zubba's nest multi,$0185 Trash can mini +Cheat27="Instant Warp\Options\Isle O Hags",D0081084 0000,81127640 ????,80127643 0001 +Cheat27_O=$014F Wooded Hollow,$0150 Heggy's egg shed,$0151 Jiggywiggy's temple,$0152 Plateau,$0153 Plateau "Honey B's Hive",$0154 Pine Grove,$0155 Cliff top,$0156 Cliff top Mumbo's skull,$015A wasteland,$015B inside another digger tunnel,$015C Quagmire +Cheat28="Instant Warp\Options\Cauldron Keep",D0081084 0000,81127640 ????,80127643 0001 +Cheat28_O=$015D Cauldron Keep,$015E The gatehouse,$015F Tower of Tragedy Quiz,$0160 Gun chamber,$016A Gun room still,$017B Crazy Castle Stockade balloon burst multi,$017C Crazy Castle Stockade Jump the hoops multi,$017D Grunty Industries packing game,$0180 Colosseum kickball arena,$0186 Dodgems +Cheat29="Instant Warp\Options\Not sure",D0081084 0000,81127640 ????,80127643 0001 +Cheat29_O=$00FC Lord woo fak fak,$00F9 Mr Patch,$0121 Inside Chuffy's wagon,$0134 Mumbo's Skull,$0135 Humba Wumba's wigwam 1,$0157 Humba Wumba's wigwam 2,$019B Jingalings Zombified Palace,$01A6 Smuggler cavern,$0141 Inside the digger tunnel,$0143 Bottles house,$0169 Bottles house still,$018A HAG Inside,$019A HAG1 Final Boss +Cheat30="Monsters dont Hurt Banjo",50002430 0000,80132EF5 0000,50002430 0000,80132EF6 0000,50002430 0000,80132EF7 0000,50002430 0000,80132EF8 0000,50002430 0000,80132EF9 0000 +Cheat0_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat4_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat5_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat6_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat7_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat8_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat9_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat10_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat11_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat12_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat13_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat14_N=Press Top D-pad,Do not use with either Have all Moves,Or Have Dragon Kazooie +Cheat15_N=Press Top D-pad,Do not use with Have All Modes Or Have All Moves & Dragon Kazooie +Cheat17_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat18_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat19_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat20_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat21_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat22_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat23_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat24_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat25_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat26_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat27_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat28_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat29_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat31="Beta Bottles Revenge Mode",8012B3F2 0001,800810C1 0002 +Cheat31_N=Bottles Revenge is a Beta mode from Banjo Tooie that the RWP team recently uncovered after an extraordinary amount of effort. Bottles the Spirit transforms into Bottles the Devil and posses enemies nearby and allows a second player hooked up to Pad 2 to play as that Posses character to try to foil Banjos Plans. As player one goes about its business, player two uses every enemy nearby to try to nab Banjo and take away some life. This mode is incredible, and you can control almost every enemy in the game: slot machines, flying creatures, uggers, zubbas...and this is just the beginning. (Congrats Rare Witch Project) +Cheat16="Play As",D0081085 0020,8012704C 00?? +Cheat16_O=$01 Banjo and Kazooie,$02 Snowball,$06 Bee,$07 Washing machine,$08 Stony,$0A Banjo,$0B Kazooie,$0C Submarine,$0D Mumbo,$0E Golden Goliath,$0F Detonator,$10 Truck,$12 T-rex baby,$13 T-rex daddy +Cheat16_N=To use this cheat, put the cheat on, then press L as you walk through a door to become that chosen character. Do not try to use the following character in Banjos house or anywhere as small or you will get stuck and wont be able to continue. Snowball Washing machine Submarine Golden Goliath Truck T-rex baby and T-rex daddy + +//---- + +[8C138BE0-95700E46-C:45] +Name=In-Fisherman Bass Hunter 64 (U) +Cheat0="Catch Bigger Fish",80111F06 0001 +Cheat1="Line Never Breaks",80111F05 0001 +Cheat2="All Lakes Unlocked",80111F00 0001 +Cheat3="Extra Cash",80111F0B 0001 +Cheat4="Easier to Catch Fish",80111F0E 0001 +Cheat5="No Penalties in Tounament",80111F08 0001 + +//---- + +[BCFACCAA-B814D8EF-C:45] +Name=Bassmasters 2000 (U) +Cheat0="Player 1 Max Score (Casting Game)",8107A412 FFFF +Cheat1="Player 2 Max Score (Casting Game)",8107A416 FFFF + +//---- + +[204489C1-1286CF2B-C:45] +Name=Batman Beyond - Return of the Joker (U) +Cheat0="Infinite\Infinite Health",802086F2 0064 +Cheat1="Infinite\Infinite Lives",802086F1 0063 +Cheat2="Infinite\Infinite Batarangs",802086FE 0063 +Cheat3="Infinite\Max Charge & Magnetic Nun Chaku",802086B9 0064 + +//---- + +[6AA4DDE7-E3E2F4E7-C:45] +Name=BattleTanx (U) +Cheat0="Have Storm Ravens Gang",80135773 0001 +Cheat1="Run Story",80135770 0001 +Cheat2="Start With All Weapons",80135765 0001 +Cheat3="Toads",80135776 0001 +Cheat4="Trippy",80135771 0001 +Cheat5="Unlimited Ammo",80135760 0001 +Cheat6="Frogs",80135775 0001 +Cheat7="Have All Levels",80135767 0001 +Cheat8="Hurl Mode",8013576B 0001 +Cheat9="Invincible",80135763 0001 +Cheat10="Invisible",8013576A 0001 +Cheat11="Unlimited Lives",80135772 0001 +Cheat12="Regenerated Allied Tanks Are Indestrucible In Campaign",8009FB2A 0001 +Cheat13="Multiplayer\Player 1\Infinite Ammo",802D8603 00FF +Cheat14="Multiplayer\Player 2\Infinite Ammo",802D9F2B 00FF +Cheat15="Multiplayer\Player 1\Tank Turret Always On (Use Right/Left C Button)",802DE7FB 0011,802DE7FF 0002 +Cheat16="Multiplayer\Player 2\Tank Turret Always On",802DEB43 0011,802DEB47 0002 +Cheat17="Multiplayer\Player 3\Tank Turret Always On",802DEE8B 0011,802DEE8F 0002 +Cheat18="Multiplayer\Player 4\Tank Turret Always On",802DF1D3 0011,802DF1D7 0002 +Cheat19="Multiplayer\Player 1\Always Have Radar",802D8195 0080 +Cheat20="Multiplayer\Player 2\Always Have Radar",802D9ABD 0080 +Cheat21="Multiplayer\Player 1\Always Has Cloaked On",802D818D 0001 +Cheat22="Multiplayer\Player 2\Always Has Cloaked On",802D9AB5 0001 +Cheat23="Multiplayer\Player 1\Your Goalith Tank On Tracks Always Has Radar",802D869D 0080 +Cheat24="Multiplayer\Player 2\Your Goalith Tank On Tracks Always Has Radar",802D9FC5 0080 +Cheat25="Multiplayer\Player 1\Your Goalith Tank On Tracks Always Has Cloaked On",802D8695 0001 +Cheat26="Multiplayer\Player 2\Your Goalith Tank On Tracks Always Has Cloaked On",802D9FBD 0001 +Cheat27="Multiplayer\Plater 1\One Hit And You Bite It",802D819F 0001 +Cheat28="MultiPlayer\Player 2\One Hit And You Bite It",802D9AC7 0001 +Cheat29="Area 51\Shock Wave Weapons",802D5A7D 00AF +Cheat30="Area 51\Mines Are Invisible",802D5ACB 00CC +Cheat31="Area 51\Mines Are Toxic Waste",802D5ACB 007C +Cheat32="Area 51\Turn Ammo Pickup Picture To Flamer Picture",802D5AAF 00AC +Cheat33="Area 51\Turn Nuke Into Toxic Waste Nuke",802D5A7B 007C +Cheat34="Multiplayer\Balltlelord Mode\Player 1\All Special Weapons & Infinite Ammo",50000E02 0000,811AD7EE FFFF +Cheat35="Multiplayer\Balltlelord Mode\Player 2\All Special Weapons & Infinite Ammo",50000E02 0000,811AE186 FFFF +Cheat36="Multiplayer\Balltlelord Mode\Player 3\All Special Weapons & Infinite Ammo",50000E02 0000,811AEB1E FFFF +Cheat37="Multiplayer\Balltlelord Mode\Player 4\All Special Weapons & Infinite Ammo",50000E02 0000,811AF4B6 FFFF +Cheat38="Multiplayer\Deathmatch, Frenzy & Convoy Modes\Player 1\All Special Weapons & Infinite Ammo",50000E02 0000,811AD322 FFFF +Cheat39="Multiplayer\Deathmatch, Frenzy & Convoy Modes\Player 2\All Special Weapons & Infinite Ammo",50000E02 0000,811ADCBA FFFF +Cheat40="Multiplayer\Deathmatch, Frenzy & Convoy Modes\Player 3\All Special Weapons & Infinite Ammo",50000E02 0000,811AE652 FFFF +Cheat41="Multiplayer\Deathmatch, Frenzy & Convoy Modes\Player 4\All Special Weapons & Infinite Ammo",50000E02 0000,811AEFEA FFFF +Cheat42="Multiplayer\Hold 'Em Mode\Player 1\All Special Weapons & Infinite Ammo",50000E02 0000,811AD7EE FFFF +Cheat43="Multiplayer\Hold 'Em Mode\Player 2\All Special Weapons & Infinite Ammo",50000E02 0000,811AE186 FFFF +Cheat44="Multiplayer\Hold 'Em Mode\Player 3\All Special Weapons & Infinite Ammo",50000E02 0000,811AEB1E FFFF +Cheat45="Multiplayer\Hold 'Em Mode\Player 4\All Special Weapons & Infinite Ammo",50000E02 0000,811AF4B6 FFFF +Cheat46="All Batteries Have Hellfire",800A34A2 0001 +Cheat47="All Batteries Have Bad Aim",800A1F7C 0001 +Cheat48="Buildings Implode Instead Of Explode, And Remain Afire",8009298E 0001 +Cheat49="Shoot Through Walls",8008E529 0001 +Cheat50="All Battletanx Are Invincible",8009843D 0001 +Cheat51="Can't Pick Up Queen Lords",8008A2F0 0001 +Cheat52="Auto Win All Queen Lord Levels",800A6745 0001 +Cheat53="Auto Lose All Queen Lord Levels",800A6746 0001 +Cheat54="Slow Battle Tanks",8009A56A 0001 +Cheat55="Buildings Fall Fast",80091BBC 0001 +Cheat56="Nuke Blast Leaves Air Yellow",800F3333 0001 +Cheat57="Nuke Blast Pink",8008055F 0001 +Cheat58="Laser Fire Invisible",800846ED 0001 +Cheat59="Full Control Of Tank In Bonus,Extra Side Player In Battlelord Multi!",800971EE 0001 +Cheat60="Multiplayer\Balltlelord Mode\Player 1\Infinite Secondary Weapons In Battlelord",802D8609 00FF,802D860B 00FF,802D860D 00FF,802D860F 00FF,802D8611 00FF,802D8615 00FF,802D8617 00FF,802D8619 00FF,802D861B 00FF,802D861D 00FF,802D861F 00FF,802D8621 00FF +Cheat61="Multiplayer\Balltlelord Mode\Player 2\Infinite Secondary Weapons In Battlelord",802D9F31 00FF,802D9F33 00FF,802D9F35 00FF,802D9F37 00FF,802D9F39 00FF,802D9F3D 00FF,802D9F3F 00FF,802D9F41 00FF,802D9F43 00FF,802D9F45 00FF,802D9F47 00FF,802D9F49 00FF +Cheat62="In Campaign 3 Enemy Tanks May Join You",802D9AAC 0000,802DB3D4 0000,802DCCFC 0000 +Cheat63="Multiplayer\Player 1\Main Weapon",802D85EB 00?? +Cheat64="Multiplayer\Player 2\Main Weapon",802D9F13 00?? +Cheat65="Multiplayer\Player 1\Secondary Weapon",802D85F7 00?? +Cheat66="Multiplayer\Player 2\Secondary Weapon",802D9F1F 00?? +Cheat67="Multiplayer\Player 1\Tank Body Modifier",802D819B 00?? +Cheat68="Multiplayer\Player 2\Tank Body Modifier",802D9AC3 00?? +Cheat69="Multiplayer\Player 1\Goalith Tank On Tracks Body Modifier",802D86A3 00?? +Cheat70="Multiplayer\Player 2\Goalith Tank On Tracks Body Modifier",802D9FCB 00?? +Cheat63_O=$00 Nothing,$01 Normal Tank Shells,$02 Motor Tank Shells,$03 Big Tank Shells,$04 Rockets,$05 Laser,$06 Nuke,$07 Gernades,$08 ?,$09 ?,$0A Nuclear Lasers,$0B Remote Rockets,$0C Mines,$0D Gun Buddies,$0E Smoke Screen,$0F Cloaking,$10 Health +Cheat64_O=$00 Nothing,$01 Normal Tank Shells,$02 Motor Tank Shells,$03 Big Tank Shells,$04 Rockets,$05 Laser,$06 Nuke,$07 Gernades,$08 ?,$09 ?,$0A Nuclear Lasers,$0B Remote Rockets,$0C Mines,$0D Gun Buddies,$0E Smoke Screen,$0F Cloaking,$10 Health +Cheat65_O=$00 Nothing,$01 Normal Tank Shells,$02 Motor Tank Shells,$03 Big Tank Shells,$04 Rockets,$05 Laser,$06 Nuke,$07 Gernades,$08 ?,$09 ?,$0A Nuclear Lasers,$0B Remote Rockets,$0C Mines,$0D Gun Buddies,$0E Smoke Screen,$0F Cloaking,$10 Health +Cheat66_O=$00 Nothing,$01 Normal Tank Shells,$02 Motor Tank Shells,$03 Big Tank Shells,$04 Rockets,$05 Laser,$06 Nuke,$07 Gernades,$08 ?,$09 ?,$0A Nuclear Lasers,$0B Remote Rockets,$0C Mines,$0D Gun Buddies,$0E Smoke Screen,$0F Cloaking,$10 Health +Cheat67_O=$00 Normal Tank,$01 Motor Tank,$02 Big Tank +Cheat68_O=$00 Normal Tank,$01 Motor Tank,$02 Big Tank +Cheat69_O=$00 Normal Tank,$01 Motor Tank,$02 Big Tank +Cheat70_O=$00 Normal Tank,$01 Motor Tank,$02 Big Tank + +//---- + +[75A4E247-6008963D-C:45] +Name=BattleTanx - Global Assault (U) +Cheat0="Rapid Fire",8008E7F0 0001 +Cheat1="Edge Hits Everything",80071AF0 0043 +Cheat2="Mini-Tanks 1",80125AB8 0001 +Cheat3="Mini-Tanks 2",80125AB9 0001 +Cheat4="Mini-Tanks 3",80125AB9 0001 +Cheat5="Mini-Tanks 4",80125ABB 0001 +Cheat6="Mini-Tanks 5",80125ABC 0001 +Cheat7="Infinite Tank Bucks",80236A9F 0064 +Cheat8="Level Select",80117F49 0001 +Cheat9="Invulnerability",80125AB0 0001 +Cheat10="Start With All Weapons",80125AB1 0001 +Cheat11="Secret Level",80125AB2 0001 +Cheat12="Enable Models",80125AB3 0001 +Cheat13="Cassandra Gang",80125AB5 0001 +Cheat14="Brandon Gang",80125AB6 0001 + +//---- + +[55D4C4CE-7753C78A-C:45] +Name=Battlezone - Rise of the Black Dogs (U) +Cheat0="Infinite\Weapons",811DF6EA 04B0 +Cheat1="Infinite\Ship Health",811DF6DE 0BA9 +Cheat2="Infinite\Shots For Sniper Rifle",811DA682 0003 +Cheat3="Have\All\Levels Unlocked & Completed For Americans",8006A1F0 0011 +Cheat4="Have\All\Levels Unlocked & Completed For Soviets",8006A1F1 0008 +Cheat5="Have\All\Levels Unlocked & Completed For Black Dogs",8006A1F3 000A +Cheat6="Have\All\Missions Open And Complete For Americans",8006A1EC 0011 +Cheat7="Have\All\Missions Open And Complete For Soviets",8006A1ED 0008 +Cheat8="Have\All\Missions Open And Complete For Black Dogs",8006A1EF 000A +Cheat9="Infinite\Scrap Collected",811FBCC6 FFFF +Cheat10="Max\Scrap Limit",811FBCCA FFFF +Cheat11="Infinite\Pilots",811FBCCE FFFF +Cheat12="Max\Pilot Limits",811FBCD2 FFFF +Cheat13="Infinite\Armor",8006A1C2 0001 +Cheat14="Infinite\Ammo",8006A1C1 0001 +Cheat15="Level Select",8006A1F5 0001 +Cheat16="Add\Building",8006A1C0 0001 +Cheat17="Add\Satellite",8006A1C3 0001 + +//---- + +[4D79D316-E8501B33-C:45] +Name=Beast Wars Transmetal (U) +Cheat0="Infinite\Health\Player 1",8112CD46 270F +Cheat1="Infinite\Stun Meter\Player 1",8012CD49 00FF +Cheat2="Infinite\Health\Player 2",8114D2C6 270F +Cheat3="Infinite\Stun Meter\Player 2",8014D2C9 00FF +Cheat4="Play As\Player 1",801BE2A4 00?? +Cheat4_O=$00 Optimus Primal,$01 Rattrap,$02 Cheetor,$03 Airazor,$04 Megatron,$05 Tarantulas,$06 Waspinator,$07 Terrorsaur +Cheat5="Play As\Player 2",801BE2A5 00?? +Cheat5_O=$00 Optimus Primal,$01 Rattrap,$02 Cheetor,$03 Airazor,$04 Megatron,$05 Tarantulas,$06 Waspinator,$07 Terrorsaur +Cheat6="Choose Stage\VS. Mode",800ED6CF 00?? +Cheat6_O=$00 Stage 1,$01 Stage 2,$02 Stage 3,$03 Stage 4,$04 Stage 5,$05 Stage 6,$06 Stage 7,$07 Stage 8 (Hidden Stage),$08 Stage 9 (Hidden Stage),$09 Stage A (Hidden Stage), +Cheat7="Infinite\Time",80102A94 000A +Cheat8="Bonus Menu Games\Infinite Time\Escape Race 100 & 200\Player 1",811BD3B6 000A +Cheat9="Bonus Menu Games\Infinite Time\Escape Race 100 & 200\Player 2",811BD3BA 000A +Cheat10="Bonus Menu Games\Max\Wins\Sunset & Sunrise Showdown\Player 1",801BC25F 00FF +Cheat11="Bonus Menu Games\Max\Points\Disc Hunter\Player 1",801BD3E9 00FF +Cheat12="Bonus Menu Games\Max\Points\Disc Hunter\Player 2",801BD3EB 00FF + +//---- + +[EDF419A8-BF1904CC-C:45] +Name=Beetle Adventure Racing! (U) +Cheat0="Have\All Cars",8002CFF7 000B +Cheat1="Have\All Tracks",8002CFF3 0006 +Cheat2="Low Timer",81025DD4 3F40 +Cheat3="Open All Difficulties",8002CFFB 0003 +Cheat4="Infinite Continues",8002CC57 0005 +Cheat5="Always Place 1st",81025DD4 1110,81025DDC 3F40 +Cheat6="Multi-Player Unlock All Levels",50000901 0000,8002D000 0001 + +//---- + +[08FFA4B7-01F453B6-C:45] +Name=Big Mountain 2000 (U) +Cheat0="Always 1st/Low Time",81350C02 0000,80350C17 0063 +Cheat1="Infinite Stamina",8034F798 0012 +Cheat2="Free Ride Complete\Stage 1-Skier",800B3578 0001 +Cheat3="Slalom Complete\Stage 1-Skier",800B357C 0001 +Cheat4="Giant Slalom Complete\Stage 1-Skier",800B3580 0001 +Cheat5="Free Ride Complete\Stage 2-Skier",800B3584 0001 +Cheat6="Slalom Complete\Stage 2-Skier",800B3588 0001 +Cheat7="Giant Slalom Complete\Stage 2-Skier",800B358C 0001 +Cheat8="Free Ride Complete\Stage 3-Skier",800B3590 0001 +Cheat9="Slalom Complete\Stage 3-Skier",800B3594 0001 +Cheat10="Giant Slalom Complete\Stage 3-Skier",800B3598 0001 +Cheat11="Free Ride Complete\Stage 4-Skier",800B359C 0001 +Cheat12="Slalom Complete\Stage 4-Skier",800B35A0 0001 +Cheat13="Giant Slalom Complete\Stage 4-Skier",800B35A4 0001 +Cheat14="Free Ride Complete\Stage 1-Boarder",800B357A 0001 +Cheat15="Slalom Complete\Stage 1-Boarder",800B357E 0001 +Cheat16="Giant Slalom Complete\Stage 1-Boarder",800B3582 0001 +Cheat17="Free Ride Complete\Stage 2-Boarder",800B3586 0001 +Cheat18="Slalom Complete\Stage 2-Boarder",800B358A 0001 +Cheat19="Giant Slalom Complete\Stage 2-Boarder",800B358E 0001 +Cheat20="Free Ride Complete\Stage 3-Boarder",800B3592 0001 +Cheat21="Slalom Complete\Stage 3-Boarder",800B3596 0001 +Cheat22="Giant Slalom Complete\Stage 3-Boarder",800B359A 0001 +Cheat23="Free Ride Complete\Stage 4-Boarder",800B359E 0001 +Cheat24="Slalom Complete\Stage 4-Boarder",800B35A2 0001 +Cheat25="Giant Slalom Complete\Stage 4-Boarder",800B35A6 0001 +Cheat26="All Boards Complete",50001802 0000,810B3578 0001 + +//---- + +[08123595-0510F1DE-C:45] +Name=Bio F.R.E.A.K.S. (U) +Cheat0="Never Wins\Player 1",8015029B 0000 +Cheat1="Needs 1 Match to Win\Player 1",D015029B 0000,8015029B 0001 +Cheat2="Infinite Health\Player 1",811502AA 6400 +Cheat3="1-Hit Death\Player 1",D01502AA 0064,811502AA 0100 +Cheat4="Infinite Shield\Player 1",811502AE 6400 +Cheat5="Infinite Jetpack\Player 1",811502B2 3200 +Cheat6="Play As\Player 1",801ABB2B 00?? +Cheat6_O=$0A She-Freak,$0B PainMaster,$0C Mutilator,$0D ChainSaw +Cheat7="Never Wins\Player 2",80152917 0000 +Cheat8="Needs 1 Match to Win\Player 2",D0152917 0000,80152917 0001 +Cheat9="Infinite Health\Player 2",811502AA 6400 +Cheat10="1-Hit Death\Player 2",D0152926 0064,81152926 0100 +Cheat11="Infinite Shield\Player 2",8115292A 6400 +Cheat12="Infinite Jetpack\Player 2",8115292E 3200 + +//---- + +[7C647C25-D9D901E6-C:45] +Name=Blast Corps (U) (V1.0) +Cheat0="Infinite\Hydraulics Sidesweeper",803EDB51 0063 +Cheat1="Infinite\Missiles Motor Bike",803F8AC3 0063 +Cheat2="Infinite\Boosts Buggy Vehicle",803EE301 0064 +Cheat3="Ballista Can Drive Through Anything",803F8A68 0001 +Cheat4="Found All\RDUS",8036E9CC C350 +Cheat5="Found All\Survivors",8036E9C9 00FF +Cheat6="Found All\Scientists",80364AD0 003F +Cheat7="Infinite Time",D0315610 0000,81315610 0000,D0315612 0001,81315612 0000 + +//---- + +[7C647E65-1948D305-C:45] +Name=Blast Corps (U) (V1.1) +Cheat0="Infinite\Hydraulics Sidesweeper",803EDC00 0063 +Cheat1="Infinite\Missiles Motor Bike",803F8B72 0063 +Cheat2="Infinite\Boosts Buggy Vehicle",803EE3B0 0064 +Cheat3="Ballista Can Drive Through Anything",803F8B17 0001 +Cheat4="Found All\RDUS",8036EA7C C350 +Cheat5="Found All\Survivors",8036EA70 00FF +Cheat6="Found All\Scientists",80364B80 003F +Cheat7="Infinite Time",D03156C0 0000,813156C0 0000,D03156C2 0001,813156C2 0000 + +//---- + +[7CD08B12-1153FF89-C:45] +Name=Blues Brothers 2000 (U) +Cheat0="Have All\Keys",800BD0B8 00FF,800BD0BE 00FF,800BD0BD 00FF +Cheat0_N=This will give you the Grey & Red,Green & Gold Keys +Cheat1="Have All\Music Notes",50000A01 0000,800BD1F0 0001 +Cheat1_N=This will give you all 10 Music Notes +Cheat2="Infinite\Lives",800BD0E3 0009 +Cheat3="Infinite\Health",800BD0F7 0002 +Cheat4="Press L to Levitate",D017DBC5 0020,810DAFD8 44CB +Cheat4_N=Press L to levitate & let go to come back down +Cheat5="Max Money",810BD0E6 03E7 +Cheat6="Can Walk When The Game Is Paused",810AB9B6 0001 + +//---- + +[5326696F-FE9A99C3-C:45] +Name=Body Harvest (U) +Cheat0="Infinite\Greece",81052B18 0098,81052B1A 967F +Cheat1="Infinite\Health",810DDCEC 0258 +Cheat2="No Humans Killed",8104816A 0000 +Cheat3="Have Alien Artifact",8004DC5F 0001 +Cheat4="Item Modifier",8004DC4F ???? +Cheat4_O=$0000 Nothing,$0002 Howitzer Shells,$0040 Crank,$0080 Windmill Cog,$0100 Heirglyph Map Piece,$0400 Hangar Key,$FFFF All Items +Cheat5="Weapon Select\1st Position",80048138 00?? +Cheat6="Weapon Select\2nd Position",80048139 00?? +Cheat7="Weapon Select\3rd Position",8004813A 00?? +Cheat8="Weapon Select\4th Position",8004813B 00?? +Cheat9="Weapon Select\5th Position",8004813C 00?? +Cheat10="Weapon Select\6th Position",8004813D 00?? +Cheat11="Weapon Select\7th Position",8004813E 00?? +Cheat12="Weapon Select\8th Position",8004813F 00?? +Cheat13="Infinite Ammo All Weapons",50001102 0000,81048146 8000 +Cheat14="Level Select",80047F93 00?? +Cheat15="Press L To Wall Over Water, Climb Hills",D00475D9 0020,8104DCD2 0808 +Cheat5_O=$00 Nothing,$01 Fuel,$02 Pistol,$03 Shotgun,$04 Rifle,$05 Machine Gun,$06 Rocket Launcher,$07 TNT,$08 Sun Shield,$09 Grenades,$0A Tri-Spinner,$0B Vehicle Weapon 1,$0C Vehicle Weapon 2,$0D Arme 2,$0E Waffe 2,$10 Fragcannon,$11 Lazer Missiles,$12 Resonator,$13 Plasma Bombs +Cheat6_O=$00 Nothing,$01 Fuel,$02 Pistol,$03 Shotgun,$04 Rifle,$05 Machine Gun,$06 Rocket Launcher,$07 TNT,$08 Sun Shield,$09 Grenades,$0A Tri-Spinner,$0B Vehicle Weapon 1,$0C Vehicle Weapon 2,$0D Arme 2,$0E Waffe 2,$10 Fragcannon,$11 Lazer Missiles,$12 Resonator,$13 Plasma Bombs +Cheat7_O=$00 Nothing,$01 Fuel,$02 Pistol,$03 Shotgun,$04 Rifle,$05 Machine Gun,$06 Rocket Launcher,$07 TNT,$08 Sun Shield,$09 Grenades,$0A Tri-Spinner,$0B Vehicle Weapon 1,$0C Vehicle Weapon 2,$0D Arme 2,$0E Waffe 2,$10 Fragcannon,$11 Lazer Missiles,$12 Resonator,$13 Plasma Bombs +Cheat8_O=$00 Nothing,$01 Fuel,$02 Pistol,$03 Shotgun,$04 Rifle,$05 Machine Gun,$06 Rocket Launcher,$07 TNT,$08 Sun Shield,$09 Grenades,$0A Tri-Spinner,$0B Vehicle Weapon 1,$0C Vehicle Weapon 2,$0D Arme 2,$0E Waffe 2,$10 Fragcannon,$11 Lazer Missiles,$12 Resonator,$13 Plasma Bombs +Cheat9_O=$00 Nothing,$01 Fuel,$02 Pistol,$03 Shotgun,$04 Rifle,$05 Machine Gun,$06 Rocket Launcher,$07 TNT,$08 Sun Shield,$09 Grenades,$0A Tri-Spinner,$0B Vehicle Weapon 1,$0C Vehicle Weapon 2,$0D Arme 2,$0E Waffe 2,$10 Fragcannon,$11 Lazer Missiles,$12 Resonator,$13 Plasma Bombs +Cheat10_O=$00 Nothing,$01 Fuel,$02 Pistol,$03 Shotgun,$04 Rifle,$05 Machine Gun,$06 Rocket Launcher,$07 TNT,$08 Sun Shield,$09 Grenades,$0A Tri-Spinner,$0B Vehicle Weapon 1,$0C Vehicle Weapon 2,$0D Arme 2,$0E Waffe 2,$10 Fragcannon,$11 Lazer Missiles,$12 Resonator,$13 Plasma Bombs +Cheat11_O=$00 Nothing,$01 Fuel,$02 Pistol,$03 Shotgun,$04 Rifle,$05 Machine Gun,$06 Rocket Launcher,$07 TNT,$08 Sun Shield,$09 Grenades,$0A Tri-Spinner,$0B Vehicle Weapon 1,$0C Vehicle Weapon 2,$0D Arme 2,$0E Waffe 2,$10 Fragcannon,$11 Lazer Missiles,$12 Resonator,$13 Plasma Bombs +Cheat12_O=$00 Nothing,$01 Fuel,$02 Pistol,$03 Shotgun,$04 Rifle,$05 Machine Gun,$06 Rocket Launcher,$07 TNT,$08 Sun Shield,$09 Grenades,$0A Tri-Spinner,$0B Vehicle Weapon 1,$0C Vehicle Weapon 2,$0D Arme 2,$0E Waffe 2,$10 Fragcannon,$11 Lazer Missiles,$12 Resonator,$13 Plasma Bombs +Cheat14_O=$01 Greece,$02 Java,$03 America,$04 Siberia,$05 Comet + +//---- + +[F568D51E-7E49BA1E-C:45] +Name=Bomberman 64 (U) +Cheat0="Invincible\Player 1",800AEE01 0001 +Cheat1="Have\Pumped up Red Remote Bombs",802AC653 0004 +Cheat2="Infinite\Lives",802AC627 0063 +Cheat3="Infinite\Gems",802AC62F 0063 +Cheat4="Infinite\Credits",802AC62B 0009 +Cheat5="Infinite\Time",802AC643 0001 +Cheat6="Carry 20 Bombs At A Time",800AEE0F 0014 +Cheat7="Infinite\Energy\Player 1",800AEE07 0002 +Cheat8="Infinite\Energy\Player 2",800AEECF 0002 +Cheat9="Infinite\Energy\Player 3",800AEF97 0002 +Cheat10="Infinite\Energy\Player 4",800AF05F 0002 + +//---- + +[237E73B4-D63B6B37-C:45] +Name=Bomberman 64 - The Second Attack! (U) +Cheat0="Infinite\Money",810ABD52 FFFF +Cheat1="Infinite\Bombs",800AD758 0003 +Cheat2="Have\Max Fire Level",800AD733 0003 +Cheat3="Infinite\Health",800AD75F 0005 +Cheat4="Infinite\Continue Time",810B5CD6 0090 +Cheat5="Have\Fire Bombs",800AD73B 0003 +Cheat6="Have\Kick Bombs Anytime",800AC743 0003 +Cheat7="Flashing Invincible",800AD767 000A +Cheat7_N=This cheat Makes you Flash But you cant be harmed,Once out of danger Turn the cheat off to stop the flashing.also do not put this on if you have already been hurt or you will stay on the floor. + +//---- + +[4446FDD6-E3788208-C:45] +Name=Bomberman Hero (U) +Cheat0="Full\Bomb Power",8016523F 0003 +Cheat1="Full\Fire Power",80165240 0003 +Cheat2="Infinite\Health",80165244 0004 +Cheat3="Infinite\Lives",80165243 0009 +Cheat4="Extra Gems",D0165241 0000,80165241 004B +Cheat5="Max\Bombs",8016523F 0008 +Cheat7="Max\Score",80177608 FFFF +Cheat8="Max\Explosion",80165240 0008 +Cheat6="Press L to Levitate",D005A455 0020,81154178 41CB,D005A455 0020,D0154154 0000,80154154 0040 +Cheat6_N=Press L to levitate & let go to come back down + +//---- + +[85AE781A-C756F05D-C:45] +Name=Buck Bumble (U) +Cheat0="Have All\Guns & Infinite Ammo",810FFF8A 0001,50000B04 0000,810E92E6 03E8 +Cheat0_N=Press C Left to receive all Guns +Cheat1="Infinite\Health",810E92D8 42D8 +Cheat1_N=If you fall into Water just turn off the Infinite Health & put back on after. +Cheat2="Infinite\99 Lives",810E9650 0005 +Cheat3="Have All\Keys",810E92E0 0101,800E92E2 0001 +Cheat4="Max Bonus",810E964A 270F +Cheat5="Level Select",810FFF92 00?? +Cheat5_O=$01 Mission 1 Shock Strike,$02 Mission 2 Radar Run,$03 Mission 3 Return Fire,$04 Mission 4 The Sonar Tower,$05 Mission 5 Big Blips,$06 Mission 6 Short Fuse,$07 Mission 7 Outpost,$08 Mission 8 Sewer,$09 Mission 9 Clean Up,$0A Mission 10 Scramble Pylon,$0B Mission 11 Herding Research,$0C Mission 12 The Extractor,$0D Mission 13 Nuke Tower,$0E Mission 14 Mucus Storage,$0F Mission 15 Depot Attack,$10 Boss Mission Destroy Carrier Level,$11 Mission 16 Sterilization,$12 Mission 17 Scorpion Killer,$13 Mission 18 Core Nuke,$14 Mission 19 Gate Keeper,$15 Queen Mission + +//---- + +[4222D89F-AFE0B637-C:45] +Name=Bust A Move '99 (U) +Cheat0="Ceiling Never Drops\Player 1",810ECDEE 0000 +Cheat1="Ceiling Never Drops\Player 2",810ECEDE 0000 +Cheat2="Ceiling Never Drops\Player 3",81158846 0000 +Cheat3="Ceiling Never Drops\Player 4",81158974 0000 +Cheat4="Infinite Time To Set Pieces\Player 1",810ECE2C 0000 +Cheat5="Infinite Time To Set Pieces\Player 2",810ECF1C 0000 +Cheat6="Infinite Time To Set Pieces\Player 3",81158884 0000 +Cheat7="Infinite Time To Set Pieces\Player 4",81158936 0000 +Cheat8="Always Gets Bubbles\Player 1",800ECE59 0007 +Cheat9="Never Gets Bubbles\Player 1",800ECE59 0000 +Cheat10="Always Gets Bubbles\Player 2",800ECF49 0007 +Cheat11="Never Gets Bubbles\Player 2",800ECF49 0000 +Cheat12="Always Gets Bubbles\Player 3",801588B1 0007 +Cheat13="Never Gets Bubbles\Player 3",801588B1 0000 +Cheat14="Always Gets Bubbles\Player 4",801589A1 0007 +Cheat15="Never Gets Bubbles\Player 4",801589A1 0000 + +//---- + +[8A86F073-CD45E54B-C:45] +Name=Bust-A-Move 2 - Arcade Edition (U) +Cheat0="Infinite Credits",80120171 0005 +Cheat1="Player 1\Always Gets Bubbles",80171131 0006 +Cheat2="Player 1\Never Gets Bubbles",80171131 0000 +Cheat3="Computer\Always Gets Bubbles",80173601 0006 +Cheat4="Computer\Never Gets Bubbles",80173601 0000 +Cheat5="Player 1\Infinite Time To Set Pieces",8117AAFC 0000 +Cheat6="Player 1\Screen Never Fills Over Time",80171125 000A + +//---- + +[AC16400E-CF5D071A-C:45] +Name=California Speed (U) +Cheat0="Always Place 1st",80151C01 0000 +Cheat1="Have All\Tracks",81168F8C FFFF +Cheat2="Have All\Cars",50001504 0000,800AAE5B 0001 + +//---- + +[F35D5F95-8AFE3D69-C:45] +Name=Castlevania (U) (V1.0) +Cheat0="Infinite\Health",81389C3E 0064 +Cheat1="Infinite\Throwing Weapon",81389C48 0064 +Cheat2="Throwing Weapon Modifier",81389C42 00?? +Cheat3="Press L To Levitate",D0387D7F 0020,81350810 3FCB +Cheat4="Have\All Items",50000501 0000,80389C4A 0001,50000301 0000,80389C51 0001,80389C5A 0001,80389C5B 0001,80389C5D 0001,50000E01 0000,80389C60 0001 +Cheat5="Have\Invincibility",80342BFE 000B +Cheat6="Infinite\Red Jewels",80389C49 0063 +Cheat7="Status",80389C88 00?? +Cheat7_O=$01 Good,$08 Vamp,$11 Poison,$22 Good but depressed,$66 Sto,$1F V+P +Cheat8="Open All Doors and Gates,No Bosses",50002A02 0000,81389BD0 FFFF +Cheat9="Infinite\Energy",80389C3F 0064 +Cheat10="Infinite\Funds",80389C45 0001,81389C46 869F +Cheat11="Have\Exp Points",80389C49 0063 +Cheat12="Max Power Up",80389CED 0002 +Cheat13="Never Get Poisoned",81389C88 0000 +Cheat2_O=$00 Nothing,$01 Knives,$02 Exploding Potions,$03 Cross,$04 Axes +Cheat14="Level Select",89389C90 ????,89389C92 0000 +Cheat14_O=$0000 Forest of Silence,$0002 Castle Wall,$0003 Villa,$0004 Inside Villa,$0006 Garden Maze,$0007 Tunnel,$0008 Underground Waterway,$0009 Castle Center,$0010 Tower of Execution,$0011 - Tower of Sorcery,$0012 - Tower of Science,$0013 - Duel Tower,$0014 - Fight With Death/Actrise,$0015 - Castle Keep,$0016 - Intro (Glitch),$0017 - Clock Tower,$0018 - Final Dracula,$001A - Fight With Maze Boss,$001B - Room of Clocks,$001C - ??,$001D - ?? +Cheat14_N=You must use this code on a saved game, because the intro to the first level will mess up the game. Now select the saved game, and hold down the GS button until the level loads. Some of the boss stages will not let you fight the boss unless you re-enter the area. Also, with the part of stage modifier, the second code modifies the part of the level that you are in, and 0000 is the level's start. +Cheat15="Switch From",80389C3D 00?? +Cheat15_O=$00 Carrie to Reindhart,$01 Reindhart to Carrie +Cheat15_N=This Switch From Cheat lets you switch characters on a saved game For example, if you are Reindhart and you want to be Carrie in the middle of your game save it and then enable this Cheat and press F1. when you start your saved game back up you'll be Carrie instead of Reindhart. + +//---- + +[4BCDFF47-AAA3AF8F-C:45] +Name=Castlevania (U) (V1.1) +Cheat0="Infinite\Health",81389C3E 0064 +Cheat1="Infinite\Throwing Weapon",81389C48 0064 +Cheat2="Throwing Weapon Modifier",81389C42 00?? +Cheat3="Press L To Levitate",D0387D7F 0020,81350810 3FCB +Cheat4="Have\All Items",50000501 0000,80389C4A 0001,50000301 0000,80389C51 0001,80389C5A 0001,80389C5B 0001,80389C5D 0001,50000E01 0000,80389C60 0001 +Cheat5="Have\Invincibility",80342BFE 000B +Cheat6="Infinite\Red Jewels",80389C49 0063 +Cheat7="Status",80389C88 00?? +Cheat7_O=$01 Good,$08 Vamp,$11 Poison,$22 Good but depressed,$66 Sto,$1F V+P +Cheat8="Open All Doors and Gates,No Bosses",50002A02 0000,81389BD0 FFFF +Cheat9="Infinite\Energy",80389C3F 0064 +Cheat10="Infinite\Funds",80389C45 0001,81389C46 869F +Cheat11="Have\Exp Points",80389C49 0063 +Cheat12="Max Power Up",80389CED 0002 +Cheat13="Never Get Poisoned",81389C88 0000 +Cheat2_O=$00 Nothing,$01 Knives,$02 Exploding Potions,$03 Cross,$04 Axes +Cheat14="Level Select",89389C90 ????,89389C92 0000 +Cheat14_O=$0000 Forest of Silence,$0002 Castle Wall,$0003 Villa,$0004 Inside Villa,$0006 Garden Maze,$0007 Tunnel,$0008 Underground Waterway,$0009 Castle Center,$0010 Tower of Execution,$0011 - Tower of Sorcery,$0012 - Tower of Science,$0013 - Duel Tower,$0014 - Fight With Death/Actrise,$0015 - Castle Keep,$0016 - Intro (Glitch),$0017 - Clock Tower,$0018 - Final Dracula,$001A - Fight With Maze Boss,$001B - Room of Clocks,$001C - ??,$001D - ?? +Cheat14_N=You must use this code on a saved game, because the intro to the first level will mess up the game. Now select the saved game, and hold down the GS button until the level loads. Some of the boss stages will not let you fight the boss unless you re-enter the area. Also, with the part of stage modifier, the second code modifies the part of the level that you are in, and 0000 is the level's start. +Cheat15="Switch From",80389C3D 00?? +Cheat15_O=$00 Carrie to Reindhart,$01 Reindhart to Carrie +Cheat15_N=This Switch From Cheat lets you switch characters on a saved game For example, if you are Reindhart and you want to be Carrie in the middle of your game save it and then enable this Cheat and press F1. when you start your saved game back up you'll be Carrie instead of Reindhart. + +//---- + +[1CC06338-87388926-C:45] +Name=Castlevania - Legacy of Darkness (U) +Cheat0="Infinite\Keys\Clocktower A",801CAB6F 000A +Cheat1="Infinite\Keys\Clocktower B",801CAB70 000A +Cheat2="Infinite\Keys\Storeroom",801CAB60 000A +Cheat3="Infinite\Keys\Garden",801CAB61 000A +Cheat4="Infinite\Keys\Copper",801CAB62 000A +Cheat5="Infinite\Keys\Chamber",801CAB63 000A +Cheat6="Infinite\Keys\Execution",801CAB64 000A +Cheat7="Infinite\Keys\Deck",801CAB65 000A +Cheat8="Infinite\Keys\Rose Garden",801CAB66 000A +Cheat9="Infinite\Keys\Thorn",801CAB67 000A +Cheat10="Infinite\Keys\Clocktower C",801CAB68 000A +Cheat11="Infinite\Keys\Clocktower D",801CAB69 000A +Cheat12="Infinite\Keys\Art Tower 1",801CAB6A 000A +Cheat13="Infinite\Keys\Art Tower 2",801CAB6B 000A +Cheat14="Infinite\Keys\Control Room",801CAB6C 000A +Cheat15="Infinite\Keys\Wall",801CAB6D 000A +Cheat16="Infinite\Keys\Clocktower E",801CAB6E 000A +Cheat17="Infinite\Keys\Archives",801CAB5E 000A +Cheat18="Infinite\Keys\Left Tower",801CAB5F 000A +Cheat19="Infinite\Health",811CAB3A 2710 +Cheat20="Infinite\Gold",811CAB42 2710 +Cheat21="Infinite\Specials\Special 1",801CAB47 000A +Cheat22="Infinite\Specials\Special 2",801CAB48 000A +Cheat23="Infinite\Specials\Special 3",801CAB49 000A +Cheat24="Infinite\Items\Roast Chicken",801CAB4A 000A +Cheat25="Infinite\Items\Roast Beef",801CAB4B 000A +Cheat26="Infinite\Items\Healing Kit",801CAB4C 000A +Cheat27="Infinite\Items\Purifying",801CAB4D 000A +Cheat28="Infinite\Items\Cure Ampoule",801CAB4E 000A +Cheat29="Infinite\Items\Powerup",801CAB4F 000A +Cheat30="Infinite\Items\The Contract",801CAB54 000A +Cheat31="Infinite\Items\Magical Nitro",801CAB55 000A +Cheat32="Infinite\Items\Mandragora",801CAB56 000A +Cheat33="Infinite\Items\Sun Card",801CAB57 000A +Cheat34="Infinite\Items\Moon Card",801CAB58 000A +Cheat35="Infinite\Items\Winch Lever",801CAB59 000A +Cheat36="Infinite\Items\Oldrey's Diary",801CAB5A 000A +Cheat37="Infinite\Items\Crest Half A",801CAB5B 000A +Cheat38="Infinite\Items\Crest Half B",801CAB5C 000A +Cheat39="Infinite\Items\Rose Brooch",801CAB5D 000A +Cheat40="Infinite\Items\Throwing Weapons",801CAB45 0064 +Cheat41="Infinite\Items\Red Jewels",801CAB45 0068 +Cheat42="Infinite\Bullets",801D3DA3 0006 +Cheat43="Wolfman Can Use Weapons",801CAB37 0002 +Cheat44="Wolfman Can't Use Weapons",801CAB37 0004 +Cheat45="Rapid Fire Gun (Henry-Hold B)",D11C87F6 0040,801D3DA3 0006 +Cheat46="Max Powerups",801CAE23 0002 +Cheat47="Stop Timer Input",811CAB22 0001 +Cheat48="Hard Mode Selected In A New Game",8032495F 0002 +Cheat49="Weapon Modifier",811CAB3E 00?? +Cheat50="Level Modifier",801CAE79 00?? +Cheat51="Inter-Level Modifier",801CAE7B 00?? +Cheat52="Cut Scene Modifier",801CAE93 0009,801CAE8B 00?? +Cheat54="Character Modifier",8031B22B 00?? +Cheat55="Status Modifier",801CAB84 00?? +Cheat56="Max Weapon Power-Up",801CAE27 0002 +Cheat57="Day Modifier For Adult Henry",801CAB1F 00?? +Cheat58="Infinite\Health Young Henry",D11C87F6 0010,813A5360 2800 +Cheat42_N=For Henry +Cheat43_N=For Cornell +Cheat44_N=For Cornell (Default) +Cheat45_N=For Henry, Hold B +Cheat48_N=With this code, you will not see the hard level status until you save and restart the game file. No special items are required to access this feature with this code turned on. +Cheat52_N=With this code, you must use the appropiate level mod before you attemp to run these cut scenes. Not doing so will ruin the cut scene as the graphics will be glitched. +Cheat49_O=$00 Nothing,$01 Knife,$02 Potion,$03 Cross,$04 Axe +Cheat50_O=$00 Forest Of Silence,$01 Left Tower,$02 Castle Wall,$03 Villa,$04 Villa,$05 Villa,$06 Villa,$1A Villa,$07 Tunnel,$08 Underground Waterway,$09 Castle Center,$0A Castle Center,$0B Castle Center,$0C Castle Center,$0D Castle Center,$0E Castle Center,$0F Castle Center,$10 Foggy Lake,$11 Foggy Lake,$12 Foggy Lake,$13 Cave Of Spiderwomen,$14 Castle Keep,$15 Castle Keep,$16 Falls Into Space(?),$17 Clock Tower,$18 Final Battle Site,$19 Castle Center,$1B Room Of Clocks,$1C Countryside Where Carrie's Mom Is Buried.(Fall Through Ground),$2B Countryside Where Carrie's Mom Is Buried.(Fall Through Ground),$1D Tower Of Sorcery,$1E Tower Of Execution,$1F Tower Of Execution,$20 Tower Of Execution,$21 Tower Of Science,$22 Tower Of Science,$23 Tower Of Ruins,$24 Tower Of Ruins,$25 Art Tower,$26 Art Tower,$27 Dual Tower,$28 Clock Tower,$29 Clock Tower,$2A Outer Wall,$2C Fall From Sky Ouside Of Castlevania Opening,$2D Another Free Fall. Forest Where Girl Runs In Opening,$2E Black Room(?) +Cheat51_O=$00 Forest Of Silence,$01 Left Tower,$02 Castle Wall,$03 Villa,$04 Villa,$05 Villa,$06 Villa,$1A Villa,$07 Tunnel,$08 Underground Waterway,$09 Castle Center,$0A Castle Center,$0B Castle Center,$0C Castle Center,$0D Castle Center,$0E Castle Center,$0F Castle Center,$10 Foggy Lake,$11 Foggy Lake,$12 Foggy Lake,$13 Cave Of Spiderwomen,$14 Castle Keep,$15 Castle Keep,$16 Falls Into Space(?),$17 Clock Tower,$18 Final Battle Site,$19 Castle Center,$1B Room Of Clocks,$1C Countryside Where Carrie's Mom Is Buried.(Fall Through Ground),$2B Countryside Where Carrie's Mom Is Buried.(Fall Through Ground),$1D Tower Of Sorcery,$1E Tower Of Execution,$1F Tower Of Execution,$20 Tower Of Execution,$21 Tower Of Science,$22 Tower Of Science,$23 Tower Of Ruins,$24 Tower Of Ruins,$25 Art Tower,$26 Art Tower,$27 Dual Tower,$28 Clock Tower,$29 Clock Tower,$2A Outer Wall,$2C Fall From Sky Ouside Of Castlevania Opening,$2D Another Free Fall. Forest Where Girl Runs In Opening,$2E Black Room(?) +Cheat52_O=$03 Castle Drawbridge Lowers,$04 Character Enters Castle,$05 (?),$0A (?),$0C (?),$20 (?),$21 (?),$22 (?),$06 Vampire In Main Entrance Hall Of Villa,$07 One Of The Working Gears Cut Scenes,$08 "I Smell Poison" From Underground Waterway,$09 Castle Gate Closes In Villa Upon Entering Villa,$0B Renon Appears For First Time,$0D Village Vampire In Upstairs Villa,$0E Malus Appears For The First Time,$0F Malus Leaves Garden,$10 Character In Boat On Foggy Lake,$11 Seal Removed From Wall In Arena,$12 Bleeding Statue,$13 Cosmic Lights,$14 Explosion At Wall In Arena,$15 Explosion At Wall In Castle That Leads To Hidden Room,$16 Malus Appears Again In Upstairs Room Of Castle,$17 Bull Awakens,$18 Vincent The Vampire,$19 One Of The Working Gears Cut Scenes,$1A Gate Opens In Forest Of Silence,$1B Meet Renon For The Last Time In Castle Keep.,$1C This Cut Scene Runs Cut Scene 27 And 2E,$1E Castle Keep Destructs,$1F Malus On Flying Horse Outside Castle Keep,$24 Spider People In Tunnel,$25 Rosa In Garden,$27 Castel Destruction,$28 Space Warp,$29 Castle Destruction,$2A Malus Is Saved By Reinhardt,$2B Malus And Reinhardt On Horse,$2E Rosa Returns,$30 Ada, Henry And Cornell At Game End,$31 Scrolling Text About Castle And Henry,$33 Vampire In Basement,$34 Vampire In Villa Basement Destroyed, Woman Vampire Rises,$35 Finds Hidden Path In Villa Basement,$37 Lever & Gear In Castle,$38 Harpie,$39 Harpie Destroyed,$44 Death(Grim Reaper),$45 Death Is Destroyed,$46 Castle Drawbridge Closes And Ortega Appears,$47 Thirsty Man,$48 Cornell Meets Henry In Garden,$49 Cornell And Henry Part In Garden,$51 Monster Dracula Appears,$52 Actrise Appears In Castle Center,$54 Actrise Appears Again With Cousin Fernandes Before Fight With Carrie,$55 Cousin Fernandes Is Destroyed,$56 Actrise Appears Again Before Fight With Carrie,$57 Actrise Defeated By Carrie +Cheat54_O=$00 Cornell,$01 Reinhardt,$02 Carrie,$03 Henry +Cheat55_O=$00 Never Get Poisoned or Vamped,$01 Normal,$04 Vamp,$08 Poison,$0C Vamped & Poisoned,$FF Instant Death +Cheat57_O=$00 7 Days,$01 6 Days,$02 5 Days,$03 4 Days,$04 3 Days,$05 2 Days,$06 1 Day,$07 0 Days +Cheat53="Enable Characters All Charactors",8031B243 0004 + +//---- + +[6420535A-50028062-C:45] +Name=Chameleon Twist (U) +Cheat0="Access All Levels",8020850E 00FF,80208510 00FF +Cheat1="Extra Crowns",80251767 0015 +Cheat2="Infinite Health",80174CF3 000A +Cheat3="Extended Tongue",8133176E FFFF +Cheat4="Level Select",8029087B 00?? +Cheat4_O=$00 Stage 1,$01 Stage 2,$02 Stage 3,$03 Stage 4,$04 Stage 5,$05 Stage 6,$06 Stage 7 + +//---- + +[CD538CE4-618AFCF9-C:45] +Name=Chameleon Twist 2 (U) +Cheat0="Infinite Health",8018BA7D 000F +Cheat1="Max Collectable Items",80164501 0014 +Cheat2="Have 6 Carrots",80164519 007E +Cheat3="Have All\Levels",80164508 003F +Cheat4="Have All\Costumes",8016451A 00FE +Cheat5="Have All\Collectibles\Stage 1",80164510 0014 +Cheat6="Have All\Collectibles\Stage 2",80164511 0014 +Cheat7="Have All\Collectibles\Stage 3",80164512 0014 +Cheat8="Have All\Collectibles\Stage 4",80164513 0014 +Cheat9="Have All\Collectibles\Stage 5",80164514 0014 +Cheat10="Have All\Collectibles\Stage 6",80164515 0014 +Cheat11="Press L To levitate",D018BAB5 0020,8118B9E0 4200 +Cheat11_N=Press L To Levitate & Let go to land + +//---- + +[1E0E96E8-4E28826B-C:45] +Name=Charlie Blast's Territory (U) +Cheat0="Stop Timer From Counting Down (All Levels)",8101D4FC 2400 + +//---- + +[214CAD94-BE1A3B24-C:45] +Name=Chopper Attack (U) +Cheat0="Max Score",81129426 FFFF +Cheat1="Infinite Weapon\1st Position",8012943B 0063 +Cheat2="Infinite Weapon\2nd Position",8012943F 0063 +Cheat3="Infinite Weapon\3rd Position",80129443 0063 +Cheat4="Infinite Weapon\4th Position",80129447 0063 +Cheat5="Infinite Weapon\5th Position",8012944B 0063 +Cheat6="Weapon Modifier\Gun Weapon",80129723 00?? +Cheat7="Gun 4-Way Shot",80129723 0004 +Cheat8="Infinite Fuel",81129726 FFFF +Cheat9="Infinite Shield",811296C8 03E8 +Cheat10="Opens All 5 Item Slots",8012945B 0005 +Cheat11="Weapon Modifier\1st Position",80129439 00?? +Cheat12="Weapon Modifier\2nd Position",8012943D 00?? +Cheat13="Weapon Modifier\3rd Position",801294F1 00?? +Cheat14="Weapon Modifier\4th Position",801294F5 00?? +Cheat15="Weapon Modifier\5th Position",801294F9 00?? +Cheat16="Score Attack Mode",81129472 0001 +Cheat17="Stage Select On",81129476 0001 +Cheat18="Option On",8112947A 0001 +Cheat19="Clear Mission Selector",8112947C 00?? +Cheat20="Texture Mode",81129484 0001 +Cheat6_O=$00 No Weapon,$01 Normal Shot,$02 2-Way Shot,$03 3-Way Shot,$04 4-Way Shot +Cheat11_O=$00 Nothing,$01 AGM,$02 AAM,$03 AGAM,$04 Dummy,$05 Rocket,$06 Cluster,$07 H-Cluster,$08 H-Plasma +Cheat12_O=$00 Nothing,$01 AGM,$02 AAM,$03 AGAM,$04 Dummy,$05 Rocket,$06 Cluster,$07 H-Cluster,$08 H-Plasma +Cheat13_O=$00 Nothing,$01 AGM,$02 AAM,$03 AGAM,$04 Dummy,$05 Rocket,$06 Cluster,$07 H-Cluster,$08 H-Plasma +Cheat14_O=$00 Nothing,$01 AGM,$02 AAM,$03 AGAM,$04 Dummy,$05 Rocket,$06 Cluster,$07 H-Cluster,$08 H-Plasma +Cheat15_O=$00 Nothing,$01 AGM,$02 AAM,$03 AGAM,$04 Dummy,$05 Rocket,$06 Cluster,$07 H-Cluster,$08 H-Plasma +Cheat19_O=$01 1,$02 2,$03 3,$04 4,$05 5,$06 6,$07 7,$08 8 +Cheat11_N=Must to be used with the Infinite Weapon Codes & the open all 5 item slot code. +Cheat12_N=Must to be used with the Infinite Weapon Codes & the open all 5 item slot code. +Cheat13_N=Must to be used with the Infinite Weapon Codes & the open all 5 item slot code. +Cheat14_N=Must to be used with the Infinite Weapon Codes & the open all 5 item slot code. +Cheat15_N=Must to be used with the Infinite Weapon Codes & the open all 5 item slot code. + +//---- + +[F03C24CA-C5237BCC-C:45] +Name=Clay Fighter 63 1-3 (U) +Cheat0="Extra Characters/Secret Options",801A2B41 000F +Cheat1="Stage Modifier",801A2B2B 00?? +Cheat2="Infinite Time To Choose Your Fighter",81200BEC 03A7 +Cheat3="Player 1 Character Modifier",801A2B2F 00?? +Cheat4="Refuse Room, Grotto Gulch, Santa's Worshop\Player 1\Cant be Stunned",801F1B0B 0000 +Cheat5="Refuse Room, Grotto Gulch, Santa's Worshop\Player 1\Infinite Energy",801F1B13 00AA +Cheat6="Refuse Room, Grotto Gulch, Santa's Worshop\Player 1\No Energy",801F1B13 0000 +Cheat7="Refuse Room, Grotto Gulch, Santa's Worshop\Player 1\Full Super Bar",811F1B1A 0200 +Cheat8="Refuse Room, Grotto Gulch, Santa's Worshop\Player 2\Cant be Stunned",801F4FAB 0000 +Cheat9="Refuse Room, Grotto Gulch, Santa's Worshop\Player 2\Infinite Energy",801F4FB3 00AA +Cheat10="Refuse Room, Grotto Gulch, Santa's Worshop\Player 2\No Energy",801F4FB3 0000 +Cheat11="Refuse Room, Grotto Gulch, Santa's Worshop\Player 2\Full Super Bar",811F4FBA 0200 +Cheat12="Tribal Tower\Player 1\Cant be Stunned",801F1BAB 0000 +Cheat13="Tribal Tower\Player 1\Infinite Energy",801F1BB3 00AA +Cheat14="Tribal Tower\Player 1\No Energy",801F1BB3 0000 +Cheat15="Tribal Tower\Player 1\Full Super Bar",811F1BBA 0200 +Cheat16="Tribal Tower\Player 2\Cant be Stunned",801F504B 0000 +Cheat17="Tribal Tower\Player 2\Infinite Energy",801F5053 00AA +Cheat18="Tribal Tower\Player 2\No Energy",801F5053 0000 +Cheat19="Tribal Tower\Player 2\Full Super Bar",811F505A 0200 +Cheat20="Aquadome\Player 1\Cant be Stunned",801F1E3B 0000 +Cheat21="Aquadome\Player 1\Infinite Energy",801F1E33 00AA +Cheat22="Aquadome\Player 1\No Energy",801F1E33 0000 +Cheat23="Aquadome\Player 1\Full Super Bar",811F1E3A 0200 +Cheat24="Aquadome\Player 2\Cant be Stunned",801F52CB 0000 +Cheat25="Aquadome\Player 2\Infinite Energy",801F52D3 00AA +Cheat26="Aquadome\Player 2\No Energy",801F52D3 0000 +Cheat27="Aquadome\Player 2\Full Super Bar",811F52DA 0200 +Cheat28="Outhouse,Claynaveral Hangar,Camp Claynaveral\Player 1\Cant be Stunned",801F233B 0000 +Cheat29="Outhouse,Claynaveral Hangar,Camp Claynaveral\Player 1\Infinite Energy",801F2343 00AA +Cheat30="Outhouse,Claynaveral Hangar,Camp Claynaveral\Player 1\No Energy",801F2343 0000 +Cheat31="Outhouse,Claynaveral Hangar,Camp Claynaveral\Player 1\Full Super Bar",811F234A 0200 +Cheat32="Outhouse,Claynaveral Hangar,Camp Claynaveral\Player 2\Cant be Stunned",801F57DB 0000 +Cheat33="Outhouse,Claynaveral Hangar,Camp Claynaveral\Player 2\Infinite Energy",801F57E3 00AA +Cheat34="Outhouse,Claynaveral Hangar,Camp Claynaveral\Player 2\No Energy",801F57E3 0000 +Cheat35="Outhouse,Claynaveral Hangar,Camp Claynaveral\Player 2\Full Super Bar",811F57EA 0200 +Cheat36="Freezing Fortress\Player 1\Cant be Stunned",801F239B 0000 +Cheat37="Freezing Fortress\Player 1\Infinite Energy",801F23A3 00AA +Cheat38="Freezing Fortress\Player 1\No Energy",801F23A3 0000 +Cheat39="Freezing Fortress\Player 1\Full Super Bar",811F23AA 0200 +Cheat40="Freezing Fortress\Player 2\Cant be Stunned",801F583B 0000 +Cheat41="Freezing Fortress\Player 2\Infinite Energy",801F5843 00AA +Cheat42="Freezing Fortress\Player 2\No Energy",801F5843 0000 +Cheat43="Freezing Fortress\Player 2\Full Super Bar",811F584A 0200 +Cheat44="Rubbage Reef\Player 1\Cant be Stunned",801F241B 0000 +Cheat45="Rubbage Reef\Player 1\Infinite Energy",801F2423 00AA +Cheat46="Rubbage Reef\Player 1\No Energy",801F2423 0000 +Cheat47="Rubbage Reef\Player 1\Full Super Bar",811F242A 0200 +Cheat48="Rubbage Reef\Player 2\Cant be Stunned",801F58BB 0000 +Cheat49="Rubbage Reef\Player 2\Infinite Energy",801F58C3 00AA +Cheat50="Rubbage Reef\Player 2\No Energy",801F58C3 0000 +Cheat51="Rubbage Reef\Player 2\Full Super Bar",811F58CA 0200 +Cheat52="Happy Harry's Hut, Spooky Spire, Mudville Mansion\Player 1\Cant be Stunned",801F244B 0000 +Cheat53="Happy Harry's Hut, Spooky Spire, Mudville Mansion\Player 1\Infinite Energy",801F2453 00AA +Cheat54="Happy Harry's Hut, Spooky Spire, Mudville Mansion\Player 1\No Energy",801F2453 0000 +Cheat55="Happy Harry's Hut, Spooky Spire, Mudville Mansion\Player 1\Full Super Bar",811F245A 0200 +Cheat56="Happy Harry's Hut, Spooky Spire, Mudville Mansion\Player 2\Cant be Stunned",801F58EB 0000 +Cheat57="Happy Harry's Hut, Spooky Spire, Mudville Mansion\Player 2\Infinite Energy",801F58F3 00AA +Cheat58="Happy Harry's Hut, Spooky Spire, Mudville Mansion\Player 2\No Energy",801F58F3 0000 +Cheat59="Happy Harry's Hut, Spooky Spire, Mudville Mansion\Player 2\Full Super Bar",811F58FA 0200 +Cheat60="Clayribbean Cruise\Player 1\Cant be Stunned",801F24FB 0000 +Cheat61="Clayribbean Cruise\Player 1\Infinite Energy",801F2503 00AA +Cheat62="Clayribbean Cruise\Player 1\No Energy",801F2503 0000 +Cheat63="Clayribbean Cruise\Player 1\Full Super Bar",811F250A 0200 +Cheat64="Clayribbean Cruise\Player 2\Cant be Stunned",801F599B 0000 +Cheat65="Clayribbean Cruise\Player 2\Infinite Energy",801F59A3 00AA +Cheat66="Clayribbean Cruise\Player 2\No Energy",801F59A3 0000 +Cheat67="Clayribbean Cruise\Player 2\Full Super Bar",811F59AA 0200 +Cheat68="Backwash Bay\Player 1\Cant be Stunned",801F258B 0000 +Cheat69="Backwash Bay\Player 1\Infinite Energy",801F2593 00AA +Cheat70="Backwash Bay\Player 1\No Energy",801F2593 0000 +Cheat71="Backwash Bay\Player 1\Full Super Bar",811F259A 0200 +Cheat72="Backwash Bay\Player 2\Cant be Stunned",801F5A2B 0000 +Cheat73="Backwash Bay\Player 2\Infinite Energy",801F5A33 00AA +Cheat74="Backwash Bay\Player 2\No Energy",801F5A33 0000 +Cheat75="Backwash Bay\Player 2\Full Super Bar",811F5A3A 0200 +Cheat76="Ghastly Graveyard\Player 1\Cant be Stunned",801F262B 0000 +Cheat77="Ghastly Graveyard\Player 1\Infinite Energy",801F2633 00AA +Cheat78="Ghastly Graveyard\Player 1\No Energy",801F2633 0000 +Cheat79="Ghastly Graveyard\Player 1\Full Super Bar",811F263A 0200 +Cheat80="Ghastly Graveyard\Player 2\Cant be Stunned",801F5ACB 0000 +Cheat81="Ghastly Graveyard\Player 2\Infinite Energy",801F5AD3 00AA +Cheat82="Ghastly Graveyard\Player 2\No Energy",801F5AD3 0000 +Cheat83="Ghastly Graveyard\Player 2\Full Super Bar",811F5ADA 0200 +Cheat84="Candy Factory\Player 1\Cant be Stunned",801F270B 0000 +Cheat85="Candy Factory\Player 1\Infinite Energy",801F2713 00AA +Cheat86="Candy Factory\Player 1\No Energy",801F2713 0000 +Cheat87="Candy Factory\Player 1\Full Super Bar",811F271A 0200 +Cheat88="Candy Factory\Player 2\Cant be Stunned",801F5BAB 0000 +Cheat89="Candy Factory\Player 2\Infinite Energy",801F5BB3 00AA +Cheat90="Candy Factory\Player 2\No Energy",801F5BB3 0000 +Cheat91="Candy Factory\Player 2\Full Super Bar",811F5BBA 0200 +Cheat92="Kooky Courtyard\Player 1\Cant be Stunned",801F280B 0000 +Cheat93="Kooky Courtyard\Player 1\Infinite Energy",801F2813 00AA +Cheat94="Kooky Courtyard\Player 1\No Energy",801F2813 0000 +Cheat95="Kooky Courtyard\Player 1\Full Super Bar",811F281A 0200 +Cheat96="Kooky Courtyard\Player 2\Cant be Stunned",801F5CAB 0000 +Cheat97="Kooky Courtyard\Player 2\Infinite Energy",801F5CB3 00AA +Cheat98="Kooky Courtyard\Player 2\No Energy",801F5CB3 0000 +Cheat99="Kooky Courtyard\Player 2\Full Super Bar",811F5CBA 0200 +Cheat100="Santa's Toy Factory\Player 1\Cant be Stunned",801F2C3B 0000 +Cheat101="Santa's Toy Factory\Player 1\Infinite Energy",801F2C43 00AA +Cheat102="Santa's Toy Factory\Player 1\No Energy",801F2C43 0000 +Cheat103="Santa's Toy Factory\Player 1\Full Super Bar",811F2C4A 0200 +Cheat104="Santa's Toy Factory\Player 2\Cant be Stunned",801F60DB 0000 +Cheat105="Santa's Toy Factory\Player 2\Infinite Energy",801F60E3 00AA +Cheat106="Santa's Toy Factory\Player 2\No Energy",801F60E3 0000 +Cheat107="Santa's Toy Factory\Player 2\Full Super Bar",811F60EA 0200 +Cheat108="Boogerhenge, Tureen Toilet\Player 1\Cant be Stunned",801F2FDB 0000 +Cheat109="Boogerhenge, Tureen Toilet\Player 1\Infinite Energy",801F2FE3 00AA +Cheat110="Boogerhenge, Tureen Toilet\Player 1\No Energy",801F2FE3 0000 +Cheat111="Boogerhenge, Tureen Toilet\Player 1\Full Super Bar",811F2FEA 0200 +Cheat112="Boogerhenge, Tureen Toilet\Player 2\Cant be Stunned",801F647B 0000 +Cheat113="Boogerhenge, Tureen Toilet\Player 2\Infinite Energy",801F6483 00AA +Cheat114="Boogerhenge, Tureen Toilet\Player 2\No Energy",801F6483 0000 +Cheat115="Boogerhenge, Tureen Toilet\Player 2\Full Super Bar",811F648A 0200 +Cheat116="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room\Player 1\Cant be Stunned",801F3BBB 0000 +Cheat117="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room\Player 1\Infinite Energy",801F3BC3 00AA +Cheat118="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room\Player 1\No Energy",801F3BC3 0000 +Cheat119="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room\Player 1\Full Super Bar",811F3BCA 0200 +Cheat120="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room\Player 2\Cant be Stunned",801F705B 0000 +Cheat121="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room\Player 2\Infinite Energy",801F7063 00AA +Cheat122="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room\Player 2\No Energy",801F7063 0000 +Cheat123="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room\Player 2\Full Super Bar",811F706A 0200 +Cheat124="Rubbage Room\Player 1\Cant be Stunned",801F464B 0000 +Cheat125="Rubbage Room\Player 1\Infinite Energy",801F4653 00AA +Cheat126="Rubbage Room\Player 1\No Energy",801F4653 0000 +Cheat127="Rubbage Room\Player 1\Full Super Bar",811F465A 0200 +Cheat128="Rubbage Room\Player 2\Cant be Stunned",801F7AEB 0000 +Cheat129="Rubbage Room\Player 2\Infinite Energy",801F7AF3 00AA +Cheat130="Rubbage Room\Player 2\No Energy",801F7AF3 0000 +Cheat131="Rubbage Room\Player 2\Full Super Bar",811F7AFA 0200 +Cheat1_O=$00 Candy Factory,$01 Claynaveral Hangar,$02 Camp Claynaveral,$03 Outhouse,$04 Mudville Mansion,$05 Ghastly Graveyard,$06 Spooky Spire,$07 Happy Harry's Hut,$08 Freezing Fortress,$09 Refuse Room,$0A Grotto Gulch,$0B Rubbage Room,$0C Rubbage Reef,$0D Kiln's Laboratory,$0E Kiln's Hideout,$0F Fiery Furnace,$10 Research Room,$11 Clayribbean Cruise,$12 Santa's Workship,$13 Kooky Courtyard,$14 Santa's Toy Factory,$15 Boogerhenge,$16 Backwash Bay,$17 Tureen Toilet,$18 Tribal Tower,$19 Aquadome +Cheat3_O=$01 Blob,$02 Bonker,$03 Boogerman,$04 Dr. Kiln,$05 Earthworm Jim,$08 Houngan,$09 Icky Bod Clay,$0A Kung Pow,$0D Sumo Santa,$0E Taffy,$0F T-Hoppy + +//---- + +[FA5A3DFF-B4C9CDB9-C:45] +Name=Clay Fighter - Sculptor's Cut (U) +Cheat0="Santa's Workshop, Refuse Room, Grotto Gulch\Player 1\Cant be Stunned",801939FF 0000 +Cheat1="Santa's Workshop, Refuse Room, Grotto Gulch\Player 1\Infinite Health",80193A07 00AA +Cheat2="Santa's Workshop, Refuse Room, Grotto Gulch\Player 1\No Health",80193A07 0000 +Cheat3="Santa's Workshop, Refuse Room, Grotto Gulch\Player 1\Full Super Bar",81193A0E 0200 +Cheat4="Santa's Workshop, Refuse Room, Grotto Gulch\Player 2\Cant be Stunned",80196EEF 0000 +Cheat5="Santa's Workshop, Refuse Room, Grotto Gulch\Player 2\Infinite Health",80196EF7 00AA +Cheat6="Santa's Workshop, Refuse Room, Grotto Gulch\Player 2\No Health",80196EF7 0000 +Cheat7="Santa's Workshop, Refuse Room, Grotto Gulch\Player 2\Full Super Bar",81196EFE 0200 +Cheat8="Tribal Tower\Player 1\Cant be Stunned",80193A9F 0000 +Cheat9="Tribal Tower\Player 1\Infinite Health",80193AA7 00AA +Cheat10="Tribal Tower\Player 1\No Health",80193AA7 0000 +Cheat11="Tribal Tower\Player 1\Full Super Bar",81193AAE 0200 +Cheat12="Tribal Tower\Player 2\Cant be Stunned",80196F8F 0000 +Cheat13="Tribal Tower\Player 2\Infinite Health",80196F97 00AA +Cheat14="Tribal Tower\Player 2\No Health",80196F97 0000 +Cheat15="Tribal Tower\Player 2\Full Super Bar",81196F9E 0200 +Cheat16="Aquadome\Player 1\Cant be Stunned",80193D1F 0000 +Cheat17="Aquadome\Player 1\Infinite Health",80193D27 00AA +Cheat18="Aquadome\Player 1\No Health",80193D27 0000 +Cheat19="Aquadome\Player 1\Full Super Bar",81193D2E 0200 +Cheat20="Aquadome\Player 2\Cant be Stunned",8019720F 0000 +Cheat21="Aquadome\Player 2\Infinite Health",80197217 00AA +Cheat22="Aquadome\Player 2\No Health",80197217 0000 +Cheat23="Aquadome\Player 2\Full Super Bar",8119721E 0200 +Cheat24="Clayribbean Cruise\Player 1\Cant be Stunned",80193F3F 0000 +Cheat25="Clayribbean Cruise\Player 1\Infinite Health",80193F47 00AA +Cheat26="Clayribbean Cruise\Player 1\No Health",80193F47 0000 +Cheat27="Clayribbean Cruise\Player 1\Full Super Bar",81193F4E 0200 +Cheat28="Clayribbean Cruise\Player 2\Cant be Stunned",8019742F 0000 +Cheat29="Clayribbean Cruise\Player 2\Infinite Health",80197437 00AA +Cheat30="Clayribbean Cruise\Player 2\No Health",80197437 0000 +Cheat31="Clayribbean Cruise\Player 2\Full Super Bar",8119743E 0200 +Cheat32="Camp Claynaveral, ClayNaveral Hangar, OutHouse\Player 1\Cant be Stunned",8019422F 0000 +Cheat33="Camp Claynaveral, ClayNaveral Hangar, OutHouse\Player 1\Infinite Health",80194237 00AA +Cheat34="Camp Claynaveral, ClayNaveral Hangar, OutHouse\Player 1\No Health",80194237 0000 +Cheat35="Camp Claynaveral, ClayNaveral Hangar, OutHouse\Player 1\Full Super Bar",8119423E 0200 +Cheat36="Camp Claynaveral, ClayNaveral Hangar, OutHouse\Player 2\Cant be Stunned",8019771F 0000 +Cheat37="Camp Claynaveral, ClayNaveral Hangar, OutHouse\Player 2\Infinite Health",80197727 00AA +Cheat38="Camp Claynaveral, ClayNaveral Hangar, OutHouse\Player 2\No Health",80197727 0000 +Cheat39="Camp Claynaveral, ClayNaveral Hangar, OutHouse\Player 2\Full Super Bar",8119772E 0200 +Cheat40="Freezing Fortress\Player 1\Cant be Stunned",8019428F 0000 +Cheat41="Freezing Fortress\Player 1\Infinite Health",80194297 00AA +Cheat42="Freezing Fortress\Player 1\No Health",80194297 0000 +Cheat43="Freezing Fortress\Player 1\Full Super Bar",8119429E 0200 +Cheat44="Freezing Fortress\Player 2\Cant be Stunned",8019777F 0000 +Cheat45="Freezing Fortress\Player 2\Infinite Health",80197787 00AA +Cheat46="Freezing Fortress\Player 2\No Health",80197787 0000 +Cheat47="Freezing Fortress\Player 2\Full Super Bar",8119778E 0200 +Cheat48="Spooky Spire, Happy Harry's Hut, Mudville Mansion\Player 1\Cant be Stunned",8019433F 0000 +Cheat49="Spooky Spire, Happy Harry's Hut, Mudville Mansion\Player 1\Infinite Health",80194347 00AA +Cheat50="Spooky Spire, Happy Harry's Hut, Mudville Mansion\Player 1\No Health",80194347 0000 +Cheat51="Spooky Spire, Happy Harry's Hut, Mudville Mansion\Player 1\Full Super Bar",8119434E 0200 +Cheat52="Spooky Spire, Happy Harry's Hut, Mudville Mansion\Player 2\Cant be Stunned",8019782F 0000 +Cheat53="Spooky Spire, Happy Harry's Hut, Mudville Mansion\Player 2\Infinite Health",80197837 00AA +Cheat54="Spooky Spire, Happy Harry's Hut, Mudville Mansion\Player 2\No Health",80197837 0000 +Cheat55="Spooky Spire, Happy Harry's Hut, Mudville Mansion\Player 2\Full Super Bar",8119783E 0200 +Cheat56="Rubbage Reef Code\Player 1\Cant be Stunned",8019430F 0000 +Cheat57="Rubbage Reef Code\Player 1\Infinite Health",80194317 00AA +Cheat58="Rubbage Reef Code\Player 1\No Health",80194317 0000 +Cheat59="Rubbage Reef Code\Player 1\Full Super Bar",8119431E 0200 +Cheat60="Rubbage Reef Code\Player 2\Cant be Stunned",801977FF 0000 +Cheat61="Rubbage Reef Code\Player 2\Infinite Health",80197807 00AA +Cheat62="Rubbage Reef Code\Player 2\No Health",80197807 0000 +Cheat63="Rubbage Reef Code\Player 2\Full Super Bar",8119780E 0200 +Cheat64="Backwash Bay\Player 1\Cant be Stunned",8019447F 0000 +Cheat65="Backwash Bay\Player 1\Infinite Health",80194487 00AA +Cheat66="Backwash Bay\Player 1\No Health",80194487 0000 +Cheat67="Backwash Bay\Player 1\Full Super Bar",8119448E 0200 +Cheat68="Backwash Bay\Player 2\Cant be Stunned",8019796F 0000 +Cheat69="Backwash Bay\Player 2\Infinite Health",80197977 00AA +Cheat70="Backwash Bay\Player 2\No Health",80197977 0000 +Cheat71="Backwash Bay\Player 2\Full Super Bar",8119797E 0200 +Cheat72="Ghastly Graveyard\Player 1\Cant be Stunned",8019451F 0000 +Cheat73="Ghastly Graveyard\Player 1\Infinite Health",80194527 00AA +Cheat74="Ghastly Graveyard\Player 1\No Health",80194527 0000 +Cheat75="Ghastly Graveyard\Player 1\Full Super Bar",8119452E 0200 +Cheat76="Ghastly Graveyard\Player 2\Cant be Stunned",80197A0F 0000 +Cheat77="Ghastly Graveyard\Player 2\Infinite Health",80197A17 00AA +Cheat78="Ghastly Graveyard\Player 2\No Health",80197A17 0000 +Cheat79="Ghastly Graveyard\Player 2\Full Super Bar",81197A1E 0200 +Cheat80="Candy Factory\Player 1\Cant be Stunned",801945FF 0000 +Cheat81="Candy Factory\Player 1\Infinite Health",80194607 00AA +Cheat82="Candy Factory\Player 1\No Health",80194607 0000 +Cheat83="Candy Factory\Player 1\Full Super Bar",8119460E 0200 +Cheat84="Candy Factory\Player 2\Cant be Stunned",80197AEF 0000 +Cheat85="Candy Factory\Player 2\Infinite Health",80197AF7 00AA +Cheat86="Candy Factory\Player 2\No Health",80197AF7 0000 +Cheat87="Candy Factory\Player 2\Full Super Bar",81197AFE 0200 +Cheat88="Kooky Courtyard\Player 1\Cant be Stunned",801946FF 0000 +Cheat89="Kooky Courtyard\Player 1\Infinite Health",80194707 00AA +Cheat90="Kooky Courtyard\Player 1\No Health",80194707 0000 +Cheat91="Kooky Courtyard\Player 1\Full Super Bar",8119470E 0200 +Cheat92="Kooky Courtyard\Player 2\Cant be Stunned",80197BEF 0000 +Cheat93="Kooky Courtyard\Player 2\Infinite Health",80197BF7 00AA +Cheat94="Kooky Courtyard\Player 2\No Health",80197BF7 0000 +Cheat95="Kooky Courtyard\Player 2\Full Super Bar",81197BFE 0200 +Cheat96="Santa's Toy Factory\Player 1\Cant be Stunned",80194B2F 0000 +Cheat97="Santa's Toy Factory\Player 1\Infinite Health",80194B37 00AA +Cheat98="Santa's Toy Factory\Player 1\No Health",80194B37 0000 +Cheat99="Santa's Toy Factory\Player 1\Full Super Bar",81194B3E 0200 +Cheat100="Santa's Toy Factory\Player 2\Cant be Stunned",8019801F 0000 +Cheat101="Santa's Toy Factory\Player 2\Infinite Health",80198027 00AA +Cheat102="Santa's Toy Factory\Player 2\No Health",80198027 0000 +Cheat103="Santa's Toy Factory\Player 2\Full Super Bar",8119802E 0200 +Cheat104="Boogerhenge, Tureen Toilet\Player 1\Cant be Stunned",80194ECF 0000 +Cheat105="Boogerhenge, Tureen Toilet\Player 1\Infinite Health",80194ED7 00AA +Cheat106="Boogerhenge, Tureen Toilet\Player 1\No Health",80194ED7 0000 +Cheat107="Boogerhenge, Tureen Toilet\Player 1\Full Super Bar",81194EDE 0200 +Cheat108="Boogerhenge, Tureen Toilet\Player 2\Cant be Stunned",801983BF 0000 +Cheat109="Boogerhenge, Tureen Toilet\Player 2\Infinite Health",801983C7 00AA +Cheat110="Boogerhenge, Tureen Toilet\Player 2\No Health",801983C7 0000 +Cheat111="Boogerhenge, Tureen Toilet\Player 2\Full Super Bar",811983CE 0200 +Cheat112="Dr. Kiln's Laboratory, Research Room, Kilns Hideout, Fiery Furnace\Player 1\Cant be Stunned",80195AAF 0000 +Cheat113="Dr. Kiln's Laboratory, Research Room, Kilns Hideout, Fiery Furnace\Player 1\Infinite Health",80195AB7 00AA +Cheat114="Dr. Kiln's Laboratory, Research Room, Kilns Hideout, Fiery Furnace\Player 1\No Health",80195AB7 0000 +Cheat115="Dr. Kiln's Laboratory, Research Room, Kilns Hideout, Fiery Furnace\Player 1\Full Super Bar",81195ABE 0200 +Cheat116="Dr. Kiln's Laboratory, Research Room, Kilns Hideout, Fiery Furnace\Player 2\Cant be Stunned",80198F9F 0000 +Cheat117="Dr. Kiln's Laboratory, Research Room, Kilns Hideout, Fiery Furnace\Player 2\Infinite Health",80198FA7 00AA +Cheat118="Dr. Kiln's Laboratory, Research Room, Kilns Hideout, Fiery Furnace\Player 2\No Health",80198FA7 0000 +Cheat119="Dr. Kiln's Laboratory, Research Room, Kilns Hideout, Fiery Furnace\Player 2\Full Super Bar",81198FAE 0200 +Cheat120="Dog House\Player 1\Cant be Stunned",8019653F 0000 +Cheat121="Dog House\Player 1\Infinite Health",80196547 00AA +Cheat122="Dog House\Player 1\No Health",80196547 0000 +Cheat123="Dog House\Player 1\Full Super Bar",8119654E 0200 +Cheat124="Dog House\Player 2\Cant be Stunned",80199A2F 0000 +Cheat125="Dog House\Player 2\Infinite Health",80199A37 00AA +Cheat126="Dog House\Player 2\No Health",80199A37 0000 +Cheat127="Dog House\Player 2\Full Super Bar",81199A3E 0200 +Cheat128="VS. Mode\Player 1\Cant be Stunned",8019195F 0000 +Cheat129="VS. Mode\Player 1\Infinite Health",80199167 00AA +Cheat130="VS. Mode\Player 1\No Health",80199167 0000 +Cheat131="VS. Mode\Player 1\Full Super Bar",8119916E 0200 +Cheat132="VS. Mode\Player 2\Cant be Stunned",80194E4F 0000 +Cheat133="VS. Mode\Player 2\Infinite Health",80194E57 00AA +Cheat134="VS. Mode\Player 2\No Health",80194E57 0000 +Cheat135="VS. Mode\Player 2\Full Super Bar",81194E5E 0200 +Cheat136="Other Codes\Have High Five",810AA0BE 0001 +Cheat137="Other Codes\Have Earth Worm Jim",810AA0E2 0001 +Cheat138="Other Codes\Have Sumo Santa",810AA106 0001 +Cheat139="Other Codes\Have Booger Man",810AA12A 0001 +Cheat140="Other Codes\Debug Mode",810AA1A6 0001 +Cheat141="Other Codes\Difficulty Modifier",810AE40A 00?? +Cheat142="Other Codes\Time Limit Modifier",800AE423 00?? +Cheat143="Other Codes\Throws & Holds Modifier",800AE42F 00?? +Cheat144="Other Codes\VS. Arena Select Modifier",800AE43B 00?? +Cheat145="Other Codes\Spillits Modifier",800AE447 00?? +Cheat146="Other Codes\Health Meters Modifier",800AE5EF 00?? +Cheat147="Other Codes\Stun Meters Modifier",800AE5FB 00?? +Cheat148="Other Codes\Super Meters Modifier",800AE607 00?? +Cheat149="Other Codes\Portraits Modifier",800AE613 00?? +Cheat141_O=$00 Cookie,$01 Easy,$02 Normal,$03 Dude,$04 Psycho +Cheat142_O=$00 On,$01 Off +Cheat143_O=$00 On,$01 Off +Cheat144_O=$00 Random,$01 Normal +Cheat145_O=$00 Normal,$01 Psycho +Cheat146_O=$00 Off,$01 On +Cheat147_O=$00 Off,$01 On +Cheat148_O=$00 Off,$01 On +Cheat149_O=$00 Off,$01 On +Cheat140_N=With this code, Press C-Up & C-Down to pick your stage. + +//---- + +[2B6FA7C0-09A71225-C:45] +Name=Clay Fighter 63 1-3 (U) (beta) +Cheat0="Extra Characters and Secret Options",8019ED41 000F +Cheat1="Stage Select",8019ED2B 00?? +Cheat1_O=$00 Candy Factory,$01 Claynaveral Hangar,$02 Camp Claynaveral,$03 Outhouse,$04 Mudville Mansion,$05 Ghastly Graveyard,$06 Spooky Spire,$07 Happy Harry's Hut,$08 Freezing Fortress,$09 Refuse Room,$0A Grotto Gulch,$0B Rubbage Room,$0C Rubbage Reef,$0D Kiln's Laboratory,$0E Kiln's Hideout,$0F Fiery Furnace,$10 Research Room,$11 Clayribbean Cruise,$12 Santa's Workship,$13 Kooky Courtyard,$14 Santa's Toy Factory,$15 Boogerhenge,$16 Backwash Bay,$17 Tureen Toilet,$18 Tribal Tower,$19 Aquadome +Cheat2="Play As\Player1",8019ED2F 00?? +Cheat2_O=$00 Bad Mr. Frosty,$01 Blob,$02 Bonker,$03 Boogerman,$04 Dr. Kiln,$05 Earthworm Jim,$08 Houngan,$09 Icky Bod Clay,$0A Kung Pow,$0D Sumo Santa,$0E Taffy,$0F T-Hoppy +Cheat3="Refuse Room, Grotto Gulch, Santa's Workship Stages\Can't be Stunned\Player 1",801EDCE3 0000 +Cheat4="Refuse Room, Grotto Gulch, Santa's Workship Stages\Infinite Energy\Player 1",801EDCEB 00AA +Cheat5="Refuse Room, Grotto Gulch, Santa's Workship Stages\No Energy\Player 1",801EDCEB 0000 +Cheat6="Refuse Room, Grotto Gulch, Santa's Workship Stages\Full Super Bar\Player 1",811EDCF2 0200 +Cheat7="Tribal Tower Stage\Can't be Stunned\Player 1",801EDD83 0000 +Cheat8="Tribal Tower Stage\Infinite Energy\Player 1",801EDD8B 00AA +Cheat9="Tribal Tower Stage\No Energy\Player 1",801EDD8B 0000 +Cheat10="Tribal Tower Stage\Full Super Bar\Player 1",811EDD92 0200 +Cheat11="Aquadome Stage\Can't be Stunned\Player 1",801EE013 0000 +Cheat12="Aquadome Stage\Infinite Energy\Player 1",801EE00B 00AA +Cheat13="Aquadome Stage\No Energy\Player 1",801EE00B 0000 +Cheat14="Aquadome Stage\Full Super Bar\Player 1",811EE012 0200 +Cheat15="Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Can't be Stunned\Player 1",801EE513 0000 +Cheat16="Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Infinite Energy\Player 1",801EE51B 00AA +Cheat17="Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\No Energy\Player 1",801EE51B 0000 +Cheat18="Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Full Super Bar\Player 1",811EE522 0200 +Cheat19="Freezing Fortress Stage\Can't be Stunned\Player 1",801EE573 0000 +Cheat20="Freezing Fortress Stage\Infinite Energy\Player 1",801EE57B 00AA +Cheat21="Freezing Fortress Stage\No Energy\Player 1",801EE57B 0000 +Cheat22="Freezing Fortress Stage\Full Super Bar\Player 1",811EE582 0200 +Cheat23="Rubbage Reef Stage\Can't be Stunned\Player 1",801EE5F3 0000 +Cheat24="Rubbage Reef Stage\Infinite Energy\Player 1",801EE5FB 00AA +Cheat25="Rubbage Reef Stage\No Energy\Player 1",801EE5FB 0000 +Cheat26="Rubbage Reef Stage\Full Super Bar\Player 1",811EE602 0200 +Cheat27="Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Can't be Stunned\Player 1",801EE623 0000 +Cheat28="Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Infinite Energy\Player 1",801EE62B 00AA +Cheat29="Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\No Energy\Player 1",801EE62B 0000 +Cheat30="Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Full Super Bar\Player 1",811EE632 0200 +Cheat31="Clayribbean Cruise Stage\Can't be Stunned\Player 1",801EE6D3 0000 +Cheat32="Clayribbean Cruise Stage\Infinite Energy\Player 1",801EE6DB 00AA +Cheat33="Clayribbean Cruise Stage\No Energy\Player 1",801EE6DB 0000 +Cheat34="Clayribbean Cruise Stage\Full Super Bar\Player 1",811EE6E2 0200 +Cheat35="Backwash Bay Stage\Can't be Stunned\Player 1",801EE763 0000 +Cheat36="Backwash Bay Stage\Infinite Energy\Player 1",801EE76B 00AA +Cheat37="Backwash Bay Stage\No Energy\Player 1",801EE76B 0000 +Cheat38="Backwash Bay Stage\Full Super Bar\Player 1",811EE772 0200 +Cheat39="Ghastly Graveyard Stage\Can't be Stunned\Player 1",801EE803 0000 +Cheat40="Ghastly Graveyard Stage\Infinite Energy\Player 1",801EE80B 00AA +Cheat41="Ghastly Graveyard Stage\No Energy\Player 1",801EE80B 0000 +Cheat42="Ghastly Graveyard Stage\Full Super Bar\Player 1",811EE812 0200 +Cheat43="Candy Factory Stage\Can't be Stunned\Player 1",801EE8E3 0000 +Cheat44="Candy Factory Stage\Infinite Energy\Player 1",801EE8EB 00AA +Cheat45="Candy Factory Stage\No Energy\Player 1",801EE8EB 0000 +Cheat46="Candy Factory Stage\Full Super Bar\Player 1",811EE8F2 0200 +Cheat47="Kooky Courtyard Stage\Can't be Stunned\Player 1",801EE9E3 0000 +Cheat48="Kooky Courtyard Stage\Infinite Energy\Player 1",801EE9EB 00AA +Cheat49="Kooky Courtyard Stage\No Energy\Player 1",801EE9EB 0000 +Cheat50="Kooky Courtyard Stage\Full Super Bar\Player 1",811EE9F2 0200 +Cheat51="Santa's Toy Factory Stage\Can't be Stunned\Player 1",801EEE13 0000 +Cheat52="Santa's Toy Factory Stage\Infinite Energy\Player 1",801EEE1B 00AA +Cheat53="Santa's Toy Factory Stage\No Energy\Player 1",801EEE1B 0000 +Cheat54="Santa's Toy Factory Stage\Full Super Bar\Player 1",811EEE22 0200 +Cheat55="Boogerhenge, Tureen Toilet Stage\Can't be Stunned\Player 1",801EF1B3 0000 +Cheat56="Boogerhenge, Tureen Toilet Stage\Infinite Energy\Player 1",801EF1BB 00AA +Cheat57="Boogerhenge, Tureen Toilet Stage\No Energy\Player 1",801EF1BB 0000 +Cheat58="Boogerhenge, Tureen Toilet Stage\Full Super Bar\Player 1",811EF1C2 0200 +Cheat59="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Can't be Stunned\Player 1",801EFD93 0000 +Cheat60="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Infinite Energy\Player 1",801EFD9B 00AA +Cheat61="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\No Energy\Player 1",801EFD9B 0000 +Cheat62="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Full Super Bar\Player 1",811EFDA2 0200 +Cheat63="Rubbage Room Stage\Can't be Stunned\Player 1",801F0823 0000 +Cheat64="Rubbage Room Stage\Infinite Energy\Player 1",801F082B 00AA +Cheat65="Rubbage Room Stage\No Energy\Player 1",801F082B 0000 +Cheat66="Rubbage Room Stage\Full Super Bar\Player 1",811F0832 0200 +Cheat67="Refuse Room, Grotto Gulch, Santa's Workship Stages\Can't be Stunned\Player 2",801F1183 0000 +Cheat68="Refuse Room, Grotto Gulch, Santa's Workship Stages\Infinite Energy\Player 2",801F118B 00AA +Cheat69="Refuse Room, Grotto Gulch, Santa's Workship Stages\No Energy\Player 2",801F118B 0000 +Cheat70="Refuse Room, Grotto Gulch, Santa's Workship Stages\Full Super Bar\Player 2",811F1192 0200 +Cheat71="Tribal Tower Stage\Can't be Stunned\Player 2",801F1223 0000 +Cheat72="Tribal Tower Stage\Infinite Energy\Player 2",801F122B 00AA +Cheat73="Tribal Tower Stage\No Energy\Player 2",801F122B 0000 +Cheat74="Tribal Tower Stage\Full Super Bar\Player 2",811F1232 0200 +Cheat75="Aquadome Stage\Can't be Stunned\Player 2",801F14A3 0000 +Cheat76="Aquadome Stage\Infinite Energy\Player 2",801F14AB 00AA +Cheat77="Aquadome Stage\No Energy\Player 2",801F14AB 0000 +Cheat78="Aquadome Stage\Full Super Bar\Player 2",811F14B2 0200 +Cheat79="Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Can't be Stunned\Player 2",801F19B3 0000 +Cheat80="Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Infinite Energy\Player 2",801F19BB 00AA +Cheat81="Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\No Energy\Player 2",801F19BB 0000 +Cheat82="Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Full Super Bar\Player 2",811F19C2 0200 +Cheat83="Freezing Fortress Stage\Can't be Stunned\Player 2",801F1A13 0000 +Cheat84="Freezing Fortress Stage\Infinite Energy\Player 2",801F1A1B 00AA +Cheat85="Freezing Fortress Stage\No Energy\Player 2",801F1A1B 0000 +Cheat86="Freezing Fortress Stage\Full Super Bar\Player 2",811F1A22 0200 +Cheat87="Rubbage Reef Stage\Can't be Stunned\Player 2",801F1A93 0000 +Cheat88="Rubbage Reef Stage\Infinite Energy\Player 2",801F1A9B 00AA +Cheat89="Rubbage Reef Stage\No Energy\Player 2",801F1A9B 0000 +Cheat90="Rubbage Reef Stage\Full Super Bar\Player 2",811F1AA2 0200 +Cheat91="Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Can't be Stunned\Player 2",801F1AC3 0000 +Cheat92="Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Infinite Energy\Player 2",801F1ACB 00AA +Cheat93="Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\No Energy\Player 2",801F1ACB 0000 +Cheat94="Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Full Super Bar\Player 2",811F1AD2 0200 +Cheat95="Clayribbean Cruise Stage\Can't be Stunned\Player 2",801F1B73 0000 +Cheat96="Clayribbean Cruise Stage\Infinite Energy\Player 2",801F1B7B 00AA +Cheat97="Clayribbean Cruise Stage\No Energy\Player 2",801F1B7B 0000 +Cheat98="Clayribbean Cruise Stage\Full Super Bar\Player 2",811F1B82 0200 +Cheat99="Backwash Bay Stage\Can't be Stunned\Player 2",801F1C03 0000 +Cheat101="Backwash Bay Stage\Infinite Energy\Player 2",801F1C0B 00AA +Cheat102="Backwash Bay Stage\No Energy\Player 2",801F1C0B 0000 +Cheat103="Backwash Bay Stage\Full Super Bar\Player 2",811F1C12 0200 +Cheat104="Ghastly Graveyard Stage\Can't be Stunned\Player 2",801F1CA3 0000 +Cheat105="Ghastly Graveyard Stage\Infinite Energy\Player 2",801F1CAB 00AA +Cheat106="Ghastly Graveyard Stage\No Energy\Player 2",801F1CAB 0000 +Cheat107="Ghastly Graveyard Stage\Full Super Bar\Player 2",811F1CB2 0200 +Cheat108="Candy Factory Stage\Can't be Stunned\Player 2",801F1D83 0000 +Cheat109="Candy Factory Stage\Infinite Energy\Player 2",801F1D8B 00AA +Cheat110="Candy Factory Stage\No Energy\Player 2",801F1D8B 0000 +Cheat111="Candy Factory Stage\Full Super Bar\Player 2",811F1D92 0200 +Cheat112="Kooky Courtyard Stage\Can't be Stunned\Player 2",801F1E83 0000 +Cheat113="Kooky Courtyard Stage\Infinite Energy\Player 2",801F1E8B 00AA +Cheat114="Kooky Courtyard Stage\No Energy\Player 2",801F1E8B 0000 +Cheat115="Kooky Courtyard Stage\Full Super Bar\Player 2",811F1E92 0200 +Cheat116="Santa's Toy Factory Stage\Can't be Stunned\Player 2",801F22B3 0000 +Cheat117="Santa's Toy Factory Stage\Infinite Energy\Player 2",801F22BB 00AA +Cheat118="Santa's Toy Factory Stage\No Energy\Player 2",801F22BB 0000 +Cheat119="Santa's Toy Factory Stage\Full Super Bar\Player 2",811F22C2 0200 +Cheat120="Boogerhenge, Tureen Toilet Stage\Can't be Stunned\Player 2",801F2653 0000 +Cheat121="Boogerhenge, Tureen Toilet Stage\Infinite Energy\Player 2",801F265B 00AA +Cheat122="Boogerhenge, Tureen Toilet Stage\No Energy\Player 2",801F265B 0000 +Cheat123="Boogerhenge, Tureen Toilet Stage\Full Super Bar\Player 2",811F2662 0200 +Cheat124="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Can't be Stunned\Player 2",801F3233 0000 +Cheat125="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Infinite Energy\Player 2",801F323B 00AA +Cheat126="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\No Energy\Player 2",801F323B 0000 +Cheat127="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Full Super Bar\Player 2",811F3242 0200 +Cheat128="Rubbage Room Stage\Can't be Stunned\Player 2",801F3CC3 0000 +Cheat129="Rubbage Room Stage\Infinite Energy\Player 2",801F3CCB 00AA +Cheat130="Rubbage Room Stage\No Energy\Player 2",801F3CCB 0000 +Cheat131="Rubbage Room Stage\Full Super Bar\Player 2",811F3CD2 0200 + +//---- + +[95286EB4-B76AD58F-C:45] +Name=Command & Conquer (U) +Cheat0="NOD\Max Cash",810C50AE FFFF,810C50B0 0001 +Cheat1="NOD\Max Power",810C50CE FFFF,810C50D0 0001 +Cheat2="NOD\Instant\Build Buildings",810C50C6 FFFF +Cheat3="NOD\Instant\Build Units",810C50BE FFFF +Cheat4="NOD\Instant\Build Vehicles",810C50C2 FFFF +Cheat5="NOD\Instant\Build Aircraft",810C50BA FFFF +Cheat6="NOD\Instant\Air Strike",800962A4 0032,800C4FF8 00FF +Cheat7="NOD\Instant\Ion Cannon",800962A5 0033,800C4FD8 00FF +Cheat8="NOD\Instant\Nuclear Strike",800962A6 0034,800C5018 00FF +Cheat9="GDI\Max Cash",810C4F06 FFFF,810C4F08 0001 +Cheat10="GDI\Max Power",810C4F26 FFFF,810C4F28 0001 +Cheat11="GDI\Instant\Build Buildings",810C4F1E FFFF +Cheat12="GDI\Instant\Build Units",810C4F16 FFFF +Cheat13="GDI\Instant\Build Vehicles",810C4F1A FFFF +Cheat14="GDI\Instant\Build Aircraft",810C4F12 FFFF +Cheat15="GDI\Instant\Air Strike",800962A4 0032,800C4E50 00FF +Cheat16="GDI\Instant\Ion Cannon",800962A5 0033,800C4E30 00FF +Cheat17="GDI\Instant\Nuclear Strike",800962A6 0034,800C4E70 00FF +Cheat18="GDI\Mission 4\Infinite Health Hum-Vee",800ABE99 0096 +Cheat19="GDI\Mission 4\Infinite Health APC #1",800ABFB1 00C8 +Cheat20="GDI\Mission 4\Infinite Health APC #2",800AC03D 00C8 +Cheat21="GDI\Mission 6\Infinite Health Commando",800B56CD 0050 +Cheat22="GDI\Mission 6\Infinite Health Transportational Helicopter",800BFC95 005A +Cheat23="GDI\Maximum Killed",80092E53 00C8 +Cheat24="NOD\Maximum Killed",80092E4F 00C8 +Cheat25="GDI\None Killed",80092E53 0000 +Cheat26="NOD\None Killed",80092E4F 0000 +Cheat27="GDI\Maximum Buildings Lost",80092E5F 00C8 +Cheat28="NOD\Maximum Buildings Lost",80092E5B 00C8 +Cheat29="GDI\No Buildings Lost",80092E5F 0000 +Cheat30="NOD\No Buildings Lost",80092E5B 0000 +Cheat31="100% Efficiency",80092E4B 0064 +Cheat32="100% Leadership",80092E47 0064 +Cheat33="Tons Of Ending Credits",81092E3C 0FFF,81092E3E FFFF +Cheat34="Max Total Score",81092E42 FFFF +Cheat35="Time Spent On Mission",80092E3B 00?? +Cheat35_O=$00 No Time,$FF Max Time + +//---- + +[30C7AC50-7704072D-C:45] +Name=Conker's Bad Fur Day (U) +Cheat0="Infinite\Health\Player 1",800CC49A 0006 +Cheat2="Infinite\Pots of cash",810D214A FFFF +Cheat1="Infinite\Oxygen",800CC382 0001 +Cheat3="Access All\Chapters, Scenes,& Multi-Player Characters",50000401 0000,800E9D01 00FF +Cheat4="Play as Option 1",800D213F 00?? +Cheat4_O=$01 Wessle,$03 Tedi,$04 Combat Squirrel,$05 Conker,$0B Uga,$0C Bald Caveman,$0D Caveman,$0E Mohican Caveman,$10 Neo Conker,$1B Villager,$21 Zombie,$23 Enemy Bat,$24 Conkers Bat,$25 Army Captain,$26 Tedi Boss,$27 Gregg,$28 Gregg skeleton +Cheat4_N=Here you can Choose Options who you want to play as,But only one Option at a time. +Cheat5="Infinite\Lives Player 1",800D2144 0064 +Cheat6="Infinite\Health\Player 2",800CC7C6 270F +Cheat7="Infinite\Health\Player 3",800CCAF2 270F +Cheat8="Infinite\Health\Player 4",800CCE1E 270F +Cheat9="Infinite\Time In Multi",8108FD7A 7500 +Cheat10="Infinite\Bags In Heist",800E0BE4 00FF +Cheat11="Access All\Characters & Weapons In Multi Race",810E9D02 ??FF +Cheat11_O=$FF All Characters & Baseball bat,$FB All Characters & Frying Pan,$F3 All Characters & Bones +Cheat12="Infinite\Bombs",802055CA 0030 +Cheat13="Infinite\Max Kills Player 1",800E0B47 03E7 +Cheat14="Infinite\Accuracy Count Player 1",800E0B67 0001 +Cheat15="Infinite\Head Shot Count Player 1",800E0B6B 03E7 +Cheat16="Press L To Levitate\Player 1",D0042A15 0020,810CC2F0 41CB +Cheat17="Press L To Levitate\Player 2",D0042A1D 0020,810CC61C 41CB +Cheat18="Press L To Levitate\Player 3",D0042A25 0020,810CC948 41CB +Cheat19="Press L To Levitate\Player 4",D0042A2D 0020,810CCC74 41CB +Cheat20="Matrix Mode (Anywhere) ",D1042A14 0010,800BEA0C 0001,D1042A14 0010,810BE574 D202,D1042A14 0001,800BEA0C 0000,D1042A14 0001,810BE574 0000 +Cheat20_N=Press R to activate and then Right-C to exit. +Cheat22="Weapon Select In Multi (On Pick Up)",80180873 00?? +Cheat22_O=$01 Sword,$02 Nothing,$03 Yellow Chain-Ssaw,$04 Throwing Knives,$05 Riffle,$06 Long Pistol with Sight,$07 Rocket Launcher,$08 Buck Shot,$0A High Powred Riffle With Scope,$0C Two Automatic Machine Guns,$13 Gas Mask +Cheat22_N=Select what Weapon you would like in Multi Player and then on a Weapon Pickup you will have the weapon of your choice.to change for another just Enable the one of your choice to have that instead.(you must have a weapon already to change for the next. +Cheat14_N=MULTI ONLY. Only put this code on once you are in the game +Cheat15_N=MULTI ONLY. Only put this code on once you are in the game,Once you pick up a Gun a shoot once, you will 100%. +Cheat16_N=Press L Button to Levitate & Let go to come back down +Cheat17_N=Press L Button to Levitate & Let go to come back down +Cheat18_N=Press L Button to Levitate & Let go to come back down +Cheat19_N=Press L Button to Levitate & Let go to come back down +Cheat21="Conkers Speed Select",810CC318 ???? +Cheat21_O=$3F00 Slow Conker,$3F80 Normal Conker,$3FF0 Fast Conker,$4030 Super Fast Conker + +//---- + +[46A3F7AF-0F7591D0-C:45] +Name=Cruis'n Exotica (U) +Cheat0="Unlock All Cars",8104F10E FFFF +Cheat1="Always Place 1st\Player 1",81065174 0000 +Cheat3="Infinite\Continues",8107F850 00FF +Cheat2="Infinite\Nitros\Player 1",800BE7FD 00FF +Cheat4="Infinite\Time",810802D4 4296 +Cheat5="Play As",800802D0 00?? +Cheat5_O=$00 ,$01 ,$02 ,$03 ,$04 ,$05 ,$06 ,$07 ,$08 ,$09 ,$0A ,$0B ,$0C ,$0D ,$0E ,$0F ,$10 ,$11 ,$12 ,$13 ,$14 ,$15 ,$16 ,$17 ,$18 ,$19 ,$1A + +//---- + +[FF2F2FB4-D161149A-C:45] +Name=Cruis'n USA (U) (v1.0) +Cheat0="Always Place 1st",8015025B 0001 +Cheat1="Unlimited Time",80150A68 0095,8015097D 0095 +Cheat2="Car Upgrades\'63 Muscle Car",8015065F 0005 +Cheat3="Car Upgrades\La Bomba",80150663 0005 +Cheat4="Car Upgrades\Devastator",80150667 0005 +Cheat5="Car Upgrades\Italia P69",8015066B 0005 +Cheat6="Car Upgrades\All-Terrain Vehicle",8015066F 0004 +Cheat7="Car Upgrades\School Bus",80150673 0004 +Cheat8="Car Upgrades\Police Car",80150677 0004 +Cheat9="Infinite Time",80150A6D 0045 +Cheat10="Stop Elapsed Time And No Traffic",80150A69 0000 +Cheat11="Play Level Modifier",80150A83 00?? +Cheat12="Player 1\Gearbox Type Modifier",80150333 00?? +Cheat13="Player 1\Always First Place",8015034B 0001 +Cheat14="Player 1\Always Have Fastest Car",8015033A 000C +Cheat15="Player 2\Gearbox Type Modifier",801506CF 00?? +Cheat16="Player 2\Always First Place",801506E7 0001 +Cheat17="Player 2\Always Have Fastest Car",801506D6 000C +Cheat18="Player 1\Lights & Sirens For Police Car & School Bus",8115065A 0001,8114E4AA 0001 +Cheat19="Player 2\Lights & Sirens For Police Car & School Bus",811509F6 0001,8114E4C2 0001 +Cheat11_O=$00 Golden Gate Park,$01 San Francisco,$02 US 101,$03 Redwood Forest,$04 Beverly Hills,$05 LA Freeway,$06 Death Valley,$07 Arizona,$08 Grand Canyon,$09 Iowa,$0A Chicago,$0B Indiana,$0C Appalachia,$0D Washington DC,$0E Cruise The USA +Cheat12_O=$00 Automatic,$01 Manual +Cheat15_O=$00 Automatic,$01 Manual + +//---- + +[5306CF45-CBC49250-C:45] +Name=Cruis'n USA (U) (v1.1) +Cheat0="Car Upgrades\'63 Muscle Car",8015053F 0005 +Cheat1="Car Upgrades\La Bomba",80150543 0005 +Cheat2="Car Upgrades\Devastator",80150547 0005 +Cheat3="Car Upgrades\Italia P69",8015054B 0005 +Cheat4="Car Upgrades\All-Terrain Vehicle",8015054F 0004 +Cheat5="Car Upgrades\School Bus",80150553 0004 +Cheat6="Car Upgrades\Police Car",80150557 0004 +Cheat7="Infinite Time",8015094D 0095 +Cheat8="Stop Elapsed Time And No Traffic",80150949 0000 +Cheat9="Play Level Modifier",80150963 00?? +Cheat10="Player 1\Gearbox Type Modifier",80150213 00?? +Cheat11="Player 1\Always First Place",8015022B 0001 +Cheat12="Player 1\Always Have Fastest Car",8015021A 0001 +Cheat13="Player 2\Gearbox Type Modifier",801505AF 00?? +Cheat14="Player 2\Always First Place",801505C7 0001 +Cheat15="Player 2\Always Have Fastest Car",801505B6 0001 +Cheat16="Player 1\Lights & Sirens For Police Car & School Bus P1",8115053A 0001,8114E38A 0001 +Cheat17="Player 2\Lights & Sirens For Police Car & School Bus P2",811508D6 0001,8114E3A2 0001 +Cheat9_O=$00 Golden Gate Park,$01 San Francisco,$02 US 101,$03 Redwood Forest,$04 Beverly Hills,$05 LA Freeway,$06 Death Valley,$07 Arizona,$08 Grand Canyon,$09 Iowa,$0A Chicago,$0B Indiana,$0C Appalachia,$0D Washington DC,$0E Cruise The USA +Cheat10_O=$00 Automatic,$01 Manual +Cheat13_O=$00 Automatic,$01 Manual + +//---- + +[B3402554-7340C004-C:45] +Name=Cruis'n USA (U) (v1.2) +Cheat0="Car Upgrades\'63 Muscle Car",8015056F 0005 +Cheat1="Car Upgrades\La Bomba",80150573 0005 +Cheat2="Car Upgrades\Devastator",80150577 0005 +Cheat3="Car Upgrades\Italia P69",8015057B 0005 +Cheat4="Car Upgrades\All-Terrain Vehicle",8015057F 0004 +Cheat5="Car Upgrades\School Bus",80150583 0004 +Cheat6="Car Upgrades\Police Car",80150587 0004 +Cheat7="Infinite Time",8015097D 0095 +Cheat8="Stop Elapsed Time And No Traffic",80150979 0000 +Cheat9="Play Level Modifier",80150993 00?? +Cheat10="Player 1\Gearbox Type Modifier",80150243 00?? +Cheat11="Player 1\Always First Place",8015025B 0001 +Cheat12="Player 1\Always Have Fastest Car",8015024A 0001 +Cheat13="Player 2\Gearbox Type Modifier",801505DF 00?? +Cheat14="Player 2\Always First Place",801505F7 0001 +Cheat15="Player 2\Always Have Fastest Car",801505E6 0001 +Cheat16="Player 1\Lights & Sirens For Police Car & School Bus",8115056A 0001,8114E3BA 0001 +Cheat17="Player 2\Lights & Sirens For Police Car & School Bus",81150906 0001,8114E3D2 0001 +Cheat9_O=$00 Golden Gate Park,$01 San Francisco,$02 US 101,$03 Redwood Forest,$04 Beverly Hills,$05 LA Freeway,$06 Death Valley,$07 Arizona,$08 Grand Canyon,$09 Iowa,$0A Chicago,$0B Indiana,$0C Appalachia,$0D Washington DC,$0E Cruise The USA +Cheat10_O=$00 Automatic,$01 Manual +Cheat13_O=$00 Automatic,$01 Manual + +//---- + +[DFE61153-D76118E6-C:45] +Name=Cruis'n World (U) +Cheat0="Have All Car Upgrades",803BEE42 0005 +Cheat1="Have All Cars",813BEE78 1FFF +Cheat2="Time Counts Down Faster",813D0D3E 0000 +Cheat3="Dancing Girl Always On",803BEE73 0001,803C21CF 0054 +Cheat4="Player 1\Always Place 1st",803CE023 0001 +Cheat5="Player 1\Car/Transmission Modifier",803BEE40 00?? +Cheat6="Player 1\Stop Elapsed Time",813C7678 3C80 +Cheat7="Player 2\Always Place 1st",803CE4FB 0001 +Cheat8="Player 2\Car/Transmission Modifier",803BEE48 00?? +Cheat9="Player 2\Stop Elapsed Time",813C78B4 3C80 +Cheat10="Player 3\Always Place 1st",803CDB4B 0001 +Cheat11="Player 3\Car/Transmission Modifier",803BEE50 00?? +Cheat12="Player 4\Always Place 1st",803CD673 0001 +Cheat13="Player 4\Car/Transmission Modifier",803BEE58 00?? +Cheat14="Have All Car Upgrades",803BEE42 0005 +Cheat15="Have All Cars",813BEE78 1FFF +Cheat16="Championship Mode\Max Total Points",813BFBFA FFFF +Cheat17="Championship Mode\Max Points Per Race",813BFBFE FFFF +Cheat18="Championship Mode\Max Points To Next Level",813BFBFC FFFF +Cheat20="Championship Mode\Unlimited Nitro\Player 2",803C7823 0003 +Cheat21="Championship Mode\Unlimited Nitro\Player 3",803C716F 0003 +Cheat22="Championship Mode\Cannot Spin Out",803CDD93 0000 +Cheat23="Championship Mode\Disable Left Lane Traffic",8033C95B 0001 +Cheat24="Championship Mode\Disable Right Lane Traffic",8033C95F 0001 +Cheat5_O=$00 Serpent (Auto),$01 Serpent (Manual),$02 Kamikaze (Auto),$03 Kamikaze (Manual),$04 ATV (Auto,$05 ATV (Manual),$06 Scarab (Auto),$07 Scarab (Manual),$08 Stallion P6 (Auto),$09 Stallion P6 (Manual),$0A Banzai GTV (Auto),$0B Banzai GTV (Manual),$0C Zombie (Auto),$0D Zombie (Manual),$0E Orca (Auto),$0F Orca (manual),$10 El Nino (Auto),$11 El Nino (Manual),$12 Rhino 4x4 (Auto),$13 Rhino 4x4 (Manual),$14 Sardine Extreme (Auto),$15 Sardine Extreme (Manual),$16 Road King (Auto),$17 Road King (Manual),$18 Grass Hopper (Auto),$19 Grass Hopper (Manual),$1A Bulldog (Auto),$1B Bulldog (Manual),$1C Enforcer (Auto),$1D Enforcer (Manual),$1E NY Taxi (Auto),$1F NY Taxi (Manual),$20 School Bus (Auto),$21 School Bus (Manual),$22 Exec (Auto),$23 Exec (Manual),$24 Conductor (Auto),$25 Conductor (Manual),$26 Speed Demon (Auto),$27 Speed Demon (Manual),$28 Tommy (Auto),$29 Tommy (Manual),$2A Rocket (Auto),$2B Rocket (Manual),$2C The Surgeon (Auto),$2D The Surgeon (Manual),$2E Monsta (Auto),$2F Monsta (Manual),$30 Howler (Auto),$31 Howler (Manual) +Cheat8_O=$00 Serpent (Auto),$01 Serpent (Manual),$02 Kamikaze (Auto),$03 Kamikaze (Manual),$04 ATV (Auto,$05 ATV (Manual),$06 Scarab (Auto),$07 Scarab (Manual),$08 Stallion P6 (Auto),$09 Stallion P6 (Manual),$0A Banzai GTV (Auto),$0B Banzai GTV (Manual),$0C Zombie (Auto),$0D Zombie (Manual),$0E Orca (Auto),$0F Orca (manual),$10 El Nino (Auto),$11 El Nino (Manual),$12 Rhino 4x4 (Auto),$13 Rhino 4x4 (Manual),$14 Sardine Extreme (Auto),$15 Sardine Extreme (Manual),$16 Road King (Auto),$17 Road King (Manual),$18 Grass Hopper (Auto),$19 Grass Hopper (Manual),$1A Bulldog (Auto),$1B Bulldog (Manual),$1C Enforcer (Auto),$1D Enforcer (Manual),$1E NY Taxi (Auto),$1F NY Taxi (Manual),$20 School Bus (Auto),$21 School Bus (Manual),$22 Exec (Auto),$23 Exec (Manual),$24 Conductor (Auto),$25 Conductor (Manual),$26 Speed Demon (Auto),$27 Speed Demon (Manual),$28 Tommy (Auto),$29 Tommy (Manual),$2A Rocket (Auto),$2B Rocket (Manual),$2C The Surgeon (Auto),$2D The Surgeon (Manual),$2E Monsta (Auto),$2F Monsta (Manual),$30 Howler (Auto),$31 Howler (Manual) +Cheat11_O=$00 Serpent (Auto),$01 Serpent (Manual),$02 Kamikaze (Auto),$03 Kamikaze (Manual),$04 ATV (Auto,$05 ATV (Manual),$06 Scarab (Auto),$07 Scarab (Manual),$08 Stallion P6 (Auto),$09 Stallion P6 (Manual),$0A Banzai GTV (Auto),$0B Banzai GTV (Manual),$0C Zombie (Auto),$0D Zombie (Manual),$0E Orca (Auto),$0F Orca (manual),$10 El Nino (Auto),$11 El Nino (Manual),$12 Rhino 4x4 (Auto),$13 Rhino 4x4 (Manual),$14 Sardine Extreme (Auto),$15 Sardine Extreme (Manual),$16 Road King (Auto),$17 Road King (Manual),$18 Grass Hopper (Auto),$19 Grass Hopper (Manual),$1A Bulldog (Auto),$1B Bulldog (Manual),$1C Enforcer (Auto),$1D Enforcer (Manual),$1E NY Taxi (Auto),$1F NY Taxi (Manual),$20 School Bus (Auto),$21 School Bus (Manual),$22 Exec (Auto),$23 Exec (Manual),$24 Conductor (Auto),$25 Conductor (Manual),$26 Speed Demon (Auto),$27 Speed Demon (Manual),$28 Tommy (Auto),$29 Tommy (Manual),$2A Rocket (Auto),$2B Rocket (Manual),$2C The Surgeon (Auto),$2D The Surgeon (Manual),$2E Monsta (Auto),$2F Monsta (Manual),$30 Howler (Auto),$31 Howler (Manual) +Cheat13_O=$00 Serpent (Auto),$01 Serpent (Manual),$02 Kamikaze (Auto),$03 Kamikaze (Manual),$04 ATV (Auto,$05 ATV (Manual),$06 Scarab (Auto),$07 Scarab (Manual),$08 Stallion P6 (Auto),$09 Stallion P6 (Manual),$0A Banzai GTV (Auto),$0B Banzai GTV (Manual),$0C Zombie (Auto),$0D Zombie (Manual),$0E Orca (Auto),$0F Orca (manual),$10 El Nino (Auto),$11 El Nino (Manual),$12 Rhino 4x4 (Auto),$13 Rhino 4x4 (Manual),$14 Sardine Extreme (Auto),$15 Sardine Extreme (Manual),$16 Road King (Auto),$17 Road King (Manual),$18 Grass Hopper (Auto),$19 Grass Hopper (Manual),$1A Bulldog (Auto),$1B Bulldog (Manual),$1C Enforcer (Auto),$1D Enforcer (Manual),$1E NY Taxi (Auto),$1F NY Taxi (Manual),$20 School Bus (Auto),$21 School Bus (Manual),$22 Exec (Auto),$23 Exec (Manual),$24 Conductor (Auto),$25 Conductor (Manual),$26 Speed Demon (Auto),$27 Speed Demon (Manual),$28 Tommy (Auto),$29 Tommy (Manual),$2A Rocket (Auto),$2B Rocket (Manual),$2C The Surgeon (Auto),$2D The Surgeon (Manual),$2E Monsta (Auto),$2F Monsta (Manual),$30 Howler (Auto),$31 Howler (Manual) +Cheat19="Championship Mode\Unlimited Nitro\Player 1",803C75E7 0003 + +//---- + +[E8FC8EA1-9F738391-C:45] +Name=CyberTiger (U) +Cheat0="Always Hole In One",8115E1D6 0000 +Cheat1="Inventory\Max Distance & Wind Cutter",800B4412 00FF +Cheat2="Inventory\Max No Bounce & Tee Up",800B4411 00FF +Cheat3="Inventory\Max Accuracy & Skipper",800B4410 00FF +Cheat4="Inventory\Max Spinner & Burrow",800B4413 00FF +Cheat5="Inventory\Max Mystery",800B4420 00F0 +Cheat6="Big Head",810AE840 401F +Cheat7="Character Unlock\Kimmi",800B0BBA 0010 +Cheat8="Character Unlock\Starr",800B0BCE 0010 +Cheat9="Character Unlock\Marvin The Alien",800B0BD7 0001 +Cheat10="Change Looks Of Liltiger",800B0BC4 0011 +Cheat11="Character Unlock\Robert & Delvis",800B0BCA 0011 +Cheat12="Character Unlock\Bengal The Tiger",800B0BC2 0010 +Cheat13="Character Unlock\Cindy",800B0BBA 0001 +Cheat14="Character Unlock\Festus",800B0BD3 0001 +Cheat15="Character Unlock\Mark",800B0BC7 0012 +Cheat16="Character Unlock\Twfan & Eagamer",800B0BBE 0011 +Cheat17="Character Unlock\Traci (Leopard Costume)",800B0BCE 0011 +Cheat18="Character Unlock\Bobby",800B0BC6 0001 + +//---- + +[A4A52B58-23759841-C:45] +Name=Dark Rift (U) +Cheat0="Access Sonork Character",80049DF0 0001 +Cheat1="Access Demitron Character",80049DF4 0001 +Cheat2="Infinite Health\All Levels\Player 1",81028988 0800,8102898A 0018,81000060 3C1B,81000062 8008,81000064 8F7B,81000066 0228,8100006C 03E0,8100006E 0008,81000070 A761,81000072 0070 +Cheat3="Press GS For 2 Rounds Won\Player 1",890B6330 0002 +Cheat4="Press GS For 2 Rounds Won\Player 2",890B6342 0002 +Cheat5="Music Modifier",800816B2 00?? +Cheat5_O=$00 Music Off,$2A Volume Low,$55 Volume Medium,$7F Volume Max + +//---- + +[F5363349-DBF9D21B-C:45] +Name=Deadly Arts (U) +Cheat0="Player 1\Character Modifier",80105001 00?? +Cheat1="Player 1\Infinite Energy",81105026 03E8 +Cheat2="Player 1\No Energy",81105026 0000 +Cheat3="Player 1\Never Wins",8009E3F4 0000 +Cheat4="Player 1\Needs 1 Round to Win",D009E3F4 0000,8009E3F4 0001 +Cheat5="Player 2\Character Modifier",8011B399 00?? +Cheat6="Player 2\Infinite Energy",8111B3BE 03E8 +Cheat7="Player 2\No Energy",8111B3BE 0000 +Cheat8="Player 2\P2 Never Wins",8009E3F5 0000 +Cheat9="Player 2\Needs 1 Round to Win",D009E3F5 0000,8009E3F5 0001 +Cheat0_O=$00 Azami,$01 Serina,$02 Miki,$03 Kai,$04 Sakai,$05 Kengon,$06 Kyeya,$07 Kaoru,$08 Gouriki,$09 Reiji,$0A Yami,$0B Hikari,$0C Invisible Fighter +Cheat5_O=$00 Azami,$01 Serina,$02 Miki,$03 Kai,$04 Sakai,$05 Kengon,$06 Kyeya,$07 Kaoru,$08 Gouriki,$09 Reiji,$0A Yami,$0B Hikari,$0C Invisible Fighter +Cheat10="Have Extra Characters (Gouriki & Reiji)",8009E3DF 00FF + +//---- + +[DEE584A2-0F161187-C:45] +Name=Destruction Derby 64 (U) +Cheat0="Solo Mode\Infinite Damage Meter",80125FD9 0026 +Cheat1="All Cars and Tracks",50000602 0000,81097A18 0101 +Cheat2="All Difficulty Levels",81097A16 0003 +Cheat3="Solo Mode\Vehicles\Baja Buggy",80097A18 0001 +Cheat4="Solo Mode\Vehicles\Low Rider",80097A19 0001 +Cheat5="Solo Mode\Vehicles\Woody Wagon",80097A1A 0001 +Cheat6="Solo Mode\Vehicles\Pickup",80097A1B 0001 +Cheat7="Solo Mode\Vehicles\Taxi Cab",80097A1C 0001 +Cheat8="Solo Mode\Vehicles\Blue Demon",80097A1D 0001 +Cheat9="Solo Mode\Vehicles\Rag Top",80097A1E 0001 +Cheat10="Solo Mode\Vehicles\Hot Rod",80097A1F 0001 +Cheat11="Solo Mode\Vehicles\Ambulance",80097A20 0001 +Cheat12="Solo Mode\Vehicles\Watchback",80097A21 0001 +Cheat13="Solo Mode\Vehicles\Street Rocket",80097A22 0001 +Cheat14="Solo Mode\Vehicles\Police Car",80097A23 0001 +Cheat15="Solo Mode\Tracks\Metro Challenge",80095CCC 0001 +Cheat16="Solo Mode\Tracks\Seascape",80095CCD 0001 +Cheat17="Solo Mode\Tracks\Boyou Run",80095CCE 0001 +Cheat18="Solo Mode\Tracks\Terminal Impact",80095CCF 0001 +Cheat19="Solo Mode\Tracks\Destruction Junction",80095CD0 0001 +Cheat20="Solo Mode\Tracks\Sunset Canyon",80095CD1 0001 +Cheat21="Solo Mode\Tracks\Apline Ridge",80095CD2 0001 +Cheat22="Solo Mode\Tracks\Midnyte Rumble",80095CD3 0001 +Cheat23="Multiplayer\Tracks\The Junkyard",80095CC8 0001 +Cheat24="Multiplayer\Tracks\Have Aztec Ruins",80095CC9 0001 +Cheat25="Multiplayer\Tracks\Urban Mayhem",80095CCA 0001 +Cheat26="Multiplayer\Tracks\Ground Zero",80095CCB 0001 +Cheat27="Multiplayer\Junkyard\Infinite Health\Player 1",80205B8B 00BE +Cheat28="Multiplayer\Junkyard\Infinite Health\Player 2",8021505F 00BE +Cheat29="Multiplayer\Aztec Ruins\Infinite Health\Player 1",801FC437 00BE +Cheat30="Multiplayer\Aztec Ruins\Infinite Health\Player 2",80217C5F 00BE +Cheat31="Multiplayer\Urban Mayhem\Infinite Health\Player 1",8021779F 00BE +Cheat32="Multiplayer\Urban Mayhem\Infinite Health\Player 2",80235E5F 00BE +Cheat33="Multiplayer\Ground Zero\Infinite Health\Player 1",801F64D7 00BE +Cheat34="Multiplayer\Ground Zero\Infinite Health\Player 2",80211D1F 00BE +Cheat35="Solo Mode\Seascape Sprint\Infinite Health",D02D4C24 0080,802D4C33 00E1 +Cheat36="Solo Mode\Metro Challenge\Infinite Health",D02EDB18 0080,802EDB27 00E1 +Cheat37="Solo Mode\Terminal Impact\Infinite Health",D02B5AA3 0080,802B5AB2 00E1 +Cheat38="Solo Mode\Destruction Junction\Infinite Health",D029A9B0 0080,8029A9BF 00E1 +Cheat39="Solo Mode\Midnyte Rumble\Infinite Health",D030C70B 0080,8030C71A 00E1 +Cheat40="Solo Mode\Bayou Run\Infinite Health",D0285E7C 0080,80285E8B 00E1 +Cheat41="Solo Mode\Alpine Ridge\Infinite Health",D02B9D24 0080,802B9D33 00E1 +Cheat42="Solo Mode\Sunset Canyon\Infinite Health",D0303A68 0080,80303A77 00E1 + +//---- + +[53D440E7-7519B011-C:45] +Name=Diddy Kong Racing (U) (V1.0) +Cheat0="Enable All Cheats",50000401 0000,810DFD9C FFFF +Cheat0_N=Go into Options & then Magic Codes. Then Code list to turn off & on what you want. +Cheat1="Have All\Trophies",811FC9DE FFFF +Cheat2="Have All\Keys",811FC9D8 FFFF +Cheat3="Have All\Amulets",811FC9E6 FFFF +Cheat4="Boss Cannot Move\Dino",811DFCF4 44A0 +Cheat5="Boss Cannot Move\Octo",811E045C 44A0 +Cheat6="Have All\99 Balloons",810DFD9A FFFF,801FCBED 0063 +Cheat7="Have All\Levels Completely Finished",50000904 0000,801FCAF7 00FF,801FCB1F 00FF,801FCB27 00FF,50000404 0000,801FCB2F 00FF,801FCB4F 00FF,50000804 0000,801FCB53 00FF +Cheat8="Have All\Silver Coins\Ancient Lake",801E34AA 0008 +Cheat9="Have All\Silver Coins\Fossil Canyon",801E694A 0008 +Cheat10="Have All\Silver Coins\Jungle Falls",801E513A 0008 +Cheat11="Have All\Silver Coins\Hot Top Volcano",801E480A 0008 +Cheat12="Have All\Silver Coins\Everfrost Peak",801E513A 0008 +Cheat13="Have All\Silver Coins\Walrus Cove",801E4C5A 0008 +Cheat14="Have All\Silver Coins\Snowball Valley",801E4BDA 0008 +Cheat15="Have All\Silver Coins\Frosty Village",801E612A 0008 +Cheat16="Have All\Silver Coins\Whale Bay",801E3CDA 0008 +Cheat17="Have All\Silver Coins\Pirate Lagoon",801E2B3A 0008 +Cheat18="Have All\Silver Coins\Crescent Island",801E3C0A 0008 +Cheat19="Have All\Silver Coins\Treasure Caves",801E38FA 0008 +Cheat20="Have All\Silver Coins\Boulder Canyon",801E63CA 0008 +Cheat21="Have All\Silver Coins\Greenwood Village",801E4C8A 0008 +Cheat22="Have All\Silver Coins\Windmill Plains",801E9D9A 0008 +Cheat23="Have All\Silver Coins\Haunted Woods",801E4BFA 0008 +Cheat24="Have All\50 Bananas\Ancient Lake",801E32CD 0032 +Cheat25="Have All\50 Bananas\Fossil Canyon",801E676D 0032 +Cheat26="Have All\50 Bananas\Jungle Falls",801E44CD 0032 +Cheat27="Have All\50 Bananas\Hot Top Volcano",801E462D 0032 +Cheat28="Have All\50 Bananas\Whale Bay",801E3AFD 0032 +Cheat29="Have All\50 Bananas\Pirate Lagoon",801E295D 0032 +Cheat30="Have All\50 Bananas\Crescent Island",801E3A2D 0032 +Cheat31="Have All\50 Bananas\Treasure Caves",801E371D 0032 +Cheat32="Have All\50 Bananas\Everfrost Peak",801E4F5D 0032 +Cheat33="Have All\50 Bananas\Walrus Cove",801E4A7D 0032 +Cheat34="Have All\50 Bananas\Snowball Valley",801E49FD 0032 +Cheat35="Have All\50 Bananas\Frosty Village",801E5F4D 0032 +Cheat36="Have All\50 Bananas\Boulder Canyon",801E61ED 0032 +Cheat37="Have All\50 Bananas\Greenwood Village",801E4AAD 0032 +Cheat38="Have All\50 Bananas\Windwill Plains",801E9BBD 0032 +Cheat39="Have All\50 Bananas\Haunted Woods",801E4A1D 0032 +Cheat40="Have All\50 Bananas\Spacedust Alley",801E654D 0032 +Cheat41="Have All\50 Bananas\Darkmoon Caverns",801E5D0D 0032 +Cheat42="Have All\50 Bananas\Star City",801E578D 0032 +Cheat43="Have All\50 Bananas\Spaceport Alpha",801E3C6D 0032 +Cheat44="Have All\The pieces of the TT thing",801FC9E6 0004 +Cheat45="Infinite\Power Ups\Ancient Lake",801E6A2B 0010 +Cheat46="Infinite\Power Ups\Boulder Canyon",801E8D4B 0010 +Cheat47="Infinite\Power Ups\Crescent Island",801E718B 0010 +Cheat48="Infinite\Power Ups\Darkmoon Caverns",801E96AB 0010 +Cheat49="Infinite\Power Ups\Everfrost Peak",801E871B 0010 +Cheat50="Infinite\Power Ups\Fossil Canyon",801E9ECB 0010 +Cheat51="Infinite\Power Ups\Frosty Village",801E96A6 0010 +Cheat52="Infinite\Power Ups\Greenwood Village",801E820B 0010 +Cheat53="Infinite\Power Ups\Hot Top Volcano",801E477B 0010 +Cheat54="Infinite\Power Ups\Haunted Woods",801E817B 0010 +Cheat55="Infinite\Power Ups\Jungle Falls",801E45BB 0010 +Cheat56="Infinite\Power Ups\Pirate Lagoon",801E54B6 0010 +Cheat57="Infinite\Power Ups\Snowball Valley",801E815B 0010 +Cheat58="Infinite\Power Ups\Spaceport Alpha",801E676B 0010 +Cheat59="Infinite\Power Ups\Space Dust Alley",801E904B 0010 +Cheat60="Infinite\Power Ups\Starcity",801E8EEB 0010 +Cheat61="Infinite\Power Ups\Treasure Cove",801E6E7B 0010 +Cheat62="Infinite\Power Ups\Walrus Cove",801E81DB 0010 +Cheat63="Infinite\Power Ups\Whale Bay",801E665B 0010 +Cheat64="Infinite\Power Ups\Windmill Plains",801EC6BB 0010 +Cheat1_N=Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. +Cheat2_N=Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. +Cheat3_N=Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. +Cheat8_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat9_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat10_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat11_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat12_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat13_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat14_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat15_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat16_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat17_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat18_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat19_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat20_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat21_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat22_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat23_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat24_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat25_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat26_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat27_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat28_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat29_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat30_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat31_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat32_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat33_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat34_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat35_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat36_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat37_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat38_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat39_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat40_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat41_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat42_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat43_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat45_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat46_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat47_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat48_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat49_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat50_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat51_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat52_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat53_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat54_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat55_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat56_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat57_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat58_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat59_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat60_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat61_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat62_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat63_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat64_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + +//---- + +[E402430D-D2FCFC9D-C:45] +Name=Diddy Kong Racing (U) (V1.1) +Cheat0="Enable All Cheats",810E031C FFFF,810E031E FFFF +Cheat0_N=Go into Options & then Magic Codes. Then Code list to turn off & on what you want. +Cheat1="Have All\Trophies",811FC9DE FFFF +Cheat2="Have All\Keys",811FD1C8 FFFF +Cheat3="Have All\Amulets",811FD1D6 FFFF +Cheat4="Boss Cannot Move\Dino",811E0444 44A0 +Cheat5="Boss Cannot Move\Octo",811E0BAC 44A0 +Cheat6="Have All\99 Balloons",810E058A FFFF,801FD3DD 0063 +Cheat7="Have All\Levels Completely Finished",50000904 0000,801FD2E7 00FF,801FD30F 00FF,801FD317 00FF,50000404 0000,801FD31F 00FF,801FD33F 00FF,50000804 0000,801FD343 00FF +Cheat8="Have All\Silver Coins\Ancient Lake",801E3BFA 0008 +Cheat9="Have All\Silver Coins\Fossil Canyon",801E709A 0008 +Cheat10="Have All\Silver Coins\Jungle Falls",801E588A 0008 +Cheat11="Have All\Silver Coins\Hot Top Volcano",801E4F5A 0008 +Cheat12="Have All\Silver Coins\Everfrost Peak",801E588A 0008 +Cheat13="Have All\Silver Coins\Walrus Cove",801E53AA 0008 +Cheat14="Have All\Silver Coins\Snowball Valley",801E532A 0008 +Cheat15="Have All\Silver Coins\Frosty Village",801E687A 0008 +Cheat16="Have All\Silver Coins\Whale Bay",801E442A 0008 +Cheat17="Have All\Silver Coins\Pirate Lagoon",801E328A 0008 +Cheat18="Have All\Silver Coins\Crescent Island",801E435A 0008 +Cheat19="Have All\Silver Coins\Treasure Caves",801E404A 0008 +Cheat20="Have All\Silver Coins\Boulder Canyon",801E6B1A 0008 +Cheat21="Have All\Silver Coins\Greenwood Village",801E53DA 0008 +Cheat22="Have All\Silver Coins\Windmill Plains",801EA4EA 0008 +Cheat23="Have All\Silver Coins\Haunted Woods",801E534A 0008 +Cheat24="Have All\50 Bananas\Ancient Lake",801E3A1D 0032 +Cheat25="Have All\50 Bananas\Fossil Canyon",801E6EBD 0032 +Cheat26="Have All\50 Bananas\Jungle Falls",801E4C1D 0032 +Cheat27="Have All\50 Bananas\Hot Top Volcano",801E4D7D 0032 +Cheat28="Have All\50 Bananas\Whale Bay",801E424D 0032 +Cheat29="Have All\50 Bananas\Pirate Lagoon",801E30AD 0032 +Cheat30="Have All\50 Bananas\Crescent Island",801E417D 0032 +Cheat31="Have All\50 Bananas\Treasure Caves",801E3E6D 0032 +Cheat32="Have All\50 Bananas\Everfrost Peak",801E56AD 0032 +Cheat33="Have All\50 Bananas\Walrus Cove",801E51CD 0032 +Cheat34="Have All\50 Bananas\Snowball Valley",801E514D 0032 +Cheat35="Have All\50 Bananas\Frosty Village",801E669D 0032 +Cheat36="Have All\50 Bananas\Boulder Canyon",801E693D 0032 +Cheat37="Have All\50 Bananas\Greenwood Village",801E51FD 0032 +Cheat38="Have All\50 Bananas\Windwill Plains",801EA30D 0032 +Cheat39="Have All\50 Bananas\Haunted Woods",801E516D 0032 +Cheat40="Have All\50 Bananas\Spacedust Alley",801E6C9D 0032 +Cheat41="Have All\50 Bananas\Darkmoon Caverns",801E645D 0032 +Cheat42="Have All\50 Bananas\Star City",801E5EDD 0032 +Cheat43="Have All\50 Bananas\Spaceport Alpha",801E43BD 0032 +Cheat44="Have All\The pieces of the TT thing",801FD1D6 0004 +Cheat45="Infinite\Power Ups\Ancient Lake",801E717B 0010 +Cheat46="Infinite\Power Ups\Boulder Canyon",801E949B 0010 +Cheat47="Infinite\Power Ups\Crescent Island",801E78DB 0010 +Cheat48="Infinite\Power Ups\Darkmoon Caverns",801E9DFB 0010 +Cheat49="Infinite\Power Ups\Everfrost Peak",801E8E6B 0010 +Cheat50="Infinite\Power Ups\Fossil Canyon",801EA61B 0010 +Cheat51="Infinite\Power Ups\Frosty Village",801E9DF6 0010 +Cheat52="Infinite\Power Ups\Greenwood Village",801E895B 0010 +Cheat53="Infinite\Power Ups\Hot Top Volcano",801E4ECB 0010 +Cheat54="Infinite\Power Ups\Haunted Woods",801E88CB 0010 +Cheat55="Infinite\Power Ups\Jungle Falls",801E4D0B 0010 +Cheat56="Infinite\Power Ups\Pirate Lagoon",801E5C06 0010 +Cheat57="Infinite\Power Ups\Snowball Valley",801E88AB 0010 +Cheat58="Infinite\Power Ups\Spaceport Alpha",801E6EBB 0010 +Cheat59="Infinite\Power Ups\Space Dust Alley",801E979B 0010 +Cheat60="Infinite\Power Ups\Starcity",801E963B 0010 +Cheat61="Infinite\Power Ups\Treasure Cove",801E75CB 0010 +Cheat62="Infinite\Power Ups\Walrus Cove",801E892B 0010 +Cheat63="Infinite\Power Ups\Whale Bay",801E6DAB 0010 +Cheat64="Infinite\Power Ups\Windmill Plains",801ECE0B 0010 +Cheat1_N=Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. +Cheat2_N=Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. +Cheat3_N=Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. +Cheat8_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat9_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat10_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat11_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat12_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat13_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat14_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat15_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat16_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat17_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat18_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat19_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat20_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat21_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat22_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat23_N=Do not use more than 1 Silver Coins up at a time or it will cause a crash +Cheat24_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat25_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat26_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat27_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat28_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat29_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat30_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat31_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat32_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat33_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat34_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat35_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat36_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat37_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat38_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat39_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat40_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat41_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat42_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat43_N=Do not use more than 1 50 Bananas up at a time or it will cause a crash +Cheat45_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat46_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat47_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat48_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat49_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat50_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat51_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat52_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat53_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat54_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat55_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat56_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat57_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat58_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat59_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat60_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat61_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat62_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat63_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash +Cheat64_N=For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + +//---- + +[C16C421B-A21580F7-C:45] +Name=Disney's Donald Duck - Goin' Quackers (U) +Cheat0="Infinite\99 Lives",801D72AE 0063 +Cheat1="Infinite\99 Stars",801D72AF 0063 +Cheat2="Instant\Rage Attack (Press C-Left)",D00CB2A1 0002,801CE5BD 0001 +Cheat3="Instant\Hyperactive State [Invincible] (Press C-Right)",D00CB2A1 0001,801CE616 0001 +Cheat4="Instant\Carrier Box [Moon Walk] (Press L)",D00CB2A1 0020,801C939F 0001 +Cheat4_N=Press and hold the L Button and you will run floating of any ledge slowing drifting down. If you keep pressing the A Button while Holding L it will act as a Moon Jump. +Cheat5="Infinite\Time\Gladstones Time Attack",801D72A7 00FF +Cheat6="Infinite\Time\Nephews Toy Hunting",801D72A3 0063 +Cheat7="Have All\Levels and Bonus Stages Unlocked",801D72CC 00FF,801D72CD 00FF,801D72CE 00FF,801D72CF 00FF,801D72D3 00FF +Cheat7_N=Press start in Gyro's Lab and then resume game to see all open +Cheat8="Have All\Time Attack & Toy Hunting Comnpleated (All Levels)",801D72D8 00FF,801D72D9 00FF,801D72DA 00FF,801D72DB 00FF,801D72DC 00FF,801D72DD 00FF,801D72DE 00FF,801D72DF 00FF +Cheat8_N=Press start in Gyro's Lab and then resume game to see all open + +//---- + +[CBFE69C7-F2C0AB2A-C:45] +Name=Disney's Tarzan (U) +Cheat0="Infinite\Health",811921C0 0120 +Cheat1="Have\Coins Collected 100%",800DD257 0064 +Cheat2="Have\Level & Tokens Completed 100%",800DD22F 0000,800DD230 0001,800DD231 0000 +Cheat3="Access Level Select",810DD21C 8001 +Cheat3_N=On the main menu Scroll down to make CHEATS visible to go into Level Select.For in-Game Cheats,Pause gameplay. +Cheat4="Infinite\Lives",800DD252 00?? +Cheat5="Have\All TARZAN Letters",800DD225 00FF +Cheat6="Have\Full Portrait",800DD224 00FF +Cheat7="Infinite\Red Weapon",81192098 0063 +Cheat8="Infinite\Green Weapon",81192096 0063 +Cheat9="Infinite\Purple Weapon",8119209A 0063 +Cheat10="Press GS For\Sabor Attacks\Sabor 1 Hit Kill",8924A23E 0001 +Cheat11="Infinite\Bonus Timer",801735FE 0025 +Cheat4_O=$03 3 Lives,$63 99 Lives +Cheat11_N=This is For All Timers on Bonus Levels + +//---- + +[EC58EABF-AD7C7169-C:45] +Name=Donkey Kong 64 (U) +Cheat0="Donkey Kong\Infinite Ammo",807FCC45 0096 +Cheat1="Infinite\Health",817FCC4C 041F +Cheat2="Donkey Kong\Infinite Musical Instrument",817FC954 0103,817FC958 00FF +Cheat3="Diddy\Infinite Musical Instrument",817FC9B6 000A +Cheat4="Tiny\Infinite Musical Instrument",817FCA72 000A +Cheat5="Lanky\Infinite Musical Instrument",817FCA14 000A +Cheat6="Chunky\Infinite Musical Instrument",817FCAD0 000A +Cheat7="Infinite\Camera Film",807FCC49 0005 +Cheat8="Infinite\Orange Bombs",807FCC41 0096 +Cheat9="Donkey Kong\Infinite Bananas\Jungle Japes",817FC95A 03E7 +Cheat10="Donkey Kong\Infinite Bananas\Angry Aztec",817FC95C 03E7 +Cheat11="Donkey Kong\Infinite Bananas\FactoryLevel",817FC95E 03E7 +Cheat12="Donkey Kong\Infinite Bananas\Galleon Level",817FC9BE 03E7 +Cheat13="Donkey Kong\Infinite Bananas\Fungi Forest",817FC962 03E7 +Cheat14="Donkey Kong\Infinite Bananas\Creepy Castle",817FC966 03E7 +Cheat15="Donkey Kong\Infinite Bananas\Crystal Caves",817FC964 03E7 +Cheat16="Donkey Kong\All Golden Bananas\Jungle Japes",817FC992 03E7 +Cheat17="Donkey Kong\All Golden Bananas\Angry Aztecs",817FC994 03E7 +Cheat18="Donkey Kong\All Golden Bananas\Frantic Factory",817FC996 03E7 +Cheat19="Donkey Kong\All Golden Bananas\Gloomy Galleon",817FC998 03E7 +Cheat20="Donkey Kong\All Golden Bananas\Crystal Caves",817FC99C 03E7 +Cheat21="Donkey Kong\All Golden Bananas\Creepy Castle",817FC99E 03E7 +Cheat22="Donkey Kong\All Golden Bananas\DK Isle",817FC9A0 03E7 +Cheat23="Diddy\All Golden Bananas\Jungle Japes",817FC9F0 0064 +Cheat24="Diddy\All Golden Bananas\Angry Aztecs",817FC9F2 0064 +Cheat25="Diddy\All Golden Bananas\Frantic Factory",817FC9F4 0064 +Cheat26="Diddy\All Golden Bananas\Gloomy Galleon",817FC9F6 0064 +Cheat27="Diddy\All Golden Bananas\Fungi Forest",817FC9F8 0064 +Cheat28="Diddy\All Golden Bananas\Crystal Caves",817FC9FA 0064 +Cheat29="Diddy\All Golden Bananas\Creepy Castle",817FC9FC 0064 +Cheat30="Diddy\All Golden Bananas\DK Isle",817FC9FE 0064 +Cheat31="Tiny\All Golden Bananas\Jungle Japes",817FCAAC 0064 +Cheat32="Tiny\All Golden Bananas\Angry Aztecs",817FCAAE 0064 +Cheat33="Tiny\All Golden Bananas\Frantic Factory",817FCAB0 0064 +Cheat34="Tiny\All Golden Bananas\Gloomy Galleon",817FCAB2 0064 +Cheat35="Tiny\All Golden Bananas\Fungi Forest",817FCAB4 0064 +Cheat36="Tiny\All Golden Bananas\Crystal Caves",817FCAB6 0064 +Cheat37="Tiny\All Golden Bananas\Creepy Castle",817FCAA8 0064 +Cheat38="Tiny\All Golden Bananas\DK Isle",817FCABA 0064 +Cheat39="Lanky\All Golden Bananas\Jungle Japes",817FCA4E 0064 +Cheat40="Lanky\All Golden Bananas\Angry Aztecs",817FCA50 0064 +Cheat41="Lanky\All Golden Bananas\Frantic Factory",817FCA52 0064 +Cheat42="Lanky\All Golden Bananas\Gloomy Galleon",817FCA54 0064 +Cheat43="Lanky\All Golden Bananas\Fungi Forest",817FCA56 0064 +Cheat44="Lanky\All Golden Bananas\Crystal Caves",817FCA58 0064 +Cheat45="Lanky\All Golden Bananas\Creepy Castle",817FCA5A 0064 +Cheat46="Lanky\All Golden Bananas\DK Isle",817FCA5C 0064 +Cheat47="Chunky\All Golden Bananas\Jungle Japes",817FCB0A 0064 +Cheat48="Chunky\All Golden Bananas\Angry Aztecs",817FCB0C 0064 +Cheat49="Chunky\All Golden Bananas\Frantic Factory",817FCB0E 0064 +Cheat50="Chunky\All Golden Bananas\Gloomy Galleon",817FCB10 0064 +Cheat51="Chunky\All Golden Bananas\Fungi Forest",817FCB12 0064 +Cheat52="Chunky\All Golden Bananas\Crystal Caves",817FCB14 0064 +Cheat53="Chunky\All Golden Bananas\Creepy Castle",817FCB16 0064 +Cheat54="Chunky\All Golden Bananas\DK Isle",817FCB18 0064 +Cheat55="Donkey Kong\Infinite Coins",817FC956 03E7 +Cheat56="Diddy\Infinite Coins",817FC9B4 03E7 +Cheat57="Tiny\Infinite Coins",817FCA70 03E7 +Cheat58="Lanky\Infinite Coins",817FCA12 03E7 +Cheat59="Chunky\Infinite Coins",817FCACE 03E7 +Cheat60="Infinite\Crystal Coconuts",807FCB87 0096 +Cheat61="Donkey Kong\Has Moves",817FC950 0103 +Cheat62="Donkey Kong\Have Weapon",817FC952 0103 +Cheat63="Free Pass (Access All Areas)",8066D226 0001,8066D321 0001 +Cheat63_N=This is exactly what it says, You can walk through Any Locked Door,Gate, Or Area. Have Fun. + +//---- + +[A83E101A-E937B69D-C:45] +Name=Doom64 (U) v1.0 +Cheat0="Always Have\Gun",800632C3 0001 +Cheat1="Always Have\Shotgun",800632C7 0001 +Cheat2="Always Have\Double Shotgun",800632CB 0001 +Cheat3="Always Have\Chain Gun",800632CF 0001 +Cheat4="Always Have\Missile Launcher",800632D3 0001 +Cheat5="Always Have\Chainsaw",800632BB 0001 +Cheat6="Always Have\Plasma Rifle",800632D7 0001 +Cheat7="Always Have\BFG 9000",800632DB 0001 +Cheat8="Always Have\Have Rocket Launcher",800632D1 0001 +Cheat9="Always Have\Laser Weapon",800632DD 0001 +Cheat10="Always Have\Bio Suite",80063283 00?? +Cheat10_O=$FF On,$00 Off +Cheat11="Infinite\Armor",8006326F 00FF +Cheat12="Rapid Fire",8106333A 0B94 +Cheat13="Invincible",8006330B 0002 +Cheat14="Turn Map Markers On",8006330B 0004 +Cheat15="Invincible And Map Markers",8006330B 0006 +Cheat16="Berserk Mode",8006327B 00FF +Cheat17="[Max Brightness]",8005A7C8 0064 +Cheat17_N=Enable this cheat on rom load to have Max Brightness (internal) and then put Jabo d3d8 on 160% Max for a extra brightness Boost. +Cheat18="Have All\Weapons",50000A04 0000,810632BA 0001 +Cheat19="Infinite\Ammo All Weapons",50000404 0000,810632E2 013C +Cheat20="Have All\Keys",50000504 0000,8106328E FFFF +Cheat21="Enable Cheat Menu",8005A7D3 0001 + +//---- + +[423E96F4-CE88F05B-C:45] +Name=Doom64 (U) v1.1 +Cheat0="Always Have\Gun",80063373 0001 +Cheat1="Always Have\Shotgun",80063377 0001 +Cheat2="Always Have\Double Shotgun",8006337B 0001 +Cheat3="Always Have\Chain Gun",8006337F 0001 +Cheat4="Always Have\Missile Launcher",80063383 0001 +Cheat5="Always Have\Chainsaw",8006336B 0001 +Cheat6="Always Have\Plasma Rifle",80063387 0001 +Cheat7="Always Have\BFG 9000",8006338B 0001 +Cheat8="Always Have\Have Rocket Launcher",80063381 0001 +Cheat9="Always Have\Laser Weapon",8006338F FFFF +Cheat10="Always Have\Bio Suite",80063333 00?? +Cheat10_O=$FF On,$00 Off +Cheat11="Infinite\Armor",8006331F 00FF +Cheat12="Rapid Fire",810633EA 0B94 +Cheat13="Invincible",800633BB 0002 +Cheat14="Turn Map Markers On",800633BB 0004 +Cheat15="Invincible And Map Markers",800633BB 0006 +Cheat16="Berserk Mode",8006332B 00FF +Cheat17="[Max Brightness]",8005A878 0064 +Cheat17_N=Enable this cheat on rom load to have Max Brightness (internal) and then put Jabo d3d8 on 160% Max for a extra brightness Boost. +Cheat18="Infinite\Ammo All Weapons",80063393 00FF,80063397 00FF,8006339B 00FF,8006339F 00FF +Cheat19="Have All Keys",8006333F 0001,80063343 0001,80063344 0001,80063353 0001,8006334F 0001,80063348 0001 +Cheat20="Enable Cheat Menu",8005A883 0001 + +//---- + +[A62230C3-F0834488-C:45] +Name=Dual Heroes (U) +Cheat0="Player 1\Infinite Energy",D022671C 0000,8122671C 00FA +Cheat1="Player 2\Infinite Energy",D022671E 0000,8122671E 00FA +Cheat2="Infinite Time",D0226724 0000,81226724 003C +Cheat3="Player 1\Never Wins",D0226715 0001,80226715 0000 +Cheat4="Player 2\1 Win To Win",D0226717 0000,80226717 0001 +Cheat5="Player 2\Never Wins",D0226717 0001,80226717 0000 +Cheat6="Player 1\1 Win To Win",D0226715 0000,80226715 0001 +Cheat7="Player 1\No Energy",D022671C 0000,8122671C 0000 +Cheat8="Player 2\No Energy",D022671E 0000,8122671E 0000 +Cheat9="Player 1\Infinite Time To Continue",802267CB 0009,803CF2A1 0009 +Cheat10="Only Play One Round",D0226791 0000,81226718 0001 +Cheat11="Player 2\Lifebar Flashes Red",D022672E 0000,8122672E 00CF + +//---- + +[FBB9F1FA-6BF88689-C:45] +Name=Duck Dodgers Starring Daffy Duck (U) +Cheat0="Infinite\Lives",80026A67 0063 +Cheat1="Infinite\Quarks",81159282 FFFF +Cheat2="Infinite\Atoms",81159286 FFFF + +//---- + +[A273AB56-DA33DB9A-C:45] +Name=Duke Nukem 64 (U) +Cheat0="In-Game Cheats\Open Cheat Menu",801012D8 0001 +Cheat1="In-Game Cheats\Open Invincibility Cheat",801012DC 0001 +Cheat2="In-Game Cheats\Open Monsters Cheat",801012E0 0001 +Cheat3="In-Game Cheats\Open All Items Cheat",801012E4 0001 +Cheat4="In-Game Cheats\Open Goto Level ?? Cheat",801012E8 0001 +Cheat5="Infinite Night Vision",812A5A5C 0640 +Cheat6="Infinite Holoduke",812A5A2C 0640 +Cheat7="Infinite Portable Medikit",812A5A4A 0064 +Cheat8="Infinite Protective Boots",812A5AA2 00C8 +Cheat9="In-Game Cheats\Invincibility Cheat On",802AAA68 0001 +Cheat10="In-Game Cheats\Invincibility Cheat Off",802AAA68 0000 +Cheat11="In-Game Cheats\Monsters Cheat On",802AABDB 0000 +Cheat12="In-Game Cheats\Monsters Cheat Off",802AABDB 0001 +Cheat13="Infinite\Armor",812A5A92 0064 +Cheat14="Infinite\Vitamin K",812A5A90 0190 +Cheat15="Infinite\Jet Pack",812A5A8E 0640 +Cheat16="Infinite\Scuba Gear",812A5A8C 1900 +Cheat17="Have All Keys",802A5A47 000F +Cheat18="Player 1\Infinite Health\Hollywood Holocaust",80247463 00FF +Cheat19="Player 1\Infinite Health\Gun Crazy",80247D53 00FF +Cheat20="Player 1\Infinite Health\Death Row",80246E5F 00FF +Cheat21="Player 1\Infinite Health\Toxic Dump",80246D83 00FF +Cheat22="Player 1\Infinite Health\Launch Facility",80248223 00FF +Cheat23="Player 1\Infinite Health\The Abyss",80246E07 00FF +Cheat24="Player 1\Infinite Health\Battleload",80246F67 00FF +Cheat25="Player 1\Infinite Health\Duke Burger",8024761B 00FF +Cheat26="Player 1\Infinite Health\Spaceport",8024735B 00FF +Cheat27="Player 1\Infinite Health\Incubator",80246D2B 00FF +Cheat28="Player 1\Infinite Health\Warp Factor",8024709B 00FF +Cheat29="Player 1\Infinite Health\Fusion Station",80247723 00FF +Cheat30="Player 1\Infinite Health\Occupied Territory",80246DDB 00FF +Cheat31="Player 1\Infinite Health\Tiberius Station",80246CA7 00FF +Cheat32="Player 1\Infinite Health\Lunar Reactor",80246C4F 00FF +Cheat33="Player 1\Infinite Health\Dark Side",802473B3 00FF +Cheat34="Player 1\Infinite Health\Dread Nought",80246D2B 00FF +Cheat35="Player 1\Infinite Health\Overlord",80247513 00FF +Cheat36="Player 1\Infinite Health\Lunatic Fringe",80246D2B 00FF +Cheat37="Player 1\Infinite Health\Raw Meat",80246DDB 00FF +Cheat38="Player 1\Infinite Health\Bank Roll",802471A3 00FF +Cheat39="Player 1\Infinite Health\Flood Zone",80246D2B 00FF +Cheat40="Player 1\Infinite Health\L.A. Rumble",80246EE3 00FF +Cheat41="Player 1\Infinite Health\Movie Set",80246DAF 00FF +Cheat42="Player 1\Infinite Health\Rabit Transit",8024869B 00FF +Cheat43="Player 1\Infinite Health\Fahrenheith",8024735B 00FF +Cheat44="Player 1\Infinite Health\Hotel Hell",80246D83 00FF +Cheat45="Player 1\Infinite Health\Stadium",8024979F 00FF +Cheat46="Player 1\Infinite Health\Area 51",8024774F 00FF +Cheat47="Player 1\Infinite Health\Free Way",80247E5B 00FF +Cheat48="Player 1\Infinite Health\Castle Dukenstein",802490BF 00FF +Cheat49="Player 1\Infinite Health\Piracy",80247673 00FF +Cheat50="Player 1\Infinite Health\Shaft",80247AEB 00FF +Cheat51="Player 1\Infinite Health\Noctis Labyrinthus",80247C1F 00FF +Cheat52="Player 2\Infinite Health\Hollywood Holocaust",8124D526 00FF +Cheat53="Player 2\Infinite Health\Gun Crazy",8124E57A 00FF +Cheat54="Player 2\Infinite Health\Death Row",8124AFAE 00FF +Cheat55="Player 2\Infinite Health\Toxic Dump",81251BCA 00FF +Cheat56="Player 2\Infinite Health\Launch Facility",8124AEA6 00FF +Cheat57="Player 2\Infinite Health\The Abyss",8124FD5E 00FF +Cheat58="Player 2\Infinite Health\BattleLord",81246CFE 00FF +Cheat59="Player 2\Infinite Health\Spaceport",8124B13A 00FF +Cheat60="Player 2\Infinite Health\Incubator",8124CEF6 00FF +Cheat61="Player 2\Infinite Health\Warp Factor",8124ED8E 00FF +Cheat62="Player 2\Infinite Health\Fusion Station",81250336 00FF +Cheat63="Player 2\Infinite Health\Occupied Territory",8124AC96 00FF +Cheat64="Player 2\Infinite Health\Tiberius Station",8124C8F2 00FF +Cheat65="Player 2\Infinite Health\Lunar Reactor",81247C1E 00FF +Cheat66="Player 2\Infinite Health\Dark Side",8124E1DE 00FF +Cheat67="Player 2\Infinite Health\Dreadnought",81249562 00FF +Cheat68="Player 2\Infinite Health\Overlord",81247646 00FF +Cheat69="Player 2\Infinite Health\Raw Meat",8124E052 00FF +Cheat70="Player 2\Infinite Health\Bank Roll",8124DE6E 00FF +Cheat71="Player 2\Infinite Health\Flood Zone",8124D736 00FF +Cheat72="Player 2\Infinite Health\L.A. Rumble",8124BF52 00FF +Cheat73="Player 2\Infinite Health\Movie Set",81248382 00FF +Cheat74="Player 2\Infinite Health\Rabid Transit",8124D86A 00FF +Cheat75="Player 2\Infinite Health\Fahrenheit",8124A1C2 00FF +Cheat76="Player 2\Infinite Health\Hotel Hell",8124D526 00FF +Cheat77="Player 2\Infinite Health\Stadium",8124924A 00FF +Cheat78="Player 2\Infinite Health\Castle Dukenstein",81249092 00FF +Cheat79="Player 2\Infinite Health\Piracy",81248ABA 00FF +Cheat80="Player 2\Infinite Health\Shaft",812477A6 00FF +Cheat81="Player 3\Infinite Health\Hollywood Holocaust",8124BC0E 00FF +Cheat82="Player 3\Infinite Health\Gun Crazy",8124C086 00FF +Cheat83="Player 3\Infinite Health\Death Row",8124AF2A 00FF +Cheat84="Player 3\Infinite Health\Toxic Dump",8125051A 00FF +Cheat85="Player 3\Infinite Health\Launch Facility",8124AD9E 00FF +Cheat86="Player 3\Infinite Health\The Abyss",8124FD32 00FF +Cheat87="Player 3\Infinite Health\BattleLord",81246CD2 00FF +Cheat88="Player 3\Infinite Health\Spaceport",8124B10E 00FF +Cheat89="Player 3\Infinite Health\Incubator",8124B1EA 00FF +Cheat90="Player 3\Infinite Health\Warp Factor",812482FE 00FF +Cheat91="Player 3\Infinite Health\Fusion Station",8125030A 00FF +Cheat92="Player 3\Infinite Health\Occupied Territory",8124AC6A 00FF +Cheat93="Player 3\Infinite Health\Tiberius Station",8124C8C6 00FF +Cheat94="Player 3\Infinite Health\Lunar Reactor",81247BF2 00FF +Cheat95="Player 3\Infinite Health\Dark Side",8124E1B2 00FF +Cheat96="Player 3\Infinite Health\Dreadnought",81249536 00FF +Cheat97="Player 3\Infinite Health\Overlord",81246EB6 00FF +Cheat98="Player 3\Infinite Health\Raw Meat",8124E026 00FF +Cheat99="Player 3\Infinite Health\Bank Roll",8124992A 00FF +Cheat100="Player 3\Infinite Health\Flood Zone",8124D70A 00FF +Cheat101="Player 3\Infinite Health\L.A. Rumble",8124BF26 00FF +Cheat102="Player 3\Infinite Health\Movie Set",81248356 00FF +Cheat103="Player 3\Infinite Health\Rabid Transit",8124D83E 00FF +Cheat104="Player 3\Infinite Health\Fahrenheit",8124A196 00FF +Cheat105="Player 3\Infinite Health\Hotel Hell",8124D4FA 00FF +Cheat106="Player 3\Infinite Health\Stadium",8124921E 00FF +Cheat107="Player 3\Infinite Health\Castle Dukenstein",81248432 00FF +Cheat108="Player 3\Infinite Health\Piracy",81248A8E 00FF +Cheat109="Player 3\Infinite Health\Shaft",8124777A 00FF +Cheat110="Player 4\Infinite Health\Hollywood Holocaust",8124B76A 00FF +Cheat111="Player 4\Infinite Health\Gun Crazy",8124B922 00FF +Cheat112="Player 4\Infinite Health\Death Row",8124AEFE 00FF +Cheat113="Player 4\Infinite Health\Toxic Dump",8124DDBE 00FF +Cheat114="Player 4\Infinite Health\Launch Facility",8124AD1A 00FF +Cheat115="Player 4\Infinite Health\The Abyss",8124E3C2 00FF +Cheat116="Player 4\Infinite Health\BattleLord",81246CA6 00FF +Cheat117="Player 4\Infinite Health\Spaceport",8124979E 00FF +Cheat118="Player 4\Infinite Health\Incubator",81247F0A 00FF +Cheat119="Player 4\Infinite Health\Warp Factor",812482D2 00FF +Cheat120="Player 4\Infinite Health\Fusion Station",81248172 00FF +Cheat121="Player 4\Infinite Health\Occupied Territory",8124AC3E 00FF +Cheat122="Player 4\Infinite Health\Tiberius Station",8124C89A 00FF +Cheat123="Player 4\Infinite Health\Lunar Reactor",81247BC6 00FF +Cheat124="Player 4\Infinite Health\Dark Side",81247932 00FF +Cheat125="Player 4\Infinite Health\Dreadnought",8124950A 00FF +Cheat126="Player 4\Infinite Health\Overlord",81246E8A 00FF +Cheat127="Player 4\Infinite Health\Raw Meat",8124DFFA 00FF +Cheat128="Player 4\Infinite Health\Bank Roll",812498FE 00FF +Cheat129="Player 4\Infinite Health\Flood Zone",81247F36 00FF +Cheat130="Player 4\Infinite Health\L.A. Rumble",8124A3A6 00FF +Cheat131="Player 4\Infinite Health\Movie Set",8124832A 00FF +Cheat132="Player 4\Infinite Health\Rabid Transit",8124B1BE 00FF +Cheat133="Player 4\Infinite Health\Fahrenheit",8124A16A 00FF +Cheat134="Player 4\Infinite Health\Hotel Hell",8124C68A 00FF +Cheat135="Player 4\Infinite Health\Stadium",812491C6 00FF +Cheat136="Player 4\Infinite Health\Castle Dukenstein",81248406 00FF +Cheat137="Player 4\Infinite Health\Piracy",81248A62 00FF +Cheat138="Player 4\Infinite Health\Shaft",8124774E 00FF +Cheat139="Player 1\Have\Boots",802A5AB9 0001 +Cheat140="Player 1\Have\Pistol",802A5ABA 0001 +Cheat141="Player 1\Have\Shotgun",802A5ABB 0001 +Cheat142="Player 1\Have\SMG",802A5ABC 0001 +Cheat143="Player 1\Have\Grenade Launcher",802A5ABD 0001 +Cheat144="Player 1\Have\Pipe Bombs",802A5ABE 0001 +Cheat145="Player 1\Have\Shrinker",802A5ABF 0001 +Cheat146="Player 1\Have\Expander",802A5AC0 0001 +Cheat147="Player 1\Have\Missile Launcher",802A5AC1 0001 +Cheat148="Player 1\Have\Plasma Cannon",802A5AC2 0001 +Cheat149="Player 1\Have\Laser Trip Bomb",802A5AC3 0001 +Cheat150="Player 1\Infinite Ammo\Pistol",802A5A01 00FF +Cheat151="Player 1\Infinite Ammo\Shotgun",802A5A03 00FF +Cheat152="Player 1\Infinite Ammo\SMG's",802A5A05 00FF +Cheat153="Player 1\Infinite Ammo\Grenade Launcher",802A5A07 00FF +Cheat154="Player 1\Infinite Ammo\Pipe Bombs",802A5A09 00FF +Cheat155="Player 1\Infinite Ammo\Shrinker",802A5A0B 00FF +Cheat156="Player 1\Infinite Ammo\Expander",802A5A0D 00FF +Cheat157="Player 1\Infinite Ammo\Missile Launcher",802A5A0F 00FF +Cheat158="Player 1\Infinite Ammo\Plasma Cannon",802A5A11 00FF +Cheat159="Player 1\Infinite Ammo\Laser Trip Bomb",802A5A13 00FF +Cheat160="Player 2\Have\Boots",802A5E45 0001 +Cheat161="Player 2\Have\Pistol",802A5E46 0001 +Cheat162="Player 2\Have\Shotgun",802A5E47 0001 +Cheat163="Player 2\Have\SMG",802A5E48 0001 +Cheat164="Player 2\Have\Grenade Launcher",802A5E49 0001 +Cheat165="Player 2\Have\Pipe Bomb",802A5E4A 0001 +Cheat166="Player 2\Have\Shrinker",802A5E4B 0001 +Cheat167="Player 2\Have\Expander",802A5E4C 0001 +Cheat168="Player 2\Have\Missle Launcher",802A5E4D 0001 +Cheat169="Player 2\Have\Plasma Cannon",802A5E4E 0001 +Cheat170="Player 2\Have\Laser Trip Bomb",802A5E4F 0001 +Cheat171="Player 2\Infinite Ammo\Pistol",802A5D8C 00FF +Cheat172="Player 2\Infinite Ammo\Shotgun",802A5D8F 00FF +Cheat173="Player 2\Infinite Ammo\SMG's",802A5D91 00FF +Cheat174="Player 2\Infinite Ammo\Grenade Launcher",802A5D93 00FF +Cheat175="Player 2\Infinite Ammo\Pipe Bombs",802A5D95 00FF +Cheat176="Player 2\Infinite Ammo\Shrinker",802A5D97 00FF +Cheat177="Player 2\Infinite Ammo\Expander",802A5D99 00FF +Cheat178="Player 2\Infinite Ammo\Missile Launcher",802A5D9B 00FF +Cheat179="Player 2\Infinite Ammo\Laser Trip Bomb",802A5D9D 00FF +Cheat180="Player 2\Infinite Ammo\Plasma Cannon",802A5D9F 00FF +Cheat181="Player 3\Have\Boots",802A61D1 0001 +Cheat182="Player 3\Have\Pistol",802A61D2 0001 +Cheat183="Player 3\Have\Shotgun",802A61D3 0001 +Cheat184="Player 3\Have\SMG",802A61D4 0001 +Cheat185="Player 3\Have\Grenade Launcher",802A61D5 0001 +Cheat186="Player 3\Have\Pipe Bomb",802A61D6 0001 +Cheat187="Player 3\Have\Shrinker",802A61D7 0001 +Cheat188="Player 3\Have\Expander",802A61D8 0001 +Cheat189="Player 3\Have\Missle Launcher",802A61D9 0001 +Cheat190="Player 3\Have\Plasma Cannon",802A61DA 0001 +Cheat191="Player 3\Have\Laser Trip Bomb",802A61DB 0001 +Cheat192="Player 3\Infinite Ammo\Pistol",802A6119 00FF +Cheat193="Player 3\Infinite Ammo\Shotgun",802A611B 00FF +Cheat194="Player 3\Infinite Ammo\SMG's",802A611D 00FF +Cheat195="Player 3\Infinite Ammo\Grenade Launcher",802A611F 00FF +Cheat196="Player 3\Infinite Ammo\Pipe Bombs",802A6121 00FF +Cheat197="Player 3\Infinite Ammo\Shrinker",802A6123 00FF +Cheat198="Player 3\Infinite Ammo\Expander",802A6125 00FF +Cheat199="Player 3\Infinite Ammo\Missile Launcher",802A6127 00FF +Cheat200="Player 3\Infinite Ammo\Laser Trip Bomb",802A6129 00FF +Cheat201="Player 3\Infinite Ammo\Plasma Cannon",802A612B 00FF +Cheat202="Player 4\Have\Boots",802A655D 0001 +Cheat203="Player 4\Have\Pistol",802A655E 0001 +Cheat204="Player 4\Have\SMG",802A655F 0001 +Cheat205="Player 4\Have\Submachine Guns",802A6560 0001 +Cheat206="Player 4\Have\Grenade Launcher",802A6561 0001 +Cheat207="Player 4\Have\Pipe Bomb",802A6562 0001 +Cheat208="Player 4\Have\Shrinker",802A6563 0001 +Cheat209="Player 4\Have\Expander",802A6564 0001 +Cheat210="Player 4\Have\Missle Launcher",802A6565 0001 +Cheat211="Player 4\Have\Plasma Cannon",802A6566 0001 +Cheat212="Player 4\Have\Laser Trip Bomb",802A6567 0001 +Cheat213="Player 4\Infinite Ammo\Pistol",802A64A5 00FF +Cheat214="Player 4\Infinite Ammo\Shotgun",802A64A7 00FF +Cheat215="Player 4\Infinite Ammo\SMG's",802A64A9 00FF +Cheat216="Player 4\Infinite Ammo\Grenade Launcher",802A64AB 00FF +Cheat217="Player 4\Infinite Ammo\Pipe Bombs",802A64AD 00FF +Cheat218="Player 4\Infinite Ammo\Shrinker",802A64AF 00FF +Cheat219="Player 4\Infinite Ammo\Expander",802A64B1 00FF +Cheat220="Player 4\Infinite Ammo\Missile Launcher",802A64B3 00FF +Cheat221="Player 4\Infinite Ammo\Laser Trip Bomb",802A64B5 00FF +Cheat222="Player 4\Infinite Ammo\Plasma Cannon",802A64B7 00FF + +//---- + +[DF574191-9EB5123D-C:45] +Name=Earthworm Jim 3D (U) +Cheat0="Infinite Egg Chucker Ammo",800C69BF 00FA +Cheat1="Infinite Cleaver Ammo",800C6A1F 00FA +Cheat2="Infinite Blaster Ammo",810C6916 03E7 +Cheat3="Infinite Rocket Launcher Ammo",810C6946 03E7 +Cheat4="Infinite Banana Peel Ammo",810C6976 03E7 +Cheat5="Infinite Green Slimer Ammo",810C69A6 03E7 +Cheat6="Infinite Shotgun Ammo",810C69EE 03E7 +Cheat7="Infinite Music Gun Ammo",810C6A06 03E7 +Cheat8="Infinite Boomerang Knives Ammo",810C6A1E 03E7 +Cheat9="Infinite Mushroom Ammo",810C6E36 03E7 +Cheat10="Have 231 Marbles",D00E9FF3 0000,800E9FF3 03E7 +Cheat11="Infinite Health",800C690F 0064 +Cheat12="Infinite Lives",800C6913 0063 +Cheat13="Infinite Laser Ammo",800C6917 00FA +Cheat14="Have All Gold Udders",50002802 0000,810C625A 0101 + +//---- + +[BDF9766D-BD068D70-C:45] +Name=ECW Hardcore Revolut (U) +Cheat0="VS & Tournment Mode\Player 1\Infinite Health",D02931FD 0029,81293380 0000,D02931FD 0029,81293382 0000 +Cheat1="VS & Tournment Mode\Player 1\Infinite Health",D02931FD 0029,81293380 00FF,D02931FD 0029,81293382 00FF +Cheat2="VS & Tournment Mode\Player 1\Super Strength",D02931FD 0029,812933DA FFFF +Cheat3="VS & Tournment Mode\Player 1\Invincible",D02931FD 0029,812933DE FFFF +Cheat4="VS & Tournment Mode\Player 1\Super Speed",D02931FD 0029,812933E2 FFFF +Cheat5="VS & Tournment Mode\Player 1\Super Stamina",D02931FD 0029,812933E6 FFFF +Cheat6="VS & Tournment Mode\Player 1\Instant Recovery",D02931FD 0029,812933EA FFFF +Cheat7="VS & Tournment Mode\Player 1\Can't Be Pinned",D02931FD 0029,8129330A FFFF +Cheat8="VS & Tournment Mode\Player 1\Can't Be Counted Out",D02931FD 0029,8129327E 0384 +Cheat9="VS & Tournment Mode\Player 2\Infinite Health",D02931FD 0029,81294620 0000,D02931FD 0029,81294622 0000 +Cheat10="VS & Tournment Mode\Player 2\Infinite Health",D02931FD 0029,81294620 00FF,D02931FD 0029,81294622 00FF +Cheat11="VS & Tournment Mode\Player 2\Super Strength",D02931FD 0029,8129467A FFFF +Cheat12="VS & Tournment Mode\Player 2\Invincible",D02931FD 0029,8129467E FFFF +Cheat13="VS & Tournment Mode\Player 2\Super Speed",D02931FD 0029,81294682 FFFF +Cheat14="VS & Tournment Mode\Player 2\Super Stamina",D02931FD 0029,81294686 FFFF +Cheat15="VS & Tournment Mode\Player 2\Instant Recovery",D02931FD 0029,8129468A FFFF +Cheat16="VS & Tournment Mode\Player 2\Can't Be Pinned",D02931FD 0029,812945AA FFFF +Cheat17="VS & Tournment Mode\Player 2\Can't Be Counted Out",D02931FD 0029,8129451E 0384 +Cheat18="All Tag Team Modes\Player 1\Infinite Health",D029A98D 0029,8129AB10 0000,D029A98D 0029,8129AB12 0000 +Cheat19="All Tag Team Modes\Player 1\Infinite Health",D029A98D 0029,8129AB10 00FF,D029A98D 0029,8129AB12 00FF +Cheat20="All Tag Team Modes\Player 1\Super Strength",D029A98D 0029,8129AB6A FFFF +Cheat21="All Tag Team Modes\Player 1\Invincible",D029A98D 0029,8129AB6E FFFF +Cheat22="All Tag Team Modes\Player 1\Super Speed",D029A98D 0029,8129AB72 FFFF +Cheat23="All Tag Team Modes\Player 1\Super Stamina",D029A98D 0029,8129AB76 FFFF +Cheat24="All Tag Team Modes\Player 1\Instant Recovery",D029A98D 0029,8129AB7A FFFF +Cheat25="All Tag Team Modes\Player 1\Can't Be Pinned",D029A98D 0029,8129AA9A FFFF +Cheat26="All Tag Team Modes\Player 1\Can't Be Counted Out",D029A98D 0029,8129AA0E 0384 +Cheat27="All Tag Team Modes\Player 2\Infinite Health",D029A98D 0029,8129BDB0 0000,D029A98D 0029,8129BDB2 0000 +Cheat28="All Tag Team Modes\Player 2\Infinite Health",D029A98D 0029,8129BDB0 00FF,D029A98D 0029,8129BDB2 00FF +Cheat29="All Tag Team Modes\Player 2\Super Strength",D029A98D 0029,8129BE0A FFFF +Cheat30="All Tag Team Modes\Player 2\Invincible",D029A98D 0029,8129BE0E FFFF +Cheat31="All Tag Team Modes\Player 2\Super Speed",D029A98D 0029,8129BE12 FFFF +Cheat32="All Tag Team Modes\Player 2\Super Stamina",D029A98D 0029,8129BE16 FFFF +Cheat33="All Tag Team Modes\Player 2\Instant Recovery",D029A98D 0029,8129BE1A FFFF +Cheat34="All Tag Team Modes\Player 2\Can't Be Pinned",D029A98D 0029,8129BD3A FFFF +Cheat35="All Tag Team Modes\Player 2\Can't Be Counted Out",D029A98D 0029,8129BCAE 0384 +Cheat36="All Tag Team Modes\Player 3\Infinite Health",D029A98D 0029,8129D050 0000,D029A98D 0029,8129D052 0000 +Cheat37="All Tag Team Modes\Player 3\Infinite Health",D029A98D 0029,8129D050 00FF,D029A98D 0029,8129D052 00FF +Cheat38="All Tag Team Modes\Player 3\Super Strength",D029A98D 0029,8129D0AA FFFF +Cheat39="All Tag Team Modes\Player 3\Invincible",D029A98D 0029,8129D0AE FFFF +Cheat40="All Tag Team Modes\Player 3\Super Speed",D029A98D 0029,8129D0B2 FFFF +Cheat41="All Tag Team Modes\Player 3\Super Stamina",D029A98D 0029,8129D0B6 FFFF +Cheat42="All Tag Team Modes\Player 3\Instant Recovery",D029A98D 0029,8129D0BA FFFF +Cheat43="All Tag Team Modes\Player 3\Can't Be Pinned",D029A98D 0029,8129CFDA FFFF +Cheat44="All Tag Team Modes\Player 3\Can't Be Counted Out",D029A98D 0029,8129CF4E 0384 +Cheat45="All Tag Team Modes\Player 4\Infinite Health",D029A98D 0029,8129E2F0 0000,D029A98D 0029,8129E2F2 0000 +Cheat46="All Tag Team Modes\Player 4\Infinite Health",D029A98D 0029,8129E2F0 00FF,D029A98D 0029,8129E2F2 00FF +Cheat47="All Tag Team Modes\Player 4\Super Strength",D029A98D 0029,8129E34A FFFF +Cheat48="All Tag Team Modes\Player 4\Invincible",D029A98D 0029,8129E34E FFFF +Cheat49="All Tag Team Modes\Player 4\Super Speed",D029A98D 0029,8129E352 FFFF +Cheat50="All Tag Team Modes\Player 4\Super Stamina",D029A98D 0029,8129E356 FFFF +Cheat51="All Tag Team Modes\Player 4\Instant Recovery",D029A98D 0029,8129E35A FFFF +Cheat52="All Tag Team Modes\Player 4\Can't Be Pinned",D029A98D 0029,8129E27A FFFF +Cheat53="All Tag Team Modes\Player 4\Can't Be Counted Out",D029A98D 0029,8129E1EE 0384 +Cheat54="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 1\Infinite Health",D029A87D 0029,8129AA00 0000,D029A87D 0029,8129AA02 0000 +Cheat55="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 1\Infinite Health",D029A87D 0029,8129AA00 00FF,D029A87D 0029,8129AA02 00FF +Cheat56="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 1\Super Strength",D029A87D 0029,8129AA5A FFFF +Cheat57="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 1\Invincible",D029A87D 0029,8129AA5E FFFF +Cheat58="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 1\Super Speed",D029A87D 0029,8129AA62 FFFF +Cheat59="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 1\Super Stamina",D029A87D 0029,8129AA66 FFFF +Cheat60="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 1\Instant Recovery",D029A87D 0029,8129AA6A FFFF +Cheat61="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 1\Can't Be Pinned",D029A87D 0029,8129A98A FFFF +Cheat62="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 1\Can't Be Counted Out",D029A87D 0029,8129A8FE 0384 +Cheat63="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 2\Infinite Health",D029A87D 0029,8129BCA0 0000,D029A87D 0029,8129BCA2 0000 +Cheat64="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 2\Infinite Health",D029A87D 0029,8129BCA0 00FF,D029A87D 0029,8129BCA2 00FF +Cheat65="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 2\Super Strength",D029A87D 0029,8129BCFA FFFF +Cheat66="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 2\Invincible",D029A87D 0029,8129BCFE FFFF +Cheat67="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 2\Super Speed",D029A87D 0029,8129BD02 FFFF +Cheat68="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 2\Super Stamina",D029A87D 0029,8129BD06 FFFF +Cheat69="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 2\Instant Recovery",D029A87D 0029,8129BD0A FFFF +Cheat70="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 2\Can't Be Pinned",D029A87D 0029,8129BC2A FFFF +Cheat71="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 2\Can't Be Counted Out",D029A87D 0029,8129BB9E 0384 +Cheat72="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 3\Infinite Health",D029A87D 0029,8129CF40 0000,D029A87D 0029,8129CF42 0000 +Cheat73="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 3\Infinite Health",D029A87D 0029,8129CF40 00FF,D029A87D 0029,8129CF42 00FF +Cheat74="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 3\Super Strength",D029A87D 0029,8129CF9A FFFF +Cheat75="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 3\Invincible",D029A87D 0029,8129CF9E FFFF +Cheat76="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 3\Super Speed",D029A87D 0029,8129CFA2 FFFF +Cheat77="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 3\Super Stamina",D029A87D 0029,8129CFA6 FFFF +Cheat78="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 3\Instant Recovery",D029A87D 0029,8129CFAA FFFF +Cheat79="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 3\Can't Be Pinned",D029A87D 0029,8129CECA FFFF +Cheat80="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 3\Can't Be Counted Out",D029A87D 0029,8129CE3E 0384 +Cheat81="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 4\Infinite Health",D029A87D 0029,8129E1E0 0000,D029A87D 0029,8129E1E2 0000 +Cheat82="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 4\Infinite Health",D029A87D 0029,8129E1E0 00FF,D029A87D 0029,8129E1E2 00FF +Cheat83="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 4\Super Strength",D029A87D 0029,8129E23A FFFF +Cheat84="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 4\Invincible",D029A87D 0029,8129E23E FFFF +Cheat85="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 4\Super Speed",D029A87D 0029,8129E242 FFFF +Cheat86="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 4\Super Stamina",D029A87D 0029,8129E246 FFFF +Cheat87="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 4\Instant Recovery",D029A87D 0029,8129E24A FFFF +Cheat88="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 4\Can't Be Pinned",D029A87D 0029,8129E16A FFFF +Cheat89="Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 4\Can't Be Counted Out",D029A87D 0029,8129E0DE 0384 +Cheat90="Battle Royal Mode\Player 1\Infinite Health",D029A66D 0029,8129A7F0 0000,D029A66D 0029,8129A7F2 0000 +Cheat91="Battle Royal Mode\Player 1\Infinite Health",D029A66D 0029,8129A7F0 00FF,D029A66D 0029,8129A7F2 00FF +Cheat92="Battle Royal Mode\Player 1\Super Strength",D029A66D 0029,8129A84A FFFF +Cheat93="Battle Royal Mode\Player 1\Invincible",D029A66D 0029,8129A84E FFFF +Cheat94="Battle Royal Mode\Player 1\Super Speed",D029A66D 0029,8129A852 FFFF +Cheat95="Battle Royal Mode\Player 1\Super Stamina",D029A66D 0029,8129A856 FFFF +Cheat96="Battle Royal Mode\Player 1\Instant Recovery",D029A66D 0029,8129A85A FFFF +Cheat97="Battle Royal Mode\Player 1\Can't Be Pinned",D029A66D 0029,8129A77A FFFF +Cheat98="Battle Royal Mode\Player 1\Can't Be Counted Out",D029A66D 0029,8129A6EE 0384 +Cheat99="Battle Royal Mode\Player 2\Infinite Health",D029A66D 0029,8129BA90 0000,D029A66D 0029,8129BA92 0000 +Cheat100="Battle Royal Mode\Player 2\Infinite Health",D029A66D 0029,8129BA90 00FF,D029A66D 0029,8129BA92 00FF +Cheat101="Battle Royal Mode\Player 2\Super Strength",D029A66D 0029,8129BAEA FFFF +Cheat102="Battle Royal Mode\Player 2\Invincible",D029A66D 0029,8129BAEE FFFF +Cheat103="Battle Royal Mode\Player 2\Super Speed",D029A66D 0029,8129BAF2 FFFF +Cheat104="Battle Royal Mode\Player 2\Super Stamina",D029A66D 0029,8129BAF6 FFFF +Cheat105="Battle Royal Mode\Player 2\Instant Recovery",D029A66D 0029,8129BAFA FFFF +Cheat106="Battle Royal Mode\Player 2\Can't Be Pinned",D029A66D 0029,8129BA1A FFFF +Cheat107="Battle Royal Mode\Player 2\Can't Be Counted Out",D029A66D 0029,8129B98E 0384 +Cheat108="Battle Royal Mode\Player 3\Infinite Health",D029A66D 0029,8129CD30 0000,D029A66D 0029,8129CD32 0000 +Cheat109="Battle Royal Mode\Player 3\Infinite Health",D029A66D 0029,8129CD30 00FF,D029A66D 0029,8129CD32 00FF +Cheat110="Battle Royal Mode\Player 3\Super Strength",D029A66D 0029,8129CD8A FFFF +Cheat111="Battle Royal Mode\Player 3\Invincible",D029A66D 0029,8129CD8E FFFF +Cheat112="Battle Royal Mode\Player 3\Super Speed",D029A66D 0029,8129CD92 FFFF +Cheat113="Battle Royal Mode\Player 3\Super Stamina",D029A66D 0029,8129CD96 FFFF +Cheat114="Battle Royal Mode\Player 3\Instant Recovery",D029A66D 0029,8129CD9A FFFF +Cheat115="Battle Royal Mode\Player 3\Can't Be Pinned",D029A66D 0029,8129CCBA FFFF +Cheat116="Battle Royal Mode\Player 3\Can't Be Counted Out",D029A66D 0029,8129CC2E 0384 +Cheat117="Battle Royal Mode\Player 4\Infinite Health",D029A66D 0029,8129DFD0 0000,D029A66D 0029,8129DFD2 0000 +Cheat118="Battle Royal Mode\Player 4\Infinite Health",D029A66D 0029,8129DFD0 00FF,D029A66D 0029,8129DFD2 00FF +Cheat119="Battle Royal Mode\Player 4\Super Strength",D029A66D 0029,8129E02A FFFF +Cheat120="Battle Royal Mode\Player 4\Invincible",D029A66D 0029,8129E02E FFFF +Cheat121="Battle Royal Mode\Player 4\Super Speed",D029A66D 0029,8129E032 FFFF +Cheat122="Battle Royal Mode\Player 4\Super Stamina",D029A66D 0029,8129E036 FFFF +Cheat123="Battle Royal Mode\Player 4\Instant Recovery",D029A66D 0029,8129E03A FFFF +Cheat124="Battle Royal Mode\Player 4\Can't Be Pinned",D029A66D 0029,8129DF5A FFFF +Cheat125="Battle Royal Mode\Player 4\Can't Be Counted Out",D029A66D 0029,8129DECE 0384 +Cheat126="1 On 2 & 2 On 1 Modes\Player 1\Infinite Health",D0296E4D 0029,81296FD0 0000,D0296E4D 0029,81296FD2 0000 +Cheat127="1 On 2 & 2 On 1 Modes\Player 1\Infinite Health",D0296E4D 0029,81296FD0 00FF,D0296E4D 0029,81296FD2 00FF +Cheat128="1 On 2 & 2 On 1 Modes\Player 1\Super Strength",D0296E4D 0029,8129702A FFFF +Cheat129="1 On 2 & 2 On 1 Modes\Player 1\Invincible",D0296E4D 0029,8129702E FFFF +Cheat130="1 On 2 & 2 On 1 Modes\Player 1\Super Speed",D0296E4D 0029,81297032 FFFF +Cheat131="1 On 2 & 2 On 1 Modes\Player 1\Super Stamina",D0296E4D 0029,81297036 FFFF +Cheat132="1 On 2 & 2 On 1 Modes\Player 1\Instant Recovery",D0296E4D 0029,8129703A FFFF +Cheat133="1 On 2 & 2 On 1 Modes\Player 1\Can't Be Pinned",D0296E4D 0029,81296F5A FFFF +Cheat134="1 On 2 & 2 On 1 Modes\Player 1\Can't Be Counted Out",D0296E4D 0029,81296ECE 0384 +Cheat135="1 On 2 & 2 On 1 Modes\Player 2\Infinite Health",D0296E4D 0029,81298270 0000,D0296E4D 0029,81298272 0000 +Cheat136="1 On 2 & 2 On 1 Modes\Player 2\Infinite Health",D0296E4D 0029,81298270 00FF,D0296E4D 0029,81298272 00FF +Cheat137="1 On 2 & 2 On 1 Modes\Player 2\Super Strength",D0296E4D 0029,812982CA FFFF +Cheat138="1 On 2 & 2 On 1 Modes\Player 2\Invincible",D0296E4D 0029,812982CE FFFF +Cheat139="1 On 2 & 2 On 1 Modes\Player 2\Super Speed",D0296E4D 0029,812982D2 FFFF +Cheat140="1 On 2 & 2 On 1 Modes\Player 2\Super Stamina",D0296E4D 0029,812982D6 FFFF +Cheat141="1 On 2 & 2 On 1 Modes\Player 2\Instant Recovery",D0296E4D 0029,812982DA FFFF +Cheat142="1 On 2 & 2 On 1 Modes\Player 2\Can't Be Pinned",D0296E4D 0029,812981FA FFFF +Cheat143="1 On 2 & 2 On 1 Modes\Player 2\Can't Be Counted Out",D0296E4D 0029,8129816E 0384 +Cheat144="1 On 2 & 2 On 1 Modes\Player 2\Infinite Health",D0296E4D 0029,81299510 0000,D0296E4D 0029,81299512 0000 +Cheat145="1 On 2 & 2 On 1 Modes\Player 2\Infinite Health",D0296E4D 0029,81299510 00FF,D0296E4D 0029,81299512 00FF +Cheat146="1 On 2 & 2 On 1 Modes\Player 2\Super Strength",D0296E4D 0029,8129956A FFFF +Cheat147="1 On 2 & 2 On 1 Modes\Player 2\Invincible",D0296E4D 0029,8129956E FFFF +Cheat148="1 On 2 & 2 On 1 Modes\Player 2\Super Speed",D0296E4D 0029,81299572 FFFF +Cheat149="1 On 2 & 2 On 1 Modes\Player 2\Super Stamina",D0296E4D 0029,81299576 FFFF +Cheat150="1 On 2 & 2 On 1 Modes\Player 2\Instant Recovery",D0296E4D 0029,8129957A FFFF +Cheat151="1 On 2 & 2 On 1 Modes\Player 2\Can't Be Pinned",D0296E4D 0029,8129949A FFFF +Cheat152="1 On 2 & 2 On 1 Modes\Player 2\Can't Be Counted Out",D0296E4D 0029,8129940E 0384 +Cheat153="3 Way Dance Mode\Player 1\Infinite Health",D0296C3D 0029,81296DC0 0000,D0296C3D 0029,81296DC2 0000 +Cheat154="3 Way Dance Mode\Player 1\Infinite Health",D0296C3D 0029,81296DC0 00FF,D0296C3D 0029,81296DC2 00FF +Cheat155="3 Way Dance Mode\Player 1\Super Strength",D0296C3D 0029,81296E1A FFFF +Cheat156="3 Way Dance Mode\Player 1\Invincible",D0296C3D 0029,81296E1E FFFF +Cheat157="3 Way Dance Mode\Player 1\Super Speed",D0296C3D 0029,81296E22 FFFF +Cheat158="3 Way Dance Mode\Player 1\Super Stamina",D0296C3D 0029,81296E26 FFFF +Cheat159="3 Way Dance Mode\Player 1\Instant Recovery",D0296C3D 0029,81296E2A FFFF +Cheat160="3 Way Dance Mode\Player 1\Can't Be Pinned",D0296C3D 0029,81296D4A FFFF +Cheat161="3 Way Dance Mode\Player 1\Can't Be Counted Out",D0296C3D 0029,81296CBE 0384 +Cheat162="3 Way Dance Mode\Player 2\Infinite Health",D0296C3D 0029,81298060 0000,D0296C3D 0029,81298062 0000 +Cheat163="3 Way Dance Mode\Player 2\Infinite Health",D0296C3D 0029,81298060 00FF,D0296C3D 0029,81298062 00FF +Cheat164="3 Way Dance Mode\Player 2\Super Strength",D0296C3D 0029,812980BA FFFF +Cheat165="3 Way Dance Mode\Player 2\Invincible",D0296C3D 0029,812980BE FFFF +Cheat166="3 Way Dance Mode\Player 2\Super Speed",D0296C3D 0029,812980C2 FFFF +Cheat167="3 Way Dance Mode\Player 2\Super Stamina",D0296C3D 0029,812980C6 FFFF +Cheat168="3 Way Dance Mode\Player 2\Instant Recovery",D0296C3D 0029,812980CA FFFF +Cheat169="3 Way Dance Mode\Player 2\Can't Be Pinned",D0296C3D 0029,81297FEA FFFF +Cheat170="3 Way Dance Mode\Player 2\Can't Be Counted Out",D0296C3D 0029,81297F5E 0384 +Cheat171="3 Way Dance Mode\Player 3\Infinite Health",D0296C3D 0029,81299300 0000,D0296C3D 0029,81299302 0000 +Cheat172="3 Way Dance Mode\Player 3\Infinite Health",D0296C3D 0029,81299300 00FF,D0296C3D 0029,81299302 00FF +Cheat173="3 Way Dance Mode\Player 3\Super Strength",D0296C3D 0029,8129935A FFFF +Cheat174="3 Way Dance Mode\Player 3\Invincible",D0296C3D 0029,8129935E FFFF +Cheat175="3 Way Dance Mode\Player 3\Super Speed",D0296C3D 0029,81299362 FFFF +Cheat176="3 Way Dance Mode\Player 3\Super Stamina",D0296C3D 0029,81299366 FFFF +Cheat177="3 Way Dance Mode\Player 3\Instant Recovery",D0296C3D 0029,8129936A FFFF +Cheat178="3 Way Dance Mode\Player 3\Can't Be Pinned",D0296C3D 0029,8129928A FFFF +Cheat179="3 Way Dance Mode\Player 3\Can't Be Counted Out",D0296C3D 0029,812991FE 0384 +Cheat180="Character Modifier\Player 1",80122773 00?? +Cheat181="Character Modifier\Player 2",80122783 00?? +Cheat182="Create A Wrestler\Infinite Move %",80131600 0024 +Cheat183="Create A Wrestler\Infinite Attribute Points",8115DD52 0000 +Cheat180_O=$0D Cyrus the Virus,$0F Mack Daddy,$15 Gertner,$19 Jeff Jones,$1C Beulah,$1D Mad Goat,$1F Nurse,$22 Tommy Rich,$25 Santoro,$27 Sound Guy,$28 The Sheik,$29 Skull,$2A H Slash,$2E Louie,$30 J Styles,$32 Taz,$33 Trainer,$36 Excel +Cheat181_O=$0D Cyrus the Virus,$0F Mack Daddy,$15 Gertner,$19 Jeff Jones,$1C Beulah,$1D Mad Goat,$1F Nurse,$22 Tommy Rich,$25 Santoro,$27 Sound Guy,$28 The Sheik,$29 Skull,$2A H Slash,$2E Louie,$30 J Styles,$32 Taz,$33 Trainer,$36 Excel + +//---- + +[F2A653CB-60633B3B-C:45] +Name=Elmo's Letter Adventure (U) +Cheat0="Found All Letters",810ACBA2 000C +Cheat1="Infinite Strikes",810A760A 0000 +Cheat2="Have No Letters",810ACBA2 0000 +Cheat2_N=Keep you kid busy for hours!!! + +//---- + +[02B1538F-C94B88D0-C:45] +Name=Elmo's Number Journey (U) +Cheat0="Found All Numbers",810ACFB2 000C +Cheat1="Infinite Strikes",810A7A76 0000 +Cheat2="Have No Numbers",810ACFB2 0000 +Cheat2_N=Keep you kid busy for hours!!! + +//---- + +[07861842-A12EBC9F-C:45] +Name=Excitebike 64 (U) +Cheat0="Auto-Pilot Always On Turbo (Original Excitebike Mode)",810E3142 19AA +Cheat1="Unlock\Difficulties & All Special Tracks",810F2D50 FFFF +Cheat2="Unlock\Silver & Gold Cup",810F2D4E 0003 +Cheat3="Max Stunt Points",810E4D18 0098,810E4D1A 967F +Cheat4="Always Low Temp",810E4F98 0000,810E4F9A 0000 +Cheat5="Steering Control",800C9E50 0040 +Cheat6="Super Speed For All",800CA9A0 0040,800CA9A1 0070 +Cheat7="Power Turbo",800CA99C 0040,800CA99D 00E0 +Cheat8="No\Overheating",800CA984 00C3 +Cheat9="No\Collision Drivers",800D9D34 0040 +Cheat10="Fast\Movement (Player)",800D9D65 00AF +Cheat11="Slow\Movement (Player)",800D9D65 0060 +Cheat12="Fast\Movement (Drones)",800D9D55 00A0 +Cheat13="Slow\Movement (Drones)",800D9D55 0060 +Cheat14="Earthquake Mode",810D7010 3AD0 + +//---- + +[FDA245D2-A74A3D47-C:45] +Name=Extreme-G (U) +Cheat0="Infinite Shields\Player 1",801635F5 00C8 +Cheat1="Infinite Primary Weapon\Player 1",801635FD 00C8 +Cheat2="Infinite Turbos\Player 1",801635CB 0003,801635CF 0003 +Cheat3="Bike Modifier\Player 1",80167C3F 00?? +Cheat4="Infinite Shields\Player 2",80163D65 00C8 +Cheat5="Infinite Primary Weapon\Player 2",80163D6D 00C8 +Cheat6="Infinite Turbos\Player 2",80163D3B 0003,80163D3F 0003 +Cheat7="Bike Modifier\Player 2",80167C8B 00?? +Cheat8="Infinite Shields\Player 3",801644D5 00C8 +Cheat9="Infinite Primary Weapon\Player 3",801644DD 00C8 +Cheat10="Infinite Turbos\Player 3",801644AB 0003,801644AF 0003 +Cheat11="Bike Modifier\Player 3",80167CD7 00?? +Cheat12="Infinite Shields\Player 4",80164C45 00C8 +Cheat13="Infinite Primary Weapon\Player 4",80164C4D 00C8 +Cheat14="Infinite Turbos\Player 4",80164C1B 0003,80164C1F 0003 +Cheat15="Bike Modifier\Player 4",80167D23 00?? +Cheat16="Extra Bikes Unlocked",80167C13 0001,80167C17 0003 +Cheat17="Extra Levels Unlocked",80167C0B 0001,80167C0F 0001 +Cheat18="All Tracks Unlocked",8019436E 0008,50000264 0000,80167747 0001,50000264 0000,80167873 0001,50000564 0000,8016799F 0001 +Cheat19="Mode Select",80095F6F 00?? +Cheat3_O=$00 Raze,$01 Rana,$02 Khan,$03 Grimace,$04 Mooga,$05 Jolt,$06 Main,$07 Apollyon,$08 Roach,$09 Neon +Cheat7_O=$00 Raze,$01 Rana,$02 Khan,$03 Grimace,$04 Mooga,$05 Jolt,$06 Main,$07 Apollyon,$08 Roach,$09 Neon +Cheat11_O=$00 Raze,$01 Rana,$02 Khan,$03 Grimace,$04 Mooga,$05 Jolt,$06 Main,$07 Apollyon,$08 Roach,$09 Neon +Cheat15_O=$00 Raze,$01 Rana,$02 Khan,$03 Grimace,$04 Mooga,$05 Jolt,$06 Main,$07 Apollyon,$08 Roach,$09 Neon +Cheat19_O=$01 Boulder,$02 Fish Eye Lens,$03 Boulder & Fish Eye Lens,$04 Magnify,$08 Anti-Gravity,$0A Anti-Gravity & Fish Eye Lens,$10 Wireframe,$11 Boulder & Wireframe,$20 Stealth Mode,$40 Ghost Mode,$80 Ugly Mode +Cheat3_O=$00 Raze,$01 Rana,$02 Khan,$03 Grimace,$04 Mooga,$05 Jolt,$06 Main,$07 Apollyon,$08 Roach,$09 Neon +Cheat7_O=$00 Raze,$01 Rana,$02 Khan,$03 Grimace,$04 Mooga,$05 Jolt,$06 Main,$07 Apollyon,$08 Roach,$09 Neon +Cheat11_O=$00 Raze,$01 Rana,$02 Khan,$03 Grimace,$04 Mooga,$05 Jolt,$06 Main,$07 Apollyon,$08 Roach,$09 Neon +Cheat15_O=$00 Raze,$01 Rana,$02 Khan,$03 Grimace,$04 Mooga,$05 Jolt,$06 Main,$07 Apollyon,$08 Roach,$09 Neon +Cheat19_O=$01 Boulder,$02 Fish Eye Lens,$03 Boulder & Fish Eye Lens,$04 Magnify,$08 Anti-Gravity,$0A Anti-Gravity & Fish Eye Lens,$10 Wireframe,$11 Boulder & Wireframe,$20 Stealth Mode,$40 Ghost Mode,$80 Ugly Mode + +//---- + +[5CD4150B-470CC2F1-C:45] +Name=Extreme-G XG2 (U) +Cheat0="Infinite\Nitros\Player 1",80170B63 0004,80170B67 0004 +Cheat1="Infinite\Shield\Player 1",80170B8D 00C8 +Cheat2="Infinite Lasers\Player 1",80170B99 00C8 +Cheat3="Infinite Nitros\Player 2",801711CB 0004,801711CF 0004 +Cheat4="Infinite Shield\Player 2",801711F5 00C8 +Cheat5="Infinite Lasers\Player 2",80171241 00C8 +Cheat6="Infinite Nitros\Player 3",80171833 0004,80171837 0004 +Cheat7="Infinite Shield\Player 3",8017185D 00C8 +Cheat8="Infinite Lasers\Player 3",80171869 00C8 +Cheat9="Infinite Nitros\Player 4",80171E9B 0004,80171E9F 0004 +Cheat10="Infinite Shield\Player 4",80171EC5 00C8 +Cheat11="Infinite Lasers\Player 4",80171ED1 00C8 +Cheat12="Access\All Tracks",50000BD8 0000,80182F87 0001 +Cheat13="Access\All Superbikes",50000304 0000,801839CF 0001 +Cheat14="Access\All Secret Characters",50000C04 0000,801839CF 0001 +Cheat15="[Screen Hud Clear]",80092B8B 0004 +Cheat14_N=This code is Fantastic, You have 12 characters to choose from to you race without any bike, just on foot +Cheat15_N=If you are using a Plugin other then Jabos and can not see through the Thick Hud then Let the game load 1st before Putting this code on,Or it will give an error and Freeze + +//---- + +[AE82687A-9A3F388D-C:45] +Name=F-1 Pole Position 64 (U) +Cheat0="Always First Place",810BA6DA 0000 + +//---- + +[52F78805-8B8FCAB7-C:45] +Name=Fighter's Destiny (U) +Cheat0="Start with Stars Modifier\Player 1",D0209757 0000,80209757 00?? +Cheat0_O=$00 No Stars,$06 Max Stars +Cheat1="Start with Stars Modifier\Player 2",D020B61F 0000,8020B61F 00?? +Cheat1_O=$00 No Stars,$06 Max Stars +Cheat2="Have 1 Star\Ryuji",8030734E 0001 +Cheat3="Have 1 Star\Bob",8030734F 0001 +Cheat4="Have 1 Star\Pierre",80307350 0001 +Cheat5="Have 1 Star\Meiling",80307351 0001 +Cheat6="Have 1 Star\Leon",80307352 0001 +Cheat7="Have 1 Star\Abdul",80307353 0001 +Cheat8="Have 1 Star\Ninja",80307354 0001 +Cheat9="Have 1 Star\Tomahawk",80307355 0001 +Cheat10="Have 1 Star\Valerie",80307356 0001 +Cheat11="Infinite Health\Player 1",802098A1 0000,802047C3 0000 +Cheat12="Infinite Health\Player 2",802047C7 0000,8020B769 0000 +Cheat13="Start on stage 100 on Survival to get Joker",802EF67B 0063 +Cheat14="Stop timer for Fastest to get Robot",810ADBDC 3F80 +Cheat15="Always Win Judge's Decision\Player 1",8020B777 FFFF,802098AF 0000 +Cheat16="Always Win Judge's Decision\Player 2",802098AF FFFF,8020B777 0000 +Cheat17="Enable Boro",80307349 0001 +Cheat18="Level Select",8022A84C 00?? +Cheat18_O=$00 Fire Mountain,$01 Desert,$02 Highlands,$03 Hong Kong,$04 Coliseum,$05 Jungle,$06 Ninja Room,$07 Suspension Bridge,$08 Palace,$09 Observation,$0A Pasture,$0B Joker's Room,$0C Blue Hell Mountain,$0D Palace +Cheat19="Play As\Player 1",802EF622 00?? +Cheat19_O=$00 Ryuji,$01 Bob,$02 Pierre,$03 Meiling,$04 Leon,$05 Abdul,$06 Ninja,$07 Tomahawk,$08 Boro,$09 Valerie,$0A Ushi,$0B Joker,$0C The Master,$0D No Clue + +//---- + +[AEEF2F45-F97E30F1-C:45] +Name=Fighter Destiny 2 (U) +Cheat0="P1 Always Win Judging",801F727A 00FF +Cheat1="P2 Always Win Judging",801F53AE 00FF +Cheat2="P1 Always Lose Judging",801F727A 0000 +Cheat3="P2 Always Lose Judging",801F53AE 0000 +Cheat4="Max Attack Power-Fighters Arena",801FBF6E 00C7 +Cheat5="Max Health Power-Fighters Arena",801FBF6F 00C7 +Cheat6="Max Recovery-Fighters Arena",801FBF70 00C7 +Cheat7="Low Time",800BA390 0001 + +//---- + +[32EFC7CB-C3EA3F20-C:45] +Name=Fighting Force 64 (U) +Cheat0="Infinite Lives P1",800CE0F3 0003 +Cheat1="Infinite Lives P2",800CE0F7 0003 +Cheat2="Infinite Pistol Ammo",8106006C 2400 +Cheat3="Infinite Rocket Launcher Ammo",81060130 2400 +Cheat4="Infinite Shotgun Ammo",810601D8 2400 + +//---- + +[A92D52E5-1D26B655-C:45] +Name=Flying Dragon (U) +Cheat0="Infinite\Health\Player 1",8020B7B1 00C8 +Cheat1="Infinite\Special\Player 1",8120AEB4 0190 +Cheat2="1 Win to Win\Player 1",D020C27F 0000,8020C27F 0001 +Cheat3="Infinite\Health\Player 2",8020BC0D 00C8 +Cheat4="Infinite\Special\Player 2",8120B1B0 0190 +Cheat5="1 Win to Win\Player 2",D020C27F 0000,8020C27F 0010 +Cheat6="Infinite\Money",8121106C 2704 + +//---- + +[9E330C01-8C0314BA-C:45] +Name=Forsaken 64 (U) +Cheat0="Infinite Shields",D014E5E2 0011,8114E5E0 1000 +Cheat1="Enable Battle Mode And Levels",8008ED6E 0012 +Cheat2="Gore Mode",8008ED67 0012 +Cheat3="Infinite Lives",8004013C 0005 +Cheat4="GS Button For 255 Spare0 Missiles",8814E648 00FF + +//---- + +[3261D479-ED0DBC25-C:45] +Name=Fox Sports College Hoops '99 (U) +Cheat0="Trail Follows The Ball",810B4600 4100 +Cheat1="Programmers Team",81097088 0100 +Cheat2="Z-Axis Stadium",80098E98 0088 +Cheat3="Final Four Stadium",80098E98 0089 +Cheat4="No Fans In Crowd",810CA520 0454 +Cheat5="Away Team Scores 0",8012A4EA 0000 +Cheat6="Away Team Scores 150",8012A4EA 0096 +Cheat7="Home Team Scores 0",8012A4D2 0000 +Cheat8="Home Team Scores 150",8012A4D2 0096 +Cheat9="Infinite Shot Clock",8112A4BC 4210 +Cheat10="Infinite Time Outs Away",8012A4EC 0006 +Cheat11="Infinite Time Outs Home",8012A4D4 0006 +Cheat12="No Time Outs Away",8012A4EC 0000 +Cheat13="No Time Outs Home",8012A4D4 0000 +Cheat14="Big Head Mode",81098E88 0100 +Cheat15="Partially Invisible Players",81098E84 0100 +Cheat16="Shot Clock Disabled",8109707C 0000 +Cheat17="GS Button For 1-Second Shot Clock",8912A4BC 3FC0 + +//---- + +[E8E5B179-44AA30E8-C:45] +Name=Frogger2 (Unreleased Alpha) +Cheat0="Freeze Timer",80163ABF 000A +Cheat2="Infinite Lives (Retro Frogger)",8025AC2F 0005 +Cheat1="Infinite 99 Lives",80163AC7 0063 + +//---- + +[B30ED978-3003C9F9-C:45] +Name=F-Zero X (U) +Cheat0="Time Always 00.00.00/1st Place",802C4BC0 0000,802C4BC2 0001 +Cheat1="Infinite Lives",800E5ED9 0005 +Cheat2="Unlock Everything",800CD3C8 0001 +Cheat3="Player 1\Infinite Shield",812C4B48 4326 +Cheat4="Player 2\Infinite Shield",812C4EF0 4326 +Cheat5="Player 3\Infinite Shield",812C5298 4326 +Cheat6="Player 4\Infinite Shield",812C5640 4326 +Cheat7="Max Shield",812C4B4C 4326 +Cheat8="Have Boost From Start",D02C4DAC 003F,802C4925 0050 +Cheat9="One Lap To Race",D02C4BC9 0000,812C4BC8 0002,D02C4BCB 0001,812C4BCA 0002 +Cheat10="Expert Mode",800E5ED9 0000,812C4B48 0000,812C4B4C 0000 +Cheat11="Super Ultimate Mega Fast Mode",812C4984 2222 +Cheat12="Cool Camera",800E523E 0000 +Cheat13="Hunk O' Junk",802C4B3F 0040 +Cheat14="Show 30 Cars Out Of 1 Position",800E5FC7 001D +Cheat15="Player 1\Invisible Car",802C4CCB 0000 +Cheat16="Player 1\Character Modifier",800E5EE1 00?? +Cheat17="Player 2\Character Modifier",802C4F90 00?? +Cheat18="Player 3\Character Modifier",802C5338 00?? +Cheat19="Player 4\Character Modifier",802C56E0 00?? +Cheat20="Player 1\Car Color Modifier",802C4BED 00?? +Cheat21="Player 2\Car Color Modifier",802C4F95 00?? +Cheat22="Player 3\Car Color Modifier",802C533D 00?? +Cheat23="Player 4\Car Color Modifier",802C56E5 00?? +Cheat27="Track Modifier",800F8517 00?? +Cheat29="Max Grand Prix Points",812C492A FFFF +Cheat15_N=Vs. Mode Only +Cheat16_O=$00 Captain Falcon,$01 Dr. Stewart,$02 Pico,$03 Samurai Goroh,$04 Jody Summer,$05 Mighty Gazelle,$06 Mr. EAD,$07 Baba,$08 Octoman,$09 Gomar + Shioh,$0A Kate Alen,$0B Roger Buster,$0C James McCloud,$0D Leon,$0E Antonio Guster,$0F Black Shadow,$10 Michael Chain,$11 Jack Levin,$12 Super Arrow,$13 Mrs. Arrow,$14 John Tanaka,$15 Beastman,$16 Zoda,$17 Dr. Clash,$18 Silver Neelsen,$19 Bio Rex,$1A Draq,$1B Billy,$1C The Skull,$1D Blood Falcon,$1E Perfect Captain Falcon +Cheat17_O=$00 Captain Falcon,$01 Dr. Stewart,$02 Pico,$03 Samurai Goroh,$04 Jody Summer,$05 Mighty Gazelle,$06 Mr. EAD,$07 Baba,$08 Octoman,$09 Gomar + Shioh,$0A Kate Alen,$0B Roger Buster,$0C James McCloud,$0D Leon,$0E Antonio Guster,$0F Black Shadow,$10 Michael Chain,$11 Jack Levin,$12 Super Arrow,$13 Mrs. Arrow,$14 John Tanaka,$15 Beastman,$16 Zoda,$17 Dr. Clash,$18 Silver Neelsen,$19 Bio Rex,$1A Draq,$1B Billy,$1C The Skull,$1D Blood Falcon,$1E Perfect Captain Falcon +Cheat18_O=$00 Captain Falcon,$01 Dr. Stewart,$02 Pico,$03 Samurai Goroh,$04 Jody Summer,$05 Mighty Gazelle,$06 Mr. EAD,$07 Baba,$08 Octoman,$09 Gomar + Shioh,$0A Kate Alen,$0B Roger Buster,$0C James McCloud,$0D Leon,$0E Antonio Guster,$0F Black Shadow,$10 Michael Chain,$11 Jack Levin,$12 Super Arrow,$13 Mrs. Arrow,$14 John Tanaka,$15 Beastman,$16 Zoda,$17 Dr. Clash,$18 Silver Neelsen,$19 Bio Rex,$1A Draq,$1B Billy,$1C The Skull,$1D Blood Falcon,$1E Perfect Captain Falcon +Cheat19_O=$00 Captain Falcon,$01 Dr. Stewart,$02 Pico,$03 Samurai Goroh,$04 Jody Summer,$05 Mighty Gazelle,$06 Mr. EAD,$07 Baba,$08 Octoman,$09 Gomar + Shioh,$0A Kate Alen,$0B Roger Buster,$0C James McCloud,$0D Leon,$0E Antonio Guster,$0F Black Shadow,$10 Michael Chain,$11 Jack Levin,$12 Super Arrow,$13 Mrs. Arrow,$14 John Tanaka,$15 Beastman,$16 Zoda,$17 Dr. Clash,$18 Silver Neelsen,$19 Bio Rex,$1A Draq,$1B Billy,$1C The Skull,$1D Blood Falcon,$1E Perfect Captain Falcon +Cheat20_O=$00 1st Color,$01 2nd Color,$02 3rd Color,$03 4th Color,$05 Hidden Color +Cheat21_O=$00 1st Color,$01 2nd Color,$02 3rd Color,$03 4th Color,$05 Hidden Color +Cheat22_O=$00 1st Color,$01 2nd Color,$02 3rd Color,$03 4th Color,$05 Hidden Color +Cheat23_O=$00 1st Color,$01 2nd Color,$02 3rd Color,$03 4th Color,$05 Hidden Color +Cheat27_O=$00 Mute City,$01 Silence,$02 Sand Ocean,$03 Devils Forest,$04 Big Blue,$05 Port Town,$06 Sector Alpha,$07 Red Canyon,$08 Devils Forest 2,$09 Mute City 2,$0A Big Blue 2,$0B White Land,$0C Fire Field,$0D Silence 2,$0E Sector Beta,$0F Red Canyon,$10 White Land 2,$11 Mute City 2,$12 Rainbow Road,$13 Devils Forest 3,$14 Space Plant,$15 Sand Ocean 2,$16 Port Town 2,$17 Big Hand + +//---- + +[729B5E32-B728D980-C:45] +Name=GAUNTLET LEGENDS +Cheat0="Infinite\Max Health",810C5C54 0000,810C5C56 270F,810C5C64 0000,810C5C66 270F +Cheat1="Infinite\Money",810C5CF6 FFFF +Cheat2="Max Strength",810C5C04 0000,810C5C06 FFFF +Cheat3="Max Speed",810C5C14 0000,810C5C16 FFFF +Cheat4="Max Magic",810C5C24 0000,810C5C26 FFFF +Cheat5="Max Armour",810C5C34 0000,810C5C36 FFFF +Cheat6="Infinite\Turbo",800FD30F 0064 +Cheat7="Level 99",810C5C44 0000,810C5C46 0063 +Cheat9="Always Shoot 5-Way",800FD198 0200 +Cheat10="Always Shoot 3-Way",800FD19A 0002 +Cheat11="Always Shoot Rapid Fire",800FD19A 1000 +Cheat12="Have Window Schards",8104EFCA 000F +Cheat13="Have Rune Stones",8104EFC6 1FFF +Cheat14="Infinite\Item On Pickup",50010100 0000,810C5BF6 FFFF +Cheat15="Infinite\Keys On Pickup",800C5C97 0006 +Cheat8="Infinite\Special Weapons",800C5FF7 0009,800C5D37 0009,800C5D67 0009,800C5DE7 0009,800C5EB7 0009 + +//---- + +[3EDC7E12-E26C1CC9-C:45] +Name=Gex 3: Deep Cover Gecko (U) +Cheat0="Start With 50 Remotes",D00A54EB 0000,800A54EB 0032 +Cheat1="Infinite Health",800A54D9 0004 +Cheat2="Extra Flies",D00A54DF 0000,800A54DF 0032 + +//---- + +[89FED774-CAAFE21B-C:45] +Name=Gex 64: Enter The Gecko (U) +Cheat0="Infinite Health",800C56BB 0005 +Cheat1="Infinite Lives",800C56B7 0005 +Cheat2="Have All Artifacts",800C56BF 0063,800C56C3 0063,800C56C7 0063 + +//---- + +[8E6E01FF-CCB4F948-C:45] +Name=Glover (U) +Cheat0="Infinite\Double Jumps",8028FC07 0000 +Cheat1="Press L To Levitate",D02AE905 0020,81290334 43E0 +Cheat2="Infinite\Health",8029018F 0028 +Cheat3="Infinite\Lives",80290193 000A +Cheat4="GS Button For 40 Gems",8829018F 0028 +Cheat5="Infinite\Activate Cheat\Modifier 1",81297BEC ???? +Cheat5_O=$0080 Level Select,$0100 Open Portals,$0200 Open Levels,$0380 All Of The Above +Cheat6="Infinite\Activate Cheat\Modifier 2",81297BEE ???? +Cheat6_O=$0002 Call Ball (Press L),$0008 Infinite Lives,$0040 Infinite Energy,$0200 Big Ball,$024A All Of The Above +Cheat7="Infinite\Action Modifier",802901E3 00?? +Cheat7_O=$00 Freeze Enemy Spell,$01 Death Spell,$02 Frog Spell,$03 Walk On Walls Spell,$04 Big Glover Spell,$05 Tree Spell,$06 Helicopter Spell,$07 Enemy Ball Spell,$08 Purple Bouncy Ball Spell,$09 Tiny Black/Grey Ball Spell,$0A Beach Ball Spell,$0B Hovering Ball Spell,$0C Green Ball Spell,$0D Super Call Ball Spell,$0E Call Ball Spell + +//---- + +[4252A5AD-AE6FBF4E-C:45] +Name=Goemon's Great Adventure (U) +Cheat0="Infinite Gold P1",81088286 03E7 +Cheat1="Infinite Health P1",80088284 0003 +Cheat2="Infinite Lives P1",80088283 0003 +Cheat3="Infinite Gold P2",8119ADEE 03E7 +Cheat4="Infinite Health P2",81088290 03E7 +Cheat5="Infinite Lives P2",8008828D 0003 +Cheat6="Infinite Coins P1",8119ADEE 03E7 +Cheat7="Open All Levels",50002D02 0000,810882AA 0303 + +//---- + +[DCBC50D1-09FD1AA3-C:45] +Name=Goldeneye 007 (U) +Cheat0="Enable All Levels & In-Built Cheat Menu",8006992E FFFF,80069930 FFFF,80069967 FFFF,8006996C FFFF,80069971 FFFF,80069976 FFFF,8006997B FFFF,8006992F FFFF,80069965 FFFF,8006996A FFFF,8006996F FFFF,80069974 FFFF,80069979 FFFF +Cheat1="Always Have 00:00 Time (All Levels)",8004837E 0000,8004838E 0000,80048396 0000,80079A22 0000,80079F26 0000 +Cheat2="Infinite Ammo (All Levels)",80079E3B 0001 +Cheat3="Bulletproof Bond",8002CE44 0030 +Cheat4="Weak Enemies",8002CE48 0048 +Cheat5="Walk through doors, objects",800364CB 0000 +Cheat6="Enable All Levels",80036FB7 0001 +Cheat7="All Objectives Complete",80036FD3 0001 +Cheat8="Gain Access\To Aztec Level Without Beating Secret Agent Or 00 Agent",8002A8FB 001A +Cheat9="Gain Access\To Egyptian Level Without Beating Secret Agent Or 00 Agent",8002A8FB 001C +Cheat10="Infinite Health Player 1 (all levels)",8100C0F4 0801,8100C0F6 8090,8100C0F8 AFA4,8100C0FA 0000,81060240 0004,81060242 7600,81060244 3C02,81060246 8008,81060248 8C42,8106024A 9EE0,8106024C 3401,8106024E 3F80,81060250 A441,81060252 00DC,81060254 0800,81060256 303F +Cheat11="Cradle in multiplayer",8002B11D 0092,8002B11F 0093,8002B127 0029,8002B123 0008,802ADC8D 0052,802ADC8E 0041,802ADC8F 0044,802ADC90 004C,802ADC91 0045 +Cheat12="Custom Weapon Grouping",80048673 0013,81048678 3FC0,80048677 00D0,8004867F 000D,80048683 000A,8004868B 0013,81048690 3FC0,8004868F 00D0,80048697 000D,8004869B 000A,800486A3 0019,810486A8 3FC0,800486A7 00D3,800486AF 0006,800486B3 0003,800486BB 0019,810486C0 3FC0,800486BF 00D3,800486C7 0006,800486CB 0003,800486D3 0013,810486D8 3FC0,800486D7 00D0,800486DF 000D,800486E3 000A,800486EB 0013,810486F0 3FC0,800486EF 00D0,800486F7 000D,800486FB 000A,80048703 0019,81048708 3FC0,80048707 00D3,8004870F 0006,80048713 0003,8004871B 0019,81048720 3FC0,8004871F 00D3,80048727 0006,8004872B 0003,812AEA50 476F,812AEA52 6C64,812AEA54 656E,812AEA56 2047,812AEA58 756E,812AEA5A 2046,812AEA5C 756E,802AEA5E 0000 +Cheat13="Facility Back Zone In Multiplayer\Part 1\2 players",811E6554 45E4,811E6558 43D5,811E655C C5A7,811E657C 801C,811E657E 6774,811E5164 45E4,811E5168 C383,811E516C 4492,811E518C 801C,811E518E D574,811E78C0 45AD,811E78C4 C383,811E78C8 4440,811E78E8 801C,811E78EA E464,811E4D18 45D0,811E4D1C 4307,811E4D20 C4FB,811E4D40 801C,811E4D42 75EC,811E6738 45CD,811E673C C383,811E6740 43F4,811E6760 801C,811E6762 A0DC,811E5450 45C2,811E5454 4356,811E5458 C598,811E5478 801C,811E547A 6A74,811E5240 4608,811E5244 4307,811E5248 43DC,811E5268 801C,811E526A 962C,811E691C 4606,811E6920 4321,811E6924 449D,811E6944 801C,811E6946 CBEC,801ED447 008A,801ED4DB 008B,801ED56F 008C,801ED603 008D,801ED697 008E,801ED72B 008F,801ED7BF 007D,801ED853 007E,801ED443 002A,801ED4D7 002A,801ED56B 002A,801ED5FF 002A,801ED693 002A,801ED727 002A,801ED7BB 002A,801ED84F 002A,801ED449 0000,801ED4DD 0000,801ED571 0000,801ED605 0000,801ED699 0000,801ED72D 0000,801ED7C1 0000,801ED855 0000,801ED44D 0000,801ED4E1 0000,801ED575 0000,801ED609 0000,801ED69D 0000,801ED731 0000,801ED7C5 0000,801ED859 0000,801EB743 002A,801EB745 0068,811EB746 277F,811EB748 1000,811EB74A 0262,811EB7C2 0190,801EB7C5 0000,811EB7C6 0258 +Cheat14="Facility Back Zone In Multiplayer\Part 2\2 players",811EB7C8 0000,811EB7CC FFFF,811EB7CE FFFF,811EB7D2 0000,801EB7D5 0000,801EB7DB 0000,811EB7E2 0000,801EB7E7 0000,801EB843 002A,801EB845 0068,811EB846 2780,811EB848 1000,811EB84A 0262,811EB8C2 0190,801EB8C5 0000,811EB8C6 0258,811EB8C8 0000,811EB8CC FFFF,811EB8CE FFFF,811EB8D2 0000,801EB8D5 0000,801EB8DB 0000,811EB8E2 0000,801EB8E7 0000,801EB943 002A,801EB945 0068,811EB946 2791,811EB948 1000,811EB94A 0262,811EB9C2 0190,801EB9C5 0000,811EB9C6 0258,811EB9C8 0000,811EB9CC FFFF,811EB9CE FFFF,811EB9D2 0000,801EB9D5 0000,801EB9DB 0000,811EB9E2 0000,801EB9E7 0000,801EBA43 002A,801EBA45 0068,811EBA46 2792,811EBA48 1000,811EBA4A 0262,811EBAC2 0190,801EBAC5 0000,811EBAC6 0258,811EBAC8 0000,811EBACC FFFF,811EBACE FFFF,811EBAD2 0000,801EBAD5 0000,801EBADB 0000,811EBAE2 0000,801EBAE7 0000,801EBB45 00A0,801EBC45 00A0,801EBD45 00A0,801EBE45 00A0,801EBB47 0075,801EBC47 0076,801EBD47 0077,801EBE47 0078,801EBBE7 0001,801EBCE7 0001,801EBDE7 0001,801EBEE7 0001,801EC247 0071,801ECD47 0072,801ECE47 0074,801ECF47 006C,801ED047 0079,801ED147 0083,D01EBFC5 005A,801EBFC5 0000,D11EBFC6 0000,811EBFC6 F333,D11EBFC8 03E8,811EBFC8 0000 +Cheat15="Facility Back Zone In Multiplayer\Part 3\2 players",D11EBFCA 0000,811EBFCA F0C4,D11EBFCE 4CCC,811EBFCE 000A,D11EBFD2 4CCC,811EBFD2 000A,D11EBFD4 0003,811EBFD4 0000,D11EBFD6 0000,811EBFD6 02C4,801EBFD9 0004,801EBFDB 0000,811EBFE2 0384,801EBFE7 0004,801EBF45 009E,801EBF47 0084,801EBF48 0010,801EC2D9 0000,801EC447 0085,801EC547 0086,811EA6B6 2743,811EA73E 0114,811EA7F2 0115,811EA8A6 00A3,811EA92E 009D,811EA9E2 00A4,811EAA96 00DA,811EAB1E 00DB,811EABD2 00DF,811EAC86 0130,811EAD0E 008D,811EADC2 012E,811EAE76 0111,811EAEFE 2740,811EAFB2 2741,811EB066 00A0,811EB0EE 009E,811EB1A2 009F,811EB256 274F,811EB2DE 2750,811EB392 0117,811EB446 0131,811EB4CE 008E,811EB582 0132,811EB636 00A1,811EB6BE 0119,811EA62E 00FA,801ED3DF 0000,801ED2DF 0001,D0024337 0007,80024337 001F +Cheat11_N=Puts the cradle graphic in the levels screen where the facility normally is in the multiplayer levels screen.Warning it doesn't allow you to enter the multiplayer levels screen,it should automatically have selected cradle, which cannot be changed from the multiplayer menus +Cheat12_N=golden gun fun should replace slappers only! appears in the multi weapons. +Cheat13_N=All parts must be on for this code to work.this cheat allows you to play the Facility Back Zone In Multiplayer +Cheat14_N=All parts must be on for this code to work.this cheat allows you to play the Facility Back Zone In Multiplayer +Cheat15_N=All parts must be on for this code to work.this cheat allows you to play the Facility Back Zone In Multiplayer +Cheat16="All 64 Characters In Multi Player",8002B197 0040 +Cheat17="Secret Island on Dam Level",D0064F31 0020,800D33ED 0050,880D33ED 0000 +Cheat17_N=For the above code to work,Get to the 2nd guard tower & go down the ladder on the left hand side & to the end of the Dock, Press L & GS and you will be transfered in the water. Just keep walking straight & you will get to it. Obviously you can't actually climb ladders or anything, you will simply walkthrough anything on that Part, if you want to walk back to the Dock, when you come near it click the cheat back on & keep pressing L & GS untill you are back on it. +Cheat18="Replace Cradle with Citadell hidden level ",8002A8F7 0029,8104468A 8970,81044690 3F44,81044692 BDEA,81044694 3F80,81044696 0000,81044698 4219,8104469A D89D,80069F80 00C4 + +//---- + +[98DF9DFC-6606C189-C:45] +Name=Harvest Moon (U) +Cheat0="Infinite\Money",811FD60E FFFF +Cheat1="Belongings\Slot 01",80189084 00?? +Cheat1_O=$00 Nothing,$01 Weeds,$02 Boulder,$03 Lumber,$04 Moondrop Plant,$05 Pink-Cat-Mint Plant,$06 Blue Plant,$07 Cake,$08 Pie,$09 Cookie,$0A Blue Feather,$0B Pink Liquid In A Bottle,$0C Red Box,$0D Turnips,$0E Potatoes,$0F Cabbages,$10 Tomatoes,$11 Corn,$12 Eggplant,$13 Strawberries,$14 Eggs,$15 Milk,$16 M Size Milk,$17 L Size Milk,$18 Gold Milk,$19 Sheared Wool,$1A High Quality Wool,$1B Wild Grapes,$1C Very Berry Fruit,$1D Tropical Fruit,$1E Walnuts,$1F Mushrooms,$20 Poisonous Mushroom,$21 Green Box,$22 Berry Of Full Moon Plant,$23 Medicinal Herbs,$24 Edible Herbs,$25 Small Fish,$26 Fish,$27 Big Fish,$28 Dumpling,$29 Cotton Candy,$2A Fried Octopus,$2B Roasted Corn,$2C Candy,$2D Chocolate,$2E Iron-Ore,$2F Blue Rock,$30 Rare Metal,$31 Moonlight Stone,$32 Pontata Root,$33 Chicken,$34 Chocolate Bar Picture,$35 ???,$36 Blue Egg Shaped Device,$37 ??,$38 Chocolate Bar Picture,$39 Fodder,$3A White Bag,$3B Tan Bag,$3C Green Bag,$3D Red Bag,$3E Yellow Bag,$3F Purple Bag +Cheat2="Belongings\Slot 02",80189085 00?? +Cheat2_O=$00 Nothing,$01 Weeds,$02 Boulder,$03 Lumber,$04 Moondrop Plant,$05 Pink-Cat-Mint Plant,$06 Blue Plant,$07 Cake,$08 Pie,$09 Cookie,$0A Blue Feather,$0B Pink Liquid In A Bottle,$0C Red Box,$0D Turnips,$0E Potatoes,$0F Cabbages,$10 Tomatoes,$11 Corn,$12 Eggplant,$13 Strawberries,$14 Eggs,$15 Milk,$16 M Size Milk,$17 L Size Milk,$18 Gold Milk,$19 Sheared Wool,$1A High Quality Wool,$1B Wild Grapes,$1C Very Berry Fruit,$1D Tropical Fruit,$1E Walnuts,$1F Mushrooms,$20 Poisonous Mushroom,$21 Green Box,$22 Berry Of Full Moon Plant,$23 Medicinal Herbs,$24 Edible Herbs,$25 Small Fish,$26 Fish,$27 Big Fish,$28 Dumpling,$29 Cotton Candy,$2A Fried Octopus,$2B Roasted Corn,$2C Candy,$2D Chocolate,$2E Iron-Ore,$2F Blue Rock,$30 Rare Metal,$31 Moonlight Stone,$32 Pontata Root,$33 Chicken,$34 Chocolate Bar Picture,$35 ???,$36 Blue Egg Shaped Device,$37 ??,$38 Chocolate Bar Picture,$39 Fodder,$3A White Bag,$3B Tan Bag,$3C Green Bag,$3D Red Bag,$3E Yellow Bag,$3F Purple Bag +Cheat3="Belongings\Slot 03",80189086 00?? +Cheat3_O=$00 Nothing,$01 Weeds,$02 Boulder,$03 Lumber,$04 Moondrop Plant,$05 Pink-Cat-Mint Plant,$06 Blue Plant,$07 Cake,$08 Pie,$09 Cookie,$0A Blue Feather,$0B Pink Liquid In A Bottle,$0C Red Box,$0D Turnips,$0E Potatoes,$0F Cabbages,$10 Tomatoes,$11 Corn,$12 Eggplant,$13 Strawberries,$14 Eggs,$15 Milk,$16 M Size Milk,$17 L Size Milk,$18 Gold Milk,$19 Sheared Wool,$1A High Quality Wool,$1B Wild Grapes,$1C Very Berry Fruit,$1D Tropical Fruit,$1E Walnuts,$1F Mushrooms,$20 Poisonous Mushroom,$21 Green Box,$22 Berry Of Full Moon Plant,$23 Medicinal Herbs,$24 Edible Herbs,$25 Small Fish,$26 Fish,$27 Big Fish,$28 Dumpling,$29 Cotton Candy,$2A Fried Octopus,$2B Roasted Corn,$2C Candy,$2D Chocolate,$2E Iron-Ore,$2F Blue Rock,$30 Rare Metal,$31 Moonlight Stone,$32 Pontata Root,$33 Chicken,$34 Chocolate Bar Picture,$35 ???,$36 Blue Egg Shaped Device,$37 ??,$38 Chocolate Bar Picture,$39 Fodder,$3A White Bag,$3B Tan Bag,$3C Green Bag,$3D Red Bag,$3E Yellow Bag,$3F Purple Bag +Cheat4="Belongings\Slot 04",80189087 00?? +Cheat4_O=$00 Nothing,$01 Weeds,$02 Boulder,$03 Lumber,$04 Moondrop Plant,$05 Pink-Cat-Mint Plant,$06 Blue Plant,$07 Cake,$08 Pie,$09 Cookie,$0A Blue Feather,$0B Pink Liquid In A Bottle,$0C Red Box,$0D Turnips,$0E Potatoes,$0F Cabbages,$10 Tomatoes,$11 Corn,$12 Eggplant,$13 Strawberries,$14 Eggs,$15 Milk,$16 M Size Milk,$17 L Size Milk,$18 Gold Milk,$19 Sheared Wool,$1A High Quality Wool,$1B Wild Grapes,$1C Very Berry Fruit,$1D Tropical Fruit,$1E Walnuts,$1F Mushrooms,$20 Poisonous Mushroom,$21 Green Box,$22 Berry Of Full Moon Plant,$23 Medicinal Herbs,$24 Edible Herbs,$25 Small Fish,$26 Fish,$27 Big Fish,$28 Dumpling,$29 Cotton Candy,$2A Fried Octopus,$2B Roasted Corn,$2C Candy,$2D Chocolate,$2E Iron-Ore,$2F Blue Rock,$30 Rare Metal,$31 Moonlight Stone,$32 Pontata Root,$33 Chicken,$34 Chocolate Bar Picture,$35 ???,$36 Blue Egg Shaped Device,$37 ??,$38 Chocolate Bar Picture,$39 Fodder,$3A White Bag,$3B Tan Bag,$3C Green Bag,$3D Red Bag,$3E Yellow Bag,$3F Purple Bag +Cheat5="Belongings\Slot 05",80189088 00?? +Cheat5_O=$00 Nothing,$01 Weeds,$02 Boulder,$03 Lumber,$04 Moondrop Plant,$05 Pink-Cat-Mint Plant,$06 Blue Plant,$07 Cake,$08 Pie,$09 Cookie,$0A Blue Feather,$0B Pink Liquid In A Bottle,$0C Red Box,$0D Turnips,$0E Potatoes,$0F Cabbages,$10 Tomatoes,$11 Corn,$12 Eggplant,$13 Strawberries,$14 Eggs,$15 Milk,$16 M Size Milk,$17 L Size Milk,$18 Gold Milk,$19 Sheared Wool,$1A High Quality Wool,$1B Wild Grapes,$1C Very Berry Fruit,$1D Tropical Fruit,$1E Walnuts,$1F Mushrooms,$20 Poisonous Mushroom,$21 Green Box,$22 Berry Of Full Moon Plant,$23 Medicinal Herbs,$24 Edible Herbs,$25 Small Fish,$26 Fish,$27 Big Fish,$28 Dumpling,$29 Cotton Candy,$2A Fried Octopus,$2B Roasted Corn,$2C Candy,$2D Chocolate,$2E Iron-Ore,$2F Blue Rock,$30 Rare Metal,$31 Moonlight Stone,$32 Pontata Root,$33 Chicken,$34 Chocolate Bar Picture,$35 ???,$36 Blue Egg Shaped Device,$37 ??,$38 Chocolate Bar Picture,$39 Fodder,$3A White Bag,$3B Tan Bag,$3C Green Bag,$3D Red Bag,$3E Yellow Bag,$3F Purple Bag +Cheat6="Belongings\Slot 06",80189089 00?? +Cheat6_O=$00 Nothing,$01 Weeds,$02 Boulder,$03 Lumber,$04 Moondrop Plant,$05 Pink-Cat-Mint Plant,$06 Blue Plant,$07 Cake,$08 Pie,$09 Cookie,$0A Blue Feather,$0B Pink Liquid In A Bottle,$0C Red Box,$0D Turnips,$0E Potatoes,$0F Cabbages,$10 Tomatoes,$11 Corn,$12 Eggplant,$13 Strawberries,$14 Eggs,$15 Milk,$16 M Size Milk,$17 L Size Milk,$18 Gold Milk,$19 Sheared Wool,$1A High Quality Wool,$1B Wild Grapes,$1C Very Berry Fruit,$1D Tropical Fruit,$1E Walnuts,$1F Mushrooms,$20 Poisonous Mushroom,$21 Green Box,$22 Berry Of Full Moon Plant,$23 Medicinal Herbs,$24 Edible Herbs,$25 Small Fish,$26 Fish,$27 Big Fish,$28 Dumpling,$29 Cotton Candy,$2A Fried Octopus,$2B Roasted Corn,$2C Candy,$2D Chocolate,$2E Iron-Ore,$2F Blue Rock,$30 Rare Metal,$31 Moonlight Stone,$32 Pontata Root,$33 Chicken,$34 Chocolate Bar Picture,$35 ???,$36 Blue Egg Shaped Device,$37 ??,$38 Chocolate Bar Picture,$39 Fodder,$3A White Bag,$3B Tan Bag,$3C Green Bag,$3D Red Bag,$3E Yellow Bag,$3F Purple Bag +Cheat7="Belongings\Slot 07",8018908A 00?? +Cheat7_O=$00 Nothing,$01 Weeds,$02 Boulder,$03 Lumber,$04 Moondrop Plant,$05 Pink-Cat-Mint Plant,$06 Blue Plant,$07 Cake,$08 Pie,$09 Cookie,$0A Blue Feather,$0B Pink Liquid In A Bottle,$0C Red Box,$0D Turnips,$0E Potatoes,$0F Cabbages,$10 Tomatoes,$11 Corn,$12 Eggplant,$13 Strawberries,$14 Eggs,$15 Milk,$16 M Size Milk,$17 L Size Milk,$18 Gold Milk,$19 Sheared Wool,$1A High Quality Wool,$1B Wild Grapes,$1C Very Berry Fruit,$1D Tropical Fruit,$1E Walnuts,$1F Mushrooms,$20 Poisonous Mushroom,$21 Green Box,$22 Berry Of Full Moon Plant,$23 Medicinal Herbs,$24 Edible Herbs,$25 Small Fish,$26 Fish,$27 Big Fish,$28 Dumpling,$29 Cotton Candy,$2A Fried Octopus,$2B Roasted Corn,$2C Candy,$2D Chocolate,$2E Iron-Ore,$2F Blue Rock,$30 Rare Metal,$31 Moonlight Stone,$32 Pontata Root,$33 Chicken,$34 Chocolate Bar Picture,$35 ???,$36 Blue Egg Shaped Device,$37 ??,$38 Chocolate Bar Picture,$39 Fodder,$3A White Bag,$3B Tan Bag,$3C Green Bag,$3D Red Bag,$3E Yellow Bag,$3F Purple Bag +Cheat8="Belongings\Slot 08",8018908B 00?? +Cheat8_O=$00 Nothing,$01 Weeds,$02 Boulder,$03 Lumber,$04 Moondrop Plant,$05 Pink-Cat-Mint Plant,$06 Blue Plant,$07 Cake,$08 Pie,$09 Cookie,$0A Blue Feather,$0B Pink Liquid In A Bottle,$0C Red Box,$0D Turnips,$0E Potatoes,$0F Cabbages,$10 Tomatoes,$11 Corn,$12 Eggplant,$13 Strawberries,$14 Eggs,$15 Milk,$16 M Size Milk,$17 L Size Milk,$18 Gold Milk,$19 Sheared Wool,$1A High Quality Wool,$1B Wild Grapes,$1C Very Berry Fruit,$1D Tropical Fruit,$1E Walnuts,$1F Mushrooms,$20 Poisonous Mushroom,$21 Green Box,$22 Berry Of Full Moon Plant,$23 Medicinal Herbs,$24 Edible Herbs,$25 Small Fish,$26 Fish,$27 Big Fish,$28 Dumpling,$29 Cotton Candy,$2A Fried Octopus,$2B Roasted Corn,$2C Candy,$2D Chocolate,$2E Iron-Ore,$2F Blue Rock,$30 Rare Metal,$31 Moonlight Stone,$32 Pontata Root,$33 Chicken,$34 Chocolate Bar Picture,$35 ???,$36 Blue Egg Shaped Device,$37 ??,$38 Chocolate Bar Picture,$39 Fodder,$3A White Bag,$3B Tan Bag,$3C Green Bag,$3D Red Bag,$3E Yellow Bag,$3F Purple Bag +Cheat9="Tool\Slot 01",80189075 00?? +Cheat9_O=$00 Nothing,$01 Sickle,$02 Hoe,$03 Axe,$04 Hammer,$05 Watering Can,$06 Milker,$07 Bell,$08 Brush,$09 Clippers,$0A Turnip Seeds,$0B Potato Seeds,$0C Cabbage Seeds,$0D Tomato Seeds,$0E Corn Seeds,$0F Eggplant Seeds,$10 Strawberry Seeds,$11 Moon Drop Grass Seeds,$12 Pink-Cat-Mint Seeds,$13 Blue Mist Seeds,$14 Bird Feed,$15 Ball No Picture,$16 Feeding Bottle,$17 ??,$18 Fishing Pole,$19 Miracle Potion,$1A Medicine For Cows,$1B Grass Seeds,$1C Blue Feather,$1D Empty Bottle,$1E ??,$1F Weeds No Picture,$20 Boulder No Picture, +Cheat10="Tool\Slot 02",80189076 00?? +Cheat10_O=$00 Nothing,$01 Sickle,$02 Hoe,$03 Axe,$04 Hammer,$05 Watering Can,$06 Milker,$07 Bell,$08 Brush,$09 Clippers,$0A Turnip Seeds,$0B Potato Seeds,$0C Cabbage Seeds,$0D Tomato Seeds,$0E Corn Seeds,$0F Eggplant Seeds,$10 Strawberry Seeds,$11 Moon Drop Grass Seeds,$12 Pink-Cat-Mint Seeds,$13 Blue Mist Seeds,$14 Bird Feed,$15 Ball No Picture,$16 Feeding Bottle,$17 ??,$18 Fishing Pole,$19 Miracle Potion,$1A Medicine For Cows,$1B Grass Seeds,$1C Blue Feather,$1D Empty Bottle,$1E ??,$1F Weeds No Picture,$20 Boulder No Picture, +Cheat11="Tool\Slot 03",80189077 00?? +Cheat11_O=$00 Nothing,$01 Sickle,$02 Hoe,$03 Axe,$04 Hammer,$05 Watering Can,$06 Milker,$07 Bell,$08 Brush,$09 Clippers,$0A Turnip Seeds,$0B Potato Seeds,$0C Cabbage Seeds,$0D Tomato Seeds,$0E Corn Seeds,$0F Eggplant Seeds,$10 Strawberry Seeds,$11 Moon Drop Grass Seeds,$12 Pink-Cat-Mint Seeds,$13 Blue Mist Seeds,$14 Bird Feed,$15 Ball No Picture,$16 Feeding Bottle,$17 ??,$18 Fishing Pole,$19 Miracle Potion,$1A Medicine For Cows,$1B Grass Seeds,$1C Blue Feather,$1D Empty Bottle,$1E ??,$1F Weeds No Picture,$20 Boulder No Picture, +Cheat12="Tool\Slot 04",80189078 00?? +Cheat12_O=$00 Nothing,$01 Sickle,$02 Hoe,$03 Axe,$04 Hammer,$05 Watering Can,$06 Milker,$07 Bell,$08 Brush,$09 Clippers,$0A Turnip Seeds,$0B Potato Seeds,$0C Cabbage Seeds,$0D Tomato Seeds,$0E Corn Seeds,$0F Eggplant Seeds,$10 Strawberry Seeds,$11 Moon Drop Grass Seeds,$12 Pink-Cat-Mint Seeds,$13 Blue Mist Seeds,$14 Bird Feed,$15 Ball No Picture,$16 Feeding Bottle,$17 ??,$18 Fishing Pole,$19 Miracle Potion,$1A Medicine For Cows,$1B Grass Seeds,$1C Blue Feather,$1D Empty Bottle,$1E ??,$1F Weeds No Picture,$20 Boulder No Picture, +Cheat13="Tool\Slot 05",80189079 00?? +Cheat13_O=$00 Nothing,$01 Sickle,$02 Hoe,$03 Axe,$04 Hammer,$05 Watering Can,$06 Milker,$07 Bell,$08 Brush,$09 Clippers,$0A Turnip Seeds,$0B Potato Seeds,$0C Cabbage Seeds,$0D Tomato Seeds,$0E Corn Seeds,$0F Eggplant Seeds,$10 Strawberry Seeds,$11 Moon Drop Grass Seeds,$12 Pink-Cat-Mint Seeds,$13 Blue Mist Seeds,$14 Bird Feed,$15 Ball No Picture,$16 Feeding Bottle,$17 ??,$18 Fishing Pole,$19 Miracle Potion,$1A Medicine For Cows,$1B Grass Seeds,$1C Blue Feather,$1D Empty Bottle,$1E ??,$1F Weeds No Picture,$20 Boulder No Picture, +Cheat14="Tool\Slot 06",8018907A 00?? +Cheat14_O=$00 Nothing,$01 Sickle,$02 Hoe,$03 Axe,$04 Hammer,$05 Watering Can,$06 Milker,$07 Bell,$08 Brush,$09 Clippers,$0A Turnip Seeds,$0B Potato Seeds,$0C Cabbage Seeds,$0D Tomato Seeds,$0E Corn Seeds,$0F Eggplant Seeds,$10 Strawberry Seeds,$11 Moon Drop Grass Seeds,$12 Pink-Cat-Mint Seeds,$13 Blue Mist Seeds,$14 Bird Feed,$15 Ball No Picture,$16 Feeding Bottle,$17 ??,$18 Fishing Pole,$19 Miracle Potion,$1A Medicine For Cows,$1B Grass Seeds,$1C Blue Feather,$1D Empty Bottle,$1E ??,$1F Weeds No Picture,$20 Boulder No Picture, +Cheat15="Tool\Slot 07",8018907B 00?? +Cheat15_O=$00 Nothing,$01 Sickle,$02 Hoe,$03 Axe,$04 Hammer,$05 Watering Can,$06 Milker,$07 Bell,$08 Brush,$09 Clippers,$0A Turnip Seeds,$0B Potato Seeds,$0C Cabbage Seeds,$0D Tomato Seeds,$0E Corn Seeds,$0F Eggplant Seeds,$10 Strawberry Seeds,$11 Moon Drop Grass Seeds,$12 Pink-Cat-Mint Seeds,$13 Blue Mist Seeds,$14 Bird Feed,$15 Ball No Picture,$16 Feeding Bottle,$17 ??,$18 Fishing Pole,$19 Miracle Potion,$1A Medicine For Cows,$1B Grass Seeds,$1C Blue Feather,$1D Empty Bottle,$1E ??,$1F Weeds No Picture,$20 Boulder No Picture, +Cheat16="Tool\Slot 08",8018907C 00?? +Cheat16_O=$00 Nothing,$01 Sickle,$02 Hoe,$03 Axe,$04 Hammer,$05 Watering Can,$06 Milker,$07 Bell,$08 Brush,$09 Clippers,$0A Turnip Seeds,$0B Potato Seeds,$0C Cabbage Seeds,$0D Tomato Seeds,$0E Corn Seeds,$0F Eggplant Seeds,$10 Strawberry Seeds,$11 Moon Drop Grass Seeds,$12 Pink-Cat-Mint Seeds,$13 Blue Mist Seeds,$14 Bird Feed,$15 Ball No Picture,$16 Feeding Bottle,$17 ??,$18 Fishing Pole,$19 Miracle Potion,$1A Medicine For Cows,$1B Grass Seeds,$1C Blue Feather,$1D Empty Bottle,$1E ??,$1F Weeds No Picture,$20 Boulder No Picture, +Cheat17="Item\Slot 01",8018908E 00?? +Cheat17_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat18="Item\Slot 02",8018908F 00?? +Cheat18_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat19="Item\Slot 03",80189090 00?? +Cheat19_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat20="Item\Slot 04",80189091 00?? +Cheat20_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat21="Item\Slot 05",80189092 00?? +Cheat21_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat22="Item\Slot 06",80189093 00?? +Cheat22_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat23="Item\Slot 07",80189094 00?? +Cheat23_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat24="Item\Slot 08",80189095 00?? +Cheat24_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat25="Item\Slot 09",80189096 00?? +Cheat25_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat26="Item\Slot 10",80189097 00?? +Cheat26_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat27="Item\Slot 11",80189098 00?? +Cheat27_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat28="Item\Slot 12",80189099 00?? +Cheat28_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat29="Item\Slot 13",8018909A 00?? +Cheat29_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat30="Item\Slot 14",8018909B 00?? +Cheat30_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat31="Item\Slot 15",8018909C 00?? +Cheat31_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat32="Item\Slot 16",8018909D 00?? +Cheat32_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat33="Item\Slot 17",8018909E 00?? +Cheat33_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat34="Item\Slot 18",8018909F 00?? +Cheat34_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat35="Item\Slot 19",801890A0 00?? +Cheat35_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat36="Item\Slot 20",801890A1 00?? +Cheat36_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat37="Item\Slot 21",801890A2 00?? +Cheat37_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat38="Item\Slot 22",801890A3 00?? +Cheat38_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat39="Item\Slot 23",801890A4 00?? +Cheat39_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat40="Item\Slot 24",801890A5 00?? +Cheat40_O=$00 Nothing,$01 Ocarina,$02 Flower Card,$03 Cake Card,$04 Broken Music Box,$05 ??,$06 Old Wine,$07 ??,$08 ??,$09 Book From Library,$0A Scroll To Bury,$0B Marble,$0C GoodLuck Charm,$0D Empty Metal Bag,$0E Horse Race Ticket,$0F Dog Race Ticket,$10 Potpourri,$11 Embroidered Hankerchief,$12 Hand - Knit Socks,$13 Lucky Bracelet,$14 Flower Bath Crystals,$15 Stamina Carrot +Cheat41="Infinite\Watering Can Uses",8016FBCD 0004 +Cheat42="Infinite\Fodder Spout (Sheep And Cows)",81180714 0063 +Cheat43="Infinite\Chicken Feed",80237411 005C +Cheat44="Infinite\Lumber",81189E50 03E7 +Cheat45="Infinite\Stamina",80189060 00FF +Cheat46="Infinite\Flower Card Points",802373F0 0063 +Cheat47="Infinite\Medals For Horse & Dog Races",81189B06 270F,81205206 270F +Cheat48="Infinite\Cake Card Points",80181B10 0063 +Cheat49="Infinite\Horse Stamina",802F5015 0002 +Cheat50="Make\Ann Love You",801C3F93 00FF +Cheat51="Make\Elli Love You",801C3F92 00FF +Cheat52="Make\Maria Love You",801C3F90 00FF +Cheat53="Make\Popuri Love You",801C3F91 00FF +Cheat54="Make\Karen Love You",801C3F94 00FF +Cheat55="Have\All Pics",8118905A FFFF +Cheat56="Have\Win Dog Races",801886B0 00FF +Cheat57="Have\Max Shipped In Bin!",8023738A FFFF + +//---- + +[7F3CEB77-8981030A-C:45] +Name=Hercules: The Legendary Journeys (U) +Cheat0="Infinite Health",810CF93E 03E7,810CF942 03E7 +Cheat1="Infinite Dinars",800B6043 00E8,800B6042 00E8 +Cheat2="Infinite Magic",810B65CA 0063,810B65B2 0063,810B65E2 0063,810B65FA 0063 +Cheat3="Press L to Levitate",D017D2D5 0020,810CF994 44CB +Cheat3_N=Press L Button to Levitate & Let go to come back down +Cheat4="Press L for 1 Hit Kill Punch",D0103383 0020,800D9BCE 0000 +Cheat4_N=Press The L Button & Hold B & Then Let Go to Kill Enimies,Rocks,Tents etc with One Punch. + +//---- + +[9CAB6AEA-87C61C00-C:45] +Name=Hexen (U) +Cheat0="Invincibility\Player 1",8113DB4C FFFF +Cheat1="Infinite\Blue Mana\Player 1",8013DB7D 00CF +Cheat2="Infinite\Green Mana\Player 1",8013DB7F 00CF +Cheat3="Infinite\Ammo & Items\Player 1",50002004 0000,8013DAC3 0064 +Cheat4="Always Have\Fist,Mace,Staff\Player 1",8013DB75 00FF +Cheat5="Always Have\Axe,Staff,Frost,Shards\Player 1",8013DB77 00FF +Cheat6="Always Have\Hammer,Firestorm & Arc of Death\Player 1",8013DB79 00FF +Cheat7="Always Have\Quietus,Wraithverge,Bloodscourge\Player 1",8013DB7B 00FF +Cheat8="Open\Main Cheat Menu",80136773 0005 +Cheat9="Open\All Options in Cheat Menu",81136696 FFFF +Cheat10="Have All\Keys\Player 1",8113DB5C 07FF +Cheat11="Boots Of Speed Always On\Player 1",8113DB58 03FF +Cheat12="Icon Of The Defender Always On\Player 1",8113DB4C 03FF +Cheat13="Wings Of Wraith Always On\Player 1",8013DB53 03FF +Cheat14="Play As\Player 1",8014A749 00?? +Cheat14_O=$00 Fighter,$00 1 Cleric,$00 2 Mage +Cheat15="Invincibility\Player 2",8113DCE8 FFFF +Cheat16="Icon Of The Defender Always On\Player 2",8113DCE8 03FF +Cheat17="Boots Of Speed Always On\Player 2",8113DCF4 03FF +Cheat18="Wings Of Wraith Always On\Player 2",8113DCEE 03FF +Cheat19="Have All\Keys\Player 2",8113DCF8 07FF +Cheat20="Infinite\Blue Mana\Player 2",8013DD19 00CF +Cheat21="Infinite\Green Mana\Player 2",8013DD1B 00CF +Cheat22="Always Have\Fist,Mace,Staff\Player 2",8013DD11 00FF +Cheat23="Always Have\Axe,Staff,Frost,Shards\Player 2",8013DD13 00FF +Cheat24="Always Have\Hammer,Firestorm & Arc of Death\Player 2",8013DD15 00FF +Cheat25="Always Have\Quietus,Wraithverge,Bloodscourge\Player 2",8013DD17 00FF +Cheat26="Invincibility\Player 3",8113DE84 FFFF +Cheat27="Icon Of The Defender Always On\Player 3",8113DE84 03FF +Cheat28="Boots Of Speed Always On\Player 3",8113DE90 03FF +Cheat29="Wings Of Wraith Always On\Player 3",8113DE8A 03FF +Cheat30="Have All\Keys\Player 3",8113DE94 07FF +Cheat31="Infinite\Blue Mana\Player 3",8013DEB5 00CF +Cheat32="Infinite\Green Mana\Player 3",8013DEB7 00CF +Cheat33="Always Have\Fist,Mace,Staff\Player 3",8013DEAD 00FF +Cheat34="Always Have\Axe,Staff,Frost,Shards\Player 3",8013DEAF 00FF +Cheat35="Always Have\Hammer,Firestorm & Arc of Death\Player 3",8013DEB1 00FF +Cheat36="Always Have\Quietus,Wraithverge,Bloodscourge\Player 3",8013DEB3 00FF +Cheat37="Invincibility\Player 4",8113E020 FFFF +Cheat38="Icon Of The Defender Always On\Player 4",8113E020 03FF +Cheat39="Boots Of Speed Always On\Player 4",8113E02C 03FF +Cheat40="Wings Of Wraith Always On\Player 4",8113E026 03FF +Cheat41="Have All\Keys\Player 4",8113E030 07FF +Cheat42="Infinite\Blue Mana\Player 4",8013E051 00CF +Cheat43="Infinite\Green Mana\Player 4",8013E053 00CF +Cheat44="Always Have\Fist,Mace,Staff\Player 4",8013E049 00FF +Cheat45="Always Have\Axe,Staff,Frost,Shards\Player 4",8013E04B 00FF +Cheat46="Always Have\Hammer,Firestorm & Arc of Death\Player 4",8013E04D 00FF +Cheat47="Always Have\Quietus,Wraithverge,Bloodscourge\Player 4",8013E04F 00FF + +//---- + +[C7C98F8E-42145DDE-C:45] +Name=Hot Wheels Turbo Racing (U) +Cheat0="Infinite Turbos\Player 1",80118CFC 000A +Cheat1="Infinite Turbos\Player 2",80119478 000A +Cheat2="Start On Lap Modifier\Player 1",D0118AA8 0000,80118AA8 00?? +Cheat3="Start On Lap Modifier\Player 2",D0119224 0000,80119224 00?? +Cheat4="Max Tournament Points",81124A16 00FF +Cheat5="Have\All Tracks",81124A0E FFFF +Cheat6="Have\All Cars & Cups\Player 1",81124A0A FFFF +Cheat7="Have\All Cars & Cups\Player 2",81124B4A FFFF +Cheat8="Press L For Time Is Always 0:00:00\Player 1",D0137FE5 0020,810F3900 0000,D0137FE5 0020,810F3902 0000 +Cheat9="Press L For Time Is Always 0:00:00\Player 2",D0137FED 0020,810F3900 0000,D0137FED 0020,810F3902 0000 +Cheat10="Have\All Special Cars\Player 1",81124A04 FFFF,81124A06 FFFF,81124A0A FFFF +Cheat11="Have\All Special Cars\Player 2",81124B44 FFFF,81124B46 FFFF,81124B4A FFFF +Cheat12="Allways 1st",8111D7EA 0000 +Cheat2_O=$00 1st,$01 2nd,$02 3rd,$03 4th +Cheat3_O=$00 1st,$01 2nd,$02 3rd,$03 4th + +//---- + +[102888BF-434888CA-C:45] +Name=Hybrid Heaven (U) +Cheat0="Have All\Keys",50000410 0000,8017E130 0063,50000410 0000,8017E138 0063 +Cheat1="Infinite\Weapons & Items",50000610 0000,8017E0D0 0063,50000610 0000,8017E0D8 0063 +Cheat2="Infinite\Refresh Items",50000D10 0000,8017E008 0063,50000C10 0000,8017E010 0063 +Cheat3="Infinite\Max Body Stats",8117DC48 270F,8117DC88 0063,50000C02 0000,8117DC50 270F,50000502 0000,8117DC80 270F,50000602 0000,8117DCA8 270F,50000602 0000,8117DCB6 270F +Cheat4="Infinite\Max Health",8117DC40 270F,8117DC42 270F +Cheat5="Level 999",8117DC88 270F +Cheat6="Press L To Levitate",D005CE51 0020,8124A0B0 3FCB +Cheat7="Have All\Moves",50005306 0000,81183CE0 0100,50005306 0000,81183CE2 00FF +Cheat8="Editor's Cheat Level and Battle Select",801CC8C4 0005 + +//---- + +[C8DC65EB-3D8C8904-C:45] +Name=Hydro Thunder (U) +Cheat0="Always 1st",812C4C96 0001 +Cheat1="Infinite\Time",812B4890 42C8 +Cheat2="Infinite\Boosts\Player 1",812C4C9C 4190 +Cheat3="Have All\Races",812B5C94 0101,812B5C96 0101,812B5C98 0101,812B5C9A 0101,812B5C9C 0101,812B5C9E 0101,812B5CA0 0101 +Cheat4="Have All\Boats",812B5CA2 0101,812B5CA4 0101,812B5CA6 0101,812B5CA8 0101,812B5CAA 0101,812B5CAC 0101,812B5CAE 0101 +Cheat5="Infinite\Boosts\Player 2",812C4FCC 4190 +Cheat6="Hydro Speedway",802B5C94 00?? +Cheat6_O=$01 Unlocked & Not Completed,$03 Unlocked & Completed + +//---- + +[E436467A-82DE8F9B-C:45] +Name=Indy Racing 2000 (U) +Cheat0="Max Exp (Gold Cup - All Classes Unlocked)",81033918 7FFF,8103391A FFFF +Cheat1="Driver Modifier (Champsionship Mode)",812CBEC6 00?? +Cheat2="Always Place 1st",8012955F 0001 +Cheat3="Unlock\Gold Cup 1st Upgrade",81023100 0000,81023102 0000 +Cheat4="Unlock\Gold Cup 2nd Upgrade",81023104 0000,81023106 0000 +Cheat5="Unlock\Sprint Car Class",810230EE 0000,810230EC 0000 +Cheat6="Unlock\Formula Cars Part 1",810230F0 0000,810230F2 0000,810230F4 0000,810230F6 0000 +Cheat1_O=$00 Scott Goodyear #4,$01 Greg Ray #2,$02 Billy Boat #11,$03 Eddie Cheever Jr.#51,$04 Buddy Lazier #91,$05 Davey Hamilton #9,$06 Sam Schmidt #99,$07 Scott Sharp #8,$08 Buzz Calkins #12,$09 Kenny Brack #14,$0A Robbie Buyl #22,$0B Tyce Carison #20,$0C Mark Dismore #28,$0D Roberto Guerrero #50,$0E Johnny Unser #92,$0F Robby Unser #81,$10 Jeff Ward #21,$11 Stephan Gregoire #7,$12 Robby McGehee #55,$13 John Hollansworth Jr. #42 +Cheat0_N=With the 'Max Exp' codes for the Gold Cup, start a new file and leave it and go back to it again. + +//---- + +[E616B5BC-C9658B88-C:45] +Name=Iggy's Reckin' Balls (U) +Cheat0="Extra Characters",810C632E FFFF +Cheat1="Always Have 99 Points",810D8EE0 0063 +Cheat2="Infinite Credits",800BDEA5 0005 +Cheat3="Enable All Courses",810CCDF2 0B00,810CCDF4 0B00,810CCDF6 0B00 + +//---- + +[69256460-B9A3F586-C:45] +Name=Jeopardy (U) +Cheat0="Max Money\Player 1",81058122 FFFF +Cheat1="Max Money\Player 2",81058124 FFFF +Cheat3="Max Money\Player 3",81058126 FFFF + +//---- + +[BB30B1A5-FCF712CE-C:45] +Name=Jeremy McGrath Supercross 2000 (U) +Cheat0="Extra Points",800711E7 00FF +Cheat1="Enable Tabletop Freestyle",81071832 0001 +Cheat2="Enable Chasm Freestyle",81071834 0001 +Cheat3="Enable Jim Jam Freestyle",81071838 0001 +Cheat4="Enable Moon Freestyle",8107183C 0001 + +//---- + +[8A6009B6-94ACE150-C:45] +Name=Jet Force Gemini (U) +Cheat0="Access\All Characters",801E6040 FFFF +Cheat1="Juno\Infinite Continues",800A3281 0002 +Cheat2="Juno\Full & Max Health",801BF976 0040,801E61E5 000C,801E61E2 0040 +Cheat3="Juno\Access\All Keys",811E6248 FFF7 +Cheat4="Juno\Access\All Objects",811E624A FFFF +Cheat5="Juno\Infinite\Mizar Tokens",811E61F4 02F4 +Cheat6="Juno\Max Blue & White Heads",811E61EA 03E7,811E61E8 03E7 +Cheat7="Juno\Infinite\Max Ammo All Weapons",50000302 0000,811E61F6 02F4,50000802 0000,811E61FC 02F4,50000402 0000,811E620C 02F4 +Cheat8="Vela\Full & Max Health",801E616F 000C,801E616C 0040 +Cheat9="Vela\Access\All Keys",811E61D2 FF70 +Cheat10="Vela\Access\All Objects",811E61D4 FFFF +Cheat11="Vela\Infinite\Mizar Tokens",811E617E 02F4 +Cheat12="Vela\Max\Blue & White Heads",811E6174 03E7,811E6172 03E7 +Cheat13="Vela\Infinite\Max Ammo All Weapons",50000302 0000,811E6180 02F4,50000802 0000,811E6186 02F4,50000402 0000,811E6196 02F4 +Cheat14="Lupus\Full & Max Health",801BF9EC 0040,801E625B 000C,801E6258 0040 +Cheat15="Lupus\Access\All Keys",811E62BE FF70 +Cheat16="Lupus\Access\All Objects",811E62C0 FFFF +Cheat17="Lupus\Infinite\Mizar Tokens",811E626A 02F4 +Cheat18="Lupus\Max\Blue & White Heads",811E6260 03E7,811E625E 03E7 +Cheat19="Lupus\Infinite\Max Ammo All Weapons",50000302 0000,811E626C 02F4,50000802 0000,811E6272 02F4,50000402 0000,811E6282 02F4 +Cheat20="Access\All Floyd Awards",50000501 0000,801E6038 0005 +Cheat20_N=only enable One character at a time when using this code +Cheat21="Juno\Access\All Weapons",801E61EC 00FF,801E61ED 00FF +Cheat22="Vela\Access\All Weapons",801E6176 00FF,801E6177 00FF +Cheat23="Lupus\Access\All Weapons",801E6262 00FF,801E6263 00FF +Cheat24="Tribals\Have All Tribals\Gold Wood",801E6014 000F +Cheat25="Tribals\No Tribals Killed\Gold Wood",801E6015 0000 +Cheat26="Tribals\Have No Tribals Remaining\Gold Wood",801E6016 0000 +Cheat21_N=Do not put this code on until you collect one Extra Weapon then you will have all ready to use +Cheat22_N=Do not put this code on until you collect one Extra Weapon then you will have all ready to use +Cheat23_N=Do not put this code on until you collect one Extra Weapon then you will have all ready to use +Cheat27="Wide Screen Always Off",800FECA8 0000 + +//---- + +[D0151AB0-FE5CA14B-C:45] +Name=John Romero's Daikatana (U) +Cheat0="Infinite\Health",8020A965 0064 +Cheat1="Infinite\Armor",8020A987 0064 +Cheat2="Infinite\Experience",8020A967 00FF +Cheat3="Max\Vitality",8020A969 0007 +Cheat4="Max\Attack",8020A96B 0007 +Cheat5="Max\Speed",8020A96D 0007 +Cheat6="Max\Acro",8020A96F 0007 +Cheat7="Max\Power",8020A971 0007 +Cheat8="Infinite\Ammo\Sidewinder",8020A9B0 00FF +Cheat9="Infinite\Ammo\Shock Wave",8020A9B1 00FF +Cheat10="Infinite\Ammo\Chvizatergo",8020A9B2 00FF +Cheat11="Infinite\Ammo\Shot Cycler",8020A9B3 00FF +Cheat12="Infinite\Ammo\Ion Cannon",8020A9B4 00FF +Cheat13="Infinite\Ammo\Disc Of Dredalus",8020A9B5 0063 +Cheat14="Infinite\Ammo\Venomous",8020A9B6 00FF +Cheat15="Infinite\Ammo\Poseidon Trident",8020A9B7 00FF +Cheat16="Infinite\Ammo\Hammer",8020A9B8 0000 +Cheat17="Infinite\Ammo\Sunflares",8020A9B9 00FF +Cheat18="Infinite\Ammo\Bolter",8020A9BA 00FF +Cheat19="Infinite\Ammo\Ballista",8020A9BB 00FF +Cheat20="Infinite\Ammo\Stavros Stave",8020A9BC 00FF +Cheat21="Infinite\Ammo\Wyndraxs Wisp",8020A9BD 00FF +Cheat22="Have All Weapons",8120A8F6 FFFF + +//---- + +[36281F23-009756CF-C:45] +Name=Ken Griffey Jr.'s Slugfest (U) +Cheat0="Max\Batting",8105D6D8 4120 +Cheat1="Max\Power",8105D270 4120 +Cheat2="Max\Speed",8105CE68 4120 +Cheat3="Max\Defense",8105CA60 4120 +Cheat4="Max\Arm Strength",8105C5F8 4120 +Cheat5="Max\Durability",8105C098 4120 +Cheat6="Max\Clutch",8105BB98 4120 +Cheat7="Max\Control",8105B760 4120 +Cheat8="Max\Stamina",8105B2F8 4120 +Cheat9="Max\Pitch Speed",8105AE90 4120 +Cheat10="Infinite\Creation Points",81059408 420C +Cheat11="Infinite\Strikes",8021AC48 0000 +Cheat12="Infinite\Balls",8021AC47 0000 +Cheat13="Inning Selection",8021AC42 00?? +Cheat13_O=$02 2nd Inning,$03 3rd Inning,$04 4th Inning,$05 5th Inning,$06 6th Inning,$07 7th Inning,$08 8th Inning,$09 9th Inning + +//---- + +[9E8FE2BA-8B270770-C:45] +Name=Killer Instinct Gold (U) (v1.0) +Cheat0="Unlock All Options",8012834C 0006 +Cheat1="Player 1\Untouchable",801D34D4 000A +Cheat2="Player 1\Fast\Punch Kick",801D347E 0010 +Cheat3="Player 1\Fast\Jump Walk",801D347C 0001 +Cheat4="Player 1\Slow Jump Walk",801D347D 0050 +Cheat5="Player 1\Infinite Energy",801D3484 0069 +Cheat6="Player 1\Fight Gargos Immediately",8012834B 000A +Cheat7="Player 1\Spinal Always Has All Skulls",801D3523 0006 +Cheat8="Player 1\Fulgore\Always Invisible",801D3478 0020,801D3479 0090,801D34C5 0092,801D3527 005E +Cheat8_N=Do not use this with Fulgore Always Visible +Cheat9="Player 1\Fulgore\Always Visible",801D3478 0023,801D3479 00F0,801D34C5 0080,801D3527 00AF +Cheat9_N=Do not use this with Fulgore Always Invisible +Cheat10="Player 1\Wins Score",8012830A 00FF +Cheat11="Player 1\Undefeated Players Scroll By Quickly",802C8CE8 0007 +Cheat12="Player 1\Play As",802C8CB8 00?? +Cheat12_O=$00 Jago,$01 Combo,$02 Spinal,$03 Tusk,$04 Glacius,$05 Fulgore,$06 Kim Wu,$07 Sabrewulf,$08 Orchid,$09 Maya,$0A Gargos +Cheat13="Player 1\1-Hit Death",D01D3484 0078,801D3484 0001 +Cheat14="Player 2\Spinal Always Has All Skulls",801D3623 0006 +Cheat15="Player 2\Fulgore Always Invisible",801D3578 0020,801D3579 0090,801D35C5 0092,801D3527 005E +Cheat15_N=Do not use this with Fulgore Always Visible +Cheat16="Player 2\Fulgore Always Visible",801D3578 0023,801D3579 00F0,801D35C5 0080,801D3527 00AF +Cheat16_N=Do not use this with Fulgore Always Invisible +Cheat17="Player 2\Play As",8004EA9D 00?? +Cheat17_O=$00 Jago,$01 Combo,$02 Spinal,$03 Tusk,$04 Glacius,$05 Fulgore,$06 Kim Wu,$07 Sabrewulf,$08 Orchid,$09 Maya,$0A Gargos +Cheat18="Player 2\Infinite Energy",801D3584 0078 +Cheat19="Player 2\Fast\Punch Kick",801D357E 0010 +Cheat20="Player 2\Fast\Jump Walk",801D357C 0001 +Cheat21="Player 2\Slow\Punch Kick",801D357F 0050 +Cheat22="Player 2\Slow\Jump Walk",801D357D 0050 +Cheat23="Player 2\Untouchable",801D34D5 000A + +//---- + +[46039FB4-0337822C-C:45] +Name=Kirby 64 - The Crystal Shards (U) +Cheat0="Get All Crystals",50000701 0000,800D6BC0 0001,50001701 0000,800D6BC8 0007 +Cheat1="Unlock All Difficulty Levels\100 Yard Hop",800D6BB9 0003 +Cheat2="Unlock All Difficulty Levels\Bumper Crop Bump",800D6BBA 0003 +Cheat3="Unlock All Difficulty Levels\Checkerboard Chase",800D6BBB 0003 +Cheat4="Infinite Lives",800D714F 0064 +Cheat5="Infinite Health",810D6E50 40C0 +Cheat6="Can Fly Forever",8112E7DE 00F0 +Cheat7="All Stages Complete",50002B01 0000,800D6BE0 0002 + +//---- + +[FCE0D799-65316C54-C:45] +Name=Knife Edge - Nose Gunner (U) +Cheat0="Infinite\Armor",8011D467 0064 +Cheat1="Level 11 Vulcan Cannon",801239B3 000A +Cheat2="Infinite\Bombs",8011D46F 0003 +Cheat3="Press\L For Rapid Fire On Nuke & Laser",D011BE01 0020,8011D497 0028 +Cheat3_N=Do not use this with Press L For Rapid Fire On Flak +Cheat4="Press\L For Rapid Fire On Flak",D011BE01 0020,8011D497 0014 +Cheat4_N=Do not use this with Press L For Rapid Fire On Nuke & Laser + +//---- + +[0894909C-DAD4D82D-C:45] +Name=Knockout Kings 2000 (U) +Cheat0="Player 1\Infinite\Health",8106B974 42C8,8106B976 0000 +Cheat1="Player 2\Infinite\Health",8106BA7C 42C8,8106BA7E 0000 +Cheat2="Player 1\No Health",8106B974 0000,8106B976 0000 +Cheat3="Player 2\No Health",8106BA7C 0000,8106BA7E 0000 +Cheat4="Player 1\Max\Power",8106B980 0000,8106B982 0BB2 +Cheat5="Player 1\No Power",8106B980 0000,8106B982 0000 +Cheat6="Player 2\Max\Power",8106BA88 0000,8106BA8A 0BB2 +Cheat7="Player 2\No Power",8106BA88 0000,8106BA8A 0000 +Cheat8="Infinite\Creation Points",81063742 0064 +Cheat9="Big\Head Mode",800F401C 0001 +Cheat10="Big\Glove Mode",800F401D 0001 +Cheat11="Player 1\Power Punch After 1st Punch",8006B983 0064 +Cheat12="Player 2\Power Punch After 1st Punch",8006BA8B 0064 +Cheat13="Stop Timer",81067546 001C +Cheat14="Player 1\Character Modifier",800EC6F3 00?? +Cheat15="Player 2\Character Modifier",800EC6F7 00?? +Cheat14_O=$00 Ali,$01 Frazier,$02 Holmes,$03 Holyfield,$04 Lewis,$05 Tua,$06 Spinks,$07 Butterbean,$08 De La Hoya,$09 Leonard,$0A Hagler,$0B Duran,$0C Whitaker,$0D Quartey,$0E Carr,$0F Vargas,$10 Reid,$11 Moskey,$12 Pryor,$13 Argnello,$14 O'Grady,$15 Mayweather,$16 Manfredy,$17 Kelley,$18 Romero,$19 Random,$1A Created Boxer,$1B Creater Boxer,$1C Dempsey,$1D K. Orr,$1E IUppa,$1F S. Sandoval,$20 S. Broadhurst,$21 Pole,$22 Hasson,$23 Alameda,$24 Wahlberg,$25 Scott,$26 Hopra,$27 Eckhardt,$28 Parker,$29 Ruiz,$2A F. Sandoval,$2B Ang,$2C Bristov,$2D Botti,$2E S. Orr,$2F Zarifes,$30 Giolito,$31 Garrett,$32 Barclay,$33 Wynne,$34 Lupidi,$35 W. Aguitar,$36 Di Ricco,$37 Philippine,$38 M. Broadhurst,$39 Weaver,$3A Lajoie,$3B Greenberg,$3C Quinn,$3D Perone,$3E Tool,$3F Bunch,$40 St. Aubyn,$41 Wells,$42 Dexter,$43 Hsu,$44 Bazzel,$45 Thompson,$46 Eklund,$47 Tallarico,$48 de Leon,$49 Coallier +Cheat15_O=$00 Ali,$01 Frazier,$02 Holmes,$03 Holyfield,$04 Lewis,$05 Tua,$06 Spinks,$07 Butterbean,$08 De La Hoya,$09 Leonard,$0A Hagler,$0B Duran,$0C Whitaker,$0D Quartey,$0E Carr,$0F Vargas,$10 Reid,$11 Moskey,$12 Pryor,$13 Argnello,$14 O'Grady,$15 Mayweather,$16 Manfredy,$17 Kelley,$18 Romero,$19 Random,$1A Created Boxer,$1B Creater Boxer,$1C Dempsey,$1D K. Orr,$1E IUppa,$1F S. Sandoval,$20 S. Broadhurst,$21 Pole,$22 Hasson,$23 Alameda,$24 Wahlberg,$25 Scott,$26 Hopra,$27 Eckhardt,$28 Parker,$29 Ruiz,$2A F. Sandoval,$2B Ang,$2C Bristov,$2D Botti,$2E S. Orr,$2F Zarifes,$30 Giolito,$31 Garrett,$32 Barclay,$33 Wynne,$34 Lupidi,$35 W. Aguitar,$36 Di Ricco,$37 Philippine,$38 M. Broadhurst,$39 Weaver,$3A Lajoie,$3B Greenberg,$3C Quinn,$3D Perone,$3E Tool,$3F Bunch,$40 St. Aubyn,$41 Wells,$42 Dexter,$43 Hsu,$44 Bazzel,$45 Thompson,$46 Eklund,$47 Tallarico,$48 de Leon,$49 Coallier +Cheat16="Ring Modifier",800EC703 00?? +Cheat16_O=$00 Great Western Forum,$01 Caesars Palace,$02 Ecko Sports Arena,$03 International Arena,$04 Local 440,$05 The Colosseum,$06 Roppongi Palace,$07 Wembley Arena,$08 Knockout Kings Arena + +//---- + +[5354631C-03A2DEF0-C:45] +Name=Legend of Zelda 2, The - Majora's Mask (U) +Cheat0="Infinite\Health",811EF6A6 0140 +Cheat1="Infinite\Hearts Options",811EF6A4 ???? +Cheat1_O=$0140 Max Hearts,$0063 6 Hearts,$0043 4 Hearts +Cheat1_N=If you need to clear the Infinite Max Hearts from the screen just choose the 6 or 4 Heart Options, take off the cheat & then make a save. +Cheat3="Infinite\Rupees",811EF6AA 03E7 +Cheat4="Infinite\Max & Double Magic Meter",801EF6A9 0060,811EF6B0 0101 +Cheat5="Infinite\Items",801EF711 0063,801EF716 0063,801EF717 0063,801EF718 0063,801EF719 0063,801EF71A 0063,801EF71C 0063,801EF71D 0063 +Cheat6="Have\Ocarina of Time",801EF6E0 0000 +Cheat7="Have\Hero's Bow",801EF6E1 0001 +Cheat8="Have\Arrows\Fire Arrow",801EF6E2 0002 +Cheat9="Have\Arrows\Ice Arrow",801EF6E3 0003 +Cheat10="Have\Arrows\Light Arrow",801EF6E4 0004 +Cheat11="Have\Bombs",801EF6E6 0006 +Cheat12="Have\Bombchu",801EF6E7 0007 +Cheat13="Have\Deku Sticks",801EF6E8 0008 +Cheat14="Have\Deku Nuts",801EF6E9 0009 +Cheat15="Have\Magic Beans",801EF6EA 000A +Cheat16="Have\Powder Kegs",801EF6EC 000C +Cheat17="Have\Pictograph",801EF6ED 000D +Cheat18="Have\Lens of Truth",801EF6EE 000E +Cheat19="Have\Hookshot",801EF6EF 000F +Cheat20="Have\Great Fairy's Sword",801EF6F0 0010 +Cheat21="Maximum Visibility",80166118 0020 +Cheat22="Fog\Blue",80166108 0020 +Cheat23="Fog\Pink",8016610C 0020 +Cheat24="Fog\Yellow",80166110 0020 +Cheat25="Press L To Levitate",D03E6B3B 0020,813FFE18 40CB +Cheat25_N=Press L To Levitate & Let go to land +Cheat26="Have\All Masks",801EF6F8 003E,801EF6F9 0038,801EF6FA 0047,801EF6FB 0045,801EF6FC 0040,801EF6FD 0032,801EF6FE 003A,801EF6FF 0046,801EF700 0039,801EF701 0042,801EF702 0048,801EF703 0033,801EF704 003C,801EF705 003D,801EF706 0037,801EF707 003F,801EF708 0036,801EF709 0034,801EF70A 0043,801EF70B 0041,801EF70C 003B,801EF70D 0044,801EF70E 0049,801EF70F 0035 +Cheat27="Beta World 1",D03E6B3B 0000,801EF672 00?? +Cheat28="Fight Demo Majora's Mask",8016A718 0020 +Cheat29="Event Item\Modifier 1",801EF6E5 00?? +Cheat30="Event Item\Modifier 2",801EF6EB 00?? +Cheat31="Event Item\Modifier 3",801EF6F1 00?? +Cheat32="Have\Item Modifier",801EF6F0 00?? +Cheat33="Bottles\Bottle 1 Modifier",801EF6F2 00?? +Cheat34="Bottles\Bottle 2 Modifier",801EF6F3 00?? +Cheat35="Bottles\Bottle 3 Modifier",801EF6F4 00?? +Cheat36="Bottles\Bottle 4 Modifier",801EF6F5 00?? +Cheat37="Bottles\Bottle 5 Modifier",801EF6F6 00?? +Cheat38="Bottles\Bottle 6 Modifier",801EF6F7 00?? +Cheat39="Use C-Buttons Anywhere",811F3588 0000,811F358A 0000 +Cheat40="All Equipment Upgrades",801EF6DD 0023,811EF72A 201B,801EF6BC 004F +Cheat41="Replace Sword With",801EF6BC 00?? +Cheat41_O=$4A Fire Arrow w/ Bow,$4B Ice Arrow w/ Bow,$4C Light Arrow w/ Bow,$4D Kokiri Sword,$4E Razor Sword,$4F Guilded Sword,$50 Deity Link's Sword +Cheat42="Play As",801EF690 00?? +Cheat43="Warp Modifier",D03E6B3A 0000,803FF395 0001,813FF39A ???? +Cheat27_O=$00 Mama's House non Beta,$01 Fearful Spider House,$02 Beneaf the Graveyard,$03 Southern Swamp Mr Tingle Entry,$06 Outside Tourist Information Southern Swamp,$08 Outside Magic Hag's Potion Shop,$0A Southern Swamp Woods Of Mystery Entry,$24 Counter Of The Tresure Chest Shop,$2E Woodfall Temple non Beta,$32 Spider Hand,$35 Statue outside Gorman Track,$36 Statue outside Lair Of The Temples Boss,$38 Path to Romani Ranch non Beta,$4A outside The Royal Palace of the Deku Kingdom,$4C Ledge in The Royal Palace of the Deku Kingdom,$4E inside The Royal Palace of the Deku Kingdom 1,$71 Green Blobs,$74 Cave Portal to Last Boss Field,$7F Waterfall Sothern Swamp,$8A Giant Turtle In the Temple non beta,$8B Room of Miau & Tijo Zora Great Hall,$94 Recieving Gorans Mask non Beta,$95 ?,$96 Hungry Goran in the Snow,$A2 Statue in Stone Tower,$A6 Stone Tower non Beta,$B9 Recieving Deku Mask non Beta,$D9 Giant Lizards in a Cave,$DA Cave with Steaming Water,$FF Vamps House In Ikana Canyon +Cheat29_O=$28 Moon's Tear,$29 Land Title Deed,$2A Swap Title Deed,$2B Mountain Title Deed,$2C Ocean Title Deed,$2D Room Key,$2E Special Delivery To Mama,$2F Letter To Kafei,$30 Pendant Of Memories +Cheat30_O=$28 Moon's Tear,$29 Land Title Deed,$2A Swap Title Deed,$2B Mountain Title Deed,$2C Ocean Title Deed,$2D Room Key,$2E Special Delivery To Mama,$2F Letter To Kafei,$30 Pendant Of Memories +Cheat31_O=$28 Moon's Tear,$29 Land Title Deed,$2A Swap Title Deed,$2B Mountain Title Deed,$2C Ocean Title Deed,$2D Room Key,$2E Special Delivery To Mama,$2F Letter To Kafei,$30 Pendant Of Memories +Cheat32_O=$05 Japanese Flute?,$0B Japanese Item?,$10 Great Fairy's Sword,$11 Japanese Hookshot?,$31 Japanese Scroll?,$4A Japanese Bow? +Cheat33_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat34_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat35_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat36_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat37_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat38_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat42_O=$00 Fierce Deity Link,$01 Goron Link,$02 Zora Link,$03 Deku Link,$04 Normal Link +Cheat43_O=$0010 Mayors Residence,$0008 Magic Hags Potion Shop,$000A Romani Ranch Barn,$000B Mama's House,$000E Honey & Darlings Shop,$0015 Final Boss Arena,$001F Beneath the Graveyard (left entrance),$002F Beneath the Graveyard (right entrance),$0030 Southern Swamp (Reg Entrance),$004F Southern Swamp (from tour house),$006E Southern Swamp (from Woodfall),$006F Southern Swamp (from Deku Palace),$0078 Path to Ikana Canyon,$009E Southern Swamp (from Deku Place 2),$009F Southern Swamp (From Potion Shop),$00AF Boat Cruise (picture taking),$00CD Southern Swamp (From Woods of Mystery),$00CE Southern Swamp (From Spider House),$00CF Southern Swamp (From Ikana Canyon),$00FE Southern Swamp (From Owl Warp),$0E00 Curiosity Shop,$0E38 Ikana Canyon Entrance,$1500 Lens of Truth Cave (get it),$2600 Stone Tower Temple (Upside down),$2609 Stone Tower Temple (Boss Room Entrance),$2604 Treasure Chest Shop,$2605 Treausre Chest Shop (counter),$260E Clock Tower (w/ skull kid, silent),$2610 Stone Tower Temple (endless fall),$6214 Romani Ranch,$9214 Zora Shop,$B214 Snowhead (Path to temple, warp in),$D214 East Clock Down +Cheat27_N=Put on the code on load up,After the Nintendo logo you will be in that place of Choice.you can also choose another place & then press F1 (reset) to go to that place this is for beta interest only it will not assist you in playing the game. +Cheat28_N=With this code,load the game & put the cheat on. then press start to apear in the Demo mode. +Cheat39_N=This code allows you to use C-Button Items where you normally can't use them. (Created by: The Gentleman) +Cheat41_N=Only put the Deity Link's Sword on, if using The Play As Fierce Deity Link Code, if not it will turn Fierce Deity Link into a crazed slashing Machine. You have been warned. +Cheat43_N=Put this code on and it will now take where you wanted to go, turn it back off or it will infinite loop entering all the time. +Cheat2="Have\All Quest/Status Items",801EF72D 0005,811EF72E F7CF + +//---- + +[B443EB08-4DB31193-C:45] +Name=Legend of Zelda, The - Majora's Mask (U) (GC Version) +Cheat0="Infinite\Health",811ED866 0140 +Cheat1="Infinite\Hearts Options",811ED864 ???? +Cheat1_O=$0140 Max Hearts,$0063 6 Hearts,$0043 4 Hearts +Cheat1_N=If you need to clear the Infinite Max Hearts from the screen just choose the 6 or 4 Heart Options, take off the cheat & then make a save. +Cheat2="Have\All Quest/Status Items",801ED8ED 0005,811ED8EE F7CF +Cheat3="Infinite\Rupees",811ED86A 03E7 +Cheat4="Infinite\Max & Double Magic Meter",801ED869 0060,811ED870 0101 +Cheat5="Infinite\Items",801ED8D1 0063,50000501 0000,801ED8D6 0063,50000201 0000,801ED8DC 0063 +Cheat6="Have\Ocarina of Time",801ED8A0 0000 +Cheat7="Have\Hero's Bow",801ED8A1 0001 +Cheat8="Have\Arrows\Fire Arrow",801ED8A2 0002 +Cheat9="Have\Arrows\Ice Arrow",801ED8A3 0003 +Cheat10="Have\Arrows\Light Arrow",801ED8A4 0004 +Cheat11="Have\Bombs",801ED8A6 0006 +Cheat12="Have\Bombchu",801ED8A7 0007 +Cheat13="Have\Deku Sticks",801ED8A8 0008 +Cheat14="Have\Deku Nuts",801ED8A9 0009 +Cheat15="Have\Magic Beans",801ED8AA 000A +Cheat16="Have\Powder Kegs",801ED8AC 000C +Cheat17="Have\Pictograph",801ED8AD 000D +Cheat18="Have\Lens of Truth",801ED8AE 000E +Cheat19="Have\Hookshot",801ED8AF 000F +Cheat20="Have\Great Fairy's Sword",801ED8B0 0010 +Cheat21="Maximum Visibility",801642D8 0020 +Cheat22="Fog\Blue",801642C8 0020 +Cheat23="Fog\Pink",801642CC 0020 +Cheat24="Fog\Yellow",801642D0 0020 +Cheat25="Press L To Levitate",D038127B 0020,8139A558 40CB +Cheat25_N=Press L To Levitate & Let go to land +Cheat26="Have\All Masks",801ED8B8 003E,801ED8B9 0038,801ED8BA 0047,801ED8BB 0045,801ED8BC 0040,801ED8BD 0032,801ED8BE 003A,801ED8BF 0046,801ED8C0 0039,801ED8C1 0042,801ED8C2 0048,801ED8C3 0033,801ED8C4 003C,801ED8C5 003D,801ED8C6 0037,801ED8C7 003F,801ED8C8 0036,801ED8C9 0034,801ED8CA 0043,801ED8CB 0041,801ED8CC 003B,801ED8CD 0044,801ED8CE 0049,801ED8CF 0035 +Cheat27="Beta World 1",D038127B 0000,801ED832 00?? +Cheat28="Fight Demo Majora's Mask",801688D8 0020 +Cheat29="Event Item\Modifier 1",801ED8A5 00?? +Cheat30="Event Item\Modifier 2",801ED8AB 00?? +Cheat31="Event Item\Modifier 3",801ED8B1 00?? +Cheat32="Have\Item Modifier",801ED8B0 00?? +Cheat33="Bottles\Bottle 1 Modifier",801ED8B2 00?? +Cheat34="Bottles\Bottle 2 Modifier",801ED8B3 00?? +Cheat35="Bottles\Bottle 3 Modifier",801ED8B4 00?? +Cheat36="Bottles\Bottle 4 Modifier",801ED8B5 00?? +Cheat37="Bottles\Bottle 5 Modifier",801ED8B6 00?? +Cheat38="Bottles\Bottle 6 Modifier",801ED8B7 00?? +Cheat39="Use C-Buttons Anywhere",811F1748 0000,811F174A 0000 +Cheat40="All Equipment Upgrades",801ED89D 0023,811ED8EA 201B,801ED87C 004F +Cheat41="Replace Sword With",801ED87C 00?? +Cheat41_O=$4A Fire Arrow w/ Bow,$4B Ice Arrow w/ Bow,$4C Light Arrow w/ Bow,$4D Kokiri Sword,$4E Razor Sword,$4F Guilded Sword,$50 Deity Link's Sword +Cheat42="Play As",801ED850 00?? +Cheat43="Warp Modifier",D03E4CFA 0000,803FD555 0001,813FD55A ???? +Cheat27_O=$00 Mama's House non Beta,$01 Fearful Spider House,$02 Beneaf the Graveyard,$03 Southern Swamp Mr Tingle Entry,$06 Outside Tourist Information Southern Swamp,$08 Outside Magic Hag's Potion Shop,$0A Southern Swamp Woods Of Mystery Entry,$24 Counter Of The Tresure Chest Shop,$2E Woodfall Temple non Beta,$32 Spider Hand,$35 Statue outside Gorman Track,$36 Statue outside Lair Of The Temples Boss,$38 Path to Romani Ranch non Beta,$4A outside The Royal Palace of the Deku Kingdom,$4C Ledge in The Royal Palace of the Deku Kingdom,$4E inside The Royal Palace of the Deku Kingdom 1,$71 Green Blobs,$74 Cave Portal to Last Boss Field,$7F Waterfall Sothern Swamp,$8A Giant Turtle In the Temple non beta,$8B Room of Miau & Tijo Zora Great Hall,$94 Recieving Gorans Mask non Beta,$95 ?,$96 Hungry Goran in the Snow,$A2 Statue in Stone Tower,$A6 Stone Tower non Beta,$B9 Recieving Deku Mask non Beta,$D9 Giant Lizards in a Cave,$DA Cave with Steaming Water,$FF Vamps House In Ikana Canyon +Cheat29_O=$28 Moon's Tear,$29 Land Title Deed,$2A Swap Title Deed,$2B Mountain Title Deed,$2C Ocean Title Deed,$2D Room Key,$2E Special Delivery To Mama,$2F Letter To Kafei,$30 Pendant Of Memories +Cheat30_O=$28 Moon's Tear,$29 Land Title Deed,$2A Swap Title Deed,$2B Mountain Title Deed,$2C Ocean Title Deed,$2D Room Key,$2E Special Delivery To Mama,$2F Letter To Kafei,$30 Pendant Of Memories +Cheat31_O=$28 Moon's Tear,$29 Land Title Deed,$2A Swap Title Deed,$2B Mountain Title Deed,$2C Ocean Title Deed,$2D Room Key,$2E Special Delivery To Mama,$2F Letter To Kafei,$30 Pendant Of Memories +Cheat32_O=$05 Japanese Flute?,$0B Japanese Item?,$10 Great Fairy's Sword,$11 Japanese Hookshot?,$31 Japanese Scroll?,$4A Japanese Bow? +Cheat33_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat34_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat35_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat36_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat37_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat38_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat42_O=$00 Fierce Deity Link,$01 Goron Link,$02 Zora Link,$03 Deku Link,$04 Normal Link +Cheat43_O=$0010 Mayors Residence,$0008 Magic Hags Potion Shop,$000A Romani Ranch Barn,$000B Mama's House,$000E Honey & Darlings Shop,$0015 Final Boss Arena,$001F Beneath the Graveyard (left entrance),$002F Beneath the Graveyard (right entrance),$0030 Southern Swamp (Reg Entrance),$004F Southern Swamp (from tour house),$006E Southern Swamp (from Woodfall),$006F Southern Swamp (from Deku Palace),$0078 Path to Ikana Canyon,$009E Southern Swamp (from Deku Place 2),$009F Southern Swamp (From Potion Shop),$00AF Boat Cruise (picture taking),$00CD Southern Swamp (From Woods of Mystery),$00CE Southern Swamp (From Spider House),$00CF Southern Swamp (From Ikana Canyon),$00FE Southern Swamp (From Owl Warp),$0E00 Curiosity Shop,$0E38 Ikana Canyon Entrance,$1500 Lens of Truth Cave (get it),$2600 Stone Tower Temple (Upside down),$2609 Stone Tower Temple (Boss Room Entrance),$2604 Treasure Chest Shop,$2605 Treausre Chest Shop (counter),$260E Clock Tower (w/ skull kid, silent),$2610 Stone Tower Temple (endless fall),$6214 Romani Ranch,$9214 Zora Shop,$B214 Snowhead (Path to temple, warp in),$D214 East Clock Down +Cheat27_N=Put on the code on load up,After the Nintendo logo you will be in that place of Choice.you can also choose another place & then press F1 (reset) to go to that place this is for beta interest only it will not assist you in playing the game. +Cheat28_N=With this code,load the game & put the cheat on. then press start to apear in the Demo mode. +Cheat39_N=This code allows you to use C-Button Items where you normally can't use them. (Created by: The Gentleman) +Cheat41_N=Only put the Deity Link's Sword on, if using The Play As Fierce Deity Link Code, if not it will turn Fierce Deity Link into a crazed slashing Machine. You have been warned. +Cheat43_N=Put this code on and it will now take where you wanted to go, turn it back off or it will infinite loop entering all the time. + +//---- + +[EC7011B7-7616D72B-C:45] +Name=Legend of Zelda, The - Ocarina of Time (U) (V1.0) +Cheat0="Infinite\Rupees",8111B99C 0001 +Cheat0_N=This cheat allows you to have the max Rupees to the Wallet you currently Hold +Cheat1="Press R\For Old Or Young Link",D01C84B5 0010,8011A5D7 00?? +Cheat1_O=$01 Link Young,$00 Link Old +Cheat1_N=To Activate this Cheat Hold The R Button when walking through a Doorway this will change you to the option on the other side, Disable this Cheat straight away after getting to the other side, in some places you might even get Access Violations. Just press ok untill you can carry on. +Cheat2="Use Any Item In Any House",8111B7F2 0000,8111B7F4 0000 +Cheat3="Have\All Equipment",8111A66C 7777 +Cheat4="Have\All Quest/Status Items",8111A674 30FF,8111A676 FFFF +Cheat5="Max\Heart Containers",8111A5FE 0140 +Cheat6="Max\Gold Skulltulas Killed",8011A6A1 0064 +Cheat7="Time of Day Modifier",8111A5DC ???? +Cheat7_O=$4000 At Sunrise,$5800 Daylight Out,$7000 Very Bright Out,$C000 At Sunset,$D000 Fairly Dark +Cheat8="Infinite\Energy",8111A600 0140 +Cheat9="Infinite\Magic",D011A609 0008,8011A60A 0001,8011A60C 0001,8011A603 0060 +Cheat10="Tunic & Boot Options",8011A640 00?? +Cheat11="Infinite\Deku Sticks",8011A65C 0009 +Cheat12="Infinite\Deku Nuts",8011A65D 0009 +Cheat13="Infinite\Bombs",8011A65E 0009 +Cheat14="Infinite\Arrows",8011A65F 0009 +Cheat15="Infinite\Deku Seeds",8011A662 0009 +Cheat16="Infinite\Bombchu's",8011A664 0009 +Cheat17="Infinite\Magic Beans",8011A66A 0009 +Cheat18="Infinite\Big Key,Small Keys,Compass,& Map",8011A678 0007,8011A679 0007,8011A67A 0007,8011A67B 0007,8011A67C 0007,8011A67D 0007,8011A67E 0007,8011A67F 0007,8011A680 0007,8011A681 0007,8011A682 0007,8011A68F 0009,8011A690 0009,8011A691 0009,8011A692 0009,8011A693 0009,8011A699 0009,8011A69C 0009,8011A697 0009 +Cheat19="Have\Ocarina",8011A64B 00?? +Cheat20="Have\Boomerang",8011A650 000E +Cheat21="Have\Lens of Truth",8011A651 000F +Cheat22="Have\Megaton Hammer",8011A653 0011 +Cheat23="Have\Deku Stick",8011A644 0000 +Cheat24="Have\Deku Nut",8011A645 0001 +Cheat25="Have\Bombs",8011A646 0002 +Cheat26="Have\Fairy Bow",8011A647 0003 +Cheat27="Have\Fairy Slingshot",8011A64A 0006 +Cheat28="Have\Bombchu",8011A64C 0009 +Cheat29="Have\Arrows\Fire Arrow",8011A648 0004 +Cheat30="Have\Arrows\Ice Arrow",8011A64E 000C +Cheat31="Have\Arrows\Light Arrow",8011A654 0012 +Cheat32="Have\Hookshot",8011A64D 00?? +Cheat33="Have\Magic Beans",8011A652 0010 +Cheat34="Have\Magic\Fairie's Wind",8011A64F 000D +Cheat35="Have\Magic\Nayru's Love",8011A655 0013 +Cheat36="Have\Magic\Din's Fire",8011A649 0005 +Cheat37="Bottles\Bottle 1 Modifier",8011A656 00?? +Cheat38="Bottles\Bottle 2 Modifier",8011A657 00?? +Cheat39="Bottles\Bottle 3 Modifier",8011A658 00?? +Cheat40="Bottles\Bottle 4 Modifier",8011A659 00?? +Cheat41="Trading\Adult Link Item",8011A65A 00?? +Cheat42="Trading\Young Link Item",8011A65B 00?? +Cheat43="Turn Giant's Knife Into Biggoron's Sword",8011A60E 0001 +Cheat44="Have Quiver (Holds 30)",8011A671 0001 +Cheat45="Equipment Modifier 1",8011A672 00?? +Cheat46="Equipment Modifier 2",8011A673 00?? +Cheat47="Press L\To Levitate",D01C84B5 0020,811DAA90 40CB +Cheat47_N=Press L To Levitate & Let go to land +Cheat48="Press L\For infinite Hover Boots",D01C84B5 0020,811DB2B2 000D +Cheat48_N=Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on +Cheat49="Instant Step Hoover Boots",D01C84B5 0020,811DAA90 40CB,D01C84B5 0000,811DB2B2 000D,8011A640 00?? +Cheat49_O=$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat49_N=Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. +Cheat50="Beta\Play Beta Quest Worlds",D01C84B5 0000,8011B9E3 00?? +Cheat50_O=$00 World 01,$01 World 02,$02 World 03,$03 World 04,$04 World 05,$07 World 06,$08 World 07,$16 World 08 +Cheat50_N=Put on the code on load up,After the Nintendo logo you will be in Beta Mode,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. +Cheat51="Warp Song Location\Minuet of Forest & Serenade of Water",8011B965 00?? +Cheat51_O=$00 Sacred Forest Meadow,$04 Lake Hylia,$15 Inside Jabu Jabu's Belly,$18 Dodongo's Cavern,$68 Inside The Deku Tree +Cheat51_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat52="Warp Song Location\Prelude of Light & Nocturne of Shadow",8011B965 00?? +Cheat52_O=$03 Kakariko Windmill,$07 Bombchu Bowling Alley,$0F Zelda & Impa Flee,$14 Kakariko Village,$17 Ganon,Final Battle,$1D Top of Ganon's Tower,$28 Bombchu Shop,$2C Bazaar,$30 Happy Mask Shop,$34 Ganon's Tower,$38 Ganon's Castle,$4C Inside Spirit Door,$6C Burning Castle,$50 House of Skulltula,$64 Death Mountain Trail,$68 Graveyard,$70 Thieves' Hideout,$74 Royal Family's Tomb,$78 Great Fairy Fountain 1,$84 Forest Temple,Room With Falling Floor,$88 Great Fairy Fountain 2,$99 Grotto 01,$9D Grotto 02,$A4 Grotto 04,$A8 Grotto 05,$B3 Grotto 06,$B0 Grotto 07,$B4 Grotto 08,$B8 Grotto 09,$C3 Grotto 10,$C0 Grotto 11,$C4 Grotto 12,$FC Grotto 13,$D3 Bottom of the Well,$D0 Lon Lon Ranch Shed,$D3 Lon Lon Ranch Outside Shed,$D8 Ice Cavern,$E3 Outside Cow Pen,$E0 Lost Woods Bridge,$E4 Lon Lon Ranch Chicken Room,$E8 In Front of Deku Tree,$EB Spirit Temple Boss,$F1 Castle Courtyard,In Front of Zelda,$F4 Temple of Time,$F8 Gerudo Fortress Jail +Cheat52_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat53="Warp Song Location\Bolero of Fire",8011B965 00?? +Cheat53_O=$03 Castle Courtyard,$0B Dodongo's Cavern Boss,$10 Inside The Deku Tree Boss,$14 Shadow Temple Boss,$17 Water Temple Boss,$1C Ganon's Castle Tower,$1F Ganon First Battle,$28 Ganon's Castle Room Before Ganon,$2B Inside Ganon's Castle Room With Pillar,$2F Lon Lon Ranch,$33 Mido's House,$37 Saria's House,$4B Bearded Man's House,$40 Top of Ganon's Castle,$47 Outside Saria's House,$4F Dampe's Race,$57 Kokiri Forest,$5B Top of Death Mountain,$5F Fishing Pond,$68 Inside Ganon's Castle,$7F Hyrule Castle Gate,$BA Top of Ganon's Tower,$C2 Great Fairy Fountain,$D6 Lost Woods Goron Entrance,$DA Lost Woods River Entrance,$DE Lost Woods Bridge Field Entrance,$E3 Goron City Lost Woods Entrance,$F6 Death Mountain Crater,$FD Ganon's Castle +Cheat53_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat54="Warp Song Location\Requiem of Spirit",8011B965 00?? +Cheat54_O=$05 Lake Hylia,08 Zora's Domain,$18 Gerudo Valley,$1E Lost Woods,$28 Gerudo Fortress,$30 Haunted Wasteland,$34 Ganon's Castle Inside Burning Castle,$38 Hyrule Castle,$3A Ganon's Castle,$3D Death Mountain Trail,$4D Goron City,$65 Fire Temple,$69 Forest Temple,$6E Shooting Gallery,$79 Ganon's Castle Inside Burning Castle,$7E Kakariko Village Entrance,$7B Zora's River Entrance,$85 Kokiri Forest Entrance,$8A Lake Hyrule Entrance,$8E Gerudo Valley Entrance,$92 Death Mountain Trail Entrance,$95 Graveyard Entrance,$9E Zora's Domain Entrance,$A2 Zora's Fountain Entrance,$BA Goron City Entrance,$BE Death Mountain Trail,$C1 Goron City,$C5 Lakeside Laboratory,$C9 Top of Ganon's Castle,$CD Hyrule Market (Child Link's),$CF Hyrule Market (Adult Link's),$F1 Desert Colossus,$FA Lon Lon Ranch Entrance,$FD Hyrule Field +Cheat54_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat55="Max\Double Defense Power",8011A69F 0014 +Cheat55_N=This gives you White Border Hearts +Cheat56="Nayru's Love is Always",8111B998 ???? +Cheat56_O=$0000 OFF,$FFFF ON +Cheat56_N=For this to work On Or off, you have to walk through a Doorway to activate the Change. +Cheat57="Infinite\Timers\All Other Timers",8011B9A1 0032 +Cheat57_N=This cheat works on all Race Timers not the final Boss and Under Water with iron Boots etc. +Cheat58="Epona\Max Carrots\Lon Lon Raunch",801F2208 0005,801EEC88 0005 +Cheat58_N=This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona +Cheat59="Infinite\Timers\Escape From Gannons Tower",8011B9A5 00B4 +Cheat59_N=This cheat works only on The Final Boss. +Cheat60="Beta\Specific things lean",80025614 0001 +Cheat60_N=This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest 01). +Cheat61="Beta\Appear in Strange Places (Hold R)",D01C84B5 0010,8111B936 0001 +Cheat61_N=If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. +Cheat62="Beta\Interface always off/on",8011B4B9 00FF,8011B92F 00?? +Cheat62_O=$00 Off,$01 On +Cheat62_N=If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset. +Cheat63="Always Have Wallet Size",8011A672 00?? +Cheat63_O=$47 Kid Wallet (Holds 99),$57 Adult Wallet (Holds 200),$67 Giant Wallet (Holds 500) +Cheat10_O=$11 Kokiri Tunic & Kokiri Boots,$12 Goron Tunic & Kokiri Boots,$13 Zora Tunic & Kokiri Boots,$14 Black Tunic & Kokiri Boots,$15 White Tunic & Kokiri Boots,$16 Yellow Tunic & Kokiri Boots,$21 Kokiri Tunic & Iron Boots,$22 Goron Tunic & Iron Boots,$23 Zora Tunic & Iron Boots,$24 Black Tunic & Iron Boots,$25 White Tunic & Iron Boots,$26 Yellow Tunic & Iron Boots,$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat19_O=$07 Fairy Ocarina,$08 Ocarina Of Time +Cheat32_O=$0A Hookshot,$0B Longshot +Cheat37_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat38_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat39_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat40_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat41_O=$2D Pocket Egg,$2E Pocket Cucco,$2F Cojiro,$30 Odd Mushroom,$31 Odd Potion,$32 Poacher's Saw,$33 Goron's Sword (Broken),$34 Prescription,$35 Eyeball Frog,$36 Eye Drops,$37 Claim Check +Cheat42_O=$21 Weird Egg,$22 Chicken,$23 Zelda's Letter,$24 Keaton Mask,$25 Skull Mask,$26 Spooky Mask,$27 Bunny Hood,$28 Goron Mask,$29 Zora Mask,$2A Gerudo Mask,$2B Mask of Truth,$2C SOLD OUT +Cheat45_O=$02 Silver Scale,$04 Golden Scale,$06 Giant's Knife (Broken),$35 Black Gauntlets,$40 Bullet Bag (Holds 30),$80 Bullet Bag (Holds 40),$C0 Bullet Bag (Holds 50) +Cheat46_O=$08 Bomb Bag (Holds 20),$10 Bomb Bag (Holds 30),$18 Bomb Bag (Holds 40),$20 Goron's Bracelet,$28 Silver Gauntlets,$30 Golden Gauntlets +Cheat2_N=do not use under or in water +Cheat3_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal +Cheat4_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal +Cheat10_N=This changes what you are wearing,once you have enabled the code press Start & then start again. +Cheat45_N=This modifies the equipment you are carrying. +Cheat46_N=This modifies the equipment you are carrying. +Cheat64="Press L+R For FMV Select",D01C84B5 0030,8111A5D2 00A0,D01C84B5 0030,8111A5DA ???? +Cheat64_O=$FFF0 Triforce FMV,$FFF1 fire FMV,$FFF2 Triforce FMV,$FFF3 Ganondorf FMV,$FFF4 Planet Making FMV,$FFF5 Fire FMV,$FFF6 Ganondorf FMV,$FFF7 More Triforce FMV,$FFF8 Ending +Cheat64_N=Hold down `L+R' after the Nintendo logo is spinning to see your favourite FMV +Cheat65="Dark Link\Make Dark Link Apear In TOT",8023E80F 0020,8023E815 0033 +Cheat66="Dark Link\Play As Dark Link",D01C84B5 0020,811DAB60 801E,D01C84B5 0020,811F2C24 801D,D01C84B5 0020,811F2C26 AA30,D01C84B5 0020,811CA0E4 801E,D01C84B5 0020,811CA0E6 4B60,D01C84B5 0020,811E4B60 0000,D01C84B5 0020,811E4B62 02FF,D01C84B5 0020,811DAA30 0033,D01C84B5 0020,811DAA32 0901,D01C84B5 0020,811DAB62 27E0,D01C84B5 0020,811E4C90 8009,D01C84B5 0020,811E4C92 7740,D01C84B5 0020,811C8710 801E,D01C84B5 0020,811C8712 4B60 + +//---- + +[D43DA81F-021E1E19-C:45] +Name=Legend of Zelda, The - Ocarina of Time (U) (V1.1) +Cheat0="Infinite\Rupees",8111BB5C 0001 +Cheat1="Press R\For Old Or Young Link",D01C8675 0010,8011A797 00?? +Cheat1_O=$01 Link Young,$00 Link Old +Cheat1_N=To Activate this Cheat Hold The R Button when walking through a Doorway this will change you to the option on the other side, Disable this Cheat straight away after getting to the other side, in some places you might even get Access Violations. Just press ok untill you can carry on. +Cheat2="Use Any Item In Any House",8111B9B2 0000,8111B9B4 0000 +Cheat3="Have\All Equipment",8111A82C 7777 +Cheat4="Have\All Quest/Status Items",8111A834 30FF,8111A836 FFFF +Cheat5="Max\Heart Containers",8111A7BE 0140 +Cheat6="Max\Gold Skulltulas Killed",8011A861 0064 +Cheat7="Time of Day Modifier",8111A79C ???? +Cheat8="Infinite\Energy",8111A7C0 0140 +Cheat9="Infinite\Magic",D011A7C9 0008,8011A7CA 0001,8011A7CC 0001,8011A7C3 0060 +Cheat10="Tunic & Boot Options",8011A800 00?? +Cheat11="Infinite\Deku Sticks",8011A81C 0009 +Cheat12="Infinite\Deku Nuts",8011A81D 0009 +Cheat13="Infinite\Bombs",8011A81E 0009 +Cheat14="Infinite\Arrows",8011A81F 0009 +Cheat15="Infinite\Deku Seeds",8011A822 0009 +Cheat16="Infinite\Bombchu's",8011A824 0009 +Cheat17="Infinite\Magic Beans",8011A82A 0009 +Cheat18="Infinite\Big Keys,Small Keys,Compass,& Map",8011A838 0007,8011A839 0007,8011A83A 0007,8011A83B 0007,8011A83C 0007,8011A83D 0007,8011A83E 0007,8011A83F 0007,8011A840 0007,8011A841 0007,8011A842 0007,8011A84F 0009,8011A850 0009,8011A851 0009,8011A852 0009,8011A853 0009,8011A859 0009,8011A85C 0009,8011A857 0009 +Cheat19="Have\Ocarina",8011A80B 00?? +Cheat20="Have\Boomerang",8011A810 000E +Cheat21="Have\Lens of Truth",8011A811 000F +Cheat22="Have\Megaton Hammer",8011A813 0011 +Cheat23="Have\Deku Stick",8011A804 0000 +Cheat24="Have\Deku Nut",8011A805 0001 +Cheat25="Have\Bombs",8011A806 0002 +Cheat26="Have\Fairy Bow",8011A807 0003 +Cheat27="Have\Fairy Slingshot",8011A80A 0006 +Cheat28="Have\Bombchu",8011A80C 0009 +Cheat29="Have\Arrows\Fire Arrow",8011A808 0004 +Cheat30="Have\Arrows\Ice Arrow",8011A80E 000C +Cheat31="Have\Arrows\Light Arrow",8011A814 0012 +Cheat32="Have\Hookshot",8011A80D 00?? +Cheat33="Have\Magic Beans",8011A812 0010 +Cheat34="Have\Magic\Fairie's Wind",8011A80F 000D +Cheat35="Have\Magic\Nayru's Love",8011A815 0013 +Cheat36="Have\Magic\Din's Fire",8011A809 0005 +Cheat37="Bottles\Bottle 1 Modifier",8011A816 00?? +Cheat38="Bottles\Bottle 2 Modifier",8011A817 00?? +Cheat39="Bottles\Bottle 3 Modifier",8011A818 00?? +Cheat40="Bottles\Bottle 4 Modifier",8011A819 00?? +Cheat41="Trading\Adult Link Item",8011A81A 00?? +Cheat42="Trading\Young Link Item",8011A81B 00?? +Cheat43="Turn Giant's Knife Into Biggoron's Sword",8011A7CE 0001 +Cheat44="Have Quiver (Holds 30)",8011A831 0001 +Cheat45="Equipment Modifier 1",8011A832 00?? +Cheat46="Equipment Modifier 2",8011A833 00?? +Cheat47="Press L To Levitate",D01C8675 0020,811DAC50 40CB +Cheat47_N=Press L To Levitate & Let go to land +Cheat48="Press L For infinite Hover Boots",D01C8675 0020,811DB472 000D +Cheat48_N=Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on +Cheat49="Instant Step Hoover Boots",D01C8675 0020,811DAC50 40CB,D01C8675 0000,811DB472 000D,8011A800 00?? +Cheat49_O=$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat49_N=Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. +Cheat50="Beta\Play Beta Quest Worlds",D01C8675 0000,8011BBA3 00?? +Cheat50_O=$00 World 01,$01 World 02,$02 World 03,$03 World 04,$04 World 05,$07 World 06,$08 World 07,$16 World 08 +Cheat50_N=Put on the code on load up,After the Nintendo logo you will be in Hyrule Field,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. +Cheat51="Warp Song Location\Minuet of Forest & Serenade of Water",8011BB25 00?? +Cheat51_O=$00 Sacred Forest Meadow,$04 Lake Hylia,$15 Inside Jabu Jabu's Belly,$18 Dodongo's Cavern,$68 Inside The Deku Tree +Cheat51_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat52="Warp Song Location\Prelude of Light & Nocturne of Shadow",8011BB25 00?? +Cheat52_O=$03 Kakariko Windmill,$07 Bombchu Bowling Alley,$0F Zelda & Impa Flee,$14 Kakariko Village,$17 Ganon,Final Battle,$1D Top of Ganon's Tower,$28 Bombchu Shop,$2C Bazaar,$30 Happy Mask Shop,$34 Ganon's Tower,$38 Ganon's Castle,$4C Inside Spirit Door,$6C Burning Castle,$50 House of Skulltula,$64 Death Mountain Trail,$68 Graveyard,$70 Thieves' Hideout,$74 Royal Family's Tomb,$78 Great Fairy Fountain 1,$84 Forest Temple,Room With Falling Floor,$88 Great Fairy Fountain 2,$99 Grotto 01,$9D Grotto 02,$A4 Grotto 04,$A8 Grotto 05,$B3 Grotto 06,$B0 Grotto 07,$B4 Grotto 08,$B8 Grotto 09,$C3 Grotto 10,$C0 Grotto 11,$C4 Grotto 12,$FC Grotto 13,$D3 Bottom of the Well,$D0 Lon Lon Ranch Shed,$D3 Lon Lon Ranch Outside Shed,$D8 Ice Cavern,$E3 Outside Cow Pen,$E0 Lost Woods Bridge,$E4 Lon Lon Ranch Chicken Room,$E8 In Front of Deku Tree,$EB Spirit Temple Boss,$F1 Castle Courtyard,In Front of Zelda,$F4 Temple of Time,$F8 Gerudo Fortress Jail +Cheat52_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat53="Warp Song Location\Bolero of Fire",8011BB25 00?? +Cheat53_O=$03 Castle Courtyard,$0B Dodongo's Cavern Boss,$10 Inside The Deku Tree Boss,$14 Shadow Temple Boss,$17 Water Temple Boss,$1C Ganon's Castle Tower,$1F Ganon First Battle,$28 Ganon's Castle Room Before Ganon,$2B Inside Ganon's Castle Room With Pillar,$2F Lon Lon Ranch,$33 Mido's House,$37 Saria's House,$4B Bearded Man's House,$40 Top of Ganon's Castle,$47 Outside Saria's House,$4F Dampe's Race,$57 Kokiri Forest,$5B Top of Death Mountain,$5F Fishing Pond,$68 Inside Ganon's Castle,$7F Hyrule Castle Gate,$BA Top of Ganon's Tower,$C2 Great Fairy Fountain,$D6 Lost Woods Goron Entrance,$DA Lost Woods River Entrance,$DE Lost Woods Bridge Field Entrance,$E3 Goron City Lost Woods Entrance,$F6 Death Mountain Crater,$FD Ganon's Castle +Cheat53_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat54="Warp Song Location\Requiem of Spirit",8011BB25 00?? +Cheat54_O=$05 Lake Hylia,08 Zora's Domain,$18 Gerudo Valley,$1E Lost Woods,$28 Gerudo Fortress,$30 Haunted Wasteland,$34 Ganon's Castle Inside Burning Castle,$38 Hyrule Castle,$3A Ganon's Castle,$3D Death Mountain Trail,$4D Goron City,$65 Fire Temple,$69 Forest Temple,$6E Shooting Gallery,$79 Ganon's Castle Inside Burning Castle,$7E Kakariko Village Entrance,$7B Zora's River Entrance,$85 Kokiri Forest Entrance,$8A Lake Hyrule Entrance,$8E Gerudo Valley Entrance,$92 Death Mountain Trail Entrance,$95 Graveyard Entrance,$9E Zora's Domain Entrance,$A2 Zora's Fountain Entrance,$BA Goron City Entrance,$BE Death Mountain Trail,$C1 Goron City,$C5 Lakeside Laboratory,$C9 Top of Ganon's Castle,$CD Hyrule Market (Child Link's),$CF Hyrule Market (Adult Link's),$F1 Desert Colossus,$FA Lon Lon Ranch Entrance,$FD Hyrule Field +Cheat54_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat55="Max\Double Defense Power",8011A85F 0014 +Cheat55_N=This gives you White Border Hearts +Cheat56="Nayru's Love is Always",8111BB58 ???? +Cheat56_O=$0000 OFF,$FFFF ON +Cheat56_N=For this to work On Or off, you have to walk through a Doorway to activate the Change. +Cheat57="Infinite\Timers\All Other Timers",8011BB61 0032 +Cheat57_N=This cheat works on all Race Timers not the final Boss and Under Water with iron Boots etc. +Cheat58="Epona\Max Carrots\Lon Lon Raunch",801F3688 0005,801F3848 0005 +Cheat58_N=This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona +Cheat59="Infinite\Timers\Escape From Gannons Tower",8011BB65 00B4 +Cheat59_N=This cheat works only on The Final Boss. +Cheat60="Beta\Specific things lean",800257D4 0001 +Cheat60_N=This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest World 01) +Cheat61="Beta\Appear in Strange Places (Hold R)",D01C8675 0010,8111BAF6 0001 +Cheat61_N=If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. +Cheat62="Beta\Interface always off/on",8011B679 00FF,8011BAEF 00?? +Cheat62_O=$00 Off,$01 On +Cheat62_N=If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset. +Cheat63="Always Have Wallet Size",8011A832 00?? +Cheat63_O=$47 Kid Wallet (Holds 99),$57 Adult Wallet (Holds 200),$67 Giant Wallet (Holds 500) +Cheat7_O=$4000 At Sunrise,$5800 Daylight Out,$7000 Very Bright Out,$C000 At Sunset,$D000 Fairly Dark +Cheat10_O=$11 Kokiri Tunic & Kokiri Boots,$12 Goron Tunic & Kokiri Boots,$13 Zora Tunic & Kokiri Boots,$14 Black Tunic & Kokiri Boots,$15 White Tunic & Kokiri Boots,$16 Yellow Tunic & Kokiri Boots,$21 Kokiri Tunic & Iron Boots,$22 Goron Tunic & Iron Boots,$23 Zora Tunic & Iron Boots,$24 Black Tunic & Iron Boots,$25 White Tunic & Iron Boots,$26 Yellow Tunic & Iron Boots,$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat19_O=$07 Fairy Ocarina,$08 Ocarina Of Time +Cheat32_O=$0A Hookshot,$0B Longshot +Cheat37_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat38_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat39_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat40_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat41_O=$2D Pocket Egg,$2E Pocket Cucco,$2F Cojiro,$30 Odd Mushroom,$31 Odd Potion,$32 Poacher's Saw,$33 Goron's Sword (Broken),$34 Prescription,$35 Eyeball Frog,$36 Eye Drops,$37 Claim Check +Cheat42_O=$21 Weird Egg,$22 Chicken,$23 Zelda's Letter,$24 Keaton Mask,$25 Skull Mask,$26 Spooky Mask,$27 Bunny Hood,$28 Goron Mask,$29 Zora Mask,$2A Gerudo Mask,$2B Mask of Truth,$2C SOLD OUT +Cheat45_O=$02 Silver Scale,$04 Golden Scale,$06 Giant's Knife (Broken),$35 Black Gauntlets,$40 Bullet Bag (Holds 30),$80 Bullet Bag (Holds 40),$C0 Bullet Bag (Holds 50) +Cheat46_O=$08 Bomb Bag (Holds 20),$10 Bomb Bag (Holds 30),$18 Bomb Bag (Holds 40),$20 Goron's Bracelet,$28 Silver Gauntlets,$30 Golden Gauntlets +Cheat0_N=This cheat allows you to have the max Rupees to the Wallet you currently Hold +Cheat2_N=do not use under or in water +Cheat3_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal +Cheat4_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal +Cheat10_N=This changes what you are wearing,once you have enabled the code press Start & then start again. +Cheat45_N=This modifies the equipment you are carrying. +Cheat46_N=This modifies the equipment you are carrying. +Cheat64="Press L+R For FMV Select",D01C8675 0030,8011A793 00A0,D01C8675 0030,8011A79B ???? +Cheat64_O=$F000 riforce FMV,$F10F ire FMV,$F200 riforce FMV,$F300 anondorf FMV,$F400 lanet Making FMV,$F50F ire FMV,$F600 anondorf FMV,$F700 ore Triforce FMV,$F80E nding +Cheat64_N=Hold down `L+R' after the Nintendo logo is spinning to see your favourite FMV +Cheat65="Dark Link\Make Dark Link Apear In TOT",8023E9AF 0020,8023E9B5 0033 + +//---- + +[693BA2AE-B7F14E9F-C:45] +Name=Legend of Zelda, The - Ocarina of Time (U) (V1.2) +Cheat0="Infinite\Rupees",8111C04C 0001 +Cheat1="Press R\For Old Or Young Link",D01C8D75 0010,8011AC87 00?? +Cheat1_O=$01 Link Young,$00 Link Old +Cheat1_N=To Activate this Cheat Hold The R Button when walking through a Doorway this will change you to the option on the other side, Disable this Cheat straight away after getting to the other side, in some places you might even get Access Violations. Just press ok untill you can carry on. +Cheat2="Use Any Item In Any House",8111BEA2 0000,8111BEA4 0000 +Cheat3="Have\All Equipment",8111AD1C 7777 +Cheat4="Have\All Quest/Status Items",8111AD24 30FF,8111AD26 FFFF +Cheat5="Max\Heart Containers",8111ACAE 0140 +Cheat6="Max\Gold Skulltulas Killed",8011AD51 0064 +Cheat7="Time of Day Modifier",8111AC8C ???? +Cheat8="Infinite\Energy",8111ACB0 0140 +Cheat9="Infinite\Magic",D011ACB9 0008,8011ACBA 0001,8011ACBC 0001,8011ACB3 0060 +Cheat10="Tunic & Boot Options",8011ACF0 00?? +Cheat11="Infinite\Deku Sticks",8011AD0C 0009 +Cheat12="Infinite\Deku Nuts",8011AD0D 0009 +Cheat13="Infinite\Bombs",8011AD0E 0009 +Cheat14="Infinite\Arrows",8011AD0F 0009 +Cheat15="Infinite\Deku Seeds",8011AD12 0009 +Cheat16="Infinite\Bombchu's",8011AD14 0009 +Cheat17="Infinite\Magic Beans",8011AD1A 0009 +Cheat18="Infinite\Big Key,Small Keys,Compass,& Map",8011AD28 0007,8011AD29 0007,8011AD2A 0007,8011AD2B 0007,8011AD2C 0007,8011AD2D 0007,8011AD2E 0007,8011AD2F 0007,8011AD30 0007,8011AD31 0007,8011AD32 0007,8011AD3F 0009,8011AD40 0009,8011AD41 0009,8011AD42 0009,8011AD43 0009,8011AD49 0009,8011AD4C 0009,8011AD47 0009 +Cheat19="Have\Ocarina",8011ACFB 00?? +Cheat20="Have\Boomerang",8011AD00 000E +Cheat21="Have\Lens of Truth",8011AD01 000F +Cheat22="Have\Megaton Hammer",8011AD03 0011 +Cheat23="Have\Deku Stick",8011ACF4 0000 +Cheat24="Have\Deku Nut",8011ACF5 0001 +Cheat25="Have\Bombs",8011ACF6 0002 +Cheat26="Have\Fairy Bow",8011ACF7 0003 +Cheat27="Have\Fairy Slingshot",8011ACFA 0006 +Cheat28="Have\Bombchu",8011ACFC 0009 +Cheat29="Have\Arrows\Fire Arrow",8011ACF8 0004 +Cheat30="Have\Arrows\Ice Arrow",8011ACFE 000C +Cheat31="Have\Arrows\Light Arrow",8011AD04 0012 +Cheat32="Have\Hookshot",8011ACFD 00?? +Cheat33="Have\Magic Beans",8011AD02 0010 +Cheat34="Have\Magic\Fairie's Wind",8011ACFF 000D +Cheat35="Have\Magic\Nayru's Love",8011AD05 0013 +Cheat36="Have\Magic\Din's Fire",8011ACF9 0005 +Cheat37="Bottles\Bottle 1 Modifier",8011AD06 00?? +Cheat38="Bottles\Bottle 2 Modifier",8011AD07 00?? +Cheat39="Bottles\Bottle 3 Modifier",8011AD08 00?? +Cheat40="Bottles\Bottle 4 Modifier",8011AD09 00?? +Cheat41="Trading\Adult Link Item",8011AD0A 00?? +Cheat42="Trading\Young Link Item",8011AD0B 00?? +Cheat43="Turn Giant's Knife Into Biggoron's Sword",8011ACBE 0001 +Cheat44="Have Quiver (Holds 30)",8011AD21 0001 +Cheat45="Equipment Modifier 1",8011AD22 00?? +Cheat46="Equipment Modifier 2",8011AD23 00?? +Cheat47="Press L To Levitate",D01C8D75 0020,811DB350 40CB +Cheat47_N=Press L To Levitate & Let go to land +Cheat48="Press L For infinite Hover Boots",D01C8D75 0020,811DBB72 000D +Cheat48_N=Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on +Cheat49="Instant Step Hoover Boots",D01C8D75 0020,811DB350 40CB,D01C8D75 0000,811DBB72 000D,8011ACF0 00?? +Cheat49_O=$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat49_N=Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. +Cheat50="Beta\Play Beta Quest Worlds",D01C8D75 0000,8011C093 00?? +Cheat50_O=$00 World 01,$01 World 02,$02 World 03,$03 World 04,$04 World 05,$07 World 06,$08 World 07,$16 World 08 +Cheat50_N=Put on the code on load up,After the Nintendo logo you will be in Hyrule Field,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. +Cheat51="Warp Song Location\Minuet of Forest & Serenade of Water",8011C015 00?? +Cheat51_O=$00 Sacred Forest Meadow,$04 Lake Hylia,$15 Inside Jabu Jabu's Belly,$18 Dodongo's Cavern,$68 Inside The Deku Tree +Cheat51_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat52="Warp Song Location\Prelude of Light & Nocturne of Shadow",8011C015 00?? +Cheat52_O=$03 Kakariko Windmill,$07 Bombchu Bowling Alley,$0F Zelda & Impa Flee,$14 Kakariko Village,$17 Ganon,$1D Top of Ganon's Tower,$28 Bombchu Shop,$2C Bazaar,$30 Happy Mask Shop,$34 Ganon's Tower,$38 Ganon's Castle,$4C Inside Spirit Door,$6C Burning Castle,$50 House of Skulltula,$64 Death Mountain Trail,$68 Graveyard,$70 Thieves' Hideout,$74 Royal Family's Tomb,$78 Great Fairy Fountain 1,$84 Forest Temple,$88 Great Fairy Fountain 2,$99 Grotto 01,$9D Grotto 02,$A4 Grotto 04,$A8 Grotto 05,$B3 Grotto 06,$B0 Grotto 07,$B4 Grotto 08,$B8 Grotto 09,$C3 Grotto 10,$C0 Grotto 11,$C4 Grotto 12,$FC Grotto 13,$D3 Bottom of the Well,$D0 Lon Lon Ranch Shed,$D3 Lon Lon Ranch Outside Shed,$D8 Ice Cavern,$E3 Outside Cow Pen,$E0 Lost Woods Bridge,$E4 Lon Lon Ranch Chicken Room,$E8 In Front of Deku Tree,$EB Spirit Temple Boss,$F1 Castle Courtyard,$F4 Temple of Time,$F8 Gerudo Fortress Jail +Cheat52_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat53="Warp Song Location\Bolero of Fire",8011C015 00?? +Cheat53_O=$03 Castle Courtyard,$0B Dodongo's Cavern Boss,$10 Inside The Deku Tree Boss,$14 Shadow Temple Boss,$17 Water Temple Boss,$1C Ganon's Castle Tower,$1F Ganon First Battle,$28 Ganon's Castle Room Before Ganon,$2B Inside Ganon's Castle Room With Pillar,$2F Lon Lon Ranch,$33 Mido's House,$37 Saria's House,$4B Bearded Man's House,$40 Top of Ganon's Castle,$47 Outside Saria's House,$4F Dampe's Race,$57 Kokiri Forest,$5B Top of Death Mountain,$5F Fishing Pond,$68 Inside Ganon's Castle,$7F Hyrule Castle Gate,$BA Top of Ganon's Tower,$C2 Great Fairy Fountain,$D6 Lost Woods Goron Entrance,$DA Lost Woods River Entrance,$DE Lost Woods Bridge Field Entrance,$E3 Goron City Lost Woods Entrance,$F6 Death Mountain Crater,$FD Ganon's Castle +Cheat53_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat54="Warp Song Location\Requiem of Spirit",8011C015 00?? +Cheat54_O=$05 Lake Hylia,08 Zora's Domain,$18 Gerudo Valley,$1E Lost Woods,$28 Gerudo Fortress,$30 Haunted Wasteland,$34 Ganon's Castle Inside Burning Castle,$38 Hyrule Castle,$3A Ganon's Castle,$3D Death Mountain Trail,$4D Goron City,$65 Fire Temple,$69 Forest Temple,$6E Shooting Gallery,$79 Ganon's Castle Inside Burning Castle,$7E Kakariko Village Entrance,$7B Zora's River Entrance,$85 Kokiri Forest Entrance,$8A Lake Hyrule Entrance,$8E Gerudo Valley Entrance,$92 Death Mountain Trail Entrance,$95 Graveyard Entrance,$9E Zora's Domain Entrance,$A2 Zora's Fountain Entrance,$BA Goron City Entrance,$BE Death Mountain Trail,$C1 Goron City,$C5 Lakeside Laboratory,$C9 Top of Ganon's Castle,$CD Hyrule Market (Child Link's),$CF Hyrule Market (Adult Link's),$F1 Desert Colossus,$FA Lon Lon Ranch Entrance,$FD Hyrule Field +Cheat54_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat55="Max\Double Defense Power",8011AD4F 0014 +Cheat55_N=This gives you White Border Hearts +Cheat56="Nayru's Love is Always",8111C048 ???? +Cheat56_O=$0000 OFF,$FFFF ON +Cheat56_N=For this to work On Or off, you have to walk through a Doorway to activate the Change. +Cheat57="Infinite\Timers\All Other Timers",8011C211 0032 +Cheat57_N=This cheat works on all Race Timers not the final Boss and Under Water with iron Boots etc. +Cheat58="Epona\Max Carrots\Lon Lon Raunch",801F3D38 0005,801F3EF8 0005 +Cheat58_N=This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona +Cheat59="Infinite\Timers\Escape From Gannons Tower",8011C215 00B4 +Cheat59_N=This cheat works only on The Final Boss. +Cheat60="Beta\Specific things lean",80025CC4 0001 +Cheat60_N=This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest World 01) +Cheat61="Beta\Appear in Strange Places (Hold R)",D01C8B65 0010,8111BFE6 0001 +Cheat61_N=If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. +Cheat62="Beta\Interface always off/on",8011BB69 00FF,8011BFDF 00?? +Cheat62_O=$00 Off,$01 On +Cheat62_N=If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset, +Cheat63="Always Have Wallet Size",8011AD22 00?? +Cheat63_O=$47 Kid Wallet (Holds 99),$57 Adult Wallet (Holds 200),$67 Giant Wallet (Holds 500) +Cheat7_O=$4000 At Sunrise,$5800 Daylight Out,$7000 Very Bright Out,$C000 At Sunset,$D000 Fairly Dark +Cheat10_O=$11 Kokiri Tunic & Kokiri Boots,$12 Goron Tunic & Kokiri Boots,$13 Zora Tunic & Kokiri Boots,$14 Black Tunic & Kokiri Boots,$15 White Tunic & Kokiri Boots,$16 Yellow Tunic & Kokiri Boots,$21 Kokiri Tunic & Iron Boots,$22 Goron Tunic & Iron Boots,$23 Zora Tunic & Iron Boots,$24 Black Tunic & Iron Boots,$25 White Tunic & Iron Boots,$26 Yellow Tunic & Iron Boots,$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat19_O=$07 Fairy Ocarina,$08 Ocarina Of Time +Cheat32_O=$0A Hookshot,$0B Longshot +Cheat37_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat38_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat39_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat40_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat41_O=$2D Pocket Egg,$2E Pocket Cucco,$2F Cojiro,$30 Odd Mushroom,$31 Odd Potion,$32 Poacher's Saw,$33 Goron's Sword (Broken),$34 Prescription,$35 Eyeball Frog,$36 Eye Drops,$37 Claim Check +Cheat42_O=$21 Weird Egg,$22 Chicken,$23 Zelda's Letter,$24 Keaton Mask,$25 Skull Mask,$26 Spooky Mask,$27 Bunny Hood,$28 Goron Mask,$29 Zora Mask,$2A Gerudo Mask,$2B Mask of Truth,$2C SOLD OUT +Cheat45_O=$02 Silver Scale,$04 Golden Scale,$06 Giant's Knife (Broken),$35 Black Gauntlets,$40 Bullet Bag (Holds 30),$80 Bullet Bag (Holds 40),$C0 Bullet Bag (Holds 50) +Cheat46_O=$08 Bomb Bag (Holds 20),$10 Bomb Bag (Holds 30),$18 Bomb Bag (Holds 40),$20 Goron's Bracelet,$28 Silver Gauntlets,$30 Golden Gauntlets +Cheat0_N=This cheat allows you to have the max Rupees to the Wallet you currently Hold +Cheat2_N=do not use under or in water +Cheat3_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal +Cheat4_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal +Cheat10_N=This changes what you are wearing,once you have enabled the code press Start & then start again. +Cheat45_N=This modifies the equipment you are carrying. +Cheat46_N=This modifies the equipment you are carrying. +Cheat64="Press L+R For FMV Select",D01C8D75 0030,8011AC83 00A0,D01C8D75 0030,8011AC8B ???? +Cheat64_O=$F000 riforce FMV,$F10F ire FMV,$F200 riforce FMV,$F300 anondorf FMV,$F400 lanet Making FMV,$F50F ire FMV,$F600 anondorf FMV,$F700 ore Triforce FMV,$F80E nding +Cheat64_N=Hold down `L+R' after the Nintendo logo is spinning to see your favourite FMV +Cheat65="Dark Link\Make Dark Link Apear In TOT",8023EFBF 0020,8023EFC5 0033 + +//---- + +[096A40EA-8ABE0A10-C:45] +Name=LEGO Racers (U) +Cheat0="Have All Tracks and Building Pieces",812576D4 FFFF,812576D6 FFFF + +//---- + +[255018DF-57D6AE3A-C:45] +Name=Lode Runner 3D (U) +Cheat0="Infinite Lives",8015299F 0063 +Cheat1="High Gold",80152AFF 0032,8015293B 0032 +Cheat2="All Navigation Pieces",8015298B 0005 + +//---- + +[6B700750-29D621FE-C:45] +Name=Mace - The Dark Ages (U) +Cheat0="Infinite Time To Choose Character",D01340F6 0001,811340F6 0260 +Cheat1="P2/CPU Never Wins",80138B43 0000 +Cheat2="Sudden Death Mode\Player 1",D1138B2A 0120,8008B1E7 0001 +Cheat3="Sudden Death Mode\Player 2",D1138B2A 0120,8008AE5F 0001 +Cheat4="Infinite Health\Player 1",8008B1E7 0064 +Cheat5="Infinite Health\Player 2",8008AE5F 0064 +Cheat6="No Health\Player 1",8008B1E7 0000 +Cheat7="No Health\Player 2",8008AE5F 0000 +Cheat8="Extra Characters",8007F9F8 0001 +Cheat9="R Button Health Restore\Player 1",D007CD2B 0010,8008B1E7 0064 +Cheat10="Z Trigger Deathblow\Player 1",D007CD2A 0020,8008AE5F 0000 +Cheat11="1 Win to Win\Player 1",D0138B47 0000,80138B47 0001 +Cheat12="1 Win to Win\Player 2",D0138B43 0000,80138B43 0001 +Cheat13="Infinite Time",81138B2A 0708 + +//---- + +[0CB81686-5FD85A81-C:45] +Name=Madden 2000 (U) +Cheat0="Enable\Stadium\Dodge City",80059198 00FF +Cheat1="Enable\Stadium\Xmas Rush",80059199 00FF +Cheat2="Enable\Stadium\Tib Bros",8005919A 00FF +Cheat3="Enable\Stadium\Tiberium",8005919B 00FF +Cheat4="Enable\Stadium\Salvage Field",8005919C 00FF +Cheat5="Enable\Stadium\Gridiron",8005919D 00FF +Cheat6="Enable\Stadium\Alpha Blitz",8005919E 00FF +Cheat7="Enable\Stadium\Nile High",8005919F 00FF +Cheat8="Enable\Stadium\4th And Incas",800591A0 00FF +Cheat9="Enable\Stadium\Maddenstein",800591A1 00FF +Cheat10="Enable\Stadium\Cosmodome",800591A2 00FF +Cheat11="Enable\Stadium\EA Sports",800591A3 00FF +Cheat12="Enable\Stadium\Tiburon",800591A4 00FF +Cheat13="Enable\Stadium\Tampa Bay",800591A5 00FF +Cheat14="Enable\Stadium\New Orleans",800591A6 00FF +Cheat15="Enable\Stadium\San Diego",800591A7 00FF +Cheat16="Enable\Team\All 60's",800598CC 00FF +Cheat17="Enable\Team\All 70's",800598CD 00FF +Cheat18="Enable\Team\All 80's",800598CE 00FF +Cheat19="Enable\Team\All 90's",800598CF 00FF +Cheat20="Enable\Team\Madden 1999",800598D0 00FF +Cheat21="Enable\Team\Madden Millenium",800598D1 00FF +Cheat22="Enable\Team\NFL Millenium",800598D2 00FF +Cheat23="Enable\Team\EA Sports",800598D3 00FF +Cheat24="Enable\Team\Tiburon",800598D4 00FF +Cheat25="Enable\Team\Marshalls",800598D5 00FF +Cheat26="Enable\Team\Toymakers",800598D6 00FF +Cheat27="Enable\Team\Clows",800598D7 00FF +Cheat28="Enable\Team\Praetorians",800598D8 00FF +Cheat29="Enable\Team\Junkyard Dogs",800598D9 00FF +Cheat30="Enable\Team\Industrials",800598DA 00FF +Cheat31="Enable\Team\Sugarbuzz",800598DB 00FF +Cheat32="Enable\Team\Mummies",800598DC 00FF +Cheat33="Enable\Team\Vipers",800598DD 00FF +Cheat34="Enable\Team\Monsters",800598DE 00FF +Cheat35="Enable\Team\Comets",800598DF 00FF +Cheat36="Level 1\Recover At Least One Fumble",800707C0 0040 +Cheat37="Level 1\200 Yards Of Total Offense Or More",800707C1 0040 +Cheat38="Level 1\Play And Win One Game of The Tournment",800707C2 0040 +Cheat39="Level 1\Have A Minimium Of Three Players ON Team Catch One Pass",800707C3 0040 +Cheat40="Level 1\Intercept At Least One Pass",800707BF 0040 +Cheat41="Level 1\Play a Exhibition Game In A Stadium Other Than The Default One",800707BE 0040 +Cheat42="Level 1\Sack The Opposing QB",800707BD 0040 +Cheat43="Level 1\QB Passes For Two TDS Or More",800707BC 0040 +Cheat44="Level 1\Play A Exhibition Game In A QTR Length Other Than 5 Minutes",800707BB 0040 +Cheat45="Level 1\Create A Player And use Him In A Game",800707BA 0040 +Cheat46="Level 1\Defeat San Francisco In Rain At 3COM Park",800707B9 0040 +Cheat47="Level 1\Defeat Green Bay In Snow At Lambeau Field",800707B8 0040 +Cheat48="Level 1\3 Tackles Or More By One Player",800707B7 0040 +Cheat49="Level 1\Kick A 40 Yard Punt Or Longer",800707B6 0040 +Cheat50="Level 1\Kick A 40 Yard Field Goal Or Longer",800707B5 0040 +Cheat51="Level 1\Throw 0 Interceptions In A Game",800707B4 0040 +Cheat52="Level 1\Hold Your Oppnent to 7 Points Or Less In a Game",800707B3 0040 +Cheat53="Level 1\Score 21 Points Or More With A QTR Length Of 6 Minutes Or Less",800707B2 0040 +Cheat54="Level 1\Complete A 20 Yard Run Or Longer",800707B1 0040 +Cheat55="Level 1\Complete A 30 Yard Pass Or Longer",800707B0 0040 +Cheat56="Level 2\Score 40 Points Or More Within A Quarter Length Of 6 Minutes Or Less",800707C4 0040 +Cheat57="Level 2\100 Yards Of Rushing Or Greater By One Player",800707C5 0040 +Cheat58="Level 2\100 Recption Yards Or Greater By One Player",800707C6 0040 +Cheat59="Level 2\QB Passes 300 Yards Or More",800707C7 0040 +Cheat60="Level 2\3 Field Goals Or More By One Player",800707C8 0040 +Cheat61="Level 2\QB Passes For 4 TDS Or More",800707C9 0040 +Cheat62="Level 2\Play And Win One Franchise Mode Game",800707CA 0040 +Cheat63="Level 2\Play And Win One Season Mode Game Without Modified Divisions",800707CB 0040 +Cheat64="Level 2\Play And Win One Season Mode Game With Modified Divisions",800707CC 0040 +Cheat65="Level 2\Play And Win Two Games In A Tournment With The Same Team",800707CD 0040 +Cheat66="Level 2\6 Receptions Or Greater By One Player",800707CE 0040 +Cheat67="Level 2\Have A RB Who Rushes For 3 TDS Or More",800707CF 0040 +Cheat68="Level 2\Hold Opposing Team To 150 Yards Total Offense Or Less",800707D0 0040 +Cheat69="Level 2\QB Rushes For One Rushing TD Or More",800707D1 0040 +Cheat70="Level 2\Commit No Fumbles In A Game",800707D2 0040 +Cheat71="Level 2\Do Not Allow Your QB To Be Sacked In A Game",800707D3 0040 +Cheat72="Level 2\Complete a 60 Yard Pass Or Longer",800707D4 0040 +Cheat73="Level 2\Play And Win A Pro Bowl Game As The NFC Team",800707D5 0040 +Cheat74="Level 2\Play And Win A Pro Bowl Game As The AFC Team",800707D6 0040 +Cheat75="Level 2\2 TDS Or More By One Receiver",800707D7 0040 +Cheat76="Level 3\150 Yards Rushing Or Greater By One Player",800707D8 0040 +Cheat77="Level 3\150 Reception Yards Or Greater By One Player",800707D9 0040 +Cheat78="Level 3\QB Who Passes For 400 Yards Or More",800707DA 0040 +Cheat79="Level 3\3 Sacks Or More By One Player",800707DB 0040 +Cheat80="Level 3\2 Interceptions Or More By One Player",800707DC 0040 +Cheat81="Level 3\Recover 2 Fumbles Or More",800707DD 0040 +Cheat82="Level 3\5 Successful Field Goals Or More By One Player",800707DE 0040 +Cheat83="Level 3\3 Knockdowns Or More By One PLayer",800707DF 0040 +Cheat84="Level 3\3 Tips Or More By One Player",800707E0 0040 +Cheat85="Level 3\Play And Win A Superbowl In Franchise Mode",800707E1 0040 +Cheat86="Level 3\Play And Win A Superbowl In Season Mode",800707E2 0040 +Cheat87="Level 3\Successfully Kick 8 Extra Points Or More",800707E3 0040 +Cheat88="Level 3\Play And Win An 8 Team Tournament",800707E4 0040 +Cheat89="Level 3\Complete A 50 Yard Run Or Longer",800707E5 0040 +Cheat90="Level 3\Commit No Penalties In A Game",800707E6 0040 +Cheat91="Level 3\Break 2 Different All-Time Records Or More In A Game",800707E7 0040 +Cheat92="Level 3\Score 55 Points Or Greater",800707E8 0040 +Cheat93="Level 3\8 Tackles Or More By One Player",800707E9 0040 +Cheat94="Level 3\400 Yards Of Total Defense Or More",800707EA 0040 +Cheat95="Level 3\Have A RB Rush For Over 100 Yards And 50 Yards Receiving",800707EB 0040 +Cheat96="Level 4\200 Yards Rushing Or Greater By One Player",800707EC 0040 +Cheat97="Level 4\200 Receptions Yards Or Greater By One Player",800707ED 0040 +Cheat98="Level 4\QB Who Passes For 500 Yards Or More",800707EE 0040 +Cheat99="Level 4\Return A Punt For A Touchdown",800707EF 0040 +Cheat100="Level 4\Return An Interception For A Touchdown",800707F0 0040 +Cheat101="Level 4\6 Successful Two Point Conversions Or More",800707F1 0040 +Cheat102="Level 4\25 Completions Or More By One QB",800707F2 0040 +Cheat103="Level 4\Go Undefeated And Win A Superbowl In One Franchise Mode Season By Playing Every Game",800707F3 0040 +Cheat104="Level 4\Go Undefeated And Win A Superbowl In One Season Mode Season By Playing Every Game",800707F4 0040 +Cheat105="Level 4\QB Who Rushes For 75 Yards Or More",800707F5 0040 +Cheat106="Level 4\Have A Minimum Of 7 Members Of Your Team Catch At Least 1 Pass",800707F6 0040 +Cheat107="Level 4\Win A 16 Team Tournament",800707F7 0040 +Cheat108="Level 4\7 Sacks Or More By One Player",800707F8 0040 +Cheat109="Level 4\650 Yards Of Total Offense Or More By One Team",800707F9 0040 +Cheat110="Level 4\Have One Reciever With 150 RAC Yards Or Greater",800707FA 0040 +Cheat111="Level 4\Rush The Ball 40 Time Or More With A QTR Length Of 6 Minutes Or Less",800707FB 0040 +Cheat112="Level 4\Rush For 100 Yards Or More With 2 Different Running Backs",800707FC 0040 +Cheat113="Level 4\Win By A Margin Of 50 Points Or More",800707FD 0040 +Cheat114="Level 4\40 First Downs Or More",800707FE 0040 +Cheat115="Level 4\Kick A Punt Of 55 Yards Or More",800707FF 0040 +Cheat116="Level 5\Return A Kickoff For A Touchdown",80070800 0040 +Cheat117="Level 5\Have A QB With A Pass AVG Of 30 Yards Or Greater While Throwing At Least 5 Passes",80070801 0040 +Cheat118="Level 5\Shut Out Opposing Team With A QTR Length Of 5 Minutes",80070802 0040 +Cheat119="Level 5\Pass For 200 Yards Or More With 2 QBS",80070803 0040 +Cheat120="Level 5\Have A RB With A Rushing AVG Of 20 Yards Or Greater While Rushing At least 3 Times",80070804 0040 +Cheat121="Level 5\3 Receivers With 100 Yards Or More Recieving",80070805 0040 +Cheat122="Level 5\200 Punt Return Yards Or Greater By One Player",80070806 0040 +Cheat123="Level 5\QB Rushes For 3 Touchdowns Or More",80070807 0040 +Cheat124="Level 5\Score 80 Points Or Greater",80070808 0040 +Cheat125="Level 5\200 Kick Return Yards Or Greater By One Player",80070809 0040 +Cheat126="Level 5\Complete A Run Play Of 80 Yards Or More",8007080A 0040 +Cheat127="Level 5\Convert 10 4th Down Conversions Or More",8007080B 0040 +Cheat128="Level 5\QB With A Minimum Of 150 Yards Passing And 100 Yards Rushing",8007080C 0040 +Cheat129="Level 5\Break 4 Different All-Time Records Or More In A Game",8007080D 0040 +Cheat130="Level 5\Successfully Kick A FG Of 55 Yards Or More",8007080E 0040 +Cheat131="Level 5\Have A QB With A 100 Passing PCT While Throwing A Minimum Of 5 Passes",8007080F 0040 +Cheat132="Level 5\Play And Win A Minimum Of Four Superbowls With The Same Team In Franchise Mode",80070810 0040 +Cheat133="Level 5\RB With A Minimum Of 100 Yards Receiving And 100 Yards Rushing",80070811 0040 +Cheat134="Level 5\Convert To 3RD Down Conversions Or More",80070812 0040 +Cheat135="Level 5\250 Yards Rushing Or Greater By One Player",80070813 0040 +Cheat136="Infinite\Time-Outs Home Team",8006CE7F 0003 +Cheat137="No Time-Outs\Home Team",8006EC7F 0000 +Cheat138="Infinite\Time-Outs Away Team",8006FE6F 0003 +Cheat139="No Time-Outs\Away Team",8006EF6F 0000 +Cheat140="Press L For First Down\Player 1",D00753DD 0020,81071B18 0001 +Cheat141="Press L For First Down\Player 2",D00753E5 0020,81071B18 0001 +Cheat142="Press L For First Down\Player 3",D00753ED 0020,81071B18 0001 +Cheat143="Press L For First Down\Player 4",D00753F5 0020,81071B18 0001 +Cheat144="Press R For Fourth Down\Player 1",D00753DD 0010,81071B18 0004 +Cheat145="Press R For Fourth Down\Player 2",D00753E5 0010,81071B18 0004 +Cheat146="Press R For Fourth Down\Player 3",D00753ED 0010,81071B18 0004 +Cheat147="Press R For Fourth Down\Player 4",D00753F5 0010,81071B18 0004 +Cheat148="Home Team\Always Has The Ball",810590A8 0000,810590AA 0001 +Cheat149="Away Team\Always Has The Ball",810590A8 0001,810590AA 0000 +Cheat150="Have All Secret Codes In Menu",81070788 FFFF,8107078A FFFF,8107078C FFFF,8107078E FFFF +Cheat151="Press GS For More Time To Choose Play",890723E6 0024 +Cheat152="Players\Jagged",8005F180 0080 +Cheat153="Players\Polygon",8005F183 0001 +Cheat154="Players\Evil Crystal",8005F183 000F +Cheat155="Uniforms\Ghetto",8005F188 001F +Cheat156="Uniforms\Bare",8005F188 008F +Cheat157="Players\Pixel",8005F18D 0001 +Cheat158="Particle Illusions\A",8005F19B 00FE +Cheat159="Particle Illusions\B",8005F199 0002 +Cheat160="Uniforms\Future",8005F207 0033 +Cheat161="Players\Hallow",8005F233 0047 +Cheat162="Players\Generic Black & White",8005F233 0058 +Cheat163="Players\Super Red",8005F43E 0002 + +//---- + +[13836389-265B3C76-C:45] +Name=Madden Football 64 (U) +Cheat0="Infinite\Time Outs Home Team",80082D97 0003 +Cheat1="Infinite\Time Outs Away Team",80084EE3 0003 +Cheat2="No Time-Outs\Home Team",80082D97 0000 +Cheat3="No Time-Outs\Away Team",80084EE3 0000 +Cheat4="Enable\All Stadiums",50000901 0000,80073510 00FF +Cheat5="Enable\All Teams",50000901 0000,80073CF8 00FF +Cheat6="Invisible Players",800545A0 0000,800545A0 0001,800545A0 0002,800545A0 0003 +Cheat7="Background\Gray Madden",810596E0 0000 +Cheat8="Background\Pink Madden",810596E0 0001 +Cheat9="Background\Green & Black Madden",810596E0 0002 +Cheat10="Background\Coloured Madden",810596E0 0003 +Cheat11="Background\Pink & Purple Madden",810596E0 0004 +Cheat12="Background\Pinker Madden",810596E0 0006 + +//---- + +[DEB78BBA-52F6BD9D-C:45] +Name=Madden NFL 99 (U) +Cheat0="Infinite\Time Outs Home Team",8005CF89 0003 +Cheat1="Infinite\Time Outs Away Team",8005FA49 0003 +Cheat2="No Time-Outs\Home Team",8005CF89 0000 +Cheat3="No Time-Outs\Away Team",8005FA49 0000 +Cheat4="Home Team\Scores 50",8005CF87 0032 +Cheat5="Home Team\Scores 0",8005CF87 0000 +Cheat6="Away Team\Scores 50",8005FA47 0032 +Cheat7="Away Team\Scores 0",8005FA47 0000 +Cheat8="Enable\All Stadiums",50000801 0000,8004A7F0 00FF +Cheat9="Enable\All Teams",50000E01 0000,8004ADD0 00FF +Cheat10="Press L For First Down\Player 1",D0066F2D 0020,810612E0 0001 +Cheat11="Press L For First Down\Player 2",D0066F35 0020,810612E0 0001 +Cheat12="Press L For First Down\Player 3",D0066F3D 0020,810612E0 0001 +Cheat13="Press L For First Down\Player 4",D0066F45 0020,810612E0 0001 +Cheat14="Press R For Fourth Down\Player 1",D0066F2D 0010,810612E0 0004 +Cheat15="Press R For Fourth Down\Player 2",D0066F35 0010,810612E0 0004 +Cheat16="Press R For Fourth Down\Player 3",D0066F3D 0010,810612E0 0004 +Cheat17="Press R For Fourth Down\Player 4",D0066F45 0010,810612E0 0004 +Cheat18="Press L For More Time To Choose Play\Player 1",D0066F2D 0020,80061245 0028 +Cheat19="Press L For More Time To Choose Play\Player 2",D0066F35 0020,80061245 0028 +Cheat20="Press L For More Time To Choose Play\Player 3",D0066F3D 0020,80061245 0028 +Cheat21="Press L For More Time To Choose Play\Player 4",D0066F45 0020,80061245 0028 + +//---- + +[EB38F792-190EA246-C:45] +Name=Madden NFL 2001 (U) +Cheat0="Home Team\Infinite Time-Outs",80071617 0003 +Cheat1="Home Team\No Time-Outs",80071617 0000 +Cheat2="Away Team\Infinite Time-Outs",800738E7 0003 +Cheat3="Away Team\No Time-Outs",800738E7 0000 +Cheat5="Have All\Cheats",50000402 0000,81070788 FFFF +Cheat6="Have 99 Tokens",8115F9F0 0063 +Cheat7="Have All\Stadiums",50000802 0000,81061850 FFFF +Cheat8="Have All\Teams",50001102 0000,810C1628 FFFF +Cheat9="Have All\Levels Completed",50001902 0000,8115FB2C FFFF +Cheat10="Have All\Cards",50007802 0000,8115F9F2 FFFF + +//---- + +[75B61647-7ADABF78-C:45] +Name=Magical Tetris Challenge (U) +Cheat0="Always Get\Magical Tetris Pieces",811D267E DB20 +Cheat1="Always Get\Straight Pieces",801D25F4 0000 +Cheat2="Quick Score Gain",811D26A6 FFFF + +//---- + +[664BA3D4-678A80B7-C:45] +Name=Mario Golf (U) +Cheat0="Enable All Courses",81130CEE FFFF +Cheat1="No Wind",810BA9F1 0000,800BA9F3 0000 +Cheat2="Unlimited\Power Hits\Player 1",801B71F8 0004 +Cheat3="Unlimited\Power Hits\Player 2",801B72B0 0004 +Cheat4="Unlimited\Power Hits\Player 3",801B7368 0004 +Cheat5="Unlimited\Power Hits\Player 4",801B7420 0004 +Cheat6="Have All Characters",50000E02 0001,810C28E4 0000 +Cheat7="Max Gold Mario Badges Player 1",800C545B 0063 +Cheat8="Zero Strokes Taken",801B71F3 0000 + +//---- + +[3E5055B6-2E92DA52-C:45] +Name=Mario Kart 64 (U) +Cheat0="Infinite Items\2 player Mode\Player 1",80165F5D 00??,80165F8A 00?? +Cheat0_O=$0D Double Mushroom,$09 Fake Item Box,$0B Ghost,$0A Invincible Star,$08 Lightning,$01 Single Banana,$03 Single Green Shell,$0C Single Mushroom,$05 Single Red Shell,$0F Super Mushroom,$04 Triple Green Shell,$0E Triple Mushroom,$06 Triple Red Shell,$02 Banana Bunch,$07 Blue Spiny Shell +Cheat1="Infinite Items\2 player Mode\Player 2",8016603D 00??,8016606A 00?? +Cheat1_O=$0D Double Mushroom,$09 Fake Item Box,$0B Ghost,$0A Invincible Star,$08 Lightning,$01 Single Banana,$03 Single Green Shell,$0C Single Mushroom,$05 Single Red Shell,$0F Super Mushroom,$04 Triple Green Shell,$0E Triple Mushroom,$06 Triple Red Shell,$02 Banana Bunch,$07 Blue Spiny Shell +Cheat2="Infinite Items\3-4 player Mode\Player 1",8016611D 00??,8016614A 00?? +Cheat2_O=$0D Double Mushroom,$09 Fake Item Box,$0B Ghost,$0A Invincible Star,$08 Lightning,$01 Single Banana,$03 Single Green Shell,$0C Single Mushroom,$05 Single Red Shell,$0F Super Mushroom,$04 Triple Green Shell,$0E Triple Mushroom,$06 Triple Red Shell,$02 Banana Bunch,$07 Blue Spiny Shell +Cheat3="Infinite Items\3-4 player Mode\Player 2",801661FD 00??,8016622A 00?? +Cheat3_O=$0D Double Mushroom,$09 Fake Item Box,$0B Ghost,$0A Invincible Star,$08 Lightning,$01 Single Banana,$03 Single Green Shell,$0C Single Mushroom,$05 Single Red Shell,$0F Super Mushroom,$04 Triple Green Shell,$0E Triple Mushroom,$06 Triple Red Shell,$02 Banana Bunch,$07 Blue Spiny Shell +Cheat4="Infinite Items\3-4 player Mode\Player 3",801662DD 00??,8016630A 00?? +Cheat4_O=$0D Double Mushroom,$09 Fake Item Box,$0B Ghost,$0A Invincible Star,$08 Lightning,$01 Single Banana,$03 Single Green Shell,$0C Single Mushroom,$05 Single Red Shell,$0F Super Mushroom,$04 Triple Green Shell,$0E Triple Mushroom,$06 Triple Red Shell,$02 Banana Bunch,$07 Blue Spiny Shell +Cheat5="Infinite Items\3-4 player Mode\Player 4",801663BD 00??,801663EA 00?? +Cheat5_O=$0D Double Mushroom,$09 Fake Item Box,$0B Ghost,$0A Invincible Star,$08 Lightning,$01 Single Banana,$03 Single Green Shell,$0C Single Mushroom,$05 Single Red Shell,$0F Super Mushroom,$04 Triple Green Shell,$0E Triple Mushroom,$06 Triple Red Shell,$02 Banana Bunch,$07 Blue Spiny Shell +Cheat6="No Laps to Race",81164390 0000,81164392 0002 +Cheat7="Always Have\46 Pts\Bowser",8018D9CF 002D +Cheat8="Always Have\46 Pts\D.K.",8018D9CC 002D +Cheat9="Always Have\46 Pts\Luigi",8018D9C9 002D +Cheat10="Always Have\46 Pts\Mario",8018D9C8 002D +Cheat11="Always Have\46 Pts\Peach",8018D9CE 002D +Cheat12="Always Have\46 Pts\Toad",8018D9CB 002D +Cheat13="Always Have\46 Pts\Wario",8018D9CD 002D +Cheat14="Always Have\46 Pts\Yoshi",8018D9CA 002D +Cheat16="All Players Can Choose The Same Character",810B3924 2400,810B3936 7FFF,810B39A4 2400,810B39B6 7FFF,810B3A38 2400,810B3A4E 7FFF +Cheat15="Press GS\To Play 2 Players In 1 Player Game",8918EDE4 0003,8918EDE4 0007,8918EDE4 0005,8918EDE4 0001 +Cheat18="Have Bonus Mode and All Gold Cups",50000401 0000,8018ED10 00?? +Cheat18_O=$00 Off,$FF On +Cheat17="Press GS\For Full Debug Menu",8818EDEF 0002 +Cheat17_N=Press GS at the Press Start Menu to access the Debug Menu +Cheat19="Press L To Levitate\Player 1",D00F6915 0020,810F69C8 4000 +Cheat20="Press L To Levitate\Player 2",D00F6925 0020,810F77A0 4000 +Cheat21="Press L To Levitate\Player 3",D00F6935 0020,810F8578 4000 +Cheat22="Press L To Levitate\Player 4",D00F6945 0020,810F9350 4000 + +//---- + +[2829657E-A0621877-C:45] +Name=Mario Party (U) +Cheat0="Top Left Character\Coin Options",800F32B8 00?? +Cheat1="Top Left Character\Star Options",800F32BC 00?? +Cheat2="Top Right Character\Coin Options",800F32E8 00?? +Cheat3="Top Right Character\Star Options",800F32EC 00?? +Cheat4="Lower Left Character\Coin Options",800F3318 00?? +Cheat5="Lower Left Character\Star Options",800F331C 00?? +Cheat6="Lower Right Character\Coin Options",800F3348 00?? +Cheat7="Lower Right Character\Star Options",800F334C 00?? +Cheat8="Top Left Character\Dice Always",800D62D3 00?? +Cheat9="Top Right Character\Dice Always",800D6317 00?? +Cheat10="Lower Left Character\Dice Always",800D635B 00?? +Cheat11="Lower Right Character\Dice Always",800D639F 00?? +Cheat12="Mini Game\Unlimited 99 lives",800F3767 0063 +Cheat13="Mini Game\Max 99 Coins",800F3770 0063 +Cheat14="Board Select",800ED5C3 00?? +Cheat14_O=$00 DK's Jungle Adventure,$01 Peach's Birthday Cake,$02 Yoshi's Tropical Island,$03 Wario's Battle Canyon,$04 Luigi's Engine Room,$05 Mario's Rainbow Castle,$06 Bowser's Magma Mountain,$07 Eternal Star,$08 Explaination Map,$09 Mini Game Stadium +Cheat15="Mini Game Island\Press GS For 99 Lives",880F37BB 0063 +Cheat16="Mini Game Island\99 Coins",800F37C4 0063 +Cheat17="Mini Game Island\Always Clear Level",800F32BB 0063 +Cheat18="Mini Game Island\World Level Select",810F32C4 ???? +Cheat0_O=$00 0 Coins,$0A 10 Coins,$64 100 Coins,$FF 255 Coins +Cheat1_O=$00 0 Stars,$64 99 Stars +Cheat2_O=$00 0 Coins,$0A 10 Coins,$64 100 Coins,$FF 255 Coins +Cheat3_O=$00 0 Stars,$64 99 Stars +Cheat4_O=$00 0 Coins,$0A 10 Coins,$64 100 Coins,$FF 255 Coins +Cheat5_O=$00 0 Stars,$64 99 Stars +Cheat6_O=$00 0 Coins,$0A 10 Coins,$64 100 Coins,$FF 255 Coins +Cheat7_O=$00 0 Stars,$64 99 Stars +Cheat8_O=$00 Rolls In Random,$01 Rolls In 1,$02 Rolls In 2,$03 Rolls In 3,$04 Rolls In 4,$05 Rolls In 5,$06 Rolls In 6,$07 Rolls In 7,$08 Rolls In 8,$09 Rolls In 9,$0A Rolls In 10 +Cheat9_O=$00 Rolls In Random,$01 Rolls In 1,$02 Rolls In 2,$03 Rolls In 3,$04 Rolls In 4,$05 Rolls In 5,$06 Rolls In 6,$07 Rolls In 7,$08 Rolls In 8,$09 Rolls In 9,$0A Rolls In 10 +Cheat10_O=$00 Rolls In Random,$01 Rolls In 1,$02 Rolls In 2,$03 Rolls In 3,$04 Rolls In 4,$05 Rolls In 5,$06 Rolls In 6,$07 Rolls In 7,$08 Rolls In 8,$09 Rolls In 9,$0A Rolls In 10 +Cheat11_O=$00 Rolls In Random,$01 Rolls In 1,$02 Rolls In 2,$03 Rolls In 3,$04 Rolls In 4,$05 Rolls In 5,$06 Rolls In 6,$07 Rolls In 7,$08 Rolls In 8,$09 Rolls In 9,$0A Rolls In 10 +Cheat18_O=$0000 Start Save and Return Space,$0001 1-1 Coin Block Blitz,$0002 1-2 Coin Block Bash,$0003 1-3 Coin Shower Flower,$0004 1-4 Paddle Battle,$0005 Save and Return Space 1,$0006 2-1 Memory Match,$0007 2-2 Ground Pound,$0008 2-3 Limbo Dance,$0009 2-4 Magical Mushroom,$000A 2-5 Piranha's Pursuit,$0018 3-1 Crazy Cutter,$0019 3-2 Buried Treasure,$001A 3-3 Desrt Dash,$001B 3-4 Tug O' War,$001C 3-5 Teetering Towers,$001D Save and Return Space 2,$001E World 4-1 to 4-3 - Entrance,$0028 World 4-4 Entrance,$0029 Save and Return Space 3,$002A World 6-1 to 6-6 Castle Entrance,$0048 World 8-6 to 8-1 Castle Entrance 2,$0049 Save and Return Space 4,$004A 9-1 Hammer Drop,$004B 9-2 Slot Car Derby,$004C 9-3 Shell Game,$004D 9-4 Knock Block Tower,$004E 9-5 Platform Peril,$004F Goal Space - Final Goal +Cheat0_N=If you want to have full 255 Coins,1st use the 100 Option then put on 255. this will stop the numbers from changing & spoiling the result. +Cheat8_N=With this option you can calculate exactly how many you need to get on the position of your choice. +Cheat9_N=With this option you can calculate exactly how many you need to get on the position of your choice. +Cheat10_N=With this option you can calculate exactly how many you need to get on the position of your choice. +Cheat11_N=With this option you can calculate exactly how many you need to get on the position of your choice. +Cheat18_N=Select where you want to go then Enable the cheat. as soon as you enter turn the cheat back off so you can move on to the next level and not the same place. + +//---- + +[9EA95858-AF72B618-C:45] +Name=Mario Party 2 (U) +Cheat0="Infinite Coins Main Menu",810F8CD2 FFFF +Cheat1="Lower Right Char\Rolls 10",800DF5A9 000A +Cheat2="Lower Right Char\Item On Pick-Up",800FD375 00?? +Cheat3="Upper Left Char\Rolls 10",800DF4C5 000A +Cheat4="Upper Left Char\Item On Pick-Up",800FD2D9 00?? +Cheat5="Upper Right Char\Rolls 10",800DF511 000A +Cheat6="Upper Right Char\Item On Pick-Up",800DF30D 00?? +Cheat7="Lower Left Char\Rolls 10",800DF55D 000A +Cheat8="Lower Left Char\Item On Pick-Up",800FD341 00?? +Cheat2_O=$00 Mushroom,$01 Skeleton Key,$02 Plunder Chest,$03 Bowser Bomb,$04 Dueling Glove,$05 Warp Block,$06 Golden Mushroom,$07 Boo Bell,$08 Bowser Suit,$09 Magic Lamp +Cheat4_O=$00 Mushroom,$01 Skeleton Key,$02 Plunder Chest,$03 Bowser Bomb,$04 Dueling Glove,$05 Warp Block,$06 Golden Mushroom,$07 Boo Bell,$08 Bowser Suit,$09 Magic Lamp +Cheat6_O=$00 Mushroom,$01 Skeleton Key,$02 Plunder Chest,$03 Bowser Bomb,$04 Dueling Glove,$05 Warp Block,$06 Golden Mushroom,$07 Boo Bell,$08 Bowser Suit,$09 Magic Lamp +Cheat8_O=$00 Mushroom,$01 Skeleton Key,$02 Plunder Chest,$03 Bowser Bomb,$04 Dueling Glove,$05 Warp Block,$06 Golden Mushroom,$07 Boo Bell,$08 Bowser Suit,$09 Magic Lamp + +//---- + +[7C3829D9-6E8247CE-C:45] +Name=Mario Party 3 (U) +Cheat0="Top Left Character\Coin Options",810D1112 00?? +Cheat1="Top Left Character\Star Options",800D1116 00?? +Cheat2="Top Right Character\Coin Options",810D114A 00?? +Cheat3="Top Right Character\Star Options",800D114E 00?? +Cheat4="Lower Left Character\Coin Options",810D1182 00?? +Cheat5="Lower Left Character\Star Options",800D1186 00?? +Cheat6="Lower Right Character\Coin Options",810D11BA 00?? +Cheat7="Lower Right Character\Star Options",800D11BE 00?? +Cheat8="Top Left Character\Dice Always",800CDBD5 00?? +Cheat9="Top Right Character\Dice Always",800CDC21 00?? +Cheat10="Lower Left Character\Dice Always",800CDC6D 00?? +Cheat11="Lower Right Character\Dice Always",800CDCB9 00?? +Cheat0_O=$00 0 Coins,$0A 10 Coins,$64 100 Coins,$FF 255 Coins +Cheat1_O=$00 0 Stars,$64 99 Stars +Cheat2_O=$00 0 Coins,$0A 10 Coins,$64 100 Coins,$FF 255 Coins +Cheat3_O=$00 0 Stars,$64 99 Stars +Cheat4_O=$00 0 Coins,$0A 10 Coins,$64 100 Coins,$FF 255 Coins +Cheat5_O=$00 0 Stars,$64 99 Stars +Cheat6_O=$00 0 Coins,$0A 10 Coins,$64 100 Coins,$FF 255 Coins +Cheat7_O=$00 0 Stars,$64 99 Stars +Cheat8_O=$00 Rolls In Random,$01 Rolls In 1,$02 Rolls In 2,$03 Rolls In 3,$04 Rolls In 4,$05 Rolls In 5,$06 Rolls In 6,$07 Rolls In 7,$08 Rolls In 8,$09 Rolls In 9,$0A Rolls In 10 +Cheat9_O=$00 Rolls In Random,$01 Rolls In 1,$02 Rolls In 2,$03 Rolls In 3,$04 Rolls In 4,$05 Rolls In 5,$06 Rolls In 6,$07 Rolls In 7,$08 Rolls In 8,$09 Rolls In 9,$0A Rolls In 10 +Cheat10_O=$00 Rolls In Random,$01 Rolls In 1,$02 Rolls In 2,$03 Rolls In 3,$04 Rolls In 4,$05 Rolls In 5,$06 Rolls In 6,$07 Rolls In 7,$08 Rolls In 8,$09 Rolls In 9,$0A Rolls In 10 +Cheat11_O=$00 Rolls In Random,$01 Rolls In 1,$02 Rolls In 2,$03 Rolls In 3,$04 Rolls In 4,$05 Rolls In 5,$06 Rolls In 6,$07 Rolls In 7,$08 Rolls In 8,$09 Rolls In 9,$0A Rolls In 10 +Cheat0_N=If you want to have full 255 Coins,1st use the 100 Option then put on 255. this will stop the numbers from changing & spoiling the result. +Cheat8_N=With this option you can calculate exactly how many you need to get on the position of your choice. +Cheat9_N=With this option you can calculate exactly how many you need to get on the position of your choice. +Cheat10_N=With this option you can calculate exactly how many you need to get on the position of your choice. +Cheat11_N=With this option you can calculate exactly how many you need to get on the position of your choice. + +//---- + +[5001CF4F-F30CB3BD-C:45] +Name=Mario Tennis (U) +Cheat0="Have All\Characters Available",810653C8 FFFF +Cheat1="Have All\Courts Available",810653CC FFFF +Cheat2="Score\Player 1",8015344A 00?? +Cheat3="Score\Player 2",8015344B 00?? +Cheat2_O=$00 0,$01 15,$02 30,$03 40 +Cheat3_O=$00 0,$01 15,$02 30,$03 40 +Cheat4="Press C-Down For Easy Win Ring Shot - Game",D0066985 0004,8015350B 0082 +Cheat4_N=Do Not use with Time,Balls,Points Option +Cheat5="Press C-Down Easy Win Ring Shot - Time,Balls,Points",D0066985 0004,80153527 0082,D0066985 0004,80153523 0082 +Cheat5_N=Do Not use with Game Option + +//---- + +[0EC158F5-FB3E6896-C:45] +Name=Mega Man 64 (U) +Cheat0="Rapid Fire",80204EB3 0002 +Cheat1="Infinite\Health",81204A1E 0050 +Cheat2="Infinite\Zenny",811BC404 E0FF,811BC406 05F5 +Cheat3="Have\Normal Items",81205650 FFFF,81205652 FFFF,81205654 FFFF,81205656 FFFF +Cheat4="Have\Special Items",8120564C FFFF,8120564E FFFF +Cheat5="Infinite\Ammo",81204EBA 0080,81204EC2 0010,81204ECA 0708,81204ED2 0018,81204EDA 0010,81204EE2 0708,81204EEA 0020,81204EF2 0020,81204EFA 0020,81204F02 0018,81204F0A 012C,81204F12 0258 +Cheat6="Have\All Special Weapons",81205640 FFFF +Cheat6_N=With this code, Roll is the one that has to equip the weapons before you can use them. + +//---- + +[FA8C4571-BBE7F9C0-C:45] +Name=Mickey's Speedway USA (U) +Cheat0="Play As",800D3081 00?? +Cheat0_O=$00 Mickey Mouse,$01 Daisy Duck,$02 Goofy,$03 Pete,$04 Minnie Mouse,$05 Donald Duck,$06 Huey,$07 Dewey,$08 Louie,$09 Lugwig Von Drake +Cheat1="Traffic Troubles\Indianapolis\Max Tokens",8018E782 0063 +Cheat2="Traffic Troubles\San Fransisco\Max Tokens",80191A52 0063 +Cheat3="Traffic Troubles\New Mexico\Max Tokens",8018FD52 0063 +Cheat4="Traffic Troubles\Grand Canyon\Max Tokens",80193142 0063 +Cheat5="Motor Way Mania\Los Angeles\Max Tokens",8018DBE2 0063 +Cheat6="Motor Way Mania\Alaska\Max Tokens",8018E372 0063 +Cheat7="Motor Way Mania\Las Vegas\Max Tokens",80192A02 0063 +Cheat8="Motor Way Mania\Philadelphia\Max Tokens",80193882 0063 +Cheat9="Freewayphobia\Dakota\Max Tokens",8018D102 0063 +Cheat10="Freewayphobia\Seattle\Max Tokens",8018FCE2 0063 +Cheat11="Freewayphobia\New York\Max Tokens",8018F402 0063 +Cheat12="Freewayphobia\Chicago\Max Tokens",80191F32 0063 +Cheat13="Victory Vehicles\Yellowstone\Max Tokens",8018D3B2 0063 +Cheat14="Victory Vehicles\Washington DC\Max Tokens",80197552 0063 +Cheat15="Victory Vehicles\Everglades\Max Tokens",8018FB12 0063 +Cheat16="Victory Vehicles\Malibu\Max Tokens",801915A2 0063 +Cheat17="Frantic Finale\Hawaii\Max Tokens",80191F62 0063 +Cheat18="Frantic Finale\Oregon\Max Tokens",8018E932 0063 +Cheat19="Frantic Finale\Texas\Max Tokens",8018F0D2 0063 +Cheat20="Frantic Finale\Colorado\Max Tokens",80191882 0063 +Cheat21="Level Select",801875A9 00?? +Cheat21_O=$00 Traffic Troubles,$01 Motor Way Mania,$02 Freewayphobia,$03 Vitory Vehicles,$04 Frantic Finale,$05 Time Trial,$06 Practice,$07 Contest,$08 Options +Cheat22="Difficulty Select",8007BF00 00?? +Cheat22_O=$00 Amateur,$01 Intermediate,$02 Professional,$03 Mirror Mode +Cheat23="Unlock Everything",800D3128 008F,800D3129 0094,800D312A 0003,800D312C 0001,800D312F 0080,50000502 0000,800D3130 0009,50000502 0000,800D3131 0024,800D313A 0015,800D313B 007F,800D313C 0001,800D313D 00FF,800D313E 0004,800D313F 0022 +Cheat23_N=This will unlock all characters, tracks, mirror mode, all in-game cheats, postcards, pluto's collar and give you all Trophies for every track and difficulties. To have this cheat save to mempak, enable it and then go into the Options Menu and disable the cheat. Go to the Wide-Screen Settings and Change it to Wide-Screen [16.9] and then the B button to get back to Wide-Screen Settings, now go back into Wide-Screen [16.9] and change it back to Normal [4.3].and press the B button until you come back to the main Options Menu.Close the game and load it again to see everything saved to the Mempak and unlocked. +Cheat24="Always 1st & final time 00:00.00",50000301 0000,801CE609 0000 +Cheat24_N=All Levels +Cheat25="Re-name Characters\Mickey\Letter 1",801BE591 00?? +Cheat25_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat26="Re-name Characters\Mickey\Letter 2",801BE592 00?? +Cheat26_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat27="Re-name Characters\Mickey\Letter 3",801BE593 00?? +Cheat27_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat28="Re-name Characters\Mickey\Letter 4",801BE594 00?? +Cheat28_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat29="Re-name Characters\Mickey\Letter 5",801BE595 00?? +Cheat29_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat30="Re-name Characters\Mickey\Letter 6",801BE596 00?? +Cheat30_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat31="Re-name Characters\Minnie\Letter 1",801BE598 00?? +Cheat31_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat32="Re-name Characters\Minnie\Letter 2",801BE599 00?? +Cheat32_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat33="Re-name Characters\Minnie\Letter 3",801BE59A 00?? +Cheat33_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat34="Re-name Characters\Minnie\Letter 4",801BE59B 00?? +Cheat34_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat35="Re-name Characters\Minnie\Letter 5",801BE59C 00?? +Cheat35_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat36="Re-name Characters\Minnie\Letter 6",801BE59D 00?? +Cheat36_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat37="Re-name Characters\Donald\Letter 1",801BE59F 00?? +Cheat37_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat38="Re-name Characters\Donald\Letter 2",801BE5A0 00?? +Cheat38_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat39="Re-name Characters\Donald\Letter 3",801BE5A1 00?? +Cheat39_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat40="Re-name Characters\Donald\Letter 4",801BE5A2 00?? +Cheat40_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat41="Re-name Characters\Donald\Letter 5",801BE5A3 00?? +Cheat41_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat42="Re-name Characters\Donald\Letter 6",801BE5A4 00?? +Cheat42_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat43="Re-name Characters\Daisy\Letter 1",801BE5A6 00?? +Cheat43_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat44="Re-name Characters\Daisy\Letter 2",801BE5A7 00?? +Cheat44_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat45="Re-name Characters\Daisy\Letter 3",801BE5A8 00?? +Cheat45_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat46="Re-name Characters\Daisy\Letter 4",801BE5A9 00?? +Cheat46_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat47="Re-name Characters\Daisy\Letter 5",801BE5AA 00?? +Cheat47_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat48="Re-name Characters\Goofy\Letter 1",801BE5AC 00?? +Cheat48_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat49="Re-name Characters\Goofy\Letter 2",801BE5AD 00?? +Cheat49_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat50="Re-name Characters\Goofy\Letter 3",801BE5AE 00?? +Cheat50_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat51="Re-name Characters\Goofy\Letter 4",801BE5AF 00?? +Cheat51_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat52="Re-name Characters\Goofy\Letter 5",801BE5B0 00?? +Cheat52_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat53="Re-name Characters\Pete\Letter 1",801BE5B2 00?? +Cheat53_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat54="Re-name Characters\Pete\Letter 2",801BE5B3 00?? +Cheat54_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat55="Re-name Characters\Pete\Letter 3",801BE5B4 00?? +Cheat55_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat56="Re-name Characters\Pete\Letter 4",801BE5B5 00?? +Cheat56_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat57="Re-name Characters\Huey\Letter 1",801BE5B7 00?? +Cheat57_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat58="Re-name Characters\Huey\Letter 2",801BE5B8 00?? +Cheat58_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat59="Re-name Characters\Huey\Letter 3",801BE5B9 00?? +Cheat59_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat60="Re-name Characters\Huey\Letter 4",801BE5BA 00?? +Cheat60_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat61="Re-name Characters\Dewey\Letter 1",801BE5BC 00?? +Cheat61_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat62="Re-name Characters\Dewey\Letter 2",801BE5BD 00?? +Cheat62_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat63="Re-name Characters\Dewey\Letter 3",801BE5BE 00?? +Cheat63_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat64="Re-name Characters\Dewey\Letter 4",801BE5BF 00?? +Cheat64_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat65="Re-name Characters\Dewey\Letter 5",801BE5C0 00?? +Cheat65_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat66="Re-name Characters\Louie\Letter 1",801BE5C2 00?? +Cheat66_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat67="Re-name Characters\Louie\Letter 2",801BE5C3 00?? +Cheat67_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat68="Re-name Characters\Louie\Letter 3",801BE5C4 00?? +Cheat68_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat69="Re-name Characters\Louie\Letter 4",801BE5C5 00?? +Cheat69_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat70="Re-name Characters\Louie\Letter 5",801BE5C6 00?? +Cheat70_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat71="Re-name Characters\Ludwig\Letter 1",801BE5C8 00?? +Cheat71_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat72="Re-name Characters\Ludwig\Letter 2",801BE5C9 00?? +Cheat72_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat73="Re-name Characters\Ludwig\Letter 3",801BE5CA 00?? +Cheat73_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat74="Re-name Characters\Ludwig\Letter 4",801BE5CB 00?? +Cheat74_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat75="Re-name Characters\Ludwig\Letter 5",801BE5CC 00?? +Cheat75_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat76="Re-name Characters\Ludwig\Letter 6",801BE5CD 00?? +Cheat76_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat77="Traffic Troubles\Indianapolis\Always Have Shield Shell",8018E75B 0063 +Cheat78="Traffic Troubles\San Fransisco\Always Have Shield Shell",80191A2B 0063 +Cheat79="Traffic Troubles\New Mexico\Always Have Shield Shell",8018FD2B 0063 +Cheat80="Traffic Troubles\Grand Canyon\Always Have Shield Shell",8019311B 0063 +Cheat81="Motor Way Mania\Los Angeles\Always Have Shield Shell",8018DBBB 0063 +Cheat82="Motor Way Mania\Alaska\Always Have Shield Shell",8018E34B 0063 +Cheat83="Motor Way Mania\Las Vegas\Always Have Shield Shell",801929DB 0063 +Cheat84="Motor Way Mania\Philadelphia\Always Have Shield Shell",8019385B 0063 +Cheat85="Freewayphobia\Dakota\Always Have Shield Shell",8018D0DB 0063 +Cheat86="Freewayphobia\Seattle\Always Have Shield Shell",8018FCBB 0063 +Cheat87="Freewayphobia\New York\Always Have Shield Shell",8018F3DB 0063 +Cheat88="Freewayphobia\Chicago\Always Have Shield Shell",80191F0B 0063 +Cheat89="Victory Vehicles\Yellowstone\Always Have Shield Shell",8018D38B 0063 +Cheat90="Victory Vehicles\Washington DC\Always Have Shield Shell",8019752B 0063 +Cheat91="Victory Vehicles\Everglades\Always Have Shield Shell",8018FAEB 0063 +Cheat92="Victory Vehicles\Malibu\Always Have Shield Shell",8019157B 0063 +Cheat93="Frantic Finale\Hawaii\Always Have Shield Shell",80191F3B 0063 +Cheat94="Frantic Finale\Oregon\Always Have Shield Shell",8018E90B 0063 +Cheat95="Frantic Finale\Texas\Always Have Shield Shell",8018F0AB 0063 +Cheat96="Frantic Finale\Colorado\Always Have Shield Shell",8019185B 0063 +Cheat1_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat2_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat3_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat4_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat5_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat6_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat7_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat8_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat9_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat10_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat11_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat12_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat13_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat14_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat15_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat16_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat17_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat18_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat19_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat20_N=Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat77_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat78_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat79_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat80_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat81_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat82_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat83_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat84_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat85_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat86_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat87_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat88_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat89_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat90_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat91_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat92_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat93_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat94_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat95_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat96_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + +//---- + +[F1850C35-ACE07912-C:45] +Name=Micro Machines 64 Turbo (U) +Cheat0="Always Place 1st",802083F1 0001 +Cheat1="Infinite\Lives",800BAFD2 0009 +Cheat2="Infinite\Specials On Pickup",80208401 0005 + +//---- + +[09D53E16-3AB268B9-C:45] +Name=Mike Piazza's Strike Zone (U) +Cheat0="Infinite\Balls",801606D0 0000 +Cheat1="Almost Always Hit A Home Run",80195714 0001 +Cheat2="Fast Game",80195729 0001 +Cheat3="Increased Gravity",80195727 0001 +Cheat4="Low Gravity",80195726 0001 +Cheat5="Slow Game",8019572A 0001 +Cheat6="Home Team\Score 0",801606B7 0000 +Cheat6_N=Do not use with Home Team Scors 30 +Cheat7="Home Team\Score 30",801606B7 001E +Cheat7_N=Do not use with Home Team Scors 0 +Cheat8="Away Team\Score 0",801606B5 0000 +Cheat8_N=Do not use with Away Team Scors 30 +Cheat9="Away Team\Score 30",801606B5 001E +Cheat9_N=Do not use with Away Team Scors 30 +Cheat10="Infinite\Strikes",801606D1 0000 +Cheat11="Stadium Modifier",800DE7E5 00?? +Cheat11_O=$00 Edison Into Field,$01 The Ball Park At Arlington,$02 The Astrodome,$03 Bank One Ballpark,$04 Milwaukee County Stadium,$05 Baltimore,$06 3com Park at Candle Stick Park,$07 Comiskey Park,$08 Coors Field,$09 Olympics Stadium,$0A Fenway Park,$0B Jacobs Field,$0C Proplayer Stadium,$0D Kauffman Stadium,$0E The Kingdom,$0F Dodger Stadium,$10 Oakland Alameda Country Stadium,$11 Qualcomm Stadium at Jack Murphy Field,$12 Cinergy Field,$13 Shea Stadium,$14 Skydome,$15 Bush Stadium,$16 3 Rivers Stadium,$17 Tiger Stadium,$18 Tropicane Field,$19 Turner Field,$1A Hubert Humphrey Metrodome,$1B Veterans Stadium,$1C Wrigley Field,$1D Yankee Stadium,$1E Devil's Thumb Stadium + +//---- + +[2E955ECD-F3000884-C:45] +Name=Milo's Astro Lanes (U) +Cheat0="Bowl A Perfect Game",5000090C 0000,800AC9F0 000A,800ACA5E 000A + +//---- + +[0B93051B-603D81F9-C:45] +Name=Mischief Makers (U) +Cheat0="Infinite\Red Gems",81175B66 270F +Cheat1="Infinite\Health",810ED0E0 03E8 + +//---- + +[26035CF8-802B9135-C:45] +Name=Mission Impossible (U) +Cheat0="Invincibility",810862B4 0101 +Cheat1="Infinite\Ammo All Guns",50000610 0000,800A8EA7 00FF +Cheat2="Infinite\Health",810862B2 FFFF +Cheat3="Access All Levels",8008A5C6 0001,8008A5DA 0001,8008A602 0001,8008A652 0001,8008A666 0001,8008A67A 0001,8008A68E 0001,8008A6A2 0001,8008A6B6 0011,8008A6CA 0021,8008A6DE 0001,8008A706 0011,8008A71A 0041,8008A72E 0021,8008A742 0081,8008A756 0001,8008A76A 0081,8008A77E 0001,8008A7A6 0001,8008A7CE 0001,8008A7E2 0011,8008A7F6 0021,8008A846 0001,8008AB2A 0001,8008AB3E 0001,8008AB52 0001,8008AB66 0001 +Cheat4="Freeze All Timers",81093D40 0063,81093D42 0063,81093D44 0063 +Cheat5="Weapon Select",800A8EA5 00??,800A8EB5 00??,800A8EC5 00?? +Cheat5_O=$00 9MM Hi Power,$01 Silenced Pistol,$02 Uzi,$03 Fists,$32 Gas Spray,$36 Blow Torch,$1F Fire Extinguisher,$24 Spray Paint,$27 Electrostunner,$0B Blow Dart Gun,$0C Dart Hand Gun,$2D Mini Rocket Launcher +Cheat6="Walk Through Walls & Objects",80093EF5 00?? +Cheat6_O=$80 On,$00 Off +Cheat6_N=This will allow you to pass through anything & even walk on water.if you amerge somewhere in the ground just press the A button. + +//---- + +[5AC383E1-D712E387-C:45] +Name=Monopoly (U) +Cheat0="Infinite\Money\Player 1",81324B46 270F +Cheat1="Infinite\Money\Player 2",81324B5A 270F +Cheat2="Infinite\Money\Player 3",81324B6E 270F +Cheat3="Infinite\Money\Player 4",81324B82 270F +Cheat4="[Language Select]",D009675F 0001,80096758 00?? +Cheat4_O=$00 American,$01 British,$02 France,$03 German +Cheat4_N=To use this load the game then enable this cheat and Reset (F1) you will now be on your chosen Language and Relative Local Language Board and Money. + +//---- + +[B19AD999-7E585118-C:45] +Name=Monster Truck Madness 64 (U) +Cheat0="Have\Aztec Valley Track",801256BF 0001 +Cheat1="Have\Alpine Challenge Track",801256DF 0001 +Cheat2="Have\Death Trap Track",801256FF 0001 +Cheat3="Infinite Missiles (Upon Pickup)",D0164BBF 0001,801A6054 0009 + +//---- + +[417DD4F4-1B482FE2-C:45] +Name=Mortal Kombat 4 (U) +Cheat0="Big Head Mode",80048CB5 0001 +Cheat1="Infinite\Health Player 1",810FE0D8 0001,810FE0DA 0000 +Cheat2="Infinite\Health Player 2",81126F54 0001,81126F56 0000 +Cheat3="1 Round To Win Player 1",D01050F3 0000,801050F3 0001 +Cheat4="99 Wins Player 1",800FE27F 0063 +Cheat5="Infinite\Credits",800493BF 00FF +Cheat6="Infinite\Time",8010511B 0063 +Cheat7="Play\As Goro Player 1",800FE293 000F +Cheat8="Play\As Noob Saibot Player 1",800FE293 0011 + +//---- + +[C34304AC-2D79C021-C:45] +Name=Mortal Kombat Mythologies - Sub-Zero (U) +Cheat0="Infinite Lives",8010BCFF 0009 +Cheat1="Invincible",8009F742 0001 +Cheat2="Level Select",D009A913 0000,8009A913 00?? +Cheat2_O=$00 Level 1 - Shaolin Temple - China,$01 Level 2 - Wind Realm,$02 Level 3 - Earth Realm,$03 Level 4 - Water Realm,$04 Level 5 - Fire Ream,$05 Level 6 - Prison,$06 Level 7 - Bridge,$07 Level 8 - Fortress +Cheat3="Max Experience",8111200E FC9A + +//---- + +[D9F75C12-A8859B59-C:45] +Name=Mortal Kombat Trilogy (U) (v1.0) +Cheat0="Player 1\No Energy",8016984D 0000 +Cheat1="Player 2\No Energy",80169B21 0000 +Cheat2="Player 2\Unlimited Energy",80169B21 00A6 +Cheat3="Player 1\Unlimited Energy",8016984D 00A6 + +//---- + +[2AF9B65C-85E2A2D7-C:45] +Name=MRC - Multi Racing Championship (U) +Cheat0="Infinite Time",80094E97 0064 +Cheat1="Low Course Time",8009483B 0000 +Cheat2="Always Place 1st",800A960F 0000 + +//---- + +[1938525C-586E9656-C:45] +Name=Ms. Pac-Man Maze Madness (U) +Cheat0="Infinite\Health",8111D55C 003C +Cheat1="Infinite\Lives",8010A3D7 0009 +Cheat2="Have All Dots",8111D55E 03E7 +Cheat3="Max Score",8111EF14 E0FF,8111EF16 05F5 + +//---- + +[FCBCCB21-72903C6B-C:45] +Name=Mystical Ninja - Starring Goemon (U) +Cheat0="Infinite\Health",8015C5E7 0028 +Cheat1="Infinite\Lives",8015C5EF 0009 +Cheat2="Infinite\Money",8115C5EA 270F +Cheat3="Press\L To Levitate",D00C7D3B 0020,8116A044 4000 +Cheat4="Press\R To Use Chargeable Weapon",D00C7D3B 0010,8120C896 005D +Cheat5="Max Heart Containers",8015C5E3 0027 +Cheat6="Play As",8015C5DF 00?? +Cheat6_O=$00 Goemon,01 Ebisumaru,02 Sasuke,03 Yae +Cheat7="Goemon\Have\Chain Pipe",8015C6BF 0002 +Cheat8="Goemon\Have\Medal of Flames",8015C6DF 0001 +Cheat9="Goemon\Have\Magic Sudden Impact",8015C6EF 0001 +Cheat10="Goemon\Pipe Modifier",8015C6AF 00?? +Cheat10_O=$00 Normal Pipe,01 Silver Pipe,02 Gold Pipe +Cheat11="Yae\Have\Bazooka",8015C6DB 0001 +Cheat12="Yae\Have\Flute",8015C6CB 0001 +Cheat13="Yae\Have\Magic Mermaid",8015C6FB 0001 +Cheat14="Yae\Katana Modifier",8015C6BB 00?? +Cheat14_O=$00 Normal Katana,01 Silver Katana,02 Gold Katana +Cheat15="Ebisumaru\Automatically Complete Ebisumaru's Training",803B52F4 0008 +Cheat16="Ebisumaru\Have\Windup Camera",8015C6D3 0001 +Cheat17="Ebisumaru\Have\Meat Saw Hammer",8015C6C3 0001 +Cheat18="Ebisumaru\Have\Magic Mini Ebisu",8015C6F3 0001 +Cheat19="Ebisumaru\Saw Hammer Modifier",8015C6B3 00?? +Cheat19_O=$00 Normal Saw Hammer,$01 Silver Saw Hammer,$02 Gold Saw Hammer +Cheat20="Sasuke\Have\Fire Cracker Bomb",8015C6C7 0001 +Cheat21="Sasuke\Have\Kunai of Severe Cold",8015C6D7 0001 +Cheat22="Sasuke\Have\Magic Flying",8015C6F7 0001 +Cheat23="Sasuke\Kunai Modifier",8015C6B7 00?? +Cheat23_O=$00 Normal Kunai,01 2 Kunai's,02 Gold Kunai +Cheat24="Have\Triton Shell",8015C6FF 0001 +Cheat25="Have\Brown Item",8015C703 0001 +Cheat26="Have\Silver Fortune Doll",8015C707 0001 +Cheat27="Have\Brown Round Item",8015C70F 0001 +Cheat28="Have\Gold Key",8015C713 0001 +Cheat29="Have\Blue Sausage",8015C717 0001 +Cheat30="Have\Pink Fish",8015C71B 0001 +Cheat31="Have\Gold Fish",8015C71F 0001 +Cheat32="Have\Blue Fish",8015C723 0001 +Cheat33="Goemon\D-Pad Up To Refill Oil",D0067D3A 0008,812F706A 03E7 +Cheat34="Goemon\Maximum Money",812F70EA 03E7 +Cheat35="Goemon\Robot Boss' Has No Health",812F7062 0000 +Cheat36="Goemon\D-Pad Left To Charge Laser",D00C7D3A 0002,802F706F 0064 + +//---- + +[8D2BAE98-D73725BF-C:45] +Name=Nagano Winter Olympics '98 (U) +Cheat0="Press [START] To Reset Timer",81137886 0000 +Cheat1="Infinite Stamina",81138400 447A,81138404 447A + +//---- + +[5129B6DA-9DEF3C8C-C:45] +Name=Namco Museum 64 (U) +Cheat0="Dig-Dug\Infinite\Credits",800FE67E 0063 +Cheat1="Dig-Dug\Infinite\Lives\Player 1",800FE709 0002 +Cheat2="Dig-Dug\Score\Player 1",810FE704 9999 +Cheat3="Dig-Dug\Infinite\Lives\Player 2",800FE76B 0004 +Cheat4="Dig-Dug\Score\Player 2",810FE768 9999 +Cheat5="Galaga\Infinite\Credits",800D76A4 0063 +Cheat6="Galaga\Infinite\Lives\Both Players",800D7510 0002 +Cheat7="Galaxian\Infinite\Credits",800CD3D0 0063 +Cheat8="Galaxian\Infinite\Lives",800CD3AD 0003 +Cheat9="Galaxian\Score\Player 1",810BCE7C 9999 +Cheat10="Galaxian\Score\Player 2",810BC780 9999 +Cheat11="Ms Pac-Man\Infinite\Credits",800BBE4B 0063 +Cheat12="Ms Pac-Man\Infinite\Lives\Player P1",800BBE23 0004 +Cheat13="Ms Pac-Man\Score Modifier\Player 1",810BC7E8 9999 +Cheat14="Ms Pac-Man\Infinite\Lives\Player 2",800BBE27 0004 +Cheat15="Ms Pac-Man\Score\Player 2",810BC7EC 9999 +Cheat16="Ms Pac-Man\High Score Modifier",810BC1F8 9999 +Cheat17="Ms Pac-Man\Eat All Ghosts All The Time",810BC100 0000,810BC102 0000,810BC12C 0000,810BC12E 0000,810BC158 0000,810BC15A 0000,810BC184 0000,810BC186 0000 +Cheat18="Pac-Man\Infinite\Credits",800A8817 0063 +Cheat19="Pac-Man\Infinite\Lives\Player 1",800BBE23 0004 +Cheat20="Pac-Man\Score\Player 1",810A86F0 9999 +Cheat21="Pac-Man\Infinite\Lives\Player 2",800BBE27 0004 +Cheat22="Pac-Man\Score\Player 2",810A86F4 9999 +Cheat23="Pac-Man\High Score",810A86F8 9999 +Cheat24="Pac-Man\Eat All Ghosts All The Time",810A8760 0000,810A8762 0000,810A878C 0000,810A878E 0000,810A87B8 0000,810A87BA 0000,810A87E4 0000,810A87E6 0000 +Cheat25="Pole Position\Infinite Time",8010A243 0063 +Cheat26="Pole Position\Score",81107BF8 9999 + +//---- + +[23749578-80DC58FD-C:45] +Name=NASCAR 99 (U) +Cheat0="1 Lap to Race",800438B3 0009,D021FBAB 0000,8021FBAB 0008,D022359B 0000,8022359B 0008 +Cheat1="Total Laps to Race Modifier",800438B3 00?? +Cheat1_O=$01 1 lap,$02 2 lap,$03 3 lap,$04 4 lap,$05 5 lap,$06 6 lap,$07 7 lap,$08 8 lap,$09 9 lap +Cheat2="Max Gear Ratios",810C9E90 7F1E,810C9E82 707F + +//---- + +[DF331A18-5FD4E044-C:45] +Name=NASCAR 2000 (U) +Cheat0="Total Number Of Laps",80046553 00?? +Cheat0_O=$01 1 lap,$02 2 lap,$03 3 lap,$04 4 lap,$05 5 lap,$06 6 lap,$07 7 lap,$08 8 lap,$09 9 lap +Cheat1="1 Lap Race",810495AE 0001 +Cheat1_N=Do not put this on with Total Number of Laps Code +Cheat2="Infinite Fuel\Player 1",81220502 3E80 +Cheat3="Infinite Fuel\Player 2",81230472 3E80 +Cheat4="Maximum\Pit Distance",800C7110 0000 +Cheat5="Maximum\Top Speed",800C7111 0000 +Cheat6="Maximum\Acceleration",800C7113 0000 +Cheat7="Beat Championship Mode Easily",80223E3B 0255 +Cheat8="Race Forever",810465AE FDE8 +Cheat9="Both Players Can Be Dale E",80046538 0003 +Cheat10="Have CPU Control Car Player 1",D0092985 0020,8015CC5C 0001,D0092985 0010,8015CC5C 0000 + +//---- + +[4E69B487-FE18E290-C:45] +Name=NBA Hangtime (U) +Cheat0="Team 1 Scores 150 pts",800A6689 0096 +Cheat1="Team 2 Scores 150 pts",800A668B 0096 + +//---- + +[EBEEA8DB-F2ECB23C-C:45] +Name=NBA JAM 2000 +Cheat0="Infinite Shot Clock",801378DF 0016 +Cheat1="Infinite Violation Clock",8013783B 005D +Cheat2="Infinite Turbo\Team 1\Player 1",8115B512 FF00 +Cheat3="Infinite Turbo\Team 1\Player 2",8115B516 FF00 +Cheat4="Team 1 Score Select",80137117 00?? +Cheat4_O=$00 00,$96 150 +Cheat5="Infinite Turbo\Team 2\Player 1",8115B50A FF00 +Cheat6="Infinite Turbo\Team 2\Player 2",8115B50E FF00 +Cheat7="Team 2 Score Select",80137113 00?? +Cheat7_O=$00 00,$96 150 + +//---- + +[810729F6-E03FCFC1-C:45] +Name=NBA Jam 99 (U) +Cheat0="Home Team\Scores 150",81160FFA 0096 +Cheat1="Home Team\Scores 0",81160FFA 0000 +Cheat2="Away Team\Scores 150",81160FFE 0096 +Cheat3="Home Team\Scores 0",81160FFE 0000 +Cheat4="Infinite\Time Outs\Home",800D5C75 0007 +Cheat5="No Time Outs\Home",800D5C7F 0000 +Cheat6="Infinite\Time Outs\Away",800D5C9B 0007 +Cheat7="No Time Outs\Away",800D5C9B 0000 +Cheat8="Away Team\Full Court Dunks",81182E4E 0004,8118305A 0004,81183266 0004,81183472 0004,8118367E 0004 +Cheat9="Away Team\Giant Players",81182DF6 0032,81182DFE 003C,81183002 0032,8118300A 003C,8118320E 0032,81183216 003C,8118341A 0032,81183422 003C,81183626 0032,8118362E 003C +Cheat10="Away Team\Tiny Players",81182DF6 0011,81182DFE 0014,81183002 0011,8118300A 0014,8118320E 0011,81183216 0014,8118341A 0011,81183422 0014,81183626 0011,8118362E 0014 +Cheat11="Creation Points (L / R)",D0061269 0020,8117E008 0200,D0061269 0010,8117E008 0000 +Cheat12="Home Team\Full Court Dunks",81182412 0004,8118261E 0004,8118282A 0004,81182A36 0004,81182C42 0004 +Cheat13="Home Team\Giant Players",811823BA 0032,811823C2 003C,811825C6 0032,811825CE 003C,811827D2 0032,811827DA 003C,811829DE 0032,811829E6 003C,81182BEA 0032,81182BF2 003C +Cheat14="Home Team\Tiny Players",811823BA 0011,811823C2 0014,811825C6 0011,811825CE 0014,811827D2 0011,811827DA 0014,811829DE 0011,811829E6 0014,81182BEA 0011,81182BF2 0014 + +//---- + +[6A121930-665CC274-C:45] +Name=NBA In The Zone '98 (U) +Cheat0="Options\FT. Penalty Situations",80144999 00?? +Cheat0_O=$00 2,$01 4,$02 6,$03 No +Cheat1="Home Team\Scores",8013C2B1 00?? +Cheat1_O=$00 No Points,$0A 10 Points,$14 20 Points,$28 40 Points,$3C 60 Points,$50 80 Points,$64 100 Points,$C8 200 Points,$FA 250 Points +Cheat2="Away Team\Scores",8013C2B3 00?? +Cheat2_O=$00 No Points,$0A 10 Points,$14 20 Points,$28 40 Points,$3C 60 Points,$50 80 Points,$64 100 Points,$C8 200 Points,$FA 250 Points +Cheat3="Home Team\Infinite Time-Outs",8013C2D6 0009,80140862 0009 +Cheat3_N=Do not use this with the No Time Out's Cheat +Cheat4="Away Team\Infinite Time-Outs",8013C2D7 0009,80140863 0009 +Cheat4_N=Do not use this with the No Time Out's Cheat +Cheat5="Home Team\No Time-Outs",8013C2D6 0000,80140862 0000 +Cheat5_N=Do not use this with the Infinite Time Out's Cheat +Cheat6="Away Team\No Time-Outs",8013C2D7 0000,80140863 0000 +Cheat6_N=Do not use this with the Infinite Time Out's Cheat +Cheat7="No Shot Clock",81140E1E FFFF +Cheat8="Create A Player\Max Field Goal",8013FF98 0063 +Cheat9="Create A Player\Max 3 Point",8013FF99 0063 +Cheat10="Create A Player\Max Free Throw",8013FF9A 0063 +Cheat11="Create A Player\Max Rebound",8013FF9C 0063 +Cheat12="Create A Player\Max Block",8013FF9D 0063 +Cheat13="Create A Player\Max Steal",8013FF9E 0063 +Cheat14="Create A Player\Max Speed",8013FF9F 0063 +Cheat15="Create A Player\Max Ball Control",8013FFA1 0063 +Cheat16="Create A Player\Max Power",8013FFA2 0063 +Cheat17="Options\Quarter Length",8013D865 00?? +Cheat17_O=$00 3:00,$01 5:00,$02 8:00,$03 12:00 +Cheat18="Options\Level",8013D864 00?? +Cheat18_O=$00 Enjoy,$01 Exciting,$02 Super Challenge +Cheat19="Options\Stamina",8013D866 00?? +Cheat19_O=$00 On,$01 Off +Cheat20="Options\27 Time Out Limit",8013D867 00?? +Cheat20_O=$00 Yes,$01 No +Cheat21="Options\Replay",8013D868 00?? +Cheat21_O=$00 Yes,$01 No +Cheat22="Options\Player Display",8013D869 00?? +Cheat22_O=$00 Name,$01 Number,$02 None +Cheat23="Options\Camera View",8013D86A 00?? +Cheat23_O=$00 1,$01 2,$02 3,$03 4,$04 5,$05 6,$06 7,$07 8,$08 9,$09 10 +Cheat24="Options\Out Of Bounds",80144990 00?? +Cheat24_O=$00 1,$01 2,$02 3,$03 4,$04 5,$05 6,$06 7,$07 8,$08 9,$09 10 +Cheat25="Options\Shot Clock Violation",80144991 00?? +Cheat25_O=$00 1,$01 2,$02 3,$03 4,$04 5,$05 6,$06 7,$07 8,$08 9,$09 10 +Cheat26="Options\Second Violation",80144992 00?? +Cheat26_O=$00 1,$01 2,$02 3,$03 4,$04 5,$05 6,$06 7,$07 8,$08 9,$09 10 +Cheat27="Options\5 Second Violation",80144993 00?? +Cheat27_O=$00 1,$01 2,$02 3,$03 4,$04 5,$05 6,$06 7,$07 8,$08 9,$09 10 +Cheat28="Options\3 Second Violation",80144994 00?? +Cheat28_O=$00 1,$01 2,$02 3,$03 4,$04 5,$05 6,$06 7,$07 8,$08 9,$09 10 +Cheat29="Options\Foul Out",80144995 00?? +Cheat29_O=$00 2,$01 4,$02 6,$03 No +Cheat30="Options\Back Court",80144996 00?? +Cheat30_O=$00 2,$01 4,$02 6,$03 No +Cheat31="Options\Traveling",80144997 00?? +Cheat31_O=$00 2,$01 4,$02 6,$03 No +Cheat32="Options\Goal Tending",80144998 00?? +Cheat32_O=$00 2,$01 4,$02 6,$03 No + +//---- + +[A292524F-3D6C2A49-C:45] +Name=NBA In The Zone '99 (U) +Cheat0="No Shot Clock",812010C4 43FF +Cheat1="Home Team\Score",81290378 ???? +Cheat1_O=$0000 o Points,$0A01 0 Points,$1402 0 Points,$2804 0 Points,$3C06 0 Points,$5008 0 Points,$6401 00 Points,$C802 00 Points,$FA02 50 Points +Cheat2="Away Team\Score",8129195C ???? +Cheat2_O=$0000 o Points,$0A01 0 Points,$1402 0 Points,$2804 0 Points,$3C06 0 Points,$5008 0 Points,$6401 00 Points,$C802 00 Points,$FA02 50 Points +Cheat3="Home Team\Time Outs Home",80290374 00?? +Cheat3_O=$00 None,$07 Infinite +Cheat4="Away Team\Time Outs",80291958 00?? +Cheat4_O=$00 None,$07 Infinite +Cheat5="Create A Player Codes\Max Shooting",802C5EFB 0063 +Cheat6="Create A Player Codes\Max 3 Point",802C5EFC 0063 +Cheat7="Create A Player Codes\Max Free Throw",802C5EFD 0063 +Cheat8="Create A Player Codes\Max Offensive",802C5EFE 0063 +Cheat9="Create A Player Codes\Max Defensive",802C5EFF 0063 +Cheat10="Create A Player Codes\Max Rebound",802C5F00 0063 +Cheat11="Create A Player Codes\Max Techinque",802C5F01 0063 +Cheat12="Create A Player Codes\Max Capaility",802C5F02 0063 + +//---- + +[5F25B0EE-6227C1DB-C:45] +Name=NBA Live 2000 (U) +Cheat0="Home Team\Infinite Time Outs",811344D0 0700 +Cheat1="Home Team\No Time Outs",811344D0 0000 +Cheat2="Away Team\Infinite Time Outs",81135098 0700 +Cheat3="Away Team\No Time Outs",81135098 0000 +Cheat4="Infinite Shot Clock",811318F2 05A0 +Cheat5="Max Inside Scoring",8017B7AC 0064 +Cheat6="Jump Shooting",8017B7AD 0064 +Cheat7="Max\3 Pointers",8017B7AE 0064 +Cheat8="Max\Free Throws",8017B7AF 0064 +Cheat9="Max\Dunking",8017B7B0 0064 +Cheat10="Max\Stealing",8017B7B1 0064 +Cheat11="Max\Blocking",8017B7B2 0064 +Cheat12="Max\Off. Awareness",8017B7BA 0064 +Cheat13="Max\Def. Awareness",8017B7B3 0064 +Cheat14="Max\Quickness",8017B7B4 0064 +Cheat15="Max\Off. Rebounds",8017B7B5 0064 +Cheat16="Max\Def. Rebounds",8017B7B6 0064 +Cheat17="Max\Jumping",8017B7B7 0064 +Cheat18="Max\Strength",8017B7B8 0064 +Cheat19="Max\Passing",8017B7B9 0064 +Cheat20="Max\Speed",8017B7BB 0064 +Cheat21="Max\Dribbling",8017B7BC 0064 +Cheat22="Max\Endurance",8017B7BD 0064 +Cheat23="Max\Shooting Range",8017B7BE 0064 + +//---- + +[6DFDCDC3-4DE701C8-C:45] +Name==NHL Breakaway 98 (U) +Cheat0="Activate Cheat Menu",80053F38 0001 +Cheat1="Home Team Goals",8012BBBC 00?? +Cheat1_O=$00 No Score,$FF Max Score +Cheat2="Away Team Goals",8012BBBD 00?? +Cheat2_O=$00 No Score,$FF Max Score + +//---- + +[82EFDC30-806A2461-C:45] +Name=NHL Blades Of Steel '99 (U) +Cheat3="Home Team Scores 50",801F6406 0032,802004BF 0032 +Cheat1="Away Team Scores 50",801F6407 0032,802004C0 0032 + +//---- + +[36FA35EB-E85E2E36-C:45] +Name=NFL Blitz 2001 (U) +Cheat0="Fire Team 1\Player 1",800EC0CB 00?? +Cheat0_O=$01 Always On,$00 Never On +Cheat1="Always On Fire Team 2\Player 2",800EC0CF 00?? +Cheat1_O=$01 Always On,$00 Never On +Cheat2="Infinite Turbo\Player 1",810EC12C 42C8,810EC12E 0000 +Cheat3="Infinite Turbo\Player 2",81DEC164 42C8,81DEC166 0000 + +//---- + +[E3AB4ED0-83040DD2-C:45] +Name=NFL Quarterback Club 2000 (U) +Cheat0="Max Clu",80075275 0063 +Cheat1="Max End",8007527D 0063 +Cheat2="Max Hnd",80075279 0063 +Cheat3="Max Rcg",80075273 0063 +Cheat4="Max Rng",8007526F 0063 +Cheat5="Max Scr",80075271 0063 +Cheat6="Max Spd",80075277 0063 +Cheat7="Home Team\No Time Outs",80054956 0000 +Cheat8="Away Team\No Time Outs Away",80054ED6 0000 +Cheat9="Infinite Creation Points",8107B36E 03E7 +Cheat10="Home Team\Infinite Time Outs",80054956 0003 +Cheat11="Away Team\Infinite Time Outs",80054ED6 0003 +Cheat12="Infinite Time To Choose Play",81081448 2800 +Cheat13="Max Acc",8007526D 0064 +Cheat14="Max Cat",8007527B 0063 + +//---- + +[28784622-FFB22985-C:45] +Name=NFL Quarterback Club 2001 (U) +Cheat0="Infinite Player Creation Pts",8107A0F2 00C8 +Cheat1="Always 1st Down",800785D2 0001 +Cheat2="1 Down Per Possession",800785D2 0004 + +//---- + +[BE76EDFF-20452D09-C:45] +Name=NFL Quarterback Club 99 (U) +Cheat0="Home Team\Infinite Time Outs",8004C0B6 0003 +Cheat1="Home Team\No Time Outs",8004C0B6 0000 +Cheat2="Away Team\Infinite Time Outs",8004C62E 0003 +Cheat3="Away Team\No Time Outs",8004C62E 0000 +Cheat4="Infinite\Time to Choose Play",81080152 0028 +Cheat5="Infinite\Character Creation Points",81072F30 015E +Cheat6="Max\Accuracy",8106FDB8 0064 +Cheat7="Max\Range",8106FDBA 0064 +Cheat8="Max\Scramble",8106FDBC 0064 +Cheat9="Max\Hands",8106FDBE 0064 +Cheat10="Max\Speed",8106FDC0 0064 +Cheat11="Max\Catch",8106FDC2 0064 +Cheat12="Max\Endurance",8106FDC4 0064 + +//---- + +[E3AB4ED0-83040DD2-C:45] +Name=NFL Quarterback Club 2000 (U) +Cheat0="Home Team\Infinite Time Outs",80054956 0003 +Cheat1="Home Team\No Time Outs",80054956 0000 +Cheat2="Away Team\Infinite Time Outs",80054ED6 0003 +Cheat3="Away Team\No Time Outs",80054ED6 0000 +Cheat4="Infinite\Time To Choose Play",81081448 2800 +Cheat5="Max\Acc",8007526D 0064 +Cheat6="Max\Cat",8007527B 0063 +Cheat7="Max\Clu",80075275 0063 +Cheat8="Max\End",8007527D 0063 +Cheat9="Max\Hnd",80075279 0063 +Cheat10="Max\Rcg",80075273 0063 +Cheat11="Max\Rng",8007526F 0063 +Cheat12="Max\Scr",80075271 0063 +Cheat13="Max\Spd",80075277 0063 +Cheat14="Infinite\Creation Points",8107B36E 03E7 + +//---- + +[2153143F-992D6351-C:45] +Name=New Tetris, The (U) +Cheat0="Press L + C-Down For Cheat Screen",D01101B3 0024,8103BFE0 0000,D01101B3 0024,8103BFE2 0000 + +//---- + +[2857674D-CC4337DA-C:45] +Name=Nightmare Creatures (U) +Cheat0="Infinite\Ammo",50000D02 0000,800A4BAF 0009 +Cheat1="Infinite\Spider Cards",810A4BAE 0009 +Cheat2="Infinite\Proximity Mines",810A4BB0 0009 +Cheat3="Infinite\Repulsive Smoke",810A4BB2 0009 +Cheat4="Infinite\Freeze Spell",810A4BB4 0009 +Cheat5="Infinite\Dynamite",810A4BB6 0009 +Cheat6="Infinite\Flash",810A4BB8 0009 +Cheat7="Infinite\Fire Bombs",810A4BBA 0009 +Cheat8="Infinite\Multi-Gun",810A4BBC 0009 +Cheat9="Infinite\Berzerkers",810A4BBE 0009 +Cheat10="Infinite\Super Healing",810A4BC0 0009 +Cheat11="Infinite\Healing",810A4BC2 0009 +Cheat12="Infinite\Chaos",810A4BC4 0009 +Cheat13="Infinite\Gun",810A4BC6 0009 +Cheat14="Infinite\Lives",800A4B53 0009 +Cheat16="Brightness Modifier",810B96EC ???? +Cheat16_O=$7FFF Very Well Lit Up,$8000 Very Dark +Cheat17="Ignatius\Infinite Health\Chelsea Level",802EC6E6 0010 +Cheat18="Ignatius\Infinite Health\Spitafields Level",803215FE 0010 +Cheat19="Ignatius\Infinite Health\Thames Tunnel Level",8031AB6E 0010 +Cheat20="Ignatius\Infinite Health\Sewer Snake Level",80255E46 0010 +Cheat21="Ignatius\Infinite Health\India Docks Level",80321546 0010 +Cheat22="Ignatius\Infinite Health\Highgate Cemetery Level",8031B2E6 0010 +Cheat23="Ignatius\Infinite Health\Hampstead Heath Level",803218B6 0010 +Cheat24="Ignatius\Infinite Health\Queenhite Docks Level",80320C1E 0010 +Cheat25="Ignatius\Infinite Health\City Level",80328256 0010 +Cheat26="Ignatius\Infinite Health\Smithfield Level",8030B05E 0010 +Cheat27="Ignatius\Infinite Health\Snowman Level",80251496 0010 +Cheat28="Ignatius\Infinite Health\Regent's Level",80315326 0010 +Cheat29="Ignatius\Infinite Health\London Zoo Level",8031E00E 0010 +Cheat30="Ignatius\Infinite Health\St. Marilebone Level",8031CD4E 0010 +Cheat31="Ignatius\Infinite Health\Bloomsbury Level",8032C4F6 0010 +Cheat32="Ignatius\Infinite Health\Pimlico Level",8031F9CE 0010 +Cheat33="Ignatius\Infinite Health\Jose Manuel Level",8025F196 0010 +Cheat34="Ignatius\Infinite Health\Westminister Level",802F4ECE 0010 +Cheat35="Ignatius\Infinite Health\Westminister II Level",802F5DE6 0010 +Cheat36="Ignatius\Infinite Health\The Roofs Level",802848FE 0010 +Cheat37="Nadia\Infinite Health\Chelsea Level",802EB6D6 000C +Cheat38="Nadia\Infinite Health\Spitafield Level",80320116 000C +Cheat39="Nadia\Infinite Health\Thames Tunnel Level",80319AC6 000C +Cheat40="Nadia\Infinite Health\Sewer Snake Level",80254926 000C +Cheat41="Nadia\Infinite Health\India Docks Level",803202CE 000C +Cheat42="Nadia\Infinite Health\Highgate Cemetary Level",8031A58E 000C +Cheat43="Nadia\Infinite Health\Hampstead Heath Level",803203D6 000C +Cheat44="Nadia\Infinite Health\Queenhite Dock's Level",8031FB7E 000C +Cheat45="Nadia\Infinite Health\City Level",80326A36 000C +Cheat46="Nadia\Infinite Health\Smithfield Level",8030A0CE 000C +Cheat47="Nadia\Infinite Health\Snowman Level",80250036 000C +Cheat48="Nadia\Infinite Health\Regent's Canal Level",80313E36 000C +Cheat49="Nadia\Infinite Health\London Zoo Level",8031CB66 000C +Cheat50="Nadia\Infinite Health\St. Marilebone Level",8031B686 000C +Cheat51="Nadia\Infinite Health\Bloomsbury Level",8032B256 000C +Cheat52="Nadia\Infinite Health\Pimlico Level",8031E4B6 000C +Cheat53="Nadia\Infinite Health\Jose Manuel Level",8025DA0E 000C +Cheat54="Nadia\Infinite Health\Westminister Level",802F360E 000C +Cheat55="Nadia\Infinite Health\Westminister II Level",802F4C76 000C +Cheat56="Nadia\Infinite Health\The Roofs Level",80282DB6 000C +Cheat17_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat18_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat19_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat20_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat21_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat22_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat23_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat24_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat25_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat26_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat27_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat28_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat29_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat30_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat31_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat32_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat33_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat34_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat35_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat36_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat37_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat38_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat39_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat40_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat41_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat42_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat43_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat44_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat45_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat46_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat47_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat48_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat49_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat50_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat51_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat52_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat53_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat54_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat55_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat56_N=Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. +Cheat15="Level Select",D00978B1 0000,810978B0 00?? +Cheat15_O=$00 Chelsea,$01 Spitafields,$02 Thames Tunnel,$03 Sewer Snake,$04 India Docks,$05 Highgate Cemetery,$06 Hampstead Heath,$07 Queenhite Docks,$08 City,$09 Smithfield,$0A Snowman,$0B Regent's,$0C London Zoo,$0D St. Marilebone,$0E Bloomsbury,$0F Pimlico,$10 Jose Manuel,$11 Westminister,$12 Westminister II,$13 The Roofs,$14 Map + +//---- + +[4998DDBB-F7B7AEBC-C:45] +Name=Nuclear Strike 64 (U) +Cheat0="Infinite\Lives",800A5DF0 0009 +Cheat1="Play Mission\1",800A5DF1 0000 +Cheat2="Play Mission\2",800A5DF1 0001 +Cheat3="Play Mission\3",800A5DF1 0002 +Cheat4="Play Mission\4",800A5DF1 0003 +Cheat5="Play Mission\5",800A5DF1 0004 +Cheat6="Play Mission\6",800A5DF1 0005 +Cheat7="Invulnerability",800A9730 0001 +Cheat8="Infinite\Lives",800A5DF0 0009 +Cheat9="Infinite\Ammo",800A9731 0001 +Cheat10="Infinite\Attempts",800A9732 0001 +Cheat11="Infinite\Fuel",800A9733 0001 +Cheat12="Infinite\Chaingun",800A9737 0001 +Cheat13="Infinite\Rockets",800A9738 0001 +Cheat14="Infinite\Missiles",800A9739 0001 +Cheat15="Infinite\Wingtips",800A973A 0001 +Cheat16="Wingtips Do Double Damage",800A973B 0001 +Cheat17="Stealth Mode",800A9734 0001 +Cheat18="Double MPG",800A9735 0001 +Cheat19="Quad Damage",800A9736 0001 +Cheat20="Max Armor Increased 50%",800A973C 0001 +Cheat21="Agility",800A973D 0001 +Cheat22="Overhead View",800A973E 0001 +Cheat23="Level Skip",800A973F 0001 +Cheat24="Debug Menu",800A9740 0001 +Cheat25="Auto Win Scenario",800A9741 0001 + +//---- + +[2655BB70-667D9925-C:45] +Name=O.D.T (Or Die Trying) (U) (M3) (Unreleased Final) +Cheat0="Play As Select",800FCD45 00?? +Cheat0_O=$00 Ike Hawkings (Corporal),$01 Sophia Hawkings (Stowaway),$02 Julia Chase (Cartographer),$03 Karma (The Ex-Deviant),$04 Max Havok (Chief Enginer),$05 Solaar (Archbishop),$06 Mr Bodybolt (7th Passenger) +Cheat1="Infinite Max\999 Lives",810C8B78 03E8 +Cheat2="Infinite Max\Health",800C8959 0066 +Cheat3="Infinite Max\Light Ammo",800C8B2B 0066 +Cheat4="Infinite Max\Fire Ammo",800C8B33 0066 +Cheat5="Infinite Max\Ionic Ammo",800C8B3B 0066 +Cheat6="Infinite Max\Fusion Ammo",800C8B43 0066 +Cheat7="Infinite Max\Mana",800C8B7F 0066 +Cheat8="Have\All Magic",800CE9C8 0010,800CE9CD 0000,800CE9D7 0001,800CE9E1 0002,800CE9EB 0003,800CE9F5 0005,800CE9FF 0006,800CEA09 0008,800CEA13 0009,800CEA1D 000B,800CEA27 000E,800CEA31 000F,800CEA3B 0010,800CEA45 0011,800CEA4F 000A,800CEA59 000C,800CEA63 000D +Cheat9="Have\Magic On Level 4",810C8B5D FFFF,810C8B5E FFFF,810C8B5F FFFF,810C8B60 FFFF,810C8B61 FFFF,810C8B62 FFFF +Cheat10="Have\Weapons On Max Upgrade",50000408 0000,800C8B2C 0009 +Cheat11="Have\Max Armour Level",800C8B80 0064 +Cheat12="Have\Max Spirit Level",800C8B84 0064 +Cheat13="Have\Max Weapon Level",800C8B82 0064 +Cheat14="Have\Max Experience Level",800C8B7C 00FF +Cheat15="Infinite Air Under Water",800C8A64 0069 +Cheat16="Press A For Bionic Jump",D00C8A4A 0080,810C8968 ???? +Cheat16_O=$0250 Medium Jump,$0800 Max Jump +Cheat17="Matts",D00C8A4A 0080,810C8963 0100 +Cheat16_N=This will make you jump to a great height + +//---- + +[319093EC-0FC209EF-C:45] +Name=Off Road Challenge (U) +Cheat0="1 Player\Always Place 1st",80103C57 0000 +Cheat1="Multi and 1 Player\Infinite Gent Turbos\Player 1",81103EBA 02F4 +Cheat2="1 Player\Max\Acceleration",8012C49F 000A +Cheat3="1 Player\Max\Shocks",8012C4A7 000A +Cheat4="1 Player\Max\Speed",8012C4A3 000A +Cheat5="1 Player\Max\Tires",8012C4AB 000A +Cheat6="Multi and 1 Player\Max Crash Helmets\Player 1",80103EB3 0064 +Cheat7="Multi and 1 Player\Infinite Gent Turbos\Player 2",811041AE 02F4 +Cheat8="Multi and 1 Player\Max Crash Helmets\Player 2",801041A7 0064 +Cheat1_N=Can be used in 1 Player and Multiplayer Modes for Player 1 +Cheat6_N=Can be used in 1 Player and Multiplayer Modes for Player 1 +Cheat7_N=Multiplayer Mode Only for Player 2 +Cheat8_N=Multiplayer Mode Only for Player 2 + +//---- + +[E6419BC5-69011DE3-C:45] +Name=Ogre Battle 64 - Person of Lordly Caliber (U) +Cheat0="Infinite Goth",81196A6E FFFF +Cheat1="Max Goth",81196A6C 0098,81196A6E 967F +Cheat2="Open All Paths",81196A80 01FF,81196A82 677F,81196A84 FCFF +Cheat3="Finish All Levels",81196A86 5454,81196A88 5140,81196A8A 4555,81196A8C 9514,81196A8E 5515 +Cheat4="Always Have Retreat & Elem Pedra Opened",D01A1C72 0000,811A1C72 0003 +Cheat5="Hour Always 00",81196A2C 0000 +Cheat6="Day Always 00",811F106C 0000 +Cheat7="Magnus\Level 99",80193C0B 0063 +Cheat8="Magnus\Max HP",81193C0E 03E7 +Cheat9="Magnus\Infinite HP",81193C10 03E7 +Cheat10="Magnus\Max Str",81193C14 03E7 +Cheat11="Magnus\Max Vit",81193C16 03E7 +Cheat12="Magnus\Max Int",81193C18 03E7 +Cheat13="Magnus\Max Mem",81193C1A 03E7 +Cheat14="Magnus\Max Agi",81193C1C 03E7 +Cheat15="Magnus\Max Dex",81193C1E 03E7 + +//---- + +[3E198D9E-F2E1267E-C:45] +Name=Paperboy (U) +Cheat0="Enable Level Select",8006A5F7 0001 +Cheat0_N=Also accesses All Bonus Levels +Cheat1="Invincibility",812688FE 0001 +Cheat2="Infinite Newspapers",81268B12 0001 +Cheat3="Big Newspapers",81268B5A 0001 +Cheat4="Turbo Mode",81268B36 0001 +Cheat5="Super Jump Springs",81268B3A 0001 +Cheat6="Rocket Boosters",81268B3E 0001 +Cheat7="99 Total Houses",8106A56A 0063 +Cheat8="Infinite Health",8006A5D2 0064 + +//---- + +[65EEE53A-ED7D733C-C:45] +Name=Paper Mario (U) +Cheat0="Lots Of Coins",8110F29C 03E7 +Cheat1="Infinite\HP",8010F292 0063,8010F293 0063 +Cheat2="Infinite\FP",8010F295 0063,8010F296 0063 +Cheat3="Have All Spirits",8010F51E 0007 +Cheat4="Max\Level",8010F299 0063 +Cheat5="Max\Star Points",8010F2A0 0063 +Cheat6="Max\Badge Points",8010F298 00?? +Cheat6_O=$3C 60 Badge Points,$7F 127 Badge Points +Cheat7="Max\Star Pieces",8010F29F 0063 +Cheat8="Have member\Goomario",8010F2AC 0001 +Cheat9="Have member\Kooper",8010F2B4 0001 +Cheat10="Have member\Bombette",8010F2BC 0001 +Cheat11="Have member\Parrakary",8010F2C4 0001 +Cheat12="Have member\Watt",8010F2D4 0001 +Cheat13="Have member\Sushie",8010F2DC 0001 +Cheat14="Have member\Lakitu",8010F2E4 0001 +Cheat15="Have member\Bow",8010F2EC 0001 +Cheat16="Upgrade member\Level 1\Goomario",8010F2AD 0001 +Cheat16_N=Do not use with level 2 upgrade cheats +Cheat17="Upgrade member\Level 1\Kooper",8010F2B5 0001 +Cheat17_N=Do not use with level 2 upgrade cheats +Cheat18="Upgrade member\Level 1\Bombette",8010F2BD 0001 +Cheat18_N=Do not use with level 2 upgrade cheats +Cheat19="Upgrade member\Level 1\Parrakary",8010F2C5 0001 +Cheat19_N=Do not use with level 2 upgrade cheats +Cheat20="Upgrade member\Level 1\Watt",8010F2D5 0001 +Cheat20_N=Do not use with level 2 upgrade cheats +Cheat21="Upgrade member\Level 1\Sushie",8010F2DD 0001 +Cheat21_N=Do not use with level 2 upgrade cheats +Cheat22="Upgrade member\Level 1\Lakitu",8010F2E5 0001 +Cheat22_N=Do not use with level 2 upgrade cheats +Cheat23="Upgrade member\Level 1\Bow",8010F2ED 0001 +Cheat23_N=Do not use with level 2 upgrade cheats +Cheat24="Upgrade member\Level 2\Goomario",8010F2AD 0002 +Cheat24_N=Do not use with level 1 upgrade cheats +Cheat25="Upgrade member\Level 2\Kooper",8010F2B5 0002 +Cheat25_N=Do not use with level 1 upgrade cheats +Cheat26="Upgrade member\Level 2\Bombette",8010F2BD 0002 +Cheat26_N=Do not use with level 1 upgrade cheats +Cheat27="Upgrade member\Level 2\Parrakary",8010F2C5 0002 +Cheat27_N=Do not use with level 1 upgrade cheats +Cheat28="Upgrade member\Level 2\Watt",8010F2D5 0002 +Cheat28_N=Do not use with level 1 upgrade cheats +Cheat29="Upgrade member\Level 2\Sushie",8010F2DD 0002 +Cheat29_N=Do not use with level 1 upgrade cheats +Cheat30="Upgrade member\Level 2\Lakitu",8010F2E5 0002 +Cheat30_N=Do not use with level 1 upgrade cheats +Cheat31="Upgrade member\Level 2\Bow",8010F2ED 0002 +Cheat31_N=Do not use with level 1 upgrade cheats +Cheat32="Have hammer\Level 1",8010F291 0000 +Cheat32_N=Do not use with other level hammer cheats +Cheat33="Have hammer\Level 2",8010F291 0001 +Cheat33_N=Do not use with other level hammer cheats +Cheat34="Have hammer\Level 3",8010F291 0002 +Cheat34_N=Do not use with other level hammer cheats +Cheat35="Have jump boots\Level 1",8010F290 0000 +Cheat35_N=Do not use with other level jump boots cheats +Cheat36="Have jump boots\Level 2",8010F290 0001 +Cheat36_N=Do not use with other level jump boots cheats +Cheat37="Have jump boots\Level 3",8010F290 0002 +Cheat37_N=Do not use with other level jump boots cheats +Cheat38="No Star Points (0)",8010F2A0 0000 +Cheat38_N=If emulator hangs at level up, enable this cheat and don't disable it whatsoever! +Cheat39="Infinite\Star Power",8010F520 0007,8010F521 0007 +Cheat40="Have\Attack item",8110F444 ???? +Cheat40_O=$0800 Fire Flower,$0081 Snowman Doll,$0082 Thunder Rage,$0083 Shooting Star,$0084 Thunder Bolt,$0085 Pebble,$0086 Dusty Hammer +Cheat40_N=Only use One Have item Option at one time. +Cheat41="Have\Defense item",8110F444 ???? +Cheat41_O=$0088 Stone Cap,$008A Mushroom,$008B Volt Shroom,$0097 Repel Gel +Cheat41_N=Only use One Have item Option at one time. +Cheat42="Have\Enemy Stats item",8110F444 ???? +Cheat42_O=$008F Sleep Sheep,$0090 POW Block,$0092 Stop Watch,$0098 Fright Jar,$009A Dizzy Dial +Cheat42_N=Only use One Have item Option at one time. +Cheat43="Have\Recovery Items Option 1",8110F444 ???? +Cheat43_O=$0094 Apple,$00B1 Apple Pie,$00C0 Big Cookie,$00BD Bland Meal,$009E Blue Berry,$00D8 Boiled Egg,$00A1 Bubble Berry,$00AA Cake Mix,$00AA Cake Mix,$00CF Coco Pop,$00BE Deluxe Feast,$00A8 Dried Fruit,$00A7 Dried Pasta,$008D Dried Shroom,$005F Egg,$00CC Electro Pop,$00CD Fire Pop,$00C9 Fried Egg,$00B6 Fried Shroom,$00D4 Frozen Fries,$00A5 Goomnut,$00BC Healthy Juice,$00CB Honey Candy,$00CA Honey Shroom,$00C4 Honey Super +Cheat43_N=Only use One Have item Option at one time. +Cheat44="Have\Recovery Items Option 2",8110F444 ???? +Cheat44_O=$00A4 Honey Syrup,$00B2 Honey Ultra,$00B9 Hot Shroom,$00AF Iced Potato,$00A2 Jammin' Jelly,$00D1 Jelly Pop,$00DA Jelly Shroom,$00C6 Jelly Super,$00B4 Jelly Ultra,$00D3 Kooky Cookie,$00A6 Koopa Leaf,$00C3 Koopa Tea,$00B5 KooPasta,$009C Lemon,$00D0 Lemon Candy,$0095 Life Shroom,$009D Lime,$0C0E Lime Candy,$00D7 Maple Shroom,$00C5 Maple Super,$00A3 Maple Syrup,$00B3 Maple Ultra,$00AD Melon,$00C2 Mistake,$008A Mushroom +Cheat44_N=Only use One Have item Option at one time. +Cheat45="Have\Recovery Items Option 3",8110F444 ???? +Cheat45_O=$00D6 Nutty Cake,$00D5 Potato Salad,$009F Red Berry,$00B7 Shroom Cake,$00B8 Shroom Steak,$00C7 Spaghetti,$00BF Special Shake,$00B0 Spicy Soup,$00AE Stinky Herb,$00A9 Strange Leaf,$008C Super Shroom,$009B Super Soda,$00BA Sweet Shroom,$0089 Tasty Tonic,$008E Ultra Shroom,$0093 Whacka's Bump,$00A0 Yellow Berry,$00D9 Yoshi Cookie,$00BB Yummy Meal, +Cheat45_N=Only use One Have item Option at one time. +Cheat46="Have\Special Items Options 1",8110F444 ???? +Cheat46_O=$0101 Jump,$010E Diploma,$010F Ultra Stone,$0110 Fortress Key,$0115 Lunar Stone,$0118 Golden Jar,$0119 Kooper's Shell,$0122 Record,$0125 Mystery Note,$012A Jade Raven,$012C Magical Seed Purple,$012D Magical Seed Blue,$0131 Bucket,$0150 Letter,$0156 Dolly,$0157 Water Stone,$0158 Magical Bean,$0159 Fertile Soil,$015A Miracle Water,$015B Volcano Vase,$0053 Artifact,$0067 Lyrics,$001D Boo's Portrait +Cheat46_N=Only use One Have item Option at one time +Cheat47="Have\Special Items Option 1",8110F444 ???? +Cheat47_O=$0030 Calculator,$0029 Cook Book,$001E Crystal Berry,$0017 Diamond Stone,$0024 Dictonary,$000E Diploma,$0032 Scarf,$000A First Degree Card,$000B Second Degree Card,$000C Third Degree Card,$000D Fourth Degree Card,$0023 Frying Pan,$0004 Hammer,$002A Jade Raven,$0019 Kooper's Shell,Lunar Stone,$0058 Magical Bean,$002B Magical Seed Red,$002D Magical Seed Green,$002E Magical Seed Brown-Orange,$0069 Mailbag,$0031 Bucket,$0021 Toy Train,$0068 Melody,$006C Star Stone,$005B Volcano Vase +Cheat47_N=Only use One Have item Option at one time. + +//---- + +[73ABB1FB-9CCA6093-C:45] +Name=Penny Racers (U) +Cheat0="Super Speed",8122AEB8 4800 +Cheat0_N=This is Turbo fast,So to slow it down a little more keep the B button pressed down +Cheat1="Always 1st",8022AD06 0001 +Cheat2="Class Select",8021E1A7 00?? +Cheat2_O=$00 Class C,$01 Class B,$03 Class AA,$04 1 Play,$05 2 Play,$06 3 Play,$07 4 Play +Cheat2_N=This code is useful because you can play Class AA without having to beat a level! + +//---- + +[DDF460CC-3CA634C0-C:45] +Name=Perfect Dark (U) (v1.0) +Cheat0="Have All\Weapons\Player 1",80207F10 0007,801EEF10 0007,801D5F10 0007 +Cheat1="Infinite\Ammo\Player 1",8020769F 00FF,801EE69F 00FF,801D569F 00FF,80206EFB 00FF,801EDEFB 00FF,801D4EFB 00FF +Cheat2="Infinite\Health\Player 1",8120677C 3F80,811ED77C 3F80,811D477C 3F80 +Cheat3="Infinite\Shield\Player 1",81206790 3F80,811E4950 3F80,811CB950 3F80 +Cheat4="Have All\Weapons\Player 2",80209B80 0007,801F0B80 0007,801D7B80 0007 +Cheat5="Infinite\Ammo\Player 2",8020930F 00FF,801F030F 00FF,801D730F 00FF,80208B6B 00FF,801EFB6B 00FF,801D6B6B 00FF +Cheat6="Infinite\Health\Player 2",812083EC 3F80,811EF3EC 3F80,811D63EC 3F80 +Cheat7="Infinite\Shield\Player 2",811FF5C0 3F80,811E65C0 3F80,811CD5C0 3F80 +Cheat8="The Ultimate All In One",800884F3 0001,8008850E 0001,80088575 0001,50000302 0000,80088572 0001,8008858C 0001,8008858D 0001,800885A6 0001,800885A9 0001,800885C0 0001,800885DA 0001,800885DC 0001,800885F4 0001,800885F5 0001,8008860E 0001,80088610 0001,80088612 0001,80088628 0001,50000501 0000,80088642 0001,50000501 0000,8008865C 0001,50000501 0000,80088676 0001,50000501 0000,80088690 0001,50000501 0000,800886AA 0001,50000501 0000,800886C4 0001,50000501 0000,800886DE 0001,50000501 0000,800886F8 0001,50000501 0000,80088712 0001,50000501 0000,8008872C 0001,50000501 0000,80088746 0001,50000501 0000,80088760 0001,50000501 0000,8008877A 0001,50000501 0000,80088794 0001,50000501 0000,800887AE 0001,800A2219 0001,50003E02 0000,800A221D 0001,50000B01 0000,800ACCC9 0001,50000901 0000,800ACCD5 0001,50000401 0000,800ACCDF 0001,50000301 0000,800ACCE4 0001,800ACCE8 0001,800ACCE9 0001,800ACCEB 0001,800ACCEC 0001,50000901 0000,800ACCEE 0001,800ACCF8 0001,50002101 0000,800ACCFA 0001,800ACD12 0001,800ACD15 0001,800ACD16 0001,800ACDEA 0001,800ACD3A 0001 +Cheat9="Carrington Institute\Have 999 points in Firing Range",810B1E32 03E7 +Cheat10="Carrington Institute\Have Infinite time in Firing Range",810B1E2E 004D +Cheat11="Carrington Institute\Have 255 targets destroyed",810B1E34 00FF +Cheat12="All levels Compleate",50004002 0000,810A2218 0001 +Cheat0_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat1_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat2_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat3_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat4_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat5_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat6_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat7_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat8_N=The Ultimate All In One activate's solo missions, give all medals on solo missions, activate cheats, activate cinemas, and who knows what else. I just don't have the time to identify these codes. I know that some of this is creditted to Zap2. I don't have the time to cut those codes out. +Cheat13="Single & Co-Op\Press B To Levitate\Player 1",D009C7E4 0040,81206720 40F2,D009C7E4 0040,802066D3 0000,D009C7E4 0040,811ED720 40F2,D009C7E4 0040,801ED6D3 0000,D009C7E4 0040,811D4720 40F2,D009C7E4 0040,801D46D3 0000 +Cheat13_N=To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something +Cheat14="Single & Co-Op\Press B To Levitate\Player 2",D009C7EC 0040,81208390 40F2,D009C7EC 0040,80208343 0000,D009C7EC 0040,811EF390 40F2,D009C7EC 0040,801EF343 0000,D009C7EC 0040,811D6390 40F2,D009C7EC 0040,801D6343 0000 +Cheat14_N=To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something +Cheat15="Multi\Press B To Levitate\Player 1",D009C7E4 0040,811BB720 40F2,D009C7E4 0040,801BB6D3 0000 +Cheat15_N=To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something +Cheat16="Multi\Press B To Levitate\Player 2",D009C7EC 0040,811BD390 40F2,D009C7EC 0040,801BD343 0000 +Cheat16_N=To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something +Cheat17="Multi\Press B To Levitate\Player 3",D009C7F4 0040,811BF000 40F2,D009C7F4 0040,801BEFB3 0000 +Cheat17_N=To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something +Cheat18="Multi\Press B To Levitate\Player 4",D009C7FC 0040,811C0C70 40F2,D009C7FC 0040,801C0C23 0000 +Cheat18_N=To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something + +//---- + +[41F2B98F-B458B466-C:45] +Name=Perfect Dark (U) (v1.1) +Cheat0="Have All\Weapons\Player 1",80207F10 0007,801EEF10 0007,801D5F10 0007 +Cheat1="Infinite\Ammo\Player 1",8020769F 00FF,801EE69F 00FF,801D569F 00FF,80206EFB 00FF,801EDEFB 00FF,801D4EFB 00FF +Cheat2="Infinite\Health\Player 1",8120677C 3F80,811ED77C 3F80,811D477C 3F80 +Cheat3="Infinite\Shield\Player 1",81206790 3F80,811E4950 3F80,811CB950 3F80 +Cheat4="Have All\Weapons\Player 2",80209B80 0007,801F0B80 0007,801D7B80 0007 +Cheat5="Infinite\Ammo\Player 2",8020930F 00FF,801F030F 00FF,801D730F 00FF,80208B6B 00FF,801EFB6B 00FF,801D6B6B 00FF +Cheat6="Infinite\Health\Player 2",812083EC 3F80,811EF3EC 3F80,811D63EC 3F80 +Cheat7="Infinite\Shield\Player 2",811FF5C0 3F80,811E65C0 3F80,811CD5C0 3F80 +Cheat8="The Ultimate All In One",800884F3 0001,8008850E 0001,80088575 0001,50000302 0000,80088572 0001,8008858C 0001,8008858D 0001,800885A6 0001,800885A9 0001,800885C0 0001,800885DA 0001,800885DC 0001,800885F4 0001,800885F5 0001,8008860E 0001,80088610 0001,80088612 0001,80088628 0001,50000501 0000,80088642 0001,50000501 0000,8008865C 0001,50000501 0000,80088676 0001,50000501 0000,80088690 0001,50000501 0000,800886AA 0001,50000501 0000,800886C4 0001,50000501 0000,800886DE 0001,50000501 0000,800886F8 0001,50000501 0000,80088712 0001,50000501 0000,8008872C 0001,50000501 0000,80088746 0001,50000501 0000,80088760 0001,50000501 0000,8008877A 0001,50000501 0000,80088794 0001,50000501 0000,800887AE 0001,800A2219 0001,50003E02 0000,800A221D 0001,50000B01 0000,800ACCC9 0001,50000901 0000,800ACCD5 0001,50000401 0000,800ACCDF 0001,50000301 0000,800ACCE4 0001,800ACCE8 0001,800ACCE9 0001,800ACCEB 0001,800ACCEC 0001,50000901 0000,800ACCEE 0001,800ACCF8 0001,50002101 0000,800ACCFA 0001,800ACD12 0001,800ACD15 0001,800ACD16 0001,800ACDEA 0001,800ACD3A 0001 +Cheat9="Carrington Institute\Have 999 points in Firing Range",810B1E32 03E7 +Cheat10="Carrington Institute\Have Infinite time in Firing Range",810B1E2E 004D +Cheat11="Carrington Institute\Have 255 targets destroyed",810B1E34 00FF +Cheat0_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat1_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat2_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat3_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat4_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat5_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat6_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat7_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat8_N=The Ultimate All In One activate's solo missions, give all medals on solo missions, activate cheats, activate cinemas, and who knows what else. I just don't have the time to identify these codes. I know that some of this is creditted to Zap2. I don't have the time to cut those codes out. +Cheat12="Single & Co-Op\Press B To Levitate\Player 1",D009C7E4 0040,81206720 40F2,D009C7E4 0040,802066D3 0000,D009C7E4 0040,811ED720 40F2,D009C7E4 0040,801ED6D3 0000,D009C7E4 0040,811D4720 40F2,D009C7E4 0040,801D46D3 0000 +Cheat12_N=To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something +Cheat13="Single & Co-Op\Press B To Levitate\Player 2",D009C7EC 0040,81208390 40F2,D009C7EC 0040,80208343 0000,D009C7EC 0040,811EF390 40F2,D009C7EC 0040,801EF343 0000,D009C7EC 0040,811D6390 40F2,D009C7EC 0040,801D6343 0000 +Cheat13_N=To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something +Cheat14="Multi\Press B To Levitate\Player 1",D009C7E4 0040,811BB720 40F2,D009C7E4 0040,801BB6D3 0000 +Cheat14_N=To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something +Cheat15="Multi\Press B To Levitate\Player 2",D009C7EC 0040,811BD390 40F2,D009C7EC 0040,801BD343 0000 +Cheat15_N=To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something +Cheat16="Multi\Press B To Levitate\Player 3",D009C7F4 0040,811BF000 40F2,D009C7F4 0040,801BEFB3 0000 +Cheat16_N=To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something +Cheat17="Multi\Press B To Levitate\Player 4",D009C7FC 0040,811C0C70 40F2,D009C7FC 0040,801C0C23 0000 +Cheat17_N=To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something + +//---- + +[B54CE881-BCCB6126-C:45] +Name=PGA European Tour (U) +Cheat0="Hole In One\Hole 01",800FF713 0000 +Cheat1="Hole In One\Hole 02",800FF715 0000 +Cheat2="Hole In One\Hole 03",800FF717 0000 +Cheat3="Hole In One\Hole 04",800FF719 0000 +Cheat4="Hole In One\Hole 05",800FF71B 0000 +Cheat5="Hole In One\Hole 06",800FF71D 0000 +Cheat6="Hole In One\Hole 07",800FF71F 0000 +Cheat7="Hole In One\Hole 08",800FF721 0000 +Cheat8="Hole In One\Hole 09",800FF723 0000 +Cheat9="Hole In One\Hole 10",800FF725 0000 +Cheat10="Hole In One\Hole 11",800FF727 0000 +Cheat11="Hole In One\Hole 12",800FF729 0000 +Cheat12="Hole In One\Hole 13",800FF72B 0000 +Cheat13="Hole In One\Hole 14",800FF72D 0000 +Cheat14="Hole In One\Hole 15",800FF72F 0000 +Cheat15="Hole In One\Hole 16",800FF731 0000 +Cheat16="Hole In One\Hole 17",800FF733 0000 +Cheat17="Hole In One\Hole 18",800FF735 0000 + +//---- + +[C851961C-78FCAAFA-C:45] +Name=Pilot Wings64 (U) +Cheat0="Infinite Fuel\Gyrocopter",80362821 0081 +Cheat1="Infinite Fuel\Rocket Belt",80362841 0081 +Cheat2="Time Always 00'00'10",80362750 0001 +Cheat3="Choose Vehicle",883626A7 00?? +Cheat3_O=$00 Hang Glider,$01 Rocket Belt,$02 Gyrocopter,$03 Cannonball,$04 Skydiving,$05 Jumble Hopper,$06 Birdman +Cheat4="Fly As Yellow Plane In USA Level",89362748 0009,813627B0 3EE0,8024CDF5 006E +Cheat5="Fly As Gray Plane In USA Level",89362748 0008,813627B0 3F30,8024CDF5 006E +Cheat6="Have Perfect Score in all Class & Level's",8036427D 0064,803642AD 0064,803642DD 0064,80364911 0064,80364A61 0064,80364941 0064,80364A91 0064,80364971 0064,80364AC1 0064,80364FA5 0064,803650F5 0064,80365245 0064,80364FD5 0064,80365125 0064,80365275 0064,80365005 0064,80365155 0064,803652A5 0064,80365639 0064,80365789 0064,803658D9 0064,80365669 0064,803657B9 0064,80365909 0064,80365699 0064,803657E9 0064,80365939 0064,8036430D 0019,8036445D 0019,803645AD 0019,803646FD 0019,8036433D 0064,8036436D 0064,803649A1 0019,80364AF1 0019,80364C41 0019,80364D91 0019,803649D1 0064,80364A01 0064,80365035 0019,80365185 0019,803652D5 0019,80365425 0019,80365065 0064,80365095 0064 +Cheat2_N=This Cheat code is for All Events +Cheat3_N=Make your Choice & then Press GS To Activate,But do not use with any other Press GS Cheat Codes. +Cheat4_N=Press GS To Activate,But do not use with any other Press GS Cheat Codes. +Cheat5_N=Press GS To Activate,But do not use with any other Press GS Cheat Codes. +Cheat6_N=With these codes, if you want them to save, you have to play a level, and lose and just choose quit after it tallies up your score. Also dont keep the code active once you save the level at 100%, turn the code off and continue with the other levels! + +//---- + +[CA12B547-71FA4EE4-C:45] +Name=Pokemon Snap (U) +Cheat0="Press L\To Stop On Tunnel Level",D00489E1 0020,801DDC55 0001 +Cheat1="Press L\To Stop On Volcano Level",D00489E1 0020,801FC5C5 0001 +Cheat2="Press L\To Stop On River Level",D00489E1 0020,801EF96D 0001 +Cheat3="Press L\To Stop On Cave Level",D00489E1 0020,80202225 0001 +Cheat4="Press L\To Stop On Beach Level",D00489E1 0020,802020F5 0001 +Cheat5="Press L\To Stop On Valley Level",D00489E1 0020,801D9ABD 0001 +Cheat6="Have\Rapid Fire Apples and Bombs",80382CB7 0000 +Cheat7="Have\Apples Bombs and Flute",803AE51F 0004 +Cheat8="Have\Apple & Bomb",803AE51F 0002 +Cheat9="Have\Apple",803AE51F 0001 +Cheat10="[Enable All Levels]",810C2212 0006 +Cheat11="Hide First Digit In Roll Of Film",80388F5A 009D +Cheat12="See Entire Introduction Fully & Various In-Game Effects",81049C7E 025A +Cheat0_N=To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. +Cheat1_N=To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. +Cheat2_N=To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. +Cheat3_N=To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. +Cheat4_N=To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. +Cheat5_N=To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. + +//---- + +[39119872-07722E9F-C:45] +Name= Pokemon Snap Station (U) +Cheat0="Press L\To Stop On Tunnel Level",D00489E1 0020,801DDC55 0001 +Cheat1="Press L\To Stop On Volcano Level",D00489E1 0020,801FC5C5 0001 +Cheat2="Press L\To Stop On River Level",D00489E1 0020,801EF96D 0001 +Cheat3="Press L\To Stop On Cave Level",D00489E1 0020,80202225 0001 +Cheat4="Press L\To Stop On Beach Level",D00489E1 0020,802020F5 0001 +Cheat5="Press L\To Stop On Valley Level",D00489E1 0020,801D9ABD 0001 +Cheat6="Have\Rapid Fire Apples and Bombs",80382CB7 0000 +Cheat7="Have\Apples Bombs and Flute",803AE51F 0004 +Cheat8="Have\Apple & Bomb",803AE51F 0002 +Cheat9="Have\Apple",803AE51F 0001 +Cheat10="[Enable All Levels]",810C2212 0006 +Cheat11="Hide First Digit In Roll Of Film",80388F5A 009D +Cheat12="See Entire Introduction Fully & Various In-Game Effects",81049C7E 025A +Cheat0_N=To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. +Cheat1_N=To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. +Cheat2_N=To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. +Cheat3_N=To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. +Cheat4_N=To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. +Cheat5_N=To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. +Cheat10_N=This is needed to be able to Play all Levels of the Game + +//---- + +[90F5D9B3-9D0EDCF0-C:45] +Name=Pokemon Stadium (U) +Cheat0="Pokemon\Max HP\Player 1",810AE586 03E7,810AE5DA 03E7,810AE62E 03E7 +Cheat1="Pokemon\Max HP\Player 2",810AE7A2 03E7,810AE7F6 03E7,810AE84A 03E7 +Cheat2="Pokemon\Inf Spells\Player 1",810AE580 FFFF,810AE582 FFFF,810AE5D4 FFFF,810AE5D6 FFFF,810AE628 FFFF,810AE62A FFFF +Cheat3="Pokemon\Inf Spells\Player 2",810AE79C FFFF,810AE79E FFFF,810AE7F0 FFFF,810AE7F2 FFFF,810AE844 FFFF,810AE846 FFFF +Cheat4="Have All Pikachus Magnemites",801183BC 0000,801183BD 0000,801183BE 0000 +Cheat5="Inf HP\In Battle All Pokemon\Player 1",81285A18 03E7 +Cheat6="Inf HP\In Battle All Pokemon\Player 2",81286438 03E7 +Cheat7="Ultimate Code",81171F3C FF01,81171F3E FF01,81171F40 FF01,81171F42 FF01,81171F44 FF01 +Cheat7_N=what's so ultimate about this code is it raises your Pokemon to its full potential. Even at Level 100, most Pokemon still have a way to go to raise their stats to the max. But with this code, you can instantly boost any Pokemon to its greatest potential!!! + +//---- + +[03571182-892FD06D-C:45] +Name=Pokemon Stadium 2 (U) +Cheat0="One Hit KO",8014576F 0000,801457C7 0000,8014581F 0000 +Cheat1="Press R To Reset Time",801CE066 0010,81183ACC 0063 +Cheat2="Max Score",D117F812 03E7,8117F812 03E7 +Cheat3="Press R+L to KO Opponents",D10CE066 0030,80145767 0000,D10CE066 0030,801457C7 0000,D10CE066 0030,8014576F 0000,D10CE066 0030,8014581F 0000 +Cheat4="Infinite\Continues",8114738C 0009 +Cheat5="Instant\Win\Topsy Turvy\Player 1",80176887 0005 +Cheat6="Instant\Win\Barrier Ball\Player 1",8016EA97 0005 +Cheat7="Instant\Win\Pichu's Power Plant\Player 1",8016D64F 0050 +Cheat8="Infinite\Dirt Rollout Rampage\Player 1",8017DFEB 0002 +Cheat9="Press Z\for Max HP\1st Pokemon",D112B554 2000,8114528E 00FF,D112B554 2000,81145290 00FF +Cheat10="Press Z\for Max L.\1st Pokemon\Player 1",D112B554 2000,81145284 0063 +Cheat11="Press Z\for Max HP\2nd Pokemon\Player 1",D112B554 2000,811452E6 00FF,D112B554 2000,811452E8 00FF +Cheat12="Press Z\for Max L.\2nd Pokemon\Player 1",D112B554 2000,811452DC 0063 +Cheat13="Press Z\for Max HP\3rd Pokemon\Player 1",D112B554 2000,8114533E 00FF,D112B554 2000,81145340 00FF +Cheat14="Press Z\for Max L.\3rd Pokemon\Player 1",D112B554 2000,81145334 0063 +Cheat0_N=To Win you must get at least one hit or just return your pokemon. +Cheat1_N=Press R To Reset Time +Cheat3_N=Press R+L Activate +Cheat9_N=This will give them Max HP when they are not in use. Just call a Pokemon out and he will then have Max HP. When your Pokemon faints, just press Z again and it will revive itIn Battle Only,Do not use with anyother Press Z Cheat Code. +Cheat10_N=Do not use with anyother Press Z Cheat Code. +Cheat11_N=This will give them Max HP when they are not in use. Just call a Pokemon out and he will then have Max HP. When your Pokemon faints, just press Z again and it will revive itIn Battle Only,Do not use with anyother Press Z Cheat Code. +Cheat12_N=Do not use with anyother Press Z Cheat Code. +Cheat13_N=This will give them Max HP when they are not in use. Just call a Pokemon out and he will then have Max HP. When your Pokemon faints, just press Z again and it will revive itIn Battle Only,Do not use with anyother Press Z Cheat Code. +Cheat14_N=Do not use with anyother Press Z Cheat Code. + +//---- + +[CF8957AD-96D57EA9-C:45] +Name=Power Rangers - Lightspeed Rescue (U) +Cheat0="Unlock All\Characters",50000C01 0000,8006252D 0001 +Cheat1="Infinite\Health",81064DF0 42C8 +Cheat2="Unlock All\Levels",50000301 0000,80062508 0001,50000801 0000,8006250C 0001,50000801 0000,80062516 0001,50000A01 0000,8006251F 0001 +Cheat1_N=For Overhead & Driving Levels + +//---- + +[FC74D475-9A0278AB-C:45] +Name=Powerpuff Girls, The - Chemical X-traction (U) +Cheat0="1 Win Needed\Player 1",D00BAD0F 0000,800BAD0F 0001 +Cheat1="Infinite Health\Player 1",810BACDC 42C8 +Cheat2="Max Chemical X\Player 1",800BAD28 0003 +Cheat3="Never Win\Player 1",800BAD0F 0000 +Cheat4="No Chemical X\Player 1",800BAD28 0000 +Cheat5="No Health\Player 1",810BACDC 0000 +Cheat6="1 Win Needed\Player 2",D00BB04F 0000,800BB04F 0001 +Cheat7="Infinite Health\Player 2",810BB01C 42C8 +Cheat8="Max Chemical X\Player 2",800BB068 0003 +Cheat9="Never Win\Player 2",800BB04F 0000 +Cheat10="No Chemical X\Player 2",800BB068 0000 +Cheat11="No Health\Player 2",810BB01C 0000 +Cheat12="Infinite Time",810E69AC 42F0 + +//---- + +[9F5BF79C-D2FE08A0-C:45] +Name=Quake +Cheat0="Infinite\Ammo",50000402 0000,80163A2D 0064,50000402 0000,81163A2C 03E7 +Cheat1="Have\All Weapons",801639EB 007F +Cheat2="Debug Mode",8006C4C2 0001 +Cheat3="Have\All Keys",801639E9 000F +Cheat4="Infinite\Armor",81163944 42C8 +Cheat5="Infinite\Health",81163930 42C8 +Cheat6="Infinite\Bio Suit",81163980 42C8 +Cheat7="Have\Quad Damage",8116397C 42C8 +Cheat8="Have\Ring of Shadows",811639E8 ???? +Cheat8_O=$42C8 On,$0000 Off +Cheat9="Rapid Fire",D00CA9E0 0020,8016396D 0001 +Cheat10="Multi\Infinite Health\Player 1",81166290 42C8 +Cheat11="Multi\Infinite Armor\Player 1",811662A4 42C8 +Cheat12="Multi\Infinite Bio Suit\Player 1",811662E0 42C8 +Cheat13="Multi\Have All Weapons\Player 1",8016634B 007F +Cheat14="Multi\Infinite Ammo\Player 1",50000402 0000,8116638C 03E7 +Cheat15="Multi\Infinite Health\Player 2",81166560 42C8 +Cheat16="Multi\Infinite Armor\Player 2",81166574 42C8 +Cheat17="Multi\Infinite Bio Suit\Player 2",811665B0 42C8 +Cheat18="Multi\Have All Weapons\Player 2",8016661B 007F +Cheat19="Multi\Infinite Ammo\Player 2",50000402 0000,8116665C 03E7 + +//---- + +[BDA8F143-B1AF2D62-C:45] +Name=QUAKE II +Cheat0="The Ultimate",8104AD2C 0800,8104AD2E 0018,81000060 8E30,81000062 0068,81000064 241B,81000066 03E7,81000068 AE1B,8100006A 0030,8100006C AC9B,8100006E 0204,81000070 A219,81000072 004B,81000074 A219,81000076 004C,81000078 1000,8100007A 0005,8100007C A219,8100007E 0050,50000604 0000,81000090 A219,50000604 0004,81000092 0054,50000504 0000,810000A8 AE1B,50000504 0004,810000AA 006C,810000BC 0801,810000BE 2B4D,810000C0 AE1B,810000C2 0080 +Cheat1="Multi\Agony\Have\All Weapons\Player 1",801832B7 0001,801832BB 0001,801832BF 0001,801832C3 0001,801832C7 0001,801832CB 0001,801832CF 0001,801832D3 0001,801832D7 0001,801832DB 0001 +Cheat2="Multi\Agony\Infinite\Ammo\Player 1",801832DF 0063,801832E3 0063,801832E7 0063,801832EB 0063,801832EF 0063,801832F3 0063 +Cheat3="Multi\Agony\Have\All Weapons\Player 2",8018361B 0001,8018361F 0001,80183623 0001,80183627 0001,8018362B 0001,8018362F 0001,80183633 0001,80183637 0001,8018363B 0001,8018363F 0001 +Cheat4="Multi\Agony\Infinite\Ammo\Player 2",80183643 0063,80183647 0063,8018364B 0063,8018364F 0063,80183653 0063,80183657 0063 +Cheat5="Multi\Cold Steel\Have\All Weapons\Player 1",8017B577 0001,8017B57B 0001,8017B57F 0001,8017B583 0001,8017B587 0001,8017B58B 0001,8017B58F 0001,8017B593 0001,8017B597 0001,8017B59B 0001 +Cheat6="Multi\Cold Steel\Infinite\Ammo\Player 1",8017B59F 0063,8017B5A3 0063,8017B5A7 0063,8017B5AB 0063,8017B5AF 0063,8017B5B3 0063 +Cheat7="Multi\Cold Steel\Have\All Weapons\Player 2",8017B8DB 0001,8017B8DF 0001,8017B8E3 0001,8017B8E7 0001,8017B8EB 0001,8017B8EF 0001,8017B8F3 0001,8017B8F7 0001,8017B8FB 0001,8017B8FF 0001 +Cheat8="Multi\Cold Steel\Infinite\Ammo\Player 2",8017B903 0063,8017B907 0063,8017B90B 0063,8017B90F 0063,8017B913 0063,8017B917 0063 +Cheat9="Multi\Corridors\Have\All Weapons\Player 1",8017D1C7 0001,8017D1CB 0001,8017D1CF 0001,8017D1D3 0001,8017D1D7 0001,8017D1DB 0001,8017D1DF 0001,8017D1E3 0001,8017D1E7 0001,8017D1EB 0001 +Cheat10="Multi\Corridors\Infinite\Ammo\Player 1",8017D1E7 0063,8017D1F3 0063,8017D1F7 0063,8017D1FB 0063,8017D1FF 0063,8017D203 0063 +Cheat11="Multi\Corridors\Have\All Weapons\Player 2",8017D52B 0001,8017D52F 0001,8017D533 0001,8017D537 0001,8017D53B 0001,8017D53F 0001,8017D543 0001,8017D547 0001,8017D54B 0001,8017D54F 0001 +Cheat12="Multi\Corridors\Infinite\Ammo\Player 2",8017D553 0063,8017D557 0063,8017D55B 0063,8017D55F 0063,8017D567 0063 +Cheat13="Multi\Dying Halls\Have\All Weapons\Player 1",801BF937 0001,801BF93B 0001,801BF93F 0001,801BF943 0001,801BF947 0001,801BF94B 0001,801BF94F 0001,801BF953 0001,801BF957 0001,801BF95B 0001 +Cheat14="Multi\Dying Halls\Infinite\Ammo\Player 1",801BF95F 0063,801BF963 0063,801BF967 0063,801BF96B 0063,801BF96F 0063,801BF973 0063 +Cheat15="Multi\Dying Halls\Have\All Weapons\Player 2",801BFC9B 0001,801BFC9F 0001,801BFCA3 0001,801BFCA7 0001,801BFCAB 0001,801BFCAF 0001,801BFCB3 0001,801BFCB7 0001,801BFCBB 0001,801BFCBF 0001 +Cheat16="Multi\Dying Halls\Infinite\Ammo\Player 2",801BFCC3 0063,801BFCC7 0063,801BFCCB 0063,801BFCCF 0063,801BFCD3 0063,801BFCD7 0063 +Cheat17="Multi\Empty Space\Have\All Weapons\Player 1",80179B27 0001,80179B2B 0001,80179B2F 0001,80179B33 0001,80179B37 0001,80179B3B 0001,80179B3F 0001,80179B43 0001,80179B47 0001,80179B4B 0001 +Cheat18="Multi\Empty Space\Infinite\Ammo\Player 1",80179B4F 0063,80179B53 0063,80179B57 0063,80179B5B 0063,80179B5F 0063,80179B63 0063 +Cheat19="Multi\Empty Space\Have\All Weapons\Player 2",80179E8B 0001,80179E8F 0001,80179E93 0001,80179E97 0001,80179E9B 0001,80179E9F 0001,80179EA3 0001,80179EA7 0001,80179EAB 0001,80179EAF 0001 +Cheat20="Multi\Empty Space\Infinite\Ammo\Player 2",80179EB3 0063,80179EB7 0063,80179EBB 0063,80179EBF 0063,80179EC3 0063,80179EC7 0063 +Cheat21="Multi\Fortress\Have\All Weapons\Player 1",8017D617 0001,8017D61B 0001,8017D61F 0001,8017D623 0001,8017D627 0001,8017D62B 0001,8017D62F 0001,8017D633 0001,8017D637 0001,8017D63B 0001 +Cheat22="Multi\Fortress\Infinite\Ammo\Player 1",8017D63F 0063,8017D643 0063,8017D647 0063,8017D64B 0063,8017D64F 0063,8017D653 0063 +Cheat23="Multi\Fortress\Have\All Weapons\Player 2",8017D97B 0001,8017D97F 0001,8017D983 0001,8017D987 0001,8017D98B 0001,8017D98F 0001,8017D993 0001,8017D997 0001,8017D99B 0001,8017D99F 0001 +Cheat24="Multi\Fortress\Infinite\Ammo\Player 2",8017D9A3 0063,8017D9A7 0063,8017D9AB 0063,8017D9AF 0063,8017D9B3 0063,8017D9B7 0063 +Cheat25="Multi\Mad Dash\Have\All Weapons\Player 1",801AE9A7 0001,801AE9AB 0001,801AE9AF 0001,801AE9B3 0001,801AE9B7 0001,801AE9BB 0001,801AE9BF 0001,801AE9C3 0001,801AE9C7 0001,801AE9CB 0001 +Cheat26="Multi\Mad Dash\Infinite\Ammo\Player 1",801AE9CF 0063,801AE9D3 0063,801AE9D7 0063,801AE9DB 0063,801AE9DF 0063,801AE9E3 0063 +Cheat27="Multi\Mad Dash\Have\All Weapons\Player 2",801AED0B 0001,801AED0F 0001,801AED13 0001,801AED17 0001,801AED1B 0001,801AED1F 0001,801AED23 0001,801AED27 0001,801AED2B 0001,801AED2F 0001 +Cheat28="Multi\Mad Dash\Infinite\Ammo\Player 2",801AED33 0063,801AED37 0063,801AED3B 0063,801AED3F 0063,801AED43 0063,801AED47 0063 +Cheat29="Multi\Overflow\Have\All Weapons\Player 1",80197907 0001,8019790B 0001,8019790F 0001,80197913 0001,80197917 0001,8019791B 0001,8019791F 0001,80197923 0001,80197927 0001,8019792B 0001 +Cheat30="Multi\Overflow\Infinite\Ammo\Player 1",8019792F 0063,80197933 0063,80197937 0063,8019793B 0063,8019793F 0063,80197943 0063 +Cheat31="Multi\Overflow\Have\All Weapons\Player 2",80197C6B 0001,80197C6F 0001,80197C73 0001,80197C77 0001,80197C7B 0001,80197C7F 0001,80197C83 0001,80197C87 0001,80197C8B 0001,80197C8F 0001 +Cheat32="Multi\Overflow\Infinite\Ammo\Player 2",80197C93 0063,80197C97 0063,80197C9B 0063,80197C9F 0063,80197CA3 0063,80197CA7 0063 +Cheat33="Multi\Twists\Have\All Weapons\Player 1",801ABE47 0001,801ABE4B 0001,801ABE4F 0001,801ABE53 0001,801ABE57 0001,801ABE5B 0001,801ABE5F 0001,801ABE63 0001,801ABE67 0001,801ABE6B 0001 +Cheat34="Multi\Twists\Infinite\Ammo\Player 1",801ABE6F 0063,801ABE73 0063,801ABE77 0063,801ABE7B 0063,801ABE7F 0063,801ABE83 0063 +Cheat35="Multi\Twists\Have\All Weapons\Player 2",801AC1AB 0001,801AC1AF 0001,801AC1B3 0001,801AC1B7 0001,801AC1BB 0001,801AC1BF 0001,801AC1C3 0001,801AC1C7 0001,801AC1CB 0001,801AC1CF 0001 +Cheat36="Multi\Twists\Infinite\Ammo\Player 2",801AC1D3 0063,801AC1D7 0063,801AC1DB 0063,801AC1DF 0063,801AC1E3 0063,801AC1E7 0063 +Cheat37="Multi\War Room\Have\All Weapons\Player 1",801A2E57 0001,801A2E5B 0001,801A2E5F 0001,801A2E63 0001,801A2E67 0001,801A2E6B 0001,801A2E6F 0001,801A2E73 0001,801A2E77 0001,801A2E7B 0001 +Cheat38="Multi\War Room\Infinite\Ammo\Player 1",801A2E7F 0063,801A2E83 0063,801A2E87 0063,801A2E8B 0063,801A2E8F 0063,801A2E93 0063 +Cheat39="Multi\War Room\Have\All Weapons\Player 2",801A31BB 0001,801A31BF 0001,801A31C3 0001,801A31C7 0001,801A31CB 0001,801A31CF 0001,801A31D3 0001,801A31D7 0001,801A31DB 0001,801A31DF 0001 +Cheat40="Multi\War Room\Infinite\Ammo\Player 2",801A31E3 0063,801A31E7 0063,801A31EB 0063,801A31EF 0063,801A31F3 0063,801A31F7 0063 +Cheat0_N=The Ultimate Gives you on Solo Play Infinite Health, Infinite Armor, All Guns, and Infinite Ammo On all Levels + +//---- + +[C8BB4DD9-CC5F430B-C:45] +Name=Quest 64 (U) +Cheat0="Have All Elements",8107BAA4 3232,8107BAA6 3232 +Cheat1="Infinite Health",8107BA84 01F4,8107BA86 01F4 +Cheat2="Infinite Magic Points",8107BA88 01F4,8107BA8A 01F4 +Cheat3="Super Agility",8107BA8E 01F4 +Cheat4="Super Defense",8107BA8C 01F4 + +//---- + +[73A88E3D-3AC5C571-C:45] +Name=Rally Challenge 2000 (U) +Cheat0="Infinite Time",81104998 49F2 +Cheat1="Arcade Mode\Car Modifier",802818B3 00?? +Cheat1_O=$00 Mitsubishi Lancer Evolution V,$01 Subaru Impreza WRC,$02 Toyota Corolla WRC,$03 Nissan Almera Kit Car,$04 Seat Cordoba WRC,$05 Skoda Octavia,$06 VW Golf GTI MK IV,$07 Proton WIRA,$08 Hyundai Coupe EVO 2 +Cheat2="Easy Courses\Australia\Have 1st",80178F87 0000 +Cheat3="Easy Courses\Australia\Always Low Lap Timer",81178F90 0000,81178F92 0000 +Cheat4="Easy Courses\Spain\Have 1st",801870D7 0000 +Cheat5="Easy Courses\Spain\Always Low Lap Timer",811870E0 0000,811870E2 0000 +Cheat6="Easy Courses\Great Britian\Have 1st",801766A7 0000 +Cheat7="Easy Courses\Great Britian\Always Low Lap Timer",811766B0 0000,811766B2 0000 +Cheat8="Medium Courses\Italy\Have 1st",8017E4E7 0000 +Cheat9="Medium Courses\Italy\Always Low Lap Timer",8117E4D0 0000,8117E4D2 0000 +Cheat10="Medium Courses\Brazil\Have 1st",801748C7 0000 +Cheat11="Medium Courses\Brazil\Always Low Lap Timer",811748D0 0000,811748D2 0000 +Cheat12="Medium Courses\France\Have 1st",80172477 0000 +Cheat13="Medium Courses\France\Always Low Lap Timer",81172480 0000,81172482 0000 +Cheat14="Expert Courses\Germany\Have 1st",8017DF87 0000 +Cheat15="Expert Courses\Germany\Always Low Lap Timer",8117DF90 0000,8117DF92 0000 +Cheat16="Expert Courses\Canada\Have 1st",8017CF87 0000 +Cheat17="Expert Courses\Canada\Always Low Lap Timer",8117CF90 0000,8117CF92 0000 +Cheat18="Expert Courses\USA\Have 1st",8017EF87 0000 +Cheat19="Expert Courses\USA\Always Low Lap Timer",8117EF90 0000,8117EF92 0000 +Cheat20="Championship Mode\Have 255 Race Points",80101D1A 00FF +Cheat21="Championship Mode\Australia\Start On 3rd Lap",D0178F6F 0001,80178F6F 0003 +Cheat22="Championship Mode\Australia\Infinite Damage\Front End",80178FA0 003E +Cheat23="Championship Mode\Australia\Infinite Damage\Left Side",80178FA4 0040 +Cheat24="Championship Mode\Australia\Infinite Damage\Right Side",80178FA8 0040 +Cheat25="Championship Mode\Australia\Infinite Damage\Tires",80178FAC 0040 +Cheat26="Championship Mode\Spain\Start On 3rd Lap",D01870BF 0001,801870BF 0003 +Cheat27="Championship Mode\Spain\Infinite Damage\Front End",801870F0 0040 +Cheat28="Championship Mode\Spain\Infinite Damage\Left Side",801870F4 0040 +Cheat29="Championship Mode\Spain\Infinite Damage\Right Side",801870F8 0040 +Cheat30="Championship Mode\Spain\Infinite Damage\Tires",801870FC 0040 +Cheat31="Championship Mode\Brazil\Start On 3rd Lap",D01748AF 0001,801748AF 0003 +Cheat32="Championship Mode\Brazil\Infinite Damage\Front End",801748E0 0040 +Cheat33="Championship Mode\Brazil\Infinite Damage\Left Side",801748E4 0040 +Cheat34="Championship Mode\Brazil\Infinite Damage\Right Side",801748E8 0040 +Cheat35="Championship Mode\Brazil\Infinite Damage\Tires",801748EC 0040 +Cheat36="Championship Mode\USA\Start On 3rd Lap",D017EF6F 0001,8017EF6F 0003 +Cheat37="Championship Mode\USA\Infinite Damage\Front End",8017EFA0 0040 +Cheat38="Championship Mode\USA\Infinite Damage\Left Side",8017EFA4 0040 +Cheat39="Championship Mode\USA\Infinite Damage\Right Side",8017EFA8 0040 +Cheat40="Championship Mode\USA\Infinite Damage\Tires",8017EFAC 0040 +Cheat41="Championship Mode\Italy\Start On 3rd Lap",D017E4CF 0001,8017E4CF 0003 +Cheat42="Championship Mode\Italy\Infinite Damage\Front End",8017E500 0040 +Cheat43="Championship Mode\Italy\Infinite Damage\Left Side",8017E504 0040 +Cheat44="Championship Mode\Italy\Infinite Damage\Right Side",8017E508 0040 +Cheat45="Championship Mode\Italy\Infinite Damage\Tires",8017E50C 0040 +Cheat46="Championship Mode\Germany\Start On 3rd Lap",D017DF6F 0001,8017DF6F 0003 +Cheat47="Championship Mode\Germany\Infinite Damage\Front End",8017DFA0 0040 +Cheat48="Championship Mode\Germany\Infinite Damage\Left Side",8017DFA4 0040 +Cheat49="Championship Mode\Germany\Infinite Damage\Right Side",8017DFA8 0040 +Cheat50="Championship Mode\Germany\Infinite Damage\Tires",8017DFAC 0040 +Cheat51="Championship Mode\Canada\Start On 3rd Lap",D017CF6F 0001,8017CF6F 0003 +Cheat52="Championship Mode\Canada\Infinite Damage\Front End",8017CFA0 0040 +Cheat53="Championship Mode\Canada\Infinite Damage\Left Side",8017CFA4 0040 +Cheat54="Championship Mode\Canada\Infinite Damage\Right Side",8017CFA8 0040 +Cheat55="Championship Mode\Canada\Infinite Damage\Tires",8017CFAC 0040 +Cheat56="Championship Mode\Great Britain\Start On 3rd Lap",D017668F 0001,8017668F 0003 +Cheat57="Championship Mode\Great Britain\Infinite Damage\Front End",801766C0 0040 +Cheat58="Championship Mode\Great Britain\Infinite Damage\Left Side",801766C4 0040 +Cheat59="Championship Mode\Great Britain\Infinite Damage\Right Side",801766C8 0040 +Cheat60="Championship Mode\Great Britain\Infinite Damage\Tires",801766CC 0040 +Cheat61="Championship Mode\France\Start On 3rd Lap",D017245F 0001,8017245F 0003 +Cheat62="Championship Mode\France\Infinite Damage\Front End",80172490 0040 +Cheat63="Championship Mode\France\Infinite Damage\Left Side",80172494 0040 +Cheat64="Championship Mode\France\Infinite Damage\Right Side",80172498 0040 +Cheat65="Championship Mode\France\Infinite Damage\Tires",8017249C 0040 + +//---- + +[C29FF9E4-264BFE7D-C:45] +Name=Rampage - World Tour (U) +Cheat0="Unlock Cheat Menu",810D5710 0001 +Cheat1="Infinite Time to Choose A Character",8118CF9A 06CB +Cheat2="Curtis\Infinite\Health",811541B8 0044 +Cheat3="Curtis\1-Hit Death",D01541B9 0044,811541B8 0001 +Cheat4="Curtis\Infinite\Special",811541C0 0044 +Cheat5="Curtis\Max Score",811541E8 000F,811541EA 423F +Cheat6="Curtis\Infinite\Lives",811541B4 0063 +Cheat7="Boris\Infinite\Health",811543D4 0044 +Cheat8="Boris\1-Hit Death",D01543D5 0044,811543D4 0001 +Cheat9="Boris\Infinite\Special",811543DC 0044 +Cheat10="Boris\Max Score",81154404 000F,81154406 423F +Cheat11="Boris\Infinite\Lives",811543D0 0063 +Cheat12="Ruby\Infinite\Health",811545F0 0044 +Cheat13="Ruby\1-Hit Death",D01545F1 0044,811545F0 0001 +Cheat14="Ruby\Infinite\Special",811545F8 0044 +Cheat15="Ruby\Max Score",81154620 000F,81154622 423F +Cheat16="Ruby\Infinite\Lives",811545EC 0063 +Cheat17="George\Infinite\Health",8115480C 0044 +Cheat18="George\1-Hit Death",D015480D 0044,8115480C 0001 +Cheat19="George\Infinite\Special",81154814 0044 +Cheat20="George\Max Score",8115483C 000F,8115483E 423F +Cheat21="George\Infinite\Lives",81154808 0063 +Cheat22="Lizzie\Infinite\Health",81154A28 0044 +Cheat23="Lizzie\1-Hit Death",D0154A29 0044,81154A28 0001 +Cheat24="Lizzie\Infinite\Special",81154A30 0044 +Cheat25="Lizzie\Max Score",81154A58 000F,81154A5A 423F +Cheat26="Lizzie\Infinite\Lives",81154A24 0063 +Cheat27="Ralph\Infinite\Health",81154C44 0044 +Cheat28="Ralph\1-Hit Death",D0154C45 0044,81154C44 0001 +Cheat29="Ralph\Infinite\Special",81154C4C 0044 +Cheat30="Ralph\Max Score",81154C74 000F,81154C76 423F +Cheat31="Ralph\Infinite\Lives",81154C40 0063 +Cheat32="Myukus Codes\Infinite\Health",81154E60 0044 +Cheat33="Myukus Codes\1-Hit Death",D0154E61 0044,81154E60 0001 +Cheat34="Myukus Codes\Infinite\Special",81154E68 0044 +Cheat35="Myukus Codes\Max Score",81154E90 000F,81154E92 423F +Cheat36="Myukus Codes\Infinite\Lives",81154E5C 0063 + +//---- + +[673D099B-A4C808DE-C:45] +Name=Rampage 2: Universal Tour (U) +Cheat0="Always Full Special\Myukus",81554E68 0044 +Cheat1="Always Full Special\Ralph",81154C4C 0044 +Cheat2="Enable\Myukus",8118CF98 0000 +Cheat3="Infinite\Health\Myukus",81154E60 0044 +Cheat4="Infinite\Lives\Myukus",81154EFC 0063 +Cheat5="Infinite\Lives\Ruby",811545EC 0063 +Cheat6="Enable\Lizzie",8118CF94 0000 +Cheat7="Enable\Ralph",8118CF96 0000 +Cheat8="Infinite Health\George",8115480C 0044 +Cheat9="Infinite Health\Lizzie",81154A28 0044 +Cheat10="Infinite Health\Ralph",81154C44 0044 +Cheat11="Infinite Lives\George",81154808 0063 +Cheat12="Infinite Lives\Lizzie",81154A24 0063 +Cheat13="Infinite Lives\Ralph",81154C40 0063 +Cheat14="Always Full Special\Boris",811543DC 0044 +Cheat15="Always Full Special\Curtis",811541C0 0044 +Cheat16="Always Full Special\Ruby",811545F8 0044 +Cheat17="Always Full Special\George",81154814 0044 +Cheat18="Always Full Special\Lizzie",81154A30 0044 +Cheat19="Enable George",8118CF92 0000 +Cheat20="Infinite\Health\Boris",811543D4 0044 +Cheat21="Infinite\Health\Curtis",811541B8 0044 +Cheat22="Infinite\Health\Ruby",811545F0 0044 +Cheat23="Infinite\Lives\Boris",811543D0 0063 +Cheat24="Infinite\Lives\Curtis",811541B4 0063 + +//---- + +[0304C48E-AC4001B8-C:45] +Name=Rat Attack (U) +Cheat0="Play As/Player 1",801514F3 00?? +Cheat1="Play As/Player 2",80151503 00?? +Cheat2="Play As/Player 3",80151513 00?? +Cheat3="Play As/Player 4",80151523 00?? +Cheat4="Max Score",81158440 05F5,81158442 E0FF +Cheat0_O=$00 Hai Jinx,$01 Sparky,$02 Manx,$03 Muffy Dupont,$04 Bob Cat,$05 Smokey,$06 Atomicat,$07 Pearl +Cheat1_O=$00 Hai Jinx,$01 Sparky,$02 Manx,$03 Muffy Dupont,$04 Bob Cat,$05 Smokey,$06 Atomicat,$07 Pearl +Cheat2_O=$00 Hai Jinx,$01 Sparky,$02 Manx,$03 Muffy Dupont,$04 Bob Cat,$05 Smokey,$06 Atomicat,$07 Pearl +Cheat3_O=$00 Hai Jinx,$01 Sparky,$02 Manx,$03 Muffy Dupont,$04 Bob Cat,$05 Smokey,$06 Atomicat,$07 Pearl + +//---- + +[F3C5BF9B-160F33E2-C:45] +Name=Rayman 2 The Great Escape (U) +Cheat0="Have All\Crates",810C70F8 7FFF,810C70FA FFFF,810C70FC FFFF,810C70FE FFFF,810C7100 FFFF,800C7102 00FF +Cheat1="All Masks",891F1210 8780 +Cheat2="Start with Full Health",811BC64C 001E +Cheat3="Have All\Levels",811F1200 FFFF,811F1202 FFFF,811F1201 03E7,811F1203 03E7 +Cheat4="Have All\Yellow Lums",50006401 0000,800C7108 00FF,50001901 0000,800C70BD 00FF,811F1182 0005,50005702 0000,811F1188 FFFF +Cheat5="Have All\Pirate Cages",801F1142 0050,811F11F0 FFFF,811F11F2 FFFF,811F11F4 FFFF,811F11F6 FFFF,811F11F8 00FF,811F11FA FFFF +Cheat6="Open Map",810C70F0 FFFF,810C70F2 FFFF +Cheat7="Infinite\Oxygen",810F4B90 4396 +Cheat1_N=Press GS To Activate All Masks + +//---- + +[3918834A-15B50C29-C:45] +Name=Razor Freestyle Scooter (U) [!] +Cheat0="Freeze Timer",800CE4EE 0077 +Cheat1="Max\Wheels Collected",800CE513 00?? +Cheat1_O=$00 0 Wheels,$1E 30 Wheels,$28 40 Wheels +Cheat2="Zero Crash Counts",800CE49F 0000 +Cheat3="Max\Tricks Landed",810CE4A6 03E7,810CE4A2 03E7 +Cheat4="Max\Combos Landed",810CE4AA 03E7,810CE4AE 03E7 +Cheat5="Have All Charcters & Levels Unlocked",50000740 0000,800CB951 0001,50000304 0000,800CB945 0001,50000304 0000,800CB985 0001,50000304 0000,800CB9C5 0001,50000304 0000,800CBA05 0001,50000304 0000,800CBA45 0001,50000304 0000,800CBA85 0001 + +//---- + +[EAB7B429-BAC92C57-C:45] +Name=Ready 2 Rumble Boxing (U) +Cheat0="Infinite\Money",810EC932 FFFF +Cheat1="Sudden Death Mode\Player 1",D00E7596 03D7,810DAF78 0000,810D9F7A 0001 +Cheat2="Sudden Death Mode\Player 2",D00E7596 03D7,810DA790 0000,810DA792 0001 +Cheat3="Player 1\Health",810D9F78 0000,810D9F7A 00?? +Cheat4="Player 1\Stamina",810D9F7C 0000,810D9F7E 00?? +Cheat5="Player 1\RUMBLE",810D9F84 0000,810D9F86 00?? +Cheat6="Player 2\Health",810DA790 0000,810DA792 00?? +Cheat7="Player 2\Stamina",810DA794 0000,810DA796 00?? +Cheat8="Player 2\RUMBLE",810DA7A0 0000,810DA7A2 00?? +Cheat9="Infinite\Time",810E7596 0E10 +Cheat10="Have All Characters",5000125C 0000,810EC938 0000,5000125C 0000,810EC93A 0003 +Cheat3_O=$64 Infinite,$00 No Health +Cheat4_O=$64 Infinite,$00 No Stamina +Cheat5_O=$30 Max,$00 Never Rumble +Cheat6_O=$64 Infinite,$00 No Health +Cheat7_O=$64 Infinite,$00 No Stamina +Cheat8_O=$30 Max,$00 Never Rumble + +//---- + +[E9219533-13FBAFBD-C:45] +Name=Ready 2 Rumble Boxing: Round 2 (U) +Cheat0="Infinite\Health\Player 1",810FF6B6 0064 +Cheat1="No Health\Player 1",810FF6B6 0000 +Cheat2="Infinite\Stamina\Player 1",810FF6BA 0064 +Cheat3="No Stamina\Player 1",810FF6BA 0000 +Cheat4="Max RUMBLE\Player 1",810FF6C2 0090 +Cheat5="Never RUMBLE\Player 1",810FF6C2 0000 +Cheat6="Infinite\Health\Player 2",81100316 0064 +Cheat7="No Health\Player 2",81100316 0000 +Cheat8="Infinite\Stamina\Player 2",8110031A 0064 +Cheat9="No Stamina\Player 2",8110031A 0000 +Cheat10="Max RUMBLE\Player 2",81100322 0090 +Cheat11="Never RUMBLE\Player 2",81100322 0000 +Cheat12="Infinite\Time",810FE352 0E10 +Cheat13="Championship Mode\Top Rank",810F81BA 000A +Cheat14="Championship Mode\Max Money",810F81C8 7FFF,810F81CA FFFF +Cheat15="Championship Mode\Infinite Money",810F81CA FFFF +Cheat16="Championship Mode\Max Strength",810F81CC 447A,810F81CE 0000 +Cheat17="Championship Mode\Max Stamina",810F81D0 447A,810F81D2 0000 +Cheat18="Championship Mode\Max Endurance",810F81D4 447A,810F81D6 0000 +Cheat19="Championship Mode\Max Dexterity",810F81D8 447A,810F81DA 0000 +Cheat20="Championship Mode\Max Experience",810F81DC 447A,810F81DE 0000 +Cheat21="Enable Extra Characters",80101E6F 0003,80101E73 0003,80101E77 0003,80101E7B 0003,80101E7F 0003,80101E83 0003,80101E87 0003 +Cheat22="Win 1 Fight to Complete Arcade Mode",80101F0B 000B +Cheat0_N=Do not use this with No Health +Cheat1_N=Do not use this with Infinite Health +Cheat2_N=Do not use this with No Stamina +Cheat3_N=Do not use this with Infinite Stamina +Cheat4_N=Do not use this with Never RUMBLE +Cheat5_N=Do not use this with Max RUMBLE +Cheat6_N=Do not use this with No Health +Cheat7_N=Do not use this with Infinite Health +Cheat8_N=Do not use this with No Stamina +Cheat9_N=Do not use this with Infinite Stamina +Cheat10_N=Do not use this with Never RUMBLE +Cheat11_N=Do not use this with Max RUMBLE + +//---- + +[AA18B1A5-07DB6AEB-C:45] +Name=Resident Evil 2 (U) +Cheat0="Max Item Modifier\Slot 01",800E8EC8 00??,800E8EC9 00FF +Cheat0_O=$00 Nothing,$01 Knife Hunk,$02 Handgun Hunk,$03 Handgun Different Ada,$04 Custom Handgun Hunk,$05 Magnum Hunk,$06 Custom Magnum Hunk,$07 Shotgun Hunk,$08 Custom Shotgun Hunk,$09 Grenade Launcher Claire,$0A Grenade Launcher (Flame Rounds) Claire,$0B Grenade Launcher (Acid Rounds) Claire,$0C Bowgun Claire,$0D Colt S.A.A. Claire,$0E Spark Shot Claire,$0F Sub Machine Gun Leon,$10 Flamethrower Leon,$11 Rocket Launcher Claire,$12 Gatling Gun Claire,$13 Machine Gun ???,$14 Handgun Bullets,$15 Shotgun Shells,$16 Magnum Bullets,$17 Fuel,$18 Grenade Rounds,$19 Flame Rounds,$1A Acid Rounds,$1B Machine Gun Bullets,$1C S. Shot Bullets,$1D Bow Gun Bolts,$1E Ink Ribbon,$1F Small Key,$20 Hand Gun Parts,$21 Magnum Parts,$22 Shotgun Parts,$23 First Aid Spray,$24 Chemical FR-W09,$25 Chemical AC-W24,$26 Green Herb,$27 Red Herb,$28 Blue Herb,$29 Mixed Herb (Green),$2A Mixed Herb (Red&Green),$2B Mixed Herb (Blue&Green),$2C Mixed Herb (?),$2D Mixed Herb (?),$2E Mixed Herb (?),$2F Lighter,$30 Lock Pick,$31 Picture,$32 Valve Handle,$33 Red Jewel,$34 Red Card Key,$35 Blue Card Key,$36 Serpent Stone,$37 Jaguar Stone,$38 Blue Stone,$39 Blue Stone (?),$3A Eagle Stone,$3B Bishop Plug,$3C Rook Plug,$3D Knight Plug,$3E King Plug,$3F W. Box Key,$40 Detonator,$41 Plastic Bomb,$42 Bomb&Detonator,$43 Crank,$44 Film,$45 Film (?),$46 Film (?),$47 Unicorn Medal,$48 Eagle Medal,$49 Wolf Medal,$4A G. Cogwheel,$4B Manhole Opener,$4C Main Fuse,$4D Fuse Case,$4E Vaccine,$4F Vaccine Cart.,$50 Film,$51 Base Vaccine,$52 G-Virus,$53 Special Key,$54 Joint S Plug,$55 Joint N Plug,$56 Cord,$57 Film,$58 Cabin Key,$59 Precinct Key (blue),$5A Precinct Key (red),$5B Precinct Key (?),$5C Precinct Key (green),$5D C. Panel Key (red),$5E C. Panel Key (yellow),$5F P. Room Key,$60 MO Disk,$61 Lab Card Key,$62 Master Key,$63 Platform Key,$64 No Item,$65 No Item,$66 No Item,$67 No Item,$68 Chris's Diary,$69 Mail to Chris,$6A Memo to Leon,$6B Police Memorandum,$6C Operation Report 1,$6D Mail to the Chief,$6E Mail to the Chief (?),$6F Secretary's Diary A,$70 Secretary's Diary B,$71 Operation Report 2,$72 User Registration,$73 Film A,$74 Film B,$75 Film C,$76 Patrol Report,$77 Watchman's Diary,$78 Chief's Diary,$79 Sewer Manager Diary,$7A Sewer Manager Fax,$7B Film D,$7C Vaccine Synthesis,$7D Lab Security Manual,$7E P-Epsilon Report,$7F Rookie Files,$80 Rookie Files (?),$81 No Item,$82 Spade Key,$83 Diamond Key,$84 Desk Key,$85 Heart Key,$86 Club Key,$87 Virgin Heart,$88 Square Crank,$89 Down Key,$8A Up Key,$8B Locker Key +Cheat1="Max Item Modifier\Slot 02",800E8ECC 00??,800E8ECD 00FF +Cheat1_O=$00 Nothing,$01 Knife Hunk,$02 Handgun Hunk,$03 Handgun Different Ada,$04 Custom Handgun Hunk,$05 Magnum Hunk,$06 Custom Magnum Hunk,$07 Shotgun Hunk,$08 Custom Shotgun Hunk,$09 Grenade Launcher Claire,$0A Grenade Launcher (Flame Rounds) Claire,$0B Grenade Launcher (Acid Rounds) Claire,$0C Bowgun Claire,$0D Colt S.A.A. Claire,$0E Spark Shot Claire,$0F Sub Machine Gun Leon,$10 Flamethrower Leon,$11 Rocket Launcher Claire,$12 Gatling Gun Claire,$13 Machine Gun ???,$14 Handgun Bullets,$15 Shotgun Shells,$16 Magnum Bullets,$17 Fuel,$18 Grenade Rounds,$19 Flame Rounds,$1A Acid Rounds,$1B Machine Gun Bullets,$1C S. Shot Bullets,$1D Bow Gun Bolts,$1E Ink Ribbon,$1F Small Key,$20 Hand Gun Parts,$21 Magnum Parts,$22 Shotgun Parts,$23 First Aid Spray,$24 Chemical FR-W09,$25 Chemical AC-W24,$26 Green Herb,$27 Red Herb,$28 Blue Herb,$29 Mixed Herb (Green),$2A Mixed Herb (Red&Green),$2B Mixed Herb (Blue&Green),$2C Mixed Herb (?),$2D Mixed Herb (?),$2E Mixed Herb (?),$2F Lighter,$30 Lock Pick,$31 Picture,$32 Valve Handle,$33 Red Jewel,$34 Red Card Key,$35 Blue Card Key,$36 Serpent Stone,$37 Jaguar Stone,$38 Blue Stone,$39 Blue Stone (?),$3A Eagle Stone,$3B Bishop Plug,$3C Rook Plug,$3D Knight Plug,$3E King Plug,$3F W. Box Key,$40 Detonator,$41 Plastic Bomb,$42 Bomb&Detonator,$43 Crank,$44 Film,$45 Film (?),$46 Film (?),$47 Unicorn Medal,$48 Eagle Medal,$49 Wolf Medal,$4A G. Cogwheel,$4B Manhole Opener,$4C Main Fuse,$4D Fuse Case,$4E Vaccine,$4F Vaccine Cart.,$50 Film,$51 Base Vaccine,$52 G-Virus,$53 Special Key,$54 Joint S Plug,$55 Joint N Plug,$56 Cord,$57 Film,$58 Cabin Key,$59 Precinct Key (blue),$5A Precinct Key (red),$5B Precinct Key (?),$5C Precinct Key (green),$5D C. Panel Key (red),$5E C. Panel Key (yellow),$5F P. Room Key,$60 MO Disk,$61 Lab Card Key,$62 Master Key,$63 Platform Key,$64 No Item,$65 No Item,$66 No Item,$67 No Item,$68 Chris's Diary,$69 Mail to Chris,$6A Memo to Leon,$6B Police Memorandum,$6C Operation Report 1,$6D Mail to the Chief,$6E Mail to the Chief (?),$6F Secretary's Diary A,$70 Secretary's Diary B,$71 Operation Report 2,$72 User Registration,$73 Film A,$74 Film B,$75 Film C,$76 Patrol Report,$77 Watchman's Diary,$78 Chief's Diary,$79 Sewer Manager Diary,$7A Sewer Manager Fax,$7B Film D,$7C Vaccine Synthesis,$7D Lab Security Manual,$7E P-Epsilon Report,$7F Rookie Files,$80 Rookie Files (?),$81 No Item,$82 Spade Key,$83 Diamond Key,$84 Desk Key,$85 Heart Key,$86 Club Key,$87 Virgin Heart,$88 Square Crank,$89 Down Key,$8A Up Key,$8B Locker Key +Cheat2="Max Item Modifier\Slot 03",800E8ED0 00??,800E8ED1 00FF +Cheat2_O=$00 Nothing,$01 Knife Hunk,$02 Handgun Hunk,$03 Handgun Different Ada,$04 Custom Handgun Hunk,$05 Magnum Hunk,$06 Custom Magnum Hunk,$07 Shotgun Hunk,$08 Custom Shotgun Hunk,$09 Grenade Launcher Claire,$0A Grenade Launcher (Flame Rounds) Claire,$0B Grenade Launcher (Acid Rounds) Claire,$0C Bowgun Claire,$0D Colt S.A.A. Claire,$0E Spark Shot Claire,$0F Sub Machine Gun Leon,$10 Flamethrower Leon,$11 Rocket Launcher Claire,$12 Gatling Gun Claire,$13 Machine Gun ???,$14 Handgun Bullets,$15 Shotgun Shells,$16 Magnum Bullets,$17 Fuel,$18 Grenade Rounds,$19 Flame Rounds,$1A Acid Rounds,$1B Machine Gun Bullets,$1C S. Shot Bullets,$1D Bow Gun Bolts,$1E Ink Ribbon,$1F Small Key,$20 Hand Gun Parts,$21 Magnum Parts,$22 Shotgun Parts,$23 First Aid Spray,$24 Chemical FR-W09,$25 Chemical AC-W24,$26 Green Herb,$27 Red Herb,$28 Blue Herb,$29 Mixed Herb (Green),$2A Mixed Herb (Red&Green),$2B Mixed Herb (Blue&Green),$2C Mixed Herb (?),$2D Mixed Herb (?),$2E Mixed Herb (?),$2F Lighter,$30 Lock Pick,$31 Picture,$32 Valve Handle,$33 Red Jewel,$34 Red Card Key,$35 Blue Card Key,$36 Serpent Stone,$37 Jaguar Stone,$38 Blue Stone,$39 Blue Stone (?),$3A Eagle Stone,$3B Bishop Plug,$3C Rook Plug,$3D Knight Plug,$3E King Plug,$3F W. Box Key,$40 Detonator,$41 Plastic Bomb,$42 Bomb&Detonator,$43 Crank,$44 Film,$45 Film (?),$46 Film (?),$47 Unicorn Medal,$48 Eagle Medal,$49 Wolf Medal,$4A G. Cogwheel,$4B Manhole Opener,$4C Main Fuse,$4D Fuse Case,$4E Vaccine,$4F Vaccine Cart.,$50 Film,$51 Base Vaccine,$52 G-Virus,$53 Special Key,$54 Joint S Plug,$55 Joint N Plug,$56 Cord,$57 Film,$58 Cabin Key,$59 Precinct Key (blue),$5A Precinct Key (red),$5B Precinct Key (?),$5C Precinct Key (green),$5D C. Panel Key (red),$5E C. Panel Key (yellow),$5F P. Room Key,$60 MO Disk,$61 Lab Card Key,$62 Master Key,$63 Platform Key,$64 No Item,$65 No Item,$66 No Item,$67 No Item,$68 Chris's Diary,$69 Mail to Chris,$6A Memo to Leon,$6B Police Memorandum,$6C Operation Report 1,$6D Mail to the Chief,$6E Mail to the Chief (?),$6F Secretary's Diary A,$70 Secretary's Diary B,$71 Operation Report 2,$72 User Registration,$73 Film A,$74 Film B,$75 Film C,$76 Patrol Report,$77 Watchman's Diary,$78 Chief's Diary,$79 Sewer Manager Diary,$7A Sewer Manager Fax,$7B Film D,$7C Vaccine Synthesis,$7D Lab Security Manual,$7E P-Epsilon Report,$7F Rookie Files,$80 Rookie Files (?),$81 No Item,$82 Spade Key,$83 Diamond Key,$84 Desk Key,$85 Heart Key,$86 Club Key,$87 Virgin Heart,$88 Square Crank,$89 Down Key,$8A Up Key,$8B Locker Key +Cheat3="Max Item Modifier\Slot 04",800E8ED4 00??,800E8ED5 00FF +Cheat3_O=$00 Nothing,$01 Knife Hunk,$02 Handgun Hunk,$03 Handgun Different Ada,$04 Custom Handgun Hunk,$05 Magnum Hunk,$06 Custom Magnum Hunk,$07 Shotgun Hunk,$08 Custom Shotgun Hunk,$09 Grenade Launcher Claire,$0A Grenade Launcher (Flame Rounds) Claire,$0B Grenade Launcher (Acid Rounds) Claire,$0C Bowgun Claire,$0D Colt S.A.A. Claire,$0E Spark Shot Claire,$0F Sub Machine Gun Leon,$10 Flamethrower Leon,$11 Rocket Launcher Claire,$12 Gatling Gun Claire,$13 Machine Gun ???,$14 Handgun Bullets,$15 Shotgun Shells,$16 Magnum Bullets,$17 Fuel,$18 Grenade Rounds,$19 Flame Rounds,$1A Acid Rounds,$1B Machine Gun Bullets,$1C S. Shot Bullets,$1D Bow Gun Bolts,$1E Ink Ribbon,$1F Small Key,$20 Hand Gun Parts,$21 Magnum Parts,$22 Shotgun Parts,$23 First Aid Spray,$24 Chemical FR-W09,$25 Chemical AC-W24,$26 Green Herb,$27 Red Herb,$28 Blue Herb,$29 Mixed Herb (Green),$2A Mixed Herb (Red&Green),$2B Mixed Herb (Blue&Green),$2C Mixed Herb (?),$2D Mixed Herb (?),$2E Mixed Herb (?),$2F Lighter,$30 Lock Pick,$31 Picture,$32 Valve Handle,$33 Red Jewel,$34 Red Card Key,$35 Blue Card Key,$36 Serpent Stone,$37 Jaguar Stone,$38 Blue Stone,$39 Blue Stone (?),$3A Eagle Stone,$3B Bishop Plug,$3C Rook Plug,$3D Knight Plug,$3E King Plug,$3F W. Box Key,$40 Detonator,$41 Plastic Bomb,$42 Bomb&Detonator,$43 Crank,$44 Film,$45 Film (?),$46 Film (?),$47 Unicorn Medal,$48 Eagle Medal,$49 Wolf Medal,$4A G. Cogwheel,$4B Manhole Opener,$4C Main Fuse,$4D Fuse Case,$4E Vaccine,$4F Vaccine Cart.,$50 Film,$51 Base Vaccine,$52 G-Virus,$53 Special Key,$54 Joint S Plug,$55 Joint N Plug,$56 Cord,$57 Film,$58 Cabin Key,$59 Precinct Key (blue),$5A Precinct Key (red),$5B Precinct Key (?),$5C Precinct Key (green),$5D C. Panel Key (red),$5E C. Panel Key (yellow),$5F P. Room Key,$60 MO Disk,$61 Lab Card Key,$62 Master Key,$63 Platform Key,$64 No Item,$65 No Item,$66 No Item,$67 No Item,$68 Chris's Diary,$69 Mail to Chris,$6A Memo to Leon,$6B Police Memorandum,$6C Operation Report 1,$6D Mail to the Chief,$6E Mail to the Chief (?),$6F Secretary's Diary A,$70 Secretary's Diary B,$71 Operation Report 2,$72 User Registration,$73 Film A,$74 Film B,$75 Film C,$76 Patrol Report,$77 Watchman's Diary,$78 Chief's Diary,$79 Sewer Manager Diary,$7A Sewer Manager Fax,$7B Film D,$7C Vaccine Synthesis,$7D Lab Security Manual,$7E P-Epsilon Report,$7F Rookie Files,$80 Rookie Files (?),$81 No Item,$82 Spade Key,$83 Diamond Key,$84 Desk Key,$85 Heart Key,$86 Club Key,$87 Virgin Heart,$88 Square Crank,$89 Down Key,$8A Up Key,$8B Locker Key +Cheat4="Max Item Modifier\Slot 05",800E8ED8 00??,800E8ED9 00FF +Cheat4_O=$00 Nothing,$01 Knife Hunk,$02 Handgun Hunk,$03 Handgun Different Ada,$04 Custom Handgun Hunk,$05 Magnum Hunk,$06 Custom Magnum Hunk,$07 Shotgun Hunk,$08 Custom Shotgun Hunk,$09 Grenade Launcher Claire,$0A Grenade Launcher (Flame Rounds) Claire,$0B Grenade Launcher (Acid Rounds) Claire,$0C Bowgun Claire,$0D Colt S.A.A. Claire,$0E Spark Shot Claire,$0F Sub Machine Gun Leon,$10 Flamethrower Leon,$11 Rocket Launcher Claire,$12 Gatling Gun Claire,$13 Machine Gun ???,$14 Handgun Bullets,$15 Shotgun Shells,$16 Magnum Bullets,$17 Fuel,$18 Grenade Rounds,$19 Flame Rounds,$1A Acid Rounds,$1B Machine Gun Bullets,$1C S. Shot Bullets,$1D Bow Gun Bolts,$1E Ink Ribbon,$1F Small Key,$20 Hand Gun Parts,$21 Magnum Parts,$22 Shotgun Parts,$23 First Aid Spray,$24 Chemical FR-W09,$25 Chemical AC-W24,$26 Green Herb,$27 Red Herb,$28 Blue Herb,$29 Mixed Herb (Green),$2A Mixed Herb (Red&Green),$2B Mixed Herb (Blue&Green),$2C Mixed Herb (?),$2D Mixed Herb (?),$2E Mixed Herb (?),$2F Lighter,$30 Lock Pick,$31 Picture,$32 Valve Handle,$33 Red Jewel,$34 Red Card Key,$35 Blue Card Key,$36 Serpent Stone,$37 Jaguar Stone,$38 Blue Stone,$39 Blue Stone (?),$3A Eagle Stone,$3B Bishop Plug,$3C Rook Plug,$3D Knight Plug,$3E King Plug,$3F W. Box Key,$40 Detonator,$41 Plastic Bomb,$42 Bomb&Detonator,$43 Crank,$44 Film,$45 Film (?),$46 Film (?),$47 Unicorn Medal,$48 Eagle Medal,$49 Wolf Medal,$4A G. Cogwheel,$4B Manhole Opener,$4C Main Fuse,$4D Fuse Case,$4E Vaccine,$4F Vaccine Cart.,$50 Film,$51 Base Vaccine,$52 G-Virus,$53 Special Key,$54 Joint S Plug,$55 Joint N Plug,$56 Cord,$57 Film,$58 Cabin Key,$59 Precinct Key (blue),$5A Precinct Key (red),$5B Precinct Key (?),$5C Precinct Key (green),$5D C. Panel Key (red),$5E C. Panel Key (yellow),$5F P. Room Key,$60 MO Disk,$61 Lab Card Key,$62 Master Key,$63 Platform Key,$64 No Item,$65 No Item,$66 No Item,$67 No Item,$68 Chris's Diary,$69 Mail to Chris,$6A Memo to Leon,$6B Police Memorandum,$6C Operation Report 1,$6D Mail to the Chief,$6E Mail to the Chief (?),$6F Secretary's Diary A,$70 Secretary's Diary B,$71 Operation Report 2,$72 User Registration,$73 Film A,$74 Film B,$75 Film C,$76 Patrol Report,$77 Watchman's Diary,$78 Chief's Diary,$79 Sewer Manager Diary,$7A Sewer Manager Fax,$7B Film D,$7C Vaccine Synthesis,$7D Lab Security Manual,$7E P-Epsilon Report,$7F Rookie Files,$80 Rookie Files (?),$81 No Item,$82 Spade Key,$83 Diamond Key,$84 Desk Key,$85 Heart Key,$86 Club Key,$87 Virgin Heart,$88 Square Crank,$89 Down Key,$8A Up Key,$8B Locker Key +Cheat5="Max Item Modifier\Slot 06",800E8EDC 00??,800E8EDD 00FF +Cheat5_O=$00 Nothing,$01 Knife Hunk,$02 Handgun Hunk,$03 Handgun Different Ada,$04 Custom Handgun Hunk,$05 Magnum Hunk,$06 Custom Magnum Hunk,$07 Shotgun Hunk,$08 Custom Shotgun Hunk,$09 Grenade Launcher Claire,$0A Grenade Launcher (Flame Rounds) Claire,$0B Grenade Launcher (Acid Rounds) Claire,$0C Bowgun Claire,$0D Colt S.A.A. Claire,$0E Spark Shot Claire,$0F Sub Machine Gun Leon,$10 Flamethrower Leon,$11 Rocket Launcher Claire,$12 Gatling Gun Claire,$13 Machine Gun ???,$14 Handgun Bullets,$15 Shotgun Shells,$16 Magnum Bullets,$17 Fuel,$18 Grenade Rounds,$19 Flame Rounds,$1A Acid Rounds,$1B Machine Gun Bullets,$1C S. Shot Bullets,$1D Bow Gun Bolts,$1E Ink Ribbon,$1F Small Key,$20 Hand Gun Parts,$21 Magnum Parts,$22 Shotgun Parts,$23 First Aid Spray,$24 Chemical FR-W09,$25 Chemical AC-W24,$26 Green Herb,$27 Red Herb,$28 Blue Herb,$29 Mixed Herb (Green),$2A Mixed Herb (Red&Green),$2B Mixed Herb (Blue&Green),$2C Mixed Herb (?),$2D Mixed Herb (?),$2E Mixed Herb (?),$2F Lighter,$30 Lock Pick,$31 Picture,$32 Valve Handle,$33 Red Jewel,$34 Red Card Key,$35 Blue Card Key,$36 Serpent Stone,$37 Jaguar Stone,$38 Blue Stone,$39 Blue Stone (?),$3A Eagle Stone,$3B Bishop Plug,$3C Rook Plug,$3D Knight Plug,$3E King Plug,$3F W. Box Key,$40 Detonator,$41 Plastic Bomb,$42 Bomb&Detonator,$43 Crank,$44 Film,$45 Film (?),$46 Film (?),$47 Unicorn Medal,$48 Eagle Medal,$49 Wolf Medal,$4A G. Cogwheel,$4B Manhole Opener,$4C Main Fuse,$4D Fuse Case,$4E Vaccine,$4F Vaccine Cart.,$50 Film,$51 Base Vaccine,$52 G-Virus,$53 Special Key,$54 Joint S Plug,$55 Joint N Plug,$56 Cord,$57 Film,$58 Cabin Key,$59 Precinct Key (blue),$5A Precinct Key (red),$5B Precinct Key (?),$5C Precinct Key (green),$5D C. Panel Key (red),$5E C. Panel Key (yellow),$5F P. Room Key,$60 MO Disk,$61 Lab Card Key,$62 Master Key,$63 Platform Key,$64 No Item,$65 No Item,$66 No Item,$67 No Item,$68 Chris's Diary,$69 Mail to Chris,$6A Memo to Leon,$6B Police Memorandum,$6C Operation Report 1,$6D Mail to the Chief,$6E Mail to the Chief (?),$6F Secretary's Diary A,$70 Secretary's Diary B,$71 Operation Report 2,$72 User Registration,$73 Film A,$74 Film B,$75 Film C,$76 Patrol Report,$77 Watchman's Diary,$78 Chief's Diary,$79 Sewer Manager Diary,$7A Sewer Manager Fax,$7B Film D,$7C Vaccine Synthesis,$7D Lab Security Manual,$7E P-Epsilon Report,$7F Rookie Files,$80 Rookie Files (?),$81 No Item,$82 Spade Key,$83 Diamond Key,$84 Desk Key,$85 Heart Key,$86 Club Key,$87 Virgin Heart,$88 Square Crank,$89 Down Key,$8A Up Key,$8B Locker Key +Cheat6="Max Item Modifier\Slot 07",800E8EE0 00??,800E8EE1 00FF +Cheat6_O=$00 Nothing,$01 Knife Hunk,$02 Handgun Hunk,$03 Handgun Different Ada,$04 Custom Handgun Hunk,$05 Magnum Hunk,$06 Custom Magnum Hunk,$07 Shotgun Hunk,$08 Custom Shotgun Hunk,$09 Grenade Launcher Claire,$0A Grenade Launcher (Flame Rounds) Claire,$0B Grenade Launcher (Acid Rounds) Claire,$0C Bowgun Claire,$0D Colt S.A.A. Claire,$0E Spark Shot Claire,$0F Sub Machine Gun Leon,$10 Flamethrower Leon,$11 Rocket Launcher Claire,$12 Gatling Gun Claire,$13 Machine Gun ???,$14 Handgun Bullets,$15 Shotgun Shells,$16 Magnum Bullets,$17 Fuel,$18 Grenade Rounds,$19 Flame Rounds,$1A Acid Rounds,$1B Machine Gun Bullets,$1C S. Shot Bullets,$1D Bow Gun Bolts,$1E Ink Ribbon,$1F Small Key,$20 Hand Gun Parts,$21 Magnum Parts,$22 Shotgun Parts,$23 First Aid Spray,$24 Chemical FR-W09,$25 Chemical AC-W24,$26 Green Herb,$27 Red Herb,$28 Blue Herb,$29 Mixed Herb (Green),$2A Mixed Herb (Red&Green),$2B Mixed Herb (Blue&Green),$2C Mixed Herb (?),$2D Mixed Herb (?),$2E Mixed Herb (?),$2F Lighter,$30 Lock Pick,$31 Picture,$32 Valve Handle,$33 Red Jewel,$34 Red Card Key,$35 Blue Card Key,$36 Serpent Stone,$37 Jaguar Stone,$38 Blue Stone,$39 Blue Stone (?),$3A Eagle Stone,$3B Bishop Plug,$3C Rook Plug,$3D Knight Plug,$3E King Plug,$3F W. Box Key,$40 Detonator,$41 Plastic Bomb,$42 Bomb&Detonator,$43 Crank,$44 Film,$45 Film (?),$46 Film (?),$47 Unicorn Medal,$48 Eagle Medal,$49 Wolf Medal,$4A G. Cogwheel,$4B Manhole Opener,$4C Main Fuse,$4D Fuse Case,$4E Vaccine,$4F Vaccine Cart.,$50 Film,$51 Base Vaccine,$52 G-Virus,$53 Special Key,$54 Joint S Plug,$55 Joint N Plug,$56 Cord,$57 Film,$58 Cabin Key,$59 Precinct Key (blue),$5A Precinct Key (red),$5B Precinct Key (?),$5C Precinct Key (green),$5D C. Panel Key (red),$5E C. Panel Key (yellow),$5F P. Room Key,$60 MO Disk,$61 Lab Card Key,$62 Master Key,$63 Platform Key,$64 No Item,$65 No Item,$66 No Item,$67 No Item,$68 Chris's Diary,$69 Mail to Chris,$6A Memo to Leon,$6B Police Memorandum,$6C Operation Report 1,$6D Mail to the Chief,$6E Mail to the Chief (?),$6F Secretary's Diary A,$70 Secretary's Diary B,$71 Operation Report 2,$72 User Registration,$73 Film A,$74 Film B,$75 Film C,$76 Patrol Report,$77 Watchman's Diary,$78 Chief's Diary,$79 Sewer Manager Diary,$7A Sewer Manager Fax,$7B Film D,$7C Vaccine Synthesis,$7D Lab Security Manual,$7E P-Epsilon Report,$7F Rookie Files,$80 Rookie Files (?),$81 No Item,$82 Spade Key,$83 Diamond Key,$84 Desk Key,$85 Heart Key,$86 Club Key,$87 Virgin Heart,$88 Square Crank,$89 Down Key,$8A Up Key,$8B Locker Key +Cheat7="Max Item Modifier\Slot 08",800E8EE4 00??,800E8EE5 00FF +Cheat7_O=$00 Nothing,$01 Knife Hunk,$02 Handgun Hunk,$03 Handgun Different Ada,$04 Custom Handgun Hunk,$05 Magnum Hunk,$06 Custom Magnum Hunk,$07 Shotgun Hunk,$08 Custom Shotgun Hunk,$09 Grenade Launcher Claire,$0A Grenade Launcher (Flame Rounds) Claire,$0B Grenade Launcher (Acid Rounds) Claire,$0C Bowgun Claire,$0D Colt S.A.A. Claire,$0E Spark Shot Claire,$0F Sub Machine Gun Leon,$10 Flamethrower Leon,$11 Rocket Launcher Claire,$12 Gatling Gun Claire,$13 Machine Gun ???,$14 Handgun Bullets,$15 Shotgun Shells,$16 Magnum Bullets,$17 Fuel,$18 Grenade Rounds,$19 Flame Rounds,$1A Acid Rounds,$1B Machine Gun Bullets,$1C S. Shot Bullets,$1D Bow Gun Bolts,$1E Ink Ribbon,$1F Small Key,$20 Hand Gun Parts,$21 Magnum Parts,$22 Shotgun Parts,$23 First Aid Spray,$24 Chemical FR-W09,$25 Chemical AC-W24,$26 Green Herb,$27 Red Herb,$28 Blue Herb,$29 Mixed Herb (Green),$2A Mixed Herb (Red&Green),$2B Mixed Herb (Blue&Green),$2C Mixed Herb (?),$2D Mixed Herb (?),$2E Mixed Herb (?),$2F Lighter,$30 Lock Pick,$31 Picture,$32 Valve Handle,$33 Red Jewel,$34 Red Card Key,$35 Blue Card Key,$36 Serpent Stone,$37 Jaguar Stone,$38 Blue Stone,$39 Blue Stone (?),$3A Eagle Stone,$3B Bishop Plug,$3C Rook Plug,$3D Knight Plug,$3E King Plug,$3F W. Box Key,$40 Detonator,$41 Plastic Bomb,$42 Bomb&Detonator,$43 Crank,$44 Film,$45 Film (?),$46 Film (?),$47 Unicorn Medal,$48 Eagle Medal,$49 Wolf Medal,$4A G. Cogwheel,$4B Manhole Opener,$4C Main Fuse,$4D Fuse Case,$4E Vaccine,$4F Vaccine Cart.,$50 Film,$51 Base Vaccine,$52 G-Virus,$53 Special Key,$54 Joint S Plug,$55 Joint N Plug,$56 Cord,$57 Film,$58 Cabin Key,$59 Precinct Key (blue),$5A Precinct Key (red),$5B Precinct Key (?),$5C Precinct Key (green),$5D C. Panel Key (red),$5E C. Panel Key (yellow),$5F P. Room Key,$60 MO Disk,$61 Lab Card Key,$62 Master Key,$63 Platform Key,$64 No Item,$65 No Item,$66 No Item,$67 No Item,$68 Chris's Diary,$69 Mail to Chris,$6A Memo to Leon,$6B Police Memorandum,$6C Operation Report 1,$6D Mail to the Chief,$6E Mail to the Chief (?),$6F Secretary's Diary A,$70 Secretary's Diary B,$71 Operation Report 2,$72 User Registration,$73 Film A,$74 Film B,$75 Film C,$76 Patrol Report,$77 Watchman's Diary,$78 Chief's Diary,$79 Sewer Manager Diary,$7A Sewer Manager Fax,$7B Film D,$7C Vaccine Synthesis,$7D Lab Security Manual,$7E P-Epsilon Report,$7F Rookie Files,$80 Rookie Files (?),$81 No Item,$82 Spade Key,$83 Diamond Key,$84 Desk Key,$85 Heart Key,$86 Club Key,$87 Virgin Heart,$88 Square Crank,$89 Down Key,$8A Up Key,$8B Locker Key +Cheat8="Max Item Modifier\Slot 09",800E8EE8 00??,800E8EE9 00FF +Cheat8_O=$00 Nothing,$01 Knife Hunk,$02 Handgun Hunk,$03 Handgun Different Ada,$04 Custom Handgun Hunk,$05 Magnum Hunk,$06 Custom Magnum Hunk,$07 Shotgun Hunk,$08 Custom Shotgun Hunk,$09 Grenade Launcher Claire,$0A Grenade Launcher (Flame Rounds) Claire,$0B Grenade Launcher (Acid Rounds) Claire,$0C Bowgun Claire,$0D Colt S.A.A. Claire,$0E Spark Shot Claire,$0F Sub Machine Gun Leon,$10 Flamethrower Leon,$11 Rocket Launcher Claire,$12 Gatling Gun Claire,$13 Machine Gun ???,$14 Handgun Bullets,$15 Shotgun Shells,$16 Magnum Bullets,$17 Fuel,$18 Grenade Rounds,$19 Flame Rounds,$1A Acid Rounds,$1B Machine Gun Bullets,$1C S. Shot Bullets,$1D Bow Gun Bolts,$1E Ink Ribbon,$1F Small Key,$20 Hand Gun Parts,$21 Magnum Parts,$22 Shotgun Parts,$23 First Aid Spray,$24 Chemical FR-W09,$25 Chemical AC-W24,$26 Green Herb,$27 Red Herb,$28 Blue Herb,$29 Mixed Herb (Green),$2A Mixed Herb (Red&Green),$2B Mixed Herb (Blue&Green),$2C Mixed Herb (?),$2D Mixed Herb (?),$2E Mixed Herb (?),$2F Lighter,$30 Lock Pick,$31 Picture,$32 Valve Handle,$33 Red Jewel,$34 Red Card Key,$35 Blue Card Key,$36 Serpent Stone,$37 Jaguar Stone,$38 Blue Stone,$39 Blue Stone (?),$3A Eagle Stone,$3B Bishop Plug,$3C Rook Plug,$3D Knight Plug,$3E King Plug,$3F W. Box Key,$40 Detonator,$41 Plastic Bomb,$42 Bomb&Detonator,$43 Crank,$44 Film,$45 Film (?),$46 Film (?),$47 Unicorn Medal,$48 Eagle Medal,$49 Wolf Medal,$4A G. Cogwheel,$4B Manhole Opener,$4C Main Fuse,$4D Fuse Case,$4E Vaccine,$4F Vaccine Cart.,$50 Film,$51 Base Vaccine,$52 G-Virus,$53 Special Key,$54 Joint S Plug,$55 Joint N Plug,$56 Cord,$57 Film,$58 Cabin Key,$59 Precinct Key (blue),$5A Precinct Key (red),$5B Precinct Key (?),$5C Precinct Key (green),$5D C. Panel Key (red),$5E C. Panel Key (yellow),$5F P. Room Key,$60 MO Disk,$61 Lab Card Key,$62 Master Key,$63 Platform Key,$64 No Item,$65 No Item,$66 No Item,$67 No Item,$68 Chris's Diary,$69 Mail to Chris,$6A Memo to Leon,$6B Police Memorandum,$6C Operation Report 1,$6D Mail to the Chief,$6E Mail to the Chief (?),$6F Secretary's Diary A,$70 Secretary's Diary B,$71 Operation Report 2,$72 User Registration,$73 Film A,$74 Film B,$75 Film C,$76 Patrol Report,$77 Watchman's Diary,$78 Chief's Diary,$79 Sewer Manager Diary,$7A Sewer Manager Fax,$7B Film D,$7C Vaccine Synthesis,$7D Lab Security Manual,$7E P-Epsilon Report,$7F Rookie Files,$80 Rookie Files (?),$81 No Item,$82 Spade Key,$83 Diamond Key,$84 Desk Key,$85 Heart Key,$86 Club Key,$87 Virgin Heart,$88 Square Crank,$89 Down Key,$8A Up Key,$8B Locker Key +Cheat9="Max Item Modifier\Slot 10",800E8EEC 00??,800E8EED 00FF +Cheat9_O=$00 Nothing,$01 Knife Hunk,$02 Handgun Hunk,$03 Handgun Different Ada,$04 Custom Handgun Hunk,$05 Magnum Hunk,$06 Custom Magnum Hunk,$07 Shotgun Hunk,$08 Custom Shotgun Hunk,$09 Grenade Launcher Claire,$0A Grenade Launcher (Flame Rounds) Claire,$0B Grenade Launcher (Acid Rounds) Claire,$0C Bowgun Claire,$0D Colt S.A.A. Claire,$0E Spark Shot Claire,$0F Sub Machine Gun Leon,$10 Flamethrower Leon,$11 Rocket Launcher Claire,$12 Gatling Gun Claire,$13 Machine Gun ???,$14 Handgun Bullets,$15 Shotgun Shells,$16 Magnum Bullets,$17 Fuel,$18 Grenade Rounds,$19 Flame Rounds,$1A Acid Rounds,$1B Machine Gun Bullets,$1C S. Shot Bullets,$1D Bow Gun Bolts,$1E Ink Ribbon,$1F Small Key,$20 Hand Gun Parts,$21 Magnum Parts,$22 Shotgun Parts,$23 First Aid Spray,$24 Chemical FR-W09,$25 Chemical AC-W24,$26 Green Herb,$27 Red Herb,$28 Blue Herb,$29 Mixed Herb (Green),$2A Mixed Herb (Red&Green),$2B Mixed Herb (Blue&Green),$2C Mixed Herb (?),$2D Mixed Herb (?),$2E Mixed Herb (?),$2F Lighter,$30 Lock Pick,$31 Picture,$32 Valve Handle,$33 Red Jewel,$34 Red Card Key,$35 Blue Card Key,$36 Serpent Stone,$37 Jaguar Stone,$38 Blue Stone,$39 Blue Stone (?),$3A Eagle Stone,$3B Bishop Plug,$3C Rook Plug,$3D Knight Plug,$3E King Plug,$3F W. Box Key,$40 Detonator,$41 Plastic Bomb,$42 Bomb&Detonator,$43 Crank,$44 Film,$45 Film (?),$46 Film (?),$47 Unicorn Medal,$48 Eagle Medal,$49 Wolf Medal,$4A G. Cogwheel,$4B Manhole Opener,$4C Main Fuse,$4D Fuse Case,$4E Vaccine,$4F Vaccine Cart.,$50 Film,$51 Base Vaccine,$52 G-Virus,$53 Special Key,$54 Joint S Plug,$55 Joint N Plug,$56 Cord,$57 Film,$58 Cabin Key,$59 Precinct Key (blue),$5A Precinct Key (red),$5B Precinct Key (?),$5C Precinct Key (green),$5D C. Panel Key (red),$5E C. Panel Key (yellow),$5F P. Room Key,$60 MO Disk,$61 Lab Card Key,$62 Master Key,$63 Platform Key,$64 No Item,$65 No Item,$66 No Item,$67 No Item,$68 Chris's Diary,$69 Mail to Chris,$6A Memo to Leon,$6B Police Memorandum,$6C Operation Report 1,$6D Mail to the Chief,$6E Mail to the Chief (?),$6F Secretary's Diary A,$70 Secretary's Diary B,$71 Operation Report 2,$72 User Registration,$73 Film A,$74 Film B,$75 Film C,$76 Patrol Report,$77 Watchman's Diary,$78 Chief's Diary,$79 Sewer Manager Diary,$7A Sewer Manager Fax,$7B Film D,$7C Vaccine Synthesis,$7D Lab Security Manual,$7E P-Epsilon Report,$7F Rookie Files,$80 Rookie Files (?),$81 No Item,$82 Spade Key,$83 Diamond Key,$84 Desk Key,$85 Heart Key,$86 Club Key,$87 Virgin Heart,$88 Square Crank,$89 Down Key,$8A Up Key,$8B Locker Key +Cheat10="Infinite\Health",810E1322 00C8 +Cheat11="Always Have Fine Condition",810E13E4 0000 +Cheat12="Play As",810E1138 ???? +Cheat12_O=$0080 Leon Original,$0180 Claire Original,$0280 Leon Original,$0380 Claire Original,$0480 Leon Wounded,$0580 Claire without jacket,$0680 Leon Wounded,$0780 Claire without jacket,$0880 Leon as Stars,$0980 Claire as Biker,$0A80 Leon as Biker,$0B80 Claires body Leons outfit,$0C80 Hunk (can crash the game),$0D80 To Fu,$0E80 Ada (can crash the game),$0F80 Cheryl, +Cheat13="Play Extra Mission",810E10EE 00?? +Cheat13_O=$48 The 4th Survior,$49 To-Fu +Cheat14="Infinite\Time",800E8CBF 0010 + +//---- + +[0F1FA987-BFC1AFA6-C:45] +Name=Re-Volt (U) +Cheat0="Access All\Cars & Tracks",8104ACA6 0001 +Cheat1="Access All\Cups",5000032C 0000,810542FA 00FF +Cheat2="Always 1st",8111565E 0001,81115666 0000,8110C1EE 02F4 +Cheat3="Infinite Continues",8110C1E2 0006 +Cheat4="Drones Have No Weapons",8111CD7E 0000 +Cheat5="Infinite Weapons\Player 1",81115648 0000,8111564A 00??,8111564E 0001 +Cheat5_O=$00 Green Missile,$01 Orange Missile,$02 Multi-Orange Missiles,$03 The Bomb,$04 Water Balloon,$05 Blue Protector,$06 Oil Slick,$07 Bowling Ball Mine,$08 Yellow Protector,$09 Lightning Bolt,$0A Orange Star,$0B Beach Ball +Cheat6="Laps To Race",8107DBCE 00?? +Cheat6_O=$01 1 Lap,$02 2 laps,$03 3 Laps,$04 4 Laps,$05 5 Laps,$06 6 Laps,$07 7 Laps,$08 8 Laps,$09 9 Laps +Cheat7="Number Of Drones In The Race",8110FEA6 00?? +Cheat7_O=$01 1 Drone,$02 2 Drones,$03 3 Drones,$04 4 Drones,$05 5 Drones,$06 6 Drones,$07 7 Drones,$08 8 Drones,$09 9 Drones +Cheat8="99 Points Player 1",8010C1EF 0063 +Cheat9="Infinite Weapons\Player 2",81117B10 0000,81117B12 00??,81117B16 0001 +Cheat9_O=$00 Green Missile,$01 Orange Missile,$02 Multi-Orange Missiles,$03 The Bomb,$04 Water Balloon,$05 Blue Protector,$06 Oil Slick,$07 Bowling Ball Mine,$08 Yellow Protector,$09 Lightning Bolt,$0A Orange Star,$0B Beach Ball +Cheat10="Infinite Weapons\Player 3",81119FD8 0000,81119FDA 00??,81119FDE 0001 +Cheat10_O=$00 Green Missile,$01 Orange Missile,$02 Multi-Orange Missiles,$03 The Bomb,$04 Water Balloon,$05 Blue Protector,$06 Oil Slick,$07 Bowling Ball Mine,$08 Yellow Protector,$09 Lightning Bolt,$0A Orange Star,$0B Beach Ball +Cheat11="Infinite Weapons\Player 4",8111C4A0 0000,8111C4A2 00??,8111C4A6 0001 +Cheat11_O=$00 Green Missile,$01 Orange Missile,$02 Multi-Orange Missiles,$03 The Bomb,$04 Water Balloon,$05 Blue Protector,$06 Oil Slick,$07 Bowling Ball Mine,$08 Yellow Protector,$09 Lightning Bolt,$0A Orange Star,$0B Beach Ball + +//---- + +[0B6B4DDB-9671E682-C:45] +Name=Roadsters Trophy (U) (M3) +Cheat0="Cheats Enabled Modifier",8108F840 ???? +Cheat0_O=$0004 Fast Bucks (You Get 250,$0008 Easy Money (You Get 1,$0010 Trophies (Second And Third Championships Wins),$0020 Smurfing (High Pitched Voices),$0040 Big Wheels (Big Foot Cars),$0080 Skywalker (Hover Cars),$0100 Car Radio (Remote Control Cars),$0200 Chopper (Top Down View),$0400 Anyway (Race Circuits Backwards),$0800 Extra Resolution (Able To Change Resolution In Options Screen) + +//---- + +[F050746C-247B820B-C:45] +Name=ROAD RASH 64 +Cheat0="Always 1st",810D7856 0000 +Cheat1="Always Have\Max Cash",810D6A7A FFFF +Cheat3="Access\Infinite & All Weapons",50000E02 0000,811B8D7A 0505 +Cheat4="Infinite\Damage",801C0D17 0002 +Cheat5="Infinite\Health\To Bike",811B8A38 42F0,811B8A3C 42F0 +Cheat6="Infinite\Health\To Character",811BFE10 4489,811BFE12 8000 +Cheat7="Always Have\Weapon",801C00B3 00?? +Cheat7_O=$01 Fists,$02 Spiked Club,$03 Tiring Iron,$04 Bat,$05 Billie Club,$06 Sledge Hammer,$07 Pool Cue,$08 Monkey Wrench,$09 Banana,$0A Cattle Prod,$0B Taser,$0C Bace,$0D Nunchuk,$0E Chain +Cheat2="Access\All Bikes & Tracks",800A77D5 0063 + +//---- + +[AC8E4B32-E7B47326-C:45] +Name=Robotron 64 (U) +Cheat0="Infinite Lives",8009B1AF 0009 +Cheat1="Max Score",8009B1AA 00FF +Cheat2="Level Select In Setup Menu",81076FF6 6F8C + +//---- + +[0C5EE085-A167DD3E-C:45] +Name=Rocket: Robot On Wheels (U) +Cheat0="Infinite\Max Health",8109F702 000C,8109F706 000C +Cheat1="Max\Tinker Toys",810A599E 270F +Cheat2="Max\Ticket Switches",810A59A2 00C8 +Cheat3="Have All\Machine Parts",810A5960 FFFF +Cheat4="Have All\Vechicles",810A5968 FFFF +Cheat5="Activate Cheat",810A63C6 F5FF +Cheat6="Whoopie World\Max Tickets",810A58F0 FFFF,810A58F2 FFFF,810A58F4 FFFF,810A58F6 FFFF,810A58F8 FFFF,810A58FA FFFF,810A58FC FFFF +Cheat7="Whoopie World\Infinite Time",810A58FE FFFF +Cheat8="Clowney Island\Max Tickets",810A5900 FFFF,810A5902 FFFF,810A5904 FFFF,810A5906 FFFF,810A5908 FFFF,810A590A FFFF,810A590C FFFF +Cheat9="Clowney Island\Infinite Time",810A590E FFFF +Cheat10="Paint Misbehaving\Max Tickets",810A5910 FFFF,810A5912 FFFF,810A5914 FFFF,810A5916 FFFF,810A5918 FFFF,810A591A FFFF,810A591C FFFF +Cheat11="Paint Misbehaving\Infinite Time",810A591E FFFF +Cheat12="Mine Blowing\Max Tickets",810A5920 FFFF,810A5922 FFFF,810A5924 FFFF,810A5926 FFFF,810A5928 FFFF,810A592A FFFF,810A592C FFFF +Cheat13="Mine Blowing\Infinite Time",810A592E FFFF +Cheat14="Arabian Flights\Max Tickets",810A5930 FFFF,810A5932 FFFF,810A5934 FFFF,810A5936 FFFF,810A5938 FFFF,810A593A FFFF,810A593C FFFF +Cheat15="Arabian Flights\Infinite Time",810A593E FFFF +Cheat16="Pyramid Scheme\Max Tickets",810A5940 FFFF,810A5942 FFFF,810A5944 FFFF,810A5946 FFFF,810A5948 FFFF,810A594A FFFF,810A594C FFFF +Cheat17="Pyramid Scheme\Infinite Time",810A594E FFFF +Cheat18="Food Fright\Max Tickets",810A5950 FFFF,810A5952 FFFF,810A5954 FFFF,810A5956 FFFF,810A5958 FFFF,810A595A FFFF,810A595C FFFF +Cheat19="Food Fright\Infinite Time",810A595E FFFF + + +//---- + +[2500267E-2A7EC3CE-C:45] +Name=RR64 - Ridge Racer 64 (U) +Cheat0="All Modes\Always Have 1st Place",81056444 0001 +Cheat1="All Modes\Infinite Time",811269CA 0700 +Cheat2="All Modes\Press R Button For Turbo",D103E1EA 0010,8105641A 0800 +Cheat3="Grand Prix Mode\Car Modifier",8113CF5A 00?? +Cheat3_O=$00 F/A Racing,$01 RT Ryukyu,$02 PAC Racing,$03 RT Solvalou,$04 RT Pink Mappy,$05 RT Blue Mappy,$06 Galaga RT Prid's,$07 Galaga RT Carrot,$08 RT Bosconian,$09 RT Nebulasray,$0A RT Xevious Red,$0B RT Xevious Green,$0C Dig Racing Team,$0D Micro Mouse Mappy,$0E 13th Racing Kid,$0F White Angel,$10 Digipen Racing,$11 Assoluto Infinito,$12 Age Solo Supernova,$13 Atomic Purple,$14 Extreme Green,$15 Terrazi Terrific,$16 Lizard Nightmare,$17 Screamin' Eagle,$18 Ultra 64 (Full Stats),$19 00-Agent,$1A Galaga' 88,$1B Blinky,$1C Red Shirt Rage,$1D Crazy Canuck,$1E Caddy Car,$1F Pooka +Cheat4="Grand Prix Mode\Track Modifier",8113CF6A 00?? +Cheat4_O=$00 Ridge Racer Novice,$01 Revolution Novice,$02 Renegade Novice,$03 Ridge Racer Intermediate,$04 Revolution Intermediate,$05 Renegade Intermediate,$06 Ridge Racer Expert,$07 Revolution Expert,$08 Renegade Expert,$09 Ridge Racer Extreme +Cheat5="Grand Prix Mode\Enlarge Cars",81119758 3FC0,811197AC 3FC0,81119800 3FC0 +Cheat6="Grand Prix Mode\Shrink Cars",80119758 003E,801197AC 003E,80119800 003E +Cheat7="Grand Prix Mode\Microscopic Cars",80119758 003D,801197AC 003D,80119800 003D +Cheat8="Grand Prix Mode\2 Tier Cars",80119BB0 0039 +Cheat9="Grand Prix Mode\Press GS For Overhead View",8811AB0F 0002 +Cheat10="Grand Prix Mode\Unlock\All Engine Classes All Levels",50001E08 0000,8102FAB0 0004,50001E08 0000,8102FAB2 0403 +Cheat11="Grand Prix Mode\Unlock\All Cars",8102F19C FFFF,8102F19E FFFF +Cheat12="Grand Prix Mode\Unlock\All Tracks & Trophies",81043530 FFFF,81043532 FFFF +Cheat13="Grand Prix Mode\Laps to Race",8111B32E ???? +Cheat13_O=$0101 lap,$0202 laps,$0303 laps,$0404 laps,$0505 laps,$0606 laps,$0707 laps,$0808 laps,$0909 laps +Cheat14="Grand Prix Mode\All Cars Have Perfect Stats",50008002 0000,8102F314 05DC + +//---- + +[1FC21532-0B6466D4-C:45] +Name=Rugrats in Paris - The Movie (U) +Cheat0="Red Tickets\Player 1",D00BE8C1 0000,8111F7F6 02F4 +Cheat1="Gold Tickets\Player 1",D00BE8C1 0000,8111F7F8 02F4 +Cheat2="Red Tickets\Player 2",D00BE8C1 0001,8111F7F6 02F4 +Cheat3="Gold Tickets\Player 2",D00BE8C1 0001,8111F7F8 02F4 +Cheat4="Red Tickets\Player 3",D00BE8C1 0002,8111F7F6 02F4 +Cheat5="Gold Tickets\Player 3",D00BE8C1 0002,8111F7F8 02F4 +Cheat6="Red Tickets\Player 4",D00BE8C1 0003,8111F7F6 02F4 +Cheat7="Gold Tickets\Player 4",D00BE8C1 0003,8111F7F8 02F4 + +//---- + +[EDD6E031-68136013-C:45] +Name=Rush 2 - Extreme Racing USA (U) +Cheat0="Always Place 1st",80112589 0000 +Cheat1="Have\Extra Cars",50000902 0000,810C1DBC FFFF +Cheat2="Have\Game Timer Off",800D9E88 0001 +Cheat3="Have\Midway Track",800E7D19 0001 +Cheat4="Have\Stunts All Tracks",8010C200 0001 +Cheat5="Press R to Shrink Car",D00D0193 0010,8010C43C 0001 +Cheat6="Track Modifier",8010C3F0 00?? +Cheat6_O=$00 Las Vegas,$01 New York Downtown,$02 Hawaii,$03 New York Uptown,$04 Alcatraz,$05 Los Angeles,$06 Seattle,$07 Half Pipe,$08 Crash,$09 Pipe,$0A Midway,$0B Stunt +Cheat7="Best Points\In Stunt Mode\Player 1",8010C068 00FF +Cheat8="Total Points\In Stunt Mode\Player 1",8010C075 00FF +Cheat9="Best Points\In Stunt Mode\Player 2",8010C069 00FF +Cheat10="Total Points\In Stunt Mode\Player 2",8010C077 00FF +Cheat11="Car Select\Player 1",803CB362 00?? +Cheat11_O=$00 Pickup,$01 Compact,$02 Muscle Car,$03 Mobster,$04 Sedan,$05 Bandit,$06 Coupe,$07 Exotic,$08 Van,$09 Sportster,$0A Subcompact,$0B Concept,$0C Stallion,$0D Cruiser,$0E Stallion,$0F 4x4,$10 Taxi,$11 Hot Rod,$12 Formula,$13 Prototype,$14 Rocket,$15 Mtn Dew +Cheat12="Car Select\Player 2",803CB363 00?? +Cheat12_O=$00 Pickup,$01 Compact,$02 Muscle Car,$03 Mobster,$04 Sedan,$05 Bandit,$06 Coupe,$07 Exotic,$08 Van,$09 Sportster,$0A Subcompact,$0B Concept,$0C Stallion,$0D Cruiser,$0E Stallion,$0F 4x4,$10 Taxi,$11 Hot Rod,$12 Formula,$13 Prototype,$14 Rocket,$15 Mtn Dew +Cheat13="Press R For Nitrous Boost",D00D0193 0010,810F58DC 44CB,D00D0193 0010,810F5938 44CB +Cheat14="Have\All Keys & Cans\Midway Track",810C1DD0 FFFF +Cheat15="Have\All Keys & Cans\Stunt Track",810C1DD2 FFFF +Cheat16="Front Pickup Tire Size\Player 1",800C0AC5 00?? +Cheat16_O=$00 Tiny,$01 Medium,$FF Gigantic +Cheat17="Rear Pickup Tire Size\Player 1",800C0BCD 00?? +Cheat17_O=$00 Tiny,$01 Medium,$FF Gigantic +Cheat18="Mt. Dew Front Tire Size\Player 1",800C0B19 00?? +Cheat18_O=$00 Tiny,$01 Medium,$FF Gigantic +Cheat19="Mt. Dew Rear Tire Size\Player 1",800C0C21 00?? +Cheat19_O=$00 Tiny,$01 Medium,$FF Gigantic +Cheat20="Rocket Front Tire Size\Player 1",800C0B15 00?? +Cheat20_O=$00 Tiny,$01 Medium,$FF Gigantic +Cheat21="Rocket Rear Tire Size\Player 1",800C0C1D 00?? +Cheat21_O=$00 Tiny,$01 Medium,$FF Gigantic +Cheat22="Prototype Front Tire Size\Player 1",800C0B11 00?? +Cheat22_O=$00 Tiny,$01 Medium,$FF Gigantic +Cheat23="Prototype Rear Tire Size\Player 1",800C0C19 00?? +Cheat23_O=$00 Tiny,$01 Medium,$FF Gigantic +Cheat24="Formula Front Tire Size\Player 1",800C0B0D 00?? +Cheat24_O=$00 Tiny,$01 Medium,$FF Gigantic +Cheat25="Formula Rear Tire Size\Player 1",800C0C15 00?? +Cheat25_O=$00 Tiny,$01 Medium,$FF Gigantic +Cheat26="Hot Rod Front Tire Size\Player 1",800C0B09 00?? +Cheat26_O=$00 Tiny,$01 Medium,$FF Gigantic +Cheat27="Hot Rod Rear Tire Size\Player 1",800C0C11 00?? +Cheat27_O=$00 Tiny,$01 Medium,$FF Gigantic +Cheat28="Cruiser Front Tire Size\Player 1",800C0AF9 00?? +Cheat28_O=$00 Tiny,$01 Medium,$FF Gigantic +Cheat29="Cruiser Rear Tire Size\Player 1",800C0C01 00?? +Cheat29_O=$00 Tiny,$01 Medium,$FF Gigantic +Cheat30="Van Front Tire Size\Player 1",800C0AE5 00?? +Cheat30_O=$00 Tiny,$01 Medium,$FF Gigantic +Cheat31="Van Rear Tire Size\Player 1",800C0BED 00?? +Cheat31_O=$00 Tiny,$01 Medium,$FF Gigantic +Cheat32="Pickup Front Tire Size\Player 2",800C0B1D 00?? +Cheat32_O=$00 Tiny,$01 Medium,$FF Gigantic +Cheat33="Rear Tire Size\Player 2",800C0C25 00?? +Cheat33_O=$00 Tiny,$01 Medium,$FF Gigantic +Cheat34="Misc\Auto Abort Disable",8010C168 0001 +Cheat35="Misc\Resurrect In Place",8010C210 0001 +Cheat36="Misc\New York Cabs",800D9E89 0001 +Cheat37="Misc\Car Collisions Off",8011249A 0001 +Cheat38="Misc\Cone Mines On",8010C166 0001 +Cheat39="Misc\Car Mines On",8010C167 0001 +Cheat40="Misc\Super Speed",80111950 0001 +Cheat41="Misc\Damage Off",8011CDB0 0001 +Cheat42="Misc\Light Gravity",800E7D22 0000 +Cheat43="Misc\Heavy Gravity",800E7D22 0002 +Cheat44="Misc\Jovian Gravity",800E7D22 0003 +Cheat45="Misc\Brakes Off",80125C64 0001 +Cheat46="Misc\Heavy Mass",8010C179 0001 +Cheat47="Misc\Massive Mass",8010C179 0002 +Cheat48="Misc\Invincible",80119634 0001 +Cheat49="Misc\Invisible Cars",8010C170 0001 +Cheat50="Misc\Invisible Tracks",8010C178 0001 +Cheat51="Misc\Large Frame",8010C43C 0003 +Cheat52="Misc\Killer Rats On",8010C17C 0001 +Cheat53="Misc\Inside-Out Car On",801174E0 0001 +Cheat54="Misc\Upside Down Mode",800D0171 0001 +Cheat55="Misc\Suicide Mode On",80119628 0001 +Cheat56="Misc\Suicide Mode Humans On",80119628 0002 +Cheat57="Misc\Levitation",8010C254 0001 +Cheat58="Misc\Super Tires",8010D3A6 0002 +Cheat59="Misc\Have All Cars In Pipe",810C1DCE FFFF +Cheat60="Press GS Activate Cheat Menu",880C2132 0001 +Cheat61="Misc\Your Car Is Invisible",801127A1 0001 +Cheat62="Misc\Laps to Race",8010C0E3 00?? +Cheat62_O=$01 1 Lap,$02 2 Laps,$03 3 Laps,$04 4 Laps,$05 5 Laps,$06 6 Laps,$07 7 Laps,$08 8 Laps,$09 9 Laps +Cheat63="Misc\Drones In Race",800D5761 00?? +Cheat63_O=$01 1 Lap,$02 2 Laps,$03 3 Laps,$04 4 Laps,$05 5 Laps,$06 6 Laps,$07 7 Laps +Cheat64="Misc\Difficulty Mod",8010C211 00?? +Cheat64_O=$00 Very Easy,$01 Easy,$02 Medium,$03 Hard,$04 Very Hard,$05 Extremely Hard +Cheat65="Unlock All Cheats",50000E02 0000,810C20E8 0101 +Cheat66="Have All Keys Found\Las Vegas Normal",810C1DBC FFFF +Cheat67="Have All Keys Found\New York-Downtown\Normal",810C1DBE FFFF +Cheat68="Have All Keys Found\Hawaii\Normal",810C1DC0 FFFF +Cheat69="Have All Keys Found\New York-Uptown\Normal",810C1DC2 FFFF +Cheat70="Have All Keys Found\Alcatraz\Normal",810C1DC4 FFFF +Cheat71="Have All Keys Found\Los Angeles\Normal",810C1DC6 FFFF +Cheat72="Have All Keys Found\Seattle\Normal",810C1DC8 FFFF + +//---- + +[769147F3-2033C10E-C:45] +Name=SCARS (U) +Cheat0="Have All\Cars",50000402 0000,803DF94B 0001 +Cheat1="Have All\Cups,Tracks & Challenges",50000302 0000,802CB4A9 0001,50000402 0000,803DD109 0001 +Cheat2="Infinite Credits",80388C1D 0009 +Cheat3="Max Score Points",8139AFB6 02F4 +Cheat4="Game Speed",802C9339 00?? +Cheat5="Always Have Equipped\Player 1",8039B144 00??,8039B147 00??,8039B149 0009 +Cheat6="Always Have Equipped\Player 2",8039B3E4 00??,8039B3E7 00??,8039B3E9 0009 +Cheat7="Always Have Equipped\Player 3",8039B684 00??,8039B687 00??,8039B689 0009 +Cheat8="Always Have Equipped\Player 4",8039B924 00??,8039B927 00??,8039B929 0009 +Cheat4_O=$00 Novice,$01 Default,$02 Advanced,$03 Master +Cheat5_O=$00 Turbo,$01 Magnet,$03 Stinger,$04 Boomerang,$05 Seeker,$06 Stopper,$07 Bullets,$08 Shield +Cheat6_O=$00 Turbo,$01 Magnet,$03 Stinger,$04 Boomerang,$05 Seeker,$06 Stopper,$07 Bullets,$08 Shield +Cheat7_O=$00 Turbo,$01 Magnet,$03 Stinger,$04 Boomerang,$05 Seeker,$06 Stopper,$07 Bullets,$08 Shield +Cheat8_O=$00 Turbo,$01 Magnet,$03 Stinger,$04 Boomerang,$05 Seeker,$06 Stopper,$07 Bullets,$08 Shield + +//---- + +[2A6B1820-6ABCF466-C:45] +Name=San Francisco Rush - Extreme Racing (U) +Cheat0="Activate\Stop Timer",800F4090 0001 +Cheat1="Activate\Auto Abort Disable",800F4078 0001 +Cheat2="Activate\Cones to Mines",800F3F88 0001 +Cheat3="Activate\Disable Car 2 Car Control",800F4050 0001 +Cheat4="Activate\Resurrect in Place",800F4080 0001 +Cheat5="Activate\Upside Down Mode",800F4061 0001 +Cheat6="Car",D00F40A5 0020,800D9EC1 00??,800D9F64 00??,800DA078 00??,800DA321 00?? +Cheat7="Edge Boost",D00F40A5 0010,81101331 FFFF +Cheat8="Car Type",800F40B1 00?? +Cheat9="Press GS For Track Select",88100050 00?? +Cheat10="Gravity",800F3D91 00?? +Cheat11="Always Place 1st",80101339 0000 +Cheat12="Have Two Special Cars",810CAC82 FFFF,810CAC98 FFFF,810CACAE FFFF,810CACC4 FFFF,810CACDA FFFF,810CACF0 FFFF +Cheat6_O=$08 Taxi,$09 Hot Rod,$0A F1 Car +Cheat8_O=$00 Normal Car,$01 Flat Car,$02 Fat Car,$03 Giant Car,$0A Invisible Car,$44 Super-Tiny Car #2,$66 Paper-Thin Cars,$6E Screen-Talled Cars,$BB Super-Sky Car,$CD Invisible Car (Can See Wheels),$DD Super-Sky Car #2,$FF Super-Tiny Car +Cheat9_O=$00 Track 1,$01 Track 2,$02 Track 3,$03 Track 4,$04 Track 5,$05 Track 6,$06 Track 7 +Cheat10_O=$00 A Balloon & 2 Weights,$01 Normal,$02 1 Weight,$03 2 Weights +Cheat7_N=by pressing R you will get a small speed boost that pushes you ahead. +Cheat8_N=It gets you from 0-150 in the the time it takes the F1 racer to. Don't use the F1 racer and only hold until you reach 150 or the game will freeze. +Cheat9_N=With this code, press GS when on the track selction screen and press A to select that track! +Cheat12_N=You receive the Hotrod and Taxi with this code, but you may have to go through the cars from the "Beginning" past the "Extreme" for them to appear. + +//---- + +[B9A9ECA2-17AAE48E-C:45] +Name=San Francisco Rush 2049 (U) +Cheat0="Unlock All Cheats",50000B02 0000,8111648C 0101 +Cheat1="Speed Activator",D0037AA4 0020,8114A298 ???? +Cheat2="Always Place 1st",80152906 0000 +Cheat3="Start On Lap Modifier",D014AA38 0000,8014AA38 00?? +Cheat4="Track Modifier",8014978C 00?? +Cheat5="Max Score\Stunt Mode",8115204E 7FFF +Cheat6="Infinate Ammo\All Players In Battle",80152B9D 0050,80152F55 0050,8015330D 0050,801536C5 0050 +Cheat8="Have All\Gold & Silver Coins\Track 1",8113A110 FFFF +Cheat9="Have All\Gold & Silver Coins\Track 2",8113A170 FFFF +Cheat9="Have All\Gold & Silver Coins\Track 3",8113A1D0 FFFF +Cheat10="Have All\Gold & Silver Coins\Track 4",8113A230 FFFF +Cheat11="Have All\Gold & Silver Coins\Track 5",8113A290 FFFF +Cheat12="Have All\Gold & Silver Coins\Track 6",8113A2F0 FFFF +Cheat1_O=$4333 146 mph,$4350 170 mph,$4380 210 mph,$4393 270 mph +Cheat4_O=$00 Track 1,$01 Track 2,$02 Track 3,$03 Track 4 + +//---- + +[0C814EC4-58FE5CA8-C:45] +Name=Scooby-Doo - Classic Creep Capers (U) +Cheat0="Infinite Health",81086BCA 0038,800BAF97 0007 + +//---- + +[036897CE-E0D4FA54-C:45] +Name=ShadowGate 64 - Trials of the Four Towers (U) +Cheat0="Item Modifier Codes\Position 01",800EC350 00?? +Cheat0_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat1="Item Modifier Codes\Position 02",800EC351 00?? +Cheat1_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat2="Item Modifier Codes\Position 03",800EC352 00?? +Cheat2_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat3="Item Modifier Codes\Position 04",800EC353 00?? +Cheat3_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat4="Item Modifier Codes\Position 05",800EC354 00?? +Cheat4_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat5="Item Modifier Codes\Position 06",800EC355 00?? +Cheat5_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat6="Item Modifier Codes\Position 07",800EC356 00?? +Cheat6_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat7="Item Modifier Codes\Position 08",800EC357 00?? +Cheat7_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat8="Item Modifier Codes\Position 09",800EC358 00?? +Cheat8_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat9="Item Modifier Codes\Position 10",800EC359 00?? +Cheat9_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat10="Item Modifier Codes\Position 11",800EC35A 00?? +Cheat10_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat11="Item Modifier Codes\Position 12",800EC35B 00?? +Cheat11_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat12="Item Modifier Codes\Position 13",800EC35C 00?? +Cheat12_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat13="Item Modifier Codes\Position 14",800EC35D 00?? +Cheat13_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat14="Item Modifier Codes\Position 15",800EC35E 00?? +Cheat14_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat15="Item Modifier Codes\Position 16",800EC35F 00?? +Cheat15_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat16="Item Modifier Codes\Position 17",800EC360 00?? +Cheat16_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat17="Item Modifier Codes\Position 18",800EC361 00?? +Cheat17_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat18="Item Modifier Codes\Position 19",800EC362 00?? +Cheat18_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat19="Item Modifier Codes\Position 20",800EC363 00?? +Cheat19_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat20="Item Modifier Codes\Position 21",800EC364 00?? +Cheat20_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat21="Item Modifier Codes\Position 22",800EC365 00?? +Cheat21_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat22="Item Modifier Codes\Position 23",800EC366 00?? +Cheat22_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat23="Item Modifier Codes\Position 24",800EC367 00?? +Cheat23_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat24="Item Modifier Codes\Position 25",800EC368 00?? +Cheat24_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat25="Item Modifier Codes\Position 26",800EC369 00?? +Cheat25_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat26="Item Modifier Codes\Position 27",800EC36A 00?? +Cheat26_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat27="Item Modifier Codes\Position 28",800EC36B 00?? +Cheat27_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat28="Item Modifier Codes\Position 29",800EC36C 00?? +Cheat28_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat29="Item Modifier Codes\Position 30",800EC36D 00?? +Cheat29_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat30="Item Modifier Codes\Position 31",800EC36E 00?? +Cheat30_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat31="Item Modifier Codes\Position 32",800EC36F 00?? +Cheat31_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat32="Item Modifier Codes\Position 33",800EC370 00?? +Cheat32_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat33="Item Modifier Codes\Position 34",800EC371 00?? +Cheat33_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat34="Item Modifier Codes\Position 35",800EC372 00?? +Cheat34_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat35="Item Modifier Codes\Position 36",800EC373 00?? +Cheat35_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat36="Item Modifier Codes\Position 37",800EC374 00?? +Cheat36_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat37="Item Modifier Codes\Position 38",800EC375 00?? +Cheat37_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat38="Item Modifier Codes\Position 39",800EC376 00?? +Cheat38_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat39="Item Modifier Codes\Position 40",800EC377 00?? +Cheat39_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat40="Item Modifier Codes\Position 41",800EC378 00?? +Cheat40_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat41="Item Modifier Codes\Position 42",800EC379 00?? +Cheat41_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat42="Item Modifier Codes\Position 43",800EC37A 00?? +Cheat42_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat43="Item Modifier Codes\Position 44",800EC37B 00?? +Cheat43_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat44="Item Modifier Codes\Position 45",800EC37C 00?? +Cheat44_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat45="Item Modifier Codes\Position 46",800EC37D 00?? +Cheat45_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat46="Item Modifier Codes\Position 47",800EC37E 00?? +Cheat46_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat47="Item Modifier Codes\Position 48",800EC37F 00?? +Cheat47_O=$01 Crest Key,$02 Bottle of Oil,$03 Fragments of A Crest,$04 Dragon Tears,$05 Pixie Flute,$06 Treasure,$07 Rusty Key,$08 Ornate Key,$09 The Ring of The Kingdom,$0A Orb,$0B Golden Key,$0C Liquid Sunset,$0D Night Elixir,$0E Forest Nectar,$0F Primitive Man Statue,$10 Apeman Sculpture,$11 Fairy Sculpture,$12 Elf Statue,$13 Ancient Coin,$14 Pick Axe,$15 The Ring of The Dead,$16 The Blue Ring,$17 The Green Ring,$18 Lever,$19 Slipper,$1A Dirty Slipper,$1B Pair of Slippers,$1C Jezibel's Pendant,$1D The Staff of Ages,$1E Rope,$1F Cemetery Key,$20 Flower,$21 Flint,$22 Fang,$23 Dragon Eye,$24 Dragon Flute,$25 Burning Candle,$26 Chipped Violin,$27 String-Less Violin,$28 Broken Violin,$29 Dungeon Key,$2A Map,$2B Bone,$2C Starcrest,$2D Iron Bar,$2E Crow Bar,$2F Hair of Giant,$30 Mug,$31 Water,$32 Water W/Dragon Tears,$33 Stone of Thirst,$34 Coin,$35 Coin,$36 Coin,$37 Coin,$38 Coin,$39 Nail,$3A Brooch,$3B Jewelry Box,$3C Fruit,$3D Gauntlet,$3E Cup,$3F Artwork,$40 Poisonous Herb,$41 Bracelet,$42 Precious Stone,$43 Broken Sword,$44 Quill,$45 Plate,$46 Broken Lance +Cheat48="All Items",50002402 0202,810EC350 0001,50004601 0000,800EC3D1 0003 + +//---- + +[3A4760B5-2D74D410-C:45] +Name=Shadowman (U) +Cheat0="Infinite\Air",81075B1C 0000,81075B1E 2710 +Cheat1="Infinite\Health",81075B18 0000,81075B1A 2710,81075B14 0000,81075B16 2710 +Cheat2="All Cheats Book of Shadows",81030690 0004,81030692 030B +Cheat3="Max Shadow Charge & Level",81075B20 0000,81075B22 2710,81075B24 0000,81075B26 2710 +Cheat4="Max Dark Souls Collected",81075F48 0078 +Cheat5="Health Meter Displayed On Screen",81075B10 0000,81075B12 00FF +Cheat6="Have All\Items",81030630 0000,81030632 100B,81030650 0016,81030652 130B,81030670 0018,81030672 150B,81030690 0004,81030692 030B,810306B0 001D,810306B2 180B,810306D0 0001,810306D2 000B,810306F0 000A,810306F2 080B,81030710 0002,81030712 010B,81030730 000C,81030732 0E0B,81030750 000E,81030752 0A0B,81030770 0009,81030772 070B,81030790 000B,81030792 090B,810307B0 0007,810307B2 060B,810307D0 001A,810307D2 160B,810307F0 0015,810307F2 120B,81030810 001E,81030812 190B,810308B0 0017,810308B2 140B,81030830 0012,81030832 0F0B,81030850 0003,81030852 020B,81030870 000D,81030872 0B0B,810308F0 0006,810308F2 050B,81030950 0014,81030952 110B,810309D0 0005,810309D2 040B,80030E57 000F +Cheat7="Have All\Ammo",81075B28 0000,81075B2A 2710,81075B2E 0063,81075B36 03E7,81075B32 03E7,81075B3A 03E7,810306D6 7FFF,81030736 7FFF,810307D6 7FFF,81030816 7FFF,81030876 7FFF,81030816 7FFF,810306D6 FFFF,81030736 FFFF,810307D6 FFFF,81030816 FFFF,81030876 FFFF,81030816 FFFF +Cheat8="Have All\Warp Levals",800309F2 0001,80030A0E 0001,80030A2A 0001,80030A46 0001,80030A62 0001,80030A7E 0001,80030A9A 0001,80030AB6 0001,80030AD2 0001,80030AEE 0001,80030B0A 0001,80030B26 0001,80030B42 0001,80030B5E 0001,80030B7A 0001,80030B96 0001,80030BB2 0001 +Cheat9="Always Play As Deadwing Character",80075F52 0001 +Cheat10="Have L-Eclipser\La Lune",80030971 0010,80030973 0D0B +Cheat11="Have L-Eclipser\La Soleil",80030991 001C,80030993 170B +Cheat12="Have L-Eclipser\La Lame",800309B1 0011,800309B3 0C0B +Cheat10_N=If you put all Three of these Options on together, you skip straight to being Shadow Man. +Cheat11_N=If you put all Three of these Options on together, you skip straight to being Shadow Man. +Cheat12_N=If you put all Three of these Options on together, you skip straight to being Shadow Man. + +//---- + +[DBF4EA9D-333E82C0-C:45] +Name=Snowboard Kids (U) +Cheat0="Infinite\Tools Options",80122295 00?? +Cheat0_O=$01 Fan,$02 Ghost,$03 Pan,$04 Rock,$05 Mouse,$06 Board +Cheat1="Infinite\Lucky Dip",80122294 0003 +Cheat2="999 Trick Game Pts",81122040 03E7 +Cheat3="1 Lap Race",D0122288 0000,80122288 0009 +Cheat4="Infinite\Cash",801222EA C350 +Cheat5="Enable Sinobin",8110AE5E 0100 +Cheat6="Access Gold Medals",50000602 0000,810ECA22 0101 +Cheat1_N="Lucky Dip is Infinite Usage Of What Ever You Get From Each Red Box" + +//---- + +[930C29EA-939245BF-C:45] +Name=Snowboard Kids 2 (U) +Cheat0="All Gold Medals",50000502 0000,81259130 0101 +Cheat1="Max Coins",8125A5BE 270F,8025A5BF 00C8 +Cheat2="Infinite\Trick Game 300 Points",8125A7F2 012C +Cheat3="Infinite\Tools Options",8025A624 00?? +Cheat3_O=$01 Frying Pan,$02 Ghost,$03 Super Ghost,$04 Fan,$05 Rocket,$06 Invisible,$07 Rock,$08 Rat Face,$09 Super Rat Face,$0A Wings +Cheat4="Infinite\Weapons Options",8025A622 00??,8025A623 0009 +Cheat4_O=$01 Slap Stick,$02 Parachute,$03 Freeze Shot,$04 Snowman,$05 Bomb,$06 Whirlwind +Cheat5="Open Extra Characters & Snowboards",8125916E 0101,80259170 0001,8025915C 0001,8125915E 0101,81259160 0101 +Cheat5_N=Battle Mode Only + +//---- + +[7ECBE939-3C331795-C:45] +Name=South Park (U) +Cheat0="Have all Cheats",810CD226 01FF +Cheat0_N=Go into the Cheats From the main Menu & put on the Ones you want + +//---- + +[C00CA948-8E60D34B-C:45] +Name=South Park - Chef's Luv Shack (U) +Cheat0="Max Or No Score\Player 1",81104772 ???? +Cheat1="Max Or No Score\Player 2",81104776 ???? +Cheat2="Max Or No Score\Player 3",8110477A ???? +Cheat3="Max Or No Score\Player 4",8110477E ???? +Cheat0_O=$FFFF Max Score,$0000 No Score +Cheat1_O=$FFFF Max Score,$0000 No Score +Cheat2_O=$FFFF Max Score,$0000 No Score +Cheat3_O=$FFFF Max Score,$0000 No Score + +//---- + +[07F3B276-EC8F3D39-C:45] +Name=South Park Rally (U) +Cheat0="Unlock All Characters & Extra Cheats",81088750 FFFF,81088752 FFFF +Cheat1="Have All\Races",81088756 FFFF +Cheat2="Have All\Tracks",8108875A FFFF +Cheat3="Infinite Credits",8008D659 0063 + +//---- + +[BFE23884-EF48EAAF-C:45] +Name=Silicon Valley (U) +Cheat0="Infinite\Ability\Sheep",811DE9A0 0400 +Cheat1="Infinite\Ability\Mouse",811DFCC8 0400 +Cheat2="Infinite\Boost\Mouse",811DFCC4 0400 +Cheat3="Infinite\Ability\Penguin",811E009C 0400 +Cheat4="Infinite\Ability\Husky",811DED78 0400 +Cheat5="Infinite\Ability\Rabbit",811DE5D0 0400 +Cheat6="Infinite\Ability\Heli-Rabbit",811DF14C 0400 +Cheat7="Infinite\Boost\Walrus",811DED74 0400 +Cheat8="Infinite\Ability\Walrus",811DE5D0 0400 +Cheat9="Infinite\Ability\Racing Dog",811DF14C 0400 +Cheat10="Infinite\Boost\Racing Dog",811DF148 0400 +Cheat11="Infinite\Ability\Ram",811DE5D0 0400 +Cheat12="Infinite\Ability\Racing Fox",811DF8F4 0082 +Cheat13="Infinite\Boost\Racing Fox",811DF8F0 0400 +Cheat14="Infinite\Ability\Springy Thing",811DF14C 0400 +Cheat15="Infinite\Ability\Fox",811DF8F4 0400 +Cheat16="Infinite\Boost\Fox",811DF8F0 0400 +Cheat17="Infinite\Energy\EVO (Chip)",801DE065 0082 +Cheat18="Infinite\Energy\Evo\in Bonus Level 1 & Final Level",801DE439 0082 +Cheat19="Infinite\Energy\Evo\In Bonus Level 4",801DEFB5 0082 +Cheat20="Infinite Health\Ship\in Asteroids Level",803E4CDB 0003 +Cheat21="Infinite\Energy\Mouse,Hyena",801DFB31 0082 +Cheat22="Infinite\Energy\Snow Husky",811DFF04 0082 +Cheat23="Infinite\Energy\Normal Rabbit",811DE438 0082 +Cheat24="Infinite\Energy\Heli-Rabbit",811DEFB4 0082 +Cheat25="Infinite\Energy\Sheep",811DEBE0 0082 +Cheat26="Infinite\Energy\Normal Penguin",811DFF04 0082 +Cheat27="Infinite\Energy\Dog",811DFF04 0082 +Cheat28="Infinite\Energy\Racing Dog",811DEFB4 0082 +Cheat29="Infinite\Energy\Ram",811DE438 0082 +Cheat30="Infinite\Energy\Racing Fox",811DF7FC 0082 +Cheat31="Infinite\Energy\Springy Thing",811DEFB4 0082 +Cheat32="Infinite\Energy\Fox",811DF75C 0082 +Cheat33="Have All\Secret Mini Game",803F643D 0001 +Cheat34="Always\Raining",803F2D6F 0005 +Cheat35="Always\Snowing",803F2D6D 0005 +Cheat36="Have All\Power Cells",803F2D3D 000F +Cheat37="Debug Mode",803F642F 0001 +Cheat39="High Score",813F2D30 007F,813F2D32 FFFF +Cheat38="All Levels Open",50002001 0000,803F7DE0 0001 + +//---- + +[EBFE2397-FF74DA34-C:45] +Name=Space Invaders (U) +Cheat0="Infinite\Lives",800B51DD 0063 +Cheat1="Infinite\Points",810B51E2 FFFF +Cheat2="Always Have\Vertical Burst",810B51DE 0104 +Cheat3="Always Have\Horizontal Right",810B51DE 0204 +Cheat4="Always Have\Horizontal Left",810B51DE 0304 +Cheat5="Always Have\Diagonal Burst",810B51DE 0404 +Cheat6="Infinite\Shield",810B51B6 0001 + +//---- + +[A60ED171-3D85D06E-C:45] +Name=Spider-Man (U) +Cheat0="Unlocked\All Costumes",810ECD7E FFFF +Cheat1="Unlocked\All Levels",810ECD74 0105,810ECDB0 FFFF +Cheat2="Have All Characters In Viewer",810ECD80 FFFF,810ECD82 FFFF +Cheat3="Infinite\Health",800F5F26 0001 +Cheat4="Infinite\Webbing",800F5F53 0001 + +//---- + +[0684FBFB-5D3EA8A5-C:45] +Name=StarCraft 64 (U) +Cheat0="Infinite\& Max Minerals",50000C04 0000,810B1D46 FFFF,50000C04 0000,810B1D44 3B9A,50000C04 0000,810B1D46 C9FF +Cheat1="Infinite\& Max Vespene Gas",50000C04 0000,810B1D76 FFFF,50000D04 0000,810B1D74 3B9A,50000D04 0000,810B1D76 C9FF +Cheat2="All levels complete",800D13C4 000C,800D13C5 000A,800D13C6 000A,800D13C7 000A,800D13C8 000A,800D13C9 000A + +//---- + +[A7D015F8-2289AA43-C:45] +Name=Star Fox 64 (U) +Cheat0="Unlimited\Boost",81137C9C 0000,81137C9E 0000,8113AB7C 0000,8113AB7E 0000 +Cheat1="Have All Medals",50000802 0000,8116E6E0 7777 +Cheat2="Infinite\Hyper Laser",8015791B 0002 +Cheat3="Loads O' Hits",8015790B 00FF +Cheat4="Infinite\Armor\Slippy",8016D72B 00FF +Cheat5="Infinite\Energy",8013AB27 00FF,80137C47 00FF +Cheat6="Infinite\Lives",80157911 0009 +Cheat7="Unlimited\Smart Bombs",8016DC13 0004 +Cheat8="Infinite\Armor\Falco",8016D727 00FF +Cheat9="Infinite\Armor\Peppy",8016D72F 00FF +Cheat10="Infinite\Dual Blue Lasers",8015791B 0002 +Cheat11="Level Select",D016E0A7 0000,8016E0A7 00?? +Cheat11_O=$00 Corneria,$01 Meteo,$02 Sector X,$03 Area 6,$04 Glitch,$05 Sector Y,$06 Venom 1,$07 Solar,$08 Zoness,$09 Venom 2,$0A Training Mode Level,$0B Macbeth,$0C Titania,$0D Aquas,$0E Fortuna,$10 Katina,$11 Bolse,$12 Sector Z,$13 Venom With Starwolf,$14 Corneria (Multi) +Cheat1_N=For Expert & Normal Modes + +//---- + +[BA780BA0-0F21DB34-C:45] +Name=Star Fox 64 (U) (V1.1) +Cheat0="Unlimited\Boost",8113C68C 0000,8113C68E 0000,8113F56C 0000,8113F56E 0000 +Cheat1="Have All Medals",50000802 0000,81178870 7777 +Cheat2="Infinite\Dual Blue Lasers",80161AAB 0002 +Cheat3="Loads O' Hits",80161A9B 00FF +Cheat4="Infinite\Armor\Slippy",801778BB 00FF +Cheat5="Infinite\Energy\Player 1",8013C637 00FF,8013F517 00FF +Cheat6="Infinite\Lives",80161AA1 0009 +Cheat7="Unlimited\Smart Bombs",80177DA3 0004 +Cheat8="Infinite\Armor\Falco",801778B7 00FF +Cheat9="Infinite\Armor\Peppy",801778BF 00FF +Cheat10="Level Select",80178237 00?? +Cheat10_O=$00 Corneria,$01 Meteo,$02 Sector X,$03 Area 6,$04 Glitch,$05 Sector Y,$06 Venom 1,$07 Solar,$08 Zoness,$09 Venom 2,$0A Training Mode Level,$0B Macbeth,$0C Titania,$0D Aquas,$0E Fortuna,$10 Katina,$11 Bolse,$12 Sector Z,$13 Venom With Starwolf,$14 Corneria (Multi) +Cheat1_N=For Expert & Normal Modes +Cheat5_N=For Solo & Multi Player +Cheat11="Infinite Health\Player 2",8013CB17 00FF,8013F9F7 00FF +Cheat12="Infinite Health\Player 3",8013CFF7 00FF,8013FED7 00FF +Cheat13="Infinite Health\Player 4",8013D4D7 00FF,801403B7 00FF +Cheat14="Infinite Smart Bombs\Player 2",80177DA7 0004 +Cheat15="Infinite Smart Bombs\Player 3",80177DAB 0004 +Cheat16="Infinite Smart Bombs\Player 4",80177DAF 0004 +Cheat17="Infinite Dual Blue Lasers\Player 2",80161AAF 0002 +Cheat18="Infinite Dual Blue Lasers\Player 3",80161AB3 0002 +Cheat19="Infinite Dual Blue Lasers\Player 4",80161AB7 0002 +Cheat20="Infinite Boost\Player 2",8113CB6C 0000,8113CB6E 0000,8113FA4C 0000,8113FA4E 0000 +Cheat21="Infinite Boost\Player 3",8113D04C 0000,8113D04E 0000,8113FF2C 0000,8113FF2E 0000 +Cheat22="Infinite Boost\Player 4",8113D52C 0000,8113D52E 0000,8114040C 0000,8114040E 0000 + +//---- + +[DDD93C85-DAE381E8-C:45] +Name=Star Soldier: Vanishing Earth (U) +Cheat0="Infinite\Lives",800A3648 0003 +Cheat1="Infinite\Specials",800A3649 0003 +Cheat2="Extra Armor",800A362F 0001 +Cheat3="Play As",800A364C 00?? +Cheat3_O=$00 Character 1,$01 Character 2,$02 Character 3 +Cheat4="Max\Score",810A3624 03E7 +Cheat5="Max\Upper Level",800A3659 0063 +Cheat6="Max\Lower Level",800A3658 0003 +Cheat7="Max\Combo",810A3644 7FFF +Cheat8="Status Modifier",800A364A 00?? +Cheat8_O=$01 High,$02 Mid,$03 Low + +//---- + +[72F70398-6556A98B-C:45] +Name=Star Wars EP1 Pod Racer (U) +Cheat0="No Damage",800A52D7 0001 +Cheat0_N=If when Racing Your Pod Over heats & bursts into flames Press "R" & you will Repair the Damage. +Cheat2="Always 1st",81118FEC 0001 +Cheat1="Infinite Truguts",81113E7A FFFF,81113E78 7FFF +Cheat3="Enable In-Game cheat Menu & Cheats",8009B7D7 0001,8109B7DA FFFF +Cheat3_N=Here you can Activate the IN-Built Cheats Menu. At the Front Screen Just Press C-Button Right.This will open up All Tracks & Characters In Free Play & Time Attack. Also In A Race, Press The Start/Pause button to Access the In-Cheat-Menu Option.You can also choose how many Pod's Racers are in the Race & also how many Laps are in the Race in Free Play & Time Attack +Cheat4="Unlock All Tracks & Characters",80113E68 00FF,80113E69 00FF,80113E6A 00FF,80113E6B 00FF,81113E68 FFFF,81113E6A FFFF,80113E74 007D,81113E76 FFFF +Cheat4_N=When using Unlock All Tracks & Characters For can to pick & choose what ever you want to play As & where ;) +Cheat5="Have All Tracks Completed",81113E6A FFFF,81113E6C 3FFF,81113E6E 3FFF,81113E70 3FFF,81113E72 00FF + +//---- + +[264D7E5C-18874622-C:45] +Name=Star Wars - Shadows of the Empire (U) (V1.0) +Cheat0="All Levels\Infinite\Lives",800E05CB 0064 +Cheat1="All Levels\Infinite\Missiles",800E1265 00FF +Cheat2="All Stages\Invincible",8107A770 2400 +Cheat3="All Stages\Infinite Health",81072D0C 2400 +Cheat4="All Stages\Lasers Never Overheat",81073948 2400 +Cheat5="All Stages\Upper Lasers",81073944 3C06,81073946 4EFF +Cheat5_N=Don't Use With Never Overheat Code +Cheat6="All Stages\Infinite\Pulse Ammo",81074204 2400 +Cheat7="All Stages\Infinite\Flame Ammo",81073720 2400 +Cheat8="All Stages\Infinite\Seeker Ammo",81073A94 2400 +Cheat9="All Stages\Infinite\Stunner Ammo",81073BD4 2400 +Cheat10="All Stages\Infinite\Disruptor Ammo",81073F04 2400 +Cheat11="All Stages\Infinite\Jet Pack",81076AAC 2400,81076C58 2400,81076B48 2400 +Cheat12="All Levels\Time Always 0:00:02",810E04E8 4000 +Cheat13="All Levels\No Clipping\Off",81111E67 0001 +Cheat14="All Levels\No Clipping\On",81111E67 0000 +Cheat15="All Levels\Visibililty\Maximum",800BA62B FFFF +Cheat16="All Levels\Visibililty\Minimum",800BA66B FFFF +Cheat17="All Levels\Large Mutant Enemies",800BB62B FFFF +Cheat18="All Levels\Dash Becomes Shorter & Wider",800BA025 FFFF +Cheat19="All Levels\See Through\Some Walls",800BC625 FFFF +Cheat20="All Levels\See Through\Everything Except Specific Things",800BC665 FFFF +Cheat21="Press GS For Pink Cheat Debug Screen",890D017F 0001 + +//---- + +[4147B091-63251060-C:45] +Name=Star Wars - Shadows of the Empire (U) (V1.1) +Cheat0="Press GS For Pink Cheat Debug Screen",890D01BF 0001 + +//---- + +[635A2BFF-8B022326-C:45] +Name=SUPER MARIO 64 +Cheat0="Press GS For 255 Coins",8933B218 00FF +Cheat1="Have\Level Select",A032D58C 0001 +Cheat2="Don't Hurt Mario\Monsters",A033B197 0001 +Cheat3="Infinite\Lives",8033B21D 0064 +Cheat4="Infinite\Energy & Breath",8033B21E 0008 +Cheat5="Have\Debug Mode",A032D598 00?? +Cheat5_O=$01 On,$00 Off +Cheat6="Mario's Cap\Off Options",8033B177 00?? +Cheat6_N=Here you can Choose Options with Mario without His Cap on,Do not use with any other Mario with/without Options,Use only one at a time +Cheat6_O=$01 Mario No Cap,$02 Invisible Mario,$04 Metal Mario,$08 Flying Mario,$0A Invisible Flying Mario,$0D Metal Flying Mario,$0F Invisible Metal Flying Mario +Cheat7="Mario's Cap\On Options",8033B177 00?? +Cheat7_N=Here you can Choose Options with Mario with His Cap on,Do not use with any other Mario with/without Options,Use only one at a time +Cheat7_O=$12 Invisible Mario,$15 Metal Mario,$16 Invisible Metal Mario,$19 Flying Mario +Cheat8="Funny Mario Options\Mario's Cap\Off & in His Hand",8033B177 00?? +Cheat8_N=Here you can Choose Options with Mario with His Cap off & in His Hand,Do not use with any other Mario with/without Options,Use only one at a time +Cheat8_O=$20 Cap In Hand,$22 Invisible Mario Cap In Hand,$24 Metal Mario Cap In Hand,$26 Invisible Metal Mario Cap In Hand,$28 Flying Mario Cap In Hand +Cheat9="Funny Mario Options\Mario's Cap\On & An Extra in His Hand",8033B177 00?? +Cheat9_N=Here you can Choose Options with Mario with His Cap on & An Extra in His Hand,Do not use with any other Mario with/without Options,Use only one at a time +Cheat9_O=$30 Cap In Hand,$32 Invisible Mario Cap In Hand,$34 Metal Mario Cap In Hand,$36 Invisible Metal Mario Cap In Hand,$38 Flying Mario Cap In Hand +Cheat10="Don't Hurt Mario\Falling",8033B22C 00E8,8133B178 FFFF +Cheat11="Press L To Levitate",D033AFA1 0020,8133B1BC 4220,D033B1BD 0020,8133B17C 0300,D033B1BD 0020,8133B17E 0880 +Cheat11_N=Press L to levitate & Let go to land +Cheat12="[Slot A Codes]\Have All 120 Stars",80207723 0001,8020770B 00C7,50001101 0000,8020770C 00FF +Cheat12_N=Have 120 Stars,once the Code is activated, you will see it as a new option in Save Slot A.This will have the Cannon open already to get upto Yoshi on the Roof. but make sure to save the game after collecting Red Coins and turn this code off before saving. you will now have it all saved to mempak +Cheat13="[Slot A Codes]\Have all key doors unlocked (and mote empty)",8020770A 007E +Cheat14="[Slot A Codes]\Have All Max 100 Coin Records For All Levels",50000F01 0000,80207725 0064 +Cheat15="[Slot B Codes]\Have All 120 Stars",80207793 0001,8020777B 00C7,50001101 0000,8020777C 00FF +Cheat15_N=Have 120 Stars,once the Code is activated, you will see it as a new option in Save Slot A.This will have the Cannon open already to get upto Yoshi on the Roof. but make sure to save the game after collecting Red Coins and turn this code off before saving. you will now have it all saved to mempak +Cheat16="[Slot B Codes]\Have all key doors unlocked (and mote empty)",8020777A 007E +Cheat17="[Slot B Codes]\Have All Max 100 Coin Records For All Levels",50000F01 0000,80207795 0064 +Cheat18="[Slot C Codes]\Have All 120 Stars",80207803 0001,802077EB 00C7,50001101 0000,802077EC 00FF +Cheat18_N=Have 120 Stars,once the Code is activated, you will see it as a new option in Save Slot A.This will have the Cannon open already to get upto Yoshi on the Roof. but make sure to save the game after collecting Red Coins and turn this code off before saving. you will now have it all saved to mempak +Cheat19="[Slot C Codes]\Have all key doors unlocked (and mote empty)",802077EA 007E +Cheat20="[Slot C Codes]\Have All Max 100 Coin Records For All Levels",50000F01 0000,80207805 0064 +Cheat21="[Slot D Codes]\Have All 120 Stars",80207873 0001,8020785B 00C7,50001101 0000,8020785C 00FF +Cheat21_N=Have 120 Stars,once the Code is activated, you will see it as a new option in Save Slot A.This will have the Cannon open already to get upto Yoshi on the Roof. but make sure to save the game after collecting Red Coins and turn this code off before saving. you will now have it all saved to mempak +Cheat22="[Slot D Codes]\Have all key doors unlocked (and mote empty)",8020785A 007E +Cheat23="[Slot D Codes]\Have All Max 100 Coin Records For All Levels",50000F01 0000,80207875 0064 +Cheat24="Level Select",D033AFA1 0020,A032DDF9 00?? +Cheat24_O=$01 Intro,$04 Big Boo's Haunt,$05 Cool Cool Mountain,$06 Mushroom Castle,$07 Hazy Maze Cave,$08 Shifting Sand Land,$09 Bob omb Battlefield,$0A Snowman's Land,$0B Wet Dry World,$0C Jolly Roger Bay,$0D Tiny Huge World,$0E Tick tock Clock,$0F Rainbow Ride,$10 Mushroom Castle Field,$11 Bowser In The Dark World,$12 Vanish Cap Under The Moat,$13 Bowser In The Fire Sea,$14 The Secret Aquarium,$15 Bowser In The Sky,$16 Lethal Lava Land,$17 Dire Dire Docks,$18 Whomp's Fortress,$19 The End,$1A Castle Courtyard,$1B The Princess's Secret Slide,$1C Cavern Of The Metal Cap,$1D Tower Of The Wing Cap,$1E Bowser In The Dark World Boss,$1F Wing Mario Over The Rainbow,$21 Bowser In The Fire Sea Boss,$22 Bowser In The Sky Boss,$24 Tall Tall Mountain +Cheat24_N=Select a Level. Jump Into a Painting. Press A at the Stars Collected Screen. As Stats are fading hold L, and you'll jump to the level you've selected. +Cheat25="Have\Turbo Running Speed",8033B1C3 00FF + +//---- + +[916B8B5B-780B85A4-C:45] +Name=SMASH BROTHERS +Cheat0="Give Kirby A Wierd Blow-Up",8025E158 000A +Cheat1="Story Mode\Skip Straight To Master Hand",800A4AE7 000D +Cheat2="Story Mode\Infinite Time",810A4B2E 43CB +Cheat3="Story Mode\Player 1\Infinite Lives",800A4B43 0004 +Cheat4="Story Mode\Player 2\Infinite Lives",800A4BB7 0004 +Cheat5="Story Mode\Player 3\Infinite Lives",800A4C2B 0004 +Cheat6="Story Mode\Player 4\Infinite Lives",800A4C9F 0004 +Cheat7="Story Mode\Player 1\Low % Health",810A4B86 0000 +Cheat8="Story Mode\Player 2\Low % Health",810A4BFA 0000 +Cheat9="Story Mode\Player 3\Low % Health",810A4C6E 0000 +Cheat10="Story Mode\Player 4\Low % Health",810A4CE2 0000 +Cheat11="Story Mode\Player 1\Character Modifier",800A4B3B 00?? +Cheat12="Story Mode\Player 2\Character Modifier",800A4BAF 00?? +Cheat13="Story Mode\Player 3\Character Modifier",800A4C23 00?? +Cheat14="Story Mode\Player 4\Character Modifier",800A4C97 00?? +Cheat15="Story Mode\Player 1\Kirby B Button Move\Hyrule Castle",80268B0F 00?? +Cheat16="Story Mode\Player 1\Kirby B Button Move\Yoshi's Island",80268E4F 00?? +Cheat17="Story Mode\Player 1\Kirby B Button Move\Sector Z",802710F7 00?? +Cheat18="Story Mode\Player 1\Kirby B Button Move\Peach's Castle",80263D9F 00?? +Cheat19="Story Mode\Player 1\Kirby B Button Move\Saffron City",80273A97 00?? +Cheat20="Story Mode\Player 1\Kirby B Button Move\Congo Jungle",80270ACF 00?? +Cheat21="Story Mode\Player 1\Kirby B Button Move\Kirby's Dreamland",8026DB3F 00?? +Cheat22="Story Mode\Player 1\Kirby B Button Move\Planet Zebes",8026FFA7 00?? +Cheat23="Story Mode\Player 1\Kirby B Button Move\Metal Mario Stage",80263597 00?? +Cheat24="Story Mode\Player 1\Kirby B Button Move\Fighting Polygon Team",8026271F 00?? +Cheat25="Story Mode\Player 1\Kirby B Button Move\Master Hand Stage",80271C4F 00?? +Cheat26="VS. Mode\Infinite Time",810A4D1E 43CB +Cheat27="VS. Mode\Player 1\Low % Health",810A4D76 0000 +Cheat28="VS. Mode\Player 2\Low % Health",810A4DEA 0000 +Cheat29="VS. Mode\Player 3\Low % Health",810A4E5E 0000 +Cheat30="VS. Mode\Player 4\Low % Health",810A4ED2 0000 +Cheat31="VS. Mode\Player 1\Character Modifier",800A4D2B 00?? +Cheat32="VS. Mode\Player 2\Character Modifier",800A4D9F 00?? +Cheat33="VS. Mode\Player 3\Character Modifier",800A4E13 00?? +Cheat34="VS. Mode\Player 4\Character Modifier",800A4E87 00?? +Cheat35="VS. Mode\Player 1\Kirby B Button Move\Hyrule Castle",802639EF 00?? +Cheat36="VS. Mode\Player 1\Kirby B Button Move\Yoshi's Island",8026E2B7 00?? +Cheat37="VS. Mode\Player 1\Kirby B Button Move\Sector Z",8026BF87 00?? +Cheat38="P1 Press Down On D-Pad To Make Items Appear In Random Spots",D109EFA4 0400,8118D0A2 0001 +Cheat39="Have All Characters",810A4938 0FF0 +Cheat40="VS. Mode\Have Mushroom Kindom",800A4937 00FF +Cheat41="Story Mode\Always Get Pacifist (60,000 Points)",810A4B6E 0000 +Cheat42="Bonus Stage Character Modifier (Training Mode)",8018F1D3 00?? +Cheat11_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat12_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat13_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat14_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat15_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat16_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat17_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat18_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat19_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat20_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat21_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat22_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat23_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat24_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat25_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat31_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat32_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat33_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat34_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat35_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat36_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat37_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat42_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat11_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code could also result freezing at the end of the Level. +Cheat12_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat13_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat14_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat31_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat32_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat33_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat34_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat42_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat43="Enable Item Switch Menu (All Modes)",811348E2 0004 +Cheat43_N=Go into Vs Mode & then Vs Options & then Press Up On the D-Pad Or Analogue Stick & then click the A Button to enter the Item Switch Menu. This Cheat Works For All Modes +Cheat44="Story Mode\Player 1\Stage Select",D1045188 0010,800A4AE7 00?? +Cheat44_O=$00 Stage 1 (Vs Link),$01 Stage 2 (Vs Yoshi Team vs 18),$02 Stage 3 (Vs Fox McCloud),$03 Bonus Stage 1,$04 Stage 4 (Freezes?),$05 Stage 5 (Vs Pikachu),$06 Stage 6 (Freezes?),$07 Bonus Stage 2,$08 Stage 7 (Vs Kirby Team vs8),$09 Stage 8 (Vs Samus Aran),$0A Stage 9 (Vs Metal Mario),$0B Bonus Stage 3 (Race To The Finish),$0C Stage 10 (Fighting Polygon Team vs30),$0D Final Stage (Vs Master Hand) + +//---- + +[A2E8F35B-C9DC87D9-C:45] +Name=Superman (U) +Cheat0="Fly Through 1st & Last Ring Only To Complete Challenge",801442E9 0063 +Cheat1="Infinite Freezing Breath",8122CDE8 42C8 +Cheat2="Infinite Health",8122CDD4 42C8 +Cheat3="Infinite Laser Eye",8122CDE4 42C8 +Cheat4="Infinite Running Boosts",8122CDDC 42C8 +Cheat5="Infinite X-Ray Vision",8122CDE0 42C8 + +//---- + +[3C1FDABE-02A4E0BA-C:45] +Name=Tetrisphere (U) +Cheat0="Single & VS Mode\Infinite Misses\Player 1",80112F9F 0003 +Cheat1="Single & VS Mode\Infinite Misses\Player 2",80116207 0003 +Cheat2="Single & VS Modes\Secret Cheat Menu",8011265F 00AD +Cheat3="Single Player Stage Select",810E12DC 0001 + +//---- + +[63E7391C-E6CCEA33-C:45] +Name=Tom and Jerry in Fists of Furry (U) +Cheat0="Unlock All Characters",810E44F2 00FF +Cheat1="Open All Versus Arenas",810E44F4 03FF +Cheat2="Infinite Health\Player 1",810E279C 42C8 +Cheat3="One Hit To Kill\Player 1",810E2A74 3F80 +Cheat4="One Hit To Kill\Player 2",810E2D4C 3F80 +Cheat5="Always Have Weapon Options\Player 1",810E2994 00?? +Cheat6="Always Have Weapon Options\Player 2",810E2C6C 00?? +Cheat7="Infinite Health\Player 2",810E2A74 42C8 +Cheat8="Infinite Time",810FED4C 42F0 +Cheat5_O=$79 Anvil,$03 Club,$04 Bird bath,$08 Broom,$09 NCube knife,$0A NCube missiles,$0B Chair,$0C Champagne,$0E Chicken,$0F Crate,$14 Deck chair,$16 Egg,$1A Fish,$1D Gardeners Fork,$1E Frying Pan,$1F Wooden Chair,$29 Bouy,$2A Mallet,$2B Watermelon,$2D Milk Bottle,$39 Plank,$41 Rolling Pin,$46 Spade,$47 Stool,$48 Tennis Racket,$4E Spanner,$55 Stick,$63 Blue Swordfish,$64 Saucepan,$65 Wooden Spoon,$6B Stool,$6D Bee hive,$78 Mooses head, +Cheat6_O=$79 Anvil,$03 Club,$04 Bird bath,$08 Broom,$09 NCube knife,$0A NCube missiles,$0B Chair,$0C Champagne,$0E Chicken,$0F Crate,$14 Deck chair,$16 Egg,$1A Fish,$1D Gardeners Fork,$1E Frying Pan,$1F Wooden Chair,$29 Bouy,$2A Mallet,$2B Watermelon,$2D Milk Bottle,$39 Plank,$41 Rolling Pin,$46 Spade,$47 Stool,$48 Tennis Racket,$4E Spanner,$55 Stick,$63 Blue Swordfish,$64 Saucepan,$65 Wooden Spoon,$6B Stool,$6D Bee hive,$78 Mooses head, +Cheat0_N=This Gives you all Characters to choose from plus fixes A freeze on the Charecter Select Menu by having it on + +//---- + +[392A0C42-B790E77D-C:45] +Name=RAINBOW SIX +Cheat0="All Missions Unlocked",810C1F10 000B +Cheat2="Infinite Ammo",8103A180 2400 +Cheat1="Infinite Health",8105518A 2400 + +//---- + +[204EC022-B119D185-C:45] +[204EC022-B119D185-C:45] +Name=Tony Hawk's Pro Skater (U) +Cheat0="Officer Dick\Have All\Tapes",50000901 0000,800DDE08 00FF +Cheat1="Officer Dick\Have All\Gold Medal\Burnside",800DDE0E 00FF +Cheat2="Officer Dick\Have All\Gold Medal\Skate Park",800DDE0B 00FF +Cheat3="Officer Dick\Have All\Gold Medal\Roswell",800DDE10 00FF +Cheat4="Tony Hawk\Have All\Tapes",50000901 0000,800DDD40 00FF +Cheat5="Tony Hawk\Have All\Gold Medal\Burnside Portland",800DDD46 00FF +Cheat6="Tony Hawk\Have All\Gold Medal\Skate Park Chicago",800DDD43 00FF +Cheat7="Tony Hawk\Have All\Gold Medal\Roswell",800DDD48 00FF +Cheat8="Bob Burnquist\Have All\Tapes",50000901 0000,800DDD54 00FF +Cheat9="Bob Burnquist\Have All\Gold Medal\Burnside Portland",800DDD5A 00FF +Cheat10="Bob Burnquist\Have All\Gold Medal\Skate Park Chicago",800DDD57 00FF +Cheat11="Bob Burnquist\Have All\Gold Medal\Roswell",800DDD5C 00FF +Cheat12="Geoff Rowley\Have All\Tapes",50000901 0000,800DDD68 00FF +Cheat13="Geoff Rowley\Have All\Gold Medal\Burnside Portland",800DDD6E 00FF +Cheat14="Geoff Rowley\Have All\Gold Medal\Skate Park Chicago",800DDD6B 00FF +Cheat15="Geoff Rowley\Have All\Gold Medal\Roswell",800DDD70 00FF +Cheat16="Bucky Lasek\Have All\Tapes",50000901 0000,800DDD7C 00FF +Cheat17="Bucky Lasek\Have All\Gold Medal\Burnside Portland",800DDD82 00FF +Cheat18="Bucky Lasek\Have All\Gold Medal\Skate Park Chicago",800DDD7F 00FF +Cheat19="Bucky Lasek\Have All\Gold Medal\Roswell",800DDD84 00FF +Cheat20="Chad Muska\Have All\Tapes",50000901 0000,800DDD90 00FF +Cheat21="Chad Muska\Have All\Gold Medal\Burnside Portland",800DDD96 00FF +Cheat22="Chad Muska\Have All\Gold Medal\Skate Park Chicago",800DDD93 00FF +Cheat23="Chad Muska\Have All\Gold Medal\Roswell",800DDD98 00FF +Cheat24="Kareem Campbell\Have All\Tapes",50000901 0000,800DDDA4 00FF +Cheat25="Kareem Campbell\Have All\Gold Medal\Burnside Portland",800DDDAA 00FF +Cheat26="Kareem Campbell\Have All\Gold Medal\Skate Park Chicago",800DDDA7 00FF +Cheat27="Kareem Campbell\Have All\Gold Medal\Roswell",800DDDAC 00FF +Cheat28="Andrew Reynolds\Have All\Tapes",50000901 0000,800DDDB8 00FF +Cheat29="Andrew Reynolds\Have All\Gold Medal\Burnside Portland",800DDDBE 00FF +Cheat30="Andrew Reynolds\Have All\Gold Medal\Skate Park Chicago",800DDDBB 00FF +Cheat31="Andrew Reynolds\Have All\Gold Medal\Roswell",800DDDC0 00FF +Cheat32="Rune Glifberg\Have All\Tapes",50000901 0000,800DDDCC 00FF +Cheat33="Rune Glifberg\Have All\Gold Medal\Burnside Portland",800DDDD2 00FF +Cheat34="Rune Glifberg\Have All\Gold Medal\Skate Park Chicago",800DDDCF 00FF +Cheat35="Rune Glifberg\Have All\Gold Medal\Roswell",800DDDD4 00FF +Cheat36="Jamie Thomas\Have All\Tapes",50000901 0000,800DDDE0 00FF +Cheat37="Jamie Thomas\Have All\Gold Medal\Burnside Portland",800DDDE6 00FF +Cheat38="Jamie Thomas\Have All\Gold Medal\Skate Park Chicago",800DDDE3 00FF +Cheat39="Jamie Thomas\Have All\Gold Medal\Roswell",800DDDE8 00FF +Cheat40="Elissa Steamer\Have All\Tapes",50000901 0000,800DDDF4 00FF +Cheat41="Elissa Steamer\Have All\Gold Medal\Burnside Portland",800DDDFA 00FF +Cheat42="Elissa Steamer\Have All\Gold Medal\Skate Park Chicago",800DDDF7 00FF +Cheat43="Elissa Steamer\Have All\Gold Medal\Roswell",800DDDFC 00FF +Cheat44="Have All Tracks",813D6E42 FFFF,813D4FFA FFFF,813D5D62 FFFF,813D84E2 FFFF,813D4FCA FFFF,813D5F2A FFFF,813D8C52 FFFF,813D5602 FFFF,813D6D3A FFFF +Cheat45="Player 1\Tony Hawk\Full Special All Levels",D00C0223 0000,813D6576 02EE,D00C0223 0001,813D4728 02EE,D00C0223 0002,813D5496 02EE,D00C0223 0003,813D7C16 02EE,D00C0223 0004,813D467E 02EE,D00C0223 0005,813D565E 02EE,D00C0223 0006,813D8386 02EE,D00C0223 0007,813D4D36 02EE,D00C0223 0008,813D646E 02EE +Cheat46="Player 1\Max Points\The Warehouse",813D6E42 FFFF +Cheat47="Player 1\Max Points\The School",813D4FFA FFFF +Cheat48="Player 1\Max Points\The Mall",813D5D62 FFFF +Cheat49="Player 1\Max Points\The Skate Park",813D84E2 FFFF +Cheat50="Player 1\Max Points\Downtown Chicago",813D4FCA FFFF +Cheat5="Player 1\Max Points\Downhill Jam",813D5F2A FFFF +Cheat5="Player 1\Max Points\Burnside",813D8C52 FFFF +Cheat5="Player 1\Max Points\Street",813D5602 FFFF +Cheat5="Player 1\Max Points\Roswell New Mexico",813D6D3A FFFF +Cheat5="Player 1\Super Max\Ollie",800D561C FFFF +Cheat5="Player 1\Super Max\Speed",800D561D FFFF +Cheat5="Player 1\Super Max\Air",800D561E FFFF +Cheat5="Player 1\Super Max\Balance",800D561F FFFF +Cheat59="Player 1\Super Max\Turning",800D5620 FFFF +Cheat60="Player 2\Super Max\Ollie",800D5621 FFFF +Cheat61="Player 2\Super Max\Speed",800D5622 FFFF +Cheat62="Player 2\Super Max\Air",800D5623 FFFF +Cheat63="Player 2\Super Max\Balance",800D5624 FFFF +Cheat64="Player 2\Super Max\Turning",800D5625 FFFF +Cheat65="Player 1\Play As",800D03D4 00?? +Cheat65_O=$ 00 Tony Hawk,$ 01 Bob Burnquist,$ 02 Geoff Rowley,$ 03 Bucky Lasek,$ 04 Chad Muska,$ 05 Kareem Campbell,$ 06 Andrew Reynolds,$ 07 Rune Glifberg,$ 08 Jamie Thomas,$ 09 Elissa Steamer,$ 0A Officer Dick +Cheat66="Player 2\Play As",800D03D5 00?? +Cheat66_O=$00 Tony Hawk,$01 Bob Burnquist,$02 Geoff Rowley,$03 Bucky Lasek,$04 Chad Muska,$05 Kareem Campbell,$06 Andrew Reynolds,$07 Rune Glifberg,$08 Jamie Thomas,$09 Elissa Steamer,$0A Officer Dick +Cheat67="Player 1\Have Perfect Balance",800DDB83 0001 +Cheat68="Player 1\Max Trick Score\The Warehouse",813D6E42 FFFF +Cheat69="Player 1\Max Trick Score\The School",813D4FFA FFFF +Cheat70="Player 1\Max Trick Score\The Mall",813D5D62 FFFF +Cheat71="Player 1\Max Trick Score\The Skate Park Course",813D84E2 FFFF +Cheat72="Player 1\Max Trick Score\Downtown",813D4FCA FFFF +Cheat73="Player 1\Max Trick Score\Downhill Jam",813D5F2A FFFF +Cheat74="Player 1\Max Trick Score\Burnside",813D8C52 FFFF +Cheat75="Player 1\Max Trick Score\The Streets",813D5602 FFFF +Cheat76="Player 1\Max Trick Score\Roswell",813D6D3A FFFF + +//---- + +[99150E18-1266E6A5-C:45] +Name=Tony Hawk's Pro Skater 2 (U) +Cheat0="Infinte Time",810E87AA 0000 +Cheat1="Unlock\Spider Man",800E9DD8 0001,800F0B9B 0001 +Cheat2="Unlock\Officer Dick",800E9DDC 0001,800F087B 0001 +Cheat3="1 Million Points",8119054C 000F,8119054E 4240 +Cheat4="All Gaps\Hanger",800E9CC5 00FF,810E9CC6 FFFF +Cheat5="All Gaps\Marseille",810E9CDC FFFF,810E9CDE FFFF,800E9CE3 000F +Cheat6="All Gaps\Philadelphia",810E9D0C FFFF,810E9D0E FFFF,810E9D12 0FFF +Cheat7="All Gaps\School II",810E9CD0 FFFF,810E9CD2 FFFF,810E9CD6 0FFF +Cheat8="All Gaps\Skatestreet",810E9D00 FFFF,810E9D02 FFFF,800E9D07 000F +Cheat9="All Gaps\Venice Beach",810E9CF4 FFFF,810E9CF6 FFFF,810E9CFA 0FFF +Cheat10="All Tricks Available\Custom Player 1",810E9454 FFFF,810E9456 FFFF,810E9458 FFFF,810E945A FFFF,810E945C FFFF,810E945E FFFF +Cheat11="All Tricks Available\Custom Player 2",810E9538 FFFF,810E953A FFFF,810E953C FFFF,810E953E FFFF,810E9540 FFFF,810E9542 FFFF +Cheat12="All Tricks Available\Custom Player 3",810E961C FFFF,810E961E FFFF,810E9620 FFFF,810E9622 FFFF,810E9624 FFFF,810E9626 FFFF +Cheat13="All Tricks Available\Custom Player 4",810E9700 FFFF,810E9702 FFFF,810E9704 FFFF,810E9706 FFFF,810E9708 FFFF,810E970A FFFF +Cheat14="Tricks Available\Bob Burnquist",810E89A4 FFFF,810E89A6 FFFF,810E89A8 FFFF,810E89AA FFFF,810E89AC FFFF,810E89AE FFFF +Cheat15="Tricks Available\Chad Muska",810E8FE0 FFFF,810E8FE2 FFFF,810E8FE4 FFFF,810E8FE6 FFFF,810E8FE8 FFFF,810E8FEA FFFF +Cheat16="Tricks Available\Eric Koston",810E8D34 FFFF,810E8D36 FFFF,810E8D38 FFFF,810E8D3A FFFF,810E8D3C FFFF,810E8D3E FFFF +Cheat17="Tricks Available\Elissa Steamer",810E928C FFFF,810E928E FFFF,810E9290 FFFF,810E9292 FFFF,810E9294 FFFF,810E9296 FFFF +Cheat18="Tricks Available\Geoff Rowley",810E91A8 FFFF,810E91AA FFFF,810E91AC FFFF,810E91AE FFFF,810E91B0 FFFF,810E91B2 FFFF +Cheat19="Tricks Available\Jamie Thomas",810E9370 FFFF,810E9372 FFFF,810E9374 FFFF,810E9376 FFFF,810E9378 FFFF,810E937A FFFF +Cheat20="Tricks Available\Kareem Campbell",810E8B6C FFFF,810E8B6E FFFF,810E8B70 FFFF,810E8B72 FFFF,810E8B74 FFFF,810E8B76 FFFF +Cheat21="Tricks Available\Officer Dick",810E97E4 FFFF,810E97E6 FFFF,810E97E8 FFFF,810E97EA FFFF,810E97EC FFFF,810E97EE FFFF +Cheat22="Tricks Available\Rune Glifberg",810E8C50 FFFF,810E8C52 FFFF,810E8C54 FFFF,810E8C56 FFFF,810E8C58 FFFF,810E8C5A FFFF +Cheat23="Tricks Available\Rodney Mullen",810E8EFC FFFF,810E8EFE FFFF,810E8F00 FFFF,810E8F02 FFFF,810E8F04 FFFF,810E8F06 FFFF +Cheat24="Tricks Available\Steve Caballero",810E8A88 FFFF,810E8A8A FFFF,810E8A8C FFFF,810E8A8E FFFF,810E8A90 FFFF,810E8A92 FFFF +Cheat25="Tricks Available\Spider Man",810E99AC FFFF,810E99AE FFFF,810E99B0 FFFF,810E99B2 FFFF,810E99B4 FFFF,810E99B6 FFFF +Cheat26="Tricks Available\Tony Hawk",810E88C0 FFFF,810E88C2 FFFF,810E88C4 FFFF,810E88C6 FFFF,810E88C8 FFFF,810E88CA FFFF +Cheat27="Tricks Available\Andrew Reynolds",810E90C4 FFFF,810E90C6 FFFF,810E90C8 FFFF,810E90CA FFFF,810E90CC FFFF,810E90CE FFFF +Cheat28="Max Cash\Officer Dick",810E975C 000F,810E975E 423F,810E9760 000F,810E9762 423F +Cheat29="Max Cash\Andrew Reynolds",810E903C 000F,810E903E 423F,810E9040 000F,810E9042 423F +Cheat30="Max Cash\Bob Burnquist",810E891C 000F,810E891E 423F,810E8920 000F,810E8922 423F +Cheat31="Max Cash\Bucky Lasek",810E8D90 000F,810E8D92 423F,810E8D94 000F,810E8D96 423F +Cheat32="Max Cash\Chad Muska",810E8F58 000F,810E8F5A 423F,810E8F5C 000F,810E8F5E 423F +Cheat33="Max Cash\Eric Koston",810E8CAC 000F,810E8CAE 423F,810E8CB0 000F,810E8CB2 423F +Cheat34="Max Cash\Elissa Steamer",810E9204 000F,810E9206 423F,810E9208 000F,810E920A 423F +Cheat35="Max Cash\Geoff Rowley",810E9120 000F,810E9122 423F,810E9124 000F,810E9126 423F +Cheat36="Max Cash\Jamie Thomas",810E92E8 000F,810E92EA 423F,810E92EC 000F,810E92EE 423F +Cheat37="Max Cash\Kareem Campbell",810E8AE4 000F,810E8AE6 423F,810E8AE8 000F,810E8AEA 423F +Cheat38="Max Cash\Rune Glifberg",810E8BC8 000F,810E8BCA 423F,810E8BCC 000F,810E8BCE 423F +Cheat39="Max Cash\Rodney Mullen",810E8E74 000F,810E8E76 423F,810E8E78 000F,810E8E7A 423F +Cheat40="Max Cash\Steve Caballero",810E8A00 000F,810E8A02 423F,810E8A04 000F,810E8A06 423F +Cheat41="Max Cash\Custom Player 1",810E93CC 000F,810E93CE 423F,810E93D0 000F,810E93D2 423F +Cheat42="Max Cash\Custom Player 2",810E94B0 000F,810E94B2 423F,810E94B4 000F,810E94B6 423F +Cheat43="Max Cash\Custom Player 3",810E9594 000F,810E9596 423F,810E9598 000F,810E959A 423F +Cheat44="Max Cash\Custom Player 4",810E9678 000F,810E967A 423F,810E967C 000F,810E967E 423F +Cheat45="All Complete\Bob Burnquist",810E8924 FFFF,810E8926 FFFF,810E8928 FFFF,810E892A FFFF,810E892C FFFF,810E892E FFFF,810E8930 FFFF,810E8932 FFFF +Cheat46="All Complete\Tony Hawk",810E8840 FFFF,810E8842 FFFF,810E8844 FFFF,810E8846 FFFF,810E8848 FFFF,810E884A FFFF,810E884C FFFF,810E884E FFFF +Cheat47="Always Special On Cheat",800E9DEC 0001 +Cheat48="Perfect Balance Cheat",800E9DE8 0001 +Cheat49="Unlock Hoffman Factory & Skate Heaven",800EA0CB 003F +Cheat50="Access In-Game Cheat Menu",50001104 0000,800E9DD8 0001 + +//---- + +[1A7F70B5-00B7B9FD-C:45] +Name=Tony Hawk's Pro Skater 3 (U) +Cheat0="Tony Hawk\All Levels Open,Gold Medals & Goals Compleated",800ED8F8 00FF,50001001 0000,800ED908 00FF +Cheat1="Tony Hawk\Have all 5of5 Stat Points & All Decks",50000F04 0000,800ED934 00FF +Cheat2="Steve Caballero\All Levels Open,Gold Medals & Goals Compleated",800ED9D4 00FF,50001001 0000,800ED9E4 00FF +Cheat3="Steve Caballero\Have all 5of5 Stat Points & All Decks",50000F04 0000,800EDA10 00FF +Cheat4="Kareem Campbell\All Levels Open,Gold Medals & Goals Compleated",800EDAB0 00FF,50001001 0000,800EDAC0 00FF +Cheat5="Kareem Campbell\Have all 5of5 Stat Points & All Decks",50000F04 0000,800EDAEC 00FF +Cheat6="Rune Glifberg\All Levels Open,Gold Medals & Goals Compleated",800EDB8C 00FF,50001001 0000,800EDB9C 00FF +Cheat7="Rune Glifberg\Have all 5of5 Stat Points & All Decks",50000F04 0000,800EDBC8 00FF +Cheat8="Eric Koston\All Levels Open,Gold Medals & Goals Compleated",800EDC68 00FF,50001001 0000,800EDC78 00FF +Cheat9="Eric Koston\Have all 5of5 Stat Points & All Decks",50000F04 0000,800EDCA4 00FF +Cheat10="Bucky Lasek\All Levels Open,Gold Medals & Goals Compleated",800EDD44 00FF,50001001 0000,800EDD54 00FF +Cheat11="Bucky Lasek\Have all 5of5 Stat Points & All Decks",50000F04 0000,800EDD80 00FF +Cheat12="Rodney Mullen\All Levels Open,Gold Medals & Goals Compleated",800EDE20 00FF,50001001 0000,800EDE30 00FF +Cheat13="Rodney Mullen\Have all 5of5 Stat Points & All Decks",50000F04 0000,800EDE5C 00FF +Cheat14="Chad Muska\All Levels Open,Gold Medals & Goals Compleated",800EDEFC 00FF,50001001 0000,800EDF0C 00FF +Cheat15="Chad Muska\Have all 5of5 Stat Points & All Decks",50000F04 0000,800EDF38 00FF +Cheat16="Andrew Rynolds\All Levels Open,Gold Medals & Goals Compleated",800EDFD8 00FF,50001001 0000,800EDFE8 00FF +Cheat17="Andrew Rynolds\Have all 5of5 Stat Points & All Decks",50000F04 0000,800EE014 00FF +Cheat18="Geoff Rowley\All Levels Open,Gold Medals & Goals Compleated",800EE0B4 00FF,50001001 0000,800EE0C4 00FF +Cheat19="Geoff Rowley\Have all 5of5 Stat Points & All Decks",50000F04 0000,800EE0F0 00FF +Cheat20="Elissa Steamer\All Levels Open,Gold Medals & Goals Compleated",800EE190 00FF,50001001 0000,800EE1A0 00FF +Cheat21="Elissa Steamer\Have all 5of5 Stat Points & All Decks",50000F04 0000,800EE1CC 00FF +Cheat22="Jamie Thomas\All Levels Open,Gold Medals & Goals Compleated",800EE26C 00FF,50001001 0000,800EE27C 00FF +Cheat23="Jamie Thomas\Have all 5of5 Stat Points & All Decks",50000F04 0000,800EE2A8 00FF +Cheat24="Bam Margera\All Levels Open,Gold Medals & Goals Compleated",800EE348 00FF,50001001 0000,800EE358 00FF +Cheat25="Bam Margera\Have all 5of5 Stat Points & All Decks",50000F04 0000,800EE384 00FF +Cheat26="Skater A\All Levels Open,Gold Medals & Goals Compleated",800EE424 00FF,50001001 0000,800EE434 00FF +Cheat27="Skater A\Have all 5of5 Stat Points & All Decks",50000F04 0000,800EE460 00FF +Cheat28="Skater B\All Levels Open,Gold Medals & Goals Compleated",800EE500 00FF,50001001 0000,800EE510 00FF +Cheat29="Skater B\Have all 5of5 Stat Points & All Decks",50000F04 0000,800EE53C 00FF +Cheat30="Skater C\All Levels Open,Gold Medals & Goals Compleated",800EE5DC 00FF,50001001 0000,800EE5EC 00FF +Cheat31="Skater C\Have all 5of5 Stat Points & All Decks",50000F04 0000,800EE618 00FF +Cheat32="Officer Dick\All Levels Open,Gold Medals & Goals Compleated",800EE6B8 00FF,50001001 0000,800EE6C8 00FF +Cheat33="Officer Dick\Have all 5of5 Stat Points & All Decks",50000F04 0000,800EE6F4 00FF +Cheat34="Wolverine\All Levels Open,Gold Medals & Goals Compleated",800EE794 00FF,50001001 0000,800EE7A4 00FF +Cheat35="Wolverine\Have all 5of5 Stat Points & All Decks",50000F04 0000,800EE7D0 00FF +Cheat36="Infinite Stat Upgrades & Deck Boards to Buy",800ED8F9 00FF,800ED905 00FF,800EDD45 00FF,800EDD51 00FF,800EDFE5 00FF,800EDFD9 00FF,800ED9D5 00FF,800ED9E1 00FF,800EDAB1 00FF,800EDABD 00FF,800EDB8D 00FF,800EDB99 00FF,800EDC69 00FF,800EDC75 00FF,800EDE21 00FF,800EDE2D 00FF,800EDEFD 00FF,800EDF09 00FF,800EE0B5 00FF,800EE0C1 00FF,800EE191 00FF,800EE19D 00FF,800EE26D 00FF,800EE279 00FF,800EE349 00FF,800EE355 00FF,800EE425 00FF,800EE431 00FF,800EE501 00FF,800EE50D 00FF,800EE5DD 00FF,800EE5E9 00FF,800EE6B9 00FF,800EE6C5 00FF,800EE795 00FF,800EE7A1 00FF +Cheat37="Play As",800E9D69 00?? +Cheat37_O=$00 Tony Hawk,$01 Steve Caballero,$02 Kareem Campbell,$03 Rune Glifberg,$04 Eric Koston,$05 Bucky Lasek,$06 Rodney Mullen,$07 Chad Muska,$08 Andrew Rynolds,$09 Geoff Rowley,$0A Elissa Steamer,$0B Jamie Thomas,$0C Bam Margera,$0D Skater A,$0E Skater B,$0F Skater C,$10 Officer Dick,$11 Wolverine +Cheat38="Timer Starts Off At 20 Mins",800E9D64 FFFF +Cheat39="Play On Level",800ED58F 00?? +Cheat39_O=$00 Foundary,$01 Los Angeles,$02 Rio De Janeiro,$03 Suburbia,$04 Airport,$05 Skater Island,$06 Canada,$07 Tokyo,$08 Downhill,$09 Custom +Cheat39_N=This allows you to play on a level even if it isnt already open just choose & tick choose foundary or what ever level & play the one you selected +Cheat36_N=This allows you to ugrade you stats in Upgrades to the Max & Also to open the Boards in Decks For All Characters. + +//---- + +[8ECC02F0-7F8BDE81-C:45] +Name=Top Gear Hyper-Bike (U) +Cheat0="Access All\Bikes",810FBCBE FFFF +Cheat1="Access All\Tracks",810FBCC2 FFFF +Cheat2="Infinite\Nitro",810B8E4C 42C8 +Cheat3="Infinite\Nitro Always On",810BB5A4 8004 +Cheat4="Laps 2 Race",8016FC88 00?? +Cheat4_O=$01 1 Lap,$02 2 laps,$03 3 Laps,$04 4 Laps,$05 5 Laps,$06 6 Laps,$07 7 Laps,$08 8 Laps,$09 9 Laps + +//---- + +[D741CD80-ACA9B912-C:45] +Name=Top Gear Overdrive (U) +Cheat0="Extra Cars & Tracks",801022F0 0001,5000020A 0000,801022F1 000E,811022E8 0501,50000302 0000,811022EA 0101 +Cheat1="Infinite Money",810F50C4 270F +Cheat2="Infinite Nitro",810F50CE 0009 +Cheat3="Laps 2 Race",801185E0 00?? +Cheat3_O=$01 1 Lap,$02 2 laps,$03 3 Laps,$04 4 Laps,$05 5 Laps,$06 6 Laps,$07 7 Laps,$08 8 Laps,$09 9 Laps +Cheat4="Level Modifier (Championship & Vs Mode)",8011D0B0 00?? +Cheat4_O=$00 Frigid Peaks - Snowy/Daytime,$01 Fertile Canyon - Day/Lightning,$02 Swampy Depot - Day/Rainbow,$03 Downtown - Clear/Rainbow,$04 Sandy Beaches - Day/Lightning,$05 Fertile Canyon - Night + +//---- + +[62269B3D-FE11B1E8-C:45] +Name=Top Gear Rally (U) +Cheat0="Have 1-6 Level Points",50000602 0000,8032685F 0064 +Cheat1="Extra Cars & Tracks",50000201 0000,8032690C 00FF,8032690F 00FF,813243CC FFFF +Cheat2="Only Race 1 Lap Championship Mode",8031EBDB 0002 +Cheat3="Always Place 1st",8131C70E 0000 + +//---- + +[BE5973E0-89B0EDB8-C:45] +Name=Top Gear Rally 2 (U) +Cheat0="Always 1st",810318E2 0001 +Cheat1="No Damage Or Failures",81030D76 0001 +Cheat2="100.000 Sponsor Credits & 950 Championship Points In Support Van",80030D82 00F3 +Cheat2_N=You Also Have Access To All Cars, Tracks & Extra Features +Cheat3="No Cones Hit",81031CEA 0000 +Cheat3_N=In ARSG Rally School +Cheat4="No Navigator",80032677 0000 +Cheat5="Max Sponsor Credits",81033816 270F +Cheat6="Infinite Time & Always Place 1st",810318EE 0001 +Cheat6_N=Championship Mode Only. +Cheat7="Max Sponsor Points & Extra Cars & Tracks",81033816 270F +Cheat7_N=This code gives you all tracks and cars. once you activate this code, You must make an internal save (Native) in options & then load that internal save, & go to Drivers Board to pick your car, Then to Race to pick your track + +//---- + +[A150743E-CF2522CD-C:45] +Name=Toy Story 2 (U) +Cheat0="Have 99 coins",810BB10E 0063 +Cheat1="Have all 5 collectables",801C7A72 0005 +Cheat2="Infinite Lives",800BB10A 0009 +Cheat3="Infinite Battery Power",810BB106 000E +Cheat4="Hold jump to fly",810BB0FC 0002 + +//---- + +[2F70F10D-5C4187FF-C:45] +Name=Turok: Dinosaur Hunter (U) (v1.0) +Cheat0="Infinite\Body Armor",81128CE6 5B23,80128D27 0001 +Cheat1="Infinite\Air",81129030 AAE1,811E85EA F1FF +Cheat2="Have\All Level Keys",50000604 0000,80128D33 0007,80128D4B 001F,80128D6B 00FF +Cheat3="Have\All Weapons",50000B04 0000,80128CF7 0001,80128D23 0001 +Cheat4="Infinite\Ammo",50000404 0000,80128CB3 00FF,80128CC3 00FF,80128CCF 00FF,50000504 0000,80128CD3 00FF,80128E5B 00FF,80128E57 00FF +Cheat5="Diffuculty Modifier",801195DF 00?? +Cheat5_O=$00 Easy,$01 Normal,$02 Hard +Cheat6="Infinite\Health",812C1584 1E61,812A24F4 1E61 +Cheat7="Have\Backpack",80128CEB 0001,80128D2B 0001 +Cheat8="Open All Portals",8114F8CA F803,50000604 0000,81128D4E 0003,81128D66 0005 +Cheat8_N=Press L to Access Map +Cheat9="Infinite\Lives",8005E689 0098,8105E6A0 2400,8005E6AD 0083 +Cheat10="Have\Cheat Menu",81119540 FFFF,81119542 FFFF + +//---- + +[2F700DCD-176CC5C9-C:45] +Name=Turok: Dinosaur Hunter (U) (v1.1) +Cheat0="Infinite\Body Armor",81128E36 5B23,80128E77 0001 +Cheat1="Infinite\Air",81129180 AAE1,811E873A F1FF +Cheat2="Have\All Level Keys",50000604 0000,80128E83 0007,80128E9B 001F,80128EBB 00FF +Cheat3="Have\All Weapons",50000B04 0000,80128E47 0001,80128E73 0001 +Cheat4="Infinite\Ammo",50000404 0000,80128E03 00FF,80128E13 00FF,80128E1F 00FF,50000504 0000,80128E23 00FF,80128FAB 00FF,80128FA7 00FF +Cheat5="Diffuculty Modifier",8011972F 00?? +Cheat5_O=$00 Easy,$01 Normal,$02 Hard +Cheat6="Infinite\Health",812C16D4 1E61,812A2644 1E61 +Cheat7="Have\Backpack",80128E3B 0001,80128E7B 0001 +Cheat8="Open All Portals",8114FA1A F803,81128E9E 0003,81128EA2 0003,81128EA6 0003,81128EAA 0003,81128EAE 0003,81128EB2 0003,81128EB6 0005 +Cheat8_N=Press L to Access Map +Cheat9="Infinite\Lives",8005E7D9 0098,8105E7F0 2400,8005E7FD 0083 +Cheat10="Have\Cheat Menu",81119690 FFFF,81119692 FFFF + +//---- + +[ADB9498B-DAF28F55-C:45] +Name=Turok: Rage Wars (U) +Cheat0="Player 1\Have All\Mini Game Icons",800FCB17 0024 +Cheat1="Player 1\Infinite\Proximity Mines",8033653D 00FF +Cheat2="Player 1\Infinite\Metal Claws",80336541 00FF +Cheat3="Player 1\Infinite\Sentry Guns",8033653F 00FF +Cheat4="Player 1\Infinite\Cerebral Bores",8033653B 00FF +Cheat5="Player 1\Infinite\Health",81336526 6400,80692B86 0064 +Cheat6="Player 1\Infinite Ammo",80336535 0063,80336537 0063,80336539 0063,80692B95 0063,80692B97 0063,80692B99 0063,80692B9B 0063,80692B9D 0063,80692B9F 0063,80692BA1 0063 +Cheat7="Player 1\Play As",80140358 00?? +Cheat7_O=$00 Turok,$01 Mantid,$02 Drone,$03 Fireborn,$04 Soldier,$05 Adon,$06 Lord Of The Dead,$07 Elite Guard,$08 Blind One,$09 Juggernaut,$0A Death Guard,$0B Bastile,$0C Syra,$0D Symbiont,$0E Tail Set,$0F Pur-Lin,$10 Symbiont,$11 Raptor,$12 Mites,$13 Monkey +Cheat8="Level Select\Proving Ground-Tightrope",8014BD9F 00?? +Cheat8_O=$00 Proving Grounds,$01 Basic Training,$02 Crossroads,$03 Grim Retreat,$04 Cathedral,$05 Fall Out,$06 Boxed Set,$07 Dire Straight,$08 Prey,$09 Warehouse,$0A Water Temple,$0B Bomb Shelter,$0C Tempered,$0D Earth Temple,$0E Fire Temple,$0F Mystic,$10 Bottleneck,$11 Tightrope, +Cheat9="Level Select\The Pit-Starlight",8014BD9F 00?? +Cheat9_O=$12 The Pit,$13 Leap Of Faith,$14 Wicked Dance,$15 Bunker,$16 Ampatheater,$17 Fire Walker,$18 Crypts,$19 Breakdown,$1A Retaliation,$1B Hopeless,$1C Matrix,$1D Fathom,$1E The Pedestal,$1F Defcon 5,$20 Spirit Temple,$21 Stronghold,$22 Courtyard,$23 Starlight +Cheat10="Player 1\Infinite\Time",811407F4 47AF,811407F6 C4B1 +Cheat11="Player 1\Have All\Medals",810FCB4A FFFF,810FCB4C FFFF,810FCB4E FFFF,800FCB50 0003 +Cheat12="Player 1\Start With Weapon",803366B0 00?? +Cheat12_O=$00 Warhammer,$01 Boomerang,$02 Tek Crossbow,$03 Mag 60,$04 Shotgun,$05 Assault Rifle,$06 Mini Gun,$07 Plasma Rifle,$08 Freeze Gun,$09 Flaregun,$0A Grenade Launcher,$0B Scorpion Launcher,$0C Napalm Gel,$0D Emaciator,$0E Inflator,$0F Chest Burster,$10 Raptor Claw,$11 Mite Bite,$12 Cerebral Bore,$13 PFM Mine,$14 Iron Claw,$15 Sentry Turret +Cheat8_N=Do Not use this with Level Select The Pit-Starlight. Only use One Level Select Option At A Time +Cheat9_N=Do Not use this with Level Select Proving Ground-Tightrope. Only use One Level Select Option At A Time + +//---- + +[E8C95AFC-35D121DA-C:45] +Name=Turok 2: Seeds of Evil (U) (Kiosk) +Cheat0="Infinite\Health",80305446 0064,80648FA6 0064 +Cheat1="99 Gems",80305449 0063,80648FA9 0063 +Cheat2="Infinite\Ammo",50000302 0000,81305868 0063,50000304 0000,81305872 0063,5000020E 0000,81305882 0063,50000302 0000,816493C8 0063,50000304 0000,816493D2 0063,5000020E 0000,816493E2 0063 + +//---- + +[49088A11-6494957E-C:45] +Name=Turok 2: Seeds of Evil (U) +Cheat0="Player 1\Have All\Weapons",D12FC912 0000,812FC912 0101,D12FC914 0000,812FC914 0101,D12FC916 0000,812FC916 0101,D12FC918 0000,812FC918 0101,D12FC91A 0000,812FC91A 0101,D12FC91C 0000,812FC91C 0101,D12FC91E 0000,812FC91E 0101,D12FC920 0000,812FC920 0101,D12FC922 0000,812FC922 0101,D12FC924 0000,812FC924 0101,D12FC926 0000,812FC926 0101,D12FC928 0000,812FC928 0101,D12FC92A 0000,812FC92A 0101,D12FC92C 0000,812FC92C 0101,D12FC92E 0000,812FC92E 0101,D12FC930 0000,812FC930 0101,D12FC932 0000,812FC932 0101,806FE742 0001,806FE743 0001,806FE744 0001,806FE745 0001,806FE746 0001,806FE747 0001,806FE748 0001,806FE749 0001,806FE74A 0001,806FE74B 0001,806FE74C 0001,806FE74D 0001,806FE74E 0001,806FE74F 0001,806FE750 0001,806FE751 0001,806FE752 0001,806FE753 0001,806FE754 0001,806FE756 0001,806FE757 0001,806FE758 0001,806FE759 0001,806FE75A 0001,806FE75B 0001,806FE75C 0001,806FE75E 0001,806FE75F 0001,806FE760 0001,806FE761 0001,806FE762 0001,806FE763 0001,806FE764 0001 +Cheat1="Player 1\Infinite\Health",812FC4C6 0064,816FE2F6 6400 +Cheat2="Player 1\99 Gems",812FC4C8 0063,806FE2F8 0063 +Cheat3="Player 1\Infinite\Ammo",802FC499 0000,50000302 0000,812FC8D4 0063,812FC8DE 0063,812FC8E2 0063,50000A02 0000,812FC8E6 0063,50000302 0000,816FE704 0063,816FE70E 0063,816FE712 0063,50000802 0000,816FE716 0063,816FE72C 0063,816FE730 0063 +Cheat4="Player 1\Have All\Keys,Nuke,Evrything",802FC602 0030,802FC60C 0030,802FC616 0030,802FC620 0030,50000601 0000,802FC634 0030,50000501 0000,802FC648 0030,50000401 0000,802FC65C 0030,50000601 0000,802FC99C 0030,802FC4E0 0033,802FC4E5 0033,802FC4EA 0033,802FC594 0033,802FC530 0033,802FC53A 0033,802FC53B 0033,802FC5B0 0033,802FC5B1 0033,802FC5B2 0033,802FC5B3 0033,806FE432 0030,806FE43C 0030,806FE446 0030,806FE450 0030,50000601 0000,806FE464 0030,50000501 0000,806FE478 0030,50000501 0000,806FE48C 0030,50000601 0000,806FE4CC 0030,806FE310 0033,806FE315 0033,806FE31A 0033,806FE360 0033,806FE36A 0033,806FE36B 0033,806FE3C4 0033,50000401 0000,806FE3E0 0033,50000601 0000,8059D61A 0001,50000D01 0000,8059D620 0001,50000401 0000,8059D62E 0001 +Cheat5="Player 2\Infinite\Health",812F723E 0064,8059D1CE 0064 +Cheat6="Player 2\Infinite\Ammo",50000602 0000,812F767C 0063,812F764C 013C,812F764E 013C,50000302 0000,812F7654 013C,812F7660 013C,812F7664 013C,812F766A 013C,812F766C 013C,812F7674 013C,812F7678 013C,8159D5DC 013C,8159D5DE 013C,8159D5E4 013C,8159D5E8 013C,8159D5EA 013C,8159D5F0 013C,8159D5F4 013C,8159D5FA 013C,8159D5FC 013C,8159D604 013C,8159D608 013C,50000602 0000,8159D60C 013C +Cheat7="Player 2\99 Gems",812F7240 0063 + +//---- + +[89A579F1-667E97EF-C:45] +Name=Turok 3: Shadow of Oblivion (U) +Cheat0="Have PSG",8033343A 0001 +Cheat1="Have Cerebral Bore",80333437 0001 +Cheat2="Have All Secrets",811659C6 FFFF,811659C4 FFFF +Cheat3="Have Grenade Launcher",80333434 0001 +Cheat4="Infinite Life Force",813334FC 0063 +Cheat5="Infinite Health",81332FDA 6400 +Cheat6="Infinite Arrows",81333408 0064 +Cheat7="Infinite Pistol Ammo",8133340E 0063 +Cheat8="Infinite Shotgun Ammo",81333412 0064 +Cheat9="Infinite Grenade Gun Ammo",8133340A 0064 +Cheat10="Infinite Firestorm Cannon Ammo",81333410 0064 +Cheat11="Have Pistol",8033342A 0001 +Cheat12="Have Shotgun",80333430 0001 + +//---- + +[033F4C13-319EE7A7-C:45] +Name=World is Not Enough, The (U) +Cheat0="Have All\Levels Unlocked",81102EE6 0021 +Cheat0_N=For Single Player Mode Only +Cheat1="Invincibility On All levels",81112F68 0101 +Cheat2="Skip Intro,",D03B0E5F 0004,803B0E5F 0009 +Cheat3="Level select",803B0E5F 0009 +Cheat4="Infinite\Ammo On All Levels",810648DC 2400 +Cheat5="Have All\Guns On All Levels",8105F224 0810,8105F226 0000,8105F228 2442,8105F22A 0001,81400000 3C02,81400002 0100,81400004 2442,81400006 0063,81400008 AE82,8140000A 0288,8140000C AE82,8140000E 0298,81400010 AE82,81400012 02A0,81400014 AE82,81400016 02A8,81400018 AE82,8140001A 02B0,8140001C AE82,8140001E 02C0,81400020 AE82,81400022 02C8,81400024 AE82,81400026 02D0,81400028 AE82,8140002A 02D8,8140002C AE82,8140002E 02E8,81400030 AE82,81400032 02F0,81400034 AE82,81400036 02F8,81400038 AE82,8140003A 0300,8140003C AE82,8140003E 0308,81400040 AE82,81400042 0310,81400044 AE82,81400046 0320,81400048 AE82,8140004A 0330,8140004C AE82,8140004E 0338,81400050 AE82,81400052 0350,81400054 AE82,81400056 0358,81400058 AE82,8140005A 0360,8140005C AE82,8140005E 0370,81400060 AE82,81400062 0378,81400064 AE82,81400066 0380,81400068 AE82,8140006A 0388,8140006C AE82,8140006E 0340,81400070 AE82,81400072 0348,81400074 AE82,81400076 0350,81400078 0801,8140007A 7C8C,8140007C A077,8140007E 01FC +Cheat5_N=Once you pick up a Gun You will have all weapons +Cheat6="Time Taken Clock At 0:00",80102F02 0000 +Cheat7="Infinite\Time",8138EE3A 19B8 +Cheat7_N=Underground Uprising +Cheat8="Have All\Skins + Everyone is Evil",50005C0C 0000,800BF687 0081 +Cheat9="Have All\Gadgets",80112F6D 0001 +Cheat10="Go Solo In Multiplayer",D00E0778 0042,801002B7 0001 +Cheat11="Stop Bond From Going Downhill on Cold Reception",D10E0778 0020,803A8466 0001,D10E0778 0010,803A8466 0000 +Cheat11_N=Press L to Stop, & R to Go +Cheat12="Fail Objectives To Complete Them",810315B8 2402,810315BA 0011 +Cheat13="Infinite\Ammo On Clip,",810649AC 2400 +Cheat14="Have Tons Of Nightvision",81064C82 1500 +Cheat14_N=For Battery Only +Cheat15="Play Crate Yard Level",80102EDF 0008 + +//---- + +[BBC99D32-117DAA80-C:45] +Name=TWISTED EDGE +Cheat0="Max\50000 Stunt Points",810829B8 C350 +Cheat2="Have\All Characters",810829F8 07FF +Cheat3="Have\All Difficulties",810829F0 0700 +Cheat4="Have\All Tracks",810829FC BFFE +Cheat5="Have\All Boards",81082A04 0003,81082A06 FFFF +Cheat1="Low Timer",801495FF 0000,80149601 0000 + +//---- + +[EA71056A-E4214847-C:45] +Name=Vigilante 8 (U) +Cheat0="All Characters & Levels",81181572 01C0 +Cheat1="Have All Cars",50000D01 0000,80191298 001F +Cheat2="Level Select",80190150 00?? +Cheat2_O=$00 Super Dreamland 64,$01 Secret Base,$02 Sand Factory,$03 Oil Fields,$04 Aircraft Graveyard,$05 Ghost Town,$06 Hoover Dam,$07 Valley Farms,$08 Casino City,$09 Canyonlands,$0A Ski Resorts +Cheat3="Play As\Player 1",80186AE0 00?? +Cheat3_O=$00 Chassey Blue,$01 Slick Clyde,$02 Sheila,$03 John Torque,$04 Dave,$05 Convoy,$06 Loki,$07 Houston 3,$08 Boogie,$09 Beezwax,$0A Molo,$0B Sid Burn,$0C "Y" The Alien +Cheat4="Play As\Player 2",80186AE1 00?? +Cheat4_O=$00 Chassey Blue,$01 Slick Clyde,$02 Sheila,$03 John Torque,$04 Dave,$05 Convoy,$06 Loki,$07 Houston 3,$08 Boogie,$09 Beezwax,$0A Molo,$0B Sid Burn,$0C "Y" The Alien + +//---- + +[F5C5866D-052713D9-C:45] +Name=Vigilante 8 - 2nd Offense (U) +Cheat0="All Quests Complete\Player 1",5000120A 0000,81197FF0 01FF +Cheat1="All Characters\Have Max\Attributes\Player 1",5000120A 0000,81197FF6 6464,5000120A 0000,81197FF8 6464 +Cheat2="All Characters\Have Max\Acceleration\Player 1",50000C0A 0000,80197FF6 0064 +Cheat3="All Characters\Have Max\Speed\Player 1",5000120A 0000,80197FF7 0064 +Cheat4="All Characters\Have Max\Armor\Player 1",5000120A 0000,80197FF8 0064 +Cheat5="All Characters\Have Max\Target Avoidance\Player 1",5000120A 0000,80197FF9 0064 +Cheat6="All Quests Complete\Player 2",5000120A 0000,811980A4 01FF +Cheat7="All Characters\Have Max\Attributes\Player 2",5000120A 0000,811980AA 6464,5000120A 0000,811980AC 6464 +Cheat8="All Characters\Have Max\Acceleration\Player 2",5000120A 0000,801980AA 0064 +Cheat9="All Characters\Have Max\Speed\Player 2",5000120A 0000,801980AB 0064 +Cheat10="All Characters\Have Max\Armor\Player 2",5000120A 0000,801980AC 0064 +Cheat11="All Characters\Have Max\Target Avoidance\Player 2",5000120A 0000,801980AD 0064 + +//---- + +[82B3248B-E73E244D-C:45] +Name=Virtual Chess 64 (U) +Cheat0="Debug Mode",810E6290 0001 +Cheat1="Time Always Counts Down\On Black Players Side",8012C67D 0001 +Cheat2="Time Always Counts Down\On White Players Side",8012C67D 0000 +Cheat3="Always Play On\2D Board",800E7257 0001 +Cheat4="Always Play On\3D Board",800E7257 0000 +Cheat5="Player 1 Controls\Both Sides In 2-Player",8012C508 0000 +Cheat5_N=This is only for Human VS. Human Game + +//---- + +[4E4A7643-A37439D7-C:45] +Name=Virtual Pool 64 (U) +Cheat0="Always Your Turn\Player 1",802EF798 0000 +Cheat1="Always Your Turn\Player 2",802EF798 0001 +Cheat2="Ball\Always In Hand",802EF79C 0002 +Cheat3="Max Ratings\Player 1",81062C6A FFFF +Cheat4="Max Ratings\Player 2",81062CEE FFFF +Cheat5="Wins Options\Player 1",812EF780 ???? +Cheat5_O=$0000 Zero Points,$FFFF Max Points +Cheat6="Wins Options\Player 2",812EF782 ???? +Cheat6_O=$0000 Zero Points,$FFFF Max Points +Cheat7="Foul Score Options\Player 1",812EF784 ???? +Cheat7_O=$0000 Zero Fouls,$FFFF Max Fouls +Cheat8="Foul Score Options\Player 2",812EF786 ???? +Cheat8_O=$0000 Zero Fouls,$FFFF Max Fouls +Cheat9="Aiming Sites Always Available",812F0922 0004 + +//---- + +[3C059038-C8BF2182-C:45] +Name=V-Rally Edition 99 (U) +Cheat0="Enable All\Cars",80140D1F 003F +Cheat1="Enable All\Tracks",80140D1A 0070 +Cheat2="Unlock Champ",80140D28 0001 +Cheat3="Enable All\Expert Times",80140D1C 0031 +Cheat4="Unlock Cheat Menu",D11B1F14 0000,811B1F14 00FF,811D530A 04FF,D11B1F14 00FF,811B0270 FF03 + +//---- + +[8066D58A-C3DECAC1-C:45] +Name=Waialae Country Club - True Golf Classics (U) +Cheat0="Max Power",8012A431 FFFF +Cheat1="Max Technique",8012A433 FFFF +Cheat2="Max Putt",8012A435 FFFF +Cheat3="Max Recover",8012A437 FFFF +Cheat4="Select Club",801DA496 00?? +Cheat4_O=$00 1W,$01 2W,$02 3W,$03 4W,$04 5W,$05 1I,$06 2I,$07 3I,$08 4I,$09 5I,$0A 6I,$0B 7I,$0C 8I,$0D 9I,$0E PW,$0F AW,$10 SW,$11 Putter +Cheat5="Always On First Shot",811DA47A 0001 +Cheat6="Club Type\Woods Mods",8012A472 00?? +Cheat6_O=$00 Titan,$01 Metal Wood,$02 Persimmon +Cheat7="Club Type\Irons Mods",8012A473 00?? +Cheat7_O=$00 Cavity,$01 Conventional +Cheat8="Club Type\Sand Wedge Mods",8012A474 00?? +Cheat8_O=$00 58 Degrees,$01 60 Degrees,$02 62 Degrees + +//---- + +[F7FE28F6-C3F2ACC3-C:45] +Name=War Gods (U) +Cheat0="Cheat Menu",80336593 0001 +Cheat1="Unlimited Time",8033F31B 0063 +Cheat2="Infinite Credits",81336582 0005,8133658E 0004 + +//---- + +[7DE11F53-74872F9D-C:45] +Name=Wave Race 64 (U) (v1.0) +Cheat0="Misses Don't Count",801C27CF 0000 +Cheat1="Infinite Time Stunt Mode",801C295E 00FF +Cheat2="Super Speed",801C27C7 0005,D0154051 0010,801C27C7 0020 +Cheat3="99 Points",801CB0A3 0063 +Cheat4="Infinite Course Out Time",801C2983 00FF +Cheat5="Maximum Power\Player 1",801C27C7 0005 +Cheat6="Maximum Power\Player 2",801C2DEA 0005,801C308A 0005 +Cheat7="Only Play Glacier Coast",800DA753 0007 +Cheat8="Open\Difficulty Option",801CAFE0 00?? +Cheat8_O=$01 Hard,$02 Expert,$03 Hard & Expert,$10 Dolphin,$11 Dolphin & Hard,$12 Dolphin & Expert,$13 Dolphin Hard & Expert +Cheat9="Open\Level Option",800DA753 00?? +Cheat9_O=$02 Sunset Bay,$03 Above & Drake Lake,$04 All Above & Marine Fortress,$05 All Above & Port Blue,$06 All Above & Southern Island,$0D All Above & Twilight City,$16 All Above & Glacier Coast +Cheat10="Open\Course Option",801CAFEB 00?? +Cheat10_O=$00 Dolphin Park,$01 Sunny Beach,$02 Sunset Bay,$03 Drake Lake,$04 Marian Fortress,$05 Port Blue,$06 Twilight City,$07 Glacier Coast,$08 Southern Island +Cheat10_N=This works in all modes except for Championship Mode. +Cheat11="Always First Place",801C269F 0000 + +//---- + +[492F4B61-04E5146A-C:45] +Name=Wave Race 64 (U) (v1.1) +Cheat0="Misses Don't Count",801C2A6F 0000 +Cheat1="Infinite Time Stunt Mode",801C2BFE 00FF +Cheat2="Super Speed",801C2A67 0005,D01CE659 0010,801C2A67 0020 +Cheat3="99 Points",801CB343 0063 +Cheat4="Infinite Course Out Time",801C2C03 00FF +Cheat5="Maximum Power\Player 1",801C2A67 0005,8013FC91 0005 +Cheat6="Maximum Power\Player 2",801C308A 0005,801C392D 0005 +Cheat7="Only Play Glacier Coast",800DA9D3 0007 +Cheat8="Open\Difficulty Option",801CB260 00?? +Cheat8_O=$01 Hard,$02 Expert,$03 Hard & Expert,$10 Dolphin,$11 Dolphin & Hard,$12 Dolphin & Expert,$13 Dolphin Hard & Expert +Cheat9="Open\Level Option",801CB26B 00?? +Cheat9_O=$02 Sunset Bay,$03 Above & Drake Lake,$04 All Above & Marine Fortress,$05 All Above & Port Blue,$06 All Above & Southern Island,$0D All Above & Twilight City,$16 All Above & Glacier Coast +Cheat10="Open\Course Option",800DA9D3 00?? +Cheat10_O=$00 Dolphin Park,$01 Sunny Beach,$02 Sunset Bay,$03 Drake Lake,$04 Marian Fortress,$05 Port Blue,$06 Twilight City,$07 Glacier Coast,$08 Southern Island +Cheat10_N=This works in all modes except for Championship Mode. +Cheat11="Always First Place",801C293F 0000 + +//---- + +[6B45223F-F00E5C56-C:45] +Name=Wayne Gretzky's 3D Hockey (U) +Cheat0="Team 1\Score pts",800E6AB1 00?? +Cheat0_O=$00 Zero Points,$1E 30 Points,$23 50 Points,$4B 75 Points,$63 99 Points +Cheat1="Team 2\Score pts",800E9F8D ???? +Cheat1_O=$0000 ero Points,$1E03 0 Points,$2305 0 Points,$4B07 5 Points,$6309 9 Points +Cheat2="Crunched Players",810EA078 3F00 +Cheat3="Extra Teams",800C7205 0001 +Cheat4="Get In Fights Constantly",800A442E 0020 +Cheat5="Players\Height Size",810EA074 ???? +Cheat5_O=$3F00 Midgets,$3F80 Normal Size,$3FC0 Large,$4080 Giants +Cheat6="Players\Head Size",810EA070 ???? +Cheat6_O=$3F00 Very Small,$3F80 Normal Size,$4080 Very Large + +//---- + +[5A9D3859-97AAE710-C:45] +Name=Wayne Gretzky's 3D Hockey '98 (U) +Cheat0="Team 1\Score pts",8011C061 00?? +Cheat0_O=$00 Zero Points,$1E 30 Points,$23 50 Points,$4B 75 Points,$63 99 Points +Cheat1="Team 2\Score pts",8011F571 ???? +Cheat1_O=$0000 ero Points,$1E03 0 Points,$2305 0 Points,$4B07 5 Points,$6309 9 Points +Cheat2="Crunched Players",810DBA6C 3F00 +Cheat3="Extra Teams",80115A0C 0001 +Cheat4="Get In Fights Constantly",800CF766 0020 +Cheat5="Players\Height Size",81120688 ???? +Cheat5_O=$3F00 Midgets,$3F80 Normal Size,$3FC0 Large,$4080 Giants +Cheat6="Players\Head Size",81118A2C ???? +Cheat6_O=$3F00 Very Small,$3F80 Normal Size,$4080 Very Large + +//---- + +[33BE8CD6-EC186912-C:45] +Name=WCW MAYHEM +Cheat0="Character Creation\Max\Strength",802F16F5 0009 +Cheat1="Character Creation\Max\Impact",803121B5 0009 +Cheat2="Character Creation\Max\Speed",803156F5 0009 +Cheat3="Character Creation\Max\Quickness",803176B5 0009 +Cheat4="Character Creation\Max\Aerial",80319675 0009 +Cheat5="Character Creation\Max\Mat Ability",8031B635 0009 +Cheat6="Character Creation\Max\Submission",8031D5F5 0009 +Cheat7="Character Creation\Max\Brawling",8031F5B5 0009 +Cheat8="Character Creation\Max\Dirtiness",80321575 0009 +Cheat9="Infinite Stamina\Player 1",810E3998 0478 +Cheat10="Infinite Stamina\Player 2",810E3B34 03ED +Cheat11="Meter Select\Player 1",800E399D 00?? +Cheat11_O=$60 Full Meter Bar,$00 Empty Meter Bar +Cheat12="Meter Select\Player 2",800AD80D 00?? +Cheat12_O=$60 Full Meter Bar,$00 Empty Meter Bar +Cheat13="Enable Cheat",800B115B 00?? +Cheat13_O=$02 Super Created Wrestlers,$04 Stamina Meter,$08 Momentum Meter,$20 Play As Same Wrestler,$80 All Wrestlers +Cheat14="Freeze Timer",810B3242 D300 + +//---- + +[CEA8B54F-7F21D503-C:45] +Name=Wetrix (U) +Cheat0="Infinite Lakes",811BF93E 0009 +Cheat1="Mega Score",801BF958 00FF,801EED04 00FF +Cheat2="Always Empty Drain",801BF991 0000,811BF992 0000,811BF994 0000 +Cheat3="Always Berserk Mode",801BF9AF 00FF +Cheat4="Stop Level Timer",801BF9B2 00FF +Cheat5="Practice Lessons Open",810B0BAA 0008 +Cheat6="Always Drop\Player 1",801BF9BB 00?? +Cheat6_O=$00 Bar,$01 T,$02 Corner,$03 Square,$04 Down Square,$05 Down Bar,$06 Big Water,$07 Medium Water,$08 Small Water,$09 Smallest Water,$0A Bomb,$0B Fireball +Cheat7="Always Drop\Player 2",801F013B 00?? +Cheat7_O=$00 Bar,$01 T,$02 Corner,$03 Square,$04 Down Square,$05 Down Bar,$06 Big Water,$07 Medium Water,$08 Small Water,$09 Smallest Water,$0A Bomb,$0B Fireball +Cheat8="Infinite Ducks",801BF94B 0009 + +//---- + +[E896092B-DC244D4E-C:45] +Name=Wheel Of Fortune (U) +Cheat0="Player 1\Max Cash",810B9990 FFFF +Cheat1="Player 2\Max Cash",810B9AA4 FFFF +Cheat2="Player 3\Max Cash",810B9BB8 FFFF +Cheat3="Player 1\No Cash",810B9992 0000 +Cheat4="Player 2\No Cash",810B9AA6 0000 +Cheat5="Player 3\No Cash",810B9BB8 0000 +Cheat6="Player 1\Infinite Free Spins",800B999B 0001 +Cheat7="Player 2\Infinite Free Spins",800B9AAF 0001 +Cheat8="Player 3\Infinite Free Spins",800B9BC3 0001 + +//---- + +[ED98957E-8242DCAC-C:45] +Name=WinBack - Covert Operations (U) +Cheat0="Infinite Health",8017AABB 0064 +Cheat1="Enable\Max Power Mode",8015D417 0001 +Cheat2="Have All Characters",8115D412 FFFF,8115D410 0003,8015D411 0003 +Cheat3="Flashlight Mod",80179448 00?? +Cheat3_O=$01 On,$00 Off +Cheat4="All Bosses 1 Hit Deaths",811BE482 0000 +Cheat5="Have All\Weapons,Items & Infinite Ammo\Player 1",8017AA9F 001E,8017AAB3 0008,8017AAB7 0009,801587C4 0009,8015D417 0001,801587C0 000C,801587C1 0060,801587C3 0001,50000601 0000,801587C5 0001,801587CB 0004,801587CD 000C +Cheat6="Start with Weapon\Player 1",8017AAA8 00?? +Cheat6_O=$00 HandGun,$01 Machinegun,$02 Shotgun,$03 Rocket Launcher,$04 M16 With Infinite Ammo,$05 New Cooler Handgun,$06 Invisible Gun 1 With Infinite Ammo,$07 Invisible Gun 2 With Infinite Ammo,$08 Odd Inviso ShotGun With Infinite Ammo,$09 Cool Rocket Launcher With Infinite Ammo,$14 Silenced Handgun +Cheat7="Time is Always 00:00:00",8110DD62 0000 +Cheat8="Have Trial Mode Unlocked",8110DCEE 0004 + +//---- + +[132D2732-C70E9118-C:45] +Name=Wipeout 64 +Cheat0="Infinite\Check Point Time",810CDE92 0960 +Cheat1="Always Place First",8109BC68 0001,81091E06 0003 +Cheat1_N=For This code doesn't record the win on the Time Trial Gold Challenge or the Weapons Gold Challenge. +Cheat2="Open\Velocitar",80093249 0001 +Cheat3="Open\Piranha II",800933C9 0001 +Cheat4="Open\Super Combo Challenge",8009351D 0000 +Cheat5="Activate\Infinite Random Weapons Pickup",80091C24 0001 +Cheat6="Activate\Power-Up Weapons",80091C28 0001 +Cheat7="Activate\Velocitar",80091C2A 0001 +Cheat8="Activate\Piranha",80091C29 0001 +Cheat9="Have Weapon\For Feisar",811BC4F6 ???? +Cheat9_O=$0101 Rockets,$0202 Missiles,$0303 Mines,$0505 Electro Bolt,$0606 E-Pak,$0707 AutoPilot,$0808 Shield,$0909 Turbo Boost,$0C0C Quake Disruptor,$0D0D Secret,$0E0E Thunder Bomb +Cheat10="Have Weapon\For AG System",811BCE3E ???? +Cheat10_O=$0101 Rockets,$0202 Missiles,$0303 Mines,$0505 Electro Bolt,$0606 E-Pak,$0707 AutoPilot,$0808 Shield,$0909 Turbo Boost,$0C0C Quake Disruptor,$0D0D Secret,$0E0E Thunder Bomb +Cheat11="Have Weapon\For Auricom",811BC1DE ???? +Cheat11_O=$0101 Rockets,$0202 Missiles,$0303 Mines,$0505 Electro Bolt,$0606 E-Pak,$0707 AutoPilot,$0808 Shield,$0909 Turbo Boost,$0C0C Quake Disruptor,$0D0D Secret,$0E0E Thunder Bomb +Cheat12="Have Weapon\For Qirex",811BC80E ???? +Cheat12_O=$0101 Rockets,$0202 Missiles,$0303 Mines,$0505 Electro Bolt,$0606 E-Pak,$0707 AutoPilot,$0808 Shield,$0909 Turbo Boost,$0C0C Quake Disruptor,$0D0D Secret,$0E0E Thunder Bomb +Cheat13="Have Weapon\For Piranha II",811BCB2E ???? +Cheat13_O=$0101 Rockets,$0202 Missiles,$0303 Mines,$0505 Electro Bolt,$0606 E-Pak,$0707 AutoPilot,$0808 Shield,$0909 Turbo Boost,$0C0C Quake Disruptor,$0D0D Secret,$0E0E Thunder Bomb +Cheat14="Infinite Eliminations",801BC52B 00FF +Cheat15="[Infinite Sheild]",5000030C 0000,8109BCE2 0000,8109BD12 0000 +Cheat15_N=This cheat enabled fixes Av's popping up and spoiling you racing,it also gives you Infinite Sheild on all Cars,Tracks and Modes + +//---- + +[BD636D6A-5D1F54BA-C:45] +Name=World Cup 98 (U) +Cheat0="Home Team scores",800478BF 00?? +Cheat0_O=$00 0 Goals,$19 25 Goals,$32 50 Goals,$63 99 Goals, +Cheat1="Away Team scores",800478BB 00?? +Cheat1_O=$00 0 Goals,$19 25 Goals,$32 50 Goals,$63 99 Goals, +Cheat2="Open Cup Classic Mode",8003CC6F 0001 + +//---- + +[D2BE2F14-38453788-C:45] +Name=WWF Attitude (U) +Cheat0="Enable Everything",8112E21C F000,8112E21E 09FF,8112E220 FFFF,8112E222 FFFF +Cheat1="0% in Move List",81135620 0000 +Cheat2="Infinite Creation Points",80161313 0000 +Cheat3="Max\Charisma",8014E3EC 000A +Cheat4="Max\Mat Skills",8014E3ED 000A +Cheat5="Max\Recovery",8014E3EB 000A +Cheat6="Max\Speed",8014E3EA 000A +Cheat7="Max\Strength",8014E3E8 000A +Cheat8="Max\Toughness",8014E3E9 000A + +//---- + +[4E4B0640-1B49BCFB-C:45] +Name=WWF No Mercy (U) +Cheat0="Infinite\Money\Championship Mode",8109940A FFFF +Cheat1="Infinite\Money\Smackdown Mall Shop",8114FAD6 FFFF +Cheat2="Have All\Characters,Costumes, & Moves",50000B02 0000,810BEE40 FFFF +Cheat3="Max Spirit\Player 1",D015A5D1 0015,8015AF5F 00FF +Cheat4="Max Spirit\Player 2",D015A5D1 0015,8015B2B7 00FF +Cheat5="Max Spirit\Player 3",D015A5D1 0015,8015B60F 00FF +Cheat6="Max Spirit\Player 4",D015A5D1 0015,8015B967 00FF +Cheat7="Always Special\Player 1",D015A5D1 0015,8015AF9E 0004 +Cheat8="Always Special\Player 2",D015A5D1 0015,8015B2F6 0004 +Cheat9="Always Special\Player 3",D015A5D1 0015,8015B64E 0004 +Cheat10="Always Special\Player 4",D015A5D1 0015,8015B9A6 0004 +Cheat11="Ultimate Code\Player 1",D015A5D1 0015,8015AF5E 0064 +Cheat12="Ultimate Code\Player 2",D015A5D1 0015,8015B2B6 0064 +Cheat13="Ultimate Code\Player 3",D015A5D1 0015,8015B60E 0064 +Cheat14="Ultimate Code\Player 4",D015A5D1 0015,8015B964 0064 +Cheat15="2 Player Championship Mode",810A755E 0002 +Cheat16="CPU To Human Control\Player 1",8015AF99 00?? +Cheat16_O=$17 Human,$18 CPU +Cheat17="CPU To Human Control\Player 2",8015B2F1 00?? +Cheat17_O=$17 Human,$18 CPU +Cheat18="CPU To Human Control\Player 3",8015B649 00?? +Cheat18_O=$17 Human,$18 CPU +Cheat19="Can't Pin\Player 1",8016CE23 0004 +Cheat20="Can't Pin\Player 2",8016CE17 0004 +Cheat21="Can't Pin\Player 3",8016CE2F 0004 +Cheat22="Can't Pin\Player 4",8016CE3B 0004 +Cheat23="Auto-Pin\Player 1",8016CE23 0003 +Cheat24="Auto-Pin\Player 2",8016CE17 0003 +Cheat25="Auto-Pin\Player 3",8016CE2F 0003 +Cheat26="Auto-Pin\Player 4",8016CE3B 0003 +Cheat27="Play As\Player 1\Option 1",810AAAD0 ???? +Cheat27_O=$0001 Rock,$0002 SCSA,$0003 Undertaker,$0004 Kane,$0005 Richards,$0006 Mankind,$0007 Cactus,$0008 Mick,$0009 HBK,$0101 HHH,$0102 X-Pac,$0103 Mr. Ass,$0104 Road Dogg,$0201 Benoit,$0202 Malenko,$0203 Saturn,$0204 Guerrero,$0301 Jericho,$0302 Angle,$0303 Tazz,$0304 Test,$0305 GodFather,$0306 D`Lo,$0307 Venis,$0308 Shamrock +Cheat28="Play As\Player 1\Option 2",810AAAD0 ???? +Cheat28_O=$0401 Rikishi,$0402 Sexay,$0403 Scotty,$0404 Edge,$0405 Christian,$0406 Matt,$0407 Jeff,$0501 Faarooq,$0502 Bradshaw,$0503 D-Von,$0504 Buh Buh,$0505 Hardcore,$0506 Crash,$0507 Bossman,$0508 Albert,$0601 Al,$0602 Blackman,$0603 Bulldog,$0604 Henry,$0605 Viscera,$0606 Andre,$0607 Buchanan,$0608 Rios,$0609 Taka,$0701 Chyna +Cheat29="Play As\Player 1\Option 3",810AAAD0 ???? +Cheat29_O=$0702 Stephanie,$0703 Tori,$0704 Debra,$0705 Trish,$0706 Lita,$0801 Jacqueline,$0802 Linda,$0803 Kat,$0804 Moola,$0805 Ho,$0901 Vince,$0902 Shane,$0903 Hebner,$0904 Jim Ross +Cheat30="Play As\Player 2\Option 1",810AAADC ???? +Cheat30_O=$0001 Rock,$0002 SCSA,$0003 Undertaker,$0004 Kane,$0005 Richards,$0006 Mankind,$0007 Cactus,$0008 Mick,$0009 HBK,$0101 HHH,$0102 X-Pac,$0103 Mr. Ass,$0104 Road Dogg,$0201 Benoit,$0202 Malenko,$0203 Saturn,$0204 Guerrero,$0301 Jericho,$0302 Angle,$0303 Tazz,$0304 Test,$0305 GodFather,$0306 D`Lo,$0307 Venis,$0308 Shamrock +Cheat31="Play As\Player 2\Option 2",810AAADC ???? +Cheat31_O=$0401 Rikishi,$0402 Sexay,$0403 Scotty,$0404 Edge,$0405 Christian,$0406 Matt,$0407 Jeff,$0501 Faarooq,$0502 Bradshaw,$0503 D-Von,$0504 Buh Buh,$0505 Hardcore,$0506 Crash,$0507 Bossman,$0508 Albert,$0601 Al,$0602 Blackman,$0603 Bulldog,$0604 Henry,$0605 Viscera,$0606 Andre,$0607 Buchanan,$0608 Rios,$0609 Taka,$0701 Chyna +Cheat32="Play As\Player 2\Option 3",810AAADC ???? +Cheat32_O=$0702 Stephanie,$0703 Tori,$0704 Debra,$0705 Trish,$0706 Lita,$0801 Jacqueline,$0802 Linda,$0803 Kat,$0804 Moola,$0805 Ho,$0901 Vince,$0902 Shane,$0903 Hebner,$0904 Jim Ross +Cheat33="Play As\Player 3\Option 1",810AAAE8 ???? +Cheat33_O=$0001 Rock,$0002 SCSA,$0003 Undertaker,$0004 Kane,$0005 Richards,$0006 Mankind,$0007 Cactus,$0008 Mick,$0009 HBK,$0101 HHH,$0102 X-Pac,$0103 Mr. Ass,$0104 Road Dogg,$0201 Benoit,$0202 Malenko,$0203 Saturn,$0204 Guerrero,$0301 Jericho,$0302 Angle,$0303 Tazz,$0304 Test,$0305 GodFather,$0306 D`Lo,$0307 Venis,$0308 Shamrock +Cheat34="Play As\Player 3\Option 2",810AAAE8 ???? +Cheat34_O=$0401 Rikishi,$0402 Sexay,$0403 Scotty,$0404 Edge,$0405 Christian,$0406 Matt,$0407 Jeff,$0501 Faarooq,$0502 Bradshaw,$0503 D-Von,$0504 Buh Buh,$0505 Hardcore,$0506 Crash,$0507 Bossman,$0508 Albert,$0601 Al,$0602 Blackman,$0603 Bulldog,$0604 Henry,$0605 Viscera,$0606 Andre,$0607 Buchanan,$0608 Rios,$0609 Taka,$0701 Chyna +Cheat35="Play As\Player 3\Option 3",810AAAE8 ???? +Cheat35_O=$0702 Stephanie,$0703 Tori,$0704 Debra,$0705 Trish,$0706 Lita,$0801 Jacqueline,$0802 Linda,$0803 Kat,$0804 Moola,$0805 Ho,$0901 Vince,$0902 Shane,$0903 Hebner,$0904 Jim Ross +Cheat36="Play As\Player 4\Option 1",810AAAF4 ???? +Cheat36_O=$0001 Rock,$0002 SCSA,$0003 Undertaker,$0004 Kane,$0005 Richards,$0006 Mankind,$0007 Cactus,$0008 Mick,$0009 HBK,$0101 HHH,$0102 X-Pac,$0103 Mr. Ass,$0104 Road Dogg,$0201 Benoit,$0202 Malenko,$0203 Saturn,$0204 Guerrero,$0301 Jericho,$0302 Angle,$0303 Tazz,$0304 Test,$0305 GodFather,$0306 D`Lo,$0307 Venis,$0308 Shamrock +Cheat37="Play As\Player 4\Option 2",810AAAF4 ???? +Cheat37_O=$0401 Rikishi,$0402 Sexay,$0403 Scotty,$0404 Edge,$0405 Christian,$0406 Matt,$0407 Jeff,$0501 Faarooq,$0502 Bradshaw,$0503 D-Von,$0504 Buh Buh,$0505 Hardcore,$0506 Crash,$0507 Bossman,$0508 Albert,$0601 Al,$0602 Blackman,$0603 Bulldog,$0604 Henry,$0605 Viscera,$0606 Andre,$0607 Buchanan,$0608 Rios,$0609 Taka,$0701 Chyna +Cheat38="Play As\Player 4\Option 3",810AAAF4 ???? +Cheat38_O=$0702 Stephanie,$0703 Tori,$0704 Debra,$0705 Trish,$0706 Lita,$0801 Jacqueline,$0802 Linda,$0803 Kat,$0804 Moola,$0805 Ho,$0901 Vince,$0902 Shane,$0903 Hebner,$0904 Jim Ross +Cheat39="Cannot Be Grabbed\Player 1",D115AEC6 0052,8115AEC6 0001,D115AEC6 00A1,8115AEC6 00C1 +Cheat40="Cannot Be Punched\Player 1",D115AEC6 002D,8115AEC6 0001,D115AEC6 0035,8115AEC6 00C1 +Cheat41="Cannot Be Knocked Down\Player 1",D115AEC6 0031,8115AEC6 0001 +Cheat42="Wrestler Size & Shape\Player 1\Thin wrestler",8106B468 3D80 +Cheat43="Wrestler Size & Shape\Player 1\Wide wrestler",8106B468 3FFF +Cheat44="Wrestler Size & Shape\Player 1\Short wrestler",8106B47C 3E80 +Cheat45="Wrestler Size & Shape\Player 1\Tall wrestler",8106B47C 3FFF +Cheat46="Wrestler Size & Shape\Player 1\Flat wrestler",8106B490 3D80 +Cheat47="Wrestler Size & Shape\Player 1\Bulgy wrestler",8106B490 3FFF +Cheat48="Wrestler Size & Shape\Player 1\Giant wrestler",8106B4A4 3E80 +Cheat49="Wrestler Size & Shape\Player 1\Small wrestler",8106B4A4 3FFF +Cheat50="Wrestler Size & Shape\Player 2\Thin wrestler",8006B528 3D80 +Cheat51="Wrestler Size & Shape\Player 2\Wide wrestler",8006B528 3FFF +Cheat52="Wrestler Size & Shape\Player 2\Short wrestler",8006B53C 3E80 +Cheat53="Wrestler Size & Shape\Player 2\Tall wrestler",8006B53C 3FFF +Cheat54="Wrestler Size & Shape\Player 2\Flat wrestler",8006B510 3DFF +Cheat55="Wrestler Size & Shape\Player 2\Bulgy wrestler",8006B510 3FFF +Cheat56="Wrestler Size & Shape\Player 2\Giant wrestler",8006B564 3E80 +Cheat57="Wrestler Size & Shape\Player 2\Small wrestler",8006B564 3FFF +Cheat58="Wrestler Size & Shape\Player 3\Thin wrestler",8006B5E8 3D80 +Cheat59="Wrestler Size & Shape\Player 3\Wide wrestler",8006B5E8 3FFF +Cheat60="Wrestler Size & Shape\Player 3\Short wrestler",8006B5FC 3E80 +Cheat61="Wrestler Size & Shape\Player 3\Tall wrestler",8006B5FC 3FFF +Cheat62="Wrestler Size & Shape\Player 3\Flat wrestler",8006B610 3D80 +Cheat63="Wrestler Size & Shape\Player 3\Bulgy wrestler",8006B610 3FFF +Cheat64="Wrestler Size & Shape\Player 3\Giant wrestler",8006B624 3E80 +Cheat65="Wrestler Size & Shape\Player 3\Small wrestler",8006B624 3FFF +Cheat66="Wrestler Size & Shape\Player 4\Thin wrestler",8006B6A8 3D80 +Cheat67="Wrestler Size & Shape\Player 4\Wide wrestler",8006B6A8 3FFF +Cheat68="Wrestler Size & Shape\Player 4\Short wrestler",8006B6BC 3E80 +Cheat69="Wrestler Size & Shape\Player 4\Tall wrestler",8006B6BC 3FFF +Cheat70="Wrestler Size & Shape\Player 4\Flat wrestler",8006B6D0 3D80 +Cheat71="Wrestler Size & Shape\Player 4\Bulgy wrestler",8006B6D0 3FFF +Cheat72="Wrestler Size & Shape\Player 4\Giant wrestler",8006B6E4 3E80 +Cheat73="Wrestler Size & Shape\Player 4\Small wrestler",8006B6E4 3FFF +Cheat74="Z LADDER",D1064880 2000,8116C768 0000,D1064880 2000,8116C76A 0019,D1064880 2000,8116C76C 0000,D1064880 2000,8116C76E 0019,D1064880 2000,8116C788 8104 +Cheat75="Replace Raw War with\TOKYO DOME",810528F4 7223,810528F6 0119,81050124 0100,81050126 0100,81050128 0100,8105012A 0100,8105012C 0100,8105012E 0100,81050130 0100,81050132 0100,81050134 0100,81050136 0100,8105010E 0999,81050400 03A5,81050402 0385,81050404 0385,81050406 0385,81050408 0385,8105040A 03A5,8105040C 03A5,8105040E 043F,81050430 043F,8105042C 03A5,81050430 21A5,81050432 0100,81050434 0000,81050436 2CFB,81050438 0899,8105043C 03AF,81050440 03AF,81050442 03A5,810500E8 24C3,81050444 0100,81050190 09EF,81050192 0000,81050194 09EF,81050196 2CFD +Cheat76="Replace Raw War with\BARBEDWIRE ROPES",81050110 04F3,81050112 04F4,81050114 04F5,81050116 04F3,81050118 04F4,8105011A 04F5,8105011C 04F3,8105011E 04F4,81050120 04F5,81050124 2CFB,81050126 2CFB,81050128 2CFB,8105012A 2CFB,8105012C 2CFB,8105012E 2CFB,81050130 2CFB,81050132 2CFB,81050134 2CFB,81079D90 3F6C,81079D94 3F48,81079DA4 3D10,81079DB8 3F71,81079E6C 3F6C,81079E80 3D10,81079E90 3F47,81079F48 3F6C,81079F4C BF4C,81079F5C 3D10,81079F70 3F71,8107A024 3F6C,8107A028 3F28,8107A038 3D10,8107A04C 3F71,8107A100 3F6C,8107A114 3D10,8107A124 3F23,8107A1DC 3F6C,8107A1E0 BF2A,8107A1F0 3D10,8107A204 3F71,8107A2B8 3F6C,8107A2BC 3F02,8107A2CC 3D10,8107A2E0 3F71,8107A394 3F6C,8107A3A8 3D10,8107A3B8 3F00,8107A470 3F6C,8107A474 BF02,8107A484 3D10,8107A498 3F71,81050144 0569,81050154 07F7,810528F4 0C01,810528F6 0555,81050140 04F4,81050150 2CFB,8107A628 3F60,8107A63C 3D10,8107A64C 3F52,8107A650 BF80,8107A8BC 3F56,8107A8C4 BA00,8107A8D0 3D10,8107A8DC 3C5A,8107A8E0 3F30,8107A8E4 BF80,8107ADE4 3F56,8107ADEC BA00,8107ADF8 3D10,8107AE04 3C5A,8107AE08 3F0E,8107AE0C BF80,8107AB7C 3F00,D115AF56 2EB2,8115AEC6 0017,D115B2AE 2EB2,8115B21E 0017,D115B606 2EB2,8115B570 0017,D115B95E 2EB2,8115B8CE 0017,81052922 FFFF,81052924 FFFF,81052926 FFFF +Cheat77="Replace Raw War with\BARBEDWIRE SQUARE\Part 1",81050110 04F3,81050112 04F4,81050114 04F5,81050116 04F3,81050118 04F4,8105011A 04F5,8105011C 04F3,8105011E 04F4,81050120 04F5,81050124 2CFB,81050126 2CFB,81050128 2CFB,8105012A 2CFB,8105012C 2CFB,8105012E 2CFB,81050130 2CFB,81050132 2CFB,81050134 2CFB,81079D90 3F6C,81079D94 3F48,81079DA4 3D10,81079DB8 3F71,81079E6C 3F6C,81079E80 3D10,81079E90 3F47,81079F48 3F6C,81079F4C BF4C,81079F5C 3D10,81079F70 3F71,8107A024 3F6C,8107A028 3F28,8107A038 3D10,8107A04C 3F71,8107A100 3F6C,8107A114 3D10,8107A124 3F23,8107A1DC 3F6C,8107A1E0 BF2A,8107A1F0 3D10,8107A204 3F71,8107A2B8 3F6C,8107A2BC 3F02,8107A2CC 3D10,8107A2E0 3F71,8107A394 3F6C,8107A3A8 3D10,8107A3B8 3F00,8107A470 3F6C,8107A474 BF02,8107A484 3D10,8107A498 3F71,81050144 0569,81050154 07F7,810528F4 0C01,810528F6 0555,81050140 04F4,81050150 2CFB,8107A628 3F60,8107A63C 3D10,8107A64C 3F52,8107A650 BF80,8107A8BC 3F56,8107A8C4 BA00,8107A8D0 3D10,8107A8DC 3C5A,8107A8E0 3F30,8107A8E4 BF80,8107ADE4 3F56,8107ADEC BA00,8107ADF8 3D10,8107AE04 3C5A,8107AE08 3F0E,8107AE0C BF80,8107AB7C 3F00,D115AF56 2EB2,8115AEC6 0017,D115B2AE 2EB2,8115B21E 0017,D115B606 2EB2,8115B570 0017,D115B95E 2EB2,8115B8CE 0017,81052922 FFFF,81052924 FFFF,81052926 FFFF,8116C330 0000,8116C332 000A,8116C334 0000,8116C336 000A,8116C378 42B4 +Cheat78="Replace Raw War with\BARBEDWIRE SQUARE\Part 2",8116C382 0000,8116C38C FFFF,81052C9C 0672,81052CA4 2CFB,D1064880 0002,8115B21E 002F,D1064886 0002,8115AEC6 002F,8116C3E4 0000,8116C3E6 000C,8116C3E8 0000,8116C3EA 000C,8116C428 C3D4,8116C440 FFFF,81052CB2 2CC2,81052CB4 0805,81052CB6 2CFB,D1064880 2000,8116C3E6 001F,D1064880 2000,8116C3EA 001F,D1064880 2000,81005592 3F81,D1005592 3F81,8116C3E6 001F,D1064880 2000,81005592 3F81,D1005592 3F81,8116C3EA 001F,D1064886 2000,8116C3E6 001F,D1064886 2000,8116C3E6 001F,D1064886 2000,81005592 3F81,D1005592 3F81,8116C3EA 001F,81052CF8 04F4,81052D00 2CFB,8116C3E4 0000,8116C3E6 0015,8116C3E8 0000,8116C3EA 0015,8116C428 0000,8116C42A 0000,8116C42C 43EB,8116C42E 0000,8116C430 C3A6,8116C432 0000,8116C436 0400,8116C43A 0000,8116C43E 0000,8116C440 FFFF,8116C442 0000,810855A8 3F00,81085684 3F00,81085750 3F00,8108583C 3F00,81050100 2CFB,8105010E 2CFB +Cheat79="Replace Raw War with\FLAMING TURNBUCKLES",8116C334 FFFF,8116C336 001F,8116C374 C350,8116C376 FFF3,8116C378 4377,8116C37A 2689,8116C37C C380,8116C37E 0406,8116C382 0D14,8116C386 0FCC,8116C38A 07DC,8116C38C FFFF,8116C38E FDE3,8116C3E8 FFFF,8116C3EA 001F,8116C428 C360,8116C42C 4370,8116C430 4376,8116C436 0D14,8116C43A 0FCC,8116C43E 07DC,8116C442 F9C4,8116C49C FFFF,8116C49E 001F,8116C4DC 4360,8116C4E0 4370,8116C4E4 4380,8116C4EA 0CD0,8116C4EE 0136,8116C4F2 04EE,8116C4F6 F601,8116C550 FFFF,8116C552 001F,8116C590 434F,8116C594 4370,8116C598 C36C,8116C59E 0E70,8116C5A2 0F58,8116C5A6 0814,8116C5AA F1E6 +Cheat80="Replace Raw War with\REMOVE RING",81050150 0000,81050152 0000,81050154 0000,810500E8 0000,810855A8 3F00,81085684 3F00,81085750 3F00,8108583C 3F00,81079C08 3F00,81079C14 3F00,81079B10 3F00 +Cheat81="Replace Raw War with\BACKYARD ARENA",8105010E 0F76,8105010C 0F76,810482E8 002F,81050150 2CFD,810528F4 33FF,810528F6 33FF,81050152 2DC7,81050114 04F4,81050116 04F5,8105011E 04F3,81050128 07FF,8105012A 07FF,81050132 07FF,81079F48 400C,81079F5C 3F00,81079F70 3FFF,8107A024 4010,8107A038 3F00,8107A04C 4020,8107A060 3F84,8107A394 4012,8107A3A8 3F00,8107A3BC 4030,8107A3D0 3F84,8105042C 0949,81050436 07FF,81050438 07FF,8105043A 07FF,8105043C 0000,8105043E 07FF,81050440 0949,81050442 0949,81050430 0F76,81050128 07FF,8105012A 07FF,8105012C 0000,8105012E 07FF,81050130 07FF,81050132 07FF,81050134 0000,81050136 08F9,81050196 2CFD,81050194 09EF,81050192 0000,81050190 09EF,8116C49E 0019,8116C4B8 0004,8116C4DC C2E1,8116C4E0 42B4,810500FE 2D2D,81050100 2D2D,81050102 2D2D,81050400 2DC7,81050402 2DC7,81050404 2DC7,81050406 2DC7,81050408 2DC7,8105040A 2DC7,8105040C 2DC7,8105040E 2DC7,50001002 0000,810501B8 0000,50000402 0000,810501E0 0000,50000902 0000,81050262 0000,50001402 0000,81050290 0000,50002C02 0000,810502EC 0000,8107941C 3FE0,81079428 3FFF,810500EC 06FE,810500EE 06FD,810500F8 07FF,810500FA 0997,81050110 06FC,81050112 06FB,8105011A 06FF,8105011C 06FA,81052CF0 2CC9,81052CF4 2D1B,81052CD0 2CD1,81052CD4 0963,81052C84 2CBF,81052C8A 0961,81052CB8 2CC4,81052CBC 2DD7,81052CC8 2CD1,81052CCC 2CFB,81052C78 2CBC,81052C80 2D31,81052CF8 2CC1,81052D00 2DD7 +Cheat82="Replace Raw War with\BACKYARD WEAK",8105042C 0E88,8105042E 2D0D,81050430 2D0D,81050432 2D0D,81050434 2D0D,81050436 07FD,8105043A 2CFB,8105043C 2D0D,8105043E 2D0D,81050440 2D0D,81050442 2D0D,810500E8 2D0D,8105010E 2D0D,8105010C 2D0D,81050150 2D0D,81050196 2CFB,81050124 2CFB,81050126 2CFB,81050128 2CFB,8105012A 2CFB,8105012C 2CFB,8105012E 2CFB,81050130 2CFB,81050132 2CFB,81050134 2CFB,81050136 2CFB,81050400 2D0D,81050402 2D0D,81050404 2D0D,81050406 2D0D,81050408 2D0D,8105040A 2D0D,8105040C 2D0D,8105040E 2D0D,810528F4 2D0D,810528F6 2D0D,81052CE8 2CC9,81052CEC 2D2D +Cheat83="Replace Raw War with\BARBEDWIRE ARENA",8105042C 2CFB,8105042E 2CFB,81050430 2CFB,81050432 2CFB,81050434 2CFB,81050436 2CFB,81050438 2CFB,8105043A 2CFB,8105043C 2CFB,8105043E 2CFB,81050440 2CFB,81050442 2CFB,810500E8 2CFB,8105010E 2CFB,8105010C 2CFB,81050150 2CFB,81050196 2CFB,81050124 2CFB,81050126 2CFB,81050128 2CFB,8105012A 2CFB,8105012C 2CFB,8105012E 2CFB,81050130 2CFB,81050132 2CFB,81050134 2CFB,81050136 2CFB,810528F4 DDDD,810528F6 DDDD,81052CE8 2CCA,81052CEC 2CFB,81050400 2CFB,81050402 2CFB,81050404 2CFB,81050406 2CFB,81050408 2CFB,8105040A 2CFB,8105040C 2CFB,8105040E 2CFB +Cheat84="Replace Raw War with\DUDLEY ARENA",8105042C 21A7,8105042E 2D0D,81050432 2D0D,81050436 21A7,8105043E 2D0D,81050440 0000,81050442 0000,810500E8 2D0D,8105010C 2CFD,8105010E 2CFD,81050150 2D29,81050152 2CFB,81050400 09EF,81050402 09EF,81050404 0000,81050406 0000,81050408 0000,8105040A 0000,8105040C 09EF,8105040E 09EF,81050188 04F6,8105018A 04F7,8105018C 04F8,8105018E 04F9,81050190 09EF,81050192 0000,81050194 09EF,81050196 2D0D,810528F4 6666,810528F6 6666,81052CE8 2CC2,81052CEC 2D0D,81052D1C 2CD3,81052D1E 2CD4,81052D20 2CD5,81052D22 2CD6,81052D24 2CFD,81052D26 2CFD,81052D28 2CFB,81052D2A 2CFB,81050124 2CFD,81050126 2CFD,81050128 2CFD,8105012A 2CFD,8105012C 2CFD,8105012E 2CFD,81050130 2CFD,81050132 2CFD,81050134 2CFD,81050136 2CFD,81050154 2CFB,811533F8 002E +Cheat85="Replace Raw War with\FLAME ARENA",8105010E 0EFE,8105010C 0EFE,810528F4 2508,810528F6 2508,81050430 2401,81050430 2401,81050404 2401,81050406 2401,81050408 2401,81050409 2401,8105040A 2401,8105040C 2401,810500E8 2401 +Cheat86="Replace Raw War with\GREENWICH STREET ARENA",81050430 2DC5,81050436 0000,81050438 0000,8105043A 0000,8105043E 0000,810504E8 0EFE,8105010E 2DC5,8105010C 2DC5,81050196 2CFD,81050136 0FB6,81050134 0FC6,81050132 0FB6,81050130 0FC6,8105012E 0FB6,8105012C 0FC6,8105012A 0FB6,81050128 0FC6,81050126 0FB6,81050124 0FC6,81050440 0000,81050442 0000,50002C02 0000,81050378 0000,50002C02 0000,810502EC 0000,50001402 0000,81050290 0000,50000902 0000,81050262 0000,50000402 0000,810501CE 0000,50001002 0000,810501B8 0000,50000402 0000,810501E0 0000,8105042C 2D0D,81050430 0000,81050150 24F0 +Cheat87="Replace Raw War with\HHH ARNEA",8105040E 24EF,8105040C 24EF,8105040A 24EF,81050408 24EF,81050406 24EF,81050404 24EF,81050402 24EF,81050400 24EF,81050436 24E9,81050440 24E9,81050442 24E9,8105043E 24EF,8105042E 24EF,8105043C 24EF,8105042C 24E9,8105010E 24E9,8105010C 24E9,81050196 24E9,8105042E 24EF,81050432 24EF,810500F8 24EF,810500FA 24EF,810500FC 24EF,810500FC 24EF,81050100 24EF,81050100 24EF,81052CE8 2CCA,81052CEC 24EF,81050150 24E9,81050152 24E9,81050154 24E9,810528F4 24E9,810528F6 24E9 +Cheat88="Replace Raw War with\HOSPITAL ARENA",8105042C 0949,8105042E 283F,81050428 0949,81050430 0949,81050430 0949,81050436 096B,81050438 0993,8105043A 096B,8105043E 283F,81050440 283F,81050442 283F,810504E8 0949,81050150 283F,81050196 283F,81050400 283F,81050402 283F,81050404 283F,81050406 283F,81050408 283F,8105040A 283F,8105040C 283F,8105040E 283F,810500F8 283F,810500FA 283F,810500FC 283F,810500FE 283F,81050100 283F,81050100 283F,81052CE8 2CCA,81052CEC 283F,8105010E 283F,8105010C 283F,81050124 0949,81050126 0949,81050128 0949,8105012A 0949,8105012C 0949,8105012E 0949,81050130 0949,81050132 0949,81050134 0949,81050136 0949,810500E8 0949,810528F4 0000,81052CE0 2CC9 +Cheat89="Replace Raw War with\KANE ARENA",8105042C 0A61,8105042E 0A61,81050428 2B6C,81050430 2B6C,81050430 2B6C,81050436 2B57,81050438 2B57,8105043A 2B57,8105043E 0A61,81050440 2B57,81050442 2B57,810500E8 1B1E,8105010E 2D37,8105010C 209F,81050194 0955,81050196 2B57,81050400 2699,81050402 2699,81050404 2699,81050406 2699,81050408 2699,8105040A 2699,8105040C 2699,8105040E 2699 +Cheat90="Replace Raw War with\SHIMMER ARENA",8105042C 1932,8105042E 1932,81050430 1932,81050434 1932,81050432 1932,81050436 1932,81050438 1932,8105043A 1932,8105043E 1932,81050440 1932,81050442 1932,81050150 1932,81050152 1932,81050154 1932,81050190 1932,81050192 1932,81050194 1932,81050196 1932,81050124 1932,81050126 1932,81050128 1932,8105012A 1932,8105012C 1932,8105012E 1932,81050130 1932,81050132 1932,81050134 1932,81050136 1932,810500E8 1932,8105010E 1932,8105010C 1932 +Cheat91="Replace Raw War with\SPACE SHIP ARENA",8105042C 094D,8105042E 0953,81050430 0953,81050432 0F0E,81050434 0953,81050436 0F0E,81050438 0899,8105043C 0953,8105043E 0899,81050440 0963,81050442 0963,81050400 0953,81050402 0953,81050404 0953,81050406 0953,81050408 0953,8105040A 0953,8105040C 0953,8105040E 0953,810500E8 0A75,810528F4 7223,810528F6 0119,81050150 0963,81050152 0963,81050190 0953,81050192 0953,81050194 0953,81050196 0963,8105010E 0F0E,8105010C 0F0E,81050124 0F10,81050126 0F10,81050128 0F10,8105012A 0F10,8105012C 0F10,8105012E 0F10,81050130 0F10,81050132 0F10,81050134 0F10,81050136 0F10,810500F8 0963,810500FA 0963,810500FC 0963,810500FE 0963,81050100 0963,81050102 0963,81052CE8 2CCA,81052CEC 0963 +Cheat92="Tables\IN RING TABLE\Part 1",81052CF0 06E1,81052CF4 09F1,81052CF8 06E2,81052D00 09F1,81052D0C 06E3,81052D0E 06E4,81052D10 09EF,81052D12 09EF,81052D14 06E5,81052D16 06E6,81052D18 09EF,81052D1A 09EF,D1064880 0001,8115AFB0 432C,D1064880 0001,8115B308 432C,D1064880 2000,8115AFB0 42B4,D1064880 2000,8115B308 42B4,8116C330 0000,8116C332 0014,8116C334 0000,8116C336 0014,8116C374 4210,8116C376 C0B1,8116C378 432F,8116C37A 51DC,8116C37C 4210,8116C37E 92F1,8116C382 0800,8116C386 05A0,8116C38A 0800,8116C38C FFFF,8116C38E F3BC,8116C3E4 0000,8116C3E6 0015,8116C3E8 0000,8116C3EA 0015,8116C428 4210,8116C42A C0B1,8116C42C 432F,8116C42E 51DC,8116C430 4210,8116C432 92F1,8116C436 0800,8116C43A 05A0,8116C43E 0800,8116C440 FFFF,8116C442 F3BC,D1064880 2000,8116C378 42E0 +Cheat93="Tables\IN RING TABLE\Part 2",D1064880 2000,8116C382 07E0,D1064880 2000,8116C38A 0680,D1064880 2000,8116C42C 42E0,D1064880 2000,8116C436 0820,D1064880 2000,8116C43E 0980,8116C498 0000,8116C49A 0017,8116C49C 0000,8116C49E 0017,8116C4DC 4210,8116C4DE C0B1,8116C4E0 432A,8116C4E2 51DC,8116C4E4 4210,8116C4E6 92F1,8116C4EA 0800,8116C4EE 05A0,8116C4F2 0800,8116C4F4 FFFF,8116C4F6 F3BC,8116C54C 0000,8116C54E 0018,8116C550 0000,8116C552 0018,8116C590 4210,8116C592 C0B1,8116C594 432A,8116C596 51DC,8116C598 4210,8116C59A 92F1,8116C59E 0800,8116C5A2 05A0,8116C5A6 0800,8116C5A8 FFFF,8116C5AA F3BC,D1064880 2000,8116C4E0 42E0,D1064880 2000,8116C4EA 07E0,D1064880 2000,8116C4F2 0680,D1064880 2000,8116C594 42E0,D1064880 2000,8116C59E 0820,D1064880 2000,8116C5A6 0980 +Cheat94="Novalty\Truck In The Crowd",81050110 0747,81050112 0748,81050114 0749,81050116 074A,81050118 074B,81050124 0A4B,81050126 0A43,81050128 0A4B,8105012A 0A43,8105012C 0A43,8105012E 0A43,8105011A 074C,8105011C 074D,81050130 0A43,8105011E 074E,81050132 0A43,81050120 0746,81050134 0A4B,81050122 0743,81050136 0A4B,D1064880 2000,8115AFB0 42EE,D1064880 2000,8115B308 42EE +Cheat95="CPU To Human Control\Player 4",8015B9A1 00?? +Cheat95_O=$17 Human,$18 CPU +Cheat96="Clock At 00:00",8115AB1E 0000,810A99F2 0000 +Cheat97="Hacked Moves\Dragon Screw Stunner",D106B454 3749,D106B456 0094,8106B460 00E9,D106B454 3749,D106B456 0094,8106B462 B9BE,D106B514 374A,D106B516 0094,8106B520 00E9,D106B514 374A,D106B516 0094 +Cheat98="Hacked Moves\Morality Check to Back of head",D106B454 3892,D106B456 0000,8106B460 00B3,D106B454 3892,D106B456 0000,8106B462 194C +Cheat99="Hacked Moves\Dragon Screw Suplex",D106B454 3749,D106B456 007C,8106B460 00AD,D106B454 3749,D106B456 007C,8106B462 DB2A,D106B514 374A,D106B516 007C,8106B520 00AD,D106B514 374A,D106B516 007C,8106B522 EAE0,D106B454 3749,D106B456 00A5,8115AF52 0000,D106B514 374A,D106B516 00A5,8115B2AA 0000 +Cheat100="Hacked Moves\Dominator into HHH Facebuster",D106B454 3810,D106B456 005C,8106B560 011A,D106B454 3810,D106B456 005C,8106B562 A256,D106B514 3811,D106B516 005C,8106B520 011A,D106B514 3811,D106B516 005C,8106B522 ACB0,D106B454 3810,D106B456 0075,8115AF52 0000 +Cheat101="Hacked Moves\Capture Tazzplex",D106B454 3689,D106B456 0021,8106B460 00BC,D106B454 3689,D106B456 0021,8106B462 A5E2,D106B514 368A,D106B516 0021,8106B520 00BC,D106B514 368A,D106B516 0021,8106B522 B6BE +Cheat102="Hacked Moves\Running Rock Bottom",D106B454 3A80,D106B456 0000,8106B460 00C1,D106B454 3A80,D106B456 0000,8106B462 F7A2,D106B514 3A81,D106B516 0000,8106B520 00C2,D106B514 3A81,D106B516 0000,8106B522 1210 +Cheat103="Hacked Moves\Running Tazplex",D106B454 3A7A,D106B456 0000,8106B460 00BC,D106B454 3A7A,D106B456 0000,8106B462 A51E,D106B514 3A7B,D106B516 0000,8106B520 00BC,D106B514 3A7B,D106B516 0000,8106B522 B5FA +Cheat104="Tables\MOVABLE TABLES\Part 1",81052C24 06E1,81052C26 06E3,81052C2C 09F1,81052C2E 09EF,81052C30 06E2,81052C32 06E5,81052C38 09F1,81052C3A 09EF,81052C48 06E4,81052C4A 06E6,81052C50 09EF,81052C52 09EF,8116C3E4 0000,8116C3E6 0001,8116C3E8 0000,8116C3EA 0001,8116C498 0000,8116C49A 0003,8116C49C 0000,8116C49E 0003,8116C330 0000,8116C332 0000,8116C334 0000,8116C336 0000,D116C556 0000,8116C33A 0000,D116C33A 0000,8116C3EE 0000,D116C3EE 0000,8116C4A2 0000,D116C556 0001,8116C33A 0001,D116C33A 0001,8116C3EE 0001,D116C3EE 0001,8116C4A2 0001,D116C556 0002,8116C33A 0002,D116C33A 0002,8116C3EE 0002,D116C3EE 0002,8116C4A2 0002,D116C556 0003,8116C33A 0003,D116C33A 0003,8116C3EE 0003,D116C3EE 0003,8116C4A2 0003,D116C556 FFFF,8116C33A FFFF,D116C33A FFFF,8116C3EE FFFF,D116C3EE FFFF,8116C4A2 FFFF,D216C556 FFFF,81079B10 3F80,D1064886 2000,81079B10 3F81,D106488C 2000,81079B10 3F81,D1064892 2000,81079B10 3F81 +Cheat105="Tables\MOVABLE TABLES\Part 2",D116C33A FFFF,8116C382 0000,D116C382 0000,8116C386 0000,D116C386 0000,8116C38A 0000,D116C38A 0000,8116C38E 0000,D116C38E 0000,8116C436 0000,D116C436 0000,8116C43A 0000,D116C43A 0000,8116C43E 0000,D116C43E 0000,8116C442 0000,D116C442 0000,8116C4EA 0000,D116C4EA 0000,8116C4EE 0000,D116C4EE 0000,8116C4F2 0000,D116C4F2 0000,8116C4F6 0000,D116C594 42B4,D116C556 FFFF,8116C378 4335,D116C378 4335,8116C42C 4335,D116C42C 4335,8116C4E0 4335,D116C594 3DC7,D116C556 FFFF,8116C378 42B0,D116C378 42B0,8116C42C 42B0,D116C42C 42B0,8116C4E0 42B0,D1064880 2000,81079B10 3F81,D1079B10 3F81,D116C594 42B4,D116C556 FFFF,8116C378 42F0,D116C378 42F0,8116C42C 42F0,D116C42C 42F0,8116C4E0 42F0,D1079B10 3F81,8116C38A 0F00,D116C38A 0F00,8116C43E 0100,D116C594 3C93,8116C378 42B0,81052D18 0000,81052D1A 0000,D116C54C 0000,8116C54E 0018,D116C550 0000,8116C552 0018 +Cheat106="Tables\Sabu Table",8116C49A 000C,8116C49E 000C,8116C4DC 43CC,8116C4E0 42E6,8116C4E4 C2C5,8116C4EE 0800,8116C602 000C,8116C606 000C,8116C648 42E6,8116C644 43CC,8116C64C C314,81052C54 06E3,81052C5C 09EF,8116C6F8 43CC,8116C6FC 42F0,8116C700 C2F1,8116C70A 0400,8116C428 43CC,8116C430 C2D0,8116C42C 42F0,8116C43A 0C00,8116C6B6 0004,8116C6BA 0004,8116C3E6 0004,8116C3EA 0004,D1064880 2000,81005592 3F81,D1005592 3F81,8116C4EA 0F00,D1005592 3F81,8116C652 0100,D1005592 3F81,8116C4E0 4240,D1005592 3F81,8116C648 4240,D1064880 0005,81005CD4 3F83,D1005CD4 3F83,8116C4EA 0000,D1005CD4 3F83,8116C652 0000,D1005CD4 3F83,8116C4E0 42E6,D1005CD4 3F83,8116C648 42E6,D1005CD4 3F83,D1064880 2000,81005CD4 0000 +Cheat0_N=For Championship Mode +Cheat1_N=For Smackdown Mall Shop +Cheat15_N=This lets player 2 play with you in championship mode so if you have a friend that you want to tag team up with in tag team championship now you can. +Cheat19_N=Do not use with Auto Pin +Cheat20_N=Do not use with Auto Pin +Cheat21_N=Do not use with Auto Pin +Cheat22_N=Do not use with Auto Pin +Cheat23_N=Do not use with Cant Pin +Cheat24_N=Do not use with Cant Pin +Cheat25_N=Do not use with Cant Pin +Cheat26_N=Do not use with Cant Pin +Cheat27_N=Do not use this with anyother Play As Player 1 Option, only use one option at a time +Cheat28_N=Do not use this with anyother Play As Player 1 Option, only use one option at a time +Cheat29_N=Do not use this with anyother Play As Player 1 Option, only use one option at a time +Cheat30_N=Do not use this with anyother Play As Player 2 Option, only use one option at a time +Cheat31_N=Do not use this with anyother Play As Player 2 Option, only use one option at a time +Cheat32_N=Do not use this with anyother Play As Player 2 Option, only use one option at a time +Cheat33_N=Do not use this with anyother Play As Player 3 Option, only use one option at a time +Cheat34_N=Do not use this with anyother Play As Player 3 Option, only use one option at a time +Cheat35_N=Do not use this with anyother Play As Player 3 Option, only use one option at a time +Cheat36_N=Do not use this with anyother Play As Player 4 Option, only use one option at a time +Cheat37_N=Do not use this with anyother Play As Player 4 Option, only use one option at a time +Cheat38_N=Do not use this with anyother Play As Player 4 Option, only use one option at a time +Cheat42_N=Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time +Cheat43_N=Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time +Cheat44_N=Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time +Cheat45_N=Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time +Cheat46_N=Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time +Cheat47_N=Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time +Cheat48_N=Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time +Cheat49_N=Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time +Cheat50_N=Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time +Cheat51_N=Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time +Cheat52_N=Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time +Cheat53_N=Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time +Cheat54_N=Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time +Cheat55_N=Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time +Cheat56_N=Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time +Cheat57_N=Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time +Cheat58_N=Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time +Cheat59_N=Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time +Cheat60_N=Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time +Cheat61_N=Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time +Cheat62_N=Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time +Cheat63_N=Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time +Cheat64_N=Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time +Cheat65_N=Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time +Cheat66_N=Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time +Cheat67_N=Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time +Cheat68_N=Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time +Cheat69_N=Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time +Cheat70_N=Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time +Cheat71_N=Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time +Cheat72_N=Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time +Cheat73_N=Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time +Cheat74_N=Press Z for the ladder to appear, sometimes there is an invisable ladder +Cheat75_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat76_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat77_N=Both Parts must be on for this Press the C Left Button to make your opponent bleed,These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat78_N=Both Parts must be on for this Press the C Left Button to make your opponent bleed,These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat79_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat80_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat81_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat82_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat83_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat84_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat85_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat86_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat87_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat88_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat89_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat90_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat91_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat92_N=To Make the Table look broken Keep the Z Button press down, To make player stand on the Table, Stand next to it & Keep C-Right Pressed Down.Put all Parts on Together for this Cheat to work +Cheat93_N=To Make the Table look broken Keep the Z Button press down, To make player stand on the Table, Stand next to it & Keep C-Right Pressed Down.Put all Parts on Together for this Cheat to work +Cheat97_N=Dragon Screw 02 P1 does a Dragon Screw then picks up P2 (still holding his leg) and spins him around and gives him a Stone Cold Stunner +Cheat98_N=Replaces: Back Clothesline P1 is immediately backed up and does the Morality Check to P2 in the back of the head (misses by a little) +Cheat99_N=Replaces: Double Dragon Screw 02 P1 does a Dragon screw then picks then up (still holding their feet) and does a capture suplex. +Cheat100_N=Replaces: Dominator +Cheat101_N=Replaces: Capture Suplex P1 grabs P2's feet like a capture suplex, then lets go & does a Tazzplex. +Cheat102_N=Replaces: Farooq Spinebuster P2 runs into P1 and P1 delivers a RockBottom to P2. +Cheat103_N=Replaces: Underhook Belly to Belly P2 runs into P1 and P1 does a Tazplex to P2. +Cheat104_N=You must use both parts for this cheat to work +Cheat105_N=You must use both parts for this cheat to work +Cheat106_N= Breakable/Fixable/Rebreakable/Refixable press Z to break, C-right + Cdown to fix + +//---- + +[CD5BEC0F-86FD1008-C:45] +Name=WWF War Zone (U) +Cheat0="Extra Characters",8113A488 1000,8113A48A 07FF,8113A48C 2000,8113A48E 3FFF +Cheat1="Infinite Creation Points",80136245 0000 + +//---- + +[90A59003-31089864-C:45] +Name=WWF WrestleMania 2000 (U) +Cheat0="Have All Characters",8109ED5A FFFF +Cheat1="Infinite Create-A-Wrestler Attribute Points",8011A81B 001E +Cheat2="Timer Is Always 00:00",8016F0AF 0000 +Cheat3="Max Attributes",50000502 0000,8011A811 0032 +Cheat4="Weapon Select\Player 1",81167236 0300,81166D90 ????,81166D92 0000,80166E50 0000 +Cheat5="Weapon Select\Player 2",811676CA 0300,81166DC0 ????,80166DC2 0001,80166E51 0001 +Cheat6="Weapon Select\Player 3",81167B5E 0300,81166DF0 ????,80166DF2 0002,80166E52 0002 +Cheat7="Weapon Select\Player 4",81167FF2 0300,81166E18 ????,81166E1A 0003,80166E53 0003 +Cheat8="Always Special\Player 1",80167235 0004 +Cheat9="Always Special\Player 2",801676C9 0004 +Cheat10="Always Special\Player 3",80167B5D 0004 +Cheat11="Always Special\Player 4",80167FF1 0004 +Cheat12="Specials Don't Run Out",8112AD94 2400 +Cheat13="Max Spirit\Player 1",801671F5 00FF +Cheat14="Always Normal Spirit\Player 1",801671F5 0032 +Cheat15="No Spirit\Player 1",801671F5 0000 +Cheat16="Max Spirit\Player 2",80167689 00FF +Cheat17="Always Normal Spirit\Player 2",80167689 0032 +Cheat18="No Spirit\Player 2",80167689 0000 +Cheat19="Max Spirit\Player 3",80167B1D 00FF +Cheat20="Always Normal Spirit\Player 3",80167B1D 0032 +Cheat21="No Spirit\Player 3",80167B1D 0000 +Cheat22="Max Spirit\Player 4",80167FB1 00FF +Cheat23="Always Normal Spirit\Player 4",80167FB1 0032 +Cheat24="No Spirit\Player 4",80167FB1 0000 +Cheat25="Ultimate Codes\Player 1",801671F4 0064 +Cheat26="Ultimate Codes\Player 2",80167688 0064 +Cheat27="Ultimate Codes\Player 3",80167B1C 0064 +Cheat28="Ultimate Codes\Player 4",80167FB0 0064 +Cheat39="Easy Pins & Longer Submissions\Player 1",801671F4 0064 +Cheat30="Easy Pins & Longer Submissions\Player 2",80167688 0064 +Cheat31="Easy Pins & Longer Submissions\Player 3",80167B1C 0064 +Cheat32="Easy Pins & Longer Submissions\Player 4",80167FB0 0064 +Cheat4_O=$0000 Broom,$0101 Shovel,$0202 Red And White Hockey Stick,$0303 Guitar,$0404 Night Stick,$0505 Head,$0606 Black Hockey Stick,$0707 Bottle,$0808 2x4,$0909 Big Purple Sheet,$0A0A White Jug,$0B0B Suit Case,$0C0C Stick,$0D0D Head,$0E0E Big Mallot,$0F0F Black Microphone,$1010 BaseBall Bat,$1111 Folding Chair,$1212 Board,$1313 Stairs,$1414 Trashcan,$FFFF Nothing +Cheat5_O=$0000 Broom,$0101 Shovel,$0202 Red And White Hockey Stick,$0303 Guitar,$0404 Night Stick,$0505 Head,$0606 Black Hockey Stick,$0707 Bottle,$0808 2x4,$0909 Big Purple Sheet,$0A0A White Jug,$0B0B Suit Case,$0C0C Stick,$0D0D Head,$0E0E Big Mallot,$0F0F Black Microphone,$1010 BaseBall Bat,$1111 Folding Chair,$1212 Board,$1313 Stairs,$1414 Trashcan,$FFFF Nothing +Cheat6_O=$0000 Broom,$0101 Shovel,$0202 Red And White Hockey Stick,$0303 Guitar,$0404 Night Stick,$0505 Head,$0606 Black Hockey Stick,$0707 Bottle,$0808 2x4,$0909 Big Purple Sheet,$0A0A White Jug,$0B0B Suit Case,$0C0C Stick,$0D0D Head,$0E0E Big Mallot,$0F0F Black Microphone,$1010 BaseBall Bat,$1111 Folding Chair,$1212 Board,$1313 Stairs,$1414 Trashcan,$FFFF Nothing +Cheat7_O=$0000 Broom,$0101 Shovel,$0202 Red And White Hockey Stick,$0303 Guitar,$0404 Night Stick,$0505 Head,$0606 Black Hockey Stick,$0707 Bottle,$0808 2x4,$0909 Big Purple Sheet,$0A0A White Jug,$0B0B Suit Case,$0C0C Stick,$0D0D Head,$0E0E Big Mallot,$0F0F Black Microphone,$1010 BaseBall Bat,$1111 Folding Chair,$1212 Board,$1313 Stairs,$1414 Trashcan,$FFFF Nothing + +//---- + +[0553AE9D-EAD8E0C1-C:45] +Name=Xena Warrior Princess: The Talisman of Fate (U) +Cheat0="1 Hit to Kill Opponent\Player 1",D10B6354 42C8,810B6354 4080 +Cheat1="Opponent Has No Energy\Player 1",810B6354 C080 +Cheat2="Player 2 Never Wins",800C0C05 0000 +Cheat3="Infinite Health\Player 1",810B6170 42C8 +Cheat4="Infinite Health\Player 2",810B6354 42C8 +Cheat5="1 Hit to Kill Opponent\Player 2",D10B6170 42C8,810B6170 4080 +Cheat6="Opponent Has No Energy\Player 2",810B6170 C080 +Cheat7="Player 1 Never Wins",800C0C03 0000 +Cheat8="Unlock Titan Difficulty Level",810BF752 0001 + +//---- + +[2337D8E8-6B8E7CEC-C:45] +Name=Yoshi's Story (U) +Cheat0="Infinite\Health",8102B780 2400 +Cheat0_N=This is for All Yoshis All levels +Cheat1="Infinite\Eggs Once You Get One",8103E89C 2400 +Cheat1_N=This is for All Yoshis All levels +Cheat2="Infinite\Lives",800F8DF7 00FF +Cheat2_N=This is for All Yoshis All levels + +//---- + +[1D4136F3-AF63EEA9-C:45] +Name=Legend of Zelda, The - Ocarina of Time - Master Quest (E) [f1] (NTSC) +Cheat0="Infinite\Rupees",81119D04 0001 +Cheat1="Max\Double Defense Power",80118A07 0014 +Cheat1_N=This gives you White Border Hearts +Cheat2="Use Any Item In Any House",81119B5A 0000,81119B5C 0000 +Cheat3="Have\All Equipment",811189D4 7777 +Cheat5="Max\Heart Containers",81118966 0140 +Cheat6="Max\Gold Skulltulas Killed",80118A09 0064 +Cheat7="Time of Day Modifier",81118944 ???? +Cheat7_O=$4000 At Sunrise,$5800 Daylight Out,$7000 Very Bright Out,$C000 At Sunset,$D000 Fairly Dark +Cheat8="Infinite\Energy",81118968 0140 +Cheat9="Infinite\Magic",D0118971 0008,80118972 0001,80118974 0001,8011896B 0060 +Cheat10="Tunic & Boot Options",801189A8 00?? +Cheat11="Infinite\Deku Sticks",801189C4 0009 +Cheat12="Infinite\Deku Nuts",801189C5 0009 +Cheat13="Infinite\Bombs",801189C6 0009 +Cheat14="Infinite\Arrows",801189C7 0009 +Cheat15="Infinite\Deku Seeds",801189CA 0009 +Cheat16="Infinite\Bombchu's",801189CC 0009 +Cheat17="Infinite\Magic Beans",801189D2 0009 +Cheat18="Infinite\Big Key,Small Keys,Compass,& Map",801189E0 0007,801189E1 0007,801189E2 0007,801189E3 0007,801189E4 0007,801189E5 0007,801189E6 0007,801189E7 0007,801189E8 0007,801189E9 0007,801189EA 0007,801189F7 0009,801189F8 0009,801189F9 0009,801189FA 0009,801189FB 0009,80118A01 0009,80118A04 0009,801189FF 0009 +Cheat19="Have\Ocarina",801189B3 00?? +Cheat20="Have\Boomerang",801189B8 000E +Cheat21="Have\Lens of Truth",801189B9 000F +Cheat22="Have\Megaton Hammer",801189BB 0011 +Cheat23="Have\Deku Stick",801189AC 0000 +Cheat24="Have\Deku Nut",801189AD 0001 +Cheat25="Have\Bombs",801189AE 0002 +Cheat26="Have\Fairy Bow",801189AF 0003 +Cheat27="Have\Fairy Slingshot",801189B2 0006 +Cheat28="Have\Bombchu",801189B4 0009 +Cheat29="Have\Arrows\Fire Arrow",801189B0 0004 +Cheat30="Have\Arrows\Ice Arrow",801189B6 000C +Cheat31="Have\Arrows\Light Arrow",801189BC 0012 +Cheat32="Have\Hookshot",801189B5 00?? +Cheat33="Have\Magic Beans",801189BA 0010 +Cheat34="Have\Magic\Fairie's Wind",801189B7 000D +Cheat35="Have\Magic\Nayru's Love",801189BD 0013 +Cheat36="Have\Magic\Din's Fire",801189B1 0005 +Cheat37="Bottles\Bottle 1 Modifier",801189BE 00?? +Cheat38="Bottles\Bottle 2 Modifier",801189BF 00?? +Cheat39="Bottles\Bottle 3 Modifier",801189C0 00?? +Cheat40="Bottles\Bottle 4 Modifier",801189C1 00?? +Cheat41="Trading\Adult Link Item",801189C2 00?? +Cheat42="Trading\Young Link Item",801189C3 00?? +Cheat43="Turn Giant's Knife Into Biggoron's Sword",80118976 0001 +Cheat44="Have Quiver (Holds 30)",801189D9 0001 +Cheat45="Equipment Modifier 1",801189DA 00?? +Cheat46="Equipment Modifier 2",801189DB 00?? +Cheat47="Warp Song Location\Minuet of Forest & Serenade of Water",80119CCD 00?? +Cheat47_O=$00 Sacred Forest Meadow,$04 Lake Hylia,$15 Inside Jabu Jabu's Belly,$18 Dodongo's Cavern,$68 Inside The Deku Tree +Cheat47_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat48="Warp Song Location\Prelude of Light & Nocturne of Shadow",80119CCD 00?? +Cheat48_O=$03 Kakariko Windmill,$07 Bombchu Bowling Alley,$0F Zelda & Impa Flee,$14 Kakariko Village,$17 Ganon,Final Battle,$1D Top of Ganon's Tower,$28 Bombchu Shop,$2C Bazaar,$30 Happy Mask Shop,$34 Ganon's Tower,$38 Ganon's Castle,$4C Inside Spirit Door,$6C Burning Castle,$50 House of Skulltula,$64 Death Mountain Trail,$68 Graveyard,$70 Thieves' Hideout,$74 Royal Family's Tomb,$78 Great Fairy Fountain 1,$84 Forest Temple,Room With Falling Floor,$88 Great Fairy Fountain 2,$99 Grotto 01,$9D Grotto 02,$A4 Grotto 04,$A8 Grotto 05,$B3 Grotto 06,$B0 Grotto 07,$B4 Grotto 08,$B8 Grotto 09,$C3 Grotto 10,$C0 Grotto 11,$C4 Grotto 12,$FC Grotto 13,$D3 Bottom of the Well,$D0 Lon Lon Ranch Shed,$D3 Lon Lon Ranch Outside Shed,$D8 Ice Cavern,$E3 Outside Cow Pen,$E0 Lost Woods Bridge,$E4 Lon Lon Ranch Chicken Room,$E8 In Front of Deku Tree,$EB Spirit Temple Boss,$F1 Castle Courtyard,In Front of Zelda,$F4 Temple of Time,$F8 Gerudo Fortress Jail +Cheat48_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat49="Warp Song Location\Bolero of Fire",80119CCD 00?? +Cheat49_O=$03 Castle Courtyard,$0B Dodongo's Cavern Boss,$10 Inside The Deku Tree Boss,$14 Shadow Temple Boss,$17 Water Temple Boss,$1C Ganon's Castle Tower,$1F Ganon First Battle,$28 Ganon's Castle Room Before Ganon,$2B Inside Ganon's Castle Room With Pillar,$2F Lon Lon Ranch,$33 Mido's House,$37 Saria's House,$4B Bearded Man's House,$40 Top of Ganon's Castle,$47 Outside Saria's House,$4F Dampe's Race,$57 Kokiri Forest,$5B Top of Death Mountain,$5F Fishing Pond,$68 Inside Ganon's Castle,$7F Hyrule Castle Gate,$BA Top of Ganon's Tower,$C2 Great Fairy Fountain,$D6 Lost Woods Goron Entrance,$DA Lost Woods River Entrance,$DE Lost Woods Bridge Field Entrance,$E3 Goron City Lost Woods Entrance,$F6 Death Mountain Crater,$FD Ganon's Castle +Cheat49_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat50="Warp Song Location\Requiem of Spirit",80119CCD 00?? +Cheat50_O=$05 Lake Hylia,$08 Zora's Domain,$18 Gerudo Valley,$1E Lost Woods,$28 Gerudo Fortress,$30 Haunted Wasteland,$34 Ganon's Castle Inside Burning Castle,$38 Hyrule Castle,$3A Ganon's Castle,$3D Death Mountain Trail,$4D Goron City,$65 Fire Temple,$69 Forest Temple,$6E Shooting Gallery,$79 Ganon's Castle Inside Burning Castle,$7E Kakariko Village Entrance,$7B Zora's River Entrance,$85 Kokiri Forest Entrance,$8A Lake Hyrule Entrance,$8E Gerudo Valley Entrance,$92 Death Mountain Trail Entrance,$95 Graveyard Entrance,$9E Zora's Domain Entrance,$A2 Zora's Fountain Entrance,$BA Goron City Entrance,$BE Death Mountain Trail,$C1 Goron City,$C5 Lakeside Laboratory,$C9 Top of Ganon's Castle,$CD Hyrule Market (Child Link's),$CF Hyrule Market (Adult Link's),$F1 Desert Colossus,$FA Lon Lon Ranch Entrance,$FD Hyrule Field +Cheat50_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat51="Nayru's Love is Always",81119D00 ???? +Cheat51_O=$0000 OFF,$FFFF ON +Cheat51_N=For this to work On Or off, you have to walk through a Doorway to activate the Change. +Cheat52="Infinite\Timers\All Other Timers",8011B9A1 0032 +Cheat52_N=This cheat works on all Race Timers not the final Boss and Under Water with iron Boots etc. +Cheat53="Epona\Max Carrots\Lon Lon Raunch",801F1A68 0005,801EE508 0005 +Cheat53_N=This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona +Cheat54="Infinite\Timers\Escape From Gannons Tower",80119D0D 00B4 +Cheat54_N=This cheat works only on The Final Boss. +Cheat55="Beta\Play Beta Quest Worlds",D011BB71 0000,80119D4B 00?? +Cheat55_O=$00 World 01,$01 World 02,$02 World 03,$03 World 04,$04 World 05,$07 World 06,$08 World 07,$16 World 08 +Cheat55_N=Put on the code on load up,& then press reset (F1) you will be in Beta Mode,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. +Cheat56="Level Select",D01C6E35 0000,8111893A ???? +Cheat56_O=$0000 Inside the Deku Tree,$0004 Dodongo's Cavern,$0008 Gerudo Training Ground,$000C Below The Phantom Gannon Boss,$0010 Water Temple,$0027 Inside Jabu-Jabu's Belly,$002C Royal Family's Tomb,$0036 Shoadow Temple,$0042 Lakeside Laboratory,$0052 Temple Of Time,$006C ? +Cheat57="Language Select",80119D41 00?? +Cheat57_O=$00 English,$01 German,$02 French +Cheat58="Press L\To Levitate",D011BB11 0020,811D93D0 40CB +Cheat59="Press L\For Infinite Hover Boots",D011BB11 0020,811D9BF2 000D +Cheat60="Instant Step Hoover Boots",D011BB11 0020,811D93D0 40CB,D011BB11 0000,811D9BF2 000D,801189A8 00?? +Cheat60_O=$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat61="Beta\Specific things lean",8002397C 0001 +Cheat61_N=This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest World 01) +Cheat62="Beta\Appear in Strange Places (Hold R)",D01C681D 0010,81119C9E 0001 +Cheat62_N=If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. +Cheat63="Beta\Interface always off/on",80119821 00FF,80119C97 00?? +Cheat63_O=$00 Off,$01 On +Cheat63_N=If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset. +Cheat64="Always Have Wallet Size",801189DA 00?? +Cheat64_O=$47 Kid Wallet (Holds 99),$57 Adult Wallet (Holds 200),$67 Giant Wallet (Holds 500) +Cheat10_O=$11 Kokiri Tunic & Kokiri Boots,$12 Goron Tunic & Kokiri Boots,$13 Zora Tunic & Kokiri Boots,$14 Black Tunic & Kokiri Boots,$15 White Tunic & Kokiri Boots,$16 Yellow Tunic & Kokiri Boots,$21 Kokiri Tunic & Iron Boots,$22 Goron Tunic & Iron Boots,$23 Zora Tunic & Iron Boots,$24 Black Tunic & Iron Boots,$25 White Tunic & Iron Boots,$26 Yellow Tunic & Iron Boots,$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat19_O=$07 Fairy Ocarina,$08 Ocarina Of Time +Cheat32_O=$0A Hookshot,$0B Longshot +Cheat37_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat38_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat39_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat40_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat41_O=$2D Pocket Egg,$2E Pocket Cucco,$2F Cojiro,$30 Odd Mushroom,$31 Odd Potion,$32 Poacher's Saw,$33 Goron's Sword (Broken),$34 Prescription,$35 Eyeball Frog,$36 Eye Drops,$37 Claim Check +Cheat42_O=$21 Weird Egg,$22 Chicken,$23 Zelda's Letter,$24 Keaton Mask,$25 Skull Mask,$26 Spooky Mask,$27 Bunny Hood,$28 Goron Mask,$29 Zora Mask,$2A Gerudo Mask,$2B Mask of Truth,$2C SOLD OUT +Cheat45_O=$02 Silver Scale,$04 Golden Scale,$06 Giant's Knife (Broken),$35 Black Gauntlets,$40 Bullet Bag (Holds 30),$80 Bullet Bag (Holds 40),$C0 Bullet Bag (Holds 50) +Cheat46_O=$08 Bomb Bag (Holds 20),$10 Bomb Bag (Holds 30),$18 Bomb Bag (Holds 40),$20 Goron's Bracelet,$28 Silver Gauntlets,$30 Golden Gauntlets +Cheat0_N=This cheat allows you to have the max Rupees to the Wallet you currently Hold +Cheat2_N=do not use under or in water +Cheat3_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal +Cheat10_N=This changes what you are wearing,once you have enabled the code press Start & then start again. +Cheat45_N=This modifies the equipment you are carrying. +Cheat46_N=This modifies the equipment you are carrying. +Cheat58_N=Press L To Levitate & Let go to land +Cheat59_N=Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on +Cheat60_N=Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. +Cheat4="Have\All Quest/Status Items",811189DC 30FF,811189DE FFFF +Cheat4_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + +//---- + +[27A3831D-B505A533-C:45] +Name=Legend of Zelda, The - Ocarina of Time - Master Quest (E) [f2] +Cheat0="Infinite\Rupees",81119D04 0001 +Cheat1="Max\Double Defense Power",80118A07 0014 +Cheat1_N=This gives you White Border Hearts +Cheat2="Use Any Item In Any House",81119B5A 0000,81119B5C 0000 +Cheat3="Have\All Equipment",811189D4 7777 +Cheat5="Max\Heart Containers",81118966 0140 +Cheat6="Max\Gold Skulltulas Killed",80118A09 0064 +Cheat7="Time of Day Modifier",81118944 ???? +Cheat7_O=$4000 At Sunrise,$5800 Daylight Out,$7000 Very Bright Out,$C000 At Sunset,$D000 Fairly Dark +Cheat8="Infinite\Energy",81118968 0140 +Cheat9="Infinite\Magic",D0118971 0008,80118972 0001,80118974 0001,8011896B 0060 +Cheat10="Tunic & Boot Options",801189A8 00?? +Cheat11="Infinite\Deku Sticks",801189C4 0009 +Cheat12="Infinite\Deku Nuts",801189C5 0009 +Cheat13="Infinite\Bombs",801189C6 0009 +Cheat14="Infinite\Arrows",801189C7 0009 +Cheat15="Infinite\Deku Seeds",801189CA 0009 +Cheat16="Infinite\Bombchu's",801189CC 0009 +Cheat17="Infinite\Magic Beans",801189D2 0009 +Cheat18="Infinite\Big Key,Small Keys,Compass,& Map",801189E0 0007,801189E1 0007,801189E2 0007,801189E3 0007,801189E4 0007,801189E5 0007,801189E6 0007,801189E7 0007,801189E8 0007,801189E9 0007,801189EA 0007,801189F7 0009,801189F8 0009,801189F9 0009,801189FA 0009,801189FB 0009,80118A01 0009,80118A04 0009,801189FF 0009 +Cheat19="Have\Ocarina",801189B3 00?? +Cheat20="Have\Boomerang",801189B8 000E +Cheat21="Have\Lens of Truth",801189B9 000F +Cheat22="Have\Megaton Hammer",801189BB 0011 +Cheat23="Have\Deku Stick",801189AC 0000 +Cheat24="Have\Deku Nut",801189AD 0001 +Cheat25="Have\Bombs",801189AE 0002 +Cheat26="Have\Fairy Bow",801189AF 0003 +Cheat27="Have\Fairy Slingshot",801189B2 0006 +Cheat28="Have\Bombchu",801189B4 0009 +Cheat29="Have\Arrows\Fire Arrow",801189B0 0004 +Cheat30="Have\Arrows\Ice Arrow",801189B6 000C +Cheat31="Have\Arrows\Light Arrow",801189BC 0012 +Cheat32="Have\Hookshot",801189B5 00?? +Cheat33="Have\Magic Beans",801189BA 0010 +Cheat34="Have\Magic\Fairie's Wind",801189B7 000D +Cheat35="Have\Magic\Nayru's Love",801189BD 0013 +Cheat36="Have\Magic\Din's Fire",801189B1 0005 +Cheat37="Bottles\Bottle 1 Modifier",801189BE 00?? +Cheat38="Bottles\Bottle 2 Modifier",801189BF 00?? +Cheat39="Bottles\Bottle 3 Modifier",801189C0 00?? +Cheat40="Bottles\Bottle 4 Modifier",801189C1 00?? +Cheat41="Trading\Adult Link Item",801189C2 00?? +Cheat42="Trading\Young Link Item",801189C3 00?? +Cheat43="Turn Giant's Knife Into Biggoron's Sword",80118976 0001 +Cheat44="Have Quiver (Holds 30)",801189D9 0001 +Cheat45="Equipment Modifier 1",801189DA 00?? +Cheat46="Equipment Modifier 2",801189DB 00?? +Cheat47="Warp Song Location\Minuet of Forest & Serenade of Water",80119CCD 00?? +Cheat47_O=$00 Sacred Forest Meadow,$04 Lake Hylia,$15 Inside Jabu Jabu's Belly,$18 Dodongo's Cavern,$68 Inside The Deku Tree +Cheat47_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat48="Warp Song Location\Prelude of Light & Nocturne of Shadow",80119CCD 00?? +Cheat48_O=$03 Kakariko Windmill,$07 Bombchu Bowling Alley,$0F Zelda & Impa Flee,$14 Kakariko Village,$17 Ganon,Final Battle,$1D Top of Ganon's Tower,$28 Bombchu Shop,$2C Bazaar,$30 Happy Mask Shop,$34 Ganon's Tower,$38 Ganon's Castle,$4C Inside Spirit Door,$6C Burning Castle,$50 House of Skulltula,$64 Death Mountain Trail,$68 Graveyard,$70 Thieves' Hideout,$74 Royal Family's Tomb,$78 Great Fairy Fountain 1,$84 Forest Temple,Room With Falling Floor,$88 Great Fairy Fountain 2,$99 Grotto 01,$9D Grotto 02,$A4 Grotto 04,$A8 Grotto 05,$B3 Grotto 06,$B0 Grotto 07,$B4 Grotto 08,$B8 Grotto 09,$C3 Grotto 10,$C0 Grotto 11,$C4 Grotto 12,$FC Grotto 13,$D3 Bottom of the Well,$D0 Lon Lon Ranch Shed,$D3 Lon Lon Ranch Outside Shed,$D8 Ice Cavern,$E3 Outside Cow Pen,$E0 Lost Woods Bridge,$E4 Lon Lon Ranch Chicken Room,$E8 In Front of Deku Tree,$EB Spirit Temple Boss,$F1 Castle Courtyard,In Front of Zelda,$F4 Temple of Time,$F8 Gerudo Fortress Jail +Cheat48_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat49="Warp Song Location\Bolero of Fire",80119CCD 00?? +Cheat49_O=$03 Castle Courtyard,$0B Dodongo's Cavern Boss,$10 Inside The Deku Tree Boss,$14 Shadow Temple Boss,$17 Water Temple Boss,$1C Ganon's Castle Tower,$1F Ganon First Battle,$28 Ganon's Castle Room Before Ganon,$2B Inside Ganon's Castle Room With Pillar,$2F Lon Lon Ranch,$33 Mido's House,$37 Saria's House,$4B Bearded Man's House,$40 Top of Ganon's Castle,$47 Outside Saria's House,$4F Dampe's Race,$57 Kokiri Forest,$5B Top of Death Mountain,$5F Fishing Pond,$68 Inside Ganon's Castle,$7F Hyrule Castle Gate,$BA Top of Ganon's Tower,$C2 Great Fairy Fountain,$D6 Lost Woods Goron Entrance,$DA Lost Woods River Entrance,$DE Lost Woods Bridge Field Entrance,$E3 Goron City Lost Woods Entrance,$F6 Death Mountain Crater,$FD Ganon's Castle +Cheat49_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat50="Warp Song Location\Requiem of Spirit",80119CCD 00?? +Cheat50_O=$05 Lake Hylia,$08 Zora's Domain,$18 Gerudo Valley,$1E Lost Woods,$28 Gerudo Fortress,$30 Haunted Wasteland,$34 Ganon's Castle Inside Burning Castle,$38 Hyrule Castle,$3A Ganon's Castle,$3D Death Mountain Trail,$4D Goron City,$65 Fire Temple,$69 Forest Temple,$6E Shooting Gallery,$79 Ganon's Castle Inside Burning Castle,$7E Kakariko Village Entrance,$7B Zora's River Entrance,$85 Kokiri Forest Entrance,$8A Lake Hyrule Entrance,$8E Gerudo Valley Entrance,$92 Death Mountain Trail Entrance,$95 Graveyard Entrance,$9E Zora's Domain Entrance,$A2 Zora's Fountain Entrance,$BA Goron City Entrance,$BE Death Mountain Trail,$C1 Goron City,$C5 Lakeside Laboratory,$C9 Top of Ganon's Castle,$CD Hyrule Market (Child Link's),$CF Hyrule Market (Adult Link's),$F1 Desert Colossus,$FA Lon Lon Ranch Entrance,$FD Hyrule Field +Cheat50_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat51="Nayru's Love is Always",81119D00 ???? +Cheat51_O=$0000 OFF,$FFFF ON +Cheat51_N=For this to work On Or off, you have to walk through a Doorway to activate the Change. +Cheat52="Infinite\Timers\All Other Timers",8011B9A1 0032 +Cheat52_N=This cheat works on all Race Timers not the final Boss and Under Water with iron Boots etc. +Cheat53="Epona\Max Carrots\Lon Lon Raunch",801F1A68 0005,801EE508 0005 +Cheat53_N=This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona +Cheat54="Infinite\Timers\Escape From Gannons Tower",80119D0D 00B4 +Cheat54_N=This cheat works only on The Final Boss. +Cheat55="Beta\Play Beta Quest Worlds",D011BB71 0000,80119D4B 00?? +Cheat55_O=$00 World 01,$01 World 02,$02 World 03,$03 World 04,$04 World 05,$07 World 06,$08 World 07,$16 World 08 +Cheat55_N=Put on the code on load up,& then press reset (F1) you will be in Beta Mode,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. +Cheat56="Level Select",D01C6E35 0000,8111893A ???? +Cheat56_O=$0000 Inside the Deku Tree,$0004 Dodongo's Cavern,$0008 Gerudo Training Ground,$000C Below The Phantom Gannon Boss,$0010 Water Temple,$0027 Inside Jabu-Jabu's Belly,$002C Royal Family's Tomb,$0036 Shoadow Temple,$0042 Lakeside Laboratory,$0052 Temple Of Time,$006C ? +Cheat57="Language Select",80119D41 00?? +Cheat57_O=$00 English,$01 German,$02 French +Cheat58="Press L\To Levitate",D011BB11 0020,811D93D0 40CB +Cheat59="Press L\For Infinite Hover Boots",D011BB11 0020,811D9BF2 000D +Cheat60="Instant Step Hoover Boots",D011BB11 0020,811D93D0 40CB,D011BB11 0000,811D9BF2 000D,801189A8 00?? +Cheat60_O=$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat61="Beta\Specific things lean",8002397C 0001 +Cheat61_N=This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest World 01) +Cheat62="Beta\Appear in Strange Places (Hold R)",D01C681D 0010,81119C9E 0001 +Cheat62_N=If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. +Cheat63="Beta\Interface always off/on",80119821 00FF,80119C97 00?? +Cheat63_O=$00 Off,$01 On +Cheat63_N=If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset. +Cheat64="Always Have Wallet Size",801189DA 00?? +Cheat64_O=$47 Kid Wallet (Holds 99),$57 Adult Wallet (Holds 200),$67 Giant Wallet (Holds 500) +Cheat10_O=$11 Kokiri Tunic & Kokiri Boots,$12 Goron Tunic & Kokiri Boots,$13 Zora Tunic & Kokiri Boots,$14 Black Tunic & Kokiri Boots,$15 White Tunic & Kokiri Boots,$16 Yellow Tunic & Kokiri Boots,$21 Kokiri Tunic & Iron Boots,$22 Goron Tunic & Iron Boots,$23 Zora Tunic & Iron Boots,$24 Black Tunic & Iron Boots,$25 White Tunic & Iron Boots,$26 Yellow Tunic & Iron Boots,$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat19_O=$07 Fairy Ocarina,$08 Ocarina Of Time +Cheat32_O=$0A Hookshot,$0B Longshot +Cheat37_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat38_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat39_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat40_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat41_O=$2D Pocket Egg,$2E Pocket Cucco,$2F Cojiro,$30 Odd Mushroom,$31 Odd Potion,$32 Poacher's Saw,$33 Goron's Sword (Broken),$34 Prescription,$35 Eyeball Frog,$36 Eye Drops,$37 Claim Check +Cheat42_O=$21 Weird Egg,$22 Chicken,$23 Zelda's Letter,$24 Keaton Mask,$25 Skull Mask,$26 Spooky Mask,$27 Bunny Hood,$28 Goron Mask,$29 Zora Mask,$2A Gerudo Mask,$2B Mask of Truth,$2C SOLD OUT +Cheat45_O=$02 Silver Scale,$04 Golden Scale,$06 Giant's Knife (Broken),$35 Black Gauntlets,$40 Bullet Bag (Holds 30),$80 Bullet Bag (Holds 40),$C0 Bullet Bag (Holds 50) +Cheat46_O=$08 Bomb Bag (Holds 20),$10 Bomb Bag (Holds 30),$18 Bomb Bag (Holds 40),$20 Goron's Bracelet,$28 Silver Gauntlets,$30 Golden Gauntlets +Cheat0_N=This cheat allows you to have the max Rupees to the Wallet you currently Hold +Cheat2_N=do not use under or in water +Cheat3_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal +Cheat10_N=This changes what you are wearing,once you have enabled the code press Start & then start again. +Cheat45_N=This modifies the equipment you are carrying. +Cheat46_N=This modifies the equipment you are carrying. +Cheat58_N=Press L To Levitate & Let go to land +Cheat59_N=Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on +Cheat60_N=Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. +Cheat4="Have\All Quest/Status Items",811189DC 30FF,811189DE FFFF +Cheat4_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + + +//--------------- PAL (E) Region Cheat Codes + + + +[0414CA61-2E57B8AA-C:50] +Name=GOLDENEYE +Cheat0="Enemies Do Nothing",80027E54 00FF +Cheat1="Enemy Options",80032142 00?? +Cheat1_O=$01 Enemies Come After You,$97 Enemies Move Around & Check,$FF Enemies Check Around Themselves +Cheat2="Enable All Levels & In-Built Cheat Menu",8105886E FFFF,80058870 00FF,800588A5 00FF,800588A7 00FF,800588AA 00FF,800588AC 00FF,800588AF 00FF,800588B1 00FF,800588BB 00FF,800588B6 00FF,800588B9 00FF,800588BB 00FF +Cheat3="All Objectives Complete",80064C9B 0001,80064C9F 0001,80064CA3 0001,80064CA7 0001,80064CAB 0001 +Cheat4="Freeze Unfreeze enemies",D00572D1 0008,80027E5C 000F,D00572D1 0004,80027E5C 0000 +Cheat1_N="These Codes Are very very cool but in most places pointless ! But great fun, try then. But remember to deactivate them before coming to the end of the level, otherwise, there will be nothing/no one, to meet or do (:" +Cheat2_N=This code gives you all of the levels, all of the in-game cheats, and the special 007 mode!Hit the "A" button until you come to the place where you choose your level. EVERY SINGLE ONE SHOULD BE THERE. Hit "B" again and check out the Cheats. ALL 23 SHOULD BE THERE. When you pick your stage, you will see another difficulty level, "007". This is the level editor, where you can change all kinds of stuff! +Cheat4_N=Press C-Up To Freeze & C-Down To Unfreeze. +Cheat6="Facility Back Zone In Multiplayer\Part 1\2 players",811E6554 45E4,811E6558 43D5,811E655C C5A7,811E657C 801C,811E657E 6774,811E5164 45E4,811E5168 C383,811E516C 4492,811E518C 801C,811E518E D574,811E78C0 45AD,811E78C4 C383,811E78C8 4440,811E78E8 801C,811E78EA E464,811E4D18 45D0,811E4D1C 4307,811E4D20 C4FB,811E4D40 801C,811E4D42 75EC,811E6738 45CD,811E673C C383,811E6740 43F4,811E6760 801C,811E6762 A0DC,811E5450 45C2,811E5454 4356,811E5458 C598,811E5478 801C,811E547A 6A74,811E5240 4608,811E5244 4307,811E5248 43DC,811E5268 801C,811E526A 962C,811E691C 4606,811E6920 4321,811E6924 449D,811E6944 801C,811E6946 CBEC,801ED447 008A,801ED4DB 008B,801ED56F 008C,801ED603 008D,801ED697 008E,801ED72B 008F,801ED7BF 007D,801ED853 007E,801ED443 002A,801ED4D7 002A,801ED56B 002A,801ED5FF 002A,801ED693 002A,801ED727 002A,801ED7BB 002A,801ED84F 002A,801ED449 0000,801ED4DD 0000,801ED571 0000,801ED605 0000,801ED699 0000,801ED72D 0000,801ED7C1 0000,801ED855 0000,801ED44D 0000,801ED4E1 0000,801ED575 0000,801ED609 0000,801ED69D 0000,801ED731 0000,801ED7C5 0000,801ED859 0000,801EB743 002A,801EB745 0068,811EB746 277F,811EB748 1000,811EB74A 0262,811EB7C2 0190,801EB7C5 0000,811EB7C6 0258 +Cheat7="Facility Back Zone In Multiplayer\Part 2\2 players",811EB7C8 0000,811EB7CC FFFF,811EB7CE FFFF,811EB7D2 0000,801EB7D5 0000,801EB7DB 0000,811EB7E2 0000,801EB7E7 0000,801EB843 002A,801EB845 0068,811EB846 2780,811EB848 1000,811EB84A 0262,811EB8C2 0190,801EB8C5 0000,811EB8C6 0258,811EB8C8 0000,811EB8CC FFFF,811EB8CE FFFF,811EB8D2 0000,801EB8D5 0000,801EB8DB 0000,811EB8E2 0000,801EB8E7 0000,801EB943 002A,801EB945 0068,811EB946 2791,811EB948 1000,811EB94A 0262,811EB9C2 0190,801EB9C5 0000,811EB9C6 0258,811EB9C8 0000,811EB9CC FFFF,811EB9CE FFFF,811EB9D2 0000,801EB9D5 0000,801EB9DB 0000,811EB9E2 0000,801EB9E7 0000,801EBA43 002A,801EBA45 0068,811EBA46 2792,811EBA48 1000,811EBA4A 0262,811EBAC2 0190,801EBAC5 0000,811EBAC6 0258,811EBAC8 0000,811EBACC FFFF,811EBACE FFFF,811EBAD2 0000,801EBAD5 0000,801EBADB 0000,811EBAE2 0000,801EBAE7 0000,801EBB45 00A0,801EBC45 00A0,801EBD45 00A0,801EBE45 00A0,801EBB47 0075,801EBC47 0076,801EBD47 0077,801EBE47 0078,801EBBE7 0001,801EBCE7 0001,801EBDE7 0001,801EBEE7 0001,801EC247 0071,801ECD47 0072,801ECE47 0074,801ECF47 006C,801ED047 0079,801ED147 0083,D01EBFC5 005A,801EBFC5 0000,D11EBFC6 0000,811EBFC6 F333,D11EBFC8 03E8,811EBFC8 0000 +Cheat8="Facility Back Zone In Multiplayer\Part 3\2 players",D11EBFCA 0000,811EBFCA F0C4,D11EBFCE 4CCC,811EBFCE 000A,D11EBFD2 4CCC,811EBFD2 000A,D11EBFD4 0003,811EBFD4 0000,D11EBFD6 0000,811EBFD6 02C4,801EBFD9 0004,801EBFDB 0000,811EBFE2 0384,801EBFE7 0004,801EBF45 009E,801EBF47 0084,801EBF48 0010,801EC2D9 0000,801EC447 0085,801EC547 0086,811EA6B6 2743,811EA73E 0114,811EA7F2 0115,811EA8A6 00A3,811EA92E 009D,811EA9E2 00A4,811EAA96 00DA,811EAB1E 00DB,811EABD2 00DF,811EAC86 0130,811EAD0E 008D,811EADC2 012E,811EAE76 0111,811EAEFE 2740,811EAFB2 2741,811EB066 00A0,811EB0EE 009E,811EB1A2 009F,811EB256 274F,811EB2DE 2750,811EB392 0117,811EB446 0131,811EB4CE 008E,811EB582 0132,811EB636 00A1,811EB6BE 0119,811EA62E 00FA,801ED3DF 0000,801ED2DF 0001,D0024337 0007,80024337 001F +Cheat9="All 64 Characters In Multi Player",800266E7 0040 +Cheat6_N=All parts must be on for this code to work.this cheat allows you to play the Facility Back Zone In Multiplayer +Cheat7_N=All parts must be on for this code to work.this cheat allows you to play the Facility Back Zone In Multiplayer +Cheat8_N=All parts must be on for this code to work.this cheat allows you to play the Facility Back Zone In Multiplayer +Cheat5="Cradle in multiplayer",8002666D 0092,8002666F 0093,80026677 0029,80026673 0008,803230C5 0052,803230C6 0041,803230C7 0044,803230C8 004C,803230C9 0045 +Cheat5_N=Puts the cradle graphic in the levels screen where the facility normally is in the multiplayer levels screen.Warning it doesn't allow you to enter the multiplayer levels screen,it should automatically have selected cradle, which cannot be changed from the multiplayer menus +Cheat10="Replace Cradle with Citadell hidden level ",80025E47 0029,8103DB6A D9B4,8103DB70 3F44,8103DB72 BDEA,8103DB74 3F80,8103DB76 0000,8103DB78 4219,8103DB7A D89D,81058EC0 C470 +Cheat11="Secret Island on Dam Level",D004C2D1 0020,800BA78D 0050,880BA78D 0000 +Cheat11_N=For the above code to work,Get to the 2nd guard tower & go down the ladder on the left hand side & to the end of the Dock, Press L & GS and you will be transfered in the water. Just keep walking straight & you will get to it. Obviously you can't actually climb ladders or anything, you will simply walkthrough anything on that Part, if you want to walk back to the Dock, when you come near it click the cheat back on & keep pressing L & GS untill you are back on it. + + +//---- + +[3B941695-F90A5EEB-C:50] +Name=007 The World is Not Enough (E) +Cheat0="Invincible",811147D8 0101 +Cheat1="Access Levels & Difficulties",81103B66 0021,50000D01 0000,80118F38 0001 +Cheat2="Infinite Time",81103B82 0000 +Cheat3="Infinite Oxygen",800E25E4 0004 +Cheat4="Multi Player\Access All Arenas",801147EB 0001,811147EC 0101,801147EE 0001 +Cheat5="Multi Player\Access All Scenarios",801147EF 0001,811147F0 0101 +Cheat6="Multi Player\Access All Weapon Modes",811147F2 0101,801147F4 0001 +Cheat7="Multi Player\Access All Evil Skins",50005C0C 0000,800C0167 0081 +Cheat8="Multi Player\Access Good Q",800C06EF 0001 +Cheat9="Multi Player\Access Evil Q",800C06EF 0081 +Cheat10="Multi Player\Invincible",811147D8 0101 + +//---- + +[58FD3F25-D92EAA8D-C:50] +Name=1080 SNOWBOARDING +Cheat0="Infinite Damage All Players and Levels",803F4C01 0000 +Cheat1="Prees L For Infinite Lives & Continues",D00556A9 0020,8026B14B 0003 +Cheat1_N=Whenever you've lost a life, Press L.Do not press L when on the main menu or during the intro Only use this feature in Match Race +Cheat2="Enable All Levels & Boarders",80250AB9 00FF,80250ABB 0005,81250AC6 FCFF,80250AC8 0007 +Cheat3="Stop Timer\Time Attack\Air Make",8031AA4A 0000 +Cheat4="Stop Timer\Time Attack\Half Pipe",802F638A 0000 +Cheat5="Stop Timer\Time Attack\Crystal Lake",802A582A 0000 +Cheat6="Stop Timer\Time Attack\Crystal Peak",802B2BCA 0000 +Cheat7="Stop Timer\Time Attack\Golden Forrest",802B135A 0000 +Cheat8="Stop Timer\Time Attack\Mountain Village",802CB95A 0000 +Cheat9="Stop Timer\Time Attack\Dragon Cave",802C137A 0000 +Cheat10="Stop Timer\Time Attack\Deadly Fall",802CF56A 0000 +Cheat11="Stop Timer\Trick Attack\Air Make",8031AABA 00C5 +Cheat12="Stop Timer\Trick Attack\Half Pipe",802F63FA 00C5 +Cheat13="Stop Timer\Trick Attack\Crystal Lake",8029F66A 00C5 +Cheat14="Stop Timer\Trick Attack\Crystal Peak",802AC8EA 00C5 +Cheat15="Stop Timer\Trick Attack\Golden Forrest",802AAF5A 00C5 +Cheat16="Stop Timer\Trick Attack\Mountain Village",802C50DA 00C5 +Cheat17="Stop Timer\Trick Attack\Dragon Cave",802BAD3A 00C5 +Cheat18="Stop Timer\Trick Attack\Deadly Fall",802C8E0A 00C5 +Cheat19="Stop Timer\Contest\Crystal Lake",8029C0DA 00C5 +Cheat20="Stop Timer\Contest\Crystal Peak",802A889A 00C5 +Cheat21="Stop Timer\Contest\Golden Forest",802A6D3A 00C5 +Cheat22="Stop Timer\Contest\Air Make",80319BBA 00C5 +Cheat23="Stop Timer\Contest\Half Pipe",802F51FA 00C5 +Cheat24="Play As",8001A0E7 00?? +Cheat24_O=$00 Dion Blaster,$01 Kensuke Kimachi,$02 Akari Hayami,$03 Ricky Winterborn,$04 Rob Haywood,$05 Silver Boarder,$06 Gold Boarder,$07 Panda Boarder + +//---- + +[8F12C096-45DC17E1-C:50] +Name=A Bug's Life +Cheat0="Infinite\Lives",801E2460 0009 +Cheat1="Infinite\Health",801E2455 0004 +Cheat2="Always Have\Super Jump",811E2450 0020 +Cheat3="Always Have\50 pieces of corn",801E2461 0032 +Cheat4="Have F-L-I-K",801E2462 000F +Cheat5="Levitate",D008FCE1 0010,801E23C6 0001,D008FCE1 0010,801E23D6 0001 +Cheat5_N="Press R To Levitate & Let go to land (:" +Cheat6="Unlock All Levels",81099B70 000F +Cheat8="Start with Berry Weapon",801E2457 00?? +Cheat8_O=$01 Blueberry,$02 Homing Berry,$03 Goldberry,$04 Super Berry ? +Cheat9="All enemies killed",801E244E 0000,801E244F 0000 +Cheat7="Have All Goldberry Tokens",D01E244E 0000,801E244E 0000 + +//---- + +[62F6BE95-F102D6D6-C:50] +Name=AERO FIGHTERS ASSAUL +Cheat0="Extra Planes",8127D69C FFFF +Cheat1="Infinite\99 Lives",80355748 0063 +Cheat2="99 Bonus",80131537 0063 +Cheat3="99 Accuracy",80131530 0063 +Cheat4="Gun Select",8027E9D3 00?? +Cheat5="Infinite\Chaffs",8027E9C7 000A +Cheat6="Infinite\Gun",8027EAC0 0001 +Cheat7="Infinite\Special Weapons",8027EE82 0002 +Cheat8="Infinite\Armor",8127D9A4 44A0,8127D9A8 44A0 +Cheat9="Infinite\Health",8027D9A5 00C8,8027D9A9 00C8 +Cheat10="Always Have\F-15J Eagle",8027D69C 0010 +Cheat11="Always Have\X-29A A.T.D.",8027D69D 0020 +Cheat4_O=$00 Chaff,$01 Jammings,$02 Air Mines,$03 Mahibishi,$0A 22mm BB Shot,$0B 22mm,$0C Hunai Shot,$0D Fireball,$0E Sabre,$14 Fire,$15 Tomahawk,$16 Ninja Glitch,$17 Fire Wave,$1E Rocket,$1F Phoenix,$20 Star,$21 Fire Arrow,$28 Ninjabeam +Cheat12="Stage Select screen unlocked",D0281691 0030,8027D5C0 000A,D0281691 0030,8027D5DA 000A +Cheat12_N=Hold L + R at the Game Mode screen and it will unlock every single level in the game; from Tokyo to Space. Do not hold L + R on any other screen, as this may cause game to freeze +Cheat13="All Boss Attack levels unlocked",80355701 003F +Cheat13_N=Unlocks all planes in death match +Cheat14="F-15J Eagle & X-29A A.T.D. planes unlocked",8035575C 00?? +Cheat14_O=$10 F-15J Eagle,$20 X-29A A.T.D.,$3F Both of the above planes + +//---- + +[D83045C8-F29D3A36-C:50] +Name=AEROGAUGE +Cheat0="No Damage\Player 1",50000402 0000,8113F338 0000 +Cheat1="No Damage\Player 2",50000402 0000,811413D8 0000 +Cheat2="Unlock Hidden Tracks & Cars",8009127C 0001 +Cheat3="Freeze All Timers",8013F001 0000,8013F005 0000,8013F00A 0000 +Cheat4="Freeze Overall Timer",8013EFF5 0001 +Cheat5="Laps Of Race",8013EFEF 00?? +Cheat6="Play As\Player 1",8013F2F5 00?? +Cheat7="Play As\Player 2",8013F2F6 00?? +Cheat8="Level Select",8013F2FB 00?? +Cheat9="Always 1st",8013F040 0001 +Cheat10="Music Modifier",800F715F 00?? +Cheat11="Language Select",8008CF93 00?? +Cheat4_N=All of the Freeze All Lap Timers must be on. These codes will Stop the others from racing against you in Grand Prix mode. To win a race in Grand Prix you must finish at least one lap in the qualify round, then complete all laps in race for first. +Cheat5_O=$01 1 Lap,$02 2 Laps,$03 3 Laps,$04 4 Laps,$05 5 Laps,$06 Never Ending Laps +Cheat6_O=$00 N64 Control Pad,$01 Interceptor,$02 Hornet,$03 Avenger,$04 Shredder,$05 Black Lightning,$06 Vengeance,$07 Prowler,$08 Reaper,$09 Dominator +Cheat7_O=$00 N64 Control Pad,$01 Interceptor,$02 Hornet,$03 Avenger,$04 Shredder,$05 Black Lightning,$06 Vengeance,$07 Prowler,$08 Reaper,$09 Dominator +Cheat8_O=$00 Canyon Rush,$01 Bikini Island,$02 China Town,$03 Neo Arena,$04 China Town Jam,$05 Neo Speed Way +Cheat10_O=$FF Music On,$00 Music Off +Cheat11_O=$00 English,$01 French,$02 German +Cheat2_N=All of the Freeze All Lap Timers must be on. These codes will Stop the others from racing against you in Grand Prix mode. To win a race in Grand Prix you must finish at least one lap in the qualify round, then complete all laps in race for first. +Cheat8_N=For this cheat to work,as soon as you put the cheat on you must turn it back off,if not you wont beable to quit a Race or even finish one. + +//---- + +[2DC4FFCC-C8FF5A21-C:50] +Name=Aidyn Chronicles - The First Mage (E) +Cheat0="Infinite\Max Health",80279308 001E +Cheat1="Infinite\99 Health Potions",8027876B 0063 +Cheat1_N=Do Not put this cheat on until you have collected your 1st Health Potion from the 1st Cheat or you will not be able to get into the Sub menu and Continue the game. +Cheat2="Have\Max Gold",50000401 0000,80277AA5 00FF +Cheat3="Have\Max Total XP",50000401 0000,8027931D 00FF +Cheat4="Have\Max Total XP Remaning to Start",50000401 0000,80279321 00FF +Cheat4_N=This will give you 16777215 Total XP Remaning to start with and after your 1st batle will allow you to buy your Max Stats + +//---- + +[27C425D0-8C2D99C1-C:50] +Name=Airboarder 64 (E) +Cheat0="Infinite Turbo\Player 1",80166019 0009 +Cheat1="Infinite Turbo\Player2",80167991 0009 +Cheat2="Infinite Time\Street Work & Coin",8010FA09 0028 +Cheat3="Infinite Time\Attack Time Time 000000",8110FA0A 0000 +Cheat4="Infinite Time\Time Attack",8010FA0B 0000 +Cheat5="Access All Boards & Characters",80050071 000C +Cheat6="Maxed Out Turbo Bar",811656E8 429F,80166017 0051 +Cheat7="Class Score Select",8016609E 00?? +Cheat7_O=$20 Class C,$40 Class B,$64 Class A,$FF Class S +Cheat8="Coin Perfect Select",801660B3 00?? +Cheat8_O=$14 Green Park Level 1,$1A Green park Level 2,$2B Green park Level 3,$4A Lost Forest Level 1,$59 Lost Forest Level 2,$80 Lost Forest Level 3,$7D Snow Festival 64 Levels 1 2 & 3,$6F Sunset Island Level 1,$74 Sunset Island Level 2,$81 Sunset Island Level 3,$6E Giant House Level 1,$77 Giant House Level 2,$72 Giant House Level 3 +Cheat9="Options\Music Modifier",80050059 00?? +Cheat9_O=$FF BGM On,$00 BGM Off +Cheat10="Options\Sound Effects Modifier",8105005A 00?? +Cheat10_O=$FF SE On,$00 SE Off +Cheat11="Options\Camera Type Modifier",81050056 00?? +Cheat11_O=$00 Roll On Near,$01 Roll On Mid,$02 Roll On Far,$03 Roll Off Near,$04 Roll Off Mid,$05 Roll Off Far +Cheat12="Options\DJ Function Modifier",8105005C 00?? +Cheat12_O=$01 DJ Function On,$00 DJ Function Off +Cheat13="All Street Work Levels Unlocked",50007801 0000,80050120 00?? +Cheat13_O=$01 Courses unlocked,$03 Courses unlocked with C rank,$04 Courses unlocked with B rank,$05 Courses unlocked with A rank,$06 Courses unlocked with S rank +Cheat8_N=this is for Coin Mode to get Perfect Coin Collection Score straight away when you enter the level + +//---- + +[3CC77150-21CDB987-C:50] +Name=Armorines - Project S.W.A.R.M. (E) +Cheat0="Enable In-Game Cheat Menu & Level Select",81115936 014F +Cheat1="Infinite Ammo (All Guns)",810496D0 2400 +Cheat2="Don't Take Any Damage",8104A260 2400 + +//---- + +[D9EDD54D-6BB8E274-C:50] +Name=All Star Baseball '99 (E) +Cheat0="The Home Team Has Max Score",8107972A FFFF +Cheat1="The Away Team Has Max Score",81080082 FFFF + +//---- + +[DFD784AD-AE426603-C:50] +Name=All Star Tennis '99 (E) +Cheat0="Game Win Select\Player 1",801BAEB1 00?? +Cheat0_O=$00 0 Games Won,$01 1 Game Won,$02 2 Games Won,$03 3 Games Won,$04 4 Games Won,$05 5 Games Won,$06 For Game Set & Match +Cheat1="Game Win Select\Player 2",801BAEB2 00?? +Cheat1_O=$00 0 Games Won,$01 1 Game Won,$02 2 Games Won,$03 3 Games Won,$04 4 Games Won,$05 5 Games Won,$06 For Game Set & Match +Cheat2="Points Select\Player 1",801C6160 00?? +Cheat2_O=$00 0 Points,$15 15 Points,$30 30 Points,$40 40 Points +Cheat3="Points Select\Player 2",801C6161 00?? +Cheat3_O=$00 0 Points,$15 15 Points,$30 30 Points,$40 40 Points + +//---- + +[B210DF19-98B58D1A-C:50] +Name=Army Men Sarge +Cheat0="Infinite Health",8016471F 0001 +Cheat1="Access\All Guns",8015E0CF 0001 +Cheat2="Access\Max Ammo",801646EF 0001 +Cheat5="Invisible to most enemies",8015E0B3 0001 +Cheat6="Play As",811653D2 00?? +Cheat6_O=$07 The Big Green One,$08 Vikki,$09 Plastro +Cheat6_N=Here you can choose who you would like to play as. But Do not use this with any other play as option.. +Cheat4="Play As Tin Soldier",8015E0D3 0001 +Cheat4_N=Do not use this with any other play as option. +Cheat7="Have Big Mode",8016470F 0001 +Cheat7_N=Do not use with Have Small Mode only use one at a time +Cheat3="Have Small Mode",8015E0C9 0001 +Cheat3_N=Do not use with Have Big Mode only use one at a time +Cheat8="Have Debug Mode",8015E417 0001 +Cheat8_N=When this code is activated, a display of numbers will show on the screen as the players move around + +//---- + +[FC7797BF-4A95E83C-C:50] +Name=LAMBORGHINI +Cheat0="Access All Bonus Cars",50000302 0000,80098583 0001,50000302 0000,8009858B 0001 +Cheat1="Max Points",810CE702 010A +Cheat2="Infinite Lap Time",8109872C 0000,8109872E 0000 +Cheat3="Always 1st Place",810A5F30 0001 +Cheat4="Start On Lap Modifier",D00A5F35 0000,810A5F34 00?? +Cheat4_O=$00 Normal,$01 Lap 1,$02 Lap 2,$03 Lap 3,$04 Lap 4,$06 Lap 5,$06 Lap 6,$07 Last Lap from Start +Cheat5="Track Direction Unlocked (All Levels)",800A4131 0003 + +//---- + +[733FCCB1-444892F9-C:50] +Name=Banjo-Kazooie (E) +Cheat0="Infinite\Lives",8038696B 0009 +Cheat1="Have\Running Shoes",8137CA88 5019 +Cheat2="Have\Zero Time all Levels",50000B04 0000,813869E4 3000 +Cheat3="Have\Blubbers Gold",80386973 00FF +Cheat4="Have\Present Option\Green",8038698F 00FF +Cheat5="Have\Present Option\Blue",80386993 00FF +Cheat6="Have\Present Option\Red",80386997 00FF +Cheat7="Have\Nabnuts Acorns",8038699F 00FF +Cheat8="Have\Eyries Caterpillars",8038699B 00FF +Cheat9="Have\Chimpys Oranges",80386977 00FF +Cheat10="Have\All Jinjos",8038695B 00FF +Cheat11="Yumblies Counter\Mr Vile",8038697C 00FF +Cheat12="Yumblies Counter\Banjo",8038697B 00FF +Cheat13="Press L To Levitate",D0285735 0020,8137CE8C 43E0 +Cheat13_N=Press L To Levitate & Let go to land +Cheat14="Do Anywhere Option\Take off anywhere",D0285734 0080,8037CBA1 0001 +Cheat14_N=Press A +Cheat15="Infinite\Health",80386963 0008,80386965 0001 +Cheat16="Infinite\8 Skulls",803869A7 0008 +Cheat17="Infinite\255 Jigsaws",803869AB 00FF +Cheat18="Infinite\Air",8038696E 000B +Cheat19="Infinite\255 Notes",80386943 00FF +Cheat20="Infinite\255 Eggs",80386947 00FF +Cheat21="Infinite\255 Gold Feathers",80386953 00FF +Cheat22="Infinite\255 Red Feathers",8038694F 00FF +Cheat23="Access All Moves",8037CD70 0001,8037CD71 007F,8037CD72 00FF,8037CD73 00FF + +//---- + +[C9176D39-EA4779D1-C:50] +Name=BANJO TOOIE +Cheat0="Infinite\Energy\Banjo and Kazooie",801201B9 0A0A,81120794 0A0A +Cheat1="Infinite\Energy\Snowball",801201B9 0063,80120797 0005 +Cheat2="Infinite\Energy\Bee",801201B9 0063,801207A3 000A,801207A4 000A +Cheat3="Infinite\Energy\Washing Machine",801201B9 0063,811207A6 0A0A +Cheat4="Infinite\Energy\Stony",801201B9 0063,801207A9 000A,8011B65A 000A +Cheat5="Infinite\Energy\Banjo",801201B9 0063,801207AF 000A,801207B0 000A +Cheat6="Infinite\Energy\Kazooie",801201B9 0063,811207B2 0A0A +Cheat7="Infinite\Energy\Submarine",801201B9 0063,801207B5 000A,801207B6 000A +Cheat8="Infinite\Energy\Mumbo",801201B9 0063,811207B8 0A0A +Cheat9="Infinite\Energy\Detonator",801201B9 0063,811207BE 0A0A +Cheat10="Infinite\Energy\T-Rex Baby",801201B9 0063,801207CF 000A,801207D0 000A +Cheat11="Infinite\Air",8112FFD2 42C8 +Cheat12="Play As",D008B494 0020,8012BFAC 00?? +Cheat12_O=$01 Banjo and Kazooie,$02 Snowball,$06 Bee,$07 Washing machine,$08 Stony,$0A Banjo,$0B Kazooie,$0C Submarine,$0D Mumbo,$0E Golden Goliath,$0F Detonator,$10 Truck,$12 T-rex baby,$13 T-rex daddy +Cheat13="Instant Warp\Options\Not sure",D008B494 0000,8112C5A0 ????,8012C5A3 0001 +Cheat13_O=$00FC Lord woo fak fak,$00F9 Mr Patch,$0121 Inside Chuffy's wagon,$0134 Mumbo's Skull,$0135 Humba Wumba's wigwam 1,$0157 Humba Wumba's wigwam 2,$019B Jingalings Zombified Palace,$01A6 Smuggler cavern,$0141 Inside the digger tunnel,$0143 Bottles house,$0169 Bottles house still,$018A HAG Inside,$019A HAG1 Final Boss +Cheat14="Instant Warp\Options\Spiral Mountain",D008B494 0000,8112C5A0 ????,8012C5A3 0001 +Cheat14_O=$00AD Grunty's Old Lair,$00AE Behind The Waterfall,$00AF Top Of Castle,$0173 Banjo's house +Cheat15="Instant Warp\Options\Jinjo Village",D008B494 0000,8112C5A0 ????,8012C5A3 0001 +Cheat15_O=$0142 Jinjo Village,$0144 King Jingalings throne room,$0143 Bottles house,$0145 Green Jinjo's House,$0146 Black Jinjo's House,$0147 Yellow Jinjo's House,$0148 Blue Jinjo's House,$014A Brown Jinjo's House,$014B Orange Jinjo's House,$014C Purple Jinjo's House,$014D Red Jinjo's House,$014E White Jinjo's House +Cheat16="Instant Warp\Options\Mayahem Temple",D008B494 0000,8112C5A0 ????,8012C5A3 0001 +Cheat16_O=$00B6 Humba's Wigwam,$00B7 Mumbo's skull,$00B8 The Temple,$00B9 Prison Compound,$00BC Code chamber,$00C4 Jade Snake Grove,$00C5 Treasure Chamber,$00C6 Kickball Arena,$0177 Targitzan's Slighty Sacred Temple,$0178 Inside Targitzans Temple,$0179 Targitzan Temple Lobby,$017A Targitzan's Temple Boss,$017F Mayan Kickball Arena,$0166 Multi,$0167 Still,$00C8 Kickball Arena,$00C9 Kickball Arena +Cheat17="Instant Warp\Options\Glitter Gulch Mine",D008B494 0000,8112C5A0 ????,8012C5A3 0001 +Cheat17_O=$00C7 Mine,$00CA Fuel depot,$00CB Crushing shed,$00CC Flooded caves,$00CD Water storage,$00CE Waterfall cavern,$00CF Power hut basement,$00D0 Chuffy's cab,$00D1 Inside chuffy's boiler boss,$00D2 Gloomy caverns,$00D3 Generator caverns,$00D4 Power hut,$00D5 Wumba's wigwam,$00D7 Train station,$00D8 Prospectors hut,$00D9 Mumbo's hut,$00DA Toxic gas cave,$00DB Canary cave,$00DC Ordnance storage,$00E9 Humba,$0126 Water supply pipe,$0163 Ordnance Storage entrance,$0164 Ordnance Storage game,$0165 Ordnance Storage game Multi,$016F Testing,$0170 Testing,$0171 Mumbo's skull +Cheat18="Instant Warp\Options\Witchy World",D008B494 0000,8112C5A0 ????,8012C5A3 0001 +Cheat18_O=$00D6 Witcy World,$00DD Dodgem dome lobby,$00DE Dodgem challenge "1 vs 1",$00DF Dodgem challenge "2 vs 1",$00E0 Dodgem challenge "3 vs 1",$00E1 Crazy castle stockade,$00E2 Crazy castle lobby,$00E3 Crazy castle pump room,$00E4 Balloon burst game,$00E5 Hoop hurry game,$00E6 Star spinner,$00E7 The inferno,$00EA Cave of horrors,$00EB Haunted cavern,$00EC Train station,$0124 Saucer of Peril,$013B Crazy castle stockade "sop",$013C Star spinner "sop",$0176 Mumbo's skull +Cheat19="Instant Warp\Options\Jolly Roger's Lagoon",D008B494 0000,8112C5A0 ????,8012C5A3 0001 +Cheat19_O=$00ED Jolly's,$00EE Pawno's emporium,$00EF mumbo's skull,$00F4 Ancient Swimming Baths,$00F6 Electric Eels lair,$00F7 Seaweed Sanctum,$00F8 Inside the big fish,$00FA temple of the fishes,$01A8 Atlantis,$01A9 Seabottom,$0181 sea bottom cavern,$0182 submarine multi,$01A7 Jolly Roger's Lagoon,$00FF Blubber's wave race hire +Cheat20="Instant Warp\Options\Terrydacty Land",D008B494 0000,8112C5A0 ????,8012C5A3 0001 +Cheat20_O=$0112 Terrydacty Land,$0113 Terry's nest,$0114 Train station,$0115 Oogle boogles cave,$0116 Inside the mountain,$0117 River passage,$0118 Styracosaurus family cave,$0119 Unga bunga's cave,$011A Stomping plains,$011B Bonfire caverns,$011E Humba's Wigwam,$0123 Inside chompa's belly,$0183 Chompa's belly multi +Cheat21="Instant Warp\Options\Grunty Industries",D008B494 0000,8112C5A0 ????,8012C5A3 0001 +Cheat21_O=$0100 Outside,$0101 Inside,$0102 Train station,$0103 Workers quarters,$0104 Trash compactor,$0105 Elevator shaft,$0106 Floor 2,$0107 Floor 2 "electromagnet chamber",$0108 Floor 3,$0109 Floor 3 "boiler plant",$010A Floor 3 "packing room",$010B Floor 4,$010C Floor 4 "cable room",$010D Floor 4 "quality control",$010E Floor 5,$010F Basement,$0110 Basement "repair depot,$0111 Basement "waste disposal",$0125 Water supply pipe,$0172 Mumbo's skull,$0162 Floor 4 "clinkers cavern",$0187 Sewer entrance +Cheat22="Instant Warp\Options\Hailfire Peaks",D008B494 0000,8112C5A0 ????,8012C5A3 0001 +Cheat22_O=$0127 Lava side,$0128 Icy side,$0129 Lava train station,$012A Ice train station,$012B Chilli billi,$012C Chilly willy,$012D Colosseum kickball stadium lobby,$0131 Boggy's igloo,$0132 Icicle grotto,$0133 Inside the volcano,$0168 Icy side still +Cheat23="Instant Warp\Options\Cloud Cuckoo Land",D008B494 0000,8112C5A0 ????,8012C5A3 0001 +Cheat23_O=$0136 Cloud Cuckoo Land 1,$0137 Inside the trashcan,$0138 Inside the cheesewedge,$0139 Zubba's nest,$013A Central cavern,$013D Inside the pot o gold,$013E Mumbo's skull,$013F Mingy jongo's skull,$0140 Humba wumba's wigwam,$0161 Cloud Cuckoo Land 2,$0188 Zubba's nest multi,$0185 Trash can mini +Cheat24="Instant Warp\Options\Isle O Hags",D008B494 0000,8112C5A0 ????,8012C5A3 0001 +Cheat24_O=$014F Wooded Hollow,$0150 Heggy's egg shed,$0151 Jiggywiggy's temple,$0152 Plateau,$0153 Plateau "Honey B's Hive",$0154 Pine Grove,$0155 Cliff top,$0156 Cliff top Mumbo's skull,$015A wasteland,$015B inside another digger tunnel,$015C Quagmire +Cheat25="Instant Warp\Options\Cauldron Keep",D008B494 0000,8112C5A0 ????,8012C5A3 0001 +Cheat25_O=$015D Cauldron Keep,$015E The gatehouse,$015F Tower of Tragedy Quiz,$0160 Gun chamber,$016A Gun room still,$017B Crazy Castle Stockade balloon burst multi,$017C Crazy Castle Stockade Jump the hoops multi,$017D Grunty Industries packing game,$0180 Colosseum kickball arena,$0186 Dodgems +Cheat0_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat1_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat2_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat3_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat4_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat5_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat6_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat7_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat8_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat9_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat10_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat12_N=To use this cheat, put the cheat on, then press L as you walk through a door to become that chosen character +Cheat13_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat14_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat15_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat16_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat17_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat18_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat19_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat20_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat21_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat22_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat23_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat24_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat25_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat26="Beta Bottles Revenge Mode",80130402 0001,8008B4D1 0002 +Cheat26_N=Bottles Revenge is a Beta mode from Banjo Tooie that the RWP team recently uncovered after an extraordinary amount of effort. Bottles the Spirit transforms into Bottles the Devil and posses enemies nearby and allows a second player hooked up to Pad 2 to play as that Posses character to try to foil Banjos Plans. As player one goes about its business, player two uses every enemy nearby to try to nab Banjo and take away some life. This mode is incredible, and you can control almost every enemy in the game: slot machines, flying creatures, uggers, zubbas...and this is just the beginning. (Congrats Rare Witch Project) + +//---- + +[B088FBB4-441E4B1D-C:50] +Name=Bass Hunter 64 (E) +Cheat0="All Lakes Available",80119800 0001 +Cheat1="Unbreakable Line",80119805 0001 +Cheat2="Large Fish",80119806 0001 +Cheat3="Fish Are More Active",80119807 0001 +Cheat4="No Penalties During Tournamet",80119808 0001 +Cheat5="No Snags While Fishing",80119809 0001 +Cheat6="Extra $300",8011980B 0001 +Cheat7="More fish in Lakes",8011980D 0001 +Cheat8="Super Lure",8011980E 0001 +Cheat9="Easy Win Current Tournament",8011980F 0001 +Cheat10="Access\All Lures",8019A1A9 0003,8119A1AA FFFF +Cheat11="Access\All Poles 2",8019A1AC 0007 +Cheat12="Access\Extra Boat 2",8019A1AD 0001 +Cheat10_N=Codes To Be Used With Save Slot 1 +Cheat11_N=Codes To Be Used With Slot 1 +Cheat12_N=Codes To Be Used With Slot 1 + +//---- + +[259F7F84-7C9EED26-C:50] +Name=Batman Beyond - Return of the Joker (E) +Cheat0="Infinite\Health",801D7F3C 0064 +Cheat1="Infinite\99 Lives",801D7F3D 0063 +Cheat2="Infinite\Infinite 99 Dark Night Discus's",801D7F4A 0063 +Cheat3="Infinite\Max Charge & Magnetic Nun Chaku",801D7F05 0064 + +//---- + +[0CAD17E6-71A5B797-C:50] +Name=BattleTanx - Global Assault (E) +Cheat0="Infinite Tank Credits",8124AB3E 02F4 +Cheat1="Score Aid",8124A152 FC9A +Cheat2="Inincibility",81121420 0100 +Cheat3="All Weapons & Invulnerable",81121420 0101 +Cheat4="Level Select",811150B8 0001 +Cheat5="All Tanx & All Campaigns",50001370 0000,81120546 FFFF,50001370 0000,8112054A FFFF +Cheat6="Infinite Edge Power",811A8D20 000A,8111AD08 000A,811AC1E4 000A,811ACB7E 000A,811AAEB4 000A,811AE378 000A,811AD514 000A,811AA51C 000A + +//---- + +[A1B64A61-D014940B-C:50] +Name=Beetle Adventure Racing (E) +Cheat0="Access All\Cars",8002CFF7 000B +Cheat1="Access All\Tracks",8002CFF3 0006 +Cheat2="Access All\Difficulties",8002CFFB 0003 +Cheat3="Access All\Multiplayer Levels",50000901 0000,8002D000 0001 +Cheat4="Access In-Game Cheats",50001301 0000,8002D008 0001 +Cheat5="Display On",81025EC6 0100 +Cheat6="Map Full",81025E6A 0102 +Cheat7="Speed units\Kph or Mph",81025E68 ???? +Cheat7_O=$0100 Kph,$0001 Mph +Cheat7_N=Here you can choose what you would like to be Displayed on your Speed Ometer, As in Kilometres Per Hour, Or Miles Per Hour. +Cheat8="Max Race Points",8102CBC0 03E7 +Cheat9="Flat Shading",81025CF6 0000 + +//---- + +[7C64E6DB-55B924DB-C:50] +Name=Blast Corps (E) +Cheat0="Infinite Hydraulics Sidesweeper",803EDB51 0063 +Cheat1="Infinite Missiles Motor Bike",803F8AC3 0063 +Cheat2="Infinite Boosts Buggy Vehicle",803EE301 0064 +Cheat3="Ballista Can Drive Through Anything",803F8A68 0001 +Cheat4="Found All RDUS",8036E9CC C350 +Cheat5="Found All Survivors",8036E9C9 00FF +Cheat6="Found All Scientists",80364AD0 003F + +//---- + +[AB7C101D-EC58C8B0-C:50] +Name=Bio F.R.E.A.K.S. (E) +Cheat0="Infinite Health\Player One",811507FA 6400 +Cheat1="Infinite Shields\Player One",811507FE 6400 +Cheat2="Shields Always Active\Player One",8015080A 0022 +Cheat3="Infinite Jet Pack\Player One",81150802 3200 +Cheat4="Smoke Trail\Player One",80150804 0001 +Cheat5="Player 2 Easily Defeated\Player One",81152E76 0100,81152E7A 0100 +Cheat6="Infinite Health\Player Two",81152E76 6400 +Cheat7="Infinite Shields\Player Two",81152E7A 6400 +Cheat8="Shields Always Active\Player Two",80152E86 0022 +Cheat9="Infinite Jet Pack\Player Two",81152E7E 3200 +Cheat10="Smoke Trail\Player Two",80152E80 0001 +Cheat11="Player 1 Easily Defeated\Player Two",811507FA 0100,811507FE 0100 + +//---- + +[D571C883-822D3FCF-C:50] +Name=Blues Brothers 2000 (E) +Cheat0="Have All\Keys",800BE268 00FF,800BE26D 00FF,800BE26E 00FF +Cheat0_N=This will give you the Grey & Red,Green & Gold Keys +Cheat1="Have All\Music Notes",50000A01 0000,800BE3A0 0001 +Cheat1_N=This will give you all 10 Music Notes +Cheat2="Infinite\Lives",800BE293 0009 +Cheat3="Infinite\Health",800BE2A7 0002 +Cheat5="Max Money",810BE296 03E7 +Cheat4="Press L to Levitate",D017E975 0020,810DBD88 44CB +Cheat4_N=Press L to levitate & let go to come back down + +//---- + +[0B58B8CD-B7B291D2-C:50] +Name=Body Harvest (E) +Cheat0="Infinite\Greece",81052B48 0098,81052B4A 967F +Cheat1="Infinite\Health",8004DD1C 0002 +Cheat2="No Humans Killed",8104819A 0000 +Cheat3="Have Alien Artifact",8004DC8F 0001 +Cheat4="Item Modifier",8004DC7F ???? +Cheat4_O=$0000 Nothing,$0002 Howitzer Shells,$0040 Crank,$0080 Windmill Cog,$0100 Heirglyph Map Piece,$0400 Hangar Key,$FFFF All Items +Cheat5="Weapon Select\1st Position",80048168 00?? +Cheat6="Weapon Select\2nd Position",80048169 00?? +Cheat7="Weapon Select\3rd Position",8004816A 00?? +Cheat8="Weapon Select\4th Position",8004816B 00?? +Cheat9="Weapon Select\5th Position",8004816C 00?? +Cheat10="Weapon Select\6th Position",8004816D 00?? +Cheat11="Weapon Select\7th Position",8004816E 00?? +Cheat12="Weapon Select\8th Position",8004816F 00?? +Cheat13="Infinite Ammo All Weapons",50001102 0000,81048176 8000 +Cheat14="Level Select",80047FC3 00?? +Cheat15="Press L To Wall Over Water, Climb Hills",D0047609 0020,8104DD02 0808 +Cheat16="Infinite\Fuel",8004E46C 0050 +Cheat5_O=$00 Nothing,$01 Fuel,$02 Pistol,$03 Shotgun,$04 Rifle,$05 Machine Gun,$06 Rocket Launcher,$07 TNT,$08 Sun Shield,$09 Grenades,$0A Tri-Spinner,$0B Vehicle Weapon 1,$0C Vehicle Weapon 2,$0D Arme 2,$0E Waffe 2,$10 Fragcannon,$11 Lazer Missiles,$12 Resonator,$13 Plasma Bombs +Cheat6_O=$00 Nothing,$01 Fuel,$02 Pistol,$03 Shotgun,$04 Rifle,$05 Machine Gun,$06 Rocket Launcher,$07 TNT,$08 Sun Shield,$09 Grenades,$0A Tri-Spinner,$0B Vehicle Weapon 1,$0C Vehicle Weapon 2,$0D Arme 2,$0E Waffe 2,$10 Fragcannon,$11 Lazer Missiles,$12 Resonator,$13 Plasma Bombs +Cheat7_O=$00 Nothing,$01 Fuel,$02 Pistol,$03 Shotgun,$04 Rifle,$05 Machine Gun,$06 Rocket Launcher,$07 TNT,$08 Sun Shield,$09 Grenades,$0A Tri-Spinner,$0B Vehicle Weapon 1,$0C Vehicle Weapon 2,$0D Arme 2,$0E Waffe 2,$10 Fragcannon,$11 Lazer Missiles,$12 Resonator,$13 Plasma Bombs +Cheat8_O=$00 Nothing,$01 Fuel,$02 Pistol,$03 Shotgun,$04 Rifle,$05 Machine Gun,$06 Rocket Launcher,$07 TNT,$08 Sun Shield,$09 Grenades,$0A Tri-Spinner,$0B Vehicle Weapon 1,$0C Vehicle Weapon 2,$0D Arme 2,$0E Waffe 2,$10 Fragcannon,$11 Lazer Missiles,$12 Resonator,$13 Plasma Bombs +Cheat9_O=$00 Nothing,$01 Fuel,$02 Pistol,$03 Shotgun,$04 Rifle,$05 Machine Gun,$06 Rocket Launcher,$07 TNT,$08 Sun Shield,$09 Grenades,$0A Tri-Spinner,$0B Vehicle Weapon 1,$0C Vehicle Weapon 2,$0D Arme 2,$0E Waffe 2,$10 Fragcannon,$11 Lazer Missiles,$12 Resonator,$13 Plasma Bombs +Cheat10_O=$00 Nothing,$01 Fuel,$02 Pistol,$03 Shotgun,$04 Rifle,$05 Machine Gun,$06 Rocket Launcher,$07 TNT,$08 Sun Shield,$09 Grenades,$0A Tri-Spinner,$0B Vehicle Weapon 1,$0C Vehicle Weapon 2,$0D Arme 2,$0E Waffe 2,$10 Fragcannon,$11 Lazer Missiles,$12 Resonator,$13 Plasma Bombs +Cheat11_O=$00 Nothing,$01 Fuel,$02 Pistol,$03 Shotgun,$04 Rifle,$05 Machine Gun,$06 Rocket Launcher,$07 TNT,$08 Sun Shield,$09 Grenades,$0A Tri-Spinner,$0B Vehicle Weapon 1,$0C Vehicle Weapon 2,$0D Arme 2,$0E Waffe 2,$10 Fragcannon,$11 Lazer Missiles,$12 Resonator,$13 Plasma Bombs +Cheat12_O=$00 Nothing,$01 Fuel,$02 Pistol,$03 Shotgun,$04 Rifle,$05 Machine Gun,$06 Rocket Launcher,$07 TNT,$08 Sun Shield,$09 Grenades,$0A Tri-Spinner,$0B Vehicle Weapon 1,$0C Vehicle Weapon 2,$0D Arme 2,$0E Waffe 2,$10 Fragcannon,$11 Lazer Missiles,$12 Resonator,$13 Plasma Bombs +Cheat14_O=$01 Greece,$02 Java,$03 America,$04 Siberia,$05 Comet + +//---- + +[D85C4E29-88E276AF-C:50] +Name=Bomberman Hero (E) +Cheat0="Full\Bomb Power",8016523F 0003 +Cheat1="Full\Fire Power",80165240 0008 +Cheat2="Infinite\Health",80165244 0004 +Cheat3="Infinite\Lives",80165243 0009 +Cheat4="Extra Gems",D0165241 0000,80165241 004B +Cheat5="Max\Bombs",8016523F 0008 +Cheat6="Press L to Levitate",D005A465 0020,81154178 41CB,D005A465 0020,D0154154 0000,80154154 0040 +Cheat7="Max\Score",80177608 FFFF +Cheat8="Max\Explosion",80165240 0008 +Cheat6_N=Press L to levitate & let go to come back down + +//---- + +[5A160336-BC7B37B0-C:50] +Name=Bomberman 64 (E) +Cheat0="Infinite\Lives",802AC617 0063 +Cheat1="Infinite\Gems",802AC61F 0063 +Cheat2="Infinite\Credits",802AC61B 0063 +Cheat3="Infinite\Time",802AC633 0000 +Cheat4="Have All Gold Cards",8008E575 00FF,8108E576 FFFF,8108E578 FFFF,8108E57A FFFF,8108E57C FFFF +Cheat5="All Levels & Stages Unlocked",50001804 0000,8008E5CF 0001 +Cheat6="Infinite Red Pumped-Up Bombs",802AC643 0004 + +//---- + +[D5B2339C-CABCCAED-C:50] +Name=Buck Bumble (E) +Cheat0="Have All\Guns & Infinite Ammo",81102C0A 0001,50000B04 0000,810EBF66 03E8 +Cheat0_N=Press C Left to receive all Guns +Cheat1="Infinite\Health",810EBF58 42D8 +Cheat1_N=If you fall into Water just turn off the Infinite Health & put back on when you restrat. +Cheat2="Infinite\99 Lives",810EC2D2 03E7 +Cheat3="Level Select Menu",801022CA 0EF0 +Cheat4="Have All\Keys",810EBF60 0001,800EBF61 0001,810EBF62 0001 +Cheat5="High Score",810EBF4E FFFF +Cheat6="Max Bonus",810EC2CA 270F + +//---- + +[CEDCDE1E-513A0502-C:50] +Name=Bust-A-Move 2 - Arcade Edition (E) +Cheat0="Infinite Credit",80120171 00FF +Cheat1="Bubble Pointer Puzzle",801807CD 0001 +Cheat2="Bubble Pointer 1P V CPU",8017E1FD 0001 +Cheat3="Access Another World",8116D100 0001 +Cheat3_N=This is for Puzzle Mode +Cheat4="Max Points Aid",81170E4A 25C2 + +//---- + +[E328B4FA-004A28E1-C:50] +Name=Bust A Move 3 DX +Cheat0="Always have guide line on",80056CCC 0082 +Cheat1="Pointer always active",D0056FA0 0002,80056FA0 0082 +Cheat2="Play As Select\Player 1",800E3250 00?? +Cheat2_O=$00 Bubbloon,$01 Twinkie,$02 Prettio,$03 Marina,$04 Musashi,$05 Luna,$06 Jack,$07 SSB,$08 Dragoon,$09 Gnome,$10 Monkey,$11 furby? (looks like 2 balloons),$12 Blue Gnome,$13 1 of the two Ballons,$14 Water under ballons +Cheat3="Play As Select\Player 2",800E3258 00?? +Cheat3_O=$00 Bubbloon,$01 Twinkie,$02 Prettio,$03 Marina,$04 Musashi,$05 Luna,$06 Jack,$07 SSB,$08 Dragoon,$09 Gnome,$10 Monkey,$11 furby? (looks like 2 balloons),$12 Blue Gnome,$13 1 of the two Ballons,$14 Water under ballons +Cheat4="Next Bubble Select\Player 1",800ECE19 00?? +Cheat4_O=$00 No Bubble,$01 Red,$02 Green,$03 Blue,$04 Yellow,$05 Orange,$06 Purple,$07 White,$08 Black +Cheat5="Next Bubble Select\Player 2",800ECF09 00?? +Cheat5_O=$00 No Bubble,$01 Red,$02 Green,$03 Blue,$04 Yellow,$05 Orange,$06 Purple,$07 White,$08 Black +Cheat6="Press GS to Reset Player 2 score to 0",8809D9C0 0000,8809D9C2 0000 + +//---- + +[64F1B7CA-71A23755-C:50] +Name=CASTLEVANIA +Cheat0="Infinite\Health",81389C42 0064 +Cheat1="Infinite\Throwing Weapon",81389C4C 0064 +Cheat2="Throwing Weapon Modifier",81389C46 00?? +Cheat3="Press L To Levitate",D0387D7F 0020,81350810 3FCB +Cheat4="Have\All Items",50000501 0000,80389C4E 0001,50000301 0000,80389C55 0001,80389C5E 0001,80389C5F 0001,80389C61 0001,50000E01 0000,80389C64 0001 +Cheat5="Have\Invincibility",80342BFE 000B +Cheat6="Infinite\Red Jewels",80389C4D 0064 +Cheat7="Status",80389C8C 00?? +Cheat7_O=$01 Good,$08 Vamp,$11 Poison,$22 Good but depressed,$66 Sto,$1F V+P +Cheat8="Open All Doors and Gates,No Bosses",50002A02 0000,81389BD0 FFFF +Cheat9="Infinite\Energy",80389C33 0064 +Cheat10="Infinite\Funds",80389C49 0001,81389C4A 869F +Cheat11="Have\Exp Points",80389C4D 0063 +Cheat12="Max Power Up",80389CF1 0002 +Cheat13="Never Get Poisoned",81389C8C 0000 +Cheat2_O=$00 Nothing,$01 Knives,$02 Exploding Potions,$03 Cross,$04 Axes +Cheat14="Level Select",89389C94 ????,89389C91 0000 +Cheat14_O=$0000 Forest of Silence,$0002 Castle Wall,$0003 Villa,$0004 Inside Villa,$0006 Garden Maze,$0007 Tunnel,$0008 Underground Waterway,$0009 Castle Center,$0010 Tower of Execution,$0011 - Tower of Sorcery,$0012 - Tower of Science,$0013 - Duel Tower,$0014 - Fight With Death/Actrise,$0015 - Castle Keep,$0016 - Intro (Glitch),$0017 - Clock Tower,$0018 - Final Dracula,$001A - Fight With Maze Boss,$001B - Room of Clocks,$001C - ??,$001D - ?? +Cheat14_N=You must use this code on a saved game, because the intro to the first level will mess up the game. Now select the saved game, and hold down the GS button until the level loads. Some of the boss stages will not let you fight the boss unless you re-enter the area. Also, with the part of stage modifier, the second code modifies the part of the level that you are in, and 0000 is the level's start. +Cheat15="Switch From",80389C41 00?? +Cheat15_O=$00 Carrie to Reindhart,$01 Reindhart to Carrie +Cheat15_N=This Switch From Cheat lets you switch characters on a saved game For example, if you are Reindhart and you want to be Carrie in the middle of your game save it and then enable this Cheat and press F1. when you start your saved game back up you'll be Carrie instead of Reindhart. + +//---- + +[A2C54BE7-6719CBB2-C:50] +Name=Castlevania - Legacy of Darkness (E) +Cheat0="Keys Option\Have Clocktower Key B",801CC040 0001 +Cheat1="Keys Option\Have Clocktower Key A",801CC03F 0001 +Cheat2="Keys Option\Have Clocktower Key E",801CC03E 0001 +Cheat3="Keys Option\Have Wall key",801CC03D 0001 +Cheat4="Keys Option\Have Control Room Key",801CC03C 0001 +Cheat5="Keys Option\Have Art Tower Key 2",801CC03B 0001 +Cheat6="Keys Option\Have Art Tower Key 1",801CC03A 0001 +Cheat7="Keys Option\Have Clocktower Key D",801CC039 0001 +Cheat8="Keys Option\Have Clocktower Key C",801CC038 0001 +Cheat9="Keys Option\Have Thorn Key",801CC037 0001 +Cheat10="Keys Option\Have Rose Garden Key",801CC01A 0001 +Cheat11="Keys Option\Have Deck Key",801CC035 0001 +Cheat12="Keys Option\Have Execution Key",801CC034 0001 +Cheat13="Keys Option\Have Chamber Key",801CC033 0001 +Cheat14="Keys Option\Have Copper Key",801CC032 0001 +Cheat15="Keys Option\Have Garden Key",801CC031 0001 +Cheat16="Keys Option\Have Storeroom Key",801CC030 0001 +Cheat17="Keys Option\Have Left Tower Key",801CC02F 0001 +Cheat18="Keys Option\Have Archives Key",801CC02E 0001 +Cheat19="Have Options\Rose Brooch",801CC02D 0001 +Cheat20="Have Options\Crest Half B",801CC02C 0001 +Cheat21="Have Options\Crest Half A",801CC02B 0001 +Cheat22="Have Options\Oldreys Diary",801CC02A 0001 +Cheat23="Have Options\Winch lever",801CC029 0001 +Cheat24="Infinite Options\Moon Cards",801CC028 0001 +Cheat25="Infinite Options\Sun Cards",801CC027 0001 +Cheat26="Have Options\Mandragora",801CC026 0001 +Cheat27="Have Options\Magical Nitro",801CC025 0001 +Cheat28="Have Options\Contract",801CC024 0001 +Cheat29="Have Options\Powerup",801CC01F 0001 +Cheat30="Infinite Options\Cure Ampoule",801CC01E 0001 +Cheat31="Infinite Options\Purifying",801CC01D 0001 +Cheat32="Infinite Options\Healing kit",801CC01C 0001 +Cheat33="Infinite Options\beef",801CC01B 0001 +Cheat34="Infinite Options\chicken",801CC01A 0001 +Cheat35="Have Options\Special Crystal 3",801CC019 0001 +Cheat36="Have Options\Special Crystal 2",801CC018 0001 +Cheat37="Have Options\Special Crystal 1",801CC017 0001 +Cheat38="Infinite Options\Red Jewels",801CC015 0068 +Cheat39="Infinite Options\Gold",811CC012 2710 +Cheat40="Infinite Options\Health",811CC00A 2710 +Cheat41="Weapon Modifier",801CC00F 00?? +Cheat42="Status Modifier",801CC054 00?? +Cheat41_O=$00 Nothing,$01 Knife,$02 Potion,$03 Cross,$04 Axe +Cheat42_O=$00 Never Get Poisoned or Vamped,$01 Normal,$04 Vamp,$08 Poison,$0C Vamped & Poisoned,$FF Instant Death +Cheat43="Level Modifier",801CC349 00?? +Cheat43_O=$00 Forest Of Silence,$01 Left Tower,$02 Castle Wall,$03 Villa,$04 Villa,$05 Villa,$06 Villa,$1A Villa,$07 Tunnel,$08 Underground Waterway,$09 Castle Center,$0A Castle Center,$0B Castle Center,$0C Castle Center,$0D Castle Center,$0E Castle Center,$0F Castle Center,$10 Foggy Lake,$11 Foggy Lake,$12 Foggy Lake,$13 Cave Of Spiderwomen,$14 Castle Keep,$15 Castle Keep,$16 Falls Into Space(?),$17 Clock Tower,$18 Final Battle Site,$19 Castle Center,$1B Room Of Clocks,$1C Countryside Where Carrie's Mom Is Buried.(Fall Through Ground),$2B Countryside Where Carrie's Mom Is Buried.(Fall Through Ground),$1D Tower Of Sorcery,$1E Tower Of Execution,$1F Tower Of Execution,$20 Tower Of Execution,$21 Tower Of Science,$22 Tower Of Science,$23 Tower Of Ruins,$24 Tower Of Ruins,$25 Art Tower,$26 Art Tower,$27 Dual Tower,$28 Clock Tower,$29 Clock Tower,$2A Outer Wall,$2C Fall From Sky Ouside Of Castlevania Opening,$2D Another Free Fall. Forest Where Girl Runs In Opening,$2E Black Room(?) +Cheat44="Inter-Level Modifier",801CC34B 00?? +Cheat44_O=$00 Forest Of Silence,$01 Left Tower,$02 Castle Wall,$03 Villa,$04 Villa,$05 Villa,$06 Villa,$1A Villa,$07 Tunnel,$08 Underground Waterway,$09 Castle Center,$0A Castle Center,$0B Castle Center,$0C Castle Center,$0D Castle Center,$0E Castle Center,$0F Castle Center,$10 Foggy Lake,$11 Foggy Lake,$12 Foggy Lake,$13 Cave Of Spiderwomen,$14 Castle Keep,$15 Castle Keep,$16 Falls Into Space(?),$17 Clock Tower,$18 Final Battle Site,$19 Castle Center,$1B Room Of Clocks,$1C Countryside Where Carrie's Mom Is Buried.(Fall Through Ground),$2B Countryside Where Carrie's Mom Is Buried.(Fall Through Ground),$1D Tower Of Sorcery,$1E Tower Of Execution,$1F Tower Of Execution,$20 Tower Of Execution,$21 Tower Of Science,$22 Tower Of Science,$23 Tower Of Ruins,$24 Tower Of Ruins,$25 Art Tower,$26 Art Tower,$27 Dual Tower,$28 Clock Tower,$29 Clock Tower,$2A Outer Wall,$2C Fall From Sky Ouside Of Castlevania Opening,$2D Another Free Fall. Forest Where Girl Runs In Opening,$2E Black Room(?) +Cheat45="Cut Scene Modifier",801CC363 0009,801CC35B 00?? +Cheat45_O=$03 Castle Drawbridge Lowers,$04 Character Enters Castle,$05 (?),$0A (?),$0C (?),$20 (?),$21 (?),$22 (?),$06 Vampire In Main Entrance Hall Of Villa,$07 One Of The Working Gears Cut Scenes,$08 "I Smell Poison" From Underground Waterway,$09 Castle Gate Closes In Villa Upon Entering Villa,$0B Renon Appears For First Time,$0D Village Vampire In Upstairs Villa,$0E Malus Appears For The First Time,$0F Malus Leaves Garden,$10 Character In Boat On Foggy Lake,$11 Seal Removed From Wall In Arena,$12 Bleeding Statue,$13 Cosmic Lights,$14 Explosion At Wall In Arena,$15 Explosion At Wall In Castle That Leads To Hidden Room,$16 Malus Appears Again In Upstairs Room Of Castle,$17 Bull Awakens,$18 Vincent The Vampire,$19 One Of The Working Gears Cut Scenes,$1A Gate Opens In Forest Of Silence,$1B Meet Renon For The Last Time In Castle Keep.,$1C This Cut Scene Runs Cut Scene 27 And 2E,$1E Castle Keep Destructs,$1F Malus On Flying Horse Outside Castle Keep,$24 Spider People In Tunnel,$25 Rosa In Garden,$27 Castel Destruction,$28 Space Warp,$29 Castle Destruction,$2A Malus Is Saved By Reinhardt,$2B Malus And Reinhardt On Horse,$2E Rosa Returns,$30 Ada Henry And Cornell At Game End,$31 Scrolling Text About Castle And Henry,$33 Vampire In Basement,$34 Vampire In Villa Basement Destroyed Woman Vampire Rises,$35 Finds Hidden Path In Villa Basement,$37 Lever & Gear In Castle,$38 Harpie,$39 Harpie Destroyed,$44 Death(Grim Reaper),$45 Death Is Destroyed,$46 Castle Drawbridge Closes And Ortega Appears,$47 Thirsty Man,$48 Cornell Meets Henry In Garden,$49 Cornell And Henry Part In Garden,$51 Monster Dracula Appears,$52 Actrise Appears In Castle Center,$54 Actrise Appears Again With Cousin Fernandes Before Fight With Carrie,$55 Cousin Fernandes Is Destroyed,$56 Actrise Appears Again Before Fight With Carrie,$57 Actrise Defeated By Carrie + +//---- + +[DCCF2134-9DD63578-C:50] +Name=Centre Court Tennis (E) +Cheat0="Infinite Character Creation Points",8017BB17 000A +Cheat1="Maximum\Serve Smash",8117BB0E 0A0A +Cheat2="Maximum\Volley Lob",8117BB10 0A0A +Cheat3="Maximum\Stroke Spin",8117BB12 0A0A +Cheat4="Maximum\Back,Front,Left & Right Move",8117BB14 000A +Cheat5="Left vs Right Side",8017BB16 0005 +Cheat6="Max Score In Mini Games",81116230 05F5,81116232 E0FF +Cheat7="Practice\Balls Always Zero",8011684F 0000 +Cheat8="Practice\Time Always Zero",8111684A 0000 +Cheat9="Scoreboard\Max sets top",80116983 0009 +Cheat10="Scoreboard\Max games top",8011698B 0009 +Cheat11="Scoreboard\Max sets bottom",80116987 0009 +Cheat12="Scoreboard\Max games bottom",8011698F 0009 + +//---- + +[B9AF8CC6-DEC9F19F-C:50] +Name=Chameleon Twist (E) +Cheat0="Access All Levels",8020860E 00FF,80208610 00FF +Cheat1="Extra Crowns",80251857 0015 +Cheat2="Infinite Health",80174DF3 000A +Cheat3="Extended Tongue",8133185E FFFF + +//---- + +[07A69D01-9A7D41A1-C:50] +Name=Chameleon Twist 2 (E) +Cheat0="Infinite Health",8018BA7D 000F +Cheat1="Max Collectable Items",80164501 0014 +Cheat2="Have 6 Carrots",80164519 007E +Cheat3="Have All\Levels",80164508 003F +Cheat4="Have All\Costumes",8016451A 00FE +Cheat5="Have All\Collectibles\Stage 1",80164510 0014 +Cheat6="Have All\Collectibles\Stage 2",80164511 0014 +Cheat7="Have All\Collectibles\Stage 3",80164512 0014 +Cheat8="Have All\Collectibles\Stage 4",80164513 0014 +Cheat9="Have All\Collectibles\Stage 5",80164514 0014 +Cheat10="Have All\Collectibles\Stage 6",80164515 0014 +Cheat11="Press L To levitate",D018BAB5 0020,8118B9E0 4200 +Cheat11_N=Press L To Levitate & Let go to land + +//---- + +[FB3C48D0-8D28F69F-C:50] +Name=Charlie Blast's Territory (E) +Cheat0="Stop Timer From Counting Down (All Levels)",8101D4E0 2400 + +//---- + +[2E359339-3FA5EDA6-C:50] +Name==Chopper Attack (E) +Cheat0="Max Score",81129716 FFFF +Cheat1="Infinite Weapon\1st Position",8012972B 0063 +Cheat2="Infinite Weapon\2nd Position",8012972F 0063 +Cheat3="Infinite Weapon\3rd Position",80129733 0063 +Cheat4="Infinite Weapon\4th Position",80129737 0063 +Cheat5="Infinite Weapon\5th Position",8012973B 0063 +Cheat6="Weapon Modifier\Gun Weapon",80129A13 00?? +Cheat7="Gun 4-Way Shot",80129A13 0004 +Cheat8="Infinite Fuel",81129A16 FFFF +Cheat9="Infinite Shield",811299B8 03E8 +Cheat10="Opens All 5 Item Slots",8012974B 0005 +Cheat11="Weapon Modifier\1st Position",80129729 00?? +Cheat12="Weapon Modifier\2nd Position",8012972D 00?? +Cheat13="Weapon Modifier\3rd Position",801297E1 00?? +Cheat14="Weapon Modifier\4th Position",801297E5 00?? +Cheat15="Weapon Modifier\5th Position",801297E9 00?? +Cheat16="Score Attack Mode",81129762 0001 +Cheat17="Stage Select On",81129766 0001 +Cheat18="Option On",8112976A 0001 +Cheat19="Clear Mission Selector",8112976C 00?? +Cheat20="Texture Mode",81129774 0001 +Cheat6_O=$00 No Weapon,$01 Normal Shot,$02 2-Way Shot,$03 3-Way Shot,$04 4-Way Shot +Cheat11_O=$00 Nothing,$01 AGM,$02 AAM,$03 AGAM,$04 Dummy,$05 Rocket,$06 Cluster,$07 H-Cluster,$08 H-Plasma +Cheat12_O=$00 Nothing,$01 AGM,$02 AAM,$03 AGAM,$04 Dummy,$05 Rocket,$06 Cluster,$07 H-Cluster,$08 H-Plasma +Cheat13_O=$00 Nothing,$01 AGM,$02 AAM,$03 AGAM,$04 Dummy,$05 Rocket,$06 Cluster,$07 H-Cluster,$08 H-Plasma +Cheat14_O=$00 Nothing,$01 AGM,$02 AAM,$03 AGAM,$04 Dummy,$05 Rocket,$06 Cluster,$07 H-Cluster,$08 H-Plasma +Cheat15_O=$00 Nothing,$01 AGM,$02 AAM,$03 AGAM,$04 Dummy,$05 Rocket,$06 Cluster,$07 H-Cluster,$08 H-Plasma +Cheat19_O=$01 1,$02 2,$03 3,$04 4,$05 5,$06 6,$07 7,$08 8 +Cheat11_N=Must to be used with the Infinite Weapon Codes & the open all 5 item slot code. +Cheat12_N=Must to be used with the Infinite Weapon Codes & the open all 5 item slot code. +Cheat13_N=Must to be used with the Infinite Weapon Codes & the open all 5 item slot code. +Cheat14_N=Must to be used with the Infinite Weapon Codes & the open all 5 item slot code. +Cheat15_N=Must to be used with the Infinite Weapon Codes & the open all 5 item slot code. + +//---- + +[8E9692B3-4264BB2A-C:50] +Name=Clay Fighter 63 1-3 (E) +Cheat0="Extra Characters and Secret Options",801A86A1 000F +Cheat1="Stage Select",801A868B 00?? +Cheat1_O=$00 Candy Factory,$01 Claynaveral Hangar,$02 Camp Claynaveral,$03 Outhouse,$04 Mudville Mansion,$05 Ghastly Graveyard,$06 Spooky Spire,$07 Happy Harry's Hut,$08 Freezing Fortress,$09 Refuse Room,$0A Grotto Gulch,$0B Rubbage Room,$0C Rubbage Reef,$0D Kiln's Laboratory,$0E Kiln's Hideout,$0F Fiery Furnace,$10 Research Room,$11 Clayribbean Cruise,$12 Santa's Workship,$13 Kooky Courtyard,$14 Santa's Toy Factory,$15 Boogerhenge,$16 Backwash Bay,$17 Tureen Toilet,$18 Tribal Tower,$19 Aquadome +Cheat2="Play As\Player1",801A868F 00?? +Cheat2_O=$00 Bad Mr. Frosty,$01 Blob,$02 Bonker,$03 Boogerman,$04 Dr. Kiln,$05 Earthworm Jim,$08 Houngan,$09 Icky Bod Clay,$0A Kung Pow,$0D Sumo Santa,$0E Taffy,$0F T-Hoppy +Cheat3="Refuse Room, Grotto Gulch, Santa's Workship Stages\Can't be Stunned\Player 1",801F766B 0000 +Cheat4="Refuse Room, Grotto Gulch, Santa's Workship Stages\Infinite Energy\Player 1",801F7673 00AA +Cheat5="Refuse Room, Grotto Gulch, Santa's Workship Stages\No Energy\Player 1",801F7673 0000 +Cheat6="Refuse Room, Grotto Gulch, Santa's Workship Stages\Full Super Bar\Player 1",811F767A 0200 +Cheat7="Tribal Tower Stage\Can't be Stunned\Player 1",801F770B 0000 +Cheat8="Tribal Tower Stage\Infinite Energy\Player 1",801F7713 00AA +Cheat9="Tribal Tower Stage\No Energy\Player 1",801F7713 0000 +Cheat10="Tribal Tower Stage\Full Super Bar\Player 1",811F771A 0200 +Cheat11="Aquadome Stage\Can't be Stunned\Player 1",801F799B 0000 +Cheat12="Aquadome Stage\Infinite Energy\Player 1",801F7993 00AA +Cheat13="Aquadome Stage\No Energy\Player 1",801F7993 0000 +Cheat14="Aquadome Stage\Full Super Bar\Player 1",811F799A 0200 +Cheat15="Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Can't be Stunned\Player 1",801F7E9B 0000 +Cheat16="Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Infinite Energy\Player 1",801F7EA3 00AA +Cheat17="Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\No Energy\Player 1",801F7EA3 0000 +Cheat18="Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Full Super Bar\Player 1",811F7EAA 0200 +Cheat19="Freezing Fortress Stage\Can't be Stunned\Player 1",801F7EFB 0000 +Cheat20="Freezing Fortress Stage\Infinite Energy\Player 1",801F7F03 00AA +Cheat21="Freezing Fortress Stage\No Energy\Player 1",801F7F03 0000 +Cheat22="Freezing Fortress Stage\Full Super Bar\Player 1",811F7F0A 0200 +Cheat23="Rubbage Reef Stage\Can't be Stunned\Player 1",801F7F7B 0000 +Cheat24="Rubbage Reef Stage\Infinite Energy\Player 1",801F7F83 00AA +Cheat25="Rubbage Reef Stage\No Energy\Player 1",801F7F83 0000 +Cheat26="Rubbage Reef Stage\Full Super Bar\Player 1",811F7F8A 0200 +Cheat27="Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Can't be Stunned\Player 1",801F7FAB 0000 +Cheat28="Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Infinite Energy\Player 1",801F7FB3 00AA +Cheat29="Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\No Energy\Player 1",801F7FB3 0000 +Cheat30="Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Full Super Bar\Player 1",811F7FBA 0200 +Cheat31="Clayribbean Cruise Stage\Can't be Stunned\Player 1",801F805B 0000 +Cheat32="Clayribbean Cruise Stage\Infinite Energy\Player 1",801F8063 00AA +Cheat33="Clayribbean Cruise Stage\No Energy\Player 1",801F8063 0000 +Cheat34="Clayribbean Cruise Stage\Full Super Bar\Player 1",811F806A 0200 +Cheat35="Backwash Bay Stage\Can't be Stunned\Player 1",801F80EB 0000 +Cheat36="Backwash Bay Stage\Infinite Energy\Player 1",801F80F3 00AA +Cheat37="Backwash Bay Stage\No Energy\Player 1",801F80F3 0000 +Cheat38="Backwash Bay Stage\Full Super Bar\Player 1",811F80FA 0200 +Cheat39="Ghastly Graveyard Stage\Can't be Stunned\Player 1",801F818B 0000 +Cheat40="Ghastly Graveyard Stage\Infinite Energy\Player 1",801F8193 00AA +Cheat41="Ghastly Graveyard Stage\No Energy\Player 1",801F8193 0000 +Cheat42="Ghastly Graveyard Stage\Full Super Bar\Player 1",811F819A 0200 +Cheat43="Candy Factory Stage\Can't be Stunned\Player 1",801F826B 0000 +Cheat44="Candy Factory Stage\Infinite Energy\Player 1",801F8273 00AA +Cheat45="Candy Factory Stage\No Energy\Player 1",801F8273 0000 +Cheat46="Candy Factory Stage\Full Super Bar\Player 1",811F827A 0200 +Cheat47="Kooky Courtyard Stage\Can't be Stunned\Player 1",801F836B 0000 +Cheat48="Kooky Courtyard Stage\Infinite Energy\Player 1",801F8373 00AA +Cheat49="Kooky Courtyard Stage\No Energy\Player 1",801F8373 0000 +Cheat50="Kooky Courtyard Stage\Full Super Bar\Player 1",811F837A 0200 +Cheat51="Santa's Toy Factory Stage\Can't be Stunned\Player 1",801F879B 0000 +Cheat52="Santa's Toy Factory Stage\Infinite Energy\Player 1",801F87A3 00AA +Cheat53="Santa's Toy Factory Stage\No Energy\Player 1",801F87A3 0000 +Cheat54="Santa's Toy Factory Stage\Full Super Bar\Player 1",811F87AA 0200 +Cheat55="Boogerhenge, Tureen Toilet Stage\Can't be Stunned\Player 1",801F8B3B 0000 +Cheat56="Boogerhenge, Tureen Toilet Stage\Infinite Energy\Player 1",801F8B43 00AA +Cheat57="Boogerhenge, Tureen Toilet Stage\No Energy\Player 1",801F8B43 0000 +Cheat58="Boogerhenge, Tureen Toilet Stage\Full Super Bar\Player 1",811F8B4A 0200 +Cheat59="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Can't be Stunned\Player 1",801F971B 0000 +Cheat60="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Infinite Energy\Player 1",801F9723 00AA +Cheat61="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\No Energy\Player 1",801F9723 0000 +Cheat62="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Full Super Bar\Player 1",811F972A 0200 +Cheat63="Rubbage Room Stage\Can't be Stunned\Player 1",801FA1AB 0000 +Cheat64="Rubbage Room Stage\Infinite Energy\Player 1",801FA1B3 00AA +Cheat65="Rubbage Room Stage\No Energy\Player 1",801FA1B3 0000 +Cheat66="Rubbage Room Stage\Full Super Bar\Player 1",811FA1BA 0200 +Cheat67="Refuse Room, Grotto Gulch, Santa's Workship Stages\Can't be Stunned\Player 2",801FAB0B 0000 +Cheat68="Refuse Room, Grotto Gulch, Santa's Workship Stages\Infinite Energy\Player 2",801FAB13 00AA +Cheat69="Refuse Room, Grotto Gulch, Santa's Workship Stages\No Energy\Player 2",801FAB13 0000 +Cheat70="Refuse Room, Grotto Gulch, Santa's Workship Stages\Full Super Bar\Player 2",811FAB1A 0200 +Cheat71="Tribal Tower Stage\Can't be Stunned\Player 2",801FABAB 0000 +Cheat72="Tribal Tower Stage\Infinite Energy\Player 2",801FABB3 00AA +Cheat73="Tribal Tower Stage\No Energy\Player 2",801FABB3 0000 +Cheat74="Tribal Tower Stage\Full Super Bar\Player 2",811FABBA 0200 +Cheat75="Aquadome Stage\Can't be Stunned\Player 2",801FAE2B 0000 +Cheat76="Aquadome Stage\Infinite Energy\Player 2",801FAE33 00AA +Cheat77="Aquadome Stage\No Energy\Player 2",801FAE33 0000 +Cheat78="Aquadome Stage\Full Super Bar\Player 2",811FAE3A 0200 +Cheat79="Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Can't be Stunned\Player 2",801FB33B 0000 +Cheat80="Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Infinite Energy\Player 2",801FB343 00AA +Cheat81="Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\No Energy\Player 2",801FB343 0000 +Cheat82="Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Full Super Bar\Player 2",811FB34A 0200 +Cheat83="Freezing Fortress Stage\Can't be Stunned\Player 2",801FB39B 0000 +Cheat84="Freezing Fortress Stage\Infinite Energy\Player 2",801FB3A3 00AA +Cheat85="Freezing Fortress Stage\No Energy\Player 2",801FB3A3 0000 +Cheat86="Freezing Fortress Stage\Full Super Bar\Player 2",811FB3AA 0200 +Cheat87="Rubbage Reef Stage\Can't be Stunned\Player 2",801FB41B 0000 +Cheat88="Rubbage Reef Stage\Infinite Energy\Player 2",801FB423 00AA +Cheat89="Rubbage Reef Stage\No Energy\Player 2",801FB423 0000 +Cheat90="Rubbage Reef Stage\Full Super Bar\Player 2",811FB42A 0200 +Cheat91="Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Can't be Stunned\Player 2",801FB44B 0000 +Cheat92="Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Infinite Energy\Player 2",801FB453 00AA +Cheat93="Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\No Energy\Player 2",801FB453 0000 +Cheat94="Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Full Super Bar\Player 2",811FB45A 0200 +Cheat95="Clayribbean Cruise Stage\Can't be Stunned\Player 2",801FB4FB 0000 +Cheat96="Clayribbean Cruise Stage\Infinite Energy\Player 2",801FB503 00AA +Cheat97="Clayribbean Cruise Stage\No Energy\Player 2",801FB503 0000 +Cheat98="Clayribbean Cruise Stage\Full Super Bar\Player 2",811FB50A 0200 +Cheat99="Backwash Bay Stage\Can't be Stunned\Player 2",801FB58B 0000 +Cheat101="Backwash Bay Stage\Infinite Energy\Player 2",801FB593 00AA +Cheat102="Backwash Bay Stage\No Energy\Player 2",801FB593 0000 +Cheat103="Backwash Bay Stage\Full Super Bar\Player 2",811FB59A 0200 +Cheat104="Ghastly Graveyard Stage\Can't be Stunned\Player 2",801FB62B 0000 +Cheat105="Ghastly Graveyard Stage\Infinite Energy\Player 2",801FB633 00AA +Cheat106="Ghastly Graveyard Stage\No Energy\Player 2",801FB633 0000 +Cheat107="Ghastly Graveyard Stage\Full Super Bar\Player 2",811FB63A 0200 +Cheat108="Candy Factory Stage\Can't be Stunned\Player 2",801FB70B 0000 +Cheat109="Candy Factory Stage\Infinite Energy\Player 2",801FB713 00AA +Cheat110="Candy Factory Stage\No Energy\Player 2",801FB713 0000 +Cheat111="Candy Factory Stage\Full Super Bar\Player 2",811FB71A 0200 +Cheat112="Kooky Courtyard Stage\Can't be Stunned\Player 2",801FB80B 0000 +Cheat113="Kooky Courtyard Stage\Infinite Energy\Player 2",801FB813 00AA +Cheat114="Kooky Courtyard Stage\No Energy\Player 2",801FB813 0000 +Cheat115="Kooky Courtyard Stage\Full Super Bar\Player 2",811FB81A 0200 +Cheat116="Santa's Toy Factory Stage\Can't be Stunned\Player 2",801FBC3B 0000 +Cheat117="Santa's Toy Factory Stage\Infinite Energy\Player 2",801FBC43 00AA +Cheat118="Santa's Toy Factory Stage\No Energy\Player 2",801FBC43 0000 +Cheat119="Santa's Toy Factory Stage\Full Super Bar\Player 2",811FBC4A 0200 +Cheat120="Boogerhenge, Tureen Toilet Stage\Can't be Stunned\Player 2",801FBFDB 0000 +Cheat121="Boogerhenge, Tureen Toilet Stage\Infinite Energy\Player 2",801FBFE3 00AA +Cheat122="Boogerhenge, Tureen Toilet Stage\No Energy\Player 2",801FBFE3 0000 +Cheat123="Boogerhenge, Tureen Toilet Stage\Full Super Bar\Player 2",811FBFEA 0200 +Cheat124="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Can't be Stunned\Player 2",801FCBBB 0000 +Cheat125="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Infinite Energy\Player 2",801FCBC3 00AA +Cheat126="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\No Energy\Player 2",801FCBC3 0000 +Cheat127="Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Full Super Bar\Player 2",811FCBCA 0200 +Cheat128="Rubbage Room Stage\Can't be Stunned\Player 2",801FD64B 0000 +Cheat129="Rubbage Room Stage\Infinite Energy\Player 2",801FD653 00AA +Cheat130="Rubbage Room Stage\No Energy\Player 2",801FD653 0000 +Cheat131="Rubbage Room Stage\Full Super Bar\Player 2",811FD65A 0200 + +//---- + +[AE5B9465-C54D6576-C:50] +Name=Command & Conquer (E) +Cheat0="Infinite Options\Power GDI",810C55D6 FFFF +Cheat1="Infinite Options\Power NOD",810C577E FFFF +Cheat2="Infinite Options\Health Commando",810B5364 0080 +Cheat3="Infinite Options\Money NOD",810C575E FFFF +Cheat4="Infinite Options\Money GDI",810C55B6 FFFF +Cheat5="Level Select",810901AA 0001 +Cheat5_N=Select Replay Mission, Press L To Display All Missions,And Press R To Select Your Team You can now press R+L+Up To Win A Battle + +//---- + +[373F5889-9A6CA80A-C:50] +Name=CONKER BFD +Cheat0="Infinite\Health\Player 1",800CC8BA 0006 +Cheat1="Infinite\Oxygen",800CC7A2 0001 +Cheat3="Access All\Chapters, Scenes,& Multi-Player Characters",50002401 0000,800EA120 00FF +Cheat4="Play as",800D255F 00?? +Cheat4_O=$01 Wessle,$03 Tedi,$04 Combat Squirrel,$05 Conker,$0B Uga,$0C Bald Caveman,$0D Caveman,$0E Mohican Caveman,$10 Neo Conker,$1B Villager,$21 Zombie,$23 Enemy Bat,$24 Conkers Bat,$25 Army Captain,$26 Tedi Boss,$27 Gregg,$28 Gregg skeleton +Cheat4_N=Here you can Choose Options who you want to play as,But only one Option at a time. +Cheat5="Infinite\Lives Player 1",800D2564 0063 +Cheat6="Infinite\Health\Player 2",800CCBE6 270F +Cheat7="Infinite\Health\Player 3",800CCF12 270F +Cheat8="Infinite\Health\Player 4",800CD23E 270F +Cheat9="Infinite\Time In Multi",8109019A 7500 +Cheat10="Infinite\Bags In Heist",800E1004 00FF +Cheat11="Access All\Characters & Weapons In Multi Race",810EA122 ??FF +Cheat11_O=$FF All Characters & Baseball bat,$FB All Characters & Frying Pan,$F3 All Characters & Bones +Cheat12="Infinite\Bombs",802059EA 0030 +Cheat13="Infinite\Max Kills Player 1",800E0F67 03E7 +Cheat14="Infinite\Accuracy Count Player 1",800E0F87 0001 +Cheat15="Infinite\Head Shot Count Player 1",800E0F8B 0064 +Cheat16="Press L To Levitate\Player 1",D0042DA5 0020,810CC710 41CB +Cheat17="Press L To Levitate\Player 2",D0042DAE 0020,810CCA3C 41CB +Cheat18="Press L To Levitate\Player 3",D0042DB5 0020,810CCD68 41CB +Cheat19="Press L To Levitate\Player 4",D0042DBE 0020,810CD094 41CB +Cheat20="Weapon Select In Multi (On Pick Up)",80180C4B 00?? +Cheat20_O=$01 Sword,$02 Nothing,$03 Yellow Chain-Ssaw,$04 Throwing Knives,$05 Riffle,$06 Long Pistol with Sight,$07 Rocket Launcher,$08 Buck Shot,$0A High Powred Riffle With Scope,$0C Two Automatic Machine Guns,$13 Gas Mask +Cheat20_N=Select what Weapon you would like in Multi Player and then on a Weapon Pickup you will have the weapon of your choice.to change for another just Enable the one of your choice to have that instead.(you must have a weapon already to change for the next. +Cheat13_N=MULTI ONLY. Only put this code on once you are in the game +Cheat14_N=MULTI ONLY. Only put this code on once you are in the game,Once you pick up a Gun a shoot once, you will 100%. +Cheat15_N=MULTI ONLY. Only put this code on once you are in the game +Cheat16_N=Press L Button to Levitate & Let go to come back down +Cheat17_N=Press L Button to Levitate & Let go to come back down +Cheat18_N=Press L Button to Levitate & Let go to come back down +Cheat19_N=Press L Button to Levitate & Let go to come back down +Cheat2="Infinite\Pots of cash",810D256A FFFF + +//---- + +[503EA760-E1300E96-C:50] +Name=Cruis'n USA (E) (1.0) +Cheat0="Always Place 1st",801502CB 0001 +Cheat1="Unlimited Time",801509ED 0045 +Cheat2="Access Options\All Tracks",80150602 001F,80150603 00FF +Cheat3="Access Options\All Car Upgrades",50000704 0000,801505DF 0003 + +//---- + +[503EA760-E1300E96-C:50] +Name=Cruis'n USA (E) (1.1) +Cheat0="Always Place 1st",801501AB 0001 +Cheat1="Unlimited Time",801508CD 0045 +Cheat2="Access Options\All Tracks",801504E2 001F,801504E3 00FF +Cheat3="Access Options\All Car Upgrades",50000704 0000,801504BF 0003 + +//---- + +[503EA760-E1300E96-C:50] +Name=Cruis'n USA (E) (1.2) +Cheat0="Always Place 1st",801501DB 0001 +Cheat1="Unlimited Time",801508FD 0045 +Cheat2="Access Options\All Tracks",80150512 001F,80150123 00FF +Cheat3="Access Options\All Car Upgrades",50000704 0000,801504EF 0003 + +//---- + +[83F3931E-CB72223D-C:50] +Name=Cruis'n World (E) +Cheat0="Infinite Time",813D0C1C 4296 +Cheat1="Access\Florida & Moon Tracks",813BF2A4 0101 +Cheat2="Max Power Level,& Paint Job / Two Tone",813BEDA2 0512 +Cheat3="Access\All Cars & Upgrades",813BED58 1FFF,803BED22 0005 +Cheat4="Unlocked Pro & Master difficulty level",803BEDD5 0003 +Cheat5="Dancing Girl Always On",803BED53 0001,803C20AF 0054 +Cheat6="Cannot Spin Out",803CDC73 0000 +Cheat7="Disable\Left Lane Traffic",8033C83B 0001 +Cheat8="Disable\Right Lane Traffic",8033C83F 0001 +Cheat9="Max\Trick points",803BF21F 0063 +Cheat10="Max\Championship Points",813BFB4E 270F +Cheat11="Always 1st\Player 1",803CDF03 0001 +Cheat12="Unlimited Nitro\Player 1",803C74C7 0003 +Cheat13="Stop Elapsed Time\Player 1",813C7558 3C80 +Cheat14="Always 1st\Player 2",803CE3DB 0001 +Cheat15="Unlimited Nitro\Player 2",803C7703 0003 +Cheat16="Stop Elapsed Time\Player 2",813C7794 3C80 +Cheat17="Always 1st\Player 3",803CDA2B 0001 +Cheat18="Unlimited Nitro\Player 3",803C704F 0064 +Cheat19="Always 1st\Player 4",803CD553 0001 +Cheat20="Unlimited Nitro Player 4",803C728B 0003 +Cheat1_N=This is for Championship Mode Only +Cheat7_N=This is for Championship Mode Only +Cheat8_N=This is for Championship Mode Only +Cheat12_N=Press C-Button Down For Boost, This Code is for Championship Mode Only +Cheat15_N=Press C-Button Down For Boost, This Code is for Championship Mode Only +Cheat18_N=Press C-Button Down For Boost, This Code is for Championship Mode Only +Cheat20_N=Press C-Button Down For Boost, This Code is for Championship Mode Only + +//---- + +[D1A78A07-52A3DD3E-C:50] +Name=CyberTiger (E) +Cheat0="Infinite & Max Power-Ups",800B4612 00F0,50000801 0000,800B4600 00FF +Cheat1="Access Secret Characters\Kimmi & Cindy",800B0DAA 0011 +Cheat2="Access Secret Characters\Twfan & Eagamer",800B0DAE 0011 +Cheat3="Access Secret Characters\Bengal The Tiger",800B4DB2 0011 +Cheat4="Access Secret Characters\Mark",800B0DB7 0012 +Cheat5="Access Secret Characters\Robert & Delvis",800B0DBA 0011 +Cheat6="Access Secret Characters\Starr & Traci",800B0DBE 0011 +Cheat7="Access Secret Characters\Festus",800B0DC3 0001 +Cheat8="Access Secret Characters\Marvin The Alien",800B0DC7 0001 + +//---- + +[7ED67CD4-B4415E6D-C:50] +Name=DARK RIFT +Cheat0="Access Sonork Character",80049AA0 0001 +Cheat1="Access Demitron Character",80049AA4 0001 +Cheat2="Infinite Health\All Levels\Player 1",812716E0 0190,8127BDB8 0190,8127E478 0190,81292EE8 0190,81293768 0190,81297538 0190,812ACCC8 0190,812B1CE8 0190,812B7BE8 0190,8138AEE0 0190 +Cheat3="Infinite Health\All Levels\Player 2",81271FB8 0190,8127B158 0190,8127E820 0190,81293B48 0190,81294390 0190,812980B8 0190,812AD608 0190,812B2D08 0190,812B67D8 0190,8138A898 0190 +Cheat4="Press GS For 2 Rounds Won\Player 1",880B6491 0002 +Cheat5="Press GS For 2 Rounds Won\Player 2",880B64A3 0002 +Cheat6="Music Modifier",80081812 00?? +Cheat6_O=$00 Music Off,$2A Volume Low,$55 Volume Medium,$7F Volume Max + +//---- + +[630AA37D-896BD7DB-C:50] +Name=Destruction Derby 64 (E) +Cheat0="Have All\Tracks",50000802 0000,81099498 0101 +Cheat1="Have All\Difficulty Levels",8109B7D6 0003 +Cheat2="Have All\Cars",50000602 0000,8109B7D8 0101 +Cheat3="Max\Points Aid",8112A3CE 02F4 +Cheat4="Max\Collisions Points",812E013A 02F4 +Cheat5="Max\Checkpoint Bonus",812E013E 02F4 + +//---- + +[FD73F775-9724755A-C:50] +Name=Diddy Kong Racing +Cheat0="Enable All Cheats",800DFE2C 001F,50000301 0000,800DFE2D 00FF +Cheat1="Have All\Trophies",80207E6E 0007,80207E6F 00FF +Cheat2="Have All\Keys",80207E69 001F +Cheat3="Have All\T.T. Amulets",80207E77 0004 +Cheat4="Have All\50 Balloons",8020807D 0032 +Cheat5="Have All\None-Adventure tracks completed",50001204 0000,80207F87 0007,50000904 0000,80207FDF 0007,80207E68 0007,80207E6A 0007,80207E6B 0007,80207E6C 000F,80207E6D 00FF +Cheat6="Have All\T.T. time trial races beaten",80207E76 0004 +Cheat7="Have All\Control Drumstick & Adventure Two mode unlocked",801264DC 0003,801264DF 0003,801264F2 0003,801264F3 0008 +Cheat8="Have All\Trophy Adventure races unlocked",50000502 0000,8020807E 0007 +Cheat0_N=Go into Options & then Magic Codes. Then Code list to turn off & on what you want. +Cheat1_N=Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. +Cheat2_N=Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. +Cheat3_N=Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. + +//---- + +[596E145B-F7D9879F-C:50] +Name=Diddy Kong Racing +Cheat0="Enable All Cheats",800E03AC 001F,50000301 0000,800E03AD 00FF +Cheat1="Have All\Trophies",8020865E 0007,8020865F 00FF +Cheat2="Have All\Keys",80208659 001F +Cheat3="Have All\T.T. Amulets",80208667 0004 +Cheat4="Have All\50 Balloons",8020807D 0032 +Cheat6="Have All\T.T. time trial races beaten",80208666 0004 +Cheat5="Have All\None-Adventure tracks completed",50001204 0000,80208777 0007,50000904 0000,802087CF 0007,80208658 0007,8020865A 0007,8020865B 0007,8020865C 000F,8020865D 00FF +Cheat7="Have All\Control Drumstick & Adventure Two mode unlocked",80126CCC 0003,80126CCF 0003,80126CE2 0003,80126CE3 0008 +Cheat8="Have All\Trophy Adventure races unlocked",50000502 0000,8020886E 0007 +Cheat0_N=Go into Options & then Magic Codes. Then Code list to turn off & on what you want. +Cheat1_N=Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. +Cheat2_N=Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. +Cheat3_N=Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. + +//---- + +[D614E5BF-A76DBCC1-C:50] +Name=Disney's Tarzan (E) +Cheat0="Infinite\Health",81192300 0120 +Cheat1="Have\Coins Collected 100%",800DD4B7 0064 +Cheat2="Have\Level & Tokens Completed 100%",800DD48F 0000,800DD490 0001,800DD491 0000 +Cheat3="Access Level Select",810DD47C 8001 +Cheat4="Infinite\Lives",800DD4B2 00?? +Cheat5="Have\All TARZAN Letters",800DD485 00FF +Cheat6="Have\Full Portrait",800DD484 00FF +Cheat7="Infinite\Red Weapon",811921D8 0063 +Cheat8="Infinite\Green Weapon",811921D6 0063 +Cheat9="Infinite\Purple Weapon",811921DA 0063 +Cheat10="Press GS For\Sabor Attacks\Sabor 1 Hit Kill",8924A49E 0001 +Cheat11="Infinite\Bonus Timer",8017373E 0025 +Cheat3_N=On the main menu Scroll down to make CHEATS visible to go into Level Select.For in-Game Cheats,Pause gameplay. +Cheat4_O=$03 3 Lives,$63 99 Lives +Cheat11_N=This is For All Timers on Bonus Levels + +//---- + +[3DF17480-193DED5A-C:50] +Name=Donald Duck Quack At +Cheat0="Infinite\99 Lives",801D6F2E 0063 +Cheat1="Infinite\99 Stars",801D6F2F 0063 +Cheat2="Instant\Rage Attack (Press C-Left)",D00CAFD1 0002,801CE23D 0001 +Cheat3="Instant\Hyperactive State [Invincible] (Press C-Right)",D00CAFD1 0001,801CE296 0001 +Cheat4="Instant\Carrier Box [Moon Walk] (Press L)",D00CAFD1 0020,801C901F 0001 +Cheat4_N=Press and hold the L Button and you will run floating of any ledge slowing drifting down. If you keep pressing the A Button while Holding L it will act as a Moon Jump. +Cheat5="Infinite\Time\Gladstones Time Attack",801D6F27 00FF +Cheat6="Infinite\Time\Nephews Toy Hunting",801D6F23 0063 +Cheat7="Have All\Levels and Bonus Stages Unlocked",801D6F4C 00FF,801D6F4D 00FF,801D6F4E 00FF,801D6F4F 00FF,801D6F53 00FF +Cheat7_N=Press start in Gyro's Lab and then resume game to see all open +Cheat8="Have All\Time Attack & Toy Hunting Comnpleated (All Levels)",801D6F58 00FF,801D6F59 00FF,801D6F5A 00FF,801D6F5B 00FF,801D6F5C 00FF,801D6F5D 00FF,801D6F5E 00FF,801D6F5F 00FF +Cheat8_N=Press start in Gyro's Lab and then resume game to see all open + +//---- + +[11936D8C-6F2C4B43-C:50] +Name=DONKEY KONG 64 +Cheat0="Donkey Kong\Infinite Ammo",807FCB85 0096 +Cheat2="Donkey Kong\Infinite Musical Instrument",817FC894 0103,817FC898 00FF +Cheat3="Diddy\Infinite Musical Instrument",817FC8F6 000A +Cheat4="Tiny\Infinite Musical Instrument",817FC9B2 000A +Cheat5="Lanky\Infinite Musical Instrument",817FC954 000A +Cheat6="Chunky\Infinite Musical Instrument",817FCA10 000A +Cheat7="Infinite\Camera Film",807FCB89 0005 +Cheat8="Infinite\Orange Bombs",807FCB81 0096 +Cheat9="Donkey Kong\Infinite Bananas\Jungle Japes",817FC89A 03E7 +Cheat10="Donkey Kong\Infinite Bananas\Angry Aztec",817FC89C 03E7 +Cheat11="Donkey Kong\Infinite Bananas\FactoryLevel",817FC89E 03E7 +Cheat12="Donkey Kong\Infinite Bananas\Galleon Level",817FC8FE 03E7 +Cheat13="Donkey Kong\Infinite Bananas\Fungi Forest",817FC8A2 03E7 +Cheat14="Donkey Kong\Infinite Bananas\Creepy Castle",817FC8A6 03E7 +Cheat15="Donkey Kong\Infinite Bananas\Crystal Caves",817FC8A4 03E7 +Cheat16="Donkey Kong\All Golden Bananas\Jungle Japes",817FC8D2 03E7 +Cheat17="Donkey Kong\All Golden Bananas\Angry Aztecs",817FC8D4 03E7 +Cheat18="Donkey Kong\All Golden Bananas\Frantic Factory",817FC8D6 03E7 +Cheat19="Donkey Kong\All Golden Bananas\Gloomy Galleon",817FC8D8 03E7 +Cheat20="Donkey Kong\All Golden Bananas\Crystal Caves",817FC8DC 03E7 +Cheat21="Donkey Kong\All Golden Bananas\Creepy Castle",817FC8DE 03E7 +Cheat22="Donkey Kong\All Golden Bananas\DK Isle",817FC8E0 03E7 +Cheat23="Diddy\All Golden Bananas\Jungle Japes",817FC930 0064 +Cheat24="Diddy\All Golden Bananas\Angry Aztecs",817FC932 0064 +Cheat25="Diddy\All Golden Bananas\Frantic Factory",817FC934 0064 +Cheat26="Diddy\All Golden Bananas\Gloomy Galleon",817FC936 0064 +Cheat27="Diddy\All Golden Bananas\Fungi Forest",817FC938 0064 +Cheat28="Diddy\All Golden Bananas\Crystal Caves",817FC93A 0064 +Cheat29="Diddy\All Golden Bananas\Creepy Castle",817FC93C 0064 +Cheat30="Diddy\All Golden Bananas\DK Isle",817FC93E 0064 +Cheat31="Tiny\All Golden Bananas\Jungle Japes",817FC9EC 0064 +Cheat32="Tiny\All Golden Bananas\Angry Aztecs",817FC9EE 0064 +Cheat33="Tiny\All Golden Bananas\Frantic Factory",817FC9F0 0064 +Cheat34="Tiny\All Golden Bananas\Gloomy Galleon",817FC9F2 0064 +Cheat35="Tiny\All Golden Bananas\Fungi Forest",817FC9F4 0064 +Cheat36="Tiny\All Golden Bananas\Crystal Caves",817FC9F6 0064 +Cheat37="Tiny\All Golden Bananas\Creepy Castle",817FC9E8 0064 +Cheat38="Tiny\All Golden Bananas\DK Isle",817FC9FA 0064 +Cheat39="Lanky\All Golden Bananas\Jungle Japes",817FC98E 0064 +Cheat40="Lanky\All Golden Bananas\Angry Aztecs",817FC990 0064 +Cheat41="Lanky\All Golden Bananas\Frantic Factory",817FC992 0064 +Cheat42="Lanky\All Golden Bananas\Gloomy Galleon",817FC994 0064 +Cheat43="Lanky\All Golden Bananas\Fungi Forest",817FC996 0064 +Cheat44="Lanky\All Golden Bananas\Crystal Caves",817FC998 0064 +Cheat45="Lanky\All Golden Bananas\Creepy Castle",817FC99A 0064 +Cheat46="Lanky\All Golden Bananas\DK Isle",817FC99C 0064 +Cheat47="Chunky\All Golden Bananas\Jungle Japes",817FCA4A 0064 +Cheat48="Chunky\All Golden Bananas\Angry Aztecs",817FCA4C 0064 +Cheat49="Chunky\All Golden Bananas\Frantic Factory",817FCA4E 0064 +Cheat50="Chunky\All Golden Bananas\Gloomy Galleon",817FCA50 0064 +Cheat51="Chunky\All Golden Bananas\Fungi Forest",817FCA52 0064 +Cheat52="Chunky\All Golden Bananas\Crystal Caves",817FCA54 0064 +Cheat53="Chunky\All Golden Bananas\Creepy Castle",817FCA56 0064 +Cheat54="Chunky\All Golden Bananas\DK Isle",817FCA58 0064 +Cheat55="Donkey Kong\Infinite Coins",817FC896 03E7 +Cheat56="Diddy\Infinite Coins",817FC8F4 03E7 +Cheat57="Tiny\Infinite Coins",817FC9B0 03E7 +Cheat58="Lanky\Infinite Coins",817FC952 03E7 +Cheat59="Chunky\Infinite Coins",817FCA0E 03E7 +Cheat60="Infinite\Crystal Coconuts",817FCB86 03E7 +Cheat61="Donkey Kong\Has Moves",817FC890 0103 +Cheat62="Donkey Kong\Have Weapon",817FC892 0103 +Cheat63="Free Pass (Access All Areas)",8066D167 0001,8066D262 0001 +Cheat63_N=This is exactly what it says, You can walk through Any Locked Door,Gate, Or Area. Have Fun. +Cheat1="Infinite\Health",817FCB8C 041F + +//---- + +[2C739EAC-9EF77726-C:50] +Name=Doom 64 (E) +Cheat0="Always Have\Gun",80063373 0001 +Cheat1="Always Have\Shotgun",80063377 0001 +Cheat2="Always Have\Double Shotgun",8006337B 0001 +Cheat3="Always Have\Chain Gun",8006337F 0001 +Cheat4="Always Have\Missile Launcher",80063383 0001 +Cheat5="Always Have\Chainsaw",8006336B 0001 +Cheat6="Always Have\Plasma Rifle",80063387 0001 +Cheat7="Always Have\BFG",8006338B 0001 +Cheat8="Infinite\Armor",800634BF 00FF +Cheat9="Rapid Fire",810633EA 0B94 +Cheat10="Invincible",8006355B 0002 +Cheat11="Turn Map Markers On",800633BB 0004 +Cheat12="Invincible And Map Markers",800633BB 0006 +Cheat13="Always Have\Bio Suite",80063333 00?? +Cheat13_O=$FF On,$00 Off +Cheat14="Always Have\Missile Ammo",8006339F 0064 +Cheat15="Always Have\Have Rocket Launcher",80063381 0001 +Cheat16="Always Have\Have Laser Weapon",8006338D 0001 +Cheat17="[Max Brightness]",8005AA18 0064 +Cheat17_N=Enable this cheat on rom load to have Max Brightness (internal) and then put Jabo d3d8 on 160% Max for a extra brightness Boost. +Cheat18="Have All\Keys",50000504 0000,810634DE FFFF +Cheat19="Have All\Weapons",50000A04 0000,8106350A 0001 +Cheat20="Infinite\Ammo All Weapons",50000404 0000,81063532 013C +Cheat21="Enable Cheat Menu",8005AA23 0001 + +//---- + +[B6524461-ED6D04B1-C:50] +Name=Dual Heroes (E) +Cheat0="Infinite Health\Player 1",80225E9D 00FA +Cheat1="Infinite Health\Player 2",80225E9F 00FA +Cheat2="Win Once To Win\Player 1",80225E95 0001 +Cheat3="Win Once To Win\Player 2",80225E97 0001 +Cheat4="Infinite Time",80225EA5 003C + +//---- + +[57BFF74D-DE747743-C:50] +Name=Duke Nukem 64 (E) +Cheat0="Access all In-Game cheats",50000504 0000,80101308 0001 +Cheat1="Infinite\Ammo & All Guns",50000C02 0000,812A5A34 02F4 +Cheat2="Access\All Items",801012EC 0001 +Cheat3="Invincibility",802AAA98 0001 +Cheat4="Access\All Keys",802A5A77 000F +Cheat5="Infinite\Holoduke",812A5A5C 0640 +Cheat6="Infinite\Night Vision",812A5A8C 0640 +Cheat7="Infinite\Scuba Gear",812A5ABC 0640 +Cheat8="Crosshair On",802A5B24 0001 +Cheat9="Max auto-aim On",802A5B25 0002 +Cheat10="Upgraded Plasma Gun",802A5A63 0063 +Cheat2_N=To access simply pause in game play & then unpause. + +//---- + +[DC36626A-3F3770CB-C:50] +Name=DUKE NUKEM ZERO HOUR +Cheat0="Cheat Menu\Cheat Menu Enabled",800CF7D8 0001 +Cheat1="Cheat Menu\Have All Weapons",811CE810 FFFF +Cheat2="Cheat Menu\Have All Game Type & Other",810E1A3E 0FFF +Cheat3="Cheat Menu\All Weapons Enabled",801CCC59 0001,801CCCC5 0001,801CDD25 0001,801CDE21 0001,801CDEB5 0001,801CDEB7 0001,801CDEE9 0001,801CE819 0001,801CE821 0001,801CE88D 0001,801CF9D5 0001 +Cheat4="Infinite Ammo (All Guns)",810A21B4 A65B +Cheat5="Invincibility",800DF203 0001 +Cheat6="Time Always 00:00",801A1D06 0000 +Cheat7="Enable Debug Menu",800DFCD0 0001 + +//---- + +[492B9DE8-C6CCC81C-C:50] +Name=Earthworm Jim 3D (E) +Cheat0="Infinite\Health",800C876F 0064 +Cheat1="Infinite\Lives",800C8773 0064 +Cheat2="Infinite\Ammo\Blaster",810C6916 0064 +Cheat3="Infinite\Ammo\Rocket Launcher",810C6946 0064 +Cheat4="Infinite\Ammo\Banana Peel Bomb",810C6976 0064 +Cheat5="Infinite\Ammo\Laser",810C698E 0064 +Cheat6="Infinite\Ammo\Green Slimer",810C69A6 0064 +Cheat7="Infinite\Ammo\Chickens",810C69BE 0064 +Cheat8="Infinite\Ammo\Shotgun",810C69EE 0064 +Cheat9="Infinite\Ammo\Music Gun",810C6906 0064 +Cheat10="Infinite\Ammo\Boomerang Knives",810C691E 0064 +Cheat11="Infinite\Ammo\Mushrooms",810C6936 0064 +Cheat12="Infinite\Ammo\Lepricon Gun",800C8897 0064 +Cheat13="Infinite\Ammo\Pistol",800C8777 0064 +Cheat14="Infinite\Ammo\Sniper Chicken",800C881F 0064 +Cheat15="Infinite\Ammo\Butcher Knife Gun",800C887F 0064 +Cheat16="Have\231 Marbles",D00EBE53 0000,800EBE53 03E7 +Cheat17="Have\All Gold Udders",50002802 0000,810C80BA 0101 + +//---- + +[202A8EE4-83F88B89-C:50] +Name=EXCITEBIKE64 +Cheat0="Infinite Time",810F0E36 1770 +Cheat1="Max Score Stunt Mode\Player One",810E43E8 0098,810E43EA 967F +Cheat2="Max Score Stunt Mode\Player Two",810E4BC8 0098,810E4BCA 967F +Cheat3="Unlock Original Excitebike",D00F6605 0030,810F2420 FF07 +Cheat3_N=Press L+R at track selection to Access Soccer,Hill Climb & Excite 3D +Cheat4="Start On Lap",D00E4681 0000,800E4681 00?? +Cheat4_O=$01 Lap 1,$02 Lap 2,$03 Lap 3,$04 Lap 4 +Cheat5="Always Low Temp\Player Two",810E4E48 0000,810E4E4A 0000 +Cheat6="Always Low Temp\Player One",810E4668 0000,810E466A 0000 +Cheat7="In Game Cheat Select\1",800CDA4A 00?? +Cheat7_O=$01 Transparent riders,$02 All stunts,$04 Invincible mode,$08 Developers team photo,$10 Beat this,$20 Small head mode +Cheat8="In Game Cheat Select\2",800CDA4B 00?? +Cheat8_O=$01 Big head mode,$02 Mirror mode,$04 Debug mode,$08 Down hill mode,$10 Stunt bonus,$20 Invisible riders,$40 Night mode,$80 Odd colour mode +Cheat9="In-Game cheat modifer",810CDA4A ???? +Cheat9_O=$0001 Big head mode,$0002 Mirror mode,$0004 Debug mode,$0008 Down hill mode,$0010 Stunt bonus,$0020 Invisible riders,$0040 Night mode,$0080 Odd colour mode,$0100 Transparent riders,$0200 All stunts,$0400 Invincible mode,$0800 Developers team photo,$1000 Beat this,$2000 Small head mode + +//---- + +[8E9D834E-1E8B29A9-C:50] +Name=Extreme-G (E) +Cheat0="Infinite Shields\Player 1",801651F5 00C8 +Cheat1="Infinite Primary Weapon\Player 1",801651FD 00C8 +Cheat2="Infinite Turbos\Player 1",801651CB 0003,801651CF 0003 +Cheat3="Bike Modifier\Player 1",8016983F 00?? +Cheat4="Infinite Shields\Player 2",80165965 00C8 +Cheat5="Infinite Primary Weapon\Player 2",8016596D 00C8 +Cheat6="Infinite Turbos\Player 2",8016593B 0003,8016593F 0003 +Cheat7="Bike Modifier\Player 2",8016988B 00?? +Cheat8="Infinite Shields\Player 3",801660D5 00C8 +Cheat9="Infinite Primary Weapon\Player 3",801660DD 00C8 +Cheat10="Infinite Turbos\Player 3",801660AB 0003,801660AF 0003 +Cheat11="Bike Modifier\Player 3",801698D7 00?? +Cheat12="Infinite Shields\Player 4",80166845 00C8 +Cheat13="Infinite Primary Weapon\Player 4",8016684D 00C8 +Cheat14="Infinite Turbos\Player 4",8016681B 0003,8016681F 0003 +Cheat15="Bike Modifier\Player 4",80169923 00?? +Cheat16="Extra Bikes Unlocked",80167C13 0001,80167C17 0003 +Cheat17="Extra Levels Unlocked",8016980B 0001,8016980F 0001 +Cheat18="All Tracks Unlocked",80095F6E 0008,50000264 0000,80169347 0001,50000264 0000,80169473 0001,50000564 0000,8016959F 0001 +Cheat19="Mode Select",80097687 00?? +Cheat3_O=$00 Raze,$01 Rana,$02 Khan,$03 Grimace,$04 Mooga,$05 Jolt,$06 Main,$07 Apollyon,$08 Roach,$09 Neon +Cheat7_O=$00 Raze,$01 Rana,$02 Khan,$03 Grimace,$04 Mooga,$05 Jolt,$06 Main,$07 Apollyon,$08 Roach,$09 Neon +Cheat11_O=$00 Raze,$01 Rana,$02 Khan,$03 Grimace,$04 Mooga,$05 Jolt,$06 Main,$07 Apollyon,$08 Roach,$09 Neon +Cheat15_O=$00 Raze,$01 Rana,$02 Khan,$03 Grimace,$04 Mooga,$05 Jolt,$06 Main,$07 Apollyon,$08 Roach,$09 Neon +Cheat19_O=$01 Boulder,$02 Fish Eye Lens,$03 Boulder & Fish Eye Lens,$04 Magnify,$08 Anti-Gravity,$0A Anti-Gravity & Fish Eye Lens,$10 Wireframe,$11 Boulder & Wireframe,$20 Stealth Mode,$40 Ghost Mode,$80 Ugly Mode + +//---- + +[1185EC85-4B5A7731-C:50] +Name=Extreme-G XG2 (E) +Cheat0="Infinite Nitros\Player 1",80170BA3 0004,80170BA7 0004 +Cheat1="Infinite Shield\Player 1",80170BCD 00C8 +Cheat2="Infinite Lasers\Player 1",80170BD9 00C8 +Cheat3="Infinite Nitros\Player 2",8017120B 0004,8017120F 0004 +Cheat4="Infinite Shield\Player 2",80171235 00C8 +Cheat5="Infinite Lasers\Player 2",80171241 00C8 +Cheat6="Infinite Nitros\Player 3",80171873 0004,80171877 0004 +Cheat7="Infinite Shield\Player 3",8017189D 00C8 +Cheat8="Infinite Lasers\Player 3",801718A9 00C8 +Cheat9="Infinite Nitros\Player 4",80171EDB 0004,80171EDF 0004 +Cheat10="Infinite Shield\Player 4",80171F05 00C8 +Cheat11="Infinite Lasers\Player 4",80171F11 00C8 +Cheat12="Access\All Tracks",50000BD8 0000,80182FC7 0001,50000CD8 0000,80182EF3 0001,50000CD8 0000,80182EF7 0001,50000CD8 0000,80182EFB 0001,50000CD8 0000,80182EFF 0001,50000CD8 0000,80182F03 0001,50000CD8 0000,80182F07 0001 +Cheat13="Access\All Levels & Superbikes",50000304 0000,80183A0F 0001 +Cheat14="Access\All Secret Characters",50000C04 0000,80183A27 0001 +Cheat15="[Screen Hud Clear]",80092C6B 0004 +Cheat14_N=This code is Fantastic, You have 12 characters to choose from to you race without any bike, just on foot +Cheat15_N=If you are using a Plugin other then Jabos 1.5 and can not see through the Thick Hud on the Screen. then Let the game load 1st before Putting this code on,Or it will give an error and Freeze + +//---- + +[07C1866E-5775CCDE-C:50] +Name=F-1 World Grand Prix II (E) +Cheat0="Max Driver Points",8103A8F6 03E7 +Cheat1="Max Constructor Points",8103A8F8 03E7 + +//---- + +[776646F6-06B9AC2B-C:50] +Name=F-Zero X (E) +Cheat0="Time Always 00.00.00/1st Place",812C4BC0 0000,812C4BC2 0001 +Cheat1="Infinite Shield",812C4B48 4326,812C4B4C 4326 +Cheat2="Infinite Lives",800D8729 0005 +Cheat3="Boost From Start",D02C4DA0 003F,802C4925 0050 +Cheat4="Unlock Everything",810C01E8 0100 + +//---- + +[3CECBCB8-6126BF07-C:50] +Name=F1 Racing Championship (E) +Cheat0="No Checkpoint time",81164E1C 0001 +Cheat1="Big Score",81164E58 8181,81164E5A 8181 +Cheat2="Instant 450kmh Boost",D10A1F50 2000,8119D334 005A +Cheat2_N=Press Trigger Button + +//---- + +[0E31EDF0-C37249D5-C:50] +Name=FIFA - Road to World Cup 98 (E) +Cheat0="Home Team scores 25 Goals",801AF433 0019 +Cheat1="Home Team scores 0 Goals",801AF433 0000 +Cheat2="Away Team scores 25 Goals",801AF437 0019 +Cheat3="Away Team scores 0 Goals",801AF437 0000 + +//---- + +[0198A651-FC219D84-C:50] +Name=FIFA 99 (E) +Cheat0="Team on the right of score board has 15 goals",800375C3 000F +Cheat1="Team on the left of score board has 15 goals",800375C7 000F +Cheat2="Team on the right of score board has 0 goals",800375C3 0000 +Cheat3="Team on the left of score board has 0 goals",800375C7 0000 + +//---- + +[C3F19159-65D2BC5A-C:50] +Name=FIFA Soccer 64 (E) +Cheat0="Number Of Goals Player 1",80119043 00?? +Cheat0_O=$01 1 Goal,$02 2 Goals,$03 3 Goals,$04 4 Goals,$05 5 Goals,$06 6 Goals,$07 7 Goals,$08 8 Goals,09 9 Goals,0A 10 Goals,$14 20 Goals,$1E 30 Goals,$28 40 Goals,$32 50 Goals +Cheat1="Number Of Goals Player 2",80119047 00?? +Cheat1_O=$01 1 Goal,$02 2 Goals,$03 3 Goals,$04 4 Goals,$05 5 Goals,$06 6 Goals,$07 7 Goals,$08 8 Goals,09 9 Goals,0A 10 Goals,$14 20 Goals,$1E 30 Goals,$28 40 Goals,$32 50 Goals + +//---- + +[36F1C74B-F2029939-C:50] +Name=Fighter's Destiny (E) +Cheat0="Start with Stars Modifier\Player 1",D0209757 0000,80209757 00?? +Cheat0_O=$00 No Stars,$06 Max Stars +Cheat1="Start with Stars Modifier\Player 2",D020B61F 0000,8020B61F 00?? +Cheat1_O=$00 No Stars,$06 Max Stars +Cheat2="Have 1 Star\Ryuji",8030734E 0001 +Cheat3="Have 1 Star\Bob",8030734F 0001 +Cheat4="Have 1 Star\Pierre",80307350 0001 +Cheat5="Have 1 Star\Meiling",80307351 0001 +Cheat6="Have 1 Star\Leon",80307352 0001 +Cheat7="Have 1 Star\Abdul",80307353 0001 +Cheat8="Have 1 Star\Ninja",80307354 0001 +Cheat9="Have 1 Star\Tomahawk",80307355 0001 +Cheat10="Have 1 Star\Valerie",80307356 0001 +Cheat11="Infinite Health\Player 1",802098A1 0000,802047C3 0000 +Cheat12="Infinite Health\Player 2",802047C7 0000,8020B769 0000 +Cheat13="Start on stage 100 on Survival to get Joker",802EF67B 0063 +Cheat14="Stop timer for Fastest to get Robot",810ADBDC 3F80 +Cheat15="Always Win Judge's Decision\Player 1",8020B777 FFFF,802098AF 0000 +Cheat16="Always Win Judge's Decision\Player 2",802098AF FFFF,8020B777 0000 +Cheat17="Enable Boro",80307349 0001 +Cheat18="Level Select",8022A84C 00?? +Cheat18_O=$00 Fire Mountain,$01 Desert,$02 Highlands,$03 Hong Kong,$04 Coliseum,$05 Jungle,$06 Ninja Room,$07 Suspension Bridge,$08 Palace,$09 Observation,$0A Pasture,$0B Joker's Room,$0C Blue Hell Mountain,$0D Palace +Cheat19="Play As\Player 1",802EF622 00?? +Cheat19_O=$00 Ryuji,$01 Bob,$02 Pierre,$03 Meiling,$04 Leon,$05 Abdul,$06 Ninja,$07 Tomahawk,$08 Boro,$09 Valerie,$0A Ushi,$0B Joker,$0C The Master,$0D No Clue + +//---- + +[66CF0FFE-AD697F9C-C:50] +Name=Fighting Force 64 (E) +Cheat0="Infinite Lives",810CE462 03E7 +Cheat1="Infinite health",810C8B0E 03E7 +Cheat2="Level Select",810A590E 0001 +Cheat2_N=Scroll With C-Left & C-Right Level Select Available, At The Player Select Top Screen +Cheat3="Score Aid",810CD912 29AA + +//---- + +[142A17AA-13028D96-C:50] +Name=Forsaken 64 (E) +Cheat0="Infinite\Primery Weapons",8008EE30 0012 +Cheat1="Infinite\Secondary Weapons",8008EE31 0012 +Cheat2="Infinite\Weapon Energy",8008EE32 0012 +Cheat3="Infinite\Lives",8008EE33 0012 +Cheat4="Stealth Mode",8008EE34 0012 +Cheat5="Invulnerability",8008EE35 0012 +Cheat6="Wireframe Mode",8008EE36 0012 +Cheat7="Gore Mode",8008EE37 0012 +Cheat8="Turbo Mode",8008EE38 0012 +Cheat9="Psychedelic Mode",8008EE39 0012 +Cheat10="One Shot Enemies",8008EE3A 0012 +Cheat11="Freeze Enemies",8008EE3B 0012 +Cheat12="Infinite\Titans",8008EE3C 0012 +Cheat12_N=Titans are included in code +Cheat13="Infinite\Solaris",8008EE3D 0012 +Cheat13_N=Solaris are included in code +Cheat14="Level Select",8008EE3E 0012 +Cheat14_N=Accesses all Missions & Battle mode + +//---- + +[D543BCD6-2BA5E256-C:50] +Name=Gauntlet Legends (E) +Cheat0="Get All Stuff",50001410 0000,810C5DA6 FFFF +Cheat0_N=Opens Up New Levels Etc, +Cheat1="Infinite Use Of Items",50001310 0000,800C5EC6 FFFF +Cheat1_N=On Pick-Ups Only +Cheat2="Access Skill Level 99",800FD38A FFFF +Cheat2_N=And Get A Familiar +Cheat3="Access All Window Shards",50000302 0000,810AE6C6 07FF +Cheat4="Access All Rune Stones",50000302 0000,810AE6D6 07FF +Cheat5="Always Max Turbo Attack",810FD4AE FF64 +Cheat6="New Player Name",810FD36C 4249,810FD36E 5443,810FD370 4820,810FD372 3639 +Cheat7="Start With Small Familiar",810FD512 0102 +Cheat7_N=Do not use this with Big Familiar Code +Cheat8="Start With Big Familiar",810FD512 0202 +Cheat8_N=Do not use this with Small Familiar Code + +//---- + +[68FCF726-49658CBC-C:50] +Name=G.A.S.P!!Fighters'NE +Cheat0="Player 1\Character Modifier",80105001 00?? +Cheat0_O=$00 Azami,$01 Serina,$02 Miki,$03 Kai,$04 Sakai,$05 Kengon,$06 Kyeya,$07 Kaoru,$08 Gouriki,$09 Reiji,$0A Yami,$0B Hikari,$0C Invisible Fighter +Cheat0_N=This Allows you to play as any Character you choose in any Mode +Cheat1="Player 1\Infinite Energy",81105026 03E8 +Cheat2="Player 2\Player 1 Never Wins",8009E3F4 0000 +Cheat3="Player 1\Need 1 Round to Win",D009E334 0000,8009E334 0001 +Cheat4="Player 2\Character Modifier",8011B399 00?? +Cheat4_O=$00 Azami,$01 Serina,$02 Miki,$03 Kai,$04 Sakai,$05 Kengon,$06 Kyeya,$07 Kaoru,$08 Gouriki,$09 Reiji,$0A Yami,$0B Hikari,$0C Invisible Fighter +Cheat4_N=This Allows you to play as any Character you choose in any Mode +Cheat5="Player 2\Infinite Energy",8111B3BE 03E8 +Cheat6="Player 1\Player 2 Has No Energy",D0044461 0008,8111B3BE 0000 +Cheat6_N=Press C-Button Up and Player 2 will lose All Health resulting in a Instant K.O. +Cheat7="Player 2\Player 1 Has No Energy",D0044467 0008,81105026 0000 +Cheat7_N=Press C-Button Up and Player 1 will lose All Health resulting in a Instant K.O. +Cheat8="Player 2\Need 1 Round to Win",D009E335 0000,8009E335 0001 +Cheat9="Player 1\Player 2 Never Wins",8009E3F5 0000 +Cheat10="Have All Extras Open",8009E31F 00FF +Cheat10_N=This Code opens all extra stages in VS Battles,Team Battle 1P, Team Battles VS,Tag Battle and Practice Modes. Extra Male and Female Body in Create A Fighter Character and Have Extra Characters (Gouriki & Reiji) +Cheat11="Music Modifier",8009E21E 00?? +Cheat11_O=$00 Stereo,$01 Monaural,$02 Music Off + +//---- + +[99179359-2FE7EBC3-C:50] +Name=Gex 3 - Deep Cover Gecko (E) +Cheat0="Infinite\Health",810A60C8 0005 +Cheat1="Infinite\Lives",810A60C6 0064 +Cheat2="Crazy Tail",8110955E 0001 +Cheat3="Access All\Special Remote Controls",810A60E4 FFFF,810A60E6 FFFF +Cheat4="Access All\ordinary Remote Controls",50000F01 0000,800A60A8 000F +Cheat5="Access All\Bonus Coins",50000F02 0000,810A6124 0007 +Cheat6="Access All\Paw Coins",50000F02 0000,810A60E8 03FF + +//---- + +[E68A000E-639166DD-C:50] +Name=Gex 64 - Enter the Gecko (E) +Cheat0="Infinite Health",800C50CB 0063 +Cheat1="Infinite Lives",810C50C6 0063 +Cheat3="INFINITE AIR CODES\Umpire Strikes Out",D00BED05 0004,8136608E 012B +Cheat4="INFINITE AIR CODES\Pain In The Asteroids",D00BED05 0004,8133CBEE 012B +Cheat5="ACCESS ALL REMOTE CONTROLS\Red Remotes",50000E01 0000,800C513E 0007 +Cheat5_N=Opens Gate 4 And The Lions Mouth +Cheat6="All Silver & Gold Gold Remotes",810C5164 0FFF,810C5166 FFFF,810C5168 01E0,810C516A 007F +Cheat6_N=Opens Gate 3,2,1 +Cheat7="Hover & Fly Mode",D10BED04 0020,8114ECA2 0010,D10BED04 0010 +Cheat7_N=Press And Hold L Button + A Button +Cheat8="Fully Charged Gex",D00AAAB9 0020,81163CDE 32FF +Cheat8_N=Press L Button Once When On One Of The Specific Levels, For Circuit Central Levels Only + +//---- + +[F5237301-99E3EE93-C:50] +Name=Glover +Cheat0="Infinite\Energy",8029129F 0003 +Cheat1="Infinite\99 Lives",8029129B 0063 +Cheat2="Have Spell\Enlarge Spell",812912B4 03E8 +Cheat3="1000 Garibs",80291297 0064 +Cheat4="Have Spell\Speed Up Spell",812912B8 03E8 +Cheat5="Have Spell\Death Spell",812912A8 03E8 +Cheat6="Have Spell\Sticky Fingers Spell",812912B2 03E8 +Cheat7="All levels unlocked ",80298CFD 00A0 +Cheat7_N=At the main menu, where it says: Start, practice, options, & time trial, hold D-pad up, then the glove, playing-with-the-ball icon, will jump down into the lower left corner of the screen, then press the A button, and a level select screen will be available with all ordinary and boss levels, etc. available +Cheat8="Cheat Modifier\1",80298CFE 00?? +Cheat8_O=$01 Low gravity,$02 Big ball,$03 Both of the above +Cheat9="Cheat Modifier\2",80298CFF 00?? +Cheat9_O=$01 Locate caribs,$02 Call ball,$08 Unlimited lives,$10 Power ball,$20 Control ball,$40 Infinite energy,$7B All of the above +Cheat10="[100% Complete]\Save Slot 1",801EBA37 0007,50000801 0000,801EBA28 00FF +Cheat11="[100% Complete]\Save Slot 2",801EBA53 0007,50000801 0000,801EBA44 00FF +Cheat12="[100% Complete]\Save Slot 3",801EBA6F 0007,50000801 0000,801EBA60 00FF +Cheat13="[100% Complete]\Save Slot 4",801EBA8B 0007,50000801 0000,801EBA7C 00FF +Cheat14="[100% Complete]\Save Slot 5",801EBAA7 0007,50000801 0000,801EBA98 00FF +Cheat15="[100% Complete]\Save Slot 6",801EBAC3 0007,50000801 0000,801EBAB4 00FF +Cheat16="Super Jump",D02AFA14 0080,801EE771 0013 +Cheat10_N=All green crystals collected and Bonuslevels solved. +Cheat11_N=All green crystals collected and Bonuslevels solved. +Cheat12_N=All green crystals collected and Bonuslevels solved. +Cheat13_N=All green crystals collected and Bonuslevels solved. +Cheat14_N=All green crystals collected and Bonuslevels solved. +Cheat15_N=All green crystals collected and Bonuslevels solved. + +//---- + +[EE4A0E33-8FD588C9-C:50] +Name=GT 64 Championship Edition (E) +Cheat0="Always first position",80162A80 0001 +Cheat1="Only race one lap",80161DF5 0001 +Cheat2="Always have 99 points",80161EC1 0063 + +//---- + +[AE90DBEB-79B89123-C:50] +Name=Hercules - The Legendary Journeys (E) +Cheat0="Infinite Health & Max Health",810CFF5E 03E7,810CFF62 03E7 +Cheat1="Infinite Dinars",800B6663 00E8,800B6662 00E8 +Cheat2="Infinite Magic",810B6BEA 0063,810B6BD2 0063,810B6C02 0063,810B6C1A 0063 +Cheat3="Press L to Levitate",D017D8F5 0020,810CFFB4 44CB +Cheat3_N=Press L Button to Levitate & Let go to come back down + +//---- + +[95B2B30B-2B6415C1-C:50] +Name=Hexen (E) +Cheat0="Access In-Game Cheat Menu",81137C56 07FF,80137D33 0005 +Cheat0_N=To Access Pause Game Play. This gives you access to In-game Cheats like God Mode,Level Select,All Items Etc + +//---- + +[277B129D-DD3879FF-C:50] +Name=Holy Magic Century (E) +Cheat0="Set Agility to 999-999",8107C234 03E7 +Cheat1="Set Defence to 999-999",8107C236 03E7 +Cheat2="Makes your MP 999-999",8107C230 03E7,8107C232 03E7 +Cheat3="Makes your HP 999-999",8107C22C 03E7,8107C22E 03E7 +Cheat4="Have All Elements",8107C24C 3232,8107C24E 3232 +Cheat5="Earn Spirits Faster",8007C25D 0000 +Cheat6="No Random Battles",8108CD1C 0000,8108CD1E 0000 + +//---- + +[E7D20193-C1158E93-C:50] +Name=Hot Wheels Turbo Racing (E) +Cheat0="Allways 1st",8111B14A 0000 +Cheat1="Max Tournament Points",811270B6 02F4 +Cheat2="Infinite Turbos",8111B39C 0800 +Cheat3="Access All Cars",811270A4 FFFF,811270A6 FFFF +Cheat4="A Few Extra Cars",811270AA FFFF +Cheat5="Bonus Tracks",811270AE FFFF +Cheat6="Race At Night",801270CF 0080 +Cheat7="Mirror Mode",801270CE 0001 + +//---- + +[641D3A7F-86820466-C:50] +Name=HYBRID HEAVEN PAL +Cheat0="Have All\Keys",50000410 0000,80181B30 0063,50000410 0000,80181B38 0063 +Cheat1="Infinite\Weapons & Items",50000610 0000,80181AD0 0063,50000610 0000,80181AD8 0063 +Cheat2="Infinite\Refresh Items",50000E10 0000,801819F8 0063,80181A08 0063,50000D10 0000,80181A00 0063,80181A10 0063 +Cheat3="Infinite\Max Body Stats",81181638 270F,81181678 0063,50000C02 0000,81181640 270F,50000502 0000,81181670 270F,50000602 0000,81181698 270F,50000602 0000,811816A6 270F +Cheat4="Infinite\Max Health",81181630 270F,81181632 270F +Cheat5="Level 999",81181678 270F +Cheat6="Have All\Moves",50005306 0000,8118C950 0100,50005306 0000,8118C952 00FF +Cheat7="Difficulty Select Options",811C5C1C ???? +Cheat7_O=$0100 Normal,$0101 Hard,$0102 Ultimate +Cheat8="Play As",811C5CF6 00?? +Cheat8_O=$01 The real Mr Diaz Baddie,$02 President Weller,$03 Alien +Cheat9="Press L To Levitate",D00CCE25 0020,812558F0 3FCB +Cheat10="Editor's Cheat Level and Battle Select",801D74A4 0005 + +//---- + +[B58988E9-B1FC4BE8-C:50] +Name=Hydro Thunder (E) +Cheat0="Always 1st",812C4DC6 0001 +Cheat1="Infinite\Time",812B49C0 42C8 +Cheat2="Infinite\Boosts\Player 1",812C4DCC 4190 +Cheat3="Have All\Ships",812B5DD2 0101,812B5DD4 0101,812B5DD6 0101,812B5DD8 0101,812B5DDA 0101,812B5DDC 0101,812B5DDE 0101 +Cheat4="Have All\Races",812B5DC4 0101,812B5DC6 0101,812B5DC8 0101,812B5DCA 0101,812B5DCC 0101,812B5DCE 0101,812B5DD0 0101 +Cheat5="Infinite\Boosts\Player 2",812C50FC 4190 + +//---- + +[D692CC5E-EC58D072-C:50] +Name=Iggy's Reckin' Balls +Cheat0="Access\Lizzy",810C642C 0001 +Cheat1="Access\All Characters,Worlds & Level Select",810CD092 0007 +Cheat2="Infinite\Turbos",810CD090 0008 +Cheat3="Infinite\Time",810D9088 44E9 +Cheat4="Infinite\Credits",810BDF5C 02F4 +Cheat5="Laps To Race",800C8909 00?? +Cheat5_O=$01 1 Lap,$02 2 Laps,$03 3 Laps,$04 4 Laps,$05 5 Laps,$06 Laps,$07 7 Laps,$08 8 Laps,$09 9 Laps +Cheat6="Difficulty Level Easy",810BDF68 0001 +Cheat7="Have Max\Points",810D8FE0 02F4 +Cheat8="Have Max\RB Medals",810D8FF0 02F4 +Cheat9="Freeze Timer",810CD67C 4000 +Cheat10="Max Points",800D8FE1 0063 +Cheat11="Max RB Medals",800D8FF1 0063 +Cheat1_N=Pause Gameplay For Level Select +Cheat0_N=Top Secret Character + +//---- + +[E2D37CF0-F57E4EAE-C:50] +Name=International Superstar Soccer 64 (E) +Cheat0="Home Team Scores",80119F2B 00?? +Cheat0_O=$00 ,$01 1 Goal,$02 2 Goals,$03 3 Goals,$04 4 Goals,$05 5 Goals,$06 6 Goals,$07 7 Goals,$08 8 Goals,09 9 Goals,0A 10 Goals,$14 20 Goals,$1E 30 Goals,$28 40 Goals,$32 50 Goals +Cheat1="Away Team Scores",8011A9BF 00?? +Cheat1_O=$00 ,$01 1 Goal,$02 2 Goals,$03 3 Goals,$04 4 Goals,$05 5 Goals,$06 6 Goals,$07 7 Goals,$08 8 Goals,09 9 Goals,0A 10 Goals,$14 20 Goals,$1E 30 Goals,$28 40 Goals,$32 50 Goals +Cheat2="Infinite player creation points",801AC581 003C + +//---- + +[F41B6343-C10661E6-C:50] +Name=International Superstar Soccer '98 (E) +Cheat0="Home Team Scores",801A86FD 00?? +Cheat0_O=$00 ,$01 1 Goal,$02 2 Goals,$03 3 Goals,$04 4 Goals,$05 5 Goals,$06 6 Goals,$07 7 Goals,$08 8 Goals,09 9 Goals,0A 10 Goals,$14 20 Goals,$1E 30 Goals,$28 40 Goals,$32 50 Goals +Cheat1="Away Team Scores",801A9579 00?? +Cheat1_O=$00 ,$01 1 Goal,$02 2 Goals,$03 3 Goals,$04 4 Goals,$05 5 Goals,$06 6 Goals,$07 7 Goals,$08 8 Goals,09 9 Goals,0A 10 Goals,$14 20 Goals,$1E 30 Goals,$28 40 Goals,$32 50 Goals +Cheat2="Infinite player creation points",D03E0CF2 0001,803E0CF2 0063 + +//---- + +[68D7A1DE-0079834A-C:50] +Name=JET FORCE GEMINI +Cheat0="Access\All Characters",80208910 FFFF +Cheat1="Infinite Continues",800A34F1 0063 +Cheat2="Juno\Full & Max Health",80208AB5 000C,80208AB2 0040 +Cheat3="Juno\Access\All Keys",81208B18 FFF7 +Cheat4="Juno\Access\All Objects",81208B1A FFFF +Cheat5="Juno\Infinite\Mizar Tokens",81208AC4 02F4 +Cheat6="Juno\Max Blue & White Heads",81208ABA 03E7,81208AB8 03E7 +Cheat7="Juno\Infinite\Max Ammo All Guns",50000302 0000,81208AC6 02F4,50000802 0000,81208ACC 02F4,50000402 0000,81208ADC 02F4 +Cheat8="Vela\Full & Max Health",80208A3F 000C,80208A3C 0040 +Cheat9="Vela\Access\All Keys",81208AA2 FF70 +Cheat10="Vela\Access\All Objects",81208AA4 FFFF +Cheat11="Vela\Infinite\Mizar Tokens",81208A4E 02F4 +Cheat12="Vela\Max\Blue & White Heads",81208A44 03E7,81208A42 03E7 +Cheat13="Vela\Infinite\Max Ammo All Guns",50000302 0000,81208A50 02F4,50000802 0000,81208A56 02F4,50000402 0000,81208A66 02F4 +Cheat14="Lupus\Full & Max Health",80208B2B 000C,80208B28 0040 +Cheat15="Lupus\Access\All Keys",81208B8E FF70 +Cheat16="Lupus\Access\All Objects",81208B90 FFFF +Cheat17="Lupus\Infinite\Mizar Tokens",81208B3A 02F4 +Cheat18="Lupus\Max\Blue & White Heads",81208B30 03E7,81208B2E 03E7 +Cheat19="Lupus\Infinite\Max Ammo All Guns",50000302 0000,81208B3C 02F4,50000802 0000,81208B42 02F4,50000402 0000,81208B52 02F4 +Cheat20="Access\All Floyd Awards",50000501 0000,80208908 0005 +Cheat20_N=only enable One character at a time when using this code +Cheat21="Juno\Access\All Weapons",80208ABC 00FF,80208ABD 00FF +Cheat22="Vela\Access\All Weapons",80208A46 00FF,80208A47 00FF +Cheat23="Lupus\Access\All Weapons",80208B32 00FF,80208B33 00FF +Cheat24="Tribals\Have All Tribals\Gold Wood",802088E4 000F +Cheat25="Tribals\No Tribals Killed\Gold Wood",802088E5 0000 +Cheat26="Tribals\Have No Tribals Remaining\Gold Wood",802088E6 0000 +Cheat21_N=Do not put this code on until you collect one Extra Weapon then you will have all ready to use +Cheat22_N=Do not put this code on until you collect one Extra Weapon then you will have all ready to use +Cheat23_N=Do not put this code on until you collect one Extra Weapon then you will have all ready to use +Cheat27="[Resolution Fix]",800FE6F2 0003,800FE6DE 0003,800FEDEA 00D0 +Cheat28="Vela\All Single Player Levels Unlocked",80208AA0 00FF,80208AA1 00FF +Cheat29="Juno\All Single Player Levels Unlocked",80208B16 00FF,80208B17 00FF +Cheat30="Lupus\All Single Player Levels Unlocked",80208B8C 00FF,80208B8D 00FF +Cheat31="All Single Player Levels Unlocked",80208AA0 00FF,80208AA1 00FF,80208B16 00FF,80208B17 00FF,80208B8C 00FF,80208B8D 00FF +Cheat31_N= All Charcters + +//---- + +[0F743195-D8A6DB95-C:50] +Name=John Romero's Daikatana (E) +Cheat0="Infinite\Health",81207B24 03E7 +Cheat1="Max\Experience",81207B26 03E7 +Cheat2="Infinite\Armour",81207B44 0001,81207B46 03E7 +Cheat3="Max\Attributes",50000502 0000,81207B28 0007 +Cheat4="Level Select",811C6B4E 0001 +Cheat5="Access\All Items",D0209D85 0020,81207B8C 007F +Cheat5_N=Press L Button Where Items Are available +Cheat6="Access\All Guns & Infinite Ammo",81207AB4 007F,81207AB6 FFFF,81207B84 03E7,50000A02 0000,81207B70 03E7 + +//---- + +[979B263E-F8470004-C:50] +Name=Killer Instinct Gold (E) +Cheat0="Infinite Health",801D3584 0078 +Cheat1="Invincible",801D35D4 000A +Cheat2="Access In-Game Cheats",801283DC 0006 +Cheat3="Access Gargos Character",80127DC8 0001 +Cheat4="Fast Kick & Punch",801D357E 0010 +Cheat5="Max Blood",80127D5D 0003 +Cheat6="No Time Limit",80127D5B 0001 + +//---- + +[0D93BA11-683868A6-C:50] +Name=Kirby64 +Cheat0="Infinite Max Health",800D718F 0006,800D7151 00C0 +Cheat1="Kirkby can fly unlimited",8012EADF 00F0 +Cheat2="Access all enemy info",50005101 0000,800D6F10 0002 +Cheat3="Access all crystals",50000701 0000,800D6EC0 0001,50001701 0000,800D6EC8 0007 +Cheat4="Access all difficulty levels",50000301 0000,800D6E69 0003 +Cheat4_N=100 yard hop, bumper crop bump & checkerboard chase +Cheat5="All Levels completed",50002B01 0000,800D6EE0 0002 +Cheat5_N=You must still beat boss's to continue onto next level +Cheat6="All Save Slots 100% Completed\Save slot 1",800ECD18 0064 +Cheat7="All Save Slots 100% Completed\Save slot 2",800ECD70 0064 +Cheat8="All Save Slots 100% Completed\Save slot 3",800ECDC8 0064 +Cheat9="Infinite Max Lives",800D714F 0064 + +//---- + +[4A997C74-E2087F99-C:50] +Name=Knife Edge - Nose Gunner (E) +Cheat0="Infinite Armour\Player One",8011D65F 0064 +Cheat1="Infinite Bombs\Player One",8011D667 0003 +Cheat2="Level 11 Vulcan Cannon\Player One",80123BAB 000A +Cheat3="Infinite Armour\Player Two",8011D663 0064 +Cheat4="Infinite Bombs\Player Two",8011D66B 0003 +Cheat5="Level 11 Vulcan Cannon\Player Two",80123BCB 000A +Cheat6="Level Select",81123E16 000C +Cheat7="Extreme Mode",8111D332 0003 +Cheat8="Max Score",81123B82 FC9A + +//---- + +[E3D6A795-2A1C5D3C-C:50] +Name=Knockout Kings 2000 (E) +Cheat0="Infinite Health\Player 1",8106B974 42C8,8106B9DE 0000 +Cheat1="Infinite Health\Player 2",8106BAE4 42C8,8106BAE6 0000 +Cheat2="No Health\Player 1",8106B9DC 0000,8106B9DE 0000 +Cheat3="No Health\Player 2",8106BAE4 0000,8106BAE6 0000 +Cheat4="Full Punch Meter\Player 1",8106B9E8 0000,8106B9EA 0BB2 +Cheat5="Full Punch Meter\Player 2",8106B9E8 0000,8106B9EA 0BB2 +Cheat6="Empty Punch Meter\Player 1",8106B9E8 0000,8106B9EA 0000 +Cheat7="Empty Punch Meter\Player 2",8016BAF0 0000,8016BAF2 0000 +Cheat8="Infinite Boxer Creation Points",810637AA 0064 +Cheat9="Have Full\Power Bar",810637AE 0064 +Cheat10="Have Full\Speed Bar",810637B2 0064 +Cheat11="Have Full\Stamina Bar",810637B6 0064 +Cheat12="Big Options\Big Head Mode",800F407C 0001 +Cheat13="Big Options\Big Gloves Mode",800F407D 0001 + +//---- + +[E97955C6-BC338D38-C:50] +Name=Legend of Zelda, The - Majora's Mask (E) (M4) (v1.0) +Cheat0="Infinite\Rupees",811E6B8A 03E7 +Cheat1="Infinite\Health",811E6B86 03E7 +Cheat2="Infinite\Max & Double Magic Meter",801E6B89 0060,811E6B90 0101 +Cheat3="Infinite\Items",801E6BF1 0063,801E6BF6 0063,801E6BF7 0063,801E6BF8 0063,801E6BF9 0063,801E6BFA 0063,801E6BFC 0063,801E6BFB 0063,801E6BFD 0063 +Cheat3_N=This is Infinite use of Bombs,Bombchus,Deku Sticks,Deku Nuts,Magic Beans,& Powder Kegs. But you must also put it's Have on to work. +Cheat4="Have\All Masks",811E6BD8 3E39,811E6BDA 4745,811E6BDC 4032,811E6BDE 3A46,811E6BE0 3842,811E6BE2 4833,811E6BE4 3C3D,811E6BE6 373F,811E6BE8 3634,811E6BEA 4341,811E6BEC 3B44,811E6BEE 4935 +Cheat5="Use all C Buttons",811EAA68 0000,811EAA6A 0000 +Cheat6="Event Item\Modifier 1",801E6BC5 00?? +Cheat7="Event Item\Modifier 2",801E6BCB 00?? +Cheat8="Event Item\Modifier 3",801E6BD1 00?? +Cheat9="Have Item Modifier",801E6BD0 00?? +Cheat10="Bottles\Bottle 1 Modifier",801E6BD2 00?? +Cheat11="Bottles\Bottle 2 Modifier",801E6BD3 00?? +Cheat12="Bottles\Bottle 3 Modifier",801E6BD4 00?? +Cheat13="Bottles\Bottle 4 Modifier",801E6BD5 00?? +Cheat14="Bottles\Bottle 5 Modifier",801E6BD6 00?? +Cheat15="Bottles\Bottle 6 Modifier",801E6BD7 00?? +Cheat16="Have\Great Fairy's Sword",801E6BD0 0010 +Cheat17="Have\QuestStatus Items",801E6C0D 0005,811E6C0E F7CF +Cheat18="Have\Have Ocarina of Time",801E6BC0 0000 +Cheat19="Have\Hero's Bow",801E6BC1 0001 +Cheat20="Have\Fire Arrow",801E6BC2 0002 +Cheat21="Have\Ice Arrow",801E6BC3 0003 +Cheat22="Have\Light Arrow",801E6BC4 0004 +Cheat23="Have\Bombs",801E6BC6 0006 +Cheat24="Have\Bombchu",801E6BC7 0007 +Cheat25="Have\Deku Sticks",801E6BC8 0008 +Cheat26="Have\Deku Nuts",801E6BC9 0009 +Cheat27="Have\Magic Beans",801E6BCA 000A +Cheat28="Have\Powder Kegs",801E6BCC 000C +Cheat29="Have\Pictograph",801E6BCD 000D +Cheat30="Have\Lens of Truth",801E6BCE 000E +Cheat31="Have\Hookshot",801E6BCF 000F +Cheat32="All Equipment Upgrades",801E6BBD 0023,811E6C0A 201B,801E6B9C 004F +Cheat33="Replace Sword With",801E6B9C 00?? +Cheat33_O=$4A Fire Arrow w/ Bow,$4B Ice Arrow w/ Bow,$4C Light Arrow w/ Bow,$4D Kokiri Sword,$4E Razor Sword,$4F Guilded Sword,$50 Deity Link's Sword +Cheat34="Play As",801E6B70 00?? +Cheat35="Infinite\Hearts Options",811E6B84 ???? +Cheat35_O=$0140 Max Hearts,$0063 6 Hearts,$0043 4 Hearts +Cheat35_N=If you need to clear the Infinite Max Hearts from the screen just choose the 6 or 4 Heart Options, take off the cheat & then make a save. +Cheat36="Press L To Levitate",D03DDFDB 0020,813F72B8 40CB +Cheat38="Warp Modifier",803DDFDA 0000,803F6835 0001,813F683A ???? +Cheat38_O=$0010 Mayors Residence,$0008 Magic Hags Potion Shop,$000A Romani Ranch Barn,$000B Mama's House,$000E Honey & Darlings Shop,$0015 Final Boss Arena,$001F Beneath the Graveyard (left entrance),$002F Beneath the Graveyard (right entrance),$0030 Southern Swamp (Reg Entrance),$004F Southern Swamp (from tour house),$006E Southern Swamp (from Woodfall),$006F Southern Swamp (from Deku Palace),$0078 Path to Ikana Canyon,$009E Southern Swamp (from Deku Place 2),$009F Southern Swamp (From Potion Shop),$00AF Boat Cruise (picture taking),$00CD Southern Swamp (From Woods of Mystery),$00CE Southern Swamp (From Spider House),$00CF Southern Swamp (From Ikana Canyon),$00FE Southern Swamp (From Owl Warp),$0E00 Curiosity Shop,$0E38 Ikana Canyon Entrance,$1500 Lens of Truth Cave (get it),$2600 Stone Tower Temple (Upside down),$2609 Stone Tower Temple (Boss Room Entrance),$2604 Treasure Chest Shop,$2605 Treausre Chest Shop (counter),$260E Clock Tower (w/ skull kid, silent),$2610 Stone Tower Temple (endless fall),$6214 Romani Ranch,$9214 Zora Shop,$B214 Snowhead (Path to temple, warp in),$D214 East Clock Down +Cheat38_N=Put this code on and it will now take where you wanted to go, turn it back off or it will infinite loop entering all the time. +Cheat6_O=$28 Moon's Tear,$29 Land Title Deed,$2A Swap Title Deed,$2B Mountain Title Deed,$2C Ocean Title Deed,$2D Room Key,$2E Special Delivery To Mama,$2F Letter To Kafei,$30 Pendant Of Memories +Cheat7_O=$28 Moon's Tear,$29 Land Title Deed,$2A Swap Title Deed,$2B Mountain Title Deed,$2C Ocean Title Deed,$2D Room Key,$2E Special Delivery To Mama,$2F Letter To Kafei,$30 Pendant Of Memories +Cheat8_O=$28 Moon's Tear,$29 Land Title Deed,$2A Swap Title Deed,$2B Mountain Title Deed,$2C Ocean Title Deed,$2D Room Key,$2E Special Delivery To Mama,$2F Letter To Kafei,$30 Pendant Of Memories +Cheat9_O=$05 Japanese Flute?,$0B Japanese Item?,$10 Great Fairy's Sword,$11 Japanese Hookshot?,$31 Japanese Scroll?,$4A Japanese Bow? +Cheat10_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat11_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat12_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat13_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat14_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat15_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat33_N=Only put the Deity Link's Sword on, if using The Play As Fierce Deity Link Code, if not it will turn Fierce Deity Link into a crazed slashing Machine. You have been warned. +Cheat34_O=$00 Fierce Deity Link,$01 Goron Link,$02 Zora Link,$03 Deku Link,$04 Normal Link +Cheat36_N=Press L To Levitate & Let go to land +Cheat37="Beta World 1",D03DDFDB 0000,801E6B52 00?? +Cheat37_O=$00 Mama's House,$01 Fearful Spider House,$02 Beneaf the Graveyard,$03 Southern Swamp Mr Tingle Entry,$06 Outside Tourist Information Southern Swamp,$08 Outside Magic Hag's Potion Shop,$0A Southern Swamp Woods Of Mystery Entry,$24 Counter Of The Tresure Chest Shop,$2E Woodfall Temple non Beta,$32 Spider Hand,$35 Statue outside Gorman Track,$36 Statue outside Lair Of The Temples Boss,$38 Path to Romani Ranch non Beta,$4A outside The Royal Palace of the Deku Kingdom,$4C Ledge in The Royal Palace of the Deku Kingdom,$4E inside The Royal Palace of the Deku Kingdom 1,$71 Green Blobs,$74 Cave Portal to Last Boss Field,$7F Waterfall Sothern Swamp,$8A Giant Turtle In the Temple non beta,$8B Room of Miau & Tijo Zora Great Hall,$94 Recieving Gorans Mask non Beta,$95 ?,$96 Hungry Goran in the Snow,$A2 Statue in Stone Tower,$A6 Stone Tower non Beta,$B9 Recieving Deku Mask non Beta,$D9 Giant Lizards in a Cave,$DA Cave with Steaming Water,$FF Vamps House In Ikana Canyon +Cheat37_N=Put on the code on load up,After the Nintendo logo you will be in that place of Choice.you can also choose another place & then press F1 (reset) to go to that place this is for beta interest only it will not assist you in playing the game. + +//---- + +[0A5D8F83-98C5371A-C:50] +Name=Legend of Zelda, The - Majora's Mask (E) (M4) (v1.1) +Cheat0="Infinite\Rupees",811E6F2A 03E7 +Cheat1="Infinite\Health",811E6F26 03E7 +Cheat2="Infinite\Max & Double Magic Meter",801E6F29 0060,811E6F30 0101 +Cheat3="Infinite\Items",801E6F91 0063,50000801 0000,801E6F96 0063 +Cheat3_N=This is Infinite use of Bombs,Bombchus,Deku Sticks,Deku Nuts,Magic Beans,& Powder Kegs. But you must also put it's Have on to work. +Cheat4="Have\All Masks",811E6F78 3E39,811E6F7A 4745,811E6F7C 4032,811E6F7E 3A46,811E6F80 3842,811E6F82 4833,811E6F84 3C3D,811E6F86 373F,811E6F88 3634,811E6F8A 4341,811E6F8C 3B44,811E6F8E 4935 +Cheat5="Use all C Buttons",811EAE08 0000,811EAE0A 0000 +Cheat6="Event Item\Modifier 1",801E6F65 00?? +Cheat7="Event Item\Modifier 2",801E6F6B 00?? +Cheat8="Event Item\Modifier 3",801E6F71 00?? +Cheat9="Have Item Modifier",801E6F70 00?? +Cheat10="Bottles\Bottle 1 Modifier",801E6F72 00?? +Cheat11="Bottles\Bottle 2 Modifier",801E6F73 00?? +Cheat12="Bottles\Bottle 3 Modifier",801E6F74 00?? +Cheat13="Bottles\Bottle 4 Modifier",801E6F75 00?? +Cheat14="Bottles\Bottle 5 Modifier",801E6F76 00?? +Cheat15="Bottles\Bottle 6 Modifier",801E6F77 00?? +Cheat16="Have\Great Fairy's Sword",801E6F70 0010 +Cheat17="Have\QuestStatus Items",801E6FAD 0005,811E6FAE F7CF +Cheat18="Have\Have Ocarina of Time",801E6F60 0000 +Cheat19="Have\Hero's Bow",801E6F61 0001 +Cheat20="Have\Fire Arrow",801E6F62 0002 +Cheat21="Have\Ice Arrow",801E6F63 0003 +Cheat22="Have\Light Arrow",801E6F64 0004 +Cheat23="Have\Bombs",801E6F66 0006 +Cheat24="Have\Bombchu",801E6F67 0007 +Cheat25="Have\Deku Sticks",801E6F68 0008 +Cheat26="Have\Deku Nuts",801E6F69 0009 +Cheat27="Have\Magic Beans",801E6F6A 000A +Cheat28="Have\Powder Kegs",801E6F6C 000C +Cheat29="Have\Pictograph",801E6F6D 000D +Cheat30="Have\Lens of Truth",801E6F6E 000E +Cheat31="Have\Hookshot",801E6F6F 000F +Cheat32="All Equipment Upgrades",801E6F5D 0023,811E6FAA 201B,801E6F3C 004F +Cheat33="Replace Sword With",801E6F3C 00?? +Cheat33_O=$4A Fire Arrow w/ Bow,$4B Ice Arrow w/ Bow,$4C Light Arrow w/ Bow,$4D Kokiri Sword,$4E Razor Sword,$4F Guilded Sword,$50 Deity Link's Sword +Cheat34="Play As",801E6F10 00?? +Cheat35="Infinite\Hearts Options",811E6F24 ???? +Cheat35_O=$0140 Max Hearts,$0063 6 Hearts,$0043 4 Hearts +Cheat35_N=If you need to clear the Infinite Max Hearts from the screen just choose the 6 or 4 Heart Options, take off the cheat & then make a save. +Cheat36="Press L To Levitate",D03DE37B 0020,813F7658 40CB +Cheat38="Warp Modifier",803DE37A 0000,803F6BD5 0001,813F6BDA ???? +Cheat38_O=$0010 Mayors Residence,$0008 Magic Hags Potion Shop,$000A Romani Ranch Barn,$000B Mama's House,$000E Honey & Darlings Shop,$0015 Final Boss Arena,$001F Beneath the Graveyard (left entrance),$002F Beneath the Graveyard (right entrance),$0030 Southern Swamp (Reg Entrance),$004F Southern Swamp (from tour house),$006E Southern Swamp (from Woodfall),$006F Southern Swamp (from Deku Palace),$0078 Path to Ikana Canyon,$009E Southern Swamp (from Deku Place 2),$009F Southern Swamp (From Potion Shop),$00AF Boat Cruise (picture taking),$00CD Southern Swamp (From Woods of Mystery),$00CE Southern Swamp (From Spider House),$00CF Southern Swamp (From Ikana Canyon),$00FE Southern Swamp (From Owl Warp),$0E00 Curiosity Shop,$0E38 Ikana Canyon Entrance,$1500 Lens of Truth Cave (get it),$2600 Stone Tower Temple (Upside down),$2609 Stone Tower Temple (Boss Room Entrance),$2604 Treasure Chest Shop,$2605 Treausre Chest Shop (counter),$260E Clock Tower (w/ skull kid, silent),$2610 Stone Tower Temple (endless fall),$6214 Romani Ranch,$9214 Zora Shop,$B214 Snowhead (Path to temple, warp in),$D214 East Clock Down +Cheat38_N=Put this code on and it will now take where you wanted to go, turn it back off or it will infinite loop entering all the time. +Cheat6_O=$28 Moon's Tear,$29 Land Title Deed,$2A Swap Title Deed,$2B Mountain Title Deed,$2C Ocean Title Deed,$2D Room Key,$2E Special Delivery To Mama,$2F Letter To Kafei,$30 Pendant Of Memories +Cheat7_O=$28 Moon's Tear,$29 Land Title Deed,$2A Swap Title Deed,$2B Mountain Title Deed,$2C Ocean Title Deed,$2D Room Key,$2E Special Delivery To Mama,$2F Letter To Kafei,$30 Pendant Of Memories +Cheat8_O=$28 Moon's Tear,$29 Land Title Deed,$2A Swap Title Deed,$2B Mountain Title Deed,$2C Ocean Title Deed,$2D Room Key,$2E Special Delivery To Mama,$2F Letter To Kafei,$30 Pendant Of Memories +Cheat9_O=$05 Japanese Flute?,$0B Japanese Item?,$10 Great Fairy's Sword,$11 Japanese Hookshot?,$31 Japanese Scroll?,$4A Japanese Bow? +Cheat10_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat11_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat12_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat13_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat14_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat15_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat33_N=Only put the Deity Link's Sword on, if using The Play As Fierce Deity Link Code, if not it will turn Fierce Deity Link into a crazed slashing Machine. You have been warned. +Cheat34_O=$00 - Fierce Deity Link,$01 Goron Link,$02 Zora Link,$03 Deku Link,$04 Normal Link +Cheat36_N=Press L To Levitate & Let go to land +Cheat37="Beta World 1",D03DE37B 0000,801E6EF2 00?? +Cheat37_O=$00 Mama's House,$01 Fearful Spider House,$02 Beneaf the Graveyard,$06 Outside Tourist Information Southern Swamp,$08 Outside Magic Hag's Potion Shop,$0A Southern Swamp Woods Of Mystery Entry,$24 Counter Of The Tresure Chest Shop,$32 Spider Hand,$35 Statue outside Gorman Track,$36 Statue outside Lair Of The Temples Boss,$4A Outside The Royal Palace of the Deku Kingdom,$4C Ledge in The Royal Palace of the Deku Kingdom,$4E Inside The Royal Palace of the Deku Kingdom 1,$71 Green Blobs,$7F Waterfall Sothern Swamp,$8B Room of Miau & Tijo Zora Great Hall,$A2 Statue in Stone Tower,$D9 Giant Lizards in a Cave,$DA Cave with Steaming Water +Cheat37_N=Put on the code on load up,After the Nintendo logo you will be in that place of Choice.you can also choose another place & then press F1 (reset) to go to that place this is for beta interest only it will not assist you in playing the game. + +//---- + +[6AECEC4F-F0924814-C:50] +Name=The Legend of Zelda - Majora's Mask - Collector's Edition (E) (GC Version) +Cheat0="Infinite\Rupees",811E54BA 03E7 +Cheat1="Infinite\Health",811E54B6 03E7 +Cheat2="Infinite\Max & Double Magic Meter",801E54B9 0060,811E54C0 0101 +Cheat3="Infinite\Items",801E5521 0063,50000801 0000,801E5526 0063 +Cheat3_N=This is Infinite use of Bombs,Bombchus,Deku Sticks,Deku Nuts,Magic Beans,& Powder Kegs. But you must also put it's Have on to work. +Cheat4="Have\All Masks",811E5508 3E39,811E550A 4745,811E550C 4032,811E550E 3A46,811E5510 3842,811E5512 4833,811E5514 3C3D,811E5516 373F,811E5518 3634,811E551A 4341,811E551C 3B44,811E551E 4935 +Cheat5="Use all C Buttons",811E9398 0000,811E939A 0000 +Cheat6="Event Item\Modifier 1",801E54F5 00?? +Cheat7="Event Item\Modifier 2",801E54FB 00?? +Cheat8="Event Item\Modifier 3",801E5501 00?? +Cheat9="Have Item Modifier",801E5500 00?? +Cheat10="Bottles\Bottle 1 Modifier",801E5502 00?? +Cheat11="Bottles\Bottle 2 Modifier",801E5503 00?? +Cheat12="Bottles\Bottle 3 Modifier",801E5504 00?? +Cheat13="Bottles\Bottle 4 Modifier",801E5505 00?? +Cheat14="Bottles\Bottle 5 Modifier",801E5506 00?? +Cheat15="Bottles\Bottle 6 Modifier",801E5507 00?? +Cheat16="Have\Great Fairy's Sword",801E5500 0010 +Cheat17="Have\QuestStatus Items",801E553D 0005,811E553E F7CF +Cheat18="Have\Have Ocarina of Time",801E54F0 0000 +Cheat19="Have\Hero's Bow",801E54F1 0001 +Cheat20="Have\Fire Arrow",801E54F2 0002 +Cheat21="Have\Ice Arrow",801E54F3 0003 +Cheat22="Have\Light Arrow",801E54F4 0004 +Cheat23="Have\Bombs",801E54F6 0006 +Cheat24="Have\Bombchu",801E54F7 0007 +Cheat25="Have\Deku Sticks",801E54F8 0008 +Cheat26="Have\Deku Nuts",801E54F9 0009 +Cheat27="Have\Magic Beans",801E54FA 000A +Cheat28="Have\Powder Kegs",801E54FC 000C +Cheat29="Have\Pictograph",801E54FD 000D +Cheat30="Have\Lens of Truth",801E54FE 000E +Cheat31="Have\Hookshot",801E54FF 000F +Cheat32="All Equipment Upgrades",801E54ED 0023,811E553A 201B,801E54CC 004F +Cheat33="Replace Sword With",801E54CC 00?? +Cheat33_O=$4A Fire Arrow w/ Bow,$4B Ice Arrow w/ Bow,$4C Light Arrow w/ Bow,$4D Kokiri Sword,$4E Razor Sword,$4F Guilded Sword,$50 Deity Link's Sword +Cheat34="Play As",801E54A0 00?? +Cheat35="Infinite\Hearts Options",811E54B4 ???? +Cheat35_O=$0140 Max Hearts,$0063 6 Hearts,$0043 4 Hearts +Cheat35_N=If you need to clear the Infinite Max Hearts from the screen just choose the 6 or 4 Heart Options, take off the cheat & then make a save. +Cheat36="Press L To Levitate",D0378ECB 0020,813921A8 40CB +Cheat37="Beta World 1",D03DC90B 0000,801E5482 00?? +Cheat37_O=$00 Mama's House non Beta,$01 Fearful Spider House,$02 Beneaf the Graveyard,$03 Southern Swamp Mr Tingle Entry,$06 Outside Tourist Information Southern Swamp,$08 Outside Magic Hag's Potion Shop,$0A Southern Swamp Woods Of Mystery Entry,$24 Counter Of The Tresure Chest Shop,$2E Woodfall Temple non Beta,$32 Spider Hand,$35 Statue outside Gorman Track,$36 Statue outside Lair Of The Temples Boss,$38 Path to Romani Ranch non Beta,$4A outside The Royal Palace of the Deku Kingdom,$4C Ledge in The Royal Palace of the Deku Kingdom,$4E inside The Royal Palace of the Deku Kingdom 1,$71 Green Blobs,$74 Cave Portal to Last Boss Field,$7F Waterfall Sothern Swamp,$8A Giant Turtle In the Temple non beta,$8B Room of Miau & Tijo Zora Great Hall,$94 Recieving Gorans Mask non Beta,$95 ?,$96 Hungry Goran in the Snow,$A2 Statue in Stone Tower,$A6 Stone Tower non Beta,$B9 Recieving Deku Mask non Beta,$D9 Giant Lizards in a Cave,$DA Cave with Steaming Water,$FF Vamps House In Ikana Canyon +Cheat37_N=Put on the code on load up,After the Nintendo logo you will be in that place of Choice.you can also choose another place & then press F1 (reset) to go to that place this is for beta interest only it will not assist you in playing the game. +Cheat38="Warp Modifier",803DC90A 0000,803F5165 0001,813F516A ???? +Cheat38_O=$0010 Mayors Residence,$0008 Magic Hags Potion Shop,$000A Romani Ranch Barn,$000B Mama's House,$000E Honey & Darlings Shop,$0015 Final Boss Arena,$001F Beneath the Graveyard (left entrance),$002F Beneath the Graveyard (right entrance),$0030 Southern Swamp (Reg Entrance),$004F Southern Swamp (from tour house),$006E Southern Swamp (from Woodfall),$006F Southern Swamp (from Deku Palace),$0078 Path to Ikana Canyon,$009E Southern Swamp (from Deku Place 2),$009F Southern Swamp (From Potion Shop),$00AF Boat Cruise (picture taking),$00CD Southern Swamp (From Woods of Mystery),$00CE Southern Swamp (From Spider House),$00CF Southern Swamp (From Ikana Canyon),$00FE Southern Swamp (From Owl Warp),$0E00 Curiosity Shop,$0E38 Ikana Canyon Entrance,$1500 Lens of Truth Cave (get it),$2600 Stone Tower Temple (Upside down),$2609 Stone Tower Temple (Boss Room Entrance),$2604 Treasure Chest Shop,$2605 Treausre Chest Shop (counter),$260E Clock Tower (w/ skull kid, silent),$2610 Stone Tower Temple (endless fall),$6214 Romani Ranch,$9214 Zora Shop,$B214 Snowhead (Path to temple, warp in),$D214 East Clock Down +Cheat38_N=Put this code on and it will now take where you wanted to go, turn it back off or it will infinite loop entering all the time. +Cheat6_O=$28 Moon's Tear,$29 Land Title Deed,$2A Swap Title Deed,$2B Mountain Title Deed,$2C Ocean Title Deed,$2D Room Key,$2E Special Delivery To Mama,$2F Letter To Kafei,$30 Pendant Of Memories +Cheat7_O=$28 Moon's Tear,$29 Land Title Deed,$2A Swap Title Deed,$2B Mountain Title Deed,$2C Ocean Title Deed,$2D Room Key,$2E Special Delivery To Mama,$2F Letter To Kafei,$30 Pendant Of Memories +Cheat8_O=$28 Moon's Tear,$29 Land Title Deed,$2A Swap Title Deed,$2B Mountain Title Deed,$2C Ocean Title Deed,$2D Room Key,$2E Special Delivery To Mama,$2F Letter To Kafei,$30 Pendant Of Memories +Cheat9_O=$05 Japanese Flute?,$0B Japanese Item?,$10 Great Fairy's Sword,$11 Japanese Hookshot?,$31 Japanese Scroll?,$4A Japanese Bow? +Cheat10_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat11_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat12_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat13_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat14_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat15_O=$12 Empty Bottle,$13 Red Potion,$14 Green Potion,$15 Blue Potion,$16 Fairy,$17 Deku Princess,$18 Milk,$19 Milk (1/2),$1A Fish,$1B Bug,$1C Blue Fire,$1D Poe,$1E Big Poe,$1F Spring Water,$20 Hot Spring Water,$21 Zora Egg,$22 Gold Dust,$23 Magical Mushroom,$24 Sea Horse,$25 Chateau Romani,$26 Japanese Bottle?,$27 Empty Japanese Bottle? +Cheat33_N=Only put the Deity Link's Sword on, if using The Play As Fierce Deity Link Code, if not it will turn Fierce Deity Link into a crazed slashing Machine. You have been warned. +Cheat34_O=$00 Fierce Deity Link,$01 Goron Link,$02 Zora Link,$03 Deku Link,$04 Normal Link +Cheat36_N=Press L To Levitate & Let go to land + +//---- + +[B044B569-373C1985-C:50] +Name=Legend of Zelda, The - Ocarina of Time (E) (V1.0) +Cheat0="Infinite\Rupees",8111979C 0001 +Cheat1="Press R\For Old Or Young Link",D01C64F5 0010,801183D7 00?? +Cheat1_O=$01 Link Young,$00 Link Old +Cheat1_N=To Activate this Cheat Hold The R Button when walking through a Doorway this will change you to the option on the other side, Disable this Cheat straight away after getting to the other side, in some places you might even get Access Violations. Just press ok untill you can carry on. +Cheat2="Use Any Item In Any House",811195F2 0000,811195F4 0000 +Cheat3="Have\All Equipment",8111846C 7777 +Cheat4="Have\All Quest/Status Items",81118474 30FF,81118476 FFFF +Cheat5="Max\Heart Containers",811183FE 0140 +Cheat6="Max\Gold Skulltulas Killed",801184A1 0064 +Cheat7="Time of Day Modifier",811183DC ???? +Cheat8="Infinite\Energy",81118400 0140 +Cheat9="Infinite\Magic",D0118409 0008,8011840A 0001,8011840C 0001,80118403 0060 +Cheat10="Tunic & Boot Options",80118440 00?? +Cheat11="Infinite\Deku Sticks",8011845C 0009 +Cheat12="Infinite\Deku Nuts",8011845D 0009 +Cheat13="Infinite\Bombs",8011845E 0009 +Cheat14="Infinite\Arrows",8011845F 0009 +Cheat15="Infinite\Deku Seeds",80118462 0009 +Cheat16="Infinite\Bombchu's",80118464 0009 +Cheat17="Infinite\Magic Beans",8011846A 0009 +Cheat18="Infinite\Big Key,Small Keys,Compass,& Map",50000B01 0000,80118478 0007,50000501 0000,8011848F 0009,80118497 0009,80118499 0009,8011849C 0009 +Cheat19="Have\Ocarina",8011844B 00?? +Cheat20="Have\Boomerang",80118450 000E +Cheat21="Have\Lens of Truth",80118451 000F +Cheat22="Have\Megaton Hammer",80118453 0011 +Cheat23="Have\Deku Stick",80118444 0000 +Cheat24="Have\Deku Nut",80118445 0001 +Cheat25="Have\Bombs",80118446 0002 +Cheat26="Have\Fairy Bow",80118447 0003 +Cheat27="Have\Fairy Slingshot",8011844A 0006 +Cheat28="Have\Bombchu",8011844C 0009 +Cheat29="Have\Arrows\Fire Arrow",80118448 0004 +Cheat30="Have\Arrows\Ice Arrow",8011844E 000C +Cheat31="Have\Arrows\Light Arrow",80118454 0012 +Cheat32="Have\Hookshot",8011844D 00?? +Cheat33="Have\Magic Beans",80118452 0010 +Cheat34="Have\Magic\Fairie's Wind",8011844F 000D +Cheat35="Have\Magic\Nayru's Love",80118455 0013 +Cheat36="Have\Magic\Din's Fire",80118449 0005 +Cheat37="Bottles\Bottle 1 Modifier",80118456 00?? +Cheat38="Bottles\Bottle 2 Modifier",80118457 00?? +Cheat39="Bottles\Bottle 3 Modifier",80118458 00?? +Cheat40="Bottles\Bottle 4 Modifier",80118459 00?? +Cheat41="Trading\Adult Link Item",8011845A 00?? +Cheat42="Trading\Young Link Item",8011845B 00?? +Cheat43="Turn Giant's Knife Into Biggoron's Sword",8011840E 0001 +Cheat44="Have Quiver (Holds 30)",80118471 0001 +Cheat45="Equipment Modifier 1",80118472 00?? +Cheat46="Equipment Modifier 2",80118473 00?? +Cheat47="Press L To Levitate",D01C64F5 0020,811D8AE0 40CB +Cheat47_N=Press L To Levitate & Let go to land +Cheat48="Press L For infinite Hover Boots",D01C64F5 0020,811D92F2 000D +Cheat48_N=Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on +Cheat49="Instant Step Hoover Boots",D01C64F5 0020,811D8AE0 40CB,D01C64F5 0000,811D92F2 000D,80118440 00?? +Cheat49_O=$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat49_N=Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. +Cheat50="Beta\Play Beta Quest Worlds",D01C64F5 0000,801197E3 00?? +Cheat50_O=$00 World 01,$01 World 02,$02 World 03,$03 World 04,$04 World 05,$07 World 06,$08 World 07,$16 World 08 +Cheat50_N=Put on the code on load up,After the Nintendo logo you will be in Hyrule Field,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. +Cheat51="Warp Song Location\Minuet of Forest & Serenade of Water",80119765 00?? +Cheat51_O=$00 Sacred Forest Meadow,$04 Lake Hylia,$15 Inside Jabu Jabu's Belly,$18 Dodongo's Cavern,$68 Inside The Deku Tree +Cheat51_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat52="Warp Song Location\Prelude of Light & Nocturne of Shadow",80119765 00?? +Cheat52_O=$03 Kakariko Windmill,$07 Bombchu Bowling Alley,$0F Zelda & Impa Flee,$14 Kakariko Village,$17 Ganon,Final Battle,$1D Top of Ganon's Tower,$28 Bombchu Shop,$2C Bazaar,$30 Happy Mask Shop,$34 Ganon's Tower,$38 Ganon's Castle,$4C Inside Spirit Door,$6C Burning Castle,$50 House of Skulltula,$64 Death Mountain Trail,$68 Graveyard,$70 Thieves' Hideout,$74 Royal Family's Tomb,$78 Great Fairy Fountain 1,$84 Forest Temple,Room With Falling Floor,$88 Great Fairy Fountain 2,$99 Grotto 01,$9D Grotto 02,$A4 Grotto 04,$A8 Grotto 05,$B3 Grotto 06,$B0 Grotto 07,$B4 Grotto 08,$B8 Grotto 09,$C3 Grotto 10,$C0 Grotto 11,$C4 Grotto 12,$FC Grotto 13,$D3 Bottom of the Well,$D0 Lon Lon Ranch Shed,$D3 Lon Lon Ranch Outside Shed,$D8 Ice Cavern,$E3 Outside Cow Pen,$E0 Lost Woods Bridge,$E4 Lon Lon Ranch Chicken Room,$E8 In Front of Deku Tree,$EB Spirit Temple Boss,$F1 Castle Courtyard,In Front of Zelda,$F4 Temple of Time,$F8 Gerudo Fortress Jail +Cheat52_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat53="Warp Song Location\Bolero of Fire",80119765 00?? +Cheat53_O=$03 Castle Courtyard,$0B Dodongo's Cavern Boss,$10 Inside The Deku Tree Boss,$14 Shadow Temple Boss,$17 Water Temple Boss,$1C Ganon's Castle Tower,$1F Ganon First Battle,$28 Ganon's Castle Room Before Ganon,$2B Inside Ganon's Castle Room With Pillar,$2F Lon Lon Ranch,$33 Mido's House,$37 Saria's House,$4B Bearded Man's House,$40 Top of Ganon's Castle,$47 Outside Saria's House,$4F Dampe's Race,$57 Kokiri Forest,$5B Top of Death Mountain,$5F Fishing Pond,$68 Inside Ganon's Castle,$7F Hyrule Castle Gate,$BA Top of Ganon's Tower,$C2 Great Fairy Fountain,$D6 Lost Woods Goron Entrance,$DA Lost Woods River Entrance,$DE Lost Woods Bridge Field Entrance,$E3 Goron City Lost Woods Entrance,$F6 Death Mountain Crater,$FD Ganon's Castle +Cheat53_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat54="Warp Song Location\Requiem of Spirit",80119765 00?? +Cheat54_O=$05 Lake Hylia,08 Zora's Domain,$18 Gerudo Valley,$1E Lost Woods,$28 Gerudo Fortress,$30 Haunted Wasteland,$34 Ganon's Castle Inside Burning Castle,$38 Hyrule Castle,$3A Ganon's Castle,$3D Death Mountain Trail,$4D Goron City,$65 Fire Temple,$69 Forest Temple,$6E Shooting Gallery,$79 Ganon's Castle Inside Burning Castle,$7E Kakariko Village Entrance,$7B Zora's River Entrance,$85 Kokiri Forest Entrance,$8A Lake Hyrule Entrance,$8E Gerudo Valley Entrance,$92 Death Mountain Trail Entrance,$95 Graveyard Entrance,$9E Zora's Domain Entrance,$A2 Zora's Fountain Entrance,$BA Goron City Entrance,$BE Death Mountain Trail,$C1 Goron City,$C5 Lakeside Laboratory,$C9 Top of Ganon's Castle,$CD Hyrule Market (Child Link's),$CF Hyrule Market (Adult Link's),$F1 Desert Colossus,$FA Lon Lon Ranch Entrance,$FD Hyrule Field +Cheat54_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat55="Max\Double Defense Power",8011849F 0014 +Cheat55_N=This gives you White Border Hearts +Cheat56="Nayru's Love is Always",801D851B ???? +Cheat56_O=$0000 OFF,$FFFF ON +Cheat56_N=For this to work On Or off, you have to walk through a Doorway to activate the Change. +Cheat57="Infinite\Timers\All Other Timers",801197A1 0032 +Cheat57_N=This cheat works on all Race Timers not the final Boss and Under Water with iron Boots etc. +Cheat58="Epona\Max Carrots\Lon Lon Raunch",801F12C8 0005,801EDD08 0005 +Cheat58_N=This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona +Cheat59="Infinite\Timers\Escape From Gannons Tower",801197A5 00B4 +Cheat59_N=This cheat works only on The Final Boss. +Cheat60="Beta\Specific things lean",80023414 0001 +Cheat60_N=This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest World 01) +Cheat61="Beta\Appear in Strange Places (Hold R)",D01C64F5 0010,81119736 0001 +Cheat61_N=If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. +Cheat62="Beta\Interface always off/on",801192B9 00FF,8011972F 00?? +Cheat62_O=$00 Off,$01 Off +Cheat62_N=If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset. +Cheat63="Always Have Wallet Size",80118472 00?? +Cheat63_O=$47 Kid Wallet (Holds 99),$57 Adult Wallet (Holds 200),$67 Giant Wallet (Holds 500) +Cheat7_O=$4000 At Sunrise,$5800 Daylight Out,$7000 Very Bright Out,$C000 At Sunset,$D000 Fairly Dark +Cheat10_O=$11 Kokiri Tunic & Kokiri Boots,$12 Goron Tunic & Kokiri Boots,$13 Zora Tunic & Kokiri Boots,$14 Black Tunic & Kokiri Boots,$15 White Tunic & Kokiri Boots,$16 Yellow Tunic & Kokiri Boots,$21 Kokiri Tunic & Iron Boots,$22 Goron Tunic & Iron Boots,$23 Zora Tunic & Iron Boots,$24 Black Tunic & Iron Boots,$25 White Tunic & Iron Boots,$26 Yellow Tunic & Iron Boots,$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat19_O=$07 Fairy Ocarina,$08 Ocarina Of Time +Cheat32_O=$0A Hookshot,$0B Longshot +Cheat37_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat38_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat39_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat40_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat41_O=$2D Pocket Egg,$2E Pocket Cucco,$2F Cojiro,$30 Odd Mushroom,$31 Odd Potion,$32 Poacher's Saw,$33 Goron's Sword (Broken),$34 Prescription,$35 Eyeball Frog,$36 Eye Drops,$37 Claim Check +Cheat42_O=$21 Weird Egg,$22 Chicken,$23 Zelda's Letter,$24 Keaton Mask,$25 Skull Mask,$26 Spooky Mask,$27 Bunny Hood,$28 Goron Mask,$29 Zora Mask,$2A Gerudo Mask,$2B Mask of Truth,$2C SOLD OUT +Cheat45_O=$02 Silver Scale,$04 Golden Scale,$06 Giant's Knife (Broken),$35 Black Gauntlets,$40 Bullet Bag (Holds 30),$80 Bullet Bag (Holds 40),$C0 Bullet Bag (Holds 50) +Cheat46_O=$08 Bomb Bag (Holds 20),$10 Bomb Bag (Holds 30),$18 Bomb Bag (Holds 40),$20 Goron's Bracelet,$28 Silver Gauntlets,$30 Golden Gauntlets +Cheat0_N=This cheat allows you to have the max Rupees to the Wallet you currently Hold +Cheat2_N=do not use under or in water +Cheat3_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal +Cheat4_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal +Cheat10_N=This changes what you are wearing,once you have enabled the code press Start & then start again. +Cheat45_N=This modifies the equipment you are carrying. +Cheat46_N=This modifies the equipment you are carrying. +Cheat64="Language Select",801197D9 00?? +Cheat64_O=$00 English,$01 German,$02 French +Cheat65="Dark Link\Make Dark Link Apear In TOT",8023D6DF 0020,8023D6E5 0033 + +//---- + +[B2055FBD-0BAB4E0C-C:50] +Name=Legend of Zelda, The - Ocarina of Time (E) (V1.1) +Cheat0="Infinite\Rupees",811197DC 0001 +Cheat1="Press R\For Old Or Young Link",D01C6535 0010,80118417 00?? +Cheat1_O=$01 Link Young,$00 Link Old +Cheat1_N=To Activate this Cheat Hold The R Button when walking through a Doorway this will change you to the option on the other side, Disable this Cheat straight away after getting to the other side, in some places you might even get Access Violations. Just press ok untill you can carry on. +Cheat2="Use Any Item In Any House",81119632 0000,81119634 0000 +Cheat3="Have\All Equipment",811184AC 7777 +Cheat4="Have\All Quest/Status Items",811184B4 30FF,811184B6 FFFF +Cheat5="Max\Heart Containers",8111843E 0140 +Cheat6="Max\Gold Skulltulas Killed",801184E1 0064 +Cheat7="Time of Day Modifier",8111841C ???? +Cheat8="Infinite\Energy",81118440 0140 +Cheat9="Infinite\Magic",D0118449 0008,8011844A 0001,8011844C 0001,80118443 0060 +Cheat10="Tunic & Boot Options",80118480 00?? +Cheat11="Infinite\Deku Sticks",8011849C 0009 +Cheat12="Infinite\Deku Nuts",8011849D 0009 +Cheat13="Infinite\Bombs",8011849E 0009 +Cheat14="Infinite\Arrows",8011849F 0009 +Cheat15="Infinite\Deku Seeds",801184A2 0009 +Cheat16="Infinite\Bombchu's",801184A4 0009 +Cheat17="Infinite\Magic Beans",801184AA 0009 +Cheat18="Infinite\Big Key,Small Keys,Compass,& Map",50000B01 0000,801184B8 0007,50000501 0000,801184CF 0009,801184D7 0009,801184D9 0009,801184DC 0009 +Cheat19="Have\Ocarina",8011848B 00?? +Cheat20="Have\Boomerang",80118490 000E +Cheat21="Have\Lens of Truth",80118491 000F +Cheat22="Have\Megaton Hammer",80118493 0011 +Cheat23="Have\Deku Stick",80118484 0000 +Cheat24="Have\Deku Nut",80118485 0001 +Cheat25="Have\Bombs",80118486 0002 +Cheat26="Have\Fairy Bow",80118487 0003 +Cheat27="Have\Fairy Slingshot",8011848A 0006 +Cheat28="Have\Bombchu",8011848C 0009 +Cheat29="Have\Arrows\Fire Arrow",80118488 0004 +Cheat30="Have\Arrows\Ice Arrow",8011848E 000C +Cheat31="Have\Arrows\Light Arrow",80118494 0012 +Cheat32="Have\Hookshot",8011848D 00?? +Cheat33="Have\Magic Beans",80118492 0010 +Cheat34="Have\Magic\Fairie's Wind",8011848F 000D +Cheat35="Have\Magic\Nayru's Love",80118495 0013 +Cheat36="Have\Magic\Din's Fire",80118489 0005 +Cheat37="Bottles\Bottle 1 Modifier",80118496 00?? +Cheat38="Bottles\Bottle 2 Modifier",80118497 00?? +Cheat39="Bottles\Bottle 3 Modifier",80118498 00?? +Cheat40="Bottles\Bottle 4 Modifier",80118499 00?? +Cheat41="Trading\Adult Link Item",8011849A 00?? +Cheat42="Trading\Young Link Item",8011849B 00?? +Cheat43="Turn Giant's Knife Into Biggoron's Sword",8011844E 0001 +Cheat44="Have Quiver (Holds 30)",801184B1 0001 +Cheat45="Equipment Modifier 1",801184B2 00?? +Cheat46="Equipment Modifier 2",801184B3 00?? +Cheat47="Press L To Levitate",D01C6535 0020,811D8B20 40CB +Cheat47_N=Press L To Levitate & Let go to land +Cheat48="Press L For infinite Hover Boots",D01C6535 0020,811D9332 000D +Cheat48_N=Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on +Cheat49="Instant Step Hoover Boots",D01C6535 0020,811D8B20 40CB,D01C6535 0000,811D9332 000D,80118480 00?? +Cheat49_O=$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat49_N=Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. +Cheat50="Beta\Play Beta Quest Worlds",D01C6535 0000,80119823 00?? +Cheat50_O=$00 World 01,$01 World 02,$02 World 03,$03 World 04,$04 World 05,$07 World 06,$08 World 07,$16 World 08 +Cheat50_N=Put on the code on load up,After the Nintendo logo you will be in Hyrule Field,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. +Cheat51="Warp Song Location\Minuet of Forest & Serenade of Water",801197A5 00?? +Cheat51_O=$00 Sacred Forest Meadow,$04 Lake Hylia,$15 Inside Jabu Jabu's Belly,$18 Dodongo's Cavern,$68 Inside The Deku Tree +Cheat51_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat52="Warp Song Location\Prelude of Light & Nocturne of Shadow",801197A5 00?? +Cheat52_O=$03 Kakariko Windmill,$07 Bombchu Bowling Alley,$0F Zelda & Impa Flee,$14 Kakariko Village,$17 Ganon,Final Battle,$1D Top of Ganon's Tower,$28 Bombchu Shop,$2C Bazaar,$30 Happy Mask Shop,$34 Ganon's Tower,$38 Ganon's Castle,$4C Inside Spirit Door,$6C Burning Castle,$50 House of Skulltula,$64 Death Mountain Trail,$68 Graveyard,$70 Thieves' Hideout,$74 Royal Family's Tomb,$78 Great Fairy Fountain 1,$84 Forest Temple,Room With Falling Floor,$88 Great Fairy Fountain 2,$99 Grotto 01,$9D Grotto 02,$A4 Grotto 04,$A8 Grotto 05,$B3 Grotto 06,$B0 Grotto 07,$B4 Grotto 08,$B8 Grotto 09,$C3 Grotto 10,$C0 Grotto 11,$C4 Grotto 12,$FC Grotto 13,$D3 Bottom of the Well,$D0 Lon Lon Ranch Shed,$D3 Lon Lon Ranch Outside Shed,$D8 Ice Cavern,$E3 Outside Cow Pen,$E0 Lost Woods Bridge,$E4 Lon Lon Ranch Chicken Room,$E8 In Front of Deku Tree,$EB Spirit Temple Boss,$F1 Castle Courtyard,In Front of Zelda,$F4 Temple of Time,$F8 Gerudo Fortress Jail +Cheat52_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat53="Warp Song Location\Bolero of Fire",801197A5 00?? +Cheat53_O=$03 Castle Courtyard,$0B Dodongo's Cavern Boss,$10 Inside The Deku Tree Boss,$14 Shadow Temple Boss,$17 Water Temple Boss,$1C Ganon's Castle Tower,$1F Ganon First Battle,$28 Ganon's Castle Room Before Ganon,$2B Inside Ganon's Castle Room With Pillar,$2F Lon Lon Ranch,$33 Mido's House,$37 Saria's House,$4B Bearded Man's House,$40 Top of Ganon's Castle,$47 Outside Saria's House,$4F Dampe's Race,$57 Kokiri Forest,$5B Top of Death Mountain,$5F Fishing Pond,$68 Inside Ganon's Castle,$7F Hyrule Castle Gate,$BA Top of Ganon's Tower,$C2 Great Fairy Fountain,$D6 Lost Woods Goron Entrance,$DA Lost Woods River Entrance,$DE Lost Woods Bridge Field Entrance,$E3 Goron City Lost Woods Entrance,$F6 Death Mountain Crater,$FD Ganon's Castle +Cheat53_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat54="Warp Song Location\Requiem of Spirit",801197A5 00?? +Cheat54_O=$05 Lake Hylia,08 Zora's Domain,$18 Gerudo Valley,$1E Lost Woods,$28 Gerudo Fortress,$30 Haunted Wasteland,$34 Ganon's Castle Inside Burning Castle,$38 Hyrule Castle,$3A Ganon's Castle,$3D Death Mountain Trail,$4D Goron City,$65 Fire Temple,$69 Forest Temple,$6E Shooting Gallery,$79 Ganon's Castle Inside Burning Castle,$7E Kakariko Village Entrance,$7B Zora's River Entrance,$85 Kokiri Forest Entrance,$8A Lake Hyrule Entrance,$8E Gerudo Valley Entrance,$92 Death Mountain Trail Entrance,$95 Graveyard Entrance,$9E Zora's Domain Entrance,$A2 Zora's Fountain Entrance,$BA Goron City Entrance,$BE Death Mountain Trail,$C1 Goron City,$C5 Lakeside Laboratory,$C9 Top of Ganon's Castle,$CD Hyrule Market (Child Link's),$CF Hyrule Market (Adult Link's),$F1 Desert Colossus,$FA Lon Lon Ranch Entrance,$FD Hyrule Field +Cheat54_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat55="Max\Double Defense Power",801184DF 0014 +Cheat55_N=This gives you White Border Hearts +Cheat56="Nayru's Love is Always",811197D8 ???? +Cheat56_O=$0000 OFF,$FFFF ON +Cheat56_N=For this to work On Or off, you have to walk through a Doorway to activate the Change. +Cheat57="Infinite\Timers\All Other Timers",801197E1 0032 +Cheat57_N=This cheat works on all Race Timers not the final Boss and Under Water with iron Boots etc. +Cheat58="Epona\Max Carrots\Lon Lon Raunch",801F1308 0005,801EDD48 0005 +Cheat58_N=This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona +Cheat59="Infinite\Timers\Escape From Gannons Tower",801197E5 00B4 +Cheat59_N=This cheat works only on The Final Boss. +Cheat60="Beta\Specific things lean",80023454 0001 +Cheat60_N=This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest World 01) +Cheat61="Beta\Appear in Strange Places (Hold R)",D01C6535 0010,81119776 0001 +Cheat61_N=If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. +Cheat62="Beta\Interface always off/on",801192F9 00FF,8011976F 00?? +Cheat62_O=$00 Off,$01 Off +Cheat62_N=If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset. +Cheat63="Always Have Wallet Size",801184B2 00?? +Cheat63_O=$47 Kid Wallet (Holds 99),$57 Adult Wallet (Holds 200),$67 Giant Wallet (Holds 500) +Cheat7_O=$4000 At Sunrise,$5800 Daylight Out,$7000 Very Bright Out,$C000 At Sunset,$D000 Fairly Dark +Cheat10_O=$11 Kokiri Tunic & Kokiri Boots,$12 Goron Tunic & Kokiri Boots,$13 Zora Tunic & Kokiri Boots,$14 Black Tunic & Kokiri Boots,$15 White Tunic & Kokiri Boots,$16 Yellow Tunic & Kokiri Boots,$21 Kokiri Tunic & Iron Boots,$22 Goron Tunic & Iron Boots,$23 Zora Tunic & Iron Boots,$24 Black Tunic & Iron Boots,$25 White Tunic & Iron Boots,$26 Yellow Tunic & Iron Boots,$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat19_O=$07 Fairy Ocarina,$08 Ocarina Of Time +Cheat32_O=$0A Hookshot,$0B Longshot +Cheat37_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat38_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat39_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat40_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat41_O=$2D Pocket Egg,$2E Pocket Cucco,$2F Cojiro,$30 Odd Mushroom,$31 Odd Potion,$32 Poacher's Saw,$33 Goron's Sword (Broken),$34 Prescription,$35 Eyeball Frog,$36 Eye Drops,$37 Claim Check +Cheat42_O=$21 Weird Egg,$22 Chicken,$23 Zelda's Letter,$24 Keaton Mask,$25 Skull Mask,$26 Spooky Mask,$27 Bunny Hood,$28 Goron Mask,$29 Zora Mask,$2A Gerudo Mask,$2B Mask of Truth,$2C SOLD OUT +Cheat45_O=$02 Silver Scale,$04 Golden Scale,$06 Giant's Knife (Broken),$35 Black Gauntlets,$40 Bullet Bag (Holds 30),$80 Bullet Bag (Holds 40),$C0 Bullet Bag (Holds 50) +Cheat46_O=$08 Bomb Bag (Holds 20),$10 Bomb Bag (Holds 30),$18 Bomb Bag (Holds 40),$20 Goron's Bracelet,$28 Silver Gauntlets,$30 Golden Gauntlets +Cheat0_N=This cheat allows you to have the max Rupees to the Wallet you currently Hold +Cheat2_N=do not use under or in water +Cheat3_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal +Cheat4_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal +Cheat10_N=This changes what you are wearing,once you have enabled the code press Start & then start again. +Cheat45_N=This modifies the equipment you are carrying. +Cheat46_N=This modifies the equipment you are carrying. +Cheat64="Language Select",80119819 00?? +Cheat64_O=$00 English,$01 German,$02 French +Cheat65="Dark Link\Make Dark Link Apear In TOT",8023D71F 0020,8023D725 0033 + +//---- + +[09465AC3-F8CB501B-C:50] +Name=Legend of Zelda, The - Ocarina of Time (E) (GC Version) +Cheat0="Infinite\Rupees",81119D24 0001 +Cheat1="Press R\For Old Or Young Link",D01C6A7D 0010,8011895F 00?? +Cheat1_O=$01 Link Young,$00 Link Old +Cheat1_N=To Activate this Cheat Hold The R Button when walking through a Doorway this will change you to the option on the other side, Disable this Cheat straight away after getting to the other side, in some places you might even get Access Violations. Just press ok untill you can carry on. +Cheat2="Use Any Item In Any House",81119B7A 0000,81119B7C 0000 +Cheat3="Have\All Equipment",811189F4 7777 +Cheat4="Have\All Quest/Status Items",811189FC 30FF,811189FE FFFF +Cheat5="Max\Heart Containers",81118986 0140 +Cheat6="Max\Gold Skulltulas Killed",80118A29 0064 +Cheat7="Time of Day Modifier",81118964 ???? +Cheat8="Infinite\Energy",81118988 0140 +Cheat9="Infinite\Magic",D0118991 0008,80118992 0001,80118994 0001,8011898B 0060 +Cheat10="Tunic & Boot Options",801189C8 00?? +Cheat11="Infinite\Deku Sticks",801189E4 0009 +Cheat12="Infinite\Deku Nuts",801189E5 0009 +Cheat13="Infinite\Bombs",801189E6 0009 +Cheat14="Infinite\Arrows",801189E7 0009 +Cheat15="Infinite\Deku Seeds",801189EA 0009 +Cheat16="Infinite\Bombchu's",801189EC 0009 +Cheat17="Infinite\Magic Beans",801189F2 0009 +Cheat18="Infinite\Big Key,Small Keys,Compass,& Map",50000B01 0000,80118A00 0007,50000501 0000,80118A17 0009,80118A1F 0009,80118A21 0009,80118A24 0009 +Cheat19="Have\Ocarina",801189D3 00?? +Cheat20="Have\Boomerang",801189D8 000E +Cheat21="Have\Lens of Truth",801189D9 000F +Cheat22="Have\Megaton Hammer",801189DB 0011 +Cheat23="Have\Deku Stick",801189CC 0000 +Cheat24="Have\Deku Nut",801189CD 0001 +Cheat25="Have\Bombs",801189CE 0002 +Cheat26="Have\Fairy Bow",801189CF 0003 +Cheat27="Have\Fairy Slingshot",801189D2 0006 +Cheat28="Have\Bombchu",801189D4 0009 +Cheat29="Have\Arrows\Fire Arrow",801189D0 0004 +Cheat30="Have\Arrows\Ice Arrow",801189D6 000C +Cheat31="Have\Arrows\Light Arrow",801189DC 0012 +Cheat32="Have\Hookshot",801189D5 00?? +Cheat33="Have\Magic Beans",801189DA 0010 +Cheat34="Have\Magic\Fairie's Wind",801189D7 000D +Cheat35="Have\Magic\Nayru's Love",801189DD 0013 +Cheat36="Have\Magic\Din's Fire",801189D1 0005 +Cheat37="Bottles\Bottle 1 Modifier",801189DE 00?? +Cheat38="Bottles\Bottle 2 Modifier",801189DF 00?? +Cheat39="Bottles\Bottle 3 Modifier",801189E0 00?? +Cheat40="Bottles\Bottle 4 Modifier",801189E1 00?? +Cheat41="Trading\Adult Link Item",801189E2 00?? +Cheat42="Trading\Young Link Item",801189E3 00?? +Cheat43="Turn Giant's Knife Into Biggoron's Sword",80118996 0001 +Cheat44="Have Quiver (Holds 30)",801189F9 0001 +Cheat45="Equipment Modifier 1",801189FA 00?? +Cheat46="Equipment Modifier 2",801189FB 00?? +Cheat47="Press L To Levitate",D011BB37 0020,811D9410 40CB +Cheat47_N=Press L To Levitate & Let go to land +Cheat48="Press L For infinite Hover Boots",D011BB37 0020,811D9C32 000D +Cheat48_N=Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on +Cheat49="Instant Step Hoover Boots",D011BB37 0020,811D9410 40CB,D011BB37 0000,811D9C32 000D,801189C8 00?? +Cheat49_O=$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat49_N=Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. +Cheat50="Beta\Play Beta Quest Worlds",D01C6A7D 0000,80119D6B 00?? +Cheat50_O=$00 World 01,$01 World 02,$02 World 03,$03 World 04,$04 World 05,$07 World 06,$08 World 07,$16 World 08 +Cheat50_N=Put on the code on load up,After the Nintendo logo you will be in Hyrule Field,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. +Cheat51="Warp Song Location\Minuet of Forest & Serenade of Water",801197A5 00?? +Cheat51_O=$00 Sacred Forest Meadow,$04 Lake Hylia,$15 Inside Jabu Jabu's Belly,$18 Dodongo's Cavern,$68 Inside The Deku Tree +Cheat51_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat52="Warp Song Location\Prelude of Light & Nocturne of Shadow",801197A5 00?? +Cheat52_O=$03 Kakariko Windmill,$07 Bombchu Bowling Alley,$0F Zelda & Impa Flee,$14 Kakariko Village,$17 Ganon,Final Battle,$1D Top of Ganon's Tower,$28 Bombchu Shop,$2C Bazaar,$30 Happy Mask Shop,$34 Ganon's Tower,$38 Ganon's Castle,$4C Inside Spirit Door,$6C Burning Castle,$50 House of Skulltula,$64 Death Mountain Trail,$68 Graveyard,$70 Thieves' Hideout,$74 Royal Family's Tomb,$78 Great Fairy Fountain 1,$84 Forest Temple,Room With Falling Floor,$88 Great Fairy Fountain 2,$99 Grotto 01,$9D Grotto 02,$A4 Grotto 04,$A8 Grotto 05,$B3 Grotto 06,$B0 Grotto 07,$B4 Grotto 08,$B8 Grotto 09,$C3 Grotto 10,$C0 Grotto 11,$C4 Grotto 12,$FC Grotto 13,$D3 Bottom of the Well,$D0 Lon Lon Ranch Shed,$D3 Lon Lon Ranch Outside Shed,$D8 Ice Cavern,$E3 Outside Cow Pen,$E0 Lost Woods Bridge,$E4 Lon Lon Ranch Chicken Room,$E8 In Front of Deku Tree,$EB Spirit Temple Boss,$F1 Castle Courtyard,In Front of Zelda,$F4 Temple of Time,$F8 Gerudo Fortress Jail +Cheat52_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat53="Warp Song Location\Bolero of Fire",801197A5 00?? +Cheat53_O=$03 Castle Courtyard,$0B Dodongo's Cavern Boss,$10 Inside The Deku Tree Boss,$14 Shadow Temple Boss,$17 Water Temple Boss,$1C Ganon's Castle Tower,$1F Ganon First Battle,$28 Ganon's Castle Room Before Ganon,$2B Inside Ganon's Castle Room With Pillar,$2F Lon Lon Ranch,$33 Mido's House,$37 Saria's House,$4B Bearded Man's House,$40 Top of Ganon's Castle,$47 Outside Saria's House,$4F Dampe's Race,$57 Kokiri Forest,$5B Top of Death Mountain,$5F Fishing Pond,$68 Inside Ganon's Castle,$7F Hyrule Castle Gate,$BA Top of Ganon's Tower,$C2 Great Fairy Fountain,$D6 Lost Woods Goron Entrance,$DA Lost Woods River Entrance,$DE Lost Woods Bridge Field Entrance,$E3 Goron City Lost Woods Entrance,$F6 Death Mountain Crater,$FD Ganon's Castle +Cheat53_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat54="Warp Song Location\Requiem of Spirit",801197A5 00?? +Cheat54_O=$05 Lake Hylia,08 Zora's Domain,$18 Gerudo Valley,$1E Lost Woods,$28 Gerudo Fortress,$30 Haunted Wasteland,$34 Ganon's Castle Inside Burning Castle,$38 Hyrule Castle,$3A Ganon's Castle,$3D Death Mountain Trail,$4D Goron City,$65 Fire Temple,$69 Forest Temple,$6E Shooting Gallery,$79 Ganon's Castle Inside Burning Castle,$7E Kakariko Village Entrance,$7B Zora's River Entrance,$85 Kokiri Forest Entrance,$8A Lake Hyrule Entrance,$8E Gerudo Valley Entrance,$92 Death Mountain Trail Entrance,$95 Graveyard Entrance,$9E Zora's Domain Entrance,$A2 Zora's Fountain Entrance,$BA Goron City Entrance,$BE Death Mountain Trail,$C1 Goron City,$C5 Lakeside Laboratory,$C9 Top of Ganon's Castle,$CD Hyrule Market (Child Link's),$CF Hyrule Market (Adult Link's),$F1 Desert Colossus,$FA Lon Lon Ranch Entrance,$FD Hyrule Field +Cheat54_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat55="Max\Double Defense Power",80118A27 0014 +Cheat55_N=This gives you White Border Hearts +Cheat56="Nayru's Love is Always",81119D20 ???? +Cheat56_O=$0000 OFF,$FFFF ON +Cheat56_N=For this to work On Or off, you have to walk through a Doorway to activate the Change. +Cheat57="Infinite\Timers\All Other Timers",80119D29 0032 +Cheat57_N=This cheat works on all Race Timers not the final Boss and Under Water with iron Boots etc. +Cheat58="Epona\Max Carrots\Lon Lon Raunch",801F1850 0005,801EE290 0005 +Cheat58_N=This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona +Cheat59="Infinite\Timers\Escape From Gannons Tower",80119D2D 00B4 +Cheat59_N=This cheat works only on The Final Boss. +Cheat60="Beta\Specific things lean",8002399C 0001 +Cheat60_N=This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest World 01) +Cheat61="Beta\Appear in Strange Places (Hold R)",D01C6A7D 0010,81119CBE 0001 +Cheat61_N=If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. +Cheat62="Beta\Interface always off/on",80119841 00FF,80119CB7 00?? +Cheat62_O=$00 Off,$01 Off +Cheat62_N=If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset. +Cheat63="Always Have Wallet Size",801189FA 00?? +Cheat63_O=$47 Kid Wallet (Holds 99),$57 Adult Wallet (Holds 200),$67 Giant Wallet (Holds 500) +Cheat7_O=$4000 At Sunrise,$5800 Daylight Out,$7000 Very Bright Out,$C000 At Sunset,$D000 Fairly Dark +Cheat10_O=$11 Kokiri Tunic & Kokiri Boots,$12 Goron Tunic & Kokiri Boots,$13 Zora Tunic & Kokiri Boots,$14 Black Tunic & Kokiri Boots,$15 White Tunic & Kokiri Boots,$16 Yellow Tunic & Kokiri Boots,$21 Kokiri Tunic & Iron Boots,$22 Goron Tunic & Iron Boots,$23 Zora Tunic & Iron Boots,$24 Black Tunic & Iron Boots,$25 White Tunic & Iron Boots,$26 Yellow Tunic & Iron Boots,$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat19_O=$07 Fairy Ocarina,$08 Ocarina Of Time +Cheat32_O=$0A Hookshot,$0B Longshot +Cheat37_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat38_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat39_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat40_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat41_O=$2D Pocket Egg,$2E Pocket Cucco,$2F Cojiro,$30 Odd Mushroom,$31 Odd Potion,$32 Poacher's Saw,$33 Goron's Sword (Broken),$34 Prescription,$35 Eyeball Frog,$36 Eye Drops,$37 Claim Check +Cheat42_O=$21 Weird Egg,$22 Chicken,$23 Zelda's Letter,$24 Keaton Mask,$25 Skull Mask,$26 Spooky Mask,$27 Bunny Hood,$28 Goron Mask,$29 Zora Mask,$2A Gerudo Mask,$2B Mask of Truth,$2C SOLD OUT +Cheat45_O=$02 Silver Scale,$04 Golden Scale,$06 Giant's Knife (Broken),$35 Black Gauntlets,$40 Bullet Bag (Holds 30),$80 Bullet Bag (Holds 40),$C0 Bullet Bag (Holds 50) +Cheat46_O=$08 Bomb Bag (Holds 20),$10 Bomb Bag (Holds 30),$18 Bomb Bag (Holds 40),$20 Goron's Bracelet,$28 Silver Gauntlets,$30 Golden Gauntlets +Cheat0_N=This cheat allows you to have the max Rupees to the Wallet you currently Hold +Cheat2_N=do not use under or in water +Cheat3_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal +Cheat4_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal +Cheat10_N=This changes what you are wearing,once you have enabled the code press Start & then start again. +Cheat45_N=This modifies the equipment you are carrying. +Cheat46_N=This modifies the equipment you are carrying. +Cheat64="Language Select",80119D61 00?? +Cheat64_O=$00 English,$01 German,$02 French + +//---- + +[1D4136F3-AF63EEA9-C:50] +Name=Legend of Zelda, The - Ocarina of Time - Master Quest (E) +Cheat0="Infinite\Rupees",81119D04 0001 +Cheat1="Max\Double Defense Power",80118A07 0014 +Cheat1_N=This gives you White Border Hearts +Cheat2="Use Any Item In Any House",81119B5A 0000,81119B5C 0000 +Cheat3="Have\All Equipment",811189D4 7777 +Cheat5="Max\Heart Containers",81118966 0140 +Cheat6="Max\Gold Skulltulas Killed",80118A09 0064 +Cheat7="Time of Day Modifier",81118944 ???? +Cheat7_O=$4000 At Sunrise,$5800 Daylight Out,$7000 Very Bright Out,$C000 At Sunset,$D000 Fairly Dark +Cheat8="Infinite\Energy",81118968 0140 +Cheat9="Infinite\Magic",D0118971 0008,80118972 0001,80118974 0001,8011896B 0060 +Cheat10="Tunic & Boot Options",801189A8 00?? +Cheat11="Infinite\Deku Sticks",801189C4 0009 +Cheat12="Infinite\Deku Nuts",801189C5 0009 +Cheat13="Infinite\Bombs",801189C6 0009 +Cheat14="Infinite\Arrows",801189C7 0009 +Cheat15="Infinite\Deku Seeds",801189CA 0009 +Cheat16="Infinite\Bombchu's",801189CC 0009 +Cheat17="Infinite\Magic Beans",801189D2 0009 +Cheat18="Infinite\Big Key,Small Keys,Compass,& Map",801189E0 0007,801189E1 0007,801189E2 0007,801189E3 0007,801189E4 0007,801189E5 0007,801189E6 0007,801189E7 0007,801189E8 0007,801189E9 0007,801189EA 0007,801189F7 0009,801189F8 0009,801189F9 0009,801189FA 0009,801189FB 0009,80118A01 0009,80118A04 0009,801189FF 0009 +Cheat19="Have\Ocarina",801189B3 00?? +Cheat20="Have\Boomerang",801189B8 000E +Cheat21="Have\Lens of Truth",801189B9 000F +Cheat22="Have\Megaton Hammer",801189BB 0011 +Cheat23="Have\Deku Stick",801189AC 0000 +Cheat24="Have\Deku Nut",801189AD 0001 +Cheat25="Have\Bombs",801189AE 0002 +Cheat26="Have\Fairy Bow",801189AF 0003 +Cheat27="Have\Fairy Slingshot",801189B2 0006 +Cheat28="Have\Bombchu",801189B4 0009 +Cheat29="Have\Arrows\Fire Arrow",801189B0 0004 +Cheat30="Have\Arrows\Ice Arrow",801189B6 000C +Cheat31="Have\Arrows\Light Arrow",801189BC 0012 +Cheat32="Have\Hookshot",801189B5 00?? +Cheat33="Have\Magic Beans",801189BA 0010 +Cheat34="Have\Magic\Fairie's Wind",801189B7 000D +Cheat35="Have\Magic\Nayru's Love",801189BD 0013 +Cheat36="Have\Magic\Din's Fire",801189B1 0005 +Cheat37="Bottles\Bottle 1 Modifier",801189BE 00?? +Cheat38="Bottles\Bottle 2 Modifier",801189BF 00?? +Cheat39="Bottles\Bottle 3 Modifier",801189C0 00?? +Cheat40="Bottles\Bottle 4 Modifier",801189C1 00?? +Cheat41="Trading\Adult Link Item",801189C2 00?? +Cheat42="Trading\Young Link Item",801189C3 00?? +Cheat43="Turn Giant's Knife Into Biggoron's Sword",80118976 0001 +Cheat44="Have Quiver (Holds 30)",801189D9 0001 +Cheat45="Equipment Modifier 1",801189DA 00?? +Cheat46="Equipment Modifier 2",801189DB 00?? +Cheat47="Warp Song Location\Minuet of Forest & Serenade of Water",80119CCD 00?? +Cheat47_O=$00 Sacred Forest Meadow,$04 Lake Hylia,$15 Inside Jabu Jabu's Belly,$18 Dodongo's Cavern,$68 Inside The Deku Tree +Cheat47_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat48="Warp Song Location\Prelude of Light & Nocturne of Shadow",80119CCD 00?? +Cheat48_O=$03 Kakariko Windmill,$07 Bombchu Bowling Alley,$0F Zelda & Impa Flee,$14 Kakariko Village,$17 Ganon,Final Battle,$1D Top of Ganon's Tower,$28 Bombchu Shop,$2C Bazaar,$30 Happy Mask Shop,$34 Ganon's Tower,$38 Ganon's Castle,$4C Inside Spirit Door,$6C Burning Castle,$50 House of Skulltula,$64 Death Mountain Trail,$68 Graveyard,$70 Thieves' Hideout,$74 Royal Family's Tomb,$78 Great Fairy Fountain 1,$84 Forest Temple,Room With Falling Floor,$88 Great Fairy Fountain 2,$99 Grotto 01,$9D Grotto 02,$A4 Grotto 04,$A8 Grotto 05,$B3 Grotto 06,$B0 Grotto 07,$B4 Grotto 08,$B8 Grotto 09,$C3 Grotto 10,$C0 Grotto 11,$C4 Grotto 12,$FC Grotto 13,$D3 Bottom of the Well,$D0 Lon Lon Ranch Shed,$D3 Lon Lon Ranch Outside Shed,$D8 Ice Cavern,$E3 Outside Cow Pen,$E0 Lost Woods Bridge,$E4 Lon Lon Ranch Chicken Room,$E8 In Front of Deku Tree,$EB Spirit Temple Boss,$F1 Castle Courtyard,In Front of Zelda,$F4 Temple of Time,$F8 Gerudo Fortress Jail +Cheat48_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat49="Warp Song Location\Bolero of Fire",80119CCD 00?? +Cheat49_O=$03 Castle Courtyard,$0B Dodongo's Cavern Boss,$10 Inside The Deku Tree Boss,$14 Shadow Temple Boss,$17 Water Temple Boss,$1C Ganon's Castle Tower,$1F Ganon First Battle,$28 Ganon's Castle Room Before Ganon,$2B Inside Ganon's Castle Room With Pillar,$2F Lon Lon Ranch,$33 Mido's House,$37 Saria's House,$4B Bearded Man's House,$40 Top of Ganon's Castle,$47 Outside Saria's House,$4F Dampe's Race,$57 Kokiri Forest,$5B Top of Death Mountain,$5F Fishing Pond,$68 Inside Ganon's Castle,$7F Hyrule Castle Gate,$BA Top of Ganon's Tower,$C2 Great Fairy Fountain,$D6 Lost Woods Goron Entrance,$DA Lost Woods River Entrance,$DE Lost Woods Bridge Field Entrance,$E3 Goron City Lost Woods Entrance,$F6 Death Mountain Crater,$FD Ganon's Castle +Cheat49_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat50="Warp Song Location\Requiem of Spirit",80119CCD 00?? +Cheat50_O=$05 Lake Hylia,$08 Zora's Domain,$18 Gerudo Valley,$1E Lost Woods,$28 Gerudo Fortress,$30 Haunted Wasteland,$34 Ganon's Castle Inside Burning Castle,$38 Hyrule Castle,$3A Ganon's Castle,$3D Death Mountain Trail,$4D Goron City,$65 Fire Temple,$69 Forest Temple,$6E Shooting Gallery,$79 Ganon's Castle Inside Burning Castle,$7E Kakariko Village Entrance,$7B Zora's River Entrance,$85 Kokiri Forest Entrance,$8A Lake Hyrule Entrance,$8E Gerudo Valley Entrance,$92 Death Mountain Trail Entrance,$95 Graveyard Entrance,$9E Zora's Domain Entrance,$A2 Zora's Fountain Entrance,$BA Goron City Entrance,$BE Death Mountain Trail,$C1 Goron City,$C5 Lakeside Laboratory,$C9 Top of Ganon's Castle,$CD Hyrule Market (Child Link's),$CF Hyrule Market (Adult Link's),$F1 Desert Colossus,$FA Lon Lon Ranch Entrance,$FD Hyrule Field +Cheat50_N=For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. +Cheat51="Nayru's Love is Always",81119D00 ???? +Cheat51_O=$0000 OFF,$FFFF ON +Cheat51_N=For this to work On Or off, you have to walk through a Doorway to activate the Change. +Cheat52="Infinite\Timers\All Other Timers",8011B9A1 0032 +Cheat52_N=This cheat works on all Race Timers not the final Boss and Under Water with iron Boots etc. +Cheat53="Epona\Max Carrots\Lon Lon Raunch",801F1A68 0005,801EE508 0005 +Cheat53_N=This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona +Cheat54="Infinite\Timers\Escape From Gannons Tower",80119D0D 00B4 +Cheat54_N=This cheat works only on The Final Boss. +Cheat55="Beta\Play Beta Quest Worlds",D011BB71 0000,80119D4B 00?? +Cheat55_O=$00 World 01,$01 World 02,$02 World 03,$03 World 04,$04 World 05,$07 World 06,$08 World 07,$16 World 08 +Cheat55_N=Put on the code on load up,& then press reset (F1) you will be in Beta Mode,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. +Cheat56="Level Select",D01C6E35 0000,8111893A ???? +Cheat56_O=$0000 Inside the Deku Tree,$0004 Dodongo's Cavern,$0008 Gerudo Training Ground,$000C Below The Phantom Gannon Boss,$0010 Water Temple,$0027 Inside Jabu-Jabu's Belly,$002C Royal Family's Tomb,$0036 Shoadow Temple,$0042 Lakeside Laboratory,$0052 Temple Of Time,$006C ? +Cheat57="Language Select",80119D41 00?? +Cheat57_O=$00 English,$01 German,$02 French +Cheat58="Press L\To Levitate",D011BB11 0020,811D93D0 40CB +Cheat59="Press L\For Infinite Hover Boots",D011BB11 0020,811D9BF2 000D +Cheat60="Instant Step Hoover Boots",D011BB11 0020,811D93D0 40CB,D011BB11 0000,811D9BF2 000D,801189A8 00?? +Cheat60_O=$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat61="Beta\Specific things lean",8002397C 0001 +Cheat61_N=This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest World 01) +Cheat62="Beta\Appear in Strange Places (Hold R)",D01C681D 0010,81119C9E 0001 +Cheat62_N=If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. +Cheat63="Beta\Interface always off/on",80119821 00FF,80119C97 00?? +Cheat63_O=$00 Off,$01 On +Cheat63_N=If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset. +Cheat64="Always Have Wallet Size",801189DA 00?? +Cheat64_O=$47 Kid Wallet (Holds 99),$57 Adult Wallet (Holds 200),$67 Giant Wallet (Holds 500) +Cheat10_O=$11 Kokiri Tunic & Kokiri Boots,$12 Goron Tunic & Kokiri Boots,$13 Zora Tunic & Kokiri Boots,$14 Black Tunic & Kokiri Boots,$15 White Tunic & Kokiri Boots,$16 Yellow Tunic & Kokiri Boots,$21 Kokiri Tunic & Iron Boots,$22 Goron Tunic & Iron Boots,$23 Zora Tunic & Iron Boots,$24 Black Tunic & Iron Boots,$25 White Tunic & Iron Boots,$26 Yellow Tunic & Iron Boots,$31 Kokiri Tunic & Hover Boots,$32 Goron Tunic & Hover Boots,$33 Zora Tunic & Hover Boots,$34 Black Tunic & Hover Boots,$35 White Tunic & Hover Boots,$36 Yellow Tunic & Hover Boots +Cheat19_O=$07 Fairy Ocarina,$08 Ocarina Of Time +Cheat32_O=$0A Hookshot,$0B Longshot +Cheat37_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat38_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat39_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat40_O=$14 Empty Bottle,$15 Red Potion,$16 Green Potion,$17 Blue Potion,$18 Bottled Fairy,$19 Fish,$1A Lon Lon Milk,$1B Letter,$1C Blue Fire,$1D Bug,$1E Big Poe,$1F Lon Lon Milk (Half),$20 Poe +Cheat41_O=$2D Pocket Egg,$2E Pocket Cucco,$2F Cojiro,$30 Odd Mushroom,$31 Odd Potion,$32 Poacher's Saw,$33 Goron's Sword (Broken),$34 Prescription,$35 Eyeball Frog,$36 Eye Drops,$37 Claim Check +Cheat42_O=$21 Weird Egg,$22 Chicken,$23 Zelda's Letter,$24 Keaton Mask,$25 Skull Mask,$26 Spooky Mask,$27 Bunny Hood,$28 Goron Mask,$29 Zora Mask,$2A Gerudo Mask,$2B Mask of Truth,$2C SOLD OUT +Cheat45_O=$02 Silver Scale,$04 Golden Scale,$06 Giant's Knife (Broken),$35 Black Gauntlets,$40 Bullet Bag (Holds 30),$80 Bullet Bag (Holds 40),$C0 Bullet Bag (Holds 50) +Cheat46_O=$08 Bomb Bag (Holds 20),$10 Bomb Bag (Holds 30),$18 Bomb Bag (Holds 40),$20 Goron's Bracelet,$28 Silver Gauntlets,$30 Golden Gauntlets +Cheat0_N=This cheat allows you to have the max Rupees to the Wallet you currently Hold +Cheat2_N=do not use under or in water +Cheat3_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal +Cheat10_N=This changes what you are wearing,once you have enabled the code press Start & then start again. +Cheat45_N=This modifies the equipment you are carrying. +Cheat46_N=This modifies the equipment you are carrying. +Cheat58_N=Press L To Levitate & Let go to land +Cheat59_N=Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on +Cheat60_N=Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. +Cheat4="Have\All Quest/Status Items",801189DD 00??,801189DE 00??,801189DF 00?? +Cheat4_O=$FF On,$00 Off +Cheat4_N=This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal +Cheat65="Have\Status Heart Containers",801189DC 00?? +Cheat65_O=$30 On,$00 Off +Cheat64="Language Select",80119D41 00?? +Cheat64_O=$00 English,$01 German,$02 French + +//---- + +[60460680-305F0E72-C:50] +Name=Lode Runner 3-D (E) +Cheat0="Infinite Lives",81157EAE 0063 +Cheat1="Access Secret Worlds",81152946 0064 +Cheat2="Access All Navigation Cards",80157E9B 0005 +Cheat3="Max & Total Gold",80157E4B 0063,80157E4F 0063 +Cheat4="Access All In-Game Cheats",81157E46 000F,81157E56 FFFF +Cheat4_N=Pause Gameplay To Access + +//---- + +[0AA0055B-7637DF65-C:50] +Name=DAFFY DUCK STARRING +Cheat6="Tennis CPU Can't Score",801D7B4B 0000 +Cheat7="Infinite\Atoms",80159667 00C8 +Cheat1="Infinite\Health",80026DE3 0004 +Cheat0="Infinite\Lives",80026DE7 0063 +Cheat8="Infinite\Quarks",80159663 00C8 +Cheat2="Infinite Time\Basketball Gym",8029F901 0042 +Cheat4="Infinite Time\Cecil's Flying Toys",802A5575 0042 +Cheat5="Infinite Time\Slippery Slide",802A7E8D 0042 +Cheat3="Infinite Time\Flight Test Range",802BA3A9 0042 + +//---- + +[1145443D-11610EDB-C:50] +Name=Mace - The Dark Age (E) +Cheat0="Infinite Health Player 1",8008B287 0064 +Cheat1="Infinite Health Player 2",8008AEFF 0064 +Cheat2="Extra Characters",8007FA98 0001 +Cheat3="Ned The Janitor",8013C281 0001 +Cheat4="Infinite\Time",8113C5BA 0B9E +Cheat5="Infinite\Time To Choose Character",D0137ABE 0001,81137ABE 02A2 +Cheat6="Infinite\Continues",8015183B 0006 +Cheat7="One Hit Death\Player 1",D008B287 0064,8008B287 0001 +Cheat8="One Hit Death\Player 2",D008AEFF 0064,8008AEFF 0001 +Cheat9="Play As Options\Player 1",8113C6E2 ???? +Cheat9_O=$3334 Executioner,$335C Lord Deimos,$33C4 Ragnar,$33AC Koyasha,$33D4 Taria,$33FC AL-Rashid,$3424 Takeshi,$344C Mordoskull,$3474 Xiao Lang,$449C Namira,$358C Dregan,$353C Hellnight,$34C4 Big Guy with spikes and a skull staff,$3514 Monk dude with sword,$3564 Pojo The Chicken,$35B4 War Mech, +Cheat10="Play As Options\Player 2",8113C6DE ???? +Cheat10_O=$3334 Executioner,$335C Lord Deimos,$33C4 Ragnar,$33AC Koyasha,$33D4 Taria,$33FC AL-Rashid,$3424 Takeshi,$344C Mordoskull,$3474 Xiao Lang,$449C Namira,$358C Dregan,$353C Hellnight,$34C4 Big Guy with spikes and a skull staff,$3514 Monk dude with sword,$3564 Pojo The Chicken,$35B4 War Mech, +Cheat11="Fight With Bunny Slippers On",81138914 0100 + +//---- + +[62E957D0-7FC15A5D-C:50] +Name=MarioGolf64 +Cheat0="Unlock all Characters and Birdy Badges",50006C01 0000,801304A4 0001,50000901 0000,80130518 0001,50000901 0000,80130521 0001 +Cheat0_N=Unlocks Metal Mario, Maple, Luigi, Sonny, Wario, Harry, Bowser, Yoshi, Mario and DK +Cheat1="Wind Speed Select",800BACA1 00?? +Cheat1_O=$00 0 MPH,$14 20 MPH +Cheat2="Weather Select",800BACAB 00?? +Cheat2_O=$00 Never Rains,$01 Always Rains +Cheat3="All Golf Courses Unlocked",80130FED 0001 +Cheat4="Always On 1st Stroke",801B74F3 0000 +Cheat5="Infinite Power Shots",801B74F8 0042 + +//---- + +[C3B6DE9D-65D2DE76-C:50] +Name=Mario Kart 64 (E) (V1.0) +Cheat0="Infinite Items",8016609D 00?? +Cheat0_O=$0D Double Mushroom,$09 Fake Item Box,$0B Ghost,$0A Invincible Star,$08 Lightning,$01 Single Banana,$03 Single Green Shell,$0C Single Mushroom,$05 Single Red Shell,$0F Super Mushroom,$04 Triple Green Shell,$0E Triple Mushroom,$06 Triple Red Shell,$02 Banana Bunch,$07 Blue Spiny Shell +Cheat1="Off-Road Tires\Player 1",50000418 0000,810F6C74 0140 +Cheat2="Off-Road Tires\Player 2",50000418 0000,810F7A4C 0100 +Cheat3="Off-Road Tires\Player 3",50000418 0000,810F8824 0100 +Cheat4="Off-Road Tires\Player 4",50000418 0000,810F9644 0100 +Cheat5="Have Bonus Mode and All Gold Cups",50000402 0000,8018EE50 00?? +Cheat5_O=$00 Off,$FF On +Cheat6="Press GS\For Full Debug Menu",8818EF2F 0002 +Cheat6_N=Press GS at the Press Start Menu to access the Debug Menu +Cheat7="Press L To Levitate\Player 1",D00F6A55 0020,810F6B08 4000 +Cheat8="Press L To Levitate\Player 2",D00F6A65 0020,810F78E0 4000 +Cheat9="Press L To Levitate\Player 3",D00F6A75 0020,810F86B8 4000 +Cheat10="Press L To Levitate\Player 4",D00F6A85 0020,810F9490 4000 + +//---- + +[2577C7D4-D18FAAAE-C:50] +Name=Mario Kart 64 (E) (V1.1) +Cheat0="Infinite Items",80165FBD 00?? +Cheat0_O=$0D Double Mushroom,$09 Fake Item Box,$0B Ghost,$0A Invincible Star,$08 Lightning,$01 Single Banana,$03 Single Green Shell,$0C Single Mushroom,$05 Single Red Shell,$0F Super Mushroom,$04 Triple Green Shell,$0E Triple Mushroom,$06 Triple Red Shell,$02 Banana Bunch,$07 Blue Spiny Shell +Cheat1="Have Bonus Mode and All Gold Cups",50000402 0000,8018ED70 00?? +Cheat1_O=$00 Off,$FF On +Cheat2="Off-Road Tires\Player 1",50000418 0000,810F6B94 0140 +Cheat3="Off-Road Tires\Player 2",50000418 0000,810F796C 0100 +Cheat4="Off-Road Tires\Player 3",50000418 0000,810F8744 0100 +Cheat5="Off-Road Tires\Player 4",50000418 0000,810F951C 0100 +Cheat6="Press GS\For Full Debug Menu",8818EE4F 0002 +Cheat6_N=Press GS at the Press Start Menu to access the Debug Menu +Cheat7="Press L To Levitate\Player 1",D00F6975 0020,810F6A28 4000 +Cheat8="Press L To Levitate\Player 2",D00F6985 0020,810F7800 4000 +Cheat9="Press L To Levitate\Player 3",D00F6995 0020,810F85D8 4000 +Cheat10="Press L To Levitate\Player 4",D00F69A5 0020,810F93B0 4000 + +//---- + +[9C663069-80F24A80-C:50] +Name=Mario Party (E) +Cheat0="Top Left Character\Coin Options",800FFAA9 00?? +Cheat1="Top Left Character\Star Options",800FFAAC 00?? +Cheat2="Top Right Character\Coin Options",800FFAD9 00?? +Cheat3="Top Right Character\Star Options",800FFADC 00?? +Cheat4="Lower Left Character\Coin Options",800FFB09 00?? +Cheat5="Lower Left Character\Star Options",800FFB0C 00?? +Cheat6="Lower Right Character\Coin Options",800FFB39 00?? +Cheat7="Lower Right Character\Star Options",800FFB3C 00?? +Cheat8="Top Left Character\Dice Always",800DDC92 00?? +Cheat9="Top Right Character\Dice Always",800DDCD6 00?? +Cheat10="Lower Left Character\Dice Always",800DDD1A 00?? +Cheat11="Lower Right Character\Dice Always",800DDD5E 00?? +Cheat12="Mini Game\Unlimited 99 lives",800FFF58 0063 +Cheat13="Mini Game\Max 99 Coins",800FFF61 0063 +Cheat0_O=$00 0 Coins,$0A 10 Coins,$64 100 Coins,$FF 255 Coins +Cheat1_O=$00 0 Stars,$64 99 Stars +Cheat2_O=$00 0 Coins,$0A 10 Coins,$64 100 Coins,$FF 255 Coins +Cheat3_O=$00 0 Stars,$64 99 Stars +Cheat4_O=$00 0 Coins,$0A 10 Coins,$64 100 Coins,$FF 255 Coins +Cheat5_O=$00 0 Stars,$64 99 Stars +Cheat6_O=$00 0 Coins,$0A 10 Coins,$64 100 Coins,$FF 255 Coins +Cheat7_O=$00 0 Stars,$64 99 Stars +Cheat8_O=$00 Rolls In Random,$01 Rolls In 1,$02 Rolls In 2,$03 Rolls In 3,$04 Rolls In 4,$05 Rolls In 5,$06 Rolls In 6,$07 Rolls In 7,$08 Rolls In 8,$09 Rolls In 9,$0A Rolls In 10 +Cheat9_O=$00 Rolls In Random,$01 Rolls In 1,$02 Rolls In 2,$03 Rolls In 3,$04 Rolls In 4,$05 Rolls In 5,$06 Rolls In 6,$07 Rolls In 7,$08 Rolls In 8,$09 Rolls In 9,$0A Rolls In 10 +Cheat10_O=$00 Rolls In Random,$01 Rolls In 1,$02 Rolls In 2,$03 Rolls In 3,$04 Rolls In 4,$05 Rolls In 5,$06 Rolls In 6,$07 Rolls In 7,$08 Rolls In 8,$09 Rolls In 9,$0A Rolls In 10 +Cheat11_O=$00 Rolls In Random,$01 Rolls In 1,$02 Rolls In 2,$03 Rolls In 3,$04 Rolls In 4,$05 Rolls In 5,$06 Rolls In 6,$07 Rolls In 7,$08 Rolls In 8,$09 Rolls In 9,$0A Rolls In 10 +Cheat0_N=If you want to have full 255 Coins,1st use the 100 Option then put on 255. this will stop the numbers from changing & spoiling the result. +Cheat8_N=With this option you can calculate exactly how many you need to get on the position of your choice. +Cheat9_N=With this option you can calculate exactly how many you need to get on the position of your choice. +Cheat10_N=With this option you can calculate exactly how many you need to get on the position of your choice. +Cheat11_N=With this option you can calculate exactly how many you need to get on the position of your choice. + +//---- + +[C5674160-0F5F453C-C:50] +Name=Mario Party 3 (E) +Cheat0="Top Left Character\Coin Options",810D0F92 00?? +Cheat1="Top Left Character\Star Options",800D0F96 00?? +Cheat2="Top Right Character\Coin Options",810D0FCA 00?? +Cheat3="Top Right Character\Star Options",800D0FCE 00?? +Cheat4="Lower Left Character\Coin Options",810D1002 00?? +Cheat5="Lower Left Character\Star Options",800D1006 00?? +Cheat6="Lower Right Character\Coin Options",810D103A 00?? +Cheat7="Lower Right Character\Star Options",800D103E 00?? +Cheat8="Top Left Character\Dice Always",800CDA55 00?? +Cheat9="Top Right Character\Dice Always",800CDAA1 00?? +Cheat10="Lower Left Character\Dice Always",800CDAED 00?? +Cheat11="Lower Right Character\Dice Always",800CDB39 00?? +Cheat0_O=$00 0 Coins,$0A 10 Coins,$64 100 Coins,$FF 255 Coins +Cheat1_O=$00 0 Stars,$64 99 Stars +Cheat2_O=$00 0 Coins,$0A 10 Coins,$64 100 Coins,$FF 255 Coins +Cheat3_O=$00 0 Stars,$64 99 Stars +Cheat4_O=$00 0 Coins,$0A 10 Coins,$64 100 Coins,$FF 255 Coins +Cheat5_O=$00 0 Stars,$64 99 Stars +Cheat6_O=$00 0 Coins,$0A 10 Coins,$64 100 Coins,$FF 255 Coins +Cheat7_O=$00 0 Stars,$64 99 Stars +Cheat8_O=$00 Rolls In Random,$01 Rolls In 1,$02 Rolls In 2,$03 Rolls In 3,$04 Rolls In 4,$05 Rolls In 5,$06 Rolls In 6,$07 Rolls In 7,$08 Rolls In 8,$09 Rolls In 9,$0A Rolls In 10 +Cheat9_O=$00 Rolls In Random,$01 Rolls In 1,$02 Rolls In 2,$03 Rolls In 3,$04 Rolls In 4,$05 Rolls In 5,$06 Rolls In 6,$07 Rolls In 7,$08 Rolls In 8,$09 Rolls In 9,$0A Rolls In 10 +Cheat10_O=$00 Rolls In Random,$01 Rolls In 1,$02 Rolls In 2,$03 Rolls In 3,$04 Rolls In 4,$05 Rolls In 5,$06 Rolls In 6,$07 Rolls In 7,$08 Rolls In 8,$09 Rolls In 9,$0A Rolls In 10 +Cheat11_O=$00 Rolls In Random,$01 Rolls In 1,$02 Rolls In 2,$03 Rolls In 3,$04 Rolls In 4,$05 Rolls In 5,$06 Rolls In 6,$07 Rolls In 7,$08 Rolls In 8,$09 Rolls In 9,$0A Rolls In 10 +Cheat0_N=If you want to have full 255 Coins,1st use the 100 Option then put on 255. this will stop the numbers from changing & spoiling the result. +Cheat8_N=With this option you can calculate exactly how many you need to get on the position of your choice. +Cheat9_N=With this option you can calculate exactly how many you need to get on the position of your choice. +Cheat10_N=With this option you can calculate exactly how many you need to get on the position of your choice. +Cheat11_N=With this option you can calculate exactly how many you need to get on the position of your choice. + +//---- + +[839F3AD5-406D15FA-C:50] +Name=MarioTennis +Cheat2="Score\Player 1",80152DFA 00?? +Cheat3="Score\Player 2",80152DFB 00?? +Cheat2_O=$00 0,$01 15,$02 30,$03 40 +Cheat3_O=$00 0,$01 15,$02 30,$03 40 +Cheat0="Have All\Characters Available",810657A0 FFFF +Cheat1="Have All\Courts Available",810657A4 FFFF + +//---- + +[DED0DD9A-E78225A7-C:50] +Name=MICKEY USA PAL +Cheat0="Play As",800D33D1 00?? +Cheat0_O=$00 Mickey Mouse,$01 Daisy Duck,$02 Goofy,$03 Pete,$04 Minnie Mouse,$05 Donald Duck,$06 Huey,$07 Dewey,$08 Louie,$09 Lugwig Von Drake +Cheat1="Traffic Troubles\Indianapolis\Max Tokens",801B4332 0063 +Cheat2="Traffic Troubles\San Fransisco\Max Tokens",801B7602 0063 +Cheat3="Traffic Troubles\New Mexico\Max Tokens",801B5902 0063 +Cheat4="Traffic Troubles\Grand Canyon\Max Tokens",801B8CF2 0063 +Cheat5="Motor Way Mania\Los Angeles\Max Tokens",801B3792 0063 +Cheat6="Motor Way Mania\Alaska\Max Tokens",801B3F22 0063 +Cheat7="Motor Way Mania\Las Vegas\Max Tokens",801B85B2 0063 +Cheat8="Motor Way Mania\Philadelphia\Max Tokens",801B9502 0063 +Cheat9="Freewayphobia\Dakota\Max Tokens",801B2CB2 0063 +Cheat10="Freewayphobia\Seattle\Max Tokens",801B5892 0063 +Cheat11="Freewayphobia\New York\Max Tokens",801B4FB2 0063 +Cheat12="Freewayphobia\Chicago\Max Tokens",801B7AE2 0063 +Cheat13="Victory Vehicles\Yellowstone\Max Tokens",801B2F62 0063 +Cheat14="Victory Vehicles\Washington DC\Max Tokens",801BD102 0063 +Cheat15="Victory Vehicles\Everglades\Max Tokens",801B56C2 0063 +Cheat16="Victory Vehicles\Malibu\Max Tokens",801B7152 0063 +Cheat17="Frantic Finale\Hawaii\Max Tokens",801B7B12 0063 +Cheat18="Frantic Finale\Oregon\Max Tokens",801B44E2 0063 +Cheat19="Frantic Finale\Texas\Max Tokens",801B4C82 0063 +Cheat20="Frantic Finale\Colorado\Max Tokens",801B7432 0063 +Cheat21="Level Select",801AD159 00?? +Cheat21_O=$00 Traffic Troubles,$01 Motor Way Mania,$02 Freewayphobia,$03 Vitory Vehicles,$04 Frantic Finale,$05 Time Trial,$06 Practice,$07 Contest,$08 Options +Cheat22="Difficulty Select",8007C1C0 00?? +Cheat22_O=$00 Amateur,$01 Intermediate,$02 Professional,$03 Mirror Mode +Cheat23="Unlock Everything",800D3478 008F,800D3479 0094,800D347A 0003,800D347C 0001,800D347F 0080,50000502 0000,800D3480 0009,50000502 0000,800D3481 0024,800D348A 0015,800D348B 007F,800D348C 0001,800D348D 00FF,800D348E 0004,800D348F 0022 +Cheat23_N=This will unlock all characters, tracks, mirror mode, all in-game cheats, postcards, pluto's collar and give you all Trophies for every track and difficulties. To have this cheat save to mempak, enable it and then go into the Options Menu and disable the cheat. Go to the Wide-Screen Settings and Change it to Wide-Screen [16.9] and then the B button to get back to Wide-Screen Settings, now go back into Wide-Screen [16.9] and change it back to Normal [4.3].and press the B button until you come back to the main Options Menu.Close the game and load it again to see everything saved to the Mempak and unlocked. +Cheat24="Always 1st & final time 00:00.00",50000301 0000,801CE959 0000 +Cheat24_N=All Levels +Cheat25="Traffic Troubles\Indianapolis\Always Have Shield Shell",801B430B 00FF +Cheat26="Traffic Troubles\San Fransisco\Always Have Shield Shell",801B75DB 00FF +Cheat27="Traffic Troubles\New Mexico\Always Have Shield Shell",801B58DB 00FF +Cheat28="Traffic Troubles\Grand Canyon\Always Have Shield Shell",801B8CCB 00FF +Cheat29="Motor Way Mania\Los Angeles\Always Have Shield Shell",801B207B 00FF +Cheat30="Motor Way Mania\Alaska\Always Have Shield Shell",801B280B 00FF +Cheat31="Motor Way Mania\Las Vegas\Always Have Shield Shell",801B6E9B 00FF +Cheat32="Motor Way Mania\Philadelphia\Always Have Shield Shell",801B7DEB 00FF +Cheat33="Freewayphobia\Dakota\Always Have Shield Shell",801B159B 00FF +Cheat34="Freewayphobia\Seattle\Always Have Shield Shell",801B417B 00FF +Cheat35="Freewayphobia\New York\Always Have Shield Shell",801B4A5B 00FF +Cheat36="Freewayphobia\Chicago\Always Have Shield Shell",801B758B 00FF +Cheat37="Victory Vehicles\Yellowstone\Always Have Shield Shell",801B2A0B 00FF +Cheat38="Victory Vehicles\Washington DC\Always Have Shield Shell",801BCBAB 00FF +Cheat39="Victory Vehicles\Everglades\Always Have Shield Shell",801B516B 00FF +Cheat40="Victory Vehicles\Malibu\Always Have Shield Shell",801B6BFB 00FF +Cheat41="Frantic Finale\Hawaii\Always Have Shield Shell",801B75BB 00FF +Cheat42="Frantic Finale\Oregon\Always Have Shield Shell",801BABEB 00FF +Cheat43="Frantic Finale\Texas\Always Have Shield Shell",801BB38B 00FF +Cheat44="Frantic Finale\Colorado\Always Have Shield Shell",801BDB3B 00FF +Cheat45="Re-name Characters\Mickey\Letter 1",801E39B9 00?? +Cheat45_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat46="Re-name Characters\Mickey\Letter 2",801E39BA 00?? +Cheat46_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat47="Re-name Characters\Mickey\Letter 3",801E39BB 00?? +Cheat47_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat48="Re-name Characters\Mickey\Letter 4",801E39BC 00?? +Cheat48_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat49="Re-name Characters\Mickey\Letter 5",801E39BD 00?? +Cheat49_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat50="Re-name Characters\Mickey\Letter 6",801E39BE 00?? +Cheat50_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat51="Re-name Characters\Minnie\Letter 1",801E39C0 00?? +Cheat51_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat52="Re-name Characters\Minnie\Letter 2",801E39C1 00?? +Cheat52_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat53="Re-name Characters\Minnie\Letter 3",801E39C2 00?? +Cheat53_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat54="Re-name Characters\Minnie\Letter 4",801E39C3 00?? +Cheat54_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat55="Re-name Characters\Minnie\Letter 5",801E39C4 00?? +Cheat55_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat56="Re-name Characters\Minnie\Letter 6",801E39C5 00?? +Cheat56_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat57="Re-name Characters\Donald\Letter 1",801E39C7 00?? +Cheat57_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat58="Re-name Characters\Donald\Letter 2",801E39C8 00?? +Cheat58_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat59="Re-name Characters\Donald\Letter 3",801E39C9 00?? +Cheat59_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat60="Re-name Characters\Donald\Letter 4",801E39CA 00?? +Cheat60_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat61="Re-name Characters\Donald\Letter 5",801E39CB 00?? +Cheat61_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat62="Re-name Characters\Donald\Letter 6",801E39CC 00?? +Cheat62_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat63="Re-name Characters\Daisy\Letter 1",801E39CE 00?? +Cheat63_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat64="Re-name Characters\Daisy\Letter 2",801E39CF 00?? +Cheat64_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat65="Re-name Characters\Daisy\Letter 3",801E39D0 00?? +Cheat65_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat66="Re-name Characters\Daisy\Letter 4",801E39D1 00?? +Cheat66_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat67="Re-name Characters\Daisy\Letter 5",801E39D2 00?? +Cheat67_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat68="Re-name Characters\Goofy\Letter 1",801E39D4 00?? +Cheat68_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat69="Re-name Characters\Goofy\Letter 2",801E39D5 00?? +Cheat69_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat70="Re-name Characters\Goofy\Letter 3",801E39D6 00?? +Cheat70_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat71="Re-name Characters\Goofy\Letter 4",801E39D7 00?? +Cheat71_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat72="Re-name Characters\Goofy\Letter 5",801E39D8 00?? +Cheat72_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat73="Re-name Characters\Pete\Letter 1",801E39DA 00?? +Cheat73_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat74="Re-name Characters\Pete\Letter 2",801E39DB 00?? +Cheat74_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat75="Re-name Characters\Pete\Letter 3",801E39DC 00?? +Cheat75_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat76="Re-name Characters\Pete\Letter 4",801E39DD 00?? +Cheat76_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat77="Re-name Characters\Huey\Letter 1",801E39DF 00?? +Cheat77_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat78="Re-name Characters\Huey\Letter 2",801E39E0 00?? +Cheat78_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat79="Re-name Characters\Huey\Letter 3",801E39E1 00?? +Cheat79_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat80="Re-name Characters\Huey\Letter 4",801E39E2 00?? +Cheat80_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat81="Re-name Characters\Dewey\Letter 1",801E39E4 00?? +Cheat81_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat82="Re-name Characters\Dewey\Letter 2",801E39E5 00?? +Cheat82_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat83="Re-name Characters\Dewey\Letter 3",801E39E6 00?? +Cheat83_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat84="Re-name Characters\Dewey\Letter 4",801E39E7 00?? +Cheat84_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat85="Re-name Characters\Dewey\Letter 5",801E39E8 00?? +Cheat85_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat86="Re-name Characters\Louie\Letter 1",801E39EA 00?? +Cheat86_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat87="Re-name Characters\Louie\Letter 2",801E39EB 00?? +Cheat87_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat88="Re-name Characters\Louie\Letter 3",801E39EC 00?? +Cheat88_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat89="Re-name Characters\Louie\Letter 4",801E39ED 00?? +Cheat89_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat90="Re-name Characters\Louie\Letter 5",801E39EE 00?? +Cheat90_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat91="Re-name Characters\Ludwig\Letter 1",801E39F0 00?? +Cheat91_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat92="Re-name Characters\Ludwig\Letter 2",801E39F1 00?? +Cheat92_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat93="Re-name Characters\Ludwig\Letter 3",801E39F2 00?? +Cheat93_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat94="Re-name Characters\Ludwig\Letter 4",801E39F3 00?? +Cheat94_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat95="Re-name Characters\Ludwig\Letter 5",801E39F4 00?? +Cheat95_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat96="Re-name Characters\Ludwig\Letter 6",801E39F5 00?? +Cheat96_O=$00 ,$20 ,$21 !,$22 ",$23 #,$24 ,$25 %,$26 &,$27 ',$28 (,$29 ),$2A *,$2B +,$2C ,$2D -,$2E .,$2F /,$30 0,$31 1,$32 2,$33 3,$34 4,$35 5,$36 6,$37 7,$38 8,$39 9,$3A :,$3B ;,$3C <,$3D =,$3E >,$3F ?,$40 @,$41 A,$42 B,$43 C,$44 D,$45 E,$46 F,$47 G,$48 H,$49 I,$4A J,$4B K,$4C L,$4D M,$4E N,$4F O,$50 P,$51 Q,$52 R,$53 S,$54 T,$55 U,$56 V,$57 W,$58 X,$59 Y,$5A Z,$60 `,$61 st ,$62 nd ,$63 rd ,$64 th ,$67 g,$68 h,$69 i,$6A j,$6B k,$6C l,$6D m,$6E n,$6F o,$70 p,$71 q,$72 r,$73 s,$74 t,$75 u,$76 v,$77 w,$78 x,$79 y,$7A z +Cheat1_N=Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat2_N=Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat3_N=Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat4_N=Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat5_N=Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat6_N=Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat7_N=Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat8_N=Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat9_N=Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat10_N=Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat11_N=Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat12_N=Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat13_N=Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat14_N=Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat15_N=Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat16_N=Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat17_N=Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat18_N=Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat19_N=Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat20_N=Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. +Cheat25_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat26_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat27_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat28_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat29_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat30_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat31_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat32_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat33_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat34_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat35_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat36_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat37_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat38_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat39_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat40_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat41_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat42_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat43_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. +Cheat44_N=Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + +//---- + +[2A49018D-D0034A02-C:50] +Name=Micro Machines 64 Turbo (E) +Cheat0="Always 1st",810BB1F8 0100 +Cheat1="One Lap To Race",810B88DE 0101 +Cheat2="Infinite 255 Lives",800BB1C2 00FF +Cheat3="Access All Tracks",810B88DA 0001 +Cheat4="Always Win Head 2 Head",810BD590 0008 +Cheat5="Always Turbo Level 1",810B4070 3100,810BBD30 0000 +Cheat5_N=In Easy Mode + +//---- + +[418BDA98-248A0F58-C:50] +Name=Mischief Makers +Cheat0="Marina\Infinite Health",810E1120 0BB8 +Cheat1="Teran\Infinite Health",810E5DA0 03E8 +Cheat2="Infinite Max Red Gems",81169C66 25C2 +Cheat3="All Stages & Chapters Unlocked",80163648 003B +Cheat4="All 52 Gold Gems Collected",80163640 0003,80163641 007E,80163642 00FF,80163643 00EF,80163644 00FF,80163645 007F,80163646 00FF,80163647 00FC +Cheat5="Marina\Press A To Levitate",D0128BF4 0080,800E1132 0091 +Cheat6="Teran\Press A To Levitate",D0128BF4 0080,800E5DB2 0091 +Cheat7="Infinite Time to Watch Ending",800E6613 0063 + +//---- + +[2256ECDA-71AB1B9C-C:50] +Name=MISSION IMPOSSIBLE +Cheat0="Invincibility",810864C4 0101 +Cheat1="Infinite\Ammo All Guns",50000610 0000,800A9097 00FF +Cheat2="Infinite\Health",810864C2 FFFF +Cheat3="Access All Levels",8008AA56 0001,8008AD3A 0001,8008A862 0001,8008A876 0001,8008A88A 0001,8008A89E 0001,8008A8B2 0001,8008A8C6 0011,8008A8DA 0021,8008AD4E 0001,8008A916 0011,8008A92A 0041,8008A93E 0021,8008A966 0001,8008A98E 0001,8008AD62 0001,8008A9DE 0001,8008A9F2 0011,8008AA06 0021,8008AD76 0001,8008A7D6 0001,8008A7EA 0001,8008A812 0001 +Cheat4="Freeze All Timers",81093F50 0063,81093F52 0063,81093F54 0063 +Cheat5="Weapon Select",800A90B5 00??,800A90C5 00??,800A90D5 00?? +Cheat5_O=$00 9MM Hi Power,$01 Silenced Pistol,$02 Uzi,$03 Fists,$32 Gas Spray,$36 Blow Torch,$1F Fire Extinguisher,$24 Spray Paint,$27 Electrostunner,$0B Blow Dart Gun,$0C Dart Hand Gun,$2D Mini Rocket Launcher +Cheat6="Walk Through Walls & Objects",80094105 00?? +Cheat6_O=$80 On,$00 Off +Cheat6_N=This will allow you to pass through anything & even walk on water.if you amerge somewhere in the ground just press the A button. + +//---- + +[73036F3B-CE0D69E9-C:50] +Name=Mortal Kombat 4 (E) +Cheat0="Unlimited Energy\Player 1",810FE208 0001,810FE20A 0000 +Cheat1="Unlimited Energy\Player 2",81127084 0001,81127086 0000 +Cheat2="Infinite Run\Player 1",811050FC 0001,811050FE 0000 +Cheat3="Infinite Run\Player 2",811051B0 0001,811051B2 0000 +Cheat4="Play As\Player 1",800FE3C3 00?? +Cheat4_O=$00 Scorpion,$01 Raiden,$02 Sonya,$03 Liu Kang,$04 Sub-Zero,$05 Fujin,$06 Shinnok,$07 Reiko,$08 Quan Chi,$09 Tanya,$0A Reptile,$0B Kai,$0C Jarek,$0D Jax,$0E Johnny Cage,$0F Goro,$11 Noob Saibot +Cheat5="Play As\Player 2",80126FBF 00?? +Cheat5_O=$00 Scorpion,$01 Raiden,$02 Sonya,$03 Liu Kang,$04 Sub-Zero,$05 Fujin,$06 Shinnok,$07 Reiko,$08 Quan Chi,$09 Tanya,$0A Reptile,$0B Kai,$0C Jarek,$0D Jax,$0E Johnny Cage,$0F Goro,$11 Noob Saibot +Cheat6="Choose A Costume\Player 1",8104A612 00?? +Cheat6_O=$00 Normal,$01 First,$02 Second,$03 Third +Cheat7="Choose A Costume\Player 2",8104A616 00?? +Cheat7_O=$00 Normal,$01 First,$02 Second,$03 Third +Cheat8="Infinite Time",8110524A 0063 +Cheat9="Enable Restart Match option",800494BB 0002 + +//---- + +[8C3D1192-BEF172E1-C:50] +Name=Mortal Kombat Trilogy (E) +Cheat0="Unlimited Energy\Player 1",801698AD 00A6 +Cheat1="Unlimited Energy\Player 2",80169B81 00A6 +Cheat2="Aggressor Energy Bar\Player 1",80169941 0030 +Cheat3="Aggressor Energy Bar\Player 2",80169943 0030 +Cheat4="Infinite Time",8114C2FC 000A +Cheat5="Unlock Secret",80169F41 0004 +Cheat6="Infinite Run\Player 1",811698B4 0030 +Cheat7="Play As\Player 1",8016989D 00?? +Cheat7_O=$00 Kano,$01 Sonya,$02 Jax,$03 Nightwolf,$04 Cage,$05 Stryker,$06 Sindel,$07 Sektor,$08 Cyrax,$09 Kung Lao,$0A Kabal,$0B Sheeva,$0C Shang Tsung,$0D Liu Kang,$0E Smoke,$0F Kitana,$10 Jade,$11 Mileena,$12 Scorpion,$13 Reptile,$14 Ermac,$15 Sub-Zero,$16 Human Smoke,$17 Noob Saibot,$18 Rayden,$19 Baraka,$1A Rain,$1B Khameleon +Cheat8="Infinite Run\Player 2",81169B88 0030 +Cheat9="Play As\Player 2",80169B41 00?? +Cheat9_O=$00 Kano,$01 Sonya,$02 Jax,$03 Nightwolf,$04 Cage,$05 Stryker,$06 Sindel,$07 Sektor,$08 Cyrax,$09 Kung Lao,$0A Kabal,$0B Sheeva,$0C Shang Tsung,$0D Liu Kang,$0E Smoke,$0F Kitana,$10 Jade,$11 Mileena,$12 Scorpion,$13 Reptile,$14 Ermac,$15 Sub-Zero,$16 Human Smoke,$17 Noob Saibot,$18 Rayden,$19 Baraka,$1A Rain,$1B Khameleon +Cheat10="Pick Your Kombat Zone",812575A4 00?? +Cheat10_O=$00 Subway,$01 Street,$02 Courtyard,$03 Pit,$04 Kahn's Tower,$05 Bridge,$06 Soul Chamber,$07 Bell Tower,$08 Kombat Temple,$09 Graveyard,$0A Pit 3,$0B River Kombat,$0C Scorpion's Lair,$0D Kahn's Kave,$0E Jade's Desert,$0F Lost Bridge,$10 Hidden Portal,$11 Dead Pool,$12 Wasteland,$13 Rooftop,$14 Armory,$15 Living Forest,$16 Tower,$17 Portal,$18 Lair,$19 Tomb,$1A Pit 2,$1B Star Bridge,$1C Pit Bottom +Cheat11="Max Aggressor\Player 1",D02B5285 0020,811698D4 5100,D02B5285 0020,811698DC 5100 +Cheat11_N=Press L Button To Activate +Cheat12="Max Aggressor\Player 2",D02B528D 0020,811698D6 5100,D02B528D 0020,811698DE 5100 +Cheat12_N=Press L Button To Activate + +//---- + +[B8F0BD03-4479189E-C:50] +Name=MRC - Multi Racing Championship (E) +Cheat0="Always 1st",800A9107 0000 +Cheat1="Infinite Time",8009498F 003C +Cheat2="Access all Gold Trophies",50000602 0000,810A9078 0000 +Cheat2_N=Championshp & Match Mode +Cheat3="Access All Tracks In Match Mode",50000602 0000,810A9080 0001 + +//---- + +[F5360FBE-2BF1691D-C:50] +Name=MYSTICAL NINJA +Cheat1="Infinite\Lives",8015D2EF 000A +Cheat2="Infinite\Ryo",8015D2EA 0010 +Cheat3="Have\Chain Pipe",8015D3BF 0002 +Cheat4="Have\Medal of Flames",8015D3DF 0001 +Cheat5="Have\Ebisumaru",8015D3A3 0001 +Cheat6="Have\Meat Saw Hammer",8015D3C0 0001 +Cheat7="Have\Sasuke Character",8015D3A4 0001 +Cheat8="Have\Fire Cracker Bomb",8015D3C4 0001 +Cheat9="Have\Kunai of Severe Cold",8015D3D4 0001 +Cheat10="Have\Yae Character",8015D3AB 0001 +Cheat11="Have\Bazooka",8015D3CB 0001 +Cheat12="Have\Flute",8015D3DB 0001 +Cheat13="Have\Magic Mermaid",8015D3FB 0001 +Cheat14="Have\Magic Sudden Impact",8015D3EC 0001 +Cheat15="Have\Magic Mini Ebisu",8015D3F2 0001 +Cheat16="Have\Magic Flying",8015D3F4 0001 +Cheat17="Have\Shell",8015D3FC 0001 +Cheat18="Have\Brown Item",8015D402 0001 +Cheat19="Have\Brown Round Item",8015D40F 0001 +Cheat20="Have\Gold Key",8015D412 0001 +Cheat21="Have\Blue Sausage",8015D417 0001 +Cheat22="Have\Pink Item",8015D41B 0001 +Cheat23="Have\Gold Item",8015D41C 0001 +Cheat24="Have\Blue Item",8015D422 0001 +Cheat25="Access\Japanese Sombrero",8015D2F7 0001 +Cheat25_N=Use only one of these codes at a time! +Cheat26="Access\Metal Helmet",8015D2F7 0002 +Cheat26_N=Use only one of these codes at a time! +Cheat27="Access\Gold Helmet",8015D2F7 0003 +Cheat27_N=Use only one of these codes at a time! +Cheat28="Access\Infinite Health",802F706A 0999 +Cheat28_N=Use only one of these codes at a time! +Cheat29="Access\Infy Ryo",802F7667 0999 +Cheat29_N=Use only one of these codes at a time! +Cheat30="Access\Always have Big Laser",802F706F FFFF +Cheat30_N=Use only one of these codes at a time! +Cheat31="Access\Infinite Ryo Impact Running",812F70EA 270F +Cheat31_N=Use only one of these codes at a time! +Cheat32="Access\Infinite Ryo Impact Fighting",812F7066 0005 +Cheat32_N=Use only one of these codes at a time! +Cheat33="Access\Enemy Health Modifer attach Activator",812F7062 03E8 +Cheat33_N=Use only one of these codes at a time! +Cheat34="Access\Infinite Impact Oil",812F706A 0154 +Cheat34_N=Use only one of these codes at a time! +Cheat35="Access\Full Energy for Lazer",812F706E 0064 +Cheat35_N=Use only one of these codes at a time! +Cheat36="Access\Mystical Ninja Skating team",8120D620 4E20,8120DEF4 4E20,8116AE78 4E20 +Cheat37="Access\Move Lock",8116AE6A 0000,8120D84A 0000 +Cheat38="Access\Skating Team V2",8120D620 4E20,8120DEF4 4E20,8116AE78 4E20,8116AE6A 0001,8120D84A 0001 +Cheat0="Infinite\Health",8015D2E7 0028 +Cheat39="Keep Blue Fish",8015D303 0003,50000404 0000,8015D2F3 0003 + +//---- + +[7F9345D3-841ECADE-C:50] +Name=Mystical Ninja 2 Starring Goemon (E) +Cheat0="Play As\Player 1",80088E02 00?? +Cheat0_O=$00 Goemon,$01 Ebisumaru,$02 Sasuke,$03 Yae +Cheat2="Unlimited Gate Opener Things",80088EC6 0099 +Cheat3="Unlimited Health\Player 1",80088ED4 0004 +Cheat4="Unlimited Shield\Player 1",80088ED5 0004,8015D3C4 0001 +Cheat5="Always Have Most Powerful Weapon",80088ED9 0003 + +//---- + +[AE4992C9-9253B253-C:50] +Name=NASCAR 99 (E) +Cheat0="Laps To Race",81044B7E 00?? +Cheat0_O=$01 1 Lap,$02 2 Laps,$03 3 Laps,$04 4 Laps,$05 5 Laps,$06 6 Laps,$07 7Laps,$08 8 Laps,$09 9 Laps +Cheat1="Access All Secret NASCAR Legends",50000602 0000,810DF400 0101 +Cheat1_N=This will give you access to,Alan Kulwicki,Cale Yarborough,Bobby Allison,Davey Allison,Richard Petty,Benny Parsons + +//---- + +[29CE7692-71C58579-C:50] +Name=NHL Breakaway 98 (E) +Cheat0="Activate Cheat Menu",80053F78 0001 +Cheat1="Home Team Scores",8012BC2C 00?? +Cheat1_O=$00 No Score,$FF Max Score +Cheat2="Away Team Score",8012BC2D 00?? +Cheat2_O=$00 No Score,$FF Max Score + +//---- + +[8A97A197-272DF6C1-C:50] +Name=Nuclear Strike 64 (E) +Cheat0="Level & Scenario Select",800ACE5C 000B +Cheat1="Invincibility",800ADB64 0001 +Cheat1_N=Makes you also fly without any fuel +Cheat2="Double MPG",800ADB69 0001 +Cheat3="No Quad Damage",800ADB6B 0001 +Cheat4="infinite Ammo For All Guns",800ADB65 0001 +Cheat5="Infinite Attempts",800ADB66 0001 + +//---- + +[E86415A6-98395B53-C:50] +Name=O.D.T (Or Die Trying) (E) (M5) (Unreleased Final) +Cheat0="Play As Select",800FCEC5 00?? +Cheat0_O=$00 Ike Hawkings (Corporal),$01 Sophia Hawkings (Stowaway),$02 Julia Chase (Cartographer),$03 Karma (The Ex-Deviant),$04 Max Havok (Chief Enginer),$05 Solaar (Archbishop),$06 Mr Bodybolt (7th Passenger) +Cheat1="Infinite Max\999 Lives",810C8CF8 03E8 +Cheat2="Infinite Max\Health",800C8AD9 0066 +Cheat3="Infinite Max\Light Ammo",800C8CAB 0066 +Cheat4="Infinite Max\Fire Ammo",800C8CB3 0066 +Cheat5="Infinite Max\Ionic Ammo",800C8CBB 0066 +Cheat6="Infinite Max\Fusion Ammo",800C8CC3 0066 +Cheat7="Infinite Max\Mana",800C8CFF 0066 +Cheat8="Have\All Magic",800CEB48 0010,800CEB4D 0000,800CEB57 0001,800CEB61 0002,800CEB6B 0003,800CEB75 0005,800CEB7F 0006,800CEB89 0008,800CEB93 0009,800CEB9D 000B,800CEBA7 000E,800CEBB1 000F,800CEBBB 0010,800CEBC5 0011,800CEBCF 000A,800CEBD9 000C,800CEBE3 000D +Cheat9="Have\Magic On Level 4",810C8CDD FFFF,810C8CDE FFFF,810C8CDF FFFF,810C8CE0 FFFF,810C8CE1 FFFF,810C8CE2 FFFF +Cheat10="Have\Weapons On Max Upgrade",800C8CAC 0009,800C8CB4 0009,800C8CBC 0009,800C8CC4 0009 +Cheat11="Have\Max Armour Level",800C8D00 0064 +Cheat12="Have\Max Spirit Level",800C8D04 0064 +Cheat13="Have\Max Weapon Level",800C8D02 0064 +Cheat14="Have\Max Experience Level",800C8CFC 00FF +Cheat15="Infinite Air Under Water",800C8BE4 0069 +Cheat16="Press A For Bionic Jump",D00C8BCA 0080,810C8AE8 ???? +Cheat16_O=$0250 Medium Jump,$0800 Max Jump +Cheat16_N=This will make you jump to a great height + +//---- + +[812289D0-C2E53296-C:50] +Name=Off Road Challenge (E) +Cheat0="1 Player\Always Place 1st",80103CD7 0000 +Cheat1="Multi and 1 Player\Infinite Gent Turbos\Player 1",81103F3A 02F4 +Cheat2="1 Player\Max\Acceleration",8012C51F 000A +Cheat3="1 Player\Max\Shocks",8012C527 000A +Cheat4="1 Player\Max\Speed",8012C523 000A +Cheat5="1 Player\Max\Tires",8012C52B 000A +Cheat6="Multi and 1 Player\Max Crash Helmets\Player 1",80103F33 0064 +Cheat7="Multi and 1 Player\Infinite Gent Turbos\Player 2",8110422E 02F4 +Cheat8="Multi and 1 Player\Max Crash Helmets\Player 2",80104227 0064 +Cheat1_N=Can be used in 1 Player and Multiplayer Modes for Player 1 +Cheat6_N=Can be used in 1 Player and Multiplayer Modes for Player 1 +Cheat7_N=Multiplayer Mode Only for Player 2 +Cheat8_N=Multiplayer Mode Only for Player 2 + +//---- + +[D5898CAF-6007B65B-C:50] +Name=OPERATION WINBACK +Cheat0="Infinite\Health",80179F8B 0064 +Cheat1="Infinite\Ammo and No Reloads",80157C9B 0078,80157C94 0078,80157C90 0063,80179F6F 001E,80157C91 0063,80179F83 0008 +Cheat2="C4 Explosives",80157C93 0001 +Cheat2_N=Slot 1 +Cheat3="Flash Light",80157C95 0001 +Cheat3_N=Slot 2 +Cheat4="C4 Detector",80157C98 0001 +Cheat4_N=Slot 3 +Cheat5="Key",80157C99 0001 +Cheat5_N=Slot 2 +Cheat6="Card Key",80157C9A 0001 +Cheat6_N=Slot 3 +Cheat7="Max Power Mode",8015C8E7 0001 +Cheat9="Walk Through Walls/Objects",D0139BC4 0020,8117964C 43C7 +Cheat9_N=Press Z Button And Joystick Forward Dont Stand Too Close To Wall/Object +Cheat8="All Multiplayer Characters",8015C8E1 000F,8015C8E2 00FF,8015C8E3 00FF +Cheat10="Weapon modifier",80179F78 00?? +Cheat10_O=$00 Handgun,$01 Submachine gun,$02 Shotgun,$03 Rocket launcher,$14 Handgun w/ silencer +Cheat11="Sudden death & trial modes unlocked",8015C8E0 00A0 +Cheat12="Time is always 00:20:38",8010D342 0078 + +//---- + +[AC976B38-C3A9C97A-C:50] +Name=Paperboy 64 (E) +Cheat0="Level Select",8006A6A7 0001 +Cheat0_N=Also accesses All Bonus Levels +Cheat1="Invincibility",81268D1A 0001 +Cheat2="Infinite Newspapers",81268D12 0001 +Cheat3="Big Newspapers",81268D5A 0001 +Cheat4="Throw Newspapers Forwards",81268D46 0001 +Cheat5="Throw Newspapers Backwards",81268D4A 0001 +Cheat6="Turbo Mode",81268D36 0001 +Cheat7="Super Jump Springs",81268D3A 0001 +Cheat8="Rocket Boosters",81268D3E 0001 +Cheat9="99 Total Houses",8106A61A 0063 + +//---- + +[19AB29AF-C71BCD28-C:50] +Name=PAPER MARIO +Cheat0="Infinite & Max HP + FP",50000601 0000,8010DD91 0063 +Cheat0_N=Do not enable this code before you have made a save, when a new game is started up. +Cheat1="Access\All Star Spirits",8110E01E 0007 +Cheat1_N=Disable this code as soon as you have reached level 8, or everything will be removed again +Cheat2="Access\Max Star Energy",8010E01E 0007 +Cheat3="Access\Infinite Star Spirits",8010E020 0007 +Cheat4="Access\Infinite Coins",8110DD9C 03E7 +Cheat5="Access\Max Star Points",8010DDA0 0063 +Cheat5_N=You will level up, everytime you get a Star point +Cheat6="Access\Max Star Pieces",8010DD9F 0063 +Cheat7="Access\Max Badge Points",8010DD98 00?? +Cheat7_O=$3C 60 Badge Points,$7F 127 Badge Points +Cheat8="Access\Level 99",8010DD99 0063 +Cheat9="Access\all members in your party",50000C08 0000,8010DDAC 0001 +Cheat10="Access\Ultra Rank",50000C08 0000,8010DDAD 0002,50000C08 0000,8010DDED 0002 +Cheat10_N=This will give you Goombario,Kooper,Bombette,Parakarry,Bow Watt, Sushie & Lakilester +Cheat11="Press L Button For Moon Jump",D0071337 0020,8010DAF4 0043 + +//---- + +[C83CEB83-FDC56219-C:50] +Name=Penny Racers (E) +Cheat0="Super Speed",81228FA8 4800 +Cheat0_N=This is Turbo fast,So to slow it down a little more keep the B button pressed down +Cheat1="Always 1st",8022CC16 0001 +Cheat2="Class Select",8021C297 00?? +Cheat2_O=$00 Class C,$01 Class B,$03 Class AA,$04 1 Play,$05 2 Play,$06 3 Play,$07 4 Play +Cheat2_N=This code is useful because you can play Class AA without having to beat a level!& then once any edit is done while the game is running + +//---- + +[E4B08007-A602FF33-C:50] +Name=Perfect Dark (E) +Cheat0="Have All\Weapons\Player 1",802037F0 0007,801EA7F0 0007,801D17F0 0007 +Cheat1="Infinite\Ammo\Player 1",80202F7F 00FF,801E9F7F 00FF,801D0F7F 00FF,802027DB 00FF,801E97DB 00FF,801D07DB 00FF +Cheat2="Infinite\Health\Player 1",8120205C 3F80,811E905C 3F80,811D005C 3F80 +Cheat3="Infinite\Shield\Player 1",81202070 3F80,811E9070 3F80,811D0070 3F80 +Cheat4="Have All\Weapons\Player 2",80205460 0007,801EC460 0007,801D3460 0007 +Cheat5="Infinite\Ammo\Player 2",80204BEF 00FF,801EBBEF 00FF,801D2BEF 00FF,8020444B 00FF,801EB44B 00FF,801D244B 00FF +Cheat6="Infinite\Health\Player 2",81203CCC 3F80,811EACCC 3F80,811D1CCC 3F80 +Cheat7="Infinite\Shield\Player 2",81203CE0 3F80,811EACE0 3F80,811D1CE0 3F80 +Cheat8="Have All\Levels Complete & All Challenges",50003C02 0000,800A27C1 0001,50001E1A 0000,80088A0D 0001,50001E1A 0000,80088A0E 0001,50001E1A 0000,80088A0F 0001,50001E1A 0000,80088A10 0001 +Cheat9="Carrington Institute\Have 999 points in Firing Range",810AD712 03E7 +Cheat10="Carrington Institute\Have Infinite time in Firing Range",810AD70E 004D +Cheat11="Carrington Institute\Have 255 targets destroyed",810AD714 00FF +Cheat0_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat1_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat2_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat3_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat4_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat5_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat6_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat7_N=This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy +Cheat8_N=Have all levels Complete on Solo Missions, & Acces all Challenges & CO-OP Levels +Cheat12="Single & Co-Op\Press B To Levitate\Player 1",D00980C4 0040,81202000 40F2,D00980C4 0040,80201FB3 0000,D00980C4 0040,811E9000 40F2,D00980C4 0040,801E8FB3 0000,D00980C4 0040,811D0000 40F2,D00980C4 0040,801CFFB3 0000 +Cheat12_N=To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something + +//---- + +[1AA05AD5-46F52D80-C:50] +Name=Pilot Wings64 +Cheat0="Infinite Fuel\Gyrocopter",80366989 0081 +Cheat1="Infinite Fuel\Rocket Belt",803669A9 0081 +Cheat2="Time Always 00'00'10",803668B8 0001 +Cheat3="Choose Vehicle",88366807 00?? +Cheat3_O=$00 Hang Glider,$01 Rocket Belt,$02 Gyrocopter,$03 Cannonball,$04 Skydiving,$05 Jumble Hopper,$06 Birdman +Cheat5="Infinite Photos",813545EE 0000 +Cheat2_N=This Cheat code is for All Events +Cheat3_N=Make your Choice & then Press GS To Activate,But do not use with any other Press GS Cheat Codes. +Cheat4="[Perfect Score] (All Class & Level's)",50000330 0000,803683ED 0064,50000330 0000,80368A81 0064,50000330 0000,80368BD1 0064,50000330 0000,80369115 0064,50000330 0000,80369265 0064,50000330 0000,803693B5 0064,50000330 0000,803697A9 0064,50000330 0000,803698F9 0064,50000330 0000,80369A49 0064 +Cheat4_N=To make these codes save to Game-Pak; just pick a level and lose, choose Next then Quit. Enable Disable Perfect Score then save and disable before using the Extra Games Perfect Score Cheat. +Cheat6="[Perfect Score] Extra Games (All Class & Level's)",8036847D 0019,803685CD 0019,8036871D 0019,8036886D 0019,803684AD 0064,803684DD 0064,80368B11 0019,80368C61 0019,80368DB1 0019,80368F01 0019,80368B41 0064,80368B71 0064,803691A5 0019,803692F5 0019,80369445 0019,80369595 0019,803691D5 0064,80369205 0064 +Cheat6_N=To make these codes save to Game-Pak; just pick a level and lose, choose Next then Quit. Enable Disable Perfect Score then save and disable before using the Extra Games Perfect Score Cheat. +Cheat7="Music Volume Select",80250FA4 00?? +Cheat7_O=$00 No Music,$3F Default Volume,$80 Max Volume + +//---- + +[4FF5976F-ACF559D8-C:50] +Name=POKEMON SNAP +Cheat0="[Enable All Levels]",810C2712 0006 +Cheat0_N=This is needed to be able to Play all Levels of the Game + +//---- + +[84077275-57315B9C-C:50] +Name=Pokemon Stadium (E) +Cheat0="Infinite Health\Stadium\Free Battle",80287D79 0064 +Cheat1="Infinite Health\Stadium\Poke Cup",80285399 0064 +Cheat2="Infinite Health\Stadium\Pica Cup",80284659 0064 +Cheat3="Infinite Health\Stadium\Prime Cup",80285FE9 0064 +Cheat4="Infinite Health\Stadium\Petit Cup",80286C29 0064 +Cheat5="Infinite Health\Stadium\Mewto",802825B9 0064 +Cheat6="Gym Leader Castle\Elite Four & Rival",80286859 00A1 +Cheat7="Gym Leader Castle\Brock",80287539 00A1 +Cheat8="Gym Leader Castle\Misty",80287E79 00A1 +Cheat9="Gym Leader Castle\Surge",80286BD9 00A1 +Cheat10="Gym Leader Castle\Erika",80286BA9 00A1 +Cheat11="Gym Leader Castle\Koga",80287519 00A1 +Cheat12="Gym Leader Castle\Sabrina",802870A9 00A1 +Cheat13="Gym Leader Castle\Blaine",80286B69 00A1 +Cheat14="Gym Leader Castle\Giovani",80287169 00A1 +Cheat15="Infinite Health\Player 1",810AE686 03E7,810AE6AA 03E7,810AE6DA 03E7,810AE6FE 03E7 +Cheat16="All Pokemon Level 100\Player 1",50000654 0000,800AE654 0064 +Cheat17="Infinite Attacks All Pokemon\Player 1",50000654 0000,810AE650 6363,50000654 0000,810AE652 6363 +Cheat18="Infinite Attacks All Pokemon\Player 2",50000654 0000,810AE86C FFFF,50000654 0000,810AE86E FFFF +Cheat19="Infinite Attacks All Pokemon\Player 3",50000654 0000,810AE86C FFFF,50000654 0000,810AE86E FFFF +Cheat20="Infinite Attacks All Pokemon\Player 4",50000654 0000,810AEA88 FFFF,50000654 0000,810AEA8A FFFF +Cheat21="Game Difficulty",D312FC40 FD70,D312FC40 A528,8112FC40 00?? +Cheat21_O=$00 Hard,$01 Normal,$02 Easy,$0F Extra Hard +Cheat22="Catch\Mew on GB Tower",80171E17 0015 +Cheat23="Catch\Mewtwo on GB Tower",80171E17 0083 +Cheat24="Infinite coins for coin case",801723E3 0099 +Cheat25="Infinite cash",81172186 9999 +Cheat26="Pokemon beach stop code",D00488A1 0020,80202BB5 0001 +Cheat27="Clefairy Says\Infinite Health\Player 1",8118F438 0064 +Cheat28="Clefairy Says\Extended Life Bar\Player 1",8118F43A 0049 +Cheat29="Clefairy Says\Infinite Health\Player 2",8118F5F8 0064 +Cheat30="Clefairy Says\Extended Life Bar\Player 2",8118F5FA 0049 +Cheat31="Clefairy Says\Infinite Health\Player 3",8118F7B8 0064 +Cheat32="Clefairy Says\Extended Life Bar\Player 3",8118F7BA 0049 +Cheat33="Clefairy Says\Infinite Health\Player 4",8118F978 0064 +Cheat34="Clefairy Says\Extended Life Bar\Player 4",8118F97A 0049 +Cheat35="Rock Harden\Infinite Armour\Player 1",81193B78 0190 +Cheat36="Rock Harden\Infinite Armour\Player 2",81193E2C 0190 +Cheat37="Rock Harden\Infinite Armour\Player 3",811940E0 0190 +Cheat38="Rock Harden\Infinite Armour\Player 4",81194394 0190 +Cheat39="Infinite Health against Mew Two",810AE632 FFFF,812823E8 FFFF +Cheat40="All Pokmon Have Max Hp",81285AE8 0096 + +//---- + +[2952369C-B6E4C3A8-C:50] +Name=Pokemon Stadium 2 (E) +Cheat0="Infinite Health Stadium & Gym Leader Castle",801DD22D 0030 +Cheat1="Mini Games\Player 1\Gutsy Golbat has 99 Hearts",D017711F 0001,8017711F 0063 +Cheat2="Mini Games\Player 2\Gutsy Golbat has 99 hearts",D017714B 0001,8017714B 0063 +Cheat3="Mini Games\Player 3\Gutsy Golbat has 99 hearts",D0177177 0001,80177177 0063 +Cheat4="Mini Games\Player 4\Gutsy Golbat has 99 hearts",D01771A3 0001,801771A3 0063 +Cheat5="Mini Games\Player 1\Clear Cut Challenge gets perfect score",801744C3 0063 +Cheat6="Mini Games\Player 1\Topsy Turvy",D01769E7 0001,801769E7 0005 +Cheat6_N=Immediatly wins +Cheat7="Mini Games\Player 1\Egg Emergency perfect score",80191C3F 0064 +Cheat8="Mini Games\Player 1\Furret Frolic Perfect Score",801E9623 0063 +Cheat9="Mini Games\Player 1\Streaming Stampede Perfect Score",8018138B 0063 +Cheat10="Mini Games\Player 1\Delibird Delivery Perfect Score",801AC2CC 0063 +Cheat11="Mini Games\Player 1\Roll Out Rampage Always in 1st Place",80103179 0001 + +//---- + +[16931D74-65DC6D34-C:50] +Name=Quake 64 (E) +Cheat0="Infinite\Ammo",50000402 0000,8016426D 0064,50000402 0000,8116426C 03E7 +Cheat1="Have\All Weapons",8016422B 007F +Cheat2="Debug Mode",8006C4E3 0001 +Cheat3="Have\All Keys",80164229 000F +Cheat4="Infinite\Armor",81164184 42C8 +Cheat5="Infinite\Health",81164170 42C8 +Cheat6="Infinite\Bio Suit",811641C0 42C8 +Cheat7="Have\Quad Damage",811641BC 42C8 +Cheat8="Have\Ring of Shadows",81164228 ???? +Cheat8_O=$42C8 On,$0000 Off +Cheat9="Rapid Fire",D00CB220 0020,801641AD 0001 +Cheat10="Multi\Infinite Health\Player 1",81166AD0 42C8 +Cheat11="Multi\Infinite Armor\Player 1",81166AE4 42C8 +Cheat12="Multi\Infinite Bio Suit\Player 1",81166B20 42C8 +Cheat13="Multi\Have All Weapons\Player 1",80166B8B 007F +Cheat14="Multi\Infinite Ammo\Player 1",50000402 0000,81166BCC 03E7 +Cheat15="Multi\Infinite Health\Player 2",81166DA0 42C8 +Cheat16="Multi\Infinite Armor\Player 2",81166DB4 42C8 +Cheat17="Multi\Infinite Bio Suit\Player 2",81166DF0 42C8 +Cheat18="Multi\Have All Weapons\Player 2",80166E5B 007F +Cheat19="Multi\Infinite Ammo\Player 2",50000402 0000,81166E9C 03E7 + +//---- + +[7433D9D7-2C4322D0-C:50] +Name=QUAKE II +Cheat0="Invincible",8002E618 0000 +Cheat1="Status Bar Always On",8008E4CF 0001 +Cheat2="Have All Weapons and Infinite Max Ammo\Level 01",50000904 0000,802A46AB 0001,50000604 0000,812A46CE 02F4 +Cheat3="Have All Weapons and Infinite Max Ammo\Level 02",50000904 0000,8028A47B 0001,50000604 0000,8128A49E 02F4 +Cheat4="Have All Weapons and Infinite Max Ammo\Level 03",50000904 0000,8027223B 0001,50000604 0000,8127225E 02F4 +Cheat5="Have All Weapons and Infinite Max Ammo\Level 04",50000904 0000,8026A70B 0001,50000604 0000,8126A72E 02F4 +Cheat6="Have All Weapons and Infinite Max Ammo\Level 05",50000904 0000,8028812B 0001,50000604 0000,8128814E 02F4 +Cheat7="Have All Weapons and Infinite Max Ammo\Level 06",50000904 0000,8027DA0B 0001,50000604 0000,8127DA2E 02F4 +Cheat8="Have All Weapons and Infinite Max Ammo\Level 07",50000904 0000,802811CB 0001,50000604 0000,812811EE 02F4 +Cheat9="Have All Weapons and Infinite Max Ammo\Level 08",50000904 0000,8027C45B 0001,50000604 0000,8127C47E 02F4 +Cheat10="Have All Weapons and Infinite Max Ammo\Level 09",50000904 0000,80247C7B 0001,50000604 0000,81247C9E 02F4 +Cheat11="Have All Weapons and Infinite Max Ammo\Level 10",50000904 0000,80276C4B 0001,50000604 0000,81276C6E 02F4 +Cheat12="Have All Weapons and Infinite Max Ammo\Level 11",50000904 0000,80278AFB 0001,50000604 0000,81278B1E 02F4 +Cheat13="Have All Weapons and Infinite Max Ammo\Level 12",50000904 0000,8028F69B 0001,50000604 0000,8128F6BE 02F4 +Cheat14="Have All Weapons and Infinite Max Ammo\Level 13",50000904 0000,80278A4B 0001,50000604 0000,81278A6E 02F4 +Cheat15="Have All Weapons and Infinite Max Ammo\Level 14",50000904 0000,802807DB 0001,50000604 0000,812807FE 02F4 +Cheat16="Have All Weapons and Infinite Max Ammo\Level 15",50000904 0000,8027636B 0001,50000604 0000,8127638E 02F4 +Cheat17="Have All Weapons and Infinite Max Ammo\Level 16",50000904 0000,8028B7FB 0001,50000604 0000,8128B81E 02F4 +Cheat18="Have All Weapons and Infinite Max Ammo\Level 17",50000904 0000,8027278B 0001,50000604 0000,812727AE 02F4 +Cheat19="Have All Weapons and Infinite Max Ammo\Level 18",50000904 0000,8026594B 0001,50000604 0000,8126596E 02F4 +Cheat20="Have All Weapons and Infinite Max Ammo\Level 19",50000904 0000,8024A28B 0001,50000604 0000,8124A2AE 02F4 + +//---- + +[9B500E8E-E90550B3-C:50] +Name=Resident Evil 2 (E) +Cheat0="Infinite Health",810DDE22 00C8 +Cheat1="Condition Always Fine",810DDEE4 0000 +Cheat2="Infinite Time",800E57BF 0010 +Cheat3="Access ChestAnywhere",D1014FA4 0020,81122598 0100 +Cheat3_N=Press L Button + Start +Cheat4="Access Quick Save",D1014FA4 6000,810E5428 8007,D1014FA4 6000,810E542A 0E30 +Cheat4_N=Press Z Button + B Button +Cheat5="Access All Items Chest",50003504 0100,810E59F4 2FFE +Cheat5_N=Disable After First Save +Cheat6="Infinite Ammo",811224AE 03E7 +Cheat7="Access Ink Ribbons",810E59C8 1EFF +Cheat7_N=Disable After First Save +Cheat8="Access Weapons\Grenadelauncher & Acid Rounds",810E59CC 0BFF +Cheat8_N=Disable After First Save +Cheat9="Access Weapons\Bow Gun",810E59D0 0CFF +Cheat9_N=Disable After First Save +Cheat10="Access Weapons\Rocket Launcher",810E59D4 11FF +Cheat10_N=Disable After First Save +Cheat11="Access Weapons\Gatling Gun",810E59D8 12FF +Cheat11_N=Disable After First Save +Cheat12="Number Of Saves Will Always Be 0",810E5650 0000 +Cheat13="Have 2 Extra Slots In Inventory",D10E584E 0000,810E584E 0001 +Cheat14="Play As",810DDC38 ???? +Cheat14_O=$0080 Leon Original,$0180 Claire Original,$0280 Leon Original,$0380 Claire Original,$0480 Leon Wounded,$0580 Claire without jacket,$0680 Leon Wounded,$0780 Claire without jacket,$0880 Leon as Stars,$0980 Claire as Biker,$0A80 Leon as Biker,$0B80 Claires body Leons outfit,$0C80 Hunk (can crash the game),$0D80 To Fu,$0E80 Ada (can crash the game),$0F80 Cheryl, +Cheat15="Play Extra Mission",810DDBEE 00?? +Cheat15_O=$48 The 4th Survior,$49 To-Fu +Cheat16="Max Item Modifier\Slot 01",800E59C8 00??,800E59C9 00FF +Cheat16_O=$00 Nothing,$01 Knife Hunk,$02 Handgun Hunk,$03 Handgun Different Ada,$04 Custom Handgun Hunk,$05 Magnum Hunk,$06 Custom Magnum Hunk,$07 Shotgun Hunk,$08 Custom Shotgun Hunk,$09 Grenade Launcher Claire,$0A Grenade Launcher (Flame Rounds) Claire,$0B Grenade Launcher (Acid Rounds) Claire,$0C Bowgun Claire,$0D Colt S.A.A. Claire,$0E Spark Shot Claire,$0F Sub Machine Gun Leon,$10 Flamethrower Leon,$11 Rocket Launcher Claire,$12 Gatling Gun Claire,$13 Machine Gun ???,$14 Handgun Bullets,$15 Shotgun Shells,$16 Magnum Bullets,$17 Fuel,$18 Grenade Rounds,$19 Flame Rounds,$1A Acid Rounds,$1B Machine Gun Bullets,$1C S. Shot Bullets,$1D Bow Gun Bolts,$1E Ink Ribbon,$1F Small Key,$20 Hand Gun Parts,$21 Magnum Parts,$22 Shotgun Parts,$23 First Aid Spray,$24 Chemical FR-W09,$25 Chemical AC-W24,$26 Green Herb,$27 Red Herb,$28 Blue Herb,$29 Mixed Herb (Green),$2A Mixed Herb (Red&Green),$2B Mixed Herb (Blue&Green),$2C Mixed Herb (?),$2D Mixed Herb (?),$2E Mixed Herb (?),$2F Lighter,$30 Lock Pick,$31 Picture,$32 Valve Handle,$33 Red Jewel,$34 Red Card Key,$35 Blue Card Key,$36 Serpent Stone,$37 Jaguar Stone,$38 Blue Stone,$39 Blue Stone (?),$3A Eagle Stone,$3B Bishop Plug,$3C Rook Plug,$3D Knight Plug,$3E King Plug,$3F W. Box Key,$40 Detonator,$41 Plastic Bomb,$42 Bomb&Detonator,$43 Crank,$44 Film,$45 Film (?),$46 Film (?),$47 Unicorn Medal,$48 Eagle Medal,$49 Wolf Medal,$4A G. Cogwheel,$4B Manhole Opener,$4C Main Fuse,$4D Fuse Case,$4E Vaccine,$4F Vaccine Cart.,$50 Film,$51 Base Vaccine,$52 G-Virus,$53 Special Key,$54 Joint S Plug,$55 Joint N Plug,$56 Cord,$57 Film,$58 Cabin Key,$59 Precinct Key (blue),$5A Precinct Key (red),$5B Precinct Key (?),$5C Precinct Key (green),$5D C. Panel Key (red),$5E C. Panel Key (yellow),$5F P. Room Key,$60 MO Disk,$61 Lab Card Key,$62 Master Key,$63 Platform Key,$64 No Item,$65 No Item,$66 No Item,$67 No Item,$68 Chris's Diary,$69 Mail to Chris,$6A Memo to Leon,$6B Police Memorandum,$6C Operation Report 1,$6D Mail to the Chief,$6E Mail to the Chief (?),$6F Secretary's Diary A,$70 Secretary's Diary B,$71 Operation Report 2,$72 User Registration,$73 Film A,$74 Film B,$75 Film C,$76 Patrol Report,$77 Watchman's Diary,$78 Chief's Diary,$79 Sewer Manager Diary,$7A Sewer Manager Fax,$7B Film D,$7C Vaccine Synthesis,$7D Lab Security Manual,$7E P-Epsilon Report,$7F Rookie Files,$80 Rookie Files (?),$81 No Item,$82 Spade Key,$83 Diamond Key,$84 Desk Key,$85 Heart Key,$86 Club Key,$87 Virgin Heart,$88 Square Crank,$89 Down Key,$8A Up Key,$8B Locker Key +Cheat17="Max Item Modifier\Slot 02",800E59CC 00??,800E59CD 00FF +Cheat17_O=$00 Nothing,$01 Knife Hunk,$02 Handgun Hunk,$03 Handgun Different Ada,$04 Custom Handgun Hunk,$05 Magnum Hunk,$06 Custom Magnum Hunk,$07 Shotgun Hunk,$08 Custom Shotgun Hunk,$09 Grenade Launcher Claire,$0A Grenade Launcher (Flame Rounds) Claire,$0B Grenade Launcher (Acid Rounds) Claire,$0C Bowgun Claire,$0D Colt S.A.A. Claire,$0E Spark Shot Claire,$0F Sub Machine Gun Leon,$10 Flamethrower Leon,$11 Rocket Launcher Claire,$12 Gatling Gun Claire,$13 Machine Gun ???,$14 Handgun Bullets,$15 Shotgun Shells,$16 Magnum Bullets,$17 Fuel,$18 Grenade Rounds,$19 Flame Rounds,$1A Acid Rounds,$1B Machine Gun Bullets,$1C S. Shot Bullets,$1D Bow Gun Bolts,$1E Ink Ribbon,$1F Small Key,$20 Hand Gun Parts,$21 Magnum Parts,$22 Shotgun Parts,$23 First Aid Spray,$24 Chemical FR-W09,$25 Chemical AC-W24,$26 Green Herb,$27 Red Herb,$28 Blue Herb,$29 Mixed Herb (Green),$2A Mixed Herb (Red&Green),$2B Mixed Herb (Blue&Green),$2C Mixed Herb (?),$2D Mixed Herb (?),$2E Mixed Herb (?),$2F Lighter,$30 Lock Pick,$31 Picture,$32 Valve Handle,$33 Red Jewel,$34 Red Card Key,$35 Blue Card Key,$36 Serpent Stone,$37 Jaguar Stone,$38 Blue Stone,$39 Blue Stone (?),$3A Eagle Stone,$3B Bishop Plug,$3C Rook Plug,$3D Knight Plug,$3E King Plug,$3F W. Box Key,$40 Detonator,$41 Plastic Bomb,$42 Bomb&Detonator,$43 Crank,$44 Film,$45 Film (?),$46 Film (?),$47 Unicorn Medal,$48 Eagle Medal,$49 Wolf Medal,$4A G. Cogwheel,$4B Manhole Opener,$4C Main Fuse,$4D Fuse Case,$4E Vaccine,$4F Vaccine Cart.,$50 Film,$51 Base Vaccine,$52 G-Virus,$53 Special Key,$54 Joint S Plug,$55 Joint N Plug,$56 Cord,$57 Film,$58 Cabin Key,$59 Precinct Key (blue),$5A Precinct Key (red),$5B Precinct Key (?),$5C Precinct Key (green),$5D C. Panel Key (red),$5E C. Panel Key (yellow),$5F P. Room Key,$60 MO Disk,$61 Lab Card Key,$62 Master Key,$63 Platform Key,$64 No Item,$65 No Item,$66 No Item,$67 No Item,$68 Chris's Diary,$69 Mail to Chris,$6A Memo to Leon,$6B Police Memorandum,$6C Operation Report 1,$6D Mail to the Chief,$6E Mail to the Chief (?),$6F Secretary's Diary A,$70 Secretary's Diary B,$71 Operation Report 2,$72 User Registration,$73 Film A,$74 Film B,$75 Film C,$76 Patrol Report,$77 Watchman's Diary,$78 Chief's Diary,$79 Sewer Manager Diary,$7A Sewer Manager Fax,$7B Film D,$7C Vaccine Synthesis,$7D Lab Security Manual,$7E P-Epsilon Report,$7F Rookie Files,$80 Rookie Files (?),$81 No Item,$82 Spade Key,$83 Diamond Key,$84 Desk Key,$85 Heart Key,$86 Club Key,$87 Virgin Heart,$88 Square Crank,$89 Down Key,$8A Up Key,$8B Locker Key +Cheat18="Max Item Modifier\Slot 03",800E59D0 00??,800E59D1 00FF +Cheat18_O=$00 Nothing,$01 Knife Hunk,$02 Handgun Hunk,$03 Handgun Different Ada,$04 Custom Handgun Hunk,$05 Magnum Hunk,$06 Custom Magnum Hunk,$07 Shotgun Hunk,$08 Custom Shotgun Hunk,$09 Grenade Launcher Claire,$0A Grenade Launcher (Flame Rounds) Claire,$0B Grenade Launcher (Acid Rounds) Claire,$0C Bowgun Claire,$0D Colt S.A.A. Claire,$0E Spark Shot Claire,$0F Sub Machine Gun Leon,$10 Flamethrower Leon,$11 Rocket Launcher Claire,$12 Gatling Gun Claire,$13 Machine Gun ???,$14 Handgun Bullets,$15 Shotgun Shells,$16 Magnum Bullets,$17 Fuel,$18 Grenade Rounds,$19 Flame Rounds,$1A Acid Rounds,$1B Machine Gun Bullets,$1C S. Shot Bullets,$1D Bow Gun Bolts,$1E Ink Ribbon,$1F Small Key,$20 Hand Gun Parts,$21 Magnum Parts,$22 Shotgun Parts,$23 First Aid Spray,$24 Chemical FR-W09,$25 Chemical AC-W24,$26 Green Herb,$27 Red Herb,$28 Blue Herb,$29 Mixed Herb (Green),$2A Mixed Herb (Red&Green),$2B Mixed Herb (Blue&Green),$2C Mixed Herb (?),$2D Mixed Herb (?),$2E Mixed Herb (?),$2F Lighter,$30 Lock Pick,$31 Picture,$32 Valve Handle,$33 Red Jewel,$34 Red Card Key,$35 Blue Card Key,$36 Serpent Stone,$37 Jaguar Stone,$38 Blue Stone,$39 Blue Stone (?),$3A Eagle Stone,$3B Bishop Plug,$3C Rook Plug,$3D Knight Plug,$3E King Plug,$3F W. Box Key,$40 Detonator,$41 Plastic Bomb,$42 Bomb&Detonator,$43 Crank,$44 Film,$45 Film (?),$46 Film (?),$47 Unicorn Medal,$48 Eagle Medal,$49 Wolf Medal,$4A G. Cogwheel,$4B Manhole Opener,$4C Main Fuse,$4D Fuse Case,$4E Vaccine,$4F Vaccine Cart.,$50 Film,$51 Base Vaccine,$52 G-Virus,$53 Special Key,$54 Joint S Plug,$55 Joint N Plug,$56 Cord,$57 Film,$58 Cabin Key,$59 Precinct Key (blue),$5A Precinct Key (red),$5B Precinct Key (?),$5C Precinct Key (green),$5D C. Panel Key (red),$5E C. Panel Key (yellow),$5F P. Room Key,$60 MO Disk,$61 Lab Card Key,$62 Master Key,$63 Platform Key,$64 No Item,$65 No Item,$66 No Item,$67 No Item,$68 Chris's Diary,$69 Mail to Chris,$6A Memo to Leon,$6B Police Memorandum,$6C Operation Report 1,$6D Mail to the Chief,$6E Mail to the Chief (?),$6F Secretary's Diary A,$70 Secretary's Diary B,$71 Operation Report 2,$72 User Registration,$73 Film A,$74 Film B,$75 Film C,$76 Patrol Report,$77 Watchman's Diary,$78 Chief's Diary,$79 Sewer Manager Diary,$7A Sewer Manager Fax,$7B Film D,$7C Vaccine Synthesis,$7D Lab Security Manual,$7E P-Epsilon Report,$7F Rookie Files,$80 Rookie Files (?),$81 No Item,$82 Spade Key,$83 Diamond Key,$84 Desk Key,$85 Heart Key,$86 Club Key,$87 Virgin Heart,$88 Square Crank,$89 Down Key,$8A Up Key,$8B Locker Key +Cheat19="Max Item Modifier\Slot 04",800E59D4 00??,800E59D5 00FF +Cheat19_O=$00 Nothing,$01 Knife Hunk,$02 Handgun Hunk,$03 Handgun Different Ada,$04 Custom Handgun Hunk,$05 Magnum Hunk,$06 Custom Magnum Hunk,$07 Shotgun Hunk,$08 Custom Shotgun Hunk,$09 Grenade Launcher Claire,$0A Grenade Launcher (Flame Rounds) Claire,$0B Grenade Launcher (Acid Rounds) Claire,$0C Bowgun Claire,$0D Colt S.A.A. Claire,$0E Spark Shot Claire,$0F Sub Machine Gun Leon,$10 Flamethrower Leon,$11 Rocket Launcher Claire,$12 Gatling Gun Claire,$13 Machine Gun ???,$14 Handgun Bullets,$15 Shotgun Shells,$16 Magnum Bullets,$17 Fuel,$18 Grenade Rounds,$19 Flame Rounds,$1A Acid Rounds,$1B Machine Gun Bullets,$1C S. Shot Bullets,$1D Bow Gun Bolts,$1E Ink Ribbon,$1F Small Key,$20 Hand Gun Parts,$21 Magnum Parts,$22 Shotgun Parts,$23 First Aid Spray,$24 Chemical FR-W09,$25 Chemical AC-W24,$26 Green Herb,$27 Red Herb,$28 Blue Herb,$29 Mixed Herb (Green),$2A Mixed Herb (Red&Green),$2B Mixed Herb (Blue&Green),$2C Mixed Herb (?),$2D Mixed Herb (?),$2E Mixed Herb (?),$2F Lighter,$30 Lock Pick,$31 Picture,$32 Valve Handle,$33 Red Jewel,$34 Red Card Key,$35 Blue Card Key,$36 Serpent Stone,$37 Jaguar Stone,$38 Blue Stone,$39 Blue Stone (?),$3A Eagle Stone,$3B Bishop Plug,$3C Rook Plug,$3D Knight Plug,$3E King Plug,$3F W. Box Key,$40 Detonator,$41 Plastic Bomb,$42 Bomb&Detonator,$43 Crank,$44 Film,$45 Film (?),$46 Film (?),$47 Unicorn Medal,$48 Eagle Medal,$49 Wolf Medal,$4A G. Cogwheel,$4B Manhole Opener,$4C Main Fuse,$4D Fuse Case,$4E Vaccine,$4F Vaccine Cart.,$50 Film,$51 Base Vaccine,$52 G-Virus,$53 Special Key,$54 Joint S Plug,$55 Joint N Plug,$56 Cord,$57 Film,$58 Cabin Key,$59 Precinct Key (blue),$5A Precinct Key (red),$5B Precinct Key (?),$5C Precinct Key (green),$5D C. Panel Key (red),$5E C. Panel Key (yellow),$5F P. Room Key,$60 MO Disk,$61 Lab Card Key,$62 Master Key,$63 Platform Key,$64 No Item,$65 No Item,$66 No Item,$67 No Item,$68 Chris's Diary,$69 Mail to Chris,$6A Memo to Leon,$6B Police Memorandum,$6C Operation Report 1,$6D Mail to the Chief,$6E Mail to the Chief (?),$6F Secretary's Diary A,$70 Secretary's Diary B,$71 Operation Report 2,$72 User Registration,$73 Film A,$74 Film B,$75 Film C,$76 Patrol Report,$77 Watchman's Diary,$78 Chief's Diary,$79 Sewer Manager Diary,$7A Sewer Manager Fax,$7B Film D,$7C Vaccine Synthesis,$7D Lab Security Manual,$7E P-Epsilon Report,$7F Rookie Files,$80 Rookie Files (?),$81 No Item,$82 Spade Key,$83 Diamond Key,$84 Desk Key,$85 Heart Key,$86 Club Key,$87 Virgin Heart,$88 Square Crank,$89 Down Key,$8A Up Key,$8B Locker Key +Cheat20="Max Item Modifier\Slot 05",800E59D8 00??,800E59D9 00FF +Cheat20_O=$00 Nothing,$01 Knife Hunk,$02 Handgun Hunk,$03 Handgun Different Ada,$04 Custom Handgun Hunk,$05 Magnum Hunk,$06 Custom Magnum Hunk,$07 Shotgun Hunk,$08 Custom Shotgun Hunk,$09 Grenade Launcher Claire,$0A Grenade Launcher (Flame Rounds) Claire,$0B Grenade Launcher (Acid Rounds) Claire,$0C Bowgun Claire,$0D Colt S.A.A. Claire,$0E Spark Shot Claire,$0F Sub Machine Gun Leon,$10 Flamethrower Leon,$11 Rocket Launcher Claire,$12 Gatling Gun Claire,$13 Machine Gun ???,$14 Handgun Bullets,$15 Shotgun Shells,$16 Magnum Bullets,$17 Fuel,$18 Grenade Rounds,$19 Flame Rounds,$1A Acid Rounds,$1B Machine Gun Bullets,$1C S. Shot Bullets,$1D Bow Gun Bolts,$1E Ink Ribbon,$1F Small Key,$20 Hand Gun Parts,$21 Magnum Parts,$22 Shotgun Parts,$23 First Aid Spray,$24 Chemical FR-W09,$25 Chemical AC-W24,$26 Green Herb,$27 Red Herb,$28 Blue Herb,$29 Mixed Herb (Green),$2A Mixed Herb (Red&Green),$2B Mixed Herb (Blue&Green),$2C Mixed Herb (?),$2D Mixed Herb (?),$2E Mixed Herb (?),$2F Lighter,$30 Lock Pick,$31 Picture,$32 Valve Handle,$33 Red Jewel,$34 Red Card Key,$35 Blue Card Key,$36 Serpent Stone,$37 Jaguar Stone,$38 Blue Stone,$39 Blue Stone (?),$3A Eagle Stone,$3B Bishop Plug,$3C Rook Plug,$3D Knight Plug,$3E King Plug,$3F W. Box Key,$40 Detonator,$41 Plastic Bomb,$42 Bomb&Detonator,$43 Crank,$44 Film,$45 Film (?),$46 Film (?),$47 Unicorn Medal,$48 Eagle Medal,$49 Wolf Medal,$4A G. Cogwheel,$4B Manhole Opener,$4C Main Fuse,$4D Fuse Case,$4E Vaccine,$4F Vaccine Cart.,$50 Film,$51 Base Vaccine,$52 G-Virus,$53 Special Key,$54 Joint S Plug,$55 Joint N Plug,$56 Cord,$57 Film,$58 Cabin Key,$59 Precinct Key (blue),$5A Precinct Key (red),$5B Precinct Key (?),$5C Precinct Key (green),$5D C. Panel Key (red),$5E C. Panel Key (yellow),$5F P. Room Key,$60 MO Disk,$61 Lab Card Key,$62 Master Key,$63 Platform Key,$64 No Item,$65 No Item,$66 No Item,$67 No Item,$68 Chris's Diary,$69 Mail to Chris,$6A Memo to Leon,$6B Police Memorandum,$6C Operation Report 1,$6D Mail to the Chief,$6E Mail to the Chief (?),$6F Secretary's Diary A,$70 Secretary's Diary B,$71 Operation Report 2,$72 User Registration,$73 Film A,$74 Film B,$75 Film C,$76 Patrol Report,$77 Watchman's Diary,$78 Chief's Diary,$79 Sewer Manager Diary,$7A Sewer Manager Fax,$7B Film D,$7C Vaccine Synthesis,$7D Lab Security Manual,$7E P-Epsilon Report,$7F Rookie Files,$80 Rookie Files (?),$81 No Item,$82 Spade Key,$83 Diamond Key,$84 Desk Key,$85 Heart Key,$86 Club Key,$87 Virgin Heart,$88 Square Crank,$89 Down Key,$8A Up Key,$8B Locker Key +Cheat21="Max Item Modifier\Slot 06",800E59DC 00??,800E59DD 00FF +Cheat21_O=$00 Nothing,$01 Knife Hunk,$02 Handgun Hunk,$03 Handgun Different Ada,$04 Custom Handgun Hunk,$05 Magnum Hunk,$06 Custom Magnum Hunk,$07 Shotgun Hunk,$08 Custom Shotgun Hunk,$09 Grenade Launcher Claire,$0A Grenade Launcher (Flame Rounds) Claire,$0B Grenade Launcher (Acid Rounds) Claire,$0C Bowgun Claire,$0D Colt S.A.A. Claire,$0E Spark Shot Claire,$0F Sub Machine Gun Leon,$10 Flamethrower Leon,$11 Rocket Launcher Claire,$12 Gatling Gun Claire,$13 Machine Gun ???,$14 Handgun Bullets,$15 Shotgun Shells,$16 Magnum Bullets,$17 Fuel,$18 Grenade Rounds,$19 Flame Rounds,$1A Acid Rounds,$1B Machine Gun Bullets,$1C S. Shot Bullets,$1D Bow Gun Bolts,$1E Ink Ribbon,$1F Small Key,$20 Hand Gun Parts,$21 Magnum Parts,$22 Shotgun Parts,$23 First Aid Spray,$24 Chemical FR-W09,$25 Chemical AC-W24,$26 Green Herb,$27 Red Herb,$28 Blue Herb,$29 Mixed Herb (Green),$2A Mixed Herb (Red&Green),$2B Mixed Herb (Blue&Green),$2C Mixed Herb (?),$2D Mixed Herb (?),$2E Mixed Herb (?),$2F Lighter,$30 Lock Pick,$31 Picture,$32 Valve Handle,$33 Red Jewel,$34 Red Card Key,$35 Blue Card Key,$36 Serpent Stone,$37 Jaguar Stone,$38 Blue Stone,$39 Blue Stone (?),$3A Eagle Stone,$3B Bishop Plug,$3C Rook Plug,$3D Knight Plug,$3E King Plug,$3F W. Box Key,$40 Detonator,$41 Plastic Bomb,$42 Bomb&Detonator,$43 Crank,$44 Film,$45 Film (?),$46 Film (?),$47 Unicorn Medal,$48 Eagle Medal,$49 Wolf Medal,$4A G. Cogwheel,$4B Manhole Opener,$4C Main Fuse,$4D Fuse Case,$4E Vaccine,$4F Vaccine Cart.,$50 Film,$51 Base Vaccine,$52 G-Virus,$53 Special Key,$54 Joint S Plug,$55 Joint N Plug,$56 Cord,$57 Film,$58 Cabin Key,$59 Precinct Key (blue),$5A Precinct Key (red),$5B Precinct Key (?),$5C Precinct Key (green),$5D C. Panel Key (red),$5E C. Panel Key (yellow),$5F P. Room Key,$60 MO Disk,$61 Lab Card Key,$62 Master Key,$63 Platform Key,$64 No Item,$65 No Item,$66 No Item,$67 No Item,$68 Chris's Diary,$69 Mail to Chris,$6A Memo to Leon,$6B Police Memorandum,$6C Operation Report 1,$6D Mail to the Chief,$6E Mail to the Chief (?),$6F Secretary's Diary A,$70 Secretary's Diary B,$71 Operation Report 2,$72 User Registration,$73 Film A,$74 Film B,$75 Film C,$76 Patrol Report,$77 Watchman's Diary,$78 Chief's Diary,$79 Sewer Manager Diary,$7A Sewer Manager Fax,$7B Film D,$7C Vaccine Synthesis,$7D Lab Security Manual,$7E P-Epsilon Report,$7F Rookie Files,$80 Rookie Files (?),$81 No Item,$82 Spade Key,$83 Diamond Key,$84 Desk Key,$85 Heart Key,$86 Club Key,$87 Virgin Heart,$88 Square Crank,$89 Down Key,$8A Up Key,$8B Locker Key +Cheat22="Max Item Modifier\Slot 07",800E59E0 00??,800E59E1 00FF +Cheat22_O=$00 Nothing,$01 Knife Hunk,$02 Handgun Hunk,$03 Handgun Different Ada,$04 Custom Handgun Hunk,$05 Magnum Hunk,$06 Custom Magnum Hunk,$07 Shotgun Hunk,$08 Custom Shotgun Hunk,$09 Grenade Launcher Claire,$0A Grenade Launcher (Flame Rounds) Claire,$0B Grenade Launcher (Acid Rounds) Claire,$0C Bowgun Claire,$0D Colt S.A.A. Claire,$0E Spark Shot Claire,$0F Sub Machine Gun Leon,$10 Flamethrower Leon,$11 Rocket Launcher Claire,$12 Gatling Gun Claire,$13 Machine Gun ???,$14 Handgun Bullets,$15 Shotgun Shells,$16 Magnum Bullets,$17 Fuel,$18 Grenade Rounds,$19 Flame Rounds,$1A Acid Rounds,$1B Machine Gun Bullets,$1C S. Shot Bullets,$1D Bow Gun Bolts,$1E Ink Ribbon,$1F Small Key,$20 Hand Gun Parts,$21 Magnum Parts,$22 Shotgun Parts,$23 First Aid Spray,$24 Chemical FR-W09,$25 Chemical AC-W24,$26 Green Herb,$27 Red Herb,$28 Blue Herb,$29 Mixed Herb (Green),$2A Mixed Herb (Red&Green),$2B Mixed Herb (Blue&Green),$2C Mixed Herb (?),$2D Mixed Herb (?),$2E Mixed Herb (?),$2F Lighter,$30 Lock Pick,$31 Picture,$32 Valve Handle,$33 Red Jewel,$34 Red Card Key,$35 Blue Card Key,$36 Serpent Stone,$37 Jaguar Stone,$38 Blue Stone,$39 Blue Stone (?),$3A Eagle Stone,$3B Bishop Plug,$3C Rook Plug,$3D Knight Plug,$3E King Plug,$3F W. Box Key,$40 Detonator,$41 Plastic Bomb,$42 Bomb&Detonator,$43 Crank,$44 Film,$45 Film (?),$46 Film (?),$47 Unicorn Medal,$48 Eagle Medal,$49 Wolf Medal,$4A G. Cogwheel,$4B Manhole Opener,$4C Main Fuse,$4D Fuse Case,$4E Vaccine,$4F Vaccine Cart.,$50 Film,$51 Base Vaccine,$52 G-Virus,$53 Special Key,$54 Joint S Plug,$55 Joint N Plug,$56 Cord,$57 Film,$58 Cabin Key,$59 Precinct Key (blue),$5A Precinct Key (red),$5B Precinct Key (?),$5C Precinct Key (green),$5D C. Panel Key (red),$5E C. Panel Key (yellow),$5F P. Room Key,$60 MO Disk,$61 Lab Card Key,$62 Master Key,$63 Platform Key,$64 No Item,$65 No Item,$66 No Item,$67 No Item,$68 Chris's Diary,$69 Mail to Chris,$6A Memo to Leon,$6B Police Memorandum,$6C Operation Report 1,$6D Mail to the Chief,$6E Mail to the Chief (?),$6F Secretary's Diary A,$70 Secretary's Diary B,$71 Operation Report 2,$72 User Registration,$73 Film A,$74 Film B,$75 Film C,$76 Patrol Report,$77 Watchman's Diary,$78 Chief's Diary,$79 Sewer Manager Diary,$7A Sewer Manager Fax,$7B Film D,$7C Vaccine Synthesis,$7D Lab Security Manual,$7E P-Epsilon Report,$7F Rookie Files,$80 Rookie Files (?),$81 No Item,$82 Spade Key,$83 Diamond Key,$84 Desk Key,$85 Heart Key,$86 Club Key,$87 Virgin Heart,$88 Square Crank,$89 Down Key,$8A Up Key,$8B Locker Key +Cheat23="Max Item Modifier\Slot 08",800E59E4 00??,800E59E5 00FF +Cheat23_O=$00 Nothing,$01 Knife Hunk,$02 Handgun Hunk,$03 Handgun Different Ada,$04 Custom Handgun Hunk,$05 Magnum Hunk,$06 Custom Magnum Hunk,$07 Shotgun Hunk,$08 Custom Shotgun Hunk,$09 Grenade Launcher Claire,$0A Grenade Launcher (Flame Rounds) Claire,$0B Grenade Launcher (Acid Rounds) Claire,$0C Bowgun Claire,$0D Colt S.A.A. Claire,$0E Spark Shot Claire,$0F Sub Machine Gun Leon,$10 Flamethrower Leon,$11 Rocket Launcher Claire,$12 Gatling Gun Claire,$13 Machine Gun ???,$14 Handgun Bullets,$15 Shotgun Shells,$16 Magnum Bullets,$17 Fuel,$18 Grenade Rounds,$19 Flame Rounds,$1A Acid Rounds,$1B Machine Gun Bullets,$1C S. Shot Bullets,$1D Bow Gun Bolts,$1E Ink Ribbon,$1F Small Key,$20 Hand Gun Parts,$21 Magnum Parts,$22 Shotgun Parts,$23 First Aid Spray,$24 Chemical FR-W09,$25 Chemical AC-W24,$26 Green Herb,$27 Red Herb,$28 Blue Herb,$29 Mixed Herb (Green),$2A Mixed Herb (Red&Green),$2B Mixed Herb (Blue&Green),$2C Mixed Herb (?),$2D Mixed Herb (?),$2E Mixed Herb (?),$2F Lighter,$30 Lock Pick,$31 Picture,$32 Valve Handle,$33 Red Jewel,$34 Red Card Key,$35 Blue Card Key,$36 Serpent Stone,$37 Jaguar Stone,$38 Blue Stone,$39 Blue Stone (?),$3A Eagle Stone,$3B Bishop Plug,$3C Rook Plug,$3D Knight Plug,$3E King Plug,$3F W. Box Key,$40 Detonator,$41 Plastic Bomb,$42 Bomb&Detonator,$43 Crank,$44 Film,$45 Film (?),$46 Film (?),$47 Unicorn Medal,$48 Eagle Medal,$49 Wolf Medal,$4A G. Cogwheel,$4B Manhole Opener,$4C Main Fuse,$4D Fuse Case,$4E Vaccine,$4F Vaccine Cart.,$50 Film,$51 Base Vaccine,$52 G-Virus,$53 Special Key,$54 Joint S Plug,$55 Joint N Plug,$56 Cord,$57 Film,$58 Cabin Key,$59 Precinct Key (blue),$5A Precinct Key (red),$5B Precinct Key (?),$5C Precinct Key (green),$5D C. Panel Key (red),$5E C. Panel Key (yellow),$5F P. Room Key,$60 MO Disk,$61 Lab Card Key,$62 Master Key,$63 Platform Key,$64 No Item,$65 No Item,$66 No Item,$67 No Item,$68 Chris's Diary,$69 Mail to Chris,$6A Memo to Leon,$6B Police Memorandum,$6C Operation Report 1,$6D Mail to the Chief,$6E Mail to the Chief (?),$6F Secretary's Diary A,$70 Secretary's Diary B,$71 Operation Report 2,$72 User Registration,$73 Film A,$74 Film B,$75 Film C,$76 Patrol Report,$77 Watchman's Diary,$78 Chief's Diary,$79 Sewer Manager Diary,$7A Sewer Manager Fax,$7B Film D,$7C Vaccine Synthesis,$7D Lab Security Manual,$7E P-Epsilon Report,$7F Rookie Files,$80 Rookie Files (?),$81 No Item,$82 Spade Key,$83 Diamond Key,$84 Desk Key,$85 Heart Key,$86 Club Key,$87 Virgin Heart,$88 Square Crank,$89 Down Key,$8A Up Key,$8B Locker Key +Cheat24="Max Item Modifier\Slot 09",800E59E8 00??,800E59E9 00FF +Cheat24_O=$00 Nothing,$01 Knife Hunk,$02 Handgun Hunk,$03 Handgun Different Ada,$04 Custom Handgun Hunk,$05 Magnum Hunk,$06 Custom Magnum Hunk,$07 Shotgun Hunk,$08 Custom Shotgun Hunk,$09 Grenade Launcher Claire,$0A Grenade Launcher (Flame Rounds) Claire,$0B Grenade Launcher (Acid Rounds) Claire,$0C Bowgun Claire,$0D Colt S.A.A. Claire,$0E Spark Shot Claire,$0F Sub Machine Gun Leon,$10 Flamethrower Leon,$11 Rocket Launcher Claire,$12 Gatling Gun Claire,$13 Machine Gun ???,$14 Handgun Bullets,$15 Shotgun Shells,$16 Magnum Bullets,$17 Fuel,$18 Grenade Rounds,$19 Flame Rounds,$1A Acid Rounds,$1B Machine Gun Bullets,$1C S. Shot Bullets,$1D Bow Gun Bolts,$1E Ink Ribbon,$1F Small Key,$20 Hand Gun Parts,$21 Magnum Parts,$22 Shotgun Parts,$23 First Aid Spray,$24 Chemical FR-W09,$25 Chemical AC-W24,$26 Green Herb,$27 Red Herb,$28 Blue Herb,$29 Mixed Herb (Green),$2A Mixed Herb (Red&Green),$2B Mixed Herb (Blue&Green),$2C Mixed Herb (?),$2D Mixed Herb (?),$2E Mixed Herb (?),$2F Lighter,$30 Lock Pick,$31 Picture,$32 Valve Handle,$33 Red Jewel,$34 Red Card Key,$35 Blue Card Key,$36 Serpent Stone,$37 Jaguar Stone,$38 Blue Stone,$39 Blue Stone (?),$3A Eagle Stone,$3B Bishop Plug,$3C Rook Plug,$3D Knight Plug,$3E King Plug,$3F W. Box Key,$40 Detonator,$41 Plastic Bomb,$42 Bomb&Detonator,$43 Crank,$44 Film,$45 Film (?),$46 Film (?),$47 Unicorn Medal,$48 Eagle Medal,$49 Wolf Medal,$4A G. Cogwheel,$4B Manhole Opener,$4C Main Fuse,$4D Fuse Case,$4E Vaccine,$4F Vaccine Cart.,$50 Film,$51 Base Vaccine,$52 G-Virus,$53 Special Key,$54 Joint S Plug,$55 Joint N Plug,$56 Cord,$57 Film,$58 Cabin Key,$59 Precinct Key (blue),$5A Precinct Key (red),$5B Precinct Key (?),$5C Precinct Key (green),$5D C. Panel Key (red),$5E C. Panel Key (yellow),$5F P. Room Key,$60 MO Disk,$61 Lab Card Key,$62 Master Key,$63 Platform Key,$64 No Item,$65 No Item,$66 No Item,$67 No Item,$68 Chris's Diary,$69 Mail to Chris,$6A Memo to Leon,$6B Police Memorandum,$6C Operation Report 1,$6D Mail to the Chief,$6E Mail to the Chief (?),$6F Secretary's Diary A,$70 Secretary's Diary B,$71 Operation Report 2,$72 User Registration,$73 Film A,$74 Film B,$75 Film C,$76 Patrol Report,$77 Watchman's Diary,$78 Chief's Diary,$79 Sewer Manager Diary,$7A Sewer Manager Fax,$7B Film D,$7C Vaccine Synthesis,$7D Lab Security Manual,$7E P-Epsilon Report,$7F Rookie Files,$80 Rookie Files (?),$81 No Item,$82 Spade Key,$83 Diamond Key,$84 Desk Key,$85 Heart Key,$86 Club Key,$87 Virgin Heart,$88 Square Crank,$89 Down Key,$8A Up Key,$8B Locker Key +Cheat25="Max Item Modifier\Slot 10",800E59EC 00??,800E59ED 00FF +Cheat25_O=$00 Nothing,$01 Knife Hunk,$02 Handgun Hunk,$03 Handgun Different Ada,$04 Custom Handgun Hunk,$05 Magnum Hunk,$06 Custom Magnum Hunk,$07 Shotgun Hunk,$08 Custom Shotgun Hunk,$09 Grenade Launcher Claire,$0A Grenade Launcher (Flame Rounds) Claire,$0B Grenade Launcher (Acid Rounds) Claire,$0C Bowgun Claire,$0D Colt S.A.A. Claire,$0E Spark Shot Claire,$0F Sub Machine Gun Leon,$10 Flamethrower Leon,$11 Rocket Launcher Claire,$12 Gatling Gun Claire,$13 Machine Gun ???,$14 Handgun Bullets,$15 Shotgun Shells,$16 Magnum Bullets,$17 Fuel,$18 Grenade Rounds,$19 Flame Rounds,$1A Acid Rounds,$1B Machine Gun Bullets,$1C S. Shot Bullets,$1D Bow Gun Bolts,$1E Ink Ribbon,$1F Small Key,$20 Hand Gun Parts,$21 Magnum Parts,$22 Shotgun Parts,$23 First Aid Spray,$24 Chemical FR-W09,$25 Chemical AC-W24,$26 Green Herb,$27 Red Herb,$28 Blue Herb,$29 Mixed Herb (Green),$2A Mixed Herb (Red&Green),$2B Mixed Herb (Blue&Green),$2C Mixed Herb (?),$2D Mixed Herb (?),$2E Mixed Herb (?),$2F Lighter,$30 Lock Pick,$31 Picture,$32 Valve Handle,$33 Red Jewel,$34 Red Card Key,$35 Blue Card Key,$36 Serpent Stone,$37 Jaguar Stone,$38 Blue Stone,$39 Blue Stone (?),$3A Eagle Stone,$3B Bishop Plug,$3C Rook Plug,$3D Knight Plug,$3E King Plug,$3F W. Box Key,$40 Detonator,$41 Plastic Bomb,$42 Bomb&Detonator,$43 Crank,$44 Film,$45 Film (?),$46 Film (?),$47 Unicorn Medal,$48 Eagle Medal,$49 Wolf Medal,$4A G. Cogwheel,$4B Manhole Opener,$4C Main Fuse,$4D Fuse Case,$4E Vaccine,$4F Vaccine Cart.,$50 Film,$51 Base Vaccine,$52 G-Virus,$53 Special Key,$54 Joint S Plug,$55 Joint N Plug,$56 Cord,$57 Film,$58 Cabin Key,$59 Precinct Key (blue),$5A Precinct Key (red),$5B Precinct Key (?),$5C Precinct Key (green),$5D C. Panel Key (red),$5E C. Panel Key (yellow),$5F P. Room Key,$60 MO Disk,$61 Lab Card Key,$62 Master Key,$63 Platform Key,$64 No Item,$65 No Item,$66 No Item,$67 No Item,$68 Chris's Diary,$69 Mail to Chris,$6A Memo to Leon,$6B Police Memorandum,$6C Operation Report 1,$6D Mail to the Chief,$6E Mail to the Chief (?),$6F Secretary's Diary A,$70 Secretary's Diary B,$71 Operation Report 2,$72 User Registration,$73 Film A,$74 Film B,$75 Film C,$76 Patrol Report,$77 Watchman's Diary,$78 Chief's Diary,$79 Sewer Manager Diary,$7A Sewer Manager Fax,$7B Film D,$7C Vaccine Synthesis,$7D Lab Security Manual,$7E P-Epsilon Report,$7F Rookie Files,$80 Rookie Files (?),$81 No Item,$82 Spade Key,$83 Diamond Key,$84 Desk Key,$85 Heart Key,$86 Club Key,$87 Virgin Heart,$88 Square Crank,$89 Down Key,$8A Up Key,$8B Locker Key + +//---- + +[C3E7E29E-5D7251CC-C:50] +Name=Re-Volt (E) +Cheat0="Access All\Cars & Tracks",8104ADF6 0001 +Cheat1="Access All\Cups",5000032C 0000,8105444A 00FF +Cheat2="Always 1st",811157AE 0001,811157B6 0000,8110C33E 02F4 +Cheat3="Infinite Continues",8110C332 0006 +Cheat4="Drones Have No Weapons",8111CECE 0000 +Cheat5="Infinite Weapons\Player 1",81115798 0000,8111579A 00??,8111579E 0001 +Cheat5_O=$00 Green Missile,$01 Orange Missile,$02 Multi-Orange Missiles,$03 The Bomb,$04 Water Balloon,$05 Blue Protector,$06 Oil Slick,$07 Bowling Ball Mine,$08 Yellow Protector,$09 Lightning Bolt,$0A Orange Star,$0B Beach Ball +Cheat6="Laps To Race",8107DD1E 00?? +Cheat6_O=$01 1 Lap,$02 2 laps,$03 3 Laps,$04 4 Laps,$05 5 Laps,$06 6 Laps,$07 7 Laps,$08 8 Laps,$09 9 Laps +Cheat7="Number Of Drones In The Race",8110FFF6 00?? +Cheat7_O=$01 1 Drone,$02 2 Drones,$03 3 Drones,$04 4 Drones,$05 5 Drones,$06 6 Drones,$07 7 Drones,$08 8 Drones,$09 9 Drones +Cheat8="99 Points Player 1",8010C33F 0063 +Cheat9="Infinite Weapons\Player 2",81117C60 0000,81117C62 00??,81117C66 0001 +Cheat9_O=$00 Green Missile,$01 Orange Missile,$02 Multi-Orange Missiles,$03 The Bomb,$04 Water Balloon,$05 Blue Protector,$06 Oil Slick,$07 Bowling Ball Mine,$08 Yellow Protector,$09 Lightning Bolt,$0A Orange Star,$0B Beach Ball +Cheat10="Infinite Weapons\Player 3",8111A128 0000,8111A12A 00??,8111A12E 0001 +Cheat10_O=$00 Green Missile,$01 Orange Missile,$02 Multi-Orange Missiles,$03 The Bomb,$04 Water Balloon,$05 Blue Protector,$06 Oil Slick,$07 Bowling Ball Mine,$08 Yellow Protector,$09 Lightning Bolt,$0A Orange Star,$0B Beach Ball +Cheat11="Infinite Weapons\Player 4",8111C5F0 0000,8111C5F2 00??,8111C5F6 0001 +Cheat11_O=$00 Green Missile,$01 Orange Missile,$02 Multi-Orange Missiles,$03 The Bomb,$04 Water Balloon,$05 Blue Protector,$06 Oil Slick,$07 Bowling Ball Mine,$08 Yellow Protector,$09 Lightning Bolt,$0A Orange Star,$0B Beach Ball + +//---- + +[02D8366A-6CABEF9C-C:50] +Name=Road Rash 64 (E) +Cheat0="Always 1st",810D7D96 0000 +Cheat1="Max Cash",810D6FBA FFFF +Cheat2="Access All Bikes & Tracks",810A7D16 0063 +Cheat3="Access All Weapons For All Modes",50000E02 0000,811B9EFA 0505 +Cheat4="Infinite Damage",801C1257 0002 +Cheat5="Infinite Health\To Bike",811B9BB8 4270 +Cheat6="Infinite Health\To Character",811C0F90 4489 +Cheat7="No Music In Game",810D61AE 0000 +Cheat8="No Music Elsewhere",810D61AA 0000 + +//---- + +[74E87A70-6293AED4-C:50] +Name=ROADSTERS TROPHY +Cheat0="Always 1st",800C1F81 0001 +Cheat1="Laps To Race",800A4649 00?? +Cheat1_O=$01 1 Lap,$02 2 laps,$03 3 Laps,$04 4 Laps,$05 5 Laps,$06 6 Laps,$07 7 Laps,$08 8 Laps,$09 9 Laps +Cheat2="Access All Trophies",800BAA9B 0007,800BACAF 0007 +Cheat2_N=Also gives you all extra features in quick race & Trophy mode +Cheat3="Max Race Points",800BACBE 00FF +Cheat4="Have Lots Of Seasons",810BACAA 02F4 +Cheat5="Max Cash",810BACA4 3AFF,810BACA6 F3FA +Cheat6="Cheats Enabled Modifier",8108F8F0 ???? +Cheat6_O=$0004 Fast Bucks (You Get 250,$0008 Easy Money (You Get 1,$0010 Trophies (Second And Third Championships Wins),$0020 Smurfing (High Pitched Voices),$0040 Big Wheels (Big Foot Cars),$0080 Skywalker (Hover Cars),$0100 Car Radio (Remote Control Cars),$0200 Chopper (Top Down View),$0400 Anyway (Race Circuits Backwards),$0800 Extra Resolution (Able To Change Resolution In Options Screen) +Cheat7="Easy Win",800BACAD 000A +Cheat7_N=Right After Start,Go, Quit Race, And you Have Won +Cheat8="All Cars\Max Upgrade",5000220C 0200,810BAD56 0270 +Cheat9="All Cars\Infinite Supply Of Super Tires",5000220C 0000,810BAD58 0F0F,5000220C 0000,810BAD5A 0F0F +Cheat10="Special Category A Car\Mind Star 600",810BAE8E 3D70,810BAE90 0F0F,810BAE92 0F0F +Cheat11="Special Category B Car\Vertige Stallion",810BAE16 2378,810BAE18 0F0F,810BAE1A 0F0F +Cheat12="Special Category C Car\Mind Star 200R",810BAD86 0A78,810BAD88 0F0F,810BAD8A 0F0F +Cheat13="Race Direction Options",810A4600 00?? +Cheat13_O=$00 Normal,$01 Reverse,$02 Mirrored Normal,$03 Mirrored Reverse +Cheat14="View Select",D00C2171 0000,800C2171 00?? +Cheat14_O=$00 Inside Car,$01 Behind View,$02 Further Behind View,$0B Distant Behind View,$FF Helicopter View +Cheat14_N=Select your View and then at start of Race press C-Up Button +Cheat15="Track Select",8008FA5D 00?? +Cheat15_O=$00 Rocket Base,$01 Temple,$02 Ski Resort,$03 Lumber Mill,$04 Area 51,$05 Oilfields,$06 Tudor Village,$07 Chateau,$08 Docklands,$09 Titus Park + +//---- + +[9FF69D4F-195F0059-C:50] +Name=Robotron 64 (E) +Cheat0="Infinite Lives",8109B0EE 03E7,810AD24E 03E7 +Cheat1="Level select",81076FB6 6F74 +Cheat1_N=Set Up In Menu +Cheat2="Fast Run",8009B14F 0003 +Cheat3="Rapid fire",8009B15F 0003 +Cheat4="Easy Difficulty level",800AD243 0000 +Cheat5="Speed level 1 Slow",800AD247 0000 + +//---- + +[9FD375F8-45F32DC8-C:50] +Name=Rocket - Robot on Wheels (E) +Cheat0="Infinite & Max Health",8109FB82 000C,8109FB84 000A +Cheat1="Activate All In-Game Cheats",810A6846 F5FF +Cheat1_N=With this code on, all rocket's abilities are now max +Cheat2="Access All Ticket Switches & Vehicles",800A5E1F 0001,50002004 0000,810A5D70 FFFF + +//---- + +[60D5E10B-8BEDED46-C:50] +Name=Rayman2 The Great Escape (E) +Cheat0="Infinite\Max Health",811BC54C 001E +Cheat1="Infinite\Oxygen",810F4A80 4396 +Cheat2="Open Options\levels & Map",50000801 0000,801F1101 00FF +Cheat3="Open Options\Open all cages",801F1032 0050,50000602 0000,811F10E0 FFFF +Cheat4="Have All\Yellow Lums",50006401 0000,800C6FF8 00FF,50001901 0000,800C6FAD 00FF,811F1072 0005,50005702 0000,811F1078 FFFF +Cheat5="Have All\Crates",810C6FE8 7FFF,50000602 0000,810C6FEA FFFF,800C6FF2 00FF +Cheat6="All Masks",891F1110 8780 +Cheat6_N=Press GS To Activate All Masks + +//---- + +[8BD4A334-1E138B05-C:50] +Name=Ready 2 Rumble Boxing (E) +Cheat0="Infinite\Health",810D8E8A 00??,810E6522 00?? +Cheat1="Infinite\Stamina",810D8E8E 00??,810E6526 00?? +Cheat2="Have Max Rumble",810D8E96 00??,810E61B8 00?? +Cheat3="Infinite\Cash",810EB852 FC9A +Cheat4="Infinite\Time",810E6486 0E10 +Cheat0_O=$64 Infinite,$00 No Health +Cheat1_O=$64 Infinite,$00 No Stamina +Cheat2_O=$30 Max,$00 Never Rumble + +//---- + +[FEE97010-4E94A9A0-C:50] +Name=RR64 - Ridge Racer 64 (E) +Cheat0="Always 1st",810569B4 0001 +Cheat1="Infinite Time",811280B2 0C00 +Cheat2="Freeze Lap Timer",810569DE 014D +Cheat3="Access All\Cars,Tracks & Golg Trophies",50000402 0000,81043AA0 FFFF +Cheat4="Access All\Platinum Trophies",8102F70C FFFF,8102F70E FFFF +Cheat5="Ultra 64",8113DDBA 0018 +Cheat6="Access\Galage '88 UFO Car",810E2C20 0028 +Cheat7="Easy Win",810569BA 0007 +Cheat8="Easy Mode",81057B10 0001 +Cheat9="Freeze Lap Timer",810569DE 014D,810569CA 00C7,810569CE 00C7,810569EA 014D,810569EE 014D,810569F2 014D +Cheat10="Always Engine Class S",81043AB0 0000 +Cheat11="Laps to Race",8111CA16 00?? +Cheat11_O=$01 1 Lap to Race,$02 2 Laps to Race,$03 3 Laps to Race,$04 4 Laps to Race,$05 5 Laps to Race,$06 6 Laps to Race,$07 7 Laps to Race,$08 8 Laps to Race,$09 9 Laps to Race +Cheat2_N=Select Car Attack, And You'll Have All The Cars At Your Disposal For A Quick Spin !! +Cheat5_N=Pick any car, beat stage 8: RR Extreme Extra and the UFO car is yours to drive! +Cheat11_N=Here you can choose how many laps are in the race, 1-9. Do not use with Option 7-9. + +//---- + +[4D3ADFDA-7598FCAE-C:50] +Name=Rugrats - Treasure Hunt (E) +Cheat0="Infinite Energy\Player 1",80254A76 001E,8025CCF6 001E +Cheat1="Infinite Energy\Player 2",80257B86 001E,80260846 001E +Cheat2="Infinite Energy\Player 3",8025ACA6 001E,802637A6 001E +Cheat3="Infinite Energy\Player 4",8025E0E6 001E,80266B76 001E + +//---- + +[0AC61D39-ABFA03A6-C:50] +Name=Rugrats in Paris - The Movie (E) +Cheat0="Tickets\Red",8111F8C6 FFFF +Cheat1="Tickets\Gold",8111F8C8 FFFF +Cheat2="Access all items In Inventory",8111F8BE 1FFF + +//---- + +[67D21868-C5424061-C:50] +Name=Rakuga Kids (E) +Cheat0="Infinite Energy\Player 1",800ACB89 00?? +Cheat0_O=$00 None,$40 Max +Cheat1="Infinite Energy\Player 2",800ACC79 00?? +Cheat1_O=$00 None,$3F Max +Cheat2="Super Attacks\Player 1",800ACB8D 00?? +Cheat2_O=$00 None,$03 3 +Cheat3="Super Attacks\Player 2",800ACC7D 00?? +Cheat3_O=$00 None,$03 3 +Cheat4="Infinite Match Time",800ABC33 0000 +Cheat5="Unlock Extras",800ACD55 00FF,800ACD57 00FF + +//---- + +[918E2D60-F865683E-C:50] +Name=S.C.A.R.S. (E) +Cheat0="Always 1st",813E00E8 0001 +Cheat1="Access\All Cups",50000302 0000,812CB7C8 0001 +Cheat2="Access\All Challenges",50000502 0000,813DD428 0001 +Cheat3="Access\All Cars",50000402 0000,813DFC6A 0001 +Cheat4="Infinite\Turbo's",8039B464 0000,8039B467 0000,8039B469 0009 +Cheat5="Infinite\Magnet's",8039B464 0001,8039B467 0001,8039B469 0009 +Cheat6="Infinite\Stinger's",8039B464 0003,8039B467 0003,8039B469 0009 +Cheat7="Infinite\Boomerang's",8039B464 0004,8039B467 0004,8039B469 0009 +Cheat8="Infinite\Seeker's",8039B464 0005,8039B467 0005,8039B469 0009 +Cheat9="Infinite\Stopper's",8039B464 0006,8039B467 0006,8039B469 0009 +Cheat10="Infinite\Bullet's",8039B464 0007,8039B467 0007,8039B469 0009 +Cheat11="Infinite\Shield's",8039B464 0008,8039B467 0008,8039B469 0009 +Cheat12="Laps To Race",813BBD5C 00?? +Cheat12_O=$01 1 Lap,$02 2 laps,$03 3 Laps,$04 4 Laps,$05 5 Laps,$06 6 Laps,$07 7 Laps,$08 8 Laps,$09 9 Laps +Cheat13="Infinite\CREDITS",80388F3D 0003 +Cheat14="Psycho Weapons",8039B469 0003,802B85A3 0003 + +//---- + +[61D116B0-FA24D60C-C:50] +Name=San Francisco Rush - Extreme Racing (E) +Cheat0="Always 1st",80101409 0000 +Cheat1="Max Race Points",810DACCA 02F4 +Cheat2="Laps To Race",800E7411 00?? +Cheat2_O=$01 1 Lap,$02 2 laps,$03 3 Laps,$04 4 Laps,$05 5 Laps,$06 6 Laps,$07 7 Laps,$08 8 Laps,$09 9 Laps +Cheat3="Gravity Modifier",800F3E61 00?? +Cheat3_O=$00 Ballon & Two Weights,$01 One Weight,$02 Two Weights +Cheat4="No\Car Collisions",800F4120 0001 +Cheat5="No\Auto Abort",800F4140 0001 +Cheat6="Resurrect In Place",800F4150 0001 +Cheat7="Stop Timer",800F4160 0001 +Cheat8="Big Front Wheels",800DA02C 0002 +Cheat9="Big Back Wheels",800DA03C 0002 +Cheat10="Difficulty Very Easy",810D9F7A 0002 +Cheat11="Automatic Transmission",800C8100 0001 +Cheat12="Access The Rock Alcatraz bonus level",D00F4174 0002,80100120 0006 +Cheat12_N=Press C-right, on any level, at the track selection screen +Cheat13="All\Keys & Cars",50000E16 0000,810CAD52 FFFF +Cheat14="All\Keys & Cars Circuits",8105696E FFFF,8105699A FFFF,50000404 0000,81056910 FFFF + +//---- + +[B7CF2136-FA0AA715-C:50] +Name=San Francisco Rush 2 - Extreme Racing USA (E) +Cheat0="Always 1st",80115499 0000 +Cheat1="Max Points In Total",810E235A 03E7 +Cheat2="Laps To Race",811088D0 00?? +Cheat2_O=$01 1 Lap,$02 2 laps,$03 3 Laps,$04 4 Laps,$05 5 Laps,$06 6 Laps,$07 7 Laps,$08 8 Laps,$09 9 Laps +Cheat3="Number Of Drones In Race",810E1B88 00?? +Cheat3_O=$01 1 Drone,$02 2 Drones,$03 3 Drones,$04 4 Drones,$05 5 Drones,$06 6 Drones,$07 7 Drones,$08 8 Drones,$09 9 Drones +Cheat4="Best Stunt Points",8110B438 02F4 +Cheat4_N=On Track +Cheat5="Max & Best Score",50000502 0000,810C4702 FFFF +Cheat5_N=On Stunt Track +Cheat6="All Keys,Cars & Cans",50000E02 0000,810C4574 FFFF +Cheat7="Access All In-Game Cheats",810C48F8 0100 +Cheat7_N=In Set-Up Menu +Cheat8="Activate All In-Game Cheats",50000E02 0000,810C48A4 FFFF +Cheat9="Access Midway Track",810C4890 02F4 +Cheat10="Easy Difficulty",8010FFAA 0000 +Cheat11="No\Checkpoints Extended Time",8010FF47 0000 +Cheat12="No\Wind",80116E98 0000 + +//---- + +[51D29418-D5B46AE3-C:50] +Name=San Francisco Rush 2049 (E) +Cheat0="Always 1st",80177D4E 0000 +Cheat1="Max Race Points",8117CE22 02F4 +Cheat2="Laps To Race",81177A18 00?? +Cheat2_O=$01 1 Lap,$02 2 laps,$03 3 Laps,$04 4 Laps,$05 5 Laps,$06 6 Laps,$07 7 Laps,$08 8 Laps,$09 9 Laps +Cheat3="Number Of Drones In Race",81163240 00?? +Cheat3_O=$01 1 Drone,$02 2 Drones,$03 3 Drones,$04 4 Drones,$05 5 Drones,$06 6 Drones,$07 7 Drones,$08 8 Drones,$09 9 Drones +Cheat4="Access All In-Game Cheats",81118E9A 0001 +Cheat5="Activate All In-Game Cheats",50000D02 0000,81118E82 0101 +Cheat6="All Silver & Gold Coins",50000660 0000,8116375C FFFF +Cheat6_N=Single, Practice & Circuit Mode +Cheat7="All Silver & Gold Coins",50000660 0000,811C542C FFFF +Cheat7_N=Circuit Mode - Using Controller Pack +Cheat8="All Silver & Gold Coins",50000440 0000,81163BBC FFFF +Cheat8_N=Stunt Mode +Cheat9="Extended Time In Battle & Stunt Mode To 2.05 Hours",811633BA 457C,811636EE 4514 +Cheat10="Stunt Wings All Modes",D017055A 0004,50000C02 0000,811139D0 0202 +Cheat10_N=Where Wings Are Available Press D-Pad Up On Wing Select +Cheat11="Stunt Wings Circuit Mode",D017055A 0004,50000C02 0000,801756A1 0202 +Cheat11_N=Press D-Pad Up On Wing Select +Cheat12="Easy Difficulty level",80177A3C 0000 +Cheat13="Max Points Stunt Mode",81177A55 3AFF,81177A57 F3FA + +//---- + +[E3BD221D-3C0834D3-C:50] +Name=Scooby-Doo - Classic Creep Capers (E) +Cheat0="Have All Items\What a night for a knight",811BA010 0101,811BA012 0101,811BA014 0101,811BA016 0101,811BA018 0101 +Cheat1="Infinite Courage",810BB096 0007,F107D9B0 0000 + +//---- + +[60C437E5-A2251EE3-C:50] +Name=Shadowman (E) +Cheat0="Have All\Items",D0059047 0001,50001D20 0000,80030613 000B +Cheat0_N=Youll not miss out any part of the game for having all parts of LEclipsers with a new game +Cheat1="Have All\Gads & The Poign",80030E57 000F +Cheat2="Have All\Levels Unlocked",5000101C 0000,80030A0E 0001 +Cheat3="Have All\Cheats: Book of Shadows",81075F4E 0FFF +Cheat4="Have All\Dark Souls Collected",D00590B3 0001,80075F49 007C +Cheat5="Infinite\Shotgun Shells",80075B2F 0063 +Cheat6="Infinite\Violator Ammo",81075B32 029A +Cheat7="Infinite\Cadeaux'",81075B36 029A +Cheat8="Infinite\0.9mm Ammo",81075B3A 0190 +Cheat9="Infinite\Max Health/Air/Shadow Charge & Voodoo Power",50000604 0000,81075B16 2710 +Cheat10="Infinite\Accumulators",800306D7 0005 +Cheat11="Infinite\Retractors",800308B7 0003 +Cheat12="Infinite\Prisms",80030957 0003 +Cheat13="Ammo always displayed on screen",50000408 0000,80075ACD 0007 +Cheat14="Press L To Levitate",D0059097 0020,80075578 0041 + +//---- + +[5FD7CDA0-D9BB51AD-C:50] +Name=Snowboard Kids (E) +Cheat0="Infinite Cash",8112272A 02F4 +Cheat1="Access Everything",810B3160 0100,810B3164 0F00 +Cheat2="1 Lap To Race",D01226C8 0000,801226C8 0009 +Cheat3="Infinite Tools Options",801226D5 00?? +Cheat3_O=$01 Fan,$02 Ghost,$03 Pan,$04 Rock,$05 Mouse,$06 Board +Cheat4="Infinite Weapons\Lucky Dip",801226D4 0003 +Cheat1_N="Have All Characters,Cups,Courses,&Boards" +Cheat4_N="Lucky Dip is Infinite Usage Of What Ever You Get From Each Red Box" + +//---- + +[C2751D1A-F8C19BFF-C:50] +Name=Snowboard Kids 2 (E) +Cheat0="Max Coins",8120639E 270F +Cheat1="Access Everything\Start New Game",50000502 0002,80204F3B 0013,50000502 0002,80204F42 0009,50000402 0002,80204F43 000A,80204F4B 000D,81204F4C 0E0F,81204F4E 0101,81204F5A 0100 +Cheat2="Trick Game 300 Points",812065D2 012C +Cheat3="Infinite Tools Options",80206404 00?? +Cheat3_O=$01 Frying Pan,$02 Ghost,$03 Super Ghost,$04 Fan,$05 Rocket,$06 Invisible,$07 Rock,$08 Rat Face,$09 Super Rat Face,$0A Wings +Cheat4="Infinite Weapons Options",80206402 00??,80206403 0009 +Cheat4_O=$01 Slap Stick,$02 Parachute,$03 Freeze Shot,$04 Snowman,$05 Bomb,$06 Whirlwind +Cheat5="Max Money(Story Mode)",81204EB0 0098,81204EB2 967F +Cheat6="Open Extra Characters",81204F4E 0101,80204F50 0001 +Cheat7="Have All Snowboards",80204F3C 0001,81204F3E 0101,81204F40 0101 + +//---- + +[20B53662-7B61899F-C:50] +Name=South Park (E) +Cheat0="Have Cheats Menu",800D77D6 01FF +Cheat1="Infinite Energy ",802FD209 0064 +Cheat2="Infinite Credits",802FD215 0064 +Cheat3="Infinite Sponge Darts",802FD223 0064 +Cheat4="Infinite Suckers",802FD222 0064 +Cheat5="Infinite Balls ",802FD21F 0064 +Cheat6="Start with 9999 Monster Score ",812FD20E 270F + +//---- + +[4F8AFC3A-F7912DF2-C:50] +Name=South Park Rally (E) +Cheat0="Infinite Credits",8008D659 0005 +Cheat1="Have All Tracks",8108875A FFFF +Cheat2="Have All Races",81088756 FFFF +Cheat3="Unlock All Characters & Extra Cheats",81088750 FFFF,81088752 FFFF + +//---- + +[FC70E272-08FFE7AA-C:50] +Name=Silicon Valley +Cheat0="Great Score",813F2E22 02F4 +Cheat1="Title Screen",803F6799 0000 +Cheat2="Debug Mode",803F651F 0001 +Cheat3="Enable Secret Mini Game",803F652D 0001 +Cheat4="High Score In Evo's Escape",813E4DDA 7FFF +Cheat5="0 Enemies To Kill In Big Celebration Parade",803E4DBB 0000 +Cheat6="Infinite Health\EVO",801DE085 0080 +Cheat7="Always Raining",803F2E5F 0005 +Cheat8="Always Snowing",803F2E5D 0005 +Cheat9="Always in 2nd Camera Angle",803F2B89 0001 +Cheat10="All levels open",50002001 0000,803F7ED0 0001 +Cheat11="Infinite Health\2 Mouse,Hyena",801DFB51 0080 +Cheat12="Infinite Health\Rocket Dog",801DEC01 0080 +Cheat13="Infinite Health\King Rat",801E19F1 0080 +Cheat14="Infinite Health\Spit Dog, Bear, King Pen, FB EVO",801DE459 0080 +Cheat15="Infinite Health\Fox, Pen, Husky, Tortoise Tank",801DFF25 0080 +Cheat16="Infinite Health\Bunny, Racing Turtle",801DF3A9 0080 +Cheat17="Infinite Health\Rocket Husky",801E1DC5 0080 +Cheat18="Infinite Health\Cool Cod",801E4039 0080 +Cheat19="Infinite Health\Elephant",801DE82D 0080 +Cheat20="Infinite Health\Lion, Camel",801E02F9 0080 +Cheat21="Infinite Health\Desert Fox",801E161D 0080 +Cheat22="Infinite Health\A. Desert Rat, Vulture, Box, Kang",801DEFD5 0080 +Cheat23="Infinite Skill\A\Power Mouse",801DFCE4 0004 +Cheat24="Infinite Skill\A\Rocket Dog",801E3A24 0004 +Cheat25="Infinite Skill\A\King Rat",801E1B84 0004 +Cheat26="Infinite Skill\A\King Penguin",801DE5EC 0004 +Cheat27="Infinite Skill\B\Rocket Dog",801E3A28 0004 +Cheat28="Infinite Skill\B\Bear",801DE5F0 0004 +Cheat29="Infinite Skill\B\Power Pen, Husky, Fox, Tort Tank",801E00BC 0004 +Cheat30="Infinite Skill\B\Bunny, Racing Turtle",801DF540 0004 +Cheat31="Infinite Skill\B\Rocket Husky",801E1F5C 0004 +Cheat32="Infinite Skill\B\Hyena",801DF914 0004 +Cheat33="Infinite Skill\B\Lion",801E0490 0004 +Cheat34="Infinite Skill\B\Armed Desert Rat",801DF16C 0004 +Cheat35="Infinite Skill\B\Desert Fox",801E17B4 0004 +Cheat36="Infinite Skill\B\Boxing Kangeroo",801DF16C 0004 +Cheat1_N=Press the Pause Button to takes you to Title Screen +Cheat11_N=Only Use Infinite Health Codes For Animals You Need +Cheat12_N=Only Use Infinite Health Codes For Animals You Need +Cheat13_N=Only Use Infinite Health Codes For Animals You Need +Cheat14_N=Only Use Infinite Health Codes For Animals You Need +Cheat15_N=Only Use Infinite Health Codes For Animals You Need +Cheat16_N=Only Use Infinite Health Codes For Animals You Need +Cheat17_N=Only Use Infinite Health Codes For Animals You Need +Cheat18_N=Only Use Infinite Health Codes For Animals You Need +Cheat19_N=Only Use Infinite Health Codes For Animals You Need +Cheat20_N=Only Use Infinite Health Codes For Animals You Need +Cheat21_N=Only Use Infinite Health Codes For Animals You Need +Cheat22_N=Only Use Infinite Health Codes For Animals You Need +Cheat23_N=Only Use Infinite Skill A Codes For Animals You Need +Cheat24_N=Only Use Infinite Skill A Codes For Animals You Need +Cheat25_N=Only Use Infinite Skill A Codes For Animals You Need +Cheat26_N=Only Use Infinite Skill A Codes For Animals You Need +Cheat27_N=Only Use Infinite Skill B Codes For Animals You Need +Cheat28_N=Only Use Infinite Skill B Codes For Animals You Need +Cheat29_N=Only Use Infinite Skill B Codes For Animals You Need +Cheat30_N=Only Use Infinite Skill B Codes For Animals You Need +Cheat31_N=Only Use Infinite Skill B Codes For Animals You Need +Cheat32_N=Only Use Infinite Skill B Codes For Animals You Need +Cheat33_N=Only Use Infinite Skill B Codes For Animals You Need +Cheat34_N=Only Use Infinite Skill B Codes For Animals You Need +Cheat35_N=Only Use Infinite Skill B Codes For Animals You Need +Cheat36_N=Only Use Infinite Skill B Codes For Animals You Need + +//---- + +[42CF5EA3-9A1334DF-C:50] +Name=StarCraft 64 (E) +Cheat0="Infinite Vespene gas,minerals & Most missions",50003202 0000,800B1D96 00FF +Cheat1="All levels complete",800D1364 000C,50000501 0000,800D1365 000A + +//---- + +[F4CBE92C-B392ED12-C:50] +Name=STARFOX64 Lylat Wars (E) +Cheat0="Unlimited\Boost",8113E6FC 0000,8113E6FE 0000,811415DC 0000,811415DE 0000,8013E7FD 0000,801416DD 0000 +Cheat1="Have All Medals",50000802 0000,8017A9D9 7777 +Cheat2="Infinite\Hyper Laser",80163B13 0002 +Cheat3="Loads O' Hits",80163B03 00FF +Cheat4="Infinite\Armor\Slippy",8017418B 00FF +Cheat5="Infinite\Energy",80141587 00FF,8013E6A7 00FF +Cheat6="Infinite\Lives",80163B09 0063 +Cheat7="Unlimited\Smart Bombs",80179E0B 0063 +Cheat8="Infinite\Armor\Falco",80174187 00FF +Cheat9="Infinite\Armor\Peppy",8017418F 00FF +Cheat10="Infinite\Dual Blue Lasers",80163C13 0002 +Cheat11="Level Select",8017A29F 00?? +Cheat12="999 Kills",80163B03 00FF +Cheat11_O=$00 Corneria,$01 Meteo,$02 Sector X,$03 Area 6,$04 Glitch,$05 Sector Y,$06 Venom 1,$07 Solar,$08 Zoness,$09 Venom 2,$0A Training Mode Level,$0B Macbeth,$0C Titania,$0D Aquas,$0E Fortuna,$10 Katina,$11 Bolse,$12 Sector Z,$13 Venom With Starwolf,$14 Corneria (Multi) +Cheat1_N=For Expert & Normal Modes + +//---- + +[D89E0E55-B17AA99A-C:50] +Name=Starshot - Space Circus Fever (E) +Cheat0="Infinite Lives",801A3E83 0063 +Cheat1="Infinite Shots",801A3EB7 0064 +Cheat2="Infinite Flight Time",801A3F1F 0064 +Cheat3="Infinite Mega Fuel",801A3EEB 0064 + +//---- + +[7EE0E8BB-49E411AA-C:50] +Name=Star Wars - Rogue Squadron (E) +Cheat0="Infinite Lives",81130B38 01C0 +Cheat0_N=This Also accesses advanced Shields & Radar +Cheat1="Invincibility",80130B2D 00FF +Cheat1_N=This Also Accesses All Levels And Makes All Crafts Available +Cheat2="Infinite Secondary Weapon",8010CA02 0063,80130B23 00?? +Cheat2_O=$01 Ion Cannon,$02 Missiles,$03 Seeker Missiles,$04 Bombs,$05 Proton Bombs,$07 Cluster Missiles,$08 Seeker Torpedos,$09 Seeker Cluster Missiles +Cheat3="Completion Time 0:00",80130B85 3FCB +Cheat4="Enemies Destroyed 756",81130B64 02F4 +Cheat5="Accuracy 100%",80130B5F 0063 +Cheat6="Friendly Saves 756",80130B66 02F4 +Cheat7="Bonus Collected 756",80130B67 02F4 +Cheat8="Always Pass Mission",80130AF4 0001 +Cheat9="Accesses\All Levels,Ships & Advanced Weapons",80130B3B 00FF +Cheat10="Access\69 Buick Electra",81130B3A 000E +Cheat10_N=Replaces The V-Wing +Cheat11="Access AT-ST Level",81130B38 1250 + +//---- + +[219191C1-33183C61-C:50] +Name=Star Wars - Rogue Squadron (E) (V1.1) +Cheat0="Infinite\Infinite Lives",80130B10 0008 +Cheat1="Extra Shields",81137E7C 4316 +Cheat2="Infinite\Infinite Secondary Weapons",8010CA32 0008 +Cheat3="Infinite\Infinite Health",81137E7C 4316 +Cheat4="Have 99\Bonus Collected",80130B87 0063 +Cheat5="Have 99\Kills",80130B85 0063 +Cheat6="Have 99\Saves",80130B86 0063 +Cheat7="1-Hit Death",81137E7C 4136 +Cheat8="Have Medals For\Ambush at Mos Eisley",88130B1C 00?? +Cheat8_O=$00 None,$01 Bronze Medal,$02 Silver Medal,$03 Gold Medal +Cheat9="Have Medals For\Rendezvou on Bankhesh",88130B1D 00?? +Cheat9_O=$00 None,$01 Bronze Medal,$02 Silver Medal,$03 Gold Medal +Cheat10="Have Medals For\The Search For The Noonnah",88130B1E 00?? +Cheat10_O=$00 None,$01 Bronze Medal,$02 Silver Medal,$03 Gold Medal +Cheat11="Have Medals For\Defection At Corellia",88130B1F 00?? +Cheat11_O=$00 None,$01 Bronze Medal,$02 Silver Medal,$03 Gold Medal +Cheat12="Have Medals For\Liberation V",88130B20 00?? +Cheat12_O=$00 None,$01 Bronze Medal,$02 Silver Medal,$03 Gold Medal +Cheat13="Have Medals For\The Jade Moon",88130B21 00?? +Cheat13_O=$00 None,$01 Bronze Medal,$02 Silver Medal,$03 Gold Medal +Cheat14="Have Medals For\Imperial Construction Yard",88130B22 00?? +Cheat14_O=$00 None,$01 Bronze Medal,$02 Silver Medal,$03 Gold Medal +Cheat15="Have Medals For\Assault on Kile II",88130B23 00?? +Cheat15_O=$00 None,$01 Bronze Medal,$02 Silver Medal,$03 Gold Medal +Cheat16="Have Medals For\Rescue on Kessel",88130B24 00?? +Cheat16_O=$00 None,$01 Bronze Medal,$02 Silver Medal,$03 Gold Medal +Cheat17="Have Medals For\Prisons on Kessel",88130B25 00?? +Cheat17_O=$00 None,$01 Bronze Medal,$02 Silver Medal,$03 Gold Medal +Cheat18="Have Medals For\Battle Above Taloraan",88130B26 00?? +Cheat18_O=$00 None,$01 Bronze Medal,$02 Silver Medal,$03 Gold Medal +Cheat19="Have Medals For\Escape From Fest",88130B27 00?? +Cheat19_O=$00 None,$01 Bronze Medal,$02 Silver Medal,$03 Gold Medal +Cheat20="Have Medals For\Blockade on Chandrila",88130B28 00?? +Cheat20_O=$00 None,$01 Bronze Medal,$02 Silver Medal,$03 Gold Medal +Cheat21="Have Medals For\Raid on Sullust",88130B29 00?? +Cheat21_O=$00 None,$01 Bronze Medal,$02 Silver Medal,$03 Gold Medal +Cheat22="Have Medals For\Moff Seerdon's Revenge",88130B2A 00?? +Cheat22_O=$00 None,$01 Bronze Medal,$02 Silver Medal,$03 Gold Medal +Cheat23="Have Medals For\The Battle of Calamari",88130B2B 00?? +Cheat23_O=$00 None,$01 Bronze Medal,$02 Silver Medal,$03 Gold Medal +Cheat24="Have Medals For\Beggar's Canyon",88130B2C 00?? +Cheat24_O=$00 None,$01 Bronze Medal,$02 Silver Medal,$03 Gold Medal +Cheat25="Have Medals For\The Death Star Trench Run",88130B2D 00?? +Cheat25_O=$00 None,$01 Bronze Medal,$02 Silver Medal,$03 Gold Medal +Cheat26="Have Medals For\Battle of Hoth",88130B2E 00?? +Cheat26_O=$00 None,$01 Bronze Medal,$02 Silver Medal,$03 Gold Medal + +//---- + +[4D486681-AB7D9245-C:50] +Name=Shadow of the Empire +Cheat0="Access In-Game Cheat Menu",D10DDE2E 0001,810D3F32 0001,D10DDE14 0002,810D3F32 0001,D10E28D4 0011,810D3F32 0001,D10E28D4 0011,810D3F32 0001 +Cheat0_N=Pause gameplay and pink text will appear in top screen. scroll with multiple buttons and select with 'A' +Cheat1="Access Wampa Stompa",8118D4E8 2057,8118D4EA 616D,8118D4EC 7061,8118D4EE 2020,8118D4F0 5374,8118D4F2 6F6D,8118D4F4 7061 +Cheat1_N=Important To Get All Codes To Work! Select empty file "Wampa Stompa" will now be your playername. +Cheat3="Max Challenge Points",8118F370 000F +Cheat4="Extra Jump Power",810E2220 3F92 +Cheat5="Freeze Timer",810E2230 4018 +Cheat2="Access All Levels",810DE2EA 0004 +Cheat2_N=Must be used with Access Wampa Stompa + +//---- + +[EAE6ACE2-020B4384-C:50] +Name=Star Wars Episode I - Battle for Naboo (E) +Cheat0="Level Select",8004C650 0013 +Cheat1="Always Pass Mission",8105C88E 0001 +Cheat2="Advanced Weapons,Shields & Extra Ships",8104C636 00FF +Cheat3="2X Secondary Weapons",8104C62A 0080 +Cheat4="Infinite Lives",80067553 03E7 +Cheat5="Access All Platinium Medals",50001301 0000,8004C63D 0004 +Cheat6="Completion Time 0:00",8105C892 0000 +Cheat7="Enemies Destroyed 756",8005C89D 02F4 +Cheat8="Accuracy 100%",8105C896 0064,8105C89A 0064 +Cheat9="Friendly Saves 756",8005C89E 02F4 +Cheat10="Bonus Collected",8005C89F 0002 +Cheat10_N=Where Bonus Are Available +Cheat11="Lives Remaining 756",8005C8A0 02F4 + +//---- + +[53ED2DC4-06258002-C:50] +Name=Star Wars Episode I - Racer (E) +Cheat0="No Damage",800AA5D7 0001 +Cheat0_N=If when Racing Your Pod Over heats & bursts into flames Press "R" & you will Repair the Damage. +Cheat1="Infinite Truguts",8111CB1A FFFF,8111CB18 7FFF +Cheat2="Always 1st",80121C8C 0001,80125489 0001 +Cheat3="Enable In-Game cheat Menu & Cheats",810A0D27 000A,810A0D2A FFFF +Cheat3_N=Here you can Activate the IN-Built Cheats Menu. At the Front Screen Just Press C-Button Right.This will open up All Tracks & Characters In Free Play & Time Attack. Also In A Race, Press The Start/Pause button to Access the In-Cheat-Menu Option.You can also choose how many Pod's Racers are in the Race & also how many Laps are in the Race in Free Play & Time Attack +Cheat4="Unlock All Tracks & Characters",8011CB08 00FF,8011CB09 00FF,8011CB0B 00FF,8111CB08 FFFF,8111C80A FFFF,8011CB14 007D,8111CB16 FFFF +Cheat4_N=When using Unlock All Tracks & Characters For can to pick & choose what ever you want to play As & where ;) +Cheat5="Have All Tracks Completed",8111CB0A FFFF,8111CB0C 3FFF,8111CB0E 3FFF,8111CB10 3FFF,8111CB12 00FF + +//---- + +[A03CF036-BCC1C5D2-C:50] +Name=SUPER MARIO 64 +Cheat0="Press GS For 255 Coins",893094D8 00FF +Cheat1="Have\Level Select",A02F973C 0001 +Cheat2="Don't Hurt Mario\Monsters",80309457 0001 +Cheat3="Infinite\Lives",803094DD 0064 +Cheat4="Infinite\Energy & Breath",803094DE 0008 +Cheat5="Have\Debug Mode",A02F9748 00?? +Cheat5_O=$01 On,$00 Off +Cheat6="Mario's Cap\Off Options",80309437 00?? +Cheat6_N=Here you can Choose Options with Mario without His Cap on,Do not use with any other Mario with/without Options,Use only one at a time +Cheat6_O=$01 Mario No Cap,$02 Invisible Mario,$04 Metal Mario,$08 Flying Mario,$0A Invisible Flying Mario,$0D Metal Flying Mario,$0F Invisible Metal Flying Mario +Cheat7="Mario's Cap\On Options",80309437 00?? +Cheat7_N=Here you can Choose Options with Mario with His Cap on,Do not use with any other Mario with/without Options,Use only one at a time +Cheat7_O=$12 Invisible Mario,$15 Metal Mario,$16 Invisible Metal Mario,$19 Flying Mario +Cheat8="Funny Mario Options\Mario's Cap\Off & in His Hand",80309437 00?? +Cheat8_N=Here you can Choose Options with Mario with His Cap off & in His Hand,Do not use with any other Mario with/without Options,Use only one at a time +Cheat8_O=$20 Cap In Hand,$22 Invisible Mario Cap In Hand,$24 Metal Mario Cap In Hand,$26 Invisible Metal Mario Cap In Hand,$28 Flying Mario Cap In Hand +Cheat9="Funny Mario Options\Mario's Cap\On & An Extra in His Hand",80309437 00?? +Cheat9_N=Here you can Choose Options with Mario with His Cap on & An Extra in His Hand,Do not use with any other Mario with/without Options,Use only one at a time +Cheat9_O=$30 Cap In Hand,$32 Invisible Mario Cap In Hand,$34 Metal Mario Cap In Hand,$36 Invisible Metal Mario Cap In Hand,$38 Flying Mario Cap In Hand +Cheat10="Don't Hurt Mario\Falling",8036CF6C 00E8,8136CEB8 FFFF +Cheat10_N=Press L to levitate & Let go to land +Cheat10="Press L To Levitate",D0309261 0020,8130947C 4220,D030947D 0020,8130943C 0300,D030947D 0020,8130943E 0880 +Cheat11="[Slot A Codes]\Have All 120 Stars",80202F23 0001,80202F0B 00C7,50001101 0000,80202F0C 00FF +Cheat11_N=Have 120 Stars,once the Code is activated, you will see it as a new option in Save Slot A.This will have the Cannon open already to get upto Yoshi on the Roof. but make sure to save the game after collecting Red Coins and turn this code off before saving. you will now have it all saved to mempak +Cheat12="[Slot A Codes]\Have all key doors unlocked (and mote empty)",80202F0A 007E +Cheat13="[Slot A Codes]\Have All Max 100 Coin Records For All Levels",50000F01 0000,80202F25 0064 +Cheat14="[Slot B Codes]\Have All 120 Stars",80202F93 0001,80202F7B 00C7,50001101 0000,80202F7C 00FF +Cheat14_N=Have 120 Stars,once the Code is activated, you will see it as a new option in Save Slot A.This will have the Cannon open already to get upto Yoshi on the Roof. but make sure to save the game after collecting Red Coins and turn this code off before saving. you will now have it all saved to mempak +Cheat15="[Slot B Codes]\Have all key doors unlocked (and mote empty)",80202F7A 007E +Cheat16="[Slot B Codes]\Have All Max 100 Coin Records For All Levels",50000F01 0000,80202F95 0064 +Cheat17="[Slot C Codes]\Have All 120 Stars",80203003 0001,80202FEB 00C7,50001101 0000,80202FEC 00FF +Cheat17_N=Have 120 Stars,once the Code is activated, you will see it as a new option in Save Slot A.This will have the Cannon open already to get upto Yoshi on the Roof. but make sure to save the game after collecting Red Coins and turn this code off before saving. you will now have it all saved to mempak +Cheat18="[Slot C Codes]\Have all key doors unlocked (and mote empty)",80202FEA 007E +Cheat19="[Slot C Codes]\Have All Max 100 Coin Records For All Levels",50000F01 0000,80203005 0064 +Cheat20="[Slot D Codes]\Have All 120 Stars",80203073 0001,8020305B 00C7,50001101 0000,8020305C 00FF +Cheat20_N=Have 120 Stars,once the Code is activated, you will see it as a new option in Save Slot A.This will have the Cannon open already to get upto Yoshi on the Roof. but make sure to save the game after collecting Red Coins and turn this code off before saving. you will now have it all saved to mempak +Cheat21="[Slot D Codes]\Have all key doors unlocked (and mote empty)",8020305A 007E +Cheat22="[Slot D Codes]\Have All Max 100 Coin Records For All Levels",50000F01 0000,80203075 0064 + +//---- + +[93945F48-5C0F2E30-C:50] +Name=Super Smash Bros (E) +Cheat0="Give Kirby A Wierd Blow-Up",802669B8 000A +Cheat1="Story Mode\Skip Straight To Master Hand",800AD347 000D +Cheat2="Story Mode\Infinite Time",810AD38E 43CB +Cheat3="Story Mode\Player 1\Infinite Lives",800AD3A3 0004 +Cheat4="Story Mode\Player 2\Infinite Lives",800AD417 0004 +Cheat5="Story Mode\Player 3\Infinite Lives",800AD48B 0004 +Cheat6="Story Mode\Player 4\Infinite Lives",800AD4FF 0004 +Cheat7="Story Mode\Player 1\Low % Health",810AD3E6 0000 +Cheat8="Story Mode\Player 2\Low % Health",810AD45A 0000 +Cheat9="Story Mode\Player 3\Low % Health",810AD4CE 0000 +Cheat10="Story Mode\Player 4\Low % Health",810AD542 0000 +Cheat11="Story Mode\Player 1\Character Modifier",800AD39B 00?? +Cheat12="Story Mode\Player 2\Character Modifier",800AD40F 00?? +Cheat13="Story Mode\Player 3\Character Modifier",800AD483 00?? +Cheat14="Story Mode\Player 4\Character Modifier",800AD4F7 00?? +Cheat15="Story Mode\Player 1\Kirby B Button Move\Hyrule Castle",8027136F 00?? +Cheat16="Story Mode\Player 1\Kirby B Button Move\Yoshi's Island",802716AF 00?? +Cheat17="Story Mode\Player 1\Kirby B Button Move\Sector Z",80279957 00?? +Cheat18="Story Mode\Player 1\Kirby B Button Move\Peach's Castle",8026C5FF 00?? +Cheat19="Story Mode\Player 1\Kirby B Button Move\Saffron City",8027C2F7 00?? +Cheat20="Story Mode\Player 1\Kirby B Button Move\Congo Jungle",8027932F 00?? +Cheat21="Story Mode\Player 1\Kirby B Button Move\Kirby's Dreamland",8027639F 00?? +Cheat22="Story Mode\Player 1\Kirby B Button Move\Planet Zebes",80278807 00?? +Cheat23="Story Mode\Player 1\Kirby B Button Move\Metal Mario Stage",8026BDF7 00?? +Cheat24="Story Mode\Player 1\Kirby B Button Move\Fighting Polygon Team",8026AF7F 00?? +Cheat25="Story Mode\Player 1\Kirby B Button Move\Master Hand Stage",8027A4AF 00?? +Cheat26="VS. Mode\Infinite Time",810AD57E 43CB +Cheat27="VS. Mode\Player 1\Low % Health",810AD5D6 0000 +Cheat28="VS. Mode\Player 2\Low % Health",810AD64A 0000 +Cheat29="VS. Mode\Player 3\Low % Health",810AD6BE 0000 +Cheat30="VS. Mode\Player 4\Low % Health",810AD732 0000 +Cheat31="VS. Mode\Player 1\Character Modifier",800AD58B 00?? +Cheat32="VS. Mode\Player 2\Character Modifier",800AD5FF 00?? +Cheat33="VS. Mode\Player 3\Character Modifier",800AD673 00?? +Cheat34="VS. Mode\Player 4\Character Modifier",800AD6E7 00?? +Cheat35="VS. Mode\Player 1\Kirby B Button Move\Hyrule Castle",8026C24F 00?? +Cheat36="VS. Mode\Player 1\Kirby B Button Move\Yoshi's Island",80276B17 00?? +Cheat37="VS. Mode\Player 1\Kirby B Button Move\Sector Z",802747E7 00?? +Cheat38="P1 Press Down On D-Pad To Make Items Appear In Random Spots",D10A7804 0400,81195902 0001 +Cheat39="Have All Characters",810AD198 0FF0 +Cheat40="VS. Mode\Have Mushroom Kindom",800AD197 00FF +Cheat41="Story Mode\Always Get Pacifist (60,000 Points)",810AD3CE 0000 +Cheat42="Bonus Stage Character Modifier (Training Mode)",80197A33 00?? +Cheat43="Jump off to win",810AD3A2 0000 +Cheat11_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat12_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat13_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat14_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat15_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat16_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat17_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat18_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat19_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat20_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat21_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat22_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat23_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat24_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat25_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat31_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat32_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat33_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat34_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat35_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat36_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat37_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat42_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat11_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code could also result freezing at the end of the Level. +Cheat12_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat13_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat14_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat31_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat32_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat33_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat34_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat42_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + +//---- + +[B44CAB74-07029A29-C:50] +Name=Superman (E) +Cheat0="Infinite Options\Freezing Breath",8122CDE8 42C8 +Cheat1="Infinite Options\Health",8122CDD4 42C8 +Cheat2="Infinite Options\Laser Eye",8122CDE4 42C8 +Cheat3="Infinite Options\Running Boosts",8122CDDC 42C8 +Cheat4="Infinite Options\X-Ray Vision",8122CDE0 42C8 +Cheat5="For More Time Press D-pad up ",D00EA380 0008,8115F0D2 1724,D00EA380 0008,8115F0DA 003C +Cheat6="Level Select",D00EA380 0020,8117A378 0013,D00EA380 0020,8117A388 000F,81144727 0063 + +//---- + +[E0C4F72F-769E1506-C:50] +Name=Tigger's Honey Hunt (E) +Cheat0="Max Honey Pots",810A288A 03E7 +Cheat1="Infinite Lives",810A2886 0009 +Cheat2="Have Mouse Card\The Adventure Begins",800A2864 0001 +Cheat3="Have Mouse Card\Night Tail",800A2865 0001 + +//---- + +[2B4F4EFB-43C511FE-C:50] +Name=TOM AND JERRY +Cheat0="[Unlock All Characters]",800E4933 00FF +Cheat1="Open All Versus Arenas",800E4934 00FF,800E4935 00FF +Cheat2="Infinite Health",800E2BDD 00C8 +Cheat3="One Hit To Kill\Player 1",800E2EB4 0080 +Cheat3_N=This Will Give Player 1 A One Hit Kill Over Player 2 +Cheat4="One Hit To Kill\Player 2",800E2BDC 0080 +Cheat4_N=This Will Give Player 2 A One Hit Kill Over Player 1 +Cheat5="Always Have Weapon Options\Player 1",810E2DD4 00?? +Cheat5_O=$79 Anvil,$03 Club,$04 Bird bath,$08 Broom,$09 NCube knife,$0A NCube missiles,$0B Chair,$0C Champagne,$0E Chicken,$0F Crate,$14 Deck chair,$16 Egg,$1A Fish,$1D Gardeners Fork,$1E Frying Pan,$1F Wooden Chair,$29 Bouy,$2A Mallet,$2B Watermelon,$2D Milk Bottle,$39 Plank,$41 Rolling Pin,$46 Spade,$47 Stool,$48 Tennis Racket,$4E Spanner,$55 Stick,$63 Blue Swordfish,$64 Saucepan,$65 Wooden Spoon,$6B Stool,$6D Bee hive,$78 Mooses head +Cheat6="Always Have Weapon Options\Player 2",810E30AC 00?? +Cheat6_O=$79 Anvil,$03 Club,$04 Bird bath,$08 Broom,$09 NCube knife,$0A NCube missiles,$0B Chair,$0C Champagne,$0E Chicken,$0F Crate,$14 Deck chair,$16 Egg,$1A Fish,$1D Gardeners Fork,$1E Frying Pan,$1F Wooden Chair,$29 Bouy,$2A Mallet,$2B Watermelon,$2D Milk Bottle,$39 Plank,$41 Rolling Pin,$46 Spade,$47 Stool,$48 Tennis Racket,$4E Spanner,$55 Stick,$63 Blue Swordfish,$64 Saucepan,$65 Wooden Spoon,$6B Stool,$6D Bee hive,$78 Mooses head, +Cheat8="No music",800B7718 0000 +Cheat0_N=This Gives you all Characters to choose from plus fixes A freeze on the Charecter Select Menu by having it on +Cheat7="Infinite time",800FF18E 00F0 + +//---- + +[9F8926A5-0587B409-C:50] +Name=Tony Hawk's Pro Skater 1 (E) +Cheat0="Access all Levels,tapes,boards & Officer Dick",50000C14 0000,800DE9FC 001E +Cheat1="Access All gold medals",50000C14 0000,800DEA03 00FF,50000C14 0000,800DEA06 00FF,50000C14 0000,800DEA08 00FF +Cheat1_N=Also opens San Francisco & Downtown Minneapolis +Cheat2="10x Trick Multiplier",800D60FE 0001 +Cheat3="Max\Balance",800D62DF 00FF +Cheat4="Max\Turning",800D6220 00FF +Cheat5="Max\Speed",800DE83A 0001 +Cheat6="Max\Air",800D62DC 00FF + +//---- + +[84EAB557-C88A190F-C:50] +Name=Tony Hawk's Pro Skater 2 (E) +Cheat0="Access In-Game Cheat Menu",50001104 0000,800E9E98 0001 +Cheat1="10x Points Multiplier",800EAD8F 0001 +Cheat2="Perfect Balance",800E9EAA 0010 +Cheat3="Always Special",800E9EAC 0001,800E9EAE 0001 +Cheat4="Moon Psysics",800E9ECE 0001 +Cheat5="Hoffmann Factory & Skate heaven Unlocked",800EA18B 003F +Cheat6="Access\Spider-Man",800E9E98 0001,800F0C5B 0001 +Cheat7="Access\Officer Dick",800E9E9C 0001,800F093B 0001 +Cheat8="Infinite Time",800E886A 0001 +Cheat9="Max Cash",50000EE4 0000,810E88F8 000A,50000EE4 0000,810E88FA 2B1F,50000EE4 0000,810E88FC 000A,50000EE4 0000,810E88FE 2B1F +Cheat9_N=All standard players,Officer Dick & Spider-Man +Cheat10="Level Goals 100%",50000EE4 0000,810E8900 FFFF,50000EE4 0000,810E8902 FFFF,50000EE4 0000,810E8904 FFFF,50000EE4 0000,810E8906 FFFF,50000EE4 0000,810E8908 FFFF,50000EE4 0000,810E890A FFFF,50000EE4 0000,810E890C FFFF,50000EE4 0000,810E890E FFFF,50000EE4 0000,810E8920 FFFF +Cheat10_N=All standard players,Officer Dick & Spider-Man, Use together with +Cheat11="All Gaps",50000A0C 0000,810E9D84 FFFF,50000A0C 0000,810E9D86 FFFF,50000A0C 0000,810E9D8A FFFF,50000402 0000,810E9DF4 FFFF +Cheat12="Max Cash For All Custom Players",500004E4 0000,810E948C 000A,500004E4 0000,810E948E 2B1F,500004E4 0000,810E9490 000A,500004E4 0000,810E9492 2B1F +Cheat13="Levels Goals 100% All Custom Players",50000802 0000,810E9494 FFFF,50000802 0000,810E9578 FFFF,50000802 0000,810E965C FFFF,50000802 0000,810E9740 FFFF + +//---- + +[5F3F49C6-0DC714B0-C:50] +Name=Top Gear Hyper-Bike (E) +Cheat0="Access All\Bikes",8107F6EE FFFF +Cheat1="Access All\Tracks",8107F6F0 00FF,8107F6F2 FFFF +Cheat2="Infinite\Nitro",810BA540 4296 +Cheat3="Infinite\Nitro Always On",810BA52C 0010 +Cheat4="Laps 2 Race",800F36B8 00?? +Cheat4_O=$01 1 Lap,$02 2 laps,$03 3 Laps,$04 4 Laps,$05 5 Laps,$06 6 Laps,$07 7 Laps,$08 8 Laps,$09 9 Laps + +//---- + +[D09BA538-1C1A5489-C:50] +Name=Top Gear Overdrive (E) +Cheat0="Extra Cars & Tracks",80102A71 000E,80102A68 0005 +Cheat1="Infinite Money",810F5905 0FA0 +Cheat2="Infinite Nitro",800F590F 000F +Cheat3="Laps 2 Race",80118E20 00?? +Cheat3_O=$01 1 Lap,$02 2 laps,$03 3 Laps,$04 4 Laps,$05 5 Laps,$06 6 Laps,$07 7 Laps,$08 8 Laps,$09 9 Laps + +//---- + +[7F43E701-536328D1-C:50] +Name=TOP GEAR RALLY +Cheat0="Have 1-6 Level Points",8032685F 0064,80326861 0064,80326863 0064,80326865 0064,80326867 0064,80326869 0064 +Cheat1="Extra Cars & Tracks",8032690F 00FF,8032690C 00FF,8032690D 00FF +Cheat2="Only Race 1 Lap Championship Mode",8031EBDB 0002 +Cheat3="Always Place 1st",8031EC0F 0000 + +//---- + +[BEBAB677-51B0B5E4-C:50] +Name=TOP GEAR RALLY 2 +Cheat0="Always 1st",80032713 0001 +Cheat1="No Damage Or Failures",80031BA7 0001 +Cheat2="100.000 Sponsor Credits & 950 Championship Points In Support Van",80031BB3 00F3 +Cheat2_N=You Also Have Access To All Cars, Tracks & Extra Features +Cheat3="No Cones Hit",80032743 0000,80032B1B 0000 +Cheat3_N=In ARSG Rally School +Cheat4="No Navigator",80032677 0000 +Cheat6="Infinite Cash",803D004E 4000 +Cheat7="Freeze Timer",8003271F 0000 +Cheat5="Max Sponsor Credits",803D27E2 0010,803D27E4 0001 + +//---- + +[CCEB3858-26952D97-C:50] +Name=Toy Story 2 (E) +Cheat0="Have 99 coins",810BB4FE 0063 +Cheat1="Have all 5 collectables",801C7E62 0005 +Cheat2="Infinite Lives",800BB4FA 0009 +Cheat3="Infinite Battery Power",810BB4F6 000E +Cheat4="Hold jump to fly",810BB4EC 0002 + +//---- + +[2F7009DD-FC3BAC53-C:50] +Name=Turok - Dinosaur Hunter (E) (V1.0) +Cheat0="Infinite\Lives",80128D7F 00FF +Cheat1="Infinite\Body Armor",81128D96 5B23,80128DD7 0001 +Cheat2="Infinite\Air",801290E0 0063,801E869A 0063 +Cheat3="Infinite\Health",812C1634 1E61,812A25A4 1E61 +Cheat4="Have\All Level Keys",50000604 0000,80128DE3 0007,80128DFB 001F,80128E1B 00FF +Cheat5="Have\All Weapons",50000B04 0000,80128DB7 0001,80128D33 0001 +Cheat6="Infinite\Ammo",50000404 0000,80128D63 00FF,80128D73 00FF,80128D7F 00FF,50000504 0000,80128D83 00FF,80128F0B 00FF,80128F07 00FF +Cheat7="Diffuculty Modifier",801195DF 00?? +Cheat7_O=$00 Easy,$01 Normal,$02 Hard +Cheat8="Have\Backpack",80128CEB 0001,80128D2B 0001 +Cheat9="Open All Portals",8114F8CA F803,81128D4E 0003,81128D52 0003,81128D56 0003,81128D5A 0003,81128D5E 0003,81128D62 0003,81128D66 0005 +Cheat9_N=Press L to Access Map +Cheat10="Have All\Gems",80128F07 00FF +Cheat11="Have\Cheat Menu",811195F0 FFFF,811195F2 FFFF + +//---- + +[2F700DCD-176CC5C9-C:50] +Name=Turok - Dinosaur Hunter (E) (V1.1) +Cheat0="Infinite\Lives",80128E1F 00FF +Cheat1="Infinite\Body Armor",81128E36 5B23,80128E77 0001 +Cheat2="Infinite\Air",80129180 0063,801E873A 0063 +Cheat3="Infinite\Health",812C16D4 1E61,812A2644 1E61 +Cheat4="Have\All Level Keys",50000604 0000,80128E83 0007,80128E9B 001F,80128EBB 00FF +Cheat5="Have\All Weapons",50000B04 0000,80128E57 0001,80128DD3 0001 +Cheat6="Infinite\Ammo",50000404 0000,80128E03 00FF,80128E13 00FF,80128E1F 00FF,50000504 0000,80128E23 00FF,80128FAB 00FF,80128FA7 00FF +Cheat7="Diffuculty Modifier",8011967F 00?? +Cheat7_O=$00 Easy,$01 Normal,$02 Hard +Cheat8="Have\Backpack",80128D8B 0001,80128DCB 0001 +Cheat9="Open All Portals",8114F96A F803,81128DEE 0003,81128DF2 0003,81128DF6 0003,81128DFA 0003,81128DFE 0003,81128E02 0003,81128E06 0005 +Cheat9_N=Press L to Access Map +Cheat10="Have All\Gems",80128FA7 00FF +Cheat11="Have\Cheat Menu",81119690 FFFF,81119692 FFFF + +//---- + +[1EA26214-E790900F-C:50] +Name=Turok - Rage Wars (E) +Cheat0="Have All Medals",8010EB50 0003,50000601 0000,8010EB4A 00FF +Cheat1="Have All Mini Game Icons",8010EB17 0024 +Cheat2="Infinite Lives\Player 1",8033637E 0064 +Cheat3="Infinite Health\Player 1",80336527 0064,80692B86 0064 +Cheat4="Infinite Ammo All Guns\Player 1",50000302 0000,80336535 0063,50000702 0000,80692B95 0063 +Cheat5="All Levels Completed",50000601 0000,8010EB7D 00FF +Cheat6="All Characters",50000301 0000,8010EB51 00FF +Cheat7="Deaths Modifier",8110EB76 ???? +Cheat7_O=$000A 10,$0014 20,$001E 30,$0028 40,$0032 50,$0064 100,$00C8 200,$0190 400,$0320 800,$0640 1600,$03E7 Infinite +Cheat8="Wins Modifier",8110EB72 ???? +Cheat8_O=$000A 10,$0014 20,$001E 30,$0028 40,$0032 50,$0064 100,$00C8 200,$0190 400,$0320 800,$0640 1600,$03E7 Infinite +Cheat9="Total Kills Modifier",8110EB6E ???? +Cheat9_O=$000A 10,$0014 20,$001E 30,$0028 40,$0032 50,$0064 100,$00C8 200,$0190 400,$0320 800,$0640 1600,$03E7 Infinite +Cheat0_N=Unlocks the In-Game Cheat Menu.Only works with a Controller-Pak +Cheat1_N=Only works with a Controller-Pak +Cheat5_N=Unlocks Frag Fest & Time Trial + +//---- + +[E0B92B94-80E87CBD-C:50] +Name=Turok 2 - Seeds of Evil (E) +Cheat0="Access In-Game Cheat Menu",8112167C FFFF,8112167E FFFF +Cheat1="Access All Nuke Pieces 1-6",D00FC701 0020,50000601 0000,802FC99C 0030 +Cheat1_N=Enter the In-game inventory option, and press L Button + +//---- + +[6A162FF2-2093704C-C:50] +Name=Turok 3 - Shadow of Oblivion (E) +Cheat0="Infinite\Grenade Gun Ammo",8133340A 0064 +Cheat1="Have\a Grenade Launcher",80333954 0001 +Cheat2="Infinite\Shotgun Ammo",81333932 0064 +Cheat3="Have\Shotgun",80333950 0001 +Cheat4="Infinite\Arrows",81333928 0063 +Cheat5="Infinite\Life Units",813334FC 0063 +Cheat6="Access\All Cheats & Level Warp",811659D4 FFFF,811659D6 FFFF + +//---- + +[E688A5B8-B14B3F18-C:50] +Name=TWISTED EDGE +Cheat0="Max\50000 Stunt Points",81082AD8 C350 +Cheat2="Have\All Characters",81082B18 07FF +Cheat3="Have\All Difficulties",81082B10 0700 +Cheat4="Have\All Tracks",81082B1C BFFE +Cheat5="Have\All Boards",81082B24 0003,81082B26 FFFF +Cheat1="Low Timer",80082A04 0000,80182A06 0000 + +//---- + +[151F79F4-8EEDC8E5-C:50] +Name=Vigilante 8 (E) +Cheat0="All Quests Completed",80193CA4 003F,50000C01 0000,80193C98 001F +Cheat1="Max Stats All Characters",50000B24 0000,811896EC 1414,50000B24 0000,811896EE 1400 +Cheat2="Access All Characters",81193CA4 3F00,50000602 0000,81193C98 1F1F + +//---- + +[98F9F2D0-03D9F09C-C:50] +Name=Virtual Pool 64 (E) +Cheat0="Foul score will stay at 0",802EF725 0000 +Cheat1="Score 0 points in shark skins",802EF723 0000 +Cheat2="Have 5 games won",802EF721 0005 +Cheat3="Pot 1 to win Set points to 25 in straight pool",802EF71D 0019 + +//---- + +[636E6B19-E57DDC5F-C:50] +Name=V-Rally Edition 99 (E) +Cheat0="Access\All Cars",8015EC13 003F +Cheat1="Access\All Tracks",8015EC0E 0070 +Cheat2="Access\Championship,World,Expert",8015EC1C 0001 +Cheat3="Access\Expert Times",8015EC10 0031 +Cheat4="Access\In-Game Cheat Menu",811CFE09 00FF,811F31FF 04FF,811CE165 FF03 +Cheat4_N=On The Title Screen, Hold Z Button & Push L Button + +//---- + +[93053075-261E0F43-C:50] +Name=Waialae Country Club - True Golf Classics (E) +Cheat0="All Players On 1st Shot",813013DA 0000 + +//---- + +[D715CC70-271CF5D6-C:50] +Name=WAR GODS +Cheat0="Infinite Time",8033F6FB 0064 +Cheat1="Enable Cheat Menu",80336973 0001 +Cheat2="Skill Select\Player 2",80335C20 00?? +Cheat2_O=$80 Max Skill,$00 Weak Skill +Cheat2_N=Max Skill makes the player more Skillful while easier to hurt where as Weak Skill is Non Skillful yet harder to harm. +Cheat3="Skill Select\Player 1",80335C1D 00?? +Cheat3_O=$80 Max Skill,$00 Weak Skill +Cheat3_N=Max Skill makes the player more Skillful while easier to hurt where as Weak Skill is Non Skillful yet harder to harm. +Cheat4="Difficulty Select",80336953 00?? +Cheat4_O=$00 Very Easy,$01 Easy,$02 Medium,$03 Hard,$04 Very hard +Cheat5="Infinite Max Continues",80336963 0005 +Cheat7="Easy Fatality Select",8033584F 00?? +Cheat7_O=$00 Always Off,$01 Always On +Cheat8="Press D-Pad\Right to Play As Exor",D033C263 0008,800EAF87 000B +Cheat8_N=Press D-Pad Right at the character Select screen to Replace Maximus with Exor. Do not use with the Play As Cheat +Cheat9="Press D-Pad\Left to Play As Grox",D033C263 0004,800EAF87 000A +Cheat9_N=Press D-Pad Left at the character Select screen to Replace Maximus with Grox. Do not use with the Play As Cheat +Cheat10="Music Select",80336954 00?? +Cheat10_O=$00 Off,$01 On +Cheat11="Level Select",80335C27 00?? +Cheat11_O=$00 Off,$01 Pagan,$02 Anubis,$03 Warhead,$04 Ahau Kin,$05 Voodoo,$06 Kabuki +Cheat12="Fatalities Select",8033695C 00?? +Cheat12_O=$00 Off,$01 On +Cheat13="Play As",800EAF87 00?? +Cheat13_O=$00 Warhead,$01 Tak,$02 Voodoo,$03 Pagan,$04 Kabuki Jo,$05 Vallah,$06 Ahau Kin,$07 Anubis,$08 CY-5,$09 Maximus,$0A Grox,$0B Exor + +//---- + +[650EFA96-30DDF9A7-C:50] +Name=Wave Race 64 (E) +Cheat0="Set\Speed Size",801C0077 00?? +Cheat0_O=$01 Slow,$0A Medium,$0F Fast +Cheat1="Misses Don't Count\Player 1",801C007F 0000 +Cheat2="Set\Wave Size",800E6B90 00?? +Cheat2_O=$00 Smooth,$19 Medium,$64 Rough,$FF Oh My God +Cheat3="Infinite Time Stunt Mode",801C020E 00FF +Cheat4="Maximum Power\Player 1",801C0077 0005 +Cheat5="Maximum Power\Player 2",801C069A 0005,801C093A 0005 +Cheat6="Only Play Glacier Coast",800D8003 0007 +Cheat7="Always Place 1st\Player 1",801BFF4F 0000 +Cheat8="Lap Timer Below 0'00'10\Player 1",811C00E6 0000 +Cheat9="Misses Don't Count\Player 2",811C03F6 0000 +Cheat10="Lap Timer Below 0'00'10\Player 2",811C045E 0000 + +//---- + +[661B45F3-9ED6266D-C:50] +Name=Wayne Gretzky's 3D Hockey '98 (E) +Cheat0="Max Score\Team 1",81120220 FFFF +Cheat1="Max Score\Team 2",81123730 FFFF +Cheat2="Difficulty Mod",801247F9 00?? +Cheat2_O=$00 ,$01 ,$02 ,$03 ,$04 +Cheat3="Anger metre always full",800D9B38 00FF,800D9826 00FF + +//---- + +[CEA8B54F-7F21D503-C:50] +Name=Wetrix (E) +Cheat0="Always Empty Drain",801BF991 0000,811BF992 0000,811BF994 0000 +Cheat1="Bezerk Mode",801BF9AF 00FF +Cheat2="Stop Level Timer",801BF9B2 00FF + +//---- + +[54310E7D-6B5430D8-C:50] +Name=Wipeout 64 +Cheat0="Access\Velocitar",800927F9 0001 +Cheat1="Access\Pirahna 2",80092979 0001 +Cheat2="Access Pirahna 2",80091259 0001,8109125A 0001 +Cheat2_N=Multiplayer +Cheat3="Access\Super Combo",81092ACC 0000 +Cheat4="Infinite\Ammo",80091254 0001 +Cheat5="Cyclone Option",80091258 00?? +Cheat5_O=$00 Off,$01 On +Cheat6="Always First",810A9248 0001,8109F3E6 0003 +Cheat7="Freeze Checkpoint Timer",810CE1D2 BCCC +Cheat8="A perfect Lap",800914B4 0001 +Cheat9="Access\All Gold Challenges\Race",81092CCC 0000 +Cheat10="Access\All Gold Challenges\Time Trial",8109354C 0000 +Cheat11="Access\All Gold Challenges\Weapon",8109394C 0000 +Cheat12="Access\All Gold Challenges\Super Combo",81093D4C 0000 +Cheat13="Access\All Gold Awards",50001C2C 0000,800941BC 0003 +Cheat14="[Infinite Sheild]",5000030C 0000,810A92C2 0000,810A92F2 0000 +Cheat15="always 1st",810A9248 0001 + +//---- + +[6D8DF08E-D008C3CF-C:50] +Name=WWF No Mercy (E) +Cheat0="Infinite\Money\Championship Mode",8109940A FFFF +Cheat1="Infinite\Money\Smackdown Mall Shop",8114FAD6 FFFF +Cheat2="Have All\Characters,Costumes, & Moves",50000B02 0000,810BEE40 FFFF +Cheat3="Max Spirit\Player 1",D015A5D1 0015,8015AF5F 00FF +Cheat4="Max Spirit\Player 2",D015A5D1 0015,8015B2B7 00FF +Cheat5="Max Spirit\Player 3",D015A5D1 0015,8015B60F 00FF +Cheat6="Max Spirit\Player 4",D015A5D1 0015,8015B967 00FF +Cheat7="Always Special\Player 1",D015A5D1 0015,8015AF9E 0004 +Cheat8="Always Special\Player 2",D015A5D1 0015,8015B2F6 0004 +Cheat9="Always Special\Player 3",D015A5D1 0015,8015B64E 0004 +Cheat10="Always Special\Player 4",D015A5D1 0015,8015B9A6 0004 +Cheat11="Ultimate Code\Player 1",D015A5D1 0015,8015AF5E 0064 +Cheat12="Ultimate Code\Player 2",D015A5D1 0015,8015B2B6 0064 +Cheat13="Ultimate Code\Player 3",D015A5D1 0015,8015B60E 0064 +Cheat14="Ultimate Code\Player 4",D015A5D1 0015,8015B964 0064 +Cheat15="2 Player Championship Mode",810A755E 0002 +Cheat16="CPU To Human Control\Player 1",8015AF99 00?? +Cheat16_O=$17 Human,$18 CPU +Cheat17="CPU To Human Control\Player 2",8015B2F1 00?? +Cheat17_O=$17 Human,$18 CPU +Cheat18="CPU To Human Control\Player 3",8015B649 00?? +Cheat18_O=$17 Human,$18 CPU +Cheat19="Can't Pin\Player 1",8016CE23 0004 +Cheat20="Can't Pin\Player 2",8016CE17 0004 +Cheat21="Can't Pin\Player 3",8016CE2F 0004 +Cheat22="Can't Pin\Player 4",8016CE3B 0004 +Cheat23="Auto-Pin\Player 1",8016CE23 0003 +Cheat24="Auto-Pin\Player 2",8016CE17 0003 +Cheat25="Auto-Pin\Player 3",8016CE2F 0003 +Cheat26="Auto-Pin\Player 4",8016CE3B 0003 +Cheat27="Play As\Player 1\Option 1",810AAAD0 ???? +Cheat27_O=$0001 Rock,$0002 SCSA,$0003 Undertaker,$0004 Kane,$0005 Richards,$0006 Mankind,$0007 Cactus,$0008 Mick,$0009 HBK,$0101 HHH,$0102 X-Pac,$0103 Mr. Ass,$0104 Road Dogg,$0201 Benoit,$0202 Malenko,$0203 Saturn,$0204 Guerrero,$0301 Jericho,$0302 Angle,$0303 Tazz,$0304 Test,$0305 GodFather,$0306 D`Lo,$0307 Venis,$0308 Shamrock +Cheat28="Play As\Player 1\Option 2",810AAAD0 ???? +Cheat28_O=$0401 Rikishi,$0402 Sexay,$0403 Scotty,$0404 Edge,$0405 Christian,$0406 Matt,$0407 Jeff,$0501 Faarooq,$0502 Bradshaw,$0503 D-Von,$0504 Buh Buh,$0505 Hardcore,$0506 Crash,$0507 Bossman,$0508 Albert,$0601 Al,$0602 Blackman,$0603 Bulldog,$0604 Henry,$0605 Viscera,$0606 Andre,$0607 Buchanan,$0608 Rios,$0609 Taka,$0701 Chyna +Cheat29="Play As\Player 1\Option 3",810AAAD0 ???? +Cheat29_O=$0702 Stephanie,$0703 Tori,$0704 Debra,$0705 Trish,$0706 Lita,$0801 Jacqueline,$0802 Linda,$0803 Kat,$0804 Moola,$0805 Ho,$0901 Vince,$0902 Shane,$0903 Hebner,$0904 Jim Ross +Cheat30="Play As\Player 2\Option 1",810AAADC ???? +Cheat30_O=$0001 Rock,$0002 SCSA,$0003 Undertaker,$0004 Kane,$0005 Richards,$0006 Mankind,$0007 Cactus,$0008 Mick,$0009 HBK,$0101 HHH,$0102 X-Pac,$0103 Mr. Ass,$0104 Road Dogg,$0201 Benoit,$0202 Malenko,$0203 Saturn,$0204 Guerrero,$0301 Jericho,$0302 Angle,$0303 Tazz,$0304 Test,$0305 GodFather,$0306 D`Lo,$0307 Venis,$0308 Shamrock +Cheat31="Play As\Player 2\Option 2",810AAADC ???? +Cheat31_O=$0401 Rikishi,$0402 Sexay,$0403 Scotty,$0404 Edge,$0405 Christian,$0406 Matt,$0407 Jeff,$0501 Faarooq,$0502 Bradshaw,$0503 D-Von,$0504 Buh Buh,$0505 Hardcore,$0506 Crash,$0507 Bossman,$0508 Albert,$0601 Al,$0602 Blackman,$0603 Bulldog,$0604 Henry,$0605 Viscera,$0606 Andre,$0607 Buchanan,$0608 Rios,$0609 Taka,$0701 Chyna +Cheat32="Play As\Player 2\Option 3",810AAADC ???? +Cheat32_O=$0702 Stephanie,$0703 Tori,$0704 Debra,$0705 Trish,$0706 Lita,$0801 Jacqueline,$0802 Linda,$0803 Kat,$0804 Moola,$0805 Ho,$0901 Vince,$0902 Shane,$0903 Hebner,$0904 Jim Ross +Cheat33="Play As\Player 3\Option 1",810AAAE8 ???? +Cheat33_O=$0001 Rock,$0002 SCSA,$0003 Undertaker,$0004 Kane,$0005 Richards,$0006 Mankind,$0007 Cactus,$0008 Mick,$0009 HBK,$0101 HHH,$0102 X-Pac,$0103 Mr. Ass,$0104 Road Dogg,$0201 Benoit,$0202 Malenko,$0203 Saturn,$0204 Guerrero,$0301 Jericho,$0302 Angle,$0303 Tazz,$0304 Test,$0305 GodFather,$0306 D`Lo,$0307 Venis,$0308 Shamrock +Cheat34="Play As\Player 3\Option 2",810AAAE8 ???? +Cheat34_O=$0401 Rikishi,$0402 Sexay,$0403 Scotty,$0404 Edge,$0405 Christian,$0406 Matt,$0407 Jeff,$0501 Faarooq,$0502 Bradshaw,$0503 D-Von,$0504 Buh Buh,$0505 Hardcore,$0506 Crash,$0507 Bossman,$0508 Albert,$0601 Al,$0602 Blackman,$0603 Bulldog,$0604 Henry,$0605 Viscera,$0606 Andre,$0607 Buchanan,$0608 Rios,$0609 Taka,$0701 Chyna +Cheat35="Play As\Player 3\Option 3",810AAAE8 ???? +Cheat35_O=$0702 Stephanie,$0703 Tori,$0704 Debra,$0705 Trish,$0706 Lita,$0801 Jacqueline,$0802 Linda,$0803 Kat,$0804 Moola,$0805 Ho,$0901 Vince,$0902 Shane,$0903 Hebner,$0904 Jim Ross +Cheat36="Play As\Player 4\Option 1",810AAAF4 ???? +Cheat36_O=$0001 Rock,$0002 SCSA,$0003 Undertaker,$0004 Kane,$0005 Richards,$0006 Mankind,$0007 Cactus,$0008 Mick,$0009 HBK,$0101 HHH,$0102 X-Pac,$0103 Mr. Ass,$0104 Road Dogg,$0201 Benoit,$0202 Malenko,$0203 Saturn,$0204 Guerrero,$0301 Jericho,$0302 Angle,$0303 Tazz,$0304 Test,$0305 GodFather,$0306 D`Lo,$0307 Venis,$0308 Shamrock +Cheat37="Play As\Player 4\Option 2",810AAAF4 ???? +Cheat37_O=$0401 Rikishi,$0402 Sexay,$0403 Scotty,$0404 Edge,$0405 Christian,$0406 Matt,$0407 Jeff,$0501 Faarooq,$0502 Bradshaw,$0503 D-Von,$0504 Buh Buh,$0505 Hardcore,$0506 Crash,$0507 Bossman,$0508 Albert,$0601 Al,$0602 Blackman,$0603 Bulldog,$0604 Henry,$0605 Viscera,$0606 Andre,$0607 Buchanan,$0608 Rios,$0609 Taka,$0701 Chyna +Cheat38="Play As\Player 4\Option 3",810AAAF4 ???? +Cheat38_O=$0702 Stephanie,$0703 Tori,$0704 Debra,$0705 Trish,$0706 Lita,$0801 Jacqueline,$0802 Linda,$0803 Kat,$0804 Moola,$0805 Ho,$0901 Vince,$0902 Shane,$0903 Hebner,$0904 Jim Ross +Cheat39="Cannot Be Grabbed\Player 1",D115AEC6 0052,8115AEC6 0001,D115AEC6 00A1,8115AEC6 00C1 +Cheat40="Cannot Be Punched\Player 1",D115AEC6 002D,8115AEC6 0001,D115AEC6 0035,8115AEC6 00C1 +Cheat41="Cannot Be Knocked Down\Player 1",D115AEC6 0031,8115AEC6 0001 +Cheat42="Wrestler Size & Shape\Player 1\Thin wrestler",8106B468 3D80 +Cheat43="Wrestler Size & Shape\Player 1\Wide wrestler",8106B468 3FFF +Cheat44="Wrestler Size & Shape\Player 1\Short wrestler",8106B47C 3E80 +Cheat45="Wrestler Size & Shape\Player 1\Tall wrestler",8106B47C 3FFF +Cheat46="Wrestler Size & Shape\Player 1\Flat wrestler",8106B490 3D80 +Cheat47="Wrestler Size & Shape\Player 1\Bulgy wrestler",8106B490 3FFF +Cheat48="Wrestler Size & Shape\Player 1\Giant wrestler",8106B4A4 3E80 +Cheat49="Wrestler Size & Shape\Player 1\Small wrestler",8106B4A4 3FFF +Cheat50="Wrestler Size & Shape\Player 2\Thin wrestler",8006B528 3D80 +Cheat51="Wrestler Size & Shape\Player 2\Wide wrestler",8006B528 3FFF +Cheat52="Wrestler Size & Shape\Player 2\Short wrestler",8006B53C 3E80 +Cheat53="Wrestler Size & Shape\Player 2\Tall wrestler",8006B53C 3FFF +Cheat54="Wrestler Size & Shape\Player 2\Flat wrestler",8006B510 3DFF +Cheat55="Wrestler Size & Shape\Player 2\Bulgy wrestler",8006B510 3FFF +Cheat56="Wrestler Size & Shape\Player 2\Giant wrestler",8006B564 3E80 +Cheat57="Wrestler Size & Shape\Player 2\Small wrestler",8006B564 3FFF +Cheat58="Wrestler Size & Shape\Player 3\Thin wrestler",8006B5E8 3D80 +Cheat59="Wrestler Size & Shape\Player 3\Wide wrestler",8006B5E8 3FFF +Cheat60="Wrestler Size & Shape\Player 3\Short wrestler",8006B5FC 3E80 +Cheat61="Wrestler Size & Shape\Player 3\Tall wrestler",8006B5FC 3FFF +Cheat62="Wrestler Size & Shape\Player 3\Flat wrestler",8006B610 3D80 +Cheat63="Wrestler Size & Shape\Player 3\Bulgy wrestler",8006B610 3FFF +Cheat64="Wrestler Size & Shape\Player 3\Giant wrestler",8006B624 3E80 +Cheat65="Wrestler Size & Shape\Player 3\Small wrestler",8006B624 3FFF +Cheat66="Wrestler Size & Shape\Player 4\Thin wrestler",8006B6A8 3D80 +Cheat67="Wrestler Size & Shape\Player 4\Wide wrestler",8006B6A8 3FFF +Cheat68="Wrestler Size & Shape\Player 4\Short wrestler",8006B6BC 3E80 +Cheat69="Wrestler Size & Shape\Player 4\Tall wrestler",8006B6BC 3FFF +Cheat70="Wrestler Size & Shape\Player 4\Flat wrestler",8006B6D0 3D80 +Cheat71="Wrestler Size & Shape\Player 4\Bulgy wrestler",8006B6D0 3FFF +Cheat72="Wrestler Size & Shape\Player 4\Giant wrestler",8006B6E4 3E80 +Cheat73="Wrestler Size & Shape\Player 4\Small wrestler",8006B6E4 3FFF +Cheat74="Z LADDER",D1064880 2000,8116C768 0000,D1064880 2000,8116C76A 0019,D1064880 2000,8116C76C 0000,D1064880 2000,8116C76E 0019,D1064880 2000,8116C788 8104 +Cheat75="Replace Raw War with\TOKYO DOME",810528F4 7223,810528F6 0119,81050124 0100,81050126 0100,81050128 0100,8105012A 0100,8105012C 0100,8105012E 0100,81050130 0100,81050132 0100,81050134 0100,81050136 0100,8105010E 0999,81050400 03A5,81050402 0385,81050404 0385,81050406 0385,81050408 0385,8105040A 03A5,8105040C 03A5,8105040E 043F,81050430 043F,8105042C 03A5,81050430 21A5,81050432 0100,81050434 0000,81050436 2CFB,81050438 0899,8105043C 03AF,81050440 03AF,81050442 03A5,810500E8 24C3,81050444 0100,81050190 09EF,81050192 0000,81050194 09EF,81050196 2CFD +Cheat76="Replace Raw War with\BARBEDWIRE ROPES",81050110 04F3,81050112 04F4,81050114 04F5,81050116 04F3,81050118 04F4,8105011A 04F5,8105011C 04F3,8105011E 04F4,81050120 04F5,81050124 2CFB,81050126 2CFB,81050128 2CFB,8105012A 2CFB,8105012C 2CFB,8105012E 2CFB,81050130 2CFB,81050132 2CFB,81050134 2CFB,81079D90 3F6C,81079D94 3F48,81079DA4 3D10,81079DB8 3F71,81079E6C 3F6C,81079E80 3D10,81079E90 3F47,81079F48 3F6C,81079F4C BF4C,81079F5C 3D10,81079F70 3F71,8107A024 3F6C,8107A028 3F28,8107A038 3D10,8107A04C 3F71,8107A100 3F6C,8107A114 3D10,8107A124 3F23,8107A1DC 3F6C,8107A1E0 BF2A,8107A1F0 3D10,8107A204 3F71,8107A2B8 3F6C,8107A2BC 3F02,8107A2CC 3D10,8107A2E0 3F71,8107A394 3F6C,8107A3A8 3D10,8107A3B8 3F00,8107A470 3F6C,8107A474 BF02,8107A484 3D10,8107A498 3F71,81050144 0569,81050154 07F7,810528F4 0C01,810528F6 0555,81050140 04F4,81050150 2CFB,8107A628 3F60,8107A63C 3D10,8107A64C 3F52,8107A650 BF80,8107A8BC 3F56,8107A8C4 BA00,8107A8D0 3D10,8107A8DC 3C5A,8107A8E0 3F30,8107A8E4 BF80,8107ADE4 3F56,8107ADEC BA00,8107ADF8 3D10,8107AE04 3C5A,8107AE08 3F0E,8107AE0C BF80,8107AB7C 3F00,D115AF56 2EB2,8115AEC6 0017,D115B2AE 2EB2,8115B21E 0017,D115B606 2EB2,8115B570 0017,D115B95E 2EB2,8115B8CE 0017,81052922 FFFF,81052924 FFFF,81052926 FFFF +Cheat77="Replace Raw War with\BARBEDWIRE SQUARE\Part 1",81050110 04F3,81050112 04F4,81050114 04F5,81050116 04F3,81050118 04F4,8105011A 04F5,8105011C 04F3,8105011E 04F4,81050120 04F5,81050124 2CFB,81050126 2CFB,81050128 2CFB,8105012A 2CFB,8105012C 2CFB,8105012E 2CFB,81050130 2CFB,81050132 2CFB,81050134 2CFB,81079D90 3F6C,81079D94 3F48,81079DA4 3D10,81079DB8 3F71,81079E6C 3F6C,81079E80 3D10,81079E90 3F47,81079F48 3F6C,81079F4C BF4C,81079F5C 3D10,81079F70 3F71,8107A024 3F6C,8107A028 3F28,8107A038 3D10,8107A04C 3F71,8107A100 3F6C,8107A114 3D10,8107A124 3F23,8107A1DC 3F6C,8107A1E0 BF2A,8107A1F0 3D10,8107A204 3F71,8107A2B8 3F6C,8107A2BC 3F02,8107A2CC 3D10,8107A2E0 3F71,8107A394 3F6C,8107A3A8 3D10,8107A3B8 3F00,8107A470 3F6C,8107A474 BF02,8107A484 3D10,8107A498 3F71,81050144 0569,81050154 07F7,810528F4 0C01,810528F6 0555,81050140 04F4,81050150 2CFB,8107A628 3F60,8107A63C 3D10,8107A64C 3F52,8107A650 BF80,8107A8BC 3F56,8107A8C4 BA00,8107A8D0 3D10,8107A8DC 3C5A,8107A8E0 3F30,8107A8E4 BF80,8107ADE4 3F56,8107ADEC BA00,8107ADF8 3D10,8107AE04 3C5A,8107AE08 3F0E,8107AE0C BF80,8107AB7C 3F00,D115AF56 2EB2,8115AEC6 0017,D115B2AE 2EB2,8115B21E 0017,D115B606 2EB2,8115B570 0017,D115B95E 2EB2,8115B8CE 0017,81052922 FFFF,81052924 FFFF,81052926 FFFF,8116C330 0000,8116C332 000A,8116C334 0000,8116C336 000A,8116C378 42B4 +Cheat78="Replace Raw War with\BARBEDWIRE SQUARE\Part 2",8116C382 0000,8116C38C FFFF,81052C9C 0672,81052CA4 2CFB,D1064880 0002,8115B21E 002F,D1064886 0002,8115AEC6 002F,8116C3E4 0000,8116C3E6 000C,8116C3E8 0000,8116C3EA 000C,8116C428 C3D4,8116C440 FFFF,81052CB2 2CC2,81052CB4 0805,81052CB6 2CFB,D1064880 2000,8116C3E6 001F,D1064880 2000,8116C3EA 001F,D1064880 2000,81005592 3F81,D1005592 3F81,8116C3E6 001F,D1064880 2000,81005592 3F81,D1005592 3F81,8116C3EA 001F,D1064886 2000,8116C3E6 001F,D1064886 2000,8116C3E6 001F,D1064886 2000,81005592 3F81,D1005592 3F81,8116C3EA 001F,81052CF8 04F4,81052D00 2CFB,8116C3E4 0000,8116C3E6 0015,8116C3E8 0000,8116C3EA 0015,8116C428 0000,8116C42A 0000,8116C42C 43EB,8116C42E 0000,8116C430 C3A6,8116C432 0000,8116C436 0400,8116C43A 0000,8116C43E 0000,8116C440 FFFF,8116C442 0000,810855A8 3F00,81085684 3F00,81085750 3F00,8108583C 3F00,81050100 2CFB,8105010E 2CFB +Cheat79="Replace Raw War with\FLAMING TURNBUCKLES",8116C334 FFFF,8116C336 001F,8116C374 C350,8116C376 FFF3,8116C378 4377,8116C37A 2689,8116C37C C380,8116C37E 0406,8116C382 0D14,8116C386 0FCC,8116C38A 07DC,8116C38C FFFF,8116C38E FDE3,8116C3E8 FFFF,8116C3EA 001F,8116C428 C360,8116C42C 4370,8116C430 4376,8116C436 0D14,8116C43A 0FCC,8116C43E 07DC,8116C442 F9C4,8116C49C FFFF,8116C49E 001F,8116C4DC 4360,8116C4E0 4370,8116C4E4 4380,8116C4EA 0CD0,8116C4EE 0136,8116C4F2 04EE,8116C4F6 F601,8116C550 FFFF,8116C552 001F,8116C590 434F,8116C594 4370,8116C598 C36C,8116C59E 0E70,8116C5A2 0F58,8116C5A6 0814,8116C5AA F1E6 +Cheat80="Replace Raw War with\REMOVE RING",81050150 0000,81050152 0000,81050154 0000,810500E8 0000,810855A8 3F00,81085684 3F00,81085750 3F00,8108583C 3F00,81079C08 3F00,81079C14 3F00,81079B10 3F00 +Cheat81="Replace Raw War with\BACKYARD ARENA",8105010E 0F76,8105010C 0F76,810482E8 002F,81050150 2CFD,810528F4 33FF,810528F6 33FF,81050152 2DC7,81050114 04F4,81050116 04F5,8105011E 04F3,81050128 07FF,8105012A 07FF,81050132 07FF,81079F48 400C,81079F5C 3F00,81079F70 3FFF,8107A024 4010,8107A038 3F00,8107A04C 4020,8107A060 3F84,8107A394 4012,8107A3A8 3F00,8107A3BC 4030,8107A3D0 3F84,8105042C 0949,81050436 07FF,81050438 07FF,8105043A 07FF,8105043C 0000,8105043E 07FF,81050440 0949,81050442 0949,81050430 0F76,81050128 07FF,8105012A 07FF,8105012C 0000,8105012E 07FF,81050130 07FF,81050132 07FF,81050134 0000,81050136 08F9,81050196 2CFD,81050194 09EF,81050192 0000,81050190 09EF,8116C49E 0019,8116C4B8 0004,8116C4DC C2E1,8116C4E0 42B4,810500FE 2D2D,81050100 2D2D,81050102 2D2D,81050400 2DC7,81050402 2DC7,81050404 2DC7,81050406 2DC7,81050408 2DC7,8105040A 2DC7,8105040C 2DC7,8105040E 2DC7,50001002 0000,810501B8 0000,50000402 0000,810501E0 0000,50000902 0000,81050262 0000,50001402 0000,81050290 0000,50002C02 0000,810502EC 0000,8107941C 3FE0,81079428 3FFF,810500EC 06FE,810500EE 06FD,810500F8 07FF,810500FA 0997,81050110 06FC,81050112 06FB,8105011A 06FF,8105011C 06FA,81052CF0 2CC9,81052CF4 2D1B,81052CD0 2CD1,81052CD4 0963,81052C84 2CBF,81052C8A 0961,81052CB8 2CC4,81052CBC 2DD7,81052CC8 2CD1,81052CCC 2CFB,81052C78 2CBC,81052C80 2D31,81052CF8 2CC1,81052D00 2DD7 +Cheat82="Replace Raw War with\BACKYARD WEAK",8105042C 0E88,8105042E 2D0D,81050430 2D0D,81050432 2D0D,81050434 2D0D,81050436 07FD,8105043A 2CFB,8105043C 2D0D,8105043E 2D0D,81050440 2D0D,81050442 2D0D,810500E8 2D0D,8105010E 2D0D,8105010C 2D0D,81050150 2D0D,81050196 2CFB,81050124 2CFB,81050126 2CFB,81050128 2CFB,8105012A 2CFB,8105012C 2CFB,8105012E 2CFB,81050130 2CFB,81050132 2CFB,81050134 2CFB,81050136 2CFB,81050400 2D0D,81050402 2D0D,81050404 2D0D,81050406 2D0D,81050408 2D0D,8105040A 2D0D,8105040C 2D0D,8105040E 2D0D,810528F4 2D0D,810528F6 2D0D,81052CE8 2CC9,81052CEC 2D2D +Cheat83="Replace Raw War with\BARBEDWIRE ARENA",8105042C 2CFB,8105042E 2CFB,81050430 2CFB,81050432 2CFB,81050434 2CFB,81050436 2CFB,81050438 2CFB,8105043A 2CFB,8105043C 2CFB,8105043E 2CFB,81050440 2CFB,81050442 2CFB,810500E8 2CFB,8105010E 2CFB,8105010C 2CFB,81050150 2CFB,81050196 2CFB,81050124 2CFB,81050126 2CFB,81050128 2CFB,8105012A 2CFB,8105012C 2CFB,8105012E 2CFB,81050130 2CFB,81050132 2CFB,81050134 2CFB,81050136 2CFB,810528F4 DDDD,810528F6 DDDD,81052CE8 2CCA,81052CEC 2CFB,81050400 2CFB,81050402 2CFB,81050404 2CFB,81050406 2CFB,81050408 2CFB,8105040A 2CFB,8105040C 2CFB,8105040E 2CFB +Cheat84="Replace Raw War with\DUDLEY ARENA",8105042C 21A7,8105042E 2D0D,81050432 2D0D,81050436 21A7,8105043E 2D0D,81050440 0000,81050442 0000,810500E8 2D0D,8105010C 2CFD,8105010E 2CFD,81050150 2D29,81050152 2CFB,81050400 09EF,81050402 09EF,81050404 0000,81050406 0000,81050408 0000,8105040A 0000,8105040C 09EF,8105040E 09EF,81050188 04F6,8105018A 04F7,8105018C 04F8,8105018E 04F9,81050190 09EF,81050192 0000,81050194 09EF,81050196 2D0D,810528F4 6666,810528F6 6666,81052CE8 2CC2,81052CEC 2D0D,81052D1C 2CD3,81052D1E 2CD4,81052D20 2CD5,81052D22 2CD6,81052D24 2CFD,81052D26 2CFD,81052D28 2CFB,81052D2A 2CFB,81050124 2CFD,81050126 2CFD,81050128 2CFD,8105012A 2CFD,8105012C 2CFD,8105012E 2CFD,81050130 2CFD,81050132 2CFD,81050134 2CFD,81050136 2CFD,81050154 2CFB,811533F8 002E +Cheat85="Replace Raw War with\FLAME ARENA",8105010E 0EFE,8105010C 0EFE,810528F4 2508,810528F6 2508,81050430 2401,81050430 2401,81050404 2401,81050406 2401,81050408 2401,81050409 2401,8105040A 2401,8105040C 2401,810500E8 2401 +Cheat86="Replace Raw War with\GREENWICH STREET ARENA",81050430 2DC5,81050436 0000,81050438 0000,8105043A 0000,8105043E 0000,810504E8 0EFE,8105010E 2DC5,8105010C 2DC5,81050196 2CFD,81050136 0FB6,81050134 0FC6,81050132 0FB6,81050130 0FC6,8105012E 0FB6,8105012C 0FC6,8105012A 0FB6,81050128 0FC6,81050126 0FB6,81050124 0FC6,81050440 0000,81050442 0000,50002C02 0000,81050378 0000,50002C02 0000,810502EC 0000,50001402 0000,81050290 0000,50000902 0000,81050262 0000,50000402 0000,810501CE 0000,50001002 0000,810501B8 0000,50000402 0000,810501E0 0000,8105042C 2D0D,81050430 0000,81050150 24F0 +Cheat87="Replace Raw War with\HHH ARNEA",8105040E 24EF,8105040C 24EF,8105040A 24EF,81050408 24EF,81050406 24EF,81050404 24EF,81050402 24EF,81050400 24EF,81050436 24E9,81050440 24E9,81050442 24E9,8105043E 24EF,8105042E 24EF,8105043C 24EF,8105042C 24E9,8105010E 24E9,8105010C 24E9,81050196 24E9,8105042E 24EF,81050432 24EF,810500F8 24EF,810500FA 24EF,810500FC 24EF,810500FC 24EF,81050100 24EF,81050100 24EF,81052CE8 2CCA,81052CEC 24EF,81050150 24E9,81050152 24E9,81050154 24E9,810528F4 24E9,810528F6 24E9 +Cheat88="Replace Raw War with\HOSPITAL ARENA",8105042C 0949,8105042E 283F,81050428 0949,81050430 0949,81050430 0949,81050436 096B,81050438 0993,8105043A 096B,8105043E 283F,81050440 283F,81050442 283F,810504E8 0949,81050150 283F,81050196 283F,81050400 283F,81050402 283F,81050404 283F,81050406 283F,81050408 283F,8105040A 283F,8105040C 283F,8105040E 283F,810500F8 283F,810500FA 283F,810500FC 283F,810500FE 283F,81050100 283F,81050100 283F,81052CE8 2CCA,81052CEC 283F,8105010E 283F,8105010C 283F,81050124 0949,81050126 0949,81050128 0949,8105012A 0949,8105012C 0949,8105012E 0949,81050130 0949,81050132 0949,81050134 0949,81050136 0949,810500E8 0949,810528F4 0000,81052CE0 2CC9 +Cheat89="Replace Raw War with\KANE ARENA",8105042C 0A61,8105042E 0A61,81050428 2B6C,81050430 2B6C,81050430 2B6C,81050436 2B57,81050438 2B57,8105043A 2B57,8105043E 0A61,81050440 2B57,81050442 2B57,810500E8 1B1E,8105010E 2D37,8105010C 209F,81050194 0955,81050196 2B57,81050400 2699,81050402 2699,81050404 2699,81050406 2699,81050408 2699,8105040A 2699,8105040C 2699,8105040E 2699 +Cheat90="Replace Raw War with\SHIMMER ARENA",8105042C 1932,8105042E 1932,81050430 1932,81050434 1932,81050432 1932,81050436 1932,81050438 1932,8105043A 1932,8105043E 1932,81050440 1932,81050442 1932,81050150 1932,81050152 1932,81050154 1932,81050190 1932,81050192 1932,81050194 1932,81050196 1932,81050124 1932,81050126 1932,81050128 1932,8105012A 1932,8105012C 1932,8105012E 1932,81050130 1932,81050132 1932,81050134 1932,81050136 1932,810500E8 1932,8105010E 1932,8105010C 1932 +Cheat91="Replace Raw War with\SPACE SHIP ARENA",8105042C 094D,8105042E 0953,81050430 0953,81050432 0F0E,81050434 0953,81050436 0F0E,81050438 0899,8105043C 0953,8105043E 0899,81050440 0963,81050442 0963,81050400 0953,81050402 0953,81050404 0953,81050406 0953,81050408 0953,8105040A 0953,8105040C 0953,8105040E 0953,810500E8 0A75,810528F4 7223,810528F6 0119,81050150 0963,81050152 0963,81050190 0953,81050192 0953,81050194 0953,81050196 0963,8105010E 0F0E,8105010C 0F0E,81050124 0F10,81050126 0F10,81050128 0F10,8105012A 0F10,8105012C 0F10,8105012E 0F10,81050130 0F10,81050132 0F10,81050134 0F10,81050136 0F10,810500F8 0963,810500FA 0963,810500FC 0963,810500FE 0963,81050100 0963,81050102 0963,81052CE8 2CCA,81052CEC 0963 +Cheat92="Tables\IN RING TABLE\Part 1",81052CF0 06E1,81052CF4 09F1,81052CF8 06E2,81052D00 09F1,81052D0C 06E3,81052D0E 06E4,81052D10 09EF,81052D12 09EF,81052D14 06E5,81052D16 06E6,81052D18 09EF,81052D1A 09EF,D1064880 0001,8115AFB0 432C,D1064880 0001,8115B308 432C,D1064880 2000,8115AFB0 42B4,D1064880 2000,8115B308 42B4,8116C330 0000,8116C332 0014,8116C334 0000,8116C336 0014,8116C374 4210,8116C376 C0B1,8116C378 432F,8116C37A 51DC,8116C37C 4210,8116C37E 92F1,8116C382 0800,8116C386 05A0,8116C38A 0800,8116C38C FFFF,8116C38E F3BC,8116C3E4 0000,8116C3E6 0015,8116C3E8 0000,8116C3EA 0015,8116C428 4210,8116C42A C0B1,8116C42C 432F,8116C42E 51DC,8116C430 4210,8116C432 92F1,8116C436 0800,8116C43A 05A0,8116C43E 0800,8116C440 FFFF,8116C442 F3BC,D1064880 2000,8116C378 42E0 +Cheat93="Tables\IN RING TABLE\Part 2",D1064880 2000,8116C382 07E0,D1064880 2000,8116C38A 0680,D1064880 2000,8116C42C 42E0,D1064880 2000,8116C436 0820,D1064880 2000,8116C43E 0980,8116C498 0000,8116C49A 0017,8116C49C 0000,8116C49E 0017,8116C4DC 4210,8116C4DE C0B1,8116C4E0 432A,8116C4E2 51DC,8116C4E4 4210,8116C4E6 92F1,8116C4EA 0800,8116C4EE 05A0,8116C4F2 0800,8116C4F4 FFFF,8116C4F6 F3BC,8116C54C 0000,8116C54E 0018,8116C550 0000,8116C552 0018,8116C590 4210,8116C592 C0B1,8116C594 432A,8116C596 51DC,8116C598 4210,8116C59A 92F1,8116C59E 0800,8116C5A2 05A0,8116C5A6 0800,8116C5A8 FFFF,8116C5AA F3BC,D1064880 2000,8116C4E0 42E0,D1064880 2000,8116C4EA 07E0,D1064880 2000,8116C4F2 0680,D1064880 2000,8116C594 42E0,D1064880 2000,8116C59E 0820,D1064880 2000,8116C5A6 0980 +Cheat94="Novalty\Truck In The Crowd",81050110 0747,81050112 0748,81050114 0749,81050116 074A,81050118 074B,81050124 0A4B,81050126 0A43,81050128 0A4B,8105012A 0A43,8105012C 0A43,8105012E 0A43,8105011A 074C,8105011C 074D,81050130 0A43,8105011E 074E,81050132 0A43,81050120 0746,81050134 0A4B,81050122 0743,81050136 0A4B,D1064880 2000,8115AFB0 42EE,D1064880 2000,8115B308 42EE +Cheat95="CPU To Human Control\Player 4",8015B9A1 00?? +Cheat95_O=$17 Human,$18 CPU +Cheat96="Clock At 00:00",8115AB1E 0000,810A99F2 0000 +Cheat97="Hacked Moves\Dragon Screw Stunner",D106B454 3749,D106B456 0094,8106B460 00E9,D106B454 3749,D106B456 0094,8106B462 B9BE,D106B514 374A,D106B516 0094,8106B520 00E9,D106B514 374A,D106B516 0094 +Cheat98="Hacked Moves\Morality Check to Back of head",D106B454 3892,D106B456 0000,8106B460 00B3,D106B454 3892,D106B456 0000,8106B462 194C +Cheat99="Hacked Moves\Dragon Screw Suplex",D106B454 3749,D106B456 007C,8106B460 00AD,D106B454 3749,D106B456 007C,8106B462 DB2A,D106B514 374A,D106B516 007C,8106B520 00AD,D106B514 374A,D106B516 007C,8106B522 EAE0,D106B454 3749,D106B456 00A5,8115AF52 0000,D106B514 374A,D106B516 00A5,8115B2AA 0000 +Cheat100="Hacked Moves\Dominator into HHH Facebuster",D106B454 3810,D106B456 005C,8106B560 011A,D106B454 3810,D106B456 005C,8106B562 A256,D106B514 3811,D106B516 005C,8106B520 011A,D106B514 3811,D106B516 005C,8106B522 ACB0,D106B454 3810,D106B456 0075,8115AF52 0000 +Cheat101="Hacked Moves\Capture Tazzplex",D106B454 3689,D106B456 0021,8106B460 00BC,D106B454 3689,D106B456 0021,8106B462 A5E2,D106B514 368A,D106B516 0021,8106B520 00BC,D106B514 368A,D106B516 0021,8106B522 B6BE +Cheat102="Hacked Moves\Running Rock Bottom",D106B454 3A80,D106B456 0000,8106B460 00C1,D106B454 3A80,D106B456 0000,8106B462 F7A2,D106B514 3A81,D106B516 0000,8106B520 00C2,D106B514 3A81,D106B516 0000,8106B522 1210 +Cheat103="Hacked Moves\Running Tazplex",D106B454 3A7A,D106B456 0000,8106B460 00BC,D106B454 3A7A,D106B456 0000,8106B462 A51E,D106B514 3A7B,D106B516 0000,8106B520 00BC,D106B514 3A7B,D106B516 0000,8106B522 B5FA +Cheat104="Tables\MOVABLE TABLES\Part 1",81052C24 06E1,81052C26 06E3,81052C2C 09F1,81052C2E 09EF,81052C30 06E2,81052C32 06E5,81052C38 09F1,81052C3A 09EF,81052C48 06E4,81052C4A 06E6,81052C50 09EF,81052C52 09EF,8116C3E4 0000,8116C3E6 0001,8116C3E8 0000,8116C3EA 0001,8116C498 0000,8116C49A 0003,8116C49C 0000,8116C49E 0003,8116C330 0000,8116C332 0000,8116C334 0000,8116C336 0000,D116C556 0000,8116C33A 0000,D116C33A 0000,8116C3EE 0000,D116C3EE 0000,8116C4A2 0000,D116C556 0001,8116C33A 0001,D116C33A 0001,8116C3EE 0001,D116C3EE 0001,8116C4A2 0001,D116C556 0002,8116C33A 0002,D116C33A 0002,8116C3EE 0002,D116C3EE 0002,8116C4A2 0002,D116C556 0003,8116C33A 0003,D116C33A 0003,8116C3EE 0003,D116C3EE 0003,8116C4A2 0003,D116C556 FFFF,8116C33A FFFF,D116C33A FFFF,8116C3EE FFFF,D116C3EE FFFF,8116C4A2 FFFF,D216C556 FFFF,81079B10 3F80,D1064886 2000,81079B10 3F81,D106488C 2000,81079B10 3F81,D1064892 2000,81079B10 3F81 +Cheat105="Tables\MOVABLE TABLES\Part 2",D116C33A FFFF,8116C382 0000,D116C382 0000,8116C386 0000,D116C386 0000,8116C38A 0000,D116C38A 0000,8116C38E 0000,D116C38E 0000,8116C436 0000,D116C436 0000,8116C43A 0000,D116C43A 0000,8116C43E 0000,D116C43E 0000,8116C442 0000,D116C442 0000,8116C4EA 0000,D116C4EA 0000,8116C4EE 0000,D116C4EE 0000,8116C4F2 0000,D116C4F2 0000,8116C4F6 0000,D116C594 42B4,D116C556 FFFF,8116C378 4335,D116C378 4335,8116C42C 4335,D116C42C 4335,8116C4E0 4335,D116C594 3DC7,D116C556 FFFF,8116C378 42B0,D116C378 42B0,8116C42C 42B0,D116C42C 42B0,8116C4E0 42B0,D1064880 2000,81079B10 3F81,D1079B10 3F81,D116C594 42B4,D116C556 FFFF,8116C378 42F0,D116C378 42F0,8116C42C 42F0,D116C42C 42F0,8116C4E0 42F0,D1079B10 3F81,8116C38A 0F00,D116C38A 0F00,8116C43E 0100,D116C594 3C93,8116C378 42B0,81052D18 0000,81052D1A 0000,D116C54C 0000,8116C54E 0018,D116C550 0000,8116C552 0018 +Cheat106="Tables\Sabu Table",8116C49A 000C,8116C49E 000C,8116C4DC 43CC,8116C4E0 42E6,8116C4E4 C2C5,8116C4EE 0800,8116C602 000C,8116C606 000C,8116C648 42E6,8116C644 43CC,8116C64C C314,81052C54 06E3,81052C5C 09EF,8116C6F8 43CC,8116C6FC 42F0,8116C700 C2F1,8116C70A 0400,8116C428 43CC,8116C430 C2D0,8116C42C 42F0,8116C43A 0C00,8116C6B6 0004,8116C6BA 0004,8116C3E6 0004,8116C3EA 0004,D1064880 2000,81005592 3F81,D1005592 3F81,8116C4EA 0F00,D1005592 3F81,8116C652 0100,D1005592 3F81,8116C4E0 4240,D1005592 3F81,8116C648 4240,D1064880 0005,81005CD4 3F83,D1005CD4 3F83,8116C4EA 0000,D1005CD4 3F83,8116C652 0000,D1005CD4 3F83,8116C4E0 42E6,D1005CD4 3F83,8116C648 42E6,D1005CD4 3F83,D1064880 2000,81005CD4 0000 +Cheat0_N=For Championship Mode +Cheat1_N=For Smackdown Mall Shop +Cheat15_N=This lets player 2 play with you in championship mode so if you have a friend that you want to tag team up with in tag team championship now you can. +Cheat19_N=Do not use with Auto Pin +Cheat20_N=Do not use with Auto Pin +Cheat21_N=Do not use with Auto Pin +Cheat22_N=Do not use with Auto Pin +Cheat23_N=Do not use with Cant Pin +Cheat24_N=Do not use with Cant Pin +Cheat25_N=Do not use with Cant Pin +Cheat26_N=Do not use with Cant Pin +Cheat27_N=Do not use this with anyother Play As Player 1 Option, only use one option at a time +Cheat28_N=Do not use this with anyother Play As Player 1 Option, only use one option at a time +Cheat29_N=Do not use this with anyother Play As Player 1 Option, only use one option at a time +Cheat30_N=Do not use this with anyother Play As Player 2 Option, only use one option at a time +Cheat31_N=Do not use this with anyother Play As Player 2 Option, only use one option at a time +Cheat32_N=Do not use this with anyother Play As Player 2 Option, only use one option at a time +Cheat33_N=Do not use this with anyother Play As Player 3 Option, only use one option at a time +Cheat34_N=Do not use this with anyother Play As Player 3 Option, only use one option at a time +Cheat35_N=Do not use this with anyother Play As Player 3 Option, only use one option at a time +Cheat36_N=Do not use this with anyother Play As Player 4 Option, only use one option at a time +Cheat37_N=Do not use this with anyother Play As Player 4 Option, only use one option at a time +Cheat38_N=Do not use this with anyother Play As Player 4 Option, only use one option at a time +Cheat42_N=Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time +Cheat43_N=Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time +Cheat44_N=Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time +Cheat45_N=Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time +Cheat46_N=Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time +Cheat47_N=Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time +Cheat48_N=Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time +Cheat49_N=Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time +Cheat50_N=Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time +Cheat51_N=Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time +Cheat52_N=Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time +Cheat53_N=Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time +Cheat54_N=Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time +Cheat55_N=Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time +Cheat56_N=Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time +Cheat57_N=Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time +Cheat58_N=Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time +Cheat59_N=Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time +Cheat60_N=Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time +Cheat61_N=Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time +Cheat62_N=Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time +Cheat63_N=Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time +Cheat64_N=Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time +Cheat65_N=Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time +Cheat66_N=Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time +Cheat67_N=Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time +Cheat68_N=Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time +Cheat69_N=Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time +Cheat70_N=Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time +Cheat71_N=Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time +Cheat72_N=Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time +Cheat73_N=Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time +Cheat74_N=Press Z for the ladder to appear, sometimes there is an invisable ladder +Cheat75_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat76_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat77_N=Both Parts must be on for this Press the C Left Button to make your opponent bleed,These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat78_N=Both Parts must be on for this Press the C Left Button to make your opponent bleed,These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat79_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat80_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat81_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat82_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat83_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat84_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat85_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat86_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat87_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat88_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat89_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat90_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat91_N=These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. +Cheat92_N=To Make the Table look broken Keep the Z Button press down, To make player stand on the Table, Stand next to it & Keep C-Right Pressed Down.Put all Parts on Together for this Cheat to work +Cheat93_N=To Make the Table look broken Keep the Z Button press down, To make player stand on the Table, Stand next to it & Keep C-Right Pressed Down.Put all Parts on Together for this Cheat to work +Cheat97_N=Dragon Screw 02 P1 does a Dragon Screw then picks up P2 (still holding his leg) and spins him around and gives him a Stone Cold Stunner +Cheat98_N=Replaces: Back Clothesline P1 is immediately backed up and does the Morality Check to P2 in the back of the head (misses by a little) +Cheat99_N=Replaces: Double Dragon Screw 02 P1 does a Dragon screw then picks then up (still holding their feet) and does a capture suplex. +Cheat100_N=Replaces: Dominator +Cheat101_N=Replaces: Capture Suplex P1 grabs P2's feet like a capture suplex, then lets go & does a Tazzplex. +Cheat102_N=Replaces: Farooq Spinebuster P2 runs into P1 and P1 delivers a RockBottom to P2. +Cheat103_N=Replaces: Underhook Belly to Belly P2 runs into P1 and P1 does a Tazplex to P2. +Cheat104_N=You must use both parts for this cheat to work +Cheat105_N=You must use both parts for this cheat to work +Cheat106_N= Breakable/Fixable/Rebreakable/Refixable press Z to break, C-right + Cdown to fix + +//---- + +[C71353BE-AA09A6EE-C:50] +Name=WWF WrestleMania 2000 (E) +Cheat0="Have All Characters",8109ED5A FFFF +Cheat1="Infinite Create-A-Wrestler Attribute Points",8011A81B 001E +Cheat2="Timer Is Always 00:00",8016F0AF 0000 +Cheat3="Max Attributes",8011A811 0032,8011A813 0032,8011A815 0032,8011A817 0032,8011A819 0032 +Cheat4="Weapon Select\Player 1",81167236 0300,81166D90 ????,81166D92 0000,80166E50 0000 +Cheat5="Weapon Select\Player 2",811676CA 0300,81166DC0 ????,80166DC2 0001,80166E51 0001 +Cheat6="Weapon Select\Player 3",81167B5E 0300,81166DF0 ????,80166DF2 0002,80166E52 0002 +Cheat7="Weapon Select\Player 4",81167FF2 0300,81166E18 ????,81166E1A 0003,80166E53 0003 +Cheat8="Always Special\Player 1",80167235 0004 +Cheat9="Always Special\Player 2",801676C9 0004 +Cheat10="Always Special\Player 3",80167B5D 0004 +Cheat11="Always Special\Player 4",80167FF1 0004 +Cheat12="Specials Don't Run Out",8112AD94 2400 +Cheat13="Max Spirit\Player 1",801671F5 00FF +Cheat14="Always Normal Spirit\Player 1",801671F5 0032 +Cheat15="No Spirit\Player 1",801671F5 0000 +Cheat16="Max Spirit\Player 2",80167689 00FF +Cheat17="Always Normal Spirit\Player 2",80167689 0032 +Cheat18="No Spirit\Player 2",80167689 0000 +Cheat19="Max Spirit\Player 3",80167B1D 00FF +Cheat20="Always Normal Spirit\Player 3",80167B1D 0032 +Cheat21="No Spirit\Player 3",80167B1D 0000 +Cheat22="Max Spirit\Player 4",80167FB1 00FF +Cheat23="Always Normal Spirit\Player 4",80167FB1 0032 +Cheat24="No Spirit\Player 4",80167FB1 0000 +Cheat25="Ultimate Codes\Player 1",801671F4 0064 +Cheat26="Ultimate Codes\Player 2",80167688 0064 +Cheat27="Ultimate Codes\Player 3",80167B1C 0064 +Cheat28="Ultimate Codes\Player 4",80167FB0 0064 +Cheat39="Easy Pins & Longer Submissions\Player 1",801671F4 0064 +Cheat30="Easy Pins & Longer Submissions\Player 2",80167688 0064 +Cheat31="Easy Pins & Longer Submissions\Player 3",80167B1C 0064 +Cheat32="Easy Pins & Longer Submissions\Player 4",80167FB0 0064 +Cheat4_O=$0000 Broom,$0101 Shovel,$0202 Red And White Hockey Stick,$0303 Guitar,$0404 Night Stick,$0505 Head,$0606 Black Hockey Stick,$0707 Bottle,$0808 2x4,$0909 Big Purple Sheet,$0A0A White Jug,$0B0B Suit Case,$0C0C Stick,$0D0D Head,$0E0E Big Mallot,$0F0F Black Microphone,$1010 BaseBall Bat,$1111 Folding Chair,$1212 Board,$1313 Stairs,$1414 Trashcan,$FFFF Nothing +Cheat5_O=$0000 Broom,$0101 Shovel,$0202 Red And White Hockey Stick,$0303 Guitar,$0404 Night Stick,$0505 Head,$0606 Black Hockey Stick,$0707 Bottle,$0808 2x4,$0909 Big Purple Sheet,$0A0A White Jug,$0B0B Suit Case,$0C0C Stick,$0D0D Head,$0E0E Big Mallot,$0F0F Black Microphone,$1010 BaseBall Bat,$1111 Folding Chair,$1212 Board,$1313 Stairs,$1414 Trashcan,$FFFF Nothing +Cheat6_O=$0000 Broom,$0101 Shovel,$0202 Red And White Hockey Stick,$0303 Guitar,$0404 Night Stick,$0505 Head,$0606 Black Hockey Stick,$0707 Bottle,$0808 2x4,$0909 Big Purple Sheet,$0A0A White Jug,$0B0B Suit Case,$0C0C Stick,$0D0D Head,$0E0E Big Mallot,$0F0F Black Microphone,$1010 BaseBall Bat,$1111 Folding Chair,$1212 Board,$1313 Stairs,$1414 Trashcan,$FFFF Nothing +Cheat7_O=$0000 Broom,$0101 Shovel,$0202 Red And White Hockey Stick,$0303 Guitar,$0404 Night Stick,$0505 Head,$0606 Black Hockey Stick,$0707 Bottle,$0808 2x4,$0909 Big Purple Sheet,$0A0A White Jug,$0B0B Suit Case,$0C0C Stick,$0D0D Head,$0E0E Big Mallot,$0F0F Black Microphone,$1010 BaseBall Bat,$1111 Folding Chair,$1212 Board,$1313 Stairs,$1414 Trashcan,$FFFF Nothing + +//---- + +[0A1667C7-293346A6-C:50] +Name=Xena Warrior Princess - Talisman of Fate (E) +Cheat0="Infinite Health\Player 1",810B5EF0 42C8 +Cheat1="Invisibility\Player 1",810BF3A2 0001 +Cheat2="Infinite Health\Player 2",810B60D4 42C8 +Cheat3="1 Win To Win\Player 1",D00C0983 0000,800C0983 0001 +Cheat4="1-Hit Death to Player 2\Player 1",D10B60D4 42C8,810B60D4 4080 +Cheat5="Player 2 Has No Energy\Player 1",810B60D4 C080 +Cheat6="P2 Never Wins\Player 1",800C0985 0000 +Cheat7="Needs 1 Win To Win\Player 2",D00C0985 0000,800C0985 0001 +Cheat8="1-Hit Death to Player 1\Player 2",D10B5EF0 42C8,810B5EF0 4080 +Cheat9="Player 1 Has No Energy\Player 2",810B5EF0 C080 +Cheat10="P1 Never Wins\Player 2",800C0983 0000 +Cheat11="Join River Team",810BF482 0001 +Cheat11_N=Select Quest Mode +Cheat12="Fight Forest Team",810BF482 0001 +Cheat12_N=Select Hardest Difficulty + Quest Mode +Cheat13="Unlock Titan Difficulty Level",810BF4D2 0001 + +//---- + +[D3F97D49-6924135B-C:50] +Name=Yoshi's Story (E) +Cheat0="Infinite\Health",50000804 0000,800F954F 0008 +Cheat0_N=This is for All Yoshis All levels +Cheat1="Infinite\Lives",800F958F 00FF +Cheat1_N=This is for All Yoshis All levels +Cheat2="Infinite Eggs",80285078 0006 +Cheat2_N=This is for All Yoshis All levels + + +//--------------- PAL (A) Region Cheat Codes + + +[155B7CDF-F0DA7325-C:55] +Name=BANJO TOOIE +Cheat0="Infinite\Energy\Banjo and Kazooie",8011FFA9 0063,81120584 0A0A +Cheat1="Infinite\Energy\Snowball",8011FFA9 0063,80120587 0005 +Cheat2="Infinite\Energy\Bee",8011FFA9 0063,80120593 000A,80120594 000A +Cheat3="Infinite\Energy\Washing Machine",8011FFA9 0063,81120596 0A0A +Cheat4="Infinite\Energy\Stony",8011FFA9 0063,80120599 000A,8011B44A 000A +Cheat5="Infinite\Energy\Banjo",8011FFA9 0063,8012059F 000A,801205A0 000A +Cheat6="Infinite\Energy\Kazooie",8011FFA9 0063,811205A2 0A0A +Cheat7="Infinite\Energy\Submarine",8011FFA9 0063,801205A5 000A,801205A6 000A +Cheat8="Infinite\Energy\Mumbo",8011FFA9 0063,811205A8 0A0A +Cheat9="Infinite\Energy\Detonator",8011FFA9 0063,811205AE 0A0A +Cheat10="Infinite\Energy\T-Rex Baby",8011FFA9 0063,801205BF 000A,801205C0 000A +Cheat11="Infinite\Air",8112FDC2 42C8 +Cheat12="Instant Warp\Options\Not sure",D008B284 0000,8012C390 ????,8012C393 0001 +Cheat12_O=$00FC Lord woo fak fak,$00F9 Mr Patch,$0121 Inside Chuffy's wagon,$0134 Mumbo's Skull,$0135 Humba Wumba's wigwam 1,$0157 Humba Wumba's wigwam 2,$019B Jingalings Zombified Palace,$01A6 Smuggler cavern,$0141 Inside the digger tunnel,$0143 Bottles house,$0169 Bottles house still,$018A HAG Inside,$019A HAG1 Final Boss +Cheat13="Instant Warp\Options\Cauldron Keep",D008B284 0000,8112C390 ????,8012C393 0001 +Cheat13_O=$015D Cauldron Keep,$015E The gatehouse,$015F Tower of Tragedy Quiz,$0160 Gun chamber,$016A Gun room still,$017B Crazy Castle Stockade balloon burst multi,$017C Crazy Castle Stockade Jump the hoops multi,$017D Grunty Industries packing game,$0180 Colosseum kickball arena,$0186 Dodgems +Cheat14="Instant Warp\Options\Spiral Mountain",D008B284 0000,8112C390 ????,8012C393 0001 +Cheat14_O=$00AD Grunty's Old Lair,$00AE Behind The Waterfall,$00AF Top Of Castle,$0173 Banjo's house +Cheat15="Instant Warp\Options\Jinjo Village",D008B284 0000,8112C390 ????,8012C393 0001 +Cheat15_O=$0142 Jinjo Village,$0144 King Jingalings throne room,$0143 Bottles house,$0145 Green Jinjo's House,$0146 Black Jinjo's House,$0147 Yellow Jinjo's House,$0148 Blue Jinjo's House,$014A Brown Jinjo's House,$014B Orange Jinjo's House,$014C Purple Jinjo's House,$014D Red Jinjo's House,$014E White Jinjo's House +Cheat16="Instant Warp\Options\Mayahem Temple",D008B284 0000,8112C390 ????,8012C393 0001 +Cheat16_O=$00B6 Humba's Wigwam,$00B7 Mumbo's skull,$00B8 The Temple,$00B9 Prison Compound,$00BC Code chamber,$00C4 Jade Snake Grove,$00C5 Treasure Chamber,$00C6 Kickball Arena,$0177 Targitzan's Slighty Sacred Temple,$0178 Inside Targitzans Temple,$0179 Targitzan Temple Lobby,$017A Targitzan's Temple Boss,$017F Mayan Kickball Arena,$0166 Multi,$0167 Still,$00C8 Kickball Arena,$00C9 Kickball Arena +Cheat17="Instant Warp\Options\Glitter Gulch Mine",D008B284 0000,8112C390 ????,8012C393 0001 +Cheat17_O=$00C7 Mine,$00CA Fuel depot,$00CB Crushing shed,$00CC Flooded caves,$00CD Water storage,$00CE Waterfall cavern,$00CF Power hut basement,$00D0 Chuffy's cab,$00D1 Inside chuffy's boiler boss,$00D2 Gloomy caverns,$00D3 Generator caverns,$00D4 Power hut,$00D5 Wumba's wigwam,$00D7 Train station,$00D8 Prospectors hut,$00D9 Mumbo's hut,$00DA Toxic gas cave,$00DB Canary cave,$00DC Ordnance storage,$00E9 Humba,$0126 Water supply pipe,$0163 Ordnance Storage entrance,$0164 Ordnance Storage game,$0165 Ordnance Storage game Multi,$016F Testing,$0170 Testing,$0171 Mumbo's skull +Cheat18="Instant Warp\Options\Witchy World",D008B284 0000,8112C390 ????,8012C393 0001 +Cheat18_O=$00D6 Witcy World,$00DD Dodgem dome lobby,$00DE Dodgem challenge "1 vs 1",$00DF Dodgem challenge "2 vs 1",$00E0 Dodgem challenge "3 vs 1",$00E1 Crazy castle stockade,$00E2 Crazy castle lobby,$00E3 Crazy castle pump room,$00E4 Balloon burst game,$00E5 Hoop hurry game,$00E6 Star spinner,$00E7 The inferno,$00EA Cave of horrors,$00EB Haunted cavern,$00EC Train station,$0124 Saucer of Peril,$013B Crazy castle stockade "sop",$013C Star spinner "sop",$0176 Mumbo's skull +Cheat19="Instant Warp\Options\Jolly Roger's Lagoon",D008B284 0000,8112C390 ????,8012C393 0001 +Cheat19_O=$00ED Jolly's,$00EE Pawno's emporium,$00EF mumbo's skull,$00F4 Ancient Swimming Baths,$00F6 Electric Eels lair,$00F7 Seaweed Sanctum,$00F8 Inside the big fish,$00FA temple of the fishes,$01A8 Atlantis,$01A9 Seabottom,$0181 sea bottom cavern,$0182 submarine multi,$01A7 Jolly Roger's Lagoon,$00FF Blubber's wave race hire +Cheat20="Instant Warp\Options\Terrydacty Land",D008B284 0000,8112C390 ????,8012C393 0001 +Cheat20_O=$0112 Terrydacty Land,$0113 Terry's nest,$0114 Train station,$0115 Oogle boogles cave,$0116 Inside the mountain,$0117 River passage,$0118 Styracosaurus family cave,$0119 Unga bunga's cave,$011A Stomping plains,$011B Bonfire caverns,$011E Humba's Wigwam,$0123 Inside chompa's belly,$0183 Chompa's belly multi +Cheat21="Instant Warp\Options\Grunty Industries",D008B284 0000,8112C390 ????,8012C393 0001 +Cheat21_O=$0100 Outside,$0101 Inside,$0102 Train station,$0103 Workers quarters,$0104 Trash compactor,$0105 Elevator shaft,$0106 Floor 2,$0107 Floor 2 "electromagnet chamber",$0108 Floor 3,$0109 Floor 3 "boiler plant",$010A Floor 3 "packing room",$010B Floor 4,$010C Floor 4 "cable room",$010D Floor 4 "quality control",$010E Floor 5,$010F Basement,$0110 Basement "repair depot,$0111 Basement "waste disposal",$0125 Water supply pipe,$0172 Mumbo's skull,$0162 Floor 4 "clinkers cavern",$0187 Sewer entrance +Cheat22="Instant Warp\Options\Hailfire Peaks",D008B284 0000,8112C390 ????,8012C393 0001 +Cheat22_O=$0127 Lava side,$0128 Icy side,$0129 Lava train station,$012A Ice train station,$012B Chilli billi,$012C Chilly willy,$012D Colosseum kickball stadium lobby,$0131 Boggy's igloo,$0132 Icicle grotto,$0133 Inside the volcano,$0168 Icy side still +Cheat23="Instant Warp\Options\Cloud Cuckoo Land",D008B284 0000,8112C390 ????,8012C393 0001 +Cheat23_O=$0136 Cloud Cuckoo Land 1,$0137 Inside the trashcan,$0138 Inside the cheesewedge,$0139 Zubba's nest,$013A Central cavern,$013D Inside the pot o gold,$013E Mumbo's skull,$013F Mingy jongo's skull,$0140 Humba wumba's wigwam,$0161 Cloud Cuckoo Land 2,$0188 Zubba's nest multi,$0185 Trash can mini +Cheat24="Instant Warp\Options\Isle O Hags",D008B284 0000,8112C390 ????,8012C393 0001 +Cheat24_O=$014F Wooded Hollow,$0150 Heggy's egg shed,$0151 Jiggywiggy's temple,$0152 Plateau,$0153 Plateau "Honey B's Hive",$0154 Pine Grove,$0155 Cliff top,$0156 Cliff top Mumbo's skull,$015A wasteland,$015B inside another digger tunnel,$015C Quagmire +Cheat25="Play As",D108B284 0000,8012BD9C 00?? +Cheat25_O=$01 Banjo and Kazooie,$02 Snowball,$06 Bee,$07 Washing machine,$08 Stony,$0A Banjo,$0B Kazooie,$0C Submarine,$0D Mumbo,$0E Golden Goliath,$0F Detonator,$10 Truck,$12 T-rex baby,$13 T-rex daddy +Cheat0_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat1_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat2_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat3_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat4_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat5_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat6_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat7_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat8_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat9_N=With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. +Cheat12_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat13_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat14_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat15_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat16_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat17_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat18_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat19_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat20_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat21_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat22_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat23_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat24_N=Only use one Instant Warp Option At once, Make sure the other is off before putting this one on +Cheat25_N=To use this cheat, put the cheat on, then press L as you walk through a door to become that chosen character +Cheat26="Beta Bottles Revenge Mode",80130172 0001,8008B4D1 0002 +Cheat26_N=Bottles Revenge is a Beta mode from Banjo Tooie that the RWP team recently uncovered after an extraordinary amount of effort. Bottles the Spirit transforms into Bottles the Devil and posses enemies nearby and allows a second player hooked up to Pad 2 to play as that Posses character to try to foil Banjos Plans. As player one goes about its business, player two uses every enemy nearby to try to nab Banjo and take away some life. This mode is incredible, and you can control almost every enemy in the game: slot machines, flying creatures, uggers, zubbas...and this is just the beginning. (Congrats Rare Witch Project) + +//---- + +[7BB18D40-83138559-C:55] +Name=Pokemon Snap (A) +Cheat0="[Enable All Levels]",810C2CD2 0006 +Cheat0_N=This is needed to be able to Play all Levels of the Game + +//---- + +[2483F22B-136E025E-C:55] +Name=Lylat Wars (A) +Cheat0="Unlimited\Boost",8113E6FC 0000,8113E6FE 0000,811415DC 0000,811415DE 0000,8013E7FD 0000,801416DD 0000 +Cheat1="Have All Medals",50000802 0000,8017A9D9 7777 +Cheat2="Infinite\Hyper Laser",80163B13 0002 +Cheat3="Loads O' Hits",80163B03 00FF +Cheat4="Infinite\Armor\Slippy",8017418B 00FF +Cheat5="Infinite\Energy",80141587 00FF,8013E6A7 00FF +Cheat6="Infinite\Lives",80163B09 0063 +Cheat7="Unlimited\Smart Bombs",80179E0B 0063 +Cheat8="Infinite\Armor\Falco",80174187 00FF +Cheat9="Infinite\Armor\Peppy",8017418F 00FF +Cheat10="Infinite\Dual Blue Lasers",80163C13 0002 +Cheat11="Level Select",8017A29F 00?? +Cheat12="999 Kills",80163B03 00FF +Cheat11_O=$00 Corneria,$01 Meteo,$02 Sector X,$03 Area 6,$04 Glitch,$05 Sector Y,$06 Venom 1,$07 Solar,$08 Zoness,$09 Venom 2,$0A Training Mode Level,$0B Macbeth,$0C Titania,$0D Aquas,$0E Fortuna,$10 Katina,$11 Bolse,$12 Sector Z,$13 Venom With Starwolf,$14 Corneria (Multi) +Cheat1_N=For Expert & Normal Modes + +//---- + +[DD26FDA1-CB4A6BE3-C:55] +Name=Super Smash Bros. (A) +Cheat0="Give Kirby A Wierd Blow-Up",8025E898 000A +Cheat1="Story Mode\Skip Straight To Master Hand",800A5227 000D +Cheat2="Story Mode\Infinite Time",810A526E 43CB +Cheat3="Story Mode\Player 1\Infinite Lives",800A5283 0004 +Cheat4="Story Mode\Player 2\Infinite Lives",800A52F7 0004 +Cheat5="Story Mode\Player 3\Infinite Lives",800A536B 0004 +Cheat6="Story Mode\Player 4\Infinite Lives",800A53DF 0004 +Cheat7="Story Mode\Player 1\Low % Health",810A52C6 0000 +Cheat8="Story Mode\Player 2\Low % Health",810A533A 0000 +Cheat9="Story Mode\Player 3\Low % Health",810A53AE 0000 +Cheat10="Story Mode\Player 4\Low % Health",810A5422 0000 +Cheat11="Story Mode\Player 1\Character Modifier",800A527B 00?? +Cheat12="Story Mode\Player 2\Character Modifier",800A52EF 00?? +Cheat13="Story Mode\Player 3\Character Modifier",800A5363 00?? +Cheat14="Story Mode\Player 4\Character Modifier",800A53D7 00?? +Cheat15="Story Mode\Player 1\Kirby B Button Move\Hyrule Castle",8026924F 00?? +Cheat16="Story Mode\Player 1\Kirby B Button Move\Yoshi's Island",8026958F 00?? +Cheat17="Story Mode\Player 1\Kirby B Button Move\Sector Z",80271837 00?? +Cheat18="Story Mode\Player 1\Kirby B Button Move\Peach's Castle",802644DF 00?? +Cheat19="Story Mode\Player 1\Kirby B Button Move\Saffron City",802741D7 00?? +Cheat20="Story Mode\Player 1\Kirby B Button Move\Congo Jungle",8027120F 00?? +Cheat21="Story Mode\Player 1\Kirby B Button Move\Kirby's Dreamland",8026E27F 00?? +Cheat22="Story Mode\Player 1\Kirby B Button Move\Planet Zebes",802706E7 00?? +Cheat23="Story Mode\Player 1\Kirby B Button Move\Metal Mario Stage",80263CD7 00?? +Cheat24="Story Mode\Player 1\Kirby B Button Move\Fighting Polygon Team",80262E5F 00?? +Cheat25="Story Mode\Player 1\Kirby B Button Move\Master Hand Stage",8027238F 00?? +Cheat26="VS. Mode\Infinite Time",810A545E 43CB +Cheat27="VS. Mode\Player 1\Low % Health",810A54B6 0000 +Cheat28="VS. Mode\Player 2\Low % Health",810A552A 0000 +Cheat29="VS. Mode\Player 3\Low % Health",810A559E 0000 +Cheat30="VS. Mode\Player 4\Low % Health",810A5612 0000 +Cheat31="VS. Mode\Player 1\Character Modifier",800A546B 00?? +Cheat32="VS. Mode\Player 2\Character Modifier",800A54DF 00?? +Cheat33="VS. Mode\Player 3\Character Modifier",800A5553 00?? +Cheat34="VS. Mode\Player 4\Character Modifier",800A55C7 00?? +Cheat35="VS. Mode\Player 1\Kirby B Button Move\Hyrule Castle",8026412F 00?? +Cheat36="VS. Mode\Player 1\Kirby B Button Move\Yoshi's Island",8026E9F7 00?? +Cheat37="VS. Mode\Player 1\Kirby B Button Move\Sector Z",8026C6C7 00?? +Cheat38="P1 Press Down On D-Pad To Make Items Appear In Random Spots",D109F6E4 0400,8118D7E2 0001 +Cheat39="Have All Characters",810A5078 0FF0 +Cheat40="VS. Mode\Have Mushroom Kindom",800A5077 00FF +Cheat41="Story Mode\Always Get Pacifist (60,000 Points)",810A52AE 0000 +Cheat42="Bonus Stage Character Modifier (Training Mode)",8018F913 00?? +Cheat43="Jump off to win",810A5282 0000 +Cheat11_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat12_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat13_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat14_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat15_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat16_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat17_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat18_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat19_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat20_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat21_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat22_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat23_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat24_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat25_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat31_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat32_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat33_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat34_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat35_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat36_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat37_O=$02 D.K. Wind-up Punch,$0A Jigglypuff Puff Punch +Cheat42_O=$00 Mario,$01 Fox,$02 DK,$03 Samus,$04 Luigi,$05 Link,$06 Yoshi,$07 C. Falcon,$08 Kirby,$09 Pikachu,$0A Jigglypuff,$0B Ness,$0C Master Hand,$0D Metal Mario,$0E Polygon Mario,$10 Polygon DK,$13 Polygon Link,$14 Polygon Yoshi,$15 Polygon Samus,$18 Polygon Kirby,$1A Giant Donkey Kong +Cheat11_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code could also result freezing at the end of the Level. +Cheat12_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat13_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat14_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat31_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat32_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat33_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat34_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. +Cheat42_N=Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + + +//--------------- PAL (F) Region Cheat Codes + + +[2B38AEC0-6350B810-C:46] +Name=A Bug's Life (F) +Cheat0="Infinite\Lives",801E27C0 0009 +Cheat1="Infinite\Health",801E27B5 0004 +Cheat2="Always Have\Super Jump",811E27B0 0020 +Cheat3="Always Have\50 pieces of corn",801E27C1 0032 +Cheat4="Have F-L-I-K",801E27C2 000F +Cheat5="Unlock All Levels",81099E90 000F +Cheat6="Have All Goldberry Tokens",811E27AE 0000 +Cheat7="Start with Berry Weapon",801E27B7 00?? +Cheat7_O=$01 Blueberry,$02 Homing Berry,$03 Goldberry,$04 Super Berry ? +Cheat8="No Music",801DD966 0000 +Cheat9="Subtitles On",801DDBDB 00?? +Cheat9_O=$00 Off,$01 On +Cheat10="Levitate",D0090001 0010,811E2726 1000,D0090001 0010,811E2736 1000 +Cheat10_N="Press R To Levitate & Let go to land (:" + +//---- + +[0C41F9C2-01717A0D-C:46] +Name=Fighter's Destiny (F) +Cheat0="Start with Stars Modifier\Player 1",D0209837 0000,80209837 00?? +Cheat0_O=$00 No Stars,$06 Max Stars +Cheat1="Start with Stars Modifier\Player 2",D020B6FF 0000,8020B6FF 00?? +Cheat1_O=$00 No Stars,$06 Max Stars +Cheat2="Have 1 Star\Ryuji",8030742E 0001 +Cheat3="Have 1 Star\Bob",8030742F 0001 +Cheat4="Have 1 Star\Pierre",80307430 0001 +Cheat5="Have 1 Star\Meiling",80307431 0001 +Cheat6="Have 1 Star\Leon",80307432 0001 +Cheat7="Have 1 Star\Abdul",80307433 0001 +Cheat8="Have 1 Star\Ninja",80307434 0001 +Cheat9="Have 1 Star\Tomahawk",80307435 0001 +Cheat10="Have 1 Star\Valerie",80307436 0001 +Cheat11="Infinite Health\Player 1",80209981 0000,802048A3 0000 +Cheat12="Infinite Health\Player 2",802048A7 0000,8020B849 0000 +Cheat13="Start on stage 100 on Survival to get Joker",802EF67B 0063 +Cheat14="Stop timer for Fastest to get Robot",810ADBDC 3F80 + +//---- + +[1E12883D-D3B92718-C:46] +Name=Duke Nukem 64 (F) +Cheat0="Access all In-Game cheats",50000504 0000,80100D98 0001 +Cheat1="Infinite\Ammo & All Guns",50000C02 0000,812A5F84 02F4 +Cheat2="Access\All Items",80100D7C 0001 +Cheat3="Invincibility",802AAFE8 0001 +Cheat4="Access\All Keys",802A5FC7 000F +Cheat5="Infinite\Holoduke",812A5FAC 0640 +Cheat6="Infinite\Night Vision",812A5FDC 0664 +Cheat7="Infinite\Scuba Gear",812A600C 0640 +Cheat8="Crosshair",802A6074 00?? +Cheat8_O=$01 On,$00 Off +Cheat9="Max auto-aim On",802A6075 0002 +Cheat10="Upgraded Plasma Gun",802A5FB3 0063 +Cheat1_N=Ena\ble and then simply pause in game play & then unpause and then press left and right. +Cheat2_N=To access simply pause in game play & then unpause. + +//---- + +[B35FEBB0-7427B204-C:46] +Name=Holy Magic Century (F) +Cheat0="Set Agility to 999-999",8107D384 03E7 +Cheat1="Set Defence to 999-999",8107D386 03E7 +Cheat2="Makes your MP 999-999",8107D380 03E7,8107D382 03E7 +Cheat3="Makes your HP 999-999",8107D37C 03E7,8107D37E 03E7 +Cheat4="Have All Elements",8107D39C 3232,8107D39E 3232 +Cheat5="Earn Spirits Faster",8007D3AD 0000 +Cheat6="No Random Battles",8008DE6C 0000,8008DE6E 0000 + +//---- + +[29A045CE-ABA9060E-C:46] +Name==Hydro Thunder (F) +Cheat0="Always 1st",812C56A6 0001 +Cheat1="Infinite\Time",812B52A0 42C8 +Cheat2="Infinite\Boosts\Player 1",812C56AC 4190 +Cheat3="Have All\Ships",50000702 0000,812B66B2 0101 +Cheat4="Have All\Races",50000702 0000,812B66A4 0101 +Cheat5="Infinite\Boosts\Player 2",812C59DC 4190 + +//---- + +[001A3BD0-AFB3DE1A-C:46] +Name=Disney's Tarzan (F) +Cheat0="Infinite\Health",81192320 0120 +Cheat1="Have\Coins Collected 100%",800DD547 0064 +Cheat2="Have\Level & Tokens Completed 100%",800DD51F 0000,800DD520 0001,800DD521 0000 +Cheat3="Access Level Select",810DD50C 8001 +Cheat4="Infinite\Lives",800DD542 00?? +Cheat4_O=$03 3 Lives,$63 99 Lives +Cheat5="Have\All TARZAN Letters",800DD515 00FF +Cheat6="Have\Full Portrait",800DD514 00FF +Cheat7="Infinite\Red Weapon",811921F8 0063 +Cheat8="Infinite\Green Weapon",811921F6 0063 +Cheat9="Infinite\Purple Weapon",811921FA 0063 +Cheat10="Press GS For\Sabor Attacks\Sabor 1 Hit Kill",8924A23E 0001 +Cheat11="Infinite\Bonus Timer",801736DE 0025 +Cheat3_N=On the main menu Scroll down to make CHEATS visible to go into Level Select.For in-Game Cheats,Pause gameplay. +Cheat4_O=$03 3 Lives,$63 99 Lives +Cheat11_N=This is For All Timers on Bonus Levels + +//---- + +[5C1B5FBD-7E961634-C:46] +Name=Hexen (F) +Cheat0="Access In-Game Cheat Menu",81137DB6 07FF,80137E93 0005 +Cheat0_N=To Access Pause Game Play. This gives you access to In-game Cheats like God Mode,Level Select,All Items Etc + +//---- + +[CB93DB97-7F5C63D5-C:46] +Name=Toy Story 2 (F) +Cheat0="Have 99 coins",810BBBDE 0063 +Cheat1="Have all 5 collectables",801C8542 0005 +Cheat2="Infinite Lives",800BBBDA 0009 +Cheat3="Infinite Battery Power",810BBBD6 000E +Cheat4="Hold jump to fly",810BBBCC 0002 + +//---- + +[EA06F8C3-07C2DEED-C:46] +Name=Shadow Man (F) +Cheat0="Have All\Items",D0059047 0001,50001D20 0000,80030613 000B +Cheat0_N=Youll not miss out any part of the game for having all parts of LEclipsers with a new game +Cheat1="Have All\Gads & The Poign",80030E57 000F +Cheat2="Have All\Levels Unlocked",5000101C 0000,80030A0E 0001 +Cheat3="Have All\Cheats: Book of Shadows",81075F4E 0FFF +Cheat4="Have All\Dark Souls Collected",D00590B3 0001,80075F49 007C +Cheat5="Infinite\Shotgun Shells",80075B2F 0063 +Cheat6="Infinite\Violator Ammo",81075B32 029A +Cheat7="Infinite\Cadeaux'",81075B36 029A +Cheat8="Infinite\0.9mm Ammo",81075B3A 0190 +Cheat9="Infinite\Max Health/Air/Shadow Charge & Voodoo Power",50000604 0000,81075B16 2710 +Cheat10="Infinite\Accumulators",800306D7 0005 +Cheat11="Infinite\Retractors",800308B7 0003 +Cheat12="Infinite\Prisms",80030957 0003 +Cheat13="Ammo always displayed on screen",50000408 0000,80075ACD 0007 +Cheat14="Press L To Levitate",D0059097 0020,80075578 0041 +Cheat15="Always Play As Deadwing Character",80075F53 0001 + +//---- + +[BA6C293A-9FAFA338-C:46] +Name=Pokemon Snap (F) +Cheat0="[Enable All Levels]",810C2552 0006 +Cheat0_N=This is needed to be able to Play all Levels of the Game + + +//--------------- PAL (G) Region Cheat Codes + +[DFF227D9-0D4D8169-C:44] +Name=A Bug's Life +Cheat0="Infinite\Lives",801E2760 0009 +Cheat1="Infinite\Health",801E2755 0004 +Cheat2="Always Have\Super Jump",811E2750 0020 +Cheat3="Always Have\50 pieces of corn",801E2761 0032 +Cheat4="Have F-L-I-K",801E2762 000F +Cheat5="Unlock All Levels",81099E30 000F +Cheat6="Have All Goldberry Tokens",811E274E 0000 +Cheat7="Start with Berry Weapon",801E2757 00?? +Cheat7_O=$01 Blueberry,$02 Homing Berry,$03 Goldberry,$04 Super Berry ? +Cheat8="No Music",801DD906 0000 +Cheat9="Subtitles On",801DDB7B 00?? +Cheat9_O=$00 Off,$01 On +Cheat10="Levitate",D008FFA1 0010,811E26C6 1000,D008FFA1 0010,811E26D6 1000 +Cheat10_N="Press R To Levitate & Let go to land (:" + +//---- + +[FE94E570-E4873A9C-C:44] +Name=Fighter's Destiny (G) +Cheat0="Start with Stars Modifier\Player 1",D0209737 0000,80209737 00?? +Cheat0_O=$00 No Stars,$06 Max Stars +Cheat1="Start with Stars Modifier\Player 2",D020B5FF 0000,8020B5FF 00?? +Cheat1_O=$00 No Stars,$06 Max Stars +Cheat2="Have 1 Star\Ryuji",8030732E 0001 +Cheat3="Have 1 Star\Bob",8030732F 0001 +Cheat4="Have 1 Star\Pierre",80307330 0001 +Cheat5="Have 1 Star\Meiling",80307331 0001 +Cheat6="Have 1 Star\Leon",80307332 0001 +Cheat7="Have 1 Star\Abdul",80307333 0001 +Cheat8="Have 1 Star\Ninja",80307334 0001 +Cheat9="Have 1 Star\Tomahawk",80307335 0001 +Cheat10="Have 1 Star\Valerie",80307336 0001 +Cheat11="Infinite Health\Player 1",80209881 0000,802047A3 0000 +Cheat12="Infinite Health\Player 2",802047A7 0000,8020B749 0000 +Cheat13="Start on stage 100 on Survival to get Joker",802EF57B 0063 +Cheat14="Stop timer for Fastest to get Robot",810ADADC 3F80 + +//---- + +[C3CD76FF-9B9DCBDE-C:44] +Name=Forsaken 64 (G) +Cheat0="Infinite\Primery Weapons",8008EE30 0012 +Cheat1="Infinite\Secondary Weapons",8008EE31 0012 +Cheat2="Infinite\Weapon Energy",8008EE32 0012 +Cheat3="Infinite\Lives",8008EE33 0012 +Cheat4="Stealth Mode",8008EE34 0012 +Cheat5="Invulnerability",8008EE35 0012 +Cheat6="Wireframe Mode",8008EE36 0012 +Cheat7="Gore Mode",8008EE37 0012 +Cheat8="Turbo Mode",8008EE38 0012 +Cheat9="Psychedelic Mode",8008EE39 0012 +Cheat10="One Shot Enemies",8008EE3A 0012 +Cheat11="Freeze Enemies",8008EE3B 0012 +Cheat12="Infinite\Titans",8008EE3C 0012 +Cheat12_N=Titans are included in code +Cheat13="Infinite\Solaris",8008EE3D 0012 +Cheat13_N=Solaris are included in code +Cheat14="Level Select",8008EE3E 0012 +Cheat14_N=Accesses all Missions & Battle mode + +//--- + +[75FA0E14-C9B3D105-C:44] +Name=Holy Magic Century (G) +Cheat0="Set Agility to 999-999",8107D644 03E7 +Cheat1="Set Defence to 999-999",8107D646 03E7 +Cheat2="Makes your MP 999-999",8107D640 03E7,8107D642 03E7 +Cheat3="Makes your HP 999-999",8107D63C 03E7,8107D63E 03E7 +Cheat4="Have All Elements",8107D65C 3232,8107D65E 3232 +Cheat5="Earn Spirits Faster",8007D66D 0000 +Cheat6="No Random Battles",8008E12C 0000,8008E12E 0000 + +//---- + +[93EB3F7E-81675E44-C:44] +Name=Mission Impossible (G) +Cheat0="Invincibility",810864C4 0101 +Cheat1="Infinite\Ammo All Guns",50000610 0000,800A9297 00FF +Cheat2="Access All Levels",8008A9D6 0001,8008A9EA 0001,8008AA12 0001,8008AA62 0001,8008AA76 0001,8008AA8A 0001,8008AA9E 0001,8008AAB2 0001,8008AAC6 0011,8008AADA 0021,8008AAEE 0001,8008AB16 0011,8008AB2A 0041,8008AB3E 0021,8008AB52 0081,8008AB66 0001,8008AB7A 0081,8008AB8E 0001,8008ABB6 0001,8008ABDE 0001,8008ABF2 0011,8008AC06 0021,8008AC56 0001,8008AF3A 0001,8008AF4E 0001,8008AF62 0001,8008AF76 0001 +Cheat3="Infinite\Health",810866C2 FFFF +Cheat4="Freeze All Timers",81094150 0063,81094152 0063,81094154 0063 +Cheat5="Weapon Select",800A92B5 00??,800A92C5 00??,800A92D5 00?? +Cheat5_O=$00 9MM Hi Power,$01 Silenced Pistol,$02 Uzi,$03 Fists,$32 Gas Spray,$36 Blow Torch,$1F Fire Extinguisher,$24 Spray Paint,$27 Electrostunner,$0B Blow Dart Gun,$0C Dart Hand Gun,$2D Mini Rocket Launcher +Cheat6="Walk Through Walls & Objects",80094305 00?? +Cheat6_O=$80 On,$00 Off +Cheat6_N=This will allow you to pass through anything & even walk on water.if you amerge somewhere in the ground just press the A button. + +//---- + +[4C261323-4F295E1A-C:44] +Name=Disney's Tarzan (G) +Cheat0="Infinite\Health",81192320 0120 +Cheat1="Have\Coins Collected 100%",800DD547 0064 +Cheat2="Have\Level & Tokens Completed 100%",800DD51F 0000,800DD520 0001,800DD521 0000 +Cheat3="Access Level Select",810DD50C 8001 +Cheat4="Infinite\Lives",800DD542 00?? +Cheat4_O=$03 3 Lives,$63 99 Lives +Cheat5="Have\All TARZAN Letters",800DD515 00FF +Cheat6="Have\Full Portrait",800DD514 00FF +Cheat7="Infinite\Red Weapon",811921F8 0063 +Cheat8="Infinite\Green Weapon",811921F6 0063 +Cheat9="Infinite\Purple Weapon",811921FA 0063 +Cheat10="Press GS For\Sabor Attacks\Sabor 1 Hit Kill",8924A23E 0001 +Cheat11="Infinite\Bonus Timer",801736DE 0025 +Cheat3_N=On the main menu Scroll down to make CHEATS visible to go into Level Select.For in-Game Cheats,Pause gameplay. +Cheat4_O=$03 3 Lives,$63 99 Lives +Cheat11_N=This is For All Timers on Bonus Levels + +//---- + +[9AB3B50A-BC666105-C:44] +Name=Hexen (G) +Cheat0="Access In-Game Cheat Menu",81137CD6 07FF,80137DB3 0005 +Cheat0_N=To Access Pause Game Play. This gives you access to In-game Cheats like God Mode,Level Select,All Items Etc + +//---- + +[84D5FD75-BBFD3CDF-C:44] +Name=Shadowman (G) +Cheat0="Have All\Items",D0059047 0001,50001D20 0000,80030613 000B +Cheat0_N=Youll not miss out any part of the game for having all parts of LEclipsers with a new game +Cheat1="Have All\Gads & The Poign",80030E57 000F +Cheat2="Have All\Levels Unlocked",5000101C 0000,80030A0E 0001 +Cheat3="Have All\Cheats: Book of Shadows",81075EFE 0FFF +Cheat4="Have All\Dark Souls Collected",D0059047 0001,80075EF9 007C +Cheat5="Infinite\Shotgun Shells",80075ADF 0063 +Cheat6="Infinite\Violator Ammo",81075AE2 029A +Cheat7="Infinite\Cadeaux'",81075AE6 029A +Cheat8="Infinite\0.9mm Ammo",81075AEA 0190 +Cheat9="Infinite\Max Health,Air,Shadow Charge & Voodoo Power",50000604 0000,81075AC6 2710 +Cheat10="Infinite\Accumulators",800306D7 0005 +Cheat11="Infinite\Retractors",800308B7 0003 +Cheat12="Infinite\Prisms",80030957 0003 +Cheat13="Ammo always displayed on screen",50000408 0000,80075A7D 0007 +Cheat14="Press L To Levitate",D0058EE4 0020,80075528 0041 + +//---- + +[91B66D42-16AC4E46-C:44] +Name=South Park +Cheat0="Have Cheats Menu",810CF716 01FF +Cheat1="Infinite Energy ",802FD209 0064 +Cheat2="Infinite Credits",802FD215 0064 +Cheat3="Infinite Sponge Darts",802FD223 0064 +Cheat4="Infinite Suckers",802FD222 0064 +Cheat5="Infinite Balls ",802FD21F 0064 +Cheat6="Start with 9999 Monster Score ",812FD20E 270F +Cheat0_N=Go into the Cheats From the main Menu & put on the Ones you want + +//---- + +[782A9075-E552631D-C:44] +Name=Toy Story 2 (G) +Cheat0="Have 99 coins",810BBBDE 0063 +Cheat1="Have all 5 collectables",801C8542 0005 +Cheat2="Infinite Lives",800BBBDA 0009 +Cheat3="Infinite Battery Power",810BBBD6 000E +Cheat4="Hold jump to fly",810BBBCC 0002 + +//---- + +[665FD963-B5CC6612-C:44] +Name=Turok - Dinosaur Hunter (G) +Cheat0="Infinite\Lives",80128E9B 00FF +Cheat1="Infinite\Body Armor",81128D26 5B23,80128D67 0001 +Cheat2="Infinite\Air",80129070 0063,801E862A 0063 +Cheat3="Infinite\Health",812C15C4 1E61,812A2534 1E61 +Cheat4="Have\All Level Keys",50000604 0000,80128D73 0007,80128D8B 001F,80128DAB 00FF +Cheat5="Have\All Weapons",50000B04 0000,80128D47 0001,80128D33 0001 +Cheat6="Infinite\Ammo",50000404 0000,80128CF3 00FF,80128D03 00FF,80128D0F 00FF,50000504 0000,80128D13 00FF,80128E9B 00FF,80128E97 00FF +Cheat7="Diffuculty Modifier",8011956F 00?? +Cheat7_O=$00 Easy,$01 Normal,$02 Hard +Cheat8="Have\Backpack",80128C7B 0001,80128CBB 0001 +Cheat9="Open All Portals",8114F85A F803,81128CDE 0003,81128CE2 0003,81128CE6 0003,81128CEA 0003,81128CEE 0003,81128CF2 0003,81128CF6 0005 +Cheat9_N=Press L to Access Map +Cheat10="Have All\Gems",80128E97 00FF + +//---- + +[5753720D-2A8A884D-C:44] +Name=Pokemon Snap (G) +Cheat0="[Enable All Levels]",810C24D2 0006 +Cheat0_N=This is needed to be able to Play all Levels of the Game + + +//--------------- PAL (I) Region Cheat Codes + + +[F63B89CE-4582D57D-C:49] +Name=A Bug's Life (I) +Cheat0="Infinite\Lives",801E2760 0009 +Cheat1="Infinite\Health",801E2755 0004 +Cheat2="Always Have\Super Jump",811E2750 0020 +Cheat3="Always Have\50 pieces of corn",801E2761 0032 +Cheat4="Have F-L-I-K",801E2762 000F +Cheat5="Unlock All Levels",81099E30 000F +Cheat6="Have All Goldberry Tokens",811E274E 0000 +Cheat7="Start with Berry Weapon",801E2757 00?? +Cheat7_O=$01 Blueberry,$02 Homing Berry,$03 Goldberry,$04 Super Berry ? +Cheat8="No Music",801DD906 0000 +Cheat9="Subtitles On",801DDB7B 00?? +Cheat9_O=$00 Off,$01 On +Cheat10="Levitate",D008FFA1 0010,811E26C6 1000,D008FFA1 0010,811E26D6 1000 +Cheat10_N="Press R To Levitate & Let go to land (:" + +//---- + +[EBA949DC-39BAECBD-C:49] +Name=Mission Impossible (I) +Cheat0="Invincibility",810864C4 0101 +Cheat1="Infinite\Ammo All Guns",50000610 0000,800A9297 00FF +Cheat2="Access All Levels",8008A9D6 0001,8008A9EA 0001,8008AA12 0001,8008AA62 0001,8008AA76 0001,8008AA8A 0001,8008AA9E 0001,8008AAB2 0001,8008AAC6 0011,8008AADA 0021,8008AAEE 0001,8008AB16 0011,8008AB2A 0041,8008AB3E 0021,8008AB52 0081,8008AB66 0001,8008AB7A 0081,8008AB8E 0001,8008ABB6 0001,8008ABDE 0001,8008ABF2 0011,8008AC06 0021,8008AC56 0001,8008AF3A 0001,8008AF4E 0001,8008AF62 0001,8008AF76 0001 +Cheat3="Infinite\Health",810866C2 FFFF +Cheat4="Freeze All Timers",81094150 0063,81094152 0063,81094154 0063 +Cheat5="Weapon Select",800A92B5 00??,800A92C5 00??,800A92D5 00?? +Cheat5_O=$00 9MM Hi Power,$01 Silenced Pistol,$02 Uzi,$03 Fists,$32 Gas Spray,$36 Blow Torch,$1F Fire Extinguisher,$24 Spray Paint,$27 Electrostunner,$0B Blow Dart Gun,$0C Dart Hand Gun,$2D Mini Rocket Launcher +Cheat6="Walk Through Walls & Objects",80094305 00?? +Cheat6_O=$80 On,$00 Off +Cheat6_N=This will allow you to pass through anything & even walk on water.if you amerge somewhere in the ground just press the A button. + +//---- + +[C0C85046-61051B05-C:49] +Name=Pokemon Snap (I) +Cheat0="[Enable All Levels]",810C2712 0006 +Cheat0_N=This is needed to be able to Play all Levels of the Game + + +//--------------- PAL (S) Region Cheat Codes + + +[5F6A04E2-D4FA070D-C:53] +Name=Mission Impossible (S) +Cheat0="Invincibility",810864C4 0101 +Cheat1="Infinite\Ammo All Guns",50000610 0000,800A9297 00FF +Cheat2="Access All Levels",8008A9D6 0001,8008A9EA 0001,8008AA12 0001,8008AA62 0001,8008AA76 0001,8008AA8A 0001,8008AA9E 0001,8008AAB2 0001,8008AAC6 0011,8008AADA 0021,8008AAEE 0001,8008AB16 0011,8008AB2A 0041,8008AB3E 0021,8008AB52 0081,8008AB66 0001,8008AB7A 0081,8008AB8E 0001,8008ABB6 0001,8008ABDE 0001,8008ABF2 0011,8008AC06 0021,8008AC56 0001,8008AF3A 0001,8008AF4E 0001,8008AF62 0001,8008AF76 0001 +Cheat3="Infinite\Health",810866C2 FFFF +Cheat4="Freeze All Timers",81094150 0063,81094152 0063,81094154 0063 +Cheat5="Weapon Select",800A92B5 00??,800A92C5 00??,800A92D5 00?? +Cheat5_O=$00 9MM Hi Power,$01 Silenced Pistol,$02 Uzi,$03 Fists,$32 Gas Spray,$36 Blow Torch,$1F Fire Extinguisher,$24 Spray Paint,$27 Electrostunner,$0B Blow Dart Gun,$0C Dart Hand Gun,$2D Mini Rocket Launcher +Cheat6="Walk Through Walls & Objects",80094305 00?? +Cheat6_O=$80 On,$00 Off +Cheat6_N=This will allow you to pass through anything & even walk on water.if you amerge somewhere in the ground just press the A button. + +//---- + +[817D286A-EF417416-C:53] +Name=Pokemon Snap (S) +Cheat0="[Enable All Levels]",810C2712 0006 +Cheat0_N=This is needed to be able to Play all Levels of the Game + + +//--------------- PAL (FGD) Region Cheat Codes + +[2E0E7749-B8B49D59-C:58] +Name=Turok 2 - Seeds of Evil (FGD) +Cheat0="Access In-Game Cheat Menu",8113568C FFFF,8113568E FFFF + +//--------------- PAL (IS) Region Cheat Codes + +[2E0E7749-B8B49D59-C:58] +Name=Turok 2 - Seeds of Evil (FGD) +Cheat0="Access In-Game Cheat Menu",8113568C FFFF,8113568E FFFF + + +//--------------- Demo Cheat Codes + +[3A089BBC-54AB2C06-C:0] +Name=Berney must die! +Cheat0="Infinite Health",800794CB 0009 + +//---- + +[A3A044B5-6DB1BF5E-C:0] +Name=POM-Spacer By Memir +Cheat1="Collect One Item For Portal",802E4E47 00?? +Cheat1_O=$03 Level 1,$0E Level 2,$0C Level 3,$0D Level 4 +Cheat2="Paly As",802E4E4C 00?? +Cheat2_O=$00 Red Helic,$01 Green Helic,$02 Blue Helic,$03 Yellow Helic,$10 Red Rocket,$11 Green Rocket,$12 Blue Rocket,$13 Yellow Rocket,$20 Red Back Bee,$21 Green Back Bee,$22 Blue Back Bee,$23 Yellow Back Bee,$30 Red Stealth,$31 Green Stealth,$32 Blue Stealth,$33 Yellow Stealth +Cheat3="Freeze Timer",802E4D5F 0000 +Cheat0="Infinite Health\Player 1",802E4E4A 0027 +Cheat4="Infinite Health\Player 2",802E4EA2 0027 +Cheat5="Infinite Health\Player 3",802E4EFA 0027 +Cheat6="Infinite Health\Player 4",802E4F52 0027 + + +//Recent in File---------->Anything under here is still being worked on<-------------------------------- + +[ABA51D09-C668BAD9-C:58] +Name=40 WINKS +Cheat0="Infinite 99 Moons",801D2A81 0063 +Cheat1="Infinite 50 Health ZZZ's",811D2A84 0032 +Cheat2="Infinite 40 Cogs",811D2A82 0028 +Cheat2_N=Disable when on Boss Modes as it can cause hanging! +Cheat3="Infinite 99 Lives",801D2A87 0063 +Cheat3_N=Disable when on Boss Modes as it can cause hanging! +Cheat4="Infinite 99 Tokens",801D2A8D 0063 +Cheat4_N=Disable when on Boss Modes as it can cause hanging! +Cheat5="Infinite Max Air",811D2AA0 07C6,811DA2F6 07C1 +Cheat6="Have All Dreamkeys Collected",50000802 0000,81207D70 FFFF +Cheat7="Setting Options\Langauge Select",801D21AC 00?? +Cheat7_O=$00 English,$01 Spanish,$02 Italian +Cheat8="Setting Options\Difficulty Select",801D534F 00?? +Cheat8_O=$00 Easy,$01 Medium,$02 Hard +Cheat9="Setting Options\SFX Volume Select",801D5350 00?? +Cheat9_O=$00 Off,$05 Normal,$07 Max +Cheat10="Setting Options\Music Volume Select",801D5351 00?? +Cheat10_O=$00 Off,$05 Normal,$07 Max +Cheat11="Setting Options\Rumble Pak Strength Select",801D5353 00?? +Cheat11_O=$00 Off (Normal),$05 Middle,$07 Max +Cheat12="Setting Options\GFX Quality Select",801D5354 00?? +Cheat12_O=$00 Normal,$01 Medium,$02 HighCol +Cheat13="Setting Options\Controller Select",801D5362 00?? +Cheat13_O=$00 Preset 1 (Normal),$01 Preset 2,$02 Preset 3 +Cheat14="Character Select",801D535F 00?? +Cheat14_O=$00 Ruff (Boy) (Default),$01 Tumble (Girl) +Cheat15="Have All 40 Winks Collected",50000602 0000,81207D60 FFFF +Cheat15_N=Combined with Have All Levels Completed cheat will open the door for Have All 40 Winks +Cheat16="Have All Levels Completed",50000202 0000,81207D6C FFFF + + +[04DAF07F-0D18E688-C:45] +Name=DUKE NUKEM ZERO HOUR +Cheat0="Cheat Menu\Cheat Menu Enabled",801CE4E8 0001 +Cheat1="Cheat Menu\Have All Weapons",811CE470 FFFF +Cheat2="Cheat Menu\Have All Game Type & Other",810E16BE FFFF +Cheat3="Cheat Menu\All Weapons Enabled",801CC8B9 0001,801CC925 0001,801CD985 0001,801CDA81 0001,801CDB15 0001,801CDB17 0001,801CDB49 0001,801CE479 0001,801CE481 0001,801CE4ED 0001,801CF635 0001 +Cheat4="Infinite Ammo (All Guns)",810A1E74 A65B +Cheat5="Invincibility",800DEEC3 0001 +Cheat6="Time Always 00:00",801A19C6 0000 +Cheat7="Enable Debug Menu",800DF990 0001 + + +[32CA974B-B2C29C50-C:46] +Name=DUKE NUKEM ZERO HOUR (F) +Cheat0="Cheat Menu\Cheat Menu Enabled",801DA748 0001 +Cheat1="Cheat Menu\Have All Weapons",811DA6D0 FFFF +Cheat2="Cheat Menu\Have All Game Type & Other",810E1B5E 0FFF +Cheat3="Cheat Menu\All Weapons Enabled",801D8B19 0001,801D8B85 0001,801D9BE5 0001,801D9CE1 0001,801D9D75 0001,801D9D77 0001,801D9DA9 0001,801DA6D9 0001,801DA6E1 0001,801DA74D 0001,801DB895 0001 +Cheat4="Infinite Ammo (All Guns)",810A21D4 A65B +Cheat5="Invincibility",800DF223 0001 +Cheat6="Enable Debug Menu",800DFCF0 0001 + +[22E9623F-B60E52AD-C:50] +Name=FLYING DRAGON +Cheat0="Infinite\Health\Player 1",80209D81 00C8 +Cheat1="Infinite\Special\Player 1",81209484 0190 +Cheat2="1 Win to Win\Player 1",D020A84F 0000,8020A84F 0001 +Cheat3="Infinite\Health\Player 2",81209780 0190 +Cheat4="Infinite\Special\Player 2",8120B1B0 0190 +Cheat5="1 Win to Win\Player 2",D020A84F 0000,8020A84F 0010 +Cheat6="Infinite\Money",8121106C 2704 + +[DEE596AB-AF3B7AE7-C:45] +Name=WCW / nWo REVENGE +Cheat0="Infinite Time",800FAF87 0000 +Cheat1="Extra Characters & Modes",8107F07C FFFF +Cheat2="Spirit Select\Player 1",800F9D25 00?? +Cheat2_O=$64 Have Max,$32 Have Normal,$00 Have None +Cheat3="Spirit Select\Player 2",800FA0D5 00?? +Cheat3_O=$64 Have Max,$32 Have Normal,$00 Have None +Cheat4="Spirit Select\Player 3",800FA485 00?? +Cheat4_O=$64 Have Max,$32 Have Normal,$00 Have None +Cheat5="Spirit Select\Player 4",800FA835 00?? +Cheat5_O=$64 Have Max,$32 Have Normal,$00 Have None +Cheat6="Infinite Time Out Of Ring",800FACE8 0014 +Cheat7="Always Special\Player 1",800F9D35 0008 +Cheat8="Always Special\Player 2",800FA0E5 0008 +Cheat9="Always Special\Player 3",800FA495 0008 +Cheat10="Always Special\Player 4",800FA845 0008 +Cheat11="Weapon Select\Player 1",800F9D31 0003,800F98E1 00??,800F98E2 0000,800F99A0 0000 +Cheat11_O=$00 Mallot,$01 Blue Microphone,$02 Black Microphone,$03 Trophy,$04 Black Baseball Bat,$05 Spotted Baseball Bat,$06 Steel Chair,$07 Table Piece,$08 Trash Can,$09 Suitcase,$0A Stop Sign,$FF Nothing +Cheat11_N=With these codes, they do glitch a LOT! It will glitch when you hit certain people with certain weapons a certain way, but it is RANDOM somewhat too +Cheat12="Weapon Select\Player 2",800FA0E1 0003,800F9911 00??,800F9912 0001,800F99A1 0001 +Cheat12_O=$00 Mallot,$01 Blue Microphone,$02 Black Microphone,$03 Trophy,$04 Black Baseball Bat,$05 Spotted Baseball Bat,$06 Steel Chair,$07 Table Piece,$08 Trash Can,$09 Suitcase,$0A Stop Sign,$FF Nothing +Cheat12_N=With these codes, they do glitch a LOT! It will glitch when you hit certain people with certain weapons a certain way, but it is RANDOM somewhat too +Cheat13="Weapon Select\Player 3",800FA491 0003,800F9941 00??,800F9942 0002,800F99A2 0002 +Cheat13_O=$00 Mallot,$01 Blue Microphone,$02 Black Microphone,$03 Trophy,$04 Black Baseball Bat,$05 Spotted Baseball Bat,$06 Steel Chair,$07 Table Piece,$08 Trash Can,$09 Suitcase,$0A Stop Sign,$FF Nothing +Cheat13_N=With these codes, they do glitch a LOT! It will glitch when you hit certain people with certain weapons a certain way, but it is RANDOM somewhat too +Cheat14="Weapon Select\Player 4",800FA841 0003,800F9971 00??,800F9972 0003,800F99A3 0003 +Cheat14_O=$00 Mallot,$01 Blue Microphone,$02 Black Microphone,$03 Trophy,$04 Black Baseball Bat,$05 Spotted Baseball Bat,$06 Steel Chair,$07 Table Piece,$08 Trash Can,$09 Suitcase,$0A Stop Sign,$FF Nothing +Cheat14_N=With these codes, they do glitch a LOT! It will glitch when you hit certain people with certain weapons a certain way, but it is RANDOM somewhat too +Cheat15="Get Title Belt In 1-Match",80038AAB 0008 +Cheat16="Character Select\Player 1",890F9D36 0240,890F9D60 42B4,8107E8B2 ???? +Cheat16_O=$0001 Sting,$0002 Giant,$0003 Lex Luger,$0004 Diamon Dallas Page,$0005 Rick Steiner,$0007 Roddy Piper,$0008 Bret Hart,$0009 Chris Benoit,$000A Goldberg,$000B Booker T,$000C Disco Inferno,$0101 Fit Finley,$0105 Meng,$0106 Barbarian,$0107 Larry Zbysko,$0108 Stevie Ray,$010B British Bulldog,$010D Yugi Nagata,$010E Jim Neidhart,$010F Alex Wright,$0201 Hollywood Hogan,$0202 Macho Man Randy Savage,$0203 Kevin Nash,$0204 Scott Hall,$0205 Buff Bagwell,$0206 Scott Stenier,$0207 Curt Hennig,$0208 Konnan,$0209 Scott Norton,$020C Brian Adams,$020D Eric Bishoff,$0301 Ultimo Dragon,$0302 Eddy Guerrero,$0303 Chris Jericho,$0304 Rey Mysterio Jr.,$0305 Juventud Guerrera,$0306 Dean Malenko,$0307 Chavo Guerrero Jr.,$0308 La Parka,$0309 Psychosis,$0401 Glacier,$0403 Wrath,$0404 Kanyon,$0501 Raven,$0502 Saturn,$0503 Kidman,$0504 Riggs,$0505 Van Hammer,$0506 Sick Boy,$0507 Lodi,$0508 Reese,$0601 AKI Man,$0602 Shogun,$0603 Executioner,$0604 Dr. Frank,$0605 Jekel,$0606 Maya Ineaby,$0701 Hawk Hana,$0702 Kimchee,$0703 Dakeken,$0704 Brickowski,$0705 Mingchee,$0706 Han Zomon,$0801 Eric Bischoff (Manager),$0802 Onoo (Manager),$0803 Jimmy Hart (Manager),$0804 Rick Rude (Manager),$0805 Dusty Rhodes (Manager),$0806 Ted Debisas (Manager),$0807 James Bandenderg (Manager),$0808 Vincent (Manager),$0901 Elizabeth (Manager),$0902 Kimberly (Manager),$0903 Jackreen (Manager),$0904 Sister Sherri (Manager),$0905 Woman (Manager) +Cheat16_N=With this code, you will need to press the GS Button to be in the ring and have full access to getting in and out of the ring. +Cheat17="Character Select\Player 2",890FA0E6 0240,890FA110 42B4,8107E8B6 ???? +Cheat17_O=$0001 Sting,$0002 Giant,$0003 Lex Luger,$0004 Diamon Dallas Page,$0005 Rick Steiner,$0007 Roddy Piper,$0008 Bret Hart,$0009 Chris Benoit,$000A Goldberg,$000B Booker T,$000C Disco Inferno,$0101 Fit Finley,$0105 Meng,$0106 Barbarian,$0107 Larry Zbysko,$0108 Stevie Ray,$010B British Bulldog,$010D Yugi Nagata,$010E Jim Neidhart,$010F Alex Wright,$0201 Hollywood Hogan,$0202 Macho Man Randy Savage,$0203 Kevin Nash,$0204 Scott Hall,$0205 Buff Bagwell,$0206 Scott Stenier,$0207 Curt Hennig,$0208 Konnan,$0209 Scott Norton,$020C Brian Adams,$020D Eric Bishoff,$0301 Ultimo Dragon,$0302 Eddy Guerrero,$0303 Chris Jericho,$0304 Rey Mysterio Jr.,$0305 Juventud Guerrera,$0306 Dean Malenko,$0307 Chavo Guerrero Jr.,$0308 La Parka,$0309 Psychosis,$0401 Glacier,$0403 Wrath,$0404 Kanyon,$0501 Raven,$0502 Saturn,$0503 Kidman,$0504 Riggs,$0505 Van Hammer,$0506 Sick Boy,$0507 Lodi,$0508 Reese,$0601 AKI Man,$0602 Shogun,$0603 Executioner,$0604 Dr. Frank,$0605 Jekel,$0606 Maya Ineaby,$0701 Hawk Hana,$0702 Kimchee,$0703 Dakeken,$0704 Brickowski,$0705 Mingchee,$0706 Han Zomon,$0801 Eric Bischoff (Manager),$0802 Onoo (Manager),$0803 Jimmy Hart (Manager),$0804 Rick Rude (Manager),$0805 Dusty Rhodes (Manager),$0806 Ted Debisas (Manager),$0807 James Bandenderg (Manager),$0808 Vincent (Manager),$0901 Elizabeth (Manager),$0902 Kimberly (Manager),$0903 Jackreen (Manager),$0904 Sister Sherri (Manager),$0905 Woman (Manager) +Cheat17_N=With this code, you will need to press the GS Button to be in the ring and have full access to getting in and out of the ring. +Cheat18="Character Select\Player 3",890FA496 0240,890FA4C0 42B4,8107E8BA ???? +Cheat18_O=$0001 Sting,$0002 Giant,$0003 Lex Luger,$0004 Diamon Dallas Page,$0005 Rick Steiner,$0007 Roddy Piper,$0008 Bret Hart,$0009 Chris Benoit,$000A Goldberg,$000B Booker T,$000C Disco Inferno,$0101 Fit Finley,$0105 Meng,$0106 Barbarian,$0107 Larry Zbysko,$0108 Stevie Ray,$010B British Bulldog,$010D Yugi Nagata,$010E Jim Neidhart,$010F Alex Wright,$0201 Hollywood Hogan,$0202 Macho Man Randy Savage,$0203 Kevin Nash,$0204 Scott Hall,$0205 Buff Bagwell,$0206 Scott Stenier,$0207 Curt Hennig,$0208 Konnan,$0209 Scott Norton,$020C Brian Adams,$020D Eric Bishoff,$0301 Ultimo Dragon,$0302 Eddy Guerrero,$0303 Chris Jericho,$0304 Rey Mysterio Jr.,$0305 Juventud Guerrera,$0306 Dean Malenko,$0307 Chavo Guerrero Jr.,$0308 La Parka,$0309 Psychosis,$0401 Glacier,$0403 Wrath,$0404 Kanyon,$0501 Raven,$0502 Saturn,$0503 Kidman,$0504 Riggs,$0505 Van Hammer,$0506 Sick Boy,$0507 Lodi,$0508 Reese,$0601 AKI Man,$0602 Shogun,$0603 Executioner,$0604 Dr. Frank,$0605 Jekel,$0606 Maya Ineaby,$0701 Hawk Hana,$0702 Kimchee,$0703 Dakeken,$0704 Brickowski,$0705 Mingchee,$0706 Han Zomon,$0801 Eric Bischoff (Manager),$0802 Onoo (Manager),$0803 Jimmy Hart (Manager),$0804 Rick Rude (Manager),$0805 Dusty Rhodes (Manager),$0806 Ted Debisas (Manager),$0807 James Bandenderg (Manager),$0808 Vincent (Manager),$0901 Elizabeth (Manager),$0902 Kimberly (Manager),$0903 Jackreen (Manager),$0904 Sister Sherri (Manager),$0905 Woman (Manager) +Cheat18_N=With this code, you will need to press the GS Button to be in the ring and have full access to getting in and out of the ring. +Cheat19="Character Select\Player 4",890FA846 0240,890FA870 42B4,8107E8BE ???? +Cheat19_O=$0001 Sting,$0002 Giant,$0003 Lex Luger,$0004 Diamon Dallas Page,$0005 Rick Steiner,$0007 Roddy Piper,$0008 Bret Hart,$0009 Chris Benoit,$000A Goldberg,$000B Booker T,$000C Disco Inferno,$0101 Fit Finley,$0105 Meng,$0106 Barbarian,$0107 Larry Zbysko,$0108 Stevie Ray,$010B British Bulldog,$010D Yugi Nagata,$010E Jim Neidhart,$010F Alex Wright,$0201 Hollywood Hogan,$0202 Macho Man Randy Savage,$0203 Kevin Nash,$0204 Scott Hall,$0205 Buff Bagwell,$0206 Scott Stenier,$0207 Curt Hennig,$0208 Konnan,$0209 Scott Norton,$020C Brian Adams,$020D Eric Bishoff,$0301 Ultimo Dragon,$0302 Eddy Guerrero,$0303 Chris Jericho,$0304 Rey Mysterio Jr.,$0305 Juventud Guerrera,$0306 Dean Malenko,$0307 Chavo Guerrero Jr.,$0308 La Parka,$0309 Psychosis,$0401 Glacier,$0403 Wrath,$0404 Kanyon,$0501 Raven,$0502 Saturn,$0503 Kidman,$0504 Riggs,$0505 Van Hammer,$0506 Sick Boy,$0507 Lodi,$0508 Reese,$0601 AKI Man,$0602 Shogun,$0603 Executioner,$0604 Dr. Frank,$0605 Jekel,$0606 Maya Ineaby,$0701 Hawk Hana,$0702 Kimchee,$0703 Dakeken,$0704 Brickowski,$0705 Mingchee,$0706 Han Zomon,$0801 Eric Bischoff (Manager),$0802 Onoo (Manager),$0803 Jimmy Hart (Manager),$0804 Rick Rude (Manager),$0805 Dusty Rhodes (Manager),$0806 Ted Debisas (Manager),$0807 James Bandenderg (Manager),$0808 Vincent (Manager),$0901 Elizabeth (Manager),$0902 Kimberly (Manager),$0903 Jackreen (Manager),$0904 Sister Sherri (Manager),$0905 Woman (Manager) +Cheat19_N=With this code, you will need to press the GS Button to be in the ring and have full access to getting in and out of the ring. +Cheat20="Ultimate Code\Player 1",800F9D24 0064 +Cheat21="Ultimate Code\Player 2",800FA0D4 0064 +Cheat22="Ultimate Code\Player 3",800FA484 0064 +Cheat23="Ultimate Code\Player 4",800FA834 0064 + +[68E8A875-0CE7A486-C:50] +Name=WCW / nWo REVENGE +Cheat0="Infinite Time",800FAF87 0000 +Cheat1="Extra Characters & Modes",8107F07C FFFF +Cheat2="Spirit Select\Player 1",800F9D25 00?? +Cheat2_O=$64 Have Max,$32 Have Normal,$00 Have None +Cheat3="Spirit Select\Player 2",800FA0D5 00?? +Cheat3_O=$64 Have Max,$32 Have Normal,$00 Have None +Cheat4="Spirit Select\Player 3",800FA485 00?? +Cheat4_O=$64 Have Max,$32 Have Normal,$00 Have None +Cheat5="Spirit Select\Player 4",800FA835 00?? +Cheat5_O=$64 Have Max,$32 Have Normal,$00 Have None +Cheat6="Infinite Time Out Of Ring",800FACE8 0014 +Cheat7="Always Special\Player 1",800F9D35 0008 +Cheat8="Always Special\Player 2",800FA0E5 0008 +Cheat9="Always Special\Player 3",800FA495 0008 +Cheat10="Always Special\Player 4",800FA845 0008 +Cheat11="Weapon Select\Player 1",800F9D31 0003,800F98E1 00??,800F98E2 0000,800F99A0 0000 +Cheat11_O=$00 Mallot,$01 Blue Microphone,$02 Black Microphone,$03 Trophy,$04 Black Baseball Bat,$05 Spotted Baseball Bat,$06 Steel Chair,$07 Table Piece,$08 Trash Can,$09 Suitcase,$0A Stop Sign,$FF Nothing +Cheat11_N=With these codes, they do glitch a LOT! It will glitch when you hit certain people with certain weapons a certain way, but it is RANDOM somewhat too +Cheat12="Weapon Select\Player 2",800FA0E1 0003,800F9911 00??,800F9912 0001,800F99A1 0001 +Cheat12_O=$00 Mallot,$01 Blue Microphone,$02 Black Microphone,$03 Trophy,$04 Black Baseball Bat,$05 Spotted Baseball Bat,$06 Steel Chair,$07 Table Piece,$08 Trash Can,$09 Suitcase,$0A Stop Sign,$FF Nothing +Cheat12_N=With these codes, they do glitch a LOT! It will glitch when you hit certain people with certain weapons a certain way, but it is RANDOM somewhat too +Cheat13="Weapon Select\Player 3",800FA491 0003,800F9941 00??,800F9942 0002,800F99A2 0002 +Cheat13_O=$00 Mallot,$01 Blue Microphone,$02 Black Microphone,$03 Trophy,$04 Black Baseball Bat,$05 Spotted Baseball Bat,$06 Steel Chair,$07 Table Piece,$08 Trash Can,$09 Suitcase,$0A Stop Sign,$FF Nothing +Cheat13_N=With these codes, they do glitch a LOT! It will glitch when you hit certain people with certain weapons a certain way, but it is RANDOM somewhat too +Cheat14="Weapon Select\Player 4",800FA841 0003,800F9971 00??,800F9972 0003,800F99A3 0003 +Cheat14_O=$00 Mallot,$01 Blue Microphone,$02 Black Microphone,$03 Trophy,$04 Black Baseball Bat,$05 Spotted Baseball Bat,$06 Steel Chair,$07 Table Piece,$08 Trash Can,$09 Suitcase,$0A Stop Sign,$FF Nothing +Cheat14_N=With these codes, they do glitch a LOT! It will glitch when you hit certain people with certain weapons a certain way, but it is RANDOM somewhat too +Cheat15="Get Title Belt In 1-Match",80038AAB 0008 +Cheat16="Character Select\Player 1",890F9D36 0240,890F9D60 42B4,8107E8B2 ???? +Cheat16_O=$0001 Sting,$0002 Giant,$0003 Lex Luger,$0004 Diamon Dallas Page,$0005 Rick Steiner,$0007 Roddy Piper,$0008 Bret Hart,$0009 Chris Benoit,$000A Goldberg,$000B Booker T,$000C Disco Inferno,$0101 Fit Finley,$0105 Meng,$0106 Barbarian,$0107 Larry Zbysko,$0108 Stevie Ray,$010B British Bulldog,$010D Yugi Nagata,$010E Jim Neidhart,$010F Alex Wright,$0201 Hollywood Hogan,$0202 Macho Man Randy Savage,$0203 Kevin Nash,$0204 Scott Hall,$0205 Buff Bagwell,$0206 Scott Stenier,$0207 Curt Hennig,$0208 Konnan,$0209 Scott Norton,$020C Brian Adams,$020D Eric Bishoff,$0301 Ultimo Dragon,$0302 Eddy Guerrero,$0303 Chris Jericho,$0304 Rey Mysterio Jr.,$0305 Juventud Guerrera,$0306 Dean Malenko,$0307 Chavo Guerrero Jr.,$0308 La Parka,$0309 Psychosis,$0401 Glacier,$0403 Wrath,$0404 Kanyon,$0501 Raven,$0502 Saturn,$0503 Kidman,$0504 Riggs,$0505 Van Hammer,$0506 Sick Boy,$0507 Lodi,$0508 Reese,$0601 AKI Man,$0602 Shogun,$0603 Executioner,$0604 Dr. Frank,$0605 Jekel,$0606 Maya Ineaby,$0701 Hawk Hana,$0702 Kimchee,$0703 Dakeken,$0704 Brickowski,$0705 Mingchee,$0706 Han Zomon,$0801 Eric Bischoff (Manager),$0802 Onoo (Manager),$0803 Jimmy Hart (Manager),$0804 Rick Rude (Manager),$0805 Dusty Rhodes (Manager),$0806 Ted Debisas (Manager),$0807 James Bandenderg (Manager),$0808 Vincent (Manager),$0901 Elizabeth (Manager),$0902 Kimberly (Manager),$0903 Jackreen (Manager),$0904 Sister Sherri (Manager),$0905 Woman (Manager) +Cheat16_N=With this code, you will need to press the GS Button to be in the ring and have full access to getting in and out of the ring. +Cheat17="Character Select\Player 2",890FA0E6 0240,890FA110 42B4,8107E8B6 ???? +Cheat17_O=$0001 Sting,$0002 Giant,$0003 Lex Luger,$0004 Diamon Dallas Page,$0005 Rick Steiner,$0007 Roddy Piper,$0008 Bret Hart,$0009 Chris Benoit,$000A Goldberg,$000B Booker T,$000C Disco Inferno,$0101 Fit Finley,$0105 Meng,$0106 Barbarian,$0107 Larry Zbysko,$0108 Stevie Ray,$010B British Bulldog,$010D Yugi Nagata,$010E Jim Neidhart,$010F Alex Wright,$0201 Hollywood Hogan,$0202 Macho Man Randy Savage,$0203 Kevin Nash,$0204 Scott Hall,$0205 Buff Bagwell,$0206 Scott Stenier,$0207 Curt Hennig,$0208 Konnan,$0209 Scott Norton,$020C Brian Adams,$020D Eric Bishoff,$0301 Ultimo Dragon,$0302 Eddy Guerrero,$0303 Chris Jericho,$0304 Rey Mysterio Jr.,$0305 Juventud Guerrera,$0306 Dean Malenko,$0307 Chavo Guerrero Jr.,$0308 La Parka,$0309 Psychosis,$0401 Glacier,$0403 Wrath,$0404 Kanyon,$0501 Raven,$0502 Saturn,$0503 Kidman,$0504 Riggs,$0505 Van Hammer,$0506 Sick Boy,$0507 Lodi,$0508 Reese,$0601 AKI Man,$0602 Shogun,$0603 Executioner,$0604 Dr. Frank,$0605 Jekel,$0606 Maya Ineaby,$0701 Hawk Hana,$0702 Kimchee,$0703 Dakeken,$0704 Brickowski,$0705 Mingchee,$0706 Han Zomon,$0801 Eric Bischoff (Manager),$0802 Onoo (Manager),$0803 Jimmy Hart (Manager),$0804 Rick Rude (Manager),$0805 Dusty Rhodes (Manager),$0806 Ted Debisas (Manager),$0807 James Bandenderg (Manager),$0808 Vincent (Manager),$0901 Elizabeth (Manager),$0902 Kimberly (Manager),$0903 Jackreen (Manager),$0904 Sister Sherri (Manager),$0905 Woman (Manager) +Cheat17_N=With this code, you will need to press the GS Button to be in the ring and have full access to getting in and out of the ring. +Cheat18="Character Select\Player 3",890FA496 0240,890FA4C0 42B4,8107E8BA ???? +Cheat18_O=$0001 Sting,$0002 Giant,$0003 Lex Luger,$0004 Diamon Dallas Page,$0005 Rick Steiner,$0007 Roddy Piper,$0008 Bret Hart,$0009 Chris Benoit,$000A Goldberg,$000B Booker T,$000C Disco Inferno,$0101 Fit Finley,$0105 Meng,$0106 Barbarian,$0107 Larry Zbysko,$0108 Stevie Ray,$010B British Bulldog,$010D Yugi Nagata,$010E Jim Neidhart,$010F Alex Wright,$0201 Hollywood Hogan,$0202 Macho Man Randy Savage,$0203 Kevin Nash,$0204 Scott Hall,$0205 Buff Bagwell,$0206 Scott Stenier,$0207 Curt Hennig,$0208 Konnan,$0209 Scott Norton,$020C Brian Adams,$020D Eric Bishoff,$0301 Ultimo Dragon,$0302 Eddy Guerrero,$0303 Chris Jericho,$0304 Rey Mysterio Jr.,$0305 Juventud Guerrera,$0306 Dean Malenko,$0307 Chavo Guerrero Jr.,$0308 La Parka,$0309 Psychosis,$0401 Glacier,$0403 Wrath,$0404 Kanyon,$0501 Raven,$0502 Saturn,$0503 Kidman,$0504 Riggs,$0505 Van Hammer,$0506 Sick Boy,$0507 Lodi,$0508 Reese,$0601 AKI Man,$0602 Shogun,$0603 Executioner,$0604 Dr. Frank,$0605 Jekel,$0606 Maya Ineaby,$0701 Hawk Hana,$0702 Kimchee,$0703 Dakeken,$0704 Brickowski,$0705 Mingchee,$0706 Han Zomon,$0801 Eric Bischoff (Manager),$0802 Onoo (Manager),$0803 Jimmy Hart (Manager),$0804 Rick Rude (Manager),$0805 Dusty Rhodes (Manager),$0806 Ted Debisas (Manager),$0807 James Bandenderg (Manager),$0808 Vincent (Manager),$0901 Elizabeth (Manager),$0902 Kimberly (Manager),$0903 Jackreen (Manager),$0904 Sister Sherri (Manager),$0905 Woman (Manager) +Cheat18_N=With this code, you will need to press the GS Button to be in the ring and have full access to getting in and out of the ring. +Cheat19="Character Select\Player 4",890FA846 0240,890FA870 42B4,8107E8BE ???? +Cheat19_O=$0001 Sting,$0002 Giant,$0003 Lex Luger,$0004 Diamon Dallas Page,$0005 Rick Steiner,$0007 Roddy Piper,$0008 Bret Hart,$0009 Chris Benoit,$000A Goldberg,$000B Booker T,$000C Disco Inferno,$0101 Fit Finley,$0105 Meng,$0106 Barbarian,$0107 Larry Zbysko,$0108 Stevie Ray,$010B British Bulldog,$010D Yugi Nagata,$010E Jim Neidhart,$010F Alex Wright,$0201 Hollywood Hogan,$0202 Macho Man Randy Savage,$0203 Kevin Nash,$0204 Scott Hall,$0205 Buff Bagwell,$0206 Scott Stenier,$0207 Curt Hennig,$0208 Konnan,$0209 Scott Norton,$020C Brian Adams,$020D Eric Bishoff,$0301 Ultimo Dragon,$0302 Eddy Guerrero,$0303 Chris Jericho,$0304 Rey Mysterio Jr.,$0305 Juventud Guerrera,$0306 Dean Malenko,$0307 Chavo Guerrero Jr.,$0308 La Parka,$0309 Psychosis,$0401 Glacier,$0403 Wrath,$0404 Kanyon,$0501 Raven,$0502 Saturn,$0503 Kidman,$0504 Riggs,$0505 Van Hammer,$0506 Sick Boy,$0507 Lodi,$0508 Reese,$0601 AKI Man,$0602 Shogun,$0603 Executioner,$0604 Dr. Frank,$0605 Jekel,$0606 Maya Ineaby,$0701 Hawk Hana,$0702 Kimchee,$0703 Dakeken,$0704 Brickowski,$0705 Mingchee,$0706 Han Zomon,$0801 Eric Bischoff (Manager),$0802 Onoo (Manager),$0803 Jimmy Hart (Manager),$0804 Rick Rude (Manager),$0805 Dusty Rhodes (Manager),$0806 Ted Debisas (Manager),$0807 James Bandenderg (Manager),$0808 Vincent (Manager),$0901 Elizabeth (Manager),$0902 Kimberly (Manager),$0903 Jackreen (Manager),$0904 Sister Sherri (Manager),$0905 Woman (Manager) +Cheat19_N=With this code, you will need to press the GS Button to be in the ring and have full access to getting in and out of the ring. +Cheat20="Ultimate Code\Player 1",800F9D24 0064 +Cheat21="Ultimate Code\Player 2",800FA0D4 0064 +Cheat22="Ultimate Code\Player 3",800FA484 0064 +Cheat23="Ultimate Code\Player 4",800FA834 0064 + +[AA7B0658-9C96937B-C:50] +Name=WCW MAYHEM +Cheat0="Character Creation\Max\Strength",80308D35 0009 +Cheat1="Character Creation\Max\Impact",80320375 0009 +Cheat2="Character Creation\Max\Speed",80322CB5 0009 +Cheat3="Character Creation\Max\Quickness",80324C75 0009 +Cheat4="Character Creation\Max\Aerial",80326C35 0009 +Cheat5="Character Creation\Max\Mat Ability",80328BF5 0009 +Cheat6="Character Creation\Max\Submission",8032ABB5 0009 +Cheat7="Character Creation\Max\Brawling",8032CB75 0009 +Cheat8="Character Creation\Max\Dirtiness",8032EB35 0009 +Cheat9="Infinite Stamina\Player 1",810E9798 0478 +Cheat10="Infinite Stamina\Player 2",810E9934 03ED +Cheat11="Meter Select\Player 1",800E979D 00?? +Cheat11_O=$60 Full Meter Bar,$00 Empty Meter Bar +Cheat12="Meter Select\Player 2",800E993D 00?? +Cheat12_O=$60 Full Meter Bar,$00 Empty Meter Bar +Cheat13="Enable Cheat",800B6F5B 00?? +Cheat13_O=$02 Super Created Wrestlers,$04 Stamina Meter,$08 Momentum Meter,$20 Play As Same Wrestler,$80 All Wrestlers +Cheat14="Freeze Timer",800B7E02 D300 + +[F82DD377-8C3FB347-C:58] +Name=TG RALLY 2 +Cheat0="Always 1st",80031F93 0001 +Cheat1="No Damage Or Failures",80031427 0001 +Cheat2="100.000 Sponsor Credits & 950 Championship Points In Support Van",80031433 00F3 +Cheat2_N=You Also Have Access To All Cars, Tracks & Extra Features +Cheat3="No Cones Hit",80031FC3 0000,8003239B 0000 +Cheat3_N=In ARSG Rally School +Cheat4="No Navigator",80031EF7 0000 +Cheat6="Infinite Cash",803A418E 4000 +Cheat7="Freeze Timer",80031F9F 0000 +Cheat5="Max Sponsor Credits",803A6702 0010,803A6704 0001 + +[E0144180-650B78C9-C:45] +Name=Tony Hawk's Pro Skater (U) (V1.1) +Cheat0="Officer Dick\Have All\Tapes",50000901 0000,800DEAC8 00FF +Cheat1="Officer Dick\Have All\Gold Medal\Burnside",800DEACE 00FF +Cheat2="Officer Dick\Have All\Gold Medal\Skate Park",800DEACB 00FF +Cheat3="Officer Dick\Have All\Gold Medal\Roswell",800DEAD0 00FF +Cheat4="Tony Hawk\Have All\Tapes",50000901 0000,800DEA00 00FF +Cheat5="Tony Hawk\Have All\Gold Medal\Burnside Portland",800DEA06 00FF +Cheat6="Tony Hawk\Have All\Gold Medal\Skate Park Chicago",800DEA03 00FF +Cheat7="Tony Hawk\Have All\Gold Medal\Roswell",800DEA08 00FF +Cheat8="Bob Burnquist\Have All\Tapes",50000901 0000,800DEA14 00FF +Cheat9="Bob Burnquist\Have All\Gold Medal\Burnside Portland",800DEA1A 00FF +Cheat10="Bob Burnquist\Have All\Gold Medal\Skate Park Chicago",800DEA17 00FF +Cheat11="Bob Burnquist\Have All\Gold Medal\Roswell",800DEA1C 00FF +Cheat12="Geoff Rowley\Have All\Tapes",50000901 0000,800DEA28 00FF +Cheat13="Geoff Rowley\Have All\Gold Medal\Burnside Portland",800DEA2E 00FF +Cheat14="Geoff Rowley\Have All\Gold Medal\Skate Park Chicago",800DEA2B 00FF +Cheat15="Geoff Rowley\Have All\Gold Medal\Roswell",800DEA30 00FF +Cheat16="Bucky Lasek\Have All\Tapes",50000901 0000,800DEA3C 00FF +Cheat17="Bucky Lasek\Have All\Gold Medal\Burnside Portland",800DEA42 00FF +Cheat18="Bucky Lasek\Have All\Gold Medal\Skate Park Chicago",800DEA3F 00FF +Cheat19="Bucky Lasek\Have All\Gold Medal\Roswell",800DEA44 00FF +Cheat20="Chad Muska\Have All\Tapes",50000901 0000,800DEA50 00FF +Cheat21="Chad Muska\Have All\Gold Medal\Burnside Portland",800DEA56 00FF +Cheat22="Chad Muska\Have All\Gold Medal\Skate Park Chicago",800DEA53 00FF +Cheat23="Chad Muska\Have All\Gold Medal\Roswell",800DEA58 00FF +Cheat24="Kareem Campbell\Have All\Tapes",50000901 0000,800DEA64 00FF +Cheat25="Kareem Campbell\Have All\Gold Medal\Burnside Portland",800DEA6A 00FF +Cheat26="Kareem Campbell\Have All\Gold Medal\Skate Park Chicago",800DEA67 00FF +Cheat27="Kareem Campbell\Have All\Gold Medal\Roswell",800DEA6C 00FF +Cheat28="Andrew Reynolds\Have All\Tapes",50000901 0000,800DEA78 00FF +Cheat29="Andrew Reynolds\Have All\Gold Medal\Burnside Portland",800DEA7E 00FF +Cheat30="Andrew Reynolds\Have All\Gold Medal\Skate Park Chicago",800DEA7B 00FF +Cheat31="Andrew Reynolds\Have All\Gold Medal\Roswell",800DEA80 00FF +Cheat32="Rune Glifberg\Have All\Tapes",50000901 0000,800DEA8C 00FF +Cheat33="Rune Glifberg\Have All\Gold Medal\Burnside Portland",800DEA92 00FF +Cheat34="Rune Glifberg\Have All\Gold Medal\Skate Park Chicago",800DEA8F 00FF +Cheat35="Rune Glifberg\Have All\Gold Medal\Roswell",800DEA94 00FF +Cheat36="Jamie Thomas\Have All\Tapes",50000901 0000,800DEAA0 00FF +Cheat37="Jamie Thomas\Have All\Gold Medal\Burnside Portland",800DEAA6 00FF +Cheat38="Jamie Thomas\Have All\Gold Medal\Skate Park Chicago",800DEAA3 00FF +Cheat39="Jamie Thomas\Have All\Gold Medal\Roswell",800DEAA8 00FF +Cheat40="Elissa Steamer\Have All\Tapes",50000901 0000,800DEAB4 00FF +Cheat41="Elissa Steamer\Have All\Gold Medal\Burnside Portland",800DEABA 00FF +Cheat42="Elissa Steamer\Have All\Gold Medal\Skate Park Chicago",800DEAB7 00FF +Cheat43="Elissa Steamer\Have All\Gold Medal\Roswell",800DEABC 00FF +Cheat44="Player 1\Super Max\Ollie",800D62DC FFFF +Cheat45="Player 1\Super Max\Speed",800D62DD FFFF +Cheat46="Player 1\Super Max\Air",800D62DE FFFF +Cheat47="Player 1\Super Max\Balance",800D62DF FFFF +Cheat48="Player 1\Super Max\Turning",800D62E0 FFFF +Cheat49="Player 2\Super Max\Ollie",800D62E1 FFFF +Cheat50="Player 2\Super Max\Speed",800D62E2 FFFF +Cheat51="Player 2\Super Max\Air",800D62E3 FFFF +Cheat52="Player 2\Super Max\Balance",800D62E4 FFFF +Cheat53="Player 2\Super Max\Turning",800D62E5 FFFF +Cheat54="Player 1\Play As",800D0FD4 00?? +Cheat54_O=$00 Tony Hawk,$01 Bob Burnquist,$02 Geoff Rowley,$03 Bucky Lasek,$04 Chad Muska,$05 Kareem Campbell,$06 Andrew Reynolds,$07 Rune Glifberg,$08 Jamie Thomas,$09 Elissa Steamer,$0A Officer Dick +Cheat55="Player 2\Play As",800D0FD5 00?? +Cheat55_O=$00 Tony Hawk,$01 Bob Burnquist,$02 Geoff Rowley,$03 Bucky Lasek,$04 Chad Muska,$05 Kareem Campbell,$06 Andrew Reynolds,$07 Rune Glifberg,$08 Jamie Thomas,$09 Elissa Steamer,$0A Officer Dick +Cheat56="Player 1\Have Perfect Balance",800DE843 0001 + +//End Of File---------->Anything under here was put in by you<-------------------------------- + + diff --git a/libmupen64plus/mupen64plus-core/data/mupen64plus.ini b/libmupen64plus/mupen64plus-core/data/mupen64plus.ini new file mode 100644 index 0000000000..85b6826945 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/data/mupen64plus.ini @@ -0,0 +1,16034 @@ +; Mupen64Plus Rom Catalog +; Generated by M64P_INICreater.php +; Script coded by: okaygo +; +; Total Rom Count: 3048 +; Fri, 06 Jun 08 23:13:38 -0400 + +[34AB1DEA3111A233A8B5C5679DE22E83] +GoodName=007 - The World is Not Enough (E) (M3) [!] +CRC=3B941695 F90A5EEB +SaveType=Controller Pack +Status=1 +Rumble=Yes +Players=4 + +[9D58996A8AA91263B5CD45C385F45FE4] +GoodName=007 - The World is Not Enough (U) [!] +CRC=033F4C13 319EE7A7 +SaveType=Controller Pack +Status=1 +Rumble=Yes +Players=4 + +[0846FFFDA3081821EA0DCBB7D4DEAAA3] +GoodName=007 - The World is Not Enough (U) [t1] +CRC=5B6AC01B 8D1A562A +RefMD5=9D58996A8AA91263B5CD45C385F45FE4 + +[1D86AE43FF88E4583C8161815577F1CD] +GoodName=007 - The World is Not Enough (U) [t1][f1] (PAL-NTSC) +CRC=5B6AC01B 8D1A562A +RefMD5=9D58996A8AA91263B5CD45C385F45FE4 + +[632C98CF281CDA776E66685B278A4FA6] +GoodName=1080 Snowboarding (E) (M4) [!] +CRC=58FD3F25 D92EAA8D +SaveType=SRAM +Status=2 +Players=2 +Rumble=Yes + +[4E08D29B094C13C030AC73A1DA2F8CD2] +GoodName=1080 Snowboarding (E) (M4) [b1] +CRC=6BB11645 2C6F637E +RefMD5=632C98CF281CDA776E66685B278A4FA6 + +[4FCA132D6C96130371F4186A3DF85077] +GoodName=1080 Snowboarding (E) (M4) [b1][f2] (NTSC) +CRC=58FD3F25 D92EAA8D +RefMD5=632C98CF281CDA776E66685B278A4FA6 + +[EC9DB32624B6C16376429D0660F0710B] +GoodName=1080 Snowboarding (E) (M4) [f1] +CRC=AF61F386 29F1112C +RefMD5=632C98CF281CDA776E66685B278A4FA6 + +[5CA3A45C21E16EDAFBAFE1BD0491DC8D] +GoodName=1080 Snowboarding (E) (M4) [f2] (NTSC) +CRC=93C5ED78 F67E8528 +RefMD5=632C98CF281CDA776E66685B278A4FA6 + +[FA27089C425DBAB99F19245C5C997613] +GoodName=1080 Snowboarding (JU) (M2) [!] +CRC=1FBAF161 2C1C54F1 +SaveType=SRAM +Status=2 +Players=2 +Rumble=Yes + +[E428181D573E25DCC0DC7F9F3BF4D1E1] +GoodName=1080 Snowboarding (JU) (M2) [b1] +CRC=92072A84 275952F8 +RefMD5=FA27089C425DBAB99F19245C5C997613 + +[A3D30FBDFD84B5E7298568BBD5CED7FD] +GoodName=1080 Snowboarding (JU) (M2) [b2] +CRC=1FBAF161 2C1C54F1 +RefMD5=FA27089C425DBAB99F19245C5C997613 + +[FE15A6E7AF4E37487252369D6F0AB35B] +GoodName=1080 Snowboarding (JU) (M2) [b3] +CRC=92072A84 275952F8 +RefMD5=FA27089C425DBAB99F19245C5C997613 + +[7657C4BB92E3F6F126D94F5942FDB445] +GoodName=1080 Snowboarding (JU) (M2) [b4] +CRC=92072A84 275952F8 +RefMD5=FA27089C425DBAB99F19245C5C997613 + +[C7AC7460AF3897BB38D6745BC4557C8E] +GoodName=1080 Snowboarding (JU) (M2) [b5] +CRC=92072A84 275952F8 +RefMD5=FA27089C425DBAB99F19245C5C997613 + +[FE320327CF6EDC64D06BFA56D8E7A085] +GoodName=1080 Snowboarding (JU) (M2) [b6] +CRC=92072A84 275952F8 +RefMD5=FA27089C425DBAB99F19245C5C997613 + +[C36AC032E36C61723698344C33DC1F7E] +GoodName=1080 Snowboarding (JU) (M2) [b7] +CRC=92072A84 275952F8 +RefMD5=FA27089C425DBAB99F19245C5C997613 + +[DAFE880CEF56AF0231EBA2390259A2AC] +GoodName=1080 Snowboarding (JU) (M2) [b8] +CRC=92072A84 275952F8 +RefMD5=FA27089C425DBAB99F19245C5C997613 + +[A0B2E39FD3FE3802C369A6937416B38E] +GoodName=1080 Snowboarding (JU) (M2) [b9] +CRC=1FBAF161 2C1C54F1 +RefMD5=FA27089C425DBAB99F19245C5C997613 + +[2C6A75570997BA7A1244950AC8FE6CBF] +GoodName=1080 Snowboarding (JU) (M2) [ba] +CRC=35F53383 0C8D0AE4 +RefMD5=FA27089C425DBAB99F19245C5C997613 + +[3B5691B895B415056E4EA69695DC26B4] +GoodName=1080 Snowboarding (JU) (M2) [f1] (DS-1) +CRC=92072A84 275952F8 +RefMD5=FA27089C425DBAB99F19245C5C997613 + +[6CEACF73F03BA3DE740BDB00D7CC18A1] +GoodName=1080 Snowboarding (JU) (M2) [f2] (PAL) +CRC=9207357A E85D4001 +RefMD5=FA27089C425DBAB99F19245C5C997613 + +[765DC057507AA32DAAEC194E32FF26B1] +GoodName=1080 Snowboarding (JU) (M2) [f2][b1] +CRC=1FBAF161 2C1C54F1 +RefMD5=FA27089C425DBAB99F19245C5C997613 + +[1ED9C697BD2F2AEBE6B3B8BF0D24A8CA] +GoodName=1080 Snowboarding (JU) (M2) [f3][t1] +CRC=92072A84 275952F8 +RefMD5=FA27089C425DBAB99F19245C5C997613 + +[C70578054AA00D7F95AE1D64E3AA9995] +GoodName=1080 Snowboarding (JU) (M2) [f3][t2] (All Levels) +CRC=92072A84 275952F8 +RefMD5=FA27089C425DBAB99F19245C5C997613 + +[00CE20766866883063AF3A6C3368039F] +GoodName=1080 Snowboarding (JU) (M2) [f4] (PAL-Z64) +CRC=92072A84 275952F8 +RefMD5=FA27089C425DBAB99F19245C5C997613 + +[AEE3FA928B2C1B73D841B47074D91C71] +GoodName=1080 Snowboarding (JU) (M2) [f5] (SRAM) +CRC=92072A84 275952F8 +RefMD5=FA27089C425DBAB99F19245C5C997613 + +[B5AC31D584BB2EF93C2A229E19B6D9A1] +GoodName=1080 Snowboarding (JU) (M2) [h1C] +CRC=35F53383 0C8D0AE4 +RefMD5=FA27089C425DBAB99F19245C5C997613 + +[136245692E02003ED1A972F424CD9323] +GoodName=1080 Snowboarding (JU) (M2) [h2C] +CRC=92072A84 275952F8 +RefMD5=FA27089C425DBAB99F19245C5C997613 + +[EC4458443FBA0F09B8593AC5ED114C26] +GoodName=1964 Demo by Steb (PD) +CRC=5C450380 4B5CB6E6 + +[E76EA30A71F9DC19C6502591FA7CB8E2] +GoodName=2 Blokes & An Armchair - Nintendo 64 Remix Remix by Tesko (PD) [f1] +CRC=04815914 87141455 + +[B05E10857A76AB70A83017ADDE8A8ACC] +GoodName=2 Blokes & An Armchair - Nintendo 64 Remix Remix by Tesko (PD) +CRC=04815914 87141455 + +[8BEC4EDFA1446859DA896E4EBAE8F925] +GoodName=3DS Model Conversion by Snake (PD) +CRC=4C304819 2CBE7573 +Players=0 +Rumble=No +Status=4 +SaveType=None + +[DF6BC38C3D0C722DADD4EEDB5DFCE305] +GoodName=3DS Model Conversion by Snake (PD) [h1C] +CRC=4C304819 2CBE7573 +RefMD5=8BEC4EDFA1446859DA896E4EBAE8F925 + +[0A5ACFEA0C7CF68AE25202040D5AD1EB] +GoodName=40 Winks (U) (M3) [!] +CRC=ABA51D09 C668BAD9 + +[66335F4DC6AB27034398BC26F263B897] +GoodName=64 Hanafuda - Tenshi no Yakusoku (J) [!] +CRC=36F22FBF 318912F2 +Players=1 +Rumble=No +SaveType=Eeprom 4KB +Status=5 + +[2CF9EDB51ADA9DE2AE7AD9FD5ACC5580] +GoodName=64 Oozumou (J) [!] +CRC=9C961069 F5EA488D +Players=4 +SaveType=None +Status=5 +Rumble=No + +[88763C3FD50E036BBB9CF504F77C0741] +GoodName=64 Oozumou (J) [b1] +CRC=9C961069 F5EA488D +RefMD5=2CF9EDB51ADA9DE2AE7AD9FD5ACC5580 + +[9A737609D5A7565589DA44381C476FD3] +GoodName=64 Oozumou (J) [b2] +CRC=9C961069 F5EA488D +RefMD5=2CF9EDB51ADA9DE2AE7AD9FD5ACC5580 + +[CD4F6C55A7567A25954908DF613B236F] +GoodName=64 Oozumou (J) [b3] +CRC=9C961069 F5EA488D +RefMD5=2CF9EDB51ADA9DE2AE7AD9FD5ACC5580 + +[F7C796371E77E0A6FBD02EB866341952] +GoodName=64 Oozumou 2 (J) [!] +CRC=85C18B16 DF9622AF +Players=4 +SaveType=None +Rumble=No +Status=5 + +[6B947F654775CF5DACD1E5D53D577DA7] +GoodName=64 Trump Collection - Alice no Wakuwaku Trump World (J) [!] +CRC=7A6081FC FF8F7A78 +Players=4 +SaveType=Eeprom 4KB +Rumble=No +Status=5 + +[2C6FDCF4A6A6614D09224EFAA55FB531] +GoodName=64 Trump Collection - Alice no Wakuwaku Trump World (J) [h1C] +CRC=7A6081FC FF8F7A78 +RefMD5=6B947F654775CF5DACD1E5D53D577DA7 + +[EA6A92DE5A221A00814F7448BF6F1B31] +GoodName=64 de Hakken!! Tamagotchi Minna de Tamagotchi World (J) [!] +CRC=B98BA456 5B2B76AF +Rumble=Yes +Players=4 +Status=2 +SaveType=Eeprom 4KB + +[11B20CFE8E3ECCC680AA8157A7906D6D] +GoodName=64 de Hakken!! Tamagotchi Minna de Tamagotchi World (J) [b1] +CRC=B98BA456 5B2B76AF +RefMD5=EA6A92DE5A221A00814F7448BF6F1B31 + +[D8F6D887B94BA913EF60A0B03F781AE6] +GoodName=64 de Hakken!! Tamagotchi Minna de Tamagotchi World (J) [h1C] +CRC=B98BA456 5B2B76AF +RefMD5=EA6A92DE5A221A00814F7448BF6F1B31 + +[326BF85C5EF158205364710454EE1AF1] +GoodName=64 de Hakken!! Tamagotchi Minna de Tamagotchi World (J) [h2C] +CRC=B98BA456 5B2B76AF +RefMD5=EA6A92DE5A221A00814F7448BF6F1B31 + +[11B891B7551BFBDB79732BFB94B45603] +GoodName=64 de Hakken!! Tamagotchi Minna de Tamagotchi World (J) [o1] +CRC=B98BA456 5B2B76AF +RefMD5=EA6A92DE5A221A00814F7448BF6F1B31 + +[14E8E1761B8994C54B304418CEA49773] +GoodName=77a Special Edition by Count0 (PD) +CRC=975B7845 A2505C18 +Players=2 +Status=1 +Rumble=No +SaveType=Eeprom 16KB + +[45C610FC443D0DF07ED9F07AC8B7C54A] +GoodName=77a Special Edition by Count0 (PD) [b1] +CRC=975B7845 A2505C18 +RefMD5=14E8E1761B8994C54B304418CEA49773 + +[7D6AC6295EF6A0ABB3D4594AF407B7A6] +GoodName=77a by Count0 (POM '98) (PD) +CRC=D6D29529 D4EADEE4 +Players=2 +Status=1 +Rumble=No +SaveType=None + +[A8426180C65A4C9DD1DF9FD033DDCBB6] +GoodName=77a by Count0 (POM '98) (PD) [b1] +CRC=D6D29529 D4EADEE4 +RefMD5=7D6AC6295EF6A0ABB3D4594AF407B7A6 + +[4A5C509A20DB7A429DC1DD4E219AD4A2] +GoodName=AI Shougi 3 (J) [!] +Players=4 +Status=1 +SaveType=Eeprom 4KB +CRC=8CC182A6 C2D0CAB0 + +[D9FE93EBA610E60F8F5D9880E52DB056] +GoodName=Absolute Crap #2 by Lem (PD) +Status=3 +Players=0 +SaveType=None +Rumble=No +CRC=2E7E893C 4E68B642 + +[9E59882163EA99A45629B9B8B491D86B] +GoodName=Absolute Crap #2 by Lem (PD) [b1] +CRC=2E7E893C 4E68B642 +RefMD5=D9FE93EBA610E60F8F5D9880E52DB056 + +[D5F73BB1FC46328440C3BD9812A49284] +GoodName=Absolute Crap #2 by Lem (PD) [b2] +CRC=2E7E893C 4E68B642 +RefMD5=D9FE93EBA610E60F8F5D9880E52DB056 + +[2F02D478FC89E46FA143B128E29B434C] +GoodName=Absolute Crap Intro #1 by Kid Stardust (PD) [b1] +CRC=B0667DED BB39A4B8 +RefMD5=FF4D4FEFF0AF8A0F9B9AE509DA7D9071 + +[E06A7190B2DF9CCCCA30C1724DDFE95B] +GoodName=Absolute Crap Intro #1 by Kid Stardust (PD) [h1C] +CRC=B0667DED BB39A4B8 +RefMD5=FF4D4FEFF0AF8A0F9B9AE509DA7D9071 + +[FF4D4FEFF0AF8A0F9B9AE509DA7D9071] +GoodName=Absolute Crap Intro #1 by Kid Stardust (PD) +CRC=B0667DED BB39A4B8 +Players=0 +Status=5 +Rumble=No +SaveType=None + +[0D77918E6C989261EEF81FE244E48EEF] +GoodName=Action Replay Pro 64 V3.0 (Unl) [b1] +CRC=158A155D C1538CDB +RefMD5=FD8681CBF1A599FF2EA55DBF40EA7D27 + +[FD8681CBF1A599FF2EA55DBF40EA7D27] +GoodName=Action Replay Pro 64 V3.0 (Unl) [f1] +CRC=8A155D15 53C1DB8C +RefMD5=FD8681CBF1A599FF2EA55DBF40EA7D27 + +[35BA407EA9E4EF7C0ACE8B4F58BEEC41] +GoodName=Action Replay Pro 64 V3.0 (Unl) +CRC=F1297BC9 42CDAE9D +Status=0 + +[67AFA5DF80A5CFC91FCE1DC918EA0A4F] +GoodName=Action Replay Pro 64 V3.3 (Unl) +CRC=A8D1DAF2 31206B53 +Status=0 + +[7558E3DA7225712936D3BA3DCE210C36] +GoodName=AeroFighters Assault (E) (M3) [!] +CRC=62F6BE95 F102D6D6 +Players=4 +SaveType=Eeprom 4KB +Rumble=Yes +Status=3 + +[915E7762364C2449AAEBC4CA5278D1E8] +GoodName=AeroFighters Assault (E) (M3) [f1] (NTSC) +CRC=0BBCDFCF 2DD952CC +RefMD5=7558E3DA7225712936D3BA3DCE210C36 + +[6C25C8D7CE393C0214917A211A199F0C] +GoodName=AeroFighters Assault (E) (M3) [o1] +CRC=62F6BE95 F102D6D6 +RefMD5=7558E3DA7225712936D3BA3DCE210C36 + +[79FB6E2452AF077C5EF1DDE5FC810F04] +GoodName=AeroFighters Assault (U) [!] +CRC=1B598BF1 ECA29B45 +Players=4 +SaveType=Eeprom 4KB +Rumble=Yes +Status=3 + +[CF5FF92EED5FD3C714BC3C4D15C47AE3] +GoodName=AeroFighters Assault (U) [b1] +CRC=1B598BF1 ECA29B45 +RefMD5=79FB6E2452AF077C5EF1DDE5FC810F04 + +[7E3E9BC4188B37A4FC283E22BEDB5D49] +GoodName=AeroFighters Assault (U) [b2] +CRC=1B598BF1 ECA29B45 +RefMD5=79FB6E2452AF077C5EF1DDE5FC810F04 + +[48522CCF3D059DDF2DCF5D6AEE2D1FD7] +GoodName=AeroFighters Assault (U) [b3] +CRC=1B598BF1 ECA29B45 +RefMD5=79FB6E2452AF077C5EF1DDE5FC810F04 + +[24CA46D2C8E2D68978AEAE46C3862F1E] +GoodName=AeroFighters Assault (U) [f1] (PAL) +CRC=5C4EB1C9 12A49603 +RefMD5=79FB6E2452AF077C5EF1DDE5FC810F04 + +[0635FE16018BB216E5CD29C300CADC74] +GoodName=AeroFighters Assault (U) [h1C] +CRC=1B598BF1 ECA29B45 +RefMD5=79FB6E2452AF077C5EF1DDE5FC810F04 + +[6A56589EC8FADD1139EC4B6EED9D19AE] +GoodName=AeroFighters Assault (U) [h2C] +CRC=1B598BF1 ECA29B45 +RefMD5=79FB6E2452AF077C5EF1DDE5FC810F04 + +[63657276E7256DCA562F024FC71F4A47] +GoodName=AeroFighters Assault (U) [h3C] +CRC=1B598BF1 ECA29B45 +RefMD5=79FB6E2452AF077C5EF1DDE5FC810F04 + +[05056045447BF1FBA8F9878A7F6009F3] +GoodName=AeroGauge (E) (M3) [!] +CRC=D83045C8 F29D3A36 +Players=4 +SaveType=Controller Pack +Rumble=No +Status=4 + +[FD979768AC0EC6CBBCA8C5339D62BB05] +GoodName=AeroGauge (E) (M3) [f1] (NTSC) +CRC=440355A4 869CE5F9 +RefMD5=05056045447BF1FBA8F9878A7F6009F3 + +[E0256E4270887B99DA7E91A620FFEFF3] +GoodName=AeroGauge (E) (M3) [h1C] +CRC=D83045C8 F29D3A36 +RefMD5=05056045447BF1FBA8F9878A7F6009F3 + +[25D19487CB80DB724DB9D735F2C28E8B] +GoodName=AeroGauge (E) (M3) [h2C] +CRC=D83045C8 F29D3A36 +RefMD5=05056045447BF1FBA8F9878A7F6009F3 + +[E970AF3DE25BB5AE1154010E26AF776F] +GoodName=AeroGauge (J) (V1.0) (Kiosk Demo) [!] +CRC=B00903C9 3916C146 + +[6A52188E8A7D008F1921AA8A6D40A74C] +GoodName=AeroGauge (J) (V1.0) (Kiosk Demo) [b1] +CRC=3F47EEA0 5DDF7A3C + +[5AB4773BB270BE3A72BB79EF68DEA414] +GoodName=AeroGauge (J) (V1.0) (Kiosk Demo) [b2] +CRC=B00903C9 3916C146 + +[13CCAA36D309B78D20C9C0C89A8CE650] +GoodName=AeroGauge (J) (V1.0) (Kiosk Demo) [b3] +CRC=B00903C9 3916C146 + +[AC5828BA750A4DCDC840050DE66305E2] +GoodName=AeroGauge (J) (V1.0) (Kiosk Demo) [b4] +CRC=3F47EEA0 5DDF7A3C + +[0620C2D134A0430F4AFA208FFEDA67B8] +GoodName=AeroGauge (J) (V1.1) [!] +CRC=80F41131 384645F6 +Players=4 +SaveType=Controller Pack +Rumble=No +Status=4 + +[CC8C56B4E37BC5A501087E7CE8C12CC5] +GoodName=AeroGauge (J) (V1.1) [b1] +CRC=80F41131 384645F6 +RefMD5=0620C2D134A0430F4AFA208FFEDA67B8 + +[426725BFE1A505D4C3B12862188A2526] +GoodName=AeroGauge (J) (V1.1) [b2] +RefMD5=0620C2D134A0430F4AFA208FFEDA67B8 +CRC=80F41131 384645F6 + +[A74429738648C96FAB23944CCB06AA6C] +GoodName=AeroGauge (J) (V1.1) [b3] +RefMD5=0620C2D134A0430F4AFA208FFEDA67B8 +CRC=80F41131 384645F6 + +[E38C4D24254BB3CB6C9EC75CD29A6566] +GoodName=AeroGauge (J) (V1.1) [b4] +RefMD5=0620C2D134A0430F4AFA208FFEDA67B8 +CRC=80F41131 384645F6 + +[E80AD38B3139CBA5A367CB9B0B21AAFA] +GoodName=AeroGauge (J) (V1.1) [b5] +RefMD5=0620C2D134A0430F4AFA208FFEDA67B8 +CRC=80F41131 384645F6 + +[CDCB7101471DD1129DF63D6076834337] +GoodName=AeroGauge (J) (V1.1) [b6] +RefMD5=0620C2D134A0430F4AFA208FFEDA67B8 +CRC=80F41131 384645F6 + +[AB36ED30033F4101D3F660951A568413] +GoodName=AeroGauge (J) (V1.1) [b7] +RefMD5=0620C2D134A0430F4AFA208FFEDA67B8 +CRC=80F41131 384645F6 + +[9D7DAD00EAAC504D459608AB30CB0C1E] +GoodName=AeroGauge (J) (V1.1) [f1] (PAL) +CRC=4795217F 63D42538 + +[72C7FFCEA6C1430616867616F5E9D51A] +GoodName=AeroGauge (U) [!] +CRC=AEBE463E CC71464B +Players=4 +SaveType=Controller Pack +Status=4 + +[B8BA26F0C27253B80E5C7D96B0FB66AB] +GoodName=AeroGauge (U) [T+Ita0.01_Cattivik66] +CRC=AEBE463E CC71464B +RefMD5=72C7FFCEA6C1430616867616F5E9D51A + +[3D6C792ED4FA3CE5C92013F15BCCD327] +GoodName=AeroGauge (U) [b1] +CRC=AEBE463E CC71464B +RefMD5=72C7FFCEA6C1430616867616F5E9D51A + +[B7DB0D2CDCAB307D744B6370F1BBA9C1] +GoodName=AeroGauge (U) [f1] (PAL) +CRC=FDAA963C FDCCD971 + +[11BE82186C64EF407B28403D49B199DB] +GoodName=AeroGauge (U) [h1C] +CRC=AEBE463E CC71464B +RefMD5=72C7FFCEA6C1430616867616F5E9D51A + +[31E739E6420DA88ABF4980AD0C76439A] +GoodName=AeroGauge (U) [h2C] +CRC=AEBE463E CC71464B +RefMD5=72C7FFCEA6C1430616867616F5E9D51A + +[54D0A39123C15F74AABB1ECC24D4D6A0] +GoodName=Aidyn Chronicles - The First Mage (E) [!] +CRC=2DC4FFCC C8FF5A21 +Players=1 +SaveType=Controller Pack +Status=3 + +[AF149336B3DDB899598E7BE8740D7DC6] +GoodName=Aidyn Chronicles - The First Mage (U) [!] +CRC=E6A95A4F BAD2EA23 +Players=1 +SaveType=Controller Pack +Status=3 + +[31448B07CBC932018870F71D1254E317] +GoodName=Aidyn Chronicles - The First Mage (U) [o1] +CRC=E6A95A4F BAD2EA23 +RefMD5=AF149336B3DDB899598E7BE8740D7DC6 + +[E8891F8F498A615A6CBAF75B7DDC9FA6] +GoodName=Airboarder 64 (E) [!] +CRC=27C425D0 8C2D99C1 +Players=4 +SaveType=Controller Pack +Status=4 +Rumble=Yes + +[DCFB92A4B106FE61E54579B1D3B7336E] +GoodName=Airboarder 64 (E) [f1] (NTSC) +CRC=89A498AE DE3CD49A +RefMD5=E8891F8F498A615A6CBAF75B7DDC9FA6 + +[A0EE7484500178BAB44FDE0AF6D5748F] +GoodName=Airboarder 64 (E) [h1C] +CRC=27C425D0 8C2D99C1 +RefMD5=E8891F8F498A615A6CBAF75B7DDC9FA6 + +[CCEE2FCF38DC2200128D75D15DB53283] +GoodName=Airboarder 64 (J) [!] +CRC=6C45B60C DCE50E30 +Players=4 +Status=4 +Rumble=Yes +SaveType=Controller Pack + +[F558165311C9CDCA73FB089E298F2056] +GoodName=Airboarder 64 (J) [b1] +CRC=6C45B60C DCE50E30 +RefMD5=CCEE2FCF38DC2200128D75D15DB53283 + +[62B005D0E9DAE96526443498D6420EC3] +GoodName=Airboarder 64 (J) [b1][t1] +CRC=F255D6F1 B65D6728 +RefMD5=CCEE2FCF38DC2200128D75D15DB53283 + +[C429FE5C86F14764923F08D44884C823] +GoodName=Airboarder 64 (J) [b2] +CRC=F255D6F1 B65D6728 +RefMD5=CCEE2FCF38DC2200128D75D15DB53283 + +[16CB66DD44F7A46EEAC5FFCB38FBE26B] +GoodName=Airboarder 64 (J) [b3] +CRC=6C45B60C DCE50E30 +RefMD5=CCEE2FCF38DC2200128D75D15DB53283 + +[278EF4B79B3544DE327CF7DBCDD60081] +GoodName=Airboarder 64 (J) [f1] (PAL) +CRC=26809B20 39A516A4 +RefMD5=CCEE2FCF38DC2200128D75D15DB53283 + +[C02C32351BD69CB2D3FAC355BE074DC0] +GoodName=Airboarder 64 (J) [h1C] +CRC=6C45B60C DCE50E30 +RefMD5=CCEE2FCF38DC2200128D75D15DB53283 + +[78CABB696CA4847BFAD09B01257C6FDA] +GoodName=Airboarder 64 (J) [h2C] +CRC=6C45B60C DCE50E30 +RefMD5=CCEE2FCF38DC2200128D75D15DB53283 + +[B6894826F5386019B19F0A775D11B042] +GoodName=Airboarder 64 (J) [h3C] +CRC=6C45B60C DCE50E30 +RefMD5=CCEE2FCF38DC2200128D75D15DB53283 + +[F9027DF3909C849CBADDAB1C1468BACC] +GoodName=Airboarder 64 (J) [h4C] +CRC=6C45B60C DCE50E30 +RefMD5=CCEE2FCF38DC2200128D75D15DB53283 + +[41BE85236052A2E8EED144989B0A3E0A] +GoodName=Airboarder 64 (J) [h5C] +CRC=F255D6F1 B65D6728 +RefMD5=CCEE2FCF38DC2200128D75D15DB53283 + +[037B58EE5FB4F3BFF408EE406E3539C0] +GoodName=Airboarder 64 (J) [h6C] +CRC=6C45B60C DCE50E30 +RefMD5=CCEE2FCF38DC2200128D75D15DB53283 + +[63F850D7CC829B287FF1DC61CA3F7CCA] +GoodName=Airboarder 64 (J) [t1] +CRC=F255D6F1 B65D6728 +RefMD5=CCEE2FCF38DC2200128D75D15DB53283 + +[256A1CB23F9E1A2762A7A171417B5D68] +GoodName=Akumajou Dracula Mokushiroku - Real Action Adventure (J) [!] +CRC=B6951A94 63C849AF + +[47EA239717C4D225C9D0E9FD37B9FCB3] +GoodName=Akumajou Dracula Mokushiroku Gaiden - Legend of Cornell (J) [!] +CRC=A5533106 B9F25E5B + +[ECD127A57E25CE8514307BB47ECC1E95] +GoodName=Alienstyle Intro by Renderman (PD) [a1] +CRC=43EFB5BB D8C62E2B +Players=0 +Status=5 +SaveType=None +Rumble=No + +[232A5DC2E98C6CAB1D9F73C1D1C1C73A] +GoodName=Alienstyle Intro by Renderman (PD) +CRC=888EEC7A 42361983 +Players=0 +Status=5 +SaveType=None +Rumble=No + +[E3F4C868917A12BD5E84D94D1C260C7D] +GoodName=All Star Tennis '99 (E) (M5) [!] +CRC=DFD784AD AE426603 +Players=4 +SaveType=Eeprom 4KB +Status=4 + +[4DC614B1022252F41E4E182249FA7BAA] +GoodName=All Star Tennis '99 (E) (M5) [f1] (NTSC) +CRC=3015A8AD 8CEAF5F8 +RefMD5=E3F4C868917A12BD5E84D94D1C260C7D + +[37962CB6D58C2D6B044EAECDCF70EC09] +GoodName=All Star Tennis '99 (E) (M5) [f2] (NTSC) +CRC=6FD0035D 371B785D +RefMD5=E3F4C868917A12BD5E84D94D1C260C7D + +[E034C969BCDC2E8DBE2C8A73BED57B53] +GoodName=All Star Tennis '99 (E) (M5) [f3] (NTSC) +CRC=2E341C3D 5AC8DEA3 +RefMD5=E3F4C868917A12BD5E84D94D1C260C7D + +[7FB6422E5BBF60FEE39651EFF3F79BAB] +GoodName=All Star Tennis '99 (E) (M5) [f4] (NTSC) +CRC=F3700A53 4795C23D +RefMD5=E3F4C868917A12BD5E84D94D1C260C7D + +[AFC3DC9BB737D81903F6CE4875B63AE9] +GoodName=All Star Tennis '99 (U) [!] +CRC=E185E291 4E50766D +Players=4 +SaveType=Eeprom 4KB +Status=4 + +[A90FE01FDAFFB70DD123C0BA04589FAA] +GoodName=All Star Tennis '99 (U) [T+Bra1.0_Guto] +CRC=E185E291 4E50766D +RefMD5=AFC3DC9BB737D81903F6CE4875B63AE9 + +[A2FA12A1DEFCB152DFD04E82968C7D3A] +GoodName=All Star Tennis '99 (U) [f1] (PAL) +CRC=2D56F77B CBE813FC +RefMD5=AFC3DC9BB737D81903F6CE4875B63AE9 + +[D341A40EA9FBE95B6F0F99DFC5901FB7] +GoodName=All Star Tennis '99 (U) [f2] (PAL) +CRC=35D13E0D E8652252 +RefMD5=AFC3DC9BB737D81903F6CE4875B63AE9 + +[953B00882A99D650E1F2817674595F0B] +GoodName=All Star Tennis '99 (U) [h1C] +CRC=E185E291 4E50766D +RefMD5=AFC3DC9BB737D81903F6CE4875B63AE9 + +[ED5F1E12DA36DBEC8A0A24ED98D4AED5] +GoodName=All-Star Baseball '99 (E) [!] +CRC=D9EDD54D 6BB8E274 +Players=4 +SaveType=Controller Pack +Rumble=Yes +Status=3 + +[78551D23F230B58B9F449CDB4A285761] +GoodName=All-Star Baseball '99 (U) [!] +CRC=C43E23A7 40B1681A +Players=4 +SaveType=Controller Pack +Status=3 +Rumble=Yes + +[045E0B801F70ADE69981FCBB2EDE5376] +GoodName=All-Star Baseball '99 (U) [f1] (PAL) +CRC=A6421764 ED1A13E9 +RefMD5=78551D23F230B58B9F449CDB4A285761 + +[13B5AE646CC09876D64366BB07796C78] +GoodName=All-Star Baseball '99 (U) [o1] +CRC=C43E23A7 40B1681A +RefMD5=78551D23F230B58B9F449CDB4A285761 + +[90448C4175EE9D0247674474DCABDFED] +GoodName=All-Star Baseball 2000 (E) [!] +CRC=A19F8089 77884B51 +Players=4 +SaveType=Controller Pack +Rumble=Yes +Status=0 + +[E4076E07DBDA9CEAB5EDCEF4D4648EAB] +GoodName=All-Star Baseball 2000 (E) [f1] (NTSC) +CRC=581900E5 8E662FC8 +RefMD5=90448C4175EE9D0247674474DCABDFED + +[AADA358CE97F06C4DF5BF55987268844] +GoodName=All-Star Baseball 2000 (U) [!] +CRC=5E547A4D 90E60795 +RefMD5=90448C4175EE9D0247674474DCABDFED + +[5D29C01B96A738C3EB68254EF40552F3] +GoodName=All-Star Baseball 2000 (U) [f1] (PAL) +CRC=44127A31 6D341229 +RefMD5=90448C4175EE9D0247674474DCABDFED + +[93B98D93275F803EF4C925BAE5FB711F] +GoodName=All-Star Baseball 2000 (U) [h1C] +CRC=5E547A4D 90E60795 +RefMD5=90448C4175EE9D0247674474DCABDFED + +[07AB7C19DBE85C8CC0961BAAF3B5CA79] +GoodName=All-Star Baseball 2000 (U) [h2C] +CRC=5E547A4D 90E60795 +RefMD5=90448C4175EE9D0247674474DCABDFED + +[6E01B8D425AE74EF5A0F875C700A3B18] +GoodName=All-Star Baseball 2001 (U) [!] +CRC=5446C6EF E18E47BB +RefMD5=90448C4175EE9D0247674474DCABDFED + +[CD04ABC5979F22EF5D6FDC4DCFAA4D50] +GoodName=All-Star Baseball 2001 (U) [f1] (PAL) +CRC=993CC742 EE65D7A4 +RefMD5=90448C4175EE9D0247674474DCABDFED + +[9BC0E3361385713BDF50F0EEBF59FFE0] +GoodName=Alleycat 64 by Dosin (POM '99) (PD) +CRC=306B3375 05F4E698 +Players=1 +Status=3 +Rumble=No +SaveType=None + +[2DCE0F6556C00B44367586FD1EEB40E5] +GoodName=Alleycat 64 by Dosin (POM '99) (PD) [b1] +CRC=306B3375 05F4E698 +RefMD5=9BC0E3361385713BDF50F0EEBF59FFE0 + +[58B27AE9B41B755E4F9C503656B93A97] +GoodName=Analogue Test Utility by WT_Riker (POM '99) (PD) [b1] +CRC=E4C44FDA 98532F4A + +[25099EEB13E4FB47E390087EF6A20CBC] +GoodName=Analogue Test Utility by WT_Riker (POM '99) (PD) +CRC=E4C44FDA 98532F4A +Players=1 +SaveType=None +Status=5 +Rumble=No + +[0C2CBAFEC6F184AD39EF29B2B5E0F44A] +GoodName=Armorines - Project S.W.A.R.M. (E) [!] +CRC=3CC77150 21CDB987 +Players=4 +SaveType=Controller Pack +Rumble=Yes +Status=5 + +[0B5F909546DE5A414F2281AD0C83D9F9] +GoodName=Armorines - Project S.W.A.R.M. (E) [f1] (NTSC) +CRC=CCDEAF02 8AFC4B28 +RefMD5=0C2CBAFEC6F184AD39EF29B2B5E0F44A + +[2BC48B3E6F61896B9BC7BEF5205CC49C] +GoodName=Armorines - Project S.W.A.R.M. (G) [!] +CRC=C0F6DB17 80E0D532 +Players=4 +SaveType=Controller Pack +Rumble=Yes +Status=5 + +[43C23D76E4B6B1CBFCE446DFADFB0396] +GoodName=Armorines - Project S.W.A.R.M. (G) [f1] (NTSC) +CRC=2CEEE754 31B69DBE +RefMD5=2BC48B3E6F61896B9BC7BEF5205CC49C + +[6E6E7A703C131ADADDF4175E9037A2EB] +GoodName=Armorines - Project S.W.A.R.M. (U) [!] +CRC=1FB5D932 3BA9481B +Players=4 +SaveType=Controller Pack +Rumble=Yes +Status=5 + +[4C15C85280DFB003C3BE6506B217B775] +GoodName=Armorines - Project S.W.A.R.M. (U) [f1] (PAL) +CRC=EA090572 192F9673 +RefMD5=6E6E7A703C131ADADDF4175E9037A2EB + +[0FDC4ACAB1B531CBB4DFB142CD630B7A] +GoodName=Armorines - Project S.W.A.R.M. (U) [t1] +CRC=E820670A A99ED0EF +RefMD5=6E6E7A703C131ADADDF4175E9037A2EB + +[755DF7F57EDF87706D4C80FF15883312] +GoodName=Army Men - Air Combat (U) [!] +CRC=4C52BBB2 CEAB0F6B +Players=4 +SaveType=Controller Pack +Rumble=Yes +Status=3 + +[53E2872612760133AB7B2CC2E22B847C] +GoodName=Army Men - Sarge's Heroes (E) (M3) [!] +CRC=B210DF19 98B58D1A +Players=4 +SaveType=Controller Pack + +[B8085C2EDB1C6D23E52ED8C06D92B4F8] +GoodName=Army Men - Sarge's Heroes (U) [!] +CRC=862C0657 8DFD896D +SaveType=Controller Pack +Players=4 +Rumble=Yes +Status=4 + +[906D5A77188A0DC90EBF294EF8A3915E] +GoodName=Army Men - Sarge's Heroes (U) [b1] +CRC=D51CF20D 5534AF93 +RefMD5=B8085C2EDB1C6D23E52ED8C06D92B4F8 + +[F1116FAEBBA932A0159B882AF9946BE6] +GoodName=Army Men - Sarge's Heroes (U) [f1] (PAL) +CRC=94123517 300EEA90 +RefMD5=B8085C2EDB1C6D23E52ED8C06D92B4F8 + +[3D1C87BCF3F8AE8E55FC87A25BE4173C] +GoodName=Army Men - Sarge's Heroes (U) [t1] +CRC=A7507855 0D454C66 +RefMD5=B8085C2EDB1C6D23E52ED8C06D92B4F8 + +[4E39474136C94CE25061FB6C0B473E29] +GoodName=Army Men - Sarge's Heroes (U) [t2] +CRC=5E23985B E3CF7CDA +RefMD5=B8085C2EDB1C6D23E52ED8C06D92B4F8 + +[A952E495077D13C8D9587B7B8BBDE2DB] +GoodName=Army Men - Sarge's Heroes (U) [t3] +CRC=5E23985B E3CF7CDA +RefMD5=B8085C2EDB1C6D23E52ED8C06D92B4F8 + +[6EEA5C4A6256092ED8F9BA8861C689C6] +GoodName=Army Men - Sarge's Heroes 2 (U) [!] +CRC=B20F73B6 2975FC34 +Players=4 +SaveType=Controller Pack +Rumble=Yes +Status=3 + +[F818FB61331122D455692C00EDB2A2FF] +GoodName=Army Men - Sarge's Heroes 2 (U) [t1] +CRC=B24303F4 9F7D2445 +RefMD5=6EEA5C4A6256092ED8F9BA8861C689C6 + +[874C7B7B365D2C20AAA1A0C90C93F9B8] +GoodName=Asteroids Hyper 64 (U) [!] +CRC=D1F7D8AB 293B0446 +Players=4 +SaveType=Controller Pack +Status=3 +Rumble=Yes + +[94751FE93510EBA2D42D82269B224CF8] +GoodName=Asteroids Hyper 64 (U) [o1] +CRC=D1F7D8AB 293B0446 +RefMD5=874C7B7B365D2C20AAA1A0C90C93F9B8 + +[48E6A629101B200A70873589B5D2F524] +GoodName=Asteroids Hyper 64 (U) [o1][f1] (PAL) +CRC=39CE39C1 04271200 +RefMD5=874C7B7B365D2C20AAA1A0C90C93F9B8 + +[00396D6B4E66D323D4AD29833A53DF74] +GoodName=Asteroids Hyper 64 (U) [o1][t1] +CRC=5638C715 5EA6181D +RefMD5=874C7B7B365D2C20AAA1A0C90C93F9B8 + +[CF63AB6AF5FBD5DBFE500DD9A658E069] +GoodName=Attax64 by Pookae (POM '99) (PD) +CRC=26E43C40 E11F283C +Players=4 +Status=3 +Rumble=No +SaveType=None + +[553037C41F9029F544353B8446BE77D9] +GoodName=Attax64 by Pookae (POM '99) (PD) [b1] +CRC=26E43C40 E11F283C +RefMD5=CF63AB6AF5FBD5DBFE500DD9A658E069 + +[7853F02DC66A35BC8C2BC33D03B8F0CA] +GoodName=Automobili Lamborghini (E) [!] +CRC=FC7797BF 4A95E83C +Players=4 +SaveType=Controller Pack +Rumble=Yes +Status=4 + +[DE4631D6419B7361DE9C4A5472964D21] +GoodName=Automobili Lamborghini (E) [o1] +CRC=FC7797BF 4A95E83C +RefMD5=7853F02DC66A35BC8C2BC33D03B8F0CA + +[EC39579F066A9714FF030D07DEC3C9D3] +GoodName=Automobili Lamborghini (U) [!] +CRC=41B25DC4 1B726786 +Players=5 +SaveType=Controller Pack +Rumble=Yes +Status=4 + +[E86A022815D0B7E65FD5557F0B3451D4] +GoodName=Automobili Lamborghini (U) [T+Ita_cattivik66][b3] +CRC=41B25DC4 1B726786 +RefMD5=EC39579F066A9714FF030D07DEC3C9D3 + +[B293E449967B246451564B25A4A36BEC] +GoodName=Automobili Lamborghini (U) [T+Ita_cattivik66][b4] +CRC=41B25DC4 1B726786 +RefMD5=EC39579F066A9714FF030D07DEC3C9D3 + +[1F324E92AF23CDC5499BBC35F3840205] +GoodName=Automobili Lamborghini (U) [b1] +CRC=4DB05DC4 28DBF801 +RefMD5=EC39579F066A9714FF030D07DEC3C9D3 + +[4086114FFB03B156DBCAA0364EB0F81B] +GoodName=Automobili Lamborghini (U) [b2] +CRC=4DB05DC4 28DBF801 +RefMD5=EC39579F066A9714FF030D07DEC3C9D3 + +[D861B752F59774A5597E66E8C58E52D9] +GoodName=Automobili Lamborghini (U) [b3] +CRC=41B25DC4 1B726786 +RefMD5=EC39579F066A9714FF030D07DEC3C9D3 + +[B708601A36054FCA51D849D6D26CEC5C] +GoodName=Automobili Lamborghini (U) [b4] +CRC=DB833E34 63548286 +RefMD5=EC39579F066A9714FF030D07DEC3C9D3 + +[0D0D6A170871ED3433A52D110B01357E] +GoodName=Automobili Lamborghini (U) [b5] +CRC=41B25DC4 1B726786 +RefMD5=EC39579F066A9714FF030D07DEC3C9D3 + +[69431C0E9152A9C5B62131C034250A25] +GoodName=Automobili Lamborghini (U) [b6] +CRC=41B25DC4 1B726786 +RefMD5=EC39579F066A9714FF030D07DEC3C9D3 + +[D441BB80EFD86B8FD65CE855FEC21631] +GoodName=Automobili Lamborghini (U) [f1] +CRC=4DB05DC4 28DBF801 +RefMD5=EC39579F066A9714FF030D07DEC3C9D3 + +[4CEF5CDD83360127B0445E7A9EA0BC8F] +GoodName=Automobili Lamborghini (U) [h1C] +CRC=41B25DC4 1B726786 +RefMD5=EC39579F066A9714FF030D07DEC3C9D3 + +[DAC77D638FF03E77F569119116D4B668] +GoodName=Automobili Lamborghini (U) [h2C] +CRC=41B25DC4 1B726786 +RefMD5=EC39579F066A9714FF030D07DEC3C9D3 + +[17951444830696AAFC07F311AB128099] +GoodName=Automobili Lamborghini (U) [o1] +CRC=41B25DC4 1B726786 +RefMD5=EC39579F066A9714FF030D07DEC3C9D3 + +[8FF8B861A0D095B910DD97EB1ECC02FF] +GoodName=Automobili Lamborghini (U) [o1][T+Ita_cattivik66] +CRC=41B25DC4 1B726786 +RefMD5=EC39579F066A9714FF030D07DEC3C9D3 + +[87D7EEBD0E6B403A2022BBD84BC12868] +GoodName=Automobili Lamborghini (U) [o2] +CRC=41B25DC4 1B726786 +RefMD5=EC39579F066A9714FF030D07DEC3C9D3 + +[805F74AEF610BA2C1F6FCEF723CD1970] +GoodName=Automobili Lamborghini (U) [o3] +CRC=4DB05DC4 28DBF801 +RefMD5=EC39579F066A9714FF030D07DEC3C9D3 + +[EC9B393B3F52B76C02E3BF2AA20145A5] +GoodName=Automobili Lamborghini (U) [o4] +CRC=41B25DC4 1B726786 +RefMD5=EC39579F066A9714FF030D07DEC3C9D3 + +[4E730D045AC33A64BA97D5672589C6C7] +GoodName=Automobili Lamborghini (U) [o5] +CRC=41B25DC4 1B726786 +RefMD5=EC39579F066A9714FF030D07DEC3C9D3 + +[8E2F186FC1B86ABC1CC04FFE1845C6AC] +GoodName=Automobili Lamborghini (U) [o6] +CRC=DB833E34 63548286 +RefMD5=EC39579F066A9714FF030D07DEC3C9D3 + +[835E98C0B8A16401BDC6653E8855F0D6] +GoodName=Automobili Lamborghini (U) [o7] +CRC=41B25DC4 1B726786 +RefMD5=EC39579F066A9714FF030D07DEC3C9D3 + +[0AD7111C5DB3CA075DCD5AC9838C3B24] +GoodName=Automobili Lamborghini (U) [o7][T+Ita_cattivik66] +CRC=41B25DC4 1B726786 +RefMD5=EC39579F066A9714FF030D07DEC3C9D3 + +[A6836524B4E71E5AD14DD8C3651665AD] +GoodName=Automobili Lamborghini (U) [t1] +CRC=DB833E34 63548286 +RefMD5=EC39579F066A9714FF030D07DEC3C9D3 + +[3B4330445D9AAE1EF9C56B1393E281E3] +GoodName=BB SRAM Manager (PD) +CRC=4E5507F2 E7D3B413 + +[8222D1129394AB4F382476D8231EF9F6] +GoodName=BMP View by Count0 (PD) +CRC=273433C0 02B1F61B + +[8183688A4B7D0A390496B5655BCD252E] +GoodName=Baku Bomberman (J) [!] +CRC=E340A49C 74318D41 +SaveType=Eeprom 4KB +Players=4 + +[70415D917D5B7BEEFEDAFDB65CD64D43] +GoodName=Baku Bomberman (J) [b1] +CRC=E340A49C 74318D41 +RefMD5=8183688A4B7D0A390496B5655BCD252E + +[5259F6331389F6AF55B867F60AA373C8] +GoodName=Baku Bomberman (J) [h1C] +CRC=E340A49C 74318D41 +RefMD5=8183688A4B7D0A390496B5655BCD252E + +[70632EE119E54F76A344A7B04340A6F9] +GoodName=Baku Bomberman (J) [t1] +CRC=3A595B0E F8788AA6 +RefMD5=8183688A4B7D0A390496B5655BCD252E + +[CA956015B6820DCFF1C814F3532E18B1] +GoodName=Baku Bomberman 2 (J) [!] +CRC=E73C7C4F AF93B838 +SaveType=Eeprom 4KB +Players=4 + +[8107825AC2A522057422463ED81E276B] +GoodName=Bakuretsu Muteki Bangai-O (J) [!] +CRC=DF98B95D 58840978 +Players=1 + +[A78517540876AE94C2027FE260633CA8] +GoodName=Bakuretsu Muteki Bangai-O (J) [f1] (PAL) +CRC=0866BEDD AE31C2EE +RefMD5=8107825AC2A522057422463ED81E276B + +[040538EA3C225D1E7F2497ACEFDE8CD0] +GoodName=Bakuretsu Muteki Bangai-O (J) [h1C] +CRC=DF98B95D 58840978 +RefMD5=8107825AC2A522057422463ED81E276B + +[09FD63AFA1156405E618752FC583DF93] +GoodName=Bakushou Jinsei 64 - Mezase! Resort Ou (J) [!] +CRC=88CF980A 8ED52EB5 + +[E16CFE9268E472A7814C58783AE7D3A2] +GoodName=Bakushou Jinsei 64 - Mezase! Resort Ou (J) [h1C] +CRC=88CF980A 8ED52EB5 + +[3D3855A86FD5A1B4D30BEB0F5A4A85AF] +GoodName=Banjo to Kazooie no Daibouken (J) [!] +CRC=5168D520 CA5FCD0D +Players=1 +SaveType=Eeprom 4KB + +[7FDAFD3252C0F59FFBA59CD42729D959] +GoodName=Banjo to Kazooie no Daibouken (J) [f1] +CRC=18439105 60424C9E +RefMD5=3D3855A86FD5A1B4D30BEB0F5A4A85AF + +[89BBBB739E54721F77F1A6441C00C093] +GoodName=Banjo to Kazooie no Daibouken (J) [f2] +CRC=18439105 60424C9E +RefMD5=3D3855A86FD5A1B4D30BEB0F5A4A85AF + +[B49EC888940FAB43651E48F760BF7BBD] +GoodName=Banjo to Kazooie no Daibouken (J) [f3] +CRC=18439105 60424C9E +RefMD5=3D3855A86FD5A1B4D30BEB0F5A4A85AF + +[715A8816F30FA24B8D174DC5CB6F25A9] +GoodName=Banjo to Kazooie no Daibouken 2 (J) [!] +CRC=514B6900 B4B19881 +SaveType=Eeprom 16KB +Players=1 + +[06A43BACF5C0687F596DF9B018CA6D7F] +GoodName=Banjo-Kazooie (E) (M3) [!] +CRC=733FCCB1 444892F9 +Players=1 +SaveType=Eeprom 4KB + +[5FC8116DAFDEC73DE9C5CCC2D8E14B4F] +GoodName=Banjo-Kazooie (E) (M3) [f1] +CRC=192C1422 5B8CFF48 +RefMD5=06A43BACF5C0687F596DF9B018CA6D7F + +[F81C314B04CEE9DC92FD4D50811F6FBB] +GoodName=Banjo-Kazooie (E) (M3) [f2] +CRC=192C15DA 74BD6300 +RefMD5=06A43BACF5C0687F596DF9B018CA6D7F + +[B29599651A13F681C9923D69354BF4A3] +GoodName=Banjo-Kazooie (U) (V1.0) [!] +CRC=A4BF9306 BF0CDFD1 +SaveType=Eeprom 4KB +Players=1 + +[8E870036E7A40BA42803C333A412EFE7] +GoodName=Banjo-Kazooie (U) (V1.0) [b1] +CRC=A4BF9306 BF0CDFD1 +RefMD5=B29599651A13F681C9923D69354BF4A3 + +[63609225DA40E2BAEC425F4AEB365330] +GoodName=Banjo-Kazooie (U) (V1.0) [b2] +CRC=A4BF9306 BF0CDFD1 +RefMD5=B29599651A13F681C9923D69354BF4A3 + +[880BB39F8B31C087D66F7193D3528EFE] +GoodName=Banjo-Kazooie (U) (V1.0) [b3] +CRC=A4BF9306 BF0CDFD1 +RefMD5=B29599651A13F681C9923D69354BF4A3 + +[6E3FBAF95C79A3668B6A9211F1372216] +GoodName=Banjo-Kazooie (U) (V1.0) [b4] +CRC=16EDC447 B291F183 +RefMD5=B29599651A13F681C9923D69354BF4A3 + +[508B2D76887E3FE169B60B6CF70E6DBA] +GoodName=Banjo-Kazooie (U) (V1.0) [b5] +CRC=A4BF9306 BF0CDFD1 +RefMD5=B29599651A13F681C9923D69354BF4A3 + +[4782CA6F893AA03F701D6EDA7552711B] +GoodName=Banjo-Kazooie (U) (V1.0) [b6] +CRC=FEF9D364 FBD6D06E +RefMD5=B29599651A13F681C9923D69354BF4A3 + +[B6BC123E51AE5C3190BCA41CFC1D637F] +GoodName=Banjo-Kazooie (U) (V1.0) [b7] +CRC=A4BF9306 BF0CDFD1 +RefMD5=B29599651A13F681C9923D69354BF4A3 + +[F9E8FEF0005E26720EB0D0FDFAB7A859] +GoodName=Banjo-Kazooie (U) (V1.0) [f1] +CRC=16EDC447 B291F183 +RefMD5=B29599651A13F681C9923D69354BF4A3 + +[7173250DC66CA58024C1C4D27B0F8720] +GoodName=Banjo-Kazooie (U) (V1.0) [t1] +CRC=16EDC447 B291F183 +RefMD5=B29599651A13F681C9923D69354BF4A3 + +[B11F476D4BC8E039355241E871DC08CF] +GoodName=Banjo-Kazooie (U) (V1.1) [!] +CRC=CD7559AC B26CF5AE +RefMD5=B29599651A13F681C9923D69354BF4A3 + +[61B5C5C3E5E1A81E5D37072C01B39B76] +GoodName=Banjo-Tooie (A) [!] +CRC=155B7CDF F0DA7325 +SaveType=Eeprom 16KB +Players=1 + +[8B2E56F18421A67BCA861427453A1E19] +GoodName=Banjo-Tooie (E) (M4) [!] +CRC=C9176D39 EA4779D1 +SaveType=Eeprom 16KB +Players=1 + +[40E98FAA24AC3EBE1D25CB5E5DDF49E4] +GoodName=Banjo-Tooie (U) [!] +CRC=C2E9AA9A 475D70AA +SaveType=Eeprom 16KB +Players=1 + +[BF3E84CDD01CAC05987FD8DA5191534B] +GoodName=Bass Hunter 64 (E) [!] +CRC=B088FBB4 441E4B1D +Players=1 +SaveType=Eeprom 4KB + +[2C618F6C69C3B4803F08762A03835139] +GoodName=Bass Rush - ECOGEAR PowerWorm Championship (J) [!] +CRC=D76333AC 0CB6219D +Players=1 + +[B1AB1D5B3B92B0ACA380D0291DA0689E] +GoodName=Bass Rush - ECOGEAR PowerWorm Championship (J) [b1] +CRC=D76333AC 0CB6219D +RefMD5=2C618F6C69C3B4803F08762A03835139 + +[1F997B26062B7D59F23193F448157EE3] +GoodName=Bass Rush - ECOGEAR PowerWorm Championship (J) [b2] +CRC=D76333AC 0CB6219D +RefMD5=2C618F6C69C3B4803F08762A03835139 + +[930C7F6E5863471DDE1816D28A10EB88] +GoodName=Bassmasters 2000 (U) [!] +CRC=BCFACCAA B814D8EF +Players=4 +SaveType=Controller Pack + +[D8903586B5E479E6C4937879650D0D2D] +GoodName=Bassmasters 2000 (U) [b1] +CRC=BCFACCAA B814D8EF +RefMD5=930C7F6E5863471DDE1816D28A10EB88 + +[342476D20D7A7BF4C5484D2DEFCC79E7] +GoodName=Bassmasters 2000 (U) [f1] (PAL) +CRC=DC41E81E AC36CAD1 +RefMD5=930C7F6E5863471DDE1816D28A10EB88 + +[A08676124B326B1035B202C83A97468F] +GoodName=Batman Beyond - Return of the Joker (U) [!] +CRC=204489C1 1286CF2B + +[E4498D8FE11A6E0CC0737D89361DE097] +GoodName=Batman Beyond - Return of the Joker (U) [o1] +CRC=204489C1 1286CF2B +Players=1 +SaveType=None + +[1C7FA31271E5588C968675E932C08991] +GoodName=Batman Beyond - Return of the Joker (U) [o1][t1] +CRC=D8928E46 965CE432 +RefMD5=E4498D8FE11A6E0CC0737D89361DE097 + +[A5EE8A6C34863E3D0EB8C06AE8668B30] +GoodName=Batman of the Future - Return of the Joker (E) (M3) [!] +CRC=259F7F84 7C9EED26 +Players=1 +SaveType=None + +[F5C9B6E4DB938258EA277670B6D37F16] +GoodName=Batman of the Future - Return of the Joker (E) (M3) [b1] +CRC=259F7F84 7C9EED26 +RefMD5=A5EE8A6C34863E3D0EB8C06AE8668B30 + +[8743BDDE07A2E9E0E5A0792D7D8678CB] +GoodName=Batman of the Future - Return of the Joker (E) (M3) [o1] +CRC=259F7F84 7C9EED26 +RefMD5=A5EE8A6C34863E3D0EB8C06AE8668B30 + +[3406A505C22BAC2F40D9BFC6FF08CF86] +GoodName=BattleTanx (U) [!] +CRC=6AA4DDE7 E3E2F4E7 +SaveType=Controller Pack +Players=4 + +[94A7605A28861C43F636AE0FF7F25F2E] +GoodName=BattleTanx (U) [b1] +CRC=6AA4DDE7 E3E2F4E7 +RefMD5=3406A505C22BAC2F40D9BFC6FF08CF86 + +[722D55C70368323D79AB1B63696A45E4] +GoodName=BattleTanx (U) [b1][t1] +CRC=3D615CF5 6984930A +RefMD5=3406A505C22BAC2F40D9BFC6FF08CF86 + +[EDD7187C79CEBDB0D1FABC040502E940] +GoodName=BattleTanx (U) [f1] (PAL) +CRC=9A75C9C2 A4488353 +RefMD5=3406A505C22BAC2F40D9BFC6FF08CF86 + +[220B85771E64C554514163120C2F82F4] +GoodName=BattleTanx (U) [t1] +CRC=3D615CF5 6984930A +RefMD5=3406A505C22BAC2F40D9BFC6FF08CF86 + +[D6E667FE10AFE8F7116888EFDE98AE0E] +GoodName=BattleTanx - Global Assault (E) (M3) [!] +CRC=0CAD17E6 71A5B797 +Players=4 +SaveType=Controller Pack + +[654557C316F901A2CA6F7F4B43343147] +GoodName=BattleTanx - Global Assault (U) [!] +CRC=75A4E247 6008963D +Players=4 +SaveType=Controller Pack + +[DC5AAE1CADF43DF43184D2935C32C26C] +GoodName=BattleTanx - Global Assault (U) [f1] (Country Check) +CRC=8A2E80DC 00F61BE4 +RefMD5=D6E667FE10AFE8F7116888EFDE98AE0E + +[D6D30577E6E8341495B7D8066035C21D] +GoodName=BattleTanx - Global Assault (U) [f2] (PAL) +CRC=90111D7E E4B49428 +RefMD5=D6E667FE10AFE8F7116888EFDE98AE0E + +[266C0989ED0929DF499389954779EA97] +GoodName=Battlezone - Rise of the Black Dogs (U) [!] +CRC=55D4C4CE 7753C78A +Players=4 +SaveType=Controller Pack + +[A94135D163E6091C960ADC918C1FB8A7] +GoodName=Beetle Adventure Racing! (E) (M3) [!] +CRC=A1B64A61 D014940B +Players=4 +SaveType=Controller Pack + +[9D5A1B779F8B43E63E8CE8427675A7EF] +GoodName=Beetle Adventure Racing! (E) (M3) [h1C] +CRC=A1B64A61 D014940B +RefMD5=A94135D163E6091C960ADC918C1FB8A7 + +[6B4398CE56A9C4786F2087F681FFFAF3] +GoodName=Beetle Adventure Racing! (E) (M3) [t1] +CRC=59445C71 1F1FE699 +RefMD5=A94135D163E6091C960ADC918C1FB8A7 + +[5FFD43089B7334072B2B74421618D973] +GoodName=Beetle Adventure Racing! (J) [!] +CRC=9C7318D2 24AE0DC1 +Players=4 +SaveType=Controller Pack + +[E126B84FA242916289D04D68C0E20BFE] +GoodName=Beetle Adventure Racing! (J) [b1] +CRC=9C7318D2 24AE0DC1 +RefMD5=5FFD43089B7334072B2B74421618D973 + +[CF97C336479DDBF1217E4DDE89D9D2D3] +GoodName=Beetle Adventure Racing! (U) (M3) [!] +CRC=EDF419A8 BF1904CC +SaveType=Controller Pack +Players=4 + +[D11BC38F26EA2835FBF017FE9BD404FE] +GoodName=Beetle Adventure Racing! (U) (M3) [b1] +CRC=EDF419A8 BF1904CC +RefMD5=CF97C336479DDBF1217E4DDE89D9D2D3 + +[40CBC5A23B7D8C1FDD47D78CACA29248] +GoodName=Beetle Adventure Racing! (U) (M3) [b2] +CRC=EDF419A8 BF1904CC +RefMD5=CF97C336479DDBF1217E4DDE89D9D2D3 + +[CC9F8A2181C6C9C5ED49B77FF632395A] +GoodName=Beetle Adventure Racing! (U) (M3) [f1] (PAL) +CRC=1E17A377 9D8C5E86 +RefMD5=CF97C336479DDBF1217E4DDE89D9D2D3 + +[EFFB7B42C6D7C29540C93006E6142F99] +GoodName=Beetle Adventure Racing! (U) (M3) [t1] +CRC=559A0FD3 897F777C +RefMD5=CF97C336479DDBF1217E4DDE89D9D2D3 + +[C246BD299AA756459193F406A261D1D1] +GoodName=Beetle Adventure Racing! (U) (M3) [t2] +CRC=522409D3 9340EBFF +RefMD5=CF97C336479DDBF1217E4DDE89D9D2D3 + +[AD7C7B994994CF56481E4450E958049F] +GoodName=Berney Must Die! by Nop_ (POM '99) (PD) +CRC=3A089BBC 54AB2C06 +Status=0 +SaveType=Controller Pack + +[108A605E3D57A5E5C52398B675861EF4] +GoodName=Berney Must Die! by Nop_ (POM '99) (PD) [t1] +CRC=861F9BDC C3353C85 +RefMD5=AD7C7B994994CF56481E4450E958049F + +[BF6780E2982C16D4A4FDB553BE8F9226] +GoodName=Big Mountain 2000 (U) [!] +CRC=08FFA4B7 01F453B6 +SaveType=Eeprom 4KB +Players=4 +Rumble=Yes + +[CFE3E75B8B4C75F231CBBD9C99804EC3] +GoodName=Big Mountain 2000 (U) [t1] +CRC=B0119B37 B9774FD5 +RefMD5=BF6780E2982C16D4A4FDB553BE8F9226 + +[0059B65E1C813BC8BD1A61A1FE009CCD] +GoodName=Bike Race '98 V1.0 by NAN (PD) +CRC=713FDDD3 72D6A0EF +Players=1 +Status=2 +SaveType=None +Rumble=No + +[A1025E61229D5D855D232210B39F5E66] +GoodName=Bike Race '98 V1.0 by NAN (PD) [b1] +CRC=713FDDD3 72D6A0EF +RefMD5=0059B65E1C813BC8BD1A61A1FE009CCD + +[1CCD7DB5B3F57944CAF7DA86EF1763E3] +GoodName=Bike Race '98 V1.2 by NAN (PD) +CRC=F4B64159 46FC16CF +Players=1 +Status=2 +SaveType=None +Rumble=No + +[58B2716389BA3C5575B5A287E59F49AF] +GoodName=Bike Race '98 V1.2 by NAN (PD) [b1] +CRC=F4B64159 46FC16CF +RefMD5=1CCD7DB5B3F57944CAF7DA86EF1763E3 + +[133B6615CD0936AC705DFC81E4389CBB] +GoodName=Bike Race '98 V1.2 by NAN (PD) [b2] +CRC=F4B64159 46FC16CF +RefMD5=1CCD7DB5B3F57944CAF7DA86EF1763E3 + +[42672BA5E98CD21D7F3E3745E69038DD] +GoodName=Bio F.R.E.A.K.S. (E) [!] +CRC=AB7C101D EC58C8B0 + +[0F412C4CDE69AE41B89D390731D34F71] +GoodName=Bio F.R.E.A.K.S. (E) [b1] +CRC=AB7C101D EC58C8B0 +Players=4 +SaveType=Controller Pack + +[B90AB8F7605D971CC7A6D9BA5E67D1AF] +GoodName=Bio F.R.E.A.K.S. (U) [!] +CRC=08123595 0510F1DE +Players=4 +SaveType=Controller Pack + +[801ECC49DAF04FBA099C6F75A06F0454] +GoodName=Bio F.R.E.A.K.S. (U) [b1] +CRC=08123595 0510F1DE +RefMD5=B90AB8F7605D971CC7A6D9BA5E67D1AF + +[F64B263F67ACA5DE1957299FD92FB35A] +GoodName=Bio F.R.E.A.K.S. (U) [b2] +CRC=08123595 0510F1DE +RefMD5=B90AB8F7605D971CC7A6D9BA5E67D1AF + +[3F2802F12058B4511A0778A891050297] +GoodName=Bio F.R.E.A.K.S. (U) [b3] +CRC=B6223A7B 2139CEA6 +RefMD5=B90AB8F7605D971CC7A6D9BA5E67D1AF + +[E02AEF75AC059FC2446BFFDD06EE64A9] +GoodName=Bio F.R.E.A.K.S. (U) [h1C] +CRC=08123595 0510F1DE +RefMD5=B90AB8F7605D971CC7A6D9BA5E67D1AF + +[879A085B07B7E6D52DFE2CE636D7A239] +GoodName=Bio F.R.E.A.K.S. (U) [t1] +CRC=B6223A7B 2139CEA6 +RefMD5=B90AB8F7605D971CC7A6D9BA5E67D1AF + +[F77D70959222276491222F31EBFF3BF1] +GoodName=Biohazard 2 (J) [!] +CRC=7EAE2488 9D40A35A +SaveType=SRAM +Players=1 + +[13D7834291A311077B84B9A2816AF6FC] +GoodName=Birthday Demo for Steve by Nep (PD) [b1] +CRC=C2B35C2F 5CD995A2 + +[4443B11C457348B0B6B64650909F0143] +GoodName=Birthday Demo for Steve by Nep (PD) +CRC=C2B35C2F 5CD995A2 + +[889D4D337AD11CE94357511C725EAB6A] +GoodName=Blast Corps (E) (M2) [!] +CRC=7C64E6DB 55B924DB +Players=1 +SaveType=Eeprom 4KB + +[7C9C000B61BF0BCF81AFD4E583EC9B2A] +GoodName=Blast Corps (E) (M2) [b1] +CRC=7C64E6DB 55B924DB +RefMD5=889D4D337AD11CE94357511C725EAB6A + +[36C97C12DDABB02D7D2D3F6B33B3D83F] +GoodName=Blast Corps (E) (M2) [b2] +CRC=7C64E6DB 55B924DB +RefMD5=889D4D337AD11CE94357511C725EAB6A + +[A8DFDFF49144627492DA9B0B65B91845] +GoodName=Blast Corps (U) (V1.0) [!] +CRC=7C647C25 D9D901E6 +Players=1 +SaveType=Eeprom 4KB + +[000E40366ECE225565D3EC83BE7D97A4] +GoodName=Blast Corps (U) (V1.0) [b1] +CRC=7C647C25 D9D901E6 +RefMD5=A8DFDFF49144627492DA9B0B65B91845 + +[4BFB72FC9A787543323ADEFC8EC2A042] +GoodName=Blast Corps (U) (V1.0) [b2] +CRC=7C647C25 D9D901E6 +RefMD5=A8DFDFF49144627492DA9B0B65B91845 + +[5875FC73069077C93E214233B60F0BDC] +GoodName=Blast Corps (U) (V1.1) [!] +CRC=7C647E65 1948D305 +Players=1 +SaveType=Eeprom 4KB + +[16B82D53D7F038A8FE67A78027720516] +GoodName=Blast Dozer (J) [!] +CRC=65234451 EBD3346F +Players=1 +SaveType=Eeprom 4KB + +[FA3A5597012B710C844682DA586A62C9] +GoodName=Blast Dozer (J) [b1] +CRC=65234451 EBD3346F +RefMD5=16B82D53D7F038A8FE67A78027720516 + +[31B4A8ED52B48E756B344C9F22736E50] +GoodName=Blues Brothers 2000 (E) (M6) [!] +CRC=D571C883 822D3FCF +Players=2 +SaveType=Controller Pack + +[997FD8F79CD6F3CD1C1C1FD21E358717] +GoodName=Blues Brothers 2000 (U) [!] +CRC=7CD08B12 1153FF89 +Players=2 +SaveType=Controller Pack + +[96D5910A6FFD3EE53638251ACE86E0CB] +GoodName=Blues Brothers 2000 (U) [f1] (PAL-NTSC) +CRC=A9A17EF3 AB1F8703 +RefMD5=997FD8F79CD6F3CD1C1C1FD21E358717 + +[A6E03FA194A2932D36E0A67F9F64D92E] +GoodName=Blues Brothers 2000 (U) [t1] +CRC=A0976BE9 FF41562B +RefMD5=997FD8F79CD6F3CD1C1C1FD21E358717 + +[A8D31D9715BB5645EFC3245A6497F542] +GoodName=Blues Brothers 2000 (U) [t1][f1] (PAL-NTSC) +CRC=ABB57137 960F561D +RefMD5=997FD8F79CD6F3CD1C1C1FD21E358717 + +[B27FA5E9AD0CB47BB3A74FFAC7BC8EDF] +GoodName=Body Harvest (E) (M3) [!] +CRC=0B58B8CD B7B291D2 +SaveType=Eeprom 4KB +Players=1 + +[0EF2448C243F86C4C9F194F49CFD8352] +GoodName=Body Harvest (E) (M3) [f1] (NTSC) +CRC=6F66B92D 80B9E520 +RefMD5=B27FA5E9AD0CB47BB3A74FFAC7BC8EDF + +[3B8585ED03E8DDB89D7DE456317545E7] +GoodName=Body Harvest (U) [!] +CRC=5326696F FE9A99C3 +Players=1 +SaveType=Eeprom 4KB + +[77554810629D4EF4D93519745FA6066B] +GoodName=Body Harvest (U) [b1] +CRC=5326696F FE9A99C3 +RefMD5=3B8585ED03E8DDB89D7DE456317545E7 + +[D266B288829193BD8205DDDCDFA5CF30] +GoodName=Body Harvest (U) [b1][t1] +CRC=C535091F D60CCF6C +RefMD5=3B8585ED03E8DDB89D7DE456317545E7 + +[13532519CBC43BFA638FD5A7754EE281] +GoodName=Body Harvest (U) [b2] +CRC=00A46EE3 554158C6 +RefMD5=3B8585ED03E8DDB89D7DE456317545E7 + +[D8BD69AEE8246A3127A58E202D447BA1] +GoodName=Body Harvest (U) [t1] +CRC=C535091F D60CCF6C +RefMD5=3B8585ED03E8DDB89D7DE456317545E7 + +[1CF31E7F6E0DEB2C18C39DDD4EED9E51] +GoodName=Bokujou Monogatari 2 (J) [!] +CRC=B3D451C6 E1CB58E2 + +[C902BB7203C6C77DDA16ABCDF8995E32] +GoodName=Bokujou Monogatari 2 (J) [b1] +CRC=B3D451C6 E1CB58E2 + +[B68F49AA8F6F7499184AC6B7B8570F2B] +GoodName=Bomberman 64 (E) [!] +CRC=5A160336 BC7B37B0 +Players=4 +SaveType=Eeprom 4KB + +[B9E6A38B28108E4D6E6A0A47BF981747] +GoodName=Bomberman 64 (E) [b1] +CRC=5A160336 BC7B37B0 +RefMD5=B68F49AA8F6F7499184AC6B7B8570F2B + +[4D5C42B239DFD67E40D4E9476A208A1E] +GoodName=Bomberman 64 (E) [b2] +CRC=5A160336 BC7B37B0 +RefMD5=B68F49AA8F6F7499184AC6B7B8570F2B + +[0283CC125AEA29EF72A03BEE7D759C5D] +GoodName=Bomberman 64 (E) [h1C] +CRC=5A160336 BC7B37B0 +RefMD5=B68F49AA8F6F7499184AC6B7B8570F2B + +[9976833301116D0CB9E278E857921BF6] +GoodName=Bomberman 64 (E) [t1] +CRC=938CA401 43339F1B +RefMD5=B68F49AA8F6F7499184AC6B7B8570F2B + +[093058ECE14C8CC1A887B2087EB5CFE9] +GoodName=Bomberman 64 (U) [!] +CRC=F568D51E 7E49BA1E +Players=4 +SaveType=Eeprom 4KB + +[BB4C5769EED69362F1A90A2BE19998D6] +GoodName=Bomberman 64 (U) [b1] +CRC=F568D51E 7E49BA1E +RefMD5=093058ECE14C8CC1A887B2087EB5CFE9 + +[FA4347AC05BC0C0BBC8CABE3ED90B8A4] +GoodName=Bomberman 64 (U) [o1] +CRC=F568D51E 7E49BA1E +RefMD5=093058ECE14C8CC1A887B2087EB5CFE9 + +[567B8914E0642721408D46627E36003B] +GoodName=Bomberman 64 - Arcade Edition (J) [f1] (PAL) +CRC=DF6FF0F4 29D14238 + +[852E8651D6C610CE593C35CEA678C9F1] +GoodName=Bomberman 64 - Arcade Edition (J) [f2] (PAL-CRC) +CRC=E87F1ACE 809F204B + +[08E491F87445C6E5C168D982FC665D5F] +GoodName=Bomberman 64 - Arcade Edition (J) +CRC=DF6FF0F4 29D14238 + +[AEC1FDB0F1CAAD86C9F457989A4CE482] +GoodName=Bomberman 64 - The Second Attack! (U) [!] +CRC=237E73B4 D63B6B37 +Players=4 +SaveType=Eeprom 4KB + +[9058970DDF26431A4DAF353C2EEA86AB] +GoodName=Bomberman 64 - The Second Attack! (U) [t1][f1] (PAL-NTSC) +CRC=9BA3E5CC EB222304 +RefMD5=AEC1FDB0F1CAAD86C9F457989A4CE482 + +[F79EF0813157880FFBAD6199E07579BE] +GoodName=Bomberman Hero (E) [!] +CRC=D85C4E29 88E276AF +Players=4 +SaveType=Eeprom 4KB + +[EA6D0EBD673A66C395569A2A230AEA6F] +GoodName=Bomberman Hero (E) [b1] +CRC=D85C4E29 88E276AF +RefMD5=F79EF0813157880FFBAD6199E07579BE + +[141430D034C16FC4B4BA20D53EAB61C1] +GoodName=Bomberman Hero (E) [b2] +CRC=D85C4E29 88E276AF +RefMD5=F79EF0813157880FFBAD6199E07579BE + +[8A8E73D70CBC902CD99C7A4E2B982778] +GoodName=Bomberman Hero (E) [b3] +CRC=D85C4E29 88E276AF +RefMD5=F79EF0813157880FFBAD6199E07579BE + +[008710F628C29D69BD939066A44AB877] +GoodName=Bomberman Hero (E) [f1] (NTSC) +CRC=D85C4E29 88E276AF +RefMD5=F79EF0813157880FFBAD6199E07579BE + +[EF2453BFF7AD0C4BFA9AB0BD6324EBF3] +GoodName=Bomberman Hero (U) [!] +CRC=4446FDD6 E3788208 +Players=4 +SaveType=Eeprom 4KB + +[5642E51D746F603DFE5A71C5CBDB5C73] +GoodName=Bomberman Hero (U) [b1] +CRC=4446FDD6 E3788208 +RefMD5=EF2453BFF7AD0C4BFA9AB0BD6324EBF3 + +[1143B49D788BA477DAE98C05D6623344] +GoodName=Bomberman Hero (U) [b2] +CRC=DA573DB9 9442D273 +RefMD5=EF2453BFF7AD0C4BFA9AB0BD6324EBF3 + +[1BCED1BA1BF5A0E2FF5768C714EE4627] +GoodName=Bomberman Hero (U) [b3] +CRC=DA573DB9 9442D273 +RefMD5=EF2453BFF7AD0C4BFA9AB0BD6324EBF3 + +[8A0479714259954BAE41D5275AC926F4] +GoodName=Bomberman Hero (U) [t1] +CRC=DA573DB9 9442D273 +RefMD5=EF2453BFF7AD0C4BFA9AB0BD6324EBF3 + +[EE273763C7391458865FF26C7EA0C3F1] +GoodName=Bomberman Hero - Mirian Oujo wo Sukue! (J) [!] +CRC=67FF12CC 76BF0212 +Players=4 +SaveType=Eeprom 4KB + +[E7D3A4A73D373DA534A025E99B4D0EEF] +GoodName=Bomberman Hero - Mirian Oujo wo Sukue! (J) [b1] +CRC=67FF12CC 76BF0212 +RefMD5=EE273763C7391458865FF26C7EA0C3F1 + +[8FA5E55E5597E2615F81CD236DCA4721] +GoodName=Bomberman Hero - Mirian Oujo wo Sukue! (J) [b2] +CRC=DDEF1333 E7209D07 +RefMD5=EE273763C7391458865FF26C7EA0C3F1 + +[F39476591E147906291BA48145F304B0] +GoodName=Bomberman Hero - Mirian Oujo wo Sukue! (J) [b3] +CRC=DDEF1333 E7209D07 +RefMD5=EE273763C7391458865FF26C7EA0C3F1 + +[49E9C7AACF839E46EA2D255A99FB2613] +GoodName=Bomberman Hero - Mirian Oujo wo Sukue! (J) [b4] +CRC=67FF12CC 76BF0212 +RefMD5=EE273763C7391458865FF26C7EA0C3F1 + +[D4806CD9D9DFC7E52D6F825B5D5CC7C2] +GoodName=Bomberman Hero - Mirian Oujo wo Sukue! (J) [b5] +CRC=DDEF1333 E7209D07 +RefMD5=EE273763C7391458865FF26C7EA0C3F1 + +[30194320B54FF67CB0CDA5DDB061D933] +GoodName=Bomberman Hero - Mirian Oujo wo Sukue! (J) [b6] +CRC=DDEF1333 E7209D07 +RefMD5=EE273763C7391458865FF26C7EA0C3F1 + +[2C68A2D12C1EBFA2AD8F0BE1A09AEEE7] +GoodName=Bomberman Hero - Mirian Oujo wo Sukue! (J) [b7] +CRC=67FF12CC 76BF0212 +RefMD5=EE273763C7391458865FF26C7EA0C3F1 + +[4022B2A0F22218870764CDAE73580762] +GoodName=Bomberman Hero - Mirian Oujo wo Sukue! (J) [b8] +CRC=DDEF1333 E7209D07 +RefMD5=EE273763C7391458865FF26C7EA0C3F1 + +[A12B361F9D38FDFE3183C2B4C1F2F217] +GoodName=Bomberman Hero - Mirian Oujo wo Sukue! (J) [o1] +CRC=67FF12CC 76BF0212 +RefMD5=EE273763C7391458865FF26C7EA0C3F1 + +[C4543F27B4E481D0818B51036B67DFEF] +GoodName=Bomberman Hero - Mirian Oujo wo Sukue! (J) [t1] +CRC=DDEF1333 E7209D07 +RefMD5=EE273763C7391458865FF26C7EA0C3F1 + +[B5772A2827BEFC81E107AE756B36BB2A] +GoodName=Boot Emu by Jovis (PD) +CRC=2D15DC8C D3BBDB52 + +[FB19AFD5E8C49978E6E6AE3622E0498A] +GoodName=Bottom of the 9th (U) [!] +CRC=D72FD14D 1FED32C4 +SaveType=Controller Pack +Players=4 + +[6E207C47FAAD2A4F64AE721A3A8F6161] +GoodName=Bottom of the 9th (U) [b1] +CRC=D72FD14D 1FED32C4 +RefMD5=FB19AFD5E8C49978E6E6AE3622E0498A + +[62E92102D6FD1701A6E904DA6AB58AE8] +GoodName=Brunswick Circuit Pro Bowling (U) [!] +CRC=1E22CF2E 42AAC813 + +[14D070077D70C94CBB1413C7641E7272] +GoodName=Brunswick Circuit Pro Bowling (U) [b1] +CRC=91644B9F 8CDD0DA5 +Players=4 +SaveType=Controller Pack + +[2D30FBE45C2858957F9EFDB5E9000033] +GoodName=Brunswick Circuit Pro Bowling (U) [o1] +CRC=1E22CF2E 42AAC813 +RefMD5=14D070077D70C94CBB1413C7641E7272 + +[C3A55D506E5BD011EC20F601EA2B33BB] +GoodName=Brunswick Circuit Pro Bowling (U) [o1][f1] (PAL) +CRC=91644B9F 8CDD0DA5 +RefMD5=14D070077D70C94CBB1413C7641E7272 + +[A2E4BE02876CB0F0D1E925FF95090C96] +GoodName=Buck Bumble (E) (M5) [!] +CRC=D5B2339C CABCCAED +Players=4 +SaveType=Controller Pack + +[AEE981977D8F069003574CD10A268D47] +GoodName=Buck Bumble (J) [!] +CRC=D7C762B6 F83D9642 +Players=4 +SaveType=Controller Pack + +[41417FCE2B37EAAE787C5A845A0015C4] +GoodName=Buck Bumble (U) [!] +CRC=85AE781A C756F05D +Players=4 +SaveType=Controller Pack + +[01933A0CBBDE1D4EB4C58CC6C6C27633] +GoodName=Buck Bumble (U) [b1][t1] +CRC=3C2B07FC 8C6AC97B +RefMD5=41417FCE2B37EAAE787C5A845A0015C4 + +[CD19788AE04DAD7AF27FD0C591983CCE] +GoodName=Buck Bumble (U) [b2] +CRC=E8522F04 43FA513A +RefMD5=41417FCE2B37EAAE787C5A845A0015C4 + +[C129EE8DA7FE1B976D71932733385438] +GoodName=Buck Bumble (U) [f1] (PAL) +CRC=3C2AC7FA 72BC3A5F +RefMD5=41417FCE2B37EAAE787C5A845A0015C4 + +[28F8F7D8423B291E3056047C62E2937A] +GoodName=Buck Bumble (U) [t1] +CRC=3C2B07FC 8C6AC97B +RefMD5=41417FCE2B37EAAE787C5A845A0015C4 + +[ED3E962653A1CD56AAB175DEEE6EE52A] +GoodName=Bug's Life, A (E) [!] +CRC=8F12C096 45DC17E1 +Players=1 +SaveType=Controller Pack + +[5BF0F2351AEE577A8345D6E13D197E06] +GoodName=Bug's Life, A (E) [f1] (NTSC) +CRC=09035DC5 870C1041 +RefMD5=ED3E962653A1CD56AAB175DEEE6EE52A + +[D2860D4FBD0EC4B2711A6EF8D78F9866] +GoodName=Bug's Life, A (F) [!] +CRC=2B38AEC0 6350B810 +SaveType=Controller Pack +Players=1 + +[504C92A5978B7EAE7A3FD30645E06D39] +GoodName=Bug's Life, A (F) [f1] (NTSC) +CRC=BD58346E 67E74459 +RefMD5=D2860D4FBD0EC4B2711A6EF8D78F9866 + +[CBEF54768670F4B5602CCBC90150007A] +GoodName=Bug's Life, A (G) [!] +CRC=DFF227D9 0D4D8169 +Players=1 +SaveType=Controller Pack + +[919E5D60A7F9A79D89AC179123D47EEE] +GoodName=Bug's Life, A (G) [f1] (NTSC) +CRC=31E33A96 2744267B +RefMD5=CBEF54768670F4B5602CCBC90150007A + +[E3609FD12369C464E832C6D2A4D20790] +GoodName=Bug's Life, A (I) [!] +CRC=F63B89CE 4582D57D +Players=1 +SaveType=Controller Pack + +[7FD6BFFB80F920E01EF869829D485EA3] +GoodName=Bug's Life, A (U) [!] +CRC=82DC04FD CF2D82F4 +Players=1 +SaveType=Controller Pack + +[14ACC20454B0C2789C9F7EF7A556231A] +GoodName=Bug's Life, A (U) [b1] +CRC=82DC04FD CF2D82F4 +Players=1 +SaveType=Controller Pack + +[6472BD444D2025B1D883FFAE35D94FD4] +GoodName=Bug's Life, A (U) [b1][f1] (PAL) +CRC=2FE62885 F6853DAF +RefMD5=14ACC20454B0C2789C9F7EF7A556231A + +[08E3F4EEEA56C873A84EA076AA362EDD] +GoodName=Bug's Life, A (U) [f1] (PAL) +CRC=2FE62885 F6853DAF +RefMD5=7FD6BFFB80F920E01EF869829D485EA3 + +[B8B760613CAA702E33F271741170632A] +GoodName=Bug's Life, A (U) [t1] +CRC=3F4AFB7B 2D24C8F8 +RefMD5=7FD6BFFB80F920E01EF869829D485EA3 + +[30AAE8A534C72FFC89343E8EF0F1C5A1] +GoodName=Bug's Life, A (U) [t2] +CRC=3F4AFB7B 2D24C8F8 +RefMD5=7FD6BFFB80F920E01EF869829D485EA3 + +[8567382D3CD5BC0406B7B4C780F621DC] +GoodName=Bust-A-Move '99 (U) [!] +CRC=4222D89F AFE0B637 +Players=4 +SaveType=Controller Pack + +[B292B14BBC7FFCC2A741FE87A80B8D4D] +GoodName=Bust-A-Move '99 (U) [b1] +CRC=8AFB2D9A 9F186C02 +RefMD5=8567382D3CD5BC0406B7B4C780F621DC + +[4EA8627701C3D6AF50DDAA607AA3B7F9] +GoodName=Bust-A-Move '99 (U) [f1] (PAL) +CRC=F23CA406 EC2ACE78 +RefMD5=8567382D3CD5BC0406B7B4C780F621DC + +[094F639A9BA63B2136D2887C8D72BCA0] +GoodName=Bust-A-Move 2 - Arcade Edition (E) [!] +CRC=CEDCDE1E 513A0502 +Players=2 +SaveType=Controller Pack + +[AE0693C8D73E5A1407A2EDF41F1164A9] +GoodName=Bust-A-Move 2 - Arcade Edition (E) [b1] +CRC=B121ED86 883423F1 +RefMD5=094F639A9BA63B2136D2887C8D72BCA0 + +[8897A39E34AEE4D3F807AF255C6617D6] +GoodName=Bust-A-Move 2 - Arcade Edition (U) [!] +CRC=8A86F073 CD45E54B +Players=2 +SaveType=Controller Pack + +[84DD20F80DB23CB49BFE98639BE6CD71] +GoodName=Bust-A-Move 2 - Arcade Edition (U) [b1] +CRC=8A86F073 CD45E54B +RefMD5=8897A39E34AEE4D3F807AF255C6617D6 + +[5065D7A833FC73CB75DED8D639AAADA5] +GoodName=Bust-A-Move 2 - Arcade Edition (U) [b2] +CRC=2D03FD5B D5C096D5 +RefMD5=8897A39E34AEE4D3F807AF255C6617D6 + +[EF3D1E9059723766941FF4E0E913C941] +GoodName=Bust-A-Move 2 - Arcade Edition (U) [b3] +CRC=322EF540 38D316EB +RefMD5=8897A39E34AEE4D3F807AF255C6617D6 + +[8EEF2BB9543B78197CEDDA6DA860DA97] +GoodName=Bust-A-Move 2 - Arcade Edition (U) [b4] +CRC=8A86F073 CD45E54B +RefMD5=8897A39E34AEE4D3F807AF255C6617D6 + +[3EA21256DDC4157C3231AE5CC9C4652A] +GoodName=Bust-A-Move 3 DX (E) [!] +CRC=E328B4FA 004A28E1 + +[16D7676C2394E422076F7CB855DE901B] +GoodName=Bust-A-Move 3 DX (E) [b1] +CRC=364C4ADC D3050993 + +[0BD4AEB12E502C39140E4DA52F77642E] +GoodName=Bust-A-Move 3 DX (E) [b2] +CRC=E328B4FA 004A28E1 + +[089D12EE45BFACD4A9FC93185AF5C42B] +GoodName=Bust-A-Move 3 DX (E) [b3] +CRC=E328B4FA 004A28E1 + +[1BDC2BFDD0B6CA9D8FD354AEAF1A3CF6] +GoodName=Bust-A-Move 3 DX (E) [f1] (NTSC100%) +CRC=364C4ADC D3050993 + +[F7CA97BE225630B7690A862FCA97E442] +GoodName=Bust-A-Move 3 DX (E) [f2] (NTSC-Z64) +CRC=D5BDCD1D 393AFE43 + +[3CA46AD43F9B62DF409759D56468F18E] +GoodName=Bust-A-Move 3 DX (E) [f3] (NTSC) +CRC=D5BDCD1D 393AFE43 + +[6A78DA715440C0C6872B5D78D31BFD3B] +GoodName=CD64 BIOS Direct-Upgrade V1.08 +CRC=549EA1B0 F666F794 + +[176D518AD6E1D89BC0FEF0672A4C1882] +GoodName=CD64 BIOS Direct-Upgrade V1.09 +CRC=8E3D8D2E 9850573F + +[0B7C2A6D2B3DE3D7D0FF7AAFAB6F8DA7] +GoodName=CD64 BIOS Direct-Upgrade V1.10 +CRC=3E93A24F AC2D58E1 + +[30D7D730E8C131C77EC6F6390B9EB8B3] +GoodName=CD64 BIOS Direct-Upgrade V1.11 +CRC=FAB972E4 1CB0882B + +[CF1E4E42B93ECBB080C05B73BB4AF808] +GoodName=CD64 BIOS Direct-Upgrade V1.13 +CRC=960621E3 7D4D5BB0 + +[B03E6FAFEA6A314285D0181D5D2ABBAB] +GoodName=CD64 BIOS Direct-Upgrade V1.20 +CRC=D32264A1 989987EA + +[A911F13E7D4CF157C79330E908BAE9A7] +GoodName=CD64 BIOS Direct-Upgrade V1.21 +CRC=4F354F88 A75E40E0 + +[6711B9D80D4D22AD0DC4AF20C9088763] +GoodName=CD64 BIOS Direct-Upgrade V1.23 +CRC=AAD9FC15 B2C9DA6F + +[354E8A1BC64683F01FE598F51D5AB4BE] +GoodName=CD64 BIOS Direct-Upgrade V1.30 +CRC=6BF11774 D330D7ED + +[F70A06305D5C545980D9D2D16EF122B2] +GoodName=CD64 BIOS EEPROM-Burner V1.08 [a1] +CRC=626C7AA3 C1480B86 + +[4EA4119D7D07FD965BB09A974341E0F3] +GoodName=CD64 BIOS EEPROM-Burner V1.08 +CRC=57D1CEA5 E2CCC89F + +[D47EC4844C8C3946A3222FB22E103F04] +GoodName=CD64 BIOS EEPROM-Burner V1.09 +CRC=CADEA283 46EAF060 + +[E7C8D1090FA90E9B8C29B48734CF3A78] +GoodName=CD64 BIOS EEPROM-Burner V1.10 +CRC=BE4AF7A0 14E3D32C + +[E730EDA716AE40BDBC404F7601491D77] +GoodName=CD64 BIOS EEPROM-Burner V1.11 (Even Bytes) +CRC=43362020 20202020 + +[706DB19D4AA4EAF902C8B48544884CEF] +GoodName=CD64 BIOS EEPROM-Burner V1.11 (Odd Bytes) +CRC=44342020 20202056 + +[CBEA298BFE9B59BBDBC379ABFD2CD208] +GoodName=CD64 BIOS EEPROM-Burner V1.11 +CRC=4A0CD2F4 F1F22FE3 + +[8191F6945DAB90A17E752AA3C94B0402] +GoodName=CD64 BIOS EEPROM-Burner V1.21 (Even Bytes) +CRC=43362020 20202020 + +[1DF4F3503FEFFBA6214092E0ABBA33B2] +GoodName=CD64 BIOS EEPROM-Burner V1.21 (Odd Bytes) +CRC=44342020 20202056 + +[16E77C21E1EA47FDD8C5635CFFF94BFD] +GoodName=CD64 BIOS EEPROM-Burner V1.21 +CRC=E74607D1 751139B4 + +[AAAA0551DB73728D79EBC1D1EDD127F6] +GoodName=CD64 BIOS EEPROM-Burner V1.23 (Even Bytes) +CRC=43362020 20202020 + +[168872484F1E933FF351D1C3DC1FC601] +GoodName=CD64 BIOS EEPROM-Burner V1.23 (Odd Bytes) +CRC=44342020 20202056 + +[DA027DB6DCB643B0BFCE71720A1F7500] +GoodName=CD64 BIOS EEPROM-Burner V1.23 +CRC=FE169919 46F54C2D + +[781AE174BEDA8641E3F0E1EFAD761050] +GoodName=CD64 BIOS EEPROM-Burner V1.30 (Even Bytes) +CRC=43362020 20202020 + +[3965F14D450F019BEB8591AA10AFC2BF] +GoodName=CD64 BIOS EEPROM-Burner V1.30 (Odd Bytes) +CRC=44342020 20202056 + +[51313E88D86DFF531E386529BBE45DD5] +GoodName=CD64 BIOS EEPROM-Burner V1.30 +CRC=C7F15051 EE3DEE75 + +[A99D3F4334F2F59B247FD5CB3DC85A77] +GoodName=CD64 Memory Test (PD) +CRC=95081A8B 49DFE4FA + +[226127FDBA21FC9019397ED2C5E5B19F] +GoodName=CZN Module Player (PD) +CRC=5B9D65DF A18AB4AE + +[965AD2FA317F0644E49A89A3219719CB] +GoodName=California Speed (U) [!] +CRC=AC16400E CF5D071A +SaveType=Controller Pack +Players=4 + +[C95353C14C4AE3DC95D1D91D6566EF92] +GoodName=California Speed (U) [f1] (Country Check) +CRC=AC16460E 46F60594 +RefMD5=965AD2FA317F0644E49A89A3219719CB + +[7658075D52C403783640DFAC2F8B6A9E] +GoodName=California Speed (U) [f2] (PAL) +CRC=41D44009 5E94483F +RefMD5=965AD2FA317F0644E49A89A3219719CB + +[EEEAD69D62EB43F093D9D46C38A82AC5] +GoodName=California Speed (U) [t1] +CRC=150DDE31 969D3994 +RefMD5=965AD2FA317F0644E49A89A3219719CB + +[CA21467BDE6B355E7A15B8F1ADA7B24D] +GoodName=Carmageddon 64 (E) (M4) (Eng-Spa-Fre-Ger) [!] +CRC=580162EC E3108BF1 +Players=4 +SaveType=Controller Pack + +[A5DB496C328C36682EB770CEFE6C2064] +GoodName=Carmageddon 64 (E) (M4) (Eng-Spa-Fre-Ger) [f1] (NTSC) +CRC=BCC83145 6B7F5DA6 +RefMD5=CA21467BDE6B355E7A15B8F1ADA7B24D + +[59EB5646FA079BCBD7A340D7A10196DD] +GoodName=Carmageddon 64 (E) (M4) (Eng-Spa-Fre-Ita) [!] +CRC=E48E01F5 E6E51F9B +Players=4 +SaveType=Controller Pack + +[D5271DB3CBE6B24099DCC6878C137FF7] +GoodName=Carmageddon 64 (E) (M4) (Eng-Spa-Fre-Ita) [b1] +CRC=E48E01F5 E6E51F9B +RefMD5=59EB5646FA079BCBD7A340D7A10196DD + +[BCD2A45C39128B7D7E29E351788E860E] +GoodName=Carmageddon 64 (E) (M4) (Eng-Spa-Fre-Ita) [f1] (NTSC) +CRC=A1CC026F E09D1766 +RefMD5=59EB5646FA079BCBD7A340D7A10196DD + +[3559BE56B70BAFB77C900516B909BFEF] +GoodName=Carmageddon 64 (E) (M4) (Eng-Spa-Fre-Ita) [f2] (NTSC) +CRC=5D0283F5 2CDEEA76 +RefMD5=59EB5646FA079BCBD7A340D7A10196DD + +[31BB57C1FAD0D47DC2353C1950B11886] +GoodName=Carmageddon 64 (U) [!] +CRC=F00F2D4E 340FAAF4 +Players=4 +SaveType=Controller Pack + +[57146B6CD8EE7D96B01A811F98A1AC61] +GoodName=Castlevania (E) (M3) [!] +CRC=64F1B7CA 71A23755 +Players=1 +SaveType=Controller Pack + +[DE30F7C3D077778380E2B3D507EFE2D3] +GoodName=Castlevania (E) (M3) [b1] +CRC=64F1B7CA 71A23755 +RefMD5=57146B6CD8EE7D96B01A811F98A1AC61 + +[96C8DA6D1567F43570CCB362811114DE] +GoodName=Castlevania (E) (M3) [t1] +CRC=DA0E5024 969ED261 +RefMD5=57146B6CD8EE7D96B01A811F98A1AC61 + +[1CC5CF3B4D29D8C3ADE957648B529DC1] +GoodName=Castlevania (U) (V1.0) [!] +CRC=F35D5F95 8AFE3D69 +Players=1 +SaveType=Controller Pack + +[C19E5A3FCDF52C7292097F215DDC428A] +GoodName=Castlevania (U) (V1.0) [b1] +CRC=F35D5F95 8AFE3D69 +RefMD5=1CC5CF3B4D29D8C3ADE957648B529DC1 + +[1A9EBA4D8CB647FD03AAEB022D04344F] +GoodName=Castlevania (U) (V1.0) [b2] +CRC=F35D5F95 8AFE3D69 +RefMD5=1CC5CF3B4D29D8C3ADE957648B529DC1 + +[A4DB62BABE8583E5F5674FFCFF8B8DFC] +GoodName=Castlevania (U) (V1.0) [b3] +CRC=F35D5F95 8AFE3D69 +RefMD5=1CC5CF3B4D29D8C3ADE957648B529DC1 + +[3E972E3340BED6E47D3C515DD10EAEDA] +GoodName=Castlevania (U) (V1.0) [b4] +CRC=F35D5F95 8AFE3D69 +RefMD5=1CC5CF3B4D29D8C3ADE957648B529DC1 + +[1FEC5A43F756C4AAE958CD286F6451C5] +GoodName=Castlevania (U) (V1.0) [t1] +CRC=0B28EBA3 5E062616 +RefMD5=1CC5CF3B4D29D8C3ADE957648B529DC1 + +[EBDC9053485AAEE05378A9D95D991104] +GoodName=Castlevania (U) (V1.0) [t2] +CRC=036CBFE5 9E626365 +RefMD5=1CC5CF3B4D29D8C3ADE957648B529DC1 + +[8F94C0A43D697D8DEAE9DE660865A966] +GoodName=Castlevania (U) (V1.0) [t3] +CRC=0B28EBA3 5E062616 +RefMD5=1CC5CF3B4D29D8C3ADE957648B529DC1 + +[8ADA90FBD3313D5080007905D183CBD4] +GoodName=Castlevania (U) (V1.0) [t4] +CRC=0B28EBA3 5E062616 +RefMD5=1CC5CF3B4D29D8C3ADE957648B529DC1 + +[06B58673F7D31C56F8FE8186E86F6BD6] +GoodName=Castlevania (U) (V1.2) [!] +CRC=4BCDFF47 AAA3AF8F +Players=1 +SaveType=Controller Pack + +[78D5F8A98A5ED21D0817856BCD2AD750] +GoodName=Castlevania - Legacy of Darkness (E) (M3) [!] +CRC=A2C54BE7 6719CBB2 +Players=1 +SaveType=Controller Pack + +[3152B82C03FC7B928D3D5C43F95AEF51] +GoodName=Castlevania - Legacy of Darkness (E) (M3) [h1C] +CRC=A2C54BE7 6719CBB2 +RefMD5=78D5F8A98A5ED21D0817856BCD2AD750 + +[45EF2794A1AC6AD737288A6577D55194] +GoodName=Castlevania - Legacy of Darkness (E) (M3) [o1] +CRC=A2C54BE7 6719CBB2 +RefMD5=78D5F8A98A5ED21D0817856BCD2AD750 + +[25258460F98F567497B24844ABE3A05B] +GoodName=Castlevania - Legacy of Darkness (U) [!] +CRC=1CC06338 87388926 +Players=1 +SaveType=Controller Pack + +[5F73634C622ABEDF6204CB801872C79C] +GoodName=Castlevania - Legacy of Darkness (U) [b1] +CRC=1CC06338 87388926 +RefMD5=25258460F98F567497B24844ABE3A05B + +[2D6ABF559A9AAE65BBEB0E60B3F82D1B] +GoodName=Castlevania - Legacy of Darkness (U) [f1] (PAL) +CRC=0CE3D2E6 6C6E443D +RefMD5=25258460F98F567497B24844ABE3A05B + +[DE4CA7C5F9DD9216771451A5AFF9F634] +GoodName=Castlevania - Legacy of Darkness (U) [f2] (PAL) +CRC=7FD0761E 2190A9ED +RefMD5=25258460F98F567497B24844ABE3A05B + +[956FCD46E850E9D10E623C6749D5524E] +GoodName=Castlevania - Legacy of Darkness (U) [t1] +CRC=64B62D16 43A2A592 +RefMD5=25258460F98F567497B24844ABE3A05B + +[31FB88048076ACE4BD4205C5F40414AB] +GoodName=Centre Court Tennis (E) [!] +CRC=DCCF2134 9DD63578 +Players=4 + +[F52661EF93B9FD4DF16F1F113082AEAA] +GoodName=Centre Court Tennis (E) [f1] (NTSC) +CRC=B6C4F400 92A39D47 +RefMD5=31FB88048076ACE4BD4205C5F40414AB + +[53EE0172E29CDCBBFA5957A442863E5A] +GoodName=Centre Court Tennis (E) [h1C] +CRC=DCCF2134 9DD63578 +RefMD5=31FB88048076ACE4BD4205C5F40414AB + +[1CD90B13B7FD6AFDCB838F801D807826] +GoodName=Chameleon Twist (E) [!] +CRC=B9AF8CC6 DEC9F19F +Players=4 +SaveType=Eeprom 4KB + +[AB7D5366FEDCF8EC2D414B6001BEB399] +GoodName=Chameleon Twist (E) [b1] +CRC=B9AF8CC6 DEC9F19F +RefMD5=1CD90B13B7FD6AFDCB838F801D807826 + +[7C74D08A04B6B1B670D90CDB153F083C] +GoodName=Chameleon Twist (E) [b2] +CRC=B9AF8CC6 DEC9F19F +RefMD5=1CD90B13B7FD6AFDCB838F801D807826 + +[2151AB8629DACD8936439FC90F0AFD10] +GoodName=Chameleon Twist (E) [b3] +CRC=B9AF8CC6 DEC9F19F +RefMD5=1CD90B13B7FD6AFDCB838F801D807826 + +[3682AEBA1DA191A1CB2C513B1F834F70] +GoodName=Chameleon Twist (E) [f1] (NTSC) +CRC=4191BA80 41C5E21A +RefMD5=1CD90B13B7FD6AFDCB838F801D807826 + +[C71750C4B84081F3331D957D3FE932AD] +GoodName=Chameleon Twist (E) [o1] +CRC=B9AF8CC6 DEC9F19F +RefMD5=1CD90B13B7FD6AFDCB838F801D807826 + +[3728BE19FDCFC3ECEBD8C7504C13D1F5] +GoodName=Chameleon Twist (E) [o2] +CRC=B9AF8CC6 DEC9F19F +RefMD5=1CD90B13B7FD6AFDCB838F801D807826 + +[C0EB519122D63A944A122437EC1B98EE] +GoodName=Chameleon Twist (J) [!] +CRC=A4F2F521 F0EB168E +Players=4 +SaveType=Eeprom 4KB + +[397BE52D4FB7DF1E26C6275E05425571] +GoodName=Chameleon Twist (U) [!] +CRC=6420535A 50028062 +SaveType=Eeprom 4KB +Players=4 + +[AB299B3943161B9C2ABF03F5A9824E9F] +GoodName=Chameleon Twist (U) [b1] +CRC=6420535A 50028062 +RefMD5=397BE52D4FB7DF1E26C6275E05425571 + +[959E64F082449BDBD0E5164C32491470] +GoodName=Chameleon Twist (U) [b2] +CRC=6420535A 50028062 +RefMD5=397BE52D4FB7DF1E26C6275E05425571 + +[277D852DF9C71BE8DCBA01BA8C862482] +GoodName=Chameleon Twist (U) [b3] +CRC=6420535A 50028062 +RefMD5=397BE52D4FB7DF1E26C6275E05425571 + +[0A04F5F5938218B510A573B86967B199] +GoodName=Chameleon Twist (U) [t1] +CRC=1CD50DF2 345593AF +RefMD5=397BE52D4FB7DF1E26C6275E05425571 + +[45D1D039AB7926ADC748DE640AFD986A] +GoodName=Chameleon Twist 2 (E) [!] +CRC=07A69D01 9A7D41A1 +Players=1 +SaveType=Controller Pack + +[3A5EDF7256EA5E7AF4B451E07CC54003] +GoodName=Chameleon Twist 2 (E) [b1] +CRC=07A69D01 9A7D41A1 +RefMD5=45D1D039AB7926ADC748DE640AFD986A + +[A55AF433E65E3690E2DC2B16018E9A0F] +GoodName=Chameleon Twist 2 (J) [!] +CRC=0549765A 93B9D042 +Players=1 +SaveType=Controller Pack + +[7A638431CE966DDA97B282FF04B1D9D7] +GoodName=Chameleon Twist 2 (J) [b1] +CRC=0549765A 93B9D042 +RefMD5=A55AF433E65E3690E2DC2B16018E9A0F + +[24658C0D8AC2C4FD58A74F13BCA1D16A] +GoodName=Chameleon Twist 2 (J) [b2] +CRC=7D5772F8 3A6785EF +RefMD5=A55AF433E65E3690E2DC2B16018E9A0F + +[99605763AD74D40D5B2D24CF3F0A3CD5] +GoodName=Chameleon Twist 2 (J) [b3] +CRC=0549765A 93B9D042 +RefMD5=A55AF433E65E3690E2DC2B16018E9A0F + +[33B9DDDD6D7039CE1C9E6773056A65C8] +GoodName=Chameleon Twist 2 (J) [b4] +CRC=0549765A 93B9D042 +RefMD5=A55AF433E65E3690E2DC2B16018E9A0F + +[740AD4DB03952BBE997DB09947A41E62] +GoodName=Chameleon Twist 2 (J) [o1] +CRC=0549765A 93B9D042 +RefMD5=A55AF433E65E3690E2DC2B16018E9A0F + +[4C5F3C38743EBB2D12154A83C026DA46] +GoodName=Chameleon Twist 2 (J) [o2] +CRC=0549765A 93B9D042 +RefMD5=A55AF433E65E3690E2DC2B16018E9A0F + +[D85C29FD57FE481A34AFBCDB9774395A] +GoodName=Chameleon Twist 2 (J) [t1] +CRC=7D5772F8 3A6785EF +RefMD5=A55AF433E65E3690E2DC2B16018E9A0F + +[00327E0B5DF6DCE6DECC31353F33A3D3] +GoodName=Chameleon Twist 2 (U) [!] +CRC=CD538CE4 618AFCF9 +Players=1 +SaveType=Controller Pack + +[80F4CD56317218264E35894BA22CAD35] +GoodName=Chameleon Twist 2 (U) [t1] +CRC=752E1BF8 E81DF66D +RefMD5=00327E0B5DF6DCE6DECC31353F33A3D3 + +[4A3263EAB67FAB2D1171A23765D73AC6] +GoodName=Chaos 89 Demo (PD) +CRC=EDA1A0C7 58EE0464 + +[DD53E1F83E8789D23DF6AF942FFEF236] +GoodName=Charlie Blast's Territory (E) [!] +CRC=FB3C48D0 8D28F69F +SaveType=None +Players=4 + +[A7C15E0C1E7D898C1B20276DF7A62660] +GoodName=Charlie Blast's Territory (E) [o1] +CRC=FB3C48D0 8D28F69F +RefMD5=DD53E1F83E8789D23DF6AF942FFEF236 + +[59FA8C6D533D36C0FFC2AAFAB7166E6F] +GoodName=Charlie Blast's Territory (U) [!] +CRC=1E0E96E8 4E28826B +SaveType=None +Players=4 + +[7FFD84FC7D112EAB4EEF15CB10189A38] +GoodName=Charlie Blast's Territory (U) [hIR] +CRC=1E0E96E8 4E28826B +RefMD5=59FA8C6D533D36C0FFC2AAFAB7166E6F + +[7CBB43473597F48AA9A8E0B0D38CE685] +GoodName=Charlie Blast's Territory (U) [hI] +CRC=A6FD0808 6E6B3ECA +RefMD5=59FA8C6D533D36C0FFC2AAFAB7166E6F + +[8F6BED633BE214CF039DBDAC356231CE] +GoodName=Chopper Attack (E) [!] +CRC=2E359339 3FA5EDA6 +Players=1 +SaveType=Eeprom 4KB + +[AC129AB2688C02419FC190A87F2A2E93] +GoodName=Chopper Attack (E) [b1] +CRC=2E359339 3FA5EDA6 +RefMD5=8F6BED633BE214CF039DBDAC356231CE + +[0A3955C704210225D95937DCAB86C9E3] +GoodName=Chopper Attack (E) [t1] +CRC=D852E238 0E52A960 +RefMD5=8F6BED633BE214CF039DBDAC356231CE + +[C37E8AFB4F3ECC86D01CE7388CA59347] +GoodName=Chopper Attack (U) [!] +CRC=214CAD94 BE1A3B24 +Players=1 +SaveType=Eeprom 4KB + +[14AEB927F3620EFE48AF7FC748C1931F] +GoodName=Chopper Attack (U) [b1] +CRC=ACBF6069 EABEE162 +RefMD5=C37E8AFB4F3ECC86D01CE7388CA59347 + +[B8BEA2194D7D75A1711C024F5069D18E] +GoodName=Chopper Attack (U) [b2] +CRC=214CAD94 BE1A3B24 +RefMD5=C37E8AFB4F3ECC86D01CE7388CA59347 + +[34957B173CD33C999B954E7034FC01EA] +GoodName=Chopper Attack (U) [b3] +CRC=214CAD94 BE1A3B24 +RefMD5=C37E8AFB4F3ECC86D01CE7388CA59347 + +[B34CBCA3EEE5C010FF3E504AF2064069] +GoodName=Chopper Attack (U) [b4] +CRC=BF5D6D65 3F4A9C03 +RefMD5=C37E8AFB4F3ECC86D01CE7388CA59347 + +[5FA39EF0EBE18DA55C260A3A89F935B6] +GoodName=Chopper Attack (U) [b5] +CRC=214CAD94 BE1A3B24 +RefMD5=C37E8AFB4F3ECC86D01CE7388CA59347 + +[64C75E19890ACDE25842A815A21D55C9] +GoodName=Chopper Attack (U) [b6] +CRC=214CAD94 BE1A3B24 +RefMD5=C37E8AFB4F3ECC86D01CE7388CA59347 + +[F10D601D64786C52CAC1FD0AB5511C82] +GoodName=Chopper Attack (U) [t1] +CRC=BF5D6D65 3F4A9C03 +RefMD5=C37E8AFB4F3ECC86D01CE7388CA59347 + +[8287A908E36E79B2D3AF0BD22C43ECD9] +GoodName=Choro Q 64 (J) [!] +CRC=2BCCF9C4 403D9F6F +Players=4 +SaveType=Eeprom 4KB + +[2C944319017A21652566CC4196C714CC] +GoodName=Choro Q 64 (J) [b1] +CRC=2BCCF9C4 403D9F6F +RefMD5=8287A908E36E79B2D3AF0BD22C43ECD9 + +[470E1635A9693102B426A840DBD691E5] +GoodName=Choro Q 64 (J) [b2] +CRC=2BCCF9C4 403D9F6F +RefMD5=8287A908E36E79B2D3AF0BD22C43ECD9 + +[04A2C1A6EFAE28E07A4AD77603081F86] +GoodName=Choro Q 64 (J) [b3] +CRC=2BCCF9C4 403D9F6F +RefMD5=8287A908E36E79B2D3AF0BD22C43ECD9 + +[5F4D852BD3B707C1B4FE29F2FE19C687] +GoodName=Choro Q 64 (J) [b4] +CRC=2BCCF9C4 403D9F6F +RefMD5=8287A908E36E79B2D3AF0BD22C43ECD9 + +[7151AE130BA8DC97A205B62FF0EE0FB6] +GoodName=Choro Q 64 (J) [h1C] +CRC=2BCCF9C4 403D9F6F +RefMD5=8287A908E36E79B2D3AF0BD22C43ECD9 + +[9081370141079031EBBDBCA56FC8C7D8] +GoodName=Choro Q 64 II - Hacha Mecha Grand Prix Race (J) [!] +CRC=26CD0F54 53EBEFE0 +Players=4 + +[78838C202C4FF5A460586451EE9182AA] +GoodName=Chou Kuukan Night Pro Yakyuu King (J) [!] +CRC=8ACE6683 3FBA426E +Players=4 + +[5224CCBE260A4B7713D662D9BC269063] +GoodName=Chou Kuukan Night Pro Yakyuu King (J) [b1] +CRC=8ACE6683 3FBA426E +RefMD5=78838C202C4FF5A460586451EE9182AA + +[9C39391D103E6DB39CEC6C774EDB082A] +GoodName=Chou Kuukan Night Pro Yakyuu King (J) [h1C] +CRC=8ACE6683 3FBA426E +RefMD5=78838C202C4FF5A460586451EE9182AA + +[97EAB4DC83DA0AD2890DE2AAAA5D109A] +GoodName=Chou Kuukan Night Pro Yakyuu King 2 (J) [!] +CRC=3A180FF4 5C8E8AF7 +Players=4 + +[9466618F4497DA6C9091E05CC9666786] +GoodName=Chou Snobow Kids (J) [!] +CRC=A7941528 61F1199D +Players=4 +SaveType=Eeprom 4KB + +[74341014043CC42D8804DADBF252B344] +GoodName=Chou Snobow Kids (J) [f1] (PAL) +CRC=2FEB152B 9C205EA5 +RefMD5=9466618F4497DA6C9091E05CC9666786 + +[BA145D51B681EF4432DB59C1DA703047] +GoodName=Christmas Flame Demo by Halley's Comet Software (PD) +CRC=B484EB31 D44B1928 + +[2A0BF5A9A136D57AF01D199B16899634] +GoodName=City-Tour GP - Zennihon GT Senshuken (J) [!] +CRC=F8009DB0 6B291823 +Players=4 +SaveType=Eeprom 4KB + +[4808E8129B22AC8B3185B37243113005] +GoodName=City-Tour GP - Zennihon GT Senshuken (J) [b1] +CRC=F8009DB0 6B291823 +RefMD5=2A0BF5A9A136D57AF01D199B16899634 + +[2BD614A2A1A317ECBEEB4193954C5FA5] +GoodName=City-Tour GP - Zennihon GT Senshuken (J) [b2] +CRC=F8009DB0 6B291823 +RefMD5=2A0BF5A9A136D57AF01D199B16899634 + +[E226801C0B57FD2F2D2E303986DB5E5C] +GoodName=City-Tour GP - Zennihon GT Senshuken (J) [b3] +CRC=F8009DB0 6B291823 +RefMD5=2A0BF5A9A136D57AF01D199B16899634 + +[30E7E083B978408D5B7760D0CE4DC61D] +GoodName=Clay Fighter - Sculptor's Cut (U) [!] +CRC=FA5A3DFF B4C9CDB9 +SaveType=None +Players=4 + +[052BB2C8C4174633A0D38DEB4D31C719] +GoodName=Clay Fighter - Sculptor's Cut (U) [b1] +CRC=FA5A3DFF B4C9CDB9 +RefMD5=30E7E083B978408D5B7760D0CE4DC61D + +[D47AB8CA78D9686A7021EBBBA00B0AA0] +GoodName=Clay Fighter - Sculptor's Cut (U) [b2] +CRC=FA5A3DFF B4C9CDB9 +RefMD5=30E7E083B978408D5B7760D0CE4DC61D + +[B8047551F6E44E367862E9BC9C2A4DDF] +GoodName=Clay Fighter - Sculptor's Cut (U) [h1C] +CRC=FA5A3DFF B4C9CDB9 +RefMD5=30E7E083B978408D5B7760D0CE4DC61D + +[CCD869C8D45C3998ADDCBF43791D6C56] +GoodName=Clay Fighter - Sculptor's Cut (U) [h2C] +CRC=FA5A3DFF B4C9CDB9 +RefMD5=30E7E083B978408D5B7760D0CE4DC61D + +[CD00C317003B03CD0BBEEC4570D2B55D] +GoodName=Clay Fighter - Sculptor's Cut (U) [t1] +CRC=6C48FE11 8E1A27EC +RefMD5=30E7E083B978408D5B7760D0CE4DC61D + +[CBBEAFF5A9074D1A5507CF46CD683D36] +GoodName=Clay Fighter 63 1-3 (Beta) [!] +CRC=2B6FA7C0 09A71225 + +[BE41BA94878999987DC8D2FD3A5551D9] +GoodName=Clay Fighter 63 1-3 (Beta) [b1] +CRC=2B6FA7C0 09A71225 + +[41965B533F3DD95663361D9DF68B0C1F] +GoodName=Clay Fighter 63 1-3 (E) [!] +CRC=8E9692B3 4264BB2A +Players=4 +SaveType=None + +[46B95EA3EB82654439A6750443BCDE53] +GoodName=Clay Fighter 63 1-3 (E) [b1][h1C] +CRC=8E9692B3 4264BB2A +RefMD5=41965B533F3DD95663361D9DF68B0C1F + +[2084974C9098B2D01C1F58B0E56EE058] +GoodName=Clay Fighter 63 1-3 (E) [h1C] +CRC=8E9692B3 4264BB2A +RefMD5=41965B533F3DD95663361D9DF68B0C1F + +[3207BF22E305C488109B09A03706F36F] +GoodName=Clay Fighter 63 1-3 (U) [!] +CRC=F03C24CA C5237BCC +Players=4 +SaveType=None + +[7A4ACAB8997D180C045D9286C917ED1B] +GoodName=Clay Fighter 63 1-3 (U) [b1] +CRC=F03C24CA C5237BCC +RefMD5=3207BF22E305C488109B09A03706F36F + +[0EDBCB64159B7E32DDA165A7A363AB35] +GoodName=Clay Fighter 63 1-3 (U) [b2] +CRC=F03C24CA C5237BCC +RefMD5=3207BF22E305C488109B09A03706F36F + +[D41EE755C8DDF4BBD5E368670C672488] +GoodName=Clay Fighter 63 1-3 (U) [o1] +CRC=2B6FA7C0 09A71225 +RefMD5=3207BF22E305C488109B09A03706F36F + +[6746F4CC43ACEBF3F04B1677B16C1935] +GoodName=Clay Fighter 63 1-3 (U) [o2] +CRC=F03C24CA C5237BCC +RefMD5=3207BF22E305C488109B09A03706F36F + +[0E38732BC5F564D74D57EF0A0CBA8D56] +GoodName=Cliffi's Little Intro by Cliffi (POM '99) (PD) [b1] +CRC=10637557 03E93693 + +[BE2AB7CD9DBDDA8DDAE1EA288C663F15] +GoodName=Cliffi's Little Intro by Cliffi (POM '99) (PD) +CRC=4B0313E2 65657446 + +[42DA4C7D040F9E7CD046A42EC3E68027] +GoodName=Command & Conquer (E) (M2) [!] +CRC=AE5B9465 C54D6576 +Players=1 +SaveType=Flash RAM + +[4D972AE7FAA1AA3ED26026F6F46C8A6A] +GoodName=Command & Conquer (E) (M2) [b1] +CRC=AE5B9465 C54D6576 +RefMD5=42DA4C7D040F9E7CD046A42EC3E68027 + +[C0CC62AC4B06416C9DB5B765ADE5F626] +GoodName=Command & Conquer (E) (M2) [b2] +CRC=AE5B9465 C54D6576 +RefMD5=42DA4C7D040F9E7CD046A42EC3E68027 + +[1D26E8B65CD2F1BF1EABAFFDBBFC1F26] +GoodName=Command & Conquer (E) (M2) [b3] +CRC=AE5B9465 C54D6576 +RefMD5=42DA4C7D040F9E7CD046A42EC3E68027 + +[E19F762182F4B4ADF5D8F6D998033059] +GoodName=Command & Conquer (E) (M2) [f1] (Z64) +CRC=EA630EC7 2B2F37F3 +RefMD5=42DA4C7D040F9E7CD046A42EC3E68027 + +[1A9195662C89DCBEA88BCFA99B096CDE] +GoodName=Command & Conquer (G) [!] +CRC=B5025BAD D32675FD +Players=1 +SaveType=Flash RAM + +[19A646E0148EA6695E797C1990919B8A] +GoodName=Command & Conquer (G) [f1] (Z64) +CRC=705AC38A A8D714E8 +RefMD5=1A9195662C89DCBEA88BCFA99B096CDE + +[B436F4717AC585B0D847756468FD6393] +GoodName=Command & Conquer (U) [!] +CRC=95286EB4 B76AD58F +Players=1 +SaveType=Flash RAM + +[57044E8F223D117F55B22E7FD2EDF71E] +GoodName=Command & Conquer (U) [b1] +CRC=F921961E E09D8B11 +RefMD5=B436F4717AC585B0D847756468FD6393 + +[715D537C6D78440C085DDD22E827C260] +GoodName=Command & Conquer (U) [f1] (Z64) +CRC=22AD2E8E 73CC712C +RefMD5=B436F4717AC585B0D847756468FD6393 + +[B206F917C1B4FD41CDADC4064C48B07B] +GoodName=Congratulations Demo for SPLiT by Widget and Immortal (PD) [b1] +CRC=D2B908C8 E0E73A1D + +[2616B2901F794EADFD26D5FA2BF5564D] +GoodName=Congratulations Demo for SPLiT by Widget and Immortal (PD) +CRC=D2B908C8 E0E73A1D + +[05194D49C14E52055DF72A54D40791E1] +GoodName=Conker's Bad Fur Day (E) [!] +CRC=373F5889 9A6CA80A +SaveType=Eeprom 16KB +Players=4 + +[00E2920665F2329B95797A7EAABC2390] +GoodName=Conker's Bad Fur Day (U) [!] +CRC=30C7AC50 7704072D +SaveType=Eeprom 16KB +Players=4 + +[DB7A03B77D44DB81B8A3FCDFC4B72D8C] +GoodName=Cruis'n Exotica (U) [!] +CRC=46A3F7AF 0F7591D0 +SaveType=Eeprom 4KB +Players=2 + +[A8266778591994EFA3A3B9E6E806F8C8] +GoodName=Cruis'n Exotica (U) [t1] +CRC=1E4C4743 FEA2C4D1 +RefMD5=DB7A03B77D44DB81B8A3FCDFC4B72D8C + +[69CD5BA6BC9310B9E37CCB1BC6BD16AD] +GoodName=Cruis'n USA (E) [!] +CRC=503EA760 E1300E96 +Players=2 +SaveType=Eeprom 4KB + +[00A3E885F8D899646228A21D946B2102] +GoodName=Cruis'n USA (U) (V1.0) [!] +CRC=FF2F2FB4 D161149A +Players=2 +SaveType=Eeprom 4KB + +[190906A8A5F1C1D4909F6374A784ECA4] +GoodName=Cruis'n USA (U) (V1.0) [T+Ita0.40] +CRC=FF2F2FB4 D161149A +RefMD5=00A3E885F8D899646228A21D946B2102 + +[635C94434922DC73C58965004E3F699D] +GoodName=Cruis'n USA (U) (V1.0) [b1] +CRC=FF2F2FB4 D161149A +RefMD5=00A3E885F8D899646228A21D946B2102 + +[D37AB17D3E27ED333704C44DCFAA28E7] +GoodName=Cruis'n USA (U) (V1.0) [b2] +CRC=FF2F2FB4 D161149A +RefMD5=00A3E885F8D899646228A21D946B2102 + +[1D4843F0C69E273A1099A4267BB9F526] +GoodName=Cruis'n USA (U) (V1.0) [b3] +CRC=FF2F2FB4 D161149A +RefMD5=00A3E885F8D899646228A21D946B2102 + +[B0679C685A1FB4D2BA96E4BB941262DE] +GoodName=Cruis'n USA (U) (V1.0) [b4] +CRC=FF2F2FB4 D161149A +RefMD5=00A3E885F8D899646228A21D946B2102 + +[A8D5B5F1902AFB1346D97A9D0D52B292] +GoodName=Cruis'n USA (U) (V1.0) [b5] +CRC=FF2F2FB4 D161149A +RefMD5=00A3E885F8D899646228A21D946B2102 + +[45FC88E2BA6711F25F0DE988E719DF29] +GoodName=Cruis'n USA (U) (V1.1) [!] +CRC=5306CF45 CBC49250 +Players=2 +SaveType=Eeprom 4KB + +[2838A9018AD2BCB8B7F6161C746A1B71] +GoodName=Cruis'n USA (U) (V1.2) [!] +CRC=B3402554 7340C004 +Players=2 +SaveType=Eeprom 4KB + +[AF950A1B6C460D7FC3E78375D35047EF] +GoodName=Cruis'n World (E) [!] +CRC=83F3931E CB72223D +SaveType=Eeprom 16KB +Players=4 + +[626478CC0790B1452045A3D853B46C18] +GoodName=Cruis'n World (E) [b1] +CRC=312E2FC5 CB76AB4D +RefMD5=AF950A1B6C460D7FC3E78375D35047EF + +[942A09966EC752A5EE81D042AF11D4BB] +GoodName=Cruis'n World (E) [b2] +CRC=AFF44E2D 2ECB9679 +RefMD5=AF950A1B6C460D7FC3E78375D35047EF + +[B22A6E184CB0657882CB4D6A81534254] +GoodName=Cruis'n World (E) [f1] +CRC=AFF44E2D 2ECB9679 +RefMD5=AF950A1B6C460D7FC3E78375D35047EF + +[0BD71426A0240CA4D871A8F54B7761F0] +GoodName=Cruis'n World (E) [f2] +CRC=AFF44E2D 2ECB9679 +RefMD5=AF950A1B6C460D7FC3E78375D35047EF + +[12CE267F5D538C2959BDEBA5E87BDE79] +GoodName=Cruis'n World (E) [f3] (NTSC) +CRC=AF3E4E2D 9C63E651 +RefMD5=AF950A1B6C460D7FC3E78375D35047EF + +[AADA4CBD938E58A447B399A1D46F03E6] +GoodName=Cruis'n World (U) [!] +CRC=DFE61153 D76118E6 +SaveType=Eeprom 16KB +Players=4 + +[B97C963235635672CBEAB35154DFDFA2] +GoodName=Cruis'n World (U) [b1] +CRC=E2A32049 46E8F8E2 +RefMD5=AADA4CBD938E58A447B399A1D46F03E6 + +[82C6213EF921BF2805B3CA7CA4F08BFB] +GoodName=Cruis'n World (U) [b2] +CRC=E2A32049 46E8F8E2 +RefMD5=AADA4CBD938E58A447B399A1D46F03E6 + +[63DA3150AC7B603187DE3951A3270F6E] +GoodName=Cruis'n World (U) [b3] +CRC=DFE61153 D76118E6 +RefMD5=AADA4CBD938E58A447B399A1D46F03E6 + +[4BCDE237F4A390A564369696D0579760] +GoodName=Cruis'n World (U) [f1] +CRC=E2A32049 46E8F8E2 +RefMD5=AADA4CBD938E58A447B399A1D46F03E6 + +[AD4A781024E29F4A735CB4B87F2D59DB] +GoodName=Cruis'n World (U) [o1] +CRC=DFE61153 D76118E6 +RefMD5=AADA4CBD938E58A447B399A1D46F03E6 + +[8D4DAA86BF542D8A55460F56C52F7D02] +GoodName=Cube Demo (PD) +CRC=0E3ED77B 8E1C26FD + +[6F936ECE2BA8EA8C74BDBBA9BDA1407A] +GoodName=Cube Demo (PD) [b1] +CRC=0E3ED77B 8E1C26FD +RefMD5=8D4DAA86BF542D8A55460F56C52F7D02 + +[9A3014ED85F796CCB836E85E78D2618A] +GoodName=Cube Demo (PD) [b2] +CRC=0E3ED77B 8E1C26FD +RefMD5=8D4DAA86BF542D8A55460F56C52F7D02 + +[827CFFD3648116511ED2D5DA76C83FBB] +GoodName=Cube Demo by Msftug (PD) +CRC=37BDF228 92CF779C + +[A06D2E83CF2628915E8847F609474661] +GoodName=Custom Robo (J) [!] +CRC=83CB0B87 7E325457 +Players=4 + +[115118DD5E0F02D82BA1BF070A7B78F1] +GoodName=Custom Robo V2 (J) [!] +CRC=079501B9 AB0232AB +Players=4 + +[8C4A4CD472D610CDA5459B3A92F21D30] +GoodName=CyberTiger (E) [!] +CRC=D1A78A07 52A3DD3E +Players=4 +SaveType=Controller Pack + +[88072F30D4F9CF384B2B3A0300649218] +GoodName=CyberTiger (U) [!] +CRC=E8FC8EA1 9F738391 +Players=4 +SaveType=Controller Pack + +[9801AAA87D650C42B021F94D5C34C7A4] +GoodName=DKONG Demo (PD) +CRC=B323E37C BBC35EC4 + +[F0D62C8FD773F55A34EAAC20D3B95F17] +GoodName=DS1 Manager V1.0 by R. Bubba Magillicutty (PD) +CRC=1194FFD2 808C6FB1 + +[4F94D90294D6E5C1FC116E073DD3F542] +GoodName=DS1 Manager V1.1 by R. Bubba Magillicutty (PD) +CRC=D7484C2A 56CFF26D + +[52037ED117D09F46F82C3F72044366E7] +GoodName=DS1 SRAM Manager V1.1 by _Sage_ (PD) +CRC=201DA461 EC0C992B + +[3A1488C2A8A8F2AB9368D7C056EB02A2] +GoodName=Dance Dance Revolution - Disney Dancing Museum (J) [!] +CRC=7188F445 84410A68 +Players=2 + +[0B86FA9259E2B751111A1701091644B1] +GoodName=Dance Dance Revolution - Disney Dancing Museum (J) [o1] +CRC=7188F445 84410A68 +RefMD5=3A1488C2A8A8F2AB9368D7C056EB02A2 + +[885A29B9A52183B96E5D636F2B765231] +GoodName=Dance Dance Revolution - Disney Dancing Museum (J) [o2] +CRC=7188F445 84410A68 +RefMD5=3A1488C2A8A8F2AB9368D7C056EB02A2 + +[4242FDE5B74F22AAF5746459E126121F] +GoodName=Dark Rift (E) [!] +CRC=7ED67CD4 B4415E6D +Players=2 +SaveType=None +Rumble=No + +[0DD2887AF64C5786C1C66877AFCC0B97] +GoodName=Dark Rift (E) [b1] +CRC=7ED67CD4 B4415E6D +RefMD5=4242FDE5B74F22AAF5746459E126121F + +[ECB170EBBFDA0E932C07524040BCC36C] +GoodName=Dark Rift (U) [!] +CRC=A4A52B58 23759841 +Players=2 +SaveType=None +Rumble=No + +[CBFEAD02C508DADFB44A00E7F7ED61B8] +GoodName=Dark Rift (U) [t1] +CRC=DAA66890 ED4CCD04 +RefMD5=ECB170EBBFDA0E932C07524040BCC36C + +[A2A4A0318DAB366A595336B6F80FF3AB] +GoodName=Deadly Arts (U) [!] +CRC=F5363349 DBF9D21B +Players=4 +SaveType=Controller Pack + +[F403FCEB3FCD41BB5830142989FC9486] +GoodName=Deadly Arts (U) [b1] +CRC=F5363349 DBF9D21B +RefMD5=A2A4A0318DAB366A595336B6F80FF3AB + +[C644E318B33C4EBD94695C0C3E1E80FF] +GoodName=Defi au Tetris Magique (F) [!] +CRC=3F66A9D9 9BCB5B00 +SaveType=None +Players=4 + +[772FA166E5DB51EFFC77FB8D832AC4D2] +GoodName=Densha de Go! 64 (J) [!] +CRC=17C54A61 4A83F2E7 +Players=1 + +[BA99C445ADC6994C97FE6463F3E0EC10] +GoodName=Densha de Go! 64 (J) [f1] (PAL) +CRC=CF138879 2A6144CB +RefMD5=772FA166E5DB51EFFC77FB8D832AC4D2 + +[1051E1402EE110F3C5E372C9E1C5B338] +GoodName=Derby Stallion 64 (J) (Beta) +CRC=96BA4EFB C9988E4E + +[7F57463856540104B21A5289312B626F] +GoodName=Derby Stallion 64 (J) [!] +CRC=A5F667E1 DA1FBD1F +Players=4 + +[BDA717ECC8434F12F313342485828B58] +GoodName=Destruction Derby 64 (E) (M3) [!] +CRC=630AA37D 896BD7DB +Players=4 +SaveType=Controller Pack + +[7FCCB47498EEC06E96AE9372247D1E90] +GoodName=Destruction Derby 64 (U) [!] +CRC=DEE584A2 0F161187 +Players=4 +SaveType=Controller Pack + +[02EEF6ED11174664A548626337879E8C] +GoodName=Destruction Derby 64 (U) [f1] (PAL) +CRC=8637C692 CAD23999 +RefMD5=7FCCB47498EEC06E96AE9372247D1E90 + +[825EA802BC3CBA523667B64DD696C597] +GoodName=Destruction Derby 64 (U) [t1] +CRC=8637BEAA 9B0EB296 +RefMD5=7FCCB47498EEC06E96AE9372247D1E90 + +[6D75719BFA6244C4591070D3F7356072] +GoodName=Dexanoid R1 by Protest Design (PD) +CRC=76712159 35666812 +Players=1 +SaveType=None +Status=3 +Rumble=No + +[875FA77726E7CD99BD410E3FC86C7777] +GoodName=Dexanoid R1 by Protest Design (PD) [b1] +CRC=1EDA4DE0 22BF698D +RefMD5=6D75719BFA6244C4591070D3F7356072 + +[CF2276AFD84E06AC780DBA2E0EA4806D] +GoodName=Dexanoid R1 by Protest Design (PD) [f1] (PAL) +CRC=CFEAACE9 1D532607 +RefMD5=6D75719BFA6244C4591070D3F7356072 + +[AE13E575386775E766F0E00AD2A40C9E] +GoodName=Dexanoid R1 by Protest Design (PD) [f2] (PAL) +CRC=3C7AEE05 56099CB6 +RefMD5=6D75719BFA6244C4591070D3F7356072 + +[8E4D5C6D95EFD1C94BB13644F7672909] +GoodName=Dexanoid R1 by Protest Design (PD) [t1] +CRC=0EC580B5 EBEE9C03 +RefMD5=6D75719BFA6244C4591070D3F7356072 + +[54BE265E7B2C28AB92BF1A4130ACB5A2] +GoodName=Dezaemon 3D (J) [!] +CRC=8979169C F189F6A0 +Players=1 + +[01E34CD8A451F0B5AEF93CCF9ADB37AF] +GoodName=Dezaemon 3D (J) [b1] +CRC=8979169C F189F6A0 +RefMD5=54BE265E7B2C28AB92BF1A4130ACB5A2 + +[60A5F3E1E94F696BF5384022247B4059] +GoodName=Dezaemon 3D (J) [b1][t1] +CRC=33487563 AC0AE62A +RefMD5=54BE265E7B2C28AB92BF1A4130ACB5A2 + +[358941CA393F6D7415E99B28D49CCF68] +GoodName=Dezaemon 3D (J) [b2] +CRC=8979169C F189F6A0 +RefMD5=54BE265E7B2C28AB92BF1A4130ACB5A2 + +[108B1A72E6F93E6935E1AD8D619797DB] +GoodName=Dezaemon 3D (J) [t1] +CRC=33487563 AC0AE62A +RefMD5=54BE265E7B2C28AB92BF1A4130ACB5A2 + +[0F0B7B78B345FBF2581D834CB4A81245] +GoodName=Diddy Kong Racing (E) (M3) (V1.0) [!] +CRC=FD73F775 9724755A +Players=4 +SaveType=Eeprom 4KB + +[79748E4E030B047DBAE8252C21305C75] +GoodName=Diddy Kong Racing (E) (M3) (V1.0) [f1] +CRC=85443325 77D72F56 +RefMD5=0F0B7B78B345FBF2581D834CB4A81245 + +[542FED7864218156EA90050013CD048E] +GoodName=Diddy Kong Racing (E) (M3) (V1.0) [o1] +CRC=FD73F775 9724755A +RefMD5=0F0B7B78B345FBF2581D834CB4A81245 + +[6B2BAFE540E0AF052A78E85B992BE999] +GoodName=Diddy Kong Racing (E) (M3) (V1.1) [!] +CRC=596E145B F7D9879F +Players=4 +SaveType=Eeprom 4KB + +[35CF26D4D33717BA730D7978E2F2107D] +GoodName=Diddy Kong Racing (E) (M3) (V1.1) [f1] (Z64) +CRC=D84C17CA 13F8F651 +RefMD5=6B2BAFE540E0AF052A78E85B992BE999 + +[0D68A405BCB04318A294DBEABF1DE063] +GoodName=Diddy Kong Racing (J) [f1] (Z64) +CRC=F389A35A 17785562 +Players=4 +SaveType=Eeprom 4KB + +[10747662A55241B9234CD114C940504F] +GoodName=Diddy Kong Racing (J) +CRC=7435C9BB 39763CF4 +Players=4 +SaveType=Eeprom 4KB + +[4F0E07F0EEAC7E5D7CE3A75461888D03] +GoodName=Diddy Kong Racing (U) (M2) (V1.0) [!] +CRC=53D440E7 7519B011 +Players=4 +SaveType=Eeprom 4KB + +[94D81D14A2D768DD0EDA3A845AFB25CD] +GoodName=Diddy Kong Racing (U) (M2) (V1.0) [T+Bra_EmuBrazil] +CRC=53D440E7 7519B011 +RefMD5=4F0E07F0EEAC7E5D7CE3A75461888D03 + +[49551E729A39F9640058AB5771A49311] +GoodName=Diddy Kong Racing (U) (M2) (V1.0) [b1] +CRC=D5295672 9CB57015 +RefMD5=4F0E07F0EEAC7E5D7CE3A75461888D03 + +[DBE3F0869F817DCD52A5CB9D43BB4FD1] +GoodName=Diddy Kong Racing (U) (M2) (V1.0) [b2] +CRC=D5295672 9CB57015 +RefMD5=4F0E07F0EEAC7E5D7CE3A75461888D03 + +[AB34FECD9A7A1030EC0892328F9CEF8A] +GoodName=Diddy Kong Racing (U) (M2) (V1.0) [b3] +CRC=D5295672 9CB57015 +RefMD5=4F0E07F0EEAC7E5D7CE3A75461888D03 + +[699A6BA5281EA0C83190E9D45C708C26] +GoodName=Diddy Kong Racing (U) (M2) (V1.0) [b4] +CRC=D5295672 9CB57015 +RefMD5=4F0E07F0EEAC7E5D7CE3A75461888D03 + +[F388EE4148A7A4A2C8A815823D23149C] +GoodName=Diddy Kong Racing (U) (M2) (V1.0) [b5] +CRC=D5295672 9CB57015 +RefMD5=4F0E07F0EEAC7E5D7CE3A75461888D03 + +[C980D2C07B98452110A3A8E52DB5DA88] +GoodName=Diddy Kong Racing (U) (M2) (V1.0) [b6] +CRC=D5295672 9CB57015 +RefMD5=4F0E07F0EEAC7E5D7CE3A75461888D03 + +[07703E5A6268EEDF552FE770F24273A7] +GoodName=Diddy Kong Racing (U) (M2) (V1.0) [b7] +CRC=D5295672 9CB57015 +RefMD5=4F0E07F0EEAC7E5D7CE3A75461888D03 + +[A3551578B7298A2E4719A9108E0AA37B] +GoodName=Diddy Kong Racing (U) (M2) (V1.0) [f1] +CRC=D5295672 9CB57015 +RefMD5=4F0E07F0EEAC7E5D7CE3A75461888D03 + +[1236FB3FC8464B559BDEDFA966D6679F] +GoodName=Diddy Kong Racing (U) (M2) (V1.0) [f1][h1C] +CRC=D5295672 9CB57015 +RefMD5=4F0E07F0EEAC7E5D7CE3A75461888D03 + +[A1D47DB4C6B93C78FE55CBFC1BB28D28] +GoodName=Diddy Kong Racing (U) (M2) (V1.0) [f2] +CRC=D5295672 9CB57015 +RefMD5=4F0E07F0EEAC7E5D7CE3A75461888D03 + +[B4E658DFF037706FFB2EB64F1DFDBB3F] +GoodName=Diddy Kong Racing (U) (M2) (V1.0) [f3] +CRC=E9C8E262 A1D5FACA +RefMD5=4F0E07F0EEAC7E5D7CE3A75461888D03 + +[FA94645F1A15ABA440AD0136ED92E9D1] +GoodName=Diddy Kong Racing (U) (M2) (V1.0) [f4] +CRC=2954A98F C2236510 +RefMD5=4F0E07F0EEAC7E5D7CE3A75461888D03 + +[511833A46BE4E00D1B3655C88E278422] +GoodName=Diddy Kong Racing (U) (M2) (V1.0) [o1] +CRC=53D440E7 7519B011 +RefMD5=4F0E07F0EEAC7E5D7CE3A75461888D03 + +[DF4FC3C46307527707F9106E75074829] +GoodName=Diddy Kong Racing (U) (M2) (V1.0) [o1][f1] +CRC=D5295672 9CB57015 +RefMD5=4F0E07F0EEAC7E5D7CE3A75461888D03 + +[422FD8833F865C4A6C17FCAC4450A69E] +GoodName=Diddy Kong Racing (U) (M2) (V1.0) [o2] +CRC=53D440E7 7519B011 +RefMD5=4F0E07F0EEAC7E5D7CE3A75461888D03 + +[B31F8CCA50F31ACC9B999ED5B779D6ED] +GoodName=Diddy Kong Racing (U) (M2) (V1.1) [!] +CRC=E402430D D2FCFC9D +Players=4 +SaveType=Eeprom 4KB + +[FBCCFED51A43B0012CE927CC73D6AADA] +GoodName=Diddy Kong Racing SRAM by Group5 (PD) +CRC=9F35059D 48B7F411 +Players=4 +SaveType=SRAM + +[0E0E920AB13EF13508F5A98CC4CD2FF8] +GoodName=Disney's Donald Duck - Goin' Quackers (U) [!] +CRC=C16C421B A21580F7 +Players=1 +SaveType=Eeprom 4KB + +[BD1DE2FC1CF31096423563A40ECBF933] +GoodName=Disney's Tarzan (E) [!] +CRC=D614E5BF A76DBCC1 +Players=1 +SaveType=Controller Pack + +[AF740B224E5DD0BD09F7254811559ADF] +GoodName=Disney's Tarzan (E) [h1C] +CRC=D614E5BF A76DBCC1 +RefMD5=BD1DE2FC1CF31096423563A40ECBF933 + +[5D82E903F65341487DDC11AF80AD607A] +GoodName=Disney's Tarzan (F) [!] +CRC=001A3BD0 AFB3DE1A +Players=1 +SaveType=Controller Pack + +[DF3CDD959E8C63B45F557FC197CE0E63] +GoodName=Disney's Tarzan (G) [!] +CRC=4C261323 4F295E1A +Players=1 +SaveType=Controller Pack + +[A29E203DDB6293B7D105BF4A2EEEDD1E] +GoodName=Disney's Tarzan (G) [h1C] +CRC=4C261323 4F295E1A +RefMD5=DF3CDD959E8C63B45F557FC197CE0E63 + +[EAE7E0EE5328ED9F13B9CF9990189928] +GoodName=Disney's Tarzan (U) [!] +CRC=CBFE69C7 F2C0AB2A +Players=1 +SaveType=Controller Pack + +[C56AD8ABD0FB5EFEF1FA0229F9A2EFF0] +GoodName=Disney's Tarzan (U) [f1] (PAL) +CRC=988C4CC3 C9F310C5 +RefMD5=EAE7E0EE5328ED9F13B9CF9990189928 + +[CC8B0A9F15B92D68963668A3495A6BF6] +GoodName=Disney's Tarzan (U) [f2] (PAL) +CRC=8BDDD635 EC0E9198 +RefMD5=EAE7E0EE5328ED9F13B9CF9990189928 + +[E9C2B20EA27E6CAB89842AF4D768724E] +GoodName=Disney's Tarzan (U) [t1] +CRC=8BEE2831 D09BC906 +RefMD5=EAE7E0EE5328ED9F13B9CF9990189928 + +[38DCF67CBA39A84108ADF48EE53544B0] +GoodName=Display List Ate My Mind Demo by Kid Stardust (PD) +CRC=887C368D D1663AA2 + +[A92F9FCD93D20778ED8FF15546BB30F5] +GoodName=Doctor V64 BIOS V1.01 +CRC=204F4E4C 59000000 + +[3509A4E21E43CEDBD704F8A1192C31DF] +GoodName=Doctor V64 BIOS V1.02 +CRC=204F4E4C 59000000 + +[A7BD2F54D9646D43A2A4AD388450223B] +GoodName=Doctor V64 BIOS V1.03 +CRC=204F4E4C 59000000 + +[30E25793ACC95529F8C69A55C6679E73] +GoodName=Doctor V64 BIOS V1.04 +CRC=204F4E4C 59000000 + +[9B69D303AFFA2CD9ABA96C21A2C21476] +GoodName=Doctor V64 BIOS V1.05 +CRC=204F4E4C 59000000 + +[ADE88A1544D469D77D4568364EF25319] +GoodName=Doctor V64 BIOS V1.08 +CRC=204F4E4C 59000000 + +[1C0FCFC7B304698F77069A5F31D27DE1] +GoodName=Doctor V64 BIOS V1.09 +CRC=204F4E4C 59000000 + +[A133F08F88F6D49E1D23D051524AD094] +GoodName=Doctor V64 BIOS V1.10 +CRC=204F4E4C 59000000 + +[601E5335E43F83676F9F341B57D03611] +GoodName=Doctor V64 BIOS V1.10r (RBubba Hack) +CRC=204F4E4C 59000000 + +[4AFA73E31031C0F582C11CDA47CC8729] +GoodName=Doctor V64 BIOS V1.11 +CRC=204F4E4C 59000000 + +[AAC7B04083FB1B9AC5B478AD89D8D3BA] +GoodName=Doctor V64 BIOS V1.21 +CRC=00000000 00000000 + +[4EAE45340300293065CEF5B598C0AC6E] +GoodName=Doctor V64 BIOS V1.22 +CRC=00000000 00000000 + +[ED9D2C04A7A0934372216ED8321EA6E3] +GoodName=Doctor V64 BIOS V1.30 +CRC=204F4E4C 59000000 + +[041813684340CE4D988B2EBA341CE5C5] +GoodName=Doctor V64 BIOS V1.31 (Blue) +CRC=204F4E4C 59000000 + +[2DF942636FB2BF924844A8F4129913BE] +GoodName=Doctor V64 BIOS V1.31 +CRC=204F4E4C 59000000 + +[B978DD8BA5F4DAC6850B7D1297EB1F11] +GoodName=Doctor V64 BIOS V1.32 +CRC=00000000 00000000 + +[F015AE0F3AD80975FB21B43EF7F14422] +GoodName=Doctor V64 BIOS V1.33 +CRC=00000000 00000000 + +[F9D9666DE2F946C9A7D6173DFADF9A81] +GoodName=Doctor V64 BIOS V1.33b +CRC=204F4E4C 59000000 + +[E60CE3D4354066CFD80129CB6C2466D5] +GoodName=Doctor V64 BIOS V1.40 +CRC=204F4E4C 59000000 + +[D62566C4A47396BFC97173D8CF468A5D] +GoodName=Doctor V64 BIOS V1.40b +CRC=00000000 00000000 + +[22134E81100D2854323B064EDD98AAC4] +GoodName=Doctor V64 BIOS V1.41 +CRC=204F4E4C 59000000 + +[25D9CDCD8C23AF6559228C4435FF0CB3] +GoodName=Doctor V64 BIOS V1.41b +CRC=00000000 00000000 + +[69A7D3A2F2805BC2FC84DB917F8AF592] +GoodName=Doctor V64 BIOS V1.50 +CRC=204F4E4C 59000000 + +[9516794650A56E60353135BB9A63C872] +GoodName=Doctor V64 BIOS V1.51 +CRC=204F4E4C 59000000 + +[FCB5472F929C8DA0DAED4C0984F8053B] +GoodName=Doctor V64 BIOS V1.52 (CH2 Hack) +CRC=204F4E4C 59000000 + +[27369BF665AD2FE9F23C6C6D202AA5E8] +GoodName=Doctor V64 BIOS V1.52 +CRC=204F4E4C 59000000 + +[941BA29D2945FA5C903FB0FC6491AC62] +GoodName=Doctor V64 BIOS V1.53 +CRC=00000000 00000000 + +[E7C2944774E1610EE6DF7358717B5DA3] +GoodName=Doctor V64 BIOS V1.60 +CRC=00000000 00000000 + +[B85FCEC60C7BEA9106BD9B9C14479EE7] +GoodName=Doctor V64 BIOS V1.61 +CRC=00000000 00000000 + +[D4BC7E3227225E303A7F6491C1DBB4CB] +GoodName=Doctor V64 BIOS V1.70 +CRC=00000000 00000000 + +[BCAC0108F0D521FF5478BA6C50B23774] +GoodName=Doctor V64 BIOS V1.71 +CRC=00000000 00000000 + +[D2DA27872F13C0BBB2D686C495F13499] +GoodName=Doctor V64 BIOS V1.72 +CRC=00000000 00000000 + +[13CD4C03FCA1BC23AE8B57885E76BCA6] +GoodName=Doctor V64 BIOS V1.73 +CRC=00000000 00000000 + +[A2604CB559D289837F718DB02AFEA85E] +GoodName=Doctor V64 BIOS V1.74 (Revive Version) +CRC=00000000 00000000 + +[8B95ABB5F6E71454FE2C415A0787A384] +GoodName=Doctor V64 BIOS V1.74 +CRC=00000000 00000000 + +[83B122B18B98B96A63C6F824833116BC] +GoodName=Doctor V64 BIOS V1.75 +CRC=00000000 00000000 + +[B444CC20AEFAD0DE4A552D8DD0486E82] +GoodName=Doctor V64 BIOS V1.76 +CRC=00000000 00000000 + +[B5D92FF099B3B74C6D0F0D75590EAC36] +GoodName=Doctor V64 BIOS V1.80 +CRC=00000000 00000000 + +[8CD8FDF74A47CA163CD23AE1D01B7E95] +GoodName=Doctor V64 BIOS V1.81 +CRC=00000000 00000000 + +[AAD6807D240FC3FF4FEDAB57135AD458] +GoodName=Doctor V64 BIOS V1.82 +CRC=00000000 00000000 + +[4121DD79CEBF67EBCA1AA2B3A7AED858] +GoodName=Doctor V64 BIOS V1.83 +CRC=00000000 00000000 + +[D3EA654D4679E0BF40BB671CA7D4A7A3] +GoodName=Doctor V64 BIOS V1.90 +CRC=00000000 00000000 + +[CF8B2C134C3FCD5A5D74402D75CA0543] +GoodName=Doctor V64 BIOS V1.91 +CRC=00000000 00000000 + +[0F83626497B7ACC4AAB3EB39CDE893D3] +GoodName=Doctor V64 BIOS V1.92 +CRC=00000000 00000000 + +[6B626C55C99CD12E88A3DB3B52372104] +GoodName=Doctor V64 BIOS V1.93 +CRC=00000000 00000000 + +[483BD87237BB38884E7E22F4981ACFDB] +GoodName=Doctor V64 BIOS V1.94 +CRC=00000000 00000000 + +[553F6E6766B85CB0247E5CA62F515C75] +GoodName=Doctor V64 BIOS V2.00 +CRC=00000000 00000000 + +[A89761018FA98E5C919F4CA0BB3E6001] +GoodName=Doctor V64 BIOS V2.00b +CRC=00000000 00000000 + +[AE36DD0BCC2F515917B0CF52AEE48AC1] +GoodName=Doctor V64 BIOS V2.01 (Red) +CRC=00000000 00000000 + +[0C91C461ED69EC1E93E9E0DEF9053546] +GoodName=Doctor V64 BIOS V2.01 +CRC=00000000 00000000 + +[BA2816F0B775099E42F124E5C43FE30C] +GoodName=Doctor V64 BIOS V2.01b +CRC=00000000 00000000 + +[DDD1958DF0330B79288B51E65E1E36A0] +GoodName=Doctor V64 BIOS V2.02 +CRC=00000000 00000000 + +[5AAA98D1FDF963FB88B3D25476924A04] +GoodName=Doctor V64 BIOS V2.02b +CRC=00000000 00000000 + +[030EAB316DC3A2D33AAC3DE15FDC4473] +GoodName=Doctor V64 BIOS V2.03 (Black) +CRC=00000000 00000000 + +[2F4E88C48823714825F35148F5B5738D] +GoodName=Doctor V64 BIOS V2.03 (Blue) +CRC=00000000 00000000 + +[7F34EB3E1363580FEA95B23A9CB1C3AF] +GoodName=Doctor V64 BIOS V2.03 (Green) +CRC=00000000 00000000 + +[A550DEBDF72B753B52882A1A573560B5] +GoodName=Doctor V64 BIOS V2.03 (Purple) +CRC=00000000 00000000 + +[014A2B82FDF9A72FC5A26A7EAF8F8176] +GoodName=Doctor V64 BIOS V2.03 (Red) +CRC=00000000 00000000 + +[41010B4BFE1F8DB801237B02A9FA265F] +GoodName=Doctor V64 BIOS V2.03 +CRC=00000000 00000000 + +[E8B403A0F0E212FA5C1220AF10D9C379] +GoodName=Donald Duck - Quack Attack (E) (M5) [!] +CRC=3DF17480 193DED5A +Players=1 +SaveType=Eeprom 4KB + +[07C4944DDAAD234F1F6B0B200BEA60B2] +GoodName=Donald Duck - Quack Attack (E) (M5) [b1] +CRC=85E42D70 132BD5C2 +RefMD5=E8B403A0F0E212FA5C1220AF10D9C379 + +[3BAFF04C5DD367F362248DC627D848C1] +GoodName=Donald Duck - Quack Attack (E) (M5) [f1] (NTSC) +CRC=8A5B9018 0A661D8F +RefMD5=E8B403A0F0E212FA5C1220AF10D9C379 + +[118E9CE360B97A6F8DAB2C9F30660BF5] +GoodName=Donkey Kong 64 (E) [!] +CRC=11936D8C 6F2C4B43 +SaveType=Eeprom 4KB +Players=4 +Rumble=Yes + +[428067DC7DB42DFC977A775F0A6E55B1] +GoodName=Donkey Kong 64 (E) [b1] +CRC=11936D8C 6F2C4B43 +RefMD5=118E9CE360B97A6F8DAB2C9F30660BF5 + +[C48C46362602766EA758FAAEED88AF50] +GoodName=Donkey Kong 64 (E) [f1] (Boot&Save) +CRC=1F95CAAA 047FC22A +RefMD5=118E9CE360B97A6F8DAB2C9F30660BF5 + +[7BE2AAB259C437E8BA91FF8E5903837C] +GoodName=Donkey Kong 64 (E) [f1] (Save) +CRC=1F95CAAA 047FC22A +RefMD5=118E9CE360B97A6F8DAB2C9F30660BF5 + +[5B677F4BF93D6578252FCAD2C8CEB637] +GoodName=Donkey Kong 64 (J) [!] +CRC=053C89A7 A5064302 +SaveType=Eeprom 4KB +Players=4 + +[98A5836E3A5DA7BD0B5819E7498ACEA2] +GoodName=Donkey Kong 64 (U) (Kiosk Demo) [!] +CRC=0DD4ABAB B5A2A91E +SaveType=Eeprom 4KB + +[843DB032839BF1AA74759F2E39A2ABDC] +GoodName=Donkey Kong 64 (U) (Kiosk Demo) [b1] +CRC=F5C21403 8FCA0710 +RefMD5=98A5836E3A5DA7BD0B5819E7498ACEA2 + +[34E6B35260F03CA72593FA373E38BBEA] +GoodName=Donkey Kong 64 (U) (Kiosk Demo) [b2] +CRC=0DD4ABAB B5A2A91E +RefMD5=98A5836E3A5DA7BD0B5819E7498ACEA2 + +[3F1A1B941E58FF977EF47B65CE359A26] +GoodName=Donkey Kong 64 (U) (Kiosk Demo) [f1] (PAL) +CRC=F5C21403 8FCA0710 +RefMD5=98A5836E3A5DA7BD0B5819E7498ACEA2 + +[9EC41ABF2519FC386CADD0731F6E868C] +GoodName=Donkey Kong 64 (U) [!] +CRC=EC58EABF AD7C7169 +SaveType=Eeprom 4KB +Players=4 + +[6B4772AA1743FEAC1919618B3FC6B3E1] +GoodName=Donkey Kong 64 (U) [b1] +CRC=EC58EABF AD7C7169 +RefMD5=9EC41ABF2519FC386CADD0731F6E868C + +[4D4483C0CA3B86997E41A7032F6AD25F] +GoodName=Donkey Kong 64 (U) [f1] (Save) +CRC=CE84793D 27ECC1AD +RefMD5=9EC41ABF2519FC386CADD0731F6E868C + +[CED71061B6A8581DC0B95970D522848A] +GoodName=Donkey Kong 64 (U) [f2] +CRC=CE84793D 27ECC1AD +RefMD5=9EC41ABF2519FC386CADD0731F6E868C + +[E56EF244D61B15DBAEF474F9C0C0B23A] +GoodName=Donkey Kong 64 (U) [f3] +CRC=CED986FD 3344AC38 +RefMD5=9EC41ABF2519FC386CADD0731F6E868C + +[190CCCA6526DC4A1F611E3B40F5131C0] +GoodName=Doom 64 (E) [!] +CRC=2C739EAC 9EF77726 +Players=1 +SaveType=Controller Pack + +[B482F51B616F4337F1B3BF5EFDD650D4] +GoodName=Doom 64 (E) [b1] +CRC=2C739EAC 9EF77726 +RefMD5=190CCCA6526DC4A1F611E3B40F5131C0 + +[06F15EF2228C1B1147C41DCCAA07D9DE] +GoodName=Doom 64 (J) [!] +CRC=7AA65B36 FDCEE5AD +Players=1 +SaveType=Controller Pack + +[053BB6D2E14D67F0FB0B509F2A6B4485] +GoodName=Doom 64 (J) [b1] +CRC=7AA65B36 FDCEE5AD +RefMD5=06F15EF2228C1B1147C41DCCAA07D9DE + +[B67748B64A2CC7EFD2F3AD4504561E0E] +GoodName=Doom 64 (U) (V1.0) [!] +CRC=A83E101A E937B69D +Players=1 +SaveType=Controller Pack + +[BF710F7D1D51EC89AC3F58022B2B5D7F] +GoodName=Doom 64 (U) (V1.0) [T+Bra1.0_Doom64BR] +CRC=B01A1DAB 7F7827E3 +RefMD5=B67748B64A2CC7EFD2F3AD4504561E0E + +[6EACFE4F39265F24FB8145FDED8272F6] +GoodName=Doom 64 (U) (V1.0) [b1] +CRC=A83E101A E937B69D +RefMD5=B67748B64A2CC7EFD2F3AD4504561E0E + +[81FD532B1C7C2CCD687E56696E073C83] +GoodName=Doom 64 (U) (V1.0) [b2] +CRC=A83E101A E937B69D +RefMD5=B67748B64A2CC7EFD2F3AD4504561E0E + +[7497ADADADA89230827C06E4BFFBBBD8] +GoodName=Doom 64 (U) (V1.0) [o1] +CRC=A83E101A E937B69D +RefMD5=B67748B64A2CC7EFD2F3AD4504561E0E + +[4DC885150DFEC67ACDD807F9FFE9596E] +GoodName=Doom 64 (U) (V1.0) [t1] +CRC=13D0EE29 D57A41AD +RefMD5=B67748B64A2CC7EFD2F3AD4504561E0E + +[29E85B9D9072AC232CEB87EFE826269A] +GoodName=Doom 64 (U) (V1.0) [t2] +CRC=13D0EE29 D57A41AD +RefMD5=B67748B64A2CC7EFD2F3AD4504561E0E + +[1B1378BB9EE819F740550F566745AF73] +GoodName=Doom 64 (U) (V1.1) [!] +CRC=423E96F4 CE88F05B +Players=1 +SaveType=Controller Pack + +[C2166455E94E89E9E3AB612B4377C443] +GoodName=Doraemon - Nobita to 3tsu no Seireiseki (J) [!] +CRC=BFF7B1C2 AEBF148E +Players=4 + +[989E7B15D24649B784813E1A07DF6887] +GoodName=Doraemon - Nobita to 3tsu no Seireiseki (J) [b1] +CRC=BFF7B1C2 AEBF148E +RefMD5=C2166455E94E89E9E3AB612B4377C443 + +[7E0DA017551101DA1C4FB6A0C49A2328] +GoodName=Doraemon - Nobita to 3tsu no Seireiseki (J) [b2] +CRC=BFF7B1C2 AEBF148E +RefMD5=C2166455E94E89E9E3AB612B4377C443 + +[BE0000D3415787F9920E178942C297C5] +GoodName=Doraemon - Nobita to 3tsu no Seireiseki (J) [b3] +CRC=BFF7B1C2 AEBF148E +RefMD5=C2166455E94E89E9E3AB612B4377C443 + +[C2909D5799099819E9A7ECE3CD4737FC] +GoodName=Doraemon - Nobita to 3tsu no Seireiseki (J) [t1] +CRC=55C0515C 901DA4A7 +RefMD5=C2166455E94E89E9E3AB612B4377C443 + +[0580D96A71671C9E6972FDCF5897CC26] +GoodName=Doraemon 2 - Nobita to Hikari no Shinden (J) [!] +CRC=B6306E99 B63ED2B2 +SaveType=Eeprom 16KB +Players=1 + +[7CC16A6090CAC3749DD6B71CA7A58605] +GoodName=Doraemon 2 - Nobita to Hikari no Shinden (J) [b1] +CRC=B6306E99 B63ED2B2 +RefMD5=0580D96A71671C9E6972FDCF5897CC26 + +[5A28008B05923016EA411BACE06EF32A] +GoodName=Doraemon 2 - Nobita to Hikari no Shinden (J) [b2] +CRC=4E30BD3A B77D6DFB +RefMD5=0580D96A71671C9E6972FDCF5897CC26 + +[7E4BCA92DA50145C9906B2A72F9351B5] +GoodName=Doraemon 2 - Nobita to Hikari no Shinden (J) [f1] (PAL) +CRC=4E30BD3A B77D6DFB +RefMD5=0580D96A71671C9E6972FDCF5897CC26 + +[58ADC17903754FEBF77DC9CD3DB8B7D8] +GoodName=Doraemon 2 - Nobita to Hikari no Shinden (J) [f2] +CRC=4E30BD3A B77D6DFB +RefMD5=0580D96A71671C9E6972FDCF5897CC26 + +[BEFA319919474BAE05DFCB570CC0CF31] +GoodName=Doraemon 2 - Nobita to Hikari no Shinden (J) [t1] +CRC=4ECEB1DE 552B6E88 +RefMD5=0580D96A71671C9E6972FDCF5897CC26 + +[A4A1D490BA67831775FC381B846E2168] +GoodName=Doraemon 3 - Nobita no Machi SOS! (J) [!] +CRC=A8275140 B9B056E8 +SaveType=Eeprom 16KB +Players=1 + +[FB7565FE1EAAED1CACFAE3B011FA6CB6] +GoodName=Doraemon 3 - Nobita no Machi SOS! (J) [f1] (PAL-NTSC) +CRC=D8059804 92739B11 +RefMD5=A4A1D490BA67831775FC381B846E2168 + +[A4F7C57C180297B2E7BA5A5FEB44FE0B] +GoodName=Doubutsu no Mori (J) [!] +CRC=BD8E206D 98C35E1C +Players=1 + +[0AA8E4B96EBB5B8A5CF91CFB04BC3741] +GoodName=Doubutsu no Mori (J) [T+Eng2007-03-22_Brandon Dixon] +CRC=BD8E206D 98C35E1C +RefMD5=A4F7C57C180297B2E7BA5A5FEB44FE0B + +[7C58DB7EE170912A2DF84E67A489058A] +GoodName=Doubutsu no Mori (J) [T-Eng2007-02-08_Brandon Dixon] +CRC=BD8E206D 98C35E1C +RefMD5=A4F7C57C180297B2E7BA5A5FEB44FE0B + +[5E2A5C56CA1A0CCAEA3AE5F852E0C58D] +GoodName=Doubutsu no Mori (J) [T-Eng2007-02-09_Brandon Dixon] +CRC=BD8E206D 98C35E1C +RefMD5=A4F7C57C180297B2E7BA5A5FEB44FE0B + +[1A7936367413E5D6874ABDA6D623AD32] +GoodName=Dr. Mario 64 (U) [!] +CRC=769D4D13 DA233FFE +Players=4 + +[0AD0800D351F77EC31092096D58C25F0] +GoodName=Dragon King by CrowTRobo (PD) [b1] +CRC=19E0E54C CB721FD2 + +[944ECED50E57D46779576F732CB27DC0] +GoodName=Dragon King by CrowTRobo (PD) +CRC=19E0E54C CB721FD2 + +[F120FADB52B414EB4FB7D13092AC3CDB] +GoodName=Dual Heroes (E) [!] +CRC=B6524461 ED6D04B1 +SaveType=Controller Pack +Players=4 + +[B01D031BE1789565E2B8A44CD76B96C6] +GoodName=Dual Heroes (E) [b1] +CRC=B6524461 ED6D04B1 +RefMD5=F120FADB52B414EB4FB7D13092AC3CDB + +[DFEBF3A9570B95D95CA6BE2CE8311D1D] +GoodName=Dual Heroes (E) [b2] +CRC=B6524461 ED6D04B1 +RefMD5=F120FADB52B414EB4FB7D13092AC3CDB + +[B406AD1694D65725FD31A054F6ECE213] +GoodName=Dual Heroes (E) [f1] (NTSC) +CRC=926C2E3B 9829A216 +RefMD5=F120FADB52B414EB4FB7D13092AC3CDB + +[E7652ED5CECEB5B1BC14495C58546D1C] +GoodName=Dual Heroes (J) [!] +CRC=056EAB63 C215FCD5 +Players=4 +SaveType=Controller Pack + +[A7D3E42EFFD6E7935DA7C9A6B6899CAC] +GoodName=Dual Heroes (J) [o1] +CRC=056EAB63 C215FCD5 +RefMD5=E7652ED5CECEB5B1BC14495C58546D1C + +[54C610270D3F5EEA39BC6A8F73B3B909] +GoodName=Dual Heroes (J) [o2] +CRC=056EAB63 C215FCD5 +RefMD5=E7652ED5CECEB5B1BC14495C58546D1C + +[923D65E69F51858C697E0E5759CD038B] +GoodName=Dual Heroes (U) [!] +CRC=A62230C3 F0834488 +Players=4 +SaveType=Controller Pack + +[E3EF8D7ACCA9CCB551C26B0F879E6B25] +GoodName=Dual Heroes (U) [b1] +CRC=A62230C3 F0834488 +RefMD5=923D65E69F51858C697E0E5759CD038B + +[02192B4B3797983BBE5E452336584208] +GoodName=Duck Dodgers Starring Daffy Duck (U) (M3) [!] +CRC=FBB9F1FA 6BF88689 +Players=4 + +[B5A5A71483679DCCACBDA770647A9DBF] +GoodName=Duck Dodgers Starring Daffy Duck (U) (M3) [t1] +CRC=83E7E0D2 B5B7E503 +RefMD5=02192B4B3797983BBE5E452336584208 + +[86E98AACA0D90BF744DA090539BA4AD8] +GoodName=Duke Nukem - ZER0 H0UR (E) [!] +CRC=DC36626A 3F3770CB +Players=4 +SaveType=Controller Pack + +[51A1EEE441240229BEB2E6CD8FAB285C] +GoodName=Duke Nukem - ZER0 H0UR (E) [f1] (NTSC) +CRC=0BD8008B 26051E1D +RefMD5=86E98AACA0D90BF744DA090539BA4AD8 + +[E2B73FEB0843874EA831A2E0076FCB72] +GoodName=Duke Nukem - ZER0 H0UR (F) [!] +CRC=32CA974B B2C29C50 +Players=4 +SaveType=Controller Pack + +[026789D47DB5FE202A76F89797B33AC7] +GoodName=Duke Nukem - ZER0 H0UR (U) [!] +CRC=04DAF07F 0D18E688 +Players=4 +SaveType=Controller Pack + +[69ED326664E48BAA9CE743E6E9C450DA] +GoodName=Duke Nukem - ZER0 H0UR (U) [b1] +CRC=04DAF07F 0D18E688 +RefMD5=026789D47DB5FE202A76F89797B33AC7 + +[75239D11AEE906C9ABEA752BA1E2AA00] +GoodName=Duke Nukem - ZER0 H0UR (U) [b2] +CRC=BCEAF9B7 F84FF876 +RefMD5=026789D47DB5FE202A76F89797B33AC7 + +[4446E99E8D43E1B7557412ACEA918F68] +GoodName=Duke Nukem - ZER0 H0UR (U) [b3] +CRC=BCEAF9B7 F84FF876 +RefMD5=026789D47DB5FE202A76F89797B33AC7 + +[BD4E03620567C6291F11B9217AC67C28] +GoodName=Duke Nukem - ZER0 H0UR (U) [b4] +CRC=04DAF07F 0D18E688 +RefMD5=026789D47DB5FE202A76F89797B33AC7 + +[A3D49AAC6BC8EEA0D707042A68D2D48C] +GoodName=Duke Nukem - ZER0 H0UR (U) [t1] +CRC=BCEAF9B7 F84FF876 +RefMD5=026789D47DB5FE202A76F89797B33AC7 + +[8657CBA95C409B74C1F5632CBC36643F] +GoodName=Duke Nukem 64 (E) [!] +CRC=57BFF74D DE747743 +Players=4 +SaveType=Controller Pack + +[A6AC9D140112BD7A3AA8A5ABA79EBD88] +GoodName=Duke Nukem 64 (E) [b1] +CRC=57BFF74D DE747743 +RefMD5=8657CBA95C409B74C1F5632CBC36643F + +[31F08F1D2F789C5D698B7E05F287E7AE] +GoodName=Duke Nukem 64 (E) [o1] +CRC=57BFF74D DE747743 +RefMD5=8657CBA95C409B74C1F5632CBC36643F + +[E2E79C7167BDB26E176D220904739C91] +GoodName=Duke Nukem 64 (F) +CRC=1E12883D D3B92718 +Players=4 +SaveType=Controller Pack + +[C7F1A43764A26DA2E43F2A36A5F76E4C] +GoodName=Duke Nukem 64 (U) [!] +CRC=A273AB56 DA33DB9A +Players=4 +SaveType=Controller Pack + +[9BE63892A2AA2B20B75B3AC4E7B7DCDF] +GoodName=Duke Nukem 64 (U) [b1] +CRC=3F84EB47 141964BF +RefMD5=C7F1A43764A26DA2E43F2A36A5F76E4C + +[685EB7D3D1F2C82932EDF7B476A6E21B] +GoodName=Duke Nukem 64 (U) [b2] +CRC=A273AB56 DA33DB9A +RefMD5=C7F1A43764A26DA2E43F2A36A5F76E4C + +[D13D7E9AA29D972CB93C39A15F304FAA] +GoodName=Duke Nukem 64 (U) [b3] +CRC=A273AB56 DA33DB9A +RefMD5=C7F1A43764A26DA2E43F2A36A5F76E4C + +[82FE3916997DA14A02C2301AC2B5E321] +GoodName=Duke Nukem 64 (U) [h1C] +CRC=A273AB56 DA33DB9A +RefMD5=C7F1A43764A26DA2E43F2A36A5F76E4C + +[6F14B999499E90761D8444F784564AB3] +GoodName=Duke Nukem 64 (U) [o1] +CRC=A273AB56 DA33DB9A +RefMD5=C7F1A43764A26DA2E43F2A36A5F76E4C + +[557F89A263B2028936753956F7902299] +GoodName=Duke Nukem 64 (U) [t1] +CRC=3F84EB47 141964BF +RefMD5=C7F1A43764A26DA2E43F2A36A5F76E4C + +[A6DF7D8C1E2DAB58496EF633AC09366E] +GoodName=Duke Nukem 64 (U) [t2] +CRC=3F84EB47 141964BF +RefMD5=C7F1A43764A26DA2E43F2A36A5F76E4C + +[8B7E6FF3453F660DCFC7B968E622E7C9] +GoodName=Duke Nukem 64 (U) [t3] +CRC=3F84EB47 141964BF +RefMD5=C7F1A43764A26DA2E43F2A36A5F76E4C + +[9A008AF4E90D7C55F21039F4E82170EF] +GoodName=Dynamix Intro (Hidden Song) by Widget and Immortal (PD) +CRC=B8E73356 040E42EC + +[5809670A42CA34D39A39598EFA82F5F3] +GoodName=Dynamix Intro by Widget and Immortal (PD) +CRC=086E91C9 89F47C51 +Players=0 +Status=3 +Rumble=No +SaveType=None + +[E06B804B5A8809C42E99B229106CC813] +GoodName=Dynamix Readme by Widget and Immortal (PD) +CRC=186CC1A9 A0DE4C8D +RefMD5=5809670A42CA34D39A39598EFA82F5F3 + +[F32E61E30C5BC232A01E52F8BC2EEF07] +GoodName=Dynamix Intro by Widget and Immortal (PD) [h1C] +CRC=086E91C9 89F47C51 +RefMD5=5809670A42CA34D39A39598EFA82F5F3 + +[1830EDE2557E8685E6F76D05CC65076A] +GoodName=ECW Hardcore Revolution (E) [!] +CRC=8C38E5DB B37C27D7 +SaveType=Controller Pack +Players=4 + +[91545C2642DB6349B8D18BF0BEE29162] +GoodName=ECW Hardcore Revolution (E) [b1] +CRC=8C38E5DB B37C27D7 +RefMD5=1830EDE2557E8685E6F76D05CC65076A + +[8EEBB16B7A4D39AE8BC8CCCBC41F0A01] +GoodName=ECW Hardcore Revolution (U) [!] +CRC=BDF9766D BD068D70 +Players=4 +SaveType=Controller Pack + +[BF2DF4B86FAA2181A7ACFE2643FA2293] +GoodName=Earthworm Jim 3D (E) (M6) [!] +CRC=492B9DE8 C6CCC81C +Players=1 +SaveType=Eeprom 4KB + +[97EA079ECF105EA16654A855644D870A] +GoodName=Earthworm Jim 3D (E) (M6) [b1] +CRC=492B9DE8 C6CCC81C +RefMD5=BF2DF4B86FAA2181A7ACFE2643FA2293 + +[980DFB38AD9A883119DE135F45B7DB36] +GoodName=Earthworm Jim 3D (U) [!] +CRC=DF574191 9EB5123D +Players=1 +SaveType=Eeprom 4KB + +[554EE4BF15388DDE586DE90AC72EF5FA] +GoodName=Earthworm Jim 3D (U) [T+Rus] +CRC=34DBB6CF EA06789D +RefMD5=980DFB38AD9A883119DE135F45B7DB36 + +[B27336A278658AC6D62AB6C4C3FB1DB6] +GoodName=Earthworm Jim 3D (U) [f1] (PAL) +CRC=04853364 948ACF82 +RefMD5=980DFB38AD9A883119DE135F45B7DB36 + +[6B870EBEDCBD81B9FF369008F904C1CD] +GoodName=Earthworm Jim 3D (U) [hI] +CRC=04842D98 1A9FF551 +RefMD5=980DFB38AD9A883119DE135F45B7DB36 + +[60F0CBE10DCE67FDD6527A78B51DCCBC] +GoodName=Earthworm Jim 3D (U) [t1] +CRC=0484CD98 1AFE0B59 +RefMD5=980DFB38AD9A883119DE135F45B7DB36 + +[935DD85AD198BBDE92161CDCE47CBFB3] +GoodName=Eikou no Saint Andrews (J) [!] +CRC=0DED0568 1502515E +Players=4 + +[936DB74AE766BB1219E8A712F0D06E4A] +GoodName=Eikou no Saint Andrews (J) [b1] +CRC=0DED0568 1502515E +RefMD5=935DD85AD198BBDE92161CDCE47CBFB3 + +[0F7C52AD7C7C88103960F44FCD0B119A] +GoodName=Eikou no Saint Andrews (J) [b2] +CRC=0DED0568 1502515E +RefMD5=935DD85AD198BBDE92161CDCE47CBFB3 + +[08CCA8D372EA8C38148F77AB5A03354D] +GoodName=Eikou no Saint Andrews (J) [h1C] +CRC=0DED0568 1502515E +RefMD5=935DD85AD198BBDE92161CDCE47CBFB3 + +[CEC824B5DA28B974B1562338EB728805] +GoodName=Eikou no Saint Andrews (J) [h2C] +CRC=0DED0568 1502515E +RefMD5=935DD85AD198BBDE92161CDCE47CBFB3 + +[15DF97A59B2354B130DEC3FB86BBA513] +GoodName=Elmo's Letter Adventure (U) [!] +CRC=F2A653CB 60633B3B +SaveType=None +Players=1 + +[F733453ED26AFA0ACA8D3EB3B5B6D8EA] +GoodName=Elmo's Number Journey (U) [!] +CRC=02B1538F C94B88D0 +Players=1 +SaveType=None + +[D42CC78A2BF0D34518B8E0D0439E432E] +GoodName=Eltale Monsters (J) [!] +CRC=E13AE2DC 4FB65CE8 +Players=4 +SaveType=Controller Pack + +[752EF6D2C2A6DBBB8CBAEFB596412C1D] +GoodName=Eltale Monsters (J) [b1] +CRC=E13AE2DC 4FB65CE8 +RefMD5=D42CC78A2BF0D34518B8E0D0439E432E + +[75A8F25B679A0D148F0D8E1143104845] +GoodName=Eurasia First N64 Intro by Sispeo (PD) +CRC=52F22511 B9D85F75 + +[761DC0DE0913D697ED1F9899948552BB] +GoodName=Eurasia Intro by Ste (PD) [b1] +CRC=52F22511 B9D85F75 + +[F7E6C9CFF1BC16B0DEDA0ECEFC5C3DFB] +GoodName=Eurasia Intro by Ste (PD) +CRC=93A94333 5A613C39 + +[F1D0406A74AD74BE5891620B7FE6640D] +GoodName=Evek - V64jr Save Manager by WT_Riker (PD) +CRC=D49DFF90 8DB53A8C + +[8FA253FD69B73DF9A831EF2F731491F2] +GoodName=Excitebike 64 (E) [!] +CRC=202A8EE4 83F88B89 +SaveType=Eeprom 16KB +Players=4 + +[BF15A61AFF71C93BF5E05243F57BCA1D] +GoodName=Excitebike 64 (J) [!] +CRC=861C3519 F6091CE5 +SaveType=Eeprom 16KB +Players=4 + +[E0018C33346714B63A55C0E040F23DEA] +GoodName=Excitebike 64 (U) (Kiosk Demo) [!] +CRC=AF754F7B 1DD17381 +SaveType=Eeprom 16KB + +[7200D1C1CF489FAFFF767729F215E6E6] +GoodName=Excitebike 64 (U) [!] +CRC=07861842 A12EBC9F +SaveType=Eeprom 16KB +Players=4 + +[496929EA74183198D121035EA808C480] +GoodName=Excitebike 64 (U) [b1] +CRC=07861842 A12EBC9F +RefMD5=7200D1C1CF489FAFFF767729F215E6E6 + +[48D1FA279FEA4C99CFEEC90E9AD1668F] +GoodName=Excitebike 64 (U) [f1] +CRC=E5B7F405 2C4462BF +RefMD5=7200D1C1CF489FAFFF767729F215E6E6 + +[285D3277D28CA3B9A5A2BE8971CCD767] +GoodName=Excitebike 64 (U) [f2] (Save) +CRC=E5B7F405 2C4462BF +RefMD5=7200D1C1CF489FAFFF767729F215E6E6 + +[6DCFDE0423D1DB58EA9E6A8F1BFFD849] +GoodName=Explode Demo by NaN (PD) +CRC=3E5D6755 9AE4BD3B + +[3B2CA0DA0810C95B31DF8C1FB8811BE2] +GoodName=Extreme-G (E) (M5) [!] +CRC=8E9D834E 1E8B29A9 +Players=4 +SaveType=Controller Pack + +[BF72E10EB79E00E095829112576F01FE] +GoodName=Extreme-G (E) (M5) [b1] +CRC=8E9D834E 1E8B29A9 +RefMD5=3B2CA0DA0810C95B31DF8C1FB8811BE2 + +[A059E27DE410BDA05D8603C22776979F] +GoodName=Extreme-G (E) (M5) [b2] +CRC=8E9D834E 1E8B29A9 +RefMD5=3B2CA0DA0810C95B31DF8C1FB8811BE2 + +[B74A059D227830C606BA79134278F55E] +GoodName=Extreme-G (E) (M5) [b3] +CRC=8E9D834E 1E8B29A9 +RefMD5=3B2CA0DA0810C95B31DF8C1FB8811BE2 + +[2257945EABC008E4D6464196B288D5BF] +GoodName=Extreme-G (E) (M5) [b4] +CRC=8E9D834E 1E8B29A9 +RefMD5=3B2CA0DA0810C95B31DF8C1FB8811BE2 + +[972D0468CEB1221214ADED7181DA7853] +GoodName=Extreme-G (E) (M5) [h1C] +CRC=8E9D834E 1E8B29A9 +RefMD5=3B2CA0DA0810C95B31DF8C1FB8811BE2 + +[A7CD65E5A4A8838D1CD452BA66E74DF6] +GoodName=Extreme-G (J) [!] +CRC=EE802DC4 690BD57D +Players=4 +SaveType=Controller Pack + +[3E660D3F991C0529E90BFEC0244DB31A] +GoodName=Extreme-G (U) [!] +CRC=FDA245D2 A74A3D47 +SaveType=Controller Pack +Players=4 + +[6D954294E254E239B3EA694C2D9ADFF9] +GoodName=Extreme-G (U) [h1C] +CRC=FDA245D2 A74A3D47 +RefMD5=3E660D3F991C0529E90BFEC0244DB31A + +[E5D2C7CE59282C0D716DD67CA787CF7B] +GoodName=Extreme-G (U) [o1] +CRC=FDA245D2 A74A3D47 +RefMD5=3E660D3F991C0529E90BFEC0244DB31A + +[B760D4C35303C74B893F1168415D743D] +GoodName=Extreme-G (U) [t1] +CRC=9FD881BC 0A62D002 +RefMD5=3E660D3F991C0529E90BFEC0244DB31A + +[BB7F98E657FB4B5FCC7DC04BD72E2D2B] +GoodName=Extreme-G XG2 (E) (M5) [!] +CRC=1185EC85 4B5A7731 +Players=4 +SaveType=Controller Pack + +[F17884A2C16FB6FD11A74D65B1388B4A] +GoodName=Extreme-G XG2 (J) [!] +CRC=399B9B81 D533AD11 +Players=4 +SaveType=Controller Pack + +[44FE06BA3686C02A7988F27600A533DA] +GoodName=Extreme-G XG2 (U) [!] +CRC=5CD4150B 470CC2F1 +Players=4 +SaveType=Controller Pack + +[B0F9C3EC65C1C88A43C694EBF429E008] +GoodName=Extreme-G XG2 (U) [t1] +CRC=21910973 0F2E70D2 +RefMD5=44FE06BA3686C02A7988F27600A533DA + +[A6BD93EA576CDF8569F68171452F7E8A] +GoodName=F-1 Pole Position 64 (E) (M3) [!] +CRC=FDD248B2 569A020E +Players=1 +SaveType=Controller Pack + +[ACBB37B24238F82B2333B710CBEE388A] +GoodName=F-1 Pole Position 64 (E) (M3) [b1] +CRC=FDD248B2 569A020E +RefMD5=A6BD93EA576CDF8569F68171452F7E8A + +[049DB657F4223D949F56E9DC5B6A9180] +GoodName=F-1 Pole Position 64 (U) (M3) [!] +CRC=AE82687A 9A3F388D +Players=1 +SaveType=Controller Pack + +[6CE5D16E977B1D4E0E71E209B2932099] +GoodName=F-1 Pole Position 64 (U) (M3) [b1] +CRC=AE82687A 9A3F388D +RefMD5=049DB657F4223D949F56E9DC5B6A9180 + +[C8C14D748679AE6F8FF1A62C4AD3B61E] +GoodName=F-1 Pole Position 64 (U) (M3) [b2] +CRC=AE82687A 9A3F388D +RefMD5=049DB657F4223D949F56E9DC5B6A9180 + +[9E684FDCAC7B5999CC863084DECA463D] +GoodName=F-1 Pole Position 64 (U) (M3) [h1C] +CRC=AE82687A 9A3F388D +RefMD5=049DB657F4223D949F56E9DC5B6A9180 + +[9FBE3363DA6C146EF2E29605BCA834FF] +GoodName=F-1 World Grand Prix (E) [!] +CRC=CC3CC8B3 0EC405A4 +Players=4 +SaveType=Eeprom 4KB + +[08B8942E977A81CAF81DAC2237E1AA65] +GoodName=F-1 World Grand Prix (E) [h1C] +CRC=CC3CC8B3 0EC405A4 +RefMD5=9FBE3363DA6C146EF2E29605BCA834FF + +[35F6C42D5A9284688284C24250F4D6BE] +GoodName=F-1 World Grand Prix (F) [!] +CRC=B70BAEE5 3A5005A8 +Players=4 +SaveType=Eeprom 4KB + +[A8C78454C70BD73375AAF69C4078D5DA] +GoodName=F-1 World Grand Prix (G) [!] +CRC=38442634 66B3F060 +Players=4 +SaveType=Eeprom 4KB + +[AA15FA62A776917E594A17B49BBC6980] +GoodName=F-1 World Grand Prix (G) [b1] +CRC=38442634 66B3F060 +RefMD5=A8C78454C70BD73375AAF69C4078D5DA + +[43115145F2DC0F3D0C6091D05CB9FA52] +GoodName=F-1 World Grand Prix (G) [b1][o1] +CRC=38442634 66B3F060 +RefMD5=A8C78454C70BD73375AAF69C4078D5DA + +[38B0DB4916328672ED592759FFB1F09C] +GoodName=F-1 World Grand Prix (G) [h1C] +CRC=38442634 66B3F060 +RefMD5=A8C78454C70BD73375AAF69C4078D5DA + +[3CEE1895A80005940887C9830B09DDE6] +GoodName=F-1 World Grand Prix (G) [o1] +CRC=38442634 66B3F060 +RefMD5=A8C78454C70BD73375AAF69C4078D5DA + +[6E5858A47CB42F9B1CB26042BA229EF6] +GoodName=F-1 World Grand Prix (G) [o1][h1C] +CRC=38442634 66B3F060 +RefMD5=A8C78454C70BD73375AAF69C4078D5DA + +[F248F0AAE609111BA9DFF9FD7AFBC485] +GoodName=F-1 World Grand Prix (J) [!] +CRC=64BF47C4 F4BD22BA +Players=4 +SaveType=Eeprom 4KB + +[7DFE40E387971269F38FE3CBE803567A] +GoodName=F-1 World Grand Prix (J) [h1C] +CRC=64BF47C4 F4BD22BA +RefMD5=F248F0AAE609111BA9DFF9FD7AFBC485 + +[A81B1DE864DF3F4BB0903760BE673F21] +GoodName=F-1 World Grand Prix (U) [!] +CRC=CC3CC8B3 0EC405A4 +SaveType=Eeprom 4KB +Players=4 + +[4E450DD2899FE7434110E30E19DD10A2] +GoodName=F-1 World Grand Prix (U) [h1C] +CRC=CC3CC8B3 0EC405A4 +RefMD5=A81B1DE864DF3F4BB0903760BE673F21 + +[05426547E5AD9DBF88CF0A401032079D] +GoodName=F-1 World Grand Prix (U) [h2C] +CRC=CC3CC8B3 0EC405A4 +RefMD5=A81B1DE864DF3F4BB0903760BE673F21 + +[BC0FD2468AC7769A37C3C58CD5699585] +GoodName=F-1 World Grand Prix II (E) (M4) [!] +CRC=07C1866E 5775CCDE +Players=4 + +[D9B59E463A73FA880E6682A08D1C3071] +GoodName=F-1 World Grand Prix II (E) (M4) [f1] (NTSC) +CRC=67C38660 94038DC6 +RefMD5=BC0FD2468AC7769A37C3C58CD5699585 + +[E94A9142B1D981A6556747BA147E1A19] +GoodName=F-1 World Grand Prix II (E) (M4) [h1C] +CRC=07C1866E 5775CCDE +RefMD5=BC0FD2468AC7769A37C3C58CD5699585 + +[EE79A8FE287B5DCAEA584439363342FC] +GoodName=F-ZERO X (E) [!] +CRC=776646F6 06B9AC2B +Players=4 +SaveType=SRAM + +[0722E679F9695D9E5F1D2823DC7D8004] +GoodName=F-ZERO X (E) [b1] +CRC=776646F6 06B9AC2B +RefMD5=EE79A8FE287B5DCAEA584439363342FC + +[99DC3FF78356CE77CB240AC7782EE6E5] +GoodName=F-ZERO X (E) [b2] +CRC=DAA6CA7D 56AA4394 +RefMD5=EE79A8FE287B5DCAEA584439363342FC + +[2E95E5833894A6E1E3D109E3B3D809F1] +GoodName=F-ZERO X (E) [b3] +CRC=EC986EA9 EB463E4A +RefMD5=EE79A8FE287B5DCAEA584439363342FC + +[308384EEEB6A88B5B498179E7484944F] +GoodName=F-ZERO X (E) [b4] +CRC=DAA6CA7D 56AA4394 +RefMD5=EE79A8FE287B5DCAEA584439363342FC + +[D1368C0E3869B85947A55C3DA6FFCA10] +GoodName=F-ZERO X (E) [f1] +CRC=DAA6CA7D 56AA4394 +RefMD5=EE79A8FE287B5DCAEA584439363342FC + +[ACE58F325D5EECBE033B21F2C7BFE870] +GoodName=F-ZERO X (E) [h1C] +CRC=776646F6 06B9AC2B +RefMD5=EE79A8FE287B5DCAEA584439363342FC + +[58D200D43620007314304F4E6C9E6528] +GoodName=F-ZERO X (J) [!] +CRC=4D3E622E 9B828B4E +Players=4 +SaveType=SRAM + +[C14AE14C6DE0DCA126C423C4ADBEE315] +GoodName=F-ZERO X (J) [b1] +CRC=076C5C15 BDA9D062 +RefMD5=58D200D43620007314304F4E6C9E6528 + +[E6EC9D86F94CEB2E311F9C23BBD3781F] +GoodName=F-ZERO X (J) [b2] +CRC=076C5C15 BDA9D062 +RefMD5=58D200D43620007314304F4E6C9E6528 + +[6AC12C2D6C0CCDF27C0D5179A500BB2D] +GoodName=F-ZERO X (J) [b3] +CRC=076C5C15 BDA9D062 +RefMD5=58D200D43620007314304F4E6C9E6528 + +[75AEA2B252309552E434B30EDFE72711] +GoodName=F-ZERO X (J) [t1] +CRC=076C5C15 BDA9D062 +RefMD5=58D200D43620007314304F4E6C9E6528 + +[C1CDB77BEA29A4B6F9A0829F8BA8A3F3] +GoodName=F-ZERO X (U) (DXP Track Pack Hack) +CRC=3983D1A9 2004158C + +[753437D0D8ADA1D12F3F9CF0F0A5171F] +GoodName=F-ZERO X (U) [!] +CRC=B30ED978 3003C9F9 +SaveType=SRAM +Players=4 + +[3AE32658B839FFA3189E3CA84E0B884A] +GoodName=F-ZERO X (U) [f1] (Sex V1.0 Hack) +CRC=7E399849 03DAC1CD + +[8363F102FE496B8D06494AA22E183A3E] +GoodName=F-ZERO X (U) [f1] (Sex V1.1 Hack) +CRC=D767D118 A1B07602 + +[7AC3B9A3AA846C439575912811B3E6E0] +GoodName=F-ZERO X (U) [f1] +CRC=B0B4EDFF B2A20628 +RefMD5=753437D0D8ADA1D12F3F9CF0F0A5171F + +[EA168957B644AFE852DA1B827AFC3F9F] +GoodName=F-ZERO X (U) [f2] (GameShark) +CRC=0B46D03D 5FFAE173 +RefMD5=753437D0D8ADA1D12F3F9CF0F0A5171F + +[9581FC6CEAC86DC8A2AEE4053043E422] +GoodName=F1 Racing Championship (E) (M5) [!] +CRC=3CECBCB8 6126BF07 +Players=2 + +[AA951294528CA2CF55F810F9FE433F8D] +GoodName=F1 Racing Championship (E) (M5) [f1] (NTSC) +CRC=67D239A0 960F3A1A +RefMD5=9581FC6CEAC86DC8A2AEE4053043E422 + +[26B18D35984528AE2F90ADBB2F2642F7] +GoodName=FIFA - Road to World Cup 98 (E) (M7) [!] +CRC=0E31EDF0 C37249D5 +Players=4 +SaveType=Controller Pack + +[479554129EB27A3546BAC96C80AF4F88] +GoodName=FIFA - Road to World Cup 98 (E) (M7) [o1] +CRC=0E31EDF0 C37249D5 +RefMD5=26B18D35984528AE2F90ADBB2F2642F7 + +[2C6D146A8473511CFCFBBE8518F49D71] +GoodName=FIFA - Road to World Cup 98 (U) (M7) [!] +CRC=CB1ACDDE CF291DF2 +Players=4 +SaveType=Controller Pack + +[4E275B05BABCA9F2CD77749026BEA5ED] +GoodName=FIFA - Road to World Cup 98 (U) (M7) [b1] +CRC=CB1ACDDE CF291DF2 +RefMD5=2C6D146A8473511CFCFBBE8518F49D71 + +[4CAAE8CA91F58D746B6A00BCBC122B87] +GoodName=FIFA - Road to World Cup 98 (U) (M7) [b2] +CRC=CB1ACDDE CF291DF2 +RefMD5=2C6D146A8473511CFCFBBE8518F49D71 + +[217D93B21FEC3A5506DB014BF445B581] +GoodName=FIFA - Road to World Cup 98 (U) (M7) [b3] +CRC=CB1ACDDE CF291DF2 +RefMD5=2C6D146A8473511CFCFBBE8518F49D71 + +[4421F891F0BA3CC7AA0FD566A162F2C8] +GoodName=FIFA - Road to World Cup 98 (U) (M7) [b4] +CRC=CB1ACDDE CF291DF2 +RefMD5=2C6D146A8473511CFCFBBE8518F49D71 + +[0B8303E33B3F6E57531FB8EB3FAE65E9] +GoodName=FIFA - Road to World Cup 98 (U) (M7) [o1] +CRC=CB1ACDDE CF291DF2 +RefMD5=2C6D146A8473511CFCFBBE8518F49D71 + +[3611779F29997267622CBC80E2D087CC] +GoodName=FIFA - Road to World Cup 98 - World Cup heno Michi (J) [!] +CRC=F5733C67 17A3973A +Players=4 +SaveType=Controller Pack + +[6432C622C05EA9CD3217E280AC2CE37C] +GoodName=FIFA 99 (E) (M8) [!] +CRC=0198A651 FC219D84 +Players=4 +SaveType=Controller Pack + +[940FFB6C94F84BFFD972A69ED86DD2FD] +GoodName=FIFA 99 (E) (M8) [hI] +CRC=F82C85BE DEB717E2 +RefMD5=6432C622C05EA9CD3217E280AC2CE37C + +[148DE3073727B9FD156F10AFADD46864] +GoodName=FIFA 99 (U) [!] +CRC=7613A630 3ED696F3 +Players=4 +SaveType=Controller Pack + +[22082B8D892A2560032FD4DA5AB975A1] +GoodName=FIFA 99 (U) [b1] +CRC=21250314 E6A82CB9 +RefMD5=148DE3073727B9FD156F10AFADD46864 + +[9A7006212947EE7648EE1D13162E55E0] +GoodName=FIFA Soccer 64 (E) (M3) [!] +CRC=C3F19159 65D2BC5A +Players=4 +SaveType=Controller Pack + +[1D71761771E3BFFC091E38B9E8B5E590] +GoodName=FIFA Soccer 64 (E) (M3) [b1] +CRC=C3F19159 65D2BC5A +RefMD5=9A7006212947EE7648EE1D13162E55E0 + +[B5FBF033D76FDE89375D84B8918A5B61] +GoodName=FIFA Soccer 64 (E) (M3) [o1] +CRC=C3F19159 65D2BC5A +RefMD5=9A7006212947EE7648EE1D13162E55E0 + +[084ABA16D84C87712A731D485FCDBE3E] +GoodName=FIFA Soccer 64 (E) (M3) [o2] +CRC=C3F19159 65D2BC5A +RefMD5=9A7006212947EE7648EE1D13162E55E0 + +[376FFEC460443409BC29BB815ABFB42A] +GoodName=FIFA Soccer 64 (E) (M3) [o3] +CRC=C3F19159 65D2BC5A +RefMD5=9A7006212947EE7648EE1D13162E55E0 + +[CF55223F9E3BD118969A34950BEDFD1F] +GoodName=FIFA Soccer 64 (E) (M3) [o4] +CRC=C3F19159 65D2BC5A +RefMD5=9A7006212947EE7648EE1D13162E55E0 + +[CC7C58A032AABA19E72CCBFA6B3EEFF6] +GoodName=FIFA Soccer 64 (U) (M3) [!] +CRC=C3F19159 65D2BC5A +Players=4 +SaveType=Controller Pack + +[CA56F2DE80839EC88750C15A21AA7C53] +GoodName=FIFA Soccer 64 (U) (M3) [b1] +CRC=C3F19159 65D2BC5A +RefMD5=CC7C58A032AABA19E72CCBFA6B3EEFF6 + +[37B24EE746A1EFD54730B5E24551E8CB] +GoodName=FIFA Soccer 64 (U) (M3) [o1] +CRC=C3F19159 65D2BC5A +RefMD5=CC7C58A032AABA19E72CCBFA6B3EEFF6 + +[D99B1A3F6D72DEFD76F3620959B94944] +GoodName=Famista 64 (J) [!] +CRC=6DFF4C37 B1B763FD + +[EACE2271AE7F32A71625C9074115D640] +GoodName=Famista 64 (J) [b1] +CRC=6DFF4C37 B1B763FD + +[FE1B92F6A7E15A1AF367FAD957375B20] +GoodName=Famista 64 (J) [b2] +CRC=6DFF4C37 B1B763FD + +[4C9B2848A2EED723C331973A926488AB] +GoodName=Famista 64 (J) [b3] +CRC=6DFF4C37 B1B763FD + +[35F3928F12DA627DB79EDFC96B93F8D3] +GoodName=Famista 64 (J) [b4] +CRC=6DFF4C37 B1B763FD + +[9213243118ACCE5664D1A35CCDCCD87E] +GoodName=Famista 64 (J) [b5] +CRC=6DFF4C37 B1B763FD + +[155FA36DD3927A73534461B50417325F] +GoodName=Famista 64 (J) [b6] +CRC=6DFF4C37 B1B763FD + +[30413678CE47E1A2EB8DA80AF0D768F5] +GoodName=Famista 64 (J) [b7] +CRC=6DFF4C37 B1B763FD + +[ADAD4FF18E09D2F5B29AA6B5F159EF4E] +GoodName=Famista 64 (J) [o1] +CRC=6DFF4C37 B1B763FD + +[04DD2A319F4F5C22569B612CFDF9F00C] +GoodName=Fighter Destiny 2 (U) [!] +CRC=AEEF2F45 F97E30F1 +Players=2 +SaveType=Controller Pack + +[7B5AFA5D60F53FA640A5F2F24F5B2741] +GoodName=Fighter Destiny 2 (U) [f1] (PAL-NTSC) +CRC=11FBD007 E7029A81 +RefMD5=04DD2A319F4F5C22569B612CFDF9F00C + +[EF5CB24CE3FE4E0F850901205437B574] +GoodName=Fighter's Destiny (E) [!] +CRC=36F1C74B F2029939 +Players=2 +SaveType=Eeprom 4KB + +[44B0BE1C4B48F6119D3AC9424903D0EB] +GoodName=Fighter's Destiny (F) [!] +CRC=0C41F9C2 01717A0D +Players=2 +SaveType=Eeprom 4KB + +[1CF379ACA2397222AF9F3DC5D8E3C444] +GoodName=Fighter's Destiny (G) [!] +CRC=FE94E570 E4873A9C +Players=2 +SaveType=Eeprom 4KB + +[D61D97A7658C419A25A9BAC96B0A3DF8] +GoodName=Fighter's Destiny (U) [!] +CRC=52F78805 8B8FCAB7 +Players=2 +SaveType=Eeprom 4KB + +[6E7C82AFF9F73A3DBF5B18D924BDF103] +GoodName=Fighter's Destiny (U) [b1] +CRC=52F78805 8B8FCAB7 +RefMD5=D61D97A7658C419A25A9BAC96B0A3DF8 + +[5FB4DE8B475C4427F0F30A28C1266CF9] +GoodName=Fighter's Destiny (U) [o1] +CRC=52F78805 8B8FCAB7 +RefMD5=D61D97A7658C419A25A9BAC96B0A3DF8 + +[722C3A74A90305D6079A37994CEBF5B2] +GoodName=Fighting Cup (J) [!] +CRC=49E46C2D 7B1A110C +Players=2 +SaveType=Eeprom 4KB + +[0035E8205336982E362402AAEA37D147] +GoodName=Fighting Force 64 (E) [!] +CRC=66CF0FFE AD697F9C +Players=4 +SaveType=Controller Pack + +[E7008D17FD71D9C2BDA1362C885388B2] +GoodName=Fighting Force 64 (U) [!] +CRC=32EFC7CB C3EA3F20 +Players=4 +SaveType=Controller Pack + +[13962910EFD82C2A2333CF38EE1FCD96] +GoodName=Fighting Force 64 (U) [T+Ita_Cattivik66] +CRC=32EFC7CB C3EA3F20 +RefMD5=E7008D17FD71D9C2BDA1362C885388B2 + +[55868ECCCC14F43BF61032DE21D9F026] +GoodName=Fighting Force 64 (U) [t1] +CRC=655BE931 9FB2E4FB +RefMD5=E7008D17FD71D9C2BDA1362C885388B2 + +[F427033D9184ACA164B971E559C0B420] +GoodName=Fighting Force 64 (U) [t1][f1] (PAL) +CRC=6976748D 1BF61F62 +RefMD5=E7008D17FD71D9C2BDA1362C885388B2 + +[3B86A6C5B478A0D33A6547D3EA276AFE] +GoodName=Fire Demo by Lac (PD) +CRC=8E248649 2E1CDE52 +SaveType=None +Players=0 +Rumble=No +Status=3 + +[75F4A7E5932FB4AE791875E770E51C72] +GoodName=Fireworks Demo by CrowTRobo (PD) +CRC=ECAEC238 EE351DDA + +[BD46DD6275077D5A701482571F5DCDCC] +GoodName=Fish Demo by NaN (PD) +CRC=5CABD891 6229F6CE + +[ADD115AAD0AB7D33BFD243936D809178] +GoodName=Flying Dragon (E) [!] +CRC=22E9623F B60E52AD +SaveType=Controller Pack +Players=4 + +[272B359D8F8AC48ACBF053C262F422E4] +GoodName=Flying Dragon (U) [!] +CRC=A92D52E5 1D26B655 +SaveType=Controller Pack +Players=4 + +[46E9A352AD6AFB83B0557EC659957B2E] +GoodName=Flying Dragon (U) [b1] +CRC=A92D52E5 1D26B655 +RefMD5=272B359D8F8AC48ACBF053C262F422E4 + +[1E672743A9B6B4E9DFB40D4004735F38] +GoodName=Flying Dragon (U) [b2] +CRC=A92D52E5 1D26B655 +RefMD5=272B359D8F8AC48ACBF053C262F422E4 + +[171E55BF4383676C0B8F3D38B0D6A739] +GoodName=Fogworld USA Demo by Horizon64 (PD) [h1C][o1] +CRC=11C646E7 4D86C048 + +[B9A7BEFADFC4C46D61883B012FD2E69F] +GoodName=Fogworld USA Demo by Horizon64 (PD) +CRC=11C646E7 4D86C048 + +[8286DED701DFA22436D311BD5B93BD29] +GoodName=Forsaken 64 (E) (M4) [!] +CRC=142A17AA 13028D96 +Players=4 +SaveType=Controller Pack + +[74650F7154E0B2DD7C364F511B0D6A77] +GoodName=Forsaken 64 (G) [!] +CRC=C3CD76FF 9B9DCBDE +Players=4 +SaveType=Controller Pack + +[F023F3189722A96ACDCF0BDD9154EF11] +GoodName=Forsaken 64 (G) [h1C] +CRC=C3CD76FF 9B9DCBDE +RefMD5=74650F7154E0B2DD7C364F511B0D6A77 + +[B775E4FF0205C405E3AA0A8DF50C54DE] +GoodName=Forsaken 64 (G) [o1] +CRC=C3CD76FF 9B9DCBDE +RefMD5=74650F7154E0B2DD7C364F511B0D6A77 + +[5CDEE5503A57D14533C66B35A5848899] +GoodName=Forsaken 64 (U) [!] +CRC=9E330C01 8C0314BA +Players=4 +SaveType=Controller Pack + +[C61FBF0BE56FBCD8FD373EDFB5D3E538] +GoodName=Forsaken 64 (U) [b1] +CRC=9E330C01 8C0314BA +RefMD5=5CDEE5503A57D14533C66B35A5848899 + +[795F7C1D3D98125C3AEA0FFFE54410DE] +GoodName=Forsaken 64 (U) [t1] +CRC=21FF0391 09F141A1 +RefMD5=5CDEE5503A57D14533C66B35A5848899 + +[ECB92E2663D5B3EEA08A149FC31E3701] +GoodName=Forsaken 64 (U) [t2] +CRC=21FF0391 09F141A1 +RefMD5=5CDEE5503A57D14533C66B35A5848899 + +[A50182B02E3F0D28BE1AC341DDC92DCA] +GoodName=Forsaken 64 (U) [t3] +CRC=5E0C3DF7 8BA027D9 +RefMD5=5CDEE5503A57D14533C66B35A5848899 + +[360DC6BE6D06DCA12E53C077AC0D2571] +GoodName=Fox Sports College Hoops '99 (U) [!] +CRC=3261D479 ED0DBC25 + +[EE0C756F832827E3ACDF6DBD410ADCA4] +GoodName=Fox Sports College Hoops '99 (U) [f1] (PAL) +CRC=3261D429 70AF148E + +[5C4496C6D937364DE0022D1C07BE38A1] +GoodName=Fractal Zoomer Demo by RedboX (PD) +CRC=30E6FE79 3EEA5386 + +[7C87831B28D5E49F4EC2BDAE9D01F3B9] +GoodName=Freekworld BBS Intro by Rene (PD) [a1] +CRC=714001E3 2EB04B67 + +[DE7384A7DA97EEEAEF80CBEFBD17961A] +GoodName=Freekworld BBS Intro by Rene (PD) +CRC=714001E3 2EB04B67 + +[7CCB9B385D1405603E7F645352EA62AA] +GoodName=Freekworld New Intro by Ste (PD) +CRC=69458FFE C9D007AB + +[372F76C0DBE0BE41F5A0A47252869E8E] +GoodName=Friendship Demo by Renderman (PD) [b1] +CRC=CEE5C8CD D3D85466 + +[C18F1C91F6F15971DB18167EB72E6CEF] +GoodName=Friendship Demo by Renderman (PD) +CRC=CEE5C8CD D3D85466 + +[CB2C9C6104C3EF69A1CF979525F2F73D] +GoodName=Frogger 2 (U) (Alpha) [!] +CRC=E8E5B179 44AA30E8 + +[27F61A55E27EA7F1EDE4CA11966ACC7C] +GoodName=Frogger 2 (U) (Alpha) [o1] +CRC=E8E5B179 44AA30E8 + +[FA6CE44ECF86DEC0AFA321D82CD3ED6E] +GoodName=Frogger 2 (U) (Alpha) [o2] +CRC=E8E5B179 44AA30E8 + +[BBCDE4966BEE5602A80D9B8C1011DFA6] +GoodName=Fushigi no Dungeon - Fuurai no Shiren 2 - Oni Shuurai! Shiren Jou! (J) [!] +CRC=F774EAEE F0D8B13E +Players=4 + +[316C59DAE45C20250A0419A937E7D65B] +GoodName=G.A.S.P!! Fighter's NEXTream (E) [!] +CRC=68FCF726 49658CBC +Players=4 +SaveType=Controller Pack + +[6C73558DE5A1EEE6597D7264F9A11B0C] +GoodName=G.A.S.P!! Fighter's NEXTream (J) [!] +CRC=AF8679B6 5E1011BF +Players=4 +SaveType=Controller Pack + +[D7C983F603EE7AE8156C6EAEEF7195C4] +GoodName=G.A.S.P!! Fighter's NEXTream (J) [o1] +CRC=AF8679B6 5E1011BF +RefMD5=6C73558DE5A1EEE6597D7264F9A11B0C + +[F61757BE8ECF0D7068C23CFCE23D2F10] +GoodName=GBlator for CD64 (PD) [f1] (V64-PAL) +CRC=5D1795D2 C0D72338 + +[ECE232D98B095604D1C15F9571DE45F8] +GoodName=GBlator for CD64 (PD) +CRC=5D8B9226 47605A2A + +[E3FDAB4E3C417E623A02875D6A6E7467] +GoodName=GBlator for NTSC Dr V64 (PD) +CRC=5C1AAD1C AF7BF297 + +[0F85543F27896856EB82C52E3C7CCAB5] +GoodName=GBlator for PAL Dr V64 (PD) +CRC=5D0F8DD2 990BE538 + +[628AA3CD492559B705488F634797E045] +GoodName=GT 64 - Championship Edition (E) (M3) [!] +CRC=EE4A0E33 8FD588C9 +SaveType=Eeprom 4KB +Players=4 + +[15DB716942C36A0CB392226001536A2A] +GoodName=GT 64 - Championship Edition (E) (M3) [b1] +CRC=B6A90FB4 E2C235BA +RefMD5=628AA3CD492559B705488F634797E045 + +[6969E979395A0AF64CAF2DF9C1054C94] +GoodName=GT 64 - Championship Edition (E) (M3) [f1] (NTSC) +CRC=B6A90FB4 E2C235BA +RefMD5=628AA3CD492559B705488F634797E045 + +[F3E25D0A7B98E8E25B7570A6E056D33C] +GoodName=GT 64 - Championship Edition (E) (M3) [f2] (NTSC) +CRC=93A292F1 ADF98E2E +RefMD5=628AA3CD492559B705488F634797E045 + +[FE81AA381719FADA693D803BAE7D5EB9] +GoodName=GT 64 - Championship Edition (U) [!] +CRC=C49ADCA2 F1501B62 +Players=4 +SaveType=Eeprom 4KB + +[4695A944B019F3829F2616591659A7CE] +GoodName=GT 64 - Championship Edition (U) [b1] +CRC=C49ADCA2 F1501B62 +RefMD5=FE81AA381719FADA693D803BAE7D5EB9 + +[9B5A92F32B9C807B2A9C01E42EF8F461] +GoodName=GT Demo (PD) [a1] +CRC=2575EF19 D13D2A2C + +[C41F0D1EDD2C8259EB27A8C97CAA3D71] +GoodName=GT Demo (PD) +CRC=2575EF19 D13D2A2C + +[3DE02CF363E4D081530FEF53FDAB5780] +GoodName=Game Boy 64 (POM '98) (PD) (Illegal Mode Enabled) +CRC=97FC2167 4616872B + +[6C36E6A39ABBAB3E9139E9ECBC67E569] +GoodName=Game Boy 64 (POM '98) (PD) +CRC=97FC2167 4616872B + +[47C7DF82B3ADEAE19C8AFACE40FEB1AC] +GoodName=Game Boy 64 + Super Mario 3 (PD) +CRC=60D0A702 432236C6 + +[7AD954ADD3779FB3BE5904D1B935EBFB] +GoodName=GameBooster 64 V1.1 (NTSC) (Unl) [b1] +CRC=1A5C1CAD 7BAF97F2 + +[C60F99DCF6B05FAA2C33970462F93865] +GoodName=GameBooster 64 V1.1 (NTSC) (Unl) [f1] +CRC=5C1AAD1C AF7BF297 + +[60D0264B38E22EF0D6B9549E4C81C29F] +GoodName=GameBooster 64 V1.1 (NTSC) (Unl) +CRC=12678830 4E5AE439 + +[DB02D36555E2473EA3036B8E0868254E] +GoodName=GameBooster 64 V1.1 (PAL) (Unl) [b1] +CRC=D06002A7 2243C636 + +[4C383E57BC1062466328D0B59FB7AA67] +GoodName=GameBooster 64 V1.1 (PAL) (Unl) [f1] (Sound) +CRC=3BCCD2DB 953FA1F5 + +[1A56FE2B2FE339C7DD4FF8D37EC8654B] +GoodName=GameBooster 64 V1.1 (PAL) (Unl) +CRC=12678830 4E5AE439 + +[437EFD7FD7F84F4C0F802D3BF1F8464E] +GoodName=GameShark Pro V2.0 (Unl) +CRC=16FB52A4 7AED1FB3 + +[F275A4216744D8F04B4A0CD74DE53111] +GoodName=GameShark Pro V3.3 (Apr 2000) (Unl) [!] +CRC=EA6D5BF8 E2B4696C + +[9F556D184D945369DDD11B5F815814A8] +GoodName=GameShark Pro V3.3 (Mar 2000) (Unl) [!] +CRC=8F89ABA0 C34C2610 + +[96CA36D474E82C270A129D775C63167A] +GoodName=Ganbare Goemon - Derodero Douchuu Obake Tenkomori (J) [!] +CRC=457B9CD9 09C55352 +SaveType=Controller Pack +Players=4 + +[7EB07675E2E9CB547A3B238AA71F57CC] +GoodName=Ganbare Goemon - Derodero Douchuu Obake Tenkomori (J) [t1] +CRC=BD8E0304 33E3998A +RefMD5=96CA36D474E82C270A129D775C63167A + +[3F50712011BE1CB59B45684D7D61F11E] +GoodName=Ganbare Goemon - Derodero Douchuu Obake Tenkomori (J) [t2] +CRC=A39C0306 F1DD4CC6 +RefMD5=96CA36D474E82C270A129D775C63167A + +[2BDE49F2855030DE342976C9A95B81B3] +GoodName=Ganbare Goemon - Mononoke Sugoroku (J) [!] +CRC=B2C6D27F 2DA48CFD +Players=4 + +[7F4E8F2ECF04BE27E660AC2EFDAC0C68] +GoodName=Ganbare Goemon - Neo Momoyama Bakufu no Odori (J) [b1] +CRC=832C168B 56A2CDAE + +[19BFC2C0124C009B51FE1724B07FAC81] +GoodName=Ganbare Goemon - Neo Momoyama Bakufu no Odori (J) [b2] +CRC=832C168B 56A2CDAE + +[A2B81C0B7E3989152CA90901D05E6352] +GoodName=Ganbare Goemon - Neo Momoyama Bakufu no Odori (J) [h1C] +CRC=832C168B 56A2CDAE + +[A7C82BB5098A7526D5417EE9A8981F48] +GoodName=Ganbare Goemon - Neo Momoyama Bakufu no Odori (J) [h1C][t1] +CRC=7BB5698F D99BF02B + +[9B929E0BF8D63E62820F2FA6257CC5CF] +GoodName=Ganbare Goemon - Neo Momoyama Bakufu no Odori (J) +CRC=832C168B 56A2CDAE + +[8D8F3A8393F3F5489B3B144369565594] +GoodName=Ganbare Nippon! Olympics 2000 (J) [!] +CRC=21FFFD0A FA0D1D98 +Players=4 +SaveType=Controller Pack + +[28C2108A375F7731E719333A09439D2F] +GoodName=Gauntlet Legends (E) [!] +CRC=D543BCD6 2BA5E256 +Players=4 +SaveType=Controller Pack + +[0806E6DB8B2BF0501BE9F2D78D280DCF] +GoodName=Gauntlet Legends (E) [b1] +CRC=D543BCD6 2BA5E256 +RefMD5=28C2108A375F7731E719333A09439D2F + +[3B2615D754A61E45B1034D555D830A78] +GoodName=Gauntlet Legends (J) [!] +CRC=70B0260E 6716D04C +Players=4 +SaveType=Controller Pack + +[9CB963E8B71F18568F78EC1AF120362E] +GoodName=Gauntlet Legends (U) [!] +CRC=729B5E32 B728D980 +Players=4 +SaveType=Controller Pack + +[50F8E73CA0160EB1A339AC2137A7B559] +GoodName=Gauntlet Legends (U) [f1] (PAL) +CRC=AA89A18D 0FC2AFE6 +RefMD5=9CB963E8B71F18568F78EC1AF120362E + +[5270D98F9E67DC7EF354ECE109C2A18F] +GoodName=Getter Love!! (J) [!] +CRC=489C84E6 4C6E49F9 +Players=4 + +[3BE170E7E94A03BD4E36732EB137EE39] +GoodName=Getter Love!! (J) [b1] +CRC=489C84E6 4C6E49F9 +RefMD5=5270D98F9E67DC7EF354ECE109C2A18F + +[1E6573F2A7454C133EB05A14C15909A9] +GoodName=Getter Love!! (J) [b2] +CRC=489C84E6 4C6E49F9 +RefMD5=5270D98F9E67DC7EF354ECE109C2A18F + +[43B9A7A5CCB6EA3F4860F9F80D73669D] +GoodName=Gex 3 - Deep Cover Gecko (E) (M2) (Fre-Ger) [!] +CRC=874733A4 A823745A +Players=1 +SaveType=Controller Pack + +[9F0492A34D7A2D7C4E9F29DC1848A04A] +GoodName=Gex 3 - Deep Cover Gecko (E) (M3) (Eng-Spa-Ita) [!] +CRC=99179359 2FE7EBC3 +Players=1 +SaveType=Controller Pack + +[6770DDEC84EB21A5E0D0F55DFD52A01A] +GoodName=Gex 3 - Deep Cover Gecko (U) [!] +CRC=3EDC7E12 E26C1CC9 +Players=1 +SaveType=Controller Pack + +[6E0FCFF93600A28C379EF52940C54E68] +GoodName=Gex 3 - Deep Cover Gecko (U) [f1] (PAL) +CRC=E68A9F6E 24FB3315 +RefMD5=6770DDEC84EB21A5E0D0F55DFD52A01A + +[EF0988EFDCEA31B88A3920CEEC17B4FF] +GoodName=Gex 3 - Deep Cover Gecko (U) [t1] +CRC=E6896018 6013AD31 +RefMD5=6770DDEC84EB21A5E0D0F55DFD52A01A + +[5BBA457E286D250101CE274E0E58080D] +GoodName=Gex 64 - Enter the Gecko (E) [!] +CRC=E68A000E 639166DD +Players=1 +SaveType=Controller Pack + +[47F9D900C97ECE154BB40A9C6DCCD3FD] +GoodName=Gex 64 - Enter the Gecko (U) [!] +CRC=89FED774 CAAFE21B +Players=1 +SaveType=Controller Pack + +[A33677B04870DE18013B760B4F53F6BF] +GoodName=Gex 64 - Enter the Gecko (U) [f1] (PAL) +CRC=4445612B F8CC9F8B +RefMD5=47F9D900C97ECE154BB40A9C6DCCD3FD + +[68828BDCAAE1C222DABB679B74B8ACD0] +GoodName=Gex 64 - Enter the Gecko (U) [t1] +CRC=71ED5D14 76A110D0 +RefMD5=47F9D900C97ECE154BB40A9C6DCCD3FD + +[3419EC10EE470F1888811D4A9B5FAACE] +GoodName=Ghemor - CD64 Xfer & Save Util (CommsLink) by CrowTRobo (PD) +CRC=2F67DC59 74AAD9F1 + +[20DA03C2098F83A790E929AC9A4CDB2E] +GoodName=Ghemor - CD64 Xfer & Save Util (Parallel) by CrowTRobo (PD) +CRC=0D99E899 43E0FCD1 + +[2F2163C53DB135792331DF00398B3F87] +GoodName=Glover (E) (M3) [!] +CRC=F5237301 99E3EE93 +Players=1 +SaveType=Eeprom 4KB + +[8881FBEAE9B84485CF66876B60CD45DF] +GoodName=Glover (E) (M3) [f1] (NTSC) +CRC=4D2B5318 47DB5316 +RefMD5=2F2163C53DB135792331DF00398B3F87 + +[87AA5740DFF79291EE97832DA1F86205] +GoodName=Glover (U) [!] +CRC=8E6E01FF CCB4F948 +Players=1 +SaveType=Eeprom 4KB + +[A1C34717476027DFBA72EEA56F94D650] +GoodName=Glover (U) [b1] +CRC=0E450FFC 9FFC8375 +RefMD5=87AA5740DFF79291EE97832DA1F86205 + +[873DC63304F632A71B309988C39C48F7] +GoodName=Glover (U) [b2] +CRC=7773E2BB 71D0A925 +RefMD5=87AA5740DFF79291EE97832DA1F86205 + +[87615822A0E00DD4FC7FDF636D4B8139] +GoodName=Glover (U) [t1] +CRC=51938192 BD4A98A1 +RefMD5=87AA5740DFF79291EE97832DA1F86205 + +[29BC5C1A24D3979D376AD421000AC9CB] +GoodName=Goemon's Great Adventure (U) [!] +CRC=4252A5AD AE6FBF4E +Players=4 +SaveType=Controller Pack + +[E048C2FE226634F039882C35A2A4EEA9] +GoodName=Golden Nugget 64 (U) [!] +CRC=4690FB1C 4CD56D44 +Players=4 +SaveType=Controller Pack + +[7CE28ADAB6FE43207B4BB19564C38AEF] +GoodName=Golden Nugget 64 (U) [b1] +CRC=4690FB1C 4CD56D44 +RefMD5=E048C2FE226634F039882C35A2A4EEA9 + +[5340DD96CF1CD7AC6D72000D40B915CE] +GoodName=Golden Nugget 64 (U) [b2] +CRC=4690FB1C 4CD56D44 +RefMD5=E048C2FE226634F039882C35A2A4EEA9 + +[2DB6ED9A6A244CB209FFDF52D9006E4D] +GoodName=Golden Nugget 64 (U) [f1] (PAL) +CRC=438CEBDC 44C1837C +RefMD5=E048C2FE226634F039882C35A2A4EEA9 + +[F68F02A69829469F208D538D7CF4A215] +GoodName=Golden Nugget 64 (U) [h1C] +CRC=4690FB1C 4CD56D44 +RefMD5=E048C2FE226634F039882C35A2A4EEA9 + +[CFF69B70A8AD674A0EFE5558765855C9] +GoodName=GoldenEye 007 (E) [!] +CRC=0414CA61 2E57B8AA +Players=4 +SaveType=Eeprom 4KB +Rumble=No +Status=4 + +[ECD4F078DC77F4B2D12C1C0F5CABA323] +GoodName=GoldenEye 007 (E) [b1] +CRC=0414CA61 2E57B8AA +RefMD5=CFF69B70A8AD674A0EFE5558765855C9 + +[D83BDE156D6FC400C28308A447B8FCA0] +GoodName=GoldenEye 007 (E) [h1C] +CRC=0414CA61 2E57B8AA +RefMD5=CFF69B70A8AD674A0EFE5558765855C9 + +[F7A0EFCF8DB90FBD6FD9BFC570A4804A] +GoodName=GoldenEye 007 (E) [t1] (Rapid Fire) +CRC=540F359D FF327745 +RefMD5=CFF69B70A8AD674A0EFE5558765855C9 + +[1880DA358F875C0740D4A6731E110109] +GoodName=GoldenEye 007 (J) [!] +CRC=A24F4CF1 A82327BA +Players=4 +SaveType=Eeprom 4KB +Rumble=Yes +Status=4 + +[FB916F914D9635F8FCBCE37A6466079D] +GoodName=GoldenEye 007 (J) [t1] (Rapid Fire) +CRC=B244B30C 72A648D8 +RefMD5=1880DA358F875C0740D4A6731E110109 + +[3AA7D5F55E3E5E6C7419CC1625AF69BC] +GoodName=GoldenEye 007 (U) (Frozen Enemies Hack) +CRC=DCBCACD1 D72FAA33 + +[9AB9FB9782C7BB42A48C1465CD8F4EF6] +GoodName=GoldenEye 007 (E) (Citadel Hack) +CRC=44853212 B1F75C3E + +[ECAB0839D3ED0E3AA8516EF1C077CF0D] +GoodName=GoldenEye 007 (U) (Citadel Hack) +CRC=1C6F7718 CBAC1E7E + +[7DD2F0E19E35511C3E1C81D206CDC472] +GoodName=GoldenEye 007 (U) (G5 Multi (for backups) Hack) +CRC=F2C3A524 A1C4DB13 + +[F4AB4CD6A8AF21E8A51BF48578CC7F24] +GoodName=GoldenEye 007 (U) (G5 Multi Hack) +CRC=DCBC50D1 09FD1AA3 + +[FD35D8A9DE0F5AB500A588A6AB5F6FB9] +GoodName=GoldenEye 007 (U) (Tetris Hack) +CRC=A84D23BA A1974DBD + +[3BC50511DE8598A49E79F4CF2E4CF8E0] +GoodName=GoldenEye 007 (U) (God Mode Hack) +CRC=DCBCACD1 E1051EA6 + +[86C6B996A55F90FC2410B16AE4BA5EE0] +GoodName=GoldenEye 007 (U) (No Music Hack) +CRC=DCBCACD1 A67DDFB4 + +[15B57CDECA506B34FF6246ED06AABD50] +GoodName=GoldenEye 007 (U) (No Power Bar Hack) +CRC=DCBCACD1 F294D541 + +[70C525880240C1E838B8B1BE35666C3B] +GoodName=GoldenEye 007 (U) [!] +CRC=DCBC50D1 09FD1AA3 +Players=4 +SaveType=Eeprom 4KB +Rumble=No +Status=4 + +[0B5A50E8D477B3BC53BE997264FE84A5] +GoodName=GoldenEye 007 (U) [b1] +CRC=DCBC50D1 09FD1AA3 +RefMD5=70C525880240C1E838B8B1BE35666C3B + +[C7A22DC5D95EBE1F8EDB0D68C13027C1] +GoodName=GoldenEye 007 (U) [h1C] +CRC=DCBC50D1 09FD1AA3 +RefMD5=70C525880240C1E838B8B1BE35666C3B + +[22FF6C18EB028792EF350554B1E1FA68] +GoodName=GoldenEye 007 (U) [o1] +CRC=DCBC50D1 09FD1AA3 +RefMD5=70C525880240C1E838B8B1BE35666C3B + +[6B8BA063C40420C164AA81ACB6089CB6] +GoodName=GoldenEye 007 (U) [o2] +CRC=DCBC50D1 09FD1AA3 +RefMD5=70C525880240C1E838B8B1BE35666C3B + +[18C00B5C3D9DF09AB9E8A737E61C3B47] +GoodName=GoldenEye 007 (U) [t1] (Rapid Fire) +CRC=E09DAF6C 8A2B86F4 +RefMD5=70C525880240C1E838B8B1BE35666C3B + +[2E50BC853F6EFC1E0D5E4679739F43C4] +GoodName=GoldenEye 007 (U) [t2] +CRC=8E1B3303 9D4F5035 +RefMD5=70C525880240C1E838B8B1BE35666C3B + +[95B784D6DD3470903BAF6BBB533E088B] +GoodName=GoldenEye 007 (U) [t3] (All Guns Zoom Mode) +CRC=1C6F7718 CBAC1E7E +RefMD5=70C525880240C1E838B8B1BE35666C3B + +[AD3D099C84096DBACAD7F1CF982631B2] +GoodName=GoldenEye 007 Intro by SonCrap (PD) +CRC=9303DD17 0813B398 + +[9B8A7541D0234F4D97004ECBC216D9C2] +GoodName=HIPTHRUST by MooglyGuy (PD) +CRC=88A12FB3 8A583CBD + +[821A739790F1D390DC7D4168C5E032DE] +GoodName=HSD Quick Intro (PD) +CRC=BD1263E5 388C9BE7 + +[7B38C3F7DA8D9778B41B0047A133590A] +GoodName=HSV Adventure Racing (A) [b1] +CRC=72611D7D 9919BDD2 + +[8C7AF37A3CB7306EBCCAC4029EB5C57D] +GoodName=HSV Adventure Racing (A) [f1] (NTSC) +CRC=B20CC247 B879579A + +[26F7D8F4640EBDFA823F84E5F89D62BF] +GoodName=HSV Adventure Racing (A) +CRC=72611D7D 9919BDD2 + +[3D4C7B11076BAFA4620BCC154C0EEEF3] +GoodName=Hamster Monogatari 64 (J) [!] +CRC=95A80114 E0B72A7F +Players=1 + +[617197EF2B6B51E58488C9F6B75F112E] +GoodName=Hard Coded Demo by Silo and Fractal (PD) [a1] +CRC=775AFA9C 0EB52EF6 + +[FB8974C6130A6B8585EA98D6661553BC] +GoodName=Hard Coded Demo by Silo and Fractal (PD) +CRC=775AFA9C 0EB52EF6 + +[193913BB063F3D945019E8F765F48F1C] +GoodName=Hard Pom '99 Demo by TS_Garp (POM '99) (PD) +CRC=9856E53D AF483207 + +[A02A4FB4B93E9847348440652CEF8D4D] +GoodName=Harukanaru Augusta Masters 98 (J) [!] +CRC=09AE57B1 182A5637 +Players=1 + +[397A69AA3829EA5FECB4CDF399084E31] +GoodName=Harukanaru Augusta Masters 98 (J) [b1] +CRC=09AE57B1 182A5637 +RefMD5=A02A4FB4B93E9847348440652CEF8D4D + +[FA6B3E3A04DE8D96B2C26F974F59A34D] +GoodName=Harukanaru Augusta Masters 98 (J) [b2] +CRC=09AE57B1 182A5637 +RefMD5=A02A4FB4B93E9847348440652CEF8D4D + +[4454122EC735252E40EC22FF5DE021C6] +GoodName=Harukanaru Augusta Masters 98 (J) [h1C] +CRC=09AE57B1 182A5637 +RefMD5=A02A4FB4B93E9847348440652CEF8D4D + +[6DA848A70D83ECE130D274124760928E] +GoodName=Harvest Moon 64 (U) [!] +CRC=98DF9DFC 6606C189 +Players=1 +SaveType=SRAM + +[3CDD87026EFEC9A03648D225F97858A5] +GoodName=Harvest Moon 64 (U) [T+Pol001] +CRC=98DF9DFC 6606C189 +RefMD5=6DA848A70D83ECE130D274124760928E + +[245FD6D774B74D4703822511CA174A54] +GoodName=Harvest Moon 64 (U) [b1] +CRC=98DF9DFC 6606C189 +RefMD5=6DA848A70D83ECE130D274124760928E + +[218DE5B3709555DA3870CE859D1975E5] +GoodName=Harvest Moon 64 (U) [f1] (PAL) +CRC=6BCF21E8 CAB5AF4F +RefMD5=6DA848A70D83ECE130D274124760928E + +[956AEC111B74720D55496F81ADA0FEFD] +GoodName=Harvest Moon 64 (U) [t1] +CRC=60CC9644 C62AE877 +RefMD5=6DA848A70D83ECE130D274124760928E + +[54AD823812D2C2E8B1688C4ACE2E654D] +GoodName=Harvest Moon 64 (U) [t1][f1] (PAL-NTSC) +CRC=60CC9644 C62AE877 +RefMD5=6DA848A70D83ECE130D274124760928E + +[19F4694B8557BC095EE07B5C8FBD23B5] +GoodName=Heavy 64 Demo by Destop (PD) +CRC=5D391A40 84D7A637 + +[5E8539E037EEA88C5A2746F60E431C8D] +GoodName=Heiwa Pachinko World 64 (J) [!] +CRC=3E70E866 4438BAE8 +Players=1 + +[9D0D85E3A0C94B98D6404E8FC28E7B01] +GoodName=Heiwa Pachinko World 64 (J) [b1] +CRC=3E70E866 4438BAE8 +RefMD5=5E8539E037EEA88C5A2746F60E431C8D + +[C2BEDCB364162D6DAC86548D7721F827] +GoodName=Heiwa Pachinko World 64 (J) [b2] +CRC=3E70E866 4438BAE8 +RefMD5=5E8539E037EEA88C5A2746F60E431C8D + +[3B6994B373BEC6E917F0B834AA6D1A46] +GoodName=Heiwa Pachinko World 64 (J) [b3] +CRC=3E70E866 4438BAE8 +RefMD5=5E8539E037EEA88C5A2746F60E431C8D + +[013E130D0D4F132741AA38D1A397E10A] +GoodName=Heiwa Pachinko World 64 (J) [h1C] +CRC=3E70E866 4438BAE8 +RefMD5=5E8539E037EEA88C5A2746F60E431C8D + +[FDF797C5FFB531FCF04E0A1928691EA3] +GoodName=Heiwa Pachinko World 64 (J) [o1] +CRC=3E70E866 4438BAE8 +RefMD5=5E8539E037EEA88C5A2746F60E431C8D + +[1546877FD85C00A83515005727E5FDA5] +GoodName=Hercules - The Legendary Journeys (E) (M6) [!] +CRC=AE90DBEB 79B89123 + +[6BBD8C42F6EF8F5B9541D6F4DB657DD7] +GoodName=Hercules - The Legendary Journeys (U) [!] +CRC=7F3CEB77 8981030A +Players=1 +SaveType=Controller Pack + +[57D8E020643146B325A11612FEFACF74] +GoodName=Hercules - The Legendary Journeys (U) [o1] +CRC=7F3CEB77 8981030A +RefMD5=6BBD8C42F6EF8F5B9541D6F4DB657DD7 + +[8CF8043BDFA89A2B0C4699D0E695E844] +GoodName=Hercules - The Legendary Journeys (U) [t1][f1] (PAL-NTSC) +CRC=DB7184C9 F53AC14A +RefMD5=6BBD8C42F6EF8F5B9541D6F4DB657DD7 + +[C2C3115821C738A4834E977E8325F89E] +GoodName=Hercules - The Legendary Journeys (U) [t1][f1][b1] +CRC=DB7184C9 F53AC14A +RefMD5=6BBD8C42F6EF8F5B9541D6F4DB657DD7 + +[3F1CF2D6C1580FDCCD662F9FCF8C4214] +GoodName=Hercules - The Legendary Journeys (U) [t1][f2] (PAL-NTSC) +CRC=DB7184C9 F53AC14A +RefMD5=6BBD8C42F6EF8F5B9541D6F4DB657DD7 + +[2080262A251D270F9CE819887F2104A7] +GoodName=Hexen (E) [!] +CRC=95B2B30B 2B6415C1 +Players=4 +SaveType=Controller Pack + +[E86A8BF46985B7CE8459AFBE5FC3DCC3] +GoodName=Hexen (E) [h1C] +CRC=95B2B30B 2B6415C1 +RefMD5=2080262A251D270F9CE819887F2104A7 + +[A5921C00111200257284CE0ABA0904CA] +GoodName=Hexen (F) [!] +CRC=5C1B5FBD 7E961634 +Players=4 +SaveType=Controller Pack + +[08CBB141DEC604E4DAD2787F237D57A2] +GoodName=Hexen (G) [!] +CRC=9AB3B50A BC666105 +Players=4 +SaveType=Controller Pack + +[35E9ECE11306EF7D8F5F09F65761D365] +GoodName=Hexen (G) [h1C] +CRC=9AB3B50A BC666105 +RefMD5=08CBB141DEC604E4DAD2787F237D57A2 + +[672152CF4DCB5D0A19662C11EFF71452] +GoodName=Hexen (J) [!] +CRC=66751A57 54A29D6E +Players=4 +SaveType=Controller Pack + +[EB98F1B8C6898AF7417F6882946DA9B3] +GoodName=Hexen (U) [!] +CRC=9CAB6AEA 87C61C00 +Players=4 +SaveType=Controller Pack + +[B06625703DB3A03BAE3D02FD0F904541] +GoodName=Hexen (U) [b1] +CRC=9CAB6AEA 87C61C00 +RefMD5=EB98F1B8C6898AF7417F6882946DA9B3 + +[EA5A22A5A2DA96D88939171CEA41A1F1] +GoodName=Hexen (U) [h1C] +CRC=9CAB6AEA 87C61C00 +RefMD5=EB98F1B8C6898AF7417F6882946DA9B3 + +[9301923AE938320FF0186B7279AFE6D8] +GoodName=Hexen (U) [t1] +CRC=E6BA0A06 8A3D2C2F +RefMD5=EB98F1B8C6898AF7417F6882946DA9B3 + +[59BA99120BE9D438C53EAED6091B9B7D] +GoodName=Hexen (U) [t2] +CRC=E6BA0A06 8A3D2C2F +RefMD5=EB98F1B8C6898AF7417F6882946DA9B3 + +[1280C78F286FC1C437A4905EE42C47F1] +GoodName=Hey You, Pikachu! (U) [!] +CRC=D3F10E5D 052EA579 +Players=1 +SaveType=Eeprom 4KB +Rumble=Yes + +[DCC316EFFC4928F5B0AE8D273D8024BF] +GoodName=HiRes CFB Demo (PD) +CRC=4072572D A23DB72C + +[73084495F3209C54900525436BBBC531] +GoodName=Hiryuu no Ken Twin (J) [!] +CRC=35FF8F1A 6E79E3BE + +[8976913EFBE98EFED3B0B32CBCAA8B49] +GoodName=Hiryuu no Ken Twin (J) [h1C] +CRC=35FF8F1A 6E79E3BE + +[E0C39E55DE1D588371D5F99056F3578C] +GoodName=Hiryuu no Ken Twin (J) [h2C] +CRC=35FF8F1A 6E79E3BE + +[EA9B6EA32CCEB8F7EFBB2FEA211B8E89] +GoodName=Hiryuu no Ken Twin (J) [h3C] +CRC=35FF8F1A 6E79E3BE + +[FA6A2E00BBFF236DAC91F08544AFFA40] +GoodName=Holy Magic Century (E) [!] +CRC=277B129D DD3879FF +Players=1 +SaveType=Controller Pack + +[80CC112F62E9A8581A1BB6A1D1E1488B] +GoodName=Holy Magic Century (E) [b1] +CRC=277B129D DD3879FF +RefMD5=FA6A2E00BBFF236DAC91F08544AFFA40 + +[668908C495432AD099C5439E38809053] +GoodName=Holy Magic Century (F) [h1C] +CRC=B35FEBB0 7427B204 + +[27D3EFBD35B1F580330961480B988FB5] +GoodName=Holy Magic Century (F) [o1] +CRC=B35FEBB0 7427B204 + +[988F5ABD96259196343659E913666820] +GoodName=Holy Magic Century (F) +CRC=B35FEBB0 7427B204 + +[AB676C3E9D26A77450DDB4AACD1A3861] +GoodName=Holy Magic Century (G) [!] +CRC=75FA0E14 C9B3D105 +Players=1 +SaveType=Controller Pack + +[ACF823A6EF4E77FE5B940D716DCED6E9] +GoodName=Holy Magic Century (G) [b1] +CRC=75FA0E14 C9B3D105 +RefMD5=AB676C3E9D26A77450DDB4AACD1A3861 + +[E26F4FFD2AA19E6EE9F9216A15189F14] +GoodName=Holy Magic Century (G) [b2] +CRC=75FA0E14 C9B3D105 +RefMD5=AB676C3E9D26A77450DDB4AACD1A3861 + +[F40D3DE4745BACC69458BAB25D6067F9] +GoodName=Holy Magic Century (G) [b3] +CRC=75FA0E14 C9B3D105 +RefMD5=AB676C3E9D26A77450DDB4AACD1A3861 + +[B1A67AEBC2BE89A800E5EB60C0DFA968] +GoodName=Hoshi no Kirby 64 (J) (V1.0) [!] +CRC=C1D702BD 6D416547 +SaveType=Eeprom 4KB +Players=4 + +[460A42ED5612EBBF92F386689067384E] +GoodName=Hoshi no Kirby 64 (J) (V1.0) [f1] +CRC=22F301B6 D0A03C3C +RefMD5=B1A67AEBC2BE89A800E5EB60C0DFA968 + +[07EA11684D74DA87719F05A1BDC4CCB3] +GoodName=Hoshi no Kirby 64 (J) (V1.0) [f2] +CRC=57CD5D6D 046282B1 +RefMD5=B1A67AEBC2BE89A800E5EB60C0DFA968 + +[FFDB4456F799722BCFE430632C3986AE] +GoodName=Hoshi no Kirby 64 (J) (V1.1) [!] +CRC=CA1BB86F 41CCA5C5 +Players=4 +SaveType=Eeprom 4KB + +[3EC0471E2CBEE17471DDBF80C56606D5] +GoodName=Hoshi no Kirby 64 (J) (V1.2) [!] +CRC=0C581C7A 3D6E20E4 +Players=4 +SaveType=Eeprom 4KB + +[35E039F8E79843917D02BE06D00C457B] +GoodName=Hoshi no Kirby 64 (J) (V1.3) [!] +CRC=BCB1F89F 060752A2 +Players=4 +SaveType=Eeprom 4KB + +[EF34DA35EF8A0734843CB182C19FEB26] +GoodName=Hot Wheels Turbo Racing (E) (M3) [!] +CRC=E7D20193 C1158E93 +Players=4 +SaveType=Controller Pack + +[BB8A58282C5D4E32B34556407ACD920E] +GoodName=Hot Wheels Turbo Racing (E) (M3) [b1] +CRC=E7D20193 C1158E93 +RefMD5=EF34DA35EF8A0734843CB182C19FEB26 + +[4311A1AEF1898678331F7E3486055307] +GoodName=Hot Wheels Turbo Racing (U) [!] +CRC=C7C98F8E 42145DDE +Players=4 +SaveType=Controller Pack + +[50091668743D2DE7CAA253420D32C2D8] +GoodName=Hot Wheels Turbo Racing (U) [f1] (PAL) +CRC=14DE709E F882947D +RefMD5=4311A1AEF1898678331F7E3486055307 + +[7D32A665027ABB585BD4FB7194752B34] +GoodName=Hot Wheels Turbo Racing (U) [t1] +CRC=1FDFCBDC FCD77D11 +RefMD5=4311A1AEF1898678331F7E3486055307 + +[97E706ED9CC6F30708FFDC187C85D59F] +GoodName=Human Grand Prix - New Generation (J) [!] +CRC=5535972E BD8E3295 +Players=1 +SaveType=Controller Pack + +[F9A6FFD35D478A8E2B369460BFAB2CC8] +GoodName=Human Grand Prix - New Generation (J) [b1] +CRC=5535972E BD8E3295 +RefMD5=97E706ED9CC6F30708FFDC187C85D59F + +[7BD3F10D47DB6D062280D8AE750A1ACB] +GoodName=Human Grand Prix - New Generation (J) [o1] +CRC=5535972E BD8E3295 +RefMD5=97E706ED9CC6F30708FFDC187C85D59F + +[DA861C4D9202F661575466450A27C412] +GoodName=Hybrid Heaven (E) (M3) [!] +CRC=641D3A7F 86820466 +Players=2 +SaveType=Controller Pack + +[24B023696975D27EAE8319EF40001348] +GoodName=Hybrid Heaven (E) (M3) [b1] +CRC=641D3A7F 86820466 +RefMD5=DA861C4D9202F661575466450A27C412 + +[E6F18336406EF3BFC990483BBF184ACD] +GoodName=Hybrid Heaven (E) (M3) [f1] (NTSC) +CRC=DCCEDB8F BA79BEDE +RefMD5=DA861C4D9202F661575466450A27C412 + +[9946EFF915FC947A226407AC1F7B35C4] +GoodName=Hybrid Heaven (J) [!] +CRC=0DE2CE36 D41D29E6 +Players=2 +SaveType=Controller Pack + +[94B284286A090B5980B7F18A4FA77853] +GoodName=Hybrid Heaven (J) [b1] +CRC=0DE2CE36 D41D29E6 +RefMD5=94B284286A090B5980B7F18A4FA77853 + +[151E92F5E3EE294BAFF5D4C3E4E95D77] +GoodName=Hybrid Heaven (J) [f1] (PAL) +CRC=DE4E5E2E DCD0615D +RefMD5=94B284286A090B5980B7F18A4FA77853 + +[C47E95BB32AB132C41D67BD243F9E02A] +GoodName=Hybrid Heaven (U) [!] +CRC=102888BF 434888CA +Players=2 +SaveType=Controller Pack + +[115521BAC11608FEBCE874F243ACC66E] +GoodName=Hybrid Heaven (U) [f1] (PAL) +CRC=FB610592 898A9705 +RefMD5=C47E95BB32AB132C41D67BD243F9E02A + +[0A44393E1C97E4F91303029E27F28AF4] +GoodName=Hybrid Heaven (U) [t1] +CRC=E8DBC96A DAC9E2EE +RefMD5=C47E95BB32AB132C41D67BD243F9E02A + +[434BB8DE49011573AC38E893224C5623] +GoodName=Hydro Thunder (E) [!] +CRC=B58988E9 B1FC4BE8 +Players=4 +SaveType=Controller Pack + +[1F57194EA272CF5DB500D228E9C94D75] +GoodName=Hydro Thunder (E) [f1] (NTSC) +CRC=EDFB6B01 8893F62C +RefMD5=434BB8DE49011573AC38E893224C5623 + +[4B4C85D9DD2D460ADAFABAE8DB48B4FA] +GoodName=Hydro Thunder (F) [!] +CRC=29A045CE ABA9060E +Players=4 +SaveType=Controller Pack + +[54F43E6B68782E98CAABEA5E7976B2BE] +GoodName=Hydro Thunder (U) [!] +CRC=C8DC65EB 3D8C8904 +SaveType=Controller Pack +Players=4 + +[22AAD544C062FB8A2DC6B2DEB32DE188] +GoodName=Hydro Thunder (U) [b1] +CRC=C8DC65EB 3D8C8904 +RefMD5=54F43E6B68782E98CAABEA5E7976B2BE + +[71DCDBE9F4B37A251E2877900CDBF406] +GoodName=Hydro Thunder (U) [b1][f1] (PAL) +CRC=63CCD041 F12A8BC0 +RefMD5=54F43E6B68782E98CAABEA5E7976B2BE + +[A5B6E5D7B689216BA5C8F6360BF89B67] +GoodName=Hydro Thunder (U) [b1][t1] +CRC=B6DB2595 BC45273B +RefMD5=54F43E6B68782E98CAABEA5E7976B2BE + +[85ACEBC851A407630D7464CCB63408BE] +GoodName=Hydro Thunder (U) [b2] +CRC=C8DC65EB 3D8C8904 +RefMD5=54F43E6B68782E98CAABEA5E7976B2BE + +[F47575C35C7352E685B848CDAFF96B80] +GoodName=Hydro Thunder (U) [b3] +CRC=C8DC65EB 3D8C8904 +RefMD5=54F43E6B68782E98CAABEA5E7976B2BE + +[D2F7B3ACE75A2CE7A06BEAC929711D94] +GoodName=Hyper Olympics Nagano 64 (J) [!] +CRC=2FC5C34C 7A05CC9D +Players=4 +SaveType=Controller Pack + +[3B6FF1829CBBEAE87704F53950791D64] +GoodName=Hyper Olympics Nagano 64 (J) [b1] +CRC=2FC5C34C 7A05CC9D +RefMD5=D2F7B3ACE75A2CE7A06BEAC929711D94 + +[F4D2BE1C47486AB3A6FCCCD2E7532C67] +GoodName=Hyper Olympics Nagano 64 (J) [b2] +CRC=2FC5C34C 7A05CC9D +RefMD5=D2F7B3ACE75A2CE7A06BEAC929711D94 + +[BAC8634F10F286E6A0DB889FCD12B25E] +GoodName=Hyper Olympics Nagano 64 (J) [b3] +CRC=2FC5C34C 7A05CC9D +RefMD5=D2F7B3ACE75A2CE7A06BEAC929711D94 + +[20AE0BA68601EB0A49D61BC7A00FEADD] +GoodName=Hyper Olympics Nagano 64 (J) [o1] +CRC=2FC5C34C 7A05CC9D +RefMD5=D2F7B3ACE75A2CE7A06BEAC929711D94 + +[DC577D70E9308F94E5F3CE03F3508539] +GoodName=Ide Yosuke no Mahjong Juku (J) [!] +CRC=77DA3B8D 162B0D7C +Players=1 + +[92A6FFA1C8D537C7A97C5C613CAE05C6] +GoodName=Ide Yosuke no Mahjong Juku (J) [b1] +CRC=77DA3B8D 162B0D7C +RefMD5=DC577D70E9308F94E5F3CE03F3508539 + +[25B297143E9E5CCBB4B80A7FB6AF399B] +GoodName=Iggy's Reckin' Balls (E) [!] +CRC=D692CC5E EC58D072 +Players=2 +SaveType=Controller Pack + +[26CEC7A56ABB81F3468CFA26D8F16B67] +GoodName=Iggy's Reckin' Balls (E) [o1] +CRC=D692CC5E EC58D072 +RefMD5=25B297143E9E5CCBB4B80A7FB6AF399B + +[464211ABB602EE1005974D2D835A3BCF] +GoodName=Iggy's Reckin' Balls (U) [!] +CRC=E616B5BC C9658B88 +Players=2 +SaveType=Controller Pack + +[8BF0EAFB7014B7B5CE8E7D778B6B4B99] +GoodName=Iggy's Reckin' Balls (U) [o1] +CRC=E616B5BC C9658B88 +RefMD5=464211ABB602EE1005974D2D835A3BCF + +[C70B0B680807F2B8C2C3D5DC495FA8C2] +GoodName=Iggy-kun no Bura Bura Poyon (J) [!] +CRC=69458B9E FC95F936 +Players=2 +SaveType=Controller Pack + +[827106236756DC5B585C4226184835FA] +GoodName=Iggy-kun no Bura Bura Poyon (J) [o1] +CRC=69458B9E FC95F936 +RefMD5=C70B0B680807F2B8C2C3D5DC495FA8C2 + +[C605F40BF669E00A5E51BAF0D00621EA] +GoodName=In-Fisherman Bass Hunter 64 (U) [!] +CRC=8C138BE0 95700E46 +SaveType=Eeprom 4KB +Players=1 + +[1AF93922A67085AB2C777B1F08AF365B] +GoodName=In-Fisherman Bass Hunter 64 (U) [f1] (PAL) +CRC=F050D644 B5A5CED1 +RefMD5=C605F40BF669E00A5E51BAF0D00621EA + +[70DE1EAB508596B6BBEFD168B5D07194] +GoodName=Indiana Jones and the Infernal Machine (U) [!] +CRC=AF9DCC15 1A723D88 +Players=1 +SaveType=Eeprom 4KB + +[A7781D441AF55C4FF8AFC68AB3A59313] +GoodName=Indy Racing 2000 (U) [!] +CRC=E436467A 82DE8F9B +SaveType=Eeprom 4KB +Players=4 + +[34489365B550F32C97337D86D52D8C84] +GoodName=International Superstar Soccer '98 (E) [!] +CRC=F41B6343 C10661E6 +Players=4 +SaveType=Controller Pack + +[7DCC05B98E2FA690B478808EBBAD5D1A] +GoodName=International Superstar Soccer '98 (U) [!] +CRC=7F0FDA09 6061CE0B +Players=4 +SaveType=Controller Pack + +[43B326B27B89288F2D17D22EA49F86BD] +GoodName=International Superstar Soccer '98 (U) [o1] +CRC=7F0FDA09 6061CE0B +RefMD5=7DCC05B98E2FA690B478808EBBAD5D1A + +[9F101B6F6BEF4F267DEB5C6C37A24B97] +GoodName=International Superstar Soccer 2000 (E) (M2) (Eng-Ger) [!] +CRC=336364A0 06C8D5BF +Players=4 +SaveType=Controller Pack + +[CC2BE97A16744860FAE8A94611479C4C] +GoodName=International Superstar Soccer 2000 (E) (M2) (Fre-Ita) [!] +CRC=BAE8E871 35FF944E +Players=4 +SaveType=Controller Pack + +[23A4ED8D79882594206173B1D476F0E9] +GoodName=International Superstar Soccer 2000 (U) (M2) [!] +CRC=8E835437 CD5748B4 +Players=4 +SaveType=Controller Pack + +[ACF18822457A451B09BD88E15A70505C] +GoodName=International Superstar Soccer 2000 (U) (M2) [f1] (PAL) +CRC=30B6A6AB 319EFD09 +RefMD5=23A4ED8D79882594206173B1D476F0E9 + +[376803F28CA8B2133671783419933CA2] +GoodName=International Superstar Soccer 64 (E) [!] +CRC=E2D37CF0 F57E4EAE +Players=4 +SaveType=Controller Pack + +[7FCC22F4BF1FC82F886C455981D2A420] +GoodName=International Superstar Soccer 64 (E) [b1] +CRC=E2D37CF0 F57E4EAE +RefMD5=376803F28CA8B2133671783419933CA2 + +[FD0102D535BC3BBB22DD823A636DC757] +GoodName=International Superstar Soccer 64 (E) [b2] +CRC=E2D37CF0 F57E4EAE +RefMD5=376803F28CA8B2133671783419933CA2 + +[65B9CAC3900435ED6893B9D489F1655F] +GoodName=International Superstar Soccer 64 (E) [h1C] +CRC=E2D37CF0 F57E4EAE +RefMD5=376803F28CA8B2133671783419933CA2 + +[70D480A73DB5751EED9E826108005834] +GoodName=International Superstar Soccer 64 (E) [h2C] +CRC=E2D37CF0 F57E4EAE +RefMD5=376803F28CA8B2133671783419933CA2 + +[6A345402AE1DB5CE1041365E36126BCE] +GoodName=International Superstar Soccer 64 (U) [!] +CRC=5F2763C4 62412AE5 +Players=4 +SaveType=Controller Pack + +[C0969E1C141BE6E144E651CAB1AEA3D8] +GoodName=International Superstar Soccer 64 (U) [b1] +CRC=5F2763C4 62412AE5 +RefMD5=6A345402AE1DB5CE1041365E36126BCE + +[0321FCDCD35E6DC0D3F4DC1251919997] +GoodName=International Superstar Soccer 64 (U) [h1C] +CRC=5F2763C4 62412AE5 +RefMD5=6A345402AE1DB5CE1041365E36126BCE + +[37A4F634CADB89DC3E43D389ED050925] +GoodName=International Superstar Soccer 64 (U) [h2C] +CRC=5F2763C4 62412AE5 +RefMD5=6A345402AE1DB5CE1041365E36126BCE + +[35662CFD07FD6AF4BAB90CA23F7C98E6] +GoodName=International Track & Field 2000 (U) [!] +CRC=20073BC7 5E3B0111 +Players=4 +SaveType=Controller Pack + +[970488FB7D9C5C25BD924E6F898B84A0] +GoodName=International Track & Field Summer Games (E) (M3) [!] +CRC=6712C779 3B72781D +Players=4 +SaveType=Controller Pack + +[1247B093E0FD6CCFD50D15DE59301076] +GoodName=J.League Dynamite Soccer 64 (J) [!] +CRC=87766747 91C27165 +Players=4 + +[849DA5F1790A386B1CD9118CA1398E9D] +GoodName=J.League Dynamite Soccer 64 (J) [b1] +CRC=87766747 91C27165 +RefMD5=1247B093E0FD6CCFD50D15DE59301076 + +[F3A1B04E1F3436E183932B54212B75B5] +GoodName=J.League Dynamite Soccer 64 (J) [b2] +CRC=87766747 91C27165 +RefMD5=1247B093E0FD6CCFD50D15DE59301076 + +[20FBBA5FCCB7454367E071A744D6BB2F] +GoodName=J.League Dynamite Soccer 64 (J) [b3] +CRC=87766747 91C27165 +RefMD5=1247B093E0FD6CCFD50D15DE59301076 + +[2085FBD994D3597A8A520F695E336382] +GoodName=J.League Dynamite Soccer 64 (J) [b4] +CRC=87766747 91C27165 +RefMD5=1247B093E0FD6CCFD50D15DE59301076 + +[E0071B3CE2E29597DC4C73D83402723C] +GoodName=J.League Dynamite Soccer 64 (J) [h1C] +CRC=87766747 91C27165 +RefMD5=1247B093E0FD6CCFD50D15DE59301076 + +[F7544B9DF78D3CDB1C1B31006372C531] +GoodName=J.League Dynamite Soccer 64 (J) [h2C] +CRC=87766747 91C27165 +RefMD5=1247B093E0FD6CCFD50D15DE59301076 + +[F848E34DC2918C708D2D0C02E082B06B] +GoodName=J.League Dynamite Soccer 64 (J) [h3C] +CRC=87766747 91C27165 +RefMD5=1247B093E0FD6CCFD50D15DE59301076 + +[E3CE4ADB8A7C0CF39E11A2846E00178A] +GoodName=J.League Eleven Beat 1997 (J) [b1][h1C] +CRC=4FBFA429 6920BB15 + +[BEF0F36513F6FA8B01638319252B2B99] +GoodName=J.League Eleven Beat 1997 (J) [b2][h1C] +CRC=4FBFA429 6920BB15 + +[476FDC0554BD3B4746FC871FDD02F4B2] +GoodName=J.League Eleven Beat 1997 (J) [h1C] +CRC=4FBFA429 6920BB15 + +[30E23D3DE446E37E5E7FBEF6794A6FC9] +GoodName=J.League Eleven Beat 1997 (J) +CRC=4FBFA429 6920BB15 + +[209DB8333EEB526AE9A91209175348CE] +GoodName=J.League Live 64 (J) [!] +CRC=54554A42 E4985FFB +Players=4 + +[46F584DBFA1E292F0ECA74CA1B12009C] +GoodName=J.League Live 64 (J) [b1] +CRC=54554A42 E4985FFB +RefMD5=209DB8333EEB526AE9A91209175348CE + +[800ACC7D609ECDB3E09E68CBD05F5FA0] +GoodName=J.League Tactics Soccer (J) (V1.0) [!] +CRC=E8D29DA0 15E61D94 +Players=4 + +[F604701C59C7D2BBA2492D0073E928F2] +GoodName=J.League Tactics Soccer (J) (V1.0) [b1] +CRC=E8D29DA0 15E61D94 +RefMD5=800ACC7D609ECDB3E09E68CBD05F5FA0 + +[7D5AFCD953BB15EC204B175761CA28C2] +GoodName=J.League Tactics Soccer (J) (V1.0) [f1] (PAL) +CRC=E8D2A500 5AA8DBCA +RefMD5=800ACC7D609ECDB3E09E68CBD05F5FA0 + +[793DBF504E20C92F6B73B4E8A25A220C] +GoodName=J.League Tactics Soccer (J) (V1.1) [!] +CRC=C6CE0AAA D117F019 +Players=4 + +[45F6B7EAF40E8445205904934EE365A6] +GoodName=JPEG Slideshow Viewer by Garth Elgar (PD) +CRC=A957851C 535A5667 + +[8EE01DE7DA2E9AD08D7ED913A5EE8632] +GoodName=Jangou Simulation Mahjong Do 64 (J) [!] +CRC=C73AD016 48C5537D +Players=1 + +[82388A4B44EF74F9C250C8152AB93669] +GoodName=Jangou Simulation Mahjong Do 64 (J) [b1] +CRC=C73AD016 48C5537D +RefMD5=8EE01DE7DA2E9AD08D7ED913A5EE8632 + +[014464F2AC70FBBB94B08B9762E65A72] +GoodName=Jangou Simulation Mahjong Do 64 (J) [b2] +CRC=C73AD016 48C5537D +RefMD5=8EE01DE7DA2E9AD08D7ED913A5EE8632 + +[304F496CE0858959700C7F71E55C55B7] +GoodName=Jangou Simulation Mahjong Do 64 (J) [b3] +CRC=C73AD016 48C5537D +RefMD5=8EE01DE7DA2E9AD08D7ED913A5EE8632 + +[A45F7200537C0D928A88CBBA2DFEB680] +GoodName=Jeopardy! (U) [!] +CRC=69256460 B9A3F586 +Players=1 +SaveType=None + +[05318721C273CB65CFBDF78AC2724BF2] +GoodName=Jeopardy! (U) [h1C] +CRC=69256460 B9A3F586 +RefMD5=A45F7200537C0D928A88CBBA2DFEB680 + +[190584D9C0DC2875183FB84C5072B8F1] +GoodName=Jeopardy! (U) [o1] +CRC=69256460 B9A3F586 +RefMD5=A45F7200537C0D928A88CBBA2DFEB680 + +[79BDD4467E102A1CBB4CC74DFC96BF7D] +GoodName=Jeopardy! (U) [o1][h1C] +CRC=69256460 B9A3F586 +RefMD5=A45F7200537C0D928A88CBBA2DFEB680 + +[4C5BE1BFC1CCCFF501EBA2A685226962] +GoodName=Jeremy McGrath Supercross 2000 (E) [!] +CRC=21F7ABFB 6A8AA7E8 +SaveType=Controller Pack +Players=4 + +[8046A4B8ABD4353B2AB9696106CCF8D2] +GoodName=Jeremy McGrath Supercross 2000 (U) [!] +CRC=BB30B1A5 FCF712CE +Players=4 +SaveType=Controller Pack + +[29E0AB31B3FC6A6B1EFC11FBDB82CB97] +GoodName=Jeremy McGrath Supercross 2000 (U) [f1] +CRC=46C6F185 E13841C8 +RefMD5=8046A4B8ABD4353B2AB9696106CCF8D2 + +[BAAF237E71AA7526C9B2F01C08B68A53] +GoodName=Jet Force Gemini (E) (M4) [!] +CRC=68D7A1DE 0079834A +Players=4 +SaveType=Flash RAM +Rumble=Yes + +[821E7F74880BBD04AA9501D3BB25138E] +GoodName=Jet Force Gemini (E) (M4) [T+Ita0.9beta_Rulesless] +CRC=68D7A1DE 0079834A +RefMD5=BAAF237E71AA7526C9B2F01C08B68A53 + +[76996A6CC868AC0E2BB2506A3C4DB606] +GoodName=Jet Force Gemini (E) (M4) [f1] +CRC=B66E0F7C 2709C22F +RefMD5=BAAF237E71AA7526C9B2F01C08B68A53 + +[5BBE9ADE7171F2E1DAAA7C48FAD38728] +GoodName=Jet Force Gemini (U) (Kiosk Demo) [!] +CRC=DFD8AB47 3CDBEB89 +Players=4 +Rumble=Yes + +[E423A21C971B8A91C3E8980E2605B840] +GoodName=Jet Force Gemini (U) (Kiosk Demo) [b1] +CRC=DFD8AB47 3CDBEB89 + +[2525E3734B921E662903E94BAB119C32] +GoodName=Jet Force Gemini (U) (Kiosk Demo) [b1][f1] (Save) +CRC=9C660FA0 C06A610D + +[B4E3489F9B655439F9902F7A466CF973] +GoodName=Jet Force Gemini (U) (Kiosk Demo) [b1][f2] +CRC=8547FED3 C4945FAF + +[69144CEED3F4D7B208D81A3DC3F57AD0] +GoodName=Jet Force Gemini (U) (Kiosk Demo) [b2] +CRC=DFD8AB47 3CDBEB89 + +[772CC6EAB2620D2D3CDC17BBC26C4F68] +GoodName=Jet Force Gemini (U) [!] +CRC=8A6009B6 94ACE150 +Players=4 +SaveType=Flash RAM +Rumble=Yes + +[92E6117285EC6A2D836B1C6839DDFD9B] +GoodName=Jet Force Gemini (U) [b1] +CRC=75CAA990 9FFDC9BD +RefMD5=772CC6EAB2620D2D3CDC17BBC26C4F68 + +[745FCD72A921ED178AF6C319B09DF1F3] +GoodName=Jet Force Gemini (U) [b2] +CRC=CDB8B4D0 8832352D +RefMD5=772CC6EAB2620D2D3CDC17BBC26C4F68 + +[878D8A26FD02FDB08200464CB6F566EF] +GoodName=Jikkyou G1 Stable (J) [!] +CRC=AF19D9F5 B70223CC +Players=4 + +[4BBAF03594C6DCECB135AC8C57CB4CD7] +GoodName=Jikkyou G1 Stable (J) [b1] +CRC=AF19D9F5 B70223CC +RefMD5=878D8A26FD02FDB08200464CB6F566EF + +[3D2CCA1B2E3BDE267769812219EDB864] +GoodName=Jikkyou J.League 1999 - Perfect Striker 2 (J) [!] +CRC=63112A53 A29FA88F +Players=4 + +[84B1421F658D5185812D861E23437520] +GoodName=Jikkyou J.League 1999 - Perfect Striker 2 (J) [b1] +CRC=63112A53 A29FA88F +RefMD5=3D2CCA1B2E3BDE267769812219EDB864 + +[657C57E1AAA698A6E83398D300AA8445] +GoodName=Jikkyou J.League 1999 - Perfect Striker 2 (J) [f1] (PAL) +CRC=3DBD5E85 EA9A328A +RefMD5=3D2CCA1B2E3BDE267769812219EDB864 + +[EA9826D391B299137788DE21E20AF6EA] +GoodName=Jikkyou J.League 1999 - Perfect Striker 2 (J) [f2] (PAL) +CRC=22CA2C52 CA62736F +RefMD5=3D2CCA1B2E3BDE267769812219EDB864 + +[58153AC5C4030D1BFD3C15CF57FB02E7] +GoodName=Jikkyou J.League Perfect Striker (J) [!] +CRC=146C4366 72A6DEB3 +Players=4 + +[759B8749E55113526E8C1C468E244CA8] +GoodName=Jikkyou J.League Perfect Striker (J) [b1] +CRC=146C4366 72A6DEB3 +RefMD5=58153AC5C4030D1BFD3C15CF57FB02E7 + +[F012DC3C0CAA38618A1FAD27C73FCBD5] +GoodName=Jikkyou J.League Perfect Striker (J) [b2] +CRC=146C4366 72A6DEB3 +RefMD5=58153AC5C4030D1BFD3C15CF57FB02E7 + +[6D1D465EBAACD3747B1362037ABED9EF] +GoodName=Jikkyou J.League Perfect Striker (J) [b3] +CRC=146C4366 72A6DEB3 +RefMD5=58153AC5C4030D1BFD3C15CF57FB02E7 + +[C7152167915E8EB928C0CBBF9AF9886E] +GoodName=Jikkyou J.League Perfect Striker (J) [f1] (PAL) +CRC=3BCCA16E 0AF6D30F +RefMD5=58153AC5C4030D1BFD3C15CF57FB02E7 + +[7FC933A64884A382AA07605EA7204FF5] +GoodName=Jikkyou Powerful Pro Yakyuu - Basic Han 2001 (J) [!] +CRC=6EDD4766 A93E9BA8 +Players=4 + +[23409668A6E6C4ECE7B5FB0B7D0E8F2C] +GoodName=Jikkyou Powerful Pro Yakyuu 2000 (J) (V1.0) [!] +CRC=0AC244D1 1F0EC605 +Players=4 + +[B653C963ED8D3A749676810F07CFE4E5] +GoodName=Jikkyou Powerful Pro Yakyuu 2000 (J) (V1.1) [!] +CRC=4264DF23 BE28BDF7 +Players=4 + +[FDA57F65EB159278223EB9D03267C27F] +GoodName=Jikkyou Powerful Pro Yakyuu 4 (J) (V1.0) [!] +CRC=34495BAD 502E9D26 +Players=4 + +[7CC328FFAA5B77CD6247124DD0AF8899] +GoodName=Jikkyou Powerful Pro Yakyuu 4 (J) (V1.0) [b1] +CRC=34495BAD 502E9D26 +Players=4 + +[924E6553AEDE5EA66E2E14D29E48D929] +GoodName=Jikkyou Powerful Pro Yakyuu 4 (J) (V1.0) [b2] +CRC=34495BAD 502E9D26 +RefMD5=7CC328FFAA5B77CD6247124DD0AF8899 + +[D9BA9FC609BFCDAC0081B7C568311BE1] +GoodName=Jikkyou Powerful Pro Yakyuu 4 (J) (V1.0) [b3] +CRC=34495BAD 502E9D26 +RefMD5=7CC328FFAA5B77CD6247124DD0AF8899 + +[2BBD484BFA0F16C09C7F13FBDC2637C6] +GoodName=Jikkyou Powerful Pro Yakyuu 4 (J) (V1.0) [b4] +CRC=34495BAD 502E9D26 +RefMD5=7CC328FFAA5B77CD6247124DD0AF8899 + +[1480E755E96B392490F606A75BC306C6] +GoodName=Jikkyou Powerful Pro Yakyuu 4 (J) (V1.0) [b5] +CRC=34495BAD 502E9D26 +RefMD5=7CC328FFAA5B77CD6247124DD0AF8899 + +[950B88955933F42514A3F4284F5A285C] +GoodName=Jikkyou Powerful Pro Yakyuu 4 (J) (V1.0) [o1] +CRC=34495BAD 502E9D26 +RefMD5=7CC328FFAA5B77CD6247124DD0AF8899 + +[B454490EB44F0978F009FA41DE8C478E] +GoodName=Jikkyou Powerful Pro Yakyuu 4 (J) (V1.1) [!] +CRC=D7891F1C C3E43788 +Players=4 + +[E9F989E09E3F1519AEFE619889A4F710] +GoodName=Jikkyou Powerful Pro Yakyuu 5 (J) [!] +CRC=D22943DA AC2B77C0 +Players=4 + +[CAFF2DAC142F169EE76965CA00518B26] +GoodName=Jikkyou Powerful Pro Yakyuu 5 (J) [b1] +CRC=D22943DA AC2B77C0 +RefMD5=E9F989E09E3F1519AEFE619889A4F710 + +[4AC1589C067AC573FD63912A5C6C47A5] +GoodName=Jikkyou Powerful Pro Yakyuu 5 (J) [f1] +CRC=95854656 C8A24DC5 +RefMD5=E9F989E09E3F1519AEFE619889A4F710 + +[8AF9D04DBA1313D1F5F4BA51D9592FBB] +GoodName=Jikkyou Powerful Pro Yakyuu 5 (J) [f2] (PAL) +CRC=38D637C1 5F05D28F +RefMD5=E9F989E09E3F1519AEFE619889A4F710 + +[E6129460E23170FFD4EC4B09D5E0CC56] +GoodName=Jikkyou Powerful Pro Yakyuu 6 (J) [b1] +CRC=B75E20B7 B3FEFDFD +RefMD5=E9F989E09E3F1519AEFE619889A4F710 + +[060D0313E23B660180441FCC7D24D7DB] +GoodName=Jikkyou Powerful Pro Yakyuu 6 (J) [!] +CRC=B75E20B7 B3FEFDFD +RefMD5=E9F989E09E3F1519AEFE619889A4F710 + +[A05E7DB2409DEECCA36E48E9D931CACB] +GoodName=Jikkyou World Soccer - World Cup France '98 (J) (V1.0) [!] +CRC=3FEA5620 7456DB40 +Players=4 + +[538B54C2AAEA73FAA3A021D42A3225BE] +GoodName=Jikkyou World Soccer - World Cup France '98 (J) (V1.1) [!] +CRC=C954B38C 6F62BEB3 +RefMD5=A05E7DB2409DEECCA36E48E9D931CACB + +[2E5FD9303138E8F558BF67BB9E799960] +GoodName=Jikkyou World Soccer - World Cup France '98 (J) (V1.2) [!] +CRC=E1C7ABD6 4E707F28 +Players=4 + +[EF0F425689586850A6F5796124B0C85B] +GoodName=Jikkyou World Soccer 3 (J) [!] +CRC=E0A79F8C 32CC97FA +Players=4 + +[68230D510015FF6817EF898C0B8B636C] +GoodName=Jinsei Game 64 (J) [!] +CRC=4AAAF6ED 376428AD +Players=4 + +[FBB0F6AF0A931EE4FEAEE4F3CC7DBE03] +GoodName=Jinsei Game 64 (J) [f1] (PAL) +CRC=7B016055 F8AC6092 +RefMD5=68230D510015FF6817EF898C0B8B636C + +[7AB29C6AD2D8F4007D8213EB3411E0BD] +GoodName=John Romero's Daikatana (E) (M3) [!] +CRC=0F743195 D8A6DB95 +Players=4 +SaveType=Controller Pack + +[2B417AD282DB321C9C67EDA7131A7F06] +GoodName=John Romero's Daikatana (E) (M3) [f1] (NTSC) +CRC=B6835E54 04A4A0D0 +RefMD5=7AB29C6AD2D8F4007D8213EB3411E0BD + +[164050084561ECB691A51B6D1E5BF4AE] +GoodName=John Romero's Daikatana (E) (M3) [h1C] +CRC=0F743195 D8A6DB95 +RefMD5=7AB29C6AD2D8F4007D8213EB3411E0BD + +[57D31EA7121DD5A05B547225EFA5CFD7] +GoodName=John Romero's Daikatana (J) [!] +CRC=9D7E3C4B E60F4A6C +Players=4 +SaveType=Controller Pack + +[5B4C268422469F50B94779E655F2B798] +GoodName=John Romero's Daikatana (U) [!] +CRC=D0151AB0 FE5CA14B +Players=4 +SaveType=Controller Pack + +[DFF0EFE2B35FCDE506D21B0C0BD373A5] +GoodName=Kakutou Denshou - F-Cup Maniax (J) [!] +CRC=4F29474F 30CB707A +Players=2 +SaveType=Controller Pack + +[9A70D30114F440B5240C10260AB2C8ED] +GoodName=Kakutou Denshou - F-Cup Maniax (J) [f1] (PAL) +CRC=F6E3494A E4EC8933 +RefMD5=DFF0EFE2B35FCDE506D21B0C0BD373A5 + +[EEC0FAB75AF59E9C23E6DE2132DE89FF] +GoodName=Ken Griffey Jr.'s Slugfest (U) [!] +CRC=36281F23 009756CF +SaveType=Flash RAM +Players=4 + +[040A9EA84FA3C73A8F318358E3250AA4] +GoodName=Ken Griffey Jr.'s Slugfest (U) [b1] +CRC=76A8C9F4 3391893D +RefMD5=EEC0FAB75AF59E9C23E6DE2132DE89FF + +[D9160E48CE1F06B9B749B43A38367A28] +GoodName=Ken Griffey Jr.'s Slugfest (U) [b2] +CRC=36281F23 009756CF +RefMD5=EEC0FAB75AF59E9C23E6DE2132DE89FF + +[BF07DE5816FFEC94AF30CB9B9B35909F] +GoodName=Ken Griffey Jr.'s Slugfest (U) [f1] +CRC=76A8C9F4 3391893D +RefMD5=EEC0FAB75AF59E9C23E6DE2132DE89FF + +[47B0348020C4200608B7EBD512028788] +GoodName=Ken Griffey Jr.'s Slugfest (U) [f2] (PAL) +CRC=76A8C9F4 3391893D +RefMD5=EEC0FAB75AF59E9C23E6DE2132DE89FF + +[57C6B3E6309AC2F4BB64B5161E4ED8EF] +GoodName=Ken Griffey Jr.'s Slugfest (U) [f3] (Nosave) +CRC=730D25F4 4A37A36E +RefMD5=EEC0FAB75AF59E9C23E6DE2132DE89FF + +[3E003A77F044F0C97748BE6861C55038] +GoodName=Ken Griffey Jr.'s Slugfest (U) [f4] (Nosave-Z64) +CRC=EAC07419 0F9F72A0 +RefMD5=EEC0FAB75AF59E9C23E6DE2132DE89FF + +[9362C5AC8CA78C12FF553CB7F12A7FF1] +GoodName=Ken Griffey Jr.'s Slugfest (U) [f5] +CRC=76A8C9F4 3391893D +RefMD5=EEC0FAB75AF59E9C23E6DE2132DE89FF + +[68EB1713156605D5B05CFB838C214EF2] +GoodName=Kid Stardust Intro with Sound by Kid Stardust (PD) [a1] +CRC=64709212 699BCF3B + +[69F3D2580CB4C91C91C2E238C72B4403] +GoodName=Kid Stardust Intro with Sound by Kid Stardust (PD) +CRC=64709212 699BCF3B + +[C93D92F10A1A97D2BA87386BE7D178FD] +GoodName=Killer Instinct Gold (E) [!] +CRC=979B263E F8470004 +SaveType=Eeprom 4KB +Players=2 + +[A63F43CC53D9E57A045E1E20A5B12592] +GoodName=Killer Instinct Gold (E) [o1] +CRC=979B263E F8470004 +RefMD5=C93D92F10A1A97D2BA87386BE7D178FD + +[8E33AD20C31FEB61D7230FAD28846C5C] +GoodName=Killer Instinct Gold (U) (V1.0) [!] +CRC=9E8FE2BA 8B270770 +Players=2 +SaveType=Eeprom 4KB + +[F73EA6171B04CD9FF05B76274E824194] +GoodName=Killer Instinct Gold (U) (V1.0) [b1] +CRC=9E8FE2BA 8B270770 +RefMD5=8E33AD20C31FEB61D7230FAD28846C5C + +[F871B07C700F5BB373E648FC64D99D2E] +GoodName=Killer Instinct Gold (U) (V1.0) [b1][t1] +CRC=06CB44B7 3163DB94 +RefMD5=8E33AD20C31FEB61D7230FAD28846C5C + +[D4CD4F6A5029048B44C8B420982E664E] +GoodName=Killer Instinct Gold (U) (V1.0) [b2] +CRC=06CB44B7 3163DB94 +RefMD5=8E33AD20C31FEB61D7230FAD28846C5C + +[3EE5EF09471ED2ADF02E6E1BA8D17963] +GoodName=Killer Instinct Gold (U) (V1.0) [b3] +CRC=06CB44B7 3163DB94 +RefMD5=8E33AD20C31FEB61D7230FAD28846C5C + +[DD44E1D799FB9000983C5291D9D34306] +GoodName=Killer Instinct Gold (U) (V1.0) [b4] +CRC=06CB44B7 3163DB94 +RefMD5=8E33AD20C31FEB61D7230FAD28846C5C + +[C0B6DEEF900B63A5E4624804B14A1BA6] +GoodName=Killer Instinct Gold (U) (V1.0) [b5] +CRC=9E8FE2BA 8B270770 +RefMD5=8E33AD20C31FEB61D7230FAD28846C5C + +[4C58608F3879627886051B7C035E3C23] +GoodName=Killer Instinct Gold (U) (V1.0) [o1] +CRC=9E8FE2BA 8B270770 +RefMD5=8E33AD20C31FEB61D7230FAD28846C5C + +[DF607E79B1539F7D6F9AD34C31F42296] +GoodName=Killer Instinct Gold (U) (V1.0) [o2] +CRC=9E8FE2BA 8B270770 +RefMD5=8E33AD20C31FEB61D7230FAD28846C5C + +[7496F1814AFBD1FC85FE76D6EBE9EA03] +GoodName=Killer Instinct Gold (U) (V1.0) [t1] +CRC=06CB44B7 3163DB94 +RefMD5=8E33AD20C31FEB61D7230FAD28846C5C + +[1C3B29CC7F362CA63AC1C26456737BB3] +GoodName=Killer Instinct Gold (U) (V1.0) [t2] +CRC=06CB44B7 3163DB94 +RefMD5=8E33AD20C31FEB61D7230FAD28846C5C + +[4C9B419DC583C0DF4AB908ADF83BFC65] +GoodName=Killer Instinct Gold (U) (V1.1) [!] +CRC=9E8FCDFA 49F5652B +Players=2 +SaveType=Eeprom 4KB + +[0CFF6A7C1B1334E07585F0C5CDB53B40] +GoodName=Killer Instinct Gold (U) (V1.1) [o1] +CRC=9E8FCDFA 49F5652B +RefMD5=4C9B419DC583C0DF4AB908ADF83BFC65 + +[DD0A82FCC10397AFB37F12BB7F94E67A] +GoodName=Killer Instinct Gold (U) (V1.2) [!] +CRC=F908CA4C 36464327 +Players=2 +SaveType=Eeprom 4KB + +[2D79C395765A601F967CD3EF7CBF439E] +GoodName=Killer Instinct Gold (U) (V1.2) [b1] +CRC=06CB44B7 3163DB94 +RefMD5=DD0A82FCC10397AFB37F12BB7F94E67A + +[3166BE5787BC30526E71277ECA3091DF] +GoodName=Killer Instinct Gold (U) (V1.2) [o1] +CRC=F908CA4C 36464327 +RefMD5=DD0A82FCC10397AFB37F12BB7F94E67A + +[CCA4E87EC206B5B65AEAB9531C0F275B] +GoodName=King Hill 64 - Extreme Snowboarding (J) [!] +CRC=519EA4E1 EB7584E8 +Players=4 +SaveType=Controller Pack + +[CE9AE0AA6DBBF965B1F72BC3AA6A7CEF] +GoodName=King Hill 64 - Extreme Snowboarding (J) [b1] +CRC=519EA4E1 EB7584E8 +RefMD5=CCA4E87EC206B5B65AEAB9531C0F275B + +[18E741AAC72ECA5A9FEFEFE6F7A3E57A] +GoodName=King Hill 64 - Extreme Snowboarding (J) [b2] +CRC=519EA4E1 EB7584E8 +RefMD5=CCA4E87EC206B5B65AEAB9531C0F275B + +[32257BFFFD9B2D680F582E148E9B0611] +GoodName=Kira to Kaiketsu! 64 Tanteidan (J) [!] +CRC=75BC6AD6 78552BC9 +Players=4 + +[A44B7A612964A6D6139D0426E569D9C9] +GoodName=Kirby 64 - The Crystal Shards (E) [!] +CRC=0D93BA11 683868A6 +Players=4 +SaveType=Eeprom 4KB + +[E3BFAF1AD4A58A3AB7FD7310C1F45D81] +GoodName=Kirby 64 - The Crystal Shards (E) [b1] +CRC=0D93BA11 683868A6 +RefMD5=A44B7A612964A6D6139D0426E569D9C9 + +[E32385ECE93DF2228FBEFE3113220A20] +GoodName=Kirby 64 - The Crystal Shards (E) [f1] +CRC=94593D97 846A278C +RefMD5=A44B7A612964A6D6139D0426E569D9C9 + +[D33E4254336383A17FF4728360562ADA] +GoodName=Kirby 64 - The Crystal Shards (U) [!] +CRC=46039FB4 0337822C +Players=4 +SaveType=Eeprom 4KB + +[329C0A564D3B4477E2887097389AB7D6] +GoodName=Kirby 64 - The Crystal Shards (U) [b1] +CRC=80A2BBB5 828DFD3E +RefMD5=D33E4254336383A17FF4728360562ADA + +[0CBA02D6EA55809A1E8D9BA02D199B7D] +GoodName=Kirby 64 - The Crystal Shards (U) [b2] +CRC=22F301B6 D0A03C3C +RefMD5=D33E4254336383A17FF4728360562ADA + +[0A010DFFB20B9A4FB7BA2F962788F54F] +GoodName=Kirby 64 - The Crystal Shards (U) [f1] +CRC=D3F52BA5 1258EDFE +RefMD5=D33E4254336383A17FF4728360562ADA + +[99F4652FEFF7373576ED440E1D33DB24] +GoodName=Kirby 64 - The Crystal Shards (U) [t1] +CRC=CBF72BBD 5D1587B2 +RefMD5=D33E4254336383A17FF4728360562ADA + +[D31A94A5685A21A932CC886D64CC9B21] +GoodName=Knife Edge - Nose Gunner (E) [!] +CRC=4A997C74 E2087F99 +SaveType=None +Players=4 + +[436BA873E9466AAB237D9429348A5F70] +GoodName=Knife Edge - Nose Gunner (J) [!] +CRC=931AEF3F EF196B90 +SaveType=None +Players=4 + +[8043D829FCD4F8F72DD81E5C6DDE916F] +GoodName=Knife Edge - Nose Gunner (U) [!] +CRC=FCE0D799 65316C54 +Players=4 +SaveType=None + +[ABFDAA35C995C839D0773D3601D59E67] +GoodName=Knife Edge - Nose Gunner (U) [b1][t1] +CRC=84F5C897 A870AC11 +RefMD5=8043D829FCD4F8F72DD81E5C6DDE916F + +[FCFBFD04A56400DE8B84297CF37CEE3D] +GoodName=Knife Edge - Nose Gunner (U) [hI] +CRC=84F5CF63 08EE7EDC +RefMD5=8043D829FCD4F8F72DD81E5C6DDE916F + +[760110BC5733A4AC31EE680A06F4F2A1] +GoodName=Knife Edge - Nose Gunner (U) [hI][t1] +CRC=84F5C897 A870AC11 +RefMD5=8043D829FCD4F8F72DD81E5C6DDE916F + +[2CA82F82284D2B3FE381999889350855] +GoodName=Knife Edge - Nose Gunner (U) [t1] +CRC=84F5C897 A870AC11 +RefMD5=8043D829FCD4F8F72DD81E5C6DDE916F + +[E95D73FF55FBB63E79AA9EAB14608584] +GoodName=Knockout Kings 2000 (E) [!] +CRC=E3D6A795 2A1C5D3C +Players=2 +SaveType=Controller Pack + +[008B473841CE4D9AC050D55F99B4B5D4] +GoodName=Knockout Kings 2000 (U) [!] +CRC=0894909C DAD4D82D +Players=2 +SaveType=Controller Pack + +[630400D4E2DCED3DDE56DFCCF39A512A] +GoodName=Knockout Kings 2000 (U) [f1] (PAL) +CRC=8D6F5219 D43B163C +RefMD5=008B473841CE4D9AC050D55F99B4B5D4 + +[C6B01C020FDFD2E5C037C5A330B161AD] +GoodName=Kobe Bryant in NBA Courtside (E) [!] +CRC=1739EFBA D0B43A68 +SaveType=Eeprom 16KB +Players=4 + +[54FD2659FCCE58FCC6EE544F95F8F7A3] +GoodName=Kobe Bryant in NBA Courtside (E) [f1] +CRC=D03F0CCB 11F19CDD +RefMD5=C6B01C020FDFD2E5C037C5A330B161AD + +[D37C79E4E4EABCB5DC6A07BD76688223] +GoodName=Kobe Bryant's NBA Courtside (U) [!] +CRC=616B8494 8A509210 +SaveType=Eeprom 16KB +Players=4 + +[EF9A84FBF0B4C31E581648F256E8ED81] +GoodName=Kobe Bryant's NBA Courtside (U) [f1] +CRC=5BC51145 D3A29FE7 +RefMD5=EF9A84FBF0B4C31E581648F256E8ED81 + +[AA0727F8F2B2C233F7BFD202194D41BC] +GoodName=Kobe Bryant's NBA Courtside (U) [h1C] +CRC=616B8494 8A509210 +RefMD5=EF9A84FBF0B4C31E581648F256E8ED81 + +[E7432C73FE47991B52EB4A44156A8D9D] +GoodName=LCARS Demo by WT Riker (PD) [b1] +CRC=F828DF21 C5E83F66 + +[28803DC0D1CD120E5C0285F7291626B8] +GoodName=LCARS Demo by WT Riker (PD) +CRC=F828DF21 C5E83F66 + +[6310C7173385ED2B06020F3B90158E9E] +GoodName=LEGO Racers (E) (M10) [!] +CRC=F478D8B3 9716DD6D +SaveType=Controller Pack +Players=2 + +[97C4CAE584F427EC44266E9B98FBF7B6] +GoodName=LEGO Racers (U) (M10) [b1] +CRC=096A40EA 8ABE0A10 +SaveType=Controller Pack +Players=2 + +[26B5EAA13DC5B5E35307FE8C0CF5B6BA] +GoodName=LEGO Racers (U) (M10) [!] +CRC=096A40EA 8ABE0A10 +SaveType=Controller Pack +Players=2 + +[E74404ED5A7076855CDE3832474751B6] +GoodName=LEGO Racers (U) (M10) [b1][f1] (PAL) +CRC=BB53C809 269594C6 +RefMD5=97C4CAE584F427EC44266E9B98FBF7B6 + +[1221C67C46C77487D35F03D3D13A3022] +GoodName=LEGO Racers (U) (M10) [b1][t1] +CRC=B0AC4321 3F4DA1AF +RefMD5=97C4CAE584F427EC44266E9B98FBF7B6 + +[050531139C082E35B101E0929B6E07EA] +GoodName=LaC's MOD Player - The Temple Gates (PD) +CRC=8E97A4A6 D1F31B33 +Status=3 +SaveType=None +Players=0 +Rumble=No + +[9602768EA88F4F5B53237E1AA20DE68A] +GoodName=LaC's Universal Bootemu V1.0 (PD) +CRC=EF623F50 ECBB509B + +[EB712F2E8A6A893141B82607B11DA8A2] +GoodName=LaC's Universal Bootemu V1.1 (PD) +CRC=BB752DA7 30D8BEF4 + +[15C2C37D4FFA1E2C5BC4D1029BC225AC] +GoodName=LaC's Universal Bootemu V1.2 (PD) +CRC=FF0AC362 F4EC09B3 + +[EB11FC0797AE1107201C4601FEE5471A] +GoodName=Last Legion UX (J) [!] +CRC=7F304099 52CF5276 +Players=4 + +[8E55FD6990472A08568324309C2FD31F] +GoodName=Last Legion UX (J) [a1] +CRC=7F304099 52CF5276 +Players=4 + +[7B5988138A8ADCA592DE616260B2700D] +GoodName=Last Legion UX (J) [b1] +CRC=7F304099 52CF5276 +RefMD5=EB11FC0797AE1107201C4601FEE5471A + +[F8D705AD5EFF0DB9E3E17A7ECB6D2123] +GoodName=Last Legion UX (J) [b2] +CRC=7F304099 52CF5276 +RefMD5=EB11FC0797AE1107201C4601FEE5471A + +[0C13E0449A28EA5B925CDB8AF8D29768] +GoodName=Zelda no Densetsu - Toki no Ocarina - Zelda Collection Version (J) (GC) [!] +CRC=F7F52DB8 2195E636 +SaveType=Flash RAM +Status=4 +Rumble=Yes +Players=1 + +[33FB7852C180B18EA0B9620B630F413F] +GoodName=Zelda no Densetsu - Toki no Ocarina GC (J) (GC) [!] +CRC=F611F4BA C584135C +SaveType=Flash RAM +Status=4 +Rumble=Yes +Players=1 + +[69895C5C78442260F6EAFB2506DC482A] +GoodName=Zelda no Densetsu - Toki no Ocarina GC URA (J) (GC) [!] +CRC=F43B45BA 2F0E9B6F +SaveType=Flash RAM +Status=4 +Rumble=Yes +Players=1 + +[13FAB67E603B002CEAF0EEA84130E973] +GoodName=Legend of Zelda, The - Majora's Mask (E) (M4) (V1.0) [!] +CRC=E97955C6 BC338D38 +SaveType=Flash RAM +Status=4 +Rumble=Yes +Players=1 + +[5798E844953662880C5EB4134F886909] +GoodName=Legend of Zelda, The - Majora's Mask (E) (M4) (V1.0) [T+Ita1.0Beta_Vampire] +CRC=E97955C6 BC338D38 +RefMD5=13FAB67E603B002CEAF0EEA84130E973 + +[36759C85694A4CF5A1F089A4136DAE2B] +GoodName=Legend of Zelda, The - Majora's Mask (E) (M4) (V1.0) [T-Ita0.9M_Vampire] +CRC=E97955C6 BC338D38 +RefMD5=13FAB67E603B002CEAF0EEA84130E973 + +[6CBAC6E5B13A4A92347488DE1C806BC0] +GoodName=Legend of Zelda, The - Majora's Mask (E) (M4) (V1.0) [T-Ita0.9P1+G_Vampire] +CRC=E97955C6 BC338D38 +RefMD5=13FAB67E603B002CEAF0EEA84130E973 + +[44494CD5D6E3332F79465DE51C2EC636] +GoodName=Legend of Zelda, The - Majora's Mask (E) (M4) (V1.0) [T-Ita0.9Z3_Vampire] +CRC=E97955C6 BC338D38 +RefMD5=13FAB67E603B002CEAF0EEA84130E973 + +[585AA96CBB44DF3BBB3B294538B0605A] +GoodName=Legend of Zelda, The - Majora's Mask (E) (M4) (V1.0) [T-Ita0.9e_Vampire] +CRC=E97955C6 BC338D38 +RefMD5=13FAB67E603B002CEAF0EEA84130E973 + +[5FD0F1EE3F6E0C1E0BA9A91ED797A8B9] +GoodName=Legend of Zelda, The - Majora's Mask (E) (M4) (V1.0) [T-Ita0.9f_Vampire] +CRC=E97955C6 BC338D38 +RefMD5=13FAB67E603B002CEAF0EEA84130E973 + +[035239281994E1E254D7AFC79F5570FB] +GoodName=Legend of Zelda, The - Majora's Mask (E) (M4) (V1.0) [f1] +CRC=E7428718 97751A86 +RefMD5=13FAB67E603B002CEAF0EEA84130E973 + +[BECCFDED43A2F159D03555027462A950] +GoodName=Legend of Zelda, The - Majora's Mask (E) (M4) (V1.1) +CRC=0A5D8F83 98C5371A +SaveType=Flash RAM +Status=4 +Rumble=Yes +Players=1 + +[6DC88503DF78FE4FAA16BCF7AEC4D1E7] +GoodName=Legend of Zelda, The - Majora's Mask (E) (M4) (V1.1) [T+Ita1.0Beta_Vampire] +CRC=0A5D8F83 98C5371A +RefMD5=BECCFDED43A2F159D03555027462A950 + +[2A0A8ACB61538235BC1094D297FB6556] +GoodName=Legend of Zelda, The - Majora's Mask (U) [!] +CRC=5354631C 03A2DEF0 +SaveType=Flash RAM +Status=4 +Rumble=Yes +Players=1 + +[9C7D1B51ECBC9AC333D00273F96758B1] +GoodName=Legend of Zelda, The - Majora's Mask (U) [T+Pol1.0] +CRC=5354631C 03A2DEF0 +RefMD5=2A0A8ACB61538235BC1094D297FB6556 + +[B90B728E0643ABC582793B451444733E] +GoodName=Legend of Zelda, The - Majora's Mask (U) [T+Rus0.85_Alex] +CRC=5354631C 03A2DEF0 +RefMD5=2A0A8ACB61538235BC1094D297FB6556 + +[04150A63D1574673BEAB036E4EB5A249] +GoodName=Legend of Zelda, The - Majora's Mask (U) [T+RusPreAlpha_Alex&gottax] +CRC=5354631C 03A2DEF0 +RefMD5=2A0A8ACB61538235BC1094D297FB6556 + +[5D5DD380115ABF43958A710C7B597771] +GoodName=Legend of Zelda, The - Majora's Mask (U) [T-Rus0.1_Alex] +CRC=5354631C 03A2DEF0 +RefMD5=2A0A8ACB61538235BC1094D297FB6556 + +[7863ED3EE54F72BD59CF970C5C402FA2] +GoodName=Legend of Zelda, The - Majora's Mask (U) [T-Rus0.2_Alex] +CRC=5354631C 03A2DEF0 +RefMD5=2A0A8ACB61538235BC1094D297FB6556 + +[E684C672C2BF64717A10F1D104108998] +GoodName=Legend of Zelda, The - Majora's Mask (U) [T-Rus0.36Alex] +CRC=5354631C 03A2DEF0 +RefMD5=2A0A8ACB61538235BC1094D297FB6556 + +[BD26BC90750D6388972C7E29441039DF] +GoodName=Legend of Zelda, The - Majora's Mask (U) [T-Rus0.50_Alex] +CRC=5354631C 03A2DEF0 +RefMD5=2A0A8ACB61538235BC1094D297FB6556 + +[3DF7F2AF3E7B1F2FD55C2C02125F0130] +GoodName=Legend of Zelda, The - Majora's Mask (U) [f1] +CRC=696F2896 764F6D3F +RefMD5=2A0A8ACB61538235BC1094D297FB6556 + +[8F281800FBA5DDCB1D2B377731FC0215] +GoodName=Legend of Zelda, The - Majora's Mask - Preview Demo (U) [!] +CRC=BF799345 39FF7A02 + +[AC0751DBC23AB2EC0C3144203ACA0003] +GoodName=Legend of Zelda, The - Majora's Mask (U) (GC) +CRC=B443EB08 4DB31193 +SaveType=Flash RAM +Status=4 +Rumble=Yes +Players=1 + +[DBE9AF0DB46256E42B5C67902B696549] +GoodName=Legend of Zelda, The - Majora's Mask - Collector's Edition (E) (M4) (GC) [!] +CRC=6AECEC4F F0924814 +Players=1 + +[9F04C8E68534B870F707C247FA4B50FC] +GoodName=Zelda no Densetsu - Toki no Ocarina (J) (V1.0) [!] +CRC=EC7011B7 7616D72B +SaveType=SRAM +Status=4 +Rumble=Yes +Players=1 + +[A04EBD753276C52E95E25AF7683DA32D] +GoodName=Zelda no Densetsu - Toki no Ocarina (J) (V1.0) [T+Chi.02_madcell] +CRC=EC7011B7 7616D72B +RefMD5=9F04C8E68534B870F707C247FA4B50FC + +[D48CFE3FBF77D5335731509BFDE10D47] +GoodName=Zelda no Densetsu - Toki no Ocarina (J) (V1.0) [T+Chi] +CRC=EC7011B7 7616D72B +RefMD5=2C27B4E000E85FD78DBCA551F1B1C965 + +[BF0622C4C479E8FF5983DB3786F84293] +GoodName=Zelda no Densetsu - Toki no Ocarina (J) (V1.0) [f1] +CRC=9FD0987D 7EAE10D8 +RefMD5=9F04C8E68534B870F707C247FA4B50FC + +[1BF5F42B98C3E97948F01155F12E2D88] +GoodName=Zelda no Densetsu - Toki no Ocarina (J) (V1.1) [!] +CRC=D43DA81F 021E1E19 +SaveType=SRAM +Status=4 +Rumble=Yes +Players=1 + +[2258052847BDD056C8406A9EF6427F13] +GoodName=Zelda no Densetsu - Toki no Ocarina (J) (V1.2) [!] +CRC=693BA2AE B7F14E9F +RefMD5=1BF5F42B98C3E97948F01155F12E2D88 + +[E040DE91A74B61E3201DB0E2323F768A] +GoodName=Legend of Zelda, The - Ocarina of Time (E) (M3) (V1.0) [!] +CRC=B044B569 373C1985 +Status=4 +Players=1 +SaveType=SRAM +Rumble=Yes + +[2B60EF777F759B4F0E19DDF3CB84D9AB] +GoodName=Legend of Zelda, The - Ocarina of Time (E) (M3) (V1.0) [b1] +CRC=B044B569 373C1985 +RefMD5=E040DE91A74B61E3201DB0E2323F768A + +[20C68EAFDFCB1BA98B495E5BEED5E4B6] +GoodName=Legend of Zelda, The - Ocarina of Time (E) (M3) (V1.0) [f1] (zpfc) +CRC=EEE48FAF 6A92BAFF +RefMD5=E040DE91A74B61E3201DB0E2323F768A + +[175EDAB7F1A3DFBB5D23C4AA1B9D647E] +GoodName=Legend of Zelda, The - Ocarina of Time (E) (M3) (V1.0) [f2] (zpc1) +CRC=96961E83 B5DE0894 +RefMD5=E040DE91A74B61E3201DB0E2323F768A + +[D714580DD74C2C033F5E1B6DC0AEAC77] +GoodName=Legend of Zelda, The - Ocarina of Time (E) (M3) (V1.1) [!] +CRC=B2055FBD 0BAB4E0C +Status=4 +Players=1 +SaveType=SRAM +Rumble=Yes + +[5BD1FE107BF8106B2AB6650ABECD54D6] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [!] +CRC=EC7011B7 7616D72B +Status=4 +SaveType=SRAM +Players=1 +Rumble=Yes + +[A43A350385FA814EC9793B7ACD9E18F4] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) (Room121 Hack) +CRC=EBE8AA17 B1EF65E6 + +[640B928AD387B271094F64B9B93ABBFC] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T+Dut] +CRC=C7C3086D 93826E6E +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[6B3DB6AAA348F5721AFAF892E9B274DE] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T+Ita100] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[48CA89956120E0522D4B6B7E2810D04C] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T+Pol1.3] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[77BF20D3ECA19EBCFC5FED35F5CF65DC] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T+Por1.0] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[7FD3BA9B095C244367E84A6E4493349B] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T+Por1.5BetaFinal] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[7037DF7E0050A6D8B9B338C774A1CEB0] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T+Rus1.0beta2_Sergey Anton] +CRC=F8B1C7C7 1EFCA431 +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[B0BB6CAB395C93C966F1CA485FC1BFBC] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T+Rus101b2] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[10A2E08708E25195E063D2E05231AB66] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T+Spa01b_toruzz] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[BBCCE848679F3D0722CBA622505FB206] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T+Spa097b2] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[51778E50CE70466796F8D51C686224C4] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T+Spa1.0] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[44E6921A257E913977088B9B6BA9D25B] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T+Spa2.0_eduardo_a2j] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[AAEB5ACA09291E8F5FEDFA1F576D9F0A] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T-Pol1.2] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[1746D1CC38C42F08F0CD12D170C046B8] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T-Por.09] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[0D6331C2FA062F20272CC1A7F80F7271] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T-Por.14] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[FF7C6D9909D36D3A11D4C9052EAFB2E8] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T-Por.22] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[D4718E7EA75847646025D07626A1DF69] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T-Por.26] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[E784353B07DAFCB66690193B03CC3E1F] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T-Por.28] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[E6A5B9A18BB8D0508FBB703EB90703B7] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T-Por.30] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[79BE4EEEB2DD94E542516DFC189B099E] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T-Por.33] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[65AC7755CB41E937A1DC5C58902A4222] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T-Por.35] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[7B3AD8B6FE2D8F0602ED1006FD673970] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T-Por.37] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[F85FC5CE4451C1E9F3EE00B814489A51] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T-Por.42] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[92AED3D84A1AA0082B128E2CFD84C4AA] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T-Rus.01] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[5DF98AE5EAC2797555587D3391222FE4] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T-Rus.06] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[A1F18DE7D5570A502C7C93B7BF27E868] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T-Rus.82] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[A5A8A0249E14A052227B3ED71A98F0B4] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T-Rus099bfix] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[3FE076D5992C53DE6E095E53E53D9BC5] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T-Rus099wip] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[40F4A3A5FE703527E03C5747BC0A2FD6] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [T-Spa1.0_eduardo] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[EE38A903556C24520CD162FD046748A2] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [b1] +CRC=EC7011B7 7616D72B +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[8C1348872D9AC31FF9D22C07D7186CCB] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [f1] +CRC=9FD0987D 7EAE10D8 +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[DB2D737DE0F117D419B3A48442B6DB22] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [f2] +CRC=9FD0987D 7EAE10D8 +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[4472B1F6B9D594B6361DFA396F8CFB2C] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.0) [f3] +CRC=9FD0987D 7EAE10D8 +RefMD5=5BD1FE107BF8106B2AB6650ABECD54D6 + +[721FDCC6F5F34BE55C43A807F2A16AF4] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.1) [!] +CRC=D43DA81F 021E1E19 +Status=4 +SaveType=SRAM +Players=1 +Rumble=Yes + +[92C842FC8CF706FF290044D40A64D346] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.1) [T+Ita100] +CRC=D43DA81F 021E1E19 +RefMD5=721FDCC6F5F34BE55C43A807F2A16AF4 + +[F5B33DC7DC76BB308801CB518B1515F3] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.1) [T+Por1.0] +CRC=D43DA81F 021E1E19 +RefMD5=721FDCC6F5F34BE55C43A807F2A16AF4 + +[C949E4929A001B339DAE000A3DA9E0A8] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.1) [T+Por100%] +CRC=D43DA81F 021E1E19 +RefMD5=721FDCC6F5F34BE55C43A807F2A16AF4 + +[53E09E6B72F114440B389FA8549E8F97] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.1) [T+Spa01b_toruzz] +CRC=D43DA81F 021E1E19 +RefMD5=721FDCC6F5F34BE55C43A807F2A16AF4 + +[EA4FA94072849F88CAC96E60C1EDD41D] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.1) [T-Spa1.0_eduardo] +CRC=D43DA81F 021E1E19 +RefMD5=721FDCC6F5F34BE55C43A807F2A16AF4 + +[B3E1D1B92626BA86E5BDF0F18409A25B] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.1) [T-Spa1.0_eduardo][b1] +CRC=D43DA81F 021E1E19 +RefMD5=721FDCC6F5F34BE55C43A807F2A16AF4 + +[468F7EAA4B94B831AEED8B83C062B5CB] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.1) [b1] +CRC=D43DA81F 021E1E19 +RefMD5=721FDCC6F5F34BE55C43A807F2A16AF4 + +[DD824A8E1A6778FA5229433109AFAEFF] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.1) [b2] +CRC=CF8EC901 7EC2C48D +RefMD5=721FDCC6F5F34BE55C43A807F2A16AF4 + +[57A9719AD547C516342E1A15D5C28C3D] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (V1.2) [!] +CRC=693BA2AE B7F14E9F +Players=1 +SaveType=SRAM + +[CD09029EDCFB7C097AC01986A0F83D3F] +GoodName=Legend of Zelda, The - Ocarina of Time (U) (GC) [!] +CRC=F3DD35BA 4152E075 +Status=4 +Players=1 +SaveType=SRAM +Rumble=Yes + +[2C27B4E000E85FD78DBCA551F1B1C965] +GoodName=Legend of Zelda, The - Ocarina of Time (E) (GC) [!] +CRC=09465AC3 F8CB501B +Status=4 +Players=1 +SaveType=SRAM +Rumble=Yes + +[77314FE3C3EDD472D0554C12FEDB38F4] +GoodName=Legend of Zelda, The - Ocarina of Time (E) (GC) [f1] +CRC=A3271D83 05B533A5 +RefMD5=2C27B4E000E85FD78DBCA551F1B1C965 + +[1618403427E4344A57833043DB5CE3C3] +GoodName=Legend of Zelda, The - Ocarina of Time - Master Quest (E) (GC) [!] +CRC=1D4136F3 AF63EEA9 +Status=4 +Players=1 +SaveType=SRAM +Rumble=Yes + +[BC2ECBE96B04EDC56B08347DF7C7FECD] +GoodName=Legend of Zelda, The - Ocarina of Time - Master Quest (E) (GC) [T+Ita70%_Rulesless] +CRC=1D4136F3 AF63EEA9 +RefMD5=1618403427E4344A57833043DB5CE3C3 + +[83673D0A0EF4705C624043788EBF11EE] +GoodName=Legend of Zelda, The - Ocarina of Time - Master Quest (E) (GC) [T+Pol1.0] +CRC=1D4136F3 AF63EEA9 +RefMD5=1618403427E4344A57833043DB5CE3C3 + +[A34093AC2B038A92CCF525CAB4CE346E] +GoodName=Legend of Zelda, The - Ocarina of Time - Master Quest (E) (GC) [f1] (NTSC) +CRC=27A3831D B505A533 +RefMD5=1618403427E4344A57833043DB5CE3C3 + +[2DE4D0F0788871CC4BB6D30B60F72184] +GoodName=Legend of Zelda, The - Ocarina of Time - Master Quest (E) (GC) [h1C] +CRC=1D4136F3 AF63EEA9 +RefMD5=1618403427E4344A57833043DB5CE3C3 + +[DA35577FE54579F6A266931CC75F512D] +GoodName=Legend of Zelda, The - Ocarina of Time - Master Quest (U) (GC) [!] +CRC=F034001A AE47ED06 +Status=4 +Players=1 +SaveType=SRAM +Rumble=Yes + +[26A1616667EEC82288534C47B6927D45] +GoodName=Legend of Zelda, The - Ocarina of Time - Master Quest (U) (Debug Version) [f1] +CRC=917D1B16 831F9BE1 +RefMD5=DA35577FE54579F6A266931CC75F512D + +[8AD8D24EA38B68DFAB154C2585FB550C] +GoodName=Legend of Zelda, The - Ocarina of Time - Master Quest (U) (Debug Version) [f2] +CRC=917D18F6 69BC5453 +RefMD5=DA35577FE54579F6A266931CC75F512D + +[8CA71E87DE4CE5E9F6EC916202A623E9] +GoodName=Legend of Zelda, The - Ocarina of Time - Master Quest (U) (Debug Version) +CRC=917D18F6 69BC5453 +RefMD5=DA35577FE54579F6A266931CC75F512D + +[55685D6324EFDE5BC9D26C98706B0B8A] +GoodName=Les Razmoket - La Chasse Aux Tresors (F) [!] +CRC=2B696CB4 7B93DCD8 + +[AEE5016E6D60D12AD768E9F6D10ADDE8] +GoodName=Let's Smash Tennis (J) [!] +CRC=3D67C62B 31D03150 + +[EF878DFACF5CD5C00BA3297B0DC888D2] +GoodName=Light Force First N64 Demo by Fractal (PD) +CRC=7D292963 D5277C1F + +[9656C4A5251F054704E35134006CFFC7] +GoodName=Liner V1.00 by Colin Phillipps of Memir (PD) +CRC=8A8E474B 6458BF2B +Status=1 +SaveType=None +Players=4 +Rumble=No + +[AF701EE852ECD13F5F9F3284EBE60561] +GoodName=Liner V1.00 by Colin Phillipps of Memir (PD) [b1] +CRC=8A8E474B 6458BF2B +RefMD5=9656C4A5251F054704E35134006CFFC7 + +[500AFE6D6732E0888D108410D135B78E] +GoodName=Liner V1.00 by Colin Phillipps of Memir (PD) [b2] +CRC=8A8E474B 6458BF2B +RefMD5=9656C4A5251F054704E35134006CFFC7 + +[99380A8ED84C89E54DE53E0B1FB423C9] +GoodName=Liner V1.02 by Colin Phillipps of Memir (PD) +CRC=F7B1C8E8 70536D3E +Status=1 +SaveType=None +Players=4 +Rumble=No + +[E62F4FDCC82C244BA9709E40756D9B62] +GoodName=Lode Runner 3-D (E) (M5) [!] +CRC=60460680 305F0E72 +SaveType=Eeprom 4KB +Rumble=Yes +Players=1 +Status=3 + +[6B1E294A9199E6F22DBC6ABC59BD7568] +GoodName=Lode Runner 3-D (E) (M5) [b1] +CRC=E378B28A 0CA18BCC +RefMD5=E62F4FDCC82C244BA9709E40756D9B62 + +[D2BD8DD8C3BE1E8F0B8AE49206DBD7E5] +GoodName=Lode Runner 3-D (J) [!] +CRC=964ADD0B B29213DB +SaveType=Eeprom 4KB +Rumble=Yes +Players=1 +Status=3 + +[D038813541589F0B3F1F900F4FD22C9B] +GoodName=Lode Runner 3-D (U) [!] +CRC=255018DF 57D6AE3A +SaveType=Eeprom 4KB +Rumble=Yes +Players=1 +Status=3 + +[5FBA92D908B9962F26D389C85F6E88CF] +GoodName=Lode Runner 3-D (U) [b1][f1] (PAL) +CRC=275A4533 ACD94796 +RefMD5=D038813541589F0B3F1F900F4FD22C9B + +[3F5CA81183EA0E69F35417F6BBD7C5AC] +GoodName=Lode Runner 3-D (U) [f1] (PAL) +CRC=275A4533 ACD94796 +RefMD5=D038813541589F0B3F1F900F4FD22C9B + +[789482B7931419FCE7FC2472026E1C65] +GoodName=Lode Runner 3-D (U) [t1] +CRC=BD13F636 02079573 +RefMD5=D038813541589F0B3F1F900F4FD22C9B + +[1408FCF68B60D845F090107EF355A7E5] +GoodName=Looney Tunes - Duck Dodgers (E) (M6) [!] +CRC=0AA0055B 7637DF65 + +[4CCFF861AD2CFD65CC660F496C1D1664] +GoodName=Lt. Duck Dodgers (Prototype) +CRC=FBB9F1FA 6BF88689 + +[7A99628EDF0A6602D0C408F31B701435] +GoodName=Lylat Wars (A) (M3) [!] +CRC=2483F22B 136E025E +Rumble=Yes +Players=4 +SaveType=Eeprom 4KB + +[B182BBBC8CE22BD3F44BB6ED91F6ACD4] +GoodName=Lylat Wars (A) (M3) [f1] +CRC=2483F22B 136E025E +RefMD5=7A99628EDF0A6602D0C408F31B701435 + +[1E03884F7017230E96F741085E5817F8] +GoodName=Lylat Wars (A) (M3) [t1] (Boost) +CRC=AF13E2C2 2D502822 +RefMD5=7A99628EDF0A6602D0C408F31B701435 + +[A2957C46E62CEC7B10EDE4547F70425F] +GoodName=Lylat Wars (A) (M3) [t2] (No Damage-Unbreakable Wings) +CRC=8B31F4AD F366CBFA +RefMD5=7A99628EDF0A6602D0C408F31B701435 + +[884CCCA35CBEEDB8ED288326F9662100] +GoodName=Lylat Wars (E) (M3) [!] +CRC=F4CBE92C B392ED12 +Players=4 +Rumble=Yes +SaveType=Eeprom 4KB + +[F0FF28B0D26CDEFC11F22FE73148A6DC] +GoodName=Lylat Wars (E) (M3) [f1] +CRC=F4CBE92C B392ED12 +RefMD5=884CCCA35CBEEDB8ED288326F9662100 + +[37F7F2F2CFB488E48A2706FC8C4B2DD5] +GoodName=Lylat Wars (E) (M3) [f1][h1C] +CRC=F4CBE92C B392ED12 +RefMD5=884CCCA35CBEEDB8ED288326F9662100 + +[499013DA36AD50C94B2CE6B794CC9983] +GoodName=Lylat Wars (E) (M3) [f2] (NTSC) +CRC=F667DC04 86510A81 +RefMD5=884CCCA35CBEEDB8ED288326F9662100 + +[12F0671C66D25622C4C9CD71C678A1F6] +GoodName=Lylat Wars (E) (M3) [t1] (Boost) +CRC=834C19FF 8A93F7D4 +RefMD5=884CCCA35CBEEDB8ED288326F9662100 + +[281E754123EC0CC688C4AA7C853DE303] +GoodName=Lylat Wars (E) (M3) [t2] (No Damage-Unbreakable Wings) +CRC=58B5EA62 27177133 +RefMD5=884CCCA35CBEEDB8ED288326F9662100 + +[41FE06C68915666E5F8FEF81B8FFF59F] +GoodName=MAME 64 Beta 3 (PD) +CRC=D5CA46C2 F8555155 + +[3803F70982907C7C24713A7F9742B6CD] +GoodName=MAME 64 Demo (PD) [b1] +CRC=9CCE5B1D 6351E283 + +[0E2516C65B94214C891B2D07C3D92AEC] +GoodName=MAME 64 Demo (PD) [b2] +CRC=9CCE5B1D 6351E283 + +[42AC30399688F98E58BE6AD1D2217E56] +GoodName=MAME 64 Demo (PD) +CRC=9CCE5B1D 6351E283 + +[C9319D97DABE9E842401433A27E00DAC] +GoodName=MAME 64 V1.0 (PD) [b1] +CRC=9CCE5B1D 6351E283 + +[6591A5FCFFF8879382C966906C3186E0] +GoodName=MAME 64 V1.0 (PD) +CRC=9CCE5B1D 6351E283 + +[D63FAF99E7876C39A9ACA2659596342F] +GoodName=MMR by Count0 (PD) [b1] +CRC=9E6581AB 57CC8CED + +[65B71F404DC3CF9A135D3229FFEA3C15] +GoodName=MMR by Count0 (PD) +CRC=9E6581AB 57CC8CED + +[0054B7FC0C2ACBED650EFE727CDBA472] +GoodName=MRC - Multi Racing Championship (E) (M3) [!] +CRC=B8F0BD03 4479189E +SaveType=Eeprom 4KB +Players=4 + +[362D10C7D270AE48D83D1D7BB78BF527] +GoodName=MRC - Multi Racing Championship (E) (M3) [b1] +CRC=B8F0BD03 4479189E +RefMD5=0054B7FC0C2ACBED650EFE727CDBA472 + +[25E39A8B45FDDFA1989CE6662F87EF23] +GoodName=MRC - Multi Racing Championship (E) (M3) [b2] +CRC=B8F0BD03 4479189E +RefMD5=0054B7FC0C2ACBED650EFE727CDBA472 + +[F5723C4CCFB9A1CE28426962D59CC85F] +GoodName=MRC - Multi Racing Championship (E) (M3) [b3] +CRC=B8F0BD03 4479189E +RefMD5=0054B7FC0C2ACBED650EFE727CDBA472 + +[FEA06F46F61DEB721CF905C785299994] +GoodName=MRC - Multi Racing Championship (E) (M3) [h1C] +CRC=B8F0BD03 4479189E +RefMD5=0054B7FC0C2ACBED650EFE727CDBA472 + +[74904F302A25620D7F63C0CB5333D464] +GoodName=MRC - Multi Racing Championship (E) (M3) [o1] +CRC=B8F0BD03 4479189E +RefMD5=0054B7FC0C2ACBED650EFE727CDBA472 + +[8E18064A2C4B3EC15A20C3D676644B3A] +GoodName=MRC - Multi Racing Championship (J) [!] +CRC=A6B6B413 15D113CC +Players=4 +SaveType=Eeprom 4KB + +[C306C80A07743F75B0C69AF2B484E957] +GoodName=MRC - Multi Racing Championship (J) [b1] +CRC=A6B6B413 15D113CC +RefMD5=8E18064A2C4B3EC15A20C3D676644B3A + +[CBA2CCCD3C3772B96CDA7128090C1FD7] +GoodName=MRC - Multi Racing Championship (J) [b2] +CRC=A6B6B413 15D113CC +RefMD5=8E18064A2C4B3EC15A20C3D676644B3A + +[8F33FE36837198B3F21CC1F37FC67CC8] +GoodName=MRC - Multi Racing Championship (J) [b3] +CRC=A6B6B413 15D113CC +RefMD5=8E18064A2C4B3EC15A20C3D676644B3A + +[6073174A8DA1305CF91B59369FAEFDDF] +GoodName=MRC - Multi Racing Championship (J) [b4] +CRC=A6B6B413 15D113CC +RefMD5=8E18064A2C4B3EC15A20C3D676644B3A + +[BB82ADC51562F8CDDCDF4F6FAD2479BA] +GoodName=MRC - Multi Racing Championship (J) [b5] +CRC=A6B6B413 15D113CC +RefMD5=8E18064A2C4B3EC15A20C3D676644B3A + +[FC61D60F2C6FE4610F70CE4949A7A062] +GoodName=MRC - Multi Racing Championship (U) [!] +CRC=2AF9B65C 85E2A2D7 +Players=4 +SaveType=Eeprom 4KB + +[E38F1DAE2A2023A529B47A26E4666759] +GoodName=MRC - Multi Racing Championship (U) [b1] +CRC=2AF9B65C 85E2A2D7 +RefMD5=FC61D60F2C6FE4610F70CE4949A7A062 + +[535995506105D0EABA796E371660CBF2] +GoodName=MRC - Multi Racing Championship (U) [b2] +CRC=2AF9B65C 85E2A2D7 +RefMD5=FC61D60F2C6FE4610F70CE4949A7A062 + +[7E8F028411746CF816848384B788B624] +GoodName=MRC - Multi Racing Championship (U) [b3] +CRC=2AF9B65C 85E2A2D7 +RefMD5=FC61D60F2C6FE4610F70CE4949A7A062 + +[677356691E55A9061772585CDDFD7F76] +GoodName=MRC - Multi Racing Championship (U) [o1] +CRC=2AF9B65C 85E2A2D7 +RefMD5=FC61D60F2C6FE4610F70CE4949A7A062 + +[72F324B7E115618771C506AF3F604F8F] +GoodName=MSFTUG Intro #1 by LaC (PD) +CRC=94D3D5CB E8808606 + +[523883A766C662E8377CD256755B27B4] +GoodName=Mace - The Dark Age (E) [!] +CRC=1145443D 11610EDB +Players=4 +SaveType=None + +[9CF16783687686C8FE2ABE0B71316C3D] +GoodName=Mace - The Dark Age (E) [b1] +CRC=1145443D 11610EDB +RefMD5=523883A766C662E8377CD256755B27B4 + +[2249D931B5D2D4544EEB75E5B4136709] +GoodName=Mace - The Dark Age (E) [b2] +CRC=1145443D 11610EDB +RefMD5=523883A766C662E8377CD256755B27B4 + +[87BD533084ACB4DC6C3E01B32F26357C] +GoodName=Mace - The Dark Age (E) [o1] +CRC=1145443D 11610EDB +RefMD5=523883A766C662E8377CD256755B27B4 + +[8E2B951678785DB1F54A31F778BFA491] +GoodName=Mace - The Dark Age (E) [o2] +CRC=1145443D 11610EDB +RefMD5=523883A766C662E8377CD256755B27B4 + +[39A2BCA1C17CD4CF1A9F3AE2B725B5C6] +GoodName=Mace - The Dark Age (U) [!] +CRC=6B700750 29D621FE +Players=4 +SaveType=None + +[DF342B032ED1ED15C24448EC6BE9F34E] +GoodName=Mace - The Dark Age (U) [b1] +CRC=6B700750 29D621FE +RefMD5=39A2BCA1C17CD4CF1A9F3AE2B725B5C6 + +[57CB2D2F6C87F520016AACF7E2785222] +GoodName=Mace - The Dark Age (U) [b2] +CRC=6B700750 29D621FE +RefMD5=39A2BCA1C17CD4CF1A9F3AE2B725B5C6 + +[D1CE0FA3D46CA27F1C15E782ACEC49DA] +GoodName=Mace - The Dark Age (U) [b3] +CRC=022E6456 75BBB3C7 +RefMD5=39A2BCA1C17CD4CF1A9F3AE2B725B5C6 + +[243F8C4067D50D994C1E883968DE8C61] +GoodName=Mace - The Dark Age (U) [b4] +CRC=022E6456 75BBB3C7 +RefMD5=39A2BCA1C17CD4CF1A9F3AE2B725B5C6 + +[88B638825A16E46837FB521EDA328C5A] +GoodName=Mace - The Dark Age (U) [b5] +CRC=6B700750 29D621FE +RefMD5=39A2BCA1C17CD4CF1A9F3AE2B725B5C6 + +[62A0CE9A58273811E34CC73BE8E6F8C4] +GoodName=Mace - The Dark Age (U) [b6] +CRC=6B700750 29D621FE +RefMD5=39A2BCA1C17CD4CF1A9F3AE2B725B5C6 + +[B96ABFBD746BC25243D607613297D769] +GoodName=Mace - The Dark Age (U) [b7] +CRC=6B700750 29D621FE +RefMD5=39A2BCA1C17CD4CF1A9F3AE2B725B5C6 + +[1D4BD885DB0C0C5365698526077E10F4] +GoodName=Mace - The Dark Age (U) [b8] +CRC=6B700750 29D621FE +RefMD5=39A2BCA1C17CD4CF1A9F3AE2B725B5C6 + +[1C897EC059C6C34C8ED57E1965410F2E] +GoodName=Mace - The Dark Age (U) [b9] +CRC=6B700750 29D621FE +RefMD5=39A2BCA1C17CD4CF1A9F3AE2B725B5C6 + +[64D508C5E0F1050048BE429E20EF4B07] +GoodName=Mace - The Dark Age (U) [o1] +CRC=6B700750 29D621FE +RefMD5=39A2BCA1C17CD4CF1A9F3AE2B725B5C6 + +[67C96076459EB5F71733F39D7FCC76A3] +GoodName=Madden Football 64 (E) [!] +CRC=A197CB52 7520DE0E +SaveType=Eeprom 16KB +Players=4 + +[5CBF54627693F800524038127BBF46BF] +GoodName=Madden Football 64 (E) [b1] +CRC=A197CB52 7520DE0E +RefMD5=67C96076459EB5F71733F39D7FCC76A3 + +[903B912CE88626900221731224E9DBE8] +GoodName=Madden Football 64 (U) [!] +CRC=13836389 265B3C76 +SaveType=Eeprom 16KB +Players=4 + +[5CA2A7F712B6C5737D0B46E67C8DDA44] +GoodName=Madden Football 64 (U) [b1] +CRC=13836389 265B3C76 +RefMD5=903B912CE88626900221731224E9DBE8 + +[9AE941A12974B7B56CFA8B5EA1E670D7] +GoodName=Madden Football 64 (U) [b2] +CRC=13836389 265B3C76 +RefMD5=903B912CE88626900221731224E9DBE8 + +[CA7161F298DF38BC8182B21BB754DB4B] +GoodName=Madden Football 64 (U) [h1C] +CRC=13836389 265B3C76 +RefMD5=903B912CE88626900221731224E9DBE8 + +[732167D19C627CAF7384C780C64AB80A] +GoodName=Madden Football 64 (U) [o1] +CRC=13836389 265B3C76 +RefMD5=903B912CE88626900221731224E9DBE8 + +[E979BF2E2B43CCB5E2E0A2798AD7770C] +GoodName=Madden Football 64 (U) [o1][h1C] +CRC=13836389 265B3C76 +RefMD5=903B912CE88626900221731224E9DBE8 + +[0966CB688D6A5F1B22B4FAB5A393C0E2] +GoodName=Madden Football 64 (U) [o2] +CRC=13836389 265B3C76 +RefMD5=903B912CE88626900221731224E9DBE8 + +[DB24A5DBA68F21D4513A37F7A7B0CF60] +GoodName=Madden Football 64 (U) [o3] +CRC=13836389 265B3C76 +RefMD5=903B912CE88626900221731224E9DBE8 + +[955D19E26B4BA7CC941F86A54A0FC13D] +GoodName=Madden NFL 2000 (U) [!] +CRC=0CB81686 5FD85A81 +Players=4 +SaveType=Controller Pack + +[441FA65FAA5C12339F89A0BB7DB43C8F] +GoodName=Madden NFL 2001 (U) [!] +CRC=EB38F792 190EA246 +Players=4 +SaveType=Controller Pack + +[AD0F2EC565D7575FB37512BC8DF8A092] +GoodName=Madden NFL 2002 (U) [!] +CRC=D7134F8D C11A00B5 +SaveType=Controller Pack +Players=4 + +[E7BF80861A0AB2A788959463D953B5D5] +GoodName=Madden NFL 99 (E) [!] +CRC=3925D625 8C83C75E +Players=4 +SaveType=Controller Pack + +[9CB5F5CD6AB141454D645C92FD9BF67C] +GoodName=Madden NFL 99 (E) [h1C] +CRC=3925D625 8C83C75E +RefMD5=E7BF80861A0AB2A788959463D953B5D5 + +[507CEAB72EF2A1BF145BF190F5CE1C80] +GoodName=Madden NFL 99 (U) [!] +CRC=DEB78BBA 52F6BD9D +Players=4 +SaveType=Controller Pack + +[C049FCD4CB185A553D8122CFE6C30139] +GoodName=Madden NFL 99 (U) [o1] +CRC=DEB78BBA 52F6BD9D +RefMD5=507CEAB72EF2A1BF145BF190F5CE1C80 + +[20E51B27E8098A9D101B44689014C281] +GoodName=Magical Tetris Challenge (E) [!] +CRC=E4906679 9F243F05 +Players=4 +SaveType=None + +[20D02EECFA887DC5A31948B18B4BB18D] +GoodName=Magical Tetris Challenge (E) [b1] +CRC=E4906679 9F243F05 +RefMD5=20E51B27E8098A9D101B44689014C281 + +[5BDE53960AD95F4C25C76C0F70C35244] +GoodName=Magical Tetris Challenge (E) [f1] (NTSC) +CRC=70BF6C4C 6F365E21 +RefMD5=20E51B27E8098A9D101B44689014C281 + +[E0992A90191BE4F1B2BA02258599334E] +GoodName=Magical Tetris Challenge (G) [!] +CRC=E1EF93F7 14908B0B +Players=4 +SaveType=None + +[79FCC98002D1F4C79DEAF55784222DF8] +GoodName=Magical Tetris Challenge (U) [!] +CRC=75B61647 7ADABF78 +Players=4 +SaveType=None + +[BD5BB4CE1FACE911F9D8C777E2594998] +GoodName=Magical Tetris Challenge (U) [b1][hI] +CRC=CDCCFF87 1D76A49E +RefMD5=79FCC98002D1F4C79DEAF55784222DF8 + +[36BEDFD15CB70478916BAA469491D80D] +GoodName=Magical Tetris Challenge (U) [hI] +CRC=CDCCFF87 1D76A49E +RefMD5=79FCC98002D1F4C79DEAF55784222DF8 + +[F1FF1F364C459701F42BEB8989675D44] +GoodName=Magical Tetris Challenge Featuring Mickey (J) [!] +CRC=80C8564A 929C65AB +Players=4 +SaveType=None + +[9F6DB67262220C62536CEBE0AF3C8E73] +GoodName=Magical Tetris Challenge Featuring Mickey (J) [b1] +CRC=E6FCB468 CFAC7528 +RefMD5=F1FF1F364C459701F42BEB8989675D44 + +[8AE2E8F0C356FEE638C8D908DCBB3381] +GoodName=Mahjong 64 (J) [!] +CRC=C53EDC41 ECE19359 +Players=1 + +[E67651E58A4B864765A752E3BEB5F4E4] +GoodName=Mahjong 64 (J) [o1] +CRC=C53EDC41 ECE19359 +RefMD5=8AE2E8F0C356FEE638C8D908DCBB3381 + +[F931E1DF9524BACEF6B731D50D7DC10F] +GoodName=Mahjong 64 (J) [o2] +CRC=C53EDC41 ECE19359 +RefMD5=8AE2E8F0C356FEE638C8D908DCBB3381 + +[E942A3EEB1EB572BADD6F705EB12A22C] +GoodName=Mahjong Hourouki Classic (J) [!] +CRC=CCCC821E 96E88A83 +Players=1 + +[50A8B47E5F8FE5BF955AFA70FE3893AC] +GoodName=Mahjong Hourouki Classic (J) [b1] +CRC=CCCC821E 96E88A83 +RefMD5=E942A3EEB1EB572BADD6F705EB12A22C + +[D2CB04B88E565170D820E3CF78B54863] +GoodName=Mahjong Hourouki Classic (J) [b2] +CRC=CCCC821E 96E88A83 +RefMD5=E942A3EEB1EB572BADD6F705EB12A22C + +[D1855B19BA0D65C103FE9318F14F5D7D] +GoodName=Mahjong Hourouki Classic (J) [b3] +CRC=CCCC821E 96E88A83 +RefMD5=E942A3EEB1EB572BADD6F705EB12A22C + +[CF0D228E8EFDF823A227979BB352DD5B] +GoodName=Mahjong Master (J) [!] +CRC=0FC42C70 8754F1CD +Players=1 + +[AD1AD9FE15C4565FF88B9B48AF6F300C] +GoodName=Mahjong Master (J) [b1] +CRC=0FC42C70 8754F1CD +RefMD5=CF0D228E8EFDF823A227979BB352DD5B + +[E0D1170D521B49E3A5EDACA3A6F579AB] +GoodName=Mahjong Master (J) [b2] +CRC=0FC42C70 8754F1CD +RefMD5=CF0D228E8EFDF823A227979BB352DD5B + +[3BD16F3DDB0DD890412BFE1E59CA5463] +GoodName=Mahjong Master (J) [o1] +CRC=0FC42C70 8754F1CD +RefMD5=CF0D228E8EFDF823A227979BB352DD5B + +[152B9939A5F50734D5401980028856B4] +GoodName=Major League Baseball Featuring Ken Griffey Jr. (E) [!] +CRC=CDB998BE 1024A5C8 +Players=4 +SaveType=SRAM + +[62CD83FC8FC8E8CF8899320BF25474CE] +GoodName=Major League Baseball Featuring Ken Griffey Jr. (E) [b1] +CRC=59F34558 0C3130E4 +RefMD5=152B9939A5F50734D5401980028856B4 + +[D5696CB5A4F2185BD8469DF018B7856B] +GoodName=Major League Baseball Featuring Ken Griffey Jr. (E) [f1] +CRC=59F34558 0C3130E4 +RefMD5=152B9939A5F50734D5401980028856B4 + +[764F22AD3D0F59667A7F083D2F789B31] +GoodName=Major League Baseball Featuring Ken Griffey Jr. (U) [!] +CRC=80C1C05C EA065EF4 +Players=4 +SaveType=SRAM + +[97FE61E8719CF0A4747301E97C759CBF] +GoodName=Major League Baseball Featuring Ken Griffey Jr. (U) [b1] +CRC=B1CF1114 5E59B81D +RefMD5=764F22AD3D0F59667A7F083D2F789B31 + +[E1BD016961EDEB895F12676AD4B77FB5] +GoodName=Major League Baseball Featuring Ken Griffey Jr. (U) [b2] +CRC=0BFC12D9 1B377DA7 +RefMD5=764F22AD3D0F59667A7F083D2F789B31 + +[16F2644156AC9DD15CA8CC01DEAE5E7E] +GoodName=Major League Baseball Featuring Ken Griffey Jr. (U) [b3] +CRC=80C1C05C EA065EF4 +RefMD5=764F22AD3D0F59667A7F083D2F789B31 + +[257057553D60C1DD1B7FDC5814CB21D9] +GoodName=Major League Baseball Featuring Ken Griffey Jr. (U) [f1] +CRC=B1CF1114 5E59B81D +RefMD5=764F22AD3D0F59667A7F083D2F789B31 + +[30B2E1F7F3AFDC5D8E6A42C8885AAD93] +GoodName=Mandelbrot Zoomer by RedBox (PD) +CRC=30E6FE79 3EEA5386 +Status=3 +Players=0 +Rumble=No +SaveType=None + +[4E054610A872E1313228637C815E514C] +GoodName=Manic Miner - Hidden Levels by RedboX (PD) +CRC=A47D4AD4 F5B0C6CB +Players=1 +SaveType=None +Status=1 +Rumble=No + +[B18BC60EA6B9C72048FD84A2B8F182D4] +GoodName=Manic Miner by RedboX (PD) +CRC=A47D4AD4 8BFA81F9 +Players=1 +SaveType=None +Status=1 +Rumble=No + +[4D010AE1AF4B04D6B70B799C56F05993] +GoodName=Mario Golf (E) [!] +CRC=62E957D0 7FC15A5D +Players=4 +SaveType=SRAM + +[CF6BD6E20B40635B0E6DED5BB5114875] +GoodName=Mario Golf (E) [f1] (Z64-Save) +CRC=1D82BE21 7EF19C9A +RefMD5=4D010AE1AF4B04D6B70B799C56F05993 + +[02C8E8FD7EB19BFEB325E2DB0380506A] +GoodName=Mario Golf (E) [f2] (Z64-Save) +CRC=1D82BE21 7EF19C9A +RefMD5=4D010AE1AF4B04D6B70B799C56F05993 + +[18E09C0650FA3F83A90089DADD96A213] +GoodName=Mario Golf (E) [h1C] +CRC=62E957D0 7FC15A5D +RefMD5=4D010AE1AF4B04D6B70B799C56F05993 + +[55634FF90EE997790781F79A5B0097EE] +GoodName=Mario Golf (E) [o1] +CRC=62E957D0 7FC15A5D +RefMD5=4D010AE1AF4B04D6B70B799C56F05993 + +[78BB5B9A279156BD61BE132817A9B2C8] +GoodName=Mario Golf (E) [o1][h1C] +CRC=62E957D0 7FC15A5D +RefMD5=4D010AE1AF4B04D6B70B799C56F05993 + +[7A5D0D77A462B5A7C372FB19EFDE1A5F] +GoodName=Mario Golf (U) [!] +CRC=664BA3D4 678A80B7 +Players=4 +SaveType=SRAM + +[D31466B4B14B03387FE52FBBBCD25A5C] +GoodName=Mario Golf (U) [b1] +CRC=E8761702 26AD5DBE +RefMD5=7A5D0D77A462B5A7C372FB19EFDE1A5F + +[11FED930D4C4DD0CA7CB03B5F1BF0A12] +GoodName=Mario Golf (U) [b1][f1] (PAL) +CRC=84CDFB72 9CA8D544 +RefMD5=7A5D0D77A462B5A7C372FB19EFDE1A5F + +[374FD81C3E8E858EEB2226501659B333] +GoodName=Mario Golf (U) [b2] +CRC=84CDFB72 9CA8D544 +RefMD5=7A5D0D77A462B5A7C372FB19EFDE1A5F + +[BE28EF71E1EE0092EEC4AA395ACFEEFF] +GoodName=Mario Golf (U) [f1] (PAL) +CRC=84CDFB72 9CA8D544 +RefMD5=7A5D0D77A462B5A7C372FB19EFDE1A5F + +[2FACDF2F3E52EE8A603DE79348E441E6] +GoodName=Mario Golf (U) [f2] (Z64-Save) +CRC=A19FA3D0 E06B2D11 +RefMD5=7A5D0D77A462B5A7C372FB19EFDE1A5F + +[903E6929666531D72D05D1E4C522E305] +GoodName=Mario Golf (U) [o2][h1C] +CRC=664BA3D4 678A80B7 +RefMD5=7A5D0D77A462B5A7C372FB19EFDE1A5F + +[12569B4FA5239A3AD53DE5D2E0243488] +GoodName=Mario Golf (U) [t1] +CRC=26647A17 8D3980C3 +RefMD5=7A5D0D77A462B5A7C372FB19EFDE1A5F + +[E5A041B1B7C8E3B4C2E8178E5A138E2D] +GoodName=Mario Golf 64 (J) [!] +CRC=D48944D1 B0D93A0E +Players=4 +SaveType=SRAM + +[B5A98CED4B9A10682988CCB219A5C9A7] +GoodName=Mario Golf 64 (J) [b1] +CRC=D48944D1 B0D93A0E +RefMD5=E5A041B1B7C8E3B4C2E8178E5A138E2D + +[334D4E8443A67E964649B28428C8F1AE] +GoodName=Mario Golf 64 (J) [b1][f1] (PAL) +CRC=B771E0A9 7B4A96E6 +RefMD5=E5A041B1B7C8E3B4C2E8178E5A138E2D + +[6D84657C9A145E67B2A8A61CD31A7218] +GoodName=Mario Golf 64 (J) [b2] +CRC=D48944D1 B0D93A0E +RefMD5=E5A041B1B7C8E3B4C2E8178E5A138E2D + +[C14090CD5CF313A471B5CD3D55EC0B53] +GoodName=Mario Golf 64 (J) [f1] (PAL) +CRC=B771E0A9 7B4A96E6 +RefMD5=E5A041B1B7C8E3B4C2E8178E5A138E2D + +[CD87BA2998D63C13B4366EB2C54E1EB6] +GoodName=Mario Golf 64 (J) [o1] +CRC=D48944D1 B0D93A0E +RefMD5=E5A041B1B7C8E3B4C2E8178E5A138E2D + +[8FAD1E4FA7BAF1443B7F21AD1947B429] +GoodName=Mario Kart 64 (E) (V1.0) [!] +CRC=C3B6DE9D 65D2DE76 +Status=3 +SaveType=Eeprom 4KB +Players=4 +Rumble=No + +[EC0FAE8002AC6356E0470CE21BFEFA4F] +GoodName=Mario Kart 64 (E) (V1.0) (Super W00ting Hack) +CRC=E470469D E105C984 +RefMD5=8FAD1E4FA7BAF1443B7F21AD1947B429 + +[B97FC8B1D00B9D673C229CA7FAE453D4] +GoodName=Mario Kart 64 (E) (V1.0) [T+Ita_Cattivik66] +CRC=C3B6DE9D 65D2DE76 +RefMD5=8FAD1E4FA7BAF1443B7F21AD1947B429 + +[E292551471766D7F51907F2BC65079AA] +GoodName=Mario Kart 64 (E) (V1.0) [b1] +CRC=C3B6DE9D 65D2DE76 +RefMD5=8FAD1E4FA7BAF1443B7F21AD1947B429 + +[8E632F2AFF9AEF3F5C1AE2FEBD482D9D] +GoodName=Mario Kart 64 (E) (V1.0) [b2] +CRC=C3B6DE9D 65D2DE76 +RefMD5=8FAD1E4FA7BAF1443B7F21AD1947B429 + +[2BB149A583FDEFEA96805F628FE42FD9] +GoodName=Mario Kart 64 (E) (V1.1) [!] +CRC=2577C7D4 D18FAAAE +Status=3 +SaveType=Eeprom 4KB +Players=4 +Rumble=Yes + +[2A64632C71FFB90DF3AE83836DEDD7A6] +GoodName=Mario Kart 64 (E) (V1.1) [T+Ita_Cattivik66][b1] +CRC=2577C7D4 D18FAAAE +RefMD5=2BB149A583FDEFEA96805F628FE42FD9 + +[A30CFA60CCCE25F1324D4AD98C26AF5D] +GoodName=Mario Kart 64 (E) (V1.1) [o1] +CRC=2577C7D4 D18FAAAE +RefMD5=2BB149A583FDEFEA96805F628FE42FD9 + +[BF964CECA78A13A82055EBDA80B95CCA] +GoodName=Mario Kart 64 (J) (V1.0) [!] +CRC=6BFF4758 E5FF5D5E +Status=3 +SaveType=Eeprom 4KB +Players=4 +Rumble=No + +[8FD3C06ED13CD27BB3D664C92A455AA8] +GoodName=Mario Kart 64 (J) (V1.0) [T+Ita_Cattivik66][b1] +CRC=6BFF4758 E5FF5D5E +RefMD5=BF964CECA78A13A82055EBDA80B95CCA + +[37AA3A354FBE508F5449E0C515083128] +GoodName=Mario Kart 64 (J) (V1.0) [b1] +CRC=6BFF4758 E5FF5D5E +RefMD5=BF964CECA78A13A82055EBDA80B95CCA + +[80B4F92970CBB13344F57E827C60959B] +GoodName=Mario Kart 64 (J) (V1.0) [b2] +CRC=6BFF4758 E5FF5D5E +RefMD5=BF964CECA78A13A82055EBDA80B95CCA + +[36295982651A9974EB7342B1DD5245E1] +GoodName=Mario Kart 64 (J) (V1.0) [o1] +CRC=6BFF4758 E5FF5D5E +RefMD5=BF964CECA78A13A82055EBDA80B95CCA + +[60535265BAE43DDFCBDB0D71594B1693] +GoodName=Mario Kart 64 (J) (V1.1) [!] +CRC=C9C3A987 5810344C +Status=3 +SaveType=Eeprom 4KB +Players=4 +Rumble=No + +[231F0134D2899C08930F6E34682D2C0B] +GoodName=Mario Kart 64 (J) (V1.1) [b1] +CRC=C9C3A987 5810344C +RefMD5=60535265BAE43DDFCBDB0D71594B1693 + +[84F11CACB9608E2E595FA5FBB8C91CE9] +GoodName=Mario Kart 64 (J) (V1.1) [b1][T+Ita_Cattivik66] +CRC=C9C3A987 5810344C +RefMD5=60535265BAE43DDFCBDB0D71594B1693 + +[B5D68FF8E5A982400556C530409263DB] +GoodName=Mario Kart 64 (J) (V1.1) [b1][f1] (PAL) +CRC=B6F68615 F4E26039 +RefMD5=60535265BAE43DDFCBDB0D71594B1693 + +[3A67D9986F54EB282924FCA4CD5F6DFF] +GoodName=Mario Kart 64 (U) [!] +CRC=3E5055B6 2E92DA52 +Status=3 +SaveType=Eeprom 4KB +Players=4 +Rumble=No + +[B63346465FE70DA3B1E7493CE5A15A31] +GoodName=Mario Kart 64 (U) (Super W00ting Hack) +CRC=4D9C55B6 85E58D87 +RefMD5=3A67D9986F54EB282924FCA4CD5F6DFF + +[D1958141566ECC4942C71D1E97171639] +GoodName=Mario Kart 64 (U) [T+Ita0.01_Cattivik66] +CRC=3E5055B6 2E92DA52 +RefMD5=3A67D9986F54EB282924FCA4CD5F6DFF + +[65CBD8DCEC6B7CE61E1CB233EFA4A317] +GoodName=Mario Kart 64 (U) [T+Por1.0_Dr_X] +CRC=3E5055B6 2E92DA52 +RefMD5=3A67D9986F54EB282924FCA4CD5F6DFF + +[4A5E85A3E7118A742E3678F8F7E82B0E] +GoodName=Mario Kart 64 (U) [b1] +CRC=3E5055B6 2E92DA52 +RefMD5=3A67D9986F54EB282924FCA4CD5F6DFF + +[ABDB8D8C53E1F938853EC80742C8AF77] +GoodName=Mario Kart 64 (U) [b2] +CRC=3E5055B6 2E92DA52 +RefMD5=3A67D9986F54EB282924FCA4CD5F6DFF + +[FE75ABB3934F88429E138019146E8393] +GoodName=Mario Kart 64 (U) [b3] +CRC=3E5055B6 2E92DA52 +RefMD5=3A67D9986F54EB282924FCA4CD5F6DFF + +[C3565B1C983B83C6C965BB88E24135B2] +GoodName=Mario Kart 64 (U) [b4] +CRC=3E5055B6 2E92DA52 +RefMD5=3A67D9986F54EB282924FCA4CD5F6DFF + +[7D54D888964A3B0D058EB80886C44C88] +GoodName=Mario Kart 64 (U) [h1C] +CRC=3E5055B6 2E92DA52 +RefMD5=3A67D9986F54EB282924FCA4CD5F6DFF + +[7C5E794E856311403FEF548DAE98A183] +GoodName=Mario Kart 64 (U) [o1] +CRC=3E5055B6 2E92DA52 +RefMD5=3A67D9986F54EB282924FCA4CD5F6DFF + +[6C634D0CE7CD99CCCBB4CE8EB837EDB4] +GoodName=Mario Kart 64 (U) [o2] +CRC=3E5055B6 2E92DA52 +RefMD5=3A67D9986F54EB282924FCA4CD5F6DFF + +[3AA8C8C023F6AB8384CBDD412DECF977] +GoodName=Mario Kart 64 (U) [t1] +CRC=465035CA C6DE1A09 +RefMD5=3A67D9986F54EB282924FCA4CD5F6DFF + +[22E183BD8AF57A79DEB6679CA919B61E] +GoodName=Mario Kart 64 (U) [t2] (Course Cheat) +CRC=085055B6 5346ED7B +RefMD5=3A67D9986F54EB282924FCA4CD5F6DFF + +[9F85F64C6DD30CA67EB355EF0332F102] +GoodName=Mario Kart 64 (U) [t3] (Star Cheat) +CRC=0B623F24 F8D4F434 +RefMD5=3A67D9986F54EB282924FCA4CD5F6DFF + +[0B2B6CC62CFEEB7C4642A3643A3ED3C8] +GoodName=Mario Kart 64 (U) [t4] +CRC=465035CA C6DE1A09 +RefMD5=3A67D9986F54EB282924FCA4CD5F6DFF + +[9773150709BD804B8E57E35F1D6B0EED] +GoodName=Mario Party (E) (M3) [!] +CRC=9C663069 80F24A80 +Players=4 +SaveType=Eeprom 4KB + +[2608A4D7A695D0B1A1BBC47695EACE0E] +GoodName=Mario Party (E) (M3) [b1] +CRC=9C663069 80F24A80 +RefMD5=9773150709BD804B8E57E35F1D6B0EED + +[37EB3D60A2E85BE5077F73A5DF651F05] +GoodName=Mario Party (E) (M3) [h1C] +CRC=9C663069 80F24A80 +RefMD5=9773150709BD804B8E57E35F1D6B0EED + +[3F556CC3B3A996CD2F471FA0D992D529] +GoodName=Mario Party (J) [!] +CRC=ADA815BE 6028622F +Players=4 +SaveType=Eeprom 4KB + +[8BC2712139FBF0C56C8EA835802C52DC] +GoodName=Mario Party (U) [!] +CRC=2829657E A0621877 +Players=4 +SaveType=Eeprom 4KB + +[D072DDBCC5961AE85E6FA9BF50241370] +GoodName=Mario Party (U) [f1] (PAL) +CRC=5B904BAE 4CA06CC9 +RefMD5=8BC2712139FBF0C56C8EA835802C52DC + +[F70112B652B0EE4856AF83F4E8005C31] +GoodName=Mario Party 2 (E) (M5) [!] +CRC=82380387 DFC744D9 +Players=4 +SaveType=Eeprom 4KB + +[F23E4CD437465F3E725262253CF3EA59] +GoodName=Mario Party 2 (J) [!] +CRC=ED567D0F 38B08915 +Players=4 +SaveType=Eeprom 4KB + +[04840612A35ECE222AFDB2DFBF926409] +GoodName=Mario Party 2 (U) [!] +CRC=9EA95858 AF72B618 +Players=4 +SaveType=Eeprom 4KB + +[F253C5A0FB69AB56A1548D435AF84D0F] +GoodName=Mario Party 2 (U) [f1] (PAL) +CRC=C6C71B88 6422C633 +RefMD5=04840612A35ECE222AFDB2DFBF926409 + +[CD75CCD32EB435713EA54DFF313FA50C] +GoodName=Mario Party 2 (U) [f2] (PAL) +CRC=C63B1ADA 9CEAEB08 +RefMD5=04840612A35ECE222AFDB2DFBF926409 + +[8E62EC6FBE3CC9FF6284191C9C88E68F] +GoodName=Mario Party 3 (E) (M4) [!] +CRC=C5674160 0F5F453C +SaveType=Eeprom 16KB +Players=4 + +[ED99F330CE7A2638AB13351012EEB86B] +GoodName=Mario Party 3 (J) [!] +CRC=0B0AB4CD 7B158937 +SaveType=Eeprom 16KB +Players=4 + +[76A8BBC81BC2060EC99C9645867237CC] +GoodName=Mario Party 3 (U) [!] +CRC=7C3829D9 6E8247CE +SaveType=Eeprom 16KB +Players=4 + +[BDD79F498F37D01B8958F56EC6FFA097] +GoodName=Mario Party 3 (U) [f1] +CRC=65DB63E3 64357A65 +RefMD5=76A8BBC81BC2060EC99C9645867237CC + +[F8F9116279FBAFD511748542994598B2] +GoodName=Mario Party 3 (U) [f2] (PAL) +CRC=822E0915 0338FD50 +RefMD5=76A8BBC81BC2060EC99C9645867237CC + +[5C3D2699C01EBD30D42C6F52491EA7F0] +GoodName=Mario Party 3 (U) [f3] +CRC=DF0C666A 1F52B368 +RefMD5=76A8BBC81BC2060EC99C9645867237CC + +[DF54F17FB84FB5B5BCF6AA9AF65B0942] +GoodName=Mario Story (J) [!] +CRC=3BA7CDDC 464E52A0 +Status=2 +Players=1 +SaveType=Flash RAM +Rumble=Yes + +[FFF9B3E22ABB9B60215DAFB13AD5A4DE] +GoodName=Mario Tennis (E) [!] +CRC=839F3AD5 406D15FA +SaveType=Eeprom 16KB +Players=4 + +[759358FAD1ED5AE31DCB2001A07F2FE5] +GoodName=Mario Tennis (U) [!] +CRC=5001CF4F F30CB3BD +SaveType=Eeprom 16KB +Players=4 + +[7FB25633FDB226F35A222B4EA17BD2DC] +GoodName=Mario Tennis (U) [f1] (Save) +CRC=BC47A8BF 5529DE0F +RefMD5=759358FAD1ED5AE31DCB2001A07F2FE5 + +[8EB1C2443D0B2E6EDA52A4EEA66D6C35] +GoodName=Mario Tennis 64 (J) [!] +CRC=3A6C42B5 1ACADA1B +SaveType=Eeprom 16KB +Players=4 + +[DD4A580E27D82BCCA6A229BA17C69368] +GoodName=Mario Tennis 64 (J) [f1] (Country Check) +CRC=3A3FA519 9595CD82 +RefMD5=8EB1C2443D0B2E6EDA52A4EEA66D6C35 + +[6BAB5F2A62A4BABAF456D5DA2976871D] +GoodName=Mario no Photopie (J) [!] +CRC=9A9890AC F0C313DF +Players=1 + +[7F4ED2AAF94A2197B0AD63C6ECE9DEA9] +GoodName=Mario no Photopie (J) [a1] +CRC=9A9890AC F0C313DF +Players=1 + +[2202B39B9017BB061822552AF83FD331] +GoodName=MeeTING Demo by Renderman (PD) [b1] +CRC=A806749B 1F521F45 + +[DD65E5F4B192A12966BBDD6718B694E6] +GoodName=MeeTING Demo by Renderman (PD) +CRC=A806749B 1F521F45 + +[3620674ACB51E436D5150738AC1C0969] +GoodName=Mega Man 64 (U) [!] +CRC=0EC158F5 FB3E6896 +Players=1 +SaveType=Flash RAM +Rumble=Yes + +[01A1304D98A58E2D5069079A4F4441F9] +GoodName=Mega Man 64 (U) [t1][f1] (PAL-NTSC) +CRC=B63200D4 E36CF5AA +RefMD5=3620674ACB51E436D5150738AC1C0969 + +[2F4C29DD26B6D5311F3D46063A393687] +GoodName=Memory Manager V1.0b by R. Bubba Magillicutty (PD) +CRC=4DEC9986 A8904450 + +[C77AC9BC65EEEA761FC8B081AF728CDB] +GoodName=Mempack Manager for Jr 0.9 by deas (PD) +CRC=81A3F478 B6965E3E + +[E1A9CBDB3C066E4BC0A4FB71ADA70CB2] +GoodName=Mempack Manager for Jr 0.9b by deas (PD) +CRC=1EC6C03C B0954ADA + +[9CF33B5F0D677C7BCE85CB877B0942CD] +GoodName=Mempack Manager for Jr 0.9c by deas (PD) +CRC=D2015E56 A9FE0CE6 + +[BAD7C9731029AD4880FF4B92E5569065] +GoodName=Mempack to N64 Uploader by Destop V1.0 (PD) +CRC=6A097D8B F999048C + +[A4039368E0472C68E3072C02C7A80F94] +GoodName=Mia Hamm Soccer 64 (U) (M2) [!] +CRC=1001F10C 3D51D8C1 +Players=4 +SaveType=Controller Pack + +[892222CC4BAF9958405D20BC492175BF] +GoodName=Michael Owens WLS 2000 (E) [!] +CRC=E36166C2 8613A2E5 +Players=4 +SaveType=Controller Pack + +[6A814E33BB6D449BE23FBBCAC7606C0B] +GoodName=Michael Owens WLS 2000 (E) [b1] +CRC=E36166C2 8613A2E5 +RefMD5=892222CC4BAF9958405D20BC492175BF + +[EC700909D09C081DA0E4BAE454C657F0] +GoodName=Michael Owens WLS 2000 (E) [b2] +CRC=9ABC592A 2AA5DEE2 +RefMD5=892222CC4BAF9958405D20BC492175BF + +[BD5D214BED53C4682E9FF8B8E9919CD4] +GoodName=Michael Owens WLS 2000 (E) [f1] (NTSC) +CRC=9ABC592A 2AA5DEE2 +RefMD5=892222CC4BAF9958405D20BC492175BF + +[288A514E98972BF9D329167AA29E66B6] +GoodName=Mickey no Racing Challenge USA (J) [!] +CRC=736AE6AF 4117E9C7 +Players=4 +SaveType=Eeprom 4KB + +[5BA3DC37860C08A209F24286B8DFEC8C] +GoodName=Mickey's Speedway USA (E) (M5) [!] +CRC=DED0DD9A E78225A7 +Players=4 +SaveType=Eeprom 4KB + +[0BF64427CF68E49C70E9EC2C9D815209] +GoodName=Mickey's Speedway USA (U) [!] +CRC=FA8C4571 BBE7F9C0 +Players=4 +SaveType=Eeprom 4KB + +[B025F0E20FB41A0AAE280847329CB919] +GoodName=Mickey's Speedway USA (U) [t1] +CRC=38112EC7 E91410C3 +RefMD5=0BF64427CF68E49C70E9EC2C9D815209 + +[9A8465E302263D635557A14AA197FE3C] +GoodName=Micro Machines 64 Turbo (E) (M5) [!] +CRC=2A49018D D0034A02 +SaveType=Controller Pack + +[68246CF0AB9DE7B6F84751FCC86A959A] +GoodName=Micro Machines 64 Turbo (E) (M5) [b1] +CRC=2A49018D D0034A02 +RefMD5=9A8465E302263D635557A14AA197FE3C + +[7D61BB9D25BAF9A608139592DC4E28DC] +GoodName=Micro Machines 64 Turbo (E) (M5) [b1][f1] (NTSC) +CRC=700F6DD9 E2EB805F +RefMD5=9A8465E302263D635557A14AA197FE3C + +[E48559E990DE24458F8A3ACDF3AEE901] +GoodName=Micro Machines 64 Turbo (E) (M5) [t1] +CRC=ADCDEC69 D0179F38 +RefMD5=9A8465E302263D635557A14AA197FE3C + +[74EB415E16C333B252847A8E09432FD9] +GoodName=Micro Machines 64 Turbo (U) [!] +CRC=F1850C35 ACE07912 +SaveType=Controller Pack + +[BB9F2E48015D9DFB347B4BE4C2DFB334] +GoodName=Micro Machines 64 Turbo (U) [a1][!] +CRC=F1850C35 ACE07912 +SaveType=Controller Pack + +[656B1442015CF95D4D1E01713309F71D] +GoodName=Micro Machines 64 Turbo (U) [b1] +CRC=F1850C35 ACE07912 +RefMD5=74EB415E16C333B252847A8E09432FD9 + +[C44D99D0437142211DACA4826F8ECB88] +GoodName=Micro Machines 64 Turbo (U) [t1] +CRC=A986ECC1 50AC924B +RefMD5=74EB415E16C333B252847A8E09432FD9 + +[2B86775EA4D848202E4F4A39C33571CA] +GoodName=Midway's Greatest Arcade Hits Volume 1 (U) [!] +CRC=E4B35E4C 1AC45CC9 +SaveType=Controller Pack +Players=1 + +[47EA6F037B093381CA88A41FBB6C4199] +GoodName=Midway's Greatest Arcade Hits Volume 1 (U) [b1] +CRC=E4B35E4C 1AC45CC9 +RefMD5=2B86775EA4D848202E4F4A39C33571CA + +[1FE59964EC1A5899F3C7D97590F676EB] +GoodName=Midway's Greatest Arcade Hits Volume 1 (U) [b2] +CRC=3F462D42 93AE9238 +RefMD5=2B86775EA4D848202E4F4A39C33571CA + +[B07FF4F972B269F2BDC69713B4B701A7] +GoodName=Midway's Greatest Arcade Hits Volume 1 (U) [o1] +CRC=E4B35E4C 1AC45CC9 +RefMD5=2B86775EA4D848202E4F4A39C33571CA + +[24467B76A192DFB67069C5A87B8606D0] +GoodName=Midway's Greatest Arcade Hits Volume 1 (U) [o1][t1] +CRC=3F462D42 93AE9238 +RefMD5=2B86775EA4D848202E4F4A39C33571CA + +[D30A4723E266D57D86BDC52F932D0DF1] +GoodName=Midway's Greatest Arcade Hits Volume 1 (U) [t1] +CRC=3F462D42 93AE9238 +RefMD5=2B86775EA4D848202E4F4A39C33571CA + +[EB357505EFC9D17A08ADBA5590896C4D] +GoodName=Midway's Greatest Arcade Hits Volume 1 (U) [t2] +CRC=3F462D42 93AE9238 +RefMD5=2B86775EA4D848202E4F4A39C33571CA + +[9D401FA1A1DDDF5C8995278E09E2210D] +GoodName=Midway's Greatest Arcade Hits Volume 1 (U) [t2][b1] +CRC=3F462D42 93AE9238 +RefMD5=2B86775EA4D848202E4F4A39C33571CA + +[EB1908E51C8D10AF8B9CAF77797BFE00] +GoodName=Mike Piazza's Strike Zone (U) [!] +CRC=09D53E16 3AB268B9 +Players=2 +SaveType=Controller Pack + +[F5978A54BB22E3BC4D46C0C3E9597B12] +GoodName=Mike Piazza's Strike Zone (U) [h1C] +CRC=09D53E16 3AB268B9 +RefMD5=EB1908E51C8D10AF8B9CAF77797BFE00 + +[1B41A885CBAA693714575383DB4C05BE] +GoodName=Mike Piazza's Strike Zone (U) [h2C] +CRC=09D53E16 3AB268B9 +RefMD5=EB1908E51C8D10AF8B9CAF77797BFE00 + +[83C51E3CD82A0D86CACE6D852990814F] +GoodName=Mike Piazza's Strike Zone (U) [h3C] +CRC=09D53E16 3AB268B9 +RefMD5=EB1908E51C8D10AF8B9CAF77797BFE00 + +[43B02AF2789990A14F77CE020E6F135C] +GoodName=Milo's Astro Lanes (E) [!] +CRC=9A490D9D 8F013ADC +SaveType=Controller Pack +Players=4 + +[988B490C2AEBF7DE3C274B7EAEEF0999] +GoodName=Milo's Astro Lanes (E) [o1] +CRC=9A490D9D 8F013ADC +RefMD5=43B02AF2789990A14F77CE020E6F135C + +[F152C4A90B33D0D2BFAF782F56B202DF] +GoodName=Milo's Astro Lanes (E) [o2] +CRC=9A490D9D 8F013ADC +RefMD5=43B02AF2789990A14F77CE020E6F135C + +[4F256146BAC4A3DDE5AD0D5F9C909251] +GoodName=Milo's Astro Lanes (U) [!] +CRC=2E955ECD F3000884 +Players=4 +SaveType=Controller Pack + +[AC004667AB4578BAA9A1C0A7771E8B17] +GoodName=Milo's Astro Lanes (U) [b1] +CRC=2E955ECD F3000884 +RefMD5=4F256146BAC4A3DDE5AD0D5F9C909251 + +[BE83566E7C7B9249FAC73DD2F1121424] +GoodName=Milo's Astro Lanes (U) [h1C] +CRC=2E955ECD F3000884 +RefMD5=4F256146BAC4A3DDE5AD0D5F9C909251 + +[0FE31A113EF389F8F95460D340C7D922] +GoodName=Milo's Astro Lanes (U) [h2C] +CRC=2E955ECD F3000884 +RefMD5=4F256146BAC4A3DDE5AD0D5F9C909251 + +[3D5F017D75679CEFCE2127CACC46C9F2] +GoodName=Milo's Astro Lanes (U) [o1] +CRC=2E955ECD F3000884 +RefMD5=4F256146BAC4A3DDE5AD0D5F9C909251 + +[FD85E6B20A9099F670C3CFBD13AEE719] +GoodName=Milo's Astro Lanes (U) [o1][b1] +CRC=2E955ECD F3000884 +RefMD5=4F256146BAC4A3DDE5AD0D5F9C909251 + +[C0513AE9494462433CDC83870320DA4E] +GoodName=Mind Present Demo 0 by Widget and Immortal (POM '98) (PD) [b1] +CRC=C811CBB1 8FB7617C + +[589DD744C7B07EC4DA91568CFBAC09EF] +GoodName=Mind Present Demo 0 by Widget and Immortal (POM '98) (PD) +CRC=C811CBB1 8FB7617C + +[4D1243D71F5536A416F3664A02FDF8E2] +GoodName=Mind Present Demo Readme by Widget and Immortal (POM '98) (PD) +CRC=139A06BC 416B0055 + +[EB3B078A74D4DC827E1E79791004DFBB] +GoodName=Mischief Makers (E) [!] +CRC=418BDA98 248A0F58 +Players=1 +SaveType=Eeprom 4KB + +[5690D74157C6623E2928A6F0353EF4AF] +GoodName=Mischief Makers (E) [b1] +CRC=418BDA98 248A0F58 +RefMD5=EB3B078A74D4DC827E1E79791004DFBB + +[495A9BFFD6620BE43225DB7133373FC5] +GoodName=Mischief Makers (U) [!] +CRC=0B93051B 603D81F9 +Players=1 +SaveType=Eeprom 4KB + +[CCF012DF82022D4797CE4CC5405E084F] +GoodName=Mischief Makers (U) [b1] +CRC=0B93051B 603D81F9 +RefMD5=495A9BFFD6620BE43225DB7133373FC5 + +[B3A172FE81F7BB47519D8E19E5F08154] +GoodName=Mischief Makers (U) [o1] +CRC=0B93051B 603D81F9 +RefMD5=495A9BFFD6620BE43225DB7133373FC5 + +[599B5D40B51F53C2C9A909E0139702FC] +GoodName=Mission Impossible (E) [!] +CRC=2256ECDA 71AB1B9C +Players=1 +SaveType=Eeprom 4KB + +[5CDC052C88A5CADCC3C73B165163E8C7] +GoodName=Mission Impossible (E) [b1] +CRC=2256ECDA 71AB1B9C +RefMD5=599B5D40B51F53C2C9A909E0139702FC + +[FD0C0E8C523437F9B6B630E369FDFC69] +GoodName=Mission Impossible (F) [!] +CRC=20095B34 343D9E87 +Players=1 +SaveType=Eeprom 4KB + +[FF9CC9E03993DD15F1436AF3874F94CF] +GoodName=Mission Impossible (F) [b1] +CRC=20095B34 343D9E87 +RefMD5=FD0C0E8C523437F9B6B630E369FDFC69 + +[D2442969E039254CF1B9B059DBB6311C] +GoodName=Mission Impossible (F) [b2] +CRC=20095B34 343D9E87 +RefMD5=FD0C0E8C523437F9B6B630E369FDFC69 + +[4111482C92EE806484AAA2C210893A52] +GoodName=Mission Impossible (G) [!] +CRC=93EB3F7E 81675E44 +Players=1 +SaveType=Eeprom 4KB + +[66C7EB8148E0714B5A71F5717DFF8642] +GoodName=Mission Impossible (I) [!] +CRC=EBA949DC 39BAECBD +Players=1 +SaveType=Eeprom 4KB + +[CA60967822CCCEFE22299691B453D893] +GoodName=Mission Impossible (I) [f1] (NTSC) +CRC=C76B18F6 AAB1BDF3 +RefMD5=66C7EB8148E0714B5A71F5717DFF8642 + +[D1BA3B1899576A4B67908ABB6544D75A] +GoodName=Mission Impossible (S) [!] +CRC=5F6A04E2 D4FA070D +Players=1 +SaveType=Eeprom 4KB + +[217B0E4723DBACDA40B70B26E610F5F9] +GoodName=Mission Impossible (S) [f1] (NTSC) +CRC=635CB5C6 E9192BFF +RefMD5=D1BA3B1899576A4B67908ABB6544D75A + +[EEBDFBD7CB57202D70CFFFCAAF55E93E] +GoodName=Mission Impossible (U) [!] +CRC=26035CF8 802B9135 +Players=1 +SaveType=Eeprom 4KB + +[550F4C177942FC0DF00B646C42EB4A90] +GoodName=Mission Impossible (U) [b1] +CRC=26035CF8 802B9135 +RefMD5=EEBDFBD7CB57202D70CFFFCAAF55E93E + +[0D97158C3408F8E3E6D38A17223AC881] +GoodName=Mission Impossible (U) [b2] +CRC=09D4D757 F2775DBD +RefMD5=EEBDFBD7CB57202D70CFFFCAAF55E93E + +[FA31743C3FC0236D6CEC0BD514DFB053] +GoodName=Mission Impossible (U) [f1] (PAL) +CRC=09D4D757 F2775DBD +RefMD5=EEBDFBD7CB57202D70CFFFCAAF55E93E + +[5320608C729C9F5B32581F81604D75E6] +GoodName=Mission Impossible (U) [t1] +CRC=B0105C85 6E5094B9 +RefMD5=EEBDFBD7CB57202D70CFFFCAAF55E93E + +[4FF9589A3224AAA46E9877D6B25E68E3] +GoodName=Monaco Grand Prix (U) [!] +CRC=28768D6D B379976C +Players=4 +SaveType=Controller Pack + +[9BF4D7FBE8157C9D6866A90269DCA7CB] +GoodName=Monaco Grand Prix (U) [f1] (PAL) +CRC=DA233397 FF46DF64 +RefMD5=4FF9589A3224AAA46E9877D6B25E68E3 + +[C93A17D130B96FBA27A0E959CAB2A450] +GoodName=Monaco Grand Prix - Racing Simulation 2 (E) (M4) [!] +CRC=28705FA5 B509690E +Players=4 +SaveType=Controller Pack + +[F81580C9C480DDF1B8F7E6A56D1B9CD5] +GoodName=Money Creates Taste Demo by Count0 (POM '99) (PD) [f1] +CRC=97E57686 F271C12F + +[A74DBAA3BF59DE13B6A191A6675C85D7] +GoodName=Money Creates Taste Demo by Count0 (POM '99) (PD) +CRC=282A4262 58B47E76 + +[D51506EDB0A941A00EB45850703B32CB] +GoodName=Monopoly (U) [!] +CRC=5AC383E1 D712E387 +Players=4 +SaveType=Eeprom 4KB + +[26C3654D20B8718A75B5FE8DA5B3284A] +GoodName=Monopoly (U) [f1] (PAL) +CRC=B9D36858 559A8241 +RefMD5=D51506EDB0A941A00EB45850703B32CB + +[E3B408997D7DB91F8219F168C6D57D26] +GoodName=Monster Truck Madness 64 (E) (M5) [!] +CRC=D3D806FC B43AA2A8 +Players=4 +SaveType=None + +[12534DAB32DBFC6CA4F66D05729102E6] +GoodName=Monster Truck Madness 64 (E) (M5) [f1] (NTSC) +CRC=AE5E467C D7194A71 +RefMD5=E3B408997D7DB91F8219F168C6D57D26 + +[514D61D3B3D5E6326869783EB2E84A00] +GoodName=Monster Truck Madness 64 (U) [!] +CRC=B19AD999 7E585118 +Players=4 +SaveType=None + +[3C9F329D5E0C7FE57355B8DC68F79331] +GoodName=Monster Truck Madness 64 (U) [t1] +CRC=29A9E7F6 1B90CFCE +RefMD5=514D61D3B3D5E6326869783EB2E84A00 + +[462B9C4F38758C2E558312AC60DF2B91] +GoodName=Morita Shougi 64 (J) [!] +CRC=E8E8DD70 415DD198 +Players=4 + +[264B82F0FC2431D6EEFDE9C9F3ED7596] +GoodName=Mortal Kombat 4 (E) [!] +CRC=73036F3B CE0D69E9 +Players=2 +SaveType=Controller Pack +Rumble=Yes + +[58EFAF3D7D0985BC426245EFA5418CC2] +GoodName=Mortal Kombat 4 (E) [h1C] +CRC=73036F3B CE0D69E9 +RefMD5=264B82F0FC2431D6EEFDE9C9F3ED7596 + +[619B1F196B70260DCE89B21E66D10934] +GoodName=Mortal Kombat 4 (E) [t1] (Hit Anywhere) +CRC=72836ECB 75D15FAE +RefMD5=264B82F0FC2431D6EEFDE9C9F3ED7596 + +[C70B91430866300CE38B49098019EF9D] +GoodName=Mortal Kombat 4 (U) [!] +CRC=417DD4F4 1B482FE2 +Players=2 +SaveType=Controller Pack +Rumble=Yes + +[CCD5A3B82976D65B3B42E8E2B2B43B48] +GoodName=Mortal Kombat 4 (U) [b1] +CRC=F96E28F7 421A4285 +RefMD5=C70B91430866300CE38B49098019EF9D + +[4C7092585CF64BBE7F26ECA720AE8941] +GoodName=Mortal Kombat 4 (U) [b2] +CRC=DB6E353B 205B0C53 +RefMD5=C70B91430866300CE38B49098019EF9D + +[480855E2348D6B85721C620AE9FEF138] +GoodName=Mortal Kombat 4 (U) [b3] +CRC=417DD4F4 1B482FE2 +RefMD5=C70B91430866300CE38B49098019EF9D + +[F972B634F638CC54AD6DCBFDC661CC02] +GoodName=Mortal Kombat 4 (U) [h1C] +CRC=417DD4F4 1B482FE2 +RefMD5=C70B91430866300CE38B49098019EF9D + +[A5F7C9F5B711ECA7C2A2923EEA6CF762] +GoodName=Mortal Kombat 4 (U) [t1] +CRC=DB6E353B 205B0C53 +RefMD5=C70B91430866300CE38B49098019EF9D + +[24E39D47A0D1AFA138B1F39AA2DAA648] +GoodName=Mortal Kombat 4 (U) [t1][f1] (PAL) +CRC=DB6E353B 205B0C53 +RefMD5=C70B91430866300CE38B49098019EF9D + +[18E1CA4BE7D8E56AC940852EC5E3ED22] +GoodName=Mortal Kombat 4 (U) [t2] (Hit Anywhere) +CRC=417DD7F4 C95B6E9E +RefMD5=C70B91430866300CE38B49098019EF9D + +[38A82A56AE61A4D354C6A26E64D25E1C] +GoodName=Mortal Kombat Mythologies - Sub-Zero (E) [!] +CRC=FF44EDC4 1AAE9213 +Players=1 +Rumble=Yes +SaveType=Controller Pack + +[DAFEE0C1FC99882A2C6A340BF0E58A08] +GoodName=Mortal Kombat Mythologies - Sub-Zero (E) [h1C] +CRC=FF44EDC4 1AAE9213 +RefMD5=38A82A56AE61A4D354C6A26E64D25E1C + +[528445FB76D0F060DF5CBE71AEEDA20F] +GoodName=Mortal Kombat Mythologies - Sub-Zero (E) [t1] (Endless Ice) +CRC=6DF2CB25 4D4821F8 +RefMD5=528445FB76D0F060DF5CBE71AEEDA20F + +[DEEC4FAEC416F4E02D934C2E42C0CAAD] +GoodName=Mortal Kombat Mythologies - Sub-Zero (U) [!] +CRC=C34304AC 2D79C021 +Players=1 +SaveType=Controller Pack +Rumble=Yes + +[8F2544F095EF7D9A5096E3D52472D699] +GoodName=Mortal Kombat Mythologies - Sub-Zero (U) [b1] +CRC=834304AE 5845CD3A +RefMD5=DEEC4FAEC416F4E02D934C2E42C0CAAD + +[1793B45C4797D9418685946A002B5D15] +GoodName=Mortal Kombat Mythologies - Sub-Zero (U) [b2] +CRC=C34304AC 2D79C021 +RefMD5=DEEC4FAEC416F4E02D934C2E42C0CAAD + +[5443BFB72D91D0DFD72FC1C6FA03A113] +GoodName=Mortal Kombat Mythologies - Sub-Zero (U) [b3] +CRC=C34304AC 2D79C021 +RefMD5=DEEC4FAEC416F4E02D934C2E42C0CAAD + +[7CCC138882A64267AD58449F309FC1D1] +GoodName=Mortal Kombat Mythologies - Sub-Zero (U) [f1] +CRC=834304AE 5845CD3A +RefMD5=DEEC4FAEC416F4E02D934C2E42C0CAAD + +[A6C51954EE5DF373E159E0E55DEAE239] +GoodName=Mortal Kombat Mythologies - Sub-Zero (U) [f3] (PAL) +CRC=834304AE 5845CD3A +RefMD5=DEEC4FAEC416F4E02D934C2E42C0CAAD + +[FFF4E1455C03F71272063C309D9F9102] +GoodName=Mortal Kombat Mythologies - Sub-Zero (U) [h1C] +CRC=C34304AC 2D79C021 +RefMD5=DEEC4FAEC416F4E02D934C2E42C0CAAD + +[FCD0BFF90306B13EB8E5007E5B4C2CB7] +GoodName=Mortal Kombat Mythologies - Sub-Zero (U) [h2C] +CRC=834304AE 5845CD3A +RefMD5=DEEC4FAEC416F4E02D934C2E42C0CAAD + +[5583527ED4AA49CF713FAE400E77F9A2] +GoodName=Mortal Kombat Mythologies - Sub-Zero (U) [o1] +CRC=C34304AC 2D79C021 +RefMD5=DEEC4FAEC416F4E02D934C2E42C0CAAD + +[AB06E6D777AE710F9B5A4DC4E7A295C8] +GoodName=Mortal Kombat Mythologies - Sub-Zero (U) [t1] +CRC=5972E751 228381B3 +RefMD5=DEEC4FAEC416F4E02D934C2E42C0CAAD + +[85B99F3D09C4070EEA7669A09D20243F] +GoodName=Mortal Kombat Mythologies - Sub-Zero (U) [t2] (Endless Ice) +CRC=ADDD6241 AA79B2F2 +RefMD5=DEEC4FAEC416F4E02D934C2E42C0CAAD + +[B278DDD3FB63F70B8B6EFEF445D81595] +GoodName=Mortal Kombat SRAM Loader (PD) +CRC=947A4B47 90BFECA6 + +[7A558BBAD8CE8828414A9CF3B044A87D] +GoodName=Mortal Kombat Trilogy (E) [!] +CRC=8C3D1192 BEF172E1 +SaveType=None +Players=2 +Rumble=No + +[1C6FE6A40AAC4BD515373B6ED8D25DBF] +GoodName=Mortal Kombat Trilogy (E) [b1] +CRC=8C3D1192 BEF172E1 +RefMD5=7A558BBAD8CE8828414A9CF3B044A87D + +[0F9B89C903BEFEDCFD107E5B5ADE687F] +GoodName=Mortal Kombat Trilogy (E) [h1C] +CRC=8C3D1192 BEF172E1 +RefMD5=7A558BBAD8CE8828414A9CF3B044A87D + +[B05DEC10CDEFACF4153E345940410477] +GoodName=Mortal Kombat Trilogy (E) [o1] +CRC=8C3D1192 BEF172E1 +RefMD5=7A558BBAD8CE8828414A9CF3B044A87D + +[AB72CB8971FA37176D3219B5F49AF442] +GoodName=Mortal Kombat Trilogy (E) [t1] (Hit Anywhere) +CRC=8C3D1192 B5096A18 +RefMD5=7A558BBAD8CE8828414A9CF3B044A87D + +[CFC196103E355B12A50605AB268992FA] +GoodName=Mortal Kombat Trilogy (E) [t2] (All Attacks Hurt P1) +CRC=833D11B6 1848E72B +RefMD5=7A558BBAD8CE8828414A9CF3B044A87D + +[9CC60D046372D2C9A529ED225E3CDB08] +GoodName=Mortal Kombat Trilogy (E) [t3] (All Attacks Hurt P2) +CRC=833D1192 D3C58762 +RefMD5=7A558BBAD8CE8828414A9CF3B044A87D + +[EBF2AC190EBB2FE6D75AD0ACAA2A82CD] +GoodName=Mortal Kombat Trilogy (E) [t4] (Hyper Mode) +CRC=93ED1192 2B2C6244 +RefMD5=7A558BBAD8CE8828414A9CF3B044A87D + +[ED7773988BCC03D06E2330A8E77BEC6F] +GoodName=Mortal Kombat Trilogy (E) [t5] (2x Aggressor) +CRC=8C352E50 6B93F13B +RefMD5=7A558BBAD8CE8828414A9CF3B044A87D + +[DF00C698E2B18A6CA94C09CCD82CACEB] +GoodName=Mortal Kombat Trilogy (E) [t6] (P1 Invincible) +CRC=8C3511AE 57115A86 +RefMD5=7A558BBAD8CE8828414A9CF3B044A87D + +[9B7F29AAB911D6753F2011C48DA752BF] +GoodName=Mortal Kombat Trilogy (U) (V1.0) [!] +CRC=D9F75C12 A8859B59 +Players=2 +SaveType=None +Rumble=No + +[7CD386C8D2E69DBBF55F02A564BD6A9A] +GoodName=Mortal Kombat Trilogy (U) (V1.0) [b1] +CRC=D9F75C12 A8859B59 +RefMD5=9B7F29AAB911D6753F2011C48DA752BF + +[77CE01C32E172C7DD812C4F1179FBA2E] +GoodName=Mortal Kombat Trilogy (U) (V1.0) [b2] +CRC=D9F75C12 A8859B59 +RefMD5=9B7F29AAB911D6753F2011C48DA752BF + +[9DA1E143FF580834FE485D08C21B6D01] +GoodName=Mortal Kombat Trilogy (U) (V1.0) [b3] +CRC=D9F75C12 A8859B59 +RefMD5=9B7F29AAB911D6753F2011C48DA752BF + +[ED4414B512CF22DA64B080D34B5E2F4F] +GoodName=Mortal Kombat Trilogy (U) (V1.0) [b4] +CRC=D9F75C12 A8859B59 +RefMD5=9B7F29AAB911D6753F2011C48DA752BF + +[57464801A058B97E056766DDFCF93A69] +GoodName=Mortal Kombat Trilogy (U) (V1.0) [b5] +CRC=D9F75C12 A8859B59 +RefMD5=9B7F29AAB911D6753F2011C48DA752BF + +[8CE0A41CB29C14300B482E0E9897EBBF] +GoodName=Mortal Kombat Trilogy (U) (V1.0) [h1C] +CRC=D9F75C12 A8859B59 +RefMD5=9B7F29AAB911D6753F2011C48DA752BF + +[4DBAD6B0E2F30A63F974A85513B668E0] +GoodName=Mortal Kombat Trilogy (U) (V1.0) [h2C] +CRC=D9F75C12 A8859B59 +RefMD5=9B7F29AAB911D6753F2011C48DA752BF + +[976825DAB07E6F5D69BFD5B46337DE85] +GoodName=Mortal Kombat Trilogy (U) (V1.0) [o1] +CRC=D9F75C12 A8859B59 +RefMD5=9B7F29AAB911D6753F2011C48DA752BF + +[EE052C69FFA67DB3544872AB0E745DDF] +GoodName=Mortal Kombat Trilogy (U) (V1.0) [o1][h1C] +CRC=D9F75C12 A8859B59 +RefMD5=9B7F29AAB911D6753F2011C48DA752BF + +[10774BFBC9D815194AD904F898CBE96F] +GoodName=Mortal Kombat Trilogy (U) (V1.0) [o1][h2C] +CRC=D9F75C12 A8859B59 +RefMD5=9B7F29AAB911D6753F2011C48DA752BF + +[04A3F6D2A30FEDE6CADC5C2FCBCFBD12] +GoodName=Mortal Kombat Trilogy (U) (V1.0) [t1] (Hit Anywhere) +CRC=F9F75B92 AFEC042B +RefMD5=9B7F29AAB911D6753F2011C48DA752BF + +[CCD0BA9C220D1EE91B39747A6E5065EE] +GoodName=Mortal Kombat Trilogy (U) (V1.0) [t2] (All Attacks Hurt P1) +CRC=F2F75C36 36637257 +RefMD5=9B7F29AAB911D6753F2011C48DA752BF + +[548C444FB604CA179EAD4115FFB070FC] +GoodName=Mortal Kombat Trilogy (U) (V1.0) [t3] (All Attacks Hurt P2) +CRC=D2F75C12 E89EB415 +RefMD5=9B7F29AAB911D6753F2011C48DA752BF + +[4DED9381CD0D396AE6C9634D575DD93C] +GoodName=Mortal Kombat Trilogy (U) (V1.0) [t4] (Hyper Mode) +CRC=A2015C11 C317ECAB +RefMD5=9B7F29AAB911D6753F2011C48DA752BF + +[F5509B1EA83A49D01E5E4EF475B87278] +GoodName=Mortal Kombat Trilogy (U) (V1.0) [t5] (2x Aggressor) +CRC=D9FECC50 D3AA8423 +RefMD5=9B7F29AAB911D6753F2011C48DA752BF + +[D68FC4D8568B7D02EFD47F32B9C091D7] +GoodName=Mortal Kombat Trilogy (U) (V1.0) [t6] (P1 Invincible) +CRC=A1815C2E C6806731 +RefMD5=9B7F29AAB911D6753F2011C48DA752BF + +[3DCB15043063BD656A0223C519218CFB] +GoodName=Mortal Kombat Trilogy (U) (V1.2) [!] +CRC=83F33AA9 A901D40D +Players=2 +SaveType=None +Rumble=No + +[27F761B7DD73E12BB311772780D6B9F4] +GoodName=Mortal Kombat Trilogy (U) (V1.2) [t1] (Hit Anywhere) +CRC=83F33AA9 2649847A +RefMD5=3DCB15043063BD656A0223C519218CFB + +[8A7B5A6AB0E815DBDFFD1FC99939CE9F] +GoodName=Mortal Kombat Trilogy (U) (V1.2) [t2] (All Attacks Hurt P1) +CRC=BCF33AAD BF3C37EC +RefMD5=3DCB15043063BD656A0223C519218CFB + +[37FEB7178712980DD0953D195187C35D] +GoodName=Mortal Kombat Trilogy (U) (V1.2) [t3] (All Attacks Hurt P2) +CRC=9CF33AA9 3F05381F +RefMD5=3DCB15043063BD656A0223C519218CFB + +[D3B28E1E154C5B58A40E3D71D8599CE2] +GoodName=Mortal Kombat Trilogy (U) (V1.2) [t4] (Hyper Mode) +CRC=9C013AA8 EB3267A7 +RefMD5=3DCB15043063BD656A0223C519218CFB + +[0D708DDE7EC6B67E705F1D865D70AFDA] +GoodName=Mortal Kombat Trilogy (U) (V1.2) [t5] (2x Aggressor) +CRC=83FB2B69 7A5D2980 +RefMD5=3DCB15043063BD656A0223C519218CFB + +[68EBC8C849459FE30E7162D48EBAC0BD] +GoodName=Mortal Kombat Trilogy (U) (V1.2) [t6] (P1 Invincible) +CRC=83F33AA9 A901D40D +RefMD5=3DCB15043063BD656A0223C519218CFB + +[08BEA3310E778A6584EB64CD3F15F86E] +GoodName=Ms. Pac-Man - Maze Madness (U) [!] +CRC=1938525C 586E9656 +SaveType=Controller Pack +Players=4 +Rumble=No + +[F905CA22CC030BBED516F3D1B6C2153A] +GoodName=My Angel Demo (PD) +CRC=9865799F 006F908C + +[E6B5C17B7BBBB7C432B3506C085D16C4] +GoodName=Mystical Ninja 2 Starring Goemon (E) (M3) [!] +CRC=7F9345D3 841ECADE +Players=1 +SaveType=Controller Pack +Rumble=No + +[75AD771425CBE2B1E8C7B4D94E67B1CA] +GoodName=Mystical Ninja 2 Starring Goemon (E) (M3) [hI] +CRC=C27F7CEC 85E0806F +RefMD5=E6B5C17B7BBBB7C432B3506C085D16C4 + +[004EA34EE12CBABDC053419714E66DD4] +GoodName=Mystical Ninja 2 Starring Goemon (E) (M3) [t1] +CRC=C27F7CEC 85E0806F +RefMD5=E6B5C17B7BBBB7C432B3506C085D16C4 + +[698930C7CCD844673D77FFECCB3DD66E] +GoodName=Mystical Ninja Starring Goemon (E) [!] +CRC=F5360FBE 2BF1691D +Players=1 +SaveType=Controller Pack +Rumble=No + +[DBD2BC43FCDADACD234AEFC8130A5413] +GoodName=Mystical Ninja Starring Goemon (E) [b1] +CRC=F5360FBE 2BF1691D +RefMD5=698930C7CCD844673D77FFECCB3DD66E + +[8F1C1FEAAF0D053E230361E3F81B0269] +GoodName=Mystical Ninja Starring Goemon (E) [h1C] +CRC=F5360FBE 2BF1691D +RefMD5=698930C7CCD844673D77FFECCB3DD66E + +[1FFBDAB727C9D634D4F4DDBD9F358445] +GoodName=Mystical Ninja Starring Goemon (E) [t1] +CRC=835B97A2 FF6C0060 +RefMD5=698930C7CCD844673D77FFECCB3DD66E + +[643CCE1AB06F97E9590241D27E5C2363] +GoodName=Mystical Ninja Starring Goemon (U) [!] +CRC=FCBCCB21 72903C6B +Players=1 +SaveType=Controller Pack +Rumble=No + +[42E282A3F208C4BDE50A4A4301181B16] +GoodName=Mystical Ninja Starring Goemon (U) [h1C] +CRC=FCBCCB21 72903C6B +RefMD5=643CCE1AB06F97E9590241D27E5C2363 + +[07A7D3DB5B64A6CCF9D44B321472CC21] +GoodName=Mystical Ninja Starring Goemon (U) [t1] +CRC=7AADA8DD 94DAB468 +RefMD5=643CCE1AB06F97E9590241D27E5C2363 + +[55F99A3F3402491E9517980BE636E3FE] +GoodName=Mystical Ninja Starring Goemon (U) [t1][h2C] +CRC=7AADA8DD 94DAB468 +RefMD5=643CCE1AB06F97E9590241D27E5C2363 + +[4D1821886352EAA2F663CFF63ED17DD8] +GoodName=Mystical Ninja Starring Goemon (U) [t2] +CRC=7AADA8DD 94DAB468 +RefMD5=643CCE1AB06F97E9590241D27E5C2363 + +[17B839B8E72A6287A5BB3CEFCBC035E9] +GoodName=N64 Scene Gallery by CALi (PD) +CRC=6D2C07F1 C884F0D0 + +[882B30625B722B5C29D0D94E70D9302E] +GoodName=N64 Seminar Demo - CPU by ZoRAXE (PD) +CRC=FD61BB45 FBB51EB2 + +[8B7816E975DB27B4BF591BFC73C43944] +GoodName=N64 Seminar Demo - RSP by ZoRAXE (PD) +CRC=6D03673A 1D63C191 + +[023175B6C809704F00A317ABCD25A8F9] +GoodName=N64 Stars Demo (PD) [b1] +CRC=71255651 C6AE0EA6 + +[67836FE63901319874E0754BC918AF7D] +GoodName=N64 Stars Demo (PD) +CRC=71255651 C6AE0EA6 + +[F4B5863F550BC83C7924E423B01E1C5A] +GoodName=N64probe (Button Test) by MooglyGuy (PD) +CRC=44410533 0C61FA96 + +[45FEB0FBBEC6CB48FF21DEAE176E9B6B] +GoodName=NASCAR 2000 (U) [!] +CRC=DF331A18 5FD4E044 +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[DB3A918FA61E1FB3110CFE6E9DA33E97] +GoodName=NASCAR 2000 (U) [f1] (PAL) +CRC=651F2792 E40CC56B +RefMD5=45FEB0FBBEC6CB48FF21DEAE176E9B6B + +[15A87A6D01DBA1A7C4375FFBC1214BB8] +GoodName=NASCAR 99 (E) (M3) [!] +CRC=AE4992C9 9253B253 +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[A31AD7E7E6177BED7345635FDA563FCA] +GoodName=NASCAR 99 (E) (M3) [h1C] +CRC=AE4992C9 9253B253 +RefMD5=15A87A6D01DBA1A7C4375FFBC1214BB8 + +[DC5F1A814C8423B4B43F71C229D65A84] +GoodName=NASCAR 99 (U) [!] +CRC=23749578 80DC58FD +Players=2 +SaveType=Controller Pack +Rumble=Yes + +[AC88A7D81FF0B712EA3A302419F3A927] +GoodName=NASCAR 99 (U) [b1] +CRC=23749578 80DC58FD +RefMD5=DC5F1A814C8423B4B43F71C229D65A84 + +[DA77C8AB76E6209550D56FED1817AFBD] +GoodName=NASCAR 99 (U) [b2] +CRC=FCB2955B B302626D +RefMD5=DC5F1A814C8423B4B43F71C229D65A84 + +[A267D8C94031678DD395FE4667C4A76A] +GoodName=NASCAR 99 (U) [b3] +CRC=23E39896 73AB48DC +RefMD5=DC5F1A814C8423B4B43F71C229D65A84 + +[71BE7A48778737FDDD3CDE7849502C5B] +GoodName=NASCAR 99 (U) [f1] (PAL) +CRC=FCB2955B B302626D +RefMD5=DC5F1A814C8423B4B43F71C229D65A84 + +[DB644859C4DCE5418010A2427E3904C0] +GoodName=NASCAR 99 (U) [o1] +CRC=23749578 80DC58FD +RefMD5=DC5F1A814C8423B4B43F71C229D65A84 + +[73BB54FFD3C0FC71F941D9A8CC57E2A1] +GoodName=NBA Courtside 2 - Featuring Kobe Bryant (U) [!] +CRC=916852D8 73DBEAEF +Players=4 +Rumble=Yes +SaveType=Flash RAM + +[EE4DCAED6759CE013BC7B5E8E815B343] +GoodName=NBA Courtside 2 - Featuring Kobe Bryant (U) [f1] (PAL) +CRC=3F16568F 37D93603 +RefMD5=73BB54FFD3C0FC71F941D9A8CC57E2A1 + +[F734667EF21DA97092F54D2547E11E51] +GoodName=NBA Courtside 2 - Featuring Kobe Bryant (U) [f2] +CRC=2816D957 A59FF70A +RefMD5=73BB54FFD3C0FC71F941D9A8CC57E2A1 + +[032ADEEF1C2D0B4387FAC099334F72E3] +GoodName=NBA Courtside 2 - Featuring Kobe Bryant (U) [hI] +CRC=24F7EB57 74B3F9F4 +RefMD5=73BB54FFD3C0FC71F941D9A8CC57E2A1 + +[94E3F2ACE3EB74150F036B217FF50370] +GoodName=NBA Courtside 2 - Featuring Kobe Bryant (U) [hI][f1] (PAL) +CRC=26211297 97DB4DFC +RefMD5=73BB54FFD3C0FC71F941D9A8CC57E2A1 + +[62365463743857CFC823978E0E590D84] +GoodName=NBA Hangtime (E) [!] +CRC=C788DCAE BD03000A +Players=4 +Rumble=No +SaveType=Controller Pack + +[0057A561D7034392D4267A4134DA41B0] +GoodName=NBA Hangtime (E) [h1C] +CRC=C788DCAE BD03000A +RefMD5=62365463743857CFC823978E0E590D84 + +[DC15FCBEAE0F1FEF7BEE141D77BB25A0] +GoodName=NBA Hangtime (U) [!] +CRC=4E69B487 FE18E290 +Players=4 +SaveType=Controller Pack +Rumble=No + +[9C595E5A5F027385A340ADDF609852DD] +GoodName=NBA Hangtime (U) [b1] +CRC=4E69B487 FE18E290 +RefMD5=DC15FCBEAE0F1FEF7BEE141D77BB25A0 + +[4955DEA9356D1506D6DE8BD8DA10E938] +GoodName=NBA Hangtime (U) [b2] +CRC=4E69B487 FE18E290 +RefMD5=DC15FCBEAE0F1FEF7BEE141D77BB25A0 + +[C8D6A414505595C13C7DA4D07A172343] +GoodName=NBA Hangtime (U) [b3] +CRC=4E69B487 FE18E290 +RefMD5=DC15FCBEAE0F1FEF7BEE141D77BB25A0 + +[C2D094778DA53C7A84466130EC5C65B0] +GoodName=NBA Hangtime (U) [f1] (PAL) +CRC=4E69B487 FE18E290 +RefMD5=DC15FCBEAE0F1FEF7BEE141D77BB25A0 + +[80F918D90DF42C9841AE998A89223C1E] +GoodName=NBA Hangtime (U) [o1] +CRC=4E69B487 FE18E290 +RefMD5=DC15FCBEAE0F1FEF7BEE141D77BB25A0 + +[62E182D019DCE0C0EEAA3BE2023A327A] +GoodName=NBA Hangtime (U) [o1][f1] +CRC=4E69B487 FE18E290 +RefMD5=DC15FCBEAE0F1FEF7BEE141D77BB25A0 + +[4C7A2F4881EACA75DC2FC36673AE2A20] +GoodName=NBA In the Zone '98 (J) [!] +CRC=36ACBA9B F28D4D94 +Players=4 +SaveType=Controller Pack +Rumble=No + +[4151ED80568EFCCA34F8831D957EB7A6] +GoodName=NBA In the Zone '98 (J) [o1] +CRC=36ACBA9B F28D4D94 +RefMD5=4C7A2F4881EACA75DC2FC36673AE2A20 + +[23215642F5FAAAD0761166EA018963F0] +GoodName=NBA In the Zone '98 (J) [o2] +CRC=36ACBA9B F28D4D94 +RefMD5=4C7A2F4881EACA75DC2FC36673AE2A20 + +[BBB48BE198089A26050C84FE5B7B8BD5] +GoodName=NBA In the Zone '98 (U) [!] +CRC=6A121930 665CC274 +Players=4 +Rumble=No +SaveType=Controller Pack + +[EE43F010F2E87BC68535D333FE64C516] +GoodName=NBA In the Zone '98 (U) [b1] +CRC=6A121930 665CC274 +RefMD5=BBB48BE198089A26050C84FE5B7B8BD5 + +[49B49E6DD528E896DE9BCE3DCCF3442E] +GoodName=NBA In the Zone '98 (U) [b2] +CRC=6A121930 665CC274 +RefMD5=BBB48BE198089A26050C84FE5B7B8BD5 + +[42F3A177F54C86F2C8EE6AFDB892A5A9] +GoodName=NBA In the Zone '98 (U) [b3] +CRC=36ACBA9B F28D4D94 +RefMD5=BBB48BE198089A26050C84FE5B7B8BD5 + +[BF33C371BF396A5F6E72627A34AEDAF5] +GoodName=NBA In the Zone '98 (U) [h1C] +CRC=6A121930 665CC274 +RefMD5=BBB48BE198089A26050C84FE5B7B8BD5 + +[62DFA8A5906E973A2C923A165EBE00A1] +GoodName=NBA In the Zone '98 (U) [h2C] +CRC=6A121930 665CC274 +RefMD5=BBB48BE198089A26050C84FE5B7B8BD5 + +[92D2BD868B17B3CA8A19116ADDB963B0] +GoodName=NBA In the Zone '98 (U) [o1] +CRC=6A121930 665CC274 +RefMD5=BBB48BE198089A26050C84FE5B7B8BD5 + +[6CBF4014C053E16852A3DB80AEB4C853] +GoodName=NBA In the Zone '99 (U) [!] +CRC=A292524F 3D6C2A49 +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[F8F87AEB2C537C9CB2E9913050BFC928] +GoodName=NBA In the Zone 2 (J) [!] +CRC=AAE11F01 2625A045 +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[4244CC48674C26BD848718C05688F821] +GoodName=NBA In the Zone 2000 (E) [!] +CRC=B3054F9F 96B69EB5 +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[AF6521E33FDE918B9A2298FA0BD3AA90] +GoodName=NBA In the Zone 2000 (E) [h1C] +CRC=B3054F9F 96B69EB5 +RefMD5=4244CC48674C26BD848718C05688F821 + +[1942833AC1A71BE8BAE74BBDFD6DE278] +GoodName=NBA In the Zone 2000 (U) [!] +CRC=8DF95B18 ECDA497B +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[F4401BCC9DD25254503E32B482EB3FAA] +GoodName=NBA In the Zone 2000 (U) [f1] (PAL) +CRC=4F8AA5EC 1E6E72DE +RefMD5=1942833AC1A71BE8BAE74BBDFD6DE278 + +[604FEB17258044A3E6C3AA9D2C5B62F9] +GoodName=NBA Jam 2000 (E) [!] +CRC=B6D0CAA0 E3F493C8 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[AFECC9A2DF7B1A66A6B7AB3AA8B4BD2E] +GoodName=NBA Jam 2000 (U) [!] +CRC=EBEEA8DB F2ECB23C +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[E25F3A1136C9C81702E0827040C5A115] +GoodName=NBA Jam 2000 (U) [f1] (PAL) +CRC=F3996B67 3A3030FA +RefMD5=AFECC9A2DF7B1A66A6B7AB3AA8B4BD2E + +[BE72BE370BC0A76D403FF2B9ED2A9173] +GoodName=NBA Jam 99 (E) [!] +CRC=E600831E 59F422A8 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[0A9D53EF71A0C6F2AE3A0435E3D58747] +GoodName=NBA Jam 99 (E) [h1C] +CRC=E600831E 59F422A8 +RefMD5=BE72BE370BC0A76D403FF2B9ED2A9173 + +[ADBE5CA10F659AF2BE712038E8522704] +GoodName=NBA Jam 99 (U) [!] +CRC=810729F6 E03FCFC1 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[7344483130995CA211B5B9FF9891A9DE] +GoodName=NBA Jam 99 (U) [b1] +CRC=810729F6 E03FCFC1 +RefMD5=ADBE5CA10F659AF2BE712038E8522704 + +[5382AD48844A3473D4CBA87C85F2BAC2] +GoodName=NBA Jam 99 (U) [f1] (PAL) +CRC=61079876 32DB765E +RefMD5=ADBE5CA10F659AF2BE712038E8522704 + +[7FEC099D1A989D5222D3F9E1A7770404] +GoodName=NBA Live 2000 (E) (M4) [!] +CRC=EB499C8F CD4567B6 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[FC47F85CC501C8C5BD9D0CA4DB48258F] +GoodName=NBA Live 2000 (U) (M4) [!] +CRC=5F25B0EE 6227C1DB +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[226C19C8759314AC740420DDC3A34EB4] +GoodName=NBA Live 99 (E) (M5) [!] +CRC=CF84F45F 00E4F6EB +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[DBE79AE6531B491B8F8EE8B2B814D665] +GoodName=NBA Live 99 (U) (M5) [!] +CRC=57F81C9B 1133FA35 +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[7044E135E702B32DFCF13E688461967F] +GoodName=NBA Live 99 (U) (M5) [b1] +CRC=57F81C9B 1133FA35 +RefMD5=DBE79AE6531B491B8F8EE8B2B814D665 + +[4DD6A2CF6091A92C43CE1B4A1B6F1556] +GoodName=NBA Live 99 (U) (M5) [b2] +CRC=57F81C9B 1133FA35 +RefMD5=DBE79AE6531B491B8F8EE8B2B814D665 + +[5F46FC3780A50D5BB8FCB0F1C95686B0] +GoodName=NBA Live 99 (U) (M5) [b3] +CRC=57F81C9B 1133FA35 +RefMD5=DBE79AE6531B491B8F8EE8B2B814D665 + +[A4111A6CDDBDE0A45489106F0DF0CA2B] +GoodName=NBA Pro 98 (E) [!] +CRC=ACDE962F B2CBF87F +Players=4 +SaveType=Controller Pack +Rumble=No + +[C5EBBDD41EAEA8BD02CF520640CCCCDF] +GoodName=NBA Pro 99 (E) [!] +CRC=8D1780B6 57B3B976 +Players=4 +SaveType=Controller Pack +Rumble=No + +[9A203506DB213F97FE28210AAF56F820] +GoodName=NBA Pro 99 (E) [f1] (NTSC) +CRC=356130AD 29367E56 +RefMD5=C5EBBDD41EAEA8BD02CF520640CCCCDF + +[881E98B47F32093C330A8B0DAD6BB65D] +GoodName=NBA Showtime - NBA on NBC (U) [!] +CRC=3FFE80F4 A7C15F7E +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[76DB89759121710C416ECFB1736B5E39] +GoodName=NBA Showtime - NBA on NBC (U) [f1] (Country Check) +CRC=E78F66E6 754ABDF5 +RefMD5=881E98B47F32093C330A8B0DAD6BB65D + +[760D5F0A578D65E68F5B4E8F64271C88] +GoodName=NBA Showtime - NBA on NBC (U) [f1] (PAL) +CRC=9CEED5BA 62A146D5 +RefMD5=881E98B47F32093C330A8B0DAD6BB65D + +[A05D4FF483AF3F1C55BEDC455E7EDBBE] +GoodName=NBC First Intro by CALi (PD) +CRC=15DB95D4 77BC52D8 + +[325B9DCD5D23F269017C16E2BA62DEA3] +GoodName=NBC-LFC Kings of Porn Vol 01 (PD) [a1] +CRC=DD95F49D 2A9B8893 + +[88095C9BD22232383AF82235F03B2658] +GoodName=NBC-LFC Kings of Porn Vol 01 (PD) +CRC=AB9F8D97 95EAA766 +RefMD5=BBDC4C4F1C474298189312008A1768C4 + +[CE915D72FEA86AA99D9C015661A3D768] +GoodName=NBCG Special Edition (PD) +CRC=011F98B2 1E1C8263 + +[8CE55DA21D0FA7B41646A1F3F45F57A1] +GoodName=NBCG's Kings of Porn Demo (PD) +CRC=61A5FCEE B59FD8D3 + +[C0ABE398CBC45EC90D03C5ADC26C1065] +GoodName=NBCG's Tag Gallery 01 by CALi (PD) +CRC=15AA9AF2 FF33D333 + +[F27300E1883EA849A69567D3AEDC5F56] +GoodName=NBCrew 2 Demo (PD) +CRC=84067BAC 87FBA623 + +[4CF0249345388BB098F79DDCD7A00798] +GoodName=NEO Myth N64 Menu Demo V0.1 (PD) +CRC=6539E529 1FE8CE01 + +[7F6C5E71711DEC81E77CCF71060F67CA] +GoodName=NFL Blitz (U) [!] +CRC=D094B170 D7C4B5CC +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[F0A1CC3D1D99A60F35D37DDCCF43CABB] +GoodName=NFL Blitz (U) [f1] (PAL) +CRC=3D6044AB 46768D77 +RefMD5=7F6C5E71711DEC81E77CCF71060F67CA + +[7E856FA8F743900FEBA5A4E28C234AF7] +GoodName=NFL Blitz - Special Edition (U) [!] +CRC=30EAD54F 31620BF6 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[BA49514441023722F02D41C62612F6C3] +GoodName=NFL Blitz 2000 (U) [!] +CRC=15A00969 34E5A285 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[DDBE4248EA34E11C091A975776042670] +GoodName=NFL Blitz 2000 (U) [f1] (PAL) +CRC=FEB72E1D 5BD2C925 +RefMD5=BA49514441023722F02D41C62612F6C3 + +[E4EDD73CB036C6B143CEE9AEEED60341] +GoodName=NFL Blitz 2001 (U) [!] +CRC=36FA35EB E85E2E36 +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[D13A38B9639CF1944FE7024E4C58739D] +GoodName=NFL Blitz 2001 (U) [f1] (PAL-NTSC) +CRC=EB7709E2 27A91031 +RefMD5=E4EDD73CB036C6B143CEE9AEEED60341 + +[75C0121D84915BF5C1FBD389CF9F9C17] +GoodName=NFL Quarterback Club 2000 (E) [!] +CRC=88BD5A9E E81FDFBF +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[EC18E3131040842E32EBAB66C7496EBD] +GoodName=NFL Quarterback Club 2000 (U) [!] +CRC=E3AB4ED0 83040DD2 +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[55224F1148F873A689604F2DC6432682] +GoodName=NFL Quarterback Club 2000 (U) [b1] +CRC=E3AB4ED0 83040DD2 +RefMD5=EC18E3131040842E32EBAB66C7496EBD + +[604E2FB5AC9A26A81883A4C19037862A] +GoodName=NFL Quarterback Club 2000 (U) [b2] +CRC=E3AB4ED0 83040DD2 +RefMD5=EC18E3131040842E32EBAB66C7496EBD + +[FD2CBDEA0992452B52E2803224232D12] +GoodName=NFL Quarterback Club 2001 (U) [!] +CRC=28784622 FFB22985 +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[A18CA5DBC85668667AA467ADD6A62B39] +GoodName=NFL Quarterback Club 98 (E) [!] +CRC=4B629EF4 99B21D9B +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[37954BA9067840FAFF851092043F0435] +GoodName=NFL Quarterback Club 98 (E) [o1] +CRC=4B629EF4 99B21D9B +RefMD5=A18CA5DBC85668667AA467ADD6A62B39 + +[709F966C30CE6DF1833E95740A5A2AB2] +GoodName=NFL Quarterback Club 98 (U) [!] +CRC=D89BE2F8 99C97ADF +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[B39D12910D12498605A9F793C29866BE] +GoodName=NFL Quarterback Club 98 (U) [b1] +CRC=D89BE2F8 99C97ADF +RefMD5=709F966C30CE6DF1833E95740A5A2AB2 + +[8A47091F443117BFA629B0B29D4450C6] +GoodName=NFL Quarterback Club 98 (U) [o1] +CRC=D89BE2F8 99C97ADF +RefMD5=709F966C30CE6DF1833E95740A5A2AB2 + +[7EC0484C2BA6AA9F0A45D7AC1F4117DA] +GoodName=NFL Quarterback Club 99 (E) [!] +CRC=52A3CF47 4EC13BFC +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[EBDC155D7462F8C73DB4730C6BF4010D] +GoodName=NFL Quarterback Club 99 (E) [b1] +CRC=52A3CF47 4EC13BFC +RefMD5=7EC0484C2BA6AA9F0A45D7AC1F4117DA + +[928869D1CE001B813BA908DFE18D7F94] +GoodName=NFL Quarterback Club 99 (U) [!] +CRC=BE76EDFF 20452D09 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[B7E41D34D209B6CFA92E3D622F911C4E] +GoodName=NHL 99 (E) [!] +CRC=287D601E ABF4F8AE +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[A62FA044BCB5507D358424ABDA6419DB] +GoodName=NHL 99 (U) [!] +CRC=591A806E A5E6921D +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[349F61F9747F2D2098F305924C97A1BF] +GoodName=NHL Blades of Steel '99 (U) [!] +CRC=82EFDC30 806A2461 +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[9FF8AFF664781384A5FC01449DC5AD8D] +GoodName=NHL Blades of Steel '99 (U) [f1] (PAL) +CRC=82EFDC30 806A2461 +RefMD5=349F61F9747F2D2098F305924C97A1BF + +[46476A5626CD99B3749AC1EE1E234FAC] +GoodName=NHL Breakaway 98 (E) [!] +CRC=29CE7692 71C58579 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[43D788E7CAEA1146228B763C13E8E740] +GoodName=NHL Breakaway 98 (E) [f1] (NTSC) +CRC=C5F020F3 27B2CA73 +RefMD5=46476A5626CD99B3749AC1EE1E234FAC + +[5CB521B928FB94E84F4E0E49B6E25CD4] +GoodName=NHL Breakaway 98 (E) [h1C] +CRC=29CE7692 71C58579 +RefMD5=46476A5626CD99B3749AC1EE1E234FAC + +[75F197DEF1D084534857493582D84E73] +GoodName=NHL Breakaway 98 (E) [o1] +CRC=29CE7692 71C58579 +RefMD5=46476A5626CD99B3749AC1EE1E234FAC + +[9EA99ED5E27E35976E8266FACF5064CD] +GoodName=NHL Breakaway 98 (E) [o1][h1C] +CRC=29CE7692 71C58579 +RefMD5=46476A5626CD99B3749AC1EE1E234FAC + +[B62076FA1421B8E7FDEC2B4F8A910EA3] +GoodName=NHL Breakaway 98 (U) [!] +CRC=6DFDCDC3 4DE701C8 +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[1D178B74A163711CA9C06327F3B709CF] +GoodName=NHL Breakaway 98 (U) [h1C] +CRC=6DFDCDC3 4DE701C8 +RefMD5=B62076FA1421B8E7FDEC2B4F8A910EA3 + +[BA863554222E503BAC7F01FA4888BE8A] +GoodName=NHL Breakaway 98 (U) [o1] +CRC=6DFDCDC3 4DE701C8 +RefMD5=B62076FA1421B8E7FDEC2B4F8A910EA3 + +[5DFB0200B6698CEF2BA2A1775BA252A8] +GoodName=NHL Breakaway 98 (U) [o1][h1C] +CRC=6DFDCDC3 4DE701C8 +RefMD5=B62076FA1421B8E7FDEC2B4F8A910EA3 + +[4BA95AA97ECFEE36051EBE0A9024EEE8] +GoodName=NHL Breakaway 99 (E) [!] +CRC=874621CB 0031C127 +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[417AFE49BF73F3663C5F5F0AF897FC79] +GoodName=NHL Breakaway 99 (E) [b1] +CRC=874621CB 0031C127 +RefMD5=4BA95AA97ECFEE36051EBE0A9024EEE8 + +[AF1D07679014760B88923A4827658CAF] +GoodName=NHL Breakaway 99 (U) [!] +CRC=441768D0 7D73F24F +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[07C102E1ADF6190E05EF3C897090DFD3] +GoodName=NHL Breakaway 99 (U) [b1] +CRC=441768D0 7D73F24F +RefMD5=AF1D07679014760B88923A4827658CAF + +[1614E1C0BEBFAA0855DA9990EF859A68] +GoodName=NHL Breakaway 99 (U) [b2] +CRC=F0C5F320 B22773CA +RefMD5=AF1D07679014760B88923A4827658CAF + +[A61854CF27E536C8513174FAEF08DFCB] +GoodName=NHL Pro 99 (E) [!] +CRC=A9895CD9 7020016C +Players=4 +Rumble=No +SaveType=Controller Pack + +[BCEE33DC37C872A188A72EEAF41369F4] +GoodName=NHL Pro 99 (E) [o1] +CRC=A9895CD9 7020016C +RefMD5=A61854CF27E536C8513174FAEF08DFCB + +[3E217E9C70608E56DA20FEAC9A458EFC] +GoodName=NUTS - Nintendo Ultra64 Test Suite by MooglyGuy (PD) +CRC=EFDAFEA4 E38D6A80 + +[B935B87F3DCCA8AEEB6A9365124846DC] +GoodName=Nagano Winter Olympics '98 (E) [!] +CRC=6D452016 713C09EE +Players=4 +SaveType=Controller Pack +Rumble=No + +[D5CE3A477104213499FFEA3A0BCB1555] +GoodName=Nagano Winter Olympics '98 (E) [h1C] +CRC=6D452016 713C09EE + +[D4D046F74BE40E067875701751647178] +GoodName=Nagano Winter Olympics '98 (E) [o1] +CRC=6D452016 713C09EE +RefMD5=B935B87F3DCCA8AEEB6A9365124846DC + +[C17F78A103D99B21533F0C1566378EF6] +GoodName=Nagano Winter Olympics '98 (U) [!] +CRC=8D2BAE98 D73725BF +Players=4 +SaveType=Controller Pack +Rumble=No + +[48782BC5728F38099B21E8B281ADC1CA] +GoodName=Nagano Winter Olympics '98 (U) [T+Ita_HRG] +CRC=8D2BAE98 D73725BF +RefMD5=C17F78A103D99B21533F0C1566378EF6 + +[63C2A327F7195FF43229738D315CF51C] +GoodName=Nagano Winter Olympics '98 (U) [b1] +CRC=8D2BAE98 D73725BF +RefMD5=C17F78A103D99B21533F0C1566378EF6 + +[2131A0AE317D243618A1E90E2153215C] +GoodName=Nagano Winter Olympics '98 (U) [b2] +CRC=8D2BAE98 D73725BF +RefMD5=C17F78A103D99B21533F0C1566378EF6 + +[96F8B3E6F6B91923462B02554025C403] +GoodName=Nagano Winter Olympics '98 (U) [h1C] +CRC=8D2BAE98 D73725BF +RefMD5=C17F78A103D99B21533F0C1566378EF6 + +[C9F607002F051F087F4FD68B8B77B4D3] +GoodName=Nagano Winter Olympics '98 (U) [o1] +CRC=8D2BAE98 D73725BF +RefMD5=C17F78A103D99B21533F0C1566378EF6 + +[A8CDD4C61604B9C279861289ED7C4542] +GoodName=Nagano Winter Olympics '98 (U) [o2] +CRC=8D2BAE98 D73725BF +RefMD5=C17F78A103D99B21533F0C1566378EF6 + +[E61251D2819E3BF3A9C0B95329F60F70] +GoodName=Namco Museum 64 (U) [!] +CRC=5129B6DA 9DEF3C8C +Players=1 +Rumble=No + +[EAD417FF24EAB32E2BF45CEA9200D425] +GoodName=Namco Museum 64 (U) [f1] (PAL) +CRC=A896AB1D 27E73688 +RefMD5=E61251D2819E3BF3A9C0B95329F60F70 + +[1F455908263C2745E4100C0319B0F4C0] +GoodName=Namco Museum 64 (U) [o1] +CRC=5129B6DA 9DEF3C8C +RefMD5=E61251D2819E3BF3A9C0B95329F60F70 + +[98C0A62FE977A8202F558E5F2E2A5A60] +GoodName=Namco Museum 64 (U) [o1][f1] (PAL) +CRC=AE21569D 5A5BC572 +RefMD5=E61251D2819E3BF3A9C0B95329F60F70 + +[E001B32D05D36EDB7E8A99B7C7E4C789] +GoodName=Namco Museum 64 (U) [t1] +CRC=A864A921 99082CD0 +RefMD5=E61251D2819E3BF3A9C0B95329F60F70 + +[CB7C26C00AB065F372DDA9950260BCBA] +GoodName=Namp64 - N64 MP3-Player by Obsidian (PD) +CRC=C4855DA2 83BBA182 + +[5E1940CA1236A76E8F2D15DE0414AE55] +GoodName=Neon Genesis Evangelion (J) [!] +CRC=147E0EDB 36C5B12C +SaveType=Eeprom 16KB +Players=1 +Rumble=Yes + +[34F5F402064F76B375771EBF80DBE734] +GoodName=Neon Genesis Evangelion (J) [b1] +CRC=147E0EDB 36C5B12C +RefMD5=5E1940CA1236A76E8F2D15DE0414AE55 + +[4374A8342E612951148136194053967C] +GoodName=Neon Genesis Evangelion (J) [b2] +CRC=147E0EDB 36C5B12C +RefMD5=5E1940CA1236A76E8F2D15DE0414AE55 + +[DB2A3682451F1A6CEAFBF44792D4A5A7] +GoodName=Neon Genesis Evangelion (J) [b3] +CRC=147E0EDB 36C5B12C +RefMD5=5E1940CA1236A76E8F2D15DE0414AE55 + +[7FE719DDE2CF1C9227BB9650AFA21A4B] +GoodName=Neon Genesis Evangelion (J) [f1] (PAL) +CRC=AC000A2B 38E3A55C +RefMD5=5E1940CA1236A76E8F2D15DE0414AE55 + +[4723E4599E37DB86B9BBD2FD18BFDB8F] +GoodName=Neon64 First Public Beta Release V2 by Halley's Comet Software (PD) +CRC=3B18F6F9 8C4BE567 + +[B7A1D8B4BD19C710E4B9DAAC5590E301] +GoodName=Neon64 First Public Beta Release V3 by Halley's Comet Software (PD) +CRC=4F707583 2D6326AA + +[E062DD1E3C8B7A266FA018C6FBC17455] +GoodName=Neon64 First Public Beta Release by Halley's Comet Software (PD) +CRC=3B18F4F7 82BFB2B3 + +[5E4DABADB17439A1F2122F5E2C141FD1] +GoodName=Neon64 V1.0 by Halley's Comet Software (PD) +CRC=E87D098B 4C70341C + +[83CB0CE82555FE733A121C052BDF3662] +GoodName=Neon64 V1.1 by Halley's Comet Software (PD) [o2] +CRC=AE809DD0 0A99B360 + +[CA02C44E41D6A7CD51785DB0981C54C7] +GoodName=Neon64 V1.1 by Halley's Comet Software (PD) +CRC=ED42A2D4 7A71CD91 + +[08EBE38D2EA9BCACED94805BBBCE7192] +GoodName=Neon64 V1.2 by Halley's Comet Software (PD) [o1] +CRC=7040B082 1BE98D03 + +[D54FB5A78A2A9189D01ACF20A6043F4B] +GoodName=Neon64 V1.2 by Halley's Comet Software (PD) +CRC=ED42A2D4 7A71CD91 + +[43475AA0D793806C23D8645F49F6656D] +GoodName=Neon64 V1.2a by Halley's Comet Software (PD) [b1] +CRC=A9F7BB48 D63C5F56 + +[38D04A1C192D591940437B6BAF628119] +GoodName=Neon64 V1.2a by Halley's Comet Software (PD) [o1] +CRC=5AAD4E36 6625D1D2 + +[9FFA642B02C27D8E01EAB17B0F0F4251] +GoodName=Neon64 V1.2a by Halley's Comet Software (PD) +CRC=ED42A2D4 7A71CD91 + +[C4ECFEC66ECEEA23F39632AB6753300F] +GoodName=New Tetris, The (E) [!] +CRC=E61CFF0A CE1C0D71 + +[7A28179B00734C9AA0F0609FAFAAFD5F] +GoodName=New Tetris, The (U) [!] +CRC=2153143F 992D6351 +Players=4 +Rumble=No +SaveType=SRAM + +[0B13983A634732FDE9D2D638C0A14C51] +GoodName=New Tetris, The (U) [f1] (PAL) +CRC=208A0427 DF465260 +RefMD5=7A28179B00734C9AA0F0609FAFAAFD5F + +[99B35D7833DAEBCE199CDCC240E29FDF] +GoodName=New Tetris, The (U) [f2] (PAL) +CRC=208A0437 0E53FF5F +RefMD5=7A28179B00734C9AA0F0609FAFAAFD5F + +[E2304DF5FF6B40E74FD5BF62655D3E57] +GoodName=New Tetris, The (U) [f3] (PAL) +CRC=43D67345 A60D5D3D +RefMD5=7A28179B00734C9AA0F0609FAFAAFD5F + +[4116CF435DB315A2481AF8D1E9352FEB] +GoodName=Nightmare Creatures (U) [!] +CRC=2857674D CC4337DA +Players=1 +Rumble=Yes +SaveType=Controller Pack + +[60A2CFF1515D4C7902DDE32A6E01D411] +GoodName=Nightmare Creatures (U) [b1] +CRC=2857674D CC4337DA +RefMD5=4116CF435DB315A2481AF8D1E9352FEB + +[68B478C274812450369DBF153CAD185D] +GoodName=Nightmare Creatures (U) [b2] +CRC=2857674D CC4337DA +RefMD5=4116CF435DB315A2481AF8D1E9352FEB + +[FF02FE6A6FE7F6C31BCA6962E53A63CA] +GoodName=Nightmare Creatures (U) [t1] +CRC=AFDCF850 5CCD80DE +RefMD5=4116CF435DB315A2481AF8D1E9352FEB + +[49198056DDEBB41B1A820A09289A2E3F] +GoodName=Nightmare Creatures (U) [t2] +CRC=AFDCF850 5CCD80DE +RefMD5=4116CF435DB315A2481AF8D1E9352FEB + +[B04957D052EF850C5EDECE69DB7377B3] +GoodName=Nintama Rantarou 64 Game Gallery (J) [!] +CRC=CD3C3CDF 317793FA +Players=4 + +[66DB457B130D31A286A23D6E4DD9726E] +GoodName=Nintendo All-Star! Dairantou Smash Brothers (J) [!] +CRC=67D20729 F696774C +Status=3 +SaveType=SRAM +Players=4 +Rumble=Yes + +[B2DF29627E0219A9C14605F46803C94C] +GoodName=Nintendo All-Star! Dairantou Smash Brothers (J) [b1] +CRC=67D20729 F696774C +RefMD5=66DB457B130D31A286A23D6E4DD9726E + +[57CBADB75429AAFC0D7040DE69DC8D70] +GoodName=Nintendo All-Star! Dairantou Smash Brothers (J) [b2] +CRC=88FFAB7D 298294A2 +RefMD5=66DB457B130D31A286A23D6E4DD9726E + +[3D78B907657918C8C58EA002FEEE1D0F] +GoodName=Nintendo All-Star! Dairantou Smash Brothers (J) [b3] +CRC=67D20729 F696774C +RefMD5=66DB457B130D31A286A23D6E4DD9726E + +[4CFAED7DAD4EE592572964BA03D8C07E] +GoodName=Nintendo All-Star! Dairantou Smash Brothers (J) [f1] +CRC=308BC746 A229B775 +RefMD5=66DB457B130D31A286A23D6E4DD9726E + +[9C0E454CFFE65835AED12B39A8D9D6EC] +GoodName=Nintendo All-Star! Dairantou Smash Brothers (J) [f2] +CRC=88FFAB7D 298294A2 +RefMD5=66DB457B130D31A286A23D6E4DD9726E + +[9A27D420B43A908ECF4F28F859E1C541] +GoodName=Nintendo All-Star! Dairantou Smash Brothers (J) [f3] +CRC=88FFAB7D 298294A2 +RefMD5=66DB457B130D31A286A23D6E4DD9726E + +[053C515BEBE73391B4479A90A8EE93F9] +GoodName=Nintendo All-Star! Dairantou Smash Brothers (J) [f4] (PAL) +CRC=58886DD0 AD93BCB1 +RefMD5=66DB457B130D31A286A23D6E4DD9726E + +[0AEE21A365F9450C258A59556F77EDB8] +GoodName=Nintendo Family by CALi (PD) +CRC=60E528A6 9500D4D3 + +[C10B51EEAC9F520419F23F95228C719A] +GoodName=Nintendo On My Mind Demo by Kid Stardust (PD) +CRC=6B2AFCC7 EEB27A34 + +[F79F17353DC5683AB60257462BE9D2FD] +GoodName=Nintendo WideBoy 64 by SonCrap (PD) +CRC=D1C6C55D F010EF52 + +[9EB9A0A45C2DD35DCB5A4A8A7FC4B151] +GoodName=Nintro64 Demo by Lem (POM '98) (PD) [b1] +CRC=4E01B4A6 C884D085 + +[497D1E0677395A921B6006BBF41EED04] +GoodName=Nintro64 Demo by Lem (POM '98) (PD) +CRC=4E01B4A6 C884D085 + +[898362D1F6E207818E8CDF88225017B6] +GoodName=NuFan Demo by Kid Stardust (PD) [b1] +CRC=FA7D3935 97AC54FC + +[9ED82C5E9B6BF204276B434C8B0F6892] +GoodName=NuFan Demo by Kid Stardust (PD) +CRC=FA7D3935 97AC54FC + +[710BA49EBD5C9A2B26653FAE93BD667A] +GoodName=Nuclear Strike 64 (E) (M2) [!] +CRC=8A97A197 272DF6C1 +Players=1 +SaveType=Controller Pack +Rumble=Yes + +[59C28E02BAF4065051C63EA51736892A] +GoodName=Nuclear Strike 64 (E) (M2) [h1C] +CRC=8A97A197 272DF6C1 +RefMD5=710BA49EBD5C9A2B26653FAE93BD667A + +[D43C2E1938534363E56A22413B91D051] +GoodName=Nuclear Strike 64 (G) [!] +CRC=8F50B845 D729D22F +Players=1 +SaveType=Controller Pack +Rumble=Yes + +[FFC584040D0D052FBAB4CB6C19245449] +GoodName=Nuclear Strike 64 (U) [!] +CRC=4998DDBB F7B7AEBC +Players=1 +SaveType=Controller Pack +Rumble=Yes + +[76C8EFDD11F6D2E553055B801A022653] +GoodName=Nuclear Strike 64 (U) [b1] +CRC=4998DDBB F7B7AEBC +RefMD5=FFC584040D0D052FBAB4CB6C19245449 + +[A3134DAE771ADDB83191422615DF8551] +GoodName=Nuclear Strike 64 (U) [f1] (PAL) +CRC=E6B339F6 22AE6901 +RefMD5=FFC584040D0D052FBAB4CB6C19245449 + +[2B7370E6880F83C808A2CB9E7F33DC46] +GoodName=Nuclear Strike 64 (U) [t1] +CRC=FE5DC5D4 E1815BE5 +RefMD5=FFC584040D0D052FBAB4CB6C19245449 + +[50C10082D0C077FDB5658EF5A6E3F54F] +GoodName=Nushi Tsuri 64 (J) [!] +CRC=D83BB920 CC406416 +Players=1 + +[7412417C50A42427637575A3CD2E652E] +GoodName=Nushi Tsuri 64 (J) [b1] +CRC=24081000 AD880000 +RefMD5=50C10082D0C077FDB5658EF5A6E3F54F + +[EEFD695B00354C5199DF348ECF404A0F] +GoodName=Nushi Tsuri 64 (J) [b2] +CRC=9ADD5DE5 451F0A65 +RefMD5=50C10082D0C077FDB5658EF5A6E3F54F + +[C187BD285BA0E2D0EF5CFFEE44B367EE] +GoodName=Nushi Tsuri 64 (J) [b3] +CRC=D83BB920 CC406416 +RefMD5=50C10082D0C077FDB5658EF5A6E3F54F + +[0B281D478B1B4FF9329B45EEB80D53F2] +GoodName=Nushi Tsuri 64 (J) [b4] +CRC=D83BB920 CC406416 +RefMD5=50C10082D0C077FDB5658EF5A6E3F54F + +[FABCB3078EDE955C04A00479EE11C43F] +GoodName=Nushi Tsuri 64 (J) [b5] +CRC=49D83BB9 20CC4064 +RefMD5=50C10082D0C077FDB5658EF5A6E3F54F + +[828E0C399C0AA7E3B047859F4FAD3550] +GoodName=Nushi Tsuri 64 - Shiokaze ni Notte (J) [b1] +CRC=5B9A9618 4B86828E +RefMD5=EEB69597E42E2F5D2914070ACF161B4F + +[A366BCBF8FF44D23A9450ECD8C71223C] +GoodName=Nushi Tsuri 64 - Shiokaze ni Notte (J) [b2] +CRC=5B9B1618 1B43C649 +RefMD5=EEB69597E42E2F5D2914070ACF161B4F + +[EEB69597E42E2F5D2914070ACF161B4F] +GoodName=Nushi Tsuri 64 - Shiokaze ni Notte (J) [!] +CRC=5B9B1618 1B43C649 +Players=1 + +[E2FB4F16A039A0E302D28ACA94D5D928] +GoodName=O.D.T. (E) (M5) [!] +CRC=E86415A6 98395B53 + +[4116E492168AAFFF1BD3100C7B0AA28F] +GoodName=O.D.T. (U) (M3) [!] +CRC=2655BB70 667D9925 + +[09BA01C6EC8B178A27FBEE3A9DEE8EB6] +GoodName=Oerjan Intro by Oerjan (POM '99) (PD) +CRC=7F2D025D 2B7DA4AD + +[E96FECBA52905DB14ADDAD7CFD61091F] +GoodName=Off Road Challenge (E) [!] +CRC=812289D0 C2E53296 +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[F30DFECB19DBD82A2FD334A8A37B8D38] +GoodName=Off Road Challenge (E) [b1] +CRC=24081000 AD880000 +RefMD5=E96FECBA52905DB14ADDAD7CFD61091F + +[1538A4235FDED9D65B98C25EDF6F9C0E] +GoodName=Off Road Challenge (E) [b2] +CRC=812289D0 C2E53296 +RefMD5=E96FECBA52905DB14ADDAD7CFD61091F + +[AF7083FC0ABCFD5A2C6A5E971453D831] +GoodName=Off Road Challenge (U) [!] +CRC=319093EC 0FC209EF +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[DC34F5AA26488352B4D025EDBF47FE39] +GoodName=Off Road Challenge (U) [b1] +CRC=319093EC 0FC209EF +RefMD5=AF7083FC0ABCFD5A2C6A5E971453D831 + +[6F378FFB873C217675F4CDD00A0318D4] +GoodName=Off Road Challenge (U) [b2] +CRC=319093EC 0FC209EF +RefMD5=AF7083FC0ABCFD5A2C6A5E971453D831 + +[D3BDAA50D6C0EFFF9D696C521B704376] +GoodName=Off Road Challenge (U) [t1] +CRC=698FE5E8 1D57B278 +RefMD5=AF7083FC0ABCFD5A2C6A5E971453D831 + +[A45C39767D33AC21956A3D4E6C03CFA1] +GoodName=Ogre Battle 64 - Person of Lordly Caliber (J) (V1.1) [!] +CRC=0375CF67 56A93FAA +Players=1 +Rumble=No +SaveType=SRAM + +[A3F64D34614A0B01B6A49AE4031ACBDF] +GoodName=Ogre Battle 64 - Person of Lordly Caliber (J) (V1.1) [b1] +CRC=0375CF67 56A93FAA +RefMD5=A45C39767D33AC21956A3D4E6C03CFA1 + +[5468A2AC2E93AD3F49E9B271C8341CAC] +GoodName=Ogre Battle 64 - Person of Lordly Caliber (J) (V1.1) [b1][o1] +CRC=0375CF67 56A93FAA +RefMD5=A45C39767D33AC21956A3D4E6C03CFA1 + +[7AF70073E7CFD8945E087A7FFD6D8348] +GoodName=Ogre Battle 64 - Person of Lordly Caliber (J) (V1.1) [b2] +CRC=0375CF67 56A93FAA +RefMD5=A45C39767D33AC21956A3D4E6C03CFA1 + +[F666E020218392E52662FDDFA1EA4F21] +GoodName=Ogre Battle 64 - Person of Lordly Caliber (U) [!] +CRC=E6419BC5 69011DE3 +Players=1 +SaveType=SRAM +Rumble=No + +[465DFD27DDAB4F5488F4DADC09B7F938] +GoodName=Olympic Hockey Nagano '98 (E) (M4) [!] +CRC=AE2D3A35 24F0D41A +SaveType=Controller Pack +Players=4 + +[02AA0C059EC36145927353C8E617AA41] +GoodName=Olympic Hockey Nagano '98 (E) (M4) [h1C] +CRC=AE2D3A35 24F0D41A +RefMD5=465DFD27DDAB4F5488F4DADC09B7F938 + +[8A964671C5A4F4FC62787F1F25EDD70D] +GoodName=Olympic Hockey Nagano '98 (J) [!] +CRC=90F43037 5C5370F5 +Players=4 +SaveType=Controller Pack + +[9C99C6D9EA98A960056C531CB78EB35B] +GoodName=Olympic Hockey Nagano '98 (U) [!] +CRC=7EC22587 EF1AE323 +Players=4 +SaveType=Controller Pack + +[8F9810383B86E86EC447F65D47CA74A7] +GoodName=Olympic Hockey Nagano '98 (U) [T+Ita_cattivik66] +CRC=7EC22587 EF1AE323 +RefMD5=9C99C6D9EA98A960056C531CB78EB35B + +[7BD97D75D09E38996F82C6190780D447] +GoodName=Olympic Hockey Nagano '98 (U) [b1] +CRC=7EC22587 EF1AE323 +RefMD5=9C99C6D9EA98A960056C531CB78EB35B + +[3A314CE9388E4178FD6FC9C74D5E7137] +GoodName=Olympic Hockey Nagano '98 (U) [b2] +CRC=7EC22587 EF1AE323 +RefMD5=9C99C6D9EA98A960056C531CB78EB35B + +[CFCB20EACFCEAA43FDDBE05FB0D170D1] +GoodName=Olympic Hockey Nagano '98 (U) [b3] +CRC=7EC22587 EF1AE323 +RefMD5=9C99C6D9EA98A960056C531CB78EB35B + +[3E973B5BBEF8B24A4C4D7C326955E71F] +GoodName=Olympic Hockey Nagano '98 (U) [h1C] +CRC=7EC22587 EF1AE323 +RefMD5=9C99C6D9EA98A960056C531CB78EB35B + +[3796829F54958CE103DCF5E3E8EB80B4] +GoodName=Onegai Monsters (J) [!] +CRC=DC649466 572FF0D9 +Players=4 + +[B19805B3DFECF85FEA7E04614362DC28] +GoodName=Onegai Monsters (J) [b1] +CRC=DC649466 572FF0D9 +RefMD5=3796829F54958CE103DCF5E3E8EB80B4 + +[91CF1982F309BD73822165087DAD4371] +GoodName=Operation WinBack (E) (M5) [!] +CRC=D5898CAF 6007B65B +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[F2DF4577D3749345F93BA0606BECA8DD] +GoodName=PC-Engine 64 (POM '99) (PD) [t1] +CRC=4B548E10 BB510803 + +[70FD44B722B55956BE86B660F153713D] +GoodName=PC-Engine 64 (POM '99) (PD) +CRC=9118F1B8 987DAC8C + +[52F4F3320607F3E8DD1A16A2F1BFBDB0] +GoodName=PD Ultraman Battle Collection 64 (J) [!] +CRC=F468118C E32EE44E +SaveType=Eeprom 16KB + +[4FD424DF60F80EE7E362A9572049BA11] +GoodName=PD Ultraman Battle Collection 64 (J) [b1] +CRC=F468118C E32EE44E +RefMD5=52F4F3320607F3E8DD1A16A2F1BFBDB0 + +[2755152E6168516F2224ADC6737B96F0] +GoodName=PD Ultraman Battle Collection 64 (J) [f1] (PAL) +CRC=37B52113 3A77A655 +RefMD5=52F4F3320607F3E8DD1A16A2F1BFBDB0 + +[826AE85B4E74354EE378E8DC2AD33271] +GoodName=PD Ultraman Battle Collection 64 (J) [f2] (PAL) +CRC=170D4973 8FA23F51 +RefMD5=52F4F3320607F3E8DD1A16A2F1BFBDB0 + +[0112FFAADA116D172ABCE136E9043A93] +GoodName=PGA European Tour (E) (M5) [!] +CRC=EE08C602 6BC2D5A6 +Players=4 +Rumble=Yes +SaveType=Eeprom 4KB + +[2F6B0ACB7270F78C972F5E6D4C75B02B] +GoodName=PGA European Tour (E) (M5) [f1] (NTSC) +CRC=5243B915 BE7743B1 +RefMD5=0112FFAADA116D172ABCE136E9043A93 + +[7DBA0D5D4279274AF07B0EF3EC3A84AD] +GoodName=PGA European Tour (E) (M5) [f2] (NTSC) +CRC=76515D11 42BF7875 +RefMD5=0112FFAADA116D172ABCE136E9043A93 + +[617CECA1D2BEFFCE943EF832326898BF] +GoodName=PGA European Tour (U) [!] +CRC=B54CE881 BCCB6126 +Players=4 +Rumble=Yes +SaveType=Eeprom 4KB + +[8E79EC6D9F8DB1C50100860BF4437462] +GoodName=POMbaer Demo by Kid Stardust (POM '99) (PD) +CRC=9D63C653 C26B460F + +[0BBE17EC2271DC293F1D2F4A7B0D61D4] +GoodName=POMolizer Demo by Renderman (POM '99) (PD) +CRC=EDAFD3C0 39EF3599 + +[D60046C23400BFEBD5B051F89E7F2F07] +GoodName=Pachinko 365 Nichi (J) [!] +CRC=74554B3B F4AEBCB5 +Players=1 +Rumble=No + +[2002438491F94C468CB487032AC4AA33] +GoodName=Pachinko 365 Nichi (J) [b1] +CRC=74554B3B F4AEBCB5 +RefMD5=D60046C23400BFEBD5B051F89E7F2F07 + +[F38ECA581BF6944EA35E3A816AD472DF] +GoodName=Pachinko 365 Nichi (J) [b2] +CRC=74554B3B F4AEBCB5 +RefMD5=D60046C23400BFEBD5B051F89E7F2F07 + +[FE38BB1EAA1C74BAF01847BDE64E7F9D] +GoodName=Pamela Demo (PD) +CRC=26AD85C5 F908A36B + +[3AAF74D7E6D560C9CB1331209AD00F22] +GoodName=Pamela Demo - Resized (PD) +CRC=26AD85C5 F908A36B + +[A9BE6A493A680642D840F859A65816CA] +GoodName=Paper Mario (E) (M4) [!] +CRC=19AB29AF C71BCD28 +Status=2 +Players=1 +SaveType=Flash RAM +Rumble=Yes + +[A722F8161FF489943191330BF8416496] +GoodName=Paper Mario (U) [!] +CRC=65EEE53A ED7D733C +Status=2 +Players=1 +SaveType=Flash RAM +Rumble=Yes + +[8595BA0A0D2EA73944228BDED4A969AD] +GoodName=Paper Mario (U) [T+Chi] +CRC=85F5A08A EAC7053E +RefMD5=A722F8161FF489943191330BF8416496 + +[B7F2EB7989C9C00096655D087D72EC51] +GoodName=Paperboy (E) [!] +CRC=AC976B38 C3A9C97A + +[C4CBCB54B010A5A71FE5CAA391E5C25F] +GoodName=Paperboy (U) [!] +CRC=3E198D9E F2E1267E +Players=1 +SaveType=Controller Pack +Rumble=No + +[12827E2EF6EB1FF0F8AA494E671C3094] +GoodName=Paperboy (U) [f1] (PAL) +CRC=8952E61E AA89984C +RefMD5=C4CBCB54B010A5A71FE5CAA391E5C25F + +[5DF3D21223F0DAFD0417998E9C1E7065] +GoodName=Paperboy (U) [hI] +CRC=89529B12 0853ED3B +RefMD5=C4CBCB54B010A5A71FE5CAA391E5C25F + +[0451768553AB8CDD6C9CA37514E6C339] +GoodName=Paperboy (U) [hI][f1] (PAL) +CRC=8F00E51E 030C92C8 +RefMD5=C4CBCB54B010A5A71FE5CAA391E5C25F + +[1F72E506250B16726E2C5A629CAE8E0F] +GoodName=Paperboy (U) [hI][t1] +CRC=8632071E 637E1042 +RefMD5=C4CBCB54B010A5A71FE5CAA391E5C25F + +[DF2A6A2446E8E01375ADE872A8F93366] +GoodName=Paperboy (U) [t1] +CRC=8632071E 637E1042 +RefMD5=C4CBCB54B010A5A71FE5CAA391E5C25F + +[D78E10C6B3E98F3B32FE0F23ED72DB42] +GoodName=Parlor! Pro 64 - Pachinko Jikki Simulation Game (J) [!] +CRC=CFE2CB31 4D6B1E1D +Players=1 +Rumble=No + +[6DF573EE08C4577BBBF117B813D93B19] +GoodName=Pause Demo by RedboX (PD) +CRC=7D1727F1 6C6B83EB + +[20DA62ECE553EDE84D02283174BECC8F] +GoodName=Penny Racers (E) [!] +CRC=C83CEB83 FDC56219 +SaveType=Eeprom 4KB +Players=4 +Rumble=No +Status=3 + +[B6DF5A75CED54DFEE0E29BCE9ABD0AAF] +GoodName=Penny Racers (E) [h1C] +CRC=C83CEB83 FDC56219 +RefMD5=20DA62ECE553EDE84D02283174BECC8F + +[6AE97EC4933A13C153A281DC8B68A0D9] +GoodName=Penny Racers (E) [h2C] +CRC=C83CEB83 FDC56219 +RefMD5=20DA62ECE553EDE84D02283174BECC8F + +[518B14054A667A3B9E0B72D3BF784E41] +GoodName=Penny Racers (U) [!] +CRC=73ABB1FB 9CCA6093 +SaveType=Eeprom 4KB +Players=4 +Rumble=No +Status=3 + +[26F033C7716A10755A3D22C62ACF6851] +GoodName=Penny Racers (U) [hI] +CRC=AB5E61C8 A2FA7596 +RefMD5=518B14054A667A3B9E0B72D3BF784E41 + +[D9B5CD305D228424891CE38E71BC9213] +GoodName=Perfect Dark (E) (M5) [!] +CRC=E4B08007 A602FF33 +SaveType=Eeprom 16KB +Players=4 +Rumble=Yes + +[9E6D80933B63B183CCBD8B5F6543DCAD] +GoodName=Perfect Dark (E) (M5) [b1] +CRC=E4B08007 A602FF33 +RefMD5=D9B5CD305D228424891CE38E71BC9213 + +[538D2B75945EAE069B29C46193E74790] +GoodName=Perfect Dark (J) [!] +CRC=96747EB4 104BB243 +SaveType=Eeprom 16KB + +[7F4171B0C8D17815BE37913F535E4E93] +GoodName=Perfect Dark (U) (V1.0) [!] +CRC=DDF460CC 3CA634C0 +SaveType=Eeprom 16KB +Players=4 +Rumble=Yes + +[BF167523E079C57DCCA880A6F38889F2] +GoodName=Perfect Dark (U) (V1.0) [f1] (PAL) +CRC=65264217 7FB64F7F +RefMD5=7F4171B0C8D17815BE37913F535E4E93 + +[E03B088B6AC9E0080440EFED07C1E40F] +GoodName=Perfect Dark (U) (V1.1) [!] +CRC=41F2B98F B458B466 +SaveType=Eeprom 16KB +Players=4 +Rumble=Yes + +[E0BCB2758EDF0AC6AB7DB36D98E1E57C] +GoodName=Pikachu Genki Dechu (J) [!] +CRC=3F245305 FC0B74AA +Players=1 +Rumble=Yes +SaveType=Eeprom 4KB + +[D0AE6C07AC0481EBA5FF9CE798A69574] +GoodName=Pikachu Genki Dechu (J) [b1] +CRC=3F245305 FC0B74AA +RefMD5=E0BCB2758EDF0AC6AB7DB36D98E1E57C + +[3FCD4969F9A080BD2BCB913EC5D7A3BD] +GoodName=Pilotwings 64 (E) (M3) [!] +CRC=1AA05AD5 46F52D80 +Players=1 +Rumble=No +SaveType=Eeprom 4KB + +[F21E2A3A05ACF49586F32DCE5C449FE4] +GoodName=Pilotwings 64 (E) (M3) [b1] +CRC=1AA05AD5 46F52D80 +RefMD5=3FCD4969F9A080BD2BCB913EC5D7A3BD + +[987682CC63777221B938CC465607BD8C] +GoodName=Pilotwings 64 (E) (M3) [b2] +CRC=1AA05AD5 46F52D80 +RefMD5=3FCD4969F9A080BD2BCB913EC5D7A3BD + +[99FD0E1CBA30C18C869F2DE98678CD16] +GoodName=Pilotwings 64 (E) (M3) [h1C] +CRC=1AA05AD5 46F52D80 +RefMD5=3FCD4969F9A080BD2BCB913EC5D7A3BD + +[E8E6EC0692009009F5DCA6827B21F59A] +GoodName=Pilotwings 64 (J) [!] +CRC=09CC4801 E42EE491 +Players=1 +SaveType=Eeprom 4KB +Rumble=No + +[2740F1B89CE7D78A5D31CF60C97A0C11] +GoodName=Pilotwings 64 (J) [b1] +CRC=09CC4801 E42EE491 +RefMD5=E8E6EC0692009009F5DCA6827B21F59A + +[8B346182730CEAFFE5E2CCF6D223C5EF] +GoodName=Pilotwings 64 (U) [!] +CRC=C851961C 78FCAAFA +Players=1 +SaveType=Eeprom 4KB +Rumble=No + +[E28F8F19E56CC6C7A0F3A3286AEB60C1] +GoodName=Pilotwings 64 (U) [h1C] +CRC=C851961C 78FCAAFA +RefMD5=8B346182730CEAFFE5E2CCF6D223C5EF + +[F69DE158BC76416B4C6C4704B15B6EB0] +GoodName=Pilotwings 64 (U) [t1] +CRC=70478A35 F9897402 +RefMD5=8B346182730CEAFFE5E2CCF6D223C5EF + +[BE9E0C9D509AAB0C72F7788D6BE3B443] +GoodName=Pip's Pong by Mr. Pips (PD) [b1] +CRC=D072CFE7 CE134788 + +[E821B540A91B7BF088E52ABC02A5CC9A] +GoodName=Pip's Pong by Mr. Pips (PD) +CRC=D072CFE7 CE134788 + +[63CBABEF9069FE3375A7726C89E9E25D] +GoodName=Pip's Porn Pack 1 by Mr. Pips (PD) +CRC=D851B920 F3D6C0CE + +[3DF1646CC28C04133B3CB5EB143AE016] +GoodName=Pip's Porn Pack 2 by Mr. Pips (POM '99) (PD) +CRC=BF9D0FB0 981C22D1 + +[547CF20308F2CE2CE5B5310A5E555113] +GoodName=Pip's Porn Pack 3 by Mr. Pips (PD) +CRC=EA2A6A75 52B2C00F + +[5D144D323785818A9BD5C667A5567BBD] +GoodName=Pip's RPGs Beta 12 by Mr. Pips (PD) +CRC=3CB8AAB8 05C8E573 + +[EFBCB657A3B05B5CB080FD628B852BD0] +GoodName=Pip's RPGs Beta 14 by Mr. Pips (PD) +CRC=56563C89 C803F77B + +[C6FAAC42045BE1AF769EC52CEA6DED52] +GoodName=Pip's RPGs Beta 15 by Mr. Pips (PD) +CRC=AFBBB9D5 8EE82954 + +[10A28DF32D06B7D3D9B14091AC9D2E14] +GoodName=Pip's RPGs Beta 2 by Mr. Pips (PD) +CRC=DAD7F751 8B6322F0 + +[6402498E891455FFB86C95AD8ABB87F6] +GoodName=Pip's RPGs Beta 3 by Mr. Pips (PD) +CRC=C830954A 29E257FC + +[10E62952244834E0B52AF32898DE8D9F] +GoodName=Pip's RPGs Beta 6 by Mr. Pips (PD) +CRC=7194B65B 9DE67E7D + +[35FAB2CC64E0E808EB629A25542C7326] +GoodName=Pip's RPGs Beta 7 by Mr. Pips (PD) +CRC=DB363DDA 50C1C2A5 + +[9E35B55606BDF4C77A1E817CE503A951] +GoodName=Pip's RPGs Beta x (PD) [a1] +CRC=668FA336 2C67F3AC + +[F8D6C5ABA62FC302C2848C53104E2683] +GoodName=Pip's RPGs Beta x (PD) +CRC=BB787C13 78C1605D + +[45CDCBCB7159EBAE1ED4D7AAE70749E0] +GoodName=Pip's Tic Tak Toe by Mark Pips (PD) +CRC=6459533B 7E22B56C + +[99D711AB6DFD36121E5C23C1DBA78C01] +GoodName=Pip's World Game 1 by Mr. Pips (PD) [b1] +CRC=762C75D1 AA09C759 + +[4D28DDB5B93EA302EE9F27805DE1B46F] +GoodName=Pip's World Game 1 by Mr. Pips (PD) +CRC=762C75D1 AA09C759 + +[BBF5060E64BD0201954E65BD281EC486] +GoodName=Pip's World Game 2 by Mr. Pips (PD) [b1] +CRC=FC051819 A46A48F6 + +[9358AA90887FC31C45BC2B849C37D6A0] +GoodName=Pip's World Game 2 by Mr. Pips (PD) +CRC=FC051819 A46A48F6 + +[9C1B750A2F9DFC53361F72F4BFB647A7] +GoodName=Pipendo by Mr. Pips (PD) +CRC=45627CED 28005F9C + +[1D7CFC7CDB5A0E1B69B1DC2E58A4F192] +GoodName=Planet Console Intro (PD) +CRC=1077590A B537FDA2 + +[83B75800690AF27800DF362697E5205E] +GoodName=Plasma Demo (PD) [a1] +CRC=7D1727F1 6C6B83EB + +[E27C00C2114A56D18DD27B426193B79C] +GoodName=Plasma Demo (PD) +CRC=E9F52336 6BEFAA5F + +[FBDD74ED68E6A0CD734562D56CCB752D] +GoodName=Pocket Monsters Snap (J) [!] +CRC=EC0F690D 32A7438C +Players=1 +Rumble=Yes +SaveType=Flash RAM + +[42CC0FE1442B0A498DFD8F743179C51A] +GoodName=Pocket Monsters Snap (J) [b1] +CRC=BB2D10F8 B8ED4D23 +RefMD5=FBDD74ED68E6A0CD734562D56CCB752D + +[76AE2B6F38E611683ACA3B87D1B3D5CE] +GoodName=Pocket Monsters Snap (J) [f1] +CRC=BB2D10F8 B8ED4D23 +RefMD5=FBDD74ED68E6A0CD734562D56CCB752D + +[CCA8D3874996A78C3B5828E7A66AC916] +GoodName=Pocket Monsters Snap (J) [f2] (GameShark) +CRC=412D7090 CEDABAC3 +RefMD5=FBDD74ED68E6A0CD734562D56CCB752D + +[C46E087D966A35095DF96799B0B4FFAE] +GoodName=Pocket Monsters Stadium (J) [!] +CRC=665E8259 D098BD1D +Players=4 +Rumble=Yes + +[B43B3C7A3D2149FEEDC8BA3B8198BE5D] +GoodName=Pocket Monsters Stadium (J) [b1] +CRC=665E8259 D098BD1D +RefMD5=CCA8D3874996A78C3B5828E7A66AC916 + +[D0698135C4A74CDEA8374DA0BD15DFDB] +GoodName=Pocket Monsters Stadium (J) [b2] +CRC=58FBD28F FEB595F0 +RefMD5=CCA8D3874996A78C3B5828E7A66AC916 + +[1A5D6FBF59D1639AF71B61410553AB04] +GoodName=Pocket Monsters Stadium (J) [f1] (Boot-PAL) +CRC=58FBD28F FEB595F0 +RefMD5=CCA8D3874996A78C3B5828E7A66AC916 + +[9BBC3945F526C8329710824C29FFC040] +GoodName=Pocket Monsters Stadium (J) [f2] (Boot) +CRC=76AF28D8 64A07F55 +RefMD5=CCA8D3874996A78C3B5828E7A66AC916 + +[2449BB712A64E3363A6CBD56F5ADEDA5] +GoodName=Pocket Monsters Stadium 2 (J) [!] +CRC=63775886 5FB80E7B +SaveType=Flash RAM +Players=4 +Rumble=Yes + +[907403B12D2AD59A0F186A1632AE39B9] +GoodName=Pocket Monsters Stadium 2 (J) [f1] +CRC=FE667A12 0D2195AD +RefMD5=2449BB712A64E3363A6CBD56F5ADEDA5 + +[3F39C01455B585CAEB2DF8A09765D0B3] +GoodName=Pocket Monsters Stadium 2 (J) [f2] +CRC=FE667A12 0D2195AD +RefMD5=2449BB712A64E3363A6CBD56F5ADEDA5 + +[DC8F45A200FED15C3B0BD97A2F52ACA5] +GoodName=Pocket Monsters Stadium 2 (J) [f3] +CRC=058381EF 6A36FEC6 +RefMD5=2449BB712A64E3363A6CBD56F5ADEDA5 + +[E5D7B56B5EDBD8575ECEB9E5ECCF4A00] +GoodName=Pocket Monsters Stadium 2 (J) [f4] +CRC=FE667A12 0D2195AD +RefMD5=2449BB712A64E3363A6CBD56F5ADEDA5 + +[A17AADCC962393D476EDC321E59C504B] +GoodName=Pocket Monsters Stadium Kin Gin (J) [!] +CRC=EE4FD7C2 9CF1D938 +Players=4 +SaveType=Flash RAM +Rumble=Yes + +[2EF9FA16DE2A09EA15B6289447F40490] +GoodName=Pokemon Puzzle League (E) [!] +CRC=4A1CD153 D830AEF8 +Players=2 +SaveType=Flash RAM +Rumble=No + +[A3BA044DFC00BB766B4B2BFB9D4B5BE9] +GoodName=Pokemon Puzzle League (F) [!] +CRC=3EB2E6F3 062F9EFE +Players=2 +SaveType=Flash RAM +Rumble=No + +[000364BAC80E41D9060A31A5923874B7] +GoodName=Pokemon Puzzle League (G) [!] +CRC=7A4747AC 44EEEC23 +Players=2 +SaveType=Flash RAM +Rumble=No + +[E722576A15182CFED6782379CE4BC8BE] +GoodName=Pokemon Puzzle League (U) [!] +CRC=19C553A7 A70F4B52 +Players=2 +SaveType=Flash RAM +Rumble=No + +[DC09E2685EB95471311E57B3605F4894] +GoodName=Pokemon Puzzle League (U) [t1] +CRC=E1AAA925 27C9C94B +RefMD5=E722576A15182CFED6782379CE4BC8BE + +[D5EDC7B884DFBA7CF4AC4CDFA8AC64A4] +GoodName=Pokemon Puzzle League (U) [t2] +CRC=AAE125A9 C9274BC9 +RefMD5=E722576A15182CFED6782379CE4BC8BE + +[E5A0CA3DC54B38EA7FCD927E3CFFAD3B] +GoodName=Pokemon Snap (A) [!] +CRC=7BB18D40 83138559 +Players=1 +SaveType=Flash RAM +Rumble=Yes + +[A88FCF3FF00F21D3CEC44D2E0FAAAAD8] +GoodName=Pokemon Snap (A) [f1] (GameShark) +CRC=F795ACE1 8DEDE03C +RefMD5=E5A0CA3DC54B38EA7FCD927E3CFFAD3B + +[F2A8106403D2BF9350BFEAB08689D54A] +GoodName=Pokemon Snap (E) [!] +CRC=4FF5976F ACF559D8 +Players=1 +SaveType=Flash RAM +Rumble=Yes + +[E9028F9CCC307806695DD81742D05D5D] +GoodName=Pokemon Snap (F) [!] +CRC=BA6C293A 9FAFA338 +Players=1 +SaveType=Flash RAM +Rumble=Yes + +[5FA70A63E352EA804607999674381749] +GoodName=Pokemon Snap (F) [b1] +CRC=BA6C293A 9FAFA338 +RefMD5=E9028F9CCC307806695DD81742D05D5D + +[144B8906DC40534CFBEF6D7B994A982B] +GoodName=Pokemon Snap (G) [!] +CRC=5753720D 2A8A884D +Players=1 +SaveType=Flash RAM +Rumble=Yes + +[D0453459095F69BE36D675D8F743069B] +GoodName=Pokemon Snap (I) [!] +CRC=C0C85046 61051B05 +Players=1 +SaveType=Flash RAM +Rumble=Yes + +[A45D7115BE5A06FD1567F9F913C3BDF8] +GoodName=Pokemon Snap (S) [!] +CRC=817D286A EF417416 +Players=1 +SaveType=Flash RAM +Rumble=Yes + +[FC3C9329B7CDD67CF7650ABF63B9A580] +GoodName=Pokemon Snap (U) [!] +CRC=CA12B547 71FA4EE4 +Players=1 +SaveType=Flash RAM +Rumble=Yes + +[CCA6F7593302D46ADA66C991C976DA2D] +GoodName=Pokemon Snap (U) [T+Spa] +CRC=CA12B547 71FA4EE4 +RefMD5=FC3C9329B7CDD67CF7650ABF63B9A580 + +[E3D4F75C24DA0521488E704812259A46] +GoodName=Pokemon Snap (U) [f1] (Save) +CRC=3FF65EDD 0F8158B0 +RefMD5=FC3C9329B7CDD67CF7650ABF63B9A580 + +[373FBBF4B909E7C8A3AAB3DD80DEBD11] +GoodName=Pokemon Snap (U) [f2] (Save-PAL) +CRC=38186DAF 232AE3D8 +RefMD5=FC3C9329B7CDD67CF7650ABF63B9A580 + +[BCB210A6A3DCA9A653F836E2957BD6DC] +GoodName=Pokemon Snap (U) [f3] (GameShark) +CRC=03529CD9 186BDDCD +RefMD5=FC3C9329B7CDD67CF7650ABF63B9A580 + +[53A5D74FA55E378ADA84AF9B0ED2B728] +GoodName=Pokemon Snap (U) [f3] +CRC=3FF65EDD 0F8158B0 +RefMD5=FC3C9329B7CDD67CF7650ABF63B9A580 + +[A9C272687DABD59C5144774B53BCC35A] +GoodName=Pokemon Snap Station (U) [!] +CRC=39119872 07722E9F +Players=1 +Rumble=Yes + +[B88F0EC125C54685FA516D233B564842] +GoodName=Pokemon Snap Station (U) [f1] +CRC=4B34DF0B 5899C0FE +RefMD5=A9C272687DABD59C5144774B53BCC35A + +[2859090D78581E0925A3AF8045E81E4B] +GoodName=Pokemon Stadium (E) (V1.0) [!] +CRC=84077275 57315B9C +Players=2 +Rumble=Yes +SaveType=Flash RAM + +[9CC940F5F463416F0B2C15F07A088F33] +GoodName=Pokemon Stadium (E) (V1.0) [f1] +CRC=9DFE20E9 18894032 +RefMD5=2859090D78581E0925A3AF8045E81E4B + +[31EE2DE8E65E30F5934C450DBAA924F0] +GoodName=Pokemon Stadium (E) (V1.1) [!] +CRC=91C9E05D AD3AAFB9 +Players=2 +SaveType=Flash RAM +Rumble=Yes + +[0E85A098D0F0E8A7EB572A69612A6873] +GoodName=Pokemon Stadium (F) [!] +CRC=A23553A3 42BF2D39 +Players=2 +SaveType=Flash RAM +Rumble=Yes + +[4688C66F8C13EDA13DD5678176A7FD8A] +GoodName=Pokemon Stadium (F) [f1] +CRC=7E3D8157 D9BF4D91 +RefMD5=0E85A098D0F0E8A7EB572A69612A6873 + +[24BE2CCB0DEA0755908C02BF67E22FE5] +GoodName=Pokemon Stadium (G) [!] +CRC=42011E1B E3552DB5 +Players=2 +SaveType=Flash RAM +Rumble=Yes + +[8FAA825507E6CD3F388CC33343FAE547] +GoodName=Pokemon Stadium (G) [f1] +CRC=D7F73553 1347659F +RefMD5=24BE2CCB0DEA0755908C02BF67E22FE5 + +[A81321759AF38BEB30A40FDACA2EA22A] +GoodName=Pokemon Stadium (I) [!] +CRC=A53FA82D DAE2C15D +Players=2 +SaveType=Flash RAM +Rumble=Yes + +[D14A499BC4E324974EAE3E42DEC58625] +GoodName=Pokemon Stadium (S) [!] +CRC=B6E549CE DC8134C0 +Players=2 +SaveType=Flash RAM +Rumble=Yes + +[8D296A614A47AC99B80D1EDE669E62B3] +GoodName=Pokemon Stadium (S) [f1] +CRC=4C115008 9F124960 +RefMD5=D14A499BC4E324974EAE3E42DEC58625 + +[ED1378BC12115F71209A77844965BA50] +GoodName=Pokemon Stadium (U) (V1.0) [!] +CRC=90F5D9B3 9D0EDCF0 +Players=2 +SaveType=Flash RAM +Rumble=Yes + +[C9214988B08511D2F44FAC2FAD2EE67A] +GoodName=Pokemon Stadium (U) (V1.0) [f1] +CRC=84EBE70F 352C5E3F +RefMD5=ED1378BC12115F71209A77844965BA50 + +[A7087A96A709E4C662A459B4B4159094] +GoodName=Pokemon Stadium (U) (V1.1) [!] +CRC=1A122D43 C17DAF0F +Players=2 +SaveType=Flash RAM +Rumble=Yes + +[A0087A475A29F38BD4CE5DF0A41A89CB] +GoodName=Pokemon Stadium (U) (V1.1) [f1] +CRC=3FC42B3E CED602E6 +RefMD5=A7087A96A709E4C662A459B4B4159094 + +[B1271DB50D6EF8F6B53CC640C3743E4F] +GoodName=Pokemon Stadium 2 (E) [!] +CRC=2952369C B6E4C3A8 +Players=2 +SaveType=Flash RAM +Rumble=Yes + +[BB1623BD4751240138DE55E18D3ACA7E] +GoodName=Pokemon Stadium 2 (E) [T+Ita0.05] +CRC=2952369C B6E4C3A8 +RefMD5=B1271DB50D6EF8F6B53CC640C3743E4F + +[4748D96916AE2BCC5FC1630515EE2561] +GoodName=Pokemon Stadium 2 (F) [!] +CRC=AC5AA5C7 A9B0CDC3 +Players=2 +SaveType=Flash RAM +Rumble=Yes + +[484F3E696C94980ACF3D7068F9ACC98F] +GoodName=Pokemon Stadium 2 (G) [!] +CRC=439B7E7E C1A1495D +Players=2 +SaveType=Flash RAM +Rumble=Yes + +[5A04D7F1AB9C6B080176567AA7168D3A] +GoodName=Pokemon Stadium 2 (I) [!] +CRC=EFCEAF00 22094848 +Players=2 +SaveType=Flash RAM +Rumble=Yes + +[B26AAFD452C9816E1B7AA0954E75825F] +GoodName=Pokemon Stadium 2 (S) [!] +CRC=D0A1FC5B 2FB8074B +Players=2 +SaveType=Flash RAM +Rumble=Yes + +[1561C75D11CEDF356A8DDB1A4A5F9D5D] +GoodName=Pokemon Stadium 2 (U) [!] +CRC=03571182 892FD06D +Players=2 +SaveType=Flash RAM +Rumble=Yes + +[BBDC4C4F1C474298189312008A1768C4] +GoodName=Polaris SnoCross (U) [!] +CRC=41380792 A167E045 +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[F27CBDB653AAF1D4856A53D5951F36DD] +GoodName=Polaris SnoCross (U) [o1][t1] +CRC=B8B73263 1492FC49 +RefMD5=BBDC4C4F1C474298189312008A1768C4 + +[35A01AEB01F3184DD20904AF28FA71C6] +GoodName=Polaris SnoCross (U) [t1] +CRC=B8B73263 1492FC49 +RefMD5=BBDC4C4F1C474298189312008A1768C4 + +[8847BD6403BA49FD62899115D661B623] +GoodName=Pom Part 1 Demo (PD) +CRC=1BC0CA2C 0F516B86 + +[037D2727B90998BED41DA0F290BB8441] +GoodName=Pom Part 2 Demo (PD) +CRC=ACD51083 EEC8DBED + +[5426EAED0D350367393F385025AF164C] +GoodName=Pom Part 3 Demo (PD) +CRC=1FE04890 D6696958 + +[C7921F3D4B91A42472DADD4DBA2CDC54] +GoodName=Pom Part 4 Demo (PD) +CRC=CFBEE39B 76F0A14A + +[F67C06AF4F6613804B3F700B1169B58D] +GoodName=Pom Part 5 Demo (PD) +CRC=2803B8CE 4A1EE409 + +[BA976164C2A900C03F445ACD51518FB0] +GoodName=Pong V0.01 by Omsk (PD) +CRC=C252F9B1 AD70338C + +[8EACC93671249508BF12CF6EC101056D] +GoodName=Pong by Oman (PD) +CRC=DAA76993 D8ACF77C +Players=2 +Status=3 +Rumble=No +SaveType=None + +[68C7FC1924AB4400CB65E40C32B7D3A6] +GoodName=Pong by Oman (PD) [a1] +CRC=DAA76993 D8ACF77C +RefMD5=8EACC93671249508BF12CF6EC101056D + +[E3CFB5F1828CAF1F00B23ADA863460AD] +GoodName=Pong by Oman (PD) [h1C][o1] +CRC=DAA76993 D8ACF77C +RefMD5=8EACC93671249508BF12CF6EC101056D + +[CD4D5C6C96C8C528A0FCE2958A4A7AC9] +GoodName=Pong by Oman (PD) [t1] +CRC=6BE878A8 3DC16D91 +RefMD5=8EACC93671249508BF12CF6EC101056D + +[8CC73C373016070647030DDE492FDC8C] +GoodName=Power League Baseball 64 (J) [!] +CRC=D7A6DCFA CCFEB6B7 +Players=4 +Rumble=No + +[6504FC6F3ADB596F7D68060EB39A75B4] +GoodName=Power League Baseball 64 (J) [o1] +CRC=D7A6DCFA CCFEB6B7 +RefMD5=8CC73C373016070647030DDE492FDC8C + +[AE3BDF729214964620417CC3163F0BB6] +GoodName=Power Rangers - Lightspeed Rescue (E) [!] +CRC=39F60C11 AB2EBA7D +SaveType=Controller Pack +Players=2 +Rumble=Yes + +[24B5BFA896802253D2B715FC760D1B3E] +GoodName=Power Rangers - Lightspeed Rescue (E) [f1] (NTSC) +CRC=8CD06379 62319493 +RefMD5=AE3BDF729214964620417CC3163F0BB6 + +[91D74621DDEF6D37FB845B3BC7059A38] +GoodName=Power Rangers - Lightspeed Rescue (U) [!] +CRC=CF8957AD 96D57EA9 +Players=2 +SaveType=Controller Pack +Rumble=Yes + +[2991BB68ECA54813D6B834ADBBBACC4C] +GoodName=Powerpuff Girls, The - Chemical X-Traction (U) [!] +CRC=FC74D475 9A0278AB +Players=2 +Rumble=No + +[25BAFC84BA4D87854DC44DF3EF8764EA] +GoodName=Premier Manager 64 (E) [!] +CRC=F3D27F54 C111ACF9 +Players=1 +Rumble=No + +[527F05F166398599F0A1B10F8E1F9585] +GoodName=Premier Manager 64 (E) [f1] (NTSC) +CRC=F45A6784 F587C72F +RefMD5=25BAFC84BA4D87854DC44DF3EF8764EA + +[ED4FE5EAA6631BB142DEF7F317315DFA] +GoodName=Premier Manager 64 (E) [f2] (NTSC100%) +CRC=C98C4580 A8C84DAD +RefMD5=25BAFC84BA4D87854DC44DF3EF8764EA + +[7995D76F4CE236B0F0289F47AE523D32] +GoodName=Pro Mahjong Kiwame 64 (J) [!] +CRC=9BA10C4E 0408ABD3 +Players=1 +Rumble=No + +[D1624977A3C25192671772623FA76438] +GoodName=Pro Mahjong Kiwame 64 (J) [b1] +CRC=9BA10C4E 0408ABD3 +RefMD5=7995D76F4CE236B0F0289F47AE523D32 + +[6FEC88E88ED25AE7E823A69444D6098A] +GoodName=Pro Mahjong Kiwame 64 (J) [o1] +CRC=9BA10C4E 0408ABD3 +RefMD5=7995D76F4CE236B0F0289F47AE523D32 + +[F1A2E4DD22ADF4F90DA4BDDCA37D5F18] +GoodName=Pro Mahjong Tsuwamono 64 - Jansou Battle ni Chousen (J) [!] +CRC=1BDCB30F A132D876 +Players=1 +Rumble=No + +[4FA4DC582C23EEE81FEB39B7EEBD15D6] +GoodName=Psychodelic Demo by Ste (POM '98) (PD) [b1] +CRC=C5C4F0D5 4EEF2573 + +[592292DF29823A0FD81ED32666878C15] +GoodName=Psychodelic Demo by Ste (POM '98) (PD) +CRC=C5C4F0D5 4EEF2573 + +[22B86AB3F320A607899A0516C90A24D0] +GoodName=Puyo Puyo 4 - Puyo Puyo Party (J) [!] +CRC=4B4672B9 2DBE5DE7 +Players=4 +Rumble=No + +[FAAA2094B04DCA4C287AF9334D22529D] +GoodName=Puyo Puyo Sun 64 (J) [!] +CRC=94807E6B 60CC62E4 +Players=2 +Rumble=Yes + +[20C7ABF5A4DB8DC1C70725FD213E29A2] +GoodName=Puyo Puyo Sun 64 (J) [b1] +CRC=94807E6B 60CC62E4 +RefMD5=FAAA2094B04DCA4C287AF9334D22529D + +[B478D4AF60D43C38BA81DE9FAEA6E057] +GoodName=Puzzle Bobble 64 (J) [!] +CRC=C0DE0747 A2DF72D3 +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[9B463A87DA73B8C923B05C3BD46EDB09] +GoodName=Puzzle Bobble 64 (J) [f1] (PAL) +CRC=53D93EA2 B88836C6 +RefMD5=B478D4AF60D43C38BA81DE9FAEA6E057 + +[EA335A87C87F302C6A10D0D3D3E09B72] +GoodName=Puzzle Bobble 64 (J) [f2] (PAL) +CRC=412E02B8 51A57E8E +RefMD5=B478D4AF60D43C38BA81DE9FAEA6E057 + +[FBDD421FC2105CF4B9663DF97FD7041D] +GoodName=Puzzle Master 64 by Michael Searl (PD) +CRC=4BBBA2E2 8BF3BBB2 +Players=1 +Rumble=No +SaveType=None +Status=2 + +[592CE7718EFDD1FF2F077C9B2B5275FB] +GoodName=Quake 64 (E) [!] +CRC=16931D74 65DC6D34 +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[30EDCCA84850E3B4129936350A9B6B8B] +GoodName=Quake 64 (E) [o1] +CRC=16931D74 65DC6D34 +RefMD5=592CE7718EFDD1FF2F077C9B2B5275FB + +[FE4AC551B284BD0924F2AAA387249B4B] +GoodName=Quake 64 (E) [t1] +CRC=68CE63CC 2FFE262C +RefMD5=592CE7718EFDD1FF2F077C9B2B5275FB + +[097605021951024C3ECB2D502C0C2A9F] +GoodName=Quake 64 (U) [!] +CRC=9F5BF79C D2FE08A0 +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[87F35BC0C6E2EAD981B49D691095B118] +GoodName=Quake 64 (U) [b1] +CRC=254CF663 DC8131EE +RefMD5=097605021951024C3ECB2D502C0C2A9F + +[295FAA9B7CC7127BC82AEA90ADB211E5] +GoodName=Quake 64 (U) [h1C] +CRC=9F5BF79C D2FE08A0 +RefMD5=097605021951024C3ECB2D502C0C2A9F + +[2138CE5AEC363BAC2F18CE65A78ECA25] +GoodName=Quake 64 (U) [o1] +CRC=9F5BF79C D2FE08A0 +RefMD5=097605021951024C3ECB2D502C0C2A9F + +[D599490909FAACB26D134D152CB5F1ED] +GoodName=Quake 64 (U) [o1][t1] +CRC=254CF663 DC8131EE +RefMD5=097605021951024C3ECB2D502C0C2A9F + +[F2FA48329FF6DDBB7BD4EEA838FD800B] +GoodName=Quake 64 (U) [o2] +CRC=9F5BF79C D2FE08A0 +RefMD5=097605021951024C3ECB2D502C0C2A9F + +[7B593077EFC15B44C8D8FF639D6FB434] +GoodName=Quake 64 (U) [o2][t1] +CRC=254CF663 DC8131EE +RefMD5=097605021951024C3ECB2D502C0C2A9F + +[953BB3AD87B3C1B7AC85F12B135FAA85] +GoodName=Quake 64 (U) [t1] +CRC=254CF663 DC8131EE +RefMD5=097605021951024C3ECB2D502C0C2A9F + +[C31A8BB6705BD2112A5ABF4F825FD3C0] +GoodName=Quake 64 Intro (PD) +CRC=F4D89C08 3F34930D + +[673D4BA4F41A0FE23650F06AF53EEC50] +GoodName=Quake II (E) [!] +CRC=7433D9D7 2C4322D0 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[55A789C553827114306E29D71E26E5DC] +GoodName=Quake II (E) [h1C] +CRC=7433D9D7 2C4322D0 +RefMD5=673D4BA4F41A0FE23650F06AF53EEC50 + +[CC93C30C633FF461C29B54CEABEFD701] +GoodName=Quake II (U) [!] +CRC=BDA8F143 B1AF2D62 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[920FAACCE1F8A80022433ACFD5CD2BC3] +GoodName=Quake II (U) [f1] (PAL) +CRC=4F8B1784 763A4E04 +RefMD5=CC93C30C633FF461C29B54CEABEFD701 + +[EA552E33973468233A0712C251ABDB6B] +GoodName=Quest 64 (U) [!] +CRC=C8BB4DD9 CC5F430B +Players=1 +Rumble=No +SaveType=Controller Pack + +[6F32B4DE3B3FC0C719BF9EA27EFC18BE] +GoodName=Quest 64 (U) [b1] +CRC=C8BB4DD9 CC5F430B +RefMD5=EA552E33973468233A0712C251ABDB6B + +[0E2CAB03B712E7D4E1C6501978E2E637] +GoodName=Quest 64 (U) [b2] +CRC=C8BB4DD9 CC5F430B +RefMD5=EA552E33973468233A0712C251ABDB6B + +[4890576C70E8486D2A90424C57C53752] +GoodName=Quest 64 (U) [b3] +CRC=C8BB4DD9 CC5F430B +RefMD5=EA552E33973468233A0712C251ABDB6B + +[E9EFCC508A7054BB94E5B3243018F1AC] +GoodName=Quest 64 (U) [b4] +CRC=C8BB4DD9 CC5F430B +RefMD5=EA552E33973468233A0712C251ABDB6B + +[131CCC5C9E9BD830147562DFD06444BF] +GoodName=Quest 64 (U) [b5] +CRC=C8BB4DD9 CC5F430B +RefMD5=EA552E33973468233A0712C251ABDB6B + +[C01A079E0005DCF5AD9AB0D58CD9515E] +GoodName=Quest 64 (U) [t1] +CRC=5F48A227 B97D9B7F +RefMD5=EA552E33973468233A0712C251ABDB6B + +[5DF35D0C05E58FCE938BAEC6CB2A230E] +GoodName=R.I.P. Jay Demo by Ste (PD) [b1] +CRC=32A92961 DB34982C + +[03418F1567DC45CBB4B4E9DA772CAA7F] +GoodName=R.I.P. Jay Demo by Ste (PD) +CRC=32A92961 DB34982C + +[FFE3839FD3974A0858A62CF363D0F8DB] +GoodName=RADWAR 2K Party Inv. Intro by Ayatolloh (PD) +CRC=C9011D05 EF078B8C + +[34AF9F96DE01A7DF6B296598908BB398] +GoodName=RPA Site Intro by Lem (PD) +CRC=79E318E1 86861726 + +[4561840840760FFA7B59F03A5F416A5C] +GoodName=RR64 - Ridge Racer 64 (E) [!] +CRC=FEE97010 4E94A9A0 +SaveType=Eeprom 16KB +Players=4 +Rumble=Yes + +[990F97D56456FC23E52BD263E709E21E] +GoodName=RR64 - Ridge Racer 64 (U) [!] +CRC=2500267E 2A7EC3CE +SaveType=Eeprom 16KB +Players=4 +Rumble=Yes + +[8CF63267BA38AB73763354C79C4ADB74] +GoodName=RR64 - Ridge Racer 64 (U) [f1] (PAL) +CRC=4E17004A 259E946C +RefMD5=990F97D56456FC23E52BD263E709E21E + +[07D6006F744727DAAC7F53692AD950C4] +GoodName=RR64 - Ridge Racer 64 (U) [t1] +CRC=5A98A468 AB27C89D +RefMD5=990F97D56456FC23E52BD263E709E21E + +[A1082A6676455C040843FD75E92DE1A3] +GoodName=RTL World League Soccer 2000 (G) [!] +CRC=658F8F37 1813D28D +Players=4 +Rumble=No + +[09BEE9D7EB1159D11E49BDFB03A2C4CC] +GoodName=RTL World League Soccer 2000 (G) [f1] (NTSC) +CRC=D250103E 136A0F0C +RefMD5=A1082A6676455C040843FD75E92DE1A3 + +[4392F33C4282B68C9DEF5111CCF733CA] +GoodName=RTL World League Soccer 2000 (G) [f1][o1] +CRC=D250103E 136A0F0C +RefMD5=A1082A6676455C040843FD75E92DE1A3 + +[AA57D69867F53456F351A289EBA08C3D] +GoodName=Racing Simulation 2 (G) [!] +CRC=2877AC2D C3DC139A +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[6160D5DE99BE421ACB620D2D203C2FEC] +GoodName=Racing Simulation 2 (G) [h1C] +CRC=2877AC2D C3DC139A +RefMD5=AA57D69867F53456F351A289EBA08C3D + +[167A3502F06CF0EEF56758533F3D0E52] +GoodName=Rakuga Kids (E) [!] +CRC=67D21868 C5424061 +Players=2 +Rumble=No + +[28FE768CED3C87659B343A7811CFAC0A] +GoodName=Rakuga Kids (E) [b1] +CRC=67D21868 C5424061 +RefMD5=167A3502F06CF0EEF56758533F3D0E52 + +[7F0900DD9726A7E56A398E910D014B61] +GoodName=Rakuga Kids (E) [f1] (NTSC) +CRC=49020C8E A000B949 +RefMD5=167A3502F06CF0EEF56758533F3D0E52 + +[98A802D44FE4169FD73D7B481C08613E] +GoodName=Rakuga Kids (E) [h1C] +CRC=67D21868 C5424061 +RefMD5=167A3502F06CF0EEF56758533F3D0E52 + +[813AD5C00BAD7C4D41F8558CECEDAE51] +GoodName=Rakuga Kids (J) [!] +CRC=9F1ECAF0 EEC48A0E +Players=2 +Rumble=No + +[378C6CE13DF3363F77D76B64C8DAB287] +GoodName=Rakuga Kids (J) [b1] +CRC=9F1ECAF0 EEC48A0E +RefMD5=813AD5C00BAD7C4D41F8558CECEDAE51 + +[08D79A5C0F393D81296F50A6D556D999] +GoodName=Rakuga Kids (J) [h1C] +CRC=9F1ECAF0 EEC48A0E +RefMD5=813AD5C00BAD7C4D41F8558CECEDAE51 + +[0630226F63561A05916EDCFBC8D96C04] +GoodName=Rally '99 (J) [!] +CRC=35D9BA0C DF485586 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[035B02E493A388E950FB42F4B3D891F8] +GoodName=Rally '99 (J) [f1] (PAL) +CRC=4C2B343C 7249BAFF +RefMD5=0630226F63561A05916EDCFBC8D96C04 + +[0458BC47CD771D8BC66B0CEAE6895724] +GoodName=Rally Challenge 2000 (U) [!] +CRC=73A88E3D 3AC5C571 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[08E02F52E0547686A9BFAC7CBB03C129] +GoodName=Rampage - World Tour (E) [!] +CRC=84D44448 67CA19B0 +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[410146EA14CF34D134BC97C78522D322] +GoodName=Rampage - World Tour (E) [h1C] +CRC=84D44448 67CA19B0 +RefMD5=08E02F52E0547686A9BFAC7CBB03C129 + +[4645672A0CF00ADA9B5E37CFDE8B024E] +GoodName=Rampage - World Tour (U) [!] +CRC=C29FF9E4 264BFE7D +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[1659F9F8C8A5C24F775B245BDA574462] +GoodName=Rampage - World Tour (U) [b1] +CRC=C29FF9E4 264BFE7D +RefMD5=4645672A0CF00ADA9B5E37CFDE8B024E + +[71EC90E34421CEEAA8B71ACAF76EFD33] +GoodName=Rampage - World Tour (U) [b2] +CRC=C29FF9E4 264BFE7D +RefMD5=4645672A0CF00ADA9B5E37CFDE8B024E + +[669584EEB9F85C7A8A96B716A2B43739] +GoodName=Rampage - World Tour (U) [b3] +CRC=C29FF9E4 264BFE7D +RefMD5=4645672A0CF00ADA9B5E37CFDE8B024E + +[70C3E7412FF8196E16CCA076B3B622F7] +GoodName=Rampage - World Tour (U) [b4] +CRC=C29FF9E4 264BFE7D +RefMD5=4645672A0CF00ADA9B5E37CFDE8B024E + +[BE823D7958151B97F812FBF01E7621D2] +GoodName=Rampage - World Tour (U) [h1C] +CRC=C29FF9E4 264BFE7D +RefMD5=4645672A0CF00ADA9B5E37CFDE8B024E + +[E3060D3FADA2A502764E765F8140FC42] +GoodName=Rampage - World Tour (U) [t1] +CRC=588F980C 63FF7803 +RefMD5=4645672A0CF00ADA9B5E37CFDE8B024E + +[4D280855EA4FFE98054BDF633EA5A7F7] +GoodName=Rampage - World Tour (U) [t2] +CRC=588F980C 63FF7803 +RefMD5=4645672A0CF00ADA9B5E37CFDE8B024E + +[1492806F12D33C3EA0EDB6848D43B1CC] +GoodName=Rampage 2 - Universal Tour (E) [!] +CRC=5DFC4249 99529C07 +Players=3 +Rumble=Yes +SaveType=Controller Pack + +[8113D0EA2008402D4631F241F625D16B] +GoodName=Rampage 2 - Universal Tour (U) [!] +CRC=673D099B A4C808DE +Players=3 +Rumble=Yes +SaveType=Controller Pack + +[EBAFB5C3BCC84543A8E7FEF1993E573F] +GoodName=Rampage 2 - Universal Tour (U) [t1] +CRC=BF4317E2 2DF987E2 +RefMD5=8113D0EA2008402D4631F241F625D16B + +[EA383E48637B44FFF9294D23B076548B] +GoodName=Rampage 2 - Universal Tour (U) [t2] +CRC=FD2FC875 3BD10D89 +RefMD5=8113D0EA2008402D4631F241F625D16B + +[C7B9024594F932BA5E3A1FB70FE9BD6B] +GoodName=Rape Kombat Trilogy Beta1 (Mortal Kombat Hack) +CRC=9A2949C1 04E76074 + +[BC66239C12AE8696926E50C2B6ED9C49] +GoodName=Rat Attack (E) (M6) [!] +CRC=20FD0BF1 F5CF1D87 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[E0BB65C30C1185FD9997020A1994B07E] +GoodName=Rat Attack (E) (M6) [f1] (NTSC) +CRC=85670AB4 3834BE8A +RefMD5=BC66239C12AE8696926E50C2B6ED9C49 + +[6F868B1652183376665F67F8183EEB5C] +GoodName=Rat Attack (E) (M6) [h1C] +CRC=20FD0BF1 F5CF1D87 +RefMD5=BC66239C12AE8696926E50C2B6ED9C49 + +[F661889FDF65DDCD212E9FB53B2C8F50] +GoodName=Rat Attack (U) (M6) [!] +CRC=0304C48E AC4001B8 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[5DBBFD5ACE8222FA8FE51BE113453C13] +GoodName=Rayman 2 - The Great Escape (E) (M5) [!] +CRC=60D5E10B 8BEDED46 +Players=1 +Rumble=Yes +SaveType=Controller Pack + +[EF2001F581A80D760C51D130725A9930] +GoodName=Rayman 2 - The Great Escape (E) (M5) [f1] (NTSC) +CRC=B8C303FA 544BB5FA +RefMD5=5DBBFD5ACE8222FA8FE51BE113453C13 + +[53B325CCDF2069AB20CAF1C9B401CD20] +GoodName=Rayman 2 - The Great Escape (E) (M5) [f2] (NTSC) +CRC=7055FD0A E0A45808 +RefMD5=5DBBFD5ACE8222FA8FE51BE113453C13 + +[03AA4D09FDE77EED9B95BE68E603D233] +GoodName=Rayman 2 - The Great Escape (U) (M5) [!] +CRC=F3C5BF9B 160F33E2 +Players=1 +Rumble=Yes +SaveType=Controller Pack + +[2B1D9F38389522A372D950E1BC6FA13F] +GoodName=Rayman 2 - The Great Escape (U) (M5) [t1] +CRC=8BB6E3EB 2402CC87 +RefMD5=03AA4D09FDE77EED9B95BE68E603D233 + +[406B08987AB92D73D72B597EC6B11BD9] +GoodName=Razor Freestyle Scooter (U) [!] +CRC=3918834A 15B50C29 +Players=2 +Rumble=No + +[FAA64ABB0D222FCC0C6E2515D3805D9F] +GoodName=Re-Volt (E) (M4) [!] +CRC=C3E7E29E 5D7251CC +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[3FC4D3187435443455F8355B2D3F8934] +GoodName=Re-Volt (U) [!] +CRC=0F1FA987 BFC1AFA6 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[377DAF6EDD0C996422D2A9C8C5DEC033] +GoodName=Re-Volt (U) [f1] (Country Check) +CRC=529AA985 A85509A3 +RefMD5=3FC4D3187435443455F8355B2D3F8934 + +[77DC38CCE0FFAB004FD54F54EE25A593] +GoodName=Re-Volt (U) [f2] (PAL) +CRC=53575A75 54573214 +RefMD5=3FC4D3187435443455F8355B2D3F8934 + +[197E24C1AB6503998798D7F56EAE7ADD] +GoodName=Re-Volt (U) [t1] +CRC=B754A584 D3530516 +RefMD5=3FC4D3187435443455F8355B2D3F8934 + +[ADC95AE01855FA305B13F8B22427E597] +GoodName=Ready 2 Rumble Boxing (E) (M3) [!] +CRC=8BD4A334 1E138B05 +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[70F73D01FEAF768758F31B23DE2C2620] +GoodName=Ready 2 Rumble Boxing (E) (M3) [t1] (P1 Untouchable) +CRC=8638A334 8EBF1508 +RefMD5=ADC95AE01855FA305B13F8B22427E597 + +[A42F6F14F7EA10ABEB3B55FFD42EB572] +GoodName=Ready 2 Rumble Boxing (U) [!] +CRC=EAB7B429 BAC92C57 +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[25620A9C9F372023A8BA862330E6373A] +GoodName=Ready 2 Rumble Boxing (U) [f1] (PAL) +CRC=5D6AA6EA 657352B1 +RefMD5=A42F6F14F7EA10ABEB3B55FFD42EB572 + +[CCECEAA389A7847DE3433888C66A76E5] +GoodName=Ready 2 Rumble Boxing (U) [t1] (P1 Untouchable) +CRC=E655B42D F22370DD +RefMD5=A42F6F14F7EA10ABEB3B55FFD42EB572 + +[DF4446A2B55C4D8D67E9C0C19E0FD9FB] +GoodName=Ready 2 Rumble Boxing - Round 2 (U) [!] +CRC=E9219533 13FBAFBD +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[CB97350D5CAB48EAB8B954D91C0E5DAC] +GoodName=Ready 2 Rumble Boxing - Round 2 (U) [t1] +CRC=6CED60AC C74292DC +RefMD5=DF4446A2B55C4D8D67E9C0C19E0FD9FB + +[B04F298721223A22E1150CEBC712EE6A] +GoodName=Resident Evil 2 (E) (M2) [!] +CRC=9B500E8E E90550B3 +Players=1 +Rumble=Yes +SaveType=SRAM + +[1ADD2C0217662B307CDFD876B35FBF7A] +GoodName=Resident Evil 2 (U) (V1.1) [!] +CRC=AA18B1A5 07DB6AEB +Players=1 +Rumble=Yes +SaveType=SRAM + +[AD922DAE446A301E1AAFE1DFBAD75A2E] +GoodName=Road Rash 64 (E) [!] +CRC=02D8366A 6CABEF9C +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[5EB2B1892B68767EB1D310FF7507D34E] +GoodName=Road Rash 64 (E) [h1C] +CRC=02D8366A 6CABEF9C +RefMD5=AD922DAE446A301E1AAFE1DFBAD75A2E + +[28C2373F6D831EEC81F6146A809E701B] +GoodName=Road Rash 64 (U) [!] +CRC=F050746C 247B820B +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[7966F17F36C43D3807C0949AAD45168A] +GoodName=Road Rash 64 (U) [f1] (PAL) +CRC=422D29E1 C1FB33F3 +RefMD5=28C2373F6D831EEC81F6146A809E701B + +[C6867566C9E173BEAB459C5945B69C23] +GoodName=Road Rash 64 (U) [t1] +CRC=48176863 E1829A22 +RefMD5=28C2373F6D831EEC81F6146A809E701B + +[41F67B5C8BB8DAEFFD989123846FC063] +GoodName=Roadsters Trophy (E) (M6) [!] +CRC=74E87A70 6293AED4 +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[D3644B398C090528E0ED9EB3C140366E] +GoodName=Roadsters Trophy (U) (M3) [!] +CRC=0B6B4DDB 9671E682 +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[AE705F25C57ACABBD0E8BAE5EC6E237F] +GoodName=Roadsters Trophy (U) (M3) [f1] (PAL) +CRC=787AECF1 CC8147BA +RefMD5=D3644B398C090528E0ED9EB3C140366E + +[5C9C715430ACBAEF3A5FBDB3E6661ACF] +GoodName=Roadsters Trophy (U) (M3) [t1] +CRC=74BCA5D3 4A945F7E +RefMD5=D3644B398C090528E0ED9EB3C140366E + +[444F70A655AC89CA900F6FAFAF926B16] +GoodName=Robot Ponkotsu 64 - 7tsu no Umi no Caramel (J) [!] +CRC=272B690F AD0A7A77 +Players=1 +Rumble=No + +[34779AF3681F58E4F642F03EAEF198F9] +GoodName=Robot Ponkotsu 64 - 7tsu no Umi no Caramel (J) [f1] (PAL) +CRC=7F564549 ED60C5E6 +RefMD5=444F70A655AC89CA900F6FAFAF926B16 + +[27C6F780F9032A531E9A322969CD9159] +GoodName=Robotech - Crystal Dreams (Beta) [a1] +CRC=75A0B893 4CA321B5 + +[B39592C6C9A3121258BDB62485956880] +GoodName=Robotech - Crystal Dreams (Beta) +CRC=75A0B893 4CA321B5 + +[2ABCD1AD41B3356FBC1018ECB121283E] +GoodName=Robotron 64 (E) [!] +CRC=9FF69D4F 195F0059 +Players=1 +SaveType=Controller Pack +Rumble=No + +[360044D5675A328E62191250F43B6671] +GoodName=Robotron 64 (E) [h1C] +CRC=9FF69D4F 195F0059 +RefMD5=2ABCD1AD41B3356FBC1018ECB121283E + +[5698757883A6F46FE5B4C9B6E780B480] +GoodName=Robotron 64 (U) [!] +CRC=AC8E4B32 E7B47326 +Players=1 +Rumble=No +SaveType=Controller Pack + +[C4A9BBF989DDFAF5F389E4ADC6195DBC] +GoodName=Robotron 64 (U) [b1] +CRC=AC8E4B32 E7B47326 +RefMD5=5698757883A6F46FE5B4C9B6E780B480 + +[8555DCF12FD35206451FB415F3FD2EEF] +GoodName=Robotron 64 (U) [b2] +CRC=8F4C4B32 6D881FCA +RefMD5=5698757883A6F46FE5B4C9B6E780B480 + +[AB50026DAEA629F554408E5BA3EFA182] +GoodName=Robotron 64 (U) [b3] +CRC=8F4C4B32 6D881FCA +RefMD5=5698757883A6F46FE5B4C9B6E780B480 + +[1AA79B5DEFE1F5852D5ADD799383CCCD] +GoodName=Robotron 64 (U) [b4] +CRC=575CCC2E A8B5ACE0 +RefMD5=5698757883A6F46FE5B4C9B6E780B480 + +[377B9C40EBE4F4CF845E577A8DC9ACCB] +GoodName=Robotron 64 (U) [f1] (PAL) +CRC=8F4C4B32 6D881FCA +RefMD5=5698757883A6F46FE5B4C9B6E780B480 + +[27E4C31540E18E3E8CEA97BFF744CC11] +GoodName=Robotron 64 (U) [o1] +CRC=AC8E4B32 E7B47326 +RefMD5=5698757883A6F46FE5B4C9B6E780B480 + +[E151CCE259636C5AE15CA1C8B380EE76] +GoodName=Robotron 64 (U) [t1] +CRC=575CCC2E A8B5ACE0 +RefMD5=5698757883A6F46FE5B4C9B6E780B480 + +[427C5457D4A29A222811F0CAA9CCA7B9] +GoodName=Rocket - Robot on Wheels (E) (M3) [!] +CRC=9FD375F8 45F32DC8 +SaveType=Eeprom 4KB +Players=1 +Rumble=Yes + +[C2907EB2F9A350793317ECE878A3B8E3] +GoodName=Rocket - Robot on Wheels (U) [!] +CRC=0C5EE085 A167DD3E +SaveType=Eeprom 4KB +Players=1 +Rumble=Yes + +[E8CBAADEDB6D19ACC142BE3105E94C4F] +GoodName=Rocket - Robot on Wheels (U) [b1] +CRC=0C5EE085 A167DD3E +RefMD5=C2907EB2F9A350793317ECE878A3B8E3 + +[991E5F527EC9330320E65233C293D4C5] +GoodName=Rocket - Robot on Wheels (U) [f1] (PAL) +CRC=B9233DC7 9CCF2D4C +RefMD5=C2907EB2F9A350793317ECE878A3B8E3 + +[B042C238C4093DB533EC4E849C40DE4F] +GoodName=Rocket - Robot on Wheels (U) [t1] +CRC=B31A9FBB 26D03050 +RefMD5=C2907EB2F9A350793317ECE878A3B8E3 + +[0C74B44680276FFE808CFA6045329819] +GoodName=Rockman Dash (J) [!] +CRC=D666593B D7A25C07 +Players=1 +SaveType=Flash RAM +Rumble=Yes + +[73971508A3B4CA92F7F4CF59C9170372] +GoodName=Rotating Demo USA by Rene (PD) [a1] +CRC=6FA4B821 29561690 + +[0BF79F532C938384431DA9406B846AFA] +GoodName=Rotating Demo USA by Rene (PD) +CRC=6FA4B821 29561690 + +[DEC4598A39728C28CD0CEBA45A173CE1] +GoodName=Rugrats - Die grosse Schatzsuche (G) [!] +CRC=451ACA0F 7863BC8A +Players=4 +Rumble=Yes +SaveType=None + +[8C432235A57D34BC4A9B8B290E21E01E] +GoodName=Rugrats - Scavenger Hunt (U) [!] +CRC=0C02B3C5 9E2511B8 +Players=4 +Rumble=Yes +SaveType=None + +[C3ED4CD05978DECFD761FA2503DCB39E] +GoodName=Rugrats - Scavenger Hunt (U) [f1] (PAL) +CRC=F04A729C 19971680 +RefMD5=8C432235A57D34BC4A9B8B290E21E01E + +[55185016031CDC73C0FD471527C35706] +GoodName=Rugrats - Treasure Hunt (E) [!] +CRC=4D3ADFDA 7598FCAE +Players=4 +Rumble=Yes +SaveType=None + +[950161325C7E11A057CC85C95685DB05] +GoodName=Rugrats - Treasure Hunt (E) [h1C] +CRC=4D3ADFDA 7598FCAE +RefMD5=55185016031CDC73C0FD471527C35706 + +[229089089661F517C863242D6BB77746] +GoodName=Rugrats in Paris - The Movie (E) [!] +CRC=0AC61D39 ABFA03A6 +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[207EFE58C7C221DBDFFF285AB80126C1] +GoodName=Rugrats in Paris - The Movie (U) [!] +CRC=1FC21532 0B6466D4 +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[F3515A45EC01D2C9FEAFBAB2B85D72C4] +GoodName=Rugrats in Paris - The Movie (U) [T+Spa0.10] +CRC=40D5D2DE 78489F0F +RefMD5=207EFE58C7C221DBDFFF285AB80126C1 + +[681DF5A32E857E77194106B35304D6B5] +GoodName=Rush 2 - Extreme Racing USA (E) (M6) [!] +CRC=B7CF2136 FA0AA715 +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[8A59477C29B4353FEAB85303C58B98F0] +GoodName=Rush 2 - Extreme Racing USA (E) (M6) [h1I] +CRC=09A0A6E5 8396630D +RefMD5=681DF5A32E857E77194106B35304D6B5 + +[E9F65EA602A442966BE4DDCE799A8E20] +GoodName=Rush 2 - Extreme Racing USA (E) (M6) [h2I] +CRC=09A0A6E5 8396630D +RefMD5=681DF5A32E857E77194106B35304D6B5 + +[6A925AB624EE3B343231D799733BA898] +GoodName=Rush 2 - Extreme Racing USA (U) [!] +CRC=EDD6E031 68136013 +Players=2 +SaveType=Controller Pack +Rumble=Yes + +[7ED3F10BC32CF76F172D8C31D15A2799] +GoodName=S.C.A.R.S. (E) (M3) [!] +CRC=918E2D60 F865683E +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[0DC80ADCD95AF4FC8FE2C7E648CA64F0] +GoodName=S.C.A.R.S. (E) (M3) [h1C] +CRC=918E2D60 F865683E +RefMD5=7ED3F10BC32CF76F172D8C31D15A2799 + +[D0AA9D20A4B85FE514D2A3150D0133EA] +GoodName=S.C.A.R.S. (U) [!] +CRC=769147F3 2033C10E +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[D0A050E86E27126FD7324B5674A30764] +GoodName=S.C.A.R.S. (U) [f1] (PAL) +CRC=8954584D EFE71E95 +RefMD5=D0AA9D20A4B85FE514D2A3150D0133EA + +[40866BBE1629E9B170DE552ACA83D967] +GoodName=S.C.A.R.S. (U) [t1] +CRC=8954A655 3B38F292 +RefMD5=D0AA9D20A4B85FE514D2A3150D0133EA + +[637A7EA2A39F20C5B20834187230D89D] +GoodName=SD Hiryuu no Ken Densetsu (J) [!] +CRC=EBF5F6B7 C956D739 +Players=1 + +[F29A0A02C41815EE3F5437E409EC327B] +GoodName=SD Hiryuu no Ken Densetsu (J) [f1] (PAL) +CRC=EBF5F6B7 C956D739 +RefMD5=637A7EA2A39F20C5B20834187230D89D + +[52FD60268A69DC7B532AD58EDD2133C0] +GoodName=SLiDeS (PD) +CRC=5BBE6E34 088B6D0E +Status=2 +Players=1 +Rumble=No +SaveType=None + +[F323E3807A6AEDEDEAC9E0739490D13C] +GoodName=SNES 9X Alpha by Loom-Crazy Nation (PD) [f1] (V64BIOS1.91) +CRC=CA69ECE5 13A88244 + +[29E875C7FFA44CA629F2576CB47A1020] +GoodName=SNES 9X Alpha by Loom-Crazy Nation (PD) +CRC=CA69ECE5 13A88244 + +[919A27C2ABBEA83BA996CEE553227929] +GoodName=SPLiT's Nacho64 by SPLiT (PD) +CRC=1FBD27A9 6CC3EB42 +Players=0 +Status=3 +Rumble=No +SaveType=None + +[A63921B3190C45940721BA3AC64D1114] +GoodName=SPLiT's Nacho64 by SPLiT (PD) [f1] (PAL) +CRC=1899FF33 885180E6 +RefMD5=919A27C2ABBEA83BA996CEE553227929 + +[123417811CDC49118EB01ECF76BAF760] +GoodName=SRAM Manager V1.0 Beta (32Mbit) (PD) [a1] +CRC=029CAE05 2B8F9DF1 + +[891E4A11B6F80E31A2F247FEA3730744] +GoodName=SRAM Manager V1.0 Beta (32Mbit) (PD) +CRC=029CAE05 2B8F9DF1 + +[98A5DBA896685D86A07CEEA283FD36D3] +GoodName=SRAM Manager V1.0 Beta (PD) +CRC=029CAE05 2B8F9DF1 + +[57BEB4B0AFDD4AFADE9DB6A13B72D17D] +GoodName=SRAM Manager V1.0 PAL Beta (PD) +CRC=4DEC9986 A8904450 + +[ED46A867A648A101D239DA0650B49783] +GoodName=SRAM Manager V2.0 (PD) [a1] +CRC=4E5507F2 E7D3B413 + +[657836F55DCB952C56BC5C645D82D6C2] +GoodName=SRAM Manager V2.0 (PD) [h1C] +CRC=4E5507F2 E7D3B413 + +[2E8367ED95724816646131BAD480BDD2] +GoodName=SRAM Manager V2.0 (PD) [h2C] +CRC=4E5507F2 E7D3B413 + +[597ADB9702440E72D5954D50671D9C57] +GoodName=SRAM Manager V2.0 (PD) +CRC=4E5507F2 E7D3B413 + +[00F846A9AA9E0083CE8C0E566843A7C7] +GoodName=SRAM Upload Tool (PD) +CRC=98A2BB11 EE4D4A86 + +[2FA1AC0A989D5F081D6A8733F2330923] +GoodName=SRAM Upload Tool + Star Fox 64 SRAM (PD) +CRC=3C524346 E4ABE776 + +[103592E65C65464C141A2184DBFD0947] +GoodName=SRAM Upload Tool V1 by LaC (PD) +CRC=3B8E7E01 6AE876A8 + +[71C2E66CCE1FEC929B5485AC41A61D95] +GoodName=SRAM Upload Tool V1.1 by Lac (PD) [b1] +CRC=98A2BB11 EE4D4A86 + +[2B2186A38B0B3541C3227144EA3C71A3] +GoodName=SRAM Upload Tool V1.1 by Lac (PD) +CRC=3C524346 E4ABE776 + +[F26102590AA6982EA78701E6A418BED0] +GoodName=SRAM Uploader-Editor by BlackBag (PD) +CRC=EC9BECFF CAB83632 + +[A5C1F8AF5D9AA7D2C771DA1C84841017] +GoodName=SRAM to DS1 Tool by WT_Riker (PD) +CRC=52BA5D2A 9BE3AB78 + +[C4E47228706BC724D7FBD811231D20C9] +GoodName=Saikyou Habu Shougi (J) [!] +CRC=5E3E60E8 4AB5D495 +Players=1 +Rumble=No + +[D92EEBA87794311C8F4443C29CC177C5] +GoodName=Saikyou Habu Shougi (J) [h1C] +CRC=5E3E60E8 4AB5D495 +RefMD5=C4E47228706BC724D7FBD811231D20C9 + +[0F205BA6B663C3C31579894873CAFA66] +GoodName=Saikyou Habu Shougi (J) [h2C] +CRC=5E3E60E8 4AB5D495 +RefMD5=C4E47228706BC724D7FBD811231D20C9 + +[95C345EE264F3A91F1381E76CAD82F11] +GoodName=Saikyou Habu Shougi (J) [h3C] +CRC=5E3E60E8 4AB5D495 +RefMD5=C4E47228706BC724D7FBD811231D20C9 + +[34F623903C3E2DBF8FB1E47F688D1859] +GoodName=Saikyou Habu Shougi (J) [h4C] +CRC=5E3E60E8 4AB5D495 +RefMD5=C4E47228706BC724D7FBD811231D20C9 + +[630A177A8D5B603F8C86D8A089E3471B] +GoodName=Sample Demo by Florian (PD) [b1] +CRC=C541EAB4 7397CB5F + +[2F8109E5C9BCC45B9987F31EA00ECA66] +GoodName=Sample Demo by Florian (PD) +CRC=C541EAB4 7397CB5F + +[81B1122EE15F7B50A341AE62E9C5716B] +GoodName=San Francisco Rush - Extreme Racing (E) (M3) [!] +CRC=61D116B0 FA24D60C +Players=2 +SaveType=Controller Pack +Rumble=Yes + +[4FDF9E702D4A6A75124623D9434BF99F] +GoodName=San Francisco Rush - Extreme Racing (E) (M3) [h1C] +CRC=61D116B0 FA24D60C +RefMD5=81B1122EE15F7B50A341AE62E9C5716B + +[F015FC28E1D62A36B4EBF4C79CA8F285] +GoodName=San Francisco Rush - Extreme Racing (U) (M3) [!] +CRC=2A6B1820 6ABCF466 +Players=2 +SaveType=Controller Pack +Rumble=Yes + +[2A8086945375826FA6495F1EF2F1DFB6] +GoodName=San Francisco Rush - Extreme Racing (U) (M3) [b1] +CRC=2A6B1820 6ABCF466 +RefMD5=F015FC28E1D62A36B4EBF4C79CA8F285 + +[C870967473A8BD2942D00EAA3D7CCC9E] +GoodName=San Francisco Rush - Extreme Racing (U) (M3) [b2] +CRC=2A6B1820 6ABCF466 +RefMD5=F015FC28E1D62A36B4EBF4C79CA8F285 + +[CFD1B123BBABF1658CA6D52F34434A1E] +GoodName=San Francisco Rush - Extreme Racing (U) (M3) [b3] +CRC=2A6B1820 6ABCF466 +RefMD5=F015FC28E1D62A36B4EBF4C79CA8F285 + +[AD921B1336EDA406D124940BED174465] +GoodName=San Francisco Rush - Extreme Racing (U) (M3) [o1] +CRC=2A6B1820 6ABCF466 +RefMD5=F015FC28E1D62A36B4EBF4C79CA8F285 + +[390FC46621581FA62F7F4CC3537F255D] +GoodName=San Francisco Rush - Extreme Racing (U) (M3) [o2] +CRC=2A6B1820 6ABCF466 +RefMD5=F015FC28E1D62A36B4EBF4C79CA8F285 + +[90CA5D19B7F085474EBD2186D70C59AF] +GoodName=San Francisco Rush - Extreme Racing (U) (M3) [o3] +CRC=2A6B1820 6ABCF466 +RefMD5=F015FC28E1D62A36B4EBF4C79CA8F285 + +[02B16AC23998F78F09AF6513F4ACB664] +GoodName=San Francisco Rush 2049 (E) (M6) [!] +CRC=51D29418 D5B46AE3 +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[AF5BE0ADFF51A8E9C6D771282C295810] +GoodName=San Francisco Rush 2049 (U) [!] +CRC=B9A9ECA2 17AAE48E +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[1977D63B511A900628DB2A3A104160AC] +GoodName=San Francisco Rush 2049 (U) [t1] +CRC=01D66F37 365F18B3 +RefMD5=AF5BE0ADFF51A8E9C6D771282C295810 + +[3B6DD7B60437234895500BEFF28DF6D6] +GoodName=Scooby-Doo! - Classic Creep Capers (E) [!] +CRC=E3BD221D 3C0834D3 +Players=1 +SaveType=Controller Pack +Rumble=No + +[16CC6DB10A56331B56F374B4FB254D5E] +GoodName=Scooby-Doo! - Classic Creep Capers (U) [!] +CRC=0C814EC4 58FE5CA8 +Players=1 +SaveType=Controller Pack +Rumble=No + +[A485A6E9E30B7D55D23D8DD043770C64] +GoodName=Shadow Man (E) (M3) [!] +CRC=60C437E5 A2251EE3 +SaveType=Controller Pack +Rumble=Yes +Players=1 + +[235511BBDB21AF5A767BDB7502A80F06] +GoodName=Shadow Man (F) [!] +CRC=EA06F8C3 07C2DEED +SaveType=Controller Pack +Rumble=Yes +Players=1 + +[AF40EF12CE923FF1C26E76CC9D9B9ED9] +GoodName=Shadow Man (G) [!] +CRC=84D5FD75 BBFD3CDF +SaveType=Controller Pack +Rumble=Yes +Players=1 + +[CFBDC1C5E419FF162DF02A0065D9BC1D] +GoodName=Shadow Man (G) [b1] +CRC=84D5FD75 BBFD3CDF +RefMD5=AF40EF12CE923FF1C26E76CC9D9B9ED9 + +[630776E478E00CDA1D09BAB55656ACA7] +GoodName=Shadow Man (G) [b2] +CRC=84D5FD75 BBFD3CDF +RefMD5=AF40EF12CE923FF1C26E76CC9D9B9ED9 + +[0802F5BB4004D8948A6C0B51C8857B74] +GoodName=Shadow Man (G) [f1] (NTSC) +CRC=720278EC 594B7975 +RefMD5=AF40EF12CE923FF1C26E76CC9D9B9ED9 + +[B457298B87B85BBF950F24867DAA9475] +GoodName=Shadow Man (U) [!] +CRC=3A4760B5 2D74D410 +SaveType=Controller Pack +Rumble=Yes +Players=1 + +[474647AEDFA95AEF73229A2784897EDD] +GoodName=Shadow Man (U) [b1] +CRC=3A4760B5 2D74D410 +RefMD5=B457298B87B85BBF950F24867DAA9475 + +[5AE3BB3604539ABDEBA639E5892BD60E] +GoodName=Shadow Man (U) [b2] +CRC=3A4760B5 2D74D410 +RefMD5=B457298B87B85BBF950F24867DAA9475 + +[22A689C97FAEDF39A8F115DB8F71830C] +GoodName=Shadow Man (U) [b3] +CRC=82342320 BC65A550 +RefMD5=B457298B87B85BBF950F24867DAA9475 + +[C76828840668B6F3D4670CF4AD89C4AA] +GoodName=Shadow Man (U) [t1] +CRC=82342320 BC65A550 +RefMD5=B457298B87B85BBF950F24867DAA9475 + +[A06E757CF1930B29FA4C0B5C9F31335F] +GoodName=Shadowgate 64 - Trials Of The Four Towers (E) (M2) (Ita-Spa) [!] +CRC=02B46F55 61778D0B +Players=1 +Rumble=No +SaveType=Controller Pack + +[11169A32D449EC3A8903CA8A9D69A6AA] +GoodName=Shadowgate 64 - Trials Of The Four Towers (E) (M3) (Fre-Ger-Dut) [!] +CRC=2BC1FCF2 7B9A0DF4 +Players=1 +Rumble=No +SaveType=Controller Pack + +[E8955C3B743FDDFE403E52E769E9853F] +GoodName=Shadowgate 64 - Trials Of The Four Towers (E) [!] +CRC=D84EEA84 45B2F1B4 +Players=1 +Rumble=No +SaveType=Controller Pack + +[5582CF3BB6E6B11D6D97F6FDD1EE9A3B] +GoodName=Shadowgate 64 - Trials Of The Four Towers (E) [f1] (NTSC) +CRC=80203B94 57B7F424 +RefMD5=E8955C3B743FDDFE403E52E769E9853F + +[C4F4CA4FFA94A870D0A3E18B74FE9FDE] +GoodName=Shadowgate 64 - Trials Of The Four Towers (J) [b1] +CRC=CCEDB696 D3883DB4 +RefMD5=E8955C3B743FDDFE403E52E769E9853F + +[66C31F31A386320F61AAF8F5F7936053] +GoodName=Shadowgate 64 - Trials Of The Four Towers (J) [b2] +CRC=CCEDB696 D3883DB4 +RefMD5=1960A3879FADF2C5EFF5BEB47E0E1441 + +[1960A3879FADF2C5EFF5BEB47E0E1441] +GoodName=Shadowgate 64 - Trials Of The Four Towers (J) +CRC=CCEDB696 D3883DB4 +Players=1 +Rumble=No +SaveType=Controller Pack + +[407A1A18BD7DBE0485329296C3F84EB8] +GoodName=Shadowgate 64 - Trials Of The Four Towers (U) (M2) [!] +CRC=036897CE E0D4FA54 +Players=1 +Rumble=No +SaveType=Controller Pack + +[3B21996F8C6496903C01DCBD77DDD6EE] +GoodName=Shadowgate 64 - Trials Of The Four Towers (U) (M2) [f1] (PAL) +CRC=015BB81E F105AC82 +RefMD5=407A1A18BD7DBE0485329296C3F84EB8 + +[3D8F438057CB98F3C9E1472ABFF61610] +GoodName=Shadowgate 64 - Trials Of The Four Towers (U) (M2) [f2] (PAL) +CRC=123D0F44 CF60A446 +RefMD5=407A1A18BD7DBE0485329296C3F84EB8 + +[F6B0E57512FDDD06345DD41B7C73B228] +GoodName=Shag'a'Delic Demo by Steve and NEP (PD) +CRC=9D9C362D 5BE66B08 + +[13893DB9E919C4E7CF0C0B0064CCB554] +GoodName=Shigesato Itoi's No. 1 Bass Fishing! Definitive Edition (J) [!] +CRC=D137A2CA 62B65053 +Players=1 +Rumble=Yes + +[16EC788C8A4E7EEE268FDF9072A4F0D4] +GoodName=Shigesato Itoi's No. 1 Bass Fishing! Definitive Edition (J) [b1] +CRC=D137A2CA 62B65053 +RefMD5=13893DB9E919C4E7CF0C0B0064CCB554 + +[13D9514A4D208DC6C7B0C833F68114D2] +GoodName=Shin Nihon Pro Wrestling - Toukon Road - Brave Spirits (J) [!] +CRC=EF703CA4 4D4A9AC9 +Players=4 + +[DC1A78608B19DBE2AE3DC0CAD9B79472] +GoodName=Shin Nihon Pro Wrestling - Toukon Road - Brave Spirits (J) [b1] +CRC=EF703CA4 4D4A9AC9 +RefMD5=13D9514A4D208DC6C7B0C833F68114D2 + +[113044B16B75F98792BF9C20C6B6282B] +GoodName=Shin Nihon Pro Wrestling - Toukon Road 2 - The Next Generation (J) [!] +CRC=551C7F43 9149831C +Players=4 + +[37149C4064A1D120B9F4F5482A915262] +GoodName=Shuffle Puck 64 (PD) +CRC=F7DF7D0D ED52018F + +[244BEA64EA209990E9C69A830B507135] +GoodName=Sim City 2000 (J) [!] +CRC=B1D5280C 4BA7BC2A +Players=1 +Rumble=No + +[FD2D06E59BF17A1BD1DA98454F83AB0D] +GoodName=Sim City 2000 (J) [b1] +CRC=B1D5280C 4BA7BC2A +RefMD5=244BEA64EA209990E9C69A830B507135 + +[F0AD16AA47258818D320A5217F2E6B1E] +GoodName=Sim City 2000 (J) [b1][o1] +CRC=B1D5280C 4BA7BC2A +RefMD5=244BEA64EA209990E9C69A830B507135 + +[A698B3419600E7E283AA1313FB2522CF] +GoodName=Sim City 2000 (J) [b2] +CRC=B1D5280C 4BA7BC2A +RefMD5=244BEA64EA209990E9C69A830B507135 + +[65FC73D7ABFFABAFFF3C35FF3CB60DE2] +GoodName=Sim City 2000 (J) [h1C] +CRC=B1D5280C 4BA7BC2A +RefMD5=244BEA64EA209990E9C69A830B507135 + +[137471D67DC8847815E327A73EA30068] +GoodName=Sim City 2000 (J) [o1] +CRC=B1D5280C 4BA7BC2A +RefMD5=244BEA64EA209990E9C69A830B507135 + +[973DE87CFC38353259F3B1F6678FEB76] +GoodName=Sim City 2000 (J) [o1][h1C] +CRC=B1D5280C 4BA7BC2A +RefMD5=244BEA64EA209990E9C69A830B507135 + +[3E6FF36AE59F9261ED275FEABBF76CED] +GoodName=Simon for N64 V0.1a by Jean-Luc Picard (POM '99) (PD) +CRC=18531B7D 074AF73E +SaveType=Controller Pack +Status=1 + +[F7F44996DD1140469C6C866DA0AFFAD7] +GoodName=Sinus (PD) +CRC=C603175E ACADF5EC +Status=3 +Players=0 +Rumble=No +SaveType=None + +[3194C65208047C938EF443325E1E73C1] +GoodName=Sitero Demo by Renderman (PD) +CRC=9A6CF2F5 D5F365EE + +[B8D4B92E66A312708626B3216DE07A3A] +GoodName=Snobow Kids (J) [!] +CRC=84FC04FF B1253CE9 +SaveType=Controller Pack +Players=4 +Rumble=Yes + +[A29129B8C044D8A825F7F3780153FCC7] +GoodName=Snobow Kids (J) [h1C] +CRC=84FC04FF B1253CE9 +RefMD5=B8D4B92E66A312708626B3216DE07A3A + +[4379C26BF067F7161BC6629445E22188] +GoodName=Snobow Kids (J) [h2C] +CRC=84FC04FF B1253CE9 +RefMD5=B8D4B92E66A312708626B3216DE07A3A + +[F7E66DA23C8BB8E59F641A636A9CAE82] +GoodName=Snow Speeder (J) [!] +CRC=2EF4D519 C64A0C5E +SaveType=Eeprom 4KB +Players=4 +Rumble=Yes + +[F0FE973338C7170D54CB41602B9D48A3] +GoodName=Snow Speeder (J) [b1] +CRC=2EF4D519 C64A0C5E +RefMD5=F7E66DA23C8BB8E59F641A636A9CAE82 + +[AB4382E583AE139EEDBAFCE5FA87E4C8] +GoodName=Snowboard Kids (E) [!] +CRC=5FD7CDA0 D9BB51AD +SaveType=Controller Pack +Players=4 +Rumble=Yes + +[55D13DC1512B1A3656DB8130E59E31D2] +GoodName=Snowboard Kids (E) [h1C] +CRC=5FD7CDA0 D9BB51AD +RefMD5=AB4382E583AE139EEDBAFCE5FA87E4C8 + +[EB31F4F9C1FE26A3A663F74E9790516E] +GoodName=Snowboard Kids (U) [!] +CRC=DBF4EA9D 333E82C0 +SaveType=Controller Pack +Players=4 +Rumble=Yes + +[FB1F9F093F6081E5695F688B9EFD4095] +GoodName=Snowboard Kids (U) [b1] +CRC=DBF4EA9D 333E82C0 +RefMD5=EB31F4F9C1FE26A3A663F74E9790516E + +[4B6914D5552E4FF348FB590D52A6DF8A] +GoodName=Snowboard Kids (U) [b2] +CRC=DBF4EA9D 333E82C0 +RefMD5=EB31F4F9C1FE26A3A663F74E9790516E + +[349FF1B4AE28E31A2B2DC93D76A5219E] +GoodName=Snowboard Kids (U) [b3] +CRC=DBF4EA9D 333E82C0 +RefMD5=EB31F4F9C1FE26A3A663F74E9790516E + +[759DF0ADF7F78D603AD344C89F360E32] +GoodName=Snowboard Kids (U) [h1C] +CRC=DBF4EA9D 333E82C0 +RefMD5=EB31F4F9C1FE26A3A663F74E9790516E + +[641A6513E4FE77B88085478F99F1857D] +GoodName=Snowboard Kids (U) [t1] +CRC=A1E78A63 022A67C9 +RefMD5=EB31F4F9C1FE26A3A663F74E9790516E + +[47B5E3955D54F969941533F26691AB38] +GoodName=Snowboard Kids 2 (E) [!] +CRC=C2751D1A F8C19BFF +SaveType=Eeprom 4KB +Players=4 +Rumble=Yes + +[08E1152E9D9742E9BBF6C224B6958F2D] +GoodName=Snowboard Kids 2 (U) [!] +CRC=930C29EA 939245BF +SaveType=Controller Pack +Players=4 +Rumble=Yes + +[22C7FCDBC74DE237E0FC7778D8A6E671] +GoodName=Snowboard Kids 2 (U) [f1] (PAL) +CRC=D3DF2FEE 8090B699 +RefMD5=08E1152E9D9742E9BBF6C224B6958F2D + +[835B149A0A312262A69DAA010728A825] +GoodName=Snowboard Kids 2 (U) [f2] (PAL) +CRC=D3DF2FEE 8090B699 +RefMD5=08E1152E9D9742E9BBF6C224B6958F2D + +[B7240CADA85A35B6C872A865F6A018A1] +GoodName=Soncrap Intro by RedboX (PD) +CRC=AAA66229 98CA5CAA + +[7D47911B5C3D91A303EF19E764F3C02B] +GoodName=Sonic Wings Assault (J) [!] +CRC=22212351 4046594B +Players=4 +Rumble=Yes +SaveType=Eeprom 4KB + +[40CC2085A5C12456BEF830B047068326] +GoodName=South Park (E) (M3) [!] +CRC=20B53662 7B61899F +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[26C99A528862342791193CA6AAACC9DD] +GoodName=South Park (E) (M3) [b1] +CRC=20B53662 7B61899F +RefMD5=40CC2085A5C12456BEF830B047068326 + +[7C63BF480D1F84FC2C0D4A959154FA27] +GoodName=South Park (E) (M3) [h1C] +CRC=20B53662 7B61899F +RefMD5=40CC2085A5C12456BEF830B047068326 + +[2C94A246E701D667BA807DAB6C9771E2] +GoodName=South Park (G) [!] +CRC=91B66D42 16AC4E46 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[1730119B0455EF89C4E495DEC8E950A5] +GoodName=South Park (U) [!] +CRC=7ECBE939 3C331795 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[BE22C6B95553B9CD5E0934B66BC36C84] +GoodName=South Park (U) [b1] +CRC=7ECBE939 3C331795 +RefMD5=1730119B0455EF89C4E495DEC8E950A5 + +[6917DEEEBC2FA9E185582215E7460271] +GoodName=South Park (U) [f1] (PAL) +CRC=42EDB4BB DEA42760 +RefMD5=1730119B0455EF89C4E495DEC8E950A5 + +[AC52781C224E9EB0B8F408A782FAC22A] +GoodName=South Park (U) [t1] +CRC=018CF733 5409AD45 +RefMD5=1730119B0455EF89C4E495DEC8E950A5 + +[F1AE48B778C8431A50C37EB1ED96B120] +GoodName=South Park - Chef's Luv Shack (E) [!] +CRC=C00CA948 8E60D34B +Players=4 +Rumble=No +SaveType=None + +[6AF573EB055648A8542AA82D9524FB2F] +GoodName=South Park - Chef's Luv Shack (U) [!] +CRC=C00CA948 8E60D34B +Players=4 +Rumble=No +SaveType=None + +[FE2AA269FD3EC81C358845BBA6CA0167] +GoodName=South Park - Chef's Luv Shack (U) [f1] (Country Check) +CRC=C19EA928 226B2610 +RefMD5=6AF573EB055648A8542AA82D9524FB2F + +[C33FA02791077A71B0AFE1CFED47C180] +GoodName=South Park Rally (E) [!] +CRC=4F8AFC3A F7912DF2 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[1C494719032FF99382B167C43FB11762] +GoodName=South Park Rally (U) [!] +CRC=07F3B276 EC8F3D39 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[CD17388E175BCF0F621EE9313D5A1C8D] +GoodName=South Park Rally (U) [f1] (PAL) +CRC=A4C8852A E512045C +RefMD5=1C494719032FF99382B167C43FB11762 + +[5DA2C22480A3F6FE9BEF9C6AD4852D37] +GoodName=South Park Rally (U) [t1] +CRC=BE37CDC8 A88CB420 +RefMD5=1C494719032FF99382B167C43FB11762 + +[DDA7AA9C5D1E617DA183750F82B55780] +GoodName=South Park Rally (U) [t2] +CRC=BE37CDC8 A88CB420 +RefMD5=1C494719032FF99382B167C43FB11762 + +[7F9CDBBB1AAAAF0983C64988EF9C58BE] +GoodName=Space Dynamites (J) [!] +CRC=37463412 EAC5388D +Players=2 +SaveType=None +Rumble=No + +[19BA66FEE088181BBB0ACA6894BB8971] +GoodName=Space Dynamites (J) [b1] +CRC=37463412 EAC5388D +RefMD5=7F9CDBBB1AAAAF0983C64988EF9C58BE + +[C72417E0F8F043F9F11851633C4B1A57] +GoodName=Space Invaders (U) [!] +CRC=EBFE2397 FF74DA34 +SaveType=Controller Pack +Players=2 +Rumble=Yes + +[63FA04C30C4A0FBE162BCDEC3CB42888] +GoodName=Space Invaders (U) [f1] (PAL) +CRC=00EDCC34 75D2DEA0 +RefMD5=C72417E0F8F043F9F11851633C4B1A57 + +[8C87830FF258893C453D70A90F62019F] +GoodName=Space Invaders (U) [t1] +CRC=33828616 933456E0 +RefMD5=C72417E0F8F043F9F11851633C4B1A57 + +[4EE1DC953B1FF209811CF2808D78F064] +GoodName=Space Invaders (U) [t2] +CRC=138D7E56 72BCC9D9 +RefMD5=C72417E0F8F043F9F11851633C4B1A57 + +[FCA7AFCADCF5E5545A62919BA94DAD18] +GoodName=Space Station Silicon Valley (E) (M7) [!] +CRC=FC70E272 08FFE7AA +Players=1 +Rumble=Yes +SaveType=Eeprom 4KB + +[5919371BCA053C750D1CB357C58953A5] +GoodName=Space Station Silicon Valley (E) (M7) [b1] +CRC=FC70E272 08FFE7AA +RefMD5=FCA7AFCADCF5E5545A62919BA94DAD18 + +[E66ED1CC4AB95D0872BB2EBC49B206C4] +GoodName=Space Station Silicon Valley (J) [!] +CRC=BFE23884 EF48EAAF +Players=1 +Rumble=Yes +SaveType=Eeprom 4KB + +[868B37D1B66D1D994E2BAD4E218BF129] +GoodName=Space Station Silicon Valley (U) [!] +CRC=BFE23884 EF48EAAF +Players=1 +Rumble=Yes +SaveType=Eeprom 4KB + +[4A8F8EBB93AF51878C8FB9057AD5F43C] +GoodName=Space Station Silicon Valley (U) [f1] (PAL) +CRC=47F09853 29CCE24F +RefMD5=868B37D1B66D1D994E2BAD4E218BF129 + +[7AE0BA601FD72514C984BC80EE6BAB8E] +GoodName=Space Station Silicon Valley (U) [f2] (PAL) +CRC=BFE23884 EF48EAAF +RefMD5=868B37D1B66D1D994E2BAD4E218BF129 + +[630E4122B0743A29C246DA2C257F92DA] +GoodName=Spacer by Memir (POM '99) (PD) +CRC=A3A044B5 6DB1BF5E +Players=4 +Status=3 +SaveType=None + +[3A6A249843DDEAFFFD334AB3C5931F8D] +GoodName=Spacer by Memir (POM '99) (PD) [t1] +CRC=1B6FAB59 99199038 +RefMD5=630E4122B0743A29C246DA2C257F92DA + +[A8E8AD9B1A05205085DCB4EADBE38020] +GoodName=Spacer by Memir (POM '99) (PD) [t2] +CRC=1B6FAB59 99199038 +RefMD5=630E4122B0743A29C246DA2C257F92DA + +[E8D70E021C40078F8A82318AE8165A73] +GoodName=Spacer by Memir (POM '99) (PD) [t2][b1] +CRC=1B6FAB59 99199038 +RefMD5=630E4122B0743A29C246DA2C257F92DA + +[44D7F3FC23428913D10E68017ACB097F] +GoodName=Spice Girls Rotator Demo by RedboX (PD) [a1] +CRC=8F5179C4 803526DC + +[1934618C99A70DD8E74305C6DB06CAF3] +GoodName=Spice Girls Rotator Demo by RedboX (PD) +CRC=8F5179C4 803526DC + +[7F1991B8861E7E532EC21ECF2AF82191] +GoodName=Spider-Man (U) [!] +CRC=A60ED171 3D85D06E +Players=1 +Rumble=Yes +SaveType=Controller Pack + +[8C5D52229DA5A223EA2DA093A5B9D31B] +GoodName=Spider-Man (U) [t1] +CRC=3E6250B2 12F5155C +RefMD5=7F1991B8861E7E532EC21ECF2AF82191 + +[041CE6116C560C239023EFB88705DA94] +GoodName=Split! 3D Demo by Lem (PD) +CRC=60B8BCC9 2EC4DFB6 + +[515C86480A7FC1238BFE252BD2C53B36] +GoodName=Sporting Clays by Charles Doty (PD) +CRC=E584FE34 9D91B1E2 +Players=1 +SaveType=None +Status=3 + +[993CCC0961CFD9F1342AD99A1BA2E282] +GoodName=Sporting Clays by Charles Doty (PD) [a1] +CRC=5402C27E 60021F86 +RefMD5=515C86480A7FC1238BFE252BD2C53B36 + +[094FE60C44F35BDC7FBE85339E9C4470] +GoodName=Sporting Clays by Charles Doty (PD) [b1] +CRC=E584FE34 9D91B1E2 +RefMD5=515C86480A7FC1238BFE252BD2C53B36 + +[446D5215C4D34EB8AB0F355F324B8D0E] +GoodName=Star Fox 64 (J) [!] +CRC=FFCAA7C1 68858537 +Players=4 +Rumble=Yes +SaveType=Eeprom 4KB + +[C4179723DC6E5D319C97F2F66AB05162] +GoodName=Star Fox 64 (J) [f1] +CRC=FFCAA7C1 68858537 +RefMD5=446D5215C4D34EB8AB0F355F324B8D0E + +[D0DD14F100B3825536DB8F32C332457F] +GoodName=Star Fox 64 (J) [o1] +CRC=FFCAA7C1 68858537 +RefMD5=446D5215C4D34EB8AB0F355F324B8D0E + +[D43D1E41DBA17FFF92829FD2495B7619] +GoodName=Star Fox 64 (J) [o1][f1] +CRC=FFCAA7C1 68858537 +RefMD5=446D5215C4D34EB8AB0F355F324B8D0E + +[0C9F7FA54CA36BFC6D8BE4187E4ABD99] +GoodName=Star Fox 64 (J) [o2][f1] +CRC=FFCAA7C1 68858537 +RefMD5=446D5215C4D34EB8AB0F355F324B8D0E + +[B74F70654B2FE3FC573D3BC913A62268] +GoodName=Star Fox 64 (J) [o3][f1] +CRC=FFCAA7C1 68858537 +RefMD5=446D5215C4D34EB8AB0F355F324B8D0E + +[AF8A5A437F286FA230D99507109C79D9] +GoodName=Star Fox 64 (J) [t1] (Boost) +CRC=305AB328 F72F632A +RefMD5=446D5215C4D34EB8AB0F355F324B8D0E + +[5E3B1FAC7C16D30499B3FAA36CAF98FD] +GoodName=Star Fox 64 (J) [t2] (No Damage-Unbreakable Wings) +CRC=1180A247 EBE234B3 +RefMD5=446D5215C4D34EB8AB0F355F324B8D0E + +[CAF9A78DB13EE00002FF63A3C0C5EABB] +GoodName=Star Fox 64 (U) (V1.0) [!] +CRC=A7D015F8 2289AA43 +Players=4 +Rumble=Yes +SaveType=Eeprom 4KB + +[5653B6DDAE328C870138E71EC30122A1] +GoodName=Star Fox 64 (U) (V1.0) [f1] +CRC=A7D015F8 2289AA43 +RefMD5=CAF9A78DB13EE00002FF63A3C0C5EABB + +[ECB9184142D288B40BCD198FB191A275] +GoodName=Star Fox 64 (U) (V1.0) [f1][h1C] +CRC=A7D015F8 2289AA43 +RefMD5=CAF9A78DB13EE00002FF63A3C0C5EABB + +[E566D58641BEDD25C450E443608EB46E] +GoodName=Star Fox 64 (U) (V1.0) [f1][o1] +CRC=A7D015F8 2289AA43 +RefMD5=CAF9A78DB13EE00002FF63A3C0C5EABB + +[D81FFD06311AB9334858CCC28EFE992A] +GoodName=Star Fox 64 (U) (V1.0) [f2] (PAL) +CRC=CBD83828 6FDEBEDC +RefMD5=CAF9A78DB13EE00002FF63A3C0C5EABB + +[7052F9C1BE69B103D6BE3DE61A94F861] +GoodName=Star Fox 64 (U) (V1.0) [h1C] +CRC=A7D015F8 2289AA43 +RefMD5=CAF9A78DB13EE00002FF63A3C0C5EABB + +[80E9D39B21E537FF53FD362B7272F255] +GoodName=Star Fox 64 (U) (V1.0) [o1][f1] +CRC=A7D015F8 2289AA43 +RefMD5=CAF9A78DB13EE00002FF63A3C0C5EABB + +[06DB24BEFB76C04D06D4DDC3A50D5319] +GoodName=Star Fox 64 (U) (V1.0) [o2][f1] +CRC=CBD83828 6FDEBEDC +RefMD5=CAF9A78DB13EE00002FF63A3C0C5EABB + +[831DC9EEB9114912ABABC15B6B14DA4B] +GoodName=Star Fox 64 (U) (V1.0) [o3][f1] +CRC=A7D015F8 2289AA43 +RefMD5=CAF9A78DB13EE00002FF63A3C0C5EABB + +[23E5AF30267036A69A8328F005DF07B1] +GoodName=Star Fox 64 (U) (V1.0) [t1] +CRC=CBD83828 6FDEBEDC +RefMD5=CAF9A78DB13EE00002FF63A3C0C5EABB + +[3D38BCD5B57CEECB0985609CCE940FFA] +GoodName=Star Fox 64 (U) (V1.0) [t2] (Boost) +CRC=1B80E202 CB5AE74F +RefMD5=CAF9A78DB13EE00002FF63A3C0C5EABB + +[63CE29BBA130AACD05402EFC06C0DC89] +GoodName=Star Fox 64 (U) (V1.0) [t3] (No Damage-Unbreakable Wings) +CRC=F6621BFB 186D11A6 +RefMD5=CAF9A78DB13EE00002FF63A3C0C5EABB + +[741A94EEE093C4C8684E66B89F8685E8] +GoodName=Star Fox 64 (U) (V1.1) [!] +CRC=BA780BA0 0F21DB34 +Players=4 +Rumble=Yes +SaveType=Eeprom 4KB + +[F0CD3B2DB0F20FFDD64BF081176EB421] +GoodName=Star Fox 64 (U) (V1.1) [t1] (Energy) +CRC=C3CA0BA3 25397DC8 +RefMD5=741A94EEE093C4C8684E66B89F8685E8 + +[FFA562936DB863EA02204F9F514B6067] +GoodName=Star Fox 64 (U) (V1.1) [t2] (Boost) +CRC=8264014A 3C9FBFC1 +RefMD5=741A94EEE093C4C8684E66B89F8685E8 + +[14A21928BE46C18BA04161305E89F5DE] +GoodName=Star Soldier - Vanishing Earth (J) [!] +CRC=B703EB23 28AAE53A +Players=1 +Rumble=Yes +SaveType=Eeprom 4KB + +[565DA8D53422F16207ECF11A81D2E649] +GoodName=Star Soldier - Vanishing Earth (J) [b1] +CRC=B703EB23 28AAE53A +RefMD5=14A21928BE46C18BA04161305E89F5DE + +[006CAFEC9BA13060D4D2F0BE211081BD] +GoodName=Star Soldier - Vanishing Earth (J) [h1C] +CRC=B703EB23 28AAE53A +RefMD5=14A21928BE46C18BA04161305E89F5DE + +[97275F6585547462A73910E9A80E4067] +GoodName=Star Soldier - Vanishing Earth (J) [o1] +CRC=B703EB23 28AAE53A +RefMD5=14A21928BE46C18BA04161305E89F5DE + +[CD40D9DD238E23AD79DC4484F77A7C4A] +GoodName=Star Soldier - Vanishing Earth (J) [t1] +CRC=31100ADC 86E97D63 +RefMD5=14A21928BE46C18BA04161305E89F5DE + +[EE045A2E9F924CD8FD00018B50E46650] +GoodName=Star Soldier - Vanishing Earth (U) [!] +CRC=DDD93C85 DAE381E8 +Players=1 +Rumble=Yes +SaveType=Eeprom 4KB + +[A68B65E6B4BC976AD9DEAB335DE3BF70] +GoodName=Star Soldier - Vanishing Earth (U) [t1] +CRC=DDD982EF 3B0D6FEC +RefMD5=EE045A2E9F924CD8FD00018B50E46650 + +[CA28A3645FC7AD969EBD75C5D6506E7A] +GoodName=Star Twins (J) [!] +CRC=F163A242 F2449B3B +Players=4 +SaveType=Flash RAM +Rumble=Yes + +[E1376F9B151EE3DA3E8ED52D970480EF] +GoodName=Star Wars - Rogue Squadron (E) (M3) (V1.0) (Language Select Hack) +CRC=7EE0E945 7D8FEE20 +RefMD5=7F919D2E35CBE561E139AE8FE93ACA86 + +[7F919D2E35CBE561E139AE8FE93ACA86] +GoodName=Star Wars - Rogue Squadron (E) (M3) (V1.0) [!] +CRC=7EE0E8BB 49E411AA +Players=1 +SaveType=Eeprom 4KB +Rumble=Yes + +[231F61E0D66A70B173BB22672EE67BD6] +GoodName=Star Wars - Rogue Squadron (E) (M3) (V1.0) [t1] +CRC=5E6508BB F321C996 +RefMD5=7F919D2E35CBE561E139AE8FE93ACA86 + +[A9DD498E6A28F55311CE4EF057E164B8] +GoodName=Star Wars - Rogue Squadron (E) (M3) (V1.1) [!] +CRC=219191C1 33183C61 +Players=1 +SaveType=Eeprom 4KB +Rumble=Yes + +[6560FFC9208A31F0518036F7937B53DA] +GoodName=Star Wars - Rogue Squadron (U) (M3) (Language Select Hack) +CRC=66A24A12 22AF6AC2 +RefMD5=47CAC4E2A6309458342F21A9018FFBF0 + +[47CAC4E2A6309458342F21A9018FFBF0] +GoodName=Star Wars - Rogue Squadron (U) (M3) [!] +CRC=66A24BEC 2EADD94F +Players=1 +SaveType=Eeprom 4KB +Rumble=Yes + +[0583AD9FDD1E3D10076AAB40E5B4E7BB] +GoodName=Star Wars - Rogue Squadron (U) (M3) [b1] +CRC=66A24BEC 2EADD94F +RefMD5=47CAC4E2A6309458342F21A9018FFBF0 + +[4903C39007AEACC113FE0E9E4BBE4711] +GoodName=Star Wars - Rogue Squadron (U) (M3) [t1] +CRC=165CBDA2 05A62246 +RefMD5=47CAC4E2A6309458342F21A9018FFBF0 + +[591CF8E672C9CC0FE9C871CC56DCC854] +GoodName=Star Wars - Shadows of the Empire (E) [!] +CRC=4D486681 AB7D9245 +Players=1 +Rumble=No +SaveType=Eeprom 4KB + +[818737338B3F1D87B7E1B7FB55057BB5] +GoodName=Star Wars - Shadows of the Empire (E) [b1] +CRC=4D486681 AB7D9245 +RefMD5=591CF8E672C9CC0FE9C871CC56DCC854 + +[E83325EC6E8520B0CBDB49B52418FE4E] +GoodName=Star Wars - Shadows of the Empire (E) [b2] +CRC=4D486681 AB7D9245 +RefMD5=591CF8E672C9CC0FE9C871CC56DCC854 + +[64E59BA2F7BA4DAFFDD5934F818DC7DA] +GoodName=Star Wars - Shadows of the Empire (E) [b3] +CRC=4D486681 AB7D9245 +RefMD5=591CF8E672C9CC0FE9C871CC56DCC854 + +[554BFCC857BE49B2AACD077E6059B281] +GoodName=Star Wars - Shadows of the Empire (E) [b4] +CRC=4D486681 AB7D9245 +RefMD5=591CF8E672C9CC0FE9C871CC56DCC854 + +[30BDF5405A8C615DC924DB9480E996B7] +GoodName=Star Wars - Shadows of the Empire (E) [o1] +CRC=4D486681 AB7D9245 +RefMD5=591CF8E672C9CC0FE9C871CC56DCC854 + +[5CCE8AD5F86E8A373A7525DC4C7E6705] +GoodName=Star Wars - Shadows of the Empire (U) (V1.0) [!] +CRC=264D7E5C 18874622 +Players=1 +Rumble=No +SaveType=Eeprom 4KB + +[C88637DCC7A00FED6297B61E79CF75A9] +GoodName=Star Wars - Shadows of the Empire (U) (V1.0) [b1] +CRC=BC3C9F6C 93B3CB13 +RefMD5=5CCE8AD5F86E8A373A7525DC4C7E6705 + +[C68CB260A7FD8D177640FA487DCCACF6] +GoodName=Star Wars - Shadows of the Empire (U) (V1.0) [b2] +CRC=BDA75F12 BDDC1661 +RefMD5=5CCE8AD5F86E8A373A7525DC4C7E6705 + +[7527B90543E3D6042A72619818B47145] +GoodName=Star Wars - Shadows of the Empire (U) (V1.0) [o1] +CRC=264D7E5C 18874622 +RefMD5=5CCE8AD5F86E8A373A7525DC4C7E6705 + +[C69FA82E2CA2460000C629E9D46D4DC2] +GoodName=Star Wars - Shadows of the Empire (U) (V1.0) [t1] +CRC=BC3C9F6C 93B3CB13 +RefMD5=5CCE8AD5F86E8A373A7525DC4C7E6705 + +[F8906B10BAE363ACB170FA841A88E96C] +GoodName=Star Wars - Shadows of the Empire (U) (V1.0) [t2] +CRC=BDA75F12 BDDC1661 +RefMD5=5CCE8AD5F86E8A373A7525DC4C7E6705 + +[FA635E837275D28FD5A24D5675BA42C8] +GoodName=Star Wars - Shadows of the Empire (U) (V1.1) [!] +CRC=4147B091 63251060 +Players=1 +SaveType=Eeprom 4KB +Rumble=No + +[E8EE7D44858C1AB90C1F48A649DC98B6] +GoodName=Star Wars - Shadows of the Empire (U) (V1.1) [b1] +CRC=D3E792A5 05D39C97 +RefMD5=FA635E837275D28FD5A24D5675BA42C8 + +[64B4FB2D4C49AE6902F13149C81CF2A1] +GoodName=Star Wars - Shadows of the Empire (U) (V1.1) [o1] +CRC=4147B091 63251060 +RefMD5=FA635E837275D28FD5A24D5675BA42C8 + +[7BC08EAF55A645DE9226617C3F83B19F] +GoodName=Star Wars - Shadows of the Empire (U) (V1.1) [t1] +CRC=D3E792A5 05D39C97 +RefMD5=FA635E837275D28FD5A24D5675BA42C8 + +[C7B40352AAD8D863D88D51672F9A0087] +GoodName=Star Wars - Shadows of the Empire (U) (V1.2) [!] +CRC=4DD7ED54 74F9287D +Players=1 +Rumble=No +SaveType=Eeprom 4KB + +[3FE2B38E18152162A34E3002DEA071F7] +GoodName=Star Wars - Shadows of the Empire (U) (V1.2) [b1] +CRC=D3E792A5 05D39C97 +RefMD5=C7B40352AAD8D863D88D51672F9A0087 + +[3BD4EE76D4CBB14D69BA628533BD7CBC] +GoodName=Star Wars - Shadows of the Empire (U) (V1.2) [b2] +CRC=D3E792A5 05D39C97 +RefMD5=C7B40352AAD8D863D88D51672F9A0087 + +[CD2C0DFDAC5572988AAB98D125EEEB53] +GoodName=Star Wars - Shadows of the Empire (U) (V1.2) [o1] +CRC=4DD7ED54 74F9287D +RefMD5=C7B40352AAD8D863D88D51672F9A0087 + +[8603B180E70B2A72EF77D46C2BEC2234] +GoodName=Star Wars - Shutsugeki! Rogue Chuutai (J) [!] +CRC=827E4890 958468DC +Players=1 +Rumble=No +SaveType=Eeprom 4KB + +[5B6B6B0C8C9A40286DCF61706B6A05CB] +GoodName=Star Wars - Teikoku no Kage (J) [!] +CRC=FE24AC63 1B41AA17 +RefMD5=8603B180E70B2A72EF77D46C2BEC2234 + +[B5FDFDF26E1F27EAF0BD849CAA4CC3B8] +GoodName=Star Wars - Teikoku no Kage (J) [o1] +CRC=FE24AC63 1B41AA17 +RefMD5=8603B180E70B2A72EF77D46C2BEC2234 + +[222F1E75F70A654B642382989E024749] +GoodName=Star Wars - Teikoku no Kage (J) [o2] +CRC=FE24AC63 1B41AA17 +RefMD5=8603B180E70B2A72EF77D46C2BEC2234 + +[0BD1F7BB9F4B02520E4E9285C809F099] +GoodName=Star Wars Episode I - Battle for Naboo (E) [!] +CRC=EAE6ACE2 020B4384 +Players=1 +Rumble=Yes +SaveType=Eeprom 4KB + +[3CB88B934572E7520F35E5458798775B] +GoodName=Star Wars Episode I - Battle for Naboo (U) [!] +CRC=3D02989B D4A381E2 +Players=1 +Rumble=Yes +SaveType=Eeprom 4KB + +[B4724120C269A1DC86991D34B1561F3D] +GoodName=Star Wars Episode I - Battle for Naboo (U) [b1] +CRC=3D02989B D4A381E2 +RefMD5=3CB88B934572E7520F35E5458798775B + +[24E6E064454DE99C88EBA9F8C3574AF3] +GoodName=Star Wars Episode I - Battle for Naboo (U) [t1] +CRC=FD8F6875 42608FDC +RefMD5=3CB88B934572E7520F35E5458798775B + +[6EF9FED309F28BD59B605F128869AA00] +GoodName=Star Wars Episode I - Racer (E) (M3) [!] +CRC=53ED2DC4 06258002 +SaveType=Eeprom 16KB + +[8CC7E31925FBFA13A584F529E8912207] +GoodName=Star Wars Episode I - Racer (E) (M3) [f1] (Save) +CRC=166312CB C30220D2 +RefMD5=6EF9FED309F28BD59B605F128869AA00 + +[7579AB0E79B1011479B88F2BF39D48E0] +GoodName=Star Wars Episode I - Racer (J) [!] +CRC=61F5B152 046122AB +SaveType=Eeprom 16KB + +[CFA21E43DAC50DFF3122ABF3AF3511F8] +GoodName=Star Wars Episode I - Racer (J) [b1] +CRC=61F5B152 046122AB +RefMD5=7579AB0E79B1011479B88F2BF39D48E0 + +[1EE8800A4003E7F9688C5A35F929D01B] +GoodName=Star Wars Episode I - Racer (U) [!] +CRC=72F70398 6556A98B +SaveType=Eeprom 16KB + +[E4353B43CB4302B7A308A42D6BB04435] +GoodName=Star Wars Episode I - Racer (U) [f1] (Save) +CRC=86EDC3C1 E983A7BF +RefMD5=1EE8800A4003E7F9688C5A35F929D01B + +[D6EED7BA15E4CF88B4D235A016B1C880] +GoodName=Star Wars Episode I - Racer (U) [t1] +CRC=C3193C16 53A19708 +RefMD5=1EE8800A4003E7F9688C5A35F929D01B + +[81FE5AD03175B6F2D23DBF5A549B0CDA] +GoodName=Star Wars Episode I - Racer (U) [t2] +CRC=1C37BF54 AC368304 +RefMD5=1EE8800A4003E7F9688C5A35F929D01B + +[0BE4958B3E8EED916307DC9F5DE3206D] +GoodName=Star Wars Episode I - Racer (U) [t3] +CRC=88C79381 85786A83 +RefMD5=1EE8800A4003E7F9688C5A35F929D01B + +[F21C920F0A7BF42F80C38C39CD61BD60] +GoodName=Star Wars Episode I - Racer (U) [t4] +CRC=B722133E 5EECEC4D +RefMD5=1EE8800A4003E7F9688C5A35F929D01B + +[3EB732A8D004263AD8EB0DA59A29582A] +GoodName=StarCraft 64 (Beta) +CRC=BC9B2CC3 4ED04DA5 +Status=1 +Players=2 +SaveType=Flash RAM +Rumble=Yes + +[432DF5EAC0BA573C6587A5BB4E51834A] +GoodName=StarCraft 64 (Beta) [f1] +CRC=BC9B2CC3 4ED04DA5 +RefMD5=3EB732A8D004263AD8EB0DA59A29582A + +[30486A26C7B87CDBDB1A421493CC745A] +GoodName=StarCraft 64 (Beta) [f2] (PAL) +CRC=036A20D8 A99C4D3D +RefMD5=3EB732A8D004263AD8EB0DA59A29582A + +[A9683B99E82271DBF84DDB59806E9423] +GoodName=StarCraft 64 (Beta) [f3] (Country Code) +CRC=BC9B2CC3 4ED04DA5 +RefMD5=3EB732A8D004263AD8EB0DA59A29582A + +[72B60FAC5EE257FA387B43C57632D50C] +GoodName=StarCraft 64 (E) [!] +CRC=42CF5EA3 9A1334DF +Status=1 +Players=2 +SaveType=Flash RAM +Rumble=Yes + +[B75945407D7DEA00A2A29AD24056A416] +GoodName=StarCraft 64 (E) [b1] +CRC=42CF5EA3 9A1334DF +RefMD5=72B60FAC5EE257FA387B43C57632D50C + +[762543CC6409C199FD50A3BCF545730D] +GoodName=StarCraft 64 (E) [f1] (NTSC) +CRC=C7501968 06533B11 +RefMD5=72B60FAC5EE257FA387B43C57632D50C + +[559F71B861F639B6376D891E3023414B] +GoodName=StarCraft 64 (U) [!] +CRC=0684FBFB 5D3EA8A5 +Status=1 +Players=2 +SaveType=Flash RAM +Rumble=Yes + +[A9C393AA232B32798ADF378F4318F99F] +GoodName=Starshot - Space Circus Fever (E) (M3) [!] +CRC=D89E0E55 B17AA99A +Players=1 +SaveType=Eeprom 4KB +Rumble=No + +[B23BFC7DC874DDAA2005F9AFF59A47FF] +GoodName=Starshot - Space Circus Fever (E) (M3) [f1] (NTSC100%) +CRC=287AAA27 8C2C02D8 +RefMD5=A9C393AA232B32798ADF378F4318F99F + +[AA11E9E44B401794C37290896C9412AC] +GoodName=Starshot - Space Circus Fever (E) (M3) [f2] (NTSC) +CRC=AD199971 1075F279 +RefMD5=A9C393AA232B32798ADF378F4318F99F + +[BAE518E0D40F846B17C510E4EA9E8C52] +GoodName=Starshot - Space Circus Fever (E) (M3) [f3] (NTSC) +CRC=ADD78971 A09C18CF +RefMD5=A9C393AA232B32798ADF378F4318F99F + +[530B796EA3B1748841F9D057F3F9EFA8] +GoodName=Starshot - Space Circus Fever (E) (M3) [t1] +CRC=AD197171 04DB7E9E +RefMD5=A9C393AA232B32798ADF378F4318F99F + +[42AF1992978229BBB5F560571708E25E] +GoodName=Starshot - Space Circus Fever (U) (M3) [!] +CRC=94EDA5B8 8673E903 +Players=1 +SaveType=Eeprom 4KB +Rumble=No + +[BD22A79568534B42EAA3D8DB9A7C4C91] +GoodName=Starshot - Space Circus Fever (U) (M3) [b1] +CRC=94EDA5B8 8673E903 +RefMD5=42AF1992978229BBB5F560571708E25E + +[E8B666A429FEDB2A1A1228CD450CD4FC] +GoodName=Stunt Racer 64 (U) [!] +CRC=9510D8D7 35100DD2 +SaveType=Controller Pack +Players=4 +Rumble=Yes + +[14DDF19382385774F253049ABEAF01D2] +GoodName=Summer64 Demo by Lem (PD) [b1] +CRC=4794B85F 3EBD5B68 + +[1B1DC8B1DD950E70C0F532DD81C9A982] +GoodName=Summer64 Demo by Lem (PD) +CRC=4794B85F 3EBD5B68 + +[B3C1D4B9EC7DCD2922E681DBBC393915] +GoodName=Super B-Daman - Battle Phoenix 64 (J) [!] +CRC=F4646B69 C5751095 +Players=2 +Rumble=Yes + +[4168C145279EA29912BA0E35DCA35289] +GoodName=Super Bomberman 2 by Rider (POM '99) (PD) +CRC=BB214F79 8B88B16B +Status=1 +Players=4 + +[09C5B4D19364EFE48BB818087734978E] +GoodName=Super Bowling (J) [!] +CRC=F3F2F385 6E490C7F +Players=4 +Rumble=Yes + +[FA3A043997A3ACDF17337385B126BC04] +GoodName=Super Bowling 64 (U) [!] +CRC=AA1D215A 91CBBE9A +Players=4 +Rumble=Yes + +[7FCF424B960F4E429FD683A4B19B3356] +GoodName=Super Fighter Demo Halley's Comet Software (PD) +CRC=1AD61BB9 F1E2BE1A + +[A215BC1CE06960E0C469DB9520E907C6] +GoodName=Super Irishley Drunk Giant WaLuigi 64 (Super Mario 64 Hack) +CRC=635A42C5 BDC58EDC + +[45676429EF6B90E65B517129B700308E] +GoodName=Super Mario 64 (E) (M3) [!] +CRC=A03CF036 BCC1C5D2 +SaveType=Eeprom 4KB +Players=1 +Rumble=No +Status=4 + +[9EE432F07F1E4E9A13CD0090CCC5A94B] +GoodName=Super Mario 64 (E) (M3) [b1] +CRC=A03CF036 BCC1C5D2 +RefMD5=45676429EF6B90E65B517129B700308E + +[225223ABF4BC1F3E38A45873BA94CEBC] +GoodName=Super Mario 64 (E) (M3) [b2] +CRC=A03CF036 BCC1C5D2 +RefMD5=45676429EF6B90E65B517129B700308E + +[6A954E08533C13DBD7599068D03A3ADB] +GoodName=Super Mario 64 (E) (M3) [h1C] +CRC=A03CF036 BCC1C5D2 +RefMD5=45676429EF6B90E65B517129B700308E + +[D1F6BC22557BF5607AA2E3C61BE44D59] +GoodName=Super Mario 64 (E) (M3) [o1] +CRC=A03CF036 BCC1C5D2 +RefMD5=45676429EF6B90E65B517129B700308E + +[DF2031338C9B0AB8317661AFA64E5F9E] +GoodName=Super Mario 64 (E) (M3) [o2] +CRC=A03CF036 BCC1C5D2 +RefMD5=45676429EF6B90E65B517129B700308E + +[121A19E2A547C554155433788986033C] +GoodName=Super Mario 64 (E) (M3) [t1] +CRC=77C44B0F 5E8948A3 +RefMD5=45676429EF6B90E65B517129B700308E + +[994D171A0154ABE747338890AF179252] +GoodName=Super Mario 64 (E) (M3) [t2] +CRC=16510823 E2EEE387 +RefMD5=45676429EF6B90E65B517129B700308E + +[85D61F5525AF708C9F1E84DCE6DC10E9] +GoodName=Super Mario 64 (J) [!] +CRC=4EAA3D0E 74757C24 +SaveType=Eeprom 4KB +Players=1 +Rumble=No +Status=4 + +[DBF7F4D881E1DF604C41367B04233E74] +GoodName=Super Mario 64 (J) [h1C] +CRC=4EAA3D0E 74757C24 +RefMD5=85D61F5525AF708C9F1E84DCE6DC10E9 + +[E458F74E694B2916EBA9818103F7CF13] +GoodName=Super Mario 64 (U) (Enable Hidden Scroller Hack) +CRC=DACDE68E 7381B3C9 +RefMD5=45676429EF6B90E65B517129B700308E + +[FF5A05FFDE29707C15D89E807ED66B81] +GoodName=Super Mario 64 (U) (No Cap Hack) +CRC=5B5DA9FB 11EEE5E5 +RefMD5=45676429EF6B90E65B517129B700308E + +[6C5AEE2BE768E581038F3B211D7F6066] +GoodName=Super Mario 64 (U) (Silver Mario Hack) +CRC=658E2804 443386FA +RefMD5=45676429EF6B90E65B517129B700308E + +[20B854B239203BAF6C961B850A4A51A2] +GoodName=Super Mario 64 (U) [!] +CRC=635A2BFF 8B022326 +SaveType=Eeprom 4KB +Players=1 +Rumble=No +Status=4 + +[597204EE766B93C1AE33B7FC0739E170] +GoodName=Super Mario 64 (U) [T+Rus] +CRC=267FBAD5 7593FADC +RefMD5=20B854B239203BAF6C961B850A4A51A2 + +[E51A6FF9B2DBBD216158CACFF35EB215] +GoodName=Super Mario 64 (U) [T+SpaFinal_Mistergame] +CRC=635A42C5 BDC58EDC +RefMD5=20B854B239203BAF6C961B850A4A51A2 + +[99BD941850AA68440B886EA05539F7DC] +GoodName=Super Mario 64 (U) [T+SpaFinal_Mistergame][a1] +CRC=635A42C5 BDC58EDC +RefMD5=20B854B239203BAF6C961B850A4A51A2 + +[35BBAF4869D0B0D2147D35F1EC3CF2CA] +GoodName=Super Mario 64 (U) [T-Ita1.0final_beta1_Rulesless] +CRC=819D5B33 A5096295 +RefMD5=20B854B239203BAF6C961B850A4A51A2 + +[CDACC6FE2CC7851A1110A60CE76FBDFB] +GoodName=Super Mario 64 (U) [T+Ita2.0final_beta2_Rulesless] +CRC=490A59F2 22BC515E +RefMD5=20B854B239203BAF6C961B850A4A51A2 + +[933C474FC970A0E7D659F32334DB6475] +GoodName=Super Mario 64 (U) [b1] +CRC=635A2BFF 8B022326 +RefMD5=20B854B239203BAF6C961B850A4A51A2 + +[0513A584BC6B3859555E72E10008B55F] +GoodName=Super Mario 64 (U) [b2] +CRC=77C44B0F 5E8948A3 +RefMD5=20B854B239203BAF6C961B850A4A51A2 + +[C3A4EBEEA4D22D8FC245B346D5C1A81E] +GoodName=Super Mario 64 (U) [h1C] +CRC=635A2BFF 8B022326 +RefMD5=20B854B239203BAF6C961B850A4A51A2 + +[179537A49DAA33BF031F09A9589EAA28] +GoodName=Super Mario 64 (U) [h2C] +CRC=635A2BFF 8B022326 +RefMD5=20B854B239203BAF6C961B850A4A51A2 + +[AED29A731056F34B79E6B996BDBAFB63] +GoodName=Super Mario 64 (U) [o1] +CRC=635A2BFF 8B022326 +RefMD5=20B854B239203BAF6C961B850A4A51A2 + +[3F3EBFAD624D623FAFEF767B99609E15] +GoodName=Super Mario 64 (U) [t1] (Invincible) +CRC=5C8BD407 63F71E2A +RefMD5=20B854B239203BAF6C961B850A4A51A2 + +[B48A8F8E2D9C7403210C2AA5262D94C7] +GoodName=Super Mario 64 (U) [t2] (Speed) +CRC=5B652BFF 8FA82E35 +RefMD5=20B854B239203BAF6C961B850A4A51A2 + +[C293D2ADF01E0528554CDBADF0F86554] +GoodName=Super Mario 64 (U) [t3] +CRC=FECE2B85 331406D1 +RefMD5=20B854B239203BAF6C961B850A4A51A2 + +[2D727C3278AA232D94F2FB45AEC4D303] +GoodName=Super Mario 64 - Shindou Edition (J) [!] +CRC=D6FBA4A8 6326AA2C +SaveType=Eeprom 4KB +Players=1 +Rumble=Yes +Status=4 + +[23033085561CD331CC81F0026FCB2CE2] +GoodName=Super Mario 64 - Shindou Edition (J) [b1] +CRC=D6FBA4A8 6326AA2C +RefMD5=2D727C3278AA232D94F2FB45AEC4D303 + +[8C361E9283D740E2F266782D9C1CE914] +GoodName=Super Mario 64 - Shindou Edition (J) [b2] +CRC=D6FBA4A8 6326AA2C +RefMD5=2D727C3278AA232D94F2FB45AEC4D303 + +[E824B289A850E7E161AF761D876F1CAE] +GoodName=Super Mario 64 - Shindou Edition (J) [h1C] +CRC=D6FBA4A8 6326AA2C +RefMD5=2D727C3278AA232D94F2FB45AEC4D303 + +[7BA990008966BDA71D8CB78FB7BA414E] +GoodName=Super Mario 64 - Shindou Edition (J) [h2C] +CRC=D6FBA4A8 6326AA2C +RefMD5=2D727C3278AA232D94F2FB45AEC4D303 + +[A75637B1D22F59F2C32BDA359A9EE79E] +GoodName=Super Mario Magic Plant Adventure 64 (Super Mario 64 Hack) +CRC=635A42C5 BDC58EDC +RefMD5=20B854B239203BAF6C961B850A4A51A2 + +[3EC3F83EAB22702E146C467EB1DB45FA] +GoodName=Super Robot Spirits (J) [!] +CRC=66572080 28E348E1 +Players=2 +Rumble=Yes + +[E92FC6AE193092F6B597E05946B558EB] +GoodName=Super Robot Spirits (J) [b1] +CRC=66572080 28E348E1 +RefMD5=3EC3F83EAB22702E146C467EB1DB45FA + +[3F4B73963ABC91CEE59C416063EFD4AE] +GoodName=Super Robot Taisen 64 (J) [!] +CRC=1649D810 F73AD6D2 +Players=1 +Rumble=No + +[462A2AF0E3B72DA4A0E9266078EE5717] +GoodName=Super Robot Taisen 64 (J) [b1] +CRC=1649D810 F73AD6D2 +RefMD5=3F4B73963ABC91CEE59C416063EFD4AE + +[BB5C21BFEA9AA7E9C90FE76C132BEC49] +GoodName=Super Robot Taisen 64 (J) [b2] +CRC=1649D810 F73AD6D2 +RefMD5=3F4B73963ABC91CEE59C416063EFD4AE + +[9AF2919C27FCF6972986993C564947CD] +GoodName=Super Robot Taisen 64 (J) [f1] (PAL) +CRC=AF981AB7 AA1A0A7A + +[694DEA68DBF1C3F06FF0476ACF2169E6] +GoodName=Super Smash Bros. (A) [!] +CRC=DD26FDA1 CB4A6BE3 +Status=3 +SaveType=SRAM +Players=4 +Rumble=Yes + +[7F18A06BB16A507E23F9DD636B7046A6] +GoodName=Super Smash Bros. (A) [f1] +CRC=9624C4F9 3FB02E03 +RefMD5=694DEA68DBF1C3F06FF0476ACF2169E6 + +[5E54C6C563B09C107F86FB33E914EF81] +GoodName=Super Smash Bros. (E) (M3) [!] +CRC=93945F48 5C0F2E30 +Status=3 +SaveType=SRAM +Players=4 +Rumble=Yes + +[4D37726FDFEC039CB36E2AAE65B9727D] +GoodName=Super Smash Bros. (E) (M3) [b1] +CRC=593BD58B C330786C +RefMD5=5E54C6C563B09C107F86FB33E914EF81 + +[99C1AB76126B7BADFA9023D50DCA1430] +GoodName=Super Smash Bros. (E) (M3) [f1] +CRC=593BD58B C330786C +RefMD5=5E54C6C563B09C107F86FB33E914EF81 + +[F7C52568A31AADF26E14DC2B6416B2ED] +GoodName=Super Smash Bros. (U) [!] +CRC=916B8B5B 780B85A4 +Status=3 +SaveType=SRAM +Players=4 +Rumble=Yes + +[508BE860974B75470851A2D25C0FCB36] +GoodName=Super Smash Bros. (U) [b1] +CRC=916B8B5B 780B85A4 +RefMD5=F7C52568A31AADF26E14DC2B6416B2ED + +[313F1541748ACF01C4355BA471043868] +GoodName=Super Smash Bros. (U) [b2] +CRC=916B8B5B 780B85A4 +RefMD5=F7C52568A31AADF26E14DC2B6416B2ED + +[326DC227FCCAA4975583E63624DDFDA1] +GoodName=Super Smash Bros. (U) [f1] +CRC=3409CEB6 CEC8517A +RefMD5=F7C52568A31AADF26E14DC2B6416B2ED + +[C2DBAE0C18C6666336F4CFA896D8ED18] +GoodName=Super Smash Bros. (U) [f2] (PAL) +CRC=8CF1CECB C8902FF4 +RefMD5=F7C52568A31AADF26E14DC2B6416B2ED + +[5A19D395B6A8B1911DEB334E392F4526] +GoodName=Super Smash Bros. (U) [f3] +CRC=3409CEB6 CEC8517A +RefMD5=F7C52568A31AADF26E14DC2B6416B2ED + +[98A3122A6D7C9B02381FC5B0CFB8C14B] +GoodName=Super Smash Bros. (U) [f4] (GameShark) +CRC=EA6D4C3F 13837E54 +RefMD5=F7C52568A31AADF26E14DC2B6416B2ED + +[ED8641A704910BB4A0FAC9AD08F9C1D2] +GoodName=Super Smash Bros. (U) [hI] +CRC=916B8B5B 780B85A4 +RefMD5=F7C52568A31AADF26E14DC2B6416B2ED + +[6B5D93B3566E96147009D1AC4FB15C97] +GoodName=Super Speed Race 64 (J) [!] +CRC=9CE02E22 206EF1B0 +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[27A7A2A19FC67346BB25E3C5BB3A91CE] +GoodName=Super Speed Race 64 (J) [o1] +CRC=9CE02E22 206EF1B0 +RefMD5=6B5D93B3566E96147009D1AC4FB15C97 + +[DB502D4577EE908160441D38531EBB8D] +GoodName=Super WaLuigi 64 (Super Mario 64 Hack) +CRC=635A42C5 BDC58EDC +RefMD5=20B854B239203BAF6C961B850A4A51A2 + +[99138CB0D1325F7BB7C2EDAB5D7F6C54] +GoodName=Super Wario 64 (Super Mario 64 Hack) +CRC=635A42C5 BDC58EDC +RefMD5=20B854B239203BAF6C961B850A4A51A2 + +[7DDF1CC63401CF43836BD14F199B6C70] +GoodName=Super Wario 64 V1.0 by Rulesless (Super Mario 64 Hack) [T+Ita] +CRC=75A15B07 2E391683 +RefMD5=20B854B239203BAF6C961B850A4A51A2 + +[93582A59F442502CADAA39BD6CC1B2CE] +GoodName=Super Wario 64 V1.0 by Rulesless (Super Mario 64 Hack) +CRC=635A42C5 BDC58EDC +RefMD5=20B854B239203BAF6C961B850A4A51A2 + +[6D58A01EF7A7A7C779D2A66315992C5F] +GoodName=Supercross 2000 (E) (M3) [!] +CRC=2CBB127F 09C2BFD8 +Players=2 +SaveType=Controller Pack +Rumble=Yes + +[60347200A1A7CABC0D849EE69EC51DF7] +GoodName=Supercross 2000 (U) [!] +CRC=C1452553 5D7B24D9 +Players=2 +SaveType=Controller Pack +Rumble=Yes + +[53922802F7744CC38BDD75852214057F] +GoodName=Supercross 2000 (U) [b1] +CRC=C1452553 5D7B24D9 +RefMD5=60347200A1A7CABC0D849EE69EC51DF7 + +[4EAB63BE36DCC7FA6D612BE780BF79C1] +GoodName=Supercross 2000 (U) [f1] (PAL) +CRC=1917566C 8BE6CD0F +RefMD5=60347200A1A7CABC0D849EE69EC51DF7 + +[5AB39F2D7A144E1BA243DF059560E878] +GoodName=Superman (E) (M6) [!] +CRC=B44CAB74 07029A29 +SaveType=Controller Pack +Players=4 +Rumble=Yes + +[3F64B4F72E61225EF3AE93976C9BFC7C] +GoodName=Superman (U) (M3) [!] +CRC=A2E8F35B C9DC87D9 +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[04A6F25CB0F2084E631B3B7FFF76BEFD] +GoodName=Superman (U) (M3) [T+Ita100_Cattivik66] +CRC=A2E8F35B C9DC87D9 +RefMD5=3F64B4F72E61225EF3AE93976C9BFC7C + +[3C28C951B1EA46690065DC32862272E4] +GoodName=Superman (U) (M3) [b1] +CRC=A2E8F35B C9DC87D9 +RefMD5=3F64B4F72E61225EF3AE93976C9BFC7C + +[574704AFFBD28C7A2728DA85CC1DA0F3] +GoodName=Superman (U) (M3) [b2] +CRC=A2E8F35B C9DC87D9 +RefMD5=3F64B4F72E61225EF3AE93976C9BFC7C + +[12562BFF127E52A6EE9B4FEF92050AF9] +GoodName=Superman (U) (M3) [f1] (PAL) +CRC=EEF7DE23 57E4FEA9 +RefMD5=3F64B4F72E61225EF3AE93976C9BFC7C + +[943337C945DA689AF869877498C7AA2C] +GoodName=Superman (U) (M3) [f2] (PAL) +CRC=06F6B180 97F0AD11 +RefMD5=3F64B4F72E61225EF3AE93976C9BFC7C + +[DBA237ED8415383AFCABA035D817272F] +GoodName=Superman (U) (M3) [t1] +CRC=5AEB33A3 23063A25 +RefMD5=3F64B4F72E61225EF3AE93976C9BFC7C + +[26F4CA20F7B9C88199AC046C57E282B4] +GoodName=Susume! Taisen Puzzle Dama Toukon! Marumata Chou (J) [!] +CRC=35E811F3 99792724 +Players=2 +Rumble=No + +[59985249F824F74C335C6C47A6E29C4A] +GoodName=Susume! Taisen Puzzle Dama Toukon! Marumata Chou (J) [b1] +CRC=35E811F3 99792724 +RefMD5=26F4CA20F7B9C88199AC046C57E282B4 + +[993A67ECD02212B4BE5B2E14652F835B] +GoodName=Susume! Taisen Puzzle Dama Toukon! Marumata Chou (J) [b2] +CRC=35E811F3 99792724 +RefMD5=26F4CA20F7B9C88199AC046C57E282B4 + +[EFE2CEBF5BB21BF766FF72C055DF36BE] +GoodName=Susume! Taisen Puzzle Dama Toukon! Marumata Chou (J) [b3] +CRC=35E811F3 99792724 +RefMD5=26F4CA20F7B9C88199AC046C57E282B4 + +[B0FE1343A2ED21D2F083041B1FE1B7A9] +GoodName=Susume! Taisen Puzzle Dama Toukon! Marumata Chou (J) [h1C] +CRC=35E811F3 99792724 +RefMD5=26F4CA20F7B9C88199AC046C57E282B4 + +[987A07DAF0F06567BC8E794291D98695] +GoodName=Susume! Taisen Puzzle Dama Toukon! Marumata Chou (J) [h2C] +CRC=35E811F3 99792724 +RefMD5=26F4CA20F7B9C88199AC046C57E282B4 + +[E946855EEF7F1BBD47AEECA33A2737BB] +GoodName=Susume! Taisen Puzzle Dama Toukon! Marumata Chou (J) [o1] +CRC=35E811F3 99792724 +RefMD5=26F4CA20F7B9C88199AC046C57E282B4 + +[D6B0135BE06DF3545A8931957FE805FA] +GoodName=Susume! Taisen Puzzle Dama Toukon! Marumata Chou (J) [o2] +CRC=35E811F3 99792724 +RefMD5=26F4CA20F7B9C88199AC046C57E282B4 + +[6922A2D0DB719AD7972C0DC146FF0D8C] +GoodName=Susume! Taisen Puzzle Dama Toukon! Marumata Chou (J) [o2][b1] +CRC=35E811F3 99792724 +RefMD5=26F4CA20F7B9C88199AC046C57E282B4 + +[4BC1D3074FA3A3DCAF1F16888B82A966] +GoodName=T-Shirt Demo by Neptune and Steve (POM '98) (PD) [b1] +CRC=1AA71519 51360D55 + +[E4D314C536F7BF78F60197EC238514AE] +GoodName=T-Shirt Demo by Neptune and Steve (POM '98) (PD) +CRC=1AA71519 51360D55 + +[ACD0118AC4709DB3943B3D35112C2001] +GoodName=TG Rally 2 (E) [!] +CRC=F82DD377 8C3FB347 + +[65E67D43E0A9B146D7881CBC803EC5C3] +GoodName=TR64 Demo by FIres and Icepir8 (PD) +CRC=2070044B E7D82D16 + +[07660B03456DD0F776F392EF3E05C481] +GoodName=TRON Demo (PD) [a1] +CRC=CB3FF554 8773CD0B + +[4D6E12E0AB62D4045B4934B6D7BB8BDC] +GoodName=TRON Demo (PD) +CRC=CB3FF554 8773CD0B + +[503C548F7B38A3721B93FD0ABF979019] +GoodName=TRSI Intro by Ayatollah (POM '99) (PD) +CRC=2DD07E20 24D40CD6 + +[192B715E8BC5972A4986DF21DC8BF357] +GoodName=Taz Express (E) (M6) [!] +CRC=AEBCDD54 15FF834A +Players=1 +Rumble=No + +[53DFA593019BDA070DD3CD5FC5B58436] +GoodName=Taz Express (E) (M6) [f1] (NTSC) +CRC=17679054 E235F4A7 +RefMD5=192B715E8BC5972A4986DF21DC8BF357 + +[AD47A9521988CEDD8D43097CFD9BE042] +GoodName=Taz Express (E) (M6) [f2] (NTSC) +CRC=00BC1D78 00709D53 +RefMD5=192B715E8BC5972A4986DF21DC8BF357 + +[7F244AFF8D729417E32B6A5B299AFDA5] +GoodName=Telefoot Soccer 2000 (F) [!] +CRC=D9042FBB FCFF997C +Players=4 +Rumble=No + +[8F96FF06D9B3C3219CEBA5CDB7CF19ED] +GoodName=Telefoot Soccer 2000 (F) [b1] +CRC=6440D7CE F6597A03 +RefMD5=7F244AFF8D729417E32B6A5B299AFDA5 + +[D1B6D277F9FAE2029A7532D8E1F4D6B2] +GoodName=Telefoot Soccer 2000 (F) [f1] (NTSC) +CRC=6440D7CE F6597A03 +RefMD5=7F244AFF8D729417E32B6A5B299AFDA5 + +[7C8EFCF4FBA28F9F5B5EA10A71283BF3] +GoodName=Tetris 64 (J) [!] +CRC=963ADBA6 F7D5C89B +Players=4 +Rumble=Yes + +[1587B17344A43532B791DCEB237D2BFC] +GoodName=Tetris 64 (J) [T+Ita] +CRC=963ADBA6 F7D5C89B + +[ECC06617156122882C4FA4BBCD241A4F] +GoodName=Tetris 64 (J) [b1] +CRC=963ADBA6 F7D5C89B + +[9036BB44A51A62CB0A74C288EBB850C7] +GoodName=Tetris 64 (J) [b2] +CRC=963ADBA6 F7D5C89B + +[8C9F139BF5FC0B7A0497F28241C6F819] +GoodName=Tetris Beta Demo by FusionMan (POM '98) (PD) [b1] +CRC=81361532 2AEB643F + +[674D416C2BD1EF0192BEE34AA260B21A] +GoodName=Tetris Beta Demo by FusionMan (POM '98) (PD) +CRC=81361532 2AEB643F + +[765A330D5CE2DBE7120C6C8E18A1487D] +GoodName=Tetrisphere (E) [!] +CRC=0FE684A9 8BB77AC4 +Players=2 +Rumble=No +SaveType=Eeprom 4KB + +[A87455244919BDA6E44FA32C7E72BFBA] +GoodName=Tetrisphere (E) [b1] +CRC=0FE684A9 8BB77AC4 +RefMD5=765A330D5CE2DBE7120C6C8E18A1487D + +[822154EE2B96BF78BCE2E46AF6578131] +GoodName=Tetrisphere (E) [b2] +CRC=0FE684A9 8BB77AC4 +RefMD5=765A330D5CE2DBE7120C6C8E18A1487D + +[3F88078E2D9DBF6C9372F6373CF9AE09] +GoodName=Tetrisphere (U) [!] +CRC=3C1FDABE 02A4E0BA +Players=2 +Rumble=No +SaveType=Eeprom 4KB + +[7211951FDF7DA809D5F3D51CA06CD465] +GoodName=Tetrisphere (U) [b1] +CRC=3C1FDABE 02A4E0BA +RefMD5=3F88078E2D9DBF6C9372F6373CF9AE09 + +[9F7527EE8A80DAE339DB769EAE707DCC] +GoodName=Tetrisphere (U) [t1] +CRC=4EF87A50 975A7CC7 +RefMD5=3F88078E2D9DBF6C9372F6373CF9AE09 + +[B11B30536D445AB6C7DC22C85C68A218] +GoodName=Textlight Demo by Horizon64 (PD) [b1] +CRC=41B1BF58 A1EB9BB7 + +[33CF09D5EAB2FB1242108A172E1844C2] +GoodName=Textlight Demo by Horizon64 (PD) +CRC=41B1BF58 A1EB9BB7 + +[DA934FF1A6CE9EEC70C235F879B23AFE] +GoodName=The Corporation 1st Intro by i_savant (PD) [b1] +CRC=44705CED 6FDFDE02 + +[B42C11B1DCBFC0AE42551021CD69AB22] +GoodName=The Corporation 1st Intro by i_savant (PD) +CRC=44705CED 6FDFDE02 + +[F6AE85B8CC2B643F37DE95D7F5682262] +GoodName=The Corporation 2nd Intro by TS_Garp (PD) [a1] +CRC=C3AB938D D48143B2 + +[EA9D71AF1508636E88D95AC1D525EF93] +GoodName=The Corporation 2nd Intro by TS_Garp (PD) [b1] +CRC=C3AB938D D48143B2 + +[756325378480E1252CB089110A689563] +GoodName=The Corporation 2nd Intro by TS_Garp (PD) +CRC=C3AB938D D48143B2 + +[D52E871B562AD000BA3728D9B45EC9CB] +GoodName=The Corporation XMAS Demo '99 by TS_Garp (PD) [b1] +CRC=93DA8551 D231E8AB + +[AF284AB7FF9363016782E99D00574E70] +GoodName=The Corporation XMAS Demo '99 by TS_Garp (PD) +CRC=93DA8551 D231E8AB + +[A09663B596F348D28AF846A51375EB81] +GoodName=Tigger's Honey Hunt (E) (M7) [!] +CRC=E0C4F72F 769E1506 +Players=1 +Rumble=No +SaveType=Flash RAM + +[F8636514B5B0EDEBF376C3111D24417A] +GoodName=Tigger's Honey Hunt (U) [!] +CRC=4EBFDD33 664C9D84 +Players=1 +Rumble=No +SaveType=Flash RAM + +[7B41F28A920112F17401D633B368BA0C] +GoodName=Tigger's Honey Hunt (U) [t1] +CRC=E972B385 7668D414 +RefMD5=F8636514B5B0EDEBF376C3111D24417A + +[7B261247150C431DE55AB371E8B46EA8] +GoodName=Tokisora Senshi Turok (J) [!] +CRC=916AE6B8 8817AB22 +Players=1 +Rumble=No +SaveType=Controller Pack + +[1B991CF41C70FF2C92FFBEFACABE8D03] +GoodName=Tom Clancy's Rainbow Six (E) [!] +CRC=4875AF3D 9A66D3A2 +Players=2 +Rumble=Yes + +[FC2D2F7EF02484EA0478A5EAFD0CBFF0] +GoodName=Tom Clancy's Rainbow Six (E) [b1] +CRC=4875AF3D 9A66D3A2 +RefMD5=1B991CF41C70FF2C92FFBEFACABE8D03 + +[C0612AA12888C10E9565A57EB2C3605D] +GoodName=Tom Clancy's Rainbow Six (E) [h1C] +CRC=4875AF3D 9A66D3A2 +RefMD5=1B991CF41C70FF2C92FFBEFACABE8D03 + +[AAD3D42A9E800780087009B16AFB1327] +GoodName=Tom Clancy's Rainbow Six (E) [o1] +CRC=4875AF3D 9A66D3A2 +RefMD5=1B991CF41C70FF2C92FFBEFACABE8D03 + +[15E4C1B4F3F459D4CAA7F7E2CF0C95DA] +GoodName=Tom Clancy's Rainbow Six (F) [!] +CRC=486BF335 034DCC81 +Players=2 +Rumble=Yes + +[FDC76A53B1056D3E50EA6A3E295FE4D1] +GoodName=Tom Clancy's Rainbow Six (G) [!] +CRC=8D412933 588F64DB +Players=2 +Rumble=Yes + +[80F3B1ABD9FB9AE73997489DB185A74D] +GoodName=Tom Clancy's Rainbow Six (U) [!] +CRC=392A0C42 B790E77D +Rumble=Yes + +[2CF9568A149177AC0B86378FBC8DCB71] +GoodName=Tom Clancy's Rainbow Six (U) [f1] (PAL) +CRC=8B79DBFD 0BB32AC0 +RefMD5=80F3B1ABD9FB9AE73997489DB185A74D + +[B9EF940408E1DFD63F867527E4212B9D] +GoodName=Tom Demo (PD) +CRC=5ECE09AE 8230C82D + +[46BE5D00682FCC1F7FC0FBA507E8E5C1] +GoodName=Tom and Jerry in Fists of Furry (E) (M6) [!] +CRC=2B4F4EFB 43C511FE +Players=2 +Rumble=Yes +SaveType=Eeprom 4KB + +[9EAA60F295DBA9A9687E3238DABA14EE] +GoodName=Tom and Jerry in Fists of Furry (E) (M6) [f1] (NTSC) +CRC=EC6F66AC 618EF742 +RefMD5=46BE5D00682FCC1F7FC0FBA507E8E5C1 + +[A63A9AF85BE8BB47C1741B8A37115354] +GoodName=Tom and Jerry in Fists of Furry (U) [!] +CRC=63E7391C E6CCEA33 +Players=2 +Rumble=Yes +SaveType=Eeprom 4KB + +[17D6D6DA5D03C9D295D72A212A719EB2] +GoodName=Tom and Jerry in Fists of Furry (U) [t1] +CRC=9BF2A817 EE20252A +RefMD5=A63A9AF85BE8BB47C1741B8A37115354 + +[3D3573A855835A98DE29D598C35590E0] +GoodName=Tonic Trouble (E) (M5) [!] +CRC=093F916E 4408B698 +Players=1 +Rumble=No +SaveType=Controller Pack + +[7D3E935156844DE0002DB875E1076A5C] +GoodName=Tonic Trouble (U) (V1.1) [!] +CRC=EF9E9714 C03B2C7D +Players=1 +Rumble=No +SaveType=Controller Pack + +[A6C5625FF127D9E741F595EBF3B3ABB9] +GoodName=Tonic Trouble (U) (V1.1) [b1] +CRC=EF9E9714 C03B2C7D +RefMD5=7D3E935156844DE0002DB875E1076A5C + +[012C9DAF61705F109392A85B2621CD42] +GoodName=Tonic Trouble (U) (V1.1) [f1] (PAL) +CRC=1671E7BC B7D756B9 +RefMD5=7D3E935156844DE0002DB875E1076A5C + +[1987E0F12DDD619F440CD9637DF7CC28] +GoodName=Tonic Trouble (U) (V1.1) [t1] +CRC=1671F4A0 5C0E7928 +RefMD5=7D3E935156844DE0002DB875E1076A5C + +[C9E9C4A18B1540C6B4111331D7C663B8] +GoodName=Tony Hawk's Pro Skater (E) [!] +CRC=9F8926A5 0587B409 +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[5ED7E392198A5FA56EE37EA9E93A8D50] +GoodName=Tony Hawk's Pro Skater (U) (V1.0) [!] +CRC=204EC022 B119D185 +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[30EC0EEA5C487E5609D9F9F356D21F27] +GoodName=Tony Hawk's Pro Skater (U) (V1.0) [t1] +CRC=85C52CA4 017EE9A6 +RefMD5=5ED7E392198A5FA56EE37EA9E93A8D50 + +[AFF424A1883DC7BB92C7B2EBE9342F85] +GoodName=Tony Hawk's Pro Skater (U) (V1.1) [!] +CRC=E0144180 650B78C9 +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[6BE030475C4DB52F273EF8A02B4DAFA8] +GoodName=Tony Hawk's Pro Skater 2 (E) [!] +CRC=84EAB557 C88A190F +Players=2 +Rumble=Yes + +[29974692808C112B306FBD259273DC96] +GoodName=Tony Hawk's Pro Skater 2 (U) [!] +CRC=99150E18 1266E6A5 +Players=2 +Rumble=Yes + +[9D4891BF26881C4541171B0235015FD4] +GoodName=Tony Hawk's Pro Skater 3 (U) +CRC=1A7F70B5 00B7B9FD +Players=4 +Rumble=Yes + +[B60D26C2C2242BFF61F76469FC272D2A] +GoodName=Top Gear Hyper Bike (Beta) +CRC=75FBDE20 A3189B31 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[0072538EF925645DB310F8E23A480B89] +GoodName=Top Gear Hyper Bike (E) [!] +CRC=5F3F49C6 0DC714B0 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[561B438F6E8240BEF1DAEB36AAE72675] +GoodName=Top Gear Hyper Bike (E) [b1] +CRC=5F3F49C6 0DC714B0 +RefMD5=0072538EF925645DB310F8E23A480B89 + +[4347174BB415CA970F2D50DF2973F656] +GoodName=Top Gear Hyper Bike (J) [!] +CRC=845B0269 57DE9502 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[7258F4AB367B025C95A4F476C461E717] +GoodName=Top Gear Hyper Bike (U) [!] +CRC=8ECC02F0 7F8BDE81 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[6C65A252F227AEF18DF2DD3CE04CC821] +GoodName=Top Gear Overdrive (E) [!] +CRC=D09BA538 1C1A5489 +Players=4 +Rumble=Yes +SaveType=Eeprom 4KB + +[11D6FFF288DE1BD61CCBD7CCA0C4A97B] +GoodName=Top Gear Overdrive (E) [h1C] +CRC=D09BA538 1C1A5489 +RefMD5=6C65A252F227AEF18DF2DD3CE04CC821 + +[B5691794A851D8B603F0C741D44AA244] +GoodName=Top Gear Overdrive (J) [!] +CRC=0578F24F 9175BF17 +Players=4 +Rumble=Yes +SaveType=Eeprom 4KB + +[8C0F46FEF9A6034FCF0B7D6952FFEC53] +GoodName=Top Gear Overdrive (J) [b1] +CRC=0578F24F 9175BF17 +RefMD5=B5691794A851D8B603F0C741D44AA244 + +[7818696426C0A429FBFCCC4EFE8D5570] +GoodName=Top Gear Overdrive (U) [!] +CRC=D741CD80 ACA9B912 +Players=4 +Rumble=Yes +SaveType=Eeprom 4KB + +[773FD446DA7F4E392907505053BF2A42] +GoodName=Top Gear Overdrive (U) [o1] +CRC=D741CD80 ACA9B912 +RefMD5=7818696426C0A429FBFCCC4EFE8D5570 + +[211256ABBC0844D9152D6A7FFA9E48BD] +GoodName=Top Gear Overdrive (U) [t1] +CRC=0F5FD10B AAEDEBEB +RefMD5=7818696426C0A429FBFCCC4EFE8D5570 + +[1698508F521280D0A80E078EC981D4AC] +GoodName=Top Gear Rally (E) [!] +CRC=7F43E701 536328D1 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[48D6C194AE106018DDFC3486A8B347F7] +GoodName=Top Gear Rally (E) [b1] +CRC=7F43E701 536328D1 +RefMD5=1698508F521280D0A80E078EC981D4AC + +[108F6609CB131830EC4C67F4A8A71D30] +GoodName=Top Gear Rally (E) [h1C] +CRC=7F43E701 536328D1 +RefMD5=1698508F521280D0A80E078EC981D4AC + +[6E0AF13DCEFEE6A11C4D7262206D6D2D] +GoodName=Top Gear Rally (J) [!] +CRC=0E596247 753D4B8B +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[6F7030284B6BC84A49E07DA864526B52] +GoodName=Top Gear Rally (U) [!] +CRC=62269B3D FE11B1E8 +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[FA88969ECFA72358EF1C045035442F5C] +GoodName=Top Gear Rally (U) [b1] +CRC=62269B3D FE11B1E8 +RefMD5=6F7030284B6BC84A49E07DA864526B52 + +[E9E3680C47CE093A3F0765539F31C6AE] +GoodName=Top Gear Rally (U) [b2] +CRC=62269B3D FE11B1E8 +RefMD5=6F7030284B6BC84A49E07DA864526B52 + +[194CE13B2B6B1F584587A68CC2F398DC] +GoodName=Top Gear Rally (U) [b3] +CRC=62269B3D FE11B1E8 +RefMD5=6F7030284B6BC84A49E07DA864526B52 + +[4FCD85C487E1FBEDFD85E27F991D1FA6] +GoodName=Top Gear Rally (U) [o1] +CRC=62269B3D FE11B1E8 +RefMD5=6F7030284B6BC84A49E07DA864526B52 + +[C33CD926E1E71F39F7238AF7B9E0DC5C] +GoodName=Top Gear Rally 2 (Beta) +CRC=EFDF9140 A4168D6B +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[44C4566572DC0662D4299AB5B19043AE] +GoodName=Top Gear Rally 2 (E) [!] +CRC=BEBAB677 51B0B5E4 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[B10D781EC625CA45713FD34E5096C24A] +GoodName=Top Gear Rally 2 (J) [!] +CRC=CFEF2CD6 C9E973E6 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[1FA409FCAC007DDECCC4CF439A0D8DAE] +GoodName=Top Gear Rally 2 (U) [!] +CRC=BE5973E0 89B0EDB8 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[4648C4F656BD4A74647DF6A7A2985F37] +GoodName=Top Gear Rally 2 (U) [f1] (PAL) +CRC=1C952873 FDA4238B +RefMD5=1FA409FCAC007DDECCC4CF439A0D8DAE + +[CAA7CAA9ADFB4B8E4B2DBED88F963D07] +GoodName=TopGun Demo by Horizon64 (PD) +CRC=E8BF8416 F2D9DA43 + +[5F2C9E5E39AB09311D96E6C751184B6B] +GoodName=Toy Story 2 (E) [!] +CRC=CCEB3858 26952D97 +Players=1 +Rumble=Yes +SaveType=Controller Pack + +[FA0F12C15B3655F9F56888C3249B1CED] +GoodName=Toy Story 2 (F) [!] +CRC=CB93DB97 7F5C63D5 +Players=1 +Rumble=Yes +SaveType=Controller Pack + +[3F40F37B0464DD065067523FB21016DD] +GoodName=Toy Story 2 (G) [!] +CRC=782A9075 E552631D +Players=1 +Rumble=Yes +SaveType=Controller Pack + +[B44E9C2D9D2F2DE3AF4793B824CCF936] +GoodName=Toy Story 2 (U) [!] +CRC=A150743E CF2522CD +Players=1 +Rumble=Yes +SaveType=Controller Pack + +[9E4F62BD672E3601F1BBF9CDAB791F9F] +GoodName=Toy Story 2 (U) [f1] (PAL) +CRC=161545FE A3C44C28 +RefMD5=B44E9C2D9D2F2DE3AF4793B824CCF936 + +[F551ADA6C6FC1877FCA0515DF4F515DF] +GoodName=Toy Story 2 (U) [t1] +CRC=1416FEBB 93472028 +RefMD5=B44E9C2D9D2F2DE3AF4793B824CCF936 + +[3D22D5BD7997293612ECDD3046BEBA13] +GoodName=Transformers - Beast Wars Metals 64 (J) [!] +CRC=91691C3D F4AC5B4D +Players=2 +Rumble=Yes +SaveType=None + +[6D38909FAA2840FC409AFA221489DE49] +GoodName=Transformers - Beast Wars Transmetal (U) [!] +CRC=4D79D316 E8501B33 +Players=2 +Rumble=Yes +SaveType=None + +[6F2C37A20E6ECCB657FBFC4BA36A34BB] +GoodName=Triple Play 2000 (U) [!] +CRC=FE4B6B43 081D29A7 +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[25E03763FC8A388A33871C58DFEB7C0E] +GoodName=Tristar and Lightforce Quake Intro by Ayatollah & Mike (PD) +CRC=F4D89C08 3F34930D + +[A0657BC99E169153FD46AECCFDE748F3] +GoodName=Tsumi to Batsu - Hoshi no Keishousha (J) [!] +CRC=B6BC0FB0 E3812198 + +[13FAA58604597E4EDC608070F8E0AE24] +GoodName=Turok - Dinosaur Hunter (E) (V1.0) [!] +CRC=2F7009DD FC3BAC53 +Players=1 +Rumble=No +SaveType=Controller Pack + +[6D5147A9CD7DDD0F1FA8B8BDA439A734] +GoodName=Turok - Dinosaur Hunter (E) (V1.0) [b1] +CRC=665F09DD FC3BAC53 +RefMD5=13FAA58604597E4EDC608070F8E0AE24 + +[E887BEE5B1DE4E4D92ADA183A245150E] +GoodName=Turok - Dinosaur Hunter (E) (V1.0) [h1C] +CRC=2F7009DD FC3BAC53 +RefMD5=13FAA58604597E4EDC608070F8E0AE24 + +[992BA72F4A1E9C51934FF345CDD0D90C] +GoodName=Turok - Dinosaur Hunter (E) (V1.1) [!] +CRC=2F700DCD 176CC5C9 +Players=1 +Rumble=No +SaveType=Controller Pack + +[548FC0E6035B65BC2108255039859934] +GoodName=Turok - Dinosaur Hunter (E) (V1.2) [!] +CRC=2F700DCD 176CC5C9 +Players=1 +Rumble=No +SaveType=Controller Pack + +[0C0BFD1038EDA4F5C958DC362CDFF2D6] +GoodName=Turok - Dinosaur Hunter (G) [!] +CRC=665FD963 B5CC6612 +Players=1 +Rumble=No +SaveType=Controller Pack + +[AE5107EFDD3C210E1EDD4ACD9B3CAC31] +GoodName=Turok - Dinosaur Hunter (U) (V1.0) [!] +CRC=2F70F10D 5C4187FF +Players=1 +Rumble=No +SaveType=Controller Pack + +[E5B207E7C8DBD8BAF9B42C96EF3C42E8] +GoodName=Turok - Dinosaur Hunter (U) (V1.0) [b1] +CRC=2F70F10D 5C4187FF +RefMD5=AE5107EFDD3C210E1EDD4ACD9B3CAC31 + +[7BBD5A1594526DE1CE6A16F4FAF82E7D] +GoodName=Turok - Dinosaur Hunter (U) (V1.0) [h1C] +CRC=2F70F10D 5C4187FF +RefMD5=AE5107EFDD3C210E1EDD4ACD9B3CAC31 + +[9D258DF027ED369886A0249BFCA936BD] +GoodName=Turok - Dinosaur Hunter (U) (V1.0) [o1] +CRC=2F70F10D 5C4187FF +RefMD5=AE5107EFDD3C210E1EDD4ACD9B3CAC31 + +[E7916845B46C3482CF4843968370557E] +GoodName=Turok - Dinosaur Hunter (U) (V1.0) [t1] +CRC=9542E183 B1D245E6 +RefMD5=AE5107EFDD3C210E1EDD4ACD9B3CAC31 + +[3DC541C0B97DB9C95A6AA8C2DED27F4A] +GoodName=Turok - Dinosaur Hunter (U) (V1.0) [t2] +CRC=9542E183 B1D245E6 +RefMD5=AE5107EFDD3C210E1EDD4ACD9B3CAC31 + +[37260287D59FE4EC6049C1D22B5614E6] +GoodName=Turok - Dinosaur Hunter (U) (V1.1) [!] +CRC=2F700DCD 176CC5C9 +Players=1 +Rumble=No +SaveType=Controller Pack + +[039875B92C0E4FEF9797EC1744877B17] +GoodName=Turok - Dinosaur Hunter (U) (V1.2) [!] +CRC=2F700DCD 176CC5C9 +Players=1 +Rumble=No +SaveType=Controller Pack + +[72A6AA28608EE93A1CB6FEB0A5F4C28C] +GoodName=Turok - Legenden des Verlorenen Landes (G) [!] +CRC=66E4FA0F DE88C7D0 +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[241CF94BED487FFF62FFB7B846DA46AB] +GoodName=Turok - Rage Wars (E) (M3) (Eng-Fre-Ita) +CRC=B6BE20A5 FACAF66D +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[DBA166A42710F40DC78DC52EB37B0BE6] +GoodName=Turok - Rage Wars (E) [!] +CRC=1EA26214 E790900F +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[CF5B28578FD62FA1FF8690079F5D68F5] +GoodName=Turok - Rage Wars (U) [!] +CRC=ADB9498B DAF28F55 +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[07E123E104BA7B335B53932EDB2CFB2F] +GoodName=Turok - Rage Wars (U) [f1] (PAL) +CRC=700694EA 636C43D5 +RefMD5=CF5B28578FD62FA1FF8690079F5D68F5 + +[CA825227E9E203E8429600189825AD74] +GoodName=Turok - Rage Wars (U) [f2] (PAL) +CRC=72618906 0EDC784B +RefMD5=CF5B28578FD62FA1FF8690079F5D68F5 + +[CE72237707F481CFE97FDE330C2AFCD6] +GoodName=Turok 2 - Seeds of Evil (E) (Kiosk Demo) [!] +CRC=E8C95AFC 35D121DA +Players=4 +SaveType=None +Rumble=Yes + +[144B10A484A22367FD2679529DBD2FED] +GoodName=Turok 2 - Seeds of Evil (E) (M4) [!] +CRC=2E0E7749 B8B49D59 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[E5A39521FA954EB97B96AC2154A5FD7A] +GoodName=Turok 2 - Seeds of Evil (E) [!] +CRC=E0B92B94 80E87CBD +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[AC1C00167B95929F8EE40DFACB49BB57] +GoodName=Turok 2 - Seeds of Evil (E) [b1] +CRC=E0B92B94 80E87CBD +RefMD5=E5A39521FA954EB97B96AC2154A5FD7A + +[B932116C967795076B5C112841AB4427] +GoodName=Turok 2 - Seeds of Evil (G) [!] +CRC=FE05840B 9393320C +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[3BD42F6AEC477C056E1AFEBB3515495C] +GoodName=Turok 2 - Seeds of Evil (U) (Kiosk Demo) [!] +CRC=E8C95AFC 35D121DA +Players=4 +Rumble=Yes +SaveType=None + +[4250FF0265AD72FC798E6ABA61CFCD0E] +GoodName=Turok 2 - Seeds of Evil (U) (Kiosk Demo) (Gore On Hack) +CRC=AAD95AFC BB3A44AC +RefMD5=3BD42F6AEC477C056E1AFEBB3515495C + +[4EA0F7563F2EAEB3D46E860C12FABFCB] +GoodName=Turok 2 - Seeds of Evil (U) (Kiosk Demo) [h1C] +CRC=E8C95AFC 35D121DA +RefMD5=3BD42F6AEC477C056E1AFEBB3515495C + +[166221365DB70D446C4206083D422DD1] +GoodName=Turok 2 - Seeds of Evil (U) (V1.1) +CRC=E0B92B94 B9A7E025 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[FAD4DA8E17CE12F68CDF29180CDD4A90] +GoodName=Turok 2 - Seeds of Evil (U) (V1.0) [!] +CRC=49088A11 6494957E +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[8DC201A0A9CFD1D2C85EE2B42D8AC49A] +GoodName=Turok 2 - Seeds of Evil (U) (V1.0) [t1] +CRC=544E3629 875BDD4A +RefMD5=FAD4DA8E17CE12F68CDF29180CDD4A90 + +[72BA2C693EFA5FF3B80374CDBD0C957B] +GoodName=Turok 2 - Seeds of Evil (U) (V1.0) [t2] +CRC=544E3629 875BDD4A +RefMD5=FAD4DA8E17CE12F68CDF29180CDD4A90 + +[401C0DBDF49A64294DAA2BC8607245DD] +GoodName=Turok 2 - Seeds of Evil (U) (V1.0) [t3] +CRC=544E3629 875BDD4A +RefMD5=FAD4DA8E17CE12F68CDF29180CDD4A90 + +[279EC83BD60A3CCE69A1DB22B0A5C318] +GoodName=Turok 3 - Shadow of Oblivion (E) [!] +CRC=6A162FF2 2093704C +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[C38ACBAE773CC3845EA354421E171998] +GoodName=Turok 3 - Shadow of Oblivion (U) (Beta-WIP) +CRC=D25C1211 13EEBF67 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[0A3A4C761960F7D648AFA60B1E565C7C] +GoodName=Turok 3 - Shadow of Oblivion (U) (Beta) [h1C] +CRC=D25C1211 13EEBF67 +RefMD5=69CE88C46A7C829C6F54004DE93EFCEF + +[69CE88C46A7C829C6F54004DE93EFCEF] +GoodName=Turok 3 - Shadow of Oblivion (U) (Beta) +CRC=37FA8F16 5F824D37 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[1211C556D77B169D81A666A9661E1777] +GoodName=Turok 3 - Shadow of Oblivion (U) [!] +CRC=89A579F1 667E97EF +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[8A5F9B3308107C253EC5DCA198F55C83] +GoodName=Turok 3 - Shadow of Oblivion (U) [t1] +CRC=6192E59D 538A78CF +RefMD5=1211C556D77B169D81A666A9661E1777 + +[A74738D03ACA4E51690408D203E86D49] +GoodName=Twintris by Twinsen (POM '98) (PD) +CRC=37B8F920 A58BB3EF + +[420C9FDBAE15767C5E584070209FF253] +GoodName=Twisted Edge Extreme Snowboarding (E) [!] +CRC=E688A5B8 B14B3F18 +SaveType=Controller Pack +Players=2 +Rumble=Yes + +[4F0E2AF205BEEB49270154810660FF37] +GoodName=Twisted Edge Extreme Snowboarding (E) [b1] +CRC=BBC99D32 117DAA80 +RefMD5=420C9FDBAE15767C5E584070209FF253 + +[FDE5F910974A8B9C561A27B07E68F244] +GoodName=Twisted Edge Extreme Snowboarding (E) [h1C] +CRC=E688A5B8 B14B3F18 +RefMD5=420C9FDBAE15767C5E584070209FF253 + +[9DF6C2C97FA34A978EF3CB77631536FE] +GoodName=Twisted Edge Extreme Snowboarding (U) [!] +CRC=BBC99D32 117DAA80 +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[0B0DF8EC747BF99F3A55A3300CE8BC0D] +GoodName=U64 (Chrome) Demo by Horizon64 (PD) [a1] +CRC=7739A454 A2F52A66 + +[9B4EFC228C894E1BA80D7D11FDA4E037] +GoodName=U64 (Chrome) Demo by Horizon64 (PD) [a1][b1] +CRC=7739A454 A2F52A66 + +[DFB437BFB32864A17E903FEDE9EC3A27] +GoodName=U64 (Chrome) Demo by Horizon64 (PD) [b1] +CRC=95013CCC 73F7C072 + +[33EFC323AA05F522CEF2324CC1D3F5DD] +GoodName=U64 (Chrome) Demo by Horizon64 (PD) +CRC=7739A454 A2F52A66 + +[A56BEF4C7E6899A96F1F33424B434790] +GoodName=U64 (Chrome) Demo by Horizon64 (older) (PD) [b1] +CRC=95013CCC 73F7C072 + +[2628818AF2FEE3C649AAF8627981A63D] +GoodName=U64 (Chrome) Demo by Horizon64 (older) (PD) +CRC=95013CCC 73F7C072 + +[FFEB5C1A85BABBBE60F2FEBA2B35C893] +GoodName=Uchhannanchan no Hono no Challenger - Denryu IraIra Bou (J) [!] +CRC=28D5562D E4D5AE50 +Players=4 + +[07B7A5CFDE9BC43F02A622387C5B5C58] +GoodName=Uchhannanchan no Hono no Challenger - Denryu IraIra Bou (J) [h1C] +CRC=28D5562D E4D5AE50 +RefMD5=FFEB5C1A85BABBBE60F2FEBA2B35C893 + +[6AFA476787B762DC08F5B9EEB237C4EE] +GoodName=Uchhannanchan no Hono no Challenger - Denryu IraIra Bou (J) [h2C] +CRC=28D5562D E4D5AE50 +RefMD5=FFEB5C1A85BABBBE60F2FEBA2B35C893 + +[D42E4496BEA3C61E353643C8438CD9C7] +GoodName=Uchhannanchan no Hono no Challenger - Denryu IraIra Bou (J) [o1] +CRC=28D5562D E4D5AE50 +RefMD5=FFEB5C1A85BABBBE60F2FEBA2B35C893 + +[CEEDAB23299FA003F32975A4C1E407E3] +GoodName=Ultra Demo Bootcode by Locke^ (PD) [h1C] +CRC=ED42A2D4 7A71CD91 + +[B882EDA9CBF832BEEA2641E442A79EDD] +GoodName=Ultra Demo Bootcode by Locke^ (PD) +CRC=ED42A2D4 7A71CD91 + +[7E6456E104503B51A97735C8FF349E4C] +GoodName=Ultra Demo by Locke^ (PD) [a1] +CRC=ED42A2D4 7A71CD91 + +[2E2C990D8BBAEE7E0681FDC89C29C0F3] +GoodName=Ultra Demo by Locke^ (PD) +CRC=ED42A2D4 7A71CD91 + +[1DE07FCA04FB0810D95B8AE4DA173A2E] +GoodName=UltraMSX2 V1.0 by Jos Kwanten (PD) [f1] (V64) +CRC=31C41A8B 544057AE + +[6A11F7EB319CF603AB30A281E0639126] +GoodName=UltraMSX2 V1.0 by Jos Kwanten (PD) +CRC=4E7DE4EF 0DEC3712 + +[FCA7BE078D6DC68AC6F2E1B7B4369720] +GoodName=UltraMSX2 V1.0 w-F1 Spirit by Jos Kwanten (PD) +CRC=504ABA0A 269AA7F4 + +[D2BD19A0873A6900AEF07ECCE103710C] +GoodName=UltraMSX2 V1.0 w-Salamander by Jos Kwanten (PD) +CRC=FF922478 570B5673 + +[8E3D79FD6C089F88ED7A2CC1CDBDD535] +GoodName=UltraSMS V1.0 by Jos Kwanten (PD) [f1] (V64) +CRC=CD29E6E5 4533F032 + +[8095B5926A9FA7A0C9DA7B46731513A1] +GoodName=UltraSMS V1.0 by Jos Kwanten (PD) +CRC=F291B959 A24CBCAF + +[27CB290FAB6C32FAA75EB0E53BE73418] +GoodName=Ultrafox 64 by Megahawks (PD) +CRC=66D8DE56 C2AA25B2 +Players=0 +SaveType=None +Rumble=No +Status=3 + +[C0B245E95A0CE736E1401A2183C3BBD1] +GoodName=Unix SRAM-Upload Utility 1.0 by Madman (PD) +CRC=5F44492A 18552A0A + +[DCAC12EB5832D4A489188330EB9EC387] +GoodName=V-Rally Edition 99 (E) (M3) [!] +CRC=636E6B19 E57DDC5F +Players=2 +Rumble=Yes +SaveType=Eeprom 4KB + +[7DCEAFF24BB1BB3D9B8FE9B78CCC7048] +GoodName=V-Rally Edition 99 (E) (M3) [f1] (NTSC) +CRC=75CF4CCD F47E10F6 +RefMD5=DCAC12EB5832D4A489188330EB9EC387 + +[8541D7A8737BE09C52D4EC1274DE2A91] +GoodName=V-Rally Edition 99 (J) [!] +CRC=4D0224A5 1BEB5794 +Players=2 +Rumble=Yes +SaveType=Eeprom 4KB + +[0C3448A9D85300ACB9C5556F27A84B23] +GoodName=V-Rally Edition 99 (U) [!] +CRC=3C059038 C8BF2182 +Players=2 +Rumble=Yes +SaveType=Eeprom 4KB + +[9768A9874D8329569F8FB27EC0AB723B] +GoodName=V-Rally Edition 99 (U) [f1] (PAL) +CRC=6F48FF84 754B4549 +RefMD5=0C3448A9D85300ACB9C5556F27A84B23 + +[7E0AC3917227EDF51132FBEBB867FF9B] +GoodName=V64Jr 512M Backup Program by HKPhooey (PD) +CRC=760EF304 AD6D6A7C + +[FD523AF9832B5A17F0EB96ED2A77E77B] +GoodName=V64Jr Backup Tool V0.2b_Beta by RedboX (PD) +CRC=F11B663A 698824C0 + +[5BAA85768F2410C61FBE2DFB62C3D836] +GoodName=V64Jr Backup Tool by WT_Riker (PD) +CRC=4BD245D4 4202B322 + +[19BA19834F948EEE3828640246405B5D] +GoodName=V64Jr Flash Save Util by CrowTRobo (PD) +CRC=6FC4EEBC 125BF459 + +[1A232A07B0D2A102CA528E75CB7BBA22] +GoodName=VNES64 + Galaga (PD) +CRC=DCBE12CD FCCB5E58 +Status=0 +SaveType=Controller Pack + +[495E0B30318FC67978D68BD034165981] +GoodName=VNES64 + Mario (PD) +CRC=66807E77 EBEA2D76 +Status=0 +SaveType=Controller Pack + +[2953091D648ED1B60A67200B17A9410D] +GoodName=VNES64 + Test Cart (PD) +CRC=4537BDFF D1ECB425 + +[BE804A0317F138775454405155C1D9A5] +GoodName=VNES64 V0.1 by Jean-Luc Picard (POM '98) (PD) +CRC=4537BDFF D1ECB425 +Status=0 +SaveType=Controller Pack + +[062C3AD13478D5C75B4E8DB2FFD500DC] +GoodName=VNES64 V0.12 by Jean-Luc Picard (PD) +CRC=0E4B8C92 7F47A9B8 +Status=0 +SaveType=Controller Pack + +[B61F53695517D380EB7240331A2342C2] +GoodName=Vector Demo by Destop (POM '99) (PD) +CRC=1CEACBA0 42BC06D6 + +[A95442CE25EEB3BD31CEF8525B9936FD] +GoodName=View N64 Test Program (PD) [b1] +CRC=A38F7AA6 03A48A45 + +[CF17AF84662E1457E61AD54575D50D20] +GoodName=View N64 Test Program (PD) +CRC=34B493C9 07654185 + +[DF011E19F41B1B19C21F1E77E13780B7] +GoodName=Vigilante 8 (E) [!] +CRC=151F79F4 8EEDC8E5 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[637B9A40BED777FC96EB1BD07EA74783] +GoodName=Vigilante 8 (E) [h1C] +CRC=151F79F4 8EEDC8E5 +RefMD5=DF011E19F41B1B19C21F1E77E13780B7 + +[FF9F85C50982DBDBA9853A8915321D31] +GoodName=Vigilante 8 (F) [!] +CRC=E2BC82A2 591CD694 +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[B69B84083D1B4EC99A465B3067F74417] +GoodName=Vigilante 8 (F) [b1] +CRC=E2BC82A2 591CD694 +RefMD5=FF9F85C50982DBDBA9853A8915321D31 + +[37B430EE16167831C6C6292994F93277] +GoodName=Vigilante 8 (G) [!] +CRC=6EDA5178 D396FEC1 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[D616ADF6441ACBBD0E6BEF023A8F6031] +GoodName=Vigilante 8 (U) [!] +CRC=EA71056A E4214847 +Players=4 +SaveType=Controller Pack +Rumble=Yes + +[9F42209E413A1A92C788BF7BC26BFB7B] +GoodName=Vigilante 8 (U) [b1] +CRC=5573C64D 905B49FA +RefMD5=D616ADF6441ACBBD0E6BEF023A8F6031 + +[5DDCE4475A98F7BA9CCE2F255723EB31] +GoodName=Vigilante 8 (U) [b2] +CRC=EA71056A E4214847 +RefMD5=D616ADF6441ACBBD0E6BEF023A8F6031 + +[B6154ECD50053CA96953176404B07824] +GoodName=Vigilante 8 (U) [f1] (PAL) +CRC=4FAFC64B B7DBE63A +RefMD5=D616ADF6441ACBBD0E6BEF023A8F6031 + +[F747B178FFAB97EE8545F7E6EFAEF7CA] +GoodName=Vigilante 8 (U) [f2] (PAL) +CRC=44C54A0B 22C0B63A +RefMD5=D616ADF6441ACBBD0E6BEF023A8F6031 + +[829E4F5DDECED5DB6C64E346EDA47E5C] +GoodName=Vigilante 8 (U) [t1] +CRC=5573C64D 905B49FA +RefMD5=D616ADF6441ACBBD0E6BEF023A8F6031 + +[47661EF1964524B6319B759913F08B62] +GoodName=Vigilante 8 - 2nd Offence (E) [!] +CRC=DD10BC7E F900B351 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[60CDF7445FAD2ABA05C958F46691501B] +GoodName=Vigilante 8 - 2nd Offense (U) [!] +CRC=F5C5866D 052713D9 +Players=4 +Rumble=Yes +SaveType=Controller Pack + +[5E30D0208FC4CB810A464E5DEFFB29A3] +GoodName=Vigilante 8 - 2nd Offense (U) [f1] (PAL) +CRC=098D46A2 D1A4CF3B +RefMD5=60CDF7445FAD2ABA05C958F46691501B + +[C3005D76AF42E929E5C67421A19F8235] +GoodName=Violence Killer - Turok New Generation (J) [!] +CRC=60006C98 2605A381 +Players=4 +Rumble=No +SaveType=Controller Pack + +[50272F8EA99E4E06ADD8CCAB5F5A4F41] +GoodName=Violence Killer - Turok New Generation (J) [b1] +CRC=60006C98 2605A381 +RefMD5=C3005D76AF42E929E5C67421A19F8235 + +[E790BE1A5B883BEBA44BC0D2666C65F5] +GoodName=Virtual Chess 64 (E) (M6) [!] +CRC=2FDAA221 A588A7CE +Players=2 +Rumble=No +SaveType=Controller Pack + +[4166D03402397A56043AC2CD45F4CB87] +GoodName=Virtual Chess 64 (E) (M6) [b1] +CRC=2FDAA221 A588A7CE +RefMD5=E790BE1A5B883BEBA44BC0D2666C65F5 + +[C5594DEFBCFE16D56284C66FDE49E540] +GoodName=Virtual Chess 64 (E) (M6) [b2] +CRC=2FDAA221 A588A7CE +RefMD5=E790BE1A5B883BEBA44BC0D2666C65F5 + +[88D89282B2346F98C7F30850B061D486] +GoodName=Virtual Chess 64 (E) (M6) [o1] +CRC=2FDAA221 A588A7CE +RefMD5=E790BE1A5B883BEBA44BC0D2666C65F5 + +[CB2B7214BE1084F2BFAEE556B0B4FD2C] +GoodName=Virtual Chess 64 (E) (M6) [o1][h1C] +CRC=2FDAA221 A588A7CE +RefMD5=E790BE1A5B883BEBA44BC0D2666C65F5 + +[F8A35270279B277586D7210FD15134FF] +GoodName=Virtual Chess 64 (U) (M3) [!] +CRC=82B3248B E73E244D +Players=2 +Rumble=No +SaveType=Controller Pack + +[F05BD2DAD01F3E354713380AAFFB63E9] +GoodName=Virtual Chess 64 (U) (M3) [b1] +CRC=82B3248B E73E244D +RefMD5=F8A35270279B277586D7210FD15134FF + +[C252FEC96171ABD07A6C5B99B74924D4] +GoodName=Virtual Chess 64 (U) (M3) [b1][o1] +CRC=82B3248B E73E244D +RefMD5=F8A35270279B277586D7210FD15134FF + +[F41FCA7F185B3EC45ED90491BC8C0983] +GoodName=Virtual Chess 64 (U) (M3) [f1] (PAL) +CRC=46F3248B 534F2F61 +RefMD5=F8A35270279B277586D7210FD15134FF + +[E62751EFDE5312ED12DEC6C9FDCBF062] +GoodName=Virtual Chess 64 (U) (M3) [f1][o1] +CRC=46F3248B 534F2F61 +RefMD5=F8A35270279B277586D7210FD15134FF + +[0343B990F58CD816D96FBE5D5E710C82] +GoodName=Virtual Chess 64 (U) [o1] +CRC=82B3248B E73E244D +RefMD5=F8A35270279B277586D7210FD15134FF + +[AB68FB43F012C1A45AF1DBCC8E8C109C] +GoodName=Virtual Pool 64 (E) [!] +CRC=98F9F2D0 03D9F09C +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[C4FD61C707977F1BF48DC15E31BD2FB1] +GoodName=Virtual Pool 64 (E) [o1] +CRC=98F9F2D0 03D9F09C +RefMD5=AB68FB43F012C1A45AF1DBCC8E8C109C + +[6D3DB67319DA339DF4B68AD0084904D5] +GoodName=Virtual Pool 64 (U) [!] +CRC=4E4A7643 A37439D7 +Players=2 +Rumble=Yes +SaveType=Controller Pack + +[C6855DF00BD5BE8A41DCE809093EE40B] +GoodName=Virtual Pool 64 (U) [o1] +CRC=4E4A7643 A37439D7 +RefMD5=6D3DB67319DA339DF4B68AD0084904D5 + +[90002501777E3237739F5ED9B0E349E2] +GoodName=Virtual Pro Wrestling 2 - Oudou Keishou (J) [!] +CRC=CD094235 88074B62 +Players=4 +Rumble=Yes + +[5E6202200AF40A8F026780EDFE1E15D0] +GoodName=Virtual Pro Wrestling 64 (J) [!] +CRC=045C08C4 4AFD798B +Players=4 +Rumble=Yes + +[7FDC16C96B517D4E433CF7353B22FBA6] +GoodName=Virtual Pro Wrestling 64 (J) [b1] +CRC=045C08C4 4AFD798B +RefMD5=5E6202200AF40A8F026780EDFE1E15D0 + +[290BE44B47110A011523A343786A15A0] +GoodName=Virtual Pro Wrestling 64 (J) [f1] +CRC=B3CD11F6 60725EB0 +RefMD5=5E6202200AF40A8F026780EDFE1E15D0 + +[9B241103CE0F13CAD5FE522DF67ED88B] +GoodName=Virtual Pro Wrestling 64 (J) [f2] +CRC=B3CD11F6 60725EB0 +RefMD5=5E6202200AF40A8F026780EDFE1E15D0 + +[1D2CB88BBCB67E12289B74F5BD88AE4C] +GoodName=Virtual Pro Wrestling 64 (J) [h1C] +CRC=045C08C4 4AFD798B +RefMD5=5E6202200AF40A8F026780EDFE1E15D0 + +[35BF5C390AF1AD730E00EB618AED7B72] +GoodName=Virtual Springfield Site Intro by Presten (PD) +CRC=4F55D05C 0CD66C91 + +[02AED169EB579494ACE75D22E10D789B] +GoodName=WCW Backstage Assault (U) [!] +CRC=396F5ADD 6693ECA7 +Players=4 +SaveType=Controller Pack + +[9E943752BCF4FBA9CA3028E596F4EB4A] +GoodName=WCW Mayhem (E) [!] +CRC=AA7B0658 9C96937B +Players=4 +SaveType=Controller Pack + +[F1AF35375519E97BB7C0E37E2F68416E] +GoodName=WCW Mayhem (E) [h1C] +CRC=AA7B0658 9C96937B +RefMD5=9E943752BCF4FBA9CA3028E596F4EB4A + +[87BF3784709CD09693CD7BCC08460C63] +GoodName=WCW Mayhem (U) [!] +CRC=33BE8CD6 EC186912 +Players=4 +SaveType=Controller Pack + +[5D7368D95B89F451E68F0832ED2BA8FF] +GoodName=WCW Mayhem (U) [f1] (PAL) +CRC=2AD07230 7A0719F7 +RefMD5=87BF3784709CD09693CD7BCC08460C63 + +[1E9FEAD701FE5AAAA248D4713891775D] +GoodName=WCW Nitro (U) [!] +CRC=D4C45A1A F425B25E +Players=4 +SaveType=Controller Pack + +[EC097EB33BAD93A8AC6E15F7839762AB] +GoodName=WCW Nitro (U) [b3] +CRC=D4C45A1A F425B25E +Players=4 +SaveType=Controller Pack + +[BC8BA67065FDBAA731DEFC866D25B8C2] +GoodName=WCW Nitro (U) [b1] +CRC=D4C45A1A F425B25E +RefMD5=1E9FEAD701FE5AAAA248D4713891775D + +[CE86CE535A5B55AE4A0E6CC942701082] +GoodName=WCW Nitro (U) [b2] +CRC=5DDB495C CE6E5573 +RefMD5=1E9FEAD701FE5AAAA248D4713891775D + +[8524D92A742BC9D0D6F072F9F80E887C] +GoodName=WCW Nitro (U) [f1] (PAL) +CRC=85DB4944 43ADE940 +RefMD5=1E9FEAD701FE5AAAA248D4713891775D + +[A6A0109023837C4ED5CAC62F4A66ABA6] +GoodName=WCW Nitro (U) [f2] (PAL) +CRC=ACDCA0C6 0F4C66F9 +RefMD5=1E9FEAD701FE5AAAA248D4713891775D + +[553D8D5347969C66E5D91C3FE35208B9] +GoodName=WCW vs. nWo - World Tour (E) [!] +CRC=8BDBAF68 345B4B36 +Players=4 +SaveType=Controller Pack + +[203C3BBFDD10C5A0B7C5D0CDB085D853] +GoodName=WCW vs. nWo - World Tour (U) (V1.0) [!] +CRC=2C3E19BD 5113EE5E +Players=4 +SaveType=Controller Pack + +[6BD5C85E25BF3146A42F962A379B4F54] +GoodName=WCW vs. nWo - World Tour (U) (V1.0) [b1] +CRC=2C3E19BD 5113EE5E +RefMD5=203C3BBFDD10C5A0B7C5D0CDB085D853 + +[B7A220B59303D47F3BEAE233CA868CFD] +GoodName=WCW vs. nWo - World Tour (U) (V1.1) [!] +CRC=71BE60B9 1DDBFB3C +Players=4 +SaveType=Controller Pack + +[30C6676EC1D62122F4E7607EF3ABBD41] +GoodName=WCW-nWo Revenge (E) [!] +CRC=68E8A875 0CE7A486 +SaveType=SRAM +Players=4 + +[07F0AD841350BD7CA1E6A99FB7E887E6] +GoodName=WCW-nWo Revenge (E) [h1C] +CRC=68E8A875 0CE7A486 +RefMD5=30C6676EC1D62122F4E7607EF3ABBD41 + +[C1384F3637D7A381B29341FED3EF3CEB] +GoodName=WCW-nWo Revenge (U) [!] +CRC=DEE596AB AF3B7AE7 +Players=4 +SaveType=SRAM + +[B230D307428F4B69B3A80109AC905A44] +GoodName=WCW-nWo Revenge (U) [b1] +CRC=DEE596AB AF3B7AE7 +RefMD5=C1384F3637D7A381B29341FED3EF3CEB + +[117EF2639E0485210C7AB70CBF3E0C00] +GoodName=WCW-nWo Revenge (U) [b2] +CRC=DEE596AB AF3B7AE7 +RefMD5=C1384F3637D7A381B29341FED3EF3CEB + +[D6CD1AF1597CF0D279A39F75EE07C43A] +GoodName=WCW-nWo Revenge (U) [f1] (PAL) +CRC=768AD2AA C3C79B68 +RefMD5=C1384F3637D7A381B29341FED3EF3CEB + +[847A00F2C5DA6696FC49702431DF3150] +GoodName=WCW-nWo Revenge (U) [f2] (PAL) +CRC=768AD2AA C3C79B68 +RefMD5=C1384F3637D7A381B29341FED3EF3CEB + +[EBC0CF55FC58845C6EE86CF8B2D87303] +GoodName=WWF - War Zone (E) [!] +CRC=33A275A4 B8504459 +Players=4 +SaveType=Controller Pack + +[2322DA2B9E7DC74678CD683B7A246B49] +GoodName=WWF - War Zone (U) [!] +CRC=CD5BEC0F 86FD1008 +Players=4 +SaveType=Controller Pack + +[3FDB2E5F9982FDA2C2344A883B8AB6EF] +GoodName=WWF Attitude (E) [!] +CRC=5BF45B7B 596BEEE8 +Players=4 +SaveType=Controller Pack + +[B86EC8D19D7D1A50EA900EA10355A735] +GoodName=WWF Attitude (G) [!] +CRC=8F3151C8 4F3AF545 +Players=4 +SaveType=Controller Pack + +[5AC5CEDBD22CEEA8DD50CF6084193357] +GoodName=WWF Attitude (G) [b1] +CRC=8F3151C8 4F3AF545 +RefMD5=B86EC8D19D7D1A50EA900EA10355A735 + +[9FAF514CB3DBB742C129DEB395DCA342] +GoodName=WWF Attitude (U) [!] +CRC=D2BE2F14 38453788 +Players=4 +SaveType=Controller Pack + +[6D4CBA7FB2E910CA1A87E63A4C1924C2] +GoodName=WWF Attitude (U) [b1] +CRC=D2BE2F14 38453788 +RefMD5=9FAF514CB3DBB742C129DEB395DCA342 + +[44BC029B5219E1A16F3B99125056F98B] +GoodName=WWF Attitude (U) [b2] +CRC=D2BE2F14 38453788 +RefMD5=9FAF514CB3DBB742C129DEB395DCA342 + +[382ECA33C5DD52B8C03A56D20F2D3F21] +GoodName=WWF Attitude (U) [f1] (PAL) +CRC=D89261A9 B1A2C9AF +RefMD5=9FAF514CB3DBB742C129DEB395DCA342 + +[C9A6446918DA5D65612C521D432B7DA1] +GoodName=WWF No Mercy (E) (V1.0) [!] +CRC=6D8DF08E D008C3CF +SaveType=Flash RAM +Players=4 + +[473FDDBB121255A171A40C14130D0165] +GoodName=WWF No Mercy (E) (V1.0) [b1] +CRC=6D8DF08E D008C3CF +RefMD5=C9A6446918DA5D65612C521D432B7DA1 + +[400A14F132D993F5544F8B008EC136FA] +GoodName=WWF No Mercy (E) (V1.1) [!] +CRC=8CDB94C2 CB46C6F0 +Players=4 +SaveType=Flash RAM + +[04C492BE7F89FC6F425238BD67629544] +GoodName=WWF No Mercy (U) (V1.0) [!] +CRC=4E4B0640 1B49BCFB +Players=4 +SaveType=Flash RAM + +[51074CFE7A319270CF088A7C65387368] +GoodName=WWF No Mercy (U) (V1.0) [t1] +CRC=361E1288 7A26BE5F +RefMD5=04C492BE7F89FC6F425238BD67629544 + +[B75149F87CC5F3A508643AC377F2FCC9] +GoodName=WWF WrestleMania 2000 (E) [!] +CRC=C71353BE AA09A6EE +Players=4 +SaveType=SRAM + +[EBB9E3D3782347743BFFB8B6D178FC8A] +GoodName=WWF WrestleMania 2000 (E) [h1C] +CRC=C71353BE AA09A6EE +RefMD5=B75149F87CC5F3A508643AC377F2FCC9 + +[11EEE2F34BF8DA05A1B8F4FB9FE9F74C] +GoodName=WWF WrestleMania 2000 (J) [!] +CRC=12737DA5 23969159 +Players=4 +SaveType=SRAM + +[AFC5EEDD3FCEEF85458E9C8FA162B303] +GoodName=WWF WrestleMania 2000 (J) [b1] +CRC=12737DA5 23969159 +RefMD5=11EEE2F34BF8DA05A1B8F4FB9FE9F74C + +[D9030CA30E4D1AF805ACCE1BFED988CC] +GoodName=WWF WrestleMania 2000 (U) [!] +CRC=90A59003 31089864 +Players=4 +SaveType=SRAM + +[CB174FA89F352DD8451A43FEF2B8D1AA] +GoodName=WWF WrestleMania 2000 (U) [b1] +CRC=90A59003 31089864 +RefMD5=D9030CA30E4D1AF805ACCE1BFED988CC + +[9EAFCA831487923E0BE79717A678894E] +GoodName=WWF WrestleMania 2000 (U) [t1] (Never Drop Weapons) +CRC=90A59003 31089864 +RefMD5=D9030CA30E4D1AF805ACCE1BFED988CC + +[5F1906DF4EB30537C2AC2FCBD005907D] +GoodName=Waialae Country Club - True Golf Classics (E) (M4) (V1.0) [!] +CRC=93053075 261E0F43 +Players=4 +SaveType=Eeprom 4KB + +[1FC540D2168650E135BCC7D3B542E03A] +GoodName=Waialae Country Club - True Golf Classics (E) (M4) (V1.0) [b1] +CRC=93053075 261E0F43 +RefMD5=5F1906DF4EB30537C2AC2FCBD005907D + +[F7C1B1EE1CE37CE09AA48C7E0A115EFA] +GoodName=Waialae Country Club - True Golf Classics (E) (M4) (V1.1) [!] +CRC=0C5057AD 046E126E +Players=4 +SaveType=Eeprom 4KB + +[DD8154D507C88694AFD69C7AF16A8CD6] +GoodName=Waialae Country Club - True Golf Classics (U) (V1.0) [!] +CRC=8066D58A C3DECAC1 +Players=4 +SaveType=Eeprom 4KB + +[D25DD15903BDCB7724A2E8A02561987F] +GoodName=War Gods (E) [!] +CRC=D715CC70 271CF5D6 +Players=2 +SaveType=None + +[9FF2BA3C8408DE9F0EDB6D764A97C197] +GoodName=War Gods (U) [!] +CRC=F7FE28F6 C3F2ACC3 +Players=2 +SaveType=None + +[D08D61E3C244A081C166C6A8D539A181] +GoodName=War Gods (U) [o1] +CRC=F7FE28F6 C3F2ACC3 +RefMD5=9FF2BA3C8408DE9F0EDB6D764A97C197 + +[0D3F2F58310387C60F932F6EC936788D] +GoodName=War Gods (U) [o1][h1C] +CRC=F7FE28F6 C3F2ACC3 +RefMD5=9FF2BA3C8408DE9F0EDB6D764A97C197 + +[F87937C9DE3703898C480FC84C692523] +GoodName=War Gods (U) [o2] +CRC=F7FE28F6 C3F2ACC3 +RefMD5=9FF2BA3C8408DE9F0EDB6D764A97C197 + +[5C98466C2B2AAF7F3B51D4406EEE39FD] +GoodName=War Gods (U) [o3] +CRC=F7FE28F6 C3F2ACC3 +RefMD5=9FF2BA3C8408DE9F0EDB6D764A97C197 + +[771FC17CDC840ED36DB8A699757C37F8] +GoodName=War Gods (U) [t1] (God Mode) +CRC=59BEB6F9 E6DC1630 +RefMD5=9FF2BA3C8408DE9F0EDB6D764A97C197 + +[D24435C65C48E8DE0831FC8F466BAA51] +GoodName=War Gods (U) (Power Bar Hack) +CRC=AFBEB6F6 B0E715DC +RefMD5=9FF2BA3C8408DE9F0EDB6D764A97C197 + +[310659115E9939F219A783ABDD456CE9] +GoodName=Wave Race 64 (E) (M2) [!] +CRC=650EFA96 30DDF9A7 +Players=4 +Rumble=No +SaveType=Eeprom 4KB + +[A992E010BC3740C7C266D4F6E90226A1] +GoodName=Wave Race 64 (E) (M2) [h1C] +CRC=650EFA96 30DDF9A7 +RefMD5=310659115E9939F219A783ABDD456CE9 + +[470D3E391A2B4CEBF0A9E15EC49CD324] +GoodName=Wave Race 64 (E) (M2) [o1] +CRC=650EFA96 30DDF9A7 +RefMD5=310659115E9939F219A783ABDD456CE9 + +[B32E555BC1A375256E8A4021A25339BE] +GoodName=Wave Race 64 (J) [!] +CRC=5C9191D6 B30AC306 +Players=4 +Rumble=No +SaveType=Eeprom 4KB + +[AE480013F39D4AEC86EEA1B4995600D1] +GoodName=Wave Race 64 (U) (V1.0) [!] +CRC=7DE11F53 74872F9D +Players=4 +Rumble=No +SaveType=Eeprom 4KB + +[D653E6B050F63B5E1C1E9856319287E1] +GoodName=Wave Race 64 (U) (V1.0) [t1] +CRC=C5F4865F 03340B83 +RefMD5=AE480013F39D4AEC86EEA1B4995600D1 + +[2048A640C12D1CF2052BA1629937D2FF] +GoodName=Wave Race 64 (U) (V1.1) [!] +CRC=492F4B61 04E5146A +Players=4 +Rumble=No +SaveType=Eeprom 4KB + +[FF67DF97476C210D158779AE6142F239] +GoodName=Wave Race 64 - Shindou Edition (J) (V1.2) [!] +CRC=535DF3E2 609789F1 +Rumble=Yes +Players=4 +SaveType=Eeprom 4KB + +[AFBC694A3BA5AE83D3CEEF906BF01839] +GoodName=Wave Race 64 - Shindou Edition (J) (V1.2) [b1] +CRC=535DF3E2 609789F1 +RefMD5=FF67DF97476C210D158779AE6142F239 + +[41E419F4392CFEF2C354006169362286] +GoodName=Wave Race 64 - Shindou Edition (J) (V1.2) [b2] +CRC=535DF3E2 609789F1 +RefMD5=FF67DF97476C210D158779AE6142F239 + +[CAD993128A11B5616E5DDE5CF50CB998] +GoodName=Wave Race 64 - Shindou Edition (J) (V1.2) [h1C] +CRC=535DF3E2 609789F1 +RefMD5=FF67DF97476C210D158779AE6142F239 + +[F9DA7EB74E391C5E6813212F7F55959A] +GoodName=Wave Race 64 - Shindou Edition (J) (V1.2) [o1] +CRC=535DF3E2 609789F1 +RefMD5=FF67DF97476C210D158779AE6142F239 + +[24A0D8C8CABC22116E469476FF6C691D] +GoodName=Wayne Gretzky's 3D Hockey '98 (E) (M4) [!] +CRC=661B45F3 9ED6266D + +[810F8BC2C8C66BDA3B206C7DD4B6D42F] +GoodName=Wayne Gretzky's 3D Hockey '98 (U) [!] +CRC=5A9D3859 97AAE710 + +[096726498E698B51AFE72AAB5262A15A] +GoodName=Wayne Gretzky's 3D Hockey '98 (U) [T+Ita_cattivik66] +CRC=5A9D3859 97AAE710 + +[C9F95F9480B5867B03CFC0533F319253] +GoodName=Wayne Gretzky's 3D Hockey '98 (U) [h1C] +CRC=5A9D3859 97AAE710 + +[F7E5BDF8E4076C27961BAF9A42C73524] +GoodName=Wayne Gretzky's 3D Hockey '98 (U) [h2C] +CRC=5A9D3859 97AAE710 + +[319816AAA30E512827BE7B7F81F80D86] +GoodName=Wayne Gretzky's 3D Hockey (E) (M4) [!] +CRC=2209094B 2C9559AF +Players=4 +SaveType=Controller Pack + +[65F1D583B5392D3467BD187224FBBD89] +GoodName=Wayne Gretzky's 3D Hockey (E) (M4) [b1] +CRC=2209095F ECD28311 +RefMD5=319816AAA30E512827BE7B7F81F80D86 + +[0905A37DBB3B9CEC38B52F6E109A9EAA] +GoodName=Wayne Gretzky's 3D Hockey (E) (M4) [h1C] +CRC=2209094B 2C9559AF +RefMD5=319816AAA30E512827BE7B7F81F80D86 + +[61E637B542D5DF178040454075C28E19] +GoodName=Wayne Gretzky's 3D Hockey (J) [!] +CRC=F1301043 FD80541A +Players=4 +SaveType=Controller Pack + +[371620871660767900FC00F72681E1FD] +GoodName=Wayne Gretzky's 3D Hockey (J) [b1] +CRC=F1301043 FD80541A +RefMD5=61E637B542D5DF178040454075C28E19 + +[03877A5CD0DD1E8C14EEEE70660E79DA] +GoodName=Wayne Gretzky's 3D Hockey (J) [o1] +CRC=F1301043 FD80541A +RefMD5=61E637B542D5DF178040454075C28E19 + +[81EFB80DB5E014D865EC2EC88C393E4D] +GoodName=Wayne Gretzky's 3D Hockey (J) [o2] +CRC=F1301043 FD80541A +RefMD5=61E637B542D5DF178040454075C28E19 + +[6DF0D6259261D0096C90BBC6AA037D8E] +GoodName=Wayne Gretzky's 3D Hockey (U) (V1.0) [!] +CRC=6B45223F F00E5C56 +Players=4 +SaveType=Controller Pack + +[EDBDB55AD58554C48B25A47D7E178513] +GoodName=Wayne Gretzky's 3D Hockey (U) (V1.0) [b1] +CRC=6B45223F F00E5C56 +RefMD5=6DF0D6259261D0096C90BBC6AA037D8E + +[5349ABD4EE13C8F029A60032735B1AE3] +GoodName=Wayne Gretzky's 3D Hockey (U) (V1.0) [o1] +CRC=6B45223F F00E5C56 +RefMD5=6DF0D6259261D0096C90BBC6AA037D8E + +[04E650B7742A69DAE98F125D1B492D78] +GoodName=Wayne Gretzky's 3D Hockey (U) (V1.1) [!] +CRC=DC3BAA59 0ABB456A +Players=4 +SaveType=Controller Pack + +[98C20A229170CF393BBF442D44FFC5B1] +GoodName=Wet Dreams Can Beta Demo by Immortal (POM '99) (PD) +CRC=CA3BC095 9649860A + +[D652769F8EE9BBE5F0BD5DF9B955D47E] +GoodName=Wet Dreams Madeiragames Demo by Immortal (POM '99) (PD) +CRC=993B7D7A 2E54F04D + +[37C0C97DFCE99F9968778448F5C9F0B6] +GoodName=Wet Dreams Main Demo by Immortal (POM '99) (PD) +CRC=A3A95A57 9FE6C27D + +[7B7B2916A857B9FC513C5F9619B36C98] +GoodName=Wet Dreams Readme by Immortal (POM '99) (PD) +CRC=9C044945 D31E0B0C +Status=5 +SaveType=None +Players=0 +Rumble=No + +[A99E2CB6ACEF7A004961DE5F6DFEEFF0] +GoodName=Wetrix (E) (M6) [!] +CRC=CEA8B54F 7F21D503 +Players=4 +SaveType=Controller Pack + +[15F425829D54DD290451D2F3EBAF953F] +GoodName=Wetrix (E) (M6) [f1] (NTSC) +CRC=792C3A8E 0F2200F7 +RefMD5=A99E2CB6ACEF7A004961DE5F6DFEEFF0 + +[087B6C2D5FBD778667C12D7FC7C305A7] +GoodName=Wetrix (E) (M6) [t1] +CRC=773E3E8E 1E8A0CBE +RefMD5=A99E2CB6ACEF7A004961DE5F6DFEEFF0 + +[E8997BF5662540B184FBF8277D260984] +GoodName=Wetrix (J) [!] +CRC=DCB6EAFA C6BBCFA3 +Players=4 +SaveType=Controller Pack + +[08826E96F3FB022A1C6351774198BA9D] +GoodName=Wetrix (J) [o1] +CRC=DCB6EAFA C6BBCFA3 +RefMD5=E8997BF5662540B184FBF8277D260984 + +[6E81D3056E409208E4AF2D39A2FF0F03] +GoodName=Wetrix (U) (M6) [!] +CRC=CEA8B54F 7F21D503 +Players=4 +SaveType=Controller Pack + +[2ABE36754E866B9B6C4BDCFFC1D11ABF] +GoodName=Wheel of Fortune (U) [!] +CRC=E896092B DC244D4E +SaveType=None +Players=4 + +[CC75D0771DBC825AC9F499400443A6A0] +GoodName=Wheel of Fortune (U) [b1] +CRC=E896092B DC244D4E +RefMD5=2ABE36754E866B9B6C4BDCFFC1D11ABF + +[D20F2C6704D5B93372816BA0559E4E0F] +GoodName=Wheel of Fortune (U) [o1] +CRC=E896092B DC244D4E +RefMD5=2ABE36754E866B9B6C4BDCFFC1D11ABF + +[CC8460B117AAFBD484CF43C1EB3D8E15] +GoodName=Wheel of Fortune (U) [o1][b1] +CRC=E896092B DC244D4E +RefMD5=2ABE36754E866B9B6C4BDCFFC1D11ABF + +[764DCDF5163D3FCE81D3E7189FA97E05] +GoodName=WideBoy BIOS V980910 +CRC=D1C6C55D F010EF52 + +[FFF632A867CDADB5AB2098CB8E2CFADC] +GoodName=WideBoy BIOS V980914 +CRC=64F1084A 763C7E91 + +[F85F2A2B6CA64898F0ADD2A78CCDCCF3] +GoodName=Wild Choppers (J) [!] +CRC=0CEBC4C7 0C9CE932 +Players=1 +SaveType=Eeprom 4KB + +[BA538CBF43471B3522C4D08BAD0797A7] +GoodName=Wild Choppers (J) [b1] +CRC=0CEBC4C7 0C9CE932 +RefMD5=F85F2A2B6CA64898F0ADD2A78CCDCCF3 + +[AC1339207A3E442B61EC0E074673C93B] +GoodName=Wild Choppers (J) [b2] +CRC=F4520439 753A6281 +RefMD5=F85F2A2B6CA64898F0ADD2A78CCDCCF3 + +[DFB55C3F9B2D2A188616E9C123E0C816] +GoodName=Wild Choppers (J) [b3] +CRC=0CEBC4C7 0C9CE932 +RefMD5=F85F2A2B6CA64898F0ADD2A78CCDCCF3 + +[7FE135D08035782A8AAE0BEFE9A9780B] +GoodName=Wild Choppers (J) [o1] +CRC=0CEBC4C7 0C9CE932 +RefMD5=F85F2A2B6CA64898F0ADD2A78CCDCCF3 + +[B2DE25613755B234A376747422D83BBC] +GoodName=Wild Choppers (J) [t1] +CRC=F4520439 753A6281 +RefMD5=F85F2A2B6CA64898F0ADD2A78CCDCCF3 + +[EE3D3550ACC463CA57408BF14E541F68] +GoodName=WinBack (J) [!] +CRC=1FA056E0 A4B9946A +Players=4 +SaveType=Controller Pack + +[1B94D98F509F467F9BC541102F6EBDFC] +GoodName=WinBack (J) [b1] +CRC=1FA056E0 A4B9946A +RefMD5=EE3D3550ACC463CA57408BF14E541F68 + +[48DA6CDCAB838153CAA2ECC3DD592A65] +GoodName=WinBack - Covert Operations (U) [!] +CRC=ED98957E 8242DCAC +Players=4 +SaveType=Controller Pack + +[ACC6FD4E26D360D1BED54C316D7E33B9] +GoodName=WinBack - Covert Operations (U) [b1] +CRC=ED98957E 8242DCAC +RefMD5=48DA6CDCAB838153CAA2ECC3DD592A65 + +[F3365B47E430011D89162FB0D7DD8DE5] +GoodName=WinBack - Covert Operations (U) [f1] (PAL) +CRC=337F24EE 73A807D9 +RefMD5=48DA6CDCAB838153CAA2ECC3DD592A65 + +[FA34EAEBAA8A4E48D6BBD93DF62CD995] +GoodName=WinBack - Covert Operations (U) [t1] +CRC=35F51C8E 39EF72B8 +RefMD5=48DA6CDCAB838153CAA2ECC3DD592A65 + +[5783373634B11F81C86908C3D81CA988] +GoodName=Wipeout 64 (E) [!] +CRC=54310E7D 6B5430D8 +Players=4 +SaveType=Controller Pack + +[73C6D87DBE50F73F3B44E0F237A546D7] +GoodName=Wipeout 64 (U) [!] +CRC=132D2732 C70E9118 +SaveType=Controller Pack +Players=4 + +[361F65D37F41536CDE98F83CAD456217] +GoodName=Wipeout 64 (U) [o1] +CRC=132D2732 C70E9118 +RefMD5=73C6D87DBE50F73F3B44E0F237A546D7 + +[0E274A162CAD0B1B50F9B8D64D9F82FC] +GoodName=Wipeout 64 (U) [t1] +CRC=A6A99491 52B4E765 +RefMD5=73C6D87DBE50F73F3B44E0F237A546D7 + +[B8DD77F17A8B638B1D38F57C81EAA89A] +GoodName=Wipeout 64 (U) [t2] +CRC=A6A99491 52B4E765 +RefMD5=73C6D87DBE50F73F3B44E0F237A546D7 + +[0FF1F8628D8FE69582DB54572D2BEA79] +GoodName=Wonder Project J2 - Koruro no Mori no Jozet (J) [!] +CRC=E43C9765 05B1C1BE +Players=1 + +[17C988866B03E382E1ABCC814187505A] +GoodName=Wonder Project J2 - Koruro no Mori no Jozet (J) [T+Eng0.1_Ryu] +CRC=6D6AF5BB 88D471E8 +RefMD5=0FF1F8628D8FE69582DB54572D2BEA79 + +[D6E56B92EC7DBFB8B14DD5D8CFF6492E] +GoodName=Wonder Project J2 - Koruro no Mori no Jozet (J) [b1] +CRC=E43C9765 05B1C1BE +RefMD5=0FF1F8628D8FE69582DB54572D2BEA79 + +[F5977968B621E74773E80CC4A33F7D2E] +GoodName=Wonder Project J2 - Koruro no Mori no Jozet (J) [h1C] +CRC=E43C9765 05B1C1BE +RefMD5=0FF1F8628D8FE69582DB54572D2BEA79 + +[3AA263ACA66F3A07BB081B575D66DEEB] +GoodName=World Cup 98 (E) (M8) [!] +CRC=F9FC3090 FF014EC2 +Players=4 +SaveType=Controller Pack + +[E3DB1863E138B3AD5685A16029D0A44C] +GoodName=World Cup 98 (E) (M8) [f1] (NTSC) +CRC=F9FC3090 FF014EC2 +RefMD5=3AA263ACA66F3A07BB081B575D66DEEB + +[4BEF5E9AA9E71205DAC1A7060E778235] +GoodName=World Cup 98 (U) (M8) [!] +CRC=BD636D6A 5D1F54BA +Players=4 +SaveType=Controller Pack + +[431DE8F6611A8131B536F0EDE1F330D9] +GoodName=World Driver Championship (E) (M5) [!] +CRC=AC062778 DFADFCB8 +SaveType=Controller Pack +Players=4 + +[9A2B0F3226FB8D129BEB7509C169476A] +GoodName=World Driver Championship (E) (M5) [h1C] +CRC=AC062778 DFADFCB8 +RefMD5=431DE8F6611A8131B536F0EDE1F330D9 + +[7C567A5BB1AD4CBE414FB6BBFF66E336] +GoodName=World Driver Championship (U) [!] +CRC=308DFEC8 CE2EB5F6 +SaveType=Controller Pack +Players=4 + +[4B86C373533D015860467C5DC1F1C662] +GoodName=World Driver Championship (U) [b1] +CRC=308DFEC8 CE2EB5F6 +RefMD5=7C567A5BB1AD4CBE414FB6BBFF66E336 + +[0C26665C2F40A786778EE4370C3A43FC] +GoodName=World Driver Championship (U) [f1] (PAL) +CRC=2A721F06 4097F7B1 +RefMD5=7C567A5BB1AD4CBE414FB6BBFF66E336 + +[628C10A5D2ACC462C5527E6302467440] +GoodName=World Driver Championship (U) [f2] (PAL) +CRC=2A980400 7D805B1C +RefMD5=7C567A5BB1AD4CBE414FB6BBFF66E336 + +[A4599EF88F36E62C1692BCEC416C5477] +GoodName=World Driver Championship (U) [t1] +CRC=C8FEF05D DAA3407D +RefMD5=7C567A5BB1AD4CBE414FB6BBFF66E336 + +[44FC2A7F028F0B6F71B255F672C8B495] +GoodName=Worms - Armageddon (E) (M6) [!] +CRC=2D21C57B 8FE4C58C +Players=4 +SaveType=Eeprom 4KB + +[35FDA68C8481F7C3419CCD91EDBB6A9E] +GoodName=Worms - Armageddon (E) (M6) [f1] (NTSC) +CRC=94FBA5FD BC8FE181 +RefMD5=44FC2A7F028F0B6F71B255F672C8B495 + +[491D4DB6718302489BF05FB962C73651] +GoodName=Worms - Armageddon (U) (M3) [!] +CRC=13E959A0 0E93CAB0 +Players=4 +SaveType=Eeprom 4KB + +[EC2BCB1B7FC7D068BE1F39E79E49A842] +GoodName=Xena Warrior Princess - The Talisman of Fate (E) [!] +CRC=0A1667C7 293346A6 +SaveType=Controller Pack +Status=3 +Rumble=Yes +Players=4 + +[1AC234649D28F09E82C0D11ABB17F03B] +GoodName=Xena Warrior Princess - The Talisman of Fate (U) [!] +CRC=0553AE9D EAD8E0C1 +SaveType=Controller Pack +Status=3 +Rumble=Yes +Players=4 + +[687AF471A5A16D665E16AC1E9069D16B] +GoodName=Xena Warrior Princess - The Talisman of Fate (U) [f1] (PAL) +CRC=BC875B60 8C993DF1 +RefMD5=1AC234649D28F09E82C0D11ABB17F03B + +[6CB35999D2E3820391913F0E4B9BC072] +GoodName=Xena Warrior Princess - The Talisman of Fate (U) [t1] +CRC=BEADC61C 8622D9F6 +RefMD5=1AC234649D28F09E82C0D11ABB17F03B + +[9137129A586E1BCAB6AE81BAC6B01275] +GoodName=Xplorer64 BIOS V1.067 (G) +CRC=656C6561 73652031 + +[763E5EACA4606E15A1E4D67DD6D987C0] +GoodName=XtraLife Dextrose Demo by RedboX (PD) [h1C] +CRC=1EDA4DE0 22BF698D + +[46C45620F26E4ED77B918F862FA597CD] +GoodName=XtraLife Dextrose Demo by RedboX (PD) +CRC=1EDA4DE0 22BF698D + +[A954E2BC5D774DC6E1CEBCE529F1CDED] +GoodName=Y2K Demo by WT_Riker (PD) [b1] +CRC=83F9F2CB E7BC4744 + +[76A1480BE9985D30FC580E4216974D3E] +GoodName=Y2K Demo by WT_Riker (PD) +CRC=83F9F2CB E7BC4744 + +[E24942948F7140EE4260268DB763D0FD] +GoodName=Yakouchuu II - Satsujin Kouru (J) [!] +CRC=9F8B96C3 A01194DC +Players=1 + +[DD8A0E5472F13EA87B176F0155FA0C66] +GoodName=Yoshi Story (J) [!] +CRC=2DCFCA60 8354B147 +Players=1 +SaveType=Eeprom 16KB + +[B7B236051E4347428288F8D840BFD2E4] +GoodName=Yoshi Story (J) [b1] +CRC=E3CCFE36 398FBC75 +RefMD5=DD8A0E5472F13EA87B176F0155FA0C66 + +[4BA4B1A2ABAF72EC83A2DB4CB6AEB7D6] +GoodName=Yoshi Story (J) [f1] +CRC=70666F63 FEC28A44 +RefMD5=DD8A0E5472F13EA87B176F0155FA0C66 + +[38F004F68D5F1ABBC4391D156DEBCAEF] +GoodName=Yoshi Story (J) [f2] +CRC=70666F63 FEC28A44 +RefMD5=DD8A0E5472F13EA87B176F0155FA0C66 + +[C43E3E28D84F337FF1BC88FA77996D33] +GoodName=Yoshi Story (J) [f3] +CRC=05BCD54E 97E2A8C9 +RefMD5=DD8A0E5472F13EA87B176F0155FA0C66 + +[20ED9559D47535EA491D3548FB9E15E2] +GoodName=Yoshi Story (J) [f4] +CRC=D4DD9982 FDBA7B67 +RefMD5=DD8A0E5472F13EA87B176F0155FA0C66 + +[3B41BAD41ABF4512FBF62727410EAC71] +GoodName=Yoshi Story (J) [t1] +CRC=369B314B E7780D04 +RefMD5=DD8A0E5472F13EA87B176F0155FA0C66 + +[CF3802A99D8FE412359F1EB018FD991F] +GoodName=Yoshi Story (J) [t2] (Health and Eggs) +CRC=AF5F3773 B29B2C9A +RefMD5=DD8A0E5472F13EA87B176F0155FA0C66 + +[2524E5FB8ED4BB8C831C5AC057E8F344] +GoodName=Yoshi's Story (E) (M3) [!] +CRC=D3F97D49 6924135B +SaveType=Eeprom 16KB +Players=1 + +[6E5E919D0FA292B97AAD08E9200E8C9C] +GoodName=Yoshi's Story (E) (M3) [b1] +CRC=D3F97D49 6924135B +RefMD5=2524E5FB8ED4BB8C831C5AC057E8F344 + +[5D3C7935193A3B7327021B5E4740DEB6] +GoodName=Yoshi's Story (E) (M3) [b2] +CRC=D3F97D49 6924135B +RefMD5=2524E5FB8ED4BB8C831C5AC057E8F344 + +[E2F6EF5D4181558656DDE8B0162D39D3] +GoodName=Yoshi's Story (E) (M3) [b2][f1] +CRC=9CB1BBB0 BC3439C7 +RefMD5=2524E5FB8ED4BB8C831C5AC057E8F344 + +[C80D0A8193D530530AE875F8D9398E82] +GoodName=Yoshi's Story (E) (M3) [b3] +CRC=D3F97D49 6924135B +RefMD5=2524E5FB8ED4BB8C831C5AC057E8F344 + +[ADEE5835A112677CCF74D5F4A1503294] +GoodName=Yoshi's Story (E) (M3) [t1] (Health and Eggs) +CRC=94FEDD3F 95719E88 +RefMD5=2524E5FB8ED4BB8C831C5AC057E8F344 + +[586A092E22604840973B82DFACEAC77A] +GoodName=Yoshi's Story (U) (M2) [!] +CRC=2337D8E8 6B8E7CEC +SaveType=Eeprom 16KB +Players=1 + +[B907C051F1D7D0D15DE65EA87CF3F922] +GoodName=Yoshi's Story (U) (M2) [b1] +CRC=9CB1BBB0 BC3439C7 +RefMD5=586A092E22604840973B82DFACEAC77A + +[B4A2127033CB671EEFE535B08F1AFB38] +GoodName=Yoshi's Story (U) (M2) [b2] +CRC=88047F1D 3B837D28 +RefMD5=586A092E22604840973B82DFACEAC77A + +[D635824B5FC256DA0F2E457663CFF286] +GoodName=Yoshi's Story (U) (M2) [b3] +CRC=CCE336FE 8F3975BC +RefMD5=586A092E22604840973B82DFACEAC77A + +[75F91A5D3012080EE9BF90C017B5128F] +GoodName=Yoshi's Story (U) (M2) [b4] +CRC=395E91DF 441D95C5 +RefMD5=586A092E22604840973B82DFACEAC77A + +[8F47F6A80734D6C8501ADED549FF65C5] +GoodName=Yoshi's Story (U) (M2) [b5] +CRC=E3CCFE36 398FBC75 +RefMD5=586A092E22604840973B82DFACEAC77A + +[0DCF29478A6DB0A3113B9EDD2AE428E1] +GoodName=Yoshi's Story (U) (M2) [f1] +CRC=E3CCFE36 398FBC75 +RefMD5=586A092E22604840973B82DFACEAC77A + +[7CE4559FED0EA7D82670E9A4ECC370CD] +GoodName=Yoshi's Story (U) (M2) [t1] +CRC=88047F1D 3B837D28 +RefMD5=586A092E22604840973B82DFACEAC77A + +[3DA2C5FA29D11D0481B60F6C6B14393A] +GoodName=Yoshi's Story (U) (M2) [t2] (Health and Eggs) +CRC=E606EE26 8783EC43 +RefMD5=586A092E22604840973B82DFACEAC77A + +[5FE7486A5A458D538179DA898B067AD3] +GoodName=Yoshi's Story BootEmu (PD) +CRC=83D8A30C 8552C117 + +[2AE35BDF163613024D876A09F25063F3] +GoodName=Yuke Yuke!! Trouble Makers (J) [!] +CRC=9FE6162D E97E4037 +Players=1 +SaveType=Eeprom 4KB + +[6F9E56C8A2B6BA5F6DBE5214E352590D] +GoodName=Yuke Yuke!! Trouble Makers (J) [a1] +CRC=9FE6162D E97E4037 +RefMD5=2AE35BDF163613024D876A09F25063F3 + +[BE734B15770D28C0A26D2DB98DF6CCCC] +GoodName=Yuke Yuke!! Trouble Makers (J) [b1] +CRC=9FE6162D E97E4037 +RefMD5=2AE35BDF163613024D876A09F25063F3 + +[BADCEDF5B6BECDBCCA7267BD2D791EB1] +GoodName=Yuke Yuke!! Trouble Makers (J) [o1] +CRC=9FE6162D E97E4037 +RefMD5=2AE35BDF163613024D876A09F25063F3 + +[C66D2037A654378C5CD365B135E36D87] +GoodName=Z64 BIOS V1.05 +CRC=551E06B4 02CD16A8 + +[730209AD52C178551C29074F49AE9B39] +GoodName=Z64 BIOS V1.07 +CRC=551E06B4 02CD16A8 + +[60BC7FE282C6BE6B90EA0B5FC63BC944] +GoodName=Z64 BIOS V1.08 (Ravemax Hack V1.00b) +CRC=00000000 00005053 + +[F5441580B27ECFB94A8C6B7989B1D101] +GoodName=Z64 BIOS V1.08 +CRC=00000000 00005053 + +[60A39BA7F3DCC592112FDF8220335F3D] +GoodName=Z64 BIOS V1.09 +CRC=00000000 00005053 + +[1412DDDCFD2DC960DA7D282D99FC2356] +GoodName=Z64 BIOS V1.10b +CRC=00000000 00005053 + +[40E74DA10255DCF00A45F02BED1AFCAD] +GoodName=Z64 BIOS V1.11 +CRC=00000000 00005053 + +[E81062B36B08078CE4CFF5A362F44764] +GoodName=Z64 BIOS V1.12 +CRC=00000000 00005053 + +[FFAAAFB32A2D87C6B621B62FFC85A2D6] +GoodName=Z64 BIOS V2.00 (Barebones) +CRC=B038EEEB 00BA6901 + +[A1CDE773E4FB8B691098F2B3D5F2DBBA] +GoodName=Z64 BIOS V2.00 +CRC=00000000 00005053 + +[319377A6D811EF8AD7B3E16B537E6346] +GoodName=Z64 BIOS V2.00b (Ravemax Hack) +CRC=00000000 00005053 + +[72775AB85B5106A97DECB0520DFD9180] +GoodName=Z64 BIOS V2.10NTSC +CRC=00000000 00005053 + +[DB67B8D7251314163E4F713724F55C66] +GoodName=Z64 BIOS V2.10PAL +CRC=00000000 00005053 + +[B15D755B8C6A4B5933802E5F227A183C] +GoodName=Z64 BIOS V2.11NTSC +CRC=00000000 00005053 + +[0CC1A139F9C3865FE698C64209C45253] +GoodName=Z64 BIOS V2.11PAL +CRC=00000000 00005053 + +[E76F0536CDAD4C6F89802E15A98AE985] +GoodName=Z64 BIOS V2.12NTSC +CRC=00000000 00005053 + +[CC2433DFB7738D5CB71A75B054E52DD5] +GoodName=Z64 BIOS V2.12PAL +CRC=00000000 00005053 + +[07C468E5050FC619791437930D740B10] +GoodName=Z64 BIOS V2.12b (Nintendo Backup Crew Hack) +CRC=00000000 00005053 + +[0170C86E42E15A364CDC6E176A63A500] +GoodName=Z64 BIOS V2.12b3 +CRC=00000000 00005053 + +[D65B99356296CA8F6B3273540203E0AA] +GoodName=Z64 BIOS V2.12b4 +CRC=00000000 00005053 + +[B6D6EDA244C308E63D36EEC607942605] +GoodName=Z64 BIOS V2.13 +CRC=00000000 00005053 + +[A4B138CAEDCE038D93C5B1FEDD897E7D] +GoodName=Z64 BIOS V2.15 +CRC=00000000 00005053 + +[4F557C3F71C0D04A54776450913E027F] +GoodName=Z64 BIOS V2.16 +CRC=00000000 00005053 + +[8EEE06C88613B1265721B26517B64F2C] +GoodName=Z64 BIOS V2.16b +CRC=00000000 00005053 + +[B29240BC2FFA6C46B83023F2226E3CDE] +GoodName=Z64 BIOS V2.17 [h1] +CRC=00000000 00005053 + +[0658D69EBA236FDF6DA5D491BDC96574] +GoodName=Z64 BIOS V2.17 by zmod.onestop.net (ORB HDisk ZIP250 2.18zd Hack) +CRC=00000000 00005053 + +[568D51E1D4602CD74AC3A2D9719A390A] +GoodName=Z64 BIOS V2.17 by zmod.onestop.net (ORB HDisk ZIP250 Hack) +CRC=00000000 00005053 + +[1630A446857F28D3068907F302B02114] +GoodName=Z64 BIOS V2.17 +CRC=00000000 00005053 + +[7344708B7E0FC0683BBA86D902B9603D] +GoodName=Zelda 64 Boot Emu V1 by Crazy Nation (PD) [a1] +CRC=9A7A9F14 05137CC7 + +[015A3F07366CEF93B5CB38B386E659F4] +GoodName=Zelda 64 Boot Emu V1 by Crazy Nation (PD) +CRC=9A7A9F14 05137CC7 + +[E419774A7113F1B82F6621EA512F10CF] +GoodName=Zelda 64 Boot Emu V2 by Crazy Nation (PD) [a1] +CRC=60005D15 65727EFF + +[01E2C444385597DC4FCF09E45C522B01] +GoodName=Zelda 64 Boot Emu V2 by Crazy Nation (PD) +CRC=60005D15 65727EFF + +[692A33B0D7456FC733A81AB83C20382B] +GoodName=Zool - Majou Tsukai Densetsu (J) [!] +CRC=1C010CCD 22D3B7FA +Players=1 + +[4F8E5341B89E6C2069A319EF2FB58B16] +GoodName=Zool - Majou Tsukai Densetsu (J) [f1] (PAL) +CRC=7711DBA7 4856F7E0 +RefMD5=692A33B0D7456FC733A81AB83C20382B + +[1DDE4D26CEDB2E8565AACB2C8098DF8D] +GoodName=Neon64 GS V1.05 (Gameshark Version) (PD) +CRC=03D7F021 8FDE0000 + +[775E6D9305BF219C0696063C809F2B48] +GoodName=Neon64 GS V1.1 (Gameshark Version) (PD) +CRC=3C0A8030 354A4E78 + +[4C3F1B48E7252391B337D9BAE404CF83] +GoodName=Neon64 GS V1.2 (Gameshark Version) (PD) +CRC=3C0A8030 354A5198 + +[81A2C7E1EC426D3AEE1C4B823A2BC7BF] +GoodName=Neon64 GS V1.2 (Pro Action Replay Version) (PD) +CRC=3C0A802D 354A3458 + +[90FAF5461E5F5CD5B67CE7891B9B055B] +GoodName=Neon64 GS V1.2a (Gameshark Version) (PD) +CRC=3C0A8030 354A51B0 + +[B9A06A029A842207A9E17AA40A702F7B] +GoodName=Neon64 GS V1.2a (Pro Action Replay Version) (PD) +CRC=3C0A802D 354A3470 + +[9BE795563DBA802DD566DF75D6106CFC] +GoodName=Z64 BIOS V2.18 +CRC=00000000 00005053 + +[4B2DBC0D448B7AD8569291E4E44821F0] +GoodName=N64probe by MooglyGuy (PD) +CRC=B216B9F1 AB27D881 + +[D7CB11A82EDAEE3F519346C7EAE201E9] +GoodName=ObjectVIEWER V1.1 by Kid Stardust (PD) +CRC=34E42466 F50868AC + +[A1D23D8C7A3194DCD0AC0CA1AF79136E] +GoodName=TheMuscularDemo by megahawks (PD) +CRC=B0565CCB BDA2C237 + +[DBF04773EC2B8ADF8A94DB7E3E461138] +GoodName=Mupen64Plus Demo by Marshallh (GPL) +CRC=DDBA4DE5 B107004A +Status=5 +Players=0 +SaveType=None +Rumble=No + +[46C9461B0B6F232C5A50CA795395D706] +GoodName=DS1 Manager V1.1 by R. Bubba Magillicutty (PD) [T+Ita] +CRC=868214B8 AB2BE6B7 + +[02E344EC824BBA4A4CFFCAC5FEADEA51] +GoodName=F-ZERO Expansion Kit (N64DD) +CRC=2129FFF8 AD000000 + +[8D3D9F294B6E174BC7B1D2FD1C727530] +GoodName=N64DD IPLROM (J) +CRC=00000000 00000000 + +[83807A5437A2EA21E2133DBA1E410750] +GoodName=Wonder Project J2 - Koruro no Mori no Jozet (J) [T-Eng0.05] +CRC=3A4B5938 A26F989D + +[E0530F182EA3BB780A6264B1D06737A1] +GoodName=Z64 BIOS V2.20cf +CRC=00000000 00005053 + +[D3929AADF7640F8C5B4CE8321AD4393A] +GoodName=Zelda no Densetsu - Mujura no Kamen (J) (GC) [!] +CRC=8473D0C1 23120666 + +[15D1A2217CAD61C39CFECBFFA0703E25] +GoodName=Zelda no Densetsu - Mujura no Kamen (J) (V1.0) [!] +CRC=EC417312 EB31DE5F + +[3E60CA693BABFF1F62CF8C0AEC338556] +GoodName=Zelda no Densetsu - Mujura no Kamen (J) (V1.0) [b1] +CRC=EC417312 EB31DE5F + +[0F6D3EDB5797A775757336549A8A9B94] +GoodName=Zelda no Densetsu - Mujura no Kamen (J) (V1.0) [b1][o1] +CRC=EC417312 EB31DE5F + +[E0CED30BF10F05EBAF1F1A27563E3E5D] +GoodName=Zelda no Densetsu - Mujura no Kamen (J) (V1.0) [f1] +CRC=EE7AF9EC A750B2D3 + +[0FA23CD30B68EB86548630FE635BB90E] +GoodName=Zelda no Densetsu - Mujura no Kamen (J) (V1.0) [o1] +CRC=EC417312 EB31DE5F + +[C38A7F6F6B61862EA383A75CDF888279] +GoodName=Zelda no Densetsu - Mujura no Kamen (J) (V1.1) [!] +CRC=69AE0438 2C63F3F3 + diff --git a/libmupen64plus/mupen64plus-core/data/mupencheat.txt b/libmupen64plus/mupen64plus-core/data/mupencheat.txt new file mode 100644 index 0000000000..ed1c792e99 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/data/mupencheat.txt @@ -0,0 +1,29925 @@ +///* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +// * Mupen64plus - mupencheat.txt * +// * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * +// * Copyright (C) 2008 Gent * +// * * +// * 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. * +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +// Used and relicensed GPL with permission from Gent +// Start Original Header +// PJ64 1.7 Official Cheats Database (Project64.cht) Beta Version 1.7.0.13 +// All Region Cheat Codes By Gent. +// ---------------------------------------------------- +// +// This Cheat file is only to be used with Project64 version 1.7 +// +// ---------------------------------------------------- +// End Original Header +// +// This file was converted to a different format from the original PJ64 cheat format. +// +// [Meta] +// Author=Gent +// Version=Official Beta Version 1.7.0.13 +// Date=30th April 2008 +// Homepage=http://www.pj64.net +//--------------- (J) Region Cheat Codes --------------- +crc 80F41131-384645F6-C:4A +gn AeroGauge (J) (V1.1) +//---- + cn No Damage\Player 1 + 50000402 0000 + 8113D058 0000 + cn No Damage\Player 2 + 50000402 0000 + 8113F0E8 0000 + cn Unlock All Tracks and Vehicles + 8008D1FC 0001 + cn Freeze All Lap Timers + 8013CD21 0001 + 8013CD25 0001 + 8013CD29 0001 + cn Freeze Overall Timer + cd All of the Freeze All Lap Timers must be on. These codes will Stop the others from racing against you in Grand Prix mode. To win a race in Grand Prix you must finish at least one lap in the qualify round, then complete all laps in race for first. + 8013CD15 0001 + cn Laps Of Race + 8013CD0E ???? 0001:"1 Lap",0002:"2 Laps",0003:"3 Laps",0004:"4 Laps",0005:"5 Laps",0006:"Never Ending Laps" + cn Play As\Player 1 + 8013D015 ???? 0000:"N64 Control Pad",0001:"Interceptor",0002:"Hornet",0003:"Avenger",0004:"Shredder",0005:"Black Lightning",0006:"Vengeance",0007:"Prowler",0008:"Reaper",0009:"Dominator" + cn Level Select + cd For this cheat to work,as soon as you put the cheat on you must turn it back off,if not you wont beable to quit a Race or even finish one. + 8013D01B ???? 0000:"Canyon Rush",0001:"Bikini Island",0002:"China Town",0003:"Neo Arena",0004:"China Town Jam",0005:"Neo Speed Way" + cn Play As\Player 2 + 8013D016 ???? 0000:"N64 Control Pad",0001:"Interceptor",0002:"Hornet",0003:"Avenger",0004:"Shredder",0005:"Black Lightning",0006:"Vengeance",0007:"Prowler",0008:"Reaper",0009:"Dominator" + cn Always 1st + 8013CD60 0001 + cn Music Modifier + 80106CCC ???? 00FF:"Music On",0000:"Music Off" + +crc B00903C9-3916C146-C:4A +gn AeroGauge - Kiosk (J) (V1.0) + cn No Damage\Player 1 + 50000402 0000 + 8113CF08 0000 + cn No Damage\Player 2 + 50000402 0000 + 8113EF98 0000 + cn Unlock All Tracks and Vehicles + 8008D0AC 0001 + cn Freeze All Lap Timers + 8013CBD1 0001 + 8013CBD5 0001 + 8013CBD9 0001 + cn Freeze Overall Timer + cd All of the Freeze All Lap Timers must be on. These codes will Stop the others from racing against you in Grand Prix mode. To win a race in Grand Prix you must finish at least one lap in the qualify round, then complete all laps in race for first. + 8013CBC5 0001 + cn Laps Of Race + 8013CBBE ???? 0001:"1 Lap",0002:"2 Laps",0003:"3 Laps",0004:"4 Laps",0005:"5 Laps",0006:"Never Ending Laps" + cn Play As\Player 1 + 8013CEC5 ???? 0000:"N64 Control Pad",0001:"Interceptor",0002:"Hornet",0003:"Avenger",0004:"Shredder",0005:"Black Lightning",0006:"Vengeance",0007:"Prowler",0008:"Reaper",0009:"Dominator" + cn Level Select + cd For this cheat to work,as soon as you put the cheat on you must turn it back off,if not you wont beable to quit a Race or even finish one. + 8013CECB ???? 0000:"Canyon Rush",0001:"Bikini Island",0002:"China Town",0003:"Neo Arena",0004:"China Town Jam",0005:"Neo Speed Way" + cn Play As\Player 2 + 8013CEC6 ???? 0000:"N64 Control Pad",0001:"Interceptor",0002:"Hornet",0003:"Avenger",0004:"Shredder",0005:"Black Lightning",0006:"Vengeance",0007:"Prowler",0008:"Reaper",0009:"Dominator" + cn Always 1st + 8013CC10 0001 + cn Music Modifier + 80106B7C ???? 00FF:"Music On",0000:"Music Off" + +crc B6951A94-63C849AF-C:4A +gn Akumajou Dracula Mokushiroku - Real Action Adventure (J) + cn Infinite\Health + 81389C3E 0064 + cn Infinite\Throwing Weapon + 81389C48 0064 + cn Throwing Weapon Modifier + 81389C42 ???? 0000:"Nothing",0001:"Knives",0002:"Exploding Potions",0003:"Cross",0004:"Axes" + cn Press L To Levitate + D0387D7F 0020 + 81350810 3FCB + cn Have\All Items + 50000501 0000 + 80389C4A 0001 + 50000301 0000 + 80389C51 0001 + 80389C5A 0001 + 80389C5B 0001 + 80389C5D 0001 + 50000E01 0000 + 80389C60 0001 + cn Have\Invincibility + 80342BFE 000B + cn Infinite\Red Jewels + 80389C49 0063 + cn Status + 80389C88 ???? 0001:"Good",0008:"Vamp",0011:"Poison",0022:"Good but depressed",0066:"Sto",001F:"V+P" + cn Open All Doors and Gates,No Bosses + 50002A02 0000 + 81389BD0 FFFF + cn Infinite\Energy + 80389C3F 0064 + cn Infinite\Funds + 80389C45 0001 + 81389C46 869F + cn Have\Exp Points + 80389C49 0063 + cn Max Power Up + 80389CED 0002 + cn Never Get Poisoned + 81389C88 0000 + cn Level Select + cd You must use this code on a saved game, because the intro to the first level will mess up the game. Now select the saved game, and hold down the GS button until the level loads. Some of the boss stages will not let you fight the boss unless you re-enter the area. Also, with the part of stage modifier, the second code modifies the part of the level that you are in, and 0000 is the level's start. + 89389C90 ???? 0000:"Forest of Silence",0002:"Castle Wall",0003:"Villa",0004:"Inside Villa",0006:"Garden Maze",0007:"Tunnel",0008:"Underground Waterway",0009:"Castle Center",0010:"Tower of Execution",0011:"- Tower of Sorcery",0012:"- Tower of Science",0013:"- Duel Tower",0014:"- Fight With Death/Actrise",0015:"- Castle Keep",0016:"- Intro (Glitch)",0017:"- Clock Tower",0018:"- Final Dracula",001A:"- Fight With Maze Boss",001B:"- Room of Clocks",001C:"- ??",001D:"- ??" + 89389C92 0000 + cn Switch From + cd This Switch From Cheat lets you switch characters on a saved game For example, if you are Reindhart and you want to be Carrie in the middle of your game save it and then enable this Cheat and press F1. when you start your saved game back up you'll be Carrie instead of Reindhart. + 80389C3D ???? 0000:"Carrie to Reindhart",0001:"Reindhart to Carrie" + +crc A5533106-B9F25E5B-C:4A +gn Akumajou Dracula Mokushiroku Gaiden-Legend of Cornell (J) + cn Infinite\Keys\Clocktower A + 801CC51F 000A + cn Infinite\Keys\Clocktower B + 801CC520 000A + cn Infinite\Keys\Storeroom + 801CC510 000A + cn Infinite\Keys\Garden + 801CC511 000A + cn Infinite\Keys\Copper + 801CC512 000A + cn Infinite\Keys\Chamber + 801CC513 000A + cn Infinite\Keys\Execution + 801CC514 000A + cn Infinite\Keys\Deck + 801CC515 000A + cn Infinite\Keys\Rose Garden + 801CC516 000A + cn Infinite\Keys\Thorn + 801CC517 000A + cn Infinite\Keys\Clocktower C + 801CC518 000A + cn Infinite\Keys\Clocktower D + 801CC519 000A + cn Infinite\Keys\Art Tower 1 + 801CC51A 000A + cn Infinite\Keys\Art Tower 2 + 801CC51B 000A + cn Infinite\Keys\Control Room + 801CC51C 000A + cn Infinite\Keys\Wall + 801CC51D 000A + cn Infinite\Keys\Clocktower E + 801CC51E 000A + cn Infinite\Keys\Archives + 801CC50E 000A + cn Infinite\Keys\Left Tower + 801CC50F 000A + cn Infinite\Health + 811CC4EA 2710 + cn Infinite\Gold + 811CC4F2 2710 + cn Infinite\Specials\Special 1 + 801CC4F7 000A + cn Infinite\Specials\Special 2 + 801CC4F8 000A + cn Infinite\Specials\Special 3 + 801CC4F9 000A + cn Infinite\Items\Roast Chicken + 801CC4FA 000A + cn Infinite\Items\Roast Beef + 801CC4FB 000A + cn Infinite\Items\Healing Kit + 801CC4FC 000A + cn Infinite\Items\Purifying + 801CC4FD 000A + cn Infinite\Items\Cure Ampoule + 801CC4FE 000A + cn Infinite\Items\Powerup + 801CC4FF 000A + cn Infinite\Items\The Contract + 801CC504 000A + cn Infinite\Items\Magical Nitro + 801CC505 000A + cn Infinite\Items\Mandragora + 801CC506 000A + cn Infinite\Items\Sun Card + 801CC507 000A + cn Infinite\Items\Moon Card + 801CC508 000A + cn Infinite\Items\Winch Lever + 801CC509 000A + cn Infinite\Items\Oldrey's Diary + 801CC50A 000A + cn Infinite\Items\Crest Half A + 801CC50B 000A + cn Infinite\Items\Crest Half B + 801CC50C 000A + cn Infinite\Items\Rose Brooch + 801CC50D 000A + cn Infinite\Items\Throwing Weapons + 801CC4F5 0064 + cn Infinite\Items\Red Jewels on Pick-Up + 801CC4F5 0068 + cn Infinite\Bullets + cd For Henry + 801D5753 0006 + cn Wolfman Can Use Weapons + cd For Cornell + 801CC4E7 0002 + cn Wolfman Can't Use Weapons + cd For Cornell (Default) + 801CC4E7 0004 + cn Rapid Fire Gun (Henry-Hold B) + cd For Henry, Hold B + D11CA1A6 0040 + 801D5753 0006 + cn Max Powerups + 801CC7D3 0002 + cn Stop Timer Input + 811CC4D2 0001 + cn Hard Mode Selected In A New Game + cd With this code, you will not see the hard level status until you save and restart the game file. No special items are required to access this feature with this code turned on. + 8032630F 0002 + cn Weapon Modifier + 811CC4EE ???? 0000:"Nothing",0001:"Knife",0002:"Potion",0003:"Cross",0004:"Axe" + cn Level Modifier + 801CC829 ???? 0000:"Forest Of Silence",0001:"Left Tower",0002:"Castle Wall",0003:"Villa",0004:"Villa",0005:"Villa",0006:"Villa",001A:"Villa",0007:"Tunnel",0008:"Underground Waterway",0009:"Castle Center",000A:"Castle Center",000B:"Castle Center",000C:"Castle Center",000D:"Castle Center",000E:"Castle Center",000F:"Castle Center",0010:"Foggy Lake",0011:"Foggy Lake",0012:"Foggy Lake",0013:"Cave Of Spiderwomen",0014:"Castle Keep",0015:"Castle Keep",0016:"Falls Into Space(?)",0017:"Clock Tower",0018:"Final Battle Site",0019:"Castle Center",001B:"Room Of Clocks",001C:"Countryside Where Carrie's Mom Is Buried.(Fall Through Ground)",002B:"Countryside Where Carrie's Mom Is Buried.(Fall Through Ground)",001D:"Tower Of Sorcery",001E:"Tower Of Execution",001F:"Tower Of Execution",0020:"Tower Of Execution",0021:"Tower Of Science",0022:"Tower Of Science",0023:"Tower Of Ruins",0024:"Tower Of Ruins",0025:"Art Tower",0026:"Art Tower",0027:"Dual Tower",0028:"Clock Tower",0029:"Clock Tower",002A:"Outer Wall",002C:"Fall From Sky Ouside Of Castlevania Opening",002D:"Another Free Fall. Forest Where Girl Runs In Opening",002E:"Black Room(?)" + cn Inter-Level Modifier + 801CC82B ???? 0000:"Forest Of Silence",0001:"Left Tower",0002:"Castle Wall",0003:"Villa",0004:"Villa",0005:"Villa",0006:"Villa",001A:"Villa",0007:"Tunnel",0008:"Underground Waterway",0009:"Castle Center",000A:"Castle Center",000B:"Castle Center",000C:"Castle Center",000D:"Castle Center",000E:"Castle Center",000F:"Castle Center",0010:"Foggy Lake",0011:"Foggy Lake",0012:"Foggy Lake",0013:"Cave Of Spiderwomen",0014:"Castle Keep",0015:"Castle Keep",0016:"Falls Into Space(?)",0017:"Clock Tower",0018:"Final Battle Site",0019:"Castle Center",001B:"Room Of Clocks",001C:"Countryside Where Carrie's Mom Is Buried.(Fall Through Ground)",002B:"Countryside Where Carrie's Mom Is Buried.(Fall Through Ground)",001D:"Tower Of Sorcery",001E:"Tower Of Execution",001F:"Tower Of Execution",0020:"Tower Of Execution",0021:"Tower Of Science",0022:"Tower Of Science",0023:"Tower Of Ruins",0024:"Tower Of Ruins",0025:"Art Tower",0026:"Art Tower",0027:"Dual Tower",0028:"Clock Tower",0029:"Clock Tower",002A:"Outer Wall",002C:"Fall From Sky Ouside Of Castlevania Opening",002D:"Another Free Fall. Forest Where Girl Runs In Opening",002E:"Black Room(?)" + cn Cut Scene Modifier + cd With this code, you must use the appropiate level mod before you attemp to run these cut scenes. Not doing so will ruin the cut scene as the graphics will be glitched. + 801CC843 0009 + 801CC83B ???? 0003:"Castle Drawbridge Lowers",0004:"Character Enters Castle",0005:"(?)",000A:"(?)",000C:"(?)",0020:"(?)",0021:"(?)",0022:"(?)",0006:"Vampire In Main Entrance Hall Of Villa",0007:"One Of The Working Gears Cut Scenes",0008:"\"I Smell Poison\" From Underground Waterway",0009:"Castle Gate Closes In Villa Upon Entering Villa",000B:"Renon Appears For First Time",000D:"Village Vampire In Upstairs Villa",000E:"Malus Appears For The First Time",000F:"Malus Leaves Garden",0010:"Character In Boat On Foggy Lake",0011:"Seal Removed From Wall In Arena",0012:"Bleeding Statue",0013:"Cosmic Lights",0014:"Explosion At Wall In Arena",0015:"Explosion At Wall In Castle That Leads To Hidden Room",0016:"Malus Appears Again In Upstairs Room Of Castle",0017:"Bull Awakens",0018:"Vincent The Vampire",0019:"One Of The Working Gears Cut Scenes",001A:"Gate Opens In Forest Of Silence",001B:"Meet Renon For The Last Time In Castle Keep.",001C:"This Cut Scene Runs Cut Scene 27 And 2E",001E:"Castle Keep Destructs",001F:"Malus On Flying Horse Outside Castle Keep",0024:"Spider People In Tunnel",0025:"Rosa In Garden",0027:"Castel Destruction",0028:"Space Warp",0029:"Castle Destruction",002A:"Malus Is Saved By Reinhardt",002B:"Malus And Reinhardt On Horse",002E:"Rosa Returns",0030:"Ada, Henry And Cornell At Game End",0031:"Scrolling Text About Castle And Henry",0033:"Vampire In Basement",0034:"Vampire In Villa Basement Destroyed, Woman Vampire Rises",0035:"Finds Hidden Path In Villa Basement",0037:"Lever & Gear In Castle",0038:"Harpie",0039:"Harpie Destroyed",0044:"Death(Grim Reaper)",0045:"Death Is Destroyed",0046:"Castle Drawbridge Closes And Ortega Appears",0047:"Thirsty Man",0048:"Cornell Meets Henry In Garden",0049:"Cornell And Henry Part In Garden",0051:"Monster Dracula Appears",0052:"Actrise Appears In Castle Center",0054:"Actrise Appears Again With Cousin Fernandes Before Fight With Carrie",0055:"Cousin Fernandes Is Destroyed",0056:"Actrise Appears Again Before Fight With Carrie",0057:"Actrise Defeated By Carrie" + cn Enable All Characters + 8031CBF3 0004 + cn Character Modifier + 8031CBDB ???? 0005:"Henry",0006:"Reinhardt",0007:"Carrie" + cn Status Modifier + 801CC534 ???? 0000:"Never Get Poisoned or Vamped",0001:"Normal",0004:"Vamp",0008:"Poison",000C:"Vamped & Poisoned",00FF:"Instant Death" + cn Max Weapon Power-Up + 801CC7D7 0002 + cn Day Modifier For Adult Henry + 801CC4CF ???? 0000:"7 Days",0001:"6 Days",0002:"5 Days",0003:"4 Days",0004:"3 Days",0005:"2 Days",0006:"1 Day",0007:"0 Days" + cn Infinite\Health Young Henry + D11CA1A6 0010 + 813A6D10 2800 + +crc 6C45B60C-DCE50E30-C:4A +gn Airboarder 64 (J) + cn Infinite Turbo\Player 1 + 80166019 0009 + cn Infinite Turbo\Player2 + 80167991 0009 + cn Infinite Time\Street Work & Coin + 801137E9 0028 + cn Infinite Time\Attack Time Time 000000 + 811137EA 0000 + cn Infinite Time\Time Attack + 801137EB 0000 + cn Access All Boards & Characters + 800500C1 000C + cn Maxed Out Turbo Bar + 811656E8 429F + 80166017 0051 + cn Class Score Select + 8016609E ???? 0020:"Class C",0040:"Class B",0064:"Class A",00FF:"Class S" + cn Coin Perfect Select + cd this is for Coin Mode to get Perfect Coin Collection Score straight away when you enter the level + 801660B3 ???? 0014:"Green Park Level 1",001A:"Green park Level 2",002B:"Green park Level 3",004A:"Lost Forest Level 1",0059:"Lost Forest Level 2",0080:"Lost Forest Level 3",007D:"Snow Festival 64 Levels 1 2 & 3",006F:"Sunset Island Level 1",0074:"Sunset Island Level 2",0081:"Sunset Island Level 3",006E:"Giant House Level 1",0077:"Giant House Level 2",0072:"Giant House Level 3" + cn Options\Music Modifier + 800500A9 ???? 00FF:"BGM On",0000:"BGM Off" + cn Options\Sound Effects Modifier + 810500AA ???? 00FF:"SE On",0000:"SE Off" + cn Options\Camera Type Modifier + 810500A6 ???? 0000:"Roll On Near",0001:"Roll On Mid",0002:"Roll On Far",0003:"Roll Off Near",0004:"Roll Off Mid",0005:"Roll Off Far" + cn Options\DJ Function Modifier + 810500AC ???? 0001:"DJ Function On",0000:"DJ Function Off" + cn All Street Work Levels Unlocked + 50007801 0000 + 80050170 ???? 0001:"Courses unlocked",0003:"Courses unlocked with C rank",0004:"Courses unlocked with B rank",0005:"Courses unlocked with A rank",0006:"Courses unlocked with S rank" + +crc E340A49C-74318D41-C:4A +gn Baku Bomberman (J) + cn Invincible\Player 1 + 800AEE01 0001 + cn Have\Pumped up Red Remote Bombs + 802AC653 0004 + cn Infinite\Lives + 802AB857 0063 + cn Infinite\Gems + 802AB85F 0063 + cn Infinite\Credits + 802AB85B 0009 + cn Infinite\Time + 802AB873 0001 + cn Carry 20 Bombs At A Time + 800AEE0F 0014 + cn Infinite\Energy\Player 1 + 800AEE07 0002 + cn Infinite\Energy\Player 2 + 800AEECF 0002 + cn Infinite\Energy\Player 3 + 800AEF97 0002 + cn Infinite\Energy\Player 4 + 800AF05F 0002 + +crc E73C7C4F-AF93B838-C:4A +gn Baku Bomberman 2 (J) + cn Infinite\Money + 810A9BB2 FFFF + cn Infinite\Bombs + 800AB5B8 0003 + cn Have\Max Fire Level + 800AB593 0003 + cn Infinite\Health + 800AB5BF 0005 + cn Infinite\Continue Time + 810B3B36 0090 + cn Have\Fire Bombs + 800AB59B 0003 + cn Have\Kick Bombs Anytime + 800AB5A3 0003 + cn Flashing Invincible + cd This cheat Makes you Flash But you cant be harmed,Once out of danger Turn the cheat off to stop the flashing.also do not put this on if you have already been hurt or you will stay on the floor. + 800AB5C7 000A + +crc 5168D520-CA5FCD0D-C:4A +gn Banjo to Kazooie no Dai Bouken (J) + cn Infinite\Eggs + 80386AA7 00FF + cn Infinite\Lives + 80386ACB 00FF + cn Infinite\Jiggies + 80386B0B 00FF + cn Infinite\Notes + cd Just collect one Note to Have 255 Notes in all Worlds. + 80386B32 00FF + 80386AA2 0001 + cn Infinite\Health + 80386AC3 0008 + 80386AC7 0008 + cn Infinite\Air + 81386ACE 0E10 + cn Infinite\Gold Feathers + 80386AB3 00FF + cn Infinite\Red Feathers + 80386AAF 00FF + cn Infinite\Always Have All Jinjos + 80386ABB 00FF + cn Have Zero Time all Levels + 50000B04 0000 + 81386B44 3000 + cn Infinite\Mumbo Tokens + 80386B07 00FF + +crc 514B6900-B4B19881-C:4A +gn Banjo to Kazooie no Dai Bouken 2 (J) + cn Infinite\Energy\Banjo and Kazooie + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 80115329 0063 + 81115A04 0A0A + cn Infinite\Air + 80125222 42C8 + cn Infinite\Energy\Snowball + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 80115329 0063 + 80115907 0005 + cn Infinite\Energy\Bee + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 80115329 0063 + 80115913 000A + 80115914 000A + cn Infinite\Energy\Washing Machine + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 80115329 0063 + 81115916 0A0A + cn Infinite\Energy\Stony + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 80115329 0063 + 80115919 000A + 8011591A 000A + cn Infinite\Energy\Banjo + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 80115329 0063 + 8011591F 000A + 80115920 000A + cn Infinite\Energy\Kazooie + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 80115329 0063 + 81115922 0A0A + cn Infinite\Energy\Submarine + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 80115329 0063 + 80115925 000A + 80115926 000A + cn Infinite\Energy\Mumbo + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 80115329 0063 + 81115928 0A0A + cn Infinite\Energy\Detonator + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 80115329 0063 + 8111592E 0A0A + cn Infinite\Energy\T-Rex Baby + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 80115329 0063 + 8011593F 000A + 80115940 000A + cn Play As + cd To use this cheat, put the cheat on, then press L as you walk through a door to become that chosen character + D0080845 0020 + 801211FC ???? 0001:"Banjo and Kazooie",0002:"Snowball",0006:"Bee",0007:"Washing machine",0008:"Stony",000A:"Banjo",000B:"Kazooie",000C:"Submarine",000D:"Mumbo",000E:"Golden Goliath",000F:"Detonator",0010:"Truck",0012:"T-rex baby",0013:"T-rex daddy" + cn Instant Warp\Options\Spiral Mountain + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D1080844 0000 + 811217F0 ???? 0000:"AD Grunty's Old Lair",0000:"AE Behind The Waterfall",0000:"AF Top Of Castle",0001:"73 Banjo's house" + 801217F3 0001 + cn Instant Warp\Options\Jinjo Village + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D1080844 0000 + 811217F0 ???? 0001:"42 Jinjo Village",0001:"44 King Jingalings throne room",0001:"43 Bottles house",0001:"45 Green Jinjo's House",0001:"46 Black Jinjo's House",0001:"47 Yellow Jinjo's House",0001:"48 Blue Jinjo's House",0001:"4A Brown Jinjo's House",0001:"4B Orange Jinjo's House",0001:"4C Purple Jinjo's House",0001:"4D Red Jinjo's House",0001:"4E White Jinjo's House" + 801217F3 0001 + cn Instant Warp\Options\Mayahem Temple + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D1080844 0000 + 811217F0 ???? 0000:"B6 Humba's Wigwam",0000:"B7 Mumbo's skull",0000:"B8 The Temple",0000:"B9 Prison Compound",0000:"BC Code chamber",0000:"C4 Jade Snake Grove",0000:"C5 Treasure Chamber",0000:"C6 Kickball Arena",0001:"77 Targitzan's Slighty Sacred Temple",0001:"78 Inside Targitzans Temple",0001:"79 Targitzan Temple Lobby",0001:"7A Targitzan's Temple Boss",0001:"7F Mayan Kickball Arena",0001:"66 Multi",0001:"67 Still",0000:"C8 Kickball Arena",0000:"C9 Kickball Arena" + 801217F3 0001 + cn Instant Warp\Options\Glitter Gulch Mine + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D1080844 0000 + 811217F0 ???? 0000:"C7 Mine",0000:"CA Fuel depot",0000:"CB Crushing shed",0000:"CC Flooded caves",0000:"CD Water storage",0000:"CE Waterfall cavern",0000:"CF Power hut basement",0000:"D0 Chuffy's cab",0000:"D1 Inside chuffy's boiler boss",0000:"D2 Gloomy caverns",0000:"D3 Generator caverns",0000:"D4 Power hut",0000:"D5 Wumba's wigwam",0000:"D7 Train station",0000:"D8 Prospectors hut",0000:"D9 Mumbo's hut",0000:"DA Toxic gas cave",0000:"DB Canary cave",0000:"DC Ordnance storage",0000:"E9 Humba",0001:"26 Water supply pipe",0001:"63 Ordnance Storage entrance",0001:"64 Ordnance Storage game",0001:"65 Ordnance Storage game Multi",0001:"6F Testing",0001:"70 Testing",0001:"71 Mumbo's skull" + 801217F3 0001 + cn Instant Warp\Options\Witchy World + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D1080844 0000 + 811217F0 ???? 0000:"D6 Witcy World",0000:"DD Dodgem dome lobby",0000:"DE Dodgem challenge \"1 vs 1\"",0000:"DF Dodgem challenge \"2 vs 1\"",0000:"E0 Dodgem challenge \"3 vs 1\"",0000:"E1 Crazy castle stockade",0000:"E2 Crazy castle lobby",0000:"E3 Crazy castle pump room",0000:"E4 Balloon burst game",0000:"E5 Hoop hurry game",0000:"E6 Star spinner",0000:"E7 The inferno",0000:"EA Cave of horrors",0000:"EB Haunted cavern",0000:"EC Train station",0001:"24 Saucer of Peril",0001:"3B Crazy castle stockade \"sop\"",0001:"3C Star spinner \"sop\"",0001:"76 Mumbo's skull" + 801217F3 0001 + cn Instant Warp\Options\Jolly Roger's Lagoon + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D1080844 0000 + 811217F0 ???? 0000:"ED Jolly's",0000:"EE Pawno's emporium",0000:"EF mumbo's skull",0000:"F4 Ancient Swimming Baths",0000:"F6 Electric Eels lair",0000:"F7 Seaweed Sanctum",0000:"F8 Inside the big fish",0000:"FA temple of the fishes",0001:"A8 Atlantis",0001:"A9 Seabottom",0001:"81 sea bottom cavern",0001:"82 submarine multi",0001:"A7 Jolly Roger's Lagoon",0000:"FF Blubber's wave race hire" + 801217F3 0001 + cn Instant Warp\Options\Terrydacty Land + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D1080844 0000 + 811217F0 ???? 0001:"12 Terrydacty Land",0001:"13 Terry's nest",0001:"14 Train station",0001:"15 Oogle boogles cave",0001:"16 Inside the mountain",0001:"17 River passage",0001:"18 Styracosaurus family cave",0001:"19 Unga bunga's cave",0001:"1A Stomping plains",0001:"1B Bonfire caverns",0001:"1E Humba's Wigwam",0001:"23 Inside chompa's belly",0001:"83 Chompa's belly multi" + 801217F3 0001 + cn Instant Warp\Options\Grunty Industries + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D1080844 0000 + 811217F0 ???? 0001:"00 Outside",0001:"01 Inside",0001:"02 Train station",0001:"03 Workers quarters",0001:"04 Trash compactor",0001:"05 Elevator shaft",0001:"06 Floor 2",0001:"07 Floor 2 \"electromagnet chamber\"",0001:"08 Floor 3",0001:"09 Floor 3 \"boiler plant\"",0001:"0A Floor 3 \"packing room\"",0001:"0B Floor 4",0001:"0C Floor 4 \"cable room\"",0001:"0D Floor 4 \"quality control\"",0001:"0E Floor 5",0001:"0F Basement",0001:"10 Basement \"repair depot",0001:"11 Basement \"waste disposal\"",0001:"25 Water supply pipe",0001:"72 Mumbo's skull",0001:"62 Floor 4 \"clinkers cavern\"",0001:"87 Sewer entrance" + 801217F3 0001 + cn Instant Warp\Options\Hailfire Peaks + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D1080844 0000 + 811217F0 ???? 0001:"27 Lava side",0001:"28 Icy side",0001:"29 Lava train station",0001:"2A Ice train station",0001:"2B Chilli billi",0001:"2C Chilly willy",0001:"2D Colosseum kickball stadium lobby",0001:"31 Boggy's igloo",0001:"32 Icicle grotto",0001:"33 Inside the volcano",0001:"68 Icy side still" + 801217F3 0001 + cn Instant Warp\Options\Cloud Cuckoo Land + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D1080844 0000 + 811217F0 ???? 0001:"36 Cloud Cuckoo Land 1",0001:"37 Inside the trashcan",0001:"38 Inside the cheesewedge",0001:"39 Zubba's nest",0001:"3A Central cavern",0001:"3D Inside the pot o gold",0001:"3E Mumbo's skull",0001:"3F Mingy jongo's skull",0001:"40 Humba wumba's wigwam",0001:"61 Cloud Cuckoo Land 2",0001:"88 Zubba's nest multi",0001:"85 Trash can mini" + 801217F3 0001 + cn Instant Warp\Options\Isle O Hags + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D1080844 0000 + 811217F0 ???? 0001:"4F Wooded Hollow",0001:"50 Heggy's egg shed",0001:"51 Jiggywiggy's temple",0001:"52 Plateau",0001:"53 Plateau \"Honey B's Hive\"",0001:"54 Pine Grove",0001:"55 Cliff top",0001:"56 Cliff top Mumbo's skull",0001:"5A wasteland",0001:"5B inside another digger tunnel",0001:"5C Quagmire" + 801217F3 0001 + cn Instant Warp\Options\Cauldron Keep + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D1080844 0000 + 811217F0 ???? 0001:"5D Cauldron Keep",0001:"5E The gatehouse",0001:"5F Tower of Tragedy Quiz",0001:"60 Gun chamber",0001:"6A Gun room still",0001:"7B Crazy Castle Stockade balloon burst multi",0001:"7C Crazy Castle Stockade Jump the hoops multi",0001:"7D Grunty Industries packing game",0001:"80 Colosseum kickball arena",0001:"86 Dodgems" + 801217F3 0001 + cn Instant Warp\Options\Not sure + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D1080844 0000 + 811217F0 ???? 0000:"FC Lord woo fak fak",0000:"F9 Mr Patch",0001:"21 Inside Chuffy's wagon",0001:"34 Mumbo's Skull",0001:"35 Humba Wumba's wigwam 1",0001:"57 Humba Wumba's wigwam 2",0001:"9B Jingalings Zombified Palace",0001:"A6 Smuggler cavern",0001:"41 Inside the digger tunnel",0001:"43 Bottles house",0001:"69 Bottles house still",0001:"8A HAG Inside",0001:"9A HAG1 Final Boss" + 801217F3 0001 + cn Beta Bottles Revenge Mode + cd Bottles Revenge is a Beta mode from Banjo Tooie that the RWP team recently uncovered after an extraordinary amount of effort. Bottles the Spirit transforms into Bottles the Devil and posses enemies nearby and allows a second player hooked up to Pad 2 to play as that Posses character to try to foil Banjos Plans. As player one goes about its business, player two uses every enemy nearby to try to nab Banjo and take away some life. This mode is incredible, and you can control almost every enemy in the game: slot machines, flying creatures, uggers, zubbas...and this is just the beginning. (Congrats Rare Witch Project) + 801255C2 0001 + 80080881 0002 + +crc 91691C3D-F4AC5B4D-C:4A +gn Transformers - Beast Wars Metals 64 (J) + cn Infinite\Health\Player 1 + 8112A576 270F + cn Infinite\Stun Meter\Player 1 + 8012A579 00FF + cn Infinite\Health\Player 2 + 8114AAF6 270F + cn Infinite\Stun Meter\Player 2 + 8014AAF9 00FF + cn Play As\Player 1 + 801BBA54 ???? 0000:"Optimus Primal",0001:"Rattrap",0002:"Cheetor",0003:"Airazor",0004:"Megatron",0005:"Tarantulas",0006:"Waspinator",0007:"Terrorsaur" + cn Play As\Player 2 + 801BBA55 ???? 0000:"Optimus Primal",0001:"Rattrap",0002:"Cheetor",0003:"Airazor",0004:"Megatron",0005:"Tarantulas",0006:"Waspinator",0007:"Terrorsaur" + +crc 65234451-EBD3346F-C:4A +gn Blast Dozer (J) + cn Infinite\Hydraulics Sidesweeper + 803EDCE1 0063 + cn Infinite\Missiles Motor Bike + 803F8C53 0063 + cn Infinite\Boosts Buggy Vehicle + 803EE491 0064 + cn Sideswipe\Can Go In Water + 803EDCE2 0063 + cn Sidesweep\Can Go Through Anything + 803EDCE2 FFFF + cn J-Bomb Floats Through Anything + 803F7C5A 0001 + cn Rapid Fire\Ballista + 803F8C5D 0000 + cn Rapid Fire\Sideswipe + 803EDCE6 0000 + cn Drive Through Anything\Ballista + 803F8BF8 0001 + cn Drive Through Anything\Dump Truck + 813EEBE8 0101 + cn Drive Through Anything\Red, White, & Blue Car + 813EEFC8 0101 + cn Drive Through Anything\Skyfall + 813EE438 0101 + cn Drive Through Anything\Police Car + 813F8FD8 0101 + cn Drive Through Anything\Red Car + 813FC658 0101 + cn Drive Through Anything\Van + 813F93A8 0101 + +crc DF6FF0F4-29D14238-C:4A +gn Bomberman 64 - Arcade Edition (J) + cn Have\Max Fire + 8024A39E 00FF + cn Have\Max Bombs + 8024A39F 00FF + cn Bomb Select + 8024A3A1 ???? 0002:"Power Bomb",0003:"Jelly Bomb",0004:"Shock Wave Bomb",0005:"Blue Remote Bomb",0006:"Red Beem Bomb",0007:"Invisible Mine Bomb",001D:"Crazy Bomb",0000:"Clear All Special Bombs." + cn Walk through\Blocks + cd Walk through Blocks like they are not there.Turn cheat to off to go back to normal. + 8024A3A5 ???? 0000:"Off",0001:"On" + cn Bomberman Speed + 8024A3A0 ???? 0004:"Slow",0008:"Normal",000E:"Fast",0010:"Turbo" + cn Have\Infinite\Kick + 8024A3A6 0002 + cn Invincible + cd Enemies & Bomb Blasts cant harm you.But if you walk & keep laying Bombs it will most likly freeze.so try to avoid constant bombing while walking.Turn cheat to off to go back to normal. + 8024A3A8 ???? 0000:"Off",0001:"On" + cn Walk through\Bombs + cd Walk through Bombs like they are not there.Turn cheat to off to go back to normal. + 8024A3A6 ???? 0000:"Off",0001:"On" + cn Infinite\Health Hearts + 8024A3AE 00FF + cn Infinite\Lives + 802E1CE7 00FF + cn Infinite\Timer + 800FDD72 002A + +crc 67FF12CC-76BF0212-C:4A +gn Bomberman Hero (J) + cn Full\Bomb Power + 80165239 0003 + cn Full\Fire Power + 8016523A 0003 + cn Infinite\Health + 8016523E 0004 + cn Infinite\Lives + 8016523D 0009 + cn Extra Gems + D016523B 0000 + 8016523B 004B + cn Max\Bombs + 80165239 0008 + cn Press L to Levitate + cd Press L to levitate & let go to come back down + D005A2F5 0020 + 81154178 41CB + D005A2F5 0020 + D0154154 0000 + 80154154 0040 + cn Max\Score + 80177601 00FF + 80177602 00FF + cn Max\Explosion + 8016523A 0008 + +crc D7C762B6-F83D9642-C:4A +gn Buck Bumble (J) + cn Have All\Guns & Infinite Ammo + cd Press C Left to receive all Guns + 81101DFA 0001 + 50000B04 0000 + 810EB156 03E7 + cn Infinite\Health + cd If you fall into Water just turn off the Infinite Health & put back on after. + 810EB148 42D8 + cn Infinite\99 Lives + 810EB4C0 0005 + cn Have All\Keys + 810EB150 0101 + 800EB152 0001 + cn Max Bonus + 810EB4BA 270F + +crc A4F2F521-F0EB168E-C:4A +gn Chameleon Twist (J) + cn Extra Crowns + 8024790B 0015 + cn Infinite Health + 80168E73 000A + cn Extended Tongue + 8132790E FFFF + cn Level Select + cd When you press Pause in-game and Stage Quit yo will go to the Stage Screen this cheat lets you choose what Stage you would like to go to but make sure you turn the cheat off and press A to continue to that stage. + 8029BF7B ???? 0000:"Stage 1",0001:"Stage 2",0002:"Stage 3",0003:"Stage 4",0004:"Stage 5",0005:"Stage 6",0006:"Stage 7" + +crc 0549765A-93B9D042-C:4A +gn Chameleon Twist 2 (J) + cn Infinite Health + 80187BBD 000F + cn Max Collectable Items + 80160641 0014 + cn Have 6 Carrots + 80160659 007E + cn Have All\Levels + 80160648 003F + cn Have All\Costumes + 8016065A 00FE + cn Have All\Collectibles\Stage 1 + 80160650 0014 + cn Have All\Collectibles\Stage 2 + 80160651 0014 + cn Have All\Collectibles\Stage 3 + 80160652 0014 + cn Have All\Collectibles\Stage 4 + 80160653 0014 + cn Have All\Collectibles\Stage 5 + 80160654 0014 + cn Have All\Collectibles\Stage 6 + 80160655 0014 + cn Press L To levitate + cd Press L To Levitate & Let go to land + D0187BF5 0020 + 81187B20 4200 + +crc 2BCCF9C4-403D9F6F-C:4A +gn Choro Q 64 (J) + cn Super Speed + cd This is Turbo fast,So to slow it down a little more keep the B button pressed down + 81213568 4800 + cn Always 1st + 802133B6 0001 + cn Class Select + cd This code is useful because you can play Class AA without having to beat a level! + 80206857 ???? 0000:"Class C",0001:"Class B",0003:"Class AA",0004:"1 Play",0005:"2 Play",0006:"3 Play",0007:"4 Play" + +crc 079501B9-AB0232AB-C:4A + cn All Stuff Available For Player 1 + cd This modifies your save file. That will make all the multiplayer stages available, as well as unlocking every part. The actual breakdown is: + 50003802 0000 + 810F4230 FFFF + cn All Equipment Unlocked + 50001402 0000 + 810F40B0 FFFF + cn All Equipment Registered + 50001402 0000 + 810F40D8 FFFF + cn All Equipment Unhighlighted + 50001402 0000 + 810F4100 FFFF + cn All Help Notes Available For Player 1 + 50000602 0000 + 810F409C FFFF + cn Side Invincible\Player 1 + 811FC00C 447A + cn Side Invincible\Player 2 + 811FC034 447A + +crc 7188F445-84410A68-C:4A +gn Dance Dance Revolution - Disney Dancing Museum + cn Maximum Song Score\Player 1 + 8108A260 3B9A + 8108A262 C9FF + cn Maximum Song Score\Player 2 + 8108A264 3B9A + 8108A266 C9FF + cn Maximum Total Score\Player 1 + 810854E0 3B9A + 810854E2 C9FF + cn Maximum Total Score\Player 2 + 81085518 3B9A + 8101551A C9FF + cn Maximum Dance Gauge\Player 1 + 810854DC 03E8 + cn Maximum Dance Gauge\Player 2 + 81085514 03E8 + cn Unlock All Songs + 8015621D 00FF + 8115621E FFFF + cn Unlock All Puzzles + 50001902 0000 + 81156228 FFFF + cn Can Skip End Credits + 8015627F 0001 + cn Endless Mode + 800854CD 0000 + cn Results\999 Perfect Steps\Player 1 + 8108A21E 03E7 + cn Results\999 Perfect Steps\Player 2 + 8108A236 03E7 + cn Results\999 Great Steps\Player 1 + 8108A222 03E7 + cn Results\999 Great Steps\Player 2 + 8108A23A 03E7 + cn Results\0 Good Steps\Player 1 + 8108A226 0000 + cn Results\0 Good Steps\Player 2 + 8108A23E 0000 + cn Results\0 Boo Steps\Player 1 + 8108A22A 0000 + cn Results\0 Boo Steps\Player 2 + 8108A242 0000 + cn Results\0 Miss Steps\Player 1 + 8108A22E 0000 + cn Results\0 Miss Steps\Player 2 + 8108A246 0000 + +crc 8979169C-F189F6A0-C:4A +gn Dezaemon 3D (J) + cn Infinite\99 Lives + 8023648D 0063 + cn Unlock Ramsie Mini-Game + 801FF43E 0001 + cn Max Score + 80249F91 00FF + cn Infinite\Speed + 8024B6BC ???? 0000:"Normal",0001:"Slow",0002:"Medium",0003:"Fast",0007:"Warp Drive" + cn Infinite\Stream Laser + 80236CD0 ???? 0000:"2 Stream Laser",0001:"4 Stream Laser",0002:"6 Stream Laser" + cn Infinite\Shield + 80250971 ???? 0001:"On",0000:"Off" + cn Infinite\99 R Button Bombs + 8024BD89 0063 + +crc 7AA65B36-FDCEE5AD-C:4A +gn Doom 64 (J) + cn Always Have\Gun + 80063B33 0001 + cn Always Have\Shotgun + 80063B37 0001 + cn Always Have\Double Shotgun + 80063B3B 0001 + cn Always Have\Chain Gun + 80063B3F 0001 + cn Always Have\Missile Launcher + 80063B43 0001 + cn Always Have\Chainsaw + 80063B2B 0001 + cn Always Have\Plasma Rifle + 80063B47 0001 + cn Always Have\BFG 9000 + 80063B4B 0001 + cn Always Have\Have Rocket Launcher + 80063B41 0001 + cn Always Have\Laser Weapon + 80063B4D 0001 + cn Always Have\Bio Suite + 80063AF3 ???? 00FF:"On",0000:"Off" + cn Infinite\Armor + 80063ADF 00FF + cn Always Have\Rapid Fire + 81063BAA 0B94 + cn Invincible + 80063B7B 0002 + cn Turn Map Markers On + 80063B7B 0004 + cn Invincible And Map Markers + 80063B7B 0006 + cn Berserk Mode + 80063AEB 00FF + cn [Max Brightness] + cd Enable this cheat on rom load to have Max Brightness (internal) and then put Jabo d3d8 on 160% Max for a extra brightness Boost. + 8005B598 0064 + cn Have All\Weapons + 50000A04 0000 + 81063B2A 0001 + cn Infinite\Ammo All Weapons + 50000404 0000 + 81063B52 013C + cn Have All\Keys + 50000504 0000 + 81063AFE FFFF + cn Enable Cheat Menu + 8005B043 0001 + +crc BFF7B1C2-AEBF148E-C:4A +gn Doraemon - Mittsu no Seireiseki (J) + cn Infinite\Lives + 800F38C5 000A + cn Infinite\Energy + 800FB897 00FF + cn Infinite\Bells + 800F38C3 ???? 0063:"99 Bells",0000:"No Bells" + +crc BD8E206D-98C35E1C-C:4A +gn Dobutsu no Mori (J) + cn Hours + 80136FBE ???? 0000:"00 AM",0001:"01 AM",0002:"02 AM",0003:"03 AM",0004:"04 AM",0005:"05 AM",0006:"06 AM",0007:"07 AM",0008:"08 AM",0009:"09 AM",000A:"10 AM",000B:"11 AM",000C:"00 PM",000D:"01 PM",000E:"02 PM",000F:"03 PM",0010:"04 PM",0011:"05 PM",0012:"06 PM",0013:"07 PM",0014:"08 PM",0015:"09 PM",0016:"10 PM",0017:"11 PM" + cn Minutes + 80136FBD ???? 0000:"00",0005:"05",000A:"10",000F:"15",0014:"20",0019:"25",001E:"30",0023:"35",0028:"40",002D:"45",0032:"50",0037:"55",003B:"59" + cn Day + 80136FBF ???? 0001:"Monday 1st",0002:"Tuesday 2nd",0003:"Wednesday 3rd",0004:"Thursday 4th",0005:"Friday 5th",0006:"Saturday 6th",0007:"Sunday 7th",0008:"Monday 8th",0009:"Tuesday 9th",000A:"Wednesday 10th",000B:"Thursday 11th",000C:"Friday 12th",000D:"Saturday 13th",000E:"Sunday 14th",000F:"Monday 15th",0010:"Tuesday 16th",0011:"Wednesday 17th",0012:"Thursday 18th",0013:"Friday 19th",0014:"Saturday 30th",0015:"Sunday 21st",0016:"Monday 22nd",0017:"Tuesday 23rd",0018:"Wednesday 24th",0019:"Thursday 25th",001A:"Friday 26th",001B:"Saturday 27th",001C:"Sunday 28th",001D:"Monday 29th",001E:"Tuesday 30th",001F:"Wednesday 31st" + cn Month + 80136FC1 ???? 0001:"Jan",0002:"Feb",0003:"March",0004:"April",0005:"May",0006:"June",0007:"July",0008:"Aug",0009:"Sept",000A:"Oct",000B:"Nov",000C:"Dec" + cn Time Passes + 80136FD2 ???? 0000:"Time Normal",0001:"Mins Like Seconds",0005:"Hours & Mins Medium",0010:"Hours & Mins Fast",00FF:"Time Zooms By" + cn Max Cash + 813BC34C FFFF + cn Item Select + 81126EE8 ???? 1011:"Tall Red Cupboard",1C00:"Pet Cage",1CA6:"Fish Tank (Fish Included!)",1D2B:"Orange NES Game",1D2F:"Grey NES Game",1D33:"Red NES Game",1D37:"Light Blue NES Game",1D3A:"Yellow NES Game",1D3E:"Purple NES Game",1D42:"Blue NES Game",1D47:"Stereo NES Colour",1D4C:"Record Player",1D50:"JukeBox",1DA0:"Grandfather Clock",1DA6:"Stereo Kinda Thing",1DA9:"Stereo",1DAC:"CD Player",1DB3:"Alarm Clock",1EA1:"Lamp",1EA5:"Snowman Fridge",1EAB:"Round Snowman Table",1EAF:"Snowman Bed",1EB0:"Snowman Seat",2100:"1000 Bag",2100:"1000 Bag",2101:"10000 Bag",2101:"10000 Bag",2102:"30000 Bag",2102:"30000 Bag",2103:"100 Bag",2103:"100 Bag",2410:"Nook's Shirt",2410:"Nook's Shirt",2514:"Flat Shell",2514:"Flat Shell",2515:"Pointy Shell",2515:"Pointy Shell",2804:"Orange,2804 Orange" + +crc 056EAB63-C215FCD5-C:4A +gn Dual Heroes (J) + cn Infinite\Energy\Player 1 + 81224DC4 00FF + cn Infinite\Energy\Player 2 + 81224DC6 00FF + cn Infinite\Time + 81224DCC 00FF + cn Never Wins\Player 1 + 80224DB5 0000 + cn Never Wins\Player 2 + 80224DB7 0000 + +crc E13AE2DC-4FB65CE8-C:4A +gn Eltale Monsters (J) + cn Have All Elements + 8107A9F4 3232 + 8107A9F6 3232 + cn Infinite Health + 8107A9D4 01F4 + 8107A9D6 01F4 + cn Infinite Magic Points + 8107A9D8 01F4 + 8107A9DA 01F4 + cn Super Agility + 8107A9DE 01F4 + cn Super Defense + 8107A9DC 01F4 + +crc 399B9B81-D533AD11-C:4A +gn Extreme-G XG2 (J) + cn Max Points + 80183DD3 0064 + cn Infinite\Nitros + 81170F02 0003 + 81170F06 0003 + cn Infinite\Shield + 81170F2C 42C8 + cn Access\All Tracks + 50000BD8 0000 + 80183327 0001 + cn Access\All Superbikes + 50000304 0000 + 80183D6F 0001 + cn Access\All Secret Characters + 50000C04 0000 + 80183D6F 0001 + cn Always 1st + 80171063 0001 + cn [Screen Hud Clear] + cd This Fixes the Problem on all Plugins that have Hud covering the Screen.Let the game load 1st before Putting this code on,Or it will give an error and Freeze + 80092D1B 0004 + +crc 147E0EDB-36C5B12C-C:4A +gn Neon Genesis Evangelion (J) + cn (Press GS)\To Refill Health + cd Don't Press GS after the Enemy is killed, only during the fight! + 891F0F18 42C8 + 891F0F1A 0000 + cn (Press GS)\To Kill Enemy + cd Don't Press GS after the Enemy is killed, only during the fight! and only use on Press GS Cheat at a time + 891F2454 0000 + 891F2456 0000 + 891F2458 0000 + 891F245A 0000 + cn (Press L)\ For One Hit Kill + cd Don't Press L after the Enemy is killed, only during the fight! + D0149DD5 0020 + 811F2458 0000 + D0149DD5 0020 + 811F245A 0000 + cn (Press R)\For Level Warp + cd Press Reset and enjoy! + D00D5115 0015 + 800D5115 ???? 002B:"Level 01",002F:"Level 02",0033:"Level 03",0037:"Level 04",003B:"Level 05",003D:"Level 06",0040:"Level 07",0043:"Level 08",0046:"Level 09",0049:"Level 10",004C:"Level 11",004F:"Level 12",0051:"Level 12.5",0053:"Level 13",0018:"Credits 1",0019:"Credits 2",001A:"Credits 3" + cn Secret Beta 2 Player Test Mode + cd Press Reset and enjoy! Secret 2 Player Test Mode? The Second Player doesn't move ;( + D00D5115 0015 + 800D5115 0055 + +crc 4D3E622E-9B828B4E-C:4A +gn F-Zero X (J) + cn Always 1st Place + 802C4BC2 0001 + cn Infinite Lives + 800E5AA9 0005 + cn Unlock Everything + 800CD428 0001 + cn Player 1\Infinite Shield + 812C4B48 4336 + 812C4B4C 4336 + cn Have Boost From Start + D02C4DAC 003F + 802C4925 0050 + cn Time Always 00.00.00 1st Place + 802C4BC0 0000 + 802C4BC2 0001 + +crc 49E46C2D-7B1A110C-C:4A +gn Fighting Cup (J) + cn Start with Stars Modifier\Player 1 + D0208E17 0000 + 80208E17 ???? 0000:"No Stars",0006:"Max Stars" + cn Start with Stars Modifier\Player 2 + D020ACDF 0000 + 8020ACDF ???? 0000:"No Stars",0006:"Max Stars" + cn Have 1 Star\Ryuji + 80306A0E 0001 + cn Have 1 Star\Bob + 80306A0F 0001 + cn Have 1 Star\Pierre + 80306A10 0001 + cn Have 1 Star\Meiling + 80306A11 0001 + cn Have 1 Star\Leon + 80306A12 0001 + cn Have 1 Star\Abdul + 80306A13 0001 + cn Have 1 Star\Ninja + 80306A14 0001 + cn Have 1 Star\Tomahawk + 80306A15 0001 + cn Have 1 Star\Valerie + 80306A16 0001 + cn Infinite Health\Player 1 + 80208F61 0000 + 80203E83 0000 + cn Infinite Health\Player 2 + 80203E87 0000 + 8020AE29 0000 + cn Start on stage 100 on Survival to get Joker + 802EED3B 0063 + cn Stop timer for Fastest to get Robot + 810AD29C 3F80 + +crc 28D5562D-E4D5AE50-C:4A +gn Fire Electric Pen (J) + cn Freeze Timer + cd Only enable this cheat once the Timer Go moves to 80. Once the level has ended or you have died disable and enable on 80. + 800760CB 0001 + +crc 70B0260E-6716D04C-C:4A +gn GAUNTLET LEGENDS + cn Infinite\Max Health + 810C5C54 0000 + 810C5C56 270F + 810C5C64 0000 + 810C5C66 270F + cn Infinite\Money + 810C5CF6 FFFF + cn Max Strength + 810C5C04 0000 + 810C5C06 FFFF + cn Max Speed + 810C5C14 0000 + 810C5C16 FFFF + cn Max Magic + 810C5C24 0000 + 810C5C26 FFFF + cn Max Armour + 810C5C34 0000 + 810C5C36 FFFF + cn Infinite\Turbo + 800FD30F 0064 + cn Level 99 + 810C5C44 0000 + 810C5C46 0063 + cn Infinite\Special Weapons + 800C5FF7 0009 + 800C5D37 0009 + 800C5D67 0009 + 800C5DE7 0009 + 800C5EB7 0009 + cn Always Shoot 5-Way + 800FD198 0200 + cn Always Shoot 3-Way + 800FD19A 0002 + cn Always Shoot Rapid Fire + 800FD19A 1000 + cn Have Window Schards + 8104EFCA 000F + cn Have Rune Stones + 8104EFC6 1FFF + cn Infinite\Item On Pickup + 50010100 0000 + 810C5BF6 FFFF + cn Infinite\Keys On Pickup + 800C5C97 0006 + +crc 0DE2CE36-D41D29E6-C:4A +gn Hybrid Heaven (J) + cn Have All\Keys + 50000410 0000 + 80181C70 0063 + 50000410 0000 + 80181C78 0063 + cn Infinite\Weapons & Items + 50000610 0000 + 80181C10 0063 + 50000610 0000 + 80181C18 0063 + cn Infinite\Refresh Items + 50000D10 0000 + 80181B48 0063 + 50000C10 0000 + 80181B50 0063 + cn Infinite\Max Body Stats + 81181788 270F + 811817C8 0063 + 50000C02 0000 + 81181790 270F + 50000502 0000 + 811817C0 270F + 50000602 0000 + 811817E8 270F + 50000602 0000 + 811817F6 270F + cn Infinite\Max Health + 81181780 270F + 81181782 270F + cn Level 999 + 811817C8 270F + cn Press L To Levitate + D005D8D1 0020 + 8124C710 3FCB + +crc 519EA4E1-EB7584E8-C:4A +gn KING HILL 64 + cn Max\50000 Stunt Points + 8108C978 C350 + cn Low Timer + 8008C8A4 0000 + 8008C8A6 0000 + cn Have\All Characters + 8108C9B8 07FF + cn Have\All Difficulties + 8108C9B0 0700 + cn Have\All Tracks + 8108C9BC BFFE + cn Have\All Boards + 8108C9C4 0003 + 8108C9C6 FFFF + +crc 6BFF4758-E5FF5D5E-C:4A +gn Mario Kart 64 (J) (1.0) + cn Infinite Items\2 player Mode\Player 1 + 80163655 ???? + 80163682 ???? 000D:"Double Mushroom",0009:"Fake Item Box",000B:"Ghost",000A:"Invincible Star",0008:"Lightning",0001:"Single Banana",0003:"Single Green Shell",000C:"Single Mushroom",0005:"Single Red Shell",000F:"Super Mushroom",0004:"Triple Green Shell",000E:"Triple Mushroom",0006:"Triple Red Shell",0002:"Banana Bunch",0007:"Blue Spiny Shell" + cn Infinite Items\2 player Mode\Player 2 + 80163735 ???? + 80163762 ???? 000D:"Double Mushroom",0009:"Fake Item Box",000B:"Ghost",000A:"Invincible Star",0008:"Lightning",0001:"Single Banana",0003:"Single Green Shell",000C:"Single Mushroom",0005:"Single Red Shell",000F:"Super Mushroom",0004:"Triple Green Shell",000E:"Triple Mushroom",0006:"Triple Red Shell",0002:"Banana Bunch",0007:"Blue Spiny Shell" + cn Infinite Items\3-4 player Mode\Player 1 + 80163815 ???? + 80163842 ???? 000D:"Double Mushroom",0009:"Fake Item Box",000B:"Ghost",000A:"Invincible Star",0008:"Lightning",0001:"Single Banana",0003:"Single Green Shell",000C:"Single Mushroom",0005:"Single Red Shell",000F:"Super Mushroom",0004:"Triple Green Shell",000E:"Triple Mushroom",0006:"Triple Red Shell",0002:"Banana Bunch",0007:"Blue Spiny Shell" + cn Infinite Items\3-4 player Mode\Player 2 + 801638F5 ???? + 80163922 ???? 000D:"Double Mushroom",0009:"Fake Item Box",000B:"Ghost",000A:"Invincible Star",0008:"Lightning",0001:"Single Banana",0003:"Single Green Shell",000C:"Single Mushroom",0005:"Single Red Shell",000F:"Super Mushroom",0004:"Triple Green Shell",000E:"Triple Mushroom",0006:"Triple Red Shell",0002:"Banana Bunch",0007:"Blue Spiny Shell" + cn Infinite Items\3-4 player Mode\Player 3 + 801639D5 ???? + 80163A02 ???? 000D:"Double Mushroom",0009:"Fake Item Box",000B:"Ghost",000A:"Invincible Star",0008:"Lightning",0001:"Single Banana",0003:"Single Green Shell",000C:"Single Mushroom",0005:"Single Red Shell",000F:"Super Mushroom",0004:"Triple Green Shell",000E:"Triple Mushroom",0006:"Triple Red Shell",0002:"Banana Bunch",0007:"Blue Spiny Shell" + cn Infinite Items\3-4 player Mode\Player 4 + 80163AB5 ???? + 80163AE2 ???? 000D:"Double Mushroom",0009:"Fake Item Box",000B:"Ghost",000A:"Invincible Star",0008:"Lightning",0001:"Single Banana",0003:"Single Green Shell",000C:"Single Mushroom",0005:"Single Red Shell",000F:"Super Mushroom",0004:"Triple Green Shell",000E:"Triple Mushroom",0006:"Triple Red Shell",0002:"Banana Bunch",0007:"Blue Spiny Shell" + cn Have Bonus Mode and All Gold Cups + 8018C728 ???? + 8018C729 ???? + 8018C72A ???? + 8018C72B ???? 0000:"Off",00FF:"On" + cn Press GS\For Full Debug Menu + cd Press GS at the Press Start Menu to access the Debug Menu + 8818C80F 0002 + cn Press L To Levitate\Player 1 + D00F73C5 0020 + 810F7478 4000 + cn Press L To Levitate\Player 2 + D00F73D5 0020 + 810F8250 4000 + cn Press L To Levitate\Player 3 + D00F73E5 0020 + 810F9028 4000 + cn Press L To Levitate\Player 4 + D00F73F5 0020 + 810F9E00 4000 + +crc C9C3A987-5810344C-C:4A +gn Mario Kart 64 (J) (1.1) + cn Have Bonus Mode and All Gold Cups + 8018B4D8 ???? + 8018B4D9 ???? + 8018B4DA ???? + 8018B4DB ???? 0000:"Off",00FF:"On" + cn Press GS\For Full Debug Menu + cd Press GS at the Press Start Menu to access the Debug Menu + 8818B5BF 0002 + cn Press L To Levitate\Player 1 + D00F61B5 0020 + 810F6268 4000 + cn Press L To Levitate\Player 2 + D00F61C5 0020 + 810F7040 4000 + cn Press L To Levitate\Player 3 + D00F61D5 0020 + 810F7E18 4000 + cn Press L To Levitate\Player 4 + D00F61E5 0020 + 810F8BF0 4000 + +crc ADA815BE-6028622F-C:4A +gn Mario Party (J) + cn Top Left Character\Coin Options + cd If you want to have full 255 Coins,1st use the 100 Option then put on 255. this will stop the numbers from changing & spoiling the result. + 800F2709 ???? 0000:"0 Coins",000A:"10 Coins",0064:"100 Coins",00FF:"255 Coins" + cn Top Left Character\Star Options + 800F270D ???? 0000:"0 Stars",0064:"99 Stars" + cn Top Right Character\Coin Options + 800F2739 ???? 0000:"0 Coins",000A:"10 Coins",0064:"100 Coins",00FF:"255 Coins" + cn Top Right Character\Star Options + 800F273D ???? 0000:"0 Stars",0064:"99 Stars" + cn Lower Left Character\Coin Options + 800F2769 ???? 0000:"0 Coins",000A:"10 Coins",0064:"100 Coins",00FF:"255 Coins" + cn Lower Left Character\Star Options + 800F276D ???? 0000:"0 Stars",0064:"99 Stars" + cn Lower Right Character\Coin Options + 800F2799 ???? 0000:"0 Coins",000A:"10 Coins",0064:"100 Coins",00FF:"255 Coins" + cn Lower Right Character\Star Options + 800F279D ???? 0000:"0 Stars",0064:"99 Stars" + cn Top Left Character\Dice Always + cd With this option you can calculate exactly how many you need to get on the position of your choice. + 800D5782 ???? 0000:"Rolls In Random",0001:"Rolls In 1",0002:"Rolls In 2",0003:"Rolls In 3",0004:"Rolls In 4",0005:"Rolls In 5",0006:"Rolls In 6",0007:"Rolls In 7",0008:"Rolls In 8",0009:"Rolls In 9",000A:"Rolls In 10" + cn Top Right Character\Dice Always + cd With this option you can calculate exactly how many you need to get on the position of your choice. + 800D57C6 ???? 0000:"Rolls In Random",0001:"Rolls In 1",0002:"Rolls In 2",0003:"Rolls In 3",0004:"Rolls In 4",0005:"Rolls In 5",0006:"Rolls In 6",0007:"Rolls In 7",0008:"Rolls In 8",0009:"Rolls In 9",000A:"Rolls In 10" + cn Lower Left Character\Dice Always + cd With this option you can calculate exactly how many you need to get on the position of your choice. + 800D580A ???? 0000:"Rolls In Random",0001:"Rolls In 1",0002:"Rolls In 2",0003:"Rolls In 3",0004:"Rolls In 4",0005:"Rolls In 5",0006:"Rolls In 6",0007:"Rolls In 7",0008:"Rolls In 8",0009:"Rolls In 9",000A:"Rolls In 10" + cn Lower Right Character\Dice Always + cd With this option you can calculate exactly how many you need to get on the position of your choice. + 800D584E ???? 0000:"Rolls In Random",0001:"Rolls In 1",0002:"Rolls In 2",0003:"Rolls In 3",0004:"Rolls In 4",0005:"Rolls In 5",0006:"Rolls In 6",0007:"Rolls In 7",0008:"Rolls In 8",0009:"Rolls In 9",000A:"Rolls In 10" + cn Mini Game\Unlimited 99 lives + 800F2C03 0063 + cn Mini Game\Max 99 Coins + 800F2C0C 0063 + +crc 3A6C42B5-1ACADA1B-C:4A +gn Mario Tennis 64 (J) + cn Have All\Characters Available + 8105DEB8 FFFF + cn Have All\Courts Available + 8105DEBC FFFF + cn Score\Player 1 + 8014B1DA ???? 0000:"0",0001:"15",0002:"30",0003:"40" + cn Score\Player 2 + 8014B1DB ???? 0000:"0",0001:"15",0002:"30",0003:"40" + +crc 736AE6AF-4117E9C7-C:4A +gn Mickey no Racing Challenge USA (J) + cn Play As + 800D3161 ???? 0000:"Mickey Mouse",0001:"Daisy Duck",0002:"Goofy",0003:"Pete",0004:"Minnie Mouse",0005:"Donald Duck",0006:"Huey",0007:"Dewey",0008:"Louie",0009:"Lugwig Von Drake" + cn Traffic Troubles\Indianapolis\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 8018E892 0063 + cn Traffic Troubles\San Fransisco\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 80191B62 0063 + cn Traffic Troubles\New Mexico\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 8018FD52 0063 + cn Traffic Troubles\Grand Canyon\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 80193252 0063 + cn Motor Way Mania\Los Angeles\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 8018DCF2 0063 + cn Motor Way Mania\Alaska\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 8018E482 0063 + cn Motor Way Mania\Las Vegas\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 80192B12 0063 + cn Motor Way Mania\Philadelphia\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 80193992 0063 + cn Freewayphobia\Dakota\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 8018D212 0063 + cn Freewayphobia\Seattle\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 8018FDF2 0063 + cn Freewayphobia\New York\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 8018F512 0063 + cn Freewayphobia\Chicago\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 80192042 0063 + cn Victory Vehicles\Yellowstone\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 8018D4C2 0063 + cn Victory Vehicles\Washington DC\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 80197662 0063 + cn Victory Vehicles\Everglades\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 8018FC22 0063 + cn Victory Vehicles\Malibu\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 801916B2 0063 + cn Frantic Finale\Hawaii\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 80192072 0063 + cn Frantic Finale\Oregon\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 8018EA42 0063 + cn Frantic Finale\Texas\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 8018F1E2 0063 + cn Frantic Finale\Colorado\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 80191992 0063 + cn Level Select + 801876B9 ???? 0000:"Traffic Troubles",0001:"Motor Way Mania",0002:"Freewayphobia",0003:"Vitory Vehicles",0004:"Frantic Finale",0005:"Time Trial",0006:"Practice",0007:"Contest",0008:"Options" + cn Difficulty Select + 8007C000 ???? 0000:"Amateur",0001:"Intermediate",0002:"Professional",0003:"Mirror Mode" + cn Unlock Everything + cd This will unlock all characters, tracks, mirror mode, all in-game cheats, postcards, pluto's collar and give you all Trophies for every track and difficulties. To have this cheat save to mempak, enable it and then go into the Options Menu and disable the cheat. Go to the Wide-Screen Settings and Change it to Wide-Screen [16.9] and then the B button to get back to Wide-Screen Settings, now go back into Wide-Screen [16.9] and change it back to Normal [4.3].and press the B button until you come back to the main Options Menu.Close the game and load it again to see everything saved to the Mempak and unlocked. + 800D3208 008F + 800D3209 0094 + 800D320A 0003 + 800D320C 0001 + 800D320F 0080 + 50000502 0000 + 800D3210 0009 + 50000502 0000 + 800D3211 0024 + 800D321A 0015 + 800D321B 007F + 800D321C 0001 + 800D321D 00FF + 800D321E 0004 + 800D321F 0022 + cn Always 1st & final time 00:00.00 + cd All Levels + 50000301 0000 + 801CE6E9 0000 + +crc 96747EB4-104BB243-C:4A +gn Perfect Dark (J) + cn Have All Weapons\Player 1 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 80206B60 0007 + 801EDB60 0007 + 801D4B60 0007 + cn Infinite\Ammo\Player 1 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 802062EF 00FF + 801ED2EF 00FF + 801D42EF 00FF + 80205B4B 00FF + 801ECB4B 00FF + 801D3B4B 00FF + cn Infinite\Health\Player 1 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 812053CC 3F80 + 811EC3CC 3F80 + 811D33CC 3F80 + cn Infinite\Shield\Player 1 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 812053E0 3F80 + 811E35A0 3F80 + 811CA5A0 3F80 + cn Have All\Weapons\Player 2 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 802087D0 0007 + 801EF7D0 0007 + 801D67D0 0007 + cn Infinite\Ammo\Player 2 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 80207F5F 00FF + 801EEF5F 00FF + 801D5F5F 00FF + 802077BB 00FF + 801EE7BB 00FF + 801D57BB 00FF + cn Infinite\Health\Player 2 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 8120703C 3F80 + 811EE03C 3F80 + 811D503C 3F80 + cn Infinite\Shield\Player 2 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 811FE210 3F80 + 811E5210 3F80 + 811CC210 3F80 + cn All levels Compleate + cd This activate's solo missions, give all medals on solo missions, activate cheats, activate cinemas, and who knows what else. I just don't have the time to identify these codes. I know that some of this is creditted to Zap2. I don't have the time to cut those codes out. + 50003201 0000 + 800A2940 0001 + 50003201 0000 + 800A2972 0001 + 50003201 0000 + 800A29A4 0001 + +crc 09CC4801-E42EE491-C:4A +gn Pilot Wings64 (J) + +crc EC0F690D-32A7438C-C:4A +gn Pocket Monsters Snap (J) + cn [Enable All Levels] + cd This is needed to be able to Play all Levels of the Game + 810C18E2 0006 + +crc 94807E6B-60CC62E4-C:4A +gn Puyo Puyo Sun 64 (J) + cn Maximum Score\Player 1 + 811632CC 05F5 + 811632CE E0FF + cn Maximum Score\Player 2 + 811632D0 05F5 + 811632D2 E0FF + cn No Warning Icons\Player 1 + 80164EA3 0000 + cn No Warning Icons\Player 2 + 80164EA7 0000 + cn Instant 7th Step of Chain\Player 1 + D0163A2B 0001 + 80163A2B 0007 + cn Instant 7th Step of Chain\Player 2 + D0163E5B 0001 + 80163E5B 0007 + cn Options Complete Demo Viewer + 8016320B 0007 + 8116320C FFFF + 8116320E FFFF + cn Mode Total Continues 0 + 801632AF 0000 + 801632C7 0000 + cn Endless Mode\Player Level 99 Player 1 + 801632E7 0063 + cn Endless Mode\Player Level 99 Player 2 + 801632EB 0063 + cn Nazo Puyo Mode\All Practice Stages Cleared 4 + 50000402 0000 + 811631E8 FFFF + cn 1P Mode\Stage Select + D0162FEB 0001 + 80162FEB ???? 000D:"Satan Arle game",0008:"Satan Schezo game",000E:"Car-kun Arle game",0009:"Car-kun Schezo game" + +crc 9F1ECAF0-EEC48A0E-C:4A +gn Rakuga Kids (J) + cn Infinite Energy\Player 1 + 800AC339 ???? 0000:"None",0040:"Max" + cn Infinite Energy\Player 2 + 800AC429 ???? 0000:"None",003F:"Max" + cn Super Attacks\Player 1 + 800AC33D ???? 0000:"None",0003:"3" + cn Super Attacks\Player 2 + 800AC42D ???? 0000:"None",0003:"3" + cn Infinite Match Time + 800AB433 0000 + cn Unlock Extras + 800ACA05 00FF + 800ACA07 00FF + +crc B6BC0FB0-E3812198-C:4A +gn Sin and Punishment - Tsumi To Batsu (J) + cn All Levels\Unlock All\Levels - Options Menu + 80075DD6 FFFF + 80075DD7 FFFF + cn All Levels\Unlock All\Option Menu Items + 80075DD8 FFFF + 80075DD9 FFFF + cn All Levels\Infinite\Energy + 800D5A9B 00FF + cn All Levels\Infinite\Time + 800D5A97 0063 + cn All Levels\Infinite\Max Credits + 80075DDC 00FF + cn Level\0-0\Invincible + cd Only use one Ivincible level Code at a time for that specific level and only use for that specific level Cheat + 8010BB2B 0001 + cn Level\1-1\Invincible + cd Only use one Ivincible level Code at a time for that specific level and only use for that specific level Cheat + 801657FB 0001 + cn Level\1-2\Invincible + cd Only use one Ivincible level Code at a time for that specific level and only use for that specific level Cheat + 801BCFBB 0001 + cn Level\1-3\Invincible + cd Only use one Ivincible level Code at a time for that specific level and only use for that specific level Cheat + 8011270B 0001 + cn Level\2-1\Invincible + 801BD2BB 0001 + cn Level\2-2\Invincible + cd Only use one Ivincible level Code at a time for that specific level and only use for that specific level Cheat + 801B913B 0001 + cn Level\2-3\Invincible + cd Only use one Ivincible level Code at a time for that specific level and only use for that specific level Cheat + 801A7D0B 0001 + cn Level\3-1\Invincible + cd Only use one Ivincible level Code at a time for that specific level and only use for that specific level Cheat + 8015890B 0001 + cn Level\3-2\Invincible + cd Only use one Ivincible level Code at a time for that specific level and only use for that specific level Cheat + 801B938B 0001 + cn Level\3-3\Invincible + cd Only use one Ivincible level Code at a time for that specific level and only use for that specific level Cheat + 81100E08 C350 + cn Level\0-0\Infinite Air Jumping + cd Only use one Infinite Air Jumping level Code at a time and only use for that specific level Cheat + 8010BB0C 0000 + cn Level\1-1\Infinite Air Jumping + cd Only use one Infinite Air Jumping level Code at a time for that specific level and only use for that specific level Cheat + 801657DC 0000 + cn Level\1-2\Infinite Air Jumping + cd Only use one Infinite Air Jumping level Code at a time for that specific level and only use for that specific level Cheat + 801BCF9C 0000 + cn Level\1-3\Infinite Air Jumping + cd Only use one Infinite Air Jumping level Code at a time for that specific level and only use for that specific level Cheat + 801126EC 0000 + cn Level\2-1\Infinite Air Jumping + cd Only use one Infinite Air Jumping level Code at a time for that specific level and only use for that specific level Cheat + 801BD29C 0000 + cn Level\2-2\Infinite Air Jumping + cd Only use one Infinite Air Jumping level Code at a time for that specific level and only use for that specific level Cheat + 801B911C 0000 + cn Level\2-3\Infinite Air Jumping + cd Only use one Infinite Air Jumping level Code at a time for that specific level and only use for that specific level Cheat + 801A7CEC 0000 + cn Level\3-1\Infinite Air Jumping + cd Only use one Infinite Air Jumping level Code at a time for that specific level and only use for that specific level Cheat + 801588EC 0000 + cn Level\3-2\Infinite Air Jumping + cd Only use one Infinite Air Jumping level Code at a time for that specific level and only use for that specific level Cheat + 801B936C 0000 + cn Level\3-3\Infinite Air Jumping + cd Only use one Infinite Air Jumping level Code at a time for that specific level and only use for that specific level Cheat + 801013CC 0000 + +crc 66572080-28E348E1-C:4A +gn Super Robot Spirits (J) + cn Infinite Hp + 802016A7 0000 + cn Infinite Sp + 802016AB 005A + cn Infinite Time + 80260BDE 0000 + cn Player 2 Health Mod + 80206AF7 ???? 0000:"Infinite Health",00C8:"Instant Death" + cn Play As + 801B9D5C ???? 0000:"FINAL BOSS",0001:"R1",0002:"DAITARN 3",0003:"DANCOUGAR",0004:"SHINING GUNDAM",0005:"DUNBINE",0006:"WALKER GALLIER",0007:"VOLTES V",0008:"1st BOSS" + +crc 67D20729-F696774C-C:4A +gn All Star! Dairantou Smash Brothers (J) + cn Give Kirby A Wierd Blow-Up + 8025C118 000A + cn Story Mode\Skip Straight To Master Hand + 800A2AA7 000D + cn Story Mode\Infinite Time + 810A2AEE 43CB + cn Story Mode\Player 1\Infinite Lives + 800A2B03 0004 + cn Story Mode\Player 2\Infinite Lives + 800A2B77 0004 + cn Story Mode\Player 3\Infinite Lives + 800A2BEB 0004 + cn Story Mode\Player 4\Infinite Lives + 800A2C5F 0004 + cn Story Mode\Player 1\Low % Health + 810A2B46 0000 + cn Story Mode\Player 2\Low % Health + 810A2BBA 0000 + cn Story Mode\Player 3\Low % Health + 810A2C2E 0000 + cn Story Mode\Player 4\Low % Health + 810A2CA2 0000 + cn Story Mode\Player 1\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code could also result freezing at the end of the Level. + 800A2AFB ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn Story Mode\Player 2\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800A2B6F ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn Story Mode\Player 3\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800A2BE3 ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn Story Mode\Player 4\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800A2C57 ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn Story Mode\Player 1\Kirby B Button Move\Hyrule Castle + 80266ACF ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Yoshi's Island + 80266E0F ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Sector Z + 8026F0B7 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Peach's Castle + 80261D5F ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Saffron City + 80271A57 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Congo Jungle + 8026EA8F ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Kirby's Dreamland + 8026BAFF ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Planet Zebes + 8026DF67 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Metal Mario Stage + 80261557 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Fighting Polygon Team + 802606DF ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Master Hand Stage + 8026FC0F ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn VS. Mode\Infinite Time + 810A2CDE 43CB + cn VS. Mode\Player 1\Low % Health + 810A2D36 0000 + cn VS. Mode\Player 2\Low % Health + 810A2DAA 0000 + cn VS. Mode\Player 3\Low % Health + 810A2E1E 0000 + cn VS. Mode\Player 4\Low % Health + 810A2E92 0000 + cn VS. Mode\Player 1\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800A2CEB ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn VS. Mode\Player 2\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800A2D5F ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn VS. Mode\Player 3\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800A2DD3 ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn VS. Mode\Player 4\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800A2E47 ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn VS. Mode\Player 1\Kirby B Button Move\Hyrule Castle + 802619AF ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn VS. Mode\Player 1\Kirby B Button Move\Yoshi's Island + 8026C277 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn VS. Mode\Player 1\Kirby B Button Move\Sector Z + 80269F47 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn P1 Press Down On D-Pad To Make Items Appear In Random Spots + D109CF64 0400 + 8118B062 0001 + cn Have All Characters + 810A28F8 0FF0 + cn VS. Mode\Have Mushroom Kindom + 800A28F7 00FF + cn Story Mode\Always Get Pacifist (60,000 Points) + 810A2B2E 0000 + cn Bonus Stage Character Modifier (Training Mode) + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 8018D193 ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + +crc 84FC04FF-B1253CE9-C:4A +gn Snowbow Kids (J) + cn Infinite\Tools Options + 801215B5 ???? 0001:"Fan",0002:"Ghost",0003:"Pan",0004:"Rock",0005:"Mouse",0006:"Board" + cn Infinite\Lucky Dip + cd "Lucky Dip is Infinite Usage Of What Ever You Get From Each Red Box" + 801215B4 0003 + cn 999 Trick Game Pts + cd Press the A Button to stop Count,or it will continue to grow without stoping. + 81121360 03E7 + cn 1 Lap Race + D01215A8 0000 + 801215A8 0009 + cn Infinite\Cash + 8012160A C350 + cn Enable Sinobin + 8110A17E 0100 + cn Access Gold Medals + 50006002 0000 + 810EBD42 0101 + +crc A7941528-61F1199D-C:4A +gn Chou Snowbow Kids (J) + cn All Gold Medals + 50000502 0000 + 81259130 0101 + cn Max Coins + 8125A5BE 270F + 8025A5BF 00C8 + cn Infinite\Trick Game 300 Points + 8125A7F2 012C + cn Infinite\Tools Options + 8025A624 ???? 0001:"Frying Pan",0002:"Ghost",0003:"Super Ghost",0004:"Fan",0005:"Rocket",0006:"Invisible",0007:"Rock",0008:"Rat Face",0009:"Super Rat Face",000A:"Wings" + cn Infinite\Weapons Options + 8025A622 ???? 0001:"Slap Stick",0002:"Parachute",0003:"Freeze Shot",0004:"Snowman",0005:"Bomb",0006:"Whirlwind" + 8025A623 0009 + cn Open Extra Characters & Snowboards + cd Battle Mode Only + 8125916E 0101 + 80259170 0001 + 8025915C 0001 + 8125915E 0101 + 81259160 0101 + +crc 61F5B152-046122AB-C:4A +gn Star Wars Episode I - Racer (J) + cn No Damage + 800A8047 0001 + cn Always 1st + 8011C25D 0001 + cn Have All Tracks Completed + 811170DA FFFF + 811170DC 3FFF + 811170DE 3FFF + 811170E0 3FFF + 811170E2 00FF + cn Have All Characters + 801170E2 007D + 811170E4 FFFF + cn Unlock All Tracks + 801170D8 00FF + 801170D9 00FF + 801170DA 00FF + 801170DB 00FF + 811170D8 FFFF + +crc 4EAA3D0E-74757C24-C:4A +gn Super Mario 64 (J) + cn Mario's Cap\Off Options + cd Here you can Choose Options with Mario without His Cap on,Do not use with any other Mario with/without Options,Use only one at a time + 80339E07 ???? 0001:"Mario No Cap",0002:"Invisible Mario",0004:"Metal Mario",0008:"Flying Mario",000A:"Invisible Flying Mario",000D:"Metal Flying Mario",000F:"Invisible Metal Flying Mario" + cn Mario's Cap\On Options + cd Here you can Choose Options with Mario with His Cap on,Do not use with any other Mario with/without Options,Use only one at a time + 80339E07 ???? 0012:"Invisible Mario",0015:"Metal Mario",0016:"Invisible Metal Mario",0019:"Flying Mario" + cn Funny Mario Options\Mario's Cap\Off & in His Hand + cd Here you can Choose Options with Mario with His Cap off & in His Hand,Do not use with any other Mario with/without Options,Use only one at a time + 80339E07 ???? 0020:"Cap In Hand",0022:"Invisible Mario Cap In Hand",0024:"Metal Mario Cap In Hand",0026:"Invisible Metal Mario Cap In Hand",0028:"Flying Mario Cap In Hand" + cn Funny Mario Options\Mario's Cap\On & An Extra in His Hand + cd Here you can Choose Options with Mario with His Cap on & An Extra in His Hand,Do not use with any other Mario with/without Options,Use only one at a time + 80339E07 ???? 0030:"Cap In Hand",0032:"Invisible Mario Cap In Hand",0034:"Metal Mario Cap In Hand",0036:"Invisible Metal Mario Cap In Hand",0038:"Flying Mario Cap In Hand" + cn Infinite\Energy & Breath + 80339EAE 0008 + cn Infinite\Lives + 80339EAD 0064 + cn Have\Level Select + 8032C64C 0001 + cn Don't Hurt Mario\Monsters + A0339E27 0001 + cn Have\Debug Mode + 8032C658 ???? 0001:"On",0000:"Off" + cn Press GS for 255 Coins + 89339EA8 00FF + cn Press L To Levitate + cd Press L to levitate & Let go to land + D0339C31 0020 + 81339E4C 4220 + D0339E4D 0020 + 81339E0C 0300 + D0339E4D 0020 + 81339E0E 0880 + cn Have All\175 Stars + cd I have Managed to put a Have 175 Stars Option in for you,once the Code is activated, you will see it as a new option in Save Slot A. + 80207B0B 00FF + 50000D02 0000 + 81207B0C FFFF + cn Have All\Maxed Out Coin Records For All Levels + 80207B25 00FF + 81207B26 FFFF + 81207B28 FFFF + 81207B2A FFFF + 81207B2C FFFF + 81207B2E FFFF + 81207B30 FFFF + 81207B32 FFFF + +crc D6FBA4A8-6326AA2C-C:4A +gn Super Mario 64 Shindou Edition (J) + cn Funny Mario Options\Limbo Mario + cd Only Use This Code On Its Own,Do not use with any other Funny Mario Options. + 8031DC0C 00C0 + cn Funny Mario Options\Runs Backwards + cd Only Use This Code On Its Own,Do not use with any other Funny Mario Options. + 8031DC0E 0080 + cn Mario's Cap\Off Options + cd Here you can Choose Options with Mario without His Cap on,Do not use with any other Mario with/without Options,Use only one at a time + 8031D9C7 ???? 0001:"Mario No Cap",0002:"Invisible Mario",0004:"Metal Mario",0008:"Flying Mario",000A:"Invisible Flying Mario",000D:"Metal Flying Mario",000F:"Invisible Metal Flying Mario" + cn Mario's Cap\On Options + cd Here you can Choose Options with Mario with His Cap on,Do not use with any other Mario with/without Options,Use only one at a time + 8031D9C7 ???? 0012:"Invisible Mario",0015:"Metal Mario",0016:"Invisible Metal Mario",0019:"Flying Mario" + cn Funny Mario Options\Mario's Cap\Off & in His Hand + cd Here you can Choose Options with Mario with His Cap off & in His Hand,Do not use with any other Mario with/without Options,Use only one at a time + 8031D9C7 ???? 0020:"Cap In Hand",0022:"Invisible Mario Cap In Hand",0024:"Metal Mario Cap In Hand",0026:"Invisible Metal Mario Cap In Hand",0028:"Flying Mario Cap In Hand" + cn Funny Mario Options\Mario's Cap\On & An Extra in His Hand + cd Here you can Choose Options with Mario with His Cap on & An Extra in His Hand,Do not use with any other Mario with/without Options,Use only one at a time + 8031D9C7 ???? 0030:"Cap In Hand",0032:"Invisible Mario Cap In Hand",0034:"Metal Mario Cap In Hand",0036:"Invisible Metal Mario Cap In Hand",0038:"Flying Mario Cap In Hand" + cn Infinite\Energy & Breath + 8031DA6E 0008 + cn Infinite\Lives + 8031DA6D 0064 + cn Don't Hurt Mario\Monsters + A031D9E7 0001 + cn Funny Mario Options\Ostrich Mario + cd Only Use This Code On Its Own,Do not use with any other Funny Mario Options. + 8031DC0C 0070 + cn Press GS For 255 Coins + cd Press GS Once on a Level To Get that amount of Coins + 8931DA68 00FF + cn Have All\175 Stars + cd I have Managed to put a Have 175 Stars Option in for you,once the Code is activated, you will see it as a new option in Save Slot A. + 80203F0B 00FF + 50000D02 0000 + 81203F0C FFFF + cn Have All\Maxed Out Coin Records For All Levels + 80203F25 00FF + 50000702 0000 + 81203F26 FFFF + cn Have\Level Select + 8030CCBC 0001 + +crc 9CE02E22-206EF1B0-C:4A +gn Super Speed Race 64 (J) + cn Always 1st Place + 81098A58 0001 + cn Freeze\Lap Timer + cd Single and Chapionship Race Modes + 800967E5 0000 + 800967E7 0000 + cn Freeze\Pit Timer + cd Single and Chapionship Race Modes + 800968A5 0000 + 800968A7 0000 + cn Car Select + 800C50B1 ???? 0000:"Car 1",0001:"Car 2",0002:"Car 3",0003:"Car 4",0004:"Car 5",0005:"Car 6",0006:"Car 7",0007:"Car 8",0008:"Car 9",0009:"Car 10",000A:"Car 11",000B:"Car 12",000C:"Car 13",000D:"Car 14",000E:"Car 15",000F:"Car 16",0010:"Car 17",0011:"Car 18" + cn 1 Lap To Race + cd In Single and Chapionship Modes use the Laps In Race Cheat or use the in game setting to choose how many laps you want per race and them use this cheat and amount of Laps to have only have 1 left if needed. + 80098A5D ???? 0003:"3 of 3 Laps",0006:"6 of 6 Laps",0009:"9 of 9 Laps",000C:"12 of 12 Laps",000F:"15 of 15 Laps",0012:"18 of 18 Laps",0015:"21 of 21 Laps",0018:"24 of 24 Laps",001B:"27 of 27 Laps",001E:"30 of 30 Laps" + cn Freeze\Timer Challenge Timer + cd Timer Challenge + 800C4F87 0050 + cn Laps\In Race\Chapionship Race Mode + 800C4ED3 ???? 0003:"3 Laps In Race",0006:"6 Laps In Race",0009:"9 Laps In Race",000C:"12 Laps In Race",000F:"15 Laps In Race",0012:"18 Laps In Race",0015:"21 Laps In Race",0018:"24 Laps In Race",001B:"27 Laps In Race",001E:"30 Laps In Race" + cn Laps\In Race\Single Race Mode + 800C4ED1 ???? 0003:"3 Laps In Race",0006:"6 Laps In Race",0009:"9 Laps In Race",000C:"12 Laps In Race",000F:"15 Laps In Race",0012:"18 Laps In Race",0015:"21 Laps In Race",0018:"24 Laps In Race",001B:"27 Laps In Race",001E:"30 Laps In Race" + cn Pit Stops\Championship + 800C4F13 ???? 0000:"Off",0001:"On" + cn Pit Stops\Single Race Mode + 800C4F11 ???? 0000:"Off",0001:"On" + cn Weather\Championship + 800C4F33 ???? 0000:"Dry",0001:"Wet",0003:"Night" + cn Weather\Single Race Mode + 800C4F31 ???? 0000:"Dry",0001:"Wet",0003:"Night" + cn Track Direction\Championship + 800C4EF3 ???? 0000:"Normal",0001:"Reverse" + +crc 916AE6B8-8817AB22-C:4A +gn Tokisora Senshi Turok (J) + cn Infinite\Body Armor + 8112FD96 5B23 + 8012FDD7 0001 + cn Infinite\Air + 81129030 AAE1 + 811E85EA F1FF + cn Have All\Level Keys + 8012FDE3 0007 + 8012FDE7 0007 + 8012FDEB 0007 + 8012FDEF 0007 + 8012FDF3 0007 + 8012FDF7 0007 + 8012FDFB 0007 + cn Have All\Weapons + 8012FDA7 0001 + 8012FDAB 0001 + 8012FDAF 0001 + 8012FDB3 0001 + 8012FDB7 0001 + 8012FDBB 0001 + 8012FDBF 0001 + 8012FDC3 0001 + 8012FDC7 0001 + 8012FDCB 0001 + 8012FDCF 0001 + 8012FDD3 0001 + cn Infinite\Ammo + 8012FD7F 00FF + 8012FD93 00FF + 8012FD83 00FF + 8012FD63 00FF + 8012FD8B 00FF + 8012FD67 00FF + 8012FD8F 00FF + 8012FD6B 00FF + cn Diffuculty Modifier + 8011252F ???? 0000:"Easy",0001:"Normal",0002:"Hard" + cn Infinite\Health + 812C15F4 013C + cn Have\Backpack + 8012FD9B 0001 + 8012FDDB 0001 + cn Infinite\Lives + 8012FF0B 00FF + cn Have\Cheat Menu + 811205F0 FFFF + 811205F2 FFFF + cn Have All\Gems + 8012FF07 00FF + +crc 5C9191D6-B30AC306-C:4A +gn Wave Race 64 (J) + cn Misses Don't Count + 801D053F 0000 + cn Infinite Time Stunt Mode + 801D06CE 00FF + cn Super Speed + 801D0537 0005 + D0161DC1 0010 + 801D0537 0020 + cn 99 Points + 801D8E13 0063 + cn Infinite Course Out Time + 801D06F3 00FF + cn Maximum Power\Player 1 + 801D0537 0005 + cn Maximum Power\Player 2 + 801D0B5A 0005 + 801D0DFA 0005 + cn Only Play Glacier Coast + 800E84C3 0007 + cn Always First Place + 801D040F 0000 + +crc 535DF3E2-609789F1-C:4A +gn Wave Race 64 Shindou Edition (J) (V1.2) + cn Misses Don't Count + 801C399F 0000 + cn Infinite Time Stunt Mode + 801C3B2E 00FF + cn Super Speed + 801C3997 0005 + D0155221 0010 + 801C3997 0020 + cn 99 Points + 801CC273 0063 + cn Infinite Course Out Time + 801C3B53 00FF + cn Maximum Power\Player 1 + 801C3997 0005 + cn Maximum Power\Player 2 + 801C3FBA 0005 + 801C425A 0005 + cn Always First Place + 801C386F 0000 + +crc DCB6EAFA-C6BBCFA3-C:4A +gn Wetrix (J) + cn Infinite Lakes + 811AC9FE 0009 + cn Mega Score + 801ACA18 00FF + 801DBDC4 00FF + cn Always Empty Drain + 801ACA51 0000 + 811ACA52 0000 + 811ACA54 0000 + cn Always Berserk Mode + 801ACA6F 00FF + cn Stop Level Timer + 801ACA72 00FF + cn Practice Lessons Open + 810C3AEA 0008 + cn Always Drop\Player 1 + 801ACA7B ???? 0000:"Bar",0001:"T",0002:"Corner",0003:"Square",0004:"Down Square",0005:"Down Bar",0006:"Big Water",0007:"Medium Water",0008:"Small Water",0009:"Smallest Water",000A:"Bomb",000B:"Fireball" + cn Always Drop\Player 2 + 801DD1FB ???? 0000:"Bar",0001:"T",0002:"Corner",0003:"Square",0004:"Down Square",0005:"Down Bar",0006:"Big Water",0007:"Medium Water",0008:"Small Water",0009:"Smallest Water",000A:"Bomb",000B:"Fireball" + cn Infinite Ducks + 801ACA0B 0009 + +crc 12737DA5-23969159-C:4A +gn WWF Wrestlemania 2000 (J) + cn Have All Characters + 81094BDA FFFF + cn Infinite Create-A-Wrestler Attribute Points + 8011069B 001E + cn Timer Is Always 00:00 + 80164F2F 0000 + cn Max Attributes + 80110691 0032 + 80110693 0032 + 80110695 0032 + 80110697 0032 + 80110699 0032 + cn Weapon Select\Player 1 + 8115D0B6 0300 + 8115CC10 ???? 0000:"Broom",0101:"Shovel",0202:"Red And White Hockey Stick",0303:"Guitar",0404:"Night Stick",0505:"Head",0606:"Black Hockey Stick",0707:"Bottle",0808:"2x4",0909:"Big Purple Sheet",0A0A:"White Jug",0B0B:"Suit Case",0C0C:"Stick",0D0D:"Head",0E0E:"Big Mallot",0F0F:"Black Microphone",1010:"BaseBall Bat",1111:"Folding Chair",1212:"Board",1313:"Stairs",1414:"Trashcan",FFFF:"Nothing" + 8115CC12 0000 + 8015CCD0 0000 + cn Weapon Select\Player 2 + 8115D54A 0300 + 8115CC40 ???? 0000:"Broom",0101:"Shovel",0202:"Red And White Hockey Stick",0303:"Guitar",0404:"Night Stick",0505:"Head",0606:"Black Hockey Stick",0707:"Bottle",0808:"2x4",0909:"Big Purple Sheet",0A0A:"White Jug",0B0B:"Suit Case",0C0C:"Stick",0D0D:"Head",0E0E:"Big Mallot",0F0F:"Black Microphone",1010:"BaseBall Bat",1111:"Folding Chair",1212:"Board",1313:"Stairs",1414:"Trashcan",FFFF:"Nothing" + 8015CC42 0001 + 8015CCD1 0001 + cn Weapon Select\Player 3 + 8115D9DE 0300 + 8115CC70 ???? 0000:"Broom",0101:"Shovel",0202:"Red And White Hockey Stick",0303:"Guitar",0404:"Night Stick",0505:"Head",0606:"Black Hockey Stick",0707:"Bottle",0808:"2x4",0909:"Big Purple Sheet",0A0A:"White Jug",0B0B:"Suit Case",0C0C:"Stick",0D0D:"Head",0E0E:"Big Mallot",0F0F:"Black Microphone",1010:"BaseBall Bat",1111:"Folding Chair",1212:"Board",1313:"Stairs",1414:"Trashcan",FFFF:"Nothing" + 8015CC72 0002 + 8015CCD2 0002 + cn Weapon Select\Player 4 + 8115DE72 0300 + 8115CC98 ???? 0000:"Broom",0101:"Shovel",0202:"Red And White Hockey Stick",0303:"Guitar",0404:"Night Stick",0505:"Head",0606:"Black Hockey Stick",0707:"Bottle",0808:"2x4",0909:"Big Purple Sheet",0A0A:"White Jug",0B0B:"Suit Case",0C0C:"Stick",0D0D:"Head",0E0E:"Big Mallot",0F0F:"Black Microphone",1010:"BaseBall Bat",1111:"Folding Chair",1212:"Board",1313:"Stairs",1414:"Trashcan",FFFF:"Nothing" + 8115CC9A 0003 + 8015CCD3 0003 + cn Always Special\Player 1 + 8015D0B5 0004 + cn Always Special\Player 2 + 8015D549 0004 + cn Always Special\Player 3 + 8015D9DD 0004 + cn Always Special\Player 4 + 8015DE71 0004 + cn Specials Don't Run Out + 81120C14 2400 + cn Max Spirit\Player 1 + 8015D075 00FF + cn Always Normal Spirit\Player 1 + 8015D075 0032 + cn No Spirit\Player 1 + 8015D075 0000 + cn Max Spirit\Player 2 + 8015D509 00FF + cn Always Normal Spirit\Player 2 + 8015D509 0032 + cn No Spirit\Player 2 + 8015D509 0000 + cn Max Spirit\Player 3 + 8015D99D 00FF + cn Always Normal Spirit\Player 3 + 8015D99D 0032 + cn No Spirit\Player 3 + 8015D99D 0000 + cn Max Spirit\Player 4 + 8015DE31 00FF + cn Always Normal Spirit\Player 4 + 8015DE31 0032 + cn No Spirit\Player 4 + 8015DE31 0000 + cn Ultimate Codes\Player 1 + 8015D074 0064 + cn Ultimate Codes\Player 2 + 8015D508 0064 + cn Ultimate Codes\Player 3 + 8015D99C 0064 + cn Ultimate Codes\Player 4 + 8015DE30 0064 + cn Easy Pins & Longer Submissions\Player 2 + 8015D508 0064 + cn Easy Pins & Longer Submissions\Player 3 + 8015D99C 0064 + cn Easy Pins & Longer Submissions\Player 4 + 8015DE30 0064 + cn Easy Pins & Longer Submissions\Player 1 + 8015D074 0064 + +crc EC417312-EB31DE5F-C:4A +gn Zelda no Densetsu 2 - Mujura no Kamen (J) (v1.0) + cn Have All\Quest Status Items + 801EF51D 0005 + 811EF51E F7CF + cn Infinite\Rupees + 811EF49A 03E7 + cn Infinite\Max & Double Magic Meter + 801EF499 0060 + 811EF4A0 0101 + cn Infinite\Arrows + 801EF501 0063 + cn Infinite\Bombs + 801EF506 0063 + cn Infinite\Bombchus + 801EF507 0063 + cn Infinite\Deku Sticks + 801EF508 0063 + cn Infinite\Deku Nuts + 801EF509 0063 + cn Infinite\Magic Beans + 801EF50A 0063 + cn Infinite\Powder Kegs + 801EF50C 0063 + cn Have\Ocarina of Time + 801EF4D0 0000 + cn Have\Hero's Bow + 801EF4D1 0001 + cn Have\Arrows\Fire Arrow + 801EF4D2 0002 + cn Have\Arrows\Ice Arrow + 801EF4D3 0003 + cn Have\Arrows\Light Arrow + 801EF4D4 0004 + cn Have\Bombs + 801EF4D6 0006 + cn Have\Bombchu + 801EF4D7 0007 + cn Have\Deku Sticks + 801EF4D8 0008 + cn Have\Deku Nuts + 801EF4D9 0009 + cn Have\Magic Beans + 801EF4DA 000A + cn Have\Powder Kegs + 801EF4DC 000C + cn Have\Pictograph + 801EF4DD 000D + cn Have\Lens of Truth + 801EF4DE 000E + cn Have\Hookshot + 801EF4DF 000F + cn Have\Great Fairy's Sword + 801EF4E0 0010 + cn Have\Bottle Modifier\1 + 801EF4E2 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Have\Bottle Modifier\2 + 801EF4E3 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Have\Bottle Modifier\3 + 801EF4E4 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Have\Bottle Modifier\4 + 801EF4E5 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Have\Bottle Modifier\5 + 801EF4E6 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Have\Bottle Modifier\6 + 801EF4E7 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn All Equipment Upgrades + 801EF4CD 0023 + 811EF51A 201B + cn Have All\Masks + 801EF4E8 005A + 801EF4E9 0055 + 801EF4EA 0063 + 801EF4EB 0061 + 801EF4EC 005C + 801EF4ED 004E + 801EF4EE 0056 + 801EF4EF 0062 + 801EF4F0 0054 + 801EF4F1 005E + 801EF4F2 0064 + 801EF4F3 004F + 801EF4F4 0058 + 801EF4F5 0059 + 801EF4F6 0053 + 801EF4F7 005B + 801EF4F8 0052 + 801EF4F9 0050 + 801EF4FA 005F + 801EF4FB 005D + 801EF4FC 0057 + 801EF4FD 0060 + 801EF4FE 0065 + 801EF4FF 0051 + cn Replace Sword With + 801EF4AC ???? 0002:"Fire Arrow w/ Bow",0003:"Ice Arrow w/ Bow",0004:"Light Arrow w/ Bow",0000:"Hero's Bow",0010:"Deity Link's Sword" + cn Infinite\Health + 811EF496 0140 + cn Infinite\Hearts Options + 811EF494 ???? 0140:"Max Hearts",0063:"6 Hearts",0043:"4 Hearts" + cn Beta World 1 + cd Put on the code on load up,After the Nintendo logo you will be in that place of Choice.you can also choose another place & then press F1 (reset) to go to that place this is for beta interest only it will not assist you in playing the game. + D01FB9E1 0000 + 801EF462 ???? 0000:"Mama's House non Beta",0001:"Fearful Spider House",0002:"Beneaf the Graveyard",0003:"Southern Swamp Mr Tingle Entry",0006:"Outside Tourist Information Southern Swamp",0008:"Outside Magic Hag's Potion Shop",000A:"Southern Swamp Woods Of Mystery Entry",0024:"Counter Of The Tresure Chest Shop",002E:"Woodfall Temple non Beta",0032:"Spider Hand",0035:"Statue outside Gorman Track",0036:"Statue outside Lair Of The Temples Boss",0038:"Path to Romani Ranch non Beta",004A:"outside The Royal Palace of the Deku Kingdom",004C:"Ledge in The Royal Palace of the Deku Kingdom",004E:"inside The Royal Palace of the Deku Kingdom 1",0071:"Green Blobs",0074:"Cave Portal to Last Boss Field",007F:"Waterfall Sothern Swamp",008A:"Giant Turtle In the Temple non beta",008B:"Room of Miau & Tijo Zora Great Hall",0094:"Recieving Gorans Mask non Beta",0095:"?",0096:"Hungry Goran in the Snow",00A2:"Statue in Stone Tower",00A6:"Stone Tower non Beta",00B9:"Recieving Deku Mask non Beta",00D9:"Giant Lizards in a Cave",00DA:"Cave with Steaming Water",00FF:"Vamps House In Ikana Canyon" + cn Press L To Levitate + cd Press L To Levitate & Let go to land + D03E6D0B 0020 + 81400008 40CB + cn Play As + 801EF480 ???? 0000:"Fierce Deity Link",0001:"Goron Link",0002:"Zora Link",0003:"Deku Link",0004:"Normal Link" + cn Warp Modifier + cd Put this code on and press the start button and it will now take where you wanted to go, turn it back off after you have got there. + D05EC55A 0000 + 803FF545 0001 + 813FF54A ???? 0010:"Mayors Residence",0008:"Magic Hags Potion Shop",000A:"Romani Ranch Barn",000B:"Mama's House",000E:"Honey & Darlings Shop",0015:"Final Boss Arena",001F:"Beneath the Graveyard (left entrance)",002F:"Beneath the Graveyard (right entrance)",0030:"Southern Swamp (Reg Entrance)",004F:"Southern Swamp (from tour house)",006E:"Southern Swamp (from Woodfall)",006F:"Southern Swamp (from Deku Palace)",0078:"Path to Ikana Canyon",009E:"Southern Swamp (from Deku Place 2)",009F:"Southern Swamp (From Potion Shop)",00AF:"Boat Cruise (picture taking)",00CD:"Southern Swamp (From Woods of Mystery)",00CE:"Southern Swamp (From Spider House)",00CF:"Southern Swamp (From Ikana Canyon)",00FE:"Southern Swamp (From Owl Warp)",0E00:"Curiosity Shop",0E38:"Ikana Canyon Entrance",1500:"Lens of Truth Cave (get it)",2600:"Stone Tower Temple (Upside down)",2609:"Stone Tower Temple (Boss Room Entrance)",2604:"Treasure Chest Shop",2605:"Treausre Chest Shop (counter)",260E:"Clock Tower (w/ skull kid, silent)",2610:"Stone Tower Temple (endless fall)",6214:"Romani Ranch",9214:"Zora Shop",B214:"Snowhead (Path to temple, warp in)",D214:"East Clock Down" + +crc 69AE0438-2C63F3F3-C:4A +gn Zelda no Densetsu 2 - Mujura no Kamen (J) (V1.1) + cn Have All\Quest Status Items + 801EF7CD 0005 + 811EF7CE F7CF + cn Infinite\Rupees + 811EF74A 03E7 + cn Infinite\Max & Double Magic Meter + 801EF749 0060 + 811EF750 0101 + cn Infinite\Arrows + 801EF7B1 0063 + cn Infinite\Bombs + 801EF7B6 0063 + cn Infinite\Bombchus + 801EF7B7 0063 + cn Infinite\Deku Sticks + 801EF7B8 0063 + cn Infinite\Deku Nuts + 801EF7B9 0063 + cn Infinite\Magic Beans + 801EF7BA 0063 + cn Infinite\Powder Kegs + 801EF7BC 0063 + cn Have\Ocarina of Time + 801EF780 0000 + cn Have\Hero's Bow + 801EF781 0001 + cn Have\Arrows\Fire Arrow + 801EF782 0002 + cn Have\Arrows\Ice Arrow + 801EF783 0003 + cn Have\Arrows\Light Arrow + 801EF784 0004 + cn Have\Bombs + 801EF786 0006 + cn Have\Bombchu + 801EF787 0007 + cn Have\Deku Sticks + 801EF788 0008 + cn Have\Deku Nuts + 801EF789 0009 + cn Have\Magic Beans + 801EF78A 000A + cn Have\Powder Kegs + 801EF78C 000C + cn Have\Pictograph + 801EF78D 000D + cn Have\Lens of Truth + 801EF78E 000E + cn Have\Hookshot + 801EF78F 000F + cn Have\Great Fairy's Sword + 801EF790 0010 + cn Have\Bottle Modifier\1 + 801EF792 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Have\Bottle Modifier\2 + 801EF793 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Have\Bottle Modifier\3 + 801EF794 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Have\Bottle Modifier\4 + 801EF795 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Have\Bottle Modifier\5 + 801EF796 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Have\Bottle Modifier\6 + 801EF797 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn All Equipment Upgrades + 801EF77D 0023 + 811EF7CA 201B + cn Have All\Masks + 801EF798 005A + 801EF799 0055 + 801EF79A 0063 + 801EF79B 0061 + 801EF79C 005C + 801EF79D 004E + 801EF79E 0056 + 801EF79F 0062 + 801EF7A0 0054 + 801EF7A1 005E + 801EF7A2 0064 + 801EF7A3 004F + 801EF7A4 0058 + 801EF7A5 0059 + 801EF7A6 0053 + 801EF7A7 005B + 801EF7A8 0052 + 801EF7A9 0050 + 801EF7AA 005F + 801EF7AB 005D + 801EF7AC 0057 + 801EF7AD 0060 + 801EF7AE 0065 + 801EF7AF 0051 + cn Replace Sword With + 801EF75C ???? 0002:"Fire Arrow w/ Bow",0003:"Ice Arrow w/ Bow",0004:"Light Arrow w/ Bow",0000:"Hero's Bow",0010:"Deity Link's Sword" + cn Infinite\Health + 811EF746 0140 + cn Infinite\Hearts Options + 811EF744 ???? 0140:"Max Hearts",0063:"6 Hearts",0043:"4 Hearts" + cn Beta World 1 + cd Put on the code on load up,After the Nintendo logo you will be in that place of Choice.you can also choose another place & then press F1 (reset) to go to that place this is for beta interest only it will not assist you in playing the game. + D01FBC91 0000 + 801EF712 ???? 0000:"Mama's House non Beta",0001:"Fearful Spider House",0002:"Beneaf the Graveyard",0003:"Southern Swamp Mr Tingle Entry",0006:"Outside Tourist Information Southern Swamp",0008:"Outside Magic Hag's Potion Shop",000A:"Southern Swamp Woods Of Mystery Entry",0024:"Counter Of The Tresure Chest Shop",002E:"Woodfall Temple non Beta",0032:"Spider Hand",0035:"Statue outside Gorman Track",0036:"Statue outside Lair Of The Temples Boss",0038:"Path to Romani Ranch non Beta",004A:"outside The Royal Palace of the Deku Kingdom",004C:"Ledge in The Royal Palace of the Deku Kingdom",004E:"inside The Royal Palace of the Deku Kingdom 1",0071:"Green Blobs",0074:"Cave Portal to Last Boss Field",007F:"Waterfall Sothern Swamp",008A:"Giant Turtle In the Temple non beta",008B:"Room of Miau & Tijo Zora Great Hall",0094:"Recieving Gorans Mask non Beta",0095:"?",0096:"Hungry Goran in the Snow",00A2:"Statue in Stone Tower",00A6:"Stone Tower non Beta",00B9:"Recieving Deku Mask non Beta",00D9:"Giant Lizards in a Cave",00DA:"Cave with Steaming Water",00FF:"Vamps House In Ikana Canyon" + cn Press L To Levitate + cd Press L To Levitate & Let go to land + D03E6FCB 0020 + 814002C8 40CB + cn Play As + 801EF730 ???? 0000:"Fierce Deity Link",0001:"Goron Link",0002:"Zora Link",0003:"Deku Link",0004:"Normal Link" + cn Warp Modifier + cd Put this code on and press the start button and it will now take where you wanted to go, turn it back off after you have got there. + D03E6FCA 0000 + 803FF805 0001 + 813FF80A ???? 0010:"Mayors Residence",0008:"Magic Hags Potion Shop",000A:"Romani Ranch Barn",000B:"Mama's House",000E:"Honey & Darlings Shop",0015:"Final Boss Arena",001F:"Beneath the Graveyard (left entrance)",002F:"Beneath the Graveyard (right entrance)",0030:"Southern Swamp (Reg Entrance)",004F:"Southern Swamp (from tour house)",006E:"Southern Swamp (from Woodfall)",006F:"Southern Swamp (from Deku Palace)",0078:"Path to Ikana Canyon",009E:"Southern Swamp (from Deku Place 2)",009F:"Southern Swamp (From Potion Shop)",00AF:"Boat Cruise (picture taking)",00CD:"Southern Swamp (From Woods of Mystery)",00CE:"Southern Swamp (From Spider House)",00CF:"Southern Swamp (From Ikana Canyon)",00FE:"Southern Swamp (From Owl Warp)",0E00:"Curiosity Shop",0E38:"Ikana Canyon Entrance",1500:"Lens of Truth Cave (get it)",2600:"Stone Tower Temple (Upside down)",2609:"Stone Tower Temple (Boss Room Entrance)",2604:"Treasure Chest Shop",2605:"Treausre Chest Shop (counter)",260E:"Clock Tower (w/ skull kid, silent)",2610:"Stone Tower Temple (endless fall)",6214:"Romani Ranch",9214:"Zora Shop",B214:"Snowhead (Path to temple, warp in)",D214:"East Clock Down" + +crc 8473D0C1-23120666-C:4A +gn Zelda no Densetsu 2 - Mujura no Kamen - Zelda Collection Version (J) (GC Version) [!] + cn Infinite\Rupees + 811ED85A 03E7 + cn Infinite\Health + 811ED856 03E7 + cn Infinite\Max & Double Magic Meter + 801ED859 0060 + 811ED860 0101 + cn Infinite\Items + cd This is Infinite use of Bombs,Bombchus,Deku Sticks,Deku Nuts,Magic Beans,& Powder Kegs. But you must also put it's Have on to work. + 801ED8C1 0063 + 50000801 0000 + 801ED8C6 0063 + cn Have\All Masks + 811ED8A8 3E39 + 811ED8AA 4745 + 811ED8AC 4032 + 811ED8AE 3A46 + 811ED8B0 3842 + 811ED8B2 4833 + 811ED8B4 3C3D + 811ED8B6 373F + 811ED8B8 3634 + 811ED8BA 4341 + 811ED8BC 3B44 + 811ED8BE 4935 + cn Use all C Buttons + 811F1738 0000 + 811F173A 0000 + cn Event Item\Modifier 1 + 801ED895 ???? 0028:"Moon's Tear",0029:"Land Title Deed",002A:"Swap Title Deed",002B:"Mountain Title Deed",002C:"Ocean Title Deed",002D:"Room Key",002E:"Special Delivery To Mama",002F:"Letter To Kafei",0030:"Pendant Of Memories" + cn Event Item\Modifier 2 + 801ED89B ???? 0028:"Moon's Tear",0029:"Land Title Deed",002A:"Swap Title Deed",002B:"Mountain Title Deed",002C:"Ocean Title Deed",002D:"Room Key",002E:"Special Delivery To Mama",002F:"Letter To Kafei",0030:"Pendant Of Memories" + cn Event Item\Modifier 3 + 801ED8A1 ???? 0028:"Moon's Tear",0029:"Land Title Deed",002A:"Swap Title Deed",002B:"Mountain Title Deed",002C:"Ocean Title Deed",002D:"Room Key",002E:"Special Delivery To Mama",002F:"Letter To Kafei",0030:"Pendant Of Memories" + cn Have Item Modifier + 801ED8A0 ???? 0005:"Japanese Flute?",000B:"Japanese Item?",0010:"Great Fairy's Sword",0011:"Japanese Hookshot?",0031:"Japanese Scroll?",004A:"Japanese Bow?" + cn Have Bottle\Modifier 1 + 801ED8A2 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Have Bottle\Modifier 2 + 801ED8A3 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Have Bottle\Modifier 3 + 801ED8A4 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Have Bottle\Modifier 4 + 801ED8A5 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Have Bottle\Modifier 5 + 801ED8A6 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Have Bottle\Modifier 6 + 801ED8A7 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Have\Great Fairy's Sword + 801ED8A0 0010 + cn Have\QuestStatus Items + 801ED8DD 0005 + 811ED8DE F7CF + cn Have\Have Ocarina of Time + 801ED890 0000 + cn Have\Hero's Bow + 801ED891 0001 + cn Have\Fire Arrow + 801ED892 0002 + cn Have\Ice Arrow + 801ED893 0003 + cn Have\Light Arrow + 801ED894 0004 + cn Have\Bombs + 801ED896 0006 + cn Have\Bombchu + 801ED897 0007 + cn Have\Deku Sticks + 801ED898 0008 + cn Have\Deku Nuts + 801ED899 0009 + cn Have\Magic Beans + 801ED89A 000A + cn Have\Powder Kegs + 801ED89C 000C + cn Have\Pictograph + 801ED89D 000D + cn Have\Lens of Truth + 801ED89E 000E + cn Have\Hookshot + 801ED89F 000F + cn All Equipment Upgrades + 801ED88D 0023 + 811ED8DA 201B + 801ED86C 004F + cn Replace Sword With + cd Only put the Deity Link's Sword on, if using The Play As Fierce Deity Link Code, if not it will turn Fierce Deity Link into a crazed slashing Machine. You have been warned. + 801ED86C ???? 004A:"Fire Arrow w/ Bow",004B:"Ice Arrow w/ Bow",004C:"Light Arrow w/ Bow",004D:"Kokiri Sword",004E:"Razor Sword",004F:"Guilded Sword",0050:"Deity Link's Sword" + cn Play As + 801ED840 ???? 0000:"Fierce Deity Link",0001:"Goron Link",0002:"Zora Link",0003:"Deku Link",0004:"Normal Link" + cn Infinite\Hearts Options + cd If you need to clear the Infinite Max Hearts from the screen just choose the 6 or 4 Heart Options, take off the cheat & then make a save. + 811ED854 ???? 0140:"Max Hearts",0063:"6 Hearts",0043:"4 Hearts" + cn Beta World 1 + cd Put on the code on load up,After the Nintendo logo you will be in that place of Choice.you can also choose another place & then press F1 (reset) to go to that place this is for beta interest only it will not assist you in playing the game. + D03E4CAB 0000 + 801ED822 ???? 0000:"Mama's House non Beta",0001:"Fearful Spider House",0002:"Beneaf the Graveyard",0003:"Southern Swamp Mr Tingle Entry",0006:"Outside Tourist Information Southern Swamp",0008:"Outside Magic Hag's Potion Shop",000A:"Southern Swamp Woods Of Mystery Entry",0024:"Counter Of The Tresure Chest Shop",002E:"Woodfall Temple non Beta",0032:"Spider Hand",0035:"Statue outside Gorman Track",0036:"Statue outside Lair Of The Temples Boss",0038:"Path to Romani Ranch non Beta",004A:"outside The Royal Palace of the Deku Kingdom",004C:"Ledge in The Royal Palace of the Deku Kingdom",004E:"inside The Royal Palace of the Deku Kingdom 1",0071:"Green Blobs",0074:"Cave Portal to Last Boss Field",007F:"Waterfall Sothern Swamp",008A:"Giant Turtle In the Temple non beta",008B:"Room of Miau & Tijo Zora Great Hall",0094:"Recieving Gorans Mask non Beta",0095:"?",0096:"Hungry Goran in the Snow",00A2:"Statue in Stone Tower",00A6:"Stone Tower non Beta",00B9:"Recieving Deku Mask non Beta",00D9:"Giant Lizards in a Cave",00DA:"Cave with Steaming Water",00FF:"Vamps House In Ikana Canyon" + cn Warp Modifier + cd Put this code on and it will now take where you wanted to go, turn it back off or it will infinite loop entering all the time. + 803E4CAA 0000 + 803FD505 0001 + 813FD50A ???? 0010:"Mayors Residence",0008:"Magic Hags Potion Shop",000A:"Romani Ranch Barn",000B:"Mama's House",000E:"Honey & Darlings Shop",0015:"Final Boss Arena",001F:"Beneath the Graveyard (left entrance)",002F:"Beneath the Graveyard (right entrance)",0030:"Southern Swamp (Reg Entrance)",004F:"Southern Swamp (from tour house)",006E:"Southern Swamp (from Woodfall)",006F:"Southern Swamp (from Deku Palace)",0078:"Path to Ikana Canyon",009E:"Southern Swamp (from Deku Place 2)",009F:"Southern Swamp (From Potion Shop)",00AF:"Boat Cruise (picture taking)",00CD:"Southern Swamp (From Woods of Mystery)",00CE:"Southern Swamp (From Spider House)",00CF:"Southern Swamp (From Ikana Canyon)",00FE:"Southern Swamp (From Owl Warp)",0E00:"Curiosity Shop",0E38:"Ikana Canyon Entrance",1500:"Lens of Truth Cave (get it)",2600:"Stone Tower Temple (Upside down)",2609:"Stone Tower Temple (Boss Room Entrance)",2604:"Treasure Chest Shop",2605:"Treausre Chest Shop (counter)",260E:"Clock Tower (w/ skull kid, silent)",2610:"Stone Tower Temple (endless fall)",6214:"Romani Ranch",9214:"Zora Shop",B214:"Snowhead (Path to temple, warp in)",D214:"East Clock Down" + cn All Items (Normal Ram Pak Version) + FF1E0000 0000 + 50002402 0202 + 810EC350 0001 + +crc EC7011B7-7616D72B-C:4A +gn Zelda no Densetsu - Toki no Ocarina (J) (v1.0) + cn Infinite\Rupees + cd This cheat allows you to have the max Rupees to the Wallet you currently Hold + 8111B99C 0001 + cn Press R\For Old Or Young Link + cd To Activate this Cheat Hold The R Button when walking through a Doorway this will change you to the option on the other side, Disable this Cheat straight away after getting to the other side, in some places you might even get Access Violations. Just press ok untill you can carry on. + D01C84B5 0010 + 8011A5D7 ???? 0001:"Link Young",0000:"Link Old" + cn Use Any Item In Any House + cd do not use under or in water + 8111B7F2 0000 + 8111B7F4 0000 + cn Have\All Equipment + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 8111A66C 7777 + cn Have\All Quest/Status Items + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 8111A674 30FF + 8111A676 FFFF + cn Max\Heart Containers + 8111A5FE 0140 + cn Max\Gold Skulltulas Killed + 8011A6A1 0064 + cn Time of Day Modifier + 8111A5DC ???? 4000:"At Sunrise",5800:"Daylight Out",7000:"Very Bright Out",C000:"At Sunset",D000:"Fairly Dark" + cn Infinite\Energy + 8111A600 0140 + cn Infinite\Magic + D011A609 0008 + 8011A60A 0001 + 8011A60C 0001 + 8011A603 0060 + cn Tunic & Boot Options + cd This changes what you are wearing,once you have enabled the code press Start & then start again. + 8011A640 ???? 0011:"Kokiri Tunic & Kokiri Boots",0012:"Goron Tunic & Kokiri Boots",0013:"Zora Tunic & Kokiri Boots",0014:"Black Tunic & Kokiri Boots",0015:"White Tunic & Kokiri Boots",0016:"Yellow Tunic & Kokiri Boots",0021:"Kokiri Tunic & Iron Boots",0022:"Goron Tunic & Iron Boots",0023:"Zora Tunic & Iron Boots",0024:"Black Tunic & Iron Boots",0025:"White Tunic & Iron Boots",0026:"Yellow Tunic & Iron Boots",0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Infinite\Deku Sticks + 8011A65C 0009 + cn Infinite\Deku Nuts + 8011A65D 0009 + cn Infinite\Bombs + 8011A65E 0009 + cn Infinite\Arrows + 8011A65F 0009 + cn Infinite\Deku Seeds + 8011A662 0009 + cn Infinite\Bombchu's + 8011A664 0009 + cn Infinite\Magic Beans + 8011A66A 0009 + cn Infinite\Big Key,Small Keys,Compass,& Map + 8011A678 0007 + 8011A679 0007 + 8011A67A 0007 + 8011A67B 0007 + 8011A67C 0007 + 8011A67D 0007 + 8011A67E 0007 + 8011A67F 0007 + 8011A680 0007 + 8011A681 0007 + 8011A682 0007 + 8011A68F 0009 + 8011A690 0009 + 8011A691 0009 + 8011A692 0009 + 8011A693 0009 + 8011A699 0009 + 8011A69C 0009 + 8011A697 0009 + cn Have\Ocarina + 8011A64B ???? 0007:"Fairy Ocarina",0008:"Ocarina Of Time" + cn Have\Boomerang + 8011A650 000E + cn Have\Lens of Truth + 8011A651 000F + cn Have\Megaton Hammer + 8011A653 0011 + cn Have\Deku Stick + 8011A644 0000 + cn Have\Deku Nut + 8011A645 0001 + cn Have\Bombs + 8011A646 0002 + cn Have\Fairy Bow + 8011A647 0003 + cn Have\Fairy Slingshot + 8011A64A 0006 + cn Have\Bombchu + 8011A64C 0009 + cn Have\Arrows\Fire Arrow + 8011A648 0004 + cn Have\Arrows\Ice Arrow + 8011A64E 000C + cn Have\Arrows\Light Arrow + 8011A654 0012 + cn Have\Hookshot + 8011A64D ???? 000A:"Hookshot",000B:"Longshot" + cn Have\Magic Beans + 8011A652 0010 + cn Have\Magic\Fairie's Wind + 8011A64F 000D + cn Have\Magic\Nayru's Love + 8011A655 0013 + cn Have\Magic\Din's Fire + 8011A649 0005 + cn Bottles\Bottle 1 Modifier + 8011A656 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 2 Modifier + 8011A657 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 3 Modifier + 8011A658 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 4 Modifier + 8011A659 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Trading\Adult Link Item + 8011A65A ???? 002D:"Pocket Egg",002E:"Pocket Cucco",002F:"Cojiro",0030:"Odd Mushroom",0031:"Odd Potion",0032:"Poacher's Saw",0033:"Goron's Sword (Broken)",0034:"Prescription",0035:"Eyeball Frog",0036:"Eye Drops",0037:"Claim Check" + cn Trading\Young Link Item + 8011A65B ???? 0021:"Weird Egg",0022:"Chicken",0023:"Zelda's Letter",0024:"Keaton Mask",0025:"Skull Mask",0026:"Spooky Mask",0027:"Bunny Hood",0028:"Goron Mask",0029:"Zora Mask",002A:"Gerudo Mask",002B:"Mask of Truth",002C:"SOLD OUT" + cn Turn Giant's Knife Into Biggoron's Sword + 8011A60E 0001 + cn Have Quiver (Holds 30) + 8011A671 0001 + cn Equipment Modifier 1 + cd This modifies the equipment you are carrying.If you Use Black Gauntlets,They are as strong as the Golden Gauntlets. This code also gives you the Silver Scale and the Golden Scale and unlimited rupees. + 8011A672 ???? 0002:"Silver Scale",0004:"Golden Scale",0006:"Giant's Knife (Broken)",0035:"Black Gauntlets",0040:"Bullet Bag (Holds 30)",0080:"Bullet Bag (Holds 40)",00C0:"Bullet Bag (Holds 50)" + cn Equipment Modifier 2 + cd This modifies the equipment you are carrying. + 8011A673 ???? 0008:"Bomb Bag (Holds 20)",0010:"Bomb Bag (Holds 30)",0018:"Bomb Bag (Holds 40)",0020:"Goron's Bracelet",0028:"Silver Gauntlets",0030:"Golden Gauntlets" + cn Press L To Levitate + cd Use this cheat to levitate. You have to deactivate it to come back down. Useful for passing obstacles that usually can be passed only at a later point! + D01C84B5 0020 + 811DAA90 40CB + cn Press L For infinite Hover Boots, + cd Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on + D01C84B5 0020 + 811DB2B2 000D + cn Instant Step Hoover Boots + cd Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. + D01C84B5 0020 + 811DAA90 40CB + D01C84B5 0000 + 811DB2B2 000D + 8011A640 ???? 0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Beta\Play Beta Quest Worlds + cd Put on the code on load up,After the Nintendo logo you will be in Beta Mode,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. + D01C84B5 0000 + 8011B9E3 ???? 0000:"World 01",0001:"World 02",0002:"World 03",0003:"World 04",0004:"World 05",0007:"World 06",0008:"World 07",0016:"World 08" + cn Warp Song Location\Minuet of Forest & Serenade of Water + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011B965 ???? 0000:"Sacred Forest Meadow",0004:"Lake Hylia",0015:"Inside Jabu Jabu's Belly",0018:"Dodongo's Cavern",0068:"Inside The Deku Tree" + cn Warp Song Location\Prelude of Light & Nocturne of Shadow + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011B965 ???? 0003:"Kakariko Windmill",0007:"Bombchu Bowling Alley",000F:"Zelda & Impa Flee",0014:"Kakariko Village",0017:"Ganon,Final Battle",001D:"Top of Ganon's Tower",0028:"Bombchu Shop",002C:"Bazaar",0030:"Happy Mask Shop",0034:"Ganon's Tower",0038:"Ganon's Castle",004C:"Inside Spirit Door",006C:"Burning Castle",0050:"House of Skulltula",0064:"Death Mountain Trail",0068:"Graveyard",0070:"Thieves' Hideout",0074:"Royal Family's Tomb",0078:"Great Fairy Fountain 1",0084:"Forest Temple,Room With Falling Floor",0088:"Great Fairy Fountain 2",0099:"Grotto 01",009D:"Grotto 02",00A4:"Grotto 04",00A8:"Grotto 05",00B3:"Grotto 06",00B0:"Grotto 07",00B4:"Grotto 08",00B8:"Grotto 09",00C3:"Grotto 10",00C0:"Grotto 11",00C4:"Grotto 12",00FC:"Grotto 13",00D3:"Bottom of the Well",00D0:"Lon Lon Ranch Shed",00D3:"Lon Lon Ranch Outside Shed",00D8:"Ice Cavern",00E3:"Outside Cow Pen",00E0:"Lost Woods Bridge",00E4:"Lon Lon Ranch Chicken Room",00E8:"In Front of Deku Tree",00EB:"Spirit Temple Boss",00F1:"Castle Courtyard,In Front of Zelda",00F4:"Temple of Time",00F8:"Gerudo Fortress Jail" + cn Warp Song Location\Bolero of Fire + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011B965 ???? 0003:"Castle Courtyard",000B:"Dodongo's Cavern Boss",0010:"Inside The Deku Tree Boss",0014:"Shadow Temple Boss",0017:"Water Temple Boss",001C:"Ganon's Castle Tower",001F:"Ganon First Battle",0028:"Ganon's Castle Room Before Ganon",002B:"Inside Ganon's Castle Room With Pillar",002F:"Lon Lon Ranch",0033:"Mido's House",0037:"Saria's House",004B:"Bearded Man's House",0040:"Top of Ganon's Castle",0047:"Outside Saria's House",004F:"Dampe's Race",0057:"Kokiri Forest",005B:"Top of Death Mountain",005F:"Fishing Pond",0068:"Inside Ganon's Castle",007F:"Hyrule Castle Gate",00BA:"Top of Ganon's Tower",00C2:"Great Fairy Fountain",00D6:"Lost Woods Goron Entrance",00DA:"Lost Woods River Entrance",00DE:"Lost Woods Bridge Field Entrance",00E3:"Goron City Lost Woods Entrance",00F6:"Death Mountain Crater",00FD:"Ganon's Castle" + cn Warp Song Location\Requiem of Spirit + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011B965 ???? 0005:"Lake Hylia,08 Zora's Domain",0018:"Gerudo Valley",001E:"Lost Woods",0028:"Gerudo Fortress",0030:"Haunted Wasteland",0034:"Ganon's Castle Inside Burning Castle",0038:"Hyrule Castle",003A:"Ganon's Castle",003D:"Death Mountain Trail",004D:"Goron City",0065:"Fire Temple",0069:"Forest Temple",006E:"Shooting Gallery",0079:"Ganon's Castle Inside Burning Castle",007E:"Kakariko Village Entrance",007B:"Zora's River Entrance",0085:"Kokiri Forest Entrance",008A:"Lake Hyrule Entrance",008E:"Gerudo Valley Entrance",0092:"Death Mountain Trail Entrance",0095:"Graveyard Entrance",009E:"Zora's Domain Entrance",00A2:"Zora's Fountain Entrance",00BA:"Goron City Entrance",00BE:"Death Mountain Trail",00C1:"Goron City",00C5:"Lakeside Laboratory",00C9:"Top of Ganon's Castle",00CD:"Hyrule Market (Child Link's)",00CF:"Hyrule Market (Adult Link's)",00F1:"Desert Colossus",00FA:"Lon Lon Ranch Entrance",00FD:"Hyrule Field" + cn Max\Double Defense Power + cd This gives you White Border Hearts + 8011A69F 0014 + cn Nayru's Love is Always + cd For this to work On Or off, you have to walk through a Doorway to activate the Change. + 8111B998 ???? 0000:"OFF",FFFF:"ON" + cn Infinite\Timers\All other Timers + cd This cheat works on all Race Timers.Under Water with iron Boots etc. + 8011B9A1 0032 + cn Epona\Max Carrots\Lon Lon Raunch + cd This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona + 801D8BCA 0006 + 801F2208 0001 + 801EEC88 0001 + cn Infinite\Timers\Escape From Gannons Tower + cd This cheat works only on The Final Boss. + 8011B9A5 00B4 + cn Beta\Specific things lean + cd This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest 01). + 80025614 0001 + cn Beta\Appear in Strange Places (Hold R) + cd If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. + D01C84B5 0010 + 8111B936 0001 + cn Beta\Interface always off/on + cd If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset. + 8011B4B9 00FF + 8011B92F ???? 0000:"Off",0001:"On" + cn Always Have Wallet Size + 8011A672 ???? 0047:"Kid Wallet (Holds 99)",0057:"Adult Wallet (Holds 200)",0067:"Giant Wallet (Holds 500)" + +crc D43DA81F-021E1E19-C:4A +gn Zelda no Densetsu - Toki no Ocarina (J) (v1.1) + cn Infinite\Rupees + cd This cheat allows you to have the max Rupees to the Wallet you currently Hold + 8111BB5C 0001 + cn Press R\For Old Or Young Link + cd To Activate this Cheat Hold The R Button when walking through a Doorway this will change you to the option on the other side, Disable this Cheat straight away after getting to the other side, in some places you might even get Access Violations. Just press ok untill you can carry on. + D01C8675 0010 + 8011A797 ???? 0001:"Link Young",0000:"Link Old" + cn Use Any Item In Any House + cd do not use under or in water + 8111B9B2 0000 + 8111B9B4 0000 + cn Have\All Equipment + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 8111A82C 7777 + cn Have\All Quest/Status Items + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 8111A834 30FF + 8111A836 FFFF + cn Max\Heart Containers + 8111A7BE 0140 + cn Max\Gold Skulltulas Killed + 8011A861 0064 + cn Time of Day Modifier + 8111A79C ???? 4000:"At Sunrise",5800:"Daylight Out",7000:"Very Bright Out",C000:"At Sunset",D000:"Fairly Dark" + cn Infinite\Energy + 8111A7C0 0140 + cn Infinite\Magic + D011A7C9 0008 + 8011A7CA 0001 + 8011A7CC 0001 + 8011A7C3 0060 + cn Tunic & Boot Options + cd This changes what you are wearing,once you have enabled the code press Start & then start again. + 8011A800 ???? 0011:"Kokiri Tunic & Kokiri Boots",0012:"Goron Tunic & Kokiri Boots",0013:"Zora Tunic & Kokiri Boots",0014:"Black Tunic & Kokiri Boots",0015:"White Tunic & Kokiri Boots",0016:"Yellow Tunic & Kokiri Boots",0021:"Kokiri Tunic & Iron Boots",0022:"Goron Tunic & Iron Boots",0023:"Zora Tunic & Iron Boots",0024:"Black Tunic & Iron Boots",0025:"White Tunic & Iron Boots",0026:"Yellow Tunic & Iron Boots",0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Infinite\Deku Sticks + 8011A81C 0009 + cn Infinite\Deku Nuts + 8011A81D 0009 + cn Infinite\Bombs + 8011A81E 0009 + cn Infinite\Arrows + 8011A81F 0009 + cn Infinite\Deku Seeds + 8011A822 0009 + cn Infinite\Bombchu's + 8011A824 0009 + cn Infinite\Magic Beans + 8011A82A 0009 + cn Infinite\Big Key,Small Keys,Compass,& Map + 8011A838 0007 + 8011A839 0007 + 8011A83A 0007 + 8011A83B 0007 + 8011A83C 0007 + 8011A83D 0007 + 8011A83E 0007 + 8011A83F 0007 + 8011A840 0007 + 8011A841 0007 + 8011A842 0007 + 8011A84F 0009 + 8011A850 0009 + 8011A851 0009 + 8011A852 0009 + 8011A853 0009 + 8011A859 0009 + 8011A85C 0009 + 8011A857 0009 + cn Have\Ocarina + 8011A80B ???? 0007:"Fairy Ocarina",0008:"Ocarina Of Time" + cn Have\Boomerang + 8011A810 000E + cn Have\Lens of Truth + 8011A811 000F + cn Have\Megaton Hammer + 8011A813 0011 + cn Have\Deku Stick + 8011A804 0000 + cn Have\Deku Nut + 8011A805 0001 + cn Have\Bombs + 8011A806 0002 + cn Have\Fairy Bow + 8011A807 0003 + cn Have\Fairy Slingshot + 8011A80A 0006 + cn Have\Bombchu + 8011A80C 0009 + cn Have\Arrows\Fire Arrow + 8011A808 0004 + cn Have\Arrows\Ice Arrow + 8011A80E 000C + cn Have\Arrows\Light Arrow + 8011A814 0012 + cn Have\Hookshot + 8011A80D ???? 000A:"Hookshot",000B:"Longshot" + cn Have\Magic Beans + 8011A812 0010 + cn Have\Magic\Fairie's Wind + 8011A80F 000D + cn Have\Magic\Nayru's Love + 8011A815 0013 + cn Have\Magic\Din's Fire + 8011A809 0005 + cn Bottles\Bottle 1 Modifier + 8011A816 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 2 Modifier + 8011A817 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 3 Modifier + 8011A818 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 4 Modifier + 8011A819 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Trading\Adult Link Item + 8011A81A ???? 002D:"Pocket Egg",002E:"Pocket Cucco",002F:"Cojiro",0030:"Odd Mushroom",0031:"Odd Potion",0032:"Poacher's Saw",0033:"Goron's Sword (Broken)",0034:"Prescription",0035:"Eyeball Frog",0036:"Eye Drops",0037:"Claim Check" + cn Trading\Young Link Item + 8011A81B ???? 0021:"Weird Egg",0022:"Chicken",0023:"Zelda's Letter",0024:"Keaton Mask",0025:"Skull Mask",0026:"Spooky Mask",0027:"Bunny Hood",0028:"Goron Mask",0029:"Zora Mask",002A:"Gerudo Mask",002B:"Mask of Truth",002C:"SOLD OUT" + cn Turn Giant's Knife Into Biggoron's Sword + 8011A7CE 0001 + cn Have Quiver (Holds 30) + 8011A831 0001 + cn Equipment Modifier 1 + cd This modifies the equipment you are carrying.If you Use Black Gauntlets,They are as strong as the Golden Gauntlets. This code also gives you the Silver Scale and the Golden Scale and unlimited rupees. + 8011A832 ???? 0002:"Silver Scale",0004:"Golden Scale",0006:"Giant's Knife (Broken)",0035:"Black Gauntlets",0040:"Bullet Bag (Holds 30)",0080:"Bullet Bag (Holds 40)",00C0:"Bullet Bag (Holds 50)" + cn Equipment Modifier 2 + cd This modifies the equipment you are carrying. + 8011A833 ???? 0008:"Bomb Bag (Holds 20)",0010:"Bomb Bag (Holds 30)",0018:"Bomb Bag (Holds 40)",0020:"Goron's Bracelet",0028:"Silver Gauntlets",0030:"Golden Gauntlets" + cn Press L To Levitate + cd Use this cheat to levitate. You have to deactivate it to come back down. Useful for passing obstacles that usually can be passed only at a later point! + D01C8675 0020 + 811DAC50 40CB + cn Press L For infinite Hover Boots, + cd Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on + D01C8675 0020 + 811DB472 000D + cn Instant Step Hoover Boots + cd Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. + D01C8675 0020 + 811DAC50 40CB + D01C8675 0000 + 811DB472 000D + 8011A800 ???? 0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Beta\Play Beta Quest Worlds + cd Put on the code on load up,After the Nintendo logo you will be in Beta Mode,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. + D01C8675 0000 + 8011BBA3 ???? 0000:"World 01",0001:"World 02",0002:"World 03",0003:"World 04",0004:"World 05",0007:"World 06",0008:"World 07",0016:"World 08" + cn Warp Song Location\Minuet of Forest & Serenade of Water + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011BB25 ???? 0000:"Sacred Forest Meadow",0004:"Lake Hylia",0015:"Inside Jabu Jabu's Belly",0018:"Dodongo's Cavern",0068:"Inside The Deku Tree" + cn Warp Song Location\Prelude of Light & Nocturne of Shadow + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011BB25 ???? 0003:"Kakariko Windmill",0007:"Bombchu Bowling Alley",000F:"Zelda & Impa Flee",0014:"Kakariko Village",0017:"Ganon,Final Battle",001D:"Top of Ganon's Tower",0028:"Bombchu Shop",002C:"Bazaar",0030:"Happy Mask Shop",0034:"Ganon's Tower",0038:"Ganon's Castle",004C:"Inside Spirit Door",006C:"Burning Castle",0050:"House of Skulltula",0064:"Death Mountain Trail",0068:"Graveyard",0070:"Thieves' Hideout",0074:"Royal Family's Tomb",0078:"Great Fairy Fountain 1",0084:"Forest Temple,Room With Falling Floor",0088:"Great Fairy Fountain 2",0099:"Grotto 01",009D:"Grotto 02",00A4:"Grotto 04",00A8:"Grotto 05",00B3:"Grotto 06",00B0:"Grotto 07",00B4:"Grotto 08",00B8:"Grotto 09",00C3:"Grotto 10",00C0:"Grotto 11",00C4:"Grotto 12",00FC:"Grotto 13",00D3:"Bottom of the Well",00D0:"Lon Lon Ranch Shed",00D3:"Lon Lon Ranch Outside Shed",00D8:"Ice Cavern",00E3:"Outside Cow Pen",00E0:"Lost Woods Bridge",00E4:"Lon Lon Ranch Chicken Room",00E8:"In Front of Deku Tree",00EB:"Spirit Temple Boss",00F1:"Castle Courtyard,In Front of Zelda",00F4:"Temple of Time",00F8:"Gerudo Fortress Jail" + cn Warp Song Location\Bolero of Fire + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011BB25 ???? 0003:"Castle Courtyard",000B:"Dodongo's Cavern Boss",0010:"Inside The Deku Tree Boss",0014:"Shadow Temple Boss",0017:"Water Temple Boss",001C:"Ganon's Castle Tower",001F:"Ganon First Battle",0028:"Ganon's Castle Room Before Ganon",002B:"Inside Ganon's Castle Room With Pillar",002F:"Lon Lon Ranch",0033:"Mido's House",0037:"Saria's House",004B:"Bearded Man's House",0040:"Top of Ganon's Castle",0047:"Outside Saria's House",004F:"Dampe's Race",0057:"Kokiri Forest",005B:"Top of Death Mountain",005F:"Fishing Pond",0068:"Inside Ganon's Castle",007F:"Hyrule Castle Gate",00BA:"Top of Ganon's Tower",00C2:"Great Fairy Fountain",00D6:"Lost Woods Goron Entrance",00DA:"Lost Woods River Entrance",00DE:"Lost Woods Bridge Field Entrance",00E3:"Goron City Lost Woods Entrance",00F6:"Death Mountain Crater",00FD:"Ganon's Castle" + cn Warp Song Location\Requiem of Spirit + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011BB25 ???? 0005:"Lake Hylia,08 Zora's Domain",0018:"Gerudo Valley",001E:"Lost Woods",0028:"Gerudo Fortress",0030:"Haunted Wasteland",0034:"Ganon's Castle Inside Burning Castle",0038:"Hyrule Castle",003A:"Ganon's Castle",003D:"Death Mountain Trail",004D:"Goron City",0065:"Fire Temple",0069:"Forest Temple",006E:"Shooting Gallery",0079:"Ganon's Castle Inside Burning Castle",007E:"Kakariko Village Entrance",007B:"Zora's River Entrance",0085:"Kokiri Forest Entrance",008A:"Lake Hyrule Entrance",008E:"Gerudo Valley Entrance",0092:"Death Mountain Trail Entrance",0095:"Graveyard Entrance",009E:"Zora's Domain Entrance",00A2:"Zora's Fountain Entrance",00BA:"Goron City Entrance",00BE:"Death Mountain Trail",00C1:"Goron City",00C5:"Lakeside Laboratory",00C9:"Top of Ganon's Castle",00CD:"Hyrule Market (Child Link's)",00CF:"Hyrule Market (Adult Link's)",00F1:"Desert Colossus",00FA:"Lon Lon Ranch Entrance",00FD:"Hyrule Field" + cn Max\Double Defense Power + cd This gives you White Border Hearts + 8011A85F 0014 + cn Nayru's Love is Always + cd For this to work On Or off, you have to walk through a Doorway to activate the Change. + 8111BB58 ???? 0000:"OFF",FFFF:"ON" + cn Infinite\Timers\All other Timers + cd This cheat works on all Race Timers.Under Water with iron Boots etc. + 8011BB61 0032 + cn Epona\Max Carrots\Lon Lon Raunch + cd This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona + 801D8D8A 0006 + 801F23C8 0001 + 801EEE48 0001 + cn Infinite\Timers\Escape From Gannons Tower + cd This cheat works only on The Final Boss. + 8011BB65 00B4 + cn Beta\Specific things lean + cd This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest 01). + 800257D4 0001 + cn Beta\Appear in Strange Places (Hold R) + cd If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. + D01C8675 0010 + 8111BAF6 0001 + cn Beta\Interface always off/on + cd If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset. + 8011B679 00FF + 8011BAEF ???? 0000:"Off",0001:"On" + cn Always Have Wallet Size + 8011A832 ???? 0047:"Kid Wallet (Holds 99)",0057:"Adult Wallet (Holds 200)",0067:"Giant Wallet (Holds 500)" + +crc 693BA2AE-B7F14E9F-C:4A +gn Zelda no Densetsu - Toki no Ocarina (J) (v1.2) +//--------------- (JU) Region Cheat Codes --------------- + cn Infinite\Rupees + cd This cheat allows you to have the max Rupees to the Wallet you currently Hold + 8111C04C 0001 + cn Press R\For Old Or Young Link + cd To Activate this Cheat Hold The R Button when walking through a Doorway this will change you to the option on the other side, Disable this Cheat straight away after getting to the other side, in some places you might even get Access Violations. Just press ok untill you can carry on. + D01C8D75 0010 + 8011AC87 ???? 0001:"Link Young",0000:"Link Old" + cn Use Any Item In Any House + cd do not use under or in water + 8111BEA2 0000 + 8111BEA4 0000 + cn Have\All Equipment + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 8111AD1C 7777 + cn Have\All Quest/Status Items + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 8111AD24 30FF + 8111AD26 FFFF + cn Max\Heart Containers + 8111ACAE 0140 + cn Max\Gold Skulltulas Killed + 8011AD51 0064 + cn Time of Day Modifier + 8111AC8C ???? 4000:"At Sunrise",5800:"Daylight Out",7000:"Very Bright Out",C000:"At Sunset",D000:"Fairly Dark" + cn Infinite\Energy + 8111ACB0 0140 + cn Infinite\Magic + D011ACB9 0008 + 8011ACBA 0001 + 8011ACBC 0001 + 8011ACB3 0060 + cn Tunic & Boot Options + cd This changes what you are wearing,once you have enabled the code press Start & then start again. + 8011ACF0 ???? 0011:"Kokiri Tunic & Kokiri Boots",0012:"Goron Tunic & Kokiri Boots",0013:"Zora Tunic & Kokiri Boots",0014:"Black Tunic & Kokiri Boots",0015:"White Tunic & Kokiri Boots",0016:"Yellow Tunic & Kokiri Boots",0021:"Kokiri Tunic & Iron Boots",0022:"Goron Tunic & Iron Boots",0023:"Zora Tunic & Iron Boots",0024:"Black Tunic & Iron Boots",0025:"White Tunic & Iron Boots",0026:"Yellow Tunic & Iron Boots",0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Infinite\Deku Sticks + 8011AD0C 0009 + cn Infinite\Deku Nuts + 8011AD0D 0009 + cn Infinite\Bombs + 8011AD0E 0009 + cn Infinite\Arrows + 8011AD0F 0009 + cn Infinite\Deku Seeds + 8011AD12 0009 + cn Infinite\Bombchu's + 8011AD14 0009 + cn Infinite\Magic Beans + 8011AD1A 0009 + cn Infinite\Big Key,Small Keys,Compass,& Map + 8011AD28 0007 + 8011AD29 0007 + 8011AD2A 0007 + 8011AD2B 0007 + 8011AD2C 0007 + 8011AD2D 0007 + 8011AD2E 0007 + 8011AD2F 0007 + 8011AD30 0007 + 8011AD31 0007 + 8011AD32 0007 + 8011AD3F 0009 + 8011AD40 0009 + 8011AD41 0009 + 8011AD42 0009 + 8011AD43 0009 + 8011AD49 0009 + 8011AD4C 0009 + 8011AD47 0009 + cn Have\Ocarina + 8011ACFB ???? 0007:"Fairy Ocarina",0008:"Ocarina Of Time" + cn Have\Boomerang + 8011AD00 000E + cn Have\Lens of Truth + 8011AD01 000F + cn Have\Megaton Hammer + 8011AD03 0011 + cn Have\Deku Stick + 8011ACF4 0000 + cn Have\Deku Nut + 8011ACF5 0001 + cn Have\Bombs + 8011ACF6 0002 + cn Have\Fairy Bow + 8011ACF7 0003 + cn Have\Fairy Slingshot + 8011ACFA 0006 + cn Have\Bombchu + 8011ACFC 0009 + cn Have\Arrows\Fire Arrow + 8011ACF8 0004 + cn Have\Arrows\Ice Arrow + 8011ACFE 000C + cn Have\Arrows\Light Arrow + 8011AD04 0012 + cn Have\Hookshot + 8011ACFD ???? 000A:"Hookshot",000B:"Longshot" + cn Have\Magic Beans + 8011AD02 0010 + cn Have\Magic\Fairie's Wind + 8011ACFF 000D + cn Have\Magic\Nayru's Love + 8011AD05 0013 + cn Have\Magic\Din's Fire + 8011ACF9 0005 + cn Bottles\Bottle 1 Modifier + 8011AD06 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 2 Modifier + 8011AD07 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 3 Modifier + 8011AD08 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 4 Modifier + 8011AD09 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Trading\Adult Link Item + 8011AD0A ???? 002D:"Pocket Egg",002E:"Pocket Cucco",002F:"Cojiro",0030:"Odd Mushroom",0031:"Odd Potion",0032:"Poacher's Saw",0033:"Goron's Sword (Broken)",0034:"Prescription",0035:"Eyeball Frog",0036:"Eye Drops",0037:"Claim Check" + cn Trading\Young Link Item + 8011AD0B ???? 0021:"Weird Egg",0022:"Chicken",0023:"Zelda's Letter",0024:"Keaton Mask",0025:"Skull Mask",0026:"Spooky Mask",0027:"Bunny Hood",0028:"Goron Mask",0029:"Zora Mask",002A:"Gerudo Mask",002B:"Mask of Truth",002C:"SOLD OUT" + cn Turn Giant's Knife Into Biggoron's Sword + 8011ACBE 0001 + cn Have Quiver (Holds 30) + 8011AD21 0001 + cn Equipment Modifier 1 + cd This modifies the equipment you are carrying.If you Use Black Gauntlets,They are as strong as the Golden Gauntlets. This code also gives you the Silver Scale and the Golden Scale and unlimited rupees. + 8011AD22 ???? 0002:"Silver Scale",0004:"Golden Scale",0006:"Giant's Knife (Broken)",0035:"Black Gauntlets",0040:"Bullet Bag (Holds 30)",0080:"Bullet Bag (Holds 40)",00C0:"Bullet Bag (Holds 50)" + cn Equipment Modifier 2 + cd This modifies the equipment you are carrying. + 8011AD23 ???? 0008:"Bomb Bag (Holds 20)",0010:"Bomb Bag (Holds 30)",0018:"Bomb Bag (Holds 40)",0020:"Goron's Bracelet",0028:"Silver Gauntlets",0030:"Golden Gauntlets" + cn Press L To Levitate + cd Use this cheat to levitate. You have to deactivate it to come back down. Useful for passing obstacles that usually can be passed only at a later point! + D01C8D75 0020 + 811DB350 40CB + cn Press L For infinite Hover Boots, + cd Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on + D01C8D75 0020 + 811DBB72 000D + cn Instant Step Hoover Boots + cd Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. + D01C8D75 0020 + 811DB350 40CB + D01C8D75 0000 + 811DBB72 000D + 8011ACF0 ???? 0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Beta\Play Beta Quest Worlds + cd Put on the code on load up,After the Nintendo logo you will be in Beta Mode,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. + D01C8D75 0000 + 8011C093 ???? 0000:"World 01",0001:"World 02",0002:"World 03",0003:"World 04",0004:"World 05",0007:"World 06",0008:"World 07",0016:"World 08" + cn Warp Song Location\Minuet of Forest & Serenade of Water + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011C015 ???? 0000:"Sacred Forest Meadow",0004:"Lake Hylia",0015:"Inside Jabu Jabu's Belly",0018:"Dodongo's Cavern",0068:"Inside The Deku Tree" + cn Warp Song Location\Prelude of Light & Nocturne of Shadow + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011C015 ???? 0003:"Kakariko Windmill",0007:"Bombchu Bowling Alley",000F:"Zelda & Impa Flee",0014:"Kakariko Village",0017:"Ganon,Final Battle",001D:"Top of Ganon's Tower",0028:"Bombchu Shop",002C:"Bazaar",0030:"Happy Mask Shop",0034:"Ganon's Tower",0038:"Ganon's Castle",004C:"Inside Spirit Door",006C:"Burning Castle",0050:"House of Skulltula",0064:"Death Mountain Trail",0068:"Graveyard",0070:"Thieves' Hideout",0074:"Royal Family's Tomb",0078:"Great Fairy Fountain 1",0084:"Forest Temple,Room With Falling Floor",0088:"Great Fairy Fountain 2",0099:"Grotto 01",009D:"Grotto 02",00A4:"Grotto 04",00A8:"Grotto 05",00B3:"Grotto 06",00B0:"Grotto 07",00B4:"Grotto 08",00B8:"Grotto 09",00C3:"Grotto 10",00C0:"Grotto 11",00C4:"Grotto 12",00FC:"Grotto 13",00D3:"Bottom of the Well",00D0:"Lon Lon Ranch Shed",00D3:"Lon Lon Ranch Outside Shed",00D8:"Ice Cavern",00E3:"Outside Cow Pen",00E0:"Lost Woods Bridge",00E4:"Lon Lon Ranch Chicken Room",00E8:"In Front of Deku Tree",00EB:"Spirit Temple Boss",00F1:"Castle Courtyard,In Front of Zelda",00F4:"Temple of Time",00F8:"Gerudo Fortress Jail" + cn Warp Song Location\Bolero of Fire + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011C015 ???? 0003:"Castle Courtyard",000B:"Dodongo's Cavern Boss",0010:"Inside The Deku Tree Boss",0014:"Shadow Temple Boss",0017:"Water Temple Boss",001C:"Ganon's Castle Tower",001F:"Ganon First Battle",0028:"Ganon's Castle Room Before Ganon",002B:"Inside Ganon's Castle Room With Pillar",002F:"Lon Lon Ranch",0033:"Mido's House",0037:"Saria's House",004B:"Bearded Man's House",0040:"Top of Ganon's Castle",0047:"Outside Saria's House",004F:"Dampe's Race",0057:"Kokiri Forest",005B:"Top of Death Mountain",005F:"Fishing Pond",0068:"Inside Ganon's Castle",007F:"Hyrule Castle Gate",00BA:"Top of Ganon's Tower",00C2:"Great Fairy Fountain",00D6:"Lost Woods Goron Entrance",00DA:"Lost Woods River Entrance",00DE:"Lost Woods Bridge Field Entrance",00E3:"Goron City Lost Woods Entrance",00F6:"Death Mountain Crater",00FD:"Ganon's Castle" + cn Warp Song Location\Requiem of Spirit + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011C015 ???? 0005:"Lake Hylia,08 Zora's Domain",0018:"Gerudo Valley",001E:"Lost Woods",0028:"Gerudo Fortress",0030:"Haunted Wasteland",0034:"Ganon's Castle Inside Burning Castle",0038:"Hyrule Castle",003A:"Ganon's Castle",003D:"Death Mountain Trail",004D:"Goron City",0065:"Fire Temple",0069:"Forest Temple",006E:"Shooting Gallery",0079:"Ganon's Castle Inside Burning Castle",007E:"Kakariko Village Entrance",007B:"Zora's River Entrance",0085:"Kokiri Forest Entrance",008A:"Lake Hyrule Entrance",008E:"Gerudo Valley Entrance",0092:"Death Mountain Trail Entrance",0095:"Graveyard Entrance",009E:"Zora's Domain Entrance",00A2:"Zora's Fountain Entrance",00BA:"Goron City Entrance",00BE:"Death Mountain Trail",00C1:"Goron City",00C5:"Lakeside Laboratory",00C9:"Top of Ganon's Castle",00CD:"Hyrule Market (Child Link's)",00CF:"Hyrule Market (Adult Link's)",00F1:"Desert Colossus",00FA:"Lon Lon Ranch Entrance",00FD:"Hyrule Field" + cn Max\Double Defense Power + cd This gives you White Border Hearts + 8011AD4F 0014 + cn Nayru's Love is Always + cd For this to work On Or off, you have to walk through a Doorway to activate the Change. + 8111C048 ???? 0000:"OFF",FFFF:"ON" + cn Infinite\Timers\All other Timers + cd This cheat works on all Race Timers.Under Water with iron Boots etc. + 8011C051 0032 + cn Epona\Max Carrots\Lon Lon Raunch + cd This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona + 801D927A 0006 + 801F28B8 0001 + 801EF338 0001 + cn Infinite\Timers\Escape From Gannons Tower + cd This cheat works only on The Final Boss. + 8011C055 00B4 + cn Beta\Specific things lean + cd This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest 01). + 80025CC4 0001 + cn Beta\Appear in Strange Places (Hold R) + cd If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. + D01C8B65 0010 + 8111BFE6 0001 + cn Beta\Interface always off/on + cd If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset. + 8011BB69 00FF + 8011BFDF ???? 0000:"Off",0001:"On" + cn Always Have Wallet Size + 8011AD22 ???? 0047:"Kid Wallet (Holds 99)",0057:"Adult Wallet (Holds 200)",0067:"Giant Wallet (Holds 500)" + +crc 1FBAF161-2C1C54F1-C:41 +gn 1080 SNOWBOARDING +//--------------- (U) Region Cheat Codes --------------- + cn Infinite Damage All Players & Levels + 803F4C3D 0000 + cn Infinite Lives & Continues + 8026B1CB 0003 + cn Enable All Levels & Boarders + 80255089 00FF + 8025508B 0005 + 81255096 FCFF + 80255098 0007 + cn Stop Timer\Time Attack\Air Make + 8031AB5A 0000 + cn Stop Timer\Time Attack\Half Pipe + 802F649A 0000 + cn Stop Timer\Time Attack\Crystal Lake + 802A593A 0000 + cn Stop Timer\Time Attack\Crystal Peak + 802B2CDA 0000 + cn Stop Timer\Time Attack\Golden Forrest + 802B146A 0000 + cn Stop Timer\Time Attack\Mountain Village + 802CBA6A 0000 + cn Stop Timer\Time Attack\Dragon Cave + 802C148A 0000 + cn Stop Timer\Time Attack\Deadly Fall + 802CF67A 0000 + cn Stop Timer\Trick Attack\Air Make + 8031ABCA 00C5 + cn Stop Timer\Trick Attack\Half Pipe + 802F650A 00C5 + cn Stop Timer\Trick Attack\Crystal Lake + 8029F77A 00C5 + cn Stop Timer\Trick Attack\Crystal Peak + 802AC9FA 00C5 + cn Stop Timer\Trick Attack\Golden Forrest + 802AB06A 00C5 + cn Stop Timer\Trick Attack\Mountain Village + 802C51EA 00C5 + cn Stop Timer\Trick Attack\Dragon Cave + 802BAE4A 00C5 + cn Stop Timer\Trick Attack\Deadly Fall + 802C8F1A 00C5 + cn Stop Timer\Contest\Crystal Lake + 8029C1EA 00C5 + cn Stop Timer\Contest\Crystal Peak + 802A89AA 00C5 + cn Stop Timer\Contest\Golden Forest + 802A6E4A 00C5 + cn Stop Timer\Contest\Air Make + 80319CCA 00C5 + cn Stop Timer\Contest\Half Pipe + 802F530A 00C5 + cn Have All\Match Levels Completed + 8025508A 0005 + cn Have All\Contest First Place Done + 80244098 0007 + cn Open Level Character Select + cd With these codes, you have to press the buttons listed below when you are viewing a certain boarders stats. Highlight Akari Hayami's stats, and then hold down the C-Left button and then press the A button to be the Crystal Boarder. Highlight Kensuke Kimachi's stats, and then hold down the C-Up button and then press the A button to be the Metal Boarder. Hightlight Rob Haywood's stats, and then hold down the C-Right button and then press the A button to be the Panda Boarder + 8125508A ???? 0001:"Easy Level",0002:"Easy & Normal Level",0003:"Easy Normal & Hard Levels",0004:"Easy Normal Hard Levels & Crystal Boarder",0005:"Easy Normal Hard Levels & Crystal & Metal Boarders" + cn Play As + 800200E7 ???? 0000:"Dion Blaster",0001:"Kensuke Kimachi",0002:"Akari Hayami",0003:"Ricky Winterborn",0004:"Rob Haywood",0005:"Silver Boarder",0006:"Gold Boarder",0007:"Panda Boarder" + cn Have All\Trick Attacks Done + 81255096 FCFF + +crc 82DC04FD-CF2D82F4-C:45 +gn A Bug's Life (J) + cn Infinite\Lives + 801E1A38 0009 + cn Infinite\Health + 801E1A2D 0004 + cn Always Have\Super Jump + 811E1A28 0020 + cn Always Have\50 pieces of corn + 801E1A39 0032 + cn Have F-L-I-K + 801E1A3A 000F + cn Levitate + cd "Press R To Levitate & Let go to land (:" + D008F2C1 0010 + 801E199E 0001 + D008F2C1 0010 + 801E19AE 0001 + cn Unlock All Levels + 81099150 000F + cn Have All Goldberry Tokens + 801E1A26 0000 + cn Start with Berry Weapon + 811E1A2E ???? 0001:"Blueberry",0002:"Homing Berry",0003:"Goldberry",0004:"Super Berry ?" + +crc 1B598BF1-ECA29B45-C:45 +gn Aerofighter's Assault (U) + cn Ultra Fast Missile Recharge + 8027E300 0001 + cn Rocket Squad + 8027E107 0001 + cn Tomahawk Squad + 8027E109 0001 + cn Extra Points + D027A20C 0000 + 8027A20C 00FF + cn Extra Planes + 8127CCEC FFFF + cn 99 Bonus + 80130B87 0063 + cn 99 Accuracy + 80130B80 0063 + cn Gun Select + 8027E023 ???? 0000:"Chaff",0001:"Jammings",0002:"Air Mines",0003:"Mahibishi",000A:"22mm BB Shot",000B:"22mm",000C:"Hunai Shot",000D:"Fireball",000E:"Sabre",0014:"Fire",0015:"Tomahawk",0016:"Ninja Glitch",0017:"Fire Wave",001E:"Rocket",001F:"Phoenix",0020:"Star",0021:"Fire Arrow",0028:"Ninjabeam" + cn Infinite\Chaffs + 8027E017 000A + cn Infinite\Gun + 8027E110 0001 + cn Infinite\Special Weapons + 8027E4D2 0002 + cn Infinite\Armor + 8127CFF4 44A0 + 8127CFF8 44A0 + cn Infinite\Health + 8027CFF5 00C8 + 8027CFF9 00C8 + cn Always Have\F-15J Eagle + 8027CCEC 0010 + cn Always Have\X-29A A.T.D. + 8027CCED 0020 + cn Infinite\99 Lives + 80348B98 0063 + +crc AEBE463E-CC71464B-C:45 +gn AEROGAUGE + cn No Damage\Player 1 + 50000402 0000 + 8113FFD8 0000 + cn No Damage\Player 2 + 50000402 0000 + 81142078 0000 + cn Unlock Hidden Tracks & Cars + 8008F29C 0001 + cn Freeze All Lap Timers + 8013FCA1 0001 + 8013FCA5 0001 + 8013FCA9 0001 + cn Freeze Overall Timer + cd All of the Freeze All Lap Timers must be on. These codes will Stop the others from racing against you in Grand Prix mode. To win a race in Grand Prix you must finish at least one lap in the qualify round, then complete all laps in race for first. + 8013FC95 0001 + cn Laps Of Race + 8013FC8E ???? 0001:"1 Lap",0002:"2 Laps",0003:"3 Laps",0004:"4 Laps",0005:"5 Laps",0006:"Never Ending Laps" + cn Play As\Player 1 + 8013FF95 ???? 0000:"N64 Control Pad",0001:"Interceptor",0002:"Hornet",0003:"Avenger",0004:"Shredder",0005:"Black Lightning",0006:"Vengeance",0007:"Prowler",0008:"Reaper",0009:"Dominator" + cn Play As\Player 2 + 8013FF96 ???? 0000:"N64 Control Pad",0001:"Interceptor",0002:"Hornet",0003:"Avenger",0004:"Shredder",0005:"Black Lightning",0006:"Vengeance",0007:"Prowler",0008:"Reaper",0009:"Dominator" + cn Level Select + 8013FF9B ???? 0000:"Canyon Rush",0001:"Bikini Island",0002:"China Town",0003:"Neo Arena",0004:"China Town Jam",0005:"Neo Speed Way" + cn Always 1st + 8013FCE0 0001 + cn Music Modifier + 80109BDC ???? 00FF:"Music On",0000:"Music Off" + +crc E6A95A4F-BAD2EA23-C:45 +gn Aidyn Chronicles - The First Mage (U) + cn Infinite\Max Health + 80278B98 001E + cn Infinite\99 Health Potions + cd Do Not put this cheat on until you have collected your 1st Health Potion from the 1st Cheat or you will not be able to get into the Sub menu and Continue the game. + 802785CB 0063 + cn Have\Max Gold + 50000401 0000 + 80277335 00FF + cn Have\Max Total XP + 50000401 0000 + 80278BAD 00FF + cn Have\Max Total XP Remaning to Start + cd This will give you 16777215 Total XP Remaning to start with and after your 1st batle will allow you to buy your Max Stats + 50000401 0000 + 80278BB1 00FF + +crc C43E23A7-40B1681A-C:45 +gn All-Star Baseball 99 (U) + cn Infinite\Character Creation Points + 800E2C31 00B0 + cn Infinite\Strikes + 800ABFB9 0000 + cn Infinite\Balls + 800ABFB7 0000 + cn Infinite\Outs + 800ABFBB 0000 + cn Max\Character Creation Accuracy + 810E2BF0 4170 + cn Max\Character Creation Clutch + 810E2BF4 4170 + cn Max\Character Creation Contact + 810E2BFC 4170 + cn Max\Character Creation Power + 810E2C00 4170 + cn Max\Character Creation VS. LHP + 810E2C04 4170 + cn Max\Character Creation VS. RHP + 810E2C08 4170 + cn Max\Character Creation Bunting + 810E2C0C 4170 + cn Max\Character Creation VS LHB + 810E2C10 4170 + cn Max\Character Creation VS RHB + 810E2C14 4170 + cn Max\Character Creation Speed + 810E2C18 4170 + cn Max\Character Creation Defense + 810E2C1C 4170 + cn Max\Character Creation Arm Strength + 810E2C20 4170 + cn Max\Character Creation Streak + 810E2C24 4170 + cn Max\Character Creation Clutch + 810E2C28 4170 + +crc 5E547A4D-90E60795-C:45 +gn All-Star Baseball 2000 (U) + cn Infinite\Strikes + 8006E4E1 0000 + cn Infinite\Balls + 8006E4DF 0000 + cn Infinite\Outs + 8006E4E3 0000 + cn Infinite\Character Creation Points + 81103350 4170 + cn Infinite\Pitch Type Creation Points + 811039BC 4170 + 811039C0 4170 + cn Character Creation\Max\Accuracy + 81115A20 4170 + cn Character Creation\Max\Stamina + 81115A24 4170 + cn Character Creation\Max\Contact + 81115A28 4170 + cn Character Creation\Max\Power + 81115A2C 4170 + cn Character Creation\Max\VS LHP + 81115A30 4170 + cn Character Creation\Max\VS RHP + 81115A34 4170 + cn Character Creation\Max\Bunting + 81115A38 4170 + cn Character Creation\Max\VS LHB + 81115A3C 4170 + cn Character Creation\Max\VS RHB + 81115A40 4170 + cn Character Creation\Max\Speed + 81115A44 4170 + cn Character Creation\Max\Defense + 81115A48 4170 + cn Character Creation\Max\Arm Str. + 81115A4C 4170 + cn Character Creation\Max\Streak + 81115A50 4170 + cn Character Creation\Max\Clutch + 81115A54 4170 + +crc E185E291-4E50766D-C:45 +gn All Star Tennis '99 (U) + cn Game Win Select\Player 1 + 801BBFA1 ???? 0000:"0 Games Won",0001:"1 Game Won",0002:"2 Games Won",0003:"3 Games Won",0004:"4 Games Won",0005:"5 Games Won",0006:"For Game Set & Match" + cn Game Win Select\Player 2 + 801BBFA2 ???? 0000:"0 Games Won",0001:"1 Game Won",0002:"2 Games Won",0003:"3 Games Won",0004:"4 Games Won",0005:"5 Games Won",0006:"For Game Set & Match" + cn Points Select\Player 1 + 801C7260 ???? 0000:"0 Points",0015:"15 Points",0030:"30 Points",0040:"40 Points" + cn Points Select\Player 2 + 801C7261 ???? 0000:"0 Points",0015:"15 Points",0030:"30 Points",0040:"40 Points" + cn Play As\Player 1 + 800BFFA5 ???? 0000:"Zoe Taylor",0001:"Vanessa Child",0002:"Amanda Coetzer",0003:"Jana Novotna",0004:"Conchita Martinez",0005:"Leon Rodez",0006:"Michael Chang",0007:"Gustavo Kuerten",0008:"Jonas Bjorkman",0009:"Mark Philippoussis",000A:"Randy Powell",000B:"Richard Krajicek" + cn Play As\Player 2 + 800BFFA6 ???? 0000:"Zoe Taylor",0001:"Vanessa Child",0002:"Amanda Coetzer",0003:"Jana Novotna",0004:"Conchita Martinez",0005:"Leon Rodez",0006:"Michael Chang",0007:"Gustavo Kuerten",0008:"Jonas Bjorkman",0009:"Mark Philippoussis",000A:"Randy Powell",000B:"Richard Krajicek" + +crc 4C52BBB2-CEAB0F6B-C:45 +gn Army Men - Air Combat (U) + cn Co-Pilot Modifier + 800B245C ???? 0000:"Lt. James Marshall \"Woodstock\"",0001:"Lt. John Lawless \"Hardcore\"",0002:"Lt. Dave Parker \"Rawhide\"",0003:"Lt. Felicity Wannamaker \"Bombshell\"",0004:"Sergeant Hawk \"Sarge\" (Hidden Character)" + cn Helicopter Modifier + 800B2534 ???? 0001:"Huey",0002:"Chinook (Hidden)",0003:"Super Stallion (Hidden)",0004:"Apache (Hidden)" + cn Always Play Level Modifier + 800B254C ???? 0000:"Mission 1-Plastic Pandemonium",0001:"Mission 2-Going Car-razy",0002:"Mission 3-The Train That Could",0003:"Mission 4-Tan Terror-Tory",0004:"Mission 5-Bug Bath",0005:"Mission 6-Uninvited Guests",0006:"Mission 7-Ants In The Pants",0007:"Mission 8-Saucer Attack",0008:"Mission 9-The Heat is On",0009:"Mission 10-The Melting Pot",000A:"Mission 11-River Rapids Riot",000B:"Mission 12-Nighttime Teddy",000C:"Mission 13-Demolition Time",000D:"Mission 14-Pick Up The Pieces",000E:"Mission 15-Have An Ice Day",000F:"Mission 16-Plastro's Revenge",0010:"Mission 17-Bug Hunt: Chew Chew Bug-B-Q",0011:"Mission 18-Bug Hunt: Crispy Critters",0012:"Mission 19-Flag-Nab-It: Fort Frenzy",0013:"Mission 20-Flag-Nab-it: Freezer Burn",0014:"Mission 21-Food Fight: Picnic Panic",0015:"Mission 22-Food Fight: Cherry Surprise",0016:"Mission 23-Rescue: Don't Feed The Crabs",0017:"Mission 24-Rescue: Tide Pool Terror" + cn Start On Play Level Modifier + D00B254C 0000 + 800B254C ???? 0000:"Mission 1-Plastic Pandemonium",0001:"Mission 2-Going Car-razy",0002:"Mission 3-The Train That Could",0003:"Mission 4-Tan Terror-Tory",0004:"Mission 5-Bug Bath",0005:"Mission 6-Uninvited Guests",0006:"Mission 7-Ants In The Pants",0007:"Mission 8-Saucer Attack",0008:"Mission 9-The Heat is On",0009:"Mission 10-The Melting Pot",000A:"Mission 11-River Rapids Riot",000B:"Mission 12-Nighttime Teddy",000C:"Mission 13-Demolition Time",000D:"Mission 14-Pick Up The Pieces",000E:"Mission 15-Have An Ice Day",000F:"Mission 16-Plastro's Revenge",0010:"Mission 17-Bug Hunt: Chew Chew Bug-B-Q",0011:"Mission 18-Bug Hunt: Crispy Critters",0012:"Mission 19-Flag-Nab-It: Fort Frenzy",0013:"Mission 20-Flag-Nab-it: Freezer Burn",0014:"Mission 21-Food Fight: Picnic Panic",0015:"Mission 22-Food Fight: Cherry Surprise",0016:"Mission 23-Rescue: Don't Feed The Crabs",0017:"Mission 24-Rescue: Tide Pool Terror" + cn Unlock All Planes + 810B252A 0105 + +crc 862C0657-8DFD896D-C:45 +gn Army Men - Sarge's Heroes (U) + cn Incendiary Bullets + 80054C94 0001 + cn All Weapons + 8115969E 0001 + cn Start With Max Ammo + 8115FCBE 0001 + cn Invincible + 8115FCEE 0001 + cn Infinite Continues + 81159692 0001 + cn Invisible + 81159682 0001 + cn Tin Solider + 811596A2 0001 + cn Maximum Visibility + 80070F52 0001 + cn Flamethrowers Fire In All Directions + 8006BD79 0020 + cn No Flamethrowers Will Work + 8006D69D 0001 + cn Multiplayer Cheats\Incendiary Bullets + 80054C81 0001 + cn Enemies Don't Recongnize You Easily + 8005742D 0001 + cn Play As + 811609A2 ???? 0007:"The Big Green One",0008:"Vikki",0009:"Plastro" + cn Play Level + 81163FFA 0001 + 8116403E ???? 88A0:"Spy Blue",88B4:"Bathroom",88C8:"Riff Mission",88E0:"Forest 81163FFA",88F0:"Hoover Mission",8908:"Thick Mission",8920:"Snow Mission",8938:"Shrap Mission",8950:"Fort Plastro",8968:"Scorch Mission",8980:"Showdown",8994:"Sandbox",89A4:"Kitchen",89B4:"Living Room",89C8:"The Way Home" + cn You Move Faster + 800ABD69 00FF + 800ABDA9 00FF + cn Press Start For Other Debug Info + 8115FCE2 0001 + cn Enemies Fight Themselves + 800585D8 0020 + cn No Enemies In Levels + 80056D4C 0020 + cn Less Enemies In Levels + 80056688 0020 + cn Enemies Can't Aim + 8006D14C 0020 + cn Enemies Have To Reload Their Guns + 8006D16A 0020 + cn Walls Off For Enemies When Hit + 800566D8 0020 + cn Bullets Only Damage At Extremely Short Range + 8006D15A 0020 + cn Improved Gun Handling + 8009C014 003E + cn Can't Fail Missions + 810A04FA ED40 + cn Everyone Has Dark Camoflauge On + 50000804 0000 + 81098F22 FAE4 + cn Flamethrower Has Air Buster Flame + 810A536A 5008 + 810A5372 5008 + cn Flamethrower Has Cloud Flame + 810A536A 5224 + 810A5372 5224 + cn Flamethrower Has Invisible Flame + 810A536A 52A0 + 810A5372 52A0 + cn Max Kills Multiplayer\Player 1 + 8033B9BC FFFF + cn Max Kills Multiplayer\Player 2 + 8033BB78 FFFF + +crc B20F73B6-2975FC34-C:45 +gn Army Men - Sarge's Heroes 2 (U) + cn Invincible + 8135C516 0600 + cn All Weapons & Ammo + 8115D06E 0001 + 8116368E 0001 + cn Max Ammo + 8116368E 0001 + cn Continues + 8115D062 0001 + cn Invisible + 8115D052 0001 + cn Test Info + 8115D3B6 0001 + cn Living Large + 811636AE 0001 + cn Mini Mode + 8115D06A 0001 + cn Play as + 81164372 ???? 0007:"Big Green One",0008:"Vikki",0009:"Plastro",000B:"Mystery Women",000C:"Hail Mendheimicus",000D:"Mini Soldier" + cn Enemies Fight Themselves + 8005EE9C 0020 + cn Move Faster + 800B9705 00FF + 800B9749 00FF + +crc 1FB5D932-3BA9481B-C:45 +gn Armorines - Project S.W.A.R.M. (U) + cn Enable In-Game Cheat Menu & Level Select + 81115936 014F + cn Infinite Lewis Laser Rifle + cd The infinite ammo will not work with these codes if you have the expansion pak inserted into your console. + 802E1D6F 0170 + cn Infinite Lewis Explosive Projectile Weapon + cd The infinite ammo will not work with these codes if you have the expansion pak inserted into your console. + 802E1D69 0030 + cn Infinite Jungle Chemical Gun + cd The infinite ammo will not work with these codes if you have the expansion pak inserted into your console. + 802E1D7B 0160 + cn Level Select + 81115932 0008 + cn Infinite Ammo (All Guns) + 810496D0 2400 + cn Don't Take Any Damage + 8104A260 2400 + cn Invincible + 81048CA0 2400 + cn Sound Modifier\Music Volume + 80115944 ???? 0000:"Off",003C:"Low (5)",0078:"Medium (1.0)",00BC:"Defualt (1.5)",00F0:"Max (2.0)" + cn Sound Modifier\SFX Volume + 80115945 ???? 0000:"Off",003C:"Low (5)",0078:"Medium (1.0)",00BC:"Defualt (1.5)",00F0:"Max (2.0)" + +crc D1F7D8AB-293B0446-C:45 +gn Asteroids Hyper 64 (U) + cn Extra Lives + 8007F90E 0063 + cn Extra Points + 8107F8FE FFFF + cn Infinite Armageddon + 8107F892 0001 + cn Infinite Items On Pickup + 8107F8A2 270F + cn Unlock Classic Asteroids + 8106DF5A 0001 + cn Infinite Lives (Classic Asteroids) + 8007F90F 002F + +crc 41B25DC4-1B726786-C:45 +gn Automobili Lamborghini (U) + cn Extra Vehicles + 50000302 0000 + 800985C3 0001 + 50000302 0000 + 800985CB 0001 + cn Max Points + 800CE743 FFFF + cn Infinite Time + 810CE76E 02F4 + cn Difficulty Modifier + 810CE7A4 ???? 0000:"Novice",0001:"Expert" + cn Speeds In Modifier + 800CE803 ???? 0000:"KM/H",0001:"MPH" + cn Always 1st Place + 810A5F70 0001 + +crc A4BF9306-BF0CDFD1-C:45 +gn Banjo-Kazooie + cn Infinite\Eggs + 80385F67 00FF + cn Infinite\Lives + 80385F8B 00FF + cn Infinite\Jiggies + 80385FCB 00FF + cn Press L To Levitate + cd Press L To Levitate & Let go to land + D0281251 0020 + 8137C4BC 43E0 + cn Infinite\Notes + cd Just collect one Note to Have 255 Notes in all Worlds. + 80385FF2 00FF + 80385F62 0001 + cn Infinite\Health + 80385F83 0008 + 80385F87 0008 + cn Infinite\Air + 81385F8E 0E10 + cn Infinite\Gold Feathers + 80385F73 00FF + cn Infinite\Red Feathers + 80385F6F 00FF + cn Infinite\Always Have All Jinjos + 80385F7B 00FF + cn Have Zero Time all Levels + 50000B04 0000 + 81386004 3000 + cn Character Select + cd When Mumbo transforms you hold:C-Up for the Termite,C-Right for the Pumpkin,C-Down for the Walrus,C-Left for the Crocc,R for the Bumble Bee,L for the Washing Machine,Press nothing to turn into Banjo + D0281251 0008 + 8037C2D3 0002 + D0281251 0001 + 8037C2D3 0003 + D0281251 0004 + 8037C2D3 0004 + D0281251 0002 + 8037C2D3 0005 + D0281251 0010 + 8037C2D3 0006 + D0281251 0020 + 8037C2D3 0007 + cn Infinite\Mumbo Tokens + 80385FC6 00FF + 80385FA2 00FF + cn Take Off And Fly From Anywhere + cd Press A Button. Do not use with Do Shock Spring Jump From Anywhere + 8037C1D1 0002 + cn Access All Moves + 8037C3A0 0001 + 8037C3A1 007F + 8037C3A2 00FF + 8037C3A3 00FF + cn Game 100% Complete + 8137C3A0 001F + 50000302 0000 + 8137C3A2 FFFF + 50000602 0000 + 813832C0 FFFF + 81383FCA 0064 + 81383FDC 0064 + 50000802 0000 + 813832F0 FFFF + 81385FA0 0063 + 81385FC4 0063 + 81385FF0 0064 + 50000602 0000 + 81385FF2 6464 + 50001002 0000 + 813831A8 FFFF + 813831B0 FF7F + 813831B2 FFB0 + 813831B4 3DA6 + 813831B6 F264 + 813831C6 FF7F + cn Secret Items + 81283400 ???? FFFF:"Have All Collected",0000:"Have None" + cn Do Shock Spring Jump From Anywhere + cd Press A Button. Do not use with Take Off And Fly From Anywhere + 8037C1D2 0002 + +crc C2E9AA9A-475D70AA-C:45 +gn Banjo-Tooie (U) + cn Infinite\Energy\Banjo and Kazooie + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 8011B069 0063 + 8111B644 0A0A + cn Infinite\Air + 8112B052 42C8 + cn Have\AllMoves + cd Press Top D-pad Up + D1081084 0800 + 8112C770 8029 + D1081084 0800 + 8112C772 0000 + 81290018 FFFF + 8129001A FFFF + 8129001C FFFF + 8129001E FFFF + cn Have Most of the Game Finished + cd Start a new game,when you appear in Spiral Mountain press Top D-Pad. Go to the menu and you will notice all eggs, all moves are available. All the jiggies have been collected. Simply Save and Restart. + 5000AC01 0000 + 80290000 00FF + 8029002B 007F + 80290063 00FB + 80290073 005F + D1081084 0800 + 8112C770 8029 + D1081084 0800 + 8112C772 0000 + cn Infinite\Energy\Snowball + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 8011B069 0063 + 8011B647 0005 + cn Infinite\Energy\Bee + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 8011B069 0063 + 8011B653 000A + 8011B654 000A + cn Infinite\Energy\Washing Machine + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 8011B069 0063 + 8111B656 0A0A + cn Infinite\Energy\Stony + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 8011B069 0063 + 8011B659 000A + 8011B65A 000A + cn Infinite\Energy\Banjo + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 8011B069 0063 + 8011B65F 000A + 8011B660 000A + cn Infinite\Energy\Kazooie + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 8011B069 0063 + 8111B662 0A0A + cn Infinite\Energy\Submarine + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 8011B069 0063 + 8011B665 000A + 8011B666 000A + cn Infinite\Energy\Mumbo + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 8011B069 0063 + 8111B668 0A0A + cn Infinite\Energy\Detonator + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 8011B069 0063 + 8111B66E 0A0A + cn Infinite\Energy\T-Rex Baby + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 8011B069 0063 + 8011B67F 000A + 8011B680 000A + cn Have\All Moves & Dragon Kazooie + cd Press Top D-pad,Do not use with either Have all Moves,Or Have Dragon Kazooie + D1081084 0800 + 8112C770 8029 + D1081084 0800 + 8112C772 0000 + 81290018 FFFF + 8129001A FFFF + 8129001C FFFF + 8129001E FFFF + 81290078 FFFF + 8129007A FFFF + cn Have\Dragon Kazooie + cd Press Top D-pad,Do not use with Have All Modes Or Have All Moves & Dragon Kazooie + D1081084 0800 + 8112C770 8029 + D1081084 0800 + 8112C772 0000 + 81290078 FFFF + 8129007A FFFF + cn Play As + cd To use this cheat, put the cheat on, then press L as you walk through a door to become that chosen character. Do not try to use the following character in Banjos house or anywhere as small or you will get stuck and wont be able to continue. Snowball Washing machine Submarine Golden Goliath Truck T-rex baby and T-rex daddy + D0081085 0020 + 8012704C ???? 0001:"Banjo and Kazooie",0002:"Snowball",0006:"Bee",0007:"Washing machine",0008:"Stony",000A:"Banjo",000B:"Kazooie",000C:"Submarine",000D:"Mumbo",000E:"Golden Goliath",000F:"Detonator",0010:"Truck",0012:"T-rex baby",0013:"T-rex daddy" + cn Instant Warp\Options\Spiral Mountain + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D0081084 0000 + 81127640 ???? 00AD:"Grunty's Old Lair",00AE:"Behind The Waterfall",00AF:"Top Of Castle",0173:"Banjo's house" + 80127643 0001 + cn Instant Warp\Options\Jinjo Village + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D0081084 0000 + 81127640 ???? 0142:"Jinjo Village",0144:"King Jingalings throne room",0143:"Bottles house",0145:"Green Jinjo's House",0146:"Black Jinjo's House",0147:"Yellow Jinjo's House",0148:"Blue Jinjo's House",014A:"Brown Jinjo's House",014B:"Orange Jinjo's House",014C:"Purple Jinjo's House",014D:"Red Jinjo's House",014E:"White Jinjo's House" + 80127643 0001 + cn Instant Warp\Options\Mayahem Temple + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D0081084 0000 + 81127640 ???? 00B6:"Humba's Wigwam",00B7:"Mumbo's skull",00B8:"The Temple",00B9:"Prison Compound",00BC:"Code chamber",00C4:"Jade Snake Grove",00C5:"Treasure Chamber",00C6:"Kickball Arena",0177:"Targitzan's Slighty Sacred Temple",0178:"Inside Targitzans Temple",0179:"Targitzan Temple Lobby",017A:"Targitzan's Temple Boss",017F:"Mayan Kickball Arena",0166:"Multi",0167:"Still",00C8:"Kickball Arena",00C9:"Kickball Arena" + 80127643 0001 + cn Instant Warp\Options\Glitter Gulch Mine + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D0081084 0000 + 81127640 ???? 00C7:"Mine",00CA:"Fuel depot",00CB:"Crushing shed",00CC:"Flooded caves",00CD:"Water storage",00CE:"Waterfall cavern",00CF:"Power hut basement",00D0:"Chuffy's cab",00D1:"Inside chuffy's boiler boss",00D2:"Gloomy caverns",00D3:"Generator caverns",00D4:"Power hut",00D5:"Wumba's wigwam",00D7:"Train station",00D8:"Prospectors hut",00D9:"Mumbo's hut",00DA:"Toxic gas cave",00DB:"Canary cave",00DC:"Ordnance storage",00E9:"Humba",0126:"Water supply pipe",0163:"Ordnance Storage entrance",0164:"Ordnance Storage game",0165:"Ordnance Storage game Multi",016F:"Testing",0170:"Testing",0171:"Mumbo's skull" + 80127643 0001 + cn Instant Warp\Options\Witchy World + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D0081084 0000 + 81127640 ???? 00D6:"Witcy World",00DD:"Dodgem dome lobby",00DE:"Dodgem challenge \"1 vs 1\"",00DF:"Dodgem challenge \"2 vs 1\"",00E0:"Dodgem challenge \"3 vs 1\"",00E1:"Crazy castle stockade",00E2:"Crazy castle lobby",00E3:"Crazy castle pump room",00E4:"Balloon burst game",00E5:"Hoop hurry game",00E6:"Star spinner",00E7:"The inferno",00EA:"Cave of horrors",00EB:"Haunted cavern",00EC:"Train station",0124:"Saucer of Peril",013B:"Crazy castle stockade \"sop\"",013C:"Star spinner \"sop\"",0176:"Mumbo's skull" + 80127643 0001 + cn Instant Warp\Options\Jolly Roger's Lagoon + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D0081084 0000 + 81127640 ???? 00ED:"Jolly's",00EE:"Pawno's emporium",00EF:"mumbo's skull",00F4:"Ancient Swimming Baths",00F6:"Electric Eels lair",00F7:"Seaweed Sanctum",00F8:"Inside the big fish",00FA:"temple of the fishes",01A8:"Atlantis",01A9:"Seabottom",0181:"sea bottom cavern",0182:"submarine multi",01A7:"Jolly Roger's Lagoon",00FF:"Blubber's wave race hire" + 80127643 0001 + cn Instant Warp\Options\Terrydacty Land + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D0081084 0000 + 81127640 ???? 0112:"Terrydacty Land",0113:"Terry's nest",0114:"Train station",0115:"Oogle boogles cave",0116:"Inside the mountain",0117:"River passage",0118:"Styracosaurus family cave",0119:"Unga bunga's cave",011A:"Stomping plains",011B:"Bonfire caverns",011E:"Humba's Wigwam",0123:"Inside chompa's belly",0183:"Chompa's belly multi" + 80127643 0001 + cn Instant Warp\Options\Grunty Industries + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D0081084 0000 + 81127640 ???? 0100:"Outside",0101:"Inside",0102:"Train station",0103:"Workers quarters",0104:"Trash compactor",0105:"Elevator shaft",0106:"Floor 2",0107:"Floor 2 \"electromagnet chamber\"",0108:"Floor 3",0109:"Floor 3 \"boiler plant\"",010A:"Floor 3 \"packing room\"",010B:"Floor 4",010C:"Floor 4 \"cable room\"",010D:"Floor 4 \"quality control\"",010E:"Floor 5",010F:"Basement",0110:"Basement \"repair depot",0111:"Basement \"waste disposal\"",0125:"Water supply pipe",0172:"Mumbo's skull",0162:"Floor 4 \"clinkers cavern\"",0187:"Sewer entrance" + 80127643 0001 + cn Instant Warp\Options\Hailfire Peaks + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D0081084 0000 + 81127640 ???? 0127:"Lava side",0128:"Icy side",0129:"Lava train station",012A:"Ice train station",012B:"Chilli billi",012C:"Chilly willy",012D:"Colosseum kickball stadium lobby",0131:"Boggy's igloo",0132:"Icicle grotto",0133:"Inside the volcano",0168:"Icy side still" + 80127643 0001 + cn Instant Warp\Options\Cloud Cuckoo Land + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D0081084 0000 + 81127640 ???? 0136:"Cloud Cuckoo Land 1",0137:"Inside the trashcan",0138:"Inside the cheesewedge",0139:"Zubba's nest",013A:"Central cavern",013D:"Inside the pot o gold",013E:"Mumbo's skull",013F:"Mingy jongo's skull",0140:"Humba wumba's wigwam",0161:"Cloud Cuckoo Land 2",0188:"Zubba's nest multi",0185:"Trash can mini" + 80127643 0001 + cn Instant Warp\Options\Isle O Hags + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D0081084 0000 + 81127640 ???? 014F:"Wooded Hollow",0150:"Heggy's egg shed",0151:"Jiggywiggy's temple",0152:"Plateau",0153:"Plateau \"Honey B's Hive\"",0154:"Pine Grove",0155:"Cliff top",0156:"Cliff top Mumbo's skull",015A:"wasteland",015B:"inside another digger tunnel",015C:"Quagmire" + 80127643 0001 + cn Instant Warp\Options\Cauldron Keep + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D0081084 0000 + 81127640 ???? 015D:"Cauldron Keep",015E:"The gatehouse",015F:"Tower of Tragedy Quiz",0160:"Gun chamber",016A:"Gun room still",017B:"Crazy Castle Stockade balloon burst multi",017C:"Crazy Castle Stockade Jump the hoops multi",017D:"Grunty Industries packing game",0180:"Colosseum kickball arena",0186:"Dodgems" + 80127643 0001 + cn Instant Warp\Options\Not sure + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D0081084 0000 + 81127640 ???? 00FC:"Lord woo fak fak",00F9:"Mr Patch",0121:"Inside Chuffy's wagon",0134:"Mumbo's Skull",0135:"Humba Wumba's wigwam 1",0157:"Humba Wumba's wigwam 2",019B:"Jingalings Zombified Palace",01A6:"Smuggler cavern",0141:"Inside the digger tunnel",0143:"Bottles house",0169:"Bottles house still",018A:"HAG Inside",019A:"HAG1 Final Boss" + 80127643 0001 + cn Monsters dont Hurt Banjo + 50002430 0000 + 80132EF5 0000 + 50002430 0000 + 80132EF6 0000 + 50002430 0000 + 80132EF7 0000 + 50002430 0000 + 80132EF8 0000 + 50002430 0000 + 80132EF9 0000 + cn Beta Bottles Revenge Mode + cd Bottles Revenge is a Beta mode from Banjo Tooie that the RWP team recently uncovered after an extraordinary amount of effort. Bottles the Spirit transforms into Bottles the Devil and posses enemies nearby and allows a second player hooked up to Pad 2 to play as that Posses character to try to foil Banjos Plans. As player one goes about its business, player two uses every enemy nearby to try to nab Banjo and take away some life. This mode is incredible, and you can control almost every enemy in the game: slot machines, flying creatures, uggers, zubbas...and this is just the beginning. (Congrats Rare Witch Project) + 8012B3F2 0001 + 800810C1 0002 + +crc 8C138BE0-95700E46-C:45 +gn In-Fisherman Bass Hunter 64 (U) + cn Catch Bigger Fish + 80111F06 0001 + cn Line Never Breaks + 80111F05 0001 + cn All Lakes Unlocked + 80111F00 0001 + cn Extra Cash + 80111F0B 0001 + cn Easier to Catch Fish + 80111F0E 0001 + cn No Penalties in Tounament + 80111F08 0001 + +crc BCFACCAA-B814D8EF-C:45 +gn Bassmasters 2000 (U) + cn Player 1 Max Score (Casting Game) + 8107A412 FFFF + cn Player 2 Max Score (Casting Game) + 8107A416 FFFF + +crc 204489C1-1286CF2B-C:45 +gn Batman Beyond - Return of the Joker (U) + cn Infinite\Infinite Health + 802086F2 0064 + cn Infinite\Infinite Lives + 802086F1 0063 + cn Infinite\Infinite Batarangs + 802086FE 0063 + cn Infinite\Max Charge & Magnetic Nun Chaku + 802086B9 0064 + +crc 6AA4DDE7-E3E2F4E7-C:45 +gn BattleTanx (U) + cn Have Storm Ravens Gang + 80135773 0001 + cn Run Story + 80135770 0001 + cn Start With All Weapons + 80135765 0001 + cn Toads + 80135776 0001 + cn Trippy + 80135771 0001 + cn Unlimited Ammo + 80135760 0001 + cn Frogs + 80135775 0001 + cn Have All Levels + 80135767 0001 + cn Hurl Mode + 8013576B 0001 + cn Invincible + 80135763 0001 + cn Invisible + 8013576A 0001 + cn Unlimited Lives + 80135772 0001 + cn Regenerated Allied Tanks Are Indestrucible In Campaign + 8009FB2A 0001 + cn Multiplayer\Player 1\Infinite Ammo + 802D8603 00FF + cn Multiplayer\Player 2\Infinite Ammo + 802D9F2B 00FF + cn Multiplayer\Player 1\Tank Turret Always On (Use Right/Left C Button) + 802DE7FB 0011 + 802DE7FF 0002 + cn Multiplayer\Player 2\Tank Turret Always On + 802DEB43 0011 + 802DEB47 0002 + cn Multiplayer\Player 3\Tank Turret Always On + 802DEE8B 0011 + 802DEE8F 0002 + cn Multiplayer\Player 4\Tank Turret Always On + 802DF1D3 0011 + 802DF1D7 0002 + cn Multiplayer\Player 1\Always Have Radar + 802D8195 0080 + cn Multiplayer\Player 2\Always Have Radar + 802D9ABD 0080 + cn Multiplayer\Player 1\Always Has Cloaked On + 802D818D 0001 + cn Multiplayer\Player 2\Always Has Cloaked On + 802D9AB5 0001 + cn Multiplayer\Player 1\Your Goalith Tank On Tracks Always Has Radar + 802D869D 0080 + cn Multiplayer\Player 2\Your Goalith Tank On Tracks Always Has Radar + 802D9FC5 0080 + cn Multiplayer\Player 1\Your Goalith Tank On Tracks Always Has Cloaked On + 802D8695 0001 + cn Multiplayer\Player 2\Your Goalith Tank On Tracks Always Has Cloaked On + 802D9FBD 0001 + cn Multiplayer\Plater 1\One Hit And You Bite It + 802D819F 0001 + cn MultiPlayer\Player 2\One Hit And You Bite It + 802D9AC7 0001 + cn Area 51\Shock Wave Weapons + 802D5A7D 00AF + cn Area 51\Mines Are Invisible + 802D5ACB 00CC + cn Area 51\Mines Are Toxic Waste + 802D5ACB 007C + cn Area 51\Turn Ammo Pickup Picture To Flamer Picture + 802D5AAF 00AC + cn Area 51\Turn Nuke Into Toxic Waste Nuke + 802D5A7B 007C + cn Multiplayer\Balltlelord Mode\Player 1\All Special Weapons & Infinite Ammo + 50000E02 0000 + 811AD7EE FFFF + cn Multiplayer\Balltlelord Mode\Player 2\All Special Weapons & Infinite Ammo + 50000E02 0000 + 811AE186 FFFF + cn Multiplayer\Balltlelord Mode\Player 3\All Special Weapons & Infinite Ammo + 50000E02 0000 + 811AEB1E FFFF + cn Multiplayer\Balltlelord Mode\Player 4\All Special Weapons & Infinite Ammo + 50000E02 0000 + 811AF4B6 FFFF + cn Multiplayer\Deathmatch, Frenzy & Convoy Modes\Player 1\All Special Weapons & Infinite Ammo + 50000E02 0000 + 811AD322 FFFF + cn Multiplayer\Deathmatch, Frenzy & Convoy Modes\Player 2\All Special Weapons & Infinite Ammo + 50000E02 0000 + 811ADCBA FFFF + cn Multiplayer\Deathmatch, Frenzy & Convoy Modes\Player 3\All Special Weapons & Infinite Ammo + 50000E02 0000 + 811AE652 FFFF + cn Multiplayer\Deathmatch, Frenzy & Convoy Modes\Player 4\All Special Weapons & Infinite Ammo + 50000E02 0000 + 811AEFEA FFFF + cn Multiplayer\Hold 'Em Mode\Player 1\All Special Weapons & Infinite Ammo + 50000E02 0000 + 811AD7EE FFFF + cn Multiplayer\Hold 'Em Mode\Player 2\All Special Weapons & Infinite Ammo + 50000E02 0000 + 811AE186 FFFF + cn Multiplayer\Hold 'Em Mode\Player 3\All Special Weapons & Infinite Ammo + 50000E02 0000 + 811AEB1E FFFF + cn Multiplayer\Hold 'Em Mode\Player 4\All Special Weapons & Infinite Ammo + 50000E02 0000 + 811AF4B6 FFFF + cn All Batteries Have Hellfire + 800A34A2 0001 + cn All Batteries Have Bad Aim + 800A1F7C 0001 + cn Buildings Implode Instead Of Explode, And Remain Afire + 8009298E 0001 + cn Shoot Through Walls + 8008E529 0001 + cn All Battletanx Are Invincible + 8009843D 0001 + cn Can't Pick Up Queen Lords + 8008A2F0 0001 + cn Auto Win All Queen Lord Levels + 800A6745 0001 + cn Auto Lose All Queen Lord Levels + 800A6746 0001 + cn Slow Battle Tanks + 8009A56A 0001 + cn Buildings Fall Fast + 80091BBC 0001 + cn Nuke Blast Leaves Air Yellow + 800F3333 0001 + cn Nuke Blast Pink + 8008055F 0001 + cn Laser Fire Invisible + 800846ED 0001 + cn Full Control Of Tank In Bonus,Extra Side Player In Battlelord Multi! + 800971EE 0001 + cn Multiplayer\Balltlelord Mode\Player 1\Infinite Secondary Weapons In Battlelord + 802D8609 00FF + 802D860B 00FF + 802D860D 00FF + 802D860F 00FF + 802D8611 00FF + 802D8615 00FF + 802D8617 00FF + 802D8619 00FF + 802D861B 00FF + 802D861D 00FF + 802D861F 00FF + 802D8621 00FF + cn Multiplayer\Balltlelord Mode\Player 2\Infinite Secondary Weapons In Battlelord + 802D9F31 00FF + 802D9F33 00FF + 802D9F35 00FF + 802D9F37 00FF + 802D9F39 00FF + 802D9F3D 00FF + 802D9F3F 00FF + 802D9F41 00FF + 802D9F43 00FF + 802D9F45 00FF + 802D9F47 00FF + 802D9F49 00FF + cn In Campaign 3 Enemy Tanks May Join You + 802D9AAC 0000 + 802DB3D4 0000 + 802DCCFC 0000 + cn Multiplayer\Player 1\Main Weapon + 802D85EB ???? 0000:"Nothing",0001:"Normal Tank Shells",0002:"Motor Tank Shells",0003:"Big Tank Shells",0004:"Rockets",0005:"Laser",0006:"Nuke",0007:"Gernades",0008:"?",0009:"?",000A:"Nuclear Lasers",000B:"Remote Rockets",000C:"Mines",000D:"Gun Buddies",000E:"Smoke Screen",000F:"Cloaking",0010:"Health" + cn Multiplayer\Player 2\Main Weapon + 802D9F13 ???? 0000:"Nothing",0001:"Normal Tank Shells",0002:"Motor Tank Shells",0003:"Big Tank Shells",0004:"Rockets",0005:"Laser",0006:"Nuke",0007:"Gernades",0008:"?",0009:"?",000A:"Nuclear Lasers",000B:"Remote Rockets",000C:"Mines",000D:"Gun Buddies",000E:"Smoke Screen",000F:"Cloaking",0010:"Health" + cn Multiplayer\Player 1\Secondary Weapon + 802D85F7 ???? 0000:"Nothing",0001:"Normal Tank Shells",0002:"Motor Tank Shells",0003:"Big Tank Shells",0004:"Rockets",0005:"Laser",0006:"Nuke",0007:"Gernades",0008:"?",0009:"?",000A:"Nuclear Lasers",000B:"Remote Rockets",000C:"Mines",000D:"Gun Buddies",000E:"Smoke Screen",000F:"Cloaking",0010:"Health" + cn Multiplayer\Player 2\Secondary Weapon + 802D9F1F ???? 0000:"Nothing",0001:"Normal Tank Shells",0002:"Motor Tank Shells",0003:"Big Tank Shells",0004:"Rockets",0005:"Laser",0006:"Nuke",0007:"Gernades",0008:"?",0009:"?",000A:"Nuclear Lasers",000B:"Remote Rockets",000C:"Mines",000D:"Gun Buddies",000E:"Smoke Screen",000F:"Cloaking",0010:"Health" + cn Multiplayer\Player 1\Tank Body Modifier + 802D819B ???? 0000:"Normal Tank",0001:"Motor Tank",0002:"Big Tank" + cn Multiplayer\Player 2\Tank Body Modifier + 802D9AC3 ???? 0000:"Normal Tank",0001:"Motor Tank",0002:"Big Tank" + cn Multiplayer\Player 1\Goalith Tank On Tracks Body Modifier + 802D86A3 ???? 0000:"Normal Tank",0001:"Motor Tank",0002:"Big Tank" + cn Multiplayer\Player 2\Goalith Tank On Tracks Body Modifier + 802D9FCB ???? 0000:"Normal Tank",0001:"Motor Tank",0002:"Big Tank" + +crc 75A4E247-6008963D-C:45 +gn BattleTanx - Global Assault (U) + cn Rapid Fire + 8008E7F0 0001 + cn Edge Hits Everything + 80071AF0 0043 + cn Mini-Tanks 1 + 80125AB8 0001 + cn Mini-Tanks 2 + 80125AB9 0001 + cn Mini-Tanks 3 + 80125AB9 0001 + cn Mini-Tanks 4 + 80125ABB 0001 + cn Mini-Tanks 5 + 80125ABC 0001 + cn Infinite Tank Bucks + 80236A9F 0064 + cn Level Select + 80117F49 0001 + cn Invulnerability + 80125AB0 0001 + cn Start With All Weapons + 80125AB1 0001 + cn Secret Level + 80125AB2 0001 + cn Enable Models + 80125AB3 0001 + cn Cassandra Gang + 80125AB5 0001 + cn Brandon Gang + 80125AB6 0001 + +crc 55D4C4CE-7753C78A-C:45 +gn Battlezone - Rise of the Black Dogs (U) + cn Infinite\Weapons + 811DF6EA 04B0 + cn Infinite\Ship Health + 811DF6DE 0BA9 + cn Infinite\Shots For Sniper Rifle + 811DA682 0003 + cn Have\All\Levels Unlocked & Completed For Americans + 8006A1F0 0011 + cn Have\All\Levels Unlocked & Completed For Soviets + 8006A1F1 0008 + cn Have\All\Levels Unlocked & Completed For Black Dogs + 8006A1F3 000A + cn Have\All\Missions Open And Complete For Americans + 8006A1EC 0011 + cn Have\All\Missions Open And Complete For Soviets + 8006A1ED 0008 + cn Have\All\Missions Open And Complete For Black Dogs + 8006A1EF 000A + cn Infinite\Scrap Collected + 811FBCC6 FFFF + cn Max\Scrap Limit + 811FBCCA FFFF + cn Infinite\Pilots + 811FBCCE FFFF + cn Max\Pilot Limits + 811FBCD2 FFFF + cn Infinite\Armor + 8006A1C2 0001 + cn Infinite\Ammo + 8006A1C1 0001 + cn Level Select + 8006A1F5 0001 + cn Add\Building + 8006A1C0 0001 + cn Add\Satellite + 8006A1C3 0001 + +crc 4D79D316-E8501B33-C:45 +gn Beast Wars Transmetal (U) + cn Infinite\Health\Player 1 + 8112CD46 270F + cn Infinite\Stun Meter\Player 1 + 8012CD49 00FF + cn Infinite\Health\Player 2 + 8114D2C6 270F + cn Infinite\Stun Meter\Player 2 + 8014D2C9 00FF + cn Play As\Player 1 + 801BE2A4 ???? 0000:"Optimus Primal",0001:"Rattrap",0002:"Cheetor",0003:"Airazor",0004:"Megatron",0005:"Tarantulas",0006:"Waspinator",0007:"Terrorsaur" + cn Play As\Player 2 + 801BE2A5 ???? 0000:"Optimus Primal",0001:"Rattrap",0002:"Cheetor",0003:"Airazor",0004:"Megatron",0005:"Tarantulas",0006:"Waspinator",0007:"Terrorsaur" + cn Choose Stage\VS. Mode + 800ED6CF ???? 0000:"Stage 1",0001:"Stage 2",0002:"Stage 3",0003:"Stage 4",0004:"Stage 5",0005:"Stage 6",0006:"Stage 7",0007:"Stage 8 (Hidden Stage)",0008:"Stage 9 (Hidden Stage)",0009:"Stage A (Hidden Stage)" + cn Infinite\Time + 80102A94 000A + cn Bonus Menu Games\Infinite Time\Escape Race 100 & 200\Player 1 + 811BD3B6 000A + cn Bonus Menu Games\Infinite Time\Escape Race 100 & 200\Player 2 + 811BD3BA 000A + cn Bonus Menu Games\Max\Wins\Sunset & Sunrise Showdown\Player 1 + 801BC25F 00FF + cn Bonus Menu Games\Max\Points\Disc Hunter\Player 1 + 801BD3E9 00FF + cn Bonus Menu Games\Max\Points\Disc Hunter\Player 2 + 801BD3EB 00FF + +crc EDF419A8-BF1904CC-C:45 +gn Beetle Adventure Racing! (U) + cn Have\All Cars + 8002CFF7 000B + cn Have\All Tracks + 8002CFF3 0006 + cn Low Timer + 81025DD4 3F40 + cn Open All Difficulties + 8002CFFB 0003 + cn Infinite Continues + 8002CC57 0005 + cn Always Place 1st + 81025DD4 1110 + 81025DDC 3F40 + cn Multi-Player Unlock All Levels + 50000901 0000 + 8002D000 0001 + +crc 08FFA4B7-01F453B6-C:45 +gn Big Mountain 2000 (U) + cn Always 1st/Low Time + 81350C02 0000 + 80350C17 0063 + cn Infinite Stamina + 8034F798 0012 + cn Free Ride Complete\Stage 1-Skier + 800B3578 0001 + cn Slalom Complete\Stage 1-Skier + 800B357C 0001 + cn Giant Slalom Complete\Stage 1-Skier + 800B3580 0001 + cn Free Ride Complete\Stage 2-Skier + 800B3584 0001 + cn Slalom Complete\Stage 2-Skier + 800B3588 0001 + cn Giant Slalom Complete\Stage 2-Skier + 800B358C 0001 + cn Free Ride Complete\Stage 3-Skier + 800B3590 0001 + cn Slalom Complete\Stage 3-Skier + 800B3594 0001 + cn Giant Slalom Complete\Stage 3-Skier + 800B3598 0001 + cn Free Ride Complete\Stage 4-Skier + 800B359C 0001 + cn Slalom Complete\Stage 4-Skier + 800B35A0 0001 + cn Giant Slalom Complete\Stage 4-Skier + 800B35A4 0001 + cn Free Ride Complete\Stage 1-Boarder + 800B357A 0001 + cn Slalom Complete\Stage 1-Boarder + 800B357E 0001 + cn Giant Slalom Complete\Stage 1-Boarder + 800B3582 0001 + cn Free Ride Complete\Stage 2-Boarder + 800B3586 0001 + cn Slalom Complete\Stage 2-Boarder + 800B358A 0001 + cn Giant Slalom Complete\Stage 2-Boarder + 800B358E 0001 + cn Free Ride Complete\Stage 3-Boarder + 800B3592 0001 + cn Slalom Complete\Stage 3-Boarder + 800B3596 0001 + cn Giant Slalom Complete\Stage 3-Boarder + 800B359A 0001 + cn Free Ride Complete\Stage 4-Boarder + 800B359E 0001 + cn Slalom Complete\Stage 4-Boarder + 800B35A2 0001 + cn Giant Slalom Complete\Stage 4-Boarder + 800B35A6 0001 + cn All Boards Complete + 50001802 0000 + 810B3578 0001 + +crc 08123595-0510F1DE-C:45 +gn Bio F.R.E.A.K.S. (U) + cn Never Wins\Player 1 + 8015029B 0000 + cn Needs 1 Match to Win\Player 1 + D015029B 0000 + 8015029B 0001 + cn Infinite Health\Player 1 + 811502AA 6400 + cn 1-Hit Death\Player 1 + D01502AA 0064 + 811502AA 0100 + cn Infinite Shield\Player 1 + 811502AE 6400 + cn Infinite Jetpack\Player 1 + 811502B2 3200 + cn Play As\Player 1 + 801ABB2B ???? 000A:"She-Freak",000B:"PainMaster",000C:"Mutilator",000D:"ChainSaw" + cn Never Wins\Player 2 + 80152917 0000 + cn Needs 1 Match to Win\Player 2 + D0152917 0000 + 80152917 0001 + cn Infinite Health\Player 2 + 811502AA 6400 + cn 1-Hit Death\Player 2 + D0152926 0064 + 81152926 0100 + cn Infinite Shield\Player 2 + 8115292A 6400 + cn Infinite Jetpack\Player 2 + 8115292E 3200 + +crc 7C647C25-D9D901E6-C:45 +gn Blast Corps (U) (V1.0) + cn Infinite\Hydraulics Sidesweeper + 803EDB51 0063 + cn Infinite\Missiles Motor Bike + 803F8AC3 0063 + cn Infinite\Boosts Buggy Vehicle + 803EE301 0064 + cn Ballista Can Drive Through Anything + 803F8A68 0001 + cn Found All\RDUS + 8036E9CC C350 + cn Found All\Survivors + 8036E9C9 00FF + cn Found All\Scientists + 80364AD0 003F + cn Infinite Time + D0315610 0000 + 81315610 0000 + D0315612 0001 + 81315612 0000 + +crc 7C647E65-1948D305-C:45 +gn Blast Corps (U) (V1.1) + cn Infinite\Hydraulics Sidesweeper + 803EDC00 0063 + cn Infinite\Missiles Motor Bike + 803F8B72 0063 + cn Infinite\Boosts Buggy Vehicle + 803EE3B0 0064 + cn Ballista Can Drive Through Anything + 803F8B17 0001 + cn Found All\RDUS + 8036EA7C C350 + cn Found All\Survivors + 8036EA70 00FF + cn Found All\Scientists + 80364B80 003F + cn Infinite Time + D03156C0 0000 + 813156C0 0000 + D03156C2 0001 + 813156C2 0000 + +crc 7CD08B12-1153FF89-C:45 +gn Blues Brothers 2000 (U) + cn Have All\Keys + cd This will give you the Grey & Red,Green & Gold Keys + 800BD0B8 00FF + 800BD0BE 00FF + 800BD0BD 00FF + cn Have All\Music Notes + cd This will give you all 10 Music Notes + 50000A01 0000 + 800BD1F0 0001 + cn Infinite\Lives + 800BD0E3 0009 + cn Infinite\Health + 800BD0F7 0002 + cn Press L to Levitate + cd Press L to levitate & let go to come back down + D017DBC5 0020 + 810DAFD8 44CB + cn Max Money + 810BD0E6 03E7 + cn Can Walk When The Game Is Paused + 810AB9B6 0001 + +crc 5326696F-FE9A99C3-C:45 +gn Body Harvest (U) + cn Infinite\Greece + 81052B18 0098 + 81052B1A 967F + cn Infinite\Health + 810DDCEC 0258 + cn No Humans Killed + 8104816A 0000 + cn Have Alien Artifact + 8004DC5F 0001 + cn Item Modifier + 8004DC4F ???? 0000:"Nothing",0002:"Howitzer Shells",0040:"Crank",0080:"Windmill Cog",0100:"Heirglyph Map Piece",0400:"Hangar Key",FFFF:"All Items" + cn Weapon Select\1st Position + 80048138 ???? 0000:"Nothing",0001:"Fuel",0002:"Pistol",0003:"Shotgun",0004:"Rifle",0005:"Machine Gun",0006:"Rocket Launcher",0007:"TNT",0008:"Sun Shield",0009:"Grenades",000A:"Tri-Spinner",000B:"Vehicle Weapon 1",000C:"Vehicle Weapon 2",000D:"Arme 2",000E:"Waffe 2",0010:"Fragcannon",0011:"Lazer Missiles",0012:"Resonator",0013:"Plasma Bombs" + cn Weapon Select\2nd Position + 80048139 ???? 0000:"Nothing",0001:"Fuel",0002:"Pistol",0003:"Shotgun",0004:"Rifle",0005:"Machine Gun",0006:"Rocket Launcher",0007:"TNT",0008:"Sun Shield",0009:"Grenades",000A:"Tri-Spinner",000B:"Vehicle Weapon 1",000C:"Vehicle Weapon 2",000D:"Arme 2",000E:"Waffe 2",0010:"Fragcannon",0011:"Lazer Missiles",0012:"Resonator",0013:"Plasma Bombs" + cn Weapon Select\3rd Position + 8004813A ???? 0000:"Nothing",0001:"Fuel",0002:"Pistol",0003:"Shotgun",0004:"Rifle",0005:"Machine Gun",0006:"Rocket Launcher",0007:"TNT",0008:"Sun Shield",0009:"Grenades",000A:"Tri-Spinner",000B:"Vehicle Weapon 1",000C:"Vehicle Weapon 2",000D:"Arme 2",000E:"Waffe 2",0010:"Fragcannon",0011:"Lazer Missiles",0012:"Resonator",0013:"Plasma Bombs" + cn Weapon Select\4th Position + 8004813B ???? 0000:"Nothing",0001:"Fuel",0002:"Pistol",0003:"Shotgun",0004:"Rifle",0005:"Machine Gun",0006:"Rocket Launcher",0007:"TNT",0008:"Sun Shield",0009:"Grenades",000A:"Tri-Spinner",000B:"Vehicle Weapon 1",000C:"Vehicle Weapon 2",000D:"Arme 2",000E:"Waffe 2",0010:"Fragcannon",0011:"Lazer Missiles",0012:"Resonator",0013:"Plasma Bombs" + cn Weapon Select\5th Position + 8004813C ???? 0000:"Nothing",0001:"Fuel",0002:"Pistol",0003:"Shotgun",0004:"Rifle",0005:"Machine Gun",0006:"Rocket Launcher",0007:"TNT",0008:"Sun Shield",0009:"Grenades",000A:"Tri-Spinner",000B:"Vehicle Weapon 1",000C:"Vehicle Weapon 2",000D:"Arme 2",000E:"Waffe 2",0010:"Fragcannon",0011:"Lazer Missiles",0012:"Resonator",0013:"Plasma Bombs" + cn Weapon Select\6th Position + 8004813D ???? 0000:"Nothing",0001:"Fuel",0002:"Pistol",0003:"Shotgun",0004:"Rifle",0005:"Machine Gun",0006:"Rocket Launcher",0007:"TNT",0008:"Sun Shield",0009:"Grenades",000A:"Tri-Spinner",000B:"Vehicle Weapon 1",000C:"Vehicle Weapon 2",000D:"Arme 2",000E:"Waffe 2",0010:"Fragcannon",0011:"Lazer Missiles",0012:"Resonator",0013:"Plasma Bombs" + cn Weapon Select\7th Position + 8004813E ???? 0000:"Nothing",0001:"Fuel",0002:"Pistol",0003:"Shotgun",0004:"Rifle",0005:"Machine Gun",0006:"Rocket Launcher",0007:"TNT",0008:"Sun Shield",0009:"Grenades",000A:"Tri-Spinner",000B:"Vehicle Weapon 1",000C:"Vehicle Weapon 2",000D:"Arme 2",000E:"Waffe 2",0010:"Fragcannon",0011:"Lazer Missiles",0012:"Resonator",0013:"Plasma Bombs" + cn Weapon Select\8th Position + 8004813F ???? 0000:"Nothing",0001:"Fuel",0002:"Pistol",0003:"Shotgun",0004:"Rifle",0005:"Machine Gun",0006:"Rocket Launcher",0007:"TNT",0008:"Sun Shield",0009:"Grenades",000A:"Tri-Spinner",000B:"Vehicle Weapon 1",000C:"Vehicle Weapon 2",000D:"Arme 2",000E:"Waffe 2",0010:"Fragcannon",0011:"Lazer Missiles",0012:"Resonator",0013:"Plasma Bombs" + cn Infinite Ammo All Weapons + 50001102 0000 + 81048146 8000 + cn Level Select + 80047F93 ???? 0001:"Greece",0002:"Java",0003:"America",0004:"Siberia",0005:"Comet" + cn Press L To Wall Over Water, Climb Hills + D00475D9 0020 + 8104DCD2 0808 + +crc F568D51E-7E49BA1E-C:45 +gn Bomberman 64 (U) + cn Invincible\Player 1 + 800AEE01 0001 + cn Have\Pumped up Red Remote Bombs + 802AC653 0004 + cn Infinite\Lives + 802AC627 0063 + cn Infinite\Gems + 802AC62F 0063 + cn Infinite\Credits + 802AC62B 0009 + cn Infinite\Time + 802AC643 0001 + cn Carry 20 Bombs At A Time + 800AEE0F 0014 + cn Infinite\Energy\Player 1 + 800AEE07 0002 + cn Infinite\Energy\Player 2 + 800AEECF 0002 + cn Infinite\Energy\Player 3 + 800AEF97 0002 + cn Infinite\Energy\Player 4 + 800AF05F 0002 + +crc 237E73B4-D63B6B37-C:45 +gn Bomberman 64 - The Second Attack! (U) + cn Infinite\Money + 810ABD52 FFFF + cn Infinite\Bombs + 800AD758 0003 + cn Have\Max Fire Level + 800AD733 0003 + cn Infinite\Health + 800AD75F 0005 + cn Infinite\Continue Time + 810B5CD6 0090 + cn Have\Fire Bombs + 800AD73B 0003 + cn Have\Kick Bombs Anytime + 800AC743 0003 + cn Flashing Invincible + cd This cheat Makes you Flash But you cant be harmed,Once out of danger Turn the cheat off to stop the flashing.also do not put this on if you have already been hurt or you will stay on the floor. + 800AD767 000A + +crc 4446FDD6-E3788208-C:45 +gn Bomberman Hero (U) + cn Full\Bomb Power + 8016523F 0003 + cn Full\Fire Power + 80165240 0003 + cn Infinite\Health + 80165244 0004 + cn Infinite\Lives + 80165243 0009 + cn Extra Gems + D0165241 0000 + 80165241 004B + cn Max\Bombs + 8016523F 0008 + cn Press L to Levitate + cd Press L to levitate & let go to come back down + D005A455 0020 + 81154178 41CB + D005A455 0020 + D0154154 0000 + 80154154 0040 + cn Max\Score + 80177608 FFFF + cn Max\Explosion + 80165240 0008 + +crc 85AE781A-C756F05D-C:45 +gn Buck Bumble (U) + cn Have All\Guns & Infinite Ammo + cd Press C Left to receive all Guns + 810FFF8A 0001 + 50000B04 0000 + 810E92E6 03E8 + cn Infinite\Health + cd If you fall into Water just turn off the Infinite Health & put back on after. + 810E92D8 42D8 + cn Infinite\99 Lives + 810E9650 0005 + cn Have All\Keys + 810E92E0 0101 + 800E92E2 0001 + cn Max Bonus + 810E964A 270F + cn Level Select + 810FFF92 ???? 0001:"Mission 1 Shock Strike",0002:"Mission 2 Radar Run",0003:"Mission 3 Return Fire",0004:"Mission 4 The Sonar Tower",0005:"Mission 5 Big Blips",0006:"Mission 6 Short Fuse",0007:"Mission 7 Outpost",0008:"Mission 8 Sewer",0009:"Mission 9 Clean Up",000A:"Mission 10 Scramble Pylon",000B:"Mission 11 Herding Research",000C:"Mission 12 The Extractor",000D:"Mission 13 Nuke Tower",000E:"Mission 14 Mucus Storage",000F:"Mission 15 Depot Attack",0010:"Boss Mission Destroy Carrier Level",0011:"Mission 16 Sterilization",0012:"Mission 17 Scorpion Killer",0013:"Mission 18 Core Nuke",0014:"Mission 19 Gate Keeper",0015:"Queen Mission" + +crc 4222D89F-AFE0B637-C:45 +gn Bust A Move '99 (U) + cn Ceiling Never Drops\Player 1 + 810ECDEE 0000 + cn Ceiling Never Drops\Player 2 + 810ECEDE 0000 + cn Ceiling Never Drops\Player 3 + 81158846 0000 + cn Ceiling Never Drops\Player 4 + 81158974 0000 + cn Infinite Time To Set Pieces\Player 1 + 810ECE2C 0000 + cn Infinite Time To Set Pieces\Player 2 + 810ECF1C 0000 + cn Infinite Time To Set Pieces\Player 3 + 81158884 0000 + cn Infinite Time To Set Pieces\Player 4 + 81158936 0000 + cn Always Gets Bubbles\Player 1 + 800ECE59 0007 + cn Never Gets Bubbles\Player 1 + 800ECE59 0000 + cn Always Gets Bubbles\Player 2 + 800ECF49 0007 + cn Never Gets Bubbles\Player 2 + 800ECF49 0000 + cn Always Gets Bubbles\Player 3 + 801588B1 0007 + cn Never Gets Bubbles\Player 3 + 801588B1 0000 + cn Always Gets Bubbles\Player 4 + 801589A1 0007 + cn Never Gets Bubbles\Player 4 + 801589A1 0000 + +crc 8A86F073-CD45E54B-C:45 +gn Bust-A-Move 2 - Arcade Edition (U) + cn Infinite Credits + 80120171 0005 + cn Player 1\Always Gets Bubbles + 80171131 0006 + cn Player 1\Never Gets Bubbles + 80171131 0000 + cn Computer\Always Gets Bubbles + 80173601 0006 + cn Computer\Never Gets Bubbles + 80173601 0000 + cn Player 1\Infinite Time To Set Pieces + 8117AAFC 0000 + cn Player 1\Screen Never Fills Over Time + 80171125 000A + +crc AC16400E-CF5D071A-C:45 +gn California Speed (U) + cn Always Place 1st + 80151C01 0000 + cn Have All\Tracks + 81168F8C FFFF + cn Have All\Cars + 50001504 0000 + 800AAE5B 0001 + +crc F35D5F95-8AFE3D69-C:45 +gn Castlevania (U) (V1.0) + cn Infinite\Health + 81389C3E 0064 + cn Infinite\Throwing Weapon + 81389C48 0064 + cn Throwing Weapon Modifier + 81389C42 ???? 0000:"Nothing",0001:"Knives",0002:"Exploding Potions",0003:"Cross",0004:"Axes" + cn Press L To Levitate + D0387D7F 0020 + 81350810 3FCB + cn Have\All Items + 50000501 0000 + 80389C4A 0001 + 50000301 0000 + 80389C51 0001 + 80389C5A 0001 + 80389C5B 0001 + 80389C5D 0001 + 50000E01 0000 + 80389C60 0001 + cn Have\Invincibility + 80342BFE 000B + cn Infinite\Red Jewels + 80389C49 0063 + cn Status + 80389C88 ???? 0001:"Good",0008:"Vamp",0011:"Poison",0022:"Good but depressed",0066:"Sto",001F:"V+P" + cn Open All Doors and Gates,No Bosses + 50002A02 0000 + 81389BD0 FFFF + cn Infinite\Energy + 80389C3F 0064 + cn Infinite\Funds + 80389C45 0001 + 81389C46 869F + cn Have\Exp Points + 80389C49 0063 + cn Max Power Up + 80389CED 0002 + cn Never Get Poisoned + 81389C88 0000 + cn Level Select + cd You must use this code on a saved game, because the intro to the first level will mess up the game. Now select the saved game, and hold down the GS button until the level loads. Some of the boss stages will not let you fight the boss unless you re-enter the area. Also, with the part of stage modifier, the second code modifies the part of the level that you are in, and 0000 is the level's start. + 89389C90 ???? 0000:"Forest of Silence",0002:"Castle Wall",0003:"Villa",0004:"Inside Villa",0006:"Garden Maze",0007:"Tunnel",0008:"Underground Waterway",0009:"Castle Center",0010:"Tower of Execution",0011:"- Tower of Sorcery",0012:"- Tower of Science",0013:"- Duel Tower",0014:"- Fight With Death/Actrise",0015:"- Castle Keep",0016:"- Intro (Glitch)",0017:"- Clock Tower",0018:"- Final Dracula",001A:"- Fight With Maze Boss",001B:"- Room of Clocks",001C:"- ??",001D:"- ??" + 89389C92 0000 + cn Switch From + cd This Switch From Cheat lets you switch characters on a saved game For example, if you are Reindhart and you want to be Carrie in the middle of your game save it and then enable this Cheat and press F1. when you start your saved game back up you'll be Carrie instead of Reindhart. + 80389C3D ???? 0000:"Carrie to Reindhart",0001:"Reindhart to Carrie" + +crc 4BCDFF47-AAA3AF8F-C:45 +gn Castlevania (U) (V1.1) + cn Infinite\Health + 81389C3E 0064 + cn Infinite\Throwing Weapon + 81389C48 0064 + cn Throwing Weapon Modifier + 81389C42 ???? 0000:"Nothing",0001:"Knives",0002:"Exploding Potions",0003:"Cross",0004:"Axes" + cn Press L To Levitate + D0387D7F 0020 + 81350810 3FCB + cn Have\All Items + 50000501 0000 + 80389C4A 0001 + 50000301 0000 + 80389C51 0001 + 80389C5A 0001 + 80389C5B 0001 + 80389C5D 0001 + 50000E01 0000 + 80389C60 0001 + cn Have\Invincibility + 80342BFE 000B + cn Infinite\Red Jewels + 80389C49 0063 + cn Status + 80389C88 ???? 0001:"Good",0008:"Vamp",0011:"Poison",0022:"Good but depressed",0066:"Sto",001F:"V+P" + cn Open All Doors and Gates,No Bosses + 50002A02 0000 + 81389BD0 FFFF + cn Infinite\Energy + 80389C3F 0064 + cn Infinite\Funds + 80389C45 0001 + 81389C46 869F + cn Have\Exp Points + 80389C49 0063 + cn Max Power Up + 80389CED 0002 + cn Never Get Poisoned + 81389C88 0000 + cn Level Select + cd You must use this code on a saved game, because the intro to the first level will mess up the game. Now select the saved game, and hold down the GS button until the level loads. Some of the boss stages will not let you fight the boss unless you re-enter the area. Also, with the part of stage modifier, the second code modifies the part of the level that you are in, and 0000 is the level's start. + 89389C90 ???? 0000:"Forest of Silence",0002:"Castle Wall",0003:"Villa",0004:"Inside Villa",0006:"Garden Maze",0007:"Tunnel",0008:"Underground Waterway",0009:"Castle Center",0010:"Tower of Execution",0011:"- Tower of Sorcery",0012:"- Tower of Science",0013:"- Duel Tower",0014:"- Fight With Death/Actrise",0015:"- Castle Keep",0016:"- Intro (Glitch)",0017:"- Clock Tower",0018:"- Final Dracula",001A:"- Fight With Maze Boss",001B:"- Room of Clocks",001C:"- ??",001D:"- ??" + 89389C92 0000 + cn Switch From + cd This Switch From Cheat lets you switch characters on a saved game For example, if you are Reindhart and you want to be Carrie in the middle of your game save it and then enable this Cheat and press F1. when you start your saved game back up you'll be Carrie instead of Reindhart. + 80389C3D ???? 0000:"Carrie to Reindhart",0001:"Reindhart to Carrie" + +crc 1CC06338-87388926-C:45 +gn Castlevania - Legacy of Darkness (U) + cn Infinite\Keys\Clocktower A + 801CAB6F 000A + cn Infinite\Keys\Clocktower B + 801CAB70 000A + cn Infinite\Keys\Storeroom + 801CAB60 000A + cn Infinite\Keys\Garden + 801CAB61 000A + cn Infinite\Keys\Copper + 801CAB62 000A + cn Infinite\Keys\Chamber + 801CAB63 000A + cn Infinite\Keys\Execution + 801CAB64 000A + cn Infinite\Keys\Deck + 801CAB65 000A + cn Infinite\Keys\Rose Garden + 801CAB66 000A + cn Infinite\Keys\Thorn + 801CAB67 000A + cn Infinite\Keys\Clocktower C + 801CAB68 000A + cn Infinite\Keys\Clocktower D + 801CAB69 000A + cn Infinite\Keys\Art Tower 1 + 801CAB6A 000A + cn Infinite\Keys\Art Tower 2 + 801CAB6B 000A + cn Infinite\Keys\Control Room + 801CAB6C 000A + cn Infinite\Keys\Wall + 801CAB6D 000A + cn Infinite\Keys\Clocktower E + 801CAB6E 000A + cn Infinite\Keys\Archives + 801CAB5E 000A + cn Infinite\Keys\Left Tower + 801CAB5F 000A + cn Infinite\Health + 811CAB3A 2710 + cn Infinite\Gold + 811CAB42 2710 + cn Infinite\Specials\Special 1 + 801CAB47 000A + cn Infinite\Specials\Special 2 + 801CAB48 000A + cn Infinite\Specials\Special 3 + 801CAB49 000A + cn Infinite\Items\Roast Chicken + 801CAB4A 000A + cn Infinite\Items\Roast Beef + 801CAB4B 000A + cn Infinite\Items\Healing Kit + 801CAB4C 000A + cn Infinite\Items\Purifying + 801CAB4D 000A + cn Infinite\Items\Cure Ampoule + 801CAB4E 000A + cn Infinite\Items\Powerup + 801CAB4F 000A + cn Infinite\Items\The Contract + 801CAB54 000A + cn Infinite\Items\Magical Nitro + 801CAB55 000A + cn Infinite\Items\Mandragora + 801CAB56 000A + cn Infinite\Items\Sun Card + 801CAB57 000A + cn Infinite\Items\Moon Card + 801CAB58 000A + cn Infinite\Items\Winch Lever + 801CAB59 000A + cn Infinite\Items\Oldrey's Diary + 801CAB5A 000A + cn Infinite\Items\Crest Half A + 801CAB5B 000A + cn Infinite\Items\Crest Half B + 801CAB5C 000A + cn Infinite\Items\Rose Brooch + 801CAB5D 000A + cn Infinite\Items\Throwing Weapons + 801CAB45 0064 + cn Infinite\Items\Red Jewels + 801CAB45 0068 + cn Infinite\Bullets + cd For Henry + 801D3DA3 0006 + cn Wolfman Can Use Weapons + cd For Cornell + 801CAB37 0002 + cn Wolfman Can't Use Weapons + cd For Cornell (Default) + 801CAB37 0004 + cn Rapid Fire Gun (Henry-Hold B) + cd For Henry, Hold B + D11C87F6 0040 + 801D3DA3 0006 + cn Max Powerups + 801CAE23 0002 + cn Stop Timer Input + 811CAB22 0001 + cn Hard Mode Selected In A New Game + cd With this code, you will not see the hard level status until you save and restart the game file. No special items are required to access this feature with this code turned on. + 8032495F 0002 + cn Weapon Modifier + 811CAB3E ???? 0000:"Nothing",0001:"Knife",0002:"Potion",0003:"Cross",0004:"Axe" + cn Level Modifier + 801CAE79 ???? 0000:"Forest Of Silence",0001:"Left Tower",0002:"Castle Wall",0003:"Villa",0004:"Villa",0005:"Villa",0006:"Villa",001A:"Villa",0007:"Tunnel",0008:"Underground Waterway",0009:"Castle Center",000A:"Castle Center",000B:"Castle Center",000C:"Castle Center",000D:"Castle Center",000E:"Castle Center",000F:"Castle Center",0010:"Foggy Lake",0011:"Foggy Lake",0012:"Foggy Lake",0013:"Cave Of Spiderwomen",0014:"Castle Keep",0015:"Castle Keep",0016:"Falls Into Space(?)",0017:"Clock Tower",0018:"Final Battle Site",0019:"Castle Center",001B:"Room Of Clocks",001C:"Countryside Where Carrie's Mom Is Buried.(Fall Through Ground)",002B:"Countryside Where Carrie's Mom Is Buried.(Fall Through Ground)",001D:"Tower Of Sorcery",001E:"Tower Of Execution",001F:"Tower Of Execution",0020:"Tower Of Execution",0021:"Tower Of Science",0022:"Tower Of Science",0023:"Tower Of Ruins",0024:"Tower Of Ruins",0025:"Art Tower",0026:"Art Tower",0027:"Dual Tower",0028:"Clock Tower",0029:"Clock Tower",002A:"Outer Wall",002C:"Fall From Sky Ouside Of Castlevania Opening",002D:"Another Free Fall. Forest Where Girl Runs In Opening",002E:"Black Room(?)" + cn Inter-Level Modifier + 801CAE7B ???? 0000:"Forest Of Silence",0001:"Left Tower",0002:"Castle Wall",0003:"Villa",0004:"Villa",0005:"Villa",0006:"Villa",001A:"Villa",0007:"Tunnel",0008:"Underground Waterway",0009:"Castle Center",000A:"Castle Center",000B:"Castle Center",000C:"Castle Center",000D:"Castle Center",000E:"Castle Center",000F:"Castle Center",0010:"Foggy Lake",0011:"Foggy Lake",0012:"Foggy Lake",0013:"Cave Of Spiderwomen",0014:"Castle Keep",0015:"Castle Keep",0016:"Falls Into Space(?)",0017:"Clock Tower",0018:"Final Battle Site",0019:"Castle Center",001B:"Room Of Clocks",001C:"Countryside Where Carrie's Mom Is Buried.(Fall Through Ground)",002B:"Countryside Where Carrie's Mom Is Buried.(Fall Through Ground)",001D:"Tower Of Sorcery",001E:"Tower Of Execution",001F:"Tower Of Execution",0020:"Tower Of Execution",0021:"Tower Of Science",0022:"Tower Of Science",0023:"Tower Of Ruins",0024:"Tower Of Ruins",0025:"Art Tower",0026:"Art Tower",0027:"Dual Tower",0028:"Clock Tower",0029:"Clock Tower",002A:"Outer Wall",002C:"Fall From Sky Ouside Of Castlevania Opening",002D:"Another Free Fall. Forest Where Girl Runs In Opening",002E:"Black Room(?)" + cn Cut Scene Modifier + cd With this code, you must use the appropiate level mod before you attemp to run these cut scenes. Not doing so will ruin the cut scene as the graphics will be glitched. + 801CAE93 0009 + 801CAE8B ???? 0003:"Castle Drawbridge Lowers",0004:"Character Enters Castle",0005:"(?)",000A:"(?)",000C:"(?)",0020:"(?)",0021:"(?)",0022:"(?)",0006:"Vampire In Main Entrance Hall Of Villa",0007:"One Of The Working Gears Cut Scenes",0008:"\"I Smell Poison\" From Underground Waterway",0009:"Castle Gate Closes In Villa Upon Entering Villa",000B:"Renon Appears For First Time",000D:"Village Vampire In Upstairs Villa",000E:"Malus Appears For The First Time",000F:"Malus Leaves Garden",0010:"Character In Boat On Foggy Lake",0011:"Seal Removed From Wall In Arena",0012:"Bleeding Statue",0013:"Cosmic Lights",0014:"Explosion At Wall In Arena",0015:"Explosion At Wall In Castle That Leads To Hidden Room",0016:"Malus Appears Again In Upstairs Room Of Castle",0017:"Bull Awakens",0018:"Vincent The Vampire",0019:"One Of The Working Gears Cut Scenes",001A:"Gate Opens In Forest Of Silence",001B:"Meet Renon For The Last Time In Castle Keep.",001C:"This Cut Scene Runs Cut Scene 27 And 2E",001E:"Castle Keep Destructs",001F:"Malus On Flying Horse Outside Castle Keep",0024:"Spider People In Tunnel",0025:"Rosa In Garden",0027:"Castel Destruction",0028:"Space Warp",0029:"Castle Destruction",002A:"Malus Is Saved By Reinhardt",002B:"Malus And Reinhardt On Horse",002E:"Rosa Returns",0030:"Ada, Henry And Cornell At Game End",0031:"Scrolling Text About Castle And Henry",0033:"Vampire In Basement",0034:"Vampire In Villa Basement Destroyed, Woman Vampire Rises",0035:"Finds Hidden Path In Villa Basement",0037:"Lever & Gear In Castle",0038:"Harpie",0039:"Harpie Destroyed",0044:"Death(Grim Reaper)",0045:"Death Is Destroyed",0046:"Castle Drawbridge Closes And Ortega Appears",0047:"Thirsty Man",0048:"Cornell Meets Henry In Garden",0049:"Cornell And Henry Part In Garden",0051:"Monster Dracula Appears",0052:"Actrise Appears In Castle Center",0054:"Actrise Appears Again With Cousin Fernandes Before Fight With Carrie",0055:"Cousin Fernandes Is Destroyed",0056:"Actrise Appears Again Before Fight With Carrie",0057:"Actrise Defeated By Carrie" + cn Enable Characters All Charactors + 8031B243 0004 + cn Character Modifier + 8031B22B ???? 0000:"Cornell",0001:"Reinhardt",0002:"Carrie",0003:"Henry" + cn Status Modifier + 801CAB84 ???? 0000:"Never Get Poisoned or Vamped",0001:"Normal",0004:"Vamp",0008:"Poison",000C:"Vamped & Poisoned",00FF:"Instant Death" + cn Max Weapon Power-Up + 801CAE27 0002 + cn Day Modifier For Adult Henry + 801CAB1F ???? 0000:"7 Days",0001:"6 Days",0002:"5 Days",0003:"4 Days",0004:"3 Days",0005:"2 Days",0006:"1 Day",0007:"0 Days" + cn Infinite\Health Young Henry + D11C87F6 0010 + 813A5360 2800 + +crc 6420535A-50028062-C:45 +gn Chameleon Twist (U) + cn Access All Levels + 8020850E 00FF + 80208510 00FF + cn Extra Crowns + 80251767 0015 + cn Infinite Health + 80174CF3 000A + cn Extended Tongue + 8133176E FFFF + cn Level Select + 8029087B ???? 0000:"Stage 1",0001:"Stage 2",0002:"Stage 3",0003:"Stage 4",0004:"Stage 5",0005:"Stage 6",0006:"Stage 7" + +crc CD538CE4-618AFCF9-C:45 +gn Chameleon Twist 2 (U) + cn Infinite Health + 8018BA7D 000F + cn Max Collectable Items + 80164501 0014 + cn Have 6 Carrots + 80164519 007E + cn Have All\Levels + 80164508 003F + cn Have All\Costumes + 8016451A 00FE + cn Have All\Collectibles\Stage 1 + 80164510 0014 + cn Have All\Collectibles\Stage 2 + 80164511 0014 + cn Have All\Collectibles\Stage 3 + 80164512 0014 + cn Have All\Collectibles\Stage 4 + 80164513 0014 + cn Have All\Collectibles\Stage 5 + 80164514 0014 + cn Have All\Collectibles\Stage 6 + 80164515 0014 + cn Press L To levitate + cd Press L To Levitate & Let go to land + D018BAB5 0020 + 8118B9E0 4200 + +crc 1E0E96E8-4E28826B-C:45 +gn Charlie Blast's Territory (U) + cn Stop Timer From Counting Down (All Levels) + 8101D4FC 2400 + +crc 214CAD94-BE1A3B24-C:45 +gn Chopper Attack (U) + cn Max Score + 81129426 FFFF + cn Infinite Weapon\1st Position + 8012943B 0063 + cn Infinite Weapon\2nd Position + 8012943F 0063 + cn Infinite Weapon\3rd Position + 80129443 0063 + cn Infinite Weapon\4th Position + 80129447 0063 + cn Infinite Weapon\5th Position + 8012944B 0063 + cn Weapon Modifier\Gun Weapon + 80129723 ???? 0000:"No Weapon",0001:"Normal Shot",0002:"2-Way Shot",0003:"3-Way Shot",0004:"4-Way Shot" + cn Gun 4-Way Shot + 80129723 0004 + cn Infinite Fuel + 81129726 FFFF + cn Infinite Shield + 811296C8 03E8 + cn Opens All 5 Item Slots + 8012945B 0005 + cn Weapon Modifier\1st Position + cd Must to be used with the Infinite Weapon Codes & the open all 5 item slot code. + 80129439 ???? 0000:"Nothing",0001:"AGM",0002:"AAM",0003:"AGAM",0004:"Dummy",0005:"Rocket",0006:"Cluster",0007:"H-Cluster",0008:"H-Plasma" + cn Weapon Modifier\2nd Position + cd Must to be used with the Infinite Weapon Codes & the open all 5 item slot code. + 8012943D ???? 0000:"Nothing",0001:"AGM",0002:"AAM",0003:"AGAM",0004:"Dummy",0005:"Rocket",0006:"Cluster",0007:"H-Cluster",0008:"H-Plasma" + cn Weapon Modifier\3rd Position + cd Must to be used with the Infinite Weapon Codes & the open all 5 item slot code. + 801294F1 ???? 0000:"Nothing",0001:"AGM",0002:"AAM",0003:"AGAM",0004:"Dummy",0005:"Rocket",0006:"Cluster",0007:"H-Cluster",0008:"H-Plasma" + cn Weapon Modifier\4th Position + cd Must to be used with the Infinite Weapon Codes & the open all 5 item slot code. + 801294F5 ???? 0000:"Nothing",0001:"AGM",0002:"AAM",0003:"AGAM",0004:"Dummy",0005:"Rocket",0006:"Cluster",0007:"H-Cluster",0008:"H-Plasma" + cn Weapon Modifier\5th Position + cd Must to be used with the Infinite Weapon Codes & the open all 5 item slot code. + 801294F9 ???? 0000:"Nothing",0001:"AGM",0002:"AAM",0003:"AGAM",0004:"Dummy",0005:"Rocket",0006:"Cluster",0007:"H-Cluster",0008:"H-Plasma" + cn Score Attack Mode + 81129472 0001 + cn Stage Select On + 81129476 0001 + cn Option On + 8112947A 0001 + cn Clear Mission Selector + 8112947C ???? 0001:"1",0002:"2",0003:"3",0004:"4",0005:"5",0006:"6",0007:"7",0008:"8" + cn Texture Mode + 81129484 0001 + +crc F03C24CA-C5237BCC-C:45 +gn Clay Fighter 63 1-3 (U) + cn Extra Characters/Secret Options + 801A2B41 000F + cn Stage Modifier + 801A2B2B ???? 0000:"Candy Factory",0001:"Claynaveral Hangar",0002:"Camp Claynaveral",0003:"Outhouse",0004:"Mudville Mansion",0005:"Ghastly Graveyard",0006:"Spooky Spire",0007:"Happy Harry's Hut",0008:"Freezing Fortress",0009:"Refuse Room",000A:"Grotto Gulch",000B:"Rubbage Room",000C:"Rubbage Reef",000D:"Kiln's Laboratory",000E:"Kiln's Hideout",000F:"Fiery Furnace",0010:"Research Room",0011:"Clayribbean Cruise",0012:"Santa's Workship",0013:"Kooky Courtyard",0014:"Santa's Toy Factory",0015:"Boogerhenge",0016:"Backwash Bay",0017:"Tureen Toilet",0018:"Tribal Tower",0019:"Aquadome" + cn Infinite Time To Choose Your Fighter + 81200BEC 03A7 + cn Player 1 Character Modifier + 801A2B2F ???? 0001:"Blob",0002:"Bonker",0003:"Boogerman",0004:"Dr. Kiln",0005:"Earthworm Jim",0008:"Houngan",0009:"Icky Bod Clay",000A:"Kung Pow",000D:"Sumo Santa",000E:"Taffy",000F:"T-Hoppy" + cn Refuse Room, Grotto Gulch, Santa's Worshop\Player 1\Cant be Stunned + 801F1B0B 0000 + cn Refuse Room, Grotto Gulch, Santa's Worshop\Player 1\Infinite Energy + 801F1B13 00AA + cn Refuse Room, Grotto Gulch, Santa's Worshop\Player 1\No Energy + 801F1B13 0000 + cn Refuse Room, Grotto Gulch, Santa's Worshop\Player 1\Full Super Bar + 811F1B1A 0200 + cn Refuse Room, Grotto Gulch, Santa's Worshop\Player 2\Cant be Stunned + 801F4FAB 0000 + cn Refuse Room, Grotto Gulch, Santa's Worshop\Player 2\Infinite Energy + 801F4FB3 00AA + cn Refuse Room, Grotto Gulch, Santa's Worshop\Player 2\No Energy + 801F4FB3 0000 + cn Refuse Room, Grotto Gulch, Santa's Worshop\Player 2\Full Super Bar + 811F4FBA 0200 + cn Tribal Tower\Player 1\Cant be Stunned + 801F1BAB 0000 + cn Tribal Tower\Player 1\Infinite Energy + 801F1BB3 00AA + cn Tribal Tower\Player 1\No Energy + 801F1BB3 0000 + cn Tribal Tower\Player 1\Full Super Bar + 811F1BBA 0200 + cn Tribal Tower\Player 2\Cant be Stunned + 801F504B 0000 + cn Tribal Tower\Player 2\Infinite Energy + 801F5053 00AA + cn Tribal Tower\Player 2\No Energy + 801F5053 0000 + cn Tribal Tower\Player 2\Full Super Bar + 811F505A 0200 + cn Aquadome\Player 1\Cant be Stunned + 801F1E3B 0000 + cn Aquadome\Player 1\Infinite Energy + 801F1E33 00AA + cn Aquadome\Player 1\No Energy + 801F1E33 0000 + cn Aquadome\Player 1\Full Super Bar + 811F1E3A 0200 + cn Aquadome\Player 2\Cant be Stunned + 801F52CB 0000 + cn Aquadome\Player 2\Infinite Energy + 801F52D3 00AA + cn Aquadome\Player 2\No Energy + 801F52D3 0000 + cn Aquadome\Player 2\Full Super Bar + 811F52DA 0200 + cn Outhouse,Claynaveral Hangar,Camp Claynaveral\Player 1\Cant be Stunned + 801F233B 0000 + cn Outhouse,Claynaveral Hangar,Camp Claynaveral\Player 1\Infinite Energy + 801F2343 00AA + cn Outhouse,Claynaveral Hangar,Camp Claynaveral\Player 1\No Energy + 801F2343 0000 + cn Outhouse,Claynaveral Hangar,Camp Claynaveral\Player 1\Full Super Bar + 811F234A 0200 + cn Outhouse,Claynaveral Hangar,Camp Claynaveral\Player 2\Cant be Stunned + 801F57DB 0000 + cn Outhouse,Claynaveral Hangar,Camp Claynaveral\Player 2\Infinite Energy + 801F57E3 00AA + cn Outhouse,Claynaveral Hangar,Camp Claynaveral\Player 2\No Energy + 801F57E3 0000 + cn Outhouse,Claynaveral Hangar,Camp Claynaveral\Player 2\Full Super Bar + 811F57EA 0200 + cn Freezing Fortress\Player 1\Cant be Stunned + 801F239B 0000 + cn Freezing Fortress\Player 1\Infinite Energy + 801F23A3 00AA + cn Freezing Fortress\Player 1\No Energy + 801F23A3 0000 + cn Freezing Fortress\Player 1\Full Super Bar + 811F23AA 0200 + cn Freezing Fortress\Player 2\Cant be Stunned + 801F583B 0000 + cn Freezing Fortress\Player 2\Infinite Energy + 801F5843 00AA + cn Freezing Fortress\Player 2\No Energy + 801F5843 0000 + cn Freezing Fortress\Player 2\Full Super Bar + 811F584A 0200 + cn Rubbage Reef\Player 1\Cant be Stunned + 801F241B 0000 + cn Rubbage Reef\Player 1\Infinite Energy + 801F2423 00AA + cn Rubbage Reef\Player 1\No Energy + 801F2423 0000 + cn Rubbage Reef\Player 1\Full Super Bar + 811F242A 0200 + cn Rubbage Reef\Player 2\Cant be Stunned + 801F58BB 0000 + cn Rubbage Reef\Player 2\Infinite Energy + 801F58C3 00AA + cn Rubbage Reef\Player 2\No Energy + 801F58C3 0000 + cn Rubbage Reef\Player 2\Full Super Bar + 811F58CA 0200 + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion\Player 1\Cant be Stunned + 801F244B 0000 + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion\Player 1\Infinite Energy + 801F2453 00AA + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion\Player 1\No Energy + 801F2453 0000 + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion\Player 1\Full Super Bar + 811F245A 0200 + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion\Player 2\Cant be Stunned + 801F58EB 0000 + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion\Player 2\Infinite Energy + 801F58F3 00AA + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion\Player 2\No Energy + 801F58F3 0000 + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion\Player 2\Full Super Bar + 811F58FA 0200 + cn Clayribbean Cruise\Player 1\Cant be Stunned + 801F24FB 0000 + cn Clayribbean Cruise\Player 1\Infinite Energy + 801F2503 00AA + cn Clayribbean Cruise\Player 1\No Energy + 801F2503 0000 + cn Clayribbean Cruise\Player 1\Full Super Bar + 811F250A 0200 + cn Clayribbean Cruise\Player 2\Cant be Stunned + 801F599B 0000 + cn Clayribbean Cruise\Player 2\Infinite Energy + 801F59A3 00AA + cn Clayribbean Cruise\Player 2\No Energy + 801F59A3 0000 + cn Clayribbean Cruise\Player 2\Full Super Bar + 811F59AA 0200 + cn Backwash Bay\Player 1\Cant be Stunned + 801F258B 0000 + cn Backwash Bay\Player 1\Infinite Energy + 801F2593 00AA + cn Backwash Bay\Player 1\No Energy + 801F2593 0000 + cn Backwash Bay\Player 1\Full Super Bar + 811F259A 0200 + cn Backwash Bay\Player 2\Cant be Stunned + 801F5A2B 0000 + cn Backwash Bay\Player 2\Infinite Energy + 801F5A33 00AA + cn Backwash Bay\Player 2\No Energy + 801F5A33 0000 + cn Backwash Bay\Player 2\Full Super Bar + 811F5A3A 0200 + cn Ghastly Graveyard\Player 1\Cant be Stunned + 801F262B 0000 + cn Ghastly Graveyard\Player 1\Infinite Energy + 801F2633 00AA + cn Ghastly Graveyard\Player 1\No Energy + 801F2633 0000 + cn Ghastly Graveyard\Player 1\Full Super Bar + 811F263A 0200 + cn Ghastly Graveyard\Player 2\Cant be Stunned + 801F5ACB 0000 + cn Ghastly Graveyard\Player 2\Infinite Energy + 801F5AD3 00AA + cn Ghastly Graveyard\Player 2\No Energy + 801F5AD3 0000 + cn Ghastly Graveyard\Player 2\Full Super Bar + 811F5ADA 0200 + cn Candy Factory\Player 1\Cant be Stunned + 801F270B 0000 + cn Candy Factory\Player 1\Infinite Energy + 801F2713 00AA + cn Candy Factory\Player 1\No Energy + 801F2713 0000 + cn Candy Factory\Player 1\Full Super Bar + 811F271A 0200 + cn Candy Factory\Player 2\Cant be Stunned + 801F5BAB 0000 + cn Candy Factory\Player 2\Infinite Energy + 801F5BB3 00AA + cn Candy Factory\Player 2\No Energy + 801F5BB3 0000 + cn Candy Factory\Player 2\Full Super Bar + 811F5BBA 0200 + cn Kooky Courtyard\Player 1\Cant be Stunned + 801F280B 0000 + cn Kooky Courtyard\Player 1\Infinite Energy + 801F2813 00AA + cn Kooky Courtyard\Player 1\No Energy + 801F2813 0000 + cn Kooky Courtyard\Player 1\Full Super Bar + 811F281A 0200 + cn Kooky Courtyard\Player 2\Cant be Stunned + 801F5CAB 0000 + cn Kooky Courtyard\Player 2\Infinite Energy + 801F5CB3 00AA + cn Kooky Courtyard\Player 2\No Energy + 801F5CB3 0000 + cn Kooky Courtyard\Player 2\Full Super Bar + 811F5CBA 0200 + cn Santa's Toy Factory\Player 1\Cant be Stunned + 801F2C3B 0000 + cn Santa's Toy Factory\Player 1\Infinite Energy + 801F2C43 00AA + cn Santa's Toy Factory\Player 1\No Energy + 801F2C43 0000 + cn Santa's Toy Factory\Player 1\Full Super Bar + 811F2C4A 0200 + cn Santa's Toy Factory\Player 2\Cant be Stunned + 801F60DB 0000 + cn Santa's Toy Factory\Player 2\Infinite Energy + 801F60E3 00AA + cn Santa's Toy Factory\Player 2\No Energy + 801F60E3 0000 + cn Santa's Toy Factory\Player 2\Full Super Bar + 811F60EA 0200 + cn Boogerhenge, Tureen Toilet\Player 1\Cant be Stunned + 801F2FDB 0000 + cn Boogerhenge, Tureen Toilet\Player 1\Infinite Energy + 801F2FE3 00AA + cn Boogerhenge, Tureen Toilet\Player 1\No Energy + 801F2FE3 0000 + cn Boogerhenge, Tureen Toilet\Player 1\Full Super Bar + 811F2FEA 0200 + cn Boogerhenge, Tureen Toilet\Player 2\Cant be Stunned + 801F647B 0000 + cn Boogerhenge, Tureen Toilet\Player 2\Infinite Energy + 801F6483 00AA + cn Boogerhenge, Tureen Toilet\Player 2\No Energy + 801F6483 0000 + cn Boogerhenge, Tureen Toilet\Player 2\Full Super Bar + 811F648A 0200 + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room\Player 1\Cant be Stunned + 801F3BBB 0000 + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room\Player 1\Infinite Energy + 801F3BC3 00AA + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room\Player 1\No Energy + 801F3BC3 0000 + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room\Player 1\Full Super Bar + 811F3BCA 0200 + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room\Player 2\Cant be Stunned + 801F705B 0000 + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room\Player 2\Infinite Energy + 801F7063 00AA + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room\Player 2\No Energy + 801F7063 0000 + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room\Player 2\Full Super Bar + 811F706A 0200 + cn Rubbage Room\Player 1\Cant be Stunned + 801F464B 0000 + cn Rubbage Room\Player 1\Infinite Energy + 801F4653 00AA + cn Rubbage Room\Player 1\No Energy + 801F4653 0000 + cn Rubbage Room\Player 1\Full Super Bar + 811F465A 0200 + cn Rubbage Room\Player 2\Cant be Stunned + 801F7AEB 0000 + cn Rubbage Room\Player 2\Infinite Energy + 801F7AF3 00AA + cn Rubbage Room\Player 2\No Energy + 801F7AF3 0000 + cn Rubbage Room\Player 2\Full Super Bar + 811F7AFA 0200 + +crc FA5A3DFF-B4C9CDB9-C:45 +gn Clay Fighter - Sculptor's Cut (U) + cn Santa's Workshop, Refuse Room, Grotto Gulch\Player 1\Cant be Stunned + 801939FF 0000 + cn Santa's Workshop, Refuse Room, Grotto Gulch\Player 1\Infinite Health + 80193A07 00AA + cn Santa's Workshop, Refuse Room, Grotto Gulch\Player 1\No Health + 80193A07 0000 + cn Santa's Workshop, Refuse Room, Grotto Gulch\Player 1\Full Super Bar + 81193A0E 0200 + cn Santa's Workshop, Refuse Room, Grotto Gulch\Player 2\Cant be Stunned + 80196EEF 0000 + cn Santa's Workshop, Refuse Room, Grotto Gulch\Player 2\Infinite Health + 80196EF7 00AA + cn Santa's Workshop, Refuse Room, Grotto Gulch\Player 2\No Health + 80196EF7 0000 + cn Santa's Workshop, Refuse Room, Grotto Gulch\Player 2\Full Super Bar + 81196EFE 0200 + cn Tribal Tower\Player 1\Cant be Stunned + 80193A9F 0000 + cn Tribal Tower\Player 1\Infinite Health + 80193AA7 00AA + cn Tribal Tower\Player 1\No Health + 80193AA7 0000 + cn Tribal Tower\Player 1\Full Super Bar + 81193AAE 0200 + cn Tribal Tower\Player 2\Cant be Stunned + 80196F8F 0000 + cn Tribal Tower\Player 2\Infinite Health + 80196F97 00AA + cn Tribal Tower\Player 2\No Health + 80196F97 0000 + cn Tribal Tower\Player 2\Full Super Bar + 81196F9E 0200 + cn Aquadome\Player 1\Cant be Stunned + 80193D1F 0000 + cn Aquadome\Player 1\Infinite Health + 80193D27 00AA + cn Aquadome\Player 1\No Health + 80193D27 0000 + cn Aquadome\Player 1\Full Super Bar + 81193D2E 0200 + cn Aquadome\Player 2\Cant be Stunned + 8019720F 0000 + cn Aquadome\Player 2\Infinite Health + 80197217 00AA + cn Aquadome\Player 2\No Health + 80197217 0000 + cn Aquadome\Player 2\Full Super Bar + 8119721E 0200 + cn Clayribbean Cruise\Player 1\Cant be Stunned + 80193F3F 0000 + cn Clayribbean Cruise\Player 1\Infinite Health + 80193F47 00AA + cn Clayribbean Cruise\Player 1\No Health + 80193F47 0000 + cn Clayribbean Cruise\Player 1\Full Super Bar + 81193F4E 0200 + cn Clayribbean Cruise\Player 2\Cant be Stunned + 8019742F 0000 + cn Clayribbean Cruise\Player 2\Infinite Health + 80197437 00AA + cn Clayribbean Cruise\Player 2\No Health + 80197437 0000 + cn Clayribbean Cruise\Player 2\Full Super Bar + 8119743E 0200 + cn Camp Claynaveral, ClayNaveral Hangar, OutHouse\Player 1\Cant be Stunned + 8019422F 0000 + cn Camp Claynaveral, ClayNaveral Hangar, OutHouse\Player 1\Infinite Health + 80194237 00AA + cn Camp Claynaveral, ClayNaveral Hangar, OutHouse\Player 1\No Health + 80194237 0000 + cn Camp Claynaveral, ClayNaveral Hangar, OutHouse\Player 1\Full Super Bar + 8119423E 0200 + cn Camp Claynaveral, ClayNaveral Hangar, OutHouse\Player 2\Cant be Stunned + 8019771F 0000 + cn Camp Claynaveral, ClayNaveral Hangar, OutHouse\Player 2\Infinite Health + 80197727 00AA + cn Camp Claynaveral, ClayNaveral Hangar, OutHouse\Player 2\No Health + 80197727 0000 + cn Camp Claynaveral, ClayNaveral Hangar, OutHouse\Player 2\Full Super Bar + 8119772E 0200 + cn Freezing Fortress\Player 1\Cant be Stunned + 8019428F 0000 + cn Freezing Fortress\Player 1\Infinite Health + 80194297 00AA + cn Freezing Fortress\Player 1\No Health + 80194297 0000 + cn Freezing Fortress\Player 1\Full Super Bar + 8119429E 0200 + cn Freezing Fortress\Player 2\Cant be Stunned + 8019777F 0000 + cn Freezing Fortress\Player 2\Infinite Health + 80197787 00AA + cn Freezing Fortress\Player 2\No Health + 80197787 0000 + cn Freezing Fortress\Player 2\Full Super Bar + 8119778E 0200 + cn Spooky Spire, Happy Harry's Hut, Mudville Mansion\Player 1\Cant be Stunned + 8019433F 0000 + cn Spooky Spire, Happy Harry's Hut, Mudville Mansion\Player 1\Infinite Health + 80194347 00AA + cn Spooky Spire, Happy Harry's Hut, Mudville Mansion\Player 1\No Health + 80194347 0000 + cn Spooky Spire, Happy Harry's Hut, Mudville Mansion\Player 1\Full Super Bar + 8119434E 0200 + cn Spooky Spire, Happy Harry's Hut, Mudville Mansion\Player 2\Cant be Stunned + 8019782F 0000 + cn Spooky Spire, Happy Harry's Hut, Mudville Mansion\Player 2\Infinite Health + 80197837 00AA + cn Spooky Spire, Happy Harry's Hut, Mudville Mansion\Player 2\No Health + 80197837 0000 + cn Spooky Spire, Happy Harry's Hut, Mudville Mansion\Player 2\Full Super Bar + 8119783E 0200 + cn Rubbage Reef Code\Player 1\Cant be Stunned + 8019430F 0000 + cn Rubbage Reef Code\Player 1\Infinite Health + 80194317 00AA + cn Rubbage Reef Code\Player 1\No Health + 80194317 0000 + cn Rubbage Reef Code\Player 1\Full Super Bar + 8119431E 0200 + cn Rubbage Reef Code\Player 2\Cant be Stunned + 801977FF 0000 + cn Rubbage Reef Code\Player 2\Infinite Health + 80197807 00AA + cn Rubbage Reef Code\Player 2\No Health + 80197807 0000 + cn Rubbage Reef Code\Player 2\Full Super Bar + 8119780E 0200 + cn Backwash Bay\Player 1\Cant be Stunned + 8019447F 0000 + cn Backwash Bay\Player 1\Infinite Health + 80194487 00AA + cn Backwash Bay\Player 1\No Health + 80194487 0000 + cn Backwash Bay\Player 1\Full Super Bar + 8119448E 0200 + cn Backwash Bay\Player 2\Cant be Stunned + 8019796F 0000 + cn Backwash Bay\Player 2\Infinite Health + 80197977 00AA + cn Backwash Bay\Player 2\No Health + 80197977 0000 + cn Backwash Bay\Player 2\Full Super Bar + 8119797E 0200 + cn Ghastly Graveyard\Player 1\Cant be Stunned + 8019451F 0000 + cn Ghastly Graveyard\Player 1\Infinite Health + 80194527 00AA + cn Ghastly Graveyard\Player 1\No Health + 80194527 0000 + cn Ghastly Graveyard\Player 1\Full Super Bar + 8119452E 0200 + cn Ghastly Graveyard\Player 2\Cant be Stunned + 80197A0F 0000 + cn Ghastly Graveyard\Player 2\Infinite Health + 80197A17 00AA + cn Ghastly Graveyard\Player 2\No Health + 80197A17 0000 + cn Ghastly Graveyard\Player 2\Full Super Bar + 81197A1E 0200 + cn Candy Factory\Player 1\Cant be Stunned + 801945FF 0000 + cn Candy Factory\Player 1\Infinite Health + 80194607 00AA + cn Candy Factory\Player 1\No Health + 80194607 0000 + cn Candy Factory\Player 1\Full Super Bar + 8119460E 0200 + cn Candy Factory\Player 2\Cant be Stunned + 80197AEF 0000 + cn Candy Factory\Player 2\Infinite Health + 80197AF7 00AA + cn Candy Factory\Player 2\No Health + 80197AF7 0000 + cn Candy Factory\Player 2\Full Super Bar + 81197AFE 0200 + cn Kooky Courtyard\Player 1\Cant be Stunned + 801946FF 0000 + cn Kooky Courtyard\Player 1\Infinite Health + 80194707 00AA + cn Kooky Courtyard\Player 1\No Health + 80194707 0000 + cn Kooky Courtyard\Player 1\Full Super Bar + 8119470E 0200 + cn Kooky Courtyard\Player 2\Cant be Stunned + 80197BEF 0000 + cn Kooky Courtyard\Player 2\Infinite Health + 80197BF7 00AA + cn Kooky Courtyard\Player 2\No Health + 80197BF7 0000 + cn Kooky Courtyard\Player 2\Full Super Bar + 81197BFE 0200 + cn Santa's Toy Factory\Player 1\Cant be Stunned + 80194B2F 0000 + cn Santa's Toy Factory\Player 1\Infinite Health + 80194B37 00AA + cn Santa's Toy Factory\Player 1\No Health + 80194B37 0000 + cn Santa's Toy Factory\Player 1\Full Super Bar + 81194B3E 0200 + cn Santa's Toy Factory\Player 2\Cant be Stunned + 8019801F 0000 + cn Santa's Toy Factory\Player 2\Infinite Health + 80198027 00AA + cn Santa's Toy Factory\Player 2\No Health + 80198027 0000 + cn Santa's Toy Factory\Player 2\Full Super Bar + 8119802E 0200 + cn Boogerhenge, Tureen Toilet\Player 1\Cant be Stunned + 80194ECF 0000 + cn Boogerhenge, Tureen Toilet\Player 1\Infinite Health + 80194ED7 00AA + cn Boogerhenge, Tureen Toilet\Player 1\No Health + 80194ED7 0000 + cn Boogerhenge, Tureen Toilet\Player 1\Full Super Bar + 81194EDE 0200 + cn Boogerhenge, Tureen Toilet\Player 2\Cant be Stunned + 801983BF 0000 + cn Boogerhenge, Tureen Toilet\Player 2\Infinite Health + 801983C7 00AA + cn Boogerhenge, Tureen Toilet\Player 2\No Health + 801983C7 0000 + cn Boogerhenge, Tureen Toilet\Player 2\Full Super Bar + 811983CE 0200 + cn Dr. Kiln's Laboratory, Research Room, Kilns Hideout, Fiery Furnace\Player 1\Cant be Stunned + 80195AAF 0000 + cn Dr. Kiln's Laboratory, Research Room, Kilns Hideout, Fiery Furnace\Player 1\Infinite Health + 80195AB7 00AA + cn Dr. Kiln's Laboratory, Research Room, Kilns Hideout, Fiery Furnace\Player 1\No Health + 80195AB7 0000 + cn Dr. Kiln's Laboratory, Research Room, Kilns Hideout, Fiery Furnace\Player 1\Full Super Bar + 81195ABE 0200 + cn Dr. Kiln's Laboratory, Research Room, Kilns Hideout, Fiery Furnace\Player 2\Cant be Stunned + 80198F9F 0000 + cn Dr. Kiln's Laboratory, Research Room, Kilns Hideout, Fiery Furnace\Player 2\Infinite Health + 80198FA7 00AA + cn Dr. Kiln's Laboratory, Research Room, Kilns Hideout, Fiery Furnace\Player 2\No Health + 80198FA7 0000 + cn Dr. Kiln's Laboratory, Research Room, Kilns Hideout, Fiery Furnace\Player 2\Full Super Bar + 81198FAE 0200 + cn Dog House\Player 1\Cant be Stunned + 8019653F 0000 + cn Dog House\Player 1\Infinite Health + 80196547 00AA + cn Dog House\Player 1\No Health + 80196547 0000 + cn Dog House\Player 1\Full Super Bar + 8119654E 0200 + cn Dog House\Player 2\Cant be Stunned + 80199A2F 0000 + cn Dog House\Player 2\Infinite Health + 80199A37 00AA + cn Dog House\Player 2\No Health + 80199A37 0000 + cn Dog House\Player 2\Full Super Bar + 81199A3E 0200 + cn VS. Mode\Player 1\Cant be Stunned + 8019195F 0000 + cn VS. Mode\Player 1\Infinite Health + 80199167 00AA + cn VS. Mode\Player 1\No Health + 80199167 0000 + cn VS. Mode\Player 1\Full Super Bar + 8119916E 0200 + cn VS. Mode\Player 2\Cant be Stunned + 80194E4F 0000 + cn VS. Mode\Player 2\Infinite Health + 80194E57 00AA + cn VS. Mode\Player 2\No Health + 80194E57 0000 + cn VS. Mode\Player 2\Full Super Bar + 81194E5E 0200 + cn Other Codes\Have High Five + 810AA0BE 0001 + cn Other Codes\Have Earth Worm Jim + 810AA0E2 0001 + cn Other Codes\Have Sumo Santa + 810AA106 0001 + cn Other Codes\Have Booger Man + 810AA12A 0001 + cn Other Codes\Debug Mode + cd With this code, Press C-Up & C-Down to pick your stage. + 810AA1A6 0001 + cn Other Codes\Difficulty Modifier + 810AE40A ???? 0000:"Cookie",0001:"Easy",0002:"Normal",0003:"Dude",0004:"Psycho" + cn Other Codes\Time Limit Modifier + 800AE423 ???? 0000:"On",0001:"Off" + cn Other Codes\Throws & Holds Modifier + 800AE42F ???? 0000:"On",0001:"Off" + cn Other Codes\VS. Arena Select Modifier + 800AE43B ???? 0000:"Random",0001:"Normal" + cn Other Codes\Spillits Modifier + 800AE447 ???? 0000:"Normal",0001:"Psycho" + cn Other Codes\Health Meters Modifier + 800AE5EF ???? 0000:"Off",0001:"On" + cn Other Codes\Stun Meters Modifier + 800AE5FB ???? 0000:"Off",0001:"On" + cn Other Codes\Super Meters Modifier + 800AE607 ???? 0000:"Off",0001:"On" + cn Other Codes\Portraits Modifier + 800AE613 ???? 0000:"Off",0001:"On" + +crc 2B6FA7C0-09A71225-C:45 +gn Clay Fighter 63 1-3 (U) (beta) + cn Extra Characters and Secret Options + 8019ED41 000F + cn Stage Select + 8019ED2B ???? 0000:"Candy Factory",0001:"Claynaveral Hangar",0002:"Camp Claynaveral",0003:"Outhouse",0004:"Mudville Mansion",0005:"Ghastly Graveyard",0006:"Spooky Spire",0007:"Happy Harry's Hut",0008:"Freezing Fortress",0009:"Refuse Room",000A:"Grotto Gulch",000B:"Rubbage Room",000C:"Rubbage Reef",000D:"Kiln's Laboratory",000E:"Kiln's Hideout",000F:"Fiery Furnace",0010:"Research Room",0011:"Clayribbean Cruise",0012:"Santa's Workship",0013:"Kooky Courtyard",0014:"Santa's Toy Factory",0015:"Boogerhenge",0016:"Backwash Bay",0017:"Tureen Toilet",0018:"Tribal Tower",0019:"Aquadome" + cn Play As\Player1 + 8019ED2F ???? 0000:"Bad Mr. Frosty",0001:"Blob",0002:"Bonker",0003:"Boogerman",0004:"Dr. Kiln",0005:"Earthworm Jim",0008:"Houngan",0009:"Icky Bod Clay",000A:"Kung Pow",000D:"Sumo Santa",000E:"Taffy",000F:"T-Hoppy" + cn Refuse Room, Grotto Gulch, Santa's Workship Stages\Can't be Stunned\Player 1 + 801EDCE3 0000 + cn Refuse Room, Grotto Gulch, Santa's Workship Stages\Infinite Energy\Player 1 + 801EDCEB 00AA + cn Refuse Room, Grotto Gulch, Santa's Workship Stages\No Energy\Player 1 + 801EDCEB 0000 + cn Refuse Room, Grotto Gulch, Santa's Workship Stages\Full Super Bar\Player 1 + 811EDCF2 0200 + cn Tribal Tower Stage\Can't be Stunned\Player 1 + 801EDD83 0000 + cn Tribal Tower Stage\Infinite Energy\Player 1 + 801EDD8B 00AA + cn Tribal Tower Stage\No Energy\Player 1 + 801EDD8B 0000 + cn Tribal Tower Stage\Full Super Bar\Player 1 + 811EDD92 0200 + cn Aquadome Stage\Can't be Stunned\Player 1 + 801EE013 0000 + cn Aquadome Stage\Infinite Energy\Player 1 + 801EE00B 00AA + cn Aquadome Stage\No Energy\Player 1 + 801EE00B 0000 + cn Aquadome Stage\Full Super Bar\Player 1 + 811EE012 0200 + cn Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Can't be Stunned\Player 1 + 801EE513 0000 + cn Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Infinite Energy\Player 1 + 801EE51B 00AA + cn Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\No Energy\Player 1 + 801EE51B 0000 + cn Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Full Super Bar\Player 1 + 811EE522 0200 + cn Freezing Fortress Stage\Can't be Stunned\Player 1 + 801EE573 0000 + cn Freezing Fortress Stage\Infinite Energy\Player 1 + 801EE57B 00AA + cn Freezing Fortress Stage\No Energy\Player 1 + 801EE57B 0000 + cn Freezing Fortress Stage\Full Super Bar\Player 1 + 811EE582 0200 + cn Rubbage Reef Stage\Can't be Stunned\Player 1 + 801EE5F3 0000 + cn Rubbage Reef Stage\Infinite Energy\Player 1 + 801EE5FB 00AA + cn Rubbage Reef Stage\No Energy\Player 1 + 801EE5FB 0000 + cn Rubbage Reef Stage\Full Super Bar\Player 1 + 811EE602 0200 + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Can't be Stunned\Player 1 + 801EE623 0000 + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Infinite Energy\Player 1 + 801EE62B 00AA + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\No Energy\Player 1 + 801EE62B 0000 + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Full Super Bar\Player 1 + 811EE632 0200 + cn Clayribbean Cruise Stage\Can't be Stunned\Player 1 + 801EE6D3 0000 + cn Clayribbean Cruise Stage\Infinite Energy\Player 1 + 801EE6DB 00AA + cn Clayribbean Cruise Stage\No Energy\Player 1 + 801EE6DB 0000 + cn Clayribbean Cruise Stage\Full Super Bar\Player 1 + 811EE6E2 0200 + cn Backwash Bay Stage\Can't be Stunned\Player 1 + 801EE763 0000 + cn Backwash Bay Stage\Infinite Energy\Player 1 + 801EE76B 00AA + cn Backwash Bay Stage\No Energy\Player 1 + 801EE76B 0000 + cn Backwash Bay Stage\Full Super Bar\Player 1 + 811EE772 0200 + cn Ghastly Graveyard Stage\Can't be Stunned\Player 1 + 801EE803 0000 + cn Ghastly Graveyard Stage\Infinite Energy\Player 1 + 801EE80B 00AA + cn Ghastly Graveyard Stage\No Energy\Player 1 + 801EE80B 0000 + cn Ghastly Graveyard Stage\Full Super Bar\Player 1 + 811EE812 0200 + cn Candy Factory Stage\Can't be Stunned\Player 1 + 801EE8E3 0000 + cn Candy Factory Stage\Infinite Energy\Player 1 + 801EE8EB 00AA + cn Candy Factory Stage\No Energy\Player 1 + 801EE8EB 0000 + cn Candy Factory Stage\Full Super Bar\Player 1 + 811EE8F2 0200 + cn Kooky Courtyard Stage\Can't be Stunned\Player 1 + 801EE9E3 0000 + cn Kooky Courtyard Stage\Infinite Energy\Player 1 + 801EE9EB 00AA + cn Kooky Courtyard Stage\No Energy\Player 1 + 801EE9EB 0000 + cn Kooky Courtyard Stage\Full Super Bar\Player 1 + 811EE9F2 0200 + cn Santa's Toy Factory Stage\Can't be Stunned\Player 1 + 801EEE13 0000 + cn Santa's Toy Factory Stage\Infinite Energy\Player 1 + 801EEE1B 00AA + cn Santa's Toy Factory Stage\No Energy\Player 1 + 801EEE1B 0000 + cn Santa's Toy Factory Stage\Full Super Bar\Player 1 + 811EEE22 0200 + cn Boogerhenge, Tureen Toilet Stage\Can't be Stunned\Player 1 + 801EF1B3 0000 + cn Boogerhenge, Tureen Toilet Stage\Infinite Energy\Player 1 + 801EF1BB 00AA + cn Boogerhenge, Tureen Toilet Stage\No Energy\Player 1 + 801EF1BB 0000 + cn Boogerhenge, Tureen Toilet Stage\Full Super Bar\Player 1 + 811EF1C2 0200 + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Can't be Stunned\Player 1 + 801EFD93 0000 + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Infinite Energy\Player 1 + 801EFD9B 00AA + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\No Energy\Player 1 + 801EFD9B 0000 + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Full Super Bar\Player 1 + 811EFDA2 0200 + cn Rubbage Room Stage\Can't be Stunned\Player 1 + 801F0823 0000 + cn Rubbage Room Stage\Infinite Energy\Player 1 + 801F082B 00AA + cn Rubbage Room Stage\No Energy\Player 1 + 801F082B 0000 + cn Rubbage Room Stage\Full Super Bar\Player 1 + 811F0832 0200 + cn Refuse Room, Grotto Gulch, Santa's Workship Stages\Can't be Stunned\Player 2 + 801F1183 0000 + cn Refuse Room, Grotto Gulch, Santa's Workship Stages\Infinite Energy\Player 2 + 801F118B 00AA + cn Refuse Room, Grotto Gulch, Santa's Workship Stages\No Energy\Player 2 + 801F118B 0000 + cn Refuse Room, Grotto Gulch, Santa's Workship Stages\Full Super Bar\Player 2 + 811F1192 0200 + cn Tribal Tower Stage\Can't be Stunned\Player 2 + 801F1223 0000 + cn Tribal Tower Stage\Infinite Energy\Player 2 + 801F122B 00AA + cn Tribal Tower Stage\No Energy\Player 2 + 801F122B 0000 + cn Tribal Tower Stage\Full Super Bar\Player 2 + 811F1232 0200 + cn Aquadome Stage\Can't be Stunned\Player 2 + 801F14A3 0000 + cn Aquadome Stage\Infinite Energy\Player 2 + 801F14AB 00AA + cn Aquadome Stage\No Energy\Player 2 + 801F14AB 0000 + cn Aquadome Stage\Full Super Bar\Player 2 + 811F14B2 0200 + cn Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Can't be Stunned\Player 2 + 801F19B3 0000 + cn Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Infinite Energy\Player 2 + 801F19BB 00AA + cn Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\No Energy\Player 2 + 801F19BB 0000 + cn Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Full Super Bar\Player 2 + 811F19C2 0200 + cn Freezing Fortress Stage\Can't be Stunned\Player 2 + 801F1A13 0000 + cn Freezing Fortress Stage\Infinite Energy\Player 2 + 801F1A1B 00AA + cn Freezing Fortress Stage\No Energy\Player 2 + 801F1A1B 0000 + cn Freezing Fortress Stage\Full Super Bar\Player 2 + 811F1A22 0200 + cn Rubbage Reef Stage\Can't be Stunned\Player 2 + 801F1A93 0000 + cn Rubbage Reef Stage\Infinite Energy\Player 2 + 801F1A9B 00AA + cn Rubbage Reef Stage\No Energy\Player 2 + 801F1A9B 0000 + cn Rubbage Reef Stage\Full Super Bar\Player 2 + 811F1AA2 0200 + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Can't be Stunned\Player 2 + 801F1AC3 0000 + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Infinite Energy\Player 2 + 801F1ACB 00AA + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\No Energy\Player 2 + 801F1ACB 0000 + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Full Super Bar\Player 2 + 811F1AD2 0200 + cn Clayribbean Cruise Stage\Can't be Stunned\Player 2 + 801F1B73 0000 + cn Clayribbean Cruise Stage\Infinite Energy\Player 2 + 801F1B7B 00AA + cn Clayribbean Cruise Stage\No Energy\Player 2 + 801F1B7B 0000 + cn Clayribbean Cruise Stage\Full Super Bar\Player 2 + 811F1B82 0200 + cn Backwash Bay Stage\Can't be Stunned\Player 2 + 801F1C03 0000 + cn Backwash Bay Stage\Infinite Energy\Player 2 + 801F1C0B 00AA + cn Backwash Bay Stage\No Energy\Player 2 + 801F1C0B 0000 + cn Backwash Bay Stage\Full Super Bar\Player 2 + 811F1C12 0200 + cn Ghastly Graveyard Stage\Can't be Stunned\Player 2 + 801F1CA3 0000 + cn Ghastly Graveyard Stage\Infinite Energy\Player 2 + 801F1CAB 00AA + cn Ghastly Graveyard Stage\No Energy\Player 2 + 801F1CAB 0000 + cn Ghastly Graveyard Stage\Full Super Bar\Player 2 + 811F1CB2 0200 + cn Candy Factory Stage\Can't be Stunned\Player 2 + 801F1D83 0000 + cn Candy Factory Stage\Infinite Energy\Player 2 + 801F1D8B 00AA + cn Candy Factory Stage\No Energy\Player 2 + 801F1D8B 0000 + cn Candy Factory Stage\Full Super Bar\Player 2 + 811F1D92 0200 + cn Kooky Courtyard Stage\Can't be Stunned\Player 2 + 801F1E83 0000 + cn Kooky Courtyard Stage\Infinite Energy\Player 2 + 801F1E8B 00AA + cn Kooky Courtyard Stage\No Energy\Player 2 + 801F1E8B 0000 + cn Kooky Courtyard Stage\Full Super Bar\Player 2 + 811F1E92 0200 + cn Santa's Toy Factory Stage\Can't be Stunned\Player 2 + 801F22B3 0000 + cn Santa's Toy Factory Stage\Infinite Energy\Player 2 + 801F22BB 00AA + cn Santa's Toy Factory Stage\No Energy\Player 2 + 801F22BB 0000 + cn Santa's Toy Factory Stage\Full Super Bar\Player 2 + 811F22C2 0200 + cn Boogerhenge, Tureen Toilet Stage\Can't be Stunned\Player 2 + 801F2653 0000 + cn Boogerhenge, Tureen Toilet Stage\Infinite Energy\Player 2 + 801F265B 00AA + cn Boogerhenge, Tureen Toilet Stage\No Energy\Player 2 + 801F265B 0000 + cn Boogerhenge, Tureen Toilet Stage\Full Super Bar\Player 2 + 811F2662 0200 + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Can't be Stunned\Player 2 + 801F3233 0000 + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Infinite Energy\Player 2 + 801F323B 00AA + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\No Energy\Player 2 + 801F323B 0000 + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Full Super Bar\Player 2 + 811F3242 0200 + cn Rubbage Room Stage\Can't be Stunned\Player 2 + 801F3CC3 0000 + cn Rubbage Room Stage\Infinite Energy\Player 2 + 801F3CCB 00AA + cn Rubbage Room Stage\No Energy\Player 2 + 801F3CCB 0000 + cn Rubbage Room Stage\Full Super Bar\Player 2 + 811F3CD2 0200 + +crc 95286EB4-B76AD58F-C:45 +gn Command & Conquer (U) + cn NOD\Max Cash + 810C50AE FFFF + 810C50B0 0001 + cn NOD\Max Power + 810C50CE FFFF + 810C50D0 0001 + cn NOD\Instant\Build Buildings + 810C50C6 FFFF + cn NOD\Instant\Build Units + 810C50BE FFFF + cn NOD\Instant\Build Vehicles + 810C50C2 FFFF + cn NOD\Instant\Build Aircraft + 810C50BA FFFF + cn NOD\Instant\Air Strike + 800962A4 0032 + 800C4FF8 00FF + cn NOD\Instant\Ion Cannon + 800962A5 0033 + 800C4FD8 00FF + cn NOD\Instant\Nuclear Strike + 800962A6 0034 + 800C5018 00FF + cn GDI\Max Cash + 810C4F06 FFFF + 810C4F08 0001 + cn GDI\Max Power + 810C4F26 FFFF + 810C4F28 0001 + cn GDI\Instant\Build Buildings + 810C4F1E FFFF + cn GDI\Instant\Build Units + 810C4F16 FFFF + cn GDI\Instant\Build Vehicles + 810C4F1A FFFF + cn GDI\Instant\Build Aircraft + 810C4F12 FFFF + cn GDI\Instant\Air Strike + 800962A4 0032 + 800C4E50 00FF + cn GDI\Instant\Ion Cannon + 800962A5 0033 + 800C4E30 00FF + cn GDI\Instant\Nuclear Strike + 800962A6 0034 + 800C4E70 00FF + cn GDI\Mission 4\Infinite Health Hum-Vee + 800ABE99 0096 + cn GDI\Mission 4\Infinite Health APC #1 + 800ABFB1 00C8 + cn GDI\Mission 4\Infinite Health APC #2 + 800AC03D 00C8 + cn GDI\Mission 6\Infinite Health Commando + 800B56CD 0050 + cn GDI\Mission 6\Infinite Health Transportational Helicopter + 800BFC95 005A + cn GDI\Maximum Killed + 80092E53 00C8 + cn NOD\Maximum Killed + 80092E4F 00C8 + cn GDI\None Killed + 80092E53 0000 + cn NOD\None Killed + 80092E4F 0000 + cn GDI\Maximum Buildings Lost + 80092E5F 00C8 + cn NOD\Maximum Buildings Lost + 80092E5B 00C8 + cn GDI\No Buildings Lost + 80092E5F 0000 + cn NOD\No Buildings Lost + 80092E5B 0000 + cn 100% Efficiency + 80092E4B 0064 + cn 100% Leadership + 80092E47 0064 + cn Tons Of Ending Credits + 81092E3C 0FFF + 81092E3E FFFF + cn Max Total Score + 81092E42 FFFF + cn Time Spent On Mission + 80092E3B ???? 0000:"No Time",00FF:"Max Time" + +crc 30C7AC50-7704072D-C:45 +gn Conker's Bad Fur Day (U) + cn Infinite\Health\Player 1 + 800CC49A 0006 + cn Infinite\Oxygen + 800CC382 0001 + cn Infinite\Pots of cash + 810D214A FFFF + cn Access All\Chapters, Scenes,& Multi-Player Characters + 50000401 0000 + 800E9D01 00FF + cn Play as Option 1 + cd Here you can Choose Options who you want to play as,But only one Option at a time. + 800D213F ???? 0001:"Wessle",0003:"Tedi",0004:"Combat Squirrel",0005:"Conker",000B:"Uga",000C:"Bald Caveman",000D:"Caveman",000E:"Mohican Caveman",0010:"Neo Conker",001B:"Villager",0021:"Zombie",0023:"Enemy Bat",0024:"Conkers Bat",0025:"Army Captain",0026:"Tedi Boss",0027:"Gregg",0028:"Gregg skeleton" + cn Infinite\Lives Player 1 + 800D2144 0064 + cn Infinite\Health\Player 2 + 800CC7C6 270F + cn Infinite\Health\Player 3 + 800CCAF2 270F + cn Infinite\Health\Player 4 + 800CCE1E 270F + cn Infinite\Time In Multi + 8108FD7A 7500 + cn Infinite\Bags In Heist + 800E0BE4 00FF + cn Access All\Characters & Weapons In Multi Race + 810E9D02 ??FF00FF:"All Characters & Baseball bat",00FB:"All Characters & Frying Pan",00F3:"All Characters & Bones" + cn Infinite\Bombs + 802055CA 0030 + cn Infinite\Max Kills Player 1 + 800E0B47 03E7 + cn Infinite\Accuracy Count Player 1 + cd MULTI ONLY. Only put this code on once you are in the game + 800E0B67 0001 + cn Infinite\Head Shot Count Player 1 + cd MULTI ONLY. Only put this code on once you are in the game,Once you pick up a Gun a shoot once, you will 100%. + 800E0B6B 03E7 + cn Press L To Levitate\Player 1 + cd Press L Button to Levitate & Let go to come back down + D0042A15 0020 + 810CC2F0 41CB + cn Press L To Levitate\Player 2 + cd Press L Button to Levitate & Let go to come back down + D0042A1D 0020 + 810CC61C 41CB + cn Press L To Levitate\Player 3 + cd Press L Button to Levitate & Let go to come back down + D0042A25 0020 + 810CC948 41CB + cn Press L To Levitate\Player 4 + cd Press L Button to Levitate & Let go to come back down + D0042A2D 0020 + 810CCC74 41CB + cn Matrix Mode (Anywhere) + cd Press R to activate and then Right-C to exit. + D1042A14 0010 + 800BEA0C 0001 + D1042A14 0010 + 810BE574 D202 + D1042A14 0001 + 800BEA0C 0000 + D1042A14 0001 + 810BE574 0000 + cn Conkers Speed Select + 810CC318 ???? 3F00:"Slow Conker",3F80:"Normal Conker",3FF0:"Fast Conker",4030:"Super Fast Conker" + cn Weapon Select In Multi (On Pick Up) + cd Select what Weapon you would like in Multi Player and then on a Weapon Pickup you will have the weapon of your choice.to change for another just Enable the one of your choice to have that instead.(you must have a weapon already to change for the next. + 80180873 ???? 0001:"Sword",0002:"Nothing",0003:"Yellow Chain-Ssaw",0004:"Throwing Knives",0005:"Riffle",0006:"Long Pistol with Sight",0007:"Rocket Launcher",0008:"Buck Shot",000A:"High Powred Riffle With Scope",000C:"Two Automatic Machine Guns",0013:"Gas Mask" + +crc 46A3F7AF-0F7591D0-C:45 +gn Cruis'n Exotica (U) + cn Unlock All Cars + 8104F10E FFFF + cn Always Place 1st\Player 1 + 81065174 0000 + cn Infinite\Nitros\Player 1 + 800BE7FD 00FF + cn Infinite\Continues + 8107F850 00FF + cn Infinite\Time + 810802D4 4296 + cn Play As + 800802D0 ???? 0000:"",0001:"",0002:"",0003:"",0004:"",0005:"",0006:"",0007:"",0008:"",0009:"",000A:"",000B:"",000C:"",000D:"",000E:"",000F:"",0010:"",0011:"",0012:"",0013:"",0014:"",0015:"",0016:"",0017:"",0018:"",0019:"" + +crc FF2F2FB4-D161149A-C:45 +gn Cruis'n USA (U) (v1.0) + cn Always Place 1st + 8015025B 0001 + cn Unlimited Time + 80150A68 0095 + 8015097D 0095 + cn Car Upgrades\'63 Muscle Car + 8015065F 0005 + cn Car Upgrades\La Bomba + 80150663 0005 + cn Car Upgrades\Devastator + 80150667 0005 + cn Car Upgrades\Italia P69 + 8015066B 0005 + cn Car Upgrades\All-Terrain Vehicle + 8015066F 0004 + cn Car Upgrades\School Bus + 80150673 0004 + cn Car Upgrades\Police Car + 80150677 0004 + cn Infinite Time + 80150A6D 0045 + cn Stop Elapsed Time And No Traffic + 80150A69 0000 + cn Play Level Modifier + 80150A83 ???? 0000:"Golden Gate Park",0001:"San Francisco",0002:"US 101",0003:"Redwood Forest",0004:"Beverly Hills",0005:"LA Freeway",0006:"Death Valley",0007:"Arizona",0008:"Grand Canyon",0009:"Iowa",000A:"Chicago",000B:"Indiana",000C:"Appalachia",000D:"Washington DC",000E:"Cruise The USA" + cn Player 1\Gearbox Type Modifier + 80150333 ???? 0000:"Automatic",0001:"Manual" + cn Player 1\Always First Place + 8015034B 0001 + cn Player 1\Always Have Fastest Car + 8015033A 000C + cn Player 2\Gearbox Type Modifier + 801506CF ???? 0000:"Automatic",0001:"Manual" + cn Player 2\Always First Place + 801506E7 0001 + cn Player 2\Always Have Fastest Car + 801506D6 000C + cn Player 1\Lights & Sirens For Police Car & School Bus + 8115065A 0001 + 8114E4AA 0001 + cn Player 2\Lights & Sirens For Police Car & School Bus + 811509F6 0001 + 8114E4C2 0001 + +crc 5306CF45-CBC49250-C:45 +gn Cruis'n USA (U) (v1.1) + cn Car Upgrades\'63 Muscle Car + 8015053F 0005 + cn Car Upgrades\La Bomba + 80150543 0005 + cn Car Upgrades\Devastator + 80150547 0005 + cn Car Upgrades\Italia P69 + 8015054B 0005 + cn Car Upgrades\All-Terrain Vehicle + 8015054F 0004 + cn Car Upgrades\School Bus + 80150553 0004 + cn Car Upgrades\Police Car + 80150557 0004 + cn Infinite Time + 8015094D 0095 + cn Stop Elapsed Time And No Traffic + 80150949 0000 + cn Play Level Modifier + 80150963 ???? 0000:"Golden Gate Park",0001:"San Francisco",0002:"US 101",0003:"Redwood Forest",0004:"Beverly Hills",0005:"LA Freeway",0006:"Death Valley",0007:"Arizona",0008:"Grand Canyon",0009:"Iowa",000A:"Chicago",000B:"Indiana",000C:"Appalachia",000D:"Washington DC",000E:"Cruise The USA" + cn Player 1\Gearbox Type Modifier + 80150213 ???? 0000:"Automatic",0001:"Manual" + cn Player 1\Always First Place + 8015022B 0001 + cn Player 1\Always Have Fastest Car + 8015021A 0001 + cn Player 2\Gearbox Type Modifier + 801505AF ???? 0000:"Automatic",0001:"Manual" + cn Player 2\Always First Place + 801505C7 0001 + cn Player 2\Always Have Fastest Car + 801505B6 0001 + cn Player 1\Lights & Sirens For Police Car & School Bus P1 + 8115053A 0001 + 8114E38A 0001 + cn Player 2\Lights & Sirens For Police Car & School Bus P2 + 811508D6 0001 + 8114E3A2 0001 + +crc B3402554-7340C004-C:45 +gn Cruis'n USA (U) (v1.2) + cn Car Upgrades\'63 Muscle Car + 8015056F 0005 + cn Car Upgrades\La Bomba + 80150573 0005 + cn Car Upgrades\Devastator + 80150577 0005 + cn Car Upgrades\Italia P69 + 8015057B 0005 + cn Car Upgrades\All-Terrain Vehicle + 8015057F 0004 + cn Car Upgrades\School Bus + 80150583 0004 + cn Car Upgrades\Police Car + 80150587 0004 + cn Infinite Time + 8015097D 0095 + cn Stop Elapsed Time And No Traffic + 80150979 0000 + cn Play Level Modifier + 80150993 ???? 0000:"Golden Gate Park",0001:"San Francisco",0002:"US 101",0003:"Redwood Forest",0004:"Beverly Hills",0005:"LA Freeway",0006:"Death Valley",0007:"Arizona",0008:"Grand Canyon",0009:"Iowa",000A:"Chicago",000B:"Indiana",000C:"Appalachia",000D:"Washington DC",000E:"Cruise The USA" + cn Player 1\Gearbox Type Modifier + 80150243 ???? 0000:"Automatic",0001:"Manual" + cn Player 1\Always First Place + 8015025B 0001 + cn Player 1\Always Have Fastest Car + 8015024A 0001 + cn Player 2\Gearbox Type Modifier + 801505DF ???? 0000:"Automatic",0001:"Manual" + cn Player 2\Always First Place + 801505F7 0001 + cn Player 2\Always Have Fastest Car + 801505E6 0001 + cn Player 1\Lights & Sirens For Police Car & School Bus + 8115056A 0001 + 8114E3BA 0001 + cn Player 2\Lights & Sirens For Police Car & School Bus + 81150906 0001 + 8114E3D2 0001 + +crc DFE61153-D76118E6-C:45 +gn Cruis'n World (U) + cn Have All Car Upgrades + 803BEE42 0005 + cn Have All Cars + 813BEE78 1FFF + cn Time Counts Down Faster + 813D0D3E 0000 + cn Dancing Girl Always On + 803BEE73 0001 + 803C21CF 0054 + cn Player 1\Always Place 1st + 803CE023 0001 + cn Player 1\Car/Transmission Modifier + 803BEE40 ???? 0000:"Serpent (Auto)",0001:"Serpent (Manual)",0002:"Kamikaze (Auto)",0003:"Kamikaze (Manual)",0004:"ATV (Auto",0005:"ATV (Manual)",0006:"Scarab (Auto)",0007:"Scarab (Manual)",0008:"Stallion P6 (Auto)",0009:"Stallion P6 (Manual)",000A:"Banzai GTV (Auto)",000B:"Banzai GTV (Manual)",000C:"Zombie (Auto)",000D:"Zombie (Manual)",000E:"Orca (Auto)",000F:"Orca (manual)",0010:"El Nino (Auto)",0011:"El Nino (Manual)",0012:"Rhino 4x4 (Auto)",0013:"Rhino 4x4 (Manual)",0014:"Sardine Extreme (Auto)",0015:"Sardine Extreme (Manual)",0016:"Road King (Auto)",0017:"Road King (Manual)",0018:"Grass Hopper (Auto)",0019:"Grass Hopper (Manual)",001A:"Bulldog (Auto)",001B:"Bulldog (Manual)",001C:"Enforcer (Auto)",001D:"Enforcer (Manual)",001E:"NY Taxi (Auto)",001F:"NY Taxi (Manual)",0020:"School Bus (Auto)",0021:"School Bus (Manual)",0022:"Exec (Auto)",0023:"Exec (Manual)",0024:"Conductor (Auto)",0025:"Conductor (Manual)",0026:"Speed Demon (Auto)",0027:"Speed Demon (Manual)",0028:"Tommy (Auto)",0029:"Tommy (Manual)",002A:"Rocket (Auto)",002B:"Rocket (Manual)",002C:"The Surgeon (Auto)",002D:"The Surgeon (Manual)",002E:"Monsta (Auto)",002F:"Monsta (Manual)",0030:"Howler (Auto)",0031:"Howler (Manual)" + cn Player 1\Stop Elapsed Time + 813C7678 3C80 + cn Player 2\Always Place 1st + 803CE4FB 0001 + cn Player 2\Car/Transmission Modifier + 803BEE48 ???? 0000:"Serpent (Auto)",0001:"Serpent (Manual)",0002:"Kamikaze (Auto)",0003:"Kamikaze (Manual)",0004:"ATV (Auto",0005:"ATV (Manual)",0006:"Scarab (Auto)",0007:"Scarab (Manual)",0008:"Stallion P6 (Auto)",0009:"Stallion P6 (Manual)",000A:"Banzai GTV (Auto)",000B:"Banzai GTV (Manual)",000C:"Zombie (Auto)",000D:"Zombie (Manual)",000E:"Orca (Auto)",000F:"Orca (manual)",0010:"El Nino (Auto)",0011:"El Nino (Manual)",0012:"Rhino 4x4 (Auto)",0013:"Rhino 4x4 (Manual)",0014:"Sardine Extreme (Auto)",0015:"Sardine Extreme (Manual)",0016:"Road King (Auto)",0017:"Road King (Manual)",0018:"Grass Hopper (Auto)",0019:"Grass Hopper (Manual)",001A:"Bulldog (Auto)",001B:"Bulldog (Manual)",001C:"Enforcer (Auto)",001D:"Enforcer (Manual)",001E:"NY Taxi (Auto)",001F:"NY Taxi (Manual)",0020:"School Bus (Auto)",0021:"School Bus (Manual)",0022:"Exec (Auto)",0023:"Exec (Manual)",0024:"Conductor (Auto)",0025:"Conductor (Manual)",0026:"Speed Demon (Auto)",0027:"Speed Demon (Manual)",0028:"Tommy (Auto)",0029:"Tommy (Manual)",002A:"Rocket (Auto)",002B:"Rocket (Manual)",002C:"The Surgeon (Auto)",002D:"The Surgeon (Manual)",002E:"Monsta (Auto)",002F:"Monsta (Manual)",0030:"Howler (Auto)",0031:"Howler (Manual)" + cn Player 2\Stop Elapsed Time + 813C78B4 3C80 + cn Player 3\Always Place 1st + 803CDB4B 0001 + cn Player 3\Car/Transmission Modifier + 803BEE50 ???? 0000:"Serpent (Auto)",0001:"Serpent (Manual)",0002:"Kamikaze (Auto)",0003:"Kamikaze (Manual)",0004:"ATV (Auto",0005:"ATV (Manual)",0006:"Scarab (Auto)",0007:"Scarab (Manual)",0008:"Stallion P6 (Auto)",0009:"Stallion P6 (Manual)",000A:"Banzai GTV (Auto)",000B:"Banzai GTV (Manual)",000C:"Zombie (Auto)",000D:"Zombie (Manual)",000E:"Orca (Auto)",000F:"Orca (manual)",0010:"El Nino (Auto)",0011:"El Nino (Manual)",0012:"Rhino 4x4 (Auto)",0013:"Rhino 4x4 (Manual)",0014:"Sardine Extreme (Auto)",0015:"Sardine Extreme (Manual)",0016:"Road King (Auto)",0017:"Road King (Manual)",0018:"Grass Hopper (Auto)",0019:"Grass Hopper (Manual)",001A:"Bulldog (Auto)",001B:"Bulldog (Manual)",001C:"Enforcer (Auto)",001D:"Enforcer (Manual)",001E:"NY Taxi (Auto)",001F:"NY Taxi (Manual)",0020:"School Bus (Auto)",0021:"School Bus (Manual)",0022:"Exec (Auto)",0023:"Exec (Manual)",0024:"Conductor (Auto)",0025:"Conductor (Manual)",0026:"Speed Demon (Auto)",0027:"Speed Demon (Manual)",0028:"Tommy (Auto)",0029:"Tommy (Manual)",002A:"Rocket (Auto)",002B:"Rocket (Manual)",002C:"The Surgeon (Auto)",002D:"The Surgeon (Manual)",002E:"Monsta (Auto)",002F:"Monsta (Manual)",0030:"Howler (Auto)",0031:"Howler (Manual)" + cn Player 4\Always Place 1st + 803CD673 0001 + cn Player 4\Car/Transmission Modifier + 803BEE58 ???? 0000:"Serpent (Auto)",0001:"Serpent (Manual)",0002:"Kamikaze (Auto)",0003:"Kamikaze (Manual)",0004:"ATV (Auto",0005:"ATV (Manual)",0006:"Scarab (Auto)",0007:"Scarab (Manual)",0008:"Stallion P6 (Auto)",0009:"Stallion P6 (Manual)",000A:"Banzai GTV (Auto)",000B:"Banzai GTV (Manual)",000C:"Zombie (Auto)",000D:"Zombie (Manual)",000E:"Orca (Auto)",000F:"Orca (manual)",0010:"El Nino (Auto)",0011:"El Nino (Manual)",0012:"Rhino 4x4 (Auto)",0013:"Rhino 4x4 (Manual)",0014:"Sardine Extreme (Auto)",0015:"Sardine Extreme (Manual)",0016:"Road King (Auto)",0017:"Road King (Manual)",0018:"Grass Hopper (Auto)",0019:"Grass Hopper (Manual)",001A:"Bulldog (Auto)",001B:"Bulldog (Manual)",001C:"Enforcer (Auto)",001D:"Enforcer (Manual)",001E:"NY Taxi (Auto)",001F:"NY Taxi (Manual)",0020:"School Bus (Auto)",0021:"School Bus (Manual)",0022:"Exec (Auto)",0023:"Exec (Manual)",0024:"Conductor (Auto)",0025:"Conductor (Manual)",0026:"Speed Demon (Auto)",0027:"Speed Demon (Manual)",0028:"Tommy (Auto)",0029:"Tommy (Manual)",002A:"Rocket (Auto)",002B:"Rocket (Manual)",002C:"The Surgeon (Auto)",002D:"The Surgeon (Manual)",002E:"Monsta (Auto)",002F:"Monsta (Manual)",0030:"Howler (Auto)",0031:"Howler (Manual)" + cn Have All Car Upgrades + 803BEE42 0005 + cn Have All Cars + 813BEE78 1FFF + cn Championship Mode\Max Total Points + 813BFBFA FFFF + cn Championship Mode\Max Points Per Race + 813BFBFE FFFF + cn Championship Mode\Max Points To Next Level + 813BFBFC FFFF + cn Championship Mode\Unlimited Nitro\Player 1 + 803C75E7 0003 + cn Championship Mode\Unlimited Nitro\Player 2 + 803C7823 0003 + cn Championship Mode\Unlimited Nitro\Player 3 + 803C716F 0003 + cn Championship Mode\Cannot Spin Out + 803CDD93 0000 + cn Championship Mode\Disable Left Lane Traffic + 8033C95B 0001 + cn Championship Mode\Disable Right Lane Traffic + 8033C95F 0001 + +crc E8FC8EA1-9F738391-C:45 +gn CyberTiger (U) + cn Always Hole In One + 8115E1D6 0000 + cn Inventory\Max Distance & Wind Cutter + 800B4412 00FF + cn Inventory\Max No Bounce & Tee Up + 800B4411 00FF + cn Inventory\Max Accuracy & Skipper + 800B4410 00FF + cn Inventory\Max Spinner & Burrow + 800B4413 00FF + cn Inventory\Max Mystery + 800B4420 00F0 + cn Big Head + 810AE840 401F + cn Character Unlock\Kimmi + 800B0BBA 0010 + cn Character Unlock\Starr + 800B0BCE 0010 + cn Character Unlock\Marvin The Alien + 800B0BD7 0001 + cn Change Looks Of Liltiger + 800B0BC4 0011 + cn Character Unlock\Robert & Delvis + 800B0BCA 0011 + cn Character Unlock\Bengal The Tiger + 800B0BC2 0010 + cn Character Unlock\Cindy + 800B0BBA 0001 + cn Character Unlock\Festus + 800B0BD3 0001 + cn Character Unlock\Mark + 800B0BC7 0012 + cn Character Unlock\Twfan & Eagamer + 800B0BBE 0011 + cn Character Unlock\Traci (Leopard Costume) + 800B0BCE 0011 + cn Character Unlock\Bobby + 800B0BC6 0001 + +crc A4A52B58-23759841-C:45 +gn Dark Rift (U) + cn Access Sonork Character + 80049DF0 0001 + cn Access Demitron Character + 80049DF4 0001 + cn Infinite Health\All Levels\Player 1 + 81028988 0800 + 8102898A 0018 + 81000060 3C1B + 81000062 8008 + 81000064 8F7B + 81000066 0228 + 8100006C 03E0 + 8100006E 0008 + 81000070 A761 + 81000072 0070 + cn Press GS For 2 Rounds Won\Player 1 + 890B6330 0002 + cn Press GS For 2 Rounds Won\Player 2 + 890B6342 0002 + cn Music Modifier + 800816B2 ???? 0000:"Music Off",002A:"Volume Low",0055:"Volume Medium",007F:"Volume Max" + +crc F5363349-DBF9D21B-C:45 +gn Deadly Arts (U) + cn Player 1\Character Modifier + 80105001 ???? 0000:"Azami",0001:"Serina",0002:"Miki",0003:"Kai",0004:"Sakai",0005:"Kengon",0006:"Kyeya",0007:"Kaoru",0008:"Gouriki",0009:"Reiji",000A:"Yami",000B:"Hikari",000C:"Invisible Fighter" + cn Player 1\Infinite Energy + 81105026 03E8 + cn Player 1\No Energy + 81105026 0000 + cn Player 1\Never Wins + 8009E3F4 0000 + cn Player 1\Needs 1 Round to Win + D009E3F4 0000 + 8009E3F4 0001 + cn Player 2\Character Modifier + 8011B399 ???? 0000:"Azami",0001:"Serina",0002:"Miki",0003:"Kai",0004:"Sakai",0005:"Kengon",0006:"Kyeya",0007:"Kaoru",0008:"Gouriki",0009:"Reiji",000A:"Yami",000B:"Hikari",000C:"Invisible Fighter" + cn Player 2\Infinite Energy + 8111B3BE 03E8 + cn Player 2\No Energy + 8111B3BE 0000 + cn Player 2\P2 Never Wins + 8009E3F5 0000 + cn Player 2\Needs 1 Round to Win + D009E3F5 0000 + 8009E3F5 0001 + cn Have Extra Characters (Gouriki & Reiji) + 8009E3DF 00FF + +crc DEE584A2-0F161187-C:45 +gn Destruction Derby 64 (U) + cn Solo Mode\Infinite Damage Meter + 80125FD9 0026 + cn All Cars and Tracks + 50000602 0000 + 81097A18 0101 + cn All Difficulty Levels + 81097A16 0003 + cn Solo Mode\Vehicles\Baja Buggy + 80097A18 0001 + cn Solo Mode\Vehicles\Low Rider + 80097A19 0001 + cn Solo Mode\Vehicles\Woody Wagon + 80097A1A 0001 + cn Solo Mode\Vehicles\Pickup + 80097A1B 0001 + cn Solo Mode\Vehicles\Taxi Cab + 80097A1C 0001 + cn Solo Mode\Vehicles\Blue Demon + 80097A1D 0001 + cn Solo Mode\Vehicles\Rag Top + 80097A1E 0001 + cn Solo Mode\Vehicles\Hot Rod + 80097A1F 0001 + cn Solo Mode\Vehicles\Ambulance + 80097A20 0001 + cn Solo Mode\Vehicles\Watchback + 80097A21 0001 + cn Solo Mode\Vehicles\Street Rocket + 80097A22 0001 + cn Solo Mode\Vehicles\Police Car + 80097A23 0001 + cn Solo Mode\Tracks\Metro Challenge + 80095CCC 0001 + cn Solo Mode\Tracks\Seascape + 80095CCD 0001 + cn Solo Mode\Tracks\Boyou Run + 80095CCE 0001 + cn Solo Mode\Tracks\Terminal Impact + 80095CCF 0001 + cn Solo Mode\Tracks\Destruction Junction + 80095CD0 0001 + cn Solo Mode\Tracks\Sunset Canyon + 80095CD1 0001 + cn Solo Mode\Tracks\Apline Ridge + 80095CD2 0001 + cn Solo Mode\Tracks\Midnyte Rumble + 80095CD3 0001 + cn Multiplayer\Tracks\The Junkyard + 80095CC8 0001 + cn Multiplayer\Tracks\Have Aztec Ruins + 80095CC9 0001 + cn Multiplayer\Tracks\Urban Mayhem + 80095CCA 0001 + cn Multiplayer\Tracks\Ground Zero + 80095CCB 0001 + cn Multiplayer\Junkyard\Infinite Health\Player 1 + 80205B8B 00BE + cn Multiplayer\Junkyard\Infinite Health\Player 2 + 8021505F 00BE + cn Multiplayer\Aztec Ruins\Infinite Health\Player 1 + 801FC437 00BE + cn Multiplayer\Aztec Ruins\Infinite Health\Player 2 + 80217C5F 00BE + cn Multiplayer\Urban Mayhem\Infinite Health\Player 1 + 8021779F 00BE + cn Multiplayer\Urban Mayhem\Infinite Health\Player 2 + 80235E5F 00BE + cn Multiplayer\Ground Zero\Infinite Health\Player 1 + 801F64D7 00BE + cn Multiplayer\Ground Zero\Infinite Health\Player 2 + 80211D1F 00BE + cn Solo Mode\Seascape Sprint\Infinite Health + D02D4C24 0080 + 802D4C33 00E1 + cn Solo Mode\Metro Challenge\Infinite Health + D02EDB18 0080 + 802EDB27 00E1 + cn Solo Mode\Terminal Impact\Infinite Health + D02B5AA3 0080 + 802B5AB2 00E1 + cn Solo Mode\Destruction Junction\Infinite Health + D029A9B0 0080 + 8029A9BF 00E1 + cn Solo Mode\Midnyte Rumble\Infinite Health + D030C70B 0080 + 8030C71A 00E1 + cn Solo Mode\Bayou Run\Infinite Health + D0285E7C 0080 + 80285E8B 00E1 + cn Solo Mode\Alpine Ridge\Infinite Health + D02B9D24 0080 + 802B9D33 00E1 + cn Solo Mode\Sunset Canyon\Infinite Health + D0303A68 0080 + 80303A77 00E1 + +crc 53D440E7-7519B011-C:45 +gn Diddy Kong Racing (U) (V1.0) + cn Enable All Cheats + cd Go into Options & then Magic Codes. Then Code list to turn off & on what you want. + 50000401 0000 + 810DFD9C FFFF + cn Have All\Trophies + cd Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. + 811FC9DE FFFF + cn Have All\Keys + cd Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. + 811FC9D8 FFFF + cn Have All\Amulets + cd Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. + 811FC9E6 FFFF + cn Boss Cannot Move\Dino + 811DFCF4 44A0 + cn Boss Cannot Move\Octo + 811E045C 44A0 + cn Have All\99 Balloons + 810DFD9A FFFF + 801FCBED 0063 + cn Have All\Levels Completely Finished + 50000904 0000 + 801FCAF7 00FF + 801FCB1F 00FF + 801FCB27 00FF + 50000404 0000 + 801FCB2F 00FF + 801FCB4F 00FF + 50000804 0000 + 801FCB53 00FF + cn Have All\Silver Coins\Ancient Lake + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E34AA 0008 + cn Have All\Silver Coins\Fossil Canyon + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E694A 0008 + cn Have All\Silver Coins\Jungle Falls + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E513A 0008 + cn Have All\Silver Coins\Hot Top Volcano + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E480A 0008 + cn Have All\Silver Coins\Everfrost Peak + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E513A 0008 + cn Have All\Silver Coins\Walrus Cove + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E4C5A 0008 + cn Have All\Silver Coins\Snowball Valley + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E4BDA 0008 + cn Have All\Silver Coins\Frosty Village + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E612A 0008 + cn Have All\Silver Coins\Whale Bay + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E3CDA 0008 + cn Have All\Silver Coins\Pirate Lagoon + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E2B3A 0008 + cn Have All\Silver Coins\Crescent Island + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E3C0A 0008 + cn Have All\Silver Coins\Treasure Caves + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E38FA 0008 + cn Have All\Silver Coins\Boulder Canyon + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E63CA 0008 + cn Have All\Silver Coins\Greenwood Village + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E4C8A 0008 + cn Have All\Silver Coins\Windmill Plains + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E9D9A 0008 + cn Have All\Silver Coins\Haunted Woods + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E4BFA 0008 + cn Have All\50 Bananas\Ancient Lake + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E32CD 0032 + cn Have All\50 Bananas\Fossil Canyon + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E676D 0032 + cn Have All\50 Bananas\Jungle Falls + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E44CD 0032 + cn Have All\50 Bananas\Hot Top Volcano + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E462D 0032 + cn Have All\50 Bananas\Whale Bay + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E3AFD 0032 + cn Have All\50 Bananas\Pirate Lagoon + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E295D 0032 + cn Have All\50 Bananas\Crescent Island + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E3A2D 0032 + cn Have All\50 Bananas\Treasure Caves + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E371D 0032 + cn Have All\50 Bananas\Everfrost Peak + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E4F5D 0032 + cn Have All\50 Bananas\Walrus Cove + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E4A7D 0032 + cn Have All\50 Bananas\Snowball Valley + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E49FD 0032 + cn Have All\50 Bananas\Frosty Village + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E5F4D 0032 + cn Have All\50 Bananas\Boulder Canyon + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E61ED 0032 + cn Have All\50 Bananas\Greenwood Village + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E4AAD 0032 + cn Have All\50 Bananas\Windwill Plains + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E9BBD 0032 + cn Have All\50 Bananas\Haunted Woods + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E4A1D 0032 + cn Have All\50 Bananas\Spacedust Alley + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E654D 0032 + cn Have All\50 Bananas\Darkmoon Caverns + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E5D0D 0032 + cn Have All\50 Bananas\Star City + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E578D 0032 + cn Have All\50 Bananas\Spaceport Alpha + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E3C6D 0032 + cn Have All\The pieces of the TT thing + 801FC9E6 0004 + cn Infinite\Power Ups\Ancient Lake + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E6A2B 0010 + cn Infinite\Power Ups\Boulder Canyon + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E8D4B 0010 + cn Infinite\Power Ups\Crescent Island + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E718B 0010 + cn Infinite\Power Ups\Darkmoon Caverns + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E96AB 0010 + cn Infinite\Power Ups\Everfrost Peak + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E871B 0010 + cn Infinite\Power Ups\Fossil Canyon + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E9ECB 0010 + cn Infinite\Power Ups\Frosty Village + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E96A6 0010 + cn Infinite\Power Ups\Greenwood Village + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E820B 0010 + cn Infinite\Power Ups\Hot Top Volcano + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E477B 0010 + cn Infinite\Power Ups\Haunted Woods + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E817B 0010 + cn Infinite\Power Ups\Jungle Falls + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E45BB 0010 + cn Infinite\Power Ups\Pirate Lagoon + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E54B6 0010 + cn Infinite\Power Ups\Snowball Valley + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E815B 0010 + cn Infinite\Power Ups\Spaceport Alpha + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E676B 0010 + cn Infinite\Power Ups\Space Dust Alley + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E904B 0010 + cn Infinite\Power Ups\Starcity + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E8EEB 0010 + cn Infinite\Power Ups\Treasure Cove + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E6E7B 0010 + cn Infinite\Power Ups\Walrus Cove + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E81DB 0010 + cn Infinite\Power Ups\Whale Bay + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E665B 0010 + cn Infinite\Power Ups\Windmill Plains + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801EC6BB 0010 + +crc E402430D-D2FCFC9D-C:45 +gn Diddy Kong Racing (U) (V1.1) + cn Enable All Cheats + cd Go into Options & then Magic Codes. Then Code list to turn off & on what you want. + 810E031C FFFF + 810E031E FFFF + cn Have All\Trophies + cd Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. + 811FC9DE FFFF + cn Have All\Keys + cd Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. + 811FD1C8 FFFF + cn Have All\Amulets + cd Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. + 811FD1D6 FFFF + cn Boss Cannot Move\Dino + 811E0444 44A0 + cn Boss Cannot Move\Octo + 811E0BAC 44A0 + cn Have All\99 Balloons + 810E058A FFFF + 801FD3DD 0063 + cn Have All\Levels Completely Finished + 50000904 0000 + 801FD2E7 00FF + 801FD30F 00FF + 801FD317 00FF + 50000404 0000 + 801FD31F 00FF + 801FD33F 00FF + 50000804 0000 + 801FD343 00FF + cn Have All\Silver Coins\Ancient Lake + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E3BFA 0008 + cn Have All\Silver Coins\Fossil Canyon + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E709A 0008 + cn Have All\Silver Coins\Jungle Falls + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E588A 0008 + cn Have All\Silver Coins\Hot Top Volcano + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E4F5A 0008 + cn Have All\Silver Coins\Everfrost Peak + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E588A 0008 + cn Have All\Silver Coins\Walrus Cove + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E53AA 0008 + cn Have All\Silver Coins\Snowball Valley + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E532A 0008 + cn Have All\Silver Coins\Frosty Village + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E687A 0008 + cn Have All\Silver Coins\Whale Bay + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E442A 0008 + cn Have All\Silver Coins\Pirate Lagoon + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E328A 0008 + cn Have All\Silver Coins\Crescent Island + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E435A 0008 + cn Have All\Silver Coins\Treasure Caves + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E404A 0008 + cn Have All\Silver Coins\Boulder Canyon + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E6B1A 0008 + cn Have All\Silver Coins\Greenwood Village + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E53DA 0008 + cn Have All\Silver Coins\Windmill Plains + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801EA4EA 0008 + cn Have All\Silver Coins\Haunted Woods + cd Do not use more than 1 Silver Coins up at a time or it will cause a crash + 801E534A 0008 + cn Have All\50 Bananas\Ancient Lake + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E3A1D 0032 + cn Have All\50 Bananas\Fossil Canyon + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E6EBD 0032 + cn Have All\50 Bananas\Jungle Falls + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E4C1D 0032 + cn Have All\50 Bananas\Hot Top Volcano + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E4D7D 0032 + cn Have All\50 Bananas\Whale Bay + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E424D 0032 + cn Have All\50 Bananas\Pirate Lagoon + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E30AD 0032 + cn Have All\50 Bananas\Crescent Island + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E417D 0032 + cn Have All\50 Bananas\Treasure Caves + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E3E6D 0032 + cn Have All\50 Bananas\Everfrost Peak + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E56AD 0032 + cn Have All\50 Bananas\Walrus Cove + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E51CD 0032 + cn Have All\50 Bananas\Snowball Valley + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E514D 0032 + cn Have All\50 Bananas\Frosty Village + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E669D 0032 + cn Have All\50 Bananas\Boulder Canyon + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E693D 0032 + cn Have All\50 Bananas\Greenwood Village + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E51FD 0032 + cn Have All\50 Bananas\Windwill Plains + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801EA30D 0032 + cn Have All\50 Bananas\Haunted Woods + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E516D 0032 + cn Have All\50 Bananas\Spacedust Alley + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E6C9D 0032 + cn Have All\50 Bananas\Darkmoon Caverns + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E645D 0032 + cn Have All\50 Bananas\Star City + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E5EDD 0032 + cn Have All\50 Bananas\Spaceport Alpha + cd Do not use more than 1 50 Bananas up at a time or it will cause a crash + 801E43BD 0032 + cn Have All\The pieces of the TT thing + 801FD1D6 0004 + cn Infinite\Power Ups\Ancient Lake + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E717B 0010 + cn Infinite\Power Ups\Boulder Canyon + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E949B 0010 + cn Infinite\Power Ups\Crescent Island + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E78DB 0010 + cn Infinite\Power Ups\Darkmoon Caverns + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E9DFB 0010 + cn Infinite\Power Ups\Everfrost Peak + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E8E6B 0010 + cn Infinite\Power Ups\Fossil Canyon + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801EA61B 0010 + cn Infinite\Power Ups\Frosty Village + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E9DF6 0010 + cn Infinite\Power Ups\Greenwood Village + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E895B 0010 + cn Infinite\Power Ups\Hot Top Volcano + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E4ECB 0010 + cn Infinite\Power Ups\Haunted Woods + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E88CB 0010 + cn Infinite\Power Ups\Jungle Falls + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E4D0B 0010 + cn Infinite\Power Ups\Pirate Lagoon + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E5C06 0010 + cn Infinite\Power Ups\Snowball Valley + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E88AB 0010 + cn Infinite\Power Ups\Spaceport Alpha + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E6EBB 0010 + cn Infinite\Power Ups\Space Dust Alley + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E979B 0010 + cn Infinite\Power Ups\Starcity + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E963B 0010 + cn Infinite\Power Ups\Treasure Cove + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E75CB 0010 + cn Infinite\Power Ups\Walrus Cove + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E892B 0010 + cn Infinite\Power Ups\Whale Bay + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801E6DAB 0010 + cn Infinite\Power Ups\Windmill Plains + cd For Track Race Only.Do not use more than 1 Infinite Power up at a time or it will cause a crash + 801ECE0B 0010 + +crc C16C421B-A21580F7-C:45 +gn Disney's Donald Duck - Goin' Quackers (U) + cn Infinite\99 Lives + 801D72AE 0063 + cn Infinite\99 Stars + 801D72AF 0063 + cn Instant\Rage Attack (Press C-Left) + D00CB2A1 0002 + 801CE5BD 0001 + cn Instant\Hyperactive State [Invincible] (Press C-Right) + D00CB2A1 0001 + 801CE616 0001 + cn Instant\Carrier Box [Moon Walk] (Press L) + cd Press and hold the L Button and you will run floating of any ledge slowing drifting down. If you keep pressing the A Button while Holding L it will act as a Moon Jump. + D00CB2A1 0020 + 801C939F 0001 + cn Infinite\Time\Gladstones Time Attack + 801D72A7 00FF + cn Infinite\Time\Nephews Toy Hunting + 801D72A3 0063 + cn Have All\Levels and Bonus Stages Unlocked + cd Press start in Gyro's Lab and then resume game to see all open + 801D72CC 00FF + 801D72CD 00FF + 801D72CE 00FF + 801D72CF 00FF + 801D72D3 00FF + cn Have All\Time Attack & Toy Hunting Comnpleated (All Levels) + cd Press start in Gyro's Lab and then resume game to see all open + 801D72D8 00FF + 801D72D9 00FF + 801D72DA 00FF + 801D72DB 00FF + 801D72DC 00FF + 801D72DD 00FF + 801D72DE 00FF + 801D72DF 00FF + +crc CBFE69C7-F2C0AB2A-C:45 +gn Disney's Tarzan (U) + cn Infinite\Health + 811921C0 0120 + cn Have\Coins Collected 100% + 800DD257 0064 + cn Have\Level & Tokens Completed 100% + 800DD22F 0000 + 800DD230 0001 + 800DD231 0000 + cn Access Level Select + cd On the main menu Scroll down to make CHEATS visible to go into Level Select.For in-Game Cheats,Pause gameplay. + 810DD21C 8001 + cn Infinite\Lives + 800DD252 ???? 0003:"3 Lives",0063:"99 Lives" + cn Have\All TARZAN Letters + 800DD225 00FF + cn Have\Full Portrait + 800DD224 00FF + cn Infinite\Red Weapon + 81192098 0063 + cn Infinite\Green Weapon + 81192096 0063 + cn Infinite\Purple Weapon + 8119209A 0063 + cn Press GS For\Sabor Attacks\Sabor 1 Hit Kill + 8924A23E 0001 + cn Infinite\Bonus Timer + cd This is For All Timers on Bonus Levels + 801735FE 0025 + +crc EC58EABF-AD7C7169-C:45 +gn Donkey Kong 64 (U) + cn Donkey Kong\Infinite Ammo + 807FCC45 0096 + cn Infinite\Health + 817FCC4C 041F + cn Donkey Kong\Infinite Musical Instrument + 817FC954 0103 + 817FC958 00FF + cn Diddy\Infinite Musical Instrument + 817FC9B6 000A + cn Tiny\Infinite Musical Instrument + 817FCA72 000A + cn Lanky\Infinite Musical Instrument + 817FCA14 000A + cn Chunky\Infinite Musical Instrument + 817FCAD0 000A + cn Infinite\Camera Film + 807FCC49 0005 + cn Infinite\Orange Bombs + 807FCC41 0096 + cn Donkey Kong\Infinite Bananas\Jungle Japes + 817FC95A 03E7 + cn Donkey Kong\Infinite Bananas\Angry Aztec + 817FC95C 03E7 + cn Donkey Kong\Infinite Bananas\FactoryLevel + 817FC95E 03E7 + cn Donkey Kong\Infinite Bananas\Galleon Level + 817FC9BE 03E7 + cn Donkey Kong\Infinite Bananas\Fungi Forest + 817FC962 03E7 + cn Donkey Kong\Infinite Bananas\Creepy Castle + 817FC966 03E7 + cn Donkey Kong\Infinite Bananas\Crystal Caves + 817FC964 03E7 + cn Donkey Kong\All Golden Bananas\Jungle Japes + 817FC992 03E7 + cn Donkey Kong\All Golden Bananas\Angry Aztecs + 817FC994 03E7 + cn Donkey Kong\All Golden Bananas\Frantic Factory + 817FC996 03E7 + cn Donkey Kong\All Golden Bananas\Gloomy Galleon + 817FC998 03E7 + cn Donkey Kong\All Golden Bananas\Crystal Caves + 817FC99C 03E7 + cn Donkey Kong\All Golden Bananas\Creepy Castle + 817FC99E 03E7 + cn Donkey Kong\All Golden Bananas\DK Isle + 817FC9A0 03E7 + cn Diddy\All Golden Bananas\Jungle Japes + 817FC9F0 0064 + cn Diddy\All Golden Bananas\Angry Aztecs + 817FC9F2 0064 + cn Diddy\All Golden Bananas\Frantic Factory + 817FC9F4 0064 + cn Diddy\All Golden Bananas\Gloomy Galleon + 817FC9F6 0064 + cn Diddy\All Golden Bananas\Fungi Forest + 817FC9F8 0064 + cn Diddy\All Golden Bananas\Crystal Caves + 817FC9FA 0064 + cn Diddy\All Golden Bananas\Creepy Castle + 817FC9FC 0064 + cn Diddy\All Golden Bananas\DK Isle + 817FC9FE 0064 + cn Tiny\All Golden Bananas\Jungle Japes + 817FCAAC 0064 + cn Tiny\All Golden Bananas\Angry Aztecs + 817FCAAE 0064 + cn Tiny\All Golden Bananas\Frantic Factory + 817FCAB0 0064 + cn Tiny\All Golden Bananas\Gloomy Galleon + 817FCAB2 0064 + cn Tiny\All Golden Bananas\Fungi Forest + 817FCAB4 0064 + cn Tiny\All Golden Bananas\Crystal Caves + 817FCAB6 0064 + cn Tiny\All Golden Bananas\Creepy Castle + 817FCAA8 0064 + cn Tiny\All Golden Bananas\DK Isle + 817FCABA 0064 + cn Lanky\All Golden Bananas\Jungle Japes + 817FCA4E 0064 + cn Lanky\All Golden Bananas\Angry Aztecs + 817FCA50 0064 + cn Lanky\All Golden Bananas\Frantic Factory + 817FCA52 0064 + cn Lanky\All Golden Bananas\Gloomy Galleon + 817FCA54 0064 + cn Lanky\All Golden Bananas\Fungi Forest + 817FCA56 0064 + cn Lanky\All Golden Bananas\Crystal Caves + 817FCA58 0064 + cn Lanky\All Golden Bananas\Creepy Castle + 817FCA5A 0064 + cn Lanky\All Golden Bananas\DK Isle + 817FCA5C 0064 + cn Chunky\All Golden Bananas\Jungle Japes + 817FCB0A 0064 + cn Chunky\All Golden Bananas\Angry Aztecs + 817FCB0C 0064 + cn Chunky\All Golden Bananas\Frantic Factory + 817FCB0E 0064 + cn Chunky\All Golden Bananas\Gloomy Galleon + 817FCB10 0064 + cn Chunky\All Golden Bananas\Fungi Forest + 817FCB12 0064 + cn Chunky\All Golden Bananas\Crystal Caves + 817FCB14 0064 + cn Chunky\All Golden Bananas\Creepy Castle + 817FCB16 0064 + cn Chunky\All Golden Bananas\DK Isle + 817FCB18 0064 + cn Donkey Kong\Infinite Coins + 817FC956 03E7 + cn Diddy\Infinite Coins + 817FC9B4 03E7 + cn Tiny\Infinite Coins + 817FCA70 03E7 + cn Lanky\Infinite Coins + 817FCA12 03E7 + cn Chunky\Infinite Coins + 817FCACE 03E7 + cn Infinite\Crystal Coconuts + 807FCB87 0096 + cn Donkey Kong\Has Moves + 817FC950 0103 + cn Donkey Kong\Have Weapon + 817FC952 0103 + cn Free Pass (Access All Areas) + cd This is exactly what it says, You can walk through Any Locked Door,Gate, Or Area. Have Fun. + 8066D226 0001 + 8066D321 0001 + +crc A83E101A-E937B69D-C:45 +gn Doom64 (U) v1.0 + cn Always Have\Gun + 800632C3 0001 + cn Always Have\Shotgun + 800632C7 0001 + cn Always Have\Double Shotgun + 800632CB 0001 + cn Always Have\Chain Gun + 800632CF 0001 + cn Always Have\Missile Launcher + 800632D3 0001 + cn Always Have\Chainsaw + 800632BB 0001 + cn Always Have\Plasma Rifle + 800632D7 0001 + cn Always Have\BFG 9000 + 800632DB 0001 + cn Always Have\Have Rocket Launcher + 800632D1 0001 + cn Always Have\Laser Weapon + 800632DD 0001 + cn Always Have\Bio Suite + 80063283 ???? 00FF:"On",0000:"Off" + cn Infinite\Armor + 8006326F 00FF + cn Rapid Fire + 8106333A 0B94 + cn Invincible + 8006330B 0002 + cn Turn Map Markers On + 8006330B 0004 + cn Invincible And Map Markers + 8006330B 0006 + cn Berserk Mode + 8006327B 00FF + cn [Max Brightness] + cd Enable this cheat on rom load to have Max Brightness (internal) and then put Jabo d3d8 on 160% Max for a extra brightness Boost. + 8005A7C8 0064 + cn Have All\Weapons + 50000A04 0000 + 810632BA 0001 + cn Infinite\Ammo All Weapons + 50000404 0000 + 810632E2 013C + cn Have All\Keys + 50000504 0000 + 8106328E FFFF + cn Enable Cheat Menu + 8005A7D3 0001 + +crc 423E96F4-CE88F05B-C:45 +gn Doom64 (U) v1.1 + cn Always Have\Gun + 80063373 0001 + cn Always Have\Shotgun + 80063377 0001 + cn Always Have\Double Shotgun + 8006337B 0001 + cn Always Have\Chain Gun + 8006337F 0001 + cn Always Have\Missile Launcher + 80063383 0001 + cn Always Have\Chainsaw + 8006336B 0001 + cn Always Have\Plasma Rifle + 80063387 0001 + cn Always Have\BFG 9000 + 8006338B 0001 + cn Always Have\Have Rocket Launcher + 80063381 0001 + cn Always Have\Laser Weapon + 8006338F FFFF + cn Always Have\Bio Suite + 80063333 ???? 00FF:"On",0000:"Off" + cn Infinite\Armor + 8006331F 00FF + cn Rapid Fire + 810633EA 0B94 + cn Invincible + 800633BB 0002 + cn Turn Map Markers On + 800633BB 0004 + cn Invincible And Map Markers + 800633BB 0006 + cn Berserk Mode + 8006332B 00FF + cn [Max Brightness] + cd Enable this cheat on rom load to have Max Brightness (internal) and then put Jabo d3d8 on 160% Max for a extra brightness Boost. + 8005A878 0064 + cn Infinite\Ammo All Weapons + 80063393 00FF + 80063397 00FF + 8006339B 00FF + 8006339F 00FF + cn Have All Keys + 8006333F 0001 + 80063343 0001 + 80063344 0001 + 80063353 0001 + 8006334F 0001 + 80063348 0001 + cn Enable Cheat Menu + 8005A883 0001 + +crc A62230C3-F0834488-C:45 +gn Dual Heroes (U) + cn Player 1\Infinite Energy + D022671C 0000 + 8122671C 00FA + cn Player 2\Infinite Energy + D022671E 0000 + 8122671E 00FA + cn Infinite Time + D0226724 0000 + 81226724 003C + cn Player 1\Never Wins + D0226715 0001 + 80226715 0000 + cn Player 2\1 Win To Win + D0226717 0000 + 80226717 0001 + cn Player 2\Never Wins + D0226717 0001 + 80226717 0000 + cn Player 1\1 Win To Win + D0226715 0000 + 80226715 0001 + cn Player 1\No Energy + D022671C 0000 + 8122671C 0000 + cn Player 2\No Energy + D022671E 0000 + 8122671E 0000 + cn Player 1\Infinite Time To Continue + 802267CB 0009 + 803CF2A1 0009 + cn Only Play One Round + D0226791 0000 + 81226718 0001 + cn Player 2\Lifebar Flashes Red + D022672E 0000 + 8122672E 00CF + +crc FBB9F1FA-6BF88689-C:45 +gn Duck Dodgers Starring Daffy Duck (U) + cn Infinite\Lives + 80026A67 0063 + cn Infinite\Quarks + 81159282 FFFF + cn Infinite\Atoms + 81159286 FFFF + +crc A273AB56-DA33DB9A-C:45 +gn Duke Nukem 64 (U) + cn In-Game Cheats\Open Cheat Menu + 801012D8 0001 + cn In-Game Cheats\Open Invincibility Cheat + 801012DC 0001 + cn In-Game Cheats\Open Monsters Cheat + 801012E0 0001 + cn In-Game Cheats\Open All Items Cheat + 801012E4 0001 + cn In-Game Cheats\Open Goto Level ?? Cheat + 801012E8 0001 + cn Infinite Night Vision + 812A5A5C 0640 + cn Infinite Holoduke + 812A5A2C 0640 + cn Infinite Portable Medikit + 812A5A4A 0064 + cn Infinite Protective Boots + 812A5AA2 00C8 + cn In-Game Cheats\Invincibility Cheat On + 802AAA68 0001 + cn In-Game Cheats\Invincibility Cheat Off + 802AAA68 0000 + cn In-Game Cheats\Monsters Cheat On + 802AABDB 0000 + cn In-Game Cheats\Monsters Cheat Off + 802AABDB 0001 + cn Infinite\Armor + 812A5A92 0064 + cn Infinite\Vitamin K + 812A5A90 0190 + cn Infinite\Jet Pack + 812A5A8E 0640 + cn Infinite\Scuba Gear + 812A5A8C 1900 + cn Have All Keys + 802A5A47 000F + cn Player 1\Infinite Health\Hollywood Holocaust + 80247463 00FF + cn Player 1\Infinite Health\Gun Crazy + 80247D53 00FF + cn Player 1\Infinite Health\Death Row + 80246E5F 00FF + cn Player 1\Infinite Health\Toxic Dump + 80246D83 00FF + cn Player 1\Infinite Health\Launch Facility + 80248223 00FF + cn Player 1\Infinite Health\The Abyss + 80246E07 00FF + cn Player 1\Infinite Health\Battleload + 80246F67 00FF + cn Player 1\Infinite Health\Duke Burger + 8024761B 00FF + cn Player 1\Infinite Health\Spaceport + 8024735B 00FF + cn Player 1\Infinite Health\Incubator + 80246D2B 00FF + cn Player 1\Infinite Health\Warp Factor + 8024709B 00FF + cn Player 1\Infinite Health\Fusion Station + 80247723 00FF + cn Player 1\Infinite Health\Occupied Territory + 80246DDB 00FF + cn Player 1\Infinite Health\Tiberius Station + 80246CA7 00FF + cn Player 1\Infinite Health\Lunar Reactor + 80246C4F 00FF + cn Player 1\Infinite Health\Dark Side + 802473B3 00FF + cn Player 1\Infinite Health\Dread Nought + 80246D2B 00FF + cn Player 1\Infinite Health\Overlord + 80247513 00FF + cn Player 1\Infinite Health\Lunatic Fringe + 80246D2B 00FF + cn Player 1\Infinite Health\Raw Meat + 80246DDB 00FF + cn Player 1\Infinite Health\Bank Roll + 802471A3 00FF + cn Player 1\Infinite Health\Flood Zone + 80246D2B 00FF + cn Player 1\Infinite Health\L.A. Rumble + 80246EE3 00FF + cn Player 1\Infinite Health\Movie Set + 80246DAF 00FF + cn Player 1\Infinite Health\Rabit Transit + 8024869B 00FF + cn Player 1\Infinite Health\Fahrenheith + 8024735B 00FF + cn Player 1\Infinite Health\Hotel Hell + 80246D83 00FF + cn Player 1\Infinite Health\Stadium + 8024979F 00FF + cn Player 1\Infinite Health\Area 51 + 8024774F 00FF + cn Player 1\Infinite Health\Free Way + 80247E5B 00FF + cn Player 1\Infinite Health\Castle Dukenstein + 802490BF 00FF + cn Player 1\Infinite Health\Piracy + 80247673 00FF + cn Player 1\Infinite Health\Shaft + 80247AEB 00FF + cn Player 1\Infinite Health\Noctis Labyrinthus + 80247C1F 00FF + cn Player 2\Infinite Health\Hollywood Holocaust + 8124D526 00FF + cn Player 2\Infinite Health\Gun Crazy + 8124E57A 00FF + cn Player 2\Infinite Health\Death Row + 8124AFAE 00FF + cn Player 2\Infinite Health\Toxic Dump + 81251BCA 00FF + cn Player 2\Infinite Health\Launch Facility + 8124AEA6 00FF + cn Player 2\Infinite Health\The Abyss + 8124FD5E 00FF + cn Player 2\Infinite Health\BattleLord + 81246CFE 00FF + cn Player 2\Infinite Health\Spaceport + 8124B13A 00FF + cn Player 2\Infinite Health\Incubator + 8124CEF6 00FF + cn Player 2\Infinite Health\Warp Factor + 8124ED8E 00FF + cn Player 2\Infinite Health\Fusion Station + 81250336 00FF + cn Player 2\Infinite Health\Occupied Territory + 8124AC96 00FF + cn Player 2\Infinite Health\Tiberius Station + 8124C8F2 00FF + cn Player 2\Infinite Health\Lunar Reactor + 81247C1E 00FF + cn Player 2\Infinite Health\Dark Side + 8124E1DE 00FF + cn Player 2\Infinite Health\Dreadnought + 81249562 00FF + cn Player 2\Infinite Health\Overlord + 81247646 00FF + cn Player 2\Infinite Health\Raw Meat + 8124E052 00FF + cn Player 2\Infinite Health\Bank Roll + 8124DE6E 00FF + cn Player 2\Infinite Health\Flood Zone + 8124D736 00FF + cn Player 2\Infinite Health\L.A. Rumble + 8124BF52 00FF + cn Player 2\Infinite Health\Movie Set + 81248382 00FF + cn Player 2\Infinite Health\Rabid Transit + 8124D86A 00FF + cn Player 2\Infinite Health\Fahrenheit + 8124A1C2 00FF + cn Player 2\Infinite Health\Hotel Hell + 8124D526 00FF + cn Player 2\Infinite Health\Stadium + 8124924A 00FF + cn Player 2\Infinite Health\Castle Dukenstein + 81249092 00FF + cn Player 2\Infinite Health\Piracy + 81248ABA 00FF + cn Player 2\Infinite Health\Shaft + 812477A6 00FF + cn Player 3\Infinite Health\Hollywood Holocaust + 8124BC0E 00FF + cn Player 3\Infinite Health\Gun Crazy + 8124C086 00FF + cn Player 3\Infinite Health\Death Row + 8124AF2A 00FF + cn Player 3\Infinite Health\Toxic Dump + 8125051A 00FF + cn Player 3\Infinite Health\Launch Facility + 8124AD9E 00FF + cn Player 3\Infinite Health\The Abyss + 8124FD32 00FF + cn Player 3\Infinite Health\BattleLord + 81246CD2 00FF + cn Player 3\Infinite Health\Spaceport + 8124B10E 00FF + cn Player 3\Infinite Health\Incubator + 8124B1EA 00FF + cn Player 3\Infinite Health\Warp Factor + 812482FE 00FF + cn Player 3\Infinite Health\Fusion Station + 8125030A 00FF + cn Player 3\Infinite Health\Occupied Territory + 8124AC6A 00FF + cn Player 3\Infinite Health\Tiberius Station + 8124C8C6 00FF + cn Player 3\Infinite Health\Lunar Reactor + 81247BF2 00FF + cn Player 3\Infinite Health\Dark Side + 8124E1B2 00FF + cn Player 3\Infinite Health\Dreadnought + 81249536 00FF + cn Player 3\Infinite Health\Overlord + 81246EB6 00FF + cn Player 3\Infinite Health\Raw Meat + 8124E026 00FF + cn Player 3\Infinite Health\Bank Roll + 8124992A 00FF + cn Player 3\Infinite Health\Flood Zone + 8124D70A 00FF + cn Player 3\Infinite Health\L.A. Rumble + 8124BF26 00FF + cn Player 3\Infinite Health\Movie Set + 81248356 00FF + cn Player 3\Infinite Health\Rabid Transit + 8124D83E 00FF + cn Player 3\Infinite Health\Fahrenheit + 8124A196 00FF + cn Player 3\Infinite Health\Hotel Hell + 8124D4FA 00FF + cn Player 3\Infinite Health\Stadium + 8124921E 00FF + cn Player 3\Infinite Health\Castle Dukenstein + 81248432 00FF + cn Player 3\Infinite Health\Piracy + 81248A8E 00FF + cn Player 3\Infinite Health\Shaft + 8124777A 00FF + cn Player 4\Infinite Health\Hollywood Holocaust + 8124B76A 00FF + cn Player 4\Infinite Health\Gun Crazy + 8124B922 00FF + cn Player 4\Infinite Health\Death Row + 8124AEFE 00FF + cn Player 4\Infinite Health\Toxic Dump + 8124DDBE 00FF + cn Player 4\Infinite Health\Launch Facility + 8124AD1A 00FF + cn Player 4\Infinite Health\The Abyss + 8124E3C2 00FF + cn Player 4\Infinite Health\BattleLord + 81246CA6 00FF + cn Player 4\Infinite Health\Spaceport + 8124979E 00FF + cn Player 4\Infinite Health\Incubator + 81247F0A 00FF + cn Player 4\Infinite Health\Warp Factor + 812482D2 00FF + cn Player 4\Infinite Health\Fusion Station + 81248172 00FF + cn Player 4\Infinite Health\Occupied Territory + 8124AC3E 00FF + cn Player 4\Infinite Health\Tiberius Station + 8124C89A 00FF + cn Player 4\Infinite Health\Lunar Reactor + 81247BC6 00FF + cn Player 4\Infinite Health\Dark Side + 81247932 00FF + cn Player 4\Infinite Health\Dreadnought + 8124950A 00FF + cn Player 4\Infinite Health\Overlord + 81246E8A 00FF + cn Player 4\Infinite Health\Raw Meat + 8124DFFA 00FF + cn Player 4\Infinite Health\Bank Roll + 812498FE 00FF + cn Player 4\Infinite Health\Flood Zone + 81247F36 00FF + cn Player 4\Infinite Health\L.A. Rumble + 8124A3A6 00FF + cn Player 4\Infinite Health\Movie Set + 8124832A 00FF + cn Player 4\Infinite Health\Rabid Transit + 8124B1BE 00FF + cn Player 4\Infinite Health\Fahrenheit + 8124A16A 00FF + cn Player 4\Infinite Health\Hotel Hell + 8124C68A 00FF + cn Player 4\Infinite Health\Stadium + 812491C6 00FF + cn Player 4\Infinite Health\Castle Dukenstein + 81248406 00FF + cn Player 4\Infinite Health\Piracy + 81248A62 00FF + cn Player 4\Infinite Health\Shaft + 8124774E 00FF + cn Player 1\Have\Boots + 802A5AB9 0001 + cn Player 1\Have\Pistol + 802A5ABA 0001 + cn Player 1\Have\Shotgun + 802A5ABB 0001 + cn Player 1\Have\SMG + 802A5ABC 0001 + cn Player 1\Have\Grenade Launcher + 802A5ABD 0001 + cn Player 1\Have\Pipe Bombs + 802A5ABE 0001 + cn Player 1\Have\Shrinker + 802A5ABF 0001 + cn Player 1\Have\Expander + 802A5AC0 0001 + cn Player 1\Have\Missile Launcher + 802A5AC1 0001 + cn Player 1\Have\Plasma Cannon + 802A5AC2 0001 + cn Player 1\Have\Laser Trip Bomb + 802A5AC3 0001 + cn Player 1\Infinite Ammo\Pistol + 802A5A01 00FF + cn Player 1\Infinite Ammo\Shotgun + 802A5A03 00FF + cn Player 1\Infinite Ammo\SMG's + 802A5A05 00FF + cn Player 1\Infinite Ammo\Grenade Launcher + 802A5A07 00FF + cn Player 1\Infinite Ammo\Pipe Bombs + 802A5A09 00FF + cn Player 1\Infinite Ammo\Shrinker + 802A5A0B 00FF + cn Player 1\Infinite Ammo\Expander + 802A5A0D 00FF + cn Player 1\Infinite Ammo\Missile Launcher + 802A5A0F 00FF + cn Player 1\Infinite Ammo\Plasma Cannon + 802A5A11 00FF + cn Player 1\Infinite Ammo\Laser Trip Bomb + 802A5A13 00FF + cn Player 2\Have\Boots + 802A5E45 0001 + cn Player 2\Have\Pistol + 802A5E46 0001 + cn Player 2\Have\Shotgun + 802A5E47 0001 + cn Player 2\Have\SMG + 802A5E48 0001 + cn Player 2\Have\Grenade Launcher + 802A5E49 0001 + cn Player 2\Have\Pipe Bomb + 802A5E4A 0001 + cn Player 2\Have\Shrinker + 802A5E4B 0001 + cn Player 2\Have\Expander + 802A5E4C 0001 + cn Player 2\Have\Missle Launcher + 802A5E4D 0001 + cn Player 2\Have\Plasma Cannon + 802A5E4E 0001 + cn Player 2\Have\Laser Trip Bomb + 802A5E4F 0001 + cn Player 2\Infinite Ammo\Pistol + 802A5D8C 00FF + cn Player 2\Infinite Ammo\Shotgun + 802A5D8F 00FF + cn Player 2\Infinite Ammo\SMG's + 802A5D91 00FF + cn Player 2\Infinite Ammo\Grenade Launcher + 802A5D93 00FF + cn Player 2\Infinite Ammo\Pipe Bombs + 802A5D95 00FF + cn Player 2\Infinite Ammo\Shrinker + 802A5D97 00FF + cn Player 2\Infinite Ammo\Expander + 802A5D99 00FF + cn Player 2\Infinite Ammo\Missile Launcher + 802A5D9B 00FF + cn Player 2\Infinite Ammo\Laser Trip Bomb + 802A5D9D 00FF + cn Player 2\Infinite Ammo\Plasma Cannon + 802A5D9F 00FF + cn Player 3\Have\Boots + 802A61D1 0001 + cn Player 3\Have\Pistol + 802A61D2 0001 + cn Player 3\Have\Shotgun + 802A61D3 0001 + cn Player 3\Have\SMG + 802A61D4 0001 + cn Player 3\Have\Grenade Launcher + 802A61D5 0001 + cn Player 3\Have\Pipe Bomb + 802A61D6 0001 + cn Player 3\Have\Shrinker + 802A61D7 0001 + cn Player 3\Have\Expander + 802A61D8 0001 + cn Player 3\Have\Missle Launcher + 802A61D9 0001 + cn Player 3\Have\Plasma Cannon + 802A61DA 0001 + cn Player 3\Have\Laser Trip Bomb + 802A61DB 0001 + cn Player 3\Infinite Ammo\Pistol + 802A6119 00FF + cn Player 3\Infinite Ammo\Shotgun + 802A611B 00FF + cn Player 3\Infinite Ammo\SMG's + 802A611D 00FF + cn Player 3\Infinite Ammo\Grenade Launcher + 802A611F 00FF + cn Player 3\Infinite Ammo\Pipe Bombs + 802A6121 00FF + cn Player 3\Infinite Ammo\Shrinker + 802A6123 00FF + cn Player 3\Infinite Ammo\Expander + 802A6125 00FF + cn Player 3\Infinite Ammo\Missile Launcher + 802A6127 00FF + cn Player 3\Infinite Ammo\Laser Trip Bomb + 802A6129 00FF + cn Player 3\Infinite Ammo\Plasma Cannon + 802A612B 00FF + cn Player 4\Have\Boots + 802A655D 0001 + cn Player 4\Have\Pistol + 802A655E 0001 + cn Player 4\Have\SMG + 802A655F 0001 + cn Player 4\Have\Submachine Guns + 802A6560 0001 + cn Player 4\Have\Grenade Launcher + 802A6561 0001 + cn Player 4\Have\Pipe Bomb + 802A6562 0001 + cn Player 4\Have\Shrinker + 802A6563 0001 + cn Player 4\Have\Expander + 802A6564 0001 + cn Player 4\Have\Missle Launcher + 802A6565 0001 + cn Player 4\Have\Plasma Cannon + 802A6566 0001 + cn Player 4\Have\Laser Trip Bomb + 802A6567 0001 + cn Player 4\Infinite Ammo\Pistol + 802A64A5 00FF + cn Player 4\Infinite Ammo\Shotgun + 802A64A7 00FF + cn Player 4\Infinite Ammo\SMG's + 802A64A9 00FF + cn Player 4\Infinite Ammo\Grenade Launcher + 802A64AB 00FF + cn Player 4\Infinite Ammo\Pipe Bombs + 802A64AD 00FF + cn Player 4\Infinite Ammo\Shrinker + 802A64AF 00FF + cn Player 4\Infinite Ammo\Expander + 802A64B1 00FF + cn Player 4\Infinite Ammo\Missile Launcher + 802A64B3 00FF + cn Player 4\Infinite Ammo\Laser Trip Bomb + 802A64B5 00FF + cn Player 4\Infinite Ammo\Plasma Cannon + 802A64B7 00FF + +crc DF574191-9EB5123D-C:45 +gn Earthworm Jim 3D (U) + cn Infinite Egg Chucker Ammo + 800C69BF 00FA + cn Infinite Cleaver Ammo + 800C6A1F 00FA + cn Infinite Blaster Ammo + 810C6916 03E7 + cn Infinite Rocket Launcher Ammo + 810C6946 03E7 + cn Infinite Banana Peel Ammo + 810C6976 03E7 + cn Infinite Green Slimer Ammo + 810C69A6 03E7 + cn Infinite Shotgun Ammo + 810C69EE 03E7 + cn Infinite Music Gun Ammo + 810C6A06 03E7 + cn Infinite Boomerang Knives Ammo + 810C6A1E 03E7 + cn Infinite Mushroom Ammo + 810C6E36 03E7 + cn Have 231 Marbles + D00E9FF3 0000 + 800E9FF3 03E7 + cn Infinite Health + 800C690F 0064 + cn Infinite Lives + 800C6913 0063 + cn Infinite Laser Ammo + 800C6917 00FA + cn Have All Gold Udders + 50002802 0000 + 810C625A 0101 + +crc BDF9766D-BD068D70-C:45 +gn ECW Hardcore Revolut (U) + cn VS & Tournment Mode\Player 1\Infinite Health + D02931FD 0029 + 81293380 0000 + D02931FD 0029 + 81293382 0000 + cn VS & Tournment Mode\Player 1\Infinite Health + D02931FD 0029 + 81293380 00FF + D02931FD 0029 + 81293382 00FF + cn VS & Tournment Mode\Player 1\Super Strength + D02931FD 0029 + 812933DA FFFF + cn VS & Tournment Mode\Player 1\Invincible + D02931FD 0029 + 812933DE FFFF + cn VS & Tournment Mode\Player 1\Super Speed + D02931FD 0029 + 812933E2 FFFF + cn VS & Tournment Mode\Player 1\Super Stamina + D02931FD 0029 + 812933E6 FFFF + cn VS & Tournment Mode\Player 1\Instant Recovery + D02931FD 0029 + 812933EA FFFF + cn VS & Tournment Mode\Player 1\Can't Be Pinned + D02931FD 0029 + 8129330A FFFF + cn VS & Tournment Mode\Player 1\Can't Be Counted Out + D02931FD 0029 + 8129327E 0384 + cn VS & Tournment Mode\Player 2\Infinite Health + D02931FD 0029 + 81294620 0000 + D02931FD 0029 + 81294622 0000 + cn VS & Tournment Mode\Player 2\Infinite Health + D02931FD 0029 + 81294620 00FF + D02931FD 0029 + 81294622 00FF + cn VS & Tournment Mode\Player 2\Super Strength + D02931FD 0029 + 8129467A FFFF + cn VS & Tournment Mode\Player 2\Invincible + D02931FD 0029 + 8129467E FFFF + cn VS & Tournment Mode\Player 2\Super Speed + D02931FD 0029 + 81294682 FFFF + cn VS & Tournment Mode\Player 2\Super Stamina + D02931FD 0029 + 81294686 FFFF + cn VS & Tournment Mode\Player 2\Instant Recovery + D02931FD 0029 + 8129468A FFFF + cn VS & Tournment Mode\Player 2\Can't Be Pinned + D02931FD 0029 + 812945AA FFFF + cn VS & Tournment Mode\Player 2\Can't Be Counted Out + D02931FD 0029 + 8129451E 0384 + cn All Tag Team Modes\Player 1\Infinite Health + D029A98D 0029 + 8129AB10 0000 + D029A98D 0029 + 8129AB12 0000 + cn All Tag Team Modes\Player 1\Infinite Health + D029A98D 0029 + 8129AB10 00FF + D029A98D 0029 + 8129AB12 00FF + cn All Tag Team Modes\Player 1\Super Strength + D029A98D 0029 + 8129AB6A FFFF + cn All Tag Team Modes\Player 1\Invincible + D029A98D 0029 + 8129AB6E FFFF + cn All Tag Team Modes\Player 1\Super Speed + D029A98D 0029 + 8129AB72 FFFF + cn All Tag Team Modes\Player 1\Super Stamina + D029A98D 0029 + 8129AB76 FFFF + cn All Tag Team Modes\Player 1\Instant Recovery + D029A98D 0029 + 8129AB7A FFFF + cn All Tag Team Modes\Player 1\Can't Be Pinned + D029A98D 0029 + 8129AA9A FFFF + cn All Tag Team Modes\Player 1\Can't Be Counted Out + D029A98D 0029 + 8129AA0E 0384 + cn All Tag Team Modes\Player 2\Infinite Health + D029A98D 0029 + 8129BDB0 0000 + D029A98D 0029 + 8129BDB2 0000 + cn All Tag Team Modes\Player 2\Infinite Health + D029A98D 0029 + 8129BDB0 00FF + D029A98D 0029 + 8129BDB2 00FF + cn All Tag Team Modes\Player 2\Super Strength + D029A98D 0029 + 8129BE0A FFFF + cn All Tag Team Modes\Player 2\Invincible + D029A98D 0029 + 8129BE0E FFFF + cn All Tag Team Modes\Player 2\Super Speed + D029A98D 0029 + 8129BE12 FFFF + cn All Tag Team Modes\Player 2\Super Stamina + D029A98D 0029 + 8129BE16 FFFF + cn All Tag Team Modes\Player 2\Instant Recovery + D029A98D 0029 + 8129BE1A FFFF + cn All Tag Team Modes\Player 2\Can't Be Pinned + D029A98D 0029 + 8129BD3A FFFF + cn All Tag Team Modes\Player 2\Can't Be Counted Out + D029A98D 0029 + 8129BCAE 0384 + cn All Tag Team Modes\Player 3\Infinite Health + D029A98D 0029 + 8129D050 0000 + D029A98D 0029 + 8129D052 0000 + cn All Tag Team Modes\Player 3\Infinite Health + D029A98D 0029 + 8129D050 00FF + D029A98D 0029 + 8129D052 00FF + cn All Tag Team Modes\Player 3\Super Strength + D029A98D 0029 + 8129D0AA FFFF + cn All Tag Team Modes\Player 3\Invincible + D029A98D 0029 + 8129D0AE FFFF + cn All Tag Team Modes\Player 3\Super Speed + D029A98D 0029 + 8129D0B2 FFFF + cn All Tag Team Modes\Player 3\Super Stamina + D029A98D 0029 + 8129D0B6 FFFF + cn All Tag Team Modes\Player 3\Instant Recovery + D029A98D 0029 + 8129D0BA FFFF + cn All Tag Team Modes\Player 3\Can't Be Pinned + D029A98D 0029 + 8129CFDA FFFF + cn All Tag Team Modes\Player 3\Can't Be Counted Out + D029A98D 0029 + 8129CF4E 0384 + cn All Tag Team Modes\Player 4\Infinite Health + D029A98D 0029 + 8129E2F0 0000 + D029A98D 0029 + 8129E2F2 0000 + cn All Tag Team Modes\Player 4\Infinite Health + D029A98D 0029 + 8129E2F0 00FF + D029A98D 0029 + 8129E2F2 00FF + cn All Tag Team Modes\Player 4\Super Strength + D029A98D 0029 + 8129E34A FFFF + cn All Tag Team Modes\Player 4\Invincible + D029A98D 0029 + 8129E34E FFFF + cn All Tag Team Modes\Player 4\Super Speed + D029A98D 0029 + 8129E352 FFFF + cn All Tag Team Modes\Player 4\Super Stamina + D029A98D 0029 + 8129E356 FFFF + cn All Tag Team Modes\Player 4\Instant Recovery + D029A98D 0029 + 8129E35A FFFF + cn All Tag Team Modes\Player 4\Can't Be Pinned + D029A98D 0029 + 8129E27A FFFF + cn All Tag Team Modes\Player 4\Can't Be Counted Out + D029A98D 0029 + 8129E1EE 0384 + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 1\Infinite Health + D029A87D 0029 + 8129AA00 0000 + D029A87D 0029 + 8129AA02 0000 + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 1\Infinite Health + D029A87D 0029 + 8129AA00 00FF + D029A87D 0029 + 8129AA02 00FF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 1\Super Strength + D029A87D 0029 + 8129AA5A FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 1\Invincible + D029A87D 0029 + 8129AA5E FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 1\Super Speed + D029A87D 0029 + 8129AA62 FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 1\Super Stamina + D029A87D 0029 + 8129AA66 FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 1\Instant Recovery + D029A87D 0029 + 8129AA6A FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 1\Can't Be Pinned + D029A87D 0029 + 8129A98A FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 1\Can't Be Counted Out + D029A87D 0029 + 8129A8FE 0384 + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 2\Infinite Health + D029A87D 0029 + 8129BCA0 0000 + D029A87D 0029 + 8129BCA2 0000 + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 2\Infinite Health + D029A87D 0029 + 8129BCA0 00FF + D029A87D 0029 + 8129BCA2 00FF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 2\Super Strength + D029A87D 0029 + 8129BCFA FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 2\Invincible + D029A87D 0029 + 8129BCFE FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 2\Super Speed + D029A87D 0029 + 8129BD02 FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 2\Super Stamina + D029A87D 0029 + 8129BD06 FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 2\Instant Recovery + D029A87D 0029 + 8129BD0A FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 2\Can't Be Pinned + D029A87D 0029 + 8129BC2A FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 2\Can't Be Counted Out + D029A87D 0029 + 8129BB9E 0384 + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 3\Infinite Health + D029A87D 0029 + 8129CF40 0000 + D029A87D 0029 + 8129CF42 0000 + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 3\Infinite Health + D029A87D 0029 + 8129CF40 00FF + D029A87D 0029 + 8129CF42 00FF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 3\Super Strength + D029A87D 0029 + 8129CF9A FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 3\Invincible + D029A87D 0029 + 8129CF9E FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 3\Super Speed + D029A87D 0029 + 8129CFA2 FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 3\Super Stamina + D029A87D 0029 + 8129CFA6 FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 3\Instant Recovery + D029A87D 0029 + 8129CFAA FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 3\Can't Be Pinned + D029A87D 0029 + 8129CECA FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 3\Can't Be Counted Out + D029A87D 0029 + 8129CE3E 0384 + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 4\Infinite Health + D029A87D 0029 + 8129E1E0 0000 + D029A87D 0029 + 8129E1E2 0000 + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 4\Infinite Health + D029A87D 0029 + 8129E1E0 00FF + D029A87D 0029 + 8129E1E2 00FF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 4\Super Strength + D029A87D 0029 + 8129E23A FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 4\Invincible + D029A87D 0029 + 8129E23E FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 4\Super Speed + D029A87D 0029 + 8129E242 FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 4\Super Stamina + D029A87D 0029 + 8129E246 FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 4\Instant Recovery + D029A87D 0029 + 8129E24A FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 4\Can't Be Pinned + D029A87D 0029 + 8129E16A FFFF + cn Tornado, Lumberjack, 1-On-3, 3-On-1 Modes\Player 4\Can't Be Counted Out + D029A87D 0029 + 8129E0DE 0384 + cn Battle Royal Mode\Player 1\Infinite Health + D029A66D 0029 + 8129A7F0 0000 + D029A66D 0029 + 8129A7F2 0000 + cn Battle Royal Mode\Player 1\Infinite Health + D029A66D 0029 + 8129A7F0 00FF + D029A66D 0029 + 8129A7F2 00FF + cn Battle Royal Mode\Player 1\Super Strength + D029A66D 0029 + 8129A84A FFFF + cn Battle Royal Mode\Player 1\Invincible + D029A66D 0029 + 8129A84E FFFF + cn Battle Royal Mode\Player 1\Super Speed + D029A66D 0029 + 8129A852 FFFF + cn Battle Royal Mode\Player 1\Super Stamina + D029A66D 0029 + 8129A856 FFFF + cn Battle Royal Mode\Player 1\Instant Recovery + D029A66D 0029 + 8129A85A FFFF + cn Battle Royal Mode\Player 1\Can't Be Pinned + D029A66D 0029 + 8129A77A FFFF + cn Battle Royal Mode\Player 1\Can't Be Counted Out + D029A66D 0029 + 8129A6EE 0384 + cn Battle Royal Mode\Player 2\Infinite Health + D029A66D 0029 + 8129BA90 0000 + D029A66D 0029 + 8129BA92 0000 + cn Battle Royal Mode\Player 2\Infinite Health + D029A66D 0029 + 8129BA90 00FF + D029A66D 0029 + 8129BA92 00FF + cn Battle Royal Mode\Player 2\Super Strength + D029A66D 0029 + 8129BAEA FFFF + cn Battle Royal Mode\Player 2\Invincible + D029A66D 0029 + 8129BAEE FFFF + cn Battle Royal Mode\Player 2\Super Speed + D029A66D 0029 + 8129BAF2 FFFF + cn Battle Royal Mode\Player 2\Super Stamina + D029A66D 0029 + 8129BAF6 FFFF + cn Battle Royal Mode\Player 2\Instant Recovery + D029A66D 0029 + 8129BAFA FFFF + cn Battle Royal Mode\Player 2\Can't Be Pinned + D029A66D 0029 + 8129BA1A FFFF + cn Battle Royal Mode\Player 2\Can't Be Counted Out + D029A66D 0029 + 8129B98E 0384 + cn Battle Royal Mode\Player 3\Infinite Health + D029A66D 0029 + 8129CD30 0000 + D029A66D 0029 + 8129CD32 0000 + cn Battle Royal Mode\Player 3\Infinite Health + D029A66D 0029 + 8129CD30 00FF + D029A66D 0029 + 8129CD32 00FF + cn Battle Royal Mode\Player 3\Super Strength + D029A66D 0029 + 8129CD8A FFFF + cn Battle Royal Mode\Player 3\Invincible + D029A66D 0029 + 8129CD8E FFFF + cn Battle Royal Mode\Player 3\Super Speed + D029A66D 0029 + 8129CD92 FFFF + cn Battle Royal Mode\Player 3\Super Stamina + D029A66D 0029 + 8129CD96 FFFF + cn Battle Royal Mode\Player 3\Instant Recovery + D029A66D 0029 + 8129CD9A FFFF + cn Battle Royal Mode\Player 3\Can't Be Pinned + D029A66D 0029 + 8129CCBA FFFF + cn Battle Royal Mode\Player 3\Can't Be Counted Out + D029A66D 0029 + 8129CC2E 0384 + cn Battle Royal Mode\Player 4\Infinite Health + D029A66D 0029 + 8129DFD0 0000 + D029A66D 0029 + 8129DFD2 0000 + cn Battle Royal Mode\Player 4\Infinite Health + D029A66D 0029 + 8129DFD0 00FF + D029A66D 0029 + 8129DFD2 00FF + cn Battle Royal Mode\Player 4\Super Strength + D029A66D 0029 + 8129E02A FFFF + cn Battle Royal Mode\Player 4\Invincible + D029A66D 0029 + 8129E02E FFFF + cn Battle Royal Mode\Player 4\Super Speed + D029A66D 0029 + 8129E032 FFFF + cn Battle Royal Mode\Player 4\Super Stamina + D029A66D 0029 + 8129E036 FFFF + cn Battle Royal Mode\Player 4\Instant Recovery + D029A66D 0029 + 8129E03A FFFF + cn Battle Royal Mode\Player 4\Can't Be Pinned + D029A66D 0029 + 8129DF5A FFFF + cn Battle Royal Mode\Player 4\Can't Be Counted Out + D029A66D 0029 + 8129DECE 0384 + cn 1 On 2 & 2 On 1 Modes\Player 1\Infinite Health + D0296E4D 0029 + 81296FD0 0000 + D0296E4D 0029 + 81296FD2 0000 + cn 1 On 2 & 2 On 1 Modes\Player 1\Infinite Health + D0296E4D 0029 + 81296FD0 00FF + D0296E4D 0029 + 81296FD2 00FF + cn 1 On 2 & 2 On 1 Modes\Player 1\Super Strength + D0296E4D 0029 + 8129702A FFFF + cn 1 On 2 & 2 On 1 Modes\Player 1\Invincible + D0296E4D 0029 + 8129702E FFFF + cn 1 On 2 & 2 On 1 Modes\Player 1\Super Speed + D0296E4D 0029 + 81297032 FFFF + cn 1 On 2 & 2 On 1 Modes\Player 1\Super Stamina + D0296E4D 0029 + 81297036 FFFF + cn 1 On 2 & 2 On 1 Modes\Player 1\Instant Recovery + D0296E4D 0029 + 8129703A FFFF + cn 1 On 2 & 2 On 1 Modes\Player 1\Can't Be Pinned + D0296E4D 0029 + 81296F5A FFFF + cn 1 On 2 & 2 On 1 Modes\Player 1\Can't Be Counted Out + D0296E4D 0029 + 81296ECE 0384 + cn 1 On 2 & 2 On 1 Modes\Player 2\Infinite Health + D0296E4D 0029 + 81298270 0000 + D0296E4D 0029 + 81298272 0000 + cn 1 On 2 & 2 On 1 Modes\Player 2\Infinite Health + D0296E4D 0029 + 81298270 00FF + D0296E4D 0029 + 81298272 00FF + cn 1 On 2 & 2 On 1 Modes\Player 2\Super Strength + D0296E4D 0029 + 812982CA FFFF + cn 1 On 2 & 2 On 1 Modes\Player 2\Invincible + D0296E4D 0029 + 812982CE FFFF + cn 1 On 2 & 2 On 1 Modes\Player 2\Super Speed + D0296E4D 0029 + 812982D2 FFFF + cn 1 On 2 & 2 On 1 Modes\Player 2\Super Stamina + D0296E4D 0029 + 812982D6 FFFF + cn 1 On 2 & 2 On 1 Modes\Player 2\Instant Recovery + D0296E4D 0029 + 812982DA FFFF + cn 1 On 2 & 2 On 1 Modes\Player 2\Can't Be Pinned + D0296E4D 0029 + 812981FA FFFF + cn 1 On 2 & 2 On 1 Modes\Player 2\Can't Be Counted Out + D0296E4D 0029 + 8129816E 0384 + cn 1 On 2 & 2 On 1 Modes\Player 2\Infinite Health + D0296E4D 0029 + 81299510 0000 + D0296E4D 0029 + 81299512 0000 + cn 1 On 2 & 2 On 1 Modes\Player 2\Infinite Health + D0296E4D 0029 + 81299510 00FF + D0296E4D 0029 + 81299512 00FF + cn 1 On 2 & 2 On 1 Modes\Player 2\Super Strength + D0296E4D 0029 + 8129956A FFFF + cn 1 On 2 & 2 On 1 Modes\Player 2\Invincible + D0296E4D 0029 + 8129956E FFFF + cn 1 On 2 & 2 On 1 Modes\Player 2\Super Speed + D0296E4D 0029 + 81299572 FFFF + cn 1 On 2 & 2 On 1 Modes\Player 2\Super Stamina + D0296E4D 0029 + 81299576 FFFF + cn 1 On 2 & 2 On 1 Modes\Player 2\Instant Recovery + D0296E4D 0029 + 8129957A FFFF + cn 1 On 2 & 2 On 1 Modes\Player 2\Can't Be Pinned + D0296E4D 0029 + 8129949A FFFF + cn 1 On 2 & 2 On 1 Modes\Player 2\Can't Be Counted Out + D0296E4D 0029 + 8129940E 0384 + cn 3 Way Dance Mode\Player 1\Infinite Health + D0296C3D 0029 + 81296DC0 0000 + D0296C3D 0029 + 81296DC2 0000 + cn 3 Way Dance Mode\Player 1\Infinite Health + D0296C3D 0029 + 81296DC0 00FF + D0296C3D 0029 + 81296DC2 00FF + cn 3 Way Dance Mode\Player 1\Super Strength + D0296C3D 0029 + 81296E1A FFFF + cn 3 Way Dance Mode\Player 1\Invincible + D0296C3D 0029 + 81296E1E FFFF + cn 3 Way Dance Mode\Player 1\Super Speed + D0296C3D 0029 + 81296E22 FFFF + cn 3 Way Dance Mode\Player 1\Super Stamina + D0296C3D 0029 + 81296E26 FFFF + cn 3 Way Dance Mode\Player 1\Instant Recovery + D0296C3D 0029 + 81296E2A FFFF + cn 3 Way Dance Mode\Player 1\Can't Be Pinned + D0296C3D 0029 + 81296D4A FFFF + cn 3 Way Dance Mode\Player 1\Can't Be Counted Out + D0296C3D 0029 + 81296CBE 0384 + cn 3 Way Dance Mode\Player 2\Infinite Health + D0296C3D 0029 + 81298060 0000 + D0296C3D 0029 + 81298062 0000 + cn 3 Way Dance Mode\Player 2\Infinite Health + D0296C3D 0029 + 81298060 00FF + D0296C3D 0029 + 81298062 00FF + cn 3 Way Dance Mode\Player 2\Super Strength + D0296C3D 0029 + 812980BA FFFF + cn 3 Way Dance Mode\Player 2\Invincible + D0296C3D 0029 + 812980BE FFFF + cn 3 Way Dance Mode\Player 2\Super Speed + D0296C3D 0029 + 812980C2 FFFF + cn 3 Way Dance Mode\Player 2\Super Stamina + D0296C3D 0029 + 812980C6 FFFF + cn 3 Way Dance Mode\Player 2\Instant Recovery + D0296C3D 0029 + 812980CA FFFF + cn 3 Way Dance Mode\Player 2\Can't Be Pinned + D0296C3D 0029 + 81297FEA FFFF + cn 3 Way Dance Mode\Player 2\Can't Be Counted Out + D0296C3D 0029 + 81297F5E 0384 + cn 3 Way Dance Mode\Player 3\Infinite Health + D0296C3D 0029 + 81299300 0000 + D0296C3D 0029 + 81299302 0000 + cn 3 Way Dance Mode\Player 3\Infinite Health + D0296C3D 0029 + 81299300 00FF + D0296C3D 0029 + 81299302 00FF + cn 3 Way Dance Mode\Player 3\Super Strength + D0296C3D 0029 + 8129935A FFFF + cn 3 Way Dance Mode\Player 3\Invincible + D0296C3D 0029 + 8129935E FFFF + cn 3 Way Dance Mode\Player 3\Super Speed + D0296C3D 0029 + 81299362 FFFF + cn 3 Way Dance Mode\Player 3\Super Stamina + D0296C3D 0029 + 81299366 FFFF + cn 3 Way Dance Mode\Player 3\Instant Recovery + D0296C3D 0029 + 8129936A FFFF + cn 3 Way Dance Mode\Player 3\Can't Be Pinned + D0296C3D 0029 + 8129928A FFFF + cn 3 Way Dance Mode\Player 3\Can't Be Counted Out + D0296C3D 0029 + 812991FE 0384 + cn Character Modifier\Player 1 + 80122773 ???? 000D:"Cyrus the Virus",000F:"Mack Daddy",0015:"Gertner",0019:"Jeff Jones",001C:"Beulah",001D:"Mad Goat",001F:"Nurse",0022:"Tommy Rich",0025:"Santoro",0027:"Sound Guy",0028:"The Sheik",0029:"Skull",002A:"H Slash",002E:"Louie",0030:"J Styles",0032:"Taz",0033:"Trainer",0036:"Excel" + cn Character Modifier\Player 2 + 80122783 ???? 000D:"Cyrus the Virus",000F:"Mack Daddy",0015:"Gertner",0019:"Jeff Jones",001C:"Beulah",001D:"Mad Goat",001F:"Nurse",0022:"Tommy Rich",0025:"Santoro",0027:"Sound Guy",0028:"The Sheik",0029:"Skull",002A:"H Slash",002E:"Louie",0030:"J Styles",0032:"Taz",0033:"Trainer",0036:"Excel" + cn Create A Wrestler\Infinite Move % + 80131600 0024 + cn Create A Wrestler\Infinite Attribute Points + 8115DD52 0000 + +crc F2A653CB-60633B3B-C:45 +gn Elmo's Letter Adventure (U) + cn Found All Letters + 810ACBA2 000C + cn Infinite Strikes + 810A760A 0000 + cn Have No Letters + cd Keep you kid busy for hours!!! + 810ACBA2 0000 + +crc 02B1538F-C94B88D0-C:45 +gn Elmo's Number Journey (U) + cn Found All Numbers + 810ACFB2 000C + cn Infinite Strikes + 810A7A76 0000 + cn Have No Numbers + cd Keep you kid busy for hours!!! + 810ACFB2 0000 + +crc 07861842-A12EBC9F-C:45 +gn Excitebike 64 (U) + cn Auto-Pilot Always On Turbo (Original Excitebike Mode) + 810E3142 19AA + cn Unlock\Difficulties & All Special Tracks + 810F2D50 FFFF + cn Unlock\Silver & Gold Cup + 810F2D4E 0003 + cn Max Stunt Points + 810E4D18 0098 + 810E4D1A 967F + cn Always Low Temp + 810E4F98 0000 + 810E4F9A 0000 + cn Steering Control + 800C9E50 0040 + cn Super Speed For All + 800CA9A0 0040 + 800CA9A1 0070 + cn Power Turbo + 800CA99C 0040 + 800CA99D 00E0 + cn No\Overheating + 800CA984 00C3 + cn No\Collision Drivers + 800D9D34 0040 + cn Fast\Movement (Player) + 800D9D65 00AF + cn Slow\Movement (Player) + 800D9D65 0060 + cn Fast\Movement (Drones) + 800D9D55 00A0 + cn Slow\Movement (Drones) + 800D9D55 0060 + cn Earthquake Mode + 810D7010 3AD0 + +crc FDA245D2-A74A3D47-C:45 +gn Extreme-G (U) + cn Infinite Shields\Player 1 + 801635F5 00C8 + cn Infinite Primary Weapon\Player 1 + 801635FD 00C8 + cn Infinite Turbos\Player 1 + 801635CB 0003 + 801635CF 0003 + cn Bike Modifier\Player 1 + 80167C3F ???? 0000:"Raze",0001:"Rana",0002:"Khan",0003:"Grimace",0004:"Mooga",0005:"Jolt",0006:"Main",0007:"Apollyon",0008:"Roach",0009:"Neon"0000:"Raze",0001:"Rana",0002:"Khan",0003:"Grimace",0004:"Mooga",0005:"Jolt",0006:"Main",0007:"Apollyon",0008:"Roach",0009:"Neon" + cn Infinite Shields\Player 2 + 80163D65 00C8 + cn Infinite Primary Weapon\Player 2 + 80163D6D 00C8 + cn Infinite Turbos\Player 2 + 80163D3B 0003 + 80163D3F 0003 + cn Bike Modifier\Player 2 + 80167C8B ???? 0000:"Raze",0001:"Rana",0002:"Khan",0003:"Grimace",0004:"Mooga",0005:"Jolt",0006:"Main",0007:"Apollyon",0008:"Roach",0009:"Neon"0000:"Raze",0001:"Rana",0002:"Khan",0003:"Grimace",0004:"Mooga",0005:"Jolt",0006:"Main",0007:"Apollyon",0008:"Roach",0009:"Neon" + cn Infinite Shields\Player 3 + 801644D5 00C8 + cn Infinite Primary Weapon\Player 3 + 801644DD 00C8 + cn Infinite Turbos\Player 3 + 801644AB 0003 + 801644AF 0003 + cn Bike Modifier\Player 3 + 80167CD7 ???? 0000:"Raze",0001:"Rana",0002:"Khan",0003:"Grimace",0004:"Mooga",0005:"Jolt",0006:"Main",0007:"Apollyon",0008:"Roach",0009:"Neon"0000:"Raze",0001:"Rana",0002:"Khan",0003:"Grimace",0004:"Mooga",0005:"Jolt",0006:"Main",0007:"Apollyon",0008:"Roach",0009:"Neon" + cn Infinite Shields\Player 4 + 80164C45 00C8 + cn Infinite Primary Weapon\Player 4 + 80164C4D 00C8 + cn Infinite Turbos\Player 4 + 80164C1B 0003 + 80164C1F 0003 + cn Bike Modifier\Player 4 + 80167D23 ???? 0000:"Raze",0001:"Rana",0002:"Khan",0003:"Grimace",0004:"Mooga",0005:"Jolt",0006:"Main",0007:"Apollyon",0008:"Roach",0009:"Neon"0000:"Raze",0001:"Rana",0002:"Khan",0003:"Grimace",0004:"Mooga",0005:"Jolt",0006:"Main",0007:"Apollyon",0008:"Roach",0009:"Neon" + cn Extra Bikes Unlocked + 80167C13 0001 + 80167C17 0003 + cn Extra Levels Unlocked + 80167C0B 0001 + 80167C0F 0001 + cn All Tracks Unlocked + 8019436E 0008 + 50000264 0000 + 80167747 0001 + 50000264 0000 + 80167873 0001 + 50000564 0000 + 8016799F 0001 + cn Mode Select + 80095F6F ???? 0001:"Boulder",0002:"Fish Eye Lens",0003:"Boulder & Fish Eye Lens",0004:"Magnify",0008:"Anti-Gravity",000A:"Anti-Gravity & Fish Eye Lens",0010:"Wireframe",0011:"Boulder & Wireframe",0020:"Stealth Mode",0040:"Ghost Mode",0080:"Ugly Mode"0001:"Boulder",0002:"Fish Eye Lens",0003:"Boulder & Fish Eye Lens",0004:"Magnify",0008:"Anti-Gravity",000A:"Anti-Gravity & Fish Eye Lens",0010:"Wireframe",0011:"Boulder & Wireframe",0020:"Stealth Mode",0040:"Ghost Mode",0080:"Ugly Mode" + +crc 5CD4150B-470CC2F1-C:45 +gn Extreme-G XG2 (U) + cn Infinite\Nitros\Player 1 + 80170B63 0004 + 80170B67 0004 + cn Infinite\Shield\Player 1 + 80170B8D 00C8 + cn Infinite Lasers\Player 1 + 80170B99 00C8 + cn Infinite Nitros\Player 2 + 801711CB 0004 + 801711CF 0004 + cn Infinite Shield\Player 2 + 801711F5 00C8 + cn Infinite Lasers\Player 2 + 80171241 00C8 + cn Infinite Nitros\Player 3 + 80171833 0004 + 80171837 0004 + cn Infinite Shield\Player 3 + 8017185D 00C8 + cn Infinite Lasers\Player 3 + 80171869 00C8 + cn Infinite Nitros\Player 4 + 80171E9B 0004 + 80171E9F 0004 + cn Infinite Shield\Player 4 + 80171EC5 00C8 + cn Infinite Lasers\Player 4 + 80171ED1 00C8 + cn Access\All Tracks + 50000BD8 0000 + 80182F87 0001 + cn Access\All Superbikes + 50000304 0000 + 801839CF 0001 + cn Access\All Secret Characters + cd This code is Fantastic, You have 12 characters to choose from to you race without any bike, just on foot + 50000C04 0000 + 801839CF 0001 + cn [Screen Hud Clear] + cd If you are using a Plugin other then Jabos and can not see through the Thick Hud then Let the game load 1st before Putting this code on,Or it will give an error and Freeze + 80092B8B 0004 + +crc AE82687A-9A3F388D-C:45 +gn F-1 Pole Position 64 (U) + cn Always First Place + 810BA6DA 0000 + +crc 52F78805-8B8FCAB7-C:45 +gn Fighter's Destiny (U) + cn Start with Stars Modifier\Player 1 + D0209757 0000 + 80209757 ???? 0000:"No Stars",0006:"Max Stars" + cn Start with Stars Modifier\Player 2 + D020B61F 0000 + 8020B61F ???? 0000:"No Stars",0006:"Max Stars" + cn Have 1 Star\Ryuji + 8030734E 0001 + cn Have 1 Star\Bob + 8030734F 0001 + cn Have 1 Star\Pierre + 80307350 0001 + cn Have 1 Star\Meiling + 80307351 0001 + cn Have 1 Star\Leon + 80307352 0001 + cn Have 1 Star\Abdul + 80307353 0001 + cn Have 1 Star\Ninja + 80307354 0001 + cn Have 1 Star\Tomahawk + 80307355 0001 + cn Have 1 Star\Valerie + 80307356 0001 + cn Infinite Health\Player 1 + 802098A1 0000 + 802047C3 0000 + cn Infinite Health\Player 2 + 802047C7 0000 + 8020B769 0000 + cn Start on stage 100 on Survival to get Joker + 802EF67B 0063 + cn Stop timer for Fastest to get Robot + 810ADBDC 3F80 + cn Always Win Judge's Decision\Player 1 + 8020B777 FFFF + 802098AF 0000 + cn Always Win Judge's Decision\Player 2 + 802098AF FFFF + 8020B777 0000 + cn Enable Boro + 80307349 0001 + cn Level Select + 8022A84C ???? 0000:"Fire Mountain",0001:"Desert",0002:"Highlands",0003:"Hong Kong",0004:"Coliseum",0005:"Jungle",0006:"Ninja Room",0007:"Suspension Bridge",0008:"Palace",0009:"Observation",000A:"Pasture",000B:"Joker's Room",000C:"Blue Hell Mountain",000D:"Palace" + cn Play As\Player 1 + 802EF622 ???? 0000:"Ryuji",0001:"Bob",0002:"Pierre",0003:"Meiling",0004:"Leon",0005:"Abdul",0006:"Ninja",0007:"Tomahawk",0008:"Boro",0009:"Valerie",000A:"Ushi",000B:"Joker",000C:"The Master",000D:"No Clue" + +crc AEEF2F45-F97E30F1-C:45 +gn Fighter Destiny 2 (U) + cn P1 Always Win Judging + 801F727A 00FF + cn P2 Always Win Judging + 801F53AE 00FF + cn P1 Always Lose Judging + 801F727A 0000 + cn P2 Always Lose Judging + 801F53AE 0000 + cn Max Attack Power-Fighters Arena + 801FBF6E 00C7 + cn Max Health Power-Fighters Arena + 801FBF6F 00C7 + cn Max Recovery-Fighters Arena + 801FBF70 00C7 + cn Low Time + 800BA390 0001 + +crc 32EFC7CB-C3EA3F20-C:45 +gn Fighting Force 64 (U) + cn Infinite Lives P1 + 800CE0F3 0003 + cn Infinite Lives P2 + 800CE0F7 0003 + cn Infinite Pistol Ammo + 8106006C 2400 + cn Infinite Rocket Launcher Ammo + 81060130 2400 + cn Infinite Shotgun Ammo + 810601D8 2400 + +crc A92D52E5-1D26B655-C:45 +gn Flying Dragon (U) + cn Infinite\Health\Player 1 + 8020B7B1 00C8 + cn Infinite\Special\Player 1 + 8120AEB4 0190 + cn 1 Win to Win\Player 1 + D020C27F 0000 + 8020C27F 0001 + cn Infinite\Health\Player 2 + 8020BC0D 00C8 + cn Infinite\Special\Player 2 + 8120B1B0 0190 + cn 1 Win to Win\Player 2 + D020C27F 0000 + 8020C27F 0010 + cn Infinite\Money + 8121106C 2704 + +crc 9E330C01-8C0314BA-C:45 +gn Forsaken 64 (U) + cn Infinite Shields + D014E5E2 0011 + 8114E5E0 1000 + cn Enable Battle Mode And Levels + 8008ED6E 0012 + cn Gore Mode + 8008ED67 0012 + cn Infinite Lives + 8004013C 0005 + cn GS Button For 255 Spare0 Missiles + 8814E648 00FF + +crc 3261D479-ED0DBC25-C:45 +gn Fox Sports College Hoops '99 (U) + cn Trail Follows The Ball + 810B4600 4100 + cn Programmers Team + 81097088 0100 + cn Z-Axis Stadium + 80098E98 0088 + cn Final Four Stadium + 80098E98 0089 + cn No Fans In Crowd + 810CA520 0454 + cn Away Team Scores 0 + 8012A4EA 0000 + cn Away Team Scores 150 + 8012A4EA 0096 + cn Home Team Scores 0 + 8012A4D2 0000 + cn Home Team Scores 150 + 8012A4D2 0096 + cn Infinite Shot Clock + 8112A4BC 4210 + cn Infinite Time Outs Away + 8012A4EC 0006 + cn Infinite Time Outs Home + 8012A4D4 0006 + cn No Time Outs Away + 8012A4EC 0000 + cn No Time Outs Home + 8012A4D4 0000 + cn Big Head Mode + 81098E88 0100 + cn Partially Invisible Players + 81098E84 0100 + cn Shot Clock Disabled + 8109707C 0000 + cn GS Button For 1-Second Shot Clock + 8912A4BC 3FC0 + +crc E8E5B179-44AA30E8-C:45 +gn Frogger2 (Unreleased Alpha) + cn Freeze Timer + 80163ABF 000A + cn Infinite 99 Lives + 80163AC7 0063 + cn Infinite Lives (Retro Frogger) + 8025AC2F 0005 + +crc B30ED978-3003C9F9-C:45 +gn F-Zero X (U) + cn Time Always 00.00.00/1st Place + 802C4BC0 0000 + 802C4BC2 0001 + cn Infinite Lives + 800E5ED9 0005 + cn Unlock Everything + 800CD3C8 0001 + cn Player 1\Infinite Shield + 812C4B48 4326 + cn Player 2\Infinite Shield + 812C4EF0 4326 + cn Player 3\Infinite Shield + 812C5298 4326 + cn Player 4\Infinite Shield + 812C5640 4326 + cn Max Shield + 812C4B4C 4326 + cn Have Boost From Start + D02C4DAC 003F + 802C4925 0050 + cn One Lap To Race + D02C4BC9 0000 + 812C4BC8 0002 + D02C4BCB 0001 + 812C4BCA 0002 + cn Expert Mode + 800E5ED9 0000 + 812C4B48 0000 + 812C4B4C 0000 + cn Super Ultimate Mega Fast Mode + 812C4984 2222 + cn Cool Camera + 800E523E 0000 + cn Hunk O' Junk + 802C4B3F 0040 + cn Show 30 Cars Out Of 1 Position + 800E5FC7 001D + cn Player 1\Invisible Car + cd Vs. Mode Only + 802C4CCB 0000 + cn Player 1\Character Modifier + 800E5EE1 ???? 0000:"Captain Falcon",0001:"Dr. Stewart",0002:"Pico",0003:"Samurai Goroh",0004:"Jody Summer",0005:"Mighty Gazelle",0006:"Mr. EAD",0007:"Baba",0008:"Octoman",0009:"Gomar + Shioh",000A:"Kate Alen",000B:"Roger Buster",000C:"James McCloud",000D:"Leon",000E:"Antonio Guster",000F:"Black Shadow",0010:"Michael Chain",0011:"Jack Levin",0012:"Super Arrow",0013:"Mrs. Arrow",0014:"John Tanaka",0015:"Beastman",0016:"Zoda",0017:"Dr. Clash",0018:"Silver Neelsen",0019:"Bio Rex",001A:"Draq",001B:"Billy",001C:"The Skull",001D:"Blood Falcon",001E:"Perfect Captain Falcon" + cn Player 2\Character Modifier + 802C4F90 ???? 0000:"Captain Falcon",0001:"Dr. Stewart",0002:"Pico",0003:"Samurai Goroh",0004:"Jody Summer",0005:"Mighty Gazelle",0006:"Mr. EAD",0007:"Baba",0008:"Octoman",0009:"Gomar + Shioh",000A:"Kate Alen",000B:"Roger Buster",000C:"James McCloud",000D:"Leon",000E:"Antonio Guster",000F:"Black Shadow",0010:"Michael Chain",0011:"Jack Levin",0012:"Super Arrow",0013:"Mrs. Arrow",0014:"John Tanaka",0015:"Beastman",0016:"Zoda",0017:"Dr. Clash",0018:"Silver Neelsen",0019:"Bio Rex",001A:"Draq",001B:"Billy",001C:"The Skull",001D:"Blood Falcon",001E:"Perfect Captain Falcon" + cn Player 3\Character Modifier + 802C5338 ???? 0000:"Captain Falcon",0001:"Dr. Stewart",0002:"Pico",0003:"Samurai Goroh",0004:"Jody Summer",0005:"Mighty Gazelle",0006:"Mr. EAD",0007:"Baba",0008:"Octoman",0009:"Gomar + Shioh",000A:"Kate Alen",000B:"Roger Buster",000C:"James McCloud",000D:"Leon",000E:"Antonio Guster",000F:"Black Shadow",0010:"Michael Chain",0011:"Jack Levin",0012:"Super Arrow",0013:"Mrs. Arrow",0014:"John Tanaka",0015:"Beastman",0016:"Zoda",0017:"Dr. Clash",0018:"Silver Neelsen",0019:"Bio Rex",001A:"Draq",001B:"Billy",001C:"The Skull",001D:"Blood Falcon",001E:"Perfect Captain Falcon" + cn Player 4\Character Modifier + 802C56E0 ???? 0000:"Captain Falcon",0001:"Dr. Stewart",0002:"Pico",0003:"Samurai Goroh",0004:"Jody Summer",0005:"Mighty Gazelle",0006:"Mr. EAD",0007:"Baba",0008:"Octoman",0009:"Gomar + Shioh",000A:"Kate Alen",000B:"Roger Buster",000C:"James McCloud",000D:"Leon",000E:"Antonio Guster",000F:"Black Shadow",0010:"Michael Chain",0011:"Jack Levin",0012:"Super Arrow",0013:"Mrs. Arrow",0014:"John Tanaka",0015:"Beastman",0016:"Zoda",0017:"Dr. Clash",0018:"Silver Neelsen",0019:"Bio Rex",001A:"Draq",001B:"Billy",001C:"The Skull",001D:"Blood Falcon",001E:"Perfect Captain Falcon" + cn Player 1\Car Color Modifier + 802C4BED ???? 0000:"1st Color",0001:"2nd Color",0002:"3rd Color",0003:"4th Color",0005:"Hidden Color" + cn Player 2\Car Color Modifier + 802C4F95 ???? 0000:"1st Color",0001:"2nd Color",0002:"3rd Color",0003:"4th Color",0005:"Hidden Color" + cn Player 3\Car Color Modifier + 802C533D ???? 0000:"1st Color",0001:"2nd Color",0002:"3rd Color",0003:"4th Color",0005:"Hidden Color" + cn Player 4\Car Color Modifier + 802C56E5 ???? 0000:"1st Color",0001:"2nd Color",0002:"3rd Color",0003:"4th Color",0005:"Hidden Color" + cn Track Modifier + 800F8517 ???? 0000:"Mute City",0001:"Silence",0002:"Sand Ocean",0003:"Devils Forest",0004:"Big Blue",0005:"Port Town",0006:"Sector Alpha",0007:"Red Canyon",0008:"Devils Forest 2",0009:"Mute City 2",000A:"Big Blue 2",000B:"White Land",000C:"Fire Field",000D:"Silence 2",000E:"Sector Beta",000F:"Red Canyon",0010:"White Land 2",0011:"Mute City 2",0012:"Rainbow Road",0013:"Devils Forest 3",0014:"Space Plant",0015:"Sand Ocean 2",0016:"Port Town 2",0017:"Big Hand" + cn Max Grand Prix Points + 812C492A FFFF + +crc 729B5E32-B728D980-C:45 +gn GAUNTLET LEGENDS + cn Infinite\Max Health + 810C5C54 0000 + 810C5C56 270F + 810C5C64 0000 + 810C5C66 270F + cn Infinite\Money + 810C5CF6 FFFF + cn Max Strength + 810C5C04 0000 + 810C5C06 FFFF + cn Max Speed + 810C5C14 0000 + 810C5C16 FFFF + cn Max Magic + 810C5C24 0000 + 810C5C26 FFFF + cn Max Armour + 810C5C34 0000 + 810C5C36 FFFF + cn Infinite\Turbo + 800FD30F 0064 + cn Level 99 + 810C5C44 0000 + 810C5C46 0063 + cn Infinite\Special Weapons + 800C5FF7 0009 + 800C5D37 0009 + 800C5D67 0009 + 800C5DE7 0009 + 800C5EB7 0009 + cn Always Shoot 5-Way + 800FD198 0200 + cn Always Shoot 3-Way + 800FD19A 0002 + cn Always Shoot Rapid Fire + 800FD19A 1000 + cn Have Window Schards + 8104EFCA 000F + cn Have Rune Stones + 8104EFC6 1FFF + cn Infinite\Item On Pickup + 50010100 0000 + 810C5BF6 FFFF + cn Infinite\Keys On Pickup + 800C5C97 0006 + +crc 3EDC7E12-E26C1CC9-C:45 +gn Gex 3: Deep Cover Gecko (U) + cn Start With 50 Remotes + D00A54EB 0000 + 800A54EB 0032 + cn Infinite Health + 800A54D9 0004 + cn Extra Flies + D00A54DF 0000 + 800A54DF 0032 + +crc 89FED774-CAAFE21B-C:45 +gn Gex 64: Enter The Gecko (U) + cn Infinite Health + 800C56BB 0005 + cn Infinite Lives + 800C56B7 0005 + cn Have All Artifacts + 800C56BF 0063 + 800C56C3 0063 + 800C56C7 0063 + +crc 8E6E01FF-CCB4F948-C:45 +gn Glover (U) + cn Infinite\Double Jumps + 8028FC07 0000 + cn Press L To Levitate + D02AE905 0020 + 81290334 43E0 + cn Infinite\Health + 8029018F 0028 + cn Infinite\Lives + 80290193 000A + cn GS Button For 40 Gems + 8829018F 0028 + cn Infinite\Activate Cheat\Modifier 1 + 81297BEC ???? 0080:"Level Select",0100:"Open Portals",0200:"Open Levels",0380:"All Of The Above" + cn Infinite\Activate Cheat\Modifier 2 + 81297BEE ???? 0002:"Call Ball (Press L)",0008:"Infinite Lives",0040:"Infinite Energy",0200:"Big Ball",024A:"All Of The Above" + cn Infinite\Action Modifier + 802901E3 ???? 0000:"Freeze Enemy Spell",0001:"Death Spell",0002:"Frog Spell",0003:"Walk On Walls Spell",0004:"Big Glover Spell",0005:"Tree Spell",0006:"Helicopter Spell",0007:"Enemy Ball Spell",0008:"Purple Bouncy Ball Spell",0009:"Tiny Black/Grey Ball Spell",000A:"Beach Ball Spell",000B:"Hovering Ball Spell",000C:"Green Ball Spell",000D:"Super Call Ball Spell",000E:"Call Ball Spell" + +crc 4252A5AD-AE6FBF4E-C:45 +gn Goemon's Great Adventure (U) + cn Infinite Gold P1 + 81088286 03E7 + cn Infinite Health P1 + 80088284 0003 + cn Infinite Lives P1 + 80088283 0003 + cn Infinite Gold P2 + 8119ADEE 03E7 + cn Infinite Health P2 + 81088290 03E7 + cn Infinite Lives P2 + 8008828D 0003 + cn Infinite Coins P1 + 8119ADEE 03E7 + cn Open All Levels + 50002D02 0000 + 810882AA 0303 + +crc DCBC50D1-09FD1AA3-C:45 +gn Goldeneye 007 (U) + cn Enable All Levels & In-Built Cheat Menu + 8006992E FFFF + 80069930 FFFF + 80069967 FFFF + 8006996C FFFF + 80069971 FFFF + 80069976 FFFF + 8006997B FFFF + 8006992F FFFF + 80069965 FFFF + 8006996A FFFF + 8006996F FFFF + 80069974 FFFF + 80069979 FFFF + cn Always Have 00:00 Time (All Levels) + 8004837E 0000 + 8004838E 0000 + 80048396 0000 + 80079A22 0000 + 80079F26 0000 + cn Infinite Ammo (All Levels) + 80079E3B 0001 + cn Bulletproof Bond + 8002CE44 0030 + cn Weak Enemies + 8002CE48 0048 + cn Walk through doors, objects + 800364CB 0000 + cn Enable All Levels + 80036FB7 0001 + cn All Objectives Complete + 80036FD3 0001 + cn Gain Access\To Aztec Level Without Beating Secret Agent Or 00 Agent + 8002A8FB 001A + cn Gain Access\To Egyptian Level Without Beating Secret Agent Or 00 Agent + 8002A8FB 001C + cn Infinite Health Player 1 (all levels) + 8100C0F4 0801 + 8100C0F6 8090 + 8100C0F8 AFA4 + 8100C0FA 0000 + 81060240 0004 + 81060242 7600 + 81060244 3C02 + 81060246 8008 + 81060248 8C42 + 8106024A 9EE0 + 8106024C 3401 + 8106024E 3F80 + 81060250 A441 + 81060252 00DC + 81060254 0800 + 81060256 303F + cn Cradle in multiplayer + cd Puts the cradle graphic in the levels screen where the facility normally is in the multiplayer levels screen.Warning it doesn't allow you to enter the multiplayer levels screen,it should automatically have selected cradle, which cannot be changed from the multiplayer menus + 8002B11D 0092 + 8002B11F 0093 + 8002B127 0029 + 8002B123 0008 + 802ADC8D 0052 + 802ADC8E 0041 + 802ADC8F 0044 + 802ADC90 004C + 802ADC91 0045 + cn Custom Weapon Grouping + cd golden gun fun should replace slappers only! appears in the multi weapons. + 80048673 0013 + 81048678 3FC0 + 80048677 00D0 + 8004867F 000D + 80048683 000A + 8004868B 0013 + 81048690 3FC0 + 8004868F 00D0 + 80048697 000D + 8004869B 000A + 800486A3 0019 + 810486A8 3FC0 + 800486A7 00D3 + 800486AF 0006 + 800486B3 0003 + 800486BB 0019 + 810486C0 3FC0 + 800486BF 00D3 + 800486C7 0006 + 800486CB 0003 + 800486D3 0013 + 810486D8 3FC0 + 800486D7 00D0 + 800486DF 000D + 800486E3 000A + 800486EB 0013 + 810486F0 3FC0 + 800486EF 00D0 + 800486F7 000D + 800486FB 000A + 80048703 0019 + 81048708 3FC0 + 80048707 00D3 + 8004870F 0006 + 80048713 0003 + 8004871B 0019 + 81048720 3FC0 + 8004871F 00D3 + 80048727 0006 + 8004872B 0003 + 812AEA50 476F + 812AEA52 6C64 + 812AEA54 656E + 812AEA56 2047 + 812AEA58 756E + 812AEA5A 2046 + 812AEA5C 756E + 802AEA5E 0000 + cn Facility Back Zone In Multiplayer\Part 1\2 players + cd All parts must be on for this code to work.this cheat allows you to play the Facility Back Zone In Multiplayer + 811E6554 45E4 + 811E6558 43D5 + 811E655C C5A7 + 811E657C 801C + 811E657E 6774 + 811E5164 45E4 + 811E5168 C383 + 811E516C 4492 + 811E518C 801C + 811E518E D574 + 811E78C0 45AD + 811E78C4 C383 + 811E78C8 4440 + 811E78E8 801C + 811E78EA E464 + 811E4D18 45D0 + 811E4D1C 4307 + 811E4D20 C4FB + 811E4D40 801C + 811E4D42 75EC + 811E6738 45CD + 811E673C C383 + 811E6740 43F4 + 811E6760 801C + 811E6762 A0DC + 811E5450 45C2 + 811E5454 4356 + 811E5458 C598 + 811E5478 801C + 811E547A 6A74 + 811E5240 4608 + 811E5244 4307 + 811E5248 43DC + 811E5268 801C + 811E526A 962C + 811E691C 4606 + 811E6920 4321 + 811E6924 449D + 811E6944 801C + 811E6946 CBEC + 801ED447 008A + 801ED4DB 008B + 801ED56F 008C + 801ED603 008D + 801ED697 008E + 801ED72B 008F + 801ED7BF 007D + 801ED853 007E + 801ED443 002A + 801ED4D7 002A + 801ED56B 002A + 801ED5FF 002A + 801ED693 002A + 801ED727 002A + 801ED7BB 002A + 801ED84F 002A + 801ED449 0000 + 801ED4DD 0000 + 801ED571 0000 + 801ED605 0000 + 801ED699 0000 + 801ED72D 0000 + 801ED7C1 0000 + 801ED855 0000 + 801ED44D 0000 + 801ED4E1 0000 + 801ED575 0000 + 801ED609 0000 + 801ED69D 0000 + 801ED731 0000 + 801ED7C5 0000 + 801ED859 0000 + 801EB743 002A + 801EB745 0068 + 811EB746 277F + 811EB748 1000 + 811EB74A 0262 + 811EB7C2 0190 + 801EB7C5 0000 + 811EB7C6 0258 + cn Facility Back Zone In Multiplayer\Part 2\2 players + cd All parts must be on for this code to work.this cheat allows you to play the Facility Back Zone In Multiplayer + 811EB7C8 0000 + 811EB7CC FFFF + 811EB7CE FFFF + 811EB7D2 0000 + 801EB7D5 0000 + 801EB7DB 0000 + 811EB7E2 0000 + 801EB7E7 0000 + 801EB843 002A + 801EB845 0068 + 811EB846 2780 + 811EB848 1000 + 811EB84A 0262 + 811EB8C2 0190 + 801EB8C5 0000 + 811EB8C6 0258 + 811EB8C8 0000 + 811EB8CC FFFF + 811EB8CE FFFF + 811EB8D2 0000 + 801EB8D5 0000 + 801EB8DB 0000 + 811EB8E2 0000 + 801EB8E7 0000 + 801EB943 002A + 801EB945 0068 + 811EB946 2791 + 811EB948 1000 + 811EB94A 0262 + 811EB9C2 0190 + 801EB9C5 0000 + 811EB9C6 0258 + 811EB9C8 0000 + 811EB9CC FFFF + 811EB9CE FFFF + 811EB9D2 0000 + 801EB9D5 0000 + 801EB9DB 0000 + 811EB9E2 0000 + 801EB9E7 0000 + 801EBA43 002A + 801EBA45 0068 + 811EBA46 2792 + 811EBA48 1000 + 811EBA4A 0262 + 811EBAC2 0190 + 801EBAC5 0000 + 811EBAC6 0258 + 811EBAC8 0000 + 811EBACC FFFF + 811EBACE FFFF + 811EBAD2 0000 + 801EBAD5 0000 + 801EBADB 0000 + 811EBAE2 0000 + 801EBAE7 0000 + 801EBB45 00A0 + 801EBC45 00A0 + 801EBD45 00A0 + 801EBE45 00A0 + 801EBB47 0075 + 801EBC47 0076 + 801EBD47 0077 + 801EBE47 0078 + 801EBBE7 0001 + 801EBCE7 0001 + 801EBDE7 0001 + 801EBEE7 0001 + 801EC247 0071 + 801ECD47 0072 + 801ECE47 0074 + 801ECF47 006C + 801ED047 0079 + 801ED147 0083 + D01EBFC5 005A + 801EBFC5 0000 + D11EBFC6 0000 + 811EBFC6 F333 + D11EBFC8 03E8 + 811EBFC8 0000 + cn Facility Back Zone In Multiplayer\Part 3\2 players + cd All parts must be on for this code to work.this cheat allows you to play the Facility Back Zone In Multiplayer + D11EBFCA 0000 + 811EBFCA F0C4 + D11EBFCE 4CCC + 811EBFCE 000A + D11EBFD2 4CCC + 811EBFD2 000A + D11EBFD4 0003 + 811EBFD4 0000 + D11EBFD6 0000 + 811EBFD6 02C4 + 801EBFD9 0004 + 801EBFDB 0000 + 811EBFE2 0384 + 801EBFE7 0004 + 801EBF45 009E + 801EBF47 0084 + 801EBF48 0010 + 801EC2D9 0000 + 801EC447 0085 + 801EC547 0086 + 811EA6B6 2743 + 811EA73E 0114 + 811EA7F2 0115 + 811EA8A6 00A3 + 811EA92E 009D + 811EA9E2 00A4 + 811EAA96 00DA + 811EAB1E 00DB + 811EABD2 00DF + 811EAC86 0130 + 811EAD0E 008D + 811EADC2 012E + 811EAE76 0111 + 811EAEFE 2740 + 811EAFB2 2741 + 811EB066 00A0 + 811EB0EE 009E + 811EB1A2 009F + 811EB256 274F + 811EB2DE 2750 + 811EB392 0117 + 811EB446 0131 + 811EB4CE 008E + 811EB582 0132 + 811EB636 00A1 + 811EB6BE 0119 + 811EA62E 00FA + 801ED3DF 0000 + 801ED2DF 0001 + D0024337 0007 + 80024337 001F + cn All 64 Characters In Multi Player + 8002B197 0040 + cn Secret Island on Dam Level + cd For the above code to work,Get to the 2nd guard tower & go down the ladder on the left hand side & to the end of the Dock, Press L & GS and you will be transfered in the water. Just keep walking straight & you will get to it. Obviously you can't actually climb ladders or anything, you will simply walkthrough anything on that Part, if you want to walk back to the Dock, when you come near it click the cheat back on & keep pressing L & GS untill you are back on it. + D0064F31 0020 + 800D33ED 0050 + 880D33ED 0000 + cn Replace Cradle with Citadell hidden level + 8002A8F7 0029 + 8104468A 8970 + 81044690 3F44 + 81044692 BDEA + 81044694 3F80 + 81044696 0000 + 81044698 4219 + 8104469A D89D + 80069F80 00C4 + +crc 98DF9DFC-6606C189-C:45 +gn Harvest Moon (U) + cn Infinite\Money + 811FD60E FFFF + cn Belongings\Slot 01 + 80189084 ???? 0000:"Nothing",0001:"Weeds",0002:"Boulder",0003:"Lumber",0004:"Moondrop Plant",0005:"Pink-Cat-Mint Plant",0006:"Blue Plant",0007:"Cake",0008:"Pie",0009:"Cookie",000A:"Blue Feather",000B:"Pink Liquid In A Bottle",000C:"Red Box",000D:"Turnips",000E:"Potatoes",000F:"Cabbages",0010:"Tomatoes",0011:"Corn",0012:"Eggplant",0013:"Strawberries",0014:"Eggs",0015:"Milk",0016:"M Size Milk",0017:"L Size Milk",0018:"Gold Milk",0019:"Sheared Wool",001A:"High Quality Wool",001B:"Wild Grapes",001C:"Very Berry Fruit",001D:"Tropical Fruit",001E:"Walnuts",001F:"Mushrooms",0020:"Poisonous Mushroom",0021:"Green Box",0022:"Berry Of Full Moon Plant",0023:"Medicinal Herbs",0024:"Edible Herbs",0025:"Small Fish",0026:"Fish",0027:"Big Fish",0028:"Dumpling",0029:"Cotton Candy",002A:"Fried Octopus",002B:"Roasted Corn",002C:"Candy",002D:"Chocolate",002E:"Iron-Ore",002F:"Blue Rock",0030:"Rare Metal",0031:"Moonlight Stone",0032:"Pontata Root",0033:"Chicken",0034:"Chocolate Bar Picture",0035:"???",0036:"Blue Egg Shaped Device",0037:"??",0038:"Chocolate Bar Picture",0039:"Fodder",003A:"White Bag",003B:"Tan Bag",003C:"Green Bag",003D:"Red Bag",003E:"Yellow Bag",003F:"Purple Bag" + cn Belongings\Slot 02 + 80189085 ???? 0000:"Nothing",0001:"Weeds",0002:"Boulder",0003:"Lumber",0004:"Moondrop Plant",0005:"Pink-Cat-Mint Plant",0006:"Blue Plant",0007:"Cake",0008:"Pie",0009:"Cookie",000A:"Blue Feather",000B:"Pink Liquid In A Bottle",000C:"Red Box",000D:"Turnips",000E:"Potatoes",000F:"Cabbages",0010:"Tomatoes",0011:"Corn",0012:"Eggplant",0013:"Strawberries",0014:"Eggs",0015:"Milk",0016:"M Size Milk",0017:"L Size Milk",0018:"Gold Milk",0019:"Sheared Wool",001A:"High Quality Wool",001B:"Wild Grapes",001C:"Very Berry Fruit",001D:"Tropical Fruit",001E:"Walnuts",001F:"Mushrooms",0020:"Poisonous Mushroom",0021:"Green Box",0022:"Berry Of Full Moon Plant",0023:"Medicinal Herbs",0024:"Edible Herbs",0025:"Small Fish",0026:"Fish",0027:"Big Fish",0028:"Dumpling",0029:"Cotton Candy",002A:"Fried Octopus",002B:"Roasted Corn",002C:"Candy",002D:"Chocolate",002E:"Iron-Ore",002F:"Blue Rock",0030:"Rare Metal",0031:"Moonlight Stone",0032:"Pontata Root",0033:"Chicken",0034:"Chocolate Bar Picture",0035:"???",0036:"Blue Egg Shaped Device",0037:"??",0038:"Chocolate Bar Picture",0039:"Fodder",003A:"White Bag",003B:"Tan Bag",003C:"Green Bag",003D:"Red Bag",003E:"Yellow Bag",003F:"Purple Bag" + cn Belongings\Slot 03 + 80189086 ???? 0000:"Nothing",0001:"Weeds",0002:"Boulder",0003:"Lumber",0004:"Moondrop Plant",0005:"Pink-Cat-Mint Plant",0006:"Blue Plant",0007:"Cake",0008:"Pie",0009:"Cookie",000A:"Blue Feather",000B:"Pink Liquid In A Bottle",000C:"Red Box",000D:"Turnips",000E:"Potatoes",000F:"Cabbages",0010:"Tomatoes",0011:"Corn",0012:"Eggplant",0013:"Strawberries",0014:"Eggs",0015:"Milk",0016:"M Size Milk",0017:"L Size Milk",0018:"Gold Milk",0019:"Sheared Wool",001A:"High Quality Wool",001B:"Wild Grapes",001C:"Very Berry Fruit",001D:"Tropical Fruit",001E:"Walnuts",001F:"Mushrooms",0020:"Poisonous Mushroom",0021:"Green Box",0022:"Berry Of Full Moon Plant",0023:"Medicinal Herbs",0024:"Edible Herbs",0025:"Small Fish",0026:"Fish",0027:"Big Fish",0028:"Dumpling",0029:"Cotton Candy",002A:"Fried Octopus",002B:"Roasted Corn",002C:"Candy",002D:"Chocolate",002E:"Iron-Ore",002F:"Blue Rock",0030:"Rare Metal",0031:"Moonlight Stone",0032:"Pontata Root",0033:"Chicken",0034:"Chocolate Bar Picture",0035:"???",0036:"Blue Egg Shaped Device",0037:"??",0038:"Chocolate Bar Picture",0039:"Fodder",003A:"White Bag",003B:"Tan Bag",003C:"Green Bag",003D:"Red Bag",003E:"Yellow Bag",003F:"Purple Bag" + cn Belongings\Slot 04 + 80189087 ???? 0000:"Nothing",0001:"Weeds",0002:"Boulder",0003:"Lumber",0004:"Moondrop Plant",0005:"Pink-Cat-Mint Plant",0006:"Blue Plant",0007:"Cake",0008:"Pie",0009:"Cookie",000A:"Blue Feather",000B:"Pink Liquid In A Bottle",000C:"Red Box",000D:"Turnips",000E:"Potatoes",000F:"Cabbages",0010:"Tomatoes",0011:"Corn",0012:"Eggplant",0013:"Strawberries",0014:"Eggs",0015:"Milk",0016:"M Size Milk",0017:"L Size Milk",0018:"Gold Milk",0019:"Sheared Wool",001A:"High Quality Wool",001B:"Wild Grapes",001C:"Very Berry Fruit",001D:"Tropical Fruit",001E:"Walnuts",001F:"Mushrooms",0020:"Poisonous Mushroom",0021:"Green Box",0022:"Berry Of Full Moon Plant",0023:"Medicinal Herbs",0024:"Edible Herbs",0025:"Small Fish",0026:"Fish",0027:"Big Fish",0028:"Dumpling",0029:"Cotton Candy",002A:"Fried Octopus",002B:"Roasted Corn",002C:"Candy",002D:"Chocolate",002E:"Iron-Ore",002F:"Blue Rock",0030:"Rare Metal",0031:"Moonlight Stone",0032:"Pontata Root",0033:"Chicken",0034:"Chocolate Bar Picture",0035:"???",0036:"Blue Egg Shaped Device",0037:"??",0038:"Chocolate Bar Picture",0039:"Fodder",003A:"White Bag",003B:"Tan Bag",003C:"Green Bag",003D:"Red Bag",003E:"Yellow Bag",003F:"Purple Bag" + cn Belongings\Slot 05 + 80189088 ???? 0000:"Nothing",0001:"Weeds",0002:"Boulder",0003:"Lumber",0004:"Moondrop Plant",0005:"Pink-Cat-Mint Plant",0006:"Blue Plant",0007:"Cake",0008:"Pie",0009:"Cookie",000A:"Blue Feather",000B:"Pink Liquid In A Bottle",000C:"Red Box",000D:"Turnips",000E:"Potatoes",000F:"Cabbages",0010:"Tomatoes",0011:"Corn",0012:"Eggplant",0013:"Strawberries",0014:"Eggs",0015:"Milk",0016:"M Size Milk",0017:"L Size Milk",0018:"Gold Milk",0019:"Sheared Wool",001A:"High Quality Wool",001B:"Wild Grapes",001C:"Very Berry Fruit",001D:"Tropical Fruit",001E:"Walnuts",001F:"Mushrooms",0020:"Poisonous Mushroom",0021:"Green Box",0022:"Berry Of Full Moon Plant",0023:"Medicinal Herbs",0024:"Edible Herbs",0025:"Small Fish",0026:"Fish",0027:"Big Fish",0028:"Dumpling",0029:"Cotton Candy",002A:"Fried Octopus",002B:"Roasted Corn",002C:"Candy",002D:"Chocolate",002E:"Iron-Ore",002F:"Blue Rock",0030:"Rare Metal",0031:"Moonlight Stone",0032:"Pontata Root",0033:"Chicken",0034:"Chocolate Bar Picture",0035:"???",0036:"Blue Egg Shaped Device",0037:"??",0038:"Chocolate Bar Picture",0039:"Fodder",003A:"White Bag",003B:"Tan Bag",003C:"Green Bag",003D:"Red Bag",003E:"Yellow Bag",003F:"Purple Bag" + cn Belongings\Slot 06 + 80189089 ???? 0000:"Nothing",0001:"Weeds",0002:"Boulder",0003:"Lumber",0004:"Moondrop Plant",0005:"Pink-Cat-Mint Plant",0006:"Blue Plant",0007:"Cake",0008:"Pie",0009:"Cookie",000A:"Blue Feather",000B:"Pink Liquid In A Bottle",000C:"Red Box",000D:"Turnips",000E:"Potatoes",000F:"Cabbages",0010:"Tomatoes",0011:"Corn",0012:"Eggplant",0013:"Strawberries",0014:"Eggs",0015:"Milk",0016:"M Size Milk",0017:"L Size Milk",0018:"Gold Milk",0019:"Sheared Wool",001A:"High Quality Wool",001B:"Wild Grapes",001C:"Very Berry Fruit",001D:"Tropical Fruit",001E:"Walnuts",001F:"Mushrooms",0020:"Poisonous Mushroom",0021:"Green Box",0022:"Berry Of Full Moon Plant",0023:"Medicinal Herbs",0024:"Edible Herbs",0025:"Small Fish",0026:"Fish",0027:"Big Fish",0028:"Dumpling",0029:"Cotton Candy",002A:"Fried Octopus",002B:"Roasted Corn",002C:"Candy",002D:"Chocolate",002E:"Iron-Ore",002F:"Blue Rock",0030:"Rare Metal",0031:"Moonlight Stone",0032:"Pontata Root",0033:"Chicken",0034:"Chocolate Bar Picture",0035:"???",0036:"Blue Egg Shaped Device",0037:"??",0038:"Chocolate Bar Picture",0039:"Fodder",003A:"White Bag",003B:"Tan Bag",003C:"Green Bag",003D:"Red Bag",003E:"Yellow Bag",003F:"Purple Bag" + cn Belongings\Slot 07 + 8018908A ???? 0000:"Nothing",0001:"Weeds",0002:"Boulder",0003:"Lumber",0004:"Moondrop Plant",0005:"Pink-Cat-Mint Plant",0006:"Blue Plant",0007:"Cake",0008:"Pie",0009:"Cookie",000A:"Blue Feather",000B:"Pink Liquid In A Bottle",000C:"Red Box",000D:"Turnips",000E:"Potatoes",000F:"Cabbages",0010:"Tomatoes",0011:"Corn",0012:"Eggplant",0013:"Strawberries",0014:"Eggs",0015:"Milk",0016:"M Size Milk",0017:"L Size Milk",0018:"Gold Milk",0019:"Sheared Wool",001A:"High Quality Wool",001B:"Wild Grapes",001C:"Very Berry Fruit",001D:"Tropical Fruit",001E:"Walnuts",001F:"Mushrooms",0020:"Poisonous Mushroom",0021:"Green Box",0022:"Berry Of Full Moon Plant",0023:"Medicinal Herbs",0024:"Edible Herbs",0025:"Small Fish",0026:"Fish",0027:"Big Fish",0028:"Dumpling",0029:"Cotton Candy",002A:"Fried Octopus",002B:"Roasted Corn",002C:"Candy",002D:"Chocolate",002E:"Iron-Ore",002F:"Blue Rock",0030:"Rare Metal",0031:"Moonlight Stone",0032:"Pontata Root",0033:"Chicken",0034:"Chocolate Bar Picture",0035:"???",0036:"Blue Egg Shaped Device",0037:"??",0038:"Chocolate Bar Picture",0039:"Fodder",003A:"White Bag",003B:"Tan Bag",003C:"Green Bag",003D:"Red Bag",003E:"Yellow Bag",003F:"Purple Bag" + cn Belongings\Slot 08 + 8018908B ???? 0000:"Nothing",0001:"Weeds",0002:"Boulder",0003:"Lumber",0004:"Moondrop Plant",0005:"Pink-Cat-Mint Plant",0006:"Blue Plant",0007:"Cake",0008:"Pie",0009:"Cookie",000A:"Blue Feather",000B:"Pink Liquid In A Bottle",000C:"Red Box",000D:"Turnips",000E:"Potatoes",000F:"Cabbages",0010:"Tomatoes",0011:"Corn",0012:"Eggplant",0013:"Strawberries",0014:"Eggs",0015:"Milk",0016:"M Size Milk",0017:"L Size Milk",0018:"Gold Milk",0019:"Sheared Wool",001A:"High Quality Wool",001B:"Wild Grapes",001C:"Very Berry Fruit",001D:"Tropical Fruit",001E:"Walnuts",001F:"Mushrooms",0020:"Poisonous Mushroom",0021:"Green Box",0022:"Berry Of Full Moon Plant",0023:"Medicinal Herbs",0024:"Edible Herbs",0025:"Small Fish",0026:"Fish",0027:"Big Fish",0028:"Dumpling",0029:"Cotton Candy",002A:"Fried Octopus",002B:"Roasted Corn",002C:"Candy",002D:"Chocolate",002E:"Iron-Ore",002F:"Blue Rock",0030:"Rare Metal",0031:"Moonlight Stone",0032:"Pontata Root",0033:"Chicken",0034:"Chocolate Bar Picture",0035:"???",0036:"Blue Egg Shaped Device",0037:"??",0038:"Chocolate Bar Picture",0039:"Fodder",003A:"White Bag",003B:"Tan Bag",003C:"Green Bag",003D:"Red Bag",003E:"Yellow Bag",003F:"Purple Bag" + cn Tool\Slot 01 + 80189075 ???? 0000:"Nothing",0001:"Sickle",0002:"Hoe",0003:"Axe",0004:"Hammer",0005:"Watering Can",0006:"Milker",0007:"Bell",0008:"Brush",0009:"Clippers",000A:"Turnip Seeds",000B:"Potato Seeds",000C:"Cabbage Seeds",000D:"Tomato Seeds",000E:"Corn Seeds",000F:"Eggplant Seeds",0010:"Strawberry Seeds",0011:"Moon Drop Grass Seeds",0012:"Pink-Cat-Mint Seeds",0013:"Blue Mist Seeds",0014:"Bird Feed",0015:"Ball No Picture",0016:"Feeding Bottle",0017:"??",0018:"Fishing Pole",0019:"Miracle Potion",001A:"Medicine For Cows",001B:"Grass Seeds",001C:"Blue Feather",001D:"Empty Bottle",001E:"??",001F:"Weeds No Picture",0020:"Boulder No Picture" + cn Tool\Slot 02 + 80189076 ???? 0000:"Nothing",0001:"Sickle",0002:"Hoe",0003:"Axe",0004:"Hammer",0005:"Watering Can",0006:"Milker",0007:"Bell",0008:"Brush",0009:"Clippers",000A:"Turnip Seeds",000B:"Potato Seeds",000C:"Cabbage Seeds",000D:"Tomato Seeds",000E:"Corn Seeds",000F:"Eggplant Seeds",0010:"Strawberry Seeds",0011:"Moon Drop Grass Seeds",0012:"Pink-Cat-Mint Seeds",0013:"Blue Mist Seeds",0014:"Bird Feed",0015:"Ball No Picture",0016:"Feeding Bottle",0017:"??",0018:"Fishing Pole",0019:"Miracle Potion",001A:"Medicine For Cows",001B:"Grass Seeds",001C:"Blue Feather",001D:"Empty Bottle",001E:"??",001F:"Weeds No Picture",0020:"Boulder No Picture" + cn Tool\Slot 03 + 80189077 ???? 0000:"Nothing",0001:"Sickle",0002:"Hoe",0003:"Axe",0004:"Hammer",0005:"Watering Can",0006:"Milker",0007:"Bell",0008:"Brush",0009:"Clippers",000A:"Turnip Seeds",000B:"Potato Seeds",000C:"Cabbage Seeds",000D:"Tomato Seeds",000E:"Corn Seeds",000F:"Eggplant Seeds",0010:"Strawberry Seeds",0011:"Moon Drop Grass Seeds",0012:"Pink-Cat-Mint Seeds",0013:"Blue Mist Seeds",0014:"Bird Feed",0015:"Ball No Picture",0016:"Feeding Bottle",0017:"??",0018:"Fishing Pole",0019:"Miracle Potion",001A:"Medicine For Cows",001B:"Grass Seeds",001C:"Blue Feather",001D:"Empty Bottle",001E:"??",001F:"Weeds No Picture",0020:"Boulder No Picture" + cn Tool\Slot 04 + 80189078 ???? 0000:"Nothing",0001:"Sickle",0002:"Hoe",0003:"Axe",0004:"Hammer",0005:"Watering Can",0006:"Milker",0007:"Bell",0008:"Brush",0009:"Clippers",000A:"Turnip Seeds",000B:"Potato Seeds",000C:"Cabbage Seeds",000D:"Tomato Seeds",000E:"Corn Seeds",000F:"Eggplant Seeds",0010:"Strawberry Seeds",0011:"Moon Drop Grass Seeds",0012:"Pink-Cat-Mint Seeds",0013:"Blue Mist Seeds",0014:"Bird Feed",0015:"Ball No Picture",0016:"Feeding Bottle",0017:"??",0018:"Fishing Pole",0019:"Miracle Potion",001A:"Medicine For Cows",001B:"Grass Seeds",001C:"Blue Feather",001D:"Empty Bottle",001E:"??",001F:"Weeds No Picture",0020:"Boulder No Picture" + cn Tool\Slot 05 + 80189079 ???? 0000:"Nothing",0001:"Sickle",0002:"Hoe",0003:"Axe",0004:"Hammer",0005:"Watering Can",0006:"Milker",0007:"Bell",0008:"Brush",0009:"Clippers",000A:"Turnip Seeds",000B:"Potato Seeds",000C:"Cabbage Seeds",000D:"Tomato Seeds",000E:"Corn Seeds",000F:"Eggplant Seeds",0010:"Strawberry Seeds",0011:"Moon Drop Grass Seeds",0012:"Pink-Cat-Mint Seeds",0013:"Blue Mist Seeds",0014:"Bird Feed",0015:"Ball No Picture",0016:"Feeding Bottle",0017:"??",0018:"Fishing Pole",0019:"Miracle Potion",001A:"Medicine For Cows",001B:"Grass Seeds",001C:"Blue Feather",001D:"Empty Bottle",001E:"??",001F:"Weeds No Picture",0020:"Boulder No Picture" + cn Tool\Slot 06 + 8018907A ???? 0000:"Nothing",0001:"Sickle",0002:"Hoe",0003:"Axe",0004:"Hammer",0005:"Watering Can",0006:"Milker",0007:"Bell",0008:"Brush",0009:"Clippers",000A:"Turnip Seeds",000B:"Potato Seeds",000C:"Cabbage Seeds",000D:"Tomato Seeds",000E:"Corn Seeds",000F:"Eggplant Seeds",0010:"Strawberry Seeds",0011:"Moon Drop Grass Seeds",0012:"Pink-Cat-Mint Seeds",0013:"Blue Mist Seeds",0014:"Bird Feed",0015:"Ball No Picture",0016:"Feeding Bottle",0017:"??",0018:"Fishing Pole",0019:"Miracle Potion",001A:"Medicine For Cows",001B:"Grass Seeds",001C:"Blue Feather",001D:"Empty Bottle",001E:"??",001F:"Weeds No Picture",0020:"Boulder No Picture" + cn Tool\Slot 07 + 8018907B ???? 0000:"Nothing",0001:"Sickle",0002:"Hoe",0003:"Axe",0004:"Hammer",0005:"Watering Can",0006:"Milker",0007:"Bell",0008:"Brush",0009:"Clippers",000A:"Turnip Seeds",000B:"Potato Seeds",000C:"Cabbage Seeds",000D:"Tomato Seeds",000E:"Corn Seeds",000F:"Eggplant Seeds",0010:"Strawberry Seeds",0011:"Moon Drop Grass Seeds",0012:"Pink-Cat-Mint Seeds",0013:"Blue Mist Seeds",0014:"Bird Feed",0015:"Ball No Picture",0016:"Feeding Bottle",0017:"??",0018:"Fishing Pole",0019:"Miracle Potion",001A:"Medicine For Cows",001B:"Grass Seeds",001C:"Blue Feather",001D:"Empty Bottle",001E:"??",001F:"Weeds No Picture",0020:"Boulder No Picture" + cn Tool\Slot 08 + 8018907C ???? 0000:"Nothing",0001:"Sickle",0002:"Hoe",0003:"Axe",0004:"Hammer",0005:"Watering Can",0006:"Milker",0007:"Bell",0008:"Brush",0009:"Clippers",000A:"Turnip Seeds",000B:"Potato Seeds",000C:"Cabbage Seeds",000D:"Tomato Seeds",000E:"Corn Seeds",000F:"Eggplant Seeds",0010:"Strawberry Seeds",0011:"Moon Drop Grass Seeds",0012:"Pink-Cat-Mint Seeds",0013:"Blue Mist Seeds",0014:"Bird Feed",0015:"Ball No Picture",0016:"Feeding Bottle",0017:"??",0018:"Fishing Pole",0019:"Miracle Potion",001A:"Medicine For Cows",001B:"Grass Seeds",001C:"Blue Feather",001D:"Empty Bottle",001E:"??",001F:"Weeds No Picture",0020:"Boulder No Picture" + cn Item\Slot 01 + 8018908E ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Item\Slot 02 + 8018908F ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Item\Slot 03 + 80189090 ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Item\Slot 04 + 80189091 ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Item\Slot 05 + 80189092 ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Item\Slot 06 + 80189093 ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Item\Slot 07 + 80189094 ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Item\Slot 08 + 80189095 ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Item\Slot 09 + 80189096 ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Item\Slot 10 + 80189097 ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Item\Slot 11 + 80189098 ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Item\Slot 12 + 80189099 ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Item\Slot 13 + 8018909A ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Item\Slot 14 + 8018909B ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Item\Slot 15 + 8018909C ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Item\Slot 16 + 8018909D ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Item\Slot 17 + 8018909E ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Item\Slot 18 + 8018909F ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Item\Slot 19 + 801890A0 ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Item\Slot 20 + 801890A1 ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Item\Slot 21 + 801890A2 ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Item\Slot 22 + 801890A3 ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Item\Slot 23 + 801890A4 ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Item\Slot 24 + 801890A5 ???? 0000:"Nothing",0001:"Ocarina",0002:"Flower Card",0003:"Cake Card",0004:"Broken Music Box",0005:"??",0006:"Old Wine",0007:"??",0008:"??",0009:"Book From Library",000A:"Scroll To Bury",000B:"Marble",000C:"GoodLuck Charm",000D:"Empty Metal Bag",000E:"Horse Race Ticket",000F:"Dog Race Ticket",0010:"Potpourri",0011:"Embroidered Hankerchief",0012:"Hand - Knit Socks",0013:"Lucky Bracelet",0014:"Flower Bath Crystals",0015:"Stamina Carrot" + cn Infinite\Watering Can Uses + 8016FBCD 0004 + cn Infinite\Fodder Spout (Sheep And Cows) + 81180714 0063 + cn Infinite\Chicken Feed + 80237411 005C + cn Infinite\Lumber + 81189E50 03E7 + cn Infinite\Stamina + 80189060 00FF + cn Infinite\Flower Card Points + 802373F0 0063 + cn Infinite\Medals For Horse & Dog Races + 81189B06 270F + 81205206 270F + cn Infinite\Cake Card Points + 80181B10 0063 + cn Infinite\Horse Stamina + 802F5015 0002 + cn Make\Ann Love You + 801C3F93 00FF + cn Make\Elli Love You + 801C3F92 00FF + cn Make\Maria Love You + 801C3F90 00FF + cn Make\Popuri Love You + 801C3F91 00FF + cn Make\Karen Love You + 801C3F94 00FF + cn Have\All Pics + 8118905A FFFF + cn Have\Win Dog Races + 801886B0 00FF + cn Have\Max Shipped In Bin! + 8023738A FFFF + +crc 7F3CEB77-8981030A-C:45 +gn Hercules: The Legendary Journeys (U) + cn Infinite Health + 810CF93E 03E7 + 810CF942 03E7 + cn Infinite Dinars + 800B6043 00E8 + 800B6042 00E8 + cn Infinite Magic + 810B65CA 0063 + 810B65B2 0063 + 810B65E2 0063 + 810B65FA 0063 + cn Press L to Levitate + cd Press L Button to Levitate & Let go to come back down + D017D2D5 0020 + 810CF994 44CB + cn Press L for 1 Hit Kill Punch + cd Press The L Button & Hold B & Then Let Go to Kill Enimies,Rocks,Tents etc with One Punch. + D0103383 0020 + 800D9BCE 0000 + +crc 9CAB6AEA-87C61C00-C:45 +gn Hexen (U) + cn Invincibility\Player 1 + 8113DB4C FFFF + cn Infinite\Blue Mana\Player 1 + 8013DB7D 00CF + cn Infinite\Green Mana\Player 1 + 8013DB7F 00CF + cn Infinite\Ammo & Items\Player 1 + 50002004 0000 + 8013DAC3 0064 + cn Always Have\Fist,Mace,Staff\Player 1 + 8013DB75 00FF + cn Always Have\Axe,Staff,Frost,Shards\Player 1 + 8013DB77 00FF + cn Always Have\Hammer,Firestorm & Arc of Death\Player 1 + 8013DB79 00FF + cn Always Have\Quietus,Wraithverge,Bloodscourge\Player 1 + 8013DB7B 00FF + cn Open\Main Cheat Menu + 80136773 0005 + cn Open\All Options in Cheat Menu + 81136696 FFFF + cn Have All\Keys\Player 1 + 8113DB5C 07FF + cn Boots Of Speed Always On\Player 1 + 8113DB58 03FF + cn Icon Of The Defender Always On\Player 1 + 8113DB4C 03FF + cn Wings Of Wraith Always On\Player 1 + 8013DB53 03FF + cn Play As\Player 1 + 8014A749 ???? 0000:"Fighter",0000:"1 Cleric",0000:"2 Mage" + cn Invincibility\Player 2 + 8113DCE8 FFFF + cn Icon Of The Defender Always On\Player 2 + 8113DCE8 03FF + cn Boots Of Speed Always On\Player 2 + 8113DCF4 03FF + cn Wings Of Wraith Always On\Player 2 + 8113DCEE 03FF + cn Have All\Keys\Player 2 + 8113DCF8 07FF + cn Infinite\Blue Mana\Player 2 + 8013DD19 00CF + cn Infinite\Green Mana\Player 2 + 8013DD1B 00CF + cn Always Have\Fist,Mace,Staff\Player 2 + 8013DD11 00FF + cn Always Have\Axe,Staff,Frost,Shards\Player 2 + 8013DD13 00FF + cn Always Have\Hammer,Firestorm & Arc of Death\Player 2 + 8013DD15 00FF + cn Always Have\Quietus,Wraithverge,Bloodscourge\Player 2 + 8013DD17 00FF + cn Invincibility\Player 3 + 8113DE84 FFFF + cn Icon Of The Defender Always On\Player 3 + 8113DE84 03FF + cn Boots Of Speed Always On\Player 3 + 8113DE90 03FF + cn Wings Of Wraith Always On\Player 3 + 8113DE8A 03FF + cn Have All\Keys\Player 3 + 8113DE94 07FF + cn Infinite\Blue Mana\Player 3 + 8013DEB5 00CF + cn Infinite\Green Mana\Player 3 + 8013DEB7 00CF + cn Always Have\Fist,Mace,Staff\Player 3 + 8013DEAD 00FF + cn Always Have\Axe,Staff,Frost,Shards\Player 3 + 8013DEAF 00FF + cn Always Have\Hammer,Firestorm & Arc of Death\Player 3 + 8013DEB1 00FF + cn Always Have\Quietus,Wraithverge,Bloodscourge\Player 3 + 8013DEB3 00FF + cn Invincibility\Player 4 + 8113E020 FFFF + cn Icon Of The Defender Always On\Player 4 + 8113E020 03FF + cn Boots Of Speed Always On\Player 4 + 8113E02C 03FF + cn Wings Of Wraith Always On\Player 4 + 8113E026 03FF + cn Have All\Keys\Player 4 + 8113E030 07FF + cn Infinite\Blue Mana\Player 4 + 8013E051 00CF + cn Infinite\Green Mana\Player 4 + 8013E053 00CF + cn Always Have\Fist,Mace,Staff\Player 4 + 8013E049 00FF + cn Always Have\Axe,Staff,Frost,Shards\Player 4 + 8013E04B 00FF + cn Always Have\Hammer,Firestorm & Arc of Death\Player 4 + 8013E04D 00FF + cn Always Have\Quietus,Wraithverge,Bloodscourge\Player 4 + 8013E04F 00FF + +crc C7C98F8E-42145DDE-C:45 +gn Hot Wheels Turbo Racing (U) + cn Infinite Turbos\Player 1 + 80118CFC 000A + cn Infinite Turbos\Player 2 + 80119478 000A + cn Start On Lap Modifier\Player 1 + D0118AA8 0000 + 80118AA8 ???? 0000:"1st",0001:"2nd",0002:"3rd",0003:"4th" + cn Start On Lap Modifier\Player 2 + D0119224 0000 + 80119224 ???? 0000:"1st",0001:"2nd",0002:"3rd",0003:"4th" + cn Max Tournament Points + 81124A16 00FF + cn Have\All Tracks + 81124A0E FFFF + cn Have\All Cars & Cups\Player 1 + 81124A0A FFFF + cn Have\All Cars & Cups\Player 2 + 81124B4A FFFF + cn Press L For Time Is Always 0:00:00\Player 1 + D0137FE5 0020 + 810F3900 0000 + D0137FE5 0020 + 810F3902 0000 + cn Press L For Time Is Always 0:00:00\Player 2 + D0137FED 0020 + 810F3900 0000 + D0137FED 0020 + 810F3902 0000 + cn Have\All Special Cars\Player 1 + 81124A04 FFFF + 81124A06 FFFF + 81124A0A FFFF + cn Have\All Special Cars\Player 2 + 81124B44 FFFF + 81124B46 FFFF + 81124B4A FFFF + cn Allways 1st + 8111D7EA 0000 + +crc 102888BF-434888CA-C:45 +gn Hybrid Heaven (U) + cn Have All\Keys + 50000410 0000 + 8017E130 0063 + 50000410 0000 + 8017E138 0063 + cn Infinite\Weapons & Items + 50000610 0000 + 8017E0D0 0063 + 50000610 0000 + 8017E0D8 0063 + cn Infinite\Refresh Items + 50000D10 0000 + 8017E008 0063 + 50000C10 0000 + 8017E010 0063 + cn Infinite\Max Body Stats + 8117DC48 270F + 8117DC88 0063 + 50000C02 0000 + 8117DC50 270F + 50000502 0000 + 8117DC80 270F + 50000602 0000 + 8117DCA8 270F + 50000602 0000 + 8117DCB6 270F + cn Infinite\Max Health + 8117DC40 270F + 8117DC42 270F + cn Level 999 + 8117DC88 270F + cn Press L To Levitate + D005CE51 0020 + 8124A0B0 3FCB + cn Have All\Moves + 50005306 0000 + 81183CE0 0100 + 50005306 0000 + 81183CE2 00FF + cn Editor's Cheat Level and Battle Select + 801CC8C4 0005 + +crc C8DC65EB-3D8C8904-C:45 +gn Hydro Thunder (U) + cn Always 1st + 812C4C96 0001 + cn Infinite\Time + 812B4890 42C8 + cn Infinite\Boosts\Player 1 + 812C4C9C 4190 + cn Have All\Races + 812B5C94 0101 + 812B5C96 0101 + 812B5C98 0101 + 812B5C9A 0101 + 812B5C9C 0101 + 812B5C9E 0101 + 812B5CA0 0101 + cn Have All\Boats + 812B5CA2 0101 + 812B5CA4 0101 + 812B5CA6 0101 + 812B5CA8 0101 + 812B5CAA 0101 + 812B5CAC 0101 + 812B5CAE 0101 + cn Infinite\Boosts\Player 2 + 812C4FCC 4190 + cn Hydro Speedway + 802B5C94 ???? 0001:"Unlocked & Not Completed",0003:"Unlocked & Completed" + +crc E436467A-82DE8F9B-C:45 +gn Indy Racing 2000 (U) + cn Max Exp (Gold Cup - All Classes Unlocked) + cd With the 'Max Exp' codes for the Gold Cup, start a new file and leave it and go back to it again. + 81033918 7FFF + 8103391A FFFF + cn Driver Modifier (Champsionship Mode) + 812CBEC6 ???? 0000:"Scott Goodyear #4",0001:"Greg Ray #2",0002:"Billy Boat #11",0003:"Eddie Cheever Jr.#51",0004:"Buddy Lazier #91",0005:"Davey Hamilton #9",0006:"Sam Schmidt #99",0007:"Scott Sharp #8",0008:"Buzz Calkins #12",0009:"Kenny Brack #14",000A:"Robbie Buyl #22",000B:"Tyce Carison #20",000C:"Mark Dismore #28",000D:"Roberto Guerrero #50",000E:"Johnny Unser #92",000F:"Robby Unser #81",0010:"Jeff Ward #21",0011:"Stephan Gregoire #7",0012:"Robby McGehee #55",0013:"John Hollansworth Jr. #42" + cn Always Place 1st + 8012955F 0001 + cn Unlock\Gold Cup 1st Upgrade + 81023100 0000 + 81023102 0000 + cn Unlock\Gold Cup 2nd Upgrade + 81023104 0000 + 81023106 0000 + cn Unlock\Sprint Car Class + 810230EE 0000 + 810230EC 0000 + cn Unlock\Formula Cars Part 1 + 810230F0 0000 + 810230F2 0000 + 810230F4 0000 + 810230F6 0000 + +crc E616B5BC-C9658B88-C:45 +gn Iggy's Reckin' Balls (U) + cn Extra Characters + 810C632E FFFF + cn Always Have 99 Points + 810D8EE0 0063 + cn Infinite Credits + 800BDEA5 0005 + cn Enable All Courses + 810CCDF2 0B00 + 810CCDF4 0B00 + 810CCDF6 0B00 + +crc 69256460-B9A3F586-C:45 +gn Jeopardy (U) + cn Max Money\Player 1 + 81058122 FFFF + cn Max Money\Player 2 + 81058124 FFFF + cn Max Money\Player 3 + 81058126 FFFF + +crc BB30B1A5-FCF712CE-C:45 +gn Jeremy McGrath Supercross 2000 (U) + cn Extra Points + 800711E7 00FF + cn Enable Tabletop Freestyle + 81071832 0001 + cn Enable Chasm Freestyle + 81071834 0001 + cn Enable Jim Jam Freestyle + 81071838 0001 + cn Enable Moon Freestyle + 8107183C 0001 + +crc 8A6009B6-94ACE150-C:45 +gn Jet Force Gemini (U) + cn Access\All Characters + 801E6040 FFFF + cn Juno\Infinite Continues + 800A3281 0002 + cn Juno\Full & Max Health + 801BF976 0040 + 801E61E5 000C + 801E61E2 0040 + cn Juno\Access\All Keys + 811E6248 FFF7 + cn Juno\Access\All Objects + 811E624A FFFF + cn Juno\Infinite\Mizar Tokens + 811E61F4 02F4 + cn Juno\Max Blue & White Heads + 811E61EA 03E7 + 811E61E8 03E7 + cn Juno\Infinite\Max Ammo All Weapons + 50000302 0000 + 811E61F6 02F4 + 50000802 0000 + 811E61FC 02F4 + 50000402 0000 + 811E620C 02F4 + cn Vela\Full & Max Health + 801E616F 000C + 801E616C 0040 + cn Vela\Access\All Keys + 811E61D2 FF70 + cn Vela\Access\All Objects + 811E61D4 FFFF + cn Vela\Infinite\Mizar Tokens + 811E617E 02F4 + cn Vela\Max\Blue & White Heads + 811E6174 03E7 + 811E6172 03E7 + cn Vela\Infinite\Max Ammo All Weapons + 50000302 0000 + 811E6180 02F4 + 50000802 0000 + 811E6186 02F4 + 50000402 0000 + 811E6196 02F4 + cn Lupus\Full & Max Health + 801BF9EC 0040 + 801E625B 000C + 801E6258 0040 + cn Lupus\Access\All Keys + 811E62BE FF70 + cn Lupus\Access\All Objects + 811E62C0 FFFF + cn Lupus\Infinite\Mizar Tokens + 811E626A 02F4 + cn Lupus\Max\Blue & White Heads + 811E6260 03E7 + 811E625E 03E7 + cn Lupus\Infinite\Max Ammo All Weapons + 50000302 0000 + 811E626C 02F4 + 50000802 0000 + 811E6272 02F4 + 50000402 0000 + 811E6282 02F4 + cn Access\All Floyd Awards + cd only enable One character at a time when using this code + 50000501 0000 + 801E6038 0005 + cn Juno\Access\All Weapons + cd Do not put this code on until you collect one Extra Weapon then you will have all ready to use + 801E61EC 00FF + 801E61ED 00FF + cn Vela\Access\All Weapons + cd Do not put this code on until you collect one Extra Weapon then you will have all ready to use + 801E6176 00FF + 801E6177 00FF + cn Lupus\Access\All Weapons + cd Do not put this code on until you collect one Extra Weapon then you will have all ready to use + 801E6262 00FF + 801E6263 00FF + cn Tribals\Have All Tribals\Gold Wood + 801E6014 000F + cn Tribals\No Tribals Killed\Gold Wood + 801E6015 0000 + cn Tribals\Have No Tribals Remaining\Gold Wood + 801E6016 0000 + cn Wide Screen Always Off + 800FECA8 0000 + +crc D0151AB0-FE5CA14B-C:45 +gn John Romero's Daikatana (U) + cn Infinite\Health + 8020A965 0064 + cn Infinite\Armor + 8020A987 0064 + cn Infinite\Experience + 8020A967 00FF + cn Max\Vitality + 8020A969 0007 + cn Max\Attack + 8020A96B 0007 + cn Max\Speed + 8020A96D 0007 + cn Max\Acro + 8020A96F 0007 + cn Max\Power + 8020A971 0007 + cn Infinite\Ammo\Sidewinder + 8020A9B0 00FF + cn Infinite\Ammo\Shock Wave + 8020A9B1 00FF + cn Infinite\Ammo\Chvizatergo + 8020A9B2 00FF + cn Infinite\Ammo\Shot Cycler + 8020A9B3 00FF + cn Infinite\Ammo\Ion Cannon + 8020A9B4 00FF + cn Infinite\Ammo\Disc Of Dredalus + 8020A9B5 0063 + cn Infinite\Ammo\Venomous + 8020A9B6 00FF + cn Infinite\Ammo\Poseidon Trident + 8020A9B7 00FF + cn Infinite\Ammo\Hammer + 8020A9B8 0000 + cn Infinite\Ammo\Sunflares + 8020A9B9 00FF + cn Infinite\Ammo\Bolter + 8020A9BA 00FF + cn Infinite\Ammo\Ballista + 8020A9BB 00FF + cn Infinite\Ammo\Stavros Stave + 8020A9BC 00FF + cn Infinite\Ammo\Wyndraxs Wisp + 8020A9BD 00FF + cn Have All Weapons + 8120A8F6 FFFF + +crc 36281F23-009756CF-C:45 +gn Ken Griffey Jr.'s Slugfest (U) + cn Max\Batting + 8105D6D8 4120 + cn Max\Power + 8105D270 4120 + cn Max\Speed + 8105CE68 4120 + cn Max\Defense + 8105CA60 4120 + cn Max\Arm Strength + 8105C5F8 4120 + cn Max\Durability + 8105C098 4120 + cn Max\Clutch + 8105BB98 4120 + cn Max\Control + 8105B760 4120 + cn Max\Stamina + 8105B2F8 4120 + cn Max\Pitch Speed + 8105AE90 4120 + cn Infinite\Creation Points + 81059408 420C + cn Infinite\Strikes + 8021AC48 0000 + cn Infinite\Balls + 8021AC47 0000 + cn Inning Selection + 8021AC42 ???? 0002:"2nd Inning",0003:"3rd Inning",0004:"4th Inning",0005:"5th Inning",0006:"6th Inning",0007:"7th Inning",0008:"8th Inning",0009:"9th Inning" + +crc 9E8FE2BA-8B270770-C:45 +gn Killer Instinct Gold (U) (v1.0) + cn Unlock All Options + 8012834C 0006 + cn Player 1\Untouchable + 801D34D4 000A + cn Player 1\Fast\Punch Kick + 801D347E 0010 + cn Player 1\Fast\Jump Walk + 801D347C 0001 + cn Player 1\Slow Jump Walk + 801D347D 0050 + cn Player 1\Infinite Energy + 801D3484 0069 + cn Player 1\Fight Gargos Immediately + 8012834B 000A + cn Player 1\Spinal Always Has All Skulls + 801D3523 0006 + cn Player 1\Fulgore\Always Invisible + cd Do not use this with Fulgore Always Visible + 801D3478 0020 + 801D3479 0090 + 801D34C5 0092 + 801D3527 005E + cn Player 1\Fulgore\Always Visible + cd Do not use this with Fulgore Always Invisible + 801D3478 0023 + 801D3479 00F0 + 801D34C5 0080 + 801D3527 00AF + cn Player 1\Wins Score + 8012830A 00FF + cn Player 1\Undefeated Players Scroll By Quickly + 802C8CE8 0007 + cn Player 1\Play As + 802C8CB8 ???? 0000:"Jago",0001:"Combo",0002:"Spinal",0003:"Tusk",0004:"Glacius",0005:"Fulgore",0006:"Kim Wu",0007:"Sabrewulf",0008:"Orchid",0009:"Maya",000A:"Gargos" + cn Player 1\1-Hit Death + D01D3484 0078 + 801D3484 0001 + cn Player 2\Spinal Always Has All Skulls + 801D3623 0006 + cn Player 2\Fulgore Always Invisible + cd Do not use this with Fulgore Always Visible + 801D3578 0020 + 801D3579 0090 + 801D35C5 0092 + 801D3527 005E + cn Player 2\Fulgore Always Visible + cd Do not use this with Fulgore Always Invisible + 801D3578 0023 + 801D3579 00F0 + 801D35C5 0080 + 801D3527 00AF + cn Player 2\Play As + 8004EA9D ???? 0000:"Jago",0001:"Combo",0002:"Spinal",0003:"Tusk",0004:"Glacius",0005:"Fulgore",0006:"Kim Wu",0007:"Sabrewulf",0008:"Orchid",0009:"Maya",000A:"Gargos" + cn Player 2\Infinite Energy + 801D3584 0078 + cn Player 2\Fast\Punch Kick + 801D357E 0010 + cn Player 2\Fast\Jump Walk + 801D357C 0001 + cn Player 2\Slow\Punch Kick + 801D357F 0050 + cn Player 2\Slow\Jump Walk + 801D357D 0050 + cn Player 2\Untouchable + 801D34D5 000A + +crc 46039FB4-0337822C-C:45 +gn Kirby 64 - The Crystal Shards (U) + cn Get All Crystals + 50000701 0000 + 800D6BC0 0001 + 50001701 0000 + 800D6BC8 0007 + cn Unlock All Difficulty Levels\100 Yard Hop + 800D6BB9 0003 + cn Unlock All Difficulty Levels\Bumper Crop Bump + 800D6BBA 0003 + cn Unlock All Difficulty Levels\Checkerboard Chase + 800D6BBB 0003 + cn Infinite Lives + 800D714F 0064 + cn Infinite Health + 810D6E50 40C0 + cn Can Fly Forever + 8112E7DE 00F0 + cn All Stages Complete + 50002B01 0000 + 800D6BE0 0002 + +crc FCE0D799-65316C54-C:45 +gn Knife Edge - Nose Gunner (U) + cn Infinite\Armor + 8011D467 0064 + cn Level 11 Vulcan Cannon + 801239B3 000A + cn Infinite\Bombs + 8011D46F 0003 + cn Press\L For Rapid Fire On Nuke & Laser + cd Do not use this with Press L For Rapid Fire On Flak + D011BE01 0020 + 8011D497 0028 + cn Press\L For Rapid Fire On Flak + cd Do not use this with Press L For Rapid Fire On Nuke & Laser + D011BE01 0020 + 8011D497 0014 + +crc 0894909C-DAD4D82D-C:45 +gn Knockout Kings 2000 (U) + cn Player 1\Infinite\Health + 8106B974 42C8 + 8106B976 0000 + cn Player 2\Infinite\Health + 8106BA7C 42C8 + 8106BA7E 0000 + cn Player 1\No Health + 8106B974 0000 + 8106B976 0000 + cn Player 2\No Health + 8106BA7C 0000 + 8106BA7E 0000 + cn Player 1\Max\Power + 8106B980 0000 + 8106B982 0BB2 + cn Player 1\No Power + 8106B980 0000 + 8106B982 0000 + cn Player 2\Max\Power + 8106BA88 0000 + 8106BA8A 0BB2 + cn Player 2\No Power + 8106BA88 0000 + 8106BA8A 0000 + cn Infinite\Creation Points + 81063742 0064 + cn Big\Head Mode + 800F401C 0001 + cn Big\Glove Mode + 800F401D 0001 + cn Player 1\Power Punch After 1st Punch + 8006B983 0064 + cn Player 2\Power Punch After 1st Punch + 8006BA8B 0064 + cn Stop Timer + 81067546 001C + cn Player 1\Character Modifier + 800EC6F3 ???? 0000:"Ali",0001:"Frazier",0002:"Holmes",0003:"Holyfield",0004:"Lewis",0005:"Tua",0006:"Spinks",0007:"Butterbean",0008:"De La Hoya",0009:"Leonard",000A:"Hagler",000B:"Duran",000C:"Whitaker",000D:"Quartey",000E:"Carr",000F:"Vargas",0010:"Reid",0011:"Moskey",0012:"Pryor",0013:"Argnello",0014:"O'Grady",0015:"Mayweather",0016:"Manfredy",0017:"Kelley",0018:"Romero",0019:"Random",001A:"Created Boxer",001B:"Creater Boxer",001C:"Dempsey",001D:"K. Orr",001E:"IUppa",001F:"S. Sandoval",0020:"S. Broadhurst",0021:"Pole",0022:"Hasson",0023:"Alameda",0024:"Wahlberg",0025:"Scott",0026:"Hopra",0027:"Eckhardt",0028:"Parker",0029:"Ruiz",002A:"F. Sandoval",002B:"Ang",002C:"Bristov",002D:"Botti",002E:"S. Orr",002F:"Zarifes",0030:"Giolito",0031:"Garrett",0032:"Barclay",0033:"Wynne",0034:"Lupidi",0035:"W. Aguitar",0036:"Di Ricco",0037:"Philippine",0038:"M. Broadhurst",0039:"Weaver",003A:"Lajoie",003B:"Greenberg",003C:"Quinn",003D:"Perone",003E:"Tool",003F:"Bunch",0040:"St. Aubyn",0041:"Wells",0042:"Dexter",0043:"Hsu",0044:"Bazzel",0045:"Thompson",0046:"Eklund",0047:"Tallarico",0048:"de Leon",0049:"Coallier" + cn Player 2\Character Modifier + 800EC6F7 ???? 0000:"Ali",0001:"Frazier",0002:"Holmes",0003:"Holyfield",0004:"Lewis",0005:"Tua",0006:"Spinks",0007:"Butterbean",0008:"De La Hoya",0009:"Leonard",000A:"Hagler",000B:"Duran",000C:"Whitaker",000D:"Quartey",000E:"Carr",000F:"Vargas",0010:"Reid",0011:"Moskey",0012:"Pryor",0013:"Argnello",0014:"O'Grady",0015:"Mayweather",0016:"Manfredy",0017:"Kelley",0018:"Romero",0019:"Random",001A:"Created Boxer",001B:"Creater Boxer",001C:"Dempsey",001D:"K. Orr",001E:"IUppa",001F:"S. Sandoval",0020:"S. Broadhurst",0021:"Pole",0022:"Hasson",0023:"Alameda",0024:"Wahlberg",0025:"Scott",0026:"Hopra",0027:"Eckhardt",0028:"Parker",0029:"Ruiz",002A:"F. Sandoval",002B:"Ang",002C:"Bristov",002D:"Botti",002E:"S. Orr",002F:"Zarifes",0030:"Giolito",0031:"Garrett",0032:"Barclay",0033:"Wynne",0034:"Lupidi",0035:"W. Aguitar",0036:"Di Ricco",0037:"Philippine",0038:"M. Broadhurst",0039:"Weaver",003A:"Lajoie",003B:"Greenberg",003C:"Quinn",003D:"Perone",003E:"Tool",003F:"Bunch",0040:"St. Aubyn",0041:"Wells",0042:"Dexter",0043:"Hsu",0044:"Bazzel",0045:"Thompson",0046:"Eklund",0047:"Tallarico",0048:"de Leon",0049:"Coallier" + cn Ring Modifier + 800EC703 ???? 0000:"Great Western Forum",0001:"Caesars Palace",0002:"Ecko Sports Arena",0003:"International Arena",0004:"Local 440",0005:"The Colosseum",0006:"Roppongi Palace",0007:"Wembley Arena",0008:"Knockout Kings Arena" + +crc 5354631C-03A2DEF0-C:45 +gn Legend of Zelda 2, The - Majora's Mask (U) + cn Infinite\Health + 811EF6A6 0140 + cn Infinite\Hearts Options + cd If you need to clear the Infinite Max Hearts from the screen just choose the 6 or 4 Heart Options, take off the cheat & then make a save. + 811EF6A4 ???? 0140:"Max Hearts",0063:"6 Hearts",0043:"4 Hearts" + cn Have\All Quest/Status Items + 801EF72D 0005 + 811EF72E F7CF + cn Infinite\Rupees + 811EF6AA 03E7 + cn Infinite\Max & Double Magic Meter + 801EF6A9 0060 + 811EF6B0 0101 + cn Infinite\Items + 801EF711 0063 + 801EF716 0063 + 801EF717 0063 + 801EF718 0063 + 801EF719 0063 + 801EF71A 0063 + 801EF71C 0063 + 801EF71D 0063 + cn Have\Ocarina of Time + 801EF6E0 0000 + cn Have\Hero's Bow + 801EF6E1 0001 + cn Have\Arrows\Fire Arrow + 801EF6E2 0002 + cn Have\Arrows\Ice Arrow + 801EF6E3 0003 + cn Have\Arrows\Light Arrow + 801EF6E4 0004 + cn Have\Bombs + 801EF6E6 0006 + cn Have\Bombchu + 801EF6E7 0007 + cn Have\Deku Sticks + 801EF6E8 0008 + cn Have\Deku Nuts + 801EF6E9 0009 + cn Have\Magic Beans + 801EF6EA 000A + cn Have\Powder Kegs + 801EF6EC 000C + cn Have\Pictograph + 801EF6ED 000D + cn Have\Lens of Truth + 801EF6EE 000E + cn Have\Hookshot + 801EF6EF 000F + cn Have\Great Fairy's Sword + 801EF6F0 0010 + cn Maximum Visibility + 80166118 0020 + cn Fog\Blue + 80166108 0020 + cn Fog\Pink + 8016610C 0020 + cn Fog\Yellow + 80166110 0020 + cn Press L To Levitate + cd Press L To Levitate & Let go to land + D03E6B3B 0020 + 813FFE18 40CB + cn Have\All Masks + 801EF6F8 003E + 801EF6F9 0038 + 801EF6FA 0047 + 801EF6FB 0045 + 801EF6FC 0040 + 801EF6FD 0032 + 801EF6FE 003A + 801EF6FF 0046 + 801EF700 0039 + 801EF701 0042 + 801EF702 0048 + 801EF703 0033 + 801EF704 003C + 801EF705 003D + 801EF706 0037 + 801EF707 003F + 801EF708 0036 + 801EF709 0034 + 801EF70A 0043 + 801EF70B 0041 + 801EF70C 003B + 801EF70D 0044 + 801EF70E 0049 + 801EF70F 0035 + cn Beta World 1 + cd Put on the code on load up,After the Nintendo logo you will be in that place of Choice.you can also choose another place & then press F1 (reset) to go to that place this is for beta interest only it will not assist you in playing the game. + D03E6B3B 0000 + 801EF672 ???? 0000:"Mama's House non Beta",0001:"Fearful Spider House",0002:"Beneaf the Graveyard",0003:"Southern Swamp Mr Tingle Entry",0006:"Outside Tourist Information Southern Swamp",0008:"Outside Magic Hag's Potion Shop",000A:"Southern Swamp Woods Of Mystery Entry",0024:"Counter Of The Tresure Chest Shop",002E:"Woodfall Temple non Beta",0032:"Spider Hand",0035:"Statue outside Gorman Track",0036:"Statue outside Lair Of The Temples Boss",0038:"Path to Romani Ranch non Beta",004A:"outside The Royal Palace of the Deku Kingdom",004C:"Ledge in The Royal Palace of the Deku Kingdom",004E:"inside The Royal Palace of the Deku Kingdom 1",0071:"Green Blobs",0074:"Cave Portal to Last Boss Field",007F:"Waterfall Sothern Swamp",008A:"Giant Turtle In the Temple non beta",008B:"Room of Miau & Tijo Zora Great Hall",0094:"Recieving Gorans Mask non Beta",0095:"?",0096:"Hungry Goran in the Snow",00A2:"Statue in Stone Tower",00A6:"Stone Tower non Beta",00B9:"Recieving Deku Mask non Beta",00D9:"Giant Lizards in a Cave",00DA:"Cave with Steaming Water",00FF:"Vamps House In Ikana Canyon" + cn Fight Demo Majora's Mask + cd With this code,load the game & put the cheat on. then press start to apear in the Demo mode. + 8016A718 0020 + cn Event Item\Modifier 1 + 801EF6E5 ???? 0028:"Moon's Tear",0029:"Land Title Deed",002A:"Swap Title Deed",002B:"Mountain Title Deed",002C:"Ocean Title Deed",002D:"Room Key",002E:"Special Delivery To Mama",002F:"Letter To Kafei",0030:"Pendant Of Memories" + cn Event Item\Modifier 2 + 801EF6EB ???? 0028:"Moon's Tear",0029:"Land Title Deed",002A:"Swap Title Deed",002B:"Mountain Title Deed",002C:"Ocean Title Deed",002D:"Room Key",002E:"Special Delivery To Mama",002F:"Letter To Kafei",0030:"Pendant Of Memories" + cn Event Item\Modifier 3 + 801EF6F1 ???? 0028:"Moon's Tear",0029:"Land Title Deed",002A:"Swap Title Deed",002B:"Mountain Title Deed",002C:"Ocean Title Deed",002D:"Room Key",002E:"Special Delivery To Mama",002F:"Letter To Kafei",0030:"Pendant Of Memories" + cn Have\Item Modifier + 801EF6F0 ???? 0005:"Japanese Flute?",000B:"Japanese Item?",0010:"Great Fairy's Sword",0011:"Japanese Hookshot?",0031:"Japanese Scroll?",004A:"Japanese Bow?" + cn Bottles\Bottle 1 Modifier + 801EF6F2 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 2 Modifier + 801EF6F3 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 3 Modifier + 801EF6F4 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 4 Modifier + 801EF6F5 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 5 Modifier + 801EF6F6 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 6 Modifier + 801EF6F7 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Use C-Buttons Anywhere + cd This code allows you to use C-Button Items where you normally can't use them. (Created by: The Gentleman) + 811F3588 0000 + 811F358A 0000 + cn All Equipment Upgrades + 801EF6DD 0023 + 811EF72A 201B + 801EF6BC 004F + cn Replace Sword With + cd Only put the Deity Link's Sword on, if using The Play As Fierce Deity Link Code, if not it will turn Fierce Deity Link into a crazed slashing Machine. You have been warned. + 801EF6BC ???? 004A:"Fire Arrow w/ Bow",004B:"Ice Arrow w/ Bow",004C:"Light Arrow w/ Bow",004D:"Kokiri Sword",004E:"Razor Sword",004F:"Guilded Sword",0050:"Deity Link's Sword" + cn Play As + 801EF690 ???? 0000:"Fierce Deity Link",0001:"Goron Link",0002:"Zora Link",0003:"Deku Link",0004:"Normal Link" + cn Warp Modifier + cd Put this code on and it will now take where you wanted to go, turn it back off or it will infinite loop entering all the time. + D03E6B3A 0000 + 803FF395 0001 + 813FF39A ???? 0010:"Mayors Residence",0008:"Magic Hags Potion Shop",000A:"Romani Ranch Barn",000B:"Mama's House",000E:"Honey & Darlings Shop",0015:"Final Boss Arena",001F:"Beneath the Graveyard (left entrance)",002F:"Beneath the Graveyard (right entrance)",0030:"Southern Swamp (Reg Entrance)",004F:"Southern Swamp (from tour house)",006E:"Southern Swamp (from Woodfall)",006F:"Southern Swamp (from Deku Palace)",0078:"Path to Ikana Canyon",009E:"Southern Swamp (from Deku Place 2)",009F:"Southern Swamp (From Potion Shop)",00AF:"Boat Cruise (picture taking)",00CD:"Southern Swamp (From Woods of Mystery)",00CE:"Southern Swamp (From Spider House)",00CF:"Southern Swamp (From Ikana Canyon)",00FE:"Southern Swamp (From Owl Warp)",0E00:"Curiosity Shop",0E38:"Ikana Canyon Entrance",1500:"Lens of Truth Cave (get it)",2600:"Stone Tower Temple (Upside down)",2609:"Stone Tower Temple (Boss Room Entrance)",2604:"Treasure Chest Shop",2605:"Treausre Chest Shop (counter)",260E:"Clock Tower (w/ skull kid, silent)",2610:"Stone Tower Temple (endless fall)",6214:"Romani Ranch",9214:"Zora Shop",B214:"Snowhead (Path to temple, warp in)",D214:"East Clock Down" + +crc B443EB08-4DB31193-C:45 +gn Legend of Zelda, The - Majora's Mask (U) (GC Version) + cn Infinite\Health + 811ED866 0140 + cn Infinite\Hearts Options + cd If you need to clear the Infinite Max Hearts from the screen just choose the 6 or 4 Heart Options, take off the cheat & then make a save. + 811ED864 ???? 0140:"Max Hearts",0063:"6 Hearts",0043:"4 Hearts" + cn Have\All Quest/Status Items + 801ED8ED 0005 + 811ED8EE F7CF + cn Infinite\Rupees + 811ED86A 03E7 + cn Infinite\Max & Double Magic Meter + 801ED869 0060 + 811ED870 0101 + cn Infinite\Items + 801ED8D1 0063 + 50000501 0000 + 801ED8D6 0063 + 50000201 0000 + 801ED8DC 0063 + cn Have\Ocarina of Time + 801ED8A0 0000 + cn Have\Hero's Bow + 801ED8A1 0001 + cn Have\Arrows\Fire Arrow + 801ED8A2 0002 + cn Have\Arrows\Ice Arrow + 801ED8A3 0003 + cn Have\Arrows\Light Arrow + 801ED8A4 0004 + cn Have\Bombs + 801ED8A6 0006 + cn Have\Bombchu + 801ED8A7 0007 + cn Have\Deku Sticks + 801ED8A8 0008 + cn Have\Deku Nuts + 801ED8A9 0009 + cn Have\Magic Beans + 801ED8AA 000A + cn Have\Powder Kegs + 801ED8AC 000C + cn Have\Pictograph + 801ED8AD 000D + cn Have\Lens of Truth + 801ED8AE 000E + cn Have\Hookshot + 801ED8AF 000F + cn Have\Great Fairy's Sword + 801ED8B0 0010 + cn Maximum Visibility + 801642D8 0020 + cn Fog\Blue + 801642C8 0020 + cn Fog\Pink + 801642CC 0020 + cn Fog\Yellow + 801642D0 0020 + cn Press L To Levitate + cd Press L To Levitate & Let go to land + D038127B 0020 + 8139A558 40CB + cn Have\All Masks + 801ED8B8 003E + 801ED8B9 0038 + 801ED8BA 0047 + 801ED8BB 0045 + 801ED8BC 0040 + 801ED8BD 0032 + 801ED8BE 003A + 801ED8BF 0046 + 801ED8C0 0039 + 801ED8C1 0042 + 801ED8C2 0048 + 801ED8C3 0033 + 801ED8C4 003C + 801ED8C5 003D + 801ED8C6 0037 + 801ED8C7 003F + 801ED8C8 0036 + 801ED8C9 0034 + 801ED8CA 0043 + 801ED8CB 0041 + 801ED8CC 003B + 801ED8CD 0044 + 801ED8CE 0049 + 801ED8CF 0035 + cn Beta World 1 + cd Put on the code on load up,After the Nintendo logo you will be in that place of Choice.you can also choose another place & then press F1 (reset) to go to that place this is for beta interest only it will not assist you in playing the game. + D038127B 0000 + 801ED832 ???? 0000:"Mama's House non Beta",0001:"Fearful Spider House",0002:"Beneaf the Graveyard",0003:"Southern Swamp Mr Tingle Entry",0006:"Outside Tourist Information Southern Swamp",0008:"Outside Magic Hag's Potion Shop",000A:"Southern Swamp Woods Of Mystery Entry",0024:"Counter Of The Tresure Chest Shop",002E:"Woodfall Temple non Beta",0032:"Spider Hand",0035:"Statue outside Gorman Track",0036:"Statue outside Lair Of The Temples Boss",0038:"Path to Romani Ranch non Beta",004A:"outside The Royal Palace of the Deku Kingdom",004C:"Ledge in The Royal Palace of the Deku Kingdom",004E:"inside The Royal Palace of the Deku Kingdom 1",0071:"Green Blobs",0074:"Cave Portal to Last Boss Field",007F:"Waterfall Sothern Swamp",008A:"Giant Turtle In the Temple non beta",008B:"Room of Miau & Tijo Zora Great Hall",0094:"Recieving Gorans Mask non Beta",0095:"?",0096:"Hungry Goran in the Snow",00A2:"Statue in Stone Tower",00A6:"Stone Tower non Beta",00B9:"Recieving Deku Mask non Beta",00D9:"Giant Lizards in a Cave",00DA:"Cave with Steaming Water",00FF:"Vamps House In Ikana Canyon" + cn Fight Demo Majora's Mask + cd With this code,load the game & put the cheat on. then press start to apear in the Demo mode. + 801688D8 0020 + cn Event Item\Modifier 1 + 801ED8A5 ???? 0028:"Moon's Tear",0029:"Land Title Deed",002A:"Swap Title Deed",002B:"Mountain Title Deed",002C:"Ocean Title Deed",002D:"Room Key",002E:"Special Delivery To Mama",002F:"Letter To Kafei",0030:"Pendant Of Memories" + cn Event Item\Modifier 2 + 801ED8AB ???? 0028:"Moon's Tear",0029:"Land Title Deed",002A:"Swap Title Deed",002B:"Mountain Title Deed",002C:"Ocean Title Deed",002D:"Room Key",002E:"Special Delivery To Mama",002F:"Letter To Kafei",0030:"Pendant Of Memories" + cn Event Item\Modifier 3 + 801ED8B1 ???? 0028:"Moon's Tear",0029:"Land Title Deed",002A:"Swap Title Deed",002B:"Mountain Title Deed",002C:"Ocean Title Deed",002D:"Room Key",002E:"Special Delivery To Mama",002F:"Letter To Kafei",0030:"Pendant Of Memories" + cn Have\Item Modifier + 801ED8B0 ???? 0005:"Japanese Flute?",000B:"Japanese Item?",0010:"Great Fairy's Sword",0011:"Japanese Hookshot?",0031:"Japanese Scroll?",004A:"Japanese Bow?" + cn Bottles\Bottle 1 Modifier + 801ED8B2 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 2 Modifier + 801ED8B3 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 3 Modifier + 801ED8B4 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 4 Modifier + 801ED8B5 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 5 Modifier + 801ED8B6 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 6 Modifier + 801ED8B7 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Use C-Buttons Anywhere + cd This code allows you to use C-Button Items where you normally can't use them. (Created by: The Gentleman) + 811F1748 0000 + 811F174A 0000 + cn All Equipment Upgrades + 801ED89D 0023 + 811ED8EA 201B + 801ED87C 004F + cn Replace Sword With + cd Only put the Deity Link's Sword on, if using The Play As Fierce Deity Link Code, if not it will turn Fierce Deity Link into a crazed slashing Machine. You have been warned. + 801ED87C ???? 004A:"Fire Arrow w/ Bow",004B:"Ice Arrow w/ Bow",004C:"Light Arrow w/ Bow",004D:"Kokiri Sword",004E:"Razor Sword",004F:"Guilded Sword",0050:"Deity Link's Sword" + cn Play As + 801ED850 ???? 0000:"Fierce Deity Link",0001:"Goron Link",0002:"Zora Link",0003:"Deku Link",0004:"Normal Link" + cn Warp Modifier + cd Put this code on and it will now take where you wanted to go, turn it back off or it will infinite loop entering all the time. + D03E4CFA 0000 + 803FD555 0001 + 813FD55A ???? 0010:"Mayors Residence",0008:"Magic Hags Potion Shop",000A:"Romani Ranch Barn",000B:"Mama's House",000E:"Honey & Darlings Shop",0015:"Final Boss Arena",001F:"Beneath the Graveyard (left entrance)",002F:"Beneath the Graveyard (right entrance)",0030:"Southern Swamp (Reg Entrance)",004F:"Southern Swamp (from tour house)",006E:"Southern Swamp (from Woodfall)",006F:"Southern Swamp (from Deku Palace)",0078:"Path to Ikana Canyon",009E:"Southern Swamp (from Deku Place 2)",009F:"Southern Swamp (From Potion Shop)",00AF:"Boat Cruise (picture taking)",00CD:"Southern Swamp (From Woods of Mystery)",00CE:"Southern Swamp (From Spider House)",00CF:"Southern Swamp (From Ikana Canyon)",00FE:"Southern Swamp (From Owl Warp)",0E00:"Curiosity Shop",0E38:"Ikana Canyon Entrance",1500:"Lens of Truth Cave (get it)",2600:"Stone Tower Temple (Upside down)",2609:"Stone Tower Temple (Boss Room Entrance)",2604:"Treasure Chest Shop",2605:"Treausre Chest Shop (counter)",260E:"Clock Tower (w/ skull kid, silent)",2610:"Stone Tower Temple (endless fall)",6214:"Romani Ranch",9214:"Zora Shop",B214:"Snowhead (Path to temple, warp in)",D214:"East Clock Down" + +crc EC7011B7-7616D72B-C:45 +gn Legend of Zelda, The - Ocarina of Time (U) (V1.0) + cn Infinite\Rupees + cd This cheat allows you to have the max Rupees to the Wallet you currently Hold + 8111B99C 0001 + cn Press R\For Old Or Young Link + cd To Activate this Cheat Hold The R Button when walking through a Doorway this will change you to the option on the other side, Disable this Cheat straight away after getting to the other side, in some places you might even get Access Violations. Just press ok untill you can carry on. + D01C84B5 0010 + 8011A5D7 ???? 0001:"Link Young",0000:"Link Old" + cn Use Any Item In Any House + cd do not use under or in water + 8111B7F2 0000 + 8111B7F4 0000 + cn Have\All Equipment + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 8111A66C 7777 + cn Have\All Quest/Status Items + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 8111A674 30FF + 8111A676 FFFF + cn Max\Heart Containers + 8111A5FE 0140 + cn Max\Gold Skulltulas Killed + 8011A6A1 0064 + cn Time of Day Modifier + 8111A5DC ???? 4000:"At Sunrise",5800:"Daylight Out",7000:"Very Bright Out",C000:"At Sunset",D000:"Fairly Dark" + cn Infinite\Energy + 8111A600 0140 + cn Infinite\Magic + D011A609 0008 + 8011A60A 0001 + 8011A60C 0001 + 8011A603 0060 + cn Tunic & Boot Options + cd This changes what you are wearing,once you have enabled the code press Start & then start again. + 8011A640 ???? 0011:"Kokiri Tunic & Kokiri Boots",0012:"Goron Tunic & Kokiri Boots",0013:"Zora Tunic & Kokiri Boots",0014:"Black Tunic & Kokiri Boots",0015:"White Tunic & Kokiri Boots",0016:"Yellow Tunic & Kokiri Boots",0021:"Kokiri Tunic & Iron Boots",0022:"Goron Tunic & Iron Boots",0023:"Zora Tunic & Iron Boots",0024:"Black Tunic & Iron Boots",0025:"White Tunic & Iron Boots",0026:"Yellow Tunic & Iron Boots",0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Infinite\Deku Sticks + 8011A65C 0009 + cn Infinite\Deku Nuts + 8011A65D 0009 + cn Infinite\Bombs + 8011A65E 0009 + cn Infinite\Arrows + 8011A65F 0009 + cn Infinite\Deku Seeds + 8011A662 0009 + cn Infinite\Bombchu's + 8011A664 0009 + cn Infinite\Magic Beans + 8011A66A 0009 + cn Infinite\Big Key,Small Keys,Compass,& Map + 8011A678 0007 + 8011A679 0007 + 8011A67A 0007 + 8011A67B 0007 + 8011A67C 0007 + 8011A67D 0007 + 8011A67E 0007 + 8011A67F 0007 + 8011A680 0007 + 8011A681 0007 + 8011A682 0007 + 8011A68F 0009 + 8011A690 0009 + 8011A691 0009 + 8011A692 0009 + 8011A693 0009 + 8011A699 0009 + 8011A69C 0009 + 8011A697 0009 + cn Have\Ocarina + 8011A64B ???? 0007:"Fairy Ocarina",0008:"Ocarina Of Time" + cn Have\Boomerang + 8011A650 000E + cn Have\Lens of Truth + 8011A651 000F + cn Have\Megaton Hammer + 8011A653 0011 + cn Have\Deku Stick + 8011A644 0000 + cn Have\Deku Nut + 8011A645 0001 + cn Have\Bombs + 8011A646 0002 + cn Have\Fairy Bow + 8011A647 0003 + cn Have\Fairy Slingshot + 8011A64A 0006 + cn Have\Bombchu + 8011A64C 0009 + cn Have\Arrows\Fire Arrow + 8011A648 0004 + cn Have\Arrows\Ice Arrow + 8011A64E 000C + cn Have\Arrows\Light Arrow + 8011A654 0012 + cn Have\Hookshot + 8011A64D ???? 000A:"Hookshot",000B:"Longshot" + cn Have\Magic Beans + 8011A652 0010 + cn Have\Magic\Fairie's Wind + 8011A64F 000D + cn Have\Magic\Nayru's Love + 8011A655 0013 + cn Have\Magic\Din's Fire + 8011A649 0005 + cn Bottles\Bottle 1 Modifier + 8011A656 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 2 Modifier + 8011A657 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 3 Modifier + 8011A658 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 4 Modifier + 8011A659 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Trading\Adult Link Item + 8011A65A ???? 002D:"Pocket Egg",002E:"Pocket Cucco",002F:"Cojiro",0030:"Odd Mushroom",0031:"Odd Potion",0032:"Poacher's Saw",0033:"Goron's Sword (Broken)",0034:"Prescription",0035:"Eyeball Frog",0036:"Eye Drops",0037:"Claim Check" + cn Trading\Young Link Item + 8011A65B ???? 0021:"Weird Egg",0022:"Chicken",0023:"Zelda's Letter",0024:"Keaton Mask",0025:"Skull Mask",0026:"Spooky Mask",0027:"Bunny Hood",0028:"Goron Mask",0029:"Zora Mask",002A:"Gerudo Mask",002B:"Mask of Truth",002C:"SOLD OUT" + cn Turn Giant's Knife Into Biggoron's Sword + 8011A60E 0001 + cn Have Quiver (Holds 30) + 8011A671 0001 + cn Equipment Modifier 1 + cd This modifies the equipment you are carrying. + 8011A672 ???? 0002:"Silver Scale",0004:"Golden Scale",0006:"Giant's Knife (Broken)",0035:"Black Gauntlets",0040:"Bullet Bag (Holds 30)",0080:"Bullet Bag (Holds 40)",00C0:"Bullet Bag (Holds 50)" + cn Equipment Modifier 2 + cd This modifies the equipment you are carrying. + 8011A673 ???? 0008:"Bomb Bag (Holds 20)",0010:"Bomb Bag (Holds 30)",0018:"Bomb Bag (Holds 40)",0020:"Goron's Bracelet",0028:"Silver Gauntlets",0030:"Golden Gauntlets" + cn Press L\To Levitate + cd Press L To Levitate & Let go to land + D01C84B5 0020 + 811DAA90 40CB + cn Press L\For infinite Hover Boots + cd Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on + D01C84B5 0020 + 811DB2B2 000D + cn Instant Step Hoover Boots + cd Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. + D01C84B5 0020 + 811DAA90 40CB + D01C84B5 0000 + 811DB2B2 000D + 8011A640 ???? 0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Beta\Play Beta Quest Worlds + cd Put on the code on load up,After the Nintendo logo you will be in Beta Mode,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. + D01C84B5 0000 + 8011B9E3 ???? 0000:"World 01",0001:"World 02",0002:"World 03",0003:"World 04",0004:"World 05",0007:"World 06",0008:"World 07",0016:"World 08" + cn Warp Song Location\Minuet of Forest & Serenade of Water + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011B965 ???? 0000:"Sacred Forest Meadow",0004:"Lake Hylia",0015:"Inside Jabu Jabu's Belly",0018:"Dodongo's Cavern",0068:"Inside The Deku Tree" + cn Warp Song Location\Prelude of Light & Nocturne of Shadow + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011B965 ???? 0003:"Kakariko Windmill",0007:"Bombchu Bowling Alley",000F:"Zelda & Impa Flee",0014:"Kakariko Village",0017:"Ganon,Final Battle",001D:"Top of Ganon's Tower",0028:"Bombchu Shop",002C:"Bazaar",0030:"Happy Mask Shop",0034:"Ganon's Tower",0038:"Ganon's Castle",004C:"Inside Spirit Door",006C:"Burning Castle",0050:"House of Skulltula",0064:"Death Mountain Trail",0068:"Graveyard",0070:"Thieves' Hideout",0074:"Royal Family's Tomb",0078:"Great Fairy Fountain 1",0084:"Forest Temple,Room With Falling Floor",0088:"Great Fairy Fountain 2",0099:"Grotto 01",009D:"Grotto 02",00A4:"Grotto 04",00A8:"Grotto 05",00B3:"Grotto 06",00B0:"Grotto 07",00B4:"Grotto 08",00B8:"Grotto 09",00C3:"Grotto 10",00C0:"Grotto 11",00C4:"Grotto 12",00FC:"Grotto 13",00D3:"Bottom of the Well",00D0:"Lon Lon Ranch Shed",00D3:"Lon Lon Ranch Outside Shed",00D8:"Ice Cavern",00E3:"Outside Cow Pen",00E0:"Lost Woods Bridge",00E4:"Lon Lon Ranch Chicken Room",00E8:"In Front of Deku Tree",00EB:"Spirit Temple Boss",00F1:"Castle Courtyard,In Front of Zelda",00F4:"Temple of Time",00F8:"Gerudo Fortress Jail" + cn Warp Song Location\Bolero of Fire + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011B965 ???? 0003:"Castle Courtyard",000B:"Dodongo's Cavern Boss",0010:"Inside The Deku Tree Boss",0014:"Shadow Temple Boss",0017:"Water Temple Boss",001C:"Ganon's Castle Tower",001F:"Ganon First Battle",0028:"Ganon's Castle Room Before Ganon",002B:"Inside Ganon's Castle Room With Pillar",002F:"Lon Lon Ranch",0033:"Mido's House",0037:"Saria's House",004B:"Bearded Man's House",0040:"Top of Ganon's Castle",0047:"Outside Saria's House",004F:"Dampe's Race",0057:"Kokiri Forest",005B:"Top of Death Mountain",005F:"Fishing Pond",0068:"Inside Ganon's Castle",007F:"Hyrule Castle Gate",00BA:"Top of Ganon's Tower",00C2:"Great Fairy Fountain",00D6:"Lost Woods Goron Entrance",00DA:"Lost Woods River Entrance",00DE:"Lost Woods Bridge Field Entrance",00E3:"Goron City Lost Woods Entrance",00F6:"Death Mountain Crater",00FD:"Ganon's Castle" + cn Warp Song Location\Requiem of Spirit + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011B965 ???? 0005:"Lake Hylia,08 Zora's Domain",0018:"Gerudo Valley",001E:"Lost Woods",0028:"Gerudo Fortress",0030:"Haunted Wasteland",0034:"Ganon's Castle Inside Burning Castle",0038:"Hyrule Castle",003A:"Ganon's Castle",003D:"Death Mountain Trail",004D:"Goron City",0065:"Fire Temple",0069:"Forest Temple",006E:"Shooting Gallery",0079:"Ganon's Castle Inside Burning Castle",007E:"Kakariko Village Entrance",007B:"Zora's River Entrance",0085:"Kokiri Forest Entrance",008A:"Lake Hyrule Entrance",008E:"Gerudo Valley Entrance",0092:"Death Mountain Trail Entrance",0095:"Graveyard Entrance",009E:"Zora's Domain Entrance",00A2:"Zora's Fountain Entrance",00BA:"Goron City Entrance",00BE:"Death Mountain Trail",00C1:"Goron City",00C5:"Lakeside Laboratory",00C9:"Top of Ganon's Castle",00CD:"Hyrule Market (Child Link's)",00CF:"Hyrule Market (Adult Link's)",00F1:"Desert Colossus",00FA:"Lon Lon Ranch Entrance",00FD:"Hyrule Field" + cn Max\Double Defense Power + cd This gives you White Border Hearts + 8011A69F 0014 + cn Nayru's Love is Always + cd For this to work On Or off, you have to walk through a Doorway to activate the Change. + 8111B998 ???? 0000:"OFF",FFFF:"ON" + cn Infinite\Timers\All Other Timers + cd This cheat works on all Race Timers not the final Boss and Under Water with iron Boots etc. + 8011B9A1 0032 + cn Epona\Max Carrots\Lon Lon Raunch + cd This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona + 801F2208 0005 + 801EEC88 0005 + cn Infinite\Timers\Escape From Gannons Tower + cd This cheat works only on The Final Boss. + 8011B9A5 00B4 + cn Beta\Specific things lean + cd This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest 01). + 80025614 0001 + cn Beta\Appear in Strange Places (Hold R) + cd If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. + D01C84B5 0010 + 8111B936 0001 + cn Beta\Interface always off/on + cd If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset. + 8011B4B9 00FF + 8011B92F ???? 0000:"Off",0001:"On" + cn Always Have Wallet Size + 8011A672 ???? 0047:"Kid Wallet (Holds 99)",0057:"Adult Wallet (Holds 200)",0067:"Giant Wallet (Holds 500)" + cn Press L+R For FMV Select + cd Hold down `L+R' after the Nintendo logo is spinning to see your favourite FMV + D01C84B5 0030 + 8111A5D2 00A0 + D01C84B5 0030 + 8111A5DA ???? FFF0:"Triforce FMV",FFF1:"fire FMV",FFF2:"Triforce FMV",FFF3:"Ganondorf FMV",FFF4:"Planet Making FMV",FFF5:"Fire FMV",FFF6:"Ganondorf FMV",FFF7:"More Triforce FMV",FFF8:"Ending" + cn Dark Link\Make Dark Link Apear In TOT + 8023E80F 0020 + 8023E815 0033 + cn Dark Link\Play As Dark Link + D01C84B5 0020 + 811DAB60 801E + D01C84B5 0020 + 811F2C24 801D + D01C84B5 0020 + 811F2C26 AA30 + D01C84B5 0020 + 811CA0E4 801E + D01C84B5 0020 + 811CA0E6 4B60 + D01C84B5 0020 + 811E4B60 0000 + D01C84B5 0020 + 811E4B62 02FF + D01C84B5 0020 + 811DAA30 0033 + D01C84B5 0020 + 811DAA32 0901 + D01C84B5 0020 + 811DAB62 27E0 + D01C84B5 0020 + 811E4C90 8009 + D01C84B5 0020 + 811E4C92 7740 + D01C84B5 0020 + 811C8710 801E + D01C84B5 0020 + 811C8712 4B60 + +crc D43DA81F-021E1E19-C:45 +gn Legend of Zelda, The - Ocarina of Time (U) (V1.1) + cn Infinite\Rupees + cd This cheat allows you to have the max Rupees to the Wallet you currently Hold + 8111BB5C 0001 + cn Press R\For Old Or Young Link + cd To Activate this Cheat Hold The R Button when walking through a Doorway this will change you to the option on the other side, Disable this Cheat straight away after getting to the other side, in some places you might even get Access Violations. Just press ok untill you can carry on. + D01C8675 0010 + 8011A797 ???? 0001:"Link Young",0000:"Link Old" + cn Use Any Item In Any House + cd do not use under or in water + 8111B9B2 0000 + 8111B9B4 0000 + cn Have\All Equipment + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 8111A82C 7777 + cn Have\All Quest/Status Items + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 8111A834 30FF + 8111A836 FFFF + cn Max\Heart Containers + 8111A7BE 0140 + cn Max\Gold Skulltulas Killed + 8011A861 0064 + cn Time of Day Modifier + 8111A79C ???? 4000:"At Sunrise",5800:"Daylight Out",7000:"Very Bright Out",C000:"At Sunset",D000:"Fairly Dark" + cn Infinite\Energy + 8111A7C0 0140 + cn Infinite\Magic + D011A7C9 0008 + 8011A7CA 0001 + 8011A7CC 0001 + 8011A7C3 0060 + cn Tunic & Boot Options + cd This changes what you are wearing,once you have enabled the code press Start & then start again. + 8011A800 ???? 0011:"Kokiri Tunic & Kokiri Boots",0012:"Goron Tunic & Kokiri Boots",0013:"Zora Tunic & Kokiri Boots",0014:"Black Tunic & Kokiri Boots",0015:"White Tunic & Kokiri Boots",0016:"Yellow Tunic & Kokiri Boots",0021:"Kokiri Tunic & Iron Boots",0022:"Goron Tunic & Iron Boots",0023:"Zora Tunic & Iron Boots",0024:"Black Tunic & Iron Boots",0025:"White Tunic & Iron Boots",0026:"Yellow Tunic & Iron Boots",0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Infinite\Deku Sticks + 8011A81C 0009 + cn Infinite\Deku Nuts + 8011A81D 0009 + cn Infinite\Bombs + 8011A81E 0009 + cn Infinite\Arrows + 8011A81F 0009 + cn Infinite\Deku Seeds + 8011A822 0009 + cn Infinite\Bombchu's + 8011A824 0009 + cn Infinite\Magic Beans + 8011A82A 0009 + cn Infinite\Big Keys,Small Keys,Compass,& Map + 8011A838 0007 + 8011A839 0007 + 8011A83A 0007 + 8011A83B 0007 + 8011A83C 0007 + 8011A83D 0007 + 8011A83E 0007 + 8011A83F 0007 + 8011A840 0007 + 8011A841 0007 + 8011A842 0007 + 8011A84F 0009 + 8011A850 0009 + 8011A851 0009 + 8011A852 0009 + 8011A853 0009 + 8011A859 0009 + 8011A85C 0009 + 8011A857 0009 + cn Have\Ocarina + 8011A80B ???? 0007:"Fairy Ocarina",0008:"Ocarina Of Time" + cn Have\Boomerang + 8011A810 000E + cn Have\Lens of Truth + 8011A811 000F + cn Have\Megaton Hammer + 8011A813 0011 + cn Have\Deku Stick + 8011A804 0000 + cn Have\Deku Nut + 8011A805 0001 + cn Have\Bombs + 8011A806 0002 + cn Have\Fairy Bow + 8011A807 0003 + cn Have\Fairy Slingshot + 8011A80A 0006 + cn Have\Bombchu + 8011A80C 0009 + cn Have\Arrows\Fire Arrow + 8011A808 0004 + cn Have\Arrows\Ice Arrow + 8011A80E 000C + cn Have\Arrows\Light Arrow + 8011A814 0012 + cn Have\Hookshot + 8011A80D ???? 000A:"Hookshot",000B:"Longshot" + cn Have\Magic Beans + 8011A812 0010 + cn Have\Magic\Fairie's Wind + 8011A80F 000D + cn Have\Magic\Nayru's Love + 8011A815 0013 + cn Have\Magic\Din's Fire + 8011A809 0005 + cn Bottles\Bottle 1 Modifier + 8011A816 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 2 Modifier + 8011A817 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 3 Modifier + 8011A818 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 4 Modifier + 8011A819 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Trading\Adult Link Item + 8011A81A ???? 002D:"Pocket Egg",002E:"Pocket Cucco",002F:"Cojiro",0030:"Odd Mushroom",0031:"Odd Potion",0032:"Poacher's Saw",0033:"Goron's Sword (Broken)",0034:"Prescription",0035:"Eyeball Frog",0036:"Eye Drops",0037:"Claim Check" + cn Trading\Young Link Item + 8011A81B ???? 0021:"Weird Egg",0022:"Chicken",0023:"Zelda's Letter",0024:"Keaton Mask",0025:"Skull Mask",0026:"Spooky Mask",0027:"Bunny Hood",0028:"Goron Mask",0029:"Zora Mask",002A:"Gerudo Mask",002B:"Mask of Truth",002C:"SOLD OUT" + cn Turn Giant's Knife Into Biggoron's Sword + 8011A7CE 0001 + cn Have Quiver (Holds 30) + 8011A831 0001 + cn Equipment Modifier 1 + cd This modifies the equipment you are carrying. + 8011A832 ???? 0002:"Silver Scale",0004:"Golden Scale",0006:"Giant's Knife (Broken)",0035:"Black Gauntlets",0040:"Bullet Bag (Holds 30)",0080:"Bullet Bag (Holds 40)",00C0:"Bullet Bag (Holds 50)" + cn Equipment Modifier 2 + cd This modifies the equipment you are carrying. + 8011A833 ???? 0008:"Bomb Bag (Holds 20)",0010:"Bomb Bag (Holds 30)",0018:"Bomb Bag (Holds 40)",0020:"Goron's Bracelet",0028:"Silver Gauntlets",0030:"Golden Gauntlets" + cn Press L To Levitate + cd Press L To Levitate & Let go to land + D01C8675 0020 + 811DAC50 40CB + cn Press L For infinite Hover Boots + cd Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on + D01C8675 0020 + 811DB472 000D + cn Instant Step Hoover Boots + cd Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. + D01C8675 0020 + 811DAC50 40CB + D01C8675 0000 + 811DB472 000D + 8011A800 ???? 0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Beta\Play Beta Quest Worlds + cd Put on the code on load up,After the Nintendo logo you will be in Hyrule Field,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. + D01C8675 0000 + 8011BBA3 ???? 0000:"World 01",0001:"World 02",0002:"World 03",0003:"World 04",0004:"World 05",0007:"World 06",0008:"World 07",0016:"World 08" + cn Warp Song Location\Minuet of Forest & Serenade of Water + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011BB25 ???? 0000:"Sacred Forest Meadow",0004:"Lake Hylia",0015:"Inside Jabu Jabu's Belly",0018:"Dodongo's Cavern",0068:"Inside The Deku Tree" + cn Warp Song Location\Prelude of Light & Nocturne of Shadow + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011BB25 ???? 0003:"Kakariko Windmill",0007:"Bombchu Bowling Alley",000F:"Zelda & Impa Flee",0014:"Kakariko Village",0017:"Ganon,Final Battle",001D:"Top of Ganon's Tower",0028:"Bombchu Shop",002C:"Bazaar",0030:"Happy Mask Shop",0034:"Ganon's Tower",0038:"Ganon's Castle",004C:"Inside Spirit Door",006C:"Burning Castle",0050:"House of Skulltula",0064:"Death Mountain Trail",0068:"Graveyard",0070:"Thieves' Hideout",0074:"Royal Family's Tomb",0078:"Great Fairy Fountain 1",0084:"Forest Temple,Room With Falling Floor",0088:"Great Fairy Fountain 2",0099:"Grotto 01",009D:"Grotto 02",00A4:"Grotto 04",00A8:"Grotto 05",00B3:"Grotto 06",00B0:"Grotto 07",00B4:"Grotto 08",00B8:"Grotto 09",00C3:"Grotto 10",00C0:"Grotto 11",00C4:"Grotto 12",00FC:"Grotto 13",00D3:"Bottom of the Well",00D0:"Lon Lon Ranch Shed",00D3:"Lon Lon Ranch Outside Shed",00D8:"Ice Cavern",00E3:"Outside Cow Pen",00E0:"Lost Woods Bridge",00E4:"Lon Lon Ranch Chicken Room",00E8:"In Front of Deku Tree",00EB:"Spirit Temple Boss",00F1:"Castle Courtyard,In Front of Zelda",00F4:"Temple of Time",00F8:"Gerudo Fortress Jail" + cn Warp Song Location\Bolero of Fire + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011BB25 ???? 0003:"Castle Courtyard",000B:"Dodongo's Cavern Boss",0010:"Inside The Deku Tree Boss",0014:"Shadow Temple Boss",0017:"Water Temple Boss",001C:"Ganon's Castle Tower",001F:"Ganon First Battle",0028:"Ganon's Castle Room Before Ganon",002B:"Inside Ganon's Castle Room With Pillar",002F:"Lon Lon Ranch",0033:"Mido's House",0037:"Saria's House",004B:"Bearded Man's House",0040:"Top of Ganon's Castle",0047:"Outside Saria's House",004F:"Dampe's Race",0057:"Kokiri Forest",005B:"Top of Death Mountain",005F:"Fishing Pond",0068:"Inside Ganon's Castle",007F:"Hyrule Castle Gate",00BA:"Top of Ganon's Tower",00C2:"Great Fairy Fountain",00D6:"Lost Woods Goron Entrance",00DA:"Lost Woods River Entrance",00DE:"Lost Woods Bridge Field Entrance",00E3:"Goron City Lost Woods Entrance",00F6:"Death Mountain Crater",00FD:"Ganon's Castle" + cn Warp Song Location\Requiem of Spirit + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011BB25 ???? 0005:"Lake Hylia,08 Zora's Domain",0018:"Gerudo Valley",001E:"Lost Woods",0028:"Gerudo Fortress",0030:"Haunted Wasteland",0034:"Ganon's Castle Inside Burning Castle",0038:"Hyrule Castle",003A:"Ganon's Castle",003D:"Death Mountain Trail",004D:"Goron City",0065:"Fire Temple",0069:"Forest Temple",006E:"Shooting Gallery",0079:"Ganon's Castle Inside Burning Castle",007E:"Kakariko Village Entrance",007B:"Zora's River Entrance",0085:"Kokiri Forest Entrance",008A:"Lake Hyrule Entrance",008E:"Gerudo Valley Entrance",0092:"Death Mountain Trail Entrance",0095:"Graveyard Entrance",009E:"Zora's Domain Entrance",00A2:"Zora's Fountain Entrance",00BA:"Goron City Entrance",00BE:"Death Mountain Trail",00C1:"Goron City",00C5:"Lakeside Laboratory",00C9:"Top of Ganon's Castle",00CD:"Hyrule Market (Child Link's)",00CF:"Hyrule Market (Adult Link's)",00F1:"Desert Colossus",00FA:"Lon Lon Ranch Entrance",00FD:"Hyrule Field" + cn Max\Double Defense Power + cd This gives you White Border Hearts + 8011A85F 0014 + cn Nayru's Love is Always + cd For this to work On Or off, you have to walk through a Doorway to activate the Change. + 8111BB58 ???? 0000:"OFF",FFFF:"ON" + cn Infinite\Timers\All Other Timers + cd This cheat works on all Race Timers not the final Boss and Under Water with iron Boots etc. + 8011BB61 0032 + cn Epona\Max Carrots\Lon Lon Raunch + cd This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona + 801F3688 0005 + 801F3848 0005 + cn Infinite\Timers\Escape From Gannons Tower + cd This cheat works only on The Final Boss. + 8011BB65 00B4 + cn Beta\Specific things lean + cd This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest World 01) + 800257D4 0001 + cn Beta\Appear in Strange Places (Hold R) + cd If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. + D01C8675 0010 + 8111BAF6 0001 + cn Beta\Interface always off/on + cd If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset. + 8011B679 00FF + 8011BAEF ???? 0000:"Off",0001:"On" + cn Always Have Wallet Size + 8011A832 ???? 0047:"Kid Wallet (Holds 99)",0057:"Adult Wallet (Holds 200)",0067:"Giant Wallet (Holds 500)" + cn Press L+R For FMV Select + cd Hold down `L+R' after the Nintendo logo is spinning to see your favourite FMV + D01C8675 0030 + 8011A793 00A0 + D01C8675 0030 + 8011A79B ???? F000:"riforce FMV",F10F:"ire FMV",F200:"riforce FMV",F300:"anondorf FMV",F400:"lanet Making FMV",F50F:"ire FMV",F600:"anondorf FMV",F700:"ore Triforce FMV",F80E:"nding" + cn Dark Link\Make Dark Link Apear In TOT + 8023E9AF 0020 + 8023E9B5 0033 + +crc 693BA2AE-B7F14E9F-C:45 +gn Legend of Zelda, The - Ocarina of Time (U) (V1.2) + cn Infinite\Rupees + cd This cheat allows you to have the max Rupees to the Wallet you currently Hold + 8111C04C 0001 + cn Press R\For Old Or Young Link + cd To Activate this Cheat Hold The R Button when walking through a Doorway this will change you to the option on the other side, Disable this Cheat straight away after getting to the other side, in some places you might even get Access Violations. Just press ok untill you can carry on. + D01C8D75 0010 + 8011AC87 ???? 0001:"Link Young",0000:"Link Old" + cn Use Any Item In Any House + cd do not use under or in water + 8111BEA2 0000 + 8111BEA4 0000 + cn Have\All Equipment + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 8111AD1C 7777 + cn Have\All Quest/Status Items + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 8111AD24 30FF + 8111AD26 FFFF + cn Max\Heart Containers + 8111ACAE 0140 + cn Max\Gold Skulltulas Killed + 8011AD51 0064 + cn Time of Day Modifier + 8111AC8C ???? 4000:"At Sunrise",5800:"Daylight Out",7000:"Very Bright Out",C000:"At Sunset",D000:"Fairly Dark" + cn Infinite\Energy + 8111ACB0 0140 + cn Infinite\Magic + D011ACB9 0008 + 8011ACBA 0001 + 8011ACBC 0001 + 8011ACB3 0060 + cn Tunic & Boot Options + cd This changes what you are wearing,once you have enabled the code press Start & then start again. + 8011ACF0 ???? 0011:"Kokiri Tunic & Kokiri Boots",0012:"Goron Tunic & Kokiri Boots",0013:"Zora Tunic & Kokiri Boots",0014:"Black Tunic & Kokiri Boots",0015:"White Tunic & Kokiri Boots",0016:"Yellow Tunic & Kokiri Boots",0021:"Kokiri Tunic & Iron Boots",0022:"Goron Tunic & Iron Boots",0023:"Zora Tunic & Iron Boots",0024:"Black Tunic & Iron Boots",0025:"White Tunic & Iron Boots",0026:"Yellow Tunic & Iron Boots",0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Infinite\Deku Sticks + 8011AD0C 0009 + cn Infinite\Deku Nuts + 8011AD0D 0009 + cn Infinite\Bombs + 8011AD0E 0009 + cn Infinite\Arrows + 8011AD0F 0009 + cn Infinite\Deku Seeds + 8011AD12 0009 + cn Infinite\Bombchu's + 8011AD14 0009 + cn Infinite\Magic Beans + 8011AD1A 0009 + cn Infinite\Big Key,Small Keys,Compass,& Map + 8011AD28 0007 + 8011AD29 0007 + 8011AD2A 0007 + 8011AD2B 0007 + 8011AD2C 0007 + 8011AD2D 0007 + 8011AD2E 0007 + 8011AD2F 0007 + 8011AD30 0007 + 8011AD31 0007 + 8011AD32 0007 + 8011AD3F 0009 + 8011AD40 0009 + 8011AD41 0009 + 8011AD42 0009 + 8011AD43 0009 + 8011AD49 0009 + 8011AD4C 0009 + 8011AD47 0009 + cn Have\Ocarina + 8011ACFB ???? 0007:"Fairy Ocarina",0008:"Ocarina Of Time" + cn Have\Boomerang + 8011AD00 000E + cn Have\Lens of Truth + 8011AD01 000F + cn Have\Megaton Hammer + 8011AD03 0011 + cn Have\Deku Stick + 8011ACF4 0000 + cn Have\Deku Nut + 8011ACF5 0001 + cn Have\Bombs + 8011ACF6 0002 + cn Have\Fairy Bow + 8011ACF7 0003 + cn Have\Fairy Slingshot + 8011ACFA 0006 + cn Have\Bombchu + 8011ACFC 0009 + cn Have\Arrows\Fire Arrow + 8011ACF8 0004 + cn Have\Arrows\Ice Arrow + 8011ACFE 000C + cn Have\Arrows\Light Arrow + 8011AD04 0012 + cn Have\Hookshot + 8011ACFD ???? 000A:"Hookshot",000B:"Longshot" + cn Have\Magic Beans + 8011AD02 0010 + cn Have\Magic\Fairie's Wind + 8011ACFF 000D + cn Have\Magic\Nayru's Love + 8011AD05 0013 + cn Have\Magic\Din's Fire + 8011ACF9 0005 + cn Bottles\Bottle 1 Modifier + 8011AD06 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 2 Modifier + 8011AD07 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 3 Modifier + 8011AD08 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 4 Modifier + 8011AD09 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Trading\Adult Link Item + 8011AD0A ???? 002D:"Pocket Egg",002E:"Pocket Cucco",002F:"Cojiro",0030:"Odd Mushroom",0031:"Odd Potion",0032:"Poacher's Saw",0033:"Goron's Sword (Broken)",0034:"Prescription",0035:"Eyeball Frog",0036:"Eye Drops",0037:"Claim Check" + cn Trading\Young Link Item + 8011AD0B ???? 0021:"Weird Egg",0022:"Chicken",0023:"Zelda's Letter",0024:"Keaton Mask",0025:"Skull Mask",0026:"Spooky Mask",0027:"Bunny Hood",0028:"Goron Mask",0029:"Zora Mask",002A:"Gerudo Mask",002B:"Mask of Truth",002C:"SOLD OUT" + cn Turn Giant's Knife Into Biggoron's Sword + 8011ACBE 0001 + cn Have Quiver (Holds 30) + 8011AD21 0001 + cn Equipment Modifier 1 + cd This modifies the equipment you are carrying. + 8011AD22 ???? 0002:"Silver Scale",0004:"Golden Scale",0006:"Giant's Knife (Broken)",0035:"Black Gauntlets",0040:"Bullet Bag (Holds 30)",0080:"Bullet Bag (Holds 40)",00C0:"Bullet Bag (Holds 50)" + cn Equipment Modifier 2 + cd This modifies the equipment you are carrying. + 8011AD23 ???? 0008:"Bomb Bag (Holds 20)",0010:"Bomb Bag (Holds 30)",0018:"Bomb Bag (Holds 40)",0020:"Goron's Bracelet",0028:"Silver Gauntlets",0030:"Golden Gauntlets" + cn Press L To Levitate + cd Press L To Levitate & Let go to land + D01C8D75 0020 + 811DB350 40CB + cn Press L For infinite Hover Boots + cd Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on + D01C8D75 0020 + 811DBB72 000D + cn Instant Step Hoover Boots + cd Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. + D01C8D75 0020 + 811DB350 40CB + D01C8D75 0000 + 811DBB72 000D + 8011ACF0 ???? 0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Beta\Play Beta Quest Worlds + cd Put on the code on load up,After the Nintendo logo you will be in Hyrule Field,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. + D01C8D75 0000 + 8011C093 ???? 0000:"World 01",0001:"World 02",0002:"World 03",0003:"World 04",0004:"World 05",0007:"World 06",0008:"World 07",0016:"World 08" + cn Warp Song Location\Minuet of Forest & Serenade of Water + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011C015 ???? 0000:"Sacred Forest Meadow",0004:"Lake Hylia",0015:"Inside Jabu Jabu's Belly",0018:"Dodongo's Cavern",0068:"Inside The Deku Tree" + cn Warp Song Location\Prelude of Light & Nocturne of Shadow + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011C015 ???? 0003:"Kakariko Windmill",0007:"Bombchu Bowling Alley",000F:"Zelda & Impa Flee",0014:"Kakariko Village",0017:"Ganon",001D:"Top of Ganon's Tower",0028:"Bombchu Shop",002C:"Bazaar",0030:"Happy Mask Shop",0034:"Ganon's Tower",0038:"Ganon's Castle",004C:"Inside Spirit Door",006C:"Burning Castle",0050:"House of Skulltula",0064:"Death Mountain Trail",0068:"Graveyard",0070:"Thieves' Hideout",0074:"Royal Family's Tomb",0078:"Great Fairy Fountain 1",0084:"Forest Temple",0088:"Great Fairy Fountain 2",0099:"Grotto 01",009D:"Grotto 02",00A4:"Grotto 04",00A8:"Grotto 05",00B3:"Grotto 06",00B0:"Grotto 07",00B4:"Grotto 08",00B8:"Grotto 09",00C3:"Grotto 10",00C0:"Grotto 11",00C4:"Grotto 12",00FC:"Grotto 13",00D3:"Bottom of the Well",00D0:"Lon Lon Ranch Shed",00D3:"Lon Lon Ranch Outside Shed",00D8:"Ice Cavern",00E3:"Outside Cow Pen",00E0:"Lost Woods Bridge",00E4:"Lon Lon Ranch Chicken Room",00E8:"In Front of Deku Tree",00EB:"Spirit Temple Boss",00F1:"Castle Courtyard",00F4:"Temple of Time",00F8:"Gerudo Fortress Jail" + cn Warp Song Location\Bolero of Fire + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011C015 ???? 0003:"Castle Courtyard",000B:"Dodongo's Cavern Boss",0010:"Inside The Deku Tree Boss",0014:"Shadow Temple Boss",0017:"Water Temple Boss",001C:"Ganon's Castle Tower",001F:"Ganon First Battle",0028:"Ganon's Castle Room Before Ganon",002B:"Inside Ganon's Castle Room With Pillar",002F:"Lon Lon Ranch",0033:"Mido's House",0037:"Saria's House",004B:"Bearded Man's House",0040:"Top of Ganon's Castle",0047:"Outside Saria's House",004F:"Dampe's Race",0057:"Kokiri Forest",005B:"Top of Death Mountain",005F:"Fishing Pond",0068:"Inside Ganon's Castle",007F:"Hyrule Castle Gate",00BA:"Top of Ganon's Tower",00C2:"Great Fairy Fountain",00D6:"Lost Woods Goron Entrance",00DA:"Lost Woods River Entrance",00DE:"Lost Woods Bridge Field Entrance",00E3:"Goron City Lost Woods Entrance",00F6:"Death Mountain Crater",00FD:"Ganon's Castle" + cn Warp Song Location\Requiem of Spirit + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 8011C015 ???? 0005:"Lake Hylia,08 Zora's Domain",0018:"Gerudo Valley",001E:"Lost Woods",0028:"Gerudo Fortress",0030:"Haunted Wasteland",0034:"Ganon's Castle Inside Burning Castle",0038:"Hyrule Castle",003A:"Ganon's Castle",003D:"Death Mountain Trail",004D:"Goron City",0065:"Fire Temple",0069:"Forest Temple",006E:"Shooting Gallery",0079:"Ganon's Castle Inside Burning Castle",007E:"Kakariko Village Entrance",007B:"Zora's River Entrance",0085:"Kokiri Forest Entrance",008A:"Lake Hyrule Entrance",008E:"Gerudo Valley Entrance",0092:"Death Mountain Trail Entrance",0095:"Graveyard Entrance",009E:"Zora's Domain Entrance",00A2:"Zora's Fountain Entrance",00BA:"Goron City Entrance",00BE:"Death Mountain Trail",00C1:"Goron City",00C5:"Lakeside Laboratory",00C9:"Top of Ganon's Castle",00CD:"Hyrule Market (Child Link's)",00CF:"Hyrule Market (Adult Link's)",00F1:"Desert Colossus",00FA:"Lon Lon Ranch Entrance",00FD:"Hyrule Field" + cn Max\Double Defense Power + cd This gives you White Border Hearts + 8011AD4F 0014 + cn Nayru's Love is Always + cd For this to work On Or off, you have to walk through a Doorway to activate the Change. + 8111C048 ???? 0000:"OFF",FFFF:"ON" + cn Infinite\Timers\All Other Timers + cd This cheat works on all Race Timers not the final Boss and Under Water with iron Boots etc. + 8011C211 0032 + cn Epona\Max Carrots\Lon Lon Raunch + cd This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona + 801F3D38 0005 + 801F3EF8 0005 + cn Infinite\Timers\Escape From Gannons Tower + cd This cheat works only on The Final Boss. + 8011C215 00B4 + cn Beta\Specific things lean + cd This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest World 01) + 80025CC4 0001 + cn Beta\Appear in Strange Places (Hold R) + cd If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. + D01C8B65 0010 + 8111BFE6 0001 + cn Beta\Interface always off/on + cd If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset, + 8011BB69 00FF + 8011BFDF ???? 0000:"Off",0001:"On" + cn Always Have Wallet Size + 8011AD22 ???? 0047:"Kid Wallet (Holds 99)",0057:"Adult Wallet (Holds 200)",0067:"Giant Wallet (Holds 500)" + cn Press L+R For FMV Select + cd Hold down `L+R' after the Nintendo logo is spinning to see your favourite FMV + D01C8D75 0030 + 8011AC83 00A0 + D01C8D75 0030 + 8011AC8B ???? F000:"riforce FMV",F10F:"ire FMV",F200:"riforce FMV",F300:"anondorf FMV",F400:"lanet Making FMV",F50F:"ire FMV",F600:"anondorf FMV",F700:"ore Triforce FMV",F80E:"nding" + cn Dark Link\Make Dark Link Apear In TOT + 8023EFBF 0020 + 8023EFC5 0033 + +crc 096A40EA-8ABE0A10-C:45 +gn LEGO Racers (U) + cn Have All Tracks and Building Pieces + 812576D4 FFFF + 812576D6 FFFF + +crc 255018DF-57D6AE3A-C:45 +gn Lode Runner 3D (U) + cn Infinite Lives + 8015299F 0063 + cn High Gold + 80152AFF 0032 + 8015293B 0032 + cn All Navigation Pieces + 8015298B 0005 + +crc 6B700750-29D621FE-C:45 +gn Mace - The Dark Ages (U) + cn Infinite Time To Choose Character + D01340F6 0001 + 811340F6 0260 + cn P2/CPU Never Wins + 80138B43 0000 + cn Sudden Death Mode\Player 1 + D1138B2A 0120 + 8008B1E7 0001 + cn Sudden Death Mode\Player 2 + D1138B2A 0120 + 8008AE5F 0001 + cn Infinite Health\Player 1 + 8008B1E7 0064 + cn Infinite Health\Player 2 + 8008AE5F 0064 + cn No Health\Player 1 + 8008B1E7 0000 + cn No Health\Player 2 + 8008AE5F 0000 + cn Extra Characters + 8007F9F8 0001 + cn R Button Health Restore\Player 1 + D007CD2B 0010 + 8008B1E7 0064 + cn Z Trigger Deathblow\Player 1 + D007CD2A 0020 + 8008AE5F 0000 + cn 1 Win to Win\Player 1 + D0138B47 0000 + 80138B47 0001 + cn 1 Win to Win\Player 2 + D0138B43 0000 + 80138B43 0001 + cn Infinite Time + 81138B2A 0708 + +crc 0CB81686-5FD85A81-C:45 +gn Madden 2000 (U) + cn Enable\Stadium\Dodge City + 80059198 00FF + cn Enable\Stadium\Xmas Rush + 80059199 00FF + cn Enable\Stadium\Tib Bros + 8005919A 00FF + cn Enable\Stadium\Tiberium + 8005919B 00FF + cn Enable\Stadium\Salvage Field + 8005919C 00FF + cn Enable\Stadium\Gridiron + 8005919D 00FF + cn Enable\Stadium\Alpha Blitz + 8005919E 00FF + cn Enable\Stadium\Nile High + 8005919F 00FF + cn Enable\Stadium\4th And Incas + 800591A0 00FF + cn Enable\Stadium\Maddenstein + 800591A1 00FF + cn Enable\Stadium\Cosmodome + 800591A2 00FF + cn Enable\Stadium\EA Sports + 800591A3 00FF + cn Enable\Stadium\Tiburon + 800591A4 00FF + cn Enable\Stadium\Tampa Bay + 800591A5 00FF + cn Enable\Stadium\New Orleans + 800591A6 00FF + cn Enable\Stadium\San Diego + 800591A7 00FF + cn Enable\Team\All 60's + 800598CC 00FF + cn Enable\Team\All 70's + 800598CD 00FF + cn Enable\Team\All 80's + 800598CE 00FF + cn Enable\Team\All 90's + 800598CF 00FF + cn Enable\Team\Madden 1999 + 800598D0 00FF + cn Enable\Team\Madden Millenium + 800598D1 00FF + cn Enable\Team\NFL Millenium + 800598D2 00FF + cn Enable\Team\EA Sports + 800598D3 00FF + cn Enable\Team\Tiburon + 800598D4 00FF + cn Enable\Team\Marshalls + 800598D5 00FF + cn Enable\Team\Toymakers + 800598D6 00FF + cn Enable\Team\Clows + 800598D7 00FF + cn Enable\Team\Praetorians + 800598D8 00FF + cn Enable\Team\Junkyard Dogs + 800598D9 00FF + cn Enable\Team\Industrials + 800598DA 00FF + cn Enable\Team\Sugarbuzz + 800598DB 00FF + cn Enable\Team\Mummies + 800598DC 00FF + cn Enable\Team\Vipers + 800598DD 00FF + cn Enable\Team\Monsters + 800598DE 00FF + cn Enable\Team\Comets + 800598DF 00FF + cn Level 1\Recover At Least One Fumble + 800707C0 0040 + cn Level 1\200 Yards Of Total Offense Or More + 800707C1 0040 + cn Level 1\Play And Win One Game of The Tournment + 800707C2 0040 + cn Level 1\Have A Minimium Of Three Players ON Team Catch One Pass + 800707C3 0040 + cn Level 1\Intercept At Least One Pass + 800707BF 0040 + cn Level 1\Play a Exhibition Game In A Stadium Other Than The Default One + 800707BE 0040 + cn Level 1\Sack The Opposing QB + 800707BD 0040 + cn Level 1\QB Passes For Two TDS Or More + 800707BC 0040 + cn Level 1\Play A Exhibition Game In A QTR Length Other Than 5 Minutes + 800707BB 0040 + cn Level 1\Create A Player And use Him In A Game + 800707BA 0040 + cn Level 1\Defeat San Francisco In Rain At 3COM Park + 800707B9 0040 + cn Level 1\Defeat Green Bay In Snow At Lambeau Field + 800707B8 0040 + cn Level 1\3 Tackles Or More By One Player + 800707B7 0040 + cn Level 1\Kick A 40 Yard Punt Or Longer + 800707B6 0040 + cn Level 1\Kick A 40 Yard Field Goal Or Longer + 800707B5 0040 + cn Level 1\Throw 0 Interceptions In A Game + 800707B4 0040 + cn Level 1\Hold Your Oppnent to 7 Points Or Less In a Game + 800707B3 0040 + cn Level 1\Score 21 Points Or More With A QTR Length Of 6 Minutes Or Less + 800707B2 0040 + cn Level 1\Complete A 20 Yard Run Or Longer + 800707B1 0040 + cn Level 1\Complete A 30 Yard Pass Or Longer + 800707B0 0040 + cn Level 2\Score 40 Points Or More Within A Quarter Length Of 6 Minutes Or Less + 800707C4 0040 + cn Level 2\100 Yards Of Rushing Or Greater By One Player + 800707C5 0040 + cn Level 2\100 Recption Yards Or Greater By One Player + 800707C6 0040 + cn Level 2\QB Passes 300 Yards Or More + 800707C7 0040 + cn Level 2\3 Field Goals Or More By One Player + 800707C8 0040 + cn Level 2\QB Passes For 4 TDS Or More + 800707C9 0040 + cn Level 2\Play And Win One Franchise Mode Game + 800707CA 0040 + cn Level 2\Play And Win One Season Mode Game Without Modified Divisions + 800707CB 0040 + cn Level 2\Play And Win One Season Mode Game With Modified Divisions + 800707CC 0040 + cn Level 2\Play And Win Two Games In A Tournment With The Same Team + 800707CD 0040 + cn Level 2\6 Receptions Or Greater By One Player + 800707CE 0040 + cn Level 2\Have A RB Who Rushes For 3 TDS Or More + 800707CF 0040 + cn Level 2\Hold Opposing Team To 150 Yards Total Offense Or Less + 800707D0 0040 + cn Level 2\QB Rushes For One Rushing TD Or More + 800707D1 0040 + cn Level 2\Commit No Fumbles In A Game + 800707D2 0040 + cn Level 2\Do Not Allow Your QB To Be Sacked In A Game + 800707D3 0040 + cn Level 2\Complete a 60 Yard Pass Or Longer + 800707D4 0040 + cn Level 2\Play And Win A Pro Bowl Game As The NFC Team + 800707D5 0040 + cn Level 2\Play And Win A Pro Bowl Game As The AFC Team + 800707D6 0040 + cn Level 2\2 TDS Or More By One Receiver + 800707D7 0040 + cn Level 3\150 Yards Rushing Or Greater By One Player + 800707D8 0040 + cn Level 3\150 Reception Yards Or Greater By One Player + 800707D9 0040 + cn Level 3\QB Who Passes For 400 Yards Or More + 800707DA 0040 + cn Level 3\3 Sacks Or More By One Player + 800707DB 0040 + cn Level 3\2 Interceptions Or More By One Player + 800707DC 0040 + cn Level 3\Recover 2 Fumbles Or More + 800707DD 0040 + cn Level 3\5 Successful Field Goals Or More By One Player + 800707DE 0040 + cn Level 3\3 Knockdowns Or More By One PLayer + 800707DF 0040 + cn Level 3\3 Tips Or More By One Player + 800707E0 0040 + cn Level 3\Play And Win A Superbowl In Franchise Mode + 800707E1 0040 + cn Level 3\Play And Win A Superbowl In Season Mode + 800707E2 0040 + cn Level 3\Successfully Kick 8 Extra Points Or More + 800707E3 0040 + cn Level 3\Play And Win An 8 Team Tournament + 800707E4 0040 + cn Level 3\Complete A 50 Yard Run Or Longer + 800707E5 0040 + cn Level 3\Commit No Penalties In A Game + 800707E6 0040 + cn Level 3\Break 2 Different All-Time Records Or More In A Game + 800707E7 0040 + cn Level 3\Score 55 Points Or Greater + 800707E8 0040 + cn Level 3\8 Tackles Or More By One Player + 800707E9 0040 + cn Level 3\400 Yards Of Total Defense Or More + 800707EA 0040 + cn Level 3\Have A RB Rush For Over 100 Yards And 50 Yards Receiving + 800707EB 0040 + cn Level 4\200 Yards Rushing Or Greater By One Player + 800707EC 0040 + cn Level 4\200 Receptions Yards Or Greater By One Player + 800707ED 0040 + cn Level 4\QB Who Passes For 500 Yards Or More + 800707EE 0040 + cn Level 4\Return A Punt For A Touchdown + 800707EF 0040 + cn Level 4\Return An Interception For A Touchdown + 800707F0 0040 + cn Level 4\6 Successful Two Point Conversions Or More + 800707F1 0040 + cn Level 4\25 Completions Or More By One QB + 800707F2 0040 + cn Level 4\Go Undefeated And Win A Superbowl In One Franchise Mode Season By Playing Every Game + 800707F3 0040 + cn Level 4\Go Undefeated And Win A Superbowl In One Season Mode Season By Playing Every Game + 800707F4 0040 + cn Level 4\QB Who Rushes For 75 Yards Or More + 800707F5 0040 + cn Level 4\Have A Minimum Of 7 Members Of Your Team Catch At Least 1 Pass + 800707F6 0040 + cn Level 4\Win A 16 Team Tournament + 800707F7 0040 + cn Level 4\7 Sacks Or More By One Player + 800707F8 0040 + cn Level 4\650 Yards Of Total Offense Or More By One Team + 800707F9 0040 + cn Level 4\Have One Reciever With 150 RAC Yards Or Greater + 800707FA 0040 + cn Level 4\Rush The Ball 40 Time Or More With A QTR Length Of 6 Minutes Or Less + 800707FB 0040 + cn Level 4\Rush For 100 Yards Or More With 2 Different Running Backs + 800707FC 0040 + cn Level 4\Win By A Margin Of 50 Points Or More + 800707FD 0040 + cn Level 4\40 First Downs Or More + 800707FE 0040 + cn Level 4\Kick A Punt Of 55 Yards Or More + 800707FF 0040 + cn Level 5\Return A Kickoff For A Touchdown + 80070800 0040 + cn Level 5\Have A QB With A Pass AVG Of 30 Yards Or Greater While Throwing At Least 5 Passes + 80070801 0040 + cn Level 5\Shut Out Opposing Team With A QTR Length Of 5 Minutes + 80070802 0040 + cn Level 5\Pass For 200 Yards Or More With 2 QBS + 80070803 0040 + cn Level 5\Have A RB With A Rushing AVG Of 20 Yards Or Greater While Rushing At least 3 Times + 80070804 0040 + cn Level 5\3 Receivers With 100 Yards Or More Recieving + 80070805 0040 + cn Level 5\200 Punt Return Yards Or Greater By One Player + 80070806 0040 + cn Level 5\QB Rushes For 3 Touchdowns Or More + 80070807 0040 + cn Level 5\Score 80 Points Or Greater + 80070808 0040 + cn Level 5\200 Kick Return Yards Or Greater By One Player + 80070809 0040 + cn Level 5\Complete A Run Play Of 80 Yards Or More + 8007080A 0040 + cn Level 5\Convert 10 4th Down Conversions Or More + 8007080B 0040 + cn Level 5\QB With A Minimum Of 150 Yards Passing And 100 Yards Rushing + 8007080C 0040 + cn Level 5\Break 4 Different All-Time Records Or More In A Game + 8007080D 0040 + cn Level 5\Successfully Kick A FG Of 55 Yards Or More + 8007080E 0040 + cn Level 5\Have A QB With A 100 Passing PCT While Throwing A Minimum Of 5 Passes + 8007080F 0040 + cn Level 5\Play And Win A Minimum Of Four Superbowls With The Same Team In Franchise Mode + 80070810 0040 + cn Level 5\RB With A Minimum Of 100 Yards Receiving And 100 Yards Rushing + 80070811 0040 + cn Level 5\Convert To 3RD Down Conversions Or More + 80070812 0040 + cn Level 5\250 Yards Rushing Or Greater By One Player + 80070813 0040 + cn Infinite\Time-Outs Home Team + 8006CE7F 0003 + cn No Time-Outs\Home Team + 8006EC7F 0000 + cn Infinite\Time-Outs Away Team + 8006FE6F 0003 + cn No Time-Outs\Away Team + 8006EF6F 0000 + cn Press L For First Down\Player 1 + D00753DD 0020 + 81071B18 0001 + cn Press L For First Down\Player 2 + D00753E5 0020 + 81071B18 0001 + cn Press L For First Down\Player 3 + D00753ED 0020 + 81071B18 0001 + cn Press L For First Down\Player 4 + D00753F5 0020 + 81071B18 0001 + cn Press R For Fourth Down\Player 1 + D00753DD 0010 + 81071B18 0004 + cn Press R For Fourth Down\Player 2 + D00753E5 0010 + 81071B18 0004 + cn Press R For Fourth Down\Player 3 + D00753ED 0010 + 81071B18 0004 + cn Press R For Fourth Down\Player 4 + D00753F5 0010 + 81071B18 0004 + cn Home Team\Always Has The Ball + 810590A8 0000 + 810590AA 0001 + cn Away Team\Always Has The Ball + 810590A8 0001 + 810590AA 0000 + cn Have All Secret Codes In Menu + 81070788 FFFF + 8107078A FFFF + 8107078C FFFF + 8107078E FFFF + cn Press GS For More Time To Choose Play + 890723E6 0024 + cn Players\Jagged + 8005F180 0080 + cn Players\Polygon + 8005F183 0001 + cn Players\Evil Crystal + 8005F183 000F + cn Uniforms\Ghetto + 8005F188 001F + cn Uniforms\Bare + 8005F188 008F + cn Players\Pixel + 8005F18D 0001 + cn Particle Illusions\A + 8005F19B 00FE + cn Particle Illusions\B + 8005F199 0002 + cn Uniforms\Future + 8005F207 0033 + cn Players\Hallow + 8005F233 0047 + cn Players\Generic Black & White + 8005F233 0058 + cn Players\Super Red + 8005F43E 0002 + +crc 13836389-265B3C76-C:45 +gn Madden Football 64 (U) + cn Infinite\Time Outs Home Team + 80082D97 0003 + cn Infinite\Time Outs Away Team + 80084EE3 0003 + cn No Time-Outs\Home Team + 80082D97 0000 + cn No Time-Outs\Away Team + 80084EE3 0000 + cn Enable\All Stadiums + 50000901 0000 + 80073510 00FF + cn Enable\All Teams + 50000901 0000 + 80073CF8 00FF + cn Invisible Players + 800545A0 0000 + 800545A0 0001 + 800545A0 0002 + 800545A0 0003 + cn Background\Gray Madden + 810596E0 0000 + cn Background\Pink Madden + 810596E0 0001 + cn Background\Green & Black Madden + 810596E0 0002 + cn Background\Coloured Madden + 810596E0 0003 + cn Background\Pink & Purple Madden + 810596E0 0004 + cn Background\Pinker Madden + 810596E0 0006 + +crc DEB78BBA-52F6BD9D-C:45 +gn Madden NFL 99 (U) + cn Infinite\Time Outs Home Team + 8005CF89 0003 + cn Infinite\Time Outs Away Team + 8005FA49 0003 + cn No Time-Outs\Home Team + 8005CF89 0000 + cn No Time-Outs\Away Team + 8005FA49 0000 + cn Home Team\Scores 50 + 8005CF87 0032 + cn Home Team\Scores 0 + 8005CF87 0000 + cn Away Team\Scores 50 + 8005FA47 0032 + cn Away Team\Scores 0 + 8005FA47 0000 + cn Enable\All Stadiums + 50000801 0000 + 8004A7F0 00FF + cn Enable\All Teams + 50000E01 0000 + 8004ADD0 00FF + cn Press L For First Down\Player 1 + D0066F2D 0020 + 810612E0 0001 + cn Press L For First Down\Player 2 + D0066F35 0020 + 810612E0 0001 + cn Press L For First Down\Player 3 + D0066F3D 0020 + 810612E0 0001 + cn Press L For First Down\Player 4 + D0066F45 0020 + 810612E0 0001 + cn Press R For Fourth Down\Player 1 + D0066F2D 0010 + 810612E0 0004 + cn Press R For Fourth Down\Player 2 + D0066F35 0010 + 810612E0 0004 + cn Press R For Fourth Down\Player 3 + D0066F3D 0010 + 810612E0 0004 + cn Press R For Fourth Down\Player 4 + D0066F45 0010 + 810612E0 0004 + cn Press L For More Time To Choose Play\Player 1 + D0066F2D 0020 + 80061245 0028 + cn Press L For More Time To Choose Play\Player 2 + D0066F35 0020 + 80061245 0028 + cn Press L For More Time To Choose Play\Player 3 + D0066F3D 0020 + 80061245 0028 + cn Press L For More Time To Choose Play\Player 4 + D0066F45 0020 + 80061245 0028 + +crc EB38F792-190EA246-C:45 +gn Madden NFL 2001 (U) + cn Home Team\Infinite Time-Outs + 80071617 0003 + cn Home Team\No Time-Outs + 80071617 0000 + cn Away Team\Infinite Time-Outs + 800738E7 0003 + cn Away Team\No Time-Outs + 800738E7 0000 + cn Have All\Cheats + 50000402 0000 + 81070788 FFFF + cn Have 99 Tokens + 8115F9F0 0063 + cn Have All\Stadiums + 50000802 0000 + 81061850 FFFF + cn Have All\Teams + 50001102 0000 + 810C1628 FFFF + cn Have All\Levels Completed + 50001902 0000 + 8115FB2C FFFF + cn Have All\Cards + 50007802 0000 + 8115F9F2 FFFF + +crc 75B61647-7ADABF78-C:45 +gn Magical Tetris Challenge (U) + cn Always Get\Magical Tetris Pieces + 811D267E DB20 + cn Always Get\Straight Pieces + 801D25F4 0000 + cn Quick Score Gain + 811D26A6 FFFF + +crc 664BA3D4-678A80B7-C:45 +gn Mario Golf (U) + cn Enable All Courses + 81130CEE FFFF + cn No Wind + 810BA9F1 0000 + 800BA9F3 0000 + cn Unlimited\Power Hits\Player 1 + 801B71F8 0004 + cn Unlimited\Power Hits\Player 2 + 801B72B0 0004 + cn Unlimited\Power Hits\Player 3 + 801B7368 0004 + cn Unlimited\Power Hits\Player 4 + 801B7420 0004 + cn Have All Characters + 50000E02 0001 + 810C28E4 0000 + cn Max Gold Mario Badges Player 1 + 800C545B 0063 + cn Zero Strokes Taken + 801B71F3 0000 + + +crc 3E5055B6-2E92DA52-C:45 +gn Mario Kart 64 (U) + cn Infinite Items\2 player Mode\Player 1 + 80165F5D ???? + 80165F8A ???? 000D:"Double Mushroom",0009:"Fake Item Box",000B:"Ghost",000A:"Invincible Star",0008:"Lightning",0001:"Single Banana",0003:"Single Green Shell",000C:"Single Mushroom",0005:"Single Red Shell",000F:"Super Mushroom",0004:"Triple Green Shell",000E:"Triple Mushroom",0006:"Triple Red Shell",0002:"Banana Bunch",0007:"Blue Spiny Shell" + cn Infinite Items\2 player Mode\Player 2 + 8016603D ???? + 8016606A ???? 000D:"Double Mushroom",0009:"Fake Item Box",000B:"Ghost",000A:"Invincible Star",0008:"Lightning",0001:"Single Banana",0003:"Single Green Shell",000C:"Single Mushroom",0005:"Single Red Shell",000F:"Super Mushroom",0004:"Triple Green Shell",000E:"Triple Mushroom",0006:"Triple Red Shell",0002:"Banana Bunch",0007:"Blue Spiny Shell" + cn Infinite Items\3-4 player Mode\Player 1 + 8016611D ???? + 8016614A ???? 000D:"Double Mushroom",0009:"Fake Item Box",000B:"Ghost",000A:"Invincible Star",0008:"Lightning",0001:"Single Banana",0003:"Single Green Shell",000C:"Single Mushroom",0005:"Single Red Shell",000F:"Super Mushroom",0004:"Triple Green Shell",000E:"Triple Mushroom",0006:"Triple Red Shell",0002:"Banana Bunch",0007:"Blue Spiny Shell" + cn Infinite Items\3-4 player Mode\Player 2 + 801661FD ???? + 8016622A ???? 000D:"Double Mushroom",0009:"Fake Item Box",000B:"Ghost",000A:"Invincible Star",0008:"Lightning",0001:"Single Banana",0003:"Single Green Shell",000C:"Single Mushroom",0005:"Single Red Shell",000F:"Super Mushroom",0004:"Triple Green Shell",000E:"Triple Mushroom",0006:"Triple Red Shell",0002:"Banana Bunch",0007:"Blue Spiny Shell" + cn Infinite Items\3-4 player Mode\Player 3 + 801662DD ???? + 8016630A ???? 000D:"Double Mushroom",0009:"Fake Item Box",000B:"Ghost",000A:"Invincible Star",0008:"Lightning",0001:"Single Banana",0003:"Single Green Shell",000C:"Single Mushroom",0005:"Single Red Shell",000F:"Super Mushroom",0004:"Triple Green Shell",000E:"Triple Mushroom",0006:"Triple Red Shell",0002:"Banana Bunch",0007:"Blue Spiny Shell" + cn Infinite Items\3-4 player Mode\Player 4 + 801663BD ???? + 801663EA ???? 000D:"Double Mushroom",0009:"Fake Item Box",000B:"Ghost",000A:"Invincible Star",0008:"Lightning",0001:"Single Banana",0003:"Single Green Shell",000C:"Single Mushroom",0005:"Single Red Shell",000F:"Super Mushroom",0004:"Triple Green Shell",000E:"Triple Mushroom",0006:"Triple Red Shell",0002:"Banana Bunch",0007:"Blue Spiny Shell" + cn No Laps to Race + 81164390 0000 + 81164392 0002 + cn Always Have\46 Pts\Bowser + 8018D9CF 002D + cn Always Have\46 Pts\D.K. + 8018D9CC 002D + cn Always Have\46 Pts\Luigi + 8018D9C9 002D + cn Always Have\46 Pts\Mario + 8018D9C8 002D + cn Always Have\46 Pts\Peach + 8018D9CE 002D + cn Always Have\46 Pts\Toad + 8018D9CB 002D + cn Always Have\46 Pts\Wario + 8018D9CD 002D + cn Always Have\46 Pts\Yoshi + 8018D9CA 002D + cn Press GS\To Play 2 Players In 1 Player Game + 8918EDE4 0003 + 8918EDE4 0007 + 8918EDE4 0005 + 8918EDE4 0001 + cn All Players Can Choose The Same Character + 810B3924 2400 + 810B3936 7FFF + 810B39A4 2400 + 810B39B6 7FFF + 810B3A38 2400 + 810B3A4E 7FFF + cn Press GS\For Full Debug Menu + cd Press GS at the Press Start Menu to access the Debug Menu + 8818EDEF 0002 + cn Have Bonus Mode and All Gold Cups + 50000401 0000 + 8018ED10 ???? 0000:"Off",00FF:"On" + cn Press L To Levitate\Player 1 + D00F6915 0020 + 810F69C8 4000 + cn Press L To Levitate\Player 2 + D00F6925 0020 + 810F77A0 4000 + cn Press L To Levitate\Player 3 + D00F6935 0020 + 810F8578 4000 + cn Press L To Levitate\Player 4 + D00F6945 0020 + 810F9350 4000 + +crc 2829657E-A0621877-C:45 +gn Mario Party (U) + cn Top Left Character\Coin Options + cd If you want to have full 255 Coins,1st use the 100 Option then put on 255. this will stop the numbers from changing & spoiling the result. + 800F32B8 ???? 0000:"0 Coins",000A:"10 Coins",0064:"100 Coins",00FF:"255 Coins" + cn Top Left Character\Star Options + 800F32BC ???? 0000:"0 Stars",0064:"99 Stars" + cn Top Right Character\Coin Options + 800F32E8 ???? 0000:"0 Coins",000A:"10 Coins",0064:"100 Coins",00FF:"255 Coins" + cn Top Right Character\Star Options + 800F32EC ???? 0000:"0 Stars",0064:"99 Stars" + cn Lower Left Character\Coin Options + 800F3318 ???? 0000:"0 Coins",000A:"10 Coins",0064:"100 Coins",00FF:"255 Coins" + cn Lower Left Character\Star Options + 800F331C ???? 0000:"0 Stars",0064:"99 Stars" + cn Lower Right Character\Coin Options + 800F3348 ???? 0000:"0 Coins",000A:"10 Coins",0064:"100 Coins",00FF:"255 Coins" + cn Lower Right Character\Star Options + 800F334C ???? 0000:"0 Stars",0064:"99 Stars" + cn Top Left Character\Dice Always + cd With this option you can calculate exactly how many you need to get on the position of your choice. + 800D62D3 ???? 0000:"Rolls In Random",0001:"Rolls In 1",0002:"Rolls In 2",0003:"Rolls In 3",0004:"Rolls In 4",0005:"Rolls In 5",0006:"Rolls In 6",0007:"Rolls In 7",0008:"Rolls In 8",0009:"Rolls In 9",000A:"Rolls In 10" + cn Top Right Character\Dice Always + cd With this option you can calculate exactly how many you need to get on the position of your choice. + 800D6317 ???? 0000:"Rolls In Random",0001:"Rolls In 1",0002:"Rolls In 2",0003:"Rolls In 3",0004:"Rolls In 4",0005:"Rolls In 5",0006:"Rolls In 6",0007:"Rolls In 7",0008:"Rolls In 8",0009:"Rolls In 9",000A:"Rolls In 10" + cn Lower Left Character\Dice Always + cd With this option you can calculate exactly how many you need to get on the position of your choice. + 800D635B ???? 0000:"Rolls In Random",0001:"Rolls In 1",0002:"Rolls In 2",0003:"Rolls In 3",0004:"Rolls In 4",0005:"Rolls In 5",0006:"Rolls In 6",0007:"Rolls In 7",0008:"Rolls In 8",0009:"Rolls In 9",000A:"Rolls In 10" + cn Lower Right Character\Dice Always + cd With this option you can calculate exactly how many you need to get on the position of your choice. + 800D639F ???? 0000:"Rolls In Random",0001:"Rolls In 1",0002:"Rolls In 2",0003:"Rolls In 3",0004:"Rolls In 4",0005:"Rolls In 5",0006:"Rolls In 6",0007:"Rolls In 7",0008:"Rolls In 8",0009:"Rolls In 9",000A:"Rolls In 10" + cn Mini Game\Unlimited 99 lives + 800F3767 0063 + cn Mini Game\Max 99 Coins + 800F3770 0063 + cn Board Select + 800ED5C3 ???? 0000:"DK's Jungle Adventure",0001:"Peach's Birthday Cake",0002:"Yoshi's Tropical Island",0003:"Wario's Battle Canyon",0004:"Luigi's Engine Room",0005:"Mario's Rainbow Castle",0006:"Bowser's Magma Mountain",0007:"Eternal Star",0008:"Explaination Map",0009:"Mini Game Stadium" + cn Mini Game Island\Press GS For 99 Lives + 880F37BB 0063 + cn Mini Game Island\99 Coins + 800F37C4 0063 + cn Mini Game Island\Always Clear Level + 800F32BB 0063 + cn Mini Game Island\World Level Select + cd Select where you want to go then Enable the cheat. as soon as you enter turn the cheat back off so you can move on to the next level and not the same place. + 810F32C4 ???? 0000:"Start Save and Return Space",0001:"1-1 Coin Block Blitz",0002:"1-2 Coin Block Bash",0003:"1-3 Coin Shower Flower",0004:"1-4 Paddle Battle",0005:"Save and Return Space 1",0006:"2-1 Memory Match",0007:"2-2 Ground Pound",0008:"2-3 Limbo Dance",0009:"2-4 Magical Mushroom",000A:"2-5 Piranha's Pursuit",0018:"3-1 Crazy Cutter",0019:"3-2 Buried Treasure",001A:"3-3 Desrt Dash",001B:"3-4 Tug O' War",001C:"3-5 Teetering Towers",001D:"Save and Return Space 2",001E:"World 4-1 to 4-3 - Entrance",0028:"World 4-4 Entrance",0029:"Save and Return Space 3",002A:"World 6-1 to 6-6 Castle Entrance",0048:"World 8-6 to 8-1 Castle Entrance 2",0049:"Save and Return Space 4",004A:"9-1 Hammer Drop",004B:"9-2 Slot Car Derby",004C:"9-3 Shell Game",004D:"9-4 Knock Block Tower",004E:"9-5 Platform Peril",004F:"Goal Space - Final Goal" + +crc 9EA95858-AF72B618-C:45 +gn Mario Party 2 (U) + cn Infinite Coins Main Menu + 810F8CD2 FFFF + cn Lower Right Char\Rolls 10 + 800DF5A9 000A + cn Lower Right Char\Item On Pick-Up + 800FD375 ???? 0000:"Mushroom",0001:"Skeleton Key",0002:"Plunder Chest",0003:"Bowser Bomb",0004:"Dueling Glove",0005:"Warp Block",0006:"Golden Mushroom",0007:"Boo Bell",0008:"Bowser Suit",0009:"Magic Lamp" + cn Upper Left Char\Rolls 10 + 800DF4C5 000A + cn Upper Left Char\Item On Pick-Up + 800FD2D9 ???? 0000:"Mushroom",0001:"Skeleton Key",0002:"Plunder Chest",0003:"Bowser Bomb",0004:"Dueling Glove",0005:"Warp Block",0006:"Golden Mushroom",0007:"Boo Bell",0008:"Bowser Suit",0009:"Magic Lamp" + cn Upper Right Char\Rolls 10 + 800DF511 000A + cn Upper Right Char\Item On Pick-Up + 800DF30D ???? 0000:"Mushroom",0001:"Skeleton Key",0002:"Plunder Chest",0003:"Bowser Bomb",0004:"Dueling Glove",0005:"Warp Block",0006:"Golden Mushroom",0007:"Boo Bell",0008:"Bowser Suit",0009:"Magic Lamp" + cn Lower Left Char\Rolls 10 + 800DF55D 000A + cn Lower Left Char\Item On Pick-Up + 800FD341 ???? 0000:"Mushroom",0001:"Skeleton Key",0002:"Plunder Chest",0003:"Bowser Bomb",0004:"Dueling Glove",0005:"Warp Block",0006:"Golden Mushroom",0007:"Boo Bell",0008:"Bowser Suit",0009:"Magic Lamp" + +crc 7C3829D9-6E8247CE-C:45 +gn Mario Party 3 (U) + cn Top Left Character\Coin Options + cd If you want to have full 255 Coins,1st use the 100 Option then put on 255. this will stop the numbers from changing & spoiling the result. + 810D1112 ???? 0000:"0 Coins",000A:"10 Coins",0064:"100 Coins",00FF:"255 Coins" + cn Top Left Character\Star Options + 800D1116 ???? 0000:"0 Stars",0064:"99 Stars" + cn Top Right Character\Coin Options + 810D114A ???? 0000:"0 Coins",000A:"10 Coins",0064:"100 Coins",00FF:"255 Coins" + cn Top Right Character\Star Options + 800D114E ???? 0000:"0 Stars",0064:"99 Stars" + cn Lower Left Character\Coin Options + 810D1182 ???? 0000:"0 Coins",000A:"10 Coins",0064:"100 Coins",00FF:"255 Coins" + cn Lower Left Character\Star Options + 800D1186 ???? 0000:"0 Stars",0064:"99 Stars" + cn Lower Right Character\Coin Options + 810D11BA ???? 0000:"0 Coins",000A:"10 Coins",0064:"100 Coins",00FF:"255 Coins" + cn Lower Right Character\Star Options + 800D11BE ???? 0000:"0 Stars",0064:"99 Stars" + cn Top Left Character\Dice Always + cd With this option you can calculate exactly how many you need to get on the position of your choice. + 800CDBD5 ???? 0000:"Rolls In Random",0001:"Rolls In 1",0002:"Rolls In 2",0003:"Rolls In 3",0004:"Rolls In 4",0005:"Rolls In 5",0006:"Rolls In 6",0007:"Rolls In 7",0008:"Rolls In 8",0009:"Rolls In 9",000A:"Rolls In 10" + cn Top Right Character\Dice Always + cd With this option you can calculate exactly how many you need to get on the position of your choice. + 800CDC21 ???? 0000:"Rolls In Random",0001:"Rolls In 1",0002:"Rolls In 2",0003:"Rolls In 3",0004:"Rolls In 4",0005:"Rolls In 5",0006:"Rolls In 6",0007:"Rolls In 7",0008:"Rolls In 8",0009:"Rolls In 9",000A:"Rolls In 10" + cn Lower Left Character\Dice Always + cd With this option you can calculate exactly how many you need to get on the position of your choice. + 800CDC6D ???? 0000:"Rolls In Random",0001:"Rolls In 1",0002:"Rolls In 2",0003:"Rolls In 3",0004:"Rolls In 4",0005:"Rolls In 5",0006:"Rolls In 6",0007:"Rolls In 7",0008:"Rolls In 8",0009:"Rolls In 9",000A:"Rolls In 10" + cn Lower Right Character\Dice Always + cd With this option you can calculate exactly how many you need to get on the position of your choice. + 800CDCB9 ???? 0000:"Rolls In Random",0001:"Rolls In 1",0002:"Rolls In 2",0003:"Rolls In 3",0004:"Rolls In 4",0005:"Rolls In 5",0006:"Rolls In 6",0007:"Rolls In 7",0008:"Rolls In 8",0009:"Rolls In 9",000A:"Rolls In 10" + +crc 5001CF4F-F30CB3BD-C:45 +gn Mario Tennis (U) + cn Have All\Characters Available + 810653C8 FFFF + cn Have All\Courts Available + 810653CC FFFF + cn Score\Player 1 + 8015344A ???? 0000:"0",0001:"15",0002:"30",0003:"40" + cn Score\Player 2 + 8015344B ???? 0000:"0",0001:"15",0002:"30",0003:"40" + cn Press C-Down For Easy Win Ring Shot - Game + cd Do Not use with Time,Balls,Points Option + D0066985 0004 + 8015350B 0082 + cn Press C-Down Easy Win Ring Shot - Time,Balls,Points + cd Do Not use with Game Option + D0066985 0004 + 80153527 0082 + D0066985 0004 + 80153523 0082 + +crc 0EC158F5-FB3E6896-C:45 +gn Mega Man 64 (U) + cn Rapid Fire + 80204EB3 0002 + cn Infinite\Health + 81204A1E 0050 + cn Infinite\Zenny + 811BC404 E0FF + 811BC406 05F5 + cn Have\Normal Items + 81205650 FFFF + 81205652 FFFF + 81205654 FFFF + 81205656 FFFF + cn Have\Special Items + 8120564C FFFF + 8120564E FFFF + cn Infinite\Ammo + 81204EBA 0080 + 81204EC2 0010 + 81204ECA 0708 + 81204ED2 0018 + 81204EDA 0010 + 81204EE2 0708 + 81204EEA 0020 + 81204EF2 0020 + 81204EFA 0020 + 81204F02 0018 + 81204F0A 012C + 81204F12 0258 + cn Have\All Special Weapons + cd With this code, Roll is the one that has to equip the weapons before you can use them. + 81205640 FFFF + +crc FA8C4571-BBE7F9C0-C:45 +gn Mickey's Speedway USA (U) + cn Play As + 800D3081 ???? 0000:"Mickey Mouse",0001:"Daisy Duck",0002:"Goofy",0003:"Pete",0004:"Minnie Mouse",0005:"Donald Duck",0006:"Huey",0007:"Dewey",0008:"Louie",0009:"Lugwig Von Drake" + cn Traffic Troubles\Indianapolis\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 8018E782 0063 + cn Traffic Troubles\San Fransisco\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 80191A52 0063 + cn Traffic Troubles\New Mexico\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 8018FD52 0063 + cn Traffic Troubles\Grand Canyon\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 80193142 0063 + cn Motor Way Mania\Los Angeles\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 8018DBE2 0063 + cn Motor Way Mania\Alaska\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 8018E372 0063 + cn Motor Way Mania\Las Vegas\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 80192A02 0063 + cn Motor Way Mania\Philadelphia\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 80193882 0063 + cn Freewayphobia\Dakota\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 8018D102 0063 + cn Freewayphobia\Seattle\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 8018FCE2 0063 + cn Freewayphobia\New York\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 8018F402 0063 + cn Freewayphobia\Chicago\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 80191F32 0063 + cn Victory Vehicles\Yellowstone\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 8018D3B2 0063 + cn Victory Vehicles\Washington DC\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 80197552 0063 + cn Victory Vehicles\Everglades\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 8018FB12 0063 + cn Victory Vehicles\Malibu\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 801915A2 0063 + cn Frantic Finale\Hawaii\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 80191F62 0063 + cn Frantic Finale\Oregon\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 8018E932 0063 + cn Frantic Finale\Texas\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 8018F0D2 0063 + cn Frantic Finale\Colorado\Max Tokens + cd Only use one Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 80191882 0063 + cn Level Select + 801875A9 ???? 0000:"Traffic Troubles",0001:"Motor Way Mania",0002:"Freewayphobia",0003:"Vitory Vehicles",0004:"Frantic Finale",0005:"Time Trial",0006:"Practice",0007:"Contest",0008:"Options" + cn Difficulty Select + 8007BF00 ???? 0000:"Amateur",0001:"Intermediate",0002:"Professional",0003:"Mirror Mode" + cn Unlock Everything + cd This will unlock all characters, tracks, mirror mode, all in-game cheats, postcards, pluto's collar and give you all Trophies for every track and difficulties. To have this cheat save to mempak, enable it and then go into the Options Menu and disable the cheat. Go to the Wide-Screen Settings and Change it to Wide-Screen [16.9] and then the B button to get back to Wide-Screen Settings, now go back into Wide-Screen [16.9] and change it back to Normal [4.3].and press the B button until you come back to the main Options Menu.Close the game and load it again to see everything saved to the Mempak and unlocked. + 800D3128 008F + 800D3129 0094 + 800D312A 0003 + 800D312C 0001 + 800D312F 0080 + 50000502 0000 + 800D3130 0009 + 50000502 0000 + 800D3131 0024 + 800D313A 0015 + 800D313B 007F + 800D313C 0001 + 800D313D 00FF + 800D313E 0004 + 800D313F 0022 + cn Always 1st & final time 00:00.00 + cd All Levels + 50000301 0000 + 801CE609 0000 + cn Re-name Characters\Mickey\Letter 1 + 801BE591 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Mickey\Letter 2 + 801BE592 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Mickey\Letter 3 + 801BE593 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Mickey\Letter 4 + 801BE594 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Mickey\Letter 5 + 801BE595 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Mickey\Letter 6 + 801BE596 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Minnie\Letter 1 + 801BE598 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Minnie\Letter 2 + 801BE599 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Minnie\Letter 3 + 801BE59A ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Minnie\Letter 4 + 801BE59B ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Minnie\Letter 5 + 801BE59C ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Minnie\Letter 6 + 801BE59D ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Donald\Letter 1 + 801BE59F ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Donald\Letter 2 + 801BE5A0 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Donald\Letter 3 + 801BE5A1 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Donald\Letter 4 + 801BE5A2 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Donald\Letter 5 + 801BE5A3 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Donald\Letter 6 + 801BE5A4 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Daisy\Letter 1 + 801BE5A6 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Daisy\Letter 2 + 801BE5A7 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Daisy\Letter 3 + 801BE5A8 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Daisy\Letter 4 + 801BE5A9 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Daisy\Letter 5 + 801BE5AA ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Goofy\Letter 1 + 801BE5AC ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Goofy\Letter 2 + 801BE5AD ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Goofy\Letter 3 + 801BE5AE ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Goofy\Letter 4 + 801BE5AF ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Goofy\Letter 5 + 801BE5B0 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Pete\Letter 1 + 801BE5B2 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Pete\Letter 2 + 801BE5B3 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Pete\Letter 3 + 801BE5B4 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Pete\Letter 4 + 801BE5B5 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Huey\Letter 1 + 801BE5B7 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Huey\Letter 2 + 801BE5B8 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Huey\Letter 3 + 801BE5B9 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Huey\Letter 4 + 801BE5BA ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Dewey\Letter 1 + 801BE5BC ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Dewey\Letter 2 + 801BE5BD ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Dewey\Letter 3 + 801BE5BE ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Dewey\Letter 4 + 801BE5BF ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Dewey\Letter 5 + 801BE5C0 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Louie\Letter 1 + 801BE5C2 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Louie\Letter 2 + 801BE5C3 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Louie\Letter 3 + 801BE5C4 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Louie\Letter 4 + 801BE5C5 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Louie\Letter 5 + 801BE5C6 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Ludwig\Letter 1 + 801BE5C8 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Ludwig\Letter 2 + 801BE5C9 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Ludwig\Letter 3 + 801BE5CA ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Ludwig\Letter 4 + 801BE5CB ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Ludwig\Letter 5 + 801BE5CC ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Ludwig\Letter 6 + 801BE5CD ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Traffic Troubles\Indianapolis\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 8018E75B 0063 + cn Traffic Troubles\San Fransisco\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 80191A2B 0063 + cn Traffic Troubles\New Mexico\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 8018FD2B 0063 + cn Traffic Troubles\Grand Canyon\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 8019311B 0063 + cn Motor Way Mania\Los Angeles\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 8018DBBB 0063 + cn Motor Way Mania\Alaska\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 8018E34B 0063 + cn Motor Way Mania\Las Vegas\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 801929DB 0063 + cn Motor Way Mania\Philadelphia\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 8019385B 0063 + cn Freewayphobia\Dakota\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 8018D0DB 0063 + cn Freewayphobia\Seattle\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 8018FCBB 0063 + cn Freewayphobia\New York\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 8018F3DB 0063 + cn Freewayphobia\Chicago\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 80191F0B 0063 + cn Victory Vehicles\Yellowstone\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 8018D38B 0063 + cn Victory Vehicles\Washington DC\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 8019752B 0063 + cn Victory Vehicles\Everglades\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 8018FAEB 0063 + cn Victory Vehicles\Malibu\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 8019157B 0063 + cn Frantic Finale\Hawaii\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 80191F3B 0063 + cn Frantic Finale\Oregon\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 8018E90B 0063 + cn Frantic Finale\Texas\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 8018F0AB 0063 + cn Frantic Finale\Colorado\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 8019185B 0063 + +crc F1850C35-ACE07912-C:45 +gn Micro Machines 64 Turbo (U) + cn Always Place 1st + 802083F1 0001 + cn Infinite\Lives + 800BAFD2 0009 + cn Infinite\Specials On Pickup + 80208401 0005 + +crc 09D53E16-3AB268B9-C:45 +gn Mike Piazza's Strike Zone (U) + cn Infinite\Balls + 801606D0 0000 + cn Almost Always Hit A Home Run + 80195714 0001 + cn Fast Game + 80195729 0001 + cn Increased Gravity + 80195727 0001 + cn Low Gravity + 80195726 0001 + cn Slow Game + 8019572A 0001 + cn Home Team\Score 0 + cd Do not use with Home Team Scors 30 + 801606B7 0000 + cn Home Team\Score 30 + cd Do not use with Home Team Scors 0 + 801606B7 001E + cn Away Team\Score 0 + cd Do not use with Away Team Scors 30 + 801606B5 0000 + cn Away Team\Score 30 + cd Do not use with Away Team Scors 30 + 801606B5 001E + cn Infinite\Strikes + 801606D1 0000 + cn Stadium Modifier + 800DE7E5 ???? 0000:"Edison Into Field",0001:"The Ball Park At Arlington",0002:"The Astrodome",0003:"Bank One Ballpark",0004:"Milwaukee County Stadium",0005:"Baltimore",0006:"3com Park at Candle Stick Park",0007:"Comiskey Park",0008:"Coors Field",0009:"Olympics Stadium",000A:"Fenway Park",000B:"Jacobs Field",000C:"Proplayer Stadium",000D:"Kauffman Stadium",000E:"The Kingdom",000F:"Dodger Stadium",0010:"Oakland Alameda Country Stadium",0011:"Qualcomm Stadium at Jack Murphy Field",0012:"Cinergy Field",0013:"Shea Stadium",0014:"Skydome",0015:"Bush Stadium",0016:"3 Rivers Stadium",0017:"Tiger Stadium",0018:"Tropicane Field",0019:"Turner Field",001A:"Hubert Humphrey Metrodome",001B:"Veterans Stadium",001C:"Wrigley Field",001D:"Yankee Stadium",001E:"Devil's Thumb Stadium" + +crc 2E955ECD-F3000884-C:45 +gn Milo's Astro Lanes (U) + cn Bowl A Perfect Game + 5000090C 0000 + 800AC9F0 000A + 800ACA5E 000A + +crc 0B93051B-603D81F9-C:45 +gn Mischief Makers (U) + cn Infinite\Red Gems + 81175B66 270F + cn Infinite\Health + 810ED0E0 03E8 + +crc 26035CF8-802B9135-C:45 +gn Mission Impossible (U) + cn Invincibility + 810862B4 0101 + cn Infinite\Ammo All Guns + 50000610 0000 + 800A8EA7 00FF + cn Infinite\Health + 810862B2 FFFF + cn Access All Levels + 8008A5C6 0001 + 8008A5DA 0001 + 8008A602 0001 + 8008A652 0001 + 8008A666 0001 + 8008A67A 0001 + 8008A68E 0001 + 8008A6A2 0001 + 8008A6B6 0011 + 8008A6CA 0021 + 8008A6DE 0001 + 8008A706 0011 + 8008A71A 0041 + 8008A72E 0021 + 8008A742 0081 + 8008A756 0001 + 8008A76A 0081 + 8008A77E 0001 + 8008A7A6 0001 + 8008A7CE 0001 + 8008A7E2 0011 + 8008A7F6 0021 + 8008A846 0001 + 8008AB2A 0001 + 8008AB3E 0001 + 8008AB52 0001 + 8008AB66 0001 + cn Freeze All Timers + 81093D40 0063 + 81093D42 0063 + 81093D44 0063 + cn Weapon Select + 800A8EA5 ???? + 800A8EB5 ???? + 800A8EC5 ???? 0000:"9MM Hi Power",0001:"Silenced Pistol",0002:"Uzi",0003:"Fists",0032:"Gas Spray",0036:"Blow Torch",001F:"Fire Extinguisher",0024:"Spray Paint",0027:"Electrostunner",000B:"Blow Dart Gun",000C:"Dart Hand Gun",002D:"Mini Rocket Launcher" + cn Walk Through Walls & Objects + cd This will allow you to pass through anything & even walk on water.if you amerge somewhere in the ground just press the A button. + 80093EF5 ???? 0080:"On",0000:"Off" + +crc 5AC383E1-D712E387-C:45 +gn Monopoly (U) + cn Infinite\Money\Player 1 + 81324B46 270F + cn Infinite\Money\Player 2 + 81324B5A 270F + cn Infinite\Money\Player 3 + 81324B6E 270F + cn Infinite\Money\Player 4 + 81324B82 270F + cn [Language Select] + cd To use this load the game then enable this cheat and Reset (F1) you will now be on your chosen Language and Relative Local Language Board and Money. + D009675F 0001 + 80096758 ???? 0000:"American",0001:"British",0002:"France",0003:"German" + +crc B19AD999-7E585118-C:45 +gn Monster Truck Madness 64 (U) + cn Have\Aztec Valley Track + 801256BF 0001 + cn Have\Alpine Challenge Track + 801256DF 0001 + cn Have\Death Trap Track + 801256FF 0001 + cn Infinite Missiles (Upon Pickup) + D0164BBF 0001 + 801A6054 0009 + +crc 417DD4F4-1B482FE2-C:45 +gn Mortal Kombat 4 (U) + cn Big Head Mode + 80048CB5 0001 + cn Infinite\Health Player 1 + 810FE0D8 0001 + 810FE0DA 0000 + cn Infinite\Health Player 2 + 81126F54 0001 + 81126F56 0000 + cn 1 Round To Win Player 1 + D01050F3 0000 + 801050F3 0001 + cn 99 Wins Player 1 + 800FE27F 0063 + cn Infinite\Credits + 800493BF 00FF + cn Infinite\Time + 8010511B 0063 + cn Play\As Goro Player 1 + 800FE293 000F + cn Play\As Noob Saibot Player 1 + 800FE293 0011 + +crc C34304AC-2D79C021-C:45 +gn Mortal Kombat Mythologies - Sub-Zero (U) + cn Infinite Lives + 8010BCFF 0009 + cn Invincible + 8009F742 0001 + cn Level Select + D009A913 0000 + 8009A913 ???? 0000:"Level 1 - Shaolin Temple - China",0001:"Level 2 - Wind Realm",0002:"Level 3 - Earth Realm",0003:"Level 4 - Water Realm",0004:"Level 5 - Fire Ream",0005:"Level 6 - Prison",0006:"Level 7 - Bridge",0007:"Level 8 - Fortress" + cn Max Experience + 8111200E FC9A + +crc D9F75C12-A8859B59-C:45 +gn Mortal Kombat Trilogy (U) (v1.0) + cn Player 1\No Energy + 8016984D 0000 + cn Player 2\No Energy + 80169B21 0000 + cn Player 2\Unlimited Energy + 80169B21 00A6 + cn Player 1\Unlimited Energy + 8016984D 00A6 + +crc 2AF9B65C-85E2A2D7-C:45 +gn MRC - Multi Racing Championship (U) + cn Infinite Time + 80094E97 0064 + cn Low Course Time + 8009483B 0000 + cn Always Place 1st + 800A960F 0000 + +crc 1938525C-586E9656-C:45 +gn Ms. Pac-Man Maze Madness (U) + cn Infinite\Health + 8111D55C 003C + cn Infinite\Lives + 8010A3D7 0009 + cn Have All Dots + 8111D55E 03E7 + cn Max Score + 8111EF14 E0FF + 8111EF16 05F5 + +crc FCBCCB21-72903C6B-C:45 +gn Mystical Ninja - Starring Goemon (U) + cn Infinite\Health + 8015C5E7 0028 + cn Infinite\Lives + 8015C5EF 0009 + cn Infinite\Money + 8115C5EA 270F + cn Press\L To Levitate + D00C7D3B 0020 + 8116A044 4000 + cn Press\R To Use Chargeable Weapon + D00C7D3B 0010 + 8120C896 005D + cn Max Heart Containers + 8015C5E3 0027 + cn Play As + 8015C5DF ???? 0000:"Goemon,01 Ebisumaru,02 Sasuke,03 Yae" + cn Goemon\Have\Chain Pipe + 8015C6BF 0002 + cn Goemon\Have\Medal of Flames + 8015C6DF 0001 + cn Goemon\Have\Magic Sudden Impact + 8015C6EF 0001 + cn Goemon\Pipe Modifier + 8015C6AF ???? 0000:"Normal Pipe,01 Silver Pipe,02 Gold Pipe" + cn Yae\Have\Bazooka + 8015C6DB 0001 + cn Yae\Have\Flute + 8015C6CB 0001 + cn Yae\Have\Magic Mermaid + 8015C6FB 0001 + cn Yae\Katana Modifier + 8015C6BB ???? 0000:"Normal Katana,01 Silver Katana,02 Gold Katana" + cn Ebisumaru\Automatically Complete Ebisumaru's Training + 803B52F4 0008 + cn Ebisumaru\Have\Windup Camera + 8015C6D3 0001 + cn Ebisumaru\Have\Meat Saw Hammer + 8015C6C3 0001 + cn Ebisumaru\Have\Magic Mini Ebisu + 8015C6F3 0001 + cn Ebisumaru\Saw Hammer Modifier + 8015C6B3 ???? 0000:"Normal Saw Hammer",0001:"Silver Saw Hammer",0002:"Gold Saw Hammer" + cn Sasuke\Have\Fire Cracker Bomb + 8015C6C7 0001 + cn Sasuke\Have\Kunai of Severe Cold + 8015C6D7 0001 + cn Sasuke\Have\Magic Flying + 8015C6F7 0001 + cn Sasuke\Kunai Modifier + 8015C6B7 ???? 0000:"Normal Kunai,01 2 Kunai's,02 Gold Kunai" + cn Have\Triton Shell + 8015C6FF 0001 + cn Have\Brown Item + 8015C703 0001 + cn Have\Silver Fortune Doll + 8015C707 0001 + cn Have\Brown Round Item + 8015C70F 0001 + cn Have\Gold Key + 8015C713 0001 + cn Have\Blue Sausage + 8015C717 0001 + cn Have\Pink Fish + 8015C71B 0001 + cn Have\Gold Fish + 8015C71F 0001 + cn Have\Blue Fish + 8015C723 0001 + cn Goemon\D-Pad Up To Refill Oil + D0067D3A 0008 + 812F706A 03E7 + cn Goemon\Maximum Money + 812F70EA 03E7 + cn Goemon\Robot Boss' Has No Health + 812F7062 0000 + cn Goemon\D-Pad Left To Charge Laser + D00C7D3A 0002 + 802F706F 0064 + +crc 8D2BAE98-D73725BF-C:45 +gn Nagano Winter Olympics '98 (U) + cn Press [START] To Reset Timer + 81137886 0000 + cn Infinite Stamina + 81138400 447A + 81138404 447A + +crc 5129B6DA-9DEF3C8C-C:45 +gn Namco Museum 64 (U) + cn Dig-Dug\Infinite\Credits + 800FE67E 0063 + cn Dig-Dug\Infinite\Lives\Player 1 + 800FE709 0002 + cn Dig-Dug\Score\Player 1 + 810FE704 9999 + cn Dig-Dug\Infinite\Lives\Player 2 + 800FE76B 0004 + cn Dig-Dug\Score\Player 2 + 810FE768 9999 + cn Galaga\Infinite\Credits + 800D76A4 0063 + cn Galaga\Infinite\Lives\Both Players + 800D7510 0002 + cn Galaxian\Infinite\Credits + 800CD3D0 0063 + cn Galaxian\Infinite\Lives + 800CD3AD 0003 + cn Galaxian\Score\Player 1 + 810BCE7C 9999 + cn Galaxian\Score\Player 2 + 810BC780 9999 + cn Ms Pac-Man\Infinite\Credits + 800BBE4B 0063 + cn Ms Pac-Man\Infinite\Lives\Player P1 + 800BBE23 0004 + cn Ms Pac-Man\Score Modifier\Player 1 + 810BC7E8 9999 + cn Ms Pac-Man\Infinite\Lives\Player 2 + 800BBE27 0004 + cn Ms Pac-Man\Score\Player 2 + 810BC7EC 9999 + cn Ms Pac-Man\High Score Modifier + 810BC1F8 9999 + cn Ms Pac-Man\Eat All Ghosts All The Time + 810BC100 0000 + 810BC102 0000 + 810BC12C 0000 + 810BC12E 0000 + 810BC158 0000 + 810BC15A 0000 + 810BC184 0000 + 810BC186 0000 + cn Pac-Man\Infinite\Credits + 800A8817 0063 + cn Pac-Man\Infinite\Lives\Player 1 + 800BBE23 0004 + cn Pac-Man\Score\Player 1 + 810A86F0 9999 + cn Pac-Man\Infinite\Lives\Player 2 + 800BBE27 0004 + cn Pac-Man\Score\Player 2 + 810A86F4 9999 + cn Pac-Man\High Score + 810A86F8 9999 + cn Pac-Man\Eat All Ghosts All The Time + 810A8760 0000 + 810A8762 0000 + 810A878C 0000 + 810A878E 0000 + 810A87B8 0000 + 810A87BA 0000 + 810A87E4 0000 + 810A87E6 0000 + cn Pole Position\Infinite Time + 8010A243 0063 + cn Pole Position\Score + 81107BF8 9999 + +crc 23749578-80DC58FD-C:45 +gn NASCAR 99 (U) + cn 1 Lap to Race + 800438B3 0009 + D021FBAB 0000 + 8021FBAB 0008 + D022359B 0000 + 8022359B 0008 + cn Total Laps to Race Modifier + 800438B3 ???? 0001:"1 lap",0002:"2 lap",0003:"3 lap",0004:"4 lap",0005:"5 lap",0006:"6 lap",0007:"7 lap",0008:"8 lap",0009:"9 lap" + cn Max Gear Ratios + 810C9E90 7F1E + 810C9E82 707F + +crc DF331A18-5FD4E044-C:45 +gn NASCAR 2000 (U) + cn Total Number Of Laps + 80046553 ???? 0001:"1 lap",0002:"2 lap",0003:"3 lap",0004:"4 lap",0005:"5 lap",0006:"6 lap",0007:"7 lap",0008:"8 lap",0009:"9 lap" + cn 1 Lap Race + cd Do not put this on with Total Number of Laps Code + 810495AE 0001 + cn Infinite Fuel\Player 1 + 81220502 3E80 + cn Infinite Fuel\Player 2 + 81230472 3E80 + cn Maximum\Pit Distance + 800C7110 0000 + cn Maximum\Top Speed + 800C7111 0000 + cn Maximum\Acceleration + 800C7113 0000 + cn Beat Championship Mode Easily + 80223E3B 0255 + cn Race Forever + 810465AE FDE8 + cn Both Players Can Be Dale E + 80046538 0003 + cn Have CPU Control Car Player 1 + D0092985 0020 + 8015CC5C 0001 + D0092985 0010 + 8015CC5C 0000 + +crc 4E69B487-FE18E290-C:45 +gn NBA Hangtime (U) + cn Team 1 Scores 150 pts + 800A6689 0096 + cn Team 2 Scores 150 pts + 800A668B 0096 + +crc EBEEA8DB-F2ECB23C-C:45 +gn NBA JAM 2000 + cn Infinite Shot Clock + 801378DF 0016 + cn Infinite Violation Clock + 8013783B 005D + cn Infinite Turbo\Team 1\Player 1 + 8115B512 FF00 + cn Infinite Turbo\Team 1\Player 2 + 8115B516 FF00 + cn Team 1 Score Select + 80137117 ???? 0000:"00",0096:"150" + cn Infinite Turbo\Team 2\Player 1 + 8115B50A FF00 + cn Infinite Turbo\Team 2\Player 2 + 8115B50E FF00 + cn Team 2 Score Select + 80137113 ???? 0000:"00",0096:"150" + +crc 810729F6-E03FCFC1-C:45 +gn NBA Jam 99 (U) + cn Home Team\Scores 150 + 81160FFA 0096 + cn Home Team\Scores 0 + 81160FFA 0000 + cn Away Team\Scores 150 + 81160FFE 0096 + cn Home Team\Scores 0 + 81160FFE 0000 + cn Infinite\Time Outs\Home + 800D5C75 0007 + cn No Time Outs\Home + 800D5C7F 0000 + cn Infinite\Time Outs\Away + 800D5C9B 0007 + cn No Time Outs\Away + 800D5C9B 0000 + cn Away Team\Full Court Dunks + 81182E4E 0004 + 8118305A 0004 + 81183266 0004 + 81183472 0004 + 8118367E 0004 + cn Away Team\Giant Players + 81182DF6 0032 + 81182DFE 003C + 81183002 0032 + 8118300A 003C + 8118320E 0032 + 81183216 003C + 8118341A 0032 + 81183422 003C + 81183626 0032 + 8118362E 003C + cn Away Team\Tiny Players + 81182DF6 0011 + 81182DFE 0014 + 81183002 0011 + 8118300A 0014 + 8118320E 0011 + 81183216 0014 + 8118341A 0011 + 81183422 0014 + 81183626 0011 + 8118362E 0014 + cn Creation Points (L / R) + D0061269 0020 + 8117E008 0200 + D0061269 0010 + 8117E008 0000 + cn Home Team\Full Court Dunks + 81182412 0004 + 8118261E 0004 + 8118282A 0004 + 81182A36 0004 + 81182C42 0004 + cn Home Team\Giant Players + 811823BA 0032 + 811823C2 003C + 811825C6 0032 + 811825CE 003C + 811827D2 0032 + 811827DA 003C + 811829DE 0032 + 811829E6 003C + 81182BEA 0032 + 81182BF2 003C + cn Home Team\Tiny Players + 811823BA 0011 + 811823C2 0014 + 811825C6 0011 + 811825CE 0014 + 811827D2 0011 + 811827DA 0014 + 811829DE 0011 + 811829E6 0014 + 81182BEA 0011 + 81182BF2 0014 + +crc 6A121930-665CC274-C:45 +gn NBA In The Zone '98 (U) + cn Options\FT. Penalty Situations + 80144999 ???? 0000:"2",0001:"4",0002:"6",0003:"No" + cn Home Team\Scores + 8013C2B1 ???? 0000:"No Points",000A:"10 Points",0014:"20 Points",0028:"40 Points",003C:"60 Points",0050:"80 Points",0064:"100 Points",00C8:"200 Points",00FA:"250 Points" + cn Away Team\Scores + 8013C2B3 ???? 0000:"No Points",000A:"10 Points",0014:"20 Points",0028:"40 Points",003C:"60 Points",0050:"80 Points",0064:"100 Points",00C8:"200 Points",00FA:"250 Points" + cn Home Team\Infinite Time-Outs + cd Do not use this with the No Time Out's Cheat + 8013C2D6 0009 + 80140862 0009 + cn Away Team\Infinite Time-Outs + cd Do not use this with the No Time Out's Cheat + 8013C2D7 0009 + 80140863 0009 + cn Home Team\No Time-Outs + cd Do not use this with the Infinite Time Out's Cheat + 8013C2D6 0000 + 80140862 0000 + cn Away Team\No Time-Outs + cd Do not use this with the Infinite Time Out's Cheat + 8013C2D7 0000 + 80140863 0000 + cn No Shot Clock + 81140E1E FFFF + cn Create A Player\Max Field Goal + 8013FF98 0063 + cn Create A Player\Max 3 Point + 8013FF99 0063 + cn Create A Player\Max Free Throw + 8013FF9A 0063 + cn Create A Player\Max Rebound + 8013FF9C 0063 + cn Create A Player\Max Block + 8013FF9D 0063 + cn Create A Player\Max Steal + 8013FF9E 0063 + cn Create A Player\Max Speed + 8013FF9F 0063 + cn Create A Player\Max Ball Control + 8013FFA1 0063 + cn Create A Player\Max Power + 8013FFA2 0063 + cn Options\Quarter Length + 8013D865 ???? 0000:"3:00",0001:"5:00",0002:"8:00",0003:"12:00" + cn Options\Level + 8013D864 ???? 0000:"Enjoy",0001:"Exciting",0002:"Super Challenge" + cn Options\Stamina + 8013D866 ???? 0000:"On",0001:"Off" + cn Options\27 Time Out Limit + 8013D867 ???? 0000:"Yes",0001:"No" + cn Options\Replay + 8013D868 ???? 0000:"Yes",0001:"No" + cn Options\Player Display + 8013D869 ???? 0000:"Name",0001:"Number",0002:"None" + cn Options\Camera View + 8013D86A ???? 0000:"1",0001:"2",0002:"3",0003:"4",0004:"5",0005:"6",0006:"7",0007:"8",0008:"9",0009:"10" + cn Options\Out Of Bounds + 80144990 ???? 0000:"1",0001:"2",0002:"3",0003:"4",0004:"5",0005:"6",0006:"7",0007:"8",0008:"9",0009:"10" + cn Options\Shot Clock Violation + 80144991 ???? 0000:"1",0001:"2",0002:"3",0003:"4",0004:"5",0005:"6",0006:"7",0007:"8",0008:"9",0009:"10" + cn Options\Second Violation + 80144992 ???? 0000:"1",0001:"2",0002:"3",0003:"4",0004:"5",0005:"6",0006:"7",0007:"8",0008:"9",0009:"10" + cn Options\5 Second Violation + 80144993 ???? 0000:"1",0001:"2",0002:"3",0003:"4",0004:"5",0005:"6",0006:"7",0007:"8",0008:"9",0009:"10" + cn Options\3 Second Violation + 80144994 ???? 0000:"1",0001:"2",0002:"3",0003:"4",0004:"5",0005:"6",0006:"7",0007:"8",0008:"9",0009:"10" + cn Options\Foul Out + 80144995 ???? 0000:"2",0001:"4",0002:"6",0003:"No" + cn Options\Back Court + 80144996 ???? 0000:"2",0001:"4",0002:"6",0003:"No" + cn Options\Traveling + 80144997 ???? 0000:"2",0001:"4",0002:"6",0003:"No" + cn Options\Goal Tending + 80144998 ???? 0000:"2",0001:"4",0002:"6",0003:"No" + +crc A292524F-3D6C2A49-C:45 +gn NBA In The Zone '99 (U) + cn No Shot Clock + 812010C4 43FF + cn Home Team\Score + 81290378 ???? 0000:"o Points",0A01:"0 Points",1402:"0 Points",2804:"0 Points",3C06:"0 Points",5008:"0 Points",6401:"00 Points",C802:"00 Points",FA02:"50 Points" + cn Away Team\Score + 8129195C ???? 0000:"o Points",0A01:"0 Points",1402:"0 Points",2804:"0 Points",3C06:"0 Points",5008:"0 Points",6401:"00 Points",C802:"00 Points",FA02:"50 Points" + cn Home Team\Time Outs Home + 80290374 ???? 0000:"None",0007:"Infinite" + cn Away Team\Time Outs + 80291958 ???? 0000:"None",0007:"Infinite" + cn Create A Player Codes\Max Shooting + 802C5EFB 0063 + cn Create A Player Codes\Max 3 Point + 802C5EFC 0063 + cn Create A Player Codes\Max Free Throw + 802C5EFD 0063 + cn Create A Player Codes\Max Offensive + 802C5EFE 0063 + cn Create A Player Codes\Max Defensive + 802C5EFF 0063 + cn Create A Player Codes\Max Rebound + 802C5F00 0063 + cn Create A Player Codes\Max Techinque + 802C5F01 0063 + cn Create A Player Codes\Max Capaility + 802C5F02 0063 + +crc 5F25B0EE-6227C1DB-C:45 +gn NBA Live 2000 (U) + cn Home Team\Infinite Time Outs + 811344D0 0700 + cn Home Team\No Time Outs + 811344D0 0000 + cn Away Team\Infinite Time Outs + 81135098 0700 + cn Away Team\No Time Outs + 81135098 0000 + cn Infinite Shot Clock + 811318F2 05A0 + cn Max Inside Scoring + 8017B7AC 0064 + cn Jump Shooting + 8017B7AD 0064 + cn Max\3 Pointers + 8017B7AE 0064 + cn Max\Free Throws + 8017B7AF 0064 + cn Max\Dunking + 8017B7B0 0064 + cn Max\Stealing + 8017B7B1 0064 + cn Max\Blocking + 8017B7B2 0064 + cn Max\Off. Awareness + 8017B7BA 0064 + cn Max\Def. Awareness + 8017B7B3 0064 + cn Max\Quickness + 8017B7B4 0064 + cn Max\Off. Rebounds + 8017B7B5 0064 + cn Max\Def. Rebounds + 8017B7B6 0064 + cn Max\Jumping + 8017B7B7 0064 + cn Max\Strength + 8017B7B8 0064 + cn Max\Passing + 8017B7B9 0064 + cn Max\Speed + 8017B7BB 0064 + cn Max\Dribbling + 8017B7BC 0064 + cn Max\Endurance + 8017B7BD 0064 + cn Max\Shooting Range + 8017B7BE 0064 + +crc 6DFDCDC3-4DE701C8-C:45 +gn =NHL Breakaway 98 (U) + cn Activate Cheat Menu + 80053F38 0001 + cn Home Team Goals + 8012BBBC ???? 0000:"No Score",00FF:"Max Score" + cn Away Team Goals + 8012BBBD ???? 0000:"No Score",00FF:"Max Score" + +crc 82EFDC30-806A2461-C:45 +gn NHL Blades Of Steel '99 (U) + cn Away Team Scores 50 + 801F6407 0032 + 802004C0 0032 + cn Home Team Scores 50 + 801F6406 0032 + 802004BF 0032 + +crc 36FA35EB-E85E2E36-C:45 +gn NFL Blitz 2001 (U) + cn Fire Team 1\Player 1 + 800EC0CB ???? 0001:"Always On",0000:"Never On" + cn Always On Fire Team 2\Player 2 + 800EC0CF ???? 0001:"Always On",0000:"Never On" + cn Infinite Turbo\Player 1 + 810EC12C 42C8 + 810EC12E 0000 + cn Infinite Turbo\Player 2 + 81DEC164 42C8 + 81DEC166 0000 + +crc E3AB4ED0-83040DD2-C:45 +gn NFL Quarterback Club 2000 (U) + cn Max Clu + 80075275 0063 + cn Max End + 8007527D 0063 + cn Max Hnd + 80075279 0063 + cn Max Rcg + 80075273 0063 + cn Max Rng + 8007526F 0063 + cn Max Scr + 80075271 0063 + cn Max Spd + 80075277 0063 + cn Home Team\No Time Outs + 80054956 0000 + cn Away Team\No Time Outs Away + 80054ED6 0000 + cn Infinite Creation Points + 8107B36E 03E7 + cn Home Team\Infinite Time Outs + 80054956 0003 + cn Away Team\Infinite Time Outs + 80054ED6 0003 + cn Infinite Time To Choose Play + 81081448 2800 + cn Max Acc + 8007526D 0064 + cn Max Cat + 8007527B 0063 + +crc 28784622-FFB22985-C:45 +gn NFL Quarterback Club 2001 (U) + cn Infinite Player Creation Pts + 8107A0F2 00C8 + cn Always 1st Down + 800785D2 0001 + cn 1 Down Per Possession + 800785D2 0004 + +crc BE76EDFF-20452D09-C:45 +gn NFL Quarterback Club 99 (U) + cn Home Team\Infinite Time Outs + 8004C0B6 0003 + cn Home Team\No Time Outs + 8004C0B6 0000 + cn Away Team\Infinite Time Outs + 8004C62E 0003 + cn Away Team\No Time Outs + 8004C62E 0000 + cn Infinite\Time to Choose Play + 81080152 0028 + cn Infinite\Character Creation Points + 81072F30 015E + cn Max\Accuracy + 8106FDB8 0064 + cn Max\Range + 8106FDBA 0064 + cn Max\Scramble + 8106FDBC 0064 + cn Max\Hands + 8106FDBE 0064 + cn Max\Speed + 8106FDC0 0064 + cn Max\Catch + 8106FDC2 0064 + cn Max\Endurance + 8106FDC4 0064 + +crc E3AB4ED0-83040DD2-C:45 +gn NFL Quarterback Club 2000 (U) + cn Home Team\Infinite Time Outs + 80054956 0003 + cn Home Team\No Time Outs + 80054956 0000 + cn Away Team\Infinite Time Outs + 80054ED6 0003 + cn Away Team\No Time Outs + 80054ED6 0000 + cn Infinite\Time To Choose Play + 81081448 2800 + cn Max\Acc + 8007526D 0064 + cn Max\Cat + 8007527B 0063 + cn Max\Clu + 80075275 0063 + cn Max\End + 8007527D 0063 + cn Max\Hnd + 80075279 0063 + cn Max\Rcg + 80075273 0063 + cn Max\Rng + 8007526F 0063 + cn Max\Scr + 80075271 0063 + cn Max\Spd + 80075277 0063 + cn Infinite\Creation Points + 8107B36E 03E7 + +crc 2153143F-992D6351-C:45 +gn New Tetris, The (U) + cn Press L + C-Down For Cheat Screen + D01101B3 0024 + 8103BFE0 0000 + D01101B3 0024 + 8103BFE2 0000 + +crc 2857674D-CC4337DA-C:45 +gn Nightmare Creatures (U) + cn Infinite\Ammo + 50000D02 0000 + 800A4BAF 0009 + cn Infinite\Spider Cards + 810A4BAE 0009 + cn Infinite\Proximity Mines + 810A4BB0 0009 + cn Infinite\Repulsive Smoke + 810A4BB2 0009 + cn Infinite\Freeze Spell + 810A4BB4 0009 + cn Infinite\Dynamite + 810A4BB6 0009 + cn Infinite\Flash + 810A4BB8 0009 + cn Infinite\Fire Bombs + 810A4BBA 0009 + cn Infinite\Multi-Gun + 810A4BBC 0009 + cn Infinite\Berzerkers + 810A4BBE 0009 + cn Infinite\Super Healing + 810A4BC0 0009 + cn Infinite\Healing + 810A4BC2 0009 + cn Infinite\Chaos + 810A4BC4 0009 + cn Infinite\Gun + 810A4BC6 0009 + cn Infinite\Lives + 800A4B53 0009 + cn Level Select + D00978B1 0000 + 810978B0 ???? 0000:"Chelsea",0001:"Spitafields",0002:"Thames Tunnel",0003:"Sewer Snake",0004:"India Docks",0005:"Highgate Cemetery",0006:"Hampstead Heath",0007:"Queenhite Docks",0008:"City",0009:"Smithfield",000A:"Snowman",000B:"Regent's",000C:"London Zoo",000D:"St. Marilebone",000E:"Bloomsbury",000F:"Pimlico",0010:"Jose Manuel",0011:"Westminister",0012:"Westminister II",0013:"The Roofs",0014:"Map" + cn Brightness Modifier + 810B96EC ???? 7FFF:"Very Well Lit Up",8000:"Very Dark" + cn Ignatius\Infinite Health\Chelsea Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 802EC6E6 0010 + cn Ignatius\Infinite Health\Spitafields Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 803215FE 0010 + cn Ignatius\Infinite Health\Thames Tunnel Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 8031AB6E 0010 + cn Ignatius\Infinite Health\Sewer Snake Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 80255E46 0010 + cn Ignatius\Infinite Health\India Docks Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 80321546 0010 + cn Ignatius\Infinite Health\Highgate Cemetery Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 8031B2E6 0010 + cn Ignatius\Infinite Health\Hampstead Heath Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 803218B6 0010 + cn Ignatius\Infinite Health\Queenhite Docks Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 80320C1E 0010 + cn Ignatius\Infinite Health\City Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 80328256 0010 + cn Ignatius\Infinite Health\Smithfield Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 8030B05E 0010 + cn Ignatius\Infinite Health\Snowman Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 80251496 0010 + cn Ignatius\Infinite Health\Regent's Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 80315326 0010 + cn Ignatius\Infinite Health\London Zoo Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 8031E00E 0010 + cn Ignatius\Infinite Health\St. Marilebone Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 8031CD4E 0010 + cn Ignatius\Infinite Health\Bloomsbury Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 8032C4F6 0010 + cn Ignatius\Infinite Health\Pimlico Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 8031F9CE 0010 + cn Ignatius\Infinite Health\Jose Manuel Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 8025F196 0010 + cn Ignatius\Infinite Health\Westminister Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 802F4ECE 0010 + cn Ignatius\Infinite Health\Westminister II Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 802F5DE6 0010 + cn Ignatius\Infinite Health\The Roofs Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 802848FE 0010 + cn Nadia\Infinite Health\Chelsea Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 802EB6D6 000C + cn Nadia\Infinite Health\Spitafield Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 80320116 000C + cn Nadia\Infinite Health\Thames Tunnel Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 80319AC6 000C + cn Nadia\Infinite Health\Sewer Snake Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 80254926 000C + cn Nadia\Infinite Health\India Docks Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 803202CE 000C + cn Nadia\Infinite Health\Highgate Cemetary Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 8031A58E 000C + cn Nadia\Infinite Health\Hampstead Heath Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 803203D6 000C + cn Nadia\Infinite Health\Queenhite Dock's Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 8031FB7E 000C + cn Nadia\Infinite Health\City Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 80326A36 000C + cn Nadia\Infinite Health\Smithfield Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 8030A0CE 000C + cn Nadia\Infinite Health\Snowman Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 80250036 000C + cn Nadia\Infinite Health\Regent's Canal Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 80313E36 000C + cn Nadia\Infinite Health\London Zoo Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 8031CB66 000C + cn Nadia\Infinite Health\St. Marilebone Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 8031B686 000C + cn Nadia\Infinite Health\Bloomsbury Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 8032B256 000C + cn Nadia\Infinite Health\Pimlico Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 8031E4B6 000C + cn Nadia\Infinite Health\Jose Manuel Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 8025DA0E 000C + cn Nadia\Infinite Health\Westminister Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 802F360E 000C + cn Nadia\Infinite Health\Westminister II Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 802F4C76 000C + cn Nadia\Infinite Health\The Roofs Level + cd Only use one Infinite Health cheat at a time or the game will freeze or suffer from sever GFX Errors. + 80282DB6 000C + +crc 4998DDBB-F7B7AEBC-C:45 +gn Nuclear Strike 64 (U) + cn Infinite\Lives + 800A5DF0 0009 + cn Play Mission\1 + 800A5DF1 0000 + cn Play Mission\2 + 800A5DF1 0001 + cn Play Mission\3 + 800A5DF1 0002 + cn Play Mission\4 + 800A5DF1 0003 + cn Play Mission\5 + 800A5DF1 0004 + cn Play Mission\6 + 800A5DF1 0005 + cn Invulnerability + 800A9730 0001 + cn Infinite\Lives + 800A5DF0 0009 + cn Infinite\Ammo + 800A9731 0001 + cn Infinite\Attempts + 800A9732 0001 + cn Infinite\Fuel + 800A9733 0001 + cn Infinite\Chaingun + 800A9737 0001 + cn Infinite\Rockets + 800A9738 0001 + cn Infinite\Missiles + 800A9739 0001 + cn Infinite\Wingtips + 800A973A 0001 + cn Wingtips Do Double Damage + 800A973B 0001 + cn Stealth Mode + 800A9734 0001 + cn Double MPG + 800A9735 0001 + cn Quad Damage + 800A9736 0001 + cn Max Armor Increased 50% + 800A973C 0001 + cn Agility + 800A973D 0001 + cn Overhead View + 800A973E 0001 + cn Level Skip + 800A973F 0001 + cn Debug Menu + 800A9740 0001 + cn Auto Win Scenario + 800A9741 0001 + +crc 2655BB70-667D9925-C:45 +gn O.D.T (Or Die Trying) (U) (M3) (Unreleased Final) + cn Play As Select + 800FCD45 ???? 0000:"Ike Hawkings (Corporal)",0001:"Sophia Hawkings (Stowaway)",0002:"Julia Chase (Cartographer)",0003:"Karma (The Ex-Deviant)",0004:"Max Havok (Chief Enginer)",0005:"Solaar (Archbishop)",0006:"Mr Bodybolt (7th Passenger)" + cn Infinite Max\999 Lives + 810C8B78 03E8 + cn Infinite Max\Health + 800C8959 0066 + cn Infinite Max\Light Ammo + 800C8B2B 0066 + cn Infinite Max\Fire Ammo + 800C8B33 0066 + cn Infinite Max\Ionic Ammo + 800C8B3B 0066 + cn Infinite Max\Fusion Ammo + 800C8B43 0066 + cn Infinite Max\Mana + 800C8B7F 0066 + cn Have\All Magic + 800CE9C8 0010 + 800CE9CD 0000 + 800CE9D7 0001 + 800CE9E1 0002 + 800CE9EB 0003 + 800CE9F5 0005 + 800CE9FF 0006 + 800CEA09 0008 + 800CEA13 0009 + 800CEA1D 000B + 800CEA27 000E + 800CEA31 000F + 800CEA3B 0010 + 800CEA45 0011 + 800CEA4F 000A + 800CEA59 000C + 800CEA63 000D + cn Have\Magic On Level 4 + 810C8B5D FFFF + 810C8B5E FFFF + 810C8B5F FFFF + 810C8B60 FFFF + 810C8B61 FFFF + 810C8B62 FFFF + cn Have\Weapons On Max Upgrade + 50000408 0000 + 800C8B2C 0009 + cn Have\Max Armour Level + 800C8B80 0064 + cn Have\Max Spirit Level + 800C8B84 0064 + cn Have\Max Weapon Level + 800C8B82 0064 + cn Have\Max Experience Level + 800C8B7C 00FF + cn Infinite Air Under Water + 800C8A64 0069 + cn Press A For Bionic Jump + cd This will make you jump to a great height + D00C8A4A 0080 + 810C8968 ???? 0250:"Medium Jump",0800:"Max Jump" + cn Matts + D00C8A4A 0080 + 810C8963 0100 + +crc 319093EC-0FC209EF-C:45 +gn Off Road Challenge (U) + cn 1 Player\Always Place 1st + 80103C57 0000 + cn Multi and 1 Player\Infinite Gent Turbos\Player 1 + cd Can be used in 1 Player and Multiplayer Modes for Player 1 + 81103EBA 02F4 + cn 1 Player\Max\Acceleration + 8012C49F 000A + cn 1 Player\Max\Shocks + 8012C4A7 000A + cn 1 Player\Max\Speed + 8012C4A3 000A + cn 1 Player\Max\Tires + 8012C4AB 000A + cn Multi and 1 Player\Max Crash Helmets\Player 1 + cd Can be used in 1 Player and Multiplayer Modes for Player 1 + 80103EB3 0064 + cn Multi and 1 Player\Infinite Gent Turbos\Player 2 + cd Multiplayer Mode Only for Player 2 + 811041AE 02F4 + cn Multi and 1 Player\Max Crash Helmets\Player 2 + cd Multiplayer Mode Only for Player 2 + 801041A7 0064 + +crc E6419BC5-69011DE3-C:45 +gn Ogre Battle 64 - Person of Lordly Caliber (U) + cn Infinite Goth + 81196A6E FFFF + cn Max Goth + 81196A6C 0098 + 81196A6E 967F + cn Open All Paths + 81196A80 01FF + 81196A82 677F + 81196A84 FCFF + cn Finish All Levels + 81196A86 5454 + 81196A88 5140 + 81196A8A 4555 + 81196A8C 9514 + 81196A8E 5515 + cn Always Have Retreat & Elem Pedra Opened + D01A1C72 0000 + 811A1C72 0003 + cn Hour Always 00 + 81196A2C 0000 + cn Day Always 00 + 811F106C 0000 + cn Magnus\Level 99 + 80193C0B 0063 + cn Magnus\Max HP + 81193C0E 03E7 + cn Magnus\Infinite HP + 81193C10 03E7 + cn Magnus\Max Str + 81193C14 03E7 + cn Magnus\Max Vit + 81193C16 03E7 + cn Magnus\Max Int + 81193C18 03E7 + cn Magnus\Max Mem + 81193C1A 03E7 + cn Magnus\Max Agi + 81193C1C 03E7 + cn Magnus\Max Dex + 81193C1E 03E7 + +crc 3E198D9E-F2E1267E-C:45 +gn Paperboy (U) + cn Enable Level Select + cd Also accesses All Bonus Levels + 8006A5F7 0001 + cn Invincibility + 812688FE 0001 + cn Infinite Newspapers + 81268B12 0001 + cn Big Newspapers + 81268B5A 0001 + cn Turbo Mode + 81268B36 0001 + cn Super Jump Springs + 81268B3A 0001 + cn Rocket Boosters + 81268B3E 0001 + cn 99 Total Houses + 8106A56A 0063 + cn Infinite Health + 8006A5D2 0064 + +crc 65EEE53A-ED7D733C-C:45 +gn Paper Mario (U) + cn Lots Of Coins + 8110F29C 03E7 + cn Infinite\HP + 8010F292 0063 + 8010F293 0063 + cn Infinite\FP + 8010F295 0063 + 8010F296 0063 + cn Have All Spirits + 8010F51E 0007 + cn Max\Level + 8010F299 0063 + cn Max\Star Points + 8010F2A0 0063 + cn Max\Badge Points + 8010F298 ???? 003C:"60 Badge Points",007F:"127 Badge Points" + cn Max\Star Pieces + 8010F29F 0063 + cn Have member\Goomario + 8010F2AC 0001 + cn Have member\Kooper + 8010F2B4 0001 + cn Have member\Bombette + 8010F2BC 0001 + cn Have member\Parrakary + 8010F2C4 0001 + cn Have member\Watt + 8010F2D4 0001 + cn Have member\Sushie + 8010F2DC 0001 + cn Have member\Lakitu + 8010F2E4 0001 + cn Have member\Bow + 8010F2EC 0001 + cn Upgrade member\Level 1\Goomario + cd Do not use with level 2 upgrade cheats + 8010F2AD 0001 + cn Upgrade member\Level 1\Kooper + cd Do not use with level 2 upgrade cheats + 8010F2B5 0001 + cn Upgrade member\Level 1\Bombette + cd Do not use with level 2 upgrade cheats + 8010F2BD 0001 + cn Upgrade member\Level 1\Parrakary + cd Do not use with level 2 upgrade cheats + 8010F2C5 0001 + cn Upgrade member\Level 1\Watt + cd Do not use with level 2 upgrade cheats + 8010F2D5 0001 + cn Upgrade member\Level 1\Sushie + cd Do not use with level 2 upgrade cheats + 8010F2DD 0001 + cn Upgrade member\Level 1\Lakitu + cd Do not use with level 2 upgrade cheats + 8010F2E5 0001 + cn Upgrade member\Level 1\Bow + cd Do not use with level 2 upgrade cheats + 8010F2ED 0001 + cn Upgrade member\Level 2\Goomario + cd Do not use with level 1 upgrade cheats + 8010F2AD 0002 + cn Upgrade member\Level 2\Kooper + cd Do not use with level 1 upgrade cheats + 8010F2B5 0002 + cn Upgrade member\Level 2\Bombette + cd Do not use with level 1 upgrade cheats + 8010F2BD 0002 + cn Upgrade member\Level 2\Parrakary + cd Do not use with level 1 upgrade cheats + 8010F2C5 0002 + cn Upgrade member\Level 2\Watt + cd Do not use with level 1 upgrade cheats + 8010F2D5 0002 + cn Upgrade member\Level 2\Sushie + cd Do not use with level 1 upgrade cheats + 8010F2DD 0002 + cn Upgrade member\Level 2\Lakitu + cd Do not use with level 1 upgrade cheats + 8010F2E5 0002 + cn Upgrade member\Level 2\Bow + cd Do not use with level 1 upgrade cheats + 8010F2ED 0002 + cn Have hammer\Level 1 + cd Do not use with other level hammer cheats + 8010F291 0000 + cn Have hammer\Level 2 + cd Do not use with other level hammer cheats + 8010F291 0001 + cn Have hammer\Level 3 + cd Do not use with other level hammer cheats + 8010F291 0002 + cn Have jump boots\Level 1 + cd Do not use with other level jump boots cheats + 8010F290 0000 + cn Have jump boots\Level 2 + cd Do not use with other level jump boots cheats + 8010F290 0001 + cn Have jump boots\Level 3 + cd Do not use with other level jump boots cheats + 8010F290 0002 + cn No Star Points (0) + cd If emulator hangs at level up, enable this cheat and don't disable it whatsoever! + 8010F2A0 0000 + cn Infinite\Star Power + 8010F520 0007 + 8010F521 0007 + cn Have\Attack item + cd Only use One Have item Option at one time. + 8110F444 ???? 0800:"Fire Flower",0081:"Snowman Doll",0082:"Thunder Rage",0083:"Shooting Star",0084:"Thunder Bolt",0085:"Pebble",0086:"Dusty Hammer" + cn Have\Defense item + cd Only use One Have item Option at one time. + 8110F444 ???? 0088:"Stone Cap",008A:"Mushroom",008B:"Volt Shroom",0097:"Repel Gel" + cn Have\Enemy Stats item + cd Only use One Have item Option at one time. + 8110F444 ???? 008F:"Sleep Sheep",0090:"POW Block",0092:"Stop Watch",0098:"Fright Jar",009A:"Dizzy Dial" + cn Have\Recovery Items Option 1 + cd Only use One Have item Option at one time. + 8110F444 ???? 0094:"Apple",00B1:"Apple Pie",00C0:"Big Cookie",00BD:"Bland Meal",009E:"Blue Berry",00D8:"Boiled Egg",00A1:"Bubble Berry",00AA:"Cake Mix",00AA:"Cake Mix",00CF:"Coco Pop",00BE:"Deluxe Feast",00A8:"Dried Fruit",00A7:"Dried Pasta",008D:"Dried Shroom",005F:"Egg",00CC:"Electro Pop",00CD:"Fire Pop",00C9:"Fried Egg",00B6:"Fried Shroom",00D4:"Frozen Fries",00A5:"Goomnut",00BC:"Healthy Juice",00CB:"Honey Candy",00CA:"Honey Shroom",00C4:"Honey Super" + cn Have\Recovery Items Option 2 + cd Only use One Have item Option at one time. + 8110F444 ???? 00A4:"Honey Syrup",00B2:"Honey Ultra",00B9:"Hot Shroom",00AF:"Iced Potato",00A2:"Jammin' Jelly",00D1:"Jelly Pop",00DA:"Jelly Shroom",00C6:"Jelly Super",00B4:"Jelly Ultra",00D3:"Kooky Cookie",00A6:"Koopa Leaf",00C3:"Koopa Tea",00B5:"KooPasta",009C:"Lemon",00D0:"Lemon Candy",0095:"Life Shroom",009D:"Lime",0C0E:"Lime Candy",00D7:"Maple Shroom",00C5:"Maple Super",00A3:"Maple Syrup",00B3:"Maple Ultra",00AD:"Melon",00C2:"Mistake",008A:"Mushroom" + cn Have\Recovery Items Option 3 + cd Only use One Have item Option at one time. + 8110F444 ???? 00D6:"Nutty Cake",00D5:"Potato Salad",009F:"Red Berry",00B7:"Shroom Cake",00B8:"Shroom Steak",00C7:"Spaghetti",00BF:"Special Shake",00B0:"Spicy Soup",00AE:"Stinky Herb",00A9:"Strange Leaf",008C:"Super Shroom",009B:"Super Soda",00BA:"Sweet Shroom",0089:"Tasty Tonic",008E:"Ultra Shroom",0093:"Whacka's Bump",00A0:"Yellow Berry",00D9:"Yoshi Cookie",00BB:"Yummy Meal" + cn Have\Special Items Options 1 + cd Only use One Have item Option at one time + 8110F444 ???? 0101:"Jump",010E:"Diploma",010F:"Ultra Stone",0110:"Fortress Key",0115:"Lunar Stone",0118:"Golden Jar",0119:"Kooper's Shell",0122:"Record",0125:"Mystery Note",012A:"Jade Raven",012C:"Magical Seed Purple",012D:"Magical Seed Blue",0131:"Bucket",0150:"Letter",0156:"Dolly",0157:"Water Stone",0158:"Magical Bean",0159:"Fertile Soil",015A:"Miracle Water",015B:"Volcano Vase",0053:"Artifact",0067:"Lyrics",001D:"Boo's Portrait" + cn Have\Special Items Option 1 + cd Only use One Have item Option at one time. + 8110F444 ???? 0030:"Calculator",0029:"Cook Book",001E:"Crystal Berry",0017:"Diamond Stone",0024:"Dictonary",000E:"Diploma",0032:"Scarf",000A:"First Degree Card",000B:"Second Degree Card",000C:"Third Degree Card",000D:"Fourth Degree Card",0023:"Frying Pan",0004:"Hammer",002A:"Jade Raven",0019:"Kooper's Shell,Lunar Stone",0058:"Magical Bean",002B:"Magical Seed Red",002D:"Magical Seed Green",002E:"Magical Seed Brown-Orange",0069:"Mailbag",0031:"Bucket",0021:"Toy Train",0068:"Melody",006C:"Star Stone",005B:"Volcano Vase" + +crc 73ABB1FB-9CCA6093-C:45 +gn Penny Racers (U) + cn Super Speed + cd This is Turbo fast,So to slow it down a little more keep the B button pressed down + 8122AEB8 4800 + cn Always 1st + 8022AD06 0001 + cn Class Select + cd This code is useful because you can play Class AA without having to beat a level! + 8021E1A7 ???? 0000:"Class C",0001:"Class B",0003:"Class AA",0004:"1 Play",0005:"2 Play",0006:"3 Play",0007:"4 Play" + +crc DDF460CC-3CA634C0-C:45 +gn Perfect Dark (U) (v1.0) + cn Have All\Weapons\Player 1 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 80207F10 0007 + 801EEF10 0007 + 801D5F10 0007 + cn Infinite\Ammo\Player 1 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 8020769F 00FF + 801EE69F 00FF + 801D569F 00FF + 80206EFB 00FF + 801EDEFB 00FF + 801D4EFB 00FF + cn Infinite\Health\Player 1 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 8120677C 3F80 + 811ED77C 3F80 + 811D477C 3F80 + cn Infinite\Shield\Player 1 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 81206790 3F80 + 811E4950 3F80 + 811CB950 3F80 + cn Have All\Weapons\Player 2 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 80209B80 0007 + 801F0B80 0007 + 801D7B80 0007 + cn Infinite\Ammo\Player 2 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 8020930F 00FF + 801F030F 00FF + 801D730F 00FF + 80208B6B 00FF + 801EFB6B 00FF + 801D6B6B 00FF + cn Infinite\Health\Player 2 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 812083EC 3F80 + 811EF3EC 3F80 + 811D63EC 3F80 + cn Infinite\Shield\Player 2 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 811FF5C0 3F80 + 811E65C0 3F80 + 811CD5C0 3F80 + cn The Ultimate All In One + cd The Ultimate All In One activate's solo missions, give all medals on solo missions, activate cheats, activate cinemas, and who knows what else. I just don't have the time to identify these codes. I know that some of this is creditted to Zap2. I don't have the time to cut those codes out. + 800884F3 0001 + 8008850E 0001 + 80088575 0001 + 50000302 0000 + 80088572 0001 + 8008858C 0001 + 8008858D 0001 + 800885A6 0001 + 800885A9 0001 + 800885C0 0001 + 800885DA 0001 + 800885DC 0001 + 800885F4 0001 + 800885F5 0001 + 8008860E 0001 + 80088610 0001 + 80088612 0001 + 80088628 0001 + 50000501 0000 + 80088642 0001 + 50000501 0000 + 8008865C 0001 + 50000501 0000 + 80088676 0001 + 50000501 0000 + 80088690 0001 + 50000501 0000 + 800886AA 0001 + 50000501 0000 + 800886C4 0001 + 50000501 0000 + 800886DE 0001 + 50000501 0000 + 800886F8 0001 + 50000501 0000 + 80088712 0001 + 50000501 0000 + 8008872C 0001 + 50000501 0000 + 80088746 0001 + 50000501 0000 + 80088760 0001 + 50000501 0000 + 8008877A 0001 + 50000501 0000 + 80088794 0001 + 50000501 0000 + 800887AE 0001 + 800A2219 0001 + 50003E02 0000 + 800A221D 0001 + 50000B01 0000 + 800ACCC9 0001 + 50000901 0000 + 800ACCD5 0001 + 50000401 0000 + 800ACCDF 0001 + 50000301 0000 + 800ACCE4 0001 + 800ACCE8 0001 + 800ACCE9 0001 + 800ACCEB 0001 + 800ACCEC 0001 + 50000901 0000 + 800ACCEE 0001 + 800ACCF8 0001 + 50002101 0000 + 800ACCFA 0001 + 800ACD12 0001 + 800ACD15 0001 + 800ACD16 0001 + 800ACDEA 0001 + 800ACD3A 0001 + cn Carrington Institute\Have 999 points in Firing Range + 810B1E32 03E7 + cn Carrington Institute\Have Infinite time in Firing Range + 810B1E2E 004D + cn Carrington Institute\Have 255 targets destroyed + 810B1E34 00FF + cn All levels Compleate + 50004002 0000 + 810A2218 0001 + cn Single & Co-Op\Press B To Levitate\Player 1 + cd To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something + D009C7E4 0040 + 81206720 40F2 + D009C7E4 0040 + 802066D3 0000 + D009C7E4 0040 + 811ED720 40F2 + D009C7E4 0040 + 801ED6D3 0000 + D009C7E4 0040 + 811D4720 40F2 + D009C7E4 0040 + 801D46D3 0000 + cn Single & Co-Op\Press B To Levitate\Player 2 + cd To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something + D009C7EC 0040 + 81208390 40F2 + D009C7EC 0040 + 80208343 0000 + D009C7EC 0040 + 811EF390 40F2 + D009C7EC 0040 + 801EF343 0000 + D009C7EC 0040 + 811D6390 40F2 + D009C7EC 0040 + 801D6343 0000 + cn Multi\Press B To Levitate\Player 1 + cd To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something + D009C7E4 0040 + 811BB720 40F2 + D009C7E4 0040 + 801BB6D3 0000 + cn Multi\Press B To Levitate\Player 2 + cd To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something + D009C7EC 0040 + 811BD390 40F2 + D009C7EC 0040 + 801BD343 0000 + cn Multi\Press B To Levitate\Player 3 + cd To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something + D009C7F4 0040 + 811BF000 40F2 + D009C7F4 0040 + 801BEFB3 0000 + cn Multi\Press B To Levitate\Player 4 + cd To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something + D009C7FC 0040 + 811C0C70 40F2 + D009C7FC 0040 + 801C0C23 0000 + +crc 41F2B98F-B458B466-C:45 +gn Perfect Dark (U) (v1.1) + cn Have All\Weapons\Player 1 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 80207F10 0007 + 801EEF10 0007 + 801D5F10 0007 + cn Infinite\Ammo\Player 1 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 8020769F 00FF + 801EE69F 00FF + 801D569F 00FF + 80206EFB 00FF + 801EDEFB 00FF + 801D4EFB 00FF + cn Infinite\Health\Player 1 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 8120677C 3F80 + 811ED77C 3F80 + 811D477C 3F80 + cn Infinite\Shield\Player 1 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 81206790 3F80 + 811E4950 3F80 + 811CB950 3F80 + cn Have All\Weapons\Player 2 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 80209B80 0007 + 801F0B80 0007 + 801D7B80 0007 + cn Infinite\Ammo\Player 2 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 8020930F 00FF + 801F030F 00FF + 801D730F 00FF + 80208B6B 00FF + 801EFB6B 00FF + 801D6B6B 00FF + cn Infinite\Health\Player 2 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 812083EC 3F80 + 811EF3EC 3F80 + 811D63EC 3F80 + cn Infinite\Shield\Player 2 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 811FF5C0 3F80 + 811E65C0 3F80 + 811CD5C0 3F80 + cn The Ultimate All In One + cd The Ultimate All In One activate's solo missions, give all medals on solo missions, activate cheats, activate cinemas, and who knows what else. I just don't have the time to identify these codes. I know that some of this is creditted to Zap2. I don't have the time to cut those codes out. + 800884F3 0001 + 8008850E 0001 + 80088575 0001 + 50000302 0000 + 80088572 0001 + 8008858C 0001 + 8008858D 0001 + 800885A6 0001 + 800885A9 0001 + 800885C0 0001 + 800885DA 0001 + 800885DC 0001 + 800885F4 0001 + 800885F5 0001 + 8008860E 0001 + 80088610 0001 + 80088612 0001 + 80088628 0001 + 50000501 0000 + 80088642 0001 + 50000501 0000 + 8008865C 0001 + 50000501 0000 + 80088676 0001 + 50000501 0000 + 80088690 0001 + 50000501 0000 + 800886AA 0001 + 50000501 0000 + 800886C4 0001 + 50000501 0000 + 800886DE 0001 + 50000501 0000 + 800886F8 0001 + 50000501 0000 + 80088712 0001 + 50000501 0000 + 8008872C 0001 + 50000501 0000 + 80088746 0001 + 50000501 0000 + 80088760 0001 + 50000501 0000 + 8008877A 0001 + 50000501 0000 + 80088794 0001 + 50000501 0000 + 800887AE 0001 + 800A2219 0001 + 50003E02 0000 + 800A221D 0001 + 50000B01 0000 + 800ACCC9 0001 + 50000901 0000 + 800ACCD5 0001 + 50000401 0000 + 800ACCDF 0001 + 50000301 0000 + 800ACCE4 0001 + 800ACCE8 0001 + 800ACCE9 0001 + 800ACCEB 0001 + 800ACCEC 0001 + 50000901 0000 + 800ACCEE 0001 + 800ACCF8 0001 + 50002101 0000 + 800ACCFA 0001 + 800ACD12 0001 + 800ACD15 0001 + 800ACD16 0001 + 800ACDEA 0001 + 800ACD3A 0001 + cn Carrington Institute\Have 999 points in Firing Range + 810B1E32 03E7 + cn Carrington Institute\Have Infinite time in Firing Range + 810B1E2E 004D + cn Carrington Institute\Have 255 targets destroyed + 810B1E34 00FF + cn Single & Co-Op\Press B To Levitate\Player 1 + cd To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something + D009C7E4 0040 + 81206720 40F2 + D009C7E4 0040 + 802066D3 0000 + D009C7E4 0040 + 811ED720 40F2 + D009C7E4 0040 + 801ED6D3 0000 + D009C7E4 0040 + 811D4720 40F2 + D009C7E4 0040 + 801D46D3 0000 + cn Single & Co-Op\Press B To Levitate\Player 2 + cd To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something + D009C7EC 0040 + 81208390 40F2 + D009C7EC 0040 + 80208343 0000 + D009C7EC 0040 + 811EF390 40F2 + D009C7EC 0040 + 801EF343 0000 + D009C7EC 0040 + 811D6390 40F2 + D009C7EC 0040 + 801D6343 0000 + cn Multi\Press B To Levitate\Player 1 + cd To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something + D009C7E4 0040 + 811BB720 40F2 + D009C7E4 0040 + 801BB6D3 0000 + cn Multi\Press B To Levitate\Player 2 + cd To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something + D009C7EC 0040 + 811BD390 40F2 + D009C7EC 0040 + 801BD343 0000 + cn Multi\Press B To Levitate\Player 3 + cd To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something + D009C7F4 0040 + 811BF000 40F2 + D009C7F4 0040 + 801BEFB3 0000 + cn Multi\Press B To Levitate\Player 4 + cd To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something + D009C7FC 0040 + 811C0C70 40F2 + D009C7FC 0040 + 801C0C23 0000 + +crc B54CE881-BCCB6126-C:45 +gn PGA European Tour (U) + cn Hole In One\Hole 01 + 800FF713 0000 + cn Hole In One\Hole 02 + 800FF715 0000 + cn Hole In One\Hole 03 + 800FF717 0000 + cn Hole In One\Hole 04 + 800FF719 0000 + cn Hole In One\Hole 05 + 800FF71B 0000 + cn Hole In One\Hole 06 + 800FF71D 0000 + cn Hole In One\Hole 07 + 800FF71F 0000 + cn Hole In One\Hole 08 + 800FF721 0000 + cn Hole In One\Hole 09 + 800FF723 0000 + cn Hole In One\Hole 10 + 800FF725 0000 + cn Hole In One\Hole 11 + 800FF727 0000 + cn Hole In One\Hole 12 + 800FF729 0000 + cn Hole In One\Hole 13 + 800FF72B 0000 + cn Hole In One\Hole 14 + 800FF72D 0000 + cn Hole In One\Hole 15 + 800FF72F 0000 + cn Hole In One\Hole 16 + 800FF731 0000 + cn Hole In One\Hole 17 + 800FF733 0000 + cn Hole In One\Hole 18 + 800FF735 0000 + +crc C851961C-78FCAAFA-C:45 +gn Pilot Wings64 (U) + cn Infinite Fuel\Gyrocopter + 80362821 0081 + cn Infinite Fuel\Rocket Belt + 80362841 0081 + cn Time Always 00'00'10 + cd This Cheat code is for All Events + 80362750 0001 + cn Choose Vehicle + cd Make your Choice & then Press GS To Activate,But do not use with any other Press GS Cheat Codes. + 883626A7 ???? 0000:"Hang Glider",0001:"Rocket Belt",0002:"Gyrocopter",0003:"Cannonball",0004:"Skydiving",0005:"Jumble Hopper",0006:"Birdman" + cn Fly As Yellow Plane In USA Level + cd Press GS To Activate,But do not use with any other Press GS Cheat Codes. + 89362748 0009 + 813627B0 3EE0 + 8024CDF5 006E + cn Fly As Gray Plane In USA Level + cd Press GS To Activate,But do not use with any other Press GS Cheat Codes. + 89362748 0008 + 813627B0 3F30 + 8024CDF5 006E + cn Have Perfect Score in all Class & Level's + cd With these codes, if you want them to save, you have to play a level, and lose and just choose quit after it tallies up your score. Also dont keep the code active once you save the level at 100%, turn the code off and continue with the other levels! + 8036427D 0064 + 803642AD 0064 + 803642DD 0064 + 80364911 0064 + 80364A61 0064 + 80364941 0064 + 80364A91 0064 + 80364971 0064 + 80364AC1 0064 + 80364FA5 0064 + 803650F5 0064 + 80365245 0064 + 80364FD5 0064 + 80365125 0064 + 80365275 0064 + 80365005 0064 + 80365155 0064 + 803652A5 0064 + 80365639 0064 + 80365789 0064 + 803658D9 0064 + 80365669 0064 + 803657B9 0064 + 80365909 0064 + 80365699 0064 + 803657E9 0064 + 80365939 0064 + 8036430D 0019 + 8036445D 0019 + 803645AD 0019 + 803646FD 0019 + 8036433D 0064 + 8036436D 0064 + 803649A1 0019 + 80364AF1 0019 + 80364C41 0019 + 80364D91 0019 + 803649D1 0064 + 80364A01 0064 + 80365035 0019 + 80365185 0019 + 803652D5 0019 + 80365425 0019 + 80365065 0064 + 80365095 0064 + +crc CA12B547-71FA4EE4-C:45 +gn Pokemon Snap (U) + cn Press L\To Stop On Tunnel Level + cd To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. + D00489E1 0020 + 801DDC55 0001 + cn Press L\To Stop On Volcano Level + cd To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. + D00489E1 0020 + 801FC5C5 0001 + cn Press L\To Stop On River Level + cd To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. + D00489E1 0020 + 801EF96D 0001 + cn Press L\To Stop On Cave Level + cd To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. + D00489E1 0020 + 80202225 0001 + cn Press L\To Stop On Beach Level + cd To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. + D00489E1 0020 + 802020F5 0001 + cn Press L\To Stop On Valley Level + cd To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. + D00489E1 0020 + 801D9ABD 0001 + cn Have\Rapid Fire Apples and Bombs + 80382CB7 0000 + cn Have\Apples Bombs and Flute + 803AE51F 0004 + cn Have\Apple & Bomb + 803AE51F 0002 + cn Have\Apple + 803AE51F 0001 + cn [Enable All Levels] + 810C2212 0006 + cn Hide First Digit In Roll Of Film + 80388F5A 009D + cn See Entire Introduction Fully & Various In-Game Effects + 81049C7E 025A + +crc 39119872-07722E9F-C:45 +gn Pokemon Snap Station (U) + cn Press L\To Stop On Tunnel Level + cd To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. + D00489E1 0020 + 801DDC55 0001 + cn Press L\To Stop On Volcano Level + cd To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. + D00489E1 0020 + 801FC5C5 0001 + cn Press L\To Stop On River Level + cd To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. + D00489E1 0020 + 801EF96D 0001 + cn Press L\To Stop On Cave Level + cd To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. + D00489E1 0020 + 80202225 0001 + cn Press L\To Stop On Beach Level + cd To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. + D00489E1 0020 + 802020F5 0001 + cn Press L\To Stop On Valley Level + cd To Activated thos Cheat Code, Press L To Stop & Press Start to Continue Again. + D00489E1 0020 + 801D9ABD 0001 + cn Have\Rapid Fire Apples and Bombs + 80382CB7 0000 + cn Have\Apples Bombs and Flute + 803AE51F 0004 + cn Have\Apple & Bomb + 803AE51F 0002 + cn Have\Apple + 803AE51F 0001 + cn [Enable All Levels] + cd This is needed to be able to Play all Levels of the Game + 810C2212 0006 + cn Hide First Digit In Roll Of Film + 80388F5A 009D + cn See Entire Introduction Fully & Various In-Game Effects + 81049C7E 025A + +crc 90F5D9B3-9D0EDCF0-C:45 +gn Pokemon Stadium (U) + cn Pokemon\Max HP\Player 1 + 810AE586 03E7 + 810AE5DA 03E7 + 810AE62E 03E7 + cn Pokemon\Max HP\Player 2 + 810AE7A2 03E7 + 810AE7F6 03E7 + 810AE84A 03E7 + cn Pokemon\Inf Spells\Player 1 + 810AE580 FFFF + 810AE582 FFFF + 810AE5D4 FFFF + 810AE5D6 FFFF + 810AE628 FFFF + 810AE62A FFFF + cn Pokemon\Inf Spells\Player 2 + 810AE79C FFFF + 810AE79E FFFF + 810AE7F0 FFFF + 810AE7F2 FFFF + 810AE844 FFFF + 810AE846 FFFF + cn Have All Pikachus Magnemites + 801183BC 0000 + 801183BD 0000 + 801183BE 0000 + cn Inf HP\In Battle All Pokemon\Player 1 + 81285A18 03E7 + cn Inf HP\In Battle All Pokemon\Player 2 + 81286438 03E7 + cn Ultimate Code + cd what's so ultimate about this code is it raises your Pokemon to its full potential. Even at Level 100, most Pokemon still have a way to go to raise their stats to the max. But with this code, you can instantly boost any Pokemon to its greatest potential!!! + 81171F3C FF01 + 81171F3E FF01 + 81171F40 FF01 + 81171F42 FF01 + 81171F44 FF01 + +crc 03571182-892FD06D-C:45 +gn Pokemon Stadium 2 (U) + cn One Hit KO + cd To Win you must get at least one hit or just return your pokemon. + 8014576F 0000 + 801457C7 0000 + 8014581F 0000 + cn Press R To Reset Time + cd Press R To Reset Time + 801CE066 0010 + 81183ACC 0063 + cn Max Score + D117F812 03E7 + 8117F812 03E7 + cn Press R+L to KO Opponents + cd Press R+L Activate + D10CE066 0030 + 80145767 0000 + D10CE066 0030 + 801457C7 0000 + D10CE066 0030 + 8014576F 0000 + D10CE066 0030 + 8014581F 0000 + cn Infinite\Continues + 8114738C 0009 + cn Instant\Win\Topsy Turvy\Player 1 + 80176887 0005 + cn Instant\Win\Barrier Ball\Player 1 + 8016EA97 0005 + cn Instant\Win\Pichu's Power Plant\Player 1 + 8016D64F 0050 + cn Infinite\Dirt Rollout Rampage\Player 1 + 8017DFEB 0002 + cn Press Z\for Max HP\1st Pokemon + cd This will give them Max HP when they are not in use. Just call a Pokemon out and he will then have Max HP. When your Pokemon faints, just press Z again and it will revive itIn Battle Only,Do not use with anyother Press Z Cheat Code. + D112B554 2000 + 8114528E 00FF + D112B554 2000 + 81145290 00FF + cn Press Z\for Max L.\1st Pokemon\Player 1 + cd Do not use with anyother Press Z Cheat Code. + D112B554 2000 + 81145284 0063 + cn Press Z\for Max HP\2nd Pokemon\Player 1 + cd This will give them Max HP when they are not in use. Just call a Pokemon out and he will then have Max HP. When your Pokemon faints, just press Z again and it will revive itIn Battle Only,Do not use with anyother Press Z Cheat Code. + D112B554 2000 + 811452E6 00FF + D112B554 2000 + 811452E8 00FF + cn Press Z\for Max L.\2nd Pokemon\Player 1 + cd Do not use with anyother Press Z Cheat Code. + D112B554 2000 + 811452DC 0063 + cn Press Z\for Max HP\3rd Pokemon\Player 1 + cd This will give them Max HP when they are not in use. Just call a Pokemon out and he will then have Max HP. When your Pokemon faints, just press Z again and it will revive itIn Battle Only,Do not use with anyother Press Z Cheat Code. + D112B554 2000 + 8114533E 00FF + D112B554 2000 + 81145340 00FF + cn Press Z\for Max L.\3rd Pokemon\Player 1 + cd Do not use with anyother Press Z Cheat Code. + D112B554 2000 + 81145334 0063 + +crc CF8957AD-96D57EA9-C:45 +gn Power Rangers - Lightspeed Rescue (U) + cn Unlock All\Characters + 50000C01 0000 + 8006252D 0001 + cn Infinite\Health + cd For Overhead & Driving Levels + 81064DF0 42C8 + cn Unlock All\Levels + 50000301 0000 + 80062508 0001 + 50000801 0000 + 8006250C 0001 + 50000801 0000 + 80062516 0001 + 50000A01 0000 + 8006251F 0001 + +crc FC74D475-9A0278AB-C:45 +gn Powerpuff Girls, The - Chemical X-traction (U) + cn 1 Win Needed\Player 1 + D00BAD0F 0000 + 800BAD0F 0001 + cn Infinite Health\Player 1 + 810BACDC 42C8 + cn Max Chemical X\Player 1 + 800BAD28 0003 + cn Never Win\Player 1 + 800BAD0F 0000 + cn No Chemical X\Player 1 + 800BAD28 0000 + cn No Health\Player 1 + 810BACDC 0000 + cn 1 Win Needed\Player 2 + D00BB04F 0000 + 800BB04F 0001 + cn Infinite Health\Player 2 + 810BB01C 42C8 + cn Max Chemical X\Player 2 + 800BB068 0003 + cn Never Win\Player 2 + 800BB04F 0000 + cn No Chemical X\Player 2 + 800BB068 0000 + cn No Health\Player 2 + 810BB01C 0000 + cn Infinite Time + 810E69AC 42F0 + +crc 9F5BF79C-D2FE08A0-C:45 +gn Quake + cn Infinite\Ammo + 50000402 0000 + 80163A2D 0064 + 50000402 0000 + 81163A2C 03E7 + cn Have\All Weapons + 801639EB 007F + cn Debug Mode + 8006C4C2 0001 + cn Have\All Keys + 801639E9 000F + cn Infinite\Armor + 81163944 42C8 + cn Infinite\Health + 81163930 42C8 + cn Infinite\Bio Suit + 81163980 42C8 + cn Have\Quad Damage + 8116397C 42C8 + cn Have\Ring of Shadows + 811639E8 ???? 42C8:"On",0000:"Off" + cn Rapid Fire + D00CA9E0 0020 + 8016396D 0001 + cn Multi\Infinite Health\Player 1 + 81166290 42C8 + cn Multi\Infinite Armor\Player 1 + 811662A4 42C8 + cn Multi\Infinite Bio Suit\Player 1 + 811662E0 42C8 + cn Multi\Have All Weapons\Player 1 + 8016634B 007F + cn Multi\Infinite Ammo\Player 1 + 50000402 0000 + 8116638C 03E7 + cn Multi\Infinite Health\Player 2 + 81166560 42C8 + cn Multi\Infinite Armor\Player 2 + 81166574 42C8 + cn Multi\Infinite Bio Suit\Player 2 + 811665B0 42C8 + cn Multi\Have All Weapons\Player 2 + 8016661B 007F + cn Multi\Infinite Ammo\Player 2 + 50000402 0000 + 8116665C 03E7 + +crc BDA8F143-B1AF2D62-C:45 +gn QUAKE II + cn The Ultimate + cd The Ultimate Gives you on Solo Play Infinite Health, Infinite Armor, All Guns, and Infinite Ammo On all Levels + 8104AD2C 0800 + 8104AD2E 0018 + 81000060 8E30 + 81000062 0068 + 81000064 241B + 81000066 03E7 + 81000068 AE1B + 8100006A 0030 + 8100006C AC9B + 8100006E 0204 + 81000070 A219 + 81000072 004B + 81000074 A219 + 81000076 004C + 81000078 1000 + 8100007A 0005 + 8100007C A219 + 8100007E 0050 + 50000604 0000 + 81000090 A219 + 50000604 0004 + 81000092 0054 + 50000504 0000 + 810000A8 AE1B + 50000504 0004 + 810000AA 006C + 810000BC 0801 + 810000BE 2B4D + 810000C0 AE1B + 810000C2 0080 + cn Multi\Agony\Have\All Weapons\Player 1 + 801832B7 0001 + 801832BB 0001 + 801832BF 0001 + 801832C3 0001 + 801832C7 0001 + 801832CB 0001 + 801832CF 0001 + 801832D3 0001 + 801832D7 0001 + 801832DB 0001 + cn Multi\Agony\Infinite\Ammo\Player 1 + 801832DF 0063 + 801832E3 0063 + 801832E7 0063 + 801832EB 0063 + 801832EF 0063 + 801832F3 0063 + cn Multi\Agony\Have\All Weapons\Player 2 + 8018361B 0001 + 8018361F 0001 + 80183623 0001 + 80183627 0001 + 8018362B 0001 + 8018362F 0001 + 80183633 0001 + 80183637 0001 + 8018363B 0001 + 8018363F 0001 + cn Multi\Agony\Infinite\Ammo\Player 2 + 80183643 0063 + 80183647 0063 + 8018364B 0063 + 8018364F 0063 + 80183653 0063 + 80183657 0063 + cn Multi\Cold Steel\Have\All Weapons\Player 1 + 8017B577 0001 + 8017B57B 0001 + 8017B57F 0001 + 8017B583 0001 + 8017B587 0001 + 8017B58B 0001 + 8017B58F 0001 + 8017B593 0001 + 8017B597 0001 + 8017B59B 0001 + cn Multi\Cold Steel\Infinite\Ammo\Player 1 + 8017B59F 0063 + 8017B5A3 0063 + 8017B5A7 0063 + 8017B5AB 0063 + 8017B5AF 0063 + 8017B5B3 0063 + cn Multi\Cold Steel\Have\All Weapons\Player 2 + 8017B8DB 0001 + 8017B8DF 0001 + 8017B8E3 0001 + 8017B8E7 0001 + 8017B8EB 0001 + 8017B8EF 0001 + 8017B8F3 0001 + 8017B8F7 0001 + 8017B8FB 0001 + 8017B8FF 0001 + cn Multi\Cold Steel\Infinite\Ammo\Player 2 + 8017B903 0063 + 8017B907 0063 + 8017B90B 0063 + 8017B90F 0063 + 8017B913 0063 + 8017B917 0063 + cn Multi\Corridors\Have\All Weapons\Player 1 + 8017D1C7 0001 + 8017D1CB 0001 + 8017D1CF 0001 + 8017D1D3 0001 + 8017D1D7 0001 + 8017D1DB 0001 + 8017D1DF 0001 + 8017D1E3 0001 + 8017D1E7 0001 + 8017D1EB 0001 + cn Multi\Corridors\Infinite\Ammo\Player 1 + 8017D1E7 0063 + 8017D1F3 0063 + 8017D1F7 0063 + 8017D1FB 0063 + 8017D1FF 0063 + 8017D203 0063 + cn Multi\Corridors\Have\All Weapons\Player 2 + 8017D52B 0001 + 8017D52F 0001 + 8017D533 0001 + 8017D537 0001 + 8017D53B 0001 + 8017D53F 0001 + 8017D543 0001 + 8017D547 0001 + 8017D54B 0001 + 8017D54F 0001 + cn Multi\Corridors\Infinite\Ammo\Player 2 + 8017D553 0063 + 8017D557 0063 + 8017D55B 0063 + 8017D55F 0063 + 8017D567 0063 + cn Multi\Dying Halls\Have\All Weapons\Player 1 + 801BF937 0001 + 801BF93B 0001 + 801BF93F 0001 + 801BF943 0001 + 801BF947 0001 + 801BF94B 0001 + 801BF94F 0001 + 801BF953 0001 + 801BF957 0001 + 801BF95B 0001 + cn Multi\Dying Halls\Infinite\Ammo\Player 1 + 801BF95F 0063 + 801BF963 0063 + 801BF967 0063 + 801BF96B 0063 + 801BF96F 0063 + 801BF973 0063 + cn Multi\Dying Halls\Have\All Weapons\Player 2 + 801BFC9B 0001 + 801BFC9F 0001 + 801BFCA3 0001 + 801BFCA7 0001 + 801BFCAB 0001 + 801BFCAF 0001 + 801BFCB3 0001 + 801BFCB7 0001 + 801BFCBB 0001 + 801BFCBF 0001 + cn Multi\Dying Halls\Infinite\Ammo\Player 2 + 801BFCC3 0063 + 801BFCC7 0063 + 801BFCCB 0063 + 801BFCCF 0063 + 801BFCD3 0063 + 801BFCD7 0063 + cn Multi\Empty Space\Have\All Weapons\Player 1 + 80179B27 0001 + 80179B2B 0001 + 80179B2F 0001 + 80179B33 0001 + 80179B37 0001 + 80179B3B 0001 + 80179B3F 0001 + 80179B43 0001 + 80179B47 0001 + 80179B4B 0001 + cn Multi\Empty Space\Infinite\Ammo\Player 1 + 80179B4F 0063 + 80179B53 0063 + 80179B57 0063 + 80179B5B 0063 + 80179B5F 0063 + 80179B63 0063 + cn Multi\Empty Space\Have\All Weapons\Player 2 + 80179E8B 0001 + 80179E8F 0001 + 80179E93 0001 + 80179E97 0001 + 80179E9B 0001 + 80179E9F 0001 + 80179EA3 0001 + 80179EA7 0001 + 80179EAB 0001 + 80179EAF 0001 + cn Multi\Empty Space\Infinite\Ammo\Player 2 + 80179EB3 0063 + 80179EB7 0063 + 80179EBB 0063 + 80179EBF 0063 + 80179EC3 0063 + 80179EC7 0063 + cn Multi\Fortress\Have\All Weapons\Player 1 + 8017D617 0001 + 8017D61B 0001 + 8017D61F 0001 + 8017D623 0001 + 8017D627 0001 + 8017D62B 0001 + 8017D62F 0001 + 8017D633 0001 + 8017D637 0001 + 8017D63B 0001 + cn Multi\Fortress\Infinite\Ammo\Player 1 + 8017D63F 0063 + 8017D643 0063 + 8017D647 0063 + 8017D64B 0063 + 8017D64F 0063 + 8017D653 0063 + cn Multi\Fortress\Have\All Weapons\Player 2 + 8017D97B 0001 + 8017D97F 0001 + 8017D983 0001 + 8017D987 0001 + 8017D98B 0001 + 8017D98F 0001 + 8017D993 0001 + 8017D997 0001 + 8017D99B 0001 + 8017D99F 0001 + cn Multi\Fortress\Infinite\Ammo\Player 2 + 8017D9A3 0063 + 8017D9A7 0063 + 8017D9AB 0063 + 8017D9AF 0063 + 8017D9B3 0063 + 8017D9B7 0063 + cn Multi\Mad Dash\Have\All Weapons\Player 1 + 801AE9A7 0001 + 801AE9AB 0001 + 801AE9AF 0001 + 801AE9B3 0001 + 801AE9B7 0001 + 801AE9BB 0001 + 801AE9BF 0001 + 801AE9C3 0001 + 801AE9C7 0001 + 801AE9CB 0001 + cn Multi\Mad Dash\Infinite\Ammo\Player 1 + 801AE9CF 0063 + 801AE9D3 0063 + 801AE9D7 0063 + 801AE9DB 0063 + 801AE9DF 0063 + 801AE9E3 0063 + cn Multi\Mad Dash\Have\All Weapons\Player 2 + 801AED0B 0001 + 801AED0F 0001 + 801AED13 0001 + 801AED17 0001 + 801AED1B 0001 + 801AED1F 0001 + 801AED23 0001 + 801AED27 0001 + 801AED2B 0001 + 801AED2F 0001 + cn Multi\Mad Dash\Infinite\Ammo\Player 2 + 801AED33 0063 + 801AED37 0063 + 801AED3B 0063 + 801AED3F 0063 + 801AED43 0063 + 801AED47 0063 + cn Multi\Overflow\Have\All Weapons\Player 1 + 80197907 0001 + 8019790B 0001 + 8019790F 0001 + 80197913 0001 + 80197917 0001 + 8019791B 0001 + 8019791F 0001 + 80197923 0001 + 80197927 0001 + 8019792B 0001 + cn Multi\Overflow\Infinite\Ammo\Player 1 + 8019792F 0063 + 80197933 0063 + 80197937 0063 + 8019793B 0063 + 8019793F 0063 + 80197943 0063 + cn Multi\Overflow\Have\All Weapons\Player 2 + 80197C6B 0001 + 80197C6F 0001 + 80197C73 0001 + 80197C77 0001 + 80197C7B 0001 + 80197C7F 0001 + 80197C83 0001 + 80197C87 0001 + 80197C8B 0001 + 80197C8F 0001 + cn Multi\Overflow\Infinite\Ammo\Player 2 + 80197C93 0063 + 80197C97 0063 + 80197C9B 0063 + 80197C9F 0063 + 80197CA3 0063 + 80197CA7 0063 + cn Multi\Twists\Have\All Weapons\Player 1 + 801ABE47 0001 + 801ABE4B 0001 + 801ABE4F 0001 + 801ABE53 0001 + 801ABE57 0001 + 801ABE5B 0001 + 801ABE5F 0001 + 801ABE63 0001 + 801ABE67 0001 + 801ABE6B 0001 + cn Multi\Twists\Infinite\Ammo\Player 1 + 801ABE6F 0063 + 801ABE73 0063 + 801ABE77 0063 + 801ABE7B 0063 + 801ABE7F 0063 + 801ABE83 0063 + cn Multi\Twists\Have\All Weapons\Player 2 + 801AC1AB 0001 + 801AC1AF 0001 + 801AC1B3 0001 + 801AC1B7 0001 + 801AC1BB 0001 + 801AC1BF 0001 + 801AC1C3 0001 + 801AC1C7 0001 + 801AC1CB 0001 + 801AC1CF 0001 + cn Multi\Twists\Infinite\Ammo\Player 2 + 801AC1D3 0063 + 801AC1D7 0063 + 801AC1DB 0063 + 801AC1DF 0063 + 801AC1E3 0063 + 801AC1E7 0063 + cn Multi\War Room\Have\All Weapons\Player 1 + 801A2E57 0001 + 801A2E5B 0001 + 801A2E5F 0001 + 801A2E63 0001 + 801A2E67 0001 + 801A2E6B 0001 + 801A2E6F 0001 + 801A2E73 0001 + 801A2E77 0001 + 801A2E7B 0001 + cn Multi\War Room\Infinite\Ammo\Player 1 + 801A2E7F 0063 + 801A2E83 0063 + 801A2E87 0063 + 801A2E8B 0063 + 801A2E8F 0063 + 801A2E93 0063 + cn Multi\War Room\Have\All Weapons\Player 2 + 801A31BB 0001 + 801A31BF 0001 + 801A31C3 0001 + 801A31C7 0001 + 801A31CB 0001 + 801A31CF 0001 + 801A31D3 0001 + 801A31D7 0001 + 801A31DB 0001 + 801A31DF 0001 + cn Multi\War Room\Infinite\Ammo\Player 2 + 801A31E3 0063 + 801A31E7 0063 + 801A31EB 0063 + 801A31EF 0063 + 801A31F3 0063 + 801A31F7 0063 + +crc C8BB4DD9-CC5F430B-C:45 +gn Quest 64 (U) + cn Have All Elements + 8107BAA4 3232 + 8107BAA6 3232 + cn Infinite Health + 8107BA84 01F4 + 8107BA86 01F4 + cn Infinite Magic Points + 8107BA88 01F4 + 8107BA8A 01F4 + cn Super Agility + 8107BA8E 01F4 + cn Super Defense + 8107BA8C 01F4 + +crc 73A88E3D-3AC5C571-C:45 +gn Rally Challenge 2000 (U) + cn Infinite Time + 81104998 49F2 + cn Arcade Mode\Car Modifier + 802818B3 ???? 0000:"Mitsubishi Lancer Evolution V",0001:"Subaru Impreza WRC",0002:"Toyota Corolla WRC",0003:"Nissan Almera Kit Car",0004:"Seat Cordoba WRC",0005:"Skoda Octavia",0006:"VW Golf GTI MK IV",0007:"Proton WIRA",0008:"Hyundai Coupe EVO 2" + cn Easy Courses\Australia\Have 1st + 80178F87 0000 + cn Easy Courses\Australia\Always Low Lap Timer + 81178F90 0000 + 81178F92 0000 + cn Easy Courses\Spain\Have 1st + 801870D7 0000 + cn Easy Courses\Spain\Always Low Lap Timer + 811870E0 0000 + 811870E2 0000 + cn Easy Courses\Great Britian\Have 1st + 801766A7 0000 + cn Easy Courses\Great Britian\Always Low Lap Timer + 811766B0 0000 + 811766B2 0000 + cn Medium Courses\Italy\Have 1st + 8017E4E7 0000 + cn Medium Courses\Italy\Always Low Lap Timer + 8117E4D0 0000 + 8117E4D2 0000 + cn Medium Courses\Brazil\Have 1st + 801748C7 0000 + cn Medium Courses\Brazil\Always Low Lap Timer + 811748D0 0000 + 811748D2 0000 + cn Medium Courses\France\Have 1st + 80172477 0000 + cn Medium Courses\France\Always Low Lap Timer + 81172480 0000 + 81172482 0000 + cn Expert Courses\Germany\Have 1st + 8017DF87 0000 + cn Expert Courses\Germany\Always Low Lap Timer + 8117DF90 0000 + 8117DF92 0000 + cn Expert Courses\Canada\Have 1st + 8017CF87 0000 + cn Expert Courses\Canada\Always Low Lap Timer + 8117CF90 0000 + 8117CF92 0000 + cn Expert Courses\USA\Have 1st + 8017EF87 0000 + cn Expert Courses\USA\Always Low Lap Timer + 8117EF90 0000 + 8117EF92 0000 + cn Championship Mode\Have 255 Race Points + 80101D1A 00FF + cn Championship Mode\Australia\Start On 3rd Lap + D0178F6F 0001 + 80178F6F 0003 + cn Championship Mode\Australia\Infinite Damage\Front End + 80178FA0 003E + cn Championship Mode\Australia\Infinite Damage\Left Side + 80178FA4 0040 + cn Championship Mode\Australia\Infinite Damage\Right Side + 80178FA8 0040 + cn Championship Mode\Australia\Infinite Damage\Tires + 80178FAC 0040 + cn Championship Mode\Spain\Start On 3rd Lap + D01870BF 0001 + 801870BF 0003 + cn Championship Mode\Spain\Infinite Damage\Front End + 801870F0 0040 + cn Championship Mode\Spain\Infinite Damage\Left Side + 801870F4 0040 + cn Championship Mode\Spain\Infinite Damage\Right Side + 801870F8 0040 + cn Championship Mode\Spain\Infinite Damage\Tires + 801870FC 0040 + cn Championship Mode\Brazil\Start On 3rd Lap + D01748AF 0001 + 801748AF 0003 + cn Championship Mode\Brazil\Infinite Damage\Front End + 801748E0 0040 + cn Championship Mode\Brazil\Infinite Damage\Left Side + 801748E4 0040 + cn Championship Mode\Brazil\Infinite Damage\Right Side + 801748E8 0040 + cn Championship Mode\Brazil\Infinite Damage\Tires + 801748EC 0040 + cn Championship Mode\USA\Start On 3rd Lap + D017EF6F 0001 + 8017EF6F 0003 + cn Championship Mode\USA\Infinite Damage\Front End + 8017EFA0 0040 + cn Championship Mode\USA\Infinite Damage\Left Side + 8017EFA4 0040 + cn Championship Mode\USA\Infinite Damage\Right Side + 8017EFA8 0040 + cn Championship Mode\USA\Infinite Damage\Tires + 8017EFAC 0040 + cn Championship Mode\Italy\Start On 3rd Lap + D017E4CF 0001 + 8017E4CF 0003 + cn Championship Mode\Italy\Infinite Damage\Front End + 8017E500 0040 + cn Championship Mode\Italy\Infinite Damage\Left Side + 8017E504 0040 + cn Championship Mode\Italy\Infinite Damage\Right Side + 8017E508 0040 + cn Championship Mode\Italy\Infinite Damage\Tires + 8017E50C 0040 + cn Championship Mode\Germany\Start On 3rd Lap + D017DF6F 0001 + 8017DF6F 0003 + cn Championship Mode\Germany\Infinite Damage\Front End + 8017DFA0 0040 + cn Championship Mode\Germany\Infinite Damage\Left Side + 8017DFA4 0040 + cn Championship Mode\Germany\Infinite Damage\Right Side + 8017DFA8 0040 + cn Championship Mode\Germany\Infinite Damage\Tires + 8017DFAC 0040 + cn Championship Mode\Canada\Start On 3rd Lap + D017CF6F 0001 + 8017CF6F 0003 + cn Championship Mode\Canada\Infinite Damage\Front End + 8017CFA0 0040 + cn Championship Mode\Canada\Infinite Damage\Left Side + 8017CFA4 0040 + cn Championship Mode\Canada\Infinite Damage\Right Side + 8017CFA8 0040 + cn Championship Mode\Canada\Infinite Damage\Tires + 8017CFAC 0040 + cn Championship Mode\Great Britain\Start On 3rd Lap + D017668F 0001 + 8017668F 0003 + cn Championship Mode\Great Britain\Infinite Damage\Front End + 801766C0 0040 + cn Championship Mode\Great Britain\Infinite Damage\Left Side + 801766C4 0040 + cn Championship Mode\Great Britain\Infinite Damage\Right Side + 801766C8 0040 + cn Championship Mode\Great Britain\Infinite Damage\Tires + 801766CC 0040 + cn Championship Mode\France\Start On 3rd Lap + D017245F 0001 + 8017245F 0003 + cn Championship Mode\France\Infinite Damage\Front End + 80172490 0040 + cn Championship Mode\France\Infinite Damage\Left Side + 80172494 0040 + cn Championship Mode\France\Infinite Damage\Right Side + 80172498 0040 + cn Championship Mode\France\Infinite Damage\Tires + 8017249C 0040 + +crc C29FF9E4-264BFE7D-C:45 +gn Rampage - World Tour (U) + cn Unlock Cheat Menu + 810D5710 0001 + cn Infinite Time to Choose A Character + 8118CF9A 06CB + cn Curtis\Infinite\Health + 811541B8 0044 + cn Curtis\1-Hit Death + D01541B9 0044 + 811541B8 0001 + cn Curtis\Infinite\Special + 811541C0 0044 + cn Curtis\Max Score + 811541E8 000F + 811541EA 423F + cn Curtis\Infinite\Lives + 811541B4 0063 + cn Boris\Infinite\Health + 811543D4 0044 + cn Boris\1-Hit Death + D01543D5 0044 + 811543D4 0001 + cn Boris\Infinite\Special + 811543DC 0044 + cn Boris\Max Score + 81154404 000F + 81154406 423F + cn Boris\Infinite\Lives + 811543D0 0063 + cn Ruby\Infinite\Health + 811545F0 0044 + cn Ruby\1-Hit Death + D01545F1 0044 + 811545F0 0001 + cn Ruby\Infinite\Special + 811545F8 0044 + cn Ruby\Max Score + 81154620 000F + 81154622 423F + cn Ruby\Infinite\Lives + 811545EC 0063 + cn George\Infinite\Health + 8115480C 0044 + cn George\1-Hit Death + D015480D 0044 + 8115480C 0001 + cn George\Infinite\Special + 81154814 0044 + cn George\Max Score + 8115483C 000F + 8115483E 423F + cn George\Infinite\Lives + 81154808 0063 + cn Lizzie\Infinite\Health + 81154A28 0044 + cn Lizzie\1-Hit Death + D0154A29 0044 + 81154A28 0001 + cn Lizzie\Infinite\Special + 81154A30 0044 + cn Lizzie\Max Score + 81154A58 000F + 81154A5A 423F + cn Lizzie\Infinite\Lives + 81154A24 0063 + cn Ralph\Infinite\Health + 81154C44 0044 + cn Ralph\1-Hit Death + D0154C45 0044 + 81154C44 0001 + cn Ralph\Infinite\Special + 81154C4C 0044 + cn Ralph\Max Score + 81154C74 000F + 81154C76 423F + cn Ralph\Infinite\Lives + 81154C40 0063 + cn Myukus Codes\Infinite\Health + 81154E60 0044 + cn Myukus Codes\1-Hit Death + D0154E61 0044 + 81154E60 0001 + cn Myukus Codes\Infinite\Special + 81154E68 0044 + cn Myukus Codes\Max Score + 81154E90 000F + 81154E92 423F + cn Myukus Codes\Infinite\Lives + 81154E5C 0063 + +crc 673D099B-A4C808DE-C:45 +gn Rampage 2: Universal Tour (U) + cn Always Full Special\Myukus + 81554E68 0044 + cn Always Full Special\Ralph + 81154C4C 0044 + cn Enable\Myukus + 8118CF98 0000 + cn Infinite\Health\Myukus + 81154E60 0044 + cn Infinite\Lives\Myukus + 81154EFC 0063 + cn Infinite\Lives\Ruby + 811545EC 0063 + cn Enable\Lizzie + 8118CF94 0000 + cn Enable\Ralph + 8118CF96 0000 + cn Infinite Health\George + 8115480C 0044 + cn Infinite Health\Lizzie + 81154A28 0044 + cn Infinite Health\Ralph + 81154C44 0044 + cn Infinite Lives\George + 81154808 0063 + cn Infinite Lives\Lizzie + 81154A24 0063 + cn Infinite Lives\Ralph + 81154C40 0063 + cn Always Full Special\Boris + 811543DC 0044 + cn Always Full Special\Curtis + 811541C0 0044 + cn Always Full Special\Ruby + 811545F8 0044 + cn Always Full Special\George + 81154814 0044 + cn Always Full Special\Lizzie + 81154A30 0044 + cn Enable George + 8118CF92 0000 + cn Infinite\Health\Boris + 811543D4 0044 + cn Infinite\Health\Curtis + 811541B8 0044 + cn Infinite\Health\Ruby + 811545F0 0044 + cn Infinite\Lives\Boris + 811543D0 0063 + cn Infinite\Lives\Curtis + 811541B4 0063 + +crc 0304C48E-AC4001B8-C:45 +gn Rat Attack (U) + cn Play As/Player 1 + 801514F3 ???? 0000:"Hai Jinx",0001:"Sparky",0002:"Manx",0003:"Muffy Dupont",0004:"Bob Cat",0005:"Smokey",0006:"Atomicat",0007:"Pearl" + cn Play As/Player 2 + 80151503 ???? 0000:"Hai Jinx",0001:"Sparky",0002:"Manx",0003:"Muffy Dupont",0004:"Bob Cat",0005:"Smokey",0006:"Atomicat",0007:"Pearl" + cn Play As/Player 3 + 80151513 ???? 0000:"Hai Jinx",0001:"Sparky",0002:"Manx",0003:"Muffy Dupont",0004:"Bob Cat",0005:"Smokey",0006:"Atomicat",0007:"Pearl" + cn Play As/Player 4 + 80151523 ???? 0000:"Hai Jinx",0001:"Sparky",0002:"Manx",0003:"Muffy Dupont",0004:"Bob Cat",0005:"Smokey",0006:"Atomicat",0007:"Pearl" + cn Max Score + 81158440 05F5 + 81158442 E0FF + +crc F3C5BF9B-160F33E2-C:45 +gn Rayman 2 The Great Escape (U) + cn Have All\Crates + 810C70F8 7FFF + 810C70FA FFFF + 810C70FC FFFF + 810C70FE FFFF + 810C7100 FFFF + 800C7102 00FF + cn All Masks + cd Press GS To Activate All Masks + 891F1210 8780 + cn Start with Full Health + 811BC64C 001E + cn Have All\Levels + 811F1200 FFFF + 811F1202 FFFF + 811F1201 03E7 + 811F1203 03E7 + cn Have All\Yellow Lums + 50006401 0000 + 800C7108 00FF + 50001901 0000 + 800C70BD 00FF + 811F1182 0005 + 50005702 0000 + 811F1188 FFFF + cn Have All\Pirate Cages + 801F1142 0050 + 811F11F0 FFFF + 811F11F2 FFFF + 811F11F4 FFFF + 811F11F6 FFFF + 811F11F8 00FF + 811F11FA FFFF + cn Open Map + 810C70F0 FFFF + 810C70F2 FFFF + cn Infinite\Oxygen + 810F4B90 4396 + +crc 3918834A-15B50C29-C:45 +gn Razor Freestyle Scooter (U) [!] + cn Freeze Timer + 800CE4EE 0077 + cn Max\Wheels Collected + 800CE513 ???? 0000:"0 Wheels",001E:"30 Wheels",0028:"40 Wheels" + cn Zero Crash Counts + 800CE49F 0000 + cn Max\Tricks Landed + 810CE4A6 03E7 + 810CE4A2 03E7 + cn Max\Combos Landed + 810CE4AA 03E7 + 810CE4AE 03E7 + cn Have All Charcters & Levels Unlocked + 50000740 0000 + 800CB951 0001 + 50000304 0000 + 800CB945 0001 + 50000304 0000 + 800CB985 0001 + 50000304 0000 + 800CB9C5 0001 + 50000304 0000 + 800CBA05 0001 + 50000304 0000 + 800CBA45 0001 + 50000304 0000 + 800CBA85 0001 + +crc EAB7B429-BAC92C57-C:45 +gn Ready 2 Rumble Boxing (U) + cn Infinite\Money + 810EC932 FFFF + cn Sudden Death Mode\Player 1 + D00E7596 03D7 + 810DAF78 0000 + 810D9F7A 0001 + cn Sudden Death Mode\Player 2 + D00E7596 03D7 + 810DA790 0000 + 810DA792 0001 + cn Player 1\Health + 810D9F78 0000 + 810D9F7A ???? 0064:"Infinite",0000:"No Health" + cn Player 1\Stamina + 810D9F7C 0000 + 810D9F7E ???? 0064:"Infinite",0000:"No Stamina" + cn Player 1\RUMBLE + 810D9F84 0000 + 810D9F86 ???? 0030:"Max",0000:"Never Rumble" + cn Player 2\Health + 810DA790 0000 + 810DA792 ???? 0064:"Infinite",0000:"No Health" + cn Player 2\Stamina + 810DA794 0000 + 810DA796 ???? 0064:"Infinite",0000:"No Stamina" + cn Player 2\RUMBLE + 810DA7A0 0000 + 810DA7A2 ???? 0030:"Max",0000:"Never Rumble" + cn Infinite\Time + 810E7596 0E10 + cn Have All Characters + 5000125C 0000 + 810EC938 0000 + 5000125C 0000 + 810EC93A 0003 + +crc E9219533-13FBAFBD-C:45 +gn Ready 2 Rumble Boxing: Round 2 (U) + cn Infinite\Health\Player 1 + cd Do not use this with No Health + 810FF6B6 0064 + cn No Health\Player 1 + cd Do not use this with Infinite Health + 810FF6B6 0000 + cn Infinite\Stamina\Player 1 + cd Do not use this with No Stamina + 810FF6BA 0064 + cn No Stamina\Player 1 + cd Do not use this with Infinite Stamina + 810FF6BA 0000 + cn Max RUMBLE\Player 1 + cd Do not use this with Never RUMBLE + 810FF6C2 0090 + cn Never RUMBLE\Player 1 + cd Do not use this with Max RUMBLE + 810FF6C2 0000 + cn Infinite\Health\Player 2 + cd Do not use this with No Health + 81100316 0064 + cn No Health\Player 2 + cd Do not use this with Infinite Health + 81100316 0000 + cn Infinite\Stamina\Player 2 + cd Do not use this with No Stamina + 8110031A 0064 + cn No Stamina\Player 2 + cd Do not use this with Infinite Stamina + 8110031A 0000 + cn Max RUMBLE\Player 2 + cd Do not use this with Never RUMBLE + 81100322 0090 + cn Never RUMBLE\Player 2 + cd Do not use this with Max RUMBLE + 81100322 0000 + cn Infinite\Time + 810FE352 0E10 + cn Championship Mode\Top Rank + 810F81BA 000A + cn Championship Mode\Max Money + 810F81C8 7FFF + 810F81CA FFFF + cn Championship Mode\Infinite Money + 810F81CA FFFF + cn Championship Mode\Max Strength + 810F81CC 447A + 810F81CE 0000 + cn Championship Mode\Max Stamina + 810F81D0 447A + 810F81D2 0000 + cn Championship Mode\Max Endurance + 810F81D4 447A + 810F81D6 0000 + cn Championship Mode\Max Dexterity + 810F81D8 447A + 810F81DA 0000 + cn Championship Mode\Max Experience + 810F81DC 447A + 810F81DE 0000 + cn Enable Extra Characters + 80101E6F 0003 + 80101E73 0003 + 80101E77 0003 + 80101E7B 0003 + 80101E7F 0003 + 80101E83 0003 + 80101E87 0003 + cn Win 1 Fight to Complete Arcade Mode + 80101F0B 000B + +crc AA18B1A5-07DB6AEB-C:45 +gn Resident Evil 2 (U) + cn Max Item Modifier\Slot 01 + 800E8EC8 ???? 0000:"Nothing",0001:"Knife Hunk",0002:"Handgun Hunk",0003:"Handgun Different Ada",0004:"Custom Handgun Hunk",0005:"Magnum Hunk",0006:"Custom Magnum Hunk",0007:"Shotgun Hunk",0008:"Custom Shotgun Hunk",0009:"Grenade Launcher Claire",000A:"Grenade Launcher (Flame Rounds) Claire",000B:"Grenade Launcher (Acid Rounds) Claire",000C:"Bowgun Claire",000D:"Colt S.A.A. Claire",000E:"Spark Shot Claire",000F:"Sub Machine Gun Leon",0010:"Flamethrower Leon",0011:"Rocket Launcher Claire",0012:"Gatling Gun Claire",0013:"Machine Gun ???",0014:"Handgun Bullets",0015:"Shotgun Shells",0016:"Magnum Bullets",0017:"Fuel",0018:"Grenade Rounds",0019:"Flame Rounds",001A:"Acid Rounds",001B:"Machine Gun Bullets",001C:"S. Shot Bullets",001D:"Bow Gun Bolts",001E:"Ink Ribbon",001F:"Small Key",0020:"Hand Gun Parts",0021:"Magnum Parts",0022:"Shotgun Parts",0023:"First Aid Spray",0024:"Chemical FR-W09",0025:"Chemical AC-W24",0026:"Green Herb",0027:"Red Herb",0028:"Blue Herb",0029:"Mixed Herb (Green)",002A:"Mixed Herb (Red&Green)",002B:"Mixed Herb (Blue&Green)",002C:"Mixed Herb (?)",002D:"Mixed Herb (?)",002E:"Mixed Herb (?)",002F:"Lighter",0030:"Lock Pick",0031:"Picture",0032:"Valve Handle",0033:"Red Jewel",0034:"Red Card Key",0035:"Blue Card Key",0036:"Serpent Stone",0037:"Jaguar Stone",0038:"Blue Stone",0039:"Blue Stone (?)",003A:"Eagle Stone",003B:"Bishop Plug",003C:"Rook Plug",003D:"Knight Plug",003E:"King Plug",003F:"W. Box Key",0040:"Detonator",0041:"Plastic Bomb",0042:"Bomb&Detonator",0043:"Crank",0044:"Film",0045:"Film (?)",0046:"Film (?)",0047:"Unicorn Medal",0048:"Eagle Medal",0049:"Wolf Medal",004A:"G. Cogwheel",004B:"Manhole Opener",004C:"Main Fuse",004D:"Fuse Case",004E:"Vaccine",004F:"Vaccine Cart.",0050:"Film",0051:"Base Vaccine",0052:"G-Virus",0053:"Special Key",0054:"Joint S Plug",0055:"Joint N Plug",0056:"Cord",0057:"Film",0058:"Cabin Key",0059:"Precinct Key (blue)",005A:"Precinct Key (red)",005B:"Precinct Key (?)",005C:"Precinct Key (green)",005D:"C. Panel Key (red)",005E:"C. Panel Key (yellow)",005F:"P. Room Key",0060:"MO Disk",0061:"Lab Card Key",0062:"Master Key",0063:"Platform Key",0064:"No Item",0065:"No Item",0066:"No Item",0067:"No Item",0068:"Chris's Diary",0069:"Mail to Chris",006A:"Memo to Leon",006B:"Police Memorandum",006C:"Operation Report 1",006D:"Mail to the Chief",006E:"Mail to the Chief (?)",006F:"Secretary's Diary A",0070:"Secretary's Diary B",0071:"Operation Report 2",0072:"User Registration",0073:"Film A",0074:"Film B",0075:"Film C",0076:"Patrol Report",0077:"Watchman's Diary",0078:"Chief's Diary",0079:"Sewer Manager Diary",007A:"Sewer Manager Fax",007B:"Film D",007C:"Vaccine Synthesis",007D:"Lab Security Manual",007E:"P-Epsilon Report",007F:"Rookie Files",0080:"Rookie Files (?)",0081:"No Item",0082:"Spade Key",0083:"Diamond Key",0084:"Desk Key",0085:"Heart Key",0086:"Club Key",0087:"Virgin Heart",0088:"Square Crank",0089:"Down Key",008A:"Up Key",008B:"Locker Key" + 800E8EC9 00FF + cn Max Item Modifier\Slot 02 + 800E8ECC ???? 0000:"Nothing",0001:"Knife Hunk",0002:"Handgun Hunk",0003:"Handgun Different Ada",0004:"Custom Handgun Hunk",0005:"Magnum Hunk",0006:"Custom Magnum Hunk",0007:"Shotgun Hunk",0008:"Custom Shotgun Hunk",0009:"Grenade Launcher Claire",000A:"Grenade Launcher (Flame Rounds) Claire",000B:"Grenade Launcher (Acid Rounds) Claire",000C:"Bowgun Claire",000D:"Colt S.A.A. Claire",000E:"Spark Shot Claire",000F:"Sub Machine Gun Leon",0010:"Flamethrower Leon",0011:"Rocket Launcher Claire",0012:"Gatling Gun Claire",0013:"Machine Gun ???",0014:"Handgun Bullets",0015:"Shotgun Shells",0016:"Magnum Bullets",0017:"Fuel",0018:"Grenade Rounds",0019:"Flame Rounds",001A:"Acid Rounds",001B:"Machine Gun Bullets",001C:"S. Shot Bullets",001D:"Bow Gun Bolts",001E:"Ink Ribbon",001F:"Small Key",0020:"Hand Gun Parts",0021:"Magnum Parts",0022:"Shotgun Parts",0023:"First Aid Spray",0024:"Chemical FR-W09",0025:"Chemical AC-W24",0026:"Green Herb",0027:"Red Herb",0028:"Blue Herb",0029:"Mixed Herb (Green)",002A:"Mixed Herb (Red&Green)",002B:"Mixed Herb (Blue&Green)",002C:"Mixed Herb (?)",002D:"Mixed Herb (?)",002E:"Mixed Herb (?)",002F:"Lighter",0030:"Lock Pick",0031:"Picture",0032:"Valve Handle",0033:"Red Jewel",0034:"Red Card Key",0035:"Blue Card Key",0036:"Serpent Stone",0037:"Jaguar Stone",0038:"Blue Stone",0039:"Blue Stone (?)",003A:"Eagle Stone",003B:"Bishop Plug",003C:"Rook Plug",003D:"Knight Plug",003E:"King Plug",003F:"W. Box Key",0040:"Detonator",0041:"Plastic Bomb",0042:"Bomb&Detonator",0043:"Crank",0044:"Film",0045:"Film (?)",0046:"Film (?)",0047:"Unicorn Medal",0048:"Eagle Medal",0049:"Wolf Medal",004A:"G. Cogwheel",004B:"Manhole Opener",004C:"Main Fuse",004D:"Fuse Case",004E:"Vaccine",004F:"Vaccine Cart.",0050:"Film",0051:"Base Vaccine",0052:"G-Virus",0053:"Special Key",0054:"Joint S Plug",0055:"Joint N Plug",0056:"Cord",0057:"Film",0058:"Cabin Key",0059:"Precinct Key (blue)",005A:"Precinct Key (red)",005B:"Precinct Key (?)",005C:"Precinct Key (green)",005D:"C. Panel Key (red)",005E:"C. Panel Key (yellow)",005F:"P. Room Key",0060:"MO Disk",0061:"Lab Card Key",0062:"Master Key",0063:"Platform Key",0064:"No Item",0065:"No Item",0066:"No Item",0067:"No Item",0068:"Chris's Diary",0069:"Mail to Chris",006A:"Memo to Leon",006B:"Police Memorandum",006C:"Operation Report 1",006D:"Mail to the Chief",006E:"Mail to the Chief (?)",006F:"Secretary's Diary A",0070:"Secretary's Diary B",0071:"Operation Report 2",0072:"User Registration",0073:"Film A",0074:"Film B",0075:"Film C",0076:"Patrol Report",0077:"Watchman's Diary",0078:"Chief's Diary",0079:"Sewer Manager Diary",007A:"Sewer Manager Fax",007B:"Film D",007C:"Vaccine Synthesis",007D:"Lab Security Manual",007E:"P-Epsilon Report",007F:"Rookie Files",0080:"Rookie Files (?)",0081:"No Item",0082:"Spade Key",0083:"Diamond Key",0084:"Desk Key",0085:"Heart Key",0086:"Club Key",0087:"Virgin Heart",0088:"Square Crank",0089:"Down Key",008A:"Up Key",008B:"Locker Key" + 800E8ECD 00FF + cn Max Item Modifier\Slot 03 + 800E8ED0 ???? 0000:"Nothing",0001:"Knife Hunk",0002:"Handgun Hunk",0003:"Handgun Different Ada",0004:"Custom Handgun Hunk",0005:"Magnum Hunk",0006:"Custom Magnum Hunk",0007:"Shotgun Hunk",0008:"Custom Shotgun Hunk",0009:"Grenade Launcher Claire",000A:"Grenade Launcher (Flame Rounds) Claire",000B:"Grenade Launcher (Acid Rounds) Claire",000C:"Bowgun Claire",000D:"Colt S.A.A. Claire",000E:"Spark Shot Claire",000F:"Sub Machine Gun Leon",0010:"Flamethrower Leon",0011:"Rocket Launcher Claire",0012:"Gatling Gun Claire",0013:"Machine Gun ???",0014:"Handgun Bullets",0015:"Shotgun Shells",0016:"Magnum Bullets",0017:"Fuel",0018:"Grenade Rounds",0019:"Flame Rounds",001A:"Acid Rounds",001B:"Machine Gun Bullets",001C:"S. Shot Bullets",001D:"Bow Gun Bolts",001E:"Ink Ribbon",001F:"Small Key",0020:"Hand Gun Parts",0021:"Magnum Parts",0022:"Shotgun Parts",0023:"First Aid Spray",0024:"Chemical FR-W09",0025:"Chemical AC-W24",0026:"Green Herb",0027:"Red Herb",0028:"Blue Herb",0029:"Mixed Herb (Green)",002A:"Mixed Herb (Red&Green)",002B:"Mixed Herb (Blue&Green)",002C:"Mixed Herb (?)",002D:"Mixed Herb (?)",002E:"Mixed Herb (?)",002F:"Lighter",0030:"Lock Pick",0031:"Picture",0032:"Valve Handle",0033:"Red Jewel",0034:"Red Card Key",0035:"Blue Card Key",0036:"Serpent Stone",0037:"Jaguar Stone",0038:"Blue Stone",0039:"Blue Stone (?)",003A:"Eagle Stone",003B:"Bishop Plug",003C:"Rook Plug",003D:"Knight Plug",003E:"King Plug",003F:"W. Box Key",0040:"Detonator",0041:"Plastic Bomb",0042:"Bomb&Detonator",0043:"Crank",0044:"Film",0045:"Film (?)",0046:"Film (?)",0047:"Unicorn Medal",0048:"Eagle Medal",0049:"Wolf Medal",004A:"G. Cogwheel",004B:"Manhole Opener",004C:"Main Fuse",004D:"Fuse Case",004E:"Vaccine",004F:"Vaccine Cart.",0050:"Film",0051:"Base Vaccine",0052:"G-Virus",0053:"Special Key",0054:"Joint S Plug",0055:"Joint N Plug",0056:"Cord",0057:"Film",0058:"Cabin Key",0059:"Precinct Key (blue)",005A:"Precinct Key (red)",005B:"Precinct Key (?)",005C:"Precinct Key (green)",005D:"C. Panel Key (red)",005E:"C. Panel Key (yellow)",005F:"P. Room Key",0060:"MO Disk",0061:"Lab Card Key",0062:"Master Key",0063:"Platform Key",0064:"No Item",0065:"No Item",0066:"No Item",0067:"No Item",0068:"Chris's Diary",0069:"Mail to Chris",006A:"Memo to Leon",006B:"Police Memorandum",006C:"Operation Report 1",006D:"Mail to the Chief",006E:"Mail to the Chief (?)",006F:"Secretary's Diary A",0070:"Secretary's Diary B",0071:"Operation Report 2",0072:"User Registration",0073:"Film A",0074:"Film B",0075:"Film C",0076:"Patrol Report",0077:"Watchman's Diary",0078:"Chief's Diary",0079:"Sewer Manager Diary",007A:"Sewer Manager Fax",007B:"Film D",007C:"Vaccine Synthesis",007D:"Lab Security Manual",007E:"P-Epsilon Report",007F:"Rookie Files",0080:"Rookie Files (?)",0081:"No Item",0082:"Spade Key",0083:"Diamond Key",0084:"Desk Key",0085:"Heart Key",0086:"Club Key",0087:"Virgin Heart",0088:"Square Crank",0089:"Down Key",008A:"Up Key",008B:"Locker Key" + 800E8ED1 00FF + cn Max Item Modifier\Slot 04 + 800E8ED4 ???? 0000:"Nothing",0001:"Knife Hunk",0002:"Handgun Hunk",0003:"Handgun Different Ada",0004:"Custom Handgun Hunk",0005:"Magnum Hunk",0006:"Custom Magnum Hunk",0007:"Shotgun Hunk",0008:"Custom Shotgun Hunk",0009:"Grenade Launcher Claire",000A:"Grenade Launcher (Flame Rounds) Claire",000B:"Grenade Launcher (Acid Rounds) Claire",000C:"Bowgun Claire",000D:"Colt S.A.A. Claire",000E:"Spark Shot Claire",000F:"Sub Machine Gun Leon",0010:"Flamethrower Leon",0011:"Rocket Launcher Claire",0012:"Gatling Gun Claire",0013:"Machine Gun ???",0014:"Handgun Bullets",0015:"Shotgun Shells",0016:"Magnum Bullets",0017:"Fuel",0018:"Grenade Rounds",0019:"Flame Rounds",001A:"Acid Rounds",001B:"Machine Gun Bullets",001C:"S. Shot Bullets",001D:"Bow Gun Bolts",001E:"Ink Ribbon",001F:"Small Key",0020:"Hand Gun Parts",0021:"Magnum Parts",0022:"Shotgun Parts",0023:"First Aid Spray",0024:"Chemical FR-W09",0025:"Chemical AC-W24",0026:"Green Herb",0027:"Red Herb",0028:"Blue Herb",0029:"Mixed Herb (Green)",002A:"Mixed Herb (Red&Green)",002B:"Mixed Herb (Blue&Green)",002C:"Mixed Herb (?)",002D:"Mixed Herb (?)",002E:"Mixed Herb (?)",002F:"Lighter",0030:"Lock Pick",0031:"Picture",0032:"Valve Handle",0033:"Red Jewel",0034:"Red Card Key",0035:"Blue Card Key",0036:"Serpent Stone",0037:"Jaguar Stone",0038:"Blue Stone",0039:"Blue Stone (?)",003A:"Eagle Stone",003B:"Bishop Plug",003C:"Rook Plug",003D:"Knight Plug",003E:"King Plug",003F:"W. Box Key",0040:"Detonator",0041:"Plastic Bomb",0042:"Bomb&Detonator",0043:"Crank",0044:"Film",0045:"Film (?)",0046:"Film (?)",0047:"Unicorn Medal",0048:"Eagle Medal",0049:"Wolf Medal",004A:"G. Cogwheel",004B:"Manhole Opener",004C:"Main Fuse",004D:"Fuse Case",004E:"Vaccine",004F:"Vaccine Cart.",0050:"Film",0051:"Base Vaccine",0052:"G-Virus",0053:"Special Key",0054:"Joint S Plug",0055:"Joint N Plug",0056:"Cord",0057:"Film",0058:"Cabin Key",0059:"Precinct Key (blue)",005A:"Precinct Key (red)",005B:"Precinct Key (?)",005C:"Precinct Key (green)",005D:"C. Panel Key (red)",005E:"C. Panel Key (yellow)",005F:"P. Room Key",0060:"MO Disk",0061:"Lab Card Key",0062:"Master Key",0063:"Platform Key",0064:"No Item",0065:"No Item",0066:"No Item",0067:"No Item",0068:"Chris's Diary",0069:"Mail to Chris",006A:"Memo to Leon",006B:"Police Memorandum",006C:"Operation Report 1",006D:"Mail to the Chief",006E:"Mail to the Chief (?)",006F:"Secretary's Diary A",0070:"Secretary's Diary B",0071:"Operation Report 2",0072:"User Registration",0073:"Film A",0074:"Film B",0075:"Film C",0076:"Patrol Report",0077:"Watchman's Diary",0078:"Chief's Diary",0079:"Sewer Manager Diary",007A:"Sewer Manager Fax",007B:"Film D",007C:"Vaccine Synthesis",007D:"Lab Security Manual",007E:"P-Epsilon Report",007F:"Rookie Files",0080:"Rookie Files (?)",0081:"No Item",0082:"Spade Key",0083:"Diamond Key",0084:"Desk Key",0085:"Heart Key",0086:"Club Key",0087:"Virgin Heart",0088:"Square Crank",0089:"Down Key",008A:"Up Key",008B:"Locker Key" + 800E8ED5 00FF + cn Max Item Modifier\Slot 05 + 800E8ED8 ???? 0000:"Nothing",0001:"Knife Hunk",0002:"Handgun Hunk",0003:"Handgun Different Ada",0004:"Custom Handgun Hunk",0005:"Magnum Hunk",0006:"Custom Magnum Hunk",0007:"Shotgun Hunk",0008:"Custom Shotgun Hunk",0009:"Grenade Launcher Claire",000A:"Grenade Launcher (Flame Rounds) Claire",000B:"Grenade Launcher (Acid Rounds) Claire",000C:"Bowgun Claire",000D:"Colt S.A.A. Claire",000E:"Spark Shot Claire",000F:"Sub Machine Gun Leon",0010:"Flamethrower Leon",0011:"Rocket Launcher Claire",0012:"Gatling Gun Claire",0013:"Machine Gun ???",0014:"Handgun Bullets",0015:"Shotgun Shells",0016:"Magnum Bullets",0017:"Fuel",0018:"Grenade Rounds",0019:"Flame Rounds",001A:"Acid Rounds",001B:"Machine Gun Bullets",001C:"S. Shot Bullets",001D:"Bow Gun Bolts",001E:"Ink Ribbon",001F:"Small Key",0020:"Hand Gun Parts",0021:"Magnum Parts",0022:"Shotgun Parts",0023:"First Aid Spray",0024:"Chemical FR-W09",0025:"Chemical AC-W24",0026:"Green Herb",0027:"Red Herb",0028:"Blue Herb",0029:"Mixed Herb (Green)",002A:"Mixed Herb (Red&Green)",002B:"Mixed Herb (Blue&Green)",002C:"Mixed Herb (?)",002D:"Mixed Herb (?)",002E:"Mixed Herb (?)",002F:"Lighter",0030:"Lock Pick",0031:"Picture",0032:"Valve Handle",0033:"Red Jewel",0034:"Red Card Key",0035:"Blue Card Key",0036:"Serpent Stone",0037:"Jaguar Stone",0038:"Blue Stone",0039:"Blue Stone (?)",003A:"Eagle Stone",003B:"Bishop Plug",003C:"Rook Plug",003D:"Knight Plug",003E:"King Plug",003F:"W. Box Key",0040:"Detonator",0041:"Plastic Bomb",0042:"Bomb&Detonator",0043:"Crank",0044:"Film",0045:"Film (?)",0046:"Film (?)",0047:"Unicorn Medal",0048:"Eagle Medal",0049:"Wolf Medal",004A:"G. Cogwheel",004B:"Manhole Opener",004C:"Main Fuse",004D:"Fuse Case",004E:"Vaccine",004F:"Vaccine Cart.",0050:"Film",0051:"Base Vaccine",0052:"G-Virus",0053:"Special Key",0054:"Joint S Plug",0055:"Joint N Plug",0056:"Cord",0057:"Film",0058:"Cabin Key",0059:"Precinct Key (blue)",005A:"Precinct Key (red)",005B:"Precinct Key (?)",005C:"Precinct Key (green)",005D:"C. Panel Key (red)",005E:"C. Panel Key (yellow)",005F:"P. Room Key",0060:"MO Disk",0061:"Lab Card Key",0062:"Master Key",0063:"Platform Key",0064:"No Item",0065:"No Item",0066:"No Item",0067:"No Item",0068:"Chris's Diary",0069:"Mail to Chris",006A:"Memo to Leon",006B:"Police Memorandum",006C:"Operation Report 1",006D:"Mail to the Chief",006E:"Mail to the Chief (?)",006F:"Secretary's Diary A",0070:"Secretary's Diary B",0071:"Operation Report 2",0072:"User Registration",0073:"Film A",0074:"Film B",0075:"Film C",0076:"Patrol Report",0077:"Watchman's Diary",0078:"Chief's Diary",0079:"Sewer Manager Diary",007A:"Sewer Manager Fax",007B:"Film D",007C:"Vaccine Synthesis",007D:"Lab Security Manual",007E:"P-Epsilon Report",007F:"Rookie Files",0080:"Rookie Files (?)",0081:"No Item",0082:"Spade Key",0083:"Diamond Key",0084:"Desk Key",0085:"Heart Key",0086:"Club Key",0087:"Virgin Heart",0088:"Square Crank",0089:"Down Key",008A:"Up Key",008B:"Locker Key" + 800E8ED9 00FF + cn Max Item Modifier\Slot 06 + 800E8EDC ???? 0000:"Nothing",0001:"Knife Hunk",0002:"Handgun Hunk",0003:"Handgun Different Ada",0004:"Custom Handgun Hunk",0005:"Magnum Hunk",0006:"Custom Magnum Hunk",0007:"Shotgun Hunk",0008:"Custom Shotgun Hunk",0009:"Grenade Launcher Claire",000A:"Grenade Launcher (Flame Rounds) Claire",000B:"Grenade Launcher (Acid Rounds) Claire",000C:"Bowgun Claire",000D:"Colt S.A.A. Claire",000E:"Spark Shot Claire",000F:"Sub Machine Gun Leon",0010:"Flamethrower Leon",0011:"Rocket Launcher Claire",0012:"Gatling Gun Claire",0013:"Machine Gun ???",0014:"Handgun Bullets",0015:"Shotgun Shells",0016:"Magnum Bullets",0017:"Fuel",0018:"Grenade Rounds",0019:"Flame Rounds",001A:"Acid Rounds",001B:"Machine Gun Bullets",001C:"S. Shot Bullets",001D:"Bow Gun Bolts",001E:"Ink Ribbon",001F:"Small Key",0020:"Hand Gun Parts",0021:"Magnum Parts",0022:"Shotgun Parts",0023:"First Aid Spray",0024:"Chemical FR-W09",0025:"Chemical AC-W24",0026:"Green Herb",0027:"Red Herb",0028:"Blue Herb",0029:"Mixed Herb (Green)",002A:"Mixed Herb (Red&Green)",002B:"Mixed Herb (Blue&Green)",002C:"Mixed Herb (?)",002D:"Mixed Herb (?)",002E:"Mixed Herb (?)",002F:"Lighter",0030:"Lock Pick",0031:"Picture",0032:"Valve Handle",0033:"Red Jewel",0034:"Red Card Key",0035:"Blue Card Key",0036:"Serpent Stone",0037:"Jaguar Stone",0038:"Blue Stone",0039:"Blue Stone (?)",003A:"Eagle Stone",003B:"Bishop Plug",003C:"Rook Plug",003D:"Knight Plug",003E:"King Plug",003F:"W. Box Key",0040:"Detonator",0041:"Plastic Bomb",0042:"Bomb&Detonator",0043:"Crank",0044:"Film",0045:"Film (?)",0046:"Film (?)",0047:"Unicorn Medal",0048:"Eagle Medal",0049:"Wolf Medal",004A:"G. Cogwheel",004B:"Manhole Opener",004C:"Main Fuse",004D:"Fuse Case",004E:"Vaccine",004F:"Vaccine Cart.",0050:"Film",0051:"Base Vaccine",0052:"G-Virus",0053:"Special Key",0054:"Joint S Plug",0055:"Joint N Plug",0056:"Cord",0057:"Film",0058:"Cabin Key",0059:"Precinct Key (blue)",005A:"Precinct Key (red)",005B:"Precinct Key (?)",005C:"Precinct Key (green)",005D:"C. Panel Key (red)",005E:"C. Panel Key (yellow)",005F:"P. Room Key",0060:"MO Disk",0061:"Lab Card Key",0062:"Master Key",0063:"Platform Key",0064:"No Item",0065:"No Item",0066:"No Item",0067:"No Item",0068:"Chris's Diary",0069:"Mail to Chris",006A:"Memo to Leon",006B:"Police Memorandum",006C:"Operation Report 1",006D:"Mail to the Chief",006E:"Mail to the Chief (?)",006F:"Secretary's Diary A",0070:"Secretary's Diary B",0071:"Operation Report 2",0072:"User Registration",0073:"Film A",0074:"Film B",0075:"Film C",0076:"Patrol Report",0077:"Watchman's Diary",0078:"Chief's Diary",0079:"Sewer Manager Diary",007A:"Sewer Manager Fax",007B:"Film D",007C:"Vaccine Synthesis",007D:"Lab Security Manual",007E:"P-Epsilon Report",007F:"Rookie Files",0080:"Rookie Files (?)",0081:"No Item",0082:"Spade Key",0083:"Diamond Key",0084:"Desk Key",0085:"Heart Key",0086:"Club Key",0087:"Virgin Heart",0088:"Square Crank",0089:"Down Key",008A:"Up Key",008B:"Locker Key" + 800E8EDD 00FF + cn Max Item Modifier\Slot 07 + 800E8EE0 ???? 0000:"Nothing",0001:"Knife Hunk",0002:"Handgun Hunk",0003:"Handgun Different Ada",0004:"Custom Handgun Hunk",0005:"Magnum Hunk",0006:"Custom Magnum Hunk",0007:"Shotgun Hunk",0008:"Custom Shotgun Hunk",0009:"Grenade Launcher Claire",000A:"Grenade Launcher (Flame Rounds) Claire",000B:"Grenade Launcher (Acid Rounds) Claire",000C:"Bowgun Claire",000D:"Colt S.A.A. Claire",000E:"Spark Shot Claire",000F:"Sub Machine Gun Leon",0010:"Flamethrower Leon",0011:"Rocket Launcher Claire",0012:"Gatling Gun Claire",0013:"Machine Gun ???",0014:"Handgun Bullets",0015:"Shotgun Shells",0016:"Magnum Bullets",0017:"Fuel",0018:"Grenade Rounds",0019:"Flame Rounds",001A:"Acid Rounds",001B:"Machine Gun Bullets",001C:"S. Shot Bullets",001D:"Bow Gun Bolts",001E:"Ink Ribbon",001F:"Small Key",0020:"Hand Gun Parts",0021:"Magnum Parts",0022:"Shotgun Parts",0023:"First Aid Spray",0024:"Chemical FR-W09",0025:"Chemical AC-W24",0026:"Green Herb",0027:"Red Herb",0028:"Blue Herb",0029:"Mixed Herb (Green)",002A:"Mixed Herb (Red&Green)",002B:"Mixed Herb (Blue&Green)",002C:"Mixed Herb (?)",002D:"Mixed Herb (?)",002E:"Mixed Herb (?)",002F:"Lighter",0030:"Lock Pick",0031:"Picture",0032:"Valve Handle",0033:"Red Jewel",0034:"Red Card Key",0035:"Blue Card Key",0036:"Serpent Stone",0037:"Jaguar Stone",0038:"Blue Stone",0039:"Blue Stone (?)",003A:"Eagle Stone",003B:"Bishop Plug",003C:"Rook Plug",003D:"Knight Plug",003E:"King Plug",003F:"W. Box Key",0040:"Detonator",0041:"Plastic Bomb",0042:"Bomb&Detonator",0043:"Crank",0044:"Film",0045:"Film (?)",0046:"Film (?)",0047:"Unicorn Medal",0048:"Eagle Medal",0049:"Wolf Medal",004A:"G. Cogwheel",004B:"Manhole Opener",004C:"Main Fuse",004D:"Fuse Case",004E:"Vaccine",004F:"Vaccine Cart.",0050:"Film",0051:"Base Vaccine",0052:"G-Virus",0053:"Special Key",0054:"Joint S Plug",0055:"Joint N Plug",0056:"Cord",0057:"Film",0058:"Cabin Key",0059:"Precinct Key (blue)",005A:"Precinct Key (red)",005B:"Precinct Key (?)",005C:"Precinct Key (green)",005D:"C. Panel Key (red)",005E:"C. Panel Key (yellow)",005F:"P. Room Key",0060:"MO Disk",0061:"Lab Card Key",0062:"Master Key",0063:"Platform Key",0064:"No Item",0065:"No Item",0066:"No Item",0067:"No Item",0068:"Chris's Diary",0069:"Mail to Chris",006A:"Memo to Leon",006B:"Police Memorandum",006C:"Operation Report 1",006D:"Mail to the Chief",006E:"Mail to the Chief (?)",006F:"Secretary's Diary A",0070:"Secretary's Diary B",0071:"Operation Report 2",0072:"User Registration",0073:"Film A",0074:"Film B",0075:"Film C",0076:"Patrol Report",0077:"Watchman's Diary",0078:"Chief's Diary",0079:"Sewer Manager Diary",007A:"Sewer Manager Fax",007B:"Film D",007C:"Vaccine Synthesis",007D:"Lab Security Manual",007E:"P-Epsilon Report",007F:"Rookie Files",0080:"Rookie Files (?)",0081:"No Item",0082:"Spade Key",0083:"Diamond Key",0084:"Desk Key",0085:"Heart Key",0086:"Club Key",0087:"Virgin Heart",0088:"Square Crank",0089:"Down Key",008A:"Up Key",008B:"Locker Key" + 800E8EE1 00FF + cn Max Item Modifier\Slot 08 + 800E8EE4 ???? 0000:"Nothing",0001:"Knife Hunk",0002:"Handgun Hunk",0003:"Handgun Different Ada",0004:"Custom Handgun Hunk",0005:"Magnum Hunk",0006:"Custom Magnum Hunk",0007:"Shotgun Hunk",0008:"Custom Shotgun Hunk",0009:"Grenade Launcher Claire",000A:"Grenade Launcher (Flame Rounds) Claire",000B:"Grenade Launcher (Acid Rounds) Claire",000C:"Bowgun Claire",000D:"Colt S.A.A. Claire",000E:"Spark Shot Claire",000F:"Sub Machine Gun Leon",0010:"Flamethrower Leon",0011:"Rocket Launcher Claire",0012:"Gatling Gun Claire",0013:"Machine Gun ???",0014:"Handgun Bullets",0015:"Shotgun Shells",0016:"Magnum Bullets",0017:"Fuel",0018:"Grenade Rounds",0019:"Flame Rounds",001A:"Acid Rounds",001B:"Machine Gun Bullets",001C:"S. Shot Bullets",001D:"Bow Gun Bolts",001E:"Ink Ribbon",001F:"Small Key",0020:"Hand Gun Parts",0021:"Magnum Parts",0022:"Shotgun Parts",0023:"First Aid Spray",0024:"Chemical FR-W09",0025:"Chemical AC-W24",0026:"Green Herb",0027:"Red Herb",0028:"Blue Herb",0029:"Mixed Herb (Green)",002A:"Mixed Herb (Red&Green)",002B:"Mixed Herb (Blue&Green)",002C:"Mixed Herb (?)",002D:"Mixed Herb (?)",002E:"Mixed Herb (?)",002F:"Lighter",0030:"Lock Pick",0031:"Picture",0032:"Valve Handle",0033:"Red Jewel",0034:"Red Card Key",0035:"Blue Card Key",0036:"Serpent Stone",0037:"Jaguar Stone",0038:"Blue Stone",0039:"Blue Stone (?)",003A:"Eagle Stone",003B:"Bishop Plug",003C:"Rook Plug",003D:"Knight Plug",003E:"King Plug",003F:"W. Box Key",0040:"Detonator",0041:"Plastic Bomb",0042:"Bomb&Detonator",0043:"Crank",0044:"Film",0045:"Film (?)",0046:"Film (?)",0047:"Unicorn Medal",0048:"Eagle Medal",0049:"Wolf Medal",004A:"G. Cogwheel",004B:"Manhole Opener",004C:"Main Fuse",004D:"Fuse Case",004E:"Vaccine",004F:"Vaccine Cart.",0050:"Film",0051:"Base Vaccine",0052:"G-Virus",0053:"Special Key",0054:"Joint S Plug",0055:"Joint N Plug",0056:"Cord",0057:"Film",0058:"Cabin Key",0059:"Precinct Key (blue)",005A:"Precinct Key (red)",005B:"Precinct Key (?)",005C:"Precinct Key (green)",005D:"C. Panel Key (red)",005E:"C. Panel Key (yellow)",005F:"P. Room Key",0060:"MO Disk",0061:"Lab Card Key",0062:"Master Key",0063:"Platform Key",0064:"No Item",0065:"No Item",0066:"No Item",0067:"No Item",0068:"Chris's Diary",0069:"Mail to Chris",006A:"Memo to Leon",006B:"Police Memorandum",006C:"Operation Report 1",006D:"Mail to the Chief",006E:"Mail to the Chief (?)",006F:"Secretary's Diary A",0070:"Secretary's Diary B",0071:"Operation Report 2",0072:"User Registration",0073:"Film A",0074:"Film B",0075:"Film C",0076:"Patrol Report",0077:"Watchman's Diary",0078:"Chief's Diary",0079:"Sewer Manager Diary",007A:"Sewer Manager Fax",007B:"Film D",007C:"Vaccine Synthesis",007D:"Lab Security Manual",007E:"P-Epsilon Report",007F:"Rookie Files",0080:"Rookie Files (?)",0081:"No Item",0082:"Spade Key",0083:"Diamond Key",0084:"Desk Key",0085:"Heart Key",0086:"Club Key",0087:"Virgin Heart",0088:"Square Crank",0089:"Down Key",008A:"Up Key",008B:"Locker Key" + 800E8EE5 00FF + cn Max Item Modifier\Slot 09 + 800E8EE8 ???? 0000:"Nothing",0001:"Knife Hunk",0002:"Handgun Hunk",0003:"Handgun Different Ada",0004:"Custom Handgun Hunk",0005:"Magnum Hunk",0006:"Custom Magnum Hunk",0007:"Shotgun Hunk",0008:"Custom Shotgun Hunk",0009:"Grenade Launcher Claire",000A:"Grenade Launcher (Flame Rounds) Claire",000B:"Grenade Launcher (Acid Rounds) Claire",000C:"Bowgun Claire",000D:"Colt S.A.A. Claire",000E:"Spark Shot Claire",000F:"Sub Machine Gun Leon",0010:"Flamethrower Leon",0011:"Rocket Launcher Claire",0012:"Gatling Gun Claire",0013:"Machine Gun ???",0014:"Handgun Bullets",0015:"Shotgun Shells",0016:"Magnum Bullets",0017:"Fuel",0018:"Grenade Rounds",0019:"Flame Rounds",001A:"Acid Rounds",001B:"Machine Gun Bullets",001C:"S. Shot Bullets",001D:"Bow Gun Bolts",001E:"Ink Ribbon",001F:"Small Key",0020:"Hand Gun Parts",0021:"Magnum Parts",0022:"Shotgun Parts",0023:"First Aid Spray",0024:"Chemical FR-W09",0025:"Chemical AC-W24",0026:"Green Herb",0027:"Red Herb",0028:"Blue Herb",0029:"Mixed Herb (Green)",002A:"Mixed Herb (Red&Green)",002B:"Mixed Herb (Blue&Green)",002C:"Mixed Herb (?)",002D:"Mixed Herb (?)",002E:"Mixed Herb (?)",002F:"Lighter",0030:"Lock Pick",0031:"Picture",0032:"Valve Handle",0033:"Red Jewel",0034:"Red Card Key",0035:"Blue Card Key",0036:"Serpent Stone",0037:"Jaguar Stone",0038:"Blue Stone",0039:"Blue Stone (?)",003A:"Eagle Stone",003B:"Bishop Plug",003C:"Rook Plug",003D:"Knight Plug",003E:"King Plug",003F:"W. Box Key",0040:"Detonator",0041:"Plastic Bomb",0042:"Bomb&Detonator",0043:"Crank",0044:"Film",0045:"Film (?)",0046:"Film (?)",0047:"Unicorn Medal",0048:"Eagle Medal",0049:"Wolf Medal",004A:"G. Cogwheel",004B:"Manhole Opener",004C:"Main Fuse",004D:"Fuse Case",004E:"Vaccine",004F:"Vaccine Cart.",0050:"Film",0051:"Base Vaccine",0052:"G-Virus",0053:"Special Key",0054:"Joint S Plug",0055:"Joint N Plug",0056:"Cord",0057:"Film",0058:"Cabin Key",0059:"Precinct Key (blue)",005A:"Precinct Key (red)",005B:"Precinct Key (?)",005C:"Precinct Key (green)",005D:"C. Panel Key (red)",005E:"C. Panel Key (yellow)",005F:"P. Room Key",0060:"MO Disk",0061:"Lab Card Key",0062:"Master Key",0063:"Platform Key",0064:"No Item",0065:"No Item",0066:"No Item",0067:"No Item",0068:"Chris's Diary",0069:"Mail to Chris",006A:"Memo to Leon",006B:"Police Memorandum",006C:"Operation Report 1",006D:"Mail to the Chief",006E:"Mail to the Chief (?)",006F:"Secretary's Diary A",0070:"Secretary's Diary B",0071:"Operation Report 2",0072:"User Registration",0073:"Film A",0074:"Film B",0075:"Film C",0076:"Patrol Report",0077:"Watchman's Diary",0078:"Chief's Diary",0079:"Sewer Manager Diary",007A:"Sewer Manager Fax",007B:"Film D",007C:"Vaccine Synthesis",007D:"Lab Security Manual",007E:"P-Epsilon Report",007F:"Rookie Files",0080:"Rookie Files (?)",0081:"No Item",0082:"Spade Key",0083:"Diamond Key",0084:"Desk Key",0085:"Heart Key",0086:"Club Key",0087:"Virgin Heart",0088:"Square Crank",0089:"Down Key",008A:"Up Key",008B:"Locker Key" + 800E8EE9 00FF + cn Max Item Modifier\Slot 10 + 800E8EEC ???? 0000:"Nothing",0001:"Knife Hunk",0002:"Handgun Hunk",0003:"Handgun Different Ada",0004:"Custom Handgun Hunk",0005:"Magnum Hunk",0006:"Custom Magnum Hunk",0007:"Shotgun Hunk",0008:"Custom Shotgun Hunk",0009:"Grenade Launcher Claire",000A:"Grenade Launcher (Flame Rounds) Claire",000B:"Grenade Launcher (Acid Rounds) Claire",000C:"Bowgun Claire",000D:"Colt S.A.A. Claire",000E:"Spark Shot Claire",000F:"Sub Machine Gun Leon",0010:"Flamethrower Leon",0011:"Rocket Launcher Claire",0012:"Gatling Gun Claire",0013:"Machine Gun ???",0014:"Handgun Bullets",0015:"Shotgun Shells",0016:"Magnum Bullets",0017:"Fuel",0018:"Grenade Rounds",0019:"Flame Rounds",001A:"Acid Rounds",001B:"Machine Gun Bullets",001C:"S. Shot Bullets",001D:"Bow Gun Bolts",001E:"Ink Ribbon",001F:"Small Key",0020:"Hand Gun Parts",0021:"Magnum Parts",0022:"Shotgun Parts",0023:"First Aid Spray",0024:"Chemical FR-W09",0025:"Chemical AC-W24",0026:"Green Herb",0027:"Red Herb",0028:"Blue Herb",0029:"Mixed Herb (Green)",002A:"Mixed Herb (Red&Green)",002B:"Mixed Herb (Blue&Green)",002C:"Mixed Herb (?)",002D:"Mixed Herb (?)",002E:"Mixed Herb (?)",002F:"Lighter",0030:"Lock Pick",0031:"Picture",0032:"Valve Handle",0033:"Red Jewel",0034:"Red Card Key",0035:"Blue Card Key",0036:"Serpent Stone",0037:"Jaguar Stone",0038:"Blue Stone",0039:"Blue Stone (?)",003A:"Eagle Stone",003B:"Bishop Plug",003C:"Rook Plug",003D:"Knight Plug",003E:"King Plug",003F:"W. Box Key",0040:"Detonator",0041:"Plastic Bomb",0042:"Bomb&Detonator",0043:"Crank",0044:"Film",0045:"Film (?)",0046:"Film (?)",0047:"Unicorn Medal",0048:"Eagle Medal",0049:"Wolf Medal",004A:"G. Cogwheel",004B:"Manhole Opener",004C:"Main Fuse",004D:"Fuse Case",004E:"Vaccine",004F:"Vaccine Cart.",0050:"Film",0051:"Base Vaccine",0052:"G-Virus",0053:"Special Key",0054:"Joint S Plug",0055:"Joint N Plug",0056:"Cord",0057:"Film",0058:"Cabin Key",0059:"Precinct Key (blue)",005A:"Precinct Key (red)",005B:"Precinct Key (?)",005C:"Precinct Key (green)",005D:"C. Panel Key (red)",005E:"C. Panel Key (yellow)",005F:"P. Room Key",0060:"MO Disk",0061:"Lab Card Key",0062:"Master Key",0063:"Platform Key",0064:"No Item",0065:"No Item",0066:"No Item",0067:"No Item",0068:"Chris's Diary",0069:"Mail to Chris",006A:"Memo to Leon",006B:"Police Memorandum",006C:"Operation Report 1",006D:"Mail to the Chief",006E:"Mail to the Chief (?)",006F:"Secretary's Diary A",0070:"Secretary's Diary B",0071:"Operation Report 2",0072:"User Registration",0073:"Film A",0074:"Film B",0075:"Film C",0076:"Patrol Report",0077:"Watchman's Diary",0078:"Chief's Diary",0079:"Sewer Manager Diary",007A:"Sewer Manager Fax",007B:"Film D",007C:"Vaccine Synthesis",007D:"Lab Security Manual",007E:"P-Epsilon Report",007F:"Rookie Files",0080:"Rookie Files (?)",0081:"No Item",0082:"Spade Key",0083:"Diamond Key",0084:"Desk Key",0085:"Heart Key",0086:"Club Key",0087:"Virgin Heart",0088:"Square Crank",0089:"Down Key",008A:"Up Key",008B:"Locker Key" + 800E8EED 00FF + cn Infinite\Health + 810E1322 00C8 + cn Always Have Fine Condition + 810E13E4 0000 + cn Play As + 810E1138 ???? 0080:"Leon Original",0180:"Claire Original",0280:"Leon Original",0380:"Claire Original",0480:"Leon Wounded",0580:"Claire without jacket",0680:"Leon Wounded",0780:"Claire without jacket",0880:"Leon as Stars",0980:"Claire as Biker",0A80:"Leon as Biker",0B80:"Claires body Leons outfit",0C80:"Hunk (can crash the game)",0D80:"To Fu",0E80:"Ada (can crash the game)",0F80:"Cheryl" + cn Play Extra Mission + 810E10EE ???? 0048:"The 4th Survior",0049:"To-Fu" + cn Infinite\Time + 800E8CBF 0010 + +crc 0F1FA987-BFC1AFA6-C:45 +gn Re-Volt (U) + cn Access All\Cars & Tracks + 8104ACA6 0001 + cn Access All\Cups + 5000032C 0000 + 810542FA 00FF + cn Always 1st + 8111565E 0001 + 81115666 0000 + 8110C1EE 02F4 + cn Infinite Continues + 8110C1E2 0006 + cn Drones Have No Weapons + 8111CD7E 0000 + cn Infinite Weapons\Player 1 + 81115648 0000 + 8111564A ???? 0000:"Green Missile",0001:"Orange Missile",0002:"Multi-Orange Missiles",0003:"The Bomb",0004:"Water Balloon",0005:"Blue Protector",0006:"Oil Slick",0007:"Bowling Ball Mine",0008:"Yellow Protector",0009:"Lightning Bolt",000A:"Orange Star",000B:"Beach Ball" + 8111564E 0001 + cn Laps To Race + 8107DBCE ???? 0001:"1 Lap",0002:"2 laps",0003:"3 Laps",0004:"4 Laps",0005:"5 Laps",0006:"6 Laps",0007:"7 Laps",0008:"8 Laps",0009:"9 Laps" + cn Number Of Drones In The Race + 8110FEA6 ???? 0001:"1 Drone",0002:"2 Drones",0003:"3 Drones",0004:"4 Drones",0005:"5 Drones",0006:"6 Drones",0007:"7 Drones",0008:"8 Drones",0009:"9 Drones" + cn 99 Points Player 1 + 8010C1EF 0063 + cn Infinite Weapons\Player 2 + 81117B10 0000 + 81117B12 ???? 0000:"Green Missile",0001:"Orange Missile",0002:"Multi-Orange Missiles",0003:"The Bomb",0004:"Water Balloon",0005:"Blue Protector",0006:"Oil Slick",0007:"Bowling Ball Mine",0008:"Yellow Protector",0009:"Lightning Bolt",000A:"Orange Star",000B:"Beach Ball" + 81117B16 0001 + cn Infinite Weapons\Player 3 + 81119FD8 0000 + 81119FDA ???? 0000:"Green Missile",0001:"Orange Missile",0002:"Multi-Orange Missiles",0003:"The Bomb",0004:"Water Balloon",0005:"Blue Protector",0006:"Oil Slick",0007:"Bowling Ball Mine",0008:"Yellow Protector",0009:"Lightning Bolt",000A:"Orange Star",000B:"Beach Ball" + 81119FDE 0001 + cn Infinite Weapons\Player 4 + 8111C4A0 0000 + 8111C4A2 ???? 0000:"Green Missile",0001:"Orange Missile",0002:"Multi-Orange Missiles",0003:"The Bomb",0004:"Water Balloon",0005:"Blue Protector",0006:"Oil Slick",0007:"Bowling Ball Mine",0008:"Yellow Protector",0009:"Lightning Bolt",000A:"Orange Star",000B:"Beach Ball" + 8111C4A6 0001 + +crc 0B6B4DDB-9671E682-C:45 +gn Roadsters Trophy (U) (M3) + cn Cheats Enabled Modifier + 8108F840 ???? 0004:"Fast Bucks (You Get 250",0008:"Easy Money (You Get 1",0010:"Trophies (Second And Third Championships Wins)",0020:"Smurfing (High Pitched Voices)",0040:"Big Wheels (Big Foot Cars)",0080:"Skywalker (Hover Cars)",0100:"Car Radio (Remote Control Cars)",0200:"Chopper (Top Down View)",0400:"Anyway (Race Circuits Backwards)",0800:"Extra Resolution (Able To Change Resolution In Options Screen)" + +crc F050746C-247B820B-C:45 +gn ROAD RASH 64 + cn Always 1st + 810D7856 0000 + cn Always Have\Max Cash + 810D6A7A FFFF + cn Access\All Bikes & Tracks + 800A77D5 0063 + cn Access\Infinite & All Weapons + 50000E02 0000 + 811B8D7A 0505 + cn Infinite\Damage + 801C0D17 0002 + cn Infinite\Health\To Bike + 811B8A38 42F0 + 811B8A3C 42F0 + cn Infinite\Health\To Character + 811BFE10 4489 + 811BFE12 8000 + cn Always Have\Weapon + 801C00B3 ???? 0001:"Fists",0002:"Spiked Club",0003:"Tiring Iron",0004:"Bat",0005:"Billie Club",0006:"Sledge Hammer",0007:"Pool Cue",0008:"Monkey Wrench",0009:"Banana",000A:"Cattle Prod",000B:"Taser",000C:"Bace",000D:"Nunchuk",000E:"Chain" + +crc AC8E4B32-E7B47326-C:45 +gn Robotron 64 (U) + cn Infinite Lives + 8009B1AF 0009 + cn Max Score + 8009B1AA 00FF + cn Level Select In Setup Menu + 81076FF6 6F8C + +crc 0C5EE085-A167DD3E-C:45 +gn Rocket: Robot On Wheels (U) + cn Infinite\Max Health + 8109F702 000C + 8109F706 000C + cn Max\Tinker Toys + 810A599E 270F + cn Max\Ticket Switches + 810A59A2 00C8 + cn Have All\Machine Parts + 810A5960 FFFF + cn Have All\Vechicles + 810A5968 FFFF + cn Activate Cheat + 810A63C6 F5FF + cn Whoopie World\Max Tickets + 810A58F0 FFFF + 810A58F2 FFFF + 810A58F4 FFFF + 810A58F6 FFFF + 810A58F8 FFFF + 810A58FA FFFF + 810A58FC FFFF + cn Whoopie World\Infinite Time + 810A58FE FFFF + cn Clowney Island\Max Tickets + 810A5900 FFFF + 810A5902 FFFF + 810A5904 FFFF + 810A5906 FFFF + 810A5908 FFFF + 810A590A FFFF + 810A590C FFFF + cn Clowney Island\Infinite Time + 810A590E FFFF + cn Paint Misbehaving\Max Tickets + 810A5910 FFFF + 810A5912 FFFF + 810A5914 FFFF + 810A5916 FFFF + 810A5918 FFFF + 810A591A FFFF + 810A591C FFFF + cn Paint Misbehaving\Infinite Time + 810A591E FFFF + cn Mine Blowing\Max Tickets + 810A5920 FFFF + 810A5922 FFFF + 810A5924 FFFF + 810A5926 FFFF + 810A5928 FFFF + 810A592A FFFF + 810A592C FFFF + cn Mine Blowing\Infinite Time + 810A592E FFFF + cn Arabian Flights\Max Tickets + 810A5930 FFFF + 810A5932 FFFF + 810A5934 FFFF + 810A5936 FFFF + 810A5938 FFFF + 810A593A FFFF + 810A593C FFFF + cn Arabian Flights\Infinite Time + 810A593E FFFF + cn Pyramid Scheme\Max Tickets + 810A5940 FFFF + 810A5942 FFFF + 810A5944 FFFF + 810A5946 FFFF + 810A5948 FFFF + 810A594A FFFF + 810A594C FFFF + cn Pyramid Scheme\Infinite Time + 810A594E FFFF + cn Food Fright\Max Tickets + 810A5950 FFFF + 810A5952 FFFF + 810A5954 FFFF + 810A5956 FFFF + 810A5958 FFFF + 810A595A FFFF + 810A595C FFFF + cn Food Fright\Infinite Time + 810A595E FFFF + +crc 2500267E-2A7EC3CE-C:45 +gn RR64 - Ridge Racer 64 (U) + cn All Modes\Always Have 1st Place + 81056444 0001 + cn All Modes\Infinite Time + 811269CA 0700 + cn All Modes\Press R Button For Turbo + D103E1EA 0010 + 8105641A 0800 + cn Grand Prix Mode\Car Modifier + 8113CF5A ???? 0000:"F/A Racing",0001:"RT Ryukyu",0002:"PAC Racing",0003:"RT Solvalou",0004:"RT Pink Mappy",0005:"RT Blue Mappy",0006:"Galaga RT Prid's",0007:"Galaga RT Carrot",0008:"RT Bosconian",0009:"RT Nebulasray",000A:"RT Xevious Red",000B:"RT Xevious Green",000C:"Dig Racing Team",000D:"Micro Mouse Mappy",000E:"13th Racing Kid",000F:"White Angel",0010:"Digipen Racing",0011:"Assoluto Infinito",0012:"Age Solo Supernova",0013:"Atomic Purple",0014:"Extreme Green",0015:"Terrazi Terrific",0016:"Lizard Nightmare",0017:"Screamin' Eagle",0018:"Ultra 64 (Full Stats)",0019:"00-Agent",001A:"Galaga' 88",001B:"Blinky",001C:"Red Shirt Rage",001D:"Crazy Canuck",001E:"Caddy Car",001F:"Pooka" + cn Grand Prix Mode\Track Modifier + 8113CF6A ???? 0000:"Ridge Racer Novice",0001:"Revolution Novice",0002:"Renegade Novice",0003:"Ridge Racer Intermediate",0004:"Revolution Intermediate",0005:"Renegade Intermediate",0006:"Ridge Racer Expert",0007:"Revolution Expert",0008:"Renegade Expert",0009:"Ridge Racer Extreme" + cn Grand Prix Mode\Enlarge Cars + 81119758 3FC0 + 811197AC 3FC0 + 81119800 3FC0 + cn Grand Prix Mode\Shrink Cars + 80119758 003E + 801197AC 003E + 80119800 003E + cn Grand Prix Mode\Microscopic Cars + 80119758 003D + 801197AC 003D + 80119800 003D + cn Grand Prix Mode\2 Tier Cars + 80119BB0 0039 + cn Grand Prix Mode\Press GS For Overhead View + 8811AB0F 0002 + cn Grand Prix Mode\Unlock\All Engine Classes All Levels + 50001E08 0000 + 8102FAB0 0004 + 50001E08 0000 + 8102FAB2 0403 + cn Grand Prix Mode\Unlock\All Cars + 8102F19C FFFF + 8102F19E FFFF + cn Grand Prix Mode\Unlock\All Tracks & Trophies + 81043530 FFFF + 81043532 FFFF + cn Grand Prix Mode\Laps to Race + 8111B32E ???? 0101:"lap",0202:"laps",0303:"laps",0404:"laps",0505:"laps",0606:"laps",0707:"laps",0808:"laps",0909:"laps" + cn Grand Prix Mode\All Cars Have Perfect Stats + 50008002 0000 + 8102F314 05DC + +crc 1FC21532-0B6466D4-C:45 +gn Rugrats in Paris - The Movie (U) + cn Red Tickets\Player 1 + D00BE8C1 0000 + 8111F7F6 02F4 + cn Gold Tickets\Player 1 + D00BE8C1 0000 + 8111F7F8 02F4 + cn Red Tickets\Player 2 + D00BE8C1 0001 + 8111F7F6 02F4 + cn Gold Tickets\Player 2 + D00BE8C1 0001 + 8111F7F8 02F4 + cn Red Tickets\Player 3 + D00BE8C1 0002 + 8111F7F6 02F4 + cn Gold Tickets\Player 3 + D00BE8C1 0002 + 8111F7F8 02F4 + cn Red Tickets\Player 4 + D00BE8C1 0003 + 8111F7F6 02F4 + cn Gold Tickets\Player 4 + D00BE8C1 0003 + 8111F7F8 02F4 + +crc EDD6E031-68136013-C:45 +gn Rush 2 - Extreme Racing USA (U) + cn Always Place 1st + 80112589 0000 + cn Have\Extra Cars + 50000902 0000 + 810C1DBC FFFF + cn Have\Game Timer Off + 800D9E88 0001 + cn Have\Midway Track + 800E7D19 0001 + cn Have\Stunts All Tracks + 8010C200 0001 + cn Press R to Shrink Car + D00D0193 0010 + 8010C43C 0001 + cn Track Modifier + 8010C3F0 ???? 0000:"Las Vegas",0001:"New York Downtown",0002:"Hawaii",0003:"New York Uptown",0004:"Alcatraz",0005:"Los Angeles",0006:"Seattle",0007:"Half Pipe",0008:"Crash",0009:"Pipe",000A:"Midway",000B:"Stunt" + cn Best Points\In Stunt Mode\Player 1 + 8010C068 00FF + cn Total Points\In Stunt Mode\Player 1 + 8010C075 00FF + cn Best Points\In Stunt Mode\Player 2 + 8010C069 00FF + cn Total Points\In Stunt Mode\Player 2 + 8010C077 00FF + cn Car Select\Player 1 + 803CB362 ???? 0000:"Pickup",0001:"Compact",0002:"Muscle Car",0003:"Mobster",0004:"Sedan",0005:"Bandit",0006:"Coupe",0007:"Exotic",0008:"Van",0009:"Sportster",000A:"Subcompact",000B:"Concept",000C:"Stallion",000D:"Cruiser",000E:"Stallion",000F:"4x4",0010:"Taxi",0011:"Hot Rod",0012:"Formula",0013:"Prototype",0014:"Rocket",0015:"Mtn Dew" + cn Car Select\Player 2 + 803CB363 ???? 0000:"Pickup",0001:"Compact",0002:"Muscle Car",0003:"Mobster",0004:"Sedan",0005:"Bandit",0006:"Coupe",0007:"Exotic",0008:"Van",0009:"Sportster",000A:"Subcompact",000B:"Concept",000C:"Stallion",000D:"Cruiser",000E:"Stallion",000F:"4x4",0010:"Taxi",0011:"Hot Rod",0012:"Formula",0013:"Prototype",0014:"Rocket",0015:"Mtn Dew" + cn Press R For Nitrous Boost + D00D0193 0010 + 810F58DC 44CB + D00D0193 0010 + 810F5938 44CB + cn Have\All Keys & Cans\Midway Track + 810C1DD0 FFFF + cn Have\All Keys & Cans\Stunt Track + 810C1DD2 FFFF + cn Front Pickup Tire Size\Player 1 + 800C0AC5 ???? 0000:"Tiny",0001:"Medium",00FF:"Gigantic" + cn Rear Pickup Tire Size\Player 1 + 800C0BCD ???? 0000:"Tiny",0001:"Medium",00FF:"Gigantic" + cn Mt. Dew Front Tire Size\Player 1 + 800C0B19 ???? 0000:"Tiny",0001:"Medium",00FF:"Gigantic" + cn Mt. Dew Rear Tire Size\Player 1 + 800C0C21 ???? 0000:"Tiny",0001:"Medium",00FF:"Gigantic" + cn Rocket Front Tire Size\Player 1 + 800C0B15 ???? 0000:"Tiny",0001:"Medium",00FF:"Gigantic" + cn Rocket Rear Tire Size\Player 1 + 800C0C1D ???? 0000:"Tiny",0001:"Medium",00FF:"Gigantic" + cn Prototype Front Tire Size\Player 1 + 800C0B11 ???? 0000:"Tiny",0001:"Medium",00FF:"Gigantic" + cn Prototype Rear Tire Size\Player 1 + 800C0C19 ???? 0000:"Tiny",0001:"Medium",00FF:"Gigantic" + cn Formula Front Tire Size\Player 1 + 800C0B0D ???? 0000:"Tiny",0001:"Medium",00FF:"Gigantic" + cn Formula Rear Tire Size\Player 1 + 800C0C15 ???? 0000:"Tiny",0001:"Medium",00FF:"Gigantic" + cn Hot Rod Front Tire Size\Player 1 + 800C0B09 ???? 0000:"Tiny",0001:"Medium",00FF:"Gigantic" + cn Hot Rod Rear Tire Size\Player 1 + 800C0C11 ???? 0000:"Tiny",0001:"Medium",00FF:"Gigantic" + cn Cruiser Front Tire Size\Player 1 + 800C0AF9 ???? 0000:"Tiny",0001:"Medium",00FF:"Gigantic" + cn Cruiser Rear Tire Size\Player 1 + 800C0C01 ???? 0000:"Tiny",0001:"Medium",00FF:"Gigantic" + cn Van Front Tire Size\Player 1 + 800C0AE5 ???? 0000:"Tiny",0001:"Medium",00FF:"Gigantic" + cn Van Rear Tire Size\Player 1 + 800C0BED ???? 0000:"Tiny",0001:"Medium",00FF:"Gigantic" + cn Pickup Front Tire Size\Player 2 + 800C0B1D ???? 0000:"Tiny",0001:"Medium",00FF:"Gigantic" + cn Rear Tire Size\Player 2 + 800C0C25 ???? 0000:"Tiny",0001:"Medium",00FF:"Gigantic" + cn Misc\Auto Abort Disable + 8010C168 0001 + cn Misc\Resurrect In Place + 8010C210 0001 + cn Misc\New York Cabs + 800D9E89 0001 + cn Misc\Car Collisions Off + 8011249A 0001 + cn Misc\Cone Mines On + 8010C166 0001 + cn Misc\Car Mines On + 8010C167 0001 + cn Misc\Super Speed + 80111950 0001 + cn Misc\Damage Off + 8011CDB0 0001 + cn Misc\Light Gravity + 800E7D22 0000 + cn Misc\Heavy Gravity + 800E7D22 0002 + cn Misc\Jovian Gravity + 800E7D22 0003 + cn Misc\Brakes Off + 80125C64 0001 + cn Misc\Heavy Mass + 8010C179 0001 + cn Misc\Massive Mass + 8010C179 0002 + cn Misc\Invincible + 80119634 0001 + cn Misc\Invisible Cars + 8010C170 0001 + cn Misc\Invisible Tracks + 8010C178 0001 + cn Misc\Large Frame + 8010C43C 0003 + cn Misc\Killer Rats On + 8010C17C 0001 + cn Misc\Inside-Out Car On + 801174E0 0001 + cn Misc\Upside Down Mode + 800D0171 0001 + cn Misc\Suicide Mode On + 80119628 0001 + cn Misc\Suicide Mode Humans On + 80119628 0002 + cn Misc\Levitation + 8010C254 0001 + cn Misc\Super Tires + 8010D3A6 0002 + cn Misc\Have All Cars In Pipe + 810C1DCE FFFF + cn Press GS Activate Cheat Menu + 880C2132 0001 + cn Misc\Your Car Is Invisible + 801127A1 0001 + cn Misc\Laps to Race + 8010C0E3 ???? 0001:"1 Lap",0002:"2 Laps",0003:"3 Laps",0004:"4 Laps",0005:"5 Laps",0006:"6 Laps",0007:"7 Laps",0008:"8 Laps",0009:"9 Laps" + cn Misc\Drones In Race + 800D5761 ???? 0001:"1 Lap",0002:"2 Laps",0003:"3 Laps",0004:"4 Laps",0005:"5 Laps",0006:"6 Laps",0007:"7 Laps" + cn Misc\Difficulty Mod + 8010C211 ???? 0000:"Very Easy",0001:"Easy",0002:"Medium",0003:"Hard",0004:"Very Hard",0005:"Extremely Hard" + cn Unlock All Cheats + 50000E02 0000 + 810C20E8 0101 + cn Have All Keys Found\Las Vegas Normal + 810C1DBC FFFF + cn Have All Keys Found\New York-Downtown\Normal + 810C1DBE FFFF + cn Have All Keys Found\Hawaii\Normal + 810C1DC0 FFFF + cn Have All Keys Found\New York-Uptown\Normal + 810C1DC2 FFFF + cn Have All Keys Found\Alcatraz\Normal + 810C1DC4 FFFF + cn Have All Keys Found\Los Angeles\Normal + 810C1DC6 FFFF + cn Have All Keys Found\Seattle\Normal + 810C1DC8 FFFF + +crc 769147F3-2033C10E-C:45 +gn SCARS (U) + cn Have All\Cars + 50000402 0000 + 803DF94B 0001 + cn Have All\Cups,Tracks & Challenges + 50000302 0000 + 802CB4A9 0001 + 50000402 0000 + 803DD109 0001 + cn Infinite Credits + 80388C1D 0009 + cn Max Score Points + 8139AFB6 02F4 + cn Game Speed + 802C9339 ???? 0000:"Novice",0001:"Default",0002:"Advanced",0003:"Master" + cn Always Have Equipped\Player 1 + 8039B144 ???? + 8039B147 ???? 0000:"Turbo",0001:"Magnet",0003:"Stinger",0004:"Boomerang",0005:"Seeker",0006:"Stopper",0007:"Bullets",0008:"Shield" + 8039B149 0009 + cn Always Have Equipped\Player 2 + 8039B3E4 ???? + 8039B3E7 ???? 0000:"Turbo",0001:"Magnet",0003:"Stinger",0004:"Boomerang",0005:"Seeker",0006:"Stopper",0007:"Bullets",0008:"Shield" + 8039B3E9 0009 + cn Always Have Equipped\Player 3 + 8039B684 ???? + 8039B687 ???? 0000:"Turbo",0001:"Magnet",0003:"Stinger",0004:"Boomerang",0005:"Seeker",0006:"Stopper",0007:"Bullets",0008:"Shield" + 8039B689 0009 + cn Always Have Equipped\Player 4 + 8039B924 ???? + 8039B927 ???? 0000:"Turbo",0001:"Magnet",0003:"Stinger",0004:"Boomerang",0005:"Seeker",0006:"Stopper",0007:"Bullets",0008:"Shield" + 8039B929 0009 + +crc 2A6B1820-6ABCF466-C:45 +gn San Francisco Rush - Extreme Racing (U) + cn Activate\Stop Timer + 800F4090 0001 + cn Activate\Auto Abort Disable + 800F4078 0001 + cn Activate\Cones to Mines + 800F3F88 0001 + cn Activate\Disable Car 2 Car Control + 800F4050 0001 + cn Activate\Resurrect in Place + 800F4080 0001 + cn Activate\Upside Down Mode + 800F4061 0001 + cn Car + D00F40A5 0020 + 800D9EC1 ???? + 800D9F64 ???? + 800DA078 ???? + 800DA321 ???? 0008:"Taxi",0009:"Hot Rod",000A:"F1 Car" + cn Edge Boost + cd by pressing R you will get a small speed boost that pushes you ahead. + D00F40A5 0010 + 81101331 FFFF + cn Car Type + cd It gets you from 0-150 in the the time it takes the F1 racer to. Don't use the F1 racer and only hold until you reach 150 or the game will freeze. + 800F40B1 ???? 0000:"Normal Car",0001:"Flat Car",0002:"Fat Car",0003:"Giant Car",000A:"Invisible Car",0044:"Super-Tiny Car #2",0066:"Paper-Thin Cars",006E:"Screen-Talled Cars",00BB:"Super-Sky Car",00CD:"Invisible Car (Can See Wheels)",00DD:"Super-Sky Car #2",00FF:"Super-Tiny Car" + cn Press GS For Track Select + cd With this code, press GS when on the track selction screen and press A to select that track! + 88100050 ???? 0000:"Track 1",0001:"Track 2",0002:"Track 3",0003:"Track 4",0004:"Track 5",0005:"Track 6",0006:"Track 7" + cn Gravity + 800F3D91 ???? 0000:"A Balloon & 2 Weights",0001:"Normal",0002:"1 Weight",0003:"2 Weights" + cn Always Place 1st + 80101339 0000 + cn Have Two Special Cars + cd You receive the Hotrod and Taxi with this code, but you may have to go through the cars from the "Beginning" past the "Extreme" for them to appear. + 810CAC82 FFFF + 810CAC98 FFFF + 810CACAE FFFF + 810CACC4 FFFF + 810CACDA FFFF + 810CACF0 FFFF + +crc B9A9ECA2-17AAE48E-C:45 +gn San Francisco Rush 2049 (U) + cn Unlock All Cheats + 50000B02 0000 + 8111648C 0101 + cn Speed Activator + D0037AA4 0020 + 8114A298 ???? 4333:"146 mph",4350:"170 mph",4380:"210 mph",4393:"270 mph" + cn Always Place 1st + 80152906 0000 + cn Start On Lap Modifier + D014AA38 0000 + 8014AA38 ???? + cn Track Modifier + 8014978C ???? 0000:"Track 1",0001:"Track 2",0002:"Track 3",0003:"Track 4" + cn Max Score\Stunt Mode + 8115204E 7FFF + cn Infinate Ammo\All Players In Battle + 80152B9D 0050 + 80152F55 0050 + 8015330D 0050 + 801536C5 0050 + cn Have All\Gold & Silver Coins\Track 1 + 8113A110 FFFF + cn Have All\Gold & Silver Coins\Track 3 + 8113A1D0 FFFF + cn Have All\Gold & Silver Coins\Track 4 + 8113A230 FFFF + cn Have All\Gold & Silver Coins\Track 5 + 8113A290 FFFF + cn Have All\Gold & Silver Coins\Track 6 + 8113A2F0 FFFF + +crc 0C814EC4-58FE5CA8-C:45 +gn Scooby-Doo - Classic Creep Capers (U) + cn Infinite Health + 81086BCA 0038 + 800BAF97 0007 + +crc 036897CE-E0D4FA54-C:45 +gn ShadowGate 64 - Trials of the Four Towers (U) + cn Item Modifier Codes\Position 01 + 800EC350 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 02 + 800EC351 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 03 + 800EC352 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 04 + 800EC353 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 05 + 800EC354 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 06 + 800EC355 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 07 + 800EC356 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 08 + 800EC357 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 09 + 800EC358 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 10 + 800EC359 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 11 + 800EC35A ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 12 + 800EC35B ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 13 + 800EC35C ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 14 + 800EC35D ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 15 + 800EC35E ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 16 + 800EC35F ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 17 + 800EC360 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 18 + 800EC361 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 19 + 800EC362 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 20 + 800EC363 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 21 + 800EC364 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 22 + 800EC365 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 23 + 800EC366 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 24 + 800EC367 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 25 + 800EC368 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 26 + 800EC369 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 27 + 800EC36A ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 28 + 800EC36B ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 29 + 800EC36C ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 30 + 800EC36D ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 31 + 800EC36E ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 32 + 800EC36F ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 33 + 800EC370 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 34 + 800EC371 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 35 + 800EC372 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 36 + 800EC373 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 37 + 800EC374 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 38 + 800EC375 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 39 + 800EC376 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 40 + 800EC377 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 41 + 800EC378 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 42 + 800EC379 ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 43 + 800EC37A ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 44 + 800EC37B ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 45 + 800EC37C ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 46 + 800EC37D ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 47 + 800EC37E ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn Item Modifier Codes\Position 48 + 800EC37F ???? 0001:"Crest Key",0002:"Bottle of Oil",0003:"Fragments of A Crest",0004:"Dragon Tears",0005:"Pixie Flute",0006:"Treasure",0007:"Rusty Key",0008:"Ornate Key",0009:"The Ring of The Kingdom",000A:"Orb",000B:"Golden Key",000C:"Liquid Sunset",000D:"Night Elixir",000E:"Forest Nectar",000F:"Primitive Man Statue",0010:"Apeman Sculpture",0011:"Fairy Sculpture",0012:"Elf Statue",0013:"Ancient Coin",0014:"Pick Axe",0015:"The Ring of The Dead",0016:"The Blue Ring",0017:"The Green Ring",0018:"Lever",0019:"Slipper",001A:"Dirty Slipper",001B:"Pair of Slippers",001C:"Jezibel's Pendant",001D:"The Staff of Ages",001E:"Rope",001F:"Cemetery Key",0020:"Flower",0021:"Flint",0022:"Fang",0023:"Dragon Eye",0024:"Dragon Flute",0025:"Burning Candle",0026:"Chipped Violin",0027:"String-Less Violin",0028:"Broken Violin",0029:"Dungeon Key",002A:"Map",002B:"Bone",002C:"Starcrest",002D:"Iron Bar",002E:"Crow Bar",002F:"Hair of Giant",0030:"Mug",0031:"Water",0032:"Water W/Dragon Tears",0033:"Stone of Thirst",0034:"Coin",0035:"Coin",0036:"Coin",0037:"Coin",0038:"Coin",0039:"Nail",003A:"Brooch",003B:"Jewelry Box",003C:"Fruit",003D:"Gauntlet",003E:"Cup",003F:"Artwork",0040:"Poisonous Herb",0041:"Bracelet",0042:"Precious Stone",0043:"Broken Sword",0044:"Quill",0045:"Plate",0046:"Broken Lance" + cn All Items + 50002402 0202 + 810EC350 0001 + 50004601 0000 + 800EC3D1 0003 + +crc 3A4760B5-2D74D410-C:45 +gn Shadowman (U) + cn Infinite\Air + 81075B1C 0000 + 81075B1E 2710 + cn Infinite\Health + 81075B18 0000 + 81075B1A 2710 + 81075B14 0000 + 81075B16 2710 + cn All Cheats Book of Shadows + 81030690 0004 + 81030692 030B + cn Max Shadow Charge & Level + 81075B20 0000 + 81075B22 2710 + 81075B24 0000 + 81075B26 2710 + cn Max Dark Souls Collected + 81075F48 0078 + cn Health Meter Displayed On Screen + 81075B10 0000 + 81075B12 00FF + cn Have All\Items + 81030630 0000 + 81030632 100B + 81030650 0016 + 81030652 130B + 81030670 0018 + 81030672 150B + 81030690 0004 + 81030692 030B + 810306B0 001D + 810306B2 180B + 810306D0 0001 + 810306D2 000B + 810306F0 000A + 810306F2 080B + 81030710 0002 + 81030712 010B + 81030730 000C + 81030732 0E0B + 81030750 000E + 81030752 0A0B + 81030770 0009 + 81030772 070B + 81030790 000B + 81030792 090B + 810307B0 0007 + 810307B2 060B + 810307D0 001A + 810307D2 160B + 810307F0 0015 + 810307F2 120B + 81030810 001E + 81030812 190B + 810308B0 0017 + 810308B2 140B + 81030830 0012 + 81030832 0F0B + 81030850 0003 + 81030852 020B + 81030870 000D + 81030872 0B0B + 810308F0 0006 + 810308F2 050B + 81030950 0014 + 81030952 110B + 810309D0 0005 + 810309D2 040B + 80030E57 000F + cn Have All\Ammo + 81075B28 0000 + 81075B2A 2710 + 81075B2E 0063 + 81075B36 03E7 + 81075B32 03E7 + 81075B3A 03E7 + 810306D6 7FFF + 81030736 7FFF + 810307D6 7FFF + 81030816 7FFF + 81030876 7FFF + 81030816 7FFF + 810306D6 FFFF + 81030736 FFFF + 810307D6 FFFF + 81030816 FFFF + 81030876 FFFF + 81030816 FFFF + cn Have All\Warp Levals + 800309F2 0001 + 80030A0E 0001 + 80030A2A 0001 + 80030A46 0001 + 80030A62 0001 + 80030A7E 0001 + 80030A9A 0001 + 80030AB6 0001 + 80030AD2 0001 + 80030AEE 0001 + 80030B0A 0001 + 80030B26 0001 + 80030B42 0001 + 80030B5E 0001 + 80030B7A 0001 + 80030B96 0001 + 80030BB2 0001 + cn Always Play As Deadwing Character + 80075F52 0001 + cn Have L-Eclipser\La Lune + cd If you put all Three of these Options on together, you skip straight to being Shadow Man. + 80030971 0010 + 80030973 0D0B + cn Have L-Eclipser\La Soleil + cd If you put all Three of these Options on together, you skip straight to being Shadow Man. + 80030991 001C + 80030993 170B + cn Have L-Eclipser\La Lame + cd If you put all Three of these Options on together, you skip straight to being Shadow Man. + 800309B1 0011 + 800309B3 0C0B + +crc DBF4EA9D-333E82C0-C:45 +gn Snowboard Kids (U) + cn Infinite\Tools Options + 80122295 ???? 0001:"Fan",0002:"Ghost",0003:"Pan",0004:"Rock",0005:"Mouse",0006:"Board" + cn Infinite\Lucky Dip + cd "Lucky Dip is Infinite Usage Of What Ever You Get From Each Red Box" + 80122294 0003 + cn 999 Trick Game Pts + 81122040 03E7 + cn 1 Lap Race + D0122288 0000 + 80122288 0009 + cn Infinite\Cash + 801222EA C350 + cn Enable Sinobin + 8110AE5E 0100 + cn Access Gold Medals + 50000602 0000 + 810ECA22 0101 + +crc 930C29EA-939245BF-C:45 +gn Snowboard Kids 2 (U) + cn All Gold Medals + 50000502 0000 + 81259130 0101 + cn Max Coins + 8125A5BE 270F + 8025A5BF 00C8 + cn Infinite\Trick Game 300 Points + 8125A7F2 012C + cn Infinite\Tools Options + 8025A624 ???? 0001:"Frying Pan",0002:"Ghost",0003:"Super Ghost",0004:"Fan",0005:"Rocket",0006:"Invisible",0007:"Rock",0008:"Rat Face",0009:"Super Rat Face",000A:"Wings" + cn Infinite\Weapons Options + 8025A622 ???? 0001:"Slap Stick",0002:"Parachute",0003:"Freeze Shot",0004:"Snowman",0005:"Bomb",0006:"Whirlwind" + 8025A623 0009 + cn Open Extra Characters & Snowboards + cd Battle Mode Only + 8125916E 0101 + 80259170 0001 + 8025915C 0001 + 8125915E 0101 + 81259160 0101 + +crc 7ECBE939-3C331795-C:45 +gn South Park (U) + cn Have all Cheats + cd Go into the Cheats From the main Menu & put on the Ones you want + 810CD226 01FF + +crc C00CA948-8E60D34B-C:45 +gn South Park - Chef's Luv Shack (U) + cn Max Or No Score\Player 1 + 81104772 ???? FFFF:"Max Score",0000:"No Score" + cn Max Or No Score\Player 2 + 81104776 ???? FFFF:"Max Score",0000:"No Score" + cn Max Or No Score\Player 3 + 8110477A ???? FFFF:"Max Score",0000:"No Score" + cn Max Or No Score\Player 4 + 8110477E ???? FFFF:"Max Score",0000:"No Score" + +crc 07F3B276-EC8F3D39-C:45 +gn South Park Rally (U) + cn Unlock All Characters & Extra Cheats + 81088750 FFFF + 81088752 FFFF + cn Have All\Races + 81088756 FFFF + cn Have All\Tracks + 8108875A FFFF + cn Infinite Credits + 8008D659 0063 + +crc BFE23884-EF48EAAF-C:45 +gn Silicon Valley (U) + cn Infinite\Ability\Sheep + 811DE9A0 0400 + cn Infinite\Ability\Mouse + 811DFCC8 0400 + cn Infinite\Boost\Mouse + 811DFCC4 0400 + cn Infinite\Ability\Penguin + 811E009C 0400 + cn Infinite\Ability\Husky + 811DED78 0400 + cn Infinite\Ability\Rabbit + 811DE5D0 0400 + cn Infinite\Ability\Heli-Rabbit + 811DF14C 0400 + cn Infinite\Boost\Walrus + 811DED74 0400 + cn Infinite\Ability\Walrus + 811DE5D0 0400 + cn Infinite\Ability\Racing Dog + 811DF14C 0400 + cn Infinite\Boost\Racing Dog + 811DF148 0400 + cn Infinite\Ability\Ram + 811DE5D0 0400 + cn Infinite\Ability\Racing Fox + 811DF8F4 0082 + cn Infinite\Boost\Racing Fox + 811DF8F0 0400 + cn Infinite\Ability\Springy Thing + 811DF14C 0400 + cn Infinite\Ability\Fox + 811DF8F4 0400 + cn Infinite\Boost\Fox + 811DF8F0 0400 + cn Infinite\Energy\EVO (Chip) + 801DE065 0082 + cn Infinite\Energy\Evo\in Bonus Level 1 & Final Level + 801DE439 0082 + cn Infinite\Energy\Evo\In Bonus Level 4 + 801DEFB5 0082 + cn Infinite Health\Ship\in Asteroids Level + 803E4CDB 0003 + cn Infinite\Energy\Mouse,Hyena + 801DFB31 0082 + cn Infinite\Energy\Snow Husky + 811DFF04 0082 + cn Infinite\Energy\Normal Rabbit + 811DE438 0082 + cn Infinite\Energy\Heli-Rabbit + 811DEFB4 0082 + cn Infinite\Energy\Sheep + 811DEBE0 0082 + cn Infinite\Energy\Normal Penguin + 811DFF04 0082 + cn Infinite\Energy\Dog + 811DFF04 0082 + cn Infinite\Energy\Racing Dog + 811DEFB4 0082 + cn Infinite\Energy\Ram + 811DE438 0082 + cn Infinite\Energy\Racing Fox + 811DF7FC 0082 + cn Infinite\Energy\Springy Thing + 811DEFB4 0082 + cn Infinite\Energy\Fox + 811DF75C 0082 + cn Have All\Secret Mini Game + 803F643D 0001 + cn Always\Raining + 803F2D6F 0005 + cn Always\Snowing + 803F2D6D 0005 + cn Have All\Power Cells + 803F2D3D 000F + cn Debug Mode + 803F642F 0001 + cn All Levels Open + 50002001 0000 + 803F7DE0 0001 + cn High Score + 813F2D30 007F + 813F2D32 FFFF + +crc EBFE2397-FF74DA34-C:45 +gn Space Invaders (U) + cn Infinite\Lives + 800B51DD 0063 + cn Infinite\Points + 810B51E2 FFFF + cn Always Have\Vertical Burst + 810B51DE 0104 + cn Always Have\Horizontal Right + 810B51DE 0204 + cn Always Have\Horizontal Left + 810B51DE 0304 + cn Always Have\Diagonal Burst + 810B51DE 0404 + cn Infinite\Shield + 810B51B6 0001 + +crc A60ED171-3D85D06E-C:45 +gn Spider-Man (U) + cn Unlocked\All Costumes + 810ECD7E FFFF + cn Unlocked\All Levels + 810ECD74 0105 + 810ECDB0 FFFF + cn Have All Characters In Viewer + 810ECD80 FFFF + 810ECD82 FFFF + cn Infinite\Health + 800F5F26 0001 + cn Infinite\Webbing + 800F5F53 0001 + +crc 0684FBFB-5D3EA8A5-C:45 +gn StarCraft 64 (U) + cn Infinite\& Max Minerals + 50000C04 0000 + 810B1D46 FFFF + 50000C04 0000 + 810B1D44 3B9A + 50000C04 0000 + 810B1D46 C9FF + cn Infinite\& Max Vespene Gas + 50000C04 0000 + 810B1D76 FFFF + 50000D04 0000 + 810B1D74 3B9A + 50000D04 0000 + 810B1D76 C9FF + cn All levels complete + 800D13C4 000C + 800D13C5 000A + 800D13C6 000A + 800D13C7 000A + 800D13C8 000A + 800D13C9 000A + +crc A7D015F8-2289AA43-C:45 +gn Star Fox 64 (U) + cn Unlimited\Boost + 81137C9C 0000 + 81137C9E 0000 + 8113AB7C 0000 + 8113AB7E 0000 + cn Have All Medals + cd For Expert & Normal Modes + 50000802 0000 + 8116E6E0 7777 + cn Infinite\Hyper Laser + 8015791B 0002 + cn Loads O' Hits + 8015790B 00FF + cn Infinite\Armor\Slippy + 8016D72B 00FF + cn Infinite\Energy + 8013AB27 00FF + 80137C47 00FF + cn Infinite\Lives + 80157911 0009 + cn Unlimited\Smart Bombs + 8016DC13 0004 + cn Infinite\Armor\Falco + 8016D727 00FF + cn Infinite\Armor\Peppy + 8016D72F 00FF + cn Infinite\Dual Blue Lasers + 8015791B 0002 + cn Level Select + D016E0A7 0000 + 8016E0A7 ???? 0000:"Corneria",0001:"Meteo",0002:"Sector X",0003:"Area 6",0004:"Glitch",0005:"Sector Y",0006:"Venom 1",0007:"Solar",0008:"Zoness",0009:"Venom 2",000A:"Training Mode Level",000B:"Macbeth",000C:"Titania",000D:"Aquas",000E:"Fortuna",0010:"Katina",0011:"Bolse",0012:"Sector Z",0013:"Venom With Starwolf",0014:"Corneria (Multi)" + +crc BA780BA0-0F21DB34-C:45 +gn Star Fox 64 (U) (V1.1) + cn Unlimited\Boost + 8113C68C 0000 + 8113C68E 0000 + 8113F56C 0000 + 8113F56E 0000 + cn Have All Medals + cd For Expert & Normal Modes + 50000802 0000 + 81178870 7777 + cn Infinite\Dual Blue Lasers + 80161AAB 0002 + cn Loads O' Hits + 80161A9B 00FF + cn Infinite\Armor\Slippy + 801778BB 00FF + cn Infinite\Energy\Player 1 + cd For Solo & Multi Player + 8013C637 00FF + 8013F517 00FF + cn Infinite\Lives + 80161AA1 0009 + cn Unlimited\Smart Bombs + 80177DA3 0004 + cn Infinite\Armor\Falco + 801778B7 00FF + cn Infinite\Armor\Peppy + 801778BF 00FF + cn Level Select + 80178237 ???? 0000:"Corneria",0001:"Meteo",0002:"Sector X",0003:"Area 6",0004:"Glitch",0005:"Sector Y",0006:"Venom 1",0007:"Solar",0008:"Zoness",0009:"Venom 2",000A:"Training Mode Level",000B:"Macbeth",000C:"Titania",000D:"Aquas",000E:"Fortuna",0010:"Katina",0011:"Bolse",0012:"Sector Z",0013:"Venom With Starwolf",0014:"Corneria (Multi)" + cn Infinite Health\Player 2 + 8013CB17 00FF + 8013F9F7 00FF + cn Infinite Health\Player 3 + 8013CFF7 00FF + 8013FED7 00FF + cn Infinite Health\Player 4 + 8013D4D7 00FF + 801403B7 00FF + cn Infinite Smart Bombs\Player 2 + 80177DA7 0004 + cn Infinite Smart Bombs\Player 3 + 80177DAB 0004 + cn Infinite Smart Bombs\Player 4 + 80177DAF 0004 + cn Infinite Dual Blue Lasers\Player 2 + 80161AAF 0002 + cn Infinite Dual Blue Lasers\Player 3 + 80161AB3 0002 + cn Infinite Dual Blue Lasers\Player 4 + 80161AB7 0002 + cn Infinite Boost\Player 2 + 8113CB6C 0000 + 8113CB6E 0000 + 8113FA4C 0000 + 8113FA4E 0000 + cn Infinite Boost\Player 3 + 8113D04C 0000 + 8113D04E 0000 + 8113FF2C 0000 + 8113FF2E 0000 + cn Infinite Boost\Player 4 + 8113D52C 0000 + 8113D52E 0000 + 8114040C 0000 + 8114040E 0000 + +crc DDD93C85-DAE381E8-C:45 +gn Star Soldier: Vanishing Earth (U) + cn Infinite\Lives + 800A3648 0003 + cn Infinite\Specials + 800A3649 0003 + cn Extra Armor + 800A362F 0001 + cn Play As + 800A364C ???? 0000:"Character 1",0001:"Character 2",0002:"Character 3" + cn Max\Score + 810A3624 03E7 + cn Max\Upper Level + 800A3659 0063 + cn Max\Lower Level + 800A3658 0003 + cn Max\Combo + 810A3644 7FFF + cn Status Modifier + 800A364A ???? 0001:"High",0002:"Mid",0003:"Low" + +crc 72F70398-6556A98B-C:45 +gn Star Wars EP1 Pod Racer (U) + cn No Damage + cd If when Racing Your Pod Over heats & bursts into flames Press "R" & you will Repair the Damage. + 800A52D7 0001 + cn Infinite Truguts + 81113E7A FFFF + 81113E78 7FFF + cn Always 1st + 81118FEC 0001 + cn Enable In-Game cheat Menu & Cheats + cd Here you can Activate the IN-Built Cheats Menu. At the Front Screen Just Press C-Button Right.This will open up All Tracks & Characters In Free Play & Time Attack. Also In A Race, Press The Start/Pause button to Access the In-Cheat-Menu Option.You can also choose how many Pod's Racers are in the Race & also how many Laps are in the Race in Free Play & Time Attack + 8009B7D7 0001 + 8109B7DA FFFF + cn Unlock All Tracks & Characters + cd When using Unlock All Tracks & Characters For can to pick & choose what ever you want to play As & where ;) + 80113E68 00FF + 80113E69 00FF + 80113E6A 00FF + 80113E6B 00FF + 81113E68 FFFF + 81113E6A FFFF + 80113E74 007D + 81113E76 FFFF + cn Have All Tracks Completed + 81113E6A FFFF + 81113E6C 3FFF + 81113E6E 3FFF + 81113E70 3FFF + 81113E72 00FF + +crc 264D7E5C-18874622-C:45 +gn Star Wars - Shadows of the Empire (U) (V1.0) + cn All Levels\Infinite\Lives + 800E05CB 0064 + cn All Levels\Infinite\Missiles + 800E1265 00FF + cn All Stages\Invincible + 8107A770 2400 + cn All Stages\Infinite Health + 81072D0C 2400 + cn All Stages\Lasers Never Overheat + 81073948 2400 + cn All Stages\Upper Lasers + cd Don't Use With Never Overheat Code + 81073944 3C06 + 81073946 4EFF + cn All Stages\Infinite\Pulse Ammo + 81074204 2400 + cn All Stages\Infinite\Flame Ammo + 81073720 2400 + cn All Stages\Infinite\Seeker Ammo + 81073A94 2400 + cn All Stages\Infinite\Stunner Ammo + 81073BD4 2400 + cn All Stages\Infinite\Disruptor Ammo + 81073F04 2400 + cn All Stages\Infinite\Jet Pack + 81076AAC 2400 + 81076C58 2400 + 81076B48 2400 + cn All Levels\Time Always 0:00:02 + 810E04E8 4000 + cn All Levels\No Clipping\Off + 81111E67 0001 + cn All Levels\No Clipping\On + 81111E67 0000 + cn All Levels\Visibililty\Maximum + 800BA62B FFFF + cn All Levels\Visibililty\Minimum + 800BA66B FFFF + cn All Levels\Large Mutant Enemies + 800BB62B FFFF + cn All Levels\Dash Becomes Shorter & Wider + 800BA025 FFFF + cn All Levels\See Through\Some Walls + 800BC625 FFFF + cn All Levels\See Through\Everything Except Specific Things + 800BC665 FFFF + cn Press GS For Pink Cheat Debug Screen + 890D017F 0001 + +crc 4147B091-63251060-C:45 +gn Star Wars - Shadows of the Empire (U) (V1.1) + cn Press GS For Pink Cheat Debug Screen + 890D01BF 0001 + +crc 635A2BFF-8B022326-C:45 +gn SUPER MARIO 64 + cn Press GS For 255 Coins + 8933B218 00FF + cn Have\Level Select + A032D58C 0001 + cn Don't Hurt Mario\Monsters + A033B197 0001 + cn Infinite\Lives + 8033B21D 0064 + cn Infinite\Energy & Breath + 8033B21E 0008 + cn Have\Debug Mode + A032D598 ???? 0001:"On",0000:"Off" + cn Mario's Cap\Off Options + cd Here you can Choose Options with Mario without His Cap on,Do not use with any other Mario with/without Options,Use only one at a time + 8033B177 ???? 0001:"Mario No Cap",0002:"Invisible Mario",0004:"Metal Mario",0008:"Flying Mario",000A:"Invisible Flying Mario",000D:"Metal Flying Mario",000F:"Invisible Metal Flying Mario" + cn Mario's Cap\On Options + cd Here you can Choose Options with Mario with His Cap on,Do not use with any other Mario with/without Options,Use only one at a time + 8033B177 ???? 0012:"Invisible Mario",0015:"Metal Mario",0016:"Invisible Metal Mario",0019:"Flying Mario" + cn Funny Mario Options\Mario's Cap\Off & in His Hand + cd Here you can Choose Options with Mario with His Cap off & in His Hand,Do not use with any other Mario with/without Options,Use only one at a time + 8033B177 ???? 0020:"Cap In Hand",0022:"Invisible Mario Cap In Hand",0024:"Metal Mario Cap In Hand",0026:"Invisible Metal Mario Cap In Hand",0028:"Flying Mario Cap In Hand" + cn Funny Mario Options\Mario's Cap\On & An Extra in His Hand + cd Here you can Choose Options with Mario with His Cap on & An Extra in His Hand,Do not use with any other Mario with/without Options,Use only one at a time + 8033B177 ???? 0030:"Cap In Hand",0032:"Invisible Mario Cap In Hand",0034:"Metal Mario Cap In Hand",0036:"Invisible Metal Mario Cap In Hand",0038:"Flying Mario Cap In Hand" + cn Don't Hurt Mario\Falling + 8033B22C 00E8 + 8133B178 FFFF + cn Press L To Levitate + cd Press L to levitate & Let go to land + D033AFA1 0020 + 8133B1BC 4220 + D033B1BD 0020 + 8133B17C 0300 + D033B1BD 0020 + 8133B17E 0880 + cn [Slot A Codes]\Have All 120 Stars + cd Have 120 Stars,once the Code is activated, you will see it as a new option in Save Slot A.This will have the Cannon open already to get upto Yoshi on the Roof. but make sure to save the game after collecting Red Coins and turn this code off before saving. you will now have it all saved to mempak + 80207723 0001 + 8020770B 00C7 + 50001101 0000 + 8020770C 00FF + cn [Slot A Codes]\Have all key doors unlocked (and mote empty) + 8020770A 007E + cn [Slot A Codes]\Have All Max 100 Coin Records For All Levels + 50000F01 0000 + 80207725 0064 + cn [Slot B Codes]\Have All 120 Stars + cd Have 120 Stars,once the Code is activated, you will see it as a new option in Save Slot A.This will have the Cannon open already to get upto Yoshi on the Roof. but make sure to save the game after collecting Red Coins and turn this code off before saving. you will now have it all saved to mempak + 80207793 0001 + 8020777B 00C7 + 50001101 0000 + 8020777C 00FF + cn [Slot B Codes]\Have all key doors unlocked (and mote empty) + 8020777A 007E + cn [Slot B Codes]\Have All Max 100 Coin Records For All Levels + 50000F01 0000 + 80207795 0064 + cn [Slot C Codes]\Have All 120 Stars + cd Have 120 Stars,once the Code is activated, you will see it as a new option in Save Slot A.This will have the Cannon open already to get upto Yoshi on the Roof. but make sure to save the game after collecting Red Coins and turn this code off before saving. you will now have it all saved to mempak + 80207803 0001 + 802077EB 00C7 + 50001101 0000 + 802077EC 00FF + cn [Slot C Codes]\Have all key doors unlocked (and mote empty) + 802077EA 007E + cn [Slot C Codes]\Have All Max 100 Coin Records For All Levels + 50000F01 0000 + 80207805 0064 + cn [Slot D Codes]\Have All 120 Stars + cd Have 120 Stars,once the Code is activated, you will see it as a new option in Save Slot A.This will have the Cannon open already to get upto Yoshi on the Roof. but make sure to save the game after collecting Red Coins and turn this code off before saving. you will now have it all saved to mempak + 80207873 0001 + 8020785B 00C7 + 50001101 0000 + 8020785C 00FF + cn [Slot D Codes]\Have all key doors unlocked (and mote empty) + 8020785A 007E + cn [Slot D Codes]\Have All Max 100 Coin Records For All Levels + 50000F01 0000 + 80207875 0064 + cn Level Select + cd Select a Level. Jump Into a Painting. Press A at the Stars Collected Screen. As Stats are fading hold L, and you'll jump to the level you've selected. + D033AFA1 0020 + A032DDF9 ???? 0001:"Intro",0004:"Big Boo's Haunt",0005:"Cool Cool Mountain",0006:"Mushroom Castle",0007:"Hazy Maze Cave",0008:"Shifting Sand Land",0009:"Bob omb Battlefield",000A:"Snowman's Land",000B:"Wet Dry World",000C:"Jolly Roger Bay",000D:"Tiny Huge World",000E:"Tick tock Clock",000F:"Rainbow Ride",0010:"Mushroom Castle Field",0011:"Bowser In The Dark World",0012:"Vanish Cap Under The Moat",0013:"Bowser In The Fire Sea",0014:"The Secret Aquarium",0015:"Bowser In The Sky",0016:"Lethal Lava Land",0017:"Dire Dire Docks",0018:"Whomp's Fortress",0019:"The End",001A:"Castle Courtyard",001B:"The Princess's Secret Slide",001C:"Cavern Of The Metal Cap",001D:"Tower Of The Wing Cap",001E:"Bowser In The Dark World Boss",001F:"Wing Mario Over The Rainbow",0021:"Bowser In The Fire Sea Boss",0022:"Bowser In The Sky Boss",0024:"Tall Tall Mountain" + cn Have\Turbo Running Speed + 8033B1C3 00FF + +crc 916B8B5B-780B85A4-C:45 +gn SMASH BROTHERS + cn Give Kirby A Wierd Blow-Up + 8025E158 000A + cn Story Mode\Skip Straight To Master Hand + 800A4AE7 000D + cn Story Mode\Infinite Time + 810A4B2E 43CB + cn Story Mode\Player 1\Infinite Lives + 800A4B43 0004 + cn Story Mode\Player 2\Infinite Lives + 800A4BB7 0004 + cn Story Mode\Player 3\Infinite Lives + 800A4C2B 0004 + cn Story Mode\Player 4\Infinite Lives + 800A4C9F 0004 + cn Story Mode\Player 1\Low % Health + 810A4B86 0000 + cn Story Mode\Player 2\Low % Health + 810A4BFA 0000 + cn Story Mode\Player 3\Low % Health + 810A4C6E 0000 + cn Story Mode\Player 4\Low % Health + 810A4CE2 0000 + cn Story Mode\Player 1\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code could also result freezing at the end of the Level. + 800A4B3B ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn Story Mode\Player 2\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800A4BAF ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn Story Mode\Player 3\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800A4C23 ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn Story Mode\Player 4\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800A4C97 ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn Story Mode\Player 1\Kirby B Button Move\Hyrule Castle + 80268B0F ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Yoshi's Island + 80268E4F ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Sector Z + 802710F7 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Peach's Castle + 80263D9F ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Saffron City + 80273A97 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Congo Jungle + 80270ACF ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Kirby's Dreamland + 8026DB3F ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Planet Zebes + 8026FFA7 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Metal Mario Stage + 80263597 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Fighting Polygon Team + 8026271F ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Master Hand Stage + 80271C4F ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn VS. Mode\Infinite Time + 810A4D1E 43CB + cn VS. Mode\Player 1\Low % Health + 810A4D76 0000 + cn VS. Mode\Player 2\Low % Health + 810A4DEA 0000 + cn VS. Mode\Player 3\Low % Health + 810A4E5E 0000 + cn VS. Mode\Player 4\Low % Health + 810A4ED2 0000 + cn VS. Mode\Player 1\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800A4D2B ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn VS. Mode\Player 2\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800A4D9F ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn VS. Mode\Player 3\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800A4E13 ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn VS. Mode\Player 4\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800A4E87 ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn VS. Mode\Player 1\Kirby B Button Move\Hyrule Castle + 802639EF ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn VS. Mode\Player 1\Kirby B Button Move\Yoshi's Island + 8026E2B7 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn VS. Mode\Player 1\Kirby B Button Move\Sector Z + 8026BF87 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn P1 Press Down On D-Pad To Make Items Appear In Random Spots + D109EFA4 0400 + 8118D0A2 0001 + cn Have All Characters + 810A4938 0FF0 + cn VS. Mode\Have Mushroom Kindom + 800A4937 00FF + cn Story Mode\Always Get Pacifist (60,000 Points) + 810A4B6E 0000 + cn Bonus Stage Character Modifier (Training Mode) + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 8018F1D3 ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn Enable Item Switch Menu (All Modes) + cd Go into Vs Mode & then Vs Options & then Press Up On the D-Pad Or Analogue Stick & then click the A Button to enter the Item Switch Menu. This Cheat Works For All Modes + 811348E2 0004 + cn Story Mode\Player 1\Stage Select + D1045188 0010 + 800A4AE7 ???? 0000:"Stage 1 (Vs Link)",0001:"Stage 2 (Vs Yoshi Team vs 18)",0002:"Stage 3 (Vs Fox McCloud)",0003:"Bonus Stage 1",0004:"Stage 4 (Freezes?)",0005:"Stage 5 (Vs Pikachu)",0006:"Stage 6 (Freezes?)",0007:"Bonus Stage 2",0008:"Stage 7 (Vs Kirby Team vs8)",0009:"Stage 8 (Vs Samus Aran)",000A:"Stage 9 (Vs Metal Mario)",000B:"Bonus Stage 3 (Race To The Finish)",000C:"Stage 10 (Fighting Polygon Team vs30)",000D:"Final Stage (Vs Master Hand)" + +crc A2E8F35B-C9DC87D9-C:45 +gn Superman (U) + cn Fly Through 1st & Last Ring Only To Complete Challenge + 801442E9 0063 + cn Infinite Freezing Breath + 8122CDE8 42C8 + cn Infinite Health + 8122CDD4 42C8 + cn Infinite Laser Eye + 8122CDE4 42C8 + cn Infinite Running Boosts + 8122CDDC 42C8 + cn Infinite X-Ray Vision + 8122CDE0 42C8 + +crc 3C1FDABE-02A4E0BA-C:45 +gn Tetrisphere (U) + cn Single & VS Mode\Infinite Misses\Player 1 + 80112F9F 0003 + cn Single & VS Mode\Infinite Misses\Player 2 + 80116207 0003 + cn Single & VS Modes\Secret Cheat Menu + 8011265F 00AD + cn Single Player Stage Select + 810E12DC 0001 + +crc 63E7391C-E6CCEA33-C:45 +gn Tom and Jerry in Fists of Furry (U) + cn Unlock All Characters + cd This Gives you all Characters to choose from plus fixes A freeze on the Charecter Select Menu by having it on + 810E44F2 00FF + cn Open All Versus Arenas + 810E44F4 03FF + cn Infinite Health\Player 1 + 810E279C 42C8 + cn One Hit To Kill\Player 1 + 810E2A74 3F80 + cn One Hit To Kill\Player 2 + 810E2D4C 3F80 + cn Always Have Weapon Options\Player 1 + 810E2994 ???? 0079:"Anvil",0003:"Club",0004:"Bird bath",0008:"Broom",0009:"NCube knife",000A:"NCube missiles",000B:"Chair",000C:"Champagne",000E:"Chicken",000F:"Crate",0014:"Deck chair",0016:"Egg",001A:"Fish",001D:"Gardeners Fork",001E:"Frying Pan",001F:"Wooden Chair",0029:"Bouy",002A:"Mallet",002B:"Watermelon",002D:"Milk Bottle",0039:"Plank",0041:"Rolling Pin",0046:"Spade",0047:"Stool",0048:"Tennis Racket",004E:"Spanner",0055:"Stick",0063:"Blue Swordfish",0064:"Saucepan",0065:"Wooden Spoon",006B:"Stool",006D:"Bee hive",0078:"Mooses head" + cn Always Have Weapon Options\Player 2 + 810E2C6C ???? 0079:"Anvil",0003:"Club",0004:"Bird bath",0008:"Broom",0009:"NCube knife",000A:"NCube missiles",000B:"Chair",000C:"Champagne",000E:"Chicken",000F:"Crate",0014:"Deck chair",0016:"Egg",001A:"Fish",001D:"Gardeners Fork",001E:"Frying Pan",001F:"Wooden Chair",0029:"Bouy",002A:"Mallet",002B:"Watermelon",002D:"Milk Bottle",0039:"Plank",0041:"Rolling Pin",0046:"Spade",0047:"Stool",0048:"Tennis Racket",004E:"Spanner",0055:"Stick",0063:"Blue Swordfish",0064:"Saucepan",0065:"Wooden Spoon",006B:"Stool",006D:"Bee hive",0078:"Mooses head" + cn Infinite Health\Player 2 + 810E2A74 42C8 + cn Infinite Time + 810FED4C 42F0 + +crc 392A0C42-B790E77D-C:45 +gn RAINBOW SIX + cn All Missions Unlocked + 810C1F10 000B + cn Infinite Health + 8105518A 2400 + cn Infinite Ammo + 8103A180 2400 + +crc 204EC022-B119D185-C:45 + +crc 204EC022-B119D185-C:45 +gn Tony Hawk's Pro Skater (U) + cn Officer Dick\Have All\Tapes + 50000901 0000 + 800DDE08 00FF + cn Officer Dick\Have All\Gold Medal\Burnside + 800DDE0E 00FF + cn Officer Dick\Have All\Gold Medal\Skate Park + 800DDE0B 00FF + cn Officer Dick\Have All\Gold Medal\Roswell + 800DDE10 00FF + cn Tony Hawk\Have All\Tapes + 50000901 0000 + 800DDD40 00FF + cn Player 1\Super Max\Balance + 800D561F FFFF + cn Tony Hawk\Have All\Gold Medal\Skate Park Chicago + 800DDD43 00FF + cn Tony Hawk\Have All\Gold Medal\Roswell + 800DDD48 00FF + cn Bob Burnquist\Have All\Tapes + 50000901 0000 + 800DDD54 00FF + cn Bob Burnquist\Have All\Gold Medal\Burnside Portland + 800DDD5A 00FF + cn Bob Burnquist\Have All\Gold Medal\Skate Park Chicago + 800DDD57 00FF + cn Bob Burnquist\Have All\Gold Medal\Roswell + 800DDD5C 00FF + cn Geoff Rowley\Have All\Tapes + 50000901 0000 + 800DDD68 00FF + cn Geoff Rowley\Have All\Gold Medal\Burnside Portland + 800DDD6E 00FF + cn Geoff Rowley\Have All\Gold Medal\Skate Park Chicago + 800DDD6B 00FF + cn Geoff Rowley\Have All\Gold Medal\Roswell + 800DDD70 00FF + cn Bucky Lasek\Have All\Tapes + 50000901 0000 + 800DDD7C 00FF + cn Bucky Lasek\Have All\Gold Medal\Burnside Portland + 800DDD82 00FF + cn Bucky Lasek\Have All\Gold Medal\Skate Park Chicago + 800DDD7F 00FF + cn Bucky Lasek\Have All\Gold Medal\Roswell + 800DDD84 00FF + cn Chad Muska\Have All\Tapes + 50000901 0000 + 800DDD90 00FF + cn Chad Muska\Have All\Gold Medal\Burnside Portland + 800DDD96 00FF + cn Chad Muska\Have All\Gold Medal\Skate Park Chicago + 800DDD93 00FF + cn Chad Muska\Have All\Gold Medal\Roswell + 800DDD98 00FF + cn Kareem Campbell\Have All\Tapes + 50000901 0000 + 800DDDA4 00FF + cn Kareem Campbell\Have All\Gold Medal\Burnside Portland + 800DDDAA 00FF + cn Kareem Campbell\Have All\Gold Medal\Skate Park Chicago + 800DDDA7 00FF + cn Kareem Campbell\Have All\Gold Medal\Roswell + 800DDDAC 00FF + cn Andrew Reynolds\Have All\Tapes + 50000901 0000 + 800DDDB8 00FF + cn Andrew Reynolds\Have All\Gold Medal\Burnside Portland + 800DDDBE 00FF + cn Andrew Reynolds\Have All\Gold Medal\Skate Park Chicago + 800DDDBB 00FF + cn Andrew Reynolds\Have All\Gold Medal\Roswell + 800DDDC0 00FF + cn Rune Glifberg\Have All\Tapes + 50000901 0000 + 800DDDCC 00FF + cn Rune Glifberg\Have All\Gold Medal\Burnside Portland + 800DDDD2 00FF + cn Rune Glifberg\Have All\Gold Medal\Skate Park Chicago + 800DDDCF 00FF + cn Rune Glifberg\Have All\Gold Medal\Roswell + 800DDDD4 00FF + cn Jamie Thomas\Have All\Tapes + 50000901 0000 + 800DDDE0 00FF + cn Jamie Thomas\Have All\Gold Medal\Burnside Portland + 800DDDE6 00FF + cn Jamie Thomas\Have All\Gold Medal\Skate Park Chicago + 800DDDE3 00FF + cn Jamie Thomas\Have All\Gold Medal\Roswell + 800DDDE8 00FF + cn Elissa Steamer\Have All\Tapes + 50000901 0000 + 800DDDF4 00FF + cn Elissa Steamer\Have All\Gold Medal\Burnside Portland + 800DDDFA 00FF + cn Elissa Steamer\Have All\Gold Medal\Skate Park Chicago + 800DDDF7 00FF + cn Elissa Steamer\Have All\Gold Medal\Roswell + 800DDDFC 00FF + cn Have All Tracks + 813D6E42 FFFF + 813D4FFA FFFF + 813D5D62 FFFF + 813D84E2 FFFF + 813D4FCA FFFF + 813D5F2A FFFF + 813D8C52 FFFF + 813D5602 FFFF + 813D6D3A FFFF + cn Player 1\Tony Hawk\Full Special All Levels + D00C0223 0000 + 813D6576 02EE + D00C0223 0001 + 813D4728 02EE + D00C0223 0002 + 813D5496 02EE + D00C0223 0003 + 813D7C16 02EE + D00C0223 0004 + 813D467E 02EE + D00C0223 0005 + 813D565E 02EE + D00C0223 0006 + 813D8386 02EE + D00C0223 0007 + 813D4D36 02EE + D00C0223 0008 + 813D646E 02EE + cn Player 1\Max Points\The Warehouse + 813D6E42 FFFF + cn Player 1\Max Points\The School + 813D4FFA FFFF + cn Player 1\Max Points\The Mall + 813D5D62 FFFF + cn Player 1\Max Points\The Skate Park + 813D84E2 FFFF + cn Player 1\Max Points\Downtown Chicago + 813D4FCA FFFF + cn Player 1\Super Max\Turning + 800D5620 FFFF + cn Player 2\Super Max\Ollie + 800D5621 FFFF + cn Player 2\Super Max\Speed + 800D5622 FFFF + cn Player 2\Super Max\Air + 800D5623 FFFF + cn Player 2\Super Max\Balance + 800D5624 FFFF + cn Player 2\Super Max\Turning + 800D5625 FFFF + cn Player 1\Play As + 800D03D4 ???? 00 :"ony Hawk", 01 :"ob Burnquist", 02 :"eoff Rowley", 03 :"ucky Lasek", 04 :"had Muska", 05 :"areem Campbell", 06 :"ndrew Reynolds", 07 :"une Glifberg", 08 :"amie Thomas", 09 :"lissa Steamer", 0A :"fficer Dick" + cn Player 2\Play As + 800D03D5 ???? 0000:"Tony Hawk",0001:"Bob Burnquist",0002:"Geoff Rowley",0003:"Bucky Lasek",0004:"Chad Muska",0005:"Kareem Campbell",0006:"Andrew Reynolds",0007:"Rune Glifberg",0008:"Jamie Thomas",0009:"Elissa Steamer",000A:"Officer Dick" + cn Player 1\Have Perfect Balance + 800DDB83 0001 + cn Player 1\Max Trick Score\The Warehouse + 813D6E42 FFFF + cn Player 1\Max Trick Score\The School + 813D4FFA FFFF + cn Player 1\Max Trick Score\The Mall + 813D5D62 FFFF + cn Player 1\Max Trick Score\The Skate Park Course + 813D84E2 FFFF + cn Player 1\Max Trick Score\Downtown + 813D4FCA FFFF + cn Player 1\Max Trick Score\Downhill Jam + 813D5F2A FFFF + cn Player 1\Max Trick Score\Burnside + 813D8C52 FFFF + cn Player 1\Max Trick Score\The Streets + 813D5602 FFFF + cn Player 1\Max Trick Score\Roswell + 813D6D3A FFFF + +crc 99150E18-1266E6A5-C:45 +gn Tony Hawk's Pro Skater 2 (U) + cn Infinte Time + 810E87AA 0000 + cn Unlock\Spider Man + 800E9DD8 0001 + 800F0B9B 0001 + cn Unlock\Officer Dick + 800E9DDC 0001 + 800F087B 0001 + cn 1 Million Points + 8119054C 000F + 8119054E 4240 + cn All Gaps\Hanger + 800E9CC5 00FF + 810E9CC6 FFFF + cn All Gaps\Marseille + 810E9CDC FFFF + 810E9CDE FFFF + 800E9CE3 000F + cn All Gaps\Philadelphia + 810E9D0C FFFF + 810E9D0E FFFF + 810E9D12 0FFF + cn All Gaps\School II + 810E9CD0 FFFF + 810E9CD2 FFFF + 810E9CD6 0FFF + cn All Gaps\Skatestreet + 810E9D00 FFFF + 810E9D02 FFFF + 800E9D07 000F + cn All Gaps\Venice Beach + 810E9CF4 FFFF + 810E9CF6 FFFF + 810E9CFA 0FFF + cn All Tricks Available\Custom Player 1 + 810E9454 FFFF + 810E9456 FFFF + 810E9458 FFFF + 810E945A FFFF + 810E945C FFFF + 810E945E FFFF + cn All Tricks Available\Custom Player 2 + 810E9538 FFFF + 810E953A FFFF + 810E953C FFFF + 810E953E FFFF + 810E9540 FFFF + 810E9542 FFFF + cn All Tricks Available\Custom Player 3 + 810E961C FFFF + 810E961E FFFF + 810E9620 FFFF + 810E9622 FFFF + 810E9624 FFFF + 810E9626 FFFF + cn All Tricks Available\Custom Player 4 + 810E9700 FFFF + 810E9702 FFFF + 810E9704 FFFF + 810E9706 FFFF + 810E9708 FFFF + 810E970A FFFF + cn Tricks Available\Bob Burnquist + 810E89A4 FFFF + 810E89A6 FFFF + 810E89A8 FFFF + 810E89AA FFFF + 810E89AC FFFF + 810E89AE FFFF + cn Tricks Available\Chad Muska + 810E8FE0 FFFF + 810E8FE2 FFFF + 810E8FE4 FFFF + 810E8FE6 FFFF + 810E8FE8 FFFF + 810E8FEA FFFF + cn Tricks Available\Eric Koston + 810E8D34 FFFF + 810E8D36 FFFF + 810E8D38 FFFF + 810E8D3A FFFF + 810E8D3C FFFF + 810E8D3E FFFF + cn Tricks Available\Elissa Steamer + 810E928C FFFF + 810E928E FFFF + 810E9290 FFFF + 810E9292 FFFF + 810E9294 FFFF + 810E9296 FFFF + cn Tricks Available\Geoff Rowley + 810E91A8 FFFF + 810E91AA FFFF + 810E91AC FFFF + 810E91AE FFFF + 810E91B0 FFFF + 810E91B2 FFFF + cn Tricks Available\Jamie Thomas + 810E9370 FFFF + 810E9372 FFFF + 810E9374 FFFF + 810E9376 FFFF + 810E9378 FFFF + 810E937A FFFF + cn Tricks Available\Kareem Campbell + 810E8B6C FFFF + 810E8B6E FFFF + 810E8B70 FFFF + 810E8B72 FFFF + 810E8B74 FFFF + 810E8B76 FFFF + cn Tricks Available\Officer Dick + 810E97E4 FFFF + 810E97E6 FFFF + 810E97E8 FFFF + 810E97EA FFFF + 810E97EC FFFF + 810E97EE FFFF + cn Tricks Available\Rune Glifberg + 810E8C50 FFFF + 810E8C52 FFFF + 810E8C54 FFFF + 810E8C56 FFFF + 810E8C58 FFFF + 810E8C5A FFFF + cn Tricks Available\Rodney Mullen + 810E8EFC FFFF + 810E8EFE FFFF + 810E8F00 FFFF + 810E8F02 FFFF + 810E8F04 FFFF + 810E8F06 FFFF + cn Tricks Available\Steve Caballero + 810E8A88 FFFF + 810E8A8A FFFF + 810E8A8C FFFF + 810E8A8E FFFF + 810E8A90 FFFF + 810E8A92 FFFF + cn Tricks Available\Spider Man + 810E99AC FFFF + 810E99AE FFFF + 810E99B0 FFFF + 810E99B2 FFFF + 810E99B4 FFFF + 810E99B6 FFFF + cn Tricks Available\Tony Hawk + 810E88C0 FFFF + 810E88C2 FFFF + 810E88C4 FFFF + 810E88C6 FFFF + 810E88C8 FFFF + 810E88CA FFFF + cn Tricks Available\Andrew Reynolds + 810E90C4 FFFF + 810E90C6 FFFF + 810E90C8 FFFF + 810E90CA FFFF + 810E90CC FFFF + 810E90CE FFFF + cn Max Cash\Officer Dick + 810E975C 000F + 810E975E 423F + 810E9760 000F + 810E9762 423F + cn Max Cash\Andrew Reynolds + 810E903C 000F + 810E903E 423F + 810E9040 000F + 810E9042 423F + cn Max Cash\Bob Burnquist + 810E891C 000F + 810E891E 423F + 810E8920 000F + 810E8922 423F + cn Max Cash\Bucky Lasek + 810E8D90 000F + 810E8D92 423F + 810E8D94 000F + 810E8D96 423F + cn Max Cash\Chad Muska + 810E8F58 000F + 810E8F5A 423F + 810E8F5C 000F + 810E8F5E 423F + cn Max Cash\Eric Koston + 810E8CAC 000F + 810E8CAE 423F + 810E8CB0 000F + 810E8CB2 423F + cn Max Cash\Elissa Steamer + 810E9204 000F + 810E9206 423F + 810E9208 000F + 810E920A 423F + cn Max Cash\Geoff Rowley + 810E9120 000F + 810E9122 423F + 810E9124 000F + 810E9126 423F + cn Max Cash\Jamie Thomas + 810E92E8 000F + 810E92EA 423F + 810E92EC 000F + 810E92EE 423F + cn Max Cash\Kareem Campbell + 810E8AE4 000F + 810E8AE6 423F + 810E8AE8 000F + 810E8AEA 423F + cn Max Cash\Rune Glifberg + 810E8BC8 000F + 810E8BCA 423F + 810E8BCC 000F + 810E8BCE 423F + cn Max Cash\Rodney Mullen + 810E8E74 000F + 810E8E76 423F + 810E8E78 000F + 810E8E7A 423F + cn Max Cash\Steve Caballero + 810E8A00 000F + 810E8A02 423F + 810E8A04 000F + 810E8A06 423F + cn Max Cash\Custom Player 1 + 810E93CC 000F + 810E93CE 423F + 810E93D0 000F + 810E93D2 423F + cn Max Cash\Custom Player 2 + 810E94B0 000F + 810E94B2 423F + 810E94B4 000F + 810E94B6 423F + cn Max Cash\Custom Player 3 + 810E9594 000F + 810E9596 423F + 810E9598 000F + 810E959A 423F + cn Max Cash\Custom Player 4 + 810E9678 000F + 810E967A 423F + 810E967C 000F + 810E967E 423F + cn All Complete\Bob Burnquist + 810E8924 FFFF + 810E8926 FFFF + 810E8928 FFFF + 810E892A FFFF + 810E892C FFFF + 810E892E FFFF + 810E8930 FFFF + 810E8932 FFFF + cn All Complete\Tony Hawk + 810E8840 FFFF + 810E8842 FFFF + 810E8844 FFFF + 810E8846 FFFF + 810E8848 FFFF + 810E884A FFFF + 810E884C FFFF + 810E884E FFFF + cn Always Special On Cheat + 800E9DEC 0001 + cn Perfect Balance Cheat + 800E9DE8 0001 + cn Unlock Hoffman Factory & Skate Heaven + 800EA0CB 003F + cn Access In-Game Cheat Menu + 50001104 0000 + 800E9DD8 0001 + +crc 1A7F70B5-00B7B9FD-C:45 +gn Tony Hawk's Pro Skater 3 (U) + cn Tony Hawk\All Levels Open,Gold Medals & Goals Compleated + 800ED8F8 00FF + 50001001 0000 + 800ED908 00FF + cn Tony Hawk\Have all 5of5 Stat Points & All Decks + 50000F04 0000 + 800ED934 00FF + cn Steve Caballero\All Levels Open,Gold Medals & Goals Compleated + 800ED9D4 00FF + 50001001 0000 + 800ED9E4 00FF + cn Steve Caballero\Have all 5of5 Stat Points & All Decks + 50000F04 0000 + 800EDA10 00FF + cn Kareem Campbell\All Levels Open,Gold Medals & Goals Compleated + 800EDAB0 00FF + 50001001 0000 + 800EDAC0 00FF + cn Kareem Campbell\Have all 5of5 Stat Points & All Decks + 50000F04 0000 + 800EDAEC 00FF + cn Rune Glifberg\All Levels Open,Gold Medals & Goals Compleated + 800EDB8C 00FF + 50001001 0000 + 800EDB9C 00FF + cn Rune Glifberg\Have all 5of5 Stat Points & All Decks + 50000F04 0000 + 800EDBC8 00FF + cn Eric Koston\All Levels Open,Gold Medals & Goals Compleated + 800EDC68 00FF + 50001001 0000 + 800EDC78 00FF + cn Eric Koston\Have all 5of5 Stat Points & All Decks + 50000F04 0000 + 800EDCA4 00FF + cn Bucky Lasek\All Levels Open,Gold Medals & Goals Compleated + 800EDD44 00FF + 50001001 0000 + 800EDD54 00FF + cn Bucky Lasek\Have all 5of5 Stat Points & All Decks + 50000F04 0000 + 800EDD80 00FF + cn Rodney Mullen\All Levels Open,Gold Medals & Goals Compleated + 800EDE20 00FF + 50001001 0000 + 800EDE30 00FF + cn Rodney Mullen\Have all 5of5 Stat Points & All Decks + 50000F04 0000 + 800EDE5C 00FF + cn Chad Muska\All Levels Open,Gold Medals & Goals Compleated + 800EDEFC 00FF + 50001001 0000 + 800EDF0C 00FF + cn Chad Muska\Have all 5of5 Stat Points & All Decks + 50000F04 0000 + 800EDF38 00FF + cn Andrew Rynolds\All Levels Open,Gold Medals & Goals Compleated + 800EDFD8 00FF + 50001001 0000 + 800EDFE8 00FF + cn Andrew Rynolds\Have all 5of5 Stat Points & All Decks + 50000F04 0000 + 800EE014 00FF + cn Geoff Rowley\All Levels Open,Gold Medals & Goals Compleated + 800EE0B4 00FF + 50001001 0000 + 800EE0C4 00FF + cn Geoff Rowley\Have all 5of5 Stat Points & All Decks + 50000F04 0000 + 800EE0F0 00FF + cn Elissa Steamer\All Levels Open,Gold Medals & Goals Compleated + 800EE190 00FF + 50001001 0000 + 800EE1A0 00FF + cn Elissa Steamer\Have all 5of5 Stat Points & All Decks + 50000F04 0000 + 800EE1CC 00FF + cn Jamie Thomas\All Levels Open,Gold Medals & Goals Compleated + 800EE26C 00FF + 50001001 0000 + 800EE27C 00FF + cn Jamie Thomas\Have all 5of5 Stat Points & All Decks + 50000F04 0000 + 800EE2A8 00FF + cn Bam Margera\All Levels Open,Gold Medals & Goals Compleated + 800EE348 00FF + 50001001 0000 + 800EE358 00FF + cn Bam Margera\Have all 5of5 Stat Points & All Decks + 50000F04 0000 + 800EE384 00FF + cn Skater A\All Levels Open,Gold Medals & Goals Compleated + 800EE424 00FF + 50001001 0000 + 800EE434 00FF + cn Skater A\Have all 5of5 Stat Points & All Decks + 50000F04 0000 + 800EE460 00FF + cn Skater B\All Levels Open,Gold Medals & Goals Compleated + 800EE500 00FF + 50001001 0000 + 800EE510 00FF + cn Skater B\Have all 5of5 Stat Points & All Decks + 50000F04 0000 + 800EE53C 00FF + cn Skater C\All Levels Open,Gold Medals & Goals Compleated + 800EE5DC 00FF + 50001001 0000 + 800EE5EC 00FF + cn Skater C\Have all 5of5 Stat Points & All Decks + 50000F04 0000 + 800EE618 00FF + cn Officer Dick\All Levels Open,Gold Medals & Goals Compleated + 800EE6B8 00FF + 50001001 0000 + 800EE6C8 00FF + cn Officer Dick\Have all 5of5 Stat Points & All Decks + 50000F04 0000 + 800EE6F4 00FF + cn Wolverine\All Levels Open,Gold Medals & Goals Compleated + 800EE794 00FF + 50001001 0000 + 800EE7A4 00FF + cn Wolverine\Have all 5of5 Stat Points & All Decks + 50000F04 0000 + 800EE7D0 00FF + cn Infinite Stat Upgrades & Deck Boards to Buy + cd This allows you to ugrade you stats in Upgrades to the Max & Also to open the Boards in Decks For All Characters. + 800ED8F9 00FF + 800ED905 00FF + 800EDD45 00FF + 800EDD51 00FF + 800EDFE5 00FF + 800EDFD9 00FF + 800ED9D5 00FF + 800ED9E1 00FF + 800EDAB1 00FF + 800EDABD 00FF + 800EDB8D 00FF + 800EDB99 00FF + 800EDC69 00FF + 800EDC75 00FF + 800EDE21 00FF + 800EDE2D 00FF + 800EDEFD 00FF + 800EDF09 00FF + 800EE0B5 00FF + 800EE0C1 00FF + 800EE191 00FF + 800EE19D 00FF + 800EE26D 00FF + 800EE279 00FF + 800EE349 00FF + 800EE355 00FF + 800EE425 00FF + 800EE431 00FF + 800EE501 00FF + 800EE50D 00FF + 800EE5DD 00FF + 800EE5E9 00FF + 800EE6B9 00FF + 800EE6C5 00FF + 800EE795 00FF + 800EE7A1 00FF + cn Play As + 800E9D69 ???? 0000:"Tony Hawk",0001:"Steve Caballero",0002:"Kareem Campbell",0003:"Rune Glifberg",0004:"Eric Koston",0005:"Bucky Lasek",0006:"Rodney Mullen",0007:"Chad Muska",0008:"Andrew Rynolds",0009:"Geoff Rowley",000A:"Elissa Steamer",000B:"Jamie Thomas",000C:"Bam Margera",000D:"Skater A",000E:"Skater B",000F:"Skater C",0010:"Officer Dick",0011:"Wolverine" + cn Timer Starts Off At 20 Mins + 800E9D64 FFFF + cn Play On Level + cd This allows you to play on a level even if it isnt already open just choose & tick choose foundary or what ever level & play the one you selected + 800ED58F ???? 0000:"Foundary",0001:"Los Angeles",0002:"Rio De Janeiro",0003:"Suburbia",0004:"Airport",0005:"Skater Island",0006:"Canada",0007:"Tokyo",0008:"Downhill",0009:"Custom" + +crc 8ECC02F0-7F8BDE81-C:45 +gn Top Gear Hyper-Bike (U) + cn Access All\Bikes + 810FBCBE FFFF + cn Access All\Tracks + 810FBCC2 FFFF + cn Infinite\Nitro + 810B8E4C 42C8 + cn Infinite\Nitro Always On + 810BB5A4 8004 + cn Laps 2 Race + 8016FC88 ???? 0001:"1 Lap",0002:"2 laps",0003:"3 Laps",0004:"4 Laps",0005:"5 Laps",0006:"6 Laps",0007:"7 Laps",0008:"8 Laps",0009:"9 Laps" + +crc D741CD80-ACA9B912-C:45 +gn Top Gear Overdrive (U) + cn Extra Cars & Tracks + 801022F0 0001 + 5000020A 0000 + 801022F1 000E + 811022E8 0501 + 50000302 0000 + 811022EA 0101 + cn Infinite Money + 810F50C4 270F + cn Infinite Nitro + 810F50CE 0009 + cn Laps 2 Race + 801185E0 ???? 0001:"1 Lap",0002:"2 laps",0003:"3 Laps",0004:"4 Laps",0005:"5 Laps",0006:"6 Laps",0007:"7 Laps",0008:"8 Laps",0009:"9 Laps" + cn Level Modifier (Championship & Vs Mode) + 8011D0B0 ???? 0000:"Frigid Peaks - Snowy/Daytime",0001:"Fertile Canyon - Day/Lightning",0002:"Swampy Depot - Day/Rainbow",0003:"Downtown - Clear/Rainbow",0004:"Sandy Beaches - Day/Lightning",0005:"Fertile Canyon - Night" + +crc 62269B3D-FE11B1E8-C:45 +gn Top Gear Rally (U) + cn Have 1-6 Level Points + 50000602 0000 + 8032685F 0064 + cn Extra Cars & Tracks + 50000201 0000 + 8032690C 00FF + 8032690F 00FF + 813243CC FFFF + cn Only Race 1 Lap Championship Mode + 8031EBDB 0002 + cn Always Place 1st + 8131C70E 0000 + +crc BE5973E0-89B0EDB8-C:45 +gn Top Gear Rally 2 (U) + cn Always 1st + 810318E2 0001 + cn No Damage Or Failures + 81030D76 0001 + cn 100.000 Sponsor Credits & 950 Championship Points In Support Van + cd You Also Have Access To All Cars, Tracks & Extra Features + 80030D82 00F3 + cn No Cones Hit + cd In ARSG Rally School + 81031CEA 0000 + cn No Navigator + 80032677 0000 + cn Max Sponsor Credits + 81033816 270F + cn Infinite Time & Always Place 1st + cd Championship Mode Only. + 810318EE 0001 + cn Max Sponsor Points & Extra Cars & Tracks + cd This code gives you all tracks and cars. once you activate this code, You must make an internal save (Native) in options & then load that internal save, & go to Drivers Board to pick your car, Then to Race to pick your track + 81033816 270F + +crc A150743E-CF2522CD-C:45 +gn Toy Story 2 (U) + cn Have 99 coins + 810BB10E 0063 + cn Have all 5 collectables + 801C7A72 0005 + cn Infinite Lives + 800BB10A 0009 + cn Infinite Battery Power + 810BB106 000E + cn Hold jump to fly + 810BB0FC 0002 + +crc 2F70F10D-5C4187FF-C:45 +gn Turok: Dinosaur Hunter (U) (v1.0) + cn Infinite\Body Armor + 81128CE6 5B23 + 80128D27 0001 + cn Infinite\Air + 81129030 AAE1 + 811E85EA F1FF + cn Have\All Level Keys + 50000604 0000 + 80128D33 0007 + 80128D4B 001F + 80128D6B 00FF + cn Have\All Weapons + 50000B04 0000 + 80128CF7 0001 + 80128D23 0001 + cn Infinite\Ammo + 50000404 0000 + 80128CB3 00FF + 80128CC3 00FF + 80128CCF 00FF + 50000504 0000 + 80128CD3 00FF + 80128E5B 00FF + 80128E57 00FF + cn Diffuculty Modifier + 801195DF ???? 0000:"Easy",0001:"Normal",0002:"Hard" + cn Infinite\Health + 812C1584 1E61 + 812A24F4 1E61 + cn Have\Backpack + 80128CEB 0001 + 80128D2B 0001 + cn Open All Portals + cd Press L to Access Map + 8114F8CA F803 + 50000604 0000 + 81128D4E 0003 + 81128D66 0005 + cn Infinite\Lives + 8005E689 0098 + 8105E6A0 2400 + 8005E6AD 0083 + cn Have\Cheat Menu + 81119540 FFFF + 81119542 FFFF + +crc 2F700DCD-176CC5C9-C:45 +gn Turok: Dinosaur Hunter (U) (v1.1) + cn Infinite\Body Armor + 81128E36 5B23 + 80128E77 0001 + cn Infinite\Air + 81129180 AAE1 + 811E873A F1FF + cn Have\All Level Keys + 50000604 0000 + 80128E83 0007 + 80128E9B 001F + 80128EBB 00FF + cn Have\All Weapons + 50000B04 0000 + 80128E47 0001 + 80128E73 0001 + cn Infinite\Ammo + 50000404 0000 + 80128E03 00FF + 80128E13 00FF + 80128E1F 00FF + 50000504 0000 + 80128E23 00FF + 80128FAB 00FF + 80128FA7 00FF + cn Diffuculty Modifier + 8011972F ???? 0000:"Easy",0001:"Normal",0002:"Hard" + cn Infinite\Health + 812C16D4 1E61 + 812A2644 1E61 + cn Have\Backpack + 80128E3B 0001 + 80128E7B 0001 + cn Open All Portals + cd Press L to Access Map + 8114FA1A F803 + 81128E9E 0003 + 81128EA2 0003 + 81128EA6 0003 + 81128EAA 0003 + 81128EAE 0003 + 81128EB2 0003 + 81128EB6 0005 + cn Infinite\Lives + 8005E7D9 0098 + 8105E7F0 2400 + 8005E7FD 0083 + cn Have\Cheat Menu + 81119690 FFFF + 81119692 FFFF + +crc ADB9498B-DAF28F55-C:45 +gn Turok: Rage Wars (U) + cn Player 1\Have All\Mini Game Icons + 800FCB17 0024 + cn Player 1\Infinite\Proximity Mines + 8033653D 00FF + cn Player 1\Infinite\Metal Claws + 80336541 00FF + cn Player 1\Infinite\Sentry Guns + 8033653F 00FF + cn Player 1\Infinite\Cerebral Bores + 8033653B 00FF + cn Player 1\Infinite\Health + 81336526 6400 + 80692B86 0064 + cn Player 1\Infinite Ammo + 80336535 0063 + 80336537 0063 + 80336539 0063 + 80692B95 0063 + 80692B97 0063 + 80692B99 0063 + 80692B9B 0063 + 80692B9D 0063 + 80692B9F 0063 + 80692BA1 0063 + cn Player 1\Play As + 80140358 ???? 0000:"Turok",0001:"Mantid",0002:"Drone",0003:"Fireborn",0004:"Soldier",0005:"Adon",0006:"Lord Of The Dead",0007:"Elite Guard",0008:"Blind One",0009:"Juggernaut",000A:"Death Guard",000B:"Bastile",000C:"Syra",000D:"Symbiont",000E:"Tail Set",000F:"Pur-Lin",0010:"Symbiont",0011:"Raptor",0012:"Mites",0013:"Monkey" + cn Level Select\Proving Ground-Tightrope + cd Do Not use this with Level Select The Pit-Starlight. Only use One Level Select Option At A Time + 8014BD9F ???? 0000:"Proving Grounds",0001:"Basic Training",0002:"Crossroads",0003:"Grim Retreat",0004:"Cathedral",0005:"Fall Out",0006:"Boxed Set",0007:"Dire Straight",0008:"Prey",0009:"Warehouse",000A:"Water Temple",000B:"Bomb Shelter",000C:"Tempered",000D:"Earth Temple",000E:"Fire Temple",000F:"Mystic",0010:"Bottleneck",0011:"Tightrope" + cn Level Select\The Pit-Starlight + cd Do Not use this with Level Select Proving Ground-Tightrope. Only use One Level Select Option At A Time + 8014BD9F ???? 0012:"The Pit",0013:"Leap Of Faith",0014:"Wicked Dance",0015:"Bunker",0016:"Ampatheater",0017:"Fire Walker",0018:"Crypts",0019:"Breakdown",001A:"Retaliation",001B:"Hopeless",001C:"Matrix",001D:"Fathom",001E:"The Pedestal",001F:"Defcon 5",0020:"Spirit Temple",0021:"Stronghold",0022:"Courtyard",0023:"Starlight" + cn Player 1\Infinite\Time + 811407F4 47AF + 811407F6 C4B1 + cn Player 1\Have All\Medals + 810FCB4A FFFF + 810FCB4C FFFF + 810FCB4E FFFF + 800FCB50 0003 + cn Player 1\Start With Weapon + 803366B0 ???? 0000:"Warhammer",0001:"Boomerang",0002:"Tek Crossbow",0003:"Mag 60",0004:"Shotgun",0005:"Assault Rifle",0006:"Mini Gun",0007:"Plasma Rifle",0008:"Freeze Gun",0009:"Flaregun",000A:"Grenade Launcher",000B:"Scorpion Launcher",000C:"Napalm Gel",000D:"Emaciator",000E:"Inflator",000F:"Chest Burster",0010:"Raptor Claw",0011:"Mite Bite",0012:"Cerebral Bore",0013:"PFM Mine",0014:"Iron Claw",0015:"Sentry Turret" + +crc E8C95AFC-35D121DA-C:45 +gn Turok 2: Seeds of Evil (U) (Kiosk) + cn Infinite\Health + 80305446 0064 + 80648FA6 0064 + cn 99 Gems + 80305449 0063 + 80648FA9 0063 + cn Infinite\Ammo + 50000302 0000 + 81305868 0063 + 50000304 0000 + 81305872 0063 + 5000020E 0000 + 81305882 0063 + 50000302 0000 + 816493C8 0063 + 50000304 0000 + 816493D2 0063 + 5000020E 0000 + 816493E2 0063 + +crc 49088A11-6494957E-C:45 +gn Turok 2: Seeds of Evil (U) + cn Player 1\Have All\Weapons + D12FC912 0000 + 812FC912 0101 + D12FC914 0000 + 812FC914 0101 + D12FC916 0000 + 812FC916 0101 + D12FC918 0000 + 812FC918 0101 + D12FC91A 0000 + 812FC91A 0101 + D12FC91C 0000 + 812FC91C 0101 + D12FC91E 0000 + 812FC91E 0101 + D12FC920 0000 + 812FC920 0101 + D12FC922 0000 + 812FC922 0101 + D12FC924 0000 + 812FC924 0101 + D12FC926 0000 + 812FC926 0101 + D12FC928 0000 + 812FC928 0101 + D12FC92A 0000 + 812FC92A 0101 + D12FC92C 0000 + 812FC92C 0101 + D12FC92E 0000 + 812FC92E 0101 + D12FC930 0000 + 812FC930 0101 + D12FC932 0000 + 812FC932 0101 + 806FE742 0001 + 806FE743 0001 + 806FE744 0001 + 806FE745 0001 + 806FE746 0001 + 806FE747 0001 + 806FE748 0001 + 806FE749 0001 + 806FE74A 0001 + 806FE74B 0001 + 806FE74C 0001 + 806FE74D 0001 + 806FE74E 0001 + 806FE74F 0001 + 806FE750 0001 + 806FE751 0001 + 806FE752 0001 + 806FE753 0001 + 806FE754 0001 + 806FE756 0001 + 806FE757 0001 + 806FE758 0001 + 806FE759 0001 + 806FE75A 0001 + 806FE75B 0001 + 806FE75C 0001 + 806FE75E 0001 + 806FE75F 0001 + 806FE760 0001 + 806FE761 0001 + 806FE762 0001 + 806FE763 0001 + 806FE764 0001 + cn Player 1\Infinite\Health + 812FC4C6 0064 + 816FE2F6 6400 + cn Player 1\99 Gems + 812FC4C8 0063 + 806FE2F8 0063 + cn Player 1\Infinite\Ammo + 802FC499 0000 + 50000302 0000 + 812FC8D4 0063 + 812FC8DE 0063 + 812FC8E2 0063 + 50000A02 0000 + 812FC8E6 0063 + 50000302 0000 + 816FE704 0063 + 816FE70E 0063 + 816FE712 0063 + 50000802 0000 + 816FE716 0063 + 816FE72C 0063 + 816FE730 0063 + cn Player 1\Have All\Keys,Nuke,Evrything + 802FC602 0030 + 802FC60C 0030 + 802FC616 0030 + 802FC620 0030 + 50000601 0000 + 802FC634 0030 + 50000501 0000 + 802FC648 0030 + 50000401 0000 + 802FC65C 0030 + 50000601 0000 + 802FC99C 0030 + 802FC4E0 0033 + 802FC4E5 0033 + 802FC4EA 0033 + 802FC594 0033 + 802FC530 0033 + 802FC53A 0033 + 802FC53B 0033 + 802FC5B0 0033 + 802FC5B1 0033 + 802FC5B2 0033 + 802FC5B3 0033 + 806FE432 0030 + 806FE43C 0030 + 806FE446 0030 + 806FE450 0030 + 50000601 0000 + 806FE464 0030 + 50000501 0000 + 806FE478 0030 + 50000501 0000 + 806FE48C 0030 + 50000601 0000 + 806FE4CC 0030 + 806FE310 0033 + 806FE315 0033 + 806FE31A 0033 + 806FE360 0033 + 806FE36A 0033 + 806FE36B 0033 + 806FE3C4 0033 + 50000401 0000 + 806FE3E0 0033 + 50000601 0000 + 8059D61A 0001 + 50000D01 0000 + 8059D620 0001 + 50000401 0000 + 8059D62E 0001 + cn Player 2\Infinite\Health + 812F723E 0064 + 8059D1CE 0064 + cn Player 2\Infinite\Ammo + 50000602 0000 + 812F767C 0063 + 812F764C 013C + 812F764E 013C + 50000302 0000 + 812F7654 013C + 812F7660 013C + 812F7664 013C + 812F766A 013C + 812F766C 013C + 812F7674 013C + 812F7678 013C + 8159D5DC 013C + 8159D5DE 013C + 8159D5E4 013C + 8159D5E8 013C + 8159D5EA 013C + 8159D5F0 013C + 8159D5F4 013C + 8159D5FA 013C + 8159D5FC 013C + 8159D604 013C + 8159D608 013C + 50000602 0000 + 8159D60C 013C + cn Player 2\99 Gems + 812F7240 0063 + +crc 89A579F1-667E97EF-C:45 +gn Turok 3: Shadow of Oblivion (U) + cn Have PSG + 8033343A 0001 + cn Have Cerebral Bore + 80333437 0001 + cn Have All Secrets + 811659C6 FFFF + 811659C4 FFFF + cn Have Grenade Launcher + 80333434 0001 + cn Infinite Life Force + 813334FC 0063 + cn Infinite Health + 81332FDA 6400 + cn Infinite Arrows + 81333408 0064 + cn Infinite Pistol Ammo + 8133340E 0063 + cn Infinite Shotgun Ammo + 81333412 0064 + cn Infinite Grenade Gun Ammo + 8133340A 0064 + cn Infinite Firestorm Cannon Ammo + 81333410 0064 + cn Have Pistol + 8033342A 0001 + cn Have Shotgun + 80333430 0001 + +crc 033F4C13-319EE7A7-C:45 +gn World is Not Enough, The (U) + cn Have All\Levels Unlocked + cd For Single Player Mode Only + 81102EE6 0021 + cn Invincibility On All levels + 81112F68 0101 + cn Skip Intro, + D03B0E5F 0004 + 803B0E5F 0009 + cn Level select + 803B0E5F 0009 + cn Infinite\Ammo On All Levels + 810648DC 2400 + cn Have All\Guns On All Levels + cd Once you pick up a Gun You will have all weapons + 8105F224 0810 + 8105F226 0000 + 8105F228 2442 + 8105F22A 0001 + 81400000 3C02 + 81400002 0100 + 81400004 2442 + 81400006 0063 + 81400008 AE82 + 8140000A 0288 + 8140000C AE82 + 8140000E 0298 + 81400010 AE82 + 81400012 02A0 + 81400014 AE82 + 81400016 02A8 + 81400018 AE82 + 8140001A 02B0 + 8140001C AE82 + 8140001E 02C0 + 81400020 AE82 + 81400022 02C8 + 81400024 AE82 + 81400026 02D0 + 81400028 AE82 + 8140002A 02D8 + 8140002C AE82 + 8140002E 02E8 + 81400030 AE82 + 81400032 02F0 + 81400034 AE82 + 81400036 02F8 + 81400038 AE82 + 8140003A 0300 + 8140003C AE82 + 8140003E 0308 + 81400040 AE82 + 81400042 0310 + 81400044 AE82 + 81400046 0320 + 81400048 AE82 + 8140004A 0330 + 8140004C AE82 + 8140004E 0338 + 81400050 AE82 + 81400052 0350 + 81400054 AE82 + 81400056 0358 + 81400058 AE82 + 8140005A 0360 + 8140005C AE82 + 8140005E 0370 + 81400060 AE82 + 81400062 0378 + 81400064 AE82 + 81400066 0380 + 81400068 AE82 + 8140006A 0388 + 8140006C AE82 + 8140006E 0340 + 81400070 AE82 + 81400072 0348 + 81400074 AE82 + 81400076 0350 + 81400078 0801 + 8140007A 7C8C + 8140007C A077 + 8140007E 01FC + cn Time Taken Clock At 0:00 + 80102F02 0000 + cn Infinite\Time + cd Underground Uprising + 8138EE3A 19B8 + cn Have All\Skins + Everyone is Evil + 50005C0C 0000 + 800BF687 0081 + cn Have All\Gadgets + 80112F6D 0001 + cn Go Solo In Multiplayer + D00E0778 0042 + 801002B7 0001 + cn Stop Bond From Going Downhill on Cold Reception + cd Press L to Stop, & R to Go + D10E0778 0020 + 803A8466 0001 + D10E0778 0010 + 803A8466 0000 + cn Fail Objectives To Complete Them + 810315B8 2402 + 810315BA 0011 + cn Infinite\Ammo On Clip, + 810649AC 2400 + cn Have Tons Of Nightvision + cd For Battery Only + 81064C82 1500 + cn Play Crate Yard Level + 80102EDF 0008 + +crc BBC99D32-117DAA80-C:45 +gn TWISTED EDGE + cn Max\50000 Stunt Points + 810829B8 C350 + cn Low Timer + 801495FF 0000 + 80149601 0000 + cn Have\All Characters + 810829F8 07FF + cn Have\All Difficulties + 810829F0 0700 + cn Have\All Tracks + 810829FC BFFE + cn Have\All Boards + 81082A04 0003 + 81082A06 FFFF + +crc EA71056A-E4214847-C:45 +gn Vigilante 8 (U) + cn All Characters & Levels + 81181572 01C0 + cn Have All Cars + 50000D01 0000 + 80191298 001F + cn Level Select + 80190150 ???? 0000:"Super Dreamland 64",0001:"Secret Base",0002:"Sand Factory",0003:"Oil Fields",0004:"Aircraft Graveyard",0005:"Ghost Town",0006:"Hoover Dam",0007:"Valley Farms",0008:"Casino City",0009:"Canyonlands",000A:"Ski Resorts" + cn Play As\Player 1 + 80186AE0 ???? 0000:"Chassey Blue",0001:"Slick Clyde",0002:"Sheila",0003:"John Torque",0004:"Dave",0005:"Convoy",0006:"Loki",0007:"Houston 3",0008:"Boogie",0009:"Beezwax",000A:"Molo",000B:"Sid Burn",000C:"\"Y\" The Alien" + cn Play As\Player 2 + 80186AE1 ???? 0000:"Chassey Blue",0001:"Slick Clyde",0002:"Sheila",0003:"John Torque",0004:"Dave",0005:"Convoy",0006:"Loki",0007:"Houston 3",0008:"Boogie",0009:"Beezwax",000A:"Molo",000B:"Sid Burn",000C:"\"Y\" The Alien" + +crc F5C5866D-052713D9-C:45 +gn Vigilante 8 - 2nd Offense (U) + cn All Quests Complete\Player 1 + 5000120A 0000 + 81197FF0 01FF + cn All Characters\Have Max\Attributes\Player 1 + 5000120A 0000 + 81197FF6 6464 + 5000120A 0000 + 81197FF8 6464 + cn All Characters\Have Max\Acceleration\Player 1 + 50000C0A 0000 + 80197FF6 0064 + cn All Characters\Have Max\Speed\Player 1 + 5000120A 0000 + 80197FF7 0064 + cn All Characters\Have Max\Armor\Player 1 + 5000120A 0000 + 80197FF8 0064 + cn All Characters\Have Max\Target Avoidance\Player 1 + 5000120A 0000 + 80197FF9 0064 + cn All Quests Complete\Player 2 + 5000120A 0000 + 811980A4 01FF + cn All Characters\Have Max\Attributes\Player 2 + 5000120A 0000 + 811980AA 6464 + 5000120A 0000 + 811980AC 6464 + cn All Characters\Have Max\Acceleration\Player 2 + 5000120A 0000 + 801980AA 0064 + cn All Characters\Have Max\Speed\Player 2 + 5000120A 0000 + 801980AB 0064 + cn All Characters\Have Max\Armor\Player 2 + 5000120A 0000 + 801980AC 0064 + cn All Characters\Have Max\Target Avoidance\Player 2 + 5000120A 0000 + 801980AD 0064 + +crc 82B3248B-E73E244D-C:45 +gn Virtual Chess 64 (U) + cn Debug Mode + 810E6290 0001 + cn Time Always Counts Down\On Black Players Side + 8012C67D 0001 + cn Time Always Counts Down\On White Players Side + 8012C67D 0000 + cn Always Play On\2D Board + 800E7257 0001 + cn Always Play On\3D Board + 800E7257 0000 + cn Player 1 Controls\Both Sides In 2-Player + cd This is only for Human VS. Human Game + 8012C508 0000 + +crc 4E4A7643-A37439D7-C:45 +gn Virtual Pool 64 (U) + cn Always Your Turn\Player 1 + 802EF798 0000 + cn Always Your Turn\Player 2 + 802EF798 0001 + cn Ball\Always In Hand + 802EF79C 0002 + cn Max Ratings\Player 1 + 81062C6A FFFF + cn Max Ratings\Player 2 + 81062CEE FFFF + cn Wins Options\Player 1 + 812EF780 ???? 0000:"Zero Points",FFFF:"Max Points" + cn Wins Options\Player 2 + 812EF782 ???? 0000:"Zero Points",FFFF:"Max Points" + cn Foul Score Options\Player 1 + 812EF784 ???? 0000:"Zero Fouls",FFFF:"Max Fouls" + cn Foul Score Options\Player 2 + 812EF786 ???? 0000:"Zero Fouls",FFFF:"Max Fouls" + cn Aiming Sites Always Available + 812F0922 0004 + +crc 3C059038-C8BF2182-C:45 +gn V-Rally Edition 99 (U) + cn Enable All\Cars + 80140D1F 003F + cn Enable All\Tracks + 80140D1A 0070 + cn Unlock Champ + 80140D28 0001 + cn Enable All\Expert Times + 80140D1C 0031 + cn Unlock Cheat Menu + D11B1F14 0000 + 811B1F14 00FF + 811D530A 04FF + D11B1F14 00FF + 811B0270 FF03 + +crc 8066D58A-C3DECAC1-C:45 +gn Waialae Country Club - True Golf Classics (U) + cn Max Power + 8012A431 FFFF + cn Max Technique + 8012A433 FFFF + cn Max Putt + 8012A435 FFFF + cn Max Recover + 8012A437 FFFF + cn Select Club + 801DA496 ???? 0000:"1W",0001:"2W",0002:"3W",0003:"4W",0004:"5W",0005:"1I",0006:"2I",0007:"3I",0008:"4I",0009:"5I",000A:"6I",000B:"7I",000C:"8I",000D:"9I",000E:"PW",000F:"AW",0010:"SW",0011:"Putter" + cn Always On First Shot + 811DA47A 0001 + cn Club Type\Woods Mods + 8012A472 ???? 0000:"Titan",0001:"Metal Wood",0002:"Persimmon" + cn Club Type\Irons Mods + 8012A473 ???? 0000:"Cavity",0001:"Conventional" + cn Club Type\Sand Wedge Mods + 8012A474 ???? 0000:"58 Degrees",0001:"60 Degrees",0002:"62 Degrees" + +crc F7FE28F6-C3F2ACC3-C:45 +gn War Gods (U) + cn Cheat Menu + 80336593 0001 + cn Unlimited Time + 8033F31B 0063 + cn Infinite Credits + 81336582 0005 + 8133658E 0004 + +crc 7DE11F53-74872F9D-C:45 +gn Wave Race 64 (U) (v1.0) + cn Misses Don't Count + 801C27CF 0000 + cn Infinite Time Stunt Mode + 801C295E 00FF + cn Super Speed + 801C27C7 0005 + D0154051 0010 + 801C27C7 0020 + cn 99 Points + 801CB0A3 0063 + cn Infinite Course Out Time + 801C2983 00FF + cn Maximum Power\Player 1 + 801C27C7 0005 + cn Maximum Power\Player 2 + 801C2DEA 0005 + 801C308A 0005 + cn Only Play Glacier Coast + 800DA753 0007 + cn Open\Difficulty Option + 801CAFE0 ???? 0001:"Hard",0002:"Expert",0003:"Hard & Expert",0010:"Dolphin",0011:"Dolphin & Hard",0012:"Dolphin & Expert",0013:"Dolphin Hard & Expert" + cn Open\Level Option + 800DA753 ???? 0002:"Sunset Bay",0003:"Above & Drake Lake",0004:"All Above & Marine Fortress",0005:"All Above & Port Blue",0006:"All Above & Southern Island",000D:"All Above & Twilight City",0016:"All Above & Glacier Coast" + cn Open\Course Option + cd This works in all modes except for Championship Mode. + 801CAFEB ???? 0000:"Dolphin Park",0001:"Sunny Beach",0002:"Sunset Bay",0003:"Drake Lake",0004:"Marian Fortress",0005:"Port Blue",0006:"Twilight City",0007:"Glacier Coast",0008:"Southern Island" + cn Always First Place + 801C269F 0000 + +crc 492F4B61-04E5146A-C:45 +gn Wave Race 64 (U) (v1.1) + cn Misses Don't Count + 801C2A6F 0000 + cn Infinite Time Stunt Mode + 801C2BFE 00FF + cn Super Speed + 801C2A67 0005 + D01CE659 0010 + 801C2A67 0020 + cn 99 Points + 801CB343 0063 + cn Infinite Course Out Time + 801C2C03 00FF + cn Maximum Power\Player 1 + 801C2A67 0005 + 8013FC91 0005 + cn Maximum Power\Player 2 + 801C308A 0005 + 801C392D 0005 + cn Only Play Glacier Coast + 800DA9D3 0007 + cn Open\Difficulty Option + 801CB260 ???? 0001:"Hard",0002:"Expert",0003:"Hard & Expert",0010:"Dolphin",0011:"Dolphin & Hard",0012:"Dolphin & Expert",0013:"Dolphin Hard & Expert" + cn Open\Level Option + 801CB26B ???? 0002:"Sunset Bay",0003:"Above & Drake Lake",0004:"All Above & Marine Fortress",0005:"All Above & Port Blue",0006:"All Above & Southern Island",000D:"All Above & Twilight City",0016:"All Above & Glacier Coast" + cn Open\Course Option + cd This works in all modes except for Championship Mode. + 800DA9D3 ???? 0000:"Dolphin Park",0001:"Sunny Beach",0002:"Sunset Bay",0003:"Drake Lake",0004:"Marian Fortress",0005:"Port Blue",0006:"Twilight City",0007:"Glacier Coast",0008:"Southern Island" + cn Always First Place + 801C293F 0000 + +crc 6B45223F-F00E5C56-C:45 +gn Wayne Gretzky's 3D Hockey (U) + cn Team 1\Score pts + 800E6AB1 ???? 0000:"Zero Points",001E:"30 Points",0023:"50 Points",004B:"75 Points",0063:"99 Points" + cn Team 2\Score pts + 800E9F8D ???? 0000:"ero Points",1E03:"0 Points",2305:"0 Points",4B07:"5 Points",6309:"9 Points" + cn Crunched Players + 810EA078 3F00 + cn Extra Teams + 800C7205 0001 + cn Get In Fights Constantly + 800A442E 0020 + cn Players\Height Size + 810EA074 ???? 3F00:"Midgets",3F80:"Normal Size",3FC0:"Large",4080:"Giants" + cn Players\Head Size + 810EA070 ???? 3F00:"Very Small",3F80:"Normal Size",4080:"Very Large" + +crc 5A9D3859-97AAE710-C:45 +gn Wayne Gretzky's 3D Hockey '98 (U) + cn Team 1\Score pts + 8011C061 ???? 0000:"Zero Points",001E:"30 Points",0023:"50 Points",004B:"75 Points",0063:"99 Points" + cn Team 2\Score pts + 8011F571 ???? 0000:"ero Points",1E03:"0 Points",2305:"0 Points",4B07:"5 Points",6309:"9 Points" + cn Crunched Players + 810DBA6C 3F00 + cn Extra Teams + 80115A0C 0001 + cn Get In Fights Constantly + 800CF766 0020 + cn Players\Height Size + 81120688 ???? 3F00:"Midgets",3F80:"Normal Size",3FC0:"Large",4080:"Giants" + cn Players\Head Size + 81118A2C ???? 3F00:"Very Small",3F80:"Normal Size",4080:"Very Large" + +crc 33BE8CD6-EC186912-C:45 +gn WCW MAYHEM + cn Character Creation\Max\Strength + 802F16F5 0009 + cn Character Creation\Max\Impact + 803121B5 0009 + cn Character Creation\Max\Speed + 803156F5 0009 + cn Character Creation\Max\Quickness + 803176B5 0009 + cn Character Creation\Max\Aerial + 80319675 0009 + cn Character Creation\Max\Mat Ability + 8031B635 0009 + cn Character Creation\Max\Submission + 8031D5F5 0009 + cn Character Creation\Max\Brawling + 8031F5B5 0009 + cn Character Creation\Max\Dirtiness + 80321575 0009 + cn Infinite Stamina\Player 1 + 810E3998 0478 + cn Infinite Stamina\Player 2 + 810E3B34 03ED + cn Meter Select\Player 1 + 800E399D ???? 0060:"Full Meter Bar",0000:"Empty Meter Bar" + cn Meter Select\Player 2 + 800AD80D ???? 0060:"Full Meter Bar",0000:"Empty Meter Bar" + cn Enable Cheat + 800B115B ???? 0002:"Super Created Wrestlers",0004:"Stamina Meter",0008:"Momentum Meter",0020:"Play As Same Wrestler",0080:"All Wrestlers" + cn Freeze Timer + 810B3242 D300 + +crc CEA8B54F-7F21D503-C:45 +gn Wetrix (U) + cn Infinite Lakes + 811BF93E 0009 + cn Mega Score + 801BF958 00FF + 801EED04 00FF + cn Always Empty Drain + 801BF991 0000 + 811BF992 0000 + 811BF994 0000 + cn Always Berserk Mode + 801BF9AF 00FF + cn Stop Level Timer + 801BF9B2 00FF + cn Practice Lessons Open + 810B0BAA 0008 + cn Always Drop\Player 1 + 801BF9BB ???? 0000:"Bar",0001:"T",0002:"Corner",0003:"Square",0004:"Down Square",0005:"Down Bar",0006:"Big Water",0007:"Medium Water",0008:"Small Water",0009:"Smallest Water",000A:"Bomb",000B:"Fireball" + cn Always Drop\Player 2 + 801F013B ???? 0000:"Bar",0001:"T",0002:"Corner",0003:"Square",0004:"Down Square",0005:"Down Bar",0006:"Big Water",0007:"Medium Water",0008:"Small Water",0009:"Smallest Water",000A:"Bomb",000B:"Fireball" + cn Infinite Ducks + 801BF94B 0009 + +crc E896092B-DC244D4E-C:45 +gn Wheel Of Fortune (U) + cn Player 1\Max Cash + 810B9990 FFFF + cn Player 2\Max Cash + 810B9AA4 FFFF + cn Player 3\Max Cash + 810B9BB8 FFFF + cn Player 1\No Cash + 810B9992 0000 + cn Player 2\No Cash + 810B9AA6 0000 + cn Player 3\No Cash + 810B9BB8 0000 + cn Player 1\Infinite Free Spins + 800B999B 0001 + cn Player 2\Infinite Free Spins + 800B9AAF 0001 + cn Player 3\Infinite Free Spins + 800B9BC3 0001 + +crc ED98957E-8242DCAC-C:45 +gn WinBack - Covert Operations (U) + cn Infinite Health + 8017AABB 0064 + cn Enable\Max Power Mode + 8015D417 0001 + cn Have All Characters + 8115D412 FFFF + 8115D410 0003 + 8015D411 0003 + cn Flashlight Mod + 80179448 ???? 0001:"On",0000:"Off" + cn All Bosses 1 Hit Deaths + 811BE482 0000 + cn Have All\Weapons,Items & Infinite Ammo\Player 1 + 8017AA9F 001E + 8017AAB3 0008 + 8017AAB7 0009 + 801587C4 0009 + 8015D417 0001 + 801587C0 000C + 801587C1 0060 + 801587C3 0001 + 50000601 0000 + 801587C5 0001 + 801587CB 0004 + 801587CD 000C + cn Start with Weapon\Player 1 + 8017AAA8 ???? 0000:"HandGun",0001:"Machinegun",0002:"Shotgun",0003:"Rocket Launcher",0004:"M16 With Infinite Ammo",0005:"New Cooler Handgun",0006:"Invisible Gun 1 With Infinite Ammo",0007:"Invisible Gun 2 With Infinite Ammo",0008:"Odd Inviso ShotGun With Infinite Ammo",0009:"Cool Rocket Launcher With Infinite Ammo",0014:"Silenced Handgun" + cn Time is Always 00:00:00 + 8110DD62 0000 + cn Have Trial Mode Unlocked + 8110DCEE 0004 + +crc 132D2732-C70E9118-C:45 +gn Wipeout 64 + cn Infinite\Check Point Time + 810CDE92 0960 + cn Always Place First + cd For This code doesn't record the win on the Time Trial Gold Challenge or the Weapons Gold Challenge. + 8109BC68 0001 + 81091E06 0003 + cn Open\Velocitar + 80093249 0001 + cn Open\Piranha II + 800933C9 0001 + cn Open\Super Combo Challenge + 8009351D 0000 + cn Activate\Infinite Random Weapons Pickup + 80091C24 0001 + cn Activate\Power-Up Weapons + 80091C28 0001 + cn Activate\Velocitar + 80091C2A 0001 + cn Activate\Piranha + 80091C29 0001 + cn Have Weapon\For Feisar + 811BC4F6 ???? 0101:"Rockets",0202:"Missiles",0303:"Mines",0505:"Electro Bolt",0606:"E-Pak",0707:"AutoPilot",0808:"Shield",0909:"Turbo Boost",0C0C:"Quake Disruptor",0D0D:"Secret",0E0E:"Thunder Bomb" + cn Have Weapon\For AG System + 811BCE3E ???? 0101:"Rockets",0202:"Missiles",0303:"Mines",0505:"Electro Bolt",0606:"E-Pak",0707:"AutoPilot",0808:"Shield",0909:"Turbo Boost",0C0C:"Quake Disruptor",0D0D:"Secret",0E0E:"Thunder Bomb" + cn Have Weapon\For Auricom + 811BC1DE ???? 0101:"Rockets",0202:"Missiles",0303:"Mines",0505:"Electro Bolt",0606:"E-Pak",0707:"AutoPilot",0808:"Shield",0909:"Turbo Boost",0C0C:"Quake Disruptor",0D0D:"Secret",0E0E:"Thunder Bomb" + cn Have Weapon\For Qirex + 811BC80E ???? 0101:"Rockets",0202:"Missiles",0303:"Mines",0505:"Electro Bolt",0606:"E-Pak",0707:"AutoPilot",0808:"Shield",0909:"Turbo Boost",0C0C:"Quake Disruptor",0D0D:"Secret",0E0E:"Thunder Bomb" + cn Have Weapon\For Piranha II + 811BCB2E ???? 0101:"Rockets",0202:"Missiles",0303:"Mines",0505:"Electro Bolt",0606:"E-Pak",0707:"AutoPilot",0808:"Shield",0909:"Turbo Boost",0C0C:"Quake Disruptor",0D0D:"Secret",0E0E:"Thunder Bomb" + cn Infinite Eliminations + 801BC52B 00FF + cn [Infinite Sheild] + cd This cheat enabled fixes Av's popping up and spoiling you racing,it also gives you Infinite Sheild on all Cars,Tracks and Modes + 5000030C 0000 + 8109BCE2 0000 + 8109BD12 0000 + +crc BD636D6A-5D1F54BA-C:45 +gn World Cup 98 (U) + cn Home Team scores + 800478BF ???? 0000:"0 Goals",0019:"25 Goals",0032:"50 Goals",0063:"99 Goals" + cn Away Team scores + 800478BB ???? 0000:"0 Goals",0019:"25 Goals",0032:"50 Goals",0063:"99 Goals" + cn Open Cup Classic Mode + 8003CC6F 0001 + +crc D2BE2F14-38453788-C:45 +gn WWF Attitude (U) + cn Enable Everything + 8112E21C F000 + 8112E21E 09FF + 8112E220 FFFF + 8112E222 FFFF + cn 0% in Move List + 81135620 0000 + cn Infinite Creation Points + 80161313 0000 + cn Max\Charisma + 8014E3EC 000A + cn Max\Mat Skills + 8014E3ED 000A + cn Max\Recovery + 8014E3EB 000A + cn Max\Speed + 8014E3EA 000A + cn Max\Strength + 8014E3E8 000A + cn Max\Toughness + 8014E3E9 000A + +crc 4E4B0640-1B49BCFB-C:45 +gn WWF No Mercy (U) + cn Infinite\Money\Championship Mode + cd For Championship Mode + 8109940A FFFF + cn Infinite\Money\Smackdown Mall Shop + cd For Smackdown Mall Shop + 8114FAD6 FFFF + cn Have All\Characters,Costumes, & Moves + 50000B02 0000 + 810BEE40 FFFF + cn Max Spirit\Player 1 + D015A5D1 0015 + 8015AF5F 00FF + cn Max Spirit\Player 2 + D015A5D1 0015 + 8015B2B7 00FF + cn Max Spirit\Player 3 + D015A5D1 0015 + 8015B60F 00FF + cn Max Spirit\Player 4 + D015A5D1 0015 + 8015B967 00FF + cn Always Special\Player 1 + D015A5D1 0015 + 8015AF9E 0004 + cn Always Special\Player 2 + D015A5D1 0015 + 8015B2F6 0004 + cn Always Special\Player 3 + D015A5D1 0015 + 8015B64E 0004 + cn Always Special\Player 4 + D015A5D1 0015 + 8015B9A6 0004 + cn Ultimate Code\Player 1 + D015A5D1 0015 + 8015AF5E 0064 + cn Ultimate Code\Player 2 + D015A5D1 0015 + 8015B2B6 0064 + cn Ultimate Code\Player 3 + D015A5D1 0015 + 8015B60E 0064 + cn Ultimate Code\Player 4 + D015A5D1 0015 + 8015B964 0064 + cn 2 Player Championship Mode + cd This lets player 2 play with you in championship mode so if you have a friend that you want to tag team up with in tag team championship now you can. + 810A755E 0002 + cn CPU To Human Control\Player 1 + 8015AF99 ???? 0017:"Human",0018:"CPU" + cn CPU To Human Control\Player 2 + 8015B2F1 ???? 0017:"Human",0018:"CPU" + cn CPU To Human Control\Player 3 + 8015B649 ???? 0017:"Human",0018:"CPU" + cn Can't Pin\Player 1 + cd Do not use with Auto Pin + 8016CE23 0004 + cn Can't Pin\Player 2 + cd Do not use with Auto Pin + 8016CE17 0004 + cn Can't Pin\Player 3 + cd Do not use with Auto Pin + 8016CE2F 0004 + cn Can't Pin\Player 4 + cd Do not use with Auto Pin + 8016CE3B 0004 + cn Auto-Pin\Player 1 + cd Do not use with Cant Pin + 8016CE23 0003 + cn Auto-Pin\Player 2 + cd Do not use with Cant Pin + 8016CE17 0003 + cn Auto-Pin\Player 3 + cd Do not use with Cant Pin + 8016CE2F 0003 + cn Auto-Pin\Player 4 + cd Do not use with Cant Pin + 8016CE3B 0003 + cn Play As\Player 1\Option 1 + cd Do not use this with anyother Play As Player 1 Option, only use one option at a time + 810AAAD0 ???? 0001:"Rock",0002:"SCSA",0003:"Undertaker",0004:"Kane",0005:"Richards",0006:"Mankind",0007:"Cactus",0008:"Mick",0009:"HBK",0101:"HHH",0102:"X-Pac",0103:"Mr. Ass",0104:"Road Dogg",0201:"Benoit",0202:"Malenko",0203:"Saturn",0204:"Guerrero",0301:"Jericho",0302:"Angle",0303:"Tazz",0304:"Test",0305:"GodFather",0306:"D`Lo",0307:"Venis",0308:"Shamrock" + cn Play As\Player 1\Option 2 + cd Do not use this with anyother Play As Player 1 Option, only use one option at a time + 810AAAD0 ???? 0401:"Rikishi",0402:"Sexay",0403:"Scotty",0404:"Edge",0405:"Christian",0406:"Matt",0407:"Jeff",0501:"Faarooq",0502:"Bradshaw",0503:"D-Von",0504:"Buh Buh",0505:"Hardcore",0506:"Crash",0507:"Bossman",0508:"Albert",0601:"Al",0602:"Blackman",0603:"Bulldog",0604:"Henry",0605:"Viscera",0606:"Andre",0607:"Buchanan",0608:"Rios",0609:"Taka",0701:"Chyna" + cn Play As\Player 1\Option 3 + cd Do not use this with anyother Play As Player 1 Option, only use one option at a time + 810AAAD0 ???? 0702:"Stephanie",0703:"Tori",0704:"Debra",0705:"Trish",0706:"Lita",0801:"Jacqueline",0802:"Linda",0803:"Kat",0804:"Moola",0805:"Ho",0901:"Vince",0902:"Shane",0903:"Hebner",0904:"Jim Ross" + cn Play As\Player 2\Option 1 + cd Do not use this with anyother Play As Player 2 Option, only use one option at a time + 810AAADC ???? 0001:"Rock",0002:"SCSA",0003:"Undertaker",0004:"Kane",0005:"Richards",0006:"Mankind",0007:"Cactus",0008:"Mick",0009:"HBK",0101:"HHH",0102:"X-Pac",0103:"Mr. Ass",0104:"Road Dogg",0201:"Benoit",0202:"Malenko",0203:"Saturn",0204:"Guerrero",0301:"Jericho",0302:"Angle",0303:"Tazz",0304:"Test",0305:"GodFather",0306:"D`Lo",0307:"Venis",0308:"Shamrock" + cn Play As\Player 2\Option 2 + cd Do not use this with anyother Play As Player 2 Option, only use one option at a time + 810AAADC ???? 0401:"Rikishi",0402:"Sexay",0403:"Scotty",0404:"Edge",0405:"Christian",0406:"Matt",0407:"Jeff",0501:"Faarooq",0502:"Bradshaw",0503:"D-Von",0504:"Buh Buh",0505:"Hardcore",0506:"Crash",0507:"Bossman",0508:"Albert",0601:"Al",0602:"Blackman",0603:"Bulldog",0604:"Henry",0605:"Viscera",0606:"Andre",0607:"Buchanan",0608:"Rios",0609:"Taka",0701:"Chyna" + cn Play As\Player 2\Option 3 + cd Do not use this with anyother Play As Player 2 Option, only use one option at a time + 810AAADC ???? 0702:"Stephanie",0703:"Tori",0704:"Debra",0705:"Trish",0706:"Lita",0801:"Jacqueline",0802:"Linda",0803:"Kat",0804:"Moola",0805:"Ho",0901:"Vince",0902:"Shane",0903:"Hebner",0904:"Jim Ross" + cn Play As\Player 3\Option 1 + cd Do not use this with anyother Play As Player 3 Option, only use one option at a time + 810AAAE8 ???? 0001:"Rock",0002:"SCSA",0003:"Undertaker",0004:"Kane",0005:"Richards",0006:"Mankind",0007:"Cactus",0008:"Mick",0009:"HBK",0101:"HHH",0102:"X-Pac",0103:"Mr. Ass",0104:"Road Dogg",0201:"Benoit",0202:"Malenko",0203:"Saturn",0204:"Guerrero",0301:"Jericho",0302:"Angle",0303:"Tazz",0304:"Test",0305:"GodFather",0306:"D`Lo",0307:"Venis",0308:"Shamrock" + cn Play As\Player 3\Option 2 + cd Do not use this with anyother Play As Player 3 Option, only use one option at a time + 810AAAE8 ???? 0401:"Rikishi",0402:"Sexay",0403:"Scotty",0404:"Edge",0405:"Christian",0406:"Matt",0407:"Jeff",0501:"Faarooq",0502:"Bradshaw",0503:"D-Von",0504:"Buh Buh",0505:"Hardcore",0506:"Crash",0507:"Bossman",0508:"Albert",0601:"Al",0602:"Blackman",0603:"Bulldog",0604:"Henry",0605:"Viscera",0606:"Andre",0607:"Buchanan",0608:"Rios",0609:"Taka",0701:"Chyna" + cn Play As\Player 3\Option 3 + cd Do not use this with anyother Play As Player 3 Option, only use one option at a time + 810AAAE8 ???? 0702:"Stephanie",0703:"Tori",0704:"Debra",0705:"Trish",0706:"Lita",0801:"Jacqueline",0802:"Linda",0803:"Kat",0804:"Moola",0805:"Ho",0901:"Vince",0902:"Shane",0903:"Hebner",0904:"Jim Ross" + cn Play As\Player 4\Option 1 + cd Do not use this with anyother Play As Player 4 Option, only use one option at a time + 810AAAF4 ???? 0001:"Rock",0002:"SCSA",0003:"Undertaker",0004:"Kane",0005:"Richards",0006:"Mankind",0007:"Cactus",0008:"Mick",0009:"HBK",0101:"HHH",0102:"X-Pac",0103:"Mr. Ass",0104:"Road Dogg",0201:"Benoit",0202:"Malenko",0203:"Saturn",0204:"Guerrero",0301:"Jericho",0302:"Angle",0303:"Tazz",0304:"Test",0305:"GodFather",0306:"D`Lo",0307:"Venis",0308:"Shamrock" + cn Play As\Player 4\Option 2 + cd Do not use this with anyother Play As Player 4 Option, only use one option at a time + 810AAAF4 ???? 0401:"Rikishi",0402:"Sexay",0403:"Scotty",0404:"Edge",0405:"Christian",0406:"Matt",0407:"Jeff",0501:"Faarooq",0502:"Bradshaw",0503:"D-Von",0504:"Buh Buh",0505:"Hardcore",0506:"Crash",0507:"Bossman",0508:"Albert",0601:"Al",0602:"Blackman",0603:"Bulldog",0604:"Henry",0605:"Viscera",0606:"Andre",0607:"Buchanan",0608:"Rios",0609:"Taka",0701:"Chyna" + cn Play As\Player 4\Option 3 + cd Do not use this with anyother Play As Player 4 Option, only use one option at a time + 810AAAF4 ???? 0702:"Stephanie",0703:"Tori",0704:"Debra",0705:"Trish",0706:"Lita",0801:"Jacqueline",0802:"Linda",0803:"Kat",0804:"Moola",0805:"Ho",0901:"Vince",0902:"Shane",0903:"Hebner",0904:"Jim Ross" + cn Cannot Be Grabbed\Player 1 + D115AEC6 0052 + 8115AEC6 0001 + D115AEC6 00A1 + 8115AEC6 00C1 + cn Cannot Be Punched\Player 1 + D115AEC6 002D + 8115AEC6 0001 + D115AEC6 0035 + 8115AEC6 00C1 + cn Cannot Be Knocked Down\Player 1 + D115AEC6 0031 + 8115AEC6 0001 + cn Wrestler Size & Shape\Player 1\Thin wrestler + cd Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time + 8106B468 3D80 + cn Wrestler Size & Shape\Player 1\Wide wrestler + cd Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time + 8106B468 3FFF + cn Wrestler Size & Shape\Player 1\Short wrestler + cd Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time + 8106B47C 3E80 + cn Wrestler Size & Shape\Player 1\Tall wrestler + cd Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time + 8106B47C 3FFF + cn Wrestler Size & Shape\Player 1\Flat wrestler + cd Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time + 8106B490 3D80 + cn Wrestler Size & Shape\Player 1\Bulgy wrestler + cd Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time + 8106B490 3FFF + cn Wrestler Size & Shape\Player 1\Giant wrestler + cd Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time + 8106B4A4 3E80 + cn Wrestler Size & Shape\Player 1\Small wrestler + cd Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time + 8106B4A4 3FFF + cn Wrestler Size & Shape\Player 2\Thin wrestler + cd Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time + 8006B528 3D80 + cn Wrestler Size & Shape\Player 2\Wide wrestler + cd Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time + 8006B528 3FFF + cn Wrestler Size & Shape\Player 2\Short wrestler + cd Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time + 8006B53C 3E80 + cn Wrestler Size & Shape\Player 2\Tall wrestler + cd Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time + 8006B53C 3FFF + cn Wrestler Size & Shape\Player 2\Flat wrestler + cd Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time + 8006B510 3DFF + cn Wrestler Size & Shape\Player 2\Bulgy wrestler + cd Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time + 8006B510 3FFF + cn Wrestler Size & Shape\Player 2\Giant wrestler + cd Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time + 8006B564 3E80 + cn Wrestler Size & Shape\Player 2\Small wrestler + cd Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time + 8006B564 3FFF + cn Wrestler Size & Shape\Player 3\Thin wrestler + cd Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time + 8006B5E8 3D80 + cn Wrestler Size & Shape\Player 3\Wide wrestler + cd Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time + 8006B5E8 3FFF + cn Wrestler Size & Shape\Player 3\Short wrestler + cd Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time + 8006B5FC 3E80 + cn Wrestler Size & Shape\Player 3\Tall wrestler + cd Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time + 8006B5FC 3FFF + cn Wrestler Size & Shape\Player 3\Flat wrestler + cd Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time + 8006B610 3D80 + cn Wrestler Size & Shape\Player 3\Bulgy wrestler + cd Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time + 8006B610 3FFF + cn Wrestler Size & Shape\Player 3\Giant wrestler + cd Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time + 8006B624 3E80 + cn Wrestler Size & Shape\Player 3\Small wrestler + cd Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time + 8006B624 3FFF + cn Wrestler Size & Shape\Player 4\Thin wrestler + cd Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time + 8006B6A8 3D80 + cn Wrestler Size & Shape\Player 4\Wide wrestler + cd Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time + 8006B6A8 3FFF + cn Wrestler Size & Shape\Player 4\Short wrestler + cd Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time + 8006B6BC 3E80 + cn Wrestler Size & Shape\Player 4\Tall wrestler + cd Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time + 8006B6BC 3FFF + cn Wrestler Size & Shape\Player 4\Flat wrestler + cd Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time + 8006B6D0 3D80 + cn Wrestler Size & Shape\Player 4\Bulgy wrestler + cd Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time + 8006B6D0 3FFF + cn Wrestler Size & Shape\Player 4\Giant wrestler + cd Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time + 8006B6E4 3E80 + cn Wrestler Size & Shape\Player 4\Small wrestler + cd Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time + 8006B6E4 3FFF + cn Z LADDER + cd Press Z for the ladder to appear, sometimes there is an invisable ladder + D1064880 2000 + 8116C768 0000 + D1064880 2000 + 8116C76A 0019 + D1064880 2000 + 8116C76C 0000 + D1064880 2000 + 8116C76E 0019 + D1064880 2000 + 8116C788 8104 + cn Replace Raw War with\TOKYO DOME + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 810528F4 7223 + 810528F6 0119 + 81050124 0100 + 81050126 0100 + 81050128 0100 + 8105012A 0100 + 8105012C 0100 + 8105012E 0100 + 81050130 0100 + 81050132 0100 + 81050134 0100 + 81050136 0100 + 8105010E 0999 + 81050400 03A5 + 81050402 0385 + 81050404 0385 + 81050406 0385 + 81050408 0385 + 8105040A 03A5 + 8105040C 03A5 + 8105040E 043F + 81050430 043F + 8105042C 03A5 + 81050430 21A5 + 81050432 0100 + 81050434 0000 + 81050436 2CFB + 81050438 0899 + 8105043C 03AF + 81050440 03AF + 81050442 03A5 + 810500E8 24C3 + 81050444 0100 + 81050190 09EF + 81050192 0000 + 81050194 09EF + 81050196 2CFD + cn Replace Raw War with\BARBEDWIRE ROPES + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 81050110 04F3 + 81050112 04F4 + 81050114 04F5 + 81050116 04F3 + 81050118 04F4 + 8105011A 04F5 + 8105011C 04F3 + 8105011E 04F4 + 81050120 04F5 + 81050124 2CFB + 81050126 2CFB + 81050128 2CFB + 8105012A 2CFB + 8105012C 2CFB + 8105012E 2CFB + 81050130 2CFB + 81050132 2CFB + 81050134 2CFB + 81079D90 3F6C + 81079D94 3F48 + 81079DA4 3D10 + 81079DB8 3F71 + 81079E6C 3F6C + 81079E80 3D10 + 81079E90 3F47 + 81079F48 3F6C + 81079F4C BF4C + 81079F5C 3D10 + 81079F70 3F71 + 8107A024 3F6C + 8107A028 3F28 + 8107A038 3D10 + 8107A04C 3F71 + 8107A100 3F6C + 8107A114 3D10 + 8107A124 3F23 + 8107A1DC 3F6C + 8107A1E0 BF2A + 8107A1F0 3D10 + 8107A204 3F71 + 8107A2B8 3F6C + 8107A2BC 3F02 + 8107A2CC 3D10 + 8107A2E0 3F71 + 8107A394 3F6C + 8107A3A8 3D10 + 8107A3B8 3F00 + 8107A470 3F6C + 8107A474 BF02 + 8107A484 3D10 + 8107A498 3F71 + 81050144 0569 + 81050154 07F7 + 810528F4 0C01 + 810528F6 0555 + 81050140 04F4 + 81050150 2CFB + 8107A628 3F60 + 8107A63C 3D10 + 8107A64C 3F52 + 8107A650 BF80 + 8107A8BC 3F56 + 8107A8C4 BA00 + 8107A8D0 3D10 + 8107A8DC 3C5A + 8107A8E0 3F30 + 8107A8E4 BF80 + 8107ADE4 3F56 + 8107ADEC BA00 + 8107ADF8 3D10 + 8107AE04 3C5A + 8107AE08 3F0E + 8107AE0C BF80 + 8107AB7C 3F00 + D115AF56 2EB2 + 8115AEC6 0017 + D115B2AE 2EB2 + 8115B21E 0017 + D115B606 2EB2 + 8115B570 0017 + D115B95E 2EB2 + 8115B8CE 0017 + 81052922 FFFF + 81052924 FFFF + 81052926 FFFF + cn Replace Raw War with\BARBEDWIRE SQUARE\Part 1 + cd Both Parts must be on for this Press the C Left Button to make your opponent bleed,These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 81050110 04F3 + 81050112 04F4 + 81050114 04F5 + 81050116 04F3 + 81050118 04F4 + 8105011A 04F5 + 8105011C 04F3 + 8105011E 04F4 + 81050120 04F5 + 81050124 2CFB + 81050126 2CFB + 81050128 2CFB + 8105012A 2CFB + 8105012C 2CFB + 8105012E 2CFB + 81050130 2CFB + 81050132 2CFB + 81050134 2CFB + 81079D90 3F6C + 81079D94 3F48 + 81079DA4 3D10 + 81079DB8 3F71 + 81079E6C 3F6C + 81079E80 3D10 + 81079E90 3F47 + 81079F48 3F6C + 81079F4C BF4C + 81079F5C 3D10 + 81079F70 3F71 + 8107A024 3F6C + 8107A028 3F28 + 8107A038 3D10 + 8107A04C 3F71 + 8107A100 3F6C + 8107A114 3D10 + 8107A124 3F23 + 8107A1DC 3F6C + 8107A1E0 BF2A + 8107A1F0 3D10 + 8107A204 3F71 + 8107A2B8 3F6C + 8107A2BC 3F02 + 8107A2CC 3D10 + 8107A2E0 3F71 + 8107A394 3F6C + 8107A3A8 3D10 + 8107A3B8 3F00 + 8107A470 3F6C + 8107A474 BF02 + 8107A484 3D10 + 8107A498 3F71 + 81050144 0569 + 81050154 07F7 + 810528F4 0C01 + 810528F6 0555 + 81050140 04F4 + 81050150 2CFB + 8107A628 3F60 + 8107A63C 3D10 + 8107A64C 3F52 + 8107A650 BF80 + 8107A8BC 3F56 + 8107A8C4 BA00 + 8107A8D0 3D10 + 8107A8DC 3C5A + 8107A8E0 3F30 + 8107A8E4 BF80 + 8107ADE4 3F56 + 8107ADEC BA00 + 8107ADF8 3D10 + 8107AE04 3C5A + 8107AE08 3F0E + 8107AE0C BF80 + 8107AB7C 3F00 + D115AF56 2EB2 + 8115AEC6 0017 + D115B2AE 2EB2 + 8115B21E 0017 + D115B606 2EB2 + 8115B570 0017 + D115B95E 2EB2 + 8115B8CE 0017 + 81052922 FFFF + 81052924 FFFF + 81052926 FFFF + 8116C330 0000 + 8116C332 000A + 8116C334 0000 + 8116C336 000A + 8116C378 42B4 + cn Replace Raw War with\BARBEDWIRE SQUARE\Part 2 + cd Both Parts must be on for this Press the C Left Button to make your opponent bleed,These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8116C382 0000 + 8116C38C FFFF + 81052C9C 0672 + 81052CA4 2CFB + D1064880 0002 + 8115B21E 002F + D1064886 0002 + 8115AEC6 002F + 8116C3E4 0000 + 8116C3E6 000C + 8116C3E8 0000 + 8116C3EA 000C + 8116C428 C3D4 + 8116C440 FFFF + 81052CB2 2CC2 + 81052CB4 0805 + 81052CB6 2CFB + D1064880 2000 + 8116C3E6 001F + D1064880 2000 + 8116C3EA 001F + D1064880 2000 + 81005592 3F81 + D1005592 3F81 + 8116C3E6 001F + D1064880 2000 + 81005592 3F81 + D1005592 3F81 + 8116C3EA 001F + D1064886 2000 + 8116C3E6 001F + D1064886 2000 + 8116C3E6 001F + D1064886 2000 + 81005592 3F81 + D1005592 3F81 + 8116C3EA 001F + 81052CF8 04F4 + 81052D00 2CFB + 8116C3E4 0000 + 8116C3E6 0015 + 8116C3E8 0000 + 8116C3EA 0015 + 8116C428 0000 + 8116C42A 0000 + 8116C42C 43EB + 8116C42E 0000 + 8116C430 C3A6 + 8116C432 0000 + 8116C436 0400 + 8116C43A 0000 + 8116C43E 0000 + 8116C440 FFFF + 8116C442 0000 + 810855A8 3F00 + 81085684 3F00 + 81085750 3F00 + 8108583C 3F00 + 81050100 2CFB + 8105010E 2CFB + cn Replace Raw War with\FLAMING TURNBUCKLES + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8116C334 FFFF + 8116C336 001F + 8116C374 C350 + 8116C376 FFF3 + 8116C378 4377 + 8116C37A 2689 + 8116C37C C380 + 8116C37E 0406 + 8116C382 0D14 + 8116C386 0FCC + 8116C38A 07DC + 8116C38C FFFF + 8116C38E FDE3 + 8116C3E8 FFFF + 8116C3EA 001F + 8116C428 C360 + 8116C42C 4370 + 8116C430 4376 + 8116C436 0D14 + 8116C43A 0FCC + 8116C43E 07DC + 8116C442 F9C4 + 8116C49C FFFF + 8116C49E 001F + 8116C4DC 4360 + 8116C4E0 4370 + 8116C4E4 4380 + 8116C4EA 0CD0 + 8116C4EE 0136 + 8116C4F2 04EE + 8116C4F6 F601 + 8116C550 FFFF + 8116C552 001F + 8116C590 434F + 8116C594 4370 + 8116C598 C36C + 8116C59E 0E70 + 8116C5A2 0F58 + 8116C5A6 0814 + 8116C5AA F1E6 + cn Replace Raw War with\REMOVE RING + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 81050150 0000 + 81050152 0000 + 81050154 0000 + 810500E8 0000 + 810855A8 3F00 + 81085684 3F00 + 81085750 3F00 + 8108583C 3F00 + 81079C08 3F00 + 81079C14 3F00 + 81079B10 3F00 + cn Replace Raw War with\BACKYARD ARENA + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8105010E 0F76 + 8105010C 0F76 + 810482E8 002F + 81050150 2CFD + 810528F4 33FF + 810528F6 33FF + 81050152 2DC7 + 81050114 04F4 + 81050116 04F5 + 8105011E 04F3 + 81050128 07FF + 8105012A 07FF + 81050132 07FF + 81079F48 400C + 81079F5C 3F00 + 81079F70 3FFF + 8107A024 4010 + 8107A038 3F00 + 8107A04C 4020 + 8107A060 3F84 + 8107A394 4012 + 8107A3A8 3F00 + 8107A3BC 4030 + 8107A3D0 3F84 + 8105042C 0949 + 81050436 07FF + 81050438 07FF + 8105043A 07FF + 8105043C 0000 + 8105043E 07FF + 81050440 0949 + 81050442 0949 + 81050430 0F76 + 81050128 07FF + 8105012A 07FF + 8105012C 0000 + 8105012E 07FF + 81050130 07FF + 81050132 07FF + 81050134 0000 + 81050136 08F9 + 81050196 2CFD + 81050194 09EF + 81050192 0000 + 81050190 09EF + 8116C49E 0019 + 8116C4B8 0004 + 8116C4DC C2E1 + 8116C4E0 42B4 + 810500FE 2D2D + 81050100 2D2D + 81050102 2D2D + 81050400 2DC7 + 81050402 2DC7 + 81050404 2DC7 + 81050406 2DC7 + 81050408 2DC7 + 8105040A 2DC7 + 8105040C 2DC7 + 8105040E 2DC7 + 50001002 0000 + 810501B8 0000 + 50000402 0000 + 810501E0 0000 + 50000902 0000 + 81050262 0000 + 50001402 0000 + 81050290 0000 + 50002C02 0000 + 810502EC 0000 + 8107941C 3FE0 + 81079428 3FFF + 810500EC 06FE + 810500EE 06FD + 810500F8 07FF + 810500FA 0997 + 81050110 06FC + 81050112 06FB + 8105011A 06FF + 8105011C 06FA + 81052CF0 2CC9 + 81052CF4 2D1B + 81052CD0 2CD1 + 81052CD4 0963 + 81052C84 2CBF + 81052C8A 0961 + 81052CB8 2CC4 + 81052CBC 2DD7 + 81052CC8 2CD1 + 81052CCC 2CFB + 81052C78 2CBC + 81052C80 2D31 + 81052CF8 2CC1 + 81052D00 2DD7 + cn Replace Raw War with\BACKYARD WEAK + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8105042C 0E88 + 8105042E 2D0D + 81050430 2D0D + 81050432 2D0D + 81050434 2D0D + 81050436 07FD + 8105043A 2CFB + 8105043C 2D0D + 8105043E 2D0D + 81050440 2D0D + 81050442 2D0D + 810500E8 2D0D + 8105010E 2D0D + 8105010C 2D0D + 81050150 2D0D + 81050196 2CFB + 81050124 2CFB + 81050126 2CFB + 81050128 2CFB + 8105012A 2CFB + 8105012C 2CFB + 8105012E 2CFB + 81050130 2CFB + 81050132 2CFB + 81050134 2CFB + 81050136 2CFB + 81050400 2D0D + 81050402 2D0D + 81050404 2D0D + 81050406 2D0D + 81050408 2D0D + 8105040A 2D0D + 8105040C 2D0D + 8105040E 2D0D + 810528F4 2D0D + 810528F6 2D0D + 81052CE8 2CC9 + 81052CEC 2D2D + cn Replace Raw War with\BARBEDWIRE ARENA + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8105042C 2CFB + 8105042E 2CFB + 81050430 2CFB + 81050432 2CFB + 81050434 2CFB + 81050436 2CFB + 81050438 2CFB + 8105043A 2CFB + 8105043C 2CFB + 8105043E 2CFB + 81050440 2CFB + 81050442 2CFB + 810500E8 2CFB + 8105010E 2CFB + 8105010C 2CFB + 81050150 2CFB + 81050196 2CFB + 81050124 2CFB + 81050126 2CFB + 81050128 2CFB + 8105012A 2CFB + 8105012C 2CFB + 8105012E 2CFB + 81050130 2CFB + 81050132 2CFB + 81050134 2CFB + 81050136 2CFB + 810528F4 DDDD + 810528F6 DDDD + 81052CE8 2CCA + 81052CEC 2CFB + 81050400 2CFB + 81050402 2CFB + 81050404 2CFB + 81050406 2CFB + 81050408 2CFB + 8105040A 2CFB + 8105040C 2CFB + 8105040E 2CFB + cn Replace Raw War with\DUDLEY ARENA + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8105042C 21A7 + 8105042E 2D0D + 81050432 2D0D + 81050436 21A7 + 8105043E 2D0D + 81050440 0000 + 81050442 0000 + 810500E8 2D0D + 8105010C 2CFD + 8105010E 2CFD + 81050150 2D29 + 81050152 2CFB + 81050400 09EF + 81050402 09EF + 81050404 0000 + 81050406 0000 + 81050408 0000 + 8105040A 0000 + 8105040C 09EF + 8105040E 09EF + 81050188 04F6 + 8105018A 04F7 + 8105018C 04F8 + 8105018E 04F9 + 81050190 09EF + 81050192 0000 + 81050194 09EF + 81050196 2D0D + 810528F4 6666 + 810528F6 6666 + 81052CE8 2CC2 + 81052CEC 2D0D + 81052D1C 2CD3 + 81052D1E 2CD4 + 81052D20 2CD5 + 81052D22 2CD6 + 81052D24 2CFD + 81052D26 2CFD + 81052D28 2CFB + 81052D2A 2CFB + 81050124 2CFD + 81050126 2CFD + 81050128 2CFD + 8105012A 2CFD + 8105012C 2CFD + 8105012E 2CFD + 81050130 2CFD + 81050132 2CFD + 81050134 2CFD + 81050136 2CFD + 81050154 2CFB + 811533F8 002E + cn Replace Raw War with\FLAME ARENA + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8105010E 0EFE + 8105010C 0EFE + 810528F4 2508 + 810528F6 2508 + 81050430 2401 + 81050430 2401 + 81050404 2401 + 81050406 2401 + 81050408 2401 + 81050409 2401 + 8105040A 2401 + 8105040C 2401 + 810500E8 2401 + cn Replace Raw War with\GREENWICH STREET ARENA + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 81050430 2DC5 + 81050436 0000 + 81050438 0000 + 8105043A 0000 + 8105043E 0000 + 810504E8 0EFE + 8105010E 2DC5 + 8105010C 2DC5 + 81050196 2CFD + 81050136 0FB6 + 81050134 0FC6 + 81050132 0FB6 + 81050130 0FC6 + 8105012E 0FB6 + 8105012C 0FC6 + 8105012A 0FB6 + 81050128 0FC6 + 81050126 0FB6 + 81050124 0FC6 + 81050440 0000 + 81050442 0000 + 50002C02 0000 + 81050378 0000 + 50002C02 0000 + 810502EC 0000 + 50001402 0000 + 81050290 0000 + 50000902 0000 + 81050262 0000 + 50000402 0000 + 810501CE 0000 + 50001002 0000 + 810501B8 0000 + 50000402 0000 + 810501E0 0000 + 8105042C 2D0D + 81050430 0000 + 81050150 24F0 + cn Replace Raw War with\HHH ARNEA + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8105040E 24EF + 8105040C 24EF + 8105040A 24EF + 81050408 24EF + 81050406 24EF + 81050404 24EF + 81050402 24EF + 81050400 24EF + 81050436 24E9 + 81050440 24E9 + 81050442 24E9 + 8105043E 24EF + 8105042E 24EF + 8105043C 24EF + 8105042C 24E9 + 8105010E 24E9 + 8105010C 24E9 + 81050196 24E9 + 8105042E 24EF + 81050432 24EF + 810500F8 24EF + 810500FA 24EF + 810500FC 24EF + 810500FC 24EF + 81050100 24EF + 81050100 24EF + 81052CE8 2CCA + 81052CEC 24EF + 81050150 24E9 + 81050152 24E9 + 81050154 24E9 + 810528F4 24E9 + 810528F6 24E9 + cn Replace Raw War with\HOSPITAL ARENA + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8105042C 0949 + 8105042E 283F + 81050428 0949 + 81050430 0949 + 81050430 0949 + 81050436 096B + 81050438 0993 + 8105043A 096B + 8105043E 283F + 81050440 283F + 81050442 283F + 810504E8 0949 + 81050150 283F + 81050196 283F + 81050400 283F + 81050402 283F + 81050404 283F + 81050406 283F + 81050408 283F + 8105040A 283F + 8105040C 283F + 8105040E 283F + 810500F8 283F + 810500FA 283F + 810500FC 283F + 810500FE 283F + 81050100 283F + 81050100 283F + 81052CE8 2CCA + 81052CEC 283F + 8105010E 283F + 8105010C 283F + 81050124 0949 + 81050126 0949 + 81050128 0949 + 8105012A 0949 + 8105012C 0949 + 8105012E 0949 + 81050130 0949 + 81050132 0949 + 81050134 0949 + 81050136 0949 + 810500E8 0949 + 810528F4 0000 + 81052CE0 2CC9 + cn Replace Raw War with\KANE ARENA + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8105042C 0A61 + 8105042E 0A61 + 81050428 2B6C + 81050430 2B6C + 81050430 2B6C + 81050436 2B57 + 81050438 2B57 + 8105043A 2B57 + 8105043E 0A61 + 81050440 2B57 + 81050442 2B57 + 810500E8 1B1E + 8105010E 2D37 + 8105010C 209F + 81050194 0955 + 81050196 2B57 + 81050400 2699 + 81050402 2699 + 81050404 2699 + 81050406 2699 + 81050408 2699 + 8105040A 2699 + 8105040C 2699 + 8105040E 2699 + cn Replace Raw War with\SHIMMER ARENA + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8105042C 1932 + 8105042E 1932 + 81050430 1932 + 81050434 1932 + 81050432 1932 + 81050436 1932 + 81050438 1932 + 8105043A 1932 + 8105043E 1932 + 81050440 1932 + 81050442 1932 + 81050150 1932 + 81050152 1932 + 81050154 1932 + 81050190 1932 + 81050192 1932 + 81050194 1932 + 81050196 1932 + 81050124 1932 + 81050126 1932 + 81050128 1932 + 8105012A 1932 + 8105012C 1932 + 8105012E 1932 + 81050130 1932 + 81050132 1932 + 81050134 1932 + 81050136 1932 + 810500E8 1932 + 8105010E 1932 + 8105010C 1932 + cn Replace Raw War with\SPACE SHIP ARENA + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8105042C 094D + 8105042E 0953 + 81050430 0953 + 81050432 0F0E + 81050434 0953 + 81050436 0F0E + 81050438 0899 + 8105043C 0953 + 8105043E 0899 + 81050440 0963 + 81050442 0963 + 81050400 0953 + 81050402 0953 + 81050404 0953 + 81050406 0953 + 81050408 0953 + 8105040A 0953 + 8105040C 0953 + 8105040E 0953 + 810500E8 0A75 + 810528F4 7223 + 810528F6 0119 + 81050150 0963 + 81050152 0963 + 81050190 0953 + 81050192 0953 + 81050194 0953 + 81050196 0963 + 8105010E 0F0E + 8105010C 0F0E + 81050124 0F10 + 81050126 0F10 + 81050128 0F10 + 8105012A 0F10 + 8105012C 0F10 + 8105012E 0F10 + 81050130 0F10 + 81050132 0F10 + 81050134 0F10 + 81050136 0F10 + 810500F8 0963 + 810500FA 0963 + 810500FC 0963 + 810500FE 0963 + 81050100 0963 + 81050102 0963 + 81052CE8 2CCA + 81052CEC 0963 + cn Tables\IN RING TABLE\Part 1 + cd To Make the Table look broken Keep the Z Button press down, To make player stand on the Table, Stand next to it & Keep C-Right Pressed Down.Put all Parts on Together for this Cheat to work + 81052CF0 06E1 + 81052CF4 09F1 + 81052CF8 06E2 + 81052D00 09F1 + 81052D0C 06E3 + 81052D0E 06E4 + 81052D10 09EF + 81052D12 09EF + 81052D14 06E5 + 81052D16 06E6 + 81052D18 09EF + 81052D1A 09EF + D1064880 0001 + 8115AFB0 432C + D1064880 0001 + 8115B308 432C + D1064880 2000 + 8115AFB0 42B4 + D1064880 2000 + 8115B308 42B4 + 8116C330 0000 + 8116C332 0014 + 8116C334 0000 + 8116C336 0014 + 8116C374 4210 + 8116C376 C0B1 + 8116C378 432F + 8116C37A 51DC + 8116C37C 4210 + 8116C37E 92F1 + 8116C382 0800 + 8116C386 05A0 + 8116C38A 0800 + 8116C38C FFFF + 8116C38E F3BC + 8116C3E4 0000 + 8116C3E6 0015 + 8116C3E8 0000 + 8116C3EA 0015 + 8116C428 4210 + 8116C42A C0B1 + 8116C42C 432F + 8116C42E 51DC + 8116C430 4210 + 8116C432 92F1 + 8116C436 0800 + 8116C43A 05A0 + 8116C43E 0800 + 8116C440 FFFF + 8116C442 F3BC + D1064880 2000 + 8116C378 42E0 + cn Tables\IN RING TABLE\Part 2 + cd To Make the Table look broken Keep the Z Button press down, To make player stand on the Table, Stand next to it & Keep C-Right Pressed Down.Put all Parts on Together for this Cheat to work + D1064880 2000 + 8116C382 07E0 + D1064880 2000 + 8116C38A 0680 + D1064880 2000 + 8116C42C 42E0 + D1064880 2000 + 8116C436 0820 + D1064880 2000 + 8116C43E 0980 + 8116C498 0000 + 8116C49A 0017 + 8116C49C 0000 + 8116C49E 0017 + 8116C4DC 4210 + 8116C4DE C0B1 + 8116C4E0 432A + 8116C4E2 51DC + 8116C4E4 4210 + 8116C4E6 92F1 + 8116C4EA 0800 + 8116C4EE 05A0 + 8116C4F2 0800 + 8116C4F4 FFFF + 8116C4F6 F3BC + 8116C54C 0000 + 8116C54E 0018 + 8116C550 0000 + 8116C552 0018 + 8116C590 4210 + 8116C592 C0B1 + 8116C594 432A + 8116C596 51DC + 8116C598 4210 + 8116C59A 92F1 + 8116C59E 0800 + 8116C5A2 05A0 + 8116C5A6 0800 + 8116C5A8 FFFF + 8116C5AA F3BC + D1064880 2000 + 8116C4E0 42E0 + D1064880 2000 + 8116C4EA 07E0 + D1064880 2000 + 8116C4F2 0680 + D1064880 2000 + 8116C594 42E0 + D1064880 2000 + 8116C59E 0820 + D1064880 2000 + 8116C5A6 0980 + cn Novalty\Truck In The Crowd + 81050110 0747 + 81050112 0748 + 81050114 0749 + 81050116 074A + 81050118 074B + 81050124 0A4B + 81050126 0A43 + 81050128 0A4B + 8105012A 0A43 + 8105012C 0A43 + 8105012E 0A43 + 8105011A 074C + 8105011C 074D + 81050130 0A43 + 8105011E 074E + 81050132 0A43 + 81050120 0746 + 81050134 0A4B + 81050122 0743 + 81050136 0A4B + D1064880 2000 + 8115AFB0 42EE + D1064880 2000 + 8115B308 42EE + cn CPU To Human Control\Player 4 + 8015B9A1 ???? 0017:"Human",0018:"CPU" + cn Clock At 00:00 + 8115AB1E 0000 + 810A99F2 0000 + cn Hacked Moves\Dragon Screw Stunner + cd Dragon Screw 02 P1 does a Dragon Screw then picks up P2 (still holding his leg) and spins him around and gives him a Stone Cold Stunner + D106B454 3749 + D106B456 0094 + 8106B460 00E9 + D106B454 3749 + D106B456 0094 + 8106B462 B9BE + D106B514 374A + D106B516 0094 + 8106B520 00E9 + D106B514 374A + D106B516 0094 + cn Hacked Moves\Morality Check to Back of head + cd Replaces: Back Clothesline P1 is immediately backed up and does the Morality Check to P2 in the back of the head (misses by a little) + D106B454 3892 + D106B456 0000 + 8106B460 00B3 + D106B454 3892 + D106B456 0000 + 8106B462 194C + cn Hacked Moves\Dragon Screw Suplex + cd Replaces: Double Dragon Screw 02 P1 does a Dragon screw then picks then up (still holding their feet) and does a capture suplex. + D106B454 3749 + D106B456 007C + 8106B460 00AD + D106B454 3749 + D106B456 007C + 8106B462 DB2A + D106B514 374A + D106B516 007C + 8106B520 00AD + D106B514 374A + D106B516 007C + 8106B522 EAE0 + D106B454 3749 + D106B456 00A5 + 8115AF52 0000 + D106B514 374A + D106B516 00A5 + 8115B2AA 0000 + cn Hacked Moves\Dominator into HHH Facebuster + cd Replaces: Dominator + D106B454 3810 + D106B456 005C + 8106B560 011A + D106B454 3810 + D106B456 005C + 8106B562 A256 + D106B514 3811 + D106B516 005C + 8106B520 011A + D106B514 3811 + D106B516 005C + 8106B522 ACB0 + D106B454 3810 + D106B456 0075 + 8115AF52 0000 + cn Hacked Moves\Capture Tazzplex + cd Replaces: Capture Suplex P1 grabs P2's feet like a capture suplex, then lets go & does a Tazzplex. + D106B454 3689 + D106B456 0021 + 8106B460 00BC + D106B454 3689 + D106B456 0021 + 8106B462 A5E2 + D106B514 368A + D106B516 0021 + 8106B520 00BC + D106B514 368A + D106B516 0021 + 8106B522 B6BE + cn Hacked Moves\Running Rock Bottom + cd Replaces: Farooq Spinebuster P2 runs into P1 and P1 delivers a RockBottom to P2. + D106B454 3A80 + D106B456 0000 + 8106B460 00C1 + D106B454 3A80 + D106B456 0000 + 8106B462 F7A2 + D106B514 3A81 + D106B516 0000 + 8106B520 00C2 + D106B514 3A81 + D106B516 0000 + 8106B522 1210 + cn Hacked Moves\Running Tazplex + cd Replaces: Underhook Belly to Belly P2 runs into P1 and P1 does a Tazplex to P2. + D106B454 3A7A + D106B456 0000 + 8106B460 00BC + D106B454 3A7A + D106B456 0000 + 8106B462 A51E + D106B514 3A7B + D106B516 0000 + 8106B520 00BC + D106B514 3A7B + D106B516 0000 + 8106B522 B5FA + cn Tables\MOVABLE TABLES\Part 1 + cd You must use both parts for this cheat to work + 81052C24 06E1 + 81052C26 06E3 + 81052C2C 09F1 + 81052C2E 09EF + 81052C30 06E2 + 81052C32 06E5 + 81052C38 09F1 + 81052C3A 09EF + 81052C48 06E4 + 81052C4A 06E6 + 81052C50 09EF + 81052C52 09EF + 8116C3E4 0000 + 8116C3E6 0001 + 8116C3E8 0000 + 8116C3EA 0001 + 8116C498 0000 + 8116C49A 0003 + 8116C49C 0000 + 8116C49E 0003 + 8116C330 0000 + 8116C332 0000 + 8116C334 0000 + 8116C336 0000 + D116C556 0000 + 8116C33A 0000 + D116C33A 0000 + 8116C3EE 0000 + D116C3EE 0000 + 8116C4A2 0000 + D116C556 0001 + 8116C33A 0001 + D116C33A 0001 + 8116C3EE 0001 + D116C3EE 0001 + 8116C4A2 0001 + D116C556 0002 + 8116C33A 0002 + D116C33A 0002 + 8116C3EE 0002 + D116C3EE 0002 + 8116C4A2 0002 + D116C556 0003 + 8116C33A 0003 + D116C33A 0003 + 8116C3EE 0003 + D116C3EE 0003 + 8116C4A2 0003 + D116C556 FFFF + 8116C33A FFFF + D116C33A FFFF + 8116C3EE FFFF + D116C3EE FFFF + 8116C4A2 FFFF + D216C556 FFFF + 81079B10 3F80 + D1064886 2000 + 81079B10 3F81 + D106488C 2000 + 81079B10 3F81 + D1064892 2000 + 81079B10 3F81 + cn Tables\MOVABLE TABLES\Part 2 + cd You must use both parts for this cheat to work + D116C33A FFFF + 8116C382 0000 + D116C382 0000 + 8116C386 0000 + D116C386 0000 + 8116C38A 0000 + D116C38A 0000 + 8116C38E 0000 + D116C38E 0000 + 8116C436 0000 + D116C436 0000 + 8116C43A 0000 + D116C43A 0000 + 8116C43E 0000 + D116C43E 0000 + 8116C442 0000 + D116C442 0000 + 8116C4EA 0000 + D116C4EA 0000 + 8116C4EE 0000 + D116C4EE 0000 + 8116C4F2 0000 + D116C4F2 0000 + 8116C4F6 0000 + D116C594 42B4 + D116C556 FFFF + 8116C378 4335 + D116C378 4335 + 8116C42C 4335 + D116C42C 4335 + 8116C4E0 4335 + D116C594 3DC7 + D116C556 FFFF + 8116C378 42B0 + D116C378 42B0 + 8116C42C 42B0 + D116C42C 42B0 + 8116C4E0 42B0 + D1064880 2000 + 81079B10 3F81 + D1079B10 3F81 + D116C594 42B4 + D116C556 FFFF + 8116C378 42F0 + D116C378 42F0 + 8116C42C 42F0 + D116C42C 42F0 + 8116C4E0 42F0 + D1079B10 3F81 + 8116C38A 0F00 + D116C38A 0F00 + 8116C43E 0100 + D116C594 3C93 + 8116C378 42B0 + 81052D18 0000 + 81052D1A 0000 + D116C54C 0000 + 8116C54E 0018 + D116C550 0000 + 8116C552 0018 + cn Tables\Sabu Table + cd Breakable/Fixable/Rebreakable/Refixable press Z to break, C-right + Cdown to fix + 8116C49A 000C + 8116C49E 000C + 8116C4DC 43CC + 8116C4E0 42E6 + 8116C4E4 C2C5 + 8116C4EE 0800 + 8116C602 000C + 8116C606 000C + 8116C648 42E6 + 8116C644 43CC + 8116C64C C314 + 81052C54 06E3 + 81052C5C 09EF + 8116C6F8 43CC + 8116C6FC 42F0 + 8116C700 C2F1 + 8116C70A 0400 + 8116C428 43CC + 8116C430 C2D0 + 8116C42C 42F0 + 8116C43A 0C00 + 8116C6B6 0004 + 8116C6BA 0004 + 8116C3E6 0004 + 8116C3EA 0004 + D1064880 2000 + 81005592 3F81 + D1005592 3F81 + 8116C4EA 0F00 + D1005592 3F81 + 8116C652 0100 + D1005592 3F81 + 8116C4E0 4240 + D1005592 3F81 + 8116C648 4240 + D1064880 0005 + 81005CD4 3F83 + D1005CD4 3F83 + 8116C4EA 0000 + D1005CD4 3F83 + 8116C652 0000 + D1005CD4 3F83 + 8116C4E0 42E6 + D1005CD4 3F83 + 8116C648 42E6 + D1005CD4 3F83 + D1064880 2000 + 81005CD4 0000 + +crc CD5BEC0F-86FD1008-C:45 +gn WWF War Zone (U) + cn Extra Characters + 8113A488 1000 + 8113A48A 07FF + 8113A48C 2000 + 8113A48E 3FFF + cn Infinite Creation Points + 80136245 0000 + +crc 90A59003-31089864-C:45 +gn WWF WrestleMania 2000 (U) + cn Have All Characters + 8109ED5A FFFF + cn Infinite Create-A-Wrestler Attribute Points + 8011A81B 001E + cn Timer Is Always 00:00 + 8016F0AF 0000 + cn Max Attributes + 50000502 0000 + 8011A811 0032 + cn Weapon Select\Player 1 + 81167236 0300 + 81166D90 ???? 0000:"Broom",0101:"Shovel",0202:"Red And White Hockey Stick",0303:"Guitar",0404:"Night Stick",0505:"Head",0606:"Black Hockey Stick",0707:"Bottle",0808:"2x4",0909:"Big Purple Sheet",0A0A:"White Jug",0B0B:"Suit Case",0C0C:"Stick",0D0D:"Head",0E0E:"Big Mallot",0F0F:"Black Microphone",1010:"BaseBall Bat",1111:"Folding Chair",1212:"Board",1313:"Stairs",1414:"Trashcan",FFFF:"Nothing" + 81166D92 0000 + 80166E50 0000 + cn Weapon Select\Player 2 + 811676CA 0300 + 81166DC0 ???? 0000:"Broom",0101:"Shovel",0202:"Red And White Hockey Stick",0303:"Guitar",0404:"Night Stick",0505:"Head",0606:"Black Hockey Stick",0707:"Bottle",0808:"2x4",0909:"Big Purple Sheet",0A0A:"White Jug",0B0B:"Suit Case",0C0C:"Stick",0D0D:"Head",0E0E:"Big Mallot",0F0F:"Black Microphone",1010:"BaseBall Bat",1111:"Folding Chair",1212:"Board",1313:"Stairs",1414:"Trashcan",FFFF:"Nothing" + 80166DC2 0001 + 80166E51 0001 + cn Weapon Select\Player 3 + 81167B5E 0300 + 81166DF0 ???? 0000:"Broom",0101:"Shovel",0202:"Red And White Hockey Stick",0303:"Guitar",0404:"Night Stick",0505:"Head",0606:"Black Hockey Stick",0707:"Bottle",0808:"2x4",0909:"Big Purple Sheet",0A0A:"White Jug",0B0B:"Suit Case",0C0C:"Stick",0D0D:"Head",0E0E:"Big Mallot",0F0F:"Black Microphone",1010:"BaseBall Bat",1111:"Folding Chair",1212:"Board",1313:"Stairs",1414:"Trashcan",FFFF:"Nothing" + 80166DF2 0002 + 80166E52 0002 + cn Weapon Select\Player 4 + 81167FF2 0300 + 81166E18 ???? 0000:"Broom",0101:"Shovel",0202:"Red And White Hockey Stick",0303:"Guitar",0404:"Night Stick",0505:"Head",0606:"Black Hockey Stick",0707:"Bottle",0808:"2x4",0909:"Big Purple Sheet",0A0A:"White Jug",0B0B:"Suit Case",0C0C:"Stick",0D0D:"Head",0E0E:"Big Mallot",0F0F:"Black Microphone",1010:"BaseBall Bat",1111:"Folding Chair",1212:"Board",1313:"Stairs",1414:"Trashcan",FFFF:"Nothing" + 81166E1A 0003 + 80166E53 0003 + cn Always Special\Player 1 + 80167235 0004 + cn Always Special\Player 2 + 801676C9 0004 + cn Always Special\Player 3 + 80167B5D 0004 + cn Always Special\Player 4 + 80167FF1 0004 + cn Specials Don't Run Out + 8112AD94 2400 + cn Max Spirit\Player 1 + 801671F5 00FF + cn Always Normal Spirit\Player 1 + 801671F5 0032 + cn No Spirit\Player 1 + 801671F5 0000 + cn Max Spirit\Player 2 + 80167689 00FF + cn Always Normal Spirit\Player 2 + 80167689 0032 + cn No Spirit\Player 2 + 80167689 0000 + cn Max Spirit\Player 3 + 80167B1D 00FF + cn Always Normal Spirit\Player 3 + 80167B1D 0032 + cn No Spirit\Player 3 + 80167B1D 0000 + cn Max Spirit\Player 4 + 80167FB1 00FF + cn Always Normal Spirit\Player 4 + 80167FB1 0032 + cn No Spirit\Player 4 + 80167FB1 0000 + cn Ultimate Codes\Player 1 + 801671F4 0064 + cn Ultimate Codes\Player 2 + 80167688 0064 + cn Ultimate Codes\Player 3 + 80167B1C 0064 + cn Ultimate Codes\Player 4 + 80167FB0 0064 + cn Easy Pins & Longer Submissions\Player 2 + 80167688 0064 + cn Easy Pins & Longer Submissions\Player 3 + 80167B1C 0064 + cn Easy Pins & Longer Submissions\Player 4 + 80167FB0 0064 + cn Easy Pins & Longer Submissions\Player 1 + 801671F4 0064 + +crc 0553AE9D-EAD8E0C1-C:45 +gn Xena Warrior Princess: The Talisman of Fate (U) + cn 1 Hit to Kill Opponent\Player 1 + D10B6354 42C8 + 810B6354 4080 + cn Opponent Has No Energy\Player 1 + 810B6354 C080 + cn Player 2 Never Wins + 800C0C05 0000 + cn Infinite Health\Player 1 + 810B6170 42C8 + cn Infinite Health\Player 2 + 810B6354 42C8 + cn 1 Hit to Kill Opponent\Player 2 + D10B6170 42C8 + 810B6170 4080 + cn Opponent Has No Energy\Player 2 + 810B6170 C080 + cn Player 1 Never Wins + 800C0C03 0000 + cn Unlock Titan Difficulty Level + 810BF752 0001 + +crc 2337D8E8-6B8E7CEC-C:45 +gn Yoshi's Story (U) + cn Infinite\Health + cd This is for All Yoshis All levels + 8102B780 2400 + cn Infinite\Eggs Once You Get One + cd This is for All Yoshis All levels + 8103E89C 2400 + cn Infinite\Lives + cd This is for All Yoshis All levels + 800F8DF7 00FF + +crc 1D4136F3-AF63EEA9-C:45 +gn Legend of Zelda, The - Ocarina of Time - Master Quest (E) [f1] (NTSC) + cn Infinite\Rupees + cd This cheat allows you to have the max Rupees to the Wallet you currently Hold + 81119D04 0001 + cn Max\Double Defense Power + cd This gives you White Border Hearts + 80118A07 0014 + cn Use Any Item In Any House + cd do not use under or in water + 81119B5A 0000 + 81119B5C 0000 + cn Have\All Equipment + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 811189D4 7777 + cn Have\All Quest/Status Items + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 811189DC 30FF + 811189DE FFFF + cn Max\Heart Containers + 81118966 0140 + cn Max\Gold Skulltulas Killed + 80118A09 0064 + cn Time of Day Modifier + 81118944 ???? 4000:"At Sunrise",5800:"Daylight Out",7000:"Very Bright Out",C000:"At Sunset",D000:"Fairly Dark" + cn Infinite\Energy + 81118968 0140 + cn Infinite\Magic + D0118971 0008 + 80118972 0001 + 80118974 0001 + 8011896B 0060 + cn Tunic & Boot Options + cd This changes what you are wearing,once you have enabled the code press Start & then start again. + 801189A8 ???? 0011:"Kokiri Tunic & Kokiri Boots",0012:"Goron Tunic & Kokiri Boots",0013:"Zora Tunic & Kokiri Boots",0014:"Black Tunic & Kokiri Boots",0015:"White Tunic & Kokiri Boots",0016:"Yellow Tunic & Kokiri Boots",0021:"Kokiri Tunic & Iron Boots",0022:"Goron Tunic & Iron Boots",0023:"Zora Tunic & Iron Boots",0024:"Black Tunic & Iron Boots",0025:"White Tunic & Iron Boots",0026:"Yellow Tunic & Iron Boots",0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Infinite\Deku Sticks + 801189C4 0009 + cn Infinite\Deku Nuts + 801189C5 0009 + cn Infinite\Bombs + 801189C6 0009 + cn Infinite\Arrows + 801189C7 0009 + cn Infinite\Deku Seeds + 801189CA 0009 + cn Infinite\Bombchu's + 801189CC 0009 + cn Infinite\Magic Beans + 801189D2 0009 + cn Infinite\Big Key,Small Keys,Compass,& Map + 801189E0 0007 + 801189E1 0007 + 801189E2 0007 + 801189E3 0007 + 801189E4 0007 + 801189E5 0007 + 801189E6 0007 + 801189E7 0007 + 801189E8 0007 + 801189E9 0007 + 801189EA 0007 + 801189F7 0009 + 801189F8 0009 + 801189F9 0009 + 801189FA 0009 + 801189FB 0009 + 80118A01 0009 + 80118A04 0009 + 801189FF 0009 + cn Have\Ocarina + 801189B3 ???? 0007:"Fairy Ocarina",0008:"Ocarina Of Time" + cn Have\Boomerang + 801189B8 000E + cn Have\Lens of Truth + 801189B9 000F + cn Have\Megaton Hammer + 801189BB 0011 + cn Have\Deku Stick + 801189AC 0000 + cn Have\Deku Nut + 801189AD 0001 + cn Have\Bombs + 801189AE 0002 + cn Have\Fairy Bow + 801189AF 0003 + cn Have\Fairy Slingshot + 801189B2 0006 + cn Have\Bombchu + 801189B4 0009 + cn Have\Arrows\Fire Arrow + 801189B0 0004 + cn Have\Arrows\Ice Arrow + 801189B6 000C + cn Have\Arrows\Light Arrow + 801189BC 0012 + cn Have\Hookshot + 801189B5 ???? 000A:"Hookshot",000B:"Longshot" + cn Have\Magic Beans + 801189BA 0010 + cn Have\Magic\Fairie's Wind + 801189B7 000D + cn Have\Magic\Nayru's Love + 801189BD 0013 + cn Have\Magic\Din's Fire + 801189B1 0005 + cn Bottles\Bottle 1 Modifier + 801189BE ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 2 Modifier + 801189BF ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 3 Modifier + 801189C0 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 4 Modifier + 801189C1 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Trading\Adult Link Item + 801189C2 ???? 002D:"Pocket Egg",002E:"Pocket Cucco",002F:"Cojiro",0030:"Odd Mushroom",0031:"Odd Potion",0032:"Poacher's Saw",0033:"Goron's Sword (Broken)",0034:"Prescription",0035:"Eyeball Frog",0036:"Eye Drops",0037:"Claim Check" + cn Trading\Young Link Item + 801189C3 ???? 0021:"Weird Egg",0022:"Chicken",0023:"Zelda's Letter",0024:"Keaton Mask",0025:"Skull Mask",0026:"Spooky Mask",0027:"Bunny Hood",0028:"Goron Mask",0029:"Zora Mask",002A:"Gerudo Mask",002B:"Mask of Truth",002C:"SOLD OUT" + cn Turn Giant's Knife Into Biggoron's Sword + 80118976 0001 + cn Have Quiver (Holds 30) + 801189D9 0001 + cn Equipment Modifier 1 + cd This modifies the equipment you are carrying. + 801189DA ???? 0002:"Silver Scale",0004:"Golden Scale",0006:"Giant's Knife (Broken)",0035:"Black Gauntlets",0040:"Bullet Bag (Holds 30)",0080:"Bullet Bag (Holds 40)",00C0:"Bullet Bag (Holds 50)" + cn Equipment Modifier 2 + cd This modifies the equipment you are carrying. + 801189DB ???? 0008:"Bomb Bag (Holds 20)",0010:"Bomb Bag (Holds 30)",0018:"Bomb Bag (Holds 40)",0020:"Goron's Bracelet",0028:"Silver Gauntlets",0030:"Golden Gauntlets" + cn Warp Song Location\Minuet of Forest & Serenade of Water + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 80119CCD ???? 0000:"Sacred Forest Meadow",0004:"Lake Hylia",0015:"Inside Jabu Jabu's Belly",0018:"Dodongo's Cavern",0068:"Inside The Deku Tree" + cn Warp Song Location\Prelude of Light & Nocturne of Shadow + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 80119CCD ???? 0003:"Kakariko Windmill",0007:"Bombchu Bowling Alley",000F:"Zelda & Impa Flee",0014:"Kakariko Village",0017:"Ganon,Final Battle",001D:"Top of Ganon's Tower",0028:"Bombchu Shop",002C:"Bazaar",0030:"Happy Mask Shop",0034:"Ganon's Tower",0038:"Ganon's Castle",004C:"Inside Spirit Door",006C:"Burning Castle",0050:"House of Skulltula",0064:"Death Mountain Trail",0068:"Graveyard",0070:"Thieves' Hideout",0074:"Royal Family's Tomb",0078:"Great Fairy Fountain 1",0084:"Forest Temple,Room With Falling Floor",0088:"Great Fairy Fountain 2",0099:"Grotto 01",009D:"Grotto 02",00A4:"Grotto 04",00A8:"Grotto 05",00B3:"Grotto 06",00B0:"Grotto 07",00B4:"Grotto 08",00B8:"Grotto 09",00C3:"Grotto 10",00C0:"Grotto 11",00C4:"Grotto 12",00FC:"Grotto 13",00D3:"Bottom of the Well",00D0:"Lon Lon Ranch Shed",00D3:"Lon Lon Ranch Outside Shed",00D8:"Ice Cavern",00E3:"Outside Cow Pen",00E0:"Lost Woods Bridge",00E4:"Lon Lon Ranch Chicken Room",00E8:"In Front of Deku Tree",00EB:"Spirit Temple Boss",00F1:"Castle Courtyard,In Front of Zelda",00F4:"Temple of Time",00F8:"Gerudo Fortress Jail" + cn Warp Song Location\Bolero of Fire + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 80119CCD ???? 0003:"Castle Courtyard",000B:"Dodongo's Cavern Boss",0010:"Inside The Deku Tree Boss",0014:"Shadow Temple Boss",0017:"Water Temple Boss",001C:"Ganon's Castle Tower",001F:"Ganon First Battle",0028:"Ganon's Castle Room Before Ganon",002B:"Inside Ganon's Castle Room With Pillar",002F:"Lon Lon Ranch",0033:"Mido's House",0037:"Saria's House",004B:"Bearded Man's House",0040:"Top of Ganon's Castle",0047:"Outside Saria's House",004F:"Dampe's Race",0057:"Kokiri Forest",005B:"Top of Death Mountain",005F:"Fishing Pond",0068:"Inside Ganon's Castle",007F:"Hyrule Castle Gate",00BA:"Top of Ganon's Tower",00C2:"Great Fairy Fountain",00D6:"Lost Woods Goron Entrance",00DA:"Lost Woods River Entrance",00DE:"Lost Woods Bridge Field Entrance",00E3:"Goron City Lost Woods Entrance",00F6:"Death Mountain Crater",00FD:"Ganon's Castle" + cn Warp Song Location\Requiem of Spirit + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 80119CCD ???? 0005:"Lake Hylia",0008:"Zora's Domain",0018:"Gerudo Valley",001E:"Lost Woods",0028:"Gerudo Fortress",0030:"Haunted Wasteland",0034:"Ganon's Castle Inside Burning Castle",0038:"Hyrule Castle",003A:"Ganon's Castle",003D:"Death Mountain Trail",004D:"Goron City",0065:"Fire Temple",0069:"Forest Temple",006E:"Shooting Gallery",0079:"Ganon's Castle Inside Burning Castle",007E:"Kakariko Village Entrance",007B:"Zora's River Entrance",0085:"Kokiri Forest Entrance",008A:"Lake Hyrule Entrance",008E:"Gerudo Valley Entrance",0092:"Death Mountain Trail Entrance",0095:"Graveyard Entrance",009E:"Zora's Domain Entrance",00A2:"Zora's Fountain Entrance",00BA:"Goron City Entrance",00BE:"Death Mountain Trail",00C1:"Goron City",00C5:"Lakeside Laboratory",00C9:"Top of Ganon's Castle",00CD:"Hyrule Market (Child Link's)",00CF:"Hyrule Market (Adult Link's)",00F1:"Desert Colossus",00FA:"Lon Lon Ranch Entrance",00FD:"Hyrule Field" + cn Nayru's Love is Always + cd For this to work On Or off, you have to walk through a Doorway to activate the Change. + 81119D00 ???? 0000:"OFF",FFFF:"ON" + cn Infinite\Timers\All Other Timers + cd This cheat works on all Race Timers not the final Boss and Under Water with iron Boots etc. + 8011B9A1 0032 + cn Epona\Max Carrots\Lon Lon Raunch + cd This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona + 801F1A68 0005 + 801EE508 0005 + cn Infinite\Timers\Escape From Gannons Tower + cd This cheat works only on The Final Boss. + 80119D0D 00B4 + cn Beta\Play Beta Quest Worlds + cd Put on the code on load up,& then press reset (F1) you will be in Beta Mode,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. + D011BB71 0000 + 80119D4B ???? 0000:"World 01",0001:"World 02",0002:"World 03",0003:"World 04",0004:"World 05",0007:"World 06",0008:"World 07",0016:"World 08" + cn Level Select + D01C6E35 0000 + 8111893A ???? 0000:"Inside the Deku Tree",0004:"Dodongo's Cavern",0008:"Gerudo Training Ground",000C:"Below The Phantom Gannon Boss",0010:"Water Temple",0027:"Inside Jabu-Jabu's Belly",002C:"Royal Family's Tomb",0036:"Shoadow Temple",0042:"Lakeside Laboratory",0052:"Temple Of Time",006C:"?" + cn Language Select + 80119D41 ???? 0000:"English",0001:"German",0002:"French" + cn Press L\To Levitate + cd Press L To Levitate & Let go to land + D011BB11 0020 + 811D93D0 40CB + cn Press L\For Infinite Hover Boots + cd Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on + D011BB11 0020 + 811D9BF2 000D + cn Instant Step Hoover Boots + cd Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. + D011BB11 0020 + 811D93D0 40CB + D011BB11 0000 + 811D9BF2 000D + 801189A8 ???? 0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Beta\Specific things lean + cd This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest World 01) + 8002397C 0001 + cn Beta\Appear in Strange Places (Hold R) + cd If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. + D01C681D 0010 + 81119C9E 0001 + cn Beta\Interface always off/on + cd If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset. + 80119821 00FF + 80119C97 ???? 0000:"Off",0001:"On" + cn Always Have Wallet Size + 801189DA ???? 0047:"Kid Wallet (Holds 99)",0057:"Adult Wallet (Holds 200)",0067:"Giant Wallet (Holds 500)" + +crc 27A3831D-B505A533-C:45 +gn Legend of Zelda, The - Ocarina of Time - Master Quest (E) [f2] +//--------------- PAL (E) Region Cheat Codes + cn Infinite\Rupees + cd This cheat allows you to have the max Rupees to the Wallet you currently Hold + 81119D04 0001 + cn Max\Double Defense Power + cd This gives you White Border Hearts + 80118A07 0014 + cn Use Any Item In Any House + cd do not use under or in water + 81119B5A 0000 + 81119B5C 0000 + cn Have\All Equipment + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 811189D4 7777 + cn Have\All Quest/Status Items + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 811189DC 30FF + 811189DE FFFF + cn Max\Heart Containers + 81118966 0140 + cn Max\Gold Skulltulas Killed + 80118A09 0064 + cn Time of Day Modifier + 81118944 ???? 4000:"At Sunrise",5800:"Daylight Out",7000:"Very Bright Out",C000:"At Sunset",D000:"Fairly Dark" + cn Infinite\Energy + 81118968 0140 + cn Infinite\Magic + D0118971 0008 + 80118972 0001 + 80118974 0001 + 8011896B 0060 + cn Tunic & Boot Options + cd This changes what you are wearing,once you have enabled the code press Start & then start again. + 801189A8 ???? 0011:"Kokiri Tunic & Kokiri Boots",0012:"Goron Tunic & Kokiri Boots",0013:"Zora Tunic & Kokiri Boots",0014:"Black Tunic & Kokiri Boots",0015:"White Tunic & Kokiri Boots",0016:"Yellow Tunic & Kokiri Boots",0021:"Kokiri Tunic & Iron Boots",0022:"Goron Tunic & Iron Boots",0023:"Zora Tunic & Iron Boots",0024:"Black Tunic & Iron Boots",0025:"White Tunic & Iron Boots",0026:"Yellow Tunic & Iron Boots",0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Infinite\Deku Sticks + 801189C4 0009 + cn Infinite\Deku Nuts + 801189C5 0009 + cn Infinite\Bombs + 801189C6 0009 + cn Infinite\Arrows + 801189C7 0009 + cn Infinite\Deku Seeds + 801189CA 0009 + cn Infinite\Bombchu's + 801189CC 0009 + cn Infinite\Magic Beans + 801189D2 0009 + cn Infinite\Big Key,Small Keys,Compass,& Map + 801189E0 0007 + 801189E1 0007 + 801189E2 0007 + 801189E3 0007 + 801189E4 0007 + 801189E5 0007 + 801189E6 0007 + 801189E7 0007 + 801189E8 0007 + 801189E9 0007 + 801189EA 0007 + 801189F7 0009 + 801189F8 0009 + 801189F9 0009 + 801189FA 0009 + 801189FB 0009 + 80118A01 0009 + 80118A04 0009 + 801189FF 0009 + cn Have\Ocarina + 801189B3 ???? 0007:"Fairy Ocarina",0008:"Ocarina Of Time" + cn Have\Boomerang + 801189B8 000E + cn Have\Lens of Truth + 801189B9 000F + cn Have\Megaton Hammer + 801189BB 0011 + cn Have\Deku Stick + 801189AC 0000 + cn Have\Deku Nut + 801189AD 0001 + cn Have\Bombs + 801189AE 0002 + cn Have\Fairy Bow + 801189AF 0003 + cn Have\Fairy Slingshot + 801189B2 0006 + cn Have\Bombchu + 801189B4 0009 + cn Have\Arrows\Fire Arrow + 801189B0 0004 + cn Have\Arrows\Ice Arrow + 801189B6 000C + cn Have\Arrows\Light Arrow + 801189BC 0012 + cn Have\Hookshot + 801189B5 ???? 000A:"Hookshot",000B:"Longshot" + cn Have\Magic Beans + 801189BA 0010 + cn Have\Magic\Fairie's Wind + 801189B7 000D + cn Have\Magic\Nayru's Love + 801189BD 0013 + cn Have\Magic\Din's Fire + 801189B1 0005 + cn Bottles\Bottle 1 Modifier + 801189BE ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 2 Modifier + 801189BF ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 3 Modifier + 801189C0 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 4 Modifier + 801189C1 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Trading\Adult Link Item + 801189C2 ???? 002D:"Pocket Egg",002E:"Pocket Cucco",002F:"Cojiro",0030:"Odd Mushroom",0031:"Odd Potion",0032:"Poacher's Saw",0033:"Goron's Sword (Broken)",0034:"Prescription",0035:"Eyeball Frog",0036:"Eye Drops",0037:"Claim Check" + cn Trading\Young Link Item + 801189C3 ???? 0021:"Weird Egg",0022:"Chicken",0023:"Zelda's Letter",0024:"Keaton Mask",0025:"Skull Mask",0026:"Spooky Mask",0027:"Bunny Hood",0028:"Goron Mask",0029:"Zora Mask",002A:"Gerudo Mask",002B:"Mask of Truth",002C:"SOLD OUT" + cn Turn Giant's Knife Into Biggoron's Sword + 80118976 0001 + cn Have Quiver (Holds 30) + 801189D9 0001 + cn Equipment Modifier 1 + cd This modifies the equipment you are carrying. + 801189DA ???? 0002:"Silver Scale",0004:"Golden Scale",0006:"Giant's Knife (Broken)",0035:"Black Gauntlets",0040:"Bullet Bag (Holds 30)",0080:"Bullet Bag (Holds 40)",00C0:"Bullet Bag (Holds 50)" + cn Equipment Modifier 2 + cd This modifies the equipment you are carrying. + 801189DB ???? 0008:"Bomb Bag (Holds 20)",0010:"Bomb Bag (Holds 30)",0018:"Bomb Bag (Holds 40)",0020:"Goron's Bracelet",0028:"Silver Gauntlets",0030:"Golden Gauntlets" + cn Warp Song Location\Minuet of Forest & Serenade of Water + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 80119CCD ???? 0000:"Sacred Forest Meadow",0004:"Lake Hylia",0015:"Inside Jabu Jabu's Belly",0018:"Dodongo's Cavern",0068:"Inside The Deku Tree" + cn Warp Song Location\Prelude of Light & Nocturne of Shadow + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 80119CCD ???? 0003:"Kakariko Windmill",0007:"Bombchu Bowling Alley",000F:"Zelda & Impa Flee",0014:"Kakariko Village",0017:"Ganon,Final Battle",001D:"Top of Ganon's Tower",0028:"Bombchu Shop",002C:"Bazaar",0030:"Happy Mask Shop",0034:"Ganon's Tower",0038:"Ganon's Castle",004C:"Inside Spirit Door",006C:"Burning Castle",0050:"House of Skulltula",0064:"Death Mountain Trail",0068:"Graveyard",0070:"Thieves' Hideout",0074:"Royal Family's Tomb",0078:"Great Fairy Fountain 1",0084:"Forest Temple,Room With Falling Floor",0088:"Great Fairy Fountain 2",0099:"Grotto 01",009D:"Grotto 02",00A4:"Grotto 04",00A8:"Grotto 05",00B3:"Grotto 06",00B0:"Grotto 07",00B4:"Grotto 08",00B8:"Grotto 09",00C3:"Grotto 10",00C0:"Grotto 11",00C4:"Grotto 12",00FC:"Grotto 13",00D3:"Bottom of the Well",00D0:"Lon Lon Ranch Shed",00D3:"Lon Lon Ranch Outside Shed",00D8:"Ice Cavern",00E3:"Outside Cow Pen",00E0:"Lost Woods Bridge",00E4:"Lon Lon Ranch Chicken Room",00E8:"In Front of Deku Tree",00EB:"Spirit Temple Boss",00F1:"Castle Courtyard,In Front of Zelda",00F4:"Temple of Time",00F8:"Gerudo Fortress Jail" + cn Warp Song Location\Bolero of Fire + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 80119CCD ???? 0003:"Castle Courtyard",000B:"Dodongo's Cavern Boss",0010:"Inside The Deku Tree Boss",0014:"Shadow Temple Boss",0017:"Water Temple Boss",001C:"Ganon's Castle Tower",001F:"Ganon First Battle",0028:"Ganon's Castle Room Before Ganon",002B:"Inside Ganon's Castle Room With Pillar",002F:"Lon Lon Ranch",0033:"Mido's House",0037:"Saria's House",004B:"Bearded Man's House",0040:"Top of Ganon's Castle",0047:"Outside Saria's House",004F:"Dampe's Race",0057:"Kokiri Forest",005B:"Top of Death Mountain",005F:"Fishing Pond",0068:"Inside Ganon's Castle",007F:"Hyrule Castle Gate",00BA:"Top of Ganon's Tower",00C2:"Great Fairy Fountain",00D6:"Lost Woods Goron Entrance",00DA:"Lost Woods River Entrance",00DE:"Lost Woods Bridge Field Entrance",00E3:"Goron City Lost Woods Entrance",00F6:"Death Mountain Crater",00FD:"Ganon's Castle" + cn Warp Song Location\Requiem of Spirit + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 80119CCD ???? 0005:"Lake Hylia",0008:"Zora's Domain",0018:"Gerudo Valley",001E:"Lost Woods",0028:"Gerudo Fortress",0030:"Haunted Wasteland",0034:"Ganon's Castle Inside Burning Castle",0038:"Hyrule Castle",003A:"Ganon's Castle",003D:"Death Mountain Trail",004D:"Goron City",0065:"Fire Temple",0069:"Forest Temple",006E:"Shooting Gallery",0079:"Ganon's Castle Inside Burning Castle",007E:"Kakariko Village Entrance",007B:"Zora's River Entrance",0085:"Kokiri Forest Entrance",008A:"Lake Hyrule Entrance",008E:"Gerudo Valley Entrance",0092:"Death Mountain Trail Entrance",0095:"Graveyard Entrance",009E:"Zora's Domain Entrance",00A2:"Zora's Fountain Entrance",00BA:"Goron City Entrance",00BE:"Death Mountain Trail",00C1:"Goron City",00C5:"Lakeside Laboratory",00C9:"Top of Ganon's Castle",00CD:"Hyrule Market (Child Link's)",00CF:"Hyrule Market (Adult Link's)",00F1:"Desert Colossus",00FA:"Lon Lon Ranch Entrance",00FD:"Hyrule Field" + cn Nayru's Love is Always + cd For this to work On Or off, you have to walk through a Doorway to activate the Change. + 81119D00 ???? 0000:"OFF",FFFF:"ON" + cn Infinite\Timers\All Other Timers + cd This cheat works on all Race Timers not the final Boss and Under Water with iron Boots etc. + 8011B9A1 0032 + cn Epona\Max Carrots\Lon Lon Raunch + cd This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona + 801F1A68 0005 + 801EE508 0005 + cn Infinite\Timers\Escape From Gannons Tower + cd This cheat works only on The Final Boss. + 80119D0D 00B4 + cn Beta\Play Beta Quest Worlds + cd Put on the code on load up,& then press reset (F1) you will be in Beta Mode,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. + D011BB71 0000 + 80119D4B ???? 0000:"World 01",0001:"World 02",0002:"World 03",0003:"World 04",0004:"World 05",0007:"World 06",0008:"World 07",0016:"World 08" + cn Level Select + D01C6E35 0000 + 8111893A ???? 0000:"Inside the Deku Tree",0004:"Dodongo's Cavern",0008:"Gerudo Training Ground",000C:"Below The Phantom Gannon Boss",0010:"Water Temple",0027:"Inside Jabu-Jabu's Belly",002C:"Royal Family's Tomb",0036:"Shoadow Temple",0042:"Lakeside Laboratory",0052:"Temple Of Time",006C:"?" + cn Language Select + 80119D41 ???? 0000:"English",0001:"German",0002:"French" + cn Press L\To Levitate + cd Press L To Levitate & Let go to land + D011BB11 0020 + 811D93D0 40CB + cn Press L\For Infinite Hover Boots + cd Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on + D011BB11 0020 + 811D9BF2 000D + cn Instant Step Hoover Boots + cd Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. + D011BB11 0020 + 811D93D0 40CB + D011BB11 0000 + 811D9BF2 000D + 801189A8 ???? 0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Beta\Specific things lean + cd This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest World 01) + 8002397C 0001 + cn Beta\Appear in Strange Places (Hold R) + cd If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. + D01C681D 0010 + 81119C9E 0001 + cn Beta\Interface always off/on + cd If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset. + 80119821 00FF + 80119C97 ???? 0000:"Off",0001:"On" + cn Always Have Wallet Size + 801189DA ???? 0047:"Kid Wallet (Holds 99)",0057:"Adult Wallet (Holds 200)",0067:"Giant Wallet (Holds 500)" + +crc 0414CA61-2E57B8AA-C:50 +gn GOLDENEYE + cn Enemies Do Nothing + 80027E54 00FF + cn Enemy Options + cd "These Codes Are very very cool but in most places pointless ! But great fun, try then. But remember to deactivate them before coming to the end of the level, otherwise, there will be nothing/no one, to meet or do (:" + 80032142 ???? 0001:"Enemies Come After You",0097:"Enemies Move Around & Check",00FF:"Enemies Check Around Themselves" + cn Enable All Levels & In-Built Cheat Menu + cd This code gives you all of the levels, all of the in-game cheats, and the special 007 mode!Hit the "A" button until you come to the place where you choose your level. EVERY SINGLE ONE SHOULD BE THERE. Hit "B" again and check out the Cheats. ALL 23 SHOULD BE THERE. When you pick your stage, you will see another difficulty level, "007". This is the level editor, where you can change all kinds of stuff! + 8105886E FFFF + 80058870 00FF + 800588A5 00FF + 800588A7 00FF + 800588AA 00FF + 800588AC 00FF + 800588AF 00FF + 800588B1 00FF + 800588BB 00FF + 800588B6 00FF + 800588B9 00FF + 800588BB 00FF + cn All Objectives Complete + 80064C9B 0001 + 80064C9F 0001 + 80064CA3 0001 + 80064CA7 0001 + 80064CAB 0001 + cn Freeze Unfreeze enemies + cd Press C-Up To Freeze & C-Down To Unfreeze. + D00572D1 0008 + 80027E5C 000F + D00572D1 0004 + 80027E5C 0000 + cn Cradle in multiplayer + cd Puts the cradle graphic in the levels screen where the facility normally is in the multiplayer levels screen.Warning it doesn't allow you to enter the multiplayer levels screen,it should automatically have selected cradle, which cannot be changed from the multiplayer menus + 8002666D 0092 + 8002666F 0093 + 80026677 0029 + 80026673 0008 + 803230C5 0052 + 803230C6 0041 + 803230C7 0044 + 803230C8 004C + 803230C9 0045 + cn Facility Back Zone In Multiplayer\Part 1\2 players + cd All parts must be on for this code to work.this cheat allows you to play the Facility Back Zone In Multiplayer + 811E6554 45E4 + 811E6558 43D5 + 811E655C C5A7 + 811E657C 801C + 811E657E 6774 + 811E5164 45E4 + 811E5168 C383 + 811E516C 4492 + 811E518C 801C + 811E518E D574 + 811E78C0 45AD + 811E78C4 C383 + 811E78C8 4440 + 811E78E8 801C + 811E78EA E464 + 811E4D18 45D0 + 811E4D1C 4307 + 811E4D20 C4FB + 811E4D40 801C + 811E4D42 75EC + 811E6738 45CD + 811E673C C383 + 811E6740 43F4 + 811E6760 801C + 811E6762 A0DC + 811E5450 45C2 + 811E5454 4356 + 811E5458 C598 + 811E5478 801C + 811E547A 6A74 + 811E5240 4608 + 811E5244 4307 + 811E5248 43DC + 811E5268 801C + 811E526A 962C + 811E691C 4606 + 811E6920 4321 + 811E6924 449D + 811E6944 801C + 811E6946 CBEC + 801ED447 008A + 801ED4DB 008B + 801ED56F 008C + 801ED603 008D + 801ED697 008E + 801ED72B 008F + 801ED7BF 007D + 801ED853 007E + 801ED443 002A + 801ED4D7 002A + 801ED56B 002A + 801ED5FF 002A + 801ED693 002A + 801ED727 002A + 801ED7BB 002A + 801ED84F 002A + 801ED449 0000 + 801ED4DD 0000 + 801ED571 0000 + 801ED605 0000 + 801ED699 0000 + 801ED72D 0000 + 801ED7C1 0000 + 801ED855 0000 + 801ED44D 0000 + 801ED4E1 0000 + 801ED575 0000 + 801ED609 0000 + 801ED69D 0000 + 801ED731 0000 + 801ED7C5 0000 + 801ED859 0000 + 801EB743 002A + 801EB745 0068 + 811EB746 277F + 811EB748 1000 + 811EB74A 0262 + 811EB7C2 0190 + 801EB7C5 0000 + 811EB7C6 0258 + cn Facility Back Zone In Multiplayer\Part 2\2 players + cd All parts must be on for this code to work.this cheat allows you to play the Facility Back Zone In Multiplayer + 811EB7C8 0000 + 811EB7CC FFFF + 811EB7CE FFFF + 811EB7D2 0000 + 801EB7D5 0000 + 801EB7DB 0000 + 811EB7E2 0000 + 801EB7E7 0000 + 801EB843 002A + 801EB845 0068 + 811EB846 2780 + 811EB848 1000 + 811EB84A 0262 + 811EB8C2 0190 + 801EB8C5 0000 + 811EB8C6 0258 + 811EB8C8 0000 + 811EB8CC FFFF + 811EB8CE FFFF + 811EB8D2 0000 + 801EB8D5 0000 + 801EB8DB 0000 + 811EB8E2 0000 + 801EB8E7 0000 + 801EB943 002A + 801EB945 0068 + 811EB946 2791 + 811EB948 1000 + 811EB94A 0262 + 811EB9C2 0190 + 801EB9C5 0000 + 811EB9C6 0258 + 811EB9C8 0000 + 811EB9CC FFFF + 811EB9CE FFFF + 811EB9D2 0000 + 801EB9D5 0000 + 801EB9DB 0000 + 811EB9E2 0000 + 801EB9E7 0000 + 801EBA43 002A + 801EBA45 0068 + 811EBA46 2792 + 811EBA48 1000 + 811EBA4A 0262 + 811EBAC2 0190 + 801EBAC5 0000 + 811EBAC6 0258 + 811EBAC8 0000 + 811EBACC FFFF + 811EBACE FFFF + 811EBAD2 0000 + 801EBAD5 0000 + 801EBADB 0000 + 811EBAE2 0000 + 801EBAE7 0000 + 801EBB45 00A0 + 801EBC45 00A0 + 801EBD45 00A0 + 801EBE45 00A0 + 801EBB47 0075 + 801EBC47 0076 + 801EBD47 0077 + 801EBE47 0078 + 801EBBE7 0001 + 801EBCE7 0001 + 801EBDE7 0001 + 801EBEE7 0001 + 801EC247 0071 + 801ECD47 0072 + 801ECE47 0074 + 801ECF47 006C + 801ED047 0079 + 801ED147 0083 + D01EBFC5 005A + 801EBFC5 0000 + D11EBFC6 0000 + 811EBFC6 F333 + D11EBFC8 03E8 + 811EBFC8 0000 + cn Facility Back Zone In Multiplayer\Part 3\2 players + cd All parts must be on for this code to work.this cheat allows you to play the Facility Back Zone In Multiplayer + D11EBFCA 0000 + 811EBFCA F0C4 + D11EBFCE 4CCC + 811EBFCE 000A + D11EBFD2 4CCC + 811EBFD2 000A + D11EBFD4 0003 + 811EBFD4 0000 + D11EBFD6 0000 + 811EBFD6 02C4 + 801EBFD9 0004 + 801EBFDB 0000 + 811EBFE2 0384 + 801EBFE7 0004 + 801EBF45 009E + 801EBF47 0084 + 801EBF48 0010 + 801EC2D9 0000 + 801EC447 0085 + 801EC547 0086 + 811EA6B6 2743 + 811EA73E 0114 + 811EA7F2 0115 + 811EA8A6 00A3 + 811EA92E 009D + 811EA9E2 00A4 + 811EAA96 00DA + 811EAB1E 00DB + 811EABD2 00DF + 811EAC86 0130 + 811EAD0E 008D + 811EADC2 012E + 811EAE76 0111 + 811EAEFE 2740 + 811EAFB2 2741 + 811EB066 00A0 + 811EB0EE 009E + 811EB1A2 009F + 811EB256 274F + 811EB2DE 2750 + 811EB392 0117 + 811EB446 0131 + 811EB4CE 008E + 811EB582 0132 + 811EB636 00A1 + 811EB6BE 0119 + 811EA62E 00FA + 801ED3DF 0000 + 801ED2DF 0001 + D0024337 0007 + 80024337 001F + cn All 64 Characters In Multi Player + 800266E7 0040 + cn Replace Cradle with Citadell hidden level + 80025E47 0029 + 8103DB6A D9B4 + 8103DB70 3F44 + 8103DB72 BDEA + 8103DB74 3F80 + 8103DB76 0000 + 8103DB78 4219 + 8103DB7A D89D + 81058EC0 C470 + cn Secret Island on Dam Level + cd For the above code to work,Get to the 2nd guard tower & go down the ladder on the left hand side & to the end of the Dock, Press L & GS and you will be transfered in the water. Just keep walking straight & you will get to it. Obviously you can't actually climb ladders or anything, you will simply walkthrough anything on that Part, if you want to walk back to the Dock, when you come near it click the cheat back on & keep pressing L & GS untill you are back on it. + D004C2D1 0020 + 800BA78D 0050 + 880BA78D 0000 + +crc 3B941695-F90A5EEB-C:50 +gn 007 The World is Not Enough (E) + cn Invincible + 811147D8 0101 + cn Access Levels & Difficulties + 81103B66 0021 + 50000D01 0000 + 80118F38 0001 + cn Infinite Time + 81103B82 0000 + cn Infinite Oxygen + 800E25E4 0004 + cn Multi Player\Access All Arenas + 801147EB 0001 + 811147EC 0101 + 801147EE 0001 + cn Multi Player\Access All Scenarios + 801147EF 0001 + 811147F0 0101 + cn Multi Player\Access All Weapon Modes + 811147F2 0101 + 801147F4 0001 + cn Multi Player\Access All Evil Skins + 50005C0C 0000 + 800C0167 0081 + cn Multi Player\Access Good Q + 800C06EF 0001 + cn Multi Player\Access Evil Q + 800C06EF 0081 + cn Multi Player\Invincible + 811147D8 0101 + +crc 58FD3F25-D92EAA8D-C:50 +gn 1080 SNOWBOARDING + cn Infinite Damage All Players and Levels + 803F4C01 0000 + cn Prees L For Infinite Lives & Continues + cd Whenever you've lost a life, Press L.Do not press L when on the main menu or during the intro Only use this feature in Match Race + D00556A9 0020 + 8026B14B 0003 + cn Enable All Levels & Boarders + 80250AB9 00FF + 80250ABB 0005 + 81250AC6 FCFF + 80250AC8 0007 + cn Stop Timer\Time Attack\Air Make + 8031AA4A 0000 + cn Stop Timer\Time Attack\Half Pipe + 802F638A 0000 + cn Stop Timer\Time Attack\Crystal Lake + 802A582A 0000 + cn Stop Timer\Time Attack\Crystal Peak + 802B2BCA 0000 + cn Stop Timer\Time Attack\Golden Forrest + 802B135A 0000 + cn Stop Timer\Time Attack\Mountain Village + 802CB95A 0000 + cn Stop Timer\Time Attack\Dragon Cave + 802C137A 0000 + cn Stop Timer\Time Attack\Deadly Fall + 802CF56A 0000 + cn Stop Timer\Trick Attack\Air Make + 8031AABA 00C5 + cn Stop Timer\Trick Attack\Half Pipe + 802F63FA 00C5 + cn Stop Timer\Trick Attack\Crystal Lake + 8029F66A 00C5 + cn Stop Timer\Trick Attack\Crystal Peak + 802AC8EA 00C5 + cn Stop Timer\Trick Attack\Golden Forrest + 802AAF5A 00C5 + cn Stop Timer\Trick Attack\Mountain Village + 802C50DA 00C5 + cn Stop Timer\Trick Attack\Dragon Cave + 802BAD3A 00C5 + cn Stop Timer\Trick Attack\Deadly Fall + 802C8E0A 00C5 + cn Stop Timer\Contest\Crystal Lake + 8029C0DA 00C5 + cn Stop Timer\Contest\Crystal Peak + 802A889A 00C5 + cn Stop Timer\Contest\Golden Forest + 802A6D3A 00C5 + cn Stop Timer\Contest\Air Make + 80319BBA 00C5 + cn Stop Timer\Contest\Half Pipe + 802F51FA 00C5 + cn Play As + 8001A0E7 ???? 0000:"Dion Blaster",0001:"Kensuke Kimachi",0002:"Akari Hayami",0003:"Ricky Winterborn",0004:"Rob Haywood",0005:"Silver Boarder",0006:"Gold Boarder",0007:"Panda Boarder" + +crc 8F12C096-45DC17E1-C:50 +gn A Bug's Life + cn Infinite\Lives + 801E2460 0009 + cn Infinite\Health + 801E2455 0004 + cn Always Have\Super Jump + 811E2450 0020 + cn Always Have\50 pieces of corn + 801E2461 0032 + cn Have F-L-I-K + 801E2462 000F + cn Levitate + cd "Press R To Levitate & Let go to land (:" + D008FCE1 0010 + 801E23C6 0001 + D008FCE1 0010 + 801E23D6 0001 + cn Unlock All Levels + 81099B70 000F + cn Have All Goldberry Tokens + D01E244E 0000 + 801E244E 0000 + cn Start with Berry Weapon + 801E2457 ???? 0001:"Blueberry",0002:"Homing Berry",0003:"Goldberry",0004:"Super Berry ?" + cn All enemies killed + 801E244E 0000 + 801E244F 0000 + +crc 62F6BE95-F102D6D6-C:50 +gn AERO FIGHTERS ASSAUL + cn Extra Planes + 8127D69C FFFF + cn Infinite\99 Lives + 80355748 0063 + cn 99 Bonus + 80131537 0063 + cn 99 Accuracy + 80131530 0063 + cn Gun Select + 8027E9D3 ???? 0000:"Chaff",0001:"Jammings",0002:"Air Mines",0003:"Mahibishi",000A:"22mm BB Shot",000B:"22mm",000C:"Hunai Shot",000D:"Fireball",000E:"Sabre",0014:"Fire",0015:"Tomahawk",0016:"Ninja Glitch",0017:"Fire Wave",001E:"Rocket",001F:"Phoenix",0020:"Star",0021:"Fire Arrow",0028:"Ninjabeam" + cn Infinite\Chaffs + 8027E9C7 000A + cn Infinite\Gun + 8027EAC0 0001 + cn Infinite\Special Weapons + 8027EE82 0002 + cn Infinite\Armor + 8127D9A4 44A0 + 8127D9A8 44A0 + cn Infinite\Health + 8027D9A5 00C8 + 8027D9A9 00C8 + cn Always Have\F-15J Eagle + 8027D69C 0010 + cn Always Have\X-29A A.T.D. + 8027D69D 0020 + cn Stage Select screen unlocked + cd Hold L + R at the Game Mode screen and it will unlock every single level in the game; from Tokyo to Space. Do not hold L + R on any other screen, as this may cause game to freeze + D0281691 0030 + 8027D5C0 000A + D0281691 0030 + 8027D5DA 000A + cn All Boss Attack levels unlocked + cd Unlocks all planes in death match + 80355701 003F + cn F-15J Eagle & X-29A A.T.D. planes unlocked + 8035575C ???? 0010:"F-15J Eagle",0020:"X-29A A.T.D.",003F:"Both of the above planes" + +crc D83045C8-F29D3A36-C:50 +gn AEROGAUGE + cn No Damage\Player 1 + 50000402 0000 + 8113F338 0000 + cn No Damage\Player 2 + 50000402 0000 + 811413D8 0000 + cn Unlock Hidden Tracks & Cars + cd All of the Freeze All Lap Timers must be on. These codes will Stop the others from racing against you in Grand Prix mode. To win a race in Grand Prix you must finish at least one lap in the qualify round, then complete all laps in race for first. + 8009127C 0001 + cn Freeze All Timers + 8013F001 0000 + 8013F005 0000 + 8013F00A 0000 + cn Freeze Overall Timer + cd All of the Freeze All Lap Timers must be on. These codes will Stop the others from racing against you in Grand Prix mode. To win a race in Grand Prix you must finish at least one lap in the qualify round, then complete all laps in race for first. + 8013EFF5 0001 + cn Laps Of Race + 8013EFEF ???? 0001:"1 Lap",0002:"2 Laps",0003:"3 Laps",0004:"4 Laps",0005:"5 Laps",0006:"Never Ending Laps" + cn Play As\Player 1 + 8013F2F5 ???? 0000:"N64 Control Pad",0001:"Interceptor",0002:"Hornet",0003:"Avenger",0004:"Shredder",0005:"Black Lightning",0006:"Vengeance",0007:"Prowler",0008:"Reaper",0009:"Dominator" + cn Play As\Player 2 + 8013F2F6 ???? 0000:"N64 Control Pad",0001:"Interceptor",0002:"Hornet",0003:"Avenger",0004:"Shredder",0005:"Black Lightning",0006:"Vengeance",0007:"Prowler",0008:"Reaper",0009:"Dominator" + cn Level Select + cd For this cheat to work,as soon as you put the cheat on you must turn it back off,if not you wont beable to quit a Race or even finish one. + 8013F2FB ???? 0000:"Canyon Rush",0001:"Bikini Island",0002:"China Town",0003:"Neo Arena",0004:"China Town Jam",0005:"Neo Speed Way" + cn Always 1st + 8013F040 0001 + cn Music Modifier + 800F715F ???? 00FF:"Music On",0000:"Music Off" + cn Language Select + 8008CF93 ???? 0000:"English",0001:"French",0002:"German" + +crc 2DC4FFCC-C8FF5A21-C:50 +gn Aidyn Chronicles - The First Mage (E) + cn Infinite\Max Health + 80279308 001E + cn Infinite\99 Health Potions + cd Do Not put this cheat on until you have collected your 1st Health Potion from the 1st Cheat or you will not be able to get into the Sub menu and Continue the game. + 8027876B 0063 + cn Have\Max Gold + 50000401 0000 + 80277AA5 00FF + cn Have\Max Total XP + 50000401 0000 + 8027931D 00FF + cn Have\Max Total XP Remaning to Start + cd This will give you 16777215 Total XP Remaning to start with and after your 1st batle will allow you to buy your Max Stats + 50000401 0000 + 80279321 00FF + +crc 27C425D0-8C2D99C1-C:50 +gn Airboarder 64 (E) + cn Infinite Turbo\Player 1 + 80166019 0009 + cn Infinite Turbo\Player2 + 80167991 0009 + cn Infinite Time\Street Work & Coin + 8010FA09 0028 + cn Infinite Time\Attack Time Time 000000 + 8110FA0A 0000 + cn Infinite Time\Time Attack + 8010FA0B 0000 + cn Access All Boards & Characters + 80050071 000C + cn Maxed Out Turbo Bar + 811656E8 429F + 80166017 0051 + cn Class Score Select + 8016609E ???? 0020:"Class C",0040:"Class B",0064:"Class A",00FF:"Class S" + cn Coin Perfect Select + cd this is for Coin Mode to get Perfect Coin Collection Score straight away when you enter the level + 801660B3 ???? 0014:"Green Park Level 1",001A:"Green park Level 2",002B:"Green park Level 3",004A:"Lost Forest Level 1",0059:"Lost Forest Level 2",0080:"Lost Forest Level 3",007D:"Snow Festival 64 Levels 1 2 & 3",006F:"Sunset Island Level 1",0074:"Sunset Island Level 2",0081:"Sunset Island Level 3",006E:"Giant House Level 1",0077:"Giant House Level 2",0072:"Giant House Level 3" + cn Options\Music Modifier + 80050059 ???? 00FF:"BGM On",0000:"BGM Off" + cn Options\Sound Effects Modifier + 8105005A ???? 00FF:"SE On",0000:"SE Off" + cn Options\Camera Type Modifier + 81050056 ???? 0000:"Roll On Near",0001:"Roll On Mid",0002:"Roll On Far",0003:"Roll Off Near",0004:"Roll Off Mid",0005:"Roll Off Far" + cn Options\DJ Function Modifier + 8105005C ???? 0001:"DJ Function On",0000:"DJ Function Off" + cn All Street Work Levels Unlocked + 50007801 0000 + 80050120 ???? 0001:"Courses unlocked",0003:"Courses unlocked with C rank",0004:"Courses unlocked with B rank",0005:"Courses unlocked with A rank",0006:"Courses unlocked with S rank" + +crc 3CC77150-21CDB987-C:50 +gn Armorines - Project S.W.A.R.M. (E) + cn Enable In-Game Cheat Menu & Level Select + 81115936 014F + cn Infinite Ammo (All Guns) + 810496D0 2400 + cn Don't Take Any Damage + 8104A260 2400 + +crc D9EDD54D-6BB8E274-C:50 +gn All Star Baseball '99 (E) + cn The Home Team Has Max Score + 8107972A FFFF + cn The Away Team Has Max Score + 81080082 FFFF + +crc DFD784AD-AE426603-C:50 +gn All Star Tennis '99 (E) + cn Game Win Select\Player 1 + 801BAEB1 ???? 0000:"0 Games Won",0001:"1 Game Won",0002:"2 Games Won",0003:"3 Games Won",0004:"4 Games Won",0005:"5 Games Won",0006:"For Game Set & Match" + cn Game Win Select\Player 2 + 801BAEB2 ???? 0000:"0 Games Won",0001:"1 Game Won",0002:"2 Games Won",0003:"3 Games Won",0004:"4 Games Won",0005:"5 Games Won",0006:"For Game Set & Match" + cn Points Select\Player 1 + 801C6160 ???? 0000:"0 Points",0015:"15 Points",0030:"30 Points",0040:"40 Points" + cn Points Select\Player 2 + 801C6161 ???? 0000:"0 Points",0015:"15 Points",0030:"30 Points",0040:"40 Points" + +crc B210DF19-98B58D1A-C:50 +gn Army Men Sarge + cn Infinite Health + 8016471F 0001 + cn Access\All Guns + 8015E0CF 0001 + cn Access\Max Ammo + 801646EF 0001 + cn Have Small Mode + cd Do not use with Have Big Mode only use one at a time + 8015E0C9 0001 + cn Play As Tin Soldier + cd Do not use this with any other play as option. + 8015E0D3 0001 + cn Invisible to most enemies + 8015E0B3 0001 + cn Play As + cd Here you can choose who you would like to play as. But Do not use this with any other play as option.. + 811653D2 ???? 0007:"The Big Green One",0008:"Vikki",0009:"Plastro" + cn Have Big Mode + cd Do not use with Have Small Mode only use one at a time + 8016470F 0001 + cn Have Debug Mode + cd When this code is activated, a display of numbers will show on the screen as the players move around + 8015E417 0001 + +crc FC7797BF-4A95E83C-C:50 +gn LAMBORGHINI + cn Access All Bonus Cars + 50000302 0000 + 80098583 0001 + 50000302 0000 + 8009858B 0001 + cn Max Points + 810CE702 010A + cn Infinite Lap Time + 8109872C 0000 + 8109872E 0000 + cn Always 1st Place + 810A5F30 0001 + cn Start On Lap Modifier + D00A5F35 0000 + 810A5F34 ???? 0000:"Normal",0001:"Lap 1",0002:"Lap 2",0003:"Lap 3",0004:"Lap 4",0006:"Lap 5",0006:"Lap 6",0007:"Last Lap from Start" + cn Track Direction Unlocked (All Levels) + 800A4131 0003 + +crc 733FCCB1-444892F9-C:50 +gn Banjo-Kazooie (E) + cn Infinite\Lives + 8038696B 0009 + cn Have\Running Shoes + 8137CA88 5019 + cn Have\Zero Time all Levels + 50000B04 0000 + 813869E4 3000 + cn Have\Blubbers Gold + 80386973 00FF + cn Have\Present Option\Green + 8038698F 00FF + cn Have\Present Option\Blue + 80386993 00FF + cn Have\Present Option\Red + 80386997 00FF + cn Have\Nabnuts Acorns + 8038699F 00FF + cn Have\Eyries Caterpillars + 8038699B 00FF + cn Have\Chimpys Oranges + 80386977 00FF + cn Have\All Jinjos + 8038695B 00FF + cn Yumblies Counter\Mr Vile + 8038697C 00FF + cn Yumblies Counter\Banjo + 8038697B 00FF + cn Press L To Levitate + cd Press L To Levitate & Let go to land + D0285735 0020 + 8137CE8C 43E0 + cn Do Anywhere Option\Take off anywhere + cd Press A + D0285734 0080 + 8037CBA1 0001 + cn Infinite\Health + 80386963 0008 + 80386965 0001 + cn Infinite\8 Skulls + 803869A7 0008 + cn Infinite\255 Jigsaws + 803869AB 00FF + cn Infinite\Air + 8038696E 000B + cn Infinite\255 Notes + 80386943 00FF + cn Infinite\255 Eggs + 80386947 00FF + cn Infinite\255 Gold Feathers + 80386953 00FF + cn Infinite\255 Red Feathers + 8038694F 00FF + cn Access All Moves + 8037CD70 0001 + 8037CD71 007F + 8037CD72 00FF + 8037CD73 00FF + +crc C9176D39-EA4779D1-C:50 +gn BANJO TOOIE + cn Infinite\Energy\Banjo and Kazooie + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 801201B9 0A0A + 81120794 0A0A + cn Infinite\Energy\Snowball + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 801201B9 0063 + 80120797 0005 + cn Infinite\Energy\Bee + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 801201B9 0063 + 801207A3 000A + 801207A4 000A + cn Infinite\Energy\Washing Machine + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 801201B9 0063 + 811207A6 0A0A + cn Infinite\Energy\Stony + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 801201B9 0063 + 801207A9 000A + 8011B65A 000A + cn Infinite\Energy\Banjo + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 801201B9 0063 + 801207AF 000A + 801207B0 000A + cn Infinite\Energy\Kazooie + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 801201B9 0063 + 811207B2 0A0A + cn Infinite\Energy\Submarine + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 801201B9 0063 + 801207B5 000A + 801207B6 000A + cn Infinite\Energy\Mumbo + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 801201B9 0063 + 811207B8 0A0A + cn Infinite\Energy\Detonator + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 801201B9 0063 + 811207BE 0A0A + cn Infinite\Energy\T-Rex Baby + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 801201B9 0063 + 801207CF 000A + 801207D0 000A + cn Infinite\Air + 8112FFD2 42C8 + cn Play As + cd To use this cheat, put the cheat on, then press L as you walk through a door to become that chosen character + D008B494 0020 + 8012BFAC ???? 0001:"Banjo and Kazooie",0002:"Snowball",0006:"Bee",0007:"Washing machine",0008:"Stony",000A:"Banjo",000B:"Kazooie",000C:"Submarine",000D:"Mumbo",000E:"Golden Goliath",000F:"Detonator",0010:"Truck",0012:"T-rex baby",0013:"T-rex daddy" + cn Instant Warp\Options\Not sure + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B494 0000 + 8112C5A0 ???? 00FC:"Lord woo fak fak",00F9:"Mr Patch",0121:"Inside Chuffy's wagon",0134:"Mumbo's Skull",0135:"Humba Wumba's wigwam 1",0157:"Humba Wumba's wigwam 2",019B:"Jingalings Zombified Palace",01A6:"Smuggler cavern",0141:"Inside the digger tunnel",0143:"Bottles house",0169:"Bottles house still",018A:"HAG Inside",019A:"HAG1 Final Boss" + 8012C5A3 0001 + cn Instant Warp\Options\Spiral Mountain + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B494 0000 + 8112C5A0 ???? 00AD:"Grunty's Old Lair",00AE:"Behind The Waterfall",00AF:"Top Of Castle",0173:"Banjo's house" + 8012C5A3 0001 + cn Instant Warp\Options\Jinjo Village + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B494 0000 + 8112C5A0 ???? 0142:"Jinjo Village",0144:"King Jingalings throne room",0143:"Bottles house",0145:"Green Jinjo's House",0146:"Black Jinjo's House",0147:"Yellow Jinjo's House",0148:"Blue Jinjo's House",014A:"Brown Jinjo's House",014B:"Orange Jinjo's House",014C:"Purple Jinjo's House",014D:"Red Jinjo's House",014E:"White Jinjo's House" + 8012C5A3 0001 + cn Instant Warp\Options\Mayahem Temple + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B494 0000 + 8112C5A0 ???? 00B6:"Humba's Wigwam",00B7:"Mumbo's skull",00B8:"The Temple",00B9:"Prison Compound",00BC:"Code chamber",00C4:"Jade Snake Grove",00C5:"Treasure Chamber",00C6:"Kickball Arena",0177:"Targitzan's Slighty Sacred Temple",0178:"Inside Targitzans Temple",0179:"Targitzan Temple Lobby",017A:"Targitzan's Temple Boss",017F:"Mayan Kickball Arena",0166:"Multi",0167:"Still",00C8:"Kickball Arena",00C9:"Kickball Arena" + 8012C5A3 0001 + cn Instant Warp\Options\Glitter Gulch Mine + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B494 0000 + 8112C5A0 ???? 00C7:"Mine",00CA:"Fuel depot",00CB:"Crushing shed",00CC:"Flooded caves",00CD:"Water storage",00CE:"Waterfall cavern",00CF:"Power hut basement",00D0:"Chuffy's cab",00D1:"Inside chuffy's boiler boss",00D2:"Gloomy caverns",00D3:"Generator caverns",00D4:"Power hut",00D5:"Wumba's wigwam",00D7:"Train station",00D8:"Prospectors hut",00D9:"Mumbo's hut",00DA:"Toxic gas cave",00DB:"Canary cave",00DC:"Ordnance storage",00E9:"Humba",0126:"Water supply pipe",0163:"Ordnance Storage entrance",0164:"Ordnance Storage game",0165:"Ordnance Storage game Multi",016F:"Testing",0170:"Testing",0171:"Mumbo's skull" + 8012C5A3 0001 + cn Instant Warp\Options\Witchy World + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B494 0000 + 8112C5A0 ???? 00D6:"Witcy World",00DD:"Dodgem dome lobby",00DE:"Dodgem challenge \"1 vs 1\"",00DF:"Dodgem challenge \"2 vs 1\"",00E0:"Dodgem challenge \"3 vs 1\"",00E1:"Crazy castle stockade",00E2:"Crazy castle lobby",00E3:"Crazy castle pump room",00E4:"Balloon burst game",00E5:"Hoop hurry game",00E6:"Star spinner",00E7:"The inferno",00EA:"Cave of horrors",00EB:"Haunted cavern",00EC:"Train station",0124:"Saucer of Peril",013B:"Crazy castle stockade \"sop\"",013C:"Star spinner \"sop\"",0176:"Mumbo's skull" + 8012C5A3 0001 + cn Instant Warp\Options\Jolly Roger's Lagoon + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B494 0000 + 8112C5A0 ???? 00ED:"Jolly's",00EE:"Pawno's emporium",00EF:"mumbo's skull",00F4:"Ancient Swimming Baths",00F6:"Electric Eels lair",00F7:"Seaweed Sanctum",00F8:"Inside the big fish",00FA:"temple of the fishes",01A8:"Atlantis",01A9:"Seabottom",0181:"sea bottom cavern",0182:"submarine multi",01A7:"Jolly Roger's Lagoon",00FF:"Blubber's wave race hire" + 8012C5A3 0001 + cn Instant Warp\Options\Terrydacty Land + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B494 0000 + 8112C5A0 ???? 0112:"Terrydacty Land",0113:"Terry's nest",0114:"Train station",0115:"Oogle boogles cave",0116:"Inside the mountain",0117:"River passage",0118:"Styracosaurus family cave",0119:"Unga bunga's cave",011A:"Stomping plains",011B:"Bonfire caverns",011E:"Humba's Wigwam",0123:"Inside chompa's belly",0183:"Chompa's belly multi" + 8012C5A3 0001 + cn Instant Warp\Options\Grunty Industries + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B494 0000 + 8112C5A0 ???? 0100:"Outside",0101:"Inside",0102:"Train station",0103:"Workers quarters",0104:"Trash compactor",0105:"Elevator shaft",0106:"Floor 2",0107:"Floor 2 \"electromagnet chamber\"",0108:"Floor 3",0109:"Floor 3 \"boiler plant\"",010A:"Floor 3 \"packing room\"",010B:"Floor 4",010C:"Floor 4 \"cable room\"",010D:"Floor 4 \"quality control\"",010E:"Floor 5",010F:"Basement",0110:"Basement \"repair depot",0111:"Basement \"waste disposal\"",0125:"Water supply pipe",0172:"Mumbo's skull",0162:"Floor 4 \"clinkers cavern\"",0187:"Sewer entrance" + 8012C5A3 0001 + cn Instant Warp\Options\Hailfire Peaks + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B494 0000 + 8112C5A0 ???? 0127:"Lava side",0128:"Icy side",0129:"Lava train station",012A:"Ice train station",012B:"Chilli billi",012C:"Chilly willy",012D:"Colosseum kickball stadium lobby",0131:"Boggy's igloo",0132:"Icicle grotto",0133:"Inside the volcano",0168:"Icy side still" + 8012C5A3 0001 + cn Instant Warp\Options\Cloud Cuckoo Land + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B494 0000 + 8112C5A0 ???? 0136:"Cloud Cuckoo Land 1",0137:"Inside the trashcan",0138:"Inside the cheesewedge",0139:"Zubba's nest",013A:"Central cavern",013D:"Inside the pot o gold",013E:"Mumbo's skull",013F:"Mingy jongo's skull",0140:"Humba wumba's wigwam",0161:"Cloud Cuckoo Land 2",0188:"Zubba's nest multi",0185:"Trash can mini" + 8012C5A3 0001 + cn Instant Warp\Options\Isle O Hags + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B494 0000 + 8112C5A0 ???? 014F:"Wooded Hollow",0150:"Heggy's egg shed",0151:"Jiggywiggy's temple",0152:"Plateau",0153:"Plateau \"Honey B's Hive\"",0154:"Pine Grove",0155:"Cliff top",0156:"Cliff top Mumbo's skull",015A:"wasteland",015B:"inside another digger tunnel",015C:"Quagmire" + 8012C5A3 0001 + cn Instant Warp\Options\Cauldron Keep + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B494 0000 + 8112C5A0 ???? 015D:"Cauldron Keep",015E:"The gatehouse",015F:"Tower of Tragedy Quiz",0160:"Gun chamber",016A:"Gun room still",017B:"Crazy Castle Stockade balloon burst multi",017C:"Crazy Castle Stockade Jump the hoops multi",017D:"Grunty Industries packing game",0180:"Colosseum kickball arena",0186:"Dodgems" + 8012C5A3 0001 + cn Beta Bottles Revenge Mode + cd Bottles Revenge is a Beta mode from Banjo Tooie that the RWP team recently uncovered after an extraordinary amount of effort. Bottles the Spirit transforms into Bottles the Devil and posses enemies nearby and allows a second player hooked up to Pad 2 to play as that Posses character to try to foil Banjos Plans. As player one goes about its business, player two uses every enemy nearby to try to nab Banjo and take away some life. This mode is incredible, and you can control almost every enemy in the game: slot machines, flying creatures, uggers, zubbas...and this is just the beginning. (Congrats Rare Witch Project) + 80130402 0001 + 8008B4D1 0002 + +crc B088FBB4-441E4B1D-C:50 +gn Bass Hunter 64 (E) + cn All Lakes Available + 80119800 0001 + cn Unbreakable Line + 80119805 0001 + cn Large Fish + 80119806 0001 + cn Fish Are More Active + 80119807 0001 + cn No Penalties During Tournamet + 80119808 0001 + cn No Snags While Fishing + 80119809 0001 + cn Extra $300 + 8011980B 0001 + cn More fish in Lakes + 8011980D 0001 + cn Super Lure + 8011980E 0001 + cn Easy Win Current Tournament + 8011980F 0001 + cn Access\All Lures + cd Codes To Be Used With Save Slot 1 + 8019A1A9 0003 + 8119A1AA FFFF + cn Access\All Poles 2 + cd Codes To Be Used With Slot 1 + 8019A1AC 0007 + cn Access\Extra Boat 2 + cd Codes To Be Used With Slot 1 + 8019A1AD 0001 + +crc 259F7F84-7C9EED26-C:50 +gn Batman Beyond - Return of the Joker (E) + cn Infinite\Health + 801D7F3C 0064 + cn Infinite\99 Lives + 801D7F3D 0063 + cn Infinite\Infinite 99 Dark Night Discus's + 801D7F4A 0063 + cn Infinite\Max Charge & Magnetic Nun Chaku + 801D7F05 0064 + +crc 0CAD17E6-71A5B797-C:50 +gn BattleTanx - Global Assault (E) + cn Infinite Tank Credits + 8124AB3E 02F4 + cn Score Aid + 8124A152 FC9A + cn Inincibility + 81121420 0100 + cn All Weapons & Invulnerable + 81121420 0101 + cn Level Select + 811150B8 0001 + cn All Tanx & All Campaigns + 50001370 0000 + 81120546 FFFF + 50001370 0000 + 8112054A FFFF + cn Infinite Edge Power + 811A8D20 000A + 8111AD08 000A + 811AC1E4 000A + 811ACB7E 000A + 811AAEB4 000A + 811AE378 000A + 811AD514 000A + 811AA51C 000A + +crc A1B64A61-D014940B-C:50 +gn Beetle Adventure Racing (E) + cn Access All\Cars + 8002CFF7 000B + cn Access All\Tracks + 8002CFF3 0006 + cn Access All\Difficulties + 8002CFFB 0003 + cn Access All\Multiplayer Levels + 50000901 0000 + 8002D000 0001 + cn Access In-Game Cheats + 50001301 0000 + 8002D008 0001 + cn Display On + 81025EC6 0100 + cn Map Full + 81025E6A 0102 + cn Speed units\Kph or Mph + cd Here you can choose what you would like to be Displayed on your Speed Ometer, As in Kilometres Per Hour, Or Miles Per Hour. + 81025E68 ???? 0100:"Kph",0001:"Mph" + cn Max Race Points + 8102CBC0 03E7 + cn Flat Shading + 81025CF6 0000 + +crc 7C64E6DB-55B924DB-C:50 +gn Blast Corps (E) + cn Infinite Hydraulics Sidesweeper + 803EDB51 0063 + cn Infinite Missiles Motor Bike + 803F8AC3 0063 + cn Infinite Boosts Buggy Vehicle + 803EE301 0064 + cn Ballista Can Drive Through Anything + 803F8A68 0001 + cn Found All RDUS + 8036E9CC C350 + cn Found All Survivors + 8036E9C9 00FF + cn Found All Scientists + 80364AD0 003F + +crc AB7C101D-EC58C8B0-C:50 +gn Bio F.R.E.A.K.S. (E) + cn Infinite Health\Player One + 811507FA 6400 + cn Infinite Shields\Player One + 811507FE 6400 + cn Shields Always Active\Player One + 8015080A 0022 + cn Infinite Jet Pack\Player One + 81150802 3200 + cn Smoke Trail\Player One + 80150804 0001 + cn Player 2 Easily Defeated\Player One + 81152E76 0100 + 81152E7A 0100 + cn Infinite Health\Player Two + 81152E76 6400 + cn Infinite Shields\Player Two + 81152E7A 6400 + cn Shields Always Active\Player Two + 80152E86 0022 + cn Infinite Jet Pack\Player Two + 81152E7E 3200 + cn Smoke Trail\Player Two + 80152E80 0001 + cn Player 1 Easily Defeated\Player Two + 811507FA 0100 + 811507FE 0100 + +crc D571C883-822D3FCF-C:50 +gn Blues Brothers 2000 (E) + cn Have All\Keys + cd This will give you the Grey & Red,Green & Gold Keys + 800BE268 00FF + 800BE26D 00FF + 800BE26E 00FF + cn Have All\Music Notes + cd This will give you all 10 Music Notes + 50000A01 0000 + 800BE3A0 0001 + cn Infinite\Lives + 800BE293 0009 + cn Infinite\Health + 800BE2A7 0002 + cn Press L to Levitate + cd Press L to levitate & let go to come back down + D017E975 0020 + 810DBD88 44CB + cn Max Money + 810BE296 03E7 + +crc 0B58B8CD-B7B291D2-C:50 +gn Body Harvest (E) + cn Infinite\Greece + 81052B48 0098 + 81052B4A 967F + cn Infinite\Health + 8004DD1C 0002 + cn No Humans Killed + 8104819A 0000 + cn Have Alien Artifact + 8004DC8F 0001 + cn Item Modifier + 8004DC7F ???? 0000:"Nothing",0002:"Howitzer Shells",0040:"Crank",0080:"Windmill Cog",0100:"Heirglyph Map Piece",0400:"Hangar Key",FFFF:"All Items" + cn Weapon Select\1st Position + 80048168 ???? 0000:"Nothing",0001:"Fuel",0002:"Pistol",0003:"Shotgun",0004:"Rifle",0005:"Machine Gun",0006:"Rocket Launcher",0007:"TNT",0008:"Sun Shield",0009:"Grenades",000A:"Tri-Spinner",000B:"Vehicle Weapon 1",000C:"Vehicle Weapon 2",000D:"Arme 2",000E:"Waffe 2",0010:"Fragcannon",0011:"Lazer Missiles",0012:"Resonator",0013:"Plasma Bombs" + cn Weapon Select\2nd Position + 80048169 ???? 0000:"Nothing",0001:"Fuel",0002:"Pistol",0003:"Shotgun",0004:"Rifle",0005:"Machine Gun",0006:"Rocket Launcher",0007:"TNT",0008:"Sun Shield",0009:"Grenades",000A:"Tri-Spinner",000B:"Vehicle Weapon 1",000C:"Vehicle Weapon 2",000D:"Arme 2",000E:"Waffe 2",0010:"Fragcannon",0011:"Lazer Missiles",0012:"Resonator",0013:"Plasma Bombs" + cn Weapon Select\3rd Position + 8004816A ???? 0000:"Nothing",0001:"Fuel",0002:"Pistol",0003:"Shotgun",0004:"Rifle",0005:"Machine Gun",0006:"Rocket Launcher",0007:"TNT",0008:"Sun Shield",0009:"Grenades",000A:"Tri-Spinner",000B:"Vehicle Weapon 1",000C:"Vehicle Weapon 2",000D:"Arme 2",000E:"Waffe 2",0010:"Fragcannon",0011:"Lazer Missiles",0012:"Resonator",0013:"Plasma Bombs" + cn Weapon Select\4th Position + 8004816B ???? 0000:"Nothing",0001:"Fuel",0002:"Pistol",0003:"Shotgun",0004:"Rifle",0005:"Machine Gun",0006:"Rocket Launcher",0007:"TNT",0008:"Sun Shield",0009:"Grenades",000A:"Tri-Spinner",000B:"Vehicle Weapon 1",000C:"Vehicle Weapon 2",000D:"Arme 2",000E:"Waffe 2",0010:"Fragcannon",0011:"Lazer Missiles",0012:"Resonator",0013:"Plasma Bombs" + cn Weapon Select\5th Position + 8004816C ???? 0000:"Nothing",0001:"Fuel",0002:"Pistol",0003:"Shotgun",0004:"Rifle",0005:"Machine Gun",0006:"Rocket Launcher",0007:"TNT",0008:"Sun Shield",0009:"Grenades",000A:"Tri-Spinner",000B:"Vehicle Weapon 1",000C:"Vehicle Weapon 2",000D:"Arme 2",000E:"Waffe 2",0010:"Fragcannon",0011:"Lazer Missiles",0012:"Resonator",0013:"Plasma Bombs" + cn Weapon Select\6th Position + 8004816D ???? 0000:"Nothing",0001:"Fuel",0002:"Pistol",0003:"Shotgun",0004:"Rifle",0005:"Machine Gun",0006:"Rocket Launcher",0007:"TNT",0008:"Sun Shield",0009:"Grenades",000A:"Tri-Spinner",000B:"Vehicle Weapon 1",000C:"Vehicle Weapon 2",000D:"Arme 2",000E:"Waffe 2",0010:"Fragcannon",0011:"Lazer Missiles",0012:"Resonator",0013:"Plasma Bombs" + cn Weapon Select\7th Position + 8004816E ???? 0000:"Nothing",0001:"Fuel",0002:"Pistol",0003:"Shotgun",0004:"Rifle",0005:"Machine Gun",0006:"Rocket Launcher",0007:"TNT",0008:"Sun Shield",0009:"Grenades",000A:"Tri-Spinner",000B:"Vehicle Weapon 1",000C:"Vehicle Weapon 2",000D:"Arme 2",000E:"Waffe 2",0010:"Fragcannon",0011:"Lazer Missiles",0012:"Resonator",0013:"Plasma Bombs" + cn Weapon Select\8th Position + 8004816F ???? 0000:"Nothing",0001:"Fuel",0002:"Pistol",0003:"Shotgun",0004:"Rifle",0005:"Machine Gun",0006:"Rocket Launcher",0007:"TNT",0008:"Sun Shield",0009:"Grenades",000A:"Tri-Spinner",000B:"Vehicle Weapon 1",000C:"Vehicle Weapon 2",000D:"Arme 2",000E:"Waffe 2",0010:"Fragcannon",0011:"Lazer Missiles",0012:"Resonator",0013:"Plasma Bombs" + cn Infinite Ammo All Weapons + 50001102 0000 + 81048176 8000 + cn Level Select + 80047FC3 ???? 0001:"Greece",0002:"Java",0003:"America",0004:"Siberia",0005:"Comet" + cn Press L To Wall Over Water, Climb Hills + D0047609 0020 + 8104DD02 0808 + cn Infinite\Fuel + 8004E46C 0050 + +crc D85C4E29-88E276AF-C:50 +gn Bomberman Hero (E) + cn Full\Bomb Power + 8016523F 0003 + cn Full\Fire Power + 80165240 0008 + cn Infinite\Health + 80165244 0004 + cn Infinite\Lives + 80165243 0009 + cn Extra Gems + D0165241 0000 + 80165241 004B + cn Max\Bombs + 8016523F 0008 + cn Press L to Levitate + cd Press L to levitate & let go to come back down + D005A465 0020 + 81154178 41CB + D005A465 0020 + D0154154 0000 + 80154154 0040 + cn Max\Score + 80177608 FFFF + cn Max\Explosion + 80165240 0008 + +crc 5A160336-BC7B37B0-C:50 +gn Bomberman 64 (E) + cn Infinite\Lives + 802AC617 0063 + cn Infinite\Gems + 802AC61F 0063 + cn Infinite\Credits + 802AC61B 0063 + cn Infinite\Time + 802AC633 0000 + cn Have All Gold Cards + 8008E575 00FF + 8108E576 FFFF + 8108E578 FFFF + 8108E57A FFFF + 8108E57C FFFF + cn All Levels & Stages Unlocked + 50001804 0000 + 8008E5CF 0001 + cn Infinite Red Pumped-Up Bombs + 802AC643 0004 + +crc D5B2339C-CABCCAED-C:50 +gn Buck Bumble (E) + cn Have All\Guns & Infinite Ammo + cd Press C Left to receive all Guns + 81102C0A 0001 + 50000B04 0000 + 810EBF66 03E8 + cn Infinite\Health + cd If you fall into Water just turn off the Infinite Health & put back on when you restrat. + 810EBF58 42D8 + cn Infinite\99 Lives + 810EC2D2 03E7 + cn Level Select Menu + 801022CA 0EF0 + cn Have All\Keys + 810EBF60 0001 + 800EBF61 0001 + 810EBF62 0001 + cn High Score + 810EBF4E FFFF + cn Max Bonus + 810EC2CA 270F + +crc CEDCDE1E-513A0502-C:50 +gn Bust-A-Move 2 - Arcade Edition (E) + cn Infinite Credit + 80120171 00FF + cn Bubble Pointer Puzzle + 801807CD 0001 + cn Bubble Pointer 1P V CPU + 8017E1FD 0001 + cn Access Another World + cd This is for Puzzle Mode + 8116D100 0001 + cn Max Points Aid + 81170E4A 25C2 + +crc E328B4FA-004A28E1-C:50 +gn Bust A Move 3 DX + cn Always have guide line on + 80056CCC 0082 + cn Pointer always active + D0056FA0 0002 + 80056FA0 0082 + cn Play As Select\Player 1 + 800E3250 ???? 0000:"Bubbloon",0001:"Twinkie",0002:"Prettio",0003:"Marina",0004:"Musashi",0005:"Luna",0006:"Jack",0007:"SSB",0008:"Dragoon",0009:"Gnome",0010:"Monkey",0011:"furby? (looks like 2 balloons)",0012:"Blue Gnome",0013:"1 of the two Ballons",0014:"Water under ballons" + cn Play As Select\Player 2 + 800E3258 ???? 0000:"Bubbloon",0001:"Twinkie",0002:"Prettio",0003:"Marina",0004:"Musashi",0005:"Luna",0006:"Jack",0007:"SSB",0008:"Dragoon",0009:"Gnome",0010:"Monkey",0011:"furby? (looks like 2 balloons)",0012:"Blue Gnome",0013:"1 of the two Ballons",0014:"Water under ballons" + cn Next Bubble Select\Player 1 + 800ECE19 ???? 0000:"No Bubble",0001:"Red",0002:"Green",0003:"Blue",0004:"Yellow",0005:"Orange",0006:"Purple",0007:"White",0008:"Black" + cn Next Bubble Select\Player 2 + 800ECF09 ???? 0000:"No Bubble",0001:"Red",0002:"Green",0003:"Blue",0004:"Yellow",0005:"Orange",0006:"Purple",0007:"White",0008:"Black" + cn Press GS to Reset Player 2 score to 0 + 8809D9C0 0000 + 8809D9C2 0000 + +crc 64F1B7CA-71A23755-C:50 +gn CASTLEVANIA + cn Infinite\Health + 81389C42 0064 + cn Infinite\Throwing Weapon + 81389C4C 0064 + cn Throwing Weapon Modifier + 81389C46 ???? 0000:"Nothing",0001:"Knives",0002:"Exploding Potions",0003:"Cross",0004:"Axes" + cn Press L To Levitate + D0387D7F 0020 + 81350810 3FCB + cn Have\All Items + 50000501 0000 + 80389C4E 0001 + 50000301 0000 + 80389C55 0001 + 80389C5E 0001 + 80389C5F 0001 + 80389C61 0001 + 50000E01 0000 + 80389C64 0001 + cn Have\Invincibility + 80342BFE 000B + cn Infinite\Red Jewels + 80389C4D 0064 + cn Status + 80389C8C ???? 0001:"Good",0008:"Vamp",0011:"Poison",0022:"Good but depressed",0066:"Sto",001F:"V+P" + cn Open All Doors and Gates,No Bosses + 50002A02 0000 + 81389BD0 FFFF + cn Infinite\Energy + 80389C33 0064 + cn Infinite\Funds + 80389C49 0001 + 81389C4A 869F + cn Have\Exp Points + 80389C4D 0063 + cn Max Power Up + 80389CF1 0002 + cn Never Get Poisoned + 81389C8C 0000 + cn Level Select + cd You must use this code on a saved game, because the intro to the first level will mess up the game. Now select the saved game, and hold down the GS button until the level loads. Some of the boss stages will not let you fight the boss unless you re-enter the area. Also, with the part of stage modifier, the second code modifies the part of the level that you are in, and 0000 is the level's start. + 89389C94 ???? 0000:"Forest of Silence",0002:"Castle Wall",0003:"Villa",0004:"Inside Villa",0006:"Garden Maze",0007:"Tunnel",0008:"Underground Waterway",0009:"Castle Center",0010:"Tower of Execution",0011:"- Tower of Sorcery",0012:"- Tower of Science",0013:"- Duel Tower",0014:"- Fight With Death/Actrise",0015:"- Castle Keep",0016:"- Intro (Glitch)",0017:"- Clock Tower",0018:"- Final Dracula",001A:"- Fight With Maze Boss",001B:"- Room of Clocks",001C:"- ??",001D:"- ??" + 89389C91 0000 + cn Switch From + cd This Switch From Cheat lets you switch characters on a saved game For example, if you are Reindhart and you want to be Carrie in the middle of your game save it and then enable this Cheat and press F1. when you start your saved game back up you'll be Carrie instead of Reindhart. + 80389C41 ???? 0000:"Carrie to Reindhart",0001:"Reindhart to Carrie" + +crc A2C54BE7-6719CBB2-C:50 +gn Castlevania - Legacy of Darkness (E) + cn Keys Option\Have Clocktower Key B + 801CC040 0001 + cn Keys Option\Have Clocktower Key A + 801CC03F 0001 + cn Keys Option\Have Clocktower Key E + 801CC03E 0001 + cn Keys Option\Have Wall key + 801CC03D 0001 + cn Keys Option\Have Control Room Key + 801CC03C 0001 + cn Keys Option\Have Art Tower Key 2 + 801CC03B 0001 + cn Keys Option\Have Art Tower Key 1 + 801CC03A 0001 + cn Keys Option\Have Clocktower Key D + 801CC039 0001 + cn Keys Option\Have Clocktower Key C + 801CC038 0001 + cn Keys Option\Have Thorn Key + 801CC037 0001 + cn Keys Option\Have Rose Garden Key + 801CC01A 0001 + cn Keys Option\Have Deck Key + 801CC035 0001 + cn Keys Option\Have Execution Key + 801CC034 0001 + cn Keys Option\Have Chamber Key + 801CC033 0001 + cn Keys Option\Have Copper Key + 801CC032 0001 + cn Keys Option\Have Garden Key + 801CC031 0001 + cn Keys Option\Have Storeroom Key + 801CC030 0001 + cn Keys Option\Have Left Tower Key + 801CC02F 0001 + cn Keys Option\Have Archives Key + 801CC02E 0001 + cn Have Options\Rose Brooch + 801CC02D 0001 + cn Have Options\Crest Half B + 801CC02C 0001 + cn Have Options\Crest Half A + 801CC02B 0001 + cn Have Options\Oldreys Diary + 801CC02A 0001 + cn Have Options\Winch lever + 801CC029 0001 + cn Infinite Options\Moon Cards + 801CC028 0001 + cn Infinite Options\Sun Cards + 801CC027 0001 + cn Have Options\Mandragora + 801CC026 0001 + cn Have Options\Magical Nitro + 801CC025 0001 + cn Have Options\Contract + 801CC024 0001 + cn Have Options\Powerup + 801CC01F 0001 + cn Infinite Options\Cure Ampoule + 801CC01E 0001 + cn Infinite Options\Purifying + 801CC01D 0001 + cn Infinite Options\Healing kit + 801CC01C 0001 + cn Infinite Options\beef + 801CC01B 0001 + cn Infinite Options\chicken + 801CC01A 0001 + cn Have Options\Special Crystal 3 + 801CC019 0001 + cn Have Options\Special Crystal 2 + 801CC018 0001 + cn Have Options\Special Crystal 1 + 801CC017 0001 + cn Infinite Options\Red Jewels + 801CC015 0068 + cn Infinite Options\Gold + 811CC012 2710 + cn Infinite Options\Health + 811CC00A 2710 + cn Weapon Modifier + 801CC00F ???? 0000:"Nothing",0001:"Knife",0002:"Potion",0003:"Cross",0004:"Axe" + cn Status Modifier + 801CC054 ???? 0000:"Never Get Poisoned or Vamped",0001:"Normal",0004:"Vamp",0008:"Poison",000C:"Vamped & Poisoned",00FF:"Instant Death" + cn Level Modifier + 801CC349 ???? 0000:"Forest Of Silence",0001:"Left Tower",0002:"Castle Wall",0003:"Villa",0004:"Villa",0005:"Villa",0006:"Villa",001A:"Villa",0007:"Tunnel",0008:"Underground Waterway",0009:"Castle Center",000A:"Castle Center",000B:"Castle Center",000C:"Castle Center",000D:"Castle Center",000E:"Castle Center",000F:"Castle Center",0010:"Foggy Lake",0011:"Foggy Lake",0012:"Foggy Lake",0013:"Cave Of Spiderwomen",0014:"Castle Keep",0015:"Castle Keep",0016:"Falls Into Space(?)",0017:"Clock Tower",0018:"Final Battle Site",0019:"Castle Center",001B:"Room Of Clocks",001C:"Countryside Where Carrie's Mom Is Buried.(Fall Through Ground)",002B:"Countryside Where Carrie's Mom Is Buried.(Fall Through Ground)",001D:"Tower Of Sorcery",001E:"Tower Of Execution",001F:"Tower Of Execution",0020:"Tower Of Execution",0021:"Tower Of Science",0022:"Tower Of Science",0023:"Tower Of Ruins",0024:"Tower Of Ruins",0025:"Art Tower",0026:"Art Tower",0027:"Dual Tower",0028:"Clock Tower",0029:"Clock Tower",002A:"Outer Wall",002C:"Fall From Sky Ouside Of Castlevania Opening",002D:"Another Free Fall. Forest Where Girl Runs In Opening",002E:"Black Room(?)" + cn Inter-Level Modifier + 801CC34B ???? 0000:"Forest Of Silence",0001:"Left Tower",0002:"Castle Wall",0003:"Villa",0004:"Villa",0005:"Villa",0006:"Villa",001A:"Villa",0007:"Tunnel",0008:"Underground Waterway",0009:"Castle Center",000A:"Castle Center",000B:"Castle Center",000C:"Castle Center",000D:"Castle Center",000E:"Castle Center",000F:"Castle Center",0010:"Foggy Lake",0011:"Foggy Lake",0012:"Foggy Lake",0013:"Cave Of Spiderwomen",0014:"Castle Keep",0015:"Castle Keep",0016:"Falls Into Space(?)",0017:"Clock Tower",0018:"Final Battle Site",0019:"Castle Center",001B:"Room Of Clocks",001C:"Countryside Where Carrie's Mom Is Buried.(Fall Through Ground)",002B:"Countryside Where Carrie's Mom Is Buried.(Fall Through Ground)",001D:"Tower Of Sorcery",001E:"Tower Of Execution",001F:"Tower Of Execution",0020:"Tower Of Execution",0021:"Tower Of Science",0022:"Tower Of Science",0023:"Tower Of Ruins",0024:"Tower Of Ruins",0025:"Art Tower",0026:"Art Tower",0027:"Dual Tower",0028:"Clock Tower",0029:"Clock Tower",002A:"Outer Wall",002C:"Fall From Sky Ouside Of Castlevania Opening",002D:"Another Free Fall. Forest Where Girl Runs In Opening",002E:"Black Room(?)" + cn Cut Scene Modifier + 801CC363 0009 + 801CC35B ???? 0003:"Castle Drawbridge Lowers",0004:"Character Enters Castle",0005:"(?)",000A:"(?)",000C:"(?)",0020:"(?)",0021:"(?)",0022:"(?)",0006:"Vampire In Main Entrance Hall Of Villa",0007:"One Of The Working Gears Cut Scenes",0008:"\"I Smell Poison\" From Underground Waterway",0009:"Castle Gate Closes In Villa Upon Entering Villa",000B:"Renon Appears For First Time",000D:"Village Vampire In Upstairs Villa",000E:"Malus Appears For The First Time",000F:"Malus Leaves Garden",0010:"Character In Boat On Foggy Lake",0011:"Seal Removed From Wall In Arena",0012:"Bleeding Statue",0013:"Cosmic Lights",0014:"Explosion At Wall In Arena",0015:"Explosion At Wall In Castle That Leads To Hidden Room",0016:"Malus Appears Again In Upstairs Room Of Castle",0017:"Bull Awakens",0018:"Vincent The Vampire",0019:"One Of The Working Gears Cut Scenes",001A:"Gate Opens In Forest Of Silence",001B:"Meet Renon For The Last Time In Castle Keep.",001C:"This Cut Scene Runs Cut Scene 27 And 2E",001E:"Castle Keep Destructs",001F:"Malus On Flying Horse Outside Castle Keep",0024:"Spider People In Tunnel",0025:"Rosa In Garden",0027:"Castel Destruction",0028:"Space Warp",0029:"Castle Destruction",002A:"Malus Is Saved By Reinhardt",002B:"Malus And Reinhardt On Horse",002E:"Rosa Returns",0030:"Ada Henry And Cornell At Game End",0031:"Scrolling Text About Castle And Henry",0033:"Vampire In Basement",0034:"Vampire In Villa Basement Destroyed Woman Vampire Rises",0035:"Finds Hidden Path In Villa Basement",0037:"Lever & Gear In Castle",0038:"Harpie",0039:"Harpie Destroyed",0044:"Death(Grim Reaper)",0045:"Death Is Destroyed",0046:"Castle Drawbridge Closes And Ortega Appears",0047:"Thirsty Man",0048:"Cornell Meets Henry In Garden",0049:"Cornell And Henry Part In Garden",0051:"Monster Dracula Appears",0052:"Actrise Appears In Castle Center",0054:"Actrise Appears Again With Cousin Fernandes Before Fight With Carrie",0055:"Cousin Fernandes Is Destroyed",0056:"Actrise Appears Again Before Fight With Carrie",0057:"Actrise Defeated By Carrie" + +crc DCCF2134-9DD63578-C:50 +gn Centre Court Tennis (E) + cn Infinite Character Creation Points + 8017BB17 000A + cn Maximum\Serve Smash + 8117BB0E 0A0A + cn Maximum\Volley Lob + 8117BB10 0A0A + cn Maximum\Stroke Spin + 8117BB12 0A0A + cn Maximum\Back,Front,Left & Right Move + 8117BB14 000A + cn Left vs Right Side + 8017BB16 0005 + cn Max Score In Mini Games + 81116230 05F5 + 81116232 E0FF + cn Practice\Balls Always Zero + 8011684F 0000 + cn Practice\Time Always Zero + 8111684A 0000 + cn Scoreboard\Max sets top + 80116983 0009 + cn Scoreboard\Max games top + 8011698B 0009 + cn Scoreboard\Max sets bottom + 80116987 0009 + cn Scoreboard\Max games bottom + 8011698F 0009 + +crc B9AF8CC6-DEC9F19F-C:50 +gn Chameleon Twist (E) + cn Access All Levels + 8020860E 00FF + 80208610 00FF + cn Extra Crowns + 80251857 0015 + cn Infinite Health + 80174DF3 000A + cn Extended Tongue + 8133185E FFFF + +crc 07A69D01-9A7D41A1-C:50 +gn Chameleon Twist 2 (E) + cn Infinite Health + 8018BA7D 000F + cn Max Collectable Items + 80164501 0014 + cn Have 6 Carrots + 80164519 007E + cn Have All\Levels + 80164508 003F + cn Have All\Costumes + 8016451A 00FE + cn Have All\Collectibles\Stage 1 + 80164510 0014 + cn Have All\Collectibles\Stage 2 + 80164511 0014 + cn Have All\Collectibles\Stage 3 + 80164512 0014 + cn Have All\Collectibles\Stage 4 + 80164513 0014 + cn Have All\Collectibles\Stage 5 + 80164514 0014 + cn Have All\Collectibles\Stage 6 + 80164515 0014 + cn Press L To levitate + cd Press L To Levitate & Let go to land + D018BAB5 0020 + 8118B9E0 4200 + +crc FB3C48D0-8D28F69F-C:50 +gn Charlie Blast's Territory (E) + cn Stop Timer From Counting Down (All Levels) + 8101D4E0 2400 + +crc 2E359339-3FA5EDA6-C:50 +gn =Chopper Attack (E) + cn Max Score + 81129716 FFFF + cn Infinite Weapon\1st Position + 8012972B 0063 + cn Infinite Weapon\2nd Position + 8012972F 0063 + cn Infinite Weapon\3rd Position + 80129733 0063 + cn Infinite Weapon\4th Position + 80129737 0063 + cn Infinite Weapon\5th Position + 8012973B 0063 + cn Weapon Modifier\Gun Weapon + 80129A13 ???? 0000:"No Weapon",0001:"Normal Shot",0002:"2-Way Shot",0003:"3-Way Shot",0004:"4-Way Shot" + cn Gun 4-Way Shot + 80129A13 0004 + cn Infinite Fuel + 81129A16 FFFF + cn Infinite Shield + 811299B8 03E8 + cn Opens All 5 Item Slots + 8012974B 0005 + cn Weapon Modifier\1st Position + cd Must to be used with the Infinite Weapon Codes & the open all 5 item slot code. + 80129729 ???? 0000:"Nothing",0001:"AGM",0002:"AAM",0003:"AGAM",0004:"Dummy",0005:"Rocket",0006:"Cluster",0007:"H-Cluster",0008:"H-Plasma" + cn Weapon Modifier\2nd Position + cd Must to be used with the Infinite Weapon Codes & the open all 5 item slot code. + 8012972D ???? 0000:"Nothing",0001:"AGM",0002:"AAM",0003:"AGAM",0004:"Dummy",0005:"Rocket",0006:"Cluster",0007:"H-Cluster",0008:"H-Plasma" + cn Weapon Modifier\3rd Position + cd Must to be used with the Infinite Weapon Codes & the open all 5 item slot code. + 801297E1 ???? 0000:"Nothing",0001:"AGM",0002:"AAM",0003:"AGAM",0004:"Dummy",0005:"Rocket",0006:"Cluster",0007:"H-Cluster",0008:"H-Plasma" + cn Weapon Modifier\4th Position + cd Must to be used with the Infinite Weapon Codes & the open all 5 item slot code. + 801297E5 ???? 0000:"Nothing",0001:"AGM",0002:"AAM",0003:"AGAM",0004:"Dummy",0005:"Rocket",0006:"Cluster",0007:"H-Cluster",0008:"H-Plasma" + cn Weapon Modifier\5th Position + cd Must to be used with the Infinite Weapon Codes & the open all 5 item slot code. + 801297E9 ???? 0000:"Nothing",0001:"AGM",0002:"AAM",0003:"AGAM",0004:"Dummy",0005:"Rocket",0006:"Cluster",0007:"H-Cluster",0008:"H-Plasma" + cn Score Attack Mode + 81129762 0001 + cn Stage Select On + 81129766 0001 + cn Option On + 8112976A 0001 + cn Clear Mission Selector + 8112976C ???? 0001:"1",0002:"2",0003:"3",0004:"4",0005:"5",0006:"6",0007:"7",0008:"8" + cn Texture Mode + 81129774 0001 + +crc 8E9692B3-4264BB2A-C:50 +gn Clay Fighter 63 1-3 (E) + cn Extra Characters and Secret Options + 801A86A1 000F + cn Stage Select + 801A868B ???? 0000:"Candy Factory",0001:"Claynaveral Hangar",0002:"Camp Claynaveral",0003:"Outhouse",0004:"Mudville Mansion",0005:"Ghastly Graveyard",0006:"Spooky Spire",0007:"Happy Harry's Hut",0008:"Freezing Fortress",0009:"Refuse Room",000A:"Grotto Gulch",000B:"Rubbage Room",000C:"Rubbage Reef",000D:"Kiln's Laboratory",000E:"Kiln's Hideout",000F:"Fiery Furnace",0010:"Research Room",0011:"Clayribbean Cruise",0012:"Santa's Workship",0013:"Kooky Courtyard",0014:"Santa's Toy Factory",0015:"Boogerhenge",0016:"Backwash Bay",0017:"Tureen Toilet",0018:"Tribal Tower",0019:"Aquadome" + cn Play As\Player1 + 801A868F ???? 0000:"Bad Mr. Frosty",0001:"Blob",0002:"Bonker",0003:"Boogerman",0004:"Dr. Kiln",0005:"Earthworm Jim",0008:"Houngan",0009:"Icky Bod Clay",000A:"Kung Pow",000D:"Sumo Santa",000E:"Taffy",000F:"T-Hoppy" + cn Refuse Room, Grotto Gulch, Santa's Workship Stages\Can't be Stunned\Player 1 + 801F766B 0000 + cn Refuse Room, Grotto Gulch, Santa's Workship Stages\Infinite Energy\Player 1 + 801F7673 00AA + cn Refuse Room, Grotto Gulch, Santa's Workship Stages\No Energy\Player 1 + 801F7673 0000 + cn Refuse Room, Grotto Gulch, Santa's Workship Stages\Full Super Bar\Player 1 + 811F767A 0200 + cn Tribal Tower Stage\Can't be Stunned\Player 1 + 801F770B 0000 + cn Tribal Tower Stage\Infinite Energy\Player 1 + 801F7713 00AA + cn Tribal Tower Stage\No Energy\Player 1 + 801F7713 0000 + cn Tribal Tower Stage\Full Super Bar\Player 1 + 811F771A 0200 + cn Aquadome Stage\Can't be Stunned\Player 1 + 801F799B 0000 + cn Aquadome Stage\Infinite Energy\Player 1 + 801F7993 00AA + cn Aquadome Stage\No Energy\Player 1 + 801F7993 0000 + cn Aquadome Stage\Full Super Bar\Player 1 + 811F799A 0200 + cn Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Can't be Stunned\Player 1 + 801F7E9B 0000 + cn Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Infinite Energy\Player 1 + 801F7EA3 00AA + cn Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\No Energy\Player 1 + 801F7EA3 0000 + cn Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Full Super Bar\Player 1 + 811F7EAA 0200 + cn Freezing Fortress Stage\Can't be Stunned\Player 1 + 801F7EFB 0000 + cn Freezing Fortress Stage\Infinite Energy\Player 1 + 801F7F03 00AA + cn Freezing Fortress Stage\No Energy\Player 1 + 801F7F03 0000 + cn Freezing Fortress Stage\Full Super Bar\Player 1 + 811F7F0A 0200 + cn Rubbage Reef Stage\Can't be Stunned\Player 1 + 801F7F7B 0000 + cn Rubbage Reef Stage\Infinite Energy\Player 1 + 801F7F83 00AA + cn Rubbage Reef Stage\No Energy\Player 1 + 801F7F83 0000 + cn Rubbage Reef Stage\Full Super Bar\Player 1 + 811F7F8A 0200 + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Can't be Stunned\Player 1 + 801F7FAB 0000 + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Infinite Energy\Player 1 + 801F7FB3 00AA + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\No Energy\Player 1 + 801F7FB3 0000 + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Full Super Bar\Player 1 + 811F7FBA 0200 + cn Clayribbean Cruise Stage\Can't be Stunned\Player 1 + 801F805B 0000 + cn Clayribbean Cruise Stage\Infinite Energy\Player 1 + 801F8063 00AA + cn Clayribbean Cruise Stage\No Energy\Player 1 + 801F8063 0000 + cn Clayribbean Cruise Stage\Full Super Bar\Player 1 + 811F806A 0200 + cn Backwash Bay Stage\Can't be Stunned\Player 1 + 801F80EB 0000 + cn Backwash Bay Stage\Infinite Energy\Player 1 + 801F80F3 00AA + cn Backwash Bay Stage\No Energy\Player 1 + 801F80F3 0000 + cn Backwash Bay Stage\Full Super Bar\Player 1 + 811F80FA 0200 + cn Ghastly Graveyard Stage\Can't be Stunned\Player 1 + 801F818B 0000 + cn Ghastly Graveyard Stage\Infinite Energy\Player 1 + 801F8193 00AA + cn Ghastly Graveyard Stage\No Energy\Player 1 + 801F8193 0000 + cn Ghastly Graveyard Stage\Full Super Bar\Player 1 + 811F819A 0200 + cn Candy Factory Stage\Can't be Stunned\Player 1 + 801F826B 0000 + cn Candy Factory Stage\Infinite Energy\Player 1 + 801F8273 00AA + cn Candy Factory Stage\No Energy\Player 1 + 801F8273 0000 + cn Candy Factory Stage\Full Super Bar\Player 1 + 811F827A 0200 + cn Kooky Courtyard Stage\Can't be Stunned\Player 1 + 801F836B 0000 + cn Kooky Courtyard Stage\Infinite Energy\Player 1 + 801F8373 00AA + cn Kooky Courtyard Stage\No Energy\Player 1 + 801F8373 0000 + cn Kooky Courtyard Stage\Full Super Bar\Player 1 + 811F837A 0200 + cn Santa's Toy Factory Stage\Can't be Stunned\Player 1 + 801F879B 0000 + cn Santa's Toy Factory Stage\Infinite Energy\Player 1 + 801F87A3 00AA + cn Santa's Toy Factory Stage\No Energy\Player 1 + 801F87A3 0000 + cn Santa's Toy Factory Stage\Full Super Bar\Player 1 + 811F87AA 0200 + cn Boogerhenge, Tureen Toilet Stage\Can't be Stunned\Player 1 + 801F8B3B 0000 + cn Boogerhenge, Tureen Toilet Stage\Infinite Energy\Player 1 + 801F8B43 00AA + cn Boogerhenge, Tureen Toilet Stage\No Energy\Player 1 + 801F8B43 0000 + cn Boogerhenge, Tureen Toilet Stage\Full Super Bar\Player 1 + 811F8B4A 0200 + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Can't be Stunned\Player 1 + 801F971B 0000 + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Infinite Energy\Player 1 + 801F9723 00AA + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\No Energy\Player 1 + 801F9723 0000 + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Full Super Bar\Player 1 + 811F972A 0200 + cn Rubbage Room Stage\Can't be Stunned\Player 1 + 801FA1AB 0000 + cn Rubbage Room Stage\Infinite Energy\Player 1 + 801FA1B3 00AA + cn Rubbage Room Stage\No Energy\Player 1 + 801FA1B3 0000 + cn Rubbage Room Stage\Full Super Bar\Player 1 + 811FA1BA 0200 + cn Refuse Room, Grotto Gulch, Santa's Workship Stages\Can't be Stunned\Player 2 + 801FAB0B 0000 + cn Refuse Room, Grotto Gulch, Santa's Workship Stages\Infinite Energy\Player 2 + 801FAB13 00AA + cn Refuse Room, Grotto Gulch, Santa's Workship Stages\No Energy\Player 2 + 801FAB13 0000 + cn Refuse Room, Grotto Gulch, Santa's Workship Stages\Full Super Bar\Player 2 + 811FAB1A 0200 + cn Tribal Tower Stage\Can't be Stunned\Player 2 + 801FABAB 0000 + cn Tribal Tower Stage\Infinite Energy\Player 2 + 801FABB3 00AA + cn Tribal Tower Stage\No Energy\Player 2 + 801FABB3 0000 + cn Tribal Tower Stage\Full Super Bar\Player 2 + 811FABBA 0200 + cn Aquadome Stage\Can't be Stunned\Player 2 + 801FAE2B 0000 + cn Aquadome Stage\Infinite Energy\Player 2 + 801FAE33 00AA + cn Aquadome Stage\No Energy\Player 2 + 801FAE33 0000 + cn Aquadome Stage\Full Super Bar\Player 2 + 811FAE3A 0200 + cn Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Can't be Stunned\Player 2 + 801FB33B 0000 + cn Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Infinite Energy\Player 2 + 801FB343 00AA + cn Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\No Energy\Player 2 + 801FB343 0000 + cn Outhouse, Claynaveral Hanger, Camp Claynaveral Stages\Full Super Bar\Player 2 + 811FB34A 0200 + cn Freezing Fortress Stage\Can't be Stunned\Player 2 + 801FB39B 0000 + cn Freezing Fortress Stage\Infinite Energy\Player 2 + 801FB3A3 00AA + cn Freezing Fortress Stage\No Energy\Player 2 + 801FB3A3 0000 + cn Freezing Fortress Stage\Full Super Bar\Player 2 + 811FB3AA 0200 + cn Rubbage Reef Stage\Can't be Stunned\Player 2 + 801FB41B 0000 + cn Rubbage Reef Stage\Infinite Energy\Player 2 + 801FB423 00AA + cn Rubbage Reef Stage\No Energy\Player 2 + 801FB423 0000 + cn Rubbage Reef Stage\Full Super Bar\Player 2 + 811FB42A 0200 + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Can't be Stunned\Player 2 + 801FB44B 0000 + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Infinite Energy\Player 2 + 801FB453 00AA + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\No Energy\Player 2 + 801FB453 0000 + cn Happy Harry's Hut, Spooky Spire, Mudville Mansion Stage\Full Super Bar\Player 2 + 811FB45A 0200 + cn Clayribbean Cruise Stage\Can't be Stunned\Player 2 + 801FB4FB 0000 + cn Clayribbean Cruise Stage\Infinite Energy\Player 2 + 801FB503 00AA + cn Clayribbean Cruise Stage\No Energy\Player 2 + 801FB503 0000 + cn Clayribbean Cruise Stage\Full Super Bar\Player 2 + 811FB50A 0200 + cn Backwash Bay Stage\Can't be Stunned\Player 2 + 801FB58B 0000 + cn Backwash Bay Stage\Infinite Energy\Player 2 + 801FB593 00AA + cn Backwash Bay Stage\No Energy\Player 2 + 801FB593 0000 + cn Backwash Bay Stage\Full Super Bar\Player 2 + 811FB59A 0200 + cn Ghastly Graveyard Stage\Can't be Stunned\Player 2 + 801FB62B 0000 + cn Ghastly Graveyard Stage\Infinite Energy\Player 2 + 801FB633 00AA + cn Ghastly Graveyard Stage\No Energy\Player 2 + 801FB633 0000 + cn Ghastly Graveyard Stage\Full Super Bar\Player 2 + 811FB63A 0200 + cn Candy Factory Stage\Can't be Stunned\Player 2 + 801FB70B 0000 + cn Candy Factory Stage\Infinite Energy\Player 2 + 801FB713 00AA + cn Candy Factory Stage\No Energy\Player 2 + 801FB713 0000 + cn Candy Factory Stage\Full Super Bar\Player 2 + 811FB71A 0200 + cn Kooky Courtyard Stage\Can't be Stunned\Player 2 + 801FB80B 0000 + cn Kooky Courtyard Stage\Infinite Energy\Player 2 + 801FB813 00AA + cn Kooky Courtyard Stage\No Energy\Player 2 + 801FB813 0000 + cn Kooky Courtyard Stage\Full Super Bar\Player 2 + 811FB81A 0200 + cn Santa's Toy Factory Stage\Can't be Stunned\Player 2 + 801FBC3B 0000 + cn Santa's Toy Factory Stage\Infinite Energy\Player 2 + 801FBC43 00AA + cn Santa's Toy Factory Stage\No Energy\Player 2 + 801FBC43 0000 + cn Santa's Toy Factory Stage\Full Super Bar\Player 2 + 811FBC4A 0200 + cn Boogerhenge, Tureen Toilet Stage\Can't be Stunned\Player 2 + 801FBFDB 0000 + cn Boogerhenge, Tureen Toilet Stage\Infinite Energy\Player 2 + 801FBFE3 00AA + cn Boogerhenge, Tureen Toilet Stage\No Energy\Player 2 + 801FBFE3 0000 + cn Boogerhenge, Tureen Toilet Stage\Full Super Bar\Player 2 + 811FBFEA 0200 + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Can't be Stunned\Player 2 + 801FCBBB 0000 + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Infinite Energy\Player 2 + 801FCBC3 00AA + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\No Energy\Player 2 + 801FCBC3 0000 + cn Kiln's Laboratory, Kiln's Hideout, Fiery Furnace, Research Room Stage\Full Super Bar\Player 2 + 811FCBCA 0200 + cn Rubbage Room Stage\Can't be Stunned\Player 2 + 801FD64B 0000 + cn Rubbage Room Stage\Infinite Energy\Player 2 + 801FD653 00AA + cn Rubbage Room Stage\No Energy\Player 2 + 801FD653 0000 + cn Rubbage Room Stage\Full Super Bar\Player 2 + 811FD65A 0200 + +crc AE5B9465-C54D6576-C:50 +gn Command & Conquer (E) + cn Infinite Options\Power GDI + 810C55D6 FFFF + cn Infinite Options\Power NOD + 810C577E FFFF + cn Infinite Options\Health Commando + 810B5364 0080 + cn Infinite Options\Money NOD + 810C575E FFFF + cn Infinite Options\Money GDI + 810C55B6 FFFF + cn Level Select + cd Select Replay Mission, Press L To Display All Missions,And Press R To Select Your Team You can now press R+L+Up To Win A Battle + 810901AA 0001 + +crc 373F5889-9A6CA80A-C:50 +gn CONKER BFD + cn Infinite\Health\Player 1 + 800CC8BA 0006 + cn Infinite\Oxygen + 800CC7A2 0001 + cn Infinite\Pots of cash + 810D256A FFFF + cn Access All\Chapters, Scenes,& Multi-Player Characters + 50002401 0000 + 800EA120 00FF + cn Play as + cd Here you can Choose Options who you want to play as,But only one Option at a time. + 800D255F ???? 0001:"Wessle",0003:"Tedi",0004:"Combat Squirrel",0005:"Conker",000B:"Uga",000C:"Bald Caveman",000D:"Caveman",000E:"Mohican Caveman",0010:"Neo Conker",001B:"Villager",0021:"Zombie",0023:"Enemy Bat",0024:"Conkers Bat",0025:"Army Captain",0026:"Tedi Boss",0027:"Gregg",0028:"Gregg skeleton" + cn Infinite\Lives Player 1 + 800D2564 0063 + cn Infinite\Health\Player 2 + 800CCBE6 270F + cn Infinite\Health\Player 3 + 800CCF12 270F + cn Infinite\Health\Player 4 + 800CD23E 270F + cn Infinite\Time In Multi + 8109019A 7500 + cn Infinite\Bags In Heist + 800E1004 00FF + cn Access All\Characters & Weapons In Multi Race + 810EA122 ??FF00FF:"All Characters & Baseball bat",00FB:"All Characters & Frying Pan",00F3:"All Characters & Bones" + cn Infinite\Bombs + 802059EA 0030 + cn Infinite\Max Kills Player 1 + cd MULTI ONLY. Only put this code on once you are in the game + 800E0F67 03E7 + cn Infinite\Accuracy Count Player 1 + cd MULTI ONLY. Only put this code on once you are in the game,Once you pick up a Gun a shoot once, you will 100%. + 800E0F87 0001 + cn Infinite\Head Shot Count Player 1 + cd MULTI ONLY. Only put this code on once you are in the game + 800E0F8B 0064 + cn Press L To Levitate\Player 1 + cd Press L Button to Levitate & Let go to come back down + D0042DA5 0020 + 810CC710 41CB + cn Press L To Levitate\Player 2 + cd Press L Button to Levitate & Let go to come back down + D0042DAE 0020 + 810CCA3C 41CB + cn Press L To Levitate\Player 3 + cd Press L Button to Levitate & Let go to come back down + D0042DB5 0020 + 810CCD68 41CB + cn Press L To Levitate\Player 4 + cd Press L Button to Levitate & Let go to come back down + D0042DBE 0020 + 810CD094 41CB + cn Weapon Select In Multi (On Pick Up) + cd Select what Weapon you would like in Multi Player and then on a Weapon Pickup you will have the weapon of your choice.to change for another just Enable the one of your choice to have that instead.(you must have a weapon already to change for the next. + 80180C4B ???? 0001:"Sword",0002:"Nothing",0003:"Yellow Chain-Ssaw",0004:"Throwing Knives",0005:"Riffle",0006:"Long Pistol with Sight",0007:"Rocket Launcher",0008:"Buck Shot",000A:"High Powred Riffle With Scope",000C:"Two Automatic Machine Guns",0013:"Gas Mask" + +crc 503EA760-E1300E96-C:50 +gn Cruis'n USA (E) (1.0) + cn Always Place 1st + 801502CB 0001 + cn Unlimited Time + 801509ED 0045 + cn Access Options\All Tracks + 80150602 001F + 80150603 00FF + cn Access Options\All Car Upgrades + 50000704 0000 + 801505DF 0003 + +crc 503EA760-E1300E96-C:50 +gn Cruis'n USA (E) (1.1) + cn Always Place 1st + 801501AB 0001 + cn Unlimited Time + 801508CD 0045 + cn Access Options\All Tracks + 801504E2 001F + 801504E3 00FF + cn Access Options\All Car Upgrades + 50000704 0000 + 801504BF 0003 + +crc 503EA760-E1300E96-C:50 +gn Cruis'n USA (E) (1.2) + cn Always Place 1st + 801501DB 0001 + cn Unlimited Time + 801508FD 0045 + cn Access Options\All Tracks + 80150512 001F + 80150123 00FF + cn Access Options\All Car Upgrades + 50000704 0000 + 801504EF 0003 + +crc 83F3931E-CB72223D-C:50 +gn Cruis'n World (E) + cn Infinite Time + 813D0C1C 4296 + cn Access\Florida & Moon Tracks + cd This is for Championship Mode Only + 813BF2A4 0101 + cn Max Power Level,& Paint Job / Two Tone + 813BEDA2 0512 + cn Access\All Cars & Upgrades + 813BED58 1FFF + 803BED22 0005 + cn Unlocked Pro & Master difficulty level + 803BEDD5 0003 + cn Dancing Girl Always On + 803BED53 0001 + 803C20AF 0054 + cn Cannot Spin Out + 803CDC73 0000 + cn Disable\Left Lane Traffic + cd This is for Championship Mode Only + 8033C83B 0001 + cn Disable\Right Lane Traffic + cd This is for Championship Mode Only + 8033C83F 0001 + cn Max\Trick points + 803BF21F 0063 + cn Max\Championship Points + 813BFB4E 270F + cn Always 1st\Player 1 + 803CDF03 0001 + cn Unlimited Nitro\Player 1 + cd Press C-Button Down For Boost, This Code is for Championship Mode Only + 803C74C7 0003 + cn Stop Elapsed Time\Player 1 + 813C7558 3C80 + cn Always 1st\Player 2 + 803CE3DB 0001 + cn Unlimited Nitro\Player 2 + cd Press C-Button Down For Boost, This Code is for Championship Mode Only + 803C7703 0003 + cn Stop Elapsed Time\Player 2 + 813C7794 3C80 + cn Always 1st\Player 3 + 803CDA2B 0001 + cn Unlimited Nitro\Player 3 + cd Press C-Button Down For Boost, This Code is for Championship Mode Only + 803C704F 0064 + cn Always 1st\Player 4 + 803CD553 0001 + cn Unlimited Nitro Player 4 + cd Press C-Button Down For Boost, This Code is for Championship Mode Only + 803C728B 0003 + +crc D1A78A07-52A3DD3E-C:50 +gn CyberTiger (E) + cn Infinite & Max Power-Ups + 800B4612 00F0 + 50000801 0000 + 800B4600 00FF + cn Access Secret Characters\Kimmi & Cindy + 800B0DAA 0011 + cn Access Secret Characters\Twfan & Eagamer + 800B0DAE 0011 + cn Access Secret Characters\Bengal The Tiger + 800B4DB2 0011 + cn Access Secret Characters\Mark + 800B0DB7 0012 + cn Access Secret Characters\Robert & Delvis + 800B0DBA 0011 + cn Access Secret Characters\Starr & Traci + 800B0DBE 0011 + cn Access Secret Characters\Festus + 800B0DC3 0001 + cn Access Secret Characters\Marvin The Alien + 800B0DC7 0001 + +crc 7ED67CD4-B4415E6D-C:50 +gn DARK RIFT + cn Access Sonork Character + 80049AA0 0001 + cn Access Demitron Character + 80049AA4 0001 + cn Infinite Health\All Levels\Player 1 + 812716E0 0190 + 8127BDB8 0190 + 8127E478 0190 + 81292EE8 0190 + 81293768 0190 + 81297538 0190 + 812ACCC8 0190 + 812B1CE8 0190 + 812B7BE8 0190 + 8138AEE0 0190 + cn Infinite Health\All Levels\Player 2 + 81271FB8 0190 + 8127B158 0190 + 8127E820 0190 + 81293B48 0190 + 81294390 0190 + 812980B8 0190 + 812AD608 0190 + 812B2D08 0190 + 812B67D8 0190 + 8138A898 0190 + cn Press GS For 2 Rounds Won\Player 1 + 880B6491 0002 + cn Press GS For 2 Rounds Won\Player 2 + 880B64A3 0002 + cn Music Modifier + 80081812 ???? 0000:"Music Off",002A:"Volume Low",0055:"Volume Medium",007F:"Volume Max" + +crc 630AA37D-896BD7DB-C:50 +gn Destruction Derby 64 (E) + cn Have All\Tracks + 50000802 0000 + 81099498 0101 + cn Have All\Difficulty Levels + 8109B7D6 0003 + cn Have All\Cars + 50000602 0000 + 8109B7D8 0101 + cn Max\Points Aid + 8112A3CE 02F4 + cn Max\Collisions Points + 812E013A 02F4 + cn Max\Checkpoint Bonus + 812E013E 02F4 + +crc FD73F775-9724755A-C:50 +gn Diddy Kong Racing + cn Enable All Cheats + cd Go into Options & then Magic Codes. Then Code list to turn off & on what you want. + 800DFE2C 001F + 50000301 0000 + 800DFE2D 00FF + cn Have All\Trophies + cd Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. + 80207E6E 0007 + 80207E6F 00FF + cn Have All\Keys + cd Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. + 80207E69 001F + cn Have All\T.T. Amulets + cd Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. + 80207E77 0004 + cn Have All\50 Balloons + 8020807D 0032 + cn Have All\None-Adventure tracks completed + 50001204 0000 + 80207F87 0007 + 50000904 0000 + 80207FDF 0007 + 80207E68 0007 + 80207E6A 0007 + 80207E6B 0007 + 80207E6C 000F + 80207E6D 00FF + cn Have All\T.T. time trial races beaten + 80207E76 0004 + cn Have All\Control Drumstick & Adventure Two mode unlocked + 801264DC 0003 + 801264DF 0003 + 801264F2 0003 + 801264F3 0008 + cn Have All\Trophy Adventure races unlocked + 50000502 0000 + 8020807E 0007 + +crc 596E145B-F7D9879F-C:50 +gn Diddy Kong Racing + cn Enable All Cheats + cd Go into Options & then Magic Codes. Then Code list to turn off & on what you want. + 800E03AC 001F + 50000301 0000 + 800E03AD 00FF + cn Have All\Trophies + cd Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. + 8020865E 0007 + 8020865F 00FF + cn Have All\Keys + cd Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. + 80208659 001F + cn Have All\T.T. Amulets + cd Only put this code on once you are inside the lobby to choose a gate,or it will crash the game. + 80208667 0004 + cn Have All\50 Balloons + 8020807D 0032 + cn Have All\None-Adventure tracks completed + 50001204 0000 + 80208777 0007 + 50000904 0000 + 802087CF 0007 + 80208658 0007 + 8020865A 0007 + 8020865B 0007 + 8020865C 000F + 8020865D 00FF + cn Have All\T.T. time trial races beaten + 80208666 0004 + cn Have All\Control Drumstick & Adventure Two mode unlocked + 80126CCC 0003 + 80126CCF 0003 + 80126CE2 0003 + 80126CE3 0008 + cn Have All\Trophy Adventure races unlocked + 50000502 0000 + 8020886E 0007 + +crc D614E5BF-A76DBCC1-C:50 +gn Disney's Tarzan (E) + cn Infinite\Health + 81192300 0120 + cn Have\Coins Collected 100% + 800DD4B7 0064 + cn Have\Level & Tokens Completed 100% + 800DD48F 0000 + 800DD490 0001 + 800DD491 0000 + cn Access Level Select + cd On the main menu Scroll down to make CHEATS visible to go into Level Select.For in-Game Cheats,Pause gameplay. + 810DD47C 8001 + cn Infinite\Lives + 800DD4B2 ???? 0003:"3 Lives",0063:"99 Lives" + cn Have\All TARZAN Letters + 800DD485 00FF + cn Have\Full Portrait + 800DD484 00FF + cn Infinite\Red Weapon + 811921D8 0063 + cn Infinite\Green Weapon + 811921D6 0063 + cn Infinite\Purple Weapon + 811921DA 0063 + cn Press GS For\Sabor Attacks\Sabor 1 Hit Kill + 8924A49E 0001 + cn Infinite\Bonus Timer + cd This is For All Timers on Bonus Levels + 8017373E 0025 + +crc 3DF17480-193DED5A-C:50 +gn Donald Duck Quack At + cn Infinite\99 Lives + 801D6F2E 0063 + cn Infinite\99 Stars + 801D6F2F 0063 + cn Instant\Rage Attack (Press C-Left) + D00CAFD1 0002 + 801CE23D 0001 + cn Instant\Hyperactive State [Invincible] (Press C-Right) + D00CAFD1 0001 + 801CE296 0001 + cn Instant\Carrier Box [Moon Walk] (Press L) + cd Press and hold the L Button and you will run floating of any ledge slowing drifting down. If you keep pressing the A Button while Holding L it will act as a Moon Jump. + D00CAFD1 0020 + 801C901F 0001 + cn Infinite\Time\Gladstones Time Attack + 801D6F27 00FF + cn Infinite\Time\Nephews Toy Hunting + 801D6F23 0063 + cn Have All\Levels and Bonus Stages Unlocked + cd Press start in Gyro's Lab and then resume game to see all open + 801D6F4C 00FF + 801D6F4D 00FF + 801D6F4E 00FF + 801D6F4F 00FF + 801D6F53 00FF + cn Have All\Time Attack & Toy Hunting Comnpleated (All Levels) + cd Press start in Gyro's Lab and then resume game to see all open + 801D6F58 00FF + 801D6F59 00FF + 801D6F5A 00FF + 801D6F5B 00FF + 801D6F5C 00FF + 801D6F5D 00FF + 801D6F5E 00FF + 801D6F5F 00FF + +crc 11936D8C-6F2C4B43-C:50 +gn DONKEY KONG 64 + cn Donkey Kong\Infinite Ammo + 807FCB85 0096 + cn Infinite\Health + 817FCB8C 041F + cn Donkey Kong\Infinite Musical Instrument + 817FC894 0103 + 817FC898 00FF + cn Diddy\Infinite Musical Instrument + 817FC8F6 000A + cn Tiny\Infinite Musical Instrument + 817FC9B2 000A + cn Lanky\Infinite Musical Instrument + 817FC954 000A + cn Chunky\Infinite Musical Instrument + 817FCA10 000A + cn Infinite\Camera Film + 807FCB89 0005 + cn Infinite\Orange Bombs + 807FCB81 0096 + cn Donkey Kong\Infinite Bananas\Jungle Japes + 817FC89A 03E7 + cn Donkey Kong\Infinite Bananas\Angry Aztec + 817FC89C 03E7 + cn Donkey Kong\Infinite Bananas\FactoryLevel + 817FC89E 03E7 + cn Donkey Kong\Infinite Bananas\Galleon Level + 817FC8FE 03E7 + cn Donkey Kong\Infinite Bananas\Fungi Forest + 817FC8A2 03E7 + cn Donkey Kong\Infinite Bananas\Creepy Castle + 817FC8A6 03E7 + cn Donkey Kong\Infinite Bananas\Crystal Caves + 817FC8A4 03E7 + cn Donkey Kong\All Golden Bananas\Jungle Japes + 817FC8D2 03E7 + cn Donkey Kong\All Golden Bananas\Angry Aztecs + 817FC8D4 03E7 + cn Donkey Kong\All Golden Bananas\Frantic Factory + 817FC8D6 03E7 + cn Donkey Kong\All Golden Bananas\Gloomy Galleon + 817FC8D8 03E7 + cn Donkey Kong\All Golden Bananas\Crystal Caves + 817FC8DC 03E7 + cn Donkey Kong\All Golden Bananas\Creepy Castle + 817FC8DE 03E7 + cn Donkey Kong\All Golden Bananas\DK Isle + 817FC8E0 03E7 + cn Diddy\All Golden Bananas\Jungle Japes + 817FC930 0064 + cn Diddy\All Golden Bananas\Angry Aztecs + 817FC932 0064 + cn Diddy\All Golden Bananas\Frantic Factory + 817FC934 0064 + cn Diddy\All Golden Bananas\Gloomy Galleon + 817FC936 0064 + cn Diddy\All Golden Bananas\Fungi Forest + 817FC938 0064 + cn Diddy\All Golden Bananas\Crystal Caves + 817FC93A 0064 + cn Diddy\All Golden Bananas\Creepy Castle + 817FC93C 0064 + cn Diddy\All Golden Bananas\DK Isle + 817FC93E 0064 + cn Tiny\All Golden Bananas\Jungle Japes + 817FC9EC 0064 + cn Tiny\All Golden Bananas\Angry Aztecs + 817FC9EE 0064 + cn Tiny\All Golden Bananas\Frantic Factory + 817FC9F0 0064 + cn Tiny\All Golden Bananas\Gloomy Galleon + 817FC9F2 0064 + cn Tiny\All Golden Bananas\Fungi Forest + 817FC9F4 0064 + cn Tiny\All Golden Bananas\Crystal Caves + 817FC9F6 0064 + cn Tiny\All Golden Bananas\Creepy Castle + 817FC9E8 0064 + cn Tiny\All Golden Bananas\DK Isle + 817FC9FA 0064 + cn Lanky\All Golden Bananas\Jungle Japes + 817FC98E 0064 + cn Lanky\All Golden Bananas\Angry Aztecs + 817FC990 0064 + cn Lanky\All Golden Bananas\Frantic Factory + 817FC992 0064 + cn Lanky\All Golden Bananas\Gloomy Galleon + 817FC994 0064 + cn Lanky\All Golden Bananas\Fungi Forest + 817FC996 0064 + cn Lanky\All Golden Bananas\Crystal Caves + 817FC998 0064 + cn Lanky\All Golden Bananas\Creepy Castle + 817FC99A 0064 + cn Lanky\All Golden Bananas\DK Isle + 817FC99C 0064 + cn Chunky\All Golden Bananas\Jungle Japes + 817FCA4A 0064 + cn Chunky\All Golden Bananas\Angry Aztecs + 817FCA4C 0064 + cn Chunky\All Golden Bananas\Frantic Factory + 817FCA4E 0064 + cn Chunky\All Golden Bananas\Gloomy Galleon + 817FCA50 0064 + cn Chunky\All Golden Bananas\Fungi Forest + 817FCA52 0064 + cn Chunky\All Golden Bananas\Crystal Caves + 817FCA54 0064 + cn Chunky\All Golden Bananas\Creepy Castle + 817FCA56 0064 + cn Chunky\All Golden Bananas\DK Isle + 817FCA58 0064 + cn Donkey Kong\Infinite Coins + 817FC896 03E7 + cn Diddy\Infinite Coins + 817FC8F4 03E7 + cn Tiny\Infinite Coins + 817FC9B0 03E7 + cn Lanky\Infinite Coins + 817FC952 03E7 + cn Chunky\Infinite Coins + 817FCA0E 03E7 + cn Infinite\Crystal Coconuts + 817FCB86 03E7 + cn Donkey Kong\Has Moves + 817FC890 0103 + cn Donkey Kong\Have Weapon + 817FC892 0103 + cn Free Pass (Access All Areas) + cd This is exactly what it says, You can walk through Any Locked Door,Gate, Or Area. Have Fun. + 8066D167 0001 + 8066D262 0001 + +crc 2C739EAC-9EF77726-C:50 +gn Doom 64 (E) + cn Always Have\Gun + 80063373 0001 + cn Always Have\Shotgun + 80063377 0001 + cn Always Have\Double Shotgun + 8006337B 0001 + cn Always Have\Chain Gun + 8006337F 0001 + cn Always Have\Missile Launcher + 80063383 0001 + cn Always Have\Chainsaw + 8006336B 0001 + cn Always Have\Plasma Rifle + 80063387 0001 + cn Always Have\BFG + 8006338B 0001 + cn Infinite\Armor + 800634BF 00FF + cn Rapid Fire + 810633EA 0B94 + cn Invincible + 8006355B 0002 + cn Turn Map Markers On + 800633BB 0004 + cn Invincible And Map Markers + 800633BB 0006 + cn Always Have\Bio Suite + 80063333 ???? 00FF:"On",0000:"Off" + cn Always Have\Missile Ammo + 8006339F 0064 + cn Always Have\Have Rocket Launcher + 80063381 0001 + cn Always Have\Have Laser Weapon + 8006338D 0001 + cn [Max Brightness] + cd Enable this cheat on rom load to have Max Brightness (internal) and then put Jabo d3d8 on 160% Max for a extra brightness Boost. + 8005AA18 0064 + cn Have All\Keys + 50000504 0000 + 810634DE FFFF + cn Have All\Weapons + 50000A04 0000 + 8106350A 0001 + cn Infinite\Ammo All Weapons + 50000404 0000 + 81063532 013C + cn Enable Cheat Menu + 8005AA23 0001 + +crc B6524461-ED6D04B1-C:50 +gn Dual Heroes (E) + cn Infinite Health\Player 1 + 80225E9D 00FA + cn Infinite Health\Player 2 + 80225E9F 00FA + cn Win Once To Win\Player 1 + 80225E95 0001 + cn Win Once To Win\Player 2 + 80225E97 0001 + cn Infinite Time + 80225EA5 003C + +crc 57BFF74D-DE747743-C:50 +gn Duke Nukem 64 (E) + cn Access all In-Game cheats + 50000504 0000 + 80101308 0001 + cn Infinite\Ammo & All Guns + 50000C02 0000 + 812A5A34 02F4 + cn Access\All Items + cd To access simply pause in game play & then unpause. + 801012EC 0001 + cn Invincibility + 802AAA98 0001 + cn Access\All Keys + 802A5A77 000F + cn Infinite\Holoduke + 812A5A5C 0640 + cn Infinite\Night Vision + 812A5A8C 0640 + cn Infinite\Scuba Gear + 812A5ABC 0640 + cn Crosshair On + 802A5B24 0001 + cn Max auto-aim On + 802A5B25 0002 + cn Upgraded Plasma Gun + 802A5A63 0063 + +crc DC36626A-3F3770CB-C:50 +gn DUKE NUKEM ZERO HOUR + cn Cheat Menu\Cheat Menu Enabled + 800CF7D8 0001 + cn Cheat Menu\Have All Weapons + 811CE810 FFFF + cn Cheat Menu\Have All Game Type & Other + 810E1A3E 0FFF + cn Cheat Menu\All Weapons Enabled + 801CCC59 0001 + 801CCCC5 0001 + 801CDD25 0001 + 801CDE21 0001 + 801CDEB5 0001 + 801CDEB7 0001 + 801CDEE9 0001 + 801CE819 0001 + 801CE821 0001 + 801CE88D 0001 + 801CF9D5 0001 + cn Infinite Ammo (All Guns) + 810A21B4 A65B + cn Invincibility + 800DF203 0001 + cn Time Always 00:00 + 801A1D06 0000 + cn Enable Debug Menu + 800DFCD0 0001 + +crc 492B9DE8-C6CCC81C-C:50 +gn Earthworm Jim 3D (E) + cn Infinite\Health + 800C876F 0064 + cn Infinite\Lives + 800C8773 0064 + cn Infinite\Ammo\Blaster + 810C6916 0064 + cn Infinite\Ammo\Rocket Launcher + 810C6946 0064 + cn Infinite\Ammo\Banana Peel Bomb + 810C6976 0064 + cn Infinite\Ammo\Laser + 810C698E 0064 + cn Infinite\Ammo\Green Slimer + 810C69A6 0064 + cn Infinite\Ammo\Chickens + 810C69BE 0064 + cn Infinite\Ammo\Shotgun + 810C69EE 0064 + cn Infinite\Ammo\Music Gun + 810C6906 0064 + cn Infinite\Ammo\Boomerang Knives + 810C691E 0064 + cn Infinite\Ammo\Mushrooms + 810C6936 0064 + cn Infinite\Ammo\Lepricon Gun + 800C8897 0064 + cn Infinite\Ammo\Pistol + 800C8777 0064 + cn Infinite\Ammo\Sniper Chicken + 800C881F 0064 + cn Infinite\Ammo\Butcher Knife Gun + 800C887F 0064 + cn Have\231 Marbles + D00EBE53 0000 + 800EBE53 03E7 + cn Have\All Gold Udders + 50002802 0000 + 810C80BA 0101 + +crc 202A8EE4-83F88B89-C:50 +gn EXCITEBIKE64 + cn Infinite Time + 810F0E36 1770 + cn Max Score Stunt Mode\Player One + 810E43E8 0098 + 810E43EA 967F + cn Max Score Stunt Mode\Player Two + 810E4BC8 0098 + 810E4BCA 967F + cn Unlock Original Excitebike + cd Press L+R at track selection to Access Soccer,Hill Climb & Excite 3D + D00F6605 0030 + 810F2420 FF07 + cn Start On Lap + D00E4681 0000 + 800E4681 ???? 0001:"Lap 1",0002:"Lap 2",0003:"Lap 3",0004:"Lap 4" + cn Always Low Temp\Player Two + 810E4E48 0000 + 810E4E4A 0000 + cn Always Low Temp\Player One + 810E4668 0000 + 810E466A 0000 + cn In Game Cheat Select\1 + 800CDA4A ???? 0001:"Transparent riders",0002:"All stunts",0004:"Invincible mode",0008:"Developers team photo",0010:"Beat this",0020:"Small head mode" + cn In Game Cheat Select\2 + 800CDA4B ???? 0001:"Big head mode",0002:"Mirror mode",0004:"Debug mode",0008:"Down hill mode",0010:"Stunt bonus",0020:"Invisible riders",0040:"Night mode",0080:"Odd colour mode" + cn In-Game cheat modifer + 810CDA4A ???? 0001:"Big head mode",0002:"Mirror mode",0004:"Debug mode",0008:"Down hill mode",0010:"Stunt bonus",0020:"Invisible riders",0040:"Night mode",0080:"Odd colour mode",0100:"Transparent riders",0200:"All stunts",0400:"Invincible mode",0800:"Developers team photo",1000:"Beat this",2000:"Small head mode" + +crc 8E9D834E-1E8B29A9-C:50 +gn Extreme-G (E) + cn Infinite Shields\Player 1 + 801651F5 00C8 + cn Infinite Primary Weapon\Player 1 + 801651FD 00C8 + cn Infinite Turbos\Player 1 + 801651CB 0003 + 801651CF 0003 + cn Bike Modifier\Player 1 + 8016983F ???? 0000:"Raze",0001:"Rana",0002:"Khan",0003:"Grimace",0004:"Mooga",0005:"Jolt",0006:"Main",0007:"Apollyon",0008:"Roach",0009:"Neon" + cn Infinite Shields\Player 2 + 80165965 00C8 + cn Infinite Primary Weapon\Player 2 + 8016596D 00C8 + cn Infinite Turbos\Player 2 + 8016593B 0003 + 8016593F 0003 + cn Bike Modifier\Player 2 + 8016988B ???? 0000:"Raze",0001:"Rana",0002:"Khan",0003:"Grimace",0004:"Mooga",0005:"Jolt",0006:"Main",0007:"Apollyon",0008:"Roach",0009:"Neon" + cn Infinite Shields\Player 3 + 801660D5 00C8 + cn Infinite Primary Weapon\Player 3 + 801660DD 00C8 + cn Infinite Turbos\Player 3 + 801660AB 0003 + 801660AF 0003 + cn Bike Modifier\Player 3 + 801698D7 ???? 0000:"Raze",0001:"Rana",0002:"Khan",0003:"Grimace",0004:"Mooga",0005:"Jolt",0006:"Main",0007:"Apollyon",0008:"Roach",0009:"Neon" + cn Infinite Shields\Player 4 + 80166845 00C8 + cn Infinite Primary Weapon\Player 4 + 8016684D 00C8 + cn Infinite Turbos\Player 4 + 8016681B 0003 + 8016681F 0003 + cn Bike Modifier\Player 4 + 80169923 ???? 0000:"Raze",0001:"Rana",0002:"Khan",0003:"Grimace",0004:"Mooga",0005:"Jolt",0006:"Main",0007:"Apollyon",0008:"Roach",0009:"Neon" + cn Extra Bikes Unlocked + 80167C13 0001 + 80167C17 0003 + cn Extra Levels Unlocked + 8016980B 0001 + 8016980F 0001 + cn All Tracks Unlocked + 80095F6E 0008 + 50000264 0000 + 80169347 0001 + 50000264 0000 + 80169473 0001 + 50000564 0000 + 8016959F 0001 + cn Mode Select + 80097687 ???? 0001:"Boulder",0002:"Fish Eye Lens",0003:"Boulder & Fish Eye Lens",0004:"Magnify",0008:"Anti-Gravity",000A:"Anti-Gravity & Fish Eye Lens",0010:"Wireframe",0011:"Boulder & Wireframe",0020:"Stealth Mode",0040:"Ghost Mode",0080:"Ugly Mode" + +crc 1185EC85-4B5A7731-C:50 +gn Extreme-G XG2 (E) + cn Infinite Nitros\Player 1 + 80170BA3 0004 + 80170BA7 0004 + cn Infinite Shield\Player 1 + 80170BCD 00C8 + cn Infinite Lasers\Player 1 + 80170BD9 00C8 + cn Infinite Nitros\Player 2 + 8017120B 0004 + 8017120F 0004 + cn Infinite Shield\Player 2 + 80171235 00C8 + cn Infinite Lasers\Player 2 + 80171241 00C8 + cn Infinite Nitros\Player 3 + 80171873 0004 + 80171877 0004 + cn Infinite Shield\Player 3 + 8017189D 00C8 + cn Infinite Lasers\Player 3 + 801718A9 00C8 + cn Infinite Nitros\Player 4 + 80171EDB 0004 + 80171EDF 0004 + cn Infinite Shield\Player 4 + 80171F05 00C8 + cn Infinite Lasers\Player 4 + 80171F11 00C8 + cn Access\All Tracks + 50000BD8 0000 + 80182FC7 0001 + 50000CD8 0000 + 80182EF3 0001 + 50000CD8 0000 + 80182EF7 0001 + 50000CD8 0000 + 80182EFB 0001 + 50000CD8 0000 + 80182EFF 0001 + 50000CD8 0000 + 80182F03 0001 + 50000CD8 0000 + 80182F07 0001 + cn Access\All Levels & Superbikes + 50000304 0000 + 80183A0F 0001 + cn Access\All Secret Characters + cd This code is Fantastic, You have 12 characters to choose from to you race without any bike, just on foot + 50000C04 0000 + 80183A27 0001 + cn [Screen Hud Clear] + cd If you are using a Plugin other then Jabos 1.5 and can not see through the Thick Hud on the Screen. then Let the game load 1st before Putting this code on,Or it will give an error and Freeze + 80092C6B 0004 + +crc 07C1866E-5775CCDE-C:50 +gn F-1 World Grand Prix II (E) + cn Max Driver Points + 8103A8F6 03E7 + cn Max Constructor Points + 8103A8F8 03E7 + +crc 776646F6-06B9AC2B-C:50 +gn F-Zero X (E) + cn Time Always 00.00.00/1st Place + 812C4BC0 0000 + 812C4BC2 0001 + cn Infinite Shield + 812C4B48 4326 + 812C4B4C 4326 + cn Infinite Lives + 800D8729 0005 + cn Boost From Start + D02C4DA0 003F + 802C4925 0050 + cn Unlock Everything + 810C01E8 0100 + +crc 3CECBCB8-6126BF07-C:50 +gn F1 Racing Championship (E) + cn No Checkpoint time + 81164E1C 0001 + cn Big Score + 81164E58 8181 + 81164E5A 8181 + cn Instant 450kmh Boost + cd Press Trigger Button + D10A1F50 2000 + 8119D334 005A + +crc 0E31EDF0-C37249D5-C:50 +gn FIFA - Road to World Cup 98 (E) + cn Home Team scores 25 Goals + 801AF433 0019 + cn Home Team scores 0 Goals + 801AF433 0000 + cn Away Team scores 25 Goals + 801AF437 0019 + cn Away Team scores 0 Goals + 801AF437 0000 + +crc 0198A651-FC219D84-C:50 +gn FIFA 99 (E) + cn Team on the right of score board has 15 goals + 800375C3 000F + cn Team on the left of score board has 15 goals + 800375C7 000F + cn Team on the right of score board has 0 goals + 800375C3 0000 + cn Team on the left of score board has 0 goals + 800375C7 0000 + +crc C3F19159-65D2BC5A-C:50 +gn FIFA Soccer 64 (E) + cn Number Of Goals Player 1 + 80119043 ???? 0001:"1 Goal",0002:"2 Goals",0003:"3 Goals",0004:"4 Goals",0005:"5 Goals",0006:"6 Goals",0007:"7 Goals",0008:"8 Goals,09 9 Goals,0A 10 Goals",0014:"20 Goals",001E:"30 Goals",0028:"40 Goals",0032:"50 Goals" + cn Number Of Goals Player 2 + 80119047 ???? 0001:"1 Goal",0002:"2 Goals",0003:"3 Goals",0004:"4 Goals",0005:"5 Goals",0006:"6 Goals",0007:"7 Goals",0008:"8 Goals,09 9 Goals,0A 10 Goals",0014:"20 Goals",001E:"30 Goals",0028:"40 Goals",0032:"50 Goals" + +crc 36F1C74B-F2029939-C:50 +gn Fighter's Destiny (E) + cn Start with Stars Modifier\Player 1 + D0209757 0000 + 80209757 ???? 0000:"No Stars",0006:"Max Stars" + cn Start with Stars Modifier\Player 2 + D020B61F 0000 + 8020B61F ???? 0000:"No Stars",0006:"Max Stars" + cn Have 1 Star\Ryuji + 8030734E 0001 + cn Have 1 Star\Bob + 8030734F 0001 + cn Have 1 Star\Pierre + 80307350 0001 + cn Have 1 Star\Meiling + 80307351 0001 + cn Have 1 Star\Leon + 80307352 0001 + cn Have 1 Star\Abdul + 80307353 0001 + cn Have 1 Star\Ninja + 80307354 0001 + cn Have 1 Star\Tomahawk + 80307355 0001 + cn Have 1 Star\Valerie + 80307356 0001 + cn Infinite Health\Player 1 + 802098A1 0000 + 802047C3 0000 + cn Infinite Health\Player 2 + 802047C7 0000 + 8020B769 0000 + cn Start on stage 100 on Survival to get Joker + 802EF67B 0063 + cn Stop timer for Fastest to get Robot + 810ADBDC 3F80 + cn Always Win Judge's Decision\Player 1 + 8020B777 FFFF + 802098AF 0000 + cn Always Win Judge's Decision\Player 2 + 802098AF FFFF + 8020B777 0000 + cn Enable Boro + 80307349 0001 + cn Level Select + 8022A84C ???? 0000:"Fire Mountain",0001:"Desert",0002:"Highlands",0003:"Hong Kong",0004:"Coliseum",0005:"Jungle",0006:"Ninja Room",0007:"Suspension Bridge",0008:"Palace",0009:"Observation",000A:"Pasture",000B:"Joker's Room",000C:"Blue Hell Mountain",000D:"Palace" + cn Play As\Player 1 + 802EF622 ???? 0000:"Ryuji",0001:"Bob",0002:"Pierre",0003:"Meiling",0004:"Leon",0005:"Abdul",0006:"Ninja",0007:"Tomahawk",0008:"Boro",0009:"Valerie",000A:"Ushi",000B:"Joker",000C:"The Master",000D:"No Clue" + +crc 66CF0FFE-AD697F9C-C:50 +gn Fighting Force 64 (E) + cn Infinite Lives + 810CE462 03E7 + cn Infinite health + 810C8B0E 03E7 + cn Level Select + cd Scroll With C-Left & C-Right Level Select Available, At The Player Select Top Screen + 810A590E 0001 + cn Score Aid + 810CD912 29AA + +crc 142A17AA-13028D96-C:50 +gn Forsaken 64 (E) + cn Infinite\Primery Weapons + 8008EE30 0012 + cn Infinite\Secondary Weapons + 8008EE31 0012 + cn Infinite\Weapon Energy + 8008EE32 0012 + cn Infinite\Lives + 8008EE33 0012 + cn Stealth Mode + 8008EE34 0012 + cn Invulnerability + 8008EE35 0012 + cn Wireframe Mode + 8008EE36 0012 + cn Gore Mode + 8008EE37 0012 + cn Turbo Mode + 8008EE38 0012 + cn Psychedelic Mode + 8008EE39 0012 + cn One Shot Enemies + 8008EE3A 0012 + cn Freeze Enemies + 8008EE3B 0012 + cn Infinite\Titans + cd Titans are included in code + 8008EE3C 0012 + cn Infinite\Solaris + cd Solaris are included in code + 8008EE3D 0012 + cn Level Select + cd Accesses all Missions & Battle mode + 8008EE3E 0012 + +crc D543BCD6-2BA5E256-C:50 +gn Gauntlet Legends (E) + cn Get All Stuff + cd Opens Up New Levels Etc, + 50001410 0000 + 810C5DA6 FFFF + cn Infinite Use Of Items + cd On Pick-Ups Only + 50001310 0000 + 800C5EC6 FFFF + cn Access Skill Level 99 + cd And Get A Familiar + 800FD38A FFFF + cn Access All Window Shards + 50000302 0000 + 810AE6C6 07FF + cn Access All Rune Stones + 50000302 0000 + 810AE6D6 07FF + cn Always Max Turbo Attack + 810FD4AE FF64 + cn New Player Name + 810FD36C 4249 + 810FD36E 5443 + 810FD370 4820 + 810FD372 3639 + cn Start With Small Familiar + cd Do not use this with Big Familiar Code + 810FD512 0102 + cn Start With Big Familiar + cd Do not use this with Small Familiar Code + 810FD512 0202 + +crc 68FCF726-49658CBC-C:50 +gn G.A.S.P!!Fighters'NE + cn Player 1\Character Modifier + cd This Allows you to play as any Character you choose in any Mode + 80105001 ???? 0000:"Azami",0001:"Serina",0002:"Miki",0003:"Kai",0004:"Sakai",0005:"Kengon",0006:"Kyeya",0007:"Kaoru",0008:"Gouriki",0009:"Reiji",000A:"Yami",000B:"Hikari",000C:"Invisible Fighter" + cn Player 1\Infinite Energy + 81105026 03E8 + cn Player 2\Player 1 Never Wins + 8009E3F4 0000 + cn Player 1\Need 1 Round to Win + D009E334 0000 + 8009E334 0001 + cn Player 2\Character Modifier + cd This Allows you to play as any Character you choose in any Mode + 8011B399 ???? 0000:"Azami",0001:"Serina",0002:"Miki",0003:"Kai",0004:"Sakai",0005:"Kengon",0006:"Kyeya",0007:"Kaoru",0008:"Gouriki",0009:"Reiji",000A:"Yami",000B:"Hikari",000C:"Invisible Fighter" + cn Player 2\Infinite Energy + 8111B3BE 03E8 + cn Player 1\Player 2 Has No Energy + cd Press C-Button Up and Player 2 will lose All Health resulting in a Instant K.O. + D0044461 0008 + 8111B3BE 0000 + cn Player 2\Player 1 Has No Energy + cd Press C-Button Up and Player 1 will lose All Health resulting in a Instant K.O. + D0044467 0008 + 81105026 0000 + cn Player 2\Need 1 Round to Win + D009E335 0000 + 8009E335 0001 + cn Player 1\Player 2 Never Wins + 8009E3F5 0000 + cn Have All Extras Open + cd This Code opens all extra stages in VS Battles,Team Battle 1P, Team Battles VS,Tag Battle and Practice Modes. Extra Male and Female Body in Create A Fighter Character and Have Extra Characters (Gouriki & Reiji) + 8009E31F 00FF + cn Music Modifier + 8009E21E ???? 0000:"Stereo",0001:"Monaural",0002:"Music Off" + +crc 99179359-2FE7EBC3-C:50 +gn Gex 3 - Deep Cover Gecko (E) + cn Infinite\Health + 810A60C8 0005 + cn Infinite\Lives + 810A60C6 0064 + cn Crazy Tail + 8110955E 0001 + cn Access All\Special Remote Controls + 810A60E4 FFFF + 810A60E6 FFFF + cn Access All\ordinary Remote Controls + 50000F01 0000 + 800A60A8 000F + cn Access All\Bonus Coins + 50000F02 0000 + 810A6124 0007 + cn Access All\Paw Coins + 50000F02 0000 + 810A60E8 03FF + +crc E68A000E-639166DD-C:50 +gn Gex 64 - Enter the Gecko (E) + cn Infinite Health + 800C50CB 0063 + cn Infinite Lives + 810C50C6 0063 + cn INFINITE AIR CODES\Umpire Strikes Out + D00BED05 0004 + 8136608E 012B + cn INFINITE AIR CODES\Pain In The Asteroids + D00BED05 0004 + 8133CBEE 012B + cn ACCESS ALL REMOTE CONTROLS\Red Remotes + cd Opens Gate 4 And The Lions Mouth + 50000E01 0000 + 800C513E 0007 + cn All Silver & Gold Gold Remotes + cd Opens Gate 3,2,1 + 810C5164 0FFF + 810C5166 FFFF + 810C5168 01E0 + 810C516A 007F + cn Hover & Fly Mode + cd Press And Hold L Button + A Button + D10BED04 0020 + 8114ECA2 0010 + D10BED04 0010 + cn Fully Charged Gex + cd Press L Button Once When On One Of The Specific Levels, For Circuit Central Levels Only + D00AAAB9 0020 + 81163CDE 32FF + +crc F5237301-99E3EE93-C:50 +gn Glover + cn Infinite\Energy + 8029129F 0003 + cn Infinite\99 Lives + 8029129B 0063 + cn Have Spell\Enlarge Spell + 812912B4 03E8 + cn 1000 Garibs + 80291297 0064 + cn Have Spell\Speed Up Spell + 812912B8 03E8 + cn Have Spell\Death Spell + 812912A8 03E8 + cn Have Spell\Sticky Fingers Spell + 812912B2 03E8 + cn All levels unlocked + cd At the main menu, where it says: Start, practice, options, & time trial, hold D-pad up, then the glove, playing-with-the-ball icon, will jump down into the lower left corner of the screen, then press the A button, and a level select screen will be available with all ordinary and boss levels, etc. available + 80298CFD 00A0 + cn Cheat Modifier\1 + 80298CFE ???? 0001:"Low gravity",0002:"Big ball",0003:"Both of the above" + cn Cheat Modifier\2 + 80298CFF ???? 0001:"Locate caribs",0002:"Call ball",0008:"Unlimited lives",0010:"Power ball",0020:"Control ball",0040:"Infinite energy",007B:"All of the above" + cn [100% Complete]\Save Slot 1 + cd All green crystals collected and Bonuslevels solved. + 801EBA37 0007 + 50000801 0000 + 801EBA28 00FF + cn [100% Complete]\Save Slot 2 + cd All green crystals collected and Bonuslevels solved. + 801EBA53 0007 + 50000801 0000 + 801EBA44 00FF + cn [100% Complete]\Save Slot 3 + cd All green crystals collected and Bonuslevels solved. + 801EBA6F 0007 + 50000801 0000 + 801EBA60 00FF + cn [100% Complete]\Save Slot 4 + cd All green crystals collected and Bonuslevels solved. + 801EBA8B 0007 + 50000801 0000 + 801EBA7C 00FF + cn [100% Complete]\Save Slot 5 + cd All green crystals collected and Bonuslevels solved. + 801EBAA7 0007 + 50000801 0000 + 801EBA98 00FF + cn [100% Complete]\Save Slot 6 + cd All green crystals collected and Bonuslevels solved. + 801EBAC3 0007 + 50000801 0000 + 801EBAB4 00FF + cn Super Jump + D02AFA14 0080 + 801EE771 0013 + +crc EE4A0E33-8FD588C9-C:50 +gn GT 64 Championship Edition (E) + cn Always first position + 80162A80 0001 + cn Only race one lap + 80161DF5 0001 + cn Always have 99 points + 80161EC1 0063 + +crc AE90DBEB-79B89123-C:50 +gn Hercules - The Legendary Journeys (E) + cn Infinite Health & Max Health + 810CFF5E 03E7 + 810CFF62 03E7 + cn Infinite Dinars + 800B6663 00E8 + 800B6662 00E8 + cn Infinite Magic + 810B6BEA 0063 + 810B6BD2 0063 + 810B6C02 0063 + 810B6C1A 0063 + cn Press L to Levitate + cd Press L Button to Levitate & Let go to come back down + D017D8F5 0020 + 810CFFB4 44CB + +crc 95B2B30B-2B6415C1-C:50 +gn Hexen (E) + cn Access In-Game Cheat Menu + cd To Access Pause Game Play. This gives you access to In-game Cheats like God Mode,Level Select,All Items Etc + 81137C56 07FF + 80137D33 0005 + +crc 277B129D-DD3879FF-C:50 +gn Holy Magic Century (E) + cn Set Agility to 999-999 + 8107C234 03E7 + cn Set Defence to 999-999 + 8107C236 03E7 + cn Makes your MP 999-999 + 8107C230 03E7 + 8107C232 03E7 + cn Makes your HP 999-999 + 8107C22C 03E7 + 8107C22E 03E7 + cn Have All Elements + 8107C24C 3232 + 8107C24E 3232 + cn Earn Spirits Faster + 8007C25D 0000 + cn No Random Battles + 8108CD1C 0000 + 8108CD1E 0000 + +crc E7D20193-C1158E93-C:50 +gn Hot Wheels Turbo Racing (E) + cn Allways 1st + 8111B14A 0000 + cn Max Tournament Points + 811270B6 02F4 + cn Infinite Turbos + 8111B39C 0800 + cn Access All Cars + 811270A4 FFFF + 811270A6 FFFF + cn A Few Extra Cars + 811270AA FFFF + cn Bonus Tracks + 811270AE FFFF + cn Race At Night + 801270CF 0080 + cn Mirror Mode + 801270CE 0001 + +crc 641D3A7F-86820466-C:50 +gn HYBRID HEAVEN PAL + cn Have All\Keys + 50000410 0000 + 80181B30 0063 + 50000410 0000 + 80181B38 0063 + cn Infinite\Weapons & Items + 50000610 0000 + 80181AD0 0063 + 50000610 0000 + 80181AD8 0063 + cn Infinite\Refresh Items + 50000E10 0000 + 801819F8 0063 + 80181A08 0063 + 50000D10 0000 + 80181A00 0063 + 80181A10 0063 + cn Infinite\Max Body Stats + 81181638 270F + 81181678 0063 + 50000C02 0000 + 81181640 270F + 50000502 0000 + 81181670 270F + 50000602 0000 + 81181698 270F + 50000602 0000 + 811816A6 270F + cn Infinite\Max Health + 81181630 270F + 81181632 270F + cn Level 999 + 81181678 270F + cn Have All\Moves + 50005306 0000 + 8118C950 0100 + 50005306 0000 + 8118C952 00FF + cn Difficulty Select Options + 811C5C1C ???? 0100:"Normal",0101:"Hard",0102:"Ultimate" + cn Play As + 811C5CF6 ???? 0001:"The real Mr Diaz Baddie",0002:"President Weller",0003:"Alien" + cn Press L To Levitate + D00CCE25 0020 + 812558F0 3FCB + cn Editor's Cheat Level and Battle Select + 801D74A4 0005 + +crc B58988E9-B1FC4BE8-C:50 +gn Hydro Thunder (E) + cn Always 1st + 812C4DC6 0001 + cn Infinite\Time + 812B49C0 42C8 + cn Infinite\Boosts\Player 1 + 812C4DCC 4190 + cn Have All\Ships + 812B5DD2 0101 + 812B5DD4 0101 + 812B5DD6 0101 + 812B5DD8 0101 + 812B5DDA 0101 + 812B5DDC 0101 + 812B5DDE 0101 + cn Have All\Races + 812B5DC4 0101 + 812B5DC6 0101 + 812B5DC8 0101 + 812B5DCA 0101 + 812B5DCC 0101 + 812B5DCE 0101 + 812B5DD0 0101 + cn Infinite\Boosts\Player 2 + 812C50FC 4190 + +crc D692CC5E-EC58D072-C:50 +gn Iggy's Reckin' Balls + cn Access\Lizzy + cd Top Secret Character + 810C642C 0001 + cn Access\All Characters,Worlds & Level Select + cd Pause Gameplay For Level Select + 810CD092 0007 + cn Infinite\Turbos + 810CD090 0008 + cn Infinite\Time + 810D9088 44E9 + cn Infinite\Credits + 810BDF5C 02F4 + cn Laps To Race + 800C8909 ???? 0001:"1 Lap",0002:"2 Laps",0003:"3 Laps",0004:"4 Laps",0005:"5 Laps",0006:"Laps",0007:"7 Laps",0008:"8 Laps",0009:"9 Laps" + cn Difficulty Level Easy + 810BDF68 0001 + cn Have Max\Points + 810D8FE0 02F4 + cn Have Max\RB Medals + 810D8FF0 02F4 + cn Freeze Timer + 810CD67C 4000 + cn Max Points + 800D8FE1 0063 + cn Max RB Medals + 800D8FF1 0063 + +crc E2D37CF0-F57E4EAE-C:50 +gn International Superstar Soccer 64 (E) + cn Home Team Scores + 80119F2B ???? 0000:"",0001:"1 Goal",0002:"2 Goals",0003:"3 Goals",0004:"4 Goals",0005:"5 Goals",0006:"6 Goals",0007:"7 Goals",0008:"8 Goals,09 9 Goals,0A 10 Goals",0014:"20 Goals",001E:"30 Goals",0028:"40 Goals",0032:"50 Goals" + cn Away Team Scores + 8011A9BF ???? 0000:"",0001:"1 Goal",0002:"2 Goals",0003:"3 Goals",0004:"4 Goals",0005:"5 Goals",0006:"6 Goals",0007:"7 Goals",0008:"8 Goals,09 9 Goals,0A 10 Goals",0014:"20 Goals",001E:"30 Goals",0028:"40 Goals",0032:"50 Goals" + cn Infinite player creation points + 801AC581 003C + +crc F41B6343-C10661E6-C:50 +gn International Superstar Soccer '98 (E) + cn Home Team Scores + 801A86FD ???? 0000:"",0001:"1 Goal",0002:"2 Goals",0003:"3 Goals",0004:"4 Goals",0005:"5 Goals",0006:"6 Goals",0007:"7 Goals",0008:"8 Goals,09 9 Goals,0A 10 Goals",0014:"20 Goals",001E:"30 Goals",0028:"40 Goals",0032:"50 Goals" + cn Away Team Scores + 801A9579 ???? 0000:"",0001:"1 Goal",0002:"2 Goals",0003:"3 Goals",0004:"4 Goals",0005:"5 Goals",0006:"6 Goals",0007:"7 Goals",0008:"8 Goals,09 9 Goals,0A 10 Goals",0014:"20 Goals",001E:"30 Goals",0028:"40 Goals",0032:"50 Goals" + cn Infinite player creation points + D03E0CF2 0001 + 803E0CF2 0063 + +crc 68D7A1DE-0079834A-C:50 +gn JET FORCE GEMINI + cn Access\All Characters + 80208910 FFFF + cn Infinite Continues + 800A34F1 0063 + cn Juno\Full & Max Health + 80208AB5 000C + 80208AB2 0040 + cn Juno\Access\All Keys + 81208B18 FFF7 + cn Juno\Access\All Objects + 81208B1A FFFF + cn Juno\Infinite\Mizar Tokens + 81208AC4 02F4 + cn Juno\Max Blue & White Heads + 81208ABA 03E7 + 81208AB8 03E7 + cn Juno\Infinite\Max Ammo All Guns + 50000302 0000 + 81208AC6 02F4 + 50000802 0000 + 81208ACC 02F4 + 50000402 0000 + 81208ADC 02F4 + cn Vela\Full & Max Health + 80208A3F 000C + 80208A3C 0040 + cn Vela\Access\All Keys + 81208AA2 FF70 + cn Vela\Access\All Objects + 81208AA4 FFFF + cn Vela\Infinite\Mizar Tokens + 81208A4E 02F4 + cn Vela\Max\Blue & White Heads + 81208A44 03E7 + 81208A42 03E7 + cn Vela\Infinite\Max Ammo All Guns + 50000302 0000 + 81208A50 02F4 + 50000802 0000 + 81208A56 02F4 + 50000402 0000 + 81208A66 02F4 + cn Lupus\Full & Max Health + 80208B2B 000C + 80208B28 0040 + cn Lupus\Access\All Keys + 81208B8E FF70 + cn Lupus\Access\All Objects + 81208B90 FFFF + cn Lupus\Infinite\Mizar Tokens + 81208B3A 02F4 + cn Lupus\Max\Blue & White Heads + 81208B30 03E7 + 81208B2E 03E7 + cn Lupus\Infinite\Max Ammo All Guns + 50000302 0000 + 81208B3C 02F4 + 50000802 0000 + 81208B42 02F4 + 50000402 0000 + 81208B52 02F4 + cn Access\All Floyd Awards + cd only enable One character at a time when using this code + 50000501 0000 + 80208908 0005 + cn Juno\Access\All Weapons + cd Do not put this code on until you collect one Extra Weapon then you will have all ready to use + 80208ABC 00FF + 80208ABD 00FF + cn Vela\Access\All Weapons + cd Do not put this code on until you collect one Extra Weapon then you will have all ready to use + 80208A46 00FF + 80208A47 00FF + cn Lupus\Access\All Weapons + cd Do not put this code on until you collect one Extra Weapon then you will have all ready to use + 80208B32 00FF + 80208B33 00FF + cn Tribals\Have All Tribals\Gold Wood + 802088E4 000F + cn Tribals\No Tribals Killed\Gold Wood + 802088E5 0000 + cn Tribals\Have No Tribals Remaining\Gold Wood + 802088E6 0000 + cn [Resolution Fix] + 800FE6F2 0003 + 800FE6DE 0003 + 800FEDEA 00D0 + cn Vela\All Single Player Levels Unlocked + 80208AA0 00FF + 80208AA1 00FF + cn Juno\All Single Player Levels Unlocked + 80208B16 00FF + 80208B17 00FF + cn Lupus\All Single Player Levels Unlocked + 80208B8C 00FF + 80208B8D 00FF + cn All Single Player Levels Unlocked + cd All Charcters + 80208AA0 00FF + 80208AA1 00FF + 80208B16 00FF + 80208B17 00FF + 80208B8C 00FF + 80208B8D 00FF + +crc 0F743195-D8A6DB95-C:50 +gn John Romero's Daikatana (E) + cn Infinite\Health + 81207B24 03E7 + cn Max\Experience + 81207B26 03E7 + cn Infinite\Armour + 81207B44 0001 + 81207B46 03E7 + cn Max\Attributes + 50000502 0000 + 81207B28 0007 + cn Level Select + 811C6B4E 0001 + cn Access\All Items + cd Press L Button Where Items Are available + D0209D85 0020 + 81207B8C 007F + cn Access\All Guns & Infinite Ammo + 81207AB4 007F + 81207AB6 FFFF + 81207B84 03E7 + 50000A02 0000 + 81207B70 03E7 + +crc 979B263E-F8470004-C:50 +gn Killer Instinct Gold (E) + cn Infinite Health + 801D3584 0078 + cn Invincible + 801D35D4 000A + cn Access In-Game Cheats + 801283DC 0006 + cn Access Gargos Character + 80127DC8 0001 + cn Fast Kick & Punch + 801D357E 0010 + cn Max Blood + 80127D5D 0003 + cn No Time Limit + 80127D5B 0001 + +crc 0D93BA11-683868A6-C:50 +gn Kirby64 + cn Infinite Max Health + 800D718F 0006 + 800D7151 00C0 + cn Kirkby can fly unlimited + 8012EADF 00F0 + cn Access all enemy info + 50005101 0000 + 800D6F10 0002 + cn Access all crystals + 50000701 0000 + 800D6EC0 0001 + 50001701 0000 + 800D6EC8 0007 + cn Access all difficulty levels + cd 100 yard hop, bumper crop bump & checkerboard chase + 50000301 0000 + 800D6E69 0003 + cn All Levels completed + cd You must still beat boss's to continue onto next level + 50002B01 0000 + 800D6EE0 0002 + cn All Save Slots 100% Completed\Save slot 1 + 800ECD18 0064 + cn All Save Slots 100% Completed\Save slot 2 + 800ECD70 0064 + cn All Save Slots 100% Completed\Save slot 3 + 800ECDC8 0064 + cn Infinite Max Lives + 800D714F 0064 + +crc 4A997C74-E2087F99-C:50 +gn Knife Edge - Nose Gunner (E) + cn Infinite Armour\Player One + 8011D65F 0064 + cn Infinite Bombs\Player One + 8011D667 0003 + cn Level 11 Vulcan Cannon\Player One + 80123BAB 000A + cn Infinite Armour\Player Two + 8011D663 0064 + cn Infinite Bombs\Player Two + 8011D66B 0003 + cn Level 11 Vulcan Cannon\Player Two + 80123BCB 000A + cn Level Select + 81123E16 000C + cn Extreme Mode + 8111D332 0003 + cn Max Score + 81123B82 FC9A + +crc E3D6A795-2A1C5D3C-C:50 +gn Knockout Kings 2000 (E) + cn Infinite Health\Player 1 + 8106B974 42C8 + 8106B9DE 0000 + cn Infinite Health\Player 2 + 8106BAE4 42C8 + 8106BAE6 0000 + cn No Health\Player 1 + 8106B9DC 0000 + 8106B9DE 0000 + cn No Health\Player 2 + 8106BAE4 0000 + 8106BAE6 0000 + cn Full Punch Meter\Player 1 + 8106B9E8 0000 + 8106B9EA 0BB2 + cn Full Punch Meter\Player 2 + 8106B9E8 0000 + 8106B9EA 0BB2 + cn Empty Punch Meter\Player 1 + 8106B9E8 0000 + 8106B9EA 0000 + cn Empty Punch Meter\Player 2 + 8016BAF0 0000 + 8016BAF2 0000 + cn Infinite Boxer Creation Points + 810637AA 0064 + cn Have Full\Power Bar + 810637AE 0064 + cn Have Full\Speed Bar + 810637B2 0064 + cn Have Full\Stamina Bar + 810637B6 0064 + cn Big Options\Big Head Mode + 800F407C 0001 + cn Big Options\Big Gloves Mode + 800F407D 0001 + +crc E97955C6-BC338D38-C:50 +gn Legend of Zelda, The - Majora's Mask (E) (M4) (v1.0) + cn Infinite\Rupees + 811E6B8A 03E7 + cn Infinite\Health + 811E6B86 03E7 + cn Infinite\Max & Double Magic Meter + 801E6B89 0060 + 811E6B90 0101 + cn Infinite\Items + cd This is Infinite use of Bombs,Bombchus,Deku Sticks,Deku Nuts,Magic Beans,& Powder Kegs. But you must also put it's Have on to work. + 801E6BF1 0063 + 801E6BF6 0063 + 801E6BF7 0063 + 801E6BF8 0063 + 801E6BF9 0063 + 801E6BFA 0063 + 801E6BFC 0063 + 801E6BFB 0063 + 801E6BFD 0063 + cn Have\All Masks + 811E6BD8 3E39 + 811E6BDA 4745 + 811E6BDC 4032 + 811E6BDE 3A46 + 811E6BE0 3842 + 811E6BE2 4833 + 811E6BE4 3C3D + 811E6BE6 373F + 811E6BE8 3634 + 811E6BEA 4341 + 811E6BEC 3B44 + 811E6BEE 4935 + cn Use all C Buttons + 811EAA68 0000 + 811EAA6A 0000 + cn Event Item\Modifier 1 + 801E6BC5 ???? 0028:"Moon's Tear",0029:"Land Title Deed",002A:"Swap Title Deed",002B:"Mountain Title Deed",002C:"Ocean Title Deed",002D:"Room Key",002E:"Special Delivery To Mama",002F:"Letter To Kafei",0030:"Pendant Of Memories" + cn Event Item\Modifier 2 + 801E6BCB ???? 0028:"Moon's Tear",0029:"Land Title Deed",002A:"Swap Title Deed",002B:"Mountain Title Deed",002C:"Ocean Title Deed",002D:"Room Key",002E:"Special Delivery To Mama",002F:"Letter To Kafei",0030:"Pendant Of Memories" + cn Event Item\Modifier 3 + 801E6BD1 ???? 0028:"Moon's Tear",0029:"Land Title Deed",002A:"Swap Title Deed",002B:"Mountain Title Deed",002C:"Ocean Title Deed",002D:"Room Key",002E:"Special Delivery To Mama",002F:"Letter To Kafei",0030:"Pendant Of Memories" + cn Have Item Modifier + 801E6BD0 ???? 0005:"Japanese Flute?",000B:"Japanese Item?",0010:"Great Fairy's Sword",0011:"Japanese Hookshot?",0031:"Japanese Scroll?",004A:"Japanese Bow?" + cn Bottles\Bottle 1 Modifier + 801E6BD2 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 2 Modifier + 801E6BD3 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 3 Modifier + 801E6BD4 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 4 Modifier + 801E6BD5 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 5 Modifier + 801E6BD6 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 6 Modifier + 801E6BD7 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Have\Great Fairy's Sword + 801E6BD0 0010 + cn Have\QuestStatus Items + 801E6C0D 0005 + 811E6C0E F7CF + cn Have\Have Ocarina of Time + 801E6BC0 0000 + cn Have\Hero's Bow + 801E6BC1 0001 + cn Have\Fire Arrow + 801E6BC2 0002 + cn Have\Ice Arrow + 801E6BC3 0003 + cn Have\Light Arrow + 801E6BC4 0004 + cn Have\Bombs + 801E6BC6 0006 + cn Have\Bombchu + 801E6BC7 0007 + cn Have\Deku Sticks + 801E6BC8 0008 + cn Have\Deku Nuts + 801E6BC9 0009 + cn Have\Magic Beans + 801E6BCA 000A + cn Have\Powder Kegs + 801E6BCC 000C + cn Have\Pictograph + 801E6BCD 000D + cn Have\Lens of Truth + 801E6BCE 000E + cn Have\Hookshot + 801E6BCF 000F + cn All Equipment Upgrades + 801E6BBD 0023 + 811E6C0A 201B + 801E6B9C 004F + cn Replace Sword With + cd Only put the Deity Link's Sword on, if using The Play As Fierce Deity Link Code, if not it will turn Fierce Deity Link into a crazed slashing Machine. You have been warned. + 801E6B9C ???? 004A:"Fire Arrow w/ Bow",004B:"Ice Arrow w/ Bow",004C:"Light Arrow w/ Bow",004D:"Kokiri Sword",004E:"Razor Sword",004F:"Guilded Sword",0050:"Deity Link's Sword" + cn Play As + 801E6B70 ???? 0000:"Fierce Deity Link",0001:"Goron Link",0002:"Zora Link",0003:"Deku Link",0004:"Normal Link" + cn Infinite\Hearts Options + cd If you need to clear the Infinite Max Hearts from the screen just choose the 6 or 4 Heart Options, take off the cheat & then make a save. + 811E6B84 ???? 0140:"Max Hearts",0063:"6 Hearts",0043:"4 Hearts" + cn Press L To Levitate + cd Press L To Levitate & Let go to land + D03DDFDB 0020 + 813F72B8 40CB + cn Beta World 1 + cd Put on the code on load up,After the Nintendo logo you will be in that place of Choice.you can also choose another place & then press F1 (reset) to go to that place this is for beta interest only it will not assist you in playing the game. + D03DDFDB 0000 + 801E6B52 ???? 0000:"Mama's House",0001:"Fearful Spider House",0002:"Beneaf the Graveyard",0003:"Southern Swamp Mr Tingle Entry",0006:"Outside Tourist Information Southern Swamp",0008:"Outside Magic Hag's Potion Shop",000A:"Southern Swamp Woods Of Mystery Entry",0024:"Counter Of The Tresure Chest Shop",002E:"Woodfall Temple non Beta",0032:"Spider Hand",0035:"Statue outside Gorman Track",0036:"Statue outside Lair Of The Temples Boss",0038:"Path to Romani Ranch non Beta",004A:"outside The Royal Palace of the Deku Kingdom",004C:"Ledge in The Royal Palace of the Deku Kingdom",004E:"inside The Royal Palace of the Deku Kingdom 1",0071:"Green Blobs",0074:"Cave Portal to Last Boss Field",007F:"Waterfall Sothern Swamp",008A:"Giant Turtle In the Temple non beta",008B:"Room of Miau & Tijo Zora Great Hall",0094:"Recieving Gorans Mask non Beta",0095:"?",0096:"Hungry Goran in the Snow",00A2:"Statue in Stone Tower",00A6:"Stone Tower non Beta",00B9:"Recieving Deku Mask non Beta",00D9:"Giant Lizards in a Cave",00DA:"Cave with Steaming Water",00FF:"Vamps House In Ikana Canyon" + cn Warp Modifier + cd Put this code on and it will now take where you wanted to go, turn it back off or it will infinite loop entering all the time. + 803DDFDA 0000 + 803F6835 0001 + 813F683A ???? 0010:"Mayors Residence",0008:"Magic Hags Potion Shop",000A:"Romani Ranch Barn",000B:"Mama's House",000E:"Honey & Darlings Shop",0015:"Final Boss Arena",001F:"Beneath the Graveyard (left entrance)",002F:"Beneath the Graveyard (right entrance)",0030:"Southern Swamp (Reg Entrance)",004F:"Southern Swamp (from tour house)",006E:"Southern Swamp (from Woodfall)",006F:"Southern Swamp (from Deku Palace)",0078:"Path to Ikana Canyon",009E:"Southern Swamp (from Deku Place 2)",009F:"Southern Swamp (From Potion Shop)",00AF:"Boat Cruise (picture taking)",00CD:"Southern Swamp (From Woods of Mystery)",00CE:"Southern Swamp (From Spider House)",00CF:"Southern Swamp (From Ikana Canyon)",00FE:"Southern Swamp (From Owl Warp)",0E00:"Curiosity Shop",0E38:"Ikana Canyon Entrance",1500:"Lens of Truth Cave (get it)",2600:"Stone Tower Temple (Upside down)",2609:"Stone Tower Temple (Boss Room Entrance)",2604:"Treasure Chest Shop",2605:"Treausre Chest Shop (counter)",260E:"Clock Tower (w/ skull kid, silent)",2610:"Stone Tower Temple (endless fall)",6214:"Romani Ranch",9214:"Zora Shop",B214:"Snowhead (Path to temple, warp in)",D214:"East Clock Down" + +crc 0A5D8F83-98C5371A-C:50 +gn Legend of Zelda, The - Majora's Mask (E) (M4) (v1.1) + cn Infinite\Rupees + 811E6F2A 03E7 + cn Infinite\Health + 811E6F26 03E7 + cn Infinite\Max & Double Magic Meter + 801E6F29 0060 + 811E6F30 0101 + cn Infinite\Items + cd This is Infinite use of Bombs,Bombchus,Deku Sticks,Deku Nuts,Magic Beans,& Powder Kegs. But you must also put it's Have on to work. + 801E6F91 0063 + 50000801 0000 + 801E6F96 0063 + cn Have\All Masks + 811E6F78 3E39 + 811E6F7A 4745 + 811E6F7C 4032 + 811E6F7E 3A46 + 811E6F80 3842 + 811E6F82 4833 + 811E6F84 3C3D + 811E6F86 373F + 811E6F88 3634 + 811E6F8A 4341 + 811E6F8C 3B44 + 811E6F8E 4935 + cn Use all C Buttons + 811EAE08 0000 + 811EAE0A 0000 + cn Event Item\Modifier 1 + 801E6F65 ???? 0028:"Moon's Tear",0029:"Land Title Deed",002A:"Swap Title Deed",002B:"Mountain Title Deed",002C:"Ocean Title Deed",002D:"Room Key",002E:"Special Delivery To Mama",002F:"Letter To Kafei",0030:"Pendant Of Memories" + cn Event Item\Modifier 2 + 801E6F6B ???? 0028:"Moon's Tear",0029:"Land Title Deed",002A:"Swap Title Deed",002B:"Mountain Title Deed",002C:"Ocean Title Deed",002D:"Room Key",002E:"Special Delivery To Mama",002F:"Letter To Kafei",0030:"Pendant Of Memories" + cn Event Item\Modifier 3 + 801E6F71 ???? 0028:"Moon's Tear",0029:"Land Title Deed",002A:"Swap Title Deed",002B:"Mountain Title Deed",002C:"Ocean Title Deed",002D:"Room Key",002E:"Special Delivery To Mama",002F:"Letter To Kafei",0030:"Pendant Of Memories" + cn Have Item Modifier + 801E6F70 ???? 0005:"Japanese Flute?",000B:"Japanese Item?",0010:"Great Fairy's Sword",0011:"Japanese Hookshot?",0031:"Japanese Scroll?",004A:"Japanese Bow?" + cn Bottles\Bottle 1 Modifier + 801E6F72 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 2 Modifier + 801E6F73 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 3 Modifier + 801E6F74 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 4 Modifier + 801E6F75 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 5 Modifier + 801E6F76 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 6 Modifier + 801E6F77 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Have\Great Fairy's Sword + 801E6F70 0010 + cn Have\QuestStatus Items + 801E6FAD 0005 + 811E6FAE F7CF + cn Have\Have Ocarina of Time + 801E6F60 0000 + cn Have\Hero's Bow + 801E6F61 0001 + cn Have\Fire Arrow + 801E6F62 0002 + cn Have\Ice Arrow + 801E6F63 0003 + cn Have\Light Arrow + 801E6F64 0004 + cn Have\Bombs + 801E6F66 0006 + cn Have\Bombchu + 801E6F67 0007 + cn Have\Deku Sticks + 801E6F68 0008 + cn Have\Deku Nuts + 801E6F69 0009 + cn Have\Magic Beans + 801E6F6A 000A + cn Have\Powder Kegs + 801E6F6C 000C + cn Have\Pictograph + 801E6F6D 000D + cn Have\Lens of Truth + 801E6F6E 000E + cn Have\Hookshot + 801E6F6F 000F + cn All Equipment Upgrades + 801E6F5D 0023 + 811E6FAA 201B + 801E6F3C 004F + cn Replace Sword With + cd Only put the Deity Link's Sword on, if using The Play As Fierce Deity Link Code, if not it will turn Fierce Deity Link into a crazed slashing Machine. You have been warned. + 801E6F3C ???? 004A:"Fire Arrow w/ Bow",004B:"Ice Arrow w/ Bow",004C:"Light Arrow w/ Bow",004D:"Kokiri Sword",004E:"Razor Sword",004F:"Guilded Sword",0050:"Deity Link's Sword" + cn Play As + 801E6F10 ???? 0000:"- Fierce Deity Link",0001:"Goron Link",0002:"Zora Link",0003:"Deku Link",0004:"Normal Link" + cn Infinite\Hearts Options + cd If you need to clear the Infinite Max Hearts from the screen just choose the 6 or 4 Heart Options, take off the cheat & then make a save. + 811E6F24 ???? 0140:"Max Hearts",0063:"6 Hearts",0043:"4 Hearts" + cn Press L To Levitate + cd Press L To Levitate & Let go to land + D03DE37B 0020 + 813F7658 40CB + cn Beta World 1 + cd Put on the code on load up,After the Nintendo logo you will be in that place of Choice.you can also choose another place & then press F1 (reset) to go to that place this is for beta interest only it will not assist you in playing the game. + D03DE37B 0000 + 801E6EF2 ???? 0000:"Mama's House",0001:"Fearful Spider House",0002:"Beneaf the Graveyard",0006:"Outside Tourist Information Southern Swamp",0008:"Outside Magic Hag's Potion Shop",000A:"Southern Swamp Woods Of Mystery Entry",0024:"Counter Of The Tresure Chest Shop",0032:"Spider Hand",0035:"Statue outside Gorman Track",0036:"Statue outside Lair Of The Temples Boss",004A:"Outside The Royal Palace of the Deku Kingdom",004C:"Ledge in The Royal Palace of the Deku Kingdom",004E:"Inside The Royal Palace of the Deku Kingdom 1",0071:"Green Blobs",007F:"Waterfall Sothern Swamp",008B:"Room of Miau & Tijo Zora Great Hall",00A2:"Statue in Stone Tower",00D9:"Giant Lizards in a Cave",00DA:"Cave with Steaming Water" + cn Warp Modifier + cd Put this code on and it will now take where you wanted to go, turn it back off or it will infinite loop entering all the time. + 803DE37A 0000 + 803F6BD5 0001 + 813F6BDA ???? 0010:"Mayors Residence",0008:"Magic Hags Potion Shop",000A:"Romani Ranch Barn",000B:"Mama's House",000E:"Honey & Darlings Shop",0015:"Final Boss Arena",001F:"Beneath the Graveyard (left entrance)",002F:"Beneath the Graveyard (right entrance)",0030:"Southern Swamp (Reg Entrance)",004F:"Southern Swamp (from tour house)",006E:"Southern Swamp (from Woodfall)",006F:"Southern Swamp (from Deku Palace)",0078:"Path to Ikana Canyon",009E:"Southern Swamp (from Deku Place 2)",009F:"Southern Swamp (From Potion Shop)",00AF:"Boat Cruise (picture taking)",00CD:"Southern Swamp (From Woods of Mystery)",00CE:"Southern Swamp (From Spider House)",00CF:"Southern Swamp (From Ikana Canyon)",00FE:"Southern Swamp (From Owl Warp)",0E00:"Curiosity Shop",0E38:"Ikana Canyon Entrance",1500:"Lens of Truth Cave (get it)",2600:"Stone Tower Temple (Upside down)",2609:"Stone Tower Temple (Boss Room Entrance)",2604:"Treasure Chest Shop",2605:"Treausre Chest Shop (counter)",260E:"Clock Tower (w/ skull kid, silent)",2610:"Stone Tower Temple (endless fall)",6214:"Romani Ranch",9214:"Zora Shop",B214:"Snowhead (Path to temple, warp in)",D214:"East Clock Down" + +crc 6AECEC4F-F0924814-C:50 +gn The Legend of Zelda - Majora's Mask - Collector's Edition (E) (GC Version) + cn Infinite\Rupees + 811E54BA 03E7 + cn Infinite\Health + 811E54B6 03E7 + cn Infinite\Max & Double Magic Meter + 801E54B9 0060 + 811E54C0 0101 + cn Infinite\Items + cd This is Infinite use of Bombs,Bombchus,Deku Sticks,Deku Nuts,Magic Beans,& Powder Kegs. But you must also put it's Have on to work. + 801E5521 0063 + 50000801 0000 + 801E5526 0063 + cn Have\All Masks + 811E5508 3E39 + 811E550A 4745 + 811E550C 4032 + 811E550E 3A46 + 811E5510 3842 + 811E5512 4833 + 811E5514 3C3D + 811E5516 373F + 811E5518 3634 + 811E551A 4341 + 811E551C 3B44 + 811E551E 4935 + cn Use all C Buttons + 811E9398 0000 + 811E939A 0000 + cn Event Item\Modifier 1 + 801E54F5 ???? 0028:"Moon's Tear",0029:"Land Title Deed",002A:"Swap Title Deed",002B:"Mountain Title Deed",002C:"Ocean Title Deed",002D:"Room Key",002E:"Special Delivery To Mama",002F:"Letter To Kafei",0030:"Pendant Of Memories" + cn Event Item\Modifier 2 + 801E54FB ???? 0028:"Moon's Tear",0029:"Land Title Deed",002A:"Swap Title Deed",002B:"Mountain Title Deed",002C:"Ocean Title Deed",002D:"Room Key",002E:"Special Delivery To Mama",002F:"Letter To Kafei",0030:"Pendant Of Memories" + cn Event Item\Modifier 3 + 801E5501 ???? 0028:"Moon's Tear",0029:"Land Title Deed",002A:"Swap Title Deed",002B:"Mountain Title Deed",002C:"Ocean Title Deed",002D:"Room Key",002E:"Special Delivery To Mama",002F:"Letter To Kafei",0030:"Pendant Of Memories" + cn Have Item Modifier + 801E5500 ???? 0005:"Japanese Flute?",000B:"Japanese Item?",0010:"Great Fairy's Sword",0011:"Japanese Hookshot?",0031:"Japanese Scroll?",004A:"Japanese Bow?" + cn Bottles\Bottle 1 Modifier + 801E5502 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 2 Modifier + 801E5503 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 3 Modifier + 801E5504 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 4 Modifier + 801E5505 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 5 Modifier + 801E5506 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Bottles\Bottle 6 Modifier + 801E5507 ???? 0012:"Empty Bottle",0013:"Red Potion",0014:"Green Potion",0015:"Blue Potion",0016:"Fairy",0017:"Deku Princess",0018:"Milk",0019:"Milk (1/2)",001A:"Fish",001B:"Bug",001C:"Blue Fire",001D:"Poe",001E:"Big Poe",001F:"Spring Water",0020:"Hot Spring Water",0021:"Zora Egg",0022:"Gold Dust",0023:"Magical Mushroom",0024:"Sea Horse",0025:"Chateau Romani",0026:"Japanese Bottle?",0027:"Empty Japanese Bottle?" + cn Have\Great Fairy's Sword + 801E5500 0010 + cn Have\QuestStatus Items + 801E553D 0005 + 811E553E F7CF + cn Have\Have Ocarina of Time + 801E54F0 0000 + cn Have\Hero's Bow + 801E54F1 0001 + cn Have\Fire Arrow + 801E54F2 0002 + cn Have\Ice Arrow + 801E54F3 0003 + cn Have\Light Arrow + 801E54F4 0004 + cn Have\Bombs + 801E54F6 0006 + cn Have\Bombchu + 801E54F7 0007 + cn Have\Deku Sticks + 801E54F8 0008 + cn Have\Deku Nuts + 801E54F9 0009 + cn Have\Magic Beans + 801E54FA 000A + cn Have\Powder Kegs + 801E54FC 000C + cn Have\Pictograph + 801E54FD 000D + cn Have\Lens of Truth + 801E54FE 000E + cn Have\Hookshot + 801E54FF 000F + cn All Equipment Upgrades + 801E54ED 0023 + 811E553A 201B + 801E54CC 004F + cn Replace Sword With + cd Only put the Deity Link's Sword on, if using The Play As Fierce Deity Link Code, if not it will turn Fierce Deity Link into a crazed slashing Machine. You have been warned. + 801E54CC ???? 004A:"Fire Arrow w/ Bow",004B:"Ice Arrow w/ Bow",004C:"Light Arrow w/ Bow",004D:"Kokiri Sword",004E:"Razor Sword",004F:"Guilded Sword",0050:"Deity Link's Sword" + cn Play As + 801E54A0 ???? 0000:"Fierce Deity Link",0001:"Goron Link",0002:"Zora Link",0003:"Deku Link",0004:"Normal Link" + cn Infinite\Hearts Options + cd If you need to clear the Infinite Max Hearts from the screen just choose the 6 or 4 Heart Options, take off the cheat & then make a save. + 811E54B4 ???? 0140:"Max Hearts",0063:"6 Hearts",0043:"4 Hearts" + cn Press L To Levitate + cd Press L To Levitate & Let go to land + D0378ECB 0020 + 813921A8 40CB + cn Beta World 1 + cd Put on the code on load up,After the Nintendo logo you will be in that place of Choice.you can also choose another place & then press F1 (reset) to go to that place this is for beta interest only it will not assist you in playing the game. + D03DC90B 0000 + 801E5482 ???? 0000:"Mama's House non Beta",0001:"Fearful Spider House",0002:"Beneaf the Graveyard",0003:"Southern Swamp Mr Tingle Entry",0006:"Outside Tourist Information Southern Swamp",0008:"Outside Magic Hag's Potion Shop",000A:"Southern Swamp Woods Of Mystery Entry",0024:"Counter Of The Tresure Chest Shop",002E:"Woodfall Temple non Beta",0032:"Spider Hand",0035:"Statue outside Gorman Track",0036:"Statue outside Lair Of The Temples Boss",0038:"Path to Romani Ranch non Beta",004A:"outside The Royal Palace of the Deku Kingdom",004C:"Ledge in The Royal Palace of the Deku Kingdom",004E:"inside The Royal Palace of the Deku Kingdom 1",0071:"Green Blobs",0074:"Cave Portal to Last Boss Field",007F:"Waterfall Sothern Swamp",008A:"Giant Turtle In the Temple non beta",008B:"Room of Miau & Tijo Zora Great Hall",0094:"Recieving Gorans Mask non Beta",0095:"?",0096:"Hungry Goran in the Snow",00A2:"Statue in Stone Tower",00A6:"Stone Tower non Beta",00B9:"Recieving Deku Mask non Beta",00D9:"Giant Lizards in a Cave",00DA:"Cave with Steaming Water",00FF:"Vamps House In Ikana Canyon" + cn Warp Modifier + cd Put this code on and it will now take where you wanted to go, turn it back off or it will infinite loop entering all the time. + 803DC90A 0000 + 803F5165 0001 + 813F516A ???? 0010:"Mayors Residence",0008:"Magic Hags Potion Shop",000A:"Romani Ranch Barn",000B:"Mama's House",000E:"Honey & Darlings Shop",0015:"Final Boss Arena",001F:"Beneath the Graveyard (left entrance)",002F:"Beneath the Graveyard (right entrance)",0030:"Southern Swamp (Reg Entrance)",004F:"Southern Swamp (from tour house)",006E:"Southern Swamp (from Woodfall)",006F:"Southern Swamp (from Deku Palace)",0078:"Path to Ikana Canyon",009E:"Southern Swamp (from Deku Place 2)",009F:"Southern Swamp (From Potion Shop)",00AF:"Boat Cruise (picture taking)",00CD:"Southern Swamp (From Woods of Mystery)",00CE:"Southern Swamp (From Spider House)",00CF:"Southern Swamp (From Ikana Canyon)",00FE:"Southern Swamp (From Owl Warp)",0E00:"Curiosity Shop",0E38:"Ikana Canyon Entrance",1500:"Lens of Truth Cave (get it)",2600:"Stone Tower Temple (Upside down)",2609:"Stone Tower Temple (Boss Room Entrance)",2604:"Treasure Chest Shop",2605:"Treausre Chest Shop (counter)",260E:"Clock Tower (w/ skull kid, silent)",2610:"Stone Tower Temple (endless fall)",6214:"Romani Ranch",9214:"Zora Shop",B214:"Snowhead (Path to temple, warp in)",D214:"East Clock Down" + +crc B044B569-373C1985-C:50 +gn Legend of Zelda, The - Ocarina of Time (E) (V1.0) + cn Infinite\Rupees + cd This cheat allows you to have the max Rupees to the Wallet you currently Hold + 8111979C 0001 + cn Press R\For Old Or Young Link + cd To Activate this Cheat Hold The R Button when walking through a Doorway this will change you to the option on the other side, Disable this Cheat straight away after getting to the other side, in some places you might even get Access Violations. Just press ok untill you can carry on. + D01C64F5 0010 + 801183D7 ???? 0001:"Link Young",0000:"Link Old" + cn Use Any Item In Any House + cd do not use under or in water + 811195F2 0000 + 811195F4 0000 + cn Have\All Equipment + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 8111846C 7777 + cn Have\All Quest/Status Items + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 81118474 30FF + 81118476 FFFF + cn Max\Heart Containers + 811183FE 0140 + cn Max\Gold Skulltulas Killed + 801184A1 0064 + cn Time of Day Modifier + 811183DC ???? 4000:"At Sunrise",5800:"Daylight Out",7000:"Very Bright Out",C000:"At Sunset",D000:"Fairly Dark" + cn Infinite\Energy + 81118400 0140 + cn Infinite\Magic + D0118409 0008 + 8011840A 0001 + 8011840C 0001 + 80118403 0060 + cn Tunic & Boot Options + cd This changes what you are wearing,once you have enabled the code press Start & then start again. + 80118440 ???? 0011:"Kokiri Tunic & Kokiri Boots",0012:"Goron Tunic & Kokiri Boots",0013:"Zora Tunic & Kokiri Boots",0014:"Black Tunic & Kokiri Boots",0015:"White Tunic & Kokiri Boots",0016:"Yellow Tunic & Kokiri Boots",0021:"Kokiri Tunic & Iron Boots",0022:"Goron Tunic & Iron Boots",0023:"Zora Tunic & Iron Boots",0024:"Black Tunic & Iron Boots",0025:"White Tunic & Iron Boots",0026:"Yellow Tunic & Iron Boots",0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Infinite\Deku Sticks + 8011845C 0009 + cn Infinite\Deku Nuts + 8011845D 0009 + cn Infinite\Bombs + 8011845E 0009 + cn Infinite\Arrows + 8011845F 0009 + cn Infinite\Deku Seeds + 80118462 0009 + cn Infinite\Bombchu's + 80118464 0009 + cn Infinite\Magic Beans + 8011846A 0009 + cn Infinite\Big Key,Small Keys,Compass,& Map + 50000B01 0000 + 80118478 0007 + 50000501 0000 + 8011848F 0009 + 80118497 0009 + 80118499 0009 + 8011849C 0009 + cn Have\Ocarina + 8011844B ???? 0007:"Fairy Ocarina",0008:"Ocarina Of Time" + cn Have\Boomerang + 80118450 000E + cn Have\Lens of Truth + 80118451 000F + cn Have\Megaton Hammer + 80118453 0011 + cn Have\Deku Stick + 80118444 0000 + cn Have\Deku Nut + 80118445 0001 + cn Have\Bombs + 80118446 0002 + cn Have\Fairy Bow + 80118447 0003 + cn Have\Fairy Slingshot + 8011844A 0006 + cn Have\Bombchu + 8011844C 0009 + cn Have\Arrows\Fire Arrow + 80118448 0004 + cn Have\Arrows\Ice Arrow + 8011844E 000C + cn Have\Arrows\Light Arrow + 80118454 0012 + cn Have\Hookshot + 8011844D ???? 000A:"Hookshot",000B:"Longshot" + cn Have\Magic Beans + 80118452 0010 + cn Have\Magic\Fairie's Wind + 8011844F 000D + cn Have\Magic\Nayru's Love + 80118455 0013 + cn Have\Magic\Din's Fire + 80118449 0005 + cn Bottles\Bottle 1 Modifier + 80118456 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 2 Modifier + 80118457 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 3 Modifier + 80118458 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 4 Modifier + 80118459 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Trading\Adult Link Item + 8011845A ???? 002D:"Pocket Egg",002E:"Pocket Cucco",002F:"Cojiro",0030:"Odd Mushroom",0031:"Odd Potion",0032:"Poacher's Saw",0033:"Goron's Sword (Broken)",0034:"Prescription",0035:"Eyeball Frog",0036:"Eye Drops",0037:"Claim Check" + cn Trading\Young Link Item + 8011845B ???? 0021:"Weird Egg",0022:"Chicken",0023:"Zelda's Letter",0024:"Keaton Mask",0025:"Skull Mask",0026:"Spooky Mask",0027:"Bunny Hood",0028:"Goron Mask",0029:"Zora Mask",002A:"Gerudo Mask",002B:"Mask of Truth",002C:"SOLD OUT" + cn Turn Giant's Knife Into Biggoron's Sword + 8011840E 0001 + cn Have Quiver (Holds 30) + 80118471 0001 + cn Equipment Modifier 1 + cd This modifies the equipment you are carrying. + 80118472 ???? 0002:"Silver Scale",0004:"Golden Scale",0006:"Giant's Knife (Broken)",0035:"Black Gauntlets",0040:"Bullet Bag (Holds 30)",0080:"Bullet Bag (Holds 40)",00C0:"Bullet Bag (Holds 50)" + cn Equipment Modifier 2 + cd This modifies the equipment you are carrying. + 80118473 ???? 0008:"Bomb Bag (Holds 20)",0010:"Bomb Bag (Holds 30)",0018:"Bomb Bag (Holds 40)",0020:"Goron's Bracelet",0028:"Silver Gauntlets",0030:"Golden Gauntlets" + cn Press L To Levitate + cd Press L To Levitate & Let go to land + D01C64F5 0020 + 811D8AE0 40CB + cn Press L For infinite Hover Boots + cd Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on + D01C64F5 0020 + 811D92F2 000D + cn Instant Step Hoover Boots + cd Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. + D01C64F5 0020 + 811D8AE0 40CB + D01C64F5 0000 + 811D92F2 000D + 80118440 ???? 0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Beta\Play Beta Quest Worlds + cd Put on the code on load up,After the Nintendo logo you will be in Hyrule Field,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. + D01C64F5 0000 + 801197E3 ???? 0000:"World 01",0001:"World 02",0002:"World 03",0003:"World 04",0004:"World 05",0007:"World 06",0008:"World 07",0016:"World 08" + cn Warp Song Location\Minuet of Forest & Serenade of Water + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 80119765 ???? 0000:"Sacred Forest Meadow",0004:"Lake Hylia",0015:"Inside Jabu Jabu's Belly",0018:"Dodongo's Cavern",0068:"Inside The Deku Tree" + cn Warp Song Location\Prelude of Light & Nocturne of Shadow + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 80119765 ???? 0003:"Kakariko Windmill",0007:"Bombchu Bowling Alley",000F:"Zelda & Impa Flee",0014:"Kakariko Village",0017:"Ganon,Final Battle",001D:"Top of Ganon's Tower",0028:"Bombchu Shop",002C:"Bazaar",0030:"Happy Mask Shop",0034:"Ganon's Tower",0038:"Ganon's Castle",004C:"Inside Spirit Door",006C:"Burning Castle",0050:"House of Skulltula",0064:"Death Mountain Trail",0068:"Graveyard",0070:"Thieves' Hideout",0074:"Royal Family's Tomb",0078:"Great Fairy Fountain 1",0084:"Forest Temple,Room With Falling Floor",0088:"Great Fairy Fountain 2",0099:"Grotto 01",009D:"Grotto 02",00A4:"Grotto 04",00A8:"Grotto 05",00B3:"Grotto 06",00B0:"Grotto 07",00B4:"Grotto 08",00B8:"Grotto 09",00C3:"Grotto 10",00C0:"Grotto 11",00C4:"Grotto 12",00FC:"Grotto 13",00D3:"Bottom of the Well",00D0:"Lon Lon Ranch Shed",00D3:"Lon Lon Ranch Outside Shed",00D8:"Ice Cavern",00E3:"Outside Cow Pen",00E0:"Lost Woods Bridge",00E4:"Lon Lon Ranch Chicken Room",00E8:"In Front of Deku Tree",00EB:"Spirit Temple Boss",00F1:"Castle Courtyard,In Front of Zelda",00F4:"Temple of Time",00F8:"Gerudo Fortress Jail" + cn Warp Song Location\Bolero of Fire + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 80119765 ???? 0003:"Castle Courtyard",000B:"Dodongo's Cavern Boss",0010:"Inside The Deku Tree Boss",0014:"Shadow Temple Boss",0017:"Water Temple Boss",001C:"Ganon's Castle Tower",001F:"Ganon First Battle",0028:"Ganon's Castle Room Before Ganon",002B:"Inside Ganon's Castle Room With Pillar",002F:"Lon Lon Ranch",0033:"Mido's House",0037:"Saria's House",004B:"Bearded Man's House",0040:"Top of Ganon's Castle",0047:"Outside Saria's House",004F:"Dampe's Race",0057:"Kokiri Forest",005B:"Top of Death Mountain",005F:"Fishing Pond",0068:"Inside Ganon's Castle",007F:"Hyrule Castle Gate",00BA:"Top of Ganon's Tower",00C2:"Great Fairy Fountain",00D6:"Lost Woods Goron Entrance",00DA:"Lost Woods River Entrance",00DE:"Lost Woods Bridge Field Entrance",00E3:"Goron City Lost Woods Entrance",00F6:"Death Mountain Crater",00FD:"Ganon's Castle" + cn Warp Song Location\Requiem of Spirit + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 80119765 ???? 0005:"Lake Hylia,08 Zora's Domain",0018:"Gerudo Valley",001E:"Lost Woods",0028:"Gerudo Fortress",0030:"Haunted Wasteland",0034:"Ganon's Castle Inside Burning Castle",0038:"Hyrule Castle",003A:"Ganon's Castle",003D:"Death Mountain Trail",004D:"Goron City",0065:"Fire Temple",0069:"Forest Temple",006E:"Shooting Gallery",0079:"Ganon's Castle Inside Burning Castle",007E:"Kakariko Village Entrance",007B:"Zora's River Entrance",0085:"Kokiri Forest Entrance",008A:"Lake Hyrule Entrance",008E:"Gerudo Valley Entrance",0092:"Death Mountain Trail Entrance",0095:"Graveyard Entrance",009E:"Zora's Domain Entrance",00A2:"Zora's Fountain Entrance",00BA:"Goron City Entrance",00BE:"Death Mountain Trail",00C1:"Goron City",00C5:"Lakeside Laboratory",00C9:"Top of Ganon's Castle",00CD:"Hyrule Market (Child Link's)",00CF:"Hyrule Market (Adult Link's)",00F1:"Desert Colossus",00FA:"Lon Lon Ranch Entrance",00FD:"Hyrule Field" + cn Max\Double Defense Power + cd This gives you White Border Hearts + 8011849F 0014 + cn Nayru's Love is Always + cd For this to work On Or off, you have to walk through a Doorway to activate the Change. + 801D851B ???? 0000:"OFF",FFFF:"ON" + cn Infinite\Timers\All Other Timers + cd This cheat works on all Race Timers not the final Boss and Under Water with iron Boots etc. + 801197A1 0032 + cn Epona\Max Carrots\Lon Lon Raunch + cd This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona + 801F12C8 0005 + 801EDD08 0005 + cn Infinite\Timers\Escape From Gannons Tower + cd This cheat works only on The Final Boss. + 801197A5 00B4 + cn Beta\Specific things lean + cd This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest World 01) + 80023414 0001 + cn Beta\Appear in Strange Places (Hold R) + cd If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. + D01C64F5 0010 + 81119736 0001 + cn Beta\Interface always off/on + cd If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset. + 801192B9 00FF + 8011972F ???? 0000:"Off",0001:"Off" + cn Always Have Wallet Size + 80118472 ???? 0047:"Kid Wallet (Holds 99)",0057:"Adult Wallet (Holds 200)",0067:"Giant Wallet (Holds 500)" + cn Language Select + 801197D9 ???? 0000:"English",0001:"German",0002:"French" + cn Dark Link\Make Dark Link Apear In TOT + 8023D6DF 0020 + 8023D6E5 0033 + +crc B2055FBD-0BAB4E0C-C:50 +gn Legend of Zelda, The - Ocarina of Time (E) (V1.1) + cn Infinite\Rupees + cd This cheat allows you to have the max Rupees to the Wallet you currently Hold + 811197DC 0001 + cn Press R\For Old Or Young Link + cd To Activate this Cheat Hold The R Button when walking through a Doorway this will change you to the option on the other side, Disable this Cheat straight away after getting to the other side, in some places you might even get Access Violations. Just press ok untill you can carry on. + D01C6535 0010 + 80118417 ???? 0001:"Link Young",0000:"Link Old" + cn Use Any Item In Any House + cd do not use under or in water + 81119632 0000 + 81119634 0000 + cn Have\All Equipment + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 811184AC 7777 + cn Have\All Quest/Status Items + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 811184B4 30FF + 811184B6 FFFF + cn Max\Heart Containers + 8111843E 0140 + cn Max\Gold Skulltulas Killed + 801184E1 0064 + cn Time of Day Modifier + 8111841C ???? 4000:"At Sunrise",5800:"Daylight Out",7000:"Very Bright Out",C000:"At Sunset",D000:"Fairly Dark" + cn Infinite\Energy + 81118440 0140 + cn Infinite\Magic + D0118449 0008 + 8011844A 0001 + 8011844C 0001 + 80118443 0060 + cn Tunic & Boot Options + cd This changes what you are wearing,once you have enabled the code press Start & then start again. + 80118480 ???? 0011:"Kokiri Tunic & Kokiri Boots",0012:"Goron Tunic & Kokiri Boots",0013:"Zora Tunic & Kokiri Boots",0014:"Black Tunic & Kokiri Boots",0015:"White Tunic & Kokiri Boots",0016:"Yellow Tunic & Kokiri Boots",0021:"Kokiri Tunic & Iron Boots",0022:"Goron Tunic & Iron Boots",0023:"Zora Tunic & Iron Boots",0024:"Black Tunic & Iron Boots",0025:"White Tunic & Iron Boots",0026:"Yellow Tunic & Iron Boots",0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Infinite\Deku Sticks + 8011849C 0009 + cn Infinite\Deku Nuts + 8011849D 0009 + cn Infinite\Bombs + 8011849E 0009 + cn Infinite\Arrows + 8011849F 0009 + cn Infinite\Deku Seeds + 801184A2 0009 + cn Infinite\Bombchu's + 801184A4 0009 + cn Infinite\Magic Beans + 801184AA 0009 + cn Infinite\Big Key,Small Keys,Compass,& Map + 50000B01 0000 + 801184B8 0007 + 50000501 0000 + 801184CF 0009 + 801184D7 0009 + 801184D9 0009 + 801184DC 0009 + cn Have\Ocarina + 8011848B ???? 0007:"Fairy Ocarina",0008:"Ocarina Of Time" + cn Have\Boomerang + 80118490 000E + cn Have\Lens of Truth + 80118491 000F + cn Have\Megaton Hammer + 80118493 0011 + cn Have\Deku Stick + 80118484 0000 + cn Have\Deku Nut + 80118485 0001 + cn Have\Bombs + 80118486 0002 + cn Have\Fairy Bow + 80118487 0003 + cn Have\Fairy Slingshot + 8011848A 0006 + cn Have\Bombchu + 8011848C 0009 + cn Have\Arrows\Fire Arrow + 80118488 0004 + cn Have\Arrows\Ice Arrow + 8011848E 000C + cn Have\Arrows\Light Arrow + 80118494 0012 + cn Have\Hookshot + 8011848D ???? 000A:"Hookshot",000B:"Longshot" + cn Have\Magic Beans + 80118492 0010 + cn Have\Magic\Fairie's Wind + 8011848F 000D + cn Have\Magic\Nayru's Love + 80118495 0013 + cn Have\Magic\Din's Fire + 80118489 0005 + cn Bottles\Bottle 1 Modifier + 80118496 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 2 Modifier + 80118497 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 3 Modifier + 80118498 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 4 Modifier + 80118499 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Trading\Adult Link Item + 8011849A ???? 002D:"Pocket Egg",002E:"Pocket Cucco",002F:"Cojiro",0030:"Odd Mushroom",0031:"Odd Potion",0032:"Poacher's Saw",0033:"Goron's Sword (Broken)",0034:"Prescription",0035:"Eyeball Frog",0036:"Eye Drops",0037:"Claim Check" + cn Trading\Young Link Item + 8011849B ???? 0021:"Weird Egg",0022:"Chicken",0023:"Zelda's Letter",0024:"Keaton Mask",0025:"Skull Mask",0026:"Spooky Mask",0027:"Bunny Hood",0028:"Goron Mask",0029:"Zora Mask",002A:"Gerudo Mask",002B:"Mask of Truth",002C:"SOLD OUT" + cn Turn Giant's Knife Into Biggoron's Sword + 8011844E 0001 + cn Have Quiver (Holds 30) + 801184B1 0001 + cn Equipment Modifier 1 + cd This modifies the equipment you are carrying. + 801184B2 ???? 0002:"Silver Scale",0004:"Golden Scale",0006:"Giant's Knife (Broken)",0035:"Black Gauntlets",0040:"Bullet Bag (Holds 30)",0080:"Bullet Bag (Holds 40)",00C0:"Bullet Bag (Holds 50)" + cn Equipment Modifier 2 + cd This modifies the equipment you are carrying. + 801184B3 ???? 0008:"Bomb Bag (Holds 20)",0010:"Bomb Bag (Holds 30)",0018:"Bomb Bag (Holds 40)",0020:"Goron's Bracelet",0028:"Silver Gauntlets",0030:"Golden Gauntlets" + cn Press L To Levitate + cd Press L To Levitate & Let go to land + D01C6535 0020 + 811D8B20 40CB + cn Press L For infinite Hover Boots + cd Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on + D01C6535 0020 + 811D9332 000D + cn Instant Step Hoover Boots + cd Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. + D01C6535 0020 + 811D8B20 40CB + D01C6535 0000 + 811D9332 000D + 80118480 ???? 0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Beta\Play Beta Quest Worlds + cd Put on the code on load up,After the Nintendo logo you will be in Hyrule Field,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. + D01C6535 0000 + 80119823 ???? 0000:"World 01",0001:"World 02",0002:"World 03",0003:"World 04",0004:"World 05",0007:"World 06",0008:"World 07",0016:"World 08" + cn Warp Song Location\Minuet of Forest & Serenade of Water + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 801197A5 ???? 0000:"Sacred Forest Meadow",0004:"Lake Hylia",0015:"Inside Jabu Jabu's Belly",0018:"Dodongo's Cavern",0068:"Inside The Deku Tree" + cn Warp Song Location\Prelude of Light & Nocturne of Shadow + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 801197A5 ???? 0003:"Kakariko Windmill",0007:"Bombchu Bowling Alley",000F:"Zelda & Impa Flee",0014:"Kakariko Village",0017:"Ganon,Final Battle",001D:"Top of Ganon's Tower",0028:"Bombchu Shop",002C:"Bazaar",0030:"Happy Mask Shop",0034:"Ganon's Tower",0038:"Ganon's Castle",004C:"Inside Spirit Door",006C:"Burning Castle",0050:"House of Skulltula",0064:"Death Mountain Trail",0068:"Graveyard",0070:"Thieves' Hideout",0074:"Royal Family's Tomb",0078:"Great Fairy Fountain 1",0084:"Forest Temple,Room With Falling Floor",0088:"Great Fairy Fountain 2",0099:"Grotto 01",009D:"Grotto 02",00A4:"Grotto 04",00A8:"Grotto 05",00B3:"Grotto 06",00B0:"Grotto 07",00B4:"Grotto 08",00B8:"Grotto 09",00C3:"Grotto 10",00C0:"Grotto 11",00C4:"Grotto 12",00FC:"Grotto 13",00D3:"Bottom of the Well",00D0:"Lon Lon Ranch Shed",00D3:"Lon Lon Ranch Outside Shed",00D8:"Ice Cavern",00E3:"Outside Cow Pen",00E0:"Lost Woods Bridge",00E4:"Lon Lon Ranch Chicken Room",00E8:"In Front of Deku Tree",00EB:"Spirit Temple Boss",00F1:"Castle Courtyard,In Front of Zelda",00F4:"Temple of Time",00F8:"Gerudo Fortress Jail" + cn Warp Song Location\Bolero of Fire + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 801197A5 ???? 0003:"Castle Courtyard",000B:"Dodongo's Cavern Boss",0010:"Inside The Deku Tree Boss",0014:"Shadow Temple Boss",0017:"Water Temple Boss",001C:"Ganon's Castle Tower",001F:"Ganon First Battle",0028:"Ganon's Castle Room Before Ganon",002B:"Inside Ganon's Castle Room With Pillar",002F:"Lon Lon Ranch",0033:"Mido's House",0037:"Saria's House",004B:"Bearded Man's House",0040:"Top of Ganon's Castle",0047:"Outside Saria's House",004F:"Dampe's Race",0057:"Kokiri Forest",005B:"Top of Death Mountain",005F:"Fishing Pond",0068:"Inside Ganon's Castle",007F:"Hyrule Castle Gate",00BA:"Top of Ganon's Tower",00C2:"Great Fairy Fountain",00D6:"Lost Woods Goron Entrance",00DA:"Lost Woods River Entrance",00DE:"Lost Woods Bridge Field Entrance",00E3:"Goron City Lost Woods Entrance",00F6:"Death Mountain Crater",00FD:"Ganon's Castle" + cn Warp Song Location\Requiem of Spirit + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 801197A5 ???? 0005:"Lake Hylia,08 Zora's Domain",0018:"Gerudo Valley",001E:"Lost Woods",0028:"Gerudo Fortress",0030:"Haunted Wasteland",0034:"Ganon's Castle Inside Burning Castle",0038:"Hyrule Castle",003A:"Ganon's Castle",003D:"Death Mountain Trail",004D:"Goron City",0065:"Fire Temple",0069:"Forest Temple",006E:"Shooting Gallery",0079:"Ganon's Castle Inside Burning Castle",007E:"Kakariko Village Entrance",007B:"Zora's River Entrance",0085:"Kokiri Forest Entrance",008A:"Lake Hyrule Entrance",008E:"Gerudo Valley Entrance",0092:"Death Mountain Trail Entrance",0095:"Graveyard Entrance",009E:"Zora's Domain Entrance",00A2:"Zora's Fountain Entrance",00BA:"Goron City Entrance",00BE:"Death Mountain Trail",00C1:"Goron City",00C5:"Lakeside Laboratory",00C9:"Top of Ganon's Castle",00CD:"Hyrule Market (Child Link's)",00CF:"Hyrule Market (Adult Link's)",00F1:"Desert Colossus",00FA:"Lon Lon Ranch Entrance",00FD:"Hyrule Field" + cn Max\Double Defense Power + cd This gives you White Border Hearts + 801184DF 0014 + cn Nayru's Love is Always + cd For this to work On Or off, you have to walk through a Doorway to activate the Change. + 811197D8 ???? 0000:"OFF",FFFF:"ON" + cn Infinite\Timers\All Other Timers + cd This cheat works on all Race Timers not the final Boss and Under Water with iron Boots etc. + 801197E1 0032 + cn Epona\Max Carrots\Lon Lon Raunch + cd This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona + 801F1308 0005 + 801EDD48 0005 + cn Infinite\Timers\Escape From Gannons Tower + cd This cheat works only on The Final Boss. + 801197E5 00B4 + cn Beta\Specific things lean + cd This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest World 01) + 80023454 0001 + cn Beta\Appear in Strange Places (Hold R) + cd If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. + D01C6535 0010 + 81119776 0001 + cn Beta\Interface always off/on + cd If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset. + 801192F9 00FF + 8011976F ???? 0000:"Off",0001:"Off" + cn Always Have Wallet Size + 801184B2 ???? 0047:"Kid Wallet (Holds 99)",0057:"Adult Wallet (Holds 200)",0067:"Giant Wallet (Holds 500)" + cn Language Select + 80119819 ???? 0000:"English",0001:"German",0002:"French" + cn Dark Link\Make Dark Link Apear In TOT + 8023D71F 0020 + 8023D725 0033 + +crc 09465AC3-F8CB501B-C:50 +gn Legend of Zelda, The - Ocarina of Time (E) (GC Version) + cn Infinite\Rupees + cd This cheat allows you to have the max Rupees to the Wallet you currently Hold + 81119D24 0001 + cn Press R\For Old Or Young Link + cd To Activate this Cheat Hold The R Button when walking through a Doorway this will change you to the option on the other side, Disable this Cheat straight away after getting to the other side, in some places you might even get Access Violations. Just press ok untill you can carry on. + D01C6A7D 0010 + 8011895F ???? 0001:"Link Young",0000:"Link Old" + cn Use Any Item In Any House + cd do not use under or in water + 81119B7A 0000 + 81119B7C 0000 + cn Have\All Equipment + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 811189F4 7777 + cn Have\All Quest/Status Items + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 811189FC 30FF + 811189FE FFFF + cn Max\Heart Containers + 81118986 0140 + cn Max\Gold Skulltulas Killed + 80118A29 0064 + cn Time of Day Modifier + 81118964 ???? 4000:"At Sunrise",5800:"Daylight Out",7000:"Very Bright Out",C000:"At Sunset",D000:"Fairly Dark" + cn Infinite\Energy + 81118988 0140 + cn Infinite\Magic + D0118991 0008 + 80118992 0001 + 80118994 0001 + 8011898B 0060 + cn Tunic & Boot Options + cd This changes what you are wearing,once you have enabled the code press Start & then start again. + 801189C8 ???? 0011:"Kokiri Tunic & Kokiri Boots",0012:"Goron Tunic & Kokiri Boots",0013:"Zora Tunic & Kokiri Boots",0014:"Black Tunic & Kokiri Boots",0015:"White Tunic & Kokiri Boots",0016:"Yellow Tunic & Kokiri Boots",0021:"Kokiri Tunic & Iron Boots",0022:"Goron Tunic & Iron Boots",0023:"Zora Tunic & Iron Boots",0024:"Black Tunic & Iron Boots",0025:"White Tunic & Iron Boots",0026:"Yellow Tunic & Iron Boots",0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Infinite\Deku Sticks + 801189E4 0009 + cn Infinite\Deku Nuts + 801189E5 0009 + cn Infinite\Bombs + 801189E6 0009 + cn Infinite\Arrows + 801189E7 0009 + cn Infinite\Deku Seeds + 801189EA 0009 + cn Infinite\Bombchu's + 801189EC 0009 + cn Infinite\Magic Beans + 801189F2 0009 + cn Infinite\Big Key,Small Keys,Compass,& Map + 50000B01 0000 + 80118A00 0007 + 50000501 0000 + 80118A17 0009 + 80118A1F 0009 + 80118A21 0009 + 80118A24 0009 + cn Have\Ocarina + 801189D3 ???? 0007:"Fairy Ocarina",0008:"Ocarina Of Time" + cn Have\Boomerang + 801189D8 000E + cn Have\Lens of Truth + 801189D9 000F + cn Have\Megaton Hammer + 801189DB 0011 + cn Have\Deku Stick + 801189CC 0000 + cn Have\Deku Nut + 801189CD 0001 + cn Have\Bombs + 801189CE 0002 + cn Have\Fairy Bow + 801189CF 0003 + cn Have\Fairy Slingshot + 801189D2 0006 + cn Have\Bombchu + 801189D4 0009 + cn Have\Arrows\Fire Arrow + 801189D0 0004 + cn Have\Arrows\Ice Arrow + 801189D6 000C + cn Have\Arrows\Light Arrow + 801189DC 0012 + cn Have\Hookshot + 801189D5 ???? 000A:"Hookshot",000B:"Longshot" + cn Have\Magic Beans + 801189DA 0010 + cn Have\Magic\Fairie's Wind + 801189D7 000D + cn Have\Magic\Nayru's Love + 801189DD 0013 + cn Have\Magic\Din's Fire + 801189D1 0005 + cn Bottles\Bottle 1 Modifier + 801189DE ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 2 Modifier + 801189DF ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 3 Modifier + 801189E0 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 4 Modifier + 801189E1 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Trading\Adult Link Item + 801189E2 ???? 002D:"Pocket Egg",002E:"Pocket Cucco",002F:"Cojiro",0030:"Odd Mushroom",0031:"Odd Potion",0032:"Poacher's Saw",0033:"Goron's Sword (Broken)",0034:"Prescription",0035:"Eyeball Frog",0036:"Eye Drops",0037:"Claim Check" + cn Trading\Young Link Item + 801189E3 ???? 0021:"Weird Egg",0022:"Chicken",0023:"Zelda's Letter",0024:"Keaton Mask",0025:"Skull Mask",0026:"Spooky Mask",0027:"Bunny Hood",0028:"Goron Mask",0029:"Zora Mask",002A:"Gerudo Mask",002B:"Mask of Truth",002C:"SOLD OUT" + cn Turn Giant's Knife Into Biggoron's Sword + 80118996 0001 + cn Have Quiver (Holds 30) + 801189F9 0001 + cn Equipment Modifier 1 + cd This modifies the equipment you are carrying. + 801189FA ???? 0002:"Silver Scale",0004:"Golden Scale",0006:"Giant's Knife (Broken)",0035:"Black Gauntlets",0040:"Bullet Bag (Holds 30)",0080:"Bullet Bag (Holds 40)",00C0:"Bullet Bag (Holds 50)" + cn Equipment Modifier 2 + cd This modifies the equipment you are carrying. + 801189FB ???? 0008:"Bomb Bag (Holds 20)",0010:"Bomb Bag (Holds 30)",0018:"Bomb Bag (Holds 40)",0020:"Goron's Bracelet",0028:"Silver Gauntlets",0030:"Golden Gauntlets" + cn Press L To Levitate + cd Press L To Levitate & Let go to land + D011BB37 0020 + 811D9410 40CB + cn Press L For infinite Hover Boots + cd Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on + D011BB37 0020 + 811D9C32 000D + cn Instant Step Hoover Boots + cd Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. + D011BB37 0020 + 811D9410 40CB + D011BB37 0000 + 811D9C32 000D + 801189C8 ???? 0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Beta\Play Beta Quest Worlds + cd Put on the code on load up,After the Nintendo logo you will be in Hyrule Field,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. + D01C6A7D 0000 + 80119D6B ???? 0000:"World 01",0001:"World 02",0002:"World 03",0003:"World 04",0004:"World 05",0007:"World 06",0008:"World 07",0016:"World 08" + cn Warp Song Location\Minuet of Forest & Serenade of Water + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 801197A5 ???? 0000:"Sacred Forest Meadow",0004:"Lake Hylia",0015:"Inside Jabu Jabu's Belly",0018:"Dodongo's Cavern",0068:"Inside The Deku Tree" + cn Warp Song Location\Prelude of Light & Nocturne of Shadow + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 801197A5 ???? 0003:"Kakariko Windmill",0007:"Bombchu Bowling Alley",000F:"Zelda & Impa Flee",0014:"Kakariko Village",0017:"Ganon,Final Battle",001D:"Top of Ganon's Tower",0028:"Bombchu Shop",002C:"Bazaar",0030:"Happy Mask Shop",0034:"Ganon's Tower",0038:"Ganon's Castle",004C:"Inside Spirit Door",006C:"Burning Castle",0050:"House of Skulltula",0064:"Death Mountain Trail",0068:"Graveyard",0070:"Thieves' Hideout",0074:"Royal Family's Tomb",0078:"Great Fairy Fountain 1",0084:"Forest Temple,Room With Falling Floor",0088:"Great Fairy Fountain 2",0099:"Grotto 01",009D:"Grotto 02",00A4:"Grotto 04",00A8:"Grotto 05",00B3:"Grotto 06",00B0:"Grotto 07",00B4:"Grotto 08",00B8:"Grotto 09",00C3:"Grotto 10",00C0:"Grotto 11",00C4:"Grotto 12",00FC:"Grotto 13",00D3:"Bottom of the Well",00D0:"Lon Lon Ranch Shed",00D3:"Lon Lon Ranch Outside Shed",00D8:"Ice Cavern",00E3:"Outside Cow Pen",00E0:"Lost Woods Bridge",00E4:"Lon Lon Ranch Chicken Room",00E8:"In Front of Deku Tree",00EB:"Spirit Temple Boss",00F1:"Castle Courtyard,In Front of Zelda",00F4:"Temple of Time",00F8:"Gerudo Fortress Jail" + cn Warp Song Location\Bolero of Fire + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 801197A5 ???? 0003:"Castle Courtyard",000B:"Dodongo's Cavern Boss",0010:"Inside The Deku Tree Boss",0014:"Shadow Temple Boss",0017:"Water Temple Boss",001C:"Ganon's Castle Tower",001F:"Ganon First Battle",0028:"Ganon's Castle Room Before Ganon",002B:"Inside Ganon's Castle Room With Pillar",002F:"Lon Lon Ranch",0033:"Mido's House",0037:"Saria's House",004B:"Bearded Man's House",0040:"Top of Ganon's Castle",0047:"Outside Saria's House",004F:"Dampe's Race",0057:"Kokiri Forest",005B:"Top of Death Mountain",005F:"Fishing Pond",0068:"Inside Ganon's Castle",007F:"Hyrule Castle Gate",00BA:"Top of Ganon's Tower",00C2:"Great Fairy Fountain",00D6:"Lost Woods Goron Entrance",00DA:"Lost Woods River Entrance",00DE:"Lost Woods Bridge Field Entrance",00E3:"Goron City Lost Woods Entrance",00F6:"Death Mountain Crater",00FD:"Ganon's Castle" + cn Warp Song Location\Requiem of Spirit + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 801197A5 ???? 0005:"Lake Hylia,08 Zora's Domain",0018:"Gerudo Valley",001E:"Lost Woods",0028:"Gerudo Fortress",0030:"Haunted Wasteland",0034:"Ganon's Castle Inside Burning Castle",0038:"Hyrule Castle",003A:"Ganon's Castle",003D:"Death Mountain Trail",004D:"Goron City",0065:"Fire Temple",0069:"Forest Temple",006E:"Shooting Gallery",0079:"Ganon's Castle Inside Burning Castle",007E:"Kakariko Village Entrance",007B:"Zora's River Entrance",0085:"Kokiri Forest Entrance",008A:"Lake Hyrule Entrance",008E:"Gerudo Valley Entrance",0092:"Death Mountain Trail Entrance",0095:"Graveyard Entrance",009E:"Zora's Domain Entrance",00A2:"Zora's Fountain Entrance",00BA:"Goron City Entrance",00BE:"Death Mountain Trail",00C1:"Goron City",00C5:"Lakeside Laboratory",00C9:"Top of Ganon's Castle",00CD:"Hyrule Market (Child Link's)",00CF:"Hyrule Market (Adult Link's)",00F1:"Desert Colossus",00FA:"Lon Lon Ranch Entrance",00FD:"Hyrule Field" + cn Max\Double Defense Power + cd This gives you White Border Hearts + 80118A27 0014 + cn Nayru's Love is Always + cd For this to work On Or off, you have to walk through a Doorway to activate the Change. + 81119D20 ???? 0000:"OFF",FFFF:"ON" + cn Infinite\Timers\All Other Timers + cd This cheat works on all Race Timers not the final Boss and Under Water with iron Boots etc. + 80119D29 0032 + cn Epona\Max Carrots\Lon Lon Raunch + cd This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona + 801F1850 0005 + 801EE290 0005 + cn Infinite\Timers\Escape From Gannons Tower + cd This cheat works only on The Final Boss. + 80119D2D 00B4 + cn Beta\Specific things lean + cd This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest World 01) + 8002399C 0001 + cn Beta\Appear in Strange Places (Hold R) + cd If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. + D01C6A7D 0010 + 81119CBE 0001 + cn Beta\Interface always off/on + cd If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset. + 80119841 00FF + 80119CB7 ???? 0000:"Off",0001:"Off" + cn Always Have Wallet Size + 801189FA ???? 0047:"Kid Wallet (Holds 99)",0057:"Adult Wallet (Holds 200)",0067:"Giant Wallet (Holds 500)" + cn Language Select + 80119D61 ???? 0000:"English",0001:"German",0002:"French" + +crc 1D4136F3-AF63EEA9-C:50 +gn Legend of Zelda, The - Ocarina of Time - Master Quest (E) + cn Infinite\Rupees + cd This cheat allows you to have the max Rupees to the Wallet you currently Hold + 81119D04 0001 + cn Max\Double Defense Power + cd This gives you White Border Hearts + 80118A07 0014 + cn Use Any Item In Any House + cd do not use under or in water + 81119B5A 0000 + 81119B5C 0000 + cn Have\All Equipment + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 811189D4 7777 + cn Have\All Quest/Status Items + cd This cheat causes the Goron Temple door not to open, but if you go to the very top of the mountain where the fairy is, next to her entrance is another one in to the fire temple.once inside put on the hover boots & infinite hover cheat to hover over to the ledge on the left hand side.From here you can carry on the game as normal + 801189DD ???? + 801189DE ???? + 801189DF ???? 00FF:"On",0000:"Off" + cn Max\Heart Containers + 81118966 0140 + cn Max\Gold Skulltulas Killed + 80118A09 0064 + cn Time of Day Modifier + 81118944 ???? 4000:"At Sunrise",5800:"Daylight Out",7000:"Very Bright Out",C000:"At Sunset",D000:"Fairly Dark" + cn Infinite\Energy + 81118968 0140 + cn Infinite\Magic + D0118971 0008 + 80118972 0001 + 80118974 0001 + 8011896B 0060 + cn Tunic & Boot Options + cd This changes what you are wearing,once you have enabled the code press Start & then start again. + 801189A8 ???? 0011:"Kokiri Tunic & Kokiri Boots",0012:"Goron Tunic & Kokiri Boots",0013:"Zora Tunic & Kokiri Boots",0014:"Black Tunic & Kokiri Boots",0015:"White Tunic & Kokiri Boots",0016:"Yellow Tunic & Kokiri Boots",0021:"Kokiri Tunic & Iron Boots",0022:"Goron Tunic & Iron Boots",0023:"Zora Tunic & Iron Boots",0024:"Black Tunic & Iron Boots",0025:"White Tunic & Iron Boots",0026:"Yellow Tunic & Iron Boots",0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Infinite\Deku Sticks + 801189C4 0009 + cn Infinite\Deku Nuts + 801189C5 0009 + cn Infinite\Bombs + 801189C6 0009 + cn Infinite\Arrows + 801189C7 0009 + cn Infinite\Deku Seeds + 801189CA 0009 + cn Infinite\Bombchu's + 801189CC 0009 + cn Infinite\Magic Beans + 801189D2 0009 + cn Infinite\Big Key,Small Keys,Compass,& Map + 801189E0 0007 + 801189E1 0007 + 801189E2 0007 + 801189E3 0007 + 801189E4 0007 + 801189E5 0007 + 801189E6 0007 + 801189E7 0007 + 801189E8 0007 + 801189E9 0007 + 801189EA 0007 + 801189F7 0009 + 801189F8 0009 + 801189F9 0009 + 801189FA 0009 + 801189FB 0009 + 80118A01 0009 + 80118A04 0009 + 801189FF 0009 + cn Have\Ocarina + 801189B3 ???? 0007:"Fairy Ocarina",0008:"Ocarina Of Time" + cn Have\Boomerang + 801189B8 000E + cn Have\Lens of Truth + 801189B9 000F + cn Have\Megaton Hammer + 801189BB 0011 + cn Have\Deku Stick + 801189AC 0000 + cn Have\Deku Nut + 801189AD 0001 + cn Have\Bombs + 801189AE 0002 + cn Have\Fairy Bow + 801189AF 0003 + cn Have\Fairy Slingshot + 801189B2 0006 + cn Have\Bombchu + 801189B4 0009 + cn Have\Arrows\Fire Arrow + 801189B0 0004 + cn Have\Arrows\Ice Arrow + 801189B6 000C + cn Have\Arrows\Light Arrow + 801189BC 0012 + cn Have\Hookshot + 801189B5 ???? 000A:"Hookshot",000B:"Longshot" + cn Have\Magic Beans + 801189BA 0010 + cn Have\Magic\Fairie's Wind + 801189B7 000D + cn Have\Magic\Nayru's Love + 801189BD 0013 + cn Have\Magic\Din's Fire + 801189B1 0005 + cn Bottles\Bottle 1 Modifier + 801189BE ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 2 Modifier + 801189BF ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 3 Modifier + 801189C0 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Bottles\Bottle 4 Modifier + 801189C1 ???? 0014:"Empty Bottle",0015:"Red Potion",0016:"Green Potion",0017:"Blue Potion",0018:"Bottled Fairy",0019:"Fish",001A:"Lon Lon Milk",001B:"Letter",001C:"Blue Fire",001D:"Bug",001E:"Big Poe",001F:"Lon Lon Milk (Half)",0020:"Poe" + cn Trading\Adult Link Item + 801189C2 ???? 002D:"Pocket Egg",002E:"Pocket Cucco",002F:"Cojiro",0030:"Odd Mushroom",0031:"Odd Potion",0032:"Poacher's Saw",0033:"Goron's Sword (Broken)",0034:"Prescription",0035:"Eyeball Frog",0036:"Eye Drops",0037:"Claim Check" + cn Trading\Young Link Item + 801189C3 ???? 0021:"Weird Egg",0022:"Chicken",0023:"Zelda's Letter",0024:"Keaton Mask",0025:"Skull Mask",0026:"Spooky Mask",0027:"Bunny Hood",0028:"Goron Mask",0029:"Zora Mask",002A:"Gerudo Mask",002B:"Mask of Truth",002C:"SOLD OUT" + cn Turn Giant's Knife Into Biggoron's Sword + 80118976 0001 + cn Have Quiver (Holds 30) + 801189D9 0001 + cn Equipment Modifier 1 + cd This modifies the equipment you are carrying. + 801189DA ???? 0002:"Silver Scale",0004:"Golden Scale",0006:"Giant's Knife (Broken)",0035:"Black Gauntlets",0040:"Bullet Bag (Holds 30)",0080:"Bullet Bag (Holds 40)",00C0:"Bullet Bag (Holds 50)" + cn Equipment Modifier 2 + cd This modifies the equipment you are carrying. + 801189DB ???? 0008:"Bomb Bag (Holds 20)",0010:"Bomb Bag (Holds 30)",0018:"Bomb Bag (Holds 40)",0020:"Goron's Bracelet",0028:"Silver Gauntlets",0030:"Golden Gauntlets" + cn Warp Song Location\Minuet of Forest & Serenade of Water + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 80119CCD ???? 0000:"Sacred Forest Meadow",0004:"Lake Hylia",0015:"Inside Jabu Jabu's Belly",0018:"Dodongo's Cavern",0068:"Inside The Deku Tree" + cn Warp Song Location\Prelude of Light & Nocturne of Shadow + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 80119CCD ???? 0003:"Kakariko Windmill",0007:"Bombchu Bowling Alley",000F:"Zelda & Impa Flee",0014:"Kakariko Village",0017:"Ganon,Final Battle",001D:"Top of Ganon's Tower",0028:"Bombchu Shop",002C:"Bazaar",0030:"Happy Mask Shop",0034:"Ganon's Tower",0038:"Ganon's Castle",004C:"Inside Spirit Door",006C:"Burning Castle",0050:"House of Skulltula",0064:"Death Mountain Trail",0068:"Graveyard",0070:"Thieves' Hideout",0074:"Royal Family's Tomb",0078:"Great Fairy Fountain 1",0084:"Forest Temple,Room With Falling Floor",0088:"Great Fairy Fountain 2",0099:"Grotto 01",009D:"Grotto 02",00A4:"Grotto 04",00A8:"Grotto 05",00B3:"Grotto 06",00B0:"Grotto 07",00B4:"Grotto 08",00B8:"Grotto 09",00C3:"Grotto 10",00C0:"Grotto 11",00C4:"Grotto 12",00FC:"Grotto 13",00D3:"Bottom of the Well",00D0:"Lon Lon Ranch Shed",00D3:"Lon Lon Ranch Outside Shed",00D8:"Ice Cavern",00E3:"Outside Cow Pen",00E0:"Lost Woods Bridge",00E4:"Lon Lon Ranch Chicken Room",00E8:"In Front of Deku Tree",00EB:"Spirit Temple Boss",00F1:"Castle Courtyard,In Front of Zelda",00F4:"Temple of Time",00F8:"Gerudo Fortress Jail" + cn Warp Song Location\Bolero of Fire + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 80119CCD ???? 0003:"Castle Courtyard",000B:"Dodongo's Cavern Boss",0010:"Inside The Deku Tree Boss",0014:"Shadow Temple Boss",0017:"Water Temple Boss",001C:"Ganon's Castle Tower",001F:"Ganon First Battle",0028:"Ganon's Castle Room Before Ganon",002B:"Inside Ganon's Castle Room With Pillar",002F:"Lon Lon Ranch",0033:"Mido's House",0037:"Saria's House",004B:"Bearded Man's House",0040:"Top of Ganon's Castle",0047:"Outside Saria's House",004F:"Dampe's Race",0057:"Kokiri Forest",005B:"Top of Death Mountain",005F:"Fishing Pond",0068:"Inside Ganon's Castle",007F:"Hyrule Castle Gate",00BA:"Top of Ganon's Tower",00C2:"Great Fairy Fountain",00D6:"Lost Woods Goron Entrance",00DA:"Lost Woods River Entrance",00DE:"Lost Woods Bridge Field Entrance",00E3:"Goron City Lost Woods Entrance",00F6:"Death Mountain Crater",00FD:"Ganon's Castle" + cn Warp Song Location\Requiem of Spirit + cd For this cheat to work,You have to have the Ocarina & Songs. make your choice & Play the song of the cheat name to get where you chose. + 80119CCD ???? 0005:"Lake Hylia",0008:"Zora's Domain",0018:"Gerudo Valley",001E:"Lost Woods",0028:"Gerudo Fortress",0030:"Haunted Wasteland",0034:"Ganon's Castle Inside Burning Castle",0038:"Hyrule Castle",003A:"Ganon's Castle",003D:"Death Mountain Trail",004D:"Goron City",0065:"Fire Temple",0069:"Forest Temple",006E:"Shooting Gallery",0079:"Ganon's Castle Inside Burning Castle",007E:"Kakariko Village Entrance",007B:"Zora's River Entrance",0085:"Kokiri Forest Entrance",008A:"Lake Hyrule Entrance",008E:"Gerudo Valley Entrance",0092:"Death Mountain Trail Entrance",0095:"Graveyard Entrance",009E:"Zora's Domain Entrance",00A2:"Zora's Fountain Entrance",00BA:"Goron City Entrance",00BE:"Death Mountain Trail",00C1:"Goron City",00C5:"Lakeside Laboratory",00C9:"Top of Ganon's Castle",00CD:"Hyrule Market (Child Link's)",00CF:"Hyrule Market (Adult Link's)",00F1:"Desert Colossus",00FA:"Lon Lon Ranch Entrance",00FD:"Hyrule Field" + cn Nayru's Love is Always + cd For this to work On Or off, you have to walk through a Doorway to activate the Change. + 81119D00 ???? 0000:"OFF",FFFF:"ON" + cn Infinite\Timers\All Other Timers + cd This cheat works on all Race Timers not the final Boss and Under Water with iron Boots etc. + 8011B9A1 0032 + cn Epona\Max Carrots\Lon Lon Raunch + cd This is For Practicing,Racing.Warning take this off before jumping the exit fence after winning Epona + 801F1A68 0005 + 801EE508 0005 + cn Infinite\Timers\Escape From Gannons Tower + cd This cheat works only on The Final Boss. + 80119D0D 00B4 + cn Beta\Play Beta Quest Worlds + cd Put on the code on load up,& then press reset (F1) you will be in Beta Mode,There are no icons, energy bar etc. on the screen.When you press a C-Buttton you can use an object.Here the objects for the C-Buttons:C-left: arrows, C-down: bombs, C-right: Ocarina of Time. There is also no Navi and start menu.When you go to some places the game will freeze or you can't move. + D011BB71 0000 + 80119D4B ???? 0000:"World 01",0001:"World 02",0002:"World 03",0003:"World 04",0004:"World 05",0007:"World 06",0008:"World 07",0016:"World 08" + cn Level Select + D01C6E35 0000 + 8111893A ???? 0000:"Inside the Deku Tree",0004:"Dodongo's Cavern",0008:"Gerudo Training Ground",000C:"Below The Phantom Gannon Boss",0010:"Water Temple",0027:"Inside Jabu-Jabu's Belly",002C:"Royal Family's Tomb",0036:"Shoadow Temple",0042:"Lakeside Laboratory",0052:"Temple Of Time",006C:"?" + cn Language Select + 80119D41 ???? 0000:"English",0001:"German",0002:"French" + cn Press L\To Levitate + cd Press L To Levitate & Let go to land + D011BB11 0020 + 811D93D0 40CB + cn Press L\For Infinite Hover Boots + cd Press L For Infinite Hover Boots & Let go to land,This Only works when you have the Boots on + D011BB11 0020 + 811D9BF2 000D + cn Instant Step Hoover Boots + cd Take off from Anywhere & to go higher just press L Once, this will lift you higher while walking.to come back Down Keep R pressed.Once you have enabled the code press Start & then start again. + D011BB11 0020 + 811D93D0 40CB + D011BB11 0000 + 811D9BF2 000D + 801189A8 ???? 0031:"Kokiri Tunic & Hover Boots",0032:"Goron Tunic & Hover Boots",0033:"Zora Tunic & Hover Boots",0034:"Black Tunic & Hover Boots",0035:"White Tunic & Hover Boots",0036:"Yellow Tunic & Hover Boots" + cn Beta\Specific things lean + cd This code will cause all items on a specific plane to lean. This is helpful for areas in which the plane causes the crash (Ex. Weird Zora's Fountain Beta Quest World 01) + 8002397C 0001 + cn Beta\Appear in Strange Places (Hold R) + cd If you go to an area where Link is immobile or invisible, using the "appear in strange places" code will almost always fix it, but you'll start somewhere outside of the Arena and in air. I recommend using the infinite step Hover boots code already supplied with PJ64 so you can float back into the arena in the event that this happens. + D01C681D 0010 + 81119C9E 0001 + cn Beta\Interface always off/on + cd If you go to an area where the interface is accessible, this signigfies that you're not in 'beta' mode anymore. Using the "interface always off/on" code, you can stay in 'beta' mode regardless of what happens. This may cause more crashes in SOME areas, but it's rare and is not too severe. If you need to explore a beta area with the interface, "use the interface always on" portion of the code. Don't use the codes as you start the game. If you need the interface on/off at a specific time, start the game, go to the area, activate the code, keep it on until next reset. + 80119821 00FF + 80119C97 ???? 0000:"Off",0001:"On" + cn Language Select + 80119D41 ???? 0000:"English",0001:"German",0002:"French" + cn Have\Status Heart Containers + 801189DC ???? 0030:"On",0000:"Off" + +crc 60460680-305F0E72-C:50 +gn Lode Runner 3-D (E) + cn Infinite Lives + 81157EAE 0063 + cn Access Secret Worlds + 81152946 0064 + cn Access All Navigation Cards + 80157E9B 0005 + cn Max & Total Gold + 80157E4B 0063 + 80157E4F 0063 + cn Access All In-Game Cheats + cd Pause Gameplay To Access + 81157E46 000F + 81157E56 FFFF + +crc 0AA0055B-7637DF65-C:50 +gn DAFFY DUCK STARRING + cn Infinite\Lives + 80026DE7 0063 + cn Infinite\Health + 80026DE3 0004 + cn Infinite Time\Basketball Gym + 8029F901 0042 + cn Infinite Time\Flight Test Range + 802BA3A9 0042 + cn Infinite Time\Cecil's Flying Toys + 802A5575 0042 + cn Infinite Time\Slippery Slide + 802A7E8D 0042 + cn Tennis CPU Can't Score + 801D7B4B 0000 + cn Infinite\Atoms + 80159667 00C8 + cn Infinite\Quarks + 80159663 00C8 + +crc 1145443D-11610EDB-C:50 +gn Mace - The Dark Age (E) + cn Infinite Health Player 1 + 8008B287 0064 + cn Infinite Health Player 2 + 8008AEFF 0064 + cn Extra Characters + 8007FA98 0001 + cn Ned The Janitor + 8013C281 0001 + cn Infinite\Time + 8113C5BA 0B9E + cn Infinite\Time To Choose Character + D0137ABE 0001 + 81137ABE 02A2 + cn Infinite\Continues + 8015183B 0006 + cn One Hit Death\Player 1 + D008B287 0064 + 8008B287 0001 + cn One Hit Death\Player 2 + D008AEFF 0064 + 8008AEFF 0001 + cn Play As Options\Player 1 + 8113C6E2 ???? 3334:"Executioner",335C:"Lord Deimos",33C4:"Ragnar",33AC:"Koyasha",33D4:"Taria",33FC:"AL-Rashid",3424:"Takeshi",344C:"Mordoskull",3474:"Xiao Lang",449C:"Namira",358C:"Dregan",353C:"Hellnight",34C4:"Big Guy with spikes and a skull staff",3514:"Monk dude with sword",3564:"Pojo The Chicken",35B4:"War Mech" + cn Play As Options\Player 2 + 8113C6DE ???? 3334:"Executioner",335C:"Lord Deimos",33C4:"Ragnar",33AC:"Koyasha",33D4:"Taria",33FC:"AL-Rashid",3424:"Takeshi",344C:"Mordoskull",3474:"Xiao Lang",449C:"Namira",358C:"Dregan",353C:"Hellnight",34C4:"Big Guy with spikes and a skull staff",3514:"Monk dude with sword",3564:"Pojo The Chicken",35B4:"War Mech" + cn Fight With Bunny Slippers On + 81138914 0100 + +crc 62E957D0-7FC15A5D-C:50 +gn MarioGolf64 + cn Unlock all Characters and Birdy Badges + cd Unlocks Metal Mario, Maple, Luigi, Sonny, Wario, Harry, Bowser, Yoshi, Mario and DK + 50006C01 0000 + 801304A4 0001 + 50000901 0000 + 80130518 0001 + 50000901 0000 + 80130521 0001 + cn Wind Speed Select + 800BACA1 ???? 0000:"0 MPH",0014:"20 MPH" + cn Weather Select + 800BACAB ???? 0000:"Never Rains",0001:"Always Rains" + cn All Golf Courses Unlocked + 80130FED 0001 + cn Always On 1st Stroke + 801B74F3 0000 + cn Infinite Power Shots + 801B74F8 0042 + +crc C3B6DE9D-65D2DE76-C:50 +gn Mario Kart 64 (E) (V1.0) + cn Infinite Items + 8016609D ???? 000D:"Double Mushroom",0009:"Fake Item Box",000B:"Ghost",000A:"Invincible Star",0008:"Lightning",0001:"Single Banana",0003:"Single Green Shell",000C:"Single Mushroom",0005:"Single Red Shell",000F:"Super Mushroom",0004:"Triple Green Shell",000E:"Triple Mushroom",0006:"Triple Red Shell",0002:"Banana Bunch",0007:"Blue Spiny Shell" + cn Off-Road Tires\Player 1 + 50000418 0000 + 810F6C74 0140 + cn Off-Road Tires\Player 2 + 50000418 0000 + 810F7A4C 0100 + cn Off-Road Tires\Player 3 + 50000418 0000 + 810F8824 0100 + cn Off-Road Tires\Player 4 + 50000418 0000 + 810F9644 0100 + cn Have Bonus Mode and All Gold Cups + 50000402 0000 + 8018EE50 ???? 0000:"Off",00FF:"On" + cn Press GS\For Full Debug Menu + cd Press GS at the Press Start Menu to access the Debug Menu + 8818EF2F 0002 + cn Press L To Levitate\Player 1 + D00F6A55 0020 + 810F6B08 4000 + cn Press L To Levitate\Player 2 + D00F6A65 0020 + 810F78E0 4000 + cn Press L To Levitate\Player 3 + D00F6A75 0020 + 810F86B8 4000 + cn Press L To Levitate\Player 4 + D00F6A85 0020 + 810F9490 4000 + +crc 2577C7D4-D18FAAAE-C:50 +gn Mario Kart 64 (E) (V1.1) + cn Infinite Items + 80165FBD ???? 000D:"Double Mushroom",0009:"Fake Item Box",000B:"Ghost",000A:"Invincible Star",0008:"Lightning",0001:"Single Banana",0003:"Single Green Shell",000C:"Single Mushroom",0005:"Single Red Shell",000F:"Super Mushroom",0004:"Triple Green Shell",000E:"Triple Mushroom",0006:"Triple Red Shell",0002:"Banana Bunch",0007:"Blue Spiny Shell" + cn Have Bonus Mode and All Gold Cups + 50000402 0000 + 8018ED70 ???? 0000:"Off",00FF:"On" + cn Off-Road Tires\Player 1 + 50000418 0000 + 810F6B94 0140 + cn Off-Road Tires\Player 2 + 50000418 0000 + 810F796C 0100 + cn Off-Road Tires\Player 3 + 50000418 0000 + 810F8744 0100 + cn Off-Road Tires\Player 4 + 50000418 0000 + 810F951C 0100 + cn Press GS\For Full Debug Menu + cd Press GS at the Press Start Menu to access the Debug Menu + 8818EE4F 0002 + cn Press L To Levitate\Player 1 + D00F6975 0020 + 810F6A28 4000 + cn Press L To Levitate\Player 2 + D00F6985 0020 + 810F7800 4000 + cn Press L To Levitate\Player 3 + D00F6995 0020 + 810F85D8 4000 + cn Press L To Levitate\Player 4 + D00F69A5 0020 + 810F93B0 4000 + +crc 9C663069-80F24A80-C:50 +gn Mario Party (E) + cn Top Left Character\Coin Options + cd If you want to have full 255 Coins,1st use the 100 Option then put on 255. this will stop the numbers from changing & spoiling the result. + 800FFAA9 ???? 0000:"0 Coins",000A:"10 Coins",0064:"100 Coins",00FF:"255 Coins" + cn Top Left Character\Star Options + 800FFAAC ???? 0000:"0 Stars",0064:"99 Stars" + cn Top Right Character\Coin Options + 800FFAD9 ???? 0000:"0 Coins",000A:"10 Coins",0064:"100 Coins",00FF:"255 Coins" + cn Top Right Character\Star Options + 800FFADC ???? 0000:"0 Stars",0064:"99 Stars" + cn Lower Left Character\Coin Options + 800FFB09 ???? 0000:"0 Coins",000A:"10 Coins",0064:"100 Coins",00FF:"255 Coins" + cn Lower Left Character\Star Options + 800FFB0C ???? 0000:"0 Stars",0064:"99 Stars" + cn Lower Right Character\Coin Options + 800FFB39 ???? 0000:"0 Coins",000A:"10 Coins",0064:"100 Coins",00FF:"255 Coins" + cn Lower Right Character\Star Options + 800FFB3C ???? 0000:"0 Stars",0064:"99 Stars" + cn Top Left Character\Dice Always + cd With this option you can calculate exactly how many you need to get on the position of your choice. + 800DDC92 ???? 0000:"Rolls In Random",0001:"Rolls In 1",0002:"Rolls In 2",0003:"Rolls In 3",0004:"Rolls In 4",0005:"Rolls In 5",0006:"Rolls In 6",0007:"Rolls In 7",0008:"Rolls In 8",0009:"Rolls In 9",000A:"Rolls In 10" + cn Top Right Character\Dice Always + cd With this option you can calculate exactly how many you need to get on the position of your choice. + 800DDCD6 ???? 0000:"Rolls In Random",0001:"Rolls In 1",0002:"Rolls In 2",0003:"Rolls In 3",0004:"Rolls In 4",0005:"Rolls In 5",0006:"Rolls In 6",0007:"Rolls In 7",0008:"Rolls In 8",0009:"Rolls In 9",000A:"Rolls In 10" + cn Lower Left Character\Dice Always + cd With this option you can calculate exactly how many you need to get on the position of your choice. + 800DDD1A ???? 0000:"Rolls In Random",0001:"Rolls In 1",0002:"Rolls In 2",0003:"Rolls In 3",0004:"Rolls In 4",0005:"Rolls In 5",0006:"Rolls In 6",0007:"Rolls In 7",0008:"Rolls In 8",0009:"Rolls In 9",000A:"Rolls In 10" + cn Lower Right Character\Dice Always + cd With this option you can calculate exactly how many you need to get on the position of your choice. + 800DDD5E ???? 0000:"Rolls In Random",0001:"Rolls In 1",0002:"Rolls In 2",0003:"Rolls In 3",0004:"Rolls In 4",0005:"Rolls In 5",0006:"Rolls In 6",0007:"Rolls In 7",0008:"Rolls In 8",0009:"Rolls In 9",000A:"Rolls In 10" + cn Mini Game\Unlimited 99 lives + 800FFF58 0063 + cn Mini Game\Max 99 Coins + 800FFF61 0063 + +crc C5674160-0F5F453C-C:50 +gn Mario Party 3 (E) + cn Top Left Character\Coin Options + cd If you want to have full 255 Coins,1st use the 100 Option then put on 255. this will stop the numbers from changing & spoiling the result. + 810D0F92 ???? 0000:"0 Coins",000A:"10 Coins",0064:"100 Coins",00FF:"255 Coins" + cn Top Left Character\Star Options + 800D0F96 ???? 0000:"0 Stars",0064:"99 Stars" + cn Top Right Character\Coin Options + 810D0FCA ???? 0000:"0 Coins",000A:"10 Coins",0064:"100 Coins",00FF:"255 Coins" + cn Top Right Character\Star Options + 800D0FCE ???? 0000:"0 Stars",0064:"99 Stars" + cn Lower Left Character\Coin Options + 810D1002 ???? 0000:"0 Coins",000A:"10 Coins",0064:"100 Coins",00FF:"255 Coins" + cn Lower Left Character\Star Options + 800D1006 ???? 0000:"0 Stars",0064:"99 Stars" + cn Lower Right Character\Coin Options + 810D103A ???? 0000:"0 Coins",000A:"10 Coins",0064:"100 Coins",00FF:"255 Coins" + cn Lower Right Character\Star Options + 800D103E ???? 0000:"0 Stars",0064:"99 Stars" + cn Top Left Character\Dice Always + cd With this option you can calculate exactly how many you need to get on the position of your choice. + 800CDA55 ???? 0000:"Rolls In Random",0001:"Rolls In 1",0002:"Rolls In 2",0003:"Rolls In 3",0004:"Rolls In 4",0005:"Rolls In 5",0006:"Rolls In 6",0007:"Rolls In 7",0008:"Rolls In 8",0009:"Rolls In 9",000A:"Rolls In 10" + cn Top Right Character\Dice Always + cd With this option you can calculate exactly how many you need to get on the position of your choice. + 800CDAA1 ???? 0000:"Rolls In Random",0001:"Rolls In 1",0002:"Rolls In 2",0003:"Rolls In 3",0004:"Rolls In 4",0005:"Rolls In 5",0006:"Rolls In 6",0007:"Rolls In 7",0008:"Rolls In 8",0009:"Rolls In 9",000A:"Rolls In 10" + cn Lower Left Character\Dice Always + cd With this option you can calculate exactly how many you need to get on the position of your choice. + 800CDAED ???? 0000:"Rolls In Random",0001:"Rolls In 1",0002:"Rolls In 2",0003:"Rolls In 3",0004:"Rolls In 4",0005:"Rolls In 5",0006:"Rolls In 6",0007:"Rolls In 7",0008:"Rolls In 8",0009:"Rolls In 9",000A:"Rolls In 10" + cn Lower Right Character\Dice Always + cd With this option you can calculate exactly how many you need to get on the position of your choice. + 800CDB39 ???? 0000:"Rolls In Random",0001:"Rolls In 1",0002:"Rolls In 2",0003:"Rolls In 3",0004:"Rolls In 4",0005:"Rolls In 5",0006:"Rolls In 6",0007:"Rolls In 7",0008:"Rolls In 8",0009:"Rolls In 9",000A:"Rolls In 10" + +crc 839F3AD5-406D15FA-C:50 +gn MarioTennis + cn Have All\Characters Available + 810657A0 FFFF + cn Have All\Courts Available + 810657A4 FFFF + cn Score\Player 1 + 80152DFA ???? 0000:"0",0001:"15",0002:"30",0003:"40" + cn Score\Player 2 + 80152DFB ???? 0000:"0",0001:"15",0002:"30",0003:"40" + +crc DED0DD9A-E78225A7-C:50 +gn MICKEY USA PAL + cn Play As + 800D33D1 ???? 0000:"Mickey Mouse",0001:"Daisy Duck",0002:"Goofy",0003:"Pete",0004:"Minnie Mouse",0005:"Donald Duck",0006:"Huey",0007:"Dewey",0008:"Louie",0009:"Lugwig Von Drake" + cn Traffic Troubles\Indianapolis\Max Tokens + cd Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 801B4332 0063 + cn Traffic Troubles\San Fransisco\Max Tokens + cd Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 801B7602 0063 + cn Traffic Troubles\New Mexico\Max Tokens + cd Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 801B5902 0063 + cn Traffic Troubles\Grand Canyon\Max Tokens + cd Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 801B8CF2 0063 + cn Motor Way Mania\Los Angeles\Max Tokens + cd Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 801B3792 0063 + cn Motor Way Mania\Alaska\Max Tokens + cd Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 801B3F22 0063 + cn Motor Way Mania\Las Vegas\Max Tokens + cd Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 801B85B2 0063 + cn Motor Way Mania\Philadelphia\Max Tokens + cd Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 801B9502 0063 + cn Freewayphobia\Dakota\Max Tokens + cd Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 801B2CB2 0063 + cn Freewayphobia\Seattle\Max Tokens + cd Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 801B5892 0063 + cn Freewayphobia\New York\Max Tokens + cd Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 801B4FB2 0063 + cn Freewayphobia\Chicago\Max Tokens + cd Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 801B7AE2 0063 + cn Victory Vehicles\Yellowstone\Max Tokens + cd Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 801B2F62 0063 + cn Victory Vehicles\Washington DC\Max Tokens + cd Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 801BD102 0063 + cn Victory Vehicles\Everglades\Max Tokens + cd Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 801B56C2 0063 + cn Victory Vehicles\Malibu\Max Tokens + cd Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 801B7152 0063 + cn Frantic Finale\Hawaii\Max Tokens + cd Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 801B7B12 0063 + cn Frantic Finale\Oregon\Max Tokens + cd Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 801B44E2 0063 + cn Frantic Finale\Texas\Max Tokens + cd Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 801B4C82 0063 + cn Frantic Finale\Colorado\Max Tokens + cd Only use one One Max Token Track code of each Level at a time, if you enable all tracks Max Token on that level Or all levels and tracks it will crash. + 801B7432 0063 + cn Level Select + 801AD159 ???? 0000:"Traffic Troubles",0001:"Motor Way Mania",0002:"Freewayphobia",0003:"Vitory Vehicles",0004:"Frantic Finale",0005:"Time Trial",0006:"Practice",0007:"Contest",0008:"Options" + cn Difficulty Select + 8007C1C0 ???? 0000:"Amateur",0001:"Intermediate",0002:"Professional",0003:"Mirror Mode" + cn Unlock Everything + cd This will unlock all characters, tracks, mirror mode, all in-game cheats, postcards, pluto's collar and give you all Trophies for every track and difficulties. To have this cheat save to mempak, enable it and then go into the Options Menu and disable the cheat. Go to the Wide-Screen Settings and Change it to Wide-Screen [16.9] and then the B button to get back to Wide-Screen Settings, now go back into Wide-Screen [16.9] and change it back to Normal [4.3].and press the B button until you come back to the main Options Menu.Close the game and load it again to see everything saved to the Mempak and unlocked. + 800D3478 008F + 800D3479 0094 + 800D347A 0003 + 800D347C 0001 + 800D347F 0080 + 50000502 0000 + 800D3480 0009 + 50000502 0000 + 800D3481 0024 + 800D348A 0015 + 800D348B 007F + 800D348C 0001 + 800D348D 00FF + 800D348E 0004 + 800D348F 0022 + cn Always 1st & final time 00:00.00 + cd All Levels + 50000301 0000 + 801CE959 0000 + cn Traffic Troubles\Indianapolis\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 801B430B 00FF + cn Traffic Troubles\San Fransisco\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 801B75DB 00FF + cn Traffic Troubles\New Mexico\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 801B58DB 00FF + cn Traffic Troubles\Grand Canyon\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 801B8CCB 00FF + cn Motor Way Mania\Los Angeles\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 801B207B 00FF + cn Motor Way Mania\Alaska\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 801B280B 00FF + cn Motor Way Mania\Las Vegas\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 801B6E9B 00FF + cn Motor Way Mania\Philadelphia\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 801B7DEB 00FF + cn Freewayphobia\Dakota\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 801B159B 00FF + cn Freewayphobia\Seattle\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 801B417B 00FF + cn Freewayphobia\New York\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 801B4A5B 00FF + cn Freewayphobia\Chicago\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 801B758B 00FF + cn Victory Vehicles\Yellowstone\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 801B2A0B 00FF + cn Victory Vehicles\Washington DC\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 801BCBAB 00FF + cn Victory Vehicles\Everglades\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 801B516B 00FF + cn Victory Vehicles\Malibu\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 801B6BFB 00FF + cn Frantic Finale\Hawaii\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 801B75BB 00FF + cn Frantic Finale\Oregon\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 801BABEB 00FF + cn Frantic Finale\Texas\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 801BB38B 00FF + cn Frantic Finale\Colorado\Always Have Shield Shell + cd Only use one Always Have Shield Shell code of each Level at a time, if you enable all tracks Always Have Shield Shell on that level Or all levels and tracks it will crash. + 801BDB3B 00FF + cn Re-name Characters\Mickey\Letter 1 + 801E39B9 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Mickey\Letter 2 + 801E39BA ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Mickey\Letter 3 + 801E39BB ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Mickey\Letter 4 + 801E39BC ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Mickey\Letter 5 + 801E39BD ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Mickey\Letter 6 + 801E39BE ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Minnie\Letter 1 + 801E39C0 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Minnie\Letter 2 + 801E39C1 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Minnie\Letter 3 + 801E39C2 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Minnie\Letter 4 + 801E39C3 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Minnie\Letter 5 + 801E39C4 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Minnie\Letter 6 + 801E39C5 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Donald\Letter 1 + 801E39C7 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Donald\Letter 2 + 801E39C8 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Donald\Letter 3 + 801E39C9 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Donald\Letter 4 + 801E39CA ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Donald\Letter 5 + 801E39CB ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Donald\Letter 6 + 801E39CC ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Daisy\Letter 1 + 801E39CE ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Daisy\Letter 2 + 801E39CF ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Daisy\Letter 3 + 801E39D0 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Daisy\Letter 4 + 801E39D1 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Daisy\Letter 5 + 801E39D2 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Goofy\Letter 1 + 801E39D4 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Goofy\Letter 2 + 801E39D5 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Goofy\Letter 3 + 801E39D6 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Goofy\Letter 4 + 801E39D7 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Goofy\Letter 5 + 801E39D8 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Pete\Letter 1 + 801E39DA ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Pete\Letter 2 + 801E39DB ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Pete\Letter 3 + 801E39DC ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Pete\Letter 4 + 801E39DD ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Huey\Letter 1 + 801E39DF ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Huey\Letter 2 + 801E39E0 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Huey\Letter 3 + 801E39E1 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Huey\Letter 4 + 801E39E2 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Dewey\Letter 1 + 801E39E4 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Dewey\Letter 2 + 801E39E5 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Dewey\Letter 3 + 801E39E6 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Dewey\Letter 4 + 801E39E7 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Dewey\Letter 5 + 801E39E8 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Louie\Letter 1 + 801E39EA ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Louie\Letter 2 + 801E39EB ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Louie\Letter 3 + 801E39EC ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Louie\Letter 4 + 801E39ED ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Louie\Letter 5 + 801E39EE ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Ludwig\Letter 1 + 801E39F0 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Ludwig\Letter 2 + 801E39F1 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Ludwig\Letter 3 + 801E39F2 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Ludwig\Letter 4 + 801E39F3 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Ludwig\Letter 5 + 801E39F4 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + cn Re-name Characters\Ludwig\Letter 6 + 801E39F5 ???? 0000:"",0020:"",0021:"!",0022:"\"",0023:"#",0024:"",0025:"%",0026:"&",0027:"'",0028:"(",0029:")",002A:"*",002B:"+",002C:"",002D:"-",002E:".",002F:"/",0030:"0",0031:"1",0032:"2",0033:"3",0034:"4",0035:"5",0036:"6",0037:"7",0038:"8",0039:"9",003A:":",003B:";",003C:"<" + +crc 2A49018D-D0034A02-C:50 +gn Micro Machines 64 Turbo (E) + cn Always 1st + 810BB1F8 0100 + cn One Lap To Race + 810B88DE 0101 + cn Infinite 255 Lives + 800BB1C2 00FF + cn Access All Tracks + 810B88DA 0001 + cn Always Win Head 2 Head + 810BD590 0008 + cn Always Turbo Level 1 + cd In Easy Mode + 810B4070 3100 + 810BBD30 0000 + +crc 418BDA98-248A0F58-C:50 +gn Mischief Makers + cn Marina\Infinite Health + 810E1120 0BB8 + cn Teran\Infinite Health + 810E5DA0 03E8 + cn Infinite Max Red Gems + 81169C66 25C2 + cn All Stages & Chapters Unlocked + 80163648 003B + cn All 52 Gold Gems Collected + 80163640 0003 + 80163641 007E + 80163642 00FF + 80163643 00EF + 80163644 00FF + 80163645 007F + 80163646 00FF + 80163647 00FC + cn Marina\Press A To Levitate + D0128BF4 0080 + 800E1132 0091 + cn Teran\Press A To Levitate + D0128BF4 0080 + 800E5DB2 0091 + cn Infinite Time to Watch Ending + 800E6613 0063 + +crc 2256ECDA-71AB1B9C-C:50 +gn MISSION IMPOSSIBLE + cn Invincibility + 810864C4 0101 + cn Infinite\Ammo All Guns + 50000610 0000 + 800A9097 00FF + cn Infinite\Health + 810864C2 FFFF + cn Access All Levels + 8008AA56 0001 + 8008AD3A 0001 + 8008A862 0001 + 8008A876 0001 + 8008A88A 0001 + 8008A89E 0001 + 8008A8B2 0001 + 8008A8C6 0011 + 8008A8DA 0021 + 8008AD4E 0001 + 8008A916 0011 + 8008A92A 0041 + 8008A93E 0021 + 8008A966 0001 + 8008A98E 0001 + 8008AD62 0001 + 8008A9DE 0001 + 8008A9F2 0011 + 8008AA06 0021 + 8008AD76 0001 + 8008A7D6 0001 + 8008A7EA 0001 + 8008A812 0001 + cn Freeze All Timers + 81093F50 0063 + 81093F52 0063 + 81093F54 0063 + cn Weapon Select + 800A90B5 ???? + 800A90C5 ???? + 800A90D5 ???? 0000:"9MM Hi Power",0001:"Silenced Pistol",0002:"Uzi",0003:"Fists",0032:"Gas Spray",0036:"Blow Torch",001F:"Fire Extinguisher",0024:"Spray Paint",0027:"Electrostunner",000B:"Blow Dart Gun",000C:"Dart Hand Gun",002D:"Mini Rocket Launcher" + cn Walk Through Walls & Objects + cd This will allow you to pass through anything & even walk on water.if you amerge somewhere in the ground just press the A button. + 80094105 ???? 0080:"On",0000:"Off" + +crc 73036F3B-CE0D69E9-C:50 +gn Mortal Kombat 4 (E) + cn Unlimited Energy\Player 1 + 810FE208 0001 + 810FE20A 0000 + cn Unlimited Energy\Player 2 + 81127084 0001 + 81127086 0000 + cn Infinite Run\Player 1 + 811050FC 0001 + 811050FE 0000 + cn Infinite Run\Player 2 + 811051B0 0001 + 811051B2 0000 + cn Play As\Player 1 + 800FE3C3 ???? 0000:"Scorpion",0001:"Raiden",0002:"Sonya",0003:"Liu Kang",0004:"Sub-Zero",0005:"Fujin",0006:"Shinnok",0007:"Reiko",0008:"Quan Chi",0009:"Tanya",000A:"Reptile",000B:"Kai",000C:"Jarek",000D:"Jax",000E:"Johnny Cage",000F:"Goro",0011:"Noob Saibot" + cn Play As\Player 2 + 80126FBF ???? 0000:"Scorpion",0001:"Raiden",0002:"Sonya",0003:"Liu Kang",0004:"Sub-Zero",0005:"Fujin",0006:"Shinnok",0007:"Reiko",0008:"Quan Chi",0009:"Tanya",000A:"Reptile",000B:"Kai",000C:"Jarek",000D:"Jax",000E:"Johnny Cage",000F:"Goro",0011:"Noob Saibot" + cn Choose A Costume\Player 1 + 8104A612 ???? 0000:"Normal",0001:"First",0002:"Second",0003:"Third" + cn Choose A Costume\Player 2 + 8104A616 ???? 0000:"Normal",0001:"First",0002:"Second",0003:"Third" + cn Infinite Time + 8110524A 0063 + cn Enable Restart Match option + 800494BB 0002 + +crc 8C3D1192-BEF172E1-C:50 +gn Mortal Kombat Trilogy (E) + cn Unlimited Energy\Player 1 + 801698AD 00A6 + cn Unlimited Energy\Player 2 + 80169B81 00A6 + cn Aggressor Energy Bar\Player 1 + 80169941 0030 + cn Aggressor Energy Bar\Player 2 + 80169943 0030 + cn Infinite Time + 8114C2FC 000A + cn Unlock Secret + 80169F41 0004 + cn Infinite Run\Player 1 + 811698B4 0030 + cn Play As\Player 1 + 8016989D ???? 0000:"Kano",0001:"Sonya",0002:"Jax",0003:"Nightwolf",0004:"Cage",0005:"Stryker",0006:"Sindel",0007:"Sektor",0008:"Cyrax",0009:"Kung Lao",000A:"Kabal",000B:"Sheeva",000C:"Shang Tsung",000D:"Liu Kang",000E:"Smoke",000F:"Kitana",0010:"Jade",0011:"Mileena",0012:"Scorpion",0013:"Reptile",0014:"Ermac",0015:"Sub-Zero",0016:"Human Smoke",0017:"Noob Saibot",0018:"Rayden",0019:"Baraka",001A:"Rain",001B:"Khameleon" + cn Infinite Run\Player 2 + 81169B88 0030 + cn Play As\Player 2 + 80169B41 ???? 0000:"Kano",0001:"Sonya",0002:"Jax",0003:"Nightwolf",0004:"Cage",0005:"Stryker",0006:"Sindel",0007:"Sektor",0008:"Cyrax",0009:"Kung Lao",000A:"Kabal",000B:"Sheeva",000C:"Shang Tsung",000D:"Liu Kang",000E:"Smoke",000F:"Kitana",0010:"Jade",0011:"Mileena",0012:"Scorpion",0013:"Reptile",0014:"Ermac",0015:"Sub-Zero",0016:"Human Smoke",0017:"Noob Saibot",0018:"Rayden",0019:"Baraka",001A:"Rain",001B:"Khameleon" + cn Pick Your Kombat Zone + 812575A4 ???? 0000:"Subway",0001:"Street",0002:"Courtyard",0003:"Pit",0004:"Kahn's Tower",0005:"Bridge",0006:"Soul Chamber",0007:"Bell Tower",0008:"Kombat Temple",0009:"Graveyard",000A:"Pit 3",000B:"River Kombat",000C:"Scorpion's Lair",000D:"Kahn's Kave",000E:"Jade's Desert",000F:"Lost Bridge",0010:"Hidden Portal",0011:"Dead Pool",0012:"Wasteland",0013:"Rooftop",0014:"Armory",0015:"Living Forest",0016:"Tower",0017:"Portal",0018:"Lair",0019:"Tomb",001A:"Pit 2",001B:"Star Bridge",001C:"Pit Bottom" + cn Max Aggressor\Player 1 + cd Press L Button To Activate + D02B5285 0020 + 811698D4 5100 + D02B5285 0020 + 811698DC 5100 + cn Max Aggressor\Player 2 + cd Press L Button To Activate + D02B528D 0020 + 811698D6 5100 + D02B528D 0020 + 811698DE 5100 + +crc B8F0BD03-4479189E-C:50 +gn MRC - Multi Racing Championship (E) + cn Always 1st + 800A9107 0000 + cn Infinite Time + 8009498F 003C + cn Access all Gold Trophies + cd Championshp & Match Mode + 50000602 0000 + 810A9078 0000 + cn Access All Tracks In Match Mode + 50000602 0000 + 810A9080 0001 + +crc F5360FBE-2BF1691D-C:50 +gn MYSTICAL NINJA + cn Infinite\Health + 8015D2E7 0028 + cn Infinite\Lives + 8015D2EF 000A + cn Infinite\Ryo + 8015D2EA 0010 + cn Have\Chain Pipe + 8015D3BF 0002 + cn Have\Medal of Flames + 8015D3DF 0001 + cn Have\Ebisumaru + 8015D3A3 0001 + cn Have\Meat Saw Hammer + 8015D3C0 0001 + cn Have\Sasuke Character + 8015D3A4 0001 + cn Have\Fire Cracker Bomb + 8015D3C4 0001 + cn Have\Kunai of Severe Cold + 8015D3D4 0001 + cn Have\Yae Character + 8015D3AB 0001 + cn Have\Bazooka + 8015D3CB 0001 + cn Have\Flute + 8015D3DB 0001 + cn Have\Magic Mermaid + 8015D3FB 0001 + cn Have\Magic Sudden Impact + 8015D3EC 0001 + cn Have\Magic Mini Ebisu + 8015D3F2 0001 + cn Have\Magic Flying + 8015D3F4 0001 + cn Have\Shell + 8015D3FC 0001 + cn Have\Brown Item + 8015D402 0001 + cn Have\Brown Round Item + 8015D40F 0001 + cn Have\Gold Key + 8015D412 0001 + cn Have\Blue Sausage + 8015D417 0001 + cn Have\Pink Item + 8015D41B 0001 + cn Have\Gold Item + 8015D41C 0001 + cn Have\Blue Item + 8015D422 0001 + cn Access\Japanese Sombrero + cd Use only one of these codes at a time! + 8015D2F7 0001 + cn Access\Metal Helmet + cd Use only one of these codes at a time! + 8015D2F7 0002 + cn Access\Gold Helmet + cd Use only one of these codes at a time! + 8015D2F7 0003 + cn Access\Infinite Health + cd Use only one of these codes at a time! + 802F706A 0999 + cn Access\Infy Ryo + cd Use only one of these codes at a time! + 802F7667 0999 + cn Access\Always have Big Laser + cd Use only one of these codes at a time! + 802F706F FFFF + cn Access\Infinite Ryo Impact Running + cd Use only one of these codes at a time! + 812F70EA 270F + cn Access\Infinite Ryo Impact Fighting + cd Use only one of these codes at a time! + 812F7066 0005 + cn Access\Enemy Health Modifer attach Activator + cd Use only one of these codes at a time! + 812F7062 03E8 + cn Access\Infinite Impact Oil + cd Use only one of these codes at a time! + 812F706A 0154 + cn Access\Full Energy for Lazer + cd Use only one of these codes at a time! + 812F706E 0064 + cn Access\Mystical Ninja Skating team + 8120D620 4E20 + 8120DEF4 4E20 + 8116AE78 4E20 + cn Access\Move Lock + 8116AE6A 0000 + 8120D84A 0000 + cn Access\Skating Team V2 + 8120D620 4E20 + 8120DEF4 4E20 + 8116AE78 4E20 + 8116AE6A 0001 + 8120D84A 0001 + cn Keep Blue Fish + 8015D303 0003 + 50000404 0000 + 8015D2F3 0003 + +crc 7F9345D3-841ECADE-C:50 +gn Mystical Ninja 2 Starring Goemon (E) + cn Play As\Player 1 + 80088E02 ???? 0000:"Goemon",0001:"Ebisumaru",0002:"Sasuke",0003:"Yae" + cn Unlimited Gate Opener Things + 80088EC6 0099 + cn Unlimited Health\Player 1 + 80088ED4 0004 + cn Unlimited Shield\Player 1 + 80088ED5 0004 + 8015D3C4 0001 + cn Always Have Most Powerful Weapon + 80088ED9 0003 + +crc AE4992C9-9253B253-C:50 +gn NASCAR 99 (E) + cn Laps To Race + 81044B7E ???? 0001:"1 Lap",0002:"2 Laps",0003:"3 Laps",0004:"4 Laps",0005:"5 Laps",0006:"6 Laps",0007:"7Laps",0008:"8 Laps",0009:"9 Laps" + cn Access All Secret NASCAR Legends + cd This will give you access to,Alan Kulwicki,Cale Yarborough,Bobby Allison,Davey Allison,Richard Petty,Benny Parsons + 50000602 0000 + 810DF400 0101 + +crc 29CE7692-71C58579-C:50 +gn NHL Breakaway 98 (E) + cn Activate Cheat Menu + 80053F78 0001 + cn Home Team Scores + 8012BC2C ???? 0000:"No Score",00FF:"Max Score" + cn Away Team Score + 8012BC2D ???? 0000:"No Score",00FF:"Max Score" + +crc 8A97A197-272DF6C1-C:50 +gn Nuclear Strike 64 (E) + cn Level & Scenario Select + 800ACE5C 000B + cn Invincibility + cd Makes you also fly without any fuel + 800ADB64 0001 + cn Double MPG + 800ADB69 0001 + cn No Quad Damage + 800ADB6B 0001 + cn infinite Ammo For All Guns + 800ADB65 0001 + cn Infinite Attempts + 800ADB66 0001 + +crc E86415A6-98395B53-C:50 +gn O.D.T (Or Die Trying) (E) (M5) (Unreleased Final) + cn Play As Select + 800FCEC5 ???? 0000:"Ike Hawkings (Corporal)",0001:"Sophia Hawkings (Stowaway)",0002:"Julia Chase (Cartographer)",0003:"Karma (The Ex-Deviant)",0004:"Max Havok (Chief Enginer)",0005:"Solaar (Archbishop)",0006:"Mr Bodybolt (7th Passenger)" + cn Infinite Max\999 Lives + 810C8CF8 03E8 + cn Infinite Max\Health + 800C8AD9 0066 + cn Infinite Max\Light Ammo + 800C8CAB 0066 + cn Infinite Max\Fire Ammo + 800C8CB3 0066 + cn Infinite Max\Ionic Ammo + 800C8CBB 0066 + cn Infinite Max\Fusion Ammo + 800C8CC3 0066 + cn Infinite Max\Mana + 800C8CFF 0066 + cn Have\All Magic + 800CEB48 0010 + 800CEB4D 0000 + 800CEB57 0001 + 800CEB61 0002 + 800CEB6B 0003 + 800CEB75 0005 + 800CEB7F 0006 + 800CEB89 0008 + 800CEB93 0009 + 800CEB9D 000B + 800CEBA7 000E + 800CEBB1 000F + 800CEBBB 0010 + 800CEBC5 0011 + 800CEBCF 000A + 800CEBD9 000C + 800CEBE3 000D + cn Have\Magic On Level 4 + 810C8CDD FFFF + 810C8CDE FFFF + 810C8CDF FFFF + 810C8CE0 FFFF + 810C8CE1 FFFF + 810C8CE2 FFFF + cn Have\Weapons On Max Upgrade + 800C8CAC 0009 + 800C8CB4 0009 + 800C8CBC 0009 + 800C8CC4 0009 + cn Have\Max Armour Level + 800C8D00 0064 + cn Have\Max Spirit Level + 800C8D04 0064 + cn Have\Max Weapon Level + 800C8D02 0064 + cn Have\Max Experience Level + 800C8CFC 00FF + cn Infinite Air Under Water + 800C8BE4 0069 + cn Press A For Bionic Jump + cd This will make you jump to a great height + D00C8BCA 0080 + 810C8AE8 ???? 0250:"Medium Jump",0800:"Max Jump" + +crc 812289D0-C2E53296-C:50 +gn Off Road Challenge (E) + cn 1 Player\Always Place 1st + 80103CD7 0000 + cn Multi and 1 Player\Infinite Gent Turbos\Player 1 + cd Can be used in 1 Player and Multiplayer Modes for Player 1 + 81103F3A 02F4 + cn 1 Player\Max\Acceleration + 8012C51F 000A + cn 1 Player\Max\Shocks + 8012C527 000A + cn 1 Player\Max\Speed + 8012C523 000A + cn 1 Player\Max\Tires + 8012C52B 000A + cn Multi and 1 Player\Max Crash Helmets\Player 1 + cd Can be used in 1 Player and Multiplayer Modes for Player 1 + 80103F33 0064 + cn Multi and 1 Player\Infinite Gent Turbos\Player 2 + cd Multiplayer Mode Only for Player 2 + 8110422E 02F4 + cn Multi and 1 Player\Max Crash Helmets\Player 2 + cd Multiplayer Mode Only for Player 2 + 80104227 0064 + +crc D5898CAF-6007B65B-C:50 +gn OPERATION WINBACK + cn Infinite\Health + 80179F8B 0064 + cn Infinite\Ammo and No Reloads + 80157C9B 0078 + 80157C94 0078 + 80157C90 0063 + 80179F6F 001E + 80157C91 0063 + 80179F83 0008 + cn C4 Explosives + cd Slot 1 + 80157C93 0001 + cn Flash Light + cd Slot 2 + 80157C95 0001 + cn C4 Detector + cd Slot 3 + 80157C98 0001 + cn Key + cd Slot 2 + 80157C99 0001 + cn Card Key + cd Slot 3 + 80157C9A 0001 + cn Max Power Mode + 8015C8E7 0001 + cn All Multiplayer Characters + 8015C8E1 000F + 8015C8E2 00FF + 8015C8E3 00FF + cn Walk Through Walls/Objects + cd Press Z Button And Joystick Forward Dont Stand Too Close To Wall/Object + D0139BC4 0020 + 8117964C 43C7 + cn Weapon modifier + 80179F78 ???? 0000:"Handgun",0001:"Submachine gun",0002:"Shotgun",0003:"Rocket launcher",0014:"Handgun w/ silencer" + cn Sudden death & trial modes unlocked + 8015C8E0 00A0 + cn Time is always 00:20:38 + 8010D342 0078 + +crc AC976B38-C3A9C97A-C:50 +gn Paperboy 64 (E) + cn Level Select + cd Also accesses All Bonus Levels + 8006A6A7 0001 + cn Invincibility + 81268D1A 0001 + cn Infinite Newspapers + 81268D12 0001 + cn Big Newspapers + 81268D5A 0001 + cn Throw Newspapers Forwards + 81268D46 0001 + cn Throw Newspapers Backwards + 81268D4A 0001 + cn Turbo Mode + 81268D36 0001 + cn Super Jump Springs + 81268D3A 0001 + cn Rocket Boosters + 81268D3E 0001 + cn 99 Total Houses + 8106A61A 0063 + +crc 19AB29AF-C71BCD28-C:50 +gn PAPER MARIO + cn Infinite & Max HP + FP + cd Do not enable this code before you have made a save, when a new game is started up. + 50000601 0000 + 8010DD91 0063 + cn Access\All Star Spirits + cd Disable this code as soon as you have reached level 8, or everything will be removed again + 8110E01E 0007 + cn Access\Max Star Energy + 8010E01E 0007 + cn Access\Infinite Star Spirits + 8010E020 0007 + cn Access\Infinite Coins + 8110DD9C 03E7 + cn Access\Max Star Points + cd You will level up, everytime you get a Star point + 8010DDA0 0063 + cn Access\Max Star Pieces + 8010DD9F 0063 + cn Access\Max Badge Points + 8010DD98 ???? 003C:"60 Badge Points",007F:"127 Badge Points" + cn Access\Level 99 + 8010DD99 0063 + cn Access\all members in your party + 50000C08 0000 + 8010DDAC 0001 + cn Access\Ultra Rank + cd This will give you Goombario,Kooper,Bombette,Parakarry,Bow Watt, Sushie & Lakilester + 50000C08 0000 + 8010DDAD 0002 + 50000C08 0000 + 8010DDED 0002 + cn Press L Button For Moon Jump + D0071337 0020 + 8010DAF4 0043 + +crc C83CEB83-FDC56219-C:50 +gn Penny Racers (E) + cn Super Speed + cd This is Turbo fast,So to slow it down a little more keep the B button pressed down + 81228FA8 4800 + cn Always 1st + 8022CC16 0001 + cn Class Select + cd This code is useful because you can play Class AA without having to beat a level!& then once any edit is done while the game is running + 8021C297 ???? 0000:"Class C",0001:"Class B",0003:"Class AA",0004:"1 Play",0005:"2 Play",0006:"3 Play",0007:"4 Play" + +crc E4B08007-A602FF33-C:50 +gn Perfect Dark (E) + cn Have All\Weapons\Player 1 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 802037F0 0007 + 801EA7F0 0007 + 801D17F0 0007 + cn Infinite\Ammo\Player 1 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 80202F7F 00FF + 801E9F7F 00FF + 801D0F7F 00FF + 802027DB 00FF + 801E97DB 00FF + 801D07DB 00FF + cn Infinite\Health\Player 1 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 8120205C 3F80 + 811E905C 3F80 + 811D005C 3F80 + cn Infinite\Shield\Player 1 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 81202070 3F80 + 811E9070 3F80 + 811D0070 3F80 + cn Have All\Weapons\Player 2 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 80205460 0007 + 801EC460 0007 + 801D3460 0007 + cn Infinite\Ammo\Player 2 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 80204BEF 00FF + 801EBBEF 00FF + 801D2BEF 00FF + 8020444B 00FF + 801EB44B 00FF + 801D244B 00FF + cn Infinite\Health\Player 2 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 81203CCC 3F80 + 811EACCC 3F80 + 811D1CCC 3F80 + cn Infinite\Shield\Player 2 + cd This code is for all Low/High Res Solo & Multi-Player Level ;) Enjoy + 81203CE0 3F80 + 811EACE0 3F80 + 811D1CE0 3F80 + cn Have All\Levels Complete & All Challenges + cd Have all levels Complete on Solo Missions, & Acces all Challenges & CO-OP Levels + 50003C02 0000 + 800A27C1 0001 + 50001E1A 0000 + 80088A0D 0001 + 50001E1A 0000 + 80088A0E 0001 + 50001E1A 0000 + 80088A0F 0001 + 50001E1A 0000 + 80088A10 0001 + cn Carrington Institute\Have 999 points in Firing Range + 810AD712 03E7 + cn Carrington Institute\Have Infinite time in Firing Range + 810AD70E 004D + cn Carrington Institute\Have 255 targets destroyed + 810AD714 00FF + cn Single & Co-Op\Press B To Levitate\Player 1 + cd To activate the moon jump you must Hold B while in the air. You can get in the air by going down steps, or hills or by going off the edge of something + D00980C4 0040 + 81202000 40F2 + D00980C4 0040 + 80201FB3 0000 + D00980C4 0040 + 811E9000 40F2 + D00980C4 0040 + 801E8FB3 0000 + D00980C4 0040 + 811D0000 40F2 + D00980C4 0040 + 801CFFB3 0000 + +crc 1AA05AD5-46F52D80-C:50 +gn Pilot Wings64 + cn Infinite Fuel\Gyrocopter + 80366989 0081 + cn Infinite Fuel\Rocket Belt + 803669A9 0081 + cn Time Always 00'00'10 + cd This Cheat code is for All Events + 803668B8 0001 + cn Choose Vehicle + cd Make your Choice & then Press GS To Activate,But do not use with any other Press GS Cheat Codes. + 88366807 ???? 0000:"Hang Glider",0001:"Rocket Belt",0002:"Gyrocopter",0003:"Cannonball",0004:"Skydiving",0005:"Jumble Hopper",0006:"Birdman" + cn [Perfect Score] (All Class & Level's) + cd To make these codes save to Game-Pak; just pick a level and lose, choose Next then Quit. Enable Disable Perfect Score then save and disable before using the Extra Games Perfect Score Cheat. + 50000330 0000 + 803683ED 0064 + 50000330 0000 + 80368A81 0064 + 50000330 0000 + 80368BD1 0064 + 50000330 0000 + 80369115 0064 + 50000330 0000 + 80369265 0064 + 50000330 0000 + 803693B5 0064 + 50000330 0000 + 803697A9 0064 + 50000330 0000 + 803698F9 0064 + 50000330 0000 + 80369A49 0064 + cn Infinite Photos + 813545EE 0000 + cn [Perfect Score] Extra Games (All Class & Level's) + cd To make these codes save to Game-Pak; just pick a level and lose, choose Next then Quit. Enable Disable Perfect Score then save and disable before using the Extra Games Perfect Score Cheat. + 8036847D 0019 + 803685CD 0019 + 8036871D 0019 + 8036886D 0019 + 803684AD 0064 + 803684DD 0064 + 80368B11 0019 + 80368C61 0019 + 80368DB1 0019 + 80368F01 0019 + 80368B41 0064 + 80368B71 0064 + 803691A5 0019 + 803692F5 0019 + 80369445 0019 + 80369595 0019 + 803691D5 0064 + 80369205 0064 + cn Music Volume Select + 80250FA4 ???? 0000:"No Music",003F:"Default Volume",0080:"Max Volume" + +crc 4FF5976F-ACF559D8-C:50 +gn POKEMON SNAP + cn [Enable All Levels] + cd This is needed to be able to Play all Levels of the Game + 810C2712 0006 + +crc 84077275-57315B9C-C:50 +gn Pokemon Stadium (E) + cn Infinite Health\Stadium\Free Battle + 80287D79 0064 + cn Infinite Health\Stadium\Poke Cup + 80285399 0064 + cn Infinite Health\Stadium\Pica Cup + 80284659 0064 + cn Infinite Health\Stadium\Prime Cup + 80285FE9 0064 + cn Infinite Health\Stadium\Petit Cup + 80286C29 0064 + cn Infinite Health\Stadium\Mewto + 802825B9 0064 + cn Gym Leader Castle\Elite Four & Rival + 80286859 00A1 + cn Gym Leader Castle\Brock + 80287539 00A1 + cn Gym Leader Castle\Misty + 80287E79 00A1 + cn Gym Leader Castle\Surge + 80286BD9 00A1 + cn Gym Leader Castle\Erika + 80286BA9 00A1 + cn Gym Leader Castle\Koga + 80287519 00A1 + cn Gym Leader Castle\Sabrina + 802870A9 00A1 + cn Gym Leader Castle\Blaine + 80286B69 00A1 + cn Gym Leader Castle\Giovani + 80287169 00A1 + cn Infinite Health\Player 1 + 810AE686 03E7 + 810AE6AA 03E7 + 810AE6DA 03E7 + 810AE6FE 03E7 + cn All Pokemon Level 100\Player 1 + 50000654 0000 + 800AE654 0064 + cn Infinite Attacks All Pokemon\Player 1 + 50000654 0000 + 810AE650 6363 + 50000654 0000 + 810AE652 6363 + cn Infinite Attacks All Pokemon\Player 2 + 50000654 0000 + 810AE86C FFFF + 50000654 0000 + 810AE86E FFFF + cn Infinite Attacks All Pokemon\Player 3 + 50000654 0000 + 810AE86C FFFF + 50000654 0000 + 810AE86E FFFF + cn Infinite Attacks All Pokemon\Player 4 + 50000654 0000 + 810AEA88 FFFF + 50000654 0000 + 810AEA8A FFFF + cn Game Difficulty + D312FC40 FD70 + D312FC40 A528 + 8112FC40 ???? 0000:"Hard",0001:"Normal",0002:"Easy",000F:"Extra Hard" + cn Catch\Mew on GB Tower + 80171E17 0015 + cn Catch\Mewtwo on GB Tower + 80171E17 0083 + cn Infinite coins for coin case + 801723E3 0099 + cn Infinite cash + 81172186 9999 + cn Pokemon beach stop code + D00488A1 0020 + 80202BB5 0001 + cn Clefairy Says\Infinite Health\Player 1 + 8118F438 0064 + cn Clefairy Says\Extended Life Bar\Player 1 + 8118F43A 0049 + cn Clefairy Says\Infinite Health\Player 2 + 8118F5F8 0064 + cn Clefairy Says\Extended Life Bar\Player 2 + 8118F5FA 0049 + cn Clefairy Says\Infinite Health\Player 3 + 8118F7B8 0064 + cn Clefairy Says\Extended Life Bar\Player 3 + 8118F7BA 0049 + cn Clefairy Says\Infinite Health\Player 4 + 8118F978 0064 + cn Clefairy Says\Extended Life Bar\Player 4 + 8118F97A 0049 + cn Rock Harden\Infinite Armour\Player 1 + 81193B78 0190 + cn Rock Harden\Infinite Armour\Player 2 + 81193E2C 0190 + cn Rock Harden\Infinite Armour\Player 3 + 811940E0 0190 + cn Rock Harden\Infinite Armour\Player 4 + 81194394 0190 + cn Infinite Health against Mew Two + 810AE632 FFFF + 812823E8 FFFF + cn All Pokmon Have Max Hp + 81285AE8 0096 + +crc 2952369C-B6E4C3A8-C:50 +gn Pokemon Stadium 2 (E) + cn Infinite Health Stadium & Gym Leader Castle + 801DD22D 0030 + cn Mini Games\Player 1\Gutsy Golbat has 99 Hearts + D017711F 0001 + 8017711F 0063 + cn Mini Games\Player 2\Gutsy Golbat has 99 hearts + D017714B 0001 + 8017714B 0063 + cn Mini Games\Player 3\Gutsy Golbat has 99 hearts + D0177177 0001 + 80177177 0063 + cn Mini Games\Player 4\Gutsy Golbat has 99 hearts + D01771A3 0001 + 801771A3 0063 + cn Mini Games\Player 1\Clear Cut Challenge gets perfect score + 801744C3 0063 + cn Mini Games\Player 1\Topsy Turvy + cd Immediatly wins + D01769E7 0001 + 801769E7 0005 + cn Mini Games\Player 1\Egg Emergency perfect score + 80191C3F 0064 + cn Mini Games\Player 1\Furret Frolic Perfect Score + 801E9623 0063 + cn Mini Games\Player 1\Streaming Stampede Perfect Score + 8018138B 0063 + cn Mini Games\Player 1\Delibird Delivery Perfect Score + 801AC2CC 0063 + cn Mini Games\Player 1\Roll Out Rampage Always in 1st Place + 80103179 0001 + +crc 16931D74-65DC6D34-C:50 +gn Quake 64 (E) + cn Infinite\Ammo + 50000402 0000 + 8016426D 0064 + 50000402 0000 + 8116426C 03E7 + cn Have\All Weapons + 8016422B 007F + cn Debug Mode + 8006C4E3 0001 + cn Have\All Keys + 80164229 000F + cn Infinite\Armor + 81164184 42C8 + cn Infinite\Health + 81164170 42C8 + cn Infinite\Bio Suit + 811641C0 42C8 + cn Have\Quad Damage + 811641BC 42C8 + cn Have\Ring of Shadows + 81164228 ???? 42C8:"On",0000:"Off" + cn Rapid Fire + D00CB220 0020 + 801641AD 0001 + cn Multi\Infinite Health\Player 1 + 81166AD0 42C8 + cn Multi\Infinite Armor\Player 1 + 81166AE4 42C8 + cn Multi\Infinite Bio Suit\Player 1 + 81166B20 42C8 + cn Multi\Have All Weapons\Player 1 + 80166B8B 007F + cn Multi\Infinite Ammo\Player 1 + 50000402 0000 + 81166BCC 03E7 + cn Multi\Infinite Health\Player 2 + 81166DA0 42C8 + cn Multi\Infinite Armor\Player 2 + 81166DB4 42C8 + cn Multi\Infinite Bio Suit\Player 2 + 81166DF0 42C8 + cn Multi\Have All Weapons\Player 2 + 80166E5B 007F + cn Multi\Infinite Ammo\Player 2 + 50000402 0000 + 81166E9C 03E7 + +crc 7433D9D7-2C4322D0-C:50 +gn QUAKE II + cn Invincible + 8002E618 0000 + cn Status Bar Always On + 8008E4CF 0001 + cn Have All Weapons and Infinite Max Ammo\Level 01 + 50000904 0000 + 802A46AB 0001 + 50000604 0000 + 812A46CE 02F4 + cn Have All Weapons and Infinite Max Ammo\Level 02 + 50000904 0000 + 8028A47B 0001 + 50000604 0000 + 8128A49E 02F4 + cn Have All Weapons and Infinite Max Ammo\Level 03 + 50000904 0000 + 8027223B 0001 + 50000604 0000 + 8127225E 02F4 + cn Have All Weapons and Infinite Max Ammo\Level 04 + 50000904 0000 + 8026A70B 0001 + 50000604 0000 + 8126A72E 02F4 + cn Have All Weapons and Infinite Max Ammo\Level 05 + 50000904 0000 + 8028812B 0001 + 50000604 0000 + 8128814E 02F4 + cn Have All Weapons and Infinite Max Ammo\Level 06 + 50000904 0000 + 8027DA0B 0001 + 50000604 0000 + 8127DA2E 02F4 + cn Have All Weapons and Infinite Max Ammo\Level 07 + 50000904 0000 + 802811CB 0001 + 50000604 0000 + 812811EE 02F4 + cn Have All Weapons and Infinite Max Ammo\Level 08 + 50000904 0000 + 8027C45B 0001 + 50000604 0000 + 8127C47E 02F4 + cn Have All Weapons and Infinite Max Ammo\Level 09 + 50000904 0000 + 80247C7B 0001 + 50000604 0000 + 81247C9E 02F4 + cn Have All Weapons and Infinite Max Ammo\Level 10 + 50000904 0000 + 80276C4B 0001 + 50000604 0000 + 81276C6E 02F4 + cn Have All Weapons and Infinite Max Ammo\Level 11 + 50000904 0000 + 80278AFB 0001 + 50000604 0000 + 81278B1E 02F4 + cn Have All Weapons and Infinite Max Ammo\Level 12 + 50000904 0000 + 8028F69B 0001 + 50000604 0000 + 8128F6BE 02F4 + cn Have All Weapons and Infinite Max Ammo\Level 13 + 50000904 0000 + 80278A4B 0001 + 50000604 0000 + 81278A6E 02F4 + cn Have All Weapons and Infinite Max Ammo\Level 14 + 50000904 0000 + 802807DB 0001 + 50000604 0000 + 812807FE 02F4 + cn Have All Weapons and Infinite Max Ammo\Level 15 + 50000904 0000 + 8027636B 0001 + 50000604 0000 + 8127638E 02F4 + cn Have All Weapons and Infinite Max Ammo\Level 16 + 50000904 0000 + 8028B7FB 0001 + 50000604 0000 + 8128B81E 02F4 + cn Have All Weapons and Infinite Max Ammo\Level 17 + 50000904 0000 + 8027278B 0001 + 50000604 0000 + 812727AE 02F4 + cn Have All Weapons and Infinite Max Ammo\Level 18 + 50000904 0000 + 8026594B 0001 + 50000604 0000 + 8126596E 02F4 + cn Have All Weapons and Infinite Max Ammo\Level 19 + 50000904 0000 + 8024A28B 0001 + 50000604 0000 + 8124A2AE 02F4 + +crc 9B500E8E-E90550B3-C:50 +gn Resident Evil 2 (E) + cn Infinite Health + 810DDE22 00C8 + cn Condition Always Fine + 810DDEE4 0000 + cn Infinite Time + 800E57BF 0010 + cn Access ChestAnywhere + cd Press L Button + Start + D1014FA4 0020 + 81122598 0100 + cn Access Quick Save + cd Press Z Button + B Button + D1014FA4 6000 + 810E5428 8007 + D1014FA4 6000 + 810E542A 0E30 + cn Access All Items Chest + cd Disable After First Save + 50003504 0100 + 810E59F4 2FFE + cn Infinite Ammo + 811224AE 03E7 + cn Access Ink Ribbons + cd Disable After First Save + 810E59C8 1EFF + cn Access Weapons\Grenadelauncher & Acid Rounds + cd Disable After First Save + 810E59CC 0BFF + cn Access Weapons\Bow Gun + cd Disable After First Save + 810E59D0 0CFF + cn Access Weapons\Rocket Launcher + cd Disable After First Save + 810E59D4 11FF + cn Access Weapons\Gatling Gun + cd Disable After First Save + 810E59D8 12FF + cn Number Of Saves Will Always Be 0 + 810E5650 0000 + cn Have 2 Extra Slots In Inventory + D10E584E 0000 + 810E584E 0001 + cn Play As + 810DDC38 ???? 0080:"Leon Original",0180:"Claire Original",0280:"Leon Original",0380:"Claire Original",0480:"Leon Wounded",0580:"Claire without jacket",0680:"Leon Wounded",0780:"Claire without jacket",0880:"Leon as Stars",0980:"Claire as Biker",0A80:"Leon as Biker",0B80:"Claires body Leons outfit",0C80:"Hunk (can crash the game)",0D80:"To Fu",0E80:"Ada (can crash the game)",0F80:"Cheryl" + cn Play Extra Mission + 810DDBEE ???? 0048:"The 4th Survior",0049:"To-Fu" + cn Max Item Modifier\Slot 01 + 800E59C8 ???? 0000:"Nothing",0001:"Knife Hunk",0002:"Handgun Hunk",0003:"Handgun Different Ada",0004:"Custom Handgun Hunk",0005:"Magnum Hunk",0006:"Custom Magnum Hunk",0007:"Shotgun Hunk",0008:"Custom Shotgun Hunk",0009:"Grenade Launcher Claire",000A:"Grenade Launcher (Flame Rounds) Claire",000B:"Grenade Launcher (Acid Rounds) Claire",000C:"Bowgun Claire",000D:"Colt S.A.A. Claire",000E:"Spark Shot Claire",000F:"Sub Machine Gun Leon",0010:"Flamethrower Leon",0011:"Rocket Launcher Claire",0012:"Gatling Gun Claire",0013:"Machine Gun ???",0014:"Handgun Bullets",0015:"Shotgun Shells",0016:"Magnum Bullets",0017:"Fuel",0018:"Grenade Rounds",0019:"Flame Rounds",001A:"Acid Rounds",001B:"Machine Gun Bullets",001C:"S. Shot Bullets",001D:"Bow Gun Bolts",001E:"Ink Ribbon",001F:"Small Key",0020:"Hand Gun Parts",0021:"Magnum Parts",0022:"Shotgun Parts",0023:"First Aid Spray",0024:"Chemical FR-W09",0025:"Chemical AC-W24",0026:"Green Herb",0027:"Red Herb",0028:"Blue Herb",0029:"Mixed Herb (Green)",002A:"Mixed Herb (Red&Green)",002B:"Mixed Herb (Blue&Green)",002C:"Mixed Herb (?)",002D:"Mixed Herb (?)",002E:"Mixed Herb (?)",002F:"Lighter",0030:"Lock Pick",0031:"Picture",0032:"Valve Handle",0033:"Red Jewel",0034:"Red Card Key",0035:"Blue Card Key",0036:"Serpent Stone",0037:"Jaguar Stone",0038:"Blue Stone",0039:"Blue Stone (?)",003A:"Eagle Stone",003B:"Bishop Plug",003C:"Rook Plug",003D:"Knight Plug",003E:"King Plug",003F:"W. Box Key",0040:"Detonator",0041:"Plastic Bomb",0042:"Bomb&Detonator",0043:"Crank",0044:"Film",0045:"Film (?)",0046:"Film (?)",0047:"Unicorn Medal",0048:"Eagle Medal",0049:"Wolf Medal",004A:"G. Cogwheel",004B:"Manhole Opener",004C:"Main Fuse",004D:"Fuse Case",004E:"Vaccine",004F:"Vaccine Cart.",0050:"Film",0051:"Base Vaccine",0052:"G-Virus",0053:"Special Key",0054:"Joint S Plug",0055:"Joint N Plug",0056:"Cord",0057:"Film",0058:"Cabin Key",0059:"Precinct Key (blue)",005A:"Precinct Key (red)",005B:"Precinct Key (?)",005C:"Precinct Key (green)",005D:"C. Panel Key (red)",005E:"C. Panel Key (yellow)",005F:"P. Room Key",0060:"MO Disk",0061:"Lab Card Key",0062:"Master Key",0063:"Platform Key",0064:"No Item",0065:"No Item",0066:"No Item",0067:"No Item",0068:"Chris's Diary",0069:"Mail to Chris",006A:"Memo to Leon",006B:"Police Memorandum",006C:"Operation Report 1",006D:"Mail to the Chief",006E:"Mail to the Chief (?)",006F:"Secretary's Diary A",0070:"Secretary's Diary B",0071:"Operation Report 2",0072:"User Registration",0073:"Film A",0074:"Film B",0075:"Film C",0076:"Patrol Report",0077:"Watchman's Diary",0078:"Chief's Diary",0079:"Sewer Manager Diary",007A:"Sewer Manager Fax",007B:"Film D",007C:"Vaccine Synthesis",007D:"Lab Security Manual",007E:"P-Epsilon Report",007F:"Rookie Files",0080:"Rookie Files (?)",0081:"No Item",0082:"Spade Key",0083:"Diamond Key",0084:"Desk Key",0085:"Heart Key",0086:"Club Key",0087:"Virgin Heart",0088:"Square Crank",0089:"Down Key",008A:"Up Key",008B:"Locker Key" + 800E59C9 00FF + cn Max Item Modifier\Slot 02 + 800E59CC ???? 0000:"Nothing",0001:"Knife Hunk",0002:"Handgun Hunk",0003:"Handgun Different Ada",0004:"Custom Handgun Hunk",0005:"Magnum Hunk",0006:"Custom Magnum Hunk",0007:"Shotgun Hunk",0008:"Custom Shotgun Hunk",0009:"Grenade Launcher Claire",000A:"Grenade Launcher (Flame Rounds) Claire",000B:"Grenade Launcher (Acid Rounds) Claire",000C:"Bowgun Claire",000D:"Colt S.A.A. Claire",000E:"Spark Shot Claire",000F:"Sub Machine Gun Leon",0010:"Flamethrower Leon",0011:"Rocket Launcher Claire",0012:"Gatling Gun Claire",0013:"Machine Gun ???",0014:"Handgun Bullets",0015:"Shotgun Shells",0016:"Magnum Bullets",0017:"Fuel",0018:"Grenade Rounds",0019:"Flame Rounds",001A:"Acid Rounds",001B:"Machine Gun Bullets",001C:"S. Shot Bullets",001D:"Bow Gun Bolts",001E:"Ink Ribbon",001F:"Small Key",0020:"Hand Gun Parts",0021:"Magnum Parts",0022:"Shotgun Parts",0023:"First Aid Spray",0024:"Chemical FR-W09",0025:"Chemical AC-W24",0026:"Green Herb",0027:"Red Herb",0028:"Blue Herb",0029:"Mixed Herb (Green)",002A:"Mixed Herb (Red&Green)",002B:"Mixed Herb (Blue&Green)",002C:"Mixed Herb (?)",002D:"Mixed Herb (?)",002E:"Mixed Herb (?)",002F:"Lighter",0030:"Lock Pick",0031:"Picture",0032:"Valve Handle",0033:"Red Jewel",0034:"Red Card Key",0035:"Blue Card Key",0036:"Serpent Stone",0037:"Jaguar Stone",0038:"Blue Stone",0039:"Blue Stone (?)",003A:"Eagle Stone",003B:"Bishop Plug",003C:"Rook Plug",003D:"Knight Plug",003E:"King Plug",003F:"W. Box Key",0040:"Detonator",0041:"Plastic Bomb",0042:"Bomb&Detonator",0043:"Crank",0044:"Film",0045:"Film (?)",0046:"Film (?)",0047:"Unicorn Medal",0048:"Eagle Medal",0049:"Wolf Medal",004A:"G. Cogwheel",004B:"Manhole Opener",004C:"Main Fuse",004D:"Fuse Case",004E:"Vaccine",004F:"Vaccine Cart.",0050:"Film",0051:"Base Vaccine",0052:"G-Virus",0053:"Special Key",0054:"Joint S Plug",0055:"Joint N Plug",0056:"Cord",0057:"Film",0058:"Cabin Key",0059:"Precinct Key (blue)",005A:"Precinct Key (red)",005B:"Precinct Key (?)",005C:"Precinct Key (green)",005D:"C. Panel Key (red)",005E:"C. Panel Key (yellow)",005F:"P. Room Key",0060:"MO Disk",0061:"Lab Card Key",0062:"Master Key",0063:"Platform Key",0064:"No Item",0065:"No Item",0066:"No Item",0067:"No Item",0068:"Chris's Diary",0069:"Mail to Chris",006A:"Memo to Leon",006B:"Police Memorandum",006C:"Operation Report 1",006D:"Mail to the Chief",006E:"Mail to the Chief (?)",006F:"Secretary's Diary A",0070:"Secretary's Diary B",0071:"Operation Report 2",0072:"User Registration",0073:"Film A",0074:"Film B",0075:"Film C",0076:"Patrol Report",0077:"Watchman's Diary",0078:"Chief's Diary",0079:"Sewer Manager Diary",007A:"Sewer Manager Fax",007B:"Film D",007C:"Vaccine Synthesis",007D:"Lab Security Manual",007E:"P-Epsilon Report",007F:"Rookie Files",0080:"Rookie Files (?)",0081:"No Item",0082:"Spade Key",0083:"Diamond Key",0084:"Desk Key",0085:"Heart Key",0086:"Club Key",0087:"Virgin Heart",0088:"Square Crank",0089:"Down Key",008A:"Up Key",008B:"Locker Key" + 800E59CD 00FF + cn Max Item Modifier\Slot 03 + 800E59D0 ???? 0000:"Nothing",0001:"Knife Hunk",0002:"Handgun Hunk",0003:"Handgun Different Ada",0004:"Custom Handgun Hunk",0005:"Magnum Hunk",0006:"Custom Magnum Hunk",0007:"Shotgun Hunk",0008:"Custom Shotgun Hunk",0009:"Grenade Launcher Claire",000A:"Grenade Launcher (Flame Rounds) Claire",000B:"Grenade Launcher (Acid Rounds) Claire",000C:"Bowgun Claire",000D:"Colt S.A.A. Claire",000E:"Spark Shot Claire",000F:"Sub Machine Gun Leon",0010:"Flamethrower Leon",0011:"Rocket Launcher Claire",0012:"Gatling Gun Claire",0013:"Machine Gun ???",0014:"Handgun Bullets",0015:"Shotgun Shells",0016:"Magnum Bullets",0017:"Fuel",0018:"Grenade Rounds",0019:"Flame Rounds",001A:"Acid Rounds",001B:"Machine Gun Bullets",001C:"S. Shot Bullets",001D:"Bow Gun Bolts",001E:"Ink Ribbon",001F:"Small Key",0020:"Hand Gun Parts",0021:"Magnum Parts",0022:"Shotgun Parts",0023:"First Aid Spray",0024:"Chemical FR-W09",0025:"Chemical AC-W24",0026:"Green Herb",0027:"Red Herb",0028:"Blue Herb",0029:"Mixed Herb (Green)",002A:"Mixed Herb (Red&Green)",002B:"Mixed Herb (Blue&Green)",002C:"Mixed Herb (?)",002D:"Mixed Herb (?)",002E:"Mixed Herb (?)",002F:"Lighter",0030:"Lock Pick",0031:"Picture",0032:"Valve Handle",0033:"Red Jewel",0034:"Red Card Key",0035:"Blue Card Key",0036:"Serpent Stone",0037:"Jaguar Stone",0038:"Blue Stone",0039:"Blue Stone (?)",003A:"Eagle Stone",003B:"Bishop Plug",003C:"Rook Plug",003D:"Knight Plug",003E:"King Plug",003F:"W. Box Key",0040:"Detonator",0041:"Plastic Bomb",0042:"Bomb&Detonator",0043:"Crank",0044:"Film",0045:"Film (?)",0046:"Film (?)",0047:"Unicorn Medal",0048:"Eagle Medal",0049:"Wolf Medal",004A:"G. Cogwheel",004B:"Manhole Opener",004C:"Main Fuse",004D:"Fuse Case",004E:"Vaccine",004F:"Vaccine Cart.",0050:"Film",0051:"Base Vaccine",0052:"G-Virus",0053:"Special Key",0054:"Joint S Plug",0055:"Joint N Plug",0056:"Cord",0057:"Film",0058:"Cabin Key",0059:"Precinct Key (blue)",005A:"Precinct Key (red)",005B:"Precinct Key (?)",005C:"Precinct Key (green)",005D:"C. Panel Key (red)",005E:"C. Panel Key (yellow)",005F:"P. Room Key",0060:"MO Disk",0061:"Lab Card Key",0062:"Master Key",0063:"Platform Key",0064:"No Item",0065:"No Item",0066:"No Item",0067:"No Item",0068:"Chris's Diary",0069:"Mail to Chris",006A:"Memo to Leon",006B:"Police Memorandum",006C:"Operation Report 1",006D:"Mail to the Chief",006E:"Mail to the Chief (?)",006F:"Secretary's Diary A",0070:"Secretary's Diary B",0071:"Operation Report 2",0072:"User Registration",0073:"Film A",0074:"Film B",0075:"Film C",0076:"Patrol Report",0077:"Watchman's Diary",0078:"Chief's Diary",0079:"Sewer Manager Diary",007A:"Sewer Manager Fax",007B:"Film D",007C:"Vaccine Synthesis",007D:"Lab Security Manual",007E:"P-Epsilon Report",007F:"Rookie Files",0080:"Rookie Files (?)",0081:"No Item",0082:"Spade Key",0083:"Diamond Key",0084:"Desk Key",0085:"Heart Key",0086:"Club Key",0087:"Virgin Heart",0088:"Square Crank",0089:"Down Key",008A:"Up Key",008B:"Locker Key" + 800E59D1 00FF + cn Max Item Modifier\Slot 04 + 800E59D4 ???? 0000:"Nothing",0001:"Knife Hunk",0002:"Handgun Hunk",0003:"Handgun Different Ada",0004:"Custom Handgun Hunk",0005:"Magnum Hunk",0006:"Custom Magnum Hunk",0007:"Shotgun Hunk",0008:"Custom Shotgun Hunk",0009:"Grenade Launcher Claire",000A:"Grenade Launcher (Flame Rounds) Claire",000B:"Grenade Launcher (Acid Rounds) Claire",000C:"Bowgun Claire",000D:"Colt S.A.A. Claire",000E:"Spark Shot Claire",000F:"Sub Machine Gun Leon",0010:"Flamethrower Leon",0011:"Rocket Launcher Claire",0012:"Gatling Gun Claire",0013:"Machine Gun ???",0014:"Handgun Bullets",0015:"Shotgun Shells",0016:"Magnum Bullets",0017:"Fuel",0018:"Grenade Rounds",0019:"Flame Rounds",001A:"Acid Rounds",001B:"Machine Gun Bullets",001C:"S. Shot Bullets",001D:"Bow Gun Bolts",001E:"Ink Ribbon",001F:"Small Key",0020:"Hand Gun Parts",0021:"Magnum Parts",0022:"Shotgun Parts",0023:"First Aid Spray",0024:"Chemical FR-W09",0025:"Chemical AC-W24",0026:"Green Herb",0027:"Red Herb",0028:"Blue Herb",0029:"Mixed Herb (Green)",002A:"Mixed Herb (Red&Green)",002B:"Mixed Herb (Blue&Green)",002C:"Mixed Herb (?)",002D:"Mixed Herb (?)",002E:"Mixed Herb (?)",002F:"Lighter",0030:"Lock Pick",0031:"Picture",0032:"Valve Handle",0033:"Red Jewel",0034:"Red Card Key",0035:"Blue Card Key",0036:"Serpent Stone",0037:"Jaguar Stone",0038:"Blue Stone",0039:"Blue Stone (?)",003A:"Eagle Stone",003B:"Bishop Plug",003C:"Rook Plug",003D:"Knight Plug",003E:"King Plug",003F:"W. Box Key",0040:"Detonator",0041:"Plastic Bomb",0042:"Bomb&Detonator",0043:"Crank",0044:"Film",0045:"Film (?)",0046:"Film (?)",0047:"Unicorn Medal",0048:"Eagle Medal",0049:"Wolf Medal",004A:"G. Cogwheel",004B:"Manhole Opener",004C:"Main Fuse",004D:"Fuse Case",004E:"Vaccine",004F:"Vaccine Cart.",0050:"Film",0051:"Base Vaccine",0052:"G-Virus",0053:"Special Key",0054:"Joint S Plug",0055:"Joint N Plug",0056:"Cord",0057:"Film",0058:"Cabin Key",0059:"Precinct Key (blue)",005A:"Precinct Key (red)",005B:"Precinct Key (?)",005C:"Precinct Key (green)",005D:"C. Panel Key (red)",005E:"C. Panel Key (yellow)",005F:"P. Room Key",0060:"MO Disk",0061:"Lab Card Key",0062:"Master Key",0063:"Platform Key",0064:"No Item",0065:"No Item",0066:"No Item",0067:"No Item",0068:"Chris's Diary",0069:"Mail to Chris",006A:"Memo to Leon",006B:"Police Memorandum",006C:"Operation Report 1",006D:"Mail to the Chief",006E:"Mail to the Chief (?)",006F:"Secretary's Diary A",0070:"Secretary's Diary B",0071:"Operation Report 2",0072:"User Registration",0073:"Film A",0074:"Film B",0075:"Film C",0076:"Patrol Report",0077:"Watchman's Diary",0078:"Chief's Diary",0079:"Sewer Manager Diary",007A:"Sewer Manager Fax",007B:"Film D",007C:"Vaccine Synthesis",007D:"Lab Security Manual",007E:"P-Epsilon Report",007F:"Rookie Files",0080:"Rookie Files (?)",0081:"No Item",0082:"Spade Key",0083:"Diamond Key",0084:"Desk Key",0085:"Heart Key",0086:"Club Key",0087:"Virgin Heart",0088:"Square Crank",0089:"Down Key",008A:"Up Key",008B:"Locker Key" + 800E59D5 00FF + cn Max Item Modifier\Slot 05 + 800E59D8 ???? 0000:"Nothing",0001:"Knife Hunk",0002:"Handgun Hunk",0003:"Handgun Different Ada",0004:"Custom Handgun Hunk",0005:"Magnum Hunk",0006:"Custom Magnum Hunk",0007:"Shotgun Hunk",0008:"Custom Shotgun Hunk",0009:"Grenade Launcher Claire",000A:"Grenade Launcher (Flame Rounds) Claire",000B:"Grenade Launcher (Acid Rounds) Claire",000C:"Bowgun Claire",000D:"Colt S.A.A. Claire",000E:"Spark Shot Claire",000F:"Sub Machine Gun Leon",0010:"Flamethrower Leon",0011:"Rocket Launcher Claire",0012:"Gatling Gun Claire",0013:"Machine Gun ???",0014:"Handgun Bullets",0015:"Shotgun Shells",0016:"Magnum Bullets",0017:"Fuel",0018:"Grenade Rounds",0019:"Flame Rounds",001A:"Acid Rounds",001B:"Machine Gun Bullets",001C:"S. Shot Bullets",001D:"Bow Gun Bolts",001E:"Ink Ribbon",001F:"Small Key",0020:"Hand Gun Parts",0021:"Magnum Parts",0022:"Shotgun Parts",0023:"First Aid Spray",0024:"Chemical FR-W09",0025:"Chemical AC-W24",0026:"Green Herb",0027:"Red Herb",0028:"Blue Herb",0029:"Mixed Herb (Green)",002A:"Mixed Herb (Red&Green)",002B:"Mixed Herb (Blue&Green)",002C:"Mixed Herb (?)",002D:"Mixed Herb (?)",002E:"Mixed Herb (?)",002F:"Lighter",0030:"Lock Pick",0031:"Picture",0032:"Valve Handle",0033:"Red Jewel",0034:"Red Card Key",0035:"Blue Card Key",0036:"Serpent Stone",0037:"Jaguar Stone",0038:"Blue Stone",0039:"Blue Stone (?)",003A:"Eagle Stone",003B:"Bishop Plug",003C:"Rook Plug",003D:"Knight Plug",003E:"King Plug",003F:"W. Box Key",0040:"Detonator",0041:"Plastic Bomb",0042:"Bomb&Detonator",0043:"Crank",0044:"Film",0045:"Film (?)",0046:"Film (?)",0047:"Unicorn Medal",0048:"Eagle Medal",0049:"Wolf Medal",004A:"G. Cogwheel",004B:"Manhole Opener",004C:"Main Fuse",004D:"Fuse Case",004E:"Vaccine",004F:"Vaccine Cart.",0050:"Film",0051:"Base Vaccine",0052:"G-Virus",0053:"Special Key",0054:"Joint S Plug",0055:"Joint N Plug",0056:"Cord",0057:"Film",0058:"Cabin Key",0059:"Precinct Key (blue)",005A:"Precinct Key (red)",005B:"Precinct Key (?)",005C:"Precinct Key (green)",005D:"C. Panel Key (red)",005E:"C. Panel Key (yellow)",005F:"P. Room Key",0060:"MO Disk",0061:"Lab Card Key",0062:"Master Key",0063:"Platform Key",0064:"No Item",0065:"No Item",0066:"No Item",0067:"No Item",0068:"Chris's Diary",0069:"Mail to Chris",006A:"Memo to Leon",006B:"Police Memorandum",006C:"Operation Report 1",006D:"Mail to the Chief",006E:"Mail to the Chief (?)",006F:"Secretary's Diary A",0070:"Secretary's Diary B",0071:"Operation Report 2",0072:"User Registration",0073:"Film A",0074:"Film B",0075:"Film C",0076:"Patrol Report",0077:"Watchman's Diary",0078:"Chief's Diary",0079:"Sewer Manager Diary",007A:"Sewer Manager Fax",007B:"Film D",007C:"Vaccine Synthesis",007D:"Lab Security Manual",007E:"P-Epsilon Report",007F:"Rookie Files",0080:"Rookie Files (?)",0081:"No Item",0082:"Spade Key",0083:"Diamond Key",0084:"Desk Key",0085:"Heart Key",0086:"Club Key",0087:"Virgin Heart",0088:"Square Crank",0089:"Down Key",008A:"Up Key",008B:"Locker Key" + 800E59D9 00FF + cn Max Item Modifier\Slot 06 + 800E59DC ???? 0000:"Nothing",0001:"Knife Hunk",0002:"Handgun Hunk",0003:"Handgun Different Ada",0004:"Custom Handgun Hunk",0005:"Magnum Hunk",0006:"Custom Magnum Hunk",0007:"Shotgun Hunk",0008:"Custom Shotgun Hunk",0009:"Grenade Launcher Claire",000A:"Grenade Launcher (Flame Rounds) Claire",000B:"Grenade Launcher (Acid Rounds) Claire",000C:"Bowgun Claire",000D:"Colt S.A.A. Claire",000E:"Spark Shot Claire",000F:"Sub Machine Gun Leon",0010:"Flamethrower Leon",0011:"Rocket Launcher Claire",0012:"Gatling Gun Claire",0013:"Machine Gun ???",0014:"Handgun Bullets",0015:"Shotgun Shells",0016:"Magnum Bullets",0017:"Fuel",0018:"Grenade Rounds",0019:"Flame Rounds",001A:"Acid Rounds",001B:"Machine Gun Bullets",001C:"S. Shot Bullets",001D:"Bow Gun Bolts",001E:"Ink Ribbon",001F:"Small Key",0020:"Hand Gun Parts",0021:"Magnum Parts",0022:"Shotgun Parts",0023:"First Aid Spray",0024:"Chemical FR-W09",0025:"Chemical AC-W24",0026:"Green Herb",0027:"Red Herb",0028:"Blue Herb",0029:"Mixed Herb (Green)",002A:"Mixed Herb (Red&Green)",002B:"Mixed Herb (Blue&Green)",002C:"Mixed Herb (?)",002D:"Mixed Herb (?)",002E:"Mixed Herb (?)",002F:"Lighter",0030:"Lock Pick",0031:"Picture",0032:"Valve Handle",0033:"Red Jewel",0034:"Red Card Key",0035:"Blue Card Key",0036:"Serpent Stone",0037:"Jaguar Stone",0038:"Blue Stone",0039:"Blue Stone (?)",003A:"Eagle Stone",003B:"Bishop Plug",003C:"Rook Plug",003D:"Knight Plug",003E:"King Plug",003F:"W. Box Key",0040:"Detonator",0041:"Plastic Bomb",0042:"Bomb&Detonator",0043:"Crank",0044:"Film",0045:"Film (?)",0046:"Film (?)",0047:"Unicorn Medal",0048:"Eagle Medal",0049:"Wolf Medal",004A:"G. Cogwheel",004B:"Manhole Opener",004C:"Main Fuse",004D:"Fuse Case",004E:"Vaccine",004F:"Vaccine Cart.",0050:"Film",0051:"Base Vaccine",0052:"G-Virus",0053:"Special Key",0054:"Joint S Plug",0055:"Joint N Plug",0056:"Cord",0057:"Film",0058:"Cabin Key",0059:"Precinct Key (blue)",005A:"Precinct Key (red)",005B:"Precinct Key (?)",005C:"Precinct Key (green)",005D:"C. Panel Key (red)",005E:"C. Panel Key (yellow)",005F:"P. Room Key",0060:"MO Disk",0061:"Lab Card Key",0062:"Master Key",0063:"Platform Key",0064:"No Item",0065:"No Item",0066:"No Item",0067:"No Item",0068:"Chris's Diary",0069:"Mail to Chris",006A:"Memo to Leon",006B:"Police Memorandum",006C:"Operation Report 1",006D:"Mail to the Chief",006E:"Mail to the Chief (?)",006F:"Secretary's Diary A",0070:"Secretary's Diary B",0071:"Operation Report 2",0072:"User Registration",0073:"Film A",0074:"Film B",0075:"Film C",0076:"Patrol Report",0077:"Watchman's Diary",0078:"Chief's Diary",0079:"Sewer Manager Diary",007A:"Sewer Manager Fax",007B:"Film D",007C:"Vaccine Synthesis",007D:"Lab Security Manual",007E:"P-Epsilon Report",007F:"Rookie Files",0080:"Rookie Files (?)",0081:"No Item",0082:"Spade Key",0083:"Diamond Key",0084:"Desk Key",0085:"Heart Key",0086:"Club Key",0087:"Virgin Heart",0088:"Square Crank",0089:"Down Key",008A:"Up Key",008B:"Locker Key" + 800E59DD 00FF + cn Max Item Modifier\Slot 07 + 800E59E0 ???? 0000:"Nothing",0001:"Knife Hunk",0002:"Handgun Hunk",0003:"Handgun Different Ada",0004:"Custom Handgun Hunk",0005:"Magnum Hunk",0006:"Custom Magnum Hunk",0007:"Shotgun Hunk",0008:"Custom Shotgun Hunk",0009:"Grenade Launcher Claire",000A:"Grenade Launcher (Flame Rounds) Claire",000B:"Grenade Launcher (Acid Rounds) Claire",000C:"Bowgun Claire",000D:"Colt S.A.A. Claire",000E:"Spark Shot Claire",000F:"Sub Machine Gun Leon",0010:"Flamethrower Leon",0011:"Rocket Launcher Claire",0012:"Gatling Gun Claire",0013:"Machine Gun ???",0014:"Handgun Bullets",0015:"Shotgun Shells",0016:"Magnum Bullets",0017:"Fuel",0018:"Grenade Rounds",0019:"Flame Rounds",001A:"Acid Rounds",001B:"Machine Gun Bullets",001C:"S. Shot Bullets",001D:"Bow Gun Bolts",001E:"Ink Ribbon",001F:"Small Key",0020:"Hand Gun Parts",0021:"Magnum Parts",0022:"Shotgun Parts",0023:"First Aid Spray",0024:"Chemical FR-W09",0025:"Chemical AC-W24",0026:"Green Herb",0027:"Red Herb",0028:"Blue Herb",0029:"Mixed Herb (Green)",002A:"Mixed Herb (Red&Green)",002B:"Mixed Herb (Blue&Green)",002C:"Mixed Herb (?)",002D:"Mixed Herb (?)",002E:"Mixed Herb (?)",002F:"Lighter",0030:"Lock Pick",0031:"Picture",0032:"Valve Handle",0033:"Red Jewel",0034:"Red Card Key",0035:"Blue Card Key",0036:"Serpent Stone",0037:"Jaguar Stone",0038:"Blue Stone",0039:"Blue Stone (?)",003A:"Eagle Stone",003B:"Bishop Plug",003C:"Rook Plug",003D:"Knight Plug",003E:"King Plug",003F:"W. Box Key",0040:"Detonator",0041:"Plastic Bomb",0042:"Bomb&Detonator",0043:"Crank",0044:"Film",0045:"Film (?)",0046:"Film (?)",0047:"Unicorn Medal",0048:"Eagle Medal",0049:"Wolf Medal",004A:"G. Cogwheel",004B:"Manhole Opener",004C:"Main Fuse",004D:"Fuse Case",004E:"Vaccine",004F:"Vaccine Cart.",0050:"Film",0051:"Base Vaccine",0052:"G-Virus",0053:"Special Key",0054:"Joint S Plug",0055:"Joint N Plug",0056:"Cord",0057:"Film",0058:"Cabin Key",0059:"Precinct Key (blue)",005A:"Precinct Key (red)",005B:"Precinct Key (?)",005C:"Precinct Key (green)",005D:"C. Panel Key (red)",005E:"C. Panel Key (yellow)",005F:"P. Room Key",0060:"MO Disk",0061:"Lab Card Key",0062:"Master Key",0063:"Platform Key",0064:"No Item",0065:"No Item",0066:"No Item",0067:"No Item",0068:"Chris's Diary",0069:"Mail to Chris",006A:"Memo to Leon",006B:"Police Memorandum",006C:"Operation Report 1",006D:"Mail to the Chief",006E:"Mail to the Chief (?)",006F:"Secretary's Diary A",0070:"Secretary's Diary B",0071:"Operation Report 2",0072:"User Registration",0073:"Film A",0074:"Film B",0075:"Film C",0076:"Patrol Report",0077:"Watchman's Diary",0078:"Chief's Diary",0079:"Sewer Manager Diary",007A:"Sewer Manager Fax",007B:"Film D",007C:"Vaccine Synthesis",007D:"Lab Security Manual",007E:"P-Epsilon Report",007F:"Rookie Files",0080:"Rookie Files (?)",0081:"No Item",0082:"Spade Key",0083:"Diamond Key",0084:"Desk Key",0085:"Heart Key",0086:"Club Key",0087:"Virgin Heart",0088:"Square Crank",0089:"Down Key",008A:"Up Key",008B:"Locker Key" + 800E59E1 00FF + cn Max Item Modifier\Slot 08 + 800E59E4 ???? 0000:"Nothing",0001:"Knife Hunk",0002:"Handgun Hunk",0003:"Handgun Different Ada",0004:"Custom Handgun Hunk",0005:"Magnum Hunk",0006:"Custom Magnum Hunk",0007:"Shotgun Hunk",0008:"Custom Shotgun Hunk",0009:"Grenade Launcher Claire",000A:"Grenade Launcher (Flame Rounds) Claire",000B:"Grenade Launcher (Acid Rounds) Claire",000C:"Bowgun Claire",000D:"Colt S.A.A. Claire",000E:"Spark Shot Claire",000F:"Sub Machine Gun Leon",0010:"Flamethrower Leon",0011:"Rocket Launcher Claire",0012:"Gatling Gun Claire",0013:"Machine Gun ???",0014:"Handgun Bullets",0015:"Shotgun Shells",0016:"Magnum Bullets",0017:"Fuel",0018:"Grenade Rounds",0019:"Flame Rounds",001A:"Acid Rounds",001B:"Machine Gun Bullets",001C:"S. Shot Bullets",001D:"Bow Gun Bolts",001E:"Ink Ribbon",001F:"Small Key",0020:"Hand Gun Parts",0021:"Magnum Parts",0022:"Shotgun Parts",0023:"First Aid Spray",0024:"Chemical FR-W09",0025:"Chemical AC-W24",0026:"Green Herb",0027:"Red Herb",0028:"Blue Herb",0029:"Mixed Herb (Green)",002A:"Mixed Herb (Red&Green)",002B:"Mixed Herb (Blue&Green)",002C:"Mixed Herb (?)",002D:"Mixed Herb (?)",002E:"Mixed Herb (?)",002F:"Lighter",0030:"Lock Pick",0031:"Picture",0032:"Valve Handle",0033:"Red Jewel",0034:"Red Card Key",0035:"Blue Card Key",0036:"Serpent Stone",0037:"Jaguar Stone",0038:"Blue Stone",0039:"Blue Stone (?)",003A:"Eagle Stone",003B:"Bishop Plug",003C:"Rook Plug",003D:"Knight Plug",003E:"King Plug",003F:"W. Box Key",0040:"Detonator",0041:"Plastic Bomb",0042:"Bomb&Detonator",0043:"Crank",0044:"Film",0045:"Film (?)",0046:"Film (?)",0047:"Unicorn Medal",0048:"Eagle Medal",0049:"Wolf Medal",004A:"G. Cogwheel",004B:"Manhole Opener",004C:"Main Fuse",004D:"Fuse Case",004E:"Vaccine",004F:"Vaccine Cart.",0050:"Film",0051:"Base Vaccine",0052:"G-Virus",0053:"Special Key",0054:"Joint S Plug",0055:"Joint N Plug",0056:"Cord",0057:"Film",0058:"Cabin Key",0059:"Precinct Key (blue)",005A:"Precinct Key (red)",005B:"Precinct Key (?)",005C:"Precinct Key (green)",005D:"C. Panel Key (red)",005E:"C. Panel Key (yellow)",005F:"P. Room Key",0060:"MO Disk",0061:"Lab Card Key",0062:"Master Key",0063:"Platform Key",0064:"No Item",0065:"No Item",0066:"No Item",0067:"No Item",0068:"Chris's Diary",0069:"Mail to Chris",006A:"Memo to Leon",006B:"Police Memorandum",006C:"Operation Report 1",006D:"Mail to the Chief",006E:"Mail to the Chief (?)",006F:"Secretary's Diary A",0070:"Secretary's Diary B",0071:"Operation Report 2",0072:"User Registration",0073:"Film A",0074:"Film B",0075:"Film C",0076:"Patrol Report",0077:"Watchman's Diary",0078:"Chief's Diary",0079:"Sewer Manager Diary",007A:"Sewer Manager Fax",007B:"Film D",007C:"Vaccine Synthesis",007D:"Lab Security Manual",007E:"P-Epsilon Report",007F:"Rookie Files",0080:"Rookie Files (?)",0081:"No Item",0082:"Spade Key",0083:"Diamond Key",0084:"Desk Key",0085:"Heart Key",0086:"Club Key",0087:"Virgin Heart",0088:"Square Crank",0089:"Down Key",008A:"Up Key",008B:"Locker Key" + 800E59E5 00FF + cn Max Item Modifier\Slot 09 + 800E59E8 ???? 0000:"Nothing",0001:"Knife Hunk",0002:"Handgun Hunk",0003:"Handgun Different Ada",0004:"Custom Handgun Hunk",0005:"Magnum Hunk",0006:"Custom Magnum Hunk",0007:"Shotgun Hunk",0008:"Custom Shotgun Hunk",0009:"Grenade Launcher Claire",000A:"Grenade Launcher (Flame Rounds) Claire",000B:"Grenade Launcher (Acid Rounds) Claire",000C:"Bowgun Claire",000D:"Colt S.A.A. Claire",000E:"Spark Shot Claire",000F:"Sub Machine Gun Leon",0010:"Flamethrower Leon",0011:"Rocket Launcher Claire",0012:"Gatling Gun Claire",0013:"Machine Gun ???",0014:"Handgun Bullets",0015:"Shotgun Shells",0016:"Magnum Bullets",0017:"Fuel",0018:"Grenade Rounds",0019:"Flame Rounds",001A:"Acid Rounds",001B:"Machine Gun Bullets",001C:"S. Shot Bullets",001D:"Bow Gun Bolts",001E:"Ink Ribbon",001F:"Small Key",0020:"Hand Gun Parts",0021:"Magnum Parts",0022:"Shotgun Parts",0023:"First Aid Spray",0024:"Chemical FR-W09",0025:"Chemical AC-W24",0026:"Green Herb",0027:"Red Herb",0028:"Blue Herb",0029:"Mixed Herb (Green)",002A:"Mixed Herb (Red&Green)",002B:"Mixed Herb (Blue&Green)",002C:"Mixed Herb (?)",002D:"Mixed Herb (?)",002E:"Mixed Herb (?)",002F:"Lighter",0030:"Lock Pick",0031:"Picture",0032:"Valve Handle",0033:"Red Jewel",0034:"Red Card Key",0035:"Blue Card Key",0036:"Serpent Stone",0037:"Jaguar Stone",0038:"Blue Stone",0039:"Blue Stone (?)",003A:"Eagle Stone",003B:"Bishop Plug",003C:"Rook Plug",003D:"Knight Plug",003E:"King Plug",003F:"W. Box Key",0040:"Detonator",0041:"Plastic Bomb",0042:"Bomb&Detonator",0043:"Crank",0044:"Film",0045:"Film (?)",0046:"Film (?)",0047:"Unicorn Medal",0048:"Eagle Medal",0049:"Wolf Medal",004A:"G. Cogwheel",004B:"Manhole Opener",004C:"Main Fuse",004D:"Fuse Case",004E:"Vaccine",004F:"Vaccine Cart.",0050:"Film",0051:"Base Vaccine",0052:"G-Virus",0053:"Special Key",0054:"Joint S Plug",0055:"Joint N Plug",0056:"Cord",0057:"Film",0058:"Cabin Key",0059:"Precinct Key (blue)",005A:"Precinct Key (red)",005B:"Precinct Key (?)",005C:"Precinct Key (green)",005D:"C. Panel Key (red)",005E:"C. Panel Key (yellow)",005F:"P. Room Key",0060:"MO Disk",0061:"Lab Card Key",0062:"Master Key",0063:"Platform Key",0064:"No Item",0065:"No Item",0066:"No Item",0067:"No Item",0068:"Chris's Diary",0069:"Mail to Chris",006A:"Memo to Leon",006B:"Police Memorandum",006C:"Operation Report 1",006D:"Mail to the Chief",006E:"Mail to the Chief (?)",006F:"Secretary's Diary A",0070:"Secretary's Diary B",0071:"Operation Report 2",0072:"User Registration",0073:"Film A",0074:"Film B",0075:"Film C",0076:"Patrol Report",0077:"Watchman's Diary",0078:"Chief's Diary",0079:"Sewer Manager Diary",007A:"Sewer Manager Fax",007B:"Film D",007C:"Vaccine Synthesis",007D:"Lab Security Manual",007E:"P-Epsilon Report",007F:"Rookie Files",0080:"Rookie Files (?)",0081:"No Item",0082:"Spade Key",0083:"Diamond Key",0084:"Desk Key",0085:"Heart Key",0086:"Club Key",0087:"Virgin Heart",0088:"Square Crank",0089:"Down Key",008A:"Up Key",008B:"Locker Key" + 800E59E9 00FF + cn Max Item Modifier\Slot 10 + 800E59EC ???? 0000:"Nothing",0001:"Knife Hunk",0002:"Handgun Hunk",0003:"Handgun Different Ada",0004:"Custom Handgun Hunk",0005:"Magnum Hunk",0006:"Custom Magnum Hunk",0007:"Shotgun Hunk",0008:"Custom Shotgun Hunk",0009:"Grenade Launcher Claire",000A:"Grenade Launcher (Flame Rounds) Claire",000B:"Grenade Launcher (Acid Rounds) Claire",000C:"Bowgun Claire",000D:"Colt S.A.A. Claire",000E:"Spark Shot Claire",000F:"Sub Machine Gun Leon",0010:"Flamethrower Leon",0011:"Rocket Launcher Claire",0012:"Gatling Gun Claire",0013:"Machine Gun ???",0014:"Handgun Bullets",0015:"Shotgun Shells",0016:"Magnum Bullets",0017:"Fuel",0018:"Grenade Rounds",0019:"Flame Rounds",001A:"Acid Rounds",001B:"Machine Gun Bullets",001C:"S. Shot Bullets",001D:"Bow Gun Bolts",001E:"Ink Ribbon",001F:"Small Key",0020:"Hand Gun Parts",0021:"Magnum Parts",0022:"Shotgun Parts",0023:"First Aid Spray",0024:"Chemical FR-W09",0025:"Chemical AC-W24",0026:"Green Herb",0027:"Red Herb",0028:"Blue Herb",0029:"Mixed Herb (Green)",002A:"Mixed Herb (Red&Green)",002B:"Mixed Herb (Blue&Green)",002C:"Mixed Herb (?)",002D:"Mixed Herb (?)",002E:"Mixed Herb (?)",002F:"Lighter",0030:"Lock Pick",0031:"Picture",0032:"Valve Handle",0033:"Red Jewel",0034:"Red Card Key",0035:"Blue Card Key",0036:"Serpent Stone",0037:"Jaguar Stone",0038:"Blue Stone",0039:"Blue Stone (?)",003A:"Eagle Stone",003B:"Bishop Plug",003C:"Rook Plug",003D:"Knight Plug",003E:"King Plug",003F:"W. Box Key",0040:"Detonator",0041:"Plastic Bomb",0042:"Bomb&Detonator",0043:"Crank",0044:"Film",0045:"Film (?)",0046:"Film (?)",0047:"Unicorn Medal",0048:"Eagle Medal",0049:"Wolf Medal",004A:"G. Cogwheel",004B:"Manhole Opener",004C:"Main Fuse",004D:"Fuse Case",004E:"Vaccine",004F:"Vaccine Cart.",0050:"Film",0051:"Base Vaccine",0052:"G-Virus",0053:"Special Key",0054:"Joint S Plug",0055:"Joint N Plug",0056:"Cord",0057:"Film",0058:"Cabin Key",0059:"Precinct Key (blue)",005A:"Precinct Key (red)",005B:"Precinct Key (?)",005C:"Precinct Key (green)",005D:"C. Panel Key (red)",005E:"C. Panel Key (yellow)",005F:"P. Room Key",0060:"MO Disk",0061:"Lab Card Key",0062:"Master Key",0063:"Platform Key",0064:"No Item",0065:"No Item",0066:"No Item",0067:"No Item",0068:"Chris's Diary",0069:"Mail to Chris",006A:"Memo to Leon",006B:"Police Memorandum",006C:"Operation Report 1",006D:"Mail to the Chief",006E:"Mail to the Chief (?)",006F:"Secretary's Diary A",0070:"Secretary's Diary B",0071:"Operation Report 2",0072:"User Registration",0073:"Film A",0074:"Film B",0075:"Film C",0076:"Patrol Report",0077:"Watchman's Diary",0078:"Chief's Diary",0079:"Sewer Manager Diary",007A:"Sewer Manager Fax",007B:"Film D",007C:"Vaccine Synthesis",007D:"Lab Security Manual",007E:"P-Epsilon Report",007F:"Rookie Files",0080:"Rookie Files (?)",0081:"No Item",0082:"Spade Key",0083:"Diamond Key",0084:"Desk Key",0085:"Heart Key",0086:"Club Key",0087:"Virgin Heart",0088:"Square Crank",0089:"Down Key",008A:"Up Key",008B:"Locker Key" + 800E59ED 00FF + +crc C3E7E29E-5D7251CC-C:50 +gn Re-Volt (E) + cn Access All\Cars & Tracks + 8104ADF6 0001 + cn Access All\Cups + 5000032C 0000 + 8105444A 00FF + cn Always 1st + 811157AE 0001 + 811157B6 0000 + 8110C33E 02F4 + cn Infinite Continues + 8110C332 0006 + cn Drones Have No Weapons + 8111CECE 0000 + cn Infinite Weapons\Player 1 + 81115798 0000 + 8111579A ???? 0000:"Green Missile",0001:"Orange Missile",0002:"Multi-Orange Missiles",0003:"The Bomb",0004:"Water Balloon",0005:"Blue Protector",0006:"Oil Slick",0007:"Bowling Ball Mine",0008:"Yellow Protector",0009:"Lightning Bolt",000A:"Orange Star",000B:"Beach Ball" + 8111579E 0001 + cn Laps To Race + 8107DD1E ???? 0001:"1 Lap",0002:"2 laps",0003:"3 Laps",0004:"4 Laps",0005:"5 Laps",0006:"6 Laps",0007:"7 Laps",0008:"8 Laps",0009:"9 Laps" + cn Number Of Drones In The Race + 8110FFF6 ???? 0001:"1 Drone",0002:"2 Drones",0003:"3 Drones",0004:"4 Drones",0005:"5 Drones",0006:"6 Drones",0007:"7 Drones",0008:"8 Drones",0009:"9 Drones" + cn 99 Points Player 1 + 8010C33F 0063 + cn Infinite Weapons\Player 2 + 81117C60 0000 + 81117C62 ???? 0000:"Green Missile",0001:"Orange Missile",0002:"Multi-Orange Missiles",0003:"The Bomb",0004:"Water Balloon",0005:"Blue Protector",0006:"Oil Slick",0007:"Bowling Ball Mine",0008:"Yellow Protector",0009:"Lightning Bolt",000A:"Orange Star",000B:"Beach Ball" + 81117C66 0001 + cn Infinite Weapons\Player 3 + 8111A128 0000 + 8111A12A ???? 0000:"Green Missile",0001:"Orange Missile",0002:"Multi-Orange Missiles",0003:"The Bomb",0004:"Water Balloon",0005:"Blue Protector",0006:"Oil Slick",0007:"Bowling Ball Mine",0008:"Yellow Protector",0009:"Lightning Bolt",000A:"Orange Star",000B:"Beach Ball" + 8111A12E 0001 + cn Infinite Weapons\Player 4 + 8111C5F0 0000 + 8111C5F2 ???? 0000:"Green Missile",0001:"Orange Missile",0002:"Multi-Orange Missiles",0003:"The Bomb",0004:"Water Balloon",0005:"Blue Protector",0006:"Oil Slick",0007:"Bowling Ball Mine",0008:"Yellow Protector",0009:"Lightning Bolt",000A:"Orange Star",000B:"Beach Ball" + 8111C5F6 0001 + +crc 02D8366A-6CABEF9C-C:50 +gn Road Rash 64 (E) + cn Always 1st + 810D7D96 0000 + cn Max Cash + 810D6FBA FFFF + cn Access All Bikes & Tracks + 810A7D16 0063 + cn Access All Weapons For All Modes + 50000E02 0000 + 811B9EFA 0505 + cn Infinite Damage + 801C1257 0002 + cn Infinite Health\To Bike + 811B9BB8 4270 + cn Infinite Health\To Character + 811C0F90 4489 + cn No Music In Game + 810D61AE 0000 + cn No Music Elsewhere + 810D61AA 0000 + +crc 74E87A70-6293AED4-C:50 +gn ROADSTERS TROPHY + cn Always 1st + 800C1F81 0001 + cn Laps To Race + 800A4649 ???? 0001:"1 Lap",0002:"2 laps",0003:"3 Laps",0004:"4 Laps",0005:"5 Laps",0006:"6 Laps",0007:"7 Laps",0008:"8 Laps",0009:"9 Laps" + cn Access All Trophies + cd Also gives you all extra features in quick race & Trophy mode + 800BAA9B 0007 + 800BACAF 0007 + cn Max Race Points + 800BACBE 00FF + cn Have Lots Of Seasons + 810BACAA 02F4 + cn Max Cash + 810BACA4 3AFF + 810BACA6 F3FA + cn Cheats Enabled Modifier + 8108F8F0 ???? 0004:"Fast Bucks (You Get 250",0008:"Easy Money (You Get 1",0010:"Trophies (Second And Third Championships Wins)",0020:"Smurfing (High Pitched Voices)",0040:"Big Wheels (Big Foot Cars)",0080:"Skywalker (Hover Cars)",0100:"Car Radio (Remote Control Cars)",0200:"Chopper (Top Down View)",0400:"Anyway (Race Circuits Backwards)",0800:"Extra Resolution (Able To Change Resolution In Options Screen)" + cn Easy Win + cd Right After Start,Go, Quit Race, And you Have Won + 800BACAD 000A + cn All Cars\Max Upgrade + 5000220C 0200 + 810BAD56 0270 + cn All Cars\Infinite Supply Of Super Tires + 5000220C 0000 + 810BAD58 0F0F + 5000220C 0000 + 810BAD5A 0F0F + cn Special Category A Car\Mind Star 600 + 810BAE8E 3D70 + 810BAE90 0F0F + 810BAE92 0F0F + cn Special Category B Car\Vertige Stallion + 810BAE16 2378 + 810BAE18 0F0F + 810BAE1A 0F0F + cn Special Category C Car\Mind Star 200R + 810BAD86 0A78 + 810BAD88 0F0F + 810BAD8A 0F0F + cn Race Direction Options + 810A4600 ???? 0000:"Normal",0001:"Reverse",0002:"Mirrored Normal",0003:"Mirrored Reverse" + cn View Select + cd Select your View and then at start of Race press C-Up Button + D00C2171 0000 + 800C2171 ???? 0000:"Inside Car",0001:"Behind View",0002:"Further Behind View",000B:"Distant Behind View",00FF:"Helicopter View" + cn Track Select + 8008FA5D ???? 0000:"Rocket Base",0001:"Temple",0002:"Ski Resort",0003:"Lumber Mill",0004:"Area 51",0005:"Oilfields",0006:"Tudor Village",0007:"Chateau",0008:"Docklands",0009:"Titus Park" + +crc 9FF69D4F-195F0059-C:50 +gn Robotron 64 (E) + cn Infinite Lives + 8109B0EE 03E7 + 810AD24E 03E7 + cn Level select + cd Set Up In Menu + 81076FB6 6F74 + cn Fast Run + 8009B14F 0003 + cn Rapid fire + 8009B15F 0003 + cn Easy Difficulty level + 800AD243 0000 + cn Speed level 1 Slow + 800AD247 0000 + +crc 9FD375F8-45F32DC8-C:50 +gn Rocket - Robot on Wheels (E) + cn Infinite & Max Health + 8109FB82 000C + 8109FB84 000A + cn Activate All In-Game Cheats + cd With this code on, all rocket's abilities are now max + 810A6846 F5FF + cn Access All Ticket Switches & Vehicles + 800A5E1F 0001 + 50002004 0000 + 810A5D70 FFFF + +crc 60D5E10B-8BEDED46-C:50 +gn Rayman2 The Great Escape (E) + cn Infinite\Max Health + 811BC54C 001E + cn Infinite\Oxygen + 810F4A80 4396 + cn Open Options\levels & Map + 50000801 0000 + 801F1101 00FF + cn Open Options\Open all cages + 801F1032 0050 + 50000602 0000 + 811F10E0 FFFF + cn Have All\Yellow Lums + 50006401 0000 + 800C6FF8 00FF + 50001901 0000 + 800C6FAD 00FF + 811F1072 0005 + 50005702 0000 + 811F1078 FFFF + cn Have All\Crates + 810C6FE8 7FFF + 50000602 0000 + 810C6FEA FFFF + 800C6FF2 00FF + cn All Masks + cd Press GS To Activate All Masks + 891F1110 8780 + +crc 8BD4A334-1E138B05-C:50 +gn Ready 2 Rumble Boxing (E) + cn Infinite\Health + 810D8E8A ???? + 810E6522 ???? 0064:"Infinite",0000:"No Health" + cn Infinite\Stamina + 810D8E8E ???? + 810E6526 ???? 0064:"Infinite",0000:"No Stamina" + cn Have Max Rumble + 810D8E96 ???? + 810E61B8 ???? 0030:"Max",0000:"Never Rumble" + cn Infinite\Cash + 810EB852 FC9A + cn Infinite\Time + 810E6486 0E10 + +crc FEE97010-4E94A9A0-C:50 +gn RR64 - Ridge Racer 64 (E) + cn Always 1st + 810569B4 0001 + cn Infinite Time + 811280B2 0C00 + cn Freeze Lap Timer + cd Select Car Attack, And You'll Have All The Cars At Your Disposal For A Quick Spin !! + 810569DE 014D + cn Access All\Cars,Tracks & Golg Trophies + 50000402 0000 + 81043AA0 FFFF + cn Access All\Platinum Trophies + 8102F70C FFFF + 8102F70E FFFF + cn Ultra 64 + cd Pick any car, beat stage 8: RR Extreme Extra and the UFO car is yours to drive! + 8113DDBA 0018 + cn Access\Galage '88 UFO Car + 810E2C20 0028 + cn Easy Win + 810569BA 0007 + cn Easy Mode + 81057B10 0001 + cn Freeze Lap Timer + 810569DE 014D + 810569CA 00C7 + 810569CE 00C7 + 810569EA 014D + 810569EE 014D + 810569F2 014D + cn Always Engine Class S + 81043AB0 0000 + cn Laps to Race + cd Here you can choose how many laps are in the race, 1-9. Do not use with Option 7-9. + 8111CA16 ???? 0001:"1 Lap to Race",0002:"2 Laps to Race",0003:"3 Laps to Race",0004:"4 Laps to Race",0005:"5 Laps to Race",0006:"6 Laps to Race",0007:"7 Laps to Race",0008:"8 Laps to Race",0009:"9 Laps to Race" + +crc 4D3ADFDA-7598FCAE-C:50 +gn Rugrats - Treasure Hunt (E) + cn Infinite Energy\Player 1 + 80254A76 001E + 8025CCF6 001E + cn Infinite Energy\Player 2 + 80257B86 001E + 80260846 001E + cn Infinite Energy\Player 3 + 8025ACA6 001E + 802637A6 001E + cn Infinite Energy\Player 4 + 8025E0E6 001E + 80266B76 001E + +crc 0AC61D39-ABFA03A6-C:50 +gn Rugrats in Paris - The Movie (E) + cn Tickets\Red + 8111F8C6 FFFF + cn Tickets\Gold + 8111F8C8 FFFF + cn Access all items In Inventory + 8111F8BE 1FFF + +crc 67D21868-C5424061-C:50 +gn Rakuga Kids (E) + cn Infinite Energy\Player 1 + 800ACB89 ???? 0000:"None",0040:"Max" + cn Infinite Energy\Player 2 + 800ACC79 ???? 0000:"None",003F:"Max" + cn Super Attacks\Player 1 + 800ACB8D ???? 0000:"None",0003:"3" + cn Super Attacks\Player 2 + 800ACC7D ???? 0000:"None",0003:"3" + cn Infinite Match Time + 800ABC33 0000 + cn Unlock Extras + 800ACD55 00FF + 800ACD57 00FF + +crc 918E2D60-F865683E-C:50 +gn S.C.A.R.S. (E) + cn Always 1st + 813E00E8 0001 + cn Access\All Cups + 50000302 0000 + 812CB7C8 0001 + cn Access\All Challenges + 50000502 0000 + 813DD428 0001 + cn Access\All Cars + 50000402 0000 + 813DFC6A 0001 + cn Infinite\Turbo's + 8039B464 0000 + 8039B467 0000 + 8039B469 0009 + cn Infinite\Magnet's + 8039B464 0001 + 8039B467 0001 + 8039B469 0009 + cn Infinite\Stinger's + 8039B464 0003 + 8039B467 0003 + 8039B469 0009 + cn Infinite\Boomerang's + 8039B464 0004 + 8039B467 0004 + 8039B469 0009 + cn Infinite\Seeker's + 8039B464 0005 + 8039B467 0005 + 8039B469 0009 + cn Infinite\Stopper's + 8039B464 0006 + 8039B467 0006 + 8039B469 0009 + cn Infinite\Bullet's + 8039B464 0007 + 8039B467 0007 + 8039B469 0009 + cn Infinite\Shield's + 8039B464 0008 + 8039B467 0008 + 8039B469 0009 + cn Laps To Race + 813BBD5C ???? 0001:"1 Lap",0002:"2 laps",0003:"3 Laps",0004:"4 Laps",0005:"5 Laps",0006:"6 Laps",0007:"7 Laps",0008:"8 Laps",0009:"9 Laps" + cn Infinite\CREDITS + 80388F3D 0003 + cn Psycho Weapons + 8039B469 0003 + 802B85A3 0003 + +crc 61D116B0-FA24D60C-C:50 +gn San Francisco Rush - Extreme Racing (E) + cn Always 1st + 80101409 0000 + cn Max Race Points + 810DACCA 02F4 + cn Laps To Race + 800E7411 ???? 0001:"1 Lap",0002:"2 laps",0003:"3 Laps",0004:"4 Laps",0005:"5 Laps",0006:"6 Laps",0007:"7 Laps",0008:"8 Laps",0009:"9 Laps" + cn Gravity Modifier + 800F3E61 ???? 0000:"Ballon & Two Weights",0001:"One Weight",0002:"Two Weights" + cn No\Car Collisions + 800F4120 0001 + cn No\Auto Abort + 800F4140 0001 + cn Resurrect In Place + 800F4150 0001 + cn Stop Timer + 800F4160 0001 + cn Big Front Wheels + 800DA02C 0002 + cn Big Back Wheels + 800DA03C 0002 + cn Difficulty Very Easy + 810D9F7A 0002 + cn Automatic Transmission + 800C8100 0001 + cn Access The Rock Alcatraz bonus level + cd Press C-right, on any level, at the track selection screen + D00F4174 0002 + 80100120 0006 + cn All\Keys & Cars + 50000E16 0000 + 810CAD52 FFFF + cn All\Keys & Cars Circuits + 8105696E FFFF + 8105699A FFFF + 50000404 0000 + 81056910 FFFF + +crc B7CF2136-FA0AA715-C:50 +gn San Francisco Rush 2 - Extreme Racing USA (E) + cn Always 1st + 80115499 0000 + cn Max Points In Total + 810E235A 03E7 + cn Laps To Race + 811088D0 ???? 0001:"1 Lap",0002:"2 laps",0003:"3 Laps",0004:"4 Laps",0005:"5 Laps",0006:"6 Laps",0007:"7 Laps",0008:"8 Laps",0009:"9 Laps" + cn Number Of Drones In Race + 810E1B88 ???? 0001:"1 Drone",0002:"2 Drones",0003:"3 Drones",0004:"4 Drones",0005:"5 Drones",0006:"6 Drones",0007:"7 Drones",0008:"8 Drones",0009:"9 Drones" + cn Best Stunt Points + cd On Track + 8110B438 02F4 + cn Max & Best Score + cd On Stunt Track + 50000502 0000 + 810C4702 FFFF + cn All Keys,Cars & Cans + 50000E02 0000 + 810C4574 FFFF + cn Access All In-Game Cheats + cd In Set-Up Menu + 810C48F8 0100 + cn Activate All In-Game Cheats + 50000E02 0000 + 810C48A4 FFFF + cn Access Midway Track + 810C4890 02F4 + cn Easy Difficulty + 8010FFAA 0000 + cn No\Checkpoints Extended Time + 8010FF47 0000 + cn No\Wind + 80116E98 0000 + +crc 51D29418-D5B46AE3-C:50 +gn San Francisco Rush 2049 (E) + cn Always 1st + 80177D4E 0000 + cn Max Race Points + 8117CE22 02F4 + cn Laps To Race + 81177A18 ???? 0001:"1 Lap",0002:"2 laps",0003:"3 Laps",0004:"4 Laps",0005:"5 Laps",0006:"6 Laps",0007:"7 Laps",0008:"8 Laps",0009:"9 Laps" + cn Number Of Drones In Race + 81163240 ???? 0001:"1 Drone",0002:"2 Drones",0003:"3 Drones",0004:"4 Drones",0005:"5 Drones",0006:"6 Drones",0007:"7 Drones",0008:"8 Drones",0009:"9 Drones" + cn Access All In-Game Cheats + 81118E9A 0001 + cn Activate All In-Game Cheats + 50000D02 0000 + 81118E82 0101 + cn All Silver & Gold Coins + cd Single, Practice & Circuit Mode + 50000660 0000 + 8116375C FFFF + cn All Silver & Gold Coins + cd Circuit Mode - Using Controller Pack + 50000660 0000 + 811C542C FFFF + cn All Silver & Gold Coins + cd Stunt Mode + 50000440 0000 + 81163BBC FFFF + cn Extended Time In Battle & Stunt Mode To 2.05 Hours + 811633BA 457C + 811636EE 4514 + cn Stunt Wings All Modes + cd Where Wings Are Available Press D-Pad Up On Wing Select + D017055A 0004 + 50000C02 0000 + 811139D0 0202 + cn Stunt Wings Circuit Mode + cd Press D-Pad Up On Wing Select + D017055A 0004 + 50000C02 0000 + 801756A1 0202 + cn Easy Difficulty level + 80177A3C 0000 + cn Max Points Stunt Mode + 81177A55 3AFF + 81177A57 F3FA + +crc E3BD221D-3C0834D3-C:50 +gn Scooby-Doo - Classic Creep Capers (E) + cn Have All Items\What a night for a knight + 811BA010 0101 + 811BA012 0101 + 811BA014 0101 + 811BA016 0101 + 811BA018 0101 + cn Infinite Courage + 810BB096 0007 + F107D9B0 0000 + +crc 60C437E5-A2251EE3-C:50 +gn Shadowman (E) + cn Have All\Items + cd Youll not miss out any part of the game for having all parts of LEclipsers with a new game + D0059047 0001 + 50001D20 0000 + 80030613 000B + cn Have All\Gads & The Poign + 80030E57 000F + cn Have All\Levels Unlocked + 5000101C 0000 + 80030A0E 0001 + cn Have All\Cheats: Book of Shadows + 81075F4E 0FFF + cn Have All\Dark Souls Collected + D00590B3 0001 + 80075F49 007C + cn Infinite\Shotgun Shells + 80075B2F 0063 + cn Infinite\Violator Ammo + 81075B32 029A + cn Infinite\Cadeaux' + 81075B36 029A + cn Infinite\0.9mm Ammo + 81075B3A 0190 + cn Infinite\Max Health/Air/Shadow Charge & Voodoo Power + 50000604 0000 + 81075B16 2710 + cn Infinite\Accumulators + 800306D7 0005 + cn Infinite\Retractors + 800308B7 0003 + cn Infinite\Prisms + 80030957 0003 + cn Ammo always displayed on screen + 50000408 0000 + 80075ACD 0007 + cn Press L To Levitate + D0059097 0020 + 80075578 0041 + +crc 5FD7CDA0-D9BB51AD-C:50 +gn Snowboard Kids (E) + cn Infinite Cash + 8112272A 02F4 + cn Access Everything + cd "Have All Characters,Cups,Courses,&Boards" + 810B3160 0100 + 810B3164 0F00 + cn 1 Lap To Race + D01226C8 0000 + 801226C8 0009 + cn Infinite Tools Options + 801226D5 ???? 0001:"Fan",0002:"Ghost",0003:"Pan",0004:"Rock",0005:"Mouse",0006:"Board" + cn Infinite Weapons\Lucky Dip + cd "Lucky Dip is Infinite Usage Of What Ever You Get From Each Red Box" + 801226D4 0003 + +crc C2751D1A-F8C19BFF-C:50 +gn Snowboard Kids 2 (E) + cn Max Coins + 8120639E 270F + cn Access Everything\Start New Game + 50000502 0002 + 80204F3B 0013 + 50000502 0002 + 80204F42 0009 + 50000402 0002 + 80204F43 000A + 80204F4B 000D + 81204F4C 0E0F + 81204F4E 0101 + 81204F5A 0100 + cn Trick Game 300 Points + 812065D2 012C + cn Infinite Tools Options + 80206404 ???? 0001:"Frying Pan",0002:"Ghost",0003:"Super Ghost",0004:"Fan",0005:"Rocket",0006:"Invisible",0007:"Rock",0008:"Rat Face",0009:"Super Rat Face",000A:"Wings" + cn Infinite Weapons Options + 80206402 ???? 0001:"Slap Stick",0002:"Parachute",0003:"Freeze Shot",0004:"Snowman",0005:"Bomb",0006:"Whirlwind" + 80206403 0009 + cn Max Money(Story Mode) + 81204EB0 0098 + 81204EB2 967F + cn Open Extra Characters + 81204F4E 0101 + 80204F50 0001 + cn Have All Snowboards + 80204F3C 0001 + 81204F3E 0101 + 81204F40 0101 + +crc 20B53662-7B61899F-C:50 +gn South Park (E) + cn Have Cheats Menu + 800D77D6 01FF + cn Infinite Energy + 802FD209 0064 + cn Infinite Credits + 802FD215 0064 + cn Infinite Sponge Darts + 802FD223 0064 + cn Infinite Suckers + 802FD222 0064 + cn Infinite Balls + 802FD21F 0064 + cn Start with 9999 Monster Score + 812FD20E 270F + +crc 4F8AFC3A-F7912DF2-C:50 +gn South Park Rally (E) + cn Infinite Credits + 8008D659 0005 + cn Have All Tracks + 8108875A FFFF + cn Have All Races + 81088756 FFFF + cn Unlock All Characters & Extra Cheats + 81088750 FFFF + 81088752 FFFF + +crc FC70E272-08FFE7AA-C:50 +gn Silicon Valley + cn Great Score + 813F2E22 02F4 + cn Title Screen + cd Press the Pause Button to takes you to Title Screen + 803F6799 0000 + cn Debug Mode + 803F651F 0001 + cn Enable Secret Mini Game + 803F652D 0001 + cn High Score In Evo's Escape + 813E4DDA 7FFF + cn 0 Enemies To Kill In Big Celebration Parade + 803E4DBB 0000 + cn Infinite Health\EVO + 801DE085 0080 + cn Always Raining + 803F2E5F 0005 + cn Always Snowing + 803F2E5D 0005 + cn Always in 2nd Camera Angle + 803F2B89 0001 + cn All levels open + 50002001 0000 + 803F7ED0 0001 + cn Infinite Health\2 Mouse,Hyena + cd Only Use Infinite Health Codes For Animals You Need + 801DFB51 0080 + cn Infinite Health\Rocket Dog + cd Only Use Infinite Health Codes For Animals You Need + 801DEC01 0080 + cn Infinite Health\King Rat + cd Only Use Infinite Health Codes For Animals You Need + 801E19F1 0080 + cn Infinite Health\Spit Dog, Bear, King Pen, FB EVO + cd Only Use Infinite Health Codes For Animals You Need + 801DE459 0080 + cn Infinite Health\Fox, Pen, Husky, Tortoise Tank + cd Only Use Infinite Health Codes For Animals You Need + 801DFF25 0080 + cn Infinite Health\Bunny, Racing Turtle + cd Only Use Infinite Health Codes For Animals You Need + 801DF3A9 0080 + cn Infinite Health\Rocket Husky + cd Only Use Infinite Health Codes For Animals You Need + 801E1DC5 0080 + cn Infinite Health\Cool Cod + cd Only Use Infinite Health Codes For Animals You Need + 801E4039 0080 + cn Infinite Health\Elephant + cd Only Use Infinite Health Codes For Animals You Need + 801DE82D 0080 + cn Infinite Health\Lion, Camel + cd Only Use Infinite Health Codes For Animals You Need + 801E02F9 0080 + cn Infinite Health\Desert Fox + cd Only Use Infinite Health Codes For Animals You Need + 801E161D 0080 + cn Infinite Health\A. Desert Rat, Vulture, Box, Kang + cd Only Use Infinite Health Codes For Animals You Need + 801DEFD5 0080 + cn Infinite Skill\A\Power Mouse + cd Only Use Infinite Skill A Codes For Animals You Need + 801DFCE4 0004 + cn Infinite Skill\A\Rocket Dog + cd Only Use Infinite Skill A Codes For Animals You Need + 801E3A24 0004 + cn Infinite Skill\A\King Rat + cd Only Use Infinite Skill A Codes For Animals You Need + 801E1B84 0004 + cn Infinite Skill\A\King Penguin + cd Only Use Infinite Skill A Codes For Animals You Need + 801DE5EC 0004 + cn Infinite Skill\B\Rocket Dog + cd Only Use Infinite Skill B Codes For Animals You Need + 801E3A28 0004 + cn Infinite Skill\B\Bear + cd Only Use Infinite Skill B Codes For Animals You Need + 801DE5F0 0004 + cn Infinite Skill\B\Power Pen, Husky, Fox, Tort Tank + cd Only Use Infinite Skill B Codes For Animals You Need + 801E00BC 0004 + cn Infinite Skill\B\Bunny, Racing Turtle + cd Only Use Infinite Skill B Codes For Animals You Need + 801DF540 0004 + cn Infinite Skill\B\Rocket Husky + cd Only Use Infinite Skill B Codes For Animals You Need + 801E1F5C 0004 + cn Infinite Skill\B\Hyena + cd Only Use Infinite Skill B Codes For Animals You Need + 801DF914 0004 + cn Infinite Skill\B\Lion + cd Only Use Infinite Skill B Codes For Animals You Need + 801E0490 0004 + cn Infinite Skill\B\Armed Desert Rat + cd Only Use Infinite Skill B Codes For Animals You Need + 801DF16C 0004 + cn Infinite Skill\B\Desert Fox + cd Only Use Infinite Skill B Codes For Animals You Need + 801E17B4 0004 + cn Infinite Skill\B\Boxing Kangeroo + cd Only Use Infinite Skill B Codes For Animals You Need + 801DF16C 0004 + +crc 42CF5EA3-9A1334DF-C:50 +gn StarCraft 64 (E) + cn Infinite Vespene gas,minerals & Most missions + 50003202 0000 + 800B1D96 00FF + cn All levels complete + 800D1364 000C + 50000501 0000 + 800D1365 000A + +crc F4CBE92C-B392ED12-C:50 +gn STARFOX64 Lylat Wars (E) + cn Unlimited\Boost + 8113E6FC 0000 + 8113E6FE 0000 + 811415DC 0000 + 811415DE 0000 + 8013E7FD 0000 + 801416DD 0000 + cn Have All Medals + cd For Expert & Normal Modes + 50000802 0000 + 8017A9D9 7777 + cn Infinite\Hyper Laser + 80163B13 0002 + cn Loads O' Hits + 80163B03 00FF + cn Infinite\Armor\Slippy + 8017418B 00FF + cn Infinite\Energy + 80141587 00FF + 8013E6A7 00FF + cn Infinite\Lives + 80163B09 0063 + cn Unlimited\Smart Bombs + 80179E0B 0063 + cn Infinite\Armor\Falco + 80174187 00FF + cn Infinite\Armor\Peppy + 8017418F 00FF + cn Infinite\Dual Blue Lasers + 80163C13 0002 + cn Level Select + 8017A29F ???? 0000:"Corneria",0001:"Meteo",0002:"Sector X",0003:"Area 6",0004:"Glitch",0005:"Sector Y",0006:"Venom 1",0007:"Solar",0008:"Zoness",0009:"Venom 2",000A:"Training Mode Level",000B:"Macbeth",000C:"Titania",000D:"Aquas",000E:"Fortuna",0010:"Katina",0011:"Bolse",0012:"Sector Z",0013:"Venom With Starwolf",0014:"Corneria (Multi)" + cn 999 Kills + 80163B03 00FF + +crc D89E0E55-B17AA99A-C:50 +gn Starshot - Space Circus Fever (E) + cn Infinite Lives + 801A3E83 0063 + cn Infinite Shots + 801A3EB7 0064 + cn Infinite Flight Time + 801A3F1F 0064 + cn Infinite Mega Fuel + 801A3EEB 0064 + +crc 7EE0E8BB-49E411AA-C:50 +gn Star Wars - Rogue Squadron (E) + cn Infinite Lives + cd This Also accesses advanced Shields & Radar + 81130B38 01C0 + cn Invincibility + cd This Also Accesses All Levels And Makes All Crafts Available + 80130B2D 00FF + cn Infinite Secondary Weapon + 8010CA02 0063 + 80130B23 ???? 0001:"Ion Cannon",0002:"Missiles",0003:"Seeker Missiles",0004:"Bombs",0005:"Proton Bombs",0007:"Cluster Missiles",0008:"Seeker Torpedos",0009:"Seeker Cluster Missiles" + cn Completion Time 0:00 + 80130B85 3FCB + cn Enemies Destroyed 756 + 81130B64 02F4 + cn Accuracy 100% + 80130B5F 0063 + cn Friendly Saves 756 + 80130B66 02F4 + cn Bonus Collected 756 + 80130B67 02F4 + cn Always Pass Mission + 80130AF4 0001 + cn Accesses\All Levels,Ships & Advanced Weapons + 80130B3B 00FF + cn Access\69 Buick Electra + cd Replaces The V-Wing + 81130B3A 000E + cn Access AT-ST Level + 81130B38 1250 + +crc 219191C1-33183C61-C:50 +gn Star Wars - Rogue Squadron (E) (V1.1) + cn Infinite\Infinite Lives + 80130B10 0008 + cn Extra Shields + 81137E7C 4316 + cn Infinite\Infinite Secondary Weapons + 8010CA32 0008 + cn Infinite\Infinite Health + 81137E7C 4316 + cn Have 99\Bonus Collected + 80130B87 0063 + cn Have 99\Kills + 80130B85 0063 + cn Have 99\Saves + 80130B86 0063 + cn 1-Hit Death + 81137E7C 4136 + cn Have Medals For\Ambush at Mos Eisley + 88130B1C ???? 0000:"None",0001:"Bronze Medal",0002:"Silver Medal",0003:"Gold Medal" + cn Have Medals For\Rendezvou on Bankhesh + 88130B1D ???? 0000:"None",0001:"Bronze Medal",0002:"Silver Medal",0003:"Gold Medal" + cn Have Medals For\The Search For The Noonnah + 88130B1E ???? 0000:"None",0001:"Bronze Medal",0002:"Silver Medal",0003:"Gold Medal" + cn Have Medals For\Defection At Corellia + 88130B1F ???? 0000:"None",0001:"Bronze Medal",0002:"Silver Medal",0003:"Gold Medal" + cn Have Medals For\Liberation V + 88130B20 ???? 0000:"None",0001:"Bronze Medal",0002:"Silver Medal",0003:"Gold Medal" + cn Have Medals For\The Jade Moon + 88130B21 ???? 0000:"None",0001:"Bronze Medal",0002:"Silver Medal",0003:"Gold Medal" + cn Have Medals For\Imperial Construction Yard + 88130B22 ???? 0000:"None",0001:"Bronze Medal",0002:"Silver Medal",0003:"Gold Medal" + cn Have Medals For\Assault on Kile II + 88130B23 ???? 0000:"None",0001:"Bronze Medal",0002:"Silver Medal",0003:"Gold Medal" + cn Have Medals For\Rescue on Kessel + 88130B24 ???? 0000:"None",0001:"Bronze Medal",0002:"Silver Medal",0003:"Gold Medal" + cn Have Medals For\Prisons on Kessel + 88130B25 ???? 0000:"None",0001:"Bronze Medal",0002:"Silver Medal",0003:"Gold Medal" + cn Have Medals For\Battle Above Taloraan + 88130B26 ???? 0000:"None",0001:"Bronze Medal",0002:"Silver Medal",0003:"Gold Medal" + cn Have Medals For\Escape From Fest + 88130B27 ???? 0000:"None",0001:"Bronze Medal",0002:"Silver Medal",0003:"Gold Medal" + cn Have Medals For\Blockade on Chandrila + 88130B28 ???? 0000:"None",0001:"Bronze Medal",0002:"Silver Medal",0003:"Gold Medal" + cn Have Medals For\Raid on Sullust + 88130B29 ???? 0000:"None",0001:"Bronze Medal",0002:"Silver Medal",0003:"Gold Medal" + cn Have Medals For\Moff Seerdon's Revenge + 88130B2A ???? 0000:"None",0001:"Bronze Medal",0002:"Silver Medal",0003:"Gold Medal" + cn Have Medals For\The Battle of Calamari + 88130B2B ???? 0000:"None",0001:"Bronze Medal",0002:"Silver Medal",0003:"Gold Medal" + cn Have Medals For\Beggar's Canyon + 88130B2C ???? 0000:"None",0001:"Bronze Medal",0002:"Silver Medal",0003:"Gold Medal" + cn Have Medals For\The Death Star Trench Run + 88130B2D ???? 0000:"None",0001:"Bronze Medal",0002:"Silver Medal",0003:"Gold Medal" + cn Have Medals For\Battle of Hoth + 88130B2E ???? 0000:"None",0001:"Bronze Medal",0002:"Silver Medal",0003:"Gold Medal" + +crc 4D486681-AB7D9245-C:50 +gn Shadow of the Empire + cn Access In-Game Cheat Menu + cd Pause gameplay and pink text will appear in top screen. scroll with multiple buttons and select with 'A' + D10DDE2E 0001 + 810D3F32 0001 + D10DDE14 0002 + 810D3F32 0001 + D10E28D4 0011 + 810D3F32 0001 + D10E28D4 0011 + 810D3F32 0001 + cn Access Wampa Stompa + cd Important To Get All Codes To Work! Select empty file "Wampa Stompa" will now be your playername. + 8118D4E8 2057 + 8118D4EA 616D + 8118D4EC 7061 + 8118D4EE 2020 + 8118D4F0 5374 + 8118D4F2 6F6D + 8118D4F4 7061 + cn Access All Levels + cd Must be used with Access Wampa Stompa + 810DE2EA 0004 + cn Max Challenge Points + 8118F370 000F + cn Extra Jump Power + 810E2220 3F92 + cn Freeze Timer + 810E2230 4018 + +crc EAE6ACE2-020B4384-C:50 +gn Star Wars Episode I - Battle for Naboo (E) + cn Level Select + 8004C650 0013 + cn Always Pass Mission + 8105C88E 0001 + cn Advanced Weapons,Shields & Extra Ships + 8104C636 00FF + cn 2X Secondary Weapons + 8104C62A 0080 + cn Infinite Lives + 80067553 03E7 + cn Access All Platinium Medals + 50001301 0000 + 8004C63D 0004 + cn Completion Time 0:00 + 8105C892 0000 + cn Enemies Destroyed 756 + 8005C89D 02F4 + cn Accuracy 100% + 8105C896 0064 + 8105C89A 0064 + cn Friendly Saves 756 + 8005C89E 02F4 + cn Bonus Collected + cd Where Bonus Are Available + 8005C89F 0002 + cn Lives Remaining 756 + 8005C8A0 02F4 + +crc 53ED2DC4-06258002-C:50 +gn Star Wars Episode I - Racer (E) + cn No Damage + cd If when Racing Your Pod Over heats & bursts into flames Press "R" & you will Repair the Damage. + 800AA5D7 0001 + cn Infinite Truguts + 8111CB1A FFFF + 8111CB18 7FFF + cn Always 1st + 80121C8C 0001 + 80125489 0001 + cn Enable In-Game cheat Menu & Cheats + cd Here you can Activate the IN-Built Cheats Menu. At the Front Screen Just Press C-Button Right.This will open up All Tracks & Characters In Free Play & Time Attack. Also In A Race, Press The Start/Pause button to Access the In-Cheat-Menu Option.You can also choose how many Pod's Racers are in the Race & also how many Laps are in the Race in Free Play & Time Attack + 810A0D27 000A + 810A0D2A FFFF + cn Unlock All Tracks & Characters + cd When using Unlock All Tracks & Characters For can to pick & choose what ever you want to play As & where ;) + 8011CB08 00FF + 8011CB09 00FF + 8011CB0B 00FF + 8111CB08 FFFF + 8111C80A FFFF + 8011CB14 007D + 8111CB16 FFFF + cn Have All Tracks Completed + 8111CB0A FFFF + 8111CB0C 3FFF + 8111CB0E 3FFF + 8111CB10 3FFF + 8111CB12 00FF + +crc A03CF036-BCC1C5D2-C:50 +gn SUPER MARIO 64 + cn Press GS For 255 Coins + 893094D8 00FF + cn Have\Level Select + A02F973C 0001 + cn Don't Hurt Mario\Monsters + 80309457 0001 + cn Infinite\Lives + 803094DD 0064 + cn Infinite\Energy & Breath + 803094DE 0008 + cn Have\Debug Mode + A02F9748 ???? 0001:"On",0000:"Off" + cn Mario's Cap\Off Options + cd Here you can Choose Options with Mario without His Cap on,Do not use with any other Mario with/without Options,Use only one at a time + 80309437 ???? 0001:"Mario No Cap",0002:"Invisible Mario",0004:"Metal Mario",0008:"Flying Mario",000A:"Invisible Flying Mario",000D:"Metal Flying Mario",000F:"Invisible Metal Flying Mario" + cn Mario's Cap\On Options + cd Here you can Choose Options with Mario with His Cap on,Do not use with any other Mario with/without Options,Use only one at a time + 80309437 ???? 0012:"Invisible Mario",0015:"Metal Mario",0016:"Invisible Metal Mario",0019:"Flying Mario" + cn Funny Mario Options\Mario's Cap\Off & in His Hand + cd Here you can Choose Options with Mario with His Cap off & in His Hand,Do not use with any other Mario with/without Options,Use only one at a time + 80309437 ???? 0020:"Cap In Hand",0022:"Invisible Mario Cap In Hand",0024:"Metal Mario Cap In Hand",0026:"Invisible Metal Mario Cap In Hand",0028:"Flying Mario Cap In Hand" + cn Funny Mario Options\Mario's Cap\On & An Extra in His Hand + cd Here you can Choose Options with Mario with His Cap on & An Extra in His Hand,Do not use with any other Mario with/without Options,Use only one at a time + 80309437 ???? 0030:"Cap In Hand",0032:"Invisible Mario Cap In Hand",0034:"Metal Mario Cap In Hand",0036:"Invisible Metal Mario Cap In Hand",0038:"Flying Mario Cap In Hand" + cn Press L To Levitate + cd Press L to levitate & Let go to land + D0309261 0020 + 8130947C 4220 + D030947D 0020 + 8130943C 0300 + D030947D 0020 + 8130943E 0880 + cn [Slot A Codes]\Have All 120 Stars + cd Have 120 Stars,once the Code is activated, you will see it as a new option in Save Slot A.This will have the Cannon open already to get upto Yoshi on the Roof. but make sure to save the game after collecting Red Coins and turn this code off before saving. you will now have it all saved to mempak + 80202F23 0001 + 80202F0B 00C7 + 50001101 0000 + 80202F0C 00FF + cn [Slot A Codes]\Have all key doors unlocked (and mote empty) + 80202F0A 007E + cn [Slot A Codes]\Have All Max 100 Coin Records For All Levels + 50000F01 0000 + 80202F25 0064 + cn [Slot B Codes]\Have All 120 Stars + cd Have 120 Stars,once the Code is activated, you will see it as a new option in Save Slot A.This will have the Cannon open already to get upto Yoshi on the Roof. but make sure to save the game after collecting Red Coins and turn this code off before saving. you will now have it all saved to mempak + 80202F93 0001 + 80202F7B 00C7 + 50001101 0000 + 80202F7C 00FF + cn [Slot B Codes]\Have all key doors unlocked (and mote empty) + 80202F7A 007E + cn [Slot B Codes]\Have All Max 100 Coin Records For All Levels + 50000F01 0000 + 80202F95 0064 + cn [Slot C Codes]\Have All 120 Stars + cd Have 120 Stars,once the Code is activated, you will see it as a new option in Save Slot A.This will have the Cannon open already to get upto Yoshi on the Roof. but make sure to save the game after collecting Red Coins and turn this code off before saving. you will now have it all saved to mempak + 80203003 0001 + 80202FEB 00C7 + 50001101 0000 + 80202FEC 00FF + cn [Slot C Codes]\Have all key doors unlocked (and mote empty) + 80202FEA 007E + cn [Slot C Codes]\Have All Max 100 Coin Records For All Levels + 50000F01 0000 + 80203005 0064 + cn [Slot D Codes]\Have All 120 Stars + cd Have 120 Stars,once the Code is activated, you will see it as a new option in Save Slot A.This will have the Cannon open already to get upto Yoshi on the Roof. but make sure to save the game after collecting Red Coins and turn this code off before saving. you will now have it all saved to mempak + 80203073 0001 + 8020305B 00C7 + 50001101 0000 + 8020305C 00FF + cn [Slot D Codes]\Have all key doors unlocked (and mote empty) + 8020305A 007E + cn [Slot D Codes]\Have All Max 100 Coin Records For All Levels + 50000F01 0000 + 80203075 0064 + +crc 93945F48-5C0F2E30-C:50 +gn Super Smash Bros (E) + cn Give Kirby A Wierd Blow-Up + 802669B8 000A + cn Story Mode\Skip Straight To Master Hand + 800AD347 000D + cn Story Mode\Infinite Time + 810AD38E 43CB + cn Story Mode\Player 1\Infinite Lives + 800AD3A3 0004 + cn Story Mode\Player 2\Infinite Lives + 800AD417 0004 + cn Story Mode\Player 3\Infinite Lives + 800AD48B 0004 + cn Story Mode\Player 4\Infinite Lives + 800AD4FF 0004 + cn Story Mode\Player 1\Low % Health + 810AD3E6 0000 + cn Story Mode\Player 2\Low % Health + 810AD45A 0000 + cn Story Mode\Player 3\Low % Health + 810AD4CE 0000 + cn Story Mode\Player 4\Low % Health + 810AD542 0000 + cn Story Mode\Player 1\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code could also result freezing at the end of the Level. + 800AD39B ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn Story Mode\Player 2\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800AD40F ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn Story Mode\Player 3\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800AD483 ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn Story Mode\Player 4\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800AD4F7 ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn Story Mode\Player 1\Kirby B Button Move\Hyrule Castle + 8027136F ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Yoshi's Island + 802716AF ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Sector Z + 80279957 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Peach's Castle + 8026C5FF ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Saffron City + 8027C2F7 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Congo Jungle + 8027932F ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Kirby's Dreamland + 8027639F ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Planet Zebes + 80278807 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Metal Mario Stage + 8026BDF7 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Fighting Polygon Team + 8026AF7F ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Master Hand Stage + 8027A4AF ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn VS. Mode\Infinite Time + 810AD57E 43CB + cn VS. Mode\Player 1\Low % Health + 810AD5D6 0000 + cn VS. Mode\Player 2\Low % Health + 810AD64A 0000 + cn VS. Mode\Player 3\Low % Health + 810AD6BE 0000 + cn VS. Mode\Player 4\Low % Health + 810AD732 0000 + cn VS. Mode\Player 1\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800AD58B ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn VS. Mode\Player 2\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800AD5FF ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn VS. Mode\Player 3\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800AD673 ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn VS. Mode\Player 4\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800AD6E7 ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn VS. Mode\Player 1\Kirby B Button Move\Hyrule Castle + 8026C24F ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn VS. Mode\Player 1\Kirby B Button Move\Yoshi's Island + 80276B17 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn VS. Mode\Player 1\Kirby B Button Move\Sector Z + 802747E7 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn P1 Press Down On D-Pad To Make Items Appear In Random Spots + D10A7804 0400 + 81195902 0001 + cn Have All Characters + 810AD198 0FF0 + cn VS. Mode\Have Mushroom Kindom + 800AD197 00FF + cn Story Mode\Always Get Pacifist (60,000 Points) + 810AD3CE 0000 + cn Bonus Stage Character Modifier (Training Mode) + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 80197A33 ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn Jump off to win + 810AD3A2 0000 + +crc B44CAB74-07029A29-C:50 +gn Superman (E) + cn Infinite Options\Freezing Breath + 8122CDE8 42C8 + cn Infinite Options\Health + 8122CDD4 42C8 + cn Infinite Options\Laser Eye + 8122CDE4 42C8 + cn Infinite Options\Running Boosts + 8122CDDC 42C8 + cn Infinite Options\X-Ray Vision + 8122CDE0 42C8 + cn For More Time Press D-pad up + D00EA380 0008 + 8115F0D2 1724 + D00EA380 0008 + 8115F0DA 003C + cn Level Select + D00EA380 0020 + 8117A378 0013 + D00EA380 0020 + 8117A388 000F + 81144727 0063 + +crc E0C4F72F-769E1506-C:50 +gn Tigger's Honey Hunt (E) + cn Max Honey Pots + 810A288A 03E7 + cn Infinite Lives + 810A2886 0009 + cn Have Mouse Card\The Adventure Begins + 800A2864 0001 + cn Have Mouse Card\Night Tail + 800A2865 0001 + +crc 2B4F4EFB-43C511FE-C:50 +gn TOM AND JERRY + cn [Unlock All Characters] + cd This Gives you all Characters to choose from plus fixes A freeze on the Charecter Select Menu by having it on + 800E4933 00FF + cn Open All Versus Arenas + 800E4934 00FF + 800E4935 00FF + cn Infinite Health + 800E2BDD 00C8 + cn One Hit To Kill\Player 1 + cd This Will Give Player 1 A One Hit Kill Over Player 2 + 800E2EB4 0080 + cn One Hit To Kill\Player 2 + cd This Will Give Player 2 A One Hit Kill Over Player 1 + 800E2BDC 0080 + cn Always Have Weapon Options\Player 1 + 810E2DD4 ???? 0079:"Anvil",0003:"Club",0004:"Bird bath",0008:"Broom",0009:"NCube knife",000A:"NCube missiles",000B:"Chair",000C:"Champagne",000E:"Chicken",000F:"Crate",0014:"Deck chair",0016:"Egg",001A:"Fish",001D:"Gardeners Fork",001E:"Frying Pan",001F:"Wooden Chair",0029:"Bouy",002A:"Mallet",002B:"Watermelon",002D:"Milk Bottle",0039:"Plank",0041:"Rolling Pin",0046:"Spade",0047:"Stool",0048:"Tennis Racket",004E:"Spanner",0055:"Stick",0063:"Blue Swordfish",0064:"Saucepan",0065:"Wooden Spoon",006B:"Stool",006D:"Bee hive",0078:"Mooses head" + cn Always Have Weapon Options\Player 2 + 810E30AC ???? 0079:"Anvil",0003:"Club",0004:"Bird bath",0008:"Broom",0009:"NCube knife",000A:"NCube missiles",000B:"Chair",000C:"Champagne",000E:"Chicken",000F:"Crate",0014:"Deck chair",0016:"Egg",001A:"Fish",001D:"Gardeners Fork",001E:"Frying Pan",001F:"Wooden Chair",0029:"Bouy",002A:"Mallet",002B:"Watermelon",002D:"Milk Bottle",0039:"Plank",0041:"Rolling Pin",0046:"Spade",0047:"Stool",0048:"Tennis Racket",004E:"Spanner",0055:"Stick",0063:"Blue Swordfish",0064:"Saucepan",0065:"Wooden Spoon",006B:"Stool",006D:"Bee hive",0078:"Mooses head" + cn Infinite time + 800FF18E 00F0 + cn No music + 800B7718 0000 + +crc 9F8926A5-0587B409-C:50 +gn Tony Hawk's Pro Skater 1 (E) + cn Access all Levels,tapes,boards & Officer Dick + 50000C14 0000 + 800DE9FC 001E + cn Access All gold medals + cd Also opens San Francisco & Downtown Minneapolis + 50000C14 0000 + 800DEA03 00FF + 50000C14 0000 + 800DEA06 00FF + 50000C14 0000 + 800DEA08 00FF + cn 10x Trick Multiplier + 800D60FE 0001 + cn Max\Balance + 800D62DF 00FF + cn Max\Turning + 800D6220 00FF + cn Max\Speed + 800DE83A 0001 + cn Max\Air + 800D62DC 00FF + +crc 84EAB557-C88A190F-C:50 +gn Tony Hawk's Pro Skater 2 (E) + cn Access In-Game Cheat Menu + 50001104 0000 + 800E9E98 0001 + cn 10x Points Multiplier + 800EAD8F 0001 + cn Perfect Balance + 800E9EAA 0010 + cn Always Special + 800E9EAC 0001 + 800E9EAE 0001 + cn Moon Psysics + 800E9ECE 0001 + cn Hoffmann Factory & Skate heaven Unlocked + 800EA18B 003F + cn Access\Spider-Man + 800E9E98 0001 + 800F0C5B 0001 + cn Access\Officer Dick + 800E9E9C 0001 + 800F093B 0001 + cn Infinite Time + 800E886A 0001 + cn Max Cash + cd All standard players,Officer Dick & Spider-Man + 50000EE4 0000 + 810E88F8 000A + 50000EE4 0000 + 810E88FA 2B1F + 50000EE4 0000 + 810E88FC 000A + 50000EE4 0000 + 810E88FE 2B1F + cn Level Goals 100% + cd All standard players,Officer Dick & Spider-Man, Use together with + 50000EE4 0000 + 810E8900 FFFF + 50000EE4 0000 + 810E8902 FFFF + 50000EE4 0000 + 810E8904 FFFF + 50000EE4 0000 + 810E8906 FFFF + 50000EE4 0000 + 810E8908 FFFF + 50000EE4 0000 + 810E890A FFFF + 50000EE4 0000 + 810E890C FFFF + 50000EE4 0000 + 810E890E FFFF + 50000EE4 0000 + 810E8920 FFFF + cn All Gaps + 50000A0C 0000 + 810E9D84 FFFF + 50000A0C 0000 + 810E9D86 FFFF + 50000A0C 0000 + 810E9D8A FFFF + 50000402 0000 + 810E9DF4 FFFF + cn Max Cash For All Custom Players + 500004E4 0000 + 810E948C 000A + 500004E4 0000 + 810E948E 2B1F + 500004E4 0000 + 810E9490 000A + 500004E4 0000 + 810E9492 2B1F + cn Levels Goals 100% All Custom Players + 50000802 0000 + 810E9494 FFFF + 50000802 0000 + 810E9578 FFFF + 50000802 0000 + 810E965C FFFF + 50000802 0000 + 810E9740 FFFF + +crc 5F3F49C6-0DC714B0-C:50 +gn Top Gear Hyper-Bike (E) + cn Access All\Bikes + 8107F6EE FFFF + cn Access All\Tracks + 8107F6F0 00FF + 8107F6F2 FFFF + cn Infinite\Nitro + 810BA540 4296 + cn Infinite\Nitro Always On + 810BA52C 0010 + cn Laps 2 Race + 800F36B8 ???? 0001:"1 Lap",0002:"2 laps",0003:"3 Laps",0004:"4 Laps",0005:"5 Laps",0006:"6 Laps",0007:"7 Laps",0008:"8 Laps",0009:"9 Laps" + +crc D09BA538-1C1A5489-C:50 +gn Top Gear Overdrive (E) + cn Extra Cars & Tracks + 80102A71 000E + 80102A68 0005 + cn Infinite Money + 810F5905 0FA0 + cn Infinite Nitro + 800F590F 000F + cn Laps 2 Race + 80118E20 ???? 0001:"1 Lap",0002:"2 laps",0003:"3 Laps",0004:"4 Laps",0005:"5 Laps",0006:"6 Laps",0007:"7 Laps",0008:"8 Laps",0009:"9 Laps" + +crc 7F43E701-536328D1-C:50 +gn TOP GEAR RALLY + cn Have 1-6 Level Points + 8032685F 0064 + 80326861 0064 + 80326863 0064 + 80326865 0064 + 80326867 0064 + 80326869 0064 + cn Extra Cars & Tracks + 8032690F 00FF + 8032690C 00FF + 8032690D 00FF + cn Only Race 1 Lap Championship Mode + 8031EBDB 0002 + cn Always Place 1st + 8031EC0F 0000 + +crc BEBAB677-51B0B5E4-C:50 +gn TOP GEAR RALLY 2 + cn Always 1st + 80032713 0001 + cn No Damage Or Failures + 80031BA7 0001 + cn 100.000 Sponsor Credits & 950 Championship Points In Support Van + cd You Also Have Access To All Cars, Tracks & Extra Features + 80031BB3 00F3 + cn No Cones Hit + cd In ARSG Rally School + 80032743 0000 + 80032B1B 0000 + cn No Navigator + 80032677 0000 + cn Max Sponsor Credits + 803D27E2 0010 + 803D27E4 0001 + cn Infinite Cash + 803D004E 4000 + cn Freeze Timer + 8003271F 0000 + +crc CCEB3858-26952D97-C:50 +gn Toy Story 2 (E) + cn Have 99 coins + 810BB4FE 0063 + cn Have all 5 collectables + 801C7E62 0005 + cn Infinite Lives + 800BB4FA 0009 + cn Infinite Battery Power + 810BB4F6 000E + cn Hold jump to fly + 810BB4EC 0002 + +crc 2F7009DD-FC3BAC53-C:50 +gn Turok - Dinosaur Hunter (E) (V1.0) + cn Infinite\Lives + 80128D7F 00FF + cn Infinite\Body Armor + 81128D96 5B23 + 80128DD7 0001 + cn Infinite\Air + 801290E0 0063 + 801E869A 0063 + cn Infinite\Health + 812C1634 1E61 + 812A25A4 1E61 + cn Have\All Level Keys + 50000604 0000 + 80128DE3 0007 + 80128DFB 001F + 80128E1B 00FF + cn Have\All Weapons + 50000B04 0000 + 80128DB7 0001 + 80128D33 0001 + cn Infinite\Ammo + 50000404 0000 + 80128D63 00FF + 80128D73 00FF + 80128D7F 00FF + 50000504 0000 + 80128D83 00FF + 80128F0B 00FF + 80128F07 00FF + cn Diffuculty Modifier + 801195DF ???? 0000:"Easy",0001:"Normal",0002:"Hard" + cn Have\Backpack + 80128CEB 0001 + 80128D2B 0001 + cn Open All Portals + cd Press L to Access Map + 8114F8CA F803 + 81128D4E 0003 + 81128D52 0003 + 81128D56 0003 + 81128D5A 0003 + 81128D5E 0003 + 81128D62 0003 + 81128D66 0005 + cn Have All\Gems + 80128F07 00FF + cn Have\Cheat Menu + 811195F0 FFFF + 811195F2 FFFF + +crc 2F700DCD-176CC5C9-C:50 +gn Turok - Dinosaur Hunter (E) (V1.1) + cn Infinite\Lives + 80128E1F 00FF + cn Infinite\Body Armor + 81128E36 5B23 + 80128E77 0001 + cn Infinite\Air + 80129180 0063 + 801E873A 0063 + cn Infinite\Health + 812C16D4 1E61 + 812A2644 1E61 + cn Have\All Level Keys + 50000604 0000 + 80128E83 0007 + 80128E9B 001F + 80128EBB 00FF + cn Have\All Weapons + 50000B04 0000 + 80128E57 0001 + 80128DD3 0001 + cn Infinite\Ammo + 50000404 0000 + 80128E03 00FF + 80128E13 00FF + 80128E1F 00FF + 50000504 0000 + 80128E23 00FF + 80128FAB 00FF + 80128FA7 00FF + cn Diffuculty Modifier + 8011967F ???? 0000:"Easy",0001:"Normal",0002:"Hard" + cn Have\Backpack + 80128D8B 0001 + 80128DCB 0001 + cn Open All Portals + cd Press L to Access Map + 8114F96A F803 + 81128DEE 0003 + 81128DF2 0003 + 81128DF6 0003 + 81128DFA 0003 + 81128DFE 0003 + 81128E02 0003 + 81128E06 0005 + cn Have All\Gems + 80128FA7 00FF + cn Have\Cheat Menu + 81119690 FFFF + 81119692 FFFF + +crc 1EA26214-E790900F-C:50 +gn Turok - Rage Wars (E) + cn Have All Medals + cd Unlocks the In-Game Cheat Menu.Only works with a Controller-Pak + 8010EB50 0003 + 50000601 0000 + 8010EB4A 00FF + cn Have All Mini Game Icons + cd Only works with a Controller-Pak + 8010EB17 0024 + cn Infinite Lives\Player 1 + 8033637E 0064 + cn Infinite Health\Player 1 + 80336527 0064 + 80692B86 0064 + cn Infinite Ammo All Guns\Player 1 + 50000302 0000 + 80336535 0063 + 50000702 0000 + 80692B95 0063 + cn All Levels Completed + cd Unlocks Frag Fest & Time Trial + 50000601 0000 + 8010EB7D 00FF + cn All Characters + 50000301 0000 + 8010EB51 00FF + cn Deaths Modifier + 8110EB76 ???? 000A:"10",0014:"20",001E:"30",0028:"40",0032:"50",0064:"100",00C8:"200",0190:"400",0320:"800",0640:"1600",03E7:"Infinite" + cn Wins Modifier + 8110EB72 ???? 000A:"10",0014:"20",001E:"30",0028:"40",0032:"50",0064:"100",00C8:"200",0190:"400",0320:"800",0640:"1600",03E7:"Infinite" + cn Total Kills Modifier + 8110EB6E ???? 000A:"10",0014:"20",001E:"30",0028:"40",0032:"50",0064:"100",00C8:"200",0190:"400",0320:"800",0640:"1600",03E7:"Infinite" + +crc E0B92B94-80E87CBD-C:50 +gn Turok 2 - Seeds of Evil (E) + cn Access In-Game Cheat Menu + 8112167C FFFF + 8112167E FFFF + cn Access All Nuke Pieces 1-6 + cd Enter the In-game inventory option, and press L Button + D00FC701 0020 + 50000601 0000 + 802FC99C 0030 + +crc 6A162FF2-2093704C-C:50 +gn Turok 3 - Shadow of Oblivion (E) + cn Infinite\Grenade Gun Ammo + 8133340A 0064 + cn Have\a Grenade Launcher + 80333954 0001 + cn Infinite\Shotgun Ammo + 81333932 0064 + cn Have\Shotgun + 80333950 0001 + cn Infinite\Arrows + 81333928 0063 + cn Infinite\Life Units + 813334FC 0063 + cn Access\All Cheats & Level Warp + 811659D4 FFFF + 811659D6 FFFF + +crc E688A5B8-B14B3F18-C:50 +gn TWISTED EDGE + cn Max\50000 Stunt Points + 81082AD8 C350 + cn Low Timer + 80082A04 0000 + 80182A06 0000 + cn Have\All Characters + 81082B18 07FF + cn Have\All Difficulties + 81082B10 0700 + cn Have\All Tracks + 81082B1C BFFE + cn Have\All Boards + 81082B24 0003 + 81082B26 FFFF + +crc 151F79F4-8EEDC8E5-C:50 +gn Vigilante 8 (E) + cn All Quests Completed + 80193CA4 003F + 50000C01 0000 + 80193C98 001F + cn Max Stats All Characters + 50000B24 0000 + 811896EC 1414 + 50000B24 0000 + 811896EE 1400 + cn Access All Characters + 81193CA4 3F00 + 50000602 0000 + 81193C98 1F1F + +crc 98F9F2D0-03D9F09C-C:50 +gn Virtual Pool 64 (E) + cn Foul score will stay at 0 + 802EF725 0000 + cn Score 0 points in shark skins + 802EF723 0000 + cn Have 5 games won + 802EF721 0005 + cn Pot 1 to win Set points to 25 in straight pool + 802EF71D 0019 + +crc 636E6B19-E57DDC5F-C:50 +gn V-Rally Edition 99 (E) + cn Access\All Cars + 8015EC13 003F + cn Access\All Tracks + 8015EC0E 0070 + cn Access\Championship,World,Expert + 8015EC1C 0001 + cn Access\Expert Times + 8015EC10 0031 + cn Access\In-Game Cheat Menu + cd On The Title Screen, Hold Z Button & Push L Button + 811CFE09 00FF + 811F31FF 04FF + 811CE165 FF03 + +crc 93053075-261E0F43-C:50 +gn Waialae Country Club - True Golf Classics (E) + cn All Players On 1st Shot + 813013DA 0000 + +crc D715CC70-271CF5D6-C:50 +gn WAR GODS + cn Infinite Time + 8033F6FB 0064 + cn Enable Cheat Menu + 80336973 0001 + cn Skill Select\Player 2 + cd Max Skill makes the player more Skillful while easier to hurt where as Weak Skill is Non Skillful yet harder to harm. + 80335C20 ???? 0080:"Max Skill",0000:"Weak Skill" + cn Skill Select\Player 1 + cd Max Skill makes the player more Skillful while easier to hurt where as Weak Skill is Non Skillful yet harder to harm. + 80335C1D ???? 0080:"Max Skill",0000:"Weak Skill" + cn Difficulty Select + 80336953 ???? 0000:"Very Easy",0001:"Easy",0002:"Medium",0003:"Hard",0004:"Very hard" + cn Infinite Max Continues + 80336963 0005 + cn Easy Fatality Select + 8033584F ???? 0000:"Always Off",0001:"Always On" + cn Press D-Pad\Right to Play As Exor + cd Press D-Pad Right at the character Select screen to Replace Maximus with Exor. Do not use with the Play As Cheat + D033C263 0008 + 800EAF87 000B + cn Press D-Pad\Left to Play As Grox + cd Press D-Pad Left at the character Select screen to Replace Maximus with Grox. Do not use with the Play As Cheat + D033C263 0004 + 800EAF87 000A + cn Music Select + 80336954 ???? 0000:"Off",0001:"On" + cn Level Select + 80335C27 ???? 0000:"Off",0001:"Pagan",0002:"Anubis",0003:"Warhead",0004:"Ahau Kin",0005:"Voodoo",0006:"Kabuki" + cn Fatalities Select + 8033695C ???? 0000:"Off",0001:"On" + cn Play As + 800EAF87 ???? 0000:"Warhead",0001:"Tak",0002:"Voodoo",0003:"Pagan",0004:"Kabuki Jo",0005:"Vallah",0006:"Ahau Kin",0007:"Anubis",0008:"CY-5",0009:"Maximus",000A:"Grox",000B:"Exor" + +crc 650EFA96-30DDF9A7-C:50 +gn Wave Race 64 (E) + cn Set\Speed Size + 801C0077 ???? 0001:"Slow",000A:"Medium",000F:"Fast" + cn Misses Don't Count\Player 1 + 801C007F 0000 + cn Set\Wave Size + 800E6B90 ???? 0000:"Smooth",0019:"Medium",0064:"Rough",00FF:"Oh My God" + cn Infinite Time Stunt Mode + 801C020E 00FF + cn Maximum Power\Player 1 + 801C0077 0005 + cn Maximum Power\Player 2 + 801C069A 0005 + 801C093A 0005 + cn Only Play Glacier Coast + 800D8003 0007 + cn Always Place 1st\Player 1 + 801BFF4F 0000 + cn Lap Timer Below 0'00'10\Player 1 + 811C00E6 0000 + cn Misses Don't Count\Player 2 + 811C03F6 0000 + cn Lap Timer Below 0'00'10\Player 2 + 811C045E 0000 + +crc 661B45F3-9ED6266D-C:50 +gn Wayne Gretzky's 3D Hockey '98 (E) + cn Max Score\Team 1 + 81120220 FFFF + cn Max Score\Team 2 + 81123730 FFFF + cn Difficulty Mod + 801247F9 ???? 0000:"",0001:"",0002:"",0003:"" + cn Anger metre always full + 800D9B38 00FF + 800D9826 00FF + +crc CEA8B54F-7F21D503-C:50 +gn Wetrix (E) + cn Always Empty Drain + 801BF991 0000 + 811BF992 0000 + 811BF994 0000 + cn Bezerk Mode + 801BF9AF 00FF + cn Stop Level Timer + 801BF9B2 00FF + +crc 54310E7D-6B5430D8-C:50 +gn Wipeout 64 + cn Access\Velocitar + 800927F9 0001 + cn Access\Pirahna 2 + 80092979 0001 + cn Access Pirahna 2 + cd Multiplayer + 80091259 0001 + 8109125A 0001 + cn Access\Super Combo + 81092ACC 0000 + cn Infinite\Ammo + 80091254 0001 + cn Cyclone Option + 80091258 ???? 0000:"Off",0001:"On" + cn Always First + 810A9248 0001 + 8109F3E6 0003 + cn Freeze Checkpoint Timer + 810CE1D2 BCCC + cn A perfect Lap + 800914B4 0001 + cn Access\All Gold Challenges\Race + 81092CCC 0000 + cn Access\All Gold Challenges\Time Trial + 8109354C 0000 + cn Access\All Gold Challenges\Weapon + 8109394C 0000 + cn Access\All Gold Challenges\Super Combo + 81093D4C 0000 + cn Access\All Gold Awards + 50001C2C 0000 + 800941BC 0003 + cn [Infinite Sheild] + 5000030C 0000 + 810A92C2 0000 + 810A92F2 0000 + cn always 1st + 810A9248 0001 + +crc 6D8DF08E-D008C3CF-C:50 +gn WWF No Mercy (E) + cn Infinite\Money\Championship Mode + cd For Championship Mode + 8109940A FFFF + cn Infinite\Money\Smackdown Mall Shop + cd For Smackdown Mall Shop + 8114FAD6 FFFF + cn Have All\Characters,Costumes, & Moves + 50000B02 0000 + 810BEE40 FFFF + cn Max Spirit\Player 1 + D015A5D1 0015 + 8015AF5F 00FF + cn Max Spirit\Player 2 + D015A5D1 0015 + 8015B2B7 00FF + cn Max Spirit\Player 3 + D015A5D1 0015 + 8015B60F 00FF + cn Max Spirit\Player 4 + D015A5D1 0015 + 8015B967 00FF + cn Always Special\Player 1 + D015A5D1 0015 + 8015AF9E 0004 + cn Always Special\Player 2 + D015A5D1 0015 + 8015B2F6 0004 + cn Always Special\Player 3 + D015A5D1 0015 + 8015B64E 0004 + cn Always Special\Player 4 + D015A5D1 0015 + 8015B9A6 0004 + cn Ultimate Code\Player 1 + D015A5D1 0015 + 8015AF5E 0064 + cn Ultimate Code\Player 2 + D015A5D1 0015 + 8015B2B6 0064 + cn Ultimate Code\Player 3 + D015A5D1 0015 + 8015B60E 0064 + cn Ultimate Code\Player 4 + D015A5D1 0015 + 8015B964 0064 + cn 2 Player Championship Mode + cd This lets player 2 play with you in championship mode so if you have a friend that you want to tag team up with in tag team championship now you can. + 810A755E 0002 + cn CPU To Human Control\Player 1 + 8015AF99 ???? 0017:"Human",0018:"CPU" + cn CPU To Human Control\Player 2 + 8015B2F1 ???? 0017:"Human",0018:"CPU" + cn CPU To Human Control\Player 3 + 8015B649 ???? 0017:"Human",0018:"CPU" + cn Can't Pin\Player 1 + cd Do not use with Auto Pin + 8016CE23 0004 + cn Can't Pin\Player 2 + cd Do not use with Auto Pin + 8016CE17 0004 + cn Can't Pin\Player 3 + cd Do not use with Auto Pin + 8016CE2F 0004 + cn Can't Pin\Player 4 + cd Do not use with Auto Pin + 8016CE3B 0004 + cn Auto-Pin\Player 1 + cd Do not use with Cant Pin + 8016CE23 0003 + cn Auto-Pin\Player 2 + cd Do not use with Cant Pin + 8016CE17 0003 + cn Auto-Pin\Player 3 + cd Do not use with Cant Pin + 8016CE2F 0003 + cn Auto-Pin\Player 4 + cd Do not use with Cant Pin + 8016CE3B 0003 + cn Play As\Player 1\Option 1 + cd Do not use this with anyother Play As Player 1 Option, only use one option at a time + 810AAAD0 ???? 0001:"Rock",0002:"SCSA",0003:"Undertaker",0004:"Kane",0005:"Richards",0006:"Mankind",0007:"Cactus",0008:"Mick",0009:"HBK",0101:"HHH",0102:"X-Pac",0103:"Mr. Ass",0104:"Road Dogg",0201:"Benoit",0202:"Malenko",0203:"Saturn",0204:"Guerrero",0301:"Jericho",0302:"Angle",0303:"Tazz",0304:"Test",0305:"GodFather",0306:"D`Lo",0307:"Venis",0308:"Shamrock" + cn Play As\Player 1\Option 2 + cd Do not use this with anyother Play As Player 1 Option, only use one option at a time + 810AAAD0 ???? 0401:"Rikishi",0402:"Sexay",0403:"Scotty",0404:"Edge",0405:"Christian",0406:"Matt",0407:"Jeff",0501:"Faarooq",0502:"Bradshaw",0503:"D-Von",0504:"Buh Buh",0505:"Hardcore",0506:"Crash",0507:"Bossman",0508:"Albert",0601:"Al",0602:"Blackman",0603:"Bulldog",0604:"Henry",0605:"Viscera",0606:"Andre",0607:"Buchanan",0608:"Rios",0609:"Taka",0701:"Chyna" + cn Play As\Player 1\Option 3 + cd Do not use this with anyother Play As Player 1 Option, only use one option at a time + 810AAAD0 ???? 0702:"Stephanie",0703:"Tori",0704:"Debra",0705:"Trish",0706:"Lita",0801:"Jacqueline",0802:"Linda",0803:"Kat",0804:"Moola",0805:"Ho",0901:"Vince",0902:"Shane",0903:"Hebner",0904:"Jim Ross" + cn Play As\Player 2\Option 1 + cd Do not use this with anyother Play As Player 2 Option, only use one option at a time + 810AAADC ???? 0001:"Rock",0002:"SCSA",0003:"Undertaker",0004:"Kane",0005:"Richards",0006:"Mankind",0007:"Cactus",0008:"Mick",0009:"HBK",0101:"HHH",0102:"X-Pac",0103:"Mr. Ass",0104:"Road Dogg",0201:"Benoit",0202:"Malenko",0203:"Saturn",0204:"Guerrero",0301:"Jericho",0302:"Angle",0303:"Tazz",0304:"Test",0305:"GodFather",0306:"D`Lo",0307:"Venis",0308:"Shamrock" + cn Play As\Player 2\Option 2 + cd Do not use this with anyother Play As Player 2 Option, only use one option at a time + 810AAADC ???? 0401:"Rikishi",0402:"Sexay",0403:"Scotty",0404:"Edge",0405:"Christian",0406:"Matt",0407:"Jeff",0501:"Faarooq",0502:"Bradshaw",0503:"D-Von",0504:"Buh Buh",0505:"Hardcore",0506:"Crash",0507:"Bossman",0508:"Albert",0601:"Al",0602:"Blackman",0603:"Bulldog",0604:"Henry",0605:"Viscera",0606:"Andre",0607:"Buchanan",0608:"Rios",0609:"Taka",0701:"Chyna" + cn Play As\Player 2\Option 3 + cd Do not use this with anyother Play As Player 2 Option, only use one option at a time + 810AAADC ???? 0702:"Stephanie",0703:"Tori",0704:"Debra",0705:"Trish",0706:"Lita",0801:"Jacqueline",0802:"Linda",0803:"Kat",0804:"Moola",0805:"Ho",0901:"Vince",0902:"Shane",0903:"Hebner",0904:"Jim Ross" + cn Play As\Player 3\Option 1 + cd Do not use this with anyother Play As Player 3 Option, only use one option at a time + 810AAAE8 ???? 0001:"Rock",0002:"SCSA",0003:"Undertaker",0004:"Kane",0005:"Richards",0006:"Mankind",0007:"Cactus",0008:"Mick",0009:"HBK",0101:"HHH",0102:"X-Pac",0103:"Mr. Ass",0104:"Road Dogg",0201:"Benoit",0202:"Malenko",0203:"Saturn",0204:"Guerrero",0301:"Jericho",0302:"Angle",0303:"Tazz",0304:"Test",0305:"GodFather",0306:"D`Lo",0307:"Venis",0308:"Shamrock" + cn Play As\Player 3\Option 2 + cd Do not use this with anyother Play As Player 3 Option, only use one option at a time + 810AAAE8 ???? 0401:"Rikishi",0402:"Sexay",0403:"Scotty",0404:"Edge",0405:"Christian",0406:"Matt",0407:"Jeff",0501:"Faarooq",0502:"Bradshaw",0503:"D-Von",0504:"Buh Buh",0505:"Hardcore",0506:"Crash",0507:"Bossman",0508:"Albert",0601:"Al",0602:"Blackman",0603:"Bulldog",0604:"Henry",0605:"Viscera",0606:"Andre",0607:"Buchanan",0608:"Rios",0609:"Taka",0701:"Chyna" + cn Play As\Player 3\Option 3 + cd Do not use this with anyother Play As Player 3 Option, only use one option at a time + 810AAAE8 ???? 0702:"Stephanie",0703:"Tori",0704:"Debra",0705:"Trish",0706:"Lita",0801:"Jacqueline",0802:"Linda",0803:"Kat",0804:"Moola",0805:"Ho",0901:"Vince",0902:"Shane",0903:"Hebner",0904:"Jim Ross" + cn Play As\Player 4\Option 1 + cd Do not use this with anyother Play As Player 4 Option, only use one option at a time + 810AAAF4 ???? 0001:"Rock",0002:"SCSA",0003:"Undertaker",0004:"Kane",0005:"Richards",0006:"Mankind",0007:"Cactus",0008:"Mick",0009:"HBK",0101:"HHH",0102:"X-Pac",0103:"Mr. Ass",0104:"Road Dogg",0201:"Benoit",0202:"Malenko",0203:"Saturn",0204:"Guerrero",0301:"Jericho",0302:"Angle",0303:"Tazz",0304:"Test",0305:"GodFather",0306:"D`Lo",0307:"Venis",0308:"Shamrock" + cn Play As\Player 4\Option 2 + cd Do not use this with anyother Play As Player 4 Option, only use one option at a time + 810AAAF4 ???? 0401:"Rikishi",0402:"Sexay",0403:"Scotty",0404:"Edge",0405:"Christian",0406:"Matt",0407:"Jeff",0501:"Faarooq",0502:"Bradshaw",0503:"D-Von",0504:"Buh Buh",0505:"Hardcore",0506:"Crash",0507:"Bossman",0508:"Albert",0601:"Al",0602:"Blackman",0603:"Bulldog",0604:"Henry",0605:"Viscera",0606:"Andre",0607:"Buchanan",0608:"Rios",0609:"Taka",0701:"Chyna" + cn Play As\Player 4\Option 3 + cd Do not use this with anyother Play As Player 4 Option, only use one option at a time + 810AAAF4 ???? 0702:"Stephanie",0703:"Tori",0704:"Debra",0705:"Trish",0706:"Lita",0801:"Jacqueline",0802:"Linda",0803:"Kat",0804:"Moola",0805:"Ho",0901:"Vince",0902:"Shane",0903:"Hebner",0904:"Jim Ross" + cn Cannot Be Grabbed\Player 1 + D115AEC6 0052 + 8115AEC6 0001 + D115AEC6 00A1 + 8115AEC6 00C1 + cn Cannot Be Punched\Player 1 + D115AEC6 002D + 8115AEC6 0001 + D115AEC6 0035 + 8115AEC6 00C1 + cn Cannot Be Knocked Down\Player 1 + D115AEC6 0031 + 8115AEC6 0001 + cn Wrestler Size & Shape\Player 1\Thin wrestler + cd Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time + 8106B468 3D80 + cn Wrestler Size & Shape\Player 1\Wide wrestler + cd Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time + 8106B468 3FFF + cn Wrestler Size & Shape\Player 1\Short wrestler + cd Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time + 8106B47C 3E80 + cn Wrestler Size & Shape\Player 1\Tall wrestler + cd Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time + 8106B47C 3FFF + cn Wrestler Size & Shape\Player 1\Flat wrestler + cd Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time + 8106B490 3D80 + cn Wrestler Size & Shape\Player 1\Bulgy wrestler + cd Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time + 8106B490 3FFF + cn Wrestler Size & Shape\Player 1\Giant wrestler + cd Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time + 8106B4A4 3E80 + cn Wrestler Size & Shape\Player 1\Small wrestler + cd Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time + 8106B4A4 3FFF + cn Wrestler Size & Shape\Player 2\Thin wrestler + cd Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time + 8006B528 3D80 + cn Wrestler Size & Shape\Player 2\Wide wrestler + cd Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time + 8006B528 3FFF + cn Wrestler Size & Shape\Player 2\Short wrestler + cd Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time + 8006B53C 3E80 + cn Wrestler Size & Shape\Player 2\Tall wrestler + cd Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time + 8006B53C 3FFF + cn Wrestler Size & Shape\Player 2\Flat wrestler + cd Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time + 8006B510 3DFF + cn Wrestler Size & Shape\Player 2\Bulgy wrestler + cd Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time + 8006B510 3FFF + cn Wrestler Size & Shape\Player 2\Giant wrestler + cd Do not use this with anyother Size & Shape Player 2 Option, only use one option at a time + 8006B564 3E80 + cn Wrestler Size & Shape\Player 2\Small wrestler + cd Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time + 8006B564 3FFF + cn Wrestler Size & Shape\Player 3\Thin wrestler + cd Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time + 8006B5E8 3D80 + cn Wrestler Size & Shape\Player 3\Wide wrestler + cd Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time + 8006B5E8 3FFF + cn Wrestler Size & Shape\Player 3\Short wrestler + cd Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time + 8006B5FC 3E80 + cn Wrestler Size & Shape\Player 3\Tall wrestler + cd Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time + 8006B5FC 3FFF + cn Wrestler Size & Shape\Player 3\Flat wrestler + cd Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time + 8006B610 3D80 + cn Wrestler Size & Shape\Player 3\Bulgy wrestler + cd Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time + 8006B610 3FFF + cn Wrestler Size & Shape\Player 3\Giant wrestler + cd Do not use this with anyother Size & Shape Player 3 Option, only use one option at a time + 8006B624 3E80 + cn Wrestler Size & Shape\Player 3\Small wrestler + cd Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time + 8006B624 3FFF + cn Wrestler Size & Shape\Player 4\Thin wrestler + cd Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time + 8006B6A8 3D80 + cn Wrestler Size & Shape\Player 4\Wide wrestler + cd Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time + 8006B6A8 3FFF + cn Wrestler Size & Shape\Player 4\Short wrestler + cd Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time + 8006B6BC 3E80 + cn Wrestler Size & Shape\Player 4\Tall wrestler + cd Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time + 8006B6BC 3FFF + cn Wrestler Size & Shape\Player 4\Flat wrestler + cd Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time + 8006B6D0 3D80 + cn Wrestler Size & Shape\Player 4\Bulgy wrestler + cd Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time + 8006B6D0 3FFF + cn Wrestler Size & Shape\Player 4\Giant wrestler + cd Do not use this with anyother Size & Shape Player 4 Option, only use one option at a time + 8006B6E4 3E80 + cn Wrestler Size & Shape\Player 4\Small wrestler + cd Do not use this with anyother Size & Shape Player 1 Option, only use one option at a time + 8006B6E4 3FFF + cn Z LADDER + cd Press Z for the ladder to appear, sometimes there is an invisable ladder + D1064880 2000 + 8116C768 0000 + D1064880 2000 + 8116C76A 0019 + D1064880 2000 + 8116C76C 0000 + D1064880 2000 + 8116C76E 0019 + D1064880 2000 + 8116C788 8104 + cn Replace Raw War with\TOKYO DOME + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 810528F4 7223 + 810528F6 0119 + 81050124 0100 + 81050126 0100 + 81050128 0100 + 8105012A 0100 + 8105012C 0100 + 8105012E 0100 + 81050130 0100 + 81050132 0100 + 81050134 0100 + 81050136 0100 + 8105010E 0999 + 81050400 03A5 + 81050402 0385 + 81050404 0385 + 81050406 0385 + 81050408 0385 + 8105040A 03A5 + 8105040C 03A5 + 8105040E 043F + 81050430 043F + 8105042C 03A5 + 81050430 21A5 + 81050432 0100 + 81050434 0000 + 81050436 2CFB + 81050438 0899 + 8105043C 03AF + 81050440 03AF + 81050442 03A5 + 810500E8 24C3 + 81050444 0100 + 81050190 09EF + 81050192 0000 + 81050194 09EF + 81050196 2CFD + cn Replace Raw War with\BARBEDWIRE ROPES + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 81050110 04F3 + 81050112 04F4 + 81050114 04F5 + 81050116 04F3 + 81050118 04F4 + 8105011A 04F5 + 8105011C 04F3 + 8105011E 04F4 + 81050120 04F5 + 81050124 2CFB + 81050126 2CFB + 81050128 2CFB + 8105012A 2CFB + 8105012C 2CFB + 8105012E 2CFB + 81050130 2CFB + 81050132 2CFB + 81050134 2CFB + 81079D90 3F6C + 81079D94 3F48 + 81079DA4 3D10 + 81079DB8 3F71 + 81079E6C 3F6C + 81079E80 3D10 + 81079E90 3F47 + 81079F48 3F6C + 81079F4C BF4C + 81079F5C 3D10 + 81079F70 3F71 + 8107A024 3F6C + 8107A028 3F28 + 8107A038 3D10 + 8107A04C 3F71 + 8107A100 3F6C + 8107A114 3D10 + 8107A124 3F23 + 8107A1DC 3F6C + 8107A1E0 BF2A + 8107A1F0 3D10 + 8107A204 3F71 + 8107A2B8 3F6C + 8107A2BC 3F02 + 8107A2CC 3D10 + 8107A2E0 3F71 + 8107A394 3F6C + 8107A3A8 3D10 + 8107A3B8 3F00 + 8107A470 3F6C + 8107A474 BF02 + 8107A484 3D10 + 8107A498 3F71 + 81050144 0569 + 81050154 07F7 + 810528F4 0C01 + 810528F6 0555 + 81050140 04F4 + 81050150 2CFB + 8107A628 3F60 + 8107A63C 3D10 + 8107A64C 3F52 + 8107A650 BF80 + 8107A8BC 3F56 + 8107A8C4 BA00 + 8107A8D0 3D10 + 8107A8DC 3C5A + 8107A8E0 3F30 + 8107A8E4 BF80 + 8107ADE4 3F56 + 8107ADEC BA00 + 8107ADF8 3D10 + 8107AE04 3C5A + 8107AE08 3F0E + 8107AE0C BF80 + 8107AB7C 3F00 + D115AF56 2EB2 + 8115AEC6 0017 + D115B2AE 2EB2 + 8115B21E 0017 + D115B606 2EB2 + 8115B570 0017 + D115B95E 2EB2 + 8115B8CE 0017 + 81052922 FFFF + 81052924 FFFF + 81052926 FFFF + cn Replace Raw War with\BARBEDWIRE SQUARE\Part 1 + cd Both Parts must be on for this Press the C Left Button to make your opponent bleed,These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 81050110 04F3 + 81050112 04F4 + 81050114 04F5 + 81050116 04F3 + 81050118 04F4 + 8105011A 04F5 + 8105011C 04F3 + 8105011E 04F4 + 81050120 04F5 + 81050124 2CFB + 81050126 2CFB + 81050128 2CFB + 8105012A 2CFB + 8105012C 2CFB + 8105012E 2CFB + 81050130 2CFB + 81050132 2CFB + 81050134 2CFB + 81079D90 3F6C + 81079D94 3F48 + 81079DA4 3D10 + 81079DB8 3F71 + 81079E6C 3F6C + 81079E80 3D10 + 81079E90 3F47 + 81079F48 3F6C + 81079F4C BF4C + 81079F5C 3D10 + 81079F70 3F71 + 8107A024 3F6C + 8107A028 3F28 + 8107A038 3D10 + 8107A04C 3F71 + 8107A100 3F6C + 8107A114 3D10 + 8107A124 3F23 + 8107A1DC 3F6C + 8107A1E0 BF2A + 8107A1F0 3D10 + 8107A204 3F71 + 8107A2B8 3F6C + 8107A2BC 3F02 + 8107A2CC 3D10 + 8107A2E0 3F71 + 8107A394 3F6C + 8107A3A8 3D10 + 8107A3B8 3F00 + 8107A470 3F6C + 8107A474 BF02 + 8107A484 3D10 + 8107A498 3F71 + 81050144 0569 + 81050154 07F7 + 810528F4 0C01 + 810528F6 0555 + 81050140 04F4 + 81050150 2CFB + 8107A628 3F60 + 8107A63C 3D10 + 8107A64C 3F52 + 8107A650 BF80 + 8107A8BC 3F56 + 8107A8C4 BA00 + 8107A8D0 3D10 + 8107A8DC 3C5A + 8107A8E0 3F30 + 8107A8E4 BF80 + 8107ADE4 3F56 + 8107ADEC BA00 + 8107ADF8 3D10 + 8107AE04 3C5A + 8107AE08 3F0E + 8107AE0C BF80 + 8107AB7C 3F00 + D115AF56 2EB2 + 8115AEC6 0017 + D115B2AE 2EB2 + 8115B21E 0017 + D115B606 2EB2 + 8115B570 0017 + D115B95E 2EB2 + 8115B8CE 0017 + 81052922 FFFF + 81052924 FFFF + 81052926 FFFF + 8116C330 0000 + 8116C332 000A + 8116C334 0000 + 8116C336 000A + 8116C378 42B4 + cn Replace Raw War with\BARBEDWIRE SQUARE\Part 2 + cd Both Parts must be on for this Press the C Left Button to make your opponent bleed,These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8116C382 0000 + 8116C38C FFFF + 81052C9C 0672 + 81052CA4 2CFB + D1064880 0002 + 8115B21E 002F + D1064886 0002 + 8115AEC6 002F + 8116C3E4 0000 + 8116C3E6 000C + 8116C3E8 0000 + 8116C3EA 000C + 8116C428 C3D4 + 8116C440 FFFF + 81052CB2 2CC2 + 81052CB4 0805 + 81052CB6 2CFB + D1064880 2000 + 8116C3E6 001F + D1064880 2000 + 8116C3EA 001F + D1064880 2000 + 81005592 3F81 + D1005592 3F81 + 8116C3E6 001F + D1064880 2000 + 81005592 3F81 + D1005592 3F81 + 8116C3EA 001F + D1064886 2000 + 8116C3E6 001F + D1064886 2000 + 8116C3E6 001F + D1064886 2000 + 81005592 3F81 + D1005592 3F81 + 8116C3EA 001F + 81052CF8 04F4 + 81052D00 2CFB + 8116C3E4 0000 + 8116C3E6 0015 + 8116C3E8 0000 + 8116C3EA 0015 + 8116C428 0000 + 8116C42A 0000 + 8116C42C 43EB + 8116C42E 0000 + 8116C430 C3A6 + 8116C432 0000 + 8116C436 0400 + 8116C43A 0000 + 8116C43E 0000 + 8116C440 FFFF + 8116C442 0000 + 810855A8 3F00 + 81085684 3F00 + 81085750 3F00 + 8108583C 3F00 + 81050100 2CFB + 8105010E 2CFB + cn Replace Raw War with\FLAMING TURNBUCKLES + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8116C334 FFFF + 8116C336 001F + 8116C374 C350 + 8116C376 FFF3 + 8116C378 4377 + 8116C37A 2689 + 8116C37C C380 + 8116C37E 0406 + 8116C382 0D14 + 8116C386 0FCC + 8116C38A 07DC + 8116C38C FFFF + 8116C38E FDE3 + 8116C3E8 FFFF + 8116C3EA 001F + 8116C428 C360 + 8116C42C 4370 + 8116C430 4376 + 8116C436 0D14 + 8116C43A 0FCC + 8116C43E 07DC + 8116C442 F9C4 + 8116C49C FFFF + 8116C49E 001F + 8116C4DC 4360 + 8116C4E0 4370 + 8116C4E4 4380 + 8116C4EA 0CD0 + 8116C4EE 0136 + 8116C4F2 04EE + 8116C4F6 F601 + 8116C550 FFFF + 8116C552 001F + 8116C590 434F + 8116C594 4370 + 8116C598 C36C + 8116C59E 0E70 + 8116C5A2 0F58 + 8116C5A6 0814 + 8116C5AA F1E6 + cn Replace Raw War with\REMOVE RING + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 81050150 0000 + 81050152 0000 + 81050154 0000 + 810500E8 0000 + 810855A8 3F00 + 81085684 3F00 + 81085750 3F00 + 8108583C 3F00 + 81079C08 3F00 + 81079C14 3F00 + 81079B10 3F00 + cn Replace Raw War with\BACKYARD ARENA + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8105010E 0F76 + 8105010C 0F76 + 810482E8 002F + 81050150 2CFD + 810528F4 33FF + 810528F6 33FF + 81050152 2DC7 + 81050114 04F4 + 81050116 04F5 + 8105011E 04F3 + 81050128 07FF + 8105012A 07FF + 81050132 07FF + 81079F48 400C + 81079F5C 3F00 + 81079F70 3FFF + 8107A024 4010 + 8107A038 3F00 + 8107A04C 4020 + 8107A060 3F84 + 8107A394 4012 + 8107A3A8 3F00 + 8107A3BC 4030 + 8107A3D0 3F84 + 8105042C 0949 + 81050436 07FF + 81050438 07FF + 8105043A 07FF + 8105043C 0000 + 8105043E 07FF + 81050440 0949 + 81050442 0949 + 81050430 0F76 + 81050128 07FF + 8105012A 07FF + 8105012C 0000 + 8105012E 07FF + 81050130 07FF + 81050132 07FF + 81050134 0000 + 81050136 08F9 + 81050196 2CFD + 81050194 09EF + 81050192 0000 + 81050190 09EF + 8116C49E 0019 + 8116C4B8 0004 + 8116C4DC C2E1 + 8116C4E0 42B4 + 810500FE 2D2D + 81050100 2D2D + 81050102 2D2D + 81050400 2DC7 + 81050402 2DC7 + 81050404 2DC7 + 81050406 2DC7 + 81050408 2DC7 + 8105040A 2DC7 + 8105040C 2DC7 + 8105040E 2DC7 + 50001002 0000 + 810501B8 0000 + 50000402 0000 + 810501E0 0000 + 50000902 0000 + 81050262 0000 + 50001402 0000 + 81050290 0000 + 50002C02 0000 + 810502EC 0000 + 8107941C 3FE0 + 81079428 3FFF + 810500EC 06FE + 810500EE 06FD + 810500F8 07FF + 810500FA 0997 + 81050110 06FC + 81050112 06FB + 8105011A 06FF + 8105011C 06FA + 81052CF0 2CC9 + 81052CF4 2D1B + 81052CD0 2CD1 + 81052CD4 0963 + 81052C84 2CBF + 81052C8A 0961 + 81052CB8 2CC4 + 81052CBC 2DD7 + 81052CC8 2CD1 + 81052CCC 2CFB + 81052C78 2CBC + 81052C80 2D31 + 81052CF8 2CC1 + 81052D00 2DD7 + cn Replace Raw War with\BACKYARD WEAK + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8105042C 0E88 + 8105042E 2D0D + 81050430 2D0D + 81050432 2D0D + 81050434 2D0D + 81050436 07FD + 8105043A 2CFB + 8105043C 2D0D + 8105043E 2D0D + 81050440 2D0D + 81050442 2D0D + 810500E8 2D0D + 8105010E 2D0D + 8105010C 2D0D + 81050150 2D0D + 81050196 2CFB + 81050124 2CFB + 81050126 2CFB + 81050128 2CFB + 8105012A 2CFB + 8105012C 2CFB + 8105012E 2CFB + 81050130 2CFB + 81050132 2CFB + 81050134 2CFB + 81050136 2CFB + 81050400 2D0D + 81050402 2D0D + 81050404 2D0D + 81050406 2D0D + 81050408 2D0D + 8105040A 2D0D + 8105040C 2D0D + 8105040E 2D0D + 810528F4 2D0D + 810528F6 2D0D + 81052CE8 2CC9 + 81052CEC 2D2D + cn Replace Raw War with\BARBEDWIRE ARENA + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8105042C 2CFB + 8105042E 2CFB + 81050430 2CFB + 81050432 2CFB + 81050434 2CFB + 81050436 2CFB + 81050438 2CFB + 8105043A 2CFB + 8105043C 2CFB + 8105043E 2CFB + 81050440 2CFB + 81050442 2CFB + 810500E8 2CFB + 8105010E 2CFB + 8105010C 2CFB + 81050150 2CFB + 81050196 2CFB + 81050124 2CFB + 81050126 2CFB + 81050128 2CFB + 8105012A 2CFB + 8105012C 2CFB + 8105012E 2CFB + 81050130 2CFB + 81050132 2CFB + 81050134 2CFB + 81050136 2CFB + 810528F4 DDDD + 810528F6 DDDD + 81052CE8 2CCA + 81052CEC 2CFB + 81050400 2CFB + 81050402 2CFB + 81050404 2CFB + 81050406 2CFB + 81050408 2CFB + 8105040A 2CFB + 8105040C 2CFB + 8105040E 2CFB + cn Replace Raw War with\DUDLEY ARENA + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8105042C 21A7 + 8105042E 2D0D + 81050432 2D0D + 81050436 21A7 + 8105043E 2D0D + 81050440 0000 + 81050442 0000 + 810500E8 2D0D + 8105010C 2CFD + 8105010E 2CFD + 81050150 2D29 + 81050152 2CFB + 81050400 09EF + 81050402 09EF + 81050404 0000 + 81050406 0000 + 81050408 0000 + 8105040A 0000 + 8105040C 09EF + 8105040E 09EF + 81050188 04F6 + 8105018A 04F7 + 8105018C 04F8 + 8105018E 04F9 + 81050190 09EF + 81050192 0000 + 81050194 09EF + 81050196 2D0D + 810528F4 6666 + 810528F6 6666 + 81052CE8 2CC2 + 81052CEC 2D0D + 81052D1C 2CD3 + 81052D1E 2CD4 + 81052D20 2CD5 + 81052D22 2CD6 + 81052D24 2CFD + 81052D26 2CFD + 81052D28 2CFB + 81052D2A 2CFB + 81050124 2CFD + 81050126 2CFD + 81050128 2CFD + 8105012A 2CFD + 8105012C 2CFD + 8105012E 2CFD + 81050130 2CFD + 81050132 2CFD + 81050134 2CFD + 81050136 2CFD + 81050154 2CFB + 811533F8 002E + cn Replace Raw War with\FLAME ARENA + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8105010E 0EFE + 8105010C 0EFE + 810528F4 2508 + 810528F6 2508 + 81050430 2401 + 81050430 2401 + 81050404 2401 + 81050406 2401 + 81050408 2401 + 81050409 2401 + 8105040A 2401 + 8105040C 2401 + 810500E8 2401 + cn Replace Raw War with\GREENWICH STREET ARENA + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 81050430 2DC5 + 81050436 0000 + 81050438 0000 + 8105043A 0000 + 8105043E 0000 + 810504E8 0EFE + 8105010E 2DC5 + 8105010C 2DC5 + 81050196 2CFD + 81050136 0FB6 + 81050134 0FC6 + 81050132 0FB6 + 81050130 0FC6 + 8105012E 0FB6 + 8105012C 0FC6 + 8105012A 0FB6 + 81050128 0FC6 + 81050126 0FB6 + 81050124 0FC6 + 81050440 0000 + 81050442 0000 + 50002C02 0000 + 81050378 0000 + 50002C02 0000 + 810502EC 0000 + 50001402 0000 + 81050290 0000 + 50000902 0000 + 81050262 0000 + 50000402 0000 + 810501CE 0000 + 50001002 0000 + 810501B8 0000 + 50000402 0000 + 810501E0 0000 + 8105042C 2D0D + 81050430 0000 + 81050150 24F0 + cn Replace Raw War with\HHH ARNEA + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8105040E 24EF + 8105040C 24EF + 8105040A 24EF + 81050408 24EF + 81050406 24EF + 81050404 24EF + 81050402 24EF + 81050400 24EF + 81050436 24E9 + 81050440 24E9 + 81050442 24E9 + 8105043E 24EF + 8105042E 24EF + 8105043C 24EF + 8105042C 24E9 + 8105010E 24E9 + 8105010C 24E9 + 81050196 24E9 + 8105042E 24EF + 81050432 24EF + 810500F8 24EF + 810500FA 24EF + 810500FC 24EF + 810500FC 24EF + 81050100 24EF + 81050100 24EF + 81052CE8 2CCA + 81052CEC 24EF + 81050150 24E9 + 81050152 24E9 + 81050154 24E9 + 810528F4 24E9 + 810528F6 24E9 + cn Replace Raw War with\HOSPITAL ARENA + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8105042C 0949 + 8105042E 283F + 81050428 0949 + 81050430 0949 + 81050430 0949 + 81050436 096B + 81050438 0993 + 8105043A 096B + 8105043E 283F + 81050440 283F + 81050442 283F + 810504E8 0949 + 81050150 283F + 81050196 283F + 81050400 283F + 81050402 283F + 81050404 283F + 81050406 283F + 81050408 283F + 8105040A 283F + 8105040C 283F + 8105040E 283F + 810500F8 283F + 810500FA 283F + 810500FC 283F + 810500FE 283F + 81050100 283F + 81050100 283F + 81052CE8 2CCA + 81052CEC 283F + 8105010E 283F + 8105010C 283F + 81050124 0949 + 81050126 0949 + 81050128 0949 + 8105012A 0949 + 8105012C 0949 + 8105012E 0949 + 81050130 0949 + 81050132 0949 + 81050134 0949 + 81050136 0949 + 810500E8 0949 + 810528F4 0000 + 81052CE0 2CC9 + cn Replace Raw War with\KANE ARENA + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8105042C 0A61 + 8105042E 0A61 + 81050428 2B6C + 81050430 2B6C + 81050430 2B6C + 81050436 2B57 + 81050438 2B57 + 8105043A 2B57 + 8105043E 0A61 + 81050440 2B57 + 81050442 2B57 + 810500E8 1B1E + 8105010E 2D37 + 8105010C 209F + 81050194 0955 + 81050196 2B57 + 81050400 2699 + 81050402 2699 + 81050404 2699 + 81050406 2699 + 81050408 2699 + 8105040A 2699 + 8105040C 2699 + 8105040E 2699 + cn Replace Raw War with\SHIMMER ARENA + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8105042C 1932 + 8105042E 1932 + 81050430 1932 + 81050434 1932 + 81050432 1932 + 81050436 1932 + 81050438 1932 + 8105043A 1932 + 8105043E 1932 + 81050440 1932 + 81050442 1932 + 81050150 1932 + 81050152 1932 + 81050154 1932 + 81050190 1932 + 81050192 1932 + 81050194 1932 + 81050196 1932 + 81050124 1932 + 81050126 1932 + 81050128 1932 + 8105012A 1932 + 8105012C 1932 + 8105012E 1932 + 81050130 1932 + 81050132 1932 + 81050134 1932 + 81050136 1932 + 810500E8 1932 + 8105010E 1932 + 8105010C 1932 + cn Replace Raw War with\SPACE SHIP ARENA + cd These Replace Raw War Arena With what ever coice you make. Only use 1 option at a time. + 8105042C 094D + 8105042E 0953 + 81050430 0953 + 81050432 0F0E + 81050434 0953 + 81050436 0F0E + 81050438 0899 + 8105043C 0953 + 8105043E 0899 + 81050440 0963 + 81050442 0963 + 81050400 0953 + 81050402 0953 + 81050404 0953 + 81050406 0953 + 81050408 0953 + 8105040A 0953 + 8105040C 0953 + 8105040E 0953 + 810500E8 0A75 + 810528F4 7223 + 810528F6 0119 + 81050150 0963 + 81050152 0963 + 81050190 0953 + 81050192 0953 + 81050194 0953 + 81050196 0963 + 8105010E 0F0E + 8105010C 0F0E + 81050124 0F10 + 81050126 0F10 + 81050128 0F10 + 8105012A 0F10 + 8105012C 0F10 + 8105012E 0F10 + 81050130 0F10 + 81050132 0F10 + 81050134 0F10 + 81050136 0F10 + 810500F8 0963 + 810500FA 0963 + 810500FC 0963 + 810500FE 0963 + 81050100 0963 + 81050102 0963 + 81052CE8 2CCA + 81052CEC 0963 + cn Tables\IN RING TABLE\Part 1 + cd To Make the Table look broken Keep the Z Button press down, To make player stand on the Table, Stand next to it & Keep C-Right Pressed Down.Put all Parts on Together for this Cheat to work + 81052CF0 06E1 + 81052CF4 09F1 + 81052CF8 06E2 + 81052D00 09F1 + 81052D0C 06E3 + 81052D0E 06E4 + 81052D10 09EF + 81052D12 09EF + 81052D14 06E5 + 81052D16 06E6 + 81052D18 09EF + 81052D1A 09EF + D1064880 0001 + 8115AFB0 432C + D1064880 0001 + 8115B308 432C + D1064880 2000 + 8115AFB0 42B4 + D1064880 2000 + 8115B308 42B4 + 8116C330 0000 + 8116C332 0014 + 8116C334 0000 + 8116C336 0014 + 8116C374 4210 + 8116C376 C0B1 + 8116C378 432F + 8116C37A 51DC + 8116C37C 4210 + 8116C37E 92F1 + 8116C382 0800 + 8116C386 05A0 + 8116C38A 0800 + 8116C38C FFFF + 8116C38E F3BC + 8116C3E4 0000 + 8116C3E6 0015 + 8116C3E8 0000 + 8116C3EA 0015 + 8116C428 4210 + 8116C42A C0B1 + 8116C42C 432F + 8116C42E 51DC + 8116C430 4210 + 8116C432 92F1 + 8116C436 0800 + 8116C43A 05A0 + 8116C43E 0800 + 8116C440 FFFF + 8116C442 F3BC + D1064880 2000 + 8116C378 42E0 + cn Tables\IN RING TABLE\Part 2 + cd To Make the Table look broken Keep the Z Button press down, To make player stand on the Table, Stand next to it & Keep C-Right Pressed Down.Put all Parts on Together for this Cheat to work + D1064880 2000 + 8116C382 07E0 + D1064880 2000 + 8116C38A 0680 + D1064880 2000 + 8116C42C 42E0 + D1064880 2000 + 8116C436 0820 + D1064880 2000 + 8116C43E 0980 + 8116C498 0000 + 8116C49A 0017 + 8116C49C 0000 + 8116C49E 0017 + 8116C4DC 4210 + 8116C4DE C0B1 + 8116C4E0 432A + 8116C4E2 51DC + 8116C4E4 4210 + 8116C4E6 92F1 + 8116C4EA 0800 + 8116C4EE 05A0 + 8116C4F2 0800 + 8116C4F4 FFFF + 8116C4F6 F3BC + 8116C54C 0000 + 8116C54E 0018 + 8116C550 0000 + 8116C552 0018 + 8116C590 4210 + 8116C592 C0B1 + 8116C594 432A + 8116C596 51DC + 8116C598 4210 + 8116C59A 92F1 + 8116C59E 0800 + 8116C5A2 05A0 + 8116C5A6 0800 + 8116C5A8 FFFF + 8116C5AA F3BC + D1064880 2000 + 8116C4E0 42E0 + D1064880 2000 + 8116C4EA 07E0 + D1064880 2000 + 8116C4F2 0680 + D1064880 2000 + 8116C594 42E0 + D1064880 2000 + 8116C59E 0820 + D1064880 2000 + 8116C5A6 0980 + cn Novalty\Truck In The Crowd + 81050110 0747 + 81050112 0748 + 81050114 0749 + 81050116 074A + 81050118 074B + 81050124 0A4B + 81050126 0A43 + 81050128 0A4B + 8105012A 0A43 + 8105012C 0A43 + 8105012E 0A43 + 8105011A 074C + 8105011C 074D + 81050130 0A43 + 8105011E 074E + 81050132 0A43 + 81050120 0746 + 81050134 0A4B + 81050122 0743 + 81050136 0A4B + D1064880 2000 + 8115AFB0 42EE + D1064880 2000 + 8115B308 42EE + cn CPU To Human Control\Player 4 + 8015B9A1 ???? 0017:"Human",0018:"CPU" + cn Clock At 00:00 + 8115AB1E 0000 + 810A99F2 0000 + cn Hacked Moves\Dragon Screw Stunner + cd Dragon Screw 02 P1 does a Dragon Screw then picks up P2 (still holding his leg) and spins him around and gives him a Stone Cold Stunner + D106B454 3749 + D106B456 0094 + 8106B460 00E9 + D106B454 3749 + D106B456 0094 + 8106B462 B9BE + D106B514 374A + D106B516 0094 + 8106B520 00E9 + D106B514 374A + D106B516 0094 + cn Hacked Moves\Morality Check to Back of head + cd Replaces: Back Clothesline P1 is immediately backed up and does the Morality Check to P2 in the back of the head (misses by a little) + D106B454 3892 + D106B456 0000 + 8106B460 00B3 + D106B454 3892 + D106B456 0000 + 8106B462 194C + cn Hacked Moves\Dragon Screw Suplex + cd Replaces: Double Dragon Screw 02 P1 does a Dragon screw then picks then up (still holding their feet) and does a capture suplex. + D106B454 3749 + D106B456 007C + 8106B460 00AD + D106B454 3749 + D106B456 007C + 8106B462 DB2A + D106B514 374A + D106B516 007C + 8106B520 00AD + D106B514 374A + D106B516 007C + 8106B522 EAE0 + D106B454 3749 + D106B456 00A5 + 8115AF52 0000 + D106B514 374A + D106B516 00A5 + 8115B2AA 0000 + cn Hacked Moves\Dominator into HHH Facebuster + cd Replaces: Dominator + D106B454 3810 + D106B456 005C + 8106B560 011A + D106B454 3810 + D106B456 005C + 8106B562 A256 + D106B514 3811 + D106B516 005C + 8106B520 011A + D106B514 3811 + D106B516 005C + 8106B522 ACB0 + D106B454 3810 + D106B456 0075 + 8115AF52 0000 + cn Hacked Moves\Capture Tazzplex + cd Replaces: Capture Suplex P1 grabs P2's feet like a capture suplex, then lets go & does a Tazzplex. + D106B454 3689 + D106B456 0021 + 8106B460 00BC + D106B454 3689 + D106B456 0021 + 8106B462 A5E2 + D106B514 368A + D106B516 0021 + 8106B520 00BC + D106B514 368A + D106B516 0021 + 8106B522 B6BE + cn Hacked Moves\Running Rock Bottom + cd Replaces: Farooq Spinebuster P2 runs into P1 and P1 delivers a RockBottom to P2. + D106B454 3A80 + D106B456 0000 + 8106B460 00C1 + D106B454 3A80 + D106B456 0000 + 8106B462 F7A2 + D106B514 3A81 + D106B516 0000 + 8106B520 00C2 + D106B514 3A81 + D106B516 0000 + 8106B522 1210 + cn Hacked Moves\Running Tazplex + cd Replaces: Underhook Belly to Belly P2 runs into P1 and P1 does a Tazplex to P2. + D106B454 3A7A + D106B456 0000 + 8106B460 00BC + D106B454 3A7A + D106B456 0000 + 8106B462 A51E + D106B514 3A7B + D106B516 0000 + 8106B520 00BC + D106B514 3A7B + D106B516 0000 + 8106B522 B5FA + cn Tables\MOVABLE TABLES\Part 1 + cd You must use both parts for this cheat to work + 81052C24 06E1 + 81052C26 06E3 + 81052C2C 09F1 + 81052C2E 09EF + 81052C30 06E2 + 81052C32 06E5 + 81052C38 09F1 + 81052C3A 09EF + 81052C48 06E4 + 81052C4A 06E6 + 81052C50 09EF + 81052C52 09EF + 8116C3E4 0000 + 8116C3E6 0001 + 8116C3E8 0000 + 8116C3EA 0001 + 8116C498 0000 + 8116C49A 0003 + 8116C49C 0000 + 8116C49E 0003 + 8116C330 0000 + 8116C332 0000 + 8116C334 0000 + 8116C336 0000 + D116C556 0000 + 8116C33A 0000 + D116C33A 0000 + 8116C3EE 0000 + D116C3EE 0000 + 8116C4A2 0000 + D116C556 0001 + 8116C33A 0001 + D116C33A 0001 + 8116C3EE 0001 + D116C3EE 0001 + 8116C4A2 0001 + D116C556 0002 + 8116C33A 0002 + D116C33A 0002 + 8116C3EE 0002 + D116C3EE 0002 + 8116C4A2 0002 + D116C556 0003 + 8116C33A 0003 + D116C33A 0003 + 8116C3EE 0003 + D116C3EE 0003 + 8116C4A2 0003 + D116C556 FFFF + 8116C33A FFFF + D116C33A FFFF + 8116C3EE FFFF + D116C3EE FFFF + 8116C4A2 FFFF + D216C556 FFFF + 81079B10 3F80 + D1064886 2000 + 81079B10 3F81 + D106488C 2000 + 81079B10 3F81 + D1064892 2000 + 81079B10 3F81 + cn Tables\MOVABLE TABLES\Part 2 + cd You must use both parts for this cheat to work + D116C33A FFFF + 8116C382 0000 + D116C382 0000 + 8116C386 0000 + D116C386 0000 + 8116C38A 0000 + D116C38A 0000 + 8116C38E 0000 + D116C38E 0000 + 8116C436 0000 + D116C436 0000 + 8116C43A 0000 + D116C43A 0000 + 8116C43E 0000 + D116C43E 0000 + 8116C442 0000 + D116C442 0000 + 8116C4EA 0000 + D116C4EA 0000 + 8116C4EE 0000 + D116C4EE 0000 + 8116C4F2 0000 + D116C4F2 0000 + 8116C4F6 0000 + D116C594 42B4 + D116C556 FFFF + 8116C378 4335 + D116C378 4335 + 8116C42C 4335 + D116C42C 4335 + 8116C4E0 4335 + D116C594 3DC7 + D116C556 FFFF + 8116C378 42B0 + D116C378 42B0 + 8116C42C 42B0 + D116C42C 42B0 + 8116C4E0 42B0 + D1064880 2000 + 81079B10 3F81 + D1079B10 3F81 + D116C594 42B4 + D116C556 FFFF + 8116C378 42F0 + D116C378 42F0 + 8116C42C 42F0 + D116C42C 42F0 + 8116C4E0 42F0 + D1079B10 3F81 + 8116C38A 0F00 + D116C38A 0F00 + 8116C43E 0100 + D116C594 3C93 + 8116C378 42B0 + 81052D18 0000 + 81052D1A 0000 + D116C54C 0000 + 8116C54E 0018 + D116C550 0000 + 8116C552 0018 + cn Tables\Sabu Table + cd Breakable/Fixable/Rebreakable/Refixable press Z to break, C-right + Cdown to fix + 8116C49A 000C + 8116C49E 000C + 8116C4DC 43CC + 8116C4E0 42E6 + 8116C4E4 C2C5 + 8116C4EE 0800 + 8116C602 000C + 8116C606 000C + 8116C648 42E6 + 8116C644 43CC + 8116C64C C314 + 81052C54 06E3 + 81052C5C 09EF + 8116C6F8 43CC + 8116C6FC 42F0 + 8116C700 C2F1 + 8116C70A 0400 + 8116C428 43CC + 8116C430 C2D0 + 8116C42C 42F0 + 8116C43A 0C00 + 8116C6B6 0004 + 8116C6BA 0004 + 8116C3E6 0004 + 8116C3EA 0004 + D1064880 2000 + 81005592 3F81 + D1005592 3F81 + 8116C4EA 0F00 + D1005592 3F81 + 8116C652 0100 + D1005592 3F81 + 8116C4E0 4240 + D1005592 3F81 + 8116C648 4240 + D1064880 0005 + 81005CD4 3F83 + D1005CD4 3F83 + 8116C4EA 0000 + D1005CD4 3F83 + 8116C652 0000 + D1005CD4 3F83 + 8116C4E0 42E6 + D1005CD4 3F83 + 8116C648 42E6 + D1005CD4 3F83 + D1064880 2000 + 81005CD4 0000 + +crc C71353BE-AA09A6EE-C:50 +gn WWF WrestleMania 2000 (E) + cn Have All Characters + 8109ED5A FFFF + cn Infinite Create-A-Wrestler Attribute Points + 8011A81B 001E + cn Timer Is Always 00:00 + 8016F0AF 0000 + cn Max Attributes + 8011A811 0032 + 8011A813 0032 + 8011A815 0032 + 8011A817 0032 + 8011A819 0032 + cn Weapon Select\Player 1 + 81167236 0300 + 81166D90 ???? 0000:"Broom",0101:"Shovel",0202:"Red And White Hockey Stick",0303:"Guitar",0404:"Night Stick",0505:"Head",0606:"Black Hockey Stick",0707:"Bottle",0808:"2x4",0909:"Big Purple Sheet",0A0A:"White Jug",0B0B:"Suit Case",0C0C:"Stick",0D0D:"Head",0E0E:"Big Mallot",0F0F:"Black Microphone",1010:"BaseBall Bat",1111:"Folding Chair",1212:"Board",1313:"Stairs",1414:"Trashcan",FFFF:"Nothing" + 81166D92 0000 + 80166E50 0000 + cn Weapon Select\Player 2 + 811676CA 0300 + 81166DC0 ???? 0000:"Broom",0101:"Shovel",0202:"Red And White Hockey Stick",0303:"Guitar",0404:"Night Stick",0505:"Head",0606:"Black Hockey Stick",0707:"Bottle",0808:"2x4",0909:"Big Purple Sheet",0A0A:"White Jug",0B0B:"Suit Case",0C0C:"Stick",0D0D:"Head",0E0E:"Big Mallot",0F0F:"Black Microphone",1010:"BaseBall Bat",1111:"Folding Chair",1212:"Board",1313:"Stairs",1414:"Trashcan",FFFF:"Nothing" + 80166DC2 0001 + 80166E51 0001 + cn Weapon Select\Player 3 + 81167B5E 0300 + 81166DF0 ???? 0000:"Broom",0101:"Shovel",0202:"Red And White Hockey Stick",0303:"Guitar",0404:"Night Stick",0505:"Head",0606:"Black Hockey Stick",0707:"Bottle",0808:"2x4",0909:"Big Purple Sheet",0A0A:"White Jug",0B0B:"Suit Case",0C0C:"Stick",0D0D:"Head",0E0E:"Big Mallot",0F0F:"Black Microphone",1010:"BaseBall Bat",1111:"Folding Chair",1212:"Board",1313:"Stairs",1414:"Trashcan",FFFF:"Nothing" + 80166DF2 0002 + 80166E52 0002 + cn Weapon Select\Player 4 + 81167FF2 0300 + 81166E18 ???? 0000:"Broom",0101:"Shovel",0202:"Red And White Hockey Stick",0303:"Guitar",0404:"Night Stick",0505:"Head",0606:"Black Hockey Stick",0707:"Bottle",0808:"2x4",0909:"Big Purple Sheet",0A0A:"White Jug",0B0B:"Suit Case",0C0C:"Stick",0D0D:"Head",0E0E:"Big Mallot",0F0F:"Black Microphone",1010:"BaseBall Bat",1111:"Folding Chair",1212:"Board",1313:"Stairs",1414:"Trashcan",FFFF:"Nothing" + 81166E1A 0003 + 80166E53 0003 + cn Always Special\Player 1 + 80167235 0004 + cn Always Special\Player 2 + 801676C9 0004 + cn Always Special\Player 3 + 80167B5D 0004 + cn Always Special\Player 4 + 80167FF1 0004 + cn Specials Don't Run Out + 8112AD94 2400 + cn Max Spirit\Player 1 + 801671F5 00FF + cn Always Normal Spirit\Player 1 + 801671F5 0032 + cn No Spirit\Player 1 + 801671F5 0000 + cn Max Spirit\Player 2 + 80167689 00FF + cn Always Normal Spirit\Player 2 + 80167689 0032 + cn No Spirit\Player 2 + 80167689 0000 + cn Max Spirit\Player 3 + 80167B1D 00FF + cn Always Normal Spirit\Player 3 + 80167B1D 0032 + cn No Spirit\Player 3 + 80167B1D 0000 + cn Max Spirit\Player 4 + 80167FB1 00FF + cn Always Normal Spirit\Player 4 + 80167FB1 0032 + cn No Spirit\Player 4 + 80167FB1 0000 + cn Ultimate Codes\Player 1 + 801671F4 0064 + cn Ultimate Codes\Player 2 + 80167688 0064 + cn Ultimate Codes\Player 3 + 80167B1C 0064 + cn Ultimate Codes\Player 4 + 80167FB0 0064 + cn Easy Pins & Longer Submissions\Player 2 + 80167688 0064 + cn Easy Pins & Longer Submissions\Player 3 + 80167B1C 0064 + cn Easy Pins & Longer Submissions\Player 4 + 80167FB0 0064 + cn Easy Pins & Longer Submissions\Player 1 + 801671F4 0064 + +crc 0A1667C7-293346A6-C:50 +gn Xena Warrior Princess - Talisman of Fate (E) + cn Infinite Health\Player 1 + 810B5EF0 42C8 + cn Invisibility\Player 1 + 810BF3A2 0001 + cn Infinite Health\Player 2 + 810B60D4 42C8 + cn 1 Win To Win\Player 1 + D00C0983 0000 + 800C0983 0001 + cn 1-Hit Death to Player 2\Player 1 + D10B60D4 42C8 + 810B60D4 4080 + cn Player 2 Has No Energy\Player 1 + 810B60D4 C080 + cn P2 Never Wins\Player 1 + 800C0985 0000 + cn Needs 1 Win To Win\Player 2 + D00C0985 0000 + 800C0985 0001 + cn 1-Hit Death to Player 1\Player 2 + D10B5EF0 42C8 + 810B5EF0 4080 + cn Player 1 Has No Energy\Player 2 + 810B5EF0 C080 + cn P1 Never Wins\Player 2 + 800C0983 0000 + cn Join River Team + cd Select Quest Mode + 810BF482 0001 + cn Fight Forest Team + cd Select Hardest Difficulty + Quest Mode + 810BF482 0001 + cn Unlock Titan Difficulty Level + 810BF4D2 0001 + +crc D3F97D49-6924135B-C:50 +gn Yoshi's Story (E) +//--------------- PAL (A) Region Cheat Codes + cn Infinite\Health + cd This is for All Yoshis All levels + 50000804 0000 + 800F954F 0008 + cn Infinite\Lives + cd This is for All Yoshis All levels + 800F958F 00FF + cn Infinite Eggs + cd This is for All Yoshis All levels + 80285078 0006 + +crc 155B7CDF-F0DA7325-C:55 +gn BANJO TOOIE + cn Infinite\Energy\Banjo and Kazooie + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 8011FFA9 0063 + 81120584 0A0A + cn Infinite\Energy\Snowball + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 8011FFA9 0063 + 80120587 0005 + cn Infinite\Energy\Bee + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 8011FFA9 0063 + 80120593 000A + 80120594 000A + cn Infinite\Energy\Washing Machine + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 8011FFA9 0063 + 81120596 0A0A + cn Infinite\Energy\Stony + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 8011FFA9 0063 + 80120599 000A + 8011B44A 000A + cn Infinite\Energy\Banjo + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 8011FFA9 0063 + 8012059F 000A + 801205A0 000A + cn Infinite\Energy\Kazooie + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 8011FFA9 0063 + 811205A2 0A0A + cn Infinite\Energy\Submarine + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 8011FFA9 0063 + 801205A5 000A + 801205A6 000A + cn Infinite\Energy\Mumbo + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 8011FFA9 0063 + 811205A8 0A0A + cn Infinite\Energy\Detonator + cd With Infinite Energy On Avoid Picking up the ! Or ? Stop Energy Honey Combs or you will be stuck. + 8011FFA9 0063 + 811205AE 0A0A + cn Infinite\Energy\T-Rex Baby + 8011FFA9 0063 + 801205BF 000A + 801205C0 000A + cn Infinite\Air + 8112FDC2 42C8 + cn Instant Warp\Options\Not sure + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B284 0000 + 8012C390 ???? 00FC:"Lord woo fak fak",00F9:"Mr Patch",0121:"Inside Chuffy's wagon",0134:"Mumbo's Skull",0135:"Humba Wumba's wigwam 1",0157:"Humba Wumba's wigwam 2",019B:"Jingalings Zombified Palace",01A6:"Smuggler cavern",0141:"Inside the digger tunnel",0143:"Bottles house",0169:"Bottles house still",018A:"HAG Inside",019A:"HAG1 Final Boss" + 8012C393 0001 + cn Instant Warp\Options\Cauldron Keep + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B284 0000 + 8112C390 ???? 015D:"Cauldron Keep",015E:"The gatehouse",015F:"Tower of Tragedy Quiz",0160:"Gun chamber",016A:"Gun room still",017B:"Crazy Castle Stockade balloon burst multi",017C:"Crazy Castle Stockade Jump the hoops multi",017D:"Grunty Industries packing game",0180:"Colosseum kickball arena",0186:"Dodgems" + 8012C393 0001 + cn Instant Warp\Options\Spiral Mountain + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B284 0000 + 8112C390 ???? 00AD:"Grunty's Old Lair",00AE:"Behind The Waterfall",00AF:"Top Of Castle",0173:"Banjo's house" + 8012C393 0001 + cn Instant Warp\Options\Jinjo Village + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B284 0000 + 8112C390 ???? 0142:"Jinjo Village",0144:"King Jingalings throne room",0143:"Bottles house",0145:"Green Jinjo's House",0146:"Black Jinjo's House",0147:"Yellow Jinjo's House",0148:"Blue Jinjo's House",014A:"Brown Jinjo's House",014B:"Orange Jinjo's House",014C:"Purple Jinjo's House",014D:"Red Jinjo's House",014E:"White Jinjo's House" + 8012C393 0001 + cn Instant Warp\Options\Mayahem Temple + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B284 0000 + 8112C390 ???? 00B6:"Humba's Wigwam",00B7:"Mumbo's skull",00B8:"The Temple",00B9:"Prison Compound",00BC:"Code chamber",00C4:"Jade Snake Grove",00C5:"Treasure Chamber",00C6:"Kickball Arena",0177:"Targitzan's Slighty Sacred Temple",0178:"Inside Targitzans Temple",0179:"Targitzan Temple Lobby",017A:"Targitzan's Temple Boss",017F:"Mayan Kickball Arena",0166:"Multi",0167:"Still",00C8:"Kickball Arena",00C9:"Kickball Arena" + 8012C393 0001 + cn Instant Warp\Options\Glitter Gulch Mine + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B284 0000 + 8112C390 ???? 00C7:"Mine",00CA:"Fuel depot",00CB:"Crushing shed",00CC:"Flooded caves",00CD:"Water storage",00CE:"Waterfall cavern",00CF:"Power hut basement",00D0:"Chuffy's cab",00D1:"Inside chuffy's boiler boss",00D2:"Gloomy caverns",00D3:"Generator caverns",00D4:"Power hut",00D5:"Wumba's wigwam",00D7:"Train station",00D8:"Prospectors hut",00D9:"Mumbo's hut",00DA:"Toxic gas cave",00DB:"Canary cave",00DC:"Ordnance storage",00E9:"Humba",0126:"Water supply pipe",0163:"Ordnance Storage entrance",0164:"Ordnance Storage game",0165:"Ordnance Storage game Multi",016F:"Testing",0170:"Testing",0171:"Mumbo's skull" + 8012C393 0001 + cn Instant Warp\Options\Witchy World + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B284 0000 + 8112C390 ???? 00D6:"Witcy World",00DD:"Dodgem dome lobby",00DE:"Dodgem challenge \"1 vs 1\"",00DF:"Dodgem challenge \"2 vs 1\"",00E0:"Dodgem challenge \"3 vs 1\"",00E1:"Crazy castle stockade",00E2:"Crazy castle lobby",00E3:"Crazy castle pump room",00E4:"Balloon burst game",00E5:"Hoop hurry game",00E6:"Star spinner",00E7:"The inferno",00EA:"Cave of horrors",00EB:"Haunted cavern",00EC:"Train station",0124:"Saucer of Peril",013B:"Crazy castle stockade \"sop\"",013C:"Star spinner \"sop\"",0176:"Mumbo's skull" + 8012C393 0001 + cn Instant Warp\Options\Jolly Roger's Lagoon + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B284 0000 + 8112C390 ???? 00ED:"Jolly's",00EE:"Pawno's emporium",00EF:"mumbo's skull",00F4:"Ancient Swimming Baths",00F6:"Electric Eels lair",00F7:"Seaweed Sanctum",00F8:"Inside the big fish",00FA:"temple of the fishes",01A8:"Atlantis",01A9:"Seabottom",0181:"sea bottom cavern",0182:"submarine multi",01A7:"Jolly Roger's Lagoon",00FF:"Blubber's wave race hire" + 8012C393 0001 + cn Instant Warp\Options\Terrydacty Land + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B284 0000 + 8112C390 ???? 0112:"Terrydacty Land",0113:"Terry's nest",0114:"Train station",0115:"Oogle boogles cave",0116:"Inside the mountain",0117:"River passage",0118:"Styracosaurus family cave",0119:"Unga bunga's cave",011A:"Stomping plains",011B:"Bonfire caverns",011E:"Humba's Wigwam",0123:"Inside chompa's belly",0183:"Chompa's belly multi" + 8012C393 0001 + cn Instant Warp\Options\Grunty Industries + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B284 0000 + 8112C390 ???? 0100:"Outside",0101:"Inside",0102:"Train station",0103:"Workers quarters",0104:"Trash compactor",0105:"Elevator shaft",0106:"Floor 2",0107:"Floor 2 \"electromagnet chamber\"",0108:"Floor 3",0109:"Floor 3 \"boiler plant\"",010A:"Floor 3 \"packing room\"",010B:"Floor 4",010C:"Floor 4 \"cable room\"",010D:"Floor 4 \"quality control\"",010E:"Floor 5",010F:"Basement",0110:"Basement \"repair depot",0111:"Basement \"waste disposal\"",0125:"Water supply pipe",0172:"Mumbo's skull",0162:"Floor 4 \"clinkers cavern\"",0187:"Sewer entrance" + 8012C393 0001 + cn Instant Warp\Options\Hailfire Peaks + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B284 0000 + 8112C390 ???? 0127:"Lava side",0128:"Icy side",0129:"Lava train station",012A:"Ice train station",012B:"Chilli billi",012C:"Chilly willy",012D:"Colosseum kickball stadium lobby",0131:"Boggy's igloo",0132:"Icicle grotto",0133:"Inside the volcano",0168:"Icy side still" + 8012C393 0001 + cn Instant Warp\Options\Cloud Cuckoo Land + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B284 0000 + 8112C390 ???? 0136:"Cloud Cuckoo Land 1",0137:"Inside the trashcan",0138:"Inside the cheesewedge",0139:"Zubba's nest",013A:"Central cavern",013D:"Inside the pot o gold",013E:"Mumbo's skull",013F:"Mingy jongo's skull",0140:"Humba wumba's wigwam",0161:"Cloud Cuckoo Land 2",0188:"Zubba's nest multi",0185:"Trash can mini" + 8012C393 0001 + cn Instant Warp\Options\Isle O Hags + cd Only use one Instant Warp Option At once, Make sure the other is off before putting this one on + D008B284 0000 + 8112C390 ???? 014F:"Wooded Hollow",0150:"Heggy's egg shed",0151:"Jiggywiggy's temple",0152:"Plateau",0153:"Plateau \"Honey B's Hive\"",0154:"Pine Grove",0155:"Cliff top",0156:"Cliff top Mumbo's skull",015A:"wasteland",015B:"inside another digger tunnel",015C:"Quagmire" + 8012C393 0001 + cn Play As + cd To use this cheat, put the cheat on, then press L as you walk through a door to become that chosen character + D108B284 0000 + 8012BD9C ???? 0001:"Banjo and Kazooie",0002:"Snowball",0006:"Bee",0007:"Washing machine",0008:"Stony",000A:"Banjo",000B:"Kazooie",000C:"Submarine",000D:"Mumbo",000E:"Golden Goliath",000F:"Detonator",0010:"Truck",0012:"T-rex baby",0013:"T-rex daddy" + cn Beta Bottles Revenge Mode + cd Bottles Revenge is a Beta mode from Banjo Tooie that the RWP team recently uncovered after an extraordinary amount of effort. Bottles the Spirit transforms into Bottles the Devil and posses enemies nearby and allows a second player hooked up to Pad 2 to play as that Posses character to try to foil Banjos Plans. As player one goes about its business, player two uses every enemy nearby to try to nab Banjo and take away some life. This mode is incredible, and you can control almost every enemy in the game: slot machines, flying creatures, uggers, zubbas...and this is just the beginning. (Congrats Rare Witch Project) + 80130172 0001 + 8008B4D1 0002 + +crc 7BB18D40-83138559-C:55 +gn Pokemon Snap (A) + cn [Enable All Levels] + cd This is needed to be able to Play all Levels of the Game + 810C2CD2 0006 + +crc 2483F22B-136E025E-C:55 +gn Lylat Wars (A) + cn Unlimited\Boost + 8113E6FC 0000 + 8113E6FE 0000 + 811415DC 0000 + 811415DE 0000 + 8013E7FD 0000 + 801416DD 0000 + cn Have All Medals + cd For Expert & Normal Modes + 50000802 0000 + 8017A9D9 7777 + cn Infinite\Hyper Laser + 80163B13 0002 + cn Loads O' Hits + 80163B03 00FF + cn Infinite\Armor\Slippy + 8017418B 00FF + cn Infinite\Energy + 80141587 00FF + 8013E6A7 00FF + cn Infinite\Lives + 80163B09 0063 + cn Unlimited\Smart Bombs + 80179E0B 0063 + cn Infinite\Armor\Falco + 80174187 00FF + cn Infinite\Armor\Peppy + 8017418F 00FF + cn Infinite\Dual Blue Lasers + 80163C13 0002 + cn Level Select + 8017A29F ???? 0000:"Corneria",0001:"Meteo",0002:"Sector X",0003:"Area 6",0004:"Glitch",0005:"Sector Y",0006:"Venom 1",0007:"Solar",0008:"Zoness",0009:"Venom 2",000A:"Training Mode Level",000B:"Macbeth",000C:"Titania",000D:"Aquas",000E:"Fortuna",0010:"Katina",0011:"Bolse",0012:"Sector Z",0013:"Venom With Starwolf",0014:"Corneria (Multi)" + cn 999 Kills + 80163B03 00FF + +crc DD26FDA1-CB4A6BE3-C:55 +gn Super Smash Bros. (A) +//--------------- PAL (F) Region Cheat Codes + cn Give Kirby A Wierd Blow-Up + 8025E898 000A + cn Story Mode\Skip Straight To Master Hand + 800A5227 000D + cn Story Mode\Infinite Time + 810A526E 43CB + cn Story Mode\Player 1\Infinite Lives + 800A5283 0004 + cn Story Mode\Player 2\Infinite Lives + 800A52F7 0004 + cn Story Mode\Player 3\Infinite Lives + 800A536B 0004 + cn Story Mode\Player 4\Infinite Lives + 800A53DF 0004 + cn Story Mode\Player 1\Low % Health + 810A52C6 0000 + cn Story Mode\Player 2\Low % Health + 810A533A 0000 + cn Story Mode\Player 3\Low % Health + 810A53AE 0000 + cn Story Mode\Player 4\Low % Health + 810A5422 0000 + cn Story Mode\Player 1\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code could also result freezing at the end of the Level. + 800A527B ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn Story Mode\Player 2\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800A52EF ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn Story Mode\Player 3\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800A5363 ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn Story Mode\Player 4\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800A53D7 ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn Story Mode\Player 1\Kirby B Button Move\Hyrule Castle + 8026924F ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Yoshi's Island + 8026958F ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Sector Z + 80271837 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Peach's Castle + 802644DF ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Saffron City + 802741D7 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Congo Jungle + 8027120F ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Kirby's Dreamland + 8026E27F ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Planet Zebes + 802706E7 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Metal Mario Stage + 80263CD7 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Fighting Polygon Team + 80262E5F ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn Story Mode\Player 1\Kirby B Button Move\Master Hand Stage + 8027238F ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn VS. Mode\Infinite Time + 810A545E 43CB + cn VS. Mode\Player 1\Low % Health + 810A54B6 0000 + cn VS. Mode\Player 2\Low % Health + 810A552A 0000 + cn VS. Mode\Player 3\Low % Health + 810A559E 0000 + cn VS. Mode\Player 4\Low % Health + 810A5612 0000 + cn VS. Mode\Player 1\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800A546B ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn VS. Mode\Player 2\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800A54DF ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn VS. Mode\Player 3\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800A5553 ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn VS. Mode\Player 4\Character Modifier + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 800A55C7 ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn VS. Mode\Player 1\Kirby B Button Move\Hyrule Castle + 8026412F ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn VS. Mode\Player 1\Kirby B Button Move\Yoshi's Island + 8026E9F7 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn VS. Mode\Player 1\Kirby B Button Move\Sector Z + 8026C6C7 ???? 0002:"D.K. Wind-up Punch",000A:"Jigglypuff Puff Punch" + cn P1 Press Down On D-Pad To Make Items Appear In Random Spots + D109F6E4 0400 + 8118D7E2 0001 + cn Have All Characters + 810A5078 0FF0 + cn VS. Mode\Have Mushroom Kindom + 800A5077 00FF + cn Story Mode\Always Get Pacifist (60,000 Points) + 810A52AE 0000 + cn Bonus Stage Character Modifier (Training Mode) + cd Only put this on after you have alreay Chose your Character on the Main Menu,& Do not use more then 1 Character Modifier at a time.Using this Code This could also result freezing at the end of the Level. + 8018F913 ???? 0000:"Mario",0001:"Fox",0002:"DK",0003:"Samus",0004:"Luigi",0005:"Link",0006:"Yoshi",0007:"C. Falcon",0008:"Kirby",0009:"Pikachu",000A:"Jigglypuff",000B:"Ness",000C:"Master Hand",000D:"Metal Mario",000E:"Polygon Mario",0010:"Polygon DK",0013:"Polygon Link",0014:"Polygon Yoshi",0015:"Polygon Samus",0018:"Polygon Kirby",001A:"Giant Donkey Kong" + cn Jump off to win + 810A5282 0000 + +crc 2B38AEC0-6350B810-C:46 +gn A Bug's Life (F) + cn Infinite\Lives + 801E27C0 0009 + cn Infinite\Health + 801E27B5 0004 + cn Always Have\Super Jump + 811E27B0 0020 + cn Always Have\50 pieces of corn + 801E27C1 0032 + cn Have F-L-I-K + 801E27C2 000F + cn Unlock All Levels + 81099E90 000F + cn Have All Goldberry Tokens + 811E27AE 0000 + cn Start with Berry Weapon + 801E27B7 ???? 0001:"Blueberry",0002:"Homing Berry",0003:"Goldberry",0004:"Super Berry ?" + cn No Music + 801DD966 0000 + cn Subtitles On + 801DDBDB ???? 0000:"Off",0001:"On" + cn Levitate + cd "Press R To Levitate & Let go to land (:" + D0090001 0010 + 811E2726 1000 + D0090001 0010 + 811E2736 1000 + +crc 0C41F9C2-01717A0D-C:46 +gn Fighter's Destiny (F) + cn Start with Stars Modifier\Player 1 + D0209837 0000 + 80209837 ???? 0000:"No Stars",0006:"Max Stars" + cn Start with Stars Modifier\Player 2 + D020B6FF 0000 + 8020B6FF ???? 0000:"No Stars",0006:"Max Stars" + cn Have 1 Star\Ryuji + 8030742E 0001 + cn Have 1 Star\Bob + 8030742F 0001 + cn Have 1 Star\Pierre + 80307430 0001 + cn Have 1 Star\Meiling + 80307431 0001 + cn Have 1 Star\Leon + 80307432 0001 + cn Have 1 Star\Abdul + 80307433 0001 + cn Have 1 Star\Ninja + 80307434 0001 + cn Have 1 Star\Tomahawk + 80307435 0001 + cn Have 1 Star\Valerie + 80307436 0001 + cn Infinite Health\Player 1 + 80209981 0000 + 802048A3 0000 + cn Infinite Health\Player 2 + 802048A7 0000 + 8020B849 0000 + cn Start on stage 100 on Survival to get Joker + 802EF67B 0063 + cn Stop timer for Fastest to get Robot + 810ADBDC 3F80 + +crc 1E12883D-D3B92718-C:46 +gn Duke Nukem 64 (F) + cn Access all In-Game cheats + 50000504 0000 + 80100D98 0001 + cn Infinite\Ammo & All Guns + cd Ena\ble and then simply pause in game play & then unpause and then press left and right. + 50000C02 0000 + 812A5F84 02F4 + cn Access\All Items + cd To access simply pause in game play & then unpause. + 80100D7C 0001 + cn Invincibility + 802AAFE8 0001 + cn Access\All Keys + 802A5FC7 000F + cn Infinite\Holoduke + 812A5FAC 0640 + cn Infinite\Night Vision + 812A5FDC 0664 + cn Infinite\Scuba Gear + 812A600C 0640 + cn Crosshair + 802A6074 ???? 0001:"On",0000:"Off" + cn Max auto-aim On + 802A6075 0002 + cn Upgraded Plasma Gun + 802A5FB3 0063 + +crc B35FEBB0-7427B204-C:46 +gn Holy Magic Century (F) + cn Set Agility to 999-999 + 8107D384 03E7 + cn Set Defence to 999-999 + 8107D386 03E7 + cn Makes your MP 999-999 + 8107D380 03E7 + 8107D382 03E7 + cn Makes your HP 999-999 + 8107D37C 03E7 + 8107D37E 03E7 + cn Have All Elements + 8107D39C 3232 + 8107D39E 3232 + cn Earn Spirits Faster + 8007D3AD 0000 + cn No Random Battles + 8008DE6C 0000 + 8008DE6E 0000 + +crc 29A045CE-ABA9060E-C:46 +gn =Hydro Thunder (F) + cn Always 1st + 812C56A6 0001 + cn Infinite\Time + 812B52A0 42C8 + cn Infinite\Boosts\Player 1 + 812C56AC 4190 + cn Have All\Ships + 50000702 0000 + 812B66B2 0101 + cn Have All\Races + 50000702 0000 + 812B66A4 0101 + cn Infinite\Boosts\Player 2 + 812C59DC 4190 + +crc 001A3BD0-AFB3DE1A-C:46 +gn Disney's Tarzan (F) + cn Infinite\Health + 81192320 0120 + cn Have\Coins Collected 100% + 800DD547 0064 + cn Have\Level & Tokens Completed 100% + 800DD51F 0000 + 800DD520 0001 + 800DD521 0000 + cn Access Level Select + cd On the main menu Scroll down to make CHEATS visible to go into Level Select.For in-Game Cheats,Pause gameplay. + 810DD50C 8001 + cn Infinite\Lives + 800DD542 ???? 0003:"3 Lives",0063:"99 Lives"0003:"3 Lives",0063:"99 Lives" + cn Have\All TARZAN Letters + 800DD515 00FF + cn Have\Full Portrait + 800DD514 00FF + cn Infinite\Red Weapon + 811921F8 0063 + cn Infinite\Green Weapon + 811921F6 0063 + cn Infinite\Purple Weapon + 811921FA 0063 + cn Press GS For\Sabor Attacks\Sabor 1 Hit Kill + 8924A23E 0001 + cn Infinite\Bonus Timer + cd This is For All Timers on Bonus Levels + 801736DE 0025 + +crc 5C1B5FBD-7E961634-C:46 +gn Hexen (F) + cn Access In-Game Cheat Menu + cd To Access Pause Game Play. This gives you access to In-game Cheats like God Mode,Level Select,All Items Etc + 81137DB6 07FF + 80137E93 0005 + +crc CB93DB97-7F5C63D5-C:46 +gn Toy Story 2 (F) + cn Have 99 coins + 810BBBDE 0063 + cn Have all 5 collectables + 801C8542 0005 + cn Infinite Lives + 800BBBDA 0009 + cn Infinite Battery Power + 810BBBD6 000E + cn Hold jump to fly + 810BBBCC 0002 + +crc EA06F8C3-07C2DEED-C:46 +gn Shadow Man (F) + cn Have All\Items + cd Youll not miss out any part of the game for having all parts of LEclipsers with a new game + D0059047 0001 + 50001D20 0000 + 80030613 000B + cn Have All\Gads & The Poign + 80030E57 000F + cn Have All\Levels Unlocked + 5000101C 0000 + 80030A0E 0001 + cn Have All\Cheats: Book of Shadows + 81075F4E 0FFF + cn Have All\Dark Souls Collected + D00590B3 0001 + 80075F49 007C + cn Infinite\Shotgun Shells + 80075B2F 0063 + cn Infinite\Violator Ammo + 81075B32 029A + cn Infinite\Cadeaux' + 81075B36 029A + cn Infinite\0.9mm Ammo + 81075B3A 0190 + cn Infinite\Max Health/Air/Shadow Charge & Voodoo Power + 50000604 0000 + 81075B16 2710 + cn Infinite\Accumulators + 800306D7 0005 + cn Infinite\Retractors + 800308B7 0003 + cn Infinite\Prisms + 80030957 0003 + cn Ammo always displayed on screen + 50000408 0000 + 80075ACD 0007 + cn Press L To Levitate + D0059097 0020 + 80075578 0041 + cn Always Play As Deadwing Character + 80075F53 0001 + +crc BA6C293A-9FAFA338-C:46 +gn Pokemon Snap (F) +//--------------- PAL (G) Region Cheat Codes + cn [Enable All Levels] + cd This is needed to be able to Play all Levels of the Game + 810C2552 0006 + +crc DFF227D9-0D4D8169-C:44 +gn A Bug's Life + cn Infinite\Lives + 801E2760 0009 + cn Infinite\Health + 801E2755 0004 + cn Always Have\Super Jump + 811E2750 0020 + cn Always Have\50 pieces of corn + 801E2761 0032 + cn Have F-L-I-K + 801E2762 000F + cn Unlock All Levels + 81099E30 000F + cn Have All Goldberry Tokens + 811E274E 0000 + cn Start with Berry Weapon + 801E2757 ???? 0001:"Blueberry",0002:"Homing Berry",0003:"Goldberry",0004:"Super Berry ?" + cn No Music + 801DD906 0000 + cn Subtitles On + 801DDB7B ???? 0000:"Off",0001:"On" + cn Levitate + cd "Press R To Levitate & Let go to land (:" + D008FFA1 0010 + 811E26C6 1000 + D008FFA1 0010 + 811E26D6 1000 + +crc FE94E570-E4873A9C-C:44 +gn Fighter's Destiny (G) + cn Start with Stars Modifier\Player 1 + D0209737 0000 + 80209737 ???? 0000:"No Stars",0006:"Max Stars" + cn Start with Stars Modifier\Player 2 + D020B5FF 0000 + 8020B5FF ???? 0000:"No Stars",0006:"Max Stars" + cn Have 1 Star\Ryuji + 8030732E 0001 + cn Have 1 Star\Bob + 8030732F 0001 + cn Have 1 Star\Pierre + 80307330 0001 + cn Have 1 Star\Meiling + 80307331 0001 + cn Have 1 Star\Leon + 80307332 0001 + cn Have 1 Star\Abdul + 80307333 0001 + cn Have 1 Star\Ninja + 80307334 0001 + cn Have 1 Star\Tomahawk + 80307335 0001 + cn Have 1 Star\Valerie + 80307336 0001 + cn Infinite Health\Player 1 + 80209881 0000 + 802047A3 0000 + cn Infinite Health\Player 2 + 802047A7 0000 + 8020B749 0000 + cn Start on stage 100 on Survival to get Joker + 802EF57B 0063 + cn Stop timer for Fastest to get Robot + 810ADADC 3F80 + +crc C3CD76FF-9B9DCBDE-C:44 +gn Forsaken 64 (G) + cn Infinite\Primery Weapons + 8008EE30 0012 + cn Infinite\Secondary Weapons + 8008EE31 0012 + cn Infinite\Weapon Energy + 8008EE32 0012 + cn Infinite\Lives + 8008EE33 0012 + cn Stealth Mode + 8008EE34 0012 + cn Invulnerability + 8008EE35 0012 + cn Wireframe Mode + 8008EE36 0012 + cn Gore Mode + 8008EE37 0012 + cn Turbo Mode + 8008EE38 0012 + cn Psychedelic Mode + 8008EE39 0012 + cn One Shot Enemies + 8008EE3A 0012 + cn Freeze Enemies + 8008EE3B 0012 + cn Infinite\Titans + cd Titans are included in code + 8008EE3C 0012 + cn Infinite\Solaris + cd Solaris are included in code + 8008EE3D 0012 + cn Level Select + cd Accesses all Missions & Battle mode + 8008EE3E 0012 + +crc 75FA0E14-C9B3D105-C:44 +gn Holy Magic Century (G) + cn Set Agility to 999-999 + 8107D644 03E7 + cn Set Defence to 999-999 + 8107D646 03E7 + cn Makes your MP 999-999 + 8107D640 03E7 + 8107D642 03E7 + cn Makes your HP 999-999 + 8107D63C 03E7 + 8107D63E 03E7 + cn Have All Elements + 8107D65C 3232 + 8107D65E 3232 + cn Earn Spirits Faster + 8007D66D 0000 + cn No Random Battles + 8008E12C 0000 + 8008E12E 0000 + +crc 93EB3F7E-81675E44-C:44 +gn Mission Impossible (G) + cn Invincibility + 810864C4 0101 + cn Infinite\Ammo All Guns + 50000610 0000 + 800A9297 00FF + cn Access All Levels + 8008A9D6 0001 + 8008A9EA 0001 + 8008AA12 0001 + 8008AA62 0001 + 8008AA76 0001 + 8008AA8A 0001 + 8008AA9E 0001 + 8008AAB2 0001 + 8008AAC6 0011 + 8008AADA 0021 + 8008AAEE 0001 + 8008AB16 0011 + 8008AB2A 0041 + 8008AB3E 0021 + 8008AB52 0081 + 8008AB66 0001 + 8008AB7A 0081 + 8008AB8E 0001 + 8008ABB6 0001 + 8008ABDE 0001 + 8008ABF2 0011 + 8008AC06 0021 + 8008AC56 0001 + 8008AF3A 0001 + 8008AF4E 0001 + 8008AF62 0001 + 8008AF76 0001 + cn Infinite\Health + 810866C2 FFFF + cn Freeze All Timers + 81094150 0063 + 81094152 0063 + 81094154 0063 + cn Weapon Select + 800A92B5 ???? + 800A92C5 ???? + 800A92D5 ???? 0000:"9MM Hi Power",0001:"Silenced Pistol",0002:"Uzi",0003:"Fists",0032:"Gas Spray",0036:"Blow Torch",001F:"Fire Extinguisher",0024:"Spray Paint",0027:"Electrostunner",000B:"Blow Dart Gun",000C:"Dart Hand Gun",002D:"Mini Rocket Launcher" + cn Walk Through Walls & Objects + cd This will allow you to pass through anything & even walk on water.if you amerge somewhere in the ground just press the A button. + 80094305 ???? 0080:"On",0000:"Off" + +crc 4C261323-4F295E1A-C:44 +gn Disney's Tarzan (G) + cn Infinite\Health + 81192320 0120 + cn Have\Coins Collected 100% + 800DD547 0064 + cn Have\Level & Tokens Completed 100% + 800DD51F 0000 + 800DD520 0001 + 800DD521 0000 + cn Access Level Select + cd On the main menu Scroll down to make CHEATS visible to go into Level Select.For in-Game Cheats,Pause gameplay. + 810DD50C 8001 + cn Infinite\Lives + 800DD542 ???? 0003:"3 Lives",0063:"99 Lives"0003:"3 Lives",0063:"99 Lives" + cn Have\All TARZAN Letters + 800DD515 00FF + cn Have\Full Portrait + 800DD514 00FF + cn Infinite\Red Weapon + 811921F8 0063 + cn Infinite\Green Weapon + 811921F6 0063 + cn Infinite\Purple Weapon + 811921FA 0063 + cn Press GS For\Sabor Attacks\Sabor 1 Hit Kill + 8924A23E 0001 + cn Infinite\Bonus Timer + cd This is For All Timers on Bonus Levels + 801736DE 0025 + +crc 9AB3B50A-BC666105-C:44 +gn Hexen (G) + cn Access In-Game Cheat Menu + cd To Access Pause Game Play. This gives you access to In-game Cheats like God Mode,Level Select,All Items Etc + 81137CD6 07FF + 80137DB3 0005 + +crc 84D5FD75-BBFD3CDF-C:44 +gn Shadowman (G) + cn Have All\Items + cd Youll not miss out any part of the game for having all parts of LEclipsers with a new game + D0059047 0001 + 50001D20 0000 + 80030613 000B + cn Have All\Gads & The Poign + 80030E57 000F + cn Have All\Levels Unlocked + 5000101C 0000 + 80030A0E 0001 + cn Have All\Cheats: Book of Shadows + 81075EFE 0FFF + cn Have All\Dark Souls Collected + D0059047 0001 + 80075EF9 007C + cn Infinite\Shotgun Shells + 80075ADF 0063 + cn Infinite\Violator Ammo + 81075AE2 029A + cn Infinite\Cadeaux' + 81075AE6 029A + cn Infinite\0.9mm Ammo + 81075AEA 0190 + cn Infinite\Max Health,Air,Shadow Charge & Voodoo Power + 50000604 0000 + 81075AC6 2710 + cn Infinite\Accumulators + 800306D7 0005 + cn Infinite\Retractors + 800308B7 0003 + cn Infinite\Prisms + 80030957 0003 + cn Ammo always displayed on screen + 50000408 0000 + 80075A7D 0007 + cn Press L To Levitate + D0058EE4 0020 + 80075528 0041 + +crc 91B66D42-16AC4E46-C:44 +gn South Park + cn Have Cheats Menu + cd Go into the Cheats From the main Menu & put on the Ones you want + 810CF716 01FF + cn Infinite Energy + 802FD209 0064 + cn Infinite Credits + 802FD215 0064 + cn Infinite Sponge Darts + 802FD223 0064 + cn Infinite Suckers + 802FD222 0064 + cn Infinite Balls + 802FD21F 0064 + cn Start with 9999 Monster Score + 812FD20E 270F + +crc 782A9075-E552631D-C:44 +gn Toy Story 2 (G) + cn Have 99 coins + 810BBBDE 0063 + cn Have all 5 collectables + 801C8542 0005 + cn Infinite Lives + 800BBBDA 0009 + cn Infinite Battery Power + 810BBBD6 000E + cn Hold jump to fly + 810BBBCC 0002 + +crc 665FD963-B5CC6612-C:44 +gn Turok - Dinosaur Hunter (G) + cn Infinite\Lives + 80128E9B 00FF + cn Infinite\Body Armor + 81128D26 5B23 + 80128D67 0001 + cn Infinite\Air + 80129070 0063 + 801E862A 0063 + cn Infinite\Health + 812C15C4 1E61 + 812A2534 1E61 + cn Have\All Level Keys + 50000604 0000 + 80128D73 0007 + 80128D8B 001F + 80128DAB 00FF + cn Have\All Weapons + 50000B04 0000 + 80128D47 0001 + 80128D33 0001 + cn Infinite\Ammo + 50000404 0000 + 80128CF3 00FF + 80128D03 00FF + 80128D0F 00FF + 50000504 0000 + 80128D13 00FF + 80128E9B 00FF + 80128E97 00FF + cn Diffuculty Modifier + 8011956F ???? 0000:"Easy",0001:"Normal",0002:"Hard" + cn Have\Backpack + 80128C7B 0001 + 80128CBB 0001 + cn Open All Portals + cd Press L to Access Map + 8114F85A F803 + 81128CDE 0003 + 81128CE2 0003 + 81128CE6 0003 + 81128CEA 0003 + 81128CEE 0003 + 81128CF2 0003 + 81128CF6 0005 + cn Have All\Gems + 80128E97 00FF + +crc 5753720D-2A8A884D-C:44 +gn Pokemon Snap (G) +//--------------- PAL (I) Region Cheat Codes + cn [Enable All Levels] + cd This is needed to be able to Play all Levels of the Game + 810C24D2 0006 + +crc F63B89CE-4582D57D-C:49 +gn A Bug's Life (I) + cn Infinite\Lives + 801E2760 0009 + cn Infinite\Health + 801E2755 0004 + cn Always Have\Super Jump + 811E2750 0020 + cn Always Have\50 pieces of corn + 801E2761 0032 + cn Have F-L-I-K + 801E2762 000F + cn Unlock All Levels + 81099E30 000F + cn Have All Goldberry Tokens + 811E274E 0000 + cn Start with Berry Weapon + 801E2757 ???? 0001:"Blueberry",0002:"Homing Berry",0003:"Goldberry",0004:"Super Berry ?" + cn No Music + 801DD906 0000 + cn Subtitles On + 801DDB7B ???? 0000:"Off",0001:"On" + cn Levitate + cd "Press R To Levitate & Let go to land (:" + D008FFA1 0010 + 811E26C6 1000 + D008FFA1 0010 + 811E26D6 1000 + +crc EBA949DC-39BAECBD-C:49 +gn Mission Impossible (I) + cn Invincibility + 810864C4 0101 + cn Infinite\Ammo All Guns + 50000610 0000 + 800A9297 00FF + cn Access All Levels + 8008A9D6 0001 + 8008A9EA 0001 + 8008AA12 0001 + 8008AA62 0001 + 8008AA76 0001 + 8008AA8A 0001 + 8008AA9E 0001 + 8008AAB2 0001 + 8008AAC6 0011 + 8008AADA 0021 + 8008AAEE 0001 + 8008AB16 0011 + 8008AB2A 0041 + 8008AB3E 0021 + 8008AB52 0081 + 8008AB66 0001 + 8008AB7A 0081 + 8008AB8E 0001 + 8008ABB6 0001 + 8008ABDE 0001 + 8008ABF2 0011 + 8008AC06 0021 + 8008AC56 0001 + 8008AF3A 0001 + 8008AF4E 0001 + 8008AF62 0001 + 8008AF76 0001 + cn Infinite\Health + 810866C2 FFFF + cn Freeze All Timers + 81094150 0063 + 81094152 0063 + 81094154 0063 + cn Weapon Select + 800A92B5 ???? + 800A92C5 ???? + 800A92D5 ???? 0000:"9MM Hi Power",0001:"Silenced Pistol",0002:"Uzi",0003:"Fists",0032:"Gas Spray",0036:"Blow Torch",001F:"Fire Extinguisher",0024:"Spray Paint",0027:"Electrostunner",000B:"Blow Dart Gun",000C:"Dart Hand Gun",002D:"Mini Rocket Launcher" + cn Walk Through Walls & Objects + cd This will allow you to pass through anything & even walk on water.if you amerge somewhere in the ground just press the A button. + 80094305 ???? 0080:"On",0000:"Off" + +crc C0C85046-61051B05-C:49 +gn Pokemon Snap (I) +//--------------- PAL (S) Region Cheat Codes + cn [Enable All Levels] + cd This is needed to be able to Play all Levels of the Game + 810C2712 0006 + +crc 5F6A04E2-D4FA070D-C:53 +gn Mission Impossible (S) + cn Invincibility + 810864C4 0101 + cn Infinite\Ammo All Guns + 50000610 0000 + 800A9297 00FF + cn Access All Levels + 8008A9D6 0001 + 8008A9EA 0001 + 8008AA12 0001 + 8008AA62 0001 + 8008AA76 0001 + 8008AA8A 0001 + 8008AA9E 0001 + 8008AAB2 0001 + 8008AAC6 0011 + 8008AADA 0021 + 8008AAEE 0001 + 8008AB16 0011 + 8008AB2A 0041 + 8008AB3E 0021 + 8008AB52 0081 + 8008AB66 0001 + 8008AB7A 0081 + 8008AB8E 0001 + 8008ABB6 0001 + 8008ABDE 0001 + 8008ABF2 0011 + 8008AC06 0021 + 8008AC56 0001 + 8008AF3A 0001 + 8008AF4E 0001 + 8008AF62 0001 + 8008AF76 0001 + cn Infinite\Health + 810866C2 FFFF + cn Freeze All Timers + 81094150 0063 + 81094152 0063 + 81094154 0063 + cn Weapon Select + 800A92B5 ???? + 800A92C5 ???? + 800A92D5 ???? 0000:"9MM Hi Power",0001:"Silenced Pistol",0002:"Uzi",0003:"Fists",0032:"Gas Spray",0036:"Blow Torch",001F:"Fire Extinguisher",0024:"Spray Paint",0027:"Electrostunner",000B:"Blow Dart Gun",000C:"Dart Hand Gun",002D:"Mini Rocket Launcher" + cn Walk Through Walls & Objects + cd This will allow you to pass through anything & even walk on water.if you amerge somewhere in the ground just press the A button. + 80094305 ???? 0080:"On",0000:"Off" + +crc 817D286A-EF417416-C:53 +gn Pokemon Snap (S) +//--------------- PAL (FGD) Region Cheat Codes + cn [Enable All Levels] + cd This is needed to be able to Play all Levels of the Game + 810C2712 0006 + +crc 2E0E7749-B8B49D59-C:58 +gn Turok 2 - Seeds of Evil (FGD) +//--------------- PAL (IS) Region Cheat Codes + cn Access In-Game Cheat Menu + 8113568C FFFF + 8113568E FFFF + +crc 2E0E7749-B8B49D59-C:58 +gn Turok 2 - Seeds of Evil (FGD) +//--------------- Demo Cheat Codes +//[3A089BBC-54AB2C06-C:0] +gn Berney must die! +//[A3A044B5-6DB1BF5E-C:0] +gn POM-Spacer By Memir +//Recent in File---------->Anything under here is still being worked on<-------------------------------- + cn Infinite Health\Player 1 + 802E4E4A 0027 + cn Collect One Item For Portal + 802E4E47 ???? 0003:"Level 1",000E:"Level 2",000C:"Level 3",000D:"Level 4" + cn Paly As + 802E4E4C ???? 0000:"Red Helic",0001:"Green Helic",0002:"Blue Helic",0003:"Yellow Helic",0010:"Red Rocket",0011:"Green Rocket",0012:"Blue Rocket",0013:"Yellow Rocket",0020:"Red Back Bee",0021:"Green Back Bee",0022:"Blue Back Bee",0023:"Yellow Back Bee",0030:"Red Stealth",0031:"Green Stealth",0032:"Blue Stealth",0033:"Yellow Stealth" + cn Freeze Timer + 802E4D5F 0000 + cn Infinite Health\Player 2 + 802E4EA2 0027 + cn Infinite Health\Player 3 + 802E4EFA 0027 + cn Infinite Health\Player 4 + 802E4F52 0027 + +crc ABA51D09-C668BAD9-C:58 +gn 40 WINKS + cn Infinite 99 Moons + 801D2A81 0063 + cn Infinite 50 Health ZZZ's + 811D2A84 0032 + cn Infinite 40 Cogs + cd Disable when on Boss Modes as it can cause hanging! + 811D2A82 0028 + cn Infinite 99 Lives + cd Disable when on Boss Modes as it can cause hanging! + 801D2A87 0063 + cn Infinite 99 Tokens + cd Disable when on Boss Modes as it can cause hanging! + 801D2A8D 0063 + cn Infinite Max Air + 811D2AA0 07C6 + 811DA2F6 07C1 + cn Have All Dreamkeys Collected + 50000802 0000 + 81207D70 FFFF + cn Setting Options\Langauge Select + 801D21AC ???? 0000:"English",0001:"Spanish",0002:"Italian" + cn Setting Options\Difficulty Select + 801D534F ???? 0000:"Easy",0001:"Medium",0002:"Hard" + cn Setting Options\SFX Volume Select + 801D5350 ???? 0000:"Off",0005:"Normal",0007:"Max" + cn Setting Options\Music Volume Select + 801D5351 ???? 0000:"Off",0005:"Normal",0007:"Max" + cn Setting Options\Rumble Pak Strength Select + 801D5353 ???? 0000:"Off (Normal)",0005:"Middle",0007:"Max" + cn Setting Options\GFX Quality Select + 801D5354 ???? 0000:"Normal",0001:"Medium",0002:"HighCol" + cn Setting Options\Controller Select + 801D5362 ???? 0000:"Preset 1 (Normal)",0001:"Preset 2",0002:"Preset 3" + cn Character Select + 801D535F ???? 0000:"Ruff (Boy) (Default)",0001:"Tumble (Girl)" + cn Have All 40 Winks Collected + cd Combined with Have All Levels Completed cheat will open the door for Have All 40 Winks + 50000602 0000 + 81207D60 FFFF + cn Have All Levels Completed + 50000202 0000 + 81207D6C FFFF + +crc 04DAF07F-0D18E688-C:45 +gn DUKE NUKEM ZERO HOUR + cn Cheat Menu\Cheat Menu Enabled + 801CE4E8 0001 + cn Cheat Menu\Have All Weapons + 811CE470 FFFF + cn Cheat Menu\Have All Game Type & Other + 810E16BE FFFF + cn Cheat Menu\All Weapons Enabled + 801CC8B9 0001 + 801CC925 0001 + 801CD985 0001 + 801CDA81 0001 + 801CDB15 0001 + 801CDB17 0001 + 801CDB49 0001 + 801CE479 0001 + 801CE481 0001 + 801CE4ED 0001 + 801CF635 0001 + cn Infinite Ammo (All Guns) + 810A1E74 A65B + cn Invincibility + 800DEEC3 0001 + cn Time Always 00:00 + 801A19C6 0000 + cn Enable Debug Menu + 800DF990 0001 + +crc 32CA974B-B2C29C50-C:46 +gn DUKE NUKEM ZERO HOUR (F) + cn Cheat Menu\Cheat Menu Enabled + 801DA748 0001 + cn Cheat Menu\Have All Weapons + 811DA6D0 FFFF + cn Cheat Menu\Have All Game Type & Other + 810E1B5E 0FFF + cn Cheat Menu\All Weapons Enabled + 801D8B19 0001 + 801D8B85 0001 + 801D9BE5 0001 + 801D9CE1 0001 + 801D9D75 0001 + 801D9D77 0001 + 801D9DA9 0001 + 801DA6D9 0001 + 801DA6E1 0001 + 801DA74D 0001 + 801DB895 0001 + cn Infinite Ammo (All Guns) + 810A21D4 A65B + cn Invincibility + 800DF223 0001 + cn Enable Debug Menu + 800DFCF0 0001 + +crc 22E9623F-B60E52AD-C:50 +gn FLYING DRAGON + cn Infinite\Health\Player 1 + 80209D81 00C8 + cn Infinite\Special\Player 1 + 81209484 0190 + cn 1 Win to Win\Player 1 + D020A84F 0000 + 8020A84F 0001 + cn Infinite\Health\Player 2 + 81209780 0190 + cn Infinite\Special\Player 2 + 8120B1B0 0190 + cn 1 Win to Win\Player 2 + D020A84F 0000 + 8020A84F 0010 + cn Infinite\Money + 8121106C 2704 + +crc DEE596AB-AF3B7AE7-C:45 +gn WCW / nWo REVENGE + cn Infinite Time + 800FAF87 0000 + cn Extra Characters & Modes + 8107F07C FFFF + cn Spirit Select\Player 1 + 800F9D25 ???? 0064:"Have Max",0032:"Have Normal",0000:"Have None" + cn Spirit Select\Player 2 + 800FA0D5 ???? 0064:"Have Max",0032:"Have Normal",0000:"Have None" + cn Spirit Select\Player 3 + 800FA485 ???? 0064:"Have Max",0032:"Have Normal",0000:"Have None" + cn Spirit Select\Player 4 + 800FA835 ???? 0064:"Have Max",0032:"Have Normal",0000:"Have None" + cn Infinite Time Out Of Ring + 800FACE8 0014 + cn Always Special\Player 1 + 800F9D35 0008 + cn Always Special\Player 2 + 800FA0E5 0008 + cn Always Special\Player 3 + 800FA495 0008 + cn Always Special\Player 4 + 800FA845 0008 + cn Weapon Select\Player 1 + cd With these codes, they do glitch a LOT! It will glitch when you hit certain people with certain weapons a certain way, but it is RANDOM somewhat too + 800F9D31 0003 + 800F98E1 ???? 0000:"Mallot",0001:"Blue Microphone",0002:"Black Microphone",0003:"Trophy",0004:"Black Baseball Bat",0005:"Spotted Baseball Bat",0006:"Steel Chair",0007:"Table Piece",0008:"Trash Can",0009:"Suitcase",000A:"Stop Sign",00FF:"Nothing" + 800F98E2 0000 + 800F99A0 0000 + cn Weapon Select\Player 2 + cd With these codes, they do glitch a LOT! It will glitch when you hit certain people with certain weapons a certain way, but it is RANDOM somewhat too + 800FA0E1 0003 + 800F9911 ???? 0000:"Mallot",0001:"Blue Microphone",0002:"Black Microphone",0003:"Trophy",0004:"Black Baseball Bat",0005:"Spotted Baseball Bat",0006:"Steel Chair",0007:"Table Piece",0008:"Trash Can",0009:"Suitcase",000A:"Stop Sign",00FF:"Nothing" + 800F9912 0001 + 800F99A1 0001 + cn Weapon Select\Player 3 + cd With these codes, they do glitch a LOT! It will glitch when you hit certain people with certain weapons a certain way, but it is RANDOM somewhat too + 800FA491 0003 + 800F9941 ???? 0000:"Mallot",0001:"Blue Microphone",0002:"Black Microphone",0003:"Trophy",0004:"Black Baseball Bat",0005:"Spotted Baseball Bat",0006:"Steel Chair",0007:"Table Piece",0008:"Trash Can",0009:"Suitcase",000A:"Stop Sign",00FF:"Nothing" + 800F9942 0002 + 800F99A2 0002 + cn Weapon Select\Player 4 + cd With these codes, they do glitch a LOT! It will glitch when you hit certain people with certain weapons a certain way, but it is RANDOM somewhat too + 800FA841 0003 + 800F9971 ???? 0000:"Mallot",0001:"Blue Microphone",0002:"Black Microphone",0003:"Trophy",0004:"Black Baseball Bat",0005:"Spotted Baseball Bat",0006:"Steel Chair",0007:"Table Piece",0008:"Trash Can",0009:"Suitcase",000A:"Stop Sign",00FF:"Nothing" + 800F9972 0003 + 800F99A3 0003 + cn Get Title Belt In 1-Match + 80038AAB 0008 + cn Character Select\Player 1 + cd With this code, you will need to press the GS Button to be in the ring and have full access to getting in and out of the ring. + 890F9D36 0240 + 890F9D60 42B4 + 8107E8B2 ???? 0001:"Sting",0002:"Giant",0003:"Lex Luger",0004:"Diamon Dallas Page",0005:"Rick Steiner",0007:"Roddy Piper",0008:"Bret Hart",0009:"Chris Benoit",000A:"Goldberg",000B:"Booker T",000C:"Disco Inferno",0101:"Fit Finley",0105:"Meng",0106:"Barbarian",0107:"Larry Zbysko",0108:"Stevie Ray",010B:"British Bulldog",010D:"Yugi Nagata",010E:"Jim Neidhart",010F:"Alex Wright",0201:"Hollywood Hogan",0202:"Macho Man Randy Savage",0203:"Kevin Nash",0204:"Scott Hall",0205:"Buff Bagwell",0206:"Scott Stenier",0207:"Curt Hennig",0208:"Konnan",0209:"Scott Norton",020C:"Brian Adams",020D:"Eric Bishoff",0301:"Ultimo Dragon",0302:"Eddy Guerrero",0303:"Chris Jericho",0304:"Rey Mysterio Jr.",0305:"Juventud Guerrera",0306:"Dean Malenko",0307:"Chavo Guerrero Jr.",0308:"La Parka",0309:"Psychosis",0401:"Glacier",0403:"Wrath",0404:"Kanyon",0501:"Raven",0502:"Saturn",0503:"Kidman",0504:"Riggs",0505:"Van Hammer",0506:"Sick Boy",0507:"Lodi",0508:"Reese",0601:"AKI Man",0602:"Shogun",0603:"Executioner",0604:"Dr. Frank",0605:"Jekel",0606:"Maya Ineaby",0701:"Hawk Hana",0702:"Kimchee",0703:"Dakeken",0704:"Brickowski",0705:"Mingchee",0706:"Han Zomon",0801:"Eric Bischoff (Manager)",0802:"Onoo (Manager)",0803:"Jimmy Hart (Manager)",0804:"Rick Rude (Manager)",0805:"Dusty Rhodes (Manager)",0806:"Ted Debisas (Manager)",0807:"James Bandenderg (Manager)",0808:"Vincent (Manager)",0901:"Elizabeth (Manager)",0902:"Kimberly (Manager)",0903:"Jackreen (Manager)",0904:"Sister Sherri (Manager)",0905:"Woman (Manager)" + cn Character Select\Player 2 + cd With this code, you will need to press the GS Button to be in the ring and have full access to getting in and out of the ring. + 890FA0E6 0240 + 890FA110 42B4 + 8107E8B6 ???? 0001:"Sting",0002:"Giant",0003:"Lex Luger",0004:"Diamon Dallas Page",0005:"Rick Steiner",0007:"Roddy Piper",0008:"Bret Hart",0009:"Chris Benoit",000A:"Goldberg",000B:"Booker T",000C:"Disco Inferno",0101:"Fit Finley",0105:"Meng",0106:"Barbarian",0107:"Larry Zbysko",0108:"Stevie Ray",010B:"British Bulldog",010D:"Yugi Nagata",010E:"Jim Neidhart",010F:"Alex Wright",0201:"Hollywood Hogan",0202:"Macho Man Randy Savage",0203:"Kevin Nash",0204:"Scott Hall",0205:"Buff Bagwell",0206:"Scott Stenier",0207:"Curt Hennig",0208:"Konnan",0209:"Scott Norton",020C:"Brian Adams",020D:"Eric Bishoff",0301:"Ultimo Dragon",0302:"Eddy Guerrero",0303:"Chris Jericho",0304:"Rey Mysterio Jr.",0305:"Juventud Guerrera",0306:"Dean Malenko",0307:"Chavo Guerrero Jr.",0308:"La Parka",0309:"Psychosis",0401:"Glacier",0403:"Wrath",0404:"Kanyon",0501:"Raven",0502:"Saturn",0503:"Kidman",0504:"Riggs",0505:"Van Hammer",0506:"Sick Boy",0507:"Lodi",0508:"Reese",0601:"AKI Man",0602:"Shogun",0603:"Executioner",0604:"Dr. Frank",0605:"Jekel",0606:"Maya Ineaby",0701:"Hawk Hana",0702:"Kimchee",0703:"Dakeken",0704:"Brickowski",0705:"Mingchee",0706:"Han Zomon",0801:"Eric Bischoff (Manager)",0802:"Onoo (Manager)",0803:"Jimmy Hart (Manager)",0804:"Rick Rude (Manager)",0805:"Dusty Rhodes (Manager)",0806:"Ted Debisas (Manager)",0807:"James Bandenderg (Manager)",0808:"Vincent (Manager)",0901:"Elizabeth (Manager)",0902:"Kimberly (Manager)",0903:"Jackreen (Manager)",0904:"Sister Sherri (Manager)",0905:"Woman (Manager)" + cn Character Select\Player 3 + cd With this code, you will need to press the GS Button to be in the ring and have full access to getting in and out of the ring. + 890FA496 0240 + 890FA4C0 42B4 + 8107E8BA ???? 0001:"Sting",0002:"Giant",0003:"Lex Luger",0004:"Diamon Dallas Page",0005:"Rick Steiner",0007:"Roddy Piper",0008:"Bret Hart",0009:"Chris Benoit",000A:"Goldberg",000B:"Booker T",000C:"Disco Inferno",0101:"Fit Finley",0105:"Meng",0106:"Barbarian",0107:"Larry Zbysko",0108:"Stevie Ray",010B:"British Bulldog",010D:"Yugi Nagata",010E:"Jim Neidhart",010F:"Alex Wright",0201:"Hollywood Hogan",0202:"Macho Man Randy Savage",0203:"Kevin Nash",0204:"Scott Hall",0205:"Buff Bagwell",0206:"Scott Stenier",0207:"Curt Hennig",0208:"Konnan",0209:"Scott Norton",020C:"Brian Adams",020D:"Eric Bishoff",0301:"Ultimo Dragon",0302:"Eddy Guerrero",0303:"Chris Jericho",0304:"Rey Mysterio Jr.",0305:"Juventud Guerrera",0306:"Dean Malenko",0307:"Chavo Guerrero Jr.",0308:"La Parka",0309:"Psychosis",0401:"Glacier",0403:"Wrath",0404:"Kanyon",0501:"Raven",0502:"Saturn",0503:"Kidman",0504:"Riggs",0505:"Van Hammer",0506:"Sick Boy",0507:"Lodi",0508:"Reese",0601:"AKI Man",0602:"Shogun",0603:"Executioner",0604:"Dr. Frank",0605:"Jekel",0606:"Maya Ineaby",0701:"Hawk Hana",0702:"Kimchee",0703:"Dakeken",0704:"Brickowski",0705:"Mingchee",0706:"Han Zomon",0801:"Eric Bischoff (Manager)",0802:"Onoo (Manager)",0803:"Jimmy Hart (Manager)",0804:"Rick Rude (Manager)",0805:"Dusty Rhodes (Manager)",0806:"Ted Debisas (Manager)",0807:"James Bandenderg (Manager)",0808:"Vincent (Manager)",0901:"Elizabeth (Manager)",0902:"Kimberly (Manager)",0903:"Jackreen (Manager)",0904:"Sister Sherri (Manager)",0905:"Woman (Manager)" + cn Character Select\Player 4 + cd With this code, you will need to press the GS Button to be in the ring and have full access to getting in and out of the ring. + 890FA846 0240 + 890FA870 42B4 + 8107E8BE ???? 0001:"Sting",0002:"Giant",0003:"Lex Luger",0004:"Diamon Dallas Page",0005:"Rick Steiner",0007:"Roddy Piper",0008:"Bret Hart",0009:"Chris Benoit",000A:"Goldberg",000B:"Booker T",000C:"Disco Inferno",0101:"Fit Finley",0105:"Meng",0106:"Barbarian",0107:"Larry Zbysko",0108:"Stevie Ray",010B:"British Bulldog",010D:"Yugi Nagata",010E:"Jim Neidhart",010F:"Alex Wright",0201:"Hollywood Hogan",0202:"Macho Man Randy Savage",0203:"Kevin Nash",0204:"Scott Hall",0205:"Buff Bagwell",0206:"Scott Stenier",0207:"Curt Hennig",0208:"Konnan",0209:"Scott Norton",020C:"Brian Adams",020D:"Eric Bishoff",0301:"Ultimo Dragon",0302:"Eddy Guerrero",0303:"Chris Jericho",0304:"Rey Mysterio Jr.",0305:"Juventud Guerrera",0306:"Dean Malenko",0307:"Chavo Guerrero Jr.",0308:"La Parka",0309:"Psychosis",0401:"Glacier",0403:"Wrath",0404:"Kanyon",0501:"Raven",0502:"Saturn",0503:"Kidman",0504:"Riggs",0505:"Van Hammer",0506:"Sick Boy",0507:"Lodi",0508:"Reese",0601:"AKI Man",0602:"Shogun",0603:"Executioner",0604:"Dr. Frank",0605:"Jekel",0606:"Maya Ineaby",0701:"Hawk Hana",0702:"Kimchee",0703:"Dakeken",0704:"Brickowski",0705:"Mingchee",0706:"Han Zomon",0801:"Eric Bischoff (Manager)",0802:"Onoo (Manager)",0803:"Jimmy Hart (Manager)",0804:"Rick Rude (Manager)",0805:"Dusty Rhodes (Manager)",0806:"Ted Debisas (Manager)",0807:"James Bandenderg (Manager)",0808:"Vincent (Manager)",0901:"Elizabeth (Manager)",0902:"Kimberly (Manager)",0903:"Jackreen (Manager)",0904:"Sister Sherri (Manager)",0905:"Woman (Manager)" + cn Ultimate Code\Player 1 + 800F9D24 0064 + cn Ultimate Code\Player 2 + 800FA0D4 0064 + cn Ultimate Code\Player 3 + 800FA484 0064 + cn Ultimate Code\Player 4 + 800FA834 0064 + +crc 68E8A875-0CE7A486-C:50 +gn WCW / nWo REVENGE + cn Infinite Time + 800FAF87 0000 + cn Extra Characters & Modes + 8107F07C FFFF + cn Spirit Select\Player 1 + 800F9D25 ???? 0064:"Have Max",0032:"Have Normal",0000:"Have None" + cn Spirit Select\Player 2 + 800FA0D5 ???? 0064:"Have Max",0032:"Have Normal",0000:"Have None" + cn Spirit Select\Player 3 + 800FA485 ???? 0064:"Have Max",0032:"Have Normal",0000:"Have None" + cn Spirit Select\Player 4 + 800FA835 ???? 0064:"Have Max",0032:"Have Normal",0000:"Have None" + cn Infinite Time Out Of Ring + 800FACE8 0014 + cn Always Special\Player 1 + 800F9D35 0008 + cn Always Special\Player 2 + 800FA0E5 0008 + cn Always Special\Player 3 + 800FA495 0008 + cn Always Special\Player 4 + 800FA845 0008 + cn Weapon Select\Player 1 + cd With these codes, they do glitch a LOT! It will glitch when you hit certain people with certain weapons a certain way, but it is RANDOM somewhat too + 800F9D31 0003 + 800F98E1 ???? 0000:"Mallot",0001:"Blue Microphone",0002:"Black Microphone",0003:"Trophy",0004:"Black Baseball Bat",0005:"Spotted Baseball Bat",0006:"Steel Chair",0007:"Table Piece",0008:"Trash Can",0009:"Suitcase",000A:"Stop Sign",00FF:"Nothing" + 800F98E2 0000 + 800F99A0 0000 + cn Weapon Select\Player 2 + cd With these codes, they do glitch a LOT! It will glitch when you hit certain people with certain weapons a certain way, but it is RANDOM somewhat too + 800FA0E1 0003 + 800F9911 ???? 0000:"Mallot",0001:"Blue Microphone",0002:"Black Microphone",0003:"Trophy",0004:"Black Baseball Bat",0005:"Spotted Baseball Bat",0006:"Steel Chair",0007:"Table Piece",0008:"Trash Can",0009:"Suitcase",000A:"Stop Sign",00FF:"Nothing" + 800F9912 0001 + 800F99A1 0001 + cn Weapon Select\Player 3 + cd With these codes, they do glitch a LOT! It will glitch when you hit certain people with certain weapons a certain way, but it is RANDOM somewhat too + 800FA491 0003 + 800F9941 ???? 0000:"Mallot",0001:"Blue Microphone",0002:"Black Microphone",0003:"Trophy",0004:"Black Baseball Bat",0005:"Spotted Baseball Bat",0006:"Steel Chair",0007:"Table Piece",0008:"Trash Can",0009:"Suitcase",000A:"Stop Sign",00FF:"Nothing" + 800F9942 0002 + 800F99A2 0002 + cn Weapon Select\Player 4 + cd With these codes, they do glitch a LOT! It will glitch when you hit certain people with certain weapons a certain way, but it is RANDOM somewhat too + 800FA841 0003 + 800F9971 ???? 0000:"Mallot",0001:"Blue Microphone",0002:"Black Microphone",0003:"Trophy",0004:"Black Baseball Bat",0005:"Spotted Baseball Bat",0006:"Steel Chair",0007:"Table Piece",0008:"Trash Can",0009:"Suitcase",000A:"Stop Sign",00FF:"Nothing" + 800F9972 0003 + 800F99A3 0003 + cn Get Title Belt In 1-Match + 80038AAB 0008 + cn Character Select\Player 1 + cd With this code, you will need to press the GS Button to be in the ring and have full access to getting in and out of the ring. + 890F9D36 0240 + 890F9D60 42B4 + 8107E8B2 ???? 0001:"Sting",0002:"Giant",0003:"Lex Luger",0004:"Diamon Dallas Page",0005:"Rick Steiner",0007:"Roddy Piper",0008:"Bret Hart",0009:"Chris Benoit",000A:"Goldberg",000B:"Booker T",000C:"Disco Inferno",0101:"Fit Finley",0105:"Meng",0106:"Barbarian",0107:"Larry Zbysko",0108:"Stevie Ray",010B:"British Bulldog",010D:"Yugi Nagata",010E:"Jim Neidhart",010F:"Alex Wright",0201:"Hollywood Hogan",0202:"Macho Man Randy Savage",0203:"Kevin Nash",0204:"Scott Hall",0205:"Buff Bagwell",0206:"Scott Stenier",0207:"Curt Hennig",0208:"Konnan",0209:"Scott Norton",020C:"Brian Adams",020D:"Eric Bishoff",0301:"Ultimo Dragon",0302:"Eddy Guerrero",0303:"Chris Jericho",0304:"Rey Mysterio Jr.",0305:"Juventud Guerrera",0306:"Dean Malenko",0307:"Chavo Guerrero Jr.",0308:"La Parka",0309:"Psychosis",0401:"Glacier",0403:"Wrath",0404:"Kanyon",0501:"Raven",0502:"Saturn",0503:"Kidman",0504:"Riggs",0505:"Van Hammer",0506:"Sick Boy",0507:"Lodi",0508:"Reese",0601:"AKI Man",0602:"Shogun",0603:"Executioner",0604:"Dr. Frank",0605:"Jekel",0606:"Maya Ineaby",0701:"Hawk Hana",0702:"Kimchee",0703:"Dakeken",0704:"Brickowski",0705:"Mingchee",0706:"Han Zomon",0801:"Eric Bischoff (Manager)",0802:"Onoo (Manager)",0803:"Jimmy Hart (Manager)",0804:"Rick Rude (Manager)",0805:"Dusty Rhodes (Manager)",0806:"Ted Debisas (Manager)",0807:"James Bandenderg (Manager)",0808:"Vincent (Manager)",0901:"Elizabeth (Manager)",0902:"Kimberly (Manager)",0903:"Jackreen (Manager)",0904:"Sister Sherri (Manager)",0905:"Woman (Manager)" + cn Character Select\Player 2 + cd With this code, you will need to press the GS Button to be in the ring and have full access to getting in and out of the ring. + 890FA0E6 0240 + 890FA110 42B4 + 8107E8B6 ???? 0001:"Sting",0002:"Giant",0003:"Lex Luger",0004:"Diamon Dallas Page",0005:"Rick Steiner",0007:"Roddy Piper",0008:"Bret Hart",0009:"Chris Benoit",000A:"Goldberg",000B:"Booker T",000C:"Disco Inferno",0101:"Fit Finley",0105:"Meng",0106:"Barbarian",0107:"Larry Zbysko",0108:"Stevie Ray",010B:"British Bulldog",010D:"Yugi Nagata",010E:"Jim Neidhart",010F:"Alex Wright",0201:"Hollywood Hogan",0202:"Macho Man Randy Savage",0203:"Kevin Nash",0204:"Scott Hall",0205:"Buff Bagwell",0206:"Scott Stenier",0207:"Curt Hennig",0208:"Konnan",0209:"Scott Norton",020C:"Brian Adams",020D:"Eric Bishoff",0301:"Ultimo Dragon",0302:"Eddy Guerrero",0303:"Chris Jericho",0304:"Rey Mysterio Jr.",0305:"Juventud Guerrera",0306:"Dean Malenko",0307:"Chavo Guerrero Jr.",0308:"La Parka",0309:"Psychosis",0401:"Glacier",0403:"Wrath",0404:"Kanyon",0501:"Raven",0502:"Saturn",0503:"Kidman",0504:"Riggs",0505:"Van Hammer",0506:"Sick Boy",0507:"Lodi",0508:"Reese",0601:"AKI Man",0602:"Shogun",0603:"Executioner",0604:"Dr. Frank",0605:"Jekel",0606:"Maya Ineaby",0701:"Hawk Hana",0702:"Kimchee",0703:"Dakeken",0704:"Brickowski",0705:"Mingchee",0706:"Han Zomon",0801:"Eric Bischoff (Manager)",0802:"Onoo (Manager)",0803:"Jimmy Hart (Manager)",0804:"Rick Rude (Manager)",0805:"Dusty Rhodes (Manager)",0806:"Ted Debisas (Manager)",0807:"James Bandenderg (Manager)",0808:"Vincent (Manager)",0901:"Elizabeth (Manager)",0902:"Kimberly (Manager)",0903:"Jackreen (Manager)",0904:"Sister Sherri (Manager)",0905:"Woman (Manager)" + cn Character Select\Player 3 + cd With this code, you will need to press the GS Button to be in the ring and have full access to getting in and out of the ring. + 890FA496 0240 + 890FA4C0 42B4 + 8107E8BA ???? 0001:"Sting",0002:"Giant",0003:"Lex Luger",0004:"Diamon Dallas Page",0005:"Rick Steiner",0007:"Roddy Piper",0008:"Bret Hart",0009:"Chris Benoit",000A:"Goldberg",000B:"Booker T",000C:"Disco Inferno",0101:"Fit Finley",0105:"Meng",0106:"Barbarian",0107:"Larry Zbysko",0108:"Stevie Ray",010B:"British Bulldog",010D:"Yugi Nagata",010E:"Jim Neidhart",010F:"Alex Wright",0201:"Hollywood Hogan",0202:"Macho Man Randy Savage",0203:"Kevin Nash",0204:"Scott Hall",0205:"Buff Bagwell",0206:"Scott Stenier",0207:"Curt Hennig",0208:"Konnan",0209:"Scott Norton",020C:"Brian Adams",020D:"Eric Bishoff",0301:"Ultimo Dragon",0302:"Eddy Guerrero",0303:"Chris Jericho",0304:"Rey Mysterio Jr.",0305:"Juventud Guerrera",0306:"Dean Malenko",0307:"Chavo Guerrero Jr.",0308:"La Parka",0309:"Psychosis",0401:"Glacier",0403:"Wrath",0404:"Kanyon",0501:"Raven",0502:"Saturn",0503:"Kidman",0504:"Riggs",0505:"Van Hammer",0506:"Sick Boy",0507:"Lodi",0508:"Reese",0601:"AKI Man",0602:"Shogun",0603:"Executioner",0604:"Dr. Frank",0605:"Jekel",0606:"Maya Ineaby",0701:"Hawk Hana",0702:"Kimchee",0703:"Dakeken",0704:"Brickowski",0705:"Mingchee",0706:"Han Zomon",0801:"Eric Bischoff (Manager)",0802:"Onoo (Manager)",0803:"Jimmy Hart (Manager)",0804:"Rick Rude (Manager)",0805:"Dusty Rhodes (Manager)",0806:"Ted Debisas (Manager)",0807:"James Bandenderg (Manager)",0808:"Vincent (Manager)",0901:"Elizabeth (Manager)",0902:"Kimberly (Manager)",0903:"Jackreen (Manager)",0904:"Sister Sherri (Manager)",0905:"Woman (Manager)" + cn Character Select\Player 4 + cd With this code, you will need to press the GS Button to be in the ring and have full access to getting in and out of the ring. + 890FA846 0240 + 890FA870 42B4 + 8107E8BE ???? 0001:"Sting",0002:"Giant",0003:"Lex Luger",0004:"Diamon Dallas Page",0005:"Rick Steiner",0007:"Roddy Piper",0008:"Bret Hart",0009:"Chris Benoit",000A:"Goldberg",000B:"Booker T",000C:"Disco Inferno",0101:"Fit Finley",0105:"Meng",0106:"Barbarian",0107:"Larry Zbysko",0108:"Stevie Ray",010B:"British Bulldog",010D:"Yugi Nagata",010E:"Jim Neidhart",010F:"Alex Wright",0201:"Hollywood Hogan",0202:"Macho Man Randy Savage",0203:"Kevin Nash",0204:"Scott Hall",0205:"Buff Bagwell",0206:"Scott Stenier",0207:"Curt Hennig",0208:"Konnan",0209:"Scott Norton",020C:"Brian Adams",020D:"Eric Bishoff",0301:"Ultimo Dragon",0302:"Eddy Guerrero",0303:"Chris Jericho",0304:"Rey Mysterio Jr.",0305:"Juventud Guerrera",0306:"Dean Malenko",0307:"Chavo Guerrero Jr.",0308:"La Parka",0309:"Psychosis",0401:"Glacier",0403:"Wrath",0404:"Kanyon",0501:"Raven",0502:"Saturn",0503:"Kidman",0504:"Riggs",0505:"Van Hammer",0506:"Sick Boy",0507:"Lodi",0508:"Reese",0601:"AKI Man",0602:"Shogun",0603:"Executioner",0604:"Dr. Frank",0605:"Jekel",0606:"Maya Ineaby",0701:"Hawk Hana",0702:"Kimchee",0703:"Dakeken",0704:"Brickowski",0705:"Mingchee",0706:"Han Zomon",0801:"Eric Bischoff (Manager)",0802:"Onoo (Manager)",0803:"Jimmy Hart (Manager)",0804:"Rick Rude (Manager)",0805:"Dusty Rhodes (Manager)",0806:"Ted Debisas (Manager)",0807:"James Bandenderg (Manager)",0808:"Vincent (Manager)",0901:"Elizabeth (Manager)",0902:"Kimberly (Manager)",0903:"Jackreen (Manager)",0904:"Sister Sherri (Manager)",0905:"Woman (Manager)" + cn Ultimate Code\Player 1 + 800F9D24 0064 + cn Ultimate Code\Player 2 + 800FA0D4 0064 + cn Ultimate Code\Player 3 + 800FA484 0064 + cn Ultimate Code\Player 4 + 800FA834 0064 + +crc AA7B0658-9C96937B-C:50 +gn WCW MAYHEM + cn Character Creation\Max\Strength + 80308D35 0009 + cn Character Creation\Max\Impact + 80320375 0009 + cn Character Creation\Max\Speed + 80322CB5 0009 + cn Character Creation\Max\Quickness + 80324C75 0009 + cn Character Creation\Max\Aerial + 80326C35 0009 + cn Character Creation\Max\Mat Ability + 80328BF5 0009 + cn Character Creation\Max\Submission + 8032ABB5 0009 + cn Character Creation\Max\Brawling + 8032CB75 0009 + cn Character Creation\Max\Dirtiness + 8032EB35 0009 + cn Infinite Stamina\Player 1 + 810E9798 0478 + cn Infinite Stamina\Player 2 + 810E9934 03ED + cn Meter Select\Player 1 + 800E979D ???? 0060:"Full Meter Bar",0000:"Empty Meter Bar" + cn Meter Select\Player 2 + 800E993D ???? 0060:"Full Meter Bar",0000:"Empty Meter Bar" + cn Enable Cheat + 800B6F5B ???? 0002:"Super Created Wrestlers",0004:"Stamina Meter",0008:"Momentum Meter",0020:"Play As Same Wrestler",0080:"All Wrestlers" + cn Freeze Timer + 800B7E02 D300 + +crc F82DD377-8C3FB347-C:58 +gn TG RALLY 2 + cn Always 1st + 80031F93 0001 + cn No Damage Or Failures + 80031427 0001 + cn 100.000 Sponsor Credits & 950 Championship Points In Support Van + cd You Also Have Access To All Cars, Tracks & Extra Features + 80031433 00F3 + cn No Cones Hit + cd In ARSG Rally School + 80031FC3 0000 + 8003239B 0000 + cn No Navigator + 80031EF7 0000 + cn Max Sponsor Credits + 803A6702 0010 + 803A6704 0001 + cn Infinite Cash + 803A418E 4000 + cn Freeze Timer + 80031F9F 0000 diff --git a/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_Core_Parameters.txt b/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_Core_Parameters.txt new file mode 100644 index 0000000000..cc0876b92b --- /dev/null +++ b/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_Core_Parameters.txt @@ -0,0 +1,191 @@ +[[Mupen64Plus v2.0 Core API v1.0|Mupen64Plus v2.0 API]] + += Core Parameters = + +These are standard parameters which are used by the Mupen64Plus Core library. They are stored in a configuration section called "Core" and may be altered by the front-end in order to adjust the behaviour of the emulator. These may be adjusted at any time and the effect of the change should occur immediately. + +{| border="1" +!Parameter Name!!Type!!Usage +|- +|Version +|M64TYPE_FLOAT +|Mupen64Plus Core config parameter set version number. Please don't change. +|- +|OnScreenDisplay +|M64TYPE_BOOL +|Draw on-screen display if True, otherwise don't draw OSD +|- +|R4300Emulator +|M64TYPE_INT +|Use Pure Interpreter if 0, Cached Interpreter if 1, or Dynamic Recompiler if 2 or more +|- +|NoCompiledJump +|M64TYPE_BOOL +|Disable compiled jump commands in dynamic recompiler (should be set to False) +|- +|DisableExtraMem +|M64TYPE_BOOL +|Disable 4MB expansion RAM pack. May be necessary for some games. +|- +|AutoStateSlotIncrement +|M64TYPE_BOOL +|Increment the save state slot after each save operation. +|- +|EnableDebugger +|M64TYPE_BOOL +|Activate the R4300 debugger when ROM execution begins, if core was built with Debugger support. +|- +|CurrentStateSlot +|M64TYPE_INT +|Save state slot (0-9) to use when saving/loading the emulator state +|- +|ScreenshotPath +|M64TYPE_STRING +|Path to directory where screenshots are saved. If this is blank, the default value of "GetConfigUserDataPath()"/screenshot will be used. +|- +|SaveStatePath +|M64TYPE_STRING +|Path to directory where emulator save states (snapshots) are saved. If this is blank, the default value of "GetConfigUserDataPath()"/save will be used. +|- +|SaveSRAMPath +|M64TYPE_STRING +|Path to directory where SRAM/EEPROM data (in-game saves) are stored. If this is blank, the default value of "GetConfigUserDataPath()"/save will be used. +|- +|SharedDataPath +|M64TYPE_STRING +|Path to a directory to search when looking for shared data files in the ConfigGetSharedDataFilepath() function. +|- +|} + +These configuration parameters are used in the Core's event loop to detect keyboard and joystick commands. They are stored in a configuration section called "CoreEvents" and may be altered by the front-end in order to adjust the behaviour of the emulator. These may be adjusted at any time and the effect of the change should occur immediately. The Keysym value stored is actually (SDLMod << 16) || SDLKey, so that keypresses with modifiers like shift, control, or alt may be used. + +{| border="1" +!Parameter Name!!Type!!Usage +|- +|Kbd Mapping Stop +|M64TYPE_INT +|SDL keysym for stopping the emulator +|- +|Kbd Mapping Fullscreen +|M64TYPE_INT +|SDL keysym for switching between fullscreen/windowed modes +|- +|Kbd Mapping Save State +|M64TYPE_INT +|SDL keysym for saving the emulator state +|- +|Kbd Mapping Load State +|M64TYPE_INT +|SDL keysym for loading the emulator state +|- +|Kbd Mapping Increment Slot +|M64TYPE_INT +|SDL keysym for advancing the save state slot +|- +|Kbd Mapping Reset +|M64TYPE_INT +|SDL keysym for resetting the emulator +|- +|Kbd Mapping Speed Down +|M64TYPE_INT +|SDL keysym for slowing down the emulator +|- +|Kbd Mapping Speed Up +|M64TYPE_INT +|SDL keysym for speeding up the emulator +|- +|Kbd Mapping Screenshot +|M64TYPE_INT +|SDL keysym for taking a screenshot +|- +|Kbd Mapping Pause +|M64TYPE_INT +|SDL keysym for pausing the emulator +|- +|Kbd Mapping Mute +|M64TYPE_INT +|SDL keysym for muting/unmuting the sound +|- +|Kbd Mapping Increase Volume +|M64TYPE_INT +|SDL keysym for increasing the volume +|- +|Kbd Mapping Decrease Volume +|M64TYPE_INT +|SDL keysym for decreasing the volume +|- +|Kbd Mapping Fast Forward +|M64TYPE_INT +|SDL keysym for temporarily going really fast +|- +|Kbd Mapping Frame Advance +|M64TYPE_INT +|SDL keysym for advancing by one frame when paused +|- +|Kbd Mapping Gameshark +|M64TYPE_INT +|SDL keysym for pressing the game shark button +|- +|} + +These configuration parameters are used in the Core's event loop to detect joystick commands. + +The command strings use a simple format described here. For commands activated by pressing a joystick axis, the format is "J'''x'''A'''y'''+" or "J'''x'''A'''y'''-", where '''x''' is the SDL joystick number (must be between 0 and 9) and '''y''' is the axis number. For the last character, '''+''' represents movement in the positive direction, while '''-''' represents movement in the negative direction. For commands activated by pressing a button, the format is "J'''x'''B'''y'''", where '''x''' is the SDL joystick number (must be between 0 and 9) and '''y''' is the button number. For commands activated by pressing a ''hat'' (a directional switch) on the joystick, the format is "J'''x'''H'''y'''V'''z'''", where '''x''' is the SDL joystick number (must be between 0 and 9), '''y''' is the hat number, and '''z''' is the hat value. The hat value corresponds with the SDL_HAT_ enumerated types: Up is 1, Right is 2, Down is 4, and Left is 8. For diagonal directions, these values may be ''or''d together. + +{| border="1" +!Parameter Name!!Type!!Usage +|- +|Version +|M64TYPE_FLOAT +|Mupen64Plus CoreEvents config parameter set version number. Please don't change. +|- +|Joy Mapping Stop +|M64TYPE_STRING +|Joystick event string for stopping the emulator +|- +|Joy Mapping Fullscreen +|M64TYPE_STRING +|Joystick event string for switching between fullscreen/windowed modes +|- +|Joy Mapping Save State +|M64TYPE_STRING +|Joystick event string for saving the emulator state +|- +|Joy Mapping Load State +|M64TYPE_STRING +|Joystick event string for loading the emulator state +|- +|Joy Mapping Increment Slot +|M64TYPE_STRING +|Joystick event string for advancing the save state slot +|- +|Joy Mapping Screenshot +|M64TYPE_STRING +|Joystick event string for taking a screenshot +|- +|Joy Mapping Pause +|M64TYPE_STRING +|Joystick event string for pausing or resuming the emulator +|- +|Joy Mapping Mute +|M64TYPE_STRING +|Joystick event string for muting/unmuting the sound +|- +|Joy Mapping Increase Volume +|M64TYPE_STRING +|Joystick event string for increasing the volume +|- +|Joy Mapping Decrease Volume +|M64TYPE_STRING +|Joystick event string for decreasing the volume +|- +|Joy Mapping Fast Forward +|M64TYPE_STRING +|Joystick event string for temporarily going really fast +|- +|Joy Mapping Gameshark +|M64TYPE_STRING +|Joystick event string for pressing the game shark button +|- +|} + diff --git a/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_Plugin_Parameters.txt b/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_Plugin_Parameters.txt new file mode 100644 index 0000000000..1f5fa4818d --- /dev/null +++ b/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_Plugin_Parameters.txt @@ -0,0 +1,395 @@ +[[Mupen64Plus v2.0 Core API v1.0|Mupen64Plus v2.0 API]] + += Plugin Parameters = + +These are standard parameters which are used by the Mupen64Plus plugins. The behavior of the plugin library when these parameters are changed while the emulator is running is not defined here. Some plugins will load the parameters when starting and store internal copies of the parameters for use during emulation. Other plugins may read the value of the parameters while running. + +=== Audio-SDL === + +{| border="1" +!Parameter Name!!Type!!Usage +|- +|Version +|M64TYPE_FLOAT +|Mupen64Plus Audio SDL config parameter set version number. Please don't change. +|- +|DEFAULT_FREQUENCY +|M64TYPE_INT +|Frequency which is used if rom doesn't want to change it +|- +|SWAP_CHANNELS +|M64TYPE_BOOL +|Swaps left and right channels +|- +|PRIMARY_BUFFER_SIZE +|M64TYPE_INT +|Size of primary buffer in output samples. This is where audio is loaded after it's extracted from n64's memory. +|- +|PRIMARY_BUFFER_TARGET +|M64TYPE_INT +|Fullness level target for Primary audio buffer, in equivalent output samples. +|- +|SECONDARY_BUFFER_SIZE +|M64TYPE_INT +|Size of secondary buffer in samples. This is SDL's hardware buffer. +|- +|RESAMPLE +|M64TYPE_STRING +|Audio resampling algorithm. "trivial" for fastest, lowest-quality algorithm. If compiled with SPEEX support, this can be "speex-fixed-0" to "speex-fixed-10". If compiled with libsrc support, this can be "src-sinc-best-quality", "src-sinc-medium-quality", "src-sinc-fastest", "src-zero-order-hold", or "src-linear". +|- +|VOLUME_CONTROL_TYPE +|M64TYPE_INT +|Volume control type: 1 = SDL (only affects Mupen64Plus output) 2 = OSS mixer (adjusts master PC volume) +|- +|VOLUME_ADJUST +|M64TYPE_INT +|Percentage change each time the volume is increased or decreased +|- +|VOLUME_DEFAULT +|M64TYPE_INT +|Default volume when a game is started. Only used if VOLUME_CONTROL_TYPE is 1 +|- +|} + +=== Video-General === + +{| border="1" +!Parameter Name!!Type!!Usage +|- +|Fullscreen +|M64TYPE_BOOL +|Use fullscreen mode if True, or windowed mode if False +|- +|ScreenWidth +|M64TYPE_INT +|Width of output window or fullscreen width +|- +|ScreenHeight +|M64TYPE_INT +|Height of output window or fullscreen height +|- +|} + +=== Video-Rice === + +{| border="1" +!Parameter Name!!Type!!Usage +|- +|FrameBufferSetting +|M64TYPE_INT +|Frame Buffer Emulation (0=ROM default, 1=disable) +|- +|FrameBufferWriteBackControl +|M64TYPE_INT +|Frequency to write back the frame buffer (0=every frame, 1=every other frame, etc) +|- +|RenderToTexture +|M64TYPE_INT +|Render-to-texture emulation (0=none, 1=ignore, 2=normal, 3=write back, 4=write back and reload) +|- +|ScreenUpdateSetting +|M64TYPE_INT +|Control when the screen will be updated (0=ROM default, 1=VI origin update, 2=VI origin change, 3=CI change, 4=first CI change, 5=first primitive draw, 6=before screen clear, 7=after screen drawn) +|- +|NormalAlphaBlender +|M64TYPE_BOOL +|Force to use normal alpha blender +|- +|FastTextureLoading +|M64TYPE_BOOL +|Use a faster algorithm to speed up texture loading and CRC computation (may break hi-res texture loading) +|- +|AccurateTextureMapping +|M64TYPE_BOOL +|Use different texture coordinate clamping code +|- +|InN64Resolution +|M64TYPE_BOOL +|Force emulated frame buffers to be in N64 native resolution +|- +|SaveVRAM +|M64TYPE_BOOL +|Try to reduce Video RAM usage (should never be used) +|- +|DoubleSizeForSmallTxtrBuf +|M64TYPE_BOOL +|Enable this option to have better render-to-texture quality +|- +|DefaultCombinerDisable +|M64TYPE_BOOL +|Force to use normal color combiner +|- +|EnableHacks +|M64TYPE_BOOL +|Enable game-specific settings from INI file +|- +|EnableFog +|M64TYPE_BOOL +|Enable or disable fog generation +|- +|WinFrameMode +|M64TYPE_BOOL +|If enabled, graphics will be drawn in WinFrame mode instead of solid and texture mode +|- +|FullTMEMEmulation +|M64TYPE_BOOL +|N64 Texture Memory Full Emulation (may fix some games, may break others) +|- +|OpenGLVertexClipper +|M64TYPE_BOOL +|Enable vertex clipper for fog operations +|- +|EnableSSE +|M64TYPE_BOOL +|Enable SSE optimizations for capable CPUs +|- +|EnableVertexShader +|M64TYPE_BOOL +|Use GPU vertex shader +|- +|SkipFrame +|M64TYPE_BOOL +|If this option is enabled, the plugin will skip every other frame +|- +|TexRectOnly +|M64TYPE_BOOL +|If enabled, texture enhancement will be done only for TxtRect ucode +|- +|SmallTextureOnly +|M64TYPE_BOOL +|If enabled, texture enhancement will be done only for textures width+height<=128 +|- +|LoadHiResTextures +|M64TYPE_BOOL +|Enable hi-resolution texture file loading +|- +|LoadHiResCRCOnly +|M64TYPE_BOOL +|Filter hi-resolution texture filenames based only on the CRC and ignore format+size tags (Glide64 compatibility) +|- +|DumpTexturesToFiles +|M64TYPE_BOOL +|Enable texture dumping +|- +|ShowFPS +|M64TYPE_BOOL +|Display On-screen FPS +|- +|FogMethod +|M64TYPE_INT +|Enable, Disable or Force fog generation (0=Disable, 1=Enable n64 choose, 2=Force Fog) +|- +|Mipmapping +|M64TYPE_INT +|Use Mipmapping? 0=no, 1=nearest, 2=bilinear, 3=trilinear +|- +|MultiSampling +|M64TYPE_INT +|Enable/Disable MultiSampling (0=off, 2,4,8,16=quality) +|- +|TextureEnhancement +|M64TYPE_INT +|Primary texture filter (0=None, 1=2X, 2=2XSAI, 3=HQ2X, 4=LQ2X, 5=HQ4X, 6=Sharpen, 7=Sharpen More, 8=External, 9=Mirrored) +|- +|TextureEnhancementControl +|M64TYPE_INT +|Secondary texture filter (0 = none, 1-4 = filtered) +|- +|ForceTextureFilter +|M64TYPE_INT +|Force to use texture filtering or not (0=auto: n64 choose, 1=force no filtering, 2=force filtering) +|- +|TextureQuality +|M64TYPE_INT +|Color bit depth to use for textures (0=default, 1=32 bits, 2=16 bits +|- +|OpenGLDepthBufferSetting +|M64TYPE_INT +|Z-buffer depth (only 16 or 32) +|- +|ColorQuality +|M64TYPE_INT +|Color bit depth for rendering window (0=32 bits, 1=16 bits) +|- +|OpenGLRenderSetting +|M64TYPE_INT +|OpenGL rendering level to support (0=auto, 1=OGL_1.1, 2=OGL_1.2, 3=OGL_1.3, 4=OGL_1.4, 5=OGL_1.4_V2, 6=OGL_TNT2, 7=NVIDIA_OGL, 8=OGL_FRAGMENT_PROGRAM) +|- +|AnisotropicFiltering +|M64TYPE_INT +|Enable/Disable Anisotropic Filtering for Mipmapping (0=no filtering, 2-16=quality). This is uneffective if EnableMipmapping is false. If the given value is to high to be supported by your graphic card, the value will be the highest value your graphic card can support. Better result with Trilinear filtering +|} + +=== Input-SDL === + +The Mupen64Plus-Input-SDL plugin uses a separate config section for each simulated N64 controller. The sections are named: Input-SDL-Control1, Input-SDL-Control2, Input-SDL-Control3, and Input-SDL-Control4. The 4 sections all contain the same parameters. + +General-purpose Controller Configuration Parameters + +{| border="1" +!Parameter Name!!Type!!Usage +|- +|Version +|M64TYPE_FLOAT +|Mupen64Plus Input-SDL config parameter set version number. Please don't change. +|- +|plugged +|M64TYPE_BOOL +|Specifies whether this controller is 'plugged in' to the simulated N64 +|- +|plugin +|M64TYPE_INT +|Specifies which type of expansion pak is in the controller: 1=None, 2=Mem pak, 5=Rumble pak +|- +|mouse +|M64TYPE_BOOL +|If True, then mouse buttons may be used with this controller, and mouse movement will map to X/Y analog stick +|- +|device +|M64TYPE_INT +|Specifies which joystick is bound to this controller: -2=Keyboard/mouse, -1=Auto config, 0 or more= SDL Joystick number +|- +|MouseSensitivity +|M64TYPE_STRING +|The sensitivity coefficients for the mouse to move the N64 controller axis value from 0. For X, Y axes. Values must be positive. +|- +|AnalogDeadzone +|M64TYPE_STRING +|The minimum absolute value of the SDL analog joystick axis to move the N64 controller axis value from 0. For X, Y axes. +|- +|AnalogPeak +|M64TYPE_STRING +|An absolute value of the SDL joystick axis >= AnalogPeak will saturate the N64 controller axis value (at 80). For X, Y axes. For each axis, this must be greater than the corresponding AnalogDeadzone value +|- +|} + +Digital Controller Configuration +These parameters are used to bind input events with N64 Controller button presses. There are 14 simulated buttons and 2 special buttons for switching between the Mem Pak and Rumble Pak expansion units. Each configuration parameter is a string which specifies input events which will map to the given N64 button. The configuration strings consist of zero or more input event words. A list of available input event words is given here: + +{| border="1" +!Input Event Word!!Usage +|- +|key(<keysym>) +|<keysym> = SDLK_* key symbol enumerated type +|- +|button(<num>) +|<num> = SDL Joystick Button Number (0 or greater) +|- +|axis(<num><dir>) +|<num> = SDL Joystick Axis Number, <dir> = axis direction (+ = positive, - = negative) +|- +|axis(<num><dir>,<deadzone>) +|<num> = SDL Joystick Axis Number, <dir> = axis direction (+ = positive, - = negative), <deadzone> = minimum axis value (max 32767) to activate button; default 6000 +|- +|hat(<num> <dir>) +|<num> = SDL Joystick Hat Number, <dir> = hat direction (Up, Down, Left, or Right) +|- +|mouse(<num>) +|<num> = mouse button number (1 = left button, 2 = middle, 3 = right, etc) +|- +|} + +
+{| border="1" +!Parameter Name!!Type!!Usage +|- +|DPad R +|M64TYPE_STRING +|Input event string for mapping the Right button on the D-pad +|- +|DPad L +|M64TYPE_STRING +|Input event string for mapping the Left button on the D-pad +|- +|DPad D +|M64TYPE_STRING +|Input event string for mapping the Down button on the D-pad +|- +|DPad U +|M64TYPE_STRING +|Input event string for mapping the Up button on the D-pad +|- +|Start +|M64TYPE_STRING +|Input event string for mapping the Start button +|- +|Z Trig +|M64TYPE_STRING +|Input event string for mapping the Z trigger +|- +|B Button +|M64TYPE_STRING +|Input event string for mapping the "B" button +|- +|A Button +|M64TYPE_STRING +|Input event string for mapping the "A" button +|- +|C Button R +|M64TYPE_STRING +|Input event string for mapping the Right "C" button +|- +|C Button L +|M64TYPE_STRING +|Input event string for mapping the Left "C" button +|- +|C Button D +|M64TYPE_STRING +|Input event string for mapping the Down "C" button +|- +|C Button U +|M64TYPE_STRING +|Input event string for mapping the Up "C" button +|- +|R Trig +|M64TYPE_STRING +|Input event string for mapping the Right trigger +|- +|L Trig +|M64TYPE_STRING +|Input event string for mapping the Left trigger +|- +|Mempak switch +|M64TYPE_STRING +|Input event string for toggling the Memory Pak unit +|- +|Rumblepak switch +|M64TYPE_STRING +|Input event string for toggling the Rumble Pak unit +|- +|} + +Analog Controller Configuration +These parameters are used to bind input events with N64 Controller analog stick movements. There are only 2 analog stick axes, X and Y. Each configuration parameter is a string which specifies input events which will map to the given N64 controller axis movement. The configuration strings consist of zero or more input event words. A list of available input event words is given here: + +{| border="1" +!Input Event Word!!Usage +|- +|key(<key_a>,<key_b>) +|<key_a> = SDLK_* key symbol for up/left movement. <key_b> = SDLK_* key symbol for down/right movement. The strength of these movements can be modulated with the Left-Shift and Left-Control keys. +|- +|button(<num_a>,<num_b>) +|<num_a> = SDL Joystick Button Number for up/left movement. <num_b> = SDL Joystick Button Number for down/right movement. +|- +|axis(<num_a><dir_a>,<num_b><dir_b>) +|<num_a> = SDL Joystick Axis Number for up/left movement, <dir_a> = axis direction for up/left movement (+ = positive, - = negative). <num_b> = SDL Joystick Axis Number for down/right movement, <dir_b> = axis direction for down/right movement. +|- +|hat(<num> <dir_a> <dir_b>) +|<num> = SDL Joystick Hat Number, <dir_a> = hat direction for up/left movement (Up, Down, Left, or Right), <dir_b> = hat direction for right/down movement +|- +|} + +
+{| border="1" +!Parameter Name!!Type!!Usage +|- +|Y Axis +|M64TYPE_STRING +|Input event string for mapping the Y axis (up/down) of the analog stick +|- +|X Axis +|M64TYPE_STRING +|Input event string for mapping the X axis (left/right) of the analog stick +|- +|} + diff --git a/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Core_API_v1.0.txt b/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Core_API_v1.0.txt new file mode 100644 index 0000000000..3ca587248a --- /dev/null +++ b/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Core_API_v1.0.txt @@ -0,0 +1,67 @@ +[http://mupen64plus.retrouprising.com Project page] + +Please note: as of January 2011, this API is a work in progress.
+The core Mupen64Plus v2.0 modules are complete, but work on GUI front-end applications is ongoing. + +To view the design proposal which preceded this API definition, go to [[Mupen64Plus v2.0 Design Proposal 3|Design Proposal 3]]. + +== New Architecture == + +Earlier versions of Mupen64Plus (and other plugin-based N64 emulators) used a single monolithic application (containing the emulator core) and four plugins. The plugins were dynamically-loaded libraries, and the application used one plugin of each type: Video, Audio, Input, and RSP. Each plugin and the application contained its own GUI code for user interface, and each plugin and the application were individually responsible for finding their own data files and finding, loading, parsing, and storing their own configuration data files. + +This was an acceptable architecture for emulators which were only designed to run on a single platform (such as Windows), but causes a lot of developer and user headaches when applied to a cross-platform emulator such as Mupen64Plus. For this reason, we are re-designing the layout of the emulator to solve some of the problems caused by the old architecture. + +Under the new architecture, the old monolithic emulator application is split into two parts: a core emulator library and a main application, called the front-end. The front-end is primarily responsible for the user interface. All GUI code will be removed from the core and plugin libraries. The primary function of the core library is to emulate the R4300 CPU and memory system, attaching the plugins to form a full N64 system emulator. The core library also contains some utility functions which may be used by the front-end and plugins, such as a configuration parameter handler. + +== High-level Usage == + +The expected sequence of operations which will be taken by the front-end application are as follows: + +# Load core library (libmupen64plus.so) and set function pointers +# Call CoreGetVersion, check core version and capabilities +# Call CoreStartup to initialize the core library +# Load front-end configuration from core config API or through own mechanism +# Find plugins, open dynamic libraries, call PluginStartup for each +# Enter message loop for user interaction +# If user selects ROM and presses Play: +#* Load and de-compress the ROM +#* Use CoreDoCommand to open the ROM +#* Call CoreAttachPlugin to attach selected plugins to core +#* Use CoreDoCommand to start emulation +#* When emulation is finished, call CoreDetachPlugin on all plugins, then close the ROM + +== Core API == +=== [[Mupen64Plus v2.0 Core Basic|Basic Core Functions]] === + +These two functions (PluginGetVersion and CoreErrorMessage) are utility functions and may be called at any time (even before core startup). These functions are used by both the front-end and the plugins. + +=== [[Mupen64Plus v2.0 Core Front-End|Front-End Functions]] === + +There are several types of functions here, which are exported from the Core library to be used by the front-end. There are 'housekeeping' functions, for startup and shutdown, and attaching and detaching plugins. There is also a Command API which is used for many simple functions such as loading, executing, or stopping a ROM. Finally the Cheat API is here, for adding and removing cheat functions. + +=== [[Mupen64Plus v2.0 Core Video Extension|Video Extension API]] === + +These functions are exported from the Core library for use by the video plugin. These functions are used for high-level video setup tasks such as enumerating available screen resolutions, setting the video mode, window caption, OpenGL attributes, and fullscreen mode. The video extension API allows for the abstraction of these functions away from the hard-coded SDL function calls currently in the video plugins, so that a front-end may override these functions and provide its own video API. + +=== [[Mupen64Plus v2.0 Core Debugger|Debugger Functions]] === + +These are the debugger functions, which are also called only from the front-end. Most of these functions will return with an error if the core library was not compiled with the debugger enabled. A front-end may examine the Capabilities value returned by the CoreGetVersion function to determine if the core library was built with the debugger enabled. + +=== [[Mupen64Plus v2.0 Core Config|Configuration API]] === + +These configuration functions are exported from the core library and are used by the core and the plugins to store all of their persistent configuration parameters. The front-end application may also use these functions to store its configuration options, or it may use a different mechanism. This section also contains two Operating System Abstraction functions. These functions are used by the core, plugins, and the front-end to find full filepaths to shared data files and user-specific data files. + +== Plugin API == +=== [[Mupen64Plus v2.0 Plugin API|Plugin API]] === + +This section lists all of the functions which are exported by the plugins. The front-end application should only use the PluginStartup, PluginShutdown, and PluginGetVersion functions. All other functions will only be called from the core. + +== Configuration Parameters == +=== [[Mupen64Plus Core Parameters|Core Parameters]] === + +This section lists the names and descriptions of all of the configuration parameters used by the Core library. + +=== [[Mupen64Plus Plugin Parameters|Plugin Parameters]] === + +This section lists the names and descriptions of all of the configuration parameters used by the Plugin libraries. + diff --git a/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Core_Basic.txt b/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Core_Basic.txt new file mode 100644 index 0000000000..a94ccc35a9 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Core_Basic.txt @@ -0,0 +1,47 @@ +[[Mupen64Plus v2.0 Core API v1.0|Mupen64Plus v2.0 API]] + += Mupen64Plus v2.0 Basic Core API = + +Most libmupen64plus functions return an m64p_error return code, which is an enumerated type defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]. Front-end code should check the return value of each call to a libmupen64plus function. + +{| border="1" +|Prototype +|'''m64p_error PluginGetVersion(m64p_plugin_type *PluginType, int *PluginVersion, int *APIVersion, const char **PluginNamePtr, int *Capabilities)''' +|- +|Input Parameters +|'''PluginType''' Pointer to an enumerated type to store the plugin type. The value M64PLUGIN_CORE will always be stored.
+'''PluginVersion''' Pointer to an integer to store the version number of the Mupen64Plus core. Version number 2.1.3 would be stored as 0x00020103.
+'''APIVersion''' Pointer to an integer to store the version number of the Core--Front-end API used by the Mupen64plus core library.
+'''PluginNamePtr''' Pointer to a const character pointer to receive the name of the core library. The const char * which is returned must point to a persistent string (ie, not stored on the stack).
+'''Capabilities''' Pointer to an integer to store a logically-or'd set of flags which specify the capabilities of the core which were built into the library during compilation. These are defined in the m64p_core_caps enumerated type, defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]. +|- +|Usage +|This function retrieves version information from the core library. This function is the same for the core library and the plugins, so that a front-end may examine all shared libraries in a directory and determine their types. Any of the input parameters may be set to NULL and this function will succeed but won't return the corresponding information. +|} +
+{| border="1" +|Prototype +|'''m64p_error CoreGetAPIVersions(int *ConfigVersion, int *DebugVersion, int *VidextVersion, int *ExtraVersion)''' +|- +|Input Parameters +|'''ConfigVersion''' Pointer to an integer to store the version number of the Config API exported by the Mupen64plus core library.
+'''DebugVersion''' Pointer to an integer to store the version number of the Debug API exported by the Mupen64plus core library.
+'''VidextVersion''' Pointer to an integer to store the version number of the Video Extension API exported by the Mupen64plus core library.
+'''ExtraVersion''' Pointer to an integer to store an API version number for future use. Currently set to 0.
+|- +|Usage +|This function retrieves API version information from the core library. This function may be used by either the front-end application or any plugin modules. Any of the input parameters may be set to NULL and this function will succeed but won't return the corresponding information. +|} +
+{| border="1" +|Prototype +|'''const char * CoreErrorMessage(m64p_error ReturnCode)''' +|- +|Input Parameters +|'''ReturnCode''' Enumerated type containing an error code. +|- +|Usage +|This function returns a pointer to a NULL-terminated string giving a human-readable description of the error. +|} +
+ diff --git a/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Core_Config.txt b/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Core_Config.txt new file mode 100644 index 0000000000..363fdedf22 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Core_Config.txt @@ -0,0 +1,313 @@ +[[Mupen64Plus v2.0 Core API v1.0|Mupen64Plus v2.0 API]] + += Mupen64Plus v2.0 Configuration API = + +Most libmupen64plus functions return an m64p_error return code, which is an enumerated type defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]. Front-end code should check the return value of each call to a libmupen64plus function. + +== Selector Functions == +These functions are used by the front-end to discover the sections in the configuration file, open a section, discover parameters within a section, and find out if a section has been changed. + +{| border="1" +|Prototype +|'''m64p_error ConfigListSections(void *context, void (*SectionListCallback)(void * context, const char * SectionName))''' +|- +|Input Parameters +|'''context''' Void pointer to be passed to the SectionListCallback function
+'''SectionListCallback''' Pointer to function in front-end for receiving the name of every section in the Mupen64Plus Core configuration data. This function will be called once for each section in the core configuration data structure, and then the ConfigListSections() function will return. +|- +|Requirements +|The Mupen64Plus library must already be initialized before calling this function. The '''SectionListCallback''' pointer cannot be NULL. +|- +|Usage +|This function is called to enumerate the list of Sections in the Mupen64Plus Core configuration file. It is expected that there will be a section named "Core" for core-specific configuration data, "Graphics" for common graphics options, and one section for each plugin library. +|} +
+{| border="1" +|Prototype +|'''m64p_error ConfigOpenSection(const char *SectionName, m64p_handle *ConfigSectionHandle)''' +|- +|Input Parameters +|'''SectionName''' Name of the Mupen64Plus configuration section to open. This name is case-insensitive. If no section exists with the given name, a new one will be created with no parameters. This name may consist of any ASCII characters between 32 and 127 except brackets "[]".
+'''ConfigSectionHandle''' This is a handle (defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]) which is required to be used for subsequent calls to core configuration functions to list, retrieve, or set configuration parameters. +|- +|Requirements +|The Mupen64Plus library must already be initialized before calling this function. The '''SectionName''' and '''ConfigSectionHandle''' pointers cannot be NULL. +|- +|Usage +|This function is used to give a configuration section handle to the front-end which may be used to read or write configuration parameter values in a given section of the configuration file. +|} +
+{| border="1" +|Prototype +|'''m64p_error ConfigListParameters(m64p_handle ConfigSectionHandle, void *context, void (*ParameterListCallback)(void * context, const char *ParamName, m64p_type ParamType))''' +|- +|Input Parameters +|'''ConfigSectionHandle''' An m64p_handle given by the '''ConfigOpenSection''' function.
+'''context''' Void pointer to be passed to the ParameterListCallback function
+'''ParameterListCallback''' Pointer to function in front-end for receiving the name of every parameter in the given section of the Mupen64Plus Core configuration data. This function will be called once for each parameter in the section, and then the ConfigListParameters() function will return. +|- +|Requirements +|The Mupen64Plus library must already be initialized before calling this function. The '''ConfigSectionHandle''' and '''ParameterListCallback''' pointers cannot be NULL. +|- +|Usage +|This function is called to enumerate the list of Parameters in a given Section of the Mupen64Plus Core configuration file. +|} +
+{| border="1" +|Prototype +|'''int ConfigHasUnsavedChanges(const char *SectionName)''' +|- +|Input Parameters +|'''SectionName''' Name of the Mupen64Plus configuration section to check for unsaved changes. This name is case-insensitive. If this pointer is NULL or points to an empty string, then all sections are checked. +|- +|Requirements +|The Mupen64Plus library must already be initialized before calling this function.
+This function was added in the Config API version 2.2.0. +|- +|Usage +|This function is called to determine if a given Section (or all sections) of the Mupen64Plus Core configuration file has been modified since it was last saved. A return value of 0 means there are no unsaved changes, while a 1 will be returned if there are unsaved changes. +|} + +== Modifier Functions == +These functions are used for deleting parts of the configuration list or saving the configuration data to disk. + +{| border="1" +|Prototype +|'''m64p_error ConfigDeleteSection(const char *SectionName)''' +|- +|Input Parameters +|'''SectionName''' Name of the Mupen64Plus configuration section to delete. This name is case-insensitive. This name may consist of any ASCII characters between 32 and 127 except brackets "[]".
+|- +|Requirements +|The Mupen64Plus library must already be initialized before calling this function. +|- +|Usage +|This function deletes a section from the Mupen64Plus configuration data. +|} +
+{| border="1" +|Prototype +|'''m64p_error ConfigSaveFile(void)''' +|- +|Input Parameters +|N/A +|- +|Requirements +|The Mupen64Plus library must already be initialized before calling this function. +|- +|Usage +|This function saves the Mupen64Plus configuration file to disk. +|} +
+{| border="1" +|Prototype +|'''m64p_error ConfigSaveSection(const char *SectionName)''' +|- +|Input Parameters +|'''SectionName''' Name of the Mupen64Plus configuration section to save. This name is case-insensitive. +|- +|Requirements +|The Mupen64Plus library must already be initialized before calling this function. The named section must exist in the current configuration.
+This function was added in the Config API version 2.1.0. +|- +|Usage +|This function saves one section of the current Mupen64Plus configuration to disk, while leaving the other sections unmodified. +|} +
+{| border="1" +|Prototype +|'''m64p_error ConfigRevertChanges(const char *SectionName)''' +|- +|Input Parameters +|'''SectionName''' Name of the Mupen64Plus configuration section to modify. This name is case-insensitive. This pointer cannot be NULL. +|- +|Requirements +|The Mupen64Plus library must already be initialized before calling this function. The named section must exist in the current configuration.
+This function was added in the Config API version 2.2.0. +|- +|Usage +|This function reverts changes previously made to one section of the current Mupen64Plus configuration file, so that it will match with the configuration at the last time that it was loaded from or saved to disk. +|} + +== Generic Get/Set Functions == +These functions should be used for reading or writing configuration values in most cases. + +{| border="1" +|Prototype +|'''m64p_error ConfigSetParameter(m64p_handle ConfigSectionHandle, const char *ParamName, m64p_type ParamType, const void *ParamValue)''' +|- +|Input Parameters +|'''ConfigSectionHandle''' An m64p_handle given by the '''ConfigOpenSection''' function.
+'''ParamName''' NULL-terminated string containing the name of the parameter whose value is being set. This name is case-insensitive. This name may consist of any ASCII characters between 32 and 127 except the equals and hash signs, and may not end in a space.
+'''ParamType''' An m64p_type value giving the type of the data object that '''ParamValue''' points to. If this is different from the native data representation used by the core, it will be converted into the type used by the core.
+'''ParamValue''' Pointer to data object containing the value of the parameter to be set.
+|- +|Requirements +|The Mupen64Plus library must already be initialized before calling this function. The '''ConfigSectionHandle''', '''ParamName''' and '''ParamValue''' pointers cannot be NULL. +|- +|Usage +|This function sets the value of one of the emulator's configuration parameters in the section which is represented by '''ConfigSectionHandle'''. +|} +
+{| border="1" +|Prototype +|'''m64p_error ConfigGetParameter(m64p_handle ConfigSectionHandle, const char *ParamName, m64p_type ParamType, void *ParamValue, int MaxSize)''' +|- +|Input Parameters +|'''ConfigSectionHandle''' An m64p_handle given by the '''ConfigOpenSection''' function.
+'''ParamName''' NULL-terminated string containing the name of the parameter whose value is being retrieved. This name is case-insensitive. This name may consist of any ASCII characters between 32 and 127 except the equals and hash signs, and may not end in a space.
+'''ParamType''' An m64p_type value giving the type of the data object that '''ParamValue''' points to. If this is different from the native data representation used by the core, it will be converted into the type given by '''ParamType'''.
+'''ParamValue''' Pointer to data object to receive the value of the parameter being retrieved.
+'''MaxSize''' Size (in bytes) of the data object that '''ParamValue''' points to. +|- +|Requirements +|The Mupen64Plus library must already be initialized before calling this function. The '''ConfigSectionHandle''', '''ParamName''' and '''ParamValue''' pointers cannot be NULL. +|- +|Usage +|This function retrieves the value of one of the emulator's parameters in the section which is represented by '''ConfigSectionHandle'''. +|} +
+{| border="1" +|Prototype +|'''m64p_error ConfigGetParameterType(m64p_handle ConfigSectionHandle, const char *ParamName, m64p_type *ParamType)''' +|- +|Input Parameters +|'''ConfigSectionHandle''' An m64p_handle given by the '''ConfigOpenSection''' function.
+'''ParamName''' Pointer to a NULL-terminated string containing the name of the parameter whose type is being retrieved. This name is case-insensitive. This name may consist of any ASCII characters between 32 and 127 except the equals and hash signs, and may not end in a space.
+'''ParamType''' Pointer to an m64p_type value to receive the type of the parameter indicated by '''ParamName'''. +|- +|Requirements +|The Mupen64Plus library must already be initialized before calling this function. The '''ConfigSectionHandle''', '''ParamName''', and '''ParamType''' pointers cannot be NULL. +|- +|Usage +|This function retrieves the type of one of the emulator's parameters in the section which is represented by '''ConfigSectionHandle'''. If there is no parameter with the given '''ParamName''', the error M64ERR_INPUT_NOT_FOUND will be returned. +|} +
+{| border="1" +|Prototype +|'''const char * ConfigGetParameterHelp(m64p_handle ConfigSectionHandle, const char *ParamName)''' +|- +|Return Value +|Pointer to a NULL-terminated string containing usage information for the '''ParamName''' parameter. May be NULL. +|- +|Input Parameters +|'''ConfigSectionHandle''' An m64p_handle given by the '''ConfigOpenSection''' function.
+'''ParamName''' NULL-terminated string containing the name of the parameter for which usage information is being retrieved. This name is case-insensitive. This name may consist of any ASCII characters between 32 and 127 except the equals and hash signs, and may not end in a space. +|- +|Requirements +|The Mupen64Plus library must already be initialized before calling this function. The '''ConfigSectionHandle''', and '''ParamName''' pointers cannot be NULL. +|- +|Usage +|This function retrieves the help information about one of the emulator's parameters in the section which is represented by '''ConfigSectionHandle'''. +|} + +== Special Get/Set Functions == +These parameterized Get/SetDefault functions are provided for simplifying the task of handling default values within a single module. Each code module using the Core's configuration API should set the default values for all configuration parameters used by that module during its Startup() function. This allows the software to set up the default values automatically rather than storing them in a separate "default config file" which has proven problematic in the past. This also solves the problem which occurs when an upgraded module contains a new config parameter not present in the previous release. + +The special Get functions return the configuration value directly rather than writing them through a pointer and returning an error code. For this reason, these parameterized Get functions should only be used within a module which 'owns' the configuration section and set up its default values in the Startup() function. Because these functions cannot signal an error to the caller, a front-end should not use these functions to retrieve configuration values for the core or the plugins, unless the names of the parameters have been enumerated with ConfigListParameters and are therefore guaranteed to exist. + +
+{| border="1" +|Prototype +|'''m64p_error ConfigSetDefaultInt(m64p_handle ConfigSectionHandle, const char *ParamName, int ParamValue, const char *ParamHelp)'''
+'''m64p_error ConfigSetDefaultFloat(m64p_handle ConfigSectionHandle, const char *ParamName, float ParamValue, const char *ParamHelp)'''
+'''m64p_error ConfigSetDefaultBool(m64p_handle ConfigSectionHandle, const char *ParamName, int ParamValue, const char *ParamHelp)'''
+'''m64p_error ConfigSetDefaultString(m64p_handle ConfigSectionHandle, const char *ParamName, const char * ParamValue, const char *ParamHelp)''' +|- +|Input Parameters +|'''ConfigSectionHandle''' An m64p_handle given by the '''ConfigOpenSection''' function.
+'''ParamName''' NULL-terminated string containing the name of the parameter whose value is being set. This name is case-insensitive. This name may consist of any ASCII characters between 32 and 127 except the equals and hash signs, and may not end in a space.
+'''ParamValue''' Integer or null-terminated string pointer containing the value of the parameter to be set.
+'''ParamHelp''' NULL-terminated string containing some human-readable information about the usage of this parameter. Can be NULL. + +|- +|Requirements +|The Mupen64Plus library must already be initialized before calling this function. The '''ConfigSectionHandle''' and '''ParamName''' pointers cannot be NULL. +|- +|Usage +|This function is used to set the value of a configuration parameter if it is not already present in the configuration file. This may happen if a new user runs the emulator, or an upgraded module uses a new parameter, or the user deletes his or her configuration file. If a parameter named '''ParamName''' is already present in the given section of the configuration file, then no action will be taken and this function will return successfully. Otherwise, a new parameter will be created its value will be assigned to '''ParamValue'''. +|} +
+{| border="1" +|Prototype +| +{| +|- +|'''int''' || '''ConfigGetParamInt(m64p_handle ConfigSectionHandle, const char *ParamName)''' +|- +|'''float''' || '''ConfigGetParamFloat(m64p_handle ConfigSectionHandle, const char *ParamName)''' +|- +|'''int''' || '''ConfigGetParamBool(m64p_handle ConfigSectionHandle, const char *ParamName)''' +|- +|'''const char *''' || '''ConfigGetParamString(m64p_handle ConfigSectionHandle, const char *ParamName)''' +|} +|- +|Input Parameters +|'''ConfigSectionHandle''' An m64p_handle given by the '''ConfigOpenSection''' function.
+'''ParamName''' NULL-terminated string containing the name of the parameter whose value is being retrieved. This name is case-insensitive. This name may consist of any ASCII characters between 32 and 127 except the equals and hash signs, and may not end in a space. +|- +|Requirements +|The Mupen64Plus library must already be initialized before calling this function. The '''ConfigSectionHandle''' and '''ParamName''' pointers cannot be NULL. +|- +|Usage +|This function retrieves the value of one of the emulator's parameters in the section which is represented by '''ConfigSectionHandle''', and returns the value directly to the calling function. If an errors occurs (such as if '''ConfigSectionHandle''' is invalid, or there is no configuration parameter named '''ParamName'''), then an error will be sent to the front-end via the DebugCallback() function, and either a 0 (zero) or an empty string will be returned. +|} + +== OS-Abstraction Functions == + +{| border="1" +|Prototype +|'''const char * ConfigGetSharedDataFilepath(const char *filename)''' +|- +|Return Value +|Pointer to a NULL-terminated string containing a full directory path and filename to a given shared data file, or NULL if this file was not found. +|- +|Requirements +|The Mupen64Plus library must already be initialized before calling this function. +|- +|Usage +|It is common for shared data files on Unix systems to be installed in different places on different systems. Therefore, this core function is provided to allow a plugin to retrieve a full pathname to a given shared data file. This type of file is intended to be shared among multiple users on a system, so it is likely to be read-only. Examples of these types of files include: the .ini files for Rice Video and Glide64, the font and Mupen64Plus.ini files for the core, and the cheat code files for the front-end. This function will first search in a directory given via the DataPath parameter to the '''CoreStartup''' function, then in a directory given by the SharedDataPath core configuration parameter, then in a directory which may be supplied at compile time through a Makefile or configure script option, and finally in some common system locations (such as /usr/share/mupen64plus and /usr/local/share/mupen64plus on Unix systems). +|} +
+{| border="1" +|Prototype +|'''const char * ConfigGetUserConfigPath(void)''' +|- +|Return Value +|Pointer to a NULL-terminated string containing the directory path to user-specific configuration files. +|- +|Requirements +|The Mupen64Plus library must already be initialized before calling this function. +|- +|Usage +|This function may be used by the plugins or front-end to get a path to the directory for storing user-specific configuration files. This will be the directory where the configuration file "mupen64plus.cfg" is located. +|} +
+{| border="1" +|Prototype +|'''const char * ConfigGetUserDataPath(void)''' +|- +|Return Value +|Pointer to a NULL-terminated string containing the directory path to user-specific data files. +|- +|Requirements +|The Mupen64Plus library must already be initialized before calling this function. +|- +|Usage +|This function may be used by the plugins or front-end to get a path to the directory for storing user-specific data files. This may be used to store files such as screenshots, saved game states, or hi-res textures. +|} +
+{| border="1" +|Prototype +|'''const char * ConfigGetUserCachePath(void)''' +|- +|Return Value +|Pointer to a NULL-terminated string containing the directory path to user-specific caching data files. +|- +|Requirements +|The Mupen64Plus library must already be initialized before calling this function. +|- +|Usage +|This function may be used by the plugins or front-end to get a path to the directory for storing user-specific caching data files. Files in this directory may be deleted by the user to save space, so critical information should not be stored here. This directory may be used to store files such as the ROM browser cache. +|} + diff --git a/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Core_Debugger.txt b/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Core_Debugger.txt new file mode 100644 index 0000000000..4bb1f0d3d9 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Core_Debugger.txt @@ -0,0 +1,282 @@ +[[Mupen64Plus v2.0 Core API v1.0|Mupen64Plus v2.0 API]] + += Mupen64Plus v2.0 Core Debugger API = + +Most libmupen64plus functions return an m64p_error return code, which is an enumerated type defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]. Front-end code should check the return value of each call to a libmupen64plus function. + +== General Debugger Functions == +{| border="1" +|Prototype +|'''m64p_error DebugSetCallbacks(void (*dbg_frontend_init)(void), void (*dbg_frontend_update)(unsigned int pc), void (*dbg_frontend_vi)(void))''' +|- +|Input Parameters +|'''dbg_frontend_init''' Pointer to function which is called when debugger is initialized.
+'''dbg_frontend_update''' Pointer to function which is called after debugger hits a breakpoint or executes one instruction in stepping mode.
+'''dbg_frontend_vi''' Pointer to function which is called during each vertical interrupt. +|- +|Requirements +|The Mupen64Plus library must be built with debugger support and must be initialized before calling this function. +|- +|Usage +|This function is called by the front-end to supply debugger callback function pointers. If debugger is enabled and then later disabled within the GUI, this function may be called with NULL pointers in order to disable the callbacks. +|} +
+{| border="1" +|Prototype +|'''m64p_error DebugSetCoreCompare(void (*dbg_core_compare)(unsigned int), void (*dbg_core_data_sync)(int, void *))''' +|- +|Input Parameters +|'''dbg_core_compare''' Pointer to function which is called after each R4300 instruction, for comparing the operation of one R4300 emulator core against another.
+'''dbg_core_data_sync''' Pointer to function which is used to transfer data from the sending emulator core to the receiving core, such as controller button press or movement data. +|- +|Requirements +|The Mupen64Plus library must be initialized before calling this function. +|- +|Usage +|This function is called by the front-end to supply callback function pointers for the Core Comparison feature. This feature is designed to work as follows. The front-end application will set up some channel for communicating data between two separately running instances of mupen64plus. For example, the unix console front-end will use named FIFOs. The front-end will register callback functions for comparing the 2 cores' states via this DebugSetCoreCompare API call. When the dbg_core_compare callback fires, the front-end will use the DebugGetCPUDataPtr function (and DebugMemGetPointer function if desired) to transmit emulator core state data from the 'sending' instance to the 'receiving' instance. The receiving instance may then check the core state data against it's own internal state and report any discrepancies. When the dbg_core_data_sync callback fires, the front-end should transmit a block of data from the sending instance to the receiving instance. This is for the purposes of synchronizing events such as controller inputs or state loading commands, so that the 2 cores may stay synchronized. This feature does not require the M64CAPS_DEBUGGER capability to built into the core, but it does require the M64CAPS_CORE_COMPARE capability. +|} +
+{| border="1" +|Prototype +|'''m64p_error DebugSetRunState(int runstate)''' +|- +|Input Parameters +|'''runstate''' 0 == pause, 1 == single instruction step, 2 == run +|- +|Requirements +|The Mupen64Plus library must be built with debugger support and must be initialized before calling this function. +|- +|Usage +|This function sets the run state of the R4300 CPU emulator. +|} +
+{| border="1" +|Prototype +|'''int DebugGetState(m64p_dbg_state statenum)''' +|- +|Input Parameters +|'''statenum''' An m64p_dbg_state enumerated type specifying which debugger state variable to read. +|- +|Requirements +|The Mupen64Plus library must be built with debugger support and must be initialized before calling this function. +|- +|Usage +|This function reads and returns a debugger state variable, which are enumerated in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]. +|} +
+{| border="1" +|Prototype +|'''m64p_error DebugStep(void)''' +|- +|Requirements +|The Mupen64Plus library must be built with debugger support and must be initialized, the emulator core must be executing a ROM, and the debugger must be active before calling this function. +|- +|Usage +|This function signals the debugger to advance one instruction when in the stepping mode. +|} +
+{| border="1" +|Prototype +|'''void DebugDecodeOp(unsigned int instruction, char *op, char *args, int pc)''' +|- +|Input Parameters +|'''instruction''' 32-bit R4300 instruction opcode
+'''op''' Pointer to character array to store decoded instruction mnemonic
+'''args''' Pointer to character array to store instruction arguments
+'''pc''' Program Counter address at which '''instruction''' is stored +|- +|Requirements +|The Mupen64Plus library must be built with debugger support. +|- +|Usage +|This is a helper function for the debugger front-end. This instruction takes a PC value and an R4300 instruction opcode and writes the disassembled instruction mnemonic and arguments into character buffers. This is intended to be used to display disassembled code. +|} + +== Memory Functions == +{| border="1" +|Prototype +|'''void * DebugMemGetRecompInfo(m64p_dbg_mem_info recomp_type, unsigned int address, int index)''' +|- +|Input Parameters +|'''recomp_type''' Type of information to retrieve about a recompiled machine instruction. Must be a M64P_DBG_RECOMP_* type.
+'''address''' Program Counter value (in N64 memory space) of R4300 instruction about which to retrieve the recompiled x86 instructions.
+'''index''' Index of recompiled instruction about which to receive information. +|- +|Requirements +|The Mupen64Plus library must be built with debugger support and must be initialized before calling this function. This function may not be available on all platforms. +|- +|Usage +|This function is used by the front-end to retrieve disassembly information about recompiled code. For example, the dynamic recompiler may take a single R4300 instruction and compile it into 10 x86 instructions. This function may then be used to retrieve the disassembled code of the 10 x86 instructions. For '''recomp_type''' of M64P_DBG_RECOMP_OPCODE or M64P_DBG_RECOMP_ARGS, a character pointer will be returned which gives the disassembled instruction code. For '''recomp_type''' of M64P_DBG_RECOMP_ADDR, a pointer to the recompiled x86 instruction will be given. +|} +
+{| border="1" +|Prototype +|'''int DebugMemGetMemInfo(m64p_dbg_mem_info mem_info_type, unsigned int address)''' +|- +|Input Parameters +|'''mem_info_type''' Type of information to retrieve about an N64 memory location. Must be a M64P_DBG_MEM_* type.
+'''address''' Memory location (in N64 memory space) about which to retrieve some information. +|- +|Requirements +|The Mupen64Plus library must be built with debugger support and must be initialized before calling this function. +|- +|Usage +|This function returns an integer value regarding the memory location '''address''', corresponding to the information requested by '''mem_info_type''', which is a type enumerated in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]. For example, if '''address''' contains R4300 program code, the front-end may request the number of x86 instructions emitted by the dynamic recompiler by requesting M64P_DBG_MEM_NUM_RECOMPILED. +|} +
+{| border="1" +|Prototype +|'''void * DebugMemGetPointer(m64p_dbg_memptr_type mem_ptr_type)''' +|- +|Input Parameters +|'''mem_ptr_type''' Memory type to which a pointer is requested. +|- +|Requirements +|The Mupen64Plus library must be initialized before calling this function. +|- +|Usage +|This function returns a memory pointer (in x86 memory space) to a block of emulated N64 memory. This may be used to retrieve a pointer to a special N64 block (such as the serial, video, or audio registers) or the RDRAM. The '''m64p_dbg_memptr_type''' type is enumerated in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]] +|} +
+{| border="1" +|Prototype +| +{| +|- +|'''unsigned long long''' || '''DebugMemRead64(unsigned int address)''' +|- +|'''unsigned int''' || '''DebugMemRead32(unsigned int address)''' +|- +|'''unsigned short''' || '''DebugMemRead16(unsigned int address)''' +|- +|'''unsigned char''' || '''DebugMemRead8(unsigned int address)''' +|} +|- +|Input Parameters +|'''address''' Memory location (in N64 memory space) from which to retrieve a value.
+|- +|Requirements +|The Mupen64Plus library must be built with debugger support and must be initialized before calling this function. +|- +|Usage +|These functions retrieve a value from the emulated N64 memory. The returned value will be correctly byte-swapped for the host architecture. +|} +
+{| border="1" +|Prototype +|'''void DebugMemWrite64(unsigned int address, unsigned long long value)'''
+'''void DebugMemWrite32(unsigned int address, unsigned int value)'''
+'''void DebugMemWrite16(unsigned int address, unsigned short value)'''
+'''void DebugMemWrite8(unsigned int address, unsigned char value)''' +|- +|Input Parameters +|'''address''' Memory location (in N64 memory space) to which to write a value.
+'''value''' Value to write into emulated memory. +|- +|Requirements +|The Mupen64Plus library must be built with debugger support and must be initialized before calling this function. +|- +|Usage +|These functions write a value into the emulated N64 memory. The given value will be correctly byte-swapped before storage. +|} + +== R4300 CPU Functions == +{| border="1" +|Prototype +|'''void *DebugGetCPUDataPtr(m64p_dbg_cpu_data cpu_data_type)''' +|- +|Input Parameters +|'''cpu_data_type''' CPU register type to which a pointer is requested.
+|- +|Requirements +|The Mupen64Plus library must be initialized before calling this function. +|- +|Usage +|This function returns a memory pointer (in x86 memory space) to a specific register in the emulated R4300 CPU. The '''m64p_dbg_cpu_data''' type is enumerated in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]. It is important to note that when the R4300 CPU core is in the Cached Interpreter or Dynamic Recompiler modes, the address of the PC register is not constant; it will change after each instruction is executed. The pointers to all other registers will never change, as the other registers are global variables. +|} + +== Breakpoint Functions == +{| border="1" +|Prototype +|'''int DebugBreakpointLookup(unsigned int address, unsigned int size, unsigned int flags)''' +|- +|Input Parameters +|'''address''' Starting address (in R4300 memory space) to search
+'''size''' Size of address space in bytes to search
+'''flags''' Breakpoint flags +|- +|Requirements +|The Mupen64Plus library must be built with debugger support and must be initialized before calling this function. +|- +|Usage +|This function searches through all current breakpoints in the debugger to find one that matches the given input parameters. If a matching breakpoint is found, the index number is returned. If no breakpoints are found, -1 is returned. +|} +
+{| border="1" +|Prototype +|'''int DebugBreakpointCommand(m64p_dbg_bkp_command command, unsigned int index, void *ptr)''' +|- +|Input Parameters +|'''command''' Enumerated value specifying the breakpoint command to execute
+'''index''' Purpose varies by command, see table below
+'''ptr''' Purpose varies by command, see table below +|- +|Requirements +|The Mupen64Plus library must be built with debugger support and must be initialized before calling this function. +|- +|Usage +|This function is used to process common breakpoint commands, such as adding, removing, or searching the breakpoints. The meanings of the '''index''' and '''ptr''' input parameters vary by command, and are given in the table below. The '''m64p_dbg_bkp_command''' type is enumerated in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]. +|} +
+{| border="1" +!Command!!Return Value!!Function!!index Parameter!!ptr Parameter +|- +|M64P_BKP_CMD_ADD_ADDR +|Index of new breakpoint +|Add an execution breakpoint at a given R4300 address. +|R4300 address +|unused +|- +|M64P_BKP_CMD_ADD_STRUCT +|Index of new breakpoint +|Add a custom breakpoint specified in a breakpoint structure. +|unused +|Pointer to breakpoint struct of new breakpoint +|- +|M64P_BKP_CMD_REPLACE +|unused +|Replace an existing breakpoint with one specified by a breakpoint structure. +|Index of breakpoint to replace +|Pointer to breakpoint struct of new breakpoint +|- +|M64P_BKP_CMD_REMOVE_ADDR +|unused +|Remove an existing breakpoint +|R4300 address of breakpoint to remove +|unused +|- +|M64P_BKP_CMD_REMOVE_IDX +|unused +|Remove an existing breakpoint +|Index of breakpoint to remove +|unused +|- +|M64P_BKP_CMD_ENABLE +|unused +|Enable a specified breakpoint +|Index of breakpoint to enable +|unused +|- +|M64P_BKP_CMD_DISABLE +|unused +|Disable a specified breakpoint +|Index of breakpoint to disable +|unused +|- +|M64P_BKP_CMD_CHECK +|Index of breakpoint if found, otherwise -1 +|Search for an execution breakpoint at a given address +|R4300 address at which to search +|unused +|} + diff --git a/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Core_Front-End.txt b/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Core_Front-End.txt new file mode 100644 index 0000000000..adf7f08756 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Core_Front-End.txt @@ -0,0 +1,332 @@ +[[Mupen64Plus v2.0 Core API v1.0|Mupen64Plus v2.0 API]] + += Mupen64Plus v2.0 Core<-->Front-End API = + +Most libmupen64plus functions return an m64p_error return code, which is an enumerated type defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]. Front-end code should check the return value of each call to a libmupen64plus function. + +== Startup/Shutdown Functions == +{| border="1" +|Prototype +|'''m64p_error CoreStartup(int APIVersion, const char *ConfigPath, const char *DataPath, void *Context, void (*DebugCallback)(void *Context, int level, const char *message), void *Context2, void (*StateCallback)(void *Context2, m64p_core_param ParamChanged, int NewValue))''' +|- +|Input Parameters +|'''APIVersion''' Integer containing the version number of the Core API used by the front-end.
+'''ConfigPath''' File path to folder containing Mupen64Plus.cfg. Can be NULL.
+'''DataPath''' Folder to search first when looking for shared data files. Can be NULL.
+'''Context''' Pointer which will be passed back to the '''DebugCallback''' function. Can be NULL.
+'''DebugCallback''' Pointer to function in front-end for receiving debug information and warnings from the core. This function must be thread-safe. Can be NULL. The value of level is 1 for an error, 2 for a warning, 3 for info, and 4 for verbose info.
+'''Context2''' Pointer which will be passed back to the '''StateCallback''' function. Can be NULL.
+'''StateCallback''' Pointer to function in front-end for receiving core state change notifications. This function must be thread-safe. Can be NULL. +|- +|Requirements +|This function must be called before any other libmupen64plus functions. +|- +|Usage +|This function initializes libmupen64plus for use by allocating memory, creating data structures, and loading the configuration file. If '''ConfigPath''' is NULL, libmupen64plus will search for the configuration file in its usual place (On Linux, in ~/.config/mupen64plus/). This function may return M64ERR_INCOMPATIBLE if older front-end is used with newer core. +|} +
+{| border="1" +|Prototype +|'''m64p_error CoreShutdown(void)''' +|- +|Input Parameters +|N/A +|- +|Usage +|This function saves the configuration file, then destroys data structures and releases memory allocated by the core library. +|} +
+{| border="1" +|Prototype +|'''m64p_error CoreAttachPlugin(m64p_plugin_type PluginType, m64p_dynlib_handle PluginLibHandle)''' +|- +|Input Parameters +|'''PluginType''' Enumerated type specifying the plugin type to attach to the core. If this type of plugin is currently attached to the core, an error will be returned.
+'''PluginLibHandle''' Dynamic library handle (defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]) corresponding with the plugin object to attach. +|- +|Requirements +|Both the core library and the plugin library must already be initialized with the CoreStartup()/PluginStartup() functions, and a ROM must be open. This function cannot be called while the emulator is running. The plugins must be attached in the following order: Video, Audio, Input, RSP. +|- +|Usage +|This function attaches the given plugin to the emulator core. There can only be one plugin of each type attached to the core at any given time. +|} +
+{| border="1" +|Prototype +|'''m64p_error CoreDetachPlugin(m64p_plugin_type PluginType)''' +|- +|Input Parameters +|'''PluginType''' Enumerated type specifying the plugin type to detach from the core. If no plugin of this type is currently attached to the core, this function will exit with a return value of M64ERR_SUCCESS. +|- +|Requirements +|Both the core library and the plugin library must already be initialized with the CoreStartup()/PluginStartup() functions. This function cannot be called while the emulator is running. +|- +|Usage +|This function detaches the given plugin from the emulator core, and re-attaches the 'dummy' plugin functions. +|} + +== Command Functions == +{| border="1" +|Prototype +|'''m64p_error CoreDoCommand(m64p_command Command, int ParamInt, void *ParamPtr)''' +|- +|Input Parameters +|'''Command''' Enumerated type specifying which command should be executed.
+'''ParamInt''' An integer value which may be used as an input to the command.
+'''ParamPtr''' A pointer which may be used as an input to the command.
+|- +|Requirements +|The core library must already be initialized with the CoreStartup() function. Each command may have its own requirements as well. +|- +|Usage +|This function sends a command to the emulator core. A table of all commands is given below. +|} +
+ +{| border="1" +!Command!!Function!!Input Parameters!!Requirements +|- +|M64CMD_ROM_OPEN +|This will cause the core to read in a binary ROM image provided by the front-end. +|'''ParamPtr''' Pointer to the uncompressed ROM image in memory.
'''ParamInt''' The size in bytes of the ROM image. +|The emulator cannot be currently running. A ROM image must not be currently opened. +|- +|M64CMD_ROM_CLOSE +|This will close any currently open ROM. The current cheat code list will also be deleted. +|N/A +|The emulator cannot be currently running. A ROM image must have been previously opened. There should be no plugins currently attached. +|- +|M64CMD_ROM_GET_HEADER +|This will retrieve the header data of the currently open ROM. +|'''ParamPtr''' Pointer to a rom_header struct to receive the data.
'''ParamInt''' The size in bytes of the rom_header struct. +|A ROM image must be open. +|- +|M64CMD_ROM_GET_SETTINGS +|This will retrieve the settings data of the currently open ROM. +|'''ParamPtr''' Pointer to a rom_settings struct to receive the data.
'''ParamInt''' The size in bytes of the rom_settings struct. +|A ROM image must be open. +|- +|M64CMD_EXECUTE +|This command will start the emulator and begin executing the ROM image. This function call will not return until the game has been stopped. +|N/A +|The emulator cannot be currently running. A ROM image must have been previously opened. +|- +|M64CMD_STOP +|This will stop the emulator, if it is currently running. +|N/A +|This command will execute asynchronously. +|- +|M64CMD_PAUSE +|This command will pause the emulator if it is running. +|N/A +|This function will return a non-successful error code if the emulator is in the stopped state. This command may execute asynchronously. +|- +|M64CMD_RESUME +|This command will resume execution of the emulator if it is paused. +|N/A +|This function will return a non-successful error code if the emulator is in the stopped state. This command may execute asynchronously. +|- +|M64CMD_CORE_STATE_QUERY +|This command will query the emulator core for the value of a state parameter +|'''ParamInt''' An m64p_core_param enumerated type specifying the desired state variable'''
ParamPtr''' Pointer to an integer to receive the value of the requested state variable. +|None +|- +|M64CMD_CORE_STATE_SET +|This command will set the value of a state parameter in the emulator core +|'''ParamInt''' An m64p_core_param enumerated type specifying the desired state variable'''
ParamPtr''' Pointer to an integer to containing the value of the requested state variable. +|The initial requirements vary depending upon the variable being set. Setting some variables requires the emulator to be running. +|- +|M64CMD_STATE_LOAD +|This command will attempt to load a saved state file. If '''ParamPtr''' is not NULL, this function will load a state file from a full pathname specified by this pointer. Otherwise ('''ParamPtr''' is NULL), it will load from the current slot. +|'''ParamInt''' Ignored'''
ParamPtr''' Pointer to string containing state file path and name, or NULL +|The emulator must be currently running or paused. This command will execute asynchronously. +|- +|M64CMD_STATE_SAVE +|This command will save a state file. If '''ParamPtr''' is not NULL, this function will save a state file to a full pathname specified by this pointer. Otherwise ('''ParamPtr''' is NULL), it will save to the current slot. +|'''ParamInt''' This parameter will only be used if '''ParamPtr''' is not NULL. If 1, a Mupen64Plus state file will be saved. If 2, a Project64 compressed state file will be saved. If 3, a Project64 uncompressed state file will be saved. '''
ParamPtr''' Pointer to string containing state file path and name, or NULL
+|The emulator must be currently running or paused. This command will execute asynchronously. +|- +|M64CMD_STATE_SET_SLOT +|This command will set the currently selected save slot index +|'''ParamInt''' Value to set for the current slot index. Must be between 0 and 9'''
ParamPtr''' Ignored
+|None +|- +|M64CMD_SEND_SDL_KEYDOWN +|This command will inject an SDL_KEYDOWN event into the emulator's core event loop. Keys not handled by the core will be passed to the input plugin. +|'''ParamInt''' Key value of the keypress event to inject, with SDLMod in the upper 16 bits and SDLKey in the lower 16 bits. +|The emulator must be currently running or paused. +|- +|M64CMD_SEND_SDL_KEYUP +|This command will inject an SDL_KEYUP event into the emulator's core event loop. +|'''ParamInt''' Key value of the keypress event to inject, with SDLMod in the upper 16 bits and SDLKey in the lower 16 bits. +|The emulator must be currently running or paused. +|- +|M64CMD_SET_FRAME_CALLBACK +|This command either registers or removes (if '''ParamPtr''' is NULL) a frame callback function. This function will be called after each video frame is rendered. The front-end callback function may call the video plugin's ReadScreen2() function to retrieve the frame if desired. +|'''ParamPtr''' Can be either NULL or a m64p_frame_callback object. +|None +|- +|M64CMD_TAKE_NEXT_SCREENSHOT +|This will cause the core to save a screenshot at the next possible opportunity. +|N/A +|The emulator must be currently running or paused. This command will execute asynchronously. +|- +|M64CMD_READ_SCREEN +|This command will copy the current contents of the video display to the buffer pointer by '''ParamPtr'''. +|'''ParamInt''' 1 to copy the buffer that is currently displayed (front buffer), 0 to copy the buffer that is being drawn (back buffer).'''
ParamPtr'''A pointer to a buffer of at least width*height*3 bytes. The buffer will be filled with the current display. The format is RGB888 with the origin in the lower left corner. +|The emulator must be currently running or paused. +|- +|M64CMD_RESET +|Reset the emulated machine. +|'''ParamInt''' 0 to do a soft reset, 1 to do a hard reset.'''
ParamPtr''' Ignored +|The emulator must be currently running or paused. +|- +|M64CMD_ADVANCE_FRAME +|Advance one frame (the emulator will run until the next frame, then pause). +|'''ParamInt''' Ignored'''
ParamPtr''' Ignored +|The emulator must be currently running or paused. +|} +
+ + +== Core State Parameters == +These core parameters may be read and/or written using the M64CMD_CORE_STATE_QUERY and M64CMD_CORE_STATE_SET commands. The front-end application will receive a callback (via the StateCallback function pointer given to the '''CoreStartup''' function) when these parameters change value. This callback will be sent even if the function which caused the state change was called by the front-end application itself. Not all of these parameters are readable or writable. Each parameter's value is held in a single 32-bit integer. The meaning of this integer is given in the Parameter Encoding column. See the table below for details on these core parameters. +
+{| border="1" +!Name!!Readable!!Writable!!int Parameter Encoding!!Notes +|- +|M64CORE_EMU_STATE +|Yes +|Yes +|enum m64p_emu_state +|1=Stopped, 2=Running, 3=Paused +|- +|M64CORE_VIDEO_MODE +|Yes +|Yes +|enum m64p_video_mode +|1=None (video not running), 2=Windowed, 3=Fullscreen +|- +|M64CORE_SAVESTATE_SLOT +|Yes +|Yes +| +|Valid values are 0 through 9. +|- +|M64CORE_SPEED_FACTOR +|Yes +|Yes +|Emulator playback speed in percent +|Valid values are 1 to 1000. +|- +|M64CORE_SPEED_LIMITER +|Yes +|Yes +|1 to enable speed limiter, or 0 to disable speed limiter. +|When speed limiter is disabled, emulator will run as fast as possible (useful for benchmarking). +|- +|M64CORE_VIDEO_SIZE +|Yes +|No +|(ScreenWidth << 16) + ScreenHeight +|This parameter is read-only. +|- +|M64CORE_AUDIO_VOLUME +|Yes +|Yes +|Volume level in percent, 0 - 100 +| +|- +|M64CORE_AUDIO_MUTE +|Yes +|Yes +|1 if muted, otherwise 0 +| +|- +|M64CORE_INPUT_GAMESHARK +|Yes +|Yes +|1 when Gameshark button pressed, 0 when button released. +|Callback function will be invoked on both button press and release. +|- +|M64CORE_STATE_LOADCOMPLETE +|No +|No +|1 if state loading was successful, 0 if state loading failed. +|This parameter cannot be read or written. It is only used for callbacks, because the state load/save operations are asynchronous. +|- +|M64CORE_STATE_SAVECOMPLETE +|No +|No +|1 if state saving was successful, 0 if state saving failed. +|This parameter cannot be read or written. It is only used for callbacks, because the state load/save operations are asynchronous. +|} +
+ +== ROM Handling Functions == +{| border="1" +|Prototype +|'''m64p_error CoreGetRomSettings(m64p_rom_settings *RomSettings, int RomSettingsLength, int Crc1, int Crc2)''' +|- +|Input Parameters +|'''RomSettings''' Pointer to m64p_rom_settings object to be filled in with data.
+'''RomSettingsLength''' Size of the object pointed to by '''RomSettings''' in bytes.
+'''Crc1''' A 32-bit integer value containing the first CRC (taken from the ROM header) to identify the ROM.
+'''Crc2''' A 32-bit integer value containing the second CRC (taken from the ROM header) to identify the ROM. +|- +|Requirements +|The core library must already be initialized with the CoreStartup() function. The '''RomSettings''' pointer must not be NULL. The '''RomSettingsLength''' value must be greater than or equal to the size of the m64p_rom_settings structure. This function does not require any ROM image to be currently open. +|- +|Usage +|This function searches through the data in the Mupen64Plus.ini file to find an entry which matches the given '''Crc1''' and '''Crc2''' hashes, and if found, fills in the '''RomSettings''' structure with the data from the Mupen64Plus.ini file. +|} +
+ +== Video Extension Functions == +{| border="1" +|Prototype +|'''m64p_error CoreOverrideVidExt(m64p_video_extension_functions *VideoFunctionStruct);''' +|- +|Input Parameters +|'''VideoFunctionStruct''' Pointer to a structure (defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]) containing pointers to the Front-end's custom Video Extension functions to override the default SDL functions +|- +|Requirements +|The Mupen64Plus library must already be initialized before calling this function. This function cannot be called while the emulator is running. +|- +|Usage +|This function overrides the core's internal SDL-based OpenGL functions which are called from the video plugin to perform various basic tasks like opening the video window, toggling between windowed and fullscreen modes, and swapping frame buffers after a frame has been rendered. This override functionality allows a front-end to define its own video extension functions to be used instead of the SDL functions, such as for the purpose of embedding the emulator display window inside of a Qt GUI window. If any of the function pointers in the structure are NULL, the override function will be disabled and the core's internal SDL functions will be used. The v2.0 core expects the Functions struct member to be equal to 9 or more. +|} +
+ +== Cheat Functions == +{| border="1" +|Prototype +|'''m64p_error CoreAddCheat(const char *CheatName, m64p_cheat_code *CodeList, int NumCodes)''' +|- +|Input Parameters +|'''CheatName''' Pointer to NULL-terminated string containing a unique name for this Cheat Function.
+'''CodeList''' Pointer to an array of m64p_cheat_code objects.
+'''NumCodes''' Number of m64p_cheat_code elements in the cheat code array. +|- +|Requirements +|The Mupen64Plus library must already be initialized before calling this function. A ROM image must be currently opened. +|- +|Usage +|This function will add a Cheat Function to a list of currently active cheats which are applied to the open ROM, and set its state to Enabled. This function may be called before a ROM begins execution or while a ROM is currently running. Some cheat codes must be applied before the ROM begins executing, and may not work correctly if added after the ROM begins execution. A Cheat Function consists of a list of one or more m64p_cheat_code elements. If a Cheat Function with the given '''CheatName''' already exists, it will be removed and the new Cheat Function will be added in its place. +|} +
+{| border="1" +|Prototype +|'''m64p_error CoreCheatEnabled(const char *CheatName, int Enabled)''' +|- +|Input Parameters +|'''CheatName''' Pointer to NULL-terminated string containing the name of an existing Cheat Function.
+'''Enabled''' Boolean value to which to set the enabled state of the specified Cheat Function. +|- +|Requirements +|The Mupen64Plus library must already be initialized before calling this function. A ROM image must be currently opened. +|- +|Usage +|This function enables or disables a specified Cheat Function. +|} + diff --git a/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Core_Video_Extension.txt b/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Core_Video_Extension.txt new file mode 100644 index 0000000000..ae832b5912 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Core_Video_Extension.txt @@ -0,0 +1,157 @@ +[[Mupen64Plus v2.0 Core API v1.0|Mupen64Plus v2.0 API]] + += Mupen64Plus v2.0 Video Extension API = + +Most libmupen64plus functions return an m64p_error return code, which is an enumerated type defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]. Plugin code should check the return value of each call to a libmupen64plus function. + +All of these functions should only be called from within the video plugin; they should not be called from the front-end. + +== Startup/Shutdown Functions == +{| border="1" +|Prototype +|'''m64p_error VidExt_Init(void)''' +|- +|Input Parameters +|N/A +|- +|Requirements +|This function should be called before any other Video Extension functions. +|- +|Usage +|This function should be called from within the RomOpen() video plugin function call. The default SDL implementation of this function simply calls SDL_InitSubSystem(SDL_INIT_VIDEO). It does not open a rendering window or switch video modes. +|} +
+{| border="1" +|Prototype +|'''m64p_error VidExt_Quit(void)''' +|- +|Input Parameters +|N/A +|- +|Usage +|This function closes any open rendering window and shuts down the video system. The default SDL implementation of this function calls SDL_QuitSubSystem(SDL_INIT_VIDEO). This function should be called from within the RomClosed() video plugin function. +|} +
+ +== Screen Handling Functions == +{| border="1" +|Prototype +|'''m64p_error VidExt_ListFullscreenModes(m64p_2d_size *SizeArray, int *NumSizes)''' +|- +|Input Parameters +|'''SizeArray''' Pointer to an array of m64p_2d_size objects, defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]
+'''NumSizes''' Pointer to an integer which contains the size of '''SizeArray''' for input, and the number of size objects stored for output. +|- +|Requirements +|The video extension must be initialized before calling this function. +|- +|Usage +|This function is used to enumerate the available resolutions for fullscreen video modes. An array '''SizeArray''' is passed into the function, which is then filled (up to *'''NumSizes''' objects) with resolution sizes. The number of sizes actually written is stored in the integer which is pointed to by '''NumSizes'''. +|} +
+{| border="1" +|Prototype +|'''m64p_error VidExt_SetVideoMode(int Width, int Height, int BitsPerPixel, m64p_video_mode ScreenMode)''' +|- +|Input Parameters +|'''Width''' Horizontal resolution in pixels of desired video window
+'''Height''' Vertical resolution in pixels of desired video window
+'''BitsPerPixel''' Pixel color resolution of desired video window. This value must be 16, 24, or 32
+'''ScreenMode''' Either M64VIDEO_WINDOWED or M64VIDEO_FULLSCREEN +|- +|Requirements +|The video extension must be initialized before calling this function. +|- +|Usage +|This function creates a rendering window or switches into a fullscreen video mode. Any desired OpenGL attributes should be set before calling this function. +|} +
+{| border="1" +|Prototype +|'''m64p_error VidExt_SetCaption(const char *Title)''' +|- +|Input Parameters +|'''Title''' Pointer to a NULL-terminated string containing the desired title text of the emulator rendering window +|- +|Requirements +|The video extension must be initialized before calling this function. +|- +|Usage +|This function sets the caption text of the emulator rendering window. +|} +
+{| border="1" +|Prototype +|'''m64p_error VidExt_ToggleFullScreen(void)''' +|- +|Input Parameters +|N/A +|- +|Requirements +|The video extension must be initialized before calling this function. The rendering window should already be created. +|- +|Usage +|This function toggles between fullscreen and windowed rendering modes. +|} +
+ +== OpenGL Functions == +{| border="1" +|Prototype +|'''void * VidExt_GL_GetProcAddress(const char* Proc)''' +|- +|Input Parameters +|'''Proc''' Pointer to a NULL-terminated string containing the name of the desired OpenGL extension function. +|- +|Requirements +|The video extension must be initialized before calling this function. +|- +|Usage +|This function is used to get a pointer to an OpenGL extension function. This is only necessary on the Windows platform, because the OpenGL implementation shipped with Windows only supports OpenGL version 1.1. +|} +
+{| border="1" +|Prototype +|'''m64p_error VidExt_GL_SetAttribute(m64p_GLattr Attr, int Value)''' +|- +|Input Parameters +|'''Attr''' Enumerated type (defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]) specifying which OpenGL attribute to set
+'''Value''' Value to set for the attribute +|- +|Requirements +|The video extension must be initialized before calling this function. The desired attributes should be set before calling '''VidExt_SetVideoMode''' +|- +|Usage +|This function is used to set certain OpenGL attributes which must be specified before creating the rendering window with '''VidExt_SetVideoMode'''. +|} +
+{| border="1" +|Prototype +|'''m64p_error VidExt_GL_GetAttribute(m64p_GLattr Attr, int *pValue)''' +|- +|Input Parameters +|'''Attr''' Enumerated type (defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]) specifying OpenGL attribute of which to get value
+'''pValue''' Pointer to integer Value which will be set to attribute's value +|- +|Requirements +|The video extension must be initialized before calling this function. +|- +|Usage +|This function may be used to check that OpenGL attributes where successfully set to the rendering window after the '''VidExt_SetVideoMode''' function call. +|} +
+{| border="1" +|Prototype +|'''m64p_error VidExt_GL_SwapBuffers(void)''' +|- +|Input Parameters +|N/A +|- +|Requirements +|The video extension must be initialized before calling this function. The rendering window should already be created. +|- +|Usage +|This function is used to swap the front/back buffers after rendering an output video frame. +|} +
+ diff --git a/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Design_Proposal_3.txt b/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Design_Proposal_3.txt new file mode 100644 index 0000000000..fdee505a78 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Design_Proposal_3.txt @@ -0,0 +1,103 @@ +[http://mupen64plus.retrouprising.com Project page] + +== Primary Goal == + +The primary goal of this re-architecture is to split this large project into smaller projects which may proceed to be developed independently of each other. The advantages of the new architecture are: +* The build system can be greatly simplified +* Each module can use its own build system. For example, the Qt GUI might switch to cmake for better Qt integration. +* Porting the emulator core to other platforms (namely Win32) will be greatly simplified by removing the most platform-specific pieces. +* Making releases for each package will be simpler and faster +* Mupen64Plus may be included into the Debian/Ubuntu repositories since glN64 (with its 'unknown' license) will be a separate project + +== Topography == + +This re-architecture will force us to lay boundaries with well-defined APIs between different parts of the emulator. Here are some initial suggestions for the new layout of the modules: + +# Mupen64plus-core +#* To simplify porting to other platforms, the core needs to be as lean as possible +#* For this reason, the GUI interfaces, the ROM cache, and the zip/lzma/7zip decompressors will be removed +#* The core will contain the code for: +#** Emulating the R4300 main CPU and memory systems +#** Loading and configuring plugins +#** Reading, parsing, and writing all configuration files for the core + plugins +#** Parsing and returning information about ROM images +#** Core user interface for keyboard and LIRC input +#** Savestates and screenshots +#** An on-screen display +#** Cheat and debugger core functions +#** 'Dummy' plugins +# Mupen64plus-console, Mupen64plus-gtk, Mupen64plus-qt +#* Command-line only, GTK, and Qt front-end interfaces +#* Each front-end for the core library will be a separate project +#* The ROM cache code will be forked and included into both GUIs +#* The front-ends will be responsible for finding and loading the core library and the plugins +#* The dynamic library handle of the core will be passed to all the plugins, and the dynamic library handle of the plugins will be passed to the core +#* The front-ends will be responsible for loading and decompressing the ROM image, and passing a pointer to the core +# Plugins (RiceVideo, glN64, glide64, Blight Input, JTTL Audio) +#* The plugins will be spun off into separate projects +#* The plugin API will change, and will be incompatible with the old Zilmar spec + +== Project Owners == +Richard42 will retain ownership of the Mupen64plus-core and Mupen64plus-console modules. I will recommend that Slougi take ownership of the Qt GUI. The plugins and GTK GUI are up for grabs. + +== Work To Do == +Tasks which have been completed will be marked with the strikethrough format. + +=== Prior to starting on the code === +# Write design document for Core API +#* Front-end + debugger + cheat +#* Configuration interface +#* Video plugin +#* Audio plugin +#* Input plugin +#* RSP plugin +# Set up new Mercurial repository for project +=== Coding tasks === +# First steps +#* Split & fork the source files into new structure +# Core +#* Refactor/simplify makefiles +#* Remove #include statements from header files +#* Write new configuration load/parse/save functionality +#* Separate event loop out of main.c into new source file +#* Fix broken WM_KeyDown/WM_KeyUp commands sent to input plugin +#* Remove main() function +#* Remove main/winlnxdefs.h +#* Add new shared library interface (Must be thread-safe and re-entrant where necessary) +#** api/callbacks.c +#** api/common.c +#** api/config.c +#** api/debugger.c +#** api/frontend.c +#** api/vidext.c +#* Refactor core code for new debug info interface (instead of printf(), send back to front-end) +#* Modify plugin-handling code to use new plugin API +#* Fix 64-bit dynamic recompiler for dynamic lib +#* Update translate.c file handling and translations +#* Update cheat.c cheat code handling +#* Remove compare_core.c, add core comparison feature to console-ui +#* Generate versioned core library +#* Simplify makefile / pre.mk +#* Refactor install.sh +#* Go through google code issue list, apply patches and close issue reports +# Front-ends +#* Refactor/simplify makefiles +## CLI +##* Write from scratch, based on main.c +##* Update man page +## GUI-Qt +##* Adapt from previous mupen64puls Qt GUI code, pulling code from CLI front-end (Slougi) +## GUI-GTK +##* Adapt from previous mupen64puls GTK GUI code, pulling code from CLI front-end (TBD) +# Plug-ins +#* For each plug-in: +#** m64p-rsp-hle +#** m64p-audio-sdl +#** m64p-video-rice +#** m64p-input-sdl +#* Remove existing configuration read/write code +#* Add Deadzone and Scaling parameters to Blight Input plugin +#* Refactor to use new configuration interface through core library +#* Refactor for changes in core plugin API +#* Refactor for new debug info interface (instead of printf(), send back to front-end) + diff --git a/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Plugin_API.txt b/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Plugin_API.txt new file mode 100644 index 0000000000..e5493d22c8 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_Plugin_API.txt @@ -0,0 +1,285 @@ +[[Mupen64Plus v2.0 Core API v1.0|Mupen64Plus v2.0 API]] + += Mupen64Plus v2.0 Plugin API = + +This section lists all of the functions which are exported by the plugins. The front-end application should only use the PluginStartup, PluginShutdown, and PluginGetVersion functions. All other functions will only be called from the core. + +== Common Plugin API == +These functions are present in all of the plugins. + +{| border="1" +|Prototype +|'''m64p_error PluginStartup(m64p_dynlib_handle CoreLibHandle, void *Context, void (*DebugCallback)(void *Context, int level, const char *Message))''' +|- +|Input Parameters +|'''CoreLibHandle''' Dynamic library handle (defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]) corresponding with the core mupen64plus library.
+'''Context''' Pointer which will be passed back to the '''DebugCallback''' function. Can be NULL.
+'''DebugCallback''' Pointer to function in front-end for receiving debug information and warnings from the plugin. This function must be thread-safe. Can be NULL. +|- +|Requirements +|This function must be called before any other plugin functions. The Core library must already be started before calling this function. This function must be called before attaching the plugin to the core. +|- +|Usage +|This function initializes plugin for use by allocating memory, creating data structures, and loading the configuration data. This function may return M64ERR_INCOMPATIBLE if an older core library is used with a newer plugin. +|} +
+{| border="1" +|Prototype +|'''m64p_error PluginShutdown(void)''' +|- +|Requirements +|This plugin should be detached from the core before calling this function. +|- +|Usage +|This function destroys data structures and releases memory allocated by the plugin library. +|} +
+{| border="1" +|Prototype +|'''m64p_error PluginGetVersion(m64p_plugin_type *PluginType, int *PluginVersion, int *APIVersion, const char **PluginNamePtr, int *Capabilities)''' +|- +|Input Parameters +|'''PluginType''' Pointer to an enumerated type to store the plugin type of this plugin.
+'''PluginVersion''' Pointer to an integer to store the version number of this plugin. Version number 2.1.3 would be stored as 0x00020103.
+'''APIVersion''' Pointer to an integer to store the version number of the Core-Plugin API for this type of plugin used by this plugin.
+'''PluginNamePtr''' Pointer to a const character pointer to receive the name of this plugin. The const char * which is returned must point to a persistent string (ie, not stored on the stack).
+'''Capabilities''' Pointer to an integer to store a logically-or'd set of flags which specify the capabilities of the plugin which were built into the library during compilation. These are currently only defined for the core, so this will always return 0 for a plugin. +|- +|Usage +|This function retrieves version information from the plugin. This function is the same for the core library and the plugins, so that a front-end may examine all shared libraries in a directory and determine their types. Any of the input parameters may be set to NULL and this function will succeed but won't return the corresponding information. +|} + +== Video Plugin API == + +=== Mupen64Plus v2.0 Video Plugin API === +{| +|void ChangeWindow(void); +|Toggle Fullscreen/Windowed mode +|- +|BOOL InitiateGFX(GFX_INFO Gfx_Info); +|Called during CoreAttachPlugin to send info about the emulator core to the graphics plugin and start up the graphics sub-system. This should create the rendering window and the OpenGL context. +|- +|void MoveScreen(int xpos, int ypos); +|This function is called in response to the emulator receiving a WM_MOVE, passing the xpos and ypos from that message. +|- +|void ProcessDList(void); +|Process high-level graphics D-list. (not currently used) +|- +|void ProcessRDPList(void); +|Process low-level graphics D-list. +|- +|void RomClosed(void); +|Called after the emulator is stopped. +|- +|int RomOpen(void); +|Called just before the emulator begins executing a ROM. '''***changed*** - this function now returns an int (boolean)''' +|- +|void ShowCFB (void); +|Called from the RSP plugin to signal a condition to the video plugin. +|- +|void UpdateScreen(void); +|This function is called in response to a VSync condition if the VI bit in MI_INTR_REG is set +|- +|void ViStatusChanged(void); +|This function is called to notify the video plugin that the ViStatus registers value has been changed. +|- +|void ViWidthChanged(void); +|This function is called to notify the video plugin that the ViWidth registers value has been changed. +|- +|void ReadScreen2(void *dest, int *width, int *height, int front); +|This function reads the pixels of the frame buffer that is either currently displayed (front != 0) or being drawn (front == 0) +|- +|void SetRenderingCallback(void (*callback)(int bScreenRedrawn)); +|Allows the core to register a callback function that will be called by the graphics plugin just before the the frame buffers are swapped. '''***changed*** - as of video api v2.1.0, the callback function must take a single int (boolean) parameter, which tells the core whether or not the screen has been redrawn since the last time the callback was called. This is used to prevent screenshots from containing OSD text.''' +|- +|void FBRead(unsigned int addr) +|Read data from frame buffer into emulated RAM space +|- +|void FBWrite(unsigned int addr, unsigned int size) +|Write data from emulated RAM space into frame buffer +|- +|void FBGetFrameBufferInfo(void *p) +|Get some information about the frame buffer +|} + +=== Remove From Older Video API === +{| +|- +|void CaptureScreen (char * Directory); +|- +|void CloseDLL(void); +|- +|void DllAbout(HWND hParent); +|- +|void DllConfig(HWND hParent); +|- +|void DllTest(HWND hParent); +|- +|void DrawScreen(void); +|- +|void GetDllInfo(PLUGIN_INFO *PluginInfo); +|- +|void ReadScreen(void **dest, int *width, int *height); +|- +|void SetConfigDir(char *configDir); +|- +|
+typedef struct {...} PLUGIN_INFO +|} + +== Audio Plugin API == + +=== Mupen64Plus v2.0 Audio Plugin API === +{| +|void AiDacrateChanged(int SystemType); +|This function is called to notify the audio plugin that the AiDacrate register's value has been changed. +|- +|void AiLenChanged(void); +|This function is called to notify the audio plugin that the AiLen register's value has been changed. +|- +|BOOL InitiateAudio(AUDIO_INFO Audio_Info); +|Called during CoreAttachPlugin to send info about the emulator core to the audio plugin. +|- +|void ProcessAList(void); +|Signal that there is an A-list to be processed. (not currently used) +|- +|int RomOpen(void); +|Called just before the emulator begins executing a ROM. '''***changed*** - this function now returns an int (boolean)''' +|- +|void RomClosed(void); +|Called after the emulator is stopped. +|- +|void SetSpeedFactor(int percent); +|Called when the emulator playback speed changes. +|- +|void VolumeUp(void);
+void VolumeDown(void); +|Increase or decrease volume level +|- +|int VolumeGetLevel(void); +|Get current volume level in percentage, between 0 and 100. '''***NEW***''' +|- +|void VolumeSetLevel(int level); +|Set current volume level. level must be between 0 and 100. '''***NEW***''' +|- +|void VolumeMute(void); +|Toggle between audio muted and un-muted +|- +|const char * VolumeGetString(void); +|Return a string describing the current volume level +|} + +=== Remove From Older Audio API === +{| +|- +|DWORD AiReadLength(void); +|- +|void AiUpdate(BOOL Wait); +|- +|void CloseDLL(void); +|- +|void DllAbout(HWND hParent); +|- +|void DllConfig(HWND hParent); +|- +|void DllTest(HWND hParent); +|- +|void GetDllInfo(PLUGIN_INFO *PluginInfo); +|- +|BOOL PauseAudio(BOOL Pause); +|- +|void SetConfigDir(char *configDir); +|- +|
+typedef struct {...} PLUGIN_INFO +|} + +== Input Plugin API == + +=== Mupen64Plus v2.0 Input Plugin API === +{| +|void ControllerCommand(int Control, BYTE * Command); +|Process the raw data that has just been sent to a specific controller. +|- +|void GetKeys(int Control, BUTTONS * Keys); +|Get the current state of the controller's buttons +|- +|void InitiateControllers(CONTROL_INFO ControlInfo); +|Setup controller data structures +|- +|void ReadController(int Control, BYTE *Command); +|Process the raw data in the pif ram that is about to be read. (not currently used) +|- +|int RomOpen(void); +|Called just before the emulator begins executing a ROM. '''***changed*** - this function now returns an int (boolean)''' +|- +|void RomClosed(void); +|Called after the emulator is stopped. +|- +|void SDL_KeyDown(int keymod, int keysym); +|Pass a SDL_KEYDOWN-style message to the input plugin +|- +|void SDL_KeyUp(int keymod, int keysym); +|Pass a SDL_KEYUP-style message to the input plugin +|} + +=== Remove From Older Input API === +{| +|- +|void CloseDLL(void); +|- +|void DllAbout(HWND hParent); +|- +|void DllConfig(HWND hParent); +|- +|void DllTest(HWND hParent); +|- +|void GetDllInfo(PLUGIN_INFO *PluginInfo); +|- +|void SetConfigDir(char *configDir); +|- +|void WM_KeyDown(WPARAM wParam, LPARAM lParam); +|- +|void WM_KeyUp(WPARAM wParam, LPARAM lParam); +|- +|
+typedef struct {...} PLUGIN_INFO +|} + +== RSP Plugin API == + +=== Mupen64Plus v2.0 RSP Plugin API === +{| +|DWORD DoRspCycles(DWORD Cycles); +|Process pending RSP tasks. +|- +|void InitiateRSP(RSP_INFO Rsp_Info, DWORD *CycleCount); +|Called during CoreAttachPlugin to send info about the emulator core to the audio plugin. +|- +|void RomClosed(void); +|Called after the emulator is stopped. +|} + +=== Remove From Older RSP API === +{| +|- +|void CloseDLL(void); +|- +|void DllAbout(HWND hParent); +|- +|void DllConfig(HWND hParent); +|- +|void DllTest(HWND hParent); +|- +|void GetDllInfo(PLUGIN_INFO *PluginInfo); +|- +|void GetRspDebugInfo(RSPDEBUG_INFO * RSPDebugInfo); +|- +|void InitiateRSPDebugger(DEBUG_INFO DebugInfo); +|- +|
+typedef struct {...} PLUGIN_INFO
+typedef struct {...} RSPDEBUG_INFO
+typedef struct {...} DEBUG_INFO +|} + diff --git a/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_headers.txt b/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_headers.txt new file mode 100644 index 0000000000..0358106bc0 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/doc/emuwiki-api-doc/Mupen64Plus_v2.0_headers.txt @@ -0,0 +1,322 @@ +[http://mupen64plus.retrouprising.com Project page] + +== m64p_types.h == + /* ----------------------------------------- */ + /* Platform-specific stuff */ + /* ----------------------------------------- */ + + /* necessary headers */ + #if defined(WIN32) + #include + #endif + + /* DLL handles and function declaration specifiers */ + #if defined(WIN32) + #define IMPORT extern "C" __declspec(dllimport) + #define EXPORT __declspec(dllexport) + #define CALL __cdecl + typedef HMODULE m64p_dynlib_handle; + #else + #define IMPORT extern "C" + #define EXPORT __attribute__((visibility("default"))) + #define CALL + typedef void * m64p_dynlib_handle; + #endif + + /* ----------------------------------------- */ + /* Structures and Types for Core library API */ + /* ----------------------------------------- */ + + typedef void * m64p_handle; + + typedef void (*m64p_frame_callback)(unsigned int FrameIndex); + typedef void (*m64p_input_callback)(void); + typedef void (*m64p_audio_callback)(void); + typedef void (*m64p_vi_callback)(void); + + typedef enum { + M64TYPE_INT = 1, + M64TYPE_FLOAT, + M64TYPE_BOOL, + M64TYPE_STRING + } m64p_type; + + typedef enum { + M64MSG_ERROR = 1, + M64MSG_WARNING, + M64MSG_INFO, + M64MSG_STATUS, + M64MSG_VERBOSE + } m64p_msg_level; + + typedef enum { + M64ERR_SUCCESS = 0, + M64ERR_NOT_INIT, /* Function is disallowed before InitMupen64Plus() is called */ + M64ERR_ALREADY_INIT, /* InitMupen64Plus() was called twice */ + M64ERR_INCOMPATIBLE, /* API versions between components are incompatible */ + M64ERR_INPUT_ASSERT, /* Invalid parameters for function call, such as ParamValue=NULL for GetCoreParameter() */ + M64ERR_INPUT_INVALID, /* Invalid input data, such as ParamValue="maybe" for SetCoreParameter() to set a BOOL-type value */ + M64ERR_INPUT_NOT_FOUND, /* The input parameter(s) specified a particular item which was not found */ + M64ERR_NO_MEMORY, /* Memory allocation failed */ + M64ERR_FILES, /* Error opening, creating, reading, or writing to a file */ + M64ERR_INTERNAL, /* Internal error (bug) */ + M64ERR_INVALID_STATE, /* Current program state does not allow operation */ + M64ERR_PLUGIN_FAIL, /* A plugin function returned a fatal error */ + M64ERR_SYSTEM_FAIL, /* A system function call, such as an SDL or file operation, failed */ + M64ERR_UNSUPPORTED, /* Function call is not supported (ie, core not built with debugger) */ + M64ERR_WRONG_TYPE /* A given input type parameter cannot be used for desired operation */ + } m64p_error; + + typedef enum { + M64CAPS_DYNAREC = 1, + M64CAPS_DEBUGGER = 2, + M64CAPS_CORE_COMPARE = 4 + } m64p_core_caps; + + typedef enum { + M64PLUGIN_NULL = 0, + M64PLUGIN_RSP = 1, + M64PLUGIN_GFX, + M64PLUGIN_AUDIO, + M64PLUGIN_INPUT, + M64PLUGIN_CORE + } m64p_plugin_type; + + typedef enum { + M64EMU_STOPPED = 1, + M64EMU_RUNNING, + M64EMU_PAUSED + } m64p_emu_state; + + typedef enum { + M64VIDEO_NONE = 1, + M64VIDEO_WINDOWED, + M64VIDEO_FULLSCREEN + } m64p_video_mode; + + typedef enum { + M64CORE_EMU_STATE = 1, + M64CORE_VIDEO_MODE, + M64CORE_SAVESTATE_SLOT, + M64CORE_SPEED_FACTOR, + M64CORE_SPEED_LIMITER, + M64CORE_VIDEO_SIZE, + M64CORE_AUDIO_VOLUME, + M64CORE_AUDIO_MUTE, + M64CORE_INPUT_GAMESHARK, + M64CORE_STATE_LOADCOMPLETE, + M64CORE_STATE_SAVECOMPLETE + } m64p_core_param; + + typedef enum { + M64CMD_NOP = 0, + M64CMD_ROM_OPEN, + M64CMD_ROM_CLOSE, + M64CMD_ROM_GET_HEADER, + M64CMD_ROM_GET_SETTINGS, + M64CMD_EXECUTE, + M64CMD_STOP, + M64CMD_PAUSE, + M64CMD_RESUME, + M64CMD_CORE_STATE_QUERY, + M64CMD_STATE_LOAD, + M64CMD_STATE_SAVE, + M64CMD_STATE_SET_SLOT, + M64CMD_SEND_SDL_KEYDOWN, + M64CMD_SEND_SDL_KEYUP, + M64CMD_SET_FRAME_CALLBACK, + M64CMD_TAKE_NEXT_SCREENSHOT, + M64CMD_CORE_STATE_SET, + M64CMD_READ_SCREEN, + M64CMD_RESET, + M64CMD_ADVANCE_FRAME + } m64p_command; + + typedef struct { + unsigned int address; + int value; + } m64p_cheat_code; + + /* ----------------------------------------- */ + /* Structures to hold ROM image information */ + /* ----------------------------------------- */ + + typedef enum + { + SYSTEM_NTSC = 0, + SYSTEM_PAL, + SYSTEM_MPAL + } m64p_system_type; + + typedef struct + { + unsigned char init_PI_BSB_DOM1_LAT_REG; /* 0x00 */ + unsigned char init_PI_BSB_DOM1_PGS_REG; /* 0x01 */ + unsigned char init_PI_BSB_DOM1_PWD_REG; /* 0x02 */ + unsigned char init_PI_BSB_DOM1_PGS_REG2; /* 0x03 */ + unsigned int ClockRate; /* 0x04 */ + unsigned int PC; /* 0x08 */ + unsigned int Release; /* 0x0C */ + unsigned int CRC1; /* 0x10 */ + unsigned int CRC2; /* 0x14 */ + unsigned int Unknown[2]; /* 0x18 */ + unsigned char Name[20]; /* 0x20 */ + unsigned int unknown; /* 0x34 */ + unsigned int Manufacturer_ID; /* 0x38 */ + unsigned short Cartridge_ID; /* 0x3C - Game serial number */ + unsigned short Country_code; /* 0x3E */ + } m64p_rom_header; + + typedef struct + { + char goodname[256]; + char MD5[33]; + unsigned char savetype; + unsigned char status; /* Rom status on a scale from 0-5. */ + unsigned char players; /* Local players 0-4, 2/3/4 way Netplay indicated by 5/6/7. */ + unsigned char rumble; /* 0 - No, 1 - Yes boolean for rumble support. */ + } m64p_rom_settings; + + /* ----------------------------------------- */ + /* Structures and Types for the Debugger */ + /* ----------------------------------------- */ + + typedef enum { + M64P_DBG_RUN_STATE = 1, + M64P_DBG_PREVIOUS_PC, + M64P_DBG_NUM_BREAKPOINTS, + M64P_DBG_CPU_DYNACORE, + M64P_DBG_CPU_NEXT_INTERRUPT + } m64p_dbg_state; + + typedef enum { + M64P_DBG_MEM_TYPE = 1, + M64P_DBG_MEM_FLAGS, + M64P_DBG_MEM_HAS_RECOMPILED, + M64P_DBG_MEM_NUM_RECOMPILED, + M64P_DBG_RECOMP_OPCODE = 16, + M64P_DBG_RECOMP_ARGS, + M64P_DBG_RECOMP_ADDR + } m64p_dbg_mem_info; + + typedef enum { + M64P_MEM_NOMEM = 0, + M64P_MEM_NOTHING, + M64P_MEM_RDRAM, + M64P_MEM_RDRAMREG, + M64P_MEM_RSPMEM, + M64P_MEM_RSPREG, + M64P_MEM_RSP, + M64P_MEM_DP, + M64P_MEM_DPS, + M64P_MEM_VI, + M64P_MEM_AI, + M64P_MEM_PI, + M64P_MEM_RI, + M64P_MEM_SI, + M64P_MEM_FLASHRAMSTAT, + M64P_MEM_ROM, + M64P_MEM_PIF, + M64P_MEM_MI, + M64P_MEM_BREAKPOINT + } m64p_dbg_mem_type; + + typedef enum { + M64P_MEM_FLAG_READABLE = 0x01, + M64P_MEM_FLAG_WRITABLE = 0x02, + M64P_MEM_FLAG_READABLE_EMUONLY = 0x04, // the EMUONLY flags signify that emulated code can read/write here, but debugger cannot + M64P_MEM_FLAG_WRITABLE_EMUONLY = 0x08 + } m64p_dbg_mem_flags; + + typedef enum { + M64P_DBG_PTR_RDRAM = 1, + M64P_DBG_PTR_PI_REG, + M64P_DBG_PTR_SI_REG, + M64P_DBG_PTR_VI_REG, + M64P_DBG_PTR_RI_REG, + M64P_DBG_PTR_AI_REG + } m64p_dbg_memptr_type; + + typedef enum { + M64P_CPU_PC = 1, + M64P_CPU_REG_REG, + M64P_CPU_REG_HI, + M64P_CPU_REG_LO, + M64P_CPU_REG_COP0, + M64P_CPU_REG_COP1_DOUBLE_PTR, + M64P_CPU_REG_COP1_SIMPLE_PTR, + M64P_CPU_REG_COP1_FGR_64, + M64P_CPU_TLB + } m64p_dbg_cpu_data; + + typedef enum { + M64P_BKP_CMD_ADD_ADDR = 1, + M64P_BKP_CMD_ADD_STRUCT, + M64P_BKP_CMD_REPLACE, + M64P_BKP_CMD_REMOVE_ADDR, + M64P_BKP_CMD_REMOVE_IDX, + M64P_BKP_CMD_ENABLE, + M64P_BKP_CMD_DISABLE, + M64P_BKP_CMD_CHECK + } m64p_dbg_bkp_command; + + #define M64P_MEM_INVALID 0xFFFFFFFF // invalid memory read will return this + + #define BREAKPOINTS_MAX_NUMBER 128 + + #define BPT_FLAG_ENABLED 0x01 + #define BPT_FLAG_CONDITIONAL 0x02 + #define BPT_FLAG_COUNTER 0x04 + #define BPT_FLAG_READ 0x08 + #define BPT_FLAG_WRITE 0x10 + #define BPT_FLAG_EXEC 0x20 + #define BPT_FLAG_LOG 0x40 //Log to the console when this breakpoint hits. + + #define BPT_CHECK_FLAG(a, b) ((a.flags & b) == b) + #define BPT_SET_FLAG(a, b) a.flags = (a.flags | b); + #define BPT_CLEAR_FLAG(a, b) a.flags = (a.flags & (~b)); + #define BPT_TOGGLE_FLAG(a, b) a.flags = (a.flags ^ b); + + typedef struct _breakpoint { + unsigned int address; + unsigned int endaddr; + unsigned int flags; + //unsigned int condition; //Placeholder for breakpoint condition + } breakpoint; + + /* ------------------------------------------------- */ + /* Structures and Types for Core Video Extension API */ + /* ------------------------------------------------- */ + + typedef struct { + unsigned int uiWidth; + unsigned int uiHeight; + } m64p_2d_size; + + typedef enum { + M64P_GL_DOUBLEBUFFER = 1, + M64P_GL_BUFFER_SIZE, + M64P_GL_DEPTH_SIZE, + M64P_GL_RED_SIZE, + M64P_GL_GREEN_SIZE, + M64P_GL_BLUE_SIZE, + M64P_GL_ALPHA_SIZE, + M64P_GL_SWAP_CONTROL, + M64P_GL_MULTISAMPLEBUFFERS, + M64P_GL_MULTISAMPLESAMPLES + } m64p_GLattr; + + typedef struct { + unsigned int Functions; + m64p_error (*VidExtFuncInit)(void); + m64p_error (*VidExtFuncQuit)(void); + m64p_error (*VidExtFuncListModes)(m64p_2d_size *, int *); + m64p_error (*VidExtFuncSetMode)(int, int, int, int); + void * (*VidExtFuncGLGetProc)(const char*); + m64p_error (*VidExtFuncGLSetAttr)(m64p_GLattr, int); + m64p_error (*VidExtFuncGLGetAttr)(m64p_GLattr, int *); + m64p_error (*VidExtFuncGLSwapBuf)(void); + m64p_error (*VidExtFuncSetCaption)(const char *); + m64p_error (*VidExtFuncToggleFS)(void); + } m64p_video_extension_functions; + diff --git a/libmupen64plus/mupen64plus-core/doc/font-license b/libmupen64plus/mupen64plus-core/doc/font-license new file mode 100644 index 0000000000..d3ae27c734 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/doc/font-license @@ -0,0 +1,40 @@ +Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. + +Bitstream Vera Sans +Bitstream Vera Sans - Roman Release 1.10 Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. + +Bitstream Vera is a trademark of Bitstream, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts +accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to +reproduce and distribute the Font Software, including without limitation the rights to use, copy, +merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom +the Font Software is furnished to do so, subject to the following conditions: + +The above copyright and trademark notices and this permission notice shall be included in all copies +of one or more of the Font Software typefaces. + +The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or +characters in the Fonts may be modified and additional glyphs or characters may be added to the +Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word +"Vera". + +This License becomes null and void to the extent applicable to Fonts or Font Software that has been +modified and is distributed under the "Bitstream Vera" names. + +The Font Software may be sold as part of a larger software package but no copy of one or more of the +Font Software typefaces may be sold by itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE +GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, +SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER +DEALINGS IN THE FONT SOFTWARE. + +Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., +shall not be used in advertising or otherwise to promote the sale, use or other dealings in this +Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., +respectively. For further information, contact: fonts at gnome dot org.http://www.bitstream.com + diff --git a/libmupen64plus/mupen64plus-core/doc/gpl-license b/libmupen64plus/mupen64plus-core/doc/gpl-license new file mode 100644 index 0000000000..4f3d00063c --- /dev/null +++ b/libmupen64plus/mupen64plus-core/doc/gpl-license @@ -0,0 +1,342 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, 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 + + + Appendix: 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. + + + Copyright (C) 19yy + + 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., 675 Mass Ave, Cambridge, MA 02139, 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) 19yy 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. + + , 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. + diff --git a/libmupen64plus/mupen64plus-core/doc/lgpl-license b/libmupen64plus/mupen64plus-core/doc/lgpl-license new file mode 100644 index 0000000000..02a8b597be --- /dev/null +++ b/libmupen64plus/mupen64plus-core/doc/lgpl-license @@ -0,0 +1,505 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 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. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +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 and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, 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 library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete 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 distribute a copy of this License along with the +Library. + + 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 Library or any portion +of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +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 Library, 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 Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you 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. + + If distribution of 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 satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be 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. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library 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. + + 9. 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 Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +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 with +this License. + + 11. 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 Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library 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 Library. + +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. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library 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. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser 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 Library +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 Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +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 + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "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 +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. 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 LIBRARY 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 +LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. 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. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; 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. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + + diff --git a/libmupen64plus/mupen64plus-core/doc/module-api-versions.txt b/libmupen64plus/mupen64plus-core/doc/module-api-versions.txt new file mode 100644 index 0000000000..a4fce57dd6 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/doc/module-api-versions.txt @@ -0,0 +1,174 @@ +Mupen64Plus API versions + +--------------------------------------------------------------------------------------------------- +Goal: + +The Mupen64Plus API versioning scheme was invented to give a more friendly and less confusing +experience for users as the various components evolve over time. There are 6 basic components +to the Mupen64Plus system, which may be independently built and installed: + +1. The Front-end UI application +2. The Core emulator library +3. The Video plugin +4. The Audio plugin +5. The Input plugin +6. The RSP plugin + +These components interact with each other in several different ways. The design goal of the +versioning scheme is to gracefully handle all situations in which two components support different +versions of their common API (due to one component being newer than the other). In particular, +each pair of components sharing a common API must discover whether or not they are compatible with +each other. They must make this determination early enough in the startup process to inform the +user of an incompatibility and gracefully exit the software if necessary without crashing. There +are 2 different decisions that pertain to the compatibility determination: + +1. Major API version. The various API version numbers are 32-bit. The major version number is + stored in the upper 16 bits, and the minor version number is in the lower 16 bits. If two + components have different major API version numbers, then they are definitely incompatible. +2. Minor API version. If two components with a common API have different minor version numbers, + then the newer component may decide whether or not it can interact with the older component + based upon the older component's version number. The newer component may optionally disable + new features and still retain backwards compatibility, or it may refuse to operate with the + older component. This decision is left to the component author when new features are added. + +--------------------------------------------------------------------------------------------------- +Basic Design: + +In mupen64plus-core/src/plugin/plugin.h, the following macros are defined: + +#define RSP_API_MAJOR_VERSION 0x20000 +#define GFX_API_MAJOR_VERSION 0x20000 +#define AUDIO_API_MAJOR_VERSION 0x20000 +#define INPUT_API_MAJOR_VERSION 0x20000 + +In mupen64plus-core/src/main/version.h, the following macros are defined: + +#define FRONTEND_API_VERSION 0x020000 +#define CONFIG_API_VERSION 0x020000 +#define DEBUG_API_VERSION 0x020000 +#define VIDEXT_API_VERSION 0x020000 + +1. When the front-end application calls the CoreStartup(), it passes it's Core<-->Front-end API + version to the core. If the API major version numbers for the core and front-end don't match, + the core return from this function with a failure code of M64ERR_INCOMPATIBLE. + +2. The Console-UI front-end also checks for API compatibility, during the AttachCoreLib() function + call. It is not strictly necessary for a front-end application to verify the API compatibility + with the core, since the core will also check during CoreStartup(). However, by doing so, an + updated front-end may detect a core library using a newer (but backwards-compatible) API, and + enable some extra features as a result of the expanded API. + +3. At the time each plugin is attached to the core (during CoreAttachPlugin function call), the + core checks the version number of the plugin API by calling the PluginGetVersion function. If + the major version number of the plugin's reported API (APIVersion & 0xffff0000) does not match + the corresponding version number for that plugin type in the core (defined in plugin.h), then + the plugin is incompatible and cannot be attached to the core. Currently the plugins have no + way to request the major version number required for a particular plugin type in the core + library. + +4. The emulator core exports several different API groups which may be used by the front-end and + plugin modules. Currently, these groups are: Front-end, Config, Debug, and Video Extension. + A front-end application or any plugin may call the CoreGetAPIVersions() function to retrieve + the API version numbers for these groups. Any plugin or front-end which can use any updated + (not present in the original "2.0" API) functions in one of these groups should call the core's + CoreGetAPIVersions() function (during PluginStartup for a plugin or at core attach time for a + front-end) to check the version # of the API supported by the core, and react accordingly. + +5. All front-ends and plugins should verify API version compatibility for the Config API. + +--------------------------------------------------------------------------------------------------- +Handling Future Changes: + +1. New feature added to a plugin library + If the feature is backwards-compatible with older cores, then plugin API minor version will + be bumped. Otherwise, major version number will be bumped. If change is backwards-compatible, + then newest core can test the plugin's API version and only enable the feature if present. + +2. New feature added to Core<-->Front-end API + Typically this will happen when a new function or a new feature of an existing function is + added to the core. If the older front-ends will still be compatible with newer cores, then the + minor version number of the front-end API will be bumped. Otherwise the major version number + will be bumped. A newer front-end can check the version of the API supported by the core and + choose whether to retain backwards-compatibility with older cores or refuse to interoperate. + +3. New feature added to Core Config API + If older plugins can still use the Core Config API with the new feature, then Config API minor + version will be bumped. Otherwise, major version number will be bumped. Newer plugins should + check the Core's Config API version and maintain backwards compatibility with older cores if + possible. + +4. New feature added to Core Debug API + If older front-ends can still use the Core Debug API with the new feature, then Debug API minor + version number will be bumped. Otherwise, major version number will be bumped. Newer + front-end applications should check the Core's Debug API version and maintain backwards + compatibility with older cores if possible. + +5. New feature added to Video Extension API + This is the most complicated interface, because it involves 3 components: the video plugin, the + core, and the front-end application. If older video plugins can still use the newer Video + Extension API with the core, *and* newer front-end applications can work with older cores, then + the Video Extension API minor version number will be bumped. Otherwise, the major version + number will be bumped. Newer video plugins can check the Core's Video Extension API version + and maintain backwards compatibility with older cores if possible, otherwise they can refuse + and give a compatibility error. Front-end applications (such as the default console-ui) which + do not hook into the Video Extension do not need to check the Core's Video Extension API + version. However, front-end applications which do hook into the Video Extension must check the + API version. If the Core and Front-end have different API major version numbers, then they are + incompatible. Also if the Core has a *newer* minor version than the front-end, then they are + incompatible. This is a unique restriction, and it must be checked and verified by the + front-end; the Core has no way to check this. + +--------------------------------------------------------------------------------------------------- +Changelog: + - Version 2.0.0 is the base for all APIs + + - FRONTEND_API_VERSION version 2.0.1: + - added "m64p_command" type "M64CMD_CORE_STATE_SET", handled by CoreDoCommand() + - added "m64p_core_param" type "M64CORE_SPEED_LIMITER", handled by "M64CMD_CORE_STATE_QUERY" and "M64CMD_CORE_STATE_SET" commands + + - FRONTEND_API_VERSION version 2.0.2: + - added "m64p_command" types: + - M64CMD_GET_SCREEN_WIDTH + - M64CMD_GET_SCREEN_HEIGHT + - M64CMD_READ_SCREEN + - M64CMD_VOLUME_UP + - M64CMD_VOLUME_DOWN + - M64CMD_VOLUME_GET_LEVEL + - M64CMD_VOLUME_SET_LEVEL + - M64CMD_VOLUME_MUTE + - M64CMD_RESET + - M64CMD_ADVANCE_FRAME + - extend command M64CMD_STATE_SAVE to support saving uncompressed PJ64 savestate files as well as zip compressed + + - FRONTEND_API_VERSION version 2.1.0: + - removed "m64p_command" types: + - M64CMD_GET_SCREEN_WIDTH + - M64CMD_GET_SCREEN_HEIGHT + - M64CMD_VOLUME_UP + - M64CMD_VOLUME_DOWN + - M64CMD_VOLUME_GET_LEVEL + - M64CMD_VOLUME_SET_LEVEL + - M64CMD_VOLUME_MUTE + - added new "m64p_core_param" types: + - M64CORE_VIDEO_SIZE + - M64CORE_AUDIO_VOLUME + - M64CORE_AUDIO_MUTE + - M64CORE_INPUT_GAMESHARK + - M64CORE_STATE_LOADCOMPLETE + - M64CORE_STATE_SAVECOMPLETE + + - CONFIG_API_VERSION version 2.1.0: + - add new function "ConfigSaveSection()" to save only a single config section to disk + + - CONFIG_API_VERSION version 2.2.0: + - add new function "ConfigHasUnsavedChanges()" to determine if a given Section (or all sections) + of the Mupen64Plus Core configuration file has been modified since it was last saved or loaded. + - add new function "ConfigRevertChanges()" to revert changes previously made to one section of + the configuration file, so that it will match with the configuration at the last time that it + was loaded from or saved to disk. + + - VIDEO_API_VERSION version 2.1.0: + - video render callback function now takes a boolean (int) parameter, which specifies whether the + video frame has been re-drawn since the last time the render callback was called. This allows + us to take screenshots without the On-Screen-Display text + diff --git a/libmupen64plus/mupen64plus-core/doc/new_dynarec.txt b/libmupen64plus/mupen64plus-core/doc/new_dynarec.txt new file mode 100644 index 0000000000..2f3d75169a --- /dev/null +++ b/libmupen64plus/mupen64plus-core/doc/new_dynarec.txt @@ -0,0 +1,413 @@ +This page describes the dynamic recompiler in [[Mupen64Plus]], and the changes made for the ARM port. + +==The original dynamic recompiler by Hacktarux== + +The dynamic recompiler used in Mupen64plus v1.5 is based on the original written by Hacktarux in 2002. + +It recompiles contiguous blocks of MIPS instructions. First, each instruction is decoded into a dynamically-allocated 132-byte data structure. + + +typedef struct _precomp_instr +{ + void (*ops)(); + union + { + struct + { + long long int *rs; + long long int *rt; + short immediate; + } i; + struct + { + unsigned int inst_index; + } j; + struct + { + long long int *rs; + long long int *rt; + long long int *rd; + unsigned char sa; + unsigned char nrd; + } r; + struct + { + unsigned char base; + unsigned char ft; + short offset; + } lf; + struct + { + unsigned char ft; + unsigned char fs; + unsigned char fd; + } cf; + } f; + unsigned int addr; /* word-aligned instruction address in r4300 address space */ + unsigned int local_addr; /* byte offset to start of corresponding x86_64 instructions, from start of code block */ + reg_cache_struct reg_cache_infos; +} precomp_instr; + + +The decoded instructions are then compiled, generating x86 instructions for each MIPS instruction. A 32K block is allocated with malloc() to hold the x86 code. If this size proves insufficient, it is incrementally resized with realloc(). + +MIPS registers are allocated to x86 registers with a least-recently-used replacement policy. All cached registers are written back prior to a branch, or a memory read or write. + +To facilitate invalidation and replacement of modified code blocks, each 4K page is compiled separately. If a sequence of instructions crosses a 4K page boundary, the current block is ended, and the next instructions will be compiled as a separate block. + +Branch instructions within a 4K page are compiled as branches directly to the target address. Branches which cross a 4K page go through an indirect address lookup. + +Compiled code blocks are invalidated on write. On an actual MIPS CPU, the instruction cache is invalidated using the CACHE instruction, however a few N64 games clear the cache using other methods. Trapping writes appears to be the most reliable method of ensuring cache coherency in the emulated system. The cache instruction is ignored. + +==Problems with the original design== + +The most significant performance problem with this design is its excessive memory usage. The decoded instruction data is retained (132 bytes for each MIPS instruction) and occasionally referenced during execution. Memory accesses frequently miss the L2 cache, resulting in poor performance. + +Additionally, the register cache is relatively inefficient, since all registers are flushed before any read or write operation. + +==A new approach== + +To reduce memory usage, the new design allocates a single large block of memory (generally 32 MiB, but the size is configurable) which is used for recompiled code. This memory is allocated using mmap with the PROT_EXEC bit set, to ensure operation on CPUs with no-execute (NX) page permissions. + +Contiguous blocks of MIPS instructions are compiled (that is, it does not attempt to follow branches or 'hot-paths'). + +The recompiler consists of eight stages, plus a linker, and a memory manager. + +Compiled blocks are invalidated on write, as before, however as the compiler will cross a 4K page, writes may invalidate adjacent pages as well. + +Currently the dynarec generates x86, x86-64, ARMv5, and ARMv7 (little-endian). Most of the code is shared between the architectures, but a different code generator is included at compile time, using different #include statements depending on the CPU type. + +==Pass 1: Disassembly== + +When an instruction address is encountered which has not been compiled, the function new_recompile_block is called, with the (virtual) address of the target instruction as its sole parameter. If the address is invalid, the function returns a nonzero value and the caller is responsible for handling the pagefault. + +Instructions are decoded until an unconditional jump, usually a return, is encountered. Disassembly is ordinarilly continued past a JAL (subroutine call) instruction, however this strategy is abandoned if invalid instructions are encountered. + +Up to 4096 instructions (16K of MIPS code) may be disassembled at once. Surprisingly, some games do actually reach this limit. + +==Pass 2: Liveness analysis== + +After disassembly, liveness analysis is performed on the registers. This determines when a particular register will no longer be used, and thus can be removed from the register cache. + +A separate analysis is done on the upper 32 bits of 64-bit registers. This can determine when only the lower 32 bits of a register are significant, thus allowing use of a 32-bit register. This enables more efficient code generation on 32-bit processors. + +==Pass 3: Register allocation== + +The 31 MIPS registers must be mapped onto seven available registers on x86, or twelve available registers on ARM. + +Instructions with 64-bit results require two registers on 32-bit host processors. 32-bit instructions require only one. A flag is set for registers containing 32-bit values, and these registers will be sign-extended before they are written to the register file. + +Registers are made available using a least-soon-needed replacement policy. When the register cache is full, and no registers can be eliminated using the liveness analysis, a ten-instruction lookahead is used to determine which registers will not be needed soon and these registers are evicted from the cache. + +==Pass 4: Free unused registers== + +After the initial register allocation, the allocations are reviewed to determine if any registers remain allocated longer than necessary. These are then removed from the register cache. This avoids having to write back a large number of registers just before a branch, and makes more registers available for the next pass. + +==Pass 5: Pre-allocate registers== + +If a register will be used soon and needs to be loaded, try to load it early if the register is available. This improves execution on CPUs with a load-use penalty. + +==Pass 6: Optimize clean/dirty state== + +If a cached register is 'dirty' and needs to be written out, try to do so as soon as the register will no longer be modified. This avoids having to write the same register on multiple code paths due to conditional branches. Additionally, try to avoid writing out dirty registers inside of loops. + +==Pass 7: Identify where registers are assumed to be 32-bit== + +When a 64-bit register is mapped to a 32-bit register with the assumption that the value will be sign-extended before being used, it is necessary to ensure that no register contains a 64-bit value when branching to such a location. These instructions are flagged to identify them as requiring 32-bit inputs. This information is used by the linker, and the exception return (ERET) handler. + +==Pass 8: Assembly== + +This generates and outputs the recompiled code. + +Following the main code block, handlers for certain exceptions as well as alternate entry points are added. + +If a recompiled instruction relies on a certain MIPS register being cached in a certain native register, then a short 'stub' of code is generated to load the necessary registers. When an instruction outside of this block needs to jump to that location, it will instead jump to the stub. The necessary registers will be loaded, and then it will jump into the main code sequence. + +On architectures which require literal pools (ARMv5) these are inserted as necessary. + +==Linker== + +The linker fills in all unresolved branches. Branches within the block are linked to their target address. Branches which jump outside of the block are linked to their target if that address has been compiled already. These inter-block branches are recorded in the jump_out array. This information will be used to remove the links in the event that the target of the branch is invalidated. + +Unresolved branches point to a stub which loads the address of the branch instruction and the virtual address of its target into registers, and calls the dynamic linker. When this code is executed, the dynamic linker will compile the target if necessary, and then patch the branch instruction with the new address. + +==Memory manager== + +The last step in new_recompile_block is to ensure that there will be sufficient memory available to compile the next block. If there is not, then the oldest blocks are purged. + +The dynarec cache can be described as a 32MB circular buffer divided into eight segments. Memory is allocated in order from beginning to end. + +When there are less than 2 empty segments, the next segment in sequence is cleared, wrapping around to the beginning of the buffer. This continues as memory is needed, wrapping around from end to beginning. + +==Invalidation and restoration== + +Normally, code blocks are looked up via a hash table, using the virtual address of the target instruction. However, for purposes of invalidation, blocks are grouped by physical address. This can be described as a virtually-indexed, physically-tagged (VIPT) cache. + +References to compiled blocks are stored in one of 4096 linked lists in the jump_in array. Each list covers a 4K block of memory, and 2048 such lists are sufficient to cover the 8MB of RAM in the Nintendo 64. The remaining lists are for code in ROM, and the bootloader in SP memory. + +When a write hits a memory page marked as cached, all entries in the corresponding list are invalidated. If any code is found to cross a 4K boundary, the adjacent lists are invalidated also. + +Sometimes blocks may be invalidated even when none of the code is actually modified. This can happen if data is written to memory in the same 4K page, or if code is reloaded without actually modifying it. If blocks which were previously invalidated are subsequently found to be unmodified, those blocks are marked in the restore_candidate array. If the block remains unmodified, it will be restored as a valid block, to avoid recompiling blocks which do not need to be recompiled. This is performed by the clean_blocks function which is called periodically. + +The jump_in array, which lists unmodified blocks, is physically indexed, however the jump_dirty array, which lists potentially-modified blocks, is virtually indexed. This allows blocks which have changed physical addresses, but are still at the same virtual address, to be recognized as being the same as before, and not in need of recompilation. + +==Dynamic linker== + +Branches with unresolved addresses jump to the dynamic linker. This will look through the jump_in list corresponding to the physical page containing the virtual target address. If found, the branch instruction will be patched with the address, and then it will jump to this address. + +If not found, the jump_dirty list will be searched for blocks which were previously compiled but may have been modified. If a potential match is found, the code will be compared against a cached copy to determine if any changes have been made. If not, then it will jump to the block. Because the memory could be modified again, branch instructions referencing these blocks are not altered, and continue to point to the dynamic linker. These blocks will continue to be verified each time they are called, until restored to the jump_in list by the clean_blocks function described above. + +If no compiled block is found, or the existing block was modified, the target is recompiled. + +==Address lookup== + +When a JR (jump register) instruction is encountered, the address of the recompiled code must be looked up using the address of the MIPS code. The majority of such instructions jump to the link register (r31) to return to the location following a JAL (call) instruction. + +When a JAL or JALR is executed, the address of the following instruction is inserted into a small 32-entry hash table, which is checked when a JR r31 instruction is executed. This allows for a quick return from subroutine calls. + +If the JR instruction uses a register other than r31, or the small hash table lookup fails to find a match, a larger 131072-entry hash table is checked. This table contains 65536 bins with up to 2 addresses per bin. If this also fails to find a match (which occurs less than 1% of the time) an exhaustive search of all compiled addresses within that 4K memory page is performed. + +If no match is found by any of these methods, the target address is compiled, and the new address is inserted into the hash table. + +==Cycle counting== + +Cycles are counted before each branch by adding the cycles from the preceding instructions to a specific register. The cycle count is in R10 on ARM and ESI on x86. The value in this register is normally a negative number. When this number exceeds zero, a conditional branch is taken which jumps to an interrupt handler. + +For example, the following x86 code adds eight cycles: + + +add $8,%esi +jns interrupt_handler + + +The conditional branch jumps to a small bit of code located after the main compiled block, which saves the cached registers to the register file, sets the instruction pointer which will be used upon return from the interrupt, and then calls cc_interrupt. + +As in the original mupen64plus, the emulated clock runs at 37.5 MHz, and each instruction takes 2 clock cycles. + +==Interrupt handler== + +When the cycle count register reaches its limit, cc_interrupt is called, which in turn calls gen_interupt [sic]. If interrupts are not enabled, cc_interrupt returns. If interrupts are enabled, and an interrupt is to be taken, the pending_exception flag will be set. In this case, cc_interrupt does not return, and instead pops the stack and causes an unconditional jump to the address in pcaddr (usually 0x80000180). + +There is one additional case where the interrupt handler may be called. If interrupts were disabled, and are enabled by writing to coprocessor 0 register 12, any pending interrupts are handled immediately. + +==Delay slots== + +MIPS has 'delay slots', where the instruction after the branch is executed before the branch is taken. Instructions in delay slots are issued out-of-order in the recompiled code. + +[[Image:Recompiler delay slot reordering.png]] + +When a branch jumps into the delay slot of another branch, this case must be handled slightly differently: + +[[Image:Recompiler delay slot reordering 2.png]] + +The branch test and delay slot are executed in-order if a dependency exists, or for 'likely' branches where the delay slot is nullified when the branch condition is false. These cases are infrequent (typically less than 10% of branches). + +==Constant propagation== + +When an instruction loads a constant into a register, the register is tagged as a constant. The constant tag will be retained if subsequent instructions modify the constant using other constants. During assembly, such a sequence of instructions is combined into a single load. For example: + + +LUI r8,12340000 --> mov $0x12345678,%eax +ORI r8,r8,5678 + + +This optimization is not performed where a branch target intervenes, eg + + +... + LUI r8,12340000 --> mov $0x12340000,%eax +L1: + ORI r8,r8,5678 --> or $0x5678,%eax + ... + BEQ r0,r0,L1 + + +Registers containing constants are identified by bits in the isconst and wasconst fields of the regstat structure. The wasconst bit is set for a register if the register contained a known constant before the instruction, and the isconst bit is set for a register if the register will contain a known constant after the instruction executes. + +==Translation lookaside buffer emulation== + +Most Nintendo 64 games do not use virtual memory, but some do. At startup, main memory is directly mapped at addresses from 0x80000000 to 0x803FFFFF, or up to 0x807FFFFF if the memory expansion is used. + +Normally, read or write operations are checked against this range, and if outside this range, control is passed to the appropriate I/O handler. This is done as follows: + +MIPS instruction: LW r1,8(r2) + +ARM code: + +add r1, r2, #8 +cmp r1, #8388608 +bvc handler +ldr r1, [r1] + + +If there are valid entries in the TLB, this would instead be compiled as follows: + +add r1, r2, #8 +mov r0, #264 +add r0, r0, r1, lsr #12 +ldr r0, [r11, r0, lsl #2] +tst r0, r0 +bmi handler +ldr r1, [r1, r0, lsl #2] + + +This looks up the offset in the memory_map table (which, in this example, is located at r11+264*4). The high bit is tested to determine whether a valid mapping exists for this page. + +==Page fault emulation== + +If a memory address references an invalid page, a conditional branch is taken to a bit of code placed after the main block. This will save any modified cached registers, and call an appropriate handler function for the address. The handler will either perform I/O, or generate an exception (pagefault). + +==Mapping executable pages== + +If the dynamic recompiler encounters code which is not in contiguous physical memory, it will end the block at the page boundary, so that the block can be removed cleanly if the mapping is changed. + +There is a special case of this, where a branch and delay slot span two pages. If a branch instruction is the last instruction in a virtual memory page, it is compiled in a different manner than other branches. The branch condition is evaluated, and the target address is placed in a register (%ebp on x86, and r8 on ARM). A special form of the dynamic linker (dyna_linker_ds) is used to link the branch to its corresponding delay slot in another block. If no page fault occurs, the delay slot executes and then jumps to the address in the register. For conditional branches that are not taken, the target address is the next instruction. This code is generated by the pagespan_assemble function. + +== Self-modifying code detection == + +Pages not containing code which has been compiled or where the code may have been modified since compilation are marked in the invalid_code array. Writes are checked against this array, and if a write hits a valid (compiled and unmodified) page, invalidate_block is called: + +MIPS instruction: SW r1,8(r2) + +ARM code: + +ldr r3, [r11, #88] // pointer to invalid_code +add r4, r2, #8 +cmp r4, #8388608 +bvc handler +str r1, [r4] +ldrb r14, [r3, r4 lsr #12] +cmp r14, #1 +bne invstub + + +In TLB mode, the invalid_code array is not checked directly. Instead, pages are marked non-writable in memory_map. + +== Long jumps == + +Branch instructions are limited to a +/-32MB range on ARM. In some cases, the dynamic recompiler needs to generate calls to locations beyond this range. This is accomplished via a jump table located at the end of the code generation area, and the full address is loaded via a pointer. The jump table is generated in arch_init(). + +As these indirect jumps cause some delay, it is best to avoid this situation if possible, by locating this area close to the other executable code. + +== Compile options == + +=== ARMv5_ONLY === + +If this is defined, the UXTH instruction is not used, and the dynamic recompiler will generate literal pools instead of using movw/movt. This provides compatibility with older processors, but generates somewhat less efficient code. + +=== RAM_OFFSET === + +When compiling for ARM, this allocates an additional register which is used to add an offset to all pointers to memory addresses between 0x80000000 and 0x807FFFFF. This allows the N64's memory to be mapped at an alternate address. This incurs a small performance penalty, but is required for certain operating systems (eg Google Android, which places shared libraries at 0x80000000). + +This option is not used for x86. The x86 instruction set allows for a full 32-bit offset in the instruction encoding, making it unnecessary to allocate an additional register for this purpose. + +=== CORTEX_A8_BRANCH_PREDICTION_HACK === + +If this is defined, the dynamic recompiler will avoid generating consecutive branch instructions without another instruction in between. This avoids a possible branch misprediction on the Cortex-A8 due to this processor having dual instruction decoders, but only one branch-prediction unit. See [[Assembly Code Optimization]] for details. + +=== USE_MINI_HT === + +If this is defined, attempt to look up return addresses in a small hash table before checking the larger hash table. Usually improves performance. + +=== IMM_PREFETCH === + +If this is defined, the x86 PREFETCH instruction is used to prefetch entries from the hash table. The increase in code size often outweighs the benefit of this. + +=== REG_PREFETCH === + +Similar to the above, but loads the address into a register first, then uses the ARM PLD instruction. The increase in code size almost always outweighs the benefit of this. + +=== R29_HACK === + +Assume that the stack pointer (r29) is always a valid memory address and do not check it. It is similar to the optimization described [http://strmnnrmn.blogspot.com/2007/08/interesting-dynarec-hack.html here]. This can crash the emulator and is not enabled by default. + +== Debugging == + +Debugging information can be obtained by defining the assem_debug macro as printf. This will cause the dynamic recompiler to print debugging information to stdout. For each disassembled MIPS instruction, an entry similar to the following will be printed: + + +U: r1 r8 r11 r16 r31 UU: r29 32: r0 r9 +pre: eax=-1 ecx=9 edx=-1 ebx=-1 ebp=29 esi=36 edi=-1 +needs: ecx ebp esi r: r9 +entry: eax=-1 ecx=9 edx=-1 ebx=-1 ebp=29 esi=36 edi=-1 +dirty: ecx ebp esi + 800001d8: LW r16,r29+14 +eax=16 ecx=9 edx=-1 ebx=-1 ebp=29 esi=36 edi=-1 dirty: eax ecx ebp esi + 32: r0 r9 r16 + + +U: A list of MIPS registers which will not be used before they are overwritten (liveness analysis) + +UU: A list of MIPS registers for which the upper 32 bits will not be used before they are overwritten + +32: Registers that contain 32-bit sign-extended values + +pre: The state of the register mapping prior to execution of this instruction. (-1 = no mapping; 36 = cycle count; The complete list of values with special meanings can be found in the source code) + +needs: a list of register mappings that were considered necessary and which could not be eliminated to make room for other mappings + +r: Registers that are known to contain 32-bit values and where optimizations rely on the assumption that the register does not contain a value outside of the range -231 to 231-1 + +entry: The minimum set of register mappings required to jump to this point + +dirty: Cached registers that have been modified and will need to be written back + +address: instruction - The decoded opcode, followed by the register mapping in effect after this instruction executes + +An asterisk (*) designates locations which are the target of a branch instruction. Constant propagation will not be performed across these points. + +After the complete disassembly, the recompiled native code is shown. + +Note that the output can be quite voluminous; 20-30 MB is typical. + +==Potential improvements== + +===Copy propagation/offset propagation=== + +A common instruction sequence is of the form: + + +LUI r9,12340000 +ADD r9,r9,r8 +LW r9,5678(r9) + + +It would be helpful to recognize this as a load from r8+12345678. The current constant propagation code does not do so. + +===Constant propagation and register assignment=== + +Constant propagation is currently done after register assignment. Registers are assigned even if the register will always contain a known value. In certain cases, such as where the constant is used only to generate a memory address, this could be avoided and no register would need to be allocated. + +===Unaligned memory access=== + +A small improvement could be made by combining adjacent LWL/LWR instructions. The potential gain from doing so is very limited because these instructions typically represent less than 1% of all memory accesses. + +===SLT/branch merging=== + +A frequent occurrence in MIPS code is an SLT or SLTI instruction followed by a branch. This is generated relatively inefficiently on x86 and ARM, first doing a compare and set, then testing this value and doing a conditional branch. Doing only one comparison would save at least one instruction, and could potentially save up to three instructions if the liveness analysis reveals that the result of the SLT instruction is used nowhere else. + +While a potentially useful optimization, there are several problems with this approach. First, there are often additional instructions between the slt and the branch. These must be checked to make sure they do not modify the registers as that would prevent reordering the instruction stream as desired. Secondly, if the result of the slt is found to be live, but unmodified, on both paths of the branch, clean_registers will normally write this value before the branch, to avoid duplicating the writeback code on both paths of the branch. This optimization would have to be removed if the slt was combined with the branch. + +===x86-64=== + +Currently the x86-64 backend generates only 32-bit instructions. Proper 64-bit code generation would improve performance. + +===PowerPC=== + +It would be possible to add a PowerPC code generator to the dynamic recompiler. Currently no one is working on this. (The mupen64gc project is using a different codebase.) + +The following is a summary of the changes which would be necessary to add a PowerPC backend. + +The slt* instructions use conditional moves, which are unavailable on PowerPC. A suitable alternative (such as moves from the condition register) would need to be used. + +The assembler can generate as much as 256K of code in a single block, however conditional branches on PowerPC are limited to +/-64K. It will be necessary to either restrict the block size, or insert jump tables in a manner similar to the literal pools on ARM. + +PowerPC generally relies on early branch resolution rather than statistical branch prediction. Scheduling branch condition tests earlier may be advantageous. (For example, the address bounds check could be done in address_generation, rather than just before the load or store. Similarly it may be advantageous to test the branch condition and update the cycle count before executing the delay slot.) + +===MIPS=== + +Recompiling MIPS into MIPS would be relatively straightforward, however the current code generator has no facility for filling delay slots. This capability would be required for efficient code generation. + +[[Category:Emulators]] +[[Category:Optimization]] +[[Category:Development]] diff --git a/libmupen64plus/mupen64plus-core/projects/msvc11/mupen64plus-core.vcxproj b/libmupen64plus/mupen64plus-core/projects/msvc11/mupen64plus-core.vcxproj new file mode 100644 index 0000000000..cd14133805 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/projects/msvc11/mupen64plus-core.vcxproj @@ -0,0 +1,226 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {92D3FEB9-2129-41C5-8577-BCD7D961EF41} + mupen64pluscore + Win32Proj + + + + DynamicLibrary + MultiByte + true + + + DynamicLibrary + MultiByte + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + true + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\..\src;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.3\include;..\..\..\mupen64plus-win32-deps\libpng-1.2.37\include;..\..\..\mupen64plus-win32-deps\freetype-2.3.5-1\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;DYNAREC;inline=__inline;M64P_OSD;M64P_PARALLEL;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + Default + + + shell32.lib;opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\lib\SDL.lib;..\..\..\mupen64plus-win32-deps\zlib-1.2.3\lib\zlib.lib;..\..\..\mupen64plus-win32-deps\libpng-1.2.37\lib\libpng.lib;..\..\..\mupen64plus-win32-deps\freetype-2.3.5-1\lib\freetype.lib;%(AdditionalDependencies) + $(OutDir)mupen64plus.dll + true + Windows + MachineX86 + + + + + ..\..\src;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.3\include;..\..\..\mupen64plus-win32-deps\libpng-1.2.37\include;..\..\..\mupen64plus-win32-deps\freetype-2.3.5-1\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;DYNAREC;inline=__inline;M64P_OSD;M64P_PARALLEL;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + Default + + + shell32.lib;opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\lib\SDL.lib;..\..\..\mupen64plus-win32-deps\zlib-1.2.3\lib\zlib.lib;..\..\..\mupen64plus-win32-deps\libpng-1.2.37\lib\libpng.lib;..\..\..\mupen64plus-win32-deps\freetype-2.3.5-1\lib\freetype.lib;%(AdditionalDependencies) + $(OutDir)mupen64plus.dll + true + Windows + true + true + MachineX86 + + + + + + + + + + + + + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libmupen64plus/mupen64plus-core/projects/msvc8/mupen64plus-core.vcproj b/libmupen64plus/mupen64plus-core/projects/msvc8/mupen64plus-core.vcproj new file mode 100644 index 0000000000..d08b8bd455 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/projects/msvc8/mupen64plus-core.vcproj @@ -0,0 +1,685 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libmupen64plus/mupen64plus-core/projects/unix/Makefile b/libmupen64plus/mupen64plus-core/projects/unix/Makefile new file mode 100644 index 0000000000..8078be37c2 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/projects/unix/Makefile @@ -0,0 +1,573 @@ +#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# * Mupen64plus - Makefile * +# * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * +# * Copyright (C) 2008-2009 Richard Goedeken * +# * Copyright (C) 2007-2008 DarkJeztr Tillin9 * +# * * +# * 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. * +# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +# Makefile for Mupen64Plus Core + +# detect operating system +UNAME ?= $(shell uname -s) +OS := NONE +ifeq ("$(UNAME)","Linux") + OS = LINUX +endif +ifeq ("$(UNAME)","linux") + OS = LINUX +endif +ifneq ("$(filter GNU hurd,$(UNAME))","") + OS = LINUX +endif +ifeq ("$(UNAME)","Darwin") + OS = OSX +endif +ifeq ("$(UNAME)","FreeBSD") + OS = FREEBSD +endif +ifeq ("$(UNAME)","OpenBSD") + OS = FREEBSD + CFLAGS += -DIOAPI_NO_64 + $(warning OS type "$(UNAME)" not officially supported.') +endif +ifneq ("$(filter GNU/kFreeBSD kfreebsd,$(UNAME))","") + OS = LINUX +endif +ifeq ("$(patsubst MINGW%,MINGW,$(UNAME))","MINGW") + OS = MINGW + PIC = 0 +endif +ifeq ("$(OS)","NONE") + $(error OS type "$(UNAME)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') +endif + +# detect system architecture +HOST_CPU ?= $(shell uname -m) +CPU := NONE +ifneq ("$(filter x86_64 amd64,$(HOST_CPU))","") + CPU := X86 + ifeq ("$(BITS)", "32") + ARCH_DETECTED := 64BITS_32 + PIC ?= 0 + else + ARCH_DETECTED := 64BITS + PIC ?= 1 + endif +endif +ifneq ("$(filter pentium i%86,$(HOST_CPU))","") + CPU := X86 + ARCH_DETECTED := 32BITS + PIC ?= 0 +endif +ifneq ("$(filter ppc macppc socppc powerpc,$(HOST_CPU))","") + CPU := PPC + ARCH_DETECTED := 32BITS + BIG_ENDIAN := 1 + PIC ?= 1 + NO_ASM := 1 + $(warning Architecture "$(HOST_CPU)" not officially supported.') +endif +ifneq ("$(filter ppc64 powerpc64,$(HOST_CPU))","") + CPU := PPC + ARCH_DETECTED := 64BITS + BIG_ENDIAN := 1 + PIC ?= 1 + NO_ASM := 1 + $(warning Architecture "$(HOST_CPU)" not officially supported.') +endif +ifneq ("$(filter arm%,$(HOST_CPU))","") + ifeq ("$(filter arm%b,$(HOST_CPU))","") + CPU := ARM + ARCH_DETECTED := 32BITS + PIC ?= 1 + NEW_DYNAREC := 1 + CFLAGS += -mfpu=vfp -mfloat-abi=softfp + $(warning Architecture "$(HOST_CPU)" not officially supported.') + endif +endif +ifeq ("$(CPU)","NONE") + $(error CPU type "$(HOST_CPU)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') +endif + +# base CFLAGS, LDLIBS, and LDFLAGS +OPTFLAGS ?= -O3 +WARNFLAGS ?= -Wall +CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src -DM64P_PARALLEL +CXXFLAGS += -fvisibility-inlines-hidden +LDLIBS += -lm + +# default configuration programs +SDL_CONFIG = $(CROSS_COMPILE)sdl-config +PKG_CONFIG = $(CROSS_COMPILE)pkg-config + +# Since we are building a shared library, we must compile with -fPIC on some architectures +# On 32-bit x86 systems we do not want to use -fPIC because we don't have to and it has a big performance penalty on this arch +ifeq ($(PIC), 1) + CFLAGS += -fPIC + LDFLAGS += -fPIC +else + CFLAGS += -fno-PIC + LDFLAGS += -fno-PIC +endif + +ifeq ($(BIG_ENDIAN), 1) + CFLAGS += -DM64P_BIG_ENDIAN +endif + +# tweak flags for 32-bit build on 64-bit system +ifeq ($(ARCH_DETECTED), 64BITS_32) + ifeq ($(OS), FREEBSD) + $(error Do not use the BITS=32 option with FreeBSD, use -m32 and -m elf_i386) + endif + CFLAGS += -m32 + LDFLAGS += -m32 -Wl,-m,elf_i386 +endif + +# set special flags per-system +ifeq ($(OS), FREEBSD) + TARGET = libmupen64plus$(POSTFIX).so.2.0.0 + SONAME = libmupen64plus$(POSTFIX).so.2 + LDFLAGS += -Wl,-Bsymbolic -shared -Wl,-export-dynamic -Wl,-soname,$(SONAME) + LDLIBS += -L${LOCALBASE}/lib -lc +endif +ifeq ($(OS), LINUX) + TARGET = libmupen64plus$(POSTFIX).so.2.0.0 + SONAME = libmupen64plus$(POSTFIX).so.2 + LDFLAGS += -Wl,-Bsymbolic -shared -Wl,-export-dynamic -Wl,-soname,$(SONAME) + LDLIBS += -ldl + # only export api symbols + LDFLAGS += -Wl,-version-script,$(SRCDIR)/api/api_export.ver +endif +ifeq ($(OS), OSX) + # Select the proper SDK + # Also, SDKs are stored in a different location since XCode 4.3 + OSX_SDK ?= $(shell sw_vers -productVersion | cut -f1 -f2 -d .) + OSX_XCODEMAJ = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f1 -d .) + OSX_XCODEMIN = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f2 -d .) + OSX_XCODEGE43 = $(shell echo "`expr $(OSX_XCODEMAJ) \>= 4``expr $(OSX_XCODEMIN) \>= 3`") + ifeq ($(OSX_XCODEGE43), 11) + OSX_SYSROOT := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs + else + OSX_SYSROOT := /Developer/SDKs + endif + + TARGET = libmupen64plus$(POSTFIX).dylib + LDFLAGS += -bundle -read_only_relocs suppress + LDLIBS += -ldl + ifeq ($(CPU), X86) + ifeq ($(ARCH_DETECTED), 64BITS) + CFLAGS += -pipe -arch x86_64 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk + LDFLAGS += -arch x86_64 + else + CFLAGS += -pipe -mmmx -msse -arch i686 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk + LDFLAGS += -arch i686 + ifneq ($(PROFILE), 1) + CFLAGS += -fomit-frame-pointer + endif + endif + endif +endif +ifeq ($(OS), MINGW) + TARGET = mupen64plus$(POSTFIX).dll + LDFLAGS += -Wl,-Bsymbolic -shared -Wl,-export-all-symbols + # only export api symbols + LDFLAGS += -Wl,-version-script,$(SRCDIR)/api/api_export.ver + LDLIBS += -lpthread +endif + +ifeq ($(CPU_ENDIANNESS), BIG) + CFLAGS += -DM64P_BIG_ENDIAN +endif + +# disable verbose output +ifneq ($(findstring $(MAKEFLAGS),s),s) +ifndef V + Q_CC = @echo ' CC '$@; + Q_CXX = @echo ' CXX '$@; + Q_LD = @echo ' LD '$@; +endif +endif + +# test for essential build dependencies +ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null),) + $(error $(PKG_CONFIG) not found) +endif +ifeq ($(shell $(PKG_CONFIG) --modversion libpng 2>/dev/null),) + $(error No libpng development libraries found!) +endif +ifeq ($(OS), OSX) # use system zlib on OSX + LDLIBS += -lz +else + ifeq ($(shell $(PKG_CONFIG) --modversion zlib 2>/dev/null),) + $(error No zlib development libraries found!) + endif + CFLAGS += $(shell $(PKG_CONFIG) --cflags zlib) + LDLIBS += $(shell $(PKG_CONFIG) --libs zlib) +endif + +CFLAGS += $(shell $(PKG_CONFIG) --cflags libpng) +LDLIBS += $(shell $(PKG_CONFIG) --libs libpng) + +# test for presence of SDL +ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),) + $(error No SDL development libraries found!) +endif +CFLAGS += $(shell $(SDL_CONFIG) --cflags) +LDLIBS += $(shell $(SDL_CONFIG) --libs) + +OSD ?= 1 +ifeq ($(OSD), 1) + CFLAGS += -DM64P_OSD + ifeq ($(shell $(PKG_CONFIG) --modversion freetype2 2>/dev/null),) + $(error No FreeType 2 development libraries found!) + endif + + # search for OpenGL libraries + GL_LIBS= + ifeq ($(OS), OSX) + GL_LIBS = -framework OpenGL + endif + ifeq ($(OS), MINGW) + GL_LIBS = -lopengl32 -lglu32 + endif + ifeq ("$(GL_LIBS)", "") + ifeq ($(shell $(PKG_CONFIG) --modversion gl 2>/dev/null),) + $(error No OpenGL development libraries found!) + endif + ifeq ($(shell $(PKG_CONFIG) --modversion glu 2>/dev/null),) + $(error No OpenGL utility development libraries found!) + endif + CFLAGS += $(shell $(PKG_CONFIG) --cflags gl glu) + GL_LIBS = $(shell $(PKG_CONFIG) --libs gl glu) + endif + + CFLAGS += $(shell $(PKG_CONFIG) --cflags freetype2) + LDLIBS += $(shell $(PKG_CONFIG) --libs freetype2) $(GL_LIBS) +endif + +# set base program pointers and flags +CC = $(CROSS_COMPILE)gcc +CXX = $(CROSS_COMPILE)g++ +RM ?= rm -f +INSTALL ?= install +MKDIR ?= mkdir -p +COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c +COMPILE.cc = $(Q_CXX)$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c +LINK.o = $(Q_LD)$(CXX) $(LDFLAGS) $(TARGET_ARCH) + +ifeq ($(OS),OSX) + LDCONFIG ?= true # no 'ldconfig' under OSX +else + ifeq ($(OS),LINUX) + LDCONFIG ?= PATH="$$PATH:/sbin" ldconfig -n + endif + ifeq ($(OS),FREEBSD) + LDCONFIG ?= PATH="$$PATH:/sbin" ldconfig -m + endif +endif + +# compiler/linker flags for various compile-time options. +# 1. macro for no assembly language +ifeq ($(NO_ASM), 1) + CFLAGS += -DNO_ASM +endif +# 2. variables for profiling and adding debugging symbols +ifeq ($(PROFILE), 1) + CFLAGS += -pg -g + LDFLAGS += -pg + INSTALL_STRIP_FLAG ?= +else + ifeq ($(DEBUG), 1) + CFLAGS += -g + INSTALL_STRIP_FLAG ?= + else + ifneq ($(OS),OSX) + INSTALL_STRIP_FLAG ?= -s + endif + endif +endif +# 3. other options given to the makefile on the command line +ifeq ($(LIRC), 1) + CFLAGS += -DWITH_LIRC +endif +ifeq ($(DEBUGGER), 1) + CFLAGS += -DDBG +endif +ifeq ($(DBG_COMPARE), 1) + CFLAGS += -DCOMPARE_CORE +endif +ifeq ($(DBG_CORE), 1) + CFLAGS += -DCORE_DBG +endif +ifeq ($(DBG_COUNT), 1) + CFLAGS += -DCOUNT_INSTR +endif +ifeq ($(DBG_TIMING), 1) + CFLAGS += -DPROFILE + LDFLAGS += -lrt +endif +ifeq ($(DBG_PROFILE), 1) + CFLAGS += -DPROFILE_R4300 +endif +# 4. compile-time directory paths for building into the library +ifneq ($(SHAREDIR),) + CFLAGS += -DSHAREDIR="$(SHAREDIR)" +endif + +# set installation options +ifeq ($(PREFIX),) + PREFIX := /usr/local +endif +ifeq ($(SHAREDIR),) + SHAREDIR := $(PREFIX)/share/mupen64plus +endif +ifeq ($(LIBDIR),) + LIBDIR := $(PREFIX)/lib +endif +ifeq ($(INCDIR),) + INCDIR := $(PREFIX)/include/mupen64plus +endif + +SRCDIR = ../../src +OBJDIR = _obj$(POSTFIX) + +# list of required source files for compilation +SOURCE = \ + $(SRCDIR)/api/callbacks.c \ + $(SRCDIR)/api/common.c \ + $(SRCDIR)/api/config.c \ + $(SRCDIR)/api/debugger.c \ + $(SRCDIR)/api/frontend.c \ + $(SRCDIR)/api/vidext.c \ + $(SRCDIR)/main/main.c \ + $(SRCDIR)/main/util.c \ + $(SRCDIR)/main/cheat.c \ + $(SRCDIR)/main/eventloop.c \ + $(SRCDIR)/main/md5.c \ + $(SRCDIR)/main/rom.c \ + $(SRCDIR)/main/savestates.c \ + $(SRCDIR)/main/workqueue.c \ + $(SRCDIR)/memory/dma.c \ + $(SRCDIR)/memory/flashram.c \ + $(SRCDIR)/memory/memory.c \ + $(SRCDIR)/memory/n64_cic_nus_6105.c \ + $(SRCDIR)/memory/pif.c \ + $(SRCDIR)/memory/tlb.c \ + $(SRCDIR)/plugin/plugin.c \ + $(SRCDIR)/plugin/dummy_video.c \ + $(SRCDIR)/plugin/dummy_audio.c \ + $(SRCDIR)/plugin/dummy_input.c \ + $(SRCDIR)/plugin/dummy_rsp.c \ + $(SRCDIR)/r4300/r4300.c \ + $(SRCDIR)/r4300/exception.c \ + $(SRCDIR)/r4300/interupt.c \ + $(SRCDIR)/r4300/profile.c \ + $(SRCDIR)/r4300/pure_interp.c \ + $(SRCDIR)/r4300/recomp.c \ + $(SRCDIR)/r4300/reset.c \ + $(SRCDIR)/osd/screenshot.cpp +ifeq ("$(OS)","MINGW") +SOURCE += \ + $(SRCDIR)/osal/dynamiclib_win32.c \ + $(SRCDIR)/osal/files_win32.c +else +SOURCE += \ + $(SRCDIR)/osal/dynamiclib_unix.c \ + $(SRCDIR)/osal/files_unix.c +endif + +ifeq ($(OSD), 1) +SOURCE += \ + $(SRCDIR)/osd/OGLFT.cpp \ + $(SRCDIR)/osd/osd.cpp +endif + +# source files for optional features +ifneq ($(NO_ASM), 1) + ifeq ($(CPU), X86) + ifeq ($(ARCH_DETECTED), 64BITS) + DYNAREC = x86_64 + else + DYNAREC = x86 + endif + endif + ifeq ($(CPU), ARM) + ifeq ($(ARCH_DETECTED), 32BITS) + DYNAREC = arm + endif + endif +endif +ifneq ($(DYNAREC), ) + CFLAGS += -DDYNAREC + + ifeq ($(NEW_DYNAREC), 1) + ifeq ($(DYNAREC), x86) + CFLAGS += -DNEW_DYNAREC=1 + else + ifeq ($(DYNAREC), arm) + CFLAGS += -DNEW_DYNAREC=3 + else + $(error NEW_DYNAREC is only supported on 32 bit x86 and 32 bit armel) + endif + endif + + SOURCE += \ + $(SRCDIR)/r4300/empty_dynarec.c \ + $(SRCDIR)/r4300/new_dynarec/linkage_$(DYNAREC).S \ + $(SRCDIR)/r4300/new_dynarec/new_dynarec.c + else + SOURCE += \ + $(SRCDIR)/r4300/$(DYNAREC)/assemble.c \ + $(SRCDIR)/r4300/$(DYNAREC)/gbc.c \ + $(SRCDIR)/r4300/$(DYNAREC)/gcop0.c \ + $(SRCDIR)/r4300/$(DYNAREC)/gcop1.c \ + $(SRCDIR)/r4300/$(DYNAREC)/gcop1_d.c \ + $(SRCDIR)/r4300/$(DYNAREC)/gcop1_l.c \ + $(SRCDIR)/r4300/$(DYNAREC)/gcop1_s.c \ + $(SRCDIR)/r4300/$(DYNAREC)/gcop1_w.c \ + $(SRCDIR)/r4300/$(DYNAREC)/gr4300.c \ + $(SRCDIR)/r4300/$(DYNAREC)/gregimm.c \ + $(SRCDIR)/r4300/$(DYNAREC)/gspecial.c \ + $(SRCDIR)/r4300/$(DYNAREC)/gtlb.c \ + $(SRCDIR)/r4300/$(DYNAREC)/regcache.c \ + $(SRCDIR)/r4300/$(DYNAREC)/rjump.c + endif +else + SOURCE += $(SRCDIR)/r4300/empty_dynarec.c +endif + +ifeq ($(LIRC), 1) + SOURCE += $(SRCDIR)/main/lirc.c + LDLIBS += -llirc_client +endif + +ifeq ($(shell $(PKG_CONFIG) --modversion minizip 2>/dev/null),) + SOURCE += \ + $(SRCDIR)/main/zip/ioapi.c \ + $(SRCDIR)/main/zip/zip.c \ + $(SRCDIR)/main/zip/unzip.c + + CFLAGS += -DNOCRYPT -DNOUNCRYPT +else + CFLAGS += $(shell $(PKG_CONFIG) --cflags minizip) -DLIBMINIZIP + LDLIBS += $(shell $(PKG_CONFIG) --libs minizip) +endif + + +ifeq ($(DEBUGGER), 1) + SOURCE += \ + $(SRCDIR)/debugger/debugger.c \ + $(SRCDIR)/debugger/dbg_decoder.c \ + $(SRCDIR)/debugger/dbg_memory.c \ + $(SRCDIR)/debugger/dbg_breakpoints.c + LDLIBS += -lopcodes -lbfd +endif + +# generate a list of object files to build, make a temporary directory for them +OBJECTS := $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(filter %.c, $(SOURCE))) +OBJECTS += $(patsubst $(SRCDIR)/%.cpp, $(OBJDIR)/%.o, $(filter %.cpp, $(SOURCE))) +OBJECTS += $(patsubst $(SRCDIR)/%.S, $(OBJDIR)/%.o, $(filter %.S, $(SOURCE))) +OBJDIRS = $(dir $(OBJECTS)) +$(shell $(MKDIR) $(OBJDIRS)) + +# build targets +targets: + @echo "Mupen64Plus-core makefile. " + @echo " Targets:" + @echo " all == Build Mupen64Plus core library" + @echo " clean == remove object files" + @echo " install == Install Mupen64Plus core library" + @echo " uninstall == Uninstall Mupen64Plus core library" + @echo " Build Options:" + @echo " BITS=32 == build 32-bit binaries on 64-bit machine" + @echo " LIRC=1 == enable LIRC support" + @echo " NO_ASM=1 == build without assembly (no dynamic recompiler or MMX/SSE code)" + @echo " SHAREDIR=path == extra path to search for shared data files" + @echo " OPTFLAGS=flag == compiler optimization (default: -O3)" + @echo " WARNFLAGS=flag == compiler warning levels (default: -Wall)" + @echo " PIC=(1|0) == Force enable/disable of position independent code" + @echo " OSD=(1|0) == Enable/disable build of OpenGL On-screen display" + @echo " NEW_DYNAREC=1 == Replace dynamic recompiler with Ari64's experimental dynarec" + @echo " POSTFIX=name == String added to the name of the the build (default: '')" + @echo " Install Options:" + @echo " PREFIX=path == install/uninstall prefix (default: /usr/local/)" + @echo " SHAREDIR=path == path to install shared data files (default: PREFIX/share/mupen64plus)" + @echo " LIBDIR=path == path to install core library (default: PREFIX/lib)" + @echo " INCDIR=path == path to install core header files (default: PREFIX/include/mupen64plus)" + @echo " DESTDIR=path == path to prepend to all installation paths (only for packagers)" + @echo " Debugging Options:" + @echo " PROFILE=1 == build gprof instrumentation into binaries for profiling" + @echo " DEBUG=1 == add debugging symbols to binaries" + @echo " DEBUGGER=1 == build debugger API into core for front-ends. runs slower." + @echo " DBG_CORE=1 == print debugging info in r4300 core" + @echo " DBG_COUNT=1 == print R4300 instruction count totals (64-bit dynarec only)" + @echo " DBG_COMPARE=1 == enable core-synchronized r4300 debugging" + @echo " DBG_TIMING=1 == print timing data" + @echo " DBG_PROFILE=1 == dump profiling data for r4300 dynarec to data file" + @echo " LTO=1 == enable experimental build with link-time optimization" + @echo " V=1 == show verbose compiler output" + +all: $(TARGET) + +install: $(TARGET) + $(INSTALL) -d "$(DESTDIR)$(LIBDIR)" + $(INSTALL) -m 0644 $(INSTALL_STRIP_FLAG) $(TARGET) "$(DESTDIR)$(LIBDIR)" + $(INSTALL) -d "$(DESTDIR)$(SHAREDIR)" + $(INSTALL) -m 0644 ../../data/* "$(DESTDIR)$(SHAREDIR)" + $(INSTALL) -d "$(DESTDIR)$(INCDIR)" + $(INSTALL) -m 0644 ../../src/api/m64p_*.h "$(DESTDIR)$(INCDIR)" + -$(LDCONFIG) "$(DESTDIR)$(LIBDIR)" + if [ ! -e "$(DESTDIR)$(LIBDIR)/$(SONAME)" ]; then ln -sf "$(TARGET)" "$(DESTDIR)$(LIBDIR)/$(SONAME)"; fi + +uninstall: + $(RM) "$(DESTDIR)$(LIBDIR)/$(TARGET)" + if [ "$(SONAME)" != "" ]; then $(RM) "$(DESTDIR)$(LIBDIR)/$(SONAME)"; fi + $(RM) $(DESTDIR)$(INCDIR)/m64p_*.h + $(RM) "$(DESTDIR)$(SHAREDIR)/mupen64plus.cht" + $(RM) "$(DESTDIR)$(SHAREDIR)/mupen64plus.ini" + $(RM) "$(DESTDIR)$(SHAREDIR)/font.ttf" + $(RM) "$(DESTDIR)$(SHAREDIR)/mupencheat.txt" + +clean: + $(RM) -r $(TARGET) $(SONAME) $(OBJDIR) + +# build dependency files +CFLAGS += -MD +-include $(OBJECTS:.o=.d) + +CXXFLAGS += $(CFLAGS) +ifeq ($(LTO), 1) + CFLAGS += -flto + CXXFLAGS += -flto + LDFLAGS += -fuse-linker-plugin $(CXXFLAGS) +endif + +# standard build rules +$(OBJDIR)/%.o: $(SRCDIR)/%.S + $(COMPILE.c) -o $@ $< + +$(OBJDIR)/%.o: $(SRCDIR)/%.c + $(COMPILE.c) -o $@ $< + +$(OBJDIR)/%.o: $(SRCDIR)/%.cpp + $(COMPILE.cc) -o $@ $< + +$(TARGET): $(OBJECTS) + $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@ + if [ "$(SONAME)" != "" ]; then ln -sf $@ $(SONAME); fi + +.PHONY: all clean install uninstall targets diff --git a/libmupen64plus/mupen64plus-core/src/api/api_export.ver b/libmupen64plus/mupen64plus-core/src/api/api_export.ver new file mode 100644 index 0000000000..1a7664e009 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/api/api_export.ver @@ -0,0 +1,68 @@ +{ global: +ConfigDeleteSection; +ConfigGetParamBool; +ConfigGetParameter; +ConfigGetParameterHelp; +ConfigGetParameterType; +ConfigGetParamFloat; +ConfigGetParamInt; +ConfigGetParamString; +ConfigGetSharedDataFilepath; +ConfigGetUserCachePath; +ConfigGetUserConfigPath; +ConfigGetUserDataPath; +ConfigHasUnsavedChanges; +ConfigListParameters; +ConfigListSections; +ConfigOpenSection; +ConfigRevertChanges; +ConfigSaveFile; +ConfigSaveSection; +ConfigSetDefaultBool; +ConfigSetDefaultFloat; +ConfigSetDefaultInt; +ConfigSetDefaultString; +ConfigSetParameter; +CoreAddCheat; +CoreAttachPlugin; +CoreCheatEnabled; +CoreDetachPlugin; +CoreDoCommand; +CoreErrorMessage; +CoreGetAPIVersions; +CoreGetRomSettings; +CoreOverrideVidExt; +CoreShutdown; +CoreStartup; +DebugBreakpointCommand; +DebugBreakpointLookup; +DebugDecodeOp; +DebugGetCPUDataPtr; +DebugGetState; +DebugMemGetMemInfo; +DebugMemGetPointer; +DebugMemGetRecompInfo; +DebugMemRead16; +DebugMemRead32; +DebugMemRead64; +DebugMemRead8; +DebugMemWrite16; +DebugMemWrite32; +DebugMemWrite64; +DebugMemWrite8; +DebugSetCallbacks; +DebugSetCoreCompare; +DebugSetRunState; +DebugStep; +PluginGetVersion; +VidExt_GL_GetProcAddress; +VidExt_GL_SetAttribute; +VidExt_GL_GetAttribute; +VidExt_GL_SwapBuffers; +VidExt_Init; +VidExt_ListFullscreenModes; +VidExt_Quit; +VidExt_SetCaption; +VidExt_SetVideoMode; +VidExt_ToggleFullScreen; +local: *; }; diff --git a/libmupen64plus/mupen64plus-core/src/api/callbacks.c b/libmupen64plus/mupen64plus-core/src/api/callbacks.c new file mode 100644 index 0000000000..b15ad63230 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/api/callbacks.c @@ -0,0 +1,78 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - api/callbacks.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This file contains the Core functions for handling callbacks to the + * front-end application + */ + +#include +#include +#include + +#include "m64p_types.h" +#include "callbacks.h" + +/* local variables */ +static ptr_DebugCallback pDebugFunc = NULL; +static ptr_StateCallback pStateFunc = NULL; +static void * DebugContext = NULL; +static void * StateContext = NULL; + +/* global Functions for use by the Core */ +m64p_error SetDebugCallback(ptr_DebugCallback pFunc, void *Context) +{ + pDebugFunc = pFunc; + DebugContext = Context; + return M64ERR_SUCCESS; +} + +m64p_error SetStateCallback(ptr_StateCallback pFunc, void *Context) +{ + pStateFunc = pFunc; + StateContext = Context; + return M64ERR_SUCCESS; +} + +void DebugMessage(int level, const char *message, ...) +{ + char msgbuf[256]; + va_list args; + + if (pDebugFunc == NULL) + return; + + va_start(args, message); + vsprintf(msgbuf, message, args); + + (*pDebugFunc)(DebugContext, level, msgbuf); + + va_end(args); +} + +void StateChanged(m64p_core_param param_type, int new_value) +{ + if (pStateFunc == NULL) + return; + + (*pStateFunc)(StateContext, param_type, new_value); +} + + diff --git a/libmupen64plus/mupen64plus-core/src/api/callbacks.h b/libmupen64plus/mupen64plus-core/src/api/callbacks.h new file mode 100644 index 0000000000..50b67a661b --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/api/callbacks.h @@ -0,0 +1,39 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - api/callbacks.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This file contains the definitions for callback functions which will be + * called from the other Core modules + */ + +#if !defined(API_CALLBACKS_H) +#define API_CALLBACKS_H + +#include "m64p_types.h" +#include "m64p_frontend.h" + +/* Functions for use by the Core, to send information back to the front-end app */ +extern m64p_error SetDebugCallback(ptr_DebugCallback pFunc, void *Context); +extern m64p_error SetStateCallback(ptr_StateCallback pFunc, void *Context); +extern void DebugMessage(int level, const char *message, ...); +extern void StateChanged(m64p_core_param param_type, int new_value); + +#endif /* API_CALLBACKS_H */ + diff --git a/libmupen64plus/mupen64plus-core/src/api/common.c b/libmupen64plus/mupen64plus-core/src/api/common.c new file mode 100644 index 0000000000..492c089a41 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/api/common.c @@ -0,0 +1,109 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - api/common.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This file contains the Core common functions which will be exported + * outside of the core library. + */ + +#include + +#define M64P_CORE_PROTOTYPES 1 +#include "m64p_types.h" +#include "m64p_common.h" +#include "../main/version.h" + +EXPORT m64p_error CALL PluginGetVersion(m64p_plugin_type *PluginType, int *PluginVersion, int *APIVersion, const char **PluginNamePtr, int *Capabilities) +{ + /* set version info */ + if (PluginType != NULL) + *PluginType = M64PLUGIN_CORE; + + if (PluginVersion != NULL) + *PluginVersion = MUPEN_CORE_VERSION; + + if (APIVersion != NULL) + *APIVersion = FRONTEND_API_VERSION; + + if (PluginNamePtr != NULL) + *PluginNamePtr = MUPEN_CORE_NAME; + + if (Capabilities != NULL) + { + *Capabilities = 0; +#if defined(DBG) + *Capabilities |= M64CAPS_DEBUGGER; +#endif +#if defined(DYNAREC) + *Capabilities |= M64CAPS_DYNAREC; +#endif +#if defined(COMPARE_CORE) + *Capabilities |= M64CAPS_CORE_COMPARE; +#endif + } + + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL CoreGetAPIVersions(int *ConfigVersion, int *DebugVersion, int *VidextVersion, int *ExtraVersion) +{ + /* set version info */ + if (ConfigVersion != NULL) + *ConfigVersion = CONFIG_API_VERSION; + + if (DebugVersion != NULL) + *DebugVersion = DEBUG_API_VERSION; + + if (VidextVersion != NULL) + *VidextVersion = VIDEXT_API_VERSION; + + if (ExtraVersion != NULL) + *ExtraVersion = 0; + + return M64ERR_SUCCESS; +} + +static const char *ErrorMessages[] = { + "SUCCESS: No error", + "NOT_INIT: A function was called before it's associated module was initialized", + "ALREADY_INIT: Initialization function called twice", + "INCOMPATIBLE: API versions between components are incompatible", + "INPUT_ASSERT: Invalid function parameters, such as a NULL pointer", + "INPUT_INVALID: An input function parameter is logically invalid", + "INPUT_NOT_FOUND: The input parameter(s) specified a particular item which was not found", + "NO_MEMORY: Memory allocation failed", + "FILES: Error opening, creating, reading, or writing to a file", + "INTERNAL: logical inconsistency in program code. Probably a bug.", + "INVALID_STATE: An operation was requested which is not allowed in the current state", + "PLUGIN_FAIL: A plugin function returned a fatal error", + "SYSTEM_FAIL: A system function call, such as an SDL or file operation, failed", + "UNSUPPORTED: Function call is not supported (ie, core not built with debugger)", + "WRONG_TYPE: A given input type parameter cannot be used for desired operation" }; + +EXPORT const char * CALL CoreErrorMessage(m64p_error ReturnCode) +{ + int i = (int) ReturnCode; + + if (i < 0 || i > (sizeof(ErrorMessages) / sizeof(char *))) + return "ERROR: Invalid m64p_error code given to CoreErrorMessage()"; + + return ErrorMessages[i]; +} + diff --git a/libmupen64plus/mupen64plus-core/src/api/config.c b/libmupen64plus/mupen64plus-core/src/api/config.c new file mode 100644 index 0000000000..b259ca4a21 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/api/config.c @@ -0,0 +1,1430 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - api/config.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This file contains the Core config functions which will be exported + * outside of the core library. + */ + +#include +#include +#include + +#define M64P_CORE_PROTOTYPES 1 +#include "m64p_types.h" +#include "m64p_config.h" +#include "config.h" +#include "callbacks.h" + +#include "main/util.h" + +#include "osal/files.h" +#include "osal/preproc.h" + +/* local types */ +#define MUPEN64PLUS_CFG_NAME "mupen64plus.cfg" + +#define SECTION_MAGIC 0xDBDC0580 + +typedef struct _config_var { + char *name; + m64p_type type; + union { + int integer; + float number; + char *string; + } val; + char *comment; + struct _config_var *next; + } config_var; + +typedef struct _config_section { + int magic; + char *name; + struct _config_var *first_var; + struct _config_section *next; + } config_section; + +typedef config_section *config_list; + +/* local variables */ +static int l_ConfigInit = 0; +static int l_SaveConfigOnExit = 0; +static char *l_DataDirOverride = NULL; +static char *l_ConfigDirOverride = NULL; +static config_list l_ConfigListActive = NULL; +static config_list l_ConfigListSaved = NULL; + +/* --------------- */ +/* local functions */ +/* --------------- */ + +static int is_numeric(const char *string) +{ + char chTemp[16]; + float fTemp; + int rval = sscanf(string, "%f%8s", &fTemp, chTemp); + + /* I want to find exactly one matched input item: a number with no garbage on the end */ + /* I use sscanf() instead of a custom loop because this routine must handle locales in which the decimal separator is not '.' */ + return (rval == 1); +} + +/* This function returns a pointer to the pointer of the requested section + * (i.e. a pointer the next field of the previous element, or to the first node). + * + * If there's no section named 'ParamName', returns the pointer to the next + * field of the last element in the list (such that derefencing it is NULL). + * + * Useful for operations that need to modify the links, e.g. deleting a section. + */ +static config_section **find_section_link(config_list *list, const char *ParamName) +{ + config_section **curr_sec_link; + for (curr_sec_link = list; *curr_sec_link != NULL; curr_sec_link = &(*curr_sec_link)->next) + { + if (osal_insensitive_strcmp(ParamName, (*curr_sec_link)->name) == 0) + break; + } + + return curr_sec_link; +} + +/* This function is similar to the previous function, but instead it returns a + * pointer to the pointer to the next section whose name is alphabetically + * greater than or equal to 'ParamName'. + * + * Useful for inserting a section in its alphabetical position. + */ +static config_section **find_alpha_section_link(config_list *list, const char *ParamName) +{ + config_section **curr_sec_link; + for (curr_sec_link = list; *curr_sec_link != NULL; curr_sec_link = &(*curr_sec_link)->next) + { + if (osal_insensitive_strcmp((*curr_sec_link)->name, ParamName) >= 0) + break; + } + + return curr_sec_link; +} + +static config_section *find_section(config_list list, const char *ParamName) +{ + return *find_section_link(&list, ParamName); +} + +static config_var *config_var_create(const char *ParamName, const char *ParamHelp) +{ + config_var *var = (config_var *) malloc(sizeof(config_var)); + + if (var == NULL || ParamName == NULL) + return NULL; + + memset(var, 0, sizeof(config_var)); + + var->name = strdup(ParamName); + if (var->name == NULL) + { + free(var); + return NULL; + } + + var->type = M64TYPE_INT; + var->val.integer = 0; + + if (ParamHelp != NULL) + { + var->comment = strdup(ParamHelp); + if (var->comment == NULL) + { + free(var->name); + free(var); + return NULL; + } + } + else + var->comment = NULL; + + var->next = NULL; + return var; +} + +static config_var *find_section_var(config_section *section, const char *ParamName) +{ + /* walk through the linked list of variables in the section */ + config_var *curr_var; + for (curr_var = section->first_var; curr_var != NULL; curr_var = curr_var->next) + { + if (osal_insensitive_strcmp(ParamName, curr_var->name) == 0) + return curr_var; + } + + /* couldn't find this configuration parameter */ + return NULL; +} + +static void append_var_to_section(config_section *section, config_var *var) +{ + config_var *last_var; + + if (section == NULL || var == NULL || section->magic != SECTION_MAGIC) + return; + + if (section->first_var == NULL) + { + section->first_var = var; + return; + } + + last_var = section->first_var; + while (last_var->next != NULL) + last_var = last_var->next; + + last_var->next = var; +} + +static void delete_var(config_var *var) +{ + if (var->type == M64TYPE_STRING) + free(var->val.string); + free(var->name); + free(var->comment); + free(var); +} + +static void delete_section(config_section *pSection) +{ + config_var *curr_var; + + if (pSection == NULL) + return; + + curr_var = pSection->first_var; + while (curr_var != NULL) + { + config_var *next_var = curr_var->next; + delete_var(curr_var); + curr_var = next_var; + } + + free(pSection->name); + free(pSection); +} + +static void delete_list(config_list *pConfigList) +{ + config_section *curr_section = *pConfigList; + while (curr_section != NULL) + { + config_section *next_section = curr_section->next; + /* delete the section itself */ + delete_section(curr_section); + + curr_section = next_section; + } + + *pConfigList = NULL; +} + +static config_section *config_section_create(const char *ParamName) +{ + config_section *sec; + + if (ParamName == NULL) + return NULL; + + sec = (config_section *) malloc(sizeof(config_section)); + if (sec == NULL) + return NULL; + + sec->magic = SECTION_MAGIC; + sec->name = strdup(ParamName); + if (sec->name == NULL) + { + free(sec); + return NULL; + } + sec->first_var = NULL; + sec->next = NULL; + return sec; +} + +static config_section * section_deepcopy(config_section *orig_section) +{ + config_section *new_section; + config_var *orig_var, *last_new_var; + + /* Input validation */ + if (orig_section == NULL) + return NULL; + + /* create and copy section struct */ + new_section = config_section_create(orig_section->name); + if (new_section == NULL) + return NULL; + + /* create and copy all section variables */ + orig_var = orig_section->first_var; + last_new_var = NULL; + while (orig_var != NULL) + { + config_var *new_var = config_var_create(orig_var->name, orig_var->comment); + if (new_var == NULL) + { + delete_section(new_section); + return NULL; + } + + new_var->type = orig_var->type; + switch (orig_var->type) + { + case M64TYPE_INT: + case M64TYPE_BOOL: + new_var->val.integer = orig_var->val.integer; + break; + + case M64TYPE_FLOAT: + new_var->val.number = orig_var->val.number; + break; + + case M64TYPE_STRING: + if (orig_var->val.string != NULL) + { + new_var->val.string = strdup(orig_var->val.string); + if (new_var->val.string == NULL) + { + delete_section(new_section); + return NULL; + } + } + else + new_var->val.string = NULL; + + break; + } + + /* add the new variable to the new section */ + if (last_new_var == NULL) + new_section->first_var = new_var; + else + last_new_var->next = new_var; + last_new_var = new_var; + /* advance variable pointer in original section variable list */ + orig_var = orig_var->next; + } + + return new_section; +} + +static void copy_configlist_active_to_saved(void) +{ + config_section *curr_section = l_ConfigListActive; + config_section *last_section = NULL; + + /* delete any pre-existing Saved config list */ + delete_list(&l_ConfigListSaved); + + /* duplicate all of the config sections in the Active list, adding them to the Saved list */ + while (curr_section != NULL) + { + config_section *new_section = section_deepcopy(curr_section); + if (new_section == NULL) break; + if (last_section == NULL) + l_ConfigListSaved = new_section; + else + last_section->next = new_section; + last_section = new_section; + curr_section = curr_section->next; + } +} + +static m64p_error write_configlist_file(void) +{ + config_section *curr_section; + const char *configpath; + char *filepath; + FILE *fPtr; + + /* get the full pathname to the config file and try to open it */ + configpath = ConfigGetUserConfigPath(); + if (configpath == NULL) + return M64ERR_FILES; + + filepath = combinepath(configpath, MUPEN64PLUS_CFG_NAME); + if (filepath == NULL) + return M64ERR_NO_MEMORY; + + fPtr = fopen(filepath, "wb"); + if (fPtr == NULL) + { + DebugMessage(M64MSG_ERROR, "Couldn't open configuration file '%s' for writing.", filepath); + free(filepath); + return M64ERR_FILES; + } + free(filepath); + + /* write out header */ + fprintf(fPtr, "# Mupen64Plus Configuration File\n"); + fprintf(fPtr, "# This file is automatically read and written by the Mupen64Plus Core library\n"); + + /* write out all of the config parameters from the Saved list */ + curr_section = l_ConfigListSaved; + while (curr_section != NULL) + { + config_var *curr_var = curr_section->first_var; + fprintf(fPtr, "\n[%s]\n\n", curr_section->name); + while (curr_var != NULL) + { + if (curr_var->comment != NULL && strlen(curr_var->comment) > 0) + fprintf(fPtr, "# %s\n", curr_var->comment); + if (curr_var->type == M64TYPE_INT) + fprintf(fPtr, "%s = %i\n", curr_var->name, curr_var->val.integer); + else if (curr_var->type == M64TYPE_FLOAT) + fprintf(fPtr, "%s = %f\n", curr_var->name, curr_var->val.number); + else if (curr_var->type == M64TYPE_BOOL && curr_var->val.integer) + fprintf(fPtr, "%s = True\n", curr_var->name); + else if (curr_var->type == M64TYPE_BOOL && !curr_var->val.integer) + fprintf(fPtr, "%s = False\n", curr_var->name); + else if (curr_var->type == M64TYPE_STRING && curr_var->val.string != NULL) + fprintf(fPtr, "%s = \"%s\"\n", curr_var->name, curr_var->val.string); + curr_var = curr_var->next; + } + fprintf(fPtr, "\n"); + curr_section = curr_section->next; + } + + fclose(fPtr); + return M64ERR_SUCCESS; +} + +/* ----------------------------------------------------------- */ +/* these functions are only to be used within the Core library */ +/* ----------------------------------------------------------- */ + +m64p_error ConfigInit(const char *ConfigDirOverride, const char *DataDirOverride) +{ + m64p_error rval; + const char *configpath = NULL; + char *filepath; + long filelen; + FILE *fPtr; + char *configtext; + + config_section *current_section = NULL; + char *line, *end, *lastcomment; + + if (l_ConfigInit) + return M64ERR_ALREADY_INIT; + l_ConfigInit = 1; + + /* if a data directory was specified, make a copy of it */ + if (DataDirOverride != NULL) + { + l_DataDirOverride = strdup(DataDirOverride); + if (l_DataDirOverride == NULL) + return M64ERR_NO_MEMORY; + } + + /* if a config directory was specified, make a copy of it */ + if (ConfigDirOverride != NULL) + { + l_ConfigDirOverride = strdup(ConfigDirOverride); + if (l_ConfigDirOverride == NULL) + return M64ERR_NO_MEMORY; + } + + /* get the full pathname to the config file and try to open it */ + configpath = ConfigGetUserConfigPath(); + if (configpath == NULL) + return M64ERR_FILES; + + filepath = combinepath(configpath, MUPEN64PLUS_CFG_NAME); + if (filepath == NULL) + return M64ERR_NO_MEMORY; + + fPtr = fopen(filepath, "rb"); + if (fPtr == NULL) + { + DebugMessage(M64MSG_INFO, "Couldn't open configuration file '%s'. Using defaults.", filepath); + free(filepath); + l_SaveConfigOnExit = 1; /* auto-save the config file so that the defaults will be saved to disk */ + return M64ERR_SUCCESS; + } + free(filepath); + + /* read the entire config file */ + fseek(fPtr, 0L, SEEK_END); + filelen = ftell(fPtr); + fseek(fPtr, 0L, SEEK_SET); + + configtext = (char *) malloc(filelen + 1); + if (configtext == NULL) + { + fclose(fPtr); + return M64ERR_NO_MEMORY; + } + if (fread(configtext, 1, filelen, fPtr) != filelen) + { + free(configtext); + fclose(fPtr); + return M64ERR_FILES; + } + fclose(fPtr); + + /* parse the file data */ + current_section = NULL; + line = configtext; + end = configtext + filelen; + lastcomment = NULL; + *end = 0; + while (line < end) + { + ini_line l = ini_parse_line(&line); + switch (l.type) + { + case INI_COMMENT: + lastcomment = l.value; + break; + + case INI_SECTION: + rval = ConfigOpenSection(l.name, (m64p_handle *) ¤t_section); + if (rval != M64ERR_SUCCESS) + { + free(configtext); + return rval; + } + lastcomment = NULL; + break; + + case INI_PROPERTY: + if (l.value[0] == '"' && l.value[strlen(l.value)-1] == '"') + { + l.value++; + l.value[strlen(l.value)-1] = 0; + ConfigSetDefaultString((m64p_handle) current_section, l.name, l.value, lastcomment); + } + else if (osal_insensitive_strcmp(l.value, "false") == 0) + { + ConfigSetDefaultBool((m64p_handle) current_section, l.name, 0, lastcomment); + } + else if (osal_insensitive_strcmp(l.value, "true") == 0) + { + ConfigSetDefaultBool((m64p_handle) current_section, l.name, 1, lastcomment); + } + else if (is_numeric(l.value)) + { + int val_int = (int) strtol(l.value, NULL, 10); + float val_float = (float) strtod(l.value, NULL); + if ((val_float - val_int) != 0.0) + ConfigSetDefaultFloat((m64p_handle) current_section, l.name, val_float, lastcomment); + else + ConfigSetDefaultInt((m64p_handle) current_section, l.name, val_int, lastcomment); + } + else + { + /* assume that it's a string */ + ConfigSetDefaultString((m64p_handle) current_section, l.name, l.value, lastcomment); + } + lastcomment = NULL; + break; + + default: + break; + } + } + + /* release memory used for config file text */ + free(configtext); + + /* duplicate the entire config data list, to store a copy of the list which represents the state of the file on disk */ + copy_configlist_active_to_saved(); + + return M64ERR_SUCCESS; +} + +m64p_error ConfigShutdown(void) +{ + /* first, save the file if necessary */ + if (l_SaveConfigOnExit) + ConfigSaveFile(); + + /* reset the initialized flag */ + if (!l_ConfigInit) + return M64ERR_NOT_INIT; + l_ConfigInit = 0; + + /* free any malloc'd local variables */ + if (l_DataDirOverride != NULL) + { + free(l_DataDirOverride); + l_DataDirOverride = NULL; + } + if (l_ConfigDirOverride != NULL) + { + free(l_ConfigDirOverride); + l_ConfigDirOverride = NULL; + } + + /* free all of the memory in the 2 lists */ + delete_list(&l_ConfigListActive); + delete_list(&l_ConfigListSaved); + + return M64ERR_SUCCESS; +} + +/* ------------------------------------------------ */ +/* Selector functions, exported outside of the Core */ +/* ------------------------------------------------ */ + +EXPORT m64p_error CALL ConfigListSections(void *context, void (*SectionListCallback)(void * context, const char * SectionName)) +{ + config_section *curr_section; + + if (!l_ConfigInit) + return M64ERR_NOT_INIT; + if (SectionListCallback == NULL) + return M64ERR_INPUT_ASSERT; + + /* just walk through the section list, making a callback for each section name */ + curr_section = l_ConfigListActive; + while (curr_section != NULL) + { + (*SectionListCallback)(context, curr_section->name); + curr_section = curr_section->next; + } + + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL ConfigOpenSection(const char *SectionName, m64p_handle *ConfigSectionHandle) +{ + config_section **curr_section; + config_section *new_section; + + if (!l_ConfigInit) + return M64ERR_NOT_INIT; + if (SectionName == NULL || ConfigSectionHandle == NULL) + return M64ERR_INPUT_ASSERT; + + /* walk through the section list, looking for a case-insensitive name match */ + curr_section = find_alpha_section_link(&l_ConfigListActive, SectionName); + if (*curr_section != NULL && osal_insensitive_strcmp(SectionName, (*curr_section)->name) == 0) + { + *ConfigSectionHandle = *curr_section; + return M64ERR_SUCCESS; + } + + /* didn't find the section, so create new one */ + new_section = config_section_create(SectionName); + if (new_section == NULL) + return M64ERR_NO_MEMORY; + + /* add section to list in alphabetical order */ + new_section->next = *curr_section; + *curr_section = new_section; + + *ConfigSectionHandle = new_section; + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL ConfigListParameters(m64p_handle ConfigSectionHandle, void *context, void (*ParameterListCallback)(void * context, const char *ParamName, m64p_type ParamType)) +{ + config_section *section; + config_var *curr_var; + + if (!l_ConfigInit) + return M64ERR_NOT_INIT; + if (ConfigSectionHandle == NULL || ParameterListCallback == NULL) + return M64ERR_INPUT_ASSERT; + + section = (config_section *) ConfigSectionHandle; + if (section->magic != SECTION_MAGIC) + return M64ERR_INPUT_INVALID; + + /* walk through this section's parameter list, making a callback for each parameter */ + curr_var = section->first_var; + while (curr_var != NULL) + { + (*ParameterListCallback)(context, curr_var->name, curr_var->type); + curr_var = curr_var->next; + } + + return M64ERR_SUCCESS; +} + +EXPORT int CALL ConfigHasUnsavedChanges(const char *SectionName) +{ + config_section *input_section, *curr_section; + config_var *active_var, *saved_var; + + /* check input conditions */ + if (!l_ConfigInit) + { + DebugMessage(M64MSG_ERROR, "ConfigHasUnsavedChanges(): Core config not initialized!"); + return 0; + } + + /* if SectionName is NULL or blank, then check all sections */ + if (SectionName == NULL || strlen(SectionName) < 1) + { + int iNumActiveSections = 0, iNumSavedSections = 0; + /* first, search through all sections in Active list. Recursively call ourself and return 1 if changed */ + curr_section = l_ConfigListActive; + while (curr_section != NULL) + { + if (ConfigHasUnsavedChanges(curr_section->name)) + return 1; + curr_section = curr_section->next; + iNumActiveSections++; + } + /* Next, count the number of Saved sections and see if the count matches */ + curr_section = l_ConfigListSaved; + while (curr_section != NULL) + { + curr_section = curr_section->next; + iNumSavedSections++; + } + if (iNumActiveSections == iNumSavedSections) + return 0; /* no changes */ + else + return 1; + } + + /* walk through the Active section list, looking for a case-insensitive name match with input string */ + input_section = find_section(l_ConfigListActive, SectionName); + if (input_section == NULL) + { + DebugMessage(M64MSG_ERROR, "ConfigHasUnsavedChanges(): section name '%s' not found!", SectionName); + return 0; + } + + /* walk through the Saved section list, looking for a case-insensitive name match */ + curr_section = find_section(l_ConfigListSaved, SectionName); + if (curr_section == NULL) + { + /* if this section isn't present in saved list, then it has been newly created */ + return 1; + } + + /* compare all of the variables in the two sections. They are expected to be in the same order */ + active_var = input_section->first_var; + saved_var = curr_section->first_var; + while (active_var != NULL && saved_var != NULL) + { + if (strcmp(active_var->name, saved_var->name) != 0) + return 1; + if (active_var->type != saved_var->type) + return 1; + switch(active_var->type) + { + case M64TYPE_INT: + if (active_var->val.integer != saved_var->val.integer) + return 1; + break; + case M64TYPE_FLOAT: + if (active_var->val.number != saved_var->val.number) + return 1; + break; + case M64TYPE_BOOL: + if ((active_var->val.integer != 0) != (saved_var->val.integer != 0)) + return 1; + break; + case M64TYPE_STRING: + if (active_var->val.string == NULL) + { + DebugMessage(M64MSG_ERROR, "ConfigHasUnsavedChanges(): Variable '%s' NULL Active string pointer!", active_var->name); + return 1; + } + if (saved_var->val.string == NULL) + { + DebugMessage(M64MSG_ERROR, "ConfigHasUnsavedChanges(): Variable '%s' NULL Saved string pointer!", active_var->name); + return 1; + } + if (strcmp(active_var->val.string, saved_var->val.string) != 0) + return 1; + break; + default: + DebugMessage(M64MSG_ERROR, "ConfigHasUnsavedChanges(): Invalid variable '%s' type %i!", active_var->name, active_var->type); + return 1; + } + if (active_var->comment != NULL && saved_var->comment != NULL && strcmp(active_var->comment, saved_var->comment) != 0) + return 1; + active_var = active_var->next; + saved_var = saved_var->next; + } + + /* any extra new variables on the end, or deleted variables? */ + if (active_var != NULL || saved_var != NULL) + return 1; + + /* exactly the same */ + return 0; +} + +/* ------------------------------------------------------- */ +/* Modifier functions, exported outside of the Core */ +/* ------------------------------------------------------- */ + +EXPORT m64p_error CALL ConfigDeleteSection(const char *SectionName) +{ + config_section **curr_section_link; + config_section *next_section; + + if (!l_ConfigInit) + return M64ERR_NOT_INIT; + if (l_ConfigListActive == NULL) + return M64ERR_INPUT_NOT_FOUND; + + /* find the named section and pull it out of the list */ + curr_section_link = find_section_link(&l_ConfigListActive, SectionName); + if (*curr_section_link == NULL) + return M64ERR_INPUT_NOT_FOUND; + + next_section = (*curr_section_link)->next; + + /* delete the named section */ + delete_section(*curr_section_link); + + /* fix the pointer to point to the next section after the deleted one */ + *curr_section_link = next_section; + + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL ConfigSaveFile(void) +{ + if (!l_ConfigInit) + return M64ERR_NOT_INIT; + + /* copy the active config list to the saved config list */ + copy_configlist_active_to_saved(); + + /* write the saved config list out to a file */ + return (write_configlist_file()); +} + +EXPORT m64p_error CALL ConfigSaveSection(const char *SectionName) +{ + config_section *curr_section, *new_section; + config_section **insertion_point; + + if (!l_ConfigInit) + return M64ERR_NOT_INIT; + if (SectionName == NULL || strlen(SectionName) < 1) + return M64ERR_INPUT_ASSERT; + + /* walk through the Active section list, looking for a case-insensitive name match */ + curr_section = find_section(l_ConfigListActive, SectionName); + if (curr_section == NULL) + return M64ERR_INPUT_NOT_FOUND; + + /* duplicate this section */ + new_section = section_deepcopy(curr_section); + if (new_section == NULL) + return M64ERR_NO_MEMORY; + + /* update config section that's in the Saved list with the new one */ + insertion_point = find_alpha_section_link(&l_ConfigListSaved, SectionName); + if (*insertion_point != NULL && osal_insensitive_strcmp((*insertion_point)->name, SectionName) == 0) + { + /* the section exists in the saved list and will be replaced */ + new_section->next = (*insertion_point)->next; + delete_section(*insertion_point); + *insertion_point = new_section; + } + else + { + /* the section didn't exist in the saved list and has to be inserted */ + new_section->next = *insertion_point; + *insertion_point = new_section; + } + + /* write the saved config list out to a file */ + return (write_configlist_file()); +} + +EXPORT m64p_error CALL ConfigRevertChanges(const char *SectionName) +{ + config_section **active_section_link, *active_section, *saved_section, *new_section; + + /* check input conditions */ + if (!l_ConfigInit) + return M64ERR_NOT_INIT; + if (SectionName == NULL) + return M64ERR_INPUT_ASSERT; + + /* walk through the Active section list, looking for a case-insensitive name match with input string */ + active_section_link = find_section_link(&l_ConfigListActive, SectionName); + active_section = *active_section_link; + if (active_section == NULL) + return M64ERR_INPUT_NOT_FOUND; + + /* walk through the Saved section list, looking for a case-insensitive name match */ + saved_section = find_section(l_ConfigListSaved, SectionName); + if (saved_section == NULL) + { + /* if this section isn't present in saved list, then it has been newly created */ + return M64ERR_INPUT_NOT_FOUND; + } + + /* copy the section as it is on the disk */ + new_section = section_deepcopy(saved_section); + if (new_section == NULL) + return M64ERR_NO_MEMORY; + + /* replace active_section with saved_section in the linked list */ + *active_section_link = new_section; + new_section->next = active_section->next; + + /* release memory associated with active_section */ + delete_section(active_section); + + return M64ERR_SUCCESS; +} + + +/* ------------------------------------------------------- */ +/* Generic Get/Set functions, exported outside of the Core */ +/* ------------------------------------------------------- */ + +EXPORT m64p_error CALL ConfigSetParameter(m64p_handle ConfigSectionHandle, const char *ParamName, m64p_type ParamType, const void *ParamValue) +{ + config_section *section; + config_var *var; + + /* check input conditions */ + if (!l_ConfigInit) + return M64ERR_NOT_INIT; + if (ConfigSectionHandle == NULL || ParamName == NULL || ParamValue == NULL || (int) ParamType < 1 || (int) ParamType > 4) + return M64ERR_INPUT_ASSERT; + + section = (config_section *) ConfigSectionHandle; + if (section->magic != SECTION_MAGIC) + return M64ERR_INPUT_INVALID; + + /* if this parameter doesn't already exist, then create it and add it to the section */ + var = find_section_var(section, ParamName); + if (var == NULL) + { + var = config_var_create(ParamName, NULL); + if (var == NULL) + return M64ERR_NO_MEMORY; + append_var_to_section(section, var); + } + + /* cleanup old values */ + switch (var->type) + { + case M64TYPE_STRING: + free(var->val.string); + break; + default: + break; + } + + /* set this parameter's value */ + var->type = ParamType; + switch(ParamType) + { + case M64TYPE_INT: + var->val.integer = *((int *) ParamValue); + break; + case M64TYPE_FLOAT: + var->val.number = *((float *) ParamValue); + break; + case M64TYPE_BOOL: + var->val.integer = (*((int *) ParamValue) != 0); + break; + case M64TYPE_STRING: + var->val.string = strdup((char *)ParamValue); + if (var->val.string == NULL) + return M64ERR_NO_MEMORY; + break; + default: + /* this is logically impossible because of the ParamType check at the top of this function */ + break; + } + + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL ConfigGetParameter(m64p_handle ConfigSectionHandle, const char *ParamName, m64p_type ParamType, void *ParamValue, int MaxSize) +{ + config_section *section; + config_var *var; + + /* check input conditions */ + if (!l_ConfigInit) + return M64ERR_NOT_INIT; + if (ConfigSectionHandle == NULL || ParamName == NULL || ParamValue == NULL || (int) ParamType < 1 || (int) ParamType > 4) + return M64ERR_INPUT_ASSERT; + + section = (config_section *) ConfigSectionHandle; + if (section->magic != SECTION_MAGIC) + return M64ERR_INPUT_INVALID; + + /* if this parameter doesn't already exist, return an error */ + var = find_section_var(section, ParamName); + if (var == NULL) + return M64ERR_INPUT_NOT_FOUND; + + /* call the specific Get function to translate the parameter to the desired type */ + switch(ParamType) + { + case M64TYPE_INT: + if (MaxSize < sizeof(int)) return M64ERR_INPUT_INVALID; + if (var->type != M64TYPE_INT && var->type != M64TYPE_FLOAT) return M64ERR_WRONG_TYPE; + *((int *) ParamValue) = ConfigGetParamInt(ConfigSectionHandle, ParamName); + break; + case M64TYPE_FLOAT: + if (MaxSize < sizeof(float)) return M64ERR_INPUT_INVALID; + if (var->type != M64TYPE_INT && var->type != M64TYPE_FLOAT) return M64ERR_WRONG_TYPE; + *((float *) ParamValue) = ConfigGetParamFloat(ConfigSectionHandle, ParamName); + break; + case M64TYPE_BOOL: + if (MaxSize < sizeof(int)) return M64ERR_INPUT_INVALID; + if (var->type != M64TYPE_BOOL && var->type != M64TYPE_INT) return M64ERR_WRONG_TYPE; + *((int *) ParamValue) = ConfigGetParamBool(ConfigSectionHandle, ParamName); + break; + case M64TYPE_STRING: + { + const char *string; + if (MaxSize < 1) return M64ERR_INPUT_INVALID; + if (var->type != M64TYPE_STRING && var->type != M64TYPE_BOOL) return M64ERR_WRONG_TYPE; + string = ConfigGetParamString(ConfigSectionHandle, ParamName); + strncpy((char *) ParamValue, string, MaxSize); + *((char *) ParamValue + MaxSize - 1) = 0; + break; + } + default: + /* this is logically impossible because of the ParamType check at the top of this function */ + break; + } + + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL ConfigGetParameterType(m64p_handle ConfigSectionHandle, const char *ParamName, m64p_type *ParamType) +{ + config_section *section; + config_var *var; + + /* check input conditions */ + if (!l_ConfigInit) + return M64ERR_NOT_INIT; + if (ConfigSectionHandle == NULL || ParamName == NULL || ParamType == NULL) + return M64ERR_INPUT_ASSERT; + + section = (config_section *) ConfigSectionHandle; + if (section->magic != SECTION_MAGIC) + return M64ERR_INPUT_INVALID; + + /* if this parameter doesn't already exist, return an error */ + var = find_section_var(section, ParamName); + if (var == NULL) + return M64ERR_INPUT_NOT_FOUND; + + *ParamType = var->type; + return M64ERR_SUCCESS; +} + + +EXPORT const char * CALL ConfigGetParameterHelp(m64p_handle ConfigSectionHandle, const char *ParamName) +{ + config_section *section; + config_var *var; + + /* check input conditions */ + if (!l_ConfigInit || ConfigSectionHandle == NULL || ParamName == NULL) + return NULL; + + section = (config_section *) ConfigSectionHandle; + if (section->magic != SECTION_MAGIC) + return NULL; + + /* if this parameter doesn't exist, return an error */ + var = find_section_var(section, ParamName); + if (var == NULL) + return NULL; + + return var->comment; +} + +/* ------------------------------------------------------- */ +/* Special Get/Set functions, exported outside of the Core */ +/* ------------------------------------------------------- */ + +EXPORT m64p_error CALL ConfigSetDefaultInt(m64p_handle ConfigSectionHandle, const char *ParamName, int ParamValue, const char *ParamHelp) +{ + config_section *section; + config_var *var; + + /* check input conditions */ + if (!l_ConfigInit) + return M64ERR_NOT_INIT; + if (ConfigSectionHandle == NULL || ParamName == NULL) + return M64ERR_INPUT_ASSERT; + + section = (config_section *) ConfigSectionHandle; + if (section->magic != SECTION_MAGIC) + return M64ERR_INPUT_INVALID; + + /* if this parameter already exists, then just return successfully */ + var = find_section_var(section, ParamName); + if (var != NULL) + return M64ERR_SUCCESS; + + /* otherwise create a new config_var object and add it to this section */ + var = config_var_create(ParamName, ParamHelp); + if (var == NULL) + return M64ERR_NO_MEMORY; + var->type = M64TYPE_INT; + var->val.integer = ParamValue; + append_var_to_section(section, var); + + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL ConfigSetDefaultFloat(m64p_handle ConfigSectionHandle, const char *ParamName, float ParamValue, const char *ParamHelp) +{ + config_section *section; + config_var *var; + + /* check input conditions */ + if (!l_ConfigInit) + return M64ERR_NOT_INIT; + if (ConfigSectionHandle == NULL || ParamName == NULL) + return M64ERR_INPUT_ASSERT; + + section = (config_section *) ConfigSectionHandle; + if (section->magic != SECTION_MAGIC) + return M64ERR_INPUT_INVALID; + + /* if this parameter already exists, then just return successfully */ + var = find_section_var(section, ParamName); + if (var != NULL) + return M64ERR_SUCCESS; + + /* otherwise create a new config_var object and add it to this section */ + var = config_var_create(ParamName, ParamHelp); + if (var == NULL) + return M64ERR_NO_MEMORY; + var->type = M64TYPE_FLOAT; + var->val.number = ParamValue; + append_var_to_section(section, var); + + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL ConfigSetDefaultBool(m64p_handle ConfigSectionHandle, const char *ParamName, int ParamValue, const char *ParamHelp) +{ + config_section *section; + config_var *var; + + /* check input conditions */ + if (!l_ConfigInit) + return M64ERR_NOT_INIT; + if (ConfigSectionHandle == NULL || ParamName == NULL) + return M64ERR_INPUT_ASSERT; + + section = (config_section *) ConfigSectionHandle; + if (section->magic != SECTION_MAGIC) + return M64ERR_INPUT_INVALID; + + /* if this parameter already exists, then just return successfully */ + var = find_section_var(section, ParamName); + if (var != NULL) + return M64ERR_SUCCESS; + + /* otherwise create a new config_var object and add it to this section */ + var = config_var_create(ParamName, ParamHelp); + if (var == NULL) + return M64ERR_NO_MEMORY; + var->type = M64TYPE_BOOL; + var->val.integer = ParamValue ? 1 : 0; + append_var_to_section(section, var); + + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL ConfigSetDefaultString(m64p_handle ConfigSectionHandle, const char *ParamName, const char * ParamValue, const char *ParamHelp) +{ + config_section *section; + config_var *var; + + /* check input conditions */ + if (!l_ConfigInit) + return M64ERR_NOT_INIT; + if (ConfigSectionHandle == NULL || ParamName == NULL || ParamValue == NULL) + return M64ERR_INPUT_ASSERT; + + section = (config_section *) ConfigSectionHandle; + if (section->magic != SECTION_MAGIC) + return M64ERR_INPUT_INVALID; + + /* if this parameter already exists, then just return successfully */ + var = find_section_var(section, ParamName); + if (var != NULL) + return M64ERR_SUCCESS; + + /* otherwise create a new config_var object and add it to this section */ + var = config_var_create(ParamName, ParamHelp); + if (var == NULL) + return M64ERR_NO_MEMORY; + var->type = M64TYPE_STRING; + var->val.string = strdup(ParamValue); + if (var->val.string == NULL) + { + delete_var(var); + return M64ERR_NO_MEMORY; + } + append_var_to_section(section, var); + + return M64ERR_SUCCESS; +} + +EXPORT int CALL ConfigGetParamInt(m64p_handle ConfigSectionHandle, const char *ParamName) +{ + config_section *section; + config_var *var; + + /* check input conditions */ + if (!l_ConfigInit || ConfigSectionHandle == NULL || ParamName == NULL) + { + DebugMessage(M64MSG_ERROR, "ConfigGetParamInt(): Input assertion!"); + return 0; + } + + section = (config_section *) ConfigSectionHandle; + if (section->magic != SECTION_MAGIC) + { + DebugMessage(M64MSG_ERROR, "ConfigGetParamInt(): ConfigSectionHandle invalid!"); + return 0; + } + + /* if this parameter doesn't already exist, return an error */ + var = find_section_var(section, ParamName); + if (var == NULL) + { + DebugMessage(M64MSG_ERROR, "ConfigGetParamInt(): Parameter '%s' not found!", ParamName); + return 0; + } + + /* translate the actual variable type to an int */ + switch(var->type) + { + case M64TYPE_INT: + return var->val.integer; + case M64TYPE_FLOAT: + return (int) var->val.number; + case M64TYPE_BOOL: + return (var->val.integer != 0); + case M64TYPE_STRING: + return atoi(var->val.string); + default: + DebugMessage(M64MSG_ERROR, "ConfigGetParamInt(): invalid internal parameter type for '%s'", ParamName); + return 0; + } + + return 0; +} + +EXPORT float CALL ConfigGetParamFloat(m64p_handle ConfigSectionHandle, const char *ParamName) +{ + config_section *section; + config_var *var; + + /* check input conditions */ + if (!l_ConfigInit || ConfigSectionHandle == NULL || ParamName == NULL) + { + DebugMessage(M64MSG_ERROR, "ConfigGetParamFloat(): Input assertion!"); + return 0.0; + } + + section = (config_section *) ConfigSectionHandle; + if (section->magic != SECTION_MAGIC) + { + DebugMessage(M64MSG_ERROR, "ConfigGetParamFloat(): ConfigSectionHandle invalid!"); + return 0.0; + } + + /* if this parameter doesn't already exist, return an error */ + var = find_section_var(section, ParamName); + if (var == NULL) + { + DebugMessage(M64MSG_ERROR, "ConfigGetParamFloat(): Parameter '%s' not found!", ParamName); + return 0.0; + } + + /* translate the actual variable type to an int */ + switch(var->type) + { + case M64TYPE_INT: + return (float) var->val.integer; + case M64TYPE_FLOAT: + return var->val.number; + case M64TYPE_BOOL: + return (var->val.integer != 0) ? 1.0f : 0.0f; + case M64TYPE_STRING: + return (float) atof(var->val.string); + default: + DebugMessage(M64MSG_ERROR, "ConfigGetParamFloat(): invalid internal parameter type for '%s'", ParamName); + return 0.0; + } + + return 0.0; +} + +EXPORT int CALL ConfigGetParamBool(m64p_handle ConfigSectionHandle, const char *ParamName) +{ + config_section *section; + config_var *var; + + /* check input conditions */ + if (!l_ConfigInit || ConfigSectionHandle == NULL || ParamName == NULL) + { + DebugMessage(M64MSG_ERROR, "ConfigGetParamBool(): Input assertion!"); + return 0; + } + + section = (config_section *) ConfigSectionHandle; + if (section->magic != SECTION_MAGIC) + { + DebugMessage(M64MSG_ERROR, "ConfigGetParamBool(): ConfigSectionHandle invalid!"); + return 0; + } + + /* if this parameter doesn't already exist, return an error */ + var = find_section_var(section, ParamName); + if (var == NULL) + { + DebugMessage(M64MSG_ERROR, "ConfigGetParamBool(): Parameter '%s' not found!", ParamName); + return 0; + } + + /* translate the actual variable type to an int */ + switch(var->type) + { + case M64TYPE_INT: + return (var->val.integer != 0); + case M64TYPE_FLOAT: + return (var->val.number != 0.0); + case M64TYPE_BOOL: + return var->val.integer; + case M64TYPE_STRING: + return (osal_insensitive_strcmp(var->val.string, "true") == 0); + default: + DebugMessage(M64MSG_ERROR, "ConfigGetParamBool(): invalid internal parameter type for '%s'", ParamName); + return 0; + } + + return 0; +} + +EXPORT const char * CALL ConfigGetParamString(m64p_handle ConfigSectionHandle, const char *ParamName) +{ + static char outstr[64]; /* warning: not thread safe */ + config_section *section; + config_var *var; + + /* check input conditions */ + if (!l_ConfigInit || ConfigSectionHandle == NULL || ParamName == NULL) + { + DebugMessage(M64MSG_ERROR, "ConfigGetParamString(): Input assertion!"); + return ""; + } + + section = (config_section *) ConfigSectionHandle; + if (section->magic != SECTION_MAGIC) + { + DebugMessage(M64MSG_ERROR, "ConfigGetParamString(): ConfigSectionHandle invalid!"); + return ""; + } + + /* if this parameter doesn't already exist, return an error */ + var = find_section_var(section, ParamName); + if (var == NULL) + { + DebugMessage(M64MSG_ERROR, "ConfigGetParamString(): Parameter '%s' not found!", ParamName); + return ""; + } + + /* translate the actual variable type to an int */ + switch(var->type) + { + case M64TYPE_INT: + snprintf(outstr, 63, "%i", var->val.integer); + outstr[63] = 0; + return outstr; + case M64TYPE_FLOAT: + snprintf(outstr, 63, "%f", var->val.number); + outstr[63] = 0; + return outstr; + case M64TYPE_BOOL: + return (var->val.integer ? "True" : "False"); + case M64TYPE_STRING: + return var->val.string; + default: + DebugMessage(M64MSG_ERROR, "ConfigGetParamString(): invalid internal parameter type for '%s'", ParamName); + return ""; + } + + return ""; +} + +/* ------------------------------------------------------ */ +/* OS Abstraction functions, exported outside of the Core */ +/* ------------------------------------------------------ */ + +EXPORT const char * CALL ConfigGetSharedDataFilepath(const char *filename) +{ + const char *configsharepath = NULL; + m64p_handle CoreHandle = NULL; + + /* check input parameter */ + if (filename == NULL) return NULL; + + /* try to get the SharedDataPath string variable in the Core configuration section */ + if (ConfigOpenSection("Core", &CoreHandle) == M64ERR_SUCCESS) + { + configsharepath = ConfigGetParamString(CoreHandle, "SharedDataPath"); + } + + return osal_get_shared_filepath(filename, l_DataDirOverride, configsharepath); +} + +EXPORT const char * CALL ConfigGetUserConfigPath(void) +{ + if (l_ConfigDirOverride != NULL) + return l_ConfigDirOverride; + else + return osal_get_user_configpath(); +} + +EXPORT const char * CALL ConfigGetUserDataPath(void) +{ + return osal_get_user_datapath(); +} + +EXPORT const char * CALL ConfigGetUserCachePath(void) +{ + return osal_get_user_cachepath(); +} + diff --git a/libmupen64plus/mupen64plus-core/src/api/config.h b/libmupen64plus/mupen64plus-core/src/api/config.h new file mode 100644 index 0000000000..76c9f7d294 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/api/config.h @@ -0,0 +1,30 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - api/config.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This file contains the Core configuration functions + */ + +#include "m64p_types.h" + +/* these functions are only to be used within the Core library */ + +m64p_error ConfigInit(const char *ConfigDirOverride, const char *DataDirOverride); +m64p_error ConfigShutdown(void); diff --git a/libmupen64plus/mupen64plus-core/src/api/debugger.c b/libmupen64plus/mupen64plus-core/src/api/debugger.c new file mode 100644 index 0000000000..89d19994ab --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/api/debugger.c @@ -0,0 +1,390 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - api/debugger.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This file contains the Core debugger functions which will be exported + * outside of the core library. + */ + +#include + +#define M64P_CORE_PROTOTYPES 1 +#include "m64p_types.h" +#include "m64p_debugger.h" +#include "callbacks.h" +#include "debugger.h" + +#include "debugger/dbg_types.h" +#include "debugger/dbg_breakpoints.h" +#include "debugger/dbg_decoder.h" +#include "debugger/dbg_memory.h" +#include "debugger/debugger.h" +#include "memory/memory.h" +#include "r4300/r4300.h" + +extern unsigned int op; /* this is in r4300/pure_interp.c */ + +/* local variables */ +static void (*callback_ui_init)(void) = NULL; +static void (*callback_ui_update)(unsigned int) = NULL; +static void (*callback_ui_vi)(void) = NULL; + +static void (*callback_core_compare)(unsigned int) = NULL; +static void (*callback_core_data_sync)(int, void *) = NULL; + +/* global Functions for use by the Core */ + +void DebuggerCallback(eDbgCallbackType type, unsigned int param) +{ + if (type == DEBUG_UI_INIT) + { + if (callback_ui_init != NULL) + (*callback_ui_init)(); + } + else if (type == DEBUG_UI_UPDATE) + { + if (callback_ui_update != NULL) + (*callback_ui_update)(param); + } + else if (type == DEBUG_UI_VI) + { + if (callback_ui_vi != NULL) + (*callback_ui_vi)(); + } +} + +void CoreCompareCallback(void) +{ + if (callback_core_compare != NULL) + (*callback_core_compare)(op); +} + +void CoreCompareDataSync(int length, void *ptr) +{ + if (callback_core_data_sync != NULL) + (*callback_core_data_sync)(length, ptr); +} + +/* exported functions for use by the front-end User Interface */ + +EXPORT m64p_error CALL DebugSetCoreCompare(void (*dbg_core_compare)(unsigned int), void (*dbg_core_data_sync)(int, void *)) +{ + callback_core_compare = dbg_core_compare; + callback_core_data_sync = dbg_core_data_sync; + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL DebugSetCallbacks(void (*dbg_frontend_init)(void), void (*dbg_frontend_update)(unsigned int pc), void (*dbg_frontend_vi)(void)) +{ +#ifdef DBG + callback_ui_init = dbg_frontend_init; + callback_ui_update = dbg_frontend_update; + callback_ui_vi = dbg_frontend_vi; + return M64ERR_SUCCESS; +#else + return M64ERR_UNSUPPORTED; +#endif +} + +EXPORT m64p_error CALL DebugSetRunState(int runstate) +{ +#ifdef DBG + run = runstate; /* in debugger/debugger.c */ + return M64ERR_SUCCESS; +#else + return M64ERR_UNSUPPORTED; +#endif +} + +EXPORT int CALL DebugGetState(m64p_dbg_state statenum) +{ +#ifdef DBG + switch (statenum) + { + case M64P_DBG_RUN_STATE: + return run; + case M64P_DBG_PREVIOUS_PC: + return previousPC; + case M64P_DBG_NUM_BREAKPOINTS: + return g_NumBreakpoints; + case M64P_DBG_CPU_DYNACORE: + return r4300emu; + case M64P_DBG_CPU_NEXT_INTERRUPT: + return next_interupt; + default: + DebugMessage(M64MSG_WARNING, "Bug: invalid m64p_dbg_state input in DebugGetState()"); + return 0; + } + return 0; +#else + DebugMessage(M64MSG_ERROR, "Bug: DebugGetState() called, but Debugger not supported in Core library"); + return 0; +#endif +} + +EXPORT m64p_error CALL DebugStep(void) +{ +#ifdef DBG + if (!g_DebuggerActive) + return M64ERR_INVALID_STATE; + debugger_step(); /* in debugger/debugger.c */ + return M64ERR_SUCCESS; +#else + return M64ERR_UNSUPPORTED; +#endif +} + +EXPORT void CALL DebugDecodeOp(unsigned int instruction, char *op, char *args, int pc) +{ +#ifdef DBG + r4300_decode_op(instruction, op, args, pc); +#else + DebugMessage(M64MSG_ERROR, "Bug: DebugDecodeOp() called, but Debugger not supported in Core library"); +#endif +} + +EXPORT void * CALL DebugMemGetRecompInfo(m64p_dbg_mem_info recomp_type, unsigned int address, int index) +{ +#ifdef DBG + switch (recomp_type) + { + case M64P_DBG_RECOMP_OPCODE: + return get_recompiled_opcode(address, index); + case M64P_DBG_RECOMP_ARGS: + return get_recompiled_args(address, index); + case M64P_DBG_RECOMP_ADDR: + return get_recompiled_addr(address, index); + default: + DebugMessage(M64MSG_ERROR, "Bug: DebugMemGetRecompInfo() called with invalid m64p_dbg_mem_info"); + return NULL; + } +#else + DebugMessage(M64MSG_ERROR, "Bug: DebugMemGetRecompInfo() called, but Debugger not supported in Core library"); + return NULL; +#endif +} + +EXPORT int CALL DebugMemGetMemInfo(m64p_dbg_mem_info mem_info_type, unsigned int address) +{ +#ifdef DBG + switch (mem_info_type) + { + case M64P_DBG_MEM_TYPE: + return get_memory_type(address); + case M64P_DBG_MEM_FLAGS: + return get_memory_flags(address); + case M64P_DBG_MEM_HAS_RECOMPILED: + return get_has_recompiled(address); + case M64P_DBG_MEM_NUM_RECOMPILED: + return get_num_recompiled(address); + default: + DebugMessage(M64MSG_ERROR, "Bug: DebugMemGetMemInfo() called with invalid m64p_dbg_mem_info"); + return 0; + } +#else + DebugMessage(M64MSG_ERROR, "Bug: DebugMemGetMemInfo() called, but Debugger not supported in Core library"); + return 0; +#endif +} + +EXPORT void * CALL DebugMemGetPointer(m64p_dbg_memptr_type mem_ptr_type) +{ + switch (mem_ptr_type) + { + case M64P_DBG_PTR_RDRAM: + return rdram; + case M64P_DBG_PTR_PI_REG: + return &pi_register; + case M64P_DBG_PTR_SI_REG: + return &si_register; + case M64P_DBG_PTR_VI_REG: + return &vi_register; + case M64P_DBG_PTR_RI_REG: + return &ri_register; + case M64P_DBG_PTR_AI_REG: + return &ai_register; + default: + DebugMessage(M64MSG_ERROR, "Bug: DebugMemGetPointer() called with invalid m64p_dbg_memptr_type"); + return NULL; + } +} + +EXPORT unsigned long long CALL DebugMemRead64(unsigned int address) +{ +#ifdef DBG + if ((address & 3) == 0) + return read_memory_64(address); + else + return read_memory_64_unaligned(address); +#else + DebugMessage(M64MSG_ERROR, "Bug: DebugMemRead64() called, but Debugger not supported in Core library"); + return 0LL; +#endif +} + +EXPORT unsigned int CALL DebugMemRead32(unsigned int address) +{ +#ifdef DBG + if ((address & 3) == 0) + return read_memory_32(address); + else + return read_memory_32_unaligned(address); +#else + DebugMessage(M64MSG_ERROR, "Bug: DebugMemRead32() called, but Debugger not supported in Core library"); + return 0; +#endif +} + +EXPORT unsigned short CALL DebugMemRead16(unsigned int address) +{ +#ifdef DBG + return read_memory_16(address); +#else + DebugMessage(M64MSG_ERROR, "Bug: DebugMemRead16() called, but Debugger not supported in Core library"); + return 0; +#endif +} + +EXPORT unsigned char CALL DebugMemRead8(unsigned int address) +{ +#ifdef DBG + return read_memory_8(address); +#else + DebugMessage(M64MSG_ERROR, "Bug: DebugMemRead8() called, but Debugger not supported in Core library"); + return 0; +#endif +} + +EXPORT void CALL DebugMemWrite64(unsigned int address, unsigned long long value) +{ +#ifdef DBG + if ((address & 3) == 0) + write_memory_64(address, value); + else + write_memory_64_unaligned(address, value); +#else + DebugMessage(M64MSG_ERROR, "Bug: DebugMemWrite64() called, but Debugger not supported in Core library"); +#endif +} + +EXPORT void CALL DebugMemWrite32(unsigned int address, unsigned int value) +{ +#ifdef DBG + if ((address & 3) == 0) + write_memory_32(address, value); + else + write_memory_32_unaligned(address, value); +#else + DebugMessage(M64MSG_ERROR, "Bug: DebugMemWrite32() called, but Debugger not supported in Core library"); +#endif +} + +EXPORT void CALL DebugMemWrite16(unsigned int address, unsigned short value) +{ +#ifdef DBG + write_memory_16(address, value); +#else + DebugMessage(M64MSG_ERROR, "Bug: DebugMemWrite16() called, but Debugger not supported in Core library"); +#endif +} + +EXPORT void CALL DebugMemWrite8(unsigned int address, unsigned char value) +{ +#ifdef DBG + write_memory_8(address, value); +#else + DebugMessage(M64MSG_ERROR, "Bug: DebugMemWrite8() called, but Debugger not supported in Core library"); +#endif +} + +EXPORT void * CALL DebugGetCPUDataPtr(m64p_dbg_cpu_data cpu_data_type) +{ + switch (cpu_data_type) + { + case M64P_CPU_PC: + return &PC->addr; + case M64P_CPU_REG_REG: + return reg; + case M64P_CPU_REG_HI: + return &hi; + case M64P_CPU_REG_LO: + return &lo; + case M64P_CPU_REG_COP0: + return reg_cop0; + case M64P_CPU_REG_COP1_DOUBLE_PTR: + return reg_cop1_double; + case M64P_CPU_REG_COP1_SIMPLE_PTR: + return reg_cop1_simple; + case M64P_CPU_REG_COP1_FGR_64: + return reg_cop1_fgr_64; + case M64P_CPU_TLB: + return tlb_e; + default: + DebugMessage(M64MSG_ERROR, "Bug: DebugGetCPUDataPtr() called with invalid input m64p_dbg_cpu_data"); + return NULL; + } +} + +EXPORT int CALL DebugBreakpointLookup(unsigned int address, unsigned int size, unsigned int flags) +{ +#ifdef DBG + return lookup_breakpoint(address, size, flags); +#else + DebugMessage(M64MSG_ERROR, "Bug: DebugBreakpointLookup() called, but Debugger not supported in Core library"); + return -1; +#endif +} + +EXPORT int CALL DebugBreakpointCommand(m64p_dbg_bkp_command command, unsigned int index, void *ptr) +{ +#ifdef DBG + switch (command) + { + case M64P_BKP_CMD_ADD_ADDR: + return add_breakpoint(index); + case M64P_BKP_CMD_ADD_STRUCT: + return add_breakpoint_struct((breakpoint *) ptr); + case M64P_BKP_CMD_REPLACE: + replace_breakpoint_num(index, (breakpoint *) ptr); + return 0; + case M64P_BKP_CMD_REMOVE_ADDR: + remove_breakpoint_by_address(index); + return 0; + case M64P_BKP_CMD_REMOVE_IDX: + remove_breakpoint_by_num(index); + return 0; + case M64P_BKP_CMD_ENABLE: + enable_breakpoint(index); + return 0; + case M64P_BKP_CMD_DISABLE: + disable_breakpoint(index); + return 0; + case M64P_BKP_CMD_CHECK: + return check_breakpoints(index); + default: + DebugMessage(M64MSG_ERROR, "Bug: DebugBreakpointCommand() called with invalid input m64p_dbg_bkp_command"); + return -1; + } +#else + DebugMessage(M64MSG_ERROR, "Bug: DebugBreakpointCommand() called, but Debugger not supported in Core library"); + return -1; +#endif +} + diff --git a/libmupen64plus/mupen64plus-core/src/api/debugger.h b/libmupen64plus/mupen64plus-core/src/api/debugger.h new file mode 100644 index 0000000000..f15a04a552 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/api/debugger.h @@ -0,0 +1,46 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - api/debugger.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This file contains the definitions for debugger functions which will be + * called from the other Core modules + */ + +#if !defined(API_DEBUGGER_H) +#define API_DEBUGGER_H + +#include "m64p_types.h" + +/* Debugger Definitions */ + +typedef enum { + DEBUG_UI_INIT = 1, + DEBUG_UI_UPDATE, + DEBUG_UI_VI, + DEBUG_CORE_COMPARE + } eDbgCallbackType; + +/* Functions for use by the Core, to send information back to the front-end app */ +extern void DebuggerCallback(eDbgCallbackType type, unsigned int param); +extern void CoreCompareCallback(void); +extern void CoreCompareDataSync(int length, void *ptr); + +#endif /* API_DEBUGGER_H */ + diff --git a/libmupen64plus/mupen64plus-core/src/api/frontend.c b/libmupen64plus/mupen64plus-core/src/api/frontend.c new file mode 100644 index 0000000000..b3fefab5e4 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/api/frontend.c @@ -0,0 +1,367 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - api/frontend.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2012 CasualJames * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This file contains the Core front-end functions which will be exported + * outside of the core library. + */ + +#include +#include +#include +#include + +#define M64P_CORE_PROTOTYPES 1 +#include "m64p_types.h" +#include "callbacks.h" +#include "m64p_config.h" +#include "m64p_frontend.h" +#include "config.h" +#include "vidext.h" + +#include "main/cheat.h" +#include "main/eventloop.h" +#include "main/main.h" +#include "main/rom.h" +#include "main/savestates.h" +#include "main/version.h" +#include "main/util.h" +#include "main/workqueue.h" +#include "osd/screenshot.h" +#include "plugin/plugin.h" + +/* some local state variables */ +static int l_CoreInit = 0; +static int l_ROMOpen = 0; + +/* functions exported outside of libmupen64plus to front-end application */ +EXPORT m64p_error CALL CoreStartup(int APIVersion, const char *ConfigPath, const char *DataPath, void *Context, + void (*DebugCallback)(void *, int, const char *), void *Context2, + void (*StateCallback)(void *, m64p_core_param, int)) +{ + if (l_CoreInit) + return M64ERR_ALREADY_INIT; + + /* very first thing is to set the callback functions for debug info and state changing*/ + SetDebugCallback(DebugCallback, Context); + SetStateCallback(StateCallback, Context2); + + /* check front-end's API version */ + if ((APIVersion & 0xffff0000) != (FRONTEND_API_VERSION & 0xffff0000)) + { + DebugMessage(M64MSG_ERROR, "CoreStartup(): Front-end (API version %i.%i.%i) is incompatible with this core (API %i.%i.%i)", + VERSION_PRINTF_SPLIT(APIVersion), VERSION_PRINTF_SPLIT(FRONTEND_API_VERSION)); + return M64ERR_INCOMPATIBLE; + } + + /* set up the default (dummy) plugins */ + plugin_connect(M64PLUGIN_GFX, NULL); + plugin_connect(M64PLUGIN_AUDIO, NULL); + plugin_connect(M64PLUGIN_INPUT, NULL); + plugin_connect(M64PLUGIN_CORE, NULL); + + savestates_init(); + + /* next, start up the configuration handling code by loading and parsing the config file */ + if (ConfigInit(ConfigPath, DataPath) != M64ERR_SUCCESS) + return M64ERR_INTERNAL; + + /* set default configuration parameter values for Core */ + if (ConfigOpenSection("Core", &g_CoreConfig) != M64ERR_SUCCESS || g_CoreConfig == NULL) + return M64ERR_INTERNAL; + + if (!main_set_core_defaults()) + return M64ERR_INTERNAL; + + /* The ROM database contains MD5 hashes, goodnames, and some game-specific parameters */ + romdatabase_open(); + + workqueue_init(); + + l_CoreInit = 1; + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL CoreShutdown(void) +{ + if (!l_CoreInit) + return M64ERR_NOT_INIT; + + /* close down some core sub-systems */ + romdatabase_close(); + ConfigShutdown(); + workqueue_shutdown(); + savestates_deinit(); + + /* tell SDL to shut down */ + SDL_Quit(); + + l_CoreInit = 0; + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL CoreAttachPlugin(m64p_plugin_type PluginType, m64p_dynlib_handle PluginLibHandle) +{ + m64p_error rval; + + if (!l_CoreInit) + return M64ERR_NOT_INIT; + if (g_EmulatorRunning || !l_ROMOpen) + return M64ERR_INVALID_STATE; + + rval = plugin_connect(PluginType, PluginLibHandle); + if (rval != M64ERR_SUCCESS) + return rval; + + rval = plugin_start(PluginType); + if (rval != M64ERR_SUCCESS) + return rval; + + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL CoreDetachPlugin(m64p_plugin_type PluginType) +{ + if (!l_CoreInit) + return M64ERR_NOT_INIT; + if (g_EmulatorRunning) + return M64ERR_INVALID_STATE; + + return plugin_connect(PluginType, NULL); +} + +EXPORT m64p_error CALL CoreDoCommand(m64p_command Command, int ParamInt, void *ParamPtr) +{ + m64p_error rval; + int keysym, keymod; + + if (!l_CoreInit) + return M64ERR_NOT_INIT; + + switch(Command) + { + case M64CMD_NOP: + return M64ERR_SUCCESS; + case M64CMD_ROM_OPEN: + if (g_EmulatorRunning || l_ROMOpen) + return M64ERR_INVALID_STATE; + if (ParamPtr == NULL || ParamInt < 4096) + return M64ERR_INPUT_ASSERT; + rval = open_rom((const unsigned char *) ParamPtr, ParamInt); + if (rval == M64ERR_SUCCESS) + { + l_ROMOpen = 1; + ScreenshotRomOpen(); + cheat_init(); + } + return rval; + case M64CMD_ROM_CLOSE: + if (g_EmulatorRunning || !l_ROMOpen) + return M64ERR_INVALID_STATE; + l_ROMOpen = 0; + cheat_delete_all(); + cheat_uninit(); + return close_rom(); + case M64CMD_ROM_GET_HEADER: + if (!l_ROMOpen) + return M64ERR_INVALID_STATE; + if (ParamPtr == NULL) + return M64ERR_INPUT_ASSERT; + if (sizeof(m64p_rom_header) < ParamInt) + ParamInt = sizeof(m64p_rom_header); + memcpy(ParamPtr, &ROM_HEADER, ParamInt); + // Mupen64Plus used to keep a m64p_rom_header with a clean ROM name + // Keep returning a clean ROM name for backwards compatibility + if (ParamInt >= 0x20) + { + int size = (ParamInt >= 0x20 + 20) ? 20 : (ParamInt - 0x20); + memcpy((char *)ParamPtr + 0x20, ROM_PARAMS.headername, size); + } + return M64ERR_SUCCESS; + case M64CMD_ROM_GET_SETTINGS: + if (!l_ROMOpen) + return M64ERR_INVALID_STATE; + if (ParamPtr == NULL) + return M64ERR_INPUT_ASSERT; + if (sizeof(m64p_rom_settings) < ParamInt) + ParamInt = sizeof(m64p_rom_settings); + memcpy(ParamPtr, &ROM_SETTINGS, ParamInt); + return M64ERR_SUCCESS; + case M64CMD_EXECUTE: + if (g_EmulatorRunning || !l_ROMOpen) + return M64ERR_INVALID_STATE; + /* print out plugin-related warning messages */ + plugin_check(); + /* the main_run() function will not return until the player has quit the game */ + rval = main_run(); + return rval; + case M64CMD_STOP: + if (!g_EmulatorRunning) + return M64ERR_INVALID_STATE; + /* this stop function is asynchronous. The emulator may not terminate until later */ + return main_core_state_set(M64CORE_EMU_STATE, M64EMU_STOPPED); + case M64CMD_PAUSE: + if (!g_EmulatorRunning) + return M64ERR_INVALID_STATE; + return main_core_state_set(M64CORE_EMU_STATE, M64EMU_PAUSED); + case M64CMD_RESUME: + if (!g_EmulatorRunning) + return M64ERR_INVALID_STATE; + return main_core_state_set(M64CORE_EMU_STATE, M64EMU_RUNNING); + case M64CMD_CORE_STATE_QUERY: + if (ParamPtr == NULL) + return M64ERR_INPUT_ASSERT; + return main_core_state_query((m64p_core_param) ParamInt, (int *) ParamPtr); + case M64CMD_CORE_STATE_SET: + if (ParamPtr == NULL) + return M64ERR_INPUT_ASSERT; + return main_core_state_set((m64p_core_param) ParamInt, *((int *)ParamPtr)); + case M64CMD_STATE_LOAD: + if (!g_EmulatorRunning) + return M64ERR_INVALID_STATE; + main_state_load((char *) ParamPtr); + return M64ERR_SUCCESS; + case M64CMD_STATE_SAVE: + if (!g_EmulatorRunning) + return M64ERR_INVALID_STATE; + if (ParamPtr != NULL && (ParamInt < 1 || ParamInt > 3)) + return M64ERR_INPUT_INVALID; + main_state_save(ParamInt, (char *) ParamPtr); + return M64ERR_SUCCESS; + case M64CMD_STATE_SET_SLOT: + if (ParamInt < 0 || ParamInt > 9) + return M64ERR_INPUT_INVALID; + return main_core_state_set(M64CORE_SAVESTATE_SLOT, ParamInt); + case M64CMD_SEND_SDL_KEYDOWN: + if (!g_EmulatorRunning) + return M64ERR_INVALID_STATE; + keysym = ParamInt & 0xffff; + keymod = (ParamInt >> 16) & 0xffff; + event_sdl_keydown(keysym, keymod); + return M64ERR_SUCCESS; + case M64CMD_SEND_SDL_KEYUP: + if (!g_EmulatorRunning) + return M64ERR_INVALID_STATE; + keysym = ParamInt & 0xffff; + keymod = (ParamInt >> 16) & 0xffff; + event_sdl_keyup(keysym, keymod); + return M64ERR_SUCCESS; + case M64CMD_SET_FRAME_CALLBACK: + g_FrameCallback = (m64p_frame_callback) ParamPtr; + return M64ERR_SUCCESS; + case M64CMD_TAKE_NEXT_SCREENSHOT: + if (!g_EmulatorRunning) + return M64ERR_INVALID_STATE; + main_take_next_screenshot(); + return M64ERR_SUCCESS; + case M64CMD_READ_SCREEN: + if (!g_EmulatorRunning) + return M64ERR_INVALID_STATE; + if (ParamPtr == NULL) + return M64ERR_INPUT_ASSERT; + if (ParamInt < 0 || ParamInt > 1) + return M64ERR_INPUT_INVALID; + return main_read_screen(ParamPtr, ParamInt); + case M64CMD_RESET: + if (!g_EmulatorRunning) + return M64ERR_INVALID_STATE; + if (ParamInt < 0 || ParamInt > 1) + return M64ERR_INPUT_INVALID; + return main_reset(ParamInt); + case M64CMD_ADVANCE_FRAME: + if (!g_EmulatorRunning) + return M64ERR_INVALID_STATE; + main_advance_one(); + return M64ERR_SUCCESS; + default: + return M64ERR_INPUT_INVALID; + } + + return M64ERR_INTERNAL; +} + +EXPORT m64p_error CALL CoreOverrideVidExt(m64p_video_extension_functions *VideoFunctionStruct) +{ + if (!l_CoreInit) + return M64ERR_NOT_INIT; + + return OverrideVideoFunctions(VideoFunctionStruct); /* in vidext.c */ +} + +EXPORT m64p_error CALL CoreAddCheat(const char *CheatName, m64p_cheat_code *CodeList, int NumCodes) +{ + if (!l_CoreInit) + return M64ERR_NOT_INIT; + if (CheatName == NULL || CodeList == NULL) + return M64ERR_INPUT_ASSERT; + if (strlen(CheatName) < 1 || NumCodes < 1) + return M64ERR_INPUT_INVALID; + + if (cheat_add_new(CheatName, CodeList, NumCodes)) + return M64ERR_SUCCESS; + + return M64ERR_INPUT_INVALID; +} + +EXPORT m64p_error CALL CoreCheatEnabled(const char *CheatName, int Enabled) +{ + if (!l_CoreInit) + return M64ERR_NOT_INIT; + if (CheatName == NULL) + return M64ERR_INPUT_ASSERT; + + if (cheat_set_enabled(CheatName, Enabled)) + return M64ERR_SUCCESS; + + return M64ERR_INPUT_INVALID; +} + +EXPORT m64p_error CALL CoreGetRomSettings(m64p_rom_settings *RomSettings, int RomSettingsLength, int Crc1, int Crc2) +{ + romdatabase_entry* entry; + int i; + + if (!l_CoreInit) + return M64ERR_NOT_INIT; + if (RomSettings == NULL) + return M64ERR_INPUT_ASSERT; + if (RomSettingsLength < sizeof(m64p_rom_settings)) + return M64ERR_INPUT_INVALID; + + /* Look up this ROM in the .ini file and fill in goodname, etc */ + entry = ini_search_by_crc(Crc1, Crc2); + if (entry == NULL) + return M64ERR_INPUT_NOT_FOUND; + + strncpy(RomSettings->goodname, entry->goodname, 255); + RomSettings->goodname[255] = '\0'; + for (i = 0; i < 16; i++) + sprintf(RomSettings->MD5 + i*2, "%02X", entry->md5[i]); + RomSettings->MD5[32] = '\0'; + RomSettings->savetype = entry->savetype; + RomSettings->status = entry->status; + RomSettings->players = entry->players; + RomSettings->rumble = entry->rumble; + + return M64ERR_SUCCESS; +} + + diff --git a/libmupen64plus/mupen64plus-core/src/api/m64p_common.h b/libmupen64plus/mupen64plus-core/src/api/m64p_common.h new file mode 100644 index 0000000000..d6f60f990a --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/api/m64p_common.h @@ -0,0 +1,90 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - m64p_common.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This header file defines typedefs for function pointers to common Core + * and plugin functions, for use by the front-end and plugin modules to attach + * to the dynamic libraries. + */ + +#if !defined(M64P_COMMON_H) +#define M64P_COMMON_H + +#include "m64p_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* PluginGetVersion() + * + * This function retrieves version information from a library. This + * function is the same for the core library and the plugins. + */ +typedef m64p_error (*ptr_PluginGetVersion)(m64p_plugin_type *, int *, int *, const char **, int *); +#if defined(M64P_PLUGIN_PROTOTYPES) || defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL PluginGetVersion(m64p_plugin_type *, int *, int *, const char **, int *); +#endif + +/* CoreGetAPIVersions() + * + * This function retrieves API version information from the core. + */ +typedef m64p_error (*ptr_CoreGetAPIVersions)(int *, int *, int *, int *); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL CoreGetAPIVersions(int *, int *, int *, int *); +#endif + +/* CoreErrorMessage() + * + * This function returns a pointer to a NULL-terminated string giving a + * human-readable description of the error. +*/ +typedef const char * (*ptr_CoreErrorMessage)(m64p_error); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT const char * CALL CoreErrorMessage(m64p_error); +#endif + +/* PluginStartup() + * + * This function initializes a plugin for use by allocating memory, creating + * data structures, and loading the configuration data. +*/ +typedef m64p_error (*ptr_PluginStartup)(m64p_dynlib_handle, void *, void (*)(void *, int, const char *)); +#if defined(M64P_PLUGIN_PROTOTYPES) || defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle, void *, void (*)(void *, int, const char *)); +#endif + +/* PluginShutdown() + * + * This function destroys data structures and releases memory allocated by + * the plugin library. +*/ +typedef m64p_error (*ptr_PluginShutdown)(void); +#if defined(M64P_PLUGIN_PROTOTYPES) || defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL PluginShutdown(void); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* #define M64P_COMMON_H */ + diff --git a/libmupen64plus/mupen64plus-core/src/api/m64p_config.h b/libmupen64plus/mupen64plus-core/src/api/m64p_config.h new file mode 100644 index 0000000000..ad2a418c79 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/api/m64p_config.h @@ -0,0 +1,242 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - m64p_config.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This header file defines typedefs for function pointers to the Core's + * configuration handling functions. + */ + +#if !defined(M64P_CONFIG_H) +#define M64P_CONFIG_H + +#include "m64p_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* ConfigListSections() + * + * This function is called to enumerate the list of Sections in the Mupen64Plus + * configuration file. It is expected that there will be a section named "Core" + * for core-specific configuration data, "Graphics" for common graphics options, + * and one or more sections for each plugin library. + */ +typedef m64p_error (*ptr_ConfigListSections)(void *, void (*)(void *, const char *)); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL ConfigListSections(void *, void (*)(void *, const char *)); +#endif + +/* ConfigOpenSection() + * + * This function is used to give a configuration section handle to the front-end + * which may be used to read or write configuration parameter values in a given + * section of the configuration file. + */ +typedef m64p_error (*ptr_ConfigOpenSection)(const char *, m64p_handle *); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL ConfigOpenSection(const char *, m64p_handle *); +#endif + +/* ConfigListParameters() + * + * This function is called to enumerate the list of Parameters in a given + * Section of the Mupen64Plus configuration file. + */ +typedef m64p_error (*ptr_ConfigListParameters)(m64p_handle, void *, void (*)(void *, const char *, m64p_type)); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL ConfigListParameters(m64p_handle, void *, void (*)(void *, const char *, m64p_type)); +#endif + +/* ConfigSaveFile() + * + * This function saves the entire current Mupen64Plus configuration to disk. + */ +typedef m64p_error (*ptr_ConfigSaveFile)(void); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL ConfigSaveFile(void); +#endif + +/* ConfigSaveSection() + * + * This function saves one section of the current Mupen64Plus configuration to disk. + */ +typedef m64p_error (*ptr_ConfigSaveSection)(const char *); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL ConfigSaveSection(const char *); +#endif + +/* ConfigHasUnsavedChanges() + * + * This function determines if a given Section (or all sections) of the Mupen64Plus Core configuration file has been modified since it was last saved or loaded. + */ +typedef int (*ptr_ConfigHasUnsavedChanges)(const char *); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT int CALL ConfigHasUnsavedChanges(const char *); +#endif + +/* ConfigDeleteSection() + * + * This function deletes a section from the Mupen64Plus configuration data. + */ +typedef m64p_error (*ptr_ConfigDeleteSection)(const char *SectionName); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL ConfigDeleteSection(const char *SectionName); +#endif + +/* ConfigRevertChanges() + * + * This function reverts changes previously made to one section of the configuration file, so that it will match with the configuration at the last time that it was loaded from or saved to disk. + */ +typedef m64p_error (*ptr_ConfigRevertChanges)(const char *SectionName); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL ConfigRevertChanges(const char *SectionName); +#endif + +/* ConfigSetParameter() + * + * This function sets the value of one of the emulator's configuration + * parameters. + */ +typedef m64p_error (*ptr_ConfigSetParameter)(m64p_handle, const char *, m64p_type, const void *); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL ConfigSetParameter(m64p_handle, const char *, m64p_type, const void *); +#endif + +/* ConfigGetParameter() + * + * This function retrieves the value of one of the emulator's parameters. + */ +typedef m64p_error (*ptr_ConfigGetParameter)(m64p_handle, const char *, m64p_type, void *, int); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL ConfigGetParameter(m64p_handle, const char *, m64p_type, void *, int); +#endif + +/* ConfigGetParameterType() + * + * This function retrieves the type of one of the emulator's parameters. + */ +typedef m64p_error (*ptr_ConfigGetParameterType)(m64p_handle, const char *, m64p_type *); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL ConfigGetParameterType(m64p_handle, const char *, m64p_type *); +#endif + +/* ConfigGetParameterHelp() + * + * This function retrieves the help information about one of the emulator's + * parameters. + */ +typedef const char * (*ptr_ConfigGetParameterHelp)(m64p_handle, const char *); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT const char * CALL ConfigGetParameterHelp(m64p_handle, const char *); +#endif + +/* ConfigSetDefault***() + * + * These functions are used to set the value of a configuration parameter if it + * is not already present in the configuration file. This may happen if a new + * user runs the emulator, or an upgraded module uses a new parameter, or the + * user deletes his or her configuration file. If the parameter is already + * present in the given section of the configuration file, then no action will + * be taken and this function will return successfully. + */ +typedef m64p_error (*ptr_ConfigSetDefaultInt)(m64p_handle, const char *, int, const char *); +typedef m64p_error (*ptr_ConfigSetDefaultFloat)(m64p_handle, const char *, float, const char *); +typedef m64p_error (*ptr_ConfigSetDefaultBool)(m64p_handle, const char *, int, const char *); +typedef m64p_error (*ptr_ConfigSetDefaultString)(m64p_handle, const char *, const char *, const char *); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL ConfigSetDefaultInt(m64p_handle, const char *, int, const char *); +EXPORT m64p_error CALL ConfigSetDefaultFloat(m64p_handle, const char *, float, const char *); +EXPORT m64p_error CALL ConfigSetDefaultBool(m64p_handle, const char *, int, const char *); +EXPORT m64p_error CALL ConfigSetDefaultString(m64p_handle, const char *, const char *, const char *); +#endif + +/* ConfigGetParam***() + * + * These functions retrieve the value of one of the emulator's parameters in + * the given section, and return the value directly to the calling function. If + * an errors occurs (such as an invalid Section handle, or invalid + * configuration parameter name), then an error will be sent to the front-end + * via the DebugCallback() function, and either a 0 (zero) or an empty string + * will be returned. + */ +typedef int (*ptr_ConfigGetParamInt)(m64p_handle, const char *); +typedef float (*ptr_ConfigGetParamFloat)(m64p_handle, const char *); +typedef int (*ptr_ConfigGetParamBool)(m64p_handle, const char *); +typedef const char * (*ptr_ConfigGetParamString)(m64p_handle, const char *); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT int CALL ConfigGetParamInt(m64p_handle, const char *); +EXPORT float CALL ConfigGetParamFloat(m64p_handle, const char *); +EXPORT int CALL ConfigGetParamBool(m64p_handle, const char *); +EXPORT const char * CALL ConfigGetParamString(m64p_handle, const char *); +#endif + +/* ConfigGetSharedDataFilepath() + * + * This function is provided to allow a plugin to retrieve a full pathname to a + * given shared data file. This type of file is intended to be shared among + * multiple users on a system, so it is likely to be read-only. + */ +typedef const char * (*ptr_ConfigGetSharedDataFilepath)(const char *); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT const char * CALL ConfigGetSharedDataFilepath(const char *); +#endif + +/* ConfigGetUserConfigPath() + * + * This function may be used by the plugins or front-end to get a path to the + * directory for storing user-specific configuration files. This will be the + * directory where "mupen64plus.cfg" is located. + */ +typedef const char * (*ptr_ConfigGetUserConfigPath)(void); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT const char * CALL ConfigGetUserConfigPath(void); +#endif + +/* ConfigGetUserDataPath() + * + * This function may be used by the plugins or front-end to get a path to the + * directory for storing user-specific data files. This may be used to store + * files such as screenshots, saved game states, or hi-res textures. + */ +typedef const char * (*ptr_ConfigGetUserDataPath)(void); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT const char * CALL ConfigGetUserDataPath(void); +#endif + +/* ConfigGetUserCachePath() + * + * This function may be used by the plugins or front-end to get a path to the + * directory for storing cached user-specific data files. Files in this + * directory may be deleted by the user to save space, so critical information + * should not be stored here. This directory may be used to store files such + * as the ROM browser cache. + */ +typedef const char * (*ptr_ConfigGetUserCachePath)(void); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT const char * CALL ConfigGetUserCachePath(void); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* #define M64P_CONFIG_H */ + diff --git a/libmupen64plus/mupen64plus-core/src/api/m64p_debugger.h b/libmupen64plus/mupen64plus-core/src/api/m64p_debugger.h new file mode 100644 index 0000000000..8ca00e0ff7 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/api/m64p_debugger.h @@ -0,0 +1,202 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - m64p_debugger.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This header file defines typedefs for function pointers to Core Debugger + * functions. + */ + +#if !defined(M64P_DEBUGGER_H) +#define M64P_DEBUGGER_H + +#include "m64p_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* DebugSetCallbacks() + * + * This function is called by the front-end to supply debugger callback + * function pointers. If debugger is enabled and then later disabled within the + * UI, this function may be called with NULL pointers in order to disable the + * callbacks. + */ +typedef m64p_error (*ptr_DebugSetCallbacks)(void (*)(void), void (*)(unsigned int), void (*)(void)); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL DebugSetCallbacks(void (*)(void), void (*)(unsigned int), void (*)(void)); +#endif + +/* DebugSetCoreCompare() + * + * This function is called by the front-end to supply callback function pointers + * for the Core Comparison feature. + */ +typedef m64p_error (*ptr_DebugSetCoreCompare)(void (*)(unsigned int), void (*)(int, void *)); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL DebugSetCoreCompare(void (*)(unsigned int), void (*)(int, void *)); +#endif + +/* DebugSetRunState() + * + * This function sets the run state of the R4300 CPU emulator. + */ +typedef m64p_error (*ptr_DebugSetRunState)(int); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL DebugSetRunState(int); +#endif + +/* DebugGetState() + * + * This function reads and returns a debugger state variable, which are + * enumerated in m64p_types.h. + */ +typedef int (*ptr_DebugGetState)(m64p_dbg_state); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT int CALL DebugGetState(m64p_dbg_state); +#endif + +/* DebugStep() + * + * This function signals the debugger to advance one instruction when in the + * stepping mode. + */ +typedef m64p_error (*ptr_DebugStep)(void); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL DebugStep(void); +#endif + +/* DebugDecodeOp() + * + * This is a helper function for the debugger front-end. This instruction takes + * a PC value and an R4300 instruction opcode and writes the disassembled + * instruction mnemonic and arguments into character buffers. This is intended + * to be used to display disassembled code. + */ +typedef void (*ptr_DebugDecodeOp)(unsigned int, char *, char *, int); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT void CALL DebugDecodeOp(unsigned int, char *, char *, int); +#endif + +/* DebugMemGetRecompInfo() + * + * This function is used by the front-end to retrieve disassembly information + * about recompiled code. For example, the dynamic recompiler may take a single + * R4300 instruction and compile it into 10 x86 instructions. This function may + * then be used to retrieve the disassembled code of the 10 x86 instructions. + */ +typedef void * (*ptr_DebugMemGetRecompInfo)(m64p_dbg_mem_info, unsigned int, int); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT void * CALL DebugMemGetRecompInfo(m64p_dbg_mem_info, unsigned int, int); +#endif + +/* DebugMemGetMemInfo() + * + * This function returns an integer value regarding the memory location address, + * corresponding to the information requested by mem_info_type, which is a type + * enumerated in m64p_types.h. + */ +typedef int (*ptr_DebugMemGetMemInfo)(m64p_dbg_mem_info, unsigned int); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT int CALL DebugMemGetMemInfo(m64p_dbg_mem_info, unsigned int); +#endif + +/* DebugMemGetPointer() + * + * This function returns a memory pointer (in x86 memory space) to a block of + * emulated N64 memory. This may be used to retrieve a pointer to a special N64 + * block (such as the serial, video, or audio registers) or the RDRAM. + */ +typedef void * (*ptr_DebugMemGetPointer)(m64p_dbg_memptr_type); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT void * CALL DebugMemGetPointer(m64p_dbg_memptr_type); +#endif + +/* DebugMemRead**() + * + * These functions retrieve a value from the emulated N64 memory. The returned + * value will be correctly byte-swapped for the host architecture. + */ +typedef unsigned long long (*ptr_DebugMemRead64)(unsigned int); +typedef unsigned int (*ptr_DebugMemRead32)(unsigned int); +typedef unsigned short (*ptr_DebugMemRead16)(unsigned int); +typedef unsigned char (*ptr_DebugMemRead8)(unsigned int); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT unsigned long long CALL DebugMemRead64(unsigned int); +EXPORT unsigned int CALL DebugMemRead32(unsigned int); +EXPORT unsigned short CALL DebugMemRead16(unsigned int); +EXPORT unsigned char CALL DebugMemRead8(unsigned int); +#endif + +/* DebugMemWrite**() + * + * These functions write a value into the emulated N64 memory. The given value + * will be correctly byte-swapped before storage. + */ +typedef void (*ptr_DebugMemWrite64)(unsigned int, unsigned long long); +typedef void (*ptr_DebugMemWrite32)(unsigned int, unsigned int); +typedef void (*ptr_DebugMemWrite16)(unsigned int, unsigned short); +typedef void (*ptr_DebugMemWrite8)(unsigned int, unsigned char); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT void CALL DebugMemWrite64(unsigned int, unsigned long long); +EXPORT void CALL DebugMemWrite32(unsigned int, unsigned int); +EXPORT void CALL DebugMemWrite16(unsigned int, unsigned short); +EXPORT void CALL DebugMemWrite8(unsigned int, unsigned char); +#endif + +/* DebugGetCPUDataPtr() + * + * This function returns a memory pointer (in x86 memory space) to a specific + * register in the emulated R4300 CPU. + */ +typedef void * (*ptr_DebugGetCPUDataPtr)(m64p_dbg_cpu_data); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT void * CALL DebugGetCPUDataPtr(m64p_dbg_cpu_data); +#endif + +/* DebugBreakpointLookup() + * + * This function searches through all current breakpoints in the debugger to + * find one that matches the given input parameters. If a matching breakpoint + * is found, the index number is returned. If no breakpoints are found, -1 is + * returned. + */ +typedef int (*ptr_DebugBreakpointLookup)(unsigned int, unsigned int, unsigned int); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT int CALL DebugBreakpointLookup(unsigned int, unsigned int, unsigned int); +#endif + +/* DebugBreakpointCommand() + * + * This function is used to process common breakpoint commands, such as adding, + * removing, or searching the breakpoints. The meanings of the index and ptr + * input parameters vary by command. + */ +typedef int (*ptr_DebugBreakpointCommand)(m64p_dbg_bkp_command, unsigned int, void *); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT int CALL DebugBreakpointCommand(m64p_dbg_bkp_command, unsigned int, void *); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* #define M64P_DEBUGGER_H */ + diff --git a/libmupen64plus/mupen64plus-core/src/api/m64p_frontend.h b/libmupen64plus/mupen64plus-core/src/api/m64p_frontend.h new file mode 100644 index 0000000000..61a5cac418 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/api/m64p_frontend.h @@ -0,0 +1,141 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - m64p_frontend.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This header file defines typedefs for function pointers to Core functions + * designed for use by the front-end user interface. + */ + +#if !defined(M64P_FRONTEND_H) +#define M64P_FRONTEND_H + +#include "m64p_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/* pointer types to the callback functions in the front-end application */ +typedef void (*ptr_DebugCallback)(void *Context, int level, const char *message); +typedef void (*ptr_StateCallback)(void *Context, m64p_core_param param_type, int new_value); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT void CALL DebugCallback(void *Context, int level, const char *message); +EXPORT void CALL StateCallback(void *Context, m64p_core_param param_type, int new_value); +#endif + +/* CoreStartup() + * + * This function initializes libmupen64plus for use by allocating memory, + * creating data structures, and loading the configuration file. + */ +typedef m64p_error (*ptr_CoreStartup)(int, const char *, const char *, void *, ptr_DebugCallback, void *, ptr_StateCallback); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL CoreStartup(int, const char *, const char *, void *, ptr_DebugCallback, void *, ptr_StateCallback); +#endif + +/* CoreShutdown() + * + * This function saves the configuration file, then destroys data structures + * and releases memory allocated by the core library. + */ +typedef m64p_error (*ptr_CoreShutdown)(void); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL CoreShutdown(void); +#endif + +/* CoreAttachPlugin() + * + * This function attaches the given plugin to the emulator core. There can only + * be one plugin of each type attached to the core at any given time. + */ +typedef m64p_error (*ptr_CoreAttachPlugin)(m64p_plugin_type, m64p_dynlib_handle); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL CoreAttachPlugin(m64p_plugin_type, m64p_dynlib_handle); +#endif + +/* CoreDetachPlugin() + * + * This function detaches the given plugin from the emulator core, and re-attaches + * the 'dummy' plugin functions. + */ +typedef m64p_error (*ptr_CoreDetachPlugin)(m64p_plugin_type); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL CoreDetachPlugin(m64p_plugin_type); +#endif + +/* CoreDoCommand() + * + * This function sends a command to the emulator core. + */ +typedef m64p_error (*ptr_CoreDoCommand)(m64p_command, int, void *); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL CoreDoCommand(m64p_command, int, void *); +#endif + +/* CoreOverrideVidExt() + * + * This function overrides the core's internal SDL-based OpenGL functions. This + * override functionality allows a front-end to define its own video extension + * functions to be used instead of the SDL functions. If any of the function + * pointers in the structure are NULL, the override function will be disabled + * and the core's internal SDL functions will be used. + */ +typedef m64p_error (*ptr_CoreOverrideVidExt)(m64p_video_extension_functions *); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL CoreOverrideVidExt(m64p_video_extension_functions *); +#endif + +/* CoreAddCheat() + * + * This function will add a Cheat Function to a list of currently active cheats + * which are applied to the open ROM. + */ +typedef m64p_error (*ptr_CoreAddCheat)(const char *, m64p_cheat_code *, int); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL CoreAddCheat(const char *, m64p_cheat_code *, int); +#endif + +/* CoreCheatEnabled() + * + * This function will enable or disable a Cheat Function which is in the list of + * currently active cheats. + */ +typedef m64p_error (*ptr_CoreCheatEnabled)(const char *, int); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL CoreCheatEnabled(const char *, int); +#endif + +/* CoreGetRomSettings() + * + * This function will retrieve the ROM settings from the mupen64plus INI file for + * the ROM image corresponding to the given CRC values. + */ +typedef m64p_error (*ptr_CoreGetRomSettings)(m64p_rom_settings *, int, int, int); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL CoreGetRomSettings(m64p_rom_settings *, int, int, int); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* #define M64P_FRONTEND_H */ + diff --git a/libmupen64plus/mupen64plus-core/src/api/m64p_plugin.h b/libmupen64plus/mupen64plus-core/src/api/m64p_plugin.h new file mode 100644 index 0000000000..398cfb54f9 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/api/m64p_plugin.h @@ -0,0 +1,269 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - m64p_plugin.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#if !defined(M64P_PLUGIN_H) +#define M64P_PLUGIN_H + +#include "m64p_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*** Controller plugin's ****/ +#define PLUGIN_NONE 1 +#define PLUGIN_MEMPAK 2 +#define PLUGIN_RUMBLE_PAK 3 /* not implemented for non raw data */ +#define PLUGIN_TRANSFER_PAK 4 /* not implemented for non raw data */ +#define PLUGIN_RAW 5 /* the controller plugin is passed in raw data */ + +/***** Structures *****/ +typedef struct { + unsigned char * RDRAM; + unsigned char * DMEM; + unsigned char * IMEM; + + unsigned int * MI_INTR_REG; + + unsigned int * SP_MEM_ADDR_REG; + unsigned int * SP_DRAM_ADDR_REG; + unsigned int * SP_RD_LEN_REG; + unsigned int * SP_WR_LEN_REG; + unsigned int * SP_STATUS_REG; + unsigned int * SP_DMA_FULL_REG; + unsigned int * SP_DMA_BUSY_REG; + unsigned int * SP_PC_REG; + unsigned int * SP_SEMAPHORE_REG; + + unsigned int * DPC_START_REG; + unsigned int * DPC_END_REG; + unsigned int * DPC_CURRENT_REG; + unsigned int * DPC_STATUS_REG; + unsigned int * DPC_CLOCK_REG; + unsigned int * DPC_BUFBUSY_REG; + unsigned int * DPC_PIPEBUSY_REG; + unsigned int * DPC_TMEM_REG; + + void (*CheckInterrupts)(void); + void (*ProcessDlistList)(void); + void (*ProcessAlistList)(void); + void (*ProcessRdpList)(void); + void (*ShowCFB)(void); +} RSP_INFO; + +typedef struct { + unsigned char * HEADER; /* This is the rom header (first 40h bytes of the rom) */ + unsigned char * RDRAM; + unsigned char * DMEM; + unsigned char * IMEM; + + unsigned int * MI_INTR_REG; + + unsigned int * DPC_START_REG; + unsigned int * DPC_END_REG; + unsigned int * DPC_CURRENT_REG; + unsigned int * DPC_STATUS_REG; + unsigned int * DPC_CLOCK_REG; + unsigned int * DPC_BUFBUSY_REG; + unsigned int * DPC_PIPEBUSY_REG; + unsigned int * DPC_TMEM_REG; + + unsigned int * VI_STATUS_REG; + unsigned int * VI_ORIGIN_REG; + unsigned int * VI_WIDTH_REG; + unsigned int * VI_INTR_REG; + unsigned int * VI_V_CURRENT_LINE_REG; + unsigned int * VI_TIMING_REG; + unsigned int * VI_V_SYNC_REG; + unsigned int * VI_H_SYNC_REG; + unsigned int * VI_LEAP_REG; + unsigned int * VI_H_START_REG; + unsigned int * VI_V_START_REG; + unsigned int * VI_V_BURST_REG; + unsigned int * VI_X_SCALE_REG; + unsigned int * VI_Y_SCALE_REG; + + void (*CheckInterrupts)(void); +} GFX_INFO; + +typedef struct { + unsigned char * RDRAM; + unsigned char * DMEM; + unsigned char * IMEM; + + unsigned int * MI_INTR_REG; + + unsigned int * AI_DRAM_ADDR_REG; + unsigned int * AI_LEN_REG; + unsigned int * AI_CONTROL_REG; + unsigned int * AI_STATUS_REG; + unsigned int * AI_DACRATE_REG; + unsigned int * AI_BITRATE_REG; + + void (*CheckInterrupts)(void); +} AUDIO_INFO; + +typedef struct { + int Present; + int RawData; + int Plugin; +} CONTROL; + +typedef union { + unsigned int Value; + struct { + unsigned R_DPAD : 1; + unsigned L_DPAD : 1; + unsigned D_DPAD : 1; + unsigned U_DPAD : 1; + unsigned START_BUTTON : 1; + unsigned Z_TRIG : 1; + unsigned B_BUTTON : 1; + unsigned A_BUTTON : 1; + + unsigned R_CBUTTON : 1; + unsigned L_CBUTTON : 1; + unsigned D_CBUTTON : 1; + unsigned U_CBUTTON : 1; + unsigned R_TRIG : 1; + unsigned L_TRIG : 1; + unsigned Reserved1 : 1; + unsigned Reserved2 : 1; + + signed X_AXIS : 8; + signed Y_AXIS : 8; + }; +} BUTTONS; + +typedef struct { + CONTROL *Controls; /* A pointer to an array of 4 controllers .. eg: + CONTROL Controls[4]; */ +} CONTROL_INFO; + +/* common plugin function pointer types */ +typedef void (*ptr_RomClosed)(void); +typedef int (*ptr_RomOpen)(void); +#if defined(M64P_PLUGIN_PROTOTYPES) +EXPORT int CALL RomOpen(void); +EXPORT void CALL RomClosed(void); +#endif + +/* video plugin function pointer types */ +typedef void (*ptr_ChangeWindow)(void); +typedef int (*ptr_InitiateGFX)(GFX_INFO Gfx_Info); +typedef void (*ptr_MoveScreen)(int x, int y); +typedef void (*ptr_ProcessDList)(void); +typedef void (*ptr_ProcessRDPList)(void); +typedef void (*ptr_ShowCFB)(void); +typedef void (*ptr_UpdateScreen)(void); +typedef void (*ptr_ViStatusChanged)(void); +typedef void (*ptr_ViWidthChanged)(void); +typedef void (*ptr_ReadScreen2)(void *dest, int *width, int *height, int front); +typedef void (*ptr_SetRenderingCallback)(void (*callback)(int)); +#if defined(M64P_PLUGIN_PROTOTYPES) +EXPORT void CALL ChangeWindow(void); +EXPORT int CALL InitiateGFX(GFX_INFO Gfx_Info); +EXPORT void CALL MoveScreen(int x, int y); +EXPORT void CALL ProcessDList(void); +EXPORT void CALL ProcessRDPList(void); +EXPORT void CALL ShowCFB(void); +EXPORT void CALL UpdateScreen(void); +EXPORT void CALL ViStatusChanged(void); +EXPORT void CALL ViWidthChanged(void); +EXPORT void CALL ReadScreen2(void *dest, int *width, int *height, int front); +EXPORT void CALL SetRenderingCallback(void (*callback)(int)); +#endif + +/* frame buffer plugin spec extension */ +typedef struct +{ + unsigned int addr; + unsigned int size; + unsigned int width; + unsigned int height; +} FrameBufferInfo; +typedef void (*ptr_FBRead)(unsigned int addr); +typedef void (*ptr_FBWrite)(unsigned int addr, unsigned int size); +typedef void (*ptr_FBGetFrameBufferInfo)(void *p); +#if defined(M64P_PLUGIN_PROTOTYPES) +EXPORT void CALL FBRead(unsigned int addr); +EXPORT void CALL FBWrite(unsigned int addr, unsigned int size); +EXPORT void CALL FBGetFrameBufferInfo(void *p); +#endif + +/* audio plugin function pointers */ +typedef void (*ptr_AiDacrateChanged)(int SystemType); +typedef void (*ptr_AiLenChanged)(void); +typedef int (*ptr_InitiateAudio)(AUDIO_INFO Audio_Info); +typedef void (*ptr_ProcessAList)(void); +typedef void (*ptr_SetSpeedFactor)(int percent); +typedef void (*ptr_VolumeUp)(void); +typedef void (*ptr_VolumeDown)(void); +typedef int (*ptr_VolumeGetLevel)(void); +typedef void (*ptr_VolumeSetLevel)(int level); +typedef void (*ptr_VolumeMute)(void); +typedef const char * (*ptr_VolumeGetString)(void); +#if defined(M64P_PLUGIN_PROTOTYPES) +EXPORT void CALL AiDacrateChanged(int SystemType); +EXPORT void CALL AiLenChanged(void); +EXPORT int CALL InitiateAudio(AUDIO_INFO Audio_Info); +EXPORT void CALL ProcessAList(void); +EXPORT void CALL SetSpeedFactor(int percent); +EXPORT void CALL VolumeUp(void); +EXPORT void CALL VolumeDown(void); +EXPORT int CALL VolumeGetLevel(void); +EXPORT void CALL VolumeSetLevel(int level); +EXPORT void CALL VolumeMute(void); +EXPORT const char * CALL VolumeGetString(void); +#endif + +/* input plugin function pointers */ +typedef void (*ptr_ControllerCommand)(int Control, unsigned char *Command); +typedef void (*ptr_GetKeys)(int Control, BUTTONS *Keys); +typedef void (*ptr_InitiateControllers)(CONTROL_INFO ControlInfo); +typedef void (*ptr_ReadController)(int Control, unsigned char *Command); +typedef void (*ptr_SDL_KeyDown)(int keymod, int keysym); +typedef void (*ptr_SDL_KeyUp)(int keymod, int keysym); +#if defined(M64P_PLUGIN_PROTOTYPES) +EXPORT void CALL ControllerCommand(int Control, unsigned char *Command); +EXPORT void CALL GetKeys(int Control, BUTTONS *Keys); +EXPORT void CALL InitiateControllers(CONTROL_INFO ControlInfo); +EXPORT void CALL ReadController(int Control, unsigned char *Command); +EXPORT void CALL SDL_KeyDown(int keymod, int keysym); +EXPORT void CALL SDL_KeyUp(int keymod, int keysym); +#endif + +/* RSP plugin function pointers */ +typedef unsigned int (*ptr_DoRspCycles)(unsigned int Cycles); +typedef void (*ptr_InitiateRSP)(RSP_INFO Rsp_Info, unsigned int *CycleCount); +#if defined(M64P_PLUGIN_PROTOTYPES) +EXPORT unsigned int CALL DoRspCycles(unsigned int Cycles); +EXPORT void CALL InitiateRSP(RSP_INFO Rsp_Info, unsigned int *CycleCount); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* M64P_PLUGIN_H */ + + diff --git a/libmupen64plus/mupen64plus-core/src/api/m64p_types.h b/libmupen64plus/mupen64plus-core/src/api/m64p_types.h new file mode 100644 index 0000000000..07fe3b83b7 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/api/m64p_types.h @@ -0,0 +1,346 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - m64p_types.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2012 CasualJames * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#if !defined(M64P_TYPES_H) +#define M64P_TYPES_H + +/* ----------------------------------------- */ +/* Platform-specific stuff */ +/* ----------------------------------------- */ + +/* necessary headers */ +#if defined(WIN32) + #include +#endif + +/* DLL handles and function declaration specifiers */ +#if defined(WIN32) + #define IMPORT extern "C" __declspec(dllimport) + #define EXPORT __declspec(dllexport) + #define CALL __cdecl + typedef HMODULE m64p_dynlib_handle; +#else + #define IMPORT extern "C" + #define EXPORT __attribute__((visibility("default"))) + #define CALL + typedef void * m64p_dynlib_handle; +#endif + +/* ----------------------------------------- */ +/* Structures and Types for Core library API */ +/* ----------------------------------------- */ + +typedef void * m64p_handle; + +typedef void (*m64p_frame_callback)(unsigned int FrameIndex); +typedef void (*m64p_input_callback)(void); +typedef void (*m64p_audio_callback)(void); +typedef void (*m64p_vi_callback)(void); + +typedef enum { + M64TYPE_INT = 1, + M64TYPE_FLOAT, + M64TYPE_BOOL, + M64TYPE_STRING +} m64p_type; + +typedef enum { + M64MSG_ERROR = 1, + M64MSG_WARNING, + M64MSG_INFO, + M64MSG_STATUS, + M64MSG_VERBOSE +} m64p_msg_level; + +typedef enum { + M64ERR_SUCCESS = 0, + M64ERR_NOT_INIT, /* Function is disallowed before InitMupen64Plus() is called */ + M64ERR_ALREADY_INIT, /* InitMupen64Plus() was called twice */ + M64ERR_INCOMPATIBLE, /* API versions between components are incompatible */ + M64ERR_INPUT_ASSERT, /* Invalid parameters for function call, such as ParamValue=NULL for GetCoreParameter() */ + M64ERR_INPUT_INVALID, /* Invalid input data, such as ParamValue="maybe" for SetCoreParameter() to set a BOOL-type value */ + M64ERR_INPUT_NOT_FOUND, /* The input parameter(s) specified a particular item which was not found */ + M64ERR_NO_MEMORY, /* Memory allocation failed */ + M64ERR_FILES, /* Error opening, creating, reading, or writing to a file */ + M64ERR_INTERNAL, /* Internal error (bug) */ + M64ERR_INVALID_STATE, /* Current program state does not allow operation */ + M64ERR_PLUGIN_FAIL, /* A plugin function returned a fatal error */ + M64ERR_SYSTEM_FAIL, /* A system function call, such as an SDL or file operation, failed */ + M64ERR_UNSUPPORTED, /* Function call is not supported (ie, core not built with debugger) */ + M64ERR_WRONG_TYPE /* A given input type parameter cannot be used for desired operation */ +} m64p_error; + +typedef enum { + M64CAPS_DYNAREC = 1, + M64CAPS_DEBUGGER = 2, + M64CAPS_CORE_COMPARE = 4 +} m64p_core_caps; + +typedef enum { + M64PLUGIN_NULL = 0, + M64PLUGIN_RSP = 1, + M64PLUGIN_GFX, + M64PLUGIN_AUDIO, + M64PLUGIN_INPUT, + M64PLUGIN_CORE +} m64p_plugin_type; + +typedef enum { + M64EMU_STOPPED = 1, + M64EMU_RUNNING, + M64EMU_PAUSED +} m64p_emu_state; + +typedef enum { + M64VIDEO_NONE = 1, + M64VIDEO_WINDOWED, + M64VIDEO_FULLSCREEN +} m64p_video_mode; + +typedef enum { + M64CORE_EMU_STATE = 1, + M64CORE_VIDEO_MODE, + M64CORE_SAVESTATE_SLOT, + M64CORE_SPEED_FACTOR, + M64CORE_SPEED_LIMITER, + M64CORE_VIDEO_SIZE, + M64CORE_AUDIO_VOLUME, + M64CORE_AUDIO_MUTE, + M64CORE_INPUT_GAMESHARK, + M64CORE_STATE_LOADCOMPLETE, + M64CORE_STATE_SAVECOMPLETE +} m64p_core_param; + +typedef enum { + M64CMD_NOP = 0, + M64CMD_ROM_OPEN, + M64CMD_ROM_CLOSE, + M64CMD_ROM_GET_HEADER, + M64CMD_ROM_GET_SETTINGS, + M64CMD_EXECUTE, + M64CMD_STOP, + M64CMD_PAUSE, + M64CMD_RESUME, + M64CMD_CORE_STATE_QUERY, + M64CMD_STATE_LOAD, + M64CMD_STATE_SAVE, + M64CMD_STATE_SET_SLOT, + M64CMD_SEND_SDL_KEYDOWN, + M64CMD_SEND_SDL_KEYUP, + M64CMD_SET_FRAME_CALLBACK, + M64CMD_TAKE_NEXT_SCREENSHOT, + M64CMD_CORE_STATE_SET, + M64CMD_READ_SCREEN, + M64CMD_RESET, + M64CMD_ADVANCE_FRAME +} m64p_command; + +typedef struct { + unsigned int address; + int value; +} m64p_cheat_code; + +/* ----------------------------------------- */ +/* Structures to hold ROM image information */ +/* ----------------------------------------- */ + +typedef enum +{ + SYSTEM_NTSC = 0, + SYSTEM_PAL, + SYSTEM_MPAL +} m64p_system_type; + +typedef struct +{ + unsigned char init_PI_BSB_DOM1_LAT_REG; /* 0x00 */ + unsigned char init_PI_BSB_DOM1_PGS_REG; /* 0x01 */ + unsigned char init_PI_BSB_DOM1_PWD_REG; /* 0x02 */ + unsigned char init_PI_BSB_DOM1_PGS_REG2; /* 0x03 */ + unsigned int ClockRate; /* 0x04 */ + unsigned int PC; /* 0x08 */ + unsigned int Release; /* 0x0C */ + unsigned int CRC1; /* 0x10 */ + unsigned int CRC2; /* 0x14 */ + unsigned int Unknown[2]; /* 0x18 */ + unsigned char Name[20]; /* 0x20 */ + unsigned int unknown; /* 0x34 */ + unsigned int Manufacturer_ID; /* 0x38 */ + unsigned short Cartridge_ID; /* 0x3C - Game serial number */ + unsigned short Country_code; /* 0x3E */ +} m64p_rom_header; + +typedef struct +{ + char goodname[256]; + char MD5[33]; + unsigned char savetype; + unsigned char status; /* Rom status on a scale from 0-5. */ + unsigned char players; /* Local players 0-4, 2/3/4 way Netplay indicated by 5/6/7. */ + unsigned char rumble; /* 0 - No, 1 - Yes boolean for rumble support. */ +} m64p_rom_settings; + +/* ----------------------------------------- */ +/* Structures and Types for the Debugger */ +/* ----------------------------------------- */ + +typedef enum { + M64P_DBG_RUN_STATE = 1, + M64P_DBG_PREVIOUS_PC, + M64P_DBG_NUM_BREAKPOINTS, + M64P_DBG_CPU_DYNACORE, + M64P_DBG_CPU_NEXT_INTERRUPT +} m64p_dbg_state; + +typedef enum { + M64P_DBG_MEM_TYPE = 1, + M64P_DBG_MEM_FLAGS, + M64P_DBG_MEM_HAS_RECOMPILED, + M64P_DBG_MEM_NUM_RECOMPILED, + M64P_DBG_RECOMP_OPCODE = 16, + M64P_DBG_RECOMP_ARGS, + M64P_DBG_RECOMP_ADDR +} m64p_dbg_mem_info; + +typedef enum { + M64P_MEM_NOMEM = 0, + M64P_MEM_NOTHING, + M64P_MEM_RDRAM, + M64P_MEM_RDRAMREG, + M64P_MEM_RSPMEM, + M64P_MEM_RSPREG, + M64P_MEM_RSP, + M64P_MEM_DP, + M64P_MEM_DPS, + M64P_MEM_VI, + M64P_MEM_AI, + M64P_MEM_PI, + M64P_MEM_RI, + M64P_MEM_SI, + M64P_MEM_FLASHRAMSTAT, + M64P_MEM_ROM, + M64P_MEM_PIF, + M64P_MEM_MI, + M64P_MEM_BREAKPOINT +} m64p_dbg_mem_type; + +typedef enum { + M64P_MEM_FLAG_READABLE = 0x01, + M64P_MEM_FLAG_WRITABLE = 0x02, + M64P_MEM_FLAG_READABLE_EMUONLY = 0x04, // the EMUONLY flags signify that emulated code can read/write here, but debugger cannot + M64P_MEM_FLAG_WRITABLE_EMUONLY = 0x08 +} m64p_dbg_mem_flags; + +typedef enum { + M64P_DBG_PTR_RDRAM = 1, + M64P_DBG_PTR_PI_REG, + M64P_DBG_PTR_SI_REG, + M64P_DBG_PTR_VI_REG, + M64P_DBG_PTR_RI_REG, + M64P_DBG_PTR_AI_REG +} m64p_dbg_memptr_type; + +typedef enum { + M64P_CPU_PC = 1, + M64P_CPU_REG_REG, + M64P_CPU_REG_HI, + M64P_CPU_REG_LO, + M64P_CPU_REG_COP0, + M64P_CPU_REG_COP1_DOUBLE_PTR, + M64P_CPU_REG_COP1_SIMPLE_PTR, + M64P_CPU_REG_COP1_FGR_64, + M64P_CPU_TLB +} m64p_dbg_cpu_data; + +typedef enum { + M64P_BKP_CMD_ADD_ADDR = 1, + M64P_BKP_CMD_ADD_STRUCT, + M64P_BKP_CMD_REPLACE, + M64P_BKP_CMD_REMOVE_ADDR, + M64P_BKP_CMD_REMOVE_IDX, + M64P_BKP_CMD_ENABLE, + M64P_BKP_CMD_DISABLE, + M64P_BKP_CMD_CHECK +} m64p_dbg_bkp_command; + +#define M64P_MEM_INVALID 0xFFFFFFFF // invalid memory read will return this + +#define BREAKPOINTS_MAX_NUMBER 128 + +#define BPT_FLAG_ENABLED 0x01 +#define BPT_FLAG_CONDITIONAL 0x02 +#define BPT_FLAG_COUNTER 0x04 +#define BPT_FLAG_READ 0x08 +#define BPT_FLAG_WRITE 0x10 +#define BPT_FLAG_EXEC 0x20 +#define BPT_FLAG_LOG 0x40 //Log to the console when this breakpoint hits. + +#define BPT_CHECK_FLAG(a, b) ((a.flags & b) == b) +#define BPT_SET_FLAG(a, b) a.flags = (a.flags | b); +#define BPT_CLEAR_FLAG(a, b) a.flags = (a.flags & (~b)); +#define BPT_TOGGLE_FLAG(a, b) a.flags = (a.flags ^ b); + +typedef struct _breakpoint { + unsigned int address; + unsigned int endaddr; + unsigned int flags; + //unsigned int condition; //Placeholder for breakpoint condition + } breakpoint; + +/* ------------------------------------------------- */ +/* Structures and Types for Core Video Extension API */ +/* ------------------------------------------------- */ + +typedef struct { + unsigned int uiWidth; + unsigned int uiHeight; +} m64p_2d_size; + +typedef enum { + M64P_GL_DOUBLEBUFFER = 1, + M64P_GL_BUFFER_SIZE, + M64P_GL_DEPTH_SIZE, + M64P_GL_RED_SIZE, + M64P_GL_GREEN_SIZE, + M64P_GL_BLUE_SIZE, + M64P_GL_ALPHA_SIZE, + M64P_GL_SWAP_CONTROL, + M64P_GL_MULTISAMPLEBUFFERS, + M64P_GL_MULTISAMPLESAMPLES +} m64p_GLattr; + +typedef struct { + unsigned int Functions; + m64p_error (*VidExtFuncInit)(void); + m64p_error (*VidExtFuncQuit)(void); + m64p_error (*VidExtFuncListModes)(m64p_2d_size *, int *); + m64p_error (*VidExtFuncSetMode)(int, int, int, int); + void * (*VidExtFuncGLGetProc)(const char*); + m64p_error (*VidExtFuncGLSetAttr)(m64p_GLattr, int); + m64p_error (*VidExtFuncGLGetAttr)(m64p_GLattr, int *); + m64p_error (*VidExtFuncGLSwapBuf)(void); + m64p_error (*VidExtFuncSetCaption)(const char *); + m64p_error (*VidExtFuncToggleFS)(void); +} m64p_video_extension_functions; + +#endif /* define M64P_TYPES_H */ + diff --git a/libmupen64plus/mupen64plus-core/src/api/m64p_vidext.h b/libmupen64plus/mupen64plus-core/src/api/m64p_vidext.h new file mode 100644 index 0000000000..731a6acd32 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/api/m64p_vidext.h @@ -0,0 +1,145 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - m64p_vidext.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This header file defines typedefs for function pointers to the core's + * video extension functions. + */ + +#if !defined(M64P_VIDEXT_H) +#define M64P_VIDEXT_H + +#include "m64p_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* VidExt_Init() + * + * This function should be called from within the InitiateGFX() video plugin + * function call. The default SDL implementation of this function simply calls + * SDL_InitSubSystem(SDL_INIT_VIDEO). It does not open a rendering window or + * switch video modes. + */ +typedef m64p_error (*ptr_VidExt_Init)(void); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL VidExt_Init(void); +#endif + +/* VidExt_Quit() + * + * This function closes any open rendering window and shuts down the video + * system. The default SDL implementation of this function calls + * SDL_QuitSubSystem(SDL_INIT_VIDEO). This function should be called from + * within the RomClose() video plugin function. + */ +typedef m64p_error (*ptr_VidExt_Quit)(void); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL VidExt_Quit(void); +#endif + +/* VidExt_ListFullscreenModes() + * + * This function is used to enumerate the available resolutions for fullscreen + * video modes. A pointer to an array is passed into the function, which is + * then filled with resolution sizes. + */ +typedef m64p_error (*ptr_VidExt_ListFullscreenModes)(m64p_2d_size *, int *); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL VidExt_ListFullscreenModes(m64p_2d_size *, int *); +#endif + +/* VidExt_SetVideoMode() + * + * This function creates a rendering window or switches into a fullscreen + * video mode. Any desired OpenGL attributes should be set before calling + * this function. + */ +typedef m64p_error (*ptr_VidExt_SetVideoMode)(int, int, int, m64p_video_mode); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL VidExt_SetVideoMode(int, int, int, m64p_video_mode); +#endif + +/* VidExt_SetCaption() + * + * This function sets the caption text of the emulator rendering window. + */ +typedef m64p_error (*ptr_VidExt_SetCaption)(const char *); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL VidExt_SetCaption(const char *); +#endif + +/* VidExt_ToggleFullScreen() + * + * This function toggles between fullscreen and windowed rendering modes. + */ +typedef m64p_error (*ptr_VidExt_ToggleFullScreen)(void); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL VidExt_ToggleFullScreen(void); +#endif + +/* VidExt_GL_GetProcAddress() + * + * This function is used to get a pointer to an OpenGL extension function. This + * is only necessary on the Windows platform, because the OpenGL implementation + * shipped with Windows only supports OpenGL version 1.1. + */ +typedef void * (*ptr_VidExt_GL_GetProcAddress)(const char *); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT void * CALL VidExt_GL_GetProcAddress(const char *); +#endif + +/* VidExt_GL_SetAttribute() + * + * This function is used to set certain OpenGL attributes which must be + * specified before creating the rendering window with VidExt_SetVideoMode. + */ +typedef m64p_error (*ptr_VidExt_GL_SetAttribute)(m64p_GLattr, int); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL VidExt_GL_SetAttribute(m64p_GLattr, int); +#endif + +/* VidExt_GL_GetAttribute() + * + * This function is used to get the value of OpenGL attributes. These values may + * be changed when calling VidExt_SetVideoMode. + */ +typedef m64p_error (*ptr_VidExt_GL_GetAttribute)(m64p_GLattr, int *); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL VidExt_GL_GetAttribute(m64p_GLattr, int *); +#endif + +/* VidExt_GL_SwapBuffers() + * + * This function is used to swap the front/back buffers after rendering an + * output video frame. + */ +typedef m64p_error (*ptr_VidExt_GL_SwapBuffers)(void); +#if defined(M64P_CORE_PROTOTYPES) +EXPORT m64p_error CALL VidExt_GL_SwapBuffers(void); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* #define M64P_VIDEXT_H */ + diff --git a/libmupen64plus/mupen64plus-core/src/api/vidext.c b/libmupen64plus/mupen64plus-core/src/api/vidext.c new file mode 100644 index 0000000000..83ccc4ee65 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/api/vidext.c @@ -0,0 +1,390 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - api/vidext.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This file contains the Core video extension functions which will be exported + * outside of the core library. + */ + +#include +#include +#include + +#define M64P_CORE_PROTOTYPES 1 +#include "m64p_types.h" +#include "m64p_vidext.h" +#include "vidext.h" +#include "callbacks.h" + +#if SDL_VERSION_ATLEAST(2,0,0) +#include "vidext_sdl2_compat.h" +#endif + +/* local variables */ +static m64p_video_extension_functions l_ExternalVideoFuncTable = {10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; +static int l_VideoExtensionActive = 0; +static int l_VideoOutputActive = 0; +static int l_Fullscreen = 0; +static SDL_Surface *l_pScreen = NULL; + +/* global function for use by frontend.c */ +m64p_error OverrideVideoFunctions(m64p_video_extension_functions *VideoFunctionStruct) +{ + /* check input data */ + if (VideoFunctionStruct == NULL) + return M64ERR_INPUT_ASSERT; + if (VideoFunctionStruct->Functions < 10) + return M64ERR_INPUT_INVALID; + + /* disable video extension if any of the function pointers are NULL */ + if (VideoFunctionStruct->VidExtFuncInit == NULL || + VideoFunctionStruct->VidExtFuncQuit == NULL || + VideoFunctionStruct->VidExtFuncListModes == NULL || + VideoFunctionStruct->VidExtFuncSetMode == NULL || + VideoFunctionStruct->VidExtFuncGLGetProc == NULL || + VideoFunctionStruct->VidExtFuncGLSetAttr == NULL || + VideoFunctionStruct->VidExtFuncGLGetAttr == NULL || + VideoFunctionStruct->VidExtFuncGLSwapBuf == NULL || + VideoFunctionStruct->VidExtFuncSetCaption == NULL || + VideoFunctionStruct->VidExtFuncToggleFS == NULL) + { + l_ExternalVideoFuncTable.Functions = 10; + memset(&l_ExternalVideoFuncTable.VidExtFuncInit, 0, 10 * sizeof(void *)); + l_VideoExtensionActive = 0; + return M64ERR_SUCCESS; + } + + /* otherwise copy in the override function pointers */ + memcpy(&l_ExternalVideoFuncTable, VideoFunctionStruct, sizeof(m64p_video_extension_functions)); + l_VideoExtensionActive = 1; + return M64ERR_SUCCESS; +} + +int VidExt_InFullscreenMode(void) +{ + return l_Fullscreen; +} + +int VidExt_VideoRunning(void) +{ + return l_VideoOutputActive; +} + +/* video extension functions to be called by the video plugin */ +EXPORT m64p_error CALL VidExt_Init(void) +{ + /* call video extension override if necessary */ + if (l_VideoExtensionActive) + return (*l_ExternalVideoFuncTable.VidExtFuncInit)(); + + if (SDL_InitSubSystem(SDL_INIT_VIDEO) == -1) + { + DebugMessage(M64MSG_ERROR, "SDL video subsystem init failed: %s", SDL_GetError()); + return M64ERR_SYSTEM_FAIL; + } + + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL VidExt_Quit(void) +{ + /* call video extension override if necessary */ + if (l_VideoExtensionActive) + { + m64p_error rval = (*l_ExternalVideoFuncTable.VidExtFuncQuit)(); + if (rval == M64ERR_SUCCESS) + { + l_VideoOutputActive = 0; + StateChanged(M64CORE_VIDEO_MODE, M64VIDEO_NONE); + } + return rval; + } + + if (!SDL_WasInit(SDL_INIT_VIDEO)) + return M64ERR_NOT_INIT; + + SDL_ShowCursor(SDL_ENABLE); + SDL_QuitSubSystem(SDL_INIT_VIDEO); + l_pScreen = NULL; + l_VideoOutputActive = 0; + StateChanged(M64CORE_VIDEO_MODE, M64VIDEO_NONE); + + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL VidExt_ListFullscreenModes(m64p_2d_size *SizeArray, int *NumSizes) +{ + const SDL_VideoInfo *videoInfo; + unsigned int videoFlags; + SDL_Rect **modes; + int i; + + /* call video extension override if necessary */ + if (l_VideoExtensionActive) + return (*l_ExternalVideoFuncTable.VidExtFuncListModes)(SizeArray, NumSizes); + + if (!SDL_WasInit(SDL_INIT_VIDEO)) + return M64ERR_NOT_INIT; + + /* get a list of SDL video modes */ + videoFlags = SDL_OPENGL | SDL_FULLSCREEN; + + if ((videoInfo = SDL_GetVideoInfo()) == NULL) + { + DebugMessage(M64MSG_ERROR, "SDL_GetVideoInfo query failed: %s", SDL_GetError()); + return M64ERR_SYSTEM_FAIL; + } + + if(videoInfo->hw_available) + videoFlags |= SDL_HWSURFACE; + else + videoFlags |= SDL_SWSURFACE; + + modes = SDL_ListModes(NULL, videoFlags); + + if (modes == (SDL_Rect **) 0 || modes == (SDL_Rect **) -1) + { + DebugMessage(M64MSG_WARNING, "No fullscreen SDL video modes available"); + *NumSizes = 0; + return M64ERR_SUCCESS; + } + + i = 0; + while (i < *NumSizes && modes[i] != NULL) + { + SizeArray[i].uiWidth = modes[i]->w; + SizeArray[i].uiHeight = modes[i]->h; + i++; + } + + *NumSizes = i; + + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL VidExt_SetVideoMode(int Width, int Height, int BitsPerPixel, m64p_video_mode ScreenMode) +{ + const SDL_VideoInfo *videoInfo; + int videoFlags = 0; + + /* call video extension override if necessary */ + if (l_VideoExtensionActive) + { + m64p_error rval = (*l_ExternalVideoFuncTable.VidExtFuncSetMode)(Width, Height, BitsPerPixel, ScreenMode); + l_Fullscreen = (rval == M64ERR_SUCCESS && ScreenMode == M64VIDEO_FULLSCREEN); + l_VideoOutputActive = (rval == M64ERR_SUCCESS); + if (l_VideoOutputActive) + { + StateChanged(M64CORE_VIDEO_MODE, ScreenMode); + StateChanged(M64CORE_VIDEO_SIZE, (Width << 16) | Height); + } + return rval; + } + + if (!SDL_WasInit(SDL_INIT_VIDEO)) + return M64ERR_NOT_INIT; + + /* Get SDL video flags to use */ + if (ScreenMode == M64VIDEO_WINDOWED) + videoFlags = SDL_OPENGL; + else if (ScreenMode == M64VIDEO_FULLSCREEN) + videoFlags = SDL_OPENGL | SDL_FULLSCREEN; + else + return M64ERR_INPUT_INVALID; + + if ((videoInfo = SDL_GetVideoInfo()) == NULL) + { + DebugMessage(M64MSG_ERROR, "SDL_GetVideoInfo query failed: %s", SDL_GetError()); + return M64ERR_SYSTEM_FAIL; + } + if (videoInfo->hw_available) + videoFlags |= SDL_HWSURFACE; + else + videoFlags |= SDL_SWSURFACE; + + /* set the mode */ + if (BitsPerPixel > 0) + DebugMessage(M64MSG_INFO, "Setting %i-bit video mode: %ix%i", BitsPerPixel, Width, Height); + else + DebugMessage(M64MSG_INFO, "Setting video mode: %ix%i", Width, Height); + + l_pScreen = SDL_SetVideoMode(Width, Height, BitsPerPixel, videoFlags); + if (l_pScreen == NULL) + { + DebugMessage(M64MSG_ERROR, "SDL_SetVideoMode failed: %s", SDL_GetError()); + return M64ERR_SYSTEM_FAIL; + } + + SDL_ShowCursor(SDL_DISABLE); + + l_Fullscreen = (ScreenMode == M64VIDEO_FULLSCREEN); + l_VideoOutputActive = 1; + StateChanged(M64CORE_VIDEO_MODE, ScreenMode); + StateChanged(M64CORE_VIDEO_SIZE, (Width << 16) | Height); + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL VidExt_SetCaption(const char *Title) +{ + /* call video extension override if necessary */ + if (l_VideoExtensionActive) + return (*l_ExternalVideoFuncTable.VidExtFuncSetCaption)(Title); + + if (!SDL_WasInit(SDL_INIT_VIDEO)) + return M64ERR_NOT_INIT; + + SDL_WM_SetCaption(Title, "M64+ Video"); + + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL VidExt_ToggleFullScreen(void) +{ + /* call video extension override if necessary */ + if (l_VideoExtensionActive) + { + m64p_error rval = (*l_ExternalVideoFuncTable.VidExtFuncToggleFS)(); + if (rval == M64ERR_SUCCESS) + { + l_Fullscreen = !l_Fullscreen; + StateChanged(M64CORE_VIDEO_MODE, l_Fullscreen ? M64VIDEO_FULLSCREEN : M64VIDEO_WINDOWED); + } + return rval; + } + + if (!SDL_WasInit(SDL_INIT_VIDEO)) + return M64ERR_NOT_INIT; + + /* TODO: + * SDL_WM_ToggleFullScreen doesn't work under Windows and others + * (see http://wiki.libsdl.org/moin.cgi/FAQWindows for explanation). + * Instead, we should call SDL_SetVideoMode with the SDL_FULLSCREEN flag. + * (see http://sdl.beuc.net/sdl.wiki/SDL_SetVideoMode), but on Windows + * this resets the OpenGL context and video plugins don't support it yet. + * Uncomment the next line to test it: */ + //return VidExt_SetVideoMode(l_pScreen->w, l_pScreen->h, l_pScreen->format->BitsPerPixel, l_Fullscreen ? M64VIDEO_WINDOWED : M64VIDEO_FULLSCREEN); + if (SDL_WM_ToggleFullScreen(l_pScreen) == 1) + { + l_Fullscreen = !l_Fullscreen; + StateChanged(M64CORE_VIDEO_MODE, l_Fullscreen ? M64VIDEO_FULLSCREEN : M64VIDEO_WINDOWED); + return M64ERR_SUCCESS; + } + + return M64ERR_SYSTEM_FAIL; +} + +EXPORT void * CALL VidExt_GL_GetProcAddress(const char* Proc) +{ + /* call video extension override if necessary */ + if (l_VideoExtensionActive) + return (*l_ExternalVideoFuncTable.VidExtFuncGLGetProc)(Proc); + + if (!SDL_WasInit(SDL_INIT_VIDEO)) + return NULL; + + return SDL_GL_GetProcAddress(Proc); +} + +typedef struct { + m64p_GLattr m64Attr; + SDL_GLattr sdlAttr; +} GLAttrMapNode; + +static const GLAttrMapNode GLAttrMap[] = { + { M64P_GL_DOUBLEBUFFER, SDL_GL_DOUBLEBUFFER }, + { M64P_GL_BUFFER_SIZE, SDL_GL_BUFFER_SIZE }, + { M64P_GL_DEPTH_SIZE, SDL_GL_DEPTH_SIZE }, + { M64P_GL_RED_SIZE, SDL_GL_RED_SIZE }, + { M64P_GL_GREEN_SIZE, SDL_GL_GREEN_SIZE }, + { M64P_GL_BLUE_SIZE, SDL_GL_BLUE_SIZE }, + { M64P_GL_ALPHA_SIZE, SDL_GL_ALPHA_SIZE }, +#if SDL_VERSION_ATLEAST(1,3,0) + { M64P_GL_SWAP_CONTROL, SDL_RENDERER_PRESENTVSYNC }, +#else + { M64P_GL_SWAP_CONTROL, SDL_GL_SWAP_CONTROL }, +#endif + { M64P_GL_MULTISAMPLEBUFFERS, SDL_GL_MULTISAMPLEBUFFERS }, + { M64P_GL_MULTISAMPLESAMPLES, SDL_GL_MULTISAMPLESAMPLES }}; +static const int mapSize = sizeof(GLAttrMap) / sizeof(GLAttrMapNode); + +EXPORT m64p_error CALL VidExt_GL_SetAttribute(m64p_GLattr Attr, int Value) +{ + int i; + + /* call video extension override if necessary */ + if (l_VideoExtensionActive) + return (*l_ExternalVideoFuncTable.VidExtFuncGLSetAttr)(Attr, Value); + + if (!SDL_WasInit(SDL_INIT_VIDEO)) + return M64ERR_NOT_INIT; + + for (i = 0; i < mapSize; i++) + { + if (GLAttrMap[i].m64Attr == Attr) + { + if (SDL_GL_SetAttribute(GLAttrMap[i].sdlAttr, Value) != 0) + return M64ERR_SYSTEM_FAIL; + return M64ERR_SUCCESS; + } + } + + return M64ERR_INPUT_INVALID; +} + +EXPORT m64p_error CALL VidExt_GL_GetAttribute(m64p_GLattr Attr, int *pValue) +{ + int i; + + /* call video extension override if necessary */ + if (l_VideoExtensionActive) + return (*l_ExternalVideoFuncTable.VidExtFuncGLGetAttr)(Attr, pValue); + + if (!SDL_WasInit(SDL_INIT_VIDEO)) + return M64ERR_NOT_INIT; + + for (i = 0; i < mapSize; i++) + { + if (GLAttrMap[i].m64Attr == Attr) + { + int NewValue = 0; + if (SDL_GL_GetAttribute(GLAttrMap[i].sdlAttr, &NewValue) != 0) + return M64ERR_SYSTEM_FAIL; + *pValue = NewValue; + return M64ERR_SUCCESS; + } + } + + return M64ERR_INPUT_INVALID; +} + +EXPORT m64p_error CALL VidExt_GL_SwapBuffers(void) +{ + /* call video extension override if necessary */ + if (l_VideoExtensionActive) + return (*l_ExternalVideoFuncTable.VidExtFuncGLSwapBuf)(); + + if (!SDL_WasInit(SDL_INIT_VIDEO)) + return M64ERR_NOT_INIT; + + SDL_GL_SwapBuffers(); + return M64ERR_SUCCESS; +} + + diff --git a/libmupen64plus/mupen64plus-core/src/api/vidext.h b/libmupen64plus/mupen64plus-core/src/api/vidext.h new file mode 100644 index 0000000000..922a18ef7f --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/api/vidext.h @@ -0,0 +1,38 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - api/vidext.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This file contains the definitions for the video extension functions which + * will be called from other Core modules. + */ + +#if !defined(API_VIDEXT_H) +#define API_VIDEXT_H + +#include "m64p_types.h" + +/* global function for use by frontend.c */ +extern m64p_error OverrideVideoFunctions(m64p_video_extension_functions *VideoFunctionStruct); + +/* these functions are only used by the core */ +extern int VidExt_InFullscreenMode(void); +extern int VidExt_VideoRunning(void); + +#endif /* API_VIDEXT_H */ diff --git a/libmupen64plus/mupen64plus-core/src/api/vidext_sdl2_compat.h b/libmupen64plus/mupen64plus-core/src/api/vidext_sdl2_compat.h new file mode 100644 index 0000000000..7c6ad8b4d7 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/api/vidext_sdl2_compat.h @@ -0,0 +1,802 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2012 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +typedef struct +{ + Uint8 *src; + int src_w, src_h; + int src_pitch; + int src_skip; + Uint8 *dst; + int dst_w, dst_h; + int dst_pitch; + int dst_skip; + SDL_PixelFormat *src_fmt; + SDL_PixelFormat *dst_fmt; + Uint8 *table; + int flags; + Uint32 colorkey; + Uint8 r, g, b, a; +} SDL_BlitInfo; + +/* Blit mapping definition */ +typedef struct SDL_BlitMap +{ + SDL_Surface *dst; + int identity; + SDL_blit blit; + void *data; + SDL_BlitInfo info; + + /* the version count matches the destination; mismatch indicates + an invalid mapping */ + Uint32 dst_palette_version; + Uint32 src_palette_version; +} SDL_BlitMap; + +typedef struct SDL_VideoInfo +{ + Uint32 hw_available:1; + Uint32 wm_available:1; + Uint32 UnusedBits1:6; + Uint32 UnusedBits2:1; + Uint32 blit_hw:1; + Uint32 blit_hw_CC:1; + Uint32 blit_hw_A:1; + Uint32 blit_sw:1; + Uint32 blit_sw_CC:1; + Uint32 blit_sw_A:1; + Uint32 blit_fill:1; + Uint32 UnusedBits3:16; + Uint32 video_mem; + + SDL_PixelFormat *vfmt; + + int current_w; + int current_h; +} SDL_VideoInfo; + +#define SDL_ANYFORMAT 0x00100000 +#define SDL_HWPALETTE 0x00200000 +#define SDL_FULLSCREEN 0x00800000 +#define SDL_RESIZABLE 0x01000000 +#define SDL_NOFRAME 0x02000000 +#define SDL_OPENGL 0x04000000 +#define SDL_HWSURFACE 0x08000001 /**< \note Not used */ + +#define SDL_BUTTON_WHEELUP 4 +#define SDL_BUTTON_WHEELDOWN 5 + +int initialized_video = 0; + +static SDL_Window *SDL_VideoWindow = NULL; +static SDL_Surface *SDL_WindowSurface = NULL; +static SDL_Surface *SDL_VideoSurface = NULL; +static SDL_Surface *SDL_ShadowSurface = NULL; +static SDL_Surface *SDL_PublicSurface = NULL; +static SDL_Rect SDL_VideoViewport; +static char *wm_title = NULL; +static Uint32 SDL_VideoFlags = 0; +static SDL_GLContext *SDL_VideoContext = NULL; +static SDL_Surface *SDL_VideoIcon; + +static void +SDL_WM_SetCaption(const char *title, const char *icon) +{ + if (wm_title) { + SDL_free(wm_title); + } + if (title) { + wm_title = SDL_strdup(title); + } else { + wm_title = NULL; + } + SDL_SetWindowTitle(SDL_VideoWindow, wm_title); +} + +static int +GetVideoDisplay() +{ + const char *variable = SDL_getenv("SDL_VIDEO_FULLSCREEN_DISPLAY"); + if ( !variable ) { + variable = SDL_getenv("SDL_VIDEO_FULLSCREEN_HEAD"); + } + if ( variable ) { + return SDL_atoi(variable); + } else { + return 0; + } +} + +static const SDL_VideoInfo * +SDL_GetVideoInfo(void) +{ + static SDL_VideoInfo info; + SDL_DisplayMode mode; + + /* Memory leak, compatibility code, who cares? */ + if (!info.vfmt && SDL_GetDesktopDisplayMode(GetVideoDisplay(), &mode) == 0) { + info.vfmt = SDL_AllocFormat(mode.format); + info.current_w = mode.w; + info.current_h = mode.h; + } + return &info; +} + +static SDL_Rect ** +SDL_ListModes(const SDL_PixelFormat * format, Uint32 flags) +{ + int i, nmodes; + SDL_Rect **modes; + + if (!initialized_video) { + return NULL; + } + + if (!(flags & SDL_FULLSCREEN)) { + return (SDL_Rect **) (-1); + } + + if (!format) { + format = SDL_GetVideoInfo()->vfmt; + } + + /* Memory leak, but this is a compatibility function, who cares? */ + nmodes = 0; + modes = NULL; + for (i = 0; i < SDL_GetNumDisplayModes(GetVideoDisplay()); ++i) { + SDL_DisplayMode mode; + int bpp; + + SDL_GetDisplayMode(GetVideoDisplay(), i, &mode); + if (!mode.w || !mode.h) { + return (SDL_Rect **) (-1); + } + + /* Copied from src/video/SDL_pixels.c:SDL_PixelFormatEnumToMasks */ + if (SDL_BYTESPERPIXEL(mode.format) <= 2) { + bpp = SDL_BITSPERPIXEL(mode.format); + } else { + bpp = SDL_BYTESPERPIXEL(mode.format) * 8; + } + + if (bpp != format->BitsPerPixel) { + continue; + } + if (nmodes > 0 && modes[nmodes - 1]->w == mode.w + && modes[nmodes - 1]->h == mode.h) { + continue; + } + + modes = SDL_realloc(modes, (nmodes + 2) * sizeof(*modes)); + if (!modes) { + return NULL; + } + modes[nmodes] = (SDL_Rect *) SDL_malloc(sizeof(SDL_Rect)); + if (!modes[nmodes]) { + return NULL; + } + modes[nmodes]->x = 0; + modes[nmodes]->y = 0; + modes[nmodes]->w = mode.w; + modes[nmodes]->h = mode.h; + ++nmodes; + } + if (modes) { + modes[nmodes] = NULL; + } + return modes; +} + +static void +SDL_UpdateRects(SDL_Surface * screen, int numrects, SDL_Rect * rects) +{ + int i; + + if (screen == SDL_ShadowSurface) { + for (i = 0; i < numrects; ++i) { + SDL_BlitSurface(SDL_ShadowSurface, &rects[i], SDL_VideoSurface, + &rects[i]); + } + + /* Fall through to video surface update */ + screen = SDL_VideoSurface; + } + if (screen == SDL_VideoSurface) { + if (SDL_VideoViewport.x || SDL_VideoViewport.y) { + SDL_Rect *stackrects = SDL_stack_alloc(SDL_Rect, numrects); + SDL_Rect *stackrect; + const SDL_Rect *rect; + + /* Offset all the rectangles before updating */ + for (i = 0; i < numrects; ++i) { + rect = &rects[i]; + stackrect = &stackrects[i]; + stackrect->x = SDL_VideoViewport.x + rect->x; + stackrect->y = SDL_VideoViewport.y + rect->y; + stackrect->w = rect->w; + stackrect->h = rect->h; + } + SDL_UpdateWindowSurfaceRects(SDL_VideoWindow, stackrects, numrects); + SDL_stack_free(stackrects); + } else { + SDL_UpdateWindowSurfaceRects(SDL_VideoWindow, rects, numrects); + } + } +} + +static void +SDL_UpdateRect(SDL_Surface * screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h) +{ + if (screen) { + SDL_Rect rect; + + /* Fill the rectangle */ + rect.x = (int) x; + rect.y = (int) y; + rect.w = (int) (w ? w : screen->w); + rect.h = (int) (h ? h : screen->h); + SDL_UpdateRects(screen, 1, &rect); + } +} + +static int +SDL_Flip(SDL_Surface * screen) +{ + SDL_UpdateRect(screen, 0, 0, 0, 0); + return 0; +} + +/* + * Calculate the pad-aligned scanline width of a surface + */ +static int +SDL_CalculatePitch(SDL_Surface * surface) +{ + int pitch; + + /* Surface should be 4-byte aligned for speed */ + pitch = surface->w * surface->format->BytesPerPixel; + switch (surface->format->BitsPerPixel) { + case 1: + pitch = (pitch + 7) / 8; + break; + case 4: + pitch = (pitch + 1) / 2; + break; + default: + break; + } + pitch = (pitch + 3) & ~3; /* 4-byte aligning */ + return (pitch); +} + +static void +SDL_InvalidateMap(SDL_BlitMap * map) +{ + if (!map) { + return; + } + if (map->dst) { + /* Release our reference to the surface - see the note below */ + if (--map->dst->refcount <= 0) { + SDL_FreeSurface(map->dst); + } + } + map->dst = NULL; + map->src_palette_version = 0; + map->dst_palette_version = 0; + if (map->info.table) { + SDL_free(map->info.table); + map->info.table = NULL; + } +} + +static void +SDL_GL_SwapBuffers(void) +{ + SDL_GL_SwapWindow(SDL_VideoWindow); +} + +static int +SDL_WM_ToggleFullScreen(SDL_Surface * surface) +{ + int length; + void *pixels; + Uint8 *src, *dst; + int row; + int window_w; + int window_h; + + if (!SDL_PublicSurface) { + SDL_SetError("SDL_SetVideoMode() hasn't been called"); + return 0; + } + + /* Copy the old bits out */ + length = SDL_PublicSurface->w * SDL_PublicSurface->format->BytesPerPixel; + pixels = SDL_malloc(SDL_PublicSurface->h * length); + if (pixels && SDL_PublicSurface->pixels) { + src = (Uint8*)SDL_PublicSurface->pixels; + dst = (Uint8*)pixels; + for (row = 0; row < SDL_PublicSurface->h; ++row) { + SDL_memcpy(dst, src, length); + src += SDL_PublicSurface->pitch; + dst += length; + } + } + + /* Do the physical mode switch */ + if (SDL_GetWindowFlags(SDL_VideoWindow) & SDL_WINDOW_FULLSCREEN) { + if (SDL_SetWindowFullscreen(SDL_VideoWindow, 0) < 0) { + return 0; + } + SDL_PublicSurface->flags &= ~SDL_FULLSCREEN; + } else { + if (SDL_SetWindowFullscreen(SDL_VideoWindow, 1) < 0) { + return 0; + } + SDL_PublicSurface->flags |= SDL_FULLSCREEN; + } + + /* Recreate the screen surface */ + SDL_WindowSurface = SDL_GetWindowSurface(SDL_VideoWindow); + if (!SDL_WindowSurface) { + /* We're totally hosed... */ + return 0; + } + + /* Center the public surface in the window surface */ + SDL_GetWindowSize(SDL_VideoWindow, &window_w, &window_h); + SDL_VideoViewport.x = (window_w - SDL_VideoSurface->w)/2; + SDL_VideoViewport.y = (window_h - SDL_VideoSurface->h)/2; + SDL_VideoViewport.w = SDL_VideoSurface->w; + SDL_VideoViewport.h = SDL_VideoSurface->h; + + /* Do some shuffling behind the application's back if format changes */ + if (SDL_VideoSurface->format->format != SDL_WindowSurface->format->format) { + if (SDL_ShadowSurface) { + if (SDL_ShadowSurface->format->format == SDL_WindowSurface->format->format) { + /* Whee! We don't need a shadow surface anymore! */ + SDL_VideoSurface->flags &= ~SDL_DONTFREE; + SDL_FreeSurface(SDL_VideoSurface); + SDL_free(SDL_ShadowSurface->pixels); + SDL_VideoSurface = SDL_ShadowSurface; + SDL_VideoSurface->flags |= SDL_PREALLOC; + SDL_ShadowSurface = NULL; + } else { + /* No problem, just change the video surface format */ + SDL_FreeFormat(SDL_VideoSurface->format); + SDL_VideoSurface->format = SDL_WindowSurface->format; + SDL_VideoSurface->format->refcount++; + SDL_InvalidateMap(SDL_ShadowSurface->map); + } + } else { + /* We can make the video surface the shadow surface */ + SDL_ShadowSurface = SDL_VideoSurface; + SDL_ShadowSurface->pitch = SDL_CalculatePitch(SDL_ShadowSurface); + SDL_ShadowSurface->pixels = SDL_malloc(SDL_ShadowSurface->h * SDL_ShadowSurface->pitch); + if (!SDL_ShadowSurface->pixels) { + /* Uh oh, we're hosed */ + SDL_ShadowSurface = NULL; + return 0; + } + SDL_ShadowSurface->flags &= ~SDL_PREALLOC; + + SDL_VideoSurface = SDL_CreateRGBSurfaceFrom(NULL, 0, 0, 32, 0, 0, 0, 0, 0); + SDL_VideoSurface->flags = SDL_ShadowSurface->flags; + SDL_VideoSurface->flags |= SDL_PREALLOC; + SDL_FreeFormat(SDL_VideoSurface->format); + SDL_VideoSurface->format = SDL_WindowSurface->format; + SDL_VideoSurface->format->refcount++; + SDL_VideoSurface->w = SDL_ShadowSurface->w; + SDL_VideoSurface->h = SDL_ShadowSurface->h; + } + } + + /* Update the video surface */ + SDL_VideoSurface->pitch = SDL_WindowSurface->pitch; + SDL_VideoSurface->pixels = (void *)((Uint8 *)SDL_WindowSurface->pixels + + SDL_VideoViewport.y * SDL_VideoSurface->pitch + + SDL_VideoViewport.x * SDL_VideoSurface->format->BytesPerPixel); + SDL_SetClipRect(SDL_VideoSurface, NULL); + + /* Copy the old bits back */ + if (pixels) { + src = (Uint8*)pixels; + dst = (Uint8*)SDL_PublicSurface->pixels; + for (row = 0; row < SDL_PublicSurface->h; ++row) { + SDL_memcpy(dst, src, length); + src += length; + dst += SDL_PublicSurface->pitch; + } + SDL_Flip(SDL_PublicSurface); + SDL_free(pixels); + } + + /* We're done! */ + return 1; +} + +static void +ClearVideoSurface() +{ + if (SDL_ShadowSurface) { + SDL_FillRect(SDL_ShadowSurface, NULL, + SDL_MapRGB(SDL_ShadowSurface->format, 0, 0, 0)); + } + SDL_FillRect(SDL_WindowSurface, NULL, 0); + SDL_UpdateWindowSurface(SDL_VideoWindow); +} + +static int +SDL_ResizeVideoMode(int width, int height, int bpp, Uint32 flags) +{ + int w, h; + + /* We can't resize something we don't have... */ + if (!SDL_VideoSurface) { + return -1; + } + + /* We probably have to recreate the window in fullscreen mode */ + if (flags & SDL_FULLSCREEN) { + return -1; + } + + /* I don't think there's any change we can gracefully make in flags */ + if (flags != SDL_VideoFlags) { + return -1; + } + if (bpp != SDL_VideoSurface->format->BitsPerPixel) { + return -1; + } + + /* Resize the window */ + SDL_GetWindowSize(SDL_VideoWindow, &w, &h); + if (w != width || h != height) { + SDL_SetWindowSize(SDL_VideoWindow, width, height); + } + + /* If we're in OpenGL mode, just resize the stub surface and we're done! */ + if (flags & SDL_OPENGL) { + SDL_VideoSurface->w = width; + SDL_VideoSurface->h = height; + return 0; + } + + SDL_WindowSurface = SDL_GetWindowSurface(SDL_VideoWindow); + if (!SDL_WindowSurface) { + return -1; + } + if (SDL_VideoSurface->format != SDL_WindowSurface->format) { + return -1; + } + SDL_VideoSurface->w = width; + SDL_VideoSurface->h = height; + SDL_VideoSurface->pixels = SDL_WindowSurface->pixels; + SDL_VideoSurface->pitch = SDL_WindowSurface->pitch; + SDL_SetClipRect(SDL_VideoSurface, NULL); + + if (SDL_ShadowSurface) { + SDL_ShadowSurface->w = width; + SDL_ShadowSurface->h = height; + SDL_ShadowSurface->pitch = SDL_CalculatePitch(SDL_ShadowSurface); + SDL_ShadowSurface->pixels = + SDL_realloc(SDL_ShadowSurface->pixels, + SDL_ShadowSurface->h * SDL_ShadowSurface->pitch); + SDL_SetClipRect(SDL_ShadowSurface, NULL); + SDL_InvalidateMap(SDL_ShadowSurface->map); + } else { + SDL_PublicSurface = SDL_VideoSurface; + } + + ClearVideoSurface(); + + return 0; +} + +static int +SDL_CompatEventFilter(void *userdata, SDL_Event * event) +{ + SDL_Event fake; + + switch (event->type) { + case SDL_WINDOWEVENT: + switch (event->window.event) { + case SDL_WINDOWEVENT_CLOSE: + fake.type = SDL_QUIT; + SDL_PushEvent(&fake); + break; + } + case SDL_KEYDOWN: + case SDL_KEYUP: + { + Uint32 unicode = 0; + if (event->key.type == SDL_KEYDOWN && event->key.keysym.sym < 256) { + unicode = event->key.keysym.sym; + if (unicode >= 'a' && unicode <= 'z') { + int shifted = !!(event->key.keysym.mod & KMOD_SHIFT); + int capslock = !!(event->key.keysym.mod & KMOD_CAPS); + if ((shifted ^ capslock) != 0) { + unicode = SDL_toupper(unicode); + } + } + } + if (unicode) { + event->key.keysym.unicode = unicode; + } + break; + } + case SDL_TEXTINPUT: + { + /* FIXME: Generate an old style key repeat event if needed */ + //printf("TEXTINPUT: '%s'\n", event->text.text); + break; + } + case SDL_MOUSEMOTION: + { + event->motion.x -= SDL_VideoViewport.x; + event->motion.y -= SDL_VideoViewport.y; + break; + } + case SDL_MOUSEBUTTONDOWN: + case SDL_MOUSEBUTTONUP: + { + event->button.x -= SDL_VideoViewport.x; + event->button.y -= SDL_VideoViewport.y; + break; + } + case SDL_MOUSEWHEEL: + { + Uint8 button; + int x, y; + + if (event->wheel.y == 0) { + break; + } + + SDL_GetMouseState(&x, &y); + + if (event->wheel.y > 0) { + button = SDL_BUTTON_WHEELUP; + } else { + button = SDL_BUTTON_WHEELDOWN; + } + + fake.button.button = button; + fake.button.x = x; + fake.button.y = y; + fake.button.windowID = event->wheel.windowID; + + fake.type = SDL_MOUSEBUTTONDOWN; + fake.button.state = SDL_PRESSED; + SDL_PushEvent(&fake); + + fake.type = SDL_MOUSEBUTTONUP; + fake.button.state = SDL_RELEASED; + SDL_PushEvent(&fake); + break; + } + + } + return 1; +} + +static void +GetEnvironmentWindowPosition(int w, int h, int *x, int *y) +{ + int display = GetVideoDisplay(); + const char *window = SDL_getenv("SDL_VIDEO_WINDOW_POS"); + const char *center = SDL_getenv("SDL_VIDEO_CENTERED"); + if (window) { + if (SDL_sscanf(window, "%d,%d", x, y) == 2) { + return; + } + if (SDL_strcmp(window, "center") == 0) { + center = window; + } + } + if (center) { + *x = SDL_WINDOWPOS_CENTERED_DISPLAY(display); + *y = SDL_WINDOWPOS_CENTERED_DISPLAY(display); + } +} + +static SDL_Surface * +SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags) +{ + SDL_DisplayMode desktop_mode; + int display = GetVideoDisplay(); + int window_x = SDL_WINDOWPOS_UNDEFINED_DISPLAY(display); + int window_y = SDL_WINDOWPOS_UNDEFINED_DISPLAY(display); + int window_w; + int window_h; + Uint32 window_flags; + Uint32 surface_flags; + + if (!initialized_video) { + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) < 0) { + return NULL; + } + initialized_video = 1; + } + + SDL_GetDesktopDisplayMode(display, &desktop_mode); + + if (width == 0) { + width = desktop_mode.w; + } + if (height == 0) { + height = desktop_mode.h; + } + if (bpp == 0) { + bpp = SDL_BITSPERPIXEL(desktop_mode.format); + } + + /* See if we can simply resize the existing window and surface */ + if (SDL_ResizeVideoMode(width, height, bpp, flags) == 0) { + return SDL_PublicSurface; + } + + /* Destroy existing window */ + SDL_PublicSurface = NULL; + if (SDL_ShadowSurface) { + SDL_ShadowSurface->flags &= ~SDL_DONTFREE; + SDL_FreeSurface(SDL_ShadowSurface); + SDL_ShadowSurface = NULL; + } + if (SDL_VideoSurface) { + SDL_VideoSurface->flags &= ~SDL_DONTFREE; + SDL_FreeSurface(SDL_VideoSurface); + SDL_VideoSurface = NULL; + } + if (SDL_VideoContext) { + /* SDL_GL_MakeCurrent(0, NULL); *//* Doesn't do anything */ + SDL_GL_DeleteContext(SDL_VideoContext); + SDL_VideoContext = NULL; + } + if (SDL_VideoWindow) { + SDL_GetWindowPosition(SDL_VideoWindow, &window_x, &window_y); + SDL_DestroyWindow(SDL_VideoWindow); + } + + /* Set up the event filter */ + if (!SDL_GetEventFilter(NULL, NULL)) { + SDL_SetEventFilter(SDL_CompatEventFilter, NULL); + } + + /* Create a new window */ + window_flags = SDL_WINDOW_SHOWN; + if (flags & SDL_FULLSCREEN) { + window_flags |= SDL_WINDOW_FULLSCREEN; + } + if (flags & SDL_OPENGL) { + window_flags |= SDL_WINDOW_OPENGL; + } + if (flags & SDL_RESIZABLE) { + window_flags |= SDL_WINDOW_RESIZABLE; + } + if (flags & SDL_NOFRAME) { + window_flags |= SDL_WINDOW_BORDERLESS; + } + GetEnvironmentWindowPosition(width, height, &window_x, &window_y); + SDL_VideoWindow = + SDL_CreateWindow(wm_title, window_x, window_y, width, height, + window_flags); + if (!SDL_VideoWindow) { + return NULL; + } + SDL_SetWindowIcon(SDL_VideoWindow, SDL_VideoIcon); + + window_flags = SDL_GetWindowFlags(SDL_VideoWindow); + surface_flags = 0; + if (window_flags & SDL_WINDOW_FULLSCREEN) { + surface_flags |= SDL_FULLSCREEN; + } + if ((window_flags & SDL_WINDOW_OPENGL) && (flags & SDL_OPENGL)) { + surface_flags |= SDL_OPENGL; + } + if (window_flags & SDL_WINDOW_RESIZABLE) { + surface_flags |= SDL_RESIZABLE; + } + if (window_flags & SDL_WINDOW_BORDERLESS) { + surface_flags |= SDL_NOFRAME; + } + + SDL_VideoFlags = flags; + + /* If we're in OpenGL mode, just create a stub surface and we're done! */ + if (flags & SDL_OPENGL) { + SDL_VideoContext = SDL_GL_CreateContext(SDL_VideoWindow); + if (!SDL_VideoContext) { + return NULL; + } + if (SDL_GL_MakeCurrent(SDL_VideoWindow, SDL_VideoContext) < 0) { + return NULL; + } + SDL_VideoSurface = + SDL_CreateRGBSurfaceFrom(NULL, width, height, bpp, 0, 0, 0, 0, 0); + if (!SDL_VideoSurface) { + return NULL; + } + SDL_VideoSurface->flags |= surface_flags; + SDL_PublicSurface = SDL_VideoSurface; + return SDL_PublicSurface; + } + + /* Create the screen surface */ + SDL_WindowSurface = SDL_GetWindowSurface(SDL_VideoWindow); + if (!SDL_WindowSurface) { + return NULL; + } + + /* Center the public surface in the window surface */ + SDL_GetWindowSize(SDL_VideoWindow, &window_w, &window_h); + SDL_VideoViewport.x = (window_w - width)/2; + SDL_VideoViewport.y = (window_h - height)/2; + SDL_VideoViewport.w = width; + SDL_VideoViewport.h = height; + + SDL_VideoSurface = SDL_CreateRGBSurfaceFrom(NULL, 0, 0, 32, 0, 0, 0, 0, 0); + SDL_VideoSurface->flags |= surface_flags; + SDL_VideoSurface->flags |= SDL_DONTFREE; + SDL_FreeFormat(SDL_VideoSurface->format); + SDL_VideoSurface->format = SDL_WindowSurface->format; + SDL_VideoSurface->format->refcount++; + SDL_VideoSurface->w = width; + SDL_VideoSurface->h = height; + SDL_VideoSurface->pitch = SDL_WindowSurface->pitch; + SDL_VideoSurface->pixels = (void *)((Uint8 *)SDL_WindowSurface->pixels + + SDL_VideoViewport.y * SDL_VideoSurface->pitch + + SDL_VideoViewport.x * SDL_VideoSurface->format->BytesPerPixel); + SDL_SetClipRect(SDL_VideoSurface, NULL); + + /* Create a shadow surface if necessary */ + if ((bpp != SDL_VideoSurface->format->BitsPerPixel) + && !(flags & SDL_ANYFORMAT)) { + SDL_ShadowSurface = + SDL_CreateRGBSurface(0, width, height, bpp, 0, 0, 0, 0); + if (!SDL_ShadowSurface) { + return NULL; + } + SDL_ShadowSurface->flags |= surface_flags; + SDL_ShadowSurface->flags |= SDL_DONTFREE; + + /* 8-bit SDL_ShadowSurface surfaces report that they have exclusive palette */ + if (SDL_ShadowSurface->format->palette) { + SDL_ShadowSurface->flags |= SDL_HWPALETTE; + //TODO SDL_DitherColors(SDL_ShadowSurface->format->palette->colors, + // SDL_ShadowSurface->format->BitsPerPixel); + } + SDL_FillRect(SDL_ShadowSurface, NULL, + SDL_MapRGB(SDL_ShadowSurface->format, 0, 0, 0)); + } + SDL_PublicSurface = + (SDL_ShadowSurface ? SDL_ShadowSurface : SDL_VideoSurface); + + ClearVideoSurface(); + + /* We're finally done! */ + return SDL_PublicSurface; +} diff --git a/libmupen64plus/mupen64plus-core/src/debugger/dbg_breakpoints.c b/libmupen64plus/mupen64plus-core/src/debugger/dbg_breakpoints.c new file mode 100644 index 0000000000..a297580f9b --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/debugger/dbg_breakpoints.c @@ -0,0 +1,217 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - dbg_breakpoints.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2008 DarkJeztr HyperHacker * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include + +#include "dbg_types.h" +#include "debugger.h" +#include "dbg_breakpoints.h" +#include "dbg_memory.h" + +#include "api/m64p_types.h" +#include "api/callbacks.h" + +int g_NumBreakpoints=0; +breakpoint g_Breakpoints[BREAKPOINTS_MAX_NUMBER]; + + +int add_breakpoint( uint32 address ) +{ + if( g_NumBreakpoints == BREAKPOINTS_MAX_NUMBER ) { + DebugMessage(M64MSG_ERROR, "BREAKPOINTS_MAX_NUMBER have been reached."); + return -1; + } + g_Breakpoints[g_NumBreakpoints].address=address; + g_Breakpoints[g_NumBreakpoints].endaddr=address; + BPT_SET_FLAG(g_Breakpoints[g_NumBreakpoints], BPT_FLAG_EXEC); + + enable_breakpoint(g_NumBreakpoints); + + return g_NumBreakpoints++; +} + +int add_breakpoint_struct(breakpoint* newbp) +{ + if( g_NumBreakpoints == BREAKPOINTS_MAX_NUMBER ) { + DebugMessage(M64MSG_ERROR, "BREAKPOINTS_MAX_NUMBER have been reached."); + return -1; + } + + memcpy(&g_Breakpoints[g_NumBreakpoints], newbp, sizeof(breakpoint)); + + if(BPT_CHECK_FLAG(g_Breakpoints[g_NumBreakpoints], BPT_FLAG_ENABLED)) + { + BPT_CLEAR_FLAG(g_Breakpoints[g_NumBreakpoints], BPT_FLAG_ENABLED); + enable_breakpoint( g_NumBreakpoints ); + } + + return g_NumBreakpoints++; +} + +void enable_breakpoint( int bpt) +{ + breakpoint *curBpt = g_Breakpoints + bpt; + uint64 bptAddr; + + if(BPT_CHECK_FLAG((*curBpt), BPT_FLAG_READ)) { + for(bptAddr = curBpt->address; bptAddr <= (curBpt->endaddr | 0xFFFF); bptAddr+=0x10000) + if(lookup_breakpoint((uint32) bptAddr & 0xFFFF0000, 0x10000, BPT_FLAG_ENABLED | BPT_FLAG_READ) == -1) + activate_memory_break_read((uint32) bptAddr); + } + + if(BPT_CHECK_FLAG((*curBpt), BPT_FLAG_WRITE)) { + for(bptAddr = curBpt->address; bptAddr <= (curBpt->endaddr | 0xFFFF); bptAddr+=0x10000) + if(lookup_breakpoint((uint32) bptAddr & 0xFFFF0000, 0x10000, BPT_FLAG_ENABLED | BPT_FLAG_WRITE) == -1) + activate_memory_break_write((uint32) bptAddr); + } + + BPT_SET_FLAG(g_Breakpoints[bpt], BPT_FLAG_ENABLED); +} + +void disable_breakpoint( int bpt ) +{ + breakpoint *curBpt = g_Breakpoints + bpt; + uint64 bptAddr; + + BPT_CLEAR_FLAG(g_Breakpoints[bpt], BPT_FLAG_ENABLED); + + if(BPT_CHECK_FLAG((*curBpt), BPT_FLAG_READ)) { + for(bptAddr = curBpt->address; bptAddr <= ((unsigned long)(curBpt->endaddr | 0xFFFF)); bptAddr+=0x10000) + if(lookup_breakpoint((uint32) bptAddr & 0xFFFF0000, 0x10000, BPT_FLAG_ENABLED | BPT_FLAG_READ) == -1) + deactivate_memory_break_read((uint32) bptAddr); + } + + if(BPT_CHECK_FLAG((*curBpt), BPT_FLAG_WRITE)) { + for(bptAddr = curBpt->address; bptAddr <= ((unsigned long)(curBpt->endaddr | 0xFFFF)); bptAddr+=0x10000) + if(lookup_breakpoint((uint32) bptAddr & 0xFFFF0000, 0x10000, BPT_FLAG_ENABLED | BPT_FLAG_WRITE) == -1) + deactivate_memory_break_write((uint32) bptAddr); + } + + BPT_CLEAR_FLAG(g_Breakpoints[bpt], BPT_FLAG_ENABLED); +} + +void remove_breakpoint_by_num( int bpt ) +{ + int curBpt; + + if(BPT_CHECK_FLAG(g_Breakpoints[bpt], BPT_FLAG_ENABLED)) + disable_breakpoint( bpt ); + + for(curBpt=bpt+1; curBpt= g_Breakpoints[i].address) || + (address <= g_Breakpoints[i].endaddr)) + return i; + } + else // endaddr >= address + { + if((endaddr >= g_Breakpoints[i].address) && + (address <= g_Breakpoints[i].endaddr)) + return i; + } + } + } + return -1; +} + +int check_breakpoints( uint32 address ) +{ + return lookup_breakpoint( address, 1, BPT_FLAG_ENABLED | BPT_FLAG_EXEC ); +} + + +int check_breakpoints_on_mem_access( uint32 pc, uint32 address, uint32 size, uint32 flags ) +{ + //This function handles memory read/write breakpoints. size specifies the address + //range to check, flags specifies the flags that all need to be set. + //It automatically stops and updates the debugger on hit, so the memory access + //functions only need to call it and can discard the result. + int bpt; + if(run == 2) + { + bpt=lookup_breakpoint( address, size, flags ); + if(bpt != -1) + { + if(BPT_CHECK_FLAG(g_Breakpoints[bpt], BPT_FLAG_LOG)) + log_breakpoint(pc, flags, address); + + run = 0; + update_debugger(pc); + + return bpt; + } + } + return -1; +} + +int log_breakpoint(uint32 PC, uint32 Flag, uint32 Access) +{ + char msg[32]; + + if(Flag & BPT_FLAG_READ) sprintf(msg, "0x%08X read 0x%08X", PC, Access); + else if(Flag & BPT_FLAG_WRITE) sprintf(msg, "0x%08X wrote 0x%08X", PC, Access); + else sprintf(msg, "0x%08X executed", PC); + DebugMessage(M64MSG_INFO, "BPT: %s", msg); + return 0; +} + diff --git a/libmupen64plus/mupen64plus-core/src/debugger/dbg_breakpoints.h b/libmupen64plus/mupen64plus-core/src/debugger/dbg_breakpoints.h new file mode 100644 index 0000000000..e6d163fe5d --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/debugger/dbg_breakpoints.h @@ -0,0 +1,43 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - dbg_breakpoints.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2008 DarkJeztr HyperHacker * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __BREAKPOINTS_H__ +#define __BREAKPOINTS_H__ + +#include "../api/m64p_types.h" + +extern int g_NumBreakpoints; +extern breakpoint g_Breakpoints[]; + +int add_breakpoint( uint32 address ); +int add_breakpoint_struct(breakpoint* newbp); +void remove_breakpoint_by_address( uint32 address ); +void remove_breakpoint_by_num( int bpt ); +void enable_breakpoint( int breakpoint ); +void disable_breakpoint( int breakpoint ); +int check_breakpoints( uint32 address ); +int check_breakpoints_on_mem_access( uint32 pc, uint32 address, uint32 size, uint32 flags ); +int lookup_breakpoint( uint32 address, uint32 size, uint32 flags ); +int log_breakpoint(uint32 PC, uint32 Flag, uint32 Access); +void replace_breakpoint_num( int, breakpoint* ); + +#endif /* __BREAKPOINTS_H__ */ + diff --git a/libmupen64plus/mupen64plus-core/src/debugger/dbg_decoder.c b/libmupen64plus/mupen64plus-core/src/debugger/dbg_decoder.c new file mode 100644 index 0000000000..6cd56ba7ba --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/debugger/dbg_decoder.c @@ -0,0 +1,822 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus -- dbg_decoder.c * + * Copyright (c) 2010 Marshall B. Rogers * + * http://64.vg/ * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * This is a heavily modified reentrant version of the MIPS disassembler found + * in the NetBSD operating system. I chose to use this as a base due to the + * small, compact, and easily manageable code. + * + * Original copyright/license information is contained below. + */ + +/* $NetBSD: db_disasm.c,v 1.21 2009/12/14 00:46:06 matt Exp $ */ + +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Ralph Campbell. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: @(#)kadb.c 8.1 (Berkeley) 6/10/93 + */ +#include +#include +#include +#include +#ifndef MIPS32 + #define MIPS32 +#endif +#include "dbg_decoder.h" +#include "dbg_decoder_local.h" +#include "osal/preproc.h" + + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Data types + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +typedef uint32_t db_addr_t; + + + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Local variables + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +static const char * const r4k_str_op_name[64] = +{ +/* 0 */ "spec", "bcond","j", "jal", "beq", "bne", "blez", "bgtz", +/* 8 */ "addi", "addiu","slti", "sltiu","andi", "ori", "xori", "lui", +/*16 */ "cop0", "cop1", "cop2", "cop3", "beql", "bnel", "blezl","bgtzl", +/*24 */ "daddi","daddiu","ldl", "ldr", "op34", "op35", "op36", "op37", +/*32 */ "lb", "lh", "lwl", "lw", "lbu", "lhu", "lwr", "lwu", +/*40 */ "sb", "sh", "swl", "sw", "sdl", "sdr", "swr", "cache", +/*48 */ "ll", "lwc1", "lwc2", "lwc3", "lld", "ldc1", "ldc2", "ld", +/*56 */ "sc", "swc1", "swc2", "swc3", "scd", "sdc1", "sdc2", "sd" +}; + +static const char * const r4k_str_spec_name[64] = +{ +/* 0 */ "sll", "spec01","srl", "sra", "sllv", "spec05","srlv","srav", +/* 8 */ "jr", "jalr", "spec12","spec13","syscall","break","spec16","sync", +/*16 */ "mfhi", "mthi", "mflo", "mtlo", "dsllv","spec25","dsrlv","dsrav", +/*24 */ "mult", "multu","div", "divu", "dmult","dmultu","ddiv","ddivu", +/*32 */ "add", "addu", "sub", "subu", "and", "or", "xor", "nor", +/*40 */ "spec50","spec51","slt","sltu", "dadd","daddu","dsub","dsubu", +/*48 */ "tge","tgeu","tlt","tltu","teq","spec65","tne","spec67", +/*56 */ "dsll","spec71","dsrl","dsra","dsll32","spec75","dsrl32","dsra32" +}; + +static const char * const r4k_str_spec2_name[4] = /* QED RM4650, R5000, etc. */ +{ +/* 0 */ "mad", "madu", "mul", "spec3" +}; + +static const char * const r4k_str_bcond_name[32] = +{ +/* 0 */ "bltz", "bgez", "bltzl", "bgezl", "?", "?", "?", "?", +/* 8 */ "tgei", "tgeiu", "tlti", "tltiu", "teqi", "?", "tnei", "?", +/*16 */ "bltzal", "bgezal", "bltzall", "bgezall", "?", "?", "?", "?", +/*24 */ "?", "?", "?", "?", "?", "?", "?", "?", +}; + +static const char * const r4k_str_cop1_name[64] = +{ +/* 0 */ "add", "sub", "mul", "div", "sqrt","abs", "mov", "neg", +/* 8 */ "fop08", "trunc.l","fop0a","fop0b","fop0c","trunc.w","fop0e","fop0f", +/*16 */ "fop10", "fop11","fop12","fop13","fop14","fop15","fop16","fop17", +/*24 */ "fop18", "fop19","fop1a","fop1b","fop1c","fop1d","fop1e","fop1f", +/*32 */ "cvt.s", "cvt.d","fop22","fop23","cvt.w","cvt.l","fop26","fop27", +/*40 */ "fop28", "fop29","fop2a","fop2b","fop2c","fop2d","fop2e","fop2f", +/*48 */ "c.f", "c.un","c.eq","c.ueq","c.olt","c.ult", + "c.ole", "c.ule", +/*56 */ "c.sf", "c.ngle","c.seq","c.ngl","c.lt","c.nge", + "c.le", "c.ngt" +}; + +static const char * const r4k_str_fmt_name[16] = +{ + + "s", "d", "e", "fmt3", + "w", "l", "fmt6", "fmt7", + "fmt8", "fmt9", "fmta", "fmtb", + "fmtc", "fmtd", "fmte", "fmtf" +}; + + +static const char * const r4k_str_reg_name[32] = +{ + "$zero", "$at", "v0", "v1", "a0", "a1", "a2", "a3", + "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", + "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", + "t8", "t9", "k0", "k1", "$gp", "$sp", "s8", "$ra" +}; + +static const char * const r4k_str_c0_opname[64] = +{ + "c0op00","tlbr", "tlbwi", "c0op03","c0op04","c0op05","tlbwr", "c0op07", + "tlbp", "c0op11","c0op12","c0op13","c0op14","c0op15","c0op16","c0op17", + "rfe", "c0op21","c0op22","c0op23","c0op24","c0op25","c0op26","c0op27", + "eret", "c0op31","c0op32","c0op33","c0op34","c0op35","c0op36","c0op37", + "c0op40","c0op41","c0op42","c0op43","c0op44","c0op45","c0op46","c0op47", + "c0op50","c0op51","c0op52","c0op53","c0op54","c0op55","c0op56","c0op57", + "c0op60","c0op61","c0op62","c0op63","c0op64","c0op65","c0op66","c0op67", + "c0op70","c0op71","c0op72","c0op73","c0op74","c0op75","c0op77","c0op77", +}; + +static const char * const r4k_str_c0_reg[32] = +{ + "C0_INX", "C0_RAND", "C0_ENTRYLO0", "C0_ENTRYLO1", + "C0_CONTEXT", "C0_PAGEMASK", "C0_WIRED", "cp0r7", + "C0_BADVADDR", "C0_COUNT", "C0_ENTRYHI", "C0_COMPARE", + "C0_SR", "C0_CAUSE", "C0_EPC", "C0_PRID", + "C0_CONFIG", "C0_LLADDR", "C0_WATCHLO", "C0_WATCHHI", + "xcontext", "cp0r21", "cp0r22", "debug", + "depc", "perfcnt", "C0_ECC", "C0_CACHE_ERR", + "C0_TAGLO", "C0_TAGHI", "C0_ERROR_EPC", "desave" +}; + + + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Local functions - lookup + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +/* Look up a symbol */ +static char * +lookup_sym ( struct r4k_dis_t * state, + uint32_t address ) +{ + if( state->lookup_sym ) + return state->lookup_sym( address, state->lookup_sym_d ); + + return NULL; +} + +/* Look up an upper 16-bits relocation */ +static char * +lookup_rel_hi16 ( struct r4k_dis_t * state, + uint32_t address ) +{ + if( state->lookup_rel_hi16 ) + return state->lookup_rel_hi16( address, state->lookup_rel_hi16_d ); + + return NULL; +} + +/* Look up a lower 16-bits relocation */ +static char * +lookup_rel_lo16 ( struct r4k_dis_t * state, + uint32_t address ) +{ + if( state->lookup_rel_lo16 ) + return state->lookup_rel_lo16( address, state->lookup_rel_lo16_d ); + + return NULL; +} + + + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Local functions - disassembler + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +/* Print text into the destination buffer */ +static int +db_printf ( struct r4k_dis_t * state, + char * fmt, + ... ) +{ + int l; + va_list ap; + char buffer[1024]; + + + /* Prepare user provided */ + va_start( ap, fmt ); + l = vsnprintf( buffer, sizeof(buffer), fmt, ap ); + va_end( ap ); + + /* Add it to our string */ + state->dest += sprintf( + state->dest, + "%s", + buffer + ); + state->length += l; + + return l; +} + + +/* Print an address to a string. If there's a symbol, the name will be printed */ +static int +print_addr ( struct r4k_dis_t * state, + uint32_t address ) +{ + int len; + char * sym; + + + /* Try to lookup symbol */ + if( (sym = lookup_sym(state, address)) ) + { + len = db_printf( state, "%s", sym ); + } + else + { + len = db_printf( state, "0x%08X", address ); + } + + return len; +} + + +/* Disassemble an instruction */ +static db_addr_t +db_disasm_insn ( struct r4k_dis_t * state, + int insn, + db_addr_t loc, + bool altfmt ) +{ + char * rel; + InstFmt i; + + i.word = insn; + + switch (i.JType.op) { + case OP_SPECIAL: + if (i.word == 0) { + db_printf(state, "nop"); + break; + } + /* XXX + * "addu" is a "move" only in 32-bit mode. What's the correct + * answer - never decode addu/daddu as "move"? + */ + if (i.RType.func == OP_ADDU && i.RType.rt == 0) { + db_printf(state, "%-16s%s,%s", + "move", + r4k_str_reg_name[i.RType.rd], + r4k_str_reg_name[i.RType.rs]); + break; + } + db_printf(state, "%-16s", r4k_str_spec_name[i.RType.func]); + switch (i.RType.func) { + case OP_SLL: + case OP_SRL: + case OP_SRA: + case OP_DSLL: + + case OP_DSRL: + case OP_DSRA: + case OP_DSLL32: + case OP_DSRL32: + case OP_DSRA32: + db_printf(state, "%s,%s,%d", + r4k_str_reg_name[i.RType.rd], + r4k_str_reg_name[i.RType.rt], + i.RType.shamt); + break; + + case OP_SLLV: + case OP_SRLV: + case OP_SRAV: + case OP_DSLLV: + case OP_DSRLV: + case OP_DSRAV: + db_printf(state, "%s,%s,%s", + r4k_str_reg_name[i.RType.rd], + r4k_str_reg_name[i.RType.rt], + r4k_str_reg_name[i.RType.rs]); + break; + + case OP_MFHI: + case OP_MFLO: + db_printf(state, "%s", r4k_str_reg_name[i.RType.rd]); + break; + + case OP_JR: + case OP_JALR: + db_printf(state, "%s", r4k_str_reg_name[i.RType.rs]); + break; + case OP_MTLO: + case OP_MTHI: + db_printf(state, "%s", r4k_str_reg_name[i.RType.rs]); + break; + + case OP_MULT: + case OP_MULTU: + case OP_DMULT: + case OP_DMULTU: + db_printf(state, "%s,%s", + r4k_str_reg_name[i.RType.rs], + r4k_str_reg_name[i.RType.rt]); + break; + + case OP_DIV: + case OP_DIVU: + case OP_DDIV: + case OP_DDIVU: + db_printf(state, "$zero,%s,%s", + r4k_str_reg_name[i.RType.rs], + r4k_str_reg_name[i.RType.rt]); + break; + + + case OP_SYSCALL: + case OP_SYNC: + break; + + case OP_BREAK: + db_printf(state, "%d", (i.RType.rs << 5) | i.RType.rt); + break; + + default: + db_printf(state, "%s,%s,%s", + r4k_str_reg_name[i.RType.rd], + r4k_str_reg_name[i.RType.rs], + r4k_str_reg_name[i.RType.rt]); + } + break; + + case OP_SPECIAL2: + if (i.RType.func == OP_MUL) + db_printf(state, "%s\t%s,%s,%s", + r4k_str_spec2_name[i.RType.func & 0x3], + r4k_str_reg_name[i.RType.rd], + r4k_str_reg_name[i.RType.rs], + r4k_str_reg_name[i.RType.rt]); + else + db_printf(state, "%s\t%s,%s", + r4k_str_spec2_name[i.RType.func & 0x3], + r4k_str_reg_name[i.RType.rs], + r4k_str_reg_name[i.RType.rt]); + + break; + + case OP_BCOND: + db_printf(state, "%-16s%s,", r4k_str_bcond_name[i.IType.rt], + r4k_str_reg_name[i.IType.rs]); + goto pr_displ; + + case OP_BLEZ: + case OP_BLEZL: + case OP_BGTZ: + case OP_BGTZL: + db_printf(state, "%-16s%s,", r4k_str_op_name[i.IType.op], + r4k_str_reg_name[i.IType.rs]); + goto pr_displ; + + case OP_BEQ: + case OP_BEQL: + if (i.IType.rs == 0 && i.IType.rt == 0) { + db_printf(state, "%-16s", "b"); + goto pr_displ; + } + /* FALLTHROUGH */ + case OP_BNE: + case OP_BNEL: + db_printf(state, "%-16s%s,%s,", r4k_str_op_name[i.IType.op], + r4k_str_reg_name[i.IType.rs], + r4k_str_reg_name[i.IType.rt]); + pr_displ: + print_addr( state, loc + 4 + ((short)i.IType.imm << 2) ); + break; + + case OP_COP0: + switch (i.RType.rs) { + case OP_BCx: + case OP_BCy: + + db_printf(state, "bc0%c\t", + "ft"[i.RType.rt & COPz_BC_TF_MASK]); + goto pr_displ; + + case OP_MT: + db_printf(state, "%-16s%s,%s", + "mtc0", + r4k_str_reg_name[i.RType.rt], + r4k_str_c0_reg[i.RType.rd]); + break; + + case OP_DMT: + db_printf(state, "%-16s%s,%s", + "dmtc0", + r4k_str_reg_name[i.RType.rt], + r4k_str_c0_reg[i.RType.rd]); + break; + + case OP_MF: + db_printf(state, "%-16s%s,%s", "mfc0", + r4k_str_reg_name[i.RType.rt], + r4k_str_c0_reg[i.RType.rd]); + break; + + case OP_DMF: + db_printf(state, "%-16s%s,%s","dmfc0", + r4k_str_reg_name[i.RType.rt], + r4k_str_c0_reg[i.RType.rd]); + break; + + default: + db_printf(state, "%s", r4k_str_c0_opname[i.FRType.func]); + } + break; + + case OP_COP1: + switch (i.RType.rs) { + case OP_BCx: + case OP_BCy: + db_printf(state, "bc1%c%s\t\t", + "ft"[i.RType.rt & COPz_BC_TF_MASK], + (insn >> 16 & 0x1F) == 2 || (insn >> 16 & 0x1F) == 3 ? "l" : ""); + goto pr_displ; + + case OP_MT: + db_printf(state, "mtc1\t\t%s,$f%d", + r4k_str_reg_name[i.RType.rt], + i.RType.rd); + break; + + case OP_MF: + db_printf(state, "mfc1\t\t%s,$f%d", + r4k_str_reg_name[i.RType.rt], + i.RType.rd); + break; + + case OP_CT: + db_printf(state, "ctc1\t\t%s,$f%d", + r4k_str_reg_name[i.RType.rt], + i.RType.rd); + break; + + case OP_CF: + db_printf(state, "cfc1\t\t%s,$f%d", + r4k_str_reg_name[i.RType.rt], + i.RType.rd); + break; + + case OP_DMT: + db_printf(state, "dmtc1\t\t%s,$f%d", + r4k_str_reg_name[i.RType.rt], + i.RType.rd); + break; + + case OP_DMF: + db_printf(state, "dmfc1\t\t%s,$f%d", + r4k_str_reg_name[i.RType.rt], + i.RType.rd); + break; + + case OP_MTH: + db_printf(state, "mthc1\t\t%s,$f%d", + r4k_str_reg_name[i.RType.rt], + i.RType.rd); + break; + + case OP_MFH: + db_printf(state, "mfhc1\t\t%s,$f%d", + r4k_str_reg_name[i.RType.rt], + i.RType.rd); + break; + + + default: + + if( i.FRType.func == 0x21 || i.FRType.func == 0x20 || i.FRType.func == 0x24 || i.FRType.func == 0x25 || + i.FRType.func == 7 || i.FRType.func == 6 || i.FRType.func == 0xd || + i.FRType.func == 4 || i.FRType.func == 5 || i.FRType.func == 9 ) + {/*NEG.fmt fd, fs*/ + + db_printf(state, "%s.%s\t\t$f%d,$f%d", + r4k_str_cop1_name[i.FRType.func], + r4k_str_fmt_name[i.FRType.fmt], + i.FRType.fd, i.FRType.fs); + } + else if( i.FRType.func != 1 && i.FRType.func != 2 && (insn & 0x3F) && !(insn >> 6 & 0x1F) ) /* C */ + { + db_printf(state, "%s.%s\t\t$f%d,$f%d", + r4k_str_cop1_name[i.FRType.func], + r4k_str_fmt_name[i.FRType.fmt], + i.FRType.fs, i.FRType.ft); + } + else + { + db_printf(state, "%s.%s\t\t$f%d,$f%d,$f%d", + r4k_str_cop1_name[i.FRType.func], + r4k_str_fmt_name[i.FRType.fmt], + i.FRType.fd, i.FRType.fs, i.FRType.ft); + } + } + break; + + case OP_J: + case OP_JAL: + db_printf(state, "%-16s", r4k_str_op_name[i.JType.op]); + print_addr(state, (loc & 0xF0000000) | (i.JType.target << 2)); + break; + + case OP_LDC1: + case OP_LWC1: + case OP_SWC1: + case OP_SDC1: + db_printf(state, "%-16s$f%d,", r4k_str_op_name[i.IType.op], + i.IType.rt); + goto loadstore; + + case OP_LB: + case OP_LH: + case OP_LW: + case OP_LWL: + case OP_LWR: + case OP_LD: + case OP_LBU: + case OP_LHU: + case OP_LWU: + case OP_SB: + case OP_SH: + case OP_SW: + case OP_SWL: + case OP_SWR: + case OP_SD: + db_printf(state, "%-16s%s,", r4k_str_op_name[i.IType.op], + r4k_str_reg_name[i.IType.rt]); + loadstore: + + /* Part of a relocation? */ + if( (rel = lookup_rel_lo16(state, loc)) ) + { + /* Yes. */ + db_printf(state, + "%%lo(%s)(%s)", + rel, + r4k_str_reg_name[i.IType.rs] + ); + + break; + } + + + db_printf(state, "%d(%s)", (short)i.IType.imm, + r4k_str_reg_name[i.IType.rs]); + break; + + case OP_ORI: + case OP_XORI: + if( i.IType.op == OP_ORI ) + { + /* Part of a relocation? */ + if( (rel = lookup_rel_lo16(state, loc)) ) + { + /* Yes. */ + db_printf(state, + "%-16s%s,%s,%%lo(%s)", + r4k_str_op_name[i.IType.op], + r4k_str_reg_name[i.IType.rt], + r4k_str_reg_name[i.IType.rs], + rel + ); + + break; + } + else + { + db_printf(state, "%-16s%s,%s,0x%x", r4k_str_op_name[i.IType.op], + r4k_str_reg_name[i.IType.rt], + r4k_str_reg_name[i.IType.rs], + i.IType.imm); + + break; + } + } + else + if (i.IType.rs == 0) { + db_printf(state, "%-16s%s,0x%x", + "li", + r4k_str_reg_name[i.IType.rt], + i.IType.imm); + break; + } + /* FALLTHROUGH */ + case OP_ANDI: + db_printf(state, "%-16s%s,%s,0x%x", r4k_str_op_name[i.IType.op], + r4k_str_reg_name[i.IType.rt], + r4k_str_reg_name[i.IType.rs], + i.IType.imm); + break; + + case OP_LUI: + { + /* Part of a relocation? */ + if( (rel = lookup_rel_hi16(state, loc)) ) + { + /* Yes. */ + db_printf(state, + "%-16s%s,%%hi(%s)", + r4k_str_op_name[i.IType.op], + r4k_str_reg_name[i.IType.rt], + rel + ); + } + else + { + db_printf(state, "%-16s%s,0x%x", r4k_str_op_name[i.IType.op], + r4k_str_reg_name[i.IType.rt], + i.IType.imm); + } + } + break; + + case OP_CACHE: + db_printf(state, "%-16s0x%x,0x%x(%s)", + r4k_str_op_name[i.IType.op], + i.IType.rt, + i.IType.imm, + r4k_str_reg_name[i.IType.rs]); + break; + + case OP_ADDI: + case OP_DADDI: + case OP_ADDIU: + case OP_DADDIU: + { + + /* Part of a relocation? */ + if( (rel = lookup_rel_lo16(state, loc)) ) + { + /* Yes. */ + db_printf(state, + "%-16s%s,%s,%%lo(%s)", + r4k_str_op_name[i.IType.op], + r4k_str_reg_name[i.IType.rt], + r4k_str_reg_name[i.IType.rs], + rel + ); + + break; + } + + if (i.IType.rs == 0) { + db_printf(state, "%-16s%s,%d", "li", + r4k_str_reg_name[i.IType.rt], + (short)i.IType.imm); + break; + } + /* FALLTHROUGH */ + + default: + + db_printf(state, "%-16s%s,%s,%d", r4k_str_op_name[i.IType.op], + r4k_str_reg_name[i.IType.rt], + r4k_str_reg_name[i.IType.rs], + (short)i.IType.imm); + } } + /*db_printf(state, "\n");*/ + + return (loc + 4); +} + + + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Global functions + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +/* Disassemble an instruction with state */ +static int +r4k_disassemble ( struct r4k_dis_t * state, + uint32_t instruction, + uint32_t location, + char * dest ) +{ + state->dest = dest; + db_disasm_insn( state, instruction, location, 0 ); + + return state->length; +} + + + +/* Disassemble an instruction but split the opcode/operands into two char *'s */ +static int +r4k_disassemble_split ( struct r4k_dis_t * state, + uint32_t instruction, + uint32_t location, + char ** opcode, + char ** operands ) +{ + int v, i; + char buff[128], * dupd; + + v = r4k_disassemble( + state, + instruction, + location, + buff + ); + + dupd = strdup( buff ); + *opcode = &dupd[0]; + + for( i = 0; buff[i] && buff[i] != ' '; i++ ); + + dupd[i] = '\0'; + + for( ; buff[i] && buff[i] == ' '; i++ ); + + *operands = &dupd[i]; + + return v; +} + + + +/* Disassemble an instruction with a blank state but split op/operands */ +static int +r4k_disassemble_split_quick ( uint32_t instruction, + uint32_t location, + char ** opcode, + char ** operands ) +{ + struct r4k_dis_t state; + + /* Init state */ + memset( &state, 0, sizeof(state) ); + + /* Perform */ + return r4k_disassemble_split( + &state, + instruction, + location, + opcode, + operands + ); +} + + +//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=[ DECODE_OP ]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=[// + +void r4300_decode_op ( uint32 instr, char * opcode, char * arguments, int counter ) +{ + char * _op, * _args; + + _op = NULL; + _args = NULL; + + r4k_disassemble_split_quick( + instr, + counter, + &_op, + &_args + ); + + strcpy( opcode, _op ); + strcpy( arguments, _args ); + + free( _op ); +} + diff --git a/libmupen64plus/mupen64plus-core/src/debugger/dbg_decoder.h b/libmupen64plus/mupen64plus-core/src/debugger/dbg_decoder.h new file mode 100644 index 0000000000..cd3b93098f --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/debugger/dbg_decoder.h @@ -0,0 +1,61 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - dbg_decoder.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2010 Marshall B. Rogers * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __DECODER_H__ +#define __DECODER_H__ + +#include "dbg_types.h" + +#if defined(WIN32) +typedef unsigned int uint32_t; +typedef unsigned char bool; +#define false 0 +#define true 1 +#else +#include +#include +#endif + +/* Disassembler lookup handler */ +typedef char * (*r4k_lookup_func)(uint32_t, void *); + +/* Disassembler state */ +typedef +struct r4k_dis_t +{ + r4k_lookup_func lookup_sym; + void * lookup_sym_d; + r4k_lookup_func lookup_rel_hi16; + void * lookup_rel_hi16_d; + r4k_lookup_func lookup_rel_lo16; + void * lookup_rel_lo16_d; + + /* Private */ + char * dest; + int length; +} +R4kDis; + +extern void r4300_decode_op ( uint32, char *, char *, int ); + + +#endif /* __DECODER_H__ */ + diff --git a/libmupen64plus/mupen64plus-core/src/debugger/dbg_decoder_local.h b/libmupen64plus/mupen64plus-core/src/debugger/dbg_decoder_local.h new file mode 100644 index 0000000000..5ec6372ff0 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/debugger/dbg_decoder_local.h @@ -0,0 +1,1481 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - dbg_debugger_local.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2010 Marshall B. Rogers * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#ifndef __DECODER_LOCAL_H__ +#define __DECODER_LOCAL_H__ + +#include + +/* $NetBSD: cpuregs.h,v 1.77 2009/12/14 00:46:04 matt Exp $ */ + +/* + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Ralph Campbell and Rick Macklem. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)machConst.h 8.1 (Berkeley) 6/10/93 + * + * machConst.h -- + * + * Machine dependent constants. + * + * Copyright (C) 1989 Digital Equipment Corporation. + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appears in all copies. + * Digital Equipment Corporation makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * from: Header: /sprite/src/kernel/mach/ds3100.md/RCS/machConst.h, + * v 9.2 89/10/21 15:55:22 jhh Exp SPRITE (DECWRL) + * from: Header: /sprite/src/kernel/mach/ds3100.md/RCS/machAddrs.h, + * v 1.2 89/08/15 18:28:21 rab Exp SPRITE (DECWRL) + * from: Header: /sprite/src/kernel/vm/ds3100.md/RCS/vmPmaxConst.h, + * v 9.1 89/09/18 17:33:00 shirriff Exp SPRITE (DECWRL) + */ + +#ifndef _MIPS_CPUREGS_H_ +#define _MIPS_CPUREGS_H_ + + +/* + * Address space. + * 32-bit mips CPUS partition their 32-bit address space into four segments: + * + * kuseg 0x00000000 - 0x7fffffff User virtual mem, mapped + * kseg0 0x80000000 - 0x9fffffff Physical memory, cached, unmapped + * kseg1 0xa0000000 - 0xbfffffff Physical memory, uncached, unmapped + * kseg2 0xc0000000 - 0xffffffff kernel-virtual, mapped + * + * mips1 physical memory is limited to 512Mbytes, which is + * doubly mapped in kseg0 (cached) and kseg1 (uncached.) + * Caching of mapped addresses is controlled by bits in the TLB entry. + */ + +#ifdef _LP64 +#define MIPS_XUSEG_START (0L << 62) +#define MIPS_XUSEG_P(x) (((uint64_t)(x) >> 62) == 0) +#define MIPS_USEG_P(x) ((uintptr_t)(x) < 0x80000000L) +#define MIPS_XSSEG_START (1L << 62) +#define MIPS_XSSEG_P(x) (((uint64_t)(x) >> 62) == 1) +#endif + +/* + * MIPS addresses are signed and we defining as negative so that + * in LP64 kern they get sign-extended correctly. + */ +#ifndef _LOCORE +#define MIPS_KSEG0_START (-0x7fffffffL-1) /* 0x80000000 */ +#define MIPS_KSEG1_START -0x60000000L /* 0xa0000000 */ +#define MIPS_KSEG2_START -0x40000000L /* 0xc0000000 */ +#define MIPS_MAX_MEM_ADDR -0x42000000L /* 0xbe000000 */ +#define MIPS_RESERVED_ADDR -0x40380000L /* 0xbfc80000 */ +#endif + +#define MIPS_PHYS_MASK 0x1fffffff + +#define MIPS_KSEG0_TO_PHYS(x) ((uintptr_t)(x) & MIPS_PHYS_MASK) +#define MIPS_PHYS_TO_KSEG0(x) ((uintptr_t)(x) | (intptr_t)MIPS_KSEG0_START) +#define MIPS_KSEG1_TO_PHYS(x) ((uintptr_t)(x) & MIPS_PHYS_MASK) +#define MIPS_PHYS_TO_KSEG1(x) ((uintptr_t)(x) | (intptr_t)MIPS_KSEG1_START) + +#define MIPS_KSEG0_P(x) (((intptr_t)(x) & ~MIPS_PHYS_MASK) == MIPS_KSEG0_START) +#define MIPS_KSEG1_P(x) (((intptr_t)(x) & ~MIPS_PHYS_MASK) == MIPS_KSEG1_START) +#define MIPS_KSEG2_P(x) ((uintptr_t)MIPS_KSEG2_START <= (uintptr_t)(x)) + +/* Map virtual address to index in mips3 r4k virtually-indexed cache */ +#define MIPS3_VA_TO_CINDEX(x) \ + (((intptr_t)(x) & 0xffffff) | MIPS_KSEG0_START) + +#ifndef _LOCORE +#define MIPS_XSEG_MASK (0x3fffffffffffffffLL) +#define MIPS_XKSEG_START (0x3ULL << 62) +#define MIPS_XKSEG_P(x) (((uint64_t)(x) >> 62) == 3) + +#define MIPS_XKPHYS_START (0x2ULL << 62) +#define MIPS_PHYS_TO_XKPHYS_UNCACHED(x) \ + (MIPS_XKPHYS_START | ((uint64_t)(CCA_UNCACHED) << 59) | (x)) +#define MIPS_PHYS_TO_XKPHYS_CACHED(x) \ + (mips3_xkphys_cached | (x)) +#define MIPS_PHYS_TO_XKPHYS(cca,x) \ + (MIPS_XKPHYS_START | ((uint64_t)(cca) << 59) | (x)) +#define MIPS_XKPHYS_TO_PHYS(x) ((uint64_t)(x) & 0x07ffffffffffffffLL) +#define MIPS_XKPHYS_TO_CCA(x) (((uint64_t)(x) >> 59) & 7) +#define MIPS_XKPHYS_P(x) (((uint64_t)(x) >> 62) == 2) +#endif /* _LOCORE */ + +#define CCA_UNCACHED 2 +#define CCA_CACHEABLE 3 /* cacheable non-coherent */ + +/* CPU dependent mtc0 hazard hook */ +#define COP0_SYNC /* nothing */ +#define COP0_HAZARD_FPUENABLE nop; nop; nop; nop; + +/* + * The bits in the cause register. + * + * Bits common to r3000 and r4000: + * + * MIPS_CR_BR_DELAY Exception happened in branch delay slot. + * MIPS_CR_COP_ERR Coprocessor error. + * MIPS_CR_IP Interrupt pending bits defined below. + * (same meaning as in CAUSE register). + * MIPS_CR_EXC_CODE The exception type (see exception codes below). + * + * Differences: + * r3k has 4 bits of execption type, r4k has 5 bits. + */ +#define MIPS_CR_BR_DELAY 0x80000000 +#define MIPS_CR_COP_ERR 0x30000000 +#define MIPS1_CR_EXC_CODE 0x0000003C /* four bits */ +#define MIPS3_CR_EXC_CODE 0x0000007C /* five bits */ +#define MIPS_CR_IP 0x0000FF00 +#define MIPS_CR_EXC_CODE_SHIFT 2 + +/* + * The bits in the status register. All bits are active when set to 1. + * + * R3000 status register fields: + * MIPS_SR_COP_USABILITY Control the usability of the four coprocessors. + * MIPS_SR_TS TLB shutdown. + * + * MIPS_SR_INT_IE Master (current) interrupt enable bit. + * + * Differences: + * r3k has cache control is via frobbing SR register bits, whereas the + * r4k cache control is via explicit instructions. + * r3k has a 3-entry stack of kernel/user bits, whereas the + * r4k has kernel/supervisor/user. + */ +#define MIPS_SR_COP_USABILITY 0xf0000000 +#define MIPS_SR_COP_0_BIT 0x10000000 +#define MIPS_SR_COP_1_BIT 0x20000000 + + /* r4k and r3k differences, see below */ + +#define MIPS_SR_MX 0x01000000 /* MIPS64 */ +#define MIPS_SR_PX 0x00800000 /* MIPS64 */ +#define MIPS_SR_BEV 0x00400000 /* Use boot exception vector */ +#define MIPS_SR_TS 0x00200000 + + /* r4k and r3k differences, see below */ + +#define MIPS_SR_INT_IE 0x00000001 +/*#define MIPS_SR_MBZ 0x0f8000c0*/ /* Never used, true for r3k */ +/*#define MIPS_SR_INT_MASK 0x0000ff00*/ + + +/* + * The R2000/R3000-specific status register bit definitions. + * all bits are active when set to 1. + * + * MIPS_SR_PARITY_ERR Parity error. + * MIPS_SR_CACHE_MISS Most recent D-cache load resulted in a miss. + * MIPS_SR_PARITY_ZERO Zero replaces outgoing parity bits. + * MIPS_SR_SWAP_CACHES Swap I-cache and D-cache. + * MIPS_SR_ISOL_CACHES Isolate D-cache from main memory. + * Interrupt enable bits defined below. + * MIPS_SR_KU_OLD Old kernel/user mode bit. 1 => user mode. + * MIPS_SR_INT_ENA_OLD Old interrupt enable bit. + * MIPS_SR_KU_PREV Previous kernel/user mode bit. 1 => user mode. + * MIPS_SR_INT_ENA_PREV Previous interrupt enable bit. + * MIPS_SR_KU_CUR Current kernel/user mode bit. 1 => user mode. + */ + +#define MIPS1_PARITY_ERR 0x00100000 +#define MIPS1_CACHE_MISS 0x00080000 +#define MIPS1_PARITY_ZERO 0x00040000 +#define MIPS1_SWAP_CACHES 0x00020000 +#define MIPS1_ISOL_CACHES 0x00010000 + +#define MIPS1_SR_KU_OLD 0x00000020 /* 2nd stacked KU/IE*/ +#define MIPS1_SR_INT_ENA_OLD 0x00000010 /* 2nd stacked KU/IE*/ +#define MIPS1_SR_KU_PREV 0x00000008 /* 1st stacked KU/IE*/ +#define MIPS1_SR_INT_ENA_PREV 0x00000004 /* 1st stacked KU/IE*/ +#define MIPS1_SR_KU_CUR 0x00000002 /* current KU */ + +/* backwards compatibility */ +#define MIPS_SR_PARITY_ERR MIPS1_PARITY_ERR +#define MIPS_SR_CACHE_MISS MIPS1_CACHE_MISS +#define MIPS_SR_PARITY_ZERO MIPS1_PARITY_ZERO +#define MIPS_SR_SWAP_CACHES MIPS1_SWAP_CACHES +#define MIPS_SR_ISOL_CACHES MIPS1_ISOL_CACHES + +#define MIPS_SR_KU_OLD MIPS1_SR_KU_OLD +#define MIPS_SR_INT_ENA_OLD MIPS1_SR_INT_ENA_OLD +#define MIPS_SR_KU_PREV MIPS1_SR_KU_PREV +#define MIPS_SR_KU_CUR MIPS1_SR_KU_CUR +#define MIPS_SR_INT_ENA_PREV MIPS1_SR_INT_ENA_PREV + +/* + * R4000 status register bit definitons, + * where different from r2000/r3000. + */ +#define MIPS3_SR_XX 0x80000000 +#define MIPS3_SR_RP 0x08000000 +#define MIPS3_SR_FR 0x04000000 +#define MIPS3_SR_RE 0x02000000 + +#define MIPS3_SR_DIAG_DL 0x01000000 /* QED 52xx */ +#define MIPS3_SR_DIAG_IL 0x00800000 /* QED 52xx */ +#define MIPS3_SR_PX 0x00800000 /* MIPS64 */ +#define MIPS3_SR_SR 0x00100000 +#define MIPS3_SR_NMI 0x00080000 /* MIPS32/64 */ +#define MIPS3_SR_DIAG_CH 0x00040000 +#define MIPS3_SR_DIAG_CE 0x00020000 +#define MIPS3_SR_DIAG_PE 0x00010000 +#define MIPS3_SR_EIE 0x00010000 /* TX79/R5900 */ +#define MIPS3_SR_KX 0x00000080 +#define MIPS3_SR_SX 0x00000040 +#define MIPS3_SR_UX 0x00000020 +#define MIPS3_SR_KSU_MASK 0x00000018 +#define MIPS3_SR_KSU_USER 0x00000010 +#define MIPS3_SR_KSU_SUPER 0x00000008 +#define MIPS3_SR_KSU_KERNEL 0x00000000 +#define MIPS3_SR_ERL 0x00000004 +#define MIPS3_SR_EXL 0x00000002 + +#ifdef MIPS3_5900 +#undef MIPS_SR_INT_IE +#define MIPS_SR_INT_IE 0x00010001 /* XXX */ +#endif + +#define MIPS_SR_SOFT_RESET MIPS3_SR_SOFT_RESET +#define MIPS_SR_DIAG_CH MIPS3_SR_DIAG_CH +#define MIPS_SR_DIAG_CE MIPS3_SR_DIAG_CE +#define MIPS_SR_DIAG_PE MIPS3_SR_DIAG_PE +#define MIPS_SR_KX MIPS3_SR_KX +#define MIPS_SR_SX MIPS3_SR_SX +#define MIPS_SR_UX MIPS3_SR_UX + +#define MIPS_SR_KSU_MASK MIPS3_SR_KSU_MASK +#define MIPS_SR_KSU_USER MIPS3_SR_KSU_USER +#define MIPS_SR_KSU_SUPER MIPS3_SR_KSU_SUPER +#define MIPS_SR_KSU_KERNEL MIPS3_SR_KSU_KERNEL +#define MIPS_SR_ERL MIPS3_SR_ERL +#define MIPS_SR_EXL MIPS3_SR_EXL + + +/* + * The interrupt masks. + * If a bit in the mask is 1 then the interrupt is enabled (or pending). + */ +#define MIPS_INT_MASK 0xff00 +#define MIPS_INT_MASK_5 0x8000 +#define MIPS_INT_MASK_4 0x4000 +#define MIPS_INT_MASK_3 0x2000 +#define MIPS_INT_MASK_2 0x1000 +#define MIPS_INT_MASK_1 0x0800 +#define MIPS_INT_MASK_0 0x0400 +#define MIPS_HARD_INT_MASK 0xfc00 +#define MIPS_SOFT_INT_MASK_1 0x0200 +#define MIPS_SOFT_INT_MASK_0 0x0100 + +/* + * mips3 CPUs have on-chip timer at INT_MASK_5. Each platform can + * choose to enable this interrupt. + */ +#if defined(MIPS3_ENABLE_CLOCK_INTR) +#define MIPS3_INT_MASK MIPS_INT_MASK +#define MIPS3_HARD_INT_MASK MIPS_HARD_INT_MASK +#else +#define MIPS3_INT_MASK (MIPS_INT_MASK & ~MIPS_INT_MASK_5) +#define MIPS3_HARD_INT_MASK (MIPS_HARD_INT_MASK & ~MIPS_INT_MASK_5) +#endif + +/* + * The bits in the context register. + */ +#define MIPS1_CNTXT_PTE_BASE 0xFFE00000 +#define MIPS1_CNTXT_BAD_VPN 0x001FFFFC + +#define MIPS3_CNTXT_PTE_BASE 0xFF800000 +#define MIPS3_CNTXT_BAD_VPN2 0x007FFFF0 + +/* + * The bits in the MIPS3 config register. + * + * bit 0..5: R/W, Bit 6..31: R/O + */ + +/* kseg0 coherency algorithm - see MIPS3_TLB_ATTR values */ +#define MIPS3_CONFIG_K0_MASK 0x00000007 + +/* + * R/W Update on Store Conditional + * 0: Store Conditional uses coherency algorithm specified by TLB + * 1: Store Conditional uses cacheable coherent update on write + */ +#define MIPS3_CONFIG_CU 0x00000008 + +#define MIPS3_CONFIG_DB 0x00000010 /* Primary D-cache line size */ +#define MIPS3_CONFIG_IB 0x00000020 /* Primary I-cache line size */ +#define MIPS3_CONFIG_CACHE_L1_LSIZE(config, bit) \ + (((config) & (bit)) ? 32 : 16) + +#define MIPS3_CONFIG_DC_MASK 0x000001c0 /* Primary D-cache size */ +#define MIPS3_CONFIG_DC_SHIFT 6 +#define MIPS3_CONFIG_IC_MASK 0x00000e00 /* Primary I-cache size */ +#define MIPS3_CONFIG_IC_SHIFT 9 +#define MIPS3_CONFIG_C_DEFBASE 0x1000 /* default base 2^12 */ + +/* Cache size mode indication: available only on Vr41xx CPUs */ +#define MIPS3_CONFIG_CS 0x00001000 +#define MIPS3_CONFIG_C_4100BASE 0x0400 /* base is 2^10 if CS=1 */ +#define MIPS3_CONFIG_CACHE_SIZE(config, mask, base, shift) \ + ((base) << (((config) & (mask)) >> (shift))) + +/* External cache enable: Controls L2 for R5000/Rm527x and L3 for Rm7000 */ +#define MIPS3_CONFIG_SE 0x00001000 + +/* Block ordering: 0: sequential, 1: sub-block */ +#define MIPS3_CONFIG_EB 0x00002000 + +/* ECC mode - 0: ECC mode, 1: parity mode */ +#define MIPS3_CONFIG_EM 0x00004000 + +/* BigEndianMem - 0: kernel and memory are little endian, 1: big endian */ +#define MIPS3_CONFIG_BE 0x00008000 + +/* Dirty Shared coherency state - 0: enabled, 1: disabled */ +#define MIPS3_CONFIG_SM 0x00010000 + +/* Secondary Cache - 0: present, 1: not present */ +#define MIPS3_CONFIG_SC 0x00020000 + +/* System Port width - 0: 64-bit, 1: 32-bit (QED RM523x), 2,3: reserved */ +#define MIPS3_CONFIG_EW_MASK 0x000c0000 +#define MIPS3_CONFIG_EW_SHIFT 18 + +/* Secondary Cache port width - 0: 128-bit data path to S-cache, 1: reserved */ +#define MIPS3_CONFIG_SW 0x00100000 + +/* Split Secondary Cache Mode - 0: I/D mixed, 1: I/D separated by SCAddr(17) */ +#define MIPS3_CONFIG_SS 0x00200000 + +/* Secondary Cache line size */ +#define MIPS3_CONFIG_SB_MASK 0x00c00000 +#define MIPS3_CONFIG_SB_SHIFT 22 +#define MIPS3_CONFIG_CACHE_L2_LSIZE(config) \ + (0x10 << (((config) & MIPS3_CONFIG_SB_MASK) >> MIPS3_CONFIG_SB_SHIFT)) + +/* Write back data rate */ +#define MIPS3_CONFIG_EP_MASK 0x0f000000 +#define MIPS3_CONFIG_EP_SHIFT 24 + +/* System clock ratio - this value is CPU dependent */ +#define MIPS3_CONFIG_EC_MASK 0x70000000 +#define MIPS3_CONFIG_EC_SHIFT 28 + +/* Master-Checker Mode - 1: enabled */ +#define MIPS3_CONFIG_CM 0x80000000 + +/* + * The bits in the MIPS4 config register. + */ + +/* kseg0 coherency algorithm - see MIPS3_TLB_ATTR values */ +#define MIPS4_CONFIG_K0_MASK MIPS3_CONFIG_K0_MASK +#define MIPS4_CONFIG_DN_MASK 0x00000018 /* Device number */ +#define MIPS4_CONFIG_CT 0x00000020 /* CohPrcReqTar */ +#define MIPS4_CONFIG_PE 0x00000040 /* PreElmReq */ +#define MIPS4_CONFIG_PM_MASK 0x00000180 /* PreReqMax */ +#define MIPS4_CONFIG_EC_MASK 0x00001e00 /* SysClkDiv */ +#define MIPS4_CONFIG_SB 0x00002000 /* SCBlkSize */ +#define MIPS4_CONFIG_SK 0x00004000 /* SCColEn */ +#define MIPS4_CONFIG_BE 0x00008000 /* MemEnd */ +#define MIPS4_CONFIG_SS_MASK 0x00070000 /* SCSize */ +#define MIPS4_CONFIG_SC_MASK 0x00380000 /* SCClkDiv */ +#define MIPS4_CONFIG_RESERVED 0x03c00000 /* Reserved wired 0 */ +#define MIPS4_CONFIG_DC_MASK 0x1c000000 /* Primary D-Cache size */ +#define MIPS4_CONFIG_IC_MASK 0xe0000000 /* Primary I-Cache size */ + +#define MIPS4_CONFIG_DC_SHIFT 26 +#define MIPS4_CONFIG_IC_SHIFT 29 + +#define MIPS4_CONFIG_CACHE_SIZE(config, mask, base, shift) \ + ((base) << (((config) & (mask)) >> (shift))) + +#define MIPS4_CONFIG_CACHE_L2_LSIZE(config) \ + (((config) & MIPS4_CONFIG_SB) ? 128 : 64) + +/* + * Location of exception vectors. + * + * Common vectors: reset and UTLB miss. + */ +#define MIPS_RESET_EXC_VEC MIPS_PHYS_TO_KSEG1(0x1FC00000) +#define MIPS_UTLB_MISS_EXC_VEC MIPS_PHYS_TO_KSEG0(0) + +/* + * MIPS-1 general exception vector (everything else) + */ +#define MIPS1_GEN_EXC_VEC MIPS_PHYS_TO_KSEG0(0x0080) + +/* + * MIPS-III exception vectors + */ +#define MIPS3_XTLB_MISS_EXC_VEC MIPS_PHYS_TO_KSEG0(0x0080) +#define MIPS3_CACHE_ERR_EXC_VEC MIPS_PHYS_TO_KSEG0(0x0100) +#define MIPS3_GEN_EXC_VEC MIPS_PHYS_TO_KSEG0(0x0180) + +/* + * TX79 (R5900) exception vectors + */ +#define MIPS_R5900_COUNTER_EXC_VEC MIPS_PHYS_TO_KSEG0(0x0080) +#define MIPS_R5900_DEBUG_EXC_VEC MIPS_PHYS_TO_KSEG0(0x0100) + +/* + * MIPS32/MIPS64 (and some MIPS3) dedicated interrupt vector. + */ +#define MIPS3_INTR_EXC_VEC MIPS_PHYS_TO_KSEG0(0x0200) + +/* + * Coprocessor 0 registers: + * + * v--- width for mips I,III,32,64 + * (3=32bit, 6=64bit, i=impl dep) + * 0 MIPS_COP_0_TLB_INDEX 3333 TLB Index. + * 1 MIPS_COP_0_TLB_RANDOM 3333 TLB Random. + * 2 MIPS_COP_0_TLB_LOW 3... r3k TLB entry low. + * 2 MIPS_COP_0_TLB_LO0 .636 r4k TLB entry low. + * 3 MIPS_COP_0_TLB_LO1 .636 r4k TLB entry low, extended. + * 4 MIPS_COP_0_TLB_CONTEXT 3636 TLB Context. + * 5 MIPS_COP_0_TLB_PG_MASK .333 TLB Page Mask register. + * 6 MIPS_COP_0_TLB_WIRED .333 Wired TLB number. + * 8 MIPS_COP_0_BAD_VADDR 3636 Bad virtual address. + * 9 MIPS_COP_0_COUNT .333 Count register. + * 10 MIPS_COP_0_TLB_HI 3636 TLB entry high. + * 11 MIPS_COP_0_COMPARE .333 Compare (against Count). + * 12 MIPS_COP_0_STATUS 3333 Status register. + * 13 MIPS_COP_0_CAUSE 3333 Exception cause register. + * 14 MIPS_COP_0_EXC_PC 3636 Exception PC. + * 15 MIPS_COP_0_PRID 3333 Processor revision identifier. + * 15/1 MIPS_COP_0_EBASE ..33 Exception Base + * 16 MIPS_COP_0_CONFIG 3333 Configuration register. + * 16/1 MIPS_COP_0_CONFIG1 ..33 Configuration register 1. + * 16/2 MIPS_COP_0_CONFIG2 ..33 Configuration register 2. + * 16/3 MIPS_COP_0_CONFIG3 ..33 Configuration register 3. + * 17 MIPS_COP_0_LLADDR .336 Load Linked Address. + * 18 MIPS_COP_0_WATCH_LO .336 WatchLo register. + * 19 MIPS_COP_0_WATCH_HI .333 WatchHi register. + * 20 MIPS_COP_0_TLB_XCONTEXT .6.6 TLB XContext register. + * 23 MIPS_COP_0_DEBUG .... Debug JTAG register. + * 24 MIPS_COP_0_DEPC .... DEPC JTAG register. + * 25 MIPS_COP_0_PERFCNT ..36 Performance Counter register. + * 26 MIPS_COP_0_ECC .3ii ECC / Error Control register. + * 27 MIPS_COP_0_CACHE_ERR .3ii Cache Error register. + * 28/0 MIPS_COP_0_TAG_LO .3ii Cache TagLo register (instr). + * 28/1 MIPS_COP_0_DATA_LO ..ii Cache DataLo register (instr). + * 28/2 MIPS_COP_0_TAG_LO ..ii Cache TagLo register (data). + * 28/3 MIPS_COP_0_DATA_LO ..ii Cache DataLo register (data). + * 29/0 MIPS_COP_0_TAG_HI .3ii Cache TagHi register (instr). + * 29/1 MIPS_COP_0_DATA_HI ..ii Cache DataHi register (instr). + * 29/2 MIPS_COP_0_TAG_HI ..ii Cache TagHi register (data). + * 29/3 MIPS_COP_0_DATA_HI ..ii Cache DataHi register (data). + * 30 MIPS_COP_0_ERROR_PC .636 Error EPC register. + * 31 MIPS_COP_0_DESAVE .... DESAVE JTAG register. + */ +#ifdef _LOCORE +#define _(n) __CONCAT($,n) +#else +#define _(n) n +#endif +#define MIPS_COP_0_TLB_INDEX _(0) +#define MIPS_COP_0_TLB_RANDOM _(1) + /* Name and meaning of TLB bits for $2 differ on r3k and r4k. */ + +#define MIPS_COP_0_TLB_CONTEXT _(4) + /* $5 and $6 new with MIPS-III */ +#define MIPS_COP_0_BAD_VADDR _(8) +#define MIPS_COP_0_TLB_HI _(10) +#define MIPS_COP_0_STATUS _(12) +#define MIPS_COP_0_CAUSE _(13) +#define MIPS_COP_0_EXC_PC _(14) +#define MIPS_COP_0_PRID _(15) + + +/* MIPS-I */ +#define MIPS_COP_0_TLB_LOW _(2) + +/* MIPS-III */ +#define MIPS_COP_0_TLB_LO0 _(2) +#define MIPS_COP_0_TLB_LO1 _(3) + +#define MIPS_COP_0_TLB_PG_MASK _(5) +#define MIPS_COP_0_TLB_WIRED _(6) + +#define MIPS_COP_0_COUNT _(9) +#define MIPS_COP_0_COMPARE _(11) + +#define MIPS_COP_0_CONFIG _(16) +#define MIPS_COP_0_LLADDR _(17) +#define MIPS_COP_0_WATCH_LO _(18) +#define MIPS_COP_0_WATCH_HI _(19) +#define MIPS_COP_0_TLB_XCONTEXT _(20) +#define MIPS_COP_0_ECC _(26) +#define MIPS_COP_0_CACHE_ERR _(27) +#define MIPS_COP_0_TAG_LO _(28) +#define MIPS_COP_0_TAG_HI _(29) +#define MIPS_COP_0_ERROR_PC _(30) + +/* MIPS32/64 */ +#define MIPS_COP_0_DEBUG _(23) +#define MIPS_COP_0_DEPC _(24) +#define MIPS_COP_0_PERFCNT _(25) +#define MIPS_COP_0_DATA_LO _(28) +#define MIPS_COP_0_DATA_HI _(29) +#define MIPS_COP_0_DESAVE _(31) + +/* + * Values for the code field in a break instruction. + */ +#define MIPS_BREAK_INSTR 0x0000000d +#define MIPS_BREAK_VAL_MASK 0x03ff0000 +#define MIPS_BREAK_VAL_SHIFT 16 +#define MIPS_BREAK_KDB_VAL 512 +#define MIPS_BREAK_SSTEP_VAL 513 +#define MIPS_BREAK_BRKPT_VAL 514 +#define MIPS_BREAK_SOVER_VAL 515 +#define MIPS_BREAK_KDB (MIPS_BREAK_INSTR | \ + (MIPS_BREAK_KDB_VAL << MIPS_BREAK_VAL_SHIFT)) +#define MIPS_BREAK_SSTEP (MIPS_BREAK_INSTR | \ + (MIPS_BREAK_SSTEP_VAL << MIPS_BREAK_VAL_SHIFT)) +#define MIPS_BREAK_BRKPT (MIPS_BREAK_INSTR | \ + (MIPS_BREAK_BRKPT_VAL << MIPS_BREAK_VAL_SHIFT)) +#define MIPS_BREAK_SOVER (MIPS_BREAK_INSTR | \ + (MIPS_BREAK_SOVER_VAL << MIPS_BREAK_VAL_SHIFT)) + +/* + * Mininum and maximum cache sizes. + */ +#define MIPS_MIN_CACHE_SIZE (16 * 1024) +#define MIPS_MAX_CACHE_SIZE (256 * 1024) +#define MIPS3_MAX_PCACHE_SIZE (32 * 1024) /* max. primary cache size */ + +/* + * The floating point version and status registers. + */ +#define MIPS_FPU_ID $0 +#define MIPS_FPU_CSR $31 + +/* + * The floating point coprocessor status register bits. + */ +#define MIPS_FPU_ROUNDING_BITS 0x00000003 +#define MIPS_FPU_ROUND_RN 0x00000000 +#define MIPS_FPU_ROUND_RZ 0x00000001 +#define MIPS_FPU_ROUND_RP 0x00000002 +#define MIPS_FPU_ROUND_RM 0x00000003 +#define MIPS_FPU_STICKY_BITS 0x0000007c +#define MIPS_FPU_STICKY_INEXACT 0x00000004 +#define MIPS_FPU_STICKY_UNDERFLOW 0x00000008 +#define MIPS_FPU_STICKY_OVERFLOW 0x00000010 +#define MIPS_FPU_STICKY_DIV0 0x00000020 +#define MIPS_FPU_STICKY_INVALID 0x00000040 +#define MIPS_FPU_ENABLE_BITS 0x00000f80 +#define MIPS_FPU_ENABLE_INEXACT 0x00000080 +#define MIPS_FPU_ENABLE_UNDERFLOW 0x00000100 +#define MIPS_FPU_ENABLE_OVERFLOW 0x00000200 +#define MIPS_FPU_ENABLE_DIV0 0x00000400 +#define MIPS_FPU_ENABLE_INVALID 0x00000800 +#define MIPS_FPU_EXCEPTION_BITS 0x0003f000 +#define MIPS_FPU_EXCEPTION_INEXACT 0x00001000 +#define MIPS_FPU_EXCEPTION_UNDERFLOW 0x00002000 +#define MIPS_FPU_EXCEPTION_OVERFLOW 0x00004000 +#define MIPS_FPU_EXCEPTION_DIV0 0x00008000 +#define MIPS_FPU_EXCEPTION_INVALID 0x00010000 +#define MIPS_FPU_EXCEPTION_UNIMPL 0x00020000 +#define MIPS_FPU_COND_BIT 0x00800000 +#define MIPS_FPU_FLUSH_BIT 0x01000000 /* r4k, MBZ on r3k */ +#define MIPS1_FPC_MBZ_BITS 0xff7c0000 +#define MIPS3_FPC_MBZ_BITS 0xfe7c0000 + + +/* + * Constants to determine if have a floating point instruction. + */ +#define MIPS_OPCODE_SHIFT 26 +#define MIPS_OPCODE_C1 0x11 + + +/* + * The low part of the TLB entry. + */ +#define MIPS1_TLB_PFN 0xfffff000 +#define MIPS1_TLB_NON_CACHEABLE_BIT 0x00000800 +#define MIPS1_TLB_DIRTY_BIT 0x00000400 +#define MIPS1_TLB_VALID_BIT 0x00000200 +#define MIPS1_TLB_GLOBAL_BIT 0x00000100 + +#define MIPS3_TLB_PFN 0x3fffffc0 +#define MIPS3_TLB_ATTR_MASK 0x00000038 +#define MIPS3_TLB_ATTR_SHIFT 3 +#define MIPS3_TLB_DIRTY_BIT 0x00000004 +#define MIPS3_TLB_VALID_BIT 0x00000002 +#define MIPS3_TLB_GLOBAL_BIT 0x00000001 + +#define MIPS1_TLB_PHYS_PAGE_SHIFT 12 +#define MIPS3_TLB_PHYS_PAGE_SHIFT 6 +#define MIPS1_TLB_PF_NUM MIPS1_TLB_PFN +#define MIPS3_TLB_PF_NUM MIPS3_TLB_PFN +#define MIPS1_TLB_MOD_BIT MIPS1_TLB_DIRTY_BIT +#define MIPS3_TLB_MOD_BIT MIPS3_TLB_DIRTY_BIT + +/* + * MIPS3_TLB_ATTR values - coherency algorithm: + * 0: cacheable, noncoherent, write-through, no write allocate + * 1: cacheable, noncoherent, write-through, write allocate + * 2: uncached + * 3: cacheable, noncoherent, write-back (noncoherent) + * 4: cacheable, coherent, write-back, exclusive (exclusive) + * 5: cacheable, coherent, write-back, exclusive on write (sharable) + * 6: cacheable, coherent, write-back, update on write (update) + * 7: uncached, accelerated (gather STORE operations) + */ +#define MIPS3_TLB_ATTR_WT 0 /* IDT */ +#define MIPS3_TLB_ATTR_WT_WRITEALLOCATE 1 /* IDT */ +#define MIPS3_TLB_ATTR_UNCACHED 2 /* R4000/R4400, IDT */ +#define MIPS3_TLB_ATTR_WB_NONCOHERENT 3 /* R4000/R4400, IDT */ +#define MIPS3_TLB_ATTR_WB_EXCLUSIVE 4 /* R4000/R4400 */ +#define MIPS3_TLB_ATTR_WB_SHARABLE 5 /* R4000/R4400 */ +#define MIPS3_TLB_ATTR_WB_UPDATE 6 /* R4000/R4400 */ +#define MIPS4_TLB_ATTR_UNCACHED_ACCELERATED 7 /* R10000 */ + + +/* + * The high part of the TLB entry. + */ +#define MIPS1_TLB_VPN 0xfffff000 +#define MIPS1_TLB_PID 0x00000fc0 +#define MIPS1_TLB_PID_SHIFT 6 + +#define MIPS3_TLB_VPN2 0xffffe000 +#define MIPS3_TLB_ASID 0x000000ff + +#define MIPS1_TLB_VIRT_PAGE_NUM MIPS1_TLB_VPN +#define MIPS3_TLB_VIRT_PAGE_NUM MIPS3_TLB_VPN2 +#define MIPS3_TLB_PID MIPS3_TLB_ASID +#define MIPS_TLB_VIRT_PAGE_SHIFT 12 + +/* + * r3000: shift count to put the index in the right spot. + */ +#define MIPS1_TLB_INDEX_SHIFT 8 + +/* + * The first TLB that write random hits. + */ +#define MIPS1_TLB_FIRST_RAND_ENTRY 8 +#define MIPS3_TLB_WIRED_UPAGES 1 + +/* + * The number of process id entries. + */ +#define MIPS1_TLB_NUM_PIDS 64 +#define MIPS3_TLB_NUM_ASIDS 256 + +/* + * Patch codes to hide CPU design differences between MIPS1 and MIPS3. + */ + +/* XXX simonb: this is before MIPS3_PLUS is defined (and is ugly!) */ + +#if !(defined(MIPS3) || defined(MIPS4) || defined(MIPS32) || defined(MIPS64)) \ + && defined(MIPS1) /* XXX simonb must be neater! */ +#define MIPS_TLB_PID_SHIFT MIPS1_TLB_PID_SHIFT +#define MIPS_TLB_NUM_PIDS MIPS1_TLB_NUM_PIDS +#endif + +#if (defined(MIPS3) || defined(MIPS4) || defined(MIPS32) || defined(MIPS64)) \ + && !defined(MIPS1) /* XXX simonb must be neater! */ +#define MIPS_TLB_PID_SHIFT 0 +#define MIPS_TLB_NUM_PIDS MIPS3_TLB_NUM_ASIDS +#endif + + +#if !defined(MIPS_TLB_PID_SHIFT) +#define MIPS_TLB_PID_SHIFT \ + ((MIPS_HAS_R4K_MMU) ? 0 : MIPS1_TLB_PID_SHIFT) + +#define MIPS_TLB_NUM_PIDS \ + ((MIPS_HAS_R4K_MMU) ? MIPS3_TLB_NUM_ASIDS : MIPS1_TLB_NUM_PIDS) +#endif + +/* + * CPU processor revision IDs for company ID == 0 (non mips32/64 chips) + */ +#define MIPS_R2000 0x01 /* MIPS R2000 ISA I */ +#define MIPS_R3000 0x02 /* MIPS R3000 ISA I */ +#define MIPS_R6000 0x03 /* MIPS R6000 ISA II */ +#define MIPS_R4000 0x04 /* MIPS R4000/R4400 ISA III */ +#define MIPS_R3LSI 0x05 /* LSI Logic R3000 derivative ISA I */ +#define MIPS_R6000A 0x06 /* MIPS R6000A ISA II */ +#define MIPS_R3IDT 0x07 /* IDT R3041 or RC36100 ISA I */ +#define MIPS_R10000 0x09 /* MIPS R10000 ISA IV */ +#define MIPS_R4200 0x0a /* NEC VR4200 ISA III */ +#define MIPS_R4300 0x0b /* NEC VR4300 ISA III */ +#define MIPS_R4100 0x0c /* NEC VR4100 ISA III */ +#define MIPS_R12000 0x0e /* MIPS R12000 ISA IV */ +#define MIPS_R14000 0x0f /* MIPS R14000 ISA IV */ +#define MIPS_R8000 0x10 /* MIPS R8000 Blackbird/TFP ISA IV */ +#define MIPS_RC32300 0x18 /* IDT RC32334,332,355 ISA 32 */ +#define MIPS_R4600 0x20 /* QED R4600 Orion ISA III */ +#define MIPS_R4700 0x21 /* QED R4700 Orion ISA III */ +#define MIPS_R3SONY 0x21 /* Sony R3000 based ISA I */ +#define MIPS_R4650 0x22 /* QED R4650 ISA III */ +#define MIPS_TX3900 0x22 /* Toshiba TX39 family ISA I */ +#define MIPS_R5000 0x23 /* MIPS R5000 ISA IV */ +#define MIPS_R3NKK 0x23 /* NKK R3000 based ISA I */ +#define MIPS_RC32364 0x26 /* IDT RC32364 ISA 32 */ +#define MIPS_RM7000 0x27 /* QED RM7000 ISA IV */ +#define MIPS_RM5200 0x28 /* QED RM5200s ISA IV */ +#define MIPS_TX4900 0x2d /* Toshiba TX49 family ISA III */ +#define MIPS_R5900 0x2e /* Toshiba R5900 (EECore) ISA --- */ +#define MIPS_RC64470 0x30 /* IDT RC64474/RC64475 ISA III */ +#define MIPS_TX7900 0x38 /* Toshiba TX79 ISA III+*/ +#define MIPS_R5400 0x54 /* NEC VR5400 ISA IV */ +#define MIPS_R5500 0x55 /* NEC VR5500 ISA IV */ +#define MIPS_LOONGSON2 0x63 /* ICT Loongson-2 ISA III */ + +/* + * CPU revision IDs for some prehistoric processors. + */ + +/* For MIPS_R3000 */ +#define MIPS_REV_R2000A 0x16 /* R2000A uses R3000 proc revision */ +#define MIPS_REV_R3000 0x20 +#define MIPS_REV_R3000A 0x30 + +/* For MIPS_TX3900 */ +#define MIPS_REV_TX3912 0x10 +#define MIPS_REV_TX3922 0x30 +#define MIPS_REV_TX3927 0x40 + +/* For MIPS_R4000 */ +#define MIPS_REV_R4000_A 0x00 +#define MIPS_REV_R4000_B 0x22 +#define MIPS_REV_R4000_C 0x30 +#define MIPS_REV_R4400_A 0x40 +#define MIPS_REV_R4400_B 0x50 +#define MIPS_REV_R4400_C 0x60 + +/* For MIPS_TX4900 */ +#define MIPS_REV_TX4927 0x22 + +/* For MIPS_LOONGSON2 */ +#define MIPS_REV_LOONGSON2E 0x02 +#define MIPS_REV_LOONGSON2F 0x03 + +/* + * CPU processor revision IDs for company ID == 1 (MIPS) + */ +#define MIPS_4Kc 0x80 /* MIPS 4Kc ISA 32 */ +#define MIPS_5Kc 0x81 /* MIPS 5Kc ISA 64 */ +#define MIPS_20Kc 0x82 /* MIPS 20Kc ISA 64 */ +#define MIPS_4Kmp 0x83 /* MIPS 4Km/4Kp ISA 32 */ +#define MIPS_4KEc 0x84 /* MIPS 4KEc ISA 32 */ +#define MIPS_4KEmp 0x85 /* MIPS 4KEm/4KEp ISA 32 */ +#define MIPS_4KSc 0x86 /* MIPS 4KSc ISA 32 */ +#define MIPS_M4K 0x87 /* MIPS M4K ISA 32 Rel 2 */ +#define MIPS_25Kf 0x88 /* MIPS 25Kf ISA 64 */ +#define MIPS_5KE 0x89 /* MIPS 5KE ISA 64 Rel 2 */ +#define MIPS_4KEc_R2 0x90 /* MIPS 4KEc_R2 ISA 32 Rel 2 */ +#define MIPS_4KEmp_R2 0x91 /* MIPS 4KEm/4KEp_R2 ISA 32 Rel 2 */ +#define MIPS_4KSd 0x92 /* MIPS 4KSd ISA 32 Rel 2 */ +#define MIPS_24K 0x93 /* MIPS 24Kc/24Kf ISA 32 Rel 2 */ +#define MIPS_34K 0x95 /* MIPS 34K ISA 32 R2 MT */ +#define MIPS_24KE 0x96 /* MIPS 24KEc ISA 32 Rel 2 */ +#define MIPS_74K 0x97 /* MIPS 74Kc/74Kf ISA 32 Rel 2 */ + +/* + * Alchemy (company ID 3) use the processor ID field to donote the CPU core + * revision and the company options field do donate the SOC chip type. + */ +/* CPU processor revision IDs */ +#define MIPS_AU_REV1 0x01 /* Alchemy Au1000 (Rev 1) ISA 32 */ +#define MIPS_AU_REV2 0x02 /* Alchemy Au1000 (Rev 2) ISA 32 */ +/* CPU company options IDs */ +#define MIPS_AU1000 0x00 +#define MIPS_AU1500 0x01 +#define MIPS_AU1100 0x02 +#define MIPS_AU1550 0x03 + +/* + * CPU processor revision IDs for company ID == 4 (SiByte) + */ +#define MIPS_SB1 0x01 /* SiByte SB1 ISA 64 */ + +/* + * CPU processor revision IDs for company ID == 5 (SandCraft) + */ +#define MIPS_SR7100 0x04 /* SandCraft SR7100 ISA 64 */ + +/* + * CPU processor revision IDs for company ID == 12 (RMI) + */ +#define MIPS_XLR732 0x00 /* RMI XLR732-C ISA 64 */ +#define MIPS_XLR716 0x02 /* RMI XLR716-C ISA 64 */ +#define MIPS_XLR532 0x08 /* RMI XLR532-C ISA 64 */ +#define MIPS_XLR516 0x0a /* RMI XLR516-C ISA 64 */ +#define MIPS_XLR508 0x0b /* RMI XLR508-C ISA 64 */ +#define MIPS_XLR308 0x0f /* RMI XLR308-C ISA 64 */ +#define MIPS_XLS616 0x40 /* RMI XLS616 ISA 64 */ +#define MIPS_XLS416 0x44 /* RMI XLS416 ISA 64 */ +#define MIPS_XLS608 0x4A /* RMI XLS608 ISA 64 */ +#define MIPS_XLS408 0x4E /* RMI XLS406 ISA 64 */ +#define MIPS_XLS404 0x4F /* RMI XLS404 ISA 64 */ +#define MIPS_XLS408LITE 0x88 /* RMI XLS408-Lite ISA 64 */ +#define MIPS_XLS404LITE 0x8C /* RMI XLS404-Lite ISA 64 */ +#define MIPS_XLS208 0x8E /* RMI XLS208 ISA 64 */ +#define MIPS_XLS204 0x8F /* RMI XLS204 ISA 64 */ +#define MIPS_XLS108 0xCE /* RMI XLS108 ISA 64 */ +#define MIPS_XLS104 0xCF /* RMI XLS104 ISA 64 */ + +/* + * FPU processor revision ID + */ +#define MIPS_SOFT 0x00 /* Software emulation ISA I */ +#define MIPS_R2360 0x01 /* MIPS R2360 FPC ISA I */ +#define MIPS_R2010 0x02 /* MIPS R2010 FPC ISA I */ +#define MIPS_R3010 0x03 /* MIPS R3010 FPC ISA I */ +#define MIPS_R6010 0x04 /* MIPS R6010 FPC ISA II */ +#define MIPS_R4010 0x05 /* MIPS R4010 FPC ISA II */ +#define MIPS_R31LSI 0x06 /* LSI Logic derivate ISA I */ +#define MIPS_R3TOSH 0x22 /* Toshiba R3000 based FPU ISA I */ + +#endif /* _MIPS_CPUREGS_H_ */ + +/* $NetBSD: cpu.h,v 1.94 2009/12/14 00:46:04 matt Exp $ */ + +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Ralph Campbell and Rick Macklem. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)cpu.h 8.4 (Berkeley) 1/4/94 + */ + +#ifndef _CPU_H_ +#define _CPU_H_ + + +/* + * bitfield defines for cpu_cp0flags + */ +#define MIPS_CP0FL_USE __BIT(0) /* use these flags */ +#define MIPS_CP0FL_ECC __BIT(1) +#define MIPS_CP0FL_CACHE_ERR __BIT(2) +#define MIPS_CP0FL_EIRR __BIT(3) +#define MIPS_CP0FL_EIMR __BIT(4) +#define MIPS_CP0FL_EBASE __BIT(5) +#define MIPS_CP0FL_CONFIG __BIT(6) +#define MIPS_CP0FL_CONFIGn(n) (__BIT(7) << ((n) & 7)) + +/* + * cpu_cidflags defines, by company + */ +/* + * RMI company-specific cpu_cidflags + */ +#define MIPS_CIDFL_RMI_TYPE __BITS(0,2) +#define CIDFL_RMI_TYPE_XLR 0 +#define CIDFL_RMI_TYPE_XLS 1 +#define CIDFL_RMI_TYPE_XLP 2 + + +#define CPU_INFO_ITERATOR int +#define CPU_INFO_FOREACH(cii, ci) \ + (void)(cii), ci = &cpu_info_store; ci != NULL; ci = ci->ci_next + + +/* + * CTL_MACHDEP definitions. + */ +#define CPU_CONSDEV 1 /* dev_t: console terminal device */ +#define CPU_BOOTED_KERNEL 2 /* string: booted kernel name */ +#define CPU_ROOT_DEVICE 3 /* string: root device name */ +#define CPU_LLSC 4 /* OS/CPU supports LL/SC instruction */ + +/* + * Platform can override, but note this breaks userland compatibility + * with other mips platforms. + */ +#ifndef CPU_MAXID +#define CPU_MAXID 5 /* number of valid machdep ids */ + +#endif + +#ifdef _KERNEL +#if defined(_LKM) || defined(_STANDALONE) +/* Assume all CPU architectures are valid for LKM's and standlone progs */ +#define MIPS1 1 +#define MIPS3 1 +#define MIPS4 1 +#define MIPS32 1 +#define MIPS64 1 +#endif + +#if (MIPS1 + MIPS3 + MIPS4 + MIPS32 + MIPS64) == 0 +#error at least one of MIPS1, MIPS3, MIPS4, MIPS32 or MIPS64 must be specified +#endif + +/* Shortcut for MIPS3 or above defined */ +#if defined(MIPS3) || defined(MIPS4) || defined(MIPS32) || defined(MIPS64) +#define MIPS3_PLUS 1 +#else +#undef MIPS3_PLUS +#endif + +/* + * Macros to find the CPU architecture we're on at run-time, + * or if possible, at compile-time. + */ + +#define CPU_ARCH_MIPSx 0 /* XXX unknown */ +#define CPU_ARCH_MIPS1 (1 << 0) +#define CPU_ARCH_MIPS2 (1 << 1) +#define CPU_ARCH_MIPS3 (1 << 2) +#define CPU_ARCH_MIPS4 (1 << 3) +#define CPU_ARCH_MIPS5 (1 << 4) +#define CPU_ARCH_MIPS32 (1 << 5) +#define CPU_ARCH_MIPS64 (1 << 6) + +/* Note: must be kept in sync with -ffixed-?? Makefile.mips. */ +#define MIPS_CURLWP $23 +#define MIPS_CURLWP_QUOTED "$23" +#define MIPS_CURLWP_CARD 23 +#define MIPS_CURLWP_FRAME(x) FRAME_S7(x) + +#ifndef _LOCORE + +#define curlwp mips_curlwp +#define curcpu() (curlwp->l_cpu) +#define curpcb ((struct pcb *)lwp_getpcb(curlwp)) +#define fpcurlwp (curcpu()->ci_fpcurlwp) +#define cpu_number() (0) +#define cpu_proc_fork(p1, p2) ((void)((p2)->p_md.md_abi = (p1)->p_md.md_abi)) + +/* XXX simonb + * Should the following be in a cpu_info type structure? + * And how many of these are per-cpu vs. per-system? (Ie, + * we can assume that all cpus have the same mmu-type, but + * maybe not that all cpus run at the same clock speed. + * Some SGI's apparently support R12k and R14k in the same + * box.) + */ + +#define CPU_MIPS_R4K_MMU 0x0001 +#define CPU_MIPS_NO_LLSC 0x0002 +#define CPU_MIPS_CAUSE_IV 0x0004 +#define CPU_MIPS_HAVE_SPECIAL_CCA 0x0008 /* Defaults to '3' if not set. */ +#define CPU_MIPS_CACHED_CCA_MASK 0x0070 +#define CPU_MIPS_CACHED_CCA_SHIFT 4 +#define CPU_MIPS_DOUBLE_COUNT 0x0080 /* 1 cp0 count == 2 clock cycles */ +#define CPU_MIPS_USE_WAIT 0x0100 /* Use "wait"-based cpu_idle() */ +#define CPU_MIPS_NO_WAIT 0x0200 /* Inverse of previous, for mips32/64 */ +#define CPU_MIPS_D_CACHE_COHERENT 0x0400 /* D-cache is fully coherent */ +#define CPU_MIPS_I_D_CACHE_COHERENT 0x0800 /* I-cache funcs don't need to flush the D-cache */ +#define CPU_MIPS_NO_LLADDR 0x1000 +#define CPU_MIPS_HAVE_MxCR 0x2000 /* have mfcr, mtcr insns */ +#define MIPS_NOT_SUPP 0x8000 + +#endif /* !_LOCORE */ + +#if ((MIPS1 + MIPS3 + MIPS4 + MIPS32 + MIPS64) == 1) || defined(_LOCORE) + +#if defined(MIPS1) + +# define CPUISMIPS3 0 +# define CPUIS64BITS 0 +# define CPUISMIPS32 0 +# define CPUISMIPS64 0 +# define CPUISMIPSNN 0 +# define MIPS_HAS_R4K_MMU 0 +# define MIPS_HAS_CLOCK 0 +# define MIPS_HAS_LLSC 0 +# define MIPS_HAS_LLADDR 0 + +#elif defined(MIPS3) || defined(MIPS4) + +# define CPUISMIPS3 1 +# define CPUIS64BITS 1 +# define CPUISMIPS32 0 +# define CPUISMIPS64 0 +# define CPUISMIPSNN 0 +# define MIPS_HAS_R4K_MMU 1 +# define MIPS_HAS_CLOCK 1 +# if defined(_LOCORE) +# if !defined(MIPS3_5900) && !defined(MIPS3_4100) +# define MIPS_HAS_LLSC 1 +# else +# define MIPS_HAS_LLSC 0 +# endif +# else /* _LOCORE */ +# define MIPS_HAS_LLSC (mips_has_llsc) +# endif /* _LOCORE */ +# define MIPS_HAS_LLADDR ((mips_cpu_flags & CPU_MIPS_NO_LLADDR) == 0) + +#elif defined(MIPS32) + +# define CPUISMIPS3 1 +# define CPUIS64BITS 0 +# define CPUISMIPS32 1 +# define CPUISMIPS64 0 +# define CPUISMIPSNN 1 +# define MIPS_HAS_R4K_MMU 1 +# define MIPS_HAS_CLOCK 1 +# define MIPS_HAS_LLSC 1 +# define MIPS_HAS_LLADDR ((mips_cpu_flags & CPU_MIPS_NO_LLADDR) == 0) + +#elif defined(MIPS64) + +# define CPUISMIPS3 1 +# define CPUIS64BITS 1 +# define CPUISMIPS32 0 +# define CPUISMIPS64 1 +# define CPUISMIPSNN 1 +# define MIPS_HAS_R4K_MMU 1 +# define MIPS_HAS_CLOCK 1 +# define MIPS_HAS_LLSC 1 +# define MIPS_HAS_LLADDR ((mips_cpu_flags & CPU_MIPS_NO_LLADDR) == 0) + +#endif + +#else /* run-time test */ + +#ifndef _LOCORE + +#define MIPS_HAS_R4K_MMU (mips_has_r4k_mmu) +#define MIPS_HAS_LLSC (mips_has_llsc) +#define MIPS_HAS_LLADDR ((mips_cpu_flags & CPU_MIPS_NO_LLADDR) == 0) + +/* This test is ... rather bogus */ +#define CPUISMIPS3 ((cpu_arch & \ + (CPU_ARCH_MIPS3 | CPU_ARCH_MIPS4 | CPU_ARCH_MIPS32 | CPU_ARCH_MIPS64)) != 0) + +/* And these aren't much better while the previous test exists as is... */ +#define CPUISMIPS32 ((cpu_arch & CPU_ARCH_MIPS32) != 0) +#define CPUISMIPS64 ((cpu_arch & CPU_ARCH_MIPS64) != 0) +#define CPUISMIPSNN ((cpu_arch & (CPU_ARCH_MIPS32 | CPU_ARCH_MIPS64)) != 0) +#define CPUIS64BITS ((cpu_arch & \ + (CPU_ARCH_MIPS3 | CPU_ARCH_MIPS4 | CPU_ARCH_MIPS64)) != 0) + +#define MIPS_HAS_CLOCK (cpu_arch >= CPU_ARCH_MIPS3) + +#else /* !_LOCORE */ + +#define MIPS_HAS_LLSC 0 + +#endif /* !_LOCORE */ + +#endif /* run-time test */ + +#ifndef _LOCORE + +/* + * A port must provde CLKF_USERMODE() for use in machine-independent code. + * These differ on r4000 and r3000 systems; provide them in the + * port-dependent file that includes this one, using the macros below. + */ + +/* mips1 versions */ +#define MIPS1_CLKF_USERMODE(framep) ((framep)->sr & MIPS_SR_KU_PREV) + +/* mips3 versions */ +#define MIPS3_CLKF_USERMODE(framep) ((framep)->sr & MIPS_SR_KSU_USER) + +#define CLKF_PC(framep) ((framep)->pc) +#define CLKF_INTR(framep) (0) + +#if defined(MIPS3_PLUS) && !defined(MIPS1) /* XXX bogus! */ +#define CLKF_USERMODE(framep) MIPS3_CLKF_USERMODE(framep) +#endif + +#if !defined(MIPS3_PLUS) && defined(MIPS1) /* XXX bogus! */ +#define CLKF_USERMODE(framep) MIPS1_CLKF_USERMODE(framep) +#endif + +#if defined(MIPS3_PLUS) && defined(MIPS1) /* XXX bogus! */ +#define CLKF_USERMODE(framep) \ + ((CPUISMIPS3) ? MIPS3_CLKF_USERMODE(framep): MIPS1_CLKF_USERMODE(framep)) +#endif + +/* + * This is used during profiling to integrate system time. It can safely + * assume that the process is resident. + */ +#define PROC_PC(p) \ + (((struct frame *)(p)->p_md.md_regs)->f_regs[37]) /* XXX PC */ + +/* + * Preempt the current process if in interrupt from user mode, + * or after the current trap/syscall if in system mode. + */ + +/* + * Give a profiling tick to the current process when the user profiling + * buffer pages are invalid. On the MIPS, request an ast to send us + * through trap, marking the proc as needing a profiling tick. + */ +#define cpu_need_proftick(l) \ +do { \ + (l)->l_pflag |= LP_OWEUPC; \ + aston(l); \ +} while (/*CONSTCOND*/0) + +/* + * Notify the current lwp (l) that it has a signal pending, + * process as soon as possible. + */ +#define cpu_signotify(l) aston(l) + +#define aston(l) ((l)->l_md.md_astpending = 1) + + +#endif /* ! _LOCORE */ +#endif /* _KERNEL */ +#endif /* _CPU_H_ */ + + +/* $NetBSD: mips_opcode.h,v 1.13 2009/08/06 04:34:50 msaitoh Exp $ */ + +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Ralph Campbell. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)mips_opcode.h 8.1 (Berkeley) 6/10/93 + */ + +/* + * Define the instruction formats and opcode values for the + * MIPS instruction set. + */ + +/* + * Define the instruction formats. + */ + + +typedef union { + unsigned word; + struct { + unsigned imm: 16; + unsigned rt: 5; + unsigned rs: 5; + unsigned op: 6; + } IType; + + struct { + unsigned target: 26; + unsigned op: 6; + } JType; + + struct { + unsigned func: 6; + unsigned shamt: 5; + unsigned rd: 5; + unsigned rt: 5; + unsigned rs: 5; + unsigned op: 6; + } RType; + + struct { + unsigned func: 6; + unsigned fd: 5; + unsigned fs: 5; + unsigned ft: 5; + unsigned fmt: 4; + unsigned : 1; /* always '1' */ + unsigned op: 6; /* always '0x11' */ + } FRType; +} InstFmt; + +/* + * Values for the 'op' field. + */ +#define OP_SPECIAL 000 +#define OP_BCOND 001 +#define OP_J 002 +#define OP_JAL 003 +#define OP_BEQ 004 +#define OP_BNE 005 +#define OP_BLEZ 006 +#define OP_BGTZ 007 + +#define OP_ADDI 010 +#define OP_ADDIU 011 +#define OP_SLTI 012 +#define OP_SLTIU 013 +#define OP_ANDI 014 +#define OP_ORI 015 +#define OP_XORI 016 +#define OP_LUI 017 + +#define OP_COP0 020 +#define OP_COP1 021 +#define OP_COP2 022 +#define OP_COP3 023 +#define OP_BEQL 024 /* MIPS-II, for r4000 port */ +#define OP_BNEL 025 /* MIPS-II, for r4000 port */ +#define OP_BLEZL 026 /* MIPS-II, for r4000 port */ +#define OP_BGTZL 027 /* MIPS-II, for r4000 port */ + +#define OP_DADDI 030 /* MIPS-II, for r4000 port */ +#define OP_DADDIU 031 /* MIPS-II, for r4000 port */ +#define OP_LDL 032 /* MIPS-II, for r4000 port */ +#define OP_LDR 033 /* MIPS-II, for r4000 port */ + +#define OP_SPECIAL2 034 /* QED opcodes */ + +#define OP_LB 040 +#define OP_LH 041 +#define OP_LWL 042 +#define OP_LW 043 +#define OP_LBU 044 +#define OP_LHU 045 +#define OP_LWR 046 +#define OP_LHU 045 +#define OP_LWR 046 +#define OP_LWU 047 /* MIPS-II, for r4000 port */ + +#define OP_SB 050 +#define OP_SH 051 +#define OP_SWL 052 +#define OP_SW 053 +#define OP_SDL 054 /* MIPS-II, for r4000 port */ +#define OP_SDR 055 /* MIPS-II, for r4000 port */ +#define OP_SWR 056 +#define OP_CACHE 057 /* MIPS-II, for r4000 port */ + +#define OP_LL 060 +#define OP_LWC0 OP_LL /* backwards source compatibility */ +#define OP_LWC1 061 +#define OP_LWC2 062 +#define OP_LWC3 063 +#define OP_LLD 064 /* MIPS-II, for r4000 port */ +#define OP_LDC1 065 +#define OP_LD 067 /* MIPS-II, for r4000 port */ + +#define OP_SC 070 +#define OP_SWC0 OP_SC /* backwards source compatibility */ +#define OP_SWC1 071 +#define OP_SWC2 072 +#define OP_SWC3 073 +#define OP_SCD 074 /* MIPS-II, for r4000 port */ +#define OP_SDC1 075 +#define OP_SD 077 /* MIPS-II, for r4000 port */ + +/* + * Values for the 'func' field when 'op' == OP_SPECIAL. + */ +#define OP_SLL 000 +#define OP_SRL 002 +#define OP_SRA 003 +#define OP_SLLV 004 +#define OP_SRLV 006 +#define OP_SRAV 007 + +#define OP_JR 010 +#define OP_JALR 011 +#define OP_SYSCALL 014 +#define OP_BREAK 015 +#define OP_SYNC 017 /* MIPS-II, for r4000 port */ + +#define OP_MFHI 020 +#define OP_MTHI 021 +#define OP_MFLO 022 +#define OP_MTLO 023 +#define OP_DSLLV 024 /* MIPS-II, for r4000 port */ +#define OP_DSRLV 026 /* MIPS-II, for r4000 port */ +#define OP_DSRAV 027 /* MIPS-II, for r4000 port */ + +#define OP_MULT 030 +#define OP_MULTU 031 +#define OP_DIV 032 +#define OP_DIVU 033 +#define OP_DMULT 034 /* MIPS-II, for r4000 port */ +#define OP_DMULTU 035 /* MIPS-II, for r4000 port */ +#define OP_DDIV 036 /* MIPS-II, for r4000 port */ +#define OP_DDIVU 037 /* MIPS-II, for r4000 port */ + +#define OP_ADD 040 +#define OP_ADDU 041 +#define OP_SUB 042 +#define OP_SUBU 043 +#define OP_AND 044 +#define OP_OR 045 +#define OP_XOR 046 +#define OP_NOR 047 + +#define OP_SLT 052 +#define OP_SLTU 053 +#define OP_DADD 054 /* MIPS-II, for r4000 port */ +#define OP_DADDU 055 /* MIPS-II, for r4000 port */ +#define OP_DSUB 056 /* MIPS-II, for r4000 port */ +#define OP_DSUBU 057 /* MIPS-II, for r4000 port */ + +#define OP_TGE 060 /* MIPS-II, for r4000 port */ +#define OP_TGEU 061 /* MIPS-II, for r4000 port */ +#define OP_TLT 062 /* MIPS-II, for r4000 port */ +#define OP_TLTU 063 /* MIPS-II, for r4000 port */ +#define OP_TEQ 064 /* MIPS-II, for r4000 port */ +#define OP_TNE 066 /* MIPS-II, for r4000 port */ + +#define OP_DSLL 070 /* MIPS-II, for r4000 port */ +#define OP_DSRL 072 /* MIPS-II, for r4000 port */ +#define OP_DSRA 073 /* MIPS-II, for r4000 port */ +#define OP_DSLL32 074 /* MIPS-II, for r4000 port */ +#define OP_DSRL32 076 /* MIPS-II, for r4000 port */ +#define OP_DSRA32 077 /* MIPS-II, for r4000 port */ + +/* + * Values for the 'func' field when 'op' == OP_SPECIAL2. + */ +#define OP_MAD 000 /* QED */ +#define OP_MADU 001 /* QED */ +#define OP_MUL 002 /* QED */ + +/* + * Values for the 'func' field when 'op' == OP_BCOND. + */ +#define OP_BLTZ 000 +#define OP_BGEZ 001 +#define OP_BLTZL 002 /* MIPS-II, for r4000 port */ +#define OP_BGEZL 003 /* MIPS-II, for r4000 port */ + +#define OP_TGEI 010 /* MIPS-II, for r4000 port */ +#define OP_TGEIU 011 /* MIPS-II, for r4000 port */ +#define OP_TLTI 012 /* MIPS-II, for r4000 port */ +#define OP_TLTIU 013 /* MIPS-II, for r4000 port */ +#define OP_TEQI 014 /* MIPS-II, for r4000 port */ +#define OP_TNEI 016 /* MIPS-II, for r4000 port */ + +#define OP_BLTZAL 020 /* MIPS-II, for r4000 port */ +#define OP_BGEZAL 021 +#define OP_BLTZALL 022 +#define OP_BGEZALL 023 + +/* + * Values for the 'rs' field when 'op' == OP_COPz. + */ +#define OP_MF 000 +#define OP_DMF 001 /* MIPS-II, for r4000 port */ +#define OP_CF 002 +#define OP_MFH 003 +#define OP_MT 004 +#define OP_DMT 005 /* MIPS-II, for r4000 port */ +#define OP_CT 006 +#define OP_MTH 007 +#define OP_BCx 010 +#define OP_BCy 014 + +/* + * Values for the 'rt' field when 'op' == OP_COPz. + */ +#define COPz_BC_TF_MASK 0x01 +#define COPz_BC_TRUE 0x01 +#define COPz_BC_FALSE 0x00 +#define COPz_BCL_TF_MASK 0x02 /* MIPS-II, for r4000 port */ +#define COPz_BCL_TRUE 0x02 /* MIPS-II, for r4000 port */ +#define COPz_BCL_FALSE 0x00 /* MIPS-II, for r4000 port */ + +#endif /* __DECODER_LOCAL_H__ */ + diff --git a/libmupen64plus/mupen64plus-core/src/debugger/dbg_memory.c b/libmupen64plus/mupen64plus-core/src/debugger/dbg_memory.c new file mode 100644 index 0000000000..c8988bf867 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/debugger/dbg_memory.c @@ -0,0 +1,1070 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - dbg_memory.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2008 DarkJeztr * + * Copyright (C) 2002 Blight * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "dbg_types.h" +#include "dbg_memory.h" +#include "dbg_breakpoints.h" + +#include "api/m64p_types.h" +#include "api/callbacks.h" +#include "memory/memory.h" +#include "r4300/r4300.h" +#include "r4300/ops.h" +#include "main/rom.h" + +/* Following are the breakpoint functions for memory access calls. See debugger/memory.h + * These macros generate the memory breakpoint function calls.*/ +MEMBREAKALL_local(nothing); +MEMBREAKALL_local(nomem); +MEMBREAKALL(rdram); +MEMBREAKALL(rdramFB); +MEMBREAKALL_local(rdramreg); +MEMBREAKALL_local(rsp_mem); +MEMBREAKALL_local(rsp_reg); +MEMBREAKALL_local(rsp); +MEMBREAKALL_local(dp); +MEMBREAKALL_local(dps); +MEMBREAKALL_local(mi); +MEMBREAKALL_local(vi); +MEMBREAKALL_local(ai); +MEMBREAKALL_local(pi); +MEMBREAKALL_local(ri); +MEMBREAKALL_local(si); +MEMBREAKALL_local(pif); + +static MEMBREAKREAD(read_flashram_status, 4); +static MEMBREAKREAD(read_flashram_statusb, 1); +static MEMBREAKREAD(read_flashram_statush, 2); +static MEMBREAKREAD(read_flashram_statusd, 8); +static MEMBREAKWRITE(write_flashram_dummy, 4); +static MEMBREAKWRITE(write_flashram_dummyb, 1); +static MEMBREAKWRITE(write_flashram_dummyh, 2); +static MEMBREAKWRITE(write_flashram_dummyd, 8); +static MEMBREAKWRITE(write_flashram_command, 4); +static MEMBREAKWRITE(write_flashram_commandb, 1); +static MEMBREAKWRITE(write_flashram_commandh, 2); +static MEMBREAKWRITE(write_flashram_commandd, 8); + +static MEMBREAKREAD(read_rom, 4); +static MEMBREAKREAD(read_romb, 1); +static MEMBREAKREAD(read_romh, 2); +static MEMBREAKREAD(read_romd, 8); + +static MEMBREAKWRITE(write_rom, 8); + +#if !defined(NO_ASM) && (defined(__i386__) || defined(__x86_64__)) + +#include +#include + +static int lines_recompiled; +static uint32 addr_recompiled; +static int num_decoded; + +static char opcode_recompiled[564][MAX_DISASSEMBLY]; +static char args_recompiled[564][MAX_DISASSEMBLY*4]; +static void *opaddr_recompiled[564]; + +static disassemble_info dis_info; + +#define CHECK_MEM(address) \ + if (!invalid_code[(address) >> 12] && blocks[(address) >> 12]->block[((address) & 0xFFF) / 4].ops != current_instruction_table.NOTCOMPILED) \ + invalid_code[(address) >> 12] = 1; + +static void process_opcode_out(void *strm, const char *fmt, ...){ + va_list ap; + va_start(ap, fmt); + char *arg; + char buff[256]; + + if(num_decoded==0) + { + if(strcmp(fmt,"%s")==0) + { + arg = va_arg(ap, char*); + strcpy(opcode_recompiled[lines_recompiled],arg); + } + else + strcpy(opcode_recompiled[lines_recompiled],"OPCODE-X"); + num_decoded++; + *(args_recompiled[lines_recompiled])=0; + } + else + { + vsprintf(buff, fmt, ap); + sprintf(args_recompiled[lines_recompiled],"%s%s", + args_recompiled[lines_recompiled],buff); + } + va_end(ap); +} + +// Callback function that will be called by libopcodes to read the +// bytes to disassemble ('read_memory_func' member of 'disassemble_info'). +static int read_memory_func(bfd_vma memaddr, bfd_byte *myaddr, + unsigned int length, disassemble_info *info) { + char* from = (char*)(long)(memaddr); + char* to = (char*)myaddr; + + while (length-- != 0) { + *to++ = *from++; + } + return (0); +} + +void init_host_disassembler(void){ + + + INIT_DISASSEMBLE_INFO(dis_info, stderr, process_opcode_out); + dis_info.fprintf_func = (fprintf_ftype) process_opcode_out; + dis_info.stream = stderr; + dis_info.bytes_per_line=1; + dis_info.endian = 1; + dis_info.mach = bfd_mach_i386_i8086; + dis_info.disassembler_options = (char*) "i386,suffix"; + dis_info.read_memory_func = read_memory_func; +} + +static void decode_recompiled(uint32 addr) +{ + unsigned char *assemb, *end_addr; + + lines_recompiled=0; + + if(blocks[addr>>12] == NULL) + return; + + if(blocks[addr>>12]->block[(addr&0xFFF)/4].ops == current_instruction_table.NOTCOMPILED) + // recompile_block((int *) SP_DMEM, blocks[addr>>12], addr); + { + strcpy(opcode_recompiled[0],"INVLD"); + strcpy(args_recompiled[0],"NOTCOMPILED"); + opaddr_recompiled[0] = (void *) 0; + addr_recompiled=0; + lines_recompiled++; + return; + } + + assemb = (blocks[addr>>12]->code) + + (blocks[addr>>12]->block[(addr&0xFFF)/4].local_addr); + + end_addr = blocks[addr>>12]->code; + + if( (addr & 0xFFF) >= 0xFFC) + end_addr += blocks[addr>>12]->code_length; + else + end_addr += blocks[addr>>12]->block[(addr&0xFFF)/4+1].local_addr; + + while(assemb < end_addr) + { + opaddr_recompiled[lines_recompiled] = assemb; + num_decoded=0; + + assemb += print_insn_i386((bfd_vma)(long) assemb, &dis_info); + + lines_recompiled++; + } + + addr_recompiled = addr; +} + +char* get_recompiled_opcode(uint32 addr, int index) +{ + if(addr != addr_recompiled) + decode_recompiled(addr); + + if(index < lines_recompiled) + return opcode_recompiled[index]; + else + return NULL; +} + +char* get_recompiled_args(uint32 addr, int index) +{ + if(addr != addr_recompiled) + decode_recompiled(addr); + + if(index < lines_recompiled) + return args_recompiled[index]; + else + return NULL; +} + +void * get_recompiled_addr(uint32 addr, int index) +{ + if(addr != addr_recompiled) + decode_recompiled(addr); + + if(index < lines_recompiled) + return opaddr_recompiled[index]; + else + return 0; +} + +int get_num_recompiled(uint32 addr) +{ + if(addr != addr_recompiled) + decode_recompiled(addr); + + return lines_recompiled; +} + +int get_has_recompiled(uint32 addr) +{ + unsigned char *assemb, *end_addr; + + if(r4300emu != CORE_DYNAREC || blocks[addr>>12] == NULL) + return FALSE; + + assemb = (blocks[addr>>12]->code) + + (blocks[addr>>12]->block[(addr&0xFFF)/4].local_addr); + + end_addr = blocks[addr>>12]->code; + + if( (addr & 0xFFF) >= 0xFFC) + end_addr += blocks[addr>>12]->code_length; + else + end_addr += blocks[addr>>12]->block[(addr&0xFFF)/4+1].local_addr; + if(assemb==end_addr) + return FALSE; + + return TRUE; +} + +#else + +#define CHECK_MEM(address) + +int get_num_recompiled(uint32 addr) +{ + return 0; +} + +char* get_recompiled_opcode(uint32 addr, int index) +{ + return NULL; +} + +char* get_recompiled_args(uint32 addr, int index) +{ + return NULL; +} + +void * get_recompiled_addr(uint32 addr, int index) +{ + return 0; +} + +int get_has_recompiled(uint32 addr) +{ + return 0; +} + +void init_host_disassembler(void) +{ + +} + +#endif + +uint64 read_memory_64(uint32 addr) +{ + return ((uint64)read_memory_32(addr) << 32) | (uint64)read_memory_32(addr + 4); +} + +uint64 read_memory_64_unaligned(uint32 addr) +{ + uint64 w[2]; + + w[0] = read_memory_32_unaligned(addr); + w[1] = read_memory_32_unaligned(addr + 4); + return (w[0] << 32) | w[1]; +} + +void write_memory_64(uint32 addr, uint64 value) +{ + write_memory_32(addr, (uint32) (value >> 32)); + write_memory_32(addr + 4, (uint32) (value & 0xFFFFFFFF)); +} + +void write_memory_64_unaligned(uint32 addr, uint64 value) +{ + write_memory_32_unaligned(addr, (uint32) (value >> 32)); + write_memory_32_unaligned(addr + 4, (uint32) (value & 0xFFFFFFFF)); +} + +uint32 read_memory_32(uint32 addr){ + const uint32 addrlow = (addr & 0xFFFF); + + switch(get_memory_type(addr)) + { + case M64P_MEM_NOMEM: + if(tlb_LUT_r[addr>>12]) + return read_memory_32((tlb_LUT_r[addr>>12]&0xFFFFF000)|(addr&0xFFF)); + return M64P_MEM_INVALID; + case M64P_MEM_RDRAM: + return *((uint32 *)(rdramb + (addr & 0xFFFFFF))); + case M64P_MEM_RSPMEM: + if ((addr & 0xFFFF) < 0x1000) + return *((uint32 *)(SP_DMEMb + (addr&0xFFF))); + else if ((addr&0xFFFF) < 0x2000) + return *((uint32 *)(SP_IMEMb + (addr&0xFFF))); + else + return M64P_MEM_INVALID; + case M64P_MEM_ROM: + return *((uint32 *)(rom + (addr & 0x03FFFFFF))); + case M64P_MEM_RDRAMREG: + if (addrlow < 0x28) + return *(readrdramreg[addrlow&0xfffc]); + break; + case M64P_MEM_RSPREG: + if (addrlow < 0x20) + return *(readrspreg[addrlow&0xfffc]); + break; + case M64P_MEM_RSP: + if (addrlow < 0x8) + return *(readrsp[addrlow&0xfffc]); + break; + case M64P_MEM_DP: + if (addrlow < 0x20) + return *(readdp[addrlow&0xfffc]); + break; + case M64P_MEM_DPS: + if (addrlow < 0x10) + return *(readdps[addrlow&0xfffc]); + break; + case M64P_MEM_VI: + if (addrlow < 0x38) + return *(readvi[addrlow&0xfffc]); + break; + case M64P_MEM_AI: + if (addrlow < 0x18) + return *(readai[addrlow&0xfffc]); + break; + case M64P_MEM_PI: + if (addrlow < 0x34) + return *(readpi[addrlow&0xfffc]); + break; + case M64P_MEM_RI: + if (addrlow < 0x20) + return *(readri[addrlow&0xfffc]); + break; + case M64P_MEM_SI: + if (addrlow < 0x1c) + return *(readsi[addrlow&0xfffc]); + break; + case M64P_MEM_PIF: + if (addrlow >= 0x7C0 && addrlow <= 0x7FF) + return sl(*((unsigned int *)(PIF_RAMb + (addrlow & 0x7FF) - 0x7C0))); + break; + case M64P_MEM_MI: + if (addrlow < 0x10) + return *(readmi[addrlow&0xfffc]); + break; + default: + break; + } + return M64P_MEM_INVALID; +} + +uint32 read_memory_32_unaligned(uint32 addr) +{ + uint8 i, b[4]; + + for(i=0; i<4; i++) b[i] = read_memory_8(addr + i); + return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3]; +} + +void write_memory_32(uint32 addr, uint32 value){ + switch(get_memory_type(addr)) + { + case M64P_MEM_RDRAM: + *((uint32 *)(rdramb + (addr & 0xFFFFFF))) = value; + CHECK_MEM(addr) + break; + } +} + +void write_memory_32_unaligned(uint32 addr, uint32 value) +{ + write_memory_8(addr + 0, value >> 24); + write_memory_8(addr + 1, (value >> 16) & 0xFF); + write_memory_8(addr + 2, (value >> 8) & 0xFF); + write_memory_8(addr + 3, value & 0xFF); +} + +//read_memory_16_unaligned and write_memory_16_unaligned don't exist because +//read_memory_16 and write_memory_16 work unaligned already. +uint16 read_memory_16(uint32 addr) +{ + return ((uint16)read_memory_8(addr) << 8) | (uint16)read_memory_8(addr+1); //cough cough hack hack +} + +void write_memory_16(uint32 addr, uint16 value) +{ + write_memory_8(addr, value >> 8); //this isn't much better + write_memory_8(addr + 1, value & 0xFF); //then again, it works unaligned +} + +uint8 read_memory_8(uint32 addr) +{ + uint32 word; + + word = read_memory_32(addr & ~3); + return (word >> ((3 - (addr & 3)) * 8)) & 0xFF; +} + +void write_memory_8(uint32 addr, uint8 value) +{ + uint32 word, mask; + + word = read_memory_32(addr & ~3); + mask = 0xFF << ((3 - (addr & 3)) * 8); + word = (word & ~mask) | (value << ((3 - (addr & 3)) * 8)); + write_memory_32(addr & ~3, word); +} + +uint32 get_memory_flags(uint32 addr) +{ + int type=get_memory_type(addr); + const uint32 addrlow = (addr & 0xFFFF); + uint32 flags = 0; + + switch(type) + { + case M64P_MEM_NOMEM: + if(tlb_LUT_r[addr>>12]) + flags = M64P_MEM_FLAG_READABLE | M64P_MEM_FLAG_WRITABLE_EMUONLY; + break; + case M64P_MEM_NOTHING: + if (((addr >> 16) == 0x8801 || (addr >> 16 == 0xA801)) && addrlow == 0) + flags = M64P_MEM_FLAG_WRITABLE_EMUONLY; // for flashram command + break; + case M64P_MEM_RDRAM: + flags = M64P_MEM_FLAG_WRITABLE; + case M64P_MEM_ROM: + flags |= M64P_MEM_FLAG_READABLE; + break; + case M64P_MEM_RDRAMREG: + if (addrlow < 0x28) + flags = M64P_MEM_FLAG_READABLE | M64P_MEM_FLAG_WRITABLE_EMUONLY; + break; + case M64P_MEM_RSPMEM: + if (addrlow < 0x2000) + flags = M64P_MEM_FLAG_READABLE | M64P_MEM_FLAG_WRITABLE_EMUONLY; + break; + case M64P_MEM_RSPREG: + if (addrlow < 0x20) + flags = M64P_MEM_FLAG_READABLE | M64P_MEM_FLAG_WRITABLE_EMUONLY; + break; + case M64P_MEM_RSP: + if (addrlow < 0x8) + flags = M64P_MEM_FLAG_READABLE | M64P_MEM_FLAG_WRITABLE_EMUONLY; + break; + case M64P_MEM_DP: + if (addrlow < 0x20) + flags = M64P_MEM_FLAG_READABLE | M64P_MEM_FLAG_WRITABLE_EMUONLY; + break; + case M64P_MEM_DPS: + if (addrlow < 0x10) + flags = M64P_MEM_FLAG_READABLE | M64P_MEM_FLAG_WRITABLE_EMUONLY; + break; + case M64P_MEM_VI: + if (addrlow < 0x38) + flags = M64P_MEM_FLAG_READABLE | M64P_MEM_FLAG_WRITABLE_EMUONLY; + break; + case M64P_MEM_AI: + if (addrlow < 0x18) + flags = M64P_MEM_FLAG_READABLE | M64P_MEM_FLAG_WRITABLE_EMUONLY; + break; + case M64P_MEM_PI: + if (addrlow < 0x34) + flags = M64P_MEM_FLAG_READABLE | M64P_MEM_FLAG_WRITABLE_EMUONLY; + break; + case M64P_MEM_RI: + if (addrlow < 0x20) + flags = M64P_MEM_FLAG_READABLE | M64P_MEM_FLAG_WRITABLE_EMUONLY; + break; + case M64P_MEM_SI: + if (addrlow < 0x1c) + flags = M64P_MEM_FLAG_READABLE | M64P_MEM_FLAG_WRITABLE_EMUONLY; + break; + case M64P_MEM_FLASHRAMSTAT: + if (addrlow == 0) + flags = M64P_MEM_FLAG_READABLE_EMUONLY; + break; + case M64P_MEM_PIF: + if (addrlow >= 0x7C0 && addrlow <= 0x7FF) + flags = M64P_MEM_FLAG_READABLE | M64P_MEM_FLAG_WRITABLE_EMUONLY; + break; + case M64P_MEM_MI: + if (addrlow < 0x10) + flags = M64P_MEM_FLAG_READABLE | M64P_MEM_FLAG_WRITABLE_EMUONLY; + break; + default: + break; + } + + return flags; +} + +int get_memory_type(uint32 addr){ + void (*readfunc)() = readmem[addr >> 16]; + + if((readfunc == read_nomem) || (readfunc == read_nomem_break)) + return M64P_MEM_NOMEM; + else if((readfunc == read_nothing) || (readfunc == read_nothing_break)) + return M64P_MEM_NOTHING; + else if((readfunc == read_rdram) || (readfunc == read_rdram_break)) + return M64P_MEM_RDRAM; + else if((readfunc == read_rdramreg) || (readfunc == read_rdramreg_break)) + return M64P_MEM_RDRAMREG; + else if((readfunc == read_rsp_mem) || (readfunc == read_rsp_mem_break)) + return M64P_MEM_RSPMEM; + else if((readfunc == read_rsp_reg) || (readfunc == read_rsp_reg_break)) + return M64P_MEM_RSPREG; + else if((readfunc == read_rsp) || (readfunc == read_rsp_break)) + return M64P_MEM_RSP; + else if((readfunc == read_dp) || (readfunc == read_dp_break)) + return M64P_MEM_DP; + else if((readfunc == read_dps) || (readfunc == read_dps_break)) + return M64P_MEM_DPS; + else if((readfunc == read_vi) || (readfunc == read_vi_break)) + return M64P_MEM_VI; + else if((readfunc == read_ai) || (readfunc == read_ai_break)) + return M64P_MEM_AI; + else if((readfunc == read_pi) || (readfunc == read_pi_break)) + return M64P_MEM_PI; + else if((readfunc == read_ri) || (readfunc == read_ri_break)) + return M64P_MEM_RI; + else if((readfunc == read_si) || (readfunc == read_si_break)) + return M64P_MEM_SI; + else if((readfunc == read_flashram_status) || + (readfunc == read_flashram_status_break)) + return M64P_MEM_FLASHRAMSTAT; + else if((readfunc == read_rom) || (readfunc == read_rom_break)) + return M64P_MEM_ROM; + else if((readfunc == read_pif) || (readfunc == read_pif_break)) + return M64P_MEM_PIF; + else if((readfunc == read_mi) || (readfunc == read_mi_break)) + return M64P_MEM_MI; + else + DebugMessage(M64MSG_ERROR, "Unknown memory type in debugger get_memory_type(): %p", readfunc); + return M64P_MEM_NOMEM; +} + +void activate_memory_break_read(uint32 addr) { + void (*readfunc)() = readmem[addr >> 16]; + + if(readfunc == read_nomem) { + readmem[addr >> 16] = read_nomem_break; + readmemb[addr >> 16] = read_nomemb_break; + readmemh[addr >> 16] = read_nomemh_break; + readmemd[addr >> 16] = read_nomemd_break; + } + else if(readfunc == read_nothing) { + readmem[addr >> 16] = read_nothing_break; + readmemb[addr >> 16] = read_nothingb_break; + readmemh[addr >> 16] = read_nothingh_break; + readmemd[addr >> 16] = read_nothingd_break; + } + else if(readfunc == read_rdram) { + readmem[addr >> 16] = read_rdram_break; + readmemb[addr >> 16] = read_rdramb_break; + readmemh[addr >> 16] = read_rdramh_break; + readmemd[addr >> 16] = read_rdramd_break; + } + else if(readfunc == read_rdramFB) { + readmem[addr >> 16] = read_rdramFB_break; + readmemb[addr >> 16] = read_rdramFBb_break; + readmemh[addr >> 16] = read_rdramFBh_break; + readmemd[addr >> 16] = read_rdramFBd_break; + } + else if(readfunc == read_rdramreg) { + readmem[addr >> 16] = read_rdramreg_break; + readmemb[addr >> 16] = read_rdramregb_break; + readmemh[addr >> 16] = read_rdramregh_break; + readmemd[addr >> 16] = read_rdramregd_break; + } + else if(readfunc == read_rsp_mem) { + readmem[addr >> 16] = read_rsp_mem_break; + readmemb[addr >> 16] = read_rsp_memb_break; + readmemh[addr >> 16] = read_rsp_memh_break; + readmemd[addr >> 16] = read_rsp_memd_break; + } + else if(readfunc == read_rsp_reg) { + readmem[addr >> 16] = read_rsp_reg_break; + readmemb[addr >> 16] = read_rsp_regh_break; + readmemh[addr >> 16] = read_rsp_regb_break; + readmemd[addr >> 16] = read_rsp_regd_break; + } + else if(readfunc == read_rsp) { + readmem[addr >> 16] = read_rsp_break; + readmemb[addr >> 16] = read_rsph_break; + readmemh[addr >> 16] = read_rspb_break; + readmemd[addr >> 16] = read_rspd_break; + } + else if(readfunc == read_dp) { + readmem[addr >> 16] = read_dp_break; + readmemb[addr >> 16] = read_dpb_break; + readmemh[addr >> 16] = read_dph_break; + readmemd[addr >> 16] = read_dpd_break; + } + else if(readfunc == read_dps) { + readmem[addr >> 16] = read_dps_break; + readmemb[addr >> 16] = read_dpsb_break; + readmemh[addr >> 16] = read_dpsh_break; + readmemd[addr >> 16] = read_dpsd_break; + } + else if(readfunc == read_mi) { + readmem[addr >> 16] = read_mi_break; + readmemb[addr >> 16] = read_mib_break; + readmemh[addr >> 16] = read_mih_break; + readmemd[addr >> 16] = read_mid_break; + } + else if(readfunc == read_vi) { + readmem[addr >> 16] = read_vi_break; + readmemb[addr >> 16] = read_vib_break; + readmemh[addr >> 16] = read_vih_break; + readmemd[addr >> 16] = read_vid_break; + } + else if(readfunc == read_ai) { + readmem[addr >> 16] = read_ai_break; + readmemb[addr >> 16] = read_aib_break; + readmemh[addr >> 16] = read_aih_break; + readmemd[addr >> 16] = read_aid_break; + } + else if(readfunc == read_pi) { + readmem[addr >> 16] = read_pi_break; + readmemb[addr >> 16] = read_pib_break; + readmemh[addr >> 16] = read_pih_break; + readmemd[addr >> 16] = read_pid_break; + } + else if(readfunc == read_ri) { + readmem[addr >> 16] = read_ri_break; + readmemb[addr >> 16] = read_rib_break; + readmemh[addr >> 16] = read_rih_break; + readmemd[addr >> 16] = read_rid_break; + } + else if(readfunc == read_si) { + readmem[addr >> 16] = read_si_break; + readmemb[addr >> 16] = read_sib_break; + readmemh[addr >> 16] = read_sih_break; + readmemd[addr >> 16] = read_sid_break; + } + else if(readfunc == read_pif) { + readmem[addr >> 16] = read_pif_break; + readmemb[addr >> 16] = read_pifb_break; + readmemh[addr >> 16] = read_pifh_break; + readmemd[addr >> 16] = read_pifd_break; + } + else if(readfunc == read_flashram_status) { + readmem[addr >> 16] = read_flashram_status_break; + readmemb[addr >> 16] = read_flashram_statusb_break; + readmemh[addr >> 16] = read_flashram_statush_break; + readmemd[addr >> 16] = read_flashram_statusd_break; + } + else if(readfunc == read_rom) { + readmem[addr >> 16] = read_rom_break; + readmemb[addr >> 16] = read_romb_break; + readmemh[addr >> 16] = read_romh_break; + readmemd[addr >> 16] = read_romd_break; + } + else + DebugMessage(M64MSG_ERROR, "Unknown memory type in debugger activate_memory_break_read(): %p", readfunc); +} + +void deactivate_memory_break_read(uint32 addr) { + void (*readfunc)() = readmem[addr >> 16]; + + if(readfunc == read_nomem_break) { + readmem[addr >> 16] = read_nomem; + readmemb[addr >> 16] = read_nomemb; + readmemh[addr >> 16] = read_nomemh; + readmemd[addr >> 16] = read_nomemd; + } + else if(readfunc == read_nothing_break) { + readmem[addr >> 16] = read_nothing; + readmemb[addr >> 16] = read_nothingb; + readmemh[addr >> 16] = read_nothingh; + readmemd[addr >> 16] = read_nothingd; + } + else if(readfunc == read_rdram_break) { + readmem[addr >> 16] = read_rdram; + readmemb[addr >> 16] = read_rdramb; + readmemh[addr >> 16] = read_rdramh; + readmemd[addr >> 16] = read_rdramd; + } + else if(readfunc == read_rdramFB_break) { + readmem[addr >> 16] = read_rdramFB; + readmemb[addr >> 16] = read_rdramFBb; + readmemh[addr >> 16] = read_rdramFBh; + readmemd[addr >> 16] = read_rdramFBd; + } + else if(readfunc == read_rdramreg_break) { + readmem[addr >> 16] = read_rdramreg; + readmemb[addr >> 16] = read_rdramregb; + readmemh[addr >> 16] = read_rdramregh; + readmemd[addr >> 16] = read_rdramregd; + } + else if(readfunc == read_rsp_mem_break) { + readmem[addr >> 16] = read_rsp_mem; + readmemb[addr >> 16] = read_rsp_memb; + readmemh[addr >> 16] = read_rsp_memh; + readmemd[addr >> 16] = read_rsp_memd; + } + else if(readfunc == read_rsp_reg_break) { + readmem[addr >> 16] = read_rsp_reg; + readmemb[addr >> 16] = read_rsp_regh; + readmemh[addr >> 16] = read_rsp_regb; + readmemd[addr >> 16] = read_rsp_regd; + } + else if(readfunc == read_rsp_break) { + readmem[addr >> 16] = read_rsp; + readmemb[addr >> 16] = read_rsph; + readmemh[addr >> 16] = read_rspb; + readmemd[addr >> 16] = read_rspd; + } + else if(readfunc == read_dp_break) { + readmem[addr >> 16] = read_dp; + readmemb[addr >> 16] = read_dpb; + readmemh[addr >> 16] = read_dph; + readmemd[addr >> 16] = read_dpd; + } + else if(readfunc == read_dps_break) { + readmem[addr >> 16] = read_dps; + readmemb[addr >> 16] = read_dpsb; + readmemh[addr >> 16] = read_dpsh; + readmemd[addr >> 16] = read_dpsd; + } + else if(readfunc == read_mi_break) { + readmem[addr >> 16] = read_mi; + readmemb[addr >> 16] = read_mib; + readmemh[addr >> 16] = read_mih; + readmemd[addr >> 16] = read_mid; + } + else if(readfunc == read_vi_break) { + readmem[addr >> 16] = read_vi; + readmemb[addr >> 16] = read_vib; + readmemh[addr >> 16] = read_vih; + readmemd[addr >> 16] = read_vid; + } + else if(readfunc == read_ai_break) { + readmem[addr >> 16] = read_ai; + readmemb[addr >> 16] = read_aib; + readmemh[addr >> 16] = read_aih; + readmemd[addr >> 16] = read_aid; + } + else if(readfunc == read_pi_break) { + readmem[addr >> 16] = read_pi; + readmemb[addr >> 16] = read_pib; + readmemh[addr >> 16] = read_pih; + readmemd[addr >> 16] = read_pid; + } + else if(readfunc == read_ri_break) { + readmem[addr >> 16] = read_ri; + readmemb[addr >> 16] = read_rib; + readmemh[addr >> 16] = read_rih; + readmemd[addr >> 16] = read_rid; + } + else if(readfunc == read_si_break) { + readmem[addr >> 16] = read_si; + readmemb[addr >> 16] = read_sib; + readmemh[addr >> 16] = read_sih; + readmemd[addr >> 16] = read_sid; + } + else if(readfunc == read_pif_break) { + readmem[addr >> 16] = read_pif; + readmemb[addr >> 16] = read_pifb; + readmemh[addr >> 16] = read_pifh; + readmemd[addr >> 16] = read_pifd; + } + else if(readfunc == read_flashram_status_break) { + readmem[addr >> 16] = read_flashram_status; + readmemb[addr >> 16] = read_flashram_statusb; + readmemh[addr >> 16] = read_flashram_statush; + readmemd[addr >> 16] = read_flashram_statusd; + } + else if(readfunc == read_rom_break) { + readmem[addr >> 16] = read_rom; + readmemb[addr >> 16] = read_romb; + readmemh[addr >> 16] = read_romh; + readmemd[addr >> 16] = read_romd; + } + else + DebugMessage(M64MSG_ERROR, "Unknown memory type in debugger deactivate_memory_break_read(): %p", readfunc); +} + +void activate_memory_break_write(uint32 addr) { + void (*writefunc)() = writemem[addr >> 16]; + + if(writefunc == write_nomem) { + writemem[addr >> 16] = write_nomem_break; + writememb[addr >> 16] = write_nomemb_break; + writememh[addr >> 16] = write_nomemh_break; + writememd[addr >> 16] = write_nomemd_break; + } + else if(writefunc == write_nothing) { + writemem[addr >> 16] = write_nothing_break; + writememb[addr >> 16] = write_nothingb_break; + writememh[addr >> 16] = write_nothingh_break; + writememd[addr >> 16] = write_nothingd_break; + } + else if(writefunc == write_rdram) { + writemem[addr >> 16] = write_rdram_break; + writememb[addr >> 16] = write_rdramb_break; + writememh[addr >> 16] = write_rdramh_break; + writememd[addr >> 16] = write_rdramd_break; + } + else if(writefunc == write_rdramFB) { + writemem[addr >> 16] = write_rdramFB_break; + writememb[addr >> 16] = write_rdramFBb_break; + writememh[addr >> 16] = write_rdramFBh_break; + writememd[addr >> 16] = write_rdramFBd_break; + } + else if(writefunc == write_rdramreg) { + writemem[addr >> 16] = write_rdramreg_break; + writememb[addr >> 16] = write_rdramregb_break; + writememh[addr >> 16] = write_rdramregh_break; + writememd[addr >> 16] = write_rdramregd_break; + } + else if(writefunc == write_rsp_mem) { + writemem[addr >> 16] = write_rsp_mem_break; + writememb[addr >> 16] = write_rsp_memb_break; + writememh[addr >> 16] = write_rsp_memh_break; + writememd[addr >> 16] = write_rsp_memd_break; + } + else if(writefunc == write_rsp_reg) { + writemem[addr >> 16] = write_rsp_reg_break; + writememb[addr >> 16] = write_rsp_regh_break; + writememh[addr >> 16] = write_rsp_regb_break; + writememd[addr >> 16] = write_rsp_regd_break; + } + else if(writefunc == write_rsp) { + writemem[addr >> 16] = write_rsp_break; + writememb[addr >> 16] = write_rsph_break; + writememh[addr >> 16] = write_rspb_break; + writememd[addr >> 16] = write_rspd_break; + } + else if(writefunc == write_dp) { + writemem[addr >> 16] = write_dp_break; + writememb[addr >> 16] = write_dpb_break; + writememh[addr >> 16] = write_dph_break; + writememd[addr >> 16] = write_dpd_break; + } + else if(writefunc == write_dps) { + writemem[addr >> 16] = write_dps_break; + writememb[addr >> 16] = write_dpsb_break; + writememh[addr >> 16] = write_dpsh_break; + writememd[addr >> 16] = write_dpsd_break; + } + else if(writefunc == write_mi) { + writemem[addr >> 16] = write_mi_break; + writememb[addr >> 16] = write_mib_break; + writememh[addr >> 16] = write_mih_break; + writememd[addr >> 16] = write_mid_break; + } + else if(writefunc == write_vi) { + writemem[addr >> 16] = write_vi_break; + writememb[addr >> 16] = write_vib_break; + writememh[addr >> 16] = write_vih_break; + writememd[addr >> 16] = write_vid_break; + } + else if(writefunc == write_ai) { + writemem[addr >> 16] = write_ai_break; + writememb[addr >> 16] = write_aib_break; + writememh[addr >> 16] = write_aih_break; + writememd[addr >> 16] = write_aid_break; + } + else if(writefunc == write_pi) { + writemem[addr >> 16] = write_pi_break; + writememb[addr >> 16] = write_pib_break; + writememh[addr >> 16] = write_pih_break; + writememd[addr >> 16] = write_pid_break; + } + else if(writefunc == write_ri) { + writemem[addr >> 16] = write_ri_break; + writememb[addr >> 16] = write_rib_break; + writememh[addr >> 16] = write_rih_break; + writememd[addr >> 16] = write_rid_break; + } + else if(writefunc == write_si) { + writemem[addr >> 16] = write_si_break; + writememb[addr >> 16] = write_sib_break; + writememh[addr >> 16] = write_sih_break; + writememd[addr >> 16] = write_sid_break; + } + else if(writefunc == write_pif) { + writemem[addr >> 16] = write_pif_break; + writememb[addr >> 16] = write_pifb_break; + writememh[addr >> 16] = write_pifh_break; + writememd[addr >> 16] = write_pifd_break; + } + else if(writefunc == write_flashram_dummy) { + writemem[addr >> 16] = write_flashram_dummy_break; + writememb[addr >> 16] = write_flashram_dummyb_break; + writememh[addr >> 16] = write_flashram_dummyh_break; + writememd[addr >> 16] = write_flashram_dummyd_break; + } + else if(writefunc == write_flashram_command) { + writemem[addr >> 16] = write_flashram_command_break; + writememb[addr >> 16] = write_flashram_commandb_break; + writememh[addr >> 16] = write_flashram_commandh_break; + writememd[addr >> 16] = write_flashram_commandd_break; + } + else if(writefunc == write_rom) { + writemem[addr >> 16] = write_rom_break; + writememb[addr >> 16] = write_nothingb_break; + writememh[addr >> 16] = write_nothingh_break; + writememd[addr >> 16] = write_nothingd_break; + } + else + DebugMessage(M64MSG_ERROR, "Unknown memory type in debugger activate_memory_break_write(): %p", writefunc); +} + +void deactivate_memory_break_write(uint32 addr) { + void (*writefunc)() = writemem[addr >> 16]; + + if(writefunc == write_nomem_break) { + writemem[addr >> 16] = write_nomem; + writememb[addr >> 16] = write_nomemb; + writememh[addr >> 16] = write_nomemh; + writememd[addr >> 16] = write_nomemd; + } + else if(writefunc == write_nothing_break) { + writemem[addr >> 16] = write_nothing; + writememb[addr >> 16] = write_nothingb; + writememh[addr >> 16] = write_nothingh; + writememd[addr >> 16] = write_nothingd; + } + else if(writefunc == write_rdram_break) { + writemem[addr >> 16] = write_rdram; + writememb[addr >> 16] = write_rdramb; + writememh[addr >> 16] = write_rdramh; + writememd[addr >> 16] = write_rdramd; + } + else if(writefunc == write_rdramFB_break) { + writemem[addr >> 16] = write_rdramFB; + writememb[addr >> 16] = write_rdramFBb; + writememh[addr >> 16] = write_rdramFBh; + writememd[addr >> 16] = write_rdramFBd; + } + else if(writefunc == write_rdramreg_break) { + writemem[addr >> 16] = write_rdramreg; + writememb[addr >> 16] = write_rdramregb; + writememh[addr >> 16] = write_rdramregh; + writememd[addr >> 16] = write_rdramregd; + } + else if(writefunc == write_rsp_mem_break) { + writemem[addr >> 16] = write_rsp_mem; + writememb[addr >> 16] = write_rsp_memb; + writememh[addr >> 16] = write_rsp_memh; + writememd[addr >> 16] = write_rsp_memd; + } + else if(writefunc == write_rsp_reg_break) { + writemem[addr >> 16] = write_rsp_reg; + writememb[addr >> 16] = write_rsp_regh; + writememh[addr >> 16] = write_rsp_regb; + writememd[addr >> 16] = write_rsp_regd; + } + else if(writefunc == write_rsp_break) { + writemem[addr >> 16] = write_rsp; + writememb[addr >> 16] = write_rsph; + writememh[addr >> 16] = write_rspb; + writememd[addr >> 16] = write_rspd; + } + else if(writefunc == write_dp_break) { + writemem[addr >> 16] = write_dp; + writememb[addr >> 16] = write_dpb; + writememh[addr >> 16] = write_dph; + writememd[addr >> 16] = write_dpd; + } + else if(writefunc == write_dps_break) { + writemem[addr >> 16] = write_dps; + writememb[addr >> 16] = write_dpsb; + writememh[addr >> 16] = write_dpsh; + writememd[addr >> 16] = write_dpsd; + } + else if(writefunc == write_mi_break) { + writemem[addr >> 16] = write_mi; + writememb[addr >> 16] = write_mib; + writememh[addr >> 16] = write_mih; + writememd[addr >> 16] = write_mid; + } + else if(writefunc == write_vi_break) { + writemem[addr >> 16] = write_vi; + writememb[addr >> 16] = write_vib; + writememh[addr >> 16] = write_vih; + writememd[addr >> 16] = write_vid; + } + else if(writefunc == write_ai_break) { + writemem[addr >> 16] = write_ai; + writememb[addr >> 16] = write_aib; + writememh[addr >> 16] = write_aih; + writememd[addr >> 16] = write_aid; + } + else if(writefunc == write_pi_break) { + writemem[addr >> 16] = write_pi; + writememb[addr >> 16] = write_pib; + writememh[addr >> 16] = write_pih; + writememd[addr >> 16] = write_pid; + } + else if(writefunc == write_ri_break) { + writemem[addr >> 16] = write_ri; + writememb[addr >> 16] = write_rib; + writememh[addr >> 16] = write_rih; + writememd[addr >> 16] = write_rid; + } + else if(writefunc == write_si_break) { + writemem[addr >> 16] = write_si; + writememb[addr >> 16] = write_sib; + writememh[addr >> 16] = write_sih; + writememd[addr >> 16] = write_sid; + } + else if(writefunc == write_pif_break) { + writemem[addr >> 16] = write_pif; + writememb[addr >> 16] = write_pifb; + writememh[addr >> 16] = write_pifh; + writememd[addr >> 16] = write_pifd; + } + else if(writefunc == write_flashram_dummy_break) { + writemem[addr >> 16] = write_flashram_dummy; + writememb[addr >> 16] = write_flashram_dummyb; + writememh[addr >> 16] = write_flashram_dummyh; + writememd[addr >> 16] = write_flashram_dummyd; + } + else if(writefunc == write_flashram_command_break) { + writemem[addr >> 16] = write_flashram_command; + writememb[addr >> 16] = write_flashram_commandb; + writememh[addr >> 16] = write_flashram_commandh; + writememd[addr >> 16] = write_flashram_commandd; + } + else if(writefunc == write_rom_break) { + writemem[addr >> 16] = write_rom; + writememb[addr >> 16] = write_nothingb; + writememh[addr >> 16] = write_nothingh; + writememd[addr >> 16] = write_nothingd; + } + else + DebugMessage(M64MSG_ERROR, "Unknown memory type in debugger deactivate_memory_break_write(): %p", writefunc); +} diff --git a/libmupen64plus/mupen64plus-core/src/debugger/dbg_memory.h b/libmupen64plus/mupen64plus-core/src/debugger/dbg_memory.h new file mode 100644 index 0000000000..fb8b22f5ac --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/debugger/dbg_memory.h @@ -0,0 +1,112 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - dbg_memory.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2008 DarkJeztr * + * Copyright (C) 2002 davFr * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __DEBUGGER_MEMORY_H__ +#define __DEBUGGER_MEMORY_H__ + +#define MAX_DISASSEMBLY 64 + +/* The following three macros create all the function calls for catching memory breakpoints + * these do not occur until after the PC is incremented, but jumps & branches are not yet taken. + */ + +#define MEMBREAKREAD(name,size) \ + void name##_break(void) { \ + check_breakpoints_on_mem_access((PC->addr)-0x4, address, size, BPT_FLAG_ENABLED | BPT_FLAG_READ); \ + name (); \ + } + +#define MEMBREAKWRITE(name,size) \ + void name##_break(void) { \ + check_breakpoints_on_mem_access((PC->addr)-0x4, address, size, BPT_FLAG_ENABLED | BPT_FLAG_WRITE); \ + name (); \ + } + +#define MEMBREAKALL(name) \ + MEMBREAKREAD( read_##name , 4); \ + MEMBREAKREAD( read_##name##b , 1); \ + MEMBREAKREAD( read_##name##h , 2); \ + MEMBREAKREAD( read_##name##d , 8); \ + MEMBREAKWRITE( write_##name , 4); \ + MEMBREAKWRITE( write_##name##b , 1); \ + MEMBREAKWRITE( write_##name##h , 2); \ + MEMBREAKWRITE( write_##name##d , 8); + +#define MEMBREAKALL_local(name) \ + static MEMBREAKREAD( read_##name , 4); \ + static MEMBREAKREAD( read_##name##b , 1); \ + static MEMBREAKREAD( read_##name##h , 2); \ + static MEMBREAKREAD( read_##name##d , 8); \ + static MEMBREAKWRITE( write_##name , 4); \ + static MEMBREAKWRITE( write_##name##b , 1); \ + static MEMBREAKWRITE( write_##name##h , 2); \ + static MEMBREAKWRITE( write_##name##d , 8); + +void init_host_disassembler(void); + +char* get_recompiled_opcode( uint32 address, int index ); +char* get_recompiled_args( uint32 address, int index ); +void* get_recompiled_addr( uint32 address, int index ); +int get_num_recompiled( uint32 address ); +int get_has_recompiled( uint32 address ); + +uint64 read_memory_64(uint32 addr); +uint64 read_memory_64_unaligned(uint32 addr); +void write_memory_64(uint32 addr, uint64 value); +void write_memory_64_unaligned(uint32 addr, uint64 value); +uint32 read_memory_32(uint32); +uint32 read_memory_32_unaligned(uint32 addr); +void write_memory_32(uint32, uint32); +void write_memory_32_unaligned(uint32 addr, uint32 value); +uint16 read_memory_16(uint32 addr); +void write_memory_16(uint32 addr, uint16 value); +uint8 read_memory_8(uint32 addr); +void write_memory_8(uint32 addr, uint8 value); +uint32 get_memory_flags(uint32); +int get_memory_type(uint32); + +void activate_memory_break_read(uint32 addr); +void deactivate_memory_break_read(uint32 addr); +void activate_memory_break_write(uint32 addr); +void deactivate_memory_break_write(uint32 addr); + +/* Following are the prototypes for the memory breakpoint functions */ +void read_rdram_break(void); +void read_rdramb_break(void); +void read_rdramh_break(void); +void read_rdramd_break(void); +void read_rdramFB_break(void); +void read_rdramFBb_break(void); +void read_rdramFBh_break(void); +void read_rdramFBd_break(void); + +void write_rdram_break(void); +void write_rdramb_break(void); +void write_rdramh_break(void); +void write_rdramd_break(void); +void write_rdramFB_break(void); +void write_rdramFBb_break(void); +void write_rdramFBh_break(void); +void write_rdramFBd_break(void); + +#endif /* __DEBUGGER_MEMORY_H__ */ + diff --git a/libmupen64plus/mupen64plus-core/src/debugger/dbg_types.h b/libmupen64plus/mupen64plus-core/src/debugger/dbg_types.h new file mode 100644 index 0000000000..eaf93ea47e --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/debugger/dbg_types.h @@ -0,0 +1,31 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - dbg_types.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 davFr * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __TYPES_H__ +#define __TYPES_H__ + +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef unsigned int uint32; +typedef unsigned long long uint64; + +#endif /* __TYPES_H__ */ + diff --git a/libmupen64plus/mupen64plus-core/src/debugger/debugger.c b/libmupen64plus/mupen64plus-core/src/debugger/debugger.c new file mode 100644 index 0000000000..12ab0829aa --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/debugger/debugger.c @@ -0,0 +1,104 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - debugger.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2008 DarkJeztr * + * Copyright (C) 2002 davFr * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "api/debugger.h" + +#include "dbg_types.h" +#include "debugger.h" +#include "dbg_breakpoints.h" +#include "dbg_memory.h" + +// State of the Emulation Thread: +// 0 -> pause, 2 -> run. + +int g_DebuggerActive = 0; // whether the debugger is enabled or not +int run; + +static SDL_cond *debugger_done_cond; +static SDL_mutex *mutex; + +uint32 previousPC; + +//]=-=-=-=-=-=-=-=-=-=-=[ Initialisation du Debugger ]=-=-=-=-=-=-=-=-=-=-=-=[ + +void init_debugger() +{ + g_DebuggerActive = 1; + run = 0; + + DebuggerCallback(DEBUG_UI_INIT, 0); /* call front-end to initialize user interface */ + + init_host_disassembler(); + + mutex = SDL_CreateMutex(); + debugger_done_cond = SDL_CreateCond(); +} + +void destroy_debugger() +{ + SDL_DestroyMutex(mutex); + mutex = NULL; + SDL_DestroyCond(debugger_done_cond); + debugger_done_cond = NULL; + g_DebuggerActive = 0; +} + +//]=-=-=-=-=-=-=-=-=-=-=-=-=[ Mise-a-Jour Debugger ]=-=-=-=-=-=-=-=-=-=-=-=-=[ + +void update_debugger(uint32 pc) +// Update debugger state and display. +// Should be called after each R4300 instruction +// Checks for breakpoint hits on PC +{ + int bpt; + + if(run!=0) {//check if we hit a breakpoint + bpt = check_breakpoints(pc); + if( bpt!=-1 ) { + run = 0; + + if(BPT_CHECK_FLAG(g_Breakpoints[bpt], BPT_FLAG_LOG)) + log_breakpoint(pc, BPT_FLAG_EXEC, 0); + } + } + + if(run!=2) { + DebuggerCallback(DEBUG_UI_UPDATE, pc); /* call front-end to notify user interface to update */ + } + if(run==0) { + // Emulation thread is blocked until a button is clicked. + SDL_mutexP(mutex); + SDL_CondWait(debugger_done_cond, mutex); + SDL_mutexV(mutex); + } + + previousPC = pc; +} + +void debugger_step() +{ + SDL_CondSignal(debugger_done_cond); +} + + diff --git a/libmupen64plus/mupen64plus-core/src/debugger/debugger.h b/libmupen64plus/mupen64plus-core/src/debugger/debugger.h new file mode 100644 index 0000000000..cc686e2b53 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/debugger/debugger.h @@ -0,0 +1,40 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - debugger.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2008 DarkJeztr * + * Copyright (C) 2002 davFr * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __DEBUGGER_H__ +#define __DEBUGGER_H__ + +extern int g_DebuggerActive; /* True if the debugger is running */ + +/* State of the Emulation Thread: + 0 -> pause, 1 -> step, 2 -> run. */ +extern int run; + +extern uint32 previousPC; + +void init_debugger(void); +void update_debugger(uint32 pc); +void destroy_debugger(void); +void debugger_step(void); + +#endif /* __DEBUGGER_H__ */ + diff --git a/libmupen64plus/mupen64plus-core/src/main/cheat.c b/libmupen64plus/mupen64plus-core/src/main/cheat.c new file mode 100644 index 0000000000..52551ce0a0 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/cheat.c @@ -0,0 +1,457 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - cheat.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * Copyright (C) 2008 Okaygo * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +// gameshark and xploder64 reference: http://doc.kodewerx.net/hacking_n64.html + +#include +#include + +#include "api/m64p_types.h" +#include "api/callbacks.h" +#include "api/config.h" + +#include "memory/memory.h" +#include "osal/preproc.h" +#include "cheat.h" +#include "main.h" +#include "rom.h" +#include "eventloop.h" +#include "list.h" + +#include +#include + +// local definitions +#define CHEAT_CODE_MAGIC_VALUE 0xDEAD0000 + +typedef struct cheat_code { + unsigned int address; + int value; + int old_value; + struct list_head list; +} cheat_code_t; + +typedef struct cheat { + char *name; + int enabled; + int was_enabled; + struct list_head cheat_codes; + struct list_head list; +} cheat_t; + +// local variables +static LIST_HEAD(active_cheats); +static SDL_mutex *cheat_mutex = NULL; + +// private functions +static unsigned short read_address_16bit(unsigned int address) +{ + return *(unsigned short *)((rdramb + ((address & 0xFFFFFF)^S16))); +} + +static unsigned char read_address_8bit(unsigned int address) +{ + return *(unsigned char *)((rdramb + ((address & 0xFFFFFF)^S8))); +} + +static void update_address_16bit(unsigned int address, unsigned short new_value) +{ + *(unsigned short *)((rdramb + ((address & 0xFFFFFF)^S16))) = new_value; +} + +static void update_address_8bit(unsigned int address, unsigned char new_value) +{ + *(unsigned char *)((rdramb + ((address & 0xFFFFFF)^S8))) = new_value; +} + +static int address_equal_to_8bit(unsigned int address, unsigned char value) +{ + unsigned char value_read; + value_read = *(unsigned char *)((rdramb + ((address & 0xFFFFFF)^S8))); + return value_read == value; +} + +static int address_equal_to_16bit(unsigned int address, unsigned short value) +{ + unsigned short value_read; + value_read = *(unsigned short *)((rdramb + ((address & 0xFFFFFF)^S16))); + return value_read == value; +} + +// individual application - returns 0 if we are supposed to skip the next cheat +// (only really used on conditional codes) +static int execute_cheat(unsigned int address, unsigned short value, int *old_value) +{ + switch (address & 0xFF000000) + { + case 0x80000000: + case 0x88000000: + case 0xA0000000: + case 0xA8000000: + case 0xF0000000: + // if pointer to old value is valid and uninitialized, write current value to it + if(old_value && (*old_value == CHEAT_CODE_MAGIC_VALUE)) + *old_value = (int) read_address_8bit(address); + update_address_8bit(address,(unsigned char) value); + return 1; + case 0x81000000: + case 0x89000000: + case 0xA1000000: + case 0xA9000000: + case 0xF1000000: + // if pointer to old value is valid and uninitialized, write current value to it + if(old_value && (*old_value == CHEAT_CODE_MAGIC_VALUE)) + *old_value = (int) read_address_16bit(address); + update_address_16bit(address,value); + return 1; + case 0xD0000000: + case 0xD8000000: + return address_equal_to_8bit(address,(unsigned char) value); + case 0xD1000000: + case 0xD9000000: + return address_equal_to_16bit(address,value); + case 0xD2000000: + case 0xDB000000: + return !(address_equal_to_8bit(address,(unsigned char) value)); + case 0xD3000000: + case 0xDA000000: + return !(address_equal_to_16bit(address,value)); + case 0xEE000000: + // most likely, this doesnt do anything. + execute_cheat(0xF1000318, 0x0040, NULL); + execute_cheat(0xF100031A, 0x0000, NULL); + return 1; + default: + return 1; + } +} + +static cheat_t *find_or_create_cheat(const char *name) +{ + cheat_t *cheat; + int found = 0; + + list_for_each_entry(cheat, &active_cheats, cheat_t, list) { + if (strcmp(cheat->name, name) == 0) { + found = 1; + break; + } + } + + if (found) + { + /* delete any pre-existing cheat codes */ + cheat_code_t *code, *safe; + + list_for_each_entry_safe(code, safe, &cheat->cheat_codes, cheat_code_t, list) { + list_del(&code->list); + free(code); + } + + cheat->enabled = 0; + cheat->was_enabled = 0; + } + else + { + cheat = malloc(sizeof(*cheat)); + cheat->name = strdup(name); + cheat->enabled = 0; + cheat->was_enabled = 0; + INIT_LIST_HEAD(&cheat->cheat_codes); + list_add_tail(&cheat->list, &active_cheats); + } + + return cheat; +} + + +// public functions +void cheat_init(void) +{ + cheat_mutex = SDL_CreateMutex(); +} + +void cheat_uninit(void) +{ + if (cheat_mutex != NULL) + SDL_DestroyMutex(cheat_mutex); + cheat_mutex = NULL; +} + +void cheat_apply_cheats(int entry) +{ + cheat_t *cheat; + cheat_code_t *code; + int skip; + int execute_next; + + // If game is Zelda OOT, apply subscreen delay fix + if (strncmp((char *)ROM_HEADER.Name, "THE LEGEND OF ZELDA", 19) == 0 && entry == ENTRY_VI) { + if (sl(ROM_HEADER.CRC1) == 0xEC7011B7 && sl(ROM_HEADER.CRC2) == 0x7616D72B) { + // Legend of Zelda, The - Ocarina of Time (U) + (J) (V1.0) + execute_cheat(0x801DA5CB, 0x0002, NULL); + } else if (sl(ROM_HEADER.CRC1) == 0xD43DA81F && sl(ROM_HEADER.CRC2) == 0x021E1E19) { + // Legend of Zelda, The - Ocarina of Time (U) + (J) (V1.1) + execute_cheat(0x801DA78B, 0x0002, NULL); + } else if (sl(ROM_HEADER.CRC1) == 0x693BA2AE && sl(ROM_HEADER.CRC2) == 0xB7F14E9F) { + // Legend of Zelda, The - Ocarina of Time (U) + (J) (V1.2) + execute_cheat(0x801DAE8B, 0x0002, NULL); + } else if (sl(ROM_HEADER.CRC1) == 0xB044B569 && sl(ROM_HEADER.CRC2) == 0x373C1985) { + // Legend of Zelda, The - Ocarina of Time (E) (V1.0) + execute_cheat(0x801D860B, 0x0002, NULL); + } else if (sl(ROM_HEADER.CRC1) == 0xB2055FBD && sl(ROM_HEADER.CRC2) == 0x0BAB4E0C) { + // Legend of Zelda, The - Ocarina of Time (E) (V1.1) + execute_cheat(0x801D864B, 0x0002, NULL); + } else { + // Legend of Zelda, The - Ocarina of Time Master Quest + execute_cheat(0x801D8F4B, 0x0002, NULL); + } + } + + if (list_empty(&active_cheats)) + return; + + if (cheat_mutex == NULL || SDL_LockMutex(cheat_mutex) != 0) + { + DebugMessage(M64MSG_ERROR, "Internal error: failed to lock mutex in cheat_apply_cheats()"); + return; + } + + list_for_each_entry(cheat, &active_cheats, cheat_t, list) { + if (cheat->enabled) + { + cheat->was_enabled = 1; + switch(entry) + { + case ENTRY_BOOT: + list_for_each_entry(code, &cheat->cheat_codes, cheat_code_t, list) { + // code should only be written once at boot time + if((code->address & 0xF0000000) == 0xF0000000) + execute_cheat(code->address, code->value, &code->old_value); + } + break; + case ENTRY_VI: + skip = 0; + execute_next = 0; + list_for_each_entry(code, &cheat->cheat_codes, cheat_code_t, list) { + if (skip) { + skip = 0; + continue; + } + if (execute_next) { + execute_next = 0; + + // if code needs GS button pressed, don't save old value + if(((code->address & 0xFF000000) == 0xD8000000 || + (code->address & 0xFF000000) == 0xD9000000 || + (code->address & 0xFF000000) == 0xDA000000 || + (code->address & 0xFF000000) == 0xDB000000)) + execute_cheat(code->address, code->value, NULL); + else + execute_cheat(code->address, code->value, &code->old_value); + + continue; + } + // conditional cheat codes + if((code->address & 0xF0000000) == 0xD0000000) + { + // if code needs GS button pressed and it's not, skip it + if(((code->address & 0xFF000000) == 0xD8000000 || + (code->address & 0xFF000000) == 0xD9000000 || + (code->address & 0xFF000000) == 0xDA000000 || + (code->address & 0xFF000000) == 0xDB000000) && + !event_gameshark_active()) + { + // skip next code + skip = 1; + continue; + } + + if (execute_cheat(code->address, code->value, NULL)) { + // if condition true, execute next cheat code + execute_next = 1; + } else { + // if condition false, skip next code + skip = 1; + continue; + } + } + // GS button triggers cheat code + else if((code->address & 0xFF000000) == 0x88000000 || + (code->address & 0xFF000000) == 0x89000000 || + (code->address & 0xFF000000) == 0xA8000000 || + (code->address & 0xFF000000) == 0xA9000000) + { + if(event_gameshark_active()) + execute_cheat(code->address, code->value, NULL); + } + // normal cheat code + else + { + // exclude boot-time cheat codes + if((code->address & 0xF0000000) != 0xF0000000) + execute_cheat(code->address, code->value, &code->old_value); + } + } + break; + default: + break; + } + } + // if cheat was enabled, but is now disabled, restore old memory values + else if (cheat->was_enabled) + { + cheat->was_enabled = 0; + switch(entry) + { + case ENTRY_VI: + list_for_each_entry(code, &cheat->cheat_codes, cheat_code_t, list) { + // set memory back to old value and clear saved copy of old value + if(code->old_value != CHEAT_CODE_MAGIC_VALUE) + { + execute_cheat(code->address, code->old_value, NULL); + code->old_value = CHEAT_CODE_MAGIC_VALUE; + } + } + break; + default: + break; + } + } + } + + SDL_UnlockMutex(cheat_mutex); +} + + +void cheat_delete_all(void) +{ + cheat_t *cheat, *safe_cheat; + cheat_code_t *code, *safe_code; + + if (list_empty(&active_cheats)) + return; + + if (cheat_mutex == NULL || SDL_LockMutex(cheat_mutex) != 0) + { + DebugMessage(M64MSG_ERROR, "Internal error: failed to lock mutex in cheat_delete_all()"); + return; + } + + list_for_each_entry_safe(cheat, safe_cheat, &active_cheats, cheat_t, list) { + free(cheat->name); + + list_for_each_entry_safe(code, safe_code, &cheat->cheat_codes, cheat_code_t, list) { + list_del(&code->list); + free(code); + } + list_del(&cheat->list); + free(cheat); + } + + SDL_UnlockMutex(cheat_mutex); +} + +int cheat_set_enabled(const char *name, int enabled) +{ + cheat_t *cheat = NULL; + + if (list_empty(&active_cheats)) + return 0; + + if (cheat_mutex == NULL || SDL_LockMutex(cheat_mutex) != 0) + { + DebugMessage(M64MSG_ERROR, "Internal error: failed to lock mutex in cheat_set_enabled()"); + return 0; + } + + list_for_each_entry(cheat, &active_cheats, cheat_t, list) { + if (strcmp(name, cheat->name) == 0) + { + cheat->enabled = enabled; + SDL_UnlockMutex(cheat_mutex); + return 1; + } + } + + SDL_UnlockMutex(cheat_mutex); + return 0; +} + +int cheat_add_new(const char *name, m64p_cheat_code *code_list, int num_codes) +{ + cheat_t *cheat; + int i, j; + + if (cheat_mutex == NULL || SDL_LockMutex(cheat_mutex) != 0) + { + DebugMessage(M64MSG_ERROR, "Internal error: failed to lock mutex in cheat_add_new()"); + return 0; + } + + /* create a new cheat function or erase the codes in an existing cheat function */ + cheat = find_or_create_cheat(name); + if (cheat == NULL) + { + SDL_UnlockMutex(cheat_mutex); + return 0; + } + + cheat->enabled = 1; /* default for new cheats is enabled */ + + for (i = 0; i < num_codes; i++) + { + /* if this is a 'patch' code, convert it and dump out all of the individual codes */ + if ((code_list[i].address & 0xFFFF0000) == 0x50000000 && i < num_codes - 1) + { + int code_count = ((code_list[i].address & 0xFF00) >> 8); + int incr_addr = code_list[i].address & 0xFF; + int incr_value = code_list[i].value; + int cur_addr = code_list[i+1].address; + int cur_value = code_list[i+1].value; + i += 1; + for (j = 0; j < code_count; j++) + { + cheat_code_t *code = malloc(sizeof(*code)); + code->address = cur_addr; + code->value = cur_value; + code->old_value = CHEAT_CODE_MAGIC_VALUE; + list_add_tail(&code->list, &cheat->cheat_codes); + cur_addr += incr_addr; + cur_value += incr_value; + } + } + else + { /* just a normal code */ + cheat_code_t *code = malloc(sizeof(*code)); + code->address = code_list[i].address; + code->value = code_list[i].value; + code->old_value = CHEAT_CODE_MAGIC_VALUE; + list_add_tail(&code->list, &cheat->cheat_codes); + } + } + + SDL_UnlockMutex(cheat_mutex); + return 1; +} + + diff --git a/libmupen64plus/mupen64plus-core/src/main/cheat.h b/libmupen64plus/mupen64plus-core/src/main/cheat.h new file mode 100644 index 0000000000..faaeb53082 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/cheat.h @@ -0,0 +1,40 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - cheat.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2008 Okaygo * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef CHEAT_H +#define CHEAT_H + +#include "api/m64p_types.h" + +#define ENTRY_BOOT 0 +#define ENTRY_VI 1 + +void cheat_apply_cheats(int entry); + +void cheat_init(void); +void cheat_uninit(void); +int cheat_add_new(const char *name, m64p_cheat_code *code_list, int num_codes); +int cheat_set_enabled(const char *name, int enabled); +void cheat_delete_all(void); + +#endif // #define CHEAT_H + + diff --git a/libmupen64plus/mupen64plus-core/src/main/eventloop.c b/libmupen64plus/mupen64plus-core/src/main/eventloop.c new file mode 100644 index 0000000000..e188f1e257 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/eventloop.c @@ -0,0 +1,512 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - eventloop.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2008-2009 Richard Goedeken * + * Copyright (C) 2008 Ebenblues Nmn Okaygo Tillin9 * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#if ! SDL_VERSION_ATLEAST(1,3,0) + +#define SDL_SCANCODE_ESCAPE SDLK_ESCAPE +#define SDL_NUM_SCANCODES SDLK_LAST +#define SDL_SCANCODE_F5 SDLK_F5 +#define SDL_SCANCODE_F7 SDLK_F7 +#define SDL_SCANCODE_F9 SDLK_F9 +#define SDL_SCANCODE_F10 SDLK_F10 +#define SDL_SCANCODE_F11 SDLK_F11 +#define SDL_SCANCODE_F12 SDLK_F12 +#define SDL_SCANCODE_P SDLK_p +#define SDL_SCANCODE_M SDLK_m +#define SDL_SCANCODE_RIGHTBRACKET SDLK_RIGHTBRACKET +#define SDL_SCANCODE_LEFTBRACKET SDLK_LEFTBRACKET +#define SDL_SCANCODE_F SDLK_f +#define SDL_SCANCODE_SLASH SDLK_SLASH +#define SDL_SCANCODE_G SDLK_g +#define SDL_SCANCODE_RETURN SDLK_RETURN +#define SDL_SCANCODE_0 SDLK_0 +#define SDL_SCANCODE_9 SDLK_9 + +#define SDL_SetEventFilter(func, data) SDL_SetEventFilter(func) +#define event_sdl_filter(userdata, event) event_sdl_filter(const event) + +#endif + +#define M64P_CORE_PROTOTYPES 1 +#include "main.h" +#include "eventloop.h" +#include "util.h" +#include "api/callbacks.h" +#include "api/config.h" +#include "api/m64p_config.h" +#include "plugin/plugin.h" +#include "r4300/interupt.h" +#include "r4300/reset.h" + +/* version number for CoreEvents config section */ +#define CONFIG_PARAM_VERSION 1.00 + +static m64p_handle l_CoreEventsConfig = NULL; + +/********************************************************************************************************* +* static variables and definitions for eventloop.c +*/ + +#define kbdFullscreen "Kbd Mapping Fullscreen" +#define kbdStop "Kbd Mapping Stop" +#define kbdPause "Kbd Mapping Pause" +#define kbdSave "Kbd Mapping Save State" +#define kbdLoad "Kbd Mapping Load State" +#define kbdIncrement "Kbd Mapping Increment Slot" +#define kbdReset "Kbd Mapping Reset" +#define kbdSpeeddown "Kbd Mapping Speed Down" +#define kbdSpeedup "Kbd Mapping Speed Up" +#define kbdScreenshot "Kbd Mapping Screenshot" +#define kbdMute "Kbd Mapping Mute" +#define kbdIncrease "Kbd Mapping Increase Volume" +#define kbdDecrease "Kbd Mapping Decrease Volume" +#define kbdForward "Kbd Mapping Fast Forward" +#define kbdAdvance "Kbd Mapping Frame Advance" +#define kbdGameshark "Kbd Mapping Gameshark" + +typedef enum {joyFullscreen, + joyStop, + joyPause, + joySave, + joyLoad, + joyIncrement, + joyScreenshot, + joyMute, + joyIncrease, + joyDecrease, + joyForward, + joyGameshark +} eJoyCommand; + +static const char *JoyCmdName[] = { "Joy Mapping Fullscreen", + "Joy Mapping Stop", + "Joy Mapping Pause", + "Joy Mapping Save State", + "Joy Mapping Load State", + "Joy Mapping Increment Slot", + "Joy Mapping Screenshot", + "Joy Mapping Mute", + "Joy Mapping Increase Volume", + "Joy Mapping Decrease Volume", + "Joy Mapping Fast Forward", + "Joy Mapping Gameshark"}; + +static const int NumJoyCommands = sizeof(JoyCmdName) / sizeof(const char *); + +static int JoyCmdActive[16]; /* if extra joystick commands are added above, make sure there is enough room in this array */ + +static int GamesharkActive = 0; + +/********************************************************************************************************* +* static functions for eventloop.c +*/ + +/** MatchJoyCommand + * This function processes an SDL event and updates the JoyCmdActive array if the + * event matches with the given command. + * + * If the event activates a joystick command which was not previously active, then + * a 1 is returned. If the event de-activates an command, a -1 is returned. Otherwise + * (if the event does not match the command or active status didn't change), a 0 is returned. + */ +static int MatchJoyCommand(const SDL_Event *event, eJoyCommand cmd) +{ + const char *event_str = ConfigGetParamString(l_CoreEventsConfig, JoyCmdName[cmd]); + int dev_number, input_number, input_value; + char axis_direction; + + /* Empty string or non-joystick command */ + if (event_str == NULL || strlen(event_str) < 4 || event_str[0] != 'J') + return 0; + + /* Evaluate event based on type of joystick input expected by the given command */ + switch (event_str[2]) + { + /* Axis */ + case 'A': + if (event->type != SDL_JOYAXISMOTION) + return 0; + if (sscanf(event_str, "J%dA%d%c", &dev_number, &input_number, &axis_direction) != 3) + return 0; + if (dev_number != event->jaxis.which || input_number != event->jaxis.axis) + return 0; + if (axis_direction == '+') + { + if (event->jaxis.value >= 15000 && JoyCmdActive[cmd] == 0) + { + JoyCmdActive[cmd] = 1; + return 1; + } + else if (event->jaxis.value <= 8000 && JoyCmdActive[cmd] == 1) + { + JoyCmdActive[cmd] = 0; + return -1; + } + return 0; + } + else if (axis_direction == '-') + { + if (event->jaxis.value <= -15000 && JoyCmdActive[cmd] == 0) + { + JoyCmdActive[cmd] = 1; + return 1; + } + else if (event->jaxis.value >= -8000 && JoyCmdActive[cmd] == 1) + { + JoyCmdActive[cmd] = 0; + return -1; + } + return 0; + } + else return 0; /* invalid axis direction in configuration parameter */ + break; + /* Hat */ + case 'H': + if (event->type != SDL_JOYHATMOTION) + return 0; + if (sscanf(event_str, "J%dH%dV%d", &dev_number, &input_number, &input_value) != 3) + return 0; + if (dev_number != event->jhat.which || input_number != event->jhat.hat) + return 0; + if ((event->jhat.value & input_value) == input_value && JoyCmdActive[cmd] == 0) + { + JoyCmdActive[cmd] = 1; + return 1; + } + else if ((event->jhat.value & input_value) != input_value && JoyCmdActive[cmd] == 1) + { + JoyCmdActive[cmd] = 0; + return -1; + } + return 0; + break; + /* Button. */ + case 'B': + if (event->type != SDL_JOYBUTTONDOWN && event->type != SDL_JOYBUTTONUP) + return 0; + if (sscanf(event_str, "J%dB%d", &dev_number, &input_number) != 2) + return 0; + if (dev_number != event->jbutton.which || input_number != event->jbutton.button) + return 0; + if (event->type == SDL_JOYBUTTONDOWN && JoyCmdActive[cmd] == 0) + { + JoyCmdActive[cmd] = 1; + return 1; + } + else if (event->type == SDL_JOYBUTTONUP && JoyCmdActive[cmd] == 1) + { + JoyCmdActive[cmd] = 0; + return -1; + } + return 0; + break; + default: + /* bad configuration parameter */ + return 0; + } + + /* impossible to reach this point */ + return 0; +} + +/********************************************************************************************************* +* sdl event filter +*/ +static int SDLCALL event_sdl_filter(void *userdata, SDL_Event *event) +{ + int cmd, action; + + switch(event->type) + { + // user clicked on window close button + case SDL_QUIT: + main_stop(); + break; + + case SDL_KEYDOWN: +#if SDL_VERSION_ATLEAST(1,3,0) + event_sdl_keydown(event->key.keysym.scancode, event->key.keysym.mod); +#else + event_sdl_keydown(event->key.keysym.sym, event->key.keysym.mod); +#endif + return 0; + case SDL_KEYUP: +#if SDL_VERSION_ATLEAST(1,3,0) + event_sdl_keyup(event->key.keysym.scancode, event->key.keysym.mod); +#else + event_sdl_keyup(event->key.keysym.sym, event->key.keysym.mod); +#endif + return 0; + + // if joystick action is detected, check if it's mapped to a special function + case SDL_JOYAXISMOTION: + case SDL_JOYBUTTONDOWN: + case SDL_JOYBUTTONUP: + case SDL_JOYHATMOTION: + for (cmd = 0; cmd < NumJoyCommands; cmd++) + { + action = MatchJoyCommand(event, (eJoyCommand) cmd); + if (action == 1) /* command was just activated (button down, etc) */ + { + if (cmd == joyFullscreen) + gfx.changeWindow(); + else if (cmd == joyStop) + main_stop(); + else if (cmd == joyPause) + main_toggle_pause(); + else if (cmd == joySave) + main_state_save(1, NULL); /* save in mupen64plus format using current slot */ + else if (cmd == joyLoad) + main_state_load(NULL); /* load using current slot */ + else if (cmd == joyIncrement) + main_state_inc_slot(); + else if (cmd == joyScreenshot) + main_take_next_screenshot(); + else if (cmd == joyMute) + main_volume_mute(); + else if (cmd == joyDecrease) + main_volume_down(); + else if (cmd == joyIncrease) + main_volume_up(); + else if (cmd == joyForward) + main_set_fastforward(1); + else if (cmd == joyGameshark) + event_set_gameshark(1); + } + else if (action == -1) /* command was just de-activated (button up, etc) */ + { + if (cmd == joyForward) + main_set_fastforward(0); + else if (cmd == joyGameshark) + event_set_gameshark(0); + } + } + + return 0; + break; + } + + return 1; +} + +/********************************************************************************************************* +* global functions +*/ + +void event_initialize(void) +{ + const char *event_str = NULL; + int i; + + /* set initial state of all joystick commands to 'off' */ + for (i = 0; i < NumJoyCommands; i++) + JoyCmdActive[i] = 0; + + /* activate any joysticks which are referenced in the joystick event command strings */ + for (i = 0; i < NumJoyCommands; i++) + { + event_str = ConfigGetParamString(l_CoreEventsConfig, JoyCmdName[i]); + if (event_str != NULL && strlen(event_str) >= 4 && event_str[0] == 'J' && event_str[1] >= '0' && event_str[1] <= '9') + { + int device = event_str[1] - '0'; + if (!SDL_WasInit(SDL_INIT_JOYSTICK)) + SDL_InitSubSystem(SDL_INIT_JOYSTICK); +#if SDL_VERSION_ATLEAST(2,0,0) +#warning SDL_JoystickOpened unsupported +#else + if (!SDL_JoystickOpened(device)) + SDL_JoystickOpen(device); +#endif + } + } + + /* set up SDL event filter and disable key repeat */ +#if SDL_VERSION_ATLEAST(2,0,0) +#warning SDL_EnableKeyRepeat unsupported +#else + SDL_EnableKeyRepeat(0, 0); +#endif + SDL_SetEventFilter(event_sdl_filter, NULL); +} + +int event_set_core_defaults(void) +{ + float fConfigParamsVersion; + int bSaveConfig = 0; + + if (ConfigOpenSection("CoreEvents", &l_CoreEventsConfig) != M64ERR_SUCCESS || l_CoreEventsConfig == NULL) + { + DebugMessage(M64MSG_ERROR, "Failed to open CoreEvents config section."); + return 0; /* fail */ + } + + if (ConfigGetParameter(l_CoreEventsConfig, "Version", M64TYPE_FLOAT, &fConfigParamsVersion, sizeof(float)) != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_WARNING, "No version number in 'CoreEvents' config section. Setting defaults."); + ConfigDeleteSection("CoreEvents"); + ConfigOpenSection("CoreEvents", &l_CoreEventsConfig); + bSaveConfig = 1; + } + else if (((int) fConfigParamsVersion) != ((int) CONFIG_PARAM_VERSION)) + { + DebugMessage(M64MSG_WARNING, "Incompatible version %.2f in 'CoreEvents' config section: current is %.2f. Setting defaults.", fConfigParamsVersion, (float) CONFIG_PARAM_VERSION); + ConfigDeleteSection("CoreEvents"); + ConfigOpenSection("CoreEvents", &l_CoreEventsConfig); + bSaveConfig = 1; + } + else if ((CONFIG_PARAM_VERSION - fConfigParamsVersion) >= 0.0001f) + { + /* handle upgrades */ + float fVersion = CONFIG_PARAM_VERSION; + ConfigSetParameter(l_CoreEventsConfig, "Version", M64TYPE_FLOAT, &fVersion); + DebugMessage(M64MSG_INFO, "Updating parameter set version in 'CoreEvents' config section to %.2f", fVersion); + bSaveConfig = 1; + } + + ConfigSetDefaultFloat(l_CoreEventsConfig, "Version", CONFIG_PARAM_VERSION, "Mupen64Plus CoreEvents config parameter set version number. Please don't change this version number."); + /* Keyboard presses mapped to core functions */ + ConfigSetDefaultInt(l_CoreEventsConfig, kbdStop, SDL_SCANCODE_ESCAPE, "SDL keysym for stopping the emulator"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdFullscreen, SDL_NUM_SCANCODES, "SDL keysym for switching between fullscreen/windowed modes"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdSave, SDL_SCANCODE_F5, "SDL keysym for saving the emulator state"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdLoad, SDL_SCANCODE_F7, "SDL keysym for loading the emulator state"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdIncrement, 0, "SDL keysym for advancing the save state slot"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdReset, SDL_SCANCODE_F9, "SDL keysym for resetting the emulator"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdSpeeddown, SDL_SCANCODE_F10, "SDL keysym for slowing down the emulator"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdSpeedup, SDL_SCANCODE_F11, "SDL keysym for speeding up the emulator"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdScreenshot, SDL_SCANCODE_F12, "SDL keysym for taking a screenshot"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdPause, SDL_SCANCODE_P, "SDL keysym for pausing the emulator"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdMute, SDL_SCANCODE_M, "SDL keysym for muting/unmuting the sound"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdIncrease, SDL_SCANCODE_RIGHTBRACKET,"SDL keysym for increasing the volume"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdDecrease, SDL_SCANCODE_LEFTBRACKET, "SDL keysym for decreasing the volume"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdForward, SDL_SCANCODE_F, "SDL keysym for temporarily going really fast"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdAdvance, SDL_SCANCODE_SLASH, "SDL keysym for advancing by one frame when paused"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdGameshark, SDL_SCANCODE_G, "SDL keysym for pressing the game shark button"); + /* Joystick events mapped to core functions */ + ConfigSetDefaultString(l_CoreEventsConfig, JoyCmdName[joyStop], "", "Joystick event string for stopping the emulator"); + ConfigSetDefaultString(l_CoreEventsConfig, JoyCmdName[joyFullscreen], "", "Joystick event string for switching between fullscreen/windowed modes"); + ConfigSetDefaultString(l_CoreEventsConfig, JoyCmdName[joySave], "", "Joystick event string for saving the emulator state"); + ConfigSetDefaultString(l_CoreEventsConfig, JoyCmdName[joyLoad], "", "Joystick event string for loading the emulator state"); + ConfigSetDefaultString(l_CoreEventsConfig, JoyCmdName[joyIncrement], "", "Joystick event string for advancing the save state slot"); + ConfigSetDefaultString(l_CoreEventsConfig, JoyCmdName[joyScreenshot], "", "Joystick event string for taking a screenshot"); + ConfigSetDefaultString(l_CoreEventsConfig, JoyCmdName[joyPause], "", "Joystick event string for pausing the emulator"); + ConfigSetDefaultString(l_CoreEventsConfig, JoyCmdName[joyMute], "", "Joystick event string for muting/unmuting the sound"); + ConfigSetDefaultString(l_CoreEventsConfig, JoyCmdName[joyIncrease], "", "Joystick event string for increasing the volume"); + ConfigSetDefaultString(l_CoreEventsConfig, JoyCmdName[joyDecrease], "", "Joystick event string for decreasing the volume"); + ConfigSetDefaultString(l_CoreEventsConfig, JoyCmdName[joyForward], "", "Joystick event string for fast-forward"); + ConfigSetDefaultString(l_CoreEventsConfig, JoyCmdName[joyGameshark], "", "Joystick event string for pressing the game shark button"); + + if (bSaveConfig) + ConfigSaveSection("CoreEvents"); + + return 1; +} + +/********************************************************************************************************* +* sdl keyup/keydown handlers +*/ + +void event_sdl_keydown(int keysym, int keymod) +{ + /* check for the only 2 hard-coded key commands: Alt-enter for fullscreen and 0-9 for save state slot */ + if (keysym == SDL_SCANCODE_RETURN && keymod & (KMOD_LALT | KMOD_RALT)) + gfx.changeWindow(); + else if (keysym >= SDL_SCANCODE_0 && keysym <= SDL_SCANCODE_9) + main_state_set_slot(keysym - SDL_SCANCODE_0); + /* check all of the configurable commands */ + else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdStop)) + main_stop(); + else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdFullscreen)) + gfx.changeWindow(); + else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdSave)) + main_state_save(0, NULL); /* save in mupen64plus format using current slot */ + else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdLoad)) + main_state_load(NULL); /* load using current slot */ + else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdIncrement)) + main_state_inc_slot(); + else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdReset)) + reset_soft(); + else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdSpeeddown)) + main_speeddown(5); + else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdSpeedup)) + main_speedup(5); + else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdScreenshot)) + main_take_next_screenshot(); /* screenshot will be taken at the end of frame rendering */ + else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdPause)) + main_toggle_pause(); + else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdMute)) + main_volume_mute(); + else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdIncrease)) + main_volume_up(); + else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdDecrease)) + main_volume_down(); + else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdForward)) + main_set_fastforward(1); + else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdAdvance)) + main_advance_one(); + else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdGameshark)) + event_set_gameshark(1); + else + { + /* pass all other keypresses to the input plugin */ + input.keyDown(keymod, keysym); + } + +} + +void event_sdl_keyup(int keysym, int keymod) +{ + if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdStop)) + { + return; + } + else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdForward)) + { + main_set_fastforward(0); + } + else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdGameshark)) + { + event_set_gameshark(0); + } + else input.keyUp(keymod, keysym); + +} + +int event_gameshark_active(void) +{ + return GamesharkActive; +} + +void event_set_gameshark(int active) +{ + // if boolean value doesn't change then just return + if (!active == !GamesharkActive) + return; + + // set the button state + GamesharkActive = (active ? 1 : 0); + + // notify front-end application that gameshark button state has changed + StateChanged(M64CORE_INPUT_GAMESHARK, GamesharkActive); +} + diff --git a/libmupen64plus/mupen64plus-core/src/main/eventloop.h b/libmupen64plus/mupen64plus-core/src/main/eventloop.h new file mode 100644 index 0000000000..fa63a7a97c --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/eventloop.h @@ -0,0 +1,34 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - eventloop.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#if !defined(EVENTLOOP_H) +#define EVENTLOOP_H + +extern int event_set_core_defaults(void); +extern void event_initialize(void); +extern void event_sdl_keydown(int keysym, int keymod); +extern void event_sdl_keyup(int keysym, int keymod); +extern int event_gameshark_active(void); +extern void event_set_gameshark(int active); + +#endif /* define(EVENTLOOP_H) */ + + diff --git a/libmupen64plus/mupen64plus-core/src/main/lirc.c b/libmupen64plus/mupen64plus-core/src/main/lirc.c new file mode 100644 index 0000000000..6b392054c9 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/lirc.c @@ -0,0 +1,127 @@ +/*************************************************************************** + lirc.c - handle lirc input events to Mupen64Plus + ------------------- + begin : Friday 11 Jan 2008 + copyright : (C) 2008 by DarkJezter + ***************************************************************************/ + +/*************************************************************************** + * * + * 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. * + * * + ***************************************************************************/ + +// Functions for LIRC support + +#ifdef WITH_LIRC + +#include +#include +#include +#include +#include + +#include "api/m64p_types.h" +#include "api/callbacks.h" +#include "plugin/plugin.h" + +#include "lirc.h" +#include "main.h" +#include "savestates.h" + +static struct lirc_config *g_config; +static int g_lircfd = 0; + +void lircStart(void) +{ + if((g_lircfd = lirc_init("mupen64plus", 1)) != -1) + { + g_config = NULL; + if(lirc_readconfig(NULL, &g_config, NULL) == 0) + DebugMessage(M64MSG_INFO, "LIRC input system started successfully"); + else + DebugMessage(M64MSG_WARNING, "LIRC disabled: Error reading lircrc!"); + } + else + DebugMessage(M64MSG_WARNING, "LIRC disabled: Error contacting daemon!"); +} + +void lircStop(void) +{ + if(g_lircfd!=-1) + { + if(g_config != NULL) + { + lirc_freeconfig(g_config); + g_config = NULL; + } + lirc_deinit(); + DebugMessage(M64MSG_INFO, "LIRC system shut down"); + } +} + +void lircCheckInput(void) +{ + struct pollfd lircpoll; + lircpoll.fd = g_lircfd; + lircpoll.events = POLLIN; + + if(poll(&lircpoll, 1, 0) > 0) + { + char *code; + char *c; + int ret; + + if(lirc_nextcode(&code) == 0 && code != NULL) + { + while((ret = lirc_code2char(g_config, code, &c)) == 0 && c!=NULL) + { + char *c_ind = c; + while(*c_ind != '\0') + { + *c_ind = toupper(*c_ind); + c_ind++; + } + DebugMessage(M64MSG_VERBOSE, "LIRC Execing command \"%s\"", c); + + if(strcmp(c, "SAVE") == 0) + main_state_save(1, NULL); /* save in mupen64plus format using current slot */ + else if(strcmp(c, "LOAD") == 0) + main_state_load(NULL); /* load using current slot */ + else if(strcmp(c, "QUIT") == 0) + main_stop(); + else if(strcmp(c, "FULLSCREEN") == 0) + gfx.changeWindow(); + else if(strcmp(c, "MUTE") == 0) + main_volume_mute(); + else if(strcmp(c, "VOL+") == 0) + main_volume_up(); + else if(strcmp(c, "VOL-") == 0) + main_volume_down(); + else if(strcmp(c, "SCREENSHOT") == 0) + main_take_next_screenshot(); + else if(strcmp(c, "SPEED+") == 0) + main_speedup(5); + else if(strcmp(c, "SPEED-") == 0) + main_speeddown(5); + else if(strcmp(c, "ADVANCE") == 0) + main_advance_one(); + else if(strcmp(c, "PAUSE") == 0) + main_toggle_pause(); + else + { + int val = ((int)c[0])-((int) '0'); + if (val >= 0 && val <= 9) + savestates_select_slot( val ); + } + } + free(code); + } + } +} + +#endif //WITH_LIRC + diff --git a/libmupen64plus/mupen64plus-core/src/main/lirc.h b/libmupen64plus/mupen64plus-core/src/main/lirc.h new file mode 100644 index 0000000000..0974e6a98a --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/lirc.h @@ -0,0 +1,25 @@ +/*************************************************************************** + lirc.h - description + ------------------- + begin : Friday 11 Jan 2008 + copyright : (C) 2008 by DarkJezter + ***************************************************************************/ + +/*************************************************************************** + * * + * 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. * + * * + ***************************************************************************/ + +#ifndef __LIRC_H__ +#define __LIRC_H__ + +extern void lircStart(void); +extern void lircStop(void); +extern void lircCheckInput(void); + +#endif //__LIRC_H__ + diff --git a/libmupen64plus/mupen64plus-core/src/main/list.h b/libmupen64plus/mupen64plus-core/src/main/list.h new file mode 100644 index 0000000000..343892c736 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/list.h @@ -0,0 +1,126 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - util.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2012 Mupen64plus development team * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __LIST_H__ +#define __LIST_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +struct list_head { + struct list_head *prev; + struct list_head *next; +}; + +#define LIST_HEAD(list) \ + struct list_head list = { &(list), &(list) } + +static inline void INIT_LIST_HEAD(struct list_head *head) +{ + head->next = head; + head->prev = head; +} + +static inline void list_add(struct list_head *new_item, struct list_head *head) +{ + struct list_head *next = head->next; + + next->prev = new_item; + new_item->next = next; + new_item->prev = head; + head->next = new_item; +} + +static inline void list_add_tail(struct list_head *new_item, struct list_head *head) +{ + struct list_head *prev = head->prev; + + prev->next = new_item; + new_item->next = head; + new_item->prev = prev; + head->prev = new_item; +} + +static inline void list_del(struct list_head *entry) +{ + struct list_head *next = entry->next; + struct list_head *prev = entry->prev; + + next->prev = prev; + prev->next = next; +} + +static inline void list_del_init(struct list_head *entry) +{ + list_del(entry); + INIT_LIST_HEAD(entry); +} + +static inline int list_empty(const struct list_head *head) +{ + return (head->next == head); +} + +#ifdef __GNUC__ + +#define container_of(ptr, type, member) ({ \ + const typeof( ((type *)0)->member ) *__mptr = (ptr); \ + (type *)( (char *)__mptr - offsetof(type,member) );}) + +#else + +#define container_of(ptr, type, member) \ + ((type *)((char *)(ptr) - offsetof(type, member))) + +#endif + +#define list_entry(ptr, type, member) container_of(ptr, type, member) + +#define list_first_entry(ptr, type, member) \ + list_entry((ptr)->next, type, member) + +#define list_for_each(pos, head) \ + for (pos = (head)->next; pos != (head); pos = pos->next) + +#define list_for_each_entry(pos, head, type, member) \ + for (pos = list_entry((head)->next, type, member); \ + &pos->member != (head); \ + pos = list_entry(pos->member.next, type, member)) + +#define list_for_each_safe(pos, safe, head) \ + for (pos = (head)->next, safe = pos->next; pos != (head); \ + pos = safe, safe = pos->next) + +#define list_for_each_entry_safe(pos, safe, head, type, member) \ + for (pos = list_entry((head)->next, type, member), \ + safe = list_entry(pos->member.next, type, member); \ + &pos->member != (head); \ + pos = safe, \ + safe = list_entry(safe->member.next, type, member)) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/libmupen64plus/mupen64plus-core/src/main/main.c b/libmupen64plus/mupen64plus-core/src/main/main.c new file mode 100644 index 0000000000..215519a333 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/main.c @@ -0,0 +1,859 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - main.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2012 CasualJames * + * Copyright (C) 2008-2009 Richard Goedeken * + * Copyright (C) 2008 Ebenblues Nmn Okaygo Tillin9 * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This is MUPEN64's main entry point. It contains code that is common + * to both the gui and non-gui versions of mupen64. See + * gui subdirectories for the gui-specific code. + * if you want to implement an interface, you should look here + */ + +#include +#include + +#include + +#define M64P_CORE_PROTOTYPES 1 +#include "api/m64p_types.h" +#include "api/callbacks.h" +#include "api/config.h" +#include "api/m64p_config.h" +#include "api/debugger.h" +#include "api/vidext.h" + +#include "main.h" +#include "eventloop.h" +#include "rom.h" +#include "savestates.h" +#include "util.h" + +#include "memory/memory.h" +#include "osal/files.h" +#include "osal/preproc.h" +#include "osd/osd.h" +#include "osd/screenshot.h" +#include "plugin/plugin.h" +#include "r4300/r4300.h" +#include "r4300/interupt.h" +#include "r4300/reset.h" + +#ifdef DBG +#include "debugger/dbg_types.h" +#include "debugger/debugger.h" +#endif + +#ifdef WITH_LIRC +#include "lirc.h" +#endif //WITH_LIRC + +/* version number for Core config section */ +#define CONFIG_PARAM_VERSION 1.01 + +/** globals **/ +m64p_handle g_CoreConfig = NULL; + +m64p_frame_callback g_FrameCallback = NULL; + +int g_MemHasBeenBSwapped = 0; // store byte-swapped flag so we don't swap twice when re-playing game +int g_EmulatorRunning = 0; // need separate boolean to tell if emulator is running, since --nogui doesn't use a thread + +/** static (local) variables **/ +static int l_CurrentFrame = 0; // frame counter +static int l_TakeScreenshot = 0; // Tell OSD Rendering callback to take a screenshot just before drawing the OSD +static int l_SpeedFactor = 100; // percentage of nominal game speed at which emulator is running +static int l_FrameAdvance = 0; // variable to check if we pause on next frame +static int l_MainSpeedLimit = 1; // insert delay during vi_interrupt to keep speed at real-time + +static osd_message_t *l_msgVol = NULL; +static osd_message_t *l_msgFF = NULL; +static osd_message_t *l_msgPause = NULL; + +/********************************************************************************************************* +* static functions +*/ + +static const char *get_savepathdefault(const char *configpath) +{ + static char path[1024]; + + if (!configpath || (strlen(configpath) == 0)) { + snprintf(path, 1024, "%ssave%c", ConfigGetUserDataPath(), OSAL_DIR_SEPARATORS[0]); + path[1023] = 0; + } else { + snprintf(path, 1024, "%s%c", configpath, OSAL_DIR_SEPARATORS[0]); + path[1023] = 0; + } + + /* create directory if it doesn't exist */ + osal_mkdirp(path, 0700); + + return path; +} + + +/********************************************************************************************************* +* helper functions +*/ + + +const char *get_savestatepath(void) +{ + /* try to get the SaveStatePath string variable in the Core configuration section */ + return get_savepathdefault(ConfigGetParamString(g_CoreConfig, "SaveStatePath")); +} + +const char *get_savesrampath(void) +{ + /* try to get the SaveSRAMPath string variable in the Core configuration section */ + return get_savepathdefault(ConfigGetParamString(g_CoreConfig, "SaveSRAMPath")); +} + +void main_message(m64p_msg_level level, unsigned int corner, const char *format, ...) +{ + va_list ap; + char buffer[2049]; + va_start(ap, format); + vsnprintf(buffer, 2047, format, ap); + buffer[2048]='\0'; + va_end(ap); + + /* send message to on-screen-display if enabled */ + if (ConfigGetParamBool(g_CoreConfig, "OnScreenDisplay")) + osd_new_message((enum osd_corner) corner, "%s", buffer); + /* send message to front-end */ + DebugMessage(level, "%s", buffer); +} + + +/********************************************************************************************************* +* global functions, for adjusting the core emulator behavior +*/ + +int main_set_core_defaults(void) +{ + float fConfigParamsVersion; + int bSaveConfig = 0, bUpgrade = 0; + + if (ConfigGetParameter(g_CoreConfig, "Version", M64TYPE_FLOAT, &fConfigParamsVersion, sizeof(float)) != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_WARNING, "No version number in 'Core' config section. Setting defaults."); + ConfigDeleteSection("Core"); + ConfigOpenSection("Core", &g_CoreConfig); + bSaveConfig = 1; + } + else if (((int) fConfigParamsVersion) != ((int) CONFIG_PARAM_VERSION)) + { + DebugMessage(M64MSG_WARNING, "Incompatible version %.2f in 'Core' config section: current is %.2f. Setting defaults.", fConfigParamsVersion, (float) CONFIG_PARAM_VERSION); + ConfigDeleteSection("Core"); + ConfigOpenSection("Core", &g_CoreConfig); + bSaveConfig = 1; + } + else if ((CONFIG_PARAM_VERSION - fConfigParamsVersion) >= 0.0001f) + { + float fVersion = (float) CONFIG_PARAM_VERSION; + ConfigSetParameter(g_CoreConfig, "Version", M64TYPE_FLOAT, &fVersion); + DebugMessage(M64MSG_INFO, "Updating parameter set version in 'Core' config section to %.2f", fVersion); + bUpgrade = 1; + bSaveConfig = 1; + } + + /* parameters controlling the operation of the core */ + ConfigSetDefaultFloat(g_CoreConfig, "Version", (float) CONFIG_PARAM_VERSION, "Mupen64Plus Core config parameter set version number. Please don't change this version number."); + ConfigSetDefaultBool(g_CoreConfig, "OnScreenDisplay", 1, "Draw on-screen display if True, otherwise don't draw OSD"); +#if defined(DYNAREC) + ConfigSetDefaultInt(g_CoreConfig, "R4300Emulator", 2, "Use Pure Interpreter if 0, Cached Interpreter if 1, or Dynamic Recompiler if 2 or more"); +#else + ConfigSetDefaultInt(g_CoreConfig, "R4300Emulator", 1, "Use Pure Interpreter if 0, Cached Interpreter if 1, or Dynamic Recompiler if 2 or more"); +#endif + ConfigSetDefaultBool(g_CoreConfig, "NoCompiledJump", 0, "Disable compiled jump commands in dynamic recompiler (should be set to False) "); + ConfigSetDefaultBool(g_CoreConfig, "DisableExtraMem", 0, "Disable 4MB expansion RAM pack. May be necessary for some games"); + ConfigSetDefaultBool(g_CoreConfig, "AutoStateSlotIncrement", 0, "Increment the save state slot after each save operation"); + ConfigSetDefaultBool(g_CoreConfig, "EnableDebugger", 0, "Activate the R4300 debugger when ROM execution begins, if core was built with Debugger support"); + ConfigSetDefaultInt(g_CoreConfig, "CurrentStateSlot", 0, "Save state slot (0-9) to use when saving/loading the emulator state"); + ConfigSetDefaultString(g_CoreConfig, "ScreenshotPath", "", "Path to directory where screenshots are saved. If this is blank, the default value of ${UserConfigPath}/screenshot will be used"); + ConfigSetDefaultString(g_CoreConfig, "SaveStatePath", "", "Path to directory where emulator save states (snapshots) are saved. If this is blank, the default value of ${UserConfigPath}/save will be used"); + ConfigSetDefaultString(g_CoreConfig, "SaveSRAMPath", "", "Path to directory where SRAM/EEPROM data (in-game saves) are stored. If this is blank, the default value of ${UserConfigPath}/save will be used"); + ConfigSetDefaultString(g_CoreConfig, "SharedDataPath", "", "Path to a directory to search when looking for shared data files"); + + /* handle upgrades */ + if (bUpgrade) + { + if (fConfigParamsVersion < 1.01f) + { // added separate SaveSRAMPath parameter in v1.01 + const char *pccSaveStatePath = ConfigGetParamString(g_CoreConfig, "SaveStatePath"); + if (pccSaveStatePath != NULL) + ConfigSetParameter(g_CoreConfig, "SaveSRAMPath", M64TYPE_STRING, pccSaveStatePath); + } + } + + if (bSaveConfig) + ConfigSaveSection("Core"); + + /* set config parameters for keyboard and joystick commands */ + return event_set_core_defaults(); +} + +void main_speeddown(int percent) +{ + if (l_SpeedFactor - percent > 10) /* 10% minimum speed */ + { + l_SpeedFactor -= percent; + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "%s %d%%", "Playback speed:", l_SpeedFactor); + audio.setSpeedFactor(l_SpeedFactor); + StateChanged(M64CORE_SPEED_FACTOR, l_SpeedFactor); + } +} + +void main_speedup(int percent) +{ + if (l_SpeedFactor + percent < 300) /* 300% maximum speed */ + { + l_SpeedFactor += percent; + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "%s %d%%", "Playback speed:", l_SpeedFactor); + audio.setSpeedFactor(l_SpeedFactor); + StateChanged(M64CORE_SPEED_FACTOR, l_SpeedFactor); + } +} + +static void main_speedset(int percent) +{ + if (percent < 1 || percent > 1000) + { + DebugMessage(M64MSG_WARNING, "Invalid speed setting %i percent", percent); + return; + } + // disable fast-forward if it's enabled + main_set_fastforward(0); + // set speed + l_SpeedFactor = percent; + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "%s %d%%", "Playback speed:", l_SpeedFactor); + audio.setSpeedFactor(l_SpeedFactor); + StateChanged(M64CORE_SPEED_FACTOR, l_SpeedFactor); +} + +void main_set_fastforward(int enable) +{ + static int ff_state = 0; + static int SavedSpeedFactor = 100; + + if (enable && !ff_state) + { + ff_state = 1; /* activate fast-forward */ + SavedSpeedFactor = l_SpeedFactor; + l_SpeedFactor = 250; + audio.setSpeedFactor(l_SpeedFactor); + StateChanged(M64CORE_SPEED_FACTOR, l_SpeedFactor); + // set fast-forward indicator + l_msgFF = osd_new_message(OSD_TOP_RIGHT, "Fast Forward"); + osd_message_set_static(l_msgFF); + osd_message_set_user_managed(l_msgFF); + } + else if (!enable && ff_state) + { + ff_state = 0; /* de-activate fast-forward */ + l_SpeedFactor = SavedSpeedFactor; + audio.setSpeedFactor(l_SpeedFactor); + StateChanged(M64CORE_SPEED_FACTOR, l_SpeedFactor); + // remove message + osd_delete_message(l_msgFF); + l_msgFF = NULL; + } + +} + +static void main_set_speedlimiter(int enable) +{ + l_MainSpeedLimit = enable ? 1 : 0; +} + +static int main_is_paused(void) +{ + return (g_EmulatorRunning && rompause); +} + +void main_toggle_pause(void) +{ + if (!g_EmulatorRunning) + return; + + if (rompause) + { + DebugMessage(M64MSG_STATUS, "Emulation continued."); + if(l_msgPause) + { + osd_delete_message(l_msgPause); + l_msgPause = NULL; + } + StateChanged(M64CORE_EMU_STATE, M64EMU_RUNNING); + } + else + { + if(l_msgPause) + osd_delete_message(l_msgPause); + + DebugMessage(M64MSG_STATUS, "Emulation paused."); + l_msgPause = osd_new_message(OSD_MIDDLE_CENTER, "Paused"); + osd_message_set_static(l_msgPause); + osd_message_set_user_managed(l_msgPause); + StateChanged(M64CORE_EMU_STATE, M64EMU_PAUSED); + } + + rompause = !rompause; + l_FrameAdvance = 0; +} + +void main_advance_one(void) +{ + l_FrameAdvance = 1; + rompause = 0; + StateChanged(M64CORE_EMU_STATE, M64EMU_RUNNING); +} + +static void main_draw_volume_osd(void) +{ + char msgString[64]; + const char *volString; + + // this calls into the audio plugin + volString = audio.volumeGetString(); + if (volString == NULL) + { + strcpy(msgString, "Volume Not Supported."); + } + else + { + sprintf(msgString, "%s: %s", "Volume", volString); + } + + // create a new message or update an existing one + if (l_msgVol != NULL) + osd_update_message(l_msgVol, "%s", msgString); + else { + l_msgVol = osd_new_message(OSD_MIDDLE_CENTER, "%s", msgString); + osd_message_set_user_managed(l_msgVol); + } +} + +/* this function could be called as a result of a keypress, joystick/button movement, + LIRC command, or 'testshots' command-line option timer */ +void main_take_next_screenshot(void) +{ + l_TakeScreenshot = l_CurrentFrame + 1; +} + +void main_state_set_slot(int slot) +{ + if (slot < 0 || slot > 9) + { + DebugMessage(M64MSG_WARNING, "Invalid savestate slot '%i' in main_state_set_slot(). Using 0", slot); + slot = 0; + } + + savestates_select_slot(slot); + StateChanged(M64CORE_SAVESTATE_SLOT, slot); +} + +void main_state_inc_slot(void) +{ + savestates_inc_slot(); +} + +static unsigned char StopRumble[64] = {0x23, 0x01, 0x03, 0xc0, 0x1b, 0x00, 0x00, 0x00, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0}; + +void main_state_load(const char *filename) +{ + input.controllerCommand(0, StopRumble); + input.controllerCommand(1, StopRumble); + input.controllerCommand(2, StopRumble); + input.controllerCommand(3, StopRumble); + + if (filename == NULL) // Save to slot + savestates_set_job(savestates_job_load, savestates_type_m64p, NULL); + else + savestates_set_job(savestates_job_load, savestates_type_unknown, filename); +} + +void main_state_save(int format, const char *filename) +{ + if (filename == NULL) // Save to slot + savestates_set_job(savestates_job_save, savestates_type_m64p, NULL); + else // Save to file + savestates_set_job(savestates_job_save, (savestates_type)format, filename); +} + +m64p_error main_core_state_query(m64p_core_param param, int *rval) +{ + switch (param) + { + case M64CORE_EMU_STATE: + if (!g_EmulatorRunning) + *rval = M64EMU_STOPPED; + else if (rompause) + *rval = M64EMU_PAUSED; + else + *rval = M64EMU_RUNNING; + break; + case M64CORE_VIDEO_MODE: + if (!VidExt_VideoRunning()) + *rval = M64VIDEO_NONE; + else if (VidExt_InFullscreenMode()) + *rval = M64VIDEO_FULLSCREEN; + else + *rval = M64VIDEO_WINDOWED; + break; + case M64CORE_SAVESTATE_SLOT: + *rval = savestates_get_slot(); + break; + case M64CORE_SPEED_FACTOR: + *rval = l_SpeedFactor; + break; + case M64CORE_SPEED_LIMITER: + *rval = l_MainSpeedLimit; + break; + case M64CORE_VIDEO_SIZE: + { + int width, height; + if (!g_EmulatorRunning) + return M64ERR_INVALID_STATE; + main_get_screen_size(&width, &height); + *rval = (width << 16) + height; + break; + } + case M64CORE_AUDIO_VOLUME: + { + if (!g_EmulatorRunning) + return M64ERR_INVALID_STATE; + return main_volume_get_level(rval); + } + case M64CORE_AUDIO_MUTE: + *rval = main_volume_get_muted(); + break; + case M64CORE_INPUT_GAMESHARK: + *rval = event_gameshark_active(); + break; + // these are only used for callbacks; they cannot be queried or set + case M64CORE_STATE_LOADCOMPLETE: + case M64CORE_STATE_SAVECOMPLETE: + return M64ERR_INPUT_INVALID; + default: + return M64ERR_INPUT_INVALID; + } + + return M64ERR_SUCCESS; +} + +m64p_error main_core_state_set(m64p_core_param param, int val) +{ + switch (param) + { + case M64CORE_EMU_STATE: + if (!g_EmulatorRunning) + return M64ERR_INVALID_STATE; + if (val == M64EMU_STOPPED) + { + /* this stop function is asynchronous. The emulator may not terminate until later */ + main_stop(); + return M64ERR_SUCCESS; + } + else if (val == M64EMU_RUNNING) + { + if (main_is_paused()) + main_toggle_pause(); + return M64ERR_SUCCESS; + } + else if (val == M64EMU_PAUSED) + { + if (!main_is_paused()) + main_toggle_pause(); + return M64ERR_SUCCESS; + } + return M64ERR_INPUT_INVALID; + case M64CORE_VIDEO_MODE: + if (!g_EmulatorRunning) + return M64ERR_INVALID_STATE; + if (val == M64VIDEO_WINDOWED) + { + if (VidExt_InFullscreenMode()) + gfx.changeWindow(); + return M64ERR_SUCCESS; + } + else if (val == M64VIDEO_FULLSCREEN) + { + if (!VidExt_InFullscreenMode()) + gfx.changeWindow(); + return M64ERR_SUCCESS; + } + return M64ERR_INPUT_INVALID; + case M64CORE_SAVESTATE_SLOT: + if (val < 0 || val > 9) + return M64ERR_INPUT_INVALID; + savestates_select_slot(val); + return M64ERR_SUCCESS; + case M64CORE_SPEED_FACTOR: + if (!g_EmulatorRunning) + return M64ERR_INVALID_STATE; + main_speedset(val); + return M64ERR_SUCCESS; + case M64CORE_SPEED_LIMITER: + main_set_speedlimiter(val); + return M64ERR_SUCCESS; + case M64CORE_VIDEO_SIZE: + // you cannot force the screen size using this function + return M64ERR_INPUT_INVALID; + case M64CORE_AUDIO_VOLUME: + if (!g_EmulatorRunning) + return M64ERR_INVALID_STATE; + if (val < 0 || val > 100) + return M64ERR_INPUT_INVALID; + return main_volume_set_level(val); + case M64CORE_AUDIO_MUTE: + if ((main_volume_get_muted() && !val) || (!main_volume_get_muted() && val)) + return main_volume_mute(); + return M64ERR_SUCCESS; + case M64CORE_INPUT_GAMESHARK: + if (!g_EmulatorRunning) + return M64ERR_INVALID_STATE; + event_set_gameshark(val); + return M64ERR_SUCCESS; + // these are only used for callbacks; they cannot be queried or set + case M64CORE_STATE_LOADCOMPLETE: + case M64CORE_STATE_SAVECOMPLETE: + return M64ERR_INPUT_INVALID; + default: + return M64ERR_INPUT_INVALID; + } +} + +m64p_error main_get_screen_size(int *width, int *height) +{ + gfx.readScreen(NULL, width, height, 0); + return M64ERR_SUCCESS; +} + +m64p_error main_read_screen(void *pixels, int bFront) +{ + int width_trash, height_trash; + gfx.readScreen(pixels, &width_trash, &height_trash, bFront); + return M64ERR_SUCCESS; +} + +m64p_error main_volume_up(void) +{ + int level = 0; + audio.volumeUp(); + main_draw_volume_osd(); + main_volume_get_level(&level); + StateChanged(M64CORE_AUDIO_VOLUME, level); + return M64ERR_SUCCESS; +} + +m64p_error main_volume_down(void) +{ + int level = 0; + audio.volumeDown(); + main_draw_volume_osd(); + main_volume_get_level(&level); + StateChanged(M64CORE_AUDIO_VOLUME, level); + return M64ERR_SUCCESS; +} + +m64p_error main_volume_get_level(int *level) +{ + *level = audio.volumeGetLevel(); + return M64ERR_SUCCESS; +} + +m64p_error main_volume_set_level(int level) +{ + audio.volumeSetLevel(level); + main_draw_volume_osd(); + level = audio.volumeGetLevel(); + StateChanged(M64CORE_AUDIO_VOLUME, level); + return M64ERR_SUCCESS; +} + +m64p_error main_volume_mute(void) +{ + audio.volumeMute(); + main_draw_volume_osd(); + StateChanged(M64CORE_AUDIO_MUTE, main_volume_get_muted()); + return M64ERR_SUCCESS; +} + +int main_volume_get_muted(void) +{ + return (audio.volumeGetLevel() == 0); +} + +m64p_error main_reset(int do_hard_reset) +{ + if (do_hard_reset) + reset_hard_job |= 1; + else + reset_soft(); + return M64ERR_SUCCESS; +} + +/********************************************************************************************************* +* global functions, callbacks from the r4300 core or from other plugins +*/ + +static void video_plugin_render_callback(int bScreenRedrawn) +{ + int bOSD = ConfigGetParamBool(g_CoreConfig, "OnScreenDisplay"); + + // if the flag is set to take a screenshot, then grab it now + if (l_TakeScreenshot != 0) + { + // if the OSD is enabled, and the screen has not been recently redrawn, then we cannot take a screenshot now because + // it contains the OSD text. Wait until the next redraw + if (!bOSD || bScreenRedrawn) + { + TakeScreenshot(l_TakeScreenshot - 1); // current frame number +1 is in l_TakeScreenshot + l_TakeScreenshot = 0; // reset flag + } + } + + // if the OSD is enabled, then draw it now + if (bOSD) + { + osd_render(); + } +} + +void new_frame(void) +{ + if (g_FrameCallback != NULL) + (*g_FrameCallback)(l_CurrentFrame); + + /* advance the current frame */ + l_CurrentFrame++; + + if (l_FrameAdvance) { + rompause = 1; + l_FrameAdvance = 0; + StateChanged(M64CORE_EMU_STATE, M64EMU_PAUSED); + } +} + +void new_vi(void) +{ + int Dif; + unsigned int CurrentFPSTime; + static unsigned int LastFPSTime = 0; + static unsigned int CounterTime = 0; + static unsigned int CalculatedTime ; + static int VI_Counter = 0; + + double VILimitMilliseconds = 1000.0 / ROM_PARAMS.vilimit; + double AdjustedLimit = VILimitMilliseconds * 100.0 / l_SpeedFactor; // adjust for selected emulator speed + int time; + + start_section(IDLE_SECTION); + VI_Counter++; + +#ifdef DBG + if(g_DebuggerActive) DebuggerCallback(DEBUG_UI_VI, 0); +#endif + + if(LastFPSTime == 0) + { + LastFPSTime = CounterTime = SDL_GetTicks(); + return; + } + CurrentFPSTime = SDL_GetTicks(); + + Dif = CurrentFPSTime - LastFPSTime; + + if (Dif < AdjustedLimit) + { + CalculatedTime = (unsigned int) (CounterTime + AdjustedLimit * VI_Counter); + time = (int)(CalculatedTime - CurrentFPSTime); + if (time > 0 && l_MainSpeedLimit) + { + DebugMessage(M64MSG_VERBOSE, " new_vi(): Waiting %ims", time); + SDL_Delay(time); + } + CurrentFPSTime = CurrentFPSTime + time; + } + + if (CurrentFPSTime - CounterTime >= 1000.0 ) + { + CounterTime = SDL_GetTicks(); + VI_Counter = 0 ; + } + + LastFPSTime = CurrentFPSTime ; + end_section(IDLE_SECTION); +} + +/********************************************************************************************************* +* emulation thread - runs the core +*/ +m64p_error main_run(void) +{ + /* take the r4300 emulator mode from the config file at this point and cache it in a global variable */ + r4300emu = ConfigGetParamInt(g_CoreConfig, "R4300Emulator"); + + /* set some other core parameters based on the config file values */ + savestates_set_autoinc_slot(ConfigGetParamBool(g_CoreConfig, "AutoStateSlotIncrement")); + savestates_select_slot(ConfigGetParamInt(g_CoreConfig, "CurrentStateSlot")); + no_compiled_jump = ConfigGetParamBool(g_CoreConfig, "NoCompiledJump"); + + // initialize memory, and do byte-swapping if it's not been done yet + if (g_MemHasBeenBSwapped == 0) + { + init_memory(1); + g_MemHasBeenBSwapped = 1; + } + else + { + init_memory(0); + } + + // Attach rom to plugins + if (!gfx.romOpen()) + { + free_memory(); return M64ERR_PLUGIN_FAIL; + } + if (!audio.romOpen()) + { + gfx.romClosed(); free_memory(); return M64ERR_PLUGIN_FAIL; + } + if (!input.romOpen()) + { + audio.romClosed(); gfx.romClosed(); free_memory(); return M64ERR_PLUGIN_FAIL; + } + + /* set up the SDL key repeat and event filter to catch keyboard/joystick commands for the core */ + event_initialize(); + + /* initialize the on-screen display */ + if (ConfigGetParamBool(g_CoreConfig, "OnScreenDisplay")) + { + // init on-screen display + int width = 640, height = 480; + gfx.readScreen(NULL, &width, &height, 0); // read screen to get width and height + osd_init(width, height); + } + + // setup rendering callback from video plugin to the core, for screenshots and On-Screen-Display + gfx.setRenderingCallback(video_plugin_render_callback); + +#ifdef WITH_LIRC + lircStart(); +#endif // WITH_LIRC + +#ifdef DBG + if (ConfigGetParamBool(g_CoreConfig, "EnableDebugger")) + init_debugger(); +#endif + + /* Startup message on the OSD */ + osd_new_message(OSD_MIDDLE_CENTER, "Mupen64Plus Started..."); + + g_EmulatorRunning = 1; + StateChanged(M64CORE_EMU_STATE, M64EMU_RUNNING); + + /* call r4300 CPU core and run the game */ + r4300_reset_hard(); + r4300_reset_soft(); + r4300_execute(); + + /* now begin to shut down */ +#ifdef WITH_LIRC + lircStop(); +#endif // WITH_LIRC + +#ifdef DBG + if (g_DebuggerActive) + destroy_debugger(); +#endif + + if (ConfigGetParamBool(g_CoreConfig, "OnScreenDisplay")) + { + osd_exit(); + } + + rsp.romClosed(); + input.romClosed(); + audio.romClosed(); + gfx.romClosed(); + free_memory(); + + // clean up + g_EmulatorRunning = 0; + StateChanged(M64CORE_EMU_STATE, M64EMU_STOPPED); + + return M64ERR_SUCCESS; +} + +void main_stop(void) +{ + /* note: this operation is asynchronous. It may be called from a thread other than the + main emulator thread, and may return before the emulator is completely stopped */ + if (!g_EmulatorRunning) + return; + + DebugMessage(M64MSG_STATUS, "Stopping emulation."); + if(l_msgPause) + { + osd_delete_message(l_msgPause); + l_msgPause = NULL; + } + if(l_msgFF) + { + osd_delete_message(l_msgFF); + l_msgFF = NULL; + } + if(l_msgVol) + { + osd_delete_message(l_msgVol); + l_msgVol = NULL; + } + if (rompause) + { + rompause = 0; + StateChanged(M64CORE_EMU_STATE, M64EMU_RUNNING); + } + stop = 1; +#ifdef DBG + if(g_DebuggerActive) + { + debugger_step(); + } +#endif +} + +/********************************************************************************************************* +* main function +*/ +int main(int argc, char *argv[]) +{ + return 1; +} + diff --git a/libmupen64plus/mupen64plus-core/src/main/main.h b/libmupen64plus/mupen64plus-core/src/main/main.h new file mode 100644 index 0000000000..d034c909e4 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/main.h @@ -0,0 +1,77 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - main.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2012 CasualJames * + * Copyright (C) 2002 Blight * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __MAIN_H__ +#define __MAIN_H__ + +#include "api/m64p_types.h" + +/* globals */ +extern m64p_handle g_CoreConfig; + +extern int g_MemHasBeenBSwapped; +extern int g_EmulatorRunning; + +extern m64p_frame_callback g_FrameCallback; + +const char* get_savestatepath(void); +const char* get_savesrampath(void); + +void new_frame(void); +void new_vi(void); + +int main_set_core_defaults(void); +void main_message(m64p_msg_level level, unsigned int osd_corner, const char *format, ...); + +m64p_error main_run(void); +void main_stop(void); +void main_toggle_pause(void); +void main_advance_one(void); + +void main_speedup(int percent); +void main_speeddown(int percent); +void main_set_fastforward(int enable); + +void main_take_next_screenshot(void); + +void main_state_set_slot(int slot); +void main_state_inc_slot(void); +void main_state_load(const char *filename); +void main_state_save(int format, const char *filename); + +m64p_error main_core_state_query(m64p_core_param param, int *rval); +m64p_error main_core_state_set(m64p_core_param param, int val); + +m64p_error main_get_screen_size(int *width, int *height); +m64p_error main_read_screen(void *pixels, int bFront); + +m64p_error main_volume_up(void); +m64p_error main_volume_down(void); +m64p_error main_volume_get_level(int *level); +m64p_error main_volume_set_level(int level); +m64p_error main_volume_mute(void); +int main_volume_get_muted(void); + +m64p_error main_reset(int do_hard_reset); + +#endif /* __MAIN_H__ */ + diff --git a/libmupen64plus/mupen64plus-core/src/main/md5.c b/libmupen64plus/mupen64plus-core/src/main/md5.c new file mode 100644 index 0000000000..93674e70b1 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/md5.c @@ -0,0 +1,382 @@ +/* + Copyright (C) 1999, 2000, 2002 Aladdin Enterprises. All rights reserved. + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + L. Peter Deutsch + ghost@aladdin.com + + */ +/* $Id: md5.c,v 1.6 2002/04/13 19:20:28 lpd Exp $ */ +/* + Independent implementation of MD5 (RFC 1321). + + This code implements the MD5 Algorithm defined in RFC 1321, whose + text is available at + http://www.ietf.org/rfc/rfc1321.txt + The code is derived from the text of the RFC, including the test suite + (section A.5) but excluding the rest of Appendix A. It does not include + any code or documentation that is identified in the RFC as being + copyrighted. + + The original and principal author of md5.c is L. Peter Deutsch + . Other authors are noted in the change history + that follows (in reverse chronological order): + + 2002-04-13 lpd Clarified derivation from RFC 1321; now handles byte order + either statically or dynamically; added missing #include + in library. + 2002-03-11 lpd Corrected argument list for main(), and added int return + type, in test program and T value program. + 2002-02-21 lpd Added missing #include in test program. + 2000-07-03 lpd Patched to eliminate warnings about "constant is + unsigned in ANSI C, signed in traditional"; made test program + self-checking. + 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. + 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5). + 1999-05-03 lpd Original version. + */ + +#include "md5.h" +#include + +#undef BYTE_ORDER /* 1 = big-endian, -1 = little-endian, 0 = unknown */ +#ifdef ARCH_IS_BIG_ENDIAN +# define BYTE_ORDER (ARCH_IS_BIG_ENDIAN ? 1 : -1) +#else +# define BYTE_ORDER 0 +#endif + +#define T_MASK ((md5_word_t)~0) +#define T1 /* 0xd76aa478 */ (T_MASK ^ 0x28955b87) +#define T2 /* 0xe8c7b756 */ (T_MASK ^ 0x173848a9) +#define T3 0x242070db +#define T4 /* 0xc1bdceee */ (T_MASK ^ 0x3e423111) +#define T5 /* 0xf57c0faf */ (T_MASK ^ 0x0a83f050) +#define T6 0x4787c62a +#define T7 /* 0xa8304613 */ (T_MASK ^ 0x57cfb9ec) +#define T8 /* 0xfd469501 */ (T_MASK ^ 0x02b96afe) +#define T9 0x698098d8 +#define T10 /* 0x8b44f7af */ (T_MASK ^ 0x74bb0850) +#define T11 /* 0xffff5bb1 */ (T_MASK ^ 0x0000a44e) +#define T12 /* 0x895cd7be */ (T_MASK ^ 0x76a32841) +#define T13 0x6b901122 +#define T14 /* 0xfd987193 */ (T_MASK ^ 0x02678e6c) +#define T15 /* 0xa679438e */ (T_MASK ^ 0x5986bc71) +#define T16 0x49b40821 +#define T17 /* 0xf61e2562 */ (T_MASK ^ 0x09e1da9d) +#define T18 /* 0xc040b340 */ (T_MASK ^ 0x3fbf4cbf) +#define T19 0x265e5a51 +#define T20 /* 0xe9b6c7aa */ (T_MASK ^ 0x16493855) +#define T21 /* 0xd62f105d */ (T_MASK ^ 0x29d0efa2) +#define T22 0x02441453 +#define T23 /* 0xd8a1e681 */ (T_MASK ^ 0x275e197e) +#define T24 /* 0xe7d3fbc8 */ (T_MASK ^ 0x182c0437) +#define T25 0x21e1cde6 +#define T26 /* 0xc33707d6 */ (T_MASK ^ 0x3cc8f829) +#define T27 /* 0xf4d50d87 */ (T_MASK ^ 0x0b2af278) +#define T28 0x455a14ed +#define T29 /* 0xa9e3e905 */ (T_MASK ^ 0x561c16fa) +#define T30 /* 0xfcefa3f8 */ (T_MASK ^ 0x03105c07) +#define T31 0x676f02d9 +#define T32 /* 0x8d2a4c8a */ (T_MASK ^ 0x72d5b375) +#define T33 /* 0xfffa3942 */ (T_MASK ^ 0x0005c6bd) +#define T34 /* 0x8771f681 */ (T_MASK ^ 0x788e097e) +#define T35 0x6d9d6122 +#define T36 /* 0xfde5380c */ (T_MASK ^ 0x021ac7f3) +#define T37 /* 0xa4beea44 */ (T_MASK ^ 0x5b4115bb) +#define T38 0x4bdecfa9 +#define T39 /* 0xf6bb4b60 */ (T_MASK ^ 0x0944b49f) +#define T40 /* 0xbebfbc70 */ (T_MASK ^ 0x4140438f) +#define T41 0x289b7ec6 +#define T42 /* 0xeaa127fa */ (T_MASK ^ 0x155ed805) +#define T43 /* 0xd4ef3085 */ (T_MASK ^ 0x2b10cf7a) +#define T44 0x04881d05 +#define T45 /* 0xd9d4d039 */ (T_MASK ^ 0x262b2fc6) +#define T46 /* 0xe6db99e5 */ (T_MASK ^ 0x1924661a) +#define T47 0x1fa27cf8 +#define T48 /* 0xc4ac5665 */ (T_MASK ^ 0x3b53a99a) +#define T49 /* 0xf4292244 */ (T_MASK ^ 0x0bd6ddbb) +#define T50 0x432aff97 +#define T51 /* 0xab9423a7 */ (T_MASK ^ 0x546bdc58) +#define T52 /* 0xfc93a039 */ (T_MASK ^ 0x036c5fc6) +#define T53 0x655b59c3 +#define T54 /* 0x8f0ccc92 */ (T_MASK ^ 0x70f3336d) +#define T55 /* 0xffeff47d */ (T_MASK ^ 0x00100b82) +#define T56 /* 0x85845dd1 */ (T_MASK ^ 0x7a7ba22e) +#define T57 0x6fa87e4f +#define T58 /* 0xfe2ce6e0 */ (T_MASK ^ 0x01d3191f) +#define T59 /* 0xa3014314 */ (T_MASK ^ 0x5cfebceb) +#define T60 0x4e0811a1 +#define T61 /* 0xf7537e82 */ (T_MASK ^ 0x08ac817d) +#define T62 /* 0xbd3af235 */ (T_MASK ^ 0x42c50dca) +#define T63 0x2ad7d2bb +#define T64 /* 0xeb86d391 */ (T_MASK ^ 0x14792c6e) + + +static void +md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/) +{ + md5_word_t + a = pms->abcd[0], b = pms->abcd[1], + c = pms->abcd[2], d = pms->abcd[3]; + md5_word_t t; +#if BYTE_ORDER > 0 + /* Define storage only for big-endian CPUs. */ + md5_word_t X[16]; +#else + /* Define storage for little-endian or both types of CPUs. */ + md5_word_t xbuf[16]; + const md5_word_t *X; +#endif + + { +#if BYTE_ORDER == 0 + /* + * Determine dynamically whether this is a big-endian or + * little-endian machine, since we can use a more efficient + * algorithm on the latter. + */ + static const int w = 1; + + if (*((const md5_byte_t *)&w)) /* dynamic little-endian */ +#endif +#if BYTE_ORDER <= 0 /* little-endian */ + { + /* + * On little-endian machines, we can process properly aligned + * data without copying it. + */ + if (!((data - (const md5_byte_t *)0) & 3)) { + /* data are properly aligned */ + X = (const md5_word_t *)data; + } else { + /* not aligned */ + memcpy(xbuf, data, 64); + X = xbuf; + } + } +#endif +#if BYTE_ORDER == 0 + else /* dynamic big-endian */ +#endif +#if BYTE_ORDER >= 0 /* big-endian */ + { + /* + * On big-endian machines, we must arrange the bytes in the + * right order. + */ + const md5_byte_t *xp = data; + int i; + +# if BYTE_ORDER == 0 + X = xbuf; /* (dynamic only) */ +# else +# define xbuf X /* (static only) */ +# endif + for (i = 0; i < 16; ++i, xp += 4) + xbuf[i] = xp[0] + (xp[1] << 8) + (xp[2] << 16) + (xp[3] << 24); + } +#endif + } + +#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) + + /* Round 1. */ + /* Let [abcd k s i] denote the operation + a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */ +#define F(x, y, z) (((x) & (y)) | (~(x) & (z))) +#define SET(a, b, c, d, k, s, Ti)\ + t = a + F(b,c,d) + X[k] + Ti;\ + a = ROTATE_LEFT(t, s) + b + /* Do the following 16 operations. */ + SET(a, b, c, d, 0, 7, T1); + SET(d, a, b, c, 1, 12, T2); + SET(c, d, a, b, 2, 17, T3); + SET(b, c, d, a, 3, 22, T4); + SET(a, b, c, d, 4, 7, T5); + SET(d, a, b, c, 5, 12, T6); + SET(c, d, a, b, 6, 17, T7); + SET(b, c, d, a, 7, 22, T8); + SET(a, b, c, d, 8, 7, T9); + SET(d, a, b, c, 9, 12, T10); + SET(c, d, a, b, 10, 17, T11); + SET(b, c, d, a, 11, 22, T12); + SET(a, b, c, d, 12, 7, T13); + SET(d, a, b, c, 13, 12, T14); + SET(c, d, a, b, 14, 17, T15); + SET(b, c, d, a, 15, 22, T16); +#undef SET + + /* Round 2. */ + /* Let [abcd k s i] denote the operation + a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */ +#define G(x, y, z) (((x) & (z)) | ((y) & ~(z))) +#define SET(a, b, c, d, k, s, Ti)\ + t = a + G(b,c,d) + X[k] + Ti;\ + a = ROTATE_LEFT(t, s) + b + /* Do the following 16 operations. */ + SET(a, b, c, d, 1, 5, T17); + SET(d, a, b, c, 6, 9, T18); + SET(c, d, a, b, 11, 14, T19); + SET(b, c, d, a, 0, 20, T20); + SET(a, b, c, d, 5, 5, T21); + SET(d, a, b, c, 10, 9, T22); + SET(c, d, a, b, 15, 14, T23); + SET(b, c, d, a, 4, 20, T24); + SET(a, b, c, d, 9, 5, T25); + SET(d, a, b, c, 14, 9, T26); + SET(c, d, a, b, 3, 14, T27); + SET(b, c, d, a, 8, 20, T28); + SET(a, b, c, d, 13, 5, T29); + SET(d, a, b, c, 2, 9, T30); + SET(c, d, a, b, 7, 14, T31); + SET(b, c, d, a, 12, 20, T32); +#undef SET + + /* Round 3. */ + /* Let [abcd k s t] denote the operation + a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */ +#define H(x, y, z) ((x) ^ (y) ^ (z)) +#define SET(a, b, c, d, k, s, Ti)\ + t = a + H(b,c,d) + X[k] + Ti;\ + a = ROTATE_LEFT(t, s) + b + /* Do the following 16 operations. */ + SET(a, b, c, d, 5, 4, T33); + SET(d, a, b, c, 8, 11, T34); + SET(c, d, a, b, 11, 16, T35); + SET(b, c, d, a, 14, 23, T36); + SET(a, b, c, d, 1, 4, T37); + SET(d, a, b, c, 4, 11, T38); + SET(c, d, a, b, 7, 16, T39); + SET(b, c, d, a, 10, 23, T40); + SET(a, b, c, d, 13, 4, T41); + SET(d, a, b, c, 0, 11, T42); + SET(c, d, a, b, 3, 16, T43); + SET(b, c, d, a, 6, 23, T44); + SET(a, b, c, d, 9, 4, T45); + SET(d, a, b, c, 12, 11, T46); + SET(c, d, a, b, 15, 16, T47); + SET(b, c, d, a, 2, 23, T48); +#undef SET + + /* Round 4. */ + /* Let [abcd k s t] denote the operation + a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */ +#define I(x, y, z) ((y) ^ ((x) | ~(z))) +#define SET(a, b, c, d, k, s, Ti)\ + t = a + I(b,c,d) + X[k] + Ti;\ + a = ROTATE_LEFT(t, s) + b + /* Do the following 16 operations. */ + SET(a, b, c, d, 0, 6, T49); + SET(d, a, b, c, 7, 10, T50); + SET(c, d, a, b, 14, 15, T51); + SET(b, c, d, a, 5, 21, T52); + SET(a, b, c, d, 12, 6, T53); + SET(d, a, b, c, 3, 10, T54); + SET(c, d, a, b, 10, 15, T55); + SET(b, c, d, a, 1, 21, T56); + SET(a, b, c, d, 8, 6, T57); + SET(d, a, b, c, 15, 10, T58); + SET(c, d, a, b, 6, 15, T59); + SET(b, c, d, a, 13, 21, T60); + SET(a, b, c, d, 4, 6, T61); + SET(d, a, b, c, 11, 10, T62); + SET(c, d, a, b, 2, 15, T63); + SET(b, c, d, a, 9, 21, T64); +#undef SET + + /* Then perform the following additions. (That is increment each + of the four registers by the value it had before this block + was started.) */ + pms->abcd[0] += a; + pms->abcd[1] += b; + pms->abcd[2] += c; + pms->abcd[3] += d; +} + +void +md5_init(md5_state_t *pms) +{ + pms->count[0] = pms->count[1] = 0; + pms->abcd[0] = 0x67452301; + pms->abcd[1] = /*0xefcdab89*/ T_MASK ^ 0x10325476; + pms->abcd[2] = /*0x98badcfe*/ T_MASK ^ 0x67452301; + pms->abcd[3] = 0x10325476; +} + +void +md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes) +{ + const md5_byte_t *p = data; + int left = nbytes; + int offset = (pms->count[0] >> 3) & 63; + md5_word_t nbits = (md5_word_t)(nbytes << 3); + + if (nbytes <= 0) + return; + + /* Update the message length. */ + pms->count[1] += nbytes >> 29; + pms->count[0] += nbits; + if (pms->count[0] < nbits) + pms->count[1]++; + + /* Process an initial partial block. */ + if (offset) { + int copy = (offset + nbytes > 64 ? 64 - offset : nbytes); + + memcpy(pms->buf + offset, p, copy); + if (offset + copy < 64) + return; + p += copy; + left -= copy; + md5_process(pms, pms->buf); + } + + /* Process full blocks. */ + for (; left >= 64; p += 64, left -= 64) + md5_process(pms, p); + + /* Process a final partial block. */ + if (left) + memcpy(pms->buf, p, left); +} + +void +md5_finish(md5_state_t *pms, md5_byte_t digest[16]) +{ + static const md5_byte_t pad[64] = { + 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; + md5_byte_t data[8]; + int i; + + /* Save the length before padding. */ + for (i = 0; i < 8; ++i) + data[i] = (md5_byte_t)(pms->count[i >> 2] >> ((i & 3) << 3)); + /* Pad to 56 bytes mod 64. */ + md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1); + /* Append the length. */ + md5_append(pms, data, 8); + for (i = 0; i < 16; ++i) + digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3)); +} + diff --git a/libmupen64plus/mupen64plus-core/src/main/md5.h b/libmupen64plus/mupen64plus-core/src/main/md5.h new file mode 100644 index 0000000000..5ddb03729e --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/md5.h @@ -0,0 +1,92 @@ +/* + Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved. + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + L. Peter Deutsch + ghost@aladdin.com + + */ +/* $Id: md5.h,v 1.4 2002/04/13 19:20:28 lpd Exp $ */ +/* + Independent implementation of MD5 (RFC 1321). + + This code implements the MD5 Algorithm defined in RFC 1321, whose + text is available at + http://www.ietf.org/rfc/rfc1321.txt + The code is derived from the text of the RFC, including the test suite + (section A.5) but excluding the rest of Appendix A. It does not include + any code or documentation that is identified in the RFC as being + copyrighted. + + The original and principal author of md5.h is L. Peter Deutsch + . Other authors are noted in the change history + that follows (in reverse chronological order): + + 2002-04-13 lpd Removed support for non-ANSI compilers; removed + references to Ghostscript; clarified derivation from RFC 1321; + now handles byte order either statically or dynamically. + 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. + 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5); + added conditionalization for C++ compilation from Martin + Purschke . + 1999-05-03 lpd Original version. + */ + +#ifndef md5_INCLUDED +# define md5_INCLUDED + +/* + * This package supports both compile-time and run-time determination of CPU + * byte order. If ARCH_IS_BIG_ENDIAN is defined as 0, the code will be + * compiled to run only on little-endian CPUs; if ARCH_IS_BIG_ENDIAN is + * defined as non-zero, the code will be compiled to run only on big-endian + * CPUs; if ARCH_IS_BIG_ENDIAN is not defined, the code will be compiled to + * run on either big- or little-endian CPUs, but will run slightly less + * efficiently on either one than if ARCH_IS_BIG_ENDIAN is defined. + */ + +typedef unsigned char md5_byte_t; /* 8-bit byte */ +typedef unsigned int md5_word_t; /* 32-bit word */ + +/* Define the state of the MD5 Algorithm. */ +typedef struct md5_state_s { + md5_word_t count[2]; /* message length in bits, lsw first */ + md5_word_t abcd[4]; /* digest buffer */ + md5_byte_t buf[64]; /* accumulate block */ +} md5_state_t; + +#ifdef __cplusplus +extern "C" +{ +#endif + +/* Initialize the algorithm. */ +void md5_init(md5_state_t *pms); + +/* Append a string to the message. */ +void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes); + +/* Finish the message and return the digest. */ +void md5_finish(md5_state_t *pms, md5_byte_t digest[16]); + +#ifdef __cplusplus +} /* end extern "C" */ +#endif + +#endif /* md5_INCLUDED */ + diff --git a/libmupen64plus/mupen64plus-core/src/main/rom.c b/libmupen64plus/mupen64plus-core/src/main/rom.c new file mode 100644 index 0000000000..1684cb90e7 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/rom.c @@ -0,0 +1,536 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - rom.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2008 Tillin9 * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include +#include + +#define M64P_CORE_PROTOTYPES 1 +#include "api/m64p_types.h" +#include "api/callbacks.h" +#include "api/config.h" +#include "api/m64p_config.h" + +#include "md5.h" +#include "rom.h" +#include "main.h" +#include "util.h" + +#include "memory/memory.h" +#include "osal/preproc.h" +#include "osd/osd.h" + +#define DEFAULT 16 + +#define CHUNKSIZE 1024*128 /* Read files 128KB at a time. */ + +static romdatabase_entry* ini_search_by_md5(md5_byte_t* md5); + +static _romdatabase g_romdatabase; + +/* Global loaded rom memory space. */ +unsigned char* rom = NULL; +/* Global loaded rom size. */ +int rom_size = 0; + +unsigned char isGoldeneyeRom = 0; + +m64p_rom_header ROM_HEADER; +rom_params ROM_PARAMS; +m64p_rom_settings ROM_SETTINGS; + +static m64p_system_type rom_country_code_to_system_type(char country_code); +static int rom_system_type_to_ai_dac_rate(m64p_system_type system_type); +static int rom_system_type_to_vi_limit(m64p_system_type system_type); + +/* Tests if a file is a valid N64 rom by checking the first 4 bytes. */ +static int is_valid_rom(const unsigned char *buffer) +{ + /* Test if rom is a native .z64 image with header 0x80371240. [ABCD] */ + if((buffer[0]==0x80)&&(buffer[1]==0x37)&&(buffer[2]==0x12)&&(buffer[3]==0x40)) + return 1; + /* Test if rom is a byteswapped .v64 image with header 0x37804012. [BADC] */ + else if((buffer[0]==0x37)&&(buffer[1]==0x80)&&(buffer[2]==0x40)&&(buffer[3]==0x12)) + return 1; + /* Test if rom is a wordswapped .n64 image with header 0x40123780. [DCBA] */ + else if((buffer[0]==0x40)&&(buffer[1]==0x12)&&(buffer[2]==0x37)&&(buffer[3]==0x80)) + return 1; + else + return 0; +} + +/* If rom is a .v64 or .n64 image, byteswap or wordswap loadlength amount of + * rom data to native .z64 before forwarding. Makes sure that data extraction + * and MD5ing routines always deal with a .z64 image. + */ +static void swap_rom(unsigned char* localrom, unsigned char* imagetype, int loadlength) +{ + unsigned char temp; + int i; + + /* Btyeswap if .v64 image. */ + if(localrom[0]==0x37) + { + *imagetype = V64IMAGE; + for (i = 0; i < loadlength; i+=2) + { + temp=localrom[i]; + localrom[i]=localrom[i+1]; + localrom[i+1]=temp; + } + } + /* Wordswap if .n64 image. */ + else if(localrom[0]==0x40) + { + *imagetype = N64IMAGE; + for (i = 0; i < loadlength; i+=4) + { + temp=localrom[i]; + localrom[i]=localrom[i+3]; + localrom[i+3]=temp; + temp=localrom[i+1]; + localrom[i+1]=localrom[i+2]; + localrom[i+2]=temp; + } + } + else + *imagetype = Z64IMAGE; +} + +m64p_error open_rom(const unsigned char* romimage, unsigned int size) +{ + md5_state_t state; + md5_byte_t digest[16]; + romdatabase_entry* entry; + char buffer[256]; + unsigned char imagetype; + int i; + + /* check input requirements */ + if (rom != NULL) + { + DebugMessage(M64MSG_ERROR, "open_rom(): previous ROM image was not freed"); + return M64ERR_INTERNAL; + } + if (romimage == NULL || !is_valid_rom(romimage)) + { + DebugMessage(M64MSG_ERROR, "open_rom(): not a valid ROM image"); + return M64ERR_INPUT_INVALID; + } + + /* Clear Byte-swapped flag, since ROM is now deleted. */ + g_MemHasBeenBSwapped = 0; + /* allocate new buffer for ROM and copy into this buffer */ + rom_size = size; + rom = (unsigned char *) malloc(size); + if (rom == NULL) + return M64ERR_NO_MEMORY; + memcpy(rom, romimage, size); + swap_rom(rom, &imagetype, rom_size); + + memcpy(&ROM_HEADER, rom, sizeof(m64p_rom_header)); + + /* Calculate MD5 hash */ + md5_init(&state); + md5_append(&state, (const md5_byte_t*)rom, rom_size); + md5_finish(&state, digest); + for ( i = 0; i < 16; ++i ) + sprintf(buffer+i*2, "%02X", digest[i]); + buffer[32] = '\0'; + strcpy(ROM_SETTINGS.MD5, buffer); + + /* add some useful properties to ROM_PARAMS */ + ROM_PARAMS.systemtype = rom_country_code_to_system_type(ROM_HEADER.Country_code); + ROM_PARAMS.vilimit = rom_system_type_to_vi_limit(ROM_PARAMS.systemtype); + ROM_PARAMS.aidacrate = rom_system_type_to_ai_dac_rate(ROM_PARAMS.systemtype); + + memcpy(ROM_PARAMS.headername, ROM_HEADER.Name, 20); + ROM_PARAMS.headername[20] = '\0'; + trim(ROM_PARAMS.headername); /* Remove trailing whitespace from ROM name. */ + + /* Look up this ROM in the .ini file and fill in goodname, etc */ + if ((entry=ini_search_by_md5(digest)) != NULL || + (entry=ini_search_by_crc(sl(ROM_HEADER.CRC1),sl(ROM_HEADER.CRC2))) != NULL) + { + strncpy(ROM_SETTINGS.goodname, entry->goodname, 255); + ROM_SETTINGS.goodname[255] = '\0'; + ROM_SETTINGS.savetype = entry->savetype; + ROM_SETTINGS.status = entry->status; + ROM_SETTINGS.players = entry->players; + ROM_SETTINGS.rumble = entry->rumble; + } + else + { + strcpy(ROM_SETTINGS.goodname, ROM_PARAMS.headername); + strcat(ROM_SETTINGS.goodname, " (unknown rom)"); + ROM_SETTINGS.savetype = NONE; + ROM_SETTINGS.status = 0; + ROM_SETTINGS.players = 0; + ROM_SETTINGS.rumble = 0; + } + + /* print out a bunch of info about the ROM */ + DebugMessage(M64MSG_INFO, "Goodname: %s", ROM_SETTINGS.goodname); + DebugMessage(M64MSG_INFO, "Name: %s", ROM_HEADER.Name); + imagestring(imagetype, buffer); + DebugMessage(M64MSG_INFO, "MD5: %s", ROM_SETTINGS.MD5); + DebugMessage(M64MSG_INFO, "CRC: %x %x", sl(ROM_HEADER.CRC1), sl(ROM_HEADER.CRC2)); + DebugMessage(M64MSG_INFO, "Imagetype: %s", buffer); + DebugMessage(M64MSG_INFO, "Rom size: %d bytes (or %d Mb or %d Megabits)", rom_size, rom_size/1024/1024, rom_size/1024/1024*8); + DebugMessage(M64MSG_VERBOSE, "ClockRate = %x", sl(ROM_HEADER.ClockRate)); + DebugMessage(M64MSG_INFO, "Version: %x", sl(ROM_HEADER.Release)); + if(sl(ROM_HEADER.Manufacturer_ID) == 'N') + DebugMessage(M64MSG_INFO, "Manufacturer: Nintendo"); + else + DebugMessage(M64MSG_INFO, "Manufacturer: %x", sl(ROM_HEADER.Manufacturer_ID)); + DebugMessage(M64MSG_VERBOSE, "Cartridge_ID: %x", ROM_HEADER.Cartridge_ID); + countrycodestring(ROM_HEADER.Country_code, buffer); + DebugMessage(M64MSG_INFO, "Country: %s", buffer); + DebugMessage(M64MSG_VERBOSE, "PC = %x", sl((unsigned int)ROM_HEADER.PC)); + DebugMessage(M64MSG_VERBOSE, "Save type: %d", ROM_SETTINGS.savetype); + + //Prepare Hack for GOLDENEYE + isGoldeneyeRom = 0; + if(strcmp(ROM_PARAMS.headername, "GOLDENEYE") == 0) + isGoldeneyeRom = 1; + + return M64ERR_SUCCESS; +} + +m64p_error close_rom(void) +{ + if (rom == NULL) + return M64ERR_INVALID_STATE; + + free(rom); + rom = NULL; + + /* Clear Byte-swapped flag, since ROM is now deleted. */ + g_MemHasBeenBSwapped = 0; + DebugMessage(M64MSG_STATUS, "Rom closed."); + + return M64ERR_SUCCESS; +} + +/********************************************************************************************/ +/* ROM utility functions */ + +// Get the system type associated to a ROM country code. +static m64p_system_type rom_country_code_to_system_type(char country_code) +{ + switch (country_code) + { + // PAL codes + case 0x44: + case 0x46: + case 0x49: + case 0x50: + case 0x53: + case 0x55: + case 0x58: + case 0x59: + return SYSTEM_PAL; + + // NTSC codes + case 0x37: + case 0x41: + case 0x45: + case 0x4a: + default: // Fallback for unknown codes + return SYSTEM_NTSC; + } +} + +// Get the VI (vertical interrupt) limit associated to a ROM system type. +static int rom_system_type_to_vi_limit(m64p_system_type system_type) +{ + switch (system_type) + { + case SYSTEM_PAL: + case SYSTEM_MPAL: + return 50; + + case SYSTEM_NTSC: + default: + return 60; + } +} + +static int rom_system_type_to_ai_dac_rate(m64p_system_type system_type) +{ + switch (system_type) + { + case SYSTEM_PAL: + return 49656530; + case SYSTEM_MPAL: + return 48628316; + case SYSTEM_NTSC: + default: + return 48681812; + } +} + +/********************************************************************************************/ +/* INI Rom database functions */ + +void romdatabase_open(void) +{ + FILE *fPtr; + char buffer[256]; + romdatabase_search* search = NULL; + romdatabase_search** next_search; + + int counter, value, lineno; + unsigned char index; + const char *pathname = ConfigGetSharedDataFilepath("mupen64plus.ini"); + + if(g_romdatabase.have_database) + return; + + /* Open romdatabase. */ + if (pathname == NULL || (fPtr = fopen(pathname, "rb")) == NULL) + { + DebugMessage(M64MSG_ERROR, "Unable to open rom database file '%s'.", pathname); + return; + } + + g_romdatabase.have_database = 1; + + /* Clear premade indices. */ + for(counter = 0; counter < 255; ++counter) + g_romdatabase.crc_lists[counter] = NULL; + for(counter = 0; counter < 255; ++counter) + g_romdatabase.md5_lists[counter] = NULL; + g_romdatabase.list = NULL; + + next_search = &g_romdatabase.list; + + /* Parse ROM database file */ + for (lineno = 1; fgets(buffer, 255, fPtr) != NULL; lineno++) + { + char *line = buffer; + ini_line l = ini_parse_line(&line); + switch (l.type) + { + case INI_SECTION: + { + md5_byte_t md5[16]; + if (!parse_hex(l.name, md5, 16)) + { + DebugMessage(M64MSG_WARNING, "ROM Database: Invalid MD5 on line %i", lineno); + search = NULL; + continue; + } + + *next_search = (romdatabase_search*)malloc(sizeof(romdatabase_search)); + search = *next_search; + next_search = &search->next_entry; + + search->entry.goodname = NULL; + memcpy(search->entry.md5, md5, 16); + search->entry.refmd5 = NULL; + search->entry.crc1 = 0; + search->entry.crc2 = 0; + search->entry.status = 0; /* Set default to 0 stars. */ + search->entry.savetype = DEFAULT; + search->entry.players = DEFAULT; + search->entry.rumble = DEFAULT; + + search->next_entry = NULL; + search->next_crc = NULL; + /* Index MD5s by first 8 bits. */ + index = search->entry.md5[0]; + search->next_md5 = g_romdatabase.md5_lists[index]; + g_romdatabase.md5_lists[index] = search; + + break; + } + case INI_PROPERTY: + // This happens if there's stray properties before any section, + // or if some error happened on INI_SECTION (e.g. parsing). + if (search == NULL) + { + DebugMessage(M64MSG_WARNING, "ROM Database: Ignoring property on line %i", lineno); + continue; + } + if(!strcmp(l.name, "GoodName")) + { + search->entry.goodname = strdup(l.value); + } + else if(!strcmp(l.name, "CRC")) + { + char garbage_sweeper; + if (sscanf(l.value, "%X %X%c", &search->entry.crc1, + &search->entry.crc2, &garbage_sweeper) == 2) + { + /* Index CRCs by first 8 bits. */ + index = search->entry.crc1 >> 24; + search->next_crc = g_romdatabase.crc_lists[index]; + g_romdatabase.crc_lists[index] = search; + } + else + { + search->entry.crc1 = search->entry.crc2 = 0; + DebugMessage(M64MSG_WARNING, "ROM Database: Invalid CRC on line %i", lineno); + } + } + else if(!strcmp(l.name, "RefMD5")) + { + md5_byte_t md5[16]; + if (parse_hex(l.value, md5, 16)) + { + search->entry.refmd5 = (md5_byte_t*)malloc(16*sizeof(md5_byte_t)); + memcpy(search->entry.refmd5, md5, 16); + } + else + DebugMessage(M64MSG_WARNING, "ROM Database: Invalid RefMD5 on line %i", lineno); + } + else if(!strcmp(l.name, "SaveType")) + { + if(!strcmp(l.value, "Eeprom 4KB")) + search->entry.savetype = EEPROM_4KB; + else if(!strcmp(l.value, "Eeprom 16KB")) + search->entry.savetype = EEPROM_16KB; + else if(!strcmp(l.value, "SRAM")) + search->entry.savetype = SRAM; + else if(!strcmp(l.value, "Flash RAM")) + search->entry.savetype = FLASH_RAM; + else if(!strcmp(l.value, "Controller Pack")) + search->entry.savetype = CONTROLLER_PACK; + else if(!strcmp(l.value, "None")) + search->entry.savetype = NONE; + else + DebugMessage(M64MSG_WARNING, "ROM Database: Invalid save type on line %i", lineno); + } + else if(!strcmp(l.name, "Status")) + { + if (string_to_int(l.value, &value) && value >= 0 && value < 6) + search->entry.status = value; + else + DebugMessage(M64MSG_WARNING, "ROM Database: Invalid status on line %i", lineno); + } + else if(!strcmp(l.name, "Players")) + { + if (string_to_int(l.value, &value) && value >= 0 && value < 8) + search->entry.players = value; + else + DebugMessage(M64MSG_WARNING, "ROM Database: Invalid player count on line %i", lineno); + } + else if(!strcmp(l.name, "Rumble")) + { + if(!strcmp(l.value, "Yes")) + search->entry.rumble = 1; + else if(!strcmp(l.value, "No")) + search->entry.rumble = 0; + else + DebugMessage(M64MSG_WARNING, "ROM Database: Invalid rumble string on line %i", lineno); + } + else + { + DebugMessage(M64MSG_WARNING, "ROM Database: Unknown property on line %i", lineno); + } + break; + default: + break; + } + } + + fclose(fPtr); + + /* Resolve RefMD5 references */ + for (search = g_romdatabase.list; search != NULL; search = search->next_entry) + { + if (search->entry.refmd5 != NULL) + { + romdatabase_entry *ref = ini_search_by_md5(search->entry.refmd5); + if (ref != NULL) + { + if(ref->savetype!=DEFAULT) + search->entry.savetype = ref->savetype; + if(ref->status!=0) + search->entry.status = ref->status; + if(ref->players!=DEFAULT) + search->entry.players = ref->players; + if(ref->rumble!=DEFAULT) + search->entry.rumble = ref->rumble; + } + else + DebugMessage(M64MSG_WARNING, "ROM Database: Error solving RefMD5s"); + } + } +} + +void romdatabase_close(void) +{ + if (!g_romdatabase.have_database) + return; + + while (g_romdatabase.list != NULL) + { + romdatabase_search* search = g_romdatabase.list->next_entry; + if(g_romdatabase.list->entry.goodname) + free(g_romdatabase.list->entry.goodname); + if(g_romdatabase.list->entry.refmd5) + free(g_romdatabase.list->entry.refmd5); + free(g_romdatabase.list); + g_romdatabase.list = search; + } +} + +static romdatabase_entry* ini_search_by_md5(md5_byte_t* md5) +{ + romdatabase_search* search; + + if(!g_romdatabase.have_database) + return NULL; + + search = g_romdatabase.md5_lists[md5[0]]; + + while (search != NULL && memcmp(search->entry.md5, md5, 16) != 0) + search = search->next_md5; + + if(search==NULL) + return NULL; + + return &(search->entry); +} + +romdatabase_entry* ini_search_by_crc(unsigned int crc1, unsigned int crc2) +{ + romdatabase_search* search; + + if(!g_romdatabase.have_database) + return NULL; + + search = g_romdatabase.crc_lists[((crc1 >> 24) & 0xff)]; + + while (search != NULL && search->entry.crc1 != crc1 && search->entry.crc2 != crc2) + search = search->next_crc; + + if(search == NULL) + return NULL; + + return &(search->entry); +} + + diff --git a/libmupen64plus/mupen64plus-core/src/main/rom.h b/libmupen64plus/mupen64plus-core/src/main/rom.h new file mode 100644 index 0000000000..5b91ace727 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/rom.h @@ -0,0 +1,140 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - rom.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2008 Tillin9 * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __ROM_H__ +#define __ROM_H__ + +#include "api/m64p_types.h" +#include "md5.h" + +/* ROM Loading and Saving functions */ + +m64p_error open_rom(const unsigned char* romimage, unsigned int size); +m64p_error close_rom(void); + +extern unsigned char* rom; +extern int rom_size; + +extern unsigned char isGoldeneyeRom; + +typedef struct _rom_params +{ + m64p_system_type systemtype; + int vilimit; + int aidacrate; + char headername[21]; /* ROM Name as in the header, removing trailing whitespace */ +} rom_params; + +extern m64p_rom_header ROM_HEADER; +extern rom_params ROM_PARAMS; +extern m64p_rom_settings ROM_SETTINGS; + +/* Supported rom compressiontypes. */ +enum +{ + UNCOMPRESSED, + ZIP_COMPRESSION, + GZIP_COMPRESSION, + BZIP2_COMPRESSION, + LZMA_COMPRESSION, + SZIP_COMPRESSION +}; + +/* Supported rom image types. */ +enum +{ + Z64IMAGE, + V64IMAGE, + N64IMAGE +}; + +/* Supported CIC chips. */ +enum +{ + CIC_NUS_6101, + CIC_NUS_6102, + CIC_NUS_6103, + CIC_NUS_6105, + CIC_NUS_6106 +}; + +/* Supported save types. */ +enum +{ + EEPROM_4KB, + EEPROM_16KB, + SRAM, + FLASH_RAM, + CONTROLLER_PACK, + NONE +}; + +/* Rom INI database structures and functions */ + +/* The romdatabase contains the items mupen64plus indexes for each rom. These + * include the goodname (from the GoodN64 project), the current status of the rom + * in mupen, the N64 savetype used in the original cartridge (often necessary for + * booting the rom in mupen), the number of players (including netplay options), + * and whether the rom can make use of the N64's rumble feature. Md5, crc1, and + * crc2 used for rom lookup. Md5s are unique hashes of the ENTIRE rom. Crcs are not + * unique and read from the rom header, meaning corrupt crcs are also a problem. + * Crcs were widely used (mainly in the cheat system). Refmd5s allows for a smaller + * database file and need not be used outside database loading. + */ +typedef struct +{ + char* goodname; + md5_byte_t md5[16]; + md5_byte_t* refmd5; + unsigned int crc1; + unsigned int crc2; + unsigned char status; /* Rom status on a scale from 0-5. */ + unsigned char savetype; + unsigned char players; /* Local players 0-4, 2/3/4 way Netplay indicated by 5/6/7. */ + unsigned char rumble; /* 0 - No, 1 - Yes boolean for rumble support. */ +} romdatabase_entry; + +typedef struct _romdatabase_search +{ + romdatabase_entry entry; + struct _romdatabase_search* next_entry; + struct _romdatabase_search* next_crc; + struct _romdatabase_search* next_md5; +} romdatabase_search; + +typedef struct +{ + int have_database; + romdatabase_search* crc_lists[256]; + romdatabase_search* md5_lists[256]; + romdatabase_search* list; +} _romdatabase; + +void romdatabase_open(void); +void romdatabase_close(void); +/* Should be used by current cheat system (isn't), when cheat system is + * migrated to md5s, will be fully depreciated. + */ +romdatabase_entry* ini_search_by_crc(unsigned int crc1, unsigned int crc2); + +#endif /* __ROM_H__ */ + diff --git a/libmupen64plus/mupen64plus-core/src/main/savestates.c b/libmupen64plus/mupen64plus-core/src/main/savestates.c new file mode 100644 index 0000000000..ff03f99ce5 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/savestates.c @@ -0,0 +1,1534 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - savestates.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2012 CasualJames * + * Copyright (C) 2009 Olejl Tillin9 * + * Copyright (C) 2008 Richard42 Tillin9 * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include + +#define M64P_CORE_PROTOTYPES 1 +#include "api/m64p_types.h" +#include "api/callbacks.h" +#include "api/m64p_config.h" +#include "api/config.h" + +#include "savestates.h" +#include "main.h" +#include "rom.h" +#include "util.h" +#include "workqueue.h" + +#include "memory/memory.h" +#include "memory/flashram.h" +#include "memory/tlb.h" +#include "r4300/macros.h" +#include "r4300/r4300.h" +#include "r4300/interupt.h" +#include "osal/preproc.h" +#include "osd/osd.h" +#include "r4300/new_dynarec/new_dynarec.h" + +#ifdef LIBMINIZIP + #include + #include +#else + #include "main/zip/unzip.h" + #include "main/zip/zip.h" +#endif + +static const char* savestate_magic = "M64+SAVE"; +static const int savestate_latest_version = 0x00010000; /* 1.0 */ +static const unsigned char pj64_magic[4] = { 0xC8, 0xA6, 0xD8, 0x23 }; + +static savestates_job job = savestates_job_nothing; +static savestates_type type = savestates_type_unknown; +static char *fname = NULL; + +static unsigned int slot = 0; +static int autoinc_save_slot = 0; + +static SDL_mutex *savestates_lock; + +struct savestate_work { + char *filepath; + char *data; + size_t size; + struct work_struct work; +}; + +/* Returns the malloc'd full path of the currently selected savestate. */ +static char *savestates_generate_path(savestates_type type) +{ + if(fname != NULL) /* A specific path was given. */ + { + return strdup(fname); + } + else /* Use the selected savestate slot */ + { + char *filename; + switch (type) + { + case savestates_type_m64p: + filename = formatstr("%s.st%d", ROM_SETTINGS.goodname, slot); + break; + case savestates_type_pj64_zip: + filename = formatstr("%s.pj%d.zip", ROM_PARAMS.headername, slot); + break; + case savestates_type_pj64_unc: + filename = formatstr("%s.pj%d", ROM_PARAMS.headername, slot); + break; + default: + filename = NULL; + break; + } + + if (filename != NULL) + { + char *filepath = formatstr("%s%s", get_savestatepath(), filename); + free(filename); + return filepath; + } + else + return NULL; + } +} + +void savestates_select_slot(unsigned int s) +{ + if(s>9||s==slot) + return; + slot = s; + ConfigSetParameter(g_CoreConfig, "CurrentSaveSlot", M64TYPE_INT, &s); + StateChanged(M64CORE_SAVESTATE_SLOT, slot); + + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Selected state slot: %d", slot); +} + +/* Returns the currently selected save slot. */ +unsigned int savestates_get_slot(void) +{ + return slot; +} + +/* Sets save state slot autoincrement on or off. */ +void savestates_set_autoinc_slot(int b) +{ + autoinc_save_slot = b; +} + +void savestates_inc_slot(void) +{ + if(++slot>9) + slot = 0; + StateChanged(M64CORE_SAVESTATE_SLOT, slot); +} + +savestates_job savestates_get_job(void) +{ + return job; +} + +void savestates_set_job(savestates_job j, savestates_type t, const char *fn) +{ + if (fname != NULL) + { + free(fname); + fname = NULL; + } + + job = j; + type = t; + if (fn != NULL) + fname = strdup(fn); +} + +static void savestates_clear_job(void) +{ + savestates_set_job(savestates_job_nothing, savestates_type_unknown, NULL); +} + +#define GETARRAY(buff, type, count) \ + (to_little_endian_buffer(buff, sizeof(type),count), \ + buff += count*sizeof(type), \ + (type *)(buff-count*sizeof(type))) +#define COPYARRAY(dst, buff, type, count) \ + memcpy(dst, GETARRAY(buff, type, count), sizeof(type)*count) +#define GETDATA(buff, type) *GETARRAY(buff, type, 1) + +#define PUTARRAY(src, buff, type, count) \ + memcpy(buff, src, sizeof(type)*count); \ + to_little_endian_buffer(buff, sizeof(type), count); \ + buff += count*sizeof(type); + +#define PUTDATA(buff, type, value) \ + do { type x = value; PUTARRAY(&x, buff, type, 1); } while(0) + +static int savestates_load_m64p(char *filepath) +{ + unsigned char header[44]; + gzFile f; + int version; + int i; + + size_t savestateSize; + unsigned char *savestateData, *curr; + char queue[1024]; + + SDL_LockMutex(savestates_lock); + + f = gzopen(filepath, "rb"); + if(f==NULL) + { + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Could not open state file: %s", filepath); + SDL_UnlockMutex(savestates_lock); + return 0; + } + + /* Read and check Mupen64Plus magic number. */ + if (gzread(f, header, 44) != 44) + { + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Could not read header from state file %s", filepath); + gzclose(f); + SDL_UnlockMutex(savestates_lock); + return 0; + } + curr = header; + + if(strncmp((char *)curr, savestate_magic, 8)!=0) + { + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "State file: %s is not a valid Mupen64plus savestate.", filepath); + gzclose(f); + SDL_UnlockMutex(savestates_lock); + return 0; + } + curr += 8; + + version = *curr++; + version = (version << 8) | *curr++; + version = (version << 8) | *curr++; + version = (version << 8) | *curr++; + if(version != 0x00010000) + { + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "State version (%08x) isn't compatible. Please update Mupen64Plus.", version); + gzclose(f); + SDL_UnlockMutex(savestates_lock); + return 0; + } + + if(memcmp((char *)curr, ROM_SETTINGS.MD5, 32)) + { + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "State ROM MD5 does not match current ROM."); + gzclose(f); + SDL_UnlockMutex(savestates_lock); + return 0; + } + curr += 32; + + /* Read the rest of the savestate */ + savestateSize = 16788244; + savestateData = curr = (unsigned char *)malloc(savestateSize); + if (savestateData == NULL) + { + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Insufficient memory to load state."); + gzclose(f); + SDL_UnlockMutex(savestates_lock); + return 0; + } + if (gzread(f, savestateData, savestateSize) != savestateSize || + (gzread(f, queue, sizeof(queue)) % 4) != 0) + { + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Could not read Mupen64Plus savestate data from %s", filepath); + free(savestateData); + gzclose(f); + SDL_UnlockMutex(savestates_lock); + return 0; + } + + gzclose(f); + SDL_UnlockMutex(savestates_lock); + + // Parse savestate + rdram_register.rdram_config = GETDATA(curr, unsigned int); + rdram_register.rdram_device_id = GETDATA(curr, unsigned int); + rdram_register.rdram_delay = GETDATA(curr, unsigned int); + rdram_register.rdram_mode = GETDATA(curr, unsigned int); + rdram_register.rdram_ref_interval = GETDATA(curr, unsigned int); + rdram_register.rdram_ref_row = GETDATA(curr, unsigned int); + rdram_register.rdram_ras_interval = GETDATA(curr, unsigned int); + rdram_register.rdram_min_interval = GETDATA(curr, unsigned int); + rdram_register.rdram_addr_select = GETDATA(curr, unsigned int); + rdram_register.rdram_device_manuf = GETDATA(curr, unsigned int); + + MI_register.w_mi_init_mode_reg = GETDATA(curr, unsigned int); + MI_register.mi_init_mode_reg = GETDATA(curr, unsigned int); + curr += 4; // Duplicate MI init mode flags from old implementation + MI_register.mi_version_reg = GETDATA(curr, unsigned int); + MI_register.mi_intr_reg = GETDATA(curr, unsigned int); + MI_register.mi_intr_mask_reg = GETDATA(curr, unsigned int); + MI_register.w_mi_intr_mask_reg = GETDATA(curr, unsigned int); + curr += 8; // Duplicated MI intr flags and padding from old implementation + + pi_register.pi_dram_addr_reg = GETDATA(curr, unsigned int); + pi_register.pi_cart_addr_reg = GETDATA(curr, unsigned int); + pi_register.pi_rd_len_reg = GETDATA(curr, unsigned int); + pi_register.pi_wr_len_reg = GETDATA(curr, unsigned int); + pi_register.read_pi_status_reg = GETDATA(curr, unsigned int); + pi_register.pi_bsd_dom1_lat_reg = GETDATA(curr, unsigned int); + pi_register.pi_bsd_dom1_pwd_reg = GETDATA(curr, unsigned int); + pi_register.pi_bsd_dom1_pgs_reg = GETDATA(curr, unsigned int); + pi_register.pi_bsd_dom1_rls_reg = GETDATA(curr, unsigned int); + pi_register.pi_bsd_dom2_lat_reg = GETDATA(curr, unsigned int); + pi_register.pi_bsd_dom2_pwd_reg = GETDATA(curr, unsigned int); + pi_register.pi_bsd_dom2_pgs_reg = GETDATA(curr, unsigned int); + pi_register.pi_bsd_dom2_rls_reg = GETDATA(curr, unsigned int); + + sp_register.sp_mem_addr_reg = GETDATA(curr, unsigned int); + sp_register.sp_dram_addr_reg = GETDATA(curr, unsigned int); + sp_register.sp_rd_len_reg = GETDATA(curr, unsigned int); + sp_register.sp_wr_len_reg = GETDATA(curr, unsigned int); + sp_register.w_sp_status_reg = GETDATA(curr, unsigned int); + sp_register.sp_status_reg = GETDATA(curr, unsigned int); + curr += 16; // Duplicated SP flags and padding from old implementation + sp_register.sp_dma_full_reg = GETDATA(curr, unsigned int); + sp_register.sp_dma_busy_reg = GETDATA(curr, unsigned int); + sp_register.sp_semaphore_reg = GETDATA(curr, unsigned int); + + rsp_register.rsp_pc = GETDATA(curr, unsigned int); + rsp_register.rsp_ibist = GETDATA(curr, unsigned int); + + si_register.si_dram_addr = GETDATA(curr, unsigned int); + si_register.si_pif_addr_rd64b = GETDATA(curr, unsigned int); + si_register.si_pif_addr_wr64b = GETDATA(curr, unsigned int); + si_register.si_stat = GETDATA(curr, unsigned int); + + vi_register.vi_status = GETDATA(curr, unsigned int); + vi_register.vi_origin = GETDATA(curr, unsigned int); + vi_register.vi_width = GETDATA(curr, unsigned int); + vi_register.vi_v_intr = GETDATA(curr, unsigned int); + vi_register.vi_current = GETDATA(curr, unsigned int); + vi_register.vi_burst = GETDATA(curr, unsigned int); + vi_register.vi_v_sync = GETDATA(curr, unsigned int); + vi_register.vi_h_sync = GETDATA(curr, unsigned int); + vi_register.vi_leap = GETDATA(curr, unsigned int); + vi_register.vi_h_start = GETDATA(curr, unsigned int); + vi_register.vi_v_start = GETDATA(curr, unsigned int); + vi_register.vi_v_burst = GETDATA(curr, unsigned int); + vi_register.vi_x_scale = GETDATA(curr, unsigned int); + vi_register.vi_y_scale = GETDATA(curr, unsigned int); + vi_register.vi_delay = GETDATA(curr, unsigned int); + update_vi_status(vi_register.vi_status); + update_vi_width(vi_register.vi_width); + + ri_register.ri_mode = GETDATA(curr, unsigned int); + ri_register.ri_config = GETDATA(curr, unsigned int); + ri_register.ri_current_load = GETDATA(curr, unsigned int); + ri_register.ri_select = GETDATA(curr, unsigned int); + ri_register.ri_refresh = GETDATA(curr, unsigned int); + ri_register.ri_latency = GETDATA(curr, unsigned int); + ri_register.ri_error = GETDATA(curr, unsigned int); + ri_register.ri_werror = GETDATA(curr, unsigned int); + + ai_register.ai_dram_addr = GETDATA(curr, unsigned int); + ai_register.ai_len = GETDATA(curr, unsigned int); + ai_register.ai_control = GETDATA(curr, unsigned int); + ai_register.ai_status = GETDATA(curr, unsigned int); + ai_register.ai_dacrate = GETDATA(curr, unsigned int); + ai_register.ai_bitrate = GETDATA(curr, unsigned int); + ai_register.next_delay = GETDATA(curr, unsigned int); + ai_register.next_len = GETDATA(curr, unsigned int); + ai_register.current_delay = GETDATA(curr, unsigned int); + ai_register.current_len = GETDATA(curr, unsigned int); + update_ai_dacrate(ai_register.ai_dacrate); + + dpc_register.dpc_start = GETDATA(curr, unsigned int); + dpc_register.dpc_end = GETDATA(curr, unsigned int); + dpc_register.dpc_current = GETDATA(curr, unsigned int); + dpc_register.w_dpc_status = GETDATA(curr, unsigned int); + dpc_register.dpc_status = GETDATA(curr, unsigned int); + curr += 12; // Duplicated DPC flags and padding from old implementation + dpc_register.dpc_clock = GETDATA(curr, unsigned int); + dpc_register.dpc_bufbusy = GETDATA(curr, unsigned int); + dpc_register.dpc_pipebusy = GETDATA(curr, unsigned int); + dpc_register.dpc_tmem = GETDATA(curr, unsigned int); + + dps_register.dps_tbist = GETDATA(curr, unsigned int); + dps_register.dps_test_mode = GETDATA(curr, unsigned int); + dps_register.dps_buftest_addr = GETDATA(curr, unsigned int); + dps_register.dps_buftest_data = GETDATA(curr, unsigned int); + + COPYARRAY(rdram, curr, unsigned int, 0x800000/4); + COPYARRAY(SP_DMEM, curr, unsigned int, 0x1000/4); + COPYARRAY(SP_IMEM, curr, unsigned int, 0x1000/4); + COPYARRAY(PIF_RAM, curr, unsigned char, 0x40); + + flashram_info.use_flashram = GETDATA(curr, int); + flashram_info.mode = GETDATA(curr, int); + flashram_info.status = GETDATA(curr, unsigned long long); + flashram_info.erase_offset = GETDATA(curr, unsigned int); + flashram_info.write_pointer = GETDATA(curr, unsigned int); + + COPYARRAY(tlb_LUT_r, curr, unsigned int, 0x100000); + COPYARRAY(tlb_LUT_w, curr, unsigned int, 0x100000); + + llbit = GETDATA(curr, unsigned int); + COPYARRAY(reg, curr, long long int, 32); + COPYARRAY(reg_cop0, curr, unsigned int, 32); + set_fpr_pointers(Status); // Status is reg_cop0[12] + lo = GETDATA(curr, long long int); + hi = GETDATA(curr, long long int); + COPYARRAY(reg_cop1_fgr_64, curr, long long int, 32); + if ((Status & 0x04000000) == 0) // 32-bit FPR mode requires data shuffling because 64-bit layout is always stored in savestate file + shuffle_fpr_data(0x04000000, 0); + FCR0 = GETDATA(curr, int); + FCR31 = GETDATA(curr, int); + + for (i = 0; i < 32; i++) + { + tlb_e[i].mask = GETDATA(curr, short); + curr += 2; + tlb_e[i].vpn2 = GETDATA(curr, int); + tlb_e[i].g = GETDATA(curr, char); + tlb_e[i].asid = GETDATA(curr, unsigned char); + curr += 2; + tlb_e[i].pfn_even = GETDATA(curr, int); + tlb_e[i].c_even = GETDATA(curr, char); + tlb_e[i].d_even = GETDATA(curr, char); + tlb_e[i].v_even = GETDATA(curr, char); + curr++; + tlb_e[i].pfn_odd = GETDATA(curr, int); + tlb_e[i].c_odd = GETDATA(curr, char); + tlb_e[i].d_odd = GETDATA(curr, char); + tlb_e[i].v_odd = GETDATA(curr, char); + tlb_e[i].r = GETDATA(curr, char); + + tlb_e[i].start_even = GETDATA(curr, unsigned int); + tlb_e[i].end_even = GETDATA(curr, unsigned int); + tlb_e[i].phys_even = GETDATA(curr, unsigned int); + tlb_e[i].start_odd = GETDATA(curr, unsigned int); + tlb_e[i].end_odd = GETDATA(curr, unsigned int); + tlb_e[i].phys_odd = GETDATA(curr, unsigned int); + } + +#ifdef NEW_DYNAREC + if (r4300emu == CORE_DYNAREC) { + pcaddr = GETDATA(curr, unsigned int); + pending_exception = 1; + invalidate_all_pages(); + } else { + if(r4300emu != CORE_PURE_INTERPRETER) + { + for (i = 0; i < 0x100000; i++) + invalid_code[i] = 1; + } + generic_jump_to(GETDATA(curr, unsigned int)); // PC + } +#else + if(r4300emu != CORE_PURE_INTERPRETER) + { + for (i = 0; i < 0x100000; i++) + invalid_code[i] = 1; + } + generic_jump_to(GETDATA(curr, unsigned int)); // PC +#endif + + next_interupt = GETDATA(curr, unsigned int); + next_vi = GETDATA(curr, unsigned int); + vi_field = GETDATA(curr, unsigned int); + + // assert(savestateData+savestateSize == curr) + + to_little_endian_buffer(queue, 4, 256); + load_eventqueue_infos(queue); + +#ifdef NEW_DYNAREC + if (r4300emu == CORE_DYNAREC) + last_addr = pcaddr; + else + last_addr = PC->addr; +#else + last_addr = PC->addr; +#endif + + free(savestateData); + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "State loaded from: %s", namefrompath(filepath)); + return 1; +} + +static int savestates_load_pj64(char *filepath, void *handle, + int (*read_func)(void *, void *, size_t)) +{ + char buffer[1024]; + unsigned int vi_timer, SaveRDRAMSize; + int i; + + unsigned char header[8]; + unsigned char RomHeader[0x40]; + + size_t savestateSize; + unsigned char *savestateData, *curr; + + /* Read and check Project64 magic number. */ + if (!read_func(handle, header, 8)) + { + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Could not read header from Project64 savestate %s", filepath); + return 0; + } + + curr = header; + if (memcmp(curr, pj64_magic, 4) != 0) + { + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "State file: %s is not a valid Project64 savestate. Unrecognized file format.", filepath); + return 0; + } + curr += 4; + + SaveRDRAMSize = GETDATA(curr, unsigned int); + + /* Read the rest of the savestate into memory. */ + savestateSize = SaveRDRAMSize + 0x2754; + savestateData = curr = (unsigned char *)malloc(savestateSize); + if (savestateData == NULL) + { + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Insufficient memory to load state."); + return 0; + } + if (!read_func(handle, savestateData, savestateSize)) + { + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Could not read savestate data from Project64 savestate %s", filepath); + free(savestateData); + return 0; + } + + // check ROM header + COPYARRAY(RomHeader, curr, unsigned int, 0x40/4); + if(memcmp(RomHeader, rom, 0x40) != 0) + { + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "State ROM header does not match current ROM."); + free(savestateData); + return 0; + } + + // vi_timer + vi_timer = GETDATA(curr, unsigned int); + + // Program Counter + last_addr = GETDATA(curr, unsigned int); + + // GPR + COPYARRAY(reg, curr, long long int, 32); + + // FPR + COPYARRAY(reg_cop1_fgr_64, curr, long long int, 32); + + // CP0 + COPYARRAY(reg_cop0, curr, unsigned int, 32); + + set_fpr_pointers(Status); // Status is reg_cop0[12] + if ((Status & 0x04000000) == 0) // TODO not sure how pj64 handles this + shuffle_fpr_data(0x04000000, 0); + + // Initialze the interupts + vi_timer += reg_cop0[9]; // Add current Count + next_interupt = (Compare < vi_timer) ? Compare : vi_timer; + next_vi = vi_timer; + vi_field = 0; + *((unsigned int*)&buffer[0]) = VI_INT; + *((unsigned int*)&buffer[4]) = vi_timer; + *((unsigned int*)&buffer[8]) = COMPARE_INT; + *((unsigned int*)&buffer[12]) = Compare; + *((unsigned int*)&buffer[16]) = 0xFFFFFFFF; + + load_eventqueue_infos(buffer); + + // FPCR + FCR0 = GETDATA(curr, int); + curr += 30 * 4; // FCR1...FCR30 not supported + FCR31 = GETDATA(curr, int); + + // hi / lo + hi = GETDATA(curr, long long int); + lo = GETDATA(curr, long long int); + + // rdram register + rdram_register.rdram_config = GETDATA(curr, unsigned int); + rdram_register.rdram_device_id = GETDATA(curr, unsigned int); + rdram_register.rdram_delay = GETDATA(curr, unsigned int); + rdram_register.rdram_mode = GETDATA(curr, unsigned int); + rdram_register.rdram_ref_interval = GETDATA(curr, unsigned int); + rdram_register.rdram_ref_row = GETDATA(curr, unsigned int); + rdram_register.rdram_ras_interval = GETDATA(curr, unsigned int); + rdram_register.rdram_min_interval = GETDATA(curr, unsigned int); + rdram_register.rdram_addr_select = GETDATA(curr, unsigned int); + rdram_register.rdram_device_manuf = GETDATA(curr, unsigned int); + + // sp_register + sp_register.sp_mem_addr_reg = GETDATA(curr, unsigned int); + sp_register.sp_dram_addr_reg = GETDATA(curr, unsigned int); + sp_register.sp_rd_len_reg = GETDATA(curr, unsigned int); + sp_register.sp_wr_len_reg = GETDATA(curr, unsigned int); + sp_register.sp_status_reg = GETDATA(curr, unsigned int); + sp_register.sp_dma_full_reg = GETDATA(curr, unsigned int); + sp_register.sp_dma_busy_reg = GETDATA(curr, unsigned int); + sp_register.sp_semaphore_reg = GETDATA(curr, unsigned int); + rsp_register.rsp_pc = GETDATA(curr, unsigned int); + rsp_register.rsp_ibist = GETDATA(curr, unsigned int); + + make_w_sp_status_reg(); + + // dpc_register + dpc_register.dpc_start = GETDATA(curr, unsigned int); + dpc_register.dpc_end = GETDATA(curr, unsigned int); + dpc_register.dpc_current = GETDATA(curr, unsigned int); + dpc_register.dpc_status = GETDATA(curr, unsigned int); + dpc_register.dpc_clock = GETDATA(curr, unsigned int); + dpc_register.dpc_bufbusy = GETDATA(curr, unsigned int); + dpc_register.dpc_pipebusy = GETDATA(curr, unsigned int); + dpc_register.dpc_tmem = GETDATA(curr, unsigned int); + (void)GETDATA(curr, unsigned int); // Dummy read + (void)GETDATA(curr, unsigned int); // Dummy read + + make_w_dpc_status(); + + // mi_register + MI_register.mi_init_mode_reg = GETDATA(curr, unsigned int); + MI_register.mi_version_reg = GETDATA(curr, unsigned int); + MI_register.mi_intr_reg = GETDATA(curr, unsigned int); + MI_register.mi_intr_mask_reg = GETDATA(curr, unsigned int); + + make_w_mi_init_mode_reg(); + make_w_mi_intr_mask_reg(); + + // vi_register + vi_register.vi_status = GETDATA(curr, unsigned int); + vi_register.vi_origin = GETDATA(curr, unsigned int); + vi_register.vi_width = GETDATA(curr, unsigned int); + vi_register.vi_v_intr = GETDATA(curr, unsigned int); + vi_register.vi_current = GETDATA(curr, unsigned int); + vi_register.vi_burst = GETDATA(curr, unsigned int); + vi_register.vi_v_sync = GETDATA(curr, unsigned int); + vi_register.vi_h_sync = GETDATA(curr, unsigned int); + vi_register.vi_leap = GETDATA(curr, unsigned int); + vi_register.vi_h_start = GETDATA(curr, unsigned int); + vi_register.vi_v_start = GETDATA(curr, unsigned int); + vi_register.vi_v_burst = GETDATA(curr, unsigned int); + vi_register.vi_x_scale = GETDATA(curr, unsigned int); + vi_register.vi_y_scale = GETDATA(curr, unsigned int); + // TODO vi delay? + update_vi_status(vi_register.vi_status); + update_vi_width(vi_register.vi_width); + + // ai_register + ai_register.ai_dram_addr = GETDATA(curr, unsigned int); + ai_register.ai_len = GETDATA(curr, unsigned int); + ai_register.ai_control = GETDATA(curr, unsigned int); + ai_register.ai_status = GETDATA(curr, unsigned int); + ai_register.ai_dacrate = GETDATA(curr, unsigned int); + ai_register.ai_bitrate = GETDATA(curr, unsigned int); + update_ai_dacrate(ai_register.ai_dacrate); + + // pi_register + pi_register.pi_dram_addr_reg = GETDATA(curr, unsigned int); + pi_register.pi_cart_addr_reg = GETDATA(curr, unsigned int); + pi_register.pi_rd_len_reg = GETDATA(curr, unsigned int); + pi_register.pi_wr_len_reg = GETDATA(curr, unsigned int); + pi_register.read_pi_status_reg = GETDATA(curr, unsigned int); + pi_register.pi_bsd_dom1_lat_reg = GETDATA(curr, unsigned int); + pi_register.pi_bsd_dom1_pwd_reg = GETDATA(curr, unsigned int); + pi_register.pi_bsd_dom1_pgs_reg = GETDATA(curr, unsigned int); + pi_register.pi_bsd_dom1_rls_reg = GETDATA(curr, unsigned int); + pi_register.pi_bsd_dom2_lat_reg = GETDATA(curr, unsigned int); + pi_register.pi_bsd_dom2_pwd_reg = GETDATA(curr, unsigned int); + pi_register.pi_bsd_dom2_pgs_reg = GETDATA(curr, unsigned int); + pi_register.pi_bsd_dom2_rls_reg = GETDATA(curr, unsigned int); + read_func(handle, &pi_register, sizeof(PI_register)); + + // ri_register + ri_register.ri_mode = GETDATA(curr, unsigned int); + ri_register.ri_config = GETDATA(curr, unsigned int); + ri_register.ri_current_load = GETDATA(curr, unsigned int); + ri_register.ri_select = GETDATA(curr, unsigned int); + ri_register.ri_refresh = GETDATA(curr, unsigned int); + ri_register.ri_latency = GETDATA(curr, unsigned int); + ri_register.ri_error = GETDATA(curr, unsigned int); + ri_register.ri_werror = GETDATA(curr, unsigned int); + + // si_register + si_register.si_dram_addr = GETDATA(curr, unsigned int); + si_register.si_pif_addr_rd64b = GETDATA(curr, unsigned int); + si_register.si_pif_addr_wr64b = GETDATA(curr, unsigned int); + si_register.si_stat = GETDATA(curr, unsigned int); + + // tlb + memset(tlb_LUT_r, 0, 0x400000); + memset(tlb_LUT_w, 0, 0x400000); + for (i=0; i < 32; i++) + { + unsigned int MyPageMask, MyEntryHi, MyEntryLo0, MyEntryLo1; + + (void)GETDATA(curr, unsigned int); // Dummy read - EntryDefined + MyPageMask = GETDATA(curr, unsigned int); + MyEntryHi = GETDATA(curr, unsigned int); + MyEntryLo0 = GETDATA(curr, unsigned int); + MyEntryLo1 = GETDATA(curr, unsigned int); + + // This is copied from TLBWI instruction + tlb_e[i].g = (MyEntryLo0 & MyEntryLo1 & 1); + tlb_e[i].pfn_even = (MyEntryLo0 & 0x3FFFFFC0) >> 6; + tlb_e[i].pfn_odd = (MyEntryLo1 & 0x3FFFFFC0) >> 6; + tlb_e[i].c_even = (MyEntryLo0 & 0x38) >> 3; + tlb_e[i].c_odd = (MyEntryLo1 & 0x38) >> 3; + tlb_e[i].d_even = (MyEntryLo0 & 0x4) >> 2; + tlb_e[i].d_odd = (MyEntryLo1 & 0x4) >> 2; + tlb_e[i].v_even = (MyEntryLo0 & 0x2) >> 1; + tlb_e[i].v_odd = (MyEntryLo1 & 0x2) >> 1; + tlb_e[i].asid = (MyEntryHi & 0xFF); + tlb_e[i].vpn2 = (MyEntryHi & 0xFFFFE000) >> 13; + //tlb_e[i].r = (MyEntryHi & 0xC000000000000000LL) >> 62; + tlb_e[i].mask = (MyPageMask & 0x1FFE000) >> 13; + + tlb_e[i].start_even = tlb_e[i].vpn2 << 13; + tlb_e[i].end_even = tlb_e[i].start_even+ + (tlb_e[i].mask << 12) + 0xFFF; + tlb_e[i].phys_even = tlb_e[i].pfn_even << 12; + + tlb_e[i].start_odd = tlb_e[i].end_even+1; + tlb_e[i].end_odd = tlb_e[i].start_odd+ + (tlb_e[i].mask << 12) + 0xFFF; + tlb_e[i].phys_odd = tlb_e[i].pfn_odd << 12; + + tlb_map(&tlb_e[i]); + } + + // pif ram + COPYARRAY(PIF_RAM, curr, unsigned char, 0x40); + + // RDRAM + memset(rdram, 0, 0x800000); + COPYARRAY(rdram, curr, unsigned int, SaveRDRAMSize/4); + + // DMEM + COPYARRAY(SP_DMEM, curr, unsigned int, 0x1000/4); + + // IMEM + COPYARRAY(SP_IMEM, curr, unsigned int, 0x1000/4); + + // The following values should not matter because we don't have any AI interrupt + // ai_register.next_delay = 0; ai_register.next_len = 0; + // ai_register.current_delay = 0; ai_register.current_len = 0; + + // The following is not available in PJ64 savestate. Keep the values as is. + // dps_register.dps_tbist = 0; dps_register.dps_test_mode = 0; + // dps_register.dps_buftest_addr = 0; dps_register.dps_buftest_data = 0; llbit = 0; + + // No flashram info in pj64 savestate. + init_flashram(); + +#ifdef NEW_DYNAREC + if (r4300emu == CORE_DYNAREC) { + pcaddr = GETDATA(curr, unsigned int); + pending_exception = 1; + invalidate_all_pages(); + } else { + if(r4300emu != CORE_PURE_INTERPRETER) + { + for (i = 0; i < 0x100000; i++) + invalid_code[i] = 1; + } + generic_jump_to(last_addr); + } +#else + if(r4300emu != CORE_PURE_INTERPRETER) + { + for (i = 0; i < 0x100000; i++) + invalid_code[i] = 1; + } + generic_jump_to(last_addr); +#endif + + // assert(savestateData+savestateSize == curr) + + free(savestateData); + return 1; +} + +static int read_data_from_zip(void *zip, void *buffer, size_t length) +{ + return unzReadCurrentFile((unzFile)zip, buffer, (unsigned)length) == length; +} + +static int savestates_load_pj64_zip(char *filepath) +{ + char szFileName[256], szExtraField[256], szComment[256]; + unzFile zipstatefile = NULL; + unz_file_info fileinfo; + int ret = 0; + + /* Open the .zip file. */ + zipstatefile = unzOpen(filepath); + if (zipstatefile == NULL || + unzGoToFirstFile(zipstatefile) != UNZ_OK || + unzGetCurrentFileInfo(zipstatefile, &fileinfo, szFileName, 255, szExtraField, 255, szComment, 255) != UNZ_OK || + unzOpenCurrentFile(zipstatefile) != UNZ_OK) + { + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Zip error. Could not open state file: %s", filepath); + goto clean_and_exit; + } + + if (!savestates_load_pj64(filepath, zipstatefile, read_data_from_zip)) + goto clean_and_exit; + + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "State loaded from: %s", namefrompath(filepath)); + ret = 1; + + clean_and_exit: + if (zipstatefile != NULL) + unzClose(zipstatefile); + return ret; +} + +static int read_data_from_file(void *file, void *buffer, size_t length) +{ + return fread(buffer, 1, length, file) == length; +} + +static int savestates_load_pj64_unc(char *filepath) +{ + FILE *f; + + /* Open the file. */ + f = fopen(filepath, "rb"); + if (f == NULL) + { + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Could not open state file: %s", filepath); + return 0; + } + + if (!savestates_load_pj64(filepath, f, read_data_from_file)) + { + fclose(f); + return 0; + } + + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "State loaded from: %s", namefrompath(filepath)); + fclose(f); + return 1; +} + +static savestates_type savestates_detect_type(char *filepath) +{ + unsigned char magic[4]; + FILE *f = fopen(filepath, "rb"); + if (f == NULL) + { + DebugMessage(M64MSG_STATUS, "Could not open state file %s\n", filepath); + return savestates_type_unknown; + } + + if (fread(magic, 1, 4, f) != 4) + { + fclose(f); + DebugMessage(M64MSG_STATUS, "Could not read from state file %s\n", filepath); + return savestates_type_unknown; + } + + fclose(f); + + if (magic[0] == 0x1f && magic[1] == 0x8b) // GZIP header + return savestates_type_m64p; + else if (memcmp(magic, "PK\x03\x04", 4) == 0) // ZIP header + return savestates_type_pj64_zip; + else if (memcmp(magic, pj64_magic, 4) == 0) // PJ64 header + return savestates_type_pj64_unc; + else + { + DebugMessage(M64MSG_STATUS, "Unknown state file type %s\n", filepath); + return savestates_type_unknown; + } +} + +int savestates_load(void) +{ + FILE *fPtr = NULL; + char *filepath = NULL; + int ret = 0; + + if (fname == NULL) // For slots, autodetect the savestate type + { + // try M64P type first + type = savestates_type_m64p; + filepath = savestates_generate_path(type); + fPtr = fopen(filepath, "rb"); // can I open this? + if (fPtr == NULL) + { + free(filepath); + // try PJ64 zipped type second + type = savestates_type_pj64_zip; + filepath = savestates_generate_path(type); + fPtr = fopen(filepath, "rb"); // can I open this? + if (fPtr == NULL) + { + free(filepath); + // finally, try PJ64 uncompressed + type = savestates_type_pj64_unc; + filepath = savestates_generate_path(type); + fPtr = fopen(filepath, "rb"); // can I open this? + if (fPtr == NULL) + { + free(filepath); + filepath = NULL; + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "No Mupen64Plus/PJ64 state file found for slot %i", slot); + type = savestates_type_unknown; + } + } + } + } + else // filename of state file to load was set explicitly in 'fname' + { + // detect type if unknown + if (type == savestates_type_unknown) + { + type = savestates_detect_type(fname); + } + filepath = savestates_generate_path(type); + if (filepath != NULL) + fPtr = fopen(filepath, "rb"); // can I open this? + if (fPtr == NULL) + { + if (filepath != NULL) + free(filepath); + filepath = NULL; + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Failed to open savestate file %s", filepath); + } + } + if (fPtr != NULL) + fclose(fPtr); + + if (filepath != NULL) + { + switch (type) + { + case savestates_type_m64p: ret = savestates_load_m64p(filepath); break; + case savestates_type_pj64_zip: ret = savestates_load_pj64_zip(filepath); break; + case savestates_type_pj64_unc: ret = savestates_load_pj64_unc(filepath); break; + default: ret = 0; break; + } + free(filepath); + filepath = NULL; + } + + // deliver callback to indicate completion of state loading operation + StateChanged(M64CORE_STATE_LOADCOMPLETE, ret); + + savestates_clear_job(); + + return ret; +} + +static void savestates_save_m64p_work(struct work_struct *work) +{ + gzFile f; + struct savestate_work *save = container_of(work, struct savestate_work, work); + + SDL_LockMutex(savestates_lock); + + // Write the state to a GZIP file + f = gzopen(save->filepath, "wb"); + + if (f==NULL) + { + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Could not open state file: %s", save->filepath); + free(save->data); + return; + } + + if (gzwrite(f, save->data, save->size) != save->size) + { + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Could not write data to state file: %s", save->filepath); + gzclose(f); + free(save->data); + return; + } + + gzclose(f); + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Saved state to: %s", namefrompath(save->filepath)); + free(save->data); + free(save->filepath); + free(save); + + SDL_UnlockMutex(savestates_lock); +} + +static int savestates_save_m64p(char *filepath) +{ + unsigned char outbuf[4]; + int i; + + char queue[1024]; + int queuelength; + + struct savestate_work *save; + char *curr; + + save = malloc(sizeof(*save)); + if (!save) { + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Insufficient memory to save state."); + return 0; + } + + save->filepath = strdup(filepath); + + if(autoinc_save_slot) + savestates_inc_slot(); + + queuelength = save_eventqueue_infos(queue); + + // Allocate memory for the save state data + save->size = 16788288 + queuelength; + save->data = curr = malloc(save->size); + if (save->data == NULL) + { + free(save->filepath); + free(save); + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Insufficient memory to save state."); + return 0; + } + + // Write the save state data to memory + PUTARRAY(savestate_magic, curr, unsigned char, 8); + + outbuf[0] = (savestate_latest_version >> 24) & 0xff; + outbuf[1] = (savestate_latest_version >> 16) & 0xff; + outbuf[2] = (savestate_latest_version >> 8) & 0xff; + outbuf[3] = (savestate_latest_version >> 0) & 0xff; + PUTARRAY(outbuf, curr, unsigned char, 4); + + PUTARRAY(ROM_SETTINGS.MD5, curr, char, 32); + + PUTDATA(curr, unsigned int, rdram_register.rdram_config); + PUTDATA(curr, unsigned int, rdram_register.rdram_device_id); + PUTDATA(curr, unsigned int, rdram_register.rdram_delay); + PUTDATA(curr, unsigned int, rdram_register.rdram_mode); + PUTDATA(curr, unsigned int, rdram_register.rdram_ref_interval); + PUTDATA(curr, unsigned int, rdram_register.rdram_ref_row); + PUTDATA(curr, unsigned int, rdram_register.rdram_ras_interval); + PUTDATA(curr, unsigned int, rdram_register.rdram_min_interval); + PUTDATA(curr, unsigned int, rdram_register.rdram_addr_select); + PUTDATA(curr, unsigned int, rdram_register.rdram_device_manuf); + + PUTDATA(curr, unsigned int, MI_register.w_mi_init_mode_reg); + PUTDATA(curr, unsigned int, MI_register.mi_init_mode_reg); + PUTDATA(curr, unsigned char, MI_register.mi_init_mode_reg & 0x7F); + PUTDATA(curr, unsigned char, (MI_register.mi_init_mode_reg & 0x80) != 0); + PUTDATA(curr, unsigned char, (MI_register.mi_init_mode_reg & 0x100) != 0); + PUTDATA(curr, unsigned char, (MI_register.mi_init_mode_reg & 0x200) != 0); + PUTDATA(curr, unsigned int, MI_register.mi_version_reg); + PUTDATA(curr, unsigned int, MI_register.mi_intr_reg); + PUTDATA(curr, unsigned int, MI_register.mi_intr_mask_reg); + PUTDATA(curr, unsigned int, MI_register.w_mi_intr_mask_reg); + PUTDATA(curr, unsigned char, (MI_register.mi_intr_mask_reg & 0x1) != 0); + PUTDATA(curr, unsigned char, (MI_register.mi_intr_mask_reg & 0x2) != 0); + PUTDATA(curr, unsigned char, (MI_register.mi_intr_mask_reg & 0x4) != 0); + PUTDATA(curr, unsigned char, (MI_register.mi_intr_mask_reg & 0x8) != 0); + PUTDATA(curr, unsigned char, (MI_register.mi_intr_mask_reg & 0x10) != 0); + PUTDATA(curr, unsigned char, (MI_register.mi_intr_mask_reg & 0x20) != 0); + PUTDATA(curr, unsigned short, 0); // Padding from old implementation + + PUTDATA(curr, unsigned int, pi_register.pi_dram_addr_reg); + PUTDATA(curr, unsigned int, pi_register.pi_cart_addr_reg); + PUTDATA(curr, unsigned int, pi_register.pi_rd_len_reg); + PUTDATA(curr, unsigned int, pi_register.pi_wr_len_reg); + PUTDATA(curr, unsigned int, pi_register.read_pi_status_reg); + PUTDATA(curr, unsigned int, pi_register.pi_bsd_dom1_lat_reg); + PUTDATA(curr, unsigned int, pi_register.pi_bsd_dom1_pwd_reg); + PUTDATA(curr, unsigned int, pi_register.pi_bsd_dom1_pgs_reg); + PUTDATA(curr, unsigned int, pi_register.pi_bsd_dom1_rls_reg); + PUTDATA(curr, unsigned int, pi_register.pi_bsd_dom2_lat_reg); + PUTDATA(curr, unsigned int, pi_register.pi_bsd_dom2_pwd_reg); + PUTDATA(curr, unsigned int, pi_register.pi_bsd_dom2_pgs_reg); + PUTDATA(curr, unsigned int, pi_register.pi_bsd_dom2_rls_reg); + + PUTDATA(curr, unsigned int, sp_register.sp_mem_addr_reg); + PUTDATA(curr, unsigned int, sp_register.sp_dram_addr_reg); + PUTDATA(curr, unsigned int, sp_register.sp_rd_len_reg); + PUTDATA(curr, unsigned int, sp_register.sp_wr_len_reg); + PUTDATA(curr, unsigned int, sp_register.w_sp_status_reg); + PUTDATA(curr, unsigned int, sp_register.sp_status_reg); + PUTDATA(curr, unsigned char, (sp_register.sp_status_reg & 0x1) != 0); + PUTDATA(curr, unsigned char, (sp_register.sp_status_reg & 0x2) != 0); + PUTDATA(curr, unsigned char, (sp_register.sp_status_reg & 0x4) != 0); + PUTDATA(curr, unsigned char, (sp_register.sp_status_reg & 0x8) != 0); + PUTDATA(curr, unsigned char, (sp_register.sp_status_reg & 0x10) != 0); + PUTDATA(curr, unsigned char, (sp_register.sp_status_reg & 0x20) != 0); + PUTDATA(curr, unsigned char, (sp_register.sp_status_reg & 0x40) != 0); + PUTDATA(curr, unsigned char, (sp_register.sp_status_reg & 0x80) != 0); + PUTDATA(curr, unsigned char, (sp_register.sp_status_reg & 0x100) != 0); + PUTDATA(curr, unsigned char, (sp_register.sp_status_reg & 0x200) != 0); + PUTDATA(curr, unsigned char, (sp_register.sp_status_reg & 0x400) != 0); + PUTDATA(curr, unsigned char, (sp_register.sp_status_reg & 0x800) != 0); + PUTDATA(curr, unsigned char, (sp_register.sp_status_reg & 0x1000) != 0); + PUTDATA(curr, unsigned char, (sp_register.sp_status_reg & 0x2000) != 0); + PUTDATA(curr, unsigned char, (sp_register.sp_status_reg & 0x4000) != 0); + PUTDATA(curr, unsigned char, 0); + PUTDATA(curr, unsigned int, sp_register.sp_dma_full_reg); + PUTDATA(curr, unsigned int, sp_register.sp_dma_busy_reg); + PUTDATA(curr, unsigned int, sp_register.sp_semaphore_reg); + + PUTDATA(curr, unsigned int, rsp_register.rsp_pc); + PUTDATA(curr, unsigned int, rsp_register.rsp_ibist); + + PUTDATA(curr, unsigned int, si_register.si_dram_addr); + PUTDATA(curr, unsigned int, si_register.si_pif_addr_rd64b); + PUTDATA(curr, unsigned int, si_register.si_pif_addr_wr64b); + PUTDATA(curr, unsigned int, si_register.si_stat); + + PUTDATA(curr, unsigned int, vi_register.vi_status); + PUTDATA(curr, unsigned int, vi_register.vi_origin); + PUTDATA(curr, unsigned int, vi_register.vi_width); + PUTDATA(curr, unsigned int, vi_register.vi_v_intr); + PUTDATA(curr, unsigned int, vi_register.vi_current); + PUTDATA(curr, unsigned int, vi_register.vi_burst); + PUTDATA(curr, unsigned int, vi_register.vi_v_sync); + PUTDATA(curr, unsigned int, vi_register.vi_h_sync); + PUTDATA(curr, unsigned int, vi_register.vi_leap); + PUTDATA(curr, unsigned int, vi_register.vi_h_start); + PUTDATA(curr, unsigned int, vi_register.vi_v_start); + PUTDATA(curr, unsigned int, vi_register.vi_v_burst); + PUTDATA(curr, unsigned int, vi_register.vi_x_scale); + PUTDATA(curr, unsigned int, vi_register.vi_y_scale); + PUTDATA(curr, unsigned int, vi_register.vi_delay); + + PUTDATA(curr, unsigned int, ri_register.ri_mode); + PUTDATA(curr, unsigned int, ri_register.ri_config); + PUTDATA(curr, unsigned int, ri_register.ri_current_load); + PUTDATA(curr, unsigned int, ri_register.ri_select); + PUTDATA(curr, unsigned int, ri_register.ri_refresh); + PUTDATA(curr, unsigned int, ri_register.ri_latency); + PUTDATA(curr, unsigned int, ri_register.ri_error); + PUTDATA(curr, unsigned int, ri_register.ri_werror); + + PUTDATA(curr, unsigned int, ai_register.ai_dram_addr); + PUTDATA(curr, unsigned int, ai_register.ai_len); + PUTDATA(curr, unsigned int, ai_register.ai_control); + PUTDATA(curr, unsigned int, ai_register.ai_status); + PUTDATA(curr, unsigned int, ai_register.ai_dacrate); + PUTDATA(curr, unsigned int, ai_register.ai_bitrate); + PUTDATA(curr, unsigned int, ai_register.next_delay); + PUTDATA(curr, unsigned int, ai_register.next_len); + PUTDATA(curr, unsigned int, ai_register.current_delay); + PUTDATA(curr, unsigned int, ai_register.current_len); + + PUTDATA(curr, unsigned int, dpc_register.dpc_start); + PUTDATA(curr, unsigned int, dpc_register.dpc_end); + PUTDATA(curr, unsigned int, dpc_register.dpc_current); + PUTDATA(curr, unsigned int, dpc_register.w_dpc_status); + PUTDATA(curr, unsigned int, dpc_register.dpc_status); + PUTDATA(curr, unsigned char, (dpc_register.dpc_status & 0x1) != 0); + PUTDATA(curr, unsigned char, (dpc_register.dpc_status & 0x2) != 0); + PUTDATA(curr, unsigned char, (dpc_register.dpc_status & 0x4) != 0); + PUTDATA(curr, unsigned char, (dpc_register.dpc_status & 0x8) != 0); + PUTDATA(curr, unsigned char, (dpc_register.dpc_status & 0x10) != 0); + PUTDATA(curr, unsigned char, (dpc_register.dpc_status & 0x20) != 0); + PUTDATA(curr, unsigned char, (dpc_register.dpc_status & 0x40) != 0); + PUTDATA(curr, unsigned char, (dpc_register.dpc_status & 0x80) != 0); + PUTDATA(curr, unsigned char, (dpc_register.dpc_status & 0x100) != 0); + PUTDATA(curr, unsigned char, (dpc_register.dpc_status & 0x200) != 0); + PUTDATA(curr, unsigned char, (dpc_register.dpc_status & 0x400) != 0); + PUTDATA(curr, unsigned char, 0); + PUTDATA(curr, unsigned int, dpc_register.dpc_clock); + PUTDATA(curr, unsigned int, dpc_register.dpc_bufbusy); + PUTDATA(curr, unsigned int, dpc_register.dpc_pipebusy); + PUTDATA(curr, unsigned int, dpc_register.dpc_tmem); + + PUTDATA(curr, unsigned int, dps_register.dps_tbist); + PUTDATA(curr, unsigned int, dps_register.dps_test_mode); + PUTDATA(curr, unsigned int, dps_register.dps_buftest_addr); + PUTDATA(curr, unsigned int, dps_register.dps_buftest_data); + + PUTARRAY(rdram, curr, unsigned int, 0x800000/4); + PUTARRAY(SP_DMEM, curr, unsigned int, 0x1000/4); + PUTARRAY(SP_IMEM, curr, unsigned int, 0x1000/4); + PUTARRAY(PIF_RAM, curr, unsigned char, 0x40); + + PUTDATA(curr, int, flashram_info.use_flashram); + PUTDATA(curr, int, flashram_info.mode); + PUTDATA(curr, unsigned long long, flashram_info.status); + PUTDATA(curr, unsigned int, flashram_info.erase_offset); + PUTDATA(curr, unsigned int, flashram_info.write_pointer); + + PUTARRAY(tlb_LUT_r, curr, unsigned int, 0x100000); + PUTARRAY(tlb_LUT_w, curr, unsigned int, 0x100000); + + PUTDATA(curr, unsigned int, llbit); + PUTARRAY(reg, curr, long long int, 32); + PUTARRAY(reg_cop0, curr, unsigned int, 32); + PUTDATA(curr, long long int, lo); + PUTDATA(curr, long long int, hi); + + if ((Status & 0x04000000) == 0) // FR bit == 0 means 32-bit (MIPS I) FGR mode + shuffle_fpr_data(0, 0x04000000); // shuffle data into 64-bit register format for storage + PUTARRAY(reg_cop1_fgr_64, curr, long long int, 32); + if ((Status & 0x04000000) == 0) + shuffle_fpr_data(0x04000000, 0); // put it back in 32-bit mode + + PUTDATA(curr, int, FCR0); + PUTDATA(curr, int, FCR31); + for (i = 0; i < 32; i++) + { + PUTDATA(curr, short, tlb_e[i].mask); + PUTDATA(curr, short, 0); + PUTDATA(curr, int, tlb_e[i].vpn2); + PUTDATA(curr, char, tlb_e[i].g); + PUTDATA(curr, unsigned char, tlb_e[i].asid); + PUTDATA(curr, short, 0); + PUTDATA(curr, int, tlb_e[i].pfn_even); + PUTDATA(curr, char, tlb_e[i].c_even); + PUTDATA(curr, char, tlb_e[i].d_even); + PUTDATA(curr, char, tlb_e[i].v_even); + PUTDATA(curr, char, 0); + PUTDATA(curr, int, tlb_e[i].pfn_odd); + PUTDATA(curr, char, tlb_e[i].c_odd); + PUTDATA(curr, char, tlb_e[i].d_odd); + PUTDATA(curr, char, tlb_e[i].v_odd); + PUTDATA(curr, char, tlb_e[i].r); + + PUTDATA(curr, unsigned int, tlb_e[i].start_even); + PUTDATA(curr, unsigned int, tlb_e[i].end_even); + PUTDATA(curr, unsigned int, tlb_e[i].phys_even); + PUTDATA(curr, unsigned int, tlb_e[i].start_odd); + PUTDATA(curr, unsigned int, tlb_e[i].end_odd); + PUTDATA(curr, unsigned int, tlb_e[i].phys_odd); + } +#ifdef NEW_DYNAREC + if (r4300emu == CORE_DYNAREC) + PUTDATA(curr, unsigned int, pcaddr); + else + PUTDATA(curr, unsigned int, PC->addr); +#else + PUTDATA(curr, unsigned int, PC->addr); +#endif + + PUTDATA(curr, unsigned int, next_interupt); + PUTDATA(curr, unsigned int, next_vi); + PUTDATA(curr, unsigned int, vi_field); + + to_little_endian_buffer(queue, 4, queuelength/4); + PUTARRAY(queue, curr, char, queuelength); + + // assert(curr == save->data + save->size) + + init_work(&save->work, savestates_save_m64p_work); + queue_work(&save->work); + + return 1; +} + +static int savestates_save_pj64(char *filepath, void *handle, + int (*write_func)(void *, const void *, size_t)) +{ + unsigned int i; + unsigned int SaveRDRAMSize = 0x800000; + + size_t savestateSize; + unsigned char *savestateData, *curr; + + // Allocate memory for the save state data + savestateSize = 8 + SaveRDRAMSize + 0x2754; + savestateData = curr = (unsigned char *)malloc(savestateSize); + if (savestateData == NULL) + { + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Insufficient memory to save state."); + return 0; + } + + // Write the save state data in memory + PUTARRAY(pj64_magic, curr, unsigned char, 4); + PUTDATA(curr, unsigned int, SaveRDRAMSize); + PUTARRAY(rom, curr, unsigned int, 0x40/4); + PUTDATA(curr, unsigned int, get_event(VI_INT) - reg_cop0[9]); // vi_timer +#ifdef NEW_DYNAREC + if (r4300emu == CORE_DYNAREC) + PUTDATA(curr, unsigned int, pcaddr); + else + PUTDATA(curr, unsigned int, PC->addr); +#else + PUTDATA(curr, unsigned int, PC->addr); +#endif + PUTARRAY(reg, curr, long long int, 32); + if ((Status & 0x04000000) == 0) // TODO not sure how pj64 handles this + shuffle_fpr_data(0x04000000, 0); + PUTARRAY(reg_cop1_fgr_64, curr, long long int, 32); + if ((Status & 0x04000000) == 0) // TODO not sure how pj64 handles this + shuffle_fpr_data(0x04000000, 0); + PUTARRAY(reg_cop0, curr, unsigned int, 32); + PUTDATA(curr, int, FCR0); + for (i = 0; i < 30; i++) + PUTDATA(curr, int, 0); // FCR1-30 not implemented + PUTDATA(curr, int, FCR31); + PUTDATA(curr, long long int, hi); + PUTDATA(curr, long long int, lo); + + PUTDATA(curr, unsigned int, rdram_register.rdram_config); + PUTDATA(curr, unsigned int, rdram_register.rdram_device_id); + PUTDATA(curr, unsigned int, rdram_register.rdram_delay); + PUTDATA(curr, unsigned int, rdram_register.rdram_mode); + PUTDATA(curr, unsigned int, rdram_register.rdram_ref_interval); + PUTDATA(curr, unsigned int, rdram_register.rdram_ref_row); + PUTDATA(curr, unsigned int, rdram_register.rdram_ras_interval); + PUTDATA(curr, unsigned int, rdram_register.rdram_min_interval); + PUTDATA(curr, unsigned int, rdram_register.rdram_addr_select); + PUTDATA(curr, unsigned int, rdram_register.rdram_device_manuf); + + PUTDATA(curr, unsigned int, sp_register.sp_mem_addr_reg); + PUTDATA(curr, unsigned int, sp_register.sp_dram_addr_reg); + PUTDATA(curr, unsigned int, sp_register.sp_rd_len_reg); + PUTDATA(curr, unsigned int, sp_register.sp_wr_len_reg); + PUTDATA(curr, unsigned int, sp_register.sp_status_reg); + PUTDATA(curr, unsigned int, sp_register.sp_dma_full_reg); + PUTDATA(curr, unsigned int, sp_register.sp_dma_busy_reg); + PUTDATA(curr, unsigned int, sp_register.sp_semaphore_reg); + + PUTDATA(curr, unsigned int, rsp_register.rsp_pc); + PUTDATA(curr, unsigned int, rsp_register.rsp_ibist); + + PUTDATA(curr, unsigned int, dpc_register.dpc_start); + PUTDATA(curr, unsigned int, dpc_register.dpc_end); + PUTDATA(curr, unsigned int, dpc_register.dpc_current); + PUTDATA(curr, unsigned int, dpc_register.dpc_status); + PUTDATA(curr, unsigned int, dpc_register.dpc_clock); + PUTDATA(curr, unsigned int, dpc_register.dpc_bufbusy); + PUTDATA(curr, unsigned int, dpc_register.dpc_pipebusy); + PUTDATA(curr, unsigned int, dpc_register.dpc_tmem); + PUTDATA(curr, unsigned int, 0); // ? + PUTDATA(curr, unsigned int, 0); // ? + + PUTDATA(curr, unsigned int, MI_register.mi_init_mode_reg); //TODO Secial handling in pj64 + PUTDATA(curr, unsigned int, MI_register.mi_version_reg); + PUTDATA(curr, unsigned int, MI_register.mi_intr_reg); + PUTDATA(curr, unsigned int, MI_register.mi_intr_mask_reg); + + PUTDATA(curr, unsigned int, vi_register.vi_status); + PUTDATA(curr, unsigned int, vi_register.vi_origin); + PUTDATA(curr, unsigned int, vi_register.vi_width); + PUTDATA(curr, unsigned int, vi_register.vi_v_intr); + PUTDATA(curr, unsigned int, vi_register.vi_current); + PUTDATA(curr, unsigned int, vi_register.vi_burst); + PUTDATA(curr, unsigned int, vi_register.vi_v_sync); + PUTDATA(curr, unsigned int, vi_register.vi_h_sync); + PUTDATA(curr, unsigned int, vi_register.vi_leap); + PUTDATA(curr, unsigned int, vi_register.vi_h_start); + PUTDATA(curr, unsigned int, vi_register.vi_v_start); + PUTDATA(curr, unsigned int, vi_register.vi_v_burst); + PUTDATA(curr, unsigned int, vi_register.vi_x_scale); + PUTDATA(curr, unsigned int, vi_register.vi_y_scale); + + PUTDATA(curr, unsigned int, ai_register.ai_dram_addr); + PUTDATA(curr, unsigned int, ai_register.ai_len); + PUTDATA(curr, unsigned int, ai_register.ai_control); + PUTDATA(curr, unsigned int, ai_register.ai_status); + PUTDATA(curr, unsigned int, ai_register.ai_dacrate); + PUTDATA(curr, unsigned int, ai_register.ai_bitrate); + + PUTDATA(curr, unsigned int, pi_register.pi_dram_addr_reg); + PUTDATA(curr, unsigned int, pi_register.pi_cart_addr_reg); + PUTDATA(curr, unsigned int, pi_register.pi_rd_len_reg); + PUTDATA(curr, unsigned int, pi_register.pi_wr_len_reg); + PUTDATA(curr, unsigned int, pi_register.read_pi_status_reg); + PUTDATA(curr, unsigned int, pi_register.pi_bsd_dom1_lat_reg); + PUTDATA(curr, unsigned int, pi_register.pi_bsd_dom1_pwd_reg); + PUTDATA(curr, unsigned int, pi_register.pi_bsd_dom1_pgs_reg); + PUTDATA(curr, unsigned int, pi_register.pi_bsd_dom1_rls_reg); + PUTDATA(curr, unsigned int, pi_register.pi_bsd_dom2_lat_reg); + PUTDATA(curr, unsigned int, pi_register.pi_bsd_dom2_pwd_reg); + PUTDATA(curr, unsigned int, pi_register.pi_bsd_dom2_pgs_reg); + PUTDATA(curr, unsigned int, pi_register.pi_bsd_dom2_rls_reg); + + PUTDATA(curr, unsigned int, ri_register.ri_mode); + PUTDATA(curr, unsigned int, ri_register.ri_config); + PUTDATA(curr, unsigned int, ri_register.ri_current_load); + PUTDATA(curr, unsigned int, ri_register.ri_select); + PUTDATA(curr, unsigned int, ri_register.ri_refresh); + PUTDATA(curr, unsigned int, ri_register.ri_latency); + PUTDATA(curr, unsigned int, ri_register.ri_error); + PUTDATA(curr, unsigned int, ri_register.ri_werror); + + PUTDATA(curr, unsigned int, si_register.si_dram_addr); + PUTDATA(curr, unsigned int, si_register.si_pif_addr_rd64b); + PUTDATA(curr, unsigned int, si_register.si_pif_addr_wr64b); + PUTDATA(curr, unsigned int, si_register.si_stat); + + for (i=0; i < 32;i++) + { + // From TLBR + unsigned int EntryDefined, MyPageMask, MyEntryHi, MyEntryLo0, MyEntryLo1; + EntryDefined = tlb_e[i].v_even || tlb_e[i].v_odd; + MyPageMask = tlb_e[i].mask << 13; + MyEntryHi = ((tlb_e[i].vpn2 << 13) | tlb_e[i].asid); + MyEntryLo0 = (tlb_e[i].pfn_even << 6) | (tlb_e[i].c_even << 3) + | (tlb_e[i].d_even << 2) | (tlb_e[i].v_even << 1) + | tlb_e[i].g; + MyEntryLo1 = (tlb_e[i].pfn_odd << 6) | (tlb_e[i].c_odd << 3) + | (tlb_e[i].d_odd << 2) | (tlb_e[i].v_odd << 1) + | tlb_e[i].g; + + PUTDATA(curr, unsigned int, EntryDefined); + PUTDATA(curr, unsigned int, MyPageMask); + PUTDATA(curr, unsigned int, MyEntryHi); + PUTDATA(curr, unsigned int, MyEntryLo0); + PUTDATA(curr, unsigned int, MyEntryLo1); + } + + PUTARRAY(PIF_RAM, curr, unsigned char, 0x40); + + PUTARRAY(rdram, curr, unsigned int, SaveRDRAMSize/4); + PUTARRAY(SP_DMEM, curr, unsigned int, 0x1000/4); + PUTARRAY(SP_IMEM, curr, unsigned int, 0x1000/4); + + // Write the save state data to the output + if (!write_func(handle, savestateData, savestateSize)) + { + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Couldn't write data to Project64 state file %s.", filepath); + free(savestateData); + return 0; + } + + // assert(savestateData+savestateSize == curr) + free(savestateData); + return 1; +} + +static int write_data_to_zip(void *zip, const void *buffer, size_t length) +{ + return zipWriteInFileInZip((zipFile)zip, buffer, (unsigned)length) == ZIP_OK; +} + +static int savestates_save_pj64_zip(char *filepath) +{ + int retval; + zipFile zipfile = NULL; + + zipfile = zipOpen(filepath, APPEND_STATUS_CREATE); + if(zipfile == NULL) + { + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Could not create PJ64 state file: %s", filepath); + goto clean_and_exit; + } + + retval = zipOpenNewFileInZip(zipfile, namefrompath(filepath), NULL, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_DEFAULT_COMPRESSION); + if(retval != ZIP_OK) + { + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Zip error. Could not create state file: %s", filepath); + goto clean_and_exit; + } + + if (!savestates_save_pj64(filepath, zipfile, write_data_to_zip)) + goto clean_and_exit; + + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Saved state to: %s", namefrompath(filepath)); + + clean_and_exit: + if (zipfile != NULL) + { + zipCloseFileInZip(zipfile); // This may fail, but we don't care + zipClose(zipfile, ""); + } + return 1; +} + +static int write_data_to_file(void *file, const void *buffer, size_t length) +{ + return fwrite(buffer, 1, length, (FILE *)file) == length; +} + +static int savestates_save_pj64_unc(char *filepath) +{ + FILE *f; + + f = fopen(filepath, "wb"); + if (f == NULL) + { + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Could not create PJ64 state file: %s", filepath); + return 0; + } + + if (!savestates_save_pj64(filepath, f, write_data_to_file)) + { + fclose(f); + return 0; + } + + main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Saved state to: %s", namefrompath(filepath)); + fclose(f); + return 1; +} + +int savestates_save(void) +{ + char *filepath; + int ret = 0; + + /* Can only save PJ64 savestates on VI / COMPARE interrupt. + Otherwise try again in a little while. */ + if ((type == savestates_type_pj64_zip || + type == savestates_type_pj64_unc) && + get_next_event_type() > COMPARE_INT) + return 0; + + if (fname != NULL && type == savestates_type_unknown) + type = savestates_type_m64p; + else if (fname == NULL) // Always save slots in M64P format + type = savestates_type_m64p; + + filepath = savestates_generate_path(type); + if (filepath != NULL) + { + switch (type) + { + case savestates_type_m64p: ret = savestates_save_m64p(filepath); break; + case savestates_type_pj64_zip: ret = savestates_save_pj64_zip(filepath); break; + case savestates_type_pj64_unc: ret = savestates_save_pj64_unc(filepath); break; + default: ret = 0; break; + } + free(filepath); + } + + // deliver callback to indicate completion of state saving operation + StateChanged(M64CORE_STATE_SAVECOMPLETE, ret); + + savestates_clear_job(); + return ret; +} + +void savestates_init(void) +{ + savestates_lock = SDL_CreateMutex(); + if (!savestates_lock) { + DebugMessage(M64MSG_ERROR, "Could not create savestates list lock"); + return; + } +} + +void savestates_deinit(void) +{ + SDL_DestroyMutex(savestates_lock); + savestates_clear_job(); +} diff --git a/libmupen64plus/mupen64plus-core/src/main/savestates.h b/libmupen64plus/mupen64plus-core/src/main/savestates.h new file mode 100644 index 0000000000..300335bd5a --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/savestates.h @@ -0,0 +1,57 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - savestates.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2012 CasualJames * + * Copyright (C) 2009 Olejl Tillin9 * + * Copyright (C) 2008 Richard42 Tillin9 * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __SAVESTAVES_H__ +#define __SAVESTAVES_H__ + +typedef enum _savestates_job +{ + savestates_job_nothing, + savestates_job_load, + savestates_job_save +} savestates_job; + +typedef enum _savestates_type +{ + savestates_type_unknown, + savestates_type_m64p, + savestates_type_pj64_zip, + savestates_type_pj64_unc +} savestates_type; + +savestates_job savestates_get_job(void); +void savestates_set_job(savestates_job j, savestates_type t, const char *fn); +void savestates_init(void); +void savestates_deinit(void); + +int savestates_load(void); +int savestates_save(void); + +void savestates_select_slot(unsigned int s); +unsigned int savestates_get_slot(void); +void savestates_set_autoinc_slot(int b); +void savestates_inc_slot(void); + +#endif /* __SAVESTAVES_H__ */ + diff --git a/libmupen64plus/mupen64plus-core/src/main/util.c b/libmupen64plus/mupen64plus-core/src/main/util.c new file mode 100644 index 0000000000..246610cf9b --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/util.c @@ -0,0 +1,404 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - util.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2012 CasualJames * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** + * Provides common utilities to the rest of the code: + * -String functions + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "rom.h" +#include "util.h" +#include "osal/files.h" +#include "osal/preproc.h" + +/********************** + File utilities + **********************/ + +file_status_t read_from_file(const char *filename, void *data, size_t size) +{ + FILE *f = fopen(filename, "rb"); + if (f == NULL) + { + return file_open_error; + } + + if (fread(data, 1, size, f) != size) + { + fclose(f); + return file_read_error; + } + + fclose(f); + return file_ok; +} + +file_status_t write_to_file(const char *filename, const void *data, size_t size) +{ + FILE *f = fopen(filename, "wb"); + if (f == NULL) + { + return file_open_error; + } + + if (fwrite(data, 1, size, f) != size) + { + fclose(f); + return file_read_error; + } + + fclose(f); + return file_ok; +} + +/********************** + Byte swap utilities + **********************/ +void swap_buffer(void *buffer, size_t length, size_t count) +{ + size_t i; + if (length == 2) + { + unsigned short *pun = (unsigned short *)buffer; + for (i = 0; i < count; i++) + pun[i] = m64p_swap16(pun[i]); + } + else if (length == 4) + { + unsigned int *pun = (unsigned int *)buffer; + for (i = 0; i < count; i++) + pun[i] = m64p_swap32(pun[i]); + } + else if (length == 8) + { + unsigned long long *pun = (unsigned long long *)buffer; + for (i = 0; i < count; i++) + pun[i] = m64p_swap64(pun[i]); + } +} + +void to_little_endian_buffer(void *buffer, size_t length, size_t count) +{ + #ifdef M64P_BIG_ENDIAN + swap_buffer(buffer, length, count); + #endif +} + +void to_big_endian_buffer(void *buffer, size_t length, size_t count) +{ + #ifndef M64P_BIG_ENDIAN + swap_buffer(buffer, length, count); + #endif +} + +/********************** + GUI utilities + **********************/ +void countrycodestring(char countrycode, char *string) +{ + switch (countrycode) + { + case 0: /* Demo */ + strcpy(string, "Demo"); + break; + + case '7': /* Beta */ + strcpy(string, "Beta"); + break; + + case 0x41: /* Japan / USA */ + strcpy(string, "USA/Japan"); + break; + + case 0x44: /* Germany */ + strcpy(string, "Germany"); + break; + + case 0x45: /* USA */ + strcpy(string, "USA"); + break; + + case 0x46: /* France */ + strcpy(string, "France"); + break; + + case 'I': /* Italy */ + strcpy(string, "Italy"); + break; + + case 0x4A: /* Japan */ + strcpy(string, "Japan"); + break; + + case 'S': /* Spain */ + strcpy(string, "Spain"); + break; + + case 0x55: case 0x59: /* Australia */ + sprintf(string, "Australia (0x%02X)", countrycode); + break; + + case 0x50: case 0x58: case 0x20: + case 0x21: case 0x38: case 0x70: + sprintf(string, "Europe (0x%02X)", countrycode); + break; + + default: + sprintf(string, "Unknown (0x%02X)", countrycode); + break; + } +} + +void imagestring(unsigned char imagetype, char *string) +{ + switch (imagetype) + { + case Z64IMAGE: + strcpy(string, ".z64 (native)"); + break; + case V64IMAGE: + strcpy(string, ".v64 (byteswapped)"); + break; + case N64IMAGE: + strcpy(string, ".n64 (wordswapped)"); + break; + default: + string[0] = '\0'; + } +} + +/********************** + Path utilities + **********************/ + +/* Looks for an instance of ANY of the characters in 'needles' in 'haystack', + * starting from the end of 'haystack'. Returns a pointer to the last position + * of some character on 'needles' on 'haystack'. If not found, returns NULL. + */ +static const char* strpbrk_reverse(const char* needles, const char* haystack) +{ + size_t stringlength = strlen(haystack), counter; + + for (counter = stringlength; counter > 0; --counter) + { + if (strchr(needles, haystack[counter-1])) + break; + } + + if (counter == 0) + return NULL; + + return haystack + counter - 1; +} + +const char* namefrompath(const char* path) +{ + const char* last_separator_ptr = strpbrk_reverse(OSAL_DIR_SEPARATORS, path); + + if (last_separator_ptr != NULL) + return last_separator_ptr + 1; + else + return path; +} + +static int is_path_separator(char c) +{ + return strchr(OSAL_DIR_SEPARATORS, c) != NULL; +} + +char* combinepath(const char* first, const char *second) +{ + size_t len_first = strlen(first), off_second = 0; + + if (first == NULL || second == NULL) + return NULL; + + while (is_path_separator(first[len_first-1])) + len_first--; + + while (is_path_separator(second[off_second])) + off_second++; + + return formatstr("%.*s%c%s", (int) len_first, first, OSAL_DIR_SEPARATORS[0], second + off_second); +} + +/********************** + String utilities + **********************/ +char *trim(char *str) +{ + char *start = str, *end = str + strlen(str); + + while (start < end && isspace(*start)) + start++; + + while (end > start && isspace(*(end-1))) + end--; + + memmove(str, start, end - start); + str[end - start] = '\0'; + + return str; +} + +int string_to_int(const char *str, int *result) +{ + char *endptr; + long int n; + if (*str == '\0' || isspace(*str)) + return 0; + errno = 0; + n = strtol(str, &endptr, 10); + if (*endptr != '\0' || errno != 0 || n < INT_MIN || n > INT_MAX) + return 0; + *result = (int)n; + return 1; +} + +static unsigned char char2hex(char c) +{ + c = tolower(c); + if(c >= '0' && c <= '9') + return c - '0'; + else if(c >= 'a' && c <= 'f') + return c - 'a' + 10; + else + return 0xFF; +} + +int parse_hex(const char *str, unsigned char *output, size_t output_size) +{ + size_t i, j; + for (i = 0; i < output_size; i++) + { + output[i] = 0; + for (j = 0; j < 2; j++) + { + unsigned char h = char2hex(*str++); + if (h == 0xFF) + return 0; + + output[i] = (output[i] << 4) | h; + } + } + + if (*str != '\0') + return 0; + + return 1; +} + +char *formatstr(const char *fmt, ...) +{ + int size = 128, ret; + char *str = (char *)malloc(size), *newstr; + va_list args; + + /* There are two implementations of vsnprintf we have to deal with: + * C99 version: Returns the number of characters which would have been written + * if the buffer had been large enough, and -1 on failure. + * Windows version: Returns the number of characters actually written, + * and -1 on failure or truncation. + * NOTE: An implementation equivalent to the Windows one appears in glibc <2.1. + */ + while (str != NULL) + { + va_start(args, fmt); + ret = vsnprintf(str, size, fmt, args); + va_end(args); + + // Successful result? + if (ret >= 0 && ret < size) + return str; + + // Increment the capacity of the buffer + if (ret >= size) + size = ret + 1; // C99 version: We got the needed buffer size + else + size *= 2; // Windows version: Keep guessing + + newstr = (char *)realloc(str, size); + if (newstr == NULL) + free(str); + str = newstr; + } + + return NULL; +} + +ini_line ini_parse_line(char **lineptr) +{ + char *line = *lineptr, *endline = strchr(*lineptr, '\n'), *equal; + ini_line l; + + // Null terminate the current line and point to the next line + if (endline != NULL) + *endline = '\0'; + *lineptr = line + strlen(line) + 1; + + // Parse the line contents + trim(line); + + if (line[0] == '#' || line[0] == ';') + { + line++; + + l.type = INI_COMMENT; + l.name = NULL; + l.value = trim(line); + } + else if (line[0] == '[' && line[strlen(line)-1] == ']') + { + line[strlen(line)-1] = '\0'; + line++; + + l.type = INI_SECTION; + l.name = trim(line); + l.value = NULL; + } + else if ((equal = strchr(line, '=')) != NULL) + { + char *name = line, *value = equal + 1; + *equal = '\0'; + + l.type = INI_PROPERTY; + l.name = trim(name); + l.value = trim(value); + } + else + { + l.type = (*line == '\0') ? INI_BLANK : INI_TRASH; + l.name = NULL; + l.value = NULL; + } + + return l; +} diff --git a/libmupen64plus/mupen64plus-core/src/main/util.h b/libmupen64plus/mupen64plus-core/src/main/util.h new file mode 100644 index 0000000000..46b05607f0 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/util.h @@ -0,0 +1,212 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - util.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2012 CasualJames * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __UTIL_H__ +#define __UTIL_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/********************** + File utilities + **********************/ + +typedef enum _file_status +{ + file_ok, + file_open_error, + file_read_error, + file_write_error +} file_status_t; + +/** read_from_file + * opens a file and reads the specified number of bytes. + * returns zero on success, nonzero on failure + */ +file_status_t read_from_file(const char *filename, void *data, size_t size); + +/** write_to_file + * opens a file and writes the specified number of bytes. + * returns zero on sucess, nonzero on failure + */ +file_status_t write_to_file(const char *filename, const void *data, size_t size); + +/********************** + Byte swap utilities + **********************/ +#ifdef _MSC_VER +#include +#endif + +/* GCC has also byte swap intrinsics (__builtin_bswap32, etc.), but they were + * added in relatively recent versions. In addition, GCC can detect the byte + * swap code and optimize it with a high enough optimization level. */ + +static inline unsigned short m64p_swap16(unsigned short x) +{ + #ifdef _MSC_VER + return _byteswap_ushort(x); + #else + return ((x & 0x00FF) << 8) | + ((x & 0xFF00) >> 8); + #endif +} + +static inline unsigned int m64p_swap32(unsigned int x) +{ + #ifdef _MSC_VER + return _byteswap_ulong(x); // long is always 32-bit in Windows + #else + return ((x & 0x000000FF) << 24) | + ((x & 0x0000FF00) << 8) | + ((x & 0x00FF0000) >> 8) | + ((x & 0xFF000000) >> 24); + #endif +} + +static inline unsigned long long int m64p_swap64(unsigned long long int x) +{ + #ifdef _MSC_VER + return _byteswap_uint64(x); + #else + return ((x & 0x00000000000000FFULL) << 56) | + ((x & 0x000000000000FF00ULL) << 40) | + ((x & 0x0000000000FF0000ULL) << 24) | + ((x & 0x00000000FF000000ULL) << 8) | + ((x & 0x000000FF00000000ULL) >> 8) | + ((x & 0x0000FF0000000000ULL) >> 24) | + ((x & 0x00FF000000000000ULL) >> 40) | + ((x & 0xFF00000000000000ULL) >> 56); + #endif +} + +#ifdef M64P_BIG_ENDIAN +#define big16(x) (x) +#define big32(x) (x) +#define big64(x) (x) +#define little16(x) m64p_swap16(x) +#define little32(x) m64p_swap32(x) +#define little64(x) m64p_swap64(x) +#else +#define big16(x) m64p_swap16(x) +#define big32(x) m64p_swap32(x) +#define big64(x) m64p_swap64(x) +#define little16(x) (x) +#define little32(x) (x) +#define little64(x) (x) +#endif + +/* Byte swaps, converts to little endian or converts to big endian a buffer, + * containing 'count' elements, each of size 'length'. */ +void swap_buffer(void *buffer, size_t length, size_t count); +void to_little_endian_buffer(void *buffer, size_t length, size_t count); +void to_big_endian_buffer(void *buffer, size_t length, size_t count); + +/********************** + GUI utilities + **********************/ +void countrycodestring(char countrycode, char *string); +void imagestring(unsigned char imagetype, char *string); + +/********************** + Path utilities + **********************/ + +/* Extracts the full file name (with extension) from a path string. + * Returns the same string, advanced until the file name. */ +const char* namefrompath(const char* path); + +/* Creates a path string by joining two path strings. + * The given path strings may or may not start or end with a path separator. + * Returns a malloc'd string with the resulting path. */ +char* combinepath(const char* first, const char *second); + +/********************** + String utilities + **********************/ + +/** trim + * Removes leading and trailing whitespace from str. Function modifies str + * and also returns modified string. + */ +char *trim(char *str); + +/* Converts an string to an integer. + * Returns 1 on success, 0 on failure. 'result' is undefined on failure. + * + * The following conditions cause this function to fail: + * - Empty string + * - Leading characters (including whitespace) + * - Trailing characters (including whitespace) + * - Overflow or underflow. + */ +int string_to_int(const char *str, int *result); + +/* Converts an string of hexadecimal characters to a byte array. + * 'output_size' is the number of bytes (hex digraphs) to convert. + * Returns 1 on success, 0 on failure. 'output' is undefined on failure. */ +int parse_hex(const char *str, unsigned char *output, size_t output_size); + +/* Formats an string, using the same syntax as printf. + * Returns the result in a malloc'd string. */ +char* formatstr(const char* fmt, ...); + +typedef enum _ini_line_type +{ + INI_BLANK, + INI_COMMENT, + INI_SECTION, + INI_PROPERTY, + INI_TRASH +} ini_line_type; + +typedef struct _ini_line +{ + ini_line_type type; + char *name; + char *value; +} ini_line; + +/* Parses the INI file line pointer by 'lineptr'. + * The first line pointed by 'lineptr' may be modifed. + * 'lineptr' will point to the next line after this function runs. + * + * Returns a ini_line structure with information about the line. + * For INI_COMMENT, the value field contains the comment. + * For INI_SECTION, the name field contains the section name. + * For INI_PROPERTY, the name and value fields contain the property parameters. + * The line type is INI_BLANK if the line is blank or invalid. + * + * The name and value fields (if any) of ini_line point to 'lineptr' + * (so their lifetime is associated to that of 'lineptr'). + */ +ini_line ini_parse_line(char **lineptr); + +#ifdef __cplusplus +} +#endif + +#endif // __UTIL_H__ + diff --git a/libmupen64plus/mupen64plus-core/src/main/version.h b/libmupen64plus/mupen64plus-core/src/main/version.h new file mode 100644 index 0000000000..59f3b1c382 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/version.h @@ -0,0 +1,39 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* Mupen64plus - version.h * +* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * +* Copyright (C) 2008-2012 Richard42 DarkJeztr Tillin9 * +* * +* 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. * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* Version macros automatically replaced by Makefiles. */ + +#ifndef __VERSION_H__ +#define __VERSION_H__ + +#define MUPEN_CORE_NAME "Mupen64Plus Core" +#define MUPEN_CORE_VERSION 0x016305 + +#define FRONTEND_API_VERSION 0x020100 +#define CONFIG_API_VERSION 0x020200 +#define DEBUG_API_VERSION 0x020000 +#define VIDEXT_API_VERSION 0x020000 + +#define VERSION_PRINTF_SPLIT(x) (((x) >> 16) & 0xffff), (((x) >> 8) & 0xff), ((x) & 0xff) + +#endif /* __VERSION_H__ */ + + diff --git a/libmupen64plus/mupen64plus-core/src/main/workqueue.c b/libmupen64plus/mupen64plus-core/src/main/workqueue.c new file mode 100644 index 0000000000..bd969bfda6 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/workqueue.c @@ -0,0 +1,185 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - util.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2012 Mupen64plus development team * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "workqueue.h" +#include "api/callbacks.h" + +#include +#include + +#define WORKQUEUE_THREADS 1 + +struct workqueue_mgmt_globals { + struct list_head work_queue; + struct list_head thread_queue; + struct list_head thread_list; + SDL_mutex *lock; +}; + +struct workqueue_thread { + SDL_Thread *thread; + SDL_cond *work_avail; + struct list_head list; + struct list_head list_mgmt; +}; + +static struct workqueue_mgmt_globals workqueue_mgmt; + +static void workqueue_dismiss(struct work_struct *work) +{ +} + +static struct work_struct *workqueue_get_work(struct workqueue_thread *thread) +{ + int found = 0; + struct work_struct *work; + + while (1) { + SDL_LockMutex(workqueue_mgmt.lock); + list_del_init(&thread->list); + if (!list_empty(&workqueue_mgmt.work_queue)) { + found = 1; + work = list_first_entry(&workqueue_mgmt.work_queue, struct work_struct, list); + list_del_init(&work->list); + } else { + list_add(&thread->list, &workqueue_mgmt.thread_queue); + SDL_CondWait(thread->work_avail, workqueue_mgmt.lock); + } + SDL_UnlockMutex(workqueue_mgmt.lock); + + if (found) + break; + } + + return work; +} + +static int workqueue_thread_handler(void *data) +{ + struct workqueue_thread *thread = data; + struct work_struct *work; + + while (1) { + work = workqueue_get_work(thread); + if (work->func == workqueue_dismiss) { + free(work); + break; + } + + work->func(work); + } + + return 0; +} + +int workqueue_init(void) +{ + size_t i; + struct workqueue_thread *thread; + + memset(&workqueue_mgmt, 0, sizeof(workqueue_mgmt)); + INIT_LIST_HEAD(&workqueue_mgmt.work_queue); + INIT_LIST_HEAD(&workqueue_mgmt.thread_queue); + INIT_LIST_HEAD(&workqueue_mgmt.thread_list); + + workqueue_mgmt.lock = SDL_CreateMutex(); + if (!workqueue_mgmt.lock) { + DebugMessage(M64MSG_ERROR, "Could not create workqueue management"); + return -1; + } + + SDL_LockMutex(workqueue_mgmt.lock); + for (i = 0; i < WORKQUEUE_THREADS; i++) { + thread = malloc(sizeof(*thread)); + if (!thread) { + DebugMessage(M64MSG_ERROR, "Could not create workqueue thread management data"); + SDL_UnlockMutex(workqueue_mgmt.lock); + return -1; + } + + memset(thread, 0, sizeof(*thread)); + list_add(&thread->list_mgmt, &workqueue_mgmt.thread_list); + INIT_LIST_HEAD(&thread->list); + thread->work_avail = SDL_CreateCond(); + if (!thread->work_avail) { + DebugMessage(M64MSG_ERROR, "Could not create workqueue thread work_avail condition"); + SDL_UnlockMutex(workqueue_mgmt.lock); + return -1; + } + +#if SDL_VERSION_ATLEAST(2,0,0) + thread->thread = SDL_CreateThread(workqueue_thread_handler, "m64pwq", thread); +#else + thread->thread = SDL_CreateThread(workqueue_thread_handler, thread); +#endif + if (!thread->thread) { + DebugMessage(M64MSG_ERROR, "Could not create workqueue thread handler"); + SDL_UnlockMutex(workqueue_mgmt.lock); + return -1; + } + } + SDL_UnlockMutex(workqueue_mgmt.lock); + + return 0; +} + +void workqueue_shutdown(void) +{ + size_t i; + int status; + struct work_struct *work; + struct workqueue_thread *thread, *safe; + + for (i = 0; i < WORKQUEUE_THREADS; i++) { + work = malloc(sizeof(*work)); + init_work(work, workqueue_dismiss); + queue_work(work); + } + + list_for_each_entry_safe(thread, safe, &workqueue_mgmt.thread_list, struct workqueue_thread, list_mgmt) { + list_del(&thread->list_mgmt); + SDL_WaitThread(thread->thread, &status); + SDL_DestroyCond(thread->work_avail); + free(thread); + } + + if (!list_empty(&workqueue_mgmt.work_queue)) + DebugMessage(M64MSG_WARNING, "Stopped workqueue with work still pending"); + + SDL_DestroyMutex(workqueue_mgmt.lock); +} + +int queue_work(struct work_struct *work) +{ + struct workqueue_thread *thread; + + SDL_LockMutex(workqueue_mgmt.lock); + list_add_tail(&work->list, &workqueue_mgmt.work_queue); + if (!list_empty(&workqueue_mgmt.thread_queue)) { + thread = list_first_entry(&workqueue_mgmt.thread_queue, struct workqueue_thread, list); + list_del_init(&thread->list); + + SDL_CondSignal(thread->work_avail); + } + SDL_UnlockMutex(workqueue_mgmt.lock); + + return 0; +} diff --git a/libmupen64plus/mupen64plus-core/src/main/workqueue.h b/libmupen64plus/mupen64plus-core/src/main/workqueue.h new file mode 100644 index 0000000000..f6bc18666a --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/workqueue.h @@ -0,0 +1,65 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - util.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2012 Mupen64plus development team * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __WORKQUEUE_H__ +#define __WORKQUEUE_H__ + +#include "list.h" + +struct work_struct *work; +typedef void (*work_func_t)(struct work_struct *work); +struct work_struct { + work_func_t func; + struct list_head list; +}; + +static inline void init_work(struct work_struct *work, work_func_t func) +{ + INIT_LIST_HEAD(&work->list); + work->func = func; +} + +#ifdef M64P_PARALLEL + +int workqueue_init(void); +void workqueue_shutdown(void); +int queue_work(struct work_struct *work); + +#else + +static inline int workqueue_init(void) +{ + return 0; +} + +static inline void workqueue_shutdown(void) +{ +} + +static inline int queue_work(struct work_struct *work) +{ + work->func(work); + return 0; +} + +#endif + +#endif diff --git a/libmupen64plus/mupen64plus-core/src/main/zip/crypt.h b/libmupen64plus/mupen64plus-core/src/main/zip/crypt.h new file mode 100644 index 0000000000..a01d08d932 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/zip/crypt.h @@ -0,0 +1,131 @@ +/* crypt.h -- base code for crypt/uncrypt ZIPfile + + + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant + + This code is a modified version of crypting code in Infozip distribution + + The encryption/decryption parts of this source code (as opposed to the + non-echoing password parts) were originally written in Europe. The + whole source package can be freely distributed, including from the USA. + (Prior to January 2000, re-export from the US was a violation of US law.) + + This encryption code is a direct transcription of the algorithm from + Roger Schlafly, described by Phil Katz in the file appnote.txt. This + file (appnote.txt) is distributed with the PKZIP program (even in the + version without encryption capabilities). + + If you don't need crypting in your application, just define symbols + NOCRYPT and NOUNCRYPT. + + This code support the "Traditional PKWARE Encryption". + + The new AES encryption added on Zip format by Winzip (see the page + http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong + Encryption is not supported. +*/ + +#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) + +/*********************************************************************** + * Return the next byte in the pseudo-random sequence + */ +static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab) +{ + unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an + * unpredictable manner on 16-bit systems; not a problem + * with any known compiler so far, though */ + + temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; + return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); +} + +/*********************************************************************** + * Update the encryption keys with the next byte of plain text + */ +static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c) +{ + (*(pkeys+0)) = CRC32((*(pkeys+0)), c); + (*(pkeys+1)) += (*(pkeys+0)) & 0xff; + (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; + { + register int keyshift = (int)((*(pkeys+1)) >> 24); + (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); + } + return c; +} + + +/*********************************************************************** + * Initialize the encryption keys and the random header according to + * the given password. + */ +static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab) +{ + *(pkeys+0) = 305419896L; + *(pkeys+1) = 591751049L; + *(pkeys+2) = 878082192L; + while (*passwd != '\0') { + update_keys(pkeys,pcrc_32_tab,(int)*passwd); + passwd++; + } +} + +#define zdecode(pkeys,pcrc_32_tab,c) \ + (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) + +#define zencode(pkeys,pcrc_32_tab,c,t) \ + (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) + +#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED + +#define RAND_HEAD_LEN 12 + /* "last resort" source for second part of crypt seed pattern */ +# ifndef ZCR_SEED2 +# define ZCR_SEED2 3141592654UL /* use PI as default pattern */ +# endif + +static int crypthead(const char* passwd, /* password string */ + unsigned char* buf, /* where to write header */ + int bufSize, + unsigned long* pkeys, + const unsigned long* pcrc_32_tab, + unsigned long crcForCrypting) +{ + int n; /* index in random header */ + int t; /* temporary */ + int c; /* random byte */ + unsigned char header[RAND_HEAD_LEN-2]; /* random header */ + static unsigned calls = 0; /* ensure different random header each time */ + + if (bufSize> 7) & 0xff; + header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t); + } + /* Encrypt random header (last two bytes is high word of crc) */ + init_keys(passwd, pkeys, pcrc_32_tab); + for (n = 0; n < RAND_HEAD_LEN-2; n++) + { + buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); + } + buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); + buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); + return n; +} + +#endif diff --git a/libmupen64plus/mupen64plus-core/src/main/zip/ioapi.c b/libmupen64plus/mupen64plus-core/src/main/zip/ioapi.c new file mode 100644 index 0000000000..7f5c191b2a --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/zip/ioapi.c @@ -0,0 +1,247 @@ +/* ioapi.h -- IO base function header for compress/uncompress .zip + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications for Zip64 support + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + +*/ + +#if defined(_WIN32) && (!(defined(_CRT_SECURE_NO_WARNINGS))) + #define _CRT_SECURE_NO_WARNINGS +#endif + +#if defined(__APPLE__) || defined(IOAPI_NO_64) +// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions +#define FOPEN_FUNC(filename, mode) fopen(filename, mode) +#define FTELLO_FUNC(stream) ftello(stream) +#define FSEEKO_FUNC(stream, offset, origin) fseeko(stream, offset, origin) +#else +#define FOPEN_FUNC(filename, mode) fopen64(filename, mode) +#define FTELLO_FUNC(stream) ftello64(stream) +#define FSEEKO_FUNC(stream, offset, origin) fseeko64(stream, offset, origin) +#endif + + +#include "ioapi.h" + +voidpf call_zopen64 (const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode) +{ + if (pfilefunc->zfile_func64.zopen64_file != NULL) + return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque,filename,mode); + else + { + return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque,(const char*)filename,mode); + } +} + +long call_zseek64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin) +{ + if (pfilefunc->zfile_func64.zseek64_file != NULL) + return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque,filestream,offset,origin); + else + { + uLong offsetTruncated = (uLong)offset; + if (offsetTruncated != offset) + return -1; + else + return (*(pfilefunc->zseek32_file))(pfilefunc->zfile_func64.opaque,filestream,offsetTruncated,origin); + } +} + +ZPOS64_T call_ztell64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream) +{ + if (pfilefunc->zfile_func64.zseek64_file != NULL) + return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream); + else + { + uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream); + if ((tell_uLong) == MAXU32) + return (ZPOS64_T)-1; + else + return tell_uLong; + } +} + +void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32) +{ + p_filefunc64_32->zfile_func64.zopen64_file = NULL; + p_filefunc64_32->zopen32_file = p_filefunc32->zopen_file; + p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; + p_filefunc64_32->zfile_func64.zread_file = p_filefunc32->zread_file; + p_filefunc64_32->zfile_func64.zwrite_file = p_filefunc32->zwrite_file; + p_filefunc64_32->zfile_func64.ztell64_file = NULL; + p_filefunc64_32->zfile_func64.zseek64_file = NULL; + p_filefunc64_32->zfile_func64.zclose_file = p_filefunc32->zclose_file; + p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; + p_filefunc64_32->zfile_func64.opaque = p_filefunc32->opaque; + p_filefunc64_32->zseek32_file = p_filefunc32->zseek_file; + p_filefunc64_32->ztell32_file = p_filefunc32->ztell_file; +} + + + +static voidpf ZCALLBACK fopen_file_func OF((voidpf opaque, const char* filename, int mode)); +static uLong ZCALLBACK fread_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size)); +static uLong ZCALLBACK fwrite_file_func OF((voidpf opaque, voidpf stream, const void* buf,uLong size)); +static ZPOS64_T ZCALLBACK ftell64_file_func OF((voidpf opaque, voidpf stream)); +static long ZCALLBACK fseek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); +static int ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream)); +static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream)); + +static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode) +{ + FILE* file = NULL; + const char* mode_fopen = NULL; + if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) + mode_fopen = "rb"; + else + if (mode & ZLIB_FILEFUNC_MODE_EXISTING) + mode_fopen = "r+b"; + else + if (mode & ZLIB_FILEFUNC_MODE_CREATE) + mode_fopen = "wb"; + + if ((filename!=NULL) && (mode_fopen != NULL)) + file = fopen(filename, mode_fopen); + return file; +} + +static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode) +{ + FILE* file = NULL; + const char* mode_fopen = NULL; + if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) + mode_fopen = "rb"; + else + if (mode & ZLIB_FILEFUNC_MODE_EXISTING) + mode_fopen = "r+b"; + else + if (mode & ZLIB_FILEFUNC_MODE_CREATE) + mode_fopen = "wb"; + + if ((filename!=NULL) && (mode_fopen != NULL)) + file = FOPEN_FUNC((const char*)filename, mode_fopen); + return file; +} + + +static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size) +{ + uLong ret; + ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); + return ret; +} + +static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size) +{ + uLong ret; + ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); + return ret; +} + +static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream) +{ + long ret; + ret = ftell((FILE *)stream); + return ret; +} + + +static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream) +{ + ZPOS64_T ret; + ret = FTELLO_FUNC((FILE *)stream); + return ret; +} + +static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin) +{ + int fseek_origin=0; + long ret; + switch (origin) + { + case ZLIB_FILEFUNC_SEEK_CUR : + fseek_origin = SEEK_CUR; + break; + case ZLIB_FILEFUNC_SEEK_END : + fseek_origin = SEEK_END; + break; + case ZLIB_FILEFUNC_SEEK_SET : + fseek_origin = SEEK_SET; + break; + default: return -1; + } + ret = 0; + if (fseek((FILE *)stream, offset, fseek_origin) != 0) + ret = -1; + return ret; +} + +static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin) +{ + int fseek_origin=0; + long ret; + switch (origin) + { + case ZLIB_FILEFUNC_SEEK_CUR : + fseek_origin = SEEK_CUR; + break; + case ZLIB_FILEFUNC_SEEK_END : + fseek_origin = SEEK_END; + break; + case ZLIB_FILEFUNC_SEEK_SET : + fseek_origin = SEEK_SET; + break; + default: return -1; + } + ret = 0; + + if(FSEEKO_FUNC((FILE *)stream, offset, fseek_origin) != 0) + ret = -1; + + return ret; +} + + +static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream) +{ + int ret; + ret = fclose((FILE *)stream); + return ret; +} + +static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream) +{ + int ret; + ret = ferror((FILE *)stream); + return ret; +} + +void fill_fopen_filefunc (pzlib_filefunc_def) + zlib_filefunc_def* pzlib_filefunc_def; +{ + pzlib_filefunc_def->zopen_file = fopen_file_func; + pzlib_filefunc_def->zread_file = fread_file_func; + pzlib_filefunc_def->zwrite_file = fwrite_file_func; + pzlib_filefunc_def->ztell_file = ftell_file_func; + pzlib_filefunc_def->zseek_file = fseek_file_func; + pzlib_filefunc_def->zclose_file = fclose_file_func; + pzlib_filefunc_def->zerror_file = ferror_file_func; + pzlib_filefunc_def->opaque = NULL; +} + +void fill_fopen64_filefunc (zlib_filefunc64_def* pzlib_filefunc_def) +{ + pzlib_filefunc_def->zopen64_file = fopen64_file_func; + pzlib_filefunc_def->zread_file = fread_file_func; + pzlib_filefunc_def->zwrite_file = fwrite_file_func; + pzlib_filefunc_def->ztell64_file = ftell64_file_func; + pzlib_filefunc_def->zseek64_file = fseek64_file_func; + pzlib_filefunc_def->zclose_file = fclose_file_func; + pzlib_filefunc_def->zerror_file = ferror_file_func; + pzlib_filefunc_def->opaque = NULL; +} diff --git a/libmupen64plus/mupen64plus-core/src/main/zip/ioapi.h b/libmupen64plus/mupen64plus-core/src/main/zip/ioapi.h new file mode 100644 index 0000000000..4c6b5fb40c --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/zip/ioapi.h @@ -0,0 +1,212 @@ +/* ioapi.h -- IO base function header for compress/uncompress .zip + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications for Zip64 support + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + + Changes + + Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this) + Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux. + More if/def section may be needed to support other platforms + Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows. + (but you should use iowin32.c for windows instead) + +*/ + +#ifndef _ZLIBIOAPI64_H +#define _ZLIBIOAPI64_H + +#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) + + // Linux needs this to support file operation on files larger then 4+GB + // But might need better if/def to select just the platforms that needs them. + + #ifndef __USE_FILE_OFFSET64 + #define __USE_FILE_OFFSET64 + #endif + #ifndef __USE_LARGEFILE64 + #define __USE_LARGEFILE64 + #endif + #ifndef _LARGEFILE64_SOURCE + #define _LARGEFILE64_SOURCE + #endif + #ifndef _FILE_OFFSET_BIT + #define _FILE_OFFSET_BIT 64 + #endif + +#endif + +#include +#include +#include "zlib.h" + +#ifndef OF +#define OF _Z_OF +#endif + +#if defined(USE_FILE32API) +#define fopen64 fopen +#define ftello64 ftell +#define fseeko64 fseek +#else +#ifdef __FreeBSD__ +#define fopen64 fopen +#define ftello64 ftello +#define fseeko64 fseeko +#endif +#ifdef _MSC_VER + #define fopen64 fopen + #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC))) + #define ftello64 _ftelli64 + #define fseeko64 _fseeki64 + #else // old MSC + #define ftello64 ftell + #define fseeko64 fseek + #endif +#endif +#endif + +/* +#ifndef ZPOS64_T + #ifdef _WIN32 + #define ZPOS64_T fpos_t + #else + #include + #define ZPOS64_T uint64_t + #endif +#endif +*/ + +#ifdef HAVE_MINIZIP64_CONF_H +#include "mz64conf.h" +#endif + +/* a type choosen by DEFINE */ +#ifdef HAVE_64BIT_INT_CUSTOM +typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; +#else +#ifdef HAS_STDINT_H +#include "stdint.h" +typedef uint64_t ZPOS64_T; +#else + +/* Maximum unsigned 32-bit value used as placeholder for zip64 */ +#define MAXU32 0xffffffff + +#if defined(_MSC_VER) || defined(__BORLANDC__) +typedef unsigned __int64 ZPOS64_T; +#else +typedef unsigned long long int ZPOS64_T; +#endif +#endif +#endif + + + +#ifdef __cplusplus +extern "C" { +#endif + + +#define ZLIB_FILEFUNC_SEEK_CUR (1) +#define ZLIB_FILEFUNC_SEEK_END (2) +#define ZLIB_FILEFUNC_SEEK_SET (0) + +#define ZLIB_FILEFUNC_MODE_READ (1) +#define ZLIB_FILEFUNC_MODE_WRITE (2) +#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) + +#define ZLIB_FILEFUNC_MODE_EXISTING (4) +#define ZLIB_FILEFUNC_MODE_CREATE (8) + + +#ifndef ZCALLBACK + #if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) + #define ZCALLBACK CALLBACK + #else + #define ZCALLBACK + #endif +#endif + + + + +typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); +typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); +typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); +typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); +typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); + +typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); +typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); + + +/* here is the "old" 32 bits structure structure */ +typedef struct zlib_filefunc_def_s +{ + open_file_func zopen_file; + read_file_func zread_file; + write_file_func zwrite_file; + tell_file_func ztell_file; + seek_file_func zseek_file; + close_file_func zclose_file; + testerror_file_func zerror_file; + voidpf opaque; +} zlib_filefunc_def; + +typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream)); +typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); +typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode)); + +typedef struct zlib_filefunc64_def_s +{ + open64_file_func zopen64_file; + read_file_func zread_file; + write_file_func zwrite_file; + tell64_file_func ztell64_file; + seek64_file_func zseek64_file; + close_file_func zclose_file; + testerror_file_func zerror_file; + voidpf opaque; +} zlib_filefunc64_def; + +void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def)); +void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); + +/* now internal definition, only for zip.c and unzip.h */ +typedef struct zlib_filefunc64_32_def_s +{ + zlib_filefunc64_def zfile_func64; + open_file_func zopen32_file; + tell_file_func ztell32_file; + seek_file_func zseek32_file; +} zlib_filefunc64_32_def; + + +#define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) +#define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) +//#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream)) +//#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode)) +#define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream)) +#define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream)) + +voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode)); +long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin)); +ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream)); + +void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32); + +#define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode))) +#define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream))) +#define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode))) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/libmupen64plus/mupen64plus-core/src/main/zip/unzip.c b/libmupen64plus/mupen64plus-core/src/main/zip/unzip.c new file mode 100644 index 0000000000..affad4bfeb --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/zip/unzip.c @@ -0,0 +1,2125 @@ +/* unzip.c -- IO for uncompress .zip files using zlib + Version 1.1, February 14h, 2010 + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications of Unzip for Zip64 + Copyright (C) 2007-2008 Even Rouault + + Modifications for Zip64 support on both zip and unzip + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + + + ------------------------------------------------------------------------------------ + Decryption code comes from crypt.c by Info-ZIP but has been greatly reduced in terms of + compatibility with older software. The following is from the original crypt.c. + Code woven in by Terry Thorsen 1/2003. + + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html + + crypt.c (full version) by Info-ZIP. Last revised: [see crypt.h] + + The encryption/decryption parts of this source code (as opposed to the + non-echoing password parts) were originally written in Europe. The + whole source package can be freely distributed, including from the USA. + (Prior to January 2000, re-export from the US was a violation of US law.) + + This encryption code is a direct transcription of the algorithm from + Roger Schlafly, described by Phil Katz in the file appnote.txt. This + file (appnote.txt) is distributed with the PKZIP program (even in the + version without encryption capabilities). + + ------------------------------------------------------------------------------------ + + Changes in unzip.c + + 2007-2008 - Even Rouault - Addition of cpl_unzGetCurrentFileZStreamPos + 2007-2008 - Even Rouault - Decoration of symbol names unz* -> cpl_unz* + 2007-2008 - Even Rouault - Remove old C style function prototypes + 2007-2008 - Even Rouault - Add unzip support for ZIP64 + + Copyright (C) 2007-2008 Even Rouault + + + Oct-2009 - Mathias Svensson - Removed cpl_* from symbol names (Even Rouault added them but since this is now moved to a new project (minizip64) I renamed them again). + Oct-2009 - Mathias Svensson - Fixed problem if uncompressed size was > 4G and compressed size was <4G + should only read the compressed/uncompressed size from the Zip64 format if + the size from normal header was 0xFFFFFFFF + Oct-2009 - Mathias Svensson - Applied some bug fixes from paches recived from Gilles Vollant + Oct-2009 - Mathias Svensson - Applied support to unzip files with compression mathod BZIP2 (bzip2 lib is required) + Patch created by Daniel Borca + + Jan-2010 - back to unzip and minizip 1.0 name scheme, with compatibility layer + + Copyright (C) 1998 - 2010 Gilles Vollant, Even Rouault, Mathias Svensson + +*/ + + +#include +#include +#include + +#ifndef NOUNCRYPT + #define NOUNCRYPT +#endif + +#include "zlib.h" +#include "unzip.h" + +#ifdef STDC +# include +# include +# include +#endif +#ifdef NO_ERRNO_H + extern int errno; +#else +# include +#endif + + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + + +#ifndef CASESENSITIVITYDEFAULT_NO +# if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) +# define CASESENSITIVITYDEFAULT_NO +# endif +#endif + + +#ifndef UNZ_BUFSIZE +#define UNZ_BUFSIZE (16384) +#endif + +#ifndef UNZ_MAXFILENAMEINZIP +#define UNZ_MAXFILENAMEINZIP (256) +#endif + +#ifndef ALLOC +# define ALLOC(size) (malloc(size)) +#endif +#ifndef TRYFREE +# define TRYFREE(p) {if (p) free(p);} +#endif + +#define SIZECENTRALDIRITEM (0x2e) +#define SIZEZIPLOCALHEADER (0x1e) + + +const char unz_copyright[] = + " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; + +/* unz_file_info_interntal contain internal info about a file in zipfile*/ +typedef struct unz_file_info64_internal_s +{ + ZPOS64_T offset_curfile;/* relative offset of local header 8 bytes */ +} unz_file_info64_internal; + + +/* file_in_zip_read_info_s contain internal information about a file in zipfile, + when reading and decompress it */ +typedef struct +{ + char *read_buffer; /* internal buffer for compressed data */ + z_stream stream; /* zLib stream structure for inflate */ + +#ifdef HAVE_BZIP2 + bz_stream bstream; /* bzLib stream structure for bziped */ +#endif + + ZPOS64_T pos_in_zipfile; /* position in byte on the zipfile, for fseek*/ + uLong stream_initialised; /* flag set if stream structure is initialised*/ + + ZPOS64_T offset_local_extrafield;/* offset of the local extra field */ + uInt size_local_extrafield;/* size of the local extra field */ + ZPOS64_T pos_local_extrafield; /* position in the local extra field in read*/ + ZPOS64_T total_out_64; + + uLong crc32; /* crc32 of all data uncompressed */ + uLong crc32_wait; /* crc32 we must obtain after decompress all */ + ZPOS64_T rest_read_compressed; /* number of byte to be decompressed */ + ZPOS64_T rest_read_uncompressed;/*number of byte to be obtained after decomp*/ + zlib_filefunc64_32_def z_filefunc; + voidpf filestream; /* io structore of the zipfile */ + uLong compression_method; /* compression method (0==store) */ + ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ + int raw; +} file_in_zip64_read_info_s; + + +/* unz64_s contain internal information about the zipfile +*/ +typedef struct +{ + zlib_filefunc64_32_def z_filefunc; + int is64bitOpenFunction; + voidpf filestream; /* io structore of the zipfile */ + unz_global_info64 gi; /* public global information */ + ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ + ZPOS64_T num_file; /* number of the current file in the zipfile*/ + ZPOS64_T pos_in_central_dir; /* pos of the current file in the central dir*/ + ZPOS64_T current_file_ok; /* flag about the usability of the current file*/ + ZPOS64_T central_pos; /* position of the beginning of the central dir*/ + + ZPOS64_T size_central_dir; /* size of the central directory */ + ZPOS64_T offset_central_dir; /* offset of start of central directory with + respect to the starting disk number */ + + unz_file_info64 cur_file_info; /* public info about the current file in zip*/ + unz_file_info64_internal cur_file_info_internal; /* private info about it*/ + file_in_zip64_read_info_s* pfile_in_zip_read; /* structure about the current + file if we are decompressing it */ + int encrypted; + + int isZip64; + +# ifndef NOUNCRYPT + unsigned long keys[3]; /* keys defining the pseudo-random sequence */ + const unsigned long* pcrc_32_tab; +# endif +} unz64_s; + + +#ifndef NOUNCRYPT +#include "crypt.h" +#endif + +/* =========================================================================== + Read a byte from a gz_stream; update next_in and avail_in. Return EOF + for end of file. + IN assertion: the stream s has been sucessfully opened for reading. +*/ + + +local int unz64local_getByte OF(( + const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + int *pi)); + +local int unz64local_getByte(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, int *pi) +{ + unsigned char c; + int err = (int)ZREAD64(*pzlib_filefunc_def,filestream,&c,1); + if (err==1) + { + *pi = (int)c; + return UNZ_OK; + } + else + { + if (ZERROR64(*pzlib_filefunc_def,filestream)) + return UNZ_ERRNO; + else + return UNZ_EOF; + } +} + + +/* =========================================================================== + Reads a long in LSB order from the given gz_stream. Sets +*/ +local int unz64local_getShort OF(( + const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX)); + +local int unz64local_getShort (const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX) +{ + uLong x ; + int i = 0; + int err; + + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((uLong)i)<<8; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +} + +local int unz64local_getLong OF(( + const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX)); + +local int unz64local_getLong (const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX) +{ + uLong x ; + int i = 0; + int err; + + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((uLong)i)<<8; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((uLong)i)<<16; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<24; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +} + +local int unz64local_getLong64 OF(( + const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + ZPOS64_T *pX)); + + +local int unz64local_getLong64 (const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + ZPOS64_T *pX) +{ + ZPOS64_T x ; + int i = 0; + int err; + + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x = (ZPOS64_T)i; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<8; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<16; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<24; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<32; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<40; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<48; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<56; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +} + +/* My own strcmpi / strcasecmp */ +local int strcmpcasenosensitive_internal (const char* fileName1, const char* fileName2) +{ + for (;;) + { + char c1=*(fileName1++); + char c2=*(fileName2++); + if ((c1>='a') && (c1<='z')) + c1 -= 0x20; + if ((c2>='a') && (c2<='z')) + c2 -= 0x20; + if (c1=='\0') + return ((c2=='\0') ? 0 : -1); + if (c2=='\0') + return 1; + if (c1c2) + return 1; + } +} + + +#ifdef CASESENSITIVITYDEFAULT_NO +#define CASESENSITIVITYDEFAULTVALUE 2 +#else +#define CASESENSITIVITYDEFAULTVALUE 1 +#endif + +#ifndef STRCMPCASENOSENTIVEFUNCTION +#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal +#endif + +/* + Compare two filename (fileName1,fileName2). + If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi + or strcasecmp) + If iCaseSenisivity = 0, case sensitivity is defaut of your operating system + (like 1 on Unix, 2 on Windows) + +*/ +extern int ZEXPORT unzStringFileNameCompare (const char* fileName1, + const char* fileName2, + int iCaseSensitivity) + +{ + if (iCaseSensitivity==0) + iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE; + + if (iCaseSensitivity==1) + return strcmp(fileName1,fileName2); + + return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2); +} + +#ifndef BUFREADCOMMENT +#define BUFREADCOMMENT (0x400) +#endif + +/* + Locate the Central directory of a zipfile (at the end, just before + the global comment) +*/ +local ZPOS64_T unz64local_SearchCentralDir OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream)); +local ZPOS64_T unz64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream) +{ + unsigned char* buf; + ZPOS64_T uSizeFile; + ZPOS64_T uBackRead; + ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */ + ZPOS64_T uPosFound=0; + + if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) + return 0; + + + uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream); + + if (uMaxBack>uSizeFile) + uMaxBack = uSizeFile; + + buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); + if (buf==NULL) + return 0; + + uBackRead = 4; + while (uBackReaduMaxBack) + uBackRead = uMaxBack; + else + uBackRead+=BUFREADCOMMENT; + uReadPos = uSizeFile-uBackRead ; + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos); + if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) + break; + + if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) + break; + + for (i=(int)uReadSize-3; (i--)>0;) + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && + ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) + { + uPosFound = uReadPos+i; + break; + } + + if (uPosFound!=0) + break; + } + TRYFREE(buf); + return uPosFound; +} + + +/* + Locate the Central directory 64 of a zipfile (at the end, just before + the global comment) +*/ +local ZPOS64_T unz64local_SearchCentralDir64 OF(( + const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream)); + +local ZPOS64_T unz64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream) +{ + unsigned char* buf; + ZPOS64_T uSizeFile; + ZPOS64_T uBackRead; + ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */ + ZPOS64_T uPosFound=0; + uLong uL; + ZPOS64_T relativeOffset; + + if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) + return 0; + + + uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream); + + if (uMaxBack>uSizeFile) + uMaxBack = uSizeFile; + + buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); + if (buf==NULL) + return 0; + + uBackRead = 4; + while (uBackReaduMaxBack) + uBackRead = uMaxBack; + else + uBackRead+=BUFREADCOMMENT; + uReadPos = uSizeFile-uBackRead ; + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos); + if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) + break; + + if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) + break; + + for (i=(int)uReadSize-3; (i--)>0;) + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && + ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07)) + { + uPosFound = uReadPos+i; + break; + } + + if (uPosFound!=0) + break; + } + TRYFREE(buf); + if (uPosFound == 0) + return 0; + + /* Zip64 end of central directory locator */ + if (ZSEEK64(*pzlib_filefunc_def,filestream, uPosFound,ZLIB_FILEFUNC_SEEK_SET)!=0) + return 0; + + /* the signature, already checked */ + if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) + return 0; + + /* number of the disk with the start of the zip64 end of central directory */ + if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) + return 0; + if (uL != 0) + return 0; + + /* relative offset of the zip64 end of central directory record */ + if (unz64local_getLong64(pzlib_filefunc_def,filestream,&relativeOffset)!=UNZ_OK) + return 0; + + /* total number of disks */ + if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) + return 0; + if (uL != 1) + return 0; + + /* Goto end of central directory record */ + if (ZSEEK64(*pzlib_filefunc_def,filestream, relativeOffset,ZLIB_FILEFUNC_SEEK_SET)!=0) + return 0; + + /* the signature */ + if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) + return 0; + + if (uL != 0x06064b50) + return 0; + + return relativeOffset; +} + +/* + Open a Zip file. path contain the full pathname (by example, + on a Windows NT computer "c:\\test\\zlib114.zip" or on an Unix computer + "zlib/zlib114.zip". + If the zipfile cannot be opened (file doesn't exist or in not valid), the + return value is NULL. + Else, the return value is a unzFile Handle, usable with other function + of this unzip package. +*/ +local unzFile unzOpenInternal (const void *path, + zlib_filefunc64_32_def* pzlib_filefunc64_32_def, + int is64bitOpenFunction) +{ + unz64_s us; + unz64_s *s; + ZPOS64_T central_pos; + uLong uL; + + uLong number_disk; /* number of the current dist, used for + spaning ZIP, unsupported, always 0*/ + uLong number_disk_with_CD; /* number the the disk with central dir, used + for spaning ZIP, unsupported, always 0*/ + ZPOS64_T number_entry_CD; /* total number of entries in + the central dir + (same than number_entry on nospan) */ + + int err=UNZ_OK; + + if (unz_copyright[0]!=' ') + return NULL; + + us.z_filefunc.zseek32_file = NULL; + us.z_filefunc.ztell32_file = NULL; + if (pzlib_filefunc64_32_def==NULL) + fill_fopen64_filefunc(&us.z_filefunc.zfile_func64); + else + us.z_filefunc = *pzlib_filefunc64_32_def; + us.is64bitOpenFunction = is64bitOpenFunction; + + + + us.filestream = ZOPEN64(us.z_filefunc, + path, + ZLIB_FILEFUNC_MODE_READ | + ZLIB_FILEFUNC_MODE_EXISTING); + if (us.filestream==NULL) + return NULL; + + central_pos = unz64local_SearchCentralDir64(&us.z_filefunc,us.filestream); + if (central_pos) + { + uLong uS; + ZPOS64_T uL64; + + us.isZip64 = 1; + + if (ZSEEK64(us.z_filefunc, us.filestream, + central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) + err=UNZ_ERRNO; + + /* the signature, already checked */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + + /* size of zip64 end of central directory record */ + if (unz64local_getLong64(&us.z_filefunc, us.filestream,&uL64)!=UNZ_OK) + err=UNZ_ERRNO; + + /* version made by */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&uS)!=UNZ_OK) + err=UNZ_ERRNO; + + /* version needed to extract */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&uS)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of this disk */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of the disk with the start of the central directory */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central directory on this disk */ + if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.gi.number_entry)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central directory */ + if (unz64local_getLong64(&us.z_filefunc, us.filestream,&number_entry_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + if ((number_entry_CD!=us.gi.number_entry) || + (number_disk_with_CD!=0) || + (number_disk!=0)) + err=UNZ_BADZIPFILE; + + /* size of the central directory */ + if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.size_central_dir)!=UNZ_OK) + err=UNZ_ERRNO; + + /* offset of start of central directory with respect to the + starting disk number */ + if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.offset_central_dir)!=UNZ_OK) + err=UNZ_ERRNO; + + us.gi.size_comment = 0; + } + else + { + central_pos = unz64local_SearchCentralDir(&us.z_filefunc,us.filestream); + if (central_pos==0) + err=UNZ_ERRNO; + + us.isZip64 = 0; + + if (ZSEEK64(us.z_filefunc, us.filestream, + central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) + err=UNZ_ERRNO; + + /* the signature, already checked */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of this disk */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of the disk with the start of the central directory */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central dir on this disk */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + us.gi.number_entry = uL; + + /* total number of entries in the central dir */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + number_entry_CD = uL; + + if ((number_entry_CD!=us.gi.number_entry) || + (number_disk_with_CD!=0) || + (number_disk!=0)) + err=UNZ_BADZIPFILE; + + /* size of the central directory */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + us.size_central_dir = uL; + + /* offset of start of central directory with respect to the + starting disk number */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + us.offset_central_dir = uL; + + /* zipfile comment length */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&us.gi.size_comment)!=UNZ_OK) + err=UNZ_ERRNO; + } + + if ((central_pospfile_in_zip_read!=NULL) + unzCloseCurrentFile(file); + + ZCLOSE64(s->z_filefunc, s->filestream); + TRYFREE(s); + return UNZ_OK; +} + + +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. */ +extern int ZEXPORT unzGetGlobalInfo64 (unzFile file, unz_global_info64* pglobal_info) +{ + unz64_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + *pglobal_info=s->gi; + return UNZ_OK; +} + +extern int ZEXPORT unzGetGlobalInfo (unzFile file, unz_global_info* pglobal_info32) +{ + unz64_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + /* to do : check if number_entry is not truncated */ + pglobal_info32->number_entry = (uLong)s->gi.number_entry; + pglobal_info32->size_comment = s->gi.size_comment; + return UNZ_OK; +} +/* + Translate date/time from Dos format to tm_unz (readable more easilty) +*/ +local void unz64local_DosDateToTmuDate (ZPOS64_T ulDosDate, tm_unz* ptm) +{ + ZPOS64_T uDate; + uDate = (ZPOS64_T)(ulDosDate>>16); + ptm->tm_mday = (uInt)(uDate&0x1f) ; + ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ; + ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ; + + ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800); + ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ; + ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ; +} + +/* + Get Info about the current file in the zipfile, with internal only info +*/ +local int unz64local_GetCurrentFileInfoInternal OF((unzFile file, + unz_file_info64 *pfile_info, + unz_file_info64_internal + *pfile_info_internal, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize)); + +local int unz64local_GetCurrentFileInfoInternal (unzFile file, + unz_file_info64 *pfile_info, + unz_file_info64_internal + *pfile_info_internal, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize) +{ + unz64_s* s; + unz_file_info64 file_info; + unz_file_info64_internal file_info_internal; + int err=UNZ_OK; + uLong uMagic; + long lSeek=0; + uLong uL; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + if (ZSEEK64(s->z_filefunc, s->filestream, + s->pos_in_central_dir+s->byte_before_the_zipfile, + ZLIB_FILEFUNC_SEEK_SET)!=0) + err=UNZ_ERRNO; + + + /* we check the magic */ + if (err==UNZ_OK) + { + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) + err=UNZ_ERRNO; + else if (uMagic!=0x02014b50) + err=UNZ_BADZIPFILE; + } + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.version) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.version_needed) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.flag) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.compression_method) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.dosDate) != UNZ_OK) + err=UNZ_ERRNO; + + unz64local_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date); + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.crc) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) + err=UNZ_ERRNO; + file_info.compressed_size = uL; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) + err=UNZ_ERRNO; + file_info.uncompressed_size = uL; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_filename) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_extra) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_comment) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.disk_num_start) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.internal_fa) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.external_fa) != UNZ_OK) + err=UNZ_ERRNO; + + // relative offset of local header + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) + err=UNZ_ERRNO; + file_info_internal.offset_curfile = uL; + + lSeek+=file_info.size_filename; + if ((err==UNZ_OK) && (szFileName!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_filename0) && (fileNameBufferSize>0)) + if (ZREAD64(s->z_filefunc, s->filestream,szFileName,uSizeRead)!=uSizeRead) + err=UNZ_ERRNO; + lSeek -= uSizeRead; + } + + // Read extrafield + if ((err==UNZ_OK) && (extraField!=NULL)) + { + ZPOS64_T uSizeRead ; + if (file_info.size_file_extraz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; + } + + if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0)) + if (ZREAD64(s->z_filefunc, s->filestream,extraField,(uLong)uSizeRead)!=uSizeRead) + err=UNZ_ERRNO; + + lSeek += file_info.size_file_extra - (uLong)uSizeRead; + } + else + lSeek += file_info.size_file_extra; + + + if ((err==UNZ_OK) && (file_info.size_file_extra != 0)) + { + uLong acc = 0; + + // since lSeek now points to after the extra field we need to move back + lSeek -= file_info.size_file_extra; + + if (lSeek!=0) + { + if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; + } + + while(acc < file_info.size_file_extra) + { + uLong headerId; + uLong dataSize; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&headerId) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&dataSize) != UNZ_OK) + err=UNZ_ERRNO; + + /* ZIP64 extra fields */ + if (headerId == 0x0001) + { + uLong uL; + + if(file_info.uncompressed_size == MAXU32) + { + if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK) + err=UNZ_ERRNO; + } + + if(file_info.compressed_size == MAXU32) + { + if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.compressed_size) != UNZ_OK) + err=UNZ_ERRNO; + } + + if(file_info_internal.offset_curfile == MAXU32) + { + /* Relative Header offset */ + if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info_internal.offset_curfile) != UNZ_OK) + err=UNZ_ERRNO; + } + + if(file_info.disk_num_start == MAXU32) + { + /* Disk Start Number */ + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) + err=UNZ_ERRNO; + } + + } + else + { + if (ZSEEK64(s->z_filefunc, s->filestream,dataSize,ZLIB_FILEFUNC_SEEK_CUR)!=0) + err=UNZ_ERRNO; + } + + acc += 2 + 2 + dataSize; + } + } + + if ((err==UNZ_OK) && (szComment!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_file_commentz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; + } + + if ((file_info.size_file_comment>0) && (commentBufferSize>0)) + if (ZREAD64(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead) + err=UNZ_ERRNO; + lSeek+=file_info.size_file_comment - uSizeRead; + } + else + lSeek+=file_info.size_file_comment; + + + if ((err==UNZ_OK) && (pfile_info!=NULL)) + *pfile_info=file_info; + + if ((err==UNZ_OK) && (pfile_info_internal!=NULL)) + *pfile_info_internal=file_info_internal; + + return err; +} + + + +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. +*/ +extern int ZEXPORT unzGetCurrentFileInfo64 (unzFile file, + unz_file_info64 * pfile_info, + char * szFileName, uLong fileNameBufferSize, + void *extraField, uLong extraFieldBufferSize, + char* szComment, uLong commentBufferSize) +{ + return unz64local_GetCurrentFileInfoInternal(file,pfile_info,NULL, + szFileName,fileNameBufferSize, + extraField,extraFieldBufferSize, + szComment,commentBufferSize); +} + +extern int ZEXPORT unzGetCurrentFileInfo (unzFile file, + unz_file_info * pfile_info, + char * szFileName, uLong fileNameBufferSize, + void *extraField, uLong extraFieldBufferSize, + char* szComment, uLong commentBufferSize) +{ + int err; + unz_file_info64 file_info64; + err = unz64local_GetCurrentFileInfoInternal(file,&file_info64,NULL, + szFileName,fileNameBufferSize, + extraField,extraFieldBufferSize, + szComment,commentBufferSize); + if ((err==UNZ_OK) && (pfile_info != NULL)) + { + pfile_info->version = file_info64.version; + pfile_info->version_needed = file_info64.version_needed; + pfile_info->flag = file_info64.flag; + pfile_info->compression_method = file_info64.compression_method; + pfile_info->dosDate = file_info64.dosDate; + pfile_info->crc = file_info64.crc; + + pfile_info->size_filename = file_info64.size_filename; + pfile_info->size_file_extra = file_info64.size_file_extra; + pfile_info->size_file_comment = file_info64.size_file_comment; + + pfile_info->disk_num_start = file_info64.disk_num_start; + pfile_info->internal_fa = file_info64.internal_fa; + pfile_info->external_fa = file_info64.external_fa; + + pfile_info->tmu_date = file_info64.tmu_date, + + + pfile_info->compressed_size = (uLong)file_info64.compressed_size; + pfile_info->uncompressed_size = (uLong)file_info64.uncompressed_size; + + } + return err; +} +/* + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem +*/ +extern int ZEXPORT unzGoToFirstFile (unzFile file) +{ + int err=UNZ_OK; + unz64_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + s->pos_in_central_dir=s->offset_central_dir; + s->num_file=0; + err=unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} + +/* + Set the current file of the zipfile to the next file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ +extern int ZEXPORT unzGoToNextFile (unzFile file) +{ + unz64_s* s; + int err; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + if (s->gi.number_entry != 0xffff) /* 2^16 files overflow hack */ + if (s->num_file+1==s->gi.number_entry) + return UNZ_END_OF_LIST_OF_FILE; + + s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename + + s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ; + s->num_file++; + err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} + + +/* + Try locate the file szFileName in the zipfile. + For the iCaseSensitivity signification, see unzipStringFileNameCompare + + return value : + UNZ_OK if the file is found. It becomes the current file. + UNZ_END_OF_LIST_OF_FILE if the file is not found +*/ +extern int ZEXPORT unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity) +{ + unz64_s* s; + int err; + + /* We remember the 'current' position in the file so that we can jump + * back there if we fail. + */ + unz_file_info64 cur_file_infoSaved; + unz_file_info64_internal cur_file_info_internalSaved; + ZPOS64_T num_fileSaved; + ZPOS64_T pos_in_central_dirSaved; + + + if (file==NULL) + return UNZ_PARAMERROR; + + if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP) + return UNZ_PARAMERROR; + + s=(unz64_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + + /* Save the current state */ + num_fileSaved = s->num_file; + pos_in_central_dirSaved = s->pos_in_central_dir; + cur_file_infoSaved = s->cur_file_info; + cur_file_info_internalSaved = s->cur_file_info_internal; + + err = unzGoToFirstFile(file); + + while (err == UNZ_OK) + { + char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1]; + err = unzGetCurrentFileInfo64(file,NULL, + szCurrentFileName,sizeof(szCurrentFileName)-1, + NULL,0,NULL,0); + if (err == UNZ_OK) + { + if (unzStringFileNameCompare(szCurrentFileName, + szFileName,iCaseSensitivity)==0) + return UNZ_OK; + err = unzGoToNextFile(file); + } + } + + /* We failed, so restore the state of the 'current file' to where we + * were. + */ + s->num_file = num_fileSaved ; + s->pos_in_central_dir = pos_in_central_dirSaved ; + s->cur_file_info = cur_file_infoSaved; + s->cur_file_info_internal = cur_file_info_internalSaved; + return err; +} + + +/* +/////////////////////////////////////////// +// Contributed by Ryan Haksi (mailto://cryogen@infoserve.net) +// I need random access +// +// Further optimization could be realized by adding an ability +// to cache the directory in memory. The goal being a single +// comprehensive file read to put the file I need in a memory. +*/ + +/* +typedef struct unz_file_pos_s +{ + ZPOS64_T pos_in_zip_directory; // offset in file + ZPOS64_T num_of_file; // # of file +} unz_file_pos; +*/ + +extern int ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos* file_pos) +{ + unz64_s* s; + + if (file==NULL || file_pos==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + + file_pos->pos_in_zip_directory = s->pos_in_central_dir; + file_pos->num_of_file = s->num_file; + + return UNZ_OK; +} + +extern int ZEXPORT unzGetFilePos( + unzFile file, + unz_file_pos* file_pos) +{ + unz64_file_pos file_pos64; + int err = unzGetFilePos64(file,&file_pos64); + if (err==UNZ_OK) + { + file_pos->pos_in_zip_directory = (uLong)file_pos64.pos_in_zip_directory; + file_pos->num_of_file = (uLong)file_pos64.num_of_file; + } + return err; +} + +extern int ZEXPORT unzGoToFilePos64(unzFile file, const unz64_file_pos* file_pos) +{ + unz64_s* s; + int err; + + if (file==NULL || file_pos==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + + /* jump to the right spot */ + s->pos_in_central_dir = file_pos->pos_in_zip_directory; + s->num_file = file_pos->num_of_file; + + /* set the current file */ + err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + /* return results */ + s->current_file_ok = (err == UNZ_OK); + return err; +} + +extern int ZEXPORT unzGoToFilePos( + unzFile file, + unz_file_pos* file_pos) +{ + unz64_file_pos file_pos64; + if (file_pos == NULL) + return UNZ_PARAMERROR; + + file_pos64.pos_in_zip_directory = file_pos->pos_in_zip_directory; + file_pos64.num_of_file = file_pos->num_of_file; + return unzGoToFilePos64(file,&file_pos64); +} + +/* +// Unzip Helper Functions - should be here? +/////////////////////////////////////////// +*/ + +/* + Read the local header of the current zipfile + Check the coherency of the local header and info in the end of central + directory about this file + store in *piSizeVar the size of extra info in local header + (filename and size of extra field data) +*/ +local int unz64local_CheckCurrentFileCoherencyHeader (unz64_s* s, uInt* piSizeVar, + ZPOS64_T * poffset_local_extrafield, + uInt * psize_local_extrafield) +{ + uLong uMagic,uData,uFlags; + uLong size_filename; + uLong size_extra_field; + int err=UNZ_OK; + + *piSizeVar = 0; + *poffset_local_extrafield = 0; + *psize_local_extrafield = 0; + + if (ZSEEK64(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile + + s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + + + if (err==UNZ_OK) + { + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) + err=UNZ_ERRNO; + else if (uMagic!=0x04034b50) + err=UNZ_BADZIPFILE; + } + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) + err=UNZ_ERRNO; +/* + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion)) + err=UNZ_BADZIPFILE; +*/ + if (unz64local_getShort(&s->z_filefunc, s->filestream,&uFlags) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method)) + err=UNZ_BADZIPFILE; + + if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) && +/* #ifdef HAVE_BZIP2 */ + (s->cur_file_info.compression_method!=Z_BZIP2ED) && +/* #endif */ + (s->cur_file_info.compression_method!=Z_DEFLATED)) + err=UNZ_BADZIPFILE; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* date/time */ + err=UNZ_ERRNO; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* crc */ + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) && ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size compr */ + err=UNZ_ERRNO; + else if (uData != 0xFFFFFFFF && (err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) && ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size uncompr */ + err=UNZ_ERRNO; + else if (uData != 0xFFFFFFFF && (err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&size_filename) != UNZ_OK) + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename)) + err=UNZ_BADZIPFILE; + + *piSizeVar += (uInt)size_filename; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&size_extra_field) != UNZ_OK) + err=UNZ_ERRNO; + *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile + + SIZEZIPLOCALHEADER + size_filename; + *psize_local_extrafield = (uInt)size_extra_field; + + *piSizeVar += (uInt)size_extra_field; + + return err; +} + +/* + Open for reading data the current file in the zipfile. + If there is no error and the file is opened, the return value is UNZ_OK. +*/ +extern int ZEXPORT unzOpenCurrentFile3 (unzFile file, int* method, + int* level, int raw, const char* password) +{ + int err=UNZ_OK; + uInt iSizeVar; + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + ZPOS64_T offset_local_extrafield; /* offset of the local extra field */ + uInt size_local_extrafield; /* size of the local extra field */ +# ifndef NOUNCRYPT + char source[12]; +# else + if (password != NULL) + return UNZ_PARAMERROR; +# endif + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + if (!s->current_file_ok) + return UNZ_PARAMERROR; + + if (s->pfile_in_zip_read != NULL) + unzCloseCurrentFile(file); + + if (unz64local_CheckCurrentFileCoherencyHeader(s,&iSizeVar, &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK) + return UNZ_BADZIPFILE; + + pfile_in_zip_read_info = (file_in_zip64_read_info_s*)ALLOC(sizeof(file_in_zip64_read_info_s)); + if (pfile_in_zip_read_info==NULL) + return UNZ_INTERNALERROR; + + pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE); + pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield; + pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield; + pfile_in_zip_read_info->pos_local_extrafield=0; + pfile_in_zip_read_info->raw=raw; + + if (pfile_in_zip_read_info->read_buffer==NULL) + { + TRYFREE(pfile_in_zip_read_info); + return UNZ_INTERNALERROR; + } + + pfile_in_zip_read_info->stream_initialised=0; + + if (method!=NULL) + *method = (int)s->cur_file_info.compression_method; + + if (level!=NULL) + { + *level = 6; + switch (s->cur_file_info.flag & 0x06) + { + case 6 : *level = 1; break; + case 4 : *level = 2; break; + case 2 : *level = 9; break; + } + } + + if ((s->cur_file_info.compression_method!=0) && +/* #ifdef HAVE_BZIP2 */ + (s->cur_file_info.compression_method!=Z_BZIP2ED) && +/* #endif */ + (s->cur_file_info.compression_method!=Z_DEFLATED)) + + err=UNZ_BADZIPFILE; + + pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc; + pfile_in_zip_read_info->crc32=0; + pfile_in_zip_read_info->total_out_64=0; + pfile_in_zip_read_info->compression_method = s->cur_file_info.compression_method; + pfile_in_zip_read_info->filestream=s->filestream; + pfile_in_zip_read_info->z_filefunc=s->z_filefunc; + pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile; + + pfile_in_zip_read_info->stream.total_out = 0; + + if ((s->cur_file_info.compression_method==Z_BZIP2ED) && (!raw)) + { +#ifdef HAVE_BZIP2 + pfile_in_zip_read_info->bstream.bzalloc = (void *(*) (void *, int, int))0; + pfile_in_zip_read_info->bstream.bzfree = (free_func)0; + pfile_in_zip_read_info->bstream.opaque = (voidpf)0; + pfile_in_zip_read_info->bstream.state = (voidpf)0; + + pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; + pfile_in_zip_read_info->stream.zfree = (free_func)0; + pfile_in_zip_read_info->stream.opaque = (voidpf)0; + pfile_in_zip_read_info->stream.next_in = (voidpf)0; + pfile_in_zip_read_info->stream.avail_in = 0; + + err=BZ2_bzDecompressInit(&pfile_in_zip_read_info->bstream, 0, 0); + if (err == Z_OK) + pfile_in_zip_read_info->stream_initialised=Z_BZIP2ED; + else + { + TRYFREE(pfile_in_zip_read_info); + return err; + } +#else + pfile_in_zip_read_info->raw=1; +#endif + } + else if ((s->cur_file_info.compression_method==Z_DEFLATED) && (!raw)) + { + pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; + pfile_in_zip_read_info->stream.zfree = (free_func)0; + pfile_in_zip_read_info->stream.opaque = (voidpf)0; + pfile_in_zip_read_info->stream.next_in = 0; + pfile_in_zip_read_info->stream.avail_in = 0; + + err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS); + if (err == Z_OK) + pfile_in_zip_read_info->stream_initialised=Z_DEFLATED; + else + { + TRYFREE(pfile_in_zip_read_info); + return err; + } + /* windowBits is passed < 0 to tell that there is no zlib header. + * Note that in this case inflate *requires* an extra "dummy" byte + * after the compressed stream in order to complete decompression and + * return Z_STREAM_END. + * In unzip, i don't wait absolutely Z_STREAM_END because I known the + * size of both compressed and uncompressed data + */ + } + pfile_in_zip_read_info->rest_read_compressed = + s->cur_file_info.compressed_size ; + pfile_in_zip_read_info->rest_read_uncompressed = + s->cur_file_info.uncompressed_size ; + + + pfile_in_zip_read_info->pos_in_zipfile = + s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER + + iSizeVar; + + pfile_in_zip_read_info->stream.avail_in = (uInt)0; + + s->pfile_in_zip_read = pfile_in_zip_read_info; + s->encrypted = 0; + +# ifndef NOUNCRYPT + if (password != NULL) + { + int i; + s->pcrc_32_tab = get_crc_table(); + init_keys(password,s->keys,s->pcrc_32_tab); + if (ZSEEK64(s->z_filefunc, s->filestream, + s->pfile_in_zip_read->pos_in_zipfile + + s->pfile_in_zip_read->byte_before_the_zipfile, + SEEK_SET)!=0) + return UNZ_INTERNALERROR; + if(ZREAD64(s->z_filefunc, s->filestream,source, 12)<12) + return UNZ_INTERNALERROR; + + for (i = 0; i<12; i++) + zdecode(s->keys,s->pcrc_32_tab,source[i]); + + s->pfile_in_zip_read->pos_in_zipfile+=12; + s->encrypted=1; + } +# endif + + + return UNZ_OK; +} + +extern int ZEXPORT unzOpenCurrentFile (unzFile file) +{ + return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL); +} + +extern int ZEXPORT unzOpenCurrentFilePassword (unzFile file, const char* password) +{ + return unzOpenCurrentFile3(file, NULL, NULL, 0, password); +} + +extern int ZEXPORT unzOpenCurrentFile2 (unzFile file, int* method, int* level, int raw) +{ + return unzOpenCurrentFile3(file, method, level, raw, NULL); +} + +/** Addition for GDAL : START */ + +extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64( unzFile file) +{ + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + s=(unz64_s*)file; + if (file==NULL) + return 0; //UNZ_PARAMERROR; + pfile_in_zip_read_info=s->pfile_in_zip_read; + if (pfile_in_zip_read_info==NULL) + return 0; //UNZ_PARAMERROR; + return pfile_in_zip_read_info->pos_in_zipfile + + pfile_in_zip_read_info->byte_before_the_zipfile; +} + +/** Addition for GDAL : END */ + +/* + Read bytes from the current file. + buf contain buffer where data must be copied + len the size of buf. + + return the number of byte copied if somes bytes are copied + return 0 if the end of file was reached + return <0 with error code if there is an error + (UNZ_ERRNO for IO error, or zLib error for uncompress error) +*/ +extern int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len) +{ + int err=UNZ_OK; + uInt iRead = 0; + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + + if (pfile_in_zip_read_info->read_buffer == NULL) + return UNZ_END_OF_LIST_OF_FILE; + if (len==0) + return 0; + + pfile_in_zip_read_info->stream.next_out = (Bytef*)buf; + + pfile_in_zip_read_info->stream.avail_out = (uInt)len; + + if ((len>pfile_in_zip_read_info->rest_read_uncompressed) && + (!(pfile_in_zip_read_info->raw))) + pfile_in_zip_read_info->stream.avail_out = + (uInt)pfile_in_zip_read_info->rest_read_uncompressed; + + if ((len>pfile_in_zip_read_info->rest_read_compressed+ + pfile_in_zip_read_info->stream.avail_in) && + (pfile_in_zip_read_info->raw)) + pfile_in_zip_read_info->stream.avail_out = + (uInt)pfile_in_zip_read_info->rest_read_compressed+ + pfile_in_zip_read_info->stream.avail_in; + + while (pfile_in_zip_read_info->stream.avail_out>0) + { + if ((pfile_in_zip_read_info->stream.avail_in==0) && + (pfile_in_zip_read_info->rest_read_compressed>0)) + { + uInt uReadThis = UNZ_BUFSIZE; + if (pfile_in_zip_read_info->rest_read_compressedrest_read_compressed; + if (uReadThis == 0) + return UNZ_EOF; + if (ZSEEK64(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + pfile_in_zip_read_info->pos_in_zipfile + + pfile_in_zip_read_info->byte_before_the_zipfile, + ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + if (ZREAD64(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + pfile_in_zip_read_info->read_buffer, + uReadThis)!=uReadThis) + return UNZ_ERRNO; + + +# ifndef NOUNCRYPT + if(s->encrypted) + { + uInt i; + for(i=0;iread_buffer[i] = + zdecode(s->keys,s->pcrc_32_tab, + pfile_in_zip_read_info->read_buffer[i]); + } +# endif + + + pfile_in_zip_read_info->pos_in_zipfile += uReadThis; + + pfile_in_zip_read_info->rest_read_compressed-=uReadThis; + + pfile_in_zip_read_info->stream.next_in = + (Bytef*)pfile_in_zip_read_info->read_buffer; + pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis; + } + + if ((pfile_in_zip_read_info->compression_method==0) || (pfile_in_zip_read_info->raw)) + { + uInt uDoCopy,i ; + + if ((pfile_in_zip_read_info->stream.avail_in == 0) && + (pfile_in_zip_read_info->rest_read_compressed == 0)) + return (iRead==0) ? UNZ_EOF : iRead; + + if (pfile_in_zip_read_info->stream.avail_out < + pfile_in_zip_read_info->stream.avail_in) + uDoCopy = pfile_in_zip_read_info->stream.avail_out ; + else + uDoCopy = pfile_in_zip_read_info->stream.avail_in ; + + for (i=0;istream.next_out+i) = + *(pfile_in_zip_read_info->stream.next_in+i); + + pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uDoCopy; + + pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32, + pfile_in_zip_read_info->stream.next_out, + uDoCopy); + pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy; + pfile_in_zip_read_info->stream.avail_in -= uDoCopy; + pfile_in_zip_read_info->stream.avail_out -= uDoCopy; + pfile_in_zip_read_info->stream.next_out += uDoCopy; + pfile_in_zip_read_info->stream.next_in += uDoCopy; + pfile_in_zip_read_info->stream.total_out += uDoCopy; + iRead += uDoCopy; + } + else if (pfile_in_zip_read_info->compression_method==Z_BZIP2ED) + { +#ifdef HAVE_BZIP2 + uLong uTotalOutBefore,uTotalOutAfter; + const Bytef *bufBefore; + uLong uOutThis; + + pfile_in_zip_read_info->bstream.next_in = (char*)pfile_in_zip_read_info->stream.next_in; + pfile_in_zip_read_info->bstream.avail_in = pfile_in_zip_read_info->stream.avail_in; + pfile_in_zip_read_info->bstream.total_in_lo32 = pfile_in_zip_read_info->stream.total_in; + pfile_in_zip_read_info->bstream.total_in_hi32 = 0; + pfile_in_zip_read_info->bstream.next_out = (char*)pfile_in_zip_read_info->stream.next_out; + pfile_in_zip_read_info->bstream.avail_out = pfile_in_zip_read_info->stream.avail_out; + pfile_in_zip_read_info->bstream.total_out_lo32 = pfile_in_zip_read_info->stream.total_out; + pfile_in_zip_read_info->bstream.total_out_hi32 = 0; + + uTotalOutBefore = pfile_in_zip_read_info->bstream.total_out_lo32; + bufBefore = (const Bytef *)pfile_in_zip_read_info->bstream.next_out; + + err=BZ2_bzDecompress(&pfile_in_zip_read_info->bstream); + + uTotalOutAfter = pfile_in_zip_read_info->bstream.total_out_lo32; + uOutThis = uTotalOutAfter-uTotalOutBefore; + + pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis; + + pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32,bufBefore, (uInt)(uOutThis)); + pfile_in_zip_read_info->rest_read_uncompressed -= uOutThis; + iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); + + pfile_in_zip_read_info->stream.next_in = (Bytef*)pfile_in_zip_read_info->bstream.next_in; + pfile_in_zip_read_info->stream.avail_in = pfile_in_zip_read_info->bstream.avail_in; + pfile_in_zip_read_info->stream.total_in = pfile_in_zip_read_info->bstream.total_in_lo32; + pfile_in_zip_read_info->stream.next_out = (Bytef*)pfile_in_zip_read_info->bstream.next_out; + pfile_in_zip_read_info->stream.avail_out = pfile_in_zip_read_info->bstream.avail_out; + pfile_in_zip_read_info->stream.total_out = pfile_in_zip_read_info->bstream.total_out_lo32; + + if (err==BZ_STREAM_END) + return (iRead==0) ? UNZ_EOF : iRead; + if (err!=BZ_OK) + break; +#endif + } // end Z_BZIP2ED + else + { + ZPOS64_T uTotalOutBefore,uTotalOutAfter; + const Bytef *bufBefore; + ZPOS64_T uOutThis; + int flush=Z_SYNC_FLUSH; + + uTotalOutBefore = pfile_in_zip_read_info->stream.total_out; + bufBefore = pfile_in_zip_read_info->stream.next_out; + + /* + if ((pfile_in_zip_read_info->rest_read_uncompressed == + pfile_in_zip_read_info->stream.avail_out) && + (pfile_in_zip_read_info->rest_read_compressed == 0)) + flush = Z_FINISH; + */ + err=inflate(&pfile_in_zip_read_info->stream,flush); + + if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL)) + err = Z_DATA_ERROR; + + uTotalOutAfter = pfile_in_zip_read_info->stream.total_out; + uOutThis = uTotalOutAfter-uTotalOutBefore; + + pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis; + + pfile_in_zip_read_info->crc32 = + crc32(pfile_in_zip_read_info->crc32,bufBefore, + (uInt)(uOutThis)); + + pfile_in_zip_read_info->rest_read_uncompressed -= + uOutThis; + + iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); + + if (err==Z_STREAM_END) + return (iRead==0) ? UNZ_EOF : iRead; + if (err!=Z_OK) + break; + } + } + + if (err==Z_OK) + return iRead; + return err; +} + + +/* + Give the current position in uncompressed data +*/ +extern z_off_t ZEXPORT unztell (unzFile file) +{ + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + return (z_off_t)pfile_in_zip_read_info->stream.total_out; +} + +extern ZPOS64_T ZEXPORT unztell64 (unzFile file) +{ + + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return (ZPOS64_T)-1; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return (ZPOS64_T)-1; + + return pfile_in_zip_read_info->total_out_64; +} + + +/* + return 1 if the end of file was reached, 0 elsewhere +*/ +extern int ZEXPORT unzeof (unzFile file) +{ + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + if (pfile_in_zip_read_info->rest_read_uncompressed == 0) + return 1; + else + return 0; +} + + + +/* +Read extra field from the current file (opened by unzOpenCurrentFile) +This is the local-header version of the extra field (sometimes, there is +more info in the local-header version than in the central-header) + + if buf==NULL, it return the size of the local extra field that can be read + + if buf!=NULL, len is the size of the buffer, the extra header is copied in + buf. + the return value is the number of bytes copied in buf, or (if <0) + the error code +*/ +extern int ZEXPORT unzGetLocalExtrafield (unzFile file, voidp buf, unsigned len) +{ + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + uInt read_now; + ZPOS64_T size_to_read; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + size_to_read = (pfile_in_zip_read_info->size_local_extrafield - + pfile_in_zip_read_info->pos_local_extrafield); + + if (buf==NULL) + return (int)size_to_read; + + if (len>size_to_read) + read_now = (uInt)size_to_read; + else + read_now = (uInt)len ; + + if (read_now==0) + return 0; + + if (ZSEEK64(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + pfile_in_zip_read_info->offset_local_extrafield + + pfile_in_zip_read_info->pos_local_extrafield, + ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + + if (ZREAD64(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + buf,read_now)!=read_now) + return UNZ_ERRNO; + + return (int)read_now; +} + +/* + Close the file in zip opened with unzipOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good +*/ +extern int ZEXPORT unzCloseCurrentFile (unzFile file) +{ + int err=UNZ_OK; + + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + + if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) && + (!pfile_in_zip_read_info->raw)) + { + if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait) + err=UNZ_CRCERROR; + } + + + TRYFREE(pfile_in_zip_read_info->read_buffer); + pfile_in_zip_read_info->read_buffer = NULL; + if (pfile_in_zip_read_info->stream_initialised == Z_DEFLATED) + inflateEnd(&pfile_in_zip_read_info->stream); +#ifdef HAVE_BZIP2 + else if (pfile_in_zip_read_info->stream_initialised == Z_BZIP2ED) + BZ2_bzDecompressEnd(&pfile_in_zip_read_info->bstream); +#endif + + + pfile_in_zip_read_info->stream_initialised = 0; + TRYFREE(pfile_in_zip_read_info); + + s->pfile_in_zip_read=NULL; + + return err; +} + + +/* + Get the global comment string of the ZipFile, in the szComment buffer. + uSizeBuf is the size of the szComment buffer. + return the number of byte copied or an error code <0 +*/ +extern int ZEXPORT unzGetGlobalComment (unzFile file, char * szComment, uLong uSizeBuf) +{ + unz64_s* s; + uLong uReadThis ; + if (file==NULL) + return (int)UNZ_PARAMERROR; + s=(unz64_s*)file; + + uReadThis = uSizeBuf; + if (uReadThis>s->gi.size_comment) + uReadThis = s->gi.size_comment; + + if (ZSEEK64(s->z_filefunc,s->filestream,s->central_pos+22,ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + + if (uReadThis>0) + { + *szComment='\0'; + if (ZREAD64(s->z_filefunc,s->filestream,szComment,uReadThis)!=uReadThis) + return UNZ_ERRNO; + } + + if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment)) + *(szComment+s->gi.size_comment)='\0'; + return (int)uReadThis; +} + +/* Additions by RX '2004 */ +extern ZPOS64_T ZEXPORT unzGetOffset64(unzFile file) +{ + unz64_s* s; + + if (file==NULL) + return 0; //UNZ_PARAMERROR; + s=(unz64_s*)file; + if (!s->current_file_ok) + return 0; + if (s->gi.number_entry != 0 && s->gi.number_entry != 0xffff) + if (s->num_file==s->gi.number_entry) + return 0; + return s->pos_in_central_dir; +} + +extern uLong ZEXPORT unzGetOffset (unzFile file) +{ + ZPOS64_T offset64; + + if (file==NULL) + return 0; //UNZ_PARAMERROR; + offset64 = unzGetOffset64(file); + return (uLong)offset64; +} + +extern int ZEXPORT unzSetOffset64(unzFile file, ZPOS64_T pos) +{ + unz64_s* s; + int err; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + + s->pos_in_central_dir = pos; + s->num_file = s->gi.number_entry; /* hack */ + err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} + +extern int ZEXPORT unzSetOffset (unzFile file, uLong pos) +{ + return unzSetOffset64(file,pos); +} diff --git a/libmupen64plus/mupen64plus-core/src/main/zip/unzip.h b/libmupen64plus/mupen64plus-core/src/main/zip/unzip.h new file mode 100644 index 0000000000..3183968b77 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/zip/unzip.h @@ -0,0 +1,437 @@ +/* unzip.h -- IO for uncompress .zip files using zlib + Version 1.1, February 14h, 2010 + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications of Unzip for Zip64 + Copyright (C) 2007-2008 Even Rouault + + Modifications for Zip64 support on both zip and unzip + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + + --------------------------------------------------------------------------------- + + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + --------------------------------------------------------------------------------- + + Changes + + See header of unzip64.c + +*/ + +#ifndef _unz64_H +#define _unz64_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _ZLIB_H +#include "zlib.h" +#endif + +#ifndef _ZLIBIOAPI_H +#include "ioapi.h" +#endif + +#ifdef HAVE_BZIP2 +#include "bzlib.h" +#endif + +#define Z_BZIP2ED 12 + +#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) +/* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ +typedef struct TagunzFile__ { int unused; } unzFile__; +typedef unzFile__ *unzFile; +#else +typedef voidp unzFile; +#endif + + +#define UNZ_OK (0) +#define UNZ_END_OF_LIST_OF_FILE (-100) +#define UNZ_ERRNO (Z_ERRNO) +#define UNZ_EOF (0) +#define UNZ_PARAMERROR (-102) +#define UNZ_BADZIPFILE (-103) +#define UNZ_INTERNALERROR (-104) +#define UNZ_CRCERROR (-105) + +/* tm_unz contain date/time info */ +typedef struct tm_unz_s +{ + uInt tm_sec; /* seconds after the minute - [0,59] */ + uInt tm_min; /* minutes after the hour - [0,59] */ + uInt tm_hour; /* hours since midnight - [0,23] */ + uInt tm_mday; /* day of the month - [1,31] */ + uInt tm_mon; /* months since January - [0,11] */ + uInt tm_year; /* years - [1980..2044] */ +} tm_unz; + +/* unz_global_info structure contain global data about the ZIPfile + These data comes from the end of central dir */ +typedef struct unz_global_info64_s +{ + ZPOS64_T number_entry; /* total number of entries in + the central dir on this disk */ + uLong size_comment; /* size of the global comment of the zipfile */ +} unz_global_info64; + +typedef struct unz_global_info_s +{ + uLong number_entry; /* total number of entries in + the central dir on this disk */ + uLong size_comment; /* size of the global comment of the zipfile */ +} unz_global_info; + +/* unz_file_info contain information about a file in the zipfile */ +typedef struct unz_file_info64_s +{ + uLong version; /* version made by 2 bytes */ + uLong version_needed; /* version needed to extract 2 bytes */ + uLong flag; /* general purpose bit flag 2 bytes */ + uLong compression_method; /* compression method 2 bytes */ + uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ + uLong crc; /* crc-32 4 bytes */ + ZPOS64_T compressed_size; /* compressed size 8 bytes */ + ZPOS64_T uncompressed_size; /* uncompressed size 8 bytes */ + uLong size_filename; /* filename length 2 bytes */ + uLong size_file_extra; /* extra field length 2 bytes */ + uLong size_file_comment; /* file comment length 2 bytes */ + + uLong disk_num_start; /* disk number start 2 bytes */ + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ + + tm_unz tmu_date; +} unz_file_info64; + +typedef struct unz_file_info_s +{ + uLong version; /* version made by 2 bytes */ + uLong version_needed; /* version needed to extract 2 bytes */ + uLong flag; /* general purpose bit flag 2 bytes */ + uLong compression_method; /* compression method 2 bytes */ + uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ + uLong crc; /* crc-32 4 bytes */ + uLong compressed_size; /* compressed size 4 bytes */ + uLong uncompressed_size; /* uncompressed size 4 bytes */ + uLong size_filename; /* filename length 2 bytes */ + uLong size_file_extra; /* extra field length 2 bytes */ + uLong size_file_comment; /* file comment length 2 bytes */ + + uLong disk_num_start; /* disk number start 2 bytes */ + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ + + tm_unz tmu_date; +} unz_file_info; + +extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, + const char* fileName2, + int iCaseSensitivity)); +/* + Compare two filename (fileName1,fileName2). + If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi + or strcasecmp) + If iCaseSenisivity = 0, case sensitivity is defaut of your operating system + (like 1 on Unix, 2 on Windows) +*/ + + +extern unzFile ZEXPORT unzOpen OF((const char *path)); +extern unzFile ZEXPORT unzOpen64 OF((const void *path)); +/* + Open a Zip file. path contain the full pathname (by example, + on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer + "zlib/zlib113.zip". + If the zipfile cannot be opened (file don't exist or in not valid), the + return value is NULL. + Else, the return value is a unzFile Handle, usable with other function + of this unzip package. + the "64" function take a const void* pointer, because the path is just the + value passed to the open64_file_func callback. + Under Windows, if UNICODE is defined, using fill_fopen64_filefunc, the path + is a pointer to a wide unicode string (LPCTSTR is LPCWSTR), so const char* + does not describe the reality +*/ + + +extern unzFile ZEXPORT unzOpen2 OF((const char *path, + zlib_filefunc_def* pzlib_filefunc_def)); +/* + Open a Zip file, like unzOpen, but provide a set of file low level API + for read/write the zip file (see ioapi.h) +*/ + +extern unzFile ZEXPORT unzOpen2_64 OF((const void *path, + zlib_filefunc64_def* pzlib_filefunc_def)); +/* + Open a Zip file, like unz64Open, but provide a set of file low level API + for read/write the zip file (see ioapi.h) +*/ + +extern int ZEXPORT unzClose OF((unzFile file)); +/* + Close a ZipFile opened with unzipOpen. + If there is files inside the .Zip opened with unzOpenCurrentFile (see later), + these files MUST be closed with unzipCloseCurrentFile before call unzipClose. + return UNZ_OK if there is no problem. */ + +extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, + unz_global_info *pglobal_info)); + +extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file, + unz_global_info64 *pglobal_info)); +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. */ + + +extern int ZEXPORT unzGetGlobalComment OF((unzFile file, + char *szComment, + uLong uSizeBuf)); +/* + Get the global comment string of the ZipFile, in the szComment buffer. + uSizeBuf is the size of the szComment buffer. + return the number of byte copied or an error code <0 +*/ + + +/***************************************************************************/ +/* Unzip package allow you browse the directory of the zipfile */ + +extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); +/* + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem +*/ + +extern int ZEXPORT unzGoToNextFile OF((unzFile file)); +/* + Set the current file of the zipfile to the next file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ + +extern int ZEXPORT unzLocateFile OF((unzFile file, + const char *szFileName, + int iCaseSensitivity)); +/* + Try locate the file szFileName in the zipfile. + For the iCaseSensitivity signification, see unzStringFileNameCompare + + return value : + UNZ_OK if the file is found. It becomes the current file. + UNZ_END_OF_LIST_OF_FILE if the file is not found +*/ + + +/* ****************************************** */ +/* Ryan supplied functions */ +/* unz_file_info contain information about a file in the zipfile */ +typedef struct unz_file_pos_s +{ + uLong pos_in_zip_directory; /* offset in zip file directory */ + uLong num_of_file; /* # of file */ +} unz_file_pos; + +extern int ZEXPORT unzGetFilePos( + unzFile file, + unz_file_pos* file_pos); + +extern int ZEXPORT unzGoToFilePos( + unzFile file, + unz_file_pos* file_pos); + +typedef struct unz64_file_pos_s +{ + ZPOS64_T pos_in_zip_directory; /* offset in zip file directory */ + ZPOS64_T num_of_file; /* # of file */ +} unz64_file_pos; + +extern int ZEXPORT unzGetFilePos64( + unzFile file, + unz64_file_pos* file_pos); + +extern int ZEXPORT unzGoToFilePos64( + unzFile file, + const unz64_file_pos* file_pos); + +/* ****************************************** */ + +extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file, + unz_file_info64 *pfile_info, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize)); + +extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, + unz_file_info *pfile_info, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize)); +/* + Get Info about the current file + if pfile_info!=NULL, the *pfile_info structure will contain somes info about + the current file + if szFileName!=NULL, the filemane string will be copied in szFileName + (fileNameBufferSize is the size of the buffer) + if extraField!=NULL, the extra field information will be copied in extraField + (extraFieldBufferSize is the size of the buffer). + This is the Central-header version of the extra field + if szComment!=NULL, the comment string of the file will be copied in szComment + (commentBufferSize is the size of the buffer) +*/ + + +/** Addition for GDAL : START */ + +extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file)); + +/** Addition for GDAL : END */ + + +/***************************************************************************/ +/* for reading the content of the current zipfile, you can open it, read data + from it, and close it (you can close it before reading all the file) + */ + +extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); +/* + Open for reading data the current file in the zipfile. + If there is no error, the return value is UNZ_OK. +*/ + +extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, + const char* password)); +/* + Open for reading data the current file in the zipfile. + password is a crypting password + If there is no error, the return value is UNZ_OK. +*/ + +extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, + int* method, + int* level, + int raw)); +/* + Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) + if raw==1 + *method will receive method of compression, *level will receive level of + compression + note : you can set level parameter as NULL (if you did not want known level, + but you CANNOT set method parameter as NULL +*/ + +extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, + int* method, + int* level, + int raw, + const char* password)); +/* + Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) + if raw==1 + *method will receive method of compression, *level will receive level of + compression + note : you can set level parameter as NULL (if you did not want known level, + but you CANNOT set method parameter as NULL +*/ + + +extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); +/* + Close the file in zip opened with unzOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good +*/ + +extern int ZEXPORT unzReadCurrentFile OF((unzFile file, + voidp buf, + unsigned len)); +/* + Read bytes from the current file (opened by unzOpenCurrentFile) + buf contain buffer where data must be copied + len the size of buf. + + return the number of byte copied if somes bytes are copied + return 0 if the end of file was reached + return <0 with error code if there is an error + (UNZ_ERRNO for IO error, or zLib error for uncompress error) +*/ + +extern z_off_t ZEXPORT unztell OF((unzFile file)); + +extern ZPOS64_T ZEXPORT unztell64 OF((unzFile file)); +/* + Give the current position in uncompressed data +*/ + +extern int ZEXPORT unzeof OF((unzFile file)); +/* + return 1 if the end of file was reached, 0 elsewhere +*/ + +extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, + voidp buf, + unsigned len)); +/* + Read extra field from the current file (opened by unzOpenCurrentFile) + This is the local-header version of the extra field (sometimes, there is + more info in the local-header version than in the central-header) + + if buf==NULL, it return the size of the local extra field + + if buf!=NULL, len is the size of the buffer, the extra header is copied in + buf. + the return value is the number of bytes copied in buf, or (if <0) + the error code +*/ + +/***************************************************************************/ + +/* Get the current file offset */ +extern ZPOS64_T ZEXPORT unzGetOffset64 (unzFile file); +extern uLong ZEXPORT unzGetOffset (unzFile file); + +/* Set the current file offset */ +extern int ZEXPORT unzSetOffset64 (unzFile file, ZPOS64_T pos); +extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); + + + +#ifdef __cplusplus +} +#endif + +#endif /* _unz64_H */ diff --git a/libmupen64plus/mupen64plus-core/src/main/zip/zip.c b/libmupen64plus/mupen64plus-core/src/main/zip/zip.c new file mode 100644 index 0000000000..70e9bfe60b --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/zip/zip.c @@ -0,0 +1,2006 @@ +/* zip.c -- IO on .zip files using zlib + Version 1.1, February 14h, 2010 + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications for Zip64 support + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + + Changes + Oct-2009 - Mathias Svensson - Remove old C style function prototypes + Oct-2009 - Mathias Svensson - Added Zip64 Support when creating new file archives + Oct-2009 - Mathias Svensson - Did some code cleanup and refactoring to get better overview of some functions. + Oct-2009 - Mathias Svensson - Added zipRemoveExtraInfoBlock to strip extra field data from its ZIP64 data + It is used when recreting zip archive with RAW when deleting items from a zip. + ZIP64 data is automaticly added to items that needs it, and existing ZIP64 data need to be removed. + Oct-2009 - Mathias Svensson - Added support for BZIP2 as compression mode (bzip2 lib is required) + Jan-2010 - back to unzip and minizip 1.0 name scheme, with compatibility layer + +*/ + + +#include +#include +#include +#include +#include "zlib.h" +#include "zip.h" + +#ifdef STDC +# include +# include +# include +#endif +#ifdef NO_ERRNO_H + extern int errno; +#else +# include +#endif + + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + +#ifndef VERSIONMADEBY +# define VERSIONMADEBY (0x0) /* platform depedent */ +#endif + +#ifndef Z_BUFSIZE +#define Z_BUFSIZE (64*1024) //(16384) +#endif + +#ifndef Z_MAXFILENAMEINZIP +#define Z_MAXFILENAMEINZIP (256) +#endif + +#ifndef ALLOC +# define ALLOC(size) (malloc(size)) +#endif +#ifndef TRYFREE +# define TRYFREE(p) {if (p) free(p);} +#endif + +/* +#define SIZECENTRALDIRITEM (0x2e) +#define SIZEZIPLOCALHEADER (0x1e) +*/ + +/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ + + +// NOT sure that this work on ALL platform +#define MAKEULONG64(a, b) ((ZPOS64_T)(((unsigned long)(a)) | ((ZPOS64_T)((unsigned long)(b))) << 32)) + +#ifndef SEEK_CUR +#define SEEK_CUR 1 +#endif + +#ifndef SEEK_END +#define SEEK_END 2 +#endif + +#ifndef SEEK_SET +#define SEEK_SET 0 +#endif + +#ifndef DEF_MEM_LEVEL +#if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +#else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +#endif +#endif +const char zip_copyright[] =" zip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; + + +#define SIZEDATA_INDATABLOCK (4096-(4*4)) + +#define LOCALHEADERMAGIC (0x04034b50) +#define CENTRALHEADERMAGIC (0x02014b50) +#define ENDHEADERMAGIC (0x06054b50) +#define ZIP64ENDHEADERMAGIC (0x6064b50) +#define ZIP64ENDLOCHEADERMAGIC (0x7064b50) + +#define FLAG_LOCALHEADER_OFFSET (0x06) +#define CRC_LOCALHEADER_OFFSET (0x0e) + +#define SIZECENTRALHEADER (0x2e) /* 46 */ + +typedef struct linkedlist_datablock_internal_s +{ + struct linkedlist_datablock_internal_s* next_datablock; + uLong avail_in_this_block; + uLong filled_in_this_block; + uLong unused; /* for future use and alignement */ + unsigned char data[SIZEDATA_INDATABLOCK]; +} linkedlist_datablock_internal; + +typedef struct linkedlist_data_s +{ + linkedlist_datablock_internal* first_block; + linkedlist_datablock_internal* last_block; +} linkedlist_data; + + +typedef struct +{ + z_stream stream; /* zLib stream structure for inflate */ +#ifdef HAVE_BZIP2 + bz_stream bstream; /* bzLib stream structure for bziped */ +#endif + + int stream_initialised; /* 1 is stream is initialised */ + uInt pos_in_buffered_data; /* last written byte in buffered_data */ + + ZPOS64_T pos_local_header; /* offset of the local header of the file + currenty writing */ + char* central_header; /* central header data for the current file */ + uLong size_centralExtra; + uLong size_centralheader; /* size of the central header for cur file */ + uLong size_centralExtraFree; /* Extra bytes allocated to the centralheader but that are not used */ + uLong flag; /* flag of the file currently writing */ + + int method; /* compression method of file currenty wr.*/ + int raw; /* 1 for directly writing raw data */ + Byte buffered_data[Z_BUFSIZE];/* buffer contain compressed data to be writ*/ + uLong dosDate; + uLong crc32; + int encrypt; + int zip64; /* Add ZIP64 extened information in the extra field */ + ZPOS64_T pos_zip64extrainfo; + ZPOS64_T totalCompressedData; + ZPOS64_T totalUncompressedData; +#ifndef NOCRYPT + unsigned long keys[3]; /* keys defining the pseudo-random sequence */ + const unsigned long* pcrc_32_tab; + int crypt_header_size; +#endif +} curfile64_info; + +typedef struct +{ + zlib_filefunc64_32_def z_filefunc; + voidpf filestream; /* io structore of the zipfile */ + linkedlist_data central_dir;/* datablock with central dir in construction*/ + int in_opened_file_inzip; /* 1 if a file in the zip is currently writ.*/ + curfile64_info ci; /* info on the file curretly writing */ + + ZPOS64_T begin_pos; /* position of the beginning of the zipfile */ + ZPOS64_T add_position_when_writting_offset; + ZPOS64_T number_entry; + +#ifndef NO_ADDFILEINEXISTINGZIP + char *globalcomment; +#endif + +} zip64_internal; + + +#ifndef NOCRYPT +#define INCLUDECRYPTINGCODE_IFCRYPTALLOWED +#include "crypt.h" +#endif + +local linkedlist_datablock_internal* allocate_new_datablock() +{ + linkedlist_datablock_internal* ldi; + ldi = (linkedlist_datablock_internal*) + ALLOC(sizeof(linkedlist_datablock_internal)); + if (ldi!=NULL) + { + ldi->next_datablock = NULL ; + ldi->filled_in_this_block = 0 ; + ldi->avail_in_this_block = SIZEDATA_INDATABLOCK ; + } + return ldi; +} + +local void free_datablock(linkedlist_datablock_internal* ldi) +{ + while (ldi!=NULL) + { + linkedlist_datablock_internal* ldinext = ldi->next_datablock; + TRYFREE(ldi); + ldi = ldinext; + } +} + +local void init_linkedlist(linkedlist_data* ll) +{ + ll->first_block = ll->last_block = NULL; +} + +local void free_linkedlist(linkedlist_data* ll) +{ + free_datablock(ll->first_block); + ll->first_block = ll->last_block = NULL; +} + + +local int add_data_in_datablock(linkedlist_data* ll, const void* buf, uLong len) +{ + linkedlist_datablock_internal* ldi; + const unsigned char* from_copy; + + if (ll==NULL) + return ZIP_INTERNALERROR; + + if (ll->last_block == NULL) + { + ll->first_block = ll->last_block = allocate_new_datablock(); + if (ll->first_block == NULL) + return ZIP_INTERNALERROR; + } + + ldi = ll->last_block; + from_copy = (unsigned char*)buf; + + while (len>0) + { + uInt copy_this; + uInt i; + unsigned char* to_copy; + + if (ldi->avail_in_this_block==0) + { + ldi->next_datablock = allocate_new_datablock(); + if (ldi->next_datablock == NULL) + return ZIP_INTERNALERROR; + ldi = ldi->next_datablock ; + ll->last_block = ldi; + } + + if (ldi->avail_in_this_block < len) + copy_this = (uInt)ldi->avail_in_this_block; + else + copy_this = (uInt)len; + + to_copy = &(ldi->data[ldi->filled_in_this_block]); + + for (i=0;ifilled_in_this_block += copy_this; + ldi->avail_in_this_block -= copy_this; + from_copy += copy_this ; + len -= copy_this; + } + return ZIP_OK; +} + + + +/****************************************************************************/ + +#ifndef NO_ADDFILEINEXISTINGZIP +/* =========================================================================== + Inputs a long in LSB order to the given file + nbByte == 1, 2 ,4 or 8 (byte, short or long, ZPOS64_T) +*/ + +local int zip64local_putValue OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T x, int nbByte)); +local int zip64local_putValue (const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T x, int nbByte) +{ + unsigned char buf[8]; + int n; + for (n = 0; n < nbByte; n++) + { + buf[n] = (unsigned char)(x & 0xff); + x >>= 8; + } + if (x != 0) + { /* data overflow - hack for ZIP64 (X Roche) */ + for (n = 0; n < nbByte; n++) + { + buf[n] = 0xff; + } + } + + if (ZWRITE64(*pzlib_filefunc_def,filestream,buf,nbByte)!=(uLong)nbByte) + return ZIP_ERRNO; + else + return ZIP_OK; +} + +local void zip64local_putValue_inmemory OF((void* dest, ZPOS64_T x, int nbByte)); +local void zip64local_putValue_inmemory (void* dest, ZPOS64_T x, int nbByte) +{ + unsigned char* buf=(unsigned char*)dest; + int n; + for (n = 0; n < nbByte; n++) { + buf[n] = (unsigned char)(x & 0xff); + x >>= 8; + } + + if (x != 0) + { /* data overflow - hack for ZIP64 */ + for (n = 0; n < nbByte; n++) + { + buf[n] = 0xff; + } + } +} + +/****************************************************************************/ + + +local uLong zip64local_TmzDateToDosDate(const tm_zip* ptm) +{ + uLong year = (uLong)ptm->tm_year; + if (year>=1980) + year-=1980; + else if (year>=80) + year-=80; + return + (uLong) (((ptm->tm_mday) + (32 * (ptm->tm_mon+1)) + (512 * year)) << 16) | + ((ptm->tm_sec/2) + (32* ptm->tm_min) + (2048 * (uLong)ptm->tm_hour)); +} + + +/****************************************************************************/ + +local int zip64local_getByte OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, int *pi)); + +local int zip64local_getByte(const zlib_filefunc64_32_def* pzlib_filefunc_def,voidpf filestream,int* pi) +{ + unsigned char c; + int err = (int)ZREAD64(*pzlib_filefunc_def,filestream,&c,1); + if (err==1) + { + *pi = (int)c; + return ZIP_OK; + } + else + { + if (ZERROR64(*pzlib_filefunc_def,filestream)) + return ZIP_ERRNO; + else + return ZIP_EOF; + } +} + + +/* =========================================================================== + Reads a long in LSB order from the given gz_stream. Sets +*/ +local int zip64local_getShort OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong *pX)); + +local int zip64local_getShort (const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong* pX) +{ + uLong x ; + int i = 0; + int err; + + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<8; + + if (err==ZIP_OK) + *pX = x; + else + *pX = 0; + return err; +} + +local int zip64local_getLong OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong *pX)); + +local int zip64local_getLong (const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong* pX) +{ + uLong x ; + int i = 0; + int err; + + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<8; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<16; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<24; + + if (err==ZIP_OK) + *pX = x; + else + *pX = 0; + return err; +} + +local int zip64local_getLong64 OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX)); + + +local int zip64local_getLong64 (const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX) +{ + ZPOS64_T x; + int i = 0; + int err; + + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x = (ZPOS64_T)i; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((ZPOS64_T)i)<<8; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((ZPOS64_T)i)<<16; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((ZPOS64_T)i)<<24; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((ZPOS64_T)i)<<32; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((ZPOS64_T)i)<<40; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((ZPOS64_T)i)<<48; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((ZPOS64_T)i)<<56; + + if (err==ZIP_OK) + *pX = x; + else + *pX = 0; + + return err; +} + +#ifndef BUFREADCOMMENT +#define BUFREADCOMMENT (0x400) +#endif +/* + Locate the Central directory of a zipfile (at the end, just before + the global comment) +*/ +local ZPOS64_T zip64local_SearchCentralDir OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream)); + +local ZPOS64_T zip64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream) +{ + unsigned char* buf; + ZPOS64_T uSizeFile; + ZPOS64_T uBackRead; + ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */ + ZPOS64_T uPosFound=0; + + if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) + return 0; + + + uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream); + + if (uMaxBack>uSizeFile) + uMaxBack = uSizeFile; + + buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); + if (buf==NULL) + return 0; + + uBackRead = 4; + while (uBackReaduMaxBack) + uBackRead = uMaxBack; + else + uBackRead+=BUFREADCOMMENT; + uReadPos = uSizeFile-uBackRead ; + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos); + if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) + break; + + if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) + break; + + for (i=(int)uReadSize-3; (i--)>0;) + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && + ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) + { + uPosFound = uReadPos+i; + break; + } + + if (uPosFound!=0) + break; + } + TRYFREE(buf); + return uPosFound; +} + +/* +Locate the End of Zip64 Central directory locator and from there find the CD of a zipfile (at the end, just before +the global comment) +*/ +local ZPOS64_T zip64local_SearchCentralDir64 OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream)); + +local ZPOS64_T zip64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream) +{ + unsigned char* buf; + ZPOS64_T uSizeFile; + ZPOS64_T uBackRead; + ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */ + ZPOS64_T uPosFound=0; + uLong uL; + ZPOS64_T relativeOffset; + + if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) + return 0; + + uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream); + + if (uMaxBack>uSizeFile) + uMaxBack = uSizeFile; + + buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); + if (buf==NULL) + return 0; + + uBackRead = 4; + while (uBackReaduMaxBack) + uBackRead = uMaxBack; + else + uBackRead+=BUFREADCOMMENT; + uReadPos = uSizeFile-uBackRead ; + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos); + if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) + break; + + if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) + break; + + for (i=(int)uReadSize-3; (i--)>0;) + { + // Signature "0x07064b50" Zip64 end of central directory locater + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07)) + { + uPosFound = uReadPos+i; + break; + } + } + + if (uPosFound!=0) + break; + } + + TRYFREE(buf); + if (uPosFound == 0) + return 0; + + /* Zip64 end of central directory locator */ + if (ZSEEK64(*pzlib_filefunc_def,filestream, uPosFound,ZLIB_FILEFUNC_SEEK_SET)!=0) + return 0; + + /* the signature, already checked */ + if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK) + return 0; + + /* number of the disk with the start of the zip64 end of central directory */ + if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK) + return 0; + if (uL != 0) + return 0; + + /* relative offset of the zip64 end of central directory record */ + if (zip64local_getLong64(pzlib_filefunc_def,filestream,&relativeOffset)!=ZIP_OK) + return 0; + + /* total number of disks */ + if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK) + return 0; + if (uL != 1) + return 0; + + /* Goto Zip64 end of central directory record */ + if (ZSEEK64(*pzlib_filefunc_def,filestream, relativeOffset,ZLIB_FILEFUNC_SEEK_SET)!=0) + return 0; + + /* the signature */ + if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK) + return 0; + + if (uL != 0x06064b50) // signature of 'Zip64 end of central directory' + return 0; + + return relativeOffset; +} + +int LoadCentralDirectoryRecord(zip64_internal* pziinit) +{ + int err=ZIP_OK; + ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ + + ZPOS64_T size_central_dir; /* size of the central directory */ + ZPOS64_T offset_central_dir; /* offset of start of central directory */ + ZPOS64_T central_pos; + uLong uL; + + uLong number_disk; /* number of the current dist, used for + spaning ZIP, unsupported, always 0*/ + uLong number_disk_with_CD; /* number the the disk with central dir, used + for spaning ZIP, unsupported, always 0*/ + ZPOS64_T number_entry; + ZPOS64_T number_entry_CD; /* total number of entries in + the central dir + (same than number_entry on nospan) */ + uLong VersionMadeBy; + uLong VersionNeeded; + uLong size_comment; + + int hasZIP64Record = 0; + + // check first if we find a ZIP64 record + central_pos = zip64local_SearchCentralDir64(&pziinit->z_filefunc,pziinit->filestream); + if(central_pos > 0) + { + hasZIP64Record = 1; + } + else if(central_pos == 0) + { + central_pos = zip64local_SearchCentralDir(&pziinit->z_filefunc,pziinit->filestream); + } + +/* disable to allow appending to empty ZIP archive + if (central_pos==0) + err=ZIP_ERRNO; +*/ + + if(hasZIP64Record) + { + ZPOS64_T sizeEndOfCentralDirectory; + if (ZSEEK64(pziinit->z_filefunc, pziinit->filestream, central_pos, ZLIB_FILEFUNC_SEEK_SET) != 0) + err=ZIP_ERRNO; + + /* the signature, already checked */ + if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream,&uL)!=ZIP_OK) + err=ZIP_ERRNO; + + /* size of zip64 end of central directory record */ + if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream, &sizeEndOfCentralDirectory)!=ZIP_OK) + err=ZIP_ERRNO; + + /* version made by */ + if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &VersionMadeBy)!=ZIP_OK) + err=ZIP_ERRNO; + + /* version needed to extract */ + if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &VersionNeeded)!=ZIP_OK) + err=ZIP_ERRNO; + + /* number of this disk */ + if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream,&number_disk)!=ZIP_OK) + err=ZIP_ERRNO; + + /* number of the disk with the start of the central directory */ + if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream,&number_disk_with_CD)!=ZIP_OK) + err=ZIP_ERRNO; + + /* total number of entries in the central directory on this disk */ + if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream, &number_entry)!=ZIP_OK) + err=ZIP_ERRNO; + + /* total number of entries in the central directory */ + if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream,&number_entry_CD)!=ZIP_OK) + err=ZIP_ERRNO; + + if ((number_entry_CD!=number_entry) || (number_disk_with_CD!=0) || (number_disk!=0)) + err=ZIP_BADZIPFILE; + + /* size of the central directory */ + if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream,&size_central_dir)!=ZIP_OK) + err=ZIP_ERRNO; + + /* offset of start of central directory with respect to the + starting disk number */ + if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream,&offset_central_dir)!=ZIP_OK) + err=ZIP_ERRNO; + + // TODO.. + // read the comment from the standard central header. + size_comment = 0; + } + else + { + // Read End of central Directory info + if (ZSEEK64(pziinit->z_filefunc, pziinit->filestream, central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) + err=ZIP_ERRNO; + + /* the signature, already checked */ + if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream,&uL)!=ZIP_OK) + err=ZIP_ERRNO; + + /* number of this disk */ + if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream,&number_disk)!=ZIP_OK) + err=ZIP_ERRNO; + + /* number of the disk with the start of the central directory */ + if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream,&number_disk_with_CD)!=ZIP_OK) + err=ZIP_ERRNO; + + /* total number of entries in the central dir on this disk */ + number_entry = 0; + if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &uL)!=ZIP_OK) + err=ZIP_ERRNO; + else + number_entry = uL; + + /* total number of entries in the central dir */ + number_entry_CD = 0; + if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &uL)!=ZIP_OK) + err=ZIP_ERRNO; + else + number_entry_CD = uL; + + if ((number_entry_CD!=number_entry) || (number_disk_with_CD!=0) || (number_disk!=0)) + err=ZIP_BADZIPFILE; + + /* size of the central directory */ + size_central_dir = 0; + if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream, &uL)!=ZIP_OK) + err=ZIP_ERRNO; + else + size_central_dir = uL; + + /* offset of start of central directory with respect to the starting disk number */ + offset_central_dir = 0; + if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream, &uL)!=ZIP_OK) + err=ZIP_ERRNO; + else + offset_central_dir = uL; + + + /* zipfile global comment length */ + if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &size_comment)!=ZIP_OK) + err=ZIP_ERRNO; + } + + if ((central_posz_filefunc, pziinit->filestream); + return ZIP_ERRNO; + } + + if (size_comment>0) + { + pziinit->globalcomment = (char*)ALLOC(size_comment+1); + if (pziinit->globalcomment) + { + size_comment = ZREAD64(pziinit->z_filefunc, pziinit->filestream, pziinit->globalcomment,size_comment); + pziinit->globalcomment[size_comment]=0; + } + } + + byte_before_the_zipfile = central_pos - (offset_central_dir+size_central_dir); + pziinit->add_position_when_writting_offset = byte_before_the_zipfile; + + { + ZPOS64_T size_central_dir_to_read = size_central_dir; + size_t buf_size = SIZEDATA_INDATABLOCK; + void* buf_read = (void*)ALLOC(buf_size); + if (ZSEEK64(pziinit->z_filefunc, pziinit->filestream, offset_central_dir + byte_before_the_zipfile, ZLIB_FILEFUNC_SEEK_SET) != 0) + err=ZIP_ERRNO; + + while ((size_central_dir_to_read>0) && (err==ZIP_OK)) + { + ZPOS64_T read_this = SIZEDATA_INDATABLOCK; + if (read_this > size_central_dir_to_read) + read_this = size_central_dir_to_read; + + if (ZREAD64(pziinit->z_filefunc, pziinit->filestream,buf_read,(uLong)read_this) != read_this) + err=ZIP_ERRNO; + + if (err==ZIP_OK) + err = add_data_in_datablock(&pziinit->central_dir,buf_read, (uLong)read_this); + + size_central_dir_to_read-=read_this; + } + TRYFREE(buf_read); + } + pziinit->begin_pos = byte_before_the_zipfile; + pziinit->number_entry = number_entry_CD; + + if (ZSEEK64(pziinit->z_filefunc, pziinit->filestream, offset_central_dir+byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET) != 0) + err=ZIP_ERRNO; + + return err; +} + + +#endif /* !NO_ADDFILEINEXISTINGZIP*/ + + +/************************************************************/ +extern zipFile ZEXPORT zipOpen3 (const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_32_def* pzlib_filefunc64_32_def) +{ + zip64_internal ziinit; + zip64_internal* zi; + int err=ZIP_OK; + + ziinit.z_filefunc.zseek32_file = NULL; + ziinit.z_filefunc.ztell32_file = NULL; + if (pzlib_filefunc64_32_def==NULL) + fill_fopen64_filefunc(&ziinit.z_filefunc.zfile_func64); + else + ziinit.z_filefunc = *pzlib_filefunc64_32_def; + + ziinit.filestream = ZOPEN64(ziinit.z_filefunc, + pathname, + (append == APPEND_STATUS_CREATE) ? + (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_CREATE) : + (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_EXISTING)); + + if (ziinit.filestream == NULL) + return NULL; + + if (append == APPEND_STATUS_CREATEAFTER) + ZSEEK64(ziinit.z_filefunc,ziinit.filestream,0,SEEK_END); + + ziinit.begin_pos = ZTELL64(ziinit.z_filefunc,ziinit.filestream); + ziinit.in_opened_file_inzip = 0; + ziinit.ci.stream_initialised = 0; + ziinit.number_entry = 0; + ziinit.add_position_when_writting_offset = 0; + init_linkedlist(&(ziinit.central_dir)); + + + + zi = (zip64_internal*)ALLOC(sizeof(zip64_internal)); + if (zi==NULL) + { + ZCLOSE64(ziinit.z_filefunc,ziinit.filestream); + return NULL; + } + + /* now we add file in a zipfile */ +# ifndef NO_ADDFILEINEXISTINGZIP + ziinit.globalcomment = NULL; + if (append == APPEND_STATUS_ADDINZIP) + { + // Read and Cache Central Directory Records + err = LoadCentralDirectoryRecord(&ziinit); + } + + if (globalcomment) + { + *globalcomment = ziinit.globalcomment; + } +# endif /* !NO_ADDFILEINEXISTINGZIP*/ + + if (err != ZIP_OK) + { +# ifndef NO_ADDFILEINEXISTINGZIP + TRYFREE(ziinit.globalcomment); +# endif /* !NO_ADDFILEINEXISTINGZIP*/ + TRYFREE(zi); + return NULL; + } + else + { + *zi = ziinit; + return (zipFile)zi; + } +} + +extern zipFile ZEXPORT zipOpen2 (const char *pathname, int append, zipcharpc* globalcomment, zlib_filefunc_def* pzlib_filefunc32_def) +{ + if (pzlib_filefunc32_def != NULL) + { + zlib_filefunc64_32_def zlib_filefunc64_32_def_fill; + fill_zlib_filefunc64_32_def_from_filefunc32(&zlib_filefunc64_32_def_fill,pzlib_filefunc32_def); + return zipOpen3(pathname, append, globalcomment, &zlib_filefunc64_32_def_fill); + } + else + return zipOpen3(pathname, append, globalcomment, NULL); +} + +extern zipFile ZEXPORT zipOpen2_64 (const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_def* pzlib_filefunc_def) +{ + if (pzlib_filefunc_def != NULL) + { + zlib_filefunc64_32_def zlib_filefunc64_32_def_fill; + zlib_filefunc64_32_def_fill.zfile_func64 = *pzlib_filefunc_def; + zlib_filefunc64_32_def_fill.ztell32_file = NULL; + zlib_filefunc64_32_def_fill.zseek32_file = NULL; + return zipOpen3(pathname, append, globalcomment, &zlib_filefunc64_32_def_fill); + } + else + return zipOpen3(pathname, append, globalcomment, NULL); +} + + + +extern zipFile ZEXPORT zipOpen (const char* pathname, int append) +{ + return zipOpen3((const void*)pathname,append,NULL,NULL); +} + +extern zipFile ZEXPORT zipOpen64 (const void* pathname, int append) +{ + return zipOpen3(pathname,append,NULL,NULL); +} + +int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt size_extrafield_local, const void* extrafield_local) +{ + /* write the local header */ + int err; + uInt size_filename = (uInt)strlen(filename); + uInt size_extrafield = size_extrafield_local; + + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)LOCALHEADERMAGIC, 4); + + if (err==ZIP_OK) + { + if(zi->ci.zip64) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)45,2);/* version needed to extract */ + else + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)20,2);/* version needed to extract */ + } + + if (err==ZIP_OK) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.flag,2); + + if (err==ZIP_OK) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.method,2); + + if (err==ZIP_OK) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.dosDate,4); + + // CRC / Compressed size / Uncompressed size will be filled in later and rewritten later + if (err==ZIP_OK) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* crc 32, unknown */ + if (err==ZIP_OK) + { + if(zi->ci.zip64) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xFFFFFFFF,4); /* compressed size, unknown */ + else + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* compressed size, unknown */ + } + if (err==ZIP_OK) + { + if(zi->ci.zip64) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xFFFFFFFF,4); /* uncompressed size, unknown */ + else + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* uncompressed size, unknown */ + } + + if (err==ZIP_OK) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_filename,2); + + if(zi->ci.zip64) + { + size_extrafield += 20; + } + + if (err==ZIP_OK) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_extrafield,2); + + if ((err==ZIP_OK) && (size_filename > 0)) + { + if (ZWRITE64(zi->z_filefunc,zi->filestream,filename,size_filename)!=size_filename) + err = ZIP_ERRNO; + } + + if ((err==ZIP_OK) && (size_extrafield_local > 0)) + { + if (ZWRITE64(zi->z_filefunc, zi->filestream, extrafield_local, size_extrafield_local) != size_extrafield_local) + err = ZIP_ERRNO; + } + + + if ((err==ZIP_OK) && (zi->ci.zip64)) + { + // write the Zip64 extended info + short HeaderID = 1; + short DataSize = 16; + ZPOS64_T CompressedSize = 0; + ZPOS64_T UncompressedSize = 0; + + // Remember position of Zip64 extended info for the local file header. (needed when we update size after done with file) + zi->ci.pos_zip64extrainfo = ZTELL64(zi->z_filefunc,zi->filestream); + + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (short)HeaderID,2); + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (short)DataSize,2); + + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)UncompressedSize,8); + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)CompressedSize,8); + } + + return err; +} + +/* + NOTE. + When writing RAW the ZIP64 extended information in extrafield_local and extrafield_global needs to be stripped + before calling this function it can be done with zipRemoveExtraInfoBlock + + It is not done here because then we need to realloc a new buffer since parameters are 'const' and I want to minimize + unnecessary allocations. + */ +extern int ZEXPORT zipOpenNewFileInZip4_64 (zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, + int windowBits,int memLevel, int strategy, + const char* password, uLong crcForCrypting, + uLong versionMadeBy, uLong flagBase, int zip64) +{ + zip64_internal* zi; + uInt size_filename; + uInt size_comment; + uInt i; + int err = ZIP_OK; + +# ifdef NOCRYPT + if (password != NULL) + return ZIP_PARAMERROR; +# endif + + if (file == NULL) + return ZIP_PARAMERROR; + +#ifdef HAVE_BZIP2 + if ((method!=0) && (method!=Z_DEFLATED) && (method!=Z_BZIP2ED)) + return ZIP_PARAMERROR; +#else + if ((method!=0) && (method!=Z_DEFLATED)) + return ZIP_PARAMERROR; +#endif + + zi = (zip64_internal*)file; + + if (zi->in_opened_file_inzip == 1) + { + err = zipCloseFileInZip (file); + if (err != ZIP_OK) + return err; + } + + if (filename==NULL) + filename="-"; + + if (comment==NULL) + size_comment = 0; + else + size_comment = (uInt)strlen(comment); + + size_filename = (uInt)strlen(filename); + + if (zipfi == NULL) + zi->ci.dosDate = 0; + else + { + if (zipfi->dosDate != 0) + zi->ci.dosDate = zipfi->dosDate; + else + zi->ci.dosDate = zip64local_TmzDateToDosDate(&zipfi->tmz_date); + } + + zi->ci.flag = flagBase; + if ((level==8) || (level==9)) + zi->ci.flag |= 2; + if (level==2) + zi->ci.flag |= 4; + if (level==1) + zi->ci.flag |= 6; + if (password != NULL) + zi->ci.flag |= 1; + + zi->ci.crc32 = 0; + zi->ci.method = method; + zi->ci.encrypt = 0; + zi->ci.stream_initialised = 0; + zi->ci.pos_in_buffered_data = 0; + zi->ci.raw = raw; + zi->ci.pos_local_header = ZTELL64(zi->z_filefunc,zi->filestream); + + zi->ci.size_centralheader = SIZECENTRALHEADER + size_filename + size_extrafield_global + size_comment; + zi->ci.size_centralExtraFree = 32; // Extra space we have reserved in case we need to add ZIP64 extra info data + + zi->ci.central_header = (char*)ALLOC((uInt)zi->ci.size_centralheader + zi->ci.size_centralExtraFree); + + zi->ci.size_centralExtra = size_extrafield_global; + zip64local_putValue_inmemory(zi->ci.central_header,(uLong)CENTRALHEADERMAGIC,4); + /* version info */ + zip64local_putValue_inmemory(zi->ci.central_header+4,(uLong)versionMadeBy,2); + zip64local_putValue_inmemory(zi->ci.central_header+6,(uLong)20,2); + zip64local_putValue_inmemory(zi->ci.central_header+8,(uLong)zi->ci.flag,2); + zip64local_putValue_inmemory(zi->ci.central_header+10,(uLong)zi->ci.method,2); + zip64local_putValue_inmemory(zi->ci.central_header+12,(uLong)zi->ci.dosDate,4); + zip64local_putValue_inmemory(zi->ci.central_header+16,(uLong)0,4); /*crc*/ + zip64local_putValue_inmemory(zi->ci.central_header+20,(uLong)0,4); /*compr size*/ + zip64local_putValue_inmemory(zi->ci.central_header+24,(uLong)0,4); /*uncompr size*/ + zip64local_putValue_inmemory(zi->ci.central_header+28,(uLong)size_filename,2); + zip64local_putValue_inmemory(zi->ci.central_header+30,(uLong)size_extrafield_global,2); + zip64local_putValue_inmemory(zi->ci.central_header+32,(uLong)size_comment,2); + zip64local_putValue_inmemory(zi->ci.central_header+34,(uLong)0,2); /*disk nm start*/ + + if (zipfi==NULL) + zip64local_putValue_inmemory(zi->ci.central_header+36,(uLong)0,2); + else + zip64local_putValue_inmemory(zi->ci.central_header+36,(uLong)zipfi->internal_fa,2); + + if (zipfi==NULL) + zip64local_putValue_inmemory(zi->ci.central_header+38,(uLong)0,4); + else + zip64local_putValue_inmemory(zi->ci.central_header+38,(uLong)zipfi->external_fa,4); + + if(zi->ci.pos_local_header >= 0xffffffff) + zip64local_putValue_inmemory(zi->ci.central_header+42,(uLong)0xffffffff,4); + else + zip64local_putValue_inmemory(zi->ci.central_header+42,(uLong)zi->ci.pos_local_header - zi->add_position_when_writting_offset,4); + + for (i=0;ici.central_header+SIZECENTRALHEADER+i) = *(filename+i); + + for (i=0;ici.central_header+SIZECENTRALHEADER+size_filename+i) = + *(((const char*)extrafield_global)+i); + + for (i=0;ici.central_header+SIZECENTRALHEADER+size_filename+ + size_extrafield_global+i) = *(comment+i); + if (zi->ci.central_header == NULL) + return ZIP_INTERNALERROR; + + zi->ci.zip64 = zip64; + zi->ci.totalCompressedData = 0; + zi->ci.totalUncompressedData = 0; + zi->ci.pos_zip64extrainfo = 0; + + err = Write_LocalFileHeader(zi, filename, size_extrafield_local, extrafield_local); + +#ifdef HAVE_BZIP2 + zi->ci.bstream.avail_in = (uInt)0; + zi->ci.bstream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.bstream.next_out = (char*)zi->ci.buffered_data; + zi->ci.bstream.total_in_hi32 = 0; + zi->ci.bstream.total_in_lo32 = 0; + zi->ci.bstream.total_out_hi32 = 0; + zi->ci.bstream.total_out_lo32 = 0; +#endif + + zi->ci.stream.avail_in = (uInt)0; + zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.stream.next_out = zi->ci.buffered_data; + zi->ci.stream.total_in = 0; + zi->ci.stream.total_out = 0; + zi->ci.stream.data_type = Z_BINARY; + +#ifdef HAVE_BZIP2 + if ((err==ZIP_OK) && (zi->ci.method == Z_DEFLATED || zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw)) +#else + if ((err==ZIP_OK) && (zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) +#endif + { + if(zi->ci.method == Z_DEFLATED) + { + zi->ci.stream.zalloc = (alloc_func)0; + zi->ci.stream.zfree = (free_func)0; + zi->ci.stream.opaque = (voidpf)0; + + if (windowBits>0) + windowBits = -windowBits; + + err = deflateInit2(&zi->ci.stream, level, Z_DEFLATED, windowBits, memLevel, strategy); + + if (err==Z_OK) + zi->ci.stream_initialised = Z_DEFLATED; + } + else if(zi->ci.method == Z_BZIP2ED) + { +#ifdef HAVE_BZIP2 + // Init BZip stuff here + zi->ci.bstream.bzalloc = 0; + zi->ci.bstream.bzfree = 0; + zi->ci.bstream.opaque = (voidpf)0; + + err = BZ2_bzCompressInit(&zi->ci.bstream, level, 0,35); + if(err == BZ_OK) + zi->ci.stream_initialised = Z_BZIP2ED; +#endif + } + + } + +# ifndef NOCRYPT + zi->ci.crypt_header_size = 0; + if ((err==Z_OK) && (password != NULL)) + { + unsigned char bufHead[RAND_HEAD_LEN]; + unsigned int sizeHead; + zi->ci.encrypt = 1; + zi->ci.pcrc_32_tab = get_crc_table(); + /*init_keys(password,zi->ci.keys,zi->ci.pcrc_32_tab);*/ + + sizeHead=crypthead(password,bufHead,RAND_HEAD_LEN,zi->ci.keys,zi->ci.pcrc_32_tab,crcForCrypting); + zi->ci.crypt_header_size = sizeHead; + + if (ZWRITE64(zi->z_filefunc,zi->filestream,bufHead,sizeHead) != sizeHead) + err = ZIP_ERRNO; + } +# endif + + if (err==Z_OK) + zi->in_opened_file_inzip = 1; + return err; +} + +extern int ZEXPORT zipOpenNewFileInZip4 (zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, + int windowBits,int memLevel, int strategy, + const char* password, uLong crcForCrypting, + uLong versionMadeBy, uLong flagBase) +{ + return zipOpenNewFileInZip4_64 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + windowBits, memLevel, strategy, + password, crcForCrypting, versionMadeBy, flagBase, 0); +} + +extern int ZEXPORT zipOpenNewFileInZip3 (zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, + int windowBits,int memLevel, int strategy, + const char* password, uLong crcForCrypting) +{ + return zipOpenNewFileInZip4_64 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + windowBits, memLevel, strategy, + password, crcForCrypting, VERSIONMADEBY, 0, 0); +} + +extern int ZEXPORT zipOpenNewFileInZip3_64(zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, + int windowBits,int memLevel, int strategy, + const char* password, uLong crcForCrypting, int zip64) +{ + return zipOpenNewFileInZip4_64 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + windowBits, memLevel, strategy, + password, crcForCrypting, VERSIONMADEBY, 0, zip64); +} + +extern int ZEXPORT zipOpenNewFileInZip2(zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw) +{ + return zipOpenNewFileInZip4_64 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + NULL, 0, VERSIONMADEBY, 0, 0); +} + +extern int ZEXPORT zipOpenNewFileInZip2_64(zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, int zip64) +{ + return zipOpenNewFileInZip4_64 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + NULL, 0, VERSIONMADEBY, 0, zip64); +} + +extern int ZEXPORT zipOpenNewFileInZip64 (zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void*extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int zip64) +{ + return zipOpenNewFileInZip4_64 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, 0, + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + NULL, 0, VERSIONMADEBY, 0, zip64); +} + +extern int ZEXPORT zipOpenNewFileInZip (zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void*extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level) +{ + return zipOpenNewFileInZip4_64 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, 0, + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + NULL, 0, VERSIONMADEBY, 0, 0); +} + +local int zip64FlushWriteBuffer(zip64_internal* zi) +{ + int err=ZIP_OK; + + if (zi->ci.encrypt != 0) + { +#ifndef NOCRYPT + uInt i; + int t; + for (i=0;ici.pos_in_buffered_data;i++) + zi->ci.buffered_data[i] = zencode(zi->ci.keys, zi->ci.pcrc_32_tab, zi->ci.buffered_data[i],t); +#endif + } + + if (ZWRITE64(zi->z_filefunc,zi->filestream,zi->ci.buffered_data,zi->ci.pos_in_buffered_data) != zi->ci.pos_in_buffered_data) + err = ZIP_ERRNO; + + zi->ci.totalCompressedData += zi->ci.pos_in_buffered_data; + +#ifdef HAVE_BZIP2 + if(zi->ci.method == Z_BZIP2ED) + { + zi->ci.totalUncompressedData += zi->ci.bstream.total_in_lo32; + zi->ci.bstream.total_in_lo32 = 0; + zi->ci.bstream.total_in_hi32 = 0; + } + else +#endif + { + zi->ci.totalUncompressedData += zi->ci.stream.total_in; + zi->ci.stream.total_in = 0; + } + + + zi->ci.pos_in_buffered_data = 0; + + return err; +} + +extern int ZEXPORT zipWriteInFileInZip (zipFile file,const void* buf,unsigned int len) +{ + zip64_internal* zi; + int err=ZIP_OK; + + if (file == NULL) + return ZIP_PARAMERROR; + zi = (zip64_internal*)file; + + if (zi->in_opened_file_inzip == 0) + return ZIP_PARAMERROR; + + zi->ci.crc32 = crc32(zi->ci.crc32,buf,(uInt)len); + +#ifdef HAVE_BZIP2 + if(zi->ci.method == Z_BZIP2ED && (!zi->ci.raw)) + { + zi->ci.bstream.next_in = (void*)buf; + zi->ci.bstream.avail_in = len; + err = BZ_RUN_OK; + + while ((err==BZ_RUN_OK) && (zi->ci.bstream.avail_in>0)) + { + if (zi->ci.bstream.avail_out == 0) + { + if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO) + err = ZIP_ERRNO; + zi->ci.bstream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.bstream.next_out = (char*)zi->ci.buffered_data; + } + + + if(err != BZ_RUN_OK) + break; + + if ((zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw)) + { + uLong uTotalOutBefore_lo = zi->ci.bstream.total_out_lo32; +// uLong uTotalOutBefore_hi = zi->ci.bstream.total_out_hi32; + err=BZ2_bzCompress(&zi->ci.bstream, BZ_RUN); + + zi->ci.pos_in_buffered_data += (uInt)(zi->ci.bstream.total_out_lo32 - uTotalOutBefore_lo) ; + } + } + + if(err == BZ_RUN_OK) + err = ZIP_OK; + } + else +#endif + { + zi->ci.stream.next_in = (Bytef*)buf; + zi->ci.stream.avail_in = len; + + while ((err==ZIP_OK) && (zi->ci.stream.avail_in>0)) + { + if (zi->ci.stream.avail_out == 0) + { + if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO) + err = ZIP_ERRNO; + zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.stream.next_out = zi->ci.buffered_data; + } + + + if(err != ZIP_OK) + break; + + if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) + { + uLong uTotalOutBefore = zi->ci.stream.total_out; + err=deflate(&zi->ci.stream, Z_NO_FLUSH); + if(uTotalOutBefore > zi->ci.stream.total_out) + { + int bBreak = 0; + bBreak++; + } + + zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ; + } + else + { + uInt copy_this,i; + if (zi->ci.stream.avail_in < zi->ci.stream.avail_out) + copy_this = zi->ci.stream.avail_in; + else + copy_this = zi->ci.stream.avail_out; + + for (i = 0; i < copy_this; i++) + *(((char*)zi->ci.stream.next_out)+i) = + *(((const char*)zi->ci.stream.next_in)+i); + { + zi->ci.stream.avail_in -= copy_this; + zi->ci.stream.avail_out-= copy_this; + zi->ci.stream.next_in+= copy_this; + zi->ci.stream.next_out+= copy_this; + zi->ci.stream.total_in+= copy_this; + zi->ci.stream.total_out+= copy_this; + zi->ci.pos_in_buffered_data += copy_this; + } + } + }// while(...) + } + + return err; +} + +extern int ZEXPORT zipCloseFileInZipRaw (zipFile file, uLong uncompressed_size, uLong crc32) +{ + return zipCloseFileInZipRaw64 (file, uncompressed_size, crc32); +} + +extern int ZEXPORT zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_size, uLong crc32) +{ + zip64_internal* zi; + ZPOS64_T compressed_size; + uLong invalidValue = 0xffffffff; + short datasize = 0; + int err=ZIP_OK; + + if (file == NULL) + return ZIP_PARAMERROR; + zi = (zip64_internal*)file; + + if (zi->in_opened_file_inzip == 0) + return ZIP_PARAMERROR; + zi->ci.stream.avail_in = 0; + + if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) + { + while (err==ZIP_OK) + { + uLong uTotalOutBefore; + if (zi->ci.stream.avail_out == 0) + { + if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO) + err = ZIP_ERRNO; + zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.stream.next_out = zi->ci.buffered_data; + } + uTotalOutBefore = zi->ci.stream.total_out; + err=deflate(&zi->ci.stream, Z_FINISH); + zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ; + } + } + else if ((zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw)) + { +#ifdef HAVE_BZIP2 + err = BZ_FINISH_OK; + while (err==BZ_FINISH_OK) + { + uLong uTotalOutBefore; + if (zi->ci.bstream.avail_out == 0) + { + if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO) + err = ZIP_ERRNO; + zi->ci.bstream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.bstream.next_out = (char*)zi->ci.buffered_data; + } + uTotalOutBefore = zi->ci.bstream.total_out_lo32; + err=BZ2_bzCompress(&zi->ci.bstream, BZ_FINISH); + if(err == BZ_STREAM_END) + err = Z_STREAM_END; + + zi->ci.pos_in_buffered_data += (uInt)(zi->ci.bstream.total_out_lo32 - uTotalOutBefore); + } + + if(err == BZ_FINISH_OK) + err = ZIP_OK; +#endif + } + + if (err==Z_STREAM_END) + err=ZIP_OK; /* this is normal */ + + if ((zi->ci.pos_in_buffered_data>0) && (err==ZIP_OK)) + { + if (zip64FlushWriteBuffer(zi)==ZIP_ERRNO) + err = ZIP_ERRNO; + } + + if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) + { + int tmp_err = deflateEnd(&zi->ci.stream); + if (err == ZIP_OK) + err = tmp_err; + zi->ci.stream_initialised = 0; + } +#ifdef HAVE_BZIP2 + else if((zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw)) + { + int tmperr = BZ2_bzCompressEnd(&zi->ci.bstream); + if (err==ZIP_OK) + err = tmperr; + zi->ci.stream_initialised = 0; + } +#endif + + if (!zi->ci.raw) + { + crc32 = (uLong)zi->ci.crc32; + uncompressed_size = zi->ci.totalUncompressedData; + } + compressed_size = zi->ci.totalCompressedData; + +# ifndef NOCRYPT + compressed_size += zi->ci.crypt_header_size; +# endif + + // update Current Item crc and sizes, + if(compressed_size >= 0xffffffff || uncompressed_size >= 0xffffffff || zi->ci.pos_local_header >= 0xffffffff) + { + /*version Made by*/ + zip64local_putValue_inmemory(zi->ci.central_header+4,(uLong)45,2); + /*version needed*/ + zip64local_putValue_inmemory(zi->ci.central_header+6,(uLong)45,2); + + } + + zip64local_putValue_inmemory(zi->ci.central_header+16,crc32,4); /*crc*/ + + + if(compressed_size >= 0xffffffff) + zip64local_putValue_inmemory(zi->ci.central_header+20, invalidValue,4); /*compr size*/ + else + zip64local_putValue_inmemory(zi->ci.central_header+20, compressed_size,4); /*compr size*/ + + /// set internal file attributes field + if (zi->ci.stream.data_type == Z_ASCII) + zip64local_putValue_inmemory(zi->ci.central_header+36,(uLong)Z_ASCII,2); + + if(uncompressed_size >= 0xffffffff) + zip64local_putValue_inmemory(zi->ci.central_header+24, invalidValue,4); /*uncompr size*/ + else + zip64local_putValue_inmemory(zi->ci.central_header+24, uncompressed_size,4); /*uncompr size*/ + + // Add ZIP64 extra info field for uncompressed size + if(uncompressed_size >= 0xffffffff) + datasize += 8; + + // Add ZIP64 extra info field for compressed size + if(compressed_size >= 0xffffffff) + datasize += 8; + + // Add ZIP64 extra info field for relative offset to local file header of current file + if(zi->ci.pos_local_header >= 0xffffffff) + datasize += 8; + + if(datasize > 0) + { + char* p = NULL; + + if((uLong)(datasize + 4) > zi->ci.size_centralExtraFree) + { + // we can not write more data to the buffer that we have room for. + return ZIP_BADZIPFILE; + } + + p = zi->ci.central_header + zi->ci.size_centralheader; + + // Add Extra Information Header for 'ZIP64 information' + zip64local_putValue_inmemory(p, 0x0001, 2); // HeaderID + p += 2; + zip64local_putValue_inmemory(p, datasize, 2); // DataSize + p += 2; + + if(uncompressed_size >= 0xffffffff) + { + zip64local_putValue_inmemory(p, uncompressed_size, 8); + p += 8; + } + + if(compressed_size >= 0xffffffff) + { + zip64local_putValue_inmemory(p, compressed_size, 8); + p += 8; + } + + if(zi->ci.pos_local_header >= 0xffffffff) + { + zip64local_putValue_inmemory(p, zi->ci.pos_local_header, 8); + p += 8; + } + + // Update how much extra free space we got in the memory buffer + // and increase the centralheader size so the new ZIP64 fields are included + // ( 4 below is the size of HeaderID and DataSize field ) + zi->ci.size_centralExtraFree -= datasize + 4; + zi->ci.size_centralheader += datasize + 4; + + // Update the extra info size field + zi->ci.size_centralExtra += datasize + 4; + zip64local_putValue_inmemory(zi->ci.central_header+30,(uLong)zi->ci.size_centralExtra,2); + } + + if (err==ZIP_OK) + err = add_data_in_datablock(&zi->central_dir, zi->ci.central_header, (uLong)zi->ci.size_centralheader); + + free(zi->ci.central_header); + + if (err==ZIP_OK) + { + // Update the LocalFileHeader with the new values. + + ZPOS64_T cur_pos_inzip = ZTELL64(zi->z_filefunc,zi->filestream); + + if (ZSEEK64(zi->z_filefunc,zi->filestream, zi->ci.pos_local_header + 14,ZLIB_FILEFUNC_SEEK_SET)!=0) + err = ZIP_ERRNO; + + if (err==ZIP_OK) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,crc32,4); /* crc 32, unknown */ + + if(uncompressed_size >= 0xffffffff || compressed_size >= 0xffffffff ) + { + if(zi->ci.pos_zip64extrainfo > 0) + { + // Update the size in the ZIP64 extended field. + if (ZSEEK64(zi->z_filefunc,zi->filestream, zi->ci.pos_zip64extrainfo + 4,ZLIB_FILEFUNC_SEEK_SET)!=0) + err = ZIP_ERRNO; + + if (err==ZIP_OK) /* compressed size, unknown */ + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, uncompressed_size, 8); + + if (err==ZIP_OK) /* uncompressed size, unknown */ + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, compressed_size, 8); + } + else + err = ZIP_BADZIPFILE; // Caller passed zip64 = 0, so no room for zip64 info -> fatal + } + else + { + if (err==ZIP_OK) /* compressed size, unknown */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,compressed_size,4); + + if (err==ZIP_OK) /* uncompressed size, unknown */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,uncompressed_size,4); + } + + if (ZSEEK64(zi->z_filefunc,zi->filestream, cur_pos_inzip,ZLIB_FILEFUNC_SEEK_SET)!=0) + err = ZIP_ERRNO; + } + + zi->number_entry ++; + zi->in_opened_file_inzip = 0; + + return err; +} + +extern int ZEXPORT zipCloseFileInZip (zipFile file) +{ + return zipCloseFileInZipRaw (file,0,0); +} + +int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal* zi, ZPOS64_T zip64eocd_pos_inzip) +{ + int err = ZIP_OK; + ZPOS64_T pos = zip64eocd_pos_inzip - zi->add_position_when_writting_offset; + + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ZIP64ENDLOCHEADERMAGIC,4); + + /*num disks*/ + if (err==ZIP_OK) /* number of the disk with the start of the central directory */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); + + /*relative offset*/ + if (err==ZIP_OK) /* Relative offset to the Zip64EndOfCentralDirectory */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream, pos,8); + + /*total disks*/ /* Do not support spawning of disk so always say 1 here*/ + if (err==ZIP_OK) /* number of the disk with the start of the central directory */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)1,4); + + return err; +} + +int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) +{ + int err = ZIP_OK; + + uLong Zip64DataSize = 44; + + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ZIP64ENDHEADERMAGIC,4); + + if (err==ZIP_OK) /* size of this 'zip64 end of central directory' */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(ZPOS64_T)Zip64DataSize,8); // why ZPOS64_T of this ? + + if (err==ZIP_OK) /* version made by */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)45,2); + + if (err==ZIP_OK) /* version needed */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)45,2); + + if (err==ZIP_OK) /* number of this disk */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); + + if (err==ZIP_OK) /* number of the disk with the start of the central directory */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); + + if (err==ZIP_OK) /* total number of entries in the central dir on this disk */ + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, zi->number_entry, 8); + + if (err==ZIP_OK) /* total number of entries in the central dir */ + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, zi->number_entry, 8); + + if (err==ZIP_OK) /* size of the central directory */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(ZPOS64_T)size_centraldir,8); + + if (err==ZIP_OK) /* offset of start of central directory with respect to the starting disk number */ + { + ZPOS64_T pos = centraldir_pos_inzip - zi->add_position_when_writting_offset; + err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (ZPOS64_T)pos,8); + } + return err; +} +int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) +{ + int err = ZIP_OK; + + /*signature*/ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ENDHEADERMAGIC,4); + + if (err==ZIP_OK) /* number of this disk */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2); + + if (err==ZIP_OK) /* number of the disk with the start of the central directory */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2); + + if (err==ZIP_OK) /* total number of entries in the central dir on this disk */ + { + { + if(zi->number_entry >= 0xFFFF) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xffff,2); // use value in ZIP64 record + else + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2); + } + } + + if (err==ZIP_OK) /* total number of entries in the central dir */ + { + if(zi->number_entry >= 0xFFFF) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xffff,2); // use value in ZIP64 record + else + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2); + } + + if (err==ZIP_OK) /* size of the central directory */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_centraldir,4); + + if (err==ZIP_OK) /* offset of start of central directory with respect to the starting disk number */ + { + ZPOS64_T pos = centraldir_pos_inzip - zi->add_position_when_writting_offset; + if(pos >= 0xffffffff) + { + err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (uLong)0xffffffff,4); + } + else + err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (uLong)(centraldir_pos_inzip - zi->add_position_when_writting_offset),4); + } + + return err; +} + +int Write_GlobalComment(zip64_internal* zi, const char* global_comment) +{ + int err = ZIP_OK; + uInt size_global_comment = 0; + + if(global_comment != NULL) + size_global_comment = (uInt)strlen(global_comment); + + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_global_comment,2); + + if (err == ZIP_OK && size_global_comment > 0) + { + if (ZWRITE64(zi->z_filefunc,zi->filestream, global_comment, size_global_comment) != size_global_comment) + err = ZIP_ERRNO; + } + return err; +} + +extern int ZEXPORT zipClose (zipFile file, const char* global_comment) +{ + zip64_internal* zi; + int err = 0; + uLong size_centraldir = 0; + ZPOS64_T centraldir_pos_inzip; + ZPOS64_T pos; + + if (file == NULL) + return ZIP_PARAMERROR; + + zi = (zip64_internal*)file; + + if (zi->in_opened_file_inzip == 1) + { + err = zipCloseFileInZip (file); + } + +#ifndef NO_ADDFILEINEXISTINGZIP + if (global_comment==NULL) + global_comment = zi->globalcomment; +#endif + + centraldir_pos_inzip = ZTELL64(zi->z_filefunc,zi->filestream); + + if (err==ZIP_OK) + { + linkedlist_datablock_internal* ldi = zi->central_dir.first_block; + while (ldi!=NULL) + { + if ((err==ZIP_OK) && (ldi->filled_in_this_block>0)) + { + if (ZWRITE64(zi->z_filefunc,zi->filestream, ldi->data, ldi->filled_in_this_block) != ldi->filled_in_this_block) + err = ZIP_ERRNO; + } + + size_centraldir += ldi->filled_in_this_block; + ldi = ldi->next_datablock; + } + } + free_linkedlist(&(zi->central_dir)); + + pos = centraldir_pos_inzip - zi->add_position_when_writting_offset; + if(pos >= 0xffffffff || zi->number_entry > 0xFFFF) + { + ZPOS64_T Zip64EOCDpos = ZTELL64(zi->z_filefunc,zi->filestream); + Write_Zip64EndOfCentralDirectoryRecord(zi, size_centraldir, centraldir_pos_inzip); + + Write_Zip64EndOfCentralDirectoryLocator(zi, Zip64EOCDpos); + } + + if (err==ZIP_OK) + err = Write_EndOfCentralDirectoryRecord(zi, size_centraldir, centraldir_pos_inzip); + + if(err == ZIP_OK) + err = Write_GlobalComment(zi, global_comment); + + if (ZCLOSE64(zi->z_filefunc,zi->filestream) != 0) + if (err == ZIP_OK) + err = ZIP_ERRNO; + +#ifndef NO_ADDFILEINEXISTINGZIP + TRYFREE(zi->globalcomment); +#endif + TRYFREE(zi); + + return err; +} + +extern int ZEXPORT zipRemoveExtraInfoBlock (char* pData, int* dataLen, short sHeader) +{ + char* p = pData; + int size = 0; + char* pNewHeader; + char* pTmp; + short header; + short dataSize; + + int retVal = ZIP_OK; + + if(pData == NULL || *dataLen < 4) + return ZIP_PARAMERROR; + + pNewHeader = (char*)ALLOC(*dataLen); + pTmp = pNewHeader; + + while(p < (pData + *dataLen)) + { + header = *(short*)p; + dataSize = *(((short*)p)+1); + + if( header == sHeader ) // Header found. + { + p += dataSize + 4; // skip it. do not copy to temp buffer + } + else + { + // Extra Info block should not be removed, So copy it to the temp buffer. + memcpy(pTmp, p, dataSize + 4); + p += dataSize + 4; + size += dataSize + 4; + } + + } + + if(size < *dataLen) + { + // clean old extra info block. + memset(pData,0, *dataLen); + + // copy the new extra info block over the old + if(size > 0) + memcpy(pData, pNewHeader, size); + + // set the new extra info size + *dataLen = size; + + retVal = ZIP_OK; + } + else + retVal = ZIP_ERRNO; + + TRYFREE(pNewHeader); + + return retVal; +} diff --git a/libmupen64plus/mupen64plus-core/src/main/zip/zip.h b/libmupen64plus/mupen64plus-core/src/main/zip/zip.h new file mode 100644 index 0000000000..8aaebb6234 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/main/zip/zip.h @@ -0,0 +1,362 @@ +/* zip.h -- IO on .zip files using zlib + Version 1.1, February 14h, 2010 + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications for Zip64 support + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + + --------------------------------------------------------------------------- + + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + --------------------------------------------------------------------------- + + Changes + + See header of zip.h + +*/ + +#ifndef _zip12_H +#define _zip12_H + +#ifdef __cplusplus +extern "C" { +#endif + +//#define HAVE_BZIP2 + +#ifndef _ZLIB_H +#include "zlib.h" +#endif + +#ifndef _ZLIBIOAPI_H +#include "ioapi.h" +#endif + +#ifdef HAVE_BZIP2 +#include "bzlib.h" +#endif + +#define Z_BZIP2ED 12 + +#if defined(STRICTZIP) || defined(STRICTZIPUNZIP) +/* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ +typedef struct TagzipFile__ { int unused; } zipFile__; +typedef zipFile__ *zipFile; +#else +typedef voidp zipFile; +#endif + +#define ZIP_OK (0) +#define ZIP_EOF (0) +#define ZIP_ERRNO (Z_ERRNO) +#define ZIP_PARAMERROR (-102) +#define ZIP_BADZIPFILE (-103) +#define ZIP_INTERNALERROR (-104) + +#ifndef DEF_MEM_LEVEL +# if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +# else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +# endif +#endif +/* default memLevel */ + +/* tm_zip contain date/time info */ +typedef struct tm_zip_s +{ + uInt tm_sec; /* seconds after the minute - [0,59] */ + uInt tm_min; /* minutes after the hour - [0,59] */ + uInt tm_hour; /* hours since midnight - [0,23] */ + uInt tm_mday; /* day of the month - [1,31] */ + uInt tm_mon; /* months since January - [0,11] */ + uInt tm_year; /* years - [1980..2044] */ +} tm_zip; + +typedef struct +{ + tm_zip tmz_date; /* date in understandable format */ + uLong dosDate; /* if dos_date == 0, tmu_date is used */ +/* uLong flag; */ /* general purpose bit flag 2 bytes */ + + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ +} zip_fileinfo; + +typedef const char* zipcharpc; + + +#define APPEND_STATUS_CREATE (0) +#define APPEND_STATUS_CREATEAFTER (1) +#define APPEND_STATUS_ADDINZIP (2) + +extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append)); +extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append)); +/* + Create a zipfile. + pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on + an Unix computer "zlib/zlib113.zip". + if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip + will be created at the end of the file. + (useful if the file contain a self extractor code) + if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will + add files in existing zip (be sure you don't add file that doesn't exist) + If the zipfile cannot be opened, the return value is NULL. + Else, the return value is a zipFile Handle, usable with other function + of this zip package. +*/ + +/* Note : there is no delete function into a zipfile. + If you want delete file into a zipfile, you must open a zipfile, and create another + Of couse, you can use RAW reading and writing to copy the file you did not want delte +*/ + +extern zipFile ZEXPORT zipOpen2 OF((const char *pathname, + int append, + zipcharpc* globalcomment, + zlib_filefunc_def* pzlib_filefunc_def)); + +extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname, + int append, + zipcharpc* globalcomment, + zlib_filefunc64_def* pzlib_filefunc_def)); + +extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level)); + +extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int zip64)); + +/* + Open a file in the ZIP for writing. + filename : the filename in zip (if NULL, '-' without quote will be used + *zipfi contain supplemental information + if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local + contains the extrafield data the the local header + if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global + contains the extrafield data the the local header + if comment != NULL, comment contain the comment string + method contain the compression method (0 for store, Z_DEFLATED for deflate) + level contain the level of compression (can be Z_DEFAULT_COMPRESSION) + zip64 is set to 1 if a zip64 extended information block should be added to the local file header. + this MUST be '1' if the uncompressed size is >= 0xffffffff. + +*/ + + +extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw)); + + +extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int zip64)); +/* + Same than zipOpenNewFileInZip, except if raw=1, we write raw file + */ + +extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int windowBits, + int memLevel, + int strategy, + const char* password, + uLong crcForCrypting)); + +extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int windowBits, + int memLevel, + int strategy, + const char* password, + uLong crcForCrypting, + int zip64 + )); + +/* + Same than zipOpenNewFileInZip2, except + windowBits,memLevel,,strategy : see parameter strategy in deflateInit2 + password : crypting password (NULL for no crypting) + crcForCrypting : crc of file to compress (needed for crypting) + */ + +extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int windowBits, + int memLevel, + int strategy, + const char* password, + uLong crcForCrypting, + uLong versionMadeBy, + uLong flagBase + )); + + +extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int windowBits, + int memLevel, + int strategy, + const char* password, + uLong crcForCrypting, + uLong versionMadeBy, + uLong flagBase, + int zip64 + )); +/* + Same than zipOpenNewFileInZip4, except + versionMadeBy : value for Version made by field + flag : value for flag field (compression level info will be added) + */ + + +extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, + const void* buf, + unsigned len)); +/* + Write data in the zipfile +*/ + +extern int ZEXPORT zipCloseFileInZip OF((zipFile file)); +/* + Close the current file in the zipfile +*/ + +extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, + uLong uncompressed_size, + uLong crc32)); + +extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file, + ZPOS64_T uncompressed_size, + uLong crc32)); + +/* + Close the current file in the zipfile, for file opened with + parameter raw=1 in zipOpenNewFileInZip2 + uncompressed_size and crc32 are value for the uncompressed size +*/ + +extern int ZEXPORT zipClose OF((zipFile file, + const char* global_comment)); +/* + Close the zipfile +*/ + + +extern int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader)); +/* + zipRemoveExtraInfoBlock - Added by Mathias Svensson + + Remove extra information block from a extra information data for the local file header or central directory header + + It is needed to remove ZIP64 extra information blocks when before data is written if using RAW mode. + + 0x0001 is the signature header for the ZIP64 extra information blocks + + usage. + Remove ZIP64 Extra information from a central director extra field data + zipRemoveExtraInfoBlock(pCenDirExtraFieldData, &nCenDirExtraFieldDataLen, 0x0001); + + Remove ZIP64 Extra information from a Local File Header extra field data + zipRemoveExtraInfoBlock(pLocalHeaderExtraFieldData, &nLocalHeaderExtraFieldDataLen, 0x0001); +*/ + +#ifdef __cplusplus +} +#endif + +#endif /* _zip64_H */ diff --git a/libmupen64plus/mupen64plus-core/src/memory/dma.c b/libmupen64plus/mupen64plus-core/src/memory/dma.c new file mode 100644 index 0000000000..7d23b0007e --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/memory/dma.c @@ -0,0 +1,387 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - dma.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include + +#include "api/m64p_types.h" + +#include "dma.h" +#include "memory.h" +#include "pif.h" +#include "flashram.h" + +#include "r4300/r4300.h" +#include "r4300/interupt.h" +#include "r4300/macros.h" +#include "r4300/ops.h" +#include "../r4300/new_dynarec/new_dynarec.h" + +#define M64P_CORE_PROTOTYPES 1 +#include "api/m64p_config.h" +#include "api/config.h" +#include "api/callbacks.h" +#include "main/main.h" +#include "main/rom.h" +#include "main/util.h" + +static unsigned char sram[0x8000]; + +static char *get_sram_path(void) +{ + return formatstr("%s%s.sra", get_savesrampath(), ROM_SETTINGS.goodname); +} + +static void sram_format(void) +{ + memset(sram, 0, sizeof(sram)); +} + +static void sram_read_file(void) +{ + char *filename = get_sram_path(); + + sram_format(); + switch (read_from_file(filename, sram, sizeof(sram))) + { + case file_open_error: + DebugMessage(M64MSG_VERBOSE, "couldn't open sram file '%s' for reading", filename); + sram_format(); + break; + case file_read_error: + DebugMessage(M64MSG_WARNING, "fread() failed on 32kb read from sram file '%s'", filename); + sram_format(); + break; + default: break; + } + + free(filename); +} + +static void sram_write_file(void) +{ + char *filename = get_sram_path(); + + switch (write_to_file(filename, sram, sizeof(sram))) + { + case file_open_error: + DebugMessage(M64MSG_WARNING, "couldn't open sram file '%s' for writing.", filename); + break; + case file_write_error: + DebugMessage(M64MSG_WARNING, "fwrite() failed on 32kb write to sram file '%s'", filename); + break; + default: break; + } + + free(filename); +} + +void dma_pi_read(void) +{ + unsigned int i; + + if (pi_register.pi_cart_addr_reg >= 0x08000000 + && pi_register.pi_cart_addr_reg < 0x08010000) + { + if (flashram_info.use_flashram != 1) + { + sram_read_file(); + + for (i=0; i < (pi_register.pi_rd_len_reg & 0xFFFFFF)+1; i++) + { + sram[((pi_register.pi_cart_addr_reg-0x08000000)+i)^S8] = + ((unsigned char*)rdram)[(pi_register.pi_dram_addr_reg+i)^S8]; + } + + sram_write_file(); + + flashram_info.use_flashram = -1; + } + else + { + dma_write_flashram(); + } + } + else + { + DebugMessage(M64MSG_WARNING, "Unknown dma read in dma_pi_read()"); + } + + pi_register.read_pi_status_reg |= 1; + update_count(); + add_interupt_event(PI_INT, 0x1000/*pi_register.pi_rd_len_reg*/); +} + +void dma_pi_write(void) +{ + unsigned int longueur; + int i; + + if (pi_register.pi_cart_addr_reg < 0x10000000) + { + if (pi_register.pi_cart_addr_reg >= 0x08000000 + && pi_register.pi_cart_addr_reg < 0x08010000) + { + if (flashram_info.use_flashram != 1) + { + int i; + + sram_read_file(); + + for (i=0; i<(int)(pi_register.pi_wr_len_reg & 0xFFFFFF)+1; i++) + { + ((unsigned char*)rdram)[(pi_register.pi_dram_addr_reg+i)^S8]= + sram[(((pi_register.pi_cart_addr_reg-0x08000000)&0xFFFF)+i)^S8]; + } + + flashram_info.use_flashram = -1; + } + else + { + dma_read_flashram(); + } + } + else if (pi_register.pi_cart_addr_reg >= 0x06000000 + && pi_register.pi_cart_addr_reg < 0x08000000) + { + } + else + { + DebugMessage(M64MSG_WARNING, "Unknown dma write 0x%x in dma_pi_write()", (int)pi_register.pi_cart_addr_reg); + } + + pi_register.read_pi_status_reg |= 1; + update_count(); + add_interupt_event(PI_INT, /*pi_register.pi_wr_len_reg*/0x1000); + + return; + } + + if (pi_register.pi_cart_addr_reg >= 0x1fc00000) // for paper mario + { + pi_register.read_pi_status_reg |= 1; + update_count(); + add_interupt_event(PI_INT, 0x1000); + + return; + } + + longueur = (pi_register.pi_wr_len_reg & 0xFFFFFF)+1; + i = (pi_register.pi_cart_addr_reg-0x10000000)&0x3FFFFFF; + longueur = (i + (int) longueur) > rom_size ? + (rom_size - i) : longueur; + longueur = (pi_register.pi_dram_addr_reg + longueur) > 0x7FFFFF ? + (0x7FFFFF - pi_register.pi_dram_addr_reg) : longueur; + + if (i>rom_size || pi_register.pi_dram_addr_reg > 0x7FFFFF) + { + pi_register.read_pi_status_reg |= 3; + update_count(); + add_interupt_event(PI_INT, longueur/8); + + return; + } + + if (r4300emu != CORE_PURE_INTERPRETER) + { + for (i=0; i<(int)longueur; i++) + { + unsigned long rdram_address1 = pi_register.pi_dram_addr_reg+i+0x80000000; + unsigned long rdram_address2 = pi_register.pi_dram_addr_reg+i+0xa0000000; + ((unsigned char*)rdram)[(pi_register.pi_dram_addr_reg+i)^S8]= + rom[(((pi_register.pi_cart_addr_reg-0x10000000)&0x3FFFFFF)+i)^S8]; + + if (!invalid_code[rdram_address1>>12]) + { + if (!blocks[rdram_address1>>12] || + blocks[rdram_address1>>12]->block[(rdram_address1&0xFFF)/4].ops != + current_instruction_table.NOTCOMPILED) + { + invalid_code[rdram_address1>>12] = 1; + } +#ifdef NEW_DYNAREC + invalidate_block(rdram_address1>>12); +#endif + } + if (!invalid_code[rdram_address2>>12]) + { + if (!blocks[rdram_address1>>12] || + blocks[rdram_address2>>12]->block[(rdram_address2&0xFFF)/4].ops != + current_instruction_table.NOTCOMPILED) + { + invalid_code[rdram_address2>>12] = 1; + } + } + } + } + else + { + for (i=0; i<(int)longueur; i++) + { + ((unsigned char*)rdram)[(pi_register.pi_dram_addr_reg+i)^S8]= + rom[(((pi_register.pi_cart_addr_reg-0x10000000)&0x3FFFFFF)+i)^S8]; + } + } + + // Set the RDRAM memory size when copying main ROM code + // (This is just a convenient way to run this code once at the beginning) + if (pi_register.pi_cart_addr_reg == 0x10001000) + { + switch (CIC_Chip) + { + case 1: + case 2: + case 3: + case 6: + { + if (ConfigGetParamInt(g_CoreConfig, "DisableExtraMem")) + { + rdram[0x318/4] = 0x400000; + } + else + { + rdram[0x318/4] = 0x800000; + } + break; + } + case 5: + { + if (ConfigGetParamInt(g_CoreConfig, "DisableExtraMem")) + { + rdram[0x3F0/4] = 0x400000; + } + else + { + rdram[0x3F0/4] = 0x800000; + } + break; + } + } + } + + pi_register.read_pi_status_reg |= 3; + update_count(); + add_interupt_event(PI_INT, longueur/8); + + return; +} + +void dma_sp_write(void) +{ + unsigned int i,j; + + unsigned int l = sp_register.sp_rd_len_reg; + + unsigned int length = ((l & 0xfff) | 7) + 1; + unsigned int count = ((l >> 12) & 0xff) + 1; + unsigned int skip = ((l >> 20) & 0xfff); + + unsigned int memaddr = sp_register.sp_mem_addr_reg & 0xfff; + unsigned int dramaddr = sp_register.sp_dram_addr_reg & 0xffffff; + + unsigned char *spmem = ((sp_register.sp_mem_addr_reg & 0x1000) != 0) ? (unsigned char*)SP_IMEM : (unsigned char*)SP_DMEM; + unsigned char *dram = (unsigned char*)rdram; + + for(j=0; j> 12) & 0xff) + 1; + unsigned int skip = ((l >> 20) & 0xfff); + + unsigned int memaddr = sp_register.sp_mem_addr_reg & 0xfff; + unsigned int dramaddr = sp_register.sp_dram_addr_reg & 0xffffff; + + unsigned char *spmem = ((sp_register.sp_mem_addr_reg & 0x1000) != 0) ? (unsigned char*)SP_IMEM : (unsigned char*)SP_DMEM; + unsigned char *dram = (unsigned char*)rdram; + + for(j=0; j +#include +#include + +#include "memory.h" +#include "flashram.h" + +#include "r4300/r4300.h" + +#include "api/m64p_types.h" +#include "api/callbacks.h" +#include "main/main.h" +#include "main/rom.h" +#include "main/util.h" + +Flashram_info flashram_info; + +typedef enum flashram_mode +{ + NOPES_MODE = 0, + ERASE_MODE, + WRITE_MODE, + READ_MODE, + STATUS_MODE +} Flashram_mode; + +static unsigned char flashram[0x20000]; + +static char *get_flashram_path(void) +{ + return formatstr("%s%s.fla", get_savesrampath(), ROM_SETTINGS.goodname); +} + +static void flashram_format(void) +{ + memset(flashram, 0xff, sizeof(flashram)); +} + +static void flashram_read_file(void) +{ + char *filename = get_flashram_path(); + + flashram_format(); + switch (read_from_file(filename, flashram, sizeof(flashram))) + { + case file_open_error: + DebugMessage(M64MSG_WARNING, "couldn't open flash ram file '%s' for reading", filename); + flashram_format(); + break; + case file_read_error: + DebugMessage(M64MSG_WARNING, "couldn't read 128kb flash ram file '%s'", filename); + break; + default: break; + } + + free(filename); +} + +static void flashram_write_file(void) +{ + char *filename = get_flashram_path(); + + switch (write_to_file(filename, flashram, sizeof(flashram))) + { + case file_open_error: + DebugMessage(M64MSG_WARNING, "couldn't open flash ram file '%s' for writing", filename); + break; + case file_write_error: + DebugMessage(M64MSG_WARNING, "couldn't write 128kb flash ram file '%s'", filename); + break; + default: break; + } + + free(filename); +} + +void init_flashram(void) +{ + flashram_info.mode = NOPES_MODE; + flashram_info.status = 0; +} + +unsigned int flashram_status(void) +{ + return (unsigned int) (flashram_info.status >> 32); +} + +void flashram_command(unsigned int command) +{ + switch (command & 0xff000000) + { + case 0x4b000000: + flashram_info.erase_offset = (command & 0xffff) * 128; + break; + case 0x78000000: + flashram_info.mode = ERASE_MODE; + flashram_info.status = 0x1111800800c20000LL; + break; + case 0xa5000000: + flashram_info.erase_offset = (command & 0xffff) * 128; + flashram_info.status = 0x1111800400c20000LL; + break; + case 0xb4000000: + flashram_info.mode = WRITE_MODE; + break; + case 0xd2000000: // execute + switch (flashram_info.mode) + { + case NOPES_MODE: + break; + case ERASE_MODE: + { + unsigned int i; + flashram_read_file(); + for (i=flashram_info.erase_offset; i<(flashram_info.erase_offset+128); i++) + { + flashram[i^S8] = 0xff; + } + flashram_write_file(); + } + break; + case WRITE_MODE: + { + int i; + flashram_read_file(); + for (i=0; i<128; i++) + { + flashram[(flashram_info.erase_offset+i)^S8]= + ((unsigned char*)rdram)[(flashram_info.write_pointer+i)^S8]; + } + flashram_write_file(); + } + break; + case STATUS_MODE: + break; + default: + DebugMessage(M64MSG_WARNING, "unknown flashram command with mode:%x", (int)flashram_info.mode); + stop=1; + break; + } + flashram_info.mode = NOPES_MODE; + break; + case 0xe1000000: + flashram_info.mode = STATUS_MODE; + flashram_info.status = 0x1111800100c20000LL; + break; + case 0xf0000000: + flashram_info.mode = READ_MODE; + flashram_info.status = 0x11118004f0000000LL; + break; + default: + DebugMessage(M64MSG_WARNING, "unknown flashram command: %x", (int)command); + break; + } +} + +void dma_read_flashram(void) +{ + unsigned int i; + + switch (flashram_info.mode) + { + case STATUS_MODE: + rdram[pi_register.pi_dram_addr_reg/4] = (unsigned int)(flashram_info.status >> 32); + rdram[pi_register.pi_dram_addr_reg/4+1] = (unsigned int)(flashram_info.status); + break; + case READ_MODE: + flashram_read_file(); + for (i=0; i<(pi_register.pi_wr_len_reg & 0x0FFFFFF)+1; i++) + { + ((unsigned char*)rdram)[(pi_register.pi_dram_addr_reg+i)^S8]= + flashram[(((pi_register.pi_cart_addr_reg-0x08000000)&0xFFFF)*2+i)^S8]; + } + break; + default: + DebugMessage(M64MSG_WARNING, "unknown dma_read_flashram: %x", flashram_info.mode); + stop=1; + break; + } +} + +void dma_write_flashram(void) +{ + switch (flashram_info.mode) + { + case WRITE_MODE: + flashram_info.write_pointer = pi_register.pi_dram_addr_reg; + break; + default: + DebugMessage(M64MSG_ERROR, "unknown dma_write_flashram: %x", flashram_info.mode); + stop=1; + break; + } +} + diff --git a/libmupen64plus/mupen64plus-core/src/memory/flashram.h b/libmupen64plus/mupen64plus-core/src/memory/flashram.h new file mode 100644 index 0000000000..b2c6987d82 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/memory/flashram.h @@ -0,0 +1,36 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - flashram.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +typedef struct _flashram_info +{ + int use_flashram; + int mode; + unsigned long long status; + unsigned int erase_offset, write_pointer; +} Flashram_info; + +extern Flashram_info flashram_info; + +void init_flashram(void); +void flashram_command(unsigned int command); +unsigned int flashram_status(void); +void dma_read_flashram(void); +void dma_write_flashram(void); diff --git a/libmupen64plus/mupen64plus-core/src/memory/memory.c b/libmupen64plus/mupen64plus-core/src/memory/memory.c new file mode 100644 index 0000000000..caf65a0e9a --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/memory/memory.c @@ -0,0 +1,3719 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - memory.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include +#include +#include + +#if !defined(WIN32) +#include +#endif + +#include "api/m64p_types.h" + +#include "memory.h" +#include "dma.h" +#include "pif.h" +#include "flashram.h" + +#include "r4300/r4300.h" +#include "r4300/macros.h" +#include "r4300/interupt.h" +#include "r4300/recomph.h" +#include "r4300/ops.h" + +#include "api/callbacks.h" +#include "main/main.h" +#include "main/rom.h" +#include "osal/preproc.h" +#include "plugin/plugin.h" +#include "r4300/new_dynarec/new_dynarec.h" + +#ifdef DBG +#include "debugger/dbg_types.h" +#include "debugger/dbg_memory.h" +#include "debugger/dbg_breakpoints.h" +#endif + +/* definitions of the rcp's structures and memory area */ +RDRAM_register rdram_register; +mips_register MI_register; +PI_register pi_register; +SP_register sp_register; +RSP_register rsp_register; +SI_register si_register; +VI_register vi_register; +RI_register ri_register; +AI_register ai_register; +DPC_register dpc_register; +DPS_register dps_register; + +ALIGN(16, unsigned int rdram[0x800000/4]); + +unsigned char *rdramb = (unsigned char *)(rdram); +unsigned int SP_DMEM[0x1000/4*2]; +unsigned int *SP_IMEM = SP_DMEM+0x1000/4; +unsigned char *SP_DMEMb = (unsigned char *)(SP_DMEM); +unsigned char *SP_IMEMb = (unsigned char*)(SP_DMEM+0x1000/4); +unsigned int PIF_RAM[0x40/4]; +unsigned char *PIF_RAMb = (unsigned char *)(PIF_RAM); + +#if NEW_DYNAREC != NEW_DYNAREC_ARM +// address : address of the read/write operation being done +unsigned int address = 0; +#endif +// *address_low = the lower 16 bit of the address : +#ifdef M64P_BIG_ENDIAN +static unsigned short *address_low = (unsigned short *)(&address)+1; +#else +static unsigned short *address_low = (unsigned short *)(&address); +#endif + +// values that are being written are stored in these variables +#if NEW_DYNAREC != NEW_DYNAREC_ARM +unsigned int word; +unsigned char cpu_byte; +unsigned short hword; +unsigned long long int dword; +#endif + +// addresse where the read value will be stored +unsigned long long int* rdword; + +// trash : when we write to unmaped memory it is written here +static unsigned int trash; + +// hash tables of read functions +void (*readmem[0x10000])(void); +void (*readmemb[0x10000])(void); +void (*readmemh[0x10000])(void); +void (*readmemd[0x10000])(void); + +// hash tables of write functions +void (*writemem[0x10000])(void); +void (*writememb[0x10000])(void); +void (*writememd[0x10000])(void); +void (*writememh[0x10000])(void); + +// memory sections +unsigned int *readrdramreg[0x10000]; +unsigned int *readrspreg[0x10000]; +unsigned int *readrsp[0x10000]; +unsigned int *readmi[0x10000]; +unsigned int *readvi[0x10000]; +unsigned int *readai[0x10000]; +unsigned int *readpi[0x10000]; +unsigned int *readri[0x10000]; +unsigned int *readsi[0x10000]; +unsigned int *readdp[0x10000]; +unsigned int *readdps[0x10000]; + +// the frameBufferInfos +static FrameBufferInfo frameBufferInfos[6]; +static char framebufferRead[0x800]; +static int firstFrameBufferSetting; + +// uncomment to output count of calls to write_rdram(): +//#define COUNT_WRITE_RDRAM_CALLS 1 + +#if defined( COUNT_WRITE_RDRAM_CALLS ) + int writerdram_count = 1; +#endif + +int init_memory(int DoByteSwap) +{ + int i; + + if (DoByteSwap != 0) + { + //swap rom + unsigned int *roml = (unsigned int *) rom; + for (i=0; i<(rom_size/4); i++) roml[i] = sl(roml[i]); + } + + //init hash tables + for (i=0; i<(0x10000); i++) + { + readmem[i] = read_nomem; + readmemb[i] = read_nomemb; + readmemd[i] = read_nomemd; + readmemh[i] = read_nomemh; + writemem[i] = write_nomem; + writememb[i] = write_nomemb; + writememd[i] = write_nomemd; + writememh[i] = write_nomemh; + } + + //init RDRAM + for (i=0; i<(0x800000/4); i++) rdram[i]=0; + + for (i=0; i> 16); i++) + { + readmem[0x9000+i] = read_rom; + readmem[0xb000+i] = read_rom; + readmemb[0x9000+i] = read_romb; + readmemb[0xb000+i] = read_romb; + readmemh[0x9000+i] = read_romh; + readmemh[0xb000+i] = read_romh; + readmemd[0x9000+i] = read_romd; + readmemd[0xb000+i] = read_romd; + writemem[0x9000+i] = write_nothing; + writemem[0xb000+i] = write_rom; + writememb[0x9000+i] = write_nothingb; + writememb[0xb000+i] = write_nothingb; + writememh[0x9000+i] = write_nothingh; + writememh[0xb000+i] = write_nothingh; + writememd[0x9000+i] = write_nothingd; + writememd[0xb000+i] = write_nothingd; + } + for (i=(rom_size >> 16); i<0xfc0; i++) + { + readmem[0x9000+i] = read_nothing; + readmem[0xb000+i] = read_nothing; + readmemb[0x9000+i] = read_nothingb; + readmemb[0xb000+i] = read_nothingb; + readmemh[0x9000+i] = read_nothingh; + readmemh[0xb000+i] = read_nothingh; + readmemd[0x9000+i] = read_nothingd; + readmemd[0xb000+i] = read_nothingd; + writemem[0x9000+i] = write_nothing; + writemem[0xb000+i] = write_nothing; + writememb[0x9000+i] = write_nothingb; + writememb[0xb000+i] = write_nothingb; + writememh[0x9000+i] = write_nothingh; + writememh[0xb000+i] = write_nothingh; + writememd[0x9000+i] = write_nothingd; + writememd[0xb000+i] = write_nothingd; + } + + //init PIF_RAM + readmem[0x9fc0] = read_pif; + readmem[0xbfc0] = read_pif; + readmemb[0x9fc0] = read_pifb; + readmemb[0xbfc0] = read_pifb; + readmemh[0x9fc0] = read_pifh; + readmemh[0xbfc0] = read_pifh; + readmemd[0x9fc0] = read_pifd; + readmemd[0xbfc0] = read_pifd; + writemem[0x9fc0] = write_pif; + writemem[0xbfc0] = write_pif; + writememb[0x9fc0] = write_pifb; + writememb[0xbfc0] = write_pifb; + writememh[0x9fc0] = write_pifh; + writememh[0xbfc0] = write_pifh; + writememd[0x9fc0] = write_pifd; + writememd[0xbfc0] = write_pifd; + for (i=0; i<(0x40/4); i++) PIF_RAM[i]=0; + + for (i=0xfc1; i<0x1000; i++) + { + readmem[0x9000+i] = read_nothing; + readmem[0xb000+i] = read_nothing; + readmemb[0x9000+i] = read_nothingb; + readmemb[0xb000+i] = read_nothingb; + readmemh[0x9000+i] = read_nothingh; + readmemh[0xb000+i] = read_nothingh; + readmemd[0x9000+i] = read_nothingd; + readmemd[0xb000+i] = read_nothingd; + writemem[0x9000+i] = write_nothing; + writemem[0xb000+i] = write_nothing; + writememb[0x9000+i] = write_nothingb; + writememb[0xb000+i] = write_nothingb; + writememh[0x9000+i] = write_nothingh; + writememh[0xb000+i] = write_nothingh; + writememd[0x9000+i] = write_nothingd; + writememd[0xb000+i] = write_nothingd; + } + + flashram_info.use_flashram = 0; + init_flashram(); + + frameBufferInfos[0].addr = 0; + fast_memory = 1; + firstFrameBufferSetting = 1; + + DebugMessage(M64MSG_VERBOSE, "Memory initialized"); + return 0; +} + +void free_memory(void) +{ +} + +void make_w_mi_init_mode_reg(void) +{ + MI_register.w_mi_init_mode_reg = MI_register.mi_init_mode_reg & 0x7F; + if ((MI_register.mi_init_mode_reg & 0x080) == 0) + MI_register.w_mi_init_mode_reg |= 0x0000080; + else + MI_register.w_mi_init_mode_reg |= 0x0000100; + + if ((MI_register.mi_init_mode_reg & 0x100) == 0) + MI_register.w_mi_init_mode_reg |= 0x0000200; + else + MI_register.w_mi_init_mode_reg |= 0x0000400; + + if ((MI_register.mi_init_mode_reg & 0x200) == 0) + MI_register.w_mi_init_mode_reg |= 0x0001000; + else + MI_register.w_mi_init_mode_reg |= 0x0002000; +} + +static void update_MI_init_mode_reg(void) +{ + MI_register.mi_init_mode_reg &= ~0x7F; // init_length + MI_register.mi_init_mode_reg |= MI_register.w_mi_init_mode_reg & 0x7F; + + if (MI_register.w_mi_init_mode_reg & 0x80) // clear init_mode + MI_register.mi_init_mode_reg &= ~0x80; + if (MI_register.w_mi_init_mode_reg & 0x100) // set init_mode + MI_register.mi_init_mode_reg |= 0x80; + + if (MI_register.w_mi_init_mode_reg & 0x200) // clear ebus_test_mode + MI_register.mi_init_mode_reg &= ~0x100; + if (MI_register.w_mi_init_mode_reg & 0x400) // set ebus_test_mode + MI_register.mi_init_mode_reg |= 0x100; + + if (MI_register.w_mi_init_mode_reg & 0x800) // clear DP interupt + { + MI_register.mi_intr_reg &= ~0x20; + check_interupt(); + } + + if (MI_register.w_mi_init_mode_reg & 0x1000) // clear RDRAM_reg_mode + MI_register.mi_init_mode_reg &= ~0x200; + if (MI_register.w_mi_init_mode_reg & 0x2000) // set RDRAM_reg_mode + MI_register.mi_init_mode_reg |= 0x200; +} + +void make_w_mi_intr_mask_reg(void) +{ + MI_register.w_mi_intr_mask_reg = 0; + if ((MI_register.mi_intr_mask_reg & 0x01) == 0) + MI_register.w_mi_intr_mask_reg |= 0x0000001; + else + MI_register.w_mi_intr_mask_reg |= 0x0000002; + + if ((MI_register.mi_intr_mask_reg & 0x02) == 0) + MI_register.w_mi_intr_mask_reg |= 0x0000004; + else + MI_register.w_mi_intr_mask_reg |= 0x0000008; + + if ((MI_register.mi_intr_mask_reg & 0x04) == 0) + MI_register.w_mi_intr_mask_reg |= 0x0000010; + else + MI_register.w_mi_intr_mask_reg |= 0x0000020; + + if ((MI_register.mi_intr_mask_reg & 0x08) == 0) + MI_register.w_mi_intr_mask_reg |= 0x0000040; + else + MI_register.w_mi_intr_mask_reg |= 0x0000080; + + if ((MI_register.mi_intr_mask_reg & 0x10) == 0) + MI_register.w_mi_intr_mask_reg |= 0x0000100; + else + MI_register.w_mi_intr_mask_reg |= 0x0000200; + + if ((MI_register.mi_intr_mask_reg & 0x20) == 0) + MI_register.w_mi_intr_mask_reg |= 0x0000400; + else + MI_register.w_mi_intr_mask_reg |= 0x0000800; +} + +static void update_MI_intr_mask_reg(void) +{ + if (MI_register.w_mi_intr_mask_reg & 0x1) MI_register.mi_intr_mask_reg &= ~0x1; // clear SP mask + if (MI_register.w_mi_intr_mask_reg & 0x2) MI_register.mi_intr_mask_reg |= 0x1; // set SP mask + if (MI_register.w_mi_intr_mask_reg & 0x4) MI_register.mi_intr_mask_reg &= ~0x2; // clear SI mask + if (MI_register.w_mi_intr_mask_reg & 0x8) MI_register.mi_intr_mask_reg |= 0x2; // set SI mask + if (MI_register.w_mi_intr_mask_reg & 0x10) MI_register.mi_intr_mask_reg &= ~0x4; // clear AI mask + if (MI_register.w_mi_intr_mask_reg & 0x20) MI_register.mi_intr_mask_reg |= 0x4; // set AI mask + if (MI_register.w_mi_intr_mask_reg & 0x40) MI_register.mi_intr_mask_reg &= ~0x8; // clear VI mask + if (MI_register.w_mi_intr_mask_reg & 0x80) MI_register.mi_intr_mask_reg |= 0x8; // set VI mask + if (MI_register.w_mi_intr_mask_reg & 0x100) MI_register.mi_intr_mask_reg &= ~0x10; // clear PI mask + if (MI_register.w_mi_intr_mask_reg & 0x200) MI_register.mi_intr_mask_reg |= 0x10; // set PI mask + if (MI_register.w_mi_intr_mask_reg & 0x400) MI_register.mi_intr_mask_reg &= ~0x20; // clear DP mask + if (MI_register.w_mi_intr_mask_reg & 0x800) MI_register.mi_intr_mask_reg |= 0x20; // set DP mask +} + +void make_w_sp_status_reg(void) +{ + sp_register.w_sp_status_reg = 0; + + if ((sp_register.sp_status_reg & 0x0001) == 0) + sp_register.w_sp_status_reg |= 0x0000001; + else + sp_register.w_sp_status_reg |= 0x0000002; + + if ((sp_register.sp_status_reg & 0x0002) == 0) + sp_register.w_sp_status_reg |= 0x0000004; + + // TODO: should the interupt bits be set under any circumstance? + + if ((sp_register.sp_status_reg & 0x0020) == 0) + sp_register.w_sp_status_reg |= 0x0000020; + else + sp_register.w_sp_status_reg |= 0x0000040; + + if ((sp_register.sp_status_reg & 0x0040) == 0) + sp_register.w_sp_status_reg |= 0x0000080; + else + sp_register.w_sp_status_reg |= 0x0000100; + if ((sp_register.sp_status_reg & 0x0080) == 0) + sp_register.w_sp_status_reg |= 0x0000200; + else + sp_register.w_sp_status_reg |= 0x0000400; + + if ((sp_register.sp_status_reg & 0x0100) == 0) + sp_register.w_sp_status_reg |= 0x0000800; + else + sp_register.w_sp_status_reg |= 0x0001000; + + if ((sp_register.sp_status_reg & 0x0200) == 0) + sp_register.w_sp_status_reg |= 0x0002000; + else + sp_register.w_sp_status_reg |= 0x0004000; + + if ((sp_register.sp_status_reg & 0x0400) == 0) + sp_register.w_sp_status_reg |= 0x0008000; + else + sp_register.w_sp_status_reg |= 0x0010000; + + if ((sp_register.sp_status_reg & 0x0800) == 0) + sp_register.w_sp_status_reg |= 0x0020000; + else + sp_register.w_sp_status_reg |= 0x0040000; + + if ((sp_register.sp_status_reg & 0x1000) == 0) + sp_register.w_sp_status_reg |= 0x0080000; + else + sp_register.w_sp_status_reg |= 0x0100000; + + if ((sp_register.sp_status_reg & 0x2000) == 0) + sp_register.w_sp_status_reg |= 0x0200000; + else + sp_register.w_sp_status_reg |= 0x0400000; + + if ((sp_register.sp_status_reg & 0x4000) == 0) + sp_register.w_sp_status_reg |= 0x0800000; + else + sp_register.w_sp_status_reg |= 0x1000000; +} + +static void do_SP_Task(void) +{ + int save_pc = rsp_register.rsp_pc & ~0xFFF; + if (SP_DMEM[0xFC0/4] == 1) + { + if (dpc_register.dpc_status & 0x2) // DP frozen (DK64, BC) + { + // don't do the task now + // the task will be done when DP is unfreezed (see update_DPC) + return; + } + + // unprotecting old frame buffers + if (gfx.fBGetFrameBufferInfo && gfx.fBRead && gfx.fBWrite && + frameBufferInfos[0].addr) + { + int i; + for (i=0; i<6; i++) + { + if (frameBufferInfos[i].addr) + { + int j; + int start = frameBufferInfos[i].addr & 0x7FFFFF; + int end = start + frameBufferInfos[i].width* + frameBufferInfos[i].height* + frameBufferInfos[i].size - 1; + start = start >> 16; + end = end >> 16; + + for (j=start; j<=end; j++) + { +#ifdef DBG + if (lookup_breakpoint(0x80000000 + j * 0x10000, 0x10000, + BPT_FLAG_ENABLED | BPT_FLAG_READ ) != -1) + { + readmem[0x8000+j] = read_rdram_break; + readmemb[0x8000+j] = read_rdramb_break; + readmemh[0x8000+j] = read_rdramh_break; + readmemd[0xa000+j] = read_rdramd_break; + } + else + { +#endif + readmem[0x8000+j] = read_rdram; + readmemb[0x8000+j] = read_rdramb; + readmemh[0x8000+j] = read_rdramh; + readmemd[0xa000+j] = read_rdramd; +#ifdef DBG + } + if (lookup_breakpoint(0xa0000000 + j * 0x10000, 0x10000, + BPT_FLAG_ENABLED | BPT_FLAG_READ ) != -1) + { + readmem[0xa000+j] = read_rdram_break; + readmemb[0xa000+j] = read_rdramb_break; + readmemh[0xa000+j] = read_rdramh_break; + readmemd[0x8000+j] = read_rdramd_break; + } + else + { +#endif + readmem[0xa000+j] = read_rdram; + readmemb[0xa000+j] = read_rdramb; + readmemh[0xa000+j] = read_rdramh; + readmemd[0x8000+j] = read_rdramd; +#ifdef DBG + } + if (lookup_breakpoint(0x80000000 + j * 0x10000, 0x10000, + BPT_FLAG_ENABLED | BPT_FLAG_WRITE ) != -1) + { + writemem[0x8000+j] = write_rdram_break; + writememb[0x8000+j] = write_rdramb_break; + writememh[0x8000+j] = write_rdramh_break; + writememd[0x8000+j] = write_rdramd_break; + } + else + { +#endif + writemem[0x8000+j] = write_rdram; + writememb[0x8000+j] = write_rdramb; + writememh[0x8000+j] = write_rdramh; + writememd[0x8000+j] = write_rdramd; +#ifdef DBG + } + if (lookup_breakpoint(0xa0000000 + j * 0x10000, 0x10000, + BPT_FLAG_ENABLED | BPT_FLAG_WRITE ) != -1) + { + writemem[0xa000+j] = write_rdram_break; + writememb[0xa000+j] = write_rdramb_break; + writememh[0xa000+j] = write_rdramh_break; + writememd[0xa000+j] = write_rdramd_break; + } + else + { +#endif + writemem[0xa000+j] = write_rdram; + writememb[0xa000+j] = write_rdramb; + writememh[0xa000+j] = write_rdramh; + writememd[0xa000+j] = write_rdramd; +#ifdef DBG + } +#endif + } + } + } + } + + //gfx.processDList(); + rsp_register.rsp_pc &= 0xFFF; + start_section(GFX_SECTION); + rsp.doRspCycles(0xFFFFFFFF); + end_section(GFX_SECTION); + rsp_register.rsp_pc |= save_pc; + new_frame(); + + update_count(); + if (MI_register.mi_intr_reg & 0x1) + add_interupt_event(SP_INT, 1000); + if (MI_register.mi_intr_reg & 0x20) + add_interupt_event(DP_INT, 1000); + MI_register.mi_intr_reg &= ~0x21; + sp_register.sp_status_reg &= ~0x303; + + // protecting new frame buffers + if (gfx.fBGetFrameBufferInfo && gfx.fBRead && gfx.fBWrite) + gfx.fBGetFrameBufferInfo(frameBufferInfos); + if (gfx.fBGetFrameBufferInfo && gfx.fBRead && gfx.fBWrite + && frameBufferInfos[0].addr) + { + int i; + for (i=0; i<6; i++) + { + if (frameBufferInfos[i].addr) + { + int j; + int start = frameBufferInfos[i].addr & 0x7FFFFF; + int end = start + frameBufferInfos[i].width* + frameBufferInfos[i].height* + frameBufferInfos[i].size - 1; + int start1 = start; + int end1 = end; + start >>= 16; + end >>= 16; + for (j=start; j<=end; j++) + { +#ifdef DBG + if (lookup_breakpoint(0x80000000 + j * 0x10000, 0x10000, + BPT_FLAG_ENABLED | BPT_FLAG_READ ) != -1) + { + readmem[0x8000+j] = read_rdramFB_break; + readmemb[0x8000+j] = read_rdramFBb_break; + readmemh[0x8000+j] = read_rdramFBh_break; + readmemd[0xa000+j] = read_rdramFBd_break; + } + else + { +#endif + readmem[0x8000+j] = read_rdramFB; + readmemb[0x8000+j] = read_rdramFBb; + readmemh[0x8000+j] = read_rdramFBh; + readmemd[0xa000+j] = read_rdramFBd; +#ifdef DBG + } + if (lookup_breakpoint(0xa0000000 + j * 0x10000, 0x10000, + BPT_FLAG_ENABLED | BPT_FLAG_READ ) != -1) + { + readmem[0xa000+j] = read_rdramFB_break; + readmemb[0xa000+j] = read_rdramFBb_break; + readmemh[0xa000+j] = read_rdramFBh_break; + readmemd[0x8000+j] = read_rdramFBd_break; + } + else + { +#endif + readmem[0xa000+j] = read_rdramFB; + readmemb[0xa000+j] = read_rdramFBb; + readmemh[0xa000+j] = read_rdramFBh; + readmemd[0x8000+j] = read_rdramFBd; +#ifdef DBG + } + if (lookup_breakpoint(0x80000000 + j * 0x10000, 0x10000, + BPT_FLAG_ENABLED | BPT_FLAG_WRITE ) != -1) + { + writemem[0x8000+j] = write_rdramFB_break; + writememb[0x8000+j] = write_rdramFBb_break; + writememh[0x8000+j] = write_rdramFBh_break; + writememd[0x8000+j] = write_rdramFBd_break; + } + else + { +#endif + writemem[0x8000+j] = write_rdramFB; + writememb[0x8000+j] = write_rdramFBb; + writememh[0x8000+j] = write_rdramFBh; + writememd[0x8000+j] = write_rdramFBd; +#ifdef DBG + } + if (lookup_breakpoint(0xa0000000 + j * 0x10000, 0x10000, + BPT_FLAG_ENABLED | BPT_FLAG_WRITE ) != -1) + { + writemem[0xa000+j] = write_rdramFB_break; + writememb[0xa000+j] = write_rdramFBb_break; + writememh[0xa000+j] = write_rdramFBh_break; + writememd[0xa000+j] = write_rdramFBd_break; + } + else + { +#endif + writemem[0xa000+j] = write_rdramFB; + writememb[0xa000+j] = write_rdramFBb; + writememh[0xa000+j] = write_rdramFBh; + writememd[0xa000+j] = write_rdramFBd; +#ifdef DBG + } +#endif + } + start <<= 4; + end <<= 4; + for (j=start; j<=end; j++) + { + if (j>=start1 && j<=end1) framebufferRead[j]=1; + else framebufferRead[j] = 0; + } + + if (firstFrameBufferSetting) + { + firstFrameBufferSetting = 0; + fast_memory = 0; + for (j=0; j<0x100000; j++) + invalid_code[j] = 1; + } + } + } + } + } + else if (SP_DMEM[0xFC0/4] == 2) + { + //audio.processAList(); + rsp_register.rsp_pc &= 0xFFF; + start_section(AUDIO_SECTION); + rsp.doRspCycles(0xFFFFFFFF); + end_section(AUDIO_SECTION); + rsp_register.rsp_pc |= save_pc; + + update_count(); + if (MI_register.mi_intr_reg & 0x1) + add_interupt_event(SP_INT, 4000/*500*/); + MI_register.mi_intr_reg &= ~0x1; + sp_register.sp_status_reg &= ~0x303; + + } + else + { + rsp_register.rsp_pc &= 0xFFF; + rsp.doRspCycles(0xFFFFFFFF); + rsp_register.rsp_pc |= save_pc; + + update_count(); + if (MI_register.mi_intr_reg & 0x1) + add_interupt_event(SP_INT, 0/*100*/); + MI_register.mi_intr_reg &= ~0x1; + sp_register.sp_status_reg &= ~0x203; + } +} + +static void update_SP(void) +{ + if (sp_register.w_sp_status_reg & 0x1) // clear halt + sp_register.sp_status_reg &= ~0x1; + if (sp_register.w_sp_status_reg & 0x2) // set halt + sp_register.sp_status_reg |= 0x1; + + if (sp_register.w_sp_status_reg & 0x4) // clear broke + sp_register.sp_status_reg &= ~0x2; + + if (sp_register.w_sp_status_reg & 0x8) // clear SP interupt + { + MI_register.mi_intr_reg &= ~1; + check_interupt(); + } + + if (sp_register.w_sp_status_reg & 0x10) // set SP interupt + { + MI_register.mi_intr_reg |= 1; + check_interupt(); + } + + if (sp_register.w_sp_status_reg & 0x20) // clear single step + sp_register.sp_status_reg &= ~0x20; + if (sp_register.w_sp_status_reg & 0x40) // set single step + sp_register.sp_status_reg |= 0x20; + + if (sp_register.w_sp_status_reg & 0x80) // clear interrupt on break + sp_register.sp_status_reg &= ~0x40; + if (sp_register.w_sp_status_reg & 0x100) // set interrupt on break + sp_register.sp_status_reg |= 0x40; + + if (sp_register.w_sp_status_reg & 0x200) // clear signal 0 + sp_register.sp_status_reg &= ~0x80; + if (sp_register.w_sp_status_reg & 0x400) // set signal 0 + sp_register.sp_status_reg |= 0x80; + + if (sp_register.w_sp_status_reg & 0x800) // clear signal 1 + sp_register.sp_status_reg &= ~0x100; + if (sp_register.w_sp_status_reg & 0x1000) // set signal 1 + sp_register.sp_status_reg |= 0x100; + + if (sp_register.w_sp_status_reg & 0x2000) // clear signal 2 + sp_register.sp_status_reg &= ~0x200; + if (sp_register.w_sp_status_reg & 0x4000) // set signal 2 + sp_register.sp_status_reg |= 0x200; + + if (sp_register.w_sp_status_reg & 0x8000) // clear signal 3 + sp_register.sp_status_reg &= ~0x400; + if (sp_register.w_sp_status_reg & 0x10000) // set signal 3 + sp_register.sp_status_reg |= 0x400; + + if (sp_register.w_sp_status_reg & 0x20000) // clear signal 4 + sp_register.sp_status_reg &= ~0x800; + if (sp_register.w_sp_status_reg & 0x40000) // set signal 4 + sp_register.sp_status_reg |= 0x800; + + if (sp_register.w_sp_status_reg & 0x80000) // clear signal 5 + sp_register.sp_status_reg &= ~0x1000; + if (sp_register.w_sp_status_reg & 0x100000) // set signal 5 + sp_register.sp_status_reg |= 0x1000; + + if (sp_register.w_sp_status_reg & 0x200000) // clear signal 6 + sp_register.sp_status_reg &= ~0x2000; + if (sp_register.w_sp_status_reg & 0x400000) // set signal 6 + sp_register.sp_status_reg |= 0x2000; + + if (sp_register.w_sp_status_reg & 0x800000) // clear signal 7 + sp_register.sp_status_reg &= ~0x4000; + if (sp_register.w_sp_status_reg & 0x1000000) // set signal 7 + sp_register.sp_status_reg |= 0x4000; + + //if (get_event(SP_INT)) return; + if (!(sp_register.w_sp_status_reg & 0x1) && + !(sp_register.w_sp_status_reg & 0x4)) return; + if (!(sp_register.sp_status_reg & 0x3)) // !halt && !broke + do_SP_Task(); +} + +void make_w_dpc_status(void) +{ + dpc_register.w_dpc_status = 0; + + if ((dpc_register.dpc_status & 0x0001) == 0) + dpc_register.w_dpc_status |= 0x0000001; + else + dpc_register.w_dpc_status |= 0x0000002; + + if ((dpc_register.dpc_status & 0x0002) == 0) + dpc_register.w_dpc_status |= 0x0000004; + else + dpc_register.w_dpc_status |= 0x0000008; + + if ((dpc_register.dpc_status & 0x0004) == 0) + dpc_register.w_dpc_status |= 0x0000010; + else + dpc_register.w_dpc_status |= 0x0000020; +} + +static void update_DPC(void) +{ + if (dpc_register.w_dpc_status & 0x1) // clear xbus_dmem_dma + dpc_register.dpc_status &= ~0x1; + if (dpc_register.w_dpc_status & 0x2) // set xbus_dmem_dma + dpc_register.dpc_status |= 0x1; + + if (dpc_register.w_dpc_status & 0x4) // clear freeze + { + dpc_register.dpc_status &= ~0x2; + + // see do_SP_task for more info + if (!(sp_register.sp_status_reg & 0x3)) // !halt && !broke + do_SP_Task(); + } + if (dpc_register.w_dpc_status & 0x8) // set freeze + dpc_register.dpc_status |= 0x2; + + if (dpc_register.w_dpc_status & 0x10) // clear flush + dpc_register.dpc_status &= ~0x4; + if (dpc_register.w_dpc_status & 0x20) // set flush + dpc_register.dpc_status |= 0x4; +} + +void read_nothing(void) +{ + if (address == 0xa5000508) *rdword = 0xFFFFFFFF; + else *rdword = 0; +} + +void read_nothingb(void) +{ + *rdword = 0; +} + +void read_nothingh(void) +{ + *rdword = 0; +} + +void read_nothingd(void) +{ + *rdword = 0; +} + +void write_nothing(void) +{ +} + +void write_nothingb(void) +{ +} + +void write_nothingh(void) +{ +} + +void write_nothingd(void) +{ +} + +void read_nomem(void) +{ + address = virtual_to_physical_address(address,0); + if (address == 0x00000000) return; + read_word_in_memory(); +} + +void read_nomemb(void) +{ + address = virtual_to_physical_address(address,0); + if (address == 0x00000000) return; + read_byte_in_memory(); +} + +void read_nomemh(void) +{ + address = virtual_to_physical_address(address,0); + if (address == 0x00000000) return; + read_hword_in_memory(); +} + +void read_nomemd(void) +{ + address = virtual_to_physical_address(address,0); + if (address == 0x00000000) return; + read_dword_in_memory(); +} + +void write_nomem(void) +{ + if (r4300emu != CORE_PURE_INTERPRETER && !invalid_code[address>>12]) + if (blocks[address>>12]->block[(address&0xFFF)/4].ops != + current_instruction_table.NOTCOMPILED) + invalid_code[address>>12] = 1; + address = virtual_to_physical_address(address,1); + if (address == 0x00000000) return; + write_word_in_memory(); +} + +void write_nomemb(void) +{ + if (r4300emu != CORE_PURE_INTERPRETER && !invalid_code[address>>12]) + if (blocks[address>>12]->block[(address&0xFFF)/4].ops != + current_instruction_table.NOTCOMPILED) + invalid_code[address>>12] = 1; + address = virtual_to_physical_address(address,1); + if (address == 0x00000000) return; + write_byte_in_memory(); +} + +void write_nomemh(void) +{ + if (r4300emu != CORE_PURE_INTERPRETER && !invalid_code[address>>12]) + if (blocks[address>>12]->block[(address&0xFFF)/4].ops != + current_instruction_table.NOTCOMPILED) + invalid_code[address>>12] = 1; + address = virtual_to_physical_address(address,1); + if (address == 0x00000000) return; + write_hword_in_memory(); +} + +void write_nomemd(void) +{ + if (r4300emu != CORE_PURE_INTERPRETER && !invalid_code[address>>12]) + if (blocks[address>>12]->block[(address&0xFFF)/4].ops != + current_instruction_table.NOTCOMPILED) + invalid_code[address>>12] = 1; + address = virtual_to_physical_address(address,1); + if (address == 0x00000000) return; + write_dword_in_memory(); +} + +void read_rdram(void) +{ + *rdword = *((unsigned int *)(rdramb + (address & 0xFFFFFF))); +} + +void read_rdramb(void) +{ + *rdword = *(rdramb + ((address & 0xFFFFFF)^S8)); +} + +void read_rdramh(void) +{ + *rdword = *((unsigned short *)(rdramb + ((address & 0xFFFFFF)^S16))); +} + +void read_rdramd(void) +{ + *rdword = ((unsigned long long int)(*(unsigned int *)(rdramb + (address & 0xFFFFFF))) << 32) | + ((*(unsigned int *)(rdramb + (address & 0xFFFFFF) + 4))); +} + +void read_rdramFB(void) +{ + int i; + for (i=0; i<6; i++) + { + if (frameBufferInfos[i].addr) + { + unsigned int start = frameBufferInfos[i].addr & 0x7FFFFF; + unsigned int end = start + frameBufferInfos[i].width* + frameBufferInfos[i].height* + frameBufferInfos[i].size - 1; + if ((address & 0x7FFFFF) >= start && (address & 0x7FFFFF) <= end && + framebufferRead[(address & 0x7FFFFF)>>12]) + { + gfx.fBRead(address); + framebufferRead[(address & 0x7FFFFF)>>12] = 0; + } + } + } + read_rdram(); +} + +void read_rdramFBb(void) +{ + int i; + for (i=0; i<6; i++) + { + if (frameBufferInfos[i].addr) + { + unsigned int start = frameBufferInfos[i].addr & 0x7FFFFF; + unsigned int end = start + frameBufferInfos[i].width* + frameBufferInfos[i].height* + frameBufferInfos[i].size - 1; + if ((address & 0x7FFFFF) >= start && (address & 0x7FFFFF) <= end && + framebufferRead[(address & 0x7FFFFF)>>12]) + { + gfx.fBRead(address); + framebufferRead[(address & 0x7FFFFF)>>12] = 0; + } + } + } + read_rdramb(); +} + +void read_rdramFBh(void) +{ + int i; + for (i=0; i<6; i++) + { + if (frameBufferInfos[i].addr) + { + unsigned int start = frameBufferInfos[i].addr & 0x7FFFFF; + unsigned int end = start + frameBufferInfos[i].width* + frameBufferInfos[i].height* + frameBufferInfos[i].size - 1; + if ((address & 0x7FFFFF) >= start && (address & 0x7FFFFF) <= end && + framebufferRead[(address & 0x7FFFFF)>>12]) + { + gfx.fBRead(address); + framebufferRead[(address & 0x7FFFFF)>>12] = 0; + } + } + } + read_rdramh(); +} + +void read_rdramFBd(void) +{ + int i; + for (i=0; i<6; i++) + { + if (frameBufferInfos[i].addr) + { + unsigned int start = frameBufferInfos[i].addr & 0x7FFFFF; + unsigned int end = start + frameBufferInfos[i].width* + frameBufferInfos[i].height* + frameBufferInfos[i].size - 1; + if ((address & 0x7FFFFF) >= start && (address & 0x7FFFFF) <= end && + framebufferRead[(address & 0x7FFFFF)>>12]) + { + gfx.fBRead(address); + framebufferRead[(address & 0x7FFFFF)>>12] = 0; + } + } + } + read_rdramd(); +} + +void write_rdram(void) +{ +#if defined( COUNT_WRITE_RDRAM_CALLS ) + printf( "write_rdram, word=%i, count: %i", word, writerdram_count ); + writerdram_count++; +#endif + *((unsigned int *)(rdramb + (address & 0xFFFFFF))) = word; +} + +void write_rdramb(void) +{ + *((rdramb + ((address & 0xFFFFFF)^S8))) = cpu_byte; +} + +void write_rdramh(void) +{ + *(unsigned short *)((rdramb + ((address & 0xFFFFFF)^S16))) = hword; +} + +void write_rdramd(void) +{ + *((unsigned int *)(rdramb + (address & 0xFFFFFF))) = (unsigned int) (dword >> 32); + *((unsigned int *)(rdramb + (address & 0xFFFFFF) + 4 )) = (unsigned int) (dword & 0xFFFFFFFF); +} + +void write_rdramFB(void) +{ + int i; + for (i=0; i<6; i++) + { + if (frameBufferInfos[i].addr) + { + unsigned int start = frameBufferInfos[i].addr & 0x7FFFFF; + unsigned int end = start + frameBufferInfos[i].width* + frameBufferInfos[i].height* + frameBufferInfos[i].size - 1; + if ((address & 0x7FFFFF) >= start && (address & 0x7FFFFF) <= end) + gfx.fBWrite(address, 4); + } + } + write_rdram(); +} + +void write_rdramFBb(void) +{ + int i; + for (i=0; i<6; i++) + { + if (frameBufferInfos[i].addr) + { + unsigned int start = frameBufferInfos[i].addr & 0x7FFFFF; + unsigned int end = start + frameBufferInfos[i].width* + frameBufferInfos[i].height* + frameBufferInfos[i].size - 1; + if ((address & 0x7FFFFF) >= start && (address & 0x7FFFFF) <= end) + gfx.fBWrite(address^S8, 1); + } + } + write_rdramb(); +} + +void write_rdramFBh(void) +{ + int i; + for (i=0; i<6; i++) + { + if (frameBufferInfos[i].addr) + { + unsigned int start = frameBufferInfos[i].addr & 0x7FFFFF; + unsigned int end = start + frameBufferInfos[i].width* + frameBufferInfos[i].height* + frameBufferInfos[i].size - 1; + if ((address & 0x7FFFFF) >= start && (address & 0x7FFFFF) <= end) + gfx.fBWrite(address^S16, 2); + } + } + write_rdramh(); +} + +void write_rdramFBd(void) +{ + int i; + for (i=0; i<6; i++) + { + if (frameBufferInfos[i].addr) + { + unsigned int start = frameBufferInfos[i].addr & 0x7FFFFF; + unsigned int end = start + frameBufferInfos[i].width* + frameBufferInfos[i].height* + frameBufferInfos[i].size - 1; + if ((address & 0x7FFFFF) >= start && (address & 0x7FFFFF) <= end) + gfx.fBWrite(address, 8); + } + } + write_rdramd(); +} + +void read_rdramreg(void) +{ + *rdword = *(readrdramreg[*address_low]); +} + +void read_rdramregb(void) +{ + *rdword = *((unsigned char*)readrdramreg[*address_low & 0xfffc] + + ((*address_low&3)^S8) ); +} + +void read_rdramregh(void) +{ + *rdword = *((unsigned short*)((unsigned char*)readrdramreg[*address_low & 0xfffc] + + ((*address_low&3)^S16) )); +} + +void read_rdramregd(void) +{ + *rdword = ((unsigned long long int)(*readrdramreg[*address_low])<<32) | + *readrdramreg[*address_low+4]; +} + +void write_rdramreg(void) +{ + *readrdramreg[*address_low] = word; +} + +void write_rdramregb(void) +{ + *((unsigned char*)readrdramreg[*address_low & 0xfffc] + + ((*address_low&3)^S8) ) = cpu_byte; +} + +void write_rdramregh(void) +{ + *((unsigned short*)((unsigned char*)readrdramreg[*address_low & 0xfffc] + + ((*address_low&3)^S16) )) = hword; +} + +void write_rdramregd(void) +{ + *readrdramreg[*address_low] = (unsigned int) (dword >> 32); + *readrdramreg[*address_low+4] = (unsigned int) (dword & 0xFFFFFFFF); +} + +void read_rsp_mem(void) +{ + if (*address_low < 0x1000) + *rdword = *((unsigned int *)(SP_DMEMb + (*address_low))); + else if (*address_low < 0x2000) + *rdword = *((unsigned int *)(SP_IMEMb + (*address_low&0xFFF))); + else + read_nomem(); +} + +void read_rsp_memb(void) +{ + if (*address_low < 0x1000) + *rdword = *(SP_DMEMb + (*address_low^S8)); + else if (*address_low < 0x2000) + *rdword = *(SP_IMEMb + ((*address_low&0xFFF)^S8)); + else + read_nomemb(); +} + +void read_rsp_memh(void) +{ + if (*address_low < 0x1000) + *rdword = *((unsigned short *)(SP_DMEMb + (*address_low^S16))); + else if (*address_low < 0x2000) + *rdword = *((unsigned short *)(SP_IMEMb + ((*address_low&0xFFF)^S16))); + else + read_nomemh(); +} + +void read_rsp_memd(void) +{ + if (*address_low < 0x1000) + { + *rdword = ((unsigned long long int)(*(unsigned int *)(SP_DMEMb + (*address_low))) << 32) | + ((*(unsigned int *)(SP_DMEMb + (*address_low) + 4))); + } + else if (*address_low < 0x2000) + { + *rdword = ((unsigned long long int)(*(unsigned int *)(SP_IMEMb + (*address_low&0xFFF))) << 32) | + ((*(unsigned int *)(SP_IMEMb + (*address_low&0xFFF) + 4))); + } + else + read_nomemd(); +} + +void write_rsp_mem(void) +{ + if (*address_low < 0x1000) + *((unsigned int *)(SP_DMEMb + (*address_low))) = word; + else if (*address_low < 0x2000) + *((unsigned int *)(SP_IMEMb + (*address_low&0xFFF))) = word; + else + write_nomem(); +} + +void write_rsp_memb(void) +{ + if (*address_low < 0x1000) + *(SP_DMEMb + (*address_low^S8)) = cpu_byte; + else if (*address_low < 0x2000) + *(SP_IMEMb + ((*address_low&0xFFF)^S8)) = cpu_byte; + else + write_nomemb(); +} + +void write_rsp_memh(void) +{ + if (*address_low < 0x1000) + *((unsigned short *)(SP_DMEMb + (*address_low^S16))) = hword; + else if (*address_low < 0x2000) + *((unsigned short *)(SP_IMEMb + ((*address_low&0xFFF)^S16))) = hword; + else + write_nomemh(); +} + +void write_rsp_memd(void) +{ + if (*address_low < 0x1000) + { + *((unsigned int *)(SP_DMEMb + *address_low)) = (unsigned int) (dword >> 32); + *((unsigned int *)(SP_DMEMb + *address_low + 4 )) = (unsigned int) (dword & 0xFFFFFFFF); + } + else if (*address_low < 0x2000) + { + *((unsigned int *)(SP_IMEMb + (*address_low&0xFFF))) = (unsigned int) (dword >> 32); + *((unsigned int *)(SP_IMEMb + (*address_low&0xFFF) + 4 )) = (unsigned int) (dword & 0xFFFFFFFF); + } + else + read_nomemd(); +} + +void read_rsp_reg(void) +{ + *rdword = *(readrspreg[*address_low]); + switch (*address_low) + { + case 0x1c: + sp_register.sp_semaphore_reg = 1; + break; + } +} + +void read_rsp_regb(void) +{ + *rdword = *((unsigned char*)readrspreg[*address_low & 0xfffc] + + ((*address_low&3)^S8) ); + switch (*address_low) + { + case 0x1c: + case 0x1d: + case 0x1e: + case 0x1f: + sp_register.sp_semaphore_reg = 1; + break; + } +} + +void read_rsp_regh(void) +{ + *rdword = *((unsigned short*)((unsigned char*)readrspreg[*address_low & 0xfffc] + + ((*address_low&3)^S16) )); + switch (*address_low) + { + case 0x1c: + case 0x1e: + sp_register.sp_semaphore_reg = 1; + break; + } +} + +void read_rsp_regd(void) +{ + *rdword = ((unsigned long long int)(*readrspreg[*address_low])<<32) | + *readrspreg[*address_low+4]; + switch (*address_low) + { + case 0x18: + sp_register.sp_semaphore_reg = 1; + break; + } +} + +void write_rsp_reg(void) +{ + switch (*address_low) + { + case 0x10: + sp_register.w_sp_status_reg = word; + update_SP(); + case 0x14: + case 0x18: + return; + break; + } + *readrspreg[*address_low] = word; + switch (*address_low) + { + case 0x8: + dma_sp_write(); + break; + case 0xc: + dma_sp_read(); + break; + case 0x1c: + sp_register.sp_semaphore_reg = 0; + break; + } +} + +void write_rsp_regb(void) +{ + switch (*address_low) + { + case 0x10: + case 0x11: + case 0x12: + case 0x13: + *((unsigned char*)&sp_register.w_sp_status_reg + + ((*address_low&3)^S8) ) = cpu_byte; + case 0x14: + case 0x15: + case 0x16: + case 0x17: + case 0x18: + case 0x19: + case 0x1a: + case 0x1b: + return; + break; + } + *((unsigned char*)readrspreg[*address_low & 0xfffc] + + ((*address_low&3)^S8) ) = cpu_byte; + switch (*address_low) + { + case 0x8: + case 0x9: + case 0xa: + case 0xb: + dma_sp_write(); + break; + case 0xc: + case 0xd: + case 0xe: + case 0xf: + dma_sp_read(); + break; + case 0x1c: + case 0x1d: + case 0x1e: + case 0x1f: + sp_register.sp_semaphore_reg = 0; + break; + } +} + +void write_rsp_regh(void) +{ + switch (*address_low) + { + case 0x10: + case 0x12: + *((unsigned short*)((unsigned char*)&sp_register.w_sp_status_reg + + ((*address_low&3)^S16) )) = hword; + case 0x14: + case 0x16: + case 0x18: + case 0x1a: + return; + break; + } + *((unsigned short*)((unsigned char*)readrspreg[*address_low & 0xfffc] + + ((*address_low&3)^S16) )) = hword; + switch (*address_low) + { + case 0x8: + case 0xa: + dma_sp_write(); + break; + case 0xc: + case 0xe: + dma_sp_read(); + break; + case 0x1c: + case 0x1e: + sp_register.sp_semaphore_reg = 0; + break; + } +} + +void write_rsp_regd(void) +{ + switch (*address_low) + { + case 0x10: + sp_register.w_sp_status_reg = (unsigned int) (dword >> 32); + update_SP(); + return; + break; + case 0x18: + sp_register.sp_semaphore_reg = 0; + return; + break; + } + *readrspreg[*address_low] = (unsigned int) (dword >> 32); + *readrspreg[*address_low+4] = (unsigned int) (dword & 0xFFFFFFFF); + switch (*address_low) + { + case 0x8: + dma_sp_write(); + dma_sp_read(); + break; + } +} + +void read_rsp(void) +{ + *rdword = *(readrsp[*address_low]); +} + +void read_rspb(void) +{ + *rdword = *((unsigned char*)readrsp[*address_low & 0xfffc] + + ((*address_low&3)^S8) ); +} + +void read_rsph(void) +{ + *rdword = *((unsigned short*)((unsigned char*)readrsp[*address_low & 0xfffc] + + ((*address_low&3)^S16) )); +} + +void read_rspd(void) +{ + *rdword = ((unsigned long long int)(*readrsp[*address_low])<<32) | + *readrsp[*address_low+4]; +} + +void write_rsp(void) +{ + *readrsp[*address_low] = word; +} + +void write_rspb(void) +{ + *((unsigned char*)readrsp[*address_low & 0xfffc] + + ((*address_low&3)^S8) ) = cpu_byte; +} + +void write_rsph(void) +{ + *((unsigned short*)((unsigned char*)readrsp[*address_low & 0xfffc] + + ((*address_low&3)^S16) )) = hword; +} + +void write_rspd(void) +{ + *readrsp[*address_low] = (unsigned int) (dword >> 32); + *readrsp[*address_low+4] = (unsigned int) (dword & 0xFFFFFFFF); +} + +void read_dp(void) +{ + *rdword = *(readdp[*address_low]); +} + +void read_dpb(void) +{ + *rdword = *((unsigned char*)readdp[*address_low & 0xfffc] + + ((*address_low&3)^S8) ); +} + +void read_dph(void) +{ + *rdword = *((unsigned short*)((unsigned char*)readdp[*address_low & 0xfffc] + + ((*address_low&3)^S16) )); +} + +void read_dpd(void) +{ + *rdword = ((unsigned long long int)(*readdp[*address_low])<<32) | + *readdp[*address_low+4]; +} + +void write_dp(void) +{ + switch (*address_low) + { + case 0xc: + dpc_register.w_dpc_status = word; + update_DPC(); + case 0x8: + case 0x10: + case 0x14: + case 0x18: + case 0x1c: + return; + break; + } + *readdp[*address_low] = word; + switch (*address_low) + { + case 0x0: + dpc_register.dpc_current = dpc_register.dpc_start; + break; + case 0x4: + gfx.processRDPList(); + MI_register.mi_intr_reg |= 0x20; + check_interupt(); + break; + } +} + +void write_dpb(void) +{ + switch (*address_low) + { + case 0xc: + case 0xd: + case 0xe: + case 0xf: + *((unsigned char*)&dpc_register.w_dpc_status + + ((*address_low&3)^S8) ) = cpu_byte; + update_DPC(); + case 0x8: + case 0x9: + case 0xa: + case 0xb: + case 0x10: + case 0x11: + case 0x12: + case 0x13: + case 0x14: + case 0x15: + case 0x16: + case 0x17: + case 0x18: + case 0x19: + case 0x1a: + case 0x1b: + case 0x1c: + case 0x1d: + case 0x1e: + case 0x1f: + return; + break; + } + *((unsigned char*)readdp[*address_low & 0xfffc] + + ((*address_low&3)^S8) ) = cpu_byte; + switch (*address_low) + { + case 0x0: + case 0x1: + case 0x2: + case 0x3: + dpc_register.dpc_current = dpc_register.dpc_start; + break; + case 0x4: + case 0x5: + case 0x6: + case 0x7: + gfx.processRDPList(); + MI_register.mi_intr_reg |= 0x20; + check_interupt(); + break; + } +} + +void write_dph(void) +{ + switch (*address_low) + { + case 0xc: + case 0xe: + *((unsigned short*)((unsigned char*)&dpc_register.w_dpc_status + + ((*address_low&3)^S16) )) = hword; + update_DPC(); + case 0x8: + case 0xa: + case 0x10: + case 0x12: + case 0x14: + case 0x16: + case 0x18: + case 0x1a: + case 0x1c: + case 0x1e: + return; + break; + } + *((unsigned short*)((unsigned char*)readdp[*address_low & 0xfffc] + + ((*address_low&3)^S16) )) = hword; + switch (*address_low) + { + case 0x0: + case 0x2: + dpc_register.dpc_current = dpc_register.dpc_start; + break; + case 0x4: + case 0x6: + gfx.processRDPList(); + MI_register.mi_intr_reg |= 0x20; + check_interupt(); + break; + } +} + +void write_dpd(void) +{ + switch (*address_low) + { + case 0x8: + dpc_register.w_dpc_status = (unsigned int) (dword & 0xFFFFFFFF); + update_DPC(); + return; + break; + case 0x10: + case 0x18: + return; + break; + } + *readdp[*address_low] = (unsigned int) (dword >> 32); + *readdp[*address_low+4] = (unsigned int) (dword & 0xFFFFFFFF); + switch (*address_low) + { + case 0x0: + dpc_register.dpc_current = dpc_register.dpc_start; + gfx.processRDPList(); + MI_register.mi_intr_reg |= 0x20; + check_interupt(); + break; + } +} + +void read_dps(void) +{ + *rdword = *(readdps[*address_low]); +} + +void read_dpsb(void) +{ + *rdword = *((unsigned char*)readdps[*address_low & 0xfffc] + + ((*address_low&3)^S8) ); +} + +void read_dpsh(void) +{ + *rdword = *((unsigned short*)((unsigned char*)readdps[*address_low & 0xfffc] + + ((*address_low&3)^S16) )); +} + +void read_dpsd(void) +{ + *rdword = ((unsigned long long int)(*readdps[*address_low])<<32) | + *readdps[*address_low+4]; +} + +void write_dps(void) +{ + *readdps[*address_low] = word; +} + +void write_dpsb(void) +{ + *((unsigned char*)readdps[*address_low & 0xfffc] + + ((*address_low&3)^S8) ) = cpu_byte; +} + +void write_dpsh(void) +{ + *((unsigned short*)((unsigned char*)readdps[*address_low & 0xfffc] + + ((*address_low&3)^S16) )) = hword; +} + +void write_dpsd(void) +{ + *readdps[*address_low] = (unsigned int) (dword >> 32); + *readdps[*address_low+4] = (unsigned int) (dword & 0xFFFFFFFF); +} + +void read_mi(void) +{ + *rdword = *(readmi[*address_low]); +} + +void read_mib(void) +{ + *rdword = *((unsigned char*)readmi[*address_low & 0xfffc] + + ((*address_low&3)^S8) ); +} + +void read_mih(void) +{ + *rdword = *((unsigned short*)((unsigned char*)readmi[*address_low & 0xfffc] + + ((*address_low&3)^S16) )); +} + +void read_mid(void) +{ + *rdword = ((unsigned long long int)(*readmi[*address_low])<<32) | + *readmi[*address_low+4]; +} + +void write_mi(void) +{ + switch (*address_low) + { + case 0x0: + MI_register.w_mi_init_mode_reg = word; + update_MI_init_mode_reg(); + break; + case 0xc: + MI_register.w_mi_intr_mask_reg = word; + update_MI_intr_mask_reg(); + + check_interupt(); + update_count(); + if (next_interupt <= Count) gen_interupt(); + break; + } +} + +void write_mib(void) +{ + switch (*address_low) + { + case 0x0: + case 0x1: + case 0x2: + case 0x3: + *((unsigned char*)&MI_register.w_mi_init_mode_reg + + ((*address_low&3)^S8) ) = cpu_byte; + update_MI_init_mode_reg(); + break; + case 0xc: + case 0xd: + case 0xe: + case 0xf: + *((unsigned char*)&MI_register.w_mi_intr_mask_reg + + ((*address_low&3)^S8) ) = cpu_byte; + update_MI_intr_mask_reg(); + + check_interupt(); + update_count(); + if (next_interupt <= Count) gen_interupt(); + break; + } +} + +void write_mih(void) +{ + switch (*address_low) + { + case 0x0: + case 0x2: + *((unsigned short*)((unsigned char*)&MI_register.w_mi_init_mode_reg + + ((*address_low&3)^S16) )) = hword; + update_MI_init_mode_reg(); + break; + case 0xc: + case 0xe: + *((unsigned short*)((unsigned char*)&MI_register.w_mi_intr_mask_reg + + ((*address_low&3)^S16) )) = hword; + update_MI_intr_mask_reg(); + + check_interupt(); + update_count(); + if (next_interupt <= Count) gen_interupt(); + break; + } +} + +void write_mid(void) +{ + switch (*address_low) + { + case 0x0: + MI_register.w_mi_init_mode_reg = (unsigned int) (dword >> 32); + update_MI_init_mode_reg(); + break; + case 0x8: + MI_register.w_mi_intr_mask_reg = (unsigned int) (dword & 0xFFFFFFFF); + update_MI_intr_mask_reg(); + + check_interupt(); + update_count(); + if (next_interupt <= Count) gen_interupt(); + break; + } +} + +void read_vi(void) +{ + switch (*address_low) + { + case 0x10: + update_count(); + vi_register.vi_current = (vi_register.vi_delay-(next_vi-Count))/1500; + vi_register.vi_current = (vi_register.vi_current&(~1))|vi_field; + break; + } + *rdword = *(readvi[*address_low]); +} + +void read_vib(void) +{ + switch (*address_low) + { + case 0x10: + case 0x11: + case 0x12: + case 0x13: + update_count(); + vi_register.vi_current = (vi_register.vi_delay-(next_vi-Count))/1500; + vi_register.vi_current = (vi_register.vi_current&(~1))|vi_field; + break; + } + *rdword = *((unsigned char*)readvi[*address_low & 0xfffc] + + ((*address_low&3)^S8) ); +} + +void read_vih(void) +{ + switch (*address_low) + { + case 0x10: + case 0x12: + update_count(); + vi_register.vi_current = (vi_register.vi_delay-(next_vi-Count))/1500; + vi_register.vi_current = (vi_register.vi_current&(~1))|vi_field; + break; + } + *rdword = *((unsigned short*)((unsigned char*)readvi[*address_low & 0xfffc] + + ((*address_low&3)^S16) )); +} + +void read_vid(void) +{ + switch (*address_low) + { + case 0x10: + update_count(); + vi_register.vi_current = (vi_register.vi_delay-(next_vi-Count))/1500; + vi_register.vi_current = (vi_register.vi_current&(~1))|vi_field; + break; + } + *rdword = ((unsigned long long int)(*readvi[*address_low])<<32) | + *readvi[*address_low+4]; +} + +void write_vi(void) +{ + switch (*address_low) + { + case 0x0: + if (vi_register.vi_status != word) + { + update_vi_status(word); + } + return; + break; + case 0x8: + if (vi_register.vi_width != word) + { + update_vi_width(word); + } + return; + break; + case 0x10: + MI_register.mi_intr_reg &= ~0x8; + check_interupt(); + return; + break; + } + *readvi[*address_low] = word; +} + +void update_vi_status(unsigned int word) +{ + vi_register.vi_status = word; + gfx.viStatusChanged(); +} + +void update_vi_width(unsigned int word) +{ + vi_register.vi_width = word; + gfx.viWidthChanged(); +} + +void write_vib(void) +{ + int temp; + switch (*address_low) + { + case 0x0: + case 0x1: + case 0x2: + case 0x3: + temp = vi_register.vi_status; + *((unsigned char*)&temp + + ((*address_low&3)^S8) ) = cpu_byte; + if (vi_register.vi_status != temp) + { + update_vi_status(temp); + } + return; + break; + case 0x8: + case 0x9: + case 0xa: + case 0xb: + temp = vi_register.vi_status; + *((unsigned char*)&temp + + ((*address_low&3)^S8) ) = cpu_byte; + if (vi_register.vi_width != temp) + { + update_vi_width(temp); + } + return; + break; + case 0x10: + case 0x11: + case 0x12: + case 0x13: + MI_register.mi_intr_reg &= ~0x8; + check_interupt(); + return; + break; + } + *((unsigned char*)readvi[*address_low & 0xfffc] + + ((*address_low&3)^S8) ) = cpu_byte; +} + +void write_vih(void) +{ + int temp; + switch (*address_low) + { + case 0x0: + case 0x2: + temp = vi_register.vi_status; + *((unsigned short*)((unsigned char*)&temp + + ((*address_low&3)^S16) )) = hword; + if (vi_register.vi_status != temp) + { + update_vi_status(temp); + } + return; + break; + case 0x8: + case 0xa: + temp = vi_register.vi_status; + *((unsigned short*)((unsigned char*)&temp + + ((*address_low&3)^S16) )) = hword; + if (vi_register.vi_width != temp) + { + update_vi_width(temp); + } + return; + break; + case 0x10: + case 0x12: + MI_register.mi_intr_reg &= ~0x8; + check_interupt(); + return; + break; + } + *((unsigned short*)((unsigned char*)readvi[*address_low & 0xfffc] + + ((*address_low&3)^S16) )) = hword; +} + +void write_vid(void) +{ + switch (*address_low) + { + case 0x0: + if (vi_register.vi_status != dword >> 32) + { + update_vi_status((unsigned int) (dword >> 32)); + } + vi_register.vi_origin = (unsigned int) (dword & 0xFFFFFFFF); + return; + break; + case 0x8: + if (vi_register.vi_width != dword >> 32) + { + update_vi_width((unsigned int) (dword >> 32)); + } + vi_register.vi_v_intr = (unsigned int) (dword & 0xFFFFFFFF); + return; + break; + case 0x10: + MI_register.mi_intr_reg &= ~0x8; + check_interupt(); + vi_register.vi_burst = (unsigned int) (dword & 0xFFFFFFFF); + return; + break; + } + *readvi[*address_low] = (unsigned int) (dword >> 32); + *readvi[*address_low+4] = (unsigned int) (dword & 0xFFFFFFFF); +} + +void read_ai(void) +{ + switch (*address_low) + { + case 0x4: + update_count(); + if (ai_register.current_delay != 0 && get_event(AI_INT) != 0 && (get_event(AI_INT)-Count) < 0x80000000) + *rdword = ((get_event(AI_INT)-Count)*(long long)ai_register.current_len)/ + ai_register.current_delay; + else + *rdword = 0; + return; + break; + } + *rdword = *(readai[*address_low]); +} + +void read_aib(void) +{ + unsigned int len; + switch (*address_low) + { + case 0x4: + case 0x5: + case 0x6: + case 0x7: + update_count(); + if (ai_register.current_delay != 0 && get_event(AI_INT) != 0) + len = (unsigned int) (((get_event(AI_INT) - Count) * (long long)ai_register.current_len) / ai_register.current_delay); + else + len = 0; + *rdword = *((unsigned char*)&len + ((*address_low&3)^S8) ); + return; + break; + } + *rdword = *((unsigned char*)readai[*address_low & 0xfffc] + + ((*address_low&3)^S8) ); +} + +void read_aih(void) +{ + unsigned int len; + switch (*address_low) + { + case 0x4: + case 0x6: + update_count(); + if (ai_register.current_delay != 0 && get_event(AI_INT) != 0) + len = (unsigned int) (((get_event(AI_INT)-Count) * (long long)ai_register.current_len) / ai_register.current_delay); + else + len = 0; + *rdword = *((unsigned short*)((unsigned char*)&len + + ((*address_low&3)^S16) )); + return; + break; + } + *rdword = *((unsigned short*)((unsigned char*)readai[*address_low & 0xfffc] + + ((*address_low&3)^S16) )); +} + +void read_aid(void) +{ + switch (*address_low) + { + case 0x0: + update_count(); + if (ai_register.current_delay != 0 && get_event(AI_INT) != 0) + *rdword = ((get_event(AI_INT)-Count)*(long long)ai_register.current_len)/ + ai_register.current_delay; + else + *rdword = 0; + *rdword |= (unsigned long long)ai_register.ai_dram_addr << 32; + return; + break; + } + *rdword = ((unsigned long long int)(*readai[*address_low])<<32) | + *readai[*address_low+4]; +} + +void write_ai(void) +{ + unsigned int freq,delay=0; + switch (*address_low) + { + case 0x4: + ai_register.ai_len = word; + audio.aiLenChanged(); + + freq = ROM_PARAMS.aidacrate / (ai_register.ai_dacrate+1); + if (freq) + delay = (unsigned int) (((unsigned long long)ai_register.ai_len*vi_register.vi_delay*ROM_PARAMS.vilimit)/(freq*4)); + + if (ai_register.ai_status & 0x40000000) // busy + { + ai_register.next_delay = delay; + ai_register.next_len = ai_register.ai_len; + ai_register.ai_status |= 0x80000000; + } + else + { + ai_register.current_delay = delay; + ai_register.current_len = ai_register.ai_len; + update_count(); + add_interupt_event(AI_INT, delay); + ai_register.ai_status |= 0x40000000; + } + return; + break; + case 0xc: + MI_register.mi_intr_reg &= ~0x4; + check_interupt(); + return; + break; + case 0x10: + if (ai_register.ai_dacrate != word) + { + update_ai_dacrate(word); + } + return; + break; + } + *readai[*address_low] = word; +} + +void update_ai_dacrate(unsigned int word) +{ + ai_register.ai_dacrate = word; + audio.aiDacrateChanged(ROM_PARAMS.systemtype); +} + +void write_aib(void) +{ + int temp; + unsigned int delay=0; + switch (*address_low) + { + case 0x4: + case 0x5: + case 0x6: + case 0x7: + temp = ai_register.ai_len; + *((unsigned char*)&temp + + ((*address_low&3)^S8) ) = cpu_byte; + ai_register.ai_len = temp; + audio.aiLenChanged(); + + delay = (unsigned int) (((unsigned long long)ai_register.ai_len*(ai_register.ai_dacrate+1)* + vi_register.vi_delay*ROM_PARAMS.vilimit)/ROM_PARAMS.aidacrate); + //delay = 0; + + if (ai_register.ai_status & 0x40000000) // busy + { + ai_register.next_delay = delay; + ai_register.next_len = ai_register.ai_len; + ai_register.ai_status |= 0x80000000; + } + else + { + ai_register.current_delay = delay; + ai_register.current_len = ai_register.ai_len; + update_count(); + add_interupt_event(AI_INT, delay/2); + ai_register.ai_status |= 0x40000000; + } + return; + break; + case 0xc: + case 0xd: + case 0xe: + case 0xf: + MI_register.mi_intr_reg &= ~0x4; + check_interupt(); + return; + break; + case 0x10: + case 0x11: + case 0x12: + case 0x13: + temp = ai_register.ai_dacrate; + *((unsigned char*)&temp + + ((*address_low&3)^S8) ) = cpu_byte; + if (ai_register.ai_dacrate != temp) + { + update_ai_dacrate(temp); + } + return; + break; + } + *((unsigned char*)readai[*address_low & 0xfffc] + + ((*address_low&3)^S8) ) = cpu_byte; +} + +void write_aih(void) +{ + int temp; + unsigned int delay=0; + switch (*address_low) + { + case 0x4: + case 0x6: + temp = ai_register.ai_len; + *((unsigned short*)((unsigned char*)&temp + + ((*address_low&3)^S16) )) = hword; + ai_register.ai_len = temp; + audio.aiLenChanged(); + + delay = (unsigned int) (((unsigned long long)ai_register.ai_len*(ai_register.ai_dacrate+1)* + vi_register.vi_delay*ROM_PARAMS.vilimit)/ROM_PARAMS.aidacrate); + + if (ai_register.ai_status & 0x40000000) // busy + { + ai_register.next_delay = delay; + ai_register.next_len = ai_register.ai_len; + ai_register.ai_status |= 0x80000000; + } + else + { + ai_register.current_delay = delay; + ai_register.current_len = ai_register.ai_len; + update_count(); + add_interupt_event(AI_INT, delay/2); + ai_register.ai_status |= 0x40000000; + } + return; + break; + case 0xc: + case 0xe: + MI_register.mi_intr_reg &= ~0x4; + check_interupt(); + return; + break; + case 0x10: + case 0x12: + temp = ai_register.ai_dacrate; + *((unsigned short*)((unsigned char*)&temp + + ((*address_low&3)^S16) )) = hword; + if (ai_register.ai_dacrate != temp) + { + update_ai_dacrate(temp); + } + return; + break; + } + *((unsigned short*)((unsigned char*)readai[*address_low & 0xfffc] + + ((*address_low&3)^S16) )) = hword; +} + +void write_aid(void) +{ + unsigned int delay=0; + switch (*address_low) + { + case 0x0: + ai_register.ai_dram_addr = (unsigned int) (dword >> 32); + ai_register.ai_len = (unsigned int) (dword & 0xFFFFFFFF); + audio.aiLenChanged(); + + delay = (unsigned int) (((unsigned long long)ai_register.ai_len*(ai_register.ai_dacrate+1)* + vi_register.vi_delay*ROM_PARAMS.vilimit)/ROM_PARAMS.aidacrate); + + if (ai_register.ai_status & 0x40000000) // busy + { + ai_register.next_delay = delay; + ai_register.next_len = ai_register.ai_len; + ai_register.ai_status |= 0x80000000; + } + else + { + ai_register.current_delay = delay; + ai_register.current_len = ai_register.ai_len; + update_count(); + add_interupt_event(AI_INT, delay/2); + ai_register.ai_status |= 0x40000000; + } + return; + break; + case 0x8: + ai_register.ai_control = (unsigned int) (dword >> 32); + MI_register.mi_intr_reg &= ~0x4; + check_interupt(); + return; + break; + case 0x10: + if (ai_register.ai_dacrate != dword >> 32) + { + update_ai_dacrate((unsigned int) (dword >> 32)); + } + ai_register.ai_bitrate = (unsigned int) (dword & 0xFFFFFFFF); + return; + break; + } + *readai[*address_low] = (unsigned int) (dword >> 32); + *readai[*address_low+4] = (unsigned int) (dword & 0xFFFFFFFF); +} + +void read_pi(void) +{ + *rdword = *(readpi[*address_low]); +} + +void read_pib(void) +{ + *rdword = *((unsigned char*)readpi[*address_low & 0xfffc] + + ((*address_low&3)^S8) ); +} + +void read_pih(void) +{ + *rdword = *((unsigned short*)((unsigned char*)readpi[*address_low & 0xfffc] + + ((*address_low&3)^S16) )); +} + +void read_pid(void) +{ + *rdword = ((unsigned long long int)(*readpi[*address_low])<<32) | + *readpi[*address_low+4]; +} + +void write_pi(void) +{ + switch (*address_low) + { + case 0x8: + pi_register.pi_rd_len_reg = word; + dma_pi_read(); + return; + break; + case 0xc: + pi_register.pi_wr_len_reg = word; + dma_pi_write(); + return; + break; + case 0x10: + if (word & 2) MI_register.mi_intr_reg &= ~0x10; + check_interupt(); + return; + break; + case 0x14: + case 0x18: + case 0x1c: + case 0x20: + case 0x24: + case 0x28: + case 0x2c: + case 0x30: + *readpi[*address_low] = word & 0xFF; + return; + break; + } + *readpi[*address_low] = word; +} + +void write_pib(void) +{ + switch (*address_low) + { + case 0x8: + case 0x9: + case 0xa: + case 0xb: + *((unsigned char*)&pi_register.pi_rd_len_reg + + ((*address_low&3)^S8) ) = cpu_byte; + dma_pi_read(); + return; + break; + case 0xc: + case 0xd: + case 0xe: + case 0xf: + *((unsigned char*)&pi_register.pi_wr_len_reg + + ((*address_low&3)^S8) ) = cpu_byte; + dma_pi_write(); + return; + break; + case 0x10: + case 0x11: + case 0x12: + case 0x13: + if (word) MI_register.mi_intr_reg &= ~0x10; + check_interupt(); + return; + break; + case 0x14: + case 0x15: + case 0x16: + case 0x18: + case 0x19: + case 0x1a: + case 0x1c: + case 0x1d: + case 0x1e: + case 0x20: + case 0x21: + case 0x22: + case 0x24: + case 0x25: + case 0x26: + case 0x28: + case 0x29: + case 0x2a: + case 0x2c: + case 0x2d: + case 0x2e: + case 0x30: + case 0x31: + case 0x32: + return; + break; + } + *((unsigned char*)readpi[*address_low & 0xfffc] + + ((*address_low&3)^S8) ) = cpu_byte; +} + +void write_pih(void) +{ + switch (*address_low) + { + case 0x8: + case 0xa: + *((unsigned short*)((unsigned char*)&pi_register.pi_rd_len_reg + + ((*address_low&3)^S16) )) = hword; + dma_pi_read(); + return; + break; + case 0xc: + case 0xe: + *((unsigned short*)((unsigned char*)&pi_register.pi_wr_len_reg + + ((*address_low&3)^S16) )) = hword; + dma_pi_write(); + return; + break; + case 0x10: + case 0x12: + if (word) MI_register.mi_intr_reg &= ~0x10; + check_interupt(); + return; + break; + case 0x16: + case 0x1a: + case 0x1e: + case 0x22: + case 0x26: + case 0x2a: + case 0x2e: + case 0x32: + *((unsigned short*)((unsigned char*)readpi[*address_low & 0xfffc] + + ((*address_low&3)^S16) )) = hword & 0xFF; + return; + break; + case 0x14: + case 0x18: + case 0x1c: + case 0x20: + case 0x24: + case 0x28: + case 0x2c: + case 0x30: + return; + break; + } + *((unsigned short*)((unsigned char*)readpi[*address_low & 0xfffc] + + ((*address_low&3)^S16) )) = hword; +} + +void write_pid(void) +{ + switch (*address_low) + { + case 0x8: + pi_register.pi_rd_len_reg = (unsigned int) (dword >> 32); + dma_pi_read(); + pi_register.pi_wr_len_reg = (unsigned int) (dword & 0xFFFFFFFF); + dma_pi_write(); + return; + break; + case 0x10: + if (word) MI_register.mi_intr_reg &= ~0x10; + check_interupt(); + *readpi[*address_low+4] = (unsigned int) (dword & 0xFF); + return; + break; + case 0x18: + case 0x20: + case 0x28: + case 0x30: + *readpi[*address_low] = (unsigned int) (dword >> 32) & 0xFF; + *readpi[*address_low+4] = (unsigned int) (dword & 0xFF); + return; + break; + } + *readpi[*address_low] = (unsigned int) (dword >> 32); + *readpi[*address_low+4] = (unsigned int) (dword & 0xFFFFFFFF); +} + +void read_ri(void) +{ + *rdword = *(readri[*address_low]); +} + +void read_rib(void) +{ + *rdword = *((unsigned char*)readri[*address_low & 0xfffc] + + ((*address_low&3)^S8) ); +} + +void read_rih(void) +{ + *rdword = *((unsigned short*)((unsigned char*)readri[*address_low & 0xfffc] + + ((*address_low&3)^S16) )); +} + +void read_rid(void) +{ + *rdword = ((unsigned long long int)(*readri[*address_low])<<32) | + *readri[*address_low+4]; +} + +void write_ri(void) +{ + *readri[*address_low] = word; +} + +void write_rib(void) +{ + *((unsigned char*)readri[*address_low & 0xfffc] + + ((*address_low&3)^S8) ) = cpu_byte; +} + +void write_rih(void) +{ + *((unsigned short*)((unsigned char*)readri[*address_low & 0xfffc] + + ((*address_low&3)^S16) )) = hword; +} + +void write_rid(void) +{ + *readri[*address_low] = (unsigned int) (dword >> 32); + *readri[*address_low+4] = (unsigned int) (dword & 0xFFFFFFFF); +} + +void read_si(void) +{ + *rdword = *(readsi[*address_low]); +} + +void read_sib(void) +{ + *rdword = *((unsigned char*)readsi[*address_low & 0xfffc] + + ((*address_low&3)^S8) ); +} + +void read_sih(void) +{ + *rdword = *((unsigned short*)((unsigned char*)readsi[*address_low & 0xfffc] + + ((*address_low&3)^S16) )); +} + +void read_sid(void) +{ + *rdword = ((unsigned long long int)(*readsi[*address_low])<<32) | + *readsi[*address_low+4]; +} + +void write_si(void) +{ + switch (*address_low) + { + case 0x0: + si_register.si_dram_addr = word; + return; + break; + case 0x4: + si_register.si_pif_addr_rd64b = word; + dma_si_read(); + return; + break; + case 0x10: + si_register.si_pif_addr_wr64b = word; + dma_si_write(); + return; + break; + case 0x18: + MI_register.mi_intr_reg &= ~0x2; + si_register.si_stat &= ~0x1000; + check_interupt(); + return; + break; + } +} + +void write_sib(void) +{ + switch (*address_low) + { + case 0x0: + case 0x1: + case 0x2: + case 0x3: + *((unsigned char*)&si_register.si_dram_addr + + ((*address_low&3)^S8) ) = cpu_byte; + return; + break; + case 0x4: + case 0x5: + case 0x6: + case 0x7: + *((unsigned char*)&si_register.si_pif_addr_rd64b + + ((*address_low&3)^S8) ) = cpu_byte; + dma_si_read(); + return; + break; + case 0x10: + case 0x11: + case 0x12: + case 0x13: + *((unsigned char*)&si_register.si_pif_addr_wr64b + + ((*address_low&3)^S8) ) = cpu_byte; + dma_si_write(); + return; + break; + case 0x18: + case 0x19: + case 0x1a: + case 0x1b: + MI_register.mi_intr_reg &= ~0x2; + si_register.si_stat &= ~0x1000; + check_interupt(); + return; + break; + } +} + +void write_sih(void) +{ + switch (*address_low) + { + case 0x0: + case 0x2: + *((unsigned short*)((unsigned char*)&si_register.si_dram_addr + + ((*address_low&3)^S16) )) = hword; + return; + break; + case 0x4: + case 0x6: + *((unsigned short*)((unsigned char*)&si_register.si_pif_addr_rd64b + + ((*address_low&3)^S16) )) = hword; + dma_si_read(); + return; + break; + case 0x10: + case 0x12: + *((unsigned short*)((unsigned char*)&si_register.si_pif_addr_wr64b + + ((*address_low&3)^S16) )) = hword; + dma_si_write(); + return; + break; + case 0x18: + case 0x1a: + MI_register.mi_intr_reg &= ~0x2; + si_register.si_stat &= ~0x1000; + check_interupt(); + return; + break; + } +} + +void write_sid(void) +{ + switch (*address_low) + { + case 0x0: + si_register.si_dram_addr = (unsigned int) (dword >> 32); + si_register.si_pif_addr_rd64b = (unsigned int) (dword & 0xFFFFFFFF); + dma_si_read(); + return; + break; + case 0x10: + si_register.si_pif_addr_wr64b = (unsigned int) (dword >> 32); + dma_si_write(); + return; + break; + case 0x18: + MI_register.mi_intr_reg &= ~0x2; + si_register.si_stat &= ~0x1000; + check_interupt(); + return; + break; + } +} + +void read_flashram_status(void) +{ + if (flashram_info.use_flashram != -1 && *address_low == 0) + { + *rdword = flashram_status(); + flashram_info.use_flashram = 1; + } + else + DebugMessage(M64MSG_ERROR, "unknown read in read_flashram_status()"); +} + +void read_flashram_statusb(void) +{ + DebugMessage(M64MSG_ERROR, "read_flashram_statusb() not implemented"); +} + +void read_flashram_statush(void) +{ + DebugMessage(M64MSG_ERROR, "read_flashram_statush() not implemented"); +} + +void read_flashram_statusd(void) +{ + DebugMessage(M64MSG_ERROR, "read_flashram_statusd() not implemented"); +} + +void write_flashram_dummy(void) +{ +} + +void write_flashram_dummyb(void) +{ +} + +void write_flashram_dummyh(void) +{ +} + +void write_flashram_dummyd(void) +{ +} + +void write_flashram_command(void) +{ + if (flashram_info.use_flashram != -1 && *address_low == 0) + { + flashram_command(word); + flashram_info.use_flashram = 1; + } + else + DebugMessage(M64MSG_ERROR, "unknown write in write_flashram_command()"); +} + +void write_flashram_commandb(void) +{ + DebugMessage(M64MSG_ERROR, "write_flashram_commandb() not implemented"); +} + +void write_flashram_commandh(void) +{ + DebugMessage(M64MSG_ERROR, "write_flashram_commandh() not implemented"); +} + +void write_flashram_commandd(void) +{ + DebugMessage(M64MSG_ERROR, "write_flashram_commandd() not implemented"); +} + +static unsigned int lastwrite = 0; + +void read_rom(void) +{ + if (lastwrite) + { + *rdword = lastwrite; + lastwrite = 0; + } + else + *rdword = *((unsigned int *)(rom + (address & 0x03FFFFFF))); +} + +void read_romb(void) +{ + *rdword = *(rom + ((address^S8) & 0x03FFFFFF)); +} + +void read_romh(void) +{ + *rdword = *((unsigned short *)(rom + ((address^S16) & 0x03FFFFFF))); +} + +void read_romd(void) +{ + *rdword = ((unsigned long long)(*((unsigned int *)(rom+(address&0x03FFFFFF))))<<32)| + *((unsigned int *)(rom + ((address+4)&0x03FFFFFF))); +} + +void write_rom(void) +{ + lastwrite = word; +} + +void read_pif(void) +{ + if ((*address_low > 0x7FF) || (*address_low < 0x7C0)) + { + DebugMessage(M64MSG_ERROR, "reading a word in PIF at invalid address 0x%x", address); + *rdword = 0; + return; + } + + *rdword = sl(*((unsigned int *)(PIF_RAMb + (address & 0x7FF) - 0x7C0))); +} + +void read_pifb(void) +{ + if ((*address_low > 0x7FF) || (*address_low < 0x7C0)) + { + DebugMessage(M64MSG_ERROR, "reading a byte in PIF at invalid address 0x%x", address); + *rdword = 0; + return; + } + + *rdword = *(PIF_RAMb + ((address & 0x7FF) - 0x7C0)); +} + +void read_pifh(void) +{ + if ((*address_low > 0x7FF) || (*address_low < 0x7C0)) + { + DebugMessage(M64MSG_ERROR, "reading a hword in PIF at invalid address 0x%x", address); + *rdword = 0; + return; + } + + *rdword = (*(PIF_RAMb + ((address & 0x7FF) - 0x7C0)) << 8) | + *(PIF_RAMb + (((address+1) & 0x7FF) - 0x7C0)); +} + +void read_pifd(void) +{ + if ((*address_low > 0x7FF) || (*address_low < 0x7C0)) + { + DebugMessage(M64MSG_ERROR, "reading a double word in PIF in invalid address 0x%x", address); + *rdword = 0; + return; + } + + *rdword = ((unsigned long long)sl(*((unsigned int *)(PIF_RAMb + (address & 0x7FF) - 0x7C0))) << 32)| + sl(*((unsigned int *)(PIF_RAMb + ((address+4) & 0x7FF) - 0x7C0))); +} + +void write_pif(void) +{ + if ((*address_low > 0x7FF) || (*address_low < 0x7C0)) + { + DebugMessage(M64MSG_ERROR, "writing a word in PIF at invalid address 0x%x", address); + return; + } + + *((unsigned int *)(PIF_RAMb + (address & 0x7FF) - 0x7C0)) = sl(word); + if ((address & 0x7FF) == 0x7FC) + { + if (PIF_RAMb[0x3F] == 0x08) + { + PIF_RAMb[0x3F] = 0; + update_count(); + add_interupt_event(SI_INT, /*0x100*/0x900); + } + else + update_pif_write(); + } +} + +void write_pifb(void) +{ + if ((*address_low > 0x7FF) || (*address_low < 0x7C0)) + { + DebugMessage(M64MSG_ERROR, "writing a byte in PIF at invalid address 0x%x", address); + return; + } + + *(PIF_RAMb + (address & 0x7FF) - 0x7C0) = cpu_byte; + if ((address & 0x7FF) == 0x7FF) + { + if (PIF_RAMb[0x3F] == 0x08) + { + PIF_RAMb[0x3F] = 0; + update_count(); + add_interupt_event(SI_INT, /*0x100*/0x900); + } + else + update_pif_write(); + } +} + +void write_pifh(void) +{ + if ((*address_low > 0x7FF) || (*address_low < 0x7C0)) + { + DebugMessage(M64MSG_ERROR, "writing a hword in PIF at invalid address 0x%x", address); + return; + } + + *(PIF_RAMb + (address & 0x7FF) - 0x7C0) = hword >> 8; + *(PIF_RAMb + ((address+1) & 0x7FF) - 0x7C0) = hword & 0xFF; + if ((address & 0x7FF) == 0x7FE) + { + if (PIF_RAMb[0x3F] == 0x08) + { + PIF_RAMb[0x3F] = 0; + update_count(); + add_interupt_event(SI_INT, /*0x100*/0x900); + } + else + update_pif_write(); + } +} + +void write_pifd(void) +{ + if ((*address_low > 0x7FF) || (*address_low < 0x7C0)) + { + DebugMessage(M64MSG_ERROR, "writing a double word in PIF at 0x%x", address); + return; + } + + *((unsigned int *)(PIF_RAMb + (address & 0x7FF) - 0x7C0)) = + sl((unsigned int)(dword >> 32)); + *((unsigned int *)(PIF_RAMb + (address & 0x7FF) - 0x7C0)) = + sl((unsigned int)(dword & 0xFFFFFFFF)); + if ((address & 0x7FF) == 0x7F8) + { + if (PIF_RAMb[0x3F] == 0x08) + { + PIF_RAMb[0x3F] = 0; + update_count(); + add_interupt_event(SI_INT, /*0x100*/0x900); + } + else + update_pif_write(); + } +} + +unsigned int *fast_mem_access(unsigned int address) +{ + /* This code is performance critical, specially on pure interpreter mode. + * Removing error checking saves some time, but the emulator may crash. */ + if (address < 0x80000000 || address >= 0xc0000000) + address = virtual_to_physical_address(address, 2); + + if ((address & 0x1FFFFFFF) >= 0x10000000) + return (unsigned int *)rom + ((address & 0x1FFFFFFF) - 0x10000000)/4; + else if ((address & 0x1FFFFFFF) < 0x800000) + return (unsigned int *)rdram + (address & 0x1FFFFFFF)/4; + else if (address >= 0xa4000000 && address <= 0xa4001000) + return (unsigned int *)SP_DMEM + (address & 0xFFF)/4; + else if ((address >= 0xa4001000 && address <= 0xa4002000)) + return (unsigned int *)SP_IMEM + (address & 0xFFF)/4; + else + return NULL; +} diff --git a/libmupen64plus/mupen64plus-core/src/memory/memory.h b/libmupen64plus/mupen64plus-core/src/memory/memory.h new file mode 100644 index 0000000000..2efeada159 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/memory/memory.h @@ -0,0 +1,413 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - memory.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef MEMORY_H +#define MEMORY_H + +#include "osal/preproc.h" + +int init_memory(int DoByteSwap); +void free_memory(void); +#define read_word_in_memory() readmem[address>>16]() +#define read_byte_in_memory() readmemb[address>>16]() +#define read_hword_in_memory() readmemh[address>>16]() +#define read_dword_in_memory() readmemd[address>>16]() +#define write_word_in_memory() writemem[address>>16]() +#define write_byte_in_memory() writememb[address >>16]() +#define write_hword_in_memory() writememh[address >>16]() +#define write_dword_in_memory() writememd[address >>16]() +extern unsigned int SP_DMEM[0x1000/4*2]; +extern unsigned char *SP_DMEMb; +extern unsigned int *SP_IMEM; +extern unsigned char *SP_IMEMb; +extern unsigned int PIF_RAM[0x40/4]; +extern unsigned char *PIF_RAMb; + +extern ALIGN(16, unsigned int rdram[0x800000/4]); + +extern unsigned int address, word; +extern unsigned char cpu_byte; +extern unsigned short hword; +extern unsigned long long dword, *rdword; + +extern void (*readmem[0x10000])(void); +extern void (*readmemb[0x10000])(void); +extern void (*readmemh[0x10000])(void); +extern void (*readmemd[0x10000])(void); +extern void (*writemem[0x10000])(void); +extern void (*writememb[0x10000])(void); +extern void (*writememh[0x10000])(void); +extern void (*writememd[0x10000])(void); + +extern unsigned int *readrdramreg[0x10000]; +extern unsigned int *readrspreg[0x10000]; +extern unsigned int *readrsp[0x10000]; +extern unsigned int *readmi[0x10000]; +extern unsigned int *readvi[0x10000]; +extern unsigned int *readai[0x10000]; +extern unsigned int *readpi[0x10000]; +extern unsigned int *readri[0x10000]; +extern unsigned int *readsi[0x10000]; +extern unsigned int *readdp[0x10000]; +extern unsigned int *readdps[0x10000]; + +typedef struct _RDRAM_register +{ + unsigned int rdram_config; + unsigned int rdram_device_id; + unsigned int rdram_delay; + unsigned int rdram_mode; + unsigned int rdram_ref_interval; + unsigned int rdram_ref_row; + unsigned int rdram_ras_interval; + unsigned int rdram_min_interval; + unsigned int rdram_addr_select; + unsigned int rdram_device_manuf; +} RDRAM_register; + +typedef struct _SP_register +{ + unsigned int sp_mem_addr_reg; + unsigned int sp_dram_addr_reg; + unsigned int sp_rd_len_reg; + unsigned int sp_wr_len_reg; + unsigned int w_sp_status_reg; + unsigned int sp_status_reg; + unsigned int sp_dma_full_reg; + unsigned int sp_dma_busy_reg; + unsigned int sp_semaphore_reg; +} SP_register; + +typedef struct _RSP_register +{ + unsigned int rsp_pc; + unsigned int rsp_ibist; +} RSP_register; + +typedef struct _DPC_register +{ + unsigned int dpc_start; + unsigned int dpc_end; + unsigned int dpc_current; + unsigned int w_dpc_status; + unsigned int dpc_status; + unsigned int dpc_clock; + unsigned int dpc_bufbusy; + unsigned int dpc_pipebusy; + unsigned int dpc_tmem; +} DPC_register; + +typedef struct _DPS_register +{ + unsigned int dps_tbist; + unsigned int dps_test_mode; + unsigned int dps_buftest_addr; + unsigned int dps_buftest_data; +} DPS_register; + +typedef struct _mips_register +{ + unsigned int w_mi_init_mode_reg; + unsigned int mi_init_mode_reg; + unsigned int mi_version_reg; + unsigned int mi_intr_reg; + unsigned int mi_intr_mask_reg; + unsigned int w_mi_intr_mask_reg; +} mips_register; + +typedef struct _VI_register +{ + unsigned int vi_status; + unsigned int vi_origin; + unsigned int vi_width; + unsigned int vi_v_intr; + unsigned int vi_current; + unsigned int vi_burst; + unsigned int vi_v_sync; + unsigned int vi_h_sync; + unsigned int vi_leap; + unsigned int vi_h_start; + unsigned int vi_v_start; + unsigned int vi_v_burst; + unsigned int vi_x_scale; + unsigned int vi_y_scale; + unsigned int vi_delay; +} VI_register; + +typedef struct _AI_register +{ + unsigned int ai_dram_addr; + unsigned int ai_len; + unsigned int ai_control; + unsigned int ai_status; + unsigned int ai_dacrate; + unsigned int ai_bitrate; + unsigned int next_delay; + unsigned int next_len; + unsigned int current_delay; + unsigned int current_len; +} AI_register; + +typedef struct _PI_register +{ + unsigned int pi_dram_addr_reg; + unsigned int pi_cart_addr_reg; + unsigned int pi_rd_len_reg; + unsigned int pi_wr_len_reg; + unsigned int read_pi_status_reg; + unsigned int pi_bsd_dom1_lat_reg; + unsigned int pi_bsd_dom1_pwd_reg; + unsigned int pi_bsd_dom1_pgs_reg; + unsigned int pi_bsd_dom1_rls_reg; + unsigned int pi_bsd_dom2_lat_reg; + unsigned int pi_bsd_dom2_pwd_reg; + unsigned int pi_bsd_dom2_pgs_reg; + unsigned int pi_bsd_dom2_rls_reg; +} PI_register; + +typedef struct _RI_register +{ + unsigned int ri_mode; + unsigned int ri_config; + unsigned int ri_current_load; + unsigned int ri_select; + unsigned int ri_refresh; + unsigned int ri_latency; + unsigned int ri_error; + unsigned int ri_werror; +} RI_register; + +typedef struct _SI_register +{ + unsigned int si_dram_addr; + unsigned int si_pif_addr_rd64b; + unsigned int si_pif_addr_wr64b; + unsigned int si_stat; +} SI_register; + +extern RDRAM_register rdram_register; +extern PI_register pi_register; +extern mips_register MI_register; +extern SP_register sp_register; +extern SI_register si_register; +extern VI_register vi_register; +extern RSP_register rsp_register; +extern RI_register ri_register; +extern AI_register ai_register; +extern DPC_register dpc_register; +extern DPS_register dps_register; + +extern unsigned char *rdramb; + +#ifndef M64P_BIG_ENDIAN +#define sl(mot) \ +( \ +((mot & 0x000000FF) << 24) | \ +((mot & 0x0000FF00) << 8) | \ +((mot & 0x00FF0000) >> 8) | \ +((mot & 0xFF000000) >> 24) \ +) + +#define S8 3 +#define S16 2 +#define Sh16 1 + +#else + +#define sl(mot) mot +#define S8 0 +#define S16 0 +#define Sh16 0 + +#endif + +void read_nothing(void); +void read_nothingh(void); +void read_nothingb(void); +void read_nothingd(void); +void read_nomem(void); +void read_nomemb(void); +void read_nomemh(void); +void read_nomemd(void); +void read_rdram(void); +void read_rdramb(void); +void read_rdramh(void); +void read_rdramd(void); +void read_rdramFB(void); +void read_rdramFBb(void); +void read_rdramFBh(void); +void read_rdramFBd(void); +void read_rdramreg(void); +void read_rdramregb(void); +void read_rdramregh(void); +void read_rdramregd(void); +void read_rsp_mem(void); +void read_rsp_memb(void); +void read_rsp_memh(void); +void read_rsp_memd(void); +void read_rsp_reg(void); +void read_rsp_regb(void); +void read_rsp_regh(void); +void read_rsp_regd(void); +void read_rsp(void); +void read_rspb(void); +void read_rsph(void); +void read_rspd(void); +void read_dp(void); +void read_dpb(void); +void read_dph(void); +void read_dpd(void); +void read_dps(void); +void read_dpsb(void); +void read_dpsh(void); +void read_dpsd(void); +void read_mi(void); +void read_mib(void); +void read_mih(void); +void read_mid(void); +void read_vi(void); +void read_vib(void); +void read_vih(void); +void read_vid(void); +void read_ai(void); +void read_aib(void); +void read_aih(void); +void read_aid(void); +void read_pi(void); +void read_pib(void); +void read_pih(void); +void read_pid(void); +void read_ri(void); +void read_rib(void); +void read_rih(void); +void read_rid(void); +void read_si(void); +void read_sib(void); +void read_sih(void); +void read_sid(void); +void read_flashram_status(void); +void read_flashram_statusb(void); +void read_flashram_statush(void); +void read_flashram_statusd(void); +void read_rom(void); +void read_romb(void); +void read_romh(void); +void read_romd(void); +void read_pif(void); +void read_pifb(void); +void read_pifh(void); +void read_pifd(void); + +void write_nothing(void); +void write_nothingb(void); +void write_nothingh(void); +void write_nothingd(void); +void write_nomem(void); +void write_nomemb(void); +void write_nomemd(void); +void write_nomemh(void); +void write_rdram(void); +void write_rdramb(void); +void write_rdramh(void); +void write_rdramd(void); +void write_rdramFB(void); +void write_rdramFBb(void); +void write_rdramFBh(void); +void write_rdramFBd(void); +void write_rdramreg(void); +void write_rdramregb(void); +void write_rdramregh(void); +void write_rdramregd(void); +void write_rsp_mem(void); +void write_rsp_memb(void); +void write_rsp_memh(void); +void write_rsp_memd(void); +void write_rsp_reg(void); +void write_rsp_regb(void); +void write_rsp_regh(void); +void write_rsp_regd(void); +void write_rsp(void); +void write_rspb(void); +void write_rsph(void); +void write_rspd(void); +void write_dp(void); +void write_dpb(void); +void write_dph(void); +void write_dpd(void); +void write_dps(void); +void write_dpsb(void); +void write_dpsh(void); +void write_dpsd(void); +void write_mi(void); +void write_mib(void); +void write_mih(void); +void write_mid(void); +void write_vi(void); +void write_vib(void); +void write_vih(void); +void write_vid(void); +void write_ai(void); +void write_aib(void); +void write_aih(void); +void write_aid(void); +void write_pi(void); +void write_pib(void); +void write_pih(void); +void write_pid(void); +void write_ri(void); +void write_rib(void); +void write_rih(void); +void write_rid(void); +void write_si(void); +void write_sib(void); +void write_sih(void); +void write_sid(void); +void write_flashram_dummy(void); +void write_flashram_dummyb(void); +void write_flashram_dummyh(void); +void write_flashram_dummyd(void); +void write_flashram_command(void); +void write_flashram_commandb(void); +void write_flashram_commandh(void); +void write_flashram_commandd(void); +void write_rom(void); +void write_pif(void); +void write_pifb(void); +void write_pifh(void); +void write_pifd(void); + +void make_w_sp_status_reg(void); +void make_w_dpc_status(void); +void make_w_mi_init_mode_reg(void); +void update_MI_intr_mode_reg(void); +void update_MI_init_mask_reg(void); +void make_w_mi_intr_mask_reg(void); +void update_ai_dacrate(unsigned int word); +void update_vi_status(unsigned int word); +void update_vi_width(unsigned int word); + +/* Returns a pointer to a block of contiguous memory + * Can access RDRAM, SP_DMEM, SP_IMEM and ROM, using TLB if necessary + * Useful for getting fast access to a zone with executable code. */ +unsigned int *fast_mem_access(unsigned int address); + +#endif + diff --git a/libmupen64plus/mupen64plus-core/src/memory/n64_cic_nus_6105.c b/libmupen64plus/mupen64plus-core/src/memory/n64_cic_nus_6105.c new file mode 100644 index 0000000000..0580669d19 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/memory/n64_cic_nus_6105.c @@ -0,0 +1,119 @@ +/* + * Copyright 2011 X-Scale. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY X-Scale ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + * EVENT SHALL X-Scale OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are + * those of the authors and should not be interpreted as representing official + * policies, either expressed or implied, of X-Scale. + * + * This software provides an algorithm that emulates the protection scheme of + * N64 PIF/CIC-NUS-6105, by determining the proper response to each challenge. + * It was synthesized after a careful, exhaustive and detailed analysis of the + * challenge/response pairs stored in the 'pif2.dat' file from Project 64. + * These challenge/response pairs were the only resource used during this + * project. There was no kind of physical access to N64 hardware. + * + * This project would have never been possible without the contribuitions of + * the following individuals and organizations: + * + * - Oman: For being at the right place at the right time and being brave + * enough to pay a personal price so we could understand in a much deeper + * way how this magical console really works. We owe you so much. + * + * - Jovis: For all the positive energy and impressive hacking spirit that you + * shared with the N64 community. You were absolutely instrumental in + * several key events that shaped the N64 community in the last 14 years. + * Even if you're not physically with us anymore, your heritage, your + * knowledge and your attitude will never be forgotten. + * + * 'The candle that burns twice as bright burns half as long.' + * + * - LaC: For the endless contributions that you've given to the N64 community + * since the early days, when N64 was the next big thing. I've always + * admired the deep knowledge that you've gathered about the most little + * hardware details. Recently, you challanged us to find a small and + * concise algorithm that would emulate the behaviour of CIC-NUS-6105 + * challenge/response protection scheme and here is the final result. + * LaC, Oman and Jovis were definitly the dream team of N64 reversing in + * the late 90's. Without your contributions, we would be much poorer. + * + * - marshall: For keeping the N64 scene alive during the last decade, when + * most people lost interest and moved along to different projects. You + * are the force that has been keeping us all together in the later + * years. When almost nobody cared about N64 anymore, you were always + * there, spreading the word, developing in the console, and lately, + * making impressive advances on the hardware side. I wish the best + * success to your new 64drive project. + * + * - hcs: For your contributions to the better understanding of the inner + * workings of the Reality Co-Processor (RCP). Your skills have impressed + * me for a long time now. And without your precious help by sharing your + * kownledge, I would have never understood the immense importance of + * Oman, Jovis and LaC achievements. Thank you ! + * + * - Azimer & Tooie: For sharing with the N64 community your findings about the + * challenge/response pair used in 'Jet Force Gemini' and the 267 + * challenge/response pairs used in 'Banjo Tooie', all stored in the + * 'pif2.dat' file of Project 64. They were instrumental to the final + * success of this endeavour. + * + * - Silicon Graphics, Inc. (SGI): For creating MIPS R4000, MIPS R4300 and + * Reality Co-Processor (RCP). You were the ultimate dream creator during + * the late 80's and early 90's. A very special word of gratitude goes to + * the two teams that during those years created RCP and MIPS R4300. They + * were technological breakthroughs back then. + * + * On a personal note, I would like to show my deepest gratitude to _Bijou_, + * for being always a source of endless hope and inspiration. + * + * -= X-Scale =- (#n64dev@EFnet) + */ + +#include "n64_cic_nus_6105.h" + +void n64_cic_nus_6105(char chl[], char rsp[], int len) +{ + static char lut0[0x10] = { + 0x4, 0x7, 0xA, 0x7, 0xE, 0x5, 0xE, 0x1, + 0xC, 0xF, 0x8, 0xF, 0x6, 0x3, 0x6, 0x9 + }; + static char lut1[0x10] = { + 0x4, 0x1, 0xA, 0x7, 0xE, 0x5, 0xE, 0x1, + 0xC, 0x9, 0x8, 0x5, 0x6, 0x3, 0xC, 0x9 + }; + char key, *lut; + int i, sgn, mag, mod; + + for (key = 0xB, lut = lut0, i = 0; i < len; i++) { + rsp[i] = (key + 5 * chl[i]) & 0xF; + key = lut[(int) rsp[i]]; + sgn = (rsp[i] >> 3) & 0x1; + mag = ((sgn == 1) ? ~rsp[i] : rsp[i]) & 0x7; + mod = (mag % 3 == 1) ? sgn : 1 - sgn; + if (lut == lut1 && (rsp[i] == 0x1 || rsp[i] == 0x9)) + mod = 1; + if (lut == lut1 && (rsp[i] == 0xB || rsp[i] == 0xE)) + mod = 0; + lut = (mod == 1) ? lut1 : lut0; + } +} + diff --git a/libmupen64plus/mupen64plus-core/src/memory/n64_cic_nus_6105.h b/libmupen64plus/mupen64plus-core/src/memory/n64_cic_nus_6105.h new file mode 100644 index 0000000000..0185d5ecff --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/memory/n64_cic_nus_6105.h @@ -0,0 +1,98 @@ +/* + * Copyright 2011 X-Scale. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY X-Scale ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + * EVENT SHALL X-Scale OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are + * those of the authors and should not be interpreted as representing official + * policies, either expressed or implied, of X-Scale. + * + * This software provides an algorithm that emulates the protection scheme of + * N64 PIF/CIC-NUS-6105, by determining the proper response to each challenge. + * It was synthesized after a careful, exhaustive and detailed analysis of the + * challenge/response pairs stored in the 'pif2.dat' file from Project 64. + * These challenge/response pairs were the only resource used during this + * project. There was no kind of physical access to N64 hardware. + * + * This project would have never been possible without the contribuitions of + * the following individuals and organizations: + * + * - Oman: For being at the right place at the right time and being brave + * enough to pay a personal price so we could understand in a much deeper + * way how this magical console really works. We owe you so much. + * + * - Jovis: For all the positive energy and impressive hacking spirit that you + * shared with the N64 community. You were absolutely instrumental in + * several key events that shaped the N64 community in the last 14 years. + * Even if you're not physically with us anymore, your heritage, your + * knowledge and your attitude will never be forgotten. + * + * 'The candle that burns twice as bright burns half as long.' + * + * - LaC: For the endless contributions that you've given to the N64 community + * since the early days, when N64 was the next big thing. I've always + * admired the deep knowledge that you've gathered about the most little + * hardware details. Recently, you challanged us to find a small and + * concise algorithm that would emulate the behaviour of CIC-NUS-6105 + * challenge/response protection scheme and here is the final result. + * LaC, Oman and Jovis were definitly the dream team of N64 reversing in + * the late 90's. Without your contributions, we would be much poorer. + * + * - marshall: For keeping the N64 scene alive during the last decade, when + * most people lost interest and moved along to different projects. You + * are the force that has been keeping us all together in the later + * years. When almost nobody cared about N64 anymore, you were always + * there, spreading the word, developing in the console, and lately, + * making impressive advances on the hardware side. I wish the best + * success to your new 64drive project. + * + * - hcs: For your contributions to the better understanding of the inner + * workings of the Reality Co-Processor (RCP). Your skills have impressed + * me for a long time now. And without your precious help by sharing your + * kownledge, I would have never understood the immense importance of + * Oman, Jovis and LaC achievements. Thank you ! + * + * - Azimer & Tooie: For sharing with the N64 community your findings about the + * challenge/response pair used in 'Jet Force Gemini' and the 267 + * challenge/response pairs used in 'Banjo Tooie', all stored in the + * 'pif2.dat' file of Project 64. They were instrumental to the final + * success of this endeavour. + * + * - Silicon Graphics, Inc. (SGI): For creating MIPS R4000, MIPS R4300 and + * Reality Co-Processor (RCP). You were the ultimate dream creator during + * the late 80's and early 90's. A very special word of gratitude goes to + * the two teams that during those years created RCP and MIPS R4300. They + * were technological breakthroughs back then. + * + * On a personal note, I would like to show my deepest gratitude to _Bijou_, + * for being always a source of endless hope and inspiration. + * + * -= X-Scale =- (#n64dev@EFnet) + */ + +#ifndef N64_CIC_NUS_6105_H +#define N64_CIC_NUS_6105_H + +#define CHL_LEN 0x20 + +void n64_cic_nus_6105(char chl[], char rsp[], int len); + +#endif /* N64_CIC_NUS_6105_H */ diff --git a/libmupen64plus/mupen64plus-core/src/memory/pif.c b/libmupen64plus/mupen64plus-core/src/memory/pif.c new file mode 100644 index 0000000000..b20c4e7e87 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/memory/pif.c @@ -0,0 +1,592 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - pif.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include +#include + +#include "memory.h" +#include "pif.h" +#include "n64_cic_nus_6105.h" + +#include "r4300/r4300.h" +#include "r4300/interupt.h" + +#include "api/m64p_types.h" +#include "api/callbacks.h" +#include "api/debugger.h" +#include "main/main.h" +#include "main/rom.h" +#include "main/util.h" +#include "plugin/plugin.h" + +static unsigned char eeprom[0x800]; +static unsigned char mempack[4][0x8000]; + +static char *get_eeprom_path(void) +{ + return formatstr("%s%s.eep", get_savesrampath(), ROM_SETTINGS.goodname); +} + +static void eeprom_format(void) +{ + memset(eeprom, 0, sizeof(eeprom)); +} + +static void eeprom_read_file(void) +{ + char *filename = get_eeprom_path(); + + switch (read_from_file(filename, eeprom, sizeof(eeprom))) + { + case file_open_error: + DebugMessage(M64MSG_VERBOSE, "couldn't open eeprom file '%s' for reading", filename); + eeprom_format(); + break; + case file_read_error: + DebugMessage(M64MSG_WARNING, "fread() failed for 2kb eeprom file '%s'", filename); + break; + default: break; + } + + free(filename); +} + +static void eeprom_write_file(void) +{ + char *filename = get_eeprom_path(); + + switch (write_to_file(filename, eeprom, sizeof(eeprom))) + { + case file_open_error: + DebugMessage(M64MSG_WARNING, "couldn't open eeprom file '%s' for writing", filename); + break; + case file_write_error: + DebugMessage(M64MSG_WARNING, "fwrite() failed for 2kb eeprom file '%s'", filename); + break; + default: break; + } + + free(filename); +} + +static char *get_mempack_path(void) +{ + return formatstr("%s%s.mpk", get_savesrampath(), ROM_SETTINGS.goodname); +} + +static void mempack_format(void) +{ + unsigned char init[] = + { + 0x81,0x01,0x02,0x03, 0x04,0x05,0x06,0x07, 0x08,0x09,0x0a,0x0b, 0x0c,0x0d,0x0e,0x0f, + 0x10,0x11,0x12,0x13, 0x14,0x15,0x16,0x17, 0x18,0x19,0x1a,0x1b, 0x1c,0x1d,0x1e,0x1f, + 0xff,0xff,0xff,0xff, 0x05,0x1a,0x5f,0x13, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + 0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff, 0xff,0xff,0x01,0xff, 0x66,0x25,0x99,0xcd, + 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + 0xff,0xff,0xff,0xff, 0x05,0x1a,0x5f,0x13, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + 0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff, 0xff,0xff,0x01,0xff, 0x66,0x25,0x99,0xcd, + 0xff,0xff,0xff,0xff, 0x05,0x1a,0x5f,0x13, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + 0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff, 0xff,0xff,0x01,0xff, 0x66,0x25,0x99,0xcd, + 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + 0xff,0xff,0xff,0xff, 0x05,0x1a,0x5f,0x13, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + 0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff, 0xff,0xff,0x01,0xff, 0x66,0x25,0x99,0xcd, + 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + 0x00,0x71,0x00,0x03, 0x00,0x03,0x00,0x03, 0x00,0x03,0x00,0x03, 0x00,0x03,0x00,0x03 + }; + int i,j; + for (i=0; i<4; i++) + { + for (j=0; j<0x8000; j+=2) + { + mempack[i][j] = 0; + mempack[i][j+1] = 0x03; + } + memcpy(mempack[i], init, 272); + } +} + +static void mempack_read_file(void) +{ + char *filename = get_mempack_path(); + + switch (read_from_file(filename, mempack, sizeof(mempack))) + { + case file_open_error: + DebugMessage(M64MSG_VERBOSE, "couldn't open memory pack file '%s' for reading", filename); + mempack_format(); + break; + case file_read_error: + DebugMessage(M64MSG_WARNING, "fread() failed for 128kb mempack file '%s'", filename); + break; + default: break; + } + + free(filename); +} + +static void mempack_write_file(void) +{ + char *filename = get_mempack_path(); + + switch (write_to_file(filename, mempack, sizeof(mempack))) + { + case file_open_error: + DebugMessage(M64MSG_WARNING, "couldn't open memory pack file '%s' for writing", filename); + break; + case file_write_error: + DebugMessage(M64MSG_WARNING, "fwrite() failed for 128kb mempack file '%s'", filename); + break; + default: break; + } + + free(filename); +} + +//#define DEBUG_PIF +#ifdef DEBUG_PIF +void print_pif(void) +{ + int i; + for (i=0; i<(64/8); i++) + DebugMessage(M64MSG_INFO, "%x %x %x %x | %x %x %x %x", + PIF_RAMb[i*8+0], PIF_RAMb[i*8+1],PIF_RAMb[i*8+2], PIF_RAMb[i*8+3], + PIF_RAMb[i*8+4], PIF_RAMb[i*8+5],PIF_RAMb[i*8+6], PIF_RAMb[i*8+7]); +} +#endif + +static unsigned char byte2bcd(int n) +{ + n %= 100; + return ((n / 10) << 4) | (n % 10); +} + +static void EepromCommand(unsigned char *Command) +{ + time_t curtime_time; + struct tm *curtime; + + switch (Command[2]) + { + case 0: // check +#ifdef DEBUG_PIF + DebugMessage(M64MSG_INFO, "EepromCommand() check size"); +#endif + if (Command[1] != 3) + { + Command[1] |= 0x40; + if ((Command[1] & 3) > 0) + Command[3] = 0; + if ((Command[1] & 3) > 1) + Command[4] = (ROM_SETTINGS.savetype != EEPROM_16KB) ? 0x80 : 0xc0; + if ((Command[1] & 3) > 2) + Command[5] = 0; + } + else + { + Command[3] = 0; + Command[4] = (ROM_SETTINGS.savetype != EEPROM_16KB) ? 0x80 : 0xc0; + Command[5] = 0; + } + break; + case 4: // read + { +#ifdef DEBUG_PIF + DebugMessage(M64MSG_INFO, "EepromCommand() read 8-byte block %i", Command[3]); +#endif + eeprom_read_file(); + memcpy(&Command[4], eeprom + Command[3]*8, 8); + } + break; + case 5: // write + { +#ifdef DEBUG_PIF + DebugMessage(M64MSG_INFO, "EepromCommand() write 8-byte block %i", Command[3]); +#endif + eeprom_read_file(); + memcpy(eeprom + Command[3]*8, &Command[4], 8); + eeprom_write_file(); + } + break; + case 6: +#ifdef DEBUG_PIF + DebugMessage(M64MSG_INFO, "EepromCommand() RTC status query"); +#endif + // RTCstatus query + Command[3] = 0x00; + Command[4] = 0x10; + Command[5] = 0x00; + break; + case 7: +#ifdef DEBUG_PIF + DebugMessage(M64MSG_INFO, "EepromCommand() read RTC block %i", Command[3]); +#endif + // read RTC block + switch (Command[3]) { // block number + case 0: + Command[4] = 0x00; + Command[5] = 0x02; + Command[12] = 0x00; + break; + case 1: + DebugMessage(M64MSG_ERROR, "RTC command in EepromCommand(): read block %d", Command[2]); + break; + case 2: + time(&curtime_time); + curtime = localtime(&curtime_time); + Command[4] = byte2bcd(curtime->tm_sec); + Command[5] = byte2bcd(curtime->tm_min); + Command[6] = 0x80 + byte2bcd(curtime->tm_hour); + Command[7] = byte2bcd(curtime->tm_mday); + Command[8] = byte2bcd(curtime->tm_wday); + Command[9] = byte2bcd(curtime->tm_mon + 1); + Command[10] = byte2bcd(curtime->tm_year); + Command[11] = byte2bcd(curtime->tm_year / 100); + Command[12] = 0x00; // status + break; + } + break; + case 8: + // write RTC block + DebugMessage(M64MSG_ERROR, "RTC write in EepromCommand(): %d not yet implemented", Command[2]); + break; + default: + DebugMessage(M64MSG_ERROR, "unknown command in EepromCommand(): %x", Command[2]); + } +} + +static unsigned char mempack_crc(unsigned char *data) +{ + int i; + unsigned char CRC = 0; + for (i=0; i<=0x20; i++) + { + int mask; + for (mask = 0x80; mask >= 1; mask >>= 1) + { + int xor_tap = (CRC & 0x80) ? 0x85 : 0x00; + CRC <<= 1; + if (i != 0x20 && (data[i] & mask)) CRC |= 1; + CRC ^= xor_tap; + } + } + return CRC; +} + +static void internal_ReadController(int Control, unsigned char *Command) +{ + switch (Command[2]) + { + case 1: +#ifdef DEBUG_PIF + DebugMessage(M64MSG_INFO, "internal_ReadController() Channel %i Command 1 read buttons", Control); +#endif + if (Controls[Control].Present) + { + BUTTONS Keys; + input.getKeys(Control, &Keys); + *((unsigned int *)(Command + 3)) = Keys.Value; +#ifdef COMPARE_CORE + CoreCompareDataSync(4, Command+3); +#endif + } + break; + case 2: // read controller pack +#ifdef DEBUG_PIF + DebugMessage(M64MSG_INFO, "internal_ReadController() Channel %i Command 2 read controller pack (in Input plugin)", Control); +#endif + if (Controls[Control].Present) + { + if (Controls[Control].Plugin == PLUGIN_RAW) + if (input.readController) + input.readController(Control, Command); + } + break; + case 3: // write controller pack +#ifdef DEBUG_PIF + DebugMessage(M64MSG_INFO, "internal_ReadController() Channel %i Command 3 write controller pack (in Input plugin)", Control); +#endif + if (Controls[Control].Present) + { + if (Controls[Control].Plugin == PLUGIN_RAW) + if (input.readController) + input.readController(Control, Command); + } + break; + } +} + +static void internal_ControllerCommand(int Control, unsigned char *Command) +{ + switch (Command[2]) + { + case 0x00: // read status + case 0xFF: // reset + if ((Command[1] & 0x80)) + break; +#ifdef DEBUG_PIF + DebugMessage(M64MSG_INFO, "internal_ControllerCommand() Channel %i Command %02x check pack present", Control, Command[2]); +#endif + if (Controls[Control].Present) + { + Command[3] = 0x05; + Command[4] = 0x00; + switch (Controls[Control].Plugin) + { + case PLUGIN_MEMPAK: + Command[5] = 1; + break; + case PLUGIN_RAW: + Command[5] = 1; + break; + default: + Command[5] = 0; + break; + } + } + else + Command[1] |= 0x80; + break; + case 0x01: +#ifdef DEBUG_PIF + DebugMessage(M64MSG_INFO, "internal_ControllerCommand() Channel %i Command 1 check controller present", Control); +#endif + if (!Controls[Control].Present) + Command[1] |= 0x80; + break; + case 0x02: // read controller pack + if (Controls[Control].Present) + { + switch (Controls[Control].Plugin) + { + case PLUGIN_MEMPAK: + { + int address = (Command[3] << 8) | Command[4]; +#ifdef DEBUG_PIF + DebugMessage(M64MSG_INFO, "internal_ControllerCommand() Channel %i Command 2 read mempack address %04x", Control, address); +#endif + if (address == 0x8001) + { + memset(&Command[5], 0, 0x20); + Command[0x25] = mempack_crc(&Command[5]); + } + else + { + address &= 0xFFE0; + if (address <= 0x7FE0) + { + mempack_read_file(); + memcpy(&Command[5], &mempack[Control][address], 0x20); + } + else + { + memset(&Command[5], 0, 0x20); + } + Command[0x25] = mempack_crc(&Command[5]); + } + } + break; + case PLUGIN_RAW: +#ifdef DEBUG_PIF + DebugMessage(M64MSG_INFO, "internal_ControllerCommand() Channel %i Command 2 controllerCommand (in Input plugin)", Control); +#endif + if (input.controllerCommand) + input.controllerCommand(Control, Command); + break; + default: +#ifdef DEBUG_PIF + DebugMessage(M64MSG_INFO, "internal_ControllerCommand() Channel %i Command 2 (no pack plugged in)", Control); +#endif + memset(&Command[5], 0, 0x20); + Command[0x25] = 0; + } + } + else + Command[1] |= 0x80; + break; + case 0x03: // write controller pack + if (Controls[Control].Present) + { + switch (Controls[Control].Plugin) + { + case PLUGIN_MEMPAK: + { + int address = (Command[3] << 8) | Command[4]; +#ifdef DEBUG_PIF + DebugMessage(M64MSG_INFO, "internal_ControllerCommand() Channel %i Command 3 write mempack address %04x", Control, address); +#endif + if (address == 0x8001) + Command[0x25] = mempack_crc(&Command[5]); + else + { + address &= 0xFFE0; + if (address <= 0x7FE0) + { + mempack_read_file(); + memcpy(&mempack[Control][address], &Command[5], 0x20); + mempack_write_file(); + } + Command[0x25] = mempack_crc(&Command[5]); + } + } + break; + case PLUGIN_RAW: +#ifdef DEBUG_PIF + DebugMessage(M64MSG_INFO, "internal_ControllerCommand() Channel %i Command 3 controllerCommand (in Input plugin)", Control); +#endif + if (input.controllerCommand) + input.controllerCommand(Control, Command); + break; + default: +#ifdef DEBUG_PIF + DebugMessage(M64MSG_INFO, "internal_ControllerCommand() Channel %i Command 3 (no pack plugged in)", Control); +#endif + Command[0x25] = mempack_crc(&Command[5]); + } + } + else + Command[1] |= 0x80; + break; + } +} + +void update_pif_write(void) +{ + char challenge[30], response[30]; + int i=0, channel=0; + if (PIF_RAMb[0x3F] > 1) + { + switch (PIF_RAMb[0x3F]) + { + case 0x02: +#ifdef DEBUG_PIF + DebugMessage(M64MSG_INFO, "update_pif_write() pif_ram[0x3f] = 2 - CIC challenge"); +#endif + // format the 'challenge' message into 30 nibbles for X-Scale's CIC code + for (i = 0; i < 15; i++) + { + challenge[i*2] = (PIF_RAMb[48+i] >> 4) & 0x0f; + challenge[i*2+1] = PIF_RAMb[48+i] & 0x0f; + } + // calculate the proper response for the given challenge (X-Scale's algorithm) + n64_cic_nus_6105(challenge, response, CHL_LEN - 2); + // re-format the 'response' into a byte stream + for (i = 0; i < 15; i++) + { + PIF_RAMb[48+i] = (response[i*2] << 4) + response[i*2+1]; + } + // the last byte (2 nibbles) is always 0 + PIF_RAMb[63] = 0; + break; + case 0x08: +#ifdef DEBUG_PIF + DebugMessage(M64MSG_INFO, "update_pif_write() pif_ram[0x3f] = 8"); +#endif + PIF_RAMb[0x3F] = 0; + break; + default: + DebugMessage(M64MSG_ERROR, "error in update_pif_write(): %x", PIF_RAMb[0x3F]); + } + return; + } + while (i<0x40) + { + switch (PIF_RAMb[i]) + { + case 0x00: + channel++; + if (channel > 6) i=0x40; + break; + case 0xFF: + break; + default: + if (!(PIF_RAMb[i] & 0xC0)) + { + if (channel < 4) + { + if (Controls[channel].Present && + Controls[channel].RawData) + input.controllerCommand(channel, &PIF_RAMb[i]); + else + internal_ControllerCommand(channel, &PIF_RAMb[i]); + } + else if (channel == 4) + EepromCommand(&PIF_RAMb[i]); + else + DebugMessage(M64MSG_ERROR, "channel >= 4 in update_pif_write"); + i += PIF_RAMb[i] + (PIF_RAMb[(i+1)] & 0x3F) + 1; + channel++; + } + else + i=0x40; + } + i++; + } + //PIF_RAMb[0x3F] = 0; + input.controllerCommand(-1, NULL); +} + +void update_pif_read(void) +{ + int i=0, channel=0; + while (i<0x40) + { + switch (PIF_RAMb[i]) + { + case 0x00: + channel++; + if (channel > 6) i=0x40; + break; + case 0xFE: + i = 0x40; + break; + case 0xFF: + break; + case 0xB4: + case 0x56: + case 0xB8: + break; + default: + if (!(PIF_RAMb[i] & 0xC0)) + { + if (channel < 4) + { + if (Controls[channel].Present && + Controls[channel].RawData) + input.readController(channel, &PIF_RAMb[i]); + else + internal_ReadController(channel, &PIF_RAMb[i]); + } + i += PIF_RAMb[i] + (PIF_RAMb[(i+1)] & 0x3F) + 1; + channel++; + } + else + i=0x40; + } + i++; + } + input.readController(-1, NULL); +} + diff --git a/libmupen64plus/mupen64plus-core/src/memory/pif.h b/libmupen64plus/mupen64plus-core/src/memory/pif.h new file mode 100644 index 0000000000..8306e7652c --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/memory/pif.h @@ -0,0 +1,29 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - pif.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef PIF_H +#define PIF_H + +void update_pif_write(void); +void update_pif_read(void); + +#endif + diff --git a/libmupen64plus/mupen64plus-core/src/memory/tlb.c b/libmupen64plus/mupen64plus-core/src/memory/tlb.c new file mode 100644 index 0000000000..c5eaf82354 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/memory/tlb.c @@ -0,0 +1,135 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - tlb.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "api/m64p_types.h" + +#include "memory.h" + +#include "r4300/r4300.h" +#include "r4300/exception.h" +#include "r4300/macros.h" +#include "main/rom.h" + +unsigned int tlb_LUT_r[0x100000]; +unsigned int tlb_LUT_w[0x100000]; + +void tlb_unmap(tlb *entry) +{ + unsigned int i; + + if (entry->v_even) + { + for (i=entry->start_even; iend_even; i += 0x1000) + tlb_LUT_r[i>>12] = 0; + if (entry->d_even) + for (i=entry->start_even; iend_even; i += 0x1000) + tlb_LUT_w[i>>12] = 0; + } + + if (entry->v_odd) + { + for (i=entry->start_odd; iend_odd; i += 0x1000) + tlb_LUT_r[i>>12] = 0; + if (entry->d_odd) + for (i=entry->start_odd; iend_odd; i += 0x1000) + tlb_LUT_w[i>>12] = 0; + } +} + +void tlb_map(tlb *entry) +{ + unsigned int i; + + if (entry->v_even) + { + if (entry->start_even < entry->end_even && + !(entry->start_even >= 0x80000000 && entry->end_even < 0xC0000000) && + entry->phys_even < 0x20000000) + { + for (i=entry->start_even;iend_even;i+=0x1000) + tlb_LUT_r[i>>12] = 0x80000000 | (entry->phys_even + (i - entry->start_even) + 0xFFF); + if (entry->d_even) + for (i=entry->start_even;iend_even;i+=0x1000) + tlb_LUT_w[i>>12] = 0x80000000 | (entry->phys_even + (i - entry->start_even) + 0xFFF); + } + } + + if (entry->v_odd) + { + if (entry->start_odd < entry->end_odd && + !(entry->start_odd >= 0x80000000 && entry->end_odd < 0xC0000000) && + entry->phys_odd < 0x20000000) + { + for (i=entry->start_odd;iend_odd;i+=0x1000) + tlb_LUT_r[i>>12] = 0x80000000 | (entry->phys_odd + (i - entry->start_odd) + 0xFFF); + if (entry->d_odd) + for (i=entry->start_odd;iend_odd;i+=0x1000) + tlb_LUT_w[i>>12] = 0x80000000 | (entry->phys_odd + (i - entry->start_odd) + 0xFFF); + } + } +} + +unsigned int virtual_to_physical_address(unsigned int addresse, int w) +{ + if (addresse >= 0x7f000000 && addresse < 0x80000000 && isGoldeneyeRom) + { + /************************************************** + GoldenEye 007 hack allows for use of TLB. + Recoded by okaygo to support all US, J, and E ROMS. + **************************************************/ + switch (ROM_HEADER.Country_code & 0xFF) + { + case 0x45: + // U + return 0xb0034b30 + (addresse & 0xFFFFFF); + break; + case 0x4A: + // J + return 0xb0034b70 + (addresse & 0xFFFFFF); + break; + case 0x50: + // E + return 0xb00329f0 + (addresse & 0xFFFFFF); + break; + default: + // UNKNOWN COUNTRY CODE FOR GOLDENEYE USING AMERICAN VERSION HACK + return 0xb0034b30 + (addresse & 0xFFFFFF); + break; + } + } + if (w == 1) + { + if (tlb_LUT_w[addresse>>12]) + return (tlb_LUT_w[addresse>>12]&0xFFFFF000)|(addresse&0xFFF); + } + else + { + if (tlb_LUT_r[addresse>>12]) + return (tlb_LUT_r[addresse>>12]&0xFFFFF000)|(addresse&0xFFF); + } + //printf("tlb exception !!! @ %x, %x, add:%x\n", addresse, w, PC->addr); + //getchar(); + TLB_refill_exception(addresse,w); + //return 0x80000000; + return 0x00000000; +} diff --git a/libmupen64plus/mupen64plus-core/src/memory/tlb.h b/libmupen64plus/mupen64plus-core/src/memory/tlb.h new file mode 100644 index 0000000000..23fc816410 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/memory/tlb.h @@ -0,0 +1,57 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - tlb.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef TLB_H +#define TLB_H + +typedef struct _tlb +{ + short mask; + int vpn2; + char g; + unsigned char asid; + int pfn_even; + char c_even; + char d_even; + char v_even; + int pfn_odd; + char c_odd; + char d_odd; + char v_odd; + char r; + //int check_parity_mask; + + unsigned int start_even; + unsigned int end_even; + unsigned int phys_even; + unsigned int start_odd; + unsigned int end_odd; + unsigned int phys_odd; +} tlb; + +extern unsigned int tlb_LUT_r[0x100000]; +extern unsigned int tlb_LUT_w[0x100000]; +void tlb_unmap(tlb *entry); +void tlb_map(tlb *entry); +unsigned int virtual_to_physical_address(unsigned int addresse, int w); + +#endif + diff --git a/libmupen64plus/mupen64plus-core/src/osal/dynamiclib.h b/libmupen64plus/mupen64plus-core/src/osal/dynamiclib.h new file mode 100644 index 0000000000..e767b86ac1 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/osal/dynamiclib.h @@ -0,0 +1,30 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - osal/dynamiclib.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#if !defined(OSAL_DYNAMICLIB_H) +#define OSAL_DYNAMICLIB_H + +#include "api/m64p_types.h" + +void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName); + +#endif /* #define OSAL_DYNAMICLIB_H */ + diff --git a/libmupen64plus/mupen64plus-core/src/osal/dynamiclib_unix.c b/libmupen64plus/mupen64plus-core/src/osal/dynamiclib_unix.c new file mode 100644 index 0000000000..05d363d8db --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/osal/dynamiclib_unix.c @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - osal/dynamiclib_unix.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include + +#include "api/m64p_types.h" +#include "api/callbacks.h" +#include "dynamiclib.h" + +void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName) +{ + if (pccProcedureName == NULL) + return NULL; + + return dlsym(LibHandle, pccProcedureName); +} diff --git a/libmupen64plus/mupen64plus-core/src/osal/dynamiclib_win32.c b/libmupen64plus/mupen64plus-core/src/osal/dynamiclib_win32.c new file mode 100644 index 0000000000..3d28373ba8 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/osal/dynamiclib_win32.c @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-ui-console - osal_dynamiclib_win32.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include + +#include "api/m64p_types.h" +#include "dynamiclib.h" + +void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName) +{ + if (pccProcedureName == NULL) + return NULL; + + return GetProcAddress(LibHandle, pccProcedureName); +} diff --git a/libmupen64plus/mupen64plus-core/src/osal/files.h b/libmupen64plus/mupen64plus-core/src/osal/files.h new file mode 100644 index 0000000000..9d6db42c60 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/osal/files.h @@ -0,0 +1,60 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - osal/files.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This file contains the declarations for OS-dependent file handling + * functions + */ + +#if !defined (OSAL_FILES_H) +#define OSAL_FILES_H + +/* some file-related preprocessor definitions */ +#if defined(WIN32) && !defined(__MINGW32__) + #include // For _unlink() + #define unlink _unlink + + #define OSAL_DIR_SEPARATORS "\\/" + #define PATH_MAX _MAX_PATH +#else /* Not WIN32 */ + #include // for PATH_MAX + #include // for unlink() + + #define OSAL_DIR_SEPARATORS "/" + + /* PATH_MAX only may be defined by limits.h */ + #ifndef PATH_MAX + #define PATH_MAX 4096 + #endif +#endif + +/* Create a directory path recursively. + * Returns zero on success, nonzero on failure. + * Note that, unlike mkdir(), this function succeeds if the path already exists. + */ +extern int osal_mkdirp(const char *dirpath, int mode); + +extern const char * osal_get_shared_filepath(const char *filename, const char *firstsearch, const char *secondsearch); +extern const char * osal_get_user_configpath(void); +extern const char * osal_get_user_datapath(void); +extern const char * osal_get_user_cachepath(void); + +#endif /* OSAL_FILES_H */ + diff --git a/libmupen64plus/mupen64plus-core/src/osal/files_unix.c b/libmupen64plus/mupen64plus-core/src/osal/files_unix.c new file mode 100644 index 0000000000..81a661c6cf --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/osal/files_unix.c @@ -0,0 +1,275 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - osal/files_unix.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This file contains the definitions for the unix-specific file handling + * functions + */ + +#include +#include +#include +#include +#include +#include + +#include "files.h" +#include "api/m64p_types.h" +#include "api/callbacks.h" + +#ifdef __APPLE__ +/* OS X code for app bundle handling */ +#include + +// dynamic data path detection onmac +bool macSetBundlePath(char* buffer) +{ + // the following code will enable mupen to find its data when placed in an app bundle on mac OS X. + // returns true if path is set, returns false if path was not set + char path[1024]; + CFBundleRef main_bundle = CFBundleGetMainBundle(); assert(main_bundle); + CFURLRef main_bundle_URL = CFBundleCopyBundleURL(main_bundle); assert(main_bundle_URL); + CFStringRef cf_string_ref = CFURLCopyFileSystemPath( main_bundle_URL, kCFURLPOSIXPathStyle); assert(cf_string_ref); + CFStringGetCString(cf_string_ref, path, 1024, kCFStringEncodingASCII); + CFRelease(main_bundle_URL); + CFRelease(cf_string_ref); + + if (strstr( path, ".app" ) != 0) + { + DebugMessage(M64MSG_VERBOSE, "checking whether we are using an app bundle: yes"); + // executable is inside an app bundle, use app bundle-relative paths + sprintf(buffer, "%s/Contents/Resources/", path); + return true; + } + else + { + DebugMessage(M64MSG_VERBOSE, "checking whether we are using an app bundle: no"); + return false; + } +} +#endif + +/* definitions for system directories to search when looking for shared data files */ +#if defined(SHAREDIR) + #define XSTR(S) STR(S) /* this wacky preprocessor thing is necessary to generate a quote-enclosed */ + #define STR(S) #S /* copy of the SHAREDIR macro, which is defined by the makefile via gcc -DSHAREDIR="..." */ + static const int datasearchdirs = 4; + static const char *datasearchpath[4] = { XSTR(SHAREDIR), "/usr/local/share/mupen64plus", "/usr/share/mupen64plus", "./" }; + #undef STR + #undef XSTR +#else + static const int datasearchdirs = 3; + static const char *datasearchpath[3] = { "/usr/local/share/mupen64plus", "/usr/share/mupen64plus", "./" }; +#endif + +/* local functions */ + +static int get_xdg_dir(char *destpath, const char *envvar, const char *subdir) +{ + struct stat fileinfo; + const char *envpath = getenv(envvar); + + /* error if this environment variable doesn't return a good string */ + if (envpath == NULL || strlen(envpath) < 1) + return 1; + + /* error if path returned by the environemnt variable isn't a valid path to a directory */ + if (stat(envpath, &fileinfo) != 0 || !S_ISDIR(fileinfo.st_mode)) + return 2; + + /* append the given sub-directory to the path given by the environment variable */ + strcpy(destpath, envpath); + if (destpath[strlen(destpath)-1] != '/') + strcat(destpath, "/"); + strcat(destpath, subdir); + + /* try to create the resulting directory tree, or return successfully if it already exists */ + if (osal_mkdirp(destpath, 0700) != 0) + { + DebugMessage(M64MSG_ERROR, "Couldn't create directory: %s", destpath); + return 3; + } + + /* Success */ + return 0; +} + +static int search_dir_file(char *destpath, const char *path, const char *filename) +{ + struct stat fileinfo; + + /* sanity check to start */ + if (destpath == NULL || path == NULL || filename == NULL) + return 1; + + /* build the full filepath */ + strcpy(destpath, path); + if (destpath[strlen(destpath)-1] != '/') + strcat(destpath, "/"); + strcat(destpath, filename); + + /* test for a valid file */ + if (stat(destpath, &fileinfo) != 0) + return 2; + if (!S_ISREG(fileinfo.st_mode)) + return 3; + + /* success - file exists and is a regular file */ + return 0; +} + +/* global functions */ + +int osal_mkdirp(const char *dirpath, int mode) +{ + char *mypath, *currpath; + struct stat fileinfo; + + // Terminate quickly if the path already exists + if (stat(dirpath, &fileinfo) == 0 && S_ISDIR(fileinfo.st_mode)) + return 0; + + // Create partial paths + mypath = currpath = strdup(dirpath); + if (mypath == NULL) + return 1; + + while ((currpath = strpbrk(currpath + 1, OSAL_DIR_SEPARATORS)) != NULL) + { + *currpath = '\0'; + if (stat(mypath, &fileinfo) != 0) + { + if (mkdir(mypath, mode) != 0) + break; + } + else + { + if (!S_ISDIR(fileinfo.st_mode)) + break; + } + *currpath = OSAL_DIR_SEPARATORS[0]; + } + free(mypath); + if (currpath != NULL) + return 1; + + // Create full path + if (stat(dirpath, &fileinfo) != 0 && mkdir(dirpath, mode) != 0) + return 1; + + return 0; +} + +const char * osal_get_shared_filepath(const char *filename, const char *firstsearch, const char *secondsearch) +{ + static char retpath[PATH_MAX]; + int i; + + /* if caller gave us any directories to search, then look there first */ + if (firstsearch != NULL && search_dir_file(retpath, firstsearch, filename) == 0) + return retpath; + if (secondsearch != NULL && search_dir_file(retpath, secondsearch, filename) == 0) + return retpath; + +#ifdef __APPLE__ + /* Special case : OS X bundles */ + static char buf[1024]; + if (macSetBundlePath(buf)) + { + sprintf(retpath, "%s%s", buf, filename); + return retpath; + } +#endif + + /* otherwise check our standard paths */ + for (i = 0; i < datasearchdirs; i++) + { + if (search_dir_file(retpath, datasearchpath[i], filename) == 0) + return retpath; + } + + /* we couldn't find the file */ + return NULL; +} + +const char * osal_get_user_configpath(void) +{ + static char retpath[PATH_MAX]; + int rval; + + /* first, try the XDG_CONFIG_HOME environment variable */ + rval = get_xdg_dir(retpath, "XDG_CONFIG_HOME", "mupen64plus/"); + if (rval == 0) + return retpath; + + /* then try the HOME environment variable */ + rval = get_xdg_dir(retpath, "HOME", ".config/mupen64plus/"); + if (rval == 0) + return retpath; + + /* otherwise we are in trouble */ + if (rval < 3) + DebugMessage(M64MSG_ERROR, "Failed to get configuration directory; $HOME is undefined or invalid."); + return NULL; +} + +const char * osal_get_user_datapath(void) +{ + static char retpath[PATH_MAX]; + int rval; + + /* first, try the XDG_DATA_HOME environment variable */ + rval = get_xdg_dir(retpath, "XDG_DATA_HOME", "mupen64plus/"); + if (rval == 0) + return retpath; + + /* then try the HOME environment variable */ + rval = get_xdg_dir(retpath, "HOME", ".local/share/mupen64plus/"); + if (rval == 0) + return retpath; + + /* otherwise we are in trouble */ + if (rval < 3) + DebugMessage(M64MSG_ERROR, "Failed to get data directory; $HOME is undefined or invalid."); + return NULL; +} + +const char * osal_get_user_cachepath(void) +{ + static char retpath[PATH_MAX]; + int rval; + + /* first, try the XDG_CACHE_HOME environment variable */ + rval = get_xdg_dir(retpath, "XDG_CACHE_HOME", "mupen64plus/"); + if (rval == 0) + return retpath; + + /* then try the HOME environment variable */ + rval = get_xdg_dir(retpath, "HOME", ".cache/mupen64plus/"); + if (rval == 0) + return retpath; + + /* otherwise we are in trouble */ + if (rval < 3) + DebugMessage(M64MSG_ERROR, "Failed to get cache directory; $HOME is undefined or invalid."); + return NULL; +} + + diff --git a/libmupen64plus/mupen64plus-core/src/osal/files_win32.c b/libmupen64plus/mupen64plus-core/src/osal/files_win32.c new file mode 100644 index 0000000000..4993f03db4 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/osal/files_win32.c @@ -0,0 +1,196 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - osal/files_win32.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This file contains the definitions for the unix-specific file handling + * functions + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "files.h" +#include "api/m64p_types.h" +#include "api/callbacks.h" + +/* definitions for system directories to search when looking for shared data files */ +#if defined(SHAREDIR) + #define XSTR(S) STR(S) /* this wacky preprocessor thing is necessary to generate a quote-enclosed */ + #define STR(S) #S /* copy of the SHAREDIR macro, which is defined by the makefile via gcc -DSHAREDIR="..." */ + static const int datasearchdirs = 2; + static const char *datasearchpath[2] = { XSTR(SHAREDIR), ".\\" }; + #undef STR + #undef XSTR +#else + static const int datasearchdirs = 1; + static const char *datasearchpath[1] = { ".\\" }; +#endif + +/* local functions */ +static int search_dir_file(char *destpath, const char *path, const char *filename) +{ + struct _stat fileinfo; + + /* sanity check to start */ + if (destpath == NULL || path == NULL || filename == NULL) + return 1; + + /* build the full filepath */ + strcpy(destpath, path); + if (destpath[strlen(destpath)-1] != '\\') + strcat(destpath, "\\"); + strcat(destpath, filename); + + /* test for a valid file */ + if (_stat(destpath, &fileinfo) != 0) + return 2; + if ((fileinfo.st_mode & _S_IFREG) == 0) + return 3; + + /* success - file exists and is a regular file */ + return 0; +} + +/* global functions */ + +int osal_mkdirp(const char *dirpath, int mode) +{ + char *mypath, *currpath; + struct _stat fileinfo; + + // Terminate quickly if the path already exists + if (_stat(dirpath, &fileinfo) == 0 && (fileinfo.st_mode & _S_IFDIR)) + return 0; + + // Create partial paths + mypath = currpath = strdup(dirpath); + if (mypath == NULL) + return 1; + + while ((currpath = strpbrk(currpath + 1, OSAL_DIR_SEPARATORS)) != NULL) + { + *currpath = '\0'; + if (_stat(mypath, &fileinfo) != 0) + { + if (_mkdir(mypath) != 0) + break; + } + else + { + if (!(fileinfo.st_mode & _S_IFDIR)) + break; + } + *currpath = OSAL_DIR_SEPARATORS[0]; + } + free(mypath); + if (currpath != NULL) + return 1; + + // Create full path + if (_stat(dirpath, &fileinfo) != 0 && _mkdir(dirpath) != 0) + return 1; + + return 0; +} + +const char * osal_get_shared_filepath(const char *filename, const char *firstsearch, const char *secondsearch) +{ + static char retpath[_MAX_PATH]; + int i; + + /* if caller gave us any directories to search, then look there first */ + if (firstsearch != NULL && search_dir_file(retpath, firstsearch, filename) == 0) + return retpath; + if (secondsearch != NULL && search_dir_file(retpath, secondsearch, filename) == 0) + return retpath; + + /* otherwise check our standard paths */ + if (search_dir_file(retpath, osal_get_user_configpath(), filename) == 0) + return retpath; + for (i = 0; i < datasearchdirs; i++) + { + if (search_dir_file(retpath, datasearchpath[i], filename) == 0) + return retpath; + } + + /* we couldn't find the file */ + return NULL; +} + +const char * osal_get_user_configpath(void) +{ + static char chHomePath[MAX_PATH]; + LPITEMIDLIST pidl; + LPMALLOC pMalloc; + struct _stat fileinfo; + + // Get item ID list for the path of user's personal directory + HRESULT hr = SHGetSpecialFolderLocation(NULL, CSIDL_APPDATA, &pidl); + // get the path in a char string + SHGetPathFromIDList(pidl, chHomePath); + // do a bunch of crap just to free some memory + hr = SHGetMalloc(&pMalloc); + pMalloc->lpVtbl->Free(pMalloc, pidl); + pMalloc->lpVtbl->Release(pMalloc); + + // tack on 'mupen64plus' + if (chHomePath[strlen(chHomePath)-1] != '\\') + strcat(chHomePath, "\\"); + strcat(chHomePath, "Mupen64Plus"); + + // if this directory doesn't exist, then make it + if (_stat(chHomePath, &fileinfo) == 0) + { + strcat(chHomePath, "\\"); + return chHomePath; + } + else + { + osal_mkdirp(chHomePath, 0); + if (_stat(chHomePath, &fileinfo) == 0) + { + strcat(chHomePath, "\\"); + return chHomePath; + } + } + + /* otherwise we are in trouble */ + DebugMessage(M64MSG_ERROR, "Failed to open configuration directory '%s'.", chHomePath); + return NULL; +} + +const char * osal_get_user_datapath(void) +{ + // in windows, these are all the same + return osal_get_user_configpath(); +} + +const char * osal_get_user_cachepath(void) +{ + // in windows, these are all the same + return osal_get_user_configpath(); +} + + diff --git a/libmupen64plus/mupen64plus-core/src/osal/preproc.h b/libmupen64plus/mupen64plus-core/src/osal/preproc.h new file mode 100644 index 0000000000..bf00df7ff4 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/osal/preproc.h @@ -0,0 +1,55 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - osal/preproc.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* this header file is for system-dependent #defines, #includes, and typedefs */ + +#if !defined (OSAL_PREPROC_H) +#define OSAL_PREPROC_H + +#if defined(WIN32) && !defined(__MINGW32__) + + // macros + #define OSAL_BREAKPOINT_INTERRUPT __asm{ int 3 }; + #define ALIGN(BYTES,DATA) __declspec(align(BYTES)) DATA; + + // string functions + #define osal_insensitive_strcmp(x, y) _stricmp(x, y) + #define snprintf _snprintf + #define strdup _strdup + + // for isnan() + #include + #define isnan _isnan + +#else /* Not WIN32 */ + + // macros + #define OSAL_BREAKPOINT_INTERRUPT asm(" int $3; "); + #define ALIGN(BYTES,DATA) DATA __attribute__((aligned(BYTES))); + + // string functions + #define osal_insensitive_strcmp(x, y) strcasecmp(x, y) + +#endif + + +#endif /* OSAL_PREPROC_H */ + diff --git a/libmupen64plus/mupen64plus-core/src/osd/OGLFT.cpp b/libmupen64plus/mupen64plus-core/src/osd/OGLFT.cpp new file mode 100644 index 0000000000..2342772841 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/osd/OGLFT.cpp @@ -0,0 +1,1291 @@ +/* + * OGLFT: A library for drawing text with OpenGL using the FreeType library + * Copyright (C) 2002 lignum Computing, Inc. + * $Id: OGLFT.cpp,v 1.11 2003/10/01 14:21:18 allen Exp $ + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include +#include +#include +#include "OGLFT.h" + +int wstrlen(const wchar_t * s) +{ + int r = 0; + while (*s++) r++; + return r; +} + +namespace OGLFT +{ + FT_Library ft_library; + bool Init_FT(void) + { + FT_Error error = FT_Init_FreeType(&ft_library); + if(error != 0) std::cerr << "[OGLFT] Could not initialize the FreeType library." << std::endl; + return (error == 0); + } + bool Uninit_FT(void) + { + FT_Error error = FT_Done_FreeType(ft_library); + if(error != 0) std::cerr << "[OGLFT] Could not terminate the FreeType library." << std::endl; + return (error == 0); + } + + // Load a new face + Face::Face (const char* filename, float point_size, FT_UInt resolution) + : point_size_(point_size), resolution_(resolution) + { + valid_ = true; + FT_Face ft_face; + FT_Error error = FT_New_Face(ft_library, filename, 0, &ft_face); + if(error != 0) + { + valid_ = false; + return; + } + + // As of FreeType 2.1: only a UNICODE charmap is automatically activated. + // If no charmap is activated automatically, just use the first one. + if(ft_face->charmap == 0 && ft_face->num_charmaps > 0) FT_Select_Charmap(ft_face, ft_face->charmaps[0]->encoding); + + faces_.push_back(FaceData(ft_face)); + + init(); + } + + // Go with a face that the user has already opened. + Face::Face (FT_Face face, float point_size, FT_UInt resolution) + : point_size_(point_size), resolution_(resolution) + { + valid_ = true; + + // As of FreeType 2.1: only a UNICODE charmap is automatically activated. + // If no charmap is activated automatically, just use the first one. + if(face->charmap == 0 && face->num_charmaps > 0) FT_Select_Charmap(face, face->charmaps[0]->encoding); + + faces_.push_back(FaceData(face, false)); + + init(); + } + + // Standard initialization behavior once the font file is opened. + void Face::init (void) + { + // By default, each glyph is compiled into a display list the first + // time it is encountered + compile_mode_ = COMPILE; + + // By default, all drawing is wrapped with push/pop matrix so that the + // MODELVIEW matrix is not modified. If advance_ is set, then subsequent + // drawings follow from the advance of the last glyph rendered. + advance_ = false; + + // Initialize the default colors + foreground_color_[R] = 0.; foreground_color_[G] = 0.; foreground_color_[B] = 0.; foreground_color_[A] = 1.; + background_color_[R] = 1.; background_color_[G] = 1.; background_color_[B] = 1.; background_color_[A] = 0.; + + // The default positioning of the text is at the origin of the first glyph + horizontal_justification_ = ORIGIN; + vertical_justification_ = BASELINE; + + // By default, strings are rendered in their nominal direction + string_rotation_ = 0; + + // setCharacterRotationReference calls the virtual function clearCaches() + // so it is up to a subclass to set the real default + rotation_reference_glyph_ = 0; + rotation_reference_face_ = 0; + rotation_offset_y_ = 0.; + } + + Face::~Face (void) + { + for(unsigned int i=0; iglyph, &glyph); + if(error != 0) continue; + + FT_BBox ft_bbox; + FT_Glyph_Get_CBox(glyph, ft_glyph_bbox_unscaled, &ft_bbox); + + FT_Done_Glyph(glyph); + + char_bbox = ft_bbox; + char_bbox.advance_ = faces_[f].face_->glyph->advance; + + bbox += char_bbox; + } + + return bbox; + } + + BBox Face::measure (const wchar_t* s) + { + BBox bbox; + int i; + + if(wstrlen(s) > 0) + { + bbox = measure(s[0]); + for(i = 1; i < wstrlen(s); i++) + { + BBox char_bbox = measure(s[i]); + bbox += char_bbox; + } + } + // make sure the origin is at 0,0 + if (bbox.x_min_ != 0) + { + bbox.x_max_ -= bbox.x_min_; + bbox.x_min_ = 0; + } + if (bbox.y_min_ != 0) + { + bbox.y_max_ -= bbox.y_min_; + bbox.y_min_ = 0; + } + return bbox; + } + + BBox Face::measure (const wchar_t* format, double number) + { + return measure(format, number); + } + + BBox Face::measureRaw (const wchar_t* s) + { + BBox bbox; + int i; + + for(i = 0; i < wstrlen(s); i++) + { + BBox char_bbox; + + unsigned int f; + FT_UInt glyph_index = 0; + + for(f=0; fglyph, &glyph); + if(error != 0) continue; + + FT_BBox ft_bbox; + FT_Glyph_Get_CBox(glyph, ft_glyph_bbox_unscaled, &ft_bbox); + + FT_Done_Glyph(glyph); + + char_bbox = ft_bbox; + char_bbox.advance_ = faces_[f].face_->glyph->advance; + + bbox += char_bbox; + } + + return bbox; + } + + // Measure the bounding box as if the (latin1) string were not rotated + BBox Face::measure_nominal (const char* s) + { + if(string_rotation_ == 0.) return measure(s); + + for(unsigned int f=0; fsecond; + + unsigned int f; + FT_UInt glyph_index = 0; + + for(f=0; fsecond; + + unsigned int f; + FT_UInt glyph_index = 0; + + for(f=0; fsecond); + return; + } + + unsigned int f; + FT_UInt glyph_index = 0; + + for(f=0; fsecond); + return; + } + + unsigned int f; + FT_UInt glyph_index = 0; + + for(f=0; fheight > 0) return faces_[0].face_->height / 64.; + else return faces_[0].face_->size->metrics.y_ppem; + } + + BBox Raster::measure (unsigned char c) + { + BBox bbox; + + // For starters, just get the unscaled glyph bounding box + unsigned int f; + FT_UInt glyph_index = 0; + + for(f=0; fglyph, &glyph); + if(error != 0) return bbox; + + FT_BBox ft_bbox; + FT_Glyph_Get_CBox(glyph, ft_glyph_bbox_unscaled, &ft_bbox); + + FT_Done_Glyph(glyph); + + bbox = ft_bbox; + bbox.advance_ = faces_[f].face_->glyph->advance; + + // In order to be accurate regarding the placement of text not + // aligned at the glyph's origin (CENTER/MIDDLE), the bounding box + // of the raster format has to be projected back into the + // view's coordinates + GLint viewport[4]; + GLdouble modelview[16], projection[16]; + + glGetIntegerv(GL_VIEWPORT, viewport); + glGetDoublev(GL_MODELVIEW_MATRIX, modelview); + glGetDoublev(GL_PROJECTION_MATRIX, projection); + + // Well, first we have to get the Origin, since that is the basis + // of the bounding box + GLdouble x0, y0, z0; + gluUnProject(0., 0., 0., modelview, projection, viewport, &x0, &y0, &z0); + + GLdouble x, y, z; + gluUnProject(bbox.x_min_, bbox.y_min_, 0., modelview, projection, viewport, &x, &y, &z); + bbox.x_min_ = (float) (x - x0); + bbox.y_min_ = (float) (y - y0); + + gluUnProject(bbox.x_max_, bbox.y_max_, 0., modelview, projection, viewport, &x, &y, &z); + bbox.x_max_ = (float) (x - x0); + bbox.y_max_ = (float) (y - y0); + + gluUnProject(bbox.advance_.dx_, bbox.advance_.dy_, 0., modelview, projection, viewport, &x, &y, &z); + bbox.advance_.dx_ = (float) (x - x0); + bbox.advance_.dy_ = (float) (y - y0); + + return bbox; + } + + BBox Raster::measure (wchar_t c) + { + BBox bbox; + + // For starters, just get the unscaled glyph bounding box + unsigned int f; + FT_UInt glyph_index = 0; + + for(f=0; fglyph, &glyph); + if(error != 0) return bbox; + + FT_BBox ft_bbox; + FT_Glyph_Get_CBox(glyph, ft_glyph_bbox_unscaled, &ft_bbox); + + FT_Done_Glyph(glyph); + + bbox = ft_bbox; + bbox.advance_ = faces_[f].face_->glyph->advance; + + // In order to be accurate regarding the placement of text not + // aligned at the glyph's origin (CENTER/MIDDLE), the bounding box + // of the raster format has to be projected back into the + // view's coordinates + GLint viewport[4]; + GLdouble modelview[16], projection[16]; + + glGetIntegerv(GL_VIEWPORT, viewport); + glGetDoublev(GL_MODELVIEW_MATRIX, modelview); + glGetDoublev(GL_PROJECTION_MATRIX, projection); + + // Well, first we have to get the Origin, since that is the basis + // of the bounding box + GLdouble x0, y0, z0; + gluUnProject(0., 0., 0., modelview, projection, viewport, &x0, &y0, &z0); + + GLdouble x, y, z; + gluUnProject(bbox.x_min_, bbox.y_min_, 0., modelview, projection, viewport, &x, &y, &z); + bbox.x_min_ = (float) (x - x0); + bbox.y_min_ = (float) (y - y0); + + gluUnProject(bbox.x_max_, bbox.y_max_, 0., modelview, projection, viewport, &x, &y, &z); + bbox.x_max_ = (float) (x - x0); + bbox.y_max_ = (float) (y - y0); + + gluUnProject(bbox.advance_.dx_, bbox.advance_.dy_, 0., modelview, projection, viewport, &x, &y, &z); + bbox.advance_.dx_ = (float) (x - x0); + bbox.advance_.dy_ = (float) (y - y0); + + return bbox; + } + + GLuint Raster::compileGlyph (FT_Face face, FT_UInt glyph_index) + { + GLuint dlist = glGenLists(1); + glNewList(dlist, GL_COMPILE); + + renderGlyph(face, glyph_index); + + glEndList(); + + return dlist; + } + + void Raster::setCharSize (void) + { + FT_Error error; + for(unsigned int i=0; iglyph->bitmap.rows / 2.0f; + } + + void Raster::clearCaches (void) + { + GDLI fgi = glyph_dlists_.begin(); + + for(; fgi != glyph_dlists_.end(); ++fgi) + { + glDeleteLists(fgi->second, 1); + } + + glyph_dlists_.clear(); + } + + Monochrome::Monochrome (const char* filename, float point_size, FT_UInt resolution) + : Raster(filename, point_size, resolution) + { + return; + } + + Monochrome::Monochrome (FT_Face face, float point_size, FT_UInt resolution) + : Raster(face, point_size, resolution) + { + return; + } + + Monochrome::~Monochrome (void) + { + return; + } + + GLubyte* Monochrome::invertBitmap (const FT_Bitmap& bitmap) + { + // In FreeType 2.0.9, the pitch of bitmaps was rounded up to an + // even number. In general, this disagrees with what we had been + // using for OpenGL. + int width = bitmap.width / 8 + ((bitmap.width & 7)> 0 ? 1 : 0); + + GLubyte* inverse = new GLubyte[ bitmap.rows * width ]; + GLubyte* inverse_ptr = inverse; + + for(int r=0; rglyph, &original_glyph); + + if(error != 0) return; + + error = FT_Glyph_Copy(original_glyph, &glyph); + + FT_Done_Glyph(original_glyph); + + if(error != 0) return; + + // If the individual characters are rotated (as distinct from string + // rotation), then apply that extra rotation here. This is equivalent + // to the sequence + // glTranslate(x_center,y_center); + // glRotate(angle); + // glTranslate(-x_center,-y_center); + // which is used for the polygonal styles. The deal with the raster + // styles is that you must retain the advance from the string rotation + // so that the glyphs are laid out properly. So, we make a copy of + // the string rotated glyph, and then rotate that and add back an + // additional offset to (in effect) restore the proper origin and + // advance of the glyph. + + if(character_rotation_z_ != 0.) + { + FT_Matrix rotation_matrix; + FT_Vector sinus; + + FT_Vector_Unit(&sinus, (FT_Angle)(character_rotation_z_ * 0x10000L)); + + rotation_matrix.xx = sinus.x; + rotation_matrix.xy = -sinus.y; + rotation_matrix.yx = sinus.y; + rotation_matrix.yy = sinus.x; + + FT_Vector original_offset, rotation_offset; + + original_offset.x = (face->glyph->metrics.width / 2 + face->glyph->metrics.horiBearingX)/ 64 * 0x10000L; + original_offset.y = (FT_Pos)(rotation_offset_y_ * 0x10000L); + + rotation_offset = original_offset; + + FT_Vector_Rotate(&rotation_offset, (FT_Angle)(character_rotation_z_ * 0x10000L)); + + rotation_offset.x = original_offset.x - rotation_offset.x; + rotation_offset.y = original_offset.y - rotation_offset.y; + + rotation_offset.x /= 1024; + rotation_offset.y /= 1024; + + error = FT_Glyph_Transform(glyph, &rotation_matrix, &rotation_offset); + } + + error = FT_Glyph_To_Bitmap(&glyph, FT_RENDER_MODE_MONO, 0, 1); + + if(error != 0) + { + FT_Done_Glyph(glyph); + return; + } + + FT_BitmapGlyph bitmap_glyph = (FT_BitmapGlyph) glyph; + + // Evidently, in FreeType2, you can only get "upside-down" bitmaps and + // OpenGL won't invert a bitmap with PixelZoom, so we have to invert the + // glyph's bitmap ourselves. + + GLubyte* inverted_bitmap = invertBitmap(bitmap_glyph->bitmap); + + glBitmap(bitmap_glyph->bitmap.width, bitmap_glyph->bitmap.rows, + (GLfloat) -bitmap_glyph->left, + (GLfloat) (bitmap_glyph->bitmap.rows - bitmap_glyph->top), + face->glyph->advance.x / 64.0f, + face->glyph->advance.y / 64.0f, + inverted_bitmap); + + FT_Done_Glyph(glyph); + + delete[] inverted_bitmap; + } + +} // close OGLFT namespace + diff --git a/libmupen64plus/mupen64plus-core/src/osd/OGLFT.h b/libmupen64plus/mupen64plus-core/src/osd/OGLFT.h new file mode 100644 index 0000000000..5b61f43b69 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/osd/OGLFT.h @@ -0,0 +1,318 @@ +// -*- c++ -*- +/* + * OGLFT: A library for drawing text with OpenGL using the FreeType library + * Copyright (C) 2002 lignum Computing, Inc. + * $Id: OGLFT.h,v 1.15 2003/10/01 14:41:09 allen Exp $ + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef OGLFT_H +#define OGLFT_H + +#include +#include +#include +#include +#include + +#define GL_GLEXT_PROTOTYPES +#include +#if defined(__MACOSX__) +#include +#elif defined(__MACOS__) +#include +#else +#include +#endif + +#include +#include FT_FREETYPE_H +#include FT_GLYPH_H +#include FT_OUTLINE_H +#include FT_TRIGONOMETRY_H + +namespace OGLFT +{ + enum Coordinates + { + X, Y, Z, W + }; + + enum ColorSpace + { + R, G, B, A + }; + + // global library functions + bool Init_FT(void); + bool Uninit_FT(void); + + struct Advance + { + float dx_; + float dy_; + + Advance ( float dx = 0, float dy = 0 ) : dx_( dx ), dy_( dy ) + { + return; + } + + Advance ( FT_Vector v ) + { + dx_ = (float) (v.x / 64.); + dy_ = (float) (v.y / 64.); + } + + Advance& operator+= ( const FT_Vector v ) + { + dx_ += (float) (v.x / 64.); + dy_ += (float) (v.y / 64.); + return *this; + } + }; + + struct BBox + { + float x_min_; + float y_min_; + float x_max_; + float y_max_; + Advance advance_; + + BBox () : x_min_( 0 ), y_min_( 0 ), x_max_( 0 ), y_max_( 0 ) + { + return; + } + BBox ( FT_BBox ft_bbox ) + { + x_min_ = (float) (ft_bbox.xMin / 64.); + y_min_ = (float) (ft_bbox.yMin / 64.); + x_max_ = (float) (ft_bbox.xMax / 64.); + y_max_ = (float) (ft_bbox.yMax / 64.); + } + BBox& operator*= ( double k ) + { + x_min_ *= (float) k; + y_min_ *= (float) k; + x_max_ *= (float) k; + y_max_ *= (float) k; + advance_.dx_ *= (float) k; + advance_.dy_ *= (float) k; + + return *this; + } + BBox& operator+= ( const BBox& b ) + { + float new_value; + + new_value = b.x_min_ + advance_.dx_; + if ( new_value < x_min_ ) x_min_ = new_value; + new_value = b.y_min_ + advance_.dy_; + if ( new_value < y_min_ ) y_min_ = new_value; + new_value = b.x_max_ + advance_.dx_; + if ( new_value > x_max_ ) x_max_ = new_value; + new_value = b.y_max_ + advance_.dy_; + if ( new_value > y_max_ ) y_max_ = new_value; + + advance_.dx_ += b.advance_.dx_; + advance_.dy_ += b.advance_.dy_; + + return *this; + } + }; + typedef std::vector DisplayLists; + typedef DisplayLists::const_iterator DLCI; + typedef DisplayLists::iterator DLI; + class Face + { + public: + enum HorizontalJustification + { + LEFT, + ORIGIN, + CENTER, + RIGHT + }; + + enum VerticalJustification + { + BOTTOM, + BASELINE, + MIDDLE, + TOP + }; + + enum GlyphCompileMode + { + COMPILE, + IMMEDIATE + }; + + private: + struct FaceData + { + FT_Face face_; + bool free_on_exit_; + FaceData ( FT_Face face, bool free_on_exit = true ) + : face_( face ), free_on_exit_( free_on_exit ) + { + return; + } + }; + + protected: + std::vector< FaceData > faces_; + bool valid_; + enum GlyphCompileMode compile_mode_; + float point_size_; + FT_UInt resolution_; + bool advance_; + GLfloat foreground_color_[4]; + GLfloat background_color_[4]; + enum HorizontalJustification horizontal_justification_; + enum VerticalJustification vertical_justification_; + GLfloat string_rotation_; + FT_UInt rotation_reference_glyph_; + FT_Face rotation_reference_face_; + GLfloat rotation_offset_y_; + typedef std::map< FT_UInt, GLuint > GlyphDLists; + typedef GlyphDLists::const_iterator GDLCI; + typedef GlyphDLists::iterator GDLI; + GlyphDLists glyph_dlists_; + DisplayLists character_display_lists_; + + public: + Face ( const char* filename, float point_size = 12, FT_UInt resolution = 100 ); + Face ( FT_Face face, float point_size = 12, FT_UInt resolution = 100 ); + virtual ~Face ( void ); + bool isValid ( void ) const { return valid_; } + bool addAuxiliaryFace ( const char* filename ); + bool addAuxiliaryFace ( FT_Face face ); + void setCompileMode ( enum GlyphCompileMode compile_mode ) { compile_mode_ = compile_mode; } + enum GlyphCompileMode compileMode ( void ) const { return compile_mode_; } + void setPointSize ( float point_size ); + float pointSize ( void ) { return point_size_; } + void setResolution ( FT_UInt resolution ); + FT_UInt resolution ( void ) { return resolution_; } + void setAdvance ( bool advance ) { advance_ = advance; } + bool advance ( void ) const { return advance_; } + void setForegroundColor ( GLfloat red = 0.0, GLfloat green = 0.0, GLfloat blue = 0.0, GLfloat alpha = 1.0 ); + void setForegroundColor ( const GLfloat foreground_color[4] ); + GLfloat foregroundRed ( void ) const { return foreground_color_[R]; } + GLfloat foregroundGreen ( void ) const { return foreground_color_[G]; } + GLfloat foregroundBlue ( void ) const { return foreground_color_[B]; } + GLfloat foregroundAlpha ( void ) const { return foreground_color_[A]; } + void setBackgroundColor ( GLfloat red = 1.0, GLfloat green = 1.0, GLfloat blue = 1.0, GLfloat alpha = 0.0 ); + void setBackgroundColor ( const GLfloat background_color[4] ); + GLfloat backgroundRed ( void ) const { return background_color_[R]; } + GLfloat backgroundGreen ( void ) const { return background_color_[G]; } + GLfloat backgroundBlue ( void ) const { return background_color_[B]; } + GLfloat backgroundAlpha ( void ) const { return background_color_[A]; } + virtual void setCharacterRotationZ ( GLfloat character_rotation_z ) = 0; + virtual GLfloat characterRotationZ ( void ) const = 0; + void setCharacterRotationReference ( unsigned char c ); + void setStringRotation ( GLfloat string_rotation ); + GLfloat stringRotation ( void ) const { return string_rotation_; } + void setHorizontalJustification ( enum HorizontalJustification horizontal_justification ) + { + horizontal_justification_ = horizontal_justification; + } + enum HorizontalJustification horizontalJustification ( void ) const { return horizontal_justification_; } + void setVerticalJustification ( enum VerticalJustification vertical_justification ) + { + vertical_justification_ = vertical_justification; + } + + enum VerticalJustification verticaljustification ( void ) const { return vertical_justification_; } + void setCharacterDisplayLists ( const DisplayLists& character_display_lists ) { character_display_lists_ = character_display_lists; } + DisplayLists& characterDisplayLists ( void ) { return character_display_lists_; } + virtual double height ( void ) const = 0; + virtual BBox measure ( unsigned char c ) = 0; + virtual BBox measure ( wchar_t c ) = 0; + virtual BBox measure ( const char* s ); + virtual BBox measureRaw ( const char* s ); + virtual BBox measure ( const wchar_t* s ); + virtual BBox measure ( const wchar_t* format, double number ); + virtual BBox measureRaw ( const wchar_t* s ); + GLuint compile ( unsigned char c ); + GLuint compile ( const wchar_t c ); + void draw ( const char* s ); + void draw ( const wchar_t* s ); + void draw ( unsigned char c ); + void draw ( const wchar_t c ); + void draw ( GLfloat x, GLfloat y, unsigned char c ); + void draw ( GLfloat x, GLfloat y, GLfloat z, unsigned char c ); + void draw ( GLfloat x, GLfloat y, wchar_t c ); + void draw ( GLfloat x, GLfloat y, GLfloat z, wchar_t c ); + void draw ( GLfloat x, GLfloat y, const char* s, float *sizebox ); + void draw ( GLfloat x, GLfloat y, GLfloat z, const char* s ); + void draw ( GLfloat x, GLfloat y, const wchar_t* s ); + void draw ( GLfloat x, GLfloat y, GLfloat z, const wchar_t* s ); + int ascender ( void ) { return faces_.front().face_->ascender; } + int descender ( void ) { return faces_.front().face_->descender; } + BBox measure_nominal ( const char* s ); + BBox measure_nominal ( const wchar_t* s ); + + protected: + virtual GLuint compileGlyph ( FT_Face face, FT_UInt glyph_index ) = 0; + virtual void renderGlyph ( FT_Face face, FT_UInt glyph_index ) = 0; + virtual void setCharSize ( void ) = 0; + virtual void clearCaches ( void ) = 0; + virtual void setRotationOffset ( void ) = 0; + + private: + void init ( void ); + }; + + class Raster : public Face + { + protected: + GLfloat character_rotation_z_; + public: + Raster ( const char* filename, float point_size = 12, FT_UInt resolution = 100 ); + Raster ( FT_Face face, float point_size = 12, FT_UInt resolution = 100 ); + virtual ~Raster ( void ); + void setCharacterRotationZ ( GLfloat character_rotation_z ); + GLfloat characterRotationZ ( void ) const { return character_rotation_z_; } + double height ( void ) const; + BBox measure ( unsigned char c ); + BBox measure ( wchar_t c ); + BBox measure ( const char* s ) { return Face::measure( s ); } + BBox measure ( const wchar_t* format, double number ) { return Face::measure( format, number ); } + + private: + void init ( void ); + GLuint compileGlyph ( FT_Face face, FT_UInt glyph_index ); + void setCharSize ( void ); + void setRotationOffset ( void ); + void clearCaches ( void ); + }; + class Monochrome : public Raster + { + public: + Monochrome ( const char* filename, float point_size = 12, FT_UInt resolution = 100 ); + Monochrome ( FT_Face face, float point_size = 12, FT_UInt resolution = 100 ); + ~Monochrome ( void ); + + private: + GLubyte* invertBitmap ( const FT_Bitmap& bitmap ); + void renderGlyph ( FT_Face face, FT_UInt glyph_index ); + }; + +} +#endif /* OGLFT_H */ + diff --git a/libmupen64plus/mupen64plus-core/src/osd/osd.cpp b/libmupen64plus/mupen64plus-core/src/osd/osd.cpp new file mode 100644 index 0000000000..c4826ee996 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/osd/osd.cpp @@ -0,0 +1,599 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - osd.cpp * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2008 Nmn Ebenblues * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +// On-screen Display +#include +#include + +#include "OGLFT.h" +#include "osd.h" + +extern "C" { + #define M64P_CORE_PROTOTYPES 1 + #include "api/m64p_config.h" + #include "api/config.h" + #include "api/callbacks.h" + #include "api/m64p_vidext.h" + #include "api/vidext.h" + #include "main/main.h" + #include "main/list.h" + #include "osal/files.h" + #include "osal/preproc.h" + #include "plugin/plugin.h" +} + +#define FONT_FILENAME "font.ttf" + +typedef void (APIENTRYP PTRGLACTIVETEXTURE)(GLenum texture); +static PTRGLACTIVETEXTURE pglActiveTexture = NULL; + +// static variables for OSD +static int l_OsdInitialized = 0; + +static LIST_HEAD(l_messageQueue); +static OGLFT::Monochrome *l_font; +static float l_fLineHeight = -1.0; + +static void animation_none(osd_message_t *); +static void animation_fade(osd_message_t *); +static void osd_remove_message(osd_message_t *msg); +static osd_message_t * osd_message_valid(osd_message_t *testmsg); + +static float fCornerScroll[OSD_NUM_CORNERS]; + +static SDL_mutex *osd_list_lock; + +// animation handlers +static void (*l_animations[OSD_NUM_ANIM_TYPES])(osd_message_t *) = { + animation_none, // animation handler for OSD_NONE + animation_fade // animation handler for OSD_FADE +}; + +// private functions +// draw message on screen +static void draw_message(osd_message_t *msg, int width, int height) +{ + float x = 0., + y = 0.; + + if(!l_font || !l_font->isValid()) + return; + + // set color. alpha is hard coded to 1. animation can change this + l_font->setForegroundColor(msg->color[R], msg->color[G], msg->color[B], 1.0); + l_font->setBackgroundColor(0.0, 0.0, 0.0, 0.0); + + // set justification based on corner + switch(msg->corner) + { + case OSD_TOP_LEFT: + l_font->setVerticalJustification(OGLFT::Face::TOP); + l_font->setHorizontalJustification(OGLFT::Face::LEFT); + x = 0.; + y = (float)height; + break; + case OSD_TOP_CENTER: + l_font->setVerticalJustification(OGLFT::Face::TOP); + l_font->setHorizontalJustification(OGLFT::Face::CENTER); + x = ((float)width)/2.0f; + y = (float)height; + break; + case OSD_TOP_RIGHT: + l_font->setVerticalJustification(OGLFT::Face::TOP); + l_font->setHorizontalJustification(OGLFT::Face::RIGHT); + x = (float)width; + y = (float)height; + break; + case OSD_MIDDLE_LEFT: + l_font->setVerticalJustification(OGLFT::Face::MIDDLE); + l_font->setHorizontalJustification(OGLFT::Face::LEFT); + x = 0.; + y = ((float)height)/2.0f; + break; + case OSD_MIDDLE_CENTER: + l_font->setVerticalJustification(OGLFT::Face::MIDDLE); + l_font->setHorizontalJustification(OGLFT::Face::CENTER); + x = ((float)width)/2.0f; + y = ((float)height)/2.0f; + break; + case OSD_MIDDLE_RIGHT: + l_font->setVerticalJustification(OGLFT::Face::MIDDLE); + l_font->setHorizontalJustification(OGLFT::Face::RIGHT); + x = (float)width; + y = ((float)height)/2.0f; + break; + case OSD_BOTTOM_LEFT: + l_font->setVerticalJustification(OGLFT::Face::BOTTOM); + l_font->setHorizontalJustification(OGLFT::Face::LEFT); + x = 0.; + y = 0.; + break; + case OSD_BOTTOM_CENTER: + l_font->setVerticalJustification(OGLFT::Face::BOTTOM); + l_font->setHorizontalJustification(OGLFT::Face::CENTER); + x = ((float)width)/2.0f; + y = 0.; + break; + case OSD_BOTTOM_RIGHT: + l_font->setVerticalJustification(OGLFT::Face::BOTTOM); + l_font->setHorizontalJustification(OGLFT::Face::RIGHT); + x = (float)width; + y = 0.; + break; + default: + l_font->setVerticalJustification(OGLFT::Face::BOTTOM); + l_font->setHorizontalJustification(OGLFT::Face::LEFT); + x = 0.; + y = 0.; + break; + } + + // apply animation for current message state + (*l_animations[msg->animation[msg->state]])(msg); + + // xoffset moves message left + x -= msg->xoffset; + // yoffset moves message up + y += msg->yoffset; + + // get the bounding box if invalid + if (msg->sizebox[0] == 0 && msg->sizebox[2] == 0) // xmin and xmax + { + OGLFT::BBox bbox = l_font->measure_nominal(msg->text); + msg->sizebox[0] = bbox.x_min_; + msg->sizebox[1] = bbox.y_min_; + msg->sizebox[2] = bbox.x_max_; + msg->sizebox[3] = bbox.y_max_; + } + + // draw the text line + l_font->draw(x, y, msg->text, msg->sizebox); +} + +// null animation handler +static void animation_none(osd_message_t *msg) { } + +// fade in/out animation handler +static void animation_fade(osd_message_t *msg) +{ + float alpha = 1.; + float elapsed_frames; + float total_frames = (float)msg->timeout[msg->state]; + + switch(msg->state) + { + case OSD_DISAPPEAR: + elapsed_frames = (float)(total_frames - msg->frames); + break; + case OSD_APPEAR: + default: + elapsed_frames = (float)msg->frames; + break; + } + + if(total_frames != 0.) + alpha = elapsed_frames / total_frames; + + l_font->setForegroundColor(msg->color[R], msg->color[G], msg->color[B], alpha); +} + +// sets message Y offset depending on where they are in the message queue +static float get_message_offset(osd_message_t *msg, float fLinePos) +{ + float offset = (float) (l_font->height() * fLinePos); + + switch(msg->corner) + { + case OSD_TOP_LEFT: + case OSD_TOP_CENTER: + case OSD_TOP_RIGHT: + return -offset; + break; + default: + return offset; + break; + } +} + +// public functions +extern "C" +void osd_init(int width, int height) +{ + const char *fontpath; + + osd_list_lock = SDL_CreateMutex(); + if (!osd_list_lock) { + DebugMessage(M64MSG_ERROR, "Could not create osd list lock"); + return; + } + + if (!OGLFT::Init_FT()) + { + DebugMessage(M64MSG_ERROR, "Could not initialize freetype library."); + return; + } + + fontpath = ConfigGetSharedDataFilepath(FONT_FILENAME); + + l_font = new OGLFT::Monochrome(fontpath, (float) height / 35.0f); // make font size proportional to screen height + + if(!l_font || !l_font->isValid()) + { + DebugMessage(M64MSG_ERROR, "Could not construct face from %s", fontpath); + return; + } + + // clear statics + for (int i = 0; i < OSD_NUM_CORNERS; i++) + fCornerScroll[i] = 0.0; + + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); +#if defined(GL_RASTER_POSITION_UNCLIPPED_IBM) + glEnable(GL_RASTER_POSITION_UNCLIPPED_IBM); +#endif + + pglActiveTexture = (PTRGLACTIVETEXTURE) VidExt_GL_GetProcAddress("glActiveTexture"); + if (pglActiveTexture == NULL) + { + DebugMessage(M64MSG_WARNING, "OpenGL function glActiveTexture() not supported. OSD deactivated."); + return; + } + + // set initialized flag + l_OsdInitialized = 1; +} + +extern "C" +void osd_exit(void) +{ + osd_message_t *msg, *safe; + + // delete font renderer + if (l_font) + { + delete l_font; + l_font = NULL; + } + + // delete message queue + SDL_LockMutex(osd_list_lock); + list_for_each_entry_safe(msg, safe, &l_messageQueue, osd_message_t, list) { + free(msg->text); + free(msg); + } + SDL_UnlockMutex(osd_list_lock); + + // shut down the Freetype library + OGLFT::Uninit_FT(); + + SDL_DestroyMutex(osd_list_lock); + + // reset initialized flag + l_OsdInitialized = 0; +} + +// renders the current osd message queue to the screen +extern "C" +void osd_render() +{ + osd_message_t *msg, *safe; + int i; + + // if we're not initialized or list is empty, then just skip it all + if (!l_OsdInitialized || list_empty(&l_messageQueue)) + return; + + // get the viewport dimensions + GLint viewport[4]; + glGetIntegerv(GL_VIEWPORT, viewport); + + // save all the attributes + glPushAttrib(GL_ALL_ATTRIB_BITS); + bool bFragmentProg = glIsEnabled(GL_FRAGMENT_PROGRAM_ARB) != 0; + bool bColorArray = glIsEnabled(GL_COLOR_ARRAY) != 0; + bool bTexCoordArray = glIsEnabled(GL_TEXTURE_COORD_ARRAY) != 0; + bool bSecColorArray = glIsEnabled(GL_SECONDARY_COLOR_ARRAY) != 0; + + // deactivate all the texturing units + GLint iActiveTex; + bool bTexture2D[8]; + glGetIntegerv(GL_ACTIVE_TEXTURE_ARB, &iActiveTex); + for (i = 0; i < 8; i++) + { + pglActiveTexture(GL_TEXTURE0_ARB + i); + bTexture2D[i] = glIsEnabled(GL_TEXTURE_2D) != 0; + glDisable(GL_TEXTURE_2D); + } + + // save the matrices and set up new ones + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadIdentity(); + gluOrtho2D(viewport[0],viewport[2],viewport[1],viewport[3]); + + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadIdentity(); + + // setup for drawing text + glDisable(GL_FOG); + glDisable(GL_LIGHTING); + glDisable(GL_ALPHA_TEST); + glDisable(GL_DEPTH_TEST); + glDisable(GL_CULL_FACE); + glDisable(GL_SCISSOR_TEST); + glDisable(GL_STENCIL_TEST); + glDisable(GL_FRAGMENT_PROGRAM_ARB); + glDisable(GL_COLOR_MATERIAL); + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + glDisableClientState(GL_COLOR_ARRAY); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + glDisableClientState(GL_SECONDARY_COLOR_ARRAY); + glShadeModel(GL_FLAT); + + // get line height if invalid + if (l_fLineHeight < 0.0) + { + OGLFT::BBox bbox = l_font->measure("01abjZpqRGB"); + l_fLineHeight = (bbox.y_max_ - bbox.y_min_) / 30.0f; + } + + // keeps track of next message position for each corner + float fCornerPos[OSD_NUM_CORNERS]; + for (i = 0; i < OSD_NUM_CORNERS; i++) + fCornerPos[i] = 0.5f * l_fLineHeight; + + SDL_LockMutex(osd_list_lock); + list_for_each_entry_safe(msg, safe, &l_messageQueue, osd_message_t, list) { + // update message state + if(msg->timeout[msg->state] != OSD_INFINITE_TIMEOUT && + ++msg->frames >= msg->timeout[msg->state]) + { + // if message is in last state, mark it for deletion and continue to the next message + if(msg->state >= OSD_NUM_STATES - 1) + { + if (msg->user_managed) { + osd_remove_message(msg); + } else { + osd_remove_message(msg); + free(msg); + } + + continue; + } + + // go to next state and reset frame count + msg->state++; + msg->frames = 0; + } + + // offset y depending on how many other messages are in the same corner + float fStartOffset; + if (msg->corner >= OSD_MIDDLE_LEFT && msg->corner <= OSD_MIDDLE_RIGHT) // don't scroll the middle messages + fStartOffset = fCornerPos[msg->corner]; + else + fStartOffset = fCornerPos[msg->corner] + (fCornerScroll[msg->corner] * l_fLineHeight); + msg->yoffset += get_message_offset(msg, fStartOffset); + + draw_message(msg, viewport[2], viewport[3]); + + msg->yoffset -= get_message_offset(msg, fStartOffset); + fCornerPos[msg->corner] += l_fLineHeight; + } + SDL_UnlockMutex(osd_list_lock); + + // do the scrolling + for (int i = 0; i < OSD_NUM_CORNERS; i++) + { + fCornerScroll[i] += 0.1f; + if (fCornerScroll[i] >= 0.0) + fCornerScroll[i] = 0.0; + } + + // restore the matrices + glMatrixMode(GL_MODELVIEW); + glPopMatrix(); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + + // restore the attributes + for (int i = 0; i < 8; i++) + { + pglActiveTexture(GL_TEXTURE0_ARB + i); + if (bTexture2D[i]) + glEnable(GL_TEXTURE_2D); + else + glDisable(GL_TEXTURE_2D); + } + pglActiveTexture(iActiveTex); + glPopAttrib(); + if (bFragmentProg) + glEnable(GL_FRAGMENT_PROGRAM_ARB); + if (bColorArray) + glEnableClientState(GL_COLOR_ARRAY); + if (bTexCoordArray) + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + if (bSecColorArray) + glEnableClientState(GL_SECONDARY_COLOR_ARRAY); + + glFinish(); +} + +// creates a new osd_message_t, adds it to the message queue and returns it in case +// the user wants to modify its parameters. Note, if the message can't be created, +// NULL is returned. +extern "C" +osd_message_t * osd_new_message(enum osd_corner eCorner, const char *fmt, ...) +{ + va_list ap; + char buf[1024]; + + if (!l_OsdInitialized) return NULL; + + osd_message_t *msg = (osd_message_t *)malloc(sizeof(*msg)); + + if (!msg) return NULL; + + va_start(ap, fmt); + vsnprintf(buf, 1024, fmt, ap); + buf[1023] = 0; + va_end(ap); + + // set default values + memset(msg, 0, sizeof(osd_message_t)); + msg->text = strdup(buf); + msg->user_managed = 0; + // default to white + msg->color[R] = 1.; + msg->color[G] = 1.; + msg->color[B] = 1.; + + msg->sizebox[0] = 0.0; // set a null bounding box + msg->sizebox[1] = 0.0; + msg->sizebox[2] = 0.0; + msg->sizebox[3] = 0.0; + + msg->corner = eCorner; + msg->state = OSD_APPEAR; + fCornerScroll[eCorner] -= 1.0; // start this one before the beginning of the list and scroll it in + + msg->animation[OSD_APPEAR] = OSD_FADE; + msg->animation[OSD_DISPLAY] = OSD_NONE; + msg->animation[OSD_DISAPPEAR] = OSD_FADE; + + if (eCorner >= OSD_MIDDLE_LEFT && eCorner <= OSD_MIDDLE_RIGHT) + { + msg->timeout[OSD_APPEAR] = 20; + msg->timeout[OSD_DISPLAY] = 60; + msg->timeout[OSD_DISAPPEAR] = 20; + } + else + { + msg->timeout[OSD_APPEAR] = 20; + msg->timeout[OSD_DISPLAY] = 180; + msg->timeout[OSD_DISAPPEAR] = 40; + } + + // add to message queue + SDL_LockMutex(osd_list_lock); + list_add(&msg->list, &l_messageQueue); + SDL_UnlockMutex(osd_list_lock); + + return msg; +} + +// update message string +extern "C" +void osd_update_message(osd_message_t *msg, const char *fmt, ...) +{ + va_list ap; + char buf[1024]; + + if (!l_OsdInitialized || !msg) return; + + va_start(ap, fmt); + vsnprintf(buf, 1024, fmt, ap); + buf[1023] = 0; + va_end(ap); + + free(msg->text); + msg->text = strdup(buf); + + // reset bounding box + msg->sizebox[0] = 0.0; + msg->sizebox[1] = 0.0; + msg->sizebox[2] = 0.0; + msg->sizebox[3] = 0.0; + + // reset display time counter + if (msg->state >= OSD_DISPLAY) + { + msg->state = OSD_DISPLAY; + msg->frames = 0; + } + + SDL_LockMutex(osd_list_lock); + if (!osd_message_valid(msg)) + list_add(&msg->list, &l_messageQueue); + SDL_UnlockMutex(osd_list_lock); + +} + +// remove message from message queue +static void osd_remove_message(osd_message_t *msg) +{ + if (!l_OsdInitialized || !msg) return; + + free(msg->text); + msg->text = NULL; + list_del(&msg->list); +} + +// remove message from message queue and free it +extern "C" +void osd_delete_message(osd_message_t *msg) +{ + if (!l_OsdInitialized || !msg) return; + + SDL_LockMutex(osd_list_lock); + osd_remove_message(msg); + free(msg); + SDL_UnlockMutex(osd_list_lock); +} + +// set message so it doesn't automatically expire in a certain number of frames. +extern "C" +void osd_message_set_static(osd_message_t *msg) +{ + if (!l_OsdInitialized || !msg) return; + + msg->timeout[OSD_DISPLAY] = OSD_INFINITE_TIMEOUT; + msg->state = OSD_DISPLAY; + msg->frames = 0; +} + +// set message so it doesn't automatically get freed when finished transition. +extern "C" +void osd_message_set_user_managed(osd_message_t *msg) +{ + if (!l_OsdInitialized || !msg) return; + + msg->user_managed = 1; +} + +// return message pointer if valid (in the OSD list), otherwise return NULL +static osd_message_t * osd_message_valid(osd_message_t *testmsg) +{ + osd_message_t *msg; + + if (!l_OsdInitialized || !testmsg) return NULL; + + list_for_each_entry(msg, &l_messageQueue, osd_message_t, list) { + if (msg == testmsg) + return testmsg; + } + + return NULL; +} + diff --git a/libmupen64plus/mupen64plus-core/src/osd/osd.h b/libmupen64plus/mupen64plus-core/src/osd/osd.h new file mode 100644 index 0000000000..199ac0df74 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/osd/osd.h @@ -0,0 +1,143 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - osd.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2008 Nmn, Ebenblues * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __OSD_H__ +#define __OSD_H__ + +#include "main/list.h" + +/****************************************************************** + osd_corner + 0 1 2 | + \ __|__/ | Offset always effects the same: + | | | +X = Leftward +Y = Upward + 3-| 4 |-5 | With no offset, the text will touch the border. + |_____| | + / | \ | + 6 7 8 | +*******************************************************************/ +enum osd_corner { + OSD_TOP_LEFT, // 0 in the picture above + OSD_TOP_CENTER, // 1 in the picture above + OSD_TOP_RIGHT, // 2 in the picture above + + OSD_MIDDLE_LEFT, // 3 in the picture above + OSD_MIDDLE_CENTER, // 4 in the picture above + OSD_MIDDLE_RIGHT, // 5 in the picture above + + OSD_BOTTOM_LEFT, // 6 in the picture above + OSD_BOTTOM_CENTER, // 7 in the picture above + OSD_BOTTOM_RIGHT, // 8 in the picture above + + OSD_NUM_CORNERS +}; + +enum osd_message_state { + OSD_APPEAR, // OSD message is appearing on the screen + OSD_DISPLAY, // OSD message is being displayed on the screen + OSD_DISAPPEAR, // OSD message is disappearing from the screen + + OSD_NUM_STATES +}; + +enum osd_animation_type { + OSD_NONE, + OSD_FADE, + + OSD_NUM_ANIM_TYPES +}; + +typedef struct { + char *text; // Text that this object will have when displayed + enum osd_corner corner; // One of the 9 corners + float xoffset; // Relative X position + float yoffset; // Relative Y position + float color[3]; // Red, Green, Blue values + float sizebox[4]; // bounding box (xmin, ymin, xmax, ymax) + int state; // display state of current message + enum osd_animation_type animation[OSD_NUM_STATES]; // animations for each display state + unsigned int timeout[OSD_NUM_STATES]; // timeouts for each display state +#define OSD_INFINITE_TIMEOUT 0xffffffff + unsigned int frames; // number of frames in this state + int user_managed; // structure managed by caller and not to be freed by us + struct list_head list; +} osd_message_t; + +enum { R, G, B }; // for referencing color array + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef M64P_OSD + +void osd_init(int width, int height); +void osd_exit(void); +void osd_render(void); +osd_message_t * osd_new_message(enum osd_corner, const char *, ...); +void osd_update_message(osd_message_t *, const char *, ...); +void osd_delete_message(osd_message_t *); +void osd_message_set_static(osd_message_t *); +void osd_message_set_user_managed(osd_message_t *); + +#else + +static inline void osd_init(int width, int height) +{ +} + +static inline void osd_exit(void) +{ +} + +static inline void osd_render(void) +{ +} + +static inline osd_message_t * osd_new_message(enum osd_corner eCorner, const char *fmt, ...) +{ + return NULL; +} + +static inline void osd_update_message(osd_message_t *msg, const char *fmt, ...) +{ +} + +static inline void osd_delete_message(osd_message_t *msg) +{ +} + +static inline void osd_message_set_static(osd_message_t *msg) +{ +} + +static inline void osd_message_set_user_managed(osd_message_t *msg) +{ +} + +#endif + +#ifdef __cplusplus +} +#endif + +#endif // __OSD_H__ + diff --git a/libmupen64plus/mupen64plus-core/src/osd/screenshot.cpp b/libmupen64plus/mupen64plus-core/src/osd/screenshot.cpp new file mode 100644 index 0000000000..c9caa7a084 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/osd/screenshot.cpp @@ -0,0 +1,231 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - screenshot.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2008 Richard42 * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include +#include + +#include +#include +#include + +#include "osd.h" + +extern "C" { +#define M64P_CORE_PROTOTYPES 1 +#include "api/m64p_types.h" +#include "api/callbacks.h" +#include "api/m64p_config.h" +#include "api/config.h" +#include "main/main.h" +#include "main/util.h" +#include "main/rom.h" +#include "osal/files.h" +#include "osal/preproc.h" +#include "plugin/plugin.h" +} + +/********************************************************************************************************* +* PNG support functions for writing screenshot files +*/ + +static void mupen_png_error(png_structp png_write, const char *message) +{ + DebugMessage(M64MSG_ERROR, "PNG Error: %s", message); +} + +static void mupen_png_warn(png_structp png_write, const char *message) +{ + DebugMessage(M64MSG_WARNING, "PNG Warning: %s", message); +} + +static void user_write_data(png_structp png_write, png_bytep data, png_size_t length) +{ + FILE *fPtr = (FILE *) png_get_io_ptr(png_write); + if (fwrite(data, 1, length, fPtr) != length) + DebugMessage(M64MSG_ERROR, "Failed to write %zi bytes to screenshot file.", length); +} + +static void user_flush_data(png_structp png_write) +{ + FILE *fPtr = (FILE *) png_get_io_ptr(png_write); + fflush(fPtr); +} + +/********************************************************************************************************* +* Other Local (static) functions +*/ + +static int SaveRGBBufferToFile(const char *filename, const unsigned char *buf, int width, int height, int pitch) +{ + int i; + + // allocate PNG structures + png_structp png_write = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, mupen_png_error, mupen_png_warn); + if (!png_write) + { + DebugMessage(M64MSG_ERROR, "Error creating PNG write struct."); + return 1; + } + png_infop png_info = png_create_info_struct(png_write); + if (!png_info) + { + png_destroy_write_struct(&png_write, (png_infopp)NULL); + DebugMessage(M64MSG_ERROR, "Error creating PNG info struct."); + return 2; + } + // Set the jumpback + if (setjmp(png_jmpbuf(png_write))) + { + png_destroy_write_struct(&png_write, &png_info); + DebugMessage(M64MSG_ERROR, "Error calling setjmp()"); + return 3; + } + // open the file to write + FILE *savefile = fopen(filename, "wb"); + if (savefile == NULL) + { + DebugMessage(M64MSG_ERROR, "Error opening '%s' to save screenshot.", filename); + return 4; + } + // set function pointers in the PNG library, for write callbacks + png_set_write_fn(png_write, (png_voidp) savefile, user_write_data, user_flush_data); + // set the info + png_set_IHDR(png_write, png_info, width, height, 8, PNG_COLOR_TYPE_RGB, + PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); + // allocate row pointers and scale each row to 24-bit color + png_byte **row_pointers; + row_pointers = (png_byte **) malloc(height * sizeof(png_bytep)); + for (i = 0; i < height; i++) + { + row_pointers[i] = (png_byte *) (buf + (height - 1 - i) * pitch); + } + // set the row pointers + png_set_rows(png_write, png_info, row_pointers); + // write the picture to disk + png_write_png(png_write, png_info, 0, NULL); + // free memory + free(row_pointers); + png_destroy_write_struct(&png_write, &png_info); + // close file + fclose(savefile); + // all done + return 0; +} + +static int CurrentShotIndex; + +static char *GetNextScreenshotPath(void) +{ + char *ScreenshotPath; + char ScreenshotFileName[20 + 8 + 1]; + + // generate the base name of the screenshot + // add the ROM name, convert to lowercase, convert spaces to underscores + strcpy(ScreenshotFileName, ROM_PARAMS.headername); + for (char *pch = ScreenshotFileName; *pch != '\0'; pch++) + *pch = (*pch == ' ') ? '_' : tolower(*pch); + strcat(ScreenshotFileName, "-###.png"); + + // add the base path to the screenshot file name + const char *SshotDir = ConfigGetParamString(g_CoreConfig, "ScreenshotPath"); + if (SshotDir == NULL || *SshotDir == '\0') + { + // note the trick to avoid an allocation. we add a NUL character + // instead of the separator, call mkdir, then add the separator + ScreenshotPath = formatstr("%sscreenshot%c%s", ConfigGetUserDataPath(), '\0', ScreenshotFileName); + if (ScreenshotPath == NULL) + return NULL; + osal_mkdirp(ScreenshotPath, 0700); + ScreenshotPath[strlen(ScreenshotPath)] = OSAL_DIR_SEPARATORS[0]; + } + else + { + ScreenshotPath = combinepath(SshotDir, ScreenshotFileName); + if (ScreenshotPath == NULL) + return NULL; + } + + // patch the number part of the name (the '###' part) until we find a free spot + char *NumberPtr = ScreenshotPath + strlen(ScreenshotPath) - 7; + for (; CurrentShotIndex < 1000; CurrentShotIndex++) + { + sprintf(NumberPtr, "%03i.png", CurrentShotIndex); + FILE *pFile = fopen(ScreenshotPath, "r"); + if (pFile == NULL) + break; + fclose(pFile); + } + + if (CurrentShotIndex >= 1000) + { + DebugMessage(M64MSG_ERROR, "Can't save screenshot; folder already contains 1000 screenshots for this ROM"); + return NULL; + } + CurrentShotIndex++; + + return ScreenshotPath; +} + +/********************************************************************************************************* +* Global screenshot functions +*/ + +extern "C" void ScreenshotRomOpen(void) +{ + CurrentShotIndex = 0; +} + +extern "C" void TakeScreenshot(int iFrameNumber) +{ + char *filename; + + // look for an unused screenshot filename + filename = GetNextScreenshotPath(); + if (filename == NULL) + return; + + // get the width and height + int width = 640; + int height = 480; + gfx.readScreen(NULL, &width, &height, 0); + + // allocate memory for the image + unsigned char *pucFrame = (unsigned char *) malloc(width * height * 3); + if (pucFrame == NULL) + { + free(filename); + return; + } + + // grab the back image from OpenGL by calling the video plugin + gfx.readScreen(pucFrame, &width, &height, 0); + + // write the image to a PNG + SaveRGBBufferToFile(filename, pucFrame, width, height, width * 3); + // free the memory + free(pucFrame); + free(filename); + // print message -- this allows developers to capture frames and use them in the regression test + main_message(M64MSG_INFO, OSD_BOTTOM_LEFT, "Captured screenshot for frame %i.", iFrameNumber); +} + diff --git a/libmupen64plus/mupen64plus-core/src/osd/screenshot.h b/libmupen64plus/mupen64plus-core/src/osd/screenshot.h new file mode 100644 index 0000000000..9176b68373 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/osd/screenshot.h @@ -0,0 +1,32 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - screenshot.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2008 Richard42 * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifdef __cplusplus +extern "C" { +#endif + +void ScreenshotRomOpen(void); +void TakeScreenshot(int iFrameNumber); + +#ifdef __cplusplus +} +#endif + diff --git a/libmupen64plus/mupen64plus-core/src/plugin/dummy_audio.c b/libmupen64plus/mupen64plus-core/src/plugin/dummy_audio.c new file mode 100644 index 0000000000..456ecb2ec4 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/plugin/dummy_audio.c @@ -0,0 +1,112 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - dummy_audio.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2008-2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "api/m64p_types.h" +#include "plugin.h" +#include "dummy_audio.h" + +m64p_error dummyaudio_PluginGetVersion(m64p_plugin_type *PluginType, int *PluginVersion, + int *APIVersion, const char **PluginNamePtr, int *Capabilities) +{ + if (PluginType != NULL) + *PluginType = M64PLUGIN_AUDIO; + + if (PluginVersion != NULL) + *PluginVersion = 0x00010000; + + if (APIVersion != NULL) + *APIVersion = AUDIO_API_VERSION; + + if (PluginNamePtr != NULL) + *PluginNamePtr = "Mupen64Plus-NoAudio"; + + if (Capabilities != NULL) + *Capabilities = 0; + + return M64ERR_SUCCESS; +} + +void dummyaudio_AiDacrateChanged(int SystemType) +{ + return; +} + +void dummyaudio_AiLenChanged(void) +{ + return; +} + +int dummyaudio_InitiateAudio(AUDIO_INFO Audio_Info) +{ + return 1; +} + +int dummyaudio_RomOpen(void) +{ + return 1; +} + +void dummyaudio_RomClosed(void) +{ + return; +} + +void dummyaudio_ProcessAList(void) +{ + return; +} + +void dummyaudio_SetSpeedFactor(int percent) +{ + return; +} + +void dummyaudio_VolumeUp(void) +{ + return; +} + +void dummyaudio_VolumeDown(void) +{ + return; +} + +int dummyaudio_VolumeGetLevel(void) +{ + return 0; +} + +void dummyaudio_VolumeSetLevel(int level) +{ + return; +} + +void dummyaudio_VolumeMute(void) +{ + return; +} + +const char *dummyaudio_VolumeGetString(void) +{ + return "disabled"; +} diff --git a/libmupen64plus/mupen64plus-core/src/plugin/dummy_audio.h b/libmupen64plus/mupen64plus-core/src/plugin/dummy_audio.h new file mode 100644 index 0000000000..18aa0437f1 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/plugin/dummy_audio.h @@ -0,0 +1,45 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - dummy_audio.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2008-2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#if !defined(DUMMY_AUDIO_H) +#define DUMMY_AUDIO_H + +#include "api/m64p_plugin.h" + +extern m64p_error dummyaudio_PluginGetVersion(m64p_plugin_type *PluginType, int *PluginVersion, + int *APIVersion, const char **PluginNamePtr, int *Capabilities); +extern void dummyaudio_AiDacrateChanged(int SystemType); +extern void dummyaudio_AiLenChanged(void); +extern int dummyaudio_InitiateAudio(AUDIO_INFO Audio_Info); +extern void dummyaudio_ProcessAList(void); +extern int dummyaudio_RomOpen(void); +extern void dummyaudio_RomClosed(void); +extern void dummyaudio_SetSpeedFactor(int percent); +extern void dummyaudio_VolumeUp(void); +extern void dummyaudio_VolumeDown(void); +extern int dummyaudio_VolumeGetLevel(void); +extern void dummyaudio_VolumeSetLevel(int level); +extern void dummyaudio_VolumeMute(void); +extern const char * dummyaudio_VolumeGetString(void); + +#endif /* DUMMY_AUDIO_H */ + + diff --git a/libmupen64plus/mupen64plus-core/src/plugin/dummy_input.c b/libmupen64plus/mupen64plus-core/src/plugin/dummy_input.c new file mode 100644 index 0000000000..a9d3e5bb54 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/plugin/dummy_input.c @@ -0,0 +1,85 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - dummy_input.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2008 Scott Gorman (okaygo) * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "api/m64p_types.h" +#include "plugin.h" +#include "dummy_input.h" + +m64p_error dummyinput_PluginGetVersion(m64p_plugin_type *PluginType, int *PluginVersion, + int *APIVersion, const char **PluginNamePtr, int *Capabilities) +{ + if (PluginType != NULL) + *PluginType = M64PLUGIN_INPUT; + + if (PluginVersion != NULL) + *PluginVersion = 0x00010000; + + if (APIVersion != NULL) + *APIVersion = INPUT_API_VERSION; + + if (PluginNamePtr != NULL) + *PluginNamePtr = "Mupen64Plus-NoInput"; + + if (Capabilities != NULL) + *Capabilities = 0; + + return M64ERR_SUCCESS; +} + +void dummyinput_InitiateControllers (CONTROL_INFO ControlInfo) +{ + ControlInfo.Controls[0].Present = 1; +} + +void dummyinput_GetKeys(int Control, BUTTONS * Keys ) +{ + Keys->Value = 0x0000; +} + +void dummyinput_ControllerCommand(int Control, unsigned char *Command) +{ +} + +void dummyinput_ReadController(int Control, unsigned char *Command) +{ +} + +int dummyinput_RomOpen(void) +{ + return 1; +} + +void dummyinput_RomClosed(void) +{ +} + +void dummyinput_SDL_KeyDown(int keymod, int keysym) +{ +} + +void dummyinput_SDL_KeyUp(int keymod, int keysym) +{ +} + + diff --git a/libmupen64plus/mupen64plus-core/src/plugin/dummy_input.h b/libmupen64plus/mupen64plus-core/src/plugin/dummy_input.h new file mode 100644 index 0000000000..0ece52ce60 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/plugin/dummy_input.h @@ -0,0 +1,42 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - dummy_input.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#if !defined(DUMMY_INPUT_H) +#define DUMMY_INPUT_H + +#include "api/m64p_plugin.h" + +extern m64p_error dummyinput_PluginGetVersion(m64p_plugin_type *PluginType, int *PluginVersion, + int *APIVersion, const char **PluginNamePtr, int *Capabilities); +extern void dummyinput_InitiateControllers (CONTROL_INFO ControlInfo); +extern void dummyinput_GetKeys(int Control, BUTTONS * Keys ); +extern void dummyinput_ControllerCommand(int Control, unsigned char *Command); +extern void dummyinput_GetKeys(int Control, BUTTONS * Keys); +extern void dummyinput_InitiateControllers(CONTROL_INFO ControlInfo); +extern void dummyinput_ReadController(int Control, unsigned char *Command); +extern int dummyinput_RomOpen(void); +extern void dummyinput_RomClosed(void); +extern void dummyinput_SDL_KeyDown(int keymod, int keysym); +extern void dummyinput_SDL_KeyUp(int keymod, int keysym); + +#endif /* DUMMY_INPUT_H */ + + diff --git a/libmupen64plus/mupen64plus-core/src/plugin/dummy_rsp.c b/libmupen64plus/mupen64plus-core/src/plugin/dummy_rsp.c new file mode 100644 index 0000000000..39748342df --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/plugin/dummy_rsp.c @@ -0,0 +1,61 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - dummy_rsp.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "api/m64p_types.h" +#include "plugin.h" +#include "dummy_rsp.h" + +m64p_error dummyrsp_PluginGetVersion(m64p_plugin_type *PluginType, int *PluginVersion, + int *APIVersion, const char **PluginNamePtr, int *Capabilities) +{ + if (PluginType != NULL) + *PluginType = M64PLUGIN_RSP; + + if (PluginVersion != NULL) + *PluginVersion = 0x00010000; + + if (APIVersion != NULL) + *APIVersion = RSP_API_VERSION; + + if (PluginNamePtr != NULL) + *PluginNamePtr = "Mupen64Plus-NoRSP"; + + if (Capabilities != NULL) + *Capabilities = 0; + + return M64ERR_SUCCESS; +} + +unsigned int dummyrsp_DoRspCycles(unsigned int Cycles) +{ + return Cycles; +} + +void dummyrsp_InitiateRSP(RSP_INFO Rsp_Info, unsigned int * CycleCount) +{ +} + +void dummyrsp_RomClosed(void) +{ +} + diff --git a/libmupen64plus/mupen64plus-core/src/plugin/dummy_rsp.h b/libmupen64plus/mupen64plus-core/src/plugin/dummy_rsp.h new file mode 100644 index 0000000000..32ad545878 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/plugin/dummy_rsp.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - dummy_rsp.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard42 * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#if !defined(DUMMY_RSP_H) +#define DUMMY_RSP_H + +#include "api/m64p_plugin.h" + +extern m64p_error dummyrsp_PluginGetVersion(m64p_plugin_type *PluginType, int *PluginVersion, + int *APIVersion, const char **PluginNamePtr, int *Capabilities); +extern unsigned int dummyrsp_DoRspCycles(unsigned int Cycles); +extern void dummyrsp_InitiateRSP(RSP_INFO Rsp_Info, unsigned int *CycleCount); +extern void dummyrsp_RomClosed(void); + +#endif /* DUMMY_RSP_H */ + + diff --git a/libmupen64plus/mupen64plus-core/src/plugin/dummy_video.c b/libmupen64plus/mupen64plus-core/src/plugin/dummy_video.c new file mode 100644 index 0000000000..d904a05df0 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/plugin/dummy_video.c @@ -0,0 +1,125 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - dummy_video.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2008 John Chadwick (NMN) * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "api/m64p_types.h" +#include "plugin.h" +#include "dummy_video.h" + +m64p_error dummyvideo_PluginGetVersion(m64p_plugin_type *PluginType, int *PluginVersion, + int *APIVersion, const char **PluginNamePtr, int *Capabilities) +{ + if (PluginType != NULL) + *PluginType = M64PLUGIN_GFX; + + if (PluginVersion != NULL) + *PluginVersion = 0x00010000; + + if (APIVersion != NULL) + *APIVersion = GFX_API_VERSION; + + if (PluginNamePtr != NULL) + *PluginNamePtr = "Mupen64Plus-NoVideo"; + + if (Capabilities != NULL) + *Capabilities = 0; + + return M64ERR_SUCCESS; +} + +void dummyvideo_ChangeWindow (void) +{ + +} + +int dummyvideo_InitiateGFX (GFX_INFO Gfx_Info) +{ + return 1; +} + +void dummyvideo_MoveScreen (int xpos, int ypos) +{ +} + +void dummyvideo_ProcessDList(void) +{ + +} + +void dummyvideo_ProcessRDPList(void) +{ + +} + +void dummyvideo_RomClosed (void) +{ + +} + +int dummyvideo_RomOpen (void) +{ + return 1; +} + +void dummyvideo_ShowCFB (void) +{ + +} + +void dummyvideo_UpdateScreen (void) +{ + +} + +void dummyvideo_ViStatusChanged (void) +{ + +} + +void dummyvideo_ViWidthChanged (void) +{ + +} + +void dummyvideo_ReadScreen2 (void *dest, int *width, int *height, int front) +{ + +} + +void dummyvideo_SetRenderingCallback(void (*callback)(int)) +{ + +} + +void dummyvideo_FBRead(unsigned int addr) +{ +} + +void dummyvideo_FBWrite(unsigned int addr, unsigned int size) +{ +} + +void dummyvideo_FBGetFrameBufferInfo(void *p) +{ +} + diff --git a/libmupen64plus/mupen64plus-core/src/plugin/dummy_video.h b/libmupen64plus/mupen64plus-core/src/plugin/dummy_video.h new file mode 100644 index 0000000000..8d6d7fb058 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/plugin/dummy_video.h @@ -0,0 +1,49 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - dummy_video.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#if !defined(DUMMY_VIDEO_H) +#define DUMMY_VIDEO_H + +#include "api/m64p_plugin.h" + +extern m64p_error dummyvideo_PluginGetVersion(m64p_plugin_type *PluginType, int *PluginVersion, + int *APIVersion, const char **PluginNamePtr, int *Capabilities); +extern void dummyvideo_ChangeWindow(void); +extern int dummyvideo_InitiateGFX(GFX_INFO Gfx_Info); +extern void dummyvideo_MoveScreen(int xpos, int ypos); +extern void dummyvideo_ProcessDList(void); +extern void dummyvideo_ProcessRDPList(void); +extern void dummyvideo_RomClosed(void); +extern int dummyvideo_RomOpen(void); +extern void dummyvideo_ShowCFB(void); +extern void dummyvideo_UpdateScreen(void); +extern void dummyvideo_ViStatusChanged(void); +extern void dummyvideo_ViWidthChanged(void); +extern void dummyvideo_ReadScreen2(void *dest, int *width, int *height, int front); +extern void dummyvideo_SetRenderingCallback(void (*callback)(int)); + +extern void dummyvideo_FBRead(unsigned int addr); +extern void dummyvideo_FBWrite(unsigned int addr, unsigned int size); +extern void dummyvideo_FBGetFrameBufferInfo(void *p); + +#endif /* DUMMY_VIDEO_H */ + + diff --git a/libmupen64plus/mupen64plus-core/src/plugin/plugin.c b/libmupen64plus/mupen64plus-core/src/plugin/plugin.c new file mode 100644 index 0000000000..656837497c --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/plugin/plugin.c @@ -0,0 +1,535 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - plugin.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "plugin.h" + +#include "api/callbacks.h" +#include "api/m64p_common.h" +#include "api/m64p_plugin.h" +#include "api/m64p_types.h" + +#include "main/rom.h" +#include "main/version.h" +#include "memory/memory.h" + +#include "osal/dynamiclib.h" + +#include "dummy_audio.h" +#include "dummy_video.h" +#include "dummy_input.h" +#include "dummy_rsp.h" + +CONTROL Controls[4]; + +/* global function pointers - initialized on core startup */ +gfx_plugin_functions gfx; +audio_plugin_functions audio; +input_plugin_functions input; +rsp_plugin_functions rsp; + +/* local data structures and functions */ +static const gfx_plugin_functions dummy_gfx = { + dummyvideo_PluginGetVersion, + dummyvideo_ChangeWindow, + dummyvideo_InitiateGFX, + dummyvideo_MoveScreen, + dummyvideo_ProcessDList, + dummyvideo_ProcessRDPList, + dummyvideo_RomClosed, + dummyvideo_RomOpen, + dummyvideo_ShowCFB, + dummyvideo_UpdateScreen, + dummyvideo_ViStatusChanged, + dummyvideo_ViWidthChanged, + dummyvideo_ReadScreen2, + dummyvideo_SetRenderingCallback, + dummyvideo_FBRead, + dummyvideo_FBWrite, + dummyvideo_FBGetFrameBufferInfo +}; + +static const audio_plugin_functions dummy_audio = { + dummyaudio_PluginGetVersion, + dummyaudio_AiDacrateChanged, + dummyaudio_AiLenChanged, + dummyaudio_InitiateAudio, + dummyaudio_ProcessAList, + dummyaudio_RomClosed, + dummyaudio_RomOpen, + dummyaudio_SetSpeedFactor, + dummyaudio_VolumeUp, + dummyaudio_VolumeDown, + dummyaudio_VolumeGetLevel, + dummyaudio_VolumeSetLevel, + dummyaudio_VolumeMute, + dummyaudio_VolumeGetString +}; + +static const input_plugin_functions dummy_input = { + dummyinput_PluginGetVersion, + dummyinput_ControllerCommand, + dummyinput_GetKeys, + dummyinput_InitiateControllers, + dummyinput_ReadController, + dummyinput_RomClosed, + dummyinput_RomOpen, + dummyinput_SDL_KeyDown, + dummyinput_SDL_KeyUp +}; + +static const rsp_plugin_functions dummy_rsp = { + dummyrsp_PluginGetVersion, + dummyrsp_DoRspCycles, + dummyrsp_InitiateRSP, + dummyrsp_RomClosed +}; + +static GFX_INFO gfx_info; +static AUDIO_INFO audio_info; +static CONTROL_INFO control_info; +static RSP_INFO rsp_info; + +static int l_RspAttached = 0; +static int l_InputAttached = 0; +static int l_AudioAttached = 0; +static int l_GfxAttached = 0; + +static unsigned int dummy; + +/* local functions */ +static void EmptyFunc(void) +{ +} + +// Handy macro to avoid code bloat when loading symbols +#define GET_FUNC(type, field, name) \ + ((field = (type)osal_dynlib_getproc(plugin_handle, name)) != NULL) + +// code to handle backwards-compatibility to video plugins with API_VERSION < 02.1.0. This API version introduced a boolean +// flag in the rendering callback, which told the core whether or not the current screen has been freshly redrawn since the +// last time the callback was called. +static void (*l_mainRenderCallback)(int) = NULL; +static ptr_SetRenderingCallback l_old1SetRenderingCallback = NULL; + +static void backcompat_videoRenderCallback(int unused) // this function will be called by the video plugin as the render callback +{ + if (l_mainRenderCallback != NULL) + l_mainRenderCallback(1); // assume screen is always freshly redrawn (otherwise screenshots won't work w/ OSD enabled) +} + +static void backcompat_setRenderCallbackIntercept(void (*callback)(int)) +{ + l_mainRenderCallback = callback; +} + +static void plugin_disconnect_gfx(void) +{ + gfx = dummy_gfx; + l_GfxAttached = 0; + l_mainRenderCallback = NULL; +} + +static m64p_error plugin_connect_gfx(m64p_dynlib_handle plugin_handle) +{ + /* attach the Video plugin function pointers */ + if (plugin_handle != NULL) + { + m64p_plugin_type PluginType; + int PluginVersion, APIVersion; + + if (l_GfxAttached) + return M64ERR_INVALID_STATE; + + if (!GET_FUNC(ptr_PluginGetVersion, gfx.getVersion, "PluginGetVersion") || + !GET_FUNC(ptr_ChangeWindow, gfx.changeWindow, "ChangeWindow") || + !GET_FUNC(ptr_InitiateGFX, gfx.initiateGFX, "InitiateGFX") || + !GET_FUNC(ptr_MoveScreen, gfx.moveScreen, "MoveScreen") || + !GET_FUNC(ptr_ProcessDList, gfx.processDList, "ProcessDList") || + !GET_FUNC(ptr_ProcessRDPList, gfx.processRDPList, "ProcessRDPList") || + !GET_FUNC(ptr_RomClosed, gfx.romClosed, "RomClosed") || + !GET_FUNC(ptr_RomOpen, gfx.romOpen, "RomOpen") || + !GET_FUNC(ptr_ShowCFB, gfx.showCFB, "ShowCFB") || + !GET_FUNC(ptr_UpdateScreen, gfx.updateScreen, "UpdateScreen") || + !GET_FUNC(ptr_ViStatusChanged, gfx.viStatusChanged, "ViStatusChanged") || + !GET_FUNC(ptr_ViWidthChanged, gfx.viWidthChanged, "ViWidthChanged") || + !GET_FUNC(ptr_ReadScreen2, gfx.readScreen, "ReadScreen2") || + !GET_FUNC(ptr_SetRenderingCallback, gfx.setRenderingCallback, "SetRenderingCallback") || + !GET_FUNC(ptr_FBRead, gfx.fBRead, "FBRead") || + !GET_FUNC(ptr_FBWrite, gfx.fBWrite, "FBWrite") || + !GET_FUNC(ptr_FBGetFrameBufferInfo, gfx.fBGetFrameBufferInfo, "FBGetFrameBufferInfo")) + { + DebugMessage(M64MSG_ERROR, "broken Video plugin; function(s) not found."); + plugin_disconnect_gfx(); + return M64ERR_INPUT_INVALID; + } + + /* check the version info */ + (*gfx.getVersion)(&PluginType, &PluginVersion, &APIVersion, NULL, NULL); + if (PluginType != M64PLUGIN_GFX || (APIVersion & 0xffff0000) != (GFX_API_VERSION & 0xffff0000)) + { + DebugMessage(M64MSG_ERROR, "incompatible Video plugin"); + plugin_disconnect_gfx(); + return M64ERR_INCOMPATIBLE; + } + + /* handle backwards-compatibility */ + if (APIVersion < 0x020100) + { + DebugMessage(M64MSG_WARNING, "Fallback for Video plugin API (%02i.%02i.%02i) < 2.1.0. Screenshots may contain On Screen Display text", VERSION_PRINTF_SPLIT(APIVersion)); + // tell the video plugin to make its rendering callback to me (it's old, and doesn't have the bScreenRedrawn flag) + gfx.setRenderingCallback(backcompat_videoRenderCallback); + l_old1SetRenderingCallback = gfx.setRenderingCallback; // save this just for future use + gfx.setRenderingCallback = (ptr_SetRenderingCallback) backcompat_setRenderCallbackIntercept; + } + + l_GfxAttached = 1; + } + else + plugin_disconnect_gfx(); + + return M64ERR_SUCCESS; +} + +static m64p_error plugin_start_gfx(void) +{ + /* fill in the GFX_INFO data structure */ + gfx_info.HEADER = (unsigned char *) rom; + gfx_info.RDRAM = (unsigned char *) rdram; + gfx_info.DMEM = (unsigned char *) SP_DMEM; + gfx_info.IMEM = (unsigned char *) SP_IMEM; + gfx_info.MI_INTR_REG = &(MI_register.mi_intr_reg); + gfx_info.DPC_START_REG = &(dpc_register.dpc_start); + gfx_info.DPC_END_REG = &(dpc_register.dpc_end); + gfx_info.DPC_CURRENT_REG = &(dpc_register.dpc_current); + gfx_info.DPC_STATUS_REG = &(dpc_register.dpc_status); + gfx_info.DPC_CLOCK_REG = &(dpc_register.dpc_clock); + gfx_info.DPC_BUFBUSY_REG = &(dpc_register.dpc_bufbusy); + gfx_info.DPC_PIPEBUSY_REG = &(dpc_register.dpc_pipebusy); + gfx_info.DPC_TMEM_REG = &(dpc_register.dpc_tmem); + gfx_info.VI_STATUS_REG = &(vi_register.vi_status); + gfx_info.VI_ORIGIN_REG = &(vi_register.vi_origin); + gfx_info.VI_WIDTH_REG = &(vi_register.vi_width); + gfx_info.VI_INTR_REG = &(vi_register.vi_v_intr); + gfx_info.VI_V_CURRENT_LINE_REG = &(vi_register.vi_current); + gfx_info.VI_TIMING_REG = &(vi_register.vi_burst); + gfx_info.VI_V_SYNC_REG = &(vi_register.vi_v_sync); + gfx_info.VI_H_SYNC_REG = &(vi_register.vi_h_sync); + gfx_info.VI_LEAP_REG = &(vi_register.vi_leap); + gfx_info.VI_H_START_REG = &(vi_register.vi_h_start); + gfx_info.VI_V_START_REG = &(vi_register.vi_v_start); + gfx_info.VI_V_BURST_REG = &(vi_register.vi_v_burst); + gfx_info.VI_X_SCALE_REG = &(vi_register.vi_x_scale); + gfx_info.VI_Y_SCALE_REG = &(vi_register.vi_y_scale); + gfx_info.CheckInterrupts = EmptyFunc; + + /* call the audio plugin */ + if (!gfx.initiateGFX(gfx_info)) + return M64ERR_PLUGIN_FAIL; + + return M64ERR_SUCCESS; +} + +static void plugin_disconnect_audio(void) +{ + audio = dummy_audio; + l_AudioAttached = 0; +} + +static m64p_error plugin_connect_audio(m64p_dynlib_handle plugin_handle) +{ + /* attach the Audio plugin function pointers */ + if (plugin_handle != NULL) + { + m64p_plugin_type PluginType; + int PluginVersion, APIVersion; + + if (l_AudioAttached) + return M64ERR_INVALID_STATE; + + if (!GET_FUNC(ptr_PluginGetVersion, audio.getVersion, "PluginGetVersion") || + !GET_FUNC(ptr_AiDacrateChanged, audio.aiDacrateChanged, "AiDacrateChanged") || + !GET_FUNC(ptr_AiLenChanged, audio.aiLenChanged, "AiLenChanged") || + !GET_FUNC(ptr_InitiateAudio, audio.initiateAudio, "InitiateAudio") || + !GET_FUNC(ptr_ProcessAList, audio.processAList, "ProcessAList") || + !GET_FUNC(ptr_RomOpen, audio.romOpen, "RomOpen") || + !GET_FUNC(ptr_RomClosed, audio.romClosed, "RomClosed") || + !GET_FUNC(ptr_SetSpeedFactor, audio.setSpeedFactor, "SetSpeedFactor") || + !GET_FUNC(ptr_VolumeUp, audio.volumeUp, "VolumeUp") || + !GET_FUNC(ptr_VolumeDown, audio.volumeDown, "VolumeDown") || + !GET_FUNC(ptr_VolumeGetLevel, audio.volumeGetLevel, "VolumeGetLevel") || + !GET_FUNC(ptr_VolumeSetLevel, audio.volumeSetLevel, "VolumeSetLevel") || + !GET_FUNC(ptr_VolumeMute, audio.volumeMute, "VolumeMute") || + !GET_FUNC(ptr_VolumeGetString, audio.volumeGetString, "VolumeGetString")) + { + DebugMessage(M64MSG_ERROR, "broken Audio plugin; function(s) not found."); + plugin_disconnect_audio(); + return M64ERR_INPUT_INVALID; + } + + /* check the version info */ + (*audio.getVersion)(&PluginType, &PluginVersion, &APIVersion, NULL, NULL); + if (PluginType != M64PLUGIN_AUDIO || (APIVersion & 0xffff0000) != (AUDIO_API_VERSION & 0xffff0000)) + { + DebugMessage(M64MSG_ERROR, "incompatible Audio plugin"); + plugin_disconnect_audio(); + return M64ERR_INCOMPATIBLE; + } + + l_AudioAttached = 1; + } + else + plugin_disconnect_audio(); + + return M64ERR_SUCCESS; +} + +static m64p_error plugin_start_audio(void) +{ + /* fill in the AUDIO_INFO data structure */ + audio_info.RDRAM = (unsigned char *) rdram; + audio_info.DMEM = (unsigned char *) SP_DMEM; + audio_info.IMEM = (unsigned char *) SP_IMEM; + audio_info.MI_INTR_REG = &(MI_register.mi_intr_reg); + audio_info.AI_DRAM_ADDR_REG = &(ai_register.ai_dram_addr); + audio_info.AI_LEN_REG = &(ai_register.ai_len); + audio_info.AI_CONTROL_REG = &(ai_register.ai_control); + audio_info.AI_STATUS_REG = &dummy; + audio_info.AI_DACRATE_REG = &(ai_register.ai_dacrate); + audio_info.AI_BITRATE_REG = &(ai_register.ai_bitrate); + audio_info.CheckInterrupts = EmptyFunc; + + /* call the audio plugin */ + if (!audio.initiateAudio(audio_info)) + return M64ERR_PLUGIN_FAIL; + + return M64ERR_SUCCESS; +} + +static void plugin_disconnect_input(void) +{ + input = dummy_input; + l_InputAttached = 0; +} + +static m64p_error plugin_connect_input(m64p_dynlib_handle plugin_handle) +{ + /* attach the Input plugin function pointers */ + if (plugin_handle != NULL) + { + m64p_plugin_type PluginType; + int PluginVersion, APIVersion; + + if (l_InputAttached) + return M64ERR_INVALID_STATE; + + if (!GET_FUNC(ptr_PluginGetVersion, input.getVersion, "PluginGetVersion") || + !GET_FUNC(ptr_ControllerCommand, input.controllerCommand, "ControllerCommand") || + !GET_FUNC(ptr_GetKeys, input.getKeys, "GetKeys") || + !GET_FUNC(ptr_InitiateControllers, input.initiateControllers, "InitiateControllers") || + !GET_FUNC(ptr_ReadController, input.readController, "ReadController") || + !GET_FUNC(ptr_RomOpen, input.romOpen, "RomOpen") || + !GET_FUNC(ptr_RomClosed, input.romClosed, "RomClosed") || + !GET_FUNC(ptr_SDL_KeyDown, input.keyDown, "SDL_KeyDown") || + !GET_FUNC(ptr_SDL_KeyUp, input.keyUp, "SDL_KeyUp")) + { + DebugMessage(M64MSG_ERROR, "broken Input plugin; function(s) not found."); + plugin_disconnect_input(); + return M64ERR_INPUT_INVALID; + } + + /* check the version info */ + (*input.getVersion)(&PluginType, &PluginVersion, &APIVersion, NULL, NULL); + if (PluginType != M64PLUGIN_INPUT || (APIVersion & 0xffff0000) != (INPUT_API_VERSION & 0xffff0000)) + { + DebugMessage(M64MSG_ERROR, "incompatible Input plugin"); + plugin_disconnect_input(); + return M64ERR_INCOMPATIBLE; + } + + l_InputAttached = 1; + } + else + plugin_disconnect_input(); + + return M64ERR_SUCCESS; +} + +static m64p_error plugin_start_input(void) +{ + int i; + + /* fill in the CONTROL_INFO data structure */ + control_info.Controls = Controls; + for (i=0; i<4; i++) + { + Controls[i].Present = 0; + Controls[i].RawData = 0; + Controls[i].Plugin = PLUGIN_NONE; + } + + /* call the input plugin */ + input.initiateControllers(control_info); + + return M64ERR_SUCCESS; +} + +static void plugin_disconnect_rsp(void) +{ + rsp = dummy_rsp; + l_RspAttached = 0; +} + +static m64p_error plugin_connect_rsp(m64p_dynlib_handle plugin_handle) +{ + /* attach the RSP plugin function pointers */ + if (plugin_handle != NULL) + { + m64p_plugin_type PluginType; + int PluginVersion, APIVersion; + + if (l_RspAttached) + return M64ERR_INVALID_STATE; + + if (!GET_FUNC(ptr_PluginGetVersion, rsp.getVersion, "PluginGetVersion") || + !GET_FUNC(ptr_DoRspCycles, rsp.doRspCycles, "DoRspCycles") || + !GET_FUNC(ptr_InitiateRSP, rsp.initiateRSP, "InitiateRSP") || + !GET_FUNC(ptr_RomClosed, rsp.romClosed, "RomClosed")) + { + DebugMessage(M64MSG_ERROR, "broken RSP plugin; function(s) not found."); + plugin_disconnect_rsp(); + return M64ERR_INPUT_INVALID; + } + + /* check the version info */ + (*rsp.getVersion)(&PluginType, &PluginVersion, &APIVersion, NULL, NULL); + if (PluginType != M64PLUGIN_RSP || (APIVersion & 0xffff0000) != (RSP_API_VERSION & 0xffff0000)) + { + DebugMessage(M64MSG_ERROR, "incompatible RSP plugin"); + plugin_disconnect_rsp(); + return M64ERR_INCOMPATIBLE; + } + + l_RspAttached = 1; + } + else + plugin_disconnect_rsp(); + + return M64ERR_SUCCESS; +} + +static m64p_error plugin_start_rsp(void) +{ + /* fill in the RSP_INFO data structure */ + rsp_info.RDRAM = (unsigned char *) rdram; + rsp_info.DMEM = (unsigned char *) SP_DMEM; + rsp_info.IMEM = (unsigned char *) SP_IMEM; + rsp_info.MI_INTR_REG = &MI_register.mi_intr_reg; + rsp_info.SP_MEM_ADDR_REG = &sp_register.sp_mem_addr_reg; + rsp_info.SP_DRAM_ADDR_REG = &sp_register.sp_dram_addr_reg; + rsp_info.SP_RD_LEN_REG = &sp_register.sp_rd_len_reg; + rsp_info.SP_WR_LEN_REG = &sp_register.sp_wr_len_reg; + rsp_info.SP_STATUS_REG = &sp_register.sp_status_reg; + rsp_info.SP_DMA_FULL_REG = &sp_register.sp_dma_full_reg; + rsp_info.SP_DMA_BUSY_REG = &sp_register.sp_dma_busy_reg; + rsp_info.SP_PC_REG = &rsp_register.rsp_pc; + rsp_info.SP_SEMAPHORE_REG = &sp_register.sp_semaphore_reg; + rsp_info.DPC_START_REG = &dpc_register.dpc_start; + rsp_info.DPC_END_REG = &dpc_register.dpc_end; + rsp_info.DPC_CURRENT_REG = &dpc_register.dpc_current; + rsp_info.DPC_STATUS_REG = &dpc_register.dpc_status; + rsp_info.DPC_CLOCK_REG = &dpc_register.dpc_clock; + rsp_info.DPC_BUFBUSY_REG = &dpc_register.dpc_bufbusy; + rsp_info.DPC_PIPEBUSY_REG = &dpc_register.dpc_pipebusy; + rsp_info.DPC_TMEM_REG = &dpc_register.dpc_tmem; + rsp_info.CheckInterrupts = EmptyFunc; + rsp_info.ProcessDlistList = gfx.processDList; + rsp_info.ProcessAlistList = audio.processAList; + rsp_info.ProcessRdpList = gfx.processRDPList; + rsp_info.ShowCFB = gfx.showCFB; + + /* call the RSP plugin */ + rsp.initiateRSP(rsp_info, NULL); + + return M64ERR_SUCCESS; +} + +/* global functions */ +m64p_error plugin_connect(m64p_plugin_type type, m64p_dynlib_handle plugin_handle) +{ + switch(type) + { + case M64PLUGIN_GFX: + if (plugin_handle != NULL && (l_AudioAttached || l_InputAttached || l_RspAttached)) + DebugMessage(M64MSG_WARNING, "Front-end bug: plugins are attached in wrong order."); + return plugin_connect_gfx(plugin_handle); + case M64PLUGIN_AUDIO: + if (plugin_handle != NULL && (l_InputAttached || l_RspAttached)) + DebugMessage(M64MSG_WARNING, "Front-end bug: plugins are attached in wrong order."); + return plugin_connect_audio(plugin_handle); + case M64PLUGIN_INPUT: + if (plugin_handle != NULL && (l_RspAttached)) + DebugMessage(M64MSG_WARNING, "Front-end bug: plugins are attached in wrong order."); + return plugin_connect_input(plugin_handle); + case M64PLUGIN_RSP: + return plugin_connect_rsp(plugin_handle); + default: + return M64ERR_INPUT_INVALID; + } + + return M64ERR_INTERNAL; +} + +m64p_error plugin_start(m64p_plugin_type type) +{ + switch(type) + { + case M64PLUGIN_RSP: + return plugin_start_rsp(); + case M64PLUGIN_GFX: + return plugin_start_gfx(); + case M64PLUGIN_AUDIO: + return plugin_start_audio(); + case M64PLUGIN_INPUT: + return plugin_start_input(); + default: + return M64ERR_INPUT_INVALID; + } + + return M64ERR_INTERNAL; +} + +m64p_error plugin_check(void) +{ + if (!l_GfxAttached) + DebugMessage(M64MSG_WARNING, "No video plugin attached. There will be no video output."); + if (!l_RspAttached) + DebugMessage(M64MSG_WARNING, "No RSP plugin attached. The video output will be corrupted."); + if (!l_AudioAttached) + DebugMessage(M64MSG_WARNING, "No audio plugin attached. There will be no sound output."); + if (!l_InputAttached) + DebugMessage(M64MSG_WARNING, "No input plugin attached. You won't be able to control the game."); + + return M64ERR_SUCCESS; +} + diff --git a/libmupen64plus/mupen64plus-core/src/plugin/plugin.h b/libmupen64plus/mupen64plus-core/src/plugin/plugin.h new file mode 100644 index 0000000000..95669f9dc1 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/plugin/plugin.h @@ -0,0 +1,116 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - plugin.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef PLUGIN_H +#define PLUGIN_H + +#include "api/m64p_common.h" +#include "api/m64p_plugin.h" + +extern m64p_error plugin_connect(m64p_plugin_type, m64p_dynlib_handle plugin_handle); +extern m64p_error plugin_start(m64p_plugin_type); +extern m64p_error plugin_check(void); + +extern CONTROL Controls[4]; + +/*** Version requirement information ***/ +#define RSP_API_VERSION 0x20000 +#define GFX_API_VERSION 0x20100 +#define AUDIO_API_VERSION 0x20000 +#define INPUT_API_VERSION 0x20000 + +/* video plugin function pointers */ +typedef struct _gfx_plugin_functions +{ + ptr_PluginGetVersion getVersion; + ptr_ChangeWindow changeWindow; + ptr_InitiateGFX initiateGFX; + ptr_MoveScreen moveScreen; + ptr_ProcessDList processDList; + ptr_ProcessRDPList processRDPList; + ptr_RomClosed romClosed; + ptr_RomOpen romOpen; + ptr_ShowCFB showCFB; + ptr_UpdateScreen updateScreen; + ptr_ViStatusChanged viStatusChanged; + ptr_ViWidthChanged viWidthChanged; + ptr_ReadScreen2 readScreen; + ptr_SetRenderingCallback setRenderingCallback; + + /* frame buffer plugin spec extension */ + ptr_FBRead fBRead; + ptr_FBWrite fBWrite; + ptr_FBGetFrameBufferInfo fBGetFrameBufferInfo; +} gfx_plugin_functions; + +extern gfx_plugin_functions gfx; + +/* audio plugin function pointers */ +typedef struct _audio_plugin_functions +{ + ptr_PluginGetVersion getVersion; + ptr_AiDacrateChanged aiDacrateChanged; + ptr_AiLenChanged aiLenChanged; + ptr_InitiateAudio initiateAudio; + ptr_ProcessAList processAList; + ptr_RomClosed romClosed; + ptr_RomOpen romOpen; + ptr_SetSpeedFactor setSpeedFactor; + ptr_VolumeUp volumeUp; + ptr_VolumeDown volumeDown; + ptr_VolumeGetLevel volumeGetLevel; + ptr_VolumeSetLevel volumeSetLevel; + ptr_VolumeMute volumeMute; + ptr_VolumeGetString volumeGetString; +} audio_plugin_functions; + +extern audio_plugin_functions audio; + +/* input plugin function pointers */ +typedef struct _input_plugin_functions +{ + ptr_PluginGetVersion getVersion; + ptr_ControllerCommand controllerCommand; + ptr_GetKeys getKeys; + ptr_InitiateControllers initiateControllers; + ptr_ReadController readController; + ptr_RomClosed romClosed; + ptr_RomOpen romOpen; + ptr_SDL_KeyDown keyDown; + ptr_SDL_KeyUp keyUp; +} input_plugin_functions; + +extern input_plugin_functions input; + +/* RSP plugin function pointers */ +typedef struct _rsp_plugin_functions +{ + ptr_PluginGetVersion getVersion; + ptr_DoRspCycles doRspCycles; + ptr_InitiateRSP initiateRSP; + ptr_RomClosed romClosed; +} rsp_plugin_functions; + +extern rsp_plugin_functions rsp; + +#endif + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/empty_dynarec.c b/libmupen64plus/mupen64plus-core/src/r4300/empty_dynarec.c new file mode 100644 index 0000000000..6af34f7cae --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/empty_dynarec.c @@ -0,0 +1,1050 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - empty_dynarec.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Richard42, Nmn * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "recomp.h" + +/* From assemble.c */ + +void init_assembler(void *block_jumps_table, int block_jumps_number, void *block_riprel_table, int block_riprel_number) +{ +} + +void free_assembler(void **block_jumps_table, int *block_jumps_number, void **block_riprel_table, int *block_riprel_number) +{ +} + +void passe2(precomp_instr *dest, int start, int end, precomp_block *block) +{ +} + +/* From gbc.c */ + +void genbc1f() +{ +} + +void genbc1f_out() +{ +} + +void genbc1f_idle() +{ +} + +void genbc1t() +{ +} + +void genbc1t_out() +{ +} + +void genbc1t_idle() +{ +} + +void genbc1fl() +{ +} + +void genbc1fl_out() +{ +} + +void genbc1fl_idle() +{ +} + +void genbc1tl() +{ +} + +void genbc1tl_out() +{ +} + +void genbc1tl_idle() +{ +} + +/* From gcop0.c */ + +void genmfc0() +{ +} + +void genmtc0() +{ +} + +/* From gcop1.c */ + +void genmfc1() +{ +} + +void gendmfc1() +{ +} + +void gencfc1() +{ +} + +void genmtc1() +{ +} + +void gendmtc1() +{ +} + +void genctc1() +{ +} + +/* From gcop1_d.c */ + +void genadd_d() +{ +} + +void gensub_d() +{ +} + +void genmul_d() +{ +} + +void gendiv_d() +{ +} + +void gensqrt_d() +{ +} + +void genabs_d() +{ +} + +void genmov_d() +{ +} + +void genneg_d() +{ +} + +void genround_l_d() +{ +} + +void gentrunc_l_d() +{ +} + +void genceil_l_d() +{ +} + +void genfloor_l_d() +{ +} + +void genround_w_d() +{ +} + +void gentrunc_w_d() +{ +} + +void genceil_w_d() +{ +} + +void genfloor_w_d() +{ +} + +void gencvt_s_d() +{ +} + +void gencvt_w_d() +{ +} + +void gencvt_l_d() +{ +} + +void genc_f_d() +{ +} + +void genc_un_d() +{ +} + +void genc_eq_d() +{ +} + +void genc_ueq_d() +{ +} + +void genc_olt_d() +{ +} + +void genc_ult_d() +{ +} + +void genc_ole_d() +{ +} + +void genc_ule_d() +{ +} + +void genc_sf_d() +{ +} + +void genc_ngle_d() +{ +} + +void genc_seq_d() +{ +} + +void genc_ngl_d() +{ +} + +void genc_lt_d() +{ +} + +void genc_nge_d() +{ +} + +void genc_le_d() +{ +} + +void genc_ngt_d() +{ +} + +/* From gcop1_l.c */ + +void gencvt_s_l() +{ +} + +void gencvt_d_l() +{ +} + +/* From gcop1_s.c */ + +void genadd_s() +{ +} + +void gensub_s() +{ +} + +void genmul_s() +{ +} + +void gendiv_s() +{ +} + +void gensqrt_s() +{ +} + +void genabs_s() +{ +} + +void genmov_s() +{ +} + +void genneg_s() +{ +} + +void genround_l_s() +{ +} + +void gentrunc_l_s() +{ +} + +void genceil_l_s() +{ +} + +void genfloor_l_s() +{ +} + +void genround_w_s() +{ +} + +void gentrunc_w_s() +{ +} + +void genceil_w_s() +{ +} + +void genfloor_w_s() +{ +} + +void gencvt_d_s() +{ +} + +void gencvt_w_s() +{ +} + +void gencvt_l_s() +{ +} + +void genc_f_s() +{ +} + +void genc_un_s() +{ +} + +void genc_eq_s() +{ +} + +void genc_ueq_s() +{ +} + +void genc_olt_s() +{ +} + +void genc_ult_s() +{ +} + +void genc_ole_s() +{ +} + +void genc_ule_s() +{ +} + +void genc_sf_s() +{ +} + +void genc_ngle_s() +{ +} + +void genc_seq_s() +{ +} + +void genc_ngl_s() +{ +} + +void genc_lt_s() +{ +} + +void genc_nge_s() +{ +} + +void genc_le_s() +{ +} + +void genc_ngt_s() +{ +} + +/* From gcop1_w.c */ + +void gencvt_s_w() +{ +} + +void gencvt_d_w() +{ +} + +/* From gr4300.c */ + +void gennotcompiled() +{ +} + +void genlink_subblock() +{ +} + +#ifdef COMPARE_CORE +void gendebug() +{ +} +#endif + +void genni() +{ +} + +void genreserved() +{ +} + +void genfin_block() +{ +} + +void gennop() +{ +} + +void genj() +{ +} + +void genj_out() +{ +} + +void genj_idle() +{ +} + +void genjal() +{ +} + +void genjal_out() +{ +} + +void genjal_idle() +{ +} + +void genbne() +{ +} + +void genbne_out() +{ +} + +void genbne_idle() +{ +} + +void genblez() +{ +} + +void genblez_idle() +{ +} + +void genbgtz() +{ +} + +void genbgtz_out() +{ +} + +void genbgtz_idle() +{ +} + +void genaddi() +{ +} + +void genaddiu() +{ +} + +void genslti() +{ +} + +void gensltiu() +{ +} + +void genandi() +{ +} + +void genori() +{ +} + +void genxori() +{ +} + +void genlui() +{ +} + +void genbeql() +{ +} + +void genbeql_out() +{ +} + +void genbeql_idle() +{ +} + +void genbeq() +{ +} + +void genbeq_out() +{ +} + +void genbeq_idle() +{ +} + +void genbnel() +{ +} + +void genbnel_out() +{ +} + +void genbnel_idle() +{ +} + +void genblezl() +{ +} + +void genblezl_out() +{ +} + +void genblezl_idle() +{ +} + +void genbgtzl() +{ +} + +void genbgtzl_out() +{ +} + +void genbgtzl_idle() +{ +} + +void gendaddi() +{ +} + +void gendaddiu() +{ +} + +void genldl() +{ +} + +void genldr() +{ +} + +void genlb() +{ +} + +void genlh() +{ +} + +void genlwl() +{ +} + +void genlw() +{ +} + +void genlbu() +{ +} + +void genlhu() +{ +} + +void genlwr() +{ +} + +void genlwu() +{ +} + +void gensb() +{ +} + +void gensh() +{ +} + +void genswl() +{ +} + +void gensw() +{ +} + +void gensdl() +{ +} + +void gensdr() +{ +} + +void genswr() +{ +} + +void genlwc1() +{ +} + +void genldc1() +{ +} + +void gencache() +{ +} + +void genld() +{ +} + +void genswc1() +{ +} + +void gensdc1() +{ +} + +void gensd() +{ +} + +void genll() +{ +} + +void gensc() +{ +} + +void genblez_out() +{ +} + +/* From gregimm.c */ + +void genbltz() +{ +} + +void genbltz_out() +{ +} + +void genbltz_idle() +{ +} + +void genbgez() +{ +} + +void genbgez_out() +{ +} + +void genbgez_idle() +{ +} + +void genbltzl() +{ +} + +void genbltzl_out() +{ +} + +void genbltzl_idle() +{ +} + +void genbgezl() +{ +} + +void genbgezl_out() +{ +} + +void genbgezl_idle() +{ +} + +void genbltzal() +{ +} + +void genbltzal_out() +{ +} + +void genbltzal_idle() +{ +} + +void genbgezal() +{ +} + +void genbgezal_out() +{ +} + +void genbgezal_idle() +{ +} + +void genbltzall() +{ +} + +void genbltzall_out() +{ +} + +void genbltzall_idle() +{ +} + +void genbgezall() +{ +} + +void genbgezall_out() +{ +} + +void genbgezall_idle() +{ +} + +/* From gspecial.c */ + +void gensll() +{ +} + +void gensrl() +{ +} + +void gensra() +{ +} + +void gensllv() +{ +} + +void gensrlv() +{ +} + +void gensrav() +{ +} + +void genjr() +{ +} + +void genjalr() +{ +} + +void gensyscall() +{ +} + +void gensync() +{ +} + +void genmfhi() +{ +} + +void genmthi() +{ +} + +void genmflo() +{ +} + +void genmtlo() +{ +} + +void gendsllv() +{ +} + +void gendsrlv() +{ +} + +void gendsrav() +{ +} + +void genmult() +{ +} + +void genmultu() +{ +} + +void gendiv() +{ +} + +void gendivu() +{ +} + +void gendmult() +{ +} + +void gendmultu() +{ +} + +void genddiv() +{ +} + +void genddivu() +{ +} + +void genadd() +{ +} + +void genaddu() +{ +} + +void gensub() +{ +} + +void gensubu() +{ +} + +void genand() +{ +} + +void genor() +{ +} + +void genxor() +{ +} + +void gennor() +{ +} + +void genslt() +{ +} + +void gensltu() +{ +} + +void gendadd() +{ +} + +void gendaddu() +{ +} + +void gendsub() +{ +} + +void gendsubu() +{ +} + +void genteq() +{ +} + +void gendsll() +{ +} + +void gendsrl() +{ +} + +void gendsra() +{ +} + +void gendsll32() +{ +} + +void gendsrl32() +{ +} + +void gendsra32() +{ +} + +/* From gtlb.c */ + +void gentlbwi() +{ +} + +void gentlbp() +{ +} + +void gentlbr() +{ +} + +void generet() +{ +} + +void gentlbwr() +{ +} + +/* From regcache.c */ + +void init_cache(precomp_instr* start) +{ +} + +void free_all_registers() +{ +} + +/* From rjump.c */ + +void dyna_jump() +{ +} + +void dyna_stop() +{ +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/exception.c b/libmupen64plus/mupen64plus-core/src/r4300/exception.c new file mode 100644 index 0000000000..af3e60f96f --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/exception.c @@ -0,0 +1,144 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - exception.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "api/m64p_types.h" +#include "api/callbacks.h" +#include "memory/memory.h" + +#include "exception.h" +#include "r4300.h" +#include "macros.h" +#include "recomph.h" + +void TLB_refill_exception(unsigned int address, int w) +{ + int usual_handler = 0, i; + + if (r4300emu != CORE_DYNAREC && w != 2) update_count(); + if (w == 1) Cause = (3 << 2); + else Cause = (2 << 2); + BadVAddr = address; + Context = (Context & 0xFF80000F) | ((address >> 9) & 0x007FFFF0); + EntryHi = address & 0xFFFFE000; + if (Status & 0x2) // Test de EXL + { + generic_jump_to(0x80000180); + if(delay_slot==1 || delay_slot==3) Cause |= 0x80000000; + else Cause &= 0x7FFFFFFF; + } + else + { + if (r4300emu != CORE_PURE_INTERPRETER) + { + if (w!=2) + EPC = PC->addr; + else + EPC = address; + } + else EPC = PC->addr; + + Cause &= ~0x80000000; + Status |= 0x2; //EXL=1 + + if (address >= 0x80000000 && address < 0xc0000000) + usual_handler = 1; + for (i=0; i<32; i++) + { + if (/*tlb_e[i].v_even &&*/ address >= tlb_e[i].start_even && + address <= tlb_e[i].end_even) + usual_handler = 1; + if (/*tlb_e[i].v_odd &&*/ address >= tlb_e[i].start_odd && + address <= tlb_e[i].end_odd) + usual_handler = 1; + } + if (usual_handler) + { + generic_jump_to(0x80000180); + } + else + { + generic_jump_to(0x80000000); + } + } + if(delay_slot==1 || delay_slot==3) + { + Cause |= 0x80000000; + EPC-=4; + } + else + { + Cause &= 0x7FFFFFFF; + } + if(w != 2) EPC-=4; + + last_addr = PC->addr; + + if (r4300emu == CORE_DYNAREC) + { + dyna_jump(); + if (!dyna_interp) delay_slot = 0; + } + + if (r4300emu != CORE_DYNAREC || dyna_interp) + { + dyna_interp = 0; + if (delay_slot) + { + skip_jump = PC->addr; + next_interupt = 0; + } + } +} + +void exception_general(void) +{ + update_count(); + Status |= 2; + + EPC = PC->addr; + + if(delay_slot==1 || delay_slot==3) + { + Cause |= 0x80000000; + EPC-=4; + } + else + { + Cause &= 0x7FFFFFFF; + } + generic_jump_to(0x80000180); + last_addr = PC->addr; + if (r4300emu == CORE_DYNAREC) + { + dyna_jump(); + if (!dyna_interp) delay_slot = 0; + } + if (r4300emu != CORE_DYNAREC || dyna_interp) + { + dyna_interp = 0; + if (delay_slot) + { + skip_jump = PC->addr; + next_interupt = 0; + } + } +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/exception.h b/libmupen64plus/mupen64plus-core/src/r4300/exception.h new file mode 100644 index 0000000000..2191304d6f --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/exception.h @@ -0,0 +1,29 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - exception.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef EXCEPTION_H +#define EXCEPTION_H + +void TLB_refill_exception(unsigned int addresse, int w); +void exception_general(void); + +#endif //EXCEPTION_H + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/fpu.h b/libmupen64plus/mupen64plus-core/src/r4300/fpu.h new file mode 100644 index 0000000000..e2933bd993 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/fpu.h @@ -0,0 +1,459 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - fpu.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2010 Ari64 * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "r4300.h" + +#ifdef _MSC_VER + #define M64P_FPU_INLINE static __inline + #include + typedef enum { FE_TONEAREST = 0, FE_TOWARDZERO, FE_UPWARD, FE_DOWNWARD } eRoundType; + static void fesetround(eRoundType RoundType) + { + static const unsigned int msRound[4] = { _RC_NEAR, _RC_CHOP, _RC_UP, _RC_DOWN }; + unsigned int oldX87, oldSSE2; + __control87_2(msRound[RoundType], _MCW_RC, &oldX87, &oldSSE2); + } + static __inline double round(double x) { return floor(x + 0.5); } + static __inline float roundf(float x) { return (float) floor(x + 0.5); } + static __inline double trunc(double x) { return (double) (int) x; } + static __inline float truncf(float x) { return (float) (int) x; } + #define isnan _isnan +#else + #define M64P_FPU_INLINE static inline + #include +#endif + + +M64P_FPU_INLINE void set_rounding(void) +{ + switch(rounding_mode) { + case 0x33F: + fesetround(FE_TONEAREST); + break; + case 0xF3F: + fesetround(FE_TOWARDZERO); + break; + case 0xB3F: + fesetround(FE_UPWARD); + break; + case 0x73F: + fesetround(FE_DOWNWARD); + break; + } +} + +M64P_FPU_INLINE void cvt_s_w(int *source,float *dest) +{ + set_rounding(); + *dest = (float) *source; +} +M64P_FPU_INLINE void cvt_d_w(int *source,double *dest) +{ + set_rounding(); + *dest = (double) *source; +} +M64P_FPU_INLINE void cvt_s_l(long long *source,float *dest) +{ + set_rounding(); + *dest = (float) *source; +} +M64P_FPU_INLINE void cvt_d_l(long long *source,double *dest) +{ + set_rounding(); + *dest = (double) *source; +} +M64P_FPU_INLINE void cvt_d_s(float *source,double *dest) +{ + set_rounding(); + *dest = (double) *source; +} +M64P_FPU_INLINE void cvt_s_d(double *source,float *dest) +{ + set_rounding(); + *dest = (float) *source; +} + +M64P_FPU_INLINE void round_l_s(float *source,long long *dest) +{ + *dest = (long long) roundf(*source); +} +M64P_FPU_INLINE void round_w_s(float *source,int *dest) +{ + *dest = (int) roundf(*source); +} +M64P_FPU_INLINE void trunc_l_s(float *source,long long *dest) +{ + *dest = (long long) truncf(*source); +} +M64P_FPU_INLINE void trunc_w_s(float *source,int *dest) +{ + *dest = (int) truncf(*source); +} +M64P_FPU_INLINE void ceil_l_s(float *source,long long *dest) +{ + *dest = (long long) ceilf(*source); +} +M64P_FPU_INLINE void ceil_w_s(float *source,int *dest) +{ + *dest = (int) ceilf(*source); +} +M64P_FPU_INLINE void floor_l_s(float *source,long long *dest) +{ + *dest = (long long) floorf(*source); +} +M64P_FPU_INLINE void floor_w_s(float *source,int *dest) +{ + *dest = (int) floorf(*source); +} + +M64P_FPU_INLINE void round_l_d(double *source,long long *dest) +{ + *dest = (long long) round(*source); +} +M64P_FPU_INLINE void round_w_d(double *source,int *dest) +{ + *dest = (int) round(*source); +} +M64P_FPU_INLINE void trunc_l_d(double *source,long long *dest) +{ + *dest = (long long) trunc(*source); +} +M64P_FPU_INLINE void trunc_w_d(double *source,int *dest) +{ + *dest = (int) trunc(*source); +} +M64P_FPU_INLINE void ceil_l_d(double *source,long long *dest) +{ + *dest = (long long) ceil(*source); +} +M64P_FPU_INLINE void ceil_w_d(double *source,int *dest) +{ + *dest = (int) ceil(*source); +} +M64P_FPU_INLINE void floor_l_d(double *source,long long *dest) +{ + *dest = (long long) floor(*source); +} +M64P_FPU_INLINE void floor_w_d(double *source,int *dest) +{ + *dest = (int) floor(*source); +} + +M64P_FPU_INLINE void cvt_w_s(float *source,int *dest) +{ + set_rounding(); + switch(FCR31&3) + { + case 0: round_w_s(source,dest);return; + case 1: trunc_w_s(source,dest);return; + case 2: ceil_w_s(source,dest);return; + case 3: floor_w_s(source,dest);return; + } +} +M64P_FPU_INLINE void cvt_w_d(double *source,int *dest) +{ + set_rounding(); + switch(FCR31&3) + { + case 0: round_w_d(source,dest);return; + case 1: trunc_w_d(source,dest);return; + case 2: ceil_w_d(source,dest);return; + case 3: floor_w_d(source,dest);return; + } +} +M64P_FPU_INLINE void cvt_l_s(float *source,long long *dest) +{ + set_rounding(); + switch(FCR31&3) + { + case 0: round_l_s(source,dest);return; + case 1: trunc_l_s(source,dest);return; + case 2: ceil_l_s(source,dest);return; + case 3: floor_l_s(source,dest);return; + } +} +M64P_FPU_INLINE void cvt_l_d(double *source,long long *dest) +{ + set_rounding(); + switch(FCR31&3) + { + case 0: round_l_d(source,dest);return; + case 1: trunc_l_d(source,dest);return; + case 2: ceil_l_d(source,dest);return; + case 3: floor_l_d(source,dest);return; + } +} + +M64P_FPU_INLINE void c_f_s() +{ + FCR31 &= ~0x800000; +} +M64P_FPU_INLINE void c_un_s(float *source,float *target) +{ + FCR31=(isnan(*source) || isnan(*target)) ? FCR31|0x800000 : FCR31&~0x800000; +} + +M64P_FPU_INLINE void c_eq_s(float *source,float *target) +{ + if (isnan(*source) || isnan(*target)) {FCR31&=~0x800000;return;} + FCR31 = *source==*target ? FCR31|0x800000 : FCR31&~0x800000; +} +M64P_FPU_INLINE void c_ueq_s(float *source,float *target) +{ + if (isnan(*source) || isnan(*target)) {FCR31|=0x800000;return;} + FCR31 = *source==*target ? FCR31|0x800000 : FCR31&~0x800000; +} + +M64P_FPU_INLINE void c_olt_s(float *source,float *target) +{ + if (isnan(*source) || isnan(*target)) {FCR31&=~0x800000;return;} + FCR31 = *source<*target ? FCR31|0x800000 : FCR31&~0x800000; +} +M64P_FPU_INLINE void c_ult_s(float *source,float *target) +{ + if (isnan(*source) || isnan(*target)) {FCR31|=0x800000;return;} + FCR31 = *source<*target ? FCR31|0x800000 : FCR31&~0x800000; +} + +M64P_FPU_INLINE void c_ole_s(float *source,float *target) +{ + if (isnan(*source) || isnan(*target)) {FCR31&=~0x800000;return;} + FCR31 = *source<=*target ? FCR31|0x800000 : FCR31&~0x800000; +} +M64P_FPU_INLINE void c_ule_s(float *source,float *target) +{ + if (isnan(*source) || isnan(*target)) {FCR31|=0x800000;return;} + FCR31 = *source<=*target ? FCR31|0x800000 : FCR31&~0x800000; +} + +M64P_FPU_INLINE void c_sf_s(float *source,float *target) +{ + //if (isnan(*source) || isnan(*target)) // FIXME - exception + FCR31&=~0x800000; +} +M64P_FPU_INLINE void c_ngle_s(float *source,float *target) +{ + //if (isnan(*source) || isnan(*target)) // FIXME - exception + FCR31&=~0x800000; +} + +M64P_FPU_INLINE void c_seq_s(float *source,float *target) +{ + //if (isnan(*source) || isnan(*target)) // FIXME - exception + FCR31 = *source==*target ? FCR31|0x800000 : FCR31&~0x800000; +} +M64P_FPU_INLINE void c_ngl_s(float *source,float *target) +{ + //if (isnan(*source) || isnan(*target)) // FIXME - exception + FCR31 = *source==*target ? FCR31|0x800000 : FCR31&~0x800000; +} + +M64P_FPU_INLINE void c_lt_s(float *source,float *target) +{ + //if (isnan(*source) || isnan(*target)) // FIXME - exception + FCR31 = *source<*target ? FCR31|0x800000 : FCR31&~0x800000; +} +M64P_FPU_INLINE void c_nge_s(float *source,float *target) +{ + //if (isnan(*source) || isnan(*target)) // FIXME - exception + FCR31 = *source<*target ? FCR31|0x800000 : FCR31&~0x800000; +} + +M64P_FPU_INLINE void c_le_s(float *source,float *target) +{ + //if (isnan(*source) || isnan(*target)) // FIXME - exception + FCR31 = *source<=*target ? FCR31|0x800000 : FCR31&~0x800000; +} +M64P_FPU_INLINE void c_ngt_s(float *source,float *target) +{ + //if (isnan(*source) || isnan(*target)) // FIXME - exception + FCR31 = *source<=*target ? FCR31|0x800000 : FCR31&~0x800000; +} + +M64P_FPU_INLINE void c_f_d() +{ + FCR31 &= ~0x800000; +} +M64P_FPU_INLINE void c_un_d(double *source,double *target) +{ + FCR31=(isnan(*source) || isnan(*target)) ? FCR31|0x800000 : FCR31&~0x800000; +} + +M64P_FPU_INLINE void c_eq_d(double *source,double *target) +{ + if (isnan(*source) || isnan(*target)) {FCR31&=~0x800000;return;} + FCR31 = *source==*target ? FCR31|0x800000 : FCR31&~0x800000; +} +M64P_FPU_INLINE void c_ueq_d(double *source,double *target) +{ + if (isnan(*source) || isnan(*target)) {FCR31|=0x800000;return;} + FCR31 = *source==*target ? FCR31|0x800000 : FCR31&~0x800000; +} + +M64P_FPU_INLINE void c_olt_d(double *source,double *target) +{ + if (isnan(*source) || isnan(*target)) {FCR31&=~0x800000;return;} + FCR31 = *source<*target ? FCR31|0x800000 : FCR31&~0x800000; +} +M64P_FPU_INLINE void c_ult_d(double *source,double *target) +{ + if (isnan(*source) || isnan(*target)) {FCR31|=0x800000;return;} + FCR31 = *source<*target ? FCR31|0x800000 : FCR31&~0x800000; +} + +M64P_FPU_INLINE void c_ole_d(double *source,double *target) +{ + if (isnan(*source) || isnan(*target)) {FCR31&=~0x800000;return;} + FCR31 = *source<=*target ? FCR31|0x800000 : FCR31&~0x800000; +} +M64P_FPU_INLINE void c_ule_d(double *source,double *target) +{ + if (isnan(*source) || isnan(*target)) {FCR31|=0x800000;return;} + FCR31 = *source<=*target ? FCR31|0x800000 : FCR31&~0x800000; +} + +M64P_FPU_INLINE void c_sf_d(double *source,double *target) +{ + //if (isnan(*source) || isnan(*target)) // FIXME - exception + FCR31&=~0x800000; +} +M64P_FPU_INLINE void c_ngle_d(double *source,double *target) +{ + //if (isnan(*source) || isnan(*target)) // FIXME - exception + FCR31&=~0x800000; +} + +M64P_FPU_INLINE void c_seq_d(double *source,double *target) +{ + //if (isnan(*source) || isnan(*target)) // FIXME - exception + FCR31 = *source==*target ? FCR31|0x800000 : FCR31&~0x800000; +} +M64P_FPU_INLINE void c_ngl_d(double *source,double *target) +{ + //if (isnan(*source) || isnan(*target)) // FIXME - exception + FCR31 = *source==*target ? FCR31|0x800000 : FCR31&~0x800000; +} + +M64P_FPU_INLINE void c_lt_d(double *source,double *target) +{ + //if (isnan(*source) || isnan(*target)) // FIXME - exception + FCR31 = *source<*target ? FCR31|0x800000 : FCR31&~0x800000; +} +M64P_FPU_INLINE void c_nge_d(double *source,double *target) +{ + //if (isnan(*source) || isnan(*target)) // FIXME - exception + FCR31 = *source<*target ? FCR31|0x800000 : FCR31&~0x800000; +} + +M64P_FPU_INLINE void c_le_d(double *source,double *target) +{ + //if (isnan(*source) || isnan(*target)) // FIXME - exception + FCR31 = *source<=*target ? FCR31|0x800000 : FCR31&~0x800000; +} +M64P_FPU_INLINE void c_ngt_d(double *source,double *target) +{ + //if (isnan(*source) || isnan(*target)) // FIXME - exception + FCR31 = *source<=*target ? FCR31|0x800000 : FCR31&~0x800000; +} + + +M64P_FPU_INLINE void add_s(float *source1,float *source2,float *target) +{ + set_rounding(); + *target=(*source1)+(*source2); +} +M64P_FPU_INLINE void sub_s(float *source1,float *source2,float *target) +{ + set_rounding(); + *target=(*source1)-(*source2); +} +M64P_FPU_INLINE void mul_s(float *source1,float *source2,float *target) +{ + set_rounding(); + *target=(*source1)*(*source2); +} +M64P_FPU_INLINE void div_s(float *source1,float *source2,float *target) +{ + set_rounding(); + *target=(*source1)/(*source2); +} +M64P_FPU_INLINE void sqrt_s(float *source,float *target) +{ + set_rounding(); + *target=sqrtf(*source); +} +M64P_FPU_INLINE void abs_s(float *source,float *target) +{ + set_rounding(); + *target=fabsf(*source); +} +M64P_FPU_INLINE void mov_s(float *source,float *target) +{ + set_rounding(); + *target=*source; +} +M64P_FPU_INLINE void neg_s(float *source,float *target) +{ + set_rounding(); + *target=-(*source); +} +M64P_FPU_INLINE void add_d(double *source1,double *source2,double *target) +{ + set_rounding(); + *target=(*source1)+(*source2); +} +M64P_FPU_INLINE void sub_d(double *source1,double *source2,double *target) +{ + set_rounding(); + *target=(*source1)-(*source2); +} +M64P_FPU_INLINE void mul_d(double *source1,double *source2,double *target) +{ + set_rounding(); + *target=(*source1)*(*source2); +} +M64P_FPU_INLINE void div_d(double *source1,double *source2,double *target) +{ + set_rounding(); + *target=(*source1)/(*source2); +} +M64P_FPU_INLINE void sqrt_d(double *source,double *target) +{ + set_rounding(); + *target=sqrt(*source); +} +M64P_FPU_INLINE void abs_d(double *source,double *target) +{ + set_rounding(); + *target=fabs(*source); +} +M64P_FPU_INLINE void mov_d(double *source,double *target) +{ + set_rounding(); + *target=*source; +} +M64P_FPU_INLINE void neg_d(double *source,double *target) +{ + set_rounding(); + *target=-(*source); +} diff --git a/libmupen64plus/mupen64plus-core/src/r4300/interpreter.def b/libmupen64plus/mupen64plus-core/src/r4300/interpreter.def new file mode 100644 index 0000000000..d82d67af27 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/interpreter.def @@ -0,0 +1,79 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - interpreter.def * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* Before #including this file, the following macros should be defined: + * + * PCADDR: Program counter (memory address of the current instruction). + * + * ADD_TO_PC(x): Increment the program counter in 'x' instructions. + * This is only used for small changes to PC, so the new program counter + * is guaranteed to fall in the current cached interpreter or dynarec block. + * + * DECLARE_INSTRUCTION(name) + * Declares an instruction function which is not a jump. + * Followed by a block of code. + * + * DECLARE_JUMP(name, destination, condition, link, likely, cop1) + * name is the name of the jump or branch instruction. + * destination is the destination memory address of the jump. + * If condition is nonzero, the jump is taken. + * link is a pointer to a variable where (PC+8) is written unconditionally. + * To avoid linking, pass ®[0] + * If likely is nonzero, the delay slot is only executed if the jump is taken. + * If cop1 is nonzero, a COP1 unusable check will be done. + * + * CHECK_MEMORY(): A snippet to be run after a store instruction, + * to check if the store affected executable blocks. + * The memory address of the store is in the 'address' global. + */ + +DECLARE_INSTRUCTION(NI) +{ + DebugMessage(M64MSG_ERROR, "NI() @ 0x%x", PCADDR); + DebugMessage(M64MSG_ERROR, "opcode not implemented: %x:%x", PCADDR, *fast_mem_access(PCADDR)); + stop=1; +} + +DECLARE_INSTRUCTION(RESERVED) +{ + DebugMessage(M64MSG_ERROR, "reserved opcode: %x:%x", PCADDR, *fast_mem_access(PCADDR)); + stop=1; +} + +// R4300 +#include "interpreter_r4300.def" + +// COP0 +#include "interpreter_cop0.def" + +// COP1 +#include "interpreter_cop1.def" + +// regimm +#include "interpreter_regimm.def" + +// special +#include "interpreter_special.def" + +// TLB +#include "interpreter_tlb.def" + + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/interpreter_cop0.def b/libmupen64plus/mupen64plus-core/src/r4300/interpreter_cop0.def new file mode 100644 index 0000000000..313ec9db44 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/interpreter_cop0.def @@ -0,0 +1,140 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - interpreter_cop0.def * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +DECLARE_INSTRUCTION(MFC0) +{ + switch(PC->f.r.nrd) + { + case 1: + DebugMessage(M64MSG_ERROR, "MFC0 instruction reading un-implemented Random register"); + stop=1; + case 9: // Count + update_count(); + default: + rrt32 = reg_cop0[PC->f.r.nrd]; + sign_extended(rrt); + } + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(MTC0) +{ + switch(PC->f.r.nrd) + { + case 0: // Index + Index = (unsigned int) rrt & 0x8000003F; + if ((Index & 0x3F) > 31) + { + DebugMessage(M64MSG_ERROR, "MTC0 instruction writing Index register with TLB index > 31"); + stop=1; + } + break; + case 1: // Random + break; + case 2: // EntryLo0 + EntryLo0 = (unsigned int) rrt & 0x3FFFFFFF; + break; + case 3: // EntryLo1 + EntryLo1 = (unsigned int) rrt & 0x3FFFFFFF; + break; + case 4: // Context + Context = ((unsigned int) rrt & 0xFF800000) | (Context & 0x007FFFF0); + break; + case 5: // PageMask + PageMask = (unsigned int) rrt & 0x01FFE000; + break; + case 6: // Wired + Wired = (unsigned int) rrt; + Random = 31; + break; + case 8: // BadVAddr + break; + case 9: // Count + update_count(); + interupt_unsafe_state = 1; + if (next_interupt <= Count) gen_interupt(); + interupt_unsafe_state = 0; + debug_count += Count; + translate_event_queue((unsigned int) rrt & 0xFFFFFFFF); + Count = (unsigned int) rrt & 0xFFFFFFFF; + debug_count -= Count; + break; + case 10: // EntryHi + EntryHi = (unsigned int) rrt & 0xFFFFE0FF; + break; + case 11: // Compare + update_count(); + remove_event(COMPARE_INT); + add_interupt_event_count(COMPARE_INT, (unsigned int)rrt); + Compare = (unsigned int) rrt; + Cause = Cause & 0xFFFF7FFF; //Timer interupt is clear + break; + case 12: // Status + if((rrt & 0x04000000) != (Status & 0x04000000)) + { + shuffle_fpr_data(Status, (unsigned int) rrt); + set_fpr_pointers((unsigned int) rrt); + } + Status = (unsigned int) rrt; + update_count(); + ADD_TO_PC(1); + check_interupt(); + interupt_unsafe_state = 1; + if (next_interupt <= Count) gen_interupt(); + interupt_unsafe_state = 0; + ADD_TO_PC(-1); + break; + case 13: // Cause + if (rrt!=0) + { + DebugMessage(M64MSG_ERROR, "MTC0 instruction trying to write Cause register with non-0 value"); + stop = 1; + } + else Cause = (unsigned int) rrt; + break; + case 14: // EPC + EPC = (unsigned int) rrt; + break; + case 15: // PRevID + break; + case 16: // Config + Config = (unsigned int) rrt; + break; + case 18: // WatchLo + WatchLo = (unsigned int) rrt & 0xFFFFFFFF; + break; + case 19: // WatchHi + WatchHi = (unsigned int) rrt & 0xFFFFFFFF; + break; + case 27: // CacheErr + break; + case 28: // TagLo + TagLo = (unsigned int) rrt & 0x0FFFFFC0; + break; + case 29: // TagHi + TagHi =0; + break; + default: + DebugMessage(M64MSG_ERROR, "Unknown MTC0 write: %d", PC->f.r.nrd); + stop=1; + } + ADD_TO_PC(1); +} diff --git a/libmupen64plus/mupen64plus-core/src/r4300/interpreter_cop1.def b/libmupen64plus/mupen64plus-core/src/r4300/interpreter_cop1.def new file mode 100644 index 0000000000..54e2d963fd --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/interpreter_cop1.def @@ -0,0 +1,708 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - interpreter_cop1.def * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "fpu.h" + +DECLARE_JUMP(BC1F, PCADDR + (iimmediate+1)*4, (FCR31 & 0x800000)==0, ®[0], 0, 1) +DECLARE_JUMP(BC1T, PCADDR + (iimmediate+1)*4, (FCR31 & 0x800000)!=0, ®[0], 0, 1) +DECLARE_JUMP(BC1FL, PCADDR + (iimmediate+1)*4, (FCR31 & 0x800000)==0, ®[0], 1, 1) +DECLARE_JUMP(BC1TL, PCADDR + (iimmediate+1)*4, (FCR31 & 0x800000)!=0, ®[0], 1, 1) + +DECLARE_INSTRUCTION(MFC1) +{ + if (check_cop1_unusable()) return; + rrt32 = *((int*)reg_cop1_simple[rfs]); + sign_extended(rrt); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DMFC1) +{ + if (check_cop1_unusable()) return; + rrt = *((long long*)reg_cop1_double[rfs]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(CFC1) +{ + if (check_cop1_unusable()) return; + if (rfs==31) + { + rrt32 = FCR31; + sign_extended(rrt); + } + if (rfs==0) + { + rrt32 = FCR0; + sign_extended(rrt); + } + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(MTC1) +{ + if (check_cop1_unusable()) return; + *((int*)reg_cop1_simple[rfs]) = rrt32; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DMTC1) +{ + if (check_cop1_unusable()) return; + *((long long*)reg_cop1_double[rfs]) = rrt; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(CTC1) +{ + if (check_cop1_unusable()) return; + if (rfs==31) + FCR31 = rrt32; + switch((FCR31 & 3)) + { + case 0: + rounding_mode = 0x33F; // Round to nearest, or to even if equidistant + break; + case 1: + rounding_mode = 0xF3F; // Truncate (toward 0) + break; + case 2: + rounding_mode = 0xB3F; // Round up (toward +infinity) + break; + case 3: + rounding_mode = 0x73F; // Round down (toward -infinity) + break; + } + //if ((FCR31 >> 7) & 0x1F) printf("FPU Exception enabled : %x\n", + // (int)((FCR31 >> 7) & 0x1F)); + ADD_TO_PC(1); +} + +// COP1_D +DECLARE_INSTRUCTION(ADD_D) +{ + if (check_cop1_unusable()) return; + add_d(reg_cop1_double[cffs], reg_cop1_double[cfft], reg_cop1_double[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(SUB_D) +{ + if (check_cop1_unusable()) return; + sub_d(reg_cop1_double[cffs], reg_cop1_double[cfft], reg_cop1_double[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(MUL_D) +{ + if (check_cop1_unusable()) return; + mul_d(reg_cop1_double[cffs], reg_cop1_double[cfft], reg_cop1_double[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DIV_D) +{ + if (check_cop1_unusable()) return; + if((FCR31 & 0x400) && *reg_cop1_double[cfft] == 0) + { + //FCR31 |= 0x8020; + /*FCR31 |= 0x8000; + Cause = 15 << 2; + exception_general();*/ + DebugMessage(M64MSG_ERROR, "DIV_D by 0"); + //return; + } + div_d(reg_cop1_double[cffs], reg_cop1_double[cfft], reg_cop1_double[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(SQRT_D) +{ + if (check_cop1_unusable()) return; + sqrt_d(reg_cop1_double[cffs], reg_cop1_double[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(ABS_D) +{ + if (check_cop1_unusable()) return; + abs_d(reg_cop1_double[cffs], reg_cop1_double[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(MOV_D) +{ + if (check_cop1_unusable()) return; + mov_d(reg_cop1_double[cffs], reg_cop1_double[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(NEG_D) +{ + if (check_cop1_unusable()) return; + neg_d(reg_cop1_double[cffs], reg_cop1_double[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(ROUND_L_D) +{ + if (check_cop1_unusable()) return; + round_l_d(reg_cop1_double[cffs], (long long*)(reg_cop1_double[cffd])); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(TRUNC_L_D) +{ + if (check_cop1_unusable()) return; + trunc_l_d(reg_cop1_double[cffs], (long long*)(reg_cop1_double[cffd])); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(CEIL_L_D) +{ + if (check_cop1_unusable()) return; + ceil_l_d(reg_cop1_double[cffs], (long long*)(reg_cop1_double[cffd])); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(FLOOR_L_D) +{ + if (check_cop1_unusable()) return; + floor_l_d(reg_cop1_double[cffs], (long long*)(reg_cop1_double[cffd])); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(ROUND_W_D) +{ + if (check_cop1_unusable()) return; + round_w_d(reg_cop1_double[cffs], (int*)reg_cop1_simple[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(TRUNC_W_D) +{ + if (check_cop1_unusable()) return; + trunc_w_d(reg_cop1_double[cffs], (int*)reg_cop1_simple[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(CEIL_W_D) +{ + if (check_cop1_unusable()) return; + ceil_w_d(reg_cop1_double[cffs], (int*)reg_cop1_simple[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(FLOOR_W_D) +{ + if (check_cop1_unusable()) return; + floor_w_d(reg_cop1_double[cffs], (int*)reg_cop1_simple[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(CVT_S_D) +{ + if (check_cop1_unusable()) return; + cvt_s_d(reg_cop1_double[cffs], reg_cop1_simple[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(CVT_W_D) +{ + if (check_cop1_unusable()) return; + cvt_w_d(reg_cop1_double[cffs], (int*)reg_cop1_simple[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(CVT_L_D) +{ + if (check_cop1_unusable()) return; + cvt_l_d(reg_cop1_double[cffs], (long long*)(reg_cop1_double[cffd])); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_F_D) +{ + if (check_cop1_unusable()) return; + c_f_d(); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_UN_D) +{ + if (check_cop1_unusable()) return; + c_un_d(reg_cop1_double[cffs], reg_cop1_double[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_EQ_D) +{ + if (check_cop1_unusable()) return; + c_eq_d(reg_cop1_double[cffs], reg_cop1_double[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_UEQ_D) +{ + if (check_cop1_unusable()) return; + c_ueq_d(reg_cop1_double[cffs], reg_cop1_double[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_OLT_D) +{ + if (check_cop1_unusable()) return; + c_olt_d(reg_cop1_double[cffs], reg_cop1_double[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_ULT_D) +{ + if (check_cop1_unusable()) return; + c_ult_d(reg_cop1_double[cffs], reg_cop1_double[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_OLE_D) +{ + if (check_cop1_unusable()) return; + c_ole_d(reg_cop1_double[cffs], reg_cop1_double[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_ULE_D) +{ + if (check_cop1_unusable()) return; + c_ule_d(reg_cop1_double[cffs], reg_cop1_double[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_SF_D) +{ + if (isnan(*reg_cop1_double[cffs]) || isnan(*reg_cop1_double[cfft])) + { + DebugMessage(M64MSG_ERROR, "Invalid operation exception in C opcode"); + stop=1; + } + c_sf_d(reg_cop1_double[cffs], reg_cop1_double[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_NGLE_D) +{ + if (isnan(*reg_cop1_double[cffs]) || isnan(*reg_cop1_double[cfft])) + { + DebugMessage(M64MSG_ERROR, "Invalid operation exception in C opcode"); + stop=1; + } + c_ngle_d(reg_cop1_double[cffs], reg_cop1_double[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_SEQ_D) +{ + if (isnan(*reg_cop1_double[cffs]) || isnan(*reg_cop1_double[cfft])) + { + DebugMessage(M64MSG_ERROR, "Invalid operation exception in C opcode"); + stop=1; + } + c_seq_d(reg_cop1_double[cffs], reg_cop1_double[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_NGL_D) +{ + if (isnan(*reg_cop1_double[cffs]) || isnan(*reg_cop1_double[cfft])) + { + DebugMessage(M64MSG_ERROR, "Invalid operation exception in C opcode"); + stop=1; + } + c_ngl_d(reg_cop1_double[cffs], reg_cop1_double[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_LT_D) +{ + if (check_cop1_unusable()) return; + if (isnan(*reg_cop1_double[cffs]) || isnan(*reg_cop1_double[cfft])) + { + DebugMessage(M64MSG_ERROR, "Invalid operation exception in C opcode"); + stop=1; + } + c_lt_d(reg_cop1_double[cffs], reg_cop1_double[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_NGE_D) +{ + if (check_cop1_unusable()) return; + if (isnan(*reg_cop1_double[cffs]) || isnan(*reg_cop1_double[cfft])) + { + DebugMessage(M64MSG_ERROR, "Invalid operation exception in C opcode"); + stop=1; + } + c_nge_d(reg_cop1_double[cffs], reg_cop1_double[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_LE_D) +{ + if (check_cop1_unusable()) return; + if (isnan(*reg_cop1_double[cffs]) || isnan(*reg_cop1_double[cfft])) + { + DebugMessage(M64MSG_ERROR, "Invalid operation exception in C opcode"); + stop=1; + } + c_le_d(reg_cop1_double[cffs], reg_cop1_double[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_NGT_D) +{ + if (check_cop1_unusable()) return; + if (isnan(*reg_cop1_double[cffs]) || isnan(*reg_cop1_double[cfft])) + { + DebugMessage(M64MSG_ERROR, "Invalid operation exception in C opcode"); + stop=1; + } + c_ngt_d(reg_cop1_double[cffs], reg_cop1_double[cfft]); + ADD_TO_PC(1); +} + +// COP1_L +DECLARE_INSTRUCTION(CVT_S_L) +{ + if (check_cop1_unusable()) return; + cvt_s_l((long long*)(reg_cop1_double[cffs]), reg_cop1_simple[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(CVT_D_L) +{ + if (check_cop1_unusable()) return; + cvt_d_l((long long*)(reg_cop1_double[cffs]), reg_cop1_double[cffd]); + ADD_TO_PC(1); +} + +// COP1_S +DECLARE_INSTRUCTION(ADD_S) +{ + if (check_cop1_unusable()) return; + add_s(reg_cop1_simple[cffs], reg_cop1_simple[cfft], reg_cop1_simple[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(SUB_S) +{ + if (check_cop1_unusable()) return; + sub_s(reg_cop1_simple[cffs], reg_cop1_simple[cfft], reg_cop1_simple[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(MUL_S) +{ + if (check_cop1_unusable()) return; + mul_s(reg_cop1_simple[cffs], reg_cop1_simple[cfft], reg_cop1_simple[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DIV_S) +{ + if (check_cop1_unusable()) return; + if((FCR31 & 0x400) && *reg_cop1_simple[cfft] == 0) + { + DebugMessage(M64MSG_ERROR, "DIV_S by 0"); + } + div_s(reg_cop1_simple[cffs], reg_cop1_simple[cfft], reg_cop1_simple[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(SQRT_S) +{ + if (check_cop1_unusable()) return; + sqrt_s(reg_cop1_simple[cffs], reg_cop1_simple[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(ABS_S) +{ + if (check_cop1_unusable()) return; + abs_s(reg_cop1_simple[cffs], reg_cop1_simple[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(MOV_S) +{ + if (check_cop1_unusable()) return; + mov_s(reg_cop1_simple[cffs], reg_cop1_simple[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(NEG_S) +{ + if (check_cop1_unusable()) return; + neg_s(reg_cop1_simple[cffs], reg_cop1_simple[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(ROUND_L_S) +{ + if (check_cop1_unusable()) return; + round_l_s(reg_cop1_simple[cffs], (long long*)(reg_cop1_double[cffd])); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(TRUNC_L_S) +{ + if (check_cop1_unusable()) return; + trunc_l_s(reg_cop1_simple[cffs], (long long*)(reg_cop1_double[cffd])); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(CEIL_L_S) +{ + if (check_cop1_unusable()) return; + ceil_l_s(reg_cop1_simple[cffs], (long long*)(reg_cop1_double[cffd])); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(FLOOR_L_S) +{ + if (check_cop1_unusable()) return; + floor_l_s(reg_cop1_simple[cffs], (long long*)(reg_cop1_double[cffd])); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(ROUND_W_S) +{ + if (check_cop1_unusable()) return; + round_w_s(reg_cop1_simple[cffs], (int*)reg_cop1_simple[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(TRUNC_W_S) +{ + if (check_cop1_unusable()) return; + trunc_w_s(reg_cop1_simple[cffs], (int*)reg_cop1_simple[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(CEIL_W_S) +{ + if (check_cop1_unusable()) return; + ceil_w_s(reg_cop1_simple[cffs], (int*)reg_cop1_simple[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(FLOOR_W_S) +{ + if (check_cop1_unusable()) return; + floor_w_s(reg_cop1_simple[cffs], (int*)reg_cop1_simple[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(CVT_D_S) +{ + if (check_cop1_unusable()) return; + cvt_d_s(reg_cop1_simple[cffs], reg_cop1_double[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(CVT_W_S) +{ + if (check_cop1_unusable()) return; + cvt_w_s(reg_cop1_simple[cffs], (int*)reg_cop1_simple[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(CVT_L_S) +{ + if (check_cop1_unusable()) return; + cvt_l_s(reg_cop1_simple[cffs], (long long*)(reg_cop1_double[cffd])); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_F_S) +{ + if (check_cop1_unusable()) return; + c_f_s(); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_UN_S) +{ + if (check_cop1_unusable()) return; + c_un_s(reg_cop1_simple[cffs], reg_cop1_simple[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_EQ_S) +{ + if (check_cop1_unusable()) return; + c_eq_s(reg_cop1_simple[cffs], reg_cop1_simple[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_UEQ_S) +{ + if (check_cop1_unusable()) return; + c_ueq_s(reg_cop1_simple[cffs], reg_cop1_simple[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_OLT_S) +{ + if (check_cop1_unusable()) return; + c_olt_s(reg_cop1_simple[cffs], reg_cop1_simple[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_ULT_S) +{ + if (check_cop1_unusable()) return; + c_ult_s(reg_cop1_simple[cffs], reg_cop1_simple[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_OLE_S) +{ + if (check_cop1_unusable()) return; + c_ole_s(reg_cop1_simple[cffs], reg_cop1_simple[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_ULE_S) +{ + if (check_cop1_unusable()) return; + c_ule_s(reg_cop1_simple[cffs], reg_cop1_simple[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_SF_S) +{ + if (check_cop1_unusable()) return; + if (isnan(*reg_cop1_simple[cffs]) || isnan(*reg_cop1_simple[cfft])) + { + DebugMessage(M64MSG_ERROR, "Invalid operation exception in C opcode"); + stop=1; + } + c_sf_s(reg_cop1_simple[cffs], reg_cop1_simple[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_NGLE_S) +{ + if (check_cop1_unusable()) return; + if (isnan(*reg_cop1_simple[cffs]) || isnan(*reg_cop1_simple[cfft])) + { + DebugMessage(M64MSG_ERROR, "Invalid operation exception in C opcode"); + stop=1; + } + c_ngle_s(reg_cop1_simple[cffs], reg_cop1_simple[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_SEQ_S) +{ + if (check_cop1_unusable()) return; + if (isnan(*reg_cop1_simple[cffs]) || isnan(*reg_cop1_simple[cfft])) + { + DebugMessage(M64MSG_ERROR, "Invalid operation exception in C opcode"); + stop=1; + } + c_seq_s(reg_cop1_simple[cffs], reg_cop1_simple[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_NGL_S) +{ + if (check_cop1_unusable()) return; + if (isnan(*reg_cop1_simple[cffs]) || isnan(*reg_cop1_simple[cfft])) + { + DebugMessage(M64MSG_ERROR, "Invalid operation exception in C opcode"); + stop=1; + } + c_ngl_s(reg_cop1_simple[cffs], reg_cop1_simple[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_LT_S) +{ + if (check_cop1_unusable()) return; + if (isnan(*reg_cop1_simple[cffs]) || isnan(*reg_cop1_simple[cfft])) + { + DebugMessage(M64MSG_ERROR, "Invalid operation exception in C opcode"); + stop=1; + } + c_lt_s(reg_cop1_simple[cffs], reg_cop1_simple[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_NGE_S) +{ + if (check_cop1_unusable()) return; + if (isnan(*reg_cop1_simple[cffs]) || isnan(*reg_cop1_simple[cfft])) + { + DebugMessage(M64MSG_ERROR, "Invalid operation exception in C opcode"); + stop=1; + } + c_nge_s(reg_cop1_simple[cffs], reg_cop1_simple[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_LE_S) +{ + if (check_cop1_unusable()) return; + if (isnan(*reg_cop1_simple[cffs]) || isnan(*reg_cop1_simple[cfft])) + { + DebugMessage(M64MSG_ERROR, "Invalid operation exception in C opcode"); + stop=1; + } + c_le_s(reg_cop1_simple[cffs], reg_cop1_simple[cfft]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(C_NGT_S) +{ + if (check_cop1_unusable()) return; + if (isnan(*reg_cop1_simple[cffs]) || isnan(*reg_cop1_simple[cfft])) + { + DebugMessage(M64MSG_ERROR, "Invalid operation exception in C opcode"); + stop=1; + } + c_ngt_s(reg_cop1_simple[cffs], reg_cop1_simple[cfft]); + ADD_TO_PC(1); +} + +// COP1_W +DECLARE_INSTRUCTION(CVT_S_W) +{ + if (check_cop1_unusable()) return; + cvt_s_w((int*)reg_cop1_simple[cffs], reg_cop1_simple[cffd]); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(CVT_D_W) +{ + if (check_cop1_unusable()) return; + cvt_d_w((int*)reg_cop1_simple[cffs], reg_cop1_double[cffd]); + ADD_TO_PC(1); +} diff --git a/libmupen64plus/mupen64plus-core/src/r4300/interpreter_r4300.def b/libmupen64plus/mupen64plus-core/src/r4300/interpreter_r4300.def new file mode 100644 index 0000000000..a78fa63af2 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/interpreter_r4300.def @@ -0,0 +1,800 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - interpreter_r4300.def * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +DECLARE_JUMP(J, (PC->f.j.inst_index<<2) | ((PCADDR+4) & 0xF0000000), 1, ®[0], 0, 0) +DECLARE_JUMP(JAL, (PC->f.j.inst_index<<2) | ((PCADDR+4) & 0xF0000000), 1, ®[31], 0, 0) +DECLARE_JUMP(BEQ, PCADDR + (iimmediate+1)*4, irs == irt, ®[0], 0, 0) +DECLARE_JUMP(BNE, PCADDR + (iimmediate+1)*4, irs != irt, ®[0], 0, 0) +DECLARE_JUMP(BLEZ, PCADDR + (iimmediate+1)*4, irs <= 0, ®[0], 0, 0) +DECLARE_JUMP(BGTZ, PCADDR + (iimmediate+1)*4, irs > 0, ®[0], 0, 0) + +DECLARE_INSTRUCTION(ADDI) +{ + irt32 = irs32 + iimmediate; + sign_extended(irt); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(ADDIU) +{ + irt32 = irs32 + iimmediate; + sign_extended(irt); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(SLTI) +{ + if (irs < iimmediate) irt = 1; + else irt = 0; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(SLTIU) +{ + if ((unsigned long long)irs < (unsigned long long)((long long)iimmediate)) + irt = 1; + else irt = 0; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(ANDI) +{ + irt = irs & (unsigned short)iimmediate; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(ORI) +{ + irt = irs | (unsigned short)iimmediate; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(XORI) +{ + irt = irs ^ (unsigned short)iimmediate; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(LUI) +{ + irt32 = iimmediate << 16; + sign_extended(irt); + ADD_TO_PC(1); +} + +DECLARE_JUMP(BEQL, PCADDR + (iimmediate+1)*4, irs == irt, ®[0], 1, 0) +DECLARE_JUMP(BNEL, PCADDR + (iimmediate+1)*4, irs != irt, ®[0], 1, 0) +DECLARE_JUMP(BLEZL, PCADDR + (iimmediate+1)*4, irs <= 0, ®[0], 1, 0) +DECLARE_JUMP(BGTZL, PCADDR + (iimmediate+1)*4, irs > 0, ®[0], 1, 0) + +DECLARE_INSTRUCTION(DADDI) +{ + irt = irs + iimmediate; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DADDIU) +{ + irt = irs + iimmediate; + ADD_TO_PC(1); +} + +// TODOXXX refactor the following functions to remove the +// lsaddr and lsrpt locals. this may lead to a small speedup too + +DECLARE_INSTRUCTION(LDL) +{ + const unsigned int lsaddr = (unsigned int)(iimmediate + irs32); + long long int *lsrtp = PC->f.i.rt; + unsigned long long int word = 0; + ADD_TO_PC(1); + switch ((lsaddr) & 7) + { + case 0: + address = (unsigned int) lsaddr; + rdword = (unsigned long long *) lsrtp; + read_dword_in_memory(); + break; + case 1: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &word; + read_dword_in_memory(); + if(address) + *lsrtp = (*lsrtp & 0xFF) | (word << 8); + break; + case 2: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &word; + read_dword_in_memory(); + if(address) + *lsrtp = (*lsrtp & 0xFFFF) | (word << 16); + break; + case 3: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &word; + read_dword_in_memory(); + if(address) + *lsrtp = (*lsrtp & 0xFFFFFF) | (word << 24); + break; + case 4: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &word; + read_dword_in_memory(); + if(address) + *lsrtp = (*lsrtp & 0xFFFFFFFF) | (word << 32); + break; + case 5: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &word; + read_dword_in_memory(); + if(address) + *lsrtp = (*lsrtp & 0xFFFFFFFFFFLL) | (word << 40); + break; + case 6: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &word; + read_dword_in_memory(); + if(address) + *lsrtp = (*lsrtp & 0xFFFFFFFFFFFFLL) | (word << 48); + break; + case 7: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &word; + read_dword_in_memory(); + if(address) + *lsrtp = (*lsrtp & 0xFFFFFFFFFFFFFFLL) | (word << 56); + break; + } +} + +DECLARE_INSTRUCTION(LDR) +{ + const unsigned int lsaddr = (unsigned int)(iimmediate + irs32); + long long int *lsrtp = PC->f.i.rt; + unsigned long long int word = 0; + ADD_TO_PC(1); + switch ((lsaddr) & 7) + { + case 0: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &word; + read_dword_in_memory(); + if(address) + *lsrtp = (*lsrtp & 0xFFFFFFFFFFFFFF00LL) | (word >> 56); + break; + case 1: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &word; + read_dword_in_memory(); + if(address) + *lsrtp = (*lsrtp & 0xFFFFFFFFFFFF0000LL) | (word >> 48); + break; + case 2: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &word; + read_dword_in_memory(); + if(address) + *lsrtp = (*lsrtp & 0xFFFFFFFFFF000000LL) | (word >> 40); + break; + case 3: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &word; + read_dword_in_memory(); + if(address) + *lsrtp = (*lsrtp & 0xFFFFFFFF00000000LL) | (word >> 32); + break; + case 4: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &word; + read_dword_in_memory(); + if(address) + *lsrtp = (*lsrtp & 0xFFFFFF0000000000LL) | (word >> 24); + break; + case 5: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &word; + read_dword_in_memory(); + if(address) + *lsrtp = (*lsrtp & 0xFFFF000000000000LL) | (word >> 16); + break; + case 6: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &word; + read_dword_in_memory(); + if(address) + *lsrtp = (*lsrtp & 0xFF00000000000000LL) | (word >> 8); + break; + case 7: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = (unsigned long long *) lsrtp; + read_dword_in_memory(); + break; + } +} + +DECLARE_INSTRUCTION(LB) +{ + const unsigned int lsaddr = (unsigned int)(iimmediate + irs32); + long long int *lsrtp = PC->f.i.rt; + ADD_TO_PC(1); + address = (unsigned int) lsaddr; + rdword = (unsigned long long *) lsrtp; + read_byte_in_memory(); + if (address) + sign_extendedb(*lsrtp); +} + +DECLARE_INSTRUCTION(LH) +{ + const unsigned int lsaddr = (unsigned int)(iimmediate + irs32); + long long int *lsrtp = PC->f.i.rt; + ADD_TO_PC(1); + address = (unsigned int) lsaddr; + rdword = (unsigned long long *) lsrtp; + read_hword_in_memory(); + if (address) + sign_extendedh(*lsrtp); +} + +DECLARE_INSTRUCTION(LWL) +{ + const unsigned int lsaddr = (unsigned int)(iimmediate + irs32); + long long int *lsrtp = PC->f.i.rt; + unsigned long long int word = 0; + ADD_TO_PC(1); + switch ((lsaddr) & 3) + { + case 0: + address = (unsigned int) lsaddr; + rdword = (unsigned long long *) lsrtp; + read_word_in_memory(); + break; + case 1: + address = ((unsigned int) lsaddr) & 0xFFFFFFFC; + rdword = &word; + read_word_in_memory(); + if(address) + *lsrtp = (*lsrtp & 0xFF) | (word << 8); + break; + case 2: + address = ((unsigned int) lsaddr) & 0xFFFFFFFC; + rdword = &word; + read_word_in_memory(); + if(address) + *lsrtp = (*lsrtp & 0xFFFF) | (word << 16); + break; + case 3: + address = ((unsigned int) lsaddr) & 0xFFFFFFFC; + rdword = &word; + read_word_in_memory(); + if(address) + *lsrtp = (*lsrtp & 0xFFFFFF) | (word << 24); + break; + } + if(address) + sign_extended(*lsrtp); +} + +DECLARE_INSTRUCTION(LW) +{ + const unsigned int lsaddr = (unsigned int)(iimmediate + irs32); + long long int *lsrtp = PC->f.i.rt; + ADD_TO_PC(1); + address = (unsigned int) lsaddr; + rdword = (unsigned long long *) lsrtp; + read_word_in_memory(); + if (address) + sign_extended(*lsrtp); +} + +DECLARE_INSTRUCTION(LBU) +{ + const unsigned int lsaddr = (unsigned int)(iimmediate + irs32); + long long int *lsrtp = PC->f.i.rt; + ADD_TO_PC(1); + address = (unsigned int) lsaddr; + rdword = (unsigned long long *) lsrtp; + read_byte_in_memory(); +} + +DECLARE_INSTRUCTION(LHU) +{ + const unsigned int lsaddr = (unsigned int)(iimmediate + irs32); + long long int *lsrtp = PC->f.i.rt; + ADD_TO_PC(1); + address = (unsigned int) lsaddr; + rdword = (unsigned long long *) lsrtp; + read_hword_in_memory(); +} + +DECLARE_INSTRUCTION(LWR) +{ + const unsigned int lsaddr = (unsigned int)(iimmediate + irs32); + long long int *lsrtp = PC->f.i.rt; + unsigned long long int word = 0; + ADD_TO_PC(1); + switch ((lsaddr) & 3) + { + case 0: + address = ((unsigned int) lsaddr) & 0xFFFFFFFC; + rdword = &word; + read_word_in_memory(); + if(address) + *lsrtp = (*lsrtp & 0xFFFFFFFFFFFFFF00LL) | ((word >> 24) & 0xFF); + break; + case 1: + address = ((unsigned int) lsaddr) & 0xFFFFFFFC; + rdword = &word; + read_word_in_memory(); + if(address) + *lsrtp = (*lsrtp & 0xFFFFFFFFFFFF0000LL) | ((word >> 16) & 0xFFFF); + break; + case 2: + address = ((unsigned int) lsaddr) & 0xFFFFFFFC; + rdword = &word; + read_word_in_memory(); + if(address) + *lsrtp = (*lsrtp & 0xFFFFFFFFFF000000LL) | ((word >> 8) & 0XFFFFFF); + break; + case 3: + address = ((unsigned int) lsaddr) & 0xFFFFFFFC; + rdword = (unsigned long long *) lsrtp; + read_word_in_memory(); + if(address) + sign_extended(*lsrtp); + } +} + +DECLARE_INSTRUCTION(LWU) +{ + const unsigned int lsaddr = (unsigned int)(iimmediate + irs32); + long long int *lsrtp = PC->f.i.rt; + ADD_TO_PC(1); + address = (unsigned int) lsaddr; + rdword = (unsigned long long *) lsrtp; + read_word_in_memory(); +} + +DECLARE_INSTRUCTION(SB) +{ + const unsigned int lsaddr = (unsigned int)(iimmediate + irs32); + long long int *lsrtp = PC->f.i.rt; + ADD_TO_PC(1); + address = (unsigned int) lsaddr; + cpu_byte = (unsigned char)(*lsrtp & 0xFF); + write_byte_in_memory(); + CHECK_MEMORY(); +} + +DECLARE_INSTRUCTION(SH) +{ + const unsigned int lsaddr = (unsigned int)(iimmediate + irs32); + long long int *lsrtp = PC->f.i.rt; + ADD_TO_PC(1); + address = (unsigned int) lsaddr; + hword = (unsigned short)(*lsrtp & 0xFFFF); + write_hword_in_memory(); + CHECK_MEMORY(); +} + +DECLARE_INSTRUCTION(SWL) +{ + const unsigned int lsaddr = (unsigned int)(iimmediate + irs32); + long long int *lsrtp = PC->f.i.rt; + unsigned long long int old_word = 0; + ADD_TO_PC(1); + switch ((lsaddr) & 3) + { + case 0: + address = ((unsigned int) lsaddr) & 0xFFFFFFFC; + word = (unsigned int)*lsrtp; + write_word_in_memory(); + CHECK_MEMORY(); + break; + case 1: + address = ((unsigned int) lsaddr) & 0xFFFFFFFC; + rdword = &old_word; + read_word_in_memory(); + if(address) + { + word = ((unsigned int)*lsrtp >> 8) | ((unsigned int) old_word & 0xFF000000); + write_word_in_memory(); + CHECK_MEMORY(); + } + break; + case 2: + address = ((unsigned int) lsaddr) & 0xFFFFFFFC; + rdword = &old_word; + read_word_in_memory(); + if(address) + { + word = ((unsigned int)*lsrtp >> 16) | ((unsigned int) old_word & 0xFFFF0000); + write_word_in_memory(); + CHECK_MEMORY(); + } + break; + case 3: + address = (unsigned int) lsaddr; + cpu_byte = (unsigned char)(*lsrtp >> 24); + write_byte_in_memory(); + CHECK_MEMORY(); + break; + } +} + +DECLARE_INSTRUCTION(SW) +{ + const unsigned int lsaddr = (unsigned int)(iimmediate + irs32); + long long int *lsrtp = PC->f.i.rt; + ADD_TO_PC(1); + address = (unsigned int) lsaddr; + word = (unsigned int)(*lsrtp & 0xFFFFFFFF); + write_word_in_memory(); + CHECK_MEMORY(); +} + +DECLARE_INSTRUCTION(SDL) +{ + const unsigned int lsaddr = (unsigned int)(iimmediate + irs32); + long long int *lsrtp = PC->f.i.rt; + unsigned long long int old_word = 0; + ADD_TO_PC(1); + switch ((lsaddr) & 7) + { + case 0: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + dword = *lsrtp; + write_dword_in_memory(); + CHECK_MEMORY(); + break; + case 1: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &old_word; + read_dword_in_memory(); + if(address) + { + dword = ((unsigned long long)*lsrtp >> 8)|(old_word & 0xFF00000000000000LL); + write_dword_in_memory(); + CHECK_MEMORY(); + } + break; + case 2: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &old_word; + read_dword_in_memory(); + if(address) + { + dword = ((unsigned long long)*lsrtp >> 16)|(old_word & 0xFFFF000000000000LL); + write_dword_in_memory(); + CHECK_MEMORY(); + } + break; + case 3: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &old_word; + read_dword_in_memory(); + if(address) + { + dword = ((unsigned long long)*lsrtp >> 24)|(old_word & 0xFFFFFF0000000000LL); + write_dword_in_memory(); + CHECK_MEMORY(); + } + break; + case 4: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &old_word; + read_dword_in_memory(); + if(address) + { + dword = ((unsigned long long)*lsrtp >> 32)|(old_word & 0xFFFFFFFF00000000LL); + write_dword_in_memory(); + CHECK_MEMORY(); + } + break; + case 5: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &old_word; + read_dword_in_memory(); + if(address) + { + dword = ((unsigned long long)*lsrtp >> 40)|(old_word & 0xFFFFFFFFFF000000LL); + write_dword_in_memory(); + CHECK_MEMORY(); + } + break; + case 6: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &old_word; + read_dword_in_memory(); + if(address) + { + dword = ((unsigned long long)*lsrtp >> 48)|(old_word & 0xFFFFFFFFFFFF0000LL); + write_dword_in_memory(); + CHECK_MEMORY(); + } + break; + case 7: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &old_word; + read_dword_in_memory(); + if(address) + { + dword = ((unsigned long long)*lsrtp >> 56)|(old_word & 0xFFFFFFFFFFFFFF00LL); + write_dword_in_memory(); + CHECK_MEMORY(); + } + break; + } +} + +DECLARE_INSTRUCTION(SDR) +{ + const unsigned int lsaddr = (unsigned int)(iimmediate + irs32); + long long int *lsrtp = PC->f.i.rt; + unsigned long long int old_word = 0; + ADD_TO_PC(1); + switch ((lsaddr) & 7) + { + case 0: + address = (unsigned int) lsaddr; + rdword = &old_word; + read_dword_in_memory(); + if(address) + { + dword = (*lsrtp << 56) | (old_word & 0x00FFFFFFFFFFFFFFLL); + write_dword_in_memory(); + CHECK_MEMORY(); + } + break; + case 1: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &old_word; + read_dword_in_memory(); + if(address) + { + dword = (*lsrtp << 48) | (old_word & 0x0000FFFFFFFFFFFFLL); + write_dword_in_memory(); + CHECK_MEMORY(); + } + break; + case 2: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &old_word; + read_dword_in_memory(); + if(address) + { + dword = (*lsrtp << 40) | (old_word & 0x000000FFFFFFFFFFLL); + write_dword_in_memory(); + CHECK_MEMORY(); + } + break; + case 3: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &old_word; + read_dword_in_memory(); + if(address) + { + dword = (*lsrtp << 32) | (old_word & 0x00000000FFFFFFFFLL); + write_dword_in_memory(); + CHECK_MEMORY(); + } + break; + case 4: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &old_word; + read_dword_in_memory(); + if(address) + { + dword = (*lsrtp << 24) | (old_word & 0x0000000000FFFFFFLL); + write_dword_in_memory(); + CHECK_MEMORY(); + } + break; + case 5: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &old_word; + read_dword_in_memory(); + if(address) + { + dword = (*lsrtp << 16) | (old_word & 0x000000000000FFFFLL); + write_dword_in_memory(); + CHECK_MEMORY(); + } + break; + case 6: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + rdword = &old_word; + read_dword_in_memory(); + if(address) + { + dword = (*lsrtp << 8) | (old_word & 0x00000000000000FFLL); + write_dword_in_memory(); + CHECK_MEMORY(); + } + break; + case 7: + address = ((unsigned int) lsaddr) & 0xFFFFFFF8; + dword = *lsrtp; + write_dword_in_memory(); + CHECK_MEMORY(); + break; + } +} + +DECLARE_INSTRUCTION(SWR) +{ + const unsigned int lsaddr = (unsigned int)(iimmediate + irs32); + long long int *lsrtp = PC->f.i.rt; + unsigned long long int old_word = 0; + ADD_TO_PC(1); + switch ((lsaddr) & 3) + { + case 0: + address = (unsigned int) lsaddr; + rdword = &old_word; + read_word_in_memory(); + if(address) + { + word = ((unsigned int)*lsrtp << 24) | ((unsigned int) old_word & 0x00FFFFFF); + write_word_in_memory(); + CHECK_MEMORY(); + } + break; + case 1: + address = ((unsigned int) lsaddr) & 0xFFFFFFFC; + rdword = &old_word; + read_word_in_memory(); + if(address) + { + word = ((unsigned int)*lsrtp << 16) | ((unsigned int) old_word & 0x0000FFFF); + write_word_in_memory(); + CHECK_MEMORY(); + } + break; + case 2: + address = ((unsigned int) lsaddr) & 0xFFFFFFFC; + rdword = &old_word; + read_word_in_memory(); + if(address) + { + word = ((unsigned int)*lsrtp << 8) | ((unsigned int) old_word & 0x000000FF); + write_word_in_memory(); + CHECK_MEMORY(); + } + break; + case 3: + address = ((unsigned int) lsaddr) & 0xFFFFFFFC; + word = (unsigned int)*lsrtp; + write_word_in_memory(); + CHECK_MEMORY(); + break; + } +} + +DECLARE_INSTRUCTION(CACHE) +{ + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(LL) +{ + const unsigned int lsaddr = (unsigned int)(iimmediate + irs32); + long long int *lsrtp = PC->f.i.rt; + ADD_TO_PC(1); + address = (unsigned int) lsaddr; + rdword = (unsigned long long *) lsrtp; + read_word_in_memory(); + if (address) + { + sign_extended(*lsrtp); + llbit = 1; + } +} + +DECLARE_INSTRUCTION(LWC1) +{ + const unsigned char lslfft = lfft; + const unsigned int lslfaddr = (unsigned int)(lfoffset + reg[lfbase]); + unsigned long long int temp; + if (check_cop1_unusable()) return; + ADD_TO_PC(1); + address = (unsigned int) lslfaddr; + rdword = &temp; + read_word_in_memory(); + if (address) + *((int*)reg_cop1_simple[lslfft]) = (int) *rdword; +} + +DECLARE_INSTRUCTION(LDC1) +{ + const unsigned char lslfft = lfft; + const unsigned int lslfaddr = (unsigned int)(lfoffset + reg[lfbase]); + if (check_cop1_unusable()) return; + ADD_TO_PC(1); + address = (unsigned int) lslfaddr; + rdword = (unsigned long long *)reg_cop1_double[lslfft]; + read_dword_in_memory(); +} + +DECLARE_INSTRUCTION(LD) +{ + const unsigned int lsaddr = (unsigned int)(iimmediate + irs32); + long long int *lsrtp = PC->f.i.rt; + ADD_TO_PC(1); + address = (unsigned int) lsaddr; + rdword = (unsigned long long *) lsrtp; + read_dword_in_memory(); +} + +DECLARE_INSTRUCTION(SC) +{ + const unsigned int lsaddr = (unsigned int)(iimmediate + irs32); + long long int *lsrtp = PC->f.i.rt; + ADD_TO_PC(1); + if(llbit) + { + address = (unsigned int) lsaddr; + word = (unsigned int)(*lsrtp & 0xFFFFFFFF); + write_word_in_memory(); + CHECK_MEMORY(); + llbit = 0; + *lsrtp = 1; + } + else + { + *lsrtp = 0; + } +} + +DECLARE_INSTRUCTION(SWC1) +{ + const unsigned char lslfft = lfft; + const unsigned int lslfaddr = (unsigned int)(lfoffset + reg[lfbase]); + if (check_cop1_unusable()) return; + ADD_TO_PC(1); + address = (unsigned int) lslfaddr; + word = *((int*)reg_cop1_simple[lslfft]); + write_word_in_memory(); + CHECK_MEMORY(); +} + +DECLARE_INSTRUCTION(SDC1) +{ + const unsigned char lslfft = lfft; + const unsigned int lslfaddr = (unsigned int)(lfoffset + reg[lfbase]); + if (check_cop1_unusable()) return; + ADD_TO_PC(1); + address = (unsigned int) lslfaddr; + dword = *((unsigned long long*)reg_cop1_double[lslfft]); + write_dword_in_memory(); + CHECK_MEMORY(); +} + +DECLARE_INSTRUCTION(SD) +{ + const unsigned int lsaddr = (unsigned int)(iimmediate + irs32); + long long int *lsrtp = PC->f.i.rt; + ADD_TO_PC(1); + address = (unsigned int) lsaddr; + dword = *lsrtp; + write_dword_in_memory(); + CHECK_MEMORY(); +} diff --git a/libmupen64plus/mupen64plus-core/src/r4300/interpreter_regimm.def b/libmupen64plus/mupen64plus-core/src/r4300/interpreter_regimm.def new file mode 100644 index 0000000000..ebe97788c1 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/interpreter_regimm.def @@ -0,0 +1,29 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - interpreter_regimm.def * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +DECLARE_JUMP(BLTZ, PCADDR + (iimmediate+1)*4, irs < 0, ®[0], 0, 0) +DECLARE_JUMP(BGEZ, PCADDR + (iimmediate+1)*4, irs >= 0, ®[0], 0, 0) +DECLARE_JUMP(BLTZL, PCADDR + (iimmediate+1)*4, irs < 0, ®[0], 1, 0) +DECLARE_JUMP(BGEZL, PCADDR + (iimmediate+1)*4, irs >= 0, ®[0], 1, 0) +DECLARE_JUMP(BLTZAL, PCADDR + (iimmediate+1)*4, irs < 0, ®[31], 0, 0) +DECLARE_JUMP(BGEZAL, PCADDR + (iimmediate+1)*4, irs >= 0, ®[31], 0, 0) +DECLARE_JUMP(BLTZALL, PCADDR + (iimmediate+1)*4, irs < 0, ®[31], 1, 0) +DECLARE_JUMP(BGEZALL, PCADDR + (iimmediate+1)*4, irs >= 0, ®[31], 1, 0) diff --git a/libmupen64plus/mupen64plus-core/src/r4300/interpreter_special.def b/libmupen64plus/mupen64plus-core/src/r4300/interpreter_special.def new file mode 100644 index 0000000000..79e217ea09 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/interpreter_special.def @@ -0,0 +1,401 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - interpreter_special.def * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +DECLARE_INSTRUCTION(NOP) +{ + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(SLL) +{ + rrd32 = (unsigned int)(rrt32) << rsa; + sign_extended(rrd); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(SRL) +{ + rrd32 = (unsigned int)rrt32 >> rsa; + sign_extended(rrd); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(SRA) +{ + rrd32 = (signed int)rrt32 >> rsa; + sign_extended(rrd); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(SLLV) +{ + rrd32 = (unsigned int)(rrt32) << (rrs32&0x1F); + sign_extended(rrd); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(SRLV) +{ + rrd32 = (unsigned int)rrt32 >> (rrs32 & 0x1F); + sign_extended(rrd); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(SRAV) +{ + rrd32 = (signed int)rrt32 >> (rrs32 & 0x1F); + sign_extended(rrd); + ADD_TO_PC(1); +} + +DECLARE_JUMP(JR, irs32, 1, ®[0], 0, 0) +DECLARE_JUMP(JALR, irs32, 1, PC->f.r.rd, 0, 0) + +DECLARE_INSTRUCTION(SYSCALL) +{ + Cause = 8 << 2; + exception_general(); +} + +DECLARE_INSTRUCTION(SYNC) +{ + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(MFHI) +{ + rrd = hi; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(MTHI) +{ + hi = rrs; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(MFLO) +{ + rrd = lo; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(MTLO) +{ + lo = rrs; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DSLLV) +{ + rrd = rrt << (rrs32&0x3F); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DSRLV) +{ + rrd = (unsigned long long)rrt >> (rrs32 & 0x3F); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DSRAV) +{ + rrd = (long long)rrt >> (rrs32 & 0x3F); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(MULT) +{ + long long int temp; + temp = rrs * rrt; + hi = temp >> 32; + lo = temp; + sign_extended(lo); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(MULTU) +{ + unsigned long long int temp; + temp = (unsigned int)rrs * (unsigned long long)((unsigned int)rrt); + hi = (long long)temp >> 32; + lo = temp; + sign_extended(lo); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DIV) +{ + if (rrt32) + { + lo = rrs32 / rrt32; + hi = rrs32 % rrt32; + sign_extended(lo); + sign_extended(hi); + } + else DebugMessage(M64MSG_ERROR, "DIV: divide by 0"); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DIVU) +{ + if (rrt32) + { + lo = (unsigned int)rrs32 / (unsigned int)rrt32; + hi = (unsigned int)rrs32 % (unsigned int)rrt32; + sign_extended(lo); + sign_extended(hi); + } + else DebugMessage(M64MSG_ERROR, "DIVU: divide by 0"); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DMULT) +{ + unsigned long long int op1, op2, op3, op4; + unsigned long long int result1, result2, result3, result4; + unsigned long long int temp1, temp2, temp3, temp4; + int sign = 0; + + if (rrs < 0) + { + op2 = -rrs; + sign = 1 - sign; + } + else op2 = rrs; + if (rrt < 0) + { + op4 = -rrt; + sign = 1 - sign; + } + else op4 = rrt; + + op1 = op2 & 0xFFFFFFFF; + op2 = (op2 >> 32) & 0xFFFFFFFF; + op3 = op4 & 0xFFFFFFFF; + op4 = (op4 >> 32) & 0xFFFFFFFF; + + temp1 = op1 * op3; + temp2 = (temp1 >> 32) + op1 * op4; + temp3 = op2 * op3; + temp4 = (temp3 >> 32) + op2 * op4; + + result1 = temp1 & 0xFFFFFFFF; + result2 = temp2 + (temp3 & 0xFFFFFFFF); + result3 = (result2 >> 32) + temp4; + result4 = (result3 >> 32); + + lo = result1 | (result2 << 32); + hi = (result3 & 0xFFFFFFFF) | (result4 << 32); + if (sign) + { + hi = ~hi; + if (!lo) hi++; + else lo = ~lo + 1; + } + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DMULTU) +{ + unsigned long long int op1, op2, op3, op4; + unsigned long long int result1, result2, result3, result4; + unsigned long long int temp1, temp2, temp3, temp4; + + op1 = rrs & 0xFFFFFFFF; + op2 = (rrs >> 32) & 0xFFFFFFFF; + op3 = rrt & 0xFFFFFFFF; + op4 = (rrt >> 32) & 0xFFFFFFFF; + + temp1 = op1 * op3; + temp2 = (temp1 >> 32) + op1 * op4; + temp3 = op2 * op3; + temp4 = (temp3 >> 32) + op2 * op4; + + result1 = temp1 & 0xFFFFFFFF; + result2 = temp2 + (temp3 & 0xFFFFFFFF); + result3 = (result2 >> 32) + temp4; + result4 = (result3 >> 32); + + lo = result1 | (result2 << 32); + hi = (result3 & 0xFFFFFFFF) | (result4 << 32); + + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DDIV) +{ + if (rrt) + { + lo = (long long int)rrs / (long long int)rrt; + hi = (long long int)rrs % (long long int)rrt; + } + else DebugMessage(M64MSG_ERROR, "DDIV: divide by 0"); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DDIVU) +{ + if (rrt) + { + lo = (unsigned long long int)rrs / (unsigned long long int)rrt; + hi = (unsigned long long int)rrs % (unsigned long long int)rrt; + } + else DebugMessage(M64MSG_ERROR, "DDIVU: divide by 0"); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(ADD) +{ + rrd32 = rrs32 + rrt32; + sign_extended(rrd); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(ADDU) +{ + rrd32 = rrs32 + rrt32; + sign_extended(rrd); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(SUB) +{ + rrd32 = rrs32 - rrt32; + sign_extended(rrd); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(SUBU) +{ + rrd32 = rrs32 - rrt32; + sign_extended(rrd); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(AND) +{ + rrd = rrs & rrt; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(OR) +{ + rrd = rrs | rrt; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(XOR) +{ + rrd = rrs ^ rrt; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(NOR) +{ + rrd = ~(rrs | rrt); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(SLT) +{ + if (rrs < rrt) rrd = 1; + else rrd = 0; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(SLTU) +{ + if ((unsigned long long)rrs < (unsigned long long)rrt) + rrd = 1; + else rrd = 0; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DADD) +{ + rrd = rrs + rrt; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DADDU) +{ + rrd = rrs + rrt; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DSUB) +{ + rrd = rrs - rrt; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DSUBU) +{ + rrd = rrs - rrt; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(TEQ) +{ + if (rrs == rrt) + { + DebugMessage(M64MSG_ERROR, "trap exception in TEQ"); + stop=1; + } + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DSLL) +{ + rrd = rrt << rsa; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DSRL) +{ + rrd = (unsigned long long)rrt >> rsa; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DSRA) +{ + rrd = rrt >> rsa; + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DSLL32) +{ + rrd = rrt << (32+rsa); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DSRL32) +{ + rrd = (unsigned long long int)rrt >> (32+rsa); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(DSRA32) +{ + rrd = (signed long long int)rrt >> (32+rsa); + ADD_TO_PC(1); +} diff --git a/libmupen64plus/mupen64plus-core/src/r4300/interpreter_tlb.def b/libmupen64plus/mupen64plus-core/src/r4300/interpreter_tlb.def new file mode 100644 index 0000000000..12d3f8971c --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/interpreter_tlb.def @@ -0,0 +1,249 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - interpreter_tlb.def * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include // For adler32() + +DECLARE_INSTRUCTION(TLBR) +{ + int index; + index = Index & 0x1F; + PageMask = tlb_e[index].mask << 13; + EntryHi = ((tlb_e[index].vpn2 << 13) | tlb_e[index].asid); + EntryLo0 = (tlb_e[index].pfn_even << 6) | (tlb_e[index].c_even << 3) + | (tlb_e[index].d_even << 2) | (tlb_e[index].v_even << 1) + | tlb_e[index].g; + EntryLo1 = (tlb_e[index].pfn_odd << 6) | (tlb_e[index].c_odd << 3) + | (tlb_e[index].d_odd << 2) | (tlb_e[index].v_odd << 1) + | tlb_e[index].g; + ADD_TO_PC(1); +} + +static void TLBWrite(unsigned int idx) +{ + if (r4300emu != CORE_PURE_INTERPRETER) + { + unsigned int i; + if (tlb_e[idx].v_even) + { + for (i=tlb_e[idx].start_even>>12; i<=tlb_e[idx].end_even>>12; i++) + { + if(!invalid_code[i] &&(invalid_code[tlb_LUT_r[i]>>12] || + invalid_code[(tlb_LUT_r[i]>>12)+0x20000])) + invalid_code[i] = 1; + if (!invalid_code[i]) + { + /*int j; + md5_state_t state; + md5_byte_t digest[16]; + md5_init(&state); + md5_append(&state, + (const md5_byte_t*)&rdram[(tlb_LUT_r[i]&0x7FF000)/4], + 0x1000); + md5_finish(&state, digest); + for (j=0; j<16; j++) blocks[i]->md5[j] = digest[j];*/ + + blocks[i]->adler32 = adler32(0, (const unsigned char *)&rdram[(tlb_LUT_r[i]&0x7FF000)/4], 0x1000); + + invalid_code[i] = 1; + } + else if (blocks[i]) + { + /*int j; + for (j=0; j<16; j++) blocks[i]->md5[j] = 0;*/ + blocks[i]->adler32 = 0; + } + } + } + if (tlb_e[idx].v_odd) + { + for (i=tlb_e[idx].start_odd>>12; i<=tlb_e[idx].end_odd>>12; i++) + { + if(!invalid_code[i] &&(invalid_code[tlb_LUT_r[i]>>12] || + invalid_code[(tlb_LUT_r[i]>>12)+0x20000])) + invalid_code[i] = 1; + if (!invalid_code[i]) + { + /*int j; + md5_state_t state; + md5_byte_t digest[16]; + md5_init(&state); + md5_append(&state, + (const md5_byte_t*)&rdram[(tlb_LUT_r[i]&0x7FF000)/4], + 0x1000); + md5_finish(&state, digest); + for (j=0; j<16; j++) blocks[i]->md5[j] = digest[j];*/ + + blocks[i]->adler32 = adler32(0, (const unsigned char *)&rdram[(tlb_LUT_r[i]&0x7FF000)/4], 0x1000); + + invalid_code[i] = 1; + } + else if (blocks[i]) + { + /*int j; + for (j=0; j<16; j++) blocks[i]->md5[j] = 0;*/ + blocks[i]->adler32 = 0; + } + } + } + } + + tlb_unmap(&tlb_e[idx]); + + tlb_e[idx].g = (EntryLo0 & EntryLo1 & 1); + tlb_e[idx].pfn_even = (EntryLo0 & 0x3FFFFFC0) >> 6; + tlb_e[idx].pfn_odd = (EntryLo1 & 0x3FFFFFC0) >> 6; + tlb_e[idx].c_even = (EntryLo0 & 0x38) >> 3; + tlb_e[idx].c_odd = (EntryLo1 & 0x38) >> 3; + tlb_e[idx].d_even = (EntryLo0 & 0x4) >> 2; + tlb_e[idx].d_odd = (EntryLo1 & 0x4) >> 2; + tlb_e[idx].v_even = (EntryLo0 & 0x2) >> 1; + tlb_e[idx].v_odd = (EntryLo1 & 0x2) >> 1; + tlb_e[idx].asid = (EntryHi & 0xFF); + tlb_e[idx].vpn2 = (EntryHi & 0xFFFFE000) >> 13; + //tlb_e[idx].r = (EntryHi & 0xC000000000000000LL) >> 62; + tlb_e[idx].mask = (PageMask & 0x1FFE000) >> 13; + + tlb_e[idx].start_even = tlb_e[idx].vpn2 << 13; + tlb_e[idx].end_even = tlb_e[idx].start_even+ + (tlb_e[idx].mask << 12) + 0xFFF; + tlb_e[idx].phys_even = tlb_e[idx].pfn_even << 12; + + + tlb_e[idx].start_odd = tlb_e[idx].end_even+1; + tlb_e[idx].end_odd = tlb_e[idx].start_odd+ + (tlb_e[idx].mask << 12) + 0xFFF; + tlb_e[idx].phys_odd = tlb_e[idx].pfn_odd << 12; + + tlb_map(&tlb_e[idx]); + + if (r4300emu != CORE_PURE_INTERPRETER) + { + unsigned int i; + if (tlb_e[idx].v_even) + { + for (i=tlb_e[idx].start_even>>12; i<=tlb_e[idx].end_even>>12; i++) + { + /*if (blocks[i] && (blocks[i]->md5[0] || blocks[i]->md5[1] || + blocks[i]->md5[2] || blocks[i]->md5[3])) + { + int j; + int equal = 1; + md5_state_t state; + md5_byte_t digest[16]; + md5_init(&state); + md5_append(&state, + (const md5_byte_t*)&rdram[(tlb_LUT_r[i]&0x7FF000)/4], + 0x1000); + md5_finish(&state, digest); + for (j=0; j<16; j++) + if (digest[j] != blocks[i]->md5[j]) + equal = 0; + if (equal) invalid_code[i] = 0; + }*/ + if(blocks[i] && blocks[i]->adler32) + { + if(blocks[i]->adler32 == adler32(0,(const unsigned char *)&rdram[(tlb_LUT_r[i]&0x7FF000)/4],0x1000)) + invalid_code[i] = 0; + } + } + } + + if (tlb_e[idx].v_odd) + { + for (i=tlb_e[idx].start_odd>>12; i<=tlb_e[idx].end_odd>>12; i++) + { + /*if (blocks[i] && (blocks[i]->md5[0] || blocks[i]->md5[1] || + blocks[i]->md5[2] || blocks[i]->md5[3])) + { + int j; + int equal = 1; + md5_state_t state; + md5_byte_t digest[16]; + md5_init(&state); + md5_append(&state, + (const md5_byte_t*)&rdram[(tlb_LUT_r[i]&0x7FF000)/4], + 0x1000); + md5_finish(&state, digest); + for (j=0; j<16; j++) + if (digest[j] != blocks[i]->md5[j]) + equal = 0; + if (equal) invalid_code[i] = 0; + }*/ + if(blocks[i] && blocks[i]->adler32) + { + if(blocks[i]->adler32 == adler32(0,(const unsigned char *)&rdram[(tlb_LUT_r[i]&0x7FF000)/4],0x1000)) + invalid_code[i] = 0; + } + } + } + } +} + +DECLARE_INSTRUCTION(TLBWI) +{ + TLBWrite(Index&0x3F); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(TLBWR) +{ + update_count(); + Random = (Count/2 % (32 - Wired)) + Wired; + TLBWrite(Random); + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(TLBP) +{ + int i; + Index |= 0x80000000; + for (i=0; i<32; i++) + { + if (((tlb_e[i].vpn2 & (~tlb_e[i].mask)) == + (((EntryHi & 0xFFFFE000) >> 13) & (~tlb_e[i].mask))) && + ((tlb_e[i].g) || + (tlb_e[i].asid == (EntryHi & 0xFF)))) + { + Index = i; + break; + } + } + ADD_TO_PC(1); +} + +DECLARE_INSTRUCTION(ERET) +{ + update_count(); + if (Status & 0x4) + { + DebugMessage(M64MSG_ERROR, "error in ERET"); + stop=1; + } + else + { + Status &= ~0x2; + generic_jump_to(EPC); + } + llbit = 0; + check_interupt(); + last_addr = PCADDR; + if (next_interupt <= Count) gen_interupt(); +} diff --git a/libmupen64plus/mupen64plus-core/src/r4300/interupt.c b/libmupen64plus/mupen64plus-core/src/r4300/interupt.c new file mode 100644 index 0000000000..f44da5b995 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/interupt.c @@ -0,0 +1,606 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - interupt.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include + +#define M64P_CORE_PROTOTYPES 1 +#include "api/m64p_types.h" +#include "api/callbacks.h" +#include "api/m64p_vidext.h" +#include "api/vidext.h" +#include "memory/memory.h" +#include "main/rom.h" +#include "main/main.h" +#include "main/savestates.h" +#include "main/cheat.h" +#include "osd/osd.h" +#include "plugin/plugin.h" + +#include "interupt.h" +#include "r4300.h" +#include "macros.h" +#include "exception.h" +#include "reset.h" +#include "new_dynarec/new_dynarec.h" + +#ifdef WITH_LIRC +#include "main/lirc.h" +#endif + +unsigned int next_vi; +int vi_field=0; +static int vi_counter=0; + +int interupt_unsafe_state = 0; + +typedef struct _interupt_queue +{ + int type; + unsigned int count; + struct _interupt_queue *next; +} interupt_queue; + +static interupt_queue *q = NULL; + +static void clear_queue(void) +{ + while(q != NULL) + { + interupt_queue *aux = q->next; + free(q); + q = aux; + } +} + +/*static void print_queue(void) +{ + interupt_queue *aux; + //if (Count < 0x7000000) return; + DebugMessage(M64MSG_INFO, "------------------ 0x%x", (unsigned int)Count); + aux = q; + while (aux != NULL) + { + DebugMessage(M64MSG_INFO, "Count:%x, %x", (unsigned int)aux->count, aux->type); + aux = aux->next; + } +}*/ + +static int SPECIAL_done = 0; + +static int before_event(unsigned int evt1, unsigned int evt2, int type2) +{ + if(evt1 - Count < 0x80000000) + { + if(evt2 - Count < 0x80000000) + { + if((evt1 - Count) < (evt2 - Count)) return 1; + else return 0; + } + else + { + if((Count - evt2) < 0x10000000) + { + switch(type2) + { + case SPECIAL_INT: + if(SPECIAL_done) return 1; + else return 0; + break; + default: + return 0; + } + } + else return 1; + } + } + else return 0; +} + +void add_interupt_event(int type, unsigned int delay) +{ + unsigned int count = Count + delay/**2*/; + int special = 0; + interupt_queue *aux = q; + + if(type == SPECIAL_INT /*|| type == COMPARE_INT*/) special = 1; + if(Count > 0x80000000) SPECIAL_done = 0; + + if (get_event(type)) { + DebugMessage(M64MSG_WARNING, "two events of type 0x%x in interrupt queue", type); + } + + if (q == NULL) + { + q = (interupt_queue *) malloc(sizeof(interupt_queue)); + q->next = NULL; + q->count = count; + q->type = type; + next_interupt = q->count; + //print_queue(); + return; + } + + if(before_event(count, q->count, q->type) && !special) + { + q = (interupt_queue *) malloc(sizeof(interupt_queue)); + q->next = aux; + q->count = count; + q->type = type; + next_interupt = q->count; + //print_queue(); + return; + } + + while (aux->next != NULL && (!before_event(count, aux->next->count, aux->next->type) || special)) + aux = aux->next; + + if (aux->next == NULL) + { + aux->next = (interupt_queue *) malloc(sizeof(interupt_queue)); + aux = aux->next; + aux->next = NULL; + aux->count = count; + aux->type = type; + } + else + { + interupt_queue *aux2; + if (type != SPECIAL_INT) + while(aux->next != NULL && aux->next->count == count) + aux = aux->next; + aux2 = aux->next; + aux->next = (interupt_queue *) malloc(sizeof(interupt_queue)); + aux = aux->next; + aux->next = aux2; + aux->count = count; + aux->type = type; + } +} + +void add_interupt_event_count(int type, unsigned int count) +{ + add_interupt_event(type, (count - Count)/*/2*/); +} + +static void remove_interupt_event(void) +{ + interupt_queue *aux = q->next; + if(q->type == SPECIAL_INT) SPECIAL_done = 1; + free(q); + q = aux; + if (q != NULL && (q->count > Count || (Count - q->count) < 0x80000000)) + next_interupt = q->count; + else + next_interupt = 0; +} + +unsigned int get_event(int type) +{ + interupt_queue *aux = q; + if (q == NULL) return 0; + if (q->type == type) + return q->count; + while (aux->next != NULL && aux->next->type != type) + aux = aux->next; + if (aux->next != NULL) + return aux->next->count; + return 0; +} + +int get_next_event_type(void) +{ + if (q == NULL) return 0; + return q->type; +} + +void remove_event(int type) +{ + interupt_queue *aux = q; + if (q == NULL) return; + if (q->type == type) + { + aux = aux->next; + free(q); + q = aux; + return; + } + while (aux->next != NULL && aux->next->type != type) + aux = aux->next; + if (aux->next != NULL) // it's a type int + { + interupt_queue *aux2 = aux->next->next; + free(aux->next); + aux->next = aux2; + } +} + +void translate_event_queue(unsigned int base) +{ + interupt_queue *aux; + remove_event(COMPARE_INT); + remove_event(SPECIAL_INT); + aux=q; + while (aux != NULL) + { + aux->count = (aux->count - Count)+base; + aux = aux->next; + } + add_interupt_event_count(COMPARE_INT, Compare); + add_interupt_event_count(SPECIAL_INT, 0); +} + +int save_eventqueue_infos(char *buf) +{ + int len = 0; + interupt_queue *aux = q; + if (q == NULL) + { + *((unsigned int*)&buf[0]) = 0xFFFFFFFF; + return 4; + } + while (aux != NULL) + { + memcpy(buf+len , &aux->type , 4); + memcpy(buf+len+4, &aux->count, 4); + len += 8; + aux = aux->next; + } + *((unsigned int*)&buf[len]) = 0xFFFFFFFF; + return len+4; +} + +void load_eventqueue_infos(char *buf) +{ + int len = 0; + clear_queue(); + while (*((unsigned int*)&buf[len]) != 0xFFFFFFFF) + { + int type = *((unsigned int*)&buf[len]); + unsigned int count = *((unsigned int*)&buf[len+4]); + add_interupt_event_count(type, count); + len += 8; + } +} + +void init_interupt(void) +{ + SPECIAL_done = 1; + next_vi = next_interupt = 5000; + vi_register.vi_delay = next_vi; + vi_field = 0; + clear_queue(); + add_interupt_event_count(VI_INT, next_vi); + add_interupt_event_count(SPECIAL_INT, 0); +} + +void check_interupt(void) +{ + if (MI_register.mi_intr_reg & MI_register.mi_intr_mask_reg) + Cause = (Cause | 0x400) & 0xFFFFFF83; + else + Cause &= ~0x400; + if ((Status & 7) != 1) return; + if (Status & Cause & 0xFF00) + { + if(q == NULL) + { + q = (interupt_queue *) malloc(sizeof(interupt_queue)); + q->next = NULL; + q->count = Count; + q->type = CHECK_INT; + } + else + { + interupt_queue* aux = (interupt_queue *) malloc(sizeof(interupt_queue)); + aux->next = q; + aux->count = Count; + aux->type = CHECK_INT; + q = aux; + } + next_interupt = Count; + } +} + +void gen_interupt(void) +{ + if (stop == 1) + { + vi_counter = 0; // debug + dyna_stop(); + } + + if (!interupt_unsafe_state) + { + if (savestates_get_job() == savestates_job_load) + { + savestates_load(); + return; + } + + if (reset_hard_job) + { + reset_hard(); + reset_hard_job = 0; + return; + } + } + + if (skip_jump) + { + unsigned int dest = skip_jump; + skip_jump = 0; + + if (q->count > Count || (Count - q->count) < 0x80000000) + next_interupt = q->count; + else + next_interupt = 0; + + last_addr = dest; + generic_jump_to(dest); + return; + } + + switch(q->type) + { + case SPECIAL_INT: + if (Count > 0x10000000) return; + remove_interupt_event(); + add_interupt_event_count(SPECIAL_INT, 0); + return; + break; + case VI_INT: + if(vi_counter < 60) + { + if (vi_counter == 0) + cheat_apply_cheats(ENTRY_BOOT); + vi_counter++; + } + else + { + cheat_apply_cheats(ENTRY_VI); + } + gfx.updateScreen(); +#ifdef WITH_LIRC + lircCheckInput(); +#endif + SDL_PumpEvents(); + + refresh_stat(); + + // if paused, poll for input events + if(rompause) + { + osd_render(); // draw Paused message in case gfx.updateScreen didn't do it + VidExt_GL_SwapBuffers(); + while(rompause) + { + SDL_Delay(10); + SDL_PumpEvents(); +#ifdef WITH_LIRC + lircCheckInput(); +#endif //WITH_LIRC + } + } + + new_vi(); + if (vi_register.vi_v_sync == 0) vi_register.vi_delay = 500000; + else vi_register.vi_delay = ((vi_register.vi_v_sync + 1)*1500); + next_vi += vi_register.vi_delay; + if (vi_register.vi_status&0x40) vi_field=1-vi_field; + else vi_field=0; + + remove_interupt_event(); + add_interupt_event_count(VI_INT, next_vi); + + MI_register.mi_intr_reg |= 0x08; + if (MI_register.mi_intr_reg & MI_register.mi_intr_mask_reg) + Cause = (Cause | 0x400) & 0xFFFFFF83; + else + return; + if ((Status & 7) != 1) return; + if (!(Status & Cause & 0xFF00)) return; + break; + + case COMPARE_INT: + remove_interupt_event(); + Count+=2; + add_interupt_event_count(COMPARE_INT, Compare); + Count-=2; + + Cause = (Cause | 0x8000) & 0xFFFFFF83; + if ((Status & 7) != 1) return; + if (!(Status & Cause & 0xFF00)) return; + break; + + case CHECK_INT: + remove_interupt_event(); + break; + + case SI_INT: +#ifdef WITH_LIRC + lircCheckInput(); +#endif //WITH_LIRC + SDL_PumpEvents(); + PIF_RAMb[0x3F] = 0x0; + remove_interupt_event(); + MI_register.mi_intr_reg |= 0x02; + si_register.si_stat |= 0x1000; + si_register.si_stat &= ~0x1; + if (MI_register.mi_intr_reg & MI_register.mi_intr_mask_reg) + Cause = (Cause | 0x400) & 0xFFFFFF83; + else + return; + if ((Status & 7) != 1) return; + if (!(Status & Cause & 0xFF00)) return; + break; + + case PI_INT: + remove_interupt_event(); + MI_register.mi_intr_reg |= 0x10; + pi_register.read_pi_status_reg &= ~3; + if (MI_register.mi_intr_reg & MI_register.mi_intr_mask_reg) + Cause = (Cause | 0x400) & 0xFFFFFF83; + else + return; + if ((Status & 7) != 1) return; + if (!(Status & Cause & 0xFF00)) return; + break; + + case AI_INT: + if (ai_register.ai_status & 0x80000000) // full + { + unsigned int ai_event = get_event(AI_INT); + remove_interupt_event(); + ai_register.ai_status &= ~0x80000000; + ai_register.current_delay = ai_register.next_delay; + ai_register.current_len = ai_register.next_len; + add_interupt_event_count(AI_INT, ai_event+ai_register.next_delay); + + MI_register.mi_intr_reg |= 0x04; + if (MI_register.mi_intr_reg & MI_register.mi_intr_mask_reg) + Cause = (Cause | 0x400) & 0xFFFFFF83; + else + return; + if ((Status & 7) != 1) return; + if (!(Status & Cause & 0xFF00)) return; + } + else + { + remove_interupt_event(); + ai_register.ai_status &= ~0x40000000; + + //------- + MI_register.mi_intr_reg |= 0x04; + if (MI_register.mi_intr_reg & MI_register.mi_intr_mask_reg) + Cause = (Cause | 0x400) & 0xFFFFFF83; + else + return; + if ((Status & 7) != 1) return; + if (!(Status & Cause & 0xFF00)) return; + } + break; + + case SP_INT: + remove_interupt_event(); + sp_register.sp_status_reg |= 0x203; + // sp_register.sp_status_reg |= 0x303; + + if (!(sp_register.sp_status_reg & 0x40)) return; // !intr_on_break + MI_register.mi_intr_reg |= 0x01; + if (MI_register.mi_intr_reg & MI_register.mi_intr_mask_reg) + Cause = (Cause | 0x400) & 0xFFFFFF83; + else + return; + if ((Status & 7) != 1) return; + if (!(Status & Cause & 0xFF00)) return; + break; + + case DP_INT: + remove_interupt_event(); + dpc_register.dpc_status &= ~2; + dpc_register.dpc_status |= 0x81; + MI_register.mi_intr_reg |= 0x20; + if (MI_register.mi_intr_reg & MI_register.mi_intr_mask_reg) + Cause = (Cause | 0x400) & 0xFFFFFF83; + else + return; + if ((Status & 7) != 1) return; + if (!(Status & Cause & 0xFF00)) return; + break; + + case HW2_INT: + // Hardware Interrupt 2 -- remove interrupt event from queue + remove_interupt_event(); + // setup r4300 Status flags: reset TS, and SR, set IM2 + Status = (Status & ~0x00380000) | 0x1000; + Cause = (Cause | 0x1000) & 0xFFFFFF83; + /* the exception_general() call below will jump to the interrupt vector (0x80000180) and setup the + * interpreter or dynarec + */ + break; + + case NMI_INT: + // Non Maskable Interrupt -- remove interrupt event from queue + remove_interupt_event(); + // setup r4300 Status flags: reset TS and SR, set BEV, ERL, and SR + Status = (Status & ~0x00380000) | 0x00500004; + Cause = 0x00000000; + // simulate the soft reset code which would run from the PIF ROM + r4300_reset_soft(); + // clear all interrupts, reset interrupt counters back to 0 + Count = 0; + vi_counter = 0; + init_interupt(); + // clear the audio status register so that subsequent write_ai() calls will work properly + ai_register.ai_status = 0; + // set ErrorEPC with the last instruction address + ErrorEPC = PC->addr; + // reset the r4300 internal state + if (r4300emu != CORE_PURE_INTERPRETER) + { + // clear all the compiled instruction blocks and re-initialize + free_blocks(); + init_blocks(); + } + // adjust ErrorEPC if we were in a delay slot, and clear the delay_slot and dyna_interp flags + if(delay_slot==1 || delay_slot==3) + { + ErrorEPC-=4; + } + delay_slot = 0; + dyna_interp = 0; + // set next instruction address to reset vector + last_addr = 0xa4000040; + generic_jump_to(0xa4000040); + return; + + default: + DebugMessage(M64MSG_ERROR, "Unknown interrupt queue event type %.8X.", q->type); + remove_interupt_event(); + break; + } + +#ifdef NEW_DYNAREC + if (r4300emu == CORE_DYNAREC) { + EPC = pcaddr; + pcaddr = 0x80000180; + Status |= 2; + Cause &= 0x7FFFFFFF; + pending_exception=1; + } else { + exception_general(); + } +#else + exception_general(); +#endif + + if (!interupt_unsafe_state) + { + if (savestates_get_job() == savestates_job_save) + { + savestates_save(); + return; + } + } +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/interupt.h b/libmupen64plus/mupen64plus-core/src/r4300/interupt.h new file mode 100644 index 0000000000..519913234e --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/interupt.h @@ -0,0 +1,57 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - interupt.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +void compare_interupt(void); +void gen_dp(void); +void init_interupt(void); + +extern int vi_field; +extern unsigned int next_vi; + +// set to avoid savestates/reset if state may be inconsistent +// (e.g. in the middle of an instruction) +extern int interupt_unsafe_state; + +void gen_interupt(void); +void check_interupt(void); + +void translate_event_queue(unsigned int base); +void remove_event(int type); +void add_interupt_event_count(int type, unsigned int count); +void add_interupt_event(int type, unsigned int delay); +unsigned int get_event(int type); +int get_next_event_type(void); + +int save_eventqueue_infos(char *buf); +void load_eventqueue_infos(char *buf); + +#define VI_INT 0x001 +#define COMPARE_INT 0x002 +#define CHECK_INT 0x004 +#define SI_INT 0x008 +#define PI_INT 0x010 +#define SPECIAL_INT 0x020 +#define AI_INT 0x040 +#define SP_INT 0x080 +#define DP_INT 0x100 +#define HW2_INT 0x200 +#define NMI_INT 0x400 + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/macros.h b/libmupen64plus/mupen64plus-core/src/r4300/macros.h new file mode 100644 index 0000000000..80a3f24133 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/macros.h @@ -0,0 +1,90 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - macros.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef MACROS_H +#define MACROS_H + +#define sign_extended(a) a = (long long)((int)a) +#define sign_extendedb(a) a = (long long)((signed char)a) +#define sign_extendedh(a) a = (long long)((short)a) + +#define rrt *PC->f.r.rt +#define rrd *PC->f.r.rd +#define rfs PC->f.r.nrd +#define rrs *PC->f.r.rs +#define rsa PC->f.r.sa +#define irt *PC->f.i.rt +#define ioffset PC->f.i.immediate +#define iimmediate PC->f.i.immediate +#define irs *PC->f.i.rs +#define ibase *PC->f.i.rs +#define jinst_index PC->f.j.inst_index +#define lfbase PC->f.lf.base +#define lfft PC->f.lf.ft +#define lfoffset PC->f.lf.offset +#define cfft PC->f.cf.ft +#define cffs PC->f.cf.fs +#define cffd PC->f.cf.fd + +// 32 bits macros +#ifndef M64P_BIG_ENDIAN +#define rrt32 *((int*)PC->f.r.rt) +#define rrd32 *((int*)PC->f.r.rd) +#define rrs32 *((int*)PC->f.r.rs) +#define irs32 *((int*)PC->f.i.rs) +#define irt32 *((int*)PC->f.i.rt) +#else +#define rrt32 *((int*)PC->f.r.rt+1) +#define rrd32 *((int*)PC->f.r.rd+1) +#define rrs32 *((int*)PC->f.r.rs+1) +#define irs32 *((int*)PC->f.i.rs+1) +#define irt32 *((int*)PC->f.i.rt+1) +#endif + +//cop0 macros +#define Index reg_cop0[0] +#define Random reg_cop0[1] +#define EntryLo0 reg_cop0[2] +#define EntryLo1 reg_cop0[3] +#define Context reg_cop0[4] +#define PageMask reg_cop0[5] +#define Wired reg_cop0[6] +#define BadVAddr reg_cop0[8] +#define Count reg_cop0[9] +#define EntryHi reg_cop0[10] +#define Compare reg_cop0[11] +#define Status reg_cop0[12] +#define Cause reg_cop0[13] +#define EPC reg_cop0[14] +#define PRevID reg_cop0[15] +#define Config reg_cop0[16] +#define LLAddr reg_cop0[17] +#define WatchLo reg_cop0[18] +#define WatchHi reg_cop0[19] +#define XContext reg_cop0[20] +#define PErr reg_cop0[26] +#define CacheErr reg_cop0[27] +#define TagLo reg_cop0[28] +#define TagHi reg_cop0[29] +#define ErrorEPC reg_cop0[30] + +#endif + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/assem_arm.c b/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/assem_arm.c new file mode 100644 index 0000000000..5b3948380a --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/assem_arm.c @@ -0,0 +1,4568 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - assem_arm.c * + * Copyright (C) 2009-2011 Ari64 * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +extern int cycle_count; +extern int last_count; +extern int pcaddr; +extern int pending_exception; +extern int branch_target; +extern int ram_offset; +extern uint64_t readmem_dword; +extern precomp_instr fake_pc; +extern void *dynarec_local; +extern u_int memory_map[1048576]; +extern u_int mini_ht[32][2]; +extern u_int rounding_modes[4]; + +static u_int literals[1024][2]; + +void indirect_jump_indexed(); +void indirect_jump(); +void do_interrupt(); +void jump_vaddr(); +void jump_vaddr_r0(); +void jump_vaddr_r1(); +void jump_vaddr_r2(); +void jump_vaddr_r3(); +void jump_vaddr_r4(); +void jump_vaddr_r5(); +void jump_vaddr_r6(); +void jump_vaddr_r7(); +void jump_vaddr_r8(); +void jump_vaddr_r9(); +void jump_vaddr_r10(); +void jump_vaddr_r12(); + +const u_int jump_vaddr_reg[16] = { + (int)jump_vaddr_r0, + (int)jump_vaddr_r1, + (int)jump_vaddr_r2, + (int)jump_vaddr_r3, + (int)jump_vaddr_r4, + (int)jump_vaddr_r5, + (int)jump_vaddr_r6, + (int)jump_vaddr_r7, + (int)jump_vaddr_r8, + (int)jump_vaddr_r9, + (int)jump_vaddr_r10, + 0, + (int)jump_vaddr_r12, + 0, + 0, + 0}; + +void invalidate_addr_r0(); +void invalidate_addr_r1(); +void invalidate_addr_r2(); +void invalidate_addr_r3(); +void invalidate_addr_r4(); +void invalidate_addr_r5(); +void invalidate_addr_r6(); +void invalidate_addr_r7(); +void invalidate_addr_r8(); +void invalidate_addr_r9(); +void invalidate_addr_r10(); +void invalidate_addr_r12(); + +const u_int invalidate_addr_reg[16] = { + (int)invalidate_addr_r0, + (int)invalidate_addr_r1, + (int)invalidate_addr_r2, + (int)invalidate_addr_r3, + (int)invalidate_addr_r4, + (int)invalidate_addr_r5, + (int)invalidate_addr_r6, + (int)invalidate_addr_r7, + (int)invalidate_addr_r8, + (int)invalidate_addr_r9, + (int)invalidate_addr_r10, + 0, + (int)invalidate_addr_r12, + 0, + 0, + 0}; + +#include "../fpu.h" + +static u_int jump_table_symbols[] = { + (int)invalidate_addr, + (int)jump_vaddr, + (int)dyna_linker, + (int)dyna_linker_ds, + (int)verify_code, + (int)verify_code_vm, + (int)verify_code_ds, + (int)cc_interrupt, + (int)fp_exception, + (int)fp_exception_ds, + (int)jump_syscall, + (int)jump_eret, + (int)indirect_jump_indexed, + (int)indirect_jump, + (int)do_interrupt, + (int)NULL /*MFC0*/, + (int)NULL /*MTC0*/, + (int)NULL /*TLBR*/, + (int)NULL /*TLBP*/, + (int)TLBWI_new, + (int)TLBWR_new, + (int)jump_vaddr_r0, + (int)jump_vaddr_r1, + (int)jump_vaddr_r2, + (int)jump_vaddr_r3, + (int)jump_vaddr_r4, + (int)jump_vaddr_r5, + (int)jump_vaddr_r6, + (int)jump_vaddr_r7, + (int)jump_vaddr_r8, + (int)jump_vaddr_r9, + (int)jump_vaddr_r10, + (int)jump_vaddr_r12, + (int)invalidate_addr_r0, + (int)invalidate_addr_r1, + (int)invalidate_addr_r2, + (int)invalidate_addr_r3, + (int)invalidate_addr_r4, + (int)invalidate_addr_r5, + (int)invalidate_addr_r6, + (int)invalidate_addr_r7, + (int)invalidate_addr_r8, + (int)invalidate_addr_r9, + (int)invalidate_addr_r10, + (int)invalidate_addr_r12, + (int)mult64, + (int)multu64, + (int)div64, + (int)divu64, + (int)cvt_s_w, + (int)cvt_d_w, + (int)cvt_s_l, + (int)cvt_d_l, + (int)cvt_w_s, + (int)cvt_w_d, + (int)cvt_l_s, + (int)cvt_l_d, + (int)cvt_d_s, + (int)cvt_s_d, + (int)round_l_s, + (int)round_w_s, + (int)trunc_l_s, + (int)trunc_w_s, + (int)ceil_l_s, + (int)ceil_w_s, + (int)floor_l_s, + (int)floor_w_s, + (int)round_l_d, + (int)round_w_d, + (int)trunc_l_d, + (int)trunc_w_d, + (int)ceil_l_d, + (int)ceil_w_d, + (int)floor_l_d, + (int)floor_w_d, + (int)c_f_s, + (int)c_un_s, + (int)c_eq_s, + (int)c_ueq_s, + (int)c_olt_s, + (int)c_ult_s, + (int)c_ole_s, + (int)c_ule_s, + (int)c_sf_s, + (int)c_ngle_s, + (int)c_seq_s, + (int)c_ngl_s, + (int)c_lt_s, + (int)c_nge_s, + (int)c_le_s, + (int)c_ngt_s, + (int)c_f_d, + (int)c_un_d, + (int)c_eq_d, + (int)c_ueq_d, + (int)c_olt_d, + (int)c_ult_d, + (int)c_ole_d, + (int)c_ule_d, + (int)c_sf_d, + (int)c_ngle_d, + (int)c_seq_d, + (int)c_ngl_d, + (int)c_lt_d, + (int)c_nge_d, + (int)c_le_d, + (int)c_ngt_d, + (int)add_s, + (int)sub_s, + (int)mul_s, + (int)div_s, + (int)sqrt_s, + (int)abs_s, + (int)mov_s, + (int)neg_s, + (int)add_d, + (int)sub_d, + (int)mul_d, + (int)div_d, + (int)sqrt_d, + (int)abs_d, + (int)mov_d, + (int)neg_d +}; + +static unsigned int needs_clear_cache[1<<(TARGET_SIZE_2-17)]; + +#define JUMP_TABLE_SIZE (sizeof(jump_table_symbols)*2) + +/* Linker */ + +static void set_jump_target(int addr,u_int target) +{ + u_char *ptr=(u_char *)addr; + u_int *ptr2=(u_int *)ptr; + if(ptr[3]==0xe2) { + assert((target-(u_int)ptr2-8)<1024); + assert((addr&3)==0); + assert((target&3)==0); + *ptr2=(*ptr2&0xFFFFF000)|((target-(u_int)ptr2-8)>>2)|0xF00; + //DebugMessage(M64MSG_VERBOSE, "target=%x addr=%x insn=%x",target,addr,*ptr2); + } + else if(ptr[3]==0x72) { + // generated by emit_jno_unlikely + if((target-(u_int)ptr2-8)<1024) { + assert((addr&3)==0); + assert((target&3)==0); + *ptr2=(*ptr2&0xFFFFF000)|((target-(u_int)ptr2-8)>>2)|0xF00; + } + else if((target-(u_int)ptr2-8)<4096&&!((target-(u_int)ptr2-8)&15)) { + assert((addr&3)==0); + assert((target&3)==0); + *ptr2=(*ptr2&0xFFFFF000)|((target-(u_int)ptr2-8)>>4)|0xE00; + } + else *ptr2=(0x7A000000)|(((target-(u_int)ptr2-8)<<6)>>8); + } + else { + assert((ptr[3]&0x0e)==0xa); + *ptr2=(*ptr2&0xFF000000)|(((target-(u_int)ptr2-8)<<6)>>8); + } +} + +// This optionally copies the instruction from the target of the branch into +// the space before the branch. Works, but the difference in speed is +// usually insignificant. +/* +static void set_jump_target_fillslot(int addr,u_int target,int copy) +{ + u_char *ptr=(u_char *)addr; + u_int *ptr2=(u_int *)ptr; + assert(!copy||ptr2[-1]==0xe28dd000); + if(ptr[3]==0xe2) { + assert(!copy); + assert((target-(u_int)ptr2-8)<4096); + *ptr2=(*ptr2&0xFFFFF000)|(target-(u_int)ptr2-8); + } + else { + assert((ptr[3]&0x0e)==0xa); + u_int target_insn=*(u_int *)target; + if((target_insn&0x0e100000)==0) { // ALU, no immediate, no flags + copy=0; + } + if((target_insn&0x0c100000)==0x04100000) { // Load + copy=0; + } + if(target_insn&0x08000000) { + copy=0; + } + if(copy) { + ptr2[-1]=target_insn; + target+=4; + } + *ptr2=(*ptr2&0xFF000000)|(((target-(u_int)ptr2-8)<<6)>>8); + } +} +*/ + +/* Literal pool */ +static void add_literal(int addr,int val) +{ + literals[literalcount][0]=addr; + literals[literalcount][1]=val; + literalcount++; +} + +static void *kill_pointer(void *stub) +{ + int *ptr=(int *)(stub+4); + assert((*ptr&0x0ff00000)==0x05900000); + u_int offset=*ptr&0xfff; + int **l_ptr=(void *)ptr+offset+8; + int *i_ptr=*l_ptr; + set_jump_target((int)i_ptr,(int)stub); + return i_ptr; +} + +static int get_pointer(void *stub) +{ + //DebugMessage(M64MSG_VERBOSE, "get_pointer(%x)",(int)stub); + int *ptr=(int *)(stub+4); + assert((*ptr&0x0ff00000)==0x05900000); + u_int offset=*ptr&0xfff; + int **l_ptr=(void *)ptr+offset+8; + int *i_ptr=*l_ptr; + assert((*i_ptr&0x0f000000)==0x0a000000); + return (int)i_ptr+((*i_ptr<<8)>>6)+8; +} + +// Find the "clean" entry point from a "dirty" entry point +// by skipping past the call to verify_code +static u_int get_clean_addr(int addr) +{ + int *ptr=(int *)addr; + #ifdef ARMv5_ONLY + ptr+=4; + #else + ptr+=6; + #endif + if((*ptr&0xFF000000)!=0xeb000000) ptr++; + assert((*ptr&0xFF000000)==0xeb000000); // bl instruction + ptr++; + if((*ptr&0xFF000000)==0xea000000) { + return (int)ptr+((*ptr<<8)>>6)+8; // follow jump + } + return (u_int)ptr; +} + +static int verify_dirty(void *addr) +{ + u_int *ptr=(u_int *)addr; + #ifdef ARMv5_ONLY + // get from literal pool + assert((*ptr&0xFFF00000)==0xe5900000); + u_int offset=*ptr&0xfff; + u_int *l_ptr=(void *)ptr+offset+8; + u_int source=l_ptr[0]; + u_int copy=l_ptr[1]; + u_int len=l_ptr[2]; + ptr+=4; + #else + // ARMv7 movw/movt + assert((*ptr&0xFFF00000)==0xe3000000); + u_int source=(ptr[0]&0xFFF)+((ptr[0]>>4)&0xF000)+((ptr[2]<<16)&0xFFF0000)+((ptr[2]<<12)&0xF0000000); + u_int copy=(ptr[1]&0xFFF)+((ptr[1]>>4)&0xF000)+((ptr[3]<<16)&0xFFF0000)+((ptr[3]<<12)&0xF0000000); + u_int len=(ptr[4]&0xFFF)+((ptr[4]>>4)&0xF000); + ptr+=6; + #endif + if((*ptr&0xFF000000)!=0xeb000000) ptr++; + assert((*ptr&0xFF000000)==0xeb000000); // bl instruction + u_int verifier=(int)ptr+((signed int)(*ptr<<8)>>6)+8; // get target of bl + if(verifier==(u_int)verify_code_vm||verifier==(u_int)verify_code_ds) { + unsigned int page=source>>12; + unsigned int map_value=memory_map[page]; + if(map_value>=0x80000000) return 0; + while(page<((source+len-1)>>12)) { + if((memory_map[++page]<<2)!=(map_value<<2)) return 0; + } + source = source+(map_value<<2); + } + //DebugMessage(M64MSG_VERBOSE, "verify_dirty: %x %x %x",source,copy,len); + return !memcmp((void *)source,(void *)copy,len); +} + +// This doesn't necessarily find all clean entry points, just +// guarantees that it's not dirty +static int isclean(int addr) +{ + #ifdef ARMv5_ONLY + int *ptr=((u_int *)addr)+4; + #else + int *ptr=((u_int *)addr)+6; + #endif + if((*ptr&0xFF000000)!=0xeb000000) ptr++; + if((*ptr&0xFF000000)!=0xeb000000) return 1; // bl instruction + if((int)ptr+((*ptr<<8)>>6)+8==(int)verify_code) return 0; + if((int)ptr+((*ptr<<8)>>6)+8==(int)verify_code_vm) return 0; + if((int)ptr+((*ptr<<8)>>6)+8==(int)verify_code_ds) return 0; + return 1; +} + +static void get_bounds(int addr,u_int *start,u_int *end) +{ + u_int *ptr=(u_int *)addr; + #ifdef ARMv5_ONLY + // get from literal pool + assert((*ptr&0xFFF00000)==0xe5900000); + u_int offset=*ptr&0xfff; + u_int *l_ptr=(void *)ptr+offset+8; + u_int source=l_ptr[0]; + //u_int copy=l_ptr[1]; + u_int len=l_ptr[2]; + ptr+=4; + #else + // ARMv7 movw/movt + assert((*ptr&0xFFF00000)==0xe3000000); + u_int source=(ptr[0]&0xFFF)+((ptr[0]>>4)&0xF000)+((ptr[2]<<16)&0xFFF0000)+((ptr[2]<<12)&0xF0000000); + //u_int copy=(ptr[1]&0xFFF)+((ptr[1]>>4)&0xF000)+((ptr[3]<<16)&0xFFF0000)+((ptr[3]<<12)&0xF0000000); + u_int len=(ptr[4]&0xFFF)+((ptr[4]>>4)&0xF000); + ptr+=6; + #endif + if((*ptr&0xFF000000)!=0xeb000000) ptr++; + assert((*ptr&0xFF000000)==0xeb000000); // bl instruction + u_int verifier=(int)ptr+((signed int)(*ptr<<8)>>6)+8; // get target of bl + if(verifier==(u_int)verify_code_vm||verifier==(u_int)verify_code_ds) { + if(memory_map[source>>12]>=0x80000000) source = 0; + else source = source+(memory_map[source>>12]<<2); + } + *start=source; + *end=source+len; +} + +/* Register allocation */ + +// Note: registers are allocated clean (unmodified state) +// if you intend to modify the register, you must call dirty_reg(). +static void alloc_reg(struct regstat *cur,int i,signed char reg) +{ + int r,hr; + int preferred_reg = (reg&7); + if(reg==CCREG) preferred_reg=HOST_CCREG; + if(reg==PTEMP||reg==FTEMP) preferred_reg=12; + + // Don't allocate unused registers + if((cur->u>>reg)&1) return; + + // see if it's already allocated + for(hr=0;hrregmap[hr]==reg) return; + } + + // Keep the same mapping if the register was already allocated in a loop + preferred_reg = loop_reg(i,reg,preferred_reg); + + // Try to allocate the preferred register + if(cur->regmap[preferred_reg]==-1) { + cur->regmap[preferred_reg]=reg; + cur->dirty&=~(1<isconst&=~(1<regmap[preferred_reg]; + if(r<64&&((cur->u>>r)&1)) { + cur->regmap[preferred_reg]=reg; + cur->dirty&=~(1<isconst&=~(1<=64&&((cur->uu>>(r&63))&1)) { + cur->regmap[preferred_reg]=reg; + cur->dirty&=~(1<isconst&=~(1<regmap[hr]; + if(r>=0) { + if(r<64) { + if((cur->u>>r)&1) {cur->regmap[hr]=-1;break;} + } + else + { + if((cur->uu>>(r&63))&1) {cur->regmap[hr]=-1;break;} + } + } + } + // Try to allocate any available register, but prefer + // registers that have not been used recently. + if(i>0) { + for(hr=0;hrregmap[hr]==-1) { + if(regs[i-1].regmap[hr]!=rs1[i-1]&®s[i-1].regmap[hr]!=rs2[i-1]&®s[i-1].regmap[hr]!=rt1[i-1]&®s[i-1].regmap[hr]!=rt2[i-1]) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<regmap[hr]==-1) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<regmap[0],cur->regmap[1],cur->regmap[2],cur->regmap[3],cur->regmap[5],cur->regmap[6],cur->regmap[7]); + //DebugMessage(M64MSG_VERBOSE, "hsn(%x): %d %d %d %d %d %d %d",start+i*4,hsn[cur->regmap[0]&63],hsn[cur->regmap[1]&63],hsn[cur->regmap[2]&63],hsn[cur->regmap[3]&63],hsn[cur->regmap[5]&63],hsn[cur->regmap[6]&63],hsn[cur->regmap[7]&63]); + if(i>0) { + // Don't evict the cycle count at entry points, otherwise the entry + // stub will have to write it. + if(bt[i]&&hsn[CCREG]>2) hsn[CCREG]=2; + if(i>1&&hsn[CCREG]>2&&(itype[i-2]==RJUMP||itype[i-2]==UJUMP||itype[i-2]==CJUMP||itype[i-2]==SJUMP||itype[i-2]==FJUMP)) hsn[CCREG]=2; + for(j=10;j>=3;j--) + { + // Alloc preferred register if available + if(hsn[r=cur->regmap[preferred_reg]&63]==j) { + for(hr=0;hrregmap[hr]&63)==r) { + cur->regmap[hr]=-1; + cur->dirty&=~(1<isconst&=~(1<regmap[preferred_reg]=reg; + return; + } + for(r=1;r<=MAXREG;r++) + { + if(hsn[r]==j&&r!=rs1[i-1]&&r!=rs2[i-1]&&r!=rt1[i-1]&&r!=rt2[i-1]) { + for(hr=0;hrregmap[hr]==r+64) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<regmap[hr]==r) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<=0;j--) + { + for(r=1;r<=MAXREG;r++) + { + if(hsn[r]==j) { + for(hr=0;hrregmap[hr]==r+64) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<regmap[hr]==r) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<uu>>reg)&1) return; + + // see if the upper half is already allocated + for(hr=0;hrregmap[hr]==reg+64) return; + } + + // Keep the same mapping if the register was already allocated in a loop + preferred_reg = loop_reg(i,reg,preferred_reg); + + // Try to allocate the preferred register + if(cur->regmap[preferred_reg]==-1) { + cur->regmap[preferred_reg]=reg|64; + cur->dirty&=~(1<isconst&=~(1<regmap[preferred_reg]; + if(r<64&&((cur->u>>r)&1)) { + cur->regmap[preferred_reg]=reg|64; + cur->dirty&=~(1<isconst&=~(1<=64&&((cur->uu>>(r&63))&1)) { + cur->regmap[preferred_reg]=reg|64; + cur->dirty&=~(1<isconst&=~(1<=0;hr--) + { + r=cur->regmap[hr]; + if(r>=0) { + if(r<64) { + if((cur->u>>r)&1) {cur->regmap[hr]=-1;break;} + } + else + { + if((cur->uu>>(r&63))&1) {cur->regmap[hr]=-1;break;} + } + } + } + // Try to allocate any available register, but prefer + // registers that have not been used recently. + if(i>0) { + for(hr=0;hrregmap[hr]==-1) { + if(regs[i-1].regmap[hr]!=rs1[i-1]&®s[i-1].regmap[hr]!=rs2[i-1]&®s[i-1].regmap[hr]!=rt1[i-1]&®s[i-1].regmap[hr]!=rt2[i-1]) { + cur->regmap[hr]=reg|64; + cur->dirty&=~(1<isconst&=~(1<regmap[hr]==-1) { + cur->regmap[hr]=reg|64; + cur->dirty&=~(1<isconst&=~(1<regmap[0],cur->regmap[1],cur->regmap[2],cur->regmap[3],cur->regmap[5],cur->regmap[6],cur->regmap[7]); + //DebugMessage(M64MSG_VERBOSE, "hsn(%x): %d %d %d %d %d %d %d",start+i*4,hsn[cur->regmap[0]&63],hsn[cur->regmap[1]&63],hsn[cur->regmap[2]&63],hsn[cur->regmap[3]&63],hsn[cur->regmap[5]&63],hsn[cur->regmap[6]&63],hsn[cur->regmap[7]&63]); + if(i>0) { + // Don't evict the cycle count at entry points, otherwise the entry + // stub will have to write it. + if(bt[i]&&hsn[CCREG]>2) hsn[CCREG]=2; + if(i>1&&hsn[CCREG]>2&&(itype[i-2]==RJUMP||itype[i-2]==UJUMP||itype[i-2]==CJUMP||itype[i-2]==SJUMP||itype[i-2]==FJUMP)) hsn[CCREG]=2; + for(j=10;j>=3;j--) + { + // Alloc preferred register if available + if(hsn[r=cur->regmap[preferred_reg]&63]==j) { + for(hr=0;hrregmap[hr]&63)==r) { + cur->regmap[hr]=-1; + cur->dirty&=~(1<isconst&=~(1<regmap[preferred_reg]=reg|64; + return; + } + for(r=1;r<=MAXREG;r++) + { + if(hsn[r]==j&&r!=rs1[i-1]&&r!=rs2[i-1]&&r!=rt1[i-1]&&r!=rt2[i-1]) { + for(hr=0;hrregmap[hr]==r+64) { + cur->regmap[hr]=reg|64; + cur->dirty&=~(1<isconst&=~(1<regmap[hr]==r) { + cur->regmap[hr]=reg|64; + cur->dirty&=~(1<isconst&=~(1<=0;j--) + { + for(r=1;r<=MAXREG;r++) + { + if(hsn[r]==j) { + for(hr=0;hrregmap[hr]==r+64) { + cur->regmap[hr]=reg|64; + cur->dirty&=~(1<isconst&=~(1<regmap[hr]==r) { + cur->regmap[hr]=reg|64; + cur->dirty&=~(1<isconst&=~(1<regmap[hr]==reg) return; + } + + // Try to allocate any available register + for(hr=HOST_REGS-1;hr>=0;hr--) { + if(hr!=EXCLUDE_REG&&cur->regmap[hr]==-1) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<=0;hr--) + { + r=cur->regmap[hr]; + if(r>=0) { + if(r<64) { + if((cur->u>>r)&1) { + if(i==0||((unneeded_reg[i-1]>>r)&1)) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<uu>>(r&63))&1) { + if(i==0||((unneeded_reg_upper[i-1]>>(r&63))&1)) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<regmap[0]&63],hsn[cur->regmap[1]&63],hsn[cur->regmap[2]&63],hsn[cur->regmap[3]&63],hsn[cur->regmap[5]&63],hsn[cur->regmap[6]&63],hsn[cur->regmap[7]&63]); + if(i>0) { + // Don't evict the cycle count at entry points, otherwise the entry + // stub will have to write it. + if(bt[i]&&hsn[CCREG]>2) hsn[CCREG]=2; + if(i>1&&hsn[CCREG]>2&&(itype[i-2]==RJUMP||itype[i-2]==UJUMP||itype[i-2]==CJUMP||itype[i-2]==SJUMP||itype[i-2]==FJUMP)) hsn[CCREG]=2; + for(j=10;j>=3;j--) + { + for(r=1;r<=MAXREG;r++) + { + if(hsn[r]==j&&r!=rs1[i-1]&&r!=rs2[i-1]&&r!=rt1[i-1]&&r!=rt2[i-1]) { + for(hr=0;hr2) { + if(cur->regmap[hr]==r+64) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<2) { + if(cur->regmap[hr]==r) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<=0;j--) + { + for(r=1;r<=MAXREG;r++) + { + if(hsn[r]==j) { + for(hr=0;hrregmap[hr]==r+64) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<regmap[hr]==r) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<regmap[n]==reg) { + dirty=(cur->dirty>>n)&1; + cur->regmap[n]=-1; + } + } + + cur->regmap[hr]=reg; + cur->dirty&=~(1<dirty|=dirty<isconst&=~(1<0) + { + if(imm<256) { + *encoded=((i&30)<<7)|imm; + return 1; + } + imm=(imm>>2)|(imm<<30);i-=2; + } + return 0; +} +static u_int genjmp(u_int addr) +{ + if(addr<4) return 0; + int offset=addr-(int)out-8; + if(offset<-33554432||offset>=33554432) { + int n; + for (n=0;n=-33554432&&offset<33554432); + return ((u_int)offset>>2)&0xffffff; +} + +static void emit_mov(int rs,int rt) +{ + assem_debug("mov %s,%s",regname[rt],regname[rs]); + output_w32(0xe1a00000|rd_rn_rm(rt,0,rs)); +} + +static void emit_movs(int rs,int rt) +{ + assem_debug("movs %s,%s",regname[rt],regname[rs]); + output_w32(0xe1b00000|rd_rn_rm(rt,0,rs)); +} + +static void emit_add(int rs1,int rs2,int rt) +{ + assem_debug("add %s,%s,%s",regname[rt],regname[rs1],regname[rs2]); + output_w32(0xe0800000|rd_rn_rm(rt,rs1,rs2)); +} + +static void emit_adds(int rs1,int rs2,int rt) +{ + assem_debug("adds %s,%s,%s",regname[rt],regname[rs1],regname[rs2]); + output_w32(0xe0900000|rd_rn_rm(rt,rs1,rs2)); +} + +static void emit_adcs(int rs1,int rs2,int rt) +{ + assem_debug("adcs %s,%s,%s",regname[rt],regname[rs1],regname[rs2]); + output_w32(0xe0b00000|rd_rn_rm(rt,rs1,rs2)); +} + +static void emit_sbc(int rs1,int rs2,int rt) +{ + assem_debug("sbc %s,%s,%s",regname[rt],regname[rs1],regname[rs2]); + output_w32(0xe0c00000|rd_rn_rm(rt,rs1,rs2)); +} + +static void emit_sbcs(int rs1,int rs2,int rt) +{ + assem_debug("sbcs %s,%s,%s",regname[rt],regname[rs1],regname[rs2]); + output_w32(0xe0d00000|rd_rn_rm(rt,rs1,rs2)); +} + +static void emit_neg(int rs, int rt) +{ + assem_debug("rsb %s,%s,#0",regname[rt],regname[rs]); + output_w32(0xe2600000|rd_rn_rm(rt,rs,0)); +} + +static void emit_negs(int rs, int rt) +{ + assem_debug("rsbs %s,%s,#0",regname[rt],regname[rs]); + output_w32(0xe2700000|rd_rn_rm(rt,rs,0)); +} + +static void emit_sub(int rs1,int rs2,int rt) +{ + assem_debug("sub %s,%s,%s",regname[rt],regname[rs1],regname[rs2]); + output_w32(0xe0400000|rd_rn_rm(rt,rs1,rs2)); +} + +static void emit_subs(int rs1,int rs2,int rt) +{ + assem_debug("subs %s,%s,%s",regname[rt],regname[rs1],regname[rs2]); + output_w32(0xe0500000|rd_rn_rm(rt,rs1,rs2)); +} + +static void emit_zeroreg(int rt) +{ + assem_debug("mov %s,#0",regname[rt]); + output_w32(0xe3a00000|rd_rn_rm(rt,0,0)); +} + +static void emit_loadlp(u_int imm,u_int rt) +{ + add_literal((int)out,imm); + assem_debug("ldr %s,pc+? [=%x]",regname[rt],imm); + output_w32(0xe5900000|rd_rn_rm(rt,15,0)); +} +static void emit_movw(u_int imm,u_int rt) +{ + assert(imm<65536); + assem_debug("movw %s,#%d (0x%x)",regname[rt],imm,imm); + output_w32(0xe3000000|rd_rn_rm(rt,0,0)|(imm&0xfff)|((imm<<4)&0xf0000)); +} +static void emit_movt(u_int imm,u_int rt) +{ + assem_debug("movt %s,#%d (0x%x)",regname[rt],imm&0xffff0000,imm&0xffff0000); + output_w32(0xe3400000|rd_rn_rm(rt,0,0)|((imm>>16)&0xfff)|((imm>>12)&0xf0000)); +} +static void emit_movimm(u_int imm,u_int rt) +{ + u_int armval; + if(genimm(imm,&armval)) { + assem_debug("mov %s,#%d",regname[rt],imm); + output_w32(0xe3a00000|rd_rn_rm(rt,0,0)|armval); + }else if(genimm(~imm,&armval)) { + assem_debug("mvn %s,#%d",regname[rt],imm); + output_w32(0xe3e00000|rd_rn_rm(rt,0,0)|armval); + }else if(imm<65536) { + #ifdef ARMv5_ONLY + assem_debug("mov %s,#%d",regname[rt],imm&0xFF00); + output_w32(0xe3a00000|rd_rn_imm_shift(rt,0,imm>>8,8)); + assem_debug("add %s,%s,#%d",regname[rt],regname[rt],imm&0xFF); + output_w32(0xe2800000|rd_rn_imm_shift(rt,rt,imm&0xff,0)); + #else + emit_movw(imm,rt); + #endif + }else{ + #ifdef ARMv5_ONLY + emit_loadlp(imm,rt); + #else + emit_movw(imm&0x0000FFFF,rt); + emit_movt(imm&0xFFFF0000,rt); + #endif + } +} +static void emit_pcreladdr(u_int rt) +{ + assem_debug("add %s,pc,#?",regname[rt]); + output_w32(0xe2800000|rd_rn_rm(rt,15,0)); +} + +static void emit_loadreg(int r, int hr) +{ + if((r&63)==0) + emit_zeroreg(hr); + else if(r==MMREG) + emit_movimm(((int)memory_map-(int)&dynarec_local)>>2,hr); + else { + int addr=((int)reg)+((r&63)<<3)+((r&64)>>4); + if((r&63)==HIREG) addr=(int)&hi+((r&64)>>4); + if((r&63)==LOREG) addr=(int)&lo+((r&64)>>4); + if(r==CCREG) addr=(int)&cycle_count; + if(r==CSREG) addr=(int)&Status; + if(r==FSREG) addr=(int)&FCR31; + if(r==INVCP) addr=(int)&invc_ptr; + if(r==ROREG) addr=(int)&ram_offset; + u_int offset = addr-(u_int)&dynarec_local; + assert(offset<4096); + assem_debug("ldr %s,fp+%d",regname[hr],offset); + output_w32(0xe5900000|rd_rn_rm(hr,FP,0)|offset); + } +} +static void emit_storereg(int r, int hr) +{ + int addr=((int)reg)+((r&63)<<3)+((r&64)>>4); + if((r&63)==HIREG) addr=(int)&hi+((r&64)>>4); + if((r&63)==LOREG) addr=(int)&lo+((r&64)>>4); + if(r==CCREG) addr=(int)&cycle_count; + if(r==FSREG) addr=(int)&FCR31; + u_int offset = addr-(u_int)&dynarec_local; + assert(offset<4096); + assem_debug("str %s,fp+%d",regname[hr],offset); + output_w32(0xe5800000|rd_rn_rm(hr,FP,0)|offset); +} + +static void emit_test(int rs, int rt) +{ + assem_debug("tst %s,%s",regname[rs],regname[rt]); + output_w32(0xe1100000|rd_rn_rm(0,rs,rt)); +} + +static void emit_testimm(int rs,int imm) +{ + u_int armval, ret; + assem_debug("tst %s,#%d",regname[rs],imm); + ret = genimm(imm,&armval); + assert(ret); + output_w32(0xe3100000|rd_rn_rm(0,rs,0)|armval); +} + +static void emit_not(int rs,int rt) +{ + assem_debug("mvn %s,%s",regname[rt],regname[rs]); + output_w32(0xe1e00000|rd_rn_rm(rt,0,rs)); +} + +static void emit_and(u_int rs1,u_int rs2,u_int rt) +{ + assem_debug("and %s,%s,%s",regname[rt],regname[rs1],regname[rs2]); + output_w32(0xe0000000|rd_rn_rm(rt,rs1,rs2)); +} + +static void emit_or(u_int rs1,u_int rs2,u_int rt) +{ + assem_debug("orr %s,%s,%s",regname[rt],regname[rs1],regname[rs2]); + output_w32(0xe1800000|rd_rn_rm(rt,rs1,rs2)); +} +static void emit_or_and_set_flags(int rs1,int rs2,int rt) +{ + assem_debug("orrs %s,%s,%s",regname[rt],regname[rs1],regname[rs2]); + output_w32(0xe1900000|rd_rn_rm(rt,rs1,rs2)); +} + +static void emit_xor(u_int rs1,u_int rs2,u_int rt) +{ + assem_debug("eor %s,%s,%s",regname[rt],regname[rs1],regname[rs2]); + output_w32(0xe0200000|rd_rn_rm(rt,rs1,rs2)); +} + +static void emit_addimm(u_int rs,int imm,u_int rt) +{ + assert(rs<16); + assert(rt<16); + if(imm!=0) { + assert(imm>-65536&&imm<65536); + u_int armval; + if(genimm(imm,&armval)) { + assem_debug("add %s,%s,#%d",regname[rt],regname[rs],imm); + output_w32(0xe2800000|rd_rn_rm(rt,rs,0)|armval); + }else if(genimm(-imm,&armval)) { + assem_debug("sub %s,%s,#%d",regname[rt],regname[rs],imm); + output_w32(0xe2400000|rd_rn_rm(rt,rs,0)|armval); + }else if(imm<0) { + assem_debug("sub %s,%s,#%d",regname[rt],regname[rs],(-imm)&0xFF00); + assem_debug("sub %s,%s,#%d",regname[rt],regname[rt],(-imm)&0xFF); + output_w32(0xe2400000|rd_rn_imm_shift(rt,rs,(-imm)>>8,8)); + output_w32(0xe2400000|rd_rn_imm_shift(rt,rt,(-imm)&0xff,0)); + }else{ + assem_debug("add %s,%s,#%d",regname[rt],regname[rs],imm&0xFF00); + assem_debug("add %s,%s,#%d",regname[rt],regname[rt],imm&0xFF); + output_w32(0xe2800000|rd_rn_imm_shift(rt,rs,imm>>8,8)); + output_w32(0xe2800000|rd_rn_imm_shift(rt,rt,imm&0xff,0)); + } + } + else if(rs!=rt) emit_mov(rs,rt); +} + +static void emit_addimm_and_set_flags(int imm,int rt) +{ + assert(imm>-65536&&imm<65536); + u_int armval; + if(genimm(imm,&armval)) { + assem_debug("adds %s,%s,#%d",regname[rt],regname[rt],imm); + output_w32(0xe2900000|rd_rn_rm(rt,rt,0)|armval); + }else if(genimm(-imm,&armval)) { + assem_debug("subs %s,%s,#%d",regname[rt],regname[rt],imm); + output_w32(0xe2500000|rd_rn_rm(rt,rt,0)|armval); + }else if(imm<0) { + assem_debug("sub %s,%s,#%d",regname[rt],regname[rt],(-imm)&0xFF00); + assem_debug("subs %s,%s,#%d",regname[rt],regname[rt],(-imm)&0xFF); + output_w32(0xe2400000|rd_rn_imm_shift(rt,rt,(-imm)>>8,8)); + output_w32(0xe2500000|rd_rn_imm_shift(rt,rt,(-imm)&0xff,0)); + }else{ + assem_debug("add %s,%s,#%d",regname[rt],regname[rt],imm&0xFF00); + assem_debug("adds %s,%s,#%d",regname[rt],regname[rt],imm&0xFF); + output_w32(0xe2800000|rd_rn_imm_shift(rt,rt,imm>>8,8)); + output_w32(0xe2900000|rd_rn_imm_shift(rt,rt,imm&0xff,0)); + } +} + +#ifndef RAM_OFFSET +static void emit_addimm_no_flags(u_int imm,u_int rt) +{ + emit_addimm(rt,imm,rt); +} +#endif + +static void emit_addnop(u_int r) +{ + assert(r<16); + assem_debug("add %s,%s,#0 (nop)",regname[r],regname[r]); + output_w32(0xe2800000|rd_rn_rm(r,r,0)); +} + +static void emit_adcimm(u_int rs,int imm,u_int rt) +{ + u_int armval, ret; + ret = genimm(imm,&armval); + assert(ret); + assem_debug("adc %s,%s,#%d",regname[rt],regname[rs],imm); + output_w32(0xe2a00000|rd_rn_rm(rt,rs,0)|armval); +} +/*static void emit_sbcimm(int imm,u_int rt) +{ + u_int armval, ret; + ret = genimm(imm,&armval); + assert(ret); + assem_debug("sbc %s,%s,#%d",regname[rt],regname[rt],imm); + output_w32(0xe2c00000|rd_rn_rm(rt,rt,0)|armval); +}*/ + +static void emit_rscimm(int rs,int imm,u_int rt) +{ + assert(0); + u_int armval, ret; + ret = genimm(imm,&armval); + assert(ret); + assem_debug("rsc %s,%s,#%d",regname[rt],regname[rs],imm); + output_w32(0xe2e00000|rd_rn_rm(rt,rs,0)|armval); +} + +static void emit_addimm64_32(int rsh,int rsl,int imm,int rth,int rtl) +{ + // TODO: if(genimm(imm,&armval)) ... + // else + emit_movimm(imm,HOST_TEMPREG); + emit_adds(HOST_TEMPREG,rsl,rtl); + emit_adcimm(rsh,0,rth); +} +#ifdef INVERTED_CARRY +static void emit_sbb(int rs1,int rs2) +{ + assem_debug("sbb %%%s,%%%s",regname[rs2],regname[rs1]); + output_byte(0x19); + output_modrm(3,rs1,rs2); +} +#endif + +static void emit_andimm(int rs,int imm,int rt) +{ + u_int armval; + if(imm==0) { + emit_zeroreg(rt); + }else if(genimm(imm,&armval)) { + assem_debug("and %s,%s,#%d",regname[rt],regname[rs],imm); + output_w32(0xe2000000|rd_rn_rm(rt,rs,0)|armval); + }else if(genimm(~imm,&armval)) { + assem_debug("bic %s,%s,#%d",regname[rt],regname[rs],imm); + output_w32(0xe3c00000|rd_rn_rm(rt,rs,0)|armval); + }else if(imm==65535) { + #ifdef ARMv5_ONLY + assem_debug("bic %s,%s,#FF000000",regname[rt],regname[rs]); + output_w32(0xe3c00000|rd_rn_rm(rt,rs,0)|0x4FF); + assem_debug("bic %s,%s,#00FF0000",regname[rt],regname[rt]); + output_w32(0xe3c00000|rd_rn_rm(rt,rt,0)|0x8FF); + #else + assem_debug("uxth %s,%s",regname[rt],regname[rs]); + output_w32(0xe6ff0070|rd_rn_rm(rt,0,rs)); + #endif + }else{ + assert(imm>0&&imm<65535); + #ifdef ARMv5_ONLY + assem_debug("mov r14,#%d",imm&0xFF00); + output_w32(0xe3a00000|rd_rn_imm_shift(HOST_TEMPREG,0,imm>>8,8)); + assem_debug("add r14,r14,#%d",imm&0xFF); + output_w32(0xe2800000|rd_rn_imm_shift(HOST_TEMPREG,HOST_TEMPREG,imm&0xff,0)); + #else + emit_movw(imm,HOST_TEMPREG); + #endif + assem_debug("and %s,%s,r14",regname[rt],regname[rs]); + output_w32(0xe0000000|rd_rn_rm(rt,rs,HOST_TEMPREG)); + } +} + +static void emit_orimm(int rs,int imm,int rt) +{ + u_int armval; + if(imm==0) { + if(rs!=rt) emit_mov(rs,rt); + }else if(genimm(imm,&armval)) { + assem_debug("orr %s,%s,#%d",regname[rt],regname[rs],imm); + output_w32(0xe3800000|rd_rn_rm(rt,rs,0)|armval); + }else{ + assert(imm>0&&imm<65536); + assem_debug("orr %s,%s,#%d",regname[rt],regname[rs],imm&0xFF00); + assem_debug("orr %s,%s,#%d",regname[rt],regname[rs],imm&0xFF); + output_w32(0xe3800000|rd_rn_imm_shift(rt,rs,imm>>8,8)); + output_w32(0xe3800000|rd_rn_imm_shift(rt,rt,imm&0xff,0)); + } +} + +static void emit_xorimm(int rs,int imm,int rt) +{ + u_int armval; + if(imm==0) { + if(rs!=rt) emit_mov(rs,rt); + }else if(genimm(imm,&armval)) { + assem_debug("eor %s,%s,#%d",regname[rt],regname[rs],imm); + output_w32(0xe2200000|rd_rn_rm(rt,rs,0)|armval); + }else{ + assert(imm>0&&imm<65536); + assem_debug("eor %s,%s,#%d",regname[rt],regname[rs],imm&0xFF00); + assem_debug("eor %s,%s,#%d",regname[rt],regname[rs],imm&0xFF); + output_w32(0xe2200000|rd_rn_imm_shift(rt,rs,imm>>8,8)); + output_w32(0xe2200000|rd_rn_imm_shift(rt,rt,imm&0xff,0)); + } +} + +static void emit_shlimm(int rs,u_int imm,int rt) +{ + assert(imm>0); + assert(imm<32); + //if(imm==1) ... + assem_debug("lsl %s,%s,#%d",regname[rt],regname[rs],imm); + output_w32(0xe1a00000|rd_rn_rm(rt,0,rs)|(imm<<7)); +} + +static void emit_shrimm(int rs,u_int imm,int rt) +{ + assert(imm>0); + assert(imm<32); + assem_debug("lsr %s,%s,#%d",regname[rt],regname[rs],imm); + output_w32(0xe1a00000|rd_rn_rm(rt,0,rs)|0x20|(imm<<7)); +} + +static void emit_sarimm(int rs,u_int imm,int rt) +{ + assert(imm>0); + assert(imm<32); + assem_debug("asr %s,%s,#%d",regname[rt],regname[rs],imm); + output_w32(0xe1a00000|rd_rn_rm(rt,0,rs)|0x40|(imm<<7)); +} + +static void emit_rorimm(int rs,u_int imm,int rt) +{ + assert(imm>0); + assert(imm<32); + assem_debug("ror %s,%s,#%d",regname[rt],regname[rs],imm); + output_w32(0xe1a00000|rd_rn_rm(rt,0,rs)|0x60|(imm<<7)); +} + +static void emit_shldimm(int rs,int rs2,u_int imm,int rt) +{ + assem_debug("shld %%%s,%%%s,%d",regname[rt],regname[rs2],imm); + assert(imm>0); + assert(imm<32); + //if(imm==1) ... + assem_debug("lsl %s,%s,#%d",regname[rt],regname[rs],imm); + output_w32(0xe1a00000|rd_rn_rm(rt,0,rs)|(imm<<7)); + assem_debug("orr %s,%s,%s,lsr #%d",regname[rt],regname[rt],regname[rs2],32-imm); + output_w32(0xe1800020|rd_rn_rm(rt,rt,rs2)|((32-imm)<<7)); +} + +static void emit_shrdimm(int rs,int rs2,u_int imm,int rt) +{ + assem_debug("shrd %%%s,%%%s,%d",regname[rt],regname[rs2],imm); + assert(imm>0); + assert(imm<32); + //if(imm==1) ... + assem_debug("lsr %s,%s,#%d",regname[rt],regname[rs],imm); + output_w32(0xe1a00020|rd_rn_rm(rt,0,rs)|(imm<<7)); + assem_debug("orr %s,%s,%s,lsl #%d",regname[rt],regname[rt],regname[rs2],32-imm); + output_w32(0xe1800000|rd_rn_rm(rt,rt,rs2)|((32-imm)<<7)); +} + +static void emit_shl(u_int rs,u_int shift,u_int rt) +{ + assert(rs<16); + assert(rt<16); + assert(shift<16); + //if(imm==1) ... + assem_debug("lsl %s,%s,%s",regname[rt],regname[rs],regname[shift]); + output_w32(0xe1a00000|rd_rn_rm(rt,0,rs)|0x10|(shift<<8)); +} +static void emit_shr(u_int rs,u_int shift,u_int rt) +{ + assert(rs<16); + assert(rt<16); + assert(shift<16); + assem_debug("lsr %s,%s,%s",regname[rt],regname[rs],regname[shift]); + output_w32(0xe1a00000|rd_rn_rm(rt,0,rs)|0x30|(shift<<8)); +} +static void emit_sar(u_int rs,u_int shift,u_int rt) +{ + assert(rs<16); + assert(rt<16); + assert(shift<16); + assem_debug("asr %s,%s,%s",regname[rt],regname[rs],regname[shift]); + output_w32(0xe1a00000|rd_rn_rm(rt,0,rs)|0x50|(shift<<8)); +} + +static void emit_orrshl(u_int rs,u_int shift,u_int rt) +{ + assert(rs<16); + assert(rt<16); + assert(shift<16); + assem_debug("orr %s,%s,%s,lsl %s",regname[rt],regname[rt],regname[rs],regname[shift]); + output_w32(0xe1800000|rd_rn_rm(rt,rt,rs)|0x10|(shift<<8)); +} +static void emit_orrshr(u_int rs,u_int shift,u_int rt) +{ + assert(rs<16); + assert(rt<16); + assert(shift<16); + assem_debug("orr %s,%s,%s,lsr %s",regname[rt],regname[rt],regname[rs],regname[shift]); + output_w32(0xe1800000|rd_rn_rm(rt,rt,rs)|0x30|(shift<<8)); +} + +static void emit_cmpimm(int rs,int imm) +{ + u_int armval; + if(genimm(imm,&armval)) { + assem_debug("cmp %s,#%d",regname[rs],imm); + output_w32(0xe3500000|rd_rn_rm(0,rs,0)|armval); + }else if(genimm(-imm,&armval)) { + assem_debug("cmn %s,#%d",regname[rs],imm); + output_w32(0xe3700000|rd_rn_rm(0,rs,0)|armval); + }else if(imm>0) { + assert(imm<65536); + #ifdef ARMv5_ONLY + emit_movimm(imm,HOST_TEMPREG); + #else + emit_movw(imm,HOST_TEMPREG); + #endif + assem_debug("cmp %s,r14",regname[rs]); + output_w32(0xe1500000|rd_rn_rm(0,rs,HOST_TEMPREG)); + }else{ + assert(imm>-65536); + #ifdef ARMv5_ONLY + emit_movimm(-imm,HOST_TEMPREG); + #else + emit_movw(-imm,HOST_TEMPREG); + #endif + assem_debug("cmn %s,r14",regname[rs]); + output_w32(0xe1700000|rd_rn_rm(0,rs,HOST_TEMPREG)); + } +} + +static void emit_cmovne_imm(int imm,int rt) +{ + assem_debug("movne %s,#%d",regname[rt],imm); + u_int armval, ret; + ret = genimm(imm,&armval); + assert(ret); + output_w32(0x13a00000|rd_rn_rm(rt,0,0)|armval); +} +static void emit_cmovl_imm(int imm,int rt) +{ + assem_debug("movlt %s,#%d",regname[rt],imm); + u_int armval, ret; + ret = genimm(imm,&armval); + assert(ret); + output_w32(0xb3a00000|rd_rn_rm(rt,0,0)|armval); +} +static void emit_cmovb_imm(int imm,int rt) +{ + assem_debug("movcc %s,#%d",regname[rt],imm); + u_int armval, ret; + ret = genimm(imm,&armval); + assert(ret); + output_w32(0x33a00000|rd_rn_rm(rt,0,0)|armval); +} +static void emit_cmovs_imm(int imm,int rt) +{ + assem_debug("movmi %s,#%d",regname[rt],imm); + u_int armval, ret; + ret = genimm(imm,&armval); + assert(ret); + output_w32(0x43a00000|rd_rn_rm(rt,0,0)|armval); +} +static void emit_cmove_reg(int rs,int rt) +{ + assem_debug("moveq %s,%s",regname[rt],regname[rs]); + output_w32(0x01a00000|rd_rn_rm(rt,0,rs)); +} +static void emit_cmovne_reg(int rs,int rt) +{ + assem_debug("movne %s,%s",regname[rt],regname[rs]); + output_w32(0x11a00000|rd_rn_rm(rt,0,rs)); +} +static void emit_cmovl_reg(int rs,int rt) +{ + assem_debug("movlt %s,%s",regname[rt],regname[rs]); + output_w32(0xb1a00000|rd_rn_rm(rt,0,rs)); +} +static void emit_cmovs_reg(int rs,int rt) +{ + assem_debug("movmi %s,%s",regname[rt],regname[rs]); + output_w32(0x41a00000|rd_rn_rm(rt,0,rs)); +} + +static void emit_slti32(int rs,int imm,int rt) +{ + if(rs!=rt) emit_zeroreg(rt); + emit_cmpimm(rs,imm); + if(rs==rt) emit_movimm(0,rt); + emit_cmovl_imm(1,rt); +} +static void emit_sltiu32(int rs,int imm,int rt) +{ + if(rs!=rt) emit_zeroreg(rt); + emit_cmpimm(rs,imm); + if(rs==rt) emit_movimm(0,rt); + emit_cmovb_imm(1,rt); +} +static void emit_slti64_32(int rsh,int rsl,int imm,int rt) +{ + assert(rsh!=rt); + emit_slti32(rsl,imm,rt); + if(imm>=0) + { + emit_test(rsh,rsh); + emit_cmovne_imm(0,rt); + emit_cmovs_imm(1,rt); + } + else + { + emit_cmpimm(rsh,-1); + emit_cmovne_imm(0,rt); + emit_cmovl_imm(1,rt); + } +} +static void emit_sltiu64_32(int rsh,int rsl,int imm,int rt) +{ + assert(rsh!=rt); + emit_sltiu32(rsl,imm,rt); + if(imm>=0) + { + emit_test(rsh,rsh); + emit_cmovne_imm(0,rt); + } + else + { + emit_cmpimm(rsh,-1); + emit_cmovne_imm(1,rt); + } +} + +static void emit_cmp(int rs,int rt) +{ + assem_debug("cmp %s,%s",regname[rs],regname[rt]); + output_w32(0xe1500000|rd_rn_rm(0,rs,rt)); +} +static void emit_set_gz32(int rs, int rt) +{ + //assem_debug("set_gz32"); + emit_cmpimm(rs,1); + emit_movimm(1,rt); + emit_cmovl_imm(0,rt); +} +static void emit_set_nz32(int rs, int rt) +{ + //assem_debug("set_nz32"); + if(rs!=rt) emit_movs(rs,rt); + else emit_test(rs,rs); + emit_cmovne_imm(1,rt); +} +static void emit_set_gz64_32(int rsh, int rsl, int rt) +{ + //assem_debug("set_gz64"); + emit_set_gz32(rsl,rt); + emit_test(rsh,rsh); + emit_cmovne_imm(1,rt); + emit_cmovs_imm(0,rt); +} +static void emit_set_nz64_32(int rsh, int rsl, int rt) +{ + //assem_debug("set_nz64"); + emit_or_and_set_flags(rsh,rsl,rt); + emit_cmovne_imm(1,rt); +} +static void emit_set_if_less32(int rs1, int rs2, int rt) +{ + //assem_debug("set if less (%%%s,%%%s),%%%s",regname[rs1],regname[rs2],regname[rt]); + if(rs1!=rt&&rs2!=rt) emit_zeroreg(rt); + emit_cmp(rs1,rs2); + if(rs1==rt||rs2==rt) emit_movimm(0,rt); + emit_cmovl_imm(1,rt); +} +static void emit_set_if_carry32(int rs1, int rs2, int rt) +{ + //assem_debug("set if carry (%%%s,%%%s),%%%s",regname[rs1],regname[rs2],regname[rt]); + if(rs1!=rt&&rs2!=rt) emit_zeroreg(rt); + emit_cmp(rs1,rs2); + if(rs1==rt||rs2==rt) emit_movimm(0,rt); + emit_cmovb_imm(1,rt); +} +static void emit_set_if_less64_32(int u1, int l1, int u2, int l2, int rt) +{ + //assem_debug("set if less64 (%%%s,%%%s,%%%s,%%%s),%%%s",regname[u1],regname[l1],regname[u2],regname[l2],regname[rt]); + assert(u1!=rt); + assert(u2!=rt); + emit_cmp(l1,l2); + emit_movimm(0,rt); + emit_sbcs(u1,u2,HOST_TEMPREG); + emit_cmovl_imm(1,rt); +} +static void emit_set_if_carry64_32(int u1, int l1, int u2, int l2, int rt) +{ + //assem_debug("set if carry64 (%%%s,%%%s,%%%s,%%%s),%%%s",regname[u1],regname[l1],regname[u2],regname[l2],regname[rt]); + assert(u1!=rt); + assert(u2!=rt); + emit_cmp(l1,l2); + emit_movimm(0,rt); + emit_sbcs(u1,u2,HOST_TEMPREG); + emit_cmovb_imm(1,rt); +} + +static void emit_call(int a) +{ + assem_debug("bl %x (%x+%x)",a,(int)out,a-(int)out-8); + u_int offset=genjmp(a); + output_w32(0xeb000000|offset); +} +static void emit_jmp(int a) +{ + assem_debug("b %x (%x+%x)",a,(int)out,a-(int)out-8); + u_int offset=genjmp(a); + output_w32(0xea000000|offset); +} +static void emit_jne(int a) +{ + assem_debug("bne %x",a); + u_int offset=genjmp(a); + output_w32(0x1a000000|offset); +} +static void emit_jeq(int a) +{ + assem_debug("beq %x",a); + u_int offset=genjmp(a); + output_w32(0x0a000000|offset); +} +static void emit_js(int a) +{ + assem_debug("bmi %x",a); + u_int offset=genjmp(a); + output_w32(0x4a000000|offset); +} +static void emit_jns(int a) +{ + assem_debug("bpl %x",a); + u_int offset=genjmp(a); + output_w32(0x5a000000|offset); +} +static void emit_jl(int a) +{ + assem_debug("blt %x",a); + u_int offset=genjmp(a); + output_w32(0xba000000|offset); +} +static void emit_jge(int a) +{ + assem_debug("bge %x",a); + u_int offset=genjmp(a); + output_w32(0xaa000000|offset); +} +static void emit_jno(int a) +{ + assem_debug("bvc %x",a); + u_int offset=genjmp(a); + output_w32(0x7a000000|offset); +} + +static void emit_jcc(int a) +{ + assem_debug("bcc %x",a); + u_int offset=genjmp(a); + output_w32(0x3a000000|offset); +} + +static void emit_pushreg(u_int r) +{ + assem_debug("push %%%s",regname[r]); + assert(0); +} +static void emit_popreg(u_int r) +{ + assem_debug("pop %%%s",regname[r]); + assert(0); +} +/* +static void emit_callreg(u_int r) +{ + assem_debug("call *%%%s",regname[r]); + assert(0); +} +static void emit_jmpreg(u_int r) +{ + assem_debug("mov pc,%s",regname[r]); + output_w32(0xe1a00000|rd_rn_rm(15,0,r)); +} +*/ +static void emit_readword_indexed(int offset, int rs, int rt) +{ + assert(offset>-4096&&offset<4096); + assem_debug("ldr %s,%s+%d",regname[rt],regname[rs],offset); + if(offset>=0) { + output_w32(0xe5900000|rd_rn_rm(rt,rs,0)|offset); + }else{ + output_w32(0xe5100000|rd_rn_rm(rt,rs,0)|(-offset)); + } +} +static void emit_readword_dualindexedx4(int rs1, int rs2, int rt) +{ + assem_debug("ldr %s,%s,%s lsl #2",regname[rt],regname[rs1],regname[rs2]); + output_w32(0xe7900000|rd_rn_rm(rt,rs1,rs2)|0x100); +} +static void emit_readword_indexed_tlb(int addr, int rs, int map, int rt) +{ + if(map<0) emit_readword_indexed(addr, rs, rt); + else { + assert(addr==0); + emit_readword_dualindexedx4(rs, map, rt); + } +} +static void emit_readdword_indexed_tlb(int addr, int rs, int map, int rh, int rl) +{ + if(map<0) { + if(rh>=0) emit_readword_indexed(addr, rs, rh); + emit_readword_indexed(addr+4, rs, rl); + }else{ + assert(rh!=rs); + if(rh>=0) emit_readword_indexed_tlb(addr, rs, map, rh); + emit_addimm(map,1,HOST_TEMPREG); + emit_readword_indexed_tlb(addr, rs, HOST_TEMPREG, rl); + } +} +static void emit_movsbl_indexed(int offset, int rs, int rt) +{ + assert(offset>-256&&offset<256); + assem_debug("ldrsb %s,%s+%d",regname[rt],regname[rs],offset); + if(offset>=0) { + output_w32(0xe1d000d0|rd_rn_rm(rt,rs,0)|((offset<<4)&0xf00)|(offset&0xf)); + }else{ + output_w32(0xe15000d0|rd_rn_rm(rt,rs,0)|(((-offset)<<4)&0xf00)|((-offset)&0xf)); + } +} +static void emit_movsbl_indexed_tlb(int addr, int rs, int map, int rt) +{ + if(map<0) emit_movsbl_indexed(addr, rs, rt); + else { + if(addr==0) { + emit_shlimm(map,2,HOST_TEMPREG); + assem_debug("ldrsb %s,%s+%s",regname[rt],regname[rs],regname[HOST_TEMPREG]); + output_w32(0xe19000d0|rd_rn_rm(rt,rs,HOST_TEMPREG)); + }else{ + assert(addr>-256&&addr<256); + assem_debug("add %s,%s,%s,lsl #2",regname[rt],regname[rs],regname[map]); + output_w32(0xe0800000|rd_rn_rm(rt,rs,map)|(2<<7)); + emit_movsbl_indexed(addr, rt, rt); + } + } +} +static void emit_movswl_indexed(int offset, int rs, int rt) +{ + assert(offset>-256&&offset<256); + assem_debug("ldrsh %s,%s+%d",regname[rt],regname[rs],offset); + if(offset>=0) { + output_w32(0xe1d000f0|rd_rn_rm(rt,rs,0)|((offset<<4)&0xf00)|(offset&0xf)); + }else{ + output_w32(0xe15000f0|rd_rn_rm(rt,rs,0)|(((-offset)<<4)&0xf00)|((-offset)&0xf)); + } +} +static void emit_movzbl_indexed(int offset, int rs, int rt) +{ + assert(offset>-4096&&offset<4096); + assem_debug("ldrb %s,%s+%d",regname[rt],regname[rs],offset); + if(offset>=0) { + output_w32(0xe5d00000|rd_rn_rm(rt,rs,0)|offset); + }else{ + output_w32(0xe5500000|rd_rn_rm(rt,rs,0)|(-offset)); + } +} +static void emit_movzbl_dualindexedx4(int rs1, int rs2, int rt) +{ + assem_debug("ldrb %s,%s,%s lsl #2",regname[rt],regname[rs1],regname[rs2]); + output_w32(0xe7d00000|rd_rn_rm(rt,rs1,rs2)|0x100); +} +static void emit_movzbl_indexed_tlb(int addr, int rs, int map, int rt) +{ + if(map<0) emit_movzbl_indexed(addr, rs, rt); + else { + if(addr==0) { + emit_movzbl_dualindexedx4(rs, map, rt); + }else{ + emit_addimm(rs,addr,rt); + emit_movzbl_dualindexedx4(rt, map, rt); + } + } +} +static void emit_movzwl_indexed(int offset, int rs, int rt) +{ + assert(offset>-256&&offset<256); + assem_debug("ldrh %s,%s+%d",regname[rt],regname[rs],offset); + if(offset>=0) { + output_w32(0xe1d000b0|rd_rn_rm(rt,rs,0)|((offset<<4)&0xf00)|(offset&0xf)); + }else{ + output_w32(0xe15000b0|rd_rn_rm(rt,rs,0)|(((-offset)<<4)&0xf00)|((-offset)&0xf)); + } +} +static void emit_readword(int addr, int rt) +{ + u_int offset = addr-(u_int)&dynarec_local; + assert(offset<4096); + assem_debug("ldr %s,fp+%d",regname[rt],offset); + output_w32(0xe5900000|rd_rn_rm(rt,FP,0)|offset); +} +static void emit_movsbl(int addr, int rt) +{ + u_int offset = addr-(u_int)&dynarec_local; + assert(offset<256); + assem_debug("ldrsb %s,fp+%d",regname[rt],offset); + output_w32(0xe1d000d0|rd_rn_rm(rt,FP,0)|((offset<<4)&0xf00)|(offset&0xf)); +} +static void emit_movswl(int addr, int rt) +{ + u_int offset = addr-(u_int)&dynarec_local; + assert(offset<256); + assem_debug("ldrsh %s,fp+%d",regname[rt],offset); + output_w32(0xe1d000f0|rd_rn_rm(rt,FP,0)|((offset<<4)&0xf00)|(offset&0xf)); +} +static void emit_movzbl(int addr, int rt) +{ + u_int offset = addr-(u_int)&dynarec_local; + assert(offset<4096); + assem_debug("ldrb %s,fp+%d",regname[rt],offset); + output_w32(0xe5d00000|rd_rn_rm(rt,FP,0)|offset); +} +static void emit_movzwl(int addr, int rt) +{ + u_int offset = addr-(u_int)&dynarec_local; + assert(offset<256); + assem_debug("ldrh %s,fp+%d",regname[rt],offset); + output_w32(0xe1d000b0|rd_rn_rm(rt,FP,0)|((offset<<4)&0xf00)|(offset&0xf)); +} + +/* +static void emit_movzwl_reg(int rs, int rt) +{ + assem_debug("movzwl %%%s,%%%s",regname[rs]+1,regname[rt]); + assert(0); +} +*/ + +static void emit_writeword_indexed(int rt, int offset, int rs) +{ + assert(offset>-4096&&offset<4096); + assem_debug("str %s,%s+%d",regname[rt],regname[rs],offset); + if(offset>=0) { + output_w32(0xe5800000|rd_rn_rm(rt,rs,0)|offset); + }else{ + output_w32(0xe5000000|rd_rn_rm(rt,rs,0)|(-offset)); + } +} +static void emit_writeword_dualindexedx4(int rt, int rs1, int rs2) +{ + assem_debug("str %s,%s,%s lsl #2",regname[rt],regname[rs1],regname[rs2]); + output_w32(0xe7800000|rd_rn_rm(rt,rs1,rs2)|0x100); +} +static void emit_writeword_indexed_tlb(int rt, int addr, int rs, int map, int temp) +{ + if(map<0) emit_writeword_indexed(rt, addr, rs); + else { + assert(addr==0); + emit_writeword_dualindexedx4(rt, rs, map); + } +} +static void emit_writedword_indexed_tlb(int rh, int rl, int addr, int rs, int map, int temp) +{ + if(map<0) { + if(rh>=0) emit_writeword_indexed(rh, addr, rs); + emit_writeword_indexed(rl, addr+4, rs); + }else{ + assert(rh>=0); + if(temp!=rs) emit_addimm(map,1,temp); + emit_writeword_indexed_tlb(rh, addr, rs, map, temp); + if(temp!=rs) emit_writeword_indexed_tlb(rl, addr, rs, temp, temp); + else { + emit_addimm(rs,4,rs); + emit_writeword_indexed_tlb(rl, addr, rs, map, temp); + } + } +} +static void emit_writehword_indexed(int rt, int offset, int rs) +{ + assert(offset>-256&&offset<256); + assem_debug("strh %s,%s+%d",regname[rt],regname[rs],offset); + if(offset>=0) { + output_w32(0xe1c000b0|rd_rn_rm(rt,rs,0)|((offset<<4)&0xf00)|(offset&0xf)); + }else{ + output_w32(0xe14000b0|rd_rn_rm(rt,rs,0)|(((-offset)<<4)&0xf00)|((-offset)&0xf)); + } +} +static void emit_writebyte_indexed(int rt, int offset, int rs) +{ + assert(offset>-4096&&offset<4096); + assem_debug("strb %s,%s+%d",regname[rt],regname[rs],offset); + if(offset>=0) { + output_w32(0xe5c00000|rd_rn_rm(rt,rs,0)|offset); + }else{ + output_w32(0xe5400000|rd_rn_rm(rt,rs,0)|(-offset)); + } +} +static void emit_writebyte_dualindexedx4(int rt, int rs1, int rs2) +{ + assem_debug("strb %s,%s,%s lsl #2",regname[rt],regname[rs1],regname[rs2]); + output_w32(0xe7c00000|rd_rn_rm(rt,rs1,rs2)|0x100); +} +static void emit_writebyte_indexed_tlb(int rt, int addr, int rs, int map, int temp) +{ + if(map<0) emit_writebyte_indexed(rt, addr, rs); + else { + if(addr==0) { + emit_writebyte_dualindexedx4(rt, rs, map); + }else{ + emit_addimm(rs,addr,temp); + emit_writebyte_dualindexedx4(rt, temp, map); + } + } +} +static void emit_writeword(int rt, int addr) +{ + u_int offset = addr-(u_int)&dynarec_local; + assert(offset<4096); + assem_debug("str %s,fp+%d",regname[rt],offset); + output_w32(0xe5800000|rd_rn_rm(rt,FP,0)|offset); +} +static void emit_writehword(int rt, int addr) +{ + u_int offset = addr-(u_int)&dynarec_local; + assert(offset<256); + assem_debug("strh %s,fp+%d",regname[rt],offset); + output_w32(0xe1c000b0|rd_rn_rm(rt,FP,0)|((offset<<4)&0xf00)|(offset&0xf)); +} +static void emit_writebyte(int rt, int addr) +{ + u_int offset = addr-(u_int)&dynarec_local; + assert(offset<4096); + assem_debug("strb %s,fp+%d",regname[rt],offset); + output_w32(0xe5c00000|rd_rn_rm(rt,FP,0)|offset); +} + +/* +static void emit_mul(int rs) +{ + assem_debug("mul %%%s",regname[rs]); + assert(0); +} +*/ + +static void emit_umull(u_int rs1, u_int rs2, u_int hi, u_int lo) +{ + assem_debug("umull %s, %s, %s, %s",regname[lo],regname[hi],regname[rs1],regname[rs2]); + assert(rs1<16); + assert(rs2<16); + assert(hi<16); + assert(lo<16); + output_w32(0xe0800090|(hi<<16)|(lo<<12)|(rs2<<8)|rs1); +} +static void emit_smull(u_int rs1, u_int rs2, u_int hi, u_int lo) +{ + assem_debug("smull %s, %s, %s, %s",regname[lo],regname[hi],regname[rs1],regname[rs2]); + assert(rs1<16); + assert(rs2<16); + assert(hi<16); + assert(lo<16); + output_w32(0xe0c00090|(hi<<16)|(lo<<12)|(rs2<<8)|rs1); +} + +static void emit_clz(int rs,int rt) +{ + assem_debug("clz %s,%s",regname[rt],regname[rs]); + output_w32(0xe16f0f10|rd_rn_rm(rt,0,rs)); +} + +static void emit_subcs(int rs1,int rs2,int rt) +{ + assem_debug("subcs %s,%s,%s",regname[rt],regname[rs1],regname[rs2]); + output_w32(0x20400000|rd_rn_rm(rt,rs1,rs2)); +} + +static void emit_shrcc_imm(int rs,u_int imm,int rt) +{ + assert(imm>0); + assert(imm<32); + assem_debug("lsrcc %s,%s,#%d",regname[rt],regname[rs],imm); + output_w32(0x31a00000|rd_rn_rm(rt,0,rs)|0x20|(imm<<7)); +} + +static void emit_negmi(int rs, int rt) +{ + assem_debug("rsbmi %s,%s,#0",regname[rt],regname[rs]); + output_w32(0x42600000|rd_rn_rm(rt,rs,0)); +} + +static void emit_orreq(u_int rs1,u_int rs2,u_int rt) +{ + assem_debug("orreq %s,%s,%s",regname[rt],regname[rs1],regname[rs2]); + output_w32(0x01800000|rd_rn_rm(rt,rs1,rs2)); +} + +static void emit_orrne(u_int rs1,u_int rs2,u_int rt) +{ + assem_debug("orrne %s,%s,%s",regname[rt],regname[rs1],regname[rs2]); + output_w32(0x11800000|rd_rn_rm(rt,rs1,rs2)); +} + +static void emit_bic_lsl(u_int rs1,u_int rs2,u_int shift,u_int rt) +{ + assem_debug("bic %s,%s,%s lsl %s",regname[rt],regname[rs1],regname[rs2],regname[shift]); + output_w32(0xe1C00000|rd_rn_rm(rt,rs1,rs2)|0x10|(shift<<8)); +} + +static void emit_biceq_lsl(u_int rs1,u_int rs2,u_int shift,u_int rt) +{ + assem_debug("biceq %s,%s,%s lsl %s",regname[rt],regname[rs1],regname[rs2],regname[shift]); + output_w32(0x01C00000|rd_rn_rm(rt,rs1,rs2)|0x10|(shift<<8)); +} + +static void emit_bicne_lsl(u_int rs1,u_int rs2,u_int shift,u_int rt) +{ + assem_debug("bicne %s,%s,%s lsl %s",regname[rt],regname[rs1],regname[rs2],regname[shift]); + output_w32(0x11C00000|rd_rn_rm(rt,rs1,rs2)|0x10|(shift<<8)); +} + +static void emit_bic_lsr(u_int rs1,u_int rs2,u_int shift,u_int rt) +{ + assem_debug("bic %s,%s,%s lsr %s",regname[rt],regname[rs1],regname[rs2],regname[shift]); + output_w32(0xe1C00000|rd_rn_rm(rt,rs1,rs2)|0x30|(shift<<8)); +} + +static void emit_biceq_lsr(u_int rs1,u_int rs2,u_int shift,u_int rt) +{ + assem_debug("biceq %s,%s,%s lsr %s",regname[rt],regname[rs1],regname[rs2],regname[shift]); + output_w32(0x01C00000|rd_rn_rm(rt,rs1,rs2)|0x30|(shift<<8)); +} + +static void emit_bicne_lsr(u_int rs1,u_int rs2,u_int shift,u_int rt) +{ + assem_debug("bicne %s,%s,%s lsr %s",regname[rt],regname[rs1],regname[rs2],regname[shift]); + output_w32(0x11C00000|rd_rn_rm(rt,rs1,rs2)|0x30|(shift<<8)); +} + +static void emit_teq(int rs, int rt) +{ + assem_debug("teq %s,%s",regname[rs],regname[rt]); + output_w32(0xe1300000|rd_rn_rm(0,rs,rt)); +} + +static void emit_rsbimm(int rs, int imm, int rt) +{ + u_int armval, ret; + ret = genimm(imm,&armval); + assert(ret); + assem_debug("rsb %s,%s,#%d",regname[rt],regname[rs],imm); + output_w32(0xe2600000|rd_rn_rm(rt,rs,0)|armval); +} + +// Load 2 immediates optimizing for small code size +static void emit_mov2imm_compact(int imm1,u_int rt1,int imm2,u_int rt2) +{ + emit_movimm(imm1,rt1); + u_int armval; + if(genimm(imm2-imm1,&armval)) { + assem_debug("add %s,%s,#%d",regname[rt2],regname[rt1],imm2-imm1); + output_w32(0xe2800000|rd_rn_rm(rt2,rt1,0)|armval); + }else if(genimm(imm1-imm2,&armval)) { + assem_debug("sub %s,%s,#%d",regname[rt2],regname[rt1],imm1-imm2); + output_w32(0xe2400000|rd_rn_rm(rt2,rt1,0)|armval); + } + else emit_movimm(imm2,rt2); +} + +// Conditionally select one of two immediates, optimizing for small code size +// This will only be called if HAVE_CMOV_IMM is defined +static void emit_cmov2imm_e_ne_compact(int imm1,int imm2,u_int rt) +{ + u_int armval; + if(genimm(imm2-imm1,&armval)) { + emit_movimm(imm1,rt); + assem_debug("addne %s,%s,#%d",regname[rt],regname[rt],imm2-imm1); + output_w32(0x12800000|rd_rn_rm(rt,rt,0)|armval); + }else if(genimm(imm1-imm2,&armval)) { + emit_movimm(imm1,rt); + assem_debug("subne %s,%s,#%d",regname[rt],regname[rt],imm1-imm2); + output_w32(0x12400000|rd_rn_rm(rt,rt,0)|armval); + } + else { + #ifdef ARMv5_ONLY + emit_movimm(imm1,rt); + add_literal((int)out,imm2); + assem_debug("ldrne %s,pc+? [=%x]",regname[rt],imm2); + output_w32(0x15900000|rd_rn_rm(rt,15,0)); + #else + emit_movw(imm1&0x0000FFFF,rt); + if((imm1&0xFFFF)!=(imm2&0xFFFF)) { + assem_debug("movwne %s,#%d (0x%x)",regname[rt],imm2&0xFFFF,imm2&0xFFFF); + output_w32(0x13000000|rd_rn_rm(rt,0,0)|(imm2&0xfff)|((imm2<<4)&0xf0000)); + } + emit_movt(imm1&0xFFFF0000,rt); + if((imm1&0xFFFF0000)!=(imm2&0xFFFF0000)) { + assem_debug("movtne %s,#%d (0x%x)",regname[rt],imm2&0xffff0000,imm2&0xffff0000); + output_w32(0x13400000|rd_rn_rm(rt,0,0)|((imm2>>16)&0xfff)|((imm2>>12)&0xf0000)); + } + #endif + } +} + +#if !defined(HOST_IMM8) +// special case for checking invalid_code +static void emit_cmpmem_indexedsr12_imm(int addr,int r,int imm) +{ + assert(0); +} +#endif + +// special case for checking invalid_code +static void emit_cmpmem_indexedsr12_reg(int base,int r,int imm) +{ + assert(imm<128&&imm>=0); + assert(r>=0&&r<16); + assem_debug("ldrb lr,%s,%s lsr #12",regname[base],regname[r]); + output_w32(0xe7d00000|rd_rn_rm(HOST_TEMPREG,base,r)|0x620); + emit_cmpimm(HOST_TEMPREG,imm); +} + +// special case for tlb mapping +static void emit_addsr12(int rs1,int rs2,int rt) +{ + assem_debug("add %s,%s,%s lsr #12",regname[rt],regname[rs1],regname[rs2]); + output_w32(0xe0800620|rd_rn_rm(rt,rs1,rs2)); +} + +static void emit_callne(int a) +{ + assem_debug("blne %x",a); + u_int offset=genjmp(a); + output_w32(0x1b000000|offset); +} + +#ifdef IMM_PREFETCH +// Used to preload hash table entries +static void emit_prefetch(void *addr) +{ + assem_debug("prefetch %x",(int)addr); + output_byte(0x0F); + output_byte(0x18); + output_modrm(0,5,1); + output_w32((int)addr); +} +#endif + +#ifdef REG_PREFETCH +static void emit_prefetchreg(int r) +{ + assem_debug("pld %s",regname[r]); + output_w32(0xf5d0f000|rd_rn_rm(0,r,0)); +} +#endif + +// Special case for mini_ht +static void emit_ldreq_indexed(int rs, u_int offset, int rt) +{ + assert(offset<4096); + assem_debug("ldreq %s,[%s, #%d]",regname[rt],regname[rs],offset); + output_w32(0x05900000|rd_rn_rm(rt,rs,0)|offset); +} + +static void emit_flds(int r,int sr) +{ + assem_debug("flds s%d,[%s]",sr,regname[r]); + output_w32(0xed900a00|((sr&14)<<11)|((sr&1)<<22)|(r<<16)); +} + +static void emit_vldr(int r,int vr) +{ + assem_debug("vldr d%d,[%s]",vr,regname[r]); + output_w32(0xed900b00|(vr<<12)|(r<<16)); +} + +static void emit_fsts(int sr,int r) +{ + assem_debug("fsts s%d,[%s]",sr,regname[r]); + output_w32(0xed800a00|((sr&14)<<11)|((sr&1)<<22)|(r<<16)); +} + +static void emit_vstr(int vr,int r) +{ + assem_debug("vstr d%d,[%s]",vr,regname[r]); + output_w32(0xed800b00|(vr<<12)|(r<<16)); +} + +static void emit_ftosizs(int s,int d) +{ + assem_debug("ftosizs s%d,s%d",d,s); + output_w32(0xeebd0ac0|((d&14)<<11)|((d&1)<<22)|((s&14)>>1)|((s&1)<<5)); +} + +static void emit_ftosizd(int s,int d) +{ + assem_debug("ftosizd s%d,d%d",d,s); + output_w32(0xeebd0bc0|((d&14)<<11)|((d&1)<<22)|(s&7)); +} + +static void emit_fsitos(int s,int d) +{ + assem_debug("fsitos s%d,s%d",d,s); + output_w32(0xeeb80ac0|((d&14)<<11)|((d&1)<<22)|((s&14)>>1)|((s&1)<<5)); +} + +static void emit_fsitod(int s,int d) +{ + assem_debug("fsitod d%d,s%d",d,s); + output_w32(0xeeb80bc0|((d&7)<<12)|((s&14)>>1)|((s&1)<<5)); +} + +static void emit_fcvtds(int s,int d) +{ + assem_debug("fcvtds d%d,s%d",d,s); + output_w32(0xeeb70ac0|((d&7)<<12)|((s&14)>>1)|((s&1)<<5)); +} + +static void emit_fcvtsd(int s,int d) +{ + assem_debug("fcvtsd s%d,d%d",d,s); + output_w32(0xeeb70bc0|((d&14)<<11)|((d&1)<<22)|(s&7)); +} + +static void emit_fsqrts(int s,int d) +{ + assem_debug("fsqrts d%d,s%d",d,s); + output_w32(0xeeb10ac0|((d&14)<<11)|((d&1)<<22)|((s&14)>>1)|((s&1)<<5)); +} + +static void emit_fsqrtd(int s,int d) +{ + assem_debug("fsqrtd s%d,d%d",d,s); + output_w32(0xeeb10bc0|((d&7)<<12)|(s&7)); +} + +static void emit_fabss(int s,int d) +{ + assem_debug("fabss d%d,s%d",d,s); + output_w32(0xeeb00ac0|((d&14)<<11)|((d&1)<<22)|((s&14)>>1)|((s&1)<<5)); +} + +static void emit_fabsd(int s,int d) +{ + assem_debug("fabsd s%d,d%d",d,s); + output_w32(0xeeb00bc0|((d&7)<<12)|(s&7)); +} + +static void emit_fnegs(int s,int d) +{ + assem_debug("fnegs d%d,s%d",d,s); + output_w32(0xeeb10a40|((d&14)<<11)|((d&1)<<22)|((s&14)>>1)|((s&1)<<5)); +} + +static void emit_fnegd(int s,int d) +{ + assem_debug("fnegd s%d,d%d",d,s); + output_w32(0xeeb10b40|((d&7)<<12)|(s&7)); +} + +static void emit_fadds(int s1,int s2,int d) +{ + assem_debug("fadds s%d,s%d,s%d",d,s1,s2); + output_w32(0xee300a00|((d&14)<<11)|((d&1)<<22)|((s1&14)<<15)|((s1&1)<<7)|((s2&14)>>1)|((s2&1)<<5)); +} + +static void emit_faddd(int s1,int s2,int d) +{ + assem_debug("faddd d%d,d%d,d%d",d,s1,s2); + output_w32(0xee300b00|((d&7)<<12)|((s1&7)<<16)|(s2&7)); +} + +static void emit_fsubs(int s1,int s2,int d) +{ + assem_debug("fsubs s%d,s%d,s%d",d,s1,s2); + output_w32(0xee300a40|((d&14)<<11)|((d&1)<<22)|((s1&14)<<15)|((s1&1)<<7)|((s2&14)>>1)|((s2&1)<<5)); +} + +static void emit_fsubd(int s1,int s2,int d) +{ + assem_debug("fsubd d%d,d%d,d%d",d,s1,s2); + output_w32(0xee300b40|((d&7)<<12)|((s1&7)<<16)|(s2&7)); +} + +static void emit_fmuls(int s1,int s2,int d) +{ + assem_debug("fmuls s%d,s%d,s%d",d,s1,s2); + output_w32(0xee200a00|((d&14)<<11)|((d&1)<<22)|((s1&14)<<15)|((s1&1)<<7)|((s2&14)>>1)|((s2&1)<<5)); +} + +static void emit_fmuld(int s1,int s2,int d) +{ + assem_debug("fmuld d%d,d%d,d%d",d,s1,s2); + output_w32(0xee200b00|((d&7)<<12)|((s1&7)<<16)|(s2&7)); +} + +static void emit_fdivs(int s1,int s2,int d) +{ + assem_debug("fdivs s%d,s%d,s%d",d,s1,s2); + output_w32(0xee800a00|((d&14)<<11)|((d&1)<<22)|((s1&14)<<15)|((s1&1)<<7)|((s2&14)>>1)|((s2&1)<<5)); +} + +static void emit_fdivd(int s1,int s2,int d) +{ + assem_debug("fdivd d%d,d%d,d%d",d,s1,s2); + output_w32(0xee800b00|((d&7)<<12)|((s1&7)<<16)|(s2&7)); +} + +static void emit_fcmps(int x,int y) +{ + assem_debug("fcmps s14, s15"); + output_w32(0xeeb47a67); +} + +static void emit_fcmpd(int x,int y) +{ + assem_debug("fcmpd d6, d7"); + output_w32(0xeeb46b47); +} + +static void emit_fmstat() +{ + assem_debug("fmstat"); + output_w32(0xeef1fa10); +} + +static void emit_bicne_imm(int rs,int imm,int rt) +{ + u_int armval, ret; + ret = genimm(imm,&armval); + assert(ret); + assem_debug("bicne %s,%s,#%d",regname[rt],regname[rs],imm); + output_w32(0x13c00000|rd_rn_rm(rt,rs,0)|armval); +} + +static void emit_biccs_imm(int rs,int imm,int rt) +{ + u_int armval, ret; + ret = genimm(imm,&armval); + assert(ret); + assem_debug("biccs %s,%s,#%d",regname[rt],regname[rs],imm); + output_w32(0x23c00000|rd_rn_rm(rt,rs,0)|armval); +} + +static void emit_bicvc_imm(int rs,int imm,int rt) +{ + u_int armval, ret; + ret = genimm(imm,&armval); + assert(ret); + assem_debug("bicvc %s,%s,#%d",regname[rt],regname[rs],imm); + output_w32(0x73c00000|rd_rn_rm(rt,rs,0)|armval); +} + +static void emit_bichi_imm(int rs,int imm,int rt) +{ + u_int armval, ret; + ret = genimm(imm,&armval); + assert(ret); + assem_debug("bichi %s,%s,#%d",regname[rt],regname[rs],imm); + output_w32(0x83c00000|rd_rn_rm(rt,rs,0)|armval); +} + +static void emit_orrvs_imm(int rs,int imm,int rt) +{ + u_int armval, ret; + ret = genimm(imm,&armval); + assert(ret); + assem_debug("orrvs %s,%s,#%d",regname[rt],regname[rs],imm); + output_w32(0x63800000|rd_rn_rm(rt,rs,0)|armval); +} + +static void emit_jno_unlikely(int a) +{ + //emit_jno(a); + assem_debug("addvc pc,pc,#? (%x)",/*a-(int)out-8,*/a); + output_w32(0x72800000|rd_rn_rm(15,15,0)); +} + +// Save registers before function call +static void save_regs(u_int reglist) +{ + reglist&=0x100f; // only save the caller-save registers, r0-r3, r12 + if(!reglist) return; + assem_debug("stmia fp,{"); + if(reglist&1) assem_debug("r0, "); + if(reglist&2) assem_debug("r1, "); + if(reglist&4) assem_debug("r2, "); + if(reglist&8) assem_debug("r3, "); + if(reglist&0x1000) assem_debug("r12"); + assem_debug("}"); + output_w32(0xe88b0000|reglist); +} +// Restore registers after function call +static void restore_regs(u_int reglist) +{ + reglist&=0x100f; // only restore the caller-save registers, r0-r3, r12 + if(!reglist) return; + assem_debug("ldmia fp,{"); + if(reglist&1) assem_debug("r0, "); + if(reglist&2) assem_debug("r1, "); + if(reglist&4) assem_debug("r2, "); + if(reglist&8) assem_debug("r3, "); + if(reglist&0x1000) assem_debug("r12"); + assem_debug("}"); + output_w32(0xe89b0000|reglist); +} + +// Write back consts using r14 so we don't disturb the other registers +static void wb_consts(signed char i_regmap[],uint64_t i_is32,u_int i_dirty,int i) +{ + int hr; + for(hr=0;hr=0&&((i_dirty>>hr)&1)) { + if(((regs[i].isconst>>hr)&1)&&i_regmap[hr]>0) { + if(i_regmap[hr]<64 || !((i_is32>>(i_regmap[hr]&63))&1) ) { + int value=constmap[i][hr]; + if(value==0) { + emit_zeroreg(HOST_TEMPREG); + } + else { + emit_movimm(value,HOST_TEMPREG); + } + emit_storereg(i_regmap[hr],HOST_TEMPREG); + if((i_is32>>i_regmap[hr])&1) { + if(value!=-1&&value!=0) emit_sarimm(HOST_TEMPREG,31,HOST_TEMPREG); + emit_storereg(i_regmap[hr]|64,HOST_TEMPREG); + } + } + } + } + } +} + +/* Stubs/epilogue */ + +static void literal_pool(int n) +{ + if(!literalcount) return; + if(n) { + if((int)out-literals[0][0]<4096-n) return; + } + u_int *ptr; + int i; + for(i=0;i=0x7000000&&addr<0x7FFFFFF); + //assert((target>=0x80000000&&target<0x80800000)||(target>0xA4000000&&target<0xA4001000)); +//DEBUG > +#ifdef DEBUG_CYCLE_COUNT + emit_readword((int)&last_count,ECX); + emit_add(HOST_CCREG,ECX,HOST_CCREG); + emit_readword((int)&next_interupt,ECX); + emit_writeword(HOST_CCREG,(int)&Count); + emit_sub(HOST_CCREG,ECX,HOST_CCREG); + emit_writeword(ECX,(int)&last_count); +#endif +//DEBUG < + emit_jmp(linker); +} + +static void emit_extjump(int addr, int target) +{ + emit_extjump2(addr, target, (int)dyna_linker); +} +static void emit_extjump_ds(int addr, int target) +{ + emit_extjump2(addr, target, (int)dyna_linker_ds); +} + +static void do_readstub(int n) +{ + assem_debug("do_readstub %x",start+stubs[n][3]*4); + literal_pool(256); + set_jump_target(stubs[n][1],(int)out); + int type=stubs[n][0]; + int i=stubs[n][3]; + int rs=stubs[n][4]; + struct regstat *i_regs=(struct regstat *)stubs[n][5]; + u_int reglist=stubs[n][7]; + signed char *i_regmap=i_regs->regmap; + int addr=get_reg(i_regmap,AGEN1+(i&1)); + int rth,rt; + int ds; + if(itype[i]==C1LS||itype[i]==LOADLR) { + rth=get_reg(i_regmap,FTEMP|64); + rt=get_reg(i_regmap,FTEMP); + }else{ + rth=get_reg(i_regmap,rt1[i]|64); + rt=get_reg(i_regmap,rt1[i]); + } + assert(rs>=0); + if(addr<0) addr=rt; + if(addr<0&&itype[i]!=C1LS&&itype[i]!=LOADLR) addr=get_reg(i_regmap,-1); + assert(addr>=0); + int ftable=0; + if(type==LOADB_STUB||type==LOADBU_STUB) + ftable=(int)readmemb; + if(type==LOADH_STUB||type==LOADHU_STUB) + ftable=(int)readmemh; + if(type==LOADW_STUB) + ftable=(int)readmem; + if(type==LOADD_STUB) + ftable=(int)readmemd; + emit_writeword(rs,(int)&address); + //emit_pusha(); + save_regs(reglist); + ds=i_regs!=®s[i]; + int real_rs=(itype[i]==LOADLR)?-1:get_reg(i_regmap,rs1[i]); + u_int cmask=ds?-1:(0x100f|~i_regs->wasconst); + if(!ds) load_all_consts(regs[i].regmap_entry,regs[i].was32,regs[i].wasdirty&~(1<regmap_entry,i_regs->was32,i_regs->wasdirty&cmask&~(1<>rs1[i])&1)<<1)+ds,3); + //emit_readword((int)&last_count,temp); + //emit_add(cc,temp,cc); + //emit_writeword(cc,(int)&Count); + //emit_mov(15,14); + emit_call((int)&indirect_jump_indexed); + //emit_callreg(rs); + //emit_readword_dualindexedx4(rs,HOST_TEMPREG,15); + // We really shouldn't need to update the count here, + // but not doing so causes random crashes... + emit_readword((int)&Count,HOST_TEMPREG); + emit_readword((int)&next_interupt,2); + emit_addimm(HOST_TEMPREG,-2*stubs[n][6]-2,HOST_TEMPREG); + emit_writeword(2,(int)&last_count); + emit_sub(HOST_TEMPREG,2,cc<0?HOST_TEMPREG:cc); + if(cc<0) { + emit_storereg(CCREG,HOST_TEMPREG); + } + //emit_popa(); + restore_regs(reglist); + //if((cc=get_reg(regmap,CCREG))>=0) { + // emit_loadreg(CCREG,cc); + //} + if(rt>=0) { + if(type==LOADB_STUB) + emit_movsbl((int)&readmem_dword,rt); + if(type==LOADBU_STUB) + emit_movzbl((int)&readmem_dword,rt); + if(type==LOADH_STUB) + emit_movswl((int)&readmem_dword,rt); + if(type==LOADHU_STUB) + emit_movzwl((int)&readmem_dword,rt); + if(type==LOADW_STUB) + emit_readword((int)&readmem_dword,rt); + if(type==LOADD_STUB) { + emit_readword((int)&readmem_dword,rt); + if(rth>=0) emit_readword(((int)&readmem_dword)+4,rth); + } + } + emit_jmp(stubs[n][2]); // return address +} + +static void inline_readstub(int type, int i, u_int addr, signed char regmap[], int target, int adj, u_int reglist) +{ + int rs=get_reg(regmap,target); + int rth=get_reg(regmap,target|64); + int rt=get_reg(regmap,target); + if(rs<0) rs=get_reg(regmap,-1); + assert(rs>=0); + int ftable=0; + if(type==LOADB_STUB||type==LOADBU_STUB) + ftable=(int)readmemb; + if(type==LOADH_STUB||type==LOADHU_STUB) + ftable=(int)readmemh; + if(type==LOADW_STUB) + ftable=(int)readmem; + if(type==LOADD_STUB) + ftable=(int)readmemd; + emit_writeword(rs,(int)&address); + //emit_pusha(); + save_regs(reglist); + if((signed int)addr>=(signed int)0xC0000000) { + // Theoretically we can have a pagefault here, if the TLB has never + // been enabled and the address is outside the range 80000000..BFFFFFFF + // Write out the registers so the pagefault can be handled. This is + // a very rare case and likely represents a bug. + int ds=regmap!=regs[i].regmap; + if(!ds) load_all_consts(regs[i].regmap_entry,regs[i].was32,regs[i].wasdirty,i); + if(!ds) wb_dirtys(regs[i].regmap_entry,regs[i].was32,regs[i].wasdirty); + else wb_dirtys(branch_regs[i-1].regmap_entry,branch_regs[i-1].was32,branch_regs[i-1].wasdirty); + } + //emit_shrimm(rs,16,1); + int cc=get_reg(regmap,CCREG); + if(cc<0) { + emit_loadreg(CCREG,2); + } + //emit_movimm(ftable,0); + emit_movimm(((u_int *)ftable)[addr>>16],0); + //emit_readword((int)&last_count,12); + emit_addimm(cc<0?2:cc,CLOCK_DIVIDER*(adj+1),2); + if((signed int)addr>=(signed int)0xC0000000) { + // Pagefault address + int ds=regmap!=regs[i].regmap; + emit_movimm(start+i*4+(((regs[i].was32>>rs1[i])&1)<<1)+ds,3); + } + //emit_add(12,2,2); + //emit_writeword(2,(int)&Count); + //emit_call(((u_int *)ftable)[addr>>16]); + emit_call((int)&indirect_jump); + // We really shouldn't need to update the count here, + // but not doing so causes random crashes... + emit_readword((int)&Count,HOST_TEMPREG); + emit_readword((int)&next_interupt,2); + emit_addimm(HOST_TEMPREG,-CLOCK_DIVIDER*(adj+1),HOST_TEMPREG); + emit_writeword(2,(int)&last_count); + emit_sub(HOST_TEMPREG,2,cc<0?HOST_TEMPREG:cc); + if(cc<0) { + emit_storereg(CCREG,HOST_TEMPREG); + } + //emit_popa(); + restore_regs(reglist); + if(rt>=0) { + if(type==LOADB_STUB) + emit_movsbl((int)&readmem_dword,rt); + if(type==LOADBU_STUB) + emit_movzbl((int)&readmem_dword,rt); + if(type==LOADH_STUB) + emit_movswl((int)&readmem_dword,rt); + if(type==LOADHU_STUB) + emit_movzwl((int)&readmem_dword,rt); + if(type==LOADW_STUB) + emit_readword((int)&readmem_dword,rt); + if(type==LOADD_STUB) { + emit_readword((int)&readmem_dword,rt); + if(rth>=0) emit_readword(((int)&readmem_dword)+4,rth); + } + } +} + +static void do_writestub(int n) +{ + assem_debug("do_writestub %x",start+stubs[n][3]*4); + literal_pool(256); + set_jump_target(stubs[n][1],(int)out); + int type=stubs[n][0]; + int i=stubs[n][3]; + int rs=stubs[n][4]; + struct regstat *i_regs=(struct regstat *)stubs[n][5]; + u_int reglist=stubs[n][7]; + signed char *i_regmap=i_regs->regmap; + int addr=get_reg(i_regmap,AGEN1+(i&1)); + int rth,rt,r; + int ds; + if(itype[i]==C1LS) { + rth=get_reg(i_regmap,FTEMP|64); + rt=get_reg(i_regmap,r=FTEMP); + }else{ + rth=get_reg(i_regmap,rs2[i]|64); + rt=get_reg(i_regmap,r=rs2[i]); + } + assert(rs>=0); + assert(rt>=0); + if(addr<0) addr=get_reg(i_regmap,-1); + assert(addr>=0); + int ftable=0; + if(type==STOREB_STUB) + ftable=(int)writememb; + if(type==STOREH_STUB) + ftable=(int)writememh; + if(type==STOREW_STUB) + ftable=(int)writemem; + if(type==STORED_STUB) + ftable=(int)writememd; + emit_writeword(rs,(int)&address); + //emit_shrimm(rs,16,rs); + //emit_movmem_indexedx4(ftable,rs,rs); + if(type==STOREB_STUB) + emit_writebyte(rt,(int)&cpu_byte); + if(type==STOREH_STUB) + emit_writehword(rt,(int)&hword); + if(type==STOREW_STUB) + emit_writeword(rt,(int)&word); + if(type==STORED_STUB) { + emit_writeword(rt,(int)&dword); + emit_writeword(r?rth:rt,(int)&dword+4); + } + //emit_pusha(); + save_regs(reglist); + ds=i_regs!=®s[i]; + int real_rs=get_reg(i_regmap,rs1[i]); + u_int cmask=ds?-1:(0x100f|~i_regs->wasconst); + if(!ds) load_all_consts(regs[i].regmap_entry,regs[i].was32,regs[i].wasdirty&~(1<regmap_entry,i_regs->was32,i_regs->wasdirty&cmask&~(1<>rs1[i])&1)<<1)+ds,3); + //emit_readword((int)&last_count,temp); + //emit_addimm(cc,2*stubs[n][5]+2,cc); + //emit_add(cc,temp,cc); + //emit_writeword(cc,(int)&Count); + emit_call((int)&indirect_jump_indexed); + //emit_callreg(rs); + emit_readword((int)&Count,HOST_TEMPREG); + emit_readword((int)&next_interupt,2); + emit_addimm(HOST_TEMPREG,-2*stubs[n][6]-2,HOST_TEMPREG); + emit_writeword(2,(int)&last_count); + emit_sub(HOST_TEMPREG,2,cc<0?HOST_TEMPREG:cc); + if(cc<0) { + emit_storereg(CCREG,HOST_TEMPREG); + } + //emit_popa(); + restore_regs(reglist); + //if((cc=get_reg(regmap,CCREG))>=0) { + // emit_loadreg(CCREG,cc); + //} + emit_jmp(stubs[n][2]); // return address +} + +static void inline_writestub(int type, int i, u_int addr, signed char regmap[], int target, int adj, u_int reglist) +{ + int rs=get_reg(regmap,-1); + int rth=get_reg(regmap,target|64); + int rt=get_reg(regmap,target); + assert(rs>=0); + assert(rt>=0); + int ftable=0; + if(type==STOREB_STUB) + ftable=(int)writememb; + if(type==STOREH_STUB) + ftable=(int)writememh; + if(type==STOREW_STUB) + ftable=(int)writemem; + if(type==STORED_STUB) + ftable=(int)writememd; + emit_writeword(rs,(int)&address); + //emit_shrimm(rs,16,rs); + //emit_movmem_indexedx4(ftable,rs,rs); + if(type==STOREB_STUB) + emit_writebyte(rt,(int)&cpu_byte); + if(type==STOREH_STUB) + emit_writehword(rt,(int)&hword); + if(type==STOREW_STUB) + emit_writeword(rt,(int)&word); + if(type==STORED_STUB) { + emit_writeword(rt,(int)&dword); + emit_writeword(target?rth:rt,(int)&dword+4); + } + //emit_pusha(); + save_regs(reglist); + if((signed int)addr>=(signed int)0xC0000000) { + // Theoretically we can have a pagefault here, if the TLB has never + // been enabled and the address is outside the range 80000000..BFFFFFFF + // Write out the registers so the pagefault can be handled. This is + // a very rare case and likely represents a bug. + int ds=regmap!=regs[i].regmap; + if(!ds) load_all_consts(regs[i].regmap_entry,regs[i].was32,regs[i].wasdirty,i); + if(!ds) wb_dirtys(regs[i].regmap_entry,regs[i].was32,regs[i].wasdirty); + else wb_dirtys(branch_regs[i-1].regmap_entry,branch_regs[i-1].was32,branch_regs[i-1].wasdirty); + } + //emit_shrimm(rs,16,1); + int cc=get_reg(regmap,CCREG); + if(cc<0) { + emit_loadreg(CCREG,2); + } + //emit_movimm(ftable,0); + emit_movimm(((u_int *)ftable)[addr>>16],0); + //emit_readword((int)&last_count,12); + emit_addimm(cc<0?2:cc,CLOCK_DIVIDER*(adj+1),2); + if((signed int)addr>=(signed int)0xC0000000) { + // Pagefault address + int ds=regmap!=regs[i].regmap; + emit_movimm(start+i*4+(((regs[i].was32>>rs1[i])&1)<<1)+ds,3); + } + //emit_add(12,2,2); + //emit_writeword(2,(int)&Count); + //emit_call(((u_int *)ftable)[addr>>16]); + emit_call((int)&indirect_jump); + emit_readword((int)&Count,HOST_TEMPREG); + emit_readword((int)&next_interupt,2); + emit_addimm(HOST_TEMPREG,-CLOCK_DIVIDER*(adj+1),HOST_TEMPREG); + emit_writeword(2,(int)&last_count); + emit_sub(HOST_TEMPREG,2,cc<0?HOST_TEMPREG:cc); + if(cc<0) { + emit_storereg(CCREG,HOST_TEMPREG); + } + //emit_popa(); + restore_regs(reglist); +} + +static void do_unalignedwritestub(int n) +{ + set_jump_target(stubs[n][1],(int)out); + output_w32(0xef000000); + emit_jmp(stubs[n][2]); // return address +} + +void printregs(int edi,int esi,int ebp,int esp,int b,int d,int c,int a) +{ + DebugMessage(M64MSG_VERBOSE, "regs: %x %x %x %x %x %x %x (%x)",a,b,c,d,ebp,esi,edi,(&edi)[-1]); +} + +static void do_invstub(int n) +{ + literal_pool(20); + u_int reglist=stubs[n][3]; + set_jump_target(stubs[n][1],(int)out); + save_regs(reglist); + if(stubs[n][4]!=0) emit_mov(stubs[n][4],0); + emit_call((int)&invalidate_addr); + restore_regs(reglist); + emit_jmp(stubs[n][2]); // return address +} + +static int do_dirty_stub(int i) +{ + assem_debug("do_dirty_stub %x",start+i*4); + // Careful about the code output here, verify_dirty needs to parse it. + #ifdef ARMv5_ONLY + emit_loadlp((int)start<(int)0xC0000000?(int)source:(int)start,1); + emit_loadlp((int)copy,2); + emit_loadlp(slen*4,3); + #else + emit_movw(((int)start<(int)0xC0000000?(u_int)source:(u_int)start)&0x0000FFFF,1); + emit_movw(((u_int)copy)&0x0000FFFF,2); + emit_movt(((int)start<(int)0xC0000000?(u_int)source:(u_int)start)&0xFFFF0000,1); + emit_movt(((u_int)copy)&0xFFFF0000,2); + emit_movw(slen*4,3); + #endif + emit_movimm(start+i*4,0); + emit_call((int)start<(int)0xC0000000?(int)&verify_code:(int)&verify_code_vm); + int entry=(int)out; + load_regs_entry(i); + if(entry==(int)out) entry=instr_addr[i]; + emit_jmp(instr_addr[i]); + return entry; +} + +static void do_dirty_stub_ds() +{ + // Careful about the code output here, verify_dirty needs to parse it. + #ifdef ARMv5_ONLY + emit_loadlp((int)start<(int)0xC0000000?(int)source:(int)start,1); + emit_loadlp((int)copy,2); + emit_loadlp(slen*4,3); + #else + emit_movw(((int)start<(int)0xC0000000?(u_int)source:(u_int)start)&0x0000FFFF,1); + emit_movw(((u_int)copy)&0x0000FFFF,2); + emit_movt(((int)start<(int)0xC0000000?(u_int)source:(u_int)start)&0xFFFF0000,1); + emit_movt(((u_int)copy)&0xFFFF0000,2); + emit_movw(slen*4,3); + #endif + emit_movimm(start+1,0); + emit_call((int)&verify_code_ds); +} + +static void do_cop1stub(int n) +{ + literal_pool(256); + assem_debug("do_cop1stub %x",start+stubs[n][3]*4); + set_jump_target(stubs[n][1],(int)out); + int i=stubs[n][3]; + int rs=stubs[n][4]; + struct regstat *i_regs=(struct regstat *)stubs[n][5]; + int ds=stubs[n][6]; + if(!ds) { + load_all_consts(regs[i].regmap_entry,regs[i].was32,regs[i].wasdirty,i); + //if(i_regs!=®s[i]) DebugMessage(M64MSG_VERBOSE, "oops: regs[i]=%x i_regs=%x",(int)®s[i],(int)i_regs); + } + //else {DebugMessage(M64MSG_ERROR, "fp exception in delay slot");} + wb_dirtys(i_regs->regmap_entry,i_regs->was32,i_regs->wasdirty); + if(regs[i].regmap_entry[HOST_CCREG]!=CCREG) emit_loadreg(CCREG,HOST_CCREG); + emit_movimm(start+(i-ds)*4,EAX); // Get PC + emit_addimm(HOST_CCREG,CLOCK_DIVIDER*ccadj[i],HOST_CCREG); // CHECK: is this right? There should probably be an extra cycle... + emit_jmp(ds?(int)fp_exception_ds:(int)fp_exception); +} + +/* TLB */ + +static int do_tlb_r(int s,int ar,int map,int cache,int x,int a,int shift,int c,u_int addr) +{ + if(c) { + if((signed int)addr>=(signed int)0xC0000000) { + // address_generation already loaded the const + emit_readword_dualindexedx4(FP,map,map); + } + else + return -1; // No mapping + } + else { + assert(s!=map); + if(cache>=0) { + // Use cached offset to memory map + emit_addsr12(cache,s,map); + }else{ + emit_movimm(((int)memory_map-(int)&dynarec_local)>>2,map); + emit_addsr12(map,s,map); + } + // Schedule this while we wait on the load + //if(x) emit_xorimm(s,x,ar); + if(shift>=0) emit_shlimm(s,3,shift); + if(~a) emit_andimm(s,a,ar); + emit_readword_dualindexedx4(FP,map,map); + } + return map; +} +static int do_tlb_r_branch(int map, int c, u_int addr, int *jaddr) +{ + if(!c||(signed int)addr>=(signed int)0xC0000000) { + emit_test(map,map); + *jaddr=(int)out; + emit_js(0); + } + return map; +} + +static void gen_tlb_addr_r(int ar, int map) { + if(map>=0) { + assem_debug("add %s,%s,%s lsl #2",regname[ar],regname[ar],regname[map]); + output_w32(0xe0800100|rd_rn_rm(ar,ar,map)); + } +} + +static int do_tlb_w(int s,int ar,int map,int cache,int x,int c,u_int addr) +{ + if(c) { + if(addr<0x80800000||addr>=0xC0000000) { + // address_generation already loaded the const + emit_readword_dualindexedx4(FP,map,map); + } + else + return -1; // No mapping + } + else { + assert(s!=map); + if(cache>=0) { + // Use cached offset to memory map + emit_addsr12(cache,s,map); + }else{ + emit_movimm(((int)memory_map-(int)&dynarec_local)>>2,map); + emit_addsr12(map,s,map); + } + // Schedule this while we wait on the load + //if(x) emit_xorimm(s,x,ar); + emit_readword_dualindexedx4(FP,map,map); + } + return map; +} +static void do_tlb_w_branch(int map, int c, u_int addr, int *jaddr) +{ + if(!c||addr<0x80800000||addr>=0xC0000000) { + emit_testimm(map,0x40000000); + *jaddr=(int)out; + emit_jne(0); + } +} + +static void gen_tlb_addr_w(int ar, int map) { + if(map>=0) { + assem_debug("add %s,%s,%s lsl #2",regname[ar],regname[ar],regname[map]); + output_w32(0xe0800100|rd_rn_rm(ar,ar,map)); + } +} + +// This reverses the above operation +static void gen_orig_addr_w(int ar, int map) { + if(map>=0) { + assem_debug("sub %s,%s,%s lsl #2",regname[ar],regname[ar],regname[map]); + output_w32(0xe0400100|rd_rn_rm(ar,ar,map)); + } +} + +// Generate the address of the memory_map entry, relative to dynarec_local +static void generate_map_const(u_int addr,int reg) { + //DebugMessage(M64MSG_VERBOSE, "generate_map_const(%x,%s)",addr,regname[reg]); + emit_movimm((addr>>12)+(((u_int)memory_map-(u_int)&dynarec_local)>>2),reg); +} + +/* Special assem */ + +static void shift_assemble_arm(int i,struct regstat *i_regs) +{ + if(rt1[i]) { + if(opcode2[i]<=0x07) // SLLV/SRLV/SRAV + { + signed char s,t,shift; + t=get_reg(i_regs->regmap,rt1[i]); + s=get_reg(i_regs->regmap,rs1[i]); + shift=get_reg(i_regs->regmap,rs2[i]); + if(t>=0){ + if(rs1[i]==0) + { + emit_zeroreg(t); + } + else if(rs2[i]==0) + { + assert(s>=0); + if(s!=t) emit_mov(s,t); + } + else + { + emit_andimm(shift,31,HOST_TEMPREG); + if(opcode2[i]==4) // SLLV + { + emit_shl(s,HOST_TEMPREG,t); + } + if(opcode2[i]==6) // SRLV + { + emit_shr(s,HOST_TEMPREG,t); + } + if(opcode2[i]==7) // SRAV + { + emit_sar(s,HOST_TEMPREG,t); + } + } + } + } else { // DSLLV/DSRLV/DSRAV + signed char sh,sl,th,tl,shift; + th=get_reg(i_regs->regmap,rt1[i]|64); + tl=get_reg(i_regs->regmap,rt1[i]); + sh=get_reg(i_regs->regmap,rs1[i]|64); + sl=get_reg(i_regs->regmap,rs1[i]); + shift=get_reg(i_regs->regmap,rs2[i]); + if(tl>=0){ + if(rs1[i]==0) + { + emit_zeroreg(tl); + if(th>=0) emit_zeroreg(th); + } + else if(rs2[i]==0) + { + assert(sl>=0); + if(sl!=tl) emit_mov(sl,tl); + if(th>=0&&sh!=th) emit_mov(sh,th); + } + else + { + // FIXME: What if shift==tl ? + assert(shift!=tl); + int temp=get_reg(i_regs->regmap,-1); + int real_th=th; + if(th<0&&opcode2[i]!=0x14) {th=temp;} // DSLLV doesn't need a temporary register + assert(sl>=0); + assert(sh>=0); + emit_andimm(shift,31,HOST_TEMPREG); + if(opcode2[i]==0x14) // DSLLV + { + if(th>=0) emit_shl(sh,HOST_TEMPREG,th); + emit_rsbimm(HOST_TEMPREG,32,HOST_TEMPREG); + emit_orrshr(sl,HOST_TEMPREG,th); + emit_andimm(shift,31,HOST_TEMPREG); + emit_testimm(shift,32); + emit_shl(sl,HOST_TEMPREG,tl); + if(th>=0) emit_cmovne_reg(tl,th); + emit_cmovne_imm(0,tl); + } + if(opcode2[i]==0x16) // DSRLV + { + assert(th>=0); + emit_shr(sl,HOST_TEMPREG,tl); + emit_rsbimm(HOST_TEMPREG,32,HOST_TEMPREG); + emit_orrshl(sh,HOST_TEMPREG,tl); + emit_andimm(shift,31,HOST_TEMPREG); + emit_testimm(shift,32); + emit_shr(sh,HOST_TEMPREG,th); + emit_cmovne_reg(th,tl); + if(real_th>=0) emit_cmovne_imm(0,th); + } + if(opcode2[i]==0x17) // DSRAV + { + assert(th>=0); + emit_shr(sl,HOST_TEMPREG,tl); + emit_rsbimm(HOST_TEMPREG,32,HOST_TEMPREG); + if(real_th>=0) { + assert(temp>=0); + emit_sarimm(th,31,temp); + } + emit_orrshl(sh,HOST_TEMPREG,tl); + emit_andimm(shift,31,HOST_TEMPREG); + emit_testimm(shift,32); + emit_sar(sh,HOST_TEMPREG,th); + emit_cmovne_reg(th,tl); + if(real_th>=0) emit_cmovne_reg(temp,th); + } + } + } + } + } +} +#define shift_assemble shift_assemble_arm + +static void loadlr_assemble_arm(int i,struct regstat *i_regs) +{ + int s,th,tl,temp,temp2,addr,map=-1,cache=-1; + int offset; + int jaddr=0; + int memtarget,c=0; + u_int hr,reglist=0; + th=get_reg(i_regs->regmap,rt1[i]|64); + tl=get_reg(i_regs->regmap,rt1[i]); + s=get_reg(i_regs->regmap,rs1[i]); + temp=get_reg(i_regs->regmap,-1); + temp2=get_reg(i_regs->regmap,FTEMP); + addr=get_reg(i_regs->regmap,AGEN1+(i&1)); + assert(addr<0); + offset=imm[i]; + for(hr=0;hrregmap[hr]>=0) reglist|=1<=0) { + c=(i_regs->wasconst>>s)&1; + memtarget=((signed int)(constmap[i][s]+offset))<(signed int)0x80800000; + if(using_tlb&&((signed int)(constmap[i][s]+offset))>=(signed int)0xC0000000) memtarget=1; + } + if(!using_tlb) { + if(!c) { + #ifdef RAM_OFFSET + map=get_reg(i_regs->regmap,ROREG); + if(map<0) emit_loadreg(ROREG,map=HOST_TEMPREG); + #endif + emit_shlimm(addr,3,temp); + if (opcode[i]==0x22||opcode[i]==0x26) { + emit_andimm(addr,0xFFFFFFFC,temp2); // LWL/LWR + }else{ + emit_andimm(addr,0xFFFFFFF8,temp2); // LDL/LDR + } + emit_cmpimm(addr,0x800000); + jaddr=(int)out; + emit_jno(0); + } + else { + if (opcode[i]==0x22||opcode[i]==0x26) { + emit_movimm(((constmap[i][s]+offset)<<3)&24,temp); // LWL/LWR + }else{ + emit_movimm(((constmap[i][s]+offset)<<3)&56,temp); // LDL/LDR + } + } + }else{ // using tlb + int a; + if(c) { + a=-1; + }else if (opcode[i]==0x22||opcode[i]==0x26) { + a=0xFFFFFFFC; // LWL/LWR + }else{ + a=0xFFFFFFF8; // LDL/LDR + } + map=get_reg(i_regs->regmap,TLREG); + cache=get_reg(i_regs->regmap,MMREG); // Get cached offset to memory_map + assert(map>=0); + reglist&=~(1<regmap,FTEMP,ccadj[i],reglist); + if(rt1[i]) { + assert(tl>=0); + emit_andimm(temp,24,temp); + if (opcode[i]==0x26) emit_xorimm(temp,24,temp); // LWR + emit_movimm(-1,HOST_TEMPREG); + if (opcode[i]==0x26) { + emit_shr(temp2,temp,temp2); + emit_bic_lsr(tl,HOST_TEMPREG,temp,tl); + }else{ + emit_shl(temp2,temp,temp2); + emit_bic_lsl(tl,HOST_TEMPREG,temp,tl); + } + emit_or(temp2,tl,tl); + } + //emit_storereg(rt1[i],tl); // DEBUG + } + if (opcode[i]==0x1A||opcode[i]==0x1B) { // LDL/LDR + int temp2h=get_reg(i_regs->regmap,FTEMP|64); + if(!c||memtarget) { + //if(th>=0) emit_readword_indexed((int)rdram-0x80000000,temp2,temp2h); + //emit_readword_indexed((int)rdram-0x7FFFFFFC,temp2,temp2); + emit_readdword_indexed_tlb(0,temp2,map,temp2h,temp2); + if(jaddr) add_stub(LOADD_STUB,jaddr,(int)out,i,temp2,(int)i_regs,ccadj[i],reglist); + } + else + inline_readstub(LOADD_STUB,i,(constmap[i][s]+offset)&0xFFFFFFF8,i_regs->regmap,FTEMP,ccadj[i],reglist); + if(rt1[i]) { + assert(th>=0); + assert(tl>=0); + emit_testimm(temp,32); + emit_andimm(temp,24,temp); + if (opcode[i]==0x1A) { // LDL + emit_rsbimm(temp,32,HOST_TEMPREG); + emit_shl(temp2h,temp,temp2h); + emit_orrshr(temp2,HOST_TEMPREG,temp2h); + emit_movimm(-1,HOST_TEMPREG); + emit_shl(temp2,temp,temp2); + emit_cmove_reg(temp2h,th); + emit_biceq_lsl(tl,HOST_TEMPREG,temp,tl); + emit_bicne_lsl(th,HOST_TEMPREG,temp,th); + emit_orreq(temp2,tl,tl); + emit_orrne(temp2,th,th); + } + if (opcode[i]==0x1B) { // LDR + emit_xorimm(temp,24,temp); + emit_rsbimm(temp,32,HOST_TEMPREG); + emit_shr(temp2,temp,temp2); + emit_orrshl(temp2h,HOST_TEMPREG,temp2); + emit_movimm(-1,HOST_TEMPREG); + emit_shr(temp2h,temp,temp2h); + emit_cmovne_reg(temp2,tl); + emit_bicne_lsr(th,HOST_TEMPREG,temp,th); + emit_biceq_lsr(tl,HOST_TEMPREG,temp,tl); + emit_orrne(temp2h,th,th); + emit_orreq(temp2h,tl,tl); + } + } + } +} +#define loadlr_assemble loadlr_assemble_arm + +static void cop0_assemble(int i,struct regstat *i_regs) +{ + if(opcode2[i]==0) // MFC0 + { + if(rt1[i]) { + signed char t=get_reg(i_regs->regmap,rt1[i]); + char copr=(source[i]>>11)&0x1f; + if(t>=0) { + emit_addimm(FP,(int)&fake_pc-(int)&dynarec_local,0); + emit_movimm((source[i]>>11)&0x1f,1); + emit_writeword(0,(int)&PC); + emit_writebyte(1,(int)&(fake_pc.f.r.nrd)); + if(copr==9) { + emit_readword((int)&last_count,ECX); + emit_loadreg(CCREG,HOST_CCREG); // TODO: do proper reg alloc + emit_add(HOST_CCREG,ECX,HOST_CCREG); + emit_addimm(HOST_CCREG,CLOCK_DIVIDER*ccadj[i],HOST_CCREG); + emit_writeword(HOST_CCREG,(int)&Count); + } + emit_call((int)cached_interpreter_table.MFC0); + emit_readword((int)&readmem_dword,t); + } + } + } + else if(opcode2[i]==4) // MTC0 + { + signed char s=get_reg(i_regs->regmap,rs1[i]); + char copr=(source[i]>>11)&0x1f; + assert(s>=0); + emit_writeword(s,(int)&readmem_dword); + wb_register(rs1[i],i_regs->regmap,i_regs->dirty,i_regs->is32); + emit_addimm(FP,(int)&fake_pc-(int)&dynarec_local,0); + emit_movimm((source[i]>>11)&0x1f,1); + emit_writeword(0,(int)&PC); + emit_writebyte(1,(int)&(fake_pc.f.r.nrd)); + if(copr==9||copr==11||copr==12) { + emit_readword((int)&last_count,ECX); + emit_loadreg(CCREG,HOST_CCREG); // TODO: do proper reg alloc + emit_add(HOST_CCREG,ECX,HOST_CCREG); + emit_addimm(HOST_CCREG,CLOCK_DIVIDER*ccadj[i],HOST_CCREG); + emit_writeword(HOST_CCREG,(int)&Count); + } + // What a mess. The status register (12) can enable interrupts, + // so needs a special case to handle a pending interrupt. + // The interrupt must be taken immediately, because a subsequent + // instruction might disable interrupts again. + if(copr==12&&!is_delayslot) { + emit_movimm(start+i*4+4,0); + emit_movimm(0,1); + emit_writeword(0,(int)&pcaddr); + emit_writeword(1,(int)&pending_exception); + } + //else if(copr==12&&is_delayslot) emit_call((int)MTC0_R12); + //else + emit_call((int)cached_interpreter_table.MTC0); + if(copr==9||copr==11||copr==12) { + emit_readword((int)&Count,HOST_CCREG); + emit_readword((int)&next_interupt,ECX); + emit_addimm(HOST_CCREG,-CLOCK_DIVIDER*ccadj[i],HOST_CCREG); + emit_sub(HOST_CCREG,ECX,HOST_CCREG); + emit_writeword(ECX,(int)&last_count); + emit_storereg(CCREG,HOST_CCREG); + } + if(copr==12) { + assert(!is_delayslot); + emit_readword((int)&pending_exception,14); + } + emit_loadreg(rs1[i],s); + if(get_reg(i_regs->regmap,rs1[i]|64)>=0) + emit_loadreg(rs1[i]|64,get_reg(i_regs->regmap,rs1[i]|64)); + if(copr==12) { + emit_test(14,14); + emit_jne((int)&do_interrupt); + } + cop1_usable=0; + } + else + { + assert(opcode2[i]==0x10); + if((source[i]&0x3f)==0x01) // TLBR + emit_call((int)cached_interpreter_table.TLBR); + if((source[i]&0x3f)==0x02) // TLBWI + emit_call((int)TLBWI_new); + if((source[i]&0x3f)==0x06) { // TLBWR + // The TLB entry written by TLBWR is dependent on the count, + // so update the cycle count + emit_readword((int)&last_count,ECX); + if(i_regs->regmap[HOST_CCREG]!=CCREG) emit_loadreg(CCREG,HOST_CCREG); + emit_add(HOST_CCREG,ECX,HOST_CCREG); + emit_addimm(HOST_CCREG,CLOCK_DIVIDER*ccadj[i],HOST_CCREG); + emit_writeword(HOST_CCREG,(int)&Count); + emit_call((int)TLBWR_new); + } + if((source[i]&0x3f)==0x08) // TLBP + emit_call((int)cached_interpreter_table.TLBP); + if((source[i]&0x3f)==0x18) // ERET + { + int count=ccadj[i]; + if(i_regs->regmap[HOST_CCREG]!=CCREG) emit_loadreg(CCREG,HOST_CCREG); + emit_addimm(HOST_CCREG,CLOCK_DIVIDER*count,HOST_CCREG); // TODO: Should there be an extra cycle here? + emit_jmp((int)jump_eret); + } + } +} + +static void cop1_assemble(int i,struct regstat *i_regs) +{ + // Check cop1 unusable + if(!cop1_usable) { + signed char rs=get_reg(i_regs->regmap,CSREG); + assert(rs>=0); + emit_testimm(rs,0x20000000); + int jaddr=(int)out; + emit_jeq(0); + add_stub(FP_STUB,jaddr,(int)out,i,rs,(int)i_regs,is_delayslot,0); + cop1_usable=1; + } + if (opcode2[i]==0) { // MFC1 + signed char tl=get_reg(i_regs->regmap,rt1[i]); + if(tl>=0) { + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],tl); + emit_readword_indexed(0,tl,tl); + } + } + else if (opcode2[i]==1) { // DMFC1 + signed char tl=get_reg(i_regs->regmap,rt1[i]); + signed char th=get_reg(i_regs->regmap,rt1[i]|64); + if(tl>=0) { + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],tl); + if(th>=0) emit_readword_indexed(4,tl,th); + emit_readword_indexed(0,tl,tl); + } + } + else if (opcode2[i]==4) { // MTC1 + signed char sl=get_reg(i_regs->regmap,rs1[i]); + signed char temp=get_reg(i_regs->regmap,-1); + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],temp); + emit_writeword_indexed(sl,0,temp); + } + else if (opcode2[i]==5) { // DMTC1 + signed char sl=get_reg(i_regs->regmap,rs1[i]); + signed char sh=rs1[i]>0?get_reg(i_regs->regmap,rs1[i]|64):sl; + signed char temp=get_reg(i_regs->regmap,-1); + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],temp); + emit_writeword_indexed(sh,4,temp); + emit_writeword_indexed(sl,0,temp); + } + else if (opcode2[i]==2) // CFC1 + { + signed char tl=get_reg(i_regs->regmap,rt1[i]); + if(tl>=0) { + u_int copr=(source[i]>>11)&0x1f; + if(copr==0) emit_readword((int)&FCR0,tl); + if(copr==31) emit_readword((int)&FCR31,tl); + } + } + else if (opcode2[i]==6) // CTC1 + { + signed char sl=get_reg(i_regs->regmap,rs1[i]); + u_int copr=(source[i]>>11)&0x1f; + assert(sl>=0); + if(copr==31) + { + emit_writeword(sl,(int)&FCR31); + // Set the rounding mode + //FIXME + //char temp=get_reg(i_regs->regmap,-1); + //emit_andimm(sl,3,temp); + //emit_fldcw_indexed((int)&rounding_modes,temp); + } + } +} + +static void fconv_assemble_arm(int i,struct regstat *i_regs) +{ + signed char temp=get_reg(i_regs->regmap,-1); + assert(temp>=0); + // Check cop1 unusable + if(!cop1_usable) { + signed char rs=get_reg(i_regs->regmap,CSREG); + assert(rs>=0); + emit_testimm(rs,0x20000000); + int jaddr=(int)out; + emit_jeq(0); + add_stub(FP_STUB,jaddr,(int)out,i,rs,(int)i_regs,is_delayslot,0); + cop1_usable=1; + } + + #if (defined(__VFP_FP__) && !defined(__SOFTFP__)) + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x0d) { // trunc_w_s + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],temp); + emit_flds(temp,15); + emit_ftosizs(15,15); // float->int, truncate + if(((source[i]>>11)&0x1f)!=((source[i]>>6)&0x1f)) + emit_readword((int)®_cop1_simple[(source[i]>>6)&0x1f],temp); + emit_fsts(15,temp); + return; + } + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x0d) { // trunc_w_d + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],temp); + emit_vldr(temp,7); + emit_ftosizd(7,13); // double->int, truncate + emit_readword((int)®_cop1_simple[(source[i]>>6)&0x1f],temp); + emit_fsts(13,temp); + return; + } + + if(opcode2[i]==0x14&&(source[i]&0x3f)==0x20) { // cvt_s_w + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],temp); + emit_flds(temp,13); + if(((source[i]>>11)&0x1f)!=((source[i]>>6)&0x1f)) + emit_readword((int)®_cop1_simple[(source[i]>>6)&0x1f],temp); + emit_fsitos(13,15); + emit_fsts(15,temp); + return; + } + if(opcode2[i]==0x14&&(source[i]&0x3f)==0x21) { // cvt_d_w + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],temp); + emit_flds(temp,13); + emit_readword((int)®_cop1_double[(source[i]>>6)&0x1f],temp); + emit_fsitod(13,7); + emit_vstr(7,temp); + return; + } + + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x21) { // cvt_d_s + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],temp); + emit_flds(temp,13); + emit_readword((int)®_cop1_double[(source[i]>>6)&0x1f],temp); + emit_fcvtds(13,7); + emit_vstr(7,temp); + return; + } + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x20) { // cvt_s_d + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],temp); + emit_vldr(temp,7); + emit_readword((int)®_cop1_simple[(source[i]>>6)&0x1f],temp); + emit_fcvtsd(7,13); + emit_fsts(13,temp); + return; + } + #endif + + // C emulation code + + u_int hr,reglist=0; + for(hr=0;hrregmap[hr]>=0) reglist|=1<>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_simple[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)cvt_s_w); + } + if(opcode2[i]==0x14&&(source[i]&0x3f)==0x21) { + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_double[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)cvt_d_w); + } + if(opcode2[i]==0x15&&(source[i]&0x3f)==0x20) { + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_simple[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)cvt_s_l); + } + if(opcode2[i]==0x15&&(source[i]&0x3f)==0x21) { + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_double[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)cvt_d_l); + } + + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x21) { + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_double[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)cvt_d_s); + } + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x24) { + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_simple[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)cvt_w_s); + } + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x25) { + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_double[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)cvt_l_s); + } + + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x20) { + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_simple[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)cvt_s_d); + } + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x24) { + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_simple[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)cvt_w_d); + } + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x25) { + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_double[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)cvt_l_d); + } + + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x08) { + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_double[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)round_l_s); + } + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x09) { + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_double[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)trunc_l_s); + } + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x0a) { + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_double[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)ceil_l_s); + } + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x0b) { + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_double[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)floor_l_s); + } + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x0c) { + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_simple[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)round_w_s); + } + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x0d) { + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_simple[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)trunc_w_s); + } + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x0e) { + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_simple[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)ceil_w_s); + } + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x0f) { + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_simple[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)floor_w_s); + } + + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x08) { + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_double[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)round_l_d); + } + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x09) { + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_double[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)trunc_l_d); + } + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x0a) { + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_double[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)ceil_l_d); + } + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x0b) { + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_double[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)floor_l_d); + } + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x0c) { + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_simple[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)round_w_d); + } + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x0d) { + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_simple[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)trunc_w_d); + } + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x0e) { + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_simple[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)ceil_w_d); + } + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x0f) { + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_simple[(source[i]>> 6)&0x1f],ARG2_REG); + emit_call((int)floor_w_d); + } + + restore_regs(reglist); +} +#define fconv_assemble fconv_assemble_arm + +static void fcomp_assemble(int i,struct regstat *i_regs) +{ + signed char fs=get_reg(i_regs->regmap,FSREG); + signed char temp=get_reg(i_regs->regmap,-1); + assert(temp>=0); + // Check cop1 unusable + if(!cop1_usable) { + signed char cs=get_reg(i_regs->regmap,CSREG); + assert(cs>=0); + emit_testimm(cs,0x20000000); + int jaddr=(int)out; + emit_jeq(0); + add_stub(FP_STUB,jaddr,(int)out,i,cs,(int)i_regs,is_delayslot,0); + cop1_usable=1; + } + + if((source[i]&0x3f)==0x30) { + emit_andimm(fs,~0x800000,fs); + return; + } + + if((source[i]&0x3e)==0x38) { + // sf/ngle - these should throw exceptions for NaNs + emit_andimm(fs,~0x800000,fs); + return; + } + + #if (defined(__VFP_FP__) && !defined(__SOFTFP__)) + if(opcode2[i]==0x10) { + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],temp); + emit_readword((int)®_cop1_simple[(source[i]>>16)&0x1f],HOST_TEMPREG); + emit_orimm(fs,0x800000,fs); + emit_flds(temp,14); + emit_flds(HOST_TEMPREG,15); + emit_fcmps(14,15); + emit_fmstat(); + if((source[i]&0x3f)==0x31) emit_bicvc_imm(fs,0x800000,fs); // c_un_s + if((source[i]&0x3f)==0x32) emit_bicne_imm(fs,0x800000,fs); // c_eq_s + if((source[i]&0x3f)==0x33) {emit_bicne_imm(fs,0x800000,fs);emit_orrvs_imm(fs,0x800000,fs);} // c_ueq_s + if((source[i]&0x3f)==0x34) emit_biccs_imm(fs,0x800000,fs); // c_olt_s + if((source[i]&0x3f)==0x35) {emit_biccs_imm(fs,0x800000,fs);emit_orrvs_imm(fs,0x800000,fs);} // c_ult_s + if((source[i]&0x3f)==0x36) emit_bichi_imm(fs,0x800000,fs); // c_ole_s + if((source[i]&0x3f)==0x37) {emit_bichi_imm(fs,0x800000,fs);emit_orrvs_imm(fs,0x800000,fs);} // c_ule_s + if((source[i]&0x3f)==0x3a) emit_bicne_imm(fs,0x800000,fs); // c_seq_s + if((source[i]&0x3f)==0x3b) emit_bicne_imm(fs,0x800000,fs); // c_ngl_s + if((source[i]&0x3f)==0x3c) emit_biccs_imm(fs,0x800000,fs); // c_lt_s + if((source[i]&0x3f)==0x3d) emit_biccs_imm(fs,0x800000,fs); // c_nge_s + if((source[i]&0x3f)==0x3e) emit_bichi_imm(fs,0x800000,fs); // c_le_s + if((source[i]&0x3f)==0x3f) emit_bichi_imm(fs,0x800000,fs); // c_ngt_s + return; + } + if(opcode2[i]==0x11) { + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],temp); + emit_readword((int)®_cop1_double[(source[i]>>16)&0x1f],HOST_TEMPREG); + emit_orimm(fs,0x800000,fs); + emit_vldr(temp,6); + emit_vldr(HOST_TEMPREG,7); + emit_fcmpd(6,7); + emit_fmstat(); + if((source[i]&0x3f)==0x31) emit_bicvc_imm(fs,0x800000,fs); // c_un_d + if((source[i]&0x3f)==0x32) emit_bicne_imm(fs,0x800000,fs); // c_eq_d + if((source[i]&0x3f)==0x33) {emit_bicne_imm(fs,0x800000,fs);emit_orrvs_imm(fs,0x800000,fs);} // c_ueq_d + if((source[i]&0x3f)==0x34) emit_biccs_imm(fs,0x800000,fs); // c_olt_d + if((source[i]&0x3f)==0x35) {emit_biccs_imm(fs,0x800000,fs);emit_orrvs_imm(fs,0x800000,fs);} // c_ult_d + if((source[i]&0x3f)==0x36) emit_bichi_imm(fs,0x800000,fs); // c_ole_d + if((source[i]&0x3f)==0x37) {emit_bichi_imm(fs,0x800000,fs);emit_orrvs_imm(fs,0x800000,fs);} // c_ule_d + if((source[i]&0x3f)==0x3a) emit_bicne_imm(fs,0x800000,fs); // c_seq_d + if((source[i]&0x3f)==0x3b) emit_bicne_imm(fs,0x800000,fs); // c_ngl_d + if((source[i]&0x3f)==0x3c) emit_biccs_imm(fs,0x800000,fs); // c_lt_d + if((source[i]&0x3f)==0x3d) emit_biccs_imm(fs,0x800000,fs); // c_nge_d + if((source[i]&0x3f)==0x3e) emit_bichi_imm(fs,0x800000,fs); // c_le_d + if((source[i]&0x3f)==0x3f) emit_bichi_imm(fs,0x800000,fs); // c_ngt_d + return; + } + #endif + + // C only + + u_int hr,reglist=0; + for(hr=0;hrregmap[hr]>=0) reglist|=1<>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_simple[(source[i]>>16)&0x1f],ARG2_REG); + if((source[i]&0x3f)==0x30) emit_call((int)c_f_s); + if((source[i]&0x3f)==0x31) emit_call((int)c_un_s); + if((source[i]&0x3f)==0x32) emit_call((int)c_eq_s); + if((source[i]&0x3f)==0x33) emit_call((int)c_ueq_s); + if((source[i]&0x3f)==0x34) emit_call((int)c_olt_s); + if((source[i]&0x3f)==0x35) emit_call((int)c_ult_s); + if((source[i]&0x3f)==0x36) emit_call((int)c_ole_s); + if((source[i]&0x3f)==0x37) emit_call((int)c_ule_s); + if((source[i]&0x3f)==0x38) emit_call((int)c_sf_s); + if((source[i]&0x3f)==0x39) emit_call((int)c_ngle_s); + if((source[i]&0x3f)==0x3a) emit_call((int)c_seq_s); + if((source[i]&0x3f)==0x3b) emit_call((int)c_ngl_s); + if((source[i]&0x3f)==0x3c) emit_call((int)c_lt_s); + if((source[i]&0x3f)==0x3d) emit_call((int)c_nge_s); + if((source[i]&0x3f)==0x3e) emit_call((int)c_le_s); + if((source[i]&0x3f)==0x3f) emit_call((int)c_ngt_s); + } + if(opcode2[i]==0x11) { + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],ARG1_REG); + emit_readword((int)®_cop1_double[(source[i]>>16)&0x1f],ARG2_REG); + if((source[i]&0x3f)==0x30) emit_call((int)c_f_d); + if((source[i]&0x3f)==0x31) emit_call((int)c_un_d); + if((source[i]&0x3f)==0x32) emit_call((int)c_eq_d); + if((source[i]&0x3f)==0x33) emit_call((int)c_ueq_d); + if((source[i]&0x3f)==0x34) emit_call((int)c_olt_d); + if((source[i]&0x3f)==0x35) emit_call((int)c_ult_d); + if((source[i]&0x3f)==0x36) emit_call((int)c_ole_d); + if((source[i]&0x3f)==0x37) emit_call((int)c_ule_d); + if((source[i]&0x3f)==0x38) emit_call((int)c_sf_d); + if((source[i]&0x3f)==0x39) emit_call((int)c_ngle_d); + if((source[i]&0x3f)==0x3a) emit_call((int)c_seq_d); + if((source[i]&0x3f)==0x3b) emit_call((int)c_ngl_d); + if((source[i]&0x3f)==0x3c) emit_call((int)c_lt_d); + if((source[i]&0x3f)==0x3d) emit_call((int)c_nge_d); + if((source[i]&0x3f)==0x3e) emit_call((int)c_le_d); + if((source[i]&0x3f)==0x3f) emit_call((int)c_ngt_d); + } + restore_regs(reglist); + emit_loadreg(FSREG,fs); +} + +static void float_assemble(int i,struct regstat *i_regs) +{ + signed char temp=get_reg(i_regs->regmap,-1); + assert(temp>=0); + // Check cop1 unusable + if(!cop1_usable) { + signed char cs=get_reg(i_regs->regmap,CSREG); + assert(cs>=0); + emit_testimm(cs,0x20000000); + int jaddr=(int)out; + emit_jeq(0); + add_stub(FP_STUB,jaddr,(int)out,i,cs,(int)i_regs,is_delayslot,0); + cop1_usable=1; + } + + #if (defined(__VFP_FP__) && !defined(__SOFTFP__)) + if((source[i]&0x3f)==6) // mov + { + if(((source[i]>>11)&0x1f)!=((source[i]>>6)&0x1f)) { + if(opcode2[i]==0x10) { + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],temp); + emit_readword((int)®_cop1_simple[(source[i]>>6)&0x1f],HOST_TEMPREG); + emit_readword_indexed(0,temp,temp); + emit_writeword_indexed(temp,0,HOST_TEMPREG); + } + if(opcode2[i]==0x11) { + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],temp); + emit_readword((int)®_cop1_double[(source[i]>>6)&0x1f],HOST_TEMPREG); + emit_vldr(temp,7); + emit_vstr(7,HOST_TEMPREG); + } + } + return; + } + + if((source[i]&0x3f)>3) + { + if(opcode2[i]==0x10) { + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],temp); + emit_flds(temp,15); + if(((source[i]>>11)&0x1f)!=((source[i]>>6)&0x1f)) { + emit_readword((int)®_cop1_simple[(source[i]>>6)&0x1f],temp); + } + if((source[i]&0x3f)==4) // sqrt + emit_fsqrts(15,15); + if((source[i]&0x3f)==5) // abs + emit_fabss(15,15); + if((source[i]&0x3f)==7) // neg + emit_fnegs(15,15); + emit_fsts(15,temp); + } + if(opcode2[i]==0x11) { + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],temp); + emit_vldr(temp,7); + if(((source[i]>>11)&0x1f)!=((source[i]>>6)&0x1f)) { + emit_readword((int)®_cop1_double[(source[i]>>6)&0x1f],temp); + } + if((source[i]&0x3f)==4) // sqrt + emit_fsqrtd(7,7); + if((source[i]&0x3f)==5) // abs + emit_fabsd(7,7); + if((source[i]&0x3f)==7) // neg + emit_fnegd(7,7); + emit_vstr(7,temp); + } + return; + } + if((source[i]&0x3f)<4) + { + if(opcode2[i]==0x10) { + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],temp); + } + if(opcode2[i]==0x11) { + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],temp); + } + if(((source[i]>>11)&0x1f)!=((source[i]>>16)&0x1f)) { + if(opcode2[i]==0x10) { + emit_readword((int)®_cop1_simple[(source[i]>>16)&0x1f],HOST_TEMPREG); + emit_flds(temp,15); + emit_flds(HOST_TEMPREG,13); + if(((source[i]>>11)&0x1f)!=((source[i]>>6)&0x1f)) { + if(((source[i]>>16)&0x1f)!=((source[i]>>6)&0x1f)) { + emit_readword((int)®_cop1_simple[(source[i]>>6)&0x1f],temp); + } + } + if((source[i]&0x3f)==0) emit_fadds(15,13,15); + if((source[i]&0x3f)==1) emit_fsubs(15,13,15); + if((source[i]&0x3f)==2) emit_fmuls(15,13,15); + if((source[i]&0x3f)==3) emit_fdivs(15,13,15); + if(((source[i]>>16)&0x1f)==((source[i]>>6)&0x1f)) { + emit_fsts(15,HOST_TEMPREG); + }else{ + emit_fsts(15,temp); + } + } + else if(opcode2[i]==0x11) { + emit_readword((int)®_cop1_double[(source[i]>>16)&0x1f],HOST_TEMPREG); + emit_vldr(temp,7); + emit_vldr(HOST_TEMPREG,6); + if(((source[i]>>11)&0x1f)!=((source[i]>>6)&0x1f)) { + if(((source[i]>>16)&0x1f)!=((source[i]>>6)&0x1f)) { + emit_readword((int)®_cop1_double[(source[i]>>6)&0x1f],temp); + } + } + if((source[i]&0x3f)==0) emit_faddd(7,6,7); + if((source[i]&0x3f)==1) emit_fsubd(7,6,7); + if((source[i]&0x3f)==2) emit_fmuld(7,6,7); + if((source[i]&0x3f)==3) emit_fdivd(7,6,7); + if(((source[i]>>16)&0x1f)==((source[i]>>6)&0x1f)) { + emit_vstr(7,HOST_TEMPREG); + }else{ + emit_vstr(7,temp); + } + } + } + else { + if(opcode2[i]==0x10) { + emit_flds(temp,15); + if(((source[i]>>11)&0x1f)!=((source[i]>>6)&0x1f)) { + emit_readword((int)®_cop1_simple[(source[i]>>6)&0x1f],temp); + } + if((source[i]&0x3f)==0) emit_fadds(15,15,15); + if((source[i]&0x3f)==1) emit_fsubs(15,15,15); + if((source[i]&0x3f)==2) emit_fmuls(15,15,15); + if((source[i]&0x3f)==3) emit_fdivs(15,15,15); + emit_fsts(15,temp); + } + else if(opcode2[i]==0x11) { + emit_vldr(temp,7); + if(((source[i]>>11)&0x1f)!=((source[i]>>6)&0x1f)) { + emit_readword((int)®_cop1_double[(source[i]>>6)&0x1f],temp); + } + if((source[i]&0x3f)==0) emit_faddd(7,7,7); + if((source[i]&0x3f)==1) emit_fsubd(7,7,7); + if((source[i]&0x3f)==2) emit_fmuld(7,7,7); + if((source[i]&0x3f)==3) emit_fdivd(7,7,7); + emit_vstr(7,temp); + } + } + return; + } + #endif + + u_int hr,reglist=0; + for(hr=0;hrregmap[hr]>=0) reglist|=1<>11)&0x1f],ARG1_REG); + if((source[i]&0x3f)<4) { + emit_readword((int)®_cop1_simple[(source[i]>>16)&0x1f],ARG2_REG); + emit_readword((int)®_cop1_simple[(source[i]>> 6)&0x1f],ARG3_REG); + }else{ + emit_readword((int)®_cop1_simple[(source[i]>> 6)&0x1f],ARG2_REG); + } + switch(source[i]&0x3f) + { + case 0x00: emit_call((int)add_s);break; + case 0x01: emit_call((int)sub_s);break; + case 0x02: emit_call((int)mul_s);break; + case 0x03: emit_call((int)div_s);break; + case 0x04: emit_call((int)sqrt_s);break; + case 0x05: emit_call((int)abs_s);break; + case 0x06: emit_call((int)mov_s);break; + case 0x07: emit_call((int)neg_s);break; + } + restore_regs(reglist); + } + if(opcode2[i]==0x11) { // Double precision + save_regs(reglist); + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],ARG1_REG); + if((source[i]&0x3f)<4) { + emit_readword((int)®_cop1_double[(source[i]>>16)&0x1f],ARG2_REG); + emit_readword((int)®_cop1_double[(source[i]>> 6)&0x1f],ARG3_REG); + }else{ + emit_readword((int)®_cop1_double[(source[i]>> 6)&0x1f],ARG2_REG); + } + switch(source[i]&0x3f) + { + case 0x00: emit_call((int)add_d);break; + case 0x01: emit_call((int)sub_d);break; + case 0x02: emit_call((int)mul_d);break; + case 0x03: emit_call((int)div_d);break; + case 0x04: emit_call((int)sqrt_d);break; + case 0x05: emit_call((int)abs_d);break; + case 0x06: emit_call((int)mov_d);break; + case 0x07: emit_call((int)neg_d);break; + } + restore_regs(reglist); + } +} + +static void multdiv_assemble_arm(int i,struct regstat *i_regs) +{ + // case 0x18: MULT + // case 0x19: MULTU + // case 0x1A: DIV + // case 0x1B: DIVU + // case 0x1C: DMULT + // case 0x1D: DMULTU + // case 0x1E: DDIV + // case 0x1F: DDIVU + if(rs1[i]&&rs2[i]) + { + if((opcode2[i]&4)==0) // 32-bit + { + if(opcode2[i]==0x18) // MULT + { + signed char m1=get_reg(i_regs->regmap,rs1[i]); + signed char m2=get_reg(i_regs->regmap,rs2[i]); + signed char hi=get_reg(i_regs->regmap,HIREG); + signed char lo=get_reg(i_regs->regmap,LOREG); + assert(m1>=0); + assert(m2>=0); + assert(hi>=0); + assert(lo>=0); + emit_smull(m1,m2,hi,lo); + } + if(opcode2[i]==0x19) // MULTU + { + signed char m1=get_reg(i_regs->regmap,rs1[i]); + signed char m2=get_reg(i_regs->regmap,rs2[i]); + signed char hi=get_reg(i_regs->regmap,HIREG); + signed char lo=get_reg(i_regs->regmap,LOREG); + assert(m1>=0); + assert(m2>=0); + assert(hi>=0); + assert(lo>=0); + emit_umull(m1,m2,hi,lo); + } + if(opcode2[i]==0x1A) // DIV + { + signed char d1=get_reg(i_regs->regmap,rs1[i]); + signed char d2=get_reg(i_regs->regmap,rs2[i]); + assert(d1>=0); + assert(d2>=0); + signed char quotient=get_reg(i_regs->regmap,LOREG); + signed char remainder=get_reg(i_regs->regmap,HIREG); + assert(quotient>=0); + assert(remainder>=0); + emit_movs(d1,remainder); + emit_negmi(remainder,remainder); + emit_movs(d2,HOST_TEMPREG); + emit_jeq((int)out+52); // Division by zero + emit_negmi(HOST_TEMPREG,HOST_TEMPREG); + emit_clz(HOST_TEMPREG,quotient); + emit_shl(HOST_TEMPREG,quotient,HOST_TEMPREG); + emit_orimm(quotient,1<<31,quotient); + emit_shr(quotient,quotient,quotient); + emit_cmp(remainder,HOST_TEMPREG); + emit_subcs(remainder,HOST_TEMPREG,remainder); + emit_adcs(quotient,quotient,quotient); + emit_shrimm(HOST_TEMPREG,1,HOST_TEMPREG); + emit_jcc((int)out-16); // -4 + emit_teq(d1,d2); + emit_negmi(quotient,quotient); + emit_test(d1,d1); + emit_negmi(remainder,remainder); + } + if(opcode2[i]==0x1B) // DIVU + { + signed char d1=get_reg(i_regs->regmap,rs1[i]); // dividend + signed char d2=get_reg(i_regs->regmap,rs2[i]); // divisor + assert(d1>=0); + assert(d2>=0); + signed char quotient=get_reg(i_regs->regmap,LOREG); + signed char remainder=get_reg(i_regs->regmap,HIREG); + assert(quotient>=0); + assert(remainder>=0); + emit_test(d2,d2); + emit_jeq((int)out+44); // Division by zero + emit_clz(d2,HOST_TEMPREG); + emit_movimm(1<<31,quotient); + emit_shl(d2,HOST_TEMPREG,d2); + emit_mov(d1,remainder); + emit_shr(quotient,HOST_TEMPREG,quotient); + emit_cmp(remainder,d2); + emit_subcs(remainder,d2,remainder); + emit_adcs(quotient,quotient,quotient); + emit_shrcc_imm(d2,1,d2); + emit_jcc((int)out-16); // -4 + } + } + else // 64-bit + { + if(opcode2[i]==0x1C) // DMULT + { + assert(opcode2[i]!=0x1C); + signed char m1h=get_reg(i_regs->regmap,rs1[i]|64); + signed char m1l=get_reg(i_regs->regmap,rs1[i]); + signed char m2h=get_reg(i_regs->regmap,rs2[i]|64); + signed char m2l=get_reg(i_regs->regmap,rs2[i]); + assert(m1h>=0); + assert(m2h>=0); + assert(m1l>=0); + assert(m2l>=0); + emit_pushreg(m2h); + emit_pushreg(m2l); + emit_pushreg(m1h); + emit_pushreg(m1l); + emit_call((int)&mult64); + emit_popreg(m1l); + emit_popreg(m1h); + emit_popreg(m2l); + emit_popreg(m2h); + signed char hih=get_reg(i_regs->regmap,HIREG|64); + signed char hil=get_reg(i_regs->regmap,HIREG); + if(hih>=0) emit_loadreg(HIREG|64,hih); + if(hil>=0) emit_loadreg(HIREG,hil); + signed char loh=get_reg(i_regs->regmap,LOREG|64); + signed char lol=get_reg(i_regs->regmap,LOREG); + if(loh>=0) emit_loadreg(LOREG|64,loh); + if(lol>=0) emit_loadreg(LOREG,lol); + } + if(opcode2[i]==0x1D) // DMULTU + { + signed char m1h=get_reg(i_regs->regmap,rs1[i]|64); + signed char m1l=get_reg(i_regs->regmap,rs1[i]); + signed char m2h=get_reg(i_regs->regmap,rs2[i]|64); + signed char m2l=get_reg(i_regs->regmap,rs2[i]); + assert(m1h>=0); + assert(m2h>=0); + assert(m1l>=0); + assert(m2l>=0); + save_regs(0x100f); + if(m1l!=0) emit_mov(m1l,0); + if(m1h==0) emit_readword((int)&dynarec_local,1); + else if(m1h>1) emit_mov(m1h,1); + if(m2l<2) emit_readword((int)&dynarec_local+m2l*4,2); + else if(m2l>2) emit_mov(m2l,2); + if(m2h<3) emit_readword((int)&dynarec_local+m2h*4,3); + else if(m2h>3) emit_mov(m2h,3); + emit_call((int)&multu64); + restore_regs(0x100f); + signed char hih=get_reg(i_regs->regmap,HIREG|64); + signed char hil=get_reg(i_regs->regmap,HIREG); + signed char loh=get_reg(i_regs->regmap,LOREG|64); + signed char lol=get_reg(i_regs->regmap,LOREG); + /*signed char temp=get_reg(i_regs->regmap,-1); + signed char rh=get_reg(i_regs->regmap,HIREG|64); + signed char rl=get_reg(i_regs->regmap,HIREG); + assert(m1h>=0); + assert(m2h>=0); + assert(m1l>=0); + assert(m2l>=0); + assert(temp>=0); + //emit_mov(m1l,EAX); + //emit_mul(m2l); + emit_umull(rl,rh,m1l,m2l); + emit_storereg(LOREG,rl); + emit_mov(rh,temp); + //emit_mov(m1h,EAX); + //emit_mul(m2l); + emit_umull(rl,rh,m1h,m2l); + emit_adds(rl,temp,temp); + emit_adcimm(rh,0,rh); + emit_storereg(HIREG,rh); + //emit_mov(m2h,EAX); + //emit_mul(m1l); + emit_umull(rl,rh,m1l,m2h); + emit_adds(rl,temp,temp); + emit_adcimm(rh,0,rh); + emit_storereg(LOREG|64,temp); + emit_mov(rh,temp); + //emit_mov(m2h,EAX); + //emit_mul(m1h); + emit_umull(rl,rh,m1h,m2h); + emit_adds(rl,temp,rl); + emit_loadreg(HIREG,temp); + emit_adcimm(rh,0,rh); + emit_adds(rl,temp,rl); + emit_adcimm(rh,0,rh); + // DEBUG + /* + emit_pushreg(m2h); + emit_pushreg(m2l); + emit_pushreg(m1h); + emit_pushreg(m1l); + emit_call((int)&multu64); + emit_popreg(m1l); + emit_popreg(m1h); + emit_popreg(m2l); + emit_popreg(m2h); + signed char hih=get_reg(i_regs->regmap,HIREG|64); + signed char hil=get_reg(i_regs->regmap,HIREG); + if(hih>=0) emit_loadreg(HIREG|64,hih); // DEBUG + if(hil>=0) emit_loadreg(HIREG,hil); // DEBUG + */ + // Shouldn't be necessary + //char loh=get_reg(i_regs->regmap,LOREG|64); + //char lol=get_reg(i_regs->regmap,LOREG); + //if(loh>=0) emit_loadreg(LOREG|64,loh); + //if(lol>=0) emit_loadreg(LOREG,lol); + } + if(opcode2[i]==0x1E) // DDIV + { + signed char d1h=get_reg(i_regs->regmap,rs1[i]|64); + signed char d1l=get_reg(i_regs->regmap,rs1[i]); + signed char d2h=get_reg(i_regs->regmap,rs2[i]|64); + signed char d2l=get_reg(i_regs->regmap,rs2[i]); + assert(d1h>=0); + assert(d2h>=0); + assert(d1l>=0); + assert(d2l>=0); + save_regs(0x100f); + if(d1l!=0) emit_mov(d1l,0); + if(d1h==0) emit_readword((int)&dynarec_local,1); + else if(d1h>1) emit_mov(d1h,1); + if(d2l<2) emit_readword((int)&dynarec_local+d2l*4,2); + else if(d2l>2) emit_mov(d2l,2); + if(d2h<3) emit_readword((int)&dynarec_local+d2h*4,3); + else if(d2h>3) emit_mov(d2h,3); + emit_call((int)&div64); + restore_regs(0x100f); + signed char hih=get_reg(i_regs->regmap,HIREG|64); + signed char hil=get_reg(i_regs->regmap,HIREG); + signed char loh=get_reg(i_regs->regmap,LOREG|64); + signed char lol=get_reg(i_regs->regmap,LOREG); + if(hih>=0) emit_loadreg(HIREG|64,hih); + if(hil>=0) emit_loadreg(HIREG,hil); + if(loh>=0) emit_loadreg(LOREG|64,loh); + if(lol>=0) emit_loadreg(LOREG,lol); + } + if(opcode2[i]==0x1F) // DDIVU + { + //u_int hr,reglist=0; + //for(hr=0;hrregmap[hr]>=0 && (i_regs->regmap[hr]&62)!=HIREG) reglist|=1<regmap,rs1[i]|64); + signed char d1l=get_reg(i_regs->regmap,rs1[i]); + signed char d2h=get_reg(i_regs->regmap,rs2[i]|64); + signed char d2l=get_reg(i_regs->regmap,rs2[i]); + assert(d1h>=0); + assert(d2h>=0); + assert(d1l>=0); + assert(d2l>=0); + save_regs(0x100f); + if(d1l!=0) emit_mov(d1l,0); + if(d1h==0) emit_readword((int)&dynarec_local,1); + else if(d1h>1) emit_mov(d1h,1); + if(d2l<2) emit_readword((int)&dynarec_local+d2l*4,2); + else if(d2l>2) emit_mov(d2l,2); + if(d2h<3) emit_readword((int)&dynarec_local+d2h*4,3); + else if(d2h>3) emit_mov(d2h,3); + emit_call((int)&divu64); + restore_regs(0x100f); + signed char hih=get_reg(i_regs->regmap,HIREG|64); + signed char hil=get_reg(i_regs->regmap,HIREG); + signed char loh=get_reg(i_regs->regmap,LOREG|64); + signed char lol=get_reg(i_regs->regmap,LOREG); + if(hih>=0) emit_loadreg(HIREG|64,hih); + if(hil>=0) emit_loadreg(HIREG,hil); + if(loh>=0) emit_loadreg(LOREG|64,loh); + if(lol>=0) emit_loadreg(LOREG,lol); + } + } + } + else + { + // Multiply by zero is zero. + // MIPS does not have a divide by zero exception. + // The result is undefined, we return zero. + signed char hr=get_reg(i_regs->regmap,HIREG); + signed char lr=get_reg(i_regs->regmap,LOREG); + if(hr>=0) emit_zeroreg(hr); + if(lr>=0) emit_zeroreg(lr); + } +} +#define multdiv_assemble multdiv_assemble_arm + +static void do_preload_rhash(int r) { + // Don't need this for ARM. On x86, this puts the value 0xf8 into the + // register. On ARM the hash can be done with a single instruction (below) +} + +static void do_preload_rhtbl(int ht) { + emit_addimm(FP,(int)&mini_ht-(int)&dynarec_local,ht); +} + +static void do_rhash(int rs,int rh) { + emit_andimm(rs,0xf8,rh); +} + +static void do_miniht_load(int ht,int rh) { + assem_debug("ldr %s,[%s,%s]!",regname[rh],regname[ht],regname[rh]); + output_w32(0xe7b00000|rd_rn_rm(rh,ht,rh)); +} + +static void do_miniht_jump(int rs,int rh,int ht) { + emit_cmp(rh,rs); + emit_ldreq_indexed(ht,4,15); + #ifdef CORTEX_A8_BRANCH_PREDICTION_HACK + emit_mov(rs,7); + emit_jmp(jump_vaddr_reg[7]); + #else + emit_jmp(jump_vaddr_reg[rs]); + #endif +} + +static void do_miniht_insert(u_int return_address,int rt,int temp) { + #ifdef ARMv5_ONLY + emit_movimm(return_address,rt); // PC into link register + add_to_linker((int)out,return_address,1); + emit_pcreladdr(temp); + emit_writeword(rt,(int)&mini_ht[(return_address&0xFF)>>3][0]); + emit_writeword(temp,(int)&mini_ht[(return_address&0xFF)>>3][1]); + #else + emit_movw(return_address&0x0000FFFF,rt); + add_to_linker((int)out,return_address,1); + emit_pcreladdr(temp); + emit_writeword(temp,(int)&mini_ht[(return_address&0xFF)>>3][1]); + emit_movt(return_address&0xFFFF0000,rt); + emit_writeword(rt,(int)&mini_ht[(return_address&0xFF)>>3][0]); + #endif +} + +// Sign-extend to 64 bits and write out upper half of a register +// This is useful where we have a 32-bit value in a register, and want to +// keep it in a 32-bit register, but can't guarantee that it won't be read +// as a 64-bit value later. +static void wb_sx(signed char pre[],signed char entry[],uint64_t dirty,uint64_t is32_pre,uint64_t is32,uint64_t u,uint64_t uu) +{ + if(is32_pre==is32) return; + int hr,reg; + for(hr=0;hr=0) { + if((dirty>>hr)&1) { + if( ((is32_pre&~is32&~uu)>>reg)&1 ) { + emit_sarimm(hr,31,HOST_TEMPREG); + emit_storereg(reg|64,HOST_TEMPREG); + } + } + } + //} + } + } +} + +static void wb_valid(signed char pre[],signed char entry[],u_int dirty_pre,u_int dirty,uint64_t is32_pre,uint64_t u,uint64_t uu) +{ + //if(dirty_pre==dirty) return; + int hr,reg,new_hr; + for(hr=0;hr>(reg&63))&1) { + if(reg>0) { + if(((dirty_pre&~dirty)>>hr)&1) { + if(reg>0&®<34) { + emit_storereg(reg,hr); + if( ((is32_pre&~uu)>>reg)&1 ) { + emit_sarimm(hr,31,HOST_TEMPREG); + emit_storereg(reg|64,HOST_TEMPREG); + } + } + else if(reg>=64) { + emit_storereg(reg,hr); + } + } + } + } + } + } +} + + +/* using strd could possibly help but you'd have to allocate registers in pairs +static void wb_invalidate_arm(signed char pre[],signed char entry[],uint64_t dirty,uint64_t is32,uint64_t u,uint64_t uu) +{ + int hr; + int wrote=-1; + for(hr=HOST_REGS-1;hr>=0;hr--) { + if(hr!=EXCLUDE_REG) { + if(pre[hr]!=entry[hr]) { + if(pre[hr]>=0) { + if((dirty>>hr)&1) { + if(get_reg(entry,pre[hr])<0) { + if(pre[hr]<64) { + if(!((u>>pre[hr])&1)) { + if(hr<10&&(~hr&1)&&(pre[hr+1]<0||wrote==hr+1)) { + if( ((is32>>pre[hr])&1) && !((uu>>pre[hr])&1) ) { + emit_sarimm(hr,31,hr+1); + emit_strdreg(pre[hr],hr); + } + else + emit_storereg(pre[hr],hr); + }else{ + emit_storereg(pre[hr],hr); + if( ((is32>>pre[hr])&1) && !((uu>>pre[hr])&1) ) { + emit_sarimm(hr,31,hr); + emit_storereg(pre[hr]|64,hr); + } + } + } + }else{ + if(!((uu>>(pre[hr]&63))&1) && !((is32>>(pre[hr]&63))&1)) { + emit_storereg(pre[hr],hr); + } + } + wrote=hr; + } + } + } + } + } + } + for(hr=0;hr=0) { + int nr; + if((nr=get_reg(entry,pre[hr]))>=0) { + emit_mov(hr,nr); + } + } + } + } + } +} +#define wb_invalidate wb_invalidate_arm +*/ + +// Clearing the cache is rather slow on ARM Linux, so mark the areas +// that need to be cleared, and then only clear these areas once. +static void do_clear_cache() +{ + int i,j; + for (i=0;i<(1<<(TARGET_SIZE_2-17));i++) + { + u_int bitmap=needs_clear_cache[i]; + if(bitmap) { + u_int start,end; + for(j=0;j<32;j++) + { + if(bitmap&(1<>2; + #endif + + // Trampolines for jumps >32M + int *ptr,*ptr2; + ptr=(int *)jump_table_symbols; + ptr2=(int *)((void *)BASE_ADDR+(1<=-33554432&&offset<33554432) { + *ptr2=0xea000000|((offset>>2)&0xffffff); // direct branch + }else{ + *ptr2=0xe51ff004; // ldr pc,[pc,#-4] + } + ptr2++; + *ptr2=*ptr; + ptr++; + ptr2++; + } + + // Jumping thru the trampolines created above slows things down by about 1%. + // If part of the cache is beyond the 32M limit, avoid using this area + // initially. It will be used later if the cache gets full. + if((u_int)dyna_linker-33554432>(u_int)BASE_ADDR) { + if((u_int)dyna_linker-33554432<(u_int)BASE_ADDR+(1<<(TARGET_SIZE_2-1))) { + out=(u_char *)(((u_int)dyna_linker-33554432)&~4095); + expirep=((((int)out-BASE_ADDR)>>(TARGET_SIZE_2-16))+16384)&65535; + } + } +} diff --git a/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/assem_arm.h b/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/assem_arm.h new file mode 100644 index 0000000000..a9db4f87c7 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/assem_arm.h @@ -0,0 +1,43 @@ +#define HOST_REGS 13 +#define HOST_CCREG 10 +#define HOST_BTREG 8 +#define EXCLUDE_REG 11 + +#define HOST_IMM8 1 +#define HAVE_CMOV_IMM 1 +#define CORTEX_A8_BRANCH_PREDICTION_HACK 1 +#define USE_MINI_HT 1 +//#define REG_PREFETCH 1 +#define HAVE_CONDITIONAL_CALL 1 +#define RAM_OFFSET 1 + +/* ARM calling convention: + r0-r3, r12: caller-save + r4-r11: callee-save */ + +#define ARG1_REG 0 +#define ARG2_REG 1 +#define ARG3_REG 2 +#define ARG4_REG 3 + +/* GCC register naming convention: + r10 = sl (base) + r11 = fp (frame pointer) + r12 = ip (scratch) + r13 = sp (stack pointer) + r14 = lr (link register) + r15 = pc (program counter) */ + +#define FP 11 +#define LR 14 +#define HOST_TEMPREG 14 + +// Note: FP is set to &dynarec_local when executing generated code. +// Thus the local variables are actually global and not on the stack. + +extern char *invc_ptr; +extern char extra_memory[33554432]; + +#define BASE_ADDR ((int)(&extra_memory)) +//#define TARGET_SIZE_2 24 // 2^24 = 16 megabytes +#define TARGET_SIZE_2 25 // 2^25 = 32 megabytes diff --git a/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/assem_x86.c b/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/assem_x86.c new file mode 100644 index 0000000000..c02a85495c --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/assem_x86.c @@ -0,0 +1,4364 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - assem_x86.c * + * Copyright (C) 2009-2011 Ari64 * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +int cycle_count; +int last_count; +int pcaddr; +int pending_exception; +int branch_target; +uint64_t readmem_dword; +static precomp_instr fake_pc; +u_int memory_map[1048576]; +static u_int mini_ht[32][2] __attribute__((aligned(8))); +u_char restore_candidate[512] __attribute__((aligned(4))); + +void do_interrupt(); +void jump_vaddr_eax(); +void jump_vaddr_ecx(); +void jump_vaddr_edx(); +void jump_vaddr_ebx(); +void jump_vaddr_ebp(); +void jump_vaddr_edi(); + +static const u_int jump_vaddr_reg[8] = { + (int)jump_vaddr_eax, + (int)jump_vaddr_ecx, + (int)jump_vaddr_edx, + (int)jump_vaddr_ebx, + 0, + (int)jump_vaddr_ebp, + 0, + (int)jump_vaddr_edi }; + +void invalidate_block_eax(); +void invalidate_block_ecx(); +void invalidate_block_edx(); +void invalidate_block_ebx(); +void invalidate_block_ebp(); +void invalidate_block_esi(); +void invalidate_block_edi(); + +static const u_int invalidate_block_reg[8] = { + (int)invalidate_block_eax, + (int)invalidate_block_ecx, + (int)invalidate_block_edx, + (int)invalidate_block_ebx, + 0, + (int)invalidate_block_ebp, + (int)invalidate_block_esi, + (int)invalidate_block_edi }; + +static const u_short rounding_modes[4] = { + 0x33F, // round + 0xF3F, // trunc + 0xB3F, // ceil + 0x73F};// floor + +#include "../fpu.h" + +// We need these for cmovcc instructions on x86 +static const u_int const_zero=0; +static const u_int const_one=1; + +/* Linker */ + +static void set_jump_target(int addr,int target) +{ + u_char *ptr=(u_char *)addr; + if(*ptr==0x0f) + { + assert(ptr[1]>=0x80&&ptr[1]<=0x8f); + u_int *ptr2=(u_int *)(ptr+2); + *ptr2=target-(int)ptr2-4; + } + else if(*ptr==0xe8||*ptr==0xe9) { + u_int *ptr2=(u_int *)(ptr+1); + *ptr2=target-(int)ptr2-4; + } + else + { + assert(*ptr==0xc7); /* mov immediate (store address) */ + u_int *ptr2=(u_int *)(ptr+6); + *ptr2=target; + } +} + +static void *kill_pointer(void *stub) +{ + int *i_ptr=*((int **)(stub+6)); + *i_ptr=(int)stub-(int)i_ptr-4; + return i_ptr; +} +static int get_pointer(void *stub) +{ + int *i_ptr=*((int **)(stub+6)); + return *i_ptr+(int)i_ptr+4; +} + +// Find the "clean" entry point from a "dirty" entry point +// by skipping past the call to verify_code +static u_int get_clean_addr(int addr) +{ + u_char *ptr=(u_char *)addr; + assert(ptr[20]==0xE8); // call instruction + assert(ptr[25]==0x83); // pop (add esp,4) instruction + if(ptr[28]==0xE9) return *(u_int *)(ptr+29)+addr+33; // follow jmp + else return(addr+28); +} + +static int verify_dirty(void *addr) +{ + u_char *ptr=(u_char *)addr; + assert(ptr[5]==0xB8); + u_int source=*(u_int *)(ptr+6); + u_int copy=*(u_int *)(ptr+11); + u_int len=*(u_int *)(ptr+16); + assert(ptr[20]==0xE8); // call instruction + u_int verifier=*(u_int *)(ptr+21)+(u_int)ptr+25; + if(verifier==(u_int)verify_code_vm||verifier==(u_int)verify_code_ds) { + unsigned int page=source>>12; + unsigned int map_value=memory_map[page]; + if(map_value>=0x80000000) return 0; + while(page<((source+len-1)>>12)) { + if((memory_map[++page]<<2)!=(map_value<<2)) return 0; + } + source = source+(map_value<<2); + } + //DebugMessage(M64MSG_VERBOSE, "verify_dirty: %x %x %x",source,copy,len); + return !memcmp((void *)source,(void *)copy,len); +} + +// This doesn't necessarily find all clean entry points, just +// guarantees that it's not dirty +static int isclean(int addr) +{ + u_char *ptr=(u_char *)addr; + if(ptr[5]!=0xB8) return 1; // mov imm,%eax + if(ptr[10]!=0xBB) return 1; // mov imm,%ebx + if(ptr[15]!=0xB9) return 1; // mov imm,%ecx + if(ptr[20]!=0xE8) return 1; // call instruction + if(ptr[25]!=0x83) return 1; // pop (add esp,4) instruction + return 0; +} + +static void get_bounds(int addr,u_int *start,u_int *end) +{ + u_char *ptr=(u_char *)addr; + assert(ptr[5]==0xB8); + u_int source=*(u_int *)(ptr+6); + //u_int copy=*(u_int *)(ptr+11); + u_int len=*(u_int *)(ptr+16); + assert(ptr[20]==0xE8); // call instruction + u_int verifier=*(u_int *)(ptr+21)+(u_int)ptr+25; + if(verifier==(u_int)verify_code_vm||verifier==(u_int)verify_code_ds) { + if(memory_map[source>>12]>=0x80000000) source = 0; + else source = source+(memory_map[source>>12]<<2); + } + if(start) *start=source; + if(end) *end=source+len; +} + +/* Register allocation */ + +// Note: registers are allocated clean (unmodified state) +// if you intend to modify the register, you must call dirty_reg(). +static void alloc_reg(struct regstat *cur,int i,signed char reg) +{ + int r,hr; + int preferred_reg = (reg&3)+(reg>28)*4-(reg==32)+2*(reg==36)-(reg==40); + + // Don't allocate unused registers + if((cur->u>>reg)&1) return; + + // see if it's already allocated + for(hr=0;hrregmap[hr]==reg) return; + } + + // Keep the same mapping if the register was already allocated in a loop + preferred_reg = loop_reg(i,reg,preferred_reg); + + // Try to allocate the preferred register + if(cur->regmap[preferred_reg]==-1) { + cur->regmap[preferred_reg]=reg; + cur->dirty&=~(1<isconst&=~(1<regmap[preferred_reg]; + if(r<64&&((cur->u>>r)&1)) { + cur->regmap[preferred_reg]=reg; + cur->dirty&=~(1<isconst&=~(1<=64&&((cur->uu>>(r&63))&1)) { + cur->regmap[preferred_reg]=reg; + cur->dirty&=~(1<isconst&=~(1<regmap[hr]==-1) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<regmap[hr]; + if(r>=0) { + if(r<64) { + if((cur->u>>r)&1) + if(i==0||(unneeded_reg[i-1]>>r)&1) {cur->regmap[hr]=-1;break;} + } + else + { + if((cur->uu>>(r&63))&1) + if(i==0||(unneeded_reg_upper[i-1]>>(r&63))&1) {cur->regmap[hr]=-1;break;} + } + } + } + // Try to allocate any available register, but prefer + // registers that have not been used recently. + if(i>0) { + for(hr=0;hrregmap[hr]==-1) { + if(regs[i-1].regmap[hr]!=rs1[i-1]&®s[i-1].regmap[hr]!=rs2[i-1]&®s[i-1].regmap[hr]!=rt1[i-1]&®s[i-1].regmap[hr]!=rt2[i-1]) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<regmap[hr]==-1) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<regmap[0]&63],hsn[cur->regmap[1]&63],hsn[cur->regmap[2]&63],hsn[cur->regmap[3]&63],hsn[cur->regmap[5]&63],hsn[cur->regmap[6]&63],hsn[cur->regmap[7]&63]); + if(i>0) { + // Don't evict the cycle count at entry points, otherwise the entry + // stub will have to write it. + if(bt[i]&&hsn[CCREG]>2) hsn[CCREG]=2; + if(i>1&&hsn[CCREG]>2&&(itype[i-2]==RJUMP||itype[i-2]==UJUMP||itype[i-2]==CJUMP||itype[i-2]==SJUMP||itype[i-2]==FJUMP)) hsn[CCREG]=2; + for(j=10;j>=3;j--) + { + // Alloc preferred register if available + if(hsn[r=cur->regmap[preferred_reg]&63]==j) { + for(hr=0;hrregmap[hr]&63)==r) { + cur->regmap[hr]=-1; + cur->dirty&=~(1<isconst&=~(1<regmap[preferred_reg]=reg; + return; + } + for(r=1;r<=MAXREG;r++) + { + if(hsn[r]==j&&r!=rs1[i-1]&&r!=rs2[i-1]&&r!=rt1[i-1]&&r!=rt2[i-1]) { + for(hr=0;hrregmap[hr]==r+64) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<regmap[hr]==r) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<=0;j--) + { + for(r=1;r<=MAXREG;r++) + { + if(hsn[r]==j) { + for(hr=0;hrregmap[hr]==r+64) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<regmap[hr]==r) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<uu>>reg)&1) return; + + // see if the upper half is already allocated + for(hr=0;hrregmap[hr]==reg+64) return; + } + + // Keep the same mapping if the register was already allocated in a loop + preferred_reg = loop_reg(i,reg,preferred_reg); + + // Try to allocate the preferred register + if(cur->regmap[preferred_reg]==-1) { + cur->regmap[preferred_reg]=reg|64; + cur->dirty&=~(1<isconst&=~(1<regmap[preferred_reg]; + if(r<64&&((cur->u>>r)&1)) { + cur->regmap[preferred_reg]=reg|64; + cur->dirty&=~(1<isconst&=~(1<=64&&((cur->uu>>(r&63))&1)) { + cur->regmap[preferred_reg]=reg|64; + cur->dirty&=~(1<isconst&=~(1<regmap[hr]==-1) { + cur->regmap[hr]=reg|64; + cur->dirty&=~(1<isconst&=~(1<=0;hr--) + { + r=cur->regmap[hr]; + if(r>=0) { + if(r<64) { + if((cur->u>>r)&1) {cur->regmap[hr]=-1;break;} + } + else + { + if((cur->uu>>(r&63))&1) {cur->regmap[hr]=-1;break;} + } + } + } + // Try to allocate any available register, but prefer + // registers that have not been used recently. + if(i>0) { + for(hr=0;hrregmap[hr]==-1) { + if(regs[i-1].regmap[hr]!=rs1[i-1]&®s[i-1].regmap[hr]!=rs2[i-1]&®s[i-1].regmap[hr]!=rt1[i-1]&®s[i-1].regmap[hr]!=rt2[i-1]) { + cur->regmap[hr]=reg|64; + cur->dirty&=~(1<isconst&=~(1<regmap[hr]==-1) { + cur->regmap[hr]=reg|64; + cur->dirty&=~(1<isconst&=~(1<regmap[0],cur->regmap[1],cur->regmap[2],cur->regmap[3],cur->regmap[5],cur->regmap[6],cur->regmap[7]); + //DebugMessage(M64MSG_VERBOSE, "hsn(%x): %d %d %d %d %d %d %d",start+i*4,hsn[cur->regmap[0]&63],hsn[cur->regmap[1]&63],hsn[cur->regmap[2]&63],hsn[cur->regmap[3]&63],hsn[cur->regmap[5]&63],hsn[cur->regmap[6]&63],hsn[cur->regmap[7]&63]); + if(i>0) { + // Don't evict the cycle count at entry points, otherwise the entry + // stub will have to write it. + if(bt[i]&&hsn[CCREG]>2) hsn[CCREG]=2; + if(i>1&&hsn[CCREG]>2&&(itype[i-2]==RJUMP||itype[i-2]==UJUMP||itype[i-2]==CJUMP||itype[i-2]==SJUMP||itype[i-2]==FJUMP)) hsn[CCREG]=2; + for(j=10;j>=3;j--) + { + // Alloc preferred register if available + if(hsn[r=cur->regmap[preferred_reg]&63]==j) { + for(hr=0;hrregmap[hr]&63)==r) { + cur->regmap[hr]=-1; + cur->dirty&=~(1<isconst&=~(1<regmap[preferred_reg]=reg|64; + return; + } + for(r=1;r<=MAXREG;r++) + { + if(hsn[r]==j&&r!=rs1[i-1]&&r!=rs2[i-1]&&r!=rt1[i-1]&&r!=rt2[i-1]) { + for(hr=0;hrregmap[hr]==r+64) { + cur->regmap[hr]=reg|64; + cur->dirty&=~(1<isconst&=~(1<regmap[hr]==r) { + cur->regmap[hr]=reg|64; + cur->dirty&=~(1<isconst&=~(1<=0;j--) + { + for(r=1;r<=MAXREG;r++) + { + if(hsn[r]==j) { + for(hr=0;hrregmap[hr]==r+64) { + cur->regmap[hr]=reg|64; + cur->dirty&=~(1<isconst&=~(1<regmap[hr]==r) { + cur->regmap[hr]=reg|64; + cur->dirty&=~(1<isconst&=~(1<regmap[hr]==reg) return; + } + + // Try to allocate any available register, starting with EDI, ESI, EBP... + // We prefer EDI, ESI, EBP since the others are used for byte/halfword stores + for(hr=HOST_REGS-1;hr>=0;hr--) { + if(hr!=EXCLUDE_REG&&cur->regmap[hr]==-1) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<=0;hr--) + { + r=cur->regmap[hr]; + if(r>=0) { + if(r<64) { + if((cur->u>>r)&1) { + if(i==0||((unneeded_reg[i-1]>>r)&1)) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<uu>>(r&63))&1) { + if(i==0||((unneeded_reg_upper[i-1]>>(r&63))&1)) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<regmap[0]&63],hsn[cur->regmap[1]&63],hsn[cur->regmap[2]&63],hsn[cur->regmap[3]&63],hsn[cur->regmap[5]&63],hsn[cur->regmap[6]&63],hsn[cur->regmap[7]&63]); + if(i>0) { + // Don't evict the cycle count at entry points, otherwise the entry + // stub will have to write it. + if(bt[i]&&hsn[CCREG]>2) hsn[CCREG]=2; + if(i>1&&hsn[CCREG]>2&&(itype[i-2]==RJUMP||itype[i-2]==UJUMP||itype[i-2]==CJUMP||itype[i-2]==SJUMP||itype[i-2]==FJUMP)) hsn[CCREG]=2; + for(j=10;j>=3;j--) + { + for(r=1;r<=MAXREG;r++) + { + if(hsn[r]==j&&r!=rs1[i-1]&&r!=rs2[i-1]&&r!=rt1[i-1]&&r!=rt2[i-1]) { + for(hr=0;hr2) { + if(cur->regmap[hr]==r+64) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<2) { + if(cur->regmap[hr]==r) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<=0;j--) + { + for(r=1;r<=MAXREG;r++) + { + if(hsn[r]==j) { + for(hr=0;hrregmap[hr]==r+64) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<regmap[hr]==r) { + cur->regmap[hr]=reg; + cur->dirty&=~(1<isconst&=~(1<regmap[n]==reg) { + dirty=(cur->dirty>>n)&1; + cur->regmap[n]=-1; + } + } + + cur->regmap[hr]=reg; + cur->dirty&=~(1<dirty|=dirty<isconst&=~(1<u&=~(1LL<u&=~(1LL<is32|=1LL<is32|=1LL<is32&=~(1LL<is32&=~(1LL<is32|=1LL<is32|=1LL<>4); + if((r&63)==HIREG) addr=(int)&hi+((r&64)>>4); + if((r&63)==LOREG) addr=(int)&lo+((r&64)>>4); + if(r==CCREG) addr=(int)&cycle_count; + if(r==CSREG) addr=(int)&Status; + if(r==FSREG) addr=(int)&FCR31; + assem_debug("mov %x+%d,%%%s",addr,r,regname[hr]); + output_byte(0x8B); + output_modrm(0,5,hr); + output_w32(addr); + } +} +static void emit_storereg(int r, int hr) +{ + int addr=((int)reg)+((r&63)<<3)+((r&64)>>4); + if((r&63)==HIREG) addr=(int)&hi+((r&64)>>4); + if((r&63)==LOREG) addr=(int)&lo+((r&64)>>4); + if(r==CCREG) addr=(int)&cycle_count; + if(r==FSREG) addr=(int)&FCR31; + assem_debug("mov %%%s,%x+%d",regname[hr],addr,r); + output_byte(0x89); + output_modrm(0,5,hr); + output_w32(addr); +} + +static void emit_test(int rs, int rt) +{ + assem_debug("test %%%s,%%%s",regname[rs],regname[rt]); + output_byte(0x85); + output_modrm(3,rs,rt); +} + +static void emit_testimm(int rs,int imm) +{ + assem_debug("test $0x%x,%%%s",imm,regname[rs]); + if(imm<128&&imm>=-128&&rs<4) { + output_byte(0xF6); + output_modrm(3,rs,0); + output_byte(imm); + } + else + { + output_byte(0xF7); + output_modrm(3,rs,0); + output_w32(imm); + } +} + +static void emit_not(int rs,int rt) +{ + if(rs!=rt) emit_mov(rs,rt); + assem_debug("not %%%s",regname[rt]); + output_byte(0xF7); + output_modrm(3,rt,2); +} + +static void emit_and(u_int rs1,u_int rs2,u_int rt) +{ + assert(rs1<8); + assert(rs2<8); + assert(rt<8); + if(rs1==rt) { + assem_debug("and %%%s,%%%s",regname[rs2],regname[rt]); + output_byte(0x21); + output_modrm(3,rs1,rs2); + } + else + if(rs2==rt) { + assem_debug("and %%%s,%%%s",regname[rs1],regname[rt]); + output_byte(0x21); + output_modrm(3,rs2,rs1); + } + else { + emit_mov(rs1,rt); + emit_and(rt,rs2,rt); + } +} + +static void emit_or(u_int rs1,u_int rs2,u_int rt) +{ + assert(rs1<8); + assert(rs2<8); + assert(rt<8); + if(rs1==rt) { + assem_debug("or %%%s,%%%s",regname[rs2],regname[rt]); + output_byte(0x09); + output_modrm(3,rs1,rs2); + } + else + if(rs2==rt) { + assem_debug("or %%%s,%%%s",regname[rs1],regname[rt]); + output_byte(0x09); + output_modrm(3,rs2,rs1); + } + else { + emit_mov(rs1,rt); + emit_or(rt,rs2,rt); + } +} +static void emit_or_and_set_flags(int rs1,int rs2,int rt) +{ + emit_or(rs1,rs2,rt); +} + +static void emit_xor(u_int rs1,u_int rs2,u_int rt) +{ + assert(rs1<8); + assert(rs2<8); + assert(rt<8); + if(rs1==rt) { + assem_debug("xor %%%s,%%%s",regname[rs2],regname[rt]); + output_byte(0x31); + output_modrm(3,rs1,rs2); + } + else + if(rs2==rt) { + assem_debug("xor %%%s,%%%s",regname[rs1],regname[rt]); + output_byte(0x31); + output_modrm(3,rs2,rs1); + } + else { + emit_mov(rs1,rt); + emit_xor(rt,rs2,rt); + } +} + +static void emit_movimm(int imm,u_int rt) +{ + assem_debug("mov $%d,%%%s",imm,regname[rt]); + assert(rt<8); + output_byte(0xB8+rt); + output_w32(imm); +} + +static void emit_addimm(int rs,int imm,int rt) +{ + if(rs==rt) { + if(imm!=0) { + assem_debug("add $%d,%%%s",imm,regname[rt]); + if(imm<128&&imm>=-128) { + output_byte(0x83); + output_modrm(3,rt,0); + output_byte(imm); + } + else + { + output_byte(0x81); + output_modrm(3,rt,0); + output_w32(imm); + } + } + } + else { + if(imm!=0) { + assem_debug("lea %d(%%%s),%%%s",imm,regname[rs],regname[rt]); + output_byte(0x8D); + if(imm<128&&imm>=-128) { + output_modrm(1,rs,rt); + output_byte(imm); + }else{ + output_modrm(2,rs,rt); + output_w32(imm); + } + }else{ + emit_mov(rs,rt); + } + } +} + +static void emit_addimm_and_set_flags(int imm,int rt) +{ + assem_debug("add $%d,%%%s",imm,regname[rt]); + if(imm<128&&imm>=-128) { + output_byte(0x83); + output_modrm(3,rt,0); + output_byte(imm); + } + else + { + output_byte(0x81); + output_modrm(3,rt,0); + output_w32(imm); + } +} +static void emit_addimm_no_flags(int imm,int rt) +{ + if(imm!=0) { + assem_debug("lea %d(%%%s),%%%s",imm,regname[rt],regname[rt]); + output_byte(0x8D); + if(imm<128&&imm>=-128) { + output_modrm(1,rt,rt); + output_byte(imm); + }else{ + output_modrm(2,rt,rt); + output_w32(imm); + } + } +} + +static void emit_adcimm(int imm,u_int rt) +{ + assem_debug("adc $%d,%%%s",imm,regname[rt]); + assert(rt<8); + if(imm<128&&imm>=-128) { + output_byte(0x83); + output_modrm(3,rt,2); + output_byte(imm); + } + else + { + output_byte(0x81); + output_modrm(3,rt,2); + output_w32(imm); + } +} +static void emit_sbbimm(int imm,u_int rt) +{ + assem_debug("sbb $%d,%%%s",imm,regname[rt]); + assert(rt<8); + if(imm<128&&imm>=-128) { + output_byte(0x83); + output_modrm(3,rt,3); + output_byte(imm); + } + else + { + output_byte(0x81); + output_modrm(3,rt,3); + output_w32(imm); + } +} + +static void emit_addimm64_32(int rsh,int rsl,int imm,int rth,int rtl) +{ + if(rsh==rth&&rsl==rtl) { + assem_debug("add $%d,%%%s",imm,regname[rtl]); + if(imm<128&&imm>=-128) { + output_byte(0x83); + output_modrm(3,rtl,0); + output_byte(imm); + } + else + { + output_byte(0x81); + output_modrm(3,rtl,0); + output_w32(imm); + } + assem_debug("adc $%d,%%%s",imm>>31,regname[rth]); + output_byte(0x83); + output_modrm(3,rth,2); + output_byte(imm>>31); + } + else { + emit_mov(rsh,rth); + emit_mov(rsl,rtl); + emit_addimm64_32(rth,rtl,imm,rth,rtl); + } +} + +static void emit_sbb(int rs1,int rs2) +{ + assem_debug("sbb %%%s,%%%s",regname[rs1],regname[rs2]); + output_byte(0x19); + output_modrm(3,rs2,rs1); +} + +static void emit_andimm(int rs,int imm,int rt) +{ + if(imm==0) { + emit_zeroreg(rt); + } + else if(rs==rt) { + assem_debug("and $%d,%%%s",imm,regname[rt]); + if(imm<128&&imm>=-128) { + output_byte(0x83); + output_modrm(3,rt,4); + output_byte(imm); + } + else + { + output_byte(0x81); + output_modrm(3,rt,4); + output_w32(imm); + } + } + else { + emit_mov(rs,rt); + emit_andimm(rt,imm,rt); + } +} + +static void emit_orimm(int rs,int imm,int rt) +{ + if(rs==rt) { + if(imm!=0) { + assem_debug("or $%d,%%%s",imm,regname[rt]); + if(imm<128&&imm>=-128) { + output_byte(0x83); + output_modrm(3,rt,1); + output_byte(imm); + } + else + { + output_byte(0x81); + output_modrm(3,rt,1); + output_w32(imm); + } + } + } + else { + emit_mov(rs,rt); + emit_orimm(rt,imm,rt); + } +} + +static void emit_xorimm(int rs,int imm,int rt) +{ + if(rs==rt) { + if(imm!=0) { + assem_debug("xor $%d,%%%s",imm,regname[rt]); + if(imm<128&&imm>=-128) { + output_byte(0x83); + output_modrm(3,rt,6); + output_byte(imm); + } + else + { + output_byte(0x81); + output_modrm(3,rt,6); + output_w32(imm); + } + } + } + else { + emit_mov(rs,rt); + emit_xorimm(rt,imm,rt); + } +} + +static void emit_shlimm(int rs,u_int imm,int rt) +{ + if(rs==rt) { + assem_debug("shl %%%s,%d",regname[rt],imm); + assert(imm>0); + if(imm==1) output_byte(0xD1); + else output_byte(0xC1); + output_modrm(3,rt,4); + if(imm>1) output_byte(imm); + } + else { + emit_mov(rs,rt); + emit_shlimm(rt,imm,rt); + } +} + +static void emit_shrimm(int rs,u_int imm,int rt) +{ + if(rs==rt) { + assem_debug("shr %%%s,%d",regname[rt],imm); + assert(imm>0); + if(imm==1) output_byte(0xD1); + else output_byte(0xC1); + output_modrm(3,rt,5); + if(imm>1) output_byte(imm); + } + else { + emit_mov(rs,rt); + emit_shrimm(rt,imm,rt); + } +} + +static void emit_sarimm(int rs,u_int imm,int rt) +{ + if(rs==rt) { + assem_debug("sar %%%s,%d",regname[rt],imm); + assert(imm>0); + if(imm==1) output_byte(0xD1); + else output_byte(0xC1); + output_modrm(3,rt,7); + if(imm>1) output_byte(imm); + } + else { + emit_mov(rs,rt); + emit_sarimm(rt,imm,rt); + } +} + +static void emit_rorimm(int rs,u_int imm,int rt) +{ + if(rs==rt) { + assem_debug("ror %%%s,%d",regname[rt],imm); + assert(imm>0); + if(imm==1) output_byte(0xD1); + else output_byte(0xC1); + output_modrm(3,rt,1); + if(imm>1) output_byte(imm); + } + else { + emit_mov(rs,rt); + emit_rorimm(rt,imm,rt); + } +} + +static void emit_shldimm(int rs,int rs2,u_int imm,int rt) +{ + if(rs==rt) { + assem_debug("shld %%%s,%%%s,%d",regname[rt],regname[rs2],imm); + assert(imm>0); + output_byte(0x0F); + output_byte(0xA4); + output_modrm(3,rt,rs2); + output_byte(imm); + } + else { + emit_mov(rs,rt); + emit_shldimm(rt,rs2,imm,rt); + } +} + +static void emit_shrdimm(int rs,int rs2,u_int imm,int rt) +{ + if(rs==rt) { + assem_debug("shrd %%%s,%%%s,%d",regname[rt],regname[rs2],imm); + assert(imm>0); + output_byte(0x0F); + output_byte(0xAC); + output_modrm(3,rt,rs2); + output_byte(imm); + } + else { + emit_mov(rs,rt); + emit_shrdimm(rt,rs2,imm,rt); + } +} + +static void emit_shlcl(int r) +{ + assem_debug("shl %%%s,%%cl",regname[r]); + output_byte(0xD3); + output_modrm(3,r,4); +} +static void emit_shrcl(int r) +{ + assem_debug("shr %%%s,%%cl",regname[r]); + output_byte(0xD3); + output_modrm(3,r,5); +} +static void emit_sarcl(int r) +{ + assem_debug("sar %%%s,%%cl",regname[r]); + output_byte(0xD3); + output_modrm(3,r,7); +} + +static void emit_shldcl(int r1,int r2) +{ + assem_debug("shld %%%s,%%%s,%%cl",regname[r1],regname[r2]); + output_byte(0x0F); + output_byte(0xA5); + output_modrm(3,r1,r2); +} +static void emit_shrdcl(int r1,int r2) +{ + assem_debug("shrd %%%s,%%%s,%%cl",regname[r1],regname[r2]); + output_byte(0x0F); + output_byte(0xAD); + output_modrm(3,r1,r2); +} + +static void emit_cmpimm(int rs,int imm) +{ + assem_debug("cmp $%d,%%%s",imm,regname[rs]); + if(imm<128&&imm>=-128) { + output_byte(0x83); + output_modrm(3,rs,7); + output_byte(imm); + } + else + { + output_byte(0x81); + output_modrm(3,rs,7); + output_w32(imm); + } +} + +static void emit_cmovne(const u_int *addr,int rt) +{ + assem_debug("cmovne %x,%%%s",(int)addr,regname[rt]); + if(addr==&const_zero) assem_debug(" [zero]"); + else if(addr==&const_one) assem_debug(" [one]"); + else assem_debug(""); + output_byte(0x0F); + output_byte(0x45); + output_modrm(0,5,rt); + output_w32((int)addr); +} +static void emit_cmovl(const u_int *addr,int rt) +{ + assem_debug("cmovl %x,%%%s",(int)addr,regname[rt]); + if(addr==&const_zero) assem_debug(" [zero]"); + else if(addr==&const_one) assem_debug(" [one]"); + else assem_debug(""); + output_byte(0x0F); + output_byte(0x4C); + output_modrm(0,5,rt); + output_w32((int)addr); +} +static void emit_cmovs(const u_int *addr,int rt) +{ + assem_debug("cmovs %x,%%%s",(int)addr,regname[rt]); + if(addr==&const_zero) assem_debug(" [zero]"); + else if(addr==&const_one) assem_debug(" [one]"); + else assem_debug(""); + output_byte(0x0F); + output_byte(0x48); + output_modrm(0,5,rt); + output_w32((int)addr); +} +static void emit_cmovne_reg(int rs,int rt) +{ + assem_debug("cmovne %%%s,%%%s",regname[rs],regname[rt]); + output_byte(0x0F); + output_byte(0x45); + output_modrm(3,rs,rt); +} +static void emit_cmovl_reg(int rs,int rt) +{ + assem_debug("cmovl %%%s,%%%s",regname[rs],regname[rt]); + output_byte(0x0F); + output_byte(0x4C); + output_modrm(3,rs,rt); +} +static void emit_cmovs_reg(int rs,int rt) +{ + assem_debug("cmovs %%%s,%%%s",regname[rs],regname[rt]); + output_byte(0x0F); + output_byte(0x48); + output_modrm(3,rs,rt); +} +static void emit_cmovnc_reg(int rs,int rt) +{ + assem_debug("cmovae %%%s,%%%s",regname[rs],regname[rt]); + output_byte(0x0F); + output_byte(0x43); + output_modrm(3,rs,rt); +} +static void emit_cmova_reg(int rs,int rt) +{ + assem_debug("cmova %%%s,%%%s",regname[rs],regname[rt]); + output_byte(0x0F); + output_byte(0x47); + output_modrm(3,rs,rt); +} +static void emit_cmovp_reg(int rs,int rt) +{ + assem_debug("cmovp %%%s,%%%s",regname[rs],regname[rt]); + output_byte(0x0F); + output_byte(0x4A); + output_modrm(3,rs,rt); +} +static void emit_cmovnp_reg(int rs,int rt) +{ + assem_debug("cmovnp %%%s,%%%s",regname[rs],regname[rt]); + output_byte(0x0F); + output_byte(0x4B); + output_modrm(3,rs,rt); +} +static void emit_setl(int rt) +{ + assem_debug("setl %%%s",regname[rt]); + output_byte(0x0F); + output_byte(0x9C); + output_modrm(3,rt,2); +} +static void emit_movzbl_reg(int rs, int rt) +{ + assem_debug("movzbl %%%s,%%%s",regname[rs]+1,regname[rt]); + output_byte(0x0F); + output_byte(0xB6); + output_modrm(3,rs,rt); +} + +static void emit_slti32(int rs,int imm,int rt) +{ + if(rs!=rt) emit_zeroreg(rt); + emit_cmpimm(rs,imm); + if(rt<4) { + emit_setl(rt); + if(rs==rt) emit_movzbl_reg(rt,rt); + } + else + { + if(rs==rt) emit_movimm(0,rt); + emit_cmovl(&const_one,rt); + } +} +static void emit_sltiu32(int rs,int imm,int rt) +{ + if(rs!=rt) emit_zeroreg(rt); + emit_cmpimm(rs,imm); + if(rs==rt) emit_movimm(0,rt); + emit_adcimm(0,rt); +} +static void emit_slti64_32(int rsh,int rsl,int imm,int rt) +{ + assert(rsh!=rt); + emit_slti32(rsl,imm,rt); + if(imm>=0) + { + emit_test(rsh,rsh); + emit_cmovne(&const_zero,rt); + emit_cmovs(&const_one,rt); + } + else + { + emit_cmpimm(rsh,-1); + emit_cmovne(&const_zero,rt); + emit_cmovl(&const_one,rt); + } +} +static void emit_sltiu64_32(int rsh,int rsl,int imm,int rt) +{ + assert(rsh!=rt); + emit_sltiu32(rsl,imm,rt); + if(imm>=0) + { + emit_test(rsh,rsh); + emit_cmovne(&const_zero,rt); + } + else + { + emit_cmpimm(rsh,-1); + emit_cmovne(&const_one,rt); + } +} + +static void emit_cmp(int rs,int rt) +{ + assem_debug("cmp %%%s,%%%s",regname[rt],regname[rs]); + output_byte(0x39); + output_modrm(3,rs,rt); +} +static void emit_set_gz32(int rs, int rt) +{ + //assem_debug("set_gz32"); + emit_cmpimm(rs,1); + emit_movimm(1,rt); + emit_cmovl(&const_zero,rt); +} +static void emit_set_nz32(int rs, int rt) +{ + //assem_debug("set_nz32"); + emit_cmpimm(rs,1); + emit_movimm(1,rt); + emit_sbbimm(0,rt); +} +static void emit_set_gz64_32(int rsh, int rsl, int rt) +{ + //assem_debug("set_gz64"); + emit_set_gz32(rsl,rt); + emit_test(rsh,rsh); + emit_cmovne(&const_one,rt); + emit_cmovs(&const_zero,rt); +} +static void emit_set_nz64_32(int rsh, int rsl, int rt) +{ + //assem_debug("set_nz64"); + emit_or_and_set_flags(rsh,rsl,rt); + emit_cmovne(&const_one,rt); +} +static void emit_set_if_less32(int rs1, int rs2, int rt) +{ + //assem_debug("set if less (%%%s,%%%s),%%%s",regname[rs1],regname[rs2],regname[rt]); + if(rs1!=rt&&rs2!=rt) emit_zeroreg(rt); + emit_cmp(rs1,rs2); + if(rs1==rt||rs2==rt) emit_movimm(0,rt); + emit_cmovl(&const_one,rt); +} +static void emit_set_if_carry32(int rs1, int rs2, int rt) +{ + //assem_debug("set if carry (%%%s,%%%s),%%%s",regname[rs1],regname[rs2],regname[rt]); + if(rs1!=rt&&rs2!=rt) emit_zeroreg(rt); + emit_cmp(rs1,rs2); + if(rs1==rt||rs2==rt) emit_movimm(0,rt); + emit_adcimm(0,rt); +} +static void emit_set_if_less64_32(int u1, int l1, int u2, int l2, int rt) +{ + //assem_debug("set if less64 (%%%s,%%%s,%%%s,%%%s),%%%s",regname[u1],regname[l1],regname[u2],regname[l2],regname[rt]); + assert(u1!=rt); + assert(u2!=rt); + emit_cmp(l1,l2); + emit_mov(u1,rt); + emit_sbb(u2,rt); + emit_movimm(0,rt); + emit_cmovl(&const_one,rt); +} +static void emit_set_if_carry64_32(int u1, int l1, int u2, int l2, int rt) +{ + //assem_debug("set if carry64 (%%%s,%%%s,%%%s,%%%s),%%%s",regname[u1],regname[l1],regname[u2],regname[l2],regname[rt]); + assert(u1!=rt); + assert(u2!=rt); + emit_cmp(l1,l2); + emit_mov(u1,rt); + emit_sbb(u2,rt); + emit_movimm(0,rt); + emit_adcimm(0,rt); +} + +static void emit_call(int a) +{ + assem_debug("call %x (%x+%x)",a,(int)out+5,a-(int)out-5); + output_byte(0xe8); + output_w32(a-(int)out-4); +} +static void emit_jmp(int a) +{ + assem_debug("jmp %x (%x+%x)",a,(int)out+5,a-(int)out-5); + output_byte(0xe9); + output_w32(a-(int)out-4); +} +static void emit_jne(int a) +{ + assem_debug("jne %x",a); + output_byte(0x0f); + output_byte(0x85); + output_w32(a-(int)out-4); +} +static void emit_jeq(int a) +{ + assem_debug("jeq %x",a); + output_byte(0x0f); + output_byte(0x84); + output_w32(a-(int)out-4); +} +static void emit_js(int a) +{ + assem_debug("js %x",a); + output_byte(0x0f); + output_byte(0x88); + output_w32(a-(int)out-4); +} +static void emit_jns(int a) +{ + assem_debug("jns %x",a); + output_byte(0x0f); + output_byte(0x89); + output_w32(a-(int)out-4); +} +static void emit_jl(int a) +{ + assem_debug("jl %x",a); + output_byte(0x0f); + output_byte(0x8c); + output_w32(a-(int)out-4); +} +static void emit_jge(int a) +{ + assem_debug("jge %x",a); + output_byte(0x0f); + output_byte(0x8d); + output_w32(a-(int)out-4); +} +static void emit_jno(int a) +{ + assem_debug("jno %x",a); + output_byte(0x0f); + output_byte(0x81); + output_w32(a-(int)out-4); +} +static void emit_jc(int a) +{ + assem_debug("jc %x",a); + output_byte(0x0f); + output_byte(0x82); + output_w32(a-(int)out-4); +} + +static void emit_pushimm(int imm) +{ + assem_debug("push $%x",imm); + output_byte(0x68); + output_w32(imm); +} +static void emit_pushmem(int addr) +{ + assem_debug("push *%x",addr); + output_byte(0xFF); + output_modrm(0,5,6); + output_w32(addr); +} +static void emit_pusha() +{ + assem_debug("pusha"); + output_byte(0x60); +} +static void emit_popa() +{ + assem_debug("popa"); + output_byte(0x61); +} +static void emit_pushreg(u_int r) +{ + assem_debug("push %%%s",regname[r]); + assert(r<8); + output_byte(0x50+r); +} +static void emit_popreg(u_int r) +{ + assem_debug("pop %%%s",regname[r]); + assert(r<8); + output_byte(0x58+r); +} +static void emit_callreg(u_int r) +{ + assem_debug("call *%%%s",regname[r]); + assert(r<8); + output_byte(0xFF); + output_modrm(3,r,2); +} +/*static void emit_jmpreg(u_int r) +{ + assem_debug("jmp *%%%s",regname[r]); + assert(r<8); + output_byte(0xFF); + output_modrm(3,r,4); +}*/ +static void emit_jmpmem_indexed(u_int addr,u_int r) +{ + assem_debug("jmp *%x(%%%s)",addr,regname[r]); + assert(r<8); + output_byte(0xFF); + output_modrm(2,r,4); + output_w32(addr); +} + +static void emit_readword(int addr, int rt) +{ + assem_debug("mov %x,%%%s",addr,regname[rt]); + output_byte(0x8B); + output_modrm(0,5,rt); + output_w32(addr); +} +static void emit_readword_indexed(int addr, int rs, int rt) +{ + assem_debug("mov %x+%%%s,%%%s",addr,regname[rs],regname[rt]); + output_byte(0x8B); + if(addr<128&&addr>=-128) { + output_modrm(1,rs,rt); + if(rs==ESP) output_sib(0,4,4); + output_byte(addr); + } + else + { + output_modrm(2,rs,rt); + if(rs==ESP) output_sib(0,4,4); + output_w32(addr); + } +} +static void emit_readword_tlb(int addr, int map, int rt) +{ + if(map<0) emit_readword(addr+(int)rdram-0x80000000, rt); + else + { + assem_debug("mov (%x,%%%s,4),%%%s",addr,regname[map],regname[rt]); + output_byte(0x8B); + output_modrm(0,4,rt); + output_sib(2,map,5); + output_w32(addr); + } +} +static void emit_readword_indexed_tlb(int addr, int rs, int map, int rt) +{ + if(map<0) emit_readword_indexed(addr+(int)rdram-0x80000000, rs, rt); + else { + assem_debug("mov %x(%%%s,%%%s,4),%%%s",addr,regname[rs],regname[map],regname[rt]); + assert(rs!=ESP); + output_byte(0x8B); + if(addr==0&&rs!=EBP) { + output_modrm(0,4,rt); + output_sib(2,map,rs); + } + else if(addr<128&&addr>=-128) { + output_modrm(1,4,rt); + output_sib(2,map,rs); + output_byte(addr); + } + else + { + output_modrm(2,4,rt); + output_sib(2,map,rs); + output_w32(addr); + } + } +} +static void emit_movmem_indexedx4(int addr, int rs, int rt) +{ + assem_debug("mov (%x,%%%s,4),%%%s",addr,regname[rs],regname[rt]); + output_byte(0x8B); + output_modrm(0,4,rt); + output_sib(2,rs,5); + output_w32(addr); +} +static void emit_readdword_tlb(int addr, int map, int rh, int rl) +{ + if(map<0) { + if(rh>=0) emit_readword(addr+(int)rdram-0x80000000, rh); + emit_readword(addr+(int)rdram-0x7FFFFFFC, rl); + } + else { + if(rh>=0) emit_movmem_indexedx4(addr, map, rh); + emit_movmem_indexedx4(addr+4, map, rl); + } +} +static void emit_readdword_indexed_tlb(int addr, int rs, int map, int rh, int rl) +{ + assert(rh!=rs); + if(rh>=0) emit_readword_indexed_tlb(addr, rs, map, rh); + emit_readword_indexed_tlb(addr+4, rs, map, rl); +} +static void emit_movsbl(int addr, int rt) +{ + assem_debug("movsbl %x,%%%s",addr,regname[rt]); + output_byte(0x0F); + output_byte(0xBE); + output_modrm(0,5,rt); + output_w32(addr); +} +static void emit_movsbl_indexed(int addr, int rs, int rt) +{ + assem_debug("movsbl %x+%%%s,%%%s",addr,regname[rs],regname[rt]); + output_byte(0x0F); + output_byte(0xBE); + output_modrm(2,rs,rt); + output_w32(addr); +} +static void emit_movsbl_tlb(int addr, int map, int rt) +{ + if(map<0) emit_movsbl(addr+(int)rdram-0x80000000, rt); + else + { + assem_debug("movsbl (%x,%%%s,4),%%%s",addr,regname[map],regname[rt]); + output_byte(0x0F); + output_byte(0xBE); + output_modrm(0,4,rt); + output_sib(2,map,5); + output_w32(addr); + } +} +static void emit_movsbl_indexed_tlb(int addr, int rs, int map, int rt) +{ + if(map<0) emit_movsbl_indexed(addr+(int)rdram-0x80000000, rs, rt); + else { + assem_debug("movsbl %x(%%%s,%%%s,4),%%%s",addr,regname[rs],regname[map],regname[rt]); + assert(rs!=ESP); + output_byte(0x0F); + output_byte(0xBE); + if(addr==0&&rs!=EBP) { + output_modrm(0,4,rt); + output_sib(2,map,rs); + } + else if(addr<128&&addr>=-128) { + output_modrm(1,4,rt); + output_sib(2,map,rs); + output_byte(addr); + } + else + { + output_modrm(2,4,rt); + output_sib(2,map,rs); + output_w32(addr); + } + } +} +static void emit_movswl(int addr, int rt) +{ + assem_debug("movswl %x,%%%s",addr,regname[rt]); + output_byte(0x0F); + output_byte(0xBF); + output_modrm(0,5,rt); + output_w32(addr); +} +static void emit_movswl_indexed(int addr, int rs, int rt) +{ + assem_debug("movswl %x+%%%s,%%%s",addr,regname[rs],regname[rt]); + output_byte(0x0F); + output_byte(0xBF); + output_modrm(2,rs,rt); + output_w32(addr); +} +static void emit_movswl_tlb(int addr, int map, int rt) +{ + if(map<0) emit_movswl(addr+(int)rdram-0x80000000, rt); + else + { + assem_debug("movswl (%x,%%%s,4),%%%s",addr,regname[map],regname[rt]); + output_byte(0x0F); + output_byte(0xBF); + output_modrm(0,4,rt); + output_sib(2,map,5); + output_w32(addr); + } +} +static void emit_movzbl(int addr, int rt) +{ + assem_debug("movzbl %x,%%%s",addr,regname[rt]); + output_byte(0x0F); + output_byte(0xB6); + output_modrm(0,5,rt); + output_w32(addr); +} +static void emit_movzbl_indexed(int addr, int rs, int rt) +{ + assem_debug("movzbl %x+%%%s,%%%s",addr,regname[rs],regname[rt]); + output_byte(0x0F); + output_byte(0xB6); + output_modrm(2,rs,rt); + output_w32(addr); +} +static void emit_movzbl_tlb(int addr, int map, int rt) +{ + if(map<0) emit_movzbl(addr+(int)rdram-0x80000000, rt); + else + { + assem_debug("movzbl (%x,%%%s,4),%%%s",addr,regname[map],regname[rt]); + output_byte(0x0F); + output_byte(0xB6); + output_modrm(0,4,rt); + output_sib(2,map,5); + output_w32(addr); + } +} +static void emit_movzbl_indexed_tlb(int addr, int rs, int map, int rt) +{ + if(map<0) emit_movzbl_indexed(addr+(int)rdram-0x80000000, rs, rt); + else { + assem_debug("movzbl %x(%%%s,%%%s,4),%%%s",addr,regname[rs],regname[map],regname[rt]); + assert(rs!=ESP); + output_byte(0x0F); + output_byte(0xB6); + if(addr==0&&rs!=EBP) { + output_modrm(0,4,rt); + output_sib(2,map,rs); + } + else if(addr<128&&addr>=-128) { + output_modrm(1,4,rt); + output_sib(2,map,rs); + output_byte(addr); + } + else + { + output_modrm(2,4,rt); + output_sib(2,map,rs); + output_w32(addr); + } + } +} +static void emit_movzwl(int addr, int rt) +{ + assem_debug("movzwl %x,%%%s",addr,regname[rt]); + output_byte(0x0F); + output_byte(0xB7); + output_modrm(0,5,rt); + output_w32(addr); +} +static void emit_movzwl_indexed(int addr, int rs, int rt) +{ + assem_debug("movzwl %x+%%%s,%%%s",addr,regname[rs],regname[rt]); + output_byte(0x0F); + output_byte(0xB7); + output_modrm(2,rs,rt); + output_w32(addr); +} +static void emit_movzwl_tlb(int addr, int map, int rt) +{ + if(map<0) emit_movzwl(addr+(int)rdram-0x80000000, rt); + else + { + assem_debug("movzwl (%x,%%%s,4),%%%s",addr,regname[map],regname[rt]); + output_byte(0x0F); + output_byte(0xB7); + output_modrm(0,4,rt); + output_sib(2,map,5); + output_w32(addr); + } +} +/* +static void emit_movzwl_reg(int rs, int rt) +{ + assem_debug("movzwl %%%s,%%%s",regname[rs]+1,regname[rt]); + output_byte(0x0F); + output_byte(0xB7); + output_modrm(3,rs,rt); +}*/ + +static void emit_xchg(int rs, int rt) +{ + assem_debug("xchg %%%s,%%%s",regname[rs],regname[rt]); + if(rs==EAX) { + output_byte(0x90+rt); + } + else + { + output_byte(0x87); + output_modrm(3,rs,rt); + } +} +static void emit_writeword(int rt, int addr) +{ + assem_debug("movl %%%s,%x",regname[rt],addr); + output_byte(0x89); + output_modrm(0,5,rt); + output_w32(addr); +} +static void emit_writeword_indexed(int rt, int addr, int rs) +{ + assem_debug("mov %%%s,%x+%%%s",regname[rt],addr,regname[rs]); + output_byte(0x89); + if(addr<128&&addr>=-128) { + output_modrm(1,rs,rt); + if(rs==ESP) output_sib(0,4,4); + output_byte(addr); + } + else + { + output_modrm(2,rs,rt); + if(rs==ESP) output_sib(0,4,4); + output_w32(addr); + } +} +static void emit_writeword_indexed_tlb(int rt, int addr, int rs, int map, int temp) +{ + if(map<0) emit_writeword_indexed(rt, addr+(int)rdram-0x80000000, rs); + else { + assem_debug("mov %%%s,%x(%%%s,%%%s,1)",regname[rt],addr,regname[rs],regname[map]); + assert(rs!=ESP); + output_byte(0x89); + if(addr==0&&rs!=EBP) { + output_modrm(0,4,rt); + output_sib(0,map,rs); + } + else if(addr<128&&addr>=-128) { + output_modrm(1,4,rt); + output_sib(0,map,rs); + output_byte(addr); + } + else + { + output_modrm(2,4,rt); + output_sib(0,map,rs); + output_w32(addr); + } + } +} +static void emit_writedword_indexed_tlb(int rh, int rl, int addr, int rs, int map, int temp) +{ + assert(rh>=0); + emit_writeword_indexed_tlb(rh, addr, rs, map, temp); + emit_writeword_indexed_tlb(rl, addr+4, rs, map, temp); +} +static void emit_writehword(int rt, int addr) +{ + assem_debug("movw %%%s,%x",regname[rt]+1,addr); + output_byte(0x66); + output_byte(0x89); + output_modrm(0,5,rt); + output_w32(addr); +} +static void emit_writehword_indexed(int rt, int addr, int rs) +{ + assem_debug("movw %%%s,%x+%%%s",regname[rt]+1,addr,regname[rs]); + output_byte(0x66); + output_byte(0x89); + if(addr<128&&addr>=-128) { + output_modrm(1,rs,rt); + output_byte(addr); + } + else + { + output_modrm(2,rs,rt); + output_w32(addr); + } +} +static void emit_writebyte(int rt, int addr) +{ + if(rt<4) { + assem_debug("movb %%%cl,%x",regname[rt][1],addr); + output_byte(0x88); + output_modrm(0,5,rt); + output_w32(addr); + } + else + { + emit_xchg(EAX,rt); + emit_writebyte(EAX,addr); + emit_xchg(EAX,rt); + } +} +static void emit_writebyte_indexed(int rt, int addr, int rs) +{ + if(rt<4) { + assem_debug("movb %%%cl,%x+%%%s",regname[rt][1],addr,regname[rs]); + output_byte(0x88); + if(addr<128&&addr>=-128) { + output_modrm(1,rs,rt); + output_byte(addr); + } + else + { + output_modrm(2,rs,rt); + output_w32(addr); + } + } + else + { + emit_xchg(EAX,rt); + emit_writebyte_indexed(EAX,addr,rs==EAX?rt:rs); + emit_xchg(EAX,rt); + } +} +static void emit_writebyte_indexed_tlb(int rt, int addr, int rs, int map, int temp) +{ + if(map<0) emit_writebyte_indexed(rt, addr+(int)rdram-0x80000000, rs); + else + if(rt<4) { + assem_debug("movb %%%cl,%x(%%%s,%%%s,1)",regname[rt][1],addr,regname[rs],regname[map]); + assert(rs!=ESP); + output_byte(0x88); + if(addr==0&&rs!=EBP) { + output_modrm(0,4,rt); + output_sib(0,map,rs); + } + else if(addr<128&&addr>=-128) { + output_modrm(1,4,rt); + output_sib(0,map,rs); + output_byte(addr); + } + else + { + output_modrm(2,4,rt); + output_sib(0,map,rs); + output_w32(addr); + } + } + else + { + emit_xchg(EAX,rt); + emit_writebyte_indexed_tlb(EAX,addr,rs==EAX?rt:rs,map==EAX?rt:map,temp); + emit_xchg(EAX,rt); + } +} +static void emit_writeword_imm(int imm, int addr) +{ + assem_debug("movl $%x,%x",imm,addr); + output_byte(0xC7); + output_modrm(0,5,0); + output_w32(addr); + output_w32(imm); +} +static void emit_writeword_imm_esp(int imm, int addr) +{ + assem_debug("mov $%x,%x(%%esp)",imm,addr); + assert(addr>=-128&&addr<128); + output_byte(0xC7); + output_modrm(1,4,0); + output_sib(0,4,4); + output_byte(addr); + output_w32(imm); +} +static void emit_writebyte_imm(int imm, int addr) +{ + assem_debug("movb $%x,%x",imm,addr); + assert(imm>=-128&&imm<128); + output_byte(0xC6); + output_modrm(0,5,0); + output_w32(addr); + output_byte(imm); +} + +static void emit_mul(int rs) +{ + assem_debug("mul %%%s",regname[rs]); + output_byte(0xF7); + output_modrm(3,rs,4); +} +static void emit_imul(int rs) +{ + assem_debug("imul %%%s",regname[rs]); + output_byte(0xF7); + output_modrm(3,rs,5); +} +static void emit_div(int rs) +{ + assem_debug("div %%%s",regname[rs]); + output_byte(0xF7); + output_modrm(3,rs,6); +} +static void emit_idiv(int rs) +{ + assem_debug("idiv %%%s",regname[rs]); + output_byte(0xF7); + output_modrm(3,rs,7); +} +static void emit_cdq() +{ + assem_debug("cdq"); + output_byte(0x99); +} + +// Load 2 immediates optimizing for small code size +static void emit_mov2imm_compact(int imm1,u_int rt1,int imm2,u_int rt2) +{ + emit_movimm(imm1,rt1); + if(imm2-imm1<128&&imm2-imm1>=-128) emit_addimm(rt1,imm2-imm1,rt2); + else emit_movimm(imm2,rt2); +} + +// special case for checking pending_exception +static void emit_cmpmem_imm_byte(int addr,int imm) +{ + assert(imm<128&&imm>=-127); + assem_debug("cmpb $%d,%x",imm,addr); + output_byte(0x80); + output_modrm(0,5,7); + output_w32(addr); + output_byte(imm); +} + +// special case for checking invalid_code +static void emit_cmpmem_indexedsr12_imm(int addr,int r,int imm) +{ + assert(imm<128&&imm>=-127); + assert(r>=0&&r<8); + emit_shrimm(r,12,r); + assem_debug("cmp $%d,%x+%%%s",imm,addr,regname[r]); + output_byte(0x80); + output_modrm(2,r,7); + output_w32(addr); + output_byte(imm); +} + +// special case for checking hash_table +static void emit_cmpmem_indexed(int addr,int rs,int rt) +{ + assert(rs>=0&&rs<8); + assert(rt>=0&&rt<8); + assem_debug("cmp %x+%%%s,%%%s",addr,regname[rs],regname[rt]); + output_byte(0x39); + output_modrm(2,rs,rt); + output_w32(addr); +} + +// Used to preload hash table entries +#ifdef IMM_PREFETCH +static void emit_prefetch(void *addr) +{ + assem_debug("prefetch %x",(int)addr); + output_byte(0x0F); + output_byte(0x18); + output_modrm(0,5,1); + output_w32((int)addr); +} +#endif + +/*void emit_submem(int r,int addr) +{ + assert(r>=0&&r<8); + assem_debug("sub %x,%%%s",addr,regname[r]); + output_byte(0x2B); + output_modrm(0,5,r); + output_w32((int)addr); +} +static void emit_subfrommem(int addr,int r) +{ + assert(r>=0&&r<8); + assem_debug("sub %%%s,%x",regname[r],addr); + output_byte(0x29); + output_modrm(0,5,r); + output_w32((int)addr); +}*/ + +static void emit_flds(int r) +{ + assem_debug("flds (%%%s)",regname[r]); + output_byte(0xd9); + if(r!=EBP) output_modrm(0,r,0); + else {output_modrm(1,EBP,0);output_byte(0);} +} +static void emit_fldl(int r) +{ + assem_debug("fldl (%%%s)",regname[r]); + output_byte(0xdd); + if(r!=EBP) output_modrm(0,r,0); + else {output_modrm(1,EBP,0);output_byte(0);} +} +static void emit_fucomip(u_int r) +{ + assem_debug("fucomip %d",r); + assert(r<8); + output_byte(0xdf); + output_byte(0xe8+r); +} +static void emit_fchs() +{ + assem_debug("fchs"); + output_byte(0xd9); + output_byte(0xe0); +} +static void emit_fabs() +{ + assem_debug("fabs"); + output_byte(0xd9); + output_byte(0xe1); +} +static void emit_fsqrt() +{ + assem_debug("fsqrt"); + output_byte(0xd9); + output_byte(0xfa); +} +static void emit_fadds(int r) +{ + assem_debug("fadds (%%%s)",regname[r]); + output_byte(0xd8); + if(r!=EBP) output_modrm(0,r,0); + else {output_modrm(1,EBP,0);output_byte(0);} +} +static void emit_faddl(int r) +{ + assem_debug("faddl (%%%s)",regname[r]); + output_byte(0xdc); + if(r!=EBP) output_modrm(0,r,0); + else {output_modrm(1,EBP,0);output_byte(0);} +} +static void emit_fadd(int r) +{ + assem_debug("fadd st%d",r); + output_byte(0xd8); + output_byte(0xc0+r); +} +static void emit_fsubs(int r) +{ + assem_debug("fsubs (%%%s)",regname[r]); + output_byte(0xd8); + if(r!=EBP) output_modrm(0,r,4); + else {output_modrm(1,EBP,4);output_byte(0);} +} +static void emit_fsubl(int r) +{ + assem_debug("fsubl (%%%s)",regname[r]); + output_byte(0xdc); + if(r!=EBP) output_modrm(0,r,4); + else {output_modrm(1,EBP,4);output_byte(0);} +} +static void emit_fsub(int r) +{ + assem_debug("fsub st%d",r); + output_byte(0xd8); + output_byte(0xe0+r); +} +static void emit_fmuls(int r) +{ + assem_debug("fmuls (%%%s)",regname[r]); + output_byte(0xd8); + if(r!=EBP) output_modrm(0,r,1); + else {output_modrm(1,EBP,1);output_byte(0);} +} +static void emit_fmull(int r) +{ + assem_debug("fmull (%%%s)",regname[r]); + output_byte(0xdc); + if(r!=EBP) output_modrm(0,r,1); + else {output_modrm(1,EBP,1);output_byte(0);} +} +static void emit_fmul(int r) +{ + assem_debug("fmul st%d",r); + output_byte(0xd8); + output_byte(0xc8+r); +} +static void emit_fdivs(int r) +{ + assem_debug("fdivs (%%%s)",regname[r]); + output_byte(0xd8); + if(r!=EBP) output_modrm(0,r,6); + else {output_modrm(1,EBP,6);output_byte(0);} +} +static void emit_fdivl(int r) +{ + assem_debug("fdivl (%%%s)",regname[r]); + output_byte(0xdc); + if(r!=EBP) output_modrm(0,r,6); + else {output_modrm(1,EBP,6);output_byte(0);} +} +static void emit_fdiv(int r) +{ + assem_debug("fdiv st%d",r); + output_byte(0xd8); + output_byte(0xf0+r); +} +static void emit_fpop() +{ + // fstp st(0) + assem_debug("fpop"); + output_byte(0xdd); + output_byte(0xd8); +} +static void emit_fildl(int r) +{ + assem_debug("fildl (%%%s)",regname[r]); + output_byte(0xdb); + if(r!=EBP) output_modrm(0,r,0); + else {output_modrm(1,EBP,0);output_byte(0);} +} +static void emit_fildll(int r) +{ + assem_debug("fildll (%%%s)",regname[r]); + output_byte(0xdf); + if(r!=EBP) output_modrm(0,r,5); + else {output_modrm(1,EBP,5);output_byte(0);} +} +static void emit_fistpl(int r) +{ + assem_debug("fistpl (%%%s)",regname[r]); + output_byte(0xdb); + if(r!=EBP) output_modrm(0,r,3); + else {output_modrm(1,EBP,3);output_byte(0);} +} +static void emit_fistpll(int r) +{ + assem_debug("fistpll (%%%s)",regname[r]); + output_byte(0xdf); + if(r!=EBP) output_modrm(0,r,7); + else {output_modrm(1,EBP,7);output_byte(0);} +} +static void emit_fstps(int r) +{ + assem_debug("fstps (%%%s)",regname[r]); + output_byte(0xd9); + if(r!=EBP) output_modrm(0,r,3); + else {output_modrm(1,EBP,3);output_byte(0);} +} +static void emit_fstpl(int r) +{ + assem_debug("fstpl (%%%s)",regname[r]); + output_byte(0xdd); + if(r!=EBP) output_modrm(0,r,3); + else {output_modrm(1,EBP,3);output_byte(0);} +} +static void emit_fnstcw_stack() +{ + assem_debug("fnstcw (%%esp)"); + output_byte(0xd9); + output_modrm(0,4,7); + output_sib(0,4,4); +} +static void emit_fldcw_stack() +{ + assem_debug("fldcw (%%esp)"); + output_byte(0xd9); + output_modrm(0,4,5); + output_sib(0,4,4); +} +static void emit_fldcw_indexed(int addr,int r) +{ + assem_debug("fldcw %x(%%%s)",addr,regname[r]); + output_byte(0xd9); + output_modrm(0,4,5); + output_sib(1,r,5); + output_w32(addr); +} +static void emit_fldcw(int addr) +{ + assem_debug("fldcw %x",addr); + output_byte(0xd9); + output_modrm(0,5,5); + output_w32(addr); +} +#ifdef __SSE__ +static void emit_movss_load(u_int addr,u_int ssereg) +{ + assem_debug("movss (%%%s),xmm%d",regname[addr],ssereg); + assert(ssereg<8); + output_byte(0xf3); + output_byte(0x0f); + output_byte(0x10); + if(addr!=EBP) output_modrm(0,addr,ssereg); + else {output_modrm(1,EBP,ssereg);output_byte(0);} +} +static void emit_movsd_load(u_int addr,u_int ssereg) +{ + assem_debug("movsd (%%%s),xmm%d",regname[addr],ssereg); + assert(ssereg<8); + output_byte(0xf2); + output_byte(0x0f); + output_byte(0x10); + if(addr!=EBP) output_modrm(0,addr,ssereg); + else {output_modrm(1,EBP,ssereg);output_byte(0);} +} +static void emit_movd_store(u_int ssereg,u_int addr) +{ + assem_debug("movd xmm%d,(%%%s)",ssereg,regname[addr]); + assert(ssereg<8); + output_byte(0x66); + output_byte(0x0f); + output_byte(0x7e); + if(addr!=EBP) output_modrm(0,addr,ssereg); + else {output_modrm(1,EBP,ssereg);output_byte(0);} +} +static void emit_cvttps2dq(u_int ssereg1,u_int ssereg2) +{ + assem_debug("cvttps2dq xmm%d,xmm%d",ssereg1,ssereg2); + assert(ssereg1<8); + assert(ssereg2<8); + output_byte(0xf3); + output_byte(0x0f); + output_byte(0x5b); + output_modrm(3,ssereg1,ssereg2); +} +static void emit_cvttpd2dq(u_int ssereg1,u_int ssereg2) +{ + assem_debug("cvttpd2dq xmm%d,xmm%d",ssereg1,ssereg2); + assert(ssereg1<8); + assert(ssereg2<8); + output_byte(0x66); + output_byte(0x0f); + output_byte(0xe6); + output_modrm(3,ssereg1,ssereg2); +} +#endif + +/* Stubs/epilogue */ + +static void emit_extjump2(int addr, int target, int linker) +{ + u_char *ptr=(u_char *)addr; + if(*ptr==0x0f) + { + assert(ptr[1]>=0x80&&ptr[1]<=0x8f); + addr+=2; + } + else + { + assert(*ptr==0xe8||*ptr==0xe9); + addr++; + } + emit_movimm(target,EAX); + emit_movimm(addr,EBX); + //assert(addr>=0x7000000&&addr<0x7FFFFFF); + //assert((target>=0x80000000&&target<0x80800000)||(target>0xA4000000&&target<0xA4001000)); +//DEBUG > +#ifdef DEBUG_CYCLE_COUNT + emit_readword((int)&last_count,ECX); + emit_add(HOST_CCREG,ECX,HOST_CCREG); + emit_readword((int)&next_interupt,ECX); + emit_writeword(HOST_CCREG,(int)&Count); + emit_sub(HOST_CCREG,ECX,HOST_CCREG); + emit_writeword(ECX,(int)&last_count); +#endif +//DEBUG < + emit_jmp(linker); +} + +static void emit_extjump(int addr, int target) +{ + emit_extjump2(addr, target, (int)dyna_linker); +} +static void emit_extjump_ds(int addr, int target) +{ + emit_extjump2(addr, target, (int)dyna_linker_ds); +} + +static void do_readstub(int n) +{ + assem_debug("do_readstub %x",start+stubs[n][3]*4); + set_jump_target(stubs[n][1],(int)out); + int type=stubs[n][0]; + int i=stubs[n][3]; + int rs=stubs[n][4]; + struct regstat *i_regs=(struct regstat *)stubs[n][5]; + signed char *i_regmap=i_regs->regmap; + int addr=get_reg(i_regmap,AGEN1+(i&1)); + int rth,rt; + int ds; + if(itype[i]==C1LS||itype[i]==LOADLR) { + rth=get_reg(i_regmap,FTEMP|64); + rt=get_reg(i_regmap,FTEMP); + }else{ + rth=get_reg(i_regmap,rt1[i]|64); + rt=get_reg(i_regmap,rt1[i]); + } + assert(rs>=0); + if(addr<0) addr=rt; + if(addr<0&&itype[i]!=C1LS&&itype[i]!=LOADLR) addr=get_reg(i_regmap,-1); + assert(addr>=0); + int ftable=0; + if(type==LOADB_STUB||type==LOADBU_STUB) + ftable=(int)readmemb; + if(type==LOADH_STUB||type==LOADHU_STUB) + ftable=(int)readmemh; + if(type==LOADW_STUB) + ftable=(int)readmem; + if(type==LOADD_STUB) + ftable=(int)readmemd; + emit_writeword(rs,(int)&address); + emit_shrimm(rs,16,addr); + emit_movmem_indexedx4(ftable,addr,addr); + emit_pusha(); + ds=i_regs!=®s[i]; + int real_rs=(itype[i]==LOADLR)?-1:get_reg(i_regmap,rs1[i]); + if(!ds) load_all_consts(regs[i].regmap_entry,regs[i].was32,regs[i].wasdirty&~(1<regmap_entry,i_regs->was32,i_regs->wasdirty&~(1<>rs1[i])&1)<<1)+ds,32); + emit_add(cc,temp,cc); + emit_writeword(cc,(int)&Count); + emit_callreg(addr); + // We really shouldn't need to update the count here, + // but not doing so causes random crashes... + emit_readword((int)&Count,HOST_CCREG); + emit_readword((int)&next_interupt,ECX); + emit_addimm(HOST_CCREG,-CLOCK_DIVIDER*(stubs[n][6]+1),HOST_CCREG); + emit_sub(HOST_CCREG,ECX,HOST_CCREG); + emit_writeword(ECX,(int)&last_count); + emit_storereg(CCREG,HOST_CCREG); + emit_popa(); + if((cc=get_reg(i_regmap,CCREG))>=0) { + emit_loadreg(CCREG,cc); + } + if(rt>=0) { + if(type==LOADB_STUB) + emit_movsbl((int)&readmem_dword,rt); + if(type==LOADBU_STUB) + emit_movzbl((int)&readmem_dword,rt); + if(type==LOADH_STUB) + emit_movswl((int)&readmem_dword,rt); + if(type==LOADHU_STUB) + emit_movzwl((int)&readmem_dword,rt); + if(type==LOADW_STUB) + emit_readword((int)&readmem_dword,rt); + if(type==LOADD_STUB) { + emit_readword((int)&readmem_dword,rt); + if(rth>=0) emit_readword(((int)&readmem_dword)+4,rth); + } + } + emit_jmp(stubs[n][2]); // return address +} + +static void inline_readstub(int type, int i, u_int addr, signed char regmap[], int target, int adj, u_int reglist) +{ + assem_debug("inline_readstub"); + int rs=get_reg(regmap,target); + int rth=get_reg(regmap,target|64); + int rt=get_reg(regmap,target); + if(rs<0) rs=get_reg(regmap,-1); + assert(rs>=0); + int ftable=0; + if(type==LOADB_STUB||type==LOADBU_STUB) + ftable=(int)readmemb; + if(type==LOADH_STUB||type==LOADHU_STUB) + ftable=(int)readmemh; + if(type==LOADW_STUB) + ftable=(int)readmem; + if(type==LOADD_STUB) + ftable=(int)readmemd; + #ifdef HOST_IMM_ADDR32 + emit_writeword_imm(addr,(int)&address); + #else + emit_writeword(rs,(int)&address); + #endif + emit_pusha(); + if((signed int)addr>=(signed int)0xC0000000) { + // Theoretically we can have a pagefault here, if the TLB has never + // been enabled and the address is outside the range 80000000..BFFFFFFF + // Write out the registers so the pagefault can be handled. This is + // a very rare case and likely represents a bug. + int ds=regmap!=regs[i].regmap; + if(!ds) load_all_consts(regs[i].regmap_entry,regs[i].was32,regs[i].wasdirty,i); + if(!ds) wb_dirtys(regs[i].regmap_entry,regs[i].was32,regs[i].wasdirty); + else wb_dirtys(branch_regs[i-1].regmap_entry,branch_regs[i-1].was32,branch_regs[i-1].wasdirty); + } + int cc=get_reg(regmap,CCREG); + int temp; + if(cc<0) { + if(rs==HOST_CCREG) + { + cc=0;temp=1; + assert(cc!=HOST_CCREG); + assert(temp!=HOST_CCREG); + emit_loadreg(CCREG,cc); + } + else + { + cc=HOST_CCREG; + emit_loadreg(CCREG,cc); + temp=!rs; + } + } + else + { + temp=!rs; + } + emit_readword((int)&last_count,temp); + emit_addimm(cc,CLOCK_DIVIDER*(adj+1),cc); + emit_add(cc,temp,cc); + emit_writeword(cc,(int)&Count); + if((signed int)addr>=(signed int)0xC0000000) { + // Pagefault address + int ds=regmap!=regs[i].regmap; + emit_writeword_imm_esp(start+i*4+(((regs[i].was32>>rs1[i])&1)<<1)+ds,32); + } + emit_call(((u_int *)ftable)[addr>>16]); + // We really shouldn't need to update the count here, + // but not doing so causes random crashes... + emit_readword((int)&Count,HOST_CCREG); + emit_readword((int)&next_interupt,ECX); + emit_addimm(HOST_CCREG,-CLOCK_DIVIDER*(adj+1),HOST_CCREG); + emit_sub(HOST_CCREG,ECX,HOST_CCREG); + emit_writeword(ECX,(int)&last_count); + emit_storereg(CCREG,HOST_CCREG); + emit_popa(); + if((cc=get_reg(regmap,CCREG))>=0) { + emit_loadreg(CCREG,cc); + } + if(rt>=0) { + if(type==LOADB_STUB) + emit_movsbl((int)&readmem_dword,rt); + if(type==LOADBU_STUB) + emit_movzbl((int)&readmem_dword,rt); + if(type==LOADH_STUB) + emit_movswl((int)&readmem_dword,rt); + if(type==LOADHU_STUB) + emit_movzwl((int)&readmem_dword,rt); + if(type==LOADW_STUB) + emit_readword((int)&readmem_dword,rt); + if(type==LOADD_STUB) { + emit_readword((int)&readmem_dword,rt); + if(rth>=0) emit_readword(((int)&readmem_dword)+4,rth); + } + } +} + +static void do_writestub(int n) +{ + assem_debug("do_writestub %x",start+stubs[n][3]*4); + set_jump_target(stubs[n][1],(int)out); + int type=stubs[n][0]; + int i=stubs[n][3]; + int rs=stubs[n][4]; + struct regstat *i_regs=(struct regstat *)stubs[n][5]; + signed char *i_regmap=i_regs->regmap; + int addr=get_reg(i_regmap,AGEN1+(i&1)); + int rth,rt,r; + int ds; + if(itype[i]==C1LS) { + rth=get_reg(i_regmap,FTEMP|64); + rt=get_reg(i_regmap,r=FTEMP); + }else{ + rth=get_reg(i_regmap,rs2[i]|64); + rt=get_reg(i_regmap,r=rs2[i]); + } + assert(rs>=0); + assert(rt>=0); + if(addr<0) addr=get_reg(i_regmap,-1); + assert(addr>=0); + int ftable=0; + if(type==STOREB_STUB) + ftable=(int)writememb; + if(type==STOREH_STUB) + ftable=(int)writememh; + if(type==STOREW_STUB) + ftable=(int)writemem; + if(type==STORED_STUB) + ftable=(int)writememd; + emit_writeword(rs,(int)&address); + emit_shrimm(rs,16,addr); + emit_movmem_indexedx4(ftable,addr,addr); + if(type==STOREB_STUB) + emit_writebyte(rt,(int)&cpu_byte); + if(type==STOREH_STUB) + emit_writehword(rt,(int)&hword); + if(type==STOREW_STUB) + emit_writeword(rt,(int)&word); + if(type==STORED_STUB) { + emit_writeword(rt,(int)&dword); + emit_writeword(r?rth:rt,(int)&dword+4); + } + emit_pusha(); + ds=i_regs!=®s[i]; + int real_rs=get_reg(i_regmap,rs1[i]); + if(!ds) load_all_consts(regs[i].regmap_entry,regs[i].was32,regs[i].wasdirty&~(1<regmap_entry,i_regs->was32,i_regs->wasdirty&~(1<>rs1[i])&1)<<1)+ds,32); + emit_add(cc,temp,cc); + emit_writeword(cc,(int)&Count); + emit_callreg(addr); + emit_readword((int)&Count,HOST_CCREG); + emit_readword((int)&next_interupt,ECX); + emit_addimm(HOST_CCREG,-CLOCK_DIVIDER*(stubs[n][6]+1),HOST_CCREG); + emit_sub(HOST_CCREG,ECX,HOST_CCREG); + emit_writeword(ECX,(int)&last_count); + emit_storereg(CCREG,HOST_CCREG); + emit_popa(); + if((cc=get_reg(i_regmap,CCREG))>=0) { + emit_loadreg(CCREG,cc); + } + emit_jmp(stubs[n][2]); // return address +} + +static void inline_writestub(int type, int i, u_int addr, signed char regmap[], int target, int adj, u_int reglist) +{ + assem_debug("inline_writestub"); + int rs=get_reg(regmap,-1); + int rth=get_reg(regmap,target|64); + int rt=get_reg(regmap,target); + assert(rs>=0); + assert(rt>=0); + int ftable=0; + if(type==STOREB_STUB) + ftable=(int)writememb; + if(type==STOREH_STUB) + ftable=(int)writememh; + if(type==STOREW_STUB) + ftable=(int)writemem; + if(type==STORED_STUB) + ftable=(int)writememd; + emit_writeword(rs,(int)&address); + if(type==STOREB_STUB) + emit_writebyte(rt,(int)&cpu_byte); + if(type==STOREH_STUB) + emit_writehword(rt,(int)&hword); + if(type==STOREW_STUB) + emit_writeword(rt,(int)&word); + if(type==STORED_STUB) { + emit_writeword(rt,(int)&dword); + emit_writeword(target?rth:rt,(int)&dword+4); + } + emit_pusha(); + if((signed int)addr>=(signed int)0xC0000000) { + // Theoretically we can have a pagefault here, if the TLB has never + // been enabled and the address is outside the range 80000000..BFFFFFFF + // Write out the registers so the pagefault can be handled. This is + // a very rare case and likely represents a bug. + int ds=regmap!=regs[i].regmap; + if(!ds) load_all_consts(regs[i].regmap_entry,regs[i].was32,regs[i].wasdirty,i); + if(!ds) wb_dirtys(regs[i].regmap_entry,regs[i].was32,regs[i].wasdirty); + else wb_dirtys(branch_regs[i-1].regmap_entry,branch_regs[i-1].was32,branch_regs[i-1].wasdirty); + } + int cc=get_reg(regmap,CCREG); + int temp; + if(cc<0) { + if(rs==HOST_CCREG) + { + cc=0;temp=1; + assert(cc!=HOST_CCREG); + assert(temp!=HOST_CCREG); + emit_loadreg(CCREG,cc); + } + else + { + cc=HOST_CCREG; + emit_loadreg(CCREG,cc); + temp=!rs; + } + } + else + { + temp=!rs; + } + emit_readword((int)&last_count,temp); + emit_addimm(cc,CLOCK_DIVIDER*(adj+1),cc); + emit_add(cc,temp,cc); + emit_writeword(cc,(int)&Count); + if((signed int)addr>=(signed int)0xC0000000) { + // Pagefault address + int ds=regmap!=regs[i].regmap; + emit_writeword_imm_esp(start+i*4+(((regs[i].was32>>rs1[i])&1)<<1)+ds,32); + } + emit_call(((u_int *)ftable)[addr>>16]); + emit_readword((int)&Count,HOST_CCREG); + emit_readword((int)&next_interupt,ECX); + emit_addimm(HOST_CCREG,-CLOCK_DIVIDER*(adj+1),HOST_CCREG); + emit_sub(HOST_CCREG,ECX,HOST_CCREG); + emit_writeword(ECX,(int)&last_count); + emit_storereg(CCREG,HOST_CCREG); + emit_popa(); + if((cc=get_reg(regmap,CCREG))>=0) { + emit_loadreg(CCREG,cc); + } +} + +static void do_unalignedwritestub(int n) +{ + set_jump_target(stubs[n][1],(int)out); + output_byte(0xCC); + emit_jmp(stubs[n][2]); // return address +} + +static void do_invstub(int n) +{ + set_jump_target(stubs[n][1],(int)out); + emit_call(invalidate_block_reg[stubs[n][4]]); + emit_jmp(stubs[n][2]); // return address +} + +static int do_dirty_stub(int i) +{ + assem_debug("do_dirty_stub %x",start+i*4); + emit_pushimm(start+i*4); + emit_movimm((int)start<(int)0xC0000000?(int)source:(int)start,EAX); + emit_movimm((int)copy,EBX); + emit_movimm(slen*4,ECX); + emit_call((int)start<(int)0xC0000000?(int)&verify_code:(int)&verify_code_vm); + emit_addimm(ESP,4,ESP); + int entry=(int)out; + load_regs_entry(i); + if(entry==(int)out) entry=instr_addr[i]; + emit_jmp(instr_addr[i]); + return entry; +} + +static void do_dirty_stub_ds() +{ + emit_pushimm(start+1); + emit_movimm((int)start<(int)0xC0000000?(int)source:(int)start,EAX); + emit_movimm((int)copy,EBX); + emit_movimm(slen*4,ECX); + emit_call((int)&verify_code_ds); + emit_addimm(ESP,4,ESP); +} + +static void do_cop1stub(int n) +{ + assem_debug("do_cop1stub %x",start+stubs[n][3]*4); + set_jump_target(stubs[n][1],(int)out); + int i=stubs[n][3]; + struct regstat *i_regs=(struct regstat *)stubs[n][5]; + int ds=stubs[n][6]; + if(!ds) { + load_all_consts(regs[i].regmap_entry,regs[i].was32,regs[i].wasdirty,i); + //if(i_regs!=®s[i]) DebugMessage(M64MSG_VERBOSE, "oops: regs[i]=%x i_regs=%x",(int)®s[i],(int)i_regs); + } + //else {DebugMessage(M64MSG_VERBOSE, "fp exception in delay slot");} + wb_dirtys(i_regs->regmap_entry,i_regs->was32,i_regs->wasdirty); + if(regs[i].regmap_entry[HOST_CCREG]!=CCREG) emit_loadreg(CCREG,HOST_CCREG); + emit_movimm(start+(i-ds)*4,EAX); // Get PC + emit_addimm(HOST_CCREG,CLOCK_DIVIDER*ccadj[i],HOST_CCREG); // CHECK: is this right? There should probably be an extra cycle... + emit_jmp(ds?(int)fp_exception_ds:(int)fp_exception); +} + +/* TLB */ + +static int do_tlb_r(int s,int ar,int map,int cache,int x,int a,int shift,int c,u_int addr) +{ + if(c) { + if((signed int)addr>=(signed int)0xC0000000) { + emit_readword((int)(memory_map+(addr>>12)),map); + } + else + return -1; // No mapping + } + else { + if(s!=map) emit_mov(s,map); + emit_shrimm(map,12,map); + // Schedule this while we wait on the load + //if(x) emit_xorimm(addr,x,addr); + if(shift>=0) emit_lea8(s,shift); + if(~a) emit_andimm(s,a,ar); + emit_movmem_indexedx4((int)memory_map,map,map); + } + return map; +} +static int do_tlb_r_branch(int map, int c, u_int addr, int *jaddr) +{ + if(!c||(signed int)addr>=(signed int)0xC0000000) { + emit_test(map,map); + *jaddr=(int)out; + emit_js(0); + } + return map; +} + +static void gen_tlb_addr_r(int ar, int map) { + if(map>=0) { + emit_leairrx4(0,ar,map,ar); + } +} + +static int do_tlb_w(int s,int ar,int map,int cache,int x,int c,u_int addr) +{ + if(c) { + if(addr<0x80800000||addr>=0xC0000000) { + emit_readword((int)(memory_map+(addr>>12)),map); + } + else + return -1; // No mapping + } + else { + if(s!=map) emit_mov(s,map); + //if(s!=ar) emit_mov(s,ar); + emit_shrimm(map,12,map); + // Schedule this while we wait on the load + //if(x) emit_xorimm(s,x,addr); + emit_movmem_indexedx4((int)memory_map,map,map); + } + emit_shlimm(map,2,map); + return map; +} +static void do_tlb_w_branch(int map, int c, u_int addr, int *jaddr) +{ + if(!c||addr<0x80800000||addr>=0xC0000000) { + *jaddr=(int)out; + emit_jc(0); + } +} + +static void gen_tlb_addr_w(int ar, int map) { + if(map>=0) { + emit_leairrx1(0,ar,map,ar); + } +} + +// We don't need this for x86 +static void generate_map_const(u_int addr,int reg) { + // void *mapaddr=memory_map+(addr>>12); +} + +/* Special assem */ + +static void shift_assemble_x86(int i,struct regstat *i_regs) +{ + if(rt1[i]) { + if(opcode2[i]<=0x07) // SLLV/SRLV/SRAV + { + char s,t,shift; + t=get_reg(i_regs->regmap,rt1[i]); + s=get_reg(i_regs->regmap,rs1[i]); + shift=get_reg(i_regs->regmap,rs2[i]); + if(t>=0){ + if(rs1[i]==0) + { + emit_zeroreg(t); + } + else if(rs2[i]==0) + { + assert(s>=0); + if(s!=t) emit_mov(s,t); + } + else + { + char temp=get_reg(i_regs->regmap,-1); + assert(s>=0); + if(t==ECX&&s!=ECX) { + if(shift!=ECX) emit_mov(shift,ECX); + if(rt1[i]==rs2[i]) {shift=temp;} + if(s!=shift) emit_mov(s,shift); + } + else + { + if(rt1[i]==rs2[i]) {emit_mov(shift,temp);shift=temp;} + if(s!=t) emit_mov(s,t); + if(shift!=ECX) { + if(i_regs->regmap[ECX]<0) + emit_mov(shift,ECX); + else + emit_xchg(shift,ECX); + } + } + if(opcode2[i]==4) // SLLV + { + emit_shlcl(t==ECX?shift:t); + } + if(opcode2[i]==6) // SRLV + { + emit_shrcl(t==ECX?shift:t); + } + if(opcode2[i]==7) // SRAV + { + emit_sarcl(t==ECX?shift:t); + } + if(shift!=ECX&&i_regs->regmap[ECX]>=0) emit_xchg(shift,ECX); + } + } + } else { // DSLLV/DSRLV/DSRAV + char sh,sl,th,tl,shift; + th=get_reg(i_regs->regmap,rt1[i]|64); + tl=get_reg(i_regs->regmap,rt1[i]); + sh=get_reg(i_regs->regmap,rs1[i]|64); + sl=get_reg(i_regs->regmap,rs1[i]); + shift=get_reg(i_regs->regmap,rs2[i]); + if(tl>=0){ + if(rs1[i]==0) + { + emit_zeroreg(tl); + if(th>=0) emit_zeroreg(th); + } + else if(rs2[i]==0) + { + assert(sl>=0); + if(sl!=tl) emit_mov(sl,tl); + if(th>=0&&sh!=th) emit_mov(sh,th); + } + else + { + // FIXME: What if shift==tl ? + assert(shift!=tl); + int temp=get_reg(i_regs->regmap,-1); + int real_th=th; + if(th<0&&opcode2[i]!=0x14) {th=temp;} // DSLLV doesn't need a temporary register + assert(sl>=0); + assert(sh>=0); + if(tl==ECX&&sl!=ECX) { + if(shift!=ECX) emit_mov(shift,ECX); + if(sl!=shift) emit_mov(sl,shift); + if(th>=0 && sh!=th) emit_mov(sh,th); + } + else if(th==ECX&&sh!=ECX) { + if(shift!=ECX) emit_mov(shift,ECX); + if(sh!=shift) emit_mov(sh,shift); + if(sl!=tl) emit_mov(sl,tl); + } + else + { + if(sl!=tl) emit_mov(sl,tl); + if(th>=0 && sh!=th) emit_mov(sh,th); + if(shift!=ECX) { + if(i_regs->regmap[ECX]<0) + emit_mov(shift,ECX); + else + emit_xchg(shift,ECX); + } + } + if(opcode2[i]==0x14) // DSLLV + { + if(th>=0) emit_shldcl(th==ECX?shift:th,tl==ECX?shift:tl); + emit_shlcl(tl==ECX?shift:tl); + emit_testimm(ECX,32); + if(th>=0) emit_cmovne_reg(tl==ECX?shift:tl,th==ECX?shift:th); + emit_cmovne(&const_zero,tl==ECX?shift:tl); + } + if(opcode2[i]==0x16) // DSRLV + { + assert(th>=0); + emit_shrdcl(tl==ECX?shift:tl,th==ECX?shift:th); + emit_shrcl(th==ECX?shift:th); + emit_testimm(ECX,32); + emit_cmovne_reg(th==ECX?shift:th,tl==ECX?shift:tl); + if(real_th>=0) emit_cmovne(&const_zero,th==ECX?shift:th); + } + if(opcode2[i]==0x17) // DSRAV + { + assert(th>=0); + emit_shrdcl(tl==ECX?shift:tl,th==ECX?shift:th); + if(real_th>=0) { + assert(temp>=0); + emit_mov(th==ECX?shift:th,temp==ECX?shift:temp); + } + emit_sarcl(th==ECX?shift:th); + if(real_th>=0) emit_sarimm(temp==ECX?shift:temp,31,temp==ECX?shift:temp); + emit_testimm(ECX,32); + emit_cmovne_reg(th==ECX?shift:th,tl==ECX?shift:tl); + if(real_th>=0) emit_cmovne_reg(temp==ECX?shift:temp,th==ECX?shift:th); + } + if(shift!=ECX&&(i_regs->regmap[ECX]>=0||temp==ECX)) emit_xchg(shift,ECX); + } + } + } + } +} +#define shift_assemble shift_assemble_x86 + +static void loadlr_assemble_x86(int i,struct regstat *i_regs) +{ + int s,th,tl,temp,temp2,addr,map=-1; + int offset; + int jaddr=0; + int memtarget,c=0; + u_int hr,reglist=0; + th=get_reg(i_regs->regmap,rt1[i]|64); + tl=get_reg(i_regs->regmap,rt1[i]); + s=get_reg(i_regs->regmap,rs1[i]); + temp=get_reg(i_regs->regmap,-1); + temp2=get_reg(i_regs->regmap,FTEMP); + addr=get_reg(i_regs->regmap,AGEN1+(i&1)); + assert(addr<0); + offset=imm[i]; + for(hr=0;hrregmap[hr]>=0) reglist|=1<=0) { + c=(i_regs->wasconst>>s)&1; + memtarget=((signed int)(constmap[i][s]+offset))<(signed int)0x80800000; + if(using_tlb&&((signed int)(constmap[i][s]+offset))>=(signed int)0xC0000000) memtarget=1; + } + if(!using_tlb) { + if(!c) { + emit_lea8(addr,temp); + if (opcode[i]==0x22||opcode[i]==0x26) { + emit_andimm(addr,0xFFFFFFFC,temp2); // LWL/LWR + }else{ + emit_andimm(addr,0xFFFFFFF8,temp2); // LDL/LDR + } + emit_cmpimm(addr,0x800000); + jaddr=(int)out; + emit_jno(0); + } + else { + if (opcode[i]==0x22||opcode[i]==0x26) { + emit_movimm(((constmap[i][s]+offset)<<3)&24,temp); // LWL/LWR + }else{ + emit_movimm(((constmap[i][s]+offset)<<3)&56,temp); // LDL/LDR + } + } + }else{ // using tlb + int a; + if(c) { + a=-1; + }else if (opcode[i]==0x22||opcode[i]==0x26) { + a=0xFFFFFFFC; // LWL/LWR + }else{ + a=0xFFFFFFF8; // LDL/LDR + } + map=get_reg(i_regs->regmap,TLREG); + assert(map>=0); + reglist&=~(1<regmap,FTEMP,ccadj[i],reglist); + if(rt1[i]) { + assert(tl>=0); + emit_andimm(temp,24,temp); + if (opcode[i]==0x26) emit_xorimm(temp,24,temp); // LWR + if(temp==ECX) + { + int temp3=EDX; + if(temp3==temp2) temp3++; + emit_pushreg(temp3); + emit_movimm(-1,temp3); + if (opcode[i]==0x26) { + emit_shrcl(temp3); + emit_shrcl(temp2); + }else{ + emit_shlcl(temp3); + emit_shlcl(temp2); + } + emit_mov(temp3,ECX); + emit_not(ECX,ECX); + emit_popreg(temp3); + } + else + { + int temp3=EBP; + if(temp3==temp) temp3++; + if(temp3==temp2) temp3++; + if(temp3==temp) temp3++; + emit_xchg(ECX,temp); + emit_pushreg(temp3); + emit_movimm(-1,temp3); + if (opcode[i]==0x26) { + emit_shrcl(temp3); + emit_shrcl(temp2==ECX?temp:temp2); + }else{ + emit_shlcl(temp3); + emit_shlcl(temp2==ECX?temp:temp2); + } + emit_not(temp3,temp3); + emit_mov(temp,ECX); + emit_mov(temp3,temp); + emit_popreg(temp3); + } + emit_and(temp,tl,tl); + emit_or(temp2,tl,tl); + //emit_storereg(rt1[i],tl); // DEBUG + /*emit_pusha(); + //save_regs(0x100f); + emit_readword((int)&last_count,ECX); + if(get_reg(i_regs->regmap,CCREG)<0) + emit_loadreg(CCREG,HOST_CCREG); + emit_add(HOST_CCREG,ECX,HOST_CCREG); + emit_addimm(HOST_CCREG,2*ccadj[i],HOST_CCREG); + emit_writeword(HOST_CCREG,(int)&Count); + emit_call((int)memdebug); + emit_popa(); + //restore_regs(0x100f);*/ + } + } + if (opcode[i]==0x1A||opcode[i]==0x1B) { // LDL/LDR + if(s>=0) + if((i_regs->wasdirty>>s)&1) + emit_storereg(rs1[i],s); + if(get_reg(i_regs->regmap,rs1[i]|64)>=0) + if((i_regs->wasdirty>>get_reg(i_regs->regmap,rs1[i]|64))&1) + emit_storereg(rs1[i]|64,get_reg(i_regs->regmap,rs1[i]|64)); + int temp2h=get_reg(i_regs->regmap,FTEMP|64); + if(!c||memtarget) { + //if(th>=0) emit_readword_indexed((int)rdram-0x80000000,temp2,temp2h); + //emit_readword_indexed((int)rdram-0x7FFFFFFC,temp2,temp2); + emit_readdword_indexed_tlb(0,temp2,map,temp2h,temp2); + if(jaddr) add_stub(LOADD_STUB,jaddr,(int)out,i,temp2,(int)i_regs,ccadj[i],reglist); + } + else + inline_readstub(LOADD_STUB,i,(constmap[i][s]+offset)&0xFFFFFFF8,i_regs->regmap,FTEMP,ccadj[i],reglist); + if(rt1[i]) { + assert(th>=0); + assert(tl>=0); + emit_andimm(temp,56,temp); + emit_pushreg(temp); + emit_pushreg(temp2h); + emit_pushreg(temp2); + emit_pushreg(th); + emit_pushreg(tl); + if(opcode[i]==0x1A) emit_call((int)ldl_merge); + if(opcode[i]==0x1B) emit_call((int)ldr_merge); + emit_addimm(ESP,20,ESP); + if(tl!=EDX) { + if(tl!=EAX) emit_mov(EAX,tl); + if(th!=EDX) emit_mov(EDX,th); + } else + if(th!=EAX) { + if(th!=EDX) emit_mov(EDX,th); + if(tl!=EAX) emit_mov(EAX,tl); + } else { + emit_xchg(EAX,EDX); + } + if(s>=0) emit_loadreg(rs1[i],s); + if(get_reg(i_regs->regmap,rs1[i]|64)>=0) + emit_loadreg(rs1[i]|64,get_reg(i_regs->regmap,rs1[i]|64)); + } + } +} +#define loadlr_assemble loadlr_assemble_x86 + +static void cop0_assemble(int i,struct regstat *i_regs) +{ + if(opcode2[i]==0) // MFC0 + { + if(rt1[i]) { + signed char t=get_reg(i_regs->regmap,rt1[i]); + char copr=(source[i]>>11)&0x1f; + if(t>=0) { + emit_writeword_imm((int)&fake_pc,(int)&PC); + emit_writebyte_imm((source[i]>>11)&0x1f,(int)&(fake_pc.f.r.nrd)); + if(copr==9) { + emit_readword((int)&last_count,ECX); + emit_loadreg(CCREG,HOST_CCREG); // TODO: do proper reg alloc + emit_add(HOST_CCREG,ECX,HOST_CCREG); + emit_addimm(HOST_CCREG,CLOCK_DIVIDER*ccadj[i],HOST_CCREG); + emit_writeword(HOST_CCREG,(int)&Count); + } + emit_call((int)cached_interpreter_table.MFC0); + emit_readword((int)&readmem_dword,t); + } + } + } + else if(opcode2[i]==4) // MTC0 + { + signed char s=get_reg(i_regs->regmap,rs1[i]); + char copr=(source[i]>>11)&0x1f; + assert(s>=0); + emit_writeword(s,(int)&readmem_dword); + emit_pusha(); + emit_writeword_imm((int)&fake_pc,(int)&PC); + emit_writebyte_imm((source[i]>>11)&0x1f,(int)&(fake_pc.f.r.nrd)); + if(copr==9||copr==11||copr==12) { + if(copr==12&&!is_delayslot) { + wb_register(rs1[i],i_regs->regmap,i_regs->dirty,i_regs->is32); + } + emit_readword((int)&last_count,ECX); + emit_loadreg(CCREG,HOST_CCREG); // TODO: do proper reg alloc + emit_add(HOST_CCREG,ECX,HOST_CCREG); + emit_addimm(HOST_CCREG,CLOCK_DIVIDER*ccadj[i],HOST_CCREG); + emit_writeword(HOST_CCREG,(int)&Count); + } + // What a mess. The status register (12) can enable interrupts, + // so needs a special case to handle a pending interrupt. + // The interrupt must be taken immediately, because a subsequent + // instruction might disable interrupts again. + if(copr==12&&!is_delayslot) { + emit_writeword_imm(start+i*4+4,(int)&pcaddr); + emit_writebyte_imm(0,(int)&pending_exception); + } + //else if(copr==12&&is_delayslot) emit_call((int)MTC0_R12); + //else + emit_call((int)cached_interpreter_table.MTC0); + if(copr==9||copr==11||copr==12) { + emit_readword((int)&Count,HOST_CCREG); + emit_readword((int)&next_interupt,ECX); + emit_addimm(HOST_CCREG,-CLOCK_DIVIDER*ccadj[i],HOST_CCREG); + emit_sub(HOST_CCREG,ECX,HOST_CCREG); + emit_writeword(ECX,(int)&last_count); + emit_storereg(CCREG,HOST_CCREG); + } + emit_popa(); + if(copr==12) { + assert(!is_delayslot); + //if(is_delayslot) output_byte(0xcc); + emit_cmpmem_imm_byte((int)&pending_exception,0); + emit_jne((int)&do_interrupt); + } + cop1_usable=0; + } + else + { + assert(opcode2[i]==0x10); + if((source[i]&0x3f)==0x01) // TLBR + emit_call((int)cached_interpreter_table.TLBR); + if((source[i]&0x3f)==0x02) // TLBWI + emit_call((int)TLBWI_new); + if((source[i]&0x3f)==0x06) { // TLBWR + // The TLB entry written by TLBWR is dependent on the count, + // so update the cycle count + emit_readword((int)&last_count,ECX); + if(i_regs->regmap[HOST_CCREG]!=CCREG) emit_loadreg(CCREG,HOST_CCREG); + emit_add(HOST_CCREG,ECX,HOST_CCREG); + emit_addimm(HOST_CCREG,CLOCK_DIVIDER*ccadj[i],HOST_CCREG); + emit_writeword(HOST_CCREG,(int)&Count); + emit_call((int)TLBWR_new); + } + if((source[i]&0x3f)==0x08) // TLBP + emit_call((int)cached_interpreter_table.TLBP); + if((source[i]&0x3f)==0x18) // ERET + { + int count=ccadj[i]; + if(i_regs->regmap[HOST_CCREG]!=CCREG) emit_loadreg(CCREG,HOST_CCREG); + emit_addimm_and_set_flags(CLOCK_DIVIDER*count,HOST_CCREG); // TODO: Should there be an extra cycle here? + emit_jmp((int)jump_eret); + } + } +} + +static void cop1_assemble(int i,struct regstat *i_regs) +{ + // Check cop1 unusable + if(!cop1_usable) { + signed char rs=get_reg(i_regs->regmap,CSREG); + assert(rs>=0); + emit_testimm(rs,0x20000000); + int jaddr=(int)out; + emit_jeq(0); + add_stub(FP_STUB,jaddr,(int)out,i,rs,(int)i_regs,is_delayslot,0); + cop1_usable=1; + } + if (opcode2[i]==0) { // MFC1 + signed char tl=get_reg(i_regs->regmap,rt1[i]); + if(tl>=0) { + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],tl); + emit_readword_indexed(0,tl,tl); + } + } + else if (opcode2[i]==1) { // DMFC1 + signed char tl=get_reg(i_regs->regmap,rt1[i]); + signed char th=get_reg(i_regs->regmap,rt1[i]|64); + if(tl>=0) { + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],tl); + if(th>=0) emit_readword_indexed(4,tl,th); + emit_readword_indexed(0,tl,tl); + } + } + else if (opcode2[i]==4) { // MTC1 + signed char sl=get_reg(i_regs->regmap,rs1[i]); + signed char temp=get_reg(i_regs->regmap,-1); + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],temp); + emit_writeword_indexed(sl,0,temp); + } + else if (opcode2[i]==5) { // DMTC1 + signed char sl=get_reg(i_regs->regmap,rs1[i]); + signed char sh=rs1[i]>0?get_reg(i_regs->regmap,rs1[i]|64):sl; + signed char temp=get_reg(i_regs->regmap,-1); + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],temp); + emit_writeword_indexed(sh,4,temp); + emit_writeword_indexed(sl,0,temp); + } + else if (opcode2[i]==2) // CFC1 + { + signed char tl=get_reg(i_regs->regmap,rt1[i]); + if(tl>=0) { + u_int copr=(source[i]>>11)&0x1f; + if(copr==0) emit_readword((int)&FCR0,tl); + if(copr==31) emit_readword((int)&FCR31,tl); + } + } + else if (opcode2[i]==6) // CTC1 + { + signed char sl=get_reg(i_regs->regmap,rs1[i]); + u_int copr=(source[i]>>11)&0x1f; + assert(sl>=0); + if(copr==31) + { + emit_writeword(sl,(int)&FCR31); + // Set the rounding mode + char temp=get_reg(i_regs->regmap,-1); + emit_movimm(3,temp); + emit_and(sl,temp,temp); + emit_fldcw_indexed((int)&rounding_modes,temp); + } + } +} + +static void fconv_assemble_x86(int i,struct regstat *i_regs) +{ + signed char temp=get_reg(i_regs->regmap,-1); + assert(temp>=0); + // Check cop1 unusable + if(!cop1_usable) { + signed char rs=get_reg(i_regs->regmap,CSREG); + assert(rs>=0); + emit_testimm(rs,0x20000000); + int jaddr=(int)out; + emit_jeq(0); + add_stub(FP_STUB,jaddr,(int)out,i,rs,(int)i_regs,is_delayslot,0); + cop1_usable=1; + } +#ifdef __SSE__ + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x0d) { // trunc_w_s + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],temp); + emit_movss_load(temp,0); + emit_cvttps2dq(0,0); // float->int, truncate + if(((source[i]>>11)&0x1f)!=((source[i]>>6)&0x1f)) + emit_readword((int)®_cop1_simple[(source[i]>>6)&0x1f],temp); + emit_movd_store(0,temp); + return; + } + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x0d) { // trunc_w_d + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],temp); + emit_movsd_load(temp,0); + emit_cvttpd2dq(0,0); // double->int, truncate + emit_readword((int)®_cop1_simple[(source[i]>>6)&0x1f],temp); + emit_movd_store(0,temp); + return; + } +#endif + + if(opcode2[i]==0x14&&(source[i]&0x3f)==0x20) { // cvt_s_w + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],temp); + emit_fildl(temp); + if(((source[i]>>11)&0x1f)!=((source[i]>>6)&0x1f)) + emit_readword((int)®_cop1_simple[(source[i]>>6)&0x1f],temp); + emit_fstps(temp); + return; + } + if(opcode2[i]==0x14&&(source[i]&0x3f)==0x21) { // cvt_d_w + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],temp); + emit_fildl(temp); + emit_readword((int)®_cop1_double[(source[i]>>6)&0x1f],temp); + emit_fstpl(temp); + return; + } + if(opcode2[i]==0x15&&(source[i]&0x3f)==0x20) { // cvt_s_l + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],temp); + emit_fildll(temp); + emit_readword((int)®_cop1_simple[(source[i]>>6)&0x1f],temp); + emit_fstps(temp); + return; + } + if(opcode2[i]==0x15&&(source[i]&0x3f)==0x21) { // cvt_d_l + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],temp); + emit_fildll(temp); + if(((source[i]>>11)&0x1f)!=((source[i]>>6)&0x1f)) + emit_readword((int)®_cop1_double[(source[i]>>6)&0x1f],temp); + emit_fstpl(temp); + return; + } + + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x21) { // cvt_d_s + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],temp); + emit_flds(temp); + emit_readword((int)®_cop1_double[(source[i]>>6)&0x1f],temp); + emit_fstpl(temp); + return; + } + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x20) { // cvt_s_d + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],temp); + emit_fldl(temp); + emit_readword((int)®_cop1_simple[(source[i]>>6)&0x1f],temp); + emit_fstps(temp); + return; + } + + if(opcode2[i]==0x10) { // cvt_*_s + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],temp); + emit_flds(temp); + } + if(opcode2[i]==0x11) { // cvt_*_d + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],temp); + emit_fldl(temp); + } + if((source[i]&0x3f)<0x10) { + emit_fnstcw_stack(); + if((source[i]&3)==0) emit_fldcw((int)&round_mode); //DebugMessage(M64MSG_VERBOSE, "round"); + if((source[i]&3)==1) emit_fldcw((int)&trunc_mode); //DebugMessage(M64MSG_VERBOSE, "trunc"); + if((source[i]&3)==2) emit_fldcw((int)&ceil_mode); //DebugMessage(M64MSG_VERBOSE, "ceil"); + if((source[i]&3)==3) emit_fldcw((int)&floor_mode); //DebugMessage(M64MSG_VERBOSE, "floor"); + } + if((source[i]&0x3f)==0x24||(source[i]&0x3c)==0x0c) { // cvt_w_* + if(opcode2[i]!=0x10||((source[i]>>11)&0x1f)!=((source[i]>>6)&0x1f)) + emit_readword((int)®_cop1_simple[(source[i]>>6)&0x1f],temp); + emit_fistpl(temp); + } + if((source[i]&0x3f)==0x25||(source[i]&0x3c)==0x08) { // cvt_l_* + if(opcode2[i]!=0x11||((source[i]>>11)&0x1f)!=((source[i]>>6)&0x1f)) + emit_readword((int)®_cop1_double[(source[i]>>6)&0x1f],temp); + emit_fistpll(temp); + } + if((source[i]&0x3f)<0x10) { + emit_fldcw_stack(); + } + return; + + // C emulation code for debugging + + emit_pusha(); + + if(opcode2[i]==0x14&&(source[i]&0x3f)==0x20) { + emit_pushmem((int)®_cop1_simple[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_simple[(source[i]>>11)&0x1f]); + emit_call((int)cvt_s_w); + } + if(opcode2[i]==0x14&&(source[i]&0x3f)==0x21) { + emit_pushmem((int)®_cop1_double[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_simple[(source[i]>>11)&0x1f]); + emit_call((int)cvt_d_w); + } + if(opcode2[i]==0x15&&(source[i]&0x3f)==0x20) { + emit_pushmem((int)®_cop1_simple[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_double[(source[i]>>11)&0x1f]); + emit_call((int)cvt_s_l); + } + if(opcode2[i]==0x15&&(source[i]&0x3f)==0x21) { + emit_pushmem((int)®_cop1_double[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_double[(source[i]>>11)&0x1f]); + emit_call((int)cvt_d_l); + } + + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x21) { + emit_pushmem((int)®_cop1_double[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_simple[(source[i]>>11)&0x1f]); + emit_call((int)cvt_d_s); + } + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x24) { + emit_pushmem((int)®_cop1_simple[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_simple[(source[i]>>11)&0x1f]); + emit_call((int)cvt_w_s); + } + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x25) { + emit_pushmem((int)®_cop1_double[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_simple[(source[i]>>11)&0x1f]); + emit_call((int)cvt_l_s); + } + + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x20) { + emit_pushmem((int)®_cop1_simple[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_double[(source[i]>>11)&0x1f]); + emit_call((int)cvt_s_d); + } + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x24) { + emit_pushmem((int)®_cop1_simple[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_double[(source[i]>>11)&0x1f]); + emit_call((int)cvt_w_d); + } + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x25) { + emit_pushmem((int)®_cop1_double[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_double[(source[i]>>11)&0x1f]); + emit_call((int)cvt_l_d); + } + + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x08) { + emit_pushmem((int)®_cop1_double[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_simple[(source[i]>>11)&0x1f]); + emit_call((int)round_l_s); + } + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x09) { + emit_pushmem((int)®_cop1_double[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_simple[(source[i]>>11)&0x1f]); + emit_call((int)trunc_l_s); + } + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x0a) { + emit_pushmem((int)®_cop1_double[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_simple[(source[i]>>11)&0x1f]); + emit_call((int)ceil_l_s); + } + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x0b) { + emit_pushmem((int)®_cop1_double[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_simple[(source[i]>>11)&0x1f]); + emit_call((int)floor_l_s); + } + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x0c) { + emit_pushmem((int)®_cop1_simple[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_simple[(source[i]>>11)&0x1f]); + emit_call((int)round_w_s); + } + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x0d) { + emit_pushmem((int)®_cop1_simple[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_simple[(source[i]>>11)&0x1f]); + emit_call((int)trunc_w_s); + } + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x0e) { + emit_pushmem((int)®_cop1_simple[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_simple[(source[i]>>11)&0x1f]); + emit_call((int)ceil_w_s); + } + if(opcode2[i]==0x10&&(source[i]&0x3f)==0x0f) { + emit_pushmem((int)®_cop1_simple[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_simple[(source[i]>>11)&0x1f]); + emit_call((int)floor_w_s); + } + + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x08) { + emit_pushmem((int)®_cop1_double[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_double[(source[i]>>11)&0x1f]); + emit_call((int)round_l_d); + } + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x09) { + emit_pushmem((int)®_cop1_double[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_double[(source[i]>>11)&0x1f]); + emit_call((int)trunc_l_d); + } + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x0a) { + emit_pushmem((int)®_cop1_double[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_double[(source[i]>>11)&0x1f]); + emit_call((int)ceil_l_d); + } + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x0b) { + emit_pushmem((int)®_cop1_double[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_double[(source[i]>>11)&0x1f]); + emit_call((int)floor_l_d); + } + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x0c) { + emit_pushmem((int)®_cop1_simple[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_double[(source[i]>>11)&0x1f]); + emit_call((int)round_w_d); + } + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x0d) { + emit_pushmem((int)®_cop1_simple[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_double[(source[i]>>11)&0x1f]); + emit_call((int)trunc_w_d); + } + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x0e) { + emit_pushmem((int)®_cop1_simple[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_double[(source[i]>>11)&0x1f]); + emit_call((int)ceil_w_d); + } + if(opcode2[i]==0x11&&(source[i]&0x3f)==0x0f) { + emit_pushmem((int)®_cop1_simple[(source[i]>> 6)&0x1f]); + emit_pushmem((int)®_cop1_double[(source[i]>>11)&0x1f]); + emit_call((int)floor_w_d); + } + + emit_addimm(ESP,8,ESP); + emit_popa(); + //emit_loadreg(CSREG,rs); + return; +} +#define fconv_assemble fconv_assemble_x86 + +static void fcomp_assemble(int i,struct regstat *i_regs) +{ + signed char fs=get_reg(i_regs->regmap,FSREG); + signed char temp=get_reg(i_regs->regmap,-1); + assert(temp>=0); + // Check cop1 unusable + if(!cop1_usable) { + signed char cs=get_reg(i_regs->regmap,CSREG); + assert(cs>=0); + emit_testimm(cs,0x20000000); + int jaddr=(int)out; + emit_jeq(0); + add_stub(FP_STUB,jaddr,(int)out,i,cs,(int)i_regs,is_delayslot,0); + cop1_usable=1; + } + + if((source[i]&0x3f)==0x30) { + emit_andimm(fs,~0x800000,fs); + return; + } + + if((source[i]&0x3e)==0x38) { + // sf/ngle - these should throw exceptions for NaNs + emit_andimm(fs,~0x800000,fs); + return; + } + + if(opcode2[i]==0x10) { + emit_readword((int)®_cop1_simple[(source[i]>>16)&0x1f],temp); + emit_flds(temp); + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],temp); + emit_flds(temp); + emit_movimm(0x800000,temp); + emit_or(fs,temp,fs); + emit_xor(temp,fs,temp); + emit_fucomip(1); + emit_fpop(); + if((source[i]&0x3f)==0x31) emit_cmovnp_reg(temp,fs); // c_un_s + if((source[i]&0x3f)==0x32) {emit_cmovne_reg(temp,fs);emit_cmovp_reg(temp,fs);} // c_eq_s + if((source[i]&0x3f)==0x33) emit_cmovne_reg(temp,fs); // c_ueq_s + if((source[i]&0x3f)==0x34) {emit_cmovnc_reg(temp,fs);emit_cmovp_reg(temp,fs);} // c_olt_s + if((source[i]&0x3f)==0x35) emit_cmovnc_reg(temp,fs); // c_ult_s + if((source[i]&0x3f)==0x36) {emit_cmova_reg(temp,fs);emit_cmovp_reg(temp,fs);} // c_ole_s + if((source[i]&0x3f)==0x37) emit_cmova_reg(temp,fs); // c_ule_s + if((source[i]&0x3f)==0x3a) emit_cmovne_reg(temp,fs); // c_seq_s + if((source[i]&0x3f)==0x3b) emit_cmovne_reg(temp,fs); // c_ngl_s + if((source[i]&0x3f)==0x3c) emit_cmovnc_reg(temp,fs); // c_lt_s + if((source[i]&0x3f)==0x3d) emit_cmovnc_reg(temp,fs); // c_nge_s + if((source[i]&0x3f)==0x3e) emit_cmova_reg(temp,fs); // c_le_s + if((source[i]&0x3f)==0x3f) emit_cmova_reg(temp,fs); // c_ngt_s + return; + } + if(opcode2[i]==0x11) { + emit_readword((int)®_cop1_double[(source[i]>>16)&0x1f],temp); + emit_fldl(temp); + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],temp); + emit_fldl(temp); + emit_movimm(0x800000,temp); + emit_or(fs,temp,fs); + emit_xor(temp,fs,temp); + emit_fucomip(1); + emit_fpop(); + if((source[i]&0x3f)==0x31) emit_cmovnp_reg(temp,fs); // c_un_d + if((source[i]&0x3f)==0x32) {emit_cmovne_reg(temp,fs);emit_cmovp_reg(temp,fs);} // c_eq_d + if((source[i]&0x3f)==0x33) emit_cmovne_reg(temp,fs); // c_ueq_d + if((source[i]&0x3f)==0x34) {emit_cmovnc_reg(temp,fs);emit_cmovp_reg(temp,fs);} // c_olt_d + if((source[i]&0x3f)==0x35) emit_cmovnc_reg(temp,fs); // c_ult_d + if((source[i]&0x3f)==0x36) {emit_cmova_reg(temp,fs);emit_cmovp_reg(temp,fs);} // c_ole_d + if((source[i]&0x3f)==0x37) emit_cmova_reg(temp,fs); // c_ule_d + if((source[i]&0x3f)==0x3a) emit_cmovne_reg(temp,fs); // c_seq_d + if((source[i]&0x3f)==0x3b) emit_cmovne_reg(temp,fs); // c_ngl_d + if((source[i]&0x3f)==0x3c) emit_cmovnc_reg(temp,fs); // c_lt_d + if((source[i]&0x3f)==0x3d) emit_cmovnc_reg(temp,fs); // c_nge_d + if((source[i]&0x3f)==0x3e) emit_cmova_reg(temp,fs); // c_le_d + if((source[i]&0x3f)==0x3f) emit_cmova_reg(temp,fs); // c_ngt_d + return; + } + + emit_pusha(); + if(opcode2[i]==0x10) { + emit_pushmem((int)®_cop1_simple[(source[i]>>16)&0x1f]); + emit_pushmem((int)®_cop1_simple[(source[i]>>11)&0x1f]); + if((source[i]&0x3f)==0x30) emit_call((int)c_f_s); + if((source[i]&0x3f)==0x31) emit_call((int)c_un_s); + if((source[i]&0x3f)==0x32) emit_call((int)c_eq_s); + if((source[i]&0x3f)==0x33) emit_call((int)c_ueq_s); + if((source[i]&0x3f)==0x34) emit_call((int)c_olt_s); + if((source[i]&0x3f)==0x35) emit_call((int)c_ult_s); + if((source[i]&0x3f)==0x36) emit_call((int)c_ole_s); + if((source[i]&0x3f)==0x37) emit_call((int)c_ule_s); + if((source[i]&0x3f)==0x38) emit_call((int)c_sf_s); + if((source[i]&0x3f)==0x39) emit_call((int)c_ngle_s); + if((source[i]&0x3f)==0x3a) emit_call((int)c_seq_s); + if((source[i]&0x3f)==0x3b) emit_call((int)c_ngl_s); + if((source[i]&0x3f)==0x3c) emit_call((int)c_lt_s); + if((source[i]&0x3f)==0x3d) emit_call((int)c_nge_s); + if((source[i]&0x3f)==0x3e) emit_call((int)c_le_s); + if((source[i]&0x3f)==0x3f) emit_call((int)c_ngt_s); + } + if(opcode2[i]==0x11) { + emit_pushmem((int)®_cop1_double[(source[i]>>16)&0x1f]); + emit_pushmem((int)®_cop1_double[(source[i]>>11)&0x1f]); + if((source[i]&0x3f)==0x30) emit_call((int)c_f_d); + if((source[i]&0x3f)==0x31) emit_call((int)c_un_d); + if((source[i]&0x3f)==0x32) emit_call((int)c_eq_d); + if((source[i]&0x3f)==0x33) emit_call((int)c_ueq_d); + if((source[i]&0x3f)==0x34) emit_call((int)c_olt_d); + if((source[i]&0x3f)==0x35) emit_call((int)c_ult_d); + if((source[i]&0x3f)==0x36) emit_call((int)c_ole_d); + if((source[i]&0x3f)==0x37) emit_call((int)c_ule_d); + if((source[i]&0x3f)==0x38) emit_call((int)c_sf_d); + if((source[i]&0x3f)==0x39) emit_call((int)c_ngle_d); + if((source[i]&0x3f)==0x3a) emit_call((int)c_seq_d); + if((source[i]&0x3f)==0x3b) emit_call((int)c_ngl_d); + if((source[i]&0x3f)==0x3c) emit_call((int)c_lt_d); + if((source[i]&0x3f)==0x3d) emit_call((int)c_nge_d); + if((source[i]&0x3f)==0x3e) emit_call((int)c_le_d); + if((source[i]&0x3f)==0x3f) emit_call((int)c_ngt_d); + } + emit_addimm(ESP,8,ESP); + emit_popa(); + emit_loadreg(FSREG,fs); + return; +} + +static void float_assemble(int i,struct regstat *i_regs) +{ + signed char temp=get_reg(i_regs->regmap,-1); + assert(temp>=0); + // Check cop1 unusable + if(!cop1_usable) { + signed char cs=get_reg(i_regs->regmap,CSREG); + assert(cs>=0); + emit_testimm(cs,0x20000000); + int jaddr=(int)out; + emit_jeq(0); + add_stub(FP_STUB,jaddr,(int)out,i,cs,(int)i_regs,is_delayslot,0); + cop1_usable=1; + } + + if((source[i]&0x3f)==6) // mov + { + if(((source[i]>>11)&0x1f)!=((source[i]>>6)&0x1f)) { + if(opcode2[i]==0x10) { + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],temp); + emit_flds(temp); + emit_readword((int)®_cop1_simple[(source[i]>>6)&0x1f],temp); + emit_fstps(temp); + } + if(opcode2[i]==0x11) { + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],temp); + emit_fldl(temp); + emit_readword((int)®_cop1_double[(source[i]>>6)&0x1f],temp); + emit_fstpl(temp); + } + } + return; + } + + if((source[i]&0x3f)>3) + { + if(opcode2[i]==0x10) { + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],temp); + emit_flds(temp); + if(((source[i]>>11)&0x1f)!=((source[i]>>6)&0x1f)) { + emit_readword((int)®_cop1_simple[(source[i]>>6)&0x1f],temp); + } + } + if(opcode2[i]==0x11) { + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],temp); + emit_fldl(temp); + if(((source[i]>>11)&0x1f)!=((source[i]>>6)&0x1f)) { + emit_readword((int)®_cop1_double[(source[i]>>6)&0x1f],temp); + } + } + if((source[i]&0x3f)==4) // sqrt + emit_fsqrt(); + if((source[i]&0x3f)==5) // abs + emit_fabs(); + if((source[i]&0x3f)==7) // neg + emit_fchs(); + if(opcode2[i]==0x10) { + emit_fstps(temp); + } + if(opcode2[i]==0x11) { + emit_fstpl(temp); + } + return; + } + if((source[i]&0x3f)<4) + { + if(opcode2[i]==0x10) { + emit_readword((int)®_cop1_simple[(source[i]>>11)&0x1f],temp); + emit_flds(temp); + } + if(opcode2[i]==0x11) { + emit_readword((int)®_cop1_double[(source[i]>>11)&0x1f],temp); + emit_fldl(temp); + } + if(((source[i]>>11)&0x1f)!=((source[i]>>16)&0x1f)) { + if(opcode2[i]==0x10) { + emit_readword((int)®_cop1_simple[(source[i]>>16)&0x1f],temp); + if((source[i]&0x3f)==0) emit_fadds(temp); + if((source[i]&0x3f)==1) emit_fsubs(temp); + if((source[i]&0x3f)==2) emit_fmuls(temp); + if((source[i]&0x3f)==3) emit_fdivs(temp); + } + else if(opcode2[i]==0x11) { + emit_readword((int)®_cop1_double[(source[i]>>16)&0x1f],temp); + if((source[i]&0x3f)==0) emit_faddl(temp); + if((source[i]&0x3f)==1) emit_fsubl(temp); + if((source[i]&0x3f)==2) emit_fmull(temp); + if((source[i]&0x3f)==3) emit_fdivl(temp); + } + } + else { + if((source[i]&0x3f)==0) emit_fadd(0); + if((source[i]&0x3f)==1) emit_fsub(0); + if((source[i]&0x3f)==2) emit_fmul(0); + if((source[i]&0x3f)==3) emit_fdiv(0); + } + if(opcode2[i]==0x10) { + if(((source[i]>>16)&0x1f)!=((source[i]>>6)&0x1f)) { + emit_readword((int)®_cop1_simple[(source[i]>>6)&0x1f],temp); + } + emit_fstps(temp); + } + if(opcode2[i]==0x11) { + if(((source[i]>>16)&0x1f)!=((source[i]>>6)&0x1f)) { + emit_readword((int)®_cop1_double[(source[i]>>6)&0x1f],temp); + } + emit_fstpl(temp); + } + return; + } + + if(opcode2[i]==0x10) { // Single precision + emit_pusha(); + emit_pushmem((int)®_cop1_simple[(source[i]>> 6)&0x1f]); + if((source[i]&0x3f)<4) + emit_pushmem((int)®_cop1_simple[(source[i]>>16)&0x1f]); + emit_pushmem((int)®_cop1_simple[(source[i]>>11)&0x1f]); + switch(source[i]&0x3f) + { + case 0x00: emit_call((int)add_s);break; + case 0x01: emit_call((int)sub_s);break; + case 0x02: emit_call((int)mul_s);break; + case 0x03: emit_call((int)div_s);break; + case 0x04: emit_call((int)sqrt_s);break; + case 0x05: emit_call((int)abs_s);break; + case 0x06: emit_call((int)mov_s);break; + case 0x07: emit_call((int)neg_s);break; + } + emit_addimm(ESP,(source[i]&0x3f)<4?12:8,ESP); + emit_popa(); + } + if(opcode2[i]==0x11) { // Double precision + emit_pusha(); + emit_pushmem((int)®_cop1_double[(source[i]>> 6)&0x1f]); + if((source[i]&0x3f)<4) + emit_pushmem((int)®_cop1_double[(source[i]>>16)&0x1f]); + emit_pushmem((int)®_cop1_double[(source[i]>>11)&0x1f]); + switch(source[i]&0x3f) + { + case 0x00: emit_call((int)add_d);break; + case 0x01: emit_call((int)sub_d);break; + case 0x02: emit_call((int)mul_d);break; + case 0x03: emit_call((int)div_d);break; + case 0x04: emit_call((int)sqrt_d);break; + case 0x05: emit_call((int)abs_d);break; + case 0x06: emit_call((int)mov_d);break; + case 0x07: emit_call((int)neg_d);break; + } + emit_addimm(ESP,(source[i]&0x3f)<4?12:8,ESP); + emit_popa(); + } +} + +static void multdiv_assemble_x86(int i,struct regstat *i_regs) +{ + // case 0x18: MULT + // case 0x19: MULTU + // case 0x1A: DIV + // case 0x1B: DIVU + // case 0x1C: DMULT + // case 0x1D: DMULTU + // case 0x1E: DDIV + // case 0x1F: DDIVU + if(rs1[i]&&rs2[i]) + { + if((opcode2[i]&4)==0) // 32-bit + { + if(opcode2[i]==0x18) // MULT + { + char m1=get_reg(i_regs->regmap,rs1[i]); + char m2=get_reg(i_regs->regmap,rs2[i]); + assert(m1>=0); + assert(m2>=0); + emit_mov(m1,EAX); + emit_imul(m2); + } + if(opcode2[i]==0x19) // MULTU + { + char m1=get_reg(i_regs->regmap,rs1[i]); + char m2=get_reg(i_regs->regmap,rs2[i]); + assert(m1>=0); + assert(m2>=0); + emit_mov(m1,EAX); + emit_mul(m2); + } + if(opcode2[i]==0x1A) // DIV + { + char d1=get_reg(i_regs->regmap,rs1[i]); + char d2=get_reg(i_regs->regmap,rs2[i]); + assert(d1>=0); + assert(d2>=0); + emit_mov(d1,EAX); + emit_cdq(); + emit_test(d2,d2); + emit_jeq((int)out+8); + emit_idiv(d2); + } + if(opcode2[i]==0x1B) // DIVU + { + char d1=get_reg(i_regs->regmap,rs1[i]); + char d2=get_reg(i_regs->regmap,rs2[i]); + assert(d1>=0); + assert(d2>=0); + emit_mov(d1,EAX); + emit_zeroreg(EDX); + emit_test(d2,d2); + emit_jeq((int)out+8); + emit_div(d2); + } + } + else // 64-bit + { + if(opcode2[i]==0x1C) // DMULT + { + char m1h=get_reg(i_regs->regmap,rs1[i]|64); + char m1l=get_reg(i_regs->regmap,rs1[i]); + char m2h=get_reg(i_regs->regmap,rs2[i]|64); + char m2l=get_reg(i_regs->regmap,rs2[i]); + assert(m1h>=0); + assert(m2h>=0); + assert(m1l>=0); + assert(m2l>=0); + emit_pushreg(m2h); + emit_pushreg(m2l); + emit_pushreg(m1h); + emit_pushreg(m1l); + emit_call((int)&mult64); + emit_popreg(m1l); + emit_popreg(m1h); + emit_popreg(m2l); + emit_popreg(m2h); + char hih=get_reg(i_regs->regmap,HIREG|64); + char hil=get_reg(i_regs->regmap,HIREG); + if(hih>=0) emit_loadreg(HIREG|64,hih); + if(hil>=0) emit_loadreg(HIREG,hil); + char loh=get_reg(i_regs->regmap,LOREG|64); + char lol=get_reg(i_regs->regmap,LOREG); + if(loh>=0) emit_loadreg(LOREG|64,loh); + if(lol>=0) emit_loadreg(LOREG,lol); + } + if(opcode2[i]==0x1D) // DMULTU + { + char m1h=get_reg(i_regs->regmap,rs1[i]|64); + char m1l=get_reg(i_regs->regmap,rs1[i]); + char m2h=get_reg(i_regs->regmap,rs2[i]|64); + char m2l=get_reg(i_regs->regmap,rs2[i]); + char temp=get_reg(i_regs->regmap,-1); + assert(m1h>=0); + assert(m2h>=0); + assert(m1l>=0); + assert(m2l>=0); + assert(temp>=0); + emit_mov(m1l,EAX); + emit_mul(m2l); + emit_storereg(LOREG,EAX); + emit_mov(EDX,temp); + emit_mov(m1h,EAX); + emit_mul(m2l); + emit_add(EAX,temp,temp); + emit_adcimm(0,EDX); + emit_storereg(HIREG,EDX); + emit_mov(m2h,EAX); + emit_mul(m1l); + emit_add(EAX,temp,temp); + emit_adcimm(0,EDX); + emit_storereg(LOREG|64,temp); + emit_mov(EDX,temp); + emit_mov(m2h,EAX); + emit_mul(m1h); + emit_add(EAX,temp,EAX); + emit_loadreg(HIREG,temp); + emit_adcimm(0,EDX); + emit_add(EAX,temp,EAX); + emit_adcimm(0,EDX); + // DEBUG + /* + emit_pushreg(m2h); + emit_pushreg(m2l); + emit_pushreg(m1h); + emit_pushreg(m1l); + emit_call((int)&multu64); + emit_popreg(m1l); + emit_popreg(m1h); + emit_popreg(m2l); + emit_popreg(m2h); + char hih=get_reg(i_regs->regmap,HIREG|64); + char hil=get_reg(i_regs->regmap,HIREG); + if(hih>=0) emit_loadreg(HIREG|64,hih); // DEBUG + if(hil>=0) emit_loadreg(HIREG,hil); // DEBUG + */ + // Shouldn't be necessary + //char loh=get_reg(i_regs->regmap,LOREG|64); + //char lol=get_reg(i_regs->regmap,LOREG); + //if(loh>=0) emit_loadreg(LOREG|64,loh); + //if(lol>=0) emit_loadreg(LOREG,lol); + } + if(opcode2[i]==0x1E) // DDIV + { + char d1h=get_reg(i_regs->regmap,rs1[i]|64); + char d1l=get_reg(i_regs->regmap,rs1[i]); + char d2h=get_reg(i_regs->regmap,rs2[i]|64); + char d2l=get_reg(i_regs->regmap,rs2[i]); + assert(d1h>=0); + assert(d2h>=0); + assert(d1l>=0); + assert(d2l>=0); + //emit_pushreg(d2h); + //emit_pushreg(d2l); + //emit_pushreg(d1h); + //emit_pushreg(d1l); + emit_addimm(ESP,-16,ESP); + emit_writeword_indexed(d2h,12,ESP); + emit_writeword_indexed(d2l,8,ESP); + emit_writeword_indexed(d1h,4,ESP); + emit_writeword_indexed(d1l,0,ESP); + emit_call((int)&div64); + //emit_popreg(d1l); + //emit_popreg(d1h); + //emit_popreg(d2l); + //emit_popreg(d2h); + emit_readword_indexed(0,ESP,d1l); + emit_readword_indexed(4,ESP,d1h); + emit_readword_indexed(8,ESP,d2l); + emit_readword_indexed(12,ESP,d2h); + emit_addimm(ESP,16,ESP); + char hih=get_reg(i_regs->regmap,HIREG|64); + char hil=get_reg(i_regs->regmap,HIREG); + char loh=get_reg(i_regs->regmap,LOREG|64); + char lol=get_reg(i_regs->regmap,LOREG); + if(hih>=0) emit_loadreg(HIREG|64,hih); + if(hil>=0) emit_loadreg(HIREG,hil); + if(loh>=0) emit_loadreg(LOREG|64,loh); + if(lol>=0) emit_loadreg(LOREG,lol); + } + if(opcode2[i]==0x1F) // DDIVU + { + char d1h=get_reg(i_regs->regmap,rs1[i]|64); + char d1l=get_reg(i_regs->regmap,rs1[i]); + char d2h=get_reg(i_regs->regmap,rs2[i]|64); + char d2l=get_reg(i_regs->regmap,rs2[i]); + assert(d1h>=0); + assert(d2h>=0); + assert(d1l>=0); + assert(d2l>=0); + //emit_pushreg(d2h); + //emit_pushreg(d2l); + //emit_pushreg(d1h); + //emit_pushreg(d1l); + emit_addimm(ESP,-16,ESP); + emit_writeword_indexed(d2h,12,ESP); + emit_writeword_indexed(d2l,8,ESP); + emit_writeword_indexed(d1h,4,ESP); + emit_writeword_indexed(d1l,0,ESP); + emit_call((int)&divu64); + //emit_popreg(d1l); + //emit_popreg(d1h); + //emit_popreg(d2l); + //emit_popreg(d2h); + emit_readword_indexed(0,ESP,d1l); + emit_readword_indexed(4,ESP,d1h); + emit_readword_indexed(8,ESP,d2l); + emit_readword_indexed(12,ESP,d2h); + emit_addimm(ESP,16,ESP); + char hih=get_reg(i_regs->regmap,HIREG|64); + char hil=get_reg(i_regs->regmap,HIREG); + char loh=get_reg(i_regs->regmap,LOREG|64); + char lol=get_reg(i_regs->regmap,LOREG); + if(hih>=0) emit_loadreg(HIREG|64,hih); + if(hil>=0) emit_loadreg(HIREG,hil); + if(loh>=0) emit_loadreg(LOREG|64,loh); + if(lol>=0) emit_loadreg(LOREG,lol); + } + } + } + else + { + // Multiply by zero is zero. + // MIPS does not have a divide by zero exception. + // The result is undefined, we return zero. + char hr=get_reg(i_regs->regmap,HIREG); + char lr=get_reg(i_regs->regmap,LOREG); + if(hr>=0) emit_zeroreg(hr); + if(lr>=0) emit_zeroreg(lr); + } +} +#define multdiv_assemble multdiv_assemble_x86 + +static void do_preload_rhash(int r) { + emit_movimm(0xf8,r); +} + +static void do_preload_rhtbl(int r) { + // Don't need this for x86 +} + +static void do_rhash(int rs,int rh) { + emit_and(rs,rh,rh); +} + +static void do_miniht_load(int ht,int rh) { + // Don't need this for x86. The load and compare can be combined into + // a single instruction (below) +} + +static void do_miniht_jump(int rs,int rh,int ht) { + emit_cmpmem_indexed((int)mini_ht,rh,rs); + emit_jne(jump_vaddr_reg[rs]); + emit_jmpmem_indexed((int)mini_ht+4,rh); +} + +static void do_miniht_insert(int return_address,int rt,int temp) { + emit_movimm(return_address,rt); // PC into link register + //emit_writeword_imm(return_address,(int)&mini_ht[(return_address&0xFF)>>8][0]); + emit_writeword(rt,(int)&mini_ht[(return_address&0xFF)>>3][0]); + add_to_linker((int)out,return_address,1); + emit_writeword_imm(0,(int)&mini_ht[(return_address&0xFF)>>3][1]); +} + +// We don't need this for x86 +static void literal_pool(int n) {} +static void literal_pool_jumpover(int n) {} + +// CPU-architecture-specific initialization, not needed for x86 +static void arch_init() {} diff --git a/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/assem_x86.h b/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/assem_x86.h new file mode 100644 index 0000000000..f2f9322320 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/assem_x86.h @@ -0,0 +1,20 @@ +#define HOST_REGS 8 +#define HOST_CCREG 6 +#define HOST_BTREG 5 +#define EXCLUDE_REG 4 + +//#define IMM_PREFETCH 1 +#define HOST_IMM_ADDR32 1 +#define INVERTED_CARRY 1 +#define DESTRUCTIVE_WRITEBACK 1 +#define DESTRUCTIVE_SHIFT 1 + +#define USE_MINI_HT 1 + +extern void *base_addr; // Code generator target address +#define TARGET_SIZE_2 25 // 2^25 = 32 megabytes +#define JUMP_TABLE_SIZE 0 // Not needed for 32-bit x86 + +/* x86 calling convention: + caller-save: %eax %ecx %edx + callee-save: %ebp %ebx %esi %edi */ diff --git a/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/linkage_arm.S b/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/linkage_arm.S new file mode 100644 index 0000000000..90421769e0 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/linkage_arm.S @@ -0,0 +1,1212 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - linkage_arm.s * + * Copyright (C) 2009-2011 Ari64 * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + .cpu arm9tdmi + .fpu softvfp + .eabi_attribute 20, 1 + .eabi_attribute 21, 1 + .eabi_attribute 23, 3 + .eabi_attribute 24, 1 + .eabi_attribute 25, 1 + .eabi_attribute 26, 2 + .eabi_attribute 30, 6 + .eabi_attribute 18, 4 + .file "linkage_arm.S" + .global extra_memory + .hidden extra_memory + .global dynarec_local + .hidden dynarec_local + .global reg + .hidden reg + .global hi + .hidden hi + .global lo + .hidden lo + .global reg_cop1_simple + .hidden reg_cop1_simple + .global reg_cop1_double + .hidden reg_cop1_double + .global reg_cop0 + .hidden reg_cop0 + .global FCR0 + .hidden FCR0 + .global FCR31 + .hidden FCR31 + .global rounding_modes + .hidden rounding_modes + .global next_interupt + .hidden next_interupt + .global cycle_count + .hidden cycle_count + .global last_count + .hidden last_count + .global pending_exception + .hidden pending_exception + .global pcaddr + .hidden pcaddr + .global stop + .hidden stop + .global invc_ptr + .hidden invc_ptr + .global address + .hidden address + .global readmem_dword + .hidden readmem_dword + .global dword + .hidden dword + .global word + .hidden word + .global hword + .hidden hword + .global cpu_byte + .hidden cpu_byte + .global branch_target + .hidden branch_target + .global PC + .hidden PC + .global fake_pc + .hidden fake_pc + .global mini_ht + .hidden mini_ht + .global restore_candidate + .hidden restore_candidate + .global ram_offset + .hidden ram_offset + .global memory_map + .hidden memory_map + .bss + .align 12 + .type extra_memory, %object + .size extra_memory, 33554432 +extra_memory: + .space 33554432+64+16+16+8+8+8+8+256+8+8+128+128+128+16+8+132+4+256+512+4194304 +dynarec_local = extra_memory + 33554432 + .type dynarec_local, %object + .size dynarec_local, 64 +next_interupt = dynarec_local + 64 + .type next_interupt, %object + .size next_interupt, 4 +cycle_count = next_interupt + 4 + .type cycle_count, %object + .size cycle_count, 4 +last_count = cycle_count + 4 + .type last_count, %object + .size last_count, 4 +pending_exception = last_count + 4 + .type pending_exception, %object + .size pending_exception, 4 +pcaddr = pending_exception + 4 + .type pcaddr, %object + .size pcaddr, 4 +stop = pcaddr + 4 + .type stop, %object + .size stop, 4 +invc_ptr = stop + 4 + .type invc_ptr, %object + .size invc_ptr, 4 +address = invc_ptr + 4 + .type address, %object + .size address, 4 +readmem_dword = address + 4 + .type readmem_dword, %object + .size readmem_dword, 8 +dword = readmem_dword + 8 + .type dword, %object + .size dword, 8 +word = dword + 8 + .type word, %object + .size word, 4 +hword = word + 4 + .type hword, %object + .size hword, 2 +cpu_byte = hword + 2 + .type cpu_byte, %object + .size cpu_byte, 1 /* 1 byte free */ +FCR0 = hword + 4 + .type FCR0, %object + .size FCR0, 4 +FCR31 = FCR0 + 4 + .type FCR31, %object + .size FCR31, 4 +reg = FCR31 + 4 + .type reg, %object + .size reg, 256 +hi = reg + 256 + .type hi, %object + .size hi, 8 +lo = hi + 8 + .type lo, %object + .size lo, 8 +reg_cop0 = lo + 8 + .type reg_cop0, %object + .size reg_cop0, 128 +reg_cop1_simple = reg_cop0 + 128 + .type reg_cop1_simple, %object + .size reg_cop1_simple, 128 +reg_cop1_double = reg_cop1_simple + 128 + .type reg_cop1_double, %object + .size reg_cop1_double, 128 +rounding_modes = reg_cop1_double + 128 + .type rounding_modes, %object + .size rounding_modes, 16 +branch_target = rounding_modes + 16 + .type branch_target, %object + .size branch_target, 4 +PC = branch_target + 4 + .type PC, %object + .size PC, 4 +fake_pc = PC + 4 + .type fake_pc, %object + .size fake_pc, 132 +ram_offset = fake_pc + 132 + .type ram_offset, %object + .size ram_offset, 4 +mini_ht = ram_offset + 4 + .type mini_ht, %object + .size mini_ht, 256 +restore_candidate = mini_ht + 256 + .type restore_candidate, %object + .size restore_candidate, 512 +memory_map = restore_candidate + 512 + .type memory_map, %object + .size memory_map, 4194304 + + .text + .align 2 + .global dyna_linker + .hidden dyna_linker + .type dyna_linker, %function +dyna_linker: + /* r0 = virtual target address */ + /* r1 = instruction to patch */ + ldr r4, .tlbptr + lsr r5, r0, #12 + mov r12, r0 + cmp r0, #0xC0000000 + mov r6, #4096 + ldrge r12, [r4, r5, lsl #2] + mov r2, #0x80000 + ldr r3, .jiptr + tst r12, r12 + sub r6, r6, #1 + moveq r12, r0 + ldr r7, [r1] + eor r2, r2, r12, lsr #12 + and r6, r6, r12, lsr #12 + cmp r2, #2048 + add r12, r7, #2 + orrcs r2, r6, #2048 + ldr r5, [r3, r2, lsl #2] + lsl r12, r12, #8 + /* jump_in lookup */ +.A1: + movs r4, r5 + beq .A3 + ldr r3, [r5] + ldr r5, [r4, #12] + teq r3, r0 + bne .A1 + ldr r3, [r4, #4] + ldr r4, [r4, #8] + tst r3, r3 + bne .A1 +.A2: + mov r5, r1 + add r1, r1, r12, asr #6 + teq r1, r4 + moveq pc, r4 /* Stale i-cache */ + bl add_link + sub r2, r4, r5 + and r1, r7, #0xff000000 + lsl r2, r2, #6 + sub r1, r1, #2 + add r1, r1, r2, lsr #8 + str r1, [r5] + mov pc, r4 +.A3: + /* hash_table lookup */ + cmp r2, #2048 + ldr r3, .jdptr + eor r4, r0, r0, lsl #16 + lslcc r2, r0, #9 + ldr r6, .htptr + lsr r4, r4, #12 + lsrcc r2, r2, #21 + bic r4, r4, #15 + ldr r5, [r3, r2, lsl #2] + ldr r7, [r6, r4]! + teq r7, r0 + ldreq pc, [r6, #4] + ldr r7, [r6, #8] + teq r7, r0 + ldreq pc, [r6, #12] + /* jump_dirty lookup */ +.A6: + movs r4, r5 + beq .A8 + ldr r3, [r5] + ldr r5, [r4, #12] + teq r3, r0 + bne .A6 +.A7: + ldr r1, [r4, #8] + /* hash_table insert */ + ldr r2, [r6] + ldr r3, [r6, #4] + str r0, [r6] + str r1, [r6, #4] + str r2, [r6, #8] + str r3, [r6, #12] + mov pc, r1 +.A8: + mov r4, r0 + mov r5, r1 + bl new_recompile_block + tst r0, r0 + mov r0, r4 + mov r1, r5 + beq dyna_linker + /* pagefault */ + mov r1, r0 + mov r2, #8 + .size dyna_linker, .-dyna_linker + .type exec_pagefault, %function +exec_pagefault: + /* r0 = instruction pointer */ + /* r1 = fault address */ + /* r2 = cause */ + ldr r3, [fp, #reg_cop0+48-dynarec_local] /* Status */ + mvn r6, #0xF000000F + ldr r4, [fp, #reg_cop0+16-dynarec_local] /* Context */ + bic r6, r6, #0x0F800000 + str r0, [fp, #reg_cop0+56-dynarec_local] /* EPC */ + orr r3, r3, #2 + str r1, [fp, #reg_cop0+32-dynarec_local] /* BadVAddr */ + bic r4, r4, r6 + str r3, [fp, #reg_cop0+48-dynarec_local] /* Status */ + and r5, r6, r1, lsr #9 + str r2, [fp, #reg_cop0+52-dynarec_local] /* Cause */ + and r1, r1, r6, lsl #9 + str r1, [fp, #reg_cop0+40-dynarec_local] /* EntryHi */ + orr r4, r4, r5 + str r4, [fp, #reg_cop0+16-dynarec_local] /* Context */ + mov r0, #0x80000000 + bl get_addr_ht + mov pc, r0 + .size exec_pagefault, .-exec_pagefault +/* Special dynamic linker for the case where a page fault + may occur in a branch delay slot */ + .global dyna_linker_ds + .hidden dyna_linker_ds + .type dyna_linker_ds, %function +dyna_linker_ds: + /* r0 = virtual target address */ + /* r1 = instruction to patch */ + ldr r4, .tlbptr + lsr r5, r0, #12 + mov r12, r0 + cmp r0, #0xC0000000 + mov r6, #4096 + ldrge r12, [r4, r5, lsl #2] + mov r2, #0x80000 + ldr r3, .jiptr + tst r12, r12 + sub r6, r6, #1 + moveq r12, r0 + ldr r7, [r1] + eor r2, r2, r12, lsr #12 + and r6, r6, r12, lsr #12 + cmp r2, #2048 + add r12, r7, #2 + orrcs r2, r6, #2048 + ldr r5, [r3, r2, lsl #2] + lsl r12, r12, #8 + /* jump_in lookup */ +.B1: + movs r4, r5 + beq .B3 + ldr r3, [r5] + ldr r5, [r4, #12] + teq r3, r0 + bne .B1 + ldr r3, [r4, #4] + ldr r4, [r4, #8] + tst r3, r3 + bne .B1 +.B2: + mov r5, r1 + add r1, r1, r12, asr #6 + teq r1, r4 + moveq pc, r4 /* Stale i-cache */ + bl add_link + sub r2, r4, r5 + and r1, r7, #0xff000000 + lsl r2, r2, #6 + sub r1, r1, #2 + add r1, r1, r2, lsr #8 + str r1, [r5] + mov pc, r4 +.B3: + /* hash_table lookup */ + cmp r2, #2048 + ldr r3, .jdptr + eor r4, r0, r0, lsl #16 + lslcc r2, r0, #9 + ldr r6, .htptr + lsr r4, r4, #12 + lsrcc r2, r2, #21 + bic r4, r4, #15 + ldr r5, [r3, r2, lsl #2] + ldr r7, [r6, r4]! + teq r7, r0 + ldreq pc, [r6, #4] + ldr r7, [r6, #8] + teq r7, r0 + ldreq pc, [r6, #12] + /* jump_dirty lookup */ +.B6: + movs r4, r5 + beq .B8 + ldr r3, [r5] + ldr r5, [r4, #12] + teq r3, r0 + bne .B6 +.B7: + ldr r1, [r4, #8] + /* hash_table insert */ + ldr r2, [r6] + ldr r3, [r6, #4] + str r0, [r6] + str r1, [r6, #4] + str r2, [r6, #8] + str r3, [r6, #12] + mov pc, r1 +.B8: + mov r4, r0 + bic r0, r0, #7 + mov r5, r1 + orr r0, r0, #1 + bl new_recompile_block + tst r0, r0 + mov r0, r4 + mov r1, r5 + beq dyna_linker_ds + /* pagefault */ + bic r1, r0, #7 + mov r2, #0x80000008 /* High bit set indicates pagefault in delay slot */ + sub r0, r1, #4 + b exec_pagefault + .size dyna_linker_ds, .-dyna_linker_ds +.jiptr: + .word jump_in +.jdptr: + .word jump_dirty +.tlbptr: + .word tlb_LUT_r +.htptr: + .word hash_table + .align 2 + .global jump_vaddr_r0 + .hidden jump_vaddr_r0 + .type jump_vaddr_r0, %function +jump_vaddr_r0: + eor r2, r0, r0, lsl #16 + b jump_vaddr + .size jump_vaddr_r0, .-jump_vaddr_r0 + .global jump_vaddr_r1 + .hidden jump_vaddr_r1 + .type jump_vaddr_r1, %function +jump_vaddr_r1: + eor r2, r1, r1, lsl #16 + mov r0, r1 + b jump_vaddr + .size jump_vaddr_r1, .-jump_vaddr_r1 + .global jump_vaddr_r2 + .hidden jump_vaddr_r2 + .type jump_vaddr_r2, %function +jump_vaddr_r2: + mov r0, r2 + eor r2, r2, r2, lsl #16 + b jump_vaddr + .size jump_vaddr_r2, .-jump_vaddr_r2 + .global jump_vaddr_r3 + .hidden jump_vaddr_r3 + .type jump_vaddr_r3, %function +jump_vaddr_r3: + eor r2, r3, r3, lsl #16 + mov r0, r3 + b jump_vaddr + .size jump_vaddr_r3, .-jump_vaddr_r3 + .global jump_vaddr_r4 + .hidden jump_vaddr_r4 + .type jump_vaddr_r4, %function +jump_vaddr_r4: + eor r2, r4, r4, lsl #16 + mov r0, r4 + b jump_vaddr + .size jump_vaddr_r4, .-jump_vaddr_r4 + .global jump_vaddr_r5 + .hidden jump_vaddr_r5 + .type jump_vaddr_r5, %function +jump_vaddr_r5: + eor r2, r5, r5, lsl #16 + mov r0, r5 + b jump_vaddr + .size jump_vaddr_r5, .-jump_vaddr_r5 + .global jump_vaddr_r6 + .hidden jump_vaddr_r6 + .type jump_vaddr_r6, %function +jump_vaddr_r6: + eor r2, r6, r6, lsl #16 + mov r0, r6 + b jump_vaddr + .size jump_vaddr_r6, .-jump_vaddr_r6 + .global jump_vaddr_r8 + .hidden jump_vaddr_r8 + .type jump_vaddr_r8, %function +jump_vaddr_r8: + eor r2, r8, r8, lsl #16 + mov r0, r8 + b jump_vaddr + .size jump_vaddr_r8, .-jump_vaddr_r8 + .global jump_vaddr_r9 + .hidden jump_vaddr_r9 + .type jump_vaddr_r9, %function +jump_vaddr_r9: + eor r2, r9, r9, lsl #16 + mov r0, r9 + b jump_vaddr + .size jump_vaddr_r9, .-jump_vaddr_r9 + .global jump_vaddr_r10 + .hidden jump_vaddr_r10 + .type jump_vaddr_r10, %function +jump_vaddr_r10: + eor r2, r10, r10, lsl #16 + mov r0, r10 + b jump_vaddr + .size jump_vaddr_r10, .-jump_vaddr_r10 + .global jump_vaddr_r12 + .hidden jump_vaddr_r12 + .type jump_vaddr_r12, %function +jump_vaddr_r12: + eor r2, r12, r12, lsl #16 + mov r0, r12 + b jump_vaddr + .size jump_vaddr_r12, .-jump_vaddr_r12 + .global jump_vaddr_r7 + .hidden jump_vaddr_r7 + .type jump_vaddr_r7, %function +jump_vaddr_r7: + eor r2, r7, r7, lsl #16 + add r0, r7, #0 + .size jump_vaddr_r7, .-jump_vaddr_r7 + .global jump_vaddr + .hidden jump_vaddr + .type jump_vaddr, %function +jump_vaddr: + ldr r1, .htptr + mvn r3, #15 + and r2, r3, r2, lsr #12 + ldr r2, [r1, r2]! + teq r2, r0 + ldreq pc, [r1, #4] + ldr r2, [r1, #8] + teq r2, r0 + ldreq pc, [r1, #12] + str r10, [fp, #cycle_count-dynarec_local] + bl get_addr + ldr r10, [fp, #cycle_count-dynarec_local] + mov pc, r0 + .size jump_vaddr, .-jump_vaddr + .align 2 + .global verify_code_ds + .hidden verify_code_ds + .type verify_code_ds, %function +verify_code_ds: + str r8, [fp, #branch_target-dynarec_local] + .size verify_code_ds, .-verify_code_ds + .global verify_code_vm + .hidden verify_code_vm + .type verify_code_vm, %function +verify_code_vm: + /* r0 = instruction pointer (virtual address) */ + /* r1 = source (virtual address) */ + /* r2 = target */ + /* r3 = length */ + cmp r1, #0xC0000000 + blt verify_code + add r12, fp, #memory_map-dynarec_local + lsr r4, r1, #12 + add r5, r1, r3 + sub r5, #1 + ldr r6, [r12, r4, lsl #2] + lsr r5, r5, #12 + movs r7, r6 + bmi .D5 + add r1, r1, r6, lsl #2 + lsl r6, r6, #2 +.D1: + add r4, r4, #1 + teq r6, r7, lsl #2 + bne .D5 + ldr r7, [r12, r4, lsl #2] + cmp r4, r5 + bls .D1 + .size verify_code_vm, .-verify_code_vm + .global verify_code + .hidden verify_code + .type verify_code, %function +verify_code: + /* r1 = source */ + /* r2 = target */ + /* r3 = length */ + tst r3, #4 + mov r4, #0 + add r3, r1, r3 + mov r5, #0 + ldrne r4, [r1], #4 + mov r12, #0 + ldrne r5, [r2], #4 + teq r1, r3 + beq .D3 +.D2: + ldr r7, [r1], #4 + eor r9, r4, r5 + ldr r8, [r2], #4 + orrs r9, r9, r12 + bne .D4 + ldr r4, [r1], #4 + eor r12, r7, r8 + ldr r5, [r2], #4 + cmp r1, r3 + bcc .D2 + teq r7, r8 +.D3: + teqeq r4, r5 +.D4: + ldr r8, [fp, #branch_target-dynarec_local] + moveq pc, lr +.D5: + bl get_addr + mov pc, r0 + .size verify_code, .-verify_code + .align 2 + .global cc_interrupt + .hidden cc_interrupt + .type cc_interrupt, %function +cc_interrupt: + ldr r0, [fp, #last_count-dynarec_local] + mov r1, #0 + mov r2, #0x1fc + add r10, r0, r10 + str r1, [fp, #pending_exception-dynarec_local] + and r2, r2, r10, lsr #17 + add r3, fp, #restore_candidate-dynarec_local + str r10, [fp, #reg_cop0+36-dynarec_local] /* Count */ + ldr r4, [r2, r3] + mov r10, lr + tst r4, r4 + bne .E4 +.E1: + bl gen_interupt + mov lr, r10 + ldr r10, [fp, #reg_cop0+36-dynarec_local] /* Count */ + ldr r0, [fp, #next_interupt-dynarec_local] + ldr r1, [fp, #pending_exception-dynarec_local] + ldr r2, [fp, #stop-dynarec_local] + str r0, [fp, #last_count-dynarec_local] + sub r10, r10, r0 + tst r2, r2 + bne .E3 + tst r1, r1 + moveq pc, lr +.E2: + ldr r0, [fp, #pcaddr-dynarec_local] + bl get_addr_ht + mov pc, r0 +.E3: + add r12, fp, #28 + ldmia r12, {r4, r5, r6, r7, r8, r9, sl, fp, pc} +.E4: + /* Move 'dirty' blocks to the 'clean' list */ + lsl r5, r2, #3 + str r1, [r2, r3] +.E5: + lsrs r4, r4, #1 + mov r0, r5 + add r5, r5, #1 + blcs clean_blocks + tst r5, #31 + bne .E5 + b .E1 + + .size cc_interrupt, .-cc_interrupt + .align 2 + .global do_interrupt + .hidden do_interrupt + .type do_interrupt, %function +do_interrupt: + ldr r0, [fp, #pcaddr-dynarec_local] + bl get_addr_ht + ldr r1, [fp, #next_interupt-dynarec_local] + ldr r10, [fp, #reg_cop0+36-dynarec_local] /* Count */ + str r1, [fp, #last_count-dynarec_local] + sub r10, r10, r1 + add r10, r10, #2 + mov pc, r0 + .size do_interrupt, .-do_interrupt + .align 2 + .global fp_exception + .hidden fp_exception + .type fp_exception, %function +fp_exception: + mov r2, #0x10000000 +.E7: + ldr r1, [fp, #reg_cop0+48-dynarec_local] /* Status */ + mov r3, #0x80000000 + str r0, [fp, #reg_cop0+56-dynarec_local] /* EPC */ + orr r1, #2 + add r2, r2, #0x2c + str r1, [fp, #reg_cop0+48-dynarec_local] /* Status */ + str r2, [fp, #reg_cop0+52-dynarec_local] /* Cause */ + add r0, r3, #0x180 + bl get_addr_ht + mov pc, r0 + .size fp_exception, .-fp_exception + .align 2 + .global fp_exception_ds + .hidden fp_exception_ds + .type fp_exception_ds, %function +fp_exception_ds: + mov r2, #0x90000000 /* Set high bit if delay slot */ + b .E7 + .size fp_exception_ds, .-fp_exception_ds + .align 2 + .global jump_syscall + .hidden jump_syscall + .type jump_syscall, %function +jump_syscall: + ldr r1, [fp, #reg_cop0+48-dynarec_local] /* Status */ + mov r3, #0x80000000 + str r0, [fp, #reg_cop0+56-dynarec_local] /* EPC */ + orr r1, #2 + mov r2, #0x20 + str r1, [fp, #reg_cop0+48-dynarec_local] /* Status */ + str r2, [fp, #reg_cop0+52-dynarec_local] /* Cause */ + add r0, r3, #0x180 + bl get_addr_ht + mov pc, r0 + .size jump_syscall, .-jump_syscall + .align 2 + .global indirect_jump_indexed + .hidden indirect_jump_indexed + .type indirect_jump_indexed, %function +indirect_jump_indexed: + ldr r0, [r0, r1, lsl #2] + .size indirect_jump_indexed, .-indirect_jump_indexed + .align 2 + .global indirect_jump + .hidden indirect_jump + .type indirect_jump, %function +indirect_jump: + ldr r12, [fp, #last_count-dynarec_local] + add r2, r2, r12 + str r2, [fp, #reg_cop0+36-dynarec_local] /* Count */ + mov pc, r0 + .size indirect_jump, .-indirect_jump + .align 2 + .global jump_eret + .hidden jump_eret + .type jump_eret, %function +jump_eret: + ldr r1, [fp, #reg_cop0+48-dynarec_local] /* Status */ + ldr r0, [fp, #last_count-dynarec_local] + bic r1, r1, #2 + add r10, r0, r10 + str r1, [fp, #reg_cop0+48-dynarec_local] /* Status */ + str r10, [fp, #reg_cop0+36-dynarec_local] /* Count */ + bl check_interupt + ldr r1, [fp, #next_interupt-dynarec_local] + ldr r0, [fp, #reg_cop0+56-dynarec_local] /* EPC */ + str r1, [fp, #last_count-dynarec_local] + subs r10, r10, r1 + bpl .E11 +.E8: + add r6, fp, #reg+256-dynarec_local + mov r5, #248 + mov r1, #0 +.E9: + ldr r2, [r6, #-8]! + ldr r3, [r6, #4] + eor r3, r3, r2, asr #31 + subs r3, r3, #1 + adc r1, r1, r1 + subs r5, r5, #8 + bne .E9 + ldr r2, [fp, #hi-dynarec_local] + ldr r3, [fp, #hi+4-dynarec_local] + eors r3, r3, r2, asr #31 + ldr r2, [fp, #lo-dynarec_local] + ldreq r3, [fp, #lo+4-dynarec_local] + eoreq r3, r3, r2, asr #31 + subs r3, r3, #1 + adc r1, r1, r1 + bl get_addr_32 + mov pc, r0 +.E11: + str r0, [fp, #pcaddr-dynarec_local] + bl cc_interrupt + ldr r0, [fp, #pcaddr-dynarec_local] + b .E8 + .size jump_eret, .-jump_eret + .align 2 + .global new_dyna_start + .hidden new_dyna_start + .type new_dyna_start, %function +new_dyna_start: + ldr r12, .dlptr + ldr r1, .tgtptr + mov r0, #0xa4000000 + stmia r12, {r4, r5, r6, r7, r8, r9, sl, fp, lr} + sub fp, r12, #28 + ldr r4, [r1] + add r0, r0, #0x40 + bl new_recompile_block + ldr r0, [fp, #next_interupt-dynarec_local] + ldr r10, [fp, #reg_cop0+36-dynarec_local] /* Count */ + str r0, [fp, #last_count-dynarec_local] + sub r10, r10, r0 + mov pc, r4 +.dlptr: + .word dynarec_local+28 +.tgtptr: + .word out + .size new_dyna_start, .-new_dyna_start + .align 2 + .global invalidate_addr_r0 + .hidden invalidate_addr_r0 + .type invalidate_addr_r0, %function +invalidate_addr_r0: + stmia fp, {r0, r1, r2, r3, r12, lr} + lsr r0, r0, #12 + b invalidate_addr_call + .size invalidate_addr_r0, .-invalidate_addr_r0 + .align 2 + .global invalidate_addr_r1 + .hidden invalidate_addr_r1 + .type invalidate_addr_r1, %function +invalidate_addr_r1: + stmia fp, {r0, r1, r2, r3, r12, lr} + lsr r0, r1, #12 + b invalidate_addr_call + .size invalidate_addr_r1, .-invalidate_addr_r1 + .align 2 + .global invalidate_addr_r2 + .hidden invalidate_addr_r2 + .type invalidate_addr_r2, %function +invalidate_addr_r2: + stmia fp, {r0, r1, r2, r3, r12, lr} + lsr r0, r2, #12 + b invalidate_addr_call + .size invalidate_addr_r2, .-invalidate_addr_r2 + .align 2 + .global invalidate_addr_r3 + .hidden invalidate_addr_r3 + .type invalidate_addr_r3, %function +invalidate_addr_r3: + stmia fp, {r0, r1, r2, r3, r12, lr} + lsr r0, r3, #12 + b invalidate_addr_call + .size invalidate_addr_r3, .-invalidate_addr_r3 + .align 2 + .global invalidate_addr_r4 + .hidden invalidate_addr_r4 + .type invalidate_addr_r4, %function +invalidate_addr_r4: + stmia fp, {r0, r1, r2, r3, r12, lr} + lsr r0, r4, #12 + b invalidate_addr_call + .size invalidate_addr_r4, .-invalidate_addr_r4 + .align 2 + .global invalidate_addr_r5 + .hidden invalidate_addr_r5 + .type invalidate_addr_r5, %function +invalidate_addr_r5: + stmia fp, {r0, r1, r2, r3, r12, lr} + lsr r0, r5, #12 + b invalidate_addr_call + .size invalidate_addr_r5, .-invalidate_addr_r5 + .align 2 + .global invalidate_addr_r6 + .hidden invalidate_addr_r6 + .type invalidate_addr_r6, %function +invalidate_addr_r6: + stmia fp, {r0, r1, r2, r3, r12, lr} + lsr r0, r6, #12 + b invalidate_addr_call + .size invalidate_addr_r6, .-invalidate_addr_r6 + .align 2 + .global invalidate_addr_r7 + .hidden invalidate_addr_r7 + .type invalidate_addr_r7, %function +invalidate_addr_r7: + stmia fp, {r0, r1, r2, r3, r12, lr} + lsr r0, r7, #12 + b invalidate_addr_call + .size invalidate_addr_r7, .-invalidate_addr_r7 + .align 2 + .global invalidate_addr_r8 + .hidden invalidate_addr_r8 + .type invalidate_addr_r8, %function +invalidate_addr_r8: + stmia fp, {r0, r1, r2, r3, r12, lr} + lsr r0, r8, #12 + b invalidate_addr_call + .size invalidate_addr_r8, .-invalidate_addr_r8 + .align 2 + .global invalidate_addr_r9 + .hidden invalidate_addr_r9 + .type invalidate_addr_r9, %function +invalidate_addr_r9: + stmia fp, {r0, r1, r2, r3, r12, lr} + lsr r0, r9, #12 + b invalidate_addr_call + .size invalidate_addr_r9, .-invalidate_addr_r9 + .align 2 + .global invalidate_addr_r10 + .hidden invalidate_addr_r10 + .type invalidate_addr_r10, %function +invalidate_addr_r10: + stmia fp, {r0, r1, r2, r3, r12, lr} + lsr r0, r10, #12 + b invalidate_addr_call + .size invalidate_addr_r10, .-invalidate_addr_r10 + .align 2 + .global invalidate_addr_r12 + .hidden invalidate_addr_r12 + .type invalidate_addr_r12, %function +invalidate_addr_r12: + stmia fp, {r0, r1, r2, r3, r12, lr} + lsr r0, r12, #12 + .size invalidate_addr_r12, .-invalidate_addr_r12 + .align 2 + .type invalidate_addr_call, %function +invalidate_addr_call: + bl invalidate_block + ldmia fp, {r0, r1, r2, r3, r12, pc} + .size invalidate_addr_call, .-invalidate_addr_call + .align 2 + .global write_rdram_new + .hidden write_rdram_new + .type write_rdram_new, %function +write_rdram_new: + ldr r3, [fp, #ram_offset-dynarec_local] + ldr r2, [fp, #address-dynarec_local] + ldr r0, [fp, #word-dynarec_local] + str r0, [r2, r3, lsl #2] + b .E12 + .size write_rdram_new, .-write_rdram_new + .align 2 + .global write_rdramb_new + .hidden write_rdramb_new + .type write_rdramb_new, %function +write_rdramb_new: + ldr r3, [fp, #ram_offset-dynarec_local] + ldr r2, [fp, #address-dynarec_local] + ldrb r0, [fp, #cpu_byte-dynarec_local] + eor r2, r2, #3 + strb r0, [r2, r3, lsl #2] + b .E12 + .size write_rdramb_new, .-write_rdramb_new + .align 2 + .global write_rdramh_new + .hidden write_rdramh_new + .type write_rdramh_new, %function +write_rdramh_new: + ldr r3, [fp, #ram_offset-dynarec_local] + ldr r2, [fp, #address-dynarec_local] + ldrh r0, [fp, #hword-dynarec_local] + eor r2, r2, #2 + lsl r3, r3, #2 + strh r0, [r2, r3] + b .E12 + .size write_rdramh_new, .-write_rdramh_new + .align 2 + .global write_rdramd_new + .hidden write_rdramd_new + .type write_rdramd_new, %function +write_rdramd_new: + ldr r3, [fp, #ram_offset-dynarec_local] + ldr r2, [fp, #address-dynarec_local] +/* ldrd r0, [fp, #dword-dynarec_local]*/ + ldr r0, [fp, #dword-dynarec_local] + ldr r1, [fp, #dword+4-dynarec_local] + add r3, r2, r3, lsl #2 + str r0, [r3, #4] + str r1, [r3] + b .E12 + .size write_rdramd_new, .-write_rdramd_new + .align 2 + .type do_invalidate, %function +do_invalidate: + ldr r2, [fp, #address-dynarec_local] +.E12: + ldr r1, [fp, #invc_ptr-dynarec_local] + lsr r0, r2, #12 + ldrb r2, [r1, r0] + tst r2, r2 + beq invalidate_block + mov pc, lr + .size do_invalidate, .-do_invalidate + .align 2 + .global read_nomem_new + .hidden read_nomem_new + .type read_nomem_new, %function +read_nomem_new: + ldr r2, [fp, #address-dynarec_local] + add r12, fp, #memory_map-dynarec_local + lsr r0, r2, #12 + ldr r12, [r12, r0, lsl #2] + mov r1, #8 + tst r12, r12 + bmi tlb_exception + ldr r0, [r2, r12, lsl #2] + str r0, [fp, #readmem_dword-dynarec_local] + mov pc, lr + .size read_nomem_new, .-read_nomem_new + .align 2 + .global read_nomemb_new + .hidden read_nomemb_new + .type read_nomemb_new, %function +read_nomemb_new: + ldr r2, [fp, #address-dynarec_local] + add r12, fp, #memory_map-dynarec_local + lsr r0, r2, #12 + ldr r12, [r12, r0, lsl #2] + mov r1, #8 + tst r12, r12 + bmi tlb_exception + eor r2, r2, #3 + ldrb r0, [r2, r12, lsl #2] + str r0, [fp, #readmem_dword-dynarec_local] + mov pc, lr + .size read_nomemb_new, .-read_nomemb_new + .align 2 + .global read_nomemh_new + .hidden read_nomemh_new + .type read_nomemh_new, %function +read_nomemh_new: + ldr r2, [fp, #address-dynarec_local] + add r12, fp, #memory_map-dynarec_local + lsr r0, r2, #12 + ldr r12, [r12, r0, lsl #2] + mov r1, #8 + tst r12, r12 + bmi tlb_exception + lsl r12, r12, #2 + eor r2, r2, #2 + ldrh r0, [r2, r12] + str r0, [fp, #readmem_dword-dynarec_local] + mov pc, lr + .size read_nomemh_new, .-read_nomemh_new + .align 2 + .global read_nomemd_new + .hidden read_nomemd_new + .type read_nomemd_new, %function +read_nomemd_new: + ldr r2, [fp, #address-dynarec_local] + add r12, fp, #memory_map-dynarec_local + lsr r0, r2, #12 + ldr r12, [r12, r0, lsl #2] + mov r1, #8 + tst r12, r12 + bmi tlb_exception + lsl r12, r12, #2 +/* ldrd r0, [r2, r12]*/ + add r3, r2, #4 + ldr r0, [r2, r12] + ldr r1, [r3, r12] + str r0, [fp, #readmem_dword+4-dynarec_local] + str r1, [fp, #readmem_dword-dynarec_local] + mov pc, lr + .size read_nomemd_new, .-read_nomemd_new + .align 2 + .global write_nomem_new + .hidden write_nomem_new + .type write_nomem_new, %function +write_nomem_new: + str r3, [fp, #24] + str lr, [fp, #28] + bl do_invalidate + ldr r2, [fp, #address-dynarec_local] + add r12, fp, #memory_map-dynarec_local + ldr lr, [fp, #28] + lsr r0, r2, #12 + ldr r3, [fp, #24] + ldr r12, [r12, r0, lsl #2] + mov r1, #0xc + tst r12, #0x40000000 + bne tlb_exception + ldr r0, [fp, #word-dynarec_local] + str r0, [r2, r12, lsl #2] + mov pc, lr + .size write_nomem_new, .-write_nomem_new + .align 2 + .global write_nomemb_new + .hidden write_nomemb_new + .type write_nomemb_new, %function +write_nomemb_new: + str r3, [fp, #24] + str lr, [fp, #28] + bl do_invalidate + ldr r2, [fp, #address-dynarec_local] + add r12, fp, #memory_map-dynarec_local + ldr lr, [fp, #28] + lsr r0, r2, #12 + ldr r3, [fp, #24] + ldr r12, [r12, r0, lsl #2] + mov r1, #0xc + tst r12, #0x40000000 + bne tlb_exception + eor r2, r2, #3 + ldrb r0, [fp, #cpu_byte-dynarec_local] + strb r0, [r2, r12, lsl #2] + mov pc, lr + .size write_nomemb_new, .-write_nomemb_new + .align 2 + .global write_nomemh_new + .hidden write_nomemh_new + .type write_nomemh_new, %function +write_nomemh_new: + str r3, [fp, #24] + str lr, [fp, #28] + bl do_invalidate + ldr r2, [fp, #address-dynarec_local] + add r12, fp, #memory_map-dynarec_local + ldr lr, [fp, #28] + lsr r0, r2, #12 + ldr r3, [fp, #24] + ldr r12, [r12, r0, lsl #2] + mov r1, #0xc + lsls r12, #2 + bcs tlb_exception + eor r2, r2, #2 + ldrh r0, [fp, #hword-dynarec_local] + strh r0, [r2, r12] + mov pc, lr + .size write_nomemh_new, .-write_nomemh_new + .align 2 + .global write_nomemd_new + .hidden write_nomemd_new + .type write_nomemd_new, %function +write_nomemd_new: + str r3, [fp, #24] + str lr, [fp, #28] + bl do_invalidate + ldr r2, [fp, #address-dynarec_local] + add r12, fp, #memory_map-dynarec_local + ldr lr, [fp, #28] + lsr r0, r2, #12 + ldr r3, [fp, #24] + ldr r12, [r12, r0, lsl #2] + mov r1, #0xc + lsls r12, #2 + bcs tlb_exception + add r3, r2, #4 + ldr r0, [fp, #dword+4-dynarec_local] + ldr r1, [fp, #dword-dynarec_local] +/* strd r0, [r2, r12]*/ + str r0, [r2, r12] + str r1, [r3, r12] + mov pc, lr + .size write_nomemd_new, .-write_nomemd_new + .align 2 + .type tlb_exception, %function +tlb_exception: + /* r1 = cause */ + /* r2 = address */ + /* r3 = instr addr/flags */ + ldr r4, [fp, #reg_cop0+48-dynarec_local] /* Status */ + add r5, fp, #memory_map-dynarec_local + lsr r6, r3, #12 + orr r1, r1, r3, lsl #31 + orr r4, r4, #2 + ldr r7, [r5, r6, lsl #2] + bic r8, r3, #3 + str r4, [fp, #reg_cop0+48-dynarec_local] /* Status */ + mov r6, #0x6000000 + str r1, [fp, #reg_cop0+52-dynarec_local] /* Cause */ + orr r6, r6, #0x22 + ldr r0, [r8, r7, lsl #2] + add r4, r8, r1, asr #29 + add r5, fp, #reg-dynarec_local + str r4, [fp, #reg_cop0+56-dynarec_local] /* EPC */ + mov r7, #0xf8 + ldr r8, [fp, #reg_cop0+16-dynarec_local] /* Context */ + lsl r1, r0, #16 + lsr r4, r0, #26 + and r7, r7, r0, lsr #18 + mvn r9, #0xF000000F + sub r2, r2, r1, asr #16 + bic r9, r9, #0x0F800000 + rors r6, r6, r4 + mov r0, #0x80000000 + ldrcs r2, [r5, r7] + bic r8, r8, r9 + tst r3, #2 + str r2, [r5, r7] + add r4, r2, r1, asr #16 + add r6, fp, #reg+4-dynarec_local + asr r3, r2, #31 + str r4, [fp, #reg_cop0+32-dynarec_local] /* BadVAddr */ + add r0, r0, #0x180 + and r4, r9, r4, lsr #9 + strne r3, [r6, r7] + orr r8, r8, r4 + str r8, [fp, #reg_cop0+16-dynarec_local] /* Context */ + bl get_addr_ht + ldr r1, [fp, #next_interupt-dynarec_local] + ldr r10, [fp, #reg_cop0+36-dynarec_local] /* Count */ + str r1, [fp, #last_count-dynarec_local] + sub r10, r10, r1 + mov pc, r0 + .size tlb_exception, .-tlb_exception + .align 2 + .global breakpoint + .hidden breakpoint + .type breakpoint, %function +breakpoint: + /* Set breakpoint here for debugging */ + mov pc, lr + .size breakpoint, .-breakpoint +/* The following bug-fix implements __clear_cache (missing in Android) */ + .align 2 + .global __clear_cache_bugfix + .hidden __clear_cache_bugfix + .type __clear_cache_bugfix, %function +__clear_cache_bugfix: + push {r7, lr} + mov r2, #0 + mov r7, #0x2 + add r7, r7, #0xf0000 + svc 0x00000000 + pop {r7, pc} + .size __clear_cache_bugfix, .-__clear_cache_bugfix +/* End of bug-fix */ + .section .note.GNU-stack,"",%progbits diff --git a/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/linkage_x86.S b/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/linkage_x86.S new file mode 100644 index 0000000000..cb5640f92a --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/linkage_x86.S @@ -0,0 +1,929 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - linkage_x86.s * + * Copyright (C) 2009-2011 Ari64 * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + .file "linkage_x86.s" + .bss + .align 4 + + .section .rodata + .text +.globl dyna_linker + .hidden dyna_linker + .type dyna_linker, @function +dyna_linker: + /* eax = virtual target address */ + /* ebx = instruction to patch */ + mov %eax, %edi + mov %eax, %ecx + shr $12, %edi + cmp $0xC0000000, %eax + cmovge tlb_LUT_r(,%edi,4), %ecx + test %ecx, %ecx + cmovz %eax, %ecx + xor $0x80000000, %ecx + mov $2047, %edx + shr $12, %ecx + and %ecx, %edx + or $2048, %edx + cmp %edx, %ecx + cmova %edx, %ecx + /* jump_in lookup */ + mov jump_in(,%ecx,4), %edx +.A1: + test %edx, %edx + je .A3 + mov (%edx), %edi + xor %eax, %edi + or 4(%edx), %edi + je .A2 + movl 12(%edx), %edx + jmp .A1 +.A2: + mov (%ebx), %edi + mov %esi, %ebp + lea 4(%ebx,%edi,1), %esi + mov %eax, %edi + pusha + call add_link + popa + mov 8(%edx), %edi + mov %ebp, %esi + lea -4(%edi), %edx + subl %ebx, %edx + movl %edx, (%ebx) + jmp *%edi +.A3: + /* hash_table lookup */ + mov %eax, %edi + mov %eax, %edx + shr $16, %edi + shr $12, %edx + xor %eax, %edi + and $2047, %edx + movzwl %di, %edi + shl $4, %edi + cmp $2048, %ecx + cmovc %edx, %ecx + cmp hash_table(%edi), %eax + jne .A5 +.A4: + mov hash_table+4(%edi), %edx + jmp *%edx +.A5: + cmp hash_table+8(%edi), %eax + lea 8(%edi), %edi + je .A4 + /* jump_dirty lookup */ + mov jump_dirty(,%ecx,4), %edx +.A6: + testl %edx, %edx + je .A8 + mov (%edx), %ecx + xor %eax, %ecx + or 4(%edx), %ecx + je .A7 + movl 12(%edx), %edx + jmp .A6 +.A7: + mov 8(%edx), %edx + /* hash_table insert */ + mov hash_table-8(%edi), %ebx + mov hash_table-4(%edi), %ecx + mov %eax, hash_table-8(%edi) + mov %edx, hash_table-4(%edi) + mov %ebx, hash_table(%edi) + mov %ecx, hash_table+4(%edi) + jmp *%edx +.A8: + mov %eax, %edi + pusha + call new_recompile_block + test %eax, %eax + popa + je dyna_linker + /* pagefault */ + mov %eax, %ebx + mov $0x08, %ecx + .size dyna_linker, .-dyna_linker + + .type exec_pagefault, @function +exec_pagefault: + /* eax = instruction pointer */ + /* ebx = fault address */ + /* ecx = cause */ + mov reg_cop0+48, %edx + add $-12, %esp + mov reg_cop0+16, %edi + or $2, %edx + mov %ebx, reg_cop0+32 /* BadVAddr */ + and $0xFF80000F, %edi + mov %edx, reg_cop0+48 /* Status */ + mov %ecx, reg_cop0+52 /* Cause */ + mov %eax, reg_cop0+56 /* EPC */ + mov %ebx, %ecx + shr $9, %ebx + and $0xFFFFE000, %ecx + and $0x007FFFF0, %ebx + mov %ecx, reg_cop0+40 /* EntryHI */ + or %ebx, %edi + mov %edi, reg_cop0+16 /* Context */ + push $0x80000000 + call get_addr_ht + add $16, %esp + jmp *%eax + .size exec_pagefault, .-exec_pagefault + +/* Special dynamic linker for the case where a page fault + may occur in a branch delay slot */ +.globl dyna_linker_ds + .hidden dyna_linker_ds + .type dyna_linker_ds, @function +dyna_linker_ds: + mov %eax, %edi + mov %eax, %ecx + shr $12, %edi + cmp $0xC0000000, %eax + cmovge tlb_LUT_r(,%edi,4), %ecx + test %ecx, %ecx + cmovz %eax, %ecx + xor $0x80000000, %ecx + mov $2047, %edx + shr $12, %ecx + and %ecx, %edx + or $2048, %edx + cmp %edx, %ecx + cmova %edx, %ecx + /* jump_in lookup */ + mov jump_in(,%ecx,4), %edx +.B1: + test %edx, %edx + je .B3 + mov (%edx), %edi + xor %eax, %edi + or 4(%edx), %edi + je .B2 + movl 12(%edx), %edx + jmp .B1 +.B2: + mov (%ebx), %edi + mov %esi, %ecx + lea 4(%ebx,%edi,1), %esi + mov %eax, %edi + pusha + call add_link + popa + mov 8(%edx), %edi + mov %ecx, %esi + lea -4(%edi), %edx + subl %ebx, %edx + movl %edx, (%ebx) + jmp *%edi +.B3: + /* hash_table lookup */ + mov %eax, %edi + mov %eax, %edx + shr $16, %edi + shr $12, %edx + xor %eax, %edi + and $2047, %edx + movzwl %di, %edi + shl $4, %edi + cmp $2048, %ecx + cmovc %edx, %ecx + cmp hash_table(%edi), %eax + jne .B5 +.B4: + mov hash_table+4(%edi), %edx + jmp *%edx +.B5: + cmp hash_table+8(%edi), %eax + lea 8(%edi), %edi + je .B4 + /* jump_dirty lookup */ + mov jump_dirty(,%ecx,4), %edx +.B6: + testl %edx, %edx + je .B8 + mov (%edx), %ecx + xor %eax, %ecx + or 4(%edx), %ecx + je .B7 + movl 12(%edx), %edx + jmp .B6 +.B7: + mov 8(%edx), %edx + /* hash_table insert */ + mov hash_table-8(%edi), %ebx + mov hash_table-4(%edi), %ecx + mov %eax, hash_table-8(%edi) + mov %edx, hash_table-4(%edi) + mov %ebx, hash_table(%edi) + mov %ecx, hash_table+4(%edi) + jmp *%edx +.B8: + mov %eax, %edi + and $0xFFFFFFF8, %edi + inc %edi + pusha + call new_recompile_block + test %eax, %eax + popa + je dyna_linker_ds + /* pagefault */ + and $0xFFFFFFF8, %eax + mov $0x80000008, %ecx /* High bit set indicates pagefault in delay slot */ + mov %eax, %ebx + sub $4, %eax + jmp exec_pagefault + .size dyna_linker_ds, .-dyna_linker_ds + +.globl jump_vaddr_eax + .hidden jump_vaddr_eax + .type jump_vaddr_eax, @function +jump_vaddr_eax: + mov %eax, %edi + jmp jump_vaddr_edi + .size jump_vaddr_eax, .-jump_vaddr_eax +.globl jump_vaddr_ecx + .hidden jump_vaddr_ecx + .type jump_vaddr_ecx, @function +jump_vaddr_ecx: + mov %ecx, %edi + jmp jump_vaddr_edi + .size jump_vaddr_ecx, .-jump_vaddr_ecx +.globl jump_vaddr_edx + .hidden jump_vaddr_edx + .type jump_vaddr_edx, @function +jump_vaddr_edx: + mov %edx, %edi + jmp jump_vaddr_edi + .size jump_vaddr_edx, .-jump_vaddr_edx +.globl jump_vaddr_ebx + .hidden jump_vaddr_ebx + .type jump_vaddr_ebx, @function +jump_vaddr_ebx: + mov %ebx, %edi + jmp jump_vaddr_edi + .size jump_vaddr_ebx, .-jump_vaddr_ebx +.globl jump_vaddr_ebp + .hidden jump_vaddr_ebp + .type jump_vaddr_ebp, @function +jump_vaddr_ebp: + mov %ebp, %edi + .size jump_vaddr_ebp, .-jump_vaddr_ebp +.globl jump_vaddr_edi + .hidden jump_vaddr_edi + .type jump_vaddr_edi, @function +jump_vaddr_edi: + mov %edi, %eax + .size jump_vaddr_edi, .-jump_vaddr_edi + + .type jump_vaddr, @function +jump_vaddr: + /* Check hash table */ + shr $16, %eax + xor %edi, %eax + movzwl %ax, %eax + shl $4, %eax + cmp hash_table(%eax), %edi + jne .C2 +.C1: + mov hash_table+4(%eax), %edi + jmp *%edi +.C2: + cmp hash_table+8(%eax), %edi + lea 8(%eax), %eax + je .C1 + /* No hit on hash table, call compiler */ + add $-12, %esp + push %edi + mov %esi, cycle_count /* CCREG */ + call get_addr + mov cycle_count, %esi + add $16, %esp + jmp *%eax + .size jump_vaddr, .-jump_vaddr + +.globl verify_code_ds + .hidden verify_code_ds + .type verify_code_ds, @function +verify_code_ds: + mov %ebp, branch_target + .size verify_code_ds, .-verify_code_ds + +.globl verify_code_vm + .hidden verify_code_vm + .type verify_code_vm, @function +verify_code_vm: + /* eax = source (virtual address) */ + /* ebx = target */ + /* ecx = length */ + cmp $0xC0000000, %eax + jl verify_code + mov %eax, %edx + lea -1(%eax,%ecx,1), %ebp + shr $12, %edx + shr $12, %ebp + mov memory_map(,%edx,4), %edi + test %edi, %edi + js .D5 + lea (%eax,%edi,4), %eax +.D1: + xor memory_map(,%edx,4), %edi + shl $2, %edi + jne .D5 + mov memory_map(,%edx,4), %edi + inc %edx + cmp %ebp, %edx + jbe .D1 + .size verify_code_vm, .-verify_code_vm + +.globl verify_code + .hidden verify_code + .type verify_code, @function +verify_code: + /* eax = source */ + /* ebx = target */ + /* ecx = length */ + mov -4(%eax,%ecx,1), %edi + xor -4(%ebx,%ecx,1), %edi + jne .D5 + mov %ecx, %edx + add $-4, %ecx + je .D3 + test $4, %edx + cmove %edx, %ecx + mov %esi, cycle_count +.D2: + mov -4(%eax,%ecx,1), %edx + mov -4(%ebx,%ecx,1), %ebp + mov -8(%eax,%ecx,1), %esi + xor %edx, %ebp + mov -8(%ebx,%ecx,1), %edi + jne .D4 + xor %esi, %edi + jne .D4 + add $-8, %ecx + jne .D2 + mov cycle_count, %esi + mov branch_target, %ebp +.D3: + ret +.D4: + mov cycle_count, %esi +.D5: + mov branch_target, %ebp + push %esi /* for stack alignment, unused */ + push 8(%esp) + call get_addr + add $16, %esp /* pop stack */ + jmp *%eax + .size verify_code, .-verify_code + +.globl cc_interrupt + .hidden cc_interrupt + .type cc_interrupt, @function +cc_interrupt: + add last_count, %esi + add $-28, %esp /* Align stack */ + mov %esi, reg_cop0+36 /* Count */ + shr $19, %esi + movl $0, pending_exception + and $0x7f, %esi + cmpl $0, restore_candidate(,%esi,4) + jne .E4 +.E1: + call gen_interupt + mov reg_cop0+36, %esi + mov next_interupt, %eax + mov pending_exception, %ebx + mov stop, %ecx + add $28, %esp + mov %eax, last_count + sub %eax, %esi + test %ecx, %ecx + jne .E3 + test %ebx, %ebx + jne .E2 + ret +.E2: + add $-8, %esp + mov pcaddr, %edi + mov %esi, cycle_count /* CCREG */ + push %edi + call get_addr_ht + mov cycle_count, %esi + add $16, %esp + jmp *%eax +.E3: + add $16, %esp /* pop stack */ + pop %edi /* restore edi */ + pop %esi /* restore esi */ + pop %ebx /* restore ebx */ + pop %ebp /* restore ebp */ + ret /* exit dynarec */ +.E4: + /* Move 'dirty' blocks to the 'clean' list */ + mov restore_candidate(,%esi,4), %ebx + mov %esi, %ebp + movl $0, restore_candidate(,%esi,4) + shl $5, %ebp +.E5: + shr $1, %ebx + jnc .E6 + mov %ebp, (%esp) + call clean_blocks +.E6: + inc %ebp + test $31, %ebp + jne .E5 + jmp .E1 + .size cc_interrupt, .-cc_interrupt + +.globl do_interrupt + .hidden do_interrupt + .type do_interrupt, @function +do_interrupt: + mov pcaddr, %edi + add $-12, %esp + push %edi + call get_addr_ht + add $16, %esp + mov reg_cop0+36, %esi + mov next_interupt, %ebx + mov %ebx, last_count + sub %ebx, %esi + add $2, %esi + jmp *%eax + .size do_interrupt, .-do_interrupt + +.globl fp_exception + .hidden fp_exception + .type fp_exception, @function +fp_exception: + mov $0x1000002c, %edx +.E7: + mov reg_cop0+48, %ebx + add $-12, %esp + or $2, %ebx + mov %ebx, reg_cop0+48 /* Status */ + mov %edx, reg_cop0+52 /* Cause */ + mov %eax, reg_cop0+56 /* EPC */ + push $0x80000180 + call get_addr_ht + add $16, %esp + jmp *%eax + .size fp_exception, .-fp_exception + +.globl fp_exception_ds + .hidden fp_exception_ds + .type fp_exception_ds, @function +fp_exception_ds: + mov $0x9000002c, %edx /* Set high bit if delay slot */ + jmp .E7 + .size fp_exception_ds, .-fp_exception_ds + +.globl jump_syscall + .hidden jump_syscall + .type jump_syscall, @function +jump_syscall: + mov $0x20, %edx + mov reg_cop0+48, %ebx + add $-12, %esp + or $2, %ebx + mov %ebx, reg_cop0+48 /* Status */ + mov %edx, reg_cop0+52 /* Cause */ + mov %eax, reg_cop0+56 /* EPC */ + push $0x80000180 + call get_addr_ht + mov $16, %esp + jmp *%eax + .size jump_syscall, .-jump_syscall + +.globl jump_eret + .hidden jump_eret + .type jump_eret, @function +jump_eret: + mov reg_cop0+48, %ebx /* Status */ + add last_count, %esi + and $0xFFFFFFFD, %ebx + mov %esi, reg_cop0+36 /* Count */ + mov %ebx, reg_cop0+48 /* Status */ + call check_interupt + mov next_interupt, %eax + mov reg_cop0+36, %esi + mov %eax, last_count + sub %eax, %esi + mov reg_cop0+56, %eax /* EPC */ + jns .E11 +.E8: + mov $248, %ebx + xor %edi, %edi +.E9: + mov reg(%ebx), %ecx + mov reg+4(%ebx), %edx + sar $31, %ecx + xor %ecx, %edx + neg %edx + adc %edi, %edi + sub $8, %ebx + jne .E9 + mov hi(%ebx), %ecx + mov hi+4(%ebx), %edx + sar $31, %ecx + xor %ecx, %edx + jne .E10 + mov lo(%ebx), %ecx + mov lo+4(%ebx), %edx + sar $31, %ecx + xor %ecx, %edx +.E10: + neg %edx + adc %edi, %edi + add $-8, %esp + push %edi + push %eax + mov %esi, cycle_count + call get_addr_32 + mov cycle_count, %esi + add $16, %esp + jmp *%eax +.E11: + mov %eax, pcaddr + call cc_interrupt + mov pcaddr, %eax + jmp .E8 + .size jump_eret, .-jump_eret + +.globl new_dyna_start + .hidden new_dyna_start + .type new_dyna_start, @function +new_dyna_start: + push %ebp + push %ebx + push %esi + push %edi + add $-8, %esp /* align stack */ + push $0xa4000040 + call new_recompile_block + movl next_interupt, %edi + movl reg_cop0+36, %esi + movl %edi, last_count + subl %edi, %esi + jmp *base_addr + .size new_dyna_start, .-new_dyna_start + +/* Note: Assumes %ebx, %ebp, %esi, %edi are callee-saved */ +.globl invalidate_block_eax + .hidden invalidate_block_eax + .type invalidate_block_eax, @function +invalidate_block_eax: + push %eax + push %ecx + push %edx + push %eax + jmp invalidate_block_call + .size invalidate_block_eax, .-invalidate_block_eax +.globl invalidate_block_ecx + .hidden invalidate_block_ecx + .type invalidate_block_ecx, @function +invalidate_block_ecx: + push %eax + push %ecx + push %edx + push %ecx + jmp invalidate_block_call + .size invalidate_block_ecx, .-invalidate_block_ecx +.globl invalidate_block_edx + .hidden invalidate_block_edx + .type invalidate_block_edx, @function +invalidate_block_edx: + push %eax + push %ecx + push %edx + push %edx + jmp invalidate_block_call + .size invalidate_block_edx, .-invalidate_block_edx +.globl invalidate_block_ebx + .hidden invalidate_block_ebx + .type invalidate_block_ebx, @function +invalidate_block_ebx: + push %eax + push %ecx + push %edx + push %ebx + jmp invalidate_block_call + .size invalidate_block_ebx, .-invalidate_block_ebx +.globl invalidate_block_ebp + .hidden invalidate_block_ebp + .type invalidate_block_ebp, @function +invalidate_block_ebp: + push %eax + push %ecx + push %edx + push %ebp + jmp invalidate_block_call + .size invalidate_block_ebp, .-invalidate_block_ebp +.globl invalidate_block_esi + .hidden invalidate_block_esi + .type invalidate_block_esi, @function +invalidate_block_esi: + push %eax + push %ecx + push %edx + push %esi + jmp invalidate_block_call + .size invalidate_block_esi, .-invalidate_block_esi +.globl invalidate_block_edi + .hidden invalidate_block_edi + .type invalidate_block_edi, @function +invalidate_block_edi: + push %eax + push %ecx + push %edx + push %edi + .size invalidate_block_edi, .-invalidate_block_edi + + .type invalidate_block_call, @function +invalidate_block_call: + call invalidate_block + pop %eax /* Throw away */ + pop %edx + pop %ecx + pop %eax + ret + .size invalidate_block_call, .-invalidate_block_call + +.globl write_rdram_new + .hidden write_rdram_new + .type write_rdram_new, @function +write_rdram_new: + mov address, %edi + mov word, %ecx + mov %ecx, rdram-0x80000000(%edi) + jmp .E12 + .size write_rdram_new, .-write_rdram_new + +.globl write_rdramb_new + .hidden write_rdramb_new + .type write_rdramb_new, @function +write_rdramb_new: + mov address, %edi + xor $3, %edi + movb cpu_byte, %cl + movb %cl, rdram-0x80000000(%edi) + jmp .E12 + .size write_rdramb_new, .-write_rdramb_new + +.globl write_rdramh_new + .hidden write_rdramh_new + .type write_rdramh_new, @function +write_rdramh_new: + mov address, %edi + xor $2, %edi + movw hword, %cx + movw %cx, rdram-0x80000000(%edi) + jmp .E12 + .size write_rdramh_new, .-write_rdramh_new + +.globl write_rdramd_new + .hidden write_rdramd_new + .type write_rdramd_new, @function +write_rdramd_new: + mov address, %edi + mov dword+4, %ecx + mov dword, %edx + mov %ecx, rdram-0x80000000(%edi) + mov %edx, rdram-0x80000000+4(%edi) + jmp .E12 + .size write_rdramd_new, .-write_rdramd_new + + .type do_invalidate, @function +do_invalidate: + mov address, %edi + mov %edi, %ebx /* Return ebx to caller */ +.E12: + shr $12, %edi + cmpb $1, invalid_code(%edi) + je .E13 + push %edi + call invalidate_block + pop %edi +.E13: + ret + .size do_invalidate, .-do_invalidate + +.globl read_nomem_new + .hidden read_nomem_new + .type read_nomem_new, @function +read_nomem_new: + mov address, %edi + mov %edi, %ebx + shr $12, %edi + mov memory_map(,%edi,4),%edi + mov $0x8, %eax + test %edi, %edi + js tlb_exception + mov (%ebx,%edi,4), %ecx + mov %ecx, readmem_dword + ret + .size read_nomem_new, .-read_nomem_new + +.globl read_nomemb_new + .hidden read_nomemb_new + .type read_nomemb_new, @function +read_nomemb_new: + mov address, %edi + mov %edi, %ebx + shr $12, %edi + mov memory_map(,%edi,4),%edi + mov $0x8, %eax + test %edi, %edi + js tlb_exception + xor $3, %ebx + movzbl (%ebx,%edi,4), %ecx + mov %ecx, readmem_dword + ret + .size read_nomemb_new, .-read_nomemb_new + +.globl read_nomemh_new + .hidden read_nomemh_new + .type read_nomemh_new, @function +read_nomemh_new: + mov address, %edi + mov %edi, %ebx + shr $12, %edi + mov memory_map(,%edi,4),%edi + mov $0x8, %eax + test %edi, %edi + js tlb_exception + xor $2, %ebx + movzwl (%ebx,%edi,4), %ecx + mov %ecx, readmem_dword + ret + .size read_nomemh_new, .-read_nomemh_new + +.globl read_nomemd_new + .hidden read_nomemd_new + .type read_nomemd_new, @function +read_nomemd_new: + mov address, %edi + mov %edi, %ebx + shr $12, %edi + mov memory_map(,%edi,4),%edi + mov $0x8, %eax + test %edi, %edi + js tlb_exception + mov 4(%ebx,%edi,4), %ecx + mov (%ebx,%edi,4), %edx + mov %ecx, readmem_dword + mov %edx, readmem_dword+4 + ret + .size read_nomemd_new, .-read_nomemd_new + +.globl write_nomem_new + .hidden write_nomem_new + .type write_nomem_new, @function +write_nomem_new: + call do_invalidate + mov memory_map(,%edi,4),%edi + mov word, %ecx + mov $0xc, %eax + shl $2, %edi + jc tlb_exception + mov %ecx, (%ebx,%edi) + ret + .size write_nomem_new, .-write_nomem_new + +.globl write_nomemb_new + .hidden write_nomemb_new + .type write_nomemb_new, @function +write_nomemb_new: + call do_invalidate + mov memory_map(,%edi,4),%edi + movb cpu_byte, %cl + mov $0xc, %eax + shl $2, %edi + jc tlb_exception + xor $3, %ebx + movb %cl, (%ebx,%edi) + ret + .size write_nomemb_new, .-write_nomemb_new + +.globl write_nomemh_new + .hidden write_nomemh_new + .type write_nomemh_new, @function +write_nomemh_new: + call do_invalidate + mov memory_map(,%edi,4),%edi + movw hword, %cx + mov $0xc, %eax + shl $2, %edi + jc tlb_exception + xor $2, %ebx + movw %cx, (%ebx,%edi) + ret + .size write_nomemh_new, .-write_nomemh_new + +.globl write_nomemd_new + .hidden write_nomemd_new + .type write_nomemd_new, @function +write_nomemd_new: + call do_invalidate + mov memory_map(,%edi,4),%edi + mov dword+4, %edx + mov dword, %ecx + mov $0xc, %eax + shl $2, %edi + jc tlb_exception + mov %edx, (%ebx,%edi) + mov %ecx, 4(%ebx,%edi) + ret + .size write_nomemd_new, .-write_nomemd_new + + .type tlb_exception, @function +tlb_exception: + /* eax = cause */ + /* ebx = address */ + /* ebp = instr addr + flags */ + mov 0x24(%esp), %ebp +/* Debug: + push %ebp + push %ebx + push %eax + call tlb_debug + pop %eax + pop %ebx + pop %ebp +/* end debug */ + mov reg_cop0+48, %esi + mov %ebp, %ecx + mov %ebp, %edx + mov %ebp, %edi + shl $31, %ebp + shr $12, %ecx + or %ebp, %eax + sar $29, %ebp + and $0xFFFFFFFC, %edx + mov memory_map(,%ecx,4), %ecx + or $2, %esi + mov (%edx, %ecx, 4), %ecx + add %ebp, %edx + mov %esi, reg_cop0+48 /* Status */ + mov %eax, reg_cop0+52 /* Cause */ + mov %edx, reg_cop0+56 /* EPC */ + add $0x24, %esp + mov $0x6000022, %edx + mov %ecx, %ebp + movswl %cx, %eax + shr $26, %ecx + shr $21, %ebp + sub %eax, %ebx + and $0x1f, %ebp + ror %cl, %edx + mov reg_cop0+16, %esi + cmovc reg(,%ebp,8), %ebx + and $0xFF80000F, %esi + mov %ebx, reg(,%ebp,8) + add %ebx, %eax + sar $31, %ebx + mov %eax, reg_cop0+32 /* BadVAddr */ + shr $9, %eax + test $2, %edi + cmove reg+4(,%ebp,8), %ebx + add $-12, %esp + and $0x007FFFF0, %eax + mov %ebx, reg+4(,%ebp,8) + push $0x80000180 + or %eax, %esi + mov %esi, reg_cop0+16 /* Context */ + call get_addr_ht + add $16, %esp + movl next_interupt, %edi + movl reg_cop0+36, %esi /* Count */ + movl %edi, last_count + subl %edi, %esi + jmp *%eax + .size tlb_exception, .-tlb_exception + +.globl breakpoint + .hidden breakpoint + .type breakpoint, @function +breakpoint: + .size breakpoint, .-breakpoint diff --git a/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/new_dynarec.c b/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/new_dynarec.c new file mode 100644 index 0000000000..8ee4eda2fd --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/new_dynarec.c @@ -0,0 +1,11065 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - new_dynarec.c * + * Copyright (C) 2009-2011 Ari64 * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include +#include +#include //include for uint64_t +#include + +#include "../recomp.h" +#include "../recomph.h" //include for function prototypes +#include "../macros.h" +#include "../r4300.h" +#include "../ops.h" +#include "../interupt.h" +#include "new_dynarec.h" + +#include "../../memory/memory.h" +#include "../../main/rom.h" + +#include + +#if NEW_DYNAREC == NEW_DYNAREC_X86 +#include "assem_x86.h" +#elif NEW_DYNAREC == NEW_DYNAREC_ARM +#include "assem_arm.h" +#else +#error Unsupported dynarec architecture +#endif + +#define MAXBLOCK 4096 +#define MAX_OUTPUT_BLOCK_SIZE 262144 +#define CLOCK_DIVIDER 2 + +void *base_addr; + +struct regstat +{ + signed char regmap_entry[HOST_REGS]; + signed char regmap[HOST_REGS]; + uint64_t was32; + uint64_t is32; + uint64_t wasdirty; + uint64_t dirty; + uint64_t u; + uint64_t uu; + u_int wasconst; + u_int isconst; + uint64_t constmap[HOST_REGS]; +}; + +struct ll_entry +{ + u_int vaddr; + u_int reg32; + void *addr; + struct ll_entry *next; +}; + +static u_int start; +static u_int *source; +static u_int pagelimit; +static char insn[MAXBLOCK][10]; +static u_char itype[MAXBLOCK]; +static u_char opcode[MAXBLOCK]; +static u_char opcode2[MAXBLOCK]; +static u_char bt[MAXBLOCK]; +static u_char rs1[MAXBLOCK]; +static u_char rs2[MAXBLOCK]; +static u_char rt1[MAXBLOCK]; +static u_char rt2[MAXBLOCK]; +static u_char us1[MAXBLOCK]; +static u_char us2[MAXBLOCK]; +static u_char dep1[MAXBLOCK]; +static u_char dep2[MAXBLOCK]; +static u_char lt1[MAXBLOCK]; +static int imm[MAXBLOCK]; +static u_int ba[MAXBLOCK]; +static char likely[MAXBLOCK]; +static char is_ds[MAXBLOCK]; +static char ooo[MAXBLOCK]; +static uint64_t unneeded_reg[MAXBLOCK]; +static uint64_t unneeded_reg_upper[MAXBLOCK]; +static uint64_t branch_unneeded_reg[MAXBLOCK]; +static uint64_t branch_unneeded_reg_upper[MAXBLOCK]; +static uint64_t p32[MAXBLOCK]; +static uint64_t pr32[MAXBLOCK]; +static signed char regmap_pre[MAXBLOCK][HOST_REGS]; +#ifdef ASSEM_DEBUG +static signed char regmap[MAXBLOCK][HOST_REGS]; +static signed char regmap_entry[MAXBLOCK][HOST_REGS]; +#endif +static uint64_t constmap[MAXBLOCK][HOST_REGS]; +static struct regstat regs[MAXBLOCK]; +static struct regstat branch_regs[MAXBLOCK]; +static signed char minimum_free_regs[MAXBLOCK]; +static u_int needed_reg[MAXBLOCK]; +static uint64_t requires_32bit[MAXBLOCK]; +static u_int wont_dirty[MAXBLOCK]; +static u_int will_dirty[MAXBLOCK]; +static int ccadj[MAXBLOCK]; +static int slen; +static u_int instr_addr[MAXBLOCK]; +static u_int link_addr[MAXBLOCK][3]; +static int linkcount; +static u_int stubs[MAXBLOCK*3][8]; +static int stubcount; +static int literalcount; +static int is_delayslot; +static int cop1_usable; +u_char *out; +struct ll_entry *jump_in[4096]; +static struct ll_entry *jump_out[4096]; +struct ll_entry *jump_dirty[4096]; +u_int hash_table[65536][4] __attribute__((aligned(16))); +static char shadow[2097152] __attribute__((aligned(16))); +static void *copy; +static int expirep; +u_int using_tlb; +static u_int stop_after_jal; +extern u_char restore_candidate[512]; +extern int cycle_count; + + /* registers that may be allocated */ + /* 1-31 gpr */ +#define HIREG 32 // hi +#define LOREG 33 // lo +#define FSREG 34 // FPU status (FCSR) +#define CSREG 35 // Coprocessor status +#define CCREG 36 // Cycle count +#define INVCP 37 // Pointer to invalid_code +#define MMREG 38 // Pointer to memory_map +#define ROREG 39 // ram offset (if rdram!=0x80000000) +#define TEMPREG 40 +#define FTEMP 40 // FPU temporary register +#define PTEMP 41 // Prefetch temporary register +#define TLREG 42 // TLB mapping offset +#define RHASH 43 // Return address hash +#define RHTBL 44 // Return address hash table address +#define RTEMP 45 // JR/JALR address register +#define MAXREG 45 +#define AGEN1 46 // Address generation temporary register +#define AGEN2 47 // Address generation temporary register +#define MGEN1 48 // Maptable address generation temporary register +#define MGEN2 49 // Maptable address generation temporary register +#define BTREG 50 // Branch target temporary register + + /* instruction types */ +#define NOP 0 // No operation +#define LOAD 1 // Load +#define STORE 2 // Store +#define LOADLR 3 // Unaligned load +#define STORELR 4 // Unaligned store +#define MOV 5 // Move +#define ALU 6 // Arithmetic/logic +#define MULTDIV 7 // Multiply/divide +#define SHIFT 8 // Shift by register +#define SHIFTIMM 9// Shift by immediate +#define IMM16 10 // 16-bit immediate +#define RJUMP 11 // Unconditional jump to register +#define UJUMP 12 // Unconditional jump +#define CJUMP 13 // Conditional branch (BEQ/BNE/BGTZ/BLEZ) +#define SJUMP 14 // Conditional branch (regimm format) +#define COP0 15 // Coprocessor 0 +#define COP1 16 // Coprocessor 1 +#define C1LS 17 // Coprocessor 1 load/store +#define FJUMP 18 // Conditional branch (floating point) +#define FLOAT 19 // Floating point unit +#define FCONV 20 // Convert integer to float +#define FCOMP 21 // Floating point compare (sets FSREG) +#define SYSCALL 22// SYSCALL +#define OTHER 23 // Other +#define SPAN 24 // Branch/delay slot spans 2 pages +#define NI 25 // Not implemented + + /* stubs */ +#define CC_STUB 1 +#define FP_STUB 2 +#define LOADB_STUB 3 +#define LOADH_STUB 4 +#define LOADW_STUB 5 +#define LOADD_STUB 6 +#define LOADBU_STUB 7 +#define LOADHU_STUB 8 +#define STOREB_STUB 9 +#define STOREH_STUB 10 +#define STOREW_STUB 11 +#define STORED_STUB 12 +#define STORELR_STUB 13 +#define INVCODE_STUB 14 + + /* branch codes */ +#define TAKEN 1 +#define NOTTAKEN 2 +#define NULLDS 3 + +/* bug-fix to implement __clear_cache (missing in Android; http://code.google.com/p/android/issues/detail?id=1803) */ +void __clear_cache_bugfix(char* begin, char *end); +#ifdef ANDROID + #define __clear_cache __clear_cache_bugfix +#endif + +// asm linkage +int new_recompile_block(int addr); +void *get_addr_ht(u_int vaddr); +static void remove_hash(int vaddr); +void dyna_linker(); +void dyna_linker_ds(); +void verify_code(); +void verify_code_vm(); +void verify_code_ds(); +void cc_interrupt(); +void fp_exception(); +void fp_exception_ds(); +void jump_syscall(); +void jump_eret(); +#if NEW_DYNAREC == NEW_DYNAREC_ARM +static void invalidate_addr(u_int addr); +#endif + +// TLB +void TLBWI_new(); +void TLBWR_new(); +void read_nomem_new(); +void read_nomemb_new(); +void read_nomemh_new(); +void read_nomemd_new(); +void write_nomem_new(); +void write_nomemb_new(); +void write_nomemh_new(); +void write_nomemd_new(); +void write_rdram_new(); +void write_rdramb_new(); +void write_rdramh_new(); +void write_rdramd_new(); +extern u_int memory_map[1048576]; + +// Needed by assembler +static void wb_register(signed char r,signed char regmap[],uint64_t dirty,uint64_t is32); +static void wb_dirtys(signed char i_regmap[],uint64_t i_is32,uint64_t i_dirty); +static void wb_needed_dirtys(signed char i_regmap[],uint64_t i_is32,uint64_t i_dirty,int addr); +static void load_all_regs(signed char i_regmap[]); +static void load_needed_regs(signed char i_regmap[],signed char next_regmap[]); +static void load_regs_entry(int t); +static void load_all_consts(signed char regmap[],int is32,u_int dirty,int i); + +static void add_stub(int type,int addr,int retaddr,int a,int b,int c,int d,int e); +static void add_to_linker(int addr,int target,int ext); +static int verify_dirty(void *addr); + +//static int tracedebug=0; + +//#define DEBUG_CYCLE_COUNT 1 + +// Uncomment these two lines to generate debug output: +//#define ASSEM_DEBUG 1 +//#define INV_DEBUG 1 + +// Uncomment this line to output the number of NOTCOMPILED blocks as they occur: +//#define COUNT_NOTCOMPILEDS 1 + +#if defined (COUNT_NOTCOMPILEDS ) + int notcompiledCount = 0; +#endif +static void nullf() {} + +#if defined( ASSEM_DEBUG ) + #define assem_debug(...) DebugMessage(M64MSG_VERBOSE, __VA_ARGS__) +#else + #define assem_debug nullf +#endif +#if defined( INV_DEBUG ) + #define inv_debug(...) DebugMessage(M64MSG_VERBOSE, __VA_ARGS__) +#else + #define inv_debug nullf +#endif + +#define log_message(...) DebugMessage(M64MSG_VERBOSE, __VA_ARGS__) + +static void tlb_hacks() +{ + // Goldeneye hack + if (strncmp((char *) ROM_HEADER.Name, "GOLDENEYE",9) == 0) + { + u_int addr; + int n; + switch (ROM_HEADER.Country_code&0xFF) + { + case 0x45: // U + addr=0x34b30; + break; + case 0x4A: // J + addr=0x34b70; + break; + case 0x50: // E + addr=0x329f0; + break; + default: + // Unknown country code + addr=0; + break; + } + u_int rom_addr=(u_int)rom; + #ifdef ROM_COPY + // Since memory_map is 32-bit, on 64-bit systems the rom needs to be + // in the lower 4G of memory to use this hack. Copy it if necessary. + if((void *)rom>(void *)0xffffffff) { + munmap(ROM_COPY, 67108864); + if(mmap(ROM_COPY, 12582912, + PROT_READ | PROT_WRITE, + MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, + -1, 0) <= 0) {DebugMessage(M64MSG_ERROR, "mmap() failed");} + memcpy(ROM_COPY,rom,12582912); + rom_addr=(u_int)ROM_COPY; + } + #endif + if(addr) { + for(n=0x7F000;n<0x80000;n++) { + memory_map[n]=(((u_int)(rom_addr+addr-0x7F000000))>>2)|0x40000000; + } + } + } +} + +// Get address from virtual address +// This is called from the recompiled JR/JALR instructions +void *get_addr(u_int vaddr) +{ + u_int page=(vaddr^0x80000000)>>12; + u_int vpage=page; + if(page>262143&&tlb_LUT_r[vaddr>>12]) page=(tlb_LUT_r[vaddr>>12]^0x80000000)>>12; + if(page>2048) page=2048+(page&2047); + if(vpage>262143&&tlb_LUT_r[vaddr>>12]) vpage&=2047; // jump_dirty uses a hash of the virtual address instead + if(vpage>2048) vpage=2048+(vpage&2047); + struct ll_entry *head; + //DebugMessage(M64MSG_VERBOSE, "TRACE: count=%d next=%d (get_addr %x,page %d)",Count,next_interupt,vaddr,page); + head=jump_in[page]; + while(head!=NULL) { + if(head->vaddr==vaddr&&head->reg32==0) { + //DebugMessage(M64MSG_VERBOSE, "TRACE: count=%d next=%d (get_addr match %x: %x)",Count,next_interupt,vaddr,(int)head->addr); + u_int *ht_bin=hash_table[((vaddr>>16)^vaddr)&0xFFFF]; + ht_bin[3]=ht_bin[1]; + ht_bin[2]=ht_bin[0]; + ht_bin[1]=(int)head->addr; + ht_bin[0]=vaddr; + return head->addr; + } + head=head->next; + } + head=jump_dirty[vpage]; + while(head!=NULL) { + if(head->vaddr==vaddr&&head->reg32==0) { + //DebugMessage(M64MSG_VERBOSE, "TRACE: count=%d next=%d (get_addr match dirty %x: %x)",Count,next_interupt,vaddr,(int)head->addr); + // Don't restore blocks which are about to expire from the cache + if((((u_int)head->addr-(u_int)out)<<(32-TARGET_SIZE_2))>0x60000000+(MAX_OUTPUT_BLOCK_SIZE<<(32-TARGET_SIZE_2))) + if(verify_dirty(head->addr)) { + //DebugMessage(M64MSG_VERBOSE, "restore candidate: %x (%d) d=%d",vaddr,page,invalid_code[vaddr>>12]); + invalid_code[vaddr>>12]=0; + memory_map[vaddr>>12]|=0x40000000; + if(vpage<2048) { + if(tlb_LUT_r[vaddr>>12]) { + invalid_code[tlb_LUT_r[vaddr>>12]>>12]=0; + memory_map[tlb_LUT_r[vaddr>>12]>>12]|=0x40000000; + } + restore_candidate[vpage>>3]|=1<<(vpage&7); + } + else restore_candidate[page>>3]|=1<<(page&7); + u_int *ht_bin=hash_table[((vaddr>>16)^vaddr)&0xFFFF]; + if(ht_bin[0]==vaddr) { + ht_bin[1]=(int)head->addr; // Replace existing entry + } + else + { + ht_bin[3]=ht_bin[1]; + ht_bin[2]=ht_bin[0]; + ht_bin[1]=(int)head->addr; + ht_bin[0]=vaddr; + } + return head->addr; + } + } + head=head->next; + } + //DebugMessage(M64MSG_VERBOSE, "TRACE: count=%d next=%d (get_addr no-match %x)",Count,next_interupt,vaddr); + int r=new_recompile_block(vaddr); + if(r==0) return get_addr(vaddr); + // Execute in unmapped page, generate pagefault execption + Status|=2; + Cause=(vaddr<<31)|0x8; + EPC=(vaddr&1)?vaddr-5:vaddr; + BadVAddr=(vaddr&~1); + Context=(Context&0xFF80000F)|((BadVAddr>>9)&0x007FFFF0); + EntryHi=BadVAddr&0xFFFFE000; + return get_addr_ht(0x80000000); +} +// Look up address in hash table first +void *get_addr_ht(u_int vaddr) +{ + //DebugMessage(M64MSG_VERBOSE, "TRACE: count=%d next=%d (get_addr_ht %x)",Count,next_interupt,vaddr); + u_int *ht_bin=hash_table[((vaddr>>16)^vaddr)&0xFFFF]; + if(ht_bin[0]==vaddr) return (void *)ht_bin[1]; + if(ht_bin[2]==vaddr) return (void *)ht_bin[3]; + return get_addr(vaddr); +} + +void *get_addr_32(u_int vaddr,u_int flags) +{ + //DebugMessage(M64MSG_VERBOSE, "TRACE: count=%d next=%d (get_addr_32 %x,flags %x)",Count,next_interupt,vaddr,flags); + u_int *ht_bin=hash_table[((vaddr>>16)^vaddr)&0xFFFF]; + if(ht_bin[0]==vaddr) return (void *)ht_bin[1]; + if(ht_bin[2]==vaddr) return (void *)ht_bin[3]; + u_int page=(vaddr^0x80000000)>>12; + u_int vpage=page; + if(page>262143&&tlb_LUT_r[vaddr>>12]) page=(tlb_LUT_r[vaddr>>12]^0x80000000)>>12; + if(page>2048) page=2048+(page&2047); + if(vpage>262143&&tlb_LUT_r[vaddr>>12]) vpage&=2047; // jump_dirty uses a hash of the virtual address instead + if(vpage>2048) vpage=2048+(vpage&2047); + struct ll_entry *head; + head=jump_in[page]; + while(head!=NULL) { + if(head->vaddr==vaddr&&(head->reg32&flags)==0) { + //DebugMessage(M64MSG_VERBOSE, "TRACE: count=%d next=%d (get_addr_32 match %x: %x)",Count,next_interupt,vaddr,(int)head->addr); + if(head->reg32==0) { + u_int *ht_bin=hash_table[((vaddr>>16)^vaddr)&0xFFFF]; + if(ht_bin[0]==-1) { + ht_bin[1]=(int)head->addr; + ht_bin[0]=vaddr; + }else if(ht_bin[2]==-1) { + ht_bin[3]=(int)head->addr; + ht_bin[2]=vaddr; + } + //ht_bin[3]=ht_bin[1]; + //ht_bin[2]=ht_bin[0]; + //ht_bin[1]=(int)head->addr; + //ht_bin[0]=vaddr; + } + return head->addr; + } + head=head->next; + } + head=jump_dirty[vpage]; + while(head!=NULL) { + if(head->vaddr==vaddr&&(head->reg32&flags)==0) { + //DebugMessage(M64MSG_VERBOSE, "TRACE: count=%d next=%d (get_addr_32 match dirty %x: %x)",Count,next_interupt,vaddr,(int)head->addr); + // Don't restore blocks which are about to expire from the cache + if((((u_int)head->addr-(u_int)out)<<(32-TARGET_SIZE_2))>0x60000000+(MAX_OUTPUT_BLOCK_SIZE<<(32-TARGET_SIZE_2))) + if(verify_dirty(head->addr)) { + //DebugMessage(M64MSG_VERBOSE, "restore candidate: %x (%d) d=%d",vaddr,page,invalid_code[vaddr>>12]); + invalid_code[vaddr>>12]=0; + memory_map[vaddr>>12]|=0x40000000; + if(vpage<2048) { + if(tlb_LUT_r[vaddr>>12]) { + invalid_code[tlb_LUT_r[vaddr>>12]>>12]=0; + memory_map[tlb_LUT_r[vaddr>>12]>>12]|=0x40000000; + } + restore_candidate[vpage>>3]|=1<<(vpage&7); + } + else restore_candidate[page>>3]|=1<<(page&7); + if(head->reg32==0) { + u_int *ht_bin=hash_table[((vaddr>>16)^vaddr)&0xFFFF]; + if(ht_bin[0]==-1) { + ht_bin[1]=(int)head->addr; + ht_bin[0]=vaddr; + }else if(ht_bin[2]==-1) { + ht_bin[3]=(int)head->addr; + ht_bin[2]=vaddr; + } + //ht_bin[3]=ht_bin[1]; + //ht_bin[2]=ht_bin[0]; + //ht_bin[1]=(int)head->addr; + //ht_bin[0]=vaddr; + } + return head->addr; + } + } + head=head->next; + } + //DebugMessage(M64MSG_VERBOSE, "TRACE: count=%d next=%d (get_addr_32 no-match %x,flags %x)",Count,next_interupt,vaddr,flags); + int r=new_recompile_block(vaddr); + if(r==0) return get_addr(vaddr); + // Execute in unmapped page, generate pagefault execption + Status|=2; + Cause=(vaddr<<31)|0x8; + EPC=(vaddr&1)?vaddr-5:vaddr; + BadVAddr=(vaddr&~1); + Context=(Context&0xFF80000F)|((BadVAddr>>9)&0x007FFFF0); + EntryHi=BadVAddr&0xFFFFE000; + return get_addr_ht(0x80000000); +} + +static void clear_all_regs(signed char regmap[]) +{ + int hr; + for (hr=0;hrregmap[hr]&63)==reg) { + cur->dirty|=1<dirty>>hr)&1) { + reg=cur->regmap[hr]; + if(reg>=64) + if((cur->is32>>(reg&63))&1) cur->regmap[hr]=-1; + } + } +} + +static void set_const(struct regstat *cur,signed char reg,uint64_t value) +{ + int hr; + if(!reg) return; + for (hr=0;hrregmap[hr]==reg) { + cur->isconst|=1<constmap[hr]=value; + } + else if((cur->regmap[hr]^64)==reg) { + cur->isconst|=1<constmap[hr]=value>>32; + } + } +} + +static void clear_const(struct regstat *cur,signed char reg) +{ + int hr; + if(!reg) return; + for (hr=0;hrregmap[hr]&63)==reg) { + cur->isconst&=~(1<regmap[hr]&63)==reg) { + return (cur->isconst>>hr)&1; + } + } + return 0; +} +static uint64_t get_const(struct regstat *cur,signed char reg) +{ + int hr; + if(!reg) return 0; + for (hr=0;hrregmap[hr]==reg) { + return cur->constmap[hr]; + } + } + DebugMessage(M64MSG_ERROR, "Unknown constant in r%d",reg); + exit(1); +} + +// Least soon needed registers +// Look at the next ten instructions and see which registers +// will be used. Try not to reallocate these. +static void lsn(u_char hsn[], int i, int *preferred_reg) +{ + int j; + int b=-1; + for(j=0;j<9;j++) + { + if(i+j>=slen) { + j=slen-i-1; + break; + } + if(itype[i+j]==UJUMP||itype[i+j]==RJUMP||(source[i+j]>>16)==0x1000) + { + // Don't go past an unconditonal jump + j++; + break; + } + } + for(;j>=0;j--) + { + if(rs1[i+j]) hsn[rs1[i+j]]=j; + if(rs2[i+j]) hsn[rs2[i+j]]=j; + if(rt1[i+j]) hsn[rt1[i+j]]=j; + if(rt2[i+j]) hsn[rt2[i+j]]=j; + if(itype[i+j]==STORE || itype[i+j]==STORELR) { + // Stores can allocate zero + hsn[rs1[i+j]]=j; + hsn[rs2[i+j]]=j; + } + // On some architectures stores need invc_ptr + #if defined(HOST_IMM8) + if(itype[i+j]==STORE || itype[i+j]==STORELR || (opcode[i+j]&0x3b)==0x39) { + hsn[INVCP]=j; + } + #endif + if(i+j>=0&&(itype[i+j]==UJUMP||itype[i+j]==CJUMP||itype[i+j]==SJUMP||itype[i+j]==FJUMP)) + { + hsn[CCREG]=j; + b=j; + } + } + if(b>=0) + { + if(ba[i+b]>=start && ba[i+b]<(start+slen*4)) + { + // Follow first branch + int t=(ba[i+b]-start)>>2; + j=7-b;if(t+j>=slen) j=slen-t-1; + for(;j>=0;j--) + { + if(rs1[t+j]) if(hsn[rs1[t+j]]>j+b+2) hsn[rs1[t+j]]=j+b+2; + if(rs2[t+j]) if(hsn[rs2[t+j]]>j+b+2) hsn[rs2[t+j]]=j+b+2; + //if(rt1[t+j]) if(hsn[rt1[t+j]]>j+b+2) hsn[rt1[t+j]]=j+b+2; + //if(rt2[t+j]) if(hsn[rt2[t+j]]>j+b+2) hsn[rt2[t+j]]=j+b+2; + } + } + // TODO: preferred register based on backward branch + } + // Delay slot should preferably not overwrite branch conditions or cycle count + if(i>0&&(itype[i-1]==RJUMP||itype[i-1]==UJUMP||itype[i-1]==CJUMP||itype[i-1]==SJUMP||itype[i-1]==FJUMP)) { + if(rs1[i-1]) if(hsn[rs1[i-1]]>1) hsn[rs1[i-1]]=1; + if(rs2[i-1]) if(hsn[rs2[i-1]]>1) hsn[rs2[i-1]]=1; + hsn[CCREG]=1; + // ...or hash tables + hsn[RHASH]=1; + hsn[RHTBL]=1; + } + // Coprocessor load/store needs FTEMP, even if not declared + if(itype[i]==C1LS) { + hsn[FTEMP]=0; + } + // Load L/R also uses FTEMP as a temporary register + if(itype[i]==LOADLR) { + hsn[FTEMP]=0; + } + // Also 64-bit SDL/SDR + if(opcode[i]==0x2c||opcode[i]==0x2d) { + hsn[FTEMP]=0; + } + // Don't remove the TLB registers either + if(itype[i]==LOAD || itype[i]==LOADLR || itype[i]==STORE || itype[i]==STORELR || itype[i]==C1LS ) { + hsn[TLREG]=0; + } + // Don't remove the miniht registers + if(itype[i]==UJUMP||itype[i]==RJUMP) + { + hsn[RHASH]=0; + hsn[RHTBL]=0; + } +} + +// We only want to allocate registers if we're going to use them again soon +static int needed_again(int r, int i) +{ + int j; + /*int b=-1;*/ + int rn=10; + + if(i>0&&(itype[i-1]==UJUMP||itype[i-1]==RJUMP||(source[i-1]>>16)==0x1000)) + { + if(ba[i-1]start+slen*4-4) + return 0; // Don't need any registers if exiting the block + } + for(j=0;j<9;j++) + { + if(i+j>=slen) { + j=slen-i-1; + break; + } + if(itype[i+j]==UJUMP||itype[i+j]==RJUMP||(source[i+j]>>16)==0x1000) + { + // Don't go past an unconditonal jump + j++; + break; + } + if(itype[i+j]==SYSCALL||((source[i+j]&0xfc00003f)==0x0d)) + { + break; + } + } + for(;j>=1;j--) + { + if(rs1[i+j]==r) rn=j; + if(rs2[i+j]==r) rn=j; + if((unneeded_reg[i+j]>>r)&1) rn=10; + if(i+j>=0&&(itype[i+j]==UJUMP||itype[i+j]==CJUMP||itype[i+j]==SJUMP||itype[i+j]==FJUMP)) + { + /*b=j;*/ + } + } + /* + if(b>=0) + { + if(ba[i+b]>=start && ba[i+b]<(start+slen*4)) + { + // Follow first branch + int o=rn; + int t=(ba[i+b]-start)>>2; + j=7-b;if(t+j>=slen) j=slen-t-1; + for(;j>=0;j--) + { + if(!((unneeded_reg[t+j]>>r)&1)) { + if(rs1[t+j]==r) if(rn>j+b+2) rn=j+b+2; + if(rs2[t+j]==r) if(rn>j+b+2) rn=j+b+2; + } + else rn=o; + } + } + }*/ + if(rn<10) return 1; + return 0; +} + +// Try to match register allocations at the end of a loop with those +// at the beginning +static int loop_reg(int i, int r, int hr) +{ + int j,k; + for(j=0;j<9;j++) + { + if(i+j>=slen) { + j=slen-i-1; + break; + } + if(itype[i+j]==UJUMP||itype[i+j]==RJUMP||(source[i+j]>>16)==0x1000) + { + // Don't go past an unconditonal jump + j++; + break; + } + } + k=0; + if(i>0){ + if(itype[i-1]==UJUMP||itype[i-1]==CJUMP||itype[i-1]==SJUMP||itype[i-1]==FJUMP) + k--; + } + for(;k>r)&1)) return hr; + if(r>64&&((unneeded_reg_upper[i+k]>>r)&1)) return hr; + if(i+k>=0&&(itype[i+k]==UJUMP||itype[i+k]==CJUMP||itype[i+k]==SJUMP||itype[i+k]==FJUMP)) + { + if(ba[i+k]>=start && ba[i+k]<(start+i*4)) + { + int t=(ba[i+k]-start)>>2; + int reg=get_reg(regs[t].regmap_entry,r); + if(reg>=0) return reg; + //reg=get_reg(regs[t+1].regmap_entry,r); + //if(reg>=0) return reg; + } + } + } + return hr; +} + + +// Allocate every register, preserving source/target regs +static void alloc_all(struct regstat *cur,int i) +{ + int hr; + + for(hr=0;hrregmap[hr]&63)!=rs1[i])&&((cur->regmap[hr]&63)!=rs2[i])&& + ((cur->regmap[hr]&63)!=rt1[i])&&((cur->regmap[hr]&63)!=rt2[i])) + { + cur->regmap[hr]=-1; + cur->dirty&=~(1<regmap[hr]&63)==0) + { + cur->regmap[hr]=-1; + cur->dirty&=~(1<>32) + // ,(int)reg[LOREG],(int)(reg[LOREG]>>32)); +} +static void divu64(uint64_t dividend,uint64_t divisor) +{ + lo=dividend/divisor; + hi=dividend%divisor; + //DebugMessage(M64MSG_VERBOSE, "TRACE: ddivu %8x%8x %8x%8x",(int)reg[HIREG],(int)(reg[HIREG]>>32) + // ,(int)reg[LOREG],(int)(reg[LOREG]>>32)); +} + +static void mult64(uint64_t m1,uint64_t m2) +{ + unsigned long long int op1, op2, op3, op4; + unsigned long long int result1, result2, result3, result4; + unsigned long long int temp1, temp2, temp3, temp4; + int sign = 0; + + if (m1 < 0) + { + op2 = -m1; + sign = 1 - sign; + } + else op2 = m1; + if (m2 < 0) + { + op4 = -m2; + sign = 1 - sign; + } + else op4 = m2; + + op1 = op2 & 0xFFFFFFFF; + op2 = (op2 >> 32) & 0xFFFFFFFF; + op3 = op4 & 0xFFFFFFFF; + op4 = (op4 >> 32) & 0xFFFFFFFF; + + temp1 = op1 * op3; + temp2 = (temp1 >> 32) + op1 * op4; + temp3 = op2 * op3; + temp4 = (temp3 >> 32) + op2 * op4; + + result1 = temp1 & 0xFFFFFFFF; + result2 = temp2 + (temp3 & 0xFFFFFFFF); + result3 = (result2 >> 32) + temp4; + result4 = (result3 >> 32); + + lo = result1 | (result2 << 32); + hi = (result3 & 0xFFFFFFFF) | (result4 << 32); + if (sign) + { + hi = ~hi; + if (!lo) hi++; + else lo = ~lo + 1; + } +} + +#if NEW_DYNAREC == NEW_DYNAREC_ARM +static void multu64(uint64_t m1,uint64_t m2) +{ + unsigned long long int op1, op2, op3, op4; + unsigned long long int result1, result2, result3, result4; + unsigned long long int temp1, temp2, temp3, temp4; + + op1 = m1 & 0xFFFFFFFF; + op2 = (m1 >> 32) & 0xFFFFFFFF; + op3 = m2 & 0xFFFFFFFF; + op4 = (m2 >> 32) & 0xFFFFFFFF; + + temp1 = op1 * op3; + temp2 = (temp1 >> 32) + op1 * op4; + temp3 = op2 * op3; + temp4 = (temp3 >> 32) + op2 * op4; + + result1 = temp1 & 0xFFFFFFFF; + result2 = temp2 + (temp3 & 0xFFFFFFFF); + result3 = (result2 >> 32) + temp4; + result4 = (result3 >> 32); + + lo = result1 | (result2 << 32); + hi = (result3 & 0xFFFFFFFF) | (result4 << 32); + + //DebugMessage(M64MSG_VERBOSE, "TRACE: dmultu %8x%8x %8x%8x",(int)reg[HIREG],(int)(reg[HIREG]>>32) + // ,(int)reg[LOREG],(int)(reg[LOREG]>>32)); +} +#endif + +static uint64_t ldl_merge(uint64_t original,uint64_t loaded,u_int bits) +{ + if(bits) { + original<<=64-bits; + original>>=64-bits; + loaded<<=bits; + original|=loaded; + } + else original=loaded; + return original; +} +static uint64_t ldr_merge(uint64_t original,uint64_t loaded,u_int bits) +{ + if(bits^56) { + original>>=64-(bits^56); + original<<=64-(bits^56); + loaded>>=bits^56; + original|=loaded; + } + else original=loaded; + return original; +} + +#if NEW_DYNAREC == NEW_DYNAREC_X86 +#include "assem_x86.c" +#elif NEW_DYNAREC == NEW_DYNAREC_ARM +#include "assem_arm.c" +#else +#error Unsupported dynarec architecture +#endif + +// Add virtual address mapping to linked list +static void ll_add(struct ll_entry **head,int vaddr,void *addr) +{ + struct ll_entry *new_entry; + new_entry=malloc(sizeof(struct ll_entry)); + assert(new_entry!=NULL); + new_entry->vaddr=vaddr; + new_entry->reg32=0; + new_entry->addr=addr; + new_entry->next=*head; + *head=new_entry; +} + +// Add virtual address mapping for 32-bit compiled block +static void ll_add_32(struct ll_entry **head,int vaddr,u_int reg32,void *addr) +{ + struct ll_entry *new_entry; + new_entry=malloc(sizeof(struct ll_entry)); + assert(new_entry!=NULL); + new_entry->vaddr=vaddr; + new_entry->reg32=reg32; + new_entry->addr=addr; + new_entry->next=*head; + *head=new_entry; +} + +// Check if an address is already compiled +// but don't return addresses which are about to expire from the cache +static void *check_addr(u_int vaddr) +{ + u_int *ht_bin=hash_table[((vaddr>>16)^vaddr)&0xFFFF]; + if(ht_bin[0]==vaddr) { + if(((ht_bin[1]-MAX_OUTPUT_BLOCK_SIZE-(u_int)out)<<(32-TARGET_SIZE_2))>0x60000000+(MAX_OUTPUT_BLOCK_SIZE<<(32-TARGET_SIZE_2))) + if(isclean(ht_bin[1])) return (void *)ht_bin[1]; + } + if(ht_bin[2]==vaddr) { + if(((ht_bin[3]-MAX_OUTPUT_BLOCK_SIZE-(u_int)out)<<(32-TARGET_SIZE_2))>0x60000000+(MAX_OUTPUT_BLOCK_SIZE<<(32-TARGET_SIZE_2))) + if(isclean(ht_bin[3])) return (void *)ht_bin[3]; + } + u_int page=(vaddr^0x80000000)>>12; + if(page>262143&&tlb_LUT_r[vaddr>>12]) page=(tlb_LUT_r[vaddr>>12]^0x80000000)>>12; + if(page>2048) page=2048+(page&2047); + struct ll_entry *head; + head=jump_in[page]; + while(head!=NULL) { + if(head->vaddr==vaddr&&head->reg32==0) { + if((((u_int)head->addr-(u_int)out)<<(32-TARGET_SIZE_2))>0x60000000+(MAX_OUTPUT_BLOCK_SIZE<<(32-TARGET_SIZE_2))) { + // Update existing entry with current address + if(ht_bin[0]==vaddr) { + ht_bin[1]=(int)head->addr; + return head->addr; + } + if(ht_bin[2]==vaddr) { + ht_bin[3]=(int)head->addr; + return head->addr; + } + // Insert into hash table with low priority. + // Don't evict existing entries, as they are probably + // addresses that are being accessed frequently. + if(ht_bin[0]==-1) { + ht_bin[1]=(int)head->addr; + ht_bin[0]=vaddr; + }else if(ht_bin[2]==-1) { + ht_bin[3]=(int)head->addr; + ht_bin[2]=vaddr; + } + return head->addr; + } + } + head=head->next; + } + return 0; +} + +static void remove_hash(int vaddr) +{ + //DebugMessage(M64MSG_VERBOSE, "remove hash: %x",vaddr); + u_int *ht_bin=hash_table[(((vaddr)>>16)^vaddr)&0xFFFF]; + if(ht_bin[2]==vaddr) { + ht_bin[2]=ht_bin[3]=-1; + } + if(ht_bin[0]==vaddr) { + ht_bin[0]=ht_bin[2]; + ht_bin[1]=ht_bin[3]; + ht_bin[2]=ht_bin[3]=-1; + } +} + +static void ll_remove_matching_addrs(struct ll_entry **head,int addr,int shift) +{ + struct ll_entry *next; + while(*head) { + if(((u_int)((*head)->addr)>>shift)==(addr>>shift) || + ((u_int)((*head)->addr-MAX_OUTPUT_BLOCK_SIZE)>>shift)==(addr>>shift)) + { + inv_debug("EXP: Remove pointer to %x (%x)\n",(int)(*head)->addr,(*head)->vaddr); + remove_hash((*head)->vaddr); + next=(*head)->next; + free(*head); + *head=next; + } + else + { + head=&((*head)->next); + } + } +} + +// Remove all entries from linked list +static void ll_clear(struct ll_entry **head) +{ + struct ll_entry *cur; + struct ll_entry *next; + if((cur=*head)) { + *head=0; + while(cur) { + next=cur->next; + free(cur); + cur=next; + } + } +} + +// Dereference the pointers and remove if it matches +static void ll_kill_pointers(struct ll_entry *head,int addr,int shift) +{ + while(head) { + int ptr=get_pointer(head->addr); + inv_debug("EXP: Lookup pointer to %x at %x (%x)\n",(int)ptr,(int)head->addr,head->vaddr); + if(((ptr>>shift)==(addr>>shift)) || + (((ptr-MAX_OUTPUT_BLOCK_SIZE)>>shift)==(addr>>shift))) + { + inv_debug("EXP: Kill pointer at %x (%x)\n",(int)head->addr,head->vaddr); + u_int host_addr=(int)kill_pointer(head->addr); + #if NEW_DYNAREC == NEW_DYNAREC_ARM + needs_clear_cache[(host_addr-(u_int)base_addr)>>17]|=1<<(((host_addr-(u_int)base_addr)>>12)&31); + #endif + } + head=head->next; + } +} + +// This is called when we write to a compiled block (see do_invstub) +static void invalidate_page(u_int page) +{ + struct ll_entry *head; + struct ll_entry *next; + head=jump_in[page]; + jump_in[page]=0; + while(head!=NULL) { + inv_debug("INVALIDATE: %x\n",head->vaddr); + remove_hash(head->vaddr); + next=head->next; + free(head); + head=next; + } + head=jump_out[page]; + jump_out[page]=0; + while(head!=NULL) { + inv_debug("INVALIDATE: kill pointer to %x (%x)\n",head->vaddr,(int)head->addr); + u_int host_addr=(int)kill_pointer(head->addr); + #if NEW_DYNAREC == NEW_DYNAREC_ARM + needs_clear_cache[(host_addr-(u_int)base_addr)>>17]|=1<<(((host_addr-(u_int)base_addr)>>12)&31); + #endif + next=head->next; + free(head); + head=next; + } +} +void invalidate_block(u_int block) +{ + u_int page,vpage; + page=vpage=block^0x80000; + if(page>262143&&tlb_LUT_r[block]) page=(tlb_LUT_r[block]^0x80000000)>>12; + if(page>2048) page=2048+(page&2047); + if(vpage>262143&&tlb_LUT_r[block]) vpage&=2047; // jump_dirty uses a hash of the virtual address instead + if(vpage>2048) vpage=2048+(vpage&2047); + inv_debug("INVALIDATE: %x (%d)\n",block<<12,page); + //inv_debug("invalid_code[block]=%d\n",invalid_code[block]); + u_int first,last; + first=last=page; + struct ll_entry *head; + head=jump_dirty[vpage]; + //DebugMessage(M64MSG_VERBOSE, "page=%d vpage=%d",page,vpage); + while(head!=NULL) { + u_int start,end; + if(vpage>2047||(head->vaddr>>12)==block) { // Ignore vaddr hash collision + get_bounds((int)head->addr,&start,&end); + //DebugMessage(M64MSG_VERBOSE, "start: %x end: %x",start,end); + if(page<2048&&start>=0x80000000&&end<0x80800000) { + if(((start-(u_int)rdram)>>12)<=page&&((end-1-(u_int)rdram)>>12)>=page) { + if((((start-(u_int)rdram)>>12)&2047)>12)&2047; + if((((end-1-(u_int)rdram)>>12)&2047)>last) last=((end-1-(u_int)rdram)>>12)&2047; + } + } + if(page<2048&&(signed int)start>=(signed int)0xC0000000&&(signed int)end>=(signed int)0xC0000000) { + if(((start+memory_map[start>>12]-(u_int)rdram)>>12)<=page&&((end-1+memory_map[(end-1)>>12]-(u_int)rdram)>>12)>=page) { + if((((start+memory_map[start>>12]-(u_int)rdram)>>12)&2047)>12]-(u_int)rdram)>>12)&2047; + if((((end-1+memory_map[(end-1)>>12]-(u_int)rdram)>>12)&2047)>last) last=((end-1+memory_map[(end-1)>>12]-(u_int)rdram)>>12)&2047; + } + } + } + head=head->next; + } + //DebugMessage(M64MSG_VERBOSE, "first=%d last=%d",first,last); + invalidate_page(page); + assert(first+5>page); // NB: this assumes MAXBLOCK<=4096 (4 pages) + assert(last>2; + u_int real_block=tlb_LUT_w[block]>>12; + invalid_code[real_block]=1; + if(real_block>=0x80000&&real_block<0x80800) memory_map[real_block]=((u_int)rdram-0x80000000)>>2; + } + else if(block>=0x80000&&block<0x80800) memory_map[block]=((u_int)rdram-0x80000000)>>2; + #ifdef USE_MINI_HT + memset(mini_ht,-1,sizeof(mini_ht)); + #endif +} + +#if NEW_DYNAREC == NEW_DYNAREC_ARM +static void invalidate_addr(u_int addr) +{ + invalidate_block(addr>>12); +} +#endif + +// This is called when loading a save state. +// Anything could have changed, so invalidate everything. +void invalidate_all_pages() +{ + u_int page; + for(page=0;page<4096;page++) + invalidate_page(page); + for(page=0;page<1048576;page++) + if(!invalid_code[page]) { + restore_candidate[(page&2047)>>3]|=1<<(page&7); + restore_candidate[((page&2047)>>3)+256]|=1<<(page&7); + } + #if NEW_DYNAREC == NEW_DYNAREC_ARM + __clear_cache((void *)base_addr,(void *)base_addr+(1<>2; + if(!tlb_LUT_w[page]||!invalid_code[page]) + memory_map[page]|=0x40000000; // Write protect + } + else memory_map[page]=-1; + if(page==0x80000) page=0xC0000; + } + tlb_hacks(); +} + +// Add an entry to jump_out after making a link +void add_link(u_int vaddr,void *src) +{ + u_int page=(vaddr^0x80000000)>>12; + if(page>262143&&tlb_LUT_r[vaddr>>12]) page=(tlb_LUT_r[vaddr>>12]^0x80000000)>>12; + if(page>4095) page=2048+(page&2047); + inv_debug("add_link: %x -> %x (%d)\n",(int)src,vaddr,page); + ll_add(jump_out+page,vaddr,src); + //int ptr=get_pointer(src); + //inv_debug("add_link: Pointer is to %x\n",(int)ptr); +} + +// If a code block was found to be unmodified (bit was set in +// restore_candidate) and it remains unmodified (bit is clear +// in invalid_code) then move the entries for that 4K page from +// the dirty list to the clean list. +void clean_blocks(u_int page) +{ + struct ll_entry *head; + inv_debug("INV: clean_blocks page=%d\n",page); + head=jump_dirty[page]; + while(head!=NULL) { + if(!invalid_code[head->vaddr>>12]) { + // Don't restore blocks which are about to expire from the cache + if((((u_int)head->addr-(u_int)out)<<(32-TARGET_SIZE_2))>0x60000000+(MAX_OUTPUT_BLOCK_SIZE<<(32-TARGET_SIZE_2))) { + u_int start,end; + if(verify_dirty(head->addr)) { + //DebugMessage(M64MSG_VERBOSE, "Possibly Restore %x (%x)",head->vaddr, (int)head->addr); + u_int i; + u_int inv=0; + get_bounds((int)head->addr,&start,&end); + if(start-(u_int)rdram<0x800000) { + for(i=(start-(u_int)rdram+0x80000000)>>12;i<=(end-1-(u_int)rdram+0x80000000)>>12;i++) { + inv|=invalid_code[i]; + } + } + if((signed int)head->vaddr>=(signed int)0xC0000000) { + u_int addr = (head->vaddr+(memory_map[head->vaddr>>12]<<2)); + //DebugMessage(M64MSG_VERBOSE, "addr=%x start=%x end=%x",addr,start,end); + if(addr=end) inv=1; + } + else if((signed int)head->vaddr>=(signed int)0x80800000) { + inv=1; + } + if(!inv) { + void * clean_addr=(void *)get_clean_addr((int)head->addr); + if((((u_int)clean_addr-(u_int)out)<<(32-TARGET_SIZE_2))>0x60000000+(MAX_OUTPUT_BLOCK_SIZE<<(32-TARGET_SIZE_2))) { + u_int ppage=page; + if(page<2048&&tlb_LUT_r[head->vaddr>>12]) ppage=(tlb_LUT_r[head->vaddr>>12]^0x80000000)>>12; + inv_debug("INV: Restored %x (%x/%x)\n",head->vaddr, (int)head->addr, (int)clean_addr); + //DebugMessage(M64MSG_VERBOSE, "page=%x, addr=%x",page,head->vaddr); + //assert(head->vaddr>>12==(page|0x80000)); + ll_add_32(jump_in+ppage,head->vaddr,head->reg32,clean_addr); + u_int *ht_bin=hash_table[((head->vaddr>>16)^head->vaddr)&0xFFFF]; + if(!head->reg32) { + if(ht_bin[0]==head->vaddr) { + ht_bin[1]=(int)clean_addr; // Replace existing entry + } + if(ht_bin[2]==head->vaddr) { + ht_bin[3]=(int)clean_addr; // Replace existing entry + } + } + } + } + } + } + } + head=head->next; + } +} + + +static void mov_alloc(struct regstat *current,int i) +{ + // Note: Don't need to actually alloc the source registers + if((~current->is32>>rs1[i])&1) { + //alloc_reg64(current,i,rs1[i]); + alloc_reg64(current,i,rt1[i]); + current->is32&=~(1LL<is32|=(1LL<is32|=1LL<=0x38&&opcode2[i]<=0x3b) // DSLL/DSRL/DSRA + { + if(rt1[i]) { + if(rs1[i]) alloc_reg64(current,i,rs1[i]); + alloc_reg64(current,i,rt1[i]); + current->is32&=~(1LL<is32&=~(1LL<is32&=~(1LL<is32|=1LL<is32|=1LL<is32|=1LL<is32&=~(1LL<=0x20&&opcode2[i]<=0x23) { // ADD/ADDU/SUB/SUBU + if(rt1[i]) { + if(rs1[i]&&rs2[i]) { + alloc_reg(current,i,rs1[i]); + alloc_reg(current,i,rs2[i]); + } + else { + if(rs1[i]&&needed_again(rs1[i],i)) alloc_reg(current,i,rs1[i]); + if(rs2[i]&&needed_again(rs2[i],i)) alloc_reg(current,i,rs2[i]); + } + alloc_reg(current,i,rt1[i]); + } + current->is32|=1LL<is32>>rs1[i])&(current->is32>>rs2[i])&1)) + { + alloc_reg64(current,i,rs1[i]); + alloc_reg64(current,i,rs2[i]); + alloc_reg(current,i,rt1[i]); + } else { + alloc_reg(current,i,rs1[i]); + alloc_reg(current,i,rs2[i]); + alloc_reg(current,i,rt1[i]); + } + } + current->is32|=1LL<=0x24&&opcode2[i]<=0x27) { // AND/OR/XOR/NOR + if(rt1[i]) { + if(rs1[i]&&rs2[i]) { + alloc_reg(current,i,rs1[i]); + alloc_reg(current,i,rs2[i]); + } + else + { + if(rs1[i]&&needed_again(rs1[i],i)) alloc_reg(current,i,rs1[i]); + if(rs2[i]&&needed_again(rs2[i],i)) alloc_reg(current,i,rs2[i]); + } + alloc_reg(current,i,rt1[i]); + if(!((current->is32>>rs1[i])&(current->is32>>rs2[i])&1)) + { + if(!((current->uu>>rt1[i])&1)) { + alloc_reg64(current,i,rt1[i]); + } + if(get_reg(current->regmap,rt1[i]|64)>=0) { + if(rs1[i]&&rs2[i]) { + alloc_reg64(current,i,rs1[i]); + alloc_reg64(current,i,rs2[i]); + } + else + { + // Is is really worth it to keep 64-bit values in registers? + #ifdef NATIVE_64BIT + if(rs1[i]&&needed_again(rs1[i],i)) alloc_reg64(current,i,rs1[i]); + if(rs2[i]&&needed_again(rs2[i],i)) alloc_reg64(current,i,rs2[i]); + #endif + } + } + current->is32&=~(1LL<is32|=1LL<=0x2c&&opcode2[i]<=0x2f) { // DADD/DADDU/DSUB/DSUBU + if(rt1[i]) { + if(rs1[i]&&rs2[i]) { + if(!((current->uu>>rt1[i])&1)||get_reg(current->regmap,rt1[i]|64)>=0) { + alloc_reg64(current,i,rs1[i]); + alloc_reg64(current,i,rs2[i]); + alloc_reg64(current,i,rt1[i]); + } else { + alloc_reg(current,i,rs1[i]); + alloc_reg(current,i,rs2[i]); + alloc_reg(current,i,rt1[i]); + } + } + else { + alloc_reg(current,i,rt1[i]); + if(!((current->uu>>rt1[i])&1)||get_reg(current->regmap,rt1[i]|64)>=0) { + // DADD used as move, or zeroing + // If we have a 64-bit source, then make the target 64 bits too + if(rs1[i]&&!((current->is32>>rs1[i])&1)) { + if(get_reg(current->regmap,rs1[i])>=0) alloc_reg64(current,i,rs1[i]); + alloc_reg64(current,i,rt1[i]); + } else if(rs2[i]&&!((current->is32>>rs2[i])&1)) { + if(get_reg(current->regmap,rs2[i])>=0) alloc_reg64(current,i,rs2[i]); + alloc_reg64(current,i,rt1[i]); + } + if(opcode2[i]>=0x2e&&rs2[i]) { + // DSUB used as negation - 64-bit result + // If we have a 32-bit register, extend it to 64 bits + if(get_reg(current->regmap,rs2[i])>=0) alloc_reg64(current,i,rs2[i]); + alloc_reg64(current,i,rt1[i]); + } + } + } + if(rs1[i]&&rs2[i]) { + current->is32&=~(1LL<is32&=~(1LL<is32>>rs1[i])&1) + current->is32|=1LL<is32&=~(1LL<is32>>rs2[i])&1) + current->is32|=1LL<is32|=1LL<is32&=~(1LL<uu>>rt1[i])&1)||get_reg(current->regmap,rt1[i]|64)>=0) { + // TODO: Could preserve the 32-bit flag if the immediate is zero + alloc_reg64(current,i,rt1[i]); + alloc_reg64(current,i,rs1[i]); + } + clear_const(current,rs1[i]); + clear_const(current,rt1[i]); + } + else if(opcode[i]==0x0a||opcode[i]==0x0b) { // SLTI/SLTIU + if((~current->is32>>rs1[i])&1) alloc_reg64(current,i,rs1[i]); + current->is32|=1LL<=0x0c&&opcode[i]<=0x0e) { // ANDI/ORI/XORI + if(((~current->is32>>rs1[i])&1)&&opcode[i]>0x0c) { + if(rs1[i]!=rt1[i]) { + if(needed_again(rs1[i],i)) alloc_reg64(current,i,rs1[i]); + alloc_reg64(current,i,rt1[i]); + current->is32&=~(1LL<is32|=1LL<is32|=1LL<is32|=1LL<u&=~1LL; // Allow allocating r0 if it's the source register + if(needed_again(rs1[i],i)) alloc_reg(current,i,rs1[i]); + if(rt1[i]&&!((current->u>>rt1[i])&1)) { + alloc_reg(current,i,rt1[i]); + assert(get_reg(current->regmap,rt1[i])>=0); + if(opcode[i]==0x27||opcode[i]==0x37) // LWU/LD + { + current->is32&=~(1LL<is32&=~(1LL<is32|=1LL<u&=~1LL; // Allow allocating r0 if necessary + if(needed_again(rs1[i],i)) alloc_reg(current,i,rs1[i]); + alloc_reg(current,i,rs2[i]); + if(opcode[i]==0x2c||opcode[i]==0x2d||opcode[i]==0x3f) { // 64-bit SDL/SDR/SD + alloc_reg64(current,i,rs2[i]); + if(rs2[i]) alloc_reg(current,i,FTEMP); + } + // If using TLB, need a register for pointer to the mapping table + if(using_tlb) alloc_reg(current,i,TLREG); + #if defined(HOST_IMM8) + // On CPUs without 32-bit immediates we need a pointer to invalid_code + else alloc_reg(current,i,INVCP); + #endif + if(opcode[i]==0x2c||opcode[i]==0x2d) { // 64-bit SDL/SDR + alloc_reg(current,i,FTEMP); + } + // We need a temporary register for address generation + alloc_reg_temp(current,i,-1); + minimum_free_regs[i]=1; +} + +static void c1ls_alloc(struct regstat *current,int i) +{ + //clear_const(current,rs1[i]); // FIXME + clear_const(current,rt1[i]); + if(needed_again(rs1[i],i)) alloc_reg(current,i,rs1[i]); + alloc_reg(current,i,CSREG); // Status + alloc_reg(current,i,FTEMP); + if(opcode[i]==0x35||opcode[i]==0x3d) { // 64-bit LDC1/SDC1 + alloc_reg64(current,i,FTEMP); + } + // If using TLB, need a register for pointer to the mapping table + if(using_tlb) alloc_reg(current,i,TLREG); + #if defined(HOST_IMM8) + // On CPUs without 32-bit immediates we need a pointer to invalid_code + else if((opcode[i]&0x3b)==0x39) // SWC1/SDC1 + alloc_reg(current,i,INVCP); + #endif + // We need a temporary register for address generation + alloc_reg_temp(current,i,-1); + minimum_free_regs[i]=1; +} + +#ifndef multdiv_alloc +void multdiv_alloc(struct regstat *current,int i) +{ + // case 0x18: MULT + // case 0x19: MULTU + // case 0x1A: DIV + // case 0x1B: DIVU + // case 0x1C: DMULT + // case 0x1D: DMULTU + // case 0x1E: DDIV + // case 0x1F: DDIVU + clear_const(current,rs1[i]); + clear_const(current,rs2[i]); + if(rs1[i]&&rs2[i]) + { + if((opcode2[i]&4)==0) // 32-bit + { + current->u&=~(1LL<u&=~(1LL<is32|=1LL<is32|=1LL<u&=~(1LL<u&=~(1LL<uu&=~(1LL<uu&=~(1LL<10) alloc_reg64(current,i,LOREG); + alloc_reg64(current,i,rs1[i]); + alloc_reg64(current,i,rs2[i]); + alloc_all(current,i); + current->is32&=~(1LL<is32&=~(1LL<is32|=1LL<is32|=1LL<is32|=1LL<u&=~1LL; + alloc_reg(current,i,0); + } + } + else + { + // TLBR/TLBWI/TLBWR/TLBP/ERET + assert(opcode2[i]==0x10); + alloc_all(current,i); + } + minimum_free_regs[i]=HOST_REGS; +} + +static void cop1_alloc(struct regstat *current,int i) +{ + alloc_reg(current,i,CSREG); // Load status + if(opcode2[i]<3) // MFC1/DMFC1/CFC1 + { + assert(rt1[i]); + clear_const(current,rt1[i]); + if(opcode2[i]==1) { + alloc_reg64(current,i,rt1[i]); // DMFC1 + current->is32&=~(1LL<is32|=1LL<3) // MTC1/DMTC1/CTC1 + { + if(rs1[i]){ + clear_const(current,rs1[i]); + if(opcode2[i]==5) + alloc_reg64(current,i,rs1[i]); // DMTC1 + else + alloc_reg(current,i,rs1[i]); // MTC1/CTC1 + alloc_reg_temp(current,i,-1); + } + else { + current->u&=~1LL; + alloc_reg(current,i,0); + alloc_reg_temp(current,i,-1); + } + } + minimum_free_regs[i]=1; +} +static void fconv_alloc(struct regstat *current,int i) +{ + alloc_reg(current,i,CSREG); // Load status + alloc_reg_temp(current,i,-1); + minimum_free_regs[i]=1; +} +static void float_alloc(struct regstat *current,int i) +{ + alloc_reg(current,i,CSREG); // Load status + alloc_reg_temp(current,i,-1); + minimum_free_regs[i]=1; +} +static void fcomp_alloc(struct regstat *current,int i) +{ + alloc_reg(current,i,CSREG); // Load status + alloc_reg(current,i,FSREG); // Load flags + dirty_reg(current,FSREG); // Flag will be modified + alloc_reg_temp(current,i,-1); + minimum_free_regs[i]=1; +} + +static void syscall_alloc(struct regstat *current,int i) +{ + alloc_cc(current,i); + dirty_reg(current,CCREG); + alloc_all(current,i); + minimum_free_regs[i]=HOST_REGS; + current->isconst=0; +} + +static void delayslot_alloc(struct regstat *current,int i) +{ + switch(itype[i]) { + case UJUMP: + case CJUMP: + case SJUMP: + case RJUMP: + case FJUMP: + case SYSCALL: + case SPAN: + assem_debug("jump in the delay slot. this shouldn't happen.");//exit(1); + DebugMessage(M64MSG_VERBOSE, "Disabled speculative precompilation"); + stop_after_jal=1; + break; + case IMM16: + imm16_alloc(current,i); + break; + case LOAD: + case LOADLR: + load_alloc(current,i); + break; + case STORE: + case STORELR: + store_alloc(current,i); + break; + case ALU: + alu_alloc(current,i); + break; + case SHIFT: + shift_alloc(current,i); + break; + case MULTDIV: + multdiv_alloc(current,i); + break; + case SHIFTIMM: + shiftimm_alloc(current,i); + break; + case MOV: + mov_alloc(current,i); + break; + case COP0: + cop0_alloc(current,i); + break; + case COP1: + cop1_alloc(current,i); + break; + case C1LS: + c1ls_alloc(current,i); + break; + case FCONV: + fconv_alloc(current,i); + break; + case FLOAT: + float_alloc(current,i); + break; + case FCOMP: + fcomp_alloc(current,i); + break; + } +} + +// Special case where a branch and delay slot span two pages in virtual memory +static void pagespan_alloc(struct regstat *current,int i) +{ + current->isconst=0; + current->wasconst=0; + regs[i].wasconst=0; + minimum_free_regs[i]=HOST_REGS; + alloc_all(current,i); + alloc_cc(current,i); + dirty_reg(current,CCREG); + if(opcode[i]==3) // JAL + { + alloc_reg(current,i,31); + dirty_reg(current,31); + } + if(opcode[i]==0&&(opcode2[i]&0x3E)==8) // JR/JALR + { + alloc_reg(current,i,rs1[i]); + if (rt1[i]!=0) { + alloc_reg(current,i,rt1[i]); + dirty_reg(current,rt1[i]); + } + } + if((opcode[i]&0x2E)==4) // BEQ/BNE/BEQL/BNEL + { + if(rs1[i]) alloc_reg(current,i,rs1[i]); + if(rs2[i]) alloc_reg(current,i,rs2[i]); + if(!((current->is32>>rs1[i])&(current->is32>>rs2[i])&1)) + { + if(rs1[i]) alloc_reg64(current,i,rs1[i]); + if(rs2[i]) alloc_reg64(current,i,rs2[i]); + } + } + else + if((opcode[i]&0x2E)==6) // BLEZ/BGTZ/BLEZL/BGTZL + { + if(rs1[i]) alloc_reg(current,i,rs1[i]); + if(!((current->is32>>rs1[i])&1)) + { + if(rs1[i]) alloc_reg64(current,i,rs1[i]); + } + } + else + if(opcode[i]==0x11) // BC1 + { + alloc_reg(current,i,FSREG); + alloc_reg(current,i,CSREG); + } + //else ... +} + +static void add_stub(int type,int addr,int retaddr,int a,int b,int c,int d,int e) +{ + stubs[stubcount][0]=type; + stubs[stubcount][1]=addr; + stubs[stubcount][2]=retaddr; + stubs[stubcount][3]=a; + stubs[stubcount][4]=b; + stubs[stubcount][5]=c; + stubs[stubcount][6]=d; + stubs[stubcount][7]=e; + stubcount++; +} + +// Write out a single register +static void wb_register(signed char r,signed char regmap[],uint64_t dirty,uint64_t is32) +{ + int hr; + for(hr=0;hr>hr)&1) { + if(regmap[hr]<64) { + emit_storereg(r,hr); + if((is32>>regmap[hr])&1) { + emit_sarimm(hr,31,hr); + emit_storereg(r|64,hr); + } + }else{ + emit_storereg(r|64,hr); + } + } + } + } + } +} +#if 0 +static int mchecksum() +{ + //if(!tracedebug) return 0; + int i; + int sum=0; + for(i=0;i<2097152;i++) { + unsigned int temp=sum; + sum<<=1; + sum|=(~temp)>>31; + sum^=((u_int *)rdram)[i]; + } + return sum; +} + +static int rchecksum() +{ + int i; + int sum=0; + for(i=0;i<64;i++) + sum^=((u_int *)reg)[i]; + return sum; +} + +static void rlist() +{ + int i; + DebugMessage(M64MSG_VERBOSE, "TRACE: "); + for(i=0;i<32;i++) + DebugMessage(M64MSG_VERBOSE, "r%d:%8x%8x ",i,((int *)(reg+i))[1],((int *)(reg+i))[0]); + DebugMessage(M64MSG_VERBOSE, "TRACE: "); + for(i=0;i<32;i++) + DebugMessage(M64MSG_VERBOSE, "f%d:%8x%8x ",i,((int*)reg_cop1_simple[i])[1],*((int*)reg_cop1_simple[i])); +} + +static void enabletrace() +{ + tracedebug=1; +} + + +static void memdebug(int i) +{ + //DebugMessage(M64MSG_VERBOSE, "TRACE: count=%d next=%d (checksum %x) lo=%8x%8x",Count,next_interupt,mchecksum(),(int)(reg[LOREG]>>32),(int)reg[LOREG]); + //DebugMessage(M64MSG_VERBOSE, "TRACE: count=%d next=%d (rchecksum %x)",Count,next_interupt,rchecksum()); + //rlist(); + //if(tracedebug) { + //if(Count>=-2084597794) { + if((signed int)Count>=-2084597794&&(signed int)Count<0) { + //if(0) { + DebugMessage(M64MSG_VERBOSE, "TRACE: count=%d next=%d (checksum %x)",Count,next_interupt,mchecksum()); + //DebugMessage(M64MSG_VERBOSE, "TRACE: count=%d next=%d (checksum %x) Status=%x",Count,next_interupt,mchecksum(),Status); + //DebugMessage(M64MSG_VERBOSE, "TRACE: count=%d next=%d (checksum %x) hi=%8x%8x",Count,next_interupt,mchecksum(),(int)(reg[HIREG]>>32),(int)reg[HIREG]); + rlist(); + #if NEW_DYNAREC == NEW_DYNAREC_X86 + DebugMessage(M64MSG_VERBOSE, "TRACE: %x",(&i)[-1]); + #endif + #if NEW_DYNAREC == NEW_DYNAREC_ARM + int j; + DebugMessage(M64MSG_VERBOSE, "TRACE: %x ",(&j)[10]); + DebugMessage(M64MSG_VERBOSE, "TRACE: %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x",(&j)[1],(&j)[2],(&j)[3],(&j)[4],(&j)[5],(&j)[6],(&j)[7],(&j)[8],(&j)[9],(&j)[10],(&j)[11],(&j)[12],(&j)[13],(&j)[14],(&j)[15],(&j)[16],(&j)[17],(&j)[18],(&j)[19],(&j)[20]); + #endif + //fflush(stdout); + } + //DebugMessage(M64MSG_VERBOSE, "TRACE: %x",(&i)[-1]); +} +#endif + +/* Debug: +static void tlb_debug(u_int cause, u_int addr, u_int iaddr) +{ + DebugMessage(M64MSG_VERBOSE, "TLB Exception: instruction=%x addr=%x cause=%x",iaddr, addr, cause); +} +end debug */ + +static void alu_assemble(int i,struct regstat *i_regs) +{ + if(opcode2[i]>=0x20&&opcode2[i]<=0x23) { // ADD/ADDU/SUB/SUBU + if(rt1[i]) { + signed char s1,s2,t; + t=get_reg(i_regs->regmap,rt1[i]); + if(t>=0) { + s1=get_reg(i_regs->regmap,rs1[i]); + s2=get_reg(i_regs->regmap,rs2[i]); + if(rs1[i]&&rs2[i]) { + assert(s1>=0); + assert(s2>=0); + if(opcode2[i]&2) emit_sub(s1,s2,t); + else emit_add(s1,s2,t); + } + else if(rs1[i]) { + if(s1>=0) emit_mov(s1,t); + else emit_loadreg(rs1[i],t); + } + else if(rs2[i]) { + if(s2>=0) { + if(opcode2[i]&2) emit_neg(s2,t); + else emit_mov(s2,t); + } + else { + emit_loadreg(rs2[i],t); + if(opcode2[i]&2) emit_neg(t,t); + } + } + else emit_zeroreg(t); + } + } + } + if(opcode2[i]>=0x2c&&opcode2[i]<=0x2f) { // DADD/DADDU/DSUB/DSUBU + if(rt1[i]) { + signed char s1l,s2l,s1h,s2h,tl,th; + tl=get_reg(i_regs->regmap,rt1[i]); + th=get_reg(i_regs->regmap,rt1[i]|64); + if(tl>=0) { + s1l=get_reg(i_regs->regmap,rs1[i]); + s2l=get_reg(i_regs->regmap,rs2[i]); + s1h=get_reg(i_regs->regmap,rs1[i]|64); + s2h=get_reg(i_regs->regmap,rs2[i]|64); + if(rs1[i]&&rs2[i]) { + assert(s1l>=0); + assert(s2l>=0); + if(opcode2[i]&2) emit_subs(s1l,s2l,tl); + else emit_adds(s1l,s2l,tl); + if(th>=0) { + #ifdef INVERTED_CARRY + if(opcode2[i]&2) {if(s1h!=th) emit_mov(s1h,th);emit_sbb(th,s2h);} + #else + if(opcode2[i]&2) emit_sbc(s1h,s2h,th); + #endif + else emit_add(s1h,s2h,th); + } + } + else if(rs1[i]) { + if(s1l>=0) emit_mov(s1l,tl); + else emit_loadreg(rs1[i],tl); + if(th>=0) { + if(s1h>=0) emit_mov(s1h,th); + else emit_loadreg(rs1[i]|64,th); + } + } + else if(rs2[i]) { + if(s2l>=0) { + if(opcode2[i]&2) emit_negs(s2l,tl); + else emit_mov(s2l,tl); + } + else { + emit_loadreg(rs2[i],tl); + if(opcode2[i]&2) emit_negs(tl,tl); + } + if(th>=0) { + #ifdef INVERTED_CARRY + if(s2h>=0) emit_mov(s2h,th); + else emit_loadreg(rs2[i]|64,th); + if(opcode2[i]&2) { + emit_adcimm(-1,th); // x86 has inverted carry flag + emit_not(th,th); + } + #else + if(opcode2[i]&2) { + if(s2h>=0) emit_rscimm(s2h,0,th); + else { + emit_loadreg(rs2[i]|64,th); + emit_rscimm(th,0,th); + } + }else{ + if(s2h>=0) emit_mov(s2h,th); + else emit_loadreg(rs2[i]|64,th); + } + #endif + } + } + else { + emit_zeroreg(tl); + if(th>=0) emit_zeroreg(th); + } + } + } + } + if(opcode2[i]==0x2a||opcode2[i]==0x2b) { // SLT/SLTU + if(rt1[i]) { + signed char s1l,s1h,s2l,s2h,t; + if(!((i_regs->was32>>rs1[i])&(i_regs->was32>>rs2[i])&1)) + { + t=get_reg(i_regs->regmap,rt1[i]); + //assert(t>=0); + if(t>=0) { + s1l=get_reg(i_regs->regmap,rs1[i]); + s1h=get_reg(i_regs->regmap,rs1[i]|64); + s2l=get_reg(i_regs->regmap,rs2[i]); + s2h=get_reg(i_regs->regmap,rs2[i]|64); + if(rs2[i]==0) // rx=0); + if(opcode2[i]==0x2a) // SLT + emit_shrimm(s1h,31,t); + else // SLTU (unsigned can not be less than zero) + emit_zeroreg(t); + } + else if(rs1[i]==0) // r0=0); + if(opcode2[i]==0x2a) // SLT + emit_set_gz64_32(s2h,s2l,t); + else // SLTU (set if not zero) + emit_set_nz64_32(s2h,s2l,t); + } + else { + assert(s1l>=0);assert(s1h>=0); + assert(s2l>=0);assert(s2h>=0); + if(opcode2[i]==0x2a) // SLT + emit_set_if_less64_32(s1h,s1l,s2h,s2l,t); + else // SLTU + emit_set_if_carry64_32(s1h,s1l,s2h,s2l,t); + } + } + } else { + t=get_reg(i_regs->regmap,rt1[i]); + //assert(t>=0); + if(t>=0) { + s1l=get_reg(i_regs->regmap,rs1[i]); + s2l=get_reg(i_regs->regmap,rs2[i]); + if(rs2[i]==0) // rx=0); + if(opcode2[i]==0x2a) // SLT + emit_shrimm(s1l,31,t); + else // SLTU (unsigned can not be less than zero) + emit_zeroreg(t); + } + else if(rs1[i]==0) // r0=0); + if(opcode2[i]==0x2a) // SLT + emit_set_gz32(s2l,t); + else // SLTU (set if not zero) + emit_set_nz32(s2l,t); + } + else{ + assert(s1l>=0);assert(s2l>=0); + if(opcode2[i]==0x2a) // SLT + emit_set_if_less32(s1l,s2l,t); + else // SLTU + emit_set_if_carry32(s1l,s2l,t); + } + } + } + } + } + if(opcode2[i]>=0x24&&opcode2[i]<=0x27) { // AND/OR/XOR/NOR + if(rt1[i]) { + signed char s1l,s1h,s2l,s2h,th,tl; + tl=get_reg(i_regs->regmap,rt1[i]); + th=get_reg(i_regs->regmap,rt1[i]|64); + if(!((i_regs->was32>>rs1[i])&(i_regs->was32>>rs2[i])&1)&&th>=0) + { + assert(tl>=0); + if(tl>=0) { + s1l=get_reg(i_regs->regmap,rs1[i]); + s1h=get_reg(i_regs->regmap,rs1[i]|64); + s2l=get_reg(i_regs->regmap,rs2[i]); + s2h=get_reg(i_regs->regmap,rs2[i]|64); + if(rs1[i]&&rs2[i]) { + assert(s1l>=0);assert(s1h>=0); + assert(s2l>=0);assert(s2h>=0); + if(opcode2[i]==0x24) { // AND + emit_and(s1l,s2l,tl); + emit_and(s1h,s2h,th); + } else + if(opcode2[i]==0x25) { // OR + emit_or(s1l,s2l,tl); + emit_or(s1h,s2h,th); + } else + if(opcode2[i]==0x26) { // XOR + emit_xor(s1l,s2l,tl); + emit_xor(s1h,s2h,th); + } else + if(opcode2[i]==0x27) { // NOR + emit_or(s1l,s2l,tl); + emit_or(s1h,s2h,th); + emit_not(tl,tl); + emit_not(th,th); + } + } + else + { + if(opcode2[i]==0x24) { // AND + emit_zeroreg(tl); + emit_zeroreg(th); + } else + if(opcode2[i]==0x25||opcode2[i]==0x26) { // OR/XOR + if(rs1[i]){ + if(s1l>=0) emit_mov(s1l,tl); + else emit_loadreg(rs1[i],tl); + if(s1h>=0) emit_mov(s1h,th); + else emit_loadreg(rs1[i]|64,th); + } + else + if(rs2[i]){ + if(s2l>=0) emit_mov(s2l,tl); + else emit_loadreg(rs2[i],tl); + if(s2h>=0) emit_mov(s2h,th); + else emit_loadreg(rs2[i]|64,th); + } + else{ + emit_zeroreg(tl); + emit_zeroreg(th); + } + } else + if(opcode2[i]==0x27) { // NOR + if(rs1[i]){ + if(s1l>=0) emit_not(s1l,tl); + else{ + emit_loadreg(rs1[i],tl); + emit_not(tl,tl); + } + if(s1h>=0) emit_not(s1h,th); + else{ + emit_loadreg(rs1[i]|64,th); + emit_not(th,th); + } + } + else + if(rs2[i]){ + if(s2l>=0) emit_not(s2l,tl); + else{ + emit_loadreg(rs2[i],tl); + emit_not(tl,tl); + } + if(s2h>=0) emit_not(s2h,th); + else{ + emit_loadreg(rs2[i]|64,th); + emit_not(th,th); + } + } + else { + emit_movimm(-1,tl); + emit_movimm(-1,th); + } + } + } + } + } + else + { + // 32 bit + if(tl>=0) { + s1l=get_reg(i_regs->regmap,rs1[i]); + s2l=get_reg(i_regs->regmap,rs2[i]); + if(rs1[i]&&rs2[i]) { + assert(s1l>=0); + assert(s2l>=0); + if(opcode2[i]==0x24) { // AND + emit_and(s1l,s2l,tl); + } else + if(opcode2[i]==0x25) { // OR + emit_or(s1l,s2l,tl); + } else + if(opcode2[i]==0x26) { // XOR + emit_xor(s1l,s2l,tl); + } else + if(opcode2[i]==0x27) { // NOR + emit_or(s1l,s2l,tl); + emit_not(tl,tl); + } + } + else + { + if(opcode2[i]==0x24) { // AND + emit_zeroreg(tl); + } else + if(opcode2[i]==0x25||opcode2[i]==0x26) { // OR/XOR + if(rs1[i]){ + if(s1l>=0) emit_mov(s1l,tl); + else emit_loadreg(rs1[i],tl); // CHECK: regmap_entry? + } + else + if(rs2[i]){ + if(s2l>=0) emit_mov(s2l,tl); + else emit_loadreg(rs2[i],tl); // CHECK: regmap_entry? + } + else emit_zeroreg(tl); + } else + if(opcode2[i]==0x27) { // NOR + if(rs1[i]){ + if(s1l>=0) emit_not(s1l,tl); + else { + emit_loadreg(rs1[i],tl); + emit_not(tl,tl); + } + } + else + if(rs2[i]){ + if(s2l>=0) emit_not(s2l,tl); + else { + emit_loadreg(rs2[i],tl); + emit_not(tl,tl); + } + } + else emit_movimm(-1,tl); + } + } + } + } + } + } +} + +static void imm16_assemble(int i,struct regstat *i_regs) +{ + if (opcode[i]==0x0f) { // LUI + if(rt1[i]) { + signed char t; + t=get_reg(i_regs->regmap,rt1[i]); + //assert(t>=0); + if(t>=0) { + if(!((i_regs->isconst>>t)&1)) + emit_movimm(imm[i]<<16,t); + } + } + } + if(opcode[i]==0x08||opcode[i]==0x09) { // ADDI/ADDIU + if(rt1[i]) { + signed char s,t; + t=get_reg(i_regs->regmap,rt1[i]); + s=get_reg(i_regs->regmap,rs1[i]); + if(rs1[i]) { + //assert(t>=0); + //assert(s>=0); + if(t>=0) { + if(!((i_regs->isconst>>t)&1)) { + if(s<0) { + if(i_regs->regmap_entry[t]!=rs1[i]) emit_loadreg(rs1[i],t); + emit_addimm(t,imm[i],t); + }else{ + if(!((i_regs->wasconst>>s)&1)) + emit_addimm(s,imm[i],t); + else + emit_movimm(constmap[i][s]+imm[i],t); + } + } + } + } else { + if(t>=0) { + if(!((i_regs->isconst>>t)&1)) + emit_movimm(imm[i],t); + } + } + } + } + if(opcode[i]==0x18||opcode[i]==0x19) { // DADDI/DADDIU + if(rt1[i]) { + signed char sh,sl,th,tl; + th=get_reg(i_regs->regmap,rt1[i]|64); + tl=get_reg(i_regs->regmap,rt1[i]); + sh=get_reg(i_regs->regmap,rs1[i]|64); + sl=get_reg(i_regs->regmap,rs1[i]); + if(tl>=0) { + if(rs1[i]) { + assert(sh>=0); + assert(sl>=0); + if(th>=0) { + emit_addimm64_32(sh,sl,imm[i],th,tl); + } + else { + emit_addimm(sl,imm[i],tl); + } + } else { + emit_movimm(imm[i],tl); + if(th>=0) emit_movimm(((signed int)imm[i])>>31,th); + } + } + } + } + else if(opcode[i]==0x0a||opcode[i]==0x0b) { // SLTI/SLTIU + if(rt1[i]) { + //assert(rs1[i]!=0); // r0 might be valid, but it's probably a bug + signed char sh,sl,t; + t=get_reg(i_regs->regmap,rt1[i]); + sh=get_reg(i_regs->regmap,rs1[i]|64); + sl=get_reg(i_regs->regmap,rs1[i]); + //assert(t>=0); + if(t>=0) { + if(rs1[i]>0) { + if(sh<0) assert((i_regs->was32>>rs1[i])&1); + if(sh<0||((i_regs->was32>>rs1[i])&1)) { + if(opcode[i]==0x0a) { // SLTI + if(sl<0) { + if(i_regs->regmap_entry[t]!=rs1[i]) emit_loadreg(rs1[i],t); + emit_slti32(t,imm[i],t); + }else{ + emit_slti32(sl,imm[i],t); + } + } + else { // SLTIU + if(sl<0) { + if(i_regs->regmap_entry[t]!=rs1[i]) emit_loadreg(rs1[i],t); + emit_sltiu32(t,imm[i],t); + }else{ + emit_sltiu32(sl,imm[i],t); + } + } + }else{ // 64-bit + assert(sl>=0); + if(opcode[i]==0x0a) // SLTI + emit_slti64_32(sh,sl,imm[i],t); + else // SLTIU + emit_sltiu64_32(sh,sl,imm[i],t); + } + }else{ + // SLTI(U) with r0 is just stupid, + // nonetheless examples can be found + if(opcode[i]==0x0a) // SLTI + if(0=0x0c&&opcode[i]<=0x0e) { // ANDI/ORI/XORI + if(rt1[i]) { + signed char sh,sl,th,tl; + th=get_reg(i_regs->regmap,rt1[i]|64); + tl=get_reg(i_regs->regmap,rt1[i]); + sh=get_reg(i_regs->regmap,rs1[i]|64); + sl=get_reg(i_regs->regmap,rs1[i]); + if(tl>=0 && !((i_regs->isconst>>tl)&1)) { + if(opcode[i]==0x0c) //ANDI + { + if(rs1[i]) { + if(sl<0) { + if(i_regs->regmap_entry[tl]!=rs1[i]) emit_loadreg(rs1[i],tl); + emit_andimm(tl,imm[i],tl); + }else{ + if(!((i_regs->wasconst>>sl)&1)) + emit_andimm(sl,imm[i],tl); + else + emit_movimm(constmap[i][sl]&imm[i],tl); + } + } + else + emit_zeroreg(tl); + if(th>=0) emit_zeroreg(th); + } + else + { + if(rs1[i]) { + if(sl<0) { + if(i_regs->regmap_entry[tl]!=rs1[i]) emit_loadreg(rs1[i],tl); + } + if(th>=0) { + if(sh<0) { + emit_loadreg(rs1[i]|64,th); + }else{ + emit_mov(sh,th); + } + } + if(opcode[i]==0x0d) { //ORI + if(sl<0) { + emit_orimm(tl,imm[i],tl); + }else{ + if(!((i_regs->wasconst>>sl)&1)) + emit_orimm(sl,imm[i],tl); + else + emit_movimm(constmap[i][sl]|imm[i],tl); + } + } + if(opcode[i]==0x0e) { //XORI + if(sl<0) { + emit_xorimm(tl,imm[i],tl); + }else{ + if(!((i_regs->wasconst>>sl)&1)) + emit_xorimm(sl,imm[i],tl); + else + emit_movimm(constmap[i][sl]^imm[i],tl); + } + } + } + else { + emit_movimm(imm[i],tl); + if(th>=0) emit_zeroreg(th); + } + } + } + } + } +} + +static void shiftimm_assemble(int i,struct regstat *i_regs) +{ + if(opcode2[i]<=0x3) // SLL/SRL/SRA + { + if(rt1[i]) { + signed char s,t; + t=get_reg(i_regs->regmap,rt1[i]); + s=get_reg(i_regs->regmap,rs1[i]); + //assert(t>=0); + if(t>=0){ + if(rs1[i]==0) + { + emit_zeroreg(t); + } + else + { + if(s<0&&i_regs->regmap_entry[t]!=rs1[i]) emit_loadreg(rs1[i],t); + if(imm[i]) { + if(opcode2[i]==0) // SLL + { + emit_shlimm(s<0?t:s,imm[i],t); + } + if(opcode2[i]==2) // SRL + { + emit_shrimm(s<0?t:s,imm[i],t); + } + if(opcode2[i]==3) // SRA + { + emit_sarimm(s<0?t:s,imm[i],t); + } + }else{ + // Shift by zero + if(s>=0 && s!=t) emit_mov(s,t); + } + } + } + //emit_storereg(rt1[i],t); //DEBUG + } + } + if(opcode2[i]>=0x38&&opcode2[i]<=0x3b) // DSLL/DSRL/DSRA + { + if(rt1[i]) { + signed char sh,sl,th,tl; + th=get_reg(i_regs->regmap,rt1[i]|64); + tl=get_reg(i_regs->regmap,rt1[i]); + sh=get_reg(i_regs->regmap,rs1[i]|64); + sl=get_reg(i_regs->regmap,rs1[i]); + if(tl>=0) { + if(rs1[i]==0) + { + emit_zeroreg(tl); + if(th>=0) emit_zeroreg(th); + } + else + { + assert(sl>=0); + assert(sh>=0); + if(imm[i]) { + if(opcode2[i]==0x38) // DSLL + { + if(th>=0) emit_shldimm(sh,sl,imm[i],th); + emit_shlimm(sl,imm[i],tl); + } + if(opcode2[i]==0x3a) // DSRL + { + emit_shrdimm(sl,sh,imm[i],tl); + if(th>=0) emit_shrimm(sh,imm[i],th); + } + if(opcode2[i]==0x3b) // DSRA + { + emit_shrdimm(sl,sh,imm[i],tl); + if(th>=0) emit_sarimm(sh,imm[i],th); + } + }else{ + // Shift by zero + if(sl!=tl) emit_mov(sl,tl); + if(th>=0&&sh!=th) emit_mov(sh,th); + } + } + } + } + } + if(opcode2[i]==0x3c) // DSLL32 + { + if(rt1[i]) { + signed char sl,tl,th; + tl=get_reg(i_regs->regmap,rt1[i]); + th=get_reg(i_regs->regmap,rt1[i]|64); + sl=get_reg(i_regs->regmap,rs1[i]); + if(th>=0||tl>=0){ + assert(tl>=0); + assert(th>=0); + assert(sl>=0); + emit_mov(sl,th); + emit_zeroreg(tl); + if(imm[i]>32) + { + emit_shlimm(th,imm[i]&31,th); + } + } + } + } + if(opcode2[i]==0x3e) // DSRL32 + { + if(rt1[i]) { + signed char sh,tl,th; + tl=get_reg(i_regs->regmap,rt1[i]); + th=get_reg(i_regs->regmap,rt1[i]|64); + sh=get_reg(i_regs->regmap,rs1[i]|64); + if(tl>=0){ + assert(sh>=0); + emit_mov(sh,tl); + if(th>=0) emit_zeroreg(th); + if(imm[i]>32) + { + emit_shrimm(tl,imm[i]&31,tl); + } + } + } + } + if(opcode2[i]==0x3f) // DSRA32 + { + if(rt1[i]) { + signed char sh,tl; + tl=get_reg(i_regs->regmap,rt1[i]); + sh=get_reg(i_regs->regmap,rs1[i]|64); + if(tl>=0){ + assert(sh>=0); + emit_mov(sh,tl); + if(imm[i]>32) + { + emit_sarimm(tl,imm[i]&31,tl); + } + } + } + } +} + +#ifndef shift_assemble +void shift_assemble(int i,struct regstat *i_regs) +{ + DebugMessage(M64MSG_ERROR, "Need shift_assemble for this architecture."); + exit(1); +} +#endif + +static void load_assemble(int i,struct regstat *i_regs) +{ + int s,th,tl,addr,map=-1,cache=-1; + int offset; + int jaddr=0; + int memtarget,c=0; + u_int hr,reglist=0; + th=get_reg(i_regs->regmap,rt1[i]|64); + tl=get_reg(i_regs->regmap,rt1[i]); + s=get_reg(i_regs->regmap,rs1[i]); + offset=imm[i]; + for(hr=0;hrregmap[hr]>=0) reglist|=1<regmap[HOST_CCREG]==CCREG) reglist&=~(1<=0) { + c=(i_regs->wasconst>>s)&1; + memtarget=((signed int)(constmap[i][s]+offset))<(signed int)0x80800000; + if(using_tlb&&((signed int)(constmap[i][s]+offset))>=(signed int)0xC0000000) memtarget=1; + } + if(tl<0) tl=get_reg(i_regs->regmap,-1); + if(offset||s<0||c) addr=tl; + else addr=s; + //DebugMessage(M64MSG_VERBOSE, "load_assemble: c=%d",c); + //if(c) DebugMessage(M64MSG_VERBOSE, "load_assemble: const=%x",(int)constmap[i][s]+offset); + assert(tl>=0); // Even if the load is a NOP, we must check for pagefaults and I/O + reglist&=~(1<=0) reglist&=~(1<regmap,ROREG); + if(map<0) emit_loadreg(ROREG,map=HOST_TEMPREG); + #endif +//#define R29_HACK 1 + #ifdef R29_HACK + // Strmnnrmn's speed hack + if(rs1[i]!=29||start<0x80001000||start>=0x80800000) + #endif + { + emit_cmpimm(addr,0x800000); + jaddr=(int)out; + #ifdef CORTEX_A8_BRANCH_PREDICTION_HACK + // Hint to branch predictor that the branch is unlikely to be taken + if(rs1[i]>=28) + emit_jno_unlikely(0); + else + #endif + emit_jno(0); + } + } + }else{ // using tlb + int x=0; + if (opcode[i]==0x20||opcode[i]==0x24) x=3; // LB/LBU + if (opcode[i]==0x21||opcode[i]==0x25) x=2; // LH/LHU + map=get_reg(i_regs->regmap,TLREG); + cache=get_reg(i_regs->regmap,MMREG); + assert(map>=0); + reglist&=~(1<regmap,rt1[i])); // ignore loads to r0 and unneeded reg + if (opcode[i]==0x20) { // LB + if(!c||memtarget) { + if(!dummy) { + #ifdef HOST_IMM_ADDR32 + if(c) + emit_movsbl_tlb((constmap[i][s]+offset)^3,map,tl); + else + #endif + { + //emit_xorimm(addr,3,tl); + //gen_tlb_addr_r(tl,map); + //emit_movsbl_indexed((int)rdram-0x80000000,tl,tl); + int x=0; + if(!c) emit_xorimm(addr,3,tl); + else x=((constmap[i][s]+offset)^3)-(constmap[i][s]+offset); + emit_movsbl_indexed_tlb(x,tl,map,tl); + } + } + if(jaddr) + add_stub(LOADB_STUB,jaddr,(int)out,i,addr,(int)i_regs,ccadj[i],reglist); + } + else + inline_readstub(LOADB_STUB,i,constmap[i][s]+offset,i_regs->regmap,rt1[i],ccadj[i],reglist); + } + if (opcode[i]==0x21) { // LH + if(!c||memtarget) { + if(!dummy) { + #ifdef HOST_IMM_ADDR32 + if(c) + emit_movswl_tlb((constmap[i][s]+offset)^2,map,tl); + else + #endif + { + int x=0; + if(!c) emit_xorimm(addr,2,tl); + else x=((constmap[i][s]+offset)^2)-(constmap[i][s]+offset); + //#ifdef + //emit_movswl_indexed_tlb(x,tl,map,tl); + //else + if(map>=0) { + gen_tlb_addr_r(tl,map); + emit_movswl_indexed(x,tl,tl); + }else{ + #ifdef RAM_OFFSET + emit_movswl_indexed(x,tl,tl); + #else + emit_movswl_indexed((int)rdram-0x80000000+x,tl,tl); + #endif + } + } + } + if(jaddr) + add_stub(LOADH_STUB,jaddr,(int)out,i,addr,(int)i_regs,ccadj[i],reglist); + } + else + inline_readstub(LOADH_STUB,i,constmap[i][s]+offset,i_regs->regmap,rt1[i],ccadj[i],reglist); + } + if (opcode[i]==0x23) { // LW + if(!c||memtarget) { + if(!dummy) { + //emit_readword_indexed((int)rdram-0x80000000,addr,tl); + #ifdef HOST_IMM_ADDR32 + if(c) + emit_readword_tlb(constmap[i][s]+offset,map,tl); + else + #endif + emit_readword_indexed_tlb(0,addr,map,tl); + } + if(jaddr) + add_stub(LOADW_STUB,jaddr,(int)out,i,addr,(int)i_regs,ccadj[i],reglist); + } + else + inline_readstub(LOADW_STUB,i,constmap[i][s]+offset,i_regs->regmap,rt1[i],ccadj[i],reglist); + } + if (opcode[i]==0x24) { // LBU + if(!c||memtarget) { + if(!dummy) { + #ifdef HOST_IMM_ADDR32 + if(c) + emit_movzbl_tlb((constmap[i][s]+offset)^3,map,tl); + else + #endif + { + //emit_xorimm(addr,3,tl); + //gen_tlb_addr_r(tl,map); + //emit_movzbl_indexed((int)rdram-0x80000000,tl,tl); + int x=0; + if(!c) emit_xorimm(addr,3,tl); + else x=((constmap[i][s]+offset)^3)-(constmap[i][s]+offset); + emit_movzbl_indexed_tlb(x,tl,map,tl); + } + } + if(jaddr) + add_stub(LOADBU_STUB,jaddr,(int)out,i,addr,(int)i_regs,ccadj[i],reglist); + } + else + inline_readstub(LOADBU_STUB,i,constmap[i][s]+offset,i_regs->regmap,rt1[i],ccadj[i],reglist); + } + if (opcode[i]==0x25) { // LHU + if(!c||memtarget) { + if(!dummy) { + #ifdef HOST_IMM_ADDR32 + if(c) + emit_movzwl_tlb((constmap[i][s]+offset)^2,map,tl); + else + #endif + { + int x=0; + if(!c) emit_xorimm(addr,2,tl); + else x=((constmap[i][s]+offset)^2)-(constmap[i][s]+offset); + //#ifdef + //emit_movzwl_indexed_tlb(x,tl,map,tl); + //#else + if(map>=0) { + gen_tlb_addr_r(tl,map); + emit_movzwl_indexed(x,tl,tl); + }else{ + #ifdef RAM_OFFSET + emit_movzwl_indexed(x,tl,tl); + #else + emit_movzwl_indexed((int)rdram-0x80000000+x,tl,tl); + #endif + } + } + } + if(jaddr) + add_stub(LOADHU_STUB,jaddr,(int)out,i,addr,(int)i_regs,ccadj[i],reglist); + } + else + inline_readstub(LOADHU_STUB,i,constmap[i][s]+offset,i_regs->regmap,rt1[i],ccadj[i],reglist); + } + if (opcode[i]==0x27) { // LWU + assert(th>=0); + if(!c||memtarget) { + if(!dummy) { + //emit_readword_indexed((int)rdram-0x80000000,addr,tl); + #ifdef HOST_IMM_ADDR32 + if(c) + emit_readword_tlb(constmap[i][s]+offset,map,tl); + else + #endif + emit_readword_indexed_tlb(0,addr,map,tl); + } + if(jaddr) + add_stub(LOADW_STUB,jaddr,(int)out,i,addr,(int)i_regs,ccadj[i],reglist); + } + else { + inline_readstub(LOADW_STUB,i,constmap[i][s]+offset,i_regs->regmap,rt1[i],ccadj[i],reglist); + } + emit_zeroreg(th); + } + if (opcode[i]==0x37) { // LD + if(!c||memtarget) { + if(!dummy) { + //gen_tlb_addr_r(tl,map); + //if(th>=0) emit_readword_indexed((int)rdram-0x80000000,addr,th); + //emit_readword_indexed((int)rdram-0x7FFFFFFC,addr,tl); + #ifdef HOST_IMM_ADDR32 + if(c) + emit_readdword_tlb(constmap[i][s]+offset,map,th,tl); + else + #endif + emit_readdword_indexed_tlb(0,addr,map,th,tl); + } + if(jaddr) + add_stub(LOADD_STUB,jaddr,(int)out,i,addr,(int)i_regs,ccadj[i],reglist); + } + else + inline_readstub(LOADD_STUB,i,constmap[i][s]+offset,i_regs->regmap,rt1[i],ccadj[i],reglist); + } + //emit_storereg(rt1[i],tl); // DEBUG + //if(opcode[i]==0x23) + //if(opcode[i]==0x24) + //if(opcode[i]==0x23||opcode[i]==0x24) + /*if(opcode[i]==0x21||opcode[i]==0x23||opcode[i]==0x24) + { + //emit_pusha(); + save_regs(0x100f); + emit_readword((int)&last_count,ECX); + #if NEW_DYNAREC == NEW_DYNAREC_X86 + if(get_reg(i_regs->regmap,CCREG)<0) + emit_loadreg(CCREG,HOST_CCREG); + emit_add(HOST_CCREG,ECX,HOST_CCREG); + emit_addimm(HOST_CCREG,2*ccadj[i],HOST_CCREG); + emit_writeword(HOST_CCREG,(int)&Count); + #endif + #if NEW_DYNAREC == NEW_DYNAREC_ARM + if(get_reg(i_regs->regmap,CCREG)<0) + emit_loadreg(CCREG,0); + else + emit_mov(HOST_CCREG,0); + emit_add(0,ECX,0); + emit_addimm(0,2*ccadj[i],0); + emit_writeword(0,(int)&Count); + #endif + emit_call((int)memdebug); + //emit_popa(); + restore_regs(0x100f); + }*/ +} + +#ifndef loadlr_assemble +static void loadlr_assemble(int i,struct regstat *i_regs) +{ + DebugMessage(M64MSG_ERROR, "Need loadlr_assemble for this architecture."); + exit(1); +} +#endif + +static void store_assemble(int i,struct regstat *i_regs) +{ + int s,th,tl,map=-1,cache=-1; + int addr,temp; + int offset; + int jaddr=0,jaddr2,type; + int memtarget,c=0; + int agr=AGEN1+(i&1); + u_int hr,reglist=0; + th=get_reg(i_regs->regmap,rs2[i]|64); + tl=get_reg(i_regs->regmap,rs2[i]); + s=get_reg(i_regs->regmap,rs1[i]); + temp=get_reg(i_regs->regmap,agr); + if(temp<0) temp=get_reg(i_regs->regmap,-1); + offset=imm[i]; + if(s>=0) { + c=(i_regs->wasconst>>s)&1; + memtarget=((signed int)(constmap[i][s]+offset))<(signed int)0x80800000; + if(using_tlb&&((signed int)(constmap[i][s]+offset))>=(signed int)0xC0000000) memtarget=1; + } + assert(tl>=0); + assert(temp>=0); + for(hr=0;hrregmap[hr]>=0) reglist|=1<regmap[HOST_CCREG]==CCREG) reglist&=~(1<regmap,ROREG); + if(map<0) emit_loadreg(ROREG,map=HOST_TEMPREG); + #endif + if(!c) { + #ifdef R29_HACK + // Strmnnrmn's speed hack + memtarget=1; + if(rs1[i]!=29||start<0x80001000||start>=0x80800000) + #endif + emit_cmpimm(addr,0x800000); + #ifdef DESTRUCTIVE_SHIFT + if(s==addr) emit_mov(s,temp); + #endif + #ifdef R29_HACK + if(rs1[i]!=29||start<0x80001000||start>=0x80800000) + #endif + { + jaddr=(int)out; + #ifdef CORTEX_A8_BRANCH_PREDICTION_HACK + // Hint to branch predictor that the branch is unlikely to be taken + if(rs1[i]>=28) + emit_jno_unlikely(0); + else + #endif + emit_jno(0); + } + } + }else{ // using tlb + int x=0; + if (opcode[i]==0x28) x=3; // SB + if (opcode[i]==0x29) x=2; // SH + map=get_reg(i_regs->regmap,TLREG); + cache=get_reg(i_regs->regmap,MMREG); + assert(map>=0); + reglist&=~(1<=0) { + gen_tlb_addr_w(temp,map); + emit_writehword_indexed(tl,x,temp); + }else + emit_writehword_indexed(tl,(int)rdram-0x80000000+x,temp); + } + type=STOREH_STUB; + } + if (opcode[i]==0x2B) { // SW + if(!c||memtarget) + //emit_writeword_indexed(tl,(int)rdram-0x80000000,addr); + emit_writeword_indexed_tlb(tl,0,addr,map,temp); + type=STOREW_STUB; + } + if (opcode[i]==0x3F) { // SD + if(!c||memtarget) { + if(rs2[i]) { + assert(th>=0); + //emit_writeword_indexed(th,(int)rdram-0x80000000,addr); + //emit_writeword_indexed(tl,(int)rdram-0x7FFFFFFC,addr); + emit_writedword_indexed_tlb(th,tl,0,addr,map,temp); + }else{ + // Store zero + //emit_writeword_indexed(tl,(int)rdram-0x80000000,temp); + //emit_writeword_indexed(tl,(int)rdram-0x7FFFFFFC,temp); + emit_writedword_indexed_tlb(tl,tl,0,addr,map,temp); + } + } + type=STORED_STUB; + } + if(!using_tlb) { + if(!c||memtarget) { + #ifdef DESTRUCTIVE_SHIFT + // The x86 shift operation is 'destructive'; it overwrites the + // source register, so we need to make a copy first and use that. + addr=temp; + #endif + #if defined(HOST_IMM8) + int ir=get_reg(i_regs->regmap,INVCP); + assert(ir>=0); + emit_cmpmem_indexedsr12_reg(ir,addr,1); + #else + emit_cmpmem_indexedsr12_imm((int)invalid_code,addr,1); + #endif + #if defined(HAVE_CONDITIONAL_CALL) && !defined(DESTRUCTIVE_SHIFT) + emit_callne(invalidate_addr_reg[addr]); + #else + jaddr2=(int)out; + emit_jne(0); + add_stub(INVCODE_STUB,jaddr2,(int)out,reglist|(1<regmap,rs2[i],ccadj[i],reglist); + } + //if(opcode[i]==0x2B || opcode[i]==0x3F) + //if(opcode[i]==0x2B || opcode[i]==0x28) + //if(opcode[i]==0x2B || opcode[i]==0x29) + //if(opcode[i]==0x2B) + +// Uncomment for extra debug output: +/* + if(opcode[i]==0x2B || opcode[i]==0x28 || opcode[i]==0x29 || opcode[i]==0x3F) + { + #if NEW_DYNAREC == NEW_DYNAREC_X86 + emit_pusha(); + #endif + #if NEW_DYNAREC == NEW_DYNAREC_ARM + save_regs(0x100f); + #endif + emit_readword((int)&last_count,ECX); + #if NEW_DYNAREC == NEW_DYNAREC_X86 + if(get_reg(i_regs->regmap,CCREG)<0) + emit_loadreg(CCREG,HOST_CCREG); + emit_add(HOST_CCREG,ECX,HOST_CCREG); + emit_addimm(HOST_CCREG,2*ccadj[i],HOST_CCREG); + emit_writeword(HOST_CCREG,(int)&Count); + #endif + #if NEW_DYNAREC == NEW_DYNAREC_ARM + if(get_reg(i_regs->regmap,CCREG)<0) + emit_loadreg(CCREG,0); + else + emit_mov(HOST_CCREG,0); + emit_add(0,ECX,0); + emit_addimm(0,2*ccadj[i],0); + emit_writeword(0,(int)&Count); + #endif + emit_call((int)memdebug); + #if NEW_DYNAREC == NEW_DYNAREC_X86 + emit_popa(); + #endif + #if NEW_DYNAREC == NEW_DYNAREC_ARM + restore_regs(0x100f); + #endif + } +*/ +} + +static void storelr_assemble(int i,struct regstat *i_regs) +{ + int s,th,tl; + int temp; + int temp2; + int offset; + int jaddr=0,jaddr2; + int case1,case2,case3; + int done0,done1,done2; + int memtarget,c=0; + int agr=AGEN1+(i&1); + u_int hr,reglist=0; + th=get_reg(i_regs->regmap,rs2[i]|64); + tl=get_reg(i_regs->regmap,rs2[i]); + s=get_reg(i_regs->regmap,rs1[i]); + temp=get_reg(i_regs->regmap,agr); + if(temp<0) temp=get_reg(i_regs->regmap,-1); + offset=imm[i]; + if(s>=0) { + c=(i_regs->isconst>>s)&1; + memtarget=((signed int)(constmap[i][s]+offset))<(signed int)0x80800000; + if(using_tlb&&((signed int)(constmap[i][s]+offset))>=(signed int)0xC0000000) memtarget=1; + } + assert(tl>=0); + for(hr=0;hrregmap[hr]>=0) reglist|=1<=0); + if(!using_tlb) { + if(!c) { + emit_cmpimm(s<0||offset?temp:s,0x800000); + if(!offset&&s!=temp) emit_mov(s,temp); + jaddr=(int)out; + emit_jno(0); + } + else + { + if(!memtarget||!rs1[i]) { + jaddr=(int)out; + emit_jmp(0); + } + } + #ifdef RAM_OFFSET + int map=get_reg(i_regs->regmap,ROREG); + if(map<0) emit_loadreg(ROREG,map=HOST_TEMPREG); + gen_tlb_addr_w(temp,map); + #else + if((u_int)rdram!=0x80000000) + emit_addimm_no_flags((u_int)rdram-(u_int)0x80000000,temp); + #endif + }else{ // using tlb + int map=get_reg(i_regs->regmap,TLREG); + int cache=get_reg(i_regs->regmap,MMREG); + assert(map>=0); + reglist&=~(1<=0) emit_mov(s,temp); + do_tlb_w_branch(map,c,constmap[i][s]+offset,&jaddr); + if(!jaddr&&!memtarget) { + jaddr=(int)out; + emit_jmp(0); + } + gen_tlb_addr_w(temp,map); + } + + if (opcode[i]==0x2C||opcode[i]==0x2D) { // SDL/SDR + temp2=get_reg(i_regs->regmap,FTEMP); + if(!rs2[i]) temp2=th=tl; + } + + emit_testimm(temp,2); + case2=(int)out; + emit_jne(0); + emit_testimm(temp,1); + case1=(int)out; + emit_jne(0); + // 0 + if (opcode[i]==0x2A) { // SWL + emit_writeword_indexed(tl,0,temp); + } + if (opcode[i]==0x2E) { // SWR + emit_writebyte_indexed(tl,3,temp); + } + if (opcode[i]==0x2C) { // SDL + emit_writeword_indexed(th,0,temp); + if(rs2[i]) emit_mov(tl,temp2); + } + if (opcode[i]==0x2D) { // SDR + emit_writebyte_indexed(tl,3,temp); + if(rs2[i]) emit_shldimm(th,tl,24,temp2); + } + done0=(int)out; + emit_jmp(0); + // 1 + set_jump_target(case1,(int)out); + if (opcode[i]==0x2A) { // SWL + // Write 3 msb into three least significant bytes + if(rs2[i]) emit_rorimm(tl,8,tl); + emit_writehword_indexed(tl,-1,temp); + if(rs2[i]) emit_rorimm(tl,16,tl); + emit_writebyte_indexed(tl,1,temp); + if(rs2[i]) emit_rorimm(tl,8,tl); + } + if (opcode[i]==0x2E) { // SWR + // Write two lsb into two most significant bytes + emit_writehword_indexed(tl,1,temp); + } + if (opcode[i]==0x2C) { // SDL + if(rs2[i]) emit_shrdimm(tl,th,8,temp2); + // Write 3 msb into three least significant bytes + if(rs2[i]) emit_rorimm(th,8,th); + emit_writehword_indexed(th,-1,temp); + if(rs2[i]) emit_rorimm(th,16,th); + emit_writebyte_indexed(th,1,temp); + if(rs2[i]) emit_rorimm(th,8,th); + } + if (opcode[i]==0x2D) { // SDR + if(rs2[i]) emit_shldimm(th,tl,16,temp2); + // Write two lsb into two most significant bytes + emit_writehword_indexed(tl,1,temp); + } + done1=(int)out; + emit_jmp(0); + // 2 + set_jump_target(case2,(int)out); + emit_testimm(temp,1); + case3=(int)out; + emit_jne(0); + if (opcode[i]==0x2A) { // SWL + // Write two msb into two least significant bytes + if(rs2[i]) emit_rorimm(tl,16,tl); + emit_writehword_indexed(tl,-2,temp); + if(rs2[i]) emit_rorimm(tl,16,tl); + } + if (opcode[i]==0x2E) { // SWR + // Write 3 lsb into three most significant bytes + emit_writebyte_indexed(tl,-1,temp); + if(rs2[i]) emit_rorimm(tl,8,tl); + emit_writehword_indexed(tl,0,temp); + if(rs2[i]) emit_rorimm(tl,24,tl); + } + if (opcode[i]==0x2C) { // SDL + if(rs2[i]) emit_shrdimm(tl,th,16,temp2); + // Write two msb into two least significant bytes + if(rs2[i]) emit_rorimm(th,16,th); + emit_writehword_indexed(th,-2,temp); + if(rs2[i]) emit_rorimm(th,16,th); + } + if (opcode[i]==0x2D) { // SDR + if(rs2[i]) emit_shldimm(th,tl,8,temp2); + // Write 3 lsb into three most significant bytes + emit_writebyte_indexed(tl,-1,temp); + if(rs2[i]) emit_rorimm(tl,8,tl); + emit_writehword_indexed(tl,0,temp); + if(rs2[i]) emit_rorimm(tl,24,tl); + } + done2=(int)out; + emit_jmp(0); + // 3 + set_jump_target(case3,(int)out); + if (opcode[i]==0x2A) { // SWL + // Write msb into least significant byte + if(rs2[i]) emit_rorimm(tl,24,tl); + emit_writebyte_indexed(tl,-3,temp); + if(rs2[i]) emit_rorimm(tl,8,tl); + } + if (opcode[i]==0x2E) { // SWR + // Write entire word + emit_writeword_indexed(tl,-3,temp); + } + if (opcode[i]==0x2C) { // SDL + if(rs2[i]) emit_shrdimm(tl,th,24,temp2); + // Write msb into least significant byte + if(rs2[i]) emit_rorimm(th,24,th); + emit_writebyte_indexed(th,-3,temp); + if(rs2[i]) emit_rorimm(th,8,th); + } + if (opcode[i]==0x2D) { // SDR + if(rs2[i]) emit_mov(th,temp2); + // Write entire word + emit_writeword_indexed(tl,-3,temp); + } + set_jump_target(done0,(int)out); + set_jump_target(done1,(int)out); + set_jump_target(done2,(int)out); + if (opcode[i]==0x2C) { // SDL + emit_testimm(temp,4); + done0=(int)out; + emit_jne(0); + emit_andimm(temp,~3,temp); + emit_writeword_indexed(temp2,4,temp); + set_jump_target(done0,(int)out); + } + if (opcode[i]==0x2D) { // SDR + emit_testimm(temp,4); + done0=(int)out; + emit_jeq(0); + emit_andimm(temp,~3,temp); + emit_writeword_indexed(temp2,-4,temp); + set_jump_target(done0,(int)out); + } + if(!c||!memtarget) + add_stub(STORELR_STUB,jaddr,(int)out,0,(int)i_regs,rs2[i],ccadj[i],reglist); + if(!using_tlb) { + #ifdef RAM_OFFSET + int map=get_reg(i_regs->regmap,ROREG); + if(map<0) map=HOST_TEMPREG; + gen_orig_addr_w(temp,map); + #else + emit_addimm_no_flags((u_int)0x80000000-(u_int)rdram,temp); + #endif + #if defined(HOST_IMM8) + int ir=get_reg(i_regs->regmap,INVCP); + assert(ir>=0); + emit_cmpmem_indexedsr12_reg(ir,temp,1); + #else + emit_cmpmem_indexedsr12_imm((int)invalid_code,temp,1); + #endif + #if defined(HAVE_CONDITIONAL_CALL) && !defined(DESTRUCTIVE_SHIFT) + emit_callne(invalidate_addr_reg[temp]); + #else + jaddr2=(int)out; + emit_jne(0); + add_stub(INVCODE_STUB,jaddr2,(int)out,reglist|(1<regmap,CCREG)<0) + emit_loadreg(CCREG,HOST_CCREG); + emit_add(HOST_CCREG,ECX,HOST_CCREG); + emit_addimm(HOST_CCREG,2*ccadj[i],HOST_CCREG); + emit_writeword(HOST_CCREG,(int)&Count); + emit_call((int)memdebug); + emit_popa(); + //restore_regs(0x100f); + */ +} + +static void c1ls_assemble(int i,struct regstat *i_regs) +{ + int s,th,tl; + int temp,ar; + int map=-1; + int offset; + int c=0; + int jaddr,jaddr2=0,jaddr3,type; + int agr=AGEN1+(i&1); + u_int hr,reglist=0; + th=get_reg(i_regs->regmap,FTEMP|64); + tl=get_reg(i_regs->regmap,FTEMP); + s=get_reg(i_regs->regmap,rs1[i]); + temp=get_reg(i_regs->regmap,agr); + if(temp<0) temp=get_reg(i_regs->regmap,-1); + offset=imm[i]; + assert(tl>=0); + assert(rs1[i]>0); + assert(temp>=0); + for(hr=0;hrregmap[hr]>=0) reglist|=1<regmap[HOST_CCREG]==CCREG) reglist&=~(1<wasconst>>s)&1; + if(s>=0) c=(i_regs->wasconst>>s)&1; + // Check cop1 unusable + if(!cop1_usable) { + signed char rs=get_reg(i_regs->regmap,CSREG); + assert(rs>=0); + emit_testimm(rs,0x20000000); + jaddr=(int)out; + emit_jeq(0); + add_stub(FP_STUB,jaddr,(int)out,i,rs,(int)i_regs,is_delayslot,0); + cop1_usable=1; + } + if (opcode[i]==0x39) { // SWC1 (get float address) + emit_readword((int)®_cop1_simple[(source[i]>>16)&0x1f],tl); + } + if (opcode[i]==0x3D) { // SDC1 (get double address) + emit_readword((int)®_cop1_double[(source[i]>>16)&0x1f],tl); + } + // Generate address + offset + if(!using_tlb) { + #ifdef RAM_OFFSET + if (!c||opcode[i]==0x39||opcode[i]==0x3D) // SWC1/SDC1 + { + map=get_reg(i_regs->regmap,ROREG); + if(map<0) emit_loadreg(ROREG,map=HOST_TEMPREG); + } + #endif + if(!c) + emit_cmpimm(offset||c||s<0?ar:s,0x800000); + } + else + { + map=get_reg(i_regs->regmap,TLREG); + int cache=get_reg(i_regs->regmap,MMREG); + assert(map>=0); + reglist&=~(1<>16)&0x1f],temp); + } + if (opcode[i]==0x35) { // LDC1 (get target address) + emit_readword((int)®_cop1_double[(source[i]>>16)&0x1f],temp); + } + if(!using_tlb) { + if(!c) { + jaddr2=(int)out; + emit_jno(0); + } + else if(((signed int)(constmap[i][s]+offset))>=(signed int)0x80800000) { + jaddr2=(int)out; + emit_jmp(0); // inline_readstub/inline_writestub? Very rare case + } + #ifdef DESTRUCTIVE_SHIFT + if (opcode[i]==0x39||opcode[i]==0x3D) { // SWC1/SDC1 + if(!offset&&!c&&s>=0) emit_mov(s,ar); + } + #endif + }else{ + if (opcode[i]==0x31||opcode[i]==0x35) { // LWC1/LDC1 + do_tlb_r_branch(map,c,constmap[i][s]+offset,&jaddr2); + } + if (opcode[i]==0x39||opcode[i]==0x3D) { // SWC1/SDC1 + do_tlb_w_branch(map,c,constmap[i][s]+offset,&jaddr2); + } + } + if (opcode[i]==0x31) { // LWC1 + //if(s>=0&&!c&&!offset) emit_mov(s,tl); + //gen_tlb_addr_r(ar,map); + //emit_readword_indexed((int)rdram-0x80000000,tl,tl); + #ifdef HOST_IMM_ADDR32 + if(c) emit_readword_tlb(constmap[i][s]+offset,map,tl); + else + #endif + emit_readword_indexed_tlb(0,offset||c||s<0?tl:s,map,tl); + type=LOADW_STUB; + } + if (opcode[i]==0x35) { // LDC1 + assert(th>=0); + //if(s>=0&&!c&&!offset) emit_mov(s,tl); + //gen_tlb_addr_r(ar,map); + //emit_readword_indexed((int)rdram-0x80000000,tl,th); + //emit_readword_indexed((int)rdram-0x7FFFFFFC,tl,tl); + #ifdef HOST_IMM_ADDR32 + if(c) emit_readdword_tlb(constmap[i][s]+offset,map,th,tl); + else + #endif + emit_readdword_indexed_tlb(0,offset||c||s<0?tl:s,map,th,tl); + type=LOADD_STUB; + } + if (opcode[i]==0x39) { // SWC1 + //emit_writeword_indexed(tl,(int)rdram-0x80000000,temp); + emit_writeword_indexed_tlb(tl,0,offset||c||s<0?temp:s,map,temp); + type=STOREW_STUB; + } + if (opcode[i]==0x3D) { // SDC1 + assert(th>=0); + //emit_writeword_indexed(th,(int)rdram-0x80000000,temp); + //emit_writeword_indexed(tl,(int)rdram-0x7FFFFFFC,temp); + emit_writedword_indexed_tlb(th,tl,0,offset||c||s<0?temp:s,map,temp); + type=STORED_STUB; + } + if(!using_tlb) { + if (opcode[i]==0x39||opcode[i]==0x3D) { // SWC1/SDC1 + #ifndef DESTRUCTIVE_SHIFT + temp=offset||c||s<0?ar:s; + #endif + #if defined(HOST_IMM8) + int ir=get_reg(i_regs->regmap,INVCP); + assert(ir>=0); + emit_cmpmem_indexedsr12_reg(ir,temp,1); + #else + emit_cmpmem_indexedsr12_imm((int)invalid_code,temp,1); + #endif + #if defined(HAVE_CONDITIONAL_CALL) && !defined(DESTRUCTIVE_SHIFT) + emit_callne(invalidate_addr_reg[temp]); + #else + jaddr3=(int)out; + emit_jne(0); + add_stub(INVCODE_STUB,jaddr3,(int)out,reglist|(1<regmap,CCREG)<0) + emit_loadreg(CCREG,HOST_CCREG); + emit_add(HOST_CCREG,ECX,HOST_CCREG); + emit_addimm(HOST_CCREG,2*ccadj[i],HOST_CCREG); + emit_writeword(HOST_CCREG,(int)&Count); + emit_call((int)memdebug); + emit_popa(); + }*/ +} + +#ifndef multdiv_assemble +void multdiv_assemble(int i,struct regstat *i_regs) +{ + DebugMessage(M64MSG_ERROR, "Need multdiv_assemble for this architecture."); + exit(1); +} +#endif + +static void mov_assemble(int i,struct regstat *i_regs) +{ + //if(opcode2[i]==0x10||opcode2[i]==0x12) { // MFHI/MFLO + //if(opcode2[i]==0x11||opcode2[i]==0x13) { // MTHI/MTLO + if(rt1[i]) { + signed char sh,sl,th,tl; + th=get_reg(i_regs->regmap,rt1[i]|64); + tl=get_reg(i_regs->regmap,rt1[i]); + //assert(tl>=0); + if(tl>=0) { + sh=get_reg(i_regs->regmap,rs1[i]|64); + sl=get_reg(i_regs->regmap,rs1[i]); + if(sl>=0) emit_mov(sl,tl); + else emit_loadreg(rs1[i],tl); + if(th>=0) { + if(sh>=0) emit_mov(sh,th); + else emit_loadreg(rs1[i]|64,th); + } + } + } +} + +#ifndef fconv_assemble +void fconv_assemble(int i,struct regstat *i_regs) +{ + DebugMessage(M64MSG_ERROR, "Need fconv_assemble for this architecture."); + exit(1); +} +#endif + +#if 0 +static void float_assemble(int i,struct regstat *i_regs) +{ + DebugMessage(M64MSG_ERROR, "Need float_assemble for this architecture."); + exit(1); +} +#endif + +static void syscall_assemble(int i,struct regstat *i_regs) +{ + signed char ccreg=get_reg(i_regs->regmap,CCREG); + assert(ccreg==HOST_CCREG); + assert(!is_delayslot); + emit_movimm(start+i*4,EAX); // Get PC + emit_addimm(HOST_CCREG,CLOCK_DIVIDER*ccadj[i],HOST_CCREG); // CHECK: is this right? There should probably be an extra cycle... + emit_jmp((int)jump_syscall); +} + +static void ds_assemble(int i,struct regstat *i_regs) +{ + is_delayslot=1; + switch(itype[i]) { + case ALU: + alu_assemble(i,i_regs);break; + case IMM16: + imm16_assemble(i,i_regs);break; + case SHIFT: + shift_assemble(i,i_regs);break; + case SHIFTIMM: + shiftimm_assemble(i,i_regs);break; + case LOAD: + load_assemble(i,i_regs);break; + case LOADLR: + loadlr_assemble(i,i_regs);break; + case STORE: + store_assemble(i,i_regs);break; + case STORELR: + storelr_assemble(i,i_regs);break; + case COP0: + cop0_assemble(i,i_regs);break; + case COP1: + cop1_assemble(i,i_regs);break; + case C1LS: + c1ls_assemble(i,i_regs);break; + case FCONV: + fconv_assemble(i,i_regs);break; + case FLOAT: + float_assemble(i,i_regs);break; + case FCOMP: + fcomp_assemble(i,i_regs);break; + case MULTDIV: + multdiv_assemble(i,i_regs);break; + case MOV: + mov_assemble(i,i_regs);break; + case SYSCALL: + case SPAN: + case UJUMP: + case RJUMP: + case CJUMP: + case SJUMP: + case FJUMP: + DebugMessage(M64MSG_VERBOSE, "Jump in the delay slot. This is probably a bug."); + } + is_delayslot=0; +} + +// Is the branch target a valid internal jump? +static int internal_branch(uint64_t i_is32,int addr) +{ + if(addr&1) return 0; // Indirect (register) jump + if(addr>=start && addr>2; + // Delay slots are not valid branch targets + //if(t>0&&(itype[t-1]==RJUMP||itype[t-1]==UJUMP||itype[t-1]==CJUMP||itype[t-1]==SJUMP||itype[t-1]==FJUMP)) return 0; + // 64 -> 32 bit transition requires a recompile + /*if(is32[t]&~unneeded_reg_upper[t]&~i_is32) + { + if(requires_32bit[t]&~i_is32) DebugMessage(M64MSG_VERBOSE, "optimizable: no"); + else DebugMessage(M64MSG_VERBOSE, "optimizable: yes"); + }*/ + //if(is32[t]&~unneeded_reg_upper[t]&~i_is32) return 0; + if(requires_32bit[t]&~i_is32) return 0; + else return 1; + } + return 0; +} + +#ifndef wb_invalidate +static void wb_invalidate(signed char pre[],signed char entry[],uint64_t dirty,uint64_t is32, + uint64_t u,uint64_t uu) +{ + int hr; + for(hr=0;hr=0) { + if((dirty>>hr)&1) { + if(get_reg(entry,pre[hr])<0) { + if(pre[hr]<64) { + if(!((u>>pre[hr])&1)) { + emit_storereg(pre[hr],hr); + if( ((is32>>pre[hr])&1) && !((uu>>pre[hr])&1) ) { + emit_sarimm(hr,31,hr); + emit_storereg(pre[hr]|64,hr); + } + } + }else{ + if(!((uu>>(pre[hr]&63))&1) && !((is32>>(pre[hr]&63))&1)) { + emit_storereg(pre[hr],hr); + } + } + } + } + } + } + } + } + // Move from one register to another (no writeback) + for(hr=0;hr=0&&(pre[hr]&63)=0) { + emit_mov(hr,nr); + } + } + } + } + } +} +#endif + +// Load the specified registers +// This only loads the registers given as arguments because +// we don't want to load things that will be overwritten +static void load_regs(signed char entry[],signed char regmap[],int is32,int rs1,int rs2) +{ + int hr; + // Load 32-bit regs + for(hr=0;hr=0) { + if(entry[hr]!=regmap[hr]) { + if(regmap[hr]==rs1||regmap[hr]==rs2) + { + if(regmap[hr]==0) { + emit_zeroreg(hr); + } + else + { + emit_loadreg(regmap[hr],hr); + } + } + } + } + } + //Load 64-bit regs + for(hr=0;hr=0) { + if(entry[hr]!=regmap[hr]) { + if(regmap[hr]-64==rs1||regmap[hr]-64==rs2) + { + assert(regmap[hr]!=64); + if((is32>>(regmap[hr]&63))&1) { + int lr=get_reg(regmap,regmap[hr]-64); + if(lr>=0) + emit_sarimm(lr,31,hr); + else + emit_loadreg(regmap[hr],hr); + } + else + { + emit_loadreg(regmap[hr],hr); + } + } + } + } + } +} + +// Load registers prior to the start of a loop +// so that they are not loaded within the loop +static void loop_preload(signed char pre[],signed char entry[]) +{ + int hr; + for(hr=0;hr=0) { + if(get_reg(pre,entry[hr])<0) { + assem_debug("loop preload:"); + //DebugMessage(M64MSG_VERBOSE, "loop preload: %d",hr); + if(entry[hr]==0) { + emit_zeroreg(hr); + } + else if(entry[hr]regmap,rt1[i]); + if(ra<0) ra=get_reg(i_regs->regmap,-1); + assert(ra>=0); + } + if(itype[i]==LOADLR) { + ra=get_reg(i_regs->regmap,FTEMP); + } + if(itype[i]==STORE||itype[i]==STORELR) { + ra=get_reg(i_regs->regmap,agr); + if(ra<0) ra=get_reg(i_regs->regmap,-1); + } + if(itype[i]==C1LS) { + if (opcode[i]==0x31||opcode[i]==0x35) // LWC1/LDC1 + ra=get_reg(i_regs->regmap,FTEMP); + else { // SWC1/SDC1 + ra=get_reg(i_regs->regmap,agr); + if(ra<0) ra=get_reg(i_regs->regmap,-1); + } + } + int rs=get_reg(i_regs->regmap,rs1[i]); + int rm=get_reg(i_regs->regmap,TLREG); + if(ra>=0) { + int offset=imm[i]; + int c=(i_regs->wasconst>>rs)&1; + if(rs1[i]==0) { + // Using r0 as a base address + /*if(rm>=0) { + if(!entry||entry[rm]!=mgr) { + generate_map_const(offset,rm); + } // else did it in the previous cycle + }*/ + if(!entry||entry[ra]!=agr) { + if (opcode[i]==0x22||opcode[i]==0x26) { + emit_movimm(offset&0xFFFFFFFC,ra); // LWL/LWR + }else if (opcode[i]==0x1a||opcode[i]==0x1b) { + emit_movimm(offset&0xFFFFFFF8,ra); // LDL/LDR + }else{ + emit_movimm(offset,ra); + } + } // else did it in the previous cycle + } + else if(rs<0) { + if(!entry||entry[ra]!=rs1[i]) + emit_loadreg(rs1[i],ra); + //if(!entry||entry[ra]!=rs1[i]) + // DebugMessage(M64MSG_VERBOSE, "poor load scheduling!"); + } + else if(c) { + if(rm>=0) { + if(!entry||entry[rm]!=mgr) { + if(itype[i]==STORE||itype[i]==STORELR||opcode[i]==0x39||opcode[i]==0x3D) { + // Stores to memory go thru the mapper to detect self-modifying + // code, loads don't. + if((unsigned int)(constmap[i][rs]+offset)>=0xC0000000 || + (unsigned int)(constmap[i][rs]+offset)<0x80800000 ) + generate_map_const(constmap[i][rs]+offset,rm); + }else{ + if((signed int)(constmap[i][rs]+offset)>=(signed int)0xC0000000) + generate_map_const(constmap[i][rs]+offset,rm); + } + } + } + if(rs1[i]!=rt1[i]||itype[i]!=LOAD) { + if(!entry||entry[ra]!=agr) { + if (opcode[i]==0x22||opcode[i]==0x26) { // LWL/LWR + #ifdef RAM_OFFSET + if((signed int)constmap[i][rs]+offset<(signed int)0x80800000) + emit_movimm(((constmap[i][rs]+offset)&0xFFFFFFFC)+(int)rdram-0x80000000,ra); + else + #endif + emit_movimm((constmap[i][rs]+offset)&0xFFFFFFFC,ra); + }else if (opcode[i]==0x1a||opcode[i]==0x1b) { // LDL/LDR + #ifdef RAM_OFFSET + if((signed int)constmap[i][rs]+offset<(signed int)0x80800000) + emit_movimm(((constmap[i][rs]+offset)&0xFFFFFFF8)+(int)rdram-0x80000000,ra); + else + #endif + emit_movimm((constmap[i][rs]+offset)&0xFFFFFFF8,ra); + }else{ + #ifdef HOST_IMM_ADDR32 + if((itype[i]!=LOAD&&opcode[i]!=0x31&&opcode[i]!=0x35) || + (using_tlb&&((signed int)constmap[i][rs]+offset)>=(signed int)0xC0000000)) + #endif + #ifdef RAM_OFFSET + if((itype[i]==LOAD||opcode[i]==0x31||opcode[i]==0x35)&&(signed int)constmap[i][rs]+offset<(signed int)0x80800000) + emit_movimm(constmap[i][rs]+offset+(int)rdram-0x80000000,ra); + else + #endif + emit_movimm(constmap[i][rs]+offset,ra); + } + } // else did it in the previous cycle + } // else load_consts already did it + } + if(offset&&!c&&rs1[i]) { + if(rs>=0) { + emit_addimm(rs,offset,ra); + }else{ + emit_addimm(ra,offset,ra); + } + } + } + } + // Preload constants for next instruction + if(itype[i+1]==LOAD||itype[i+1]==LOADLR||itype[i+1]==STORE||itype[i+1]==STORELR||itype[i+1]==C1LS) { + int agr,ra; + #ifndef HOST_IMM_ADDR32 + // Mapper entry + agr=MGEN1+((i+1)&1); + ra=get_reg(i_regs->regmap,agr); + if(ra>=0) { + int rs=get_reg(regs[i+1].regmap,rs1[i+1]); + int offset=imm[i+1]; + int c=(regs[i+1].wasconst>>rs)&1; + if(c) { + if(itype[i+1]==STORE||itype[i+1]==STORELR||opcode[i+1]==0x39||opcode[i+1]==0x3D) { + // Stores to memory go thru the mapper to detect self-modifying + // code, loads don't. + if((unsigned int)(constmap[i+1][rs]+offset)>=0xC0000000 || + (unsigned int)(constmap[i+1][rs]+offset)<0x80800000 ) + generate_map_const(constmap[i+1][rs]+offset,ra); + }else{ + if((signed int)(constmap[i+1][rs]+offset)>=(signed int)0xC0000000) + generate_map_const(constmap[i+1][rs]+offset,ra); + } + } + /*else if(rs1[i]==0) { + generate_map_const(offset,ra); + }*/ + } + #endif + // Actual address + agr=AGEN1+((i+1)&1); + ra=get_reg(i_regs->regmap,agr); + if(ra>=0) { + int rs=get_reg(regs[i+1].regmap,rs1[i+1]); + int offset=imm[i+1]; + int c=(regs[i+1].wasconst>>rs)&1; + if(c&&(rs1[i+1]!=rt1[i+1]||itype[i+1]!=LOAD)) { + if (opcode[i+1]==0x22||opcode[i+1]==0x26) { // LWL/LWR + #ifdef RAM_OFFSET + if((signed int)constmap[i+1][rs]+offset<(signed int)0x80800000) + emit_movimm(((constmap[i+1][rs]+offset)&0xFFFFFFFC)+(int)rdram-0x80000000,ra); + else + #endif + emit_movimm((constmap[i+1][rs]+offset)&0xFFFFFFFC,ra); + }else if (opcode[i+1]==0x1a||opcode[i+1]==0x1b) { // LDL/LDR + #ifdef RAM_OFFSET + if((signed int)constmap[i+1][rs]+offset<(signed int)0x80800000) + emit_movimm(((constmap[i+1][rs]+offset)&0xFFFFFFF8)+(int)rdram-0x80000000,ra); + else + #endif + emit_movimm((constmap[i+1][rs]+offset)&0xFFFFFFF8,ra); + }else{ + #ifdef HOST_IMM_ADDR32 + if((itype[i+1]!=LOAD&&opcode[i+1]!=0x31&&opcode[i+1]!=0x35) || + (using_tlb&&((signed int)constmap[i+1][rs]+offset)>=(signed int)0xC0000000)) + #endif + #ifdef RAM_OFFSET + if((itype[i+1]==LOAD||opcode[i+1]==0x31||opcode[i+1]==0x35)&&(signed int)constmap[i+1][rs]+offset<(signed int)0x80800000) + emit_movimm(constmap[i+1][rs]+offset+(int)rdram-0x80000000,ra); + else + #endif + emit_movimm(constmap[i+1][rs]+offset,ra); + } + } + else if(rs1[i+1]==0) { + // Using r0 as a base address + if (opcode[i+1]==0x22||opcode[i+1]==0x26) { + emit_movimm(offset&0xFFFFFFFC,ra); // LWL/LWR + }else if (opcode[i+1]==0x1a||opcode[i+1]==0x1b) { + emit_movimm(offset&0xFFFFFFF8,ra); // LDL/LDR + }else{ + emit_movimm(offset,ra); + } + } + } + } +} + +static int get_final_value(int hr, int i, int *value) +{ + int reg=regs[i].regmap[hr]; + while(i>hr)&1)) break; + if(bt[i+1]) break; + i++; + } + if(i>hr)&1)) + { + #ifdef HOST_IMM_ADDR32 + if(!using_tlb||((signed int)constmap[i][hr]+imm[i+2])<(signed int)0xC0000000) return 0; + #endif + #ifdef RAM_OFFSET + if((signed int)constmap[i][hr]+imm[i+2]<(signed int)0x80800000) + *value=constmap[i][hr]+imm[i+2]+(int)rdram-0x80000000; + else + #endif + // Precompute load address + *value=constmap[i][hr]+imm[i+2]; + return 1; + } + } + if(itype[i+1]==LOAD&&rs1[i+1]==reg&&rt1[i+1]==reg) + { + #ifdef HOST_IMM_ADDR32 + if(!using_tlb||((signed int)constmap[i][hr]+imm[i+1])<(signed int)0xC0000000) return 0; + #endif + #ifdef RAM_OFFSET + if((signed int)constmap[i][hr]+imm[i+1]<(signed int)0x80800000) + *value=constmap[i][hr]+imm[i+1]+(int)rdram-0x80000000; + else + #endif + // Precompute load address + *value=constmap[i][hr]+imm[i+1]; + //DebugMessage(M64MSG_VERBOSE, "c=%x imm=%x",(int)constmap[i][hr],imm[i+1]); + return 1; + } + } + } + *value=constmap[i][hr]; + //DebugMessage(M64MSG_VERBOSE, "c=%x",(int)constmap[i][hr]); + if(i==slen-1) return 1; + if(reg<64) { + return !((unneeded_reg[i+1]>>reg)&1); + }else{ + return !((unneeded_reg_upper[i+1]>>reg)&1); + } +} + +// Load registers with known constants +static void load_consts(signed char pre[],signed char regmap[],int is32,int i) +{ + int hr; + // Load 32-bit regs + for(hr=0;hr=0) { + //if(entry[hr]!=regmap[hr]) { + if(i==0||!((regs[i-1].isconst>>hr)&1)||pre[hr]!=regmap[hr]||bt[i]) { + if(((regs[i].isconst>>hr)&1)&®map[hr]<64&®map[hr]>0) { + int value; + if(get_final_value(hr,i,&value)) { + if(value==0) { + emit_zeroreg(hr); + } + else { + emit_movimm(value,hr); + } + } + } + } + } + } + // Load 64-bit regs + for(hr=0;hr=0) { + //if(entry[hr]!=regmap[hr]) { + if(i==0||!((regs[i-1].isconst>>hr)&1)||pre[hr]!=regmap[hr]||bt[i]) { + if(((regs[i].isconst>>hr)&1)&®map[hr]>64) { + if((is32>>(regmap[hr]&63))&1) { + int lr=get_reg(regmap,regmap[hr]-64); + assert(lr>=0); + emit_sarimm(lr,31,hr); + } + else + { + int value; + if(get_final_value(hr,i,&value)) { + if(value==0) { + emit_zeroreg(hr); + } + else { + emit_movimm(value,hr); + } + } + } + } + } + } + } +} +static void load_all_consts(signed char regmap[],int is32,u_int dirty,int i) +{ + int hr; + // Load 32-bit regs + for(hr=0;hr=0&&((dirty>>hr)&1)) { + if(((regs[i].isconst>>hr)&1)&®map[hr]<64&®map[hr]>0) { + int value=constmap[i][hr]; + if(value==0) { + emit_zeroreg(hr); + } + else { + emit_movimm(value,hr); + } + } + } + } + // Load 64-bit regs + for(hr=0;hr=0&&((dirty>>hr)&1)) { + if(((regs[i].isconst>>hr)&1)&®map[hr]>64) { + if((is32>>(regmap[hr]&63))&1) { + int lr=get_reg(regmap,regmap[hr]-64); + assert(lr>=0); + emit_sarimm(lr,31,hr); + } + else + { + int value=constmap[i][hr]; + if(value==0) { + emit_zeroreg(hr); + } + else { + emit_movimm(value,hr); + } + } + } + } + } +} + +// Write out all dirty registers (except cycle count) +static void wb_dirtys(signed char i_regmap[],uint64_t i_is32,uint64_t i_dirty) +{ + int hr; + for(hr=0;hr0) { + if(i_regmap[hr]!=CCREG) { + if((i_dirty>>hr)&1) { + if(i_regmap[hr]<64) { + emit_storereg(i_regmap[hr],hr); + if( ((i_is32>>i_regmap[hr])&1) ) { + #ifdef DESTRUCTIVE_WRITEBACK + emit_sarimm(hr,31,hr); + emit_storereg(i_regmap[hr]|64,hr); + #else + emit_sarimm(hr,31,HOST_TEMPREG); + emit_storereg(i_regmap[hr]|64,HOST_TEMPREG); + #endif + } + }else{ + if( !((i_is32>>(i_regmap[hr]&63))&1) ) { + emit_storereg(i_regmap[hr],hr); + } + } + } + } + } + } + } +} +// Write out dirty registers that we need to reload (pair with load_needed_regs) +// This writes the registers not written by store_regs_bt +static void wb_needed_dirtys(signed char i_regmap[],uint64_t i_is32,uint64_t i_dirty,int addr) +{ + int hr; + int t=(addr-start)>>2; + for(hr=0;hr0) { + if(i_regmap[hr]!=CCREG) { + if(i_regmap[hr]==regs[t].regmap_entry[hr] && ((regs[t].dirty>>hr)&1) && !(((i_is32&~regs[t].was32&~unneeded_reg_upper[t])>>(i_regmap[hr]&63))&1)) { + if((i_dirty>>hr)&1) { + if(i_regmap[hr]<64) { + emit_storereg(i_regmap[hr],hr); + if( ((i_is32>>i_regmap[hr])&1) ) { + #ifdef DESTRUCTIVE_WRITEBACK + emit_sarimm(hr,31,hr); + emit_storereg(i_regmap[hr]|64,hr); + #else + emit_sarimm(hr,31,HOST_TEMPREG); + emit_storereg(i_regmap[hr]|64,HOST_TEMPREG); + #endif + } + }else{ + if( !((i_is32>>(i_regmap[hr]&63))&1) ) { + emit_storereg(i_regmap[hr],hr); + } + } + } + } + } + } + } + } +} + +// Load all registers (except cycle count) +static void load_all_regs(signed char i_regmap[]) +{ + int hr; + for(hr=0;hr0 && (i_regmap[hr]&63)=0) { + if(i_regmap[hr]==0) { + emit_zeroreg(hr); + } + else + if(i_regmap[hr]>0 && (i_regmap[hr]&63)=0&®s[t].regmap_entry[hr]=64&®s[t].regmap_entry[hr]>(regs[t].regmap_entry[hr]&63))&1) { + int lr=get_reg(regs[t].regmap_entry,regs[t].regmap_entry[hr]-64); + if(lr<0) { + emit_loadreg(regs[t].regmap_entry[hr],hr); + } + else + { + emit_sarimm(lr,31,hr); + } + } + else + { + emit_loadreg(regs[t].regmap_entry[hr],hr); + } + } + } +} + +// Store dirty registers prior to branch +static void store_regs_bt(signed char i_regmap[],uint64_t i_is32,uint64_t i_dirty,int addr) +{ + if(internal_branch(i_is32,addr)) + { + int t=(addr-start)>>2; + int hr; + for(hr=0;hr0 && i_regmap[hr]!=CCREG) { + if(i_regmap[hr]!=regs[t].regmap_entry[hr] || !((regs[t].dirty>>hr)&1) || (((i_is32&~regs[t].was32&~unneeded_reg_upper[t])>>(i_regmap[hr]&63))&1)) { + if((i_dirty>>hr)&1) { + if(i_regmap[hr]<64) { + if(!((unneeded_reg[t]>>i_regmap[hr])&1)) { + emit_storereg(i_regmap[hr],hr); + if( ((i_is32>>i_regmap[hr])&1) && !((unneeded_reg_upper[t]>>i_regmap[hr])&1) ) { + #ifdef DESTRUCTIVE_WRITEBACK + emit_sarimm(hr,31,hr); + emit_storereg(i_regmap[hr]|64,hr); + #else + emit_sarimm(hr,31,HOST_TEMPREG); + emit_storereg(i_regmap[hr]|64,HOST_TEMPREG); + #endif + } + } + }else{ + if( !((i_is32>>(i_regmap[hr]&63))&1) && !((unneeded_reg_upper[t]>>(i_regmap[hr]&63))&1) ) { + emit_storereg(i_regmap[hr],hr); + } + } + } + } + } + } + } + } + else + { + // Branch out of this block, write out all dirty regs + wb_dirtys(i_regmap,i_is32,i_dirty); + } +} + +// Load all needed registers for branch target +static void load_regs_bt(signed char i_regmap[],uint64_t i_is32,uint64_t i_dirty,int addr) +{ + //if(addr>=start && addr<(start+slen*4)) + if(internal_branch(i_is32,addr)) + { + int t=(addr-start)>>2; + int hr; + // Store the cycle count before loading something else + if(i_regmap[HOST_CCREG]!=CCREG) { + assert(i_regmap[HOST_CCREG]==-1); + } + if(regs[t].regmap_entry[HOST_CCREG]!=CCREG) { + emit_storereg(CCREG,HOST_CCREG); + } + // Load 32-bit regs + for(hr=0;hr=0&®s[t].regmap_entry[hr]>hr)&1) && ((i_dirty>>hr)&1) && (((i_is32&~unneeded_reg_upper[t])>>i_regmap[hr])&1) ) || (((i_is32&~regs[t].was32&~unneeded_reg_upper[t])>>(i_regmap[hr]&63))&1)) { + #else + if(i_regmap[hr]!=regs[t].regmap_entry[hr] ) { + #endif + if(regs[t].regmap_entry[hr]==0) { + emit_zeroreg(hr); + } + else if(regs[t].regmap_entry[hr]!=CCREG) + { + emit_loadreg(regs[t].regmap_entry[hr],hr); + } + } + } + } + //Load 64-bit regs + for(hr=0;hr=64&®s[t].regmap_entry[hr]>(regs[t].regmap_entry[hr]&63))&1) { + int lr=get_reg(regs[t].regmap_entry,regs[t].regmap_entry[hr]-64); + if(lr<0) { + emit_loadreg(regs[t].regmap_entry[hr],hr); + } + else + { + emit_sarimm(lr,31,hr); + } + } + else + { + emit_loadreg(regs[t].regmap_entry[hr],hr); + } + } + else if((i_is32>>(regs[t].regmap_entry[hr]&63))&1) { + int lr=get_reg(regs[t].regmap_entry,regs[t].regmap_entry[hr]-64); + assert(lr>=0); + emit_sarimm(lr,31,hr); + } + } + } + } +} + +static int match_bt(signed char i_regmap[],uint64_t i_is32,uint64_t i_dirty,int addr) +{ + if(addr>=start && addr>2; + int hr; + if(regs[t].regmap_entry[HOST_CCREG]!=CCREG) return 0; + for(hr=0;hr=0&&(regs[t].regmap_entry[hr]|64)>hr)&1) + { + if(i_regmap[hr]>i_regmap[hr])&1)) + return 0; + } + else if(i_regmap[hr]>=64&&i_regmap[hr]>(i_regmap[hr]&63))&1)) + return 0; + } + } + } + else // Same register but is it 32-bit or dirty? + if(i_regmap[hr]>=0) + { + if(!((regs[t].dirty>>hr)&1)) + { + if((i_dirty>>hr)&1) + { + if(!((unneeded_reg[t]>>i_regmap[hr])&1)) + { + //DebugMessage(M64MSG_VERBOSE, "%x: dirty no match",addr); + return 0; + } + } + } + if((((regs[t].was32^i_is32)&~unneeded_reg_upper[t])>>(i_regmap[hr]&63))&1) + { + //DebugMessage(M64MSG_VERBOSE, "%x: is32 no match",addr); + return 0; + } + } + } + } + //if(is32[t]&~unneeded_reg_upper[t]&~i_is32) return 0; + if(requires_32bit[t]&~i_is32) return 0; + // Delay slots are not valid branch targets + //if(t>0&&(itype[t-1]==RJUMP||itype[t-1]==UJUMP||itype[t-1]==CJUMP||itype[t-1]==SJUMP||itype[t-1]==FJUMP)) return 0; + // Delay slots require additional processing, so do not match + if(is_ds[t]) return 0; + } + else + { + int hr; + for(hr=0;hr=0) + { + if(hr!=HOST_CCREG||i_regmap[hr]!=CCREG) + { + if((i_dirty>>hr)&1) + { + return 0; + } + } + } + } + } + } + return 1; +} + +// Used when a branch jumps into the delay slot of another branch +static void ds_assemble_entry(int i) +{ + int t=(ba[i]-start)>>2; + if(!instr_addr[t]) instr_addr[t]=(u_int)out; + assem_debug("Assemble delay slot at %x",ba[i]); + assem_debug("<->"); + if(regs[t].regmap_entry[HOST_CCREG]==CCREG&®s[t].regmap[HOST_CCREG]!=CCREG) + wb_register(CCREG,regs[t].regmap_entry,regs[t].wasdirty,regs[t].was32); + load_regs(regs[t].regmap_entry,regs[t].regmap,regs[t].was32,rs1[t],rs2[t]); + address_generation(t,®s[t],regs[t].regmap_entry); + if(itype[t]==LOAD||itype[t]==LOADLR||itype[t]==STORE||itype[t]==STORELR||itype[t]==C1LS) + load_regs(regs[t].regmap_entry,regs[t].regmap,regs[t].was32,MMREG,ROREG); + if(itype[t]==STORE||itype[t]==STORELR||(opcode[t]&0x3b)==0x39) + load_regs(regs[t].regmap_entry,regs[t].regmap,regs[t].was32,INVCP,INVCP); + cop1_usable=0; + is_delayslot=0; + switch(itype[t]) { + case ALU: + alu_assemble(t,®s[t]);break; + case IMM16: + imm16_assemble(t,®s[t]);break; + case SHIFT: + shift_assemble(t,®s[t]);break; + case SHIFTIMM: + shiftimm_assemble(t,®s[t]);break; + case LOAD: + load_assemble(t,®s[t]);break; + case LOADLR: + loadlr_assemble(t,®s[t]);break; + case STORE: + store_assemble(t,®s[t]);break; + case STORELR: + storelr_assemble(t,®s[t]);break; + case COP0: + cop0_assemble(t,®s[t]);break; + case COP1: + cop1_assemble(t,®s[t]);break; + case C1LS: + c1ls_assemble(t,®s[t]);break; + case FCONV: + fconv_assemble(t,®s[t]);break; + case FLOAT: + float_assemble(t,®s[t]);break; + case FCOMP: + fcomp_assemble(t,®s[t]);break; + case MULTDIV: + multdiv_assemble(t,®s[t]);break; + case MOV: + mov_assemble(t,®s[t]);break; + case SYSCALL: + case SPAN: + case UJUMP: + case RJUMP: + case CJUMP: + case SJUMP: + case FJUMP: + DebugMessage(M64MSG_VERBOSE, "Jump in the delay slot. This is probably a bug."); + } + store_regs_bt(regs[t].regmap,regs[t].is32,regs[t].dirty,ba[i]+4); + load_regs_bt(regs[t].regmap,regs[t].is32,regs[t].dirty,ba[i]+4); + if(internal_branch(regs[t].is32,ba[i]+4)) + assem_debug("branch: internal"); + else + assem_debug("branch: external"); + assert(internal_branch(regs[t].is32,ba[i]+4)); + add_to_linker((int)out,ba[i]+4,internal_branch(regs[t].is32,ba[i]+4)); + emit_jmp(0); +} + +static void do_cc(int i,signed char i_regmap[],int *adj,int addr,int taken,int invert) +{ + int count; + int jaddr; + int idle=0; + if(itype[i]==RJUMP) + { + *adj=0; + } + //if(ba[i]>=start && ba[i]<(start+slen*4)) + if(internal_branch(branch_regs[i].is32,ba[i])) + { + int t=(ba[i]-start)>>2; + if(is_ds[t]) *adj=-1; // Branch into delay slot adds an extra cycle + else *adj=ccadj[t]; + } + else + { + *adj=0; + } + count=ccadj[i]; + if(taken==TAKEN && i==(ba[i]-start)>>2 && source[i+1]==0) { + // Idle loop + if(count&1) emit_addimm_and_set_flags(2*(count+2),HOST_CCREG); + idle=(int)out; + //emit_subfrommem(&idlecount,HOST_CCREG); // Count idle cycles + emit_andimm(HOST_CCREG,3,HOST_CCREG); + jaddr=(int)out; + emit_jmp(0); + } + else if(*adj==0||invert) { + emit_addimm_and_set_flags(CLOCK_DIVIDER*(count+2),HOST_CCREG); + jaddr=(int)out; + emit_jns(0); + } + else + { + emit_cmpimm(HOST_CCREG,-CLOCK_DIVIDER*(count+2)); + jaddr=(int)out; + emit_jns(0); + } + add_stub(CC_STUB,jaddr,idle?idle:(int)out,(*adj==0||invert||idle)?0:(count+2),i,addr,taken,0); +} + +static void do_ccstub(int n) +{ + literal_pool(256); + assem_debug("do_ccstub %x",start+stubs[n][4]*4); + set_jump_target(stubs[n][1],(int)out); + int i=stubs[n][4]; + if(stubs[n][6]==NULLDS) { + // Delay slot instruction is nullified ("likely" branch) + wb_dirtys(regs[i].regmap,regs[i].is32,regs[i].dirty); + } + else if(stubs[n][6]!=TAKEN) { + wb_dirtys(branch_regs[i].regmap,branch_regs[i].is32,branch_regs[i].dirty); + } + else { + if(internal_branch(branch_regs[i].is32,ba[i])) + wb_needed_dirtys(branch_regs[i].regmap,branch_regs[i].is32,branch_regs[i].dirty,ba[i]); + } + if(stubs[n][5]!=-1) + { + // Save PC as return address + emit_movimm(stubs[n][5],EAX); + emit_writeword(EAX,(int)&pcaddr); + } + else + { + // Return address depends on which way the branch goes + if(itype[i]==CJUMP||itype[i]==SJUMP||itype[i]==FJUMP) + { + int s1l=get_reg(branch_regs[i].regmap,rs1[i]); + int s1h=get_reg(branch_regs[i].regmap,rs1[i]|64); + int s2l=get_reg(branch_regs[i].regmap,rs2[i]); + int s2h=get_reg(branch_regs[i].regmap,rs2[i]|64); + if(rs1[i]==0) + { + s1l=s2l;s1h=s2h; + s2l=s2h=-1; + } + else if(rs2[i]==0) + { + s2l=s2h=-1; + } + if((branch_regs[i].is32>>rs1[i])&(branch_regs[i].is32>>rs2[i])&1) { + s1h=s2h=-1; + } + assert(s1l>=0); + #ifdef DESTRUCTIVE_WRITEBACK + if(rs1[i]) { + if((branch_regs[i].dirty>>s1l)&(branch_regs[i].is32>>rs1[i])&1) + emit_loadreg(rs1[i],s1l); + } + else { + if((branch_regs[i].dirty>>s1l)&(branch_regs[i].is32>>rs2[i])&1) + emit_loadreg(rs2[i],s1l); + } + if(s2l>=0) + if((branch_regs[i].dirty>>s2l)&(branch_regs[i].is32>>rs2[i])&1) + emit_loadreg(rs2[i],s2l); + #endif + int hr=0; + int addr,alt,ntaddr; + while(hr=0) emit_cmp(s1l,s2l); + else emit_test(s1l,s1l); + emit_cmov2imm_e_ne_compact(ba[i],start+i*4+8,addr); + } + else + #endif + { + emit_mov2imm_compact(ba[i],addr,start+i*4+8,alt); + if(s1h>=0) { + if(s2h>=0) emit_cmp(s1h,s2h); + else emit_test(s1h,s1h); + emit_cmovne_reg(alt,addr); + } + if(s2l>=0) emit_cmp(s1l,s2l); + else emit_test(s1l,s1l); + emit_cmovne_reg(alt,addr); + } + } + if((opcode[i]&0x2f)==5) // BNE + { + #ifdef HAVE_CMOV_IMM + if(s1h<0) { + if(s2l>=0) emit_cmp(s1l,s2l); + else emit_test(s1l,s1l); + emit_cmov2imm_e_ne_compact(start+i*4+8,ba[i],addr); + } + else + #endif + { + emit_mov2imm_compact(start+i*4+8,addr,ba[i],alt); + if(s1h>=0) { + if(s2h>=0) emit_cmp(s1h,s2h); + else emit_test(s1h,s1h); + emit_cmovne_reg(alt,addr); + } + if(s2l>=0) emit_cmp(s1l,s2l); + else emit_test(s1l,s1l); + emit_cmovne_reg(alt,addr); + } + } + if((opcode[i]&0x2f)==6) // BLEZ + { + //emit_movimm(ba[i],alt); + //emit_movimm(start+i*4+8,addr); + emit_mov2imm_compact(ba[i],alt,start+i*4+8,addr); + emit_cmpimm(s1l,1); + if(s1h>=0) emit_mov(addr,ntaddr); + emit_cmovl_reg(alt,addr); + if(s1h>=0) { + emit_test(s1h,s1h); + emit_cmovne_reg(ntaddr,addr); + emit_cmovs_reg(alt,addr); + } + } + if((opcode[i]&0x2f)==7) // BGTZ + { + //emit_movimm(ba[i],addr); + //emit_movimm(start+i*4+8,ntaddr); + emit_mov2imm_compact(ba[i],addr,start+i*4+8,ntaddr); + emit_cmpimm(s1l,1); + if(s1h>=0) emit_mov(addr,alt); + emit_cmovl_reg(ntaddr,addr); + if(s1h>=0) { + emit_test(s1h,s1h); + emit_cmovne_reg(alt,addr); + emit_cmovs_reg(ntaddr,addr); + } + } + if((opcode[i]==1)&&(opcode2[i]&0x2D)==0) // BLTZ + { + //emit_movimm(ba[i],alt); + //emit_movimm(start+i*4+8,addr); + emit_mov2imm_compact(ba[i],alt,start+i*4+8,addr); + if(s1h>=0) emit_test(s1h,s1h); + else emit_test(s1l,s1l); + emit_cmovs_reg(alt,addr); + } + if((opcode[i]==1)&&(opcode2[i]&0x2D)==1) // BGEZ + { + //emit_movimm(ba[i],addr); + //emit_movimm(start+i*4+8,alt); + emit_mov2imm_compact(ba[i],addr,start+i*4+8,alt); + if(s1h>=0) emit_test(s1h,s1h); + else emit_test(s1l,s1l); + emit_cmovs_reg(alt,addr); + } + if(opcode[i]==0x11 && opcode2[i]==0x08 ) { + if(source[i]&0x10000) // BC1T + { + //emit_movimm(ba[i],alt); + //emit_movimm(start+i*4+8,addr); + emit_mov2imm_compact(ba[i],alt,start+i*4+8,addr); + emit_testimm(s1l,0x800000); + emit_cmovne_reg(alt,addr); + } + else // BC1F + { + //emit_movimm(ba[i],addr); + //emit_movimm(start+i*4+8,alt); + emit_mov2imm_compact(ba[i],addr,start+i*4+8,alt); + emit_testimm(s1l,0x800000); + emit_cmovne_reg(alt,addr); + } + } + emit_writeword(addr,(int)&pcaddr); + } + else + if(itype[i]==RJUMP) + { + int r=get_reg(branch_regs[i].regmap,rs1[i]); + if(rs1[i]==rt1[i+1]||rs1[i]==rt2[i+1]) { + r=get_reg(branch_regs[i].regmap,RTEMP); + } + emit_writeword(r,(int)&pcaddr); + } + else {DebugMessage(M64MSG_ERROR, "Unknown branch type in do_ccstub");exit(1);} + } + // Update cycle count + assert(branch_regs[i].regmap[HOST_CCREG]==CCREG||branch_regs[i].regmap[HOST_CCREG]==-1); + if(stubs[n][3]) emit_addimm(HOST_CCREG,CLOCK_DIVIDER*stubs[n][3],HOST_CCREG); + emit_call((int)cc_interrupt); + if(stubs[n][3]) emit_addimm(HOST_CCREG,-CLOCK_DIVIDER*stubs[n][3],HOST_CCREG); + if(stubs[n][6]==TAKEN) { + if(internal_branch(branch_regs[i].is32,ba[i])) + load_needed_regs(branch_regs[i].regmap,regs[(ba[i]-start)>>2].regmap_entry); + else if(itype[i]==RJUMP) { + if(get_reg(branch_regs[i].regmap,RTEMP)>=0) + emit_readword((int)&pcaddr,get_reg(branch_regs[i].regmap,RTEMP)); + else + emit_loadreg(rs1[i],get_reg(branch_regs[i].regmap,rs1[i])); + } + }else if(stubs[n][6]==NOTTAKEN) { + if(iregmap; + #endif + if(i==(ba[i]-start)>>2) assem_debug("idle loop"); + address_generation(i+1,i_regs,regs[i].regmap_entry); + #ifdef REG_PREFETCH + int temp=get_reg(branch_regs[i].regmap,PTEMP); + if(rt1[i]==31&&temp>=0) + { + int return_address=start+i*4+8; + if(get_reg(branch_regs[i].regmap,31)>0) + if(i_regmap[temp]==PTEMP) emit_movimm((int)hash_table[((return_address>>16)^return_address)&0xFFFF],temp); + } + #endif + ds_assemble(i+1,i_regs); + uint64_t bc_unneeded=branch_regs[i].u; + uint64_t bc_unneeded_upper=branch_regs[i].uu; + bc_unneeded|=1|(1LL<=0); + return_address=start+i*4+8; + if(rt>=0) { + #ifdef USE_MINI_HT + if(internal_branch(branch_regs[i].is32,return_address)) { + int temp=rt+1; + if(temp==EXCLUDE_REG||temp>=HOST_REGS|| + branch_regs[i].regmap[temp]>=0) + { + temp=get_reg(branch_regs[i].regmap,-1); + } + #ifdef HOST_TEMPREG + if(temp<0) temp=HOST_TEMPREG; + #endif + if(temp>=0) do_miniht_insert(return_address,rt,temp); + else emit_movimm(return_address,rt); + } + else + #endif + { + #ifdef REG_PREFETCH + if(temp>=0) + { + if(i_regmap[temp]!=PTEMP) emit_movimm((int)hash_table[((return_address>>16)^return_address)&0xFFFF],temp); + } + #endif + emit_movimm(return_address,rt); // PC into link register + #ifdef IMM_PREFETCH + emit_prefetch(hash_table[((return_address>>16)^return_address)&0xFFFF]); + #endif + } + } + } + int cc,adj; + cc=get_reg(branch_regs[i].regmap,CCREG); + assert(cc==HOST_CCREG); + store_regs_bt(branch_regs[i].regmap,branch_regs[i].is32,branch_regs[i].dirty,ba[i]); + #ifdef REG_PREFETCH + if(rt1[i]==31&&temp>=0) emit_prefetchreg(temp); + #endif + do_cc(i,branch_regs[i].regmap,&adj,ba[i],TAKEN,0); + if(adj) emit_addimm(cc,CLOCK_DIVIDER*(ccadj[i]+2-adj),cc); + load_regs_bt(branch_regs[i].regmap,branch_regs[i].is32,branch_regs[i].dirty,ba[i]); + if(internal_branch(branch_regs[i].is32,ba[i])) + assem_debug("branch: internal"); + else + assem_debug("branch: external"); + if(internal_branch(branch_regs[i].is32,ba[i])&&is_ds[(ba[i]-start)>>2]) { + ds_assemble_entry(i); + } + else { + add_to_linker((int)out,ba[i],internal_branch(branch_regs[i].is32,ba[i])); + emit_jmp(0); + } +} + +static void rjump_assemble(int i,struct regstat *i_regs) +{ + #ifdef REG_PREFETCH + signed char *i_regmap=i_regs->regmap; + #endif + int temp; + int rs,cc; + rs=get_reg(branch_regs[i].regmap,rs1[i]); + assert(rs>=0); + if(rs1[i]==rt1[i+1]||rs1[i]==rt2[i+1]) { + // Delay slot abuse, make a copy of the branch address register + temp=get_reg(branch_regs[i].regmap,RTEMP); + assert(temp>=0); + assert(regs[i].regmap[temp]==RTEMP); + emit_mov(rs,temp); + rs=temp; + } + address_generation(i+1,i_regs,regs[i].regmap_entry); + #ifdef REG_PREFETCH + if(rt1[i]==31) + { + if((temp=get_reg(branch_regs[i].regmap,PTEMP))>=0) { + int return_address=start+i*4+8; + if(i_regmap[temp]==PTEMP) emit_movimm((int)hash_table[((return_address>>16)^return_address)&0xFFFF],temp); + } + } + #endif + #ifdef USE_MINI_HT + if(rs1[i]==31) { + int rh=get_reg(regs[i].regmap,RHASH); + if(rh>=0) do_preload_rhash(rh); + } + #endif + ds_assemble(i+1,i_regs); + uint64_t bc_unneeded=branch_regs[i].u; + uint64_t bc_unneeded_upper=branch_regs[i].uu; + bc_unneeded|=1|(1LL<=0); + return_address=start+i*4+8; + #ifdef REG_PREFETCH + if(temp>=0) + { + if(i_regmap[temp]!=PTEMP) emit_movimm((int)hash_table[((return_address>>16)^return_address)&0xFFFF],temp); + } + #endif + emit_movimm(return_address,rt); // PC into link register + #ifdef IMM_PREFETCH + emit_prefetch(hash_table[((return_address>>16)^return_address)&0xFFFF]); + #endif + } + cc=get_reg(branch_regs[i].regmap,CCREG); + assert(cc==HOST_CCREG); + #ifdef USE_MINI_HT + int rh=get_reg(branch_regs[i].regmap,RHASH); + int ht=get_reg(branch_regs[i].regmap,RHTBL); + if(rs1[i]==31) { + if(regs[i].regmap[rh]!=RHASH) do_preload_rhash(rh); + do_preload_rhtbl(ht); + do_rhash(rs,rh); + } + #endif + store_regs_bt(branch_regs[i].regmap,branch_regs[i].is32,branch_regs[i].dirty,-1); + #ifdef DESTRUCTIVE_WRITEBACK + if((branch_regs[i].dirty>>rs)&(branch_regs[i].is32>>rs1[i])&1) { + if(rs1[i]!=rt1[i+1]&&rs1[i]!=rt2[i+1]) { + emit_loadreg(rs1[i],rs); + } + } + #endif + #ifdef REG_PREFETCH + if(rt1[i]==31&&temp>=0) emit_prefetchreg(temp); + #endif + #ifdef USE_MINI_HT + if(rs1[i]==31) { + do_miniht_load(ht,rh); + } + #endif + //do_cc(i,branch_regs[i].regmap,&adj,-1,TAKEN); + //if(adj) emit_addimm(cc,2*(ccadj[i]+2-adj),cc); // ??? - Shouldn't happen + //assert(adj==0); + emit_addimm_and_set_flags(CLOCK_DIVIDER*(ccadj[i]+2),HOST_CCREG); + add_stub(CC_STUB,(int)out,jump_vaddr_reg[rs],0,i,-1,TAKEN,0); + emit_jns(0); + //load_regs_bt(branch_regs[i].regmap,branch_regs[i].is32,branch_regs[i].dirty,-1); + #ifdef USE_MINI_HT + if(rs1[i]==31) { + do_miniht_jump(rs,rh,ht); + } + else + #endif + { + //if(rs!=EAX) emit_mov(rs,EAX); + //emit_jmp((int)jump_vaddr_eax); + emit_jmp(jump_vaddr_reg[rs]); + } + /* Check hash table + temp=!rs; + emit_mov(rs,temp); + emit_shrimm(rs,16,rs); + emit_xor(temp,rs,rs); + emit_movzwl_reg(rs,rs); + emit_shlimm(rs,4,rs); + emit_cmpmem_indexed((int)hash_table,rs,temp); + emit_jne((int)out+14); + emit_readword_indexed((int)hash_table+4,rs,rs); + emit_jmpreg(rs); + emit_cmpmem_indexed((int)hash_table+8,rs,temp); + emit_addimm_no_flags(8,rs); + emit_jeq((int)out-17); + // No hit on hash table, call compiler + emit_pushreg(temp); +//DEBUG > +#ifdef DEBUG_CYCLE_COUNT + emit_readword((int)&last_count,ECX); + emit_add(HOST_CCREG,ECX,HOST_CCREG); + emit_readword((int)&next_interupt,ECX); + emit_writeword(HOST_CCREG,(int)&Count); + emit_sub(HOST_CCREG,ECX,HOST_CCREG); + emit_writeword(ECX,(int)&last_count); +#endif +//DEBUG < + emit_storereg(CCREG,HOST_CCREG); + emit_call((int)get_addr); + emit_loadreg(CCREG,HOST_CCREG); + emit_addimm(ESP,4,ESP); + emit_jmpreg(EAX);*/ + #ifdef CORTEX_A8_BRANCH_PREDICTION_HACK + if(rt1[i]!=31&&iregmap; + int cc; + int match; + match=match_bt(branch_regs[i].regmap,branch_regs[i].is32,branch_regs[i].dirty,ba[i]); + assem_debug("match=%d",match); + int s1h,s1l,s2h,s2l; + int prev_cop1_usable=cop1_usable; + int unconditional=0,nop=0; + int only32=0; + int invert=0; + int internal=internal_branch(branch_regs[i].is32,ba[i]); + if(i==(ba[i]-start)>>2) assem_debug("idle loop"); + if(!match) invert=1; + #ifdef CORTEX_A8_BRANCH_PREDICTION_HACK + if(i>(ba[i]-start)>>2) invert=1; + #endif + + if(ooo[i]) { + s1l=get_reg(branch_regs[i].regmap,rs1[i]); + s1h=get_reg(branch_regs[i].regmap,rs1[i]|64); + s2l=get_reg(branch_regs[i].regmap,rs2[i]); + s2h=get_reg(branch_regs[i].regmap,rs2[i]|64); + } + else { + s1l=get_reg(i_regmap,rs1[i]); + s1h=get_reg(i_regmap,rs1[i]|64); + s2l=get_reg(i_regmap,rs2[i]); + s2h=get_reg(i_regmap,rs2[i]|64); + } + if(rs1[i]==0&&rs2[i]==0) + { + if(opcode[i]&1) nop=1; + else unconditional=1; + //assert(opcode[i]!=5); + //assert(opcode[i]!=7); + //assert(opcode[i]!=0x15); + //assert(opcode[i]!=0x17); + } + else if(rs1[i]==0) + { + s1l=s2l;s1h=s2h; + s2l=s2h=-1; + only32=(regs[i].was32>>rs2[i])&1; + } + else if(rs2[i]==0) + { + s2l=s2h=-1; + only32=(regs[i].was32>>rs1[i])&1; + } + else { + only32=(regs[i].was32>>rs1[i])&(regs[i].was32>>rs2[i])&1; + } + + if(ooo[i]) { + // Out of order execution (delay slot first) + //DebugMessage(M64MSG_VERBOSE, "OOOE"); + address_generation(i+1,i_regs,regs[i].regmap_entry); + ds_assemble(i+1,i_regs); + int adj; + uint64_t bc_unneeded=branch_regs[i].u; + uint64_t bc_unneeded_upper=branch_regs[i].uu; + bc_unneeded&=~((1LL<>2 || source[i+1]!=0) { + if(adj) emit_addimm(cc,CLOCK_DIVIDER*(ccadj[i]+2-adj),cc); + load_regs_bt(branch_regs[i].regmap,branch_regs[i].is32,branch_regs[i].dirty,ba[i]); + if(internal) + assem_debug("branch: internal"); + else + assem_debug("branch: external"); + if(internal&&is_ds[(ba[i]-start)>>2]) { + ds_assemble_entry(i); + } + else { + add_to_linker((int)out,ba[i],internal); + emit_jmp(0); + } + #ifdef CORTEX_A8_BRANCH_PREDICTION_HACK + if(((u_int)out)&7) emit_addnop(0); + #endif + } + } + else if(nop) { + emit_addimm_and_set_flags(CLOCK_DIVIDER*(ccadj[i]+2),cc); + int jaddr=(int)out; + emit_jns(0); + add_stub(CC_STUB,jaddr,(int)out,0,i,start+i*4+8,NOTTAKEN,0); + } + else { + int taken=0,nottaken=0,nottaken1=0; + do_cc(i,branch_regs[i].regmap,&adj,-1,0,invert); + if(adj&&!invert) emit_addimm(cc,CLOCK_DIVIDER*(ccadj[i]+2-adj),cc); + if(!only32) + { + assert(s1h>=0); + if(opcode[i]==4) // BEQ + { + if(s2h>=0) emit_cmp(s1h,s2h); + else emit_test(s1h,s1h); + nottaken1=(int)out; + emit_jne(1); + } + if(opcode[i]==5) // BNE + { + if(s2h>=0) emit_cmp(s1h,s2h); + else emit_test(s1h,s1h); + if(invert) taken=(int)out; + else add_to_linker((int)out,ba[i],internal); + emit_jne(0); + } + if(opcode[i]==6) // BLEZ + { + emit_test(s1h,s1h); + if(invert) taken=(int)out; + else add_to_linker((int)out,ba[i],internal); + emit_js(0); + nottaken1=(int)out; + emit_jne(1); + } + if(opcode[i]==7) // BGTZ + { + emit_test(s1h,s1h); + nottaken1=(int)out; + emit_js(1); + if(invert) taken=(int)out; + else add_to_linker((int)out,ba[i],internal); + emit_jne(0); + } + } // if(!only32) + + //DebugMessage(M64MSG_VERBOSE, "branch(%d): eax=%d ecx=%d edx=%d ebx=%d ebp=%d esi=%d edi=%d",i,branch_regs[i].regmap[0],branch_regs[i].regmap[1],branch_regs[i].regmap[2],branch_regs[i].regmap[3],branch_regs[i].regmap[5],branch_regs[i].regmap[6],branch_regs[i].regmap[7]); + assert(s1l>=0); + if(opcode[i]==4) // BEQ + { + if(s2l>=0) emit_cmp(s1l,s2l); + else emit_test(s1l,s1l); + if(invert){ + nottaken=(int)out; + emit_jne(1); + }else{ + add_to_linker((int)out,ba[i],internal); + emit_jeq(0); + } + } + if(opcode[i]==5) // BNE + { + if(s2l>=0) emit_cmp(s1l,s2l); + else emit_test(s1l,s1l); + if(invert){ + nottaken=(int)out; + emit_jeq(1); + }else{ + add_to_linker((int)out,ba[i],internal); + emit_jne(0); + } + } + if(opcode[i]==6) // BLEZ + { + emit_cmpimm(s1l,1); + if(invert){ + nottaken=(int)out; + emit_jge(1); + }else{ + add_to_linker((int)out,ba[i],internal); + emit_jl(0); + } + } + if(opcode[i]==7) // BGTZ + { + emit_cmpimm(s1l,1); + if(invert){ + nottaken=(int)out; + emit_jl(1); + }else{ + add_to_linker((int)out,ba[i],internal); + emit_jge(0); + } + } + if(invert) { + if(taken) set_jump_target(taken,(int)out); + #ifdef CORTEX_A8_BRANCH_PREDICTION_HACK + if(match&&(!internal||!is_ds[(ba[i]-start)>>2])) { + if(adj) { + emit_addimm(cc,-CLOCK_DIVIDER*adj,cc); + add_to_linker((int)out,ba[i],internal); + }else{ + emit_addnop(13); + add_to_linker((int)out,ba[i],internal*2); + } + emit_jmp(0); + }else + #endif + { + if(adj) emit_addimm(cc,-CLOCK_DIVIDER*adj,cc); + store_regs_bt(branch_regs[i].regmap,branch_regs[i].is32,branch_regs[i].dirty,ba[i]); + load_regs_bt(branch_regs[i].regmap,branch_regs[i].is32,branch_regs[i].dirty,ba[i]); + if(internal) + assem_debug("branch: internal"); + else + assem_debug("branch: external"); + if(internal&&is_ds[(ba[i]-start)>>2]) { + ds_assemble_entry(i); + } + else { + add_to_linker((int)out,ba[i],internal); + emit_jmp(0); + } + } + set_jump_target(nottaken,(int)out); + } + + if(nottaken1) set_jump_target(nottaken1,(int)out); + if(adj) { + if(!invert) emit_addimm(cc,CLOCK_DIVIDER*adj,cc); + } + } // (!unconditional) + } // if(ooo) + else + { + // In-order execution (branch first) + //if(likely[i]) DebugMessage(M64MSG_VERBOSE, "IOL"); + //else + //DebugMessage(M64MSG_VERBOSE, "IOE"); + int taken=0,nottaken=0,nottaken1=0; + if(!unconditional&&!nop) { + if(!only32) + { + assert(s1h>=0); + if((opcode[i]&0x2f)==4) // BEQ + { + if(s2h>=0) emit_cmp(s1h,s2h); + else emit_test(s1h,s1h); + nottaken1=(int)out; + emit_jne(2); + } + if((opcode[i]&0x2f)==5) // BNE + { + if(s2h>=0) emit_cmp(s1h,s2h); + else emit_test(s1h,s1h); + taken=(int)out; + emit_jne(1); + } + if((opcode[i]&0x2f)==6) // BLEZ + { + emit_test(s1h,s1h); + taken=(int)out; + emit_js(1); + nottaken1=(int)out; + emit_jne(2); + } + if((opcode[i]&0x2f)==7) // BGTZ + { + emit_test(s1h,s1h); + nottaken1=(int)out; + emit_js(2); + taken=(int)out; + emit_jne(1); + } + } // if(!only32) + + //DebugMessage(M64MSG_VERBOSE, "branch(%d): eax=%d ecx=%d edx=%d ebx=%d ebp=%d esi=%d edi=%d",i,branch_regs[i].regmap[0],branch_regs[i].regmap[1],branch_regs[i].regmap[2],branch_regs[i].regmap[3],branch_regs[i].regmap[5],branch_regs[i].regmap[6],branch_regs[i].regmap[7]); + assert(s1l>=0); + if((opcode[i]&0x2f)==4) // BEQ + { + if(s2l>=0) emit_cmp(s1l,s2l); + else emit_test(s1l,s1l); + nottaken=(int)out; + emit_jne(2); + } + if((opcode[i]&0x2f)==5) // BNE + { + if(s2l>=0) emit_cmp(s1l,s2l); + else emit_test(s1l,s1l); + nottaken=(int)out; + emit_jeq(2); + } + if((opcode[i]&0x2f)==6) // BLEZ + { + emit_cmpimm(s1l,1); + nottaken=(int)out; + emit_jge(2); + } + if((opcode[i]&0x2f)==7) // BGTZ + { + emit_cmpimm(s1l,1); + nottaken=(int)out; + emit_jl(2); + } + } // if(!unconditional) + int adj; + uint64_t ds_unneeded=branch_regs[i].u; + uint64_t ds_unneeded_upper=branch_regs[i].uu; + ds_unneeded&=~((1LL<>rt1[i+1])&1) ds_unneeded_upper&=~((1LL<>2]) { + ds_assemble_entry(i); + } + else { + add_to_linker((int)out,ba[i],internal); + emit_jmp(0); + } + } + // branch not taken + cop1_usable=prev_cop1_usable; + if(!unconditional) { + if(nottaken1) set_jump_target(nottaken1,(int)out); + set_jump_target(nottaken,(int)out); + assem_debug("2:"); + if(!likely[i]) { + wb_invalidate(regs[i].regmap,branch_regs[i].regmap,regs[i].dirty,regs[i].is32, + ds_unneeded,ds_unneeded_upper); + load_regs(regs[i].regmap,branch_regs[i].regmap,regs[i].was32,rs1[i+1],rs2[i+1]); + address_generation(i+1,&branch_regs[i],0); + load_regs(regs[i].regmap,branch_regs[i].regmap,regs[i].was32,CCREG,CCREG); + ds_assemble(i+1,&branch_regs[i]); + } + cc=get_reg(branch_regs[i].regmap,CCREG); + if(cc==-1&&!likely[i]) { + // Cycle count isn't in a register, temporarily load it then write it out + emit_loadreg(CCREG,HOST_CCREG); + emit_addimm_and_set_flags(CLOCK_DIVIDER*(ccadj[i]+2),HOST_CCREG); + int jaddr=(int)out; + emit_jns(0); + add_stub(CC_STUB,jaddr,(int)out,0,i,start+i*4+8,NOTTAKEN,0); + emit_storereg(CCREG,HOST_CCREG); + } + else{ + cc=get_reg(i_regmap,CCREG); + assert(cc==HOST_CCREG); + emit_addimm_and_set_flags(CLOCK_DIVIDER*(ccadj[i]+2),cc); + int jaddr=(int)out; + emit_jns(0); + add_stub(CC_STUB,jaddr,(int)out,0,i,start+i*4+8,likely[i]?NULLDS:NOTTAKEN,0); + } + } + } +} + +static void sjump_assemble(int i,struct regstat *i_regs) +{ + signed char *i_regmap=i_regs->regmap; + int cc; + int match; + match=match_bt(branch_regs[i].regmap,branch_regs[i].is32,branch_regs[i].dirty,ba[i]); + assem_debug("smatch=%d",match); + int s1h,s1l; + int prev_cop1_usable=cop1_usable; + int unconditional=0,nevertaken=0; + int only32=0; + int invert=0; + int internal=internal_branch(branch_regs[i].is32,ba[i]); + if(i==(ba[i]-start)>>2) assem_debug("idle loop"); + if(!match) invert=1; + #ifdef CORTEX_A8_BRANCH_PREDICTION_HACK + if(i>(ba[i]-start)>>2) invert=1; + #endif + + //if(opcode2[i]>=0x10) return; // FIXME (BxxZAL) + assert(opcode2[i]<0x10||rs1[i]==0); // FIXME (BxxZAL) + + if(ooo[i]) { + s1l=get_reg(branch_regs[i].regmap,rs1[i]); + s1h=get_reg(branch_regs[i].regmap,rs1[i]|64); + } + else { + s1l=get_reg(i_regmap,rs1[i]); + s1h=get_reg(i_regmap,rs1[i]|64); + } + if(rs1[i]==0) + { + if(opcode2[i]&1) unconditional=1; + else nevertaken=1; + // These are never taken (r0 is never less than zero) + //assert(opcode2[i]!=0); + //assert(opcode2[i]!=2); + //assert(opcode2[i]!=0x10); + //assert(opcode2[i]!=0x12); + } + else { + only32=(regs[i].was32>>rs1[i])&1; + } + + if(ooo[i]) { + // Out of order execution (delay slot first) + //DebugMessage(M64MSG_VERBOSE, "OOOE"); + address_generation(i+1,i_regs,regs[i].regmap_entry); + ds_assemble(i+1,i_regs); + int adj; + uint64_t bc_unneeded=branch_regs[i].u; + uint64_t bc_unneeded_upper=branch_regs[i].uu; + bc_unneeded&=~((1LL<=0) { + // Save the PC even if the branch is not taken + return_address=start+i*4+8; + emit_movimm(return_address,rt); // PC into link register + #ifdef IMM_PREFETCH + if(!nevertaken) emit_prefetch(hash_table[((return_address>>16)^return_address)&0xFFFF]); + #endif + } + } + cc=get_reg(branch_regs[i].regmap,CCREG); + assert(cc==HOST_CCREG); + if(unconditional) + store_regs_bt(branch_regs[i].regmap,branch_regs[i].is32,branch_regs[i].dirty,ba[i]); + //do_cc(i,branch_regs[i].regmap,&adj,unconditional?ba[i]:-1,unconditional); + assem_debug("cycle count (adj)"); + if(unconditional) { + do_cc(i,branch_regs[i].regmap,&adj,ba[i],TAKEN,0); + if(i!=(ba[i]-start)>>2 || source[i+1]!=0) { + if(adj) emit_addimm(cc,CLOCK_DIVIDER*(ccadj[i]+2-adj),cc); + load_regs_bt(branch_regs[i].regmap,branch_regs[i].is32,branch_regs[i].dirty,ba[i]); + if(internal) + assem_debug("branch: internal"); + else + assem_debug("branch: external"); + if(internal&&is_ds[(ba[i]-start)>>2]) { + ds_assemble_entry(i); + } + else { + add_to_linker((int)out,ba[i],internal); + emit_jmp(0); + } + #ifdef CORTEX_A8_BRANCH_PREDICTION_HACK + if(((u_int)out)&7) emit_addnop(0); + #endif + } + } + else if(nevertaken) { + emit_addimm_and_set_flags(CLOCK_DIVIDER*(ccadj[i]+2),cc); + int jaddr=(int)out; + emit_jns(0); + add_stub(CC_STUB,jaddr,(int)out,0,i,start+i*4+8,NOTTAKEN,0); + } + else { + int nottaken=0; + do_cc(i,branch_regs[i].regmap,&adj,-1,0,invert); + if(adj&&!invert) emit_addimm(cc,CLOCK_DIVIDER*(ccadj[i]+2-adj),cc); + if(!only32) + { + assert(s1h>=0); + if(opcode2[i]==0) // BLTZ + { + emit_test(s1h,s1h); + if(invert){ + nottaken=(int)out; + emit_jns(1); + }else{ + add_to_linker((int)out,ba[i],internal); + emit_js(0); + } + } + if(opcode2[i]==1) // BGEZ + { + emit_test(s1h,s1h); + if(invert){ + nottaken=(int)out; + emit_js(1); + }else{ + add_to_linker((int)out,ba[i],internal); + emit_jns(0); + } + } + } // if(!only32) + else + { + assert(s1l>=0); + if(opcode2[i]==0) // BLTZ + { + emit_test(s1l,s1l); + if(invert){ + nottaken=(int)out; + emit_jns(1); + }else{ + add_to_linker((int)out,ba[i],internal); + emit_js(0); + } + } + if(opcode2[i]==1) // BGEZ + { + emit_test(s1l,s1l); + if(invert){ + nottaken=(int)out; + emit_js(1); + }else{ + add_to_linker((int)out,ba[i],internal); + emit_jns(0); + } + } + } // if(!only32) + + if(invert) { + #ifdef CORTEX_A8_BRANCH_PREDICTION_HACK + if(match&&(!internal||!is_ds[(ba[i]-start)>>2])) { + if(adj) { + emit_addimm(cc,-CLOCK_DIVIDER*adj,cc); + add_to_linker((int)out,ba[i],internal); + }else{ + emit_addnop(13); + add_to_linker((int)out,ba[i],internal*2); + } + emit_jmp(0); + }else + #endif + { + if(adj) emit_addimm(cc,-CLOCK_DIVIDER*adj,cc); + store_regs_bt(branch_regs[i].regmap,branch_regs[i].is32,branch_regs[i].dirty,ba[i]); + load_regs_bt(branch_regs[i].regmap,branch_regs[i].is32,branch_regs[i].dirty,ba[i]); + if(internal) + assem_debug("branch: internal"); + else + assem_debug("branch: external"); + if(internal&&is_ds[(ba[i]-start)>>2]) { + ds_assemble_entry(i); + } + else { + add_to_linker((int)out,ba[i],internal); + emit_jmp(0); + } + } + set_jump_target(nottaken,(int)out); + } + + if(adj) { + if(!invert) emit_addimm(cc,CLOCK_DIVIDER*adj,cc); + } + } // (!unconditional) + } // if(ooo) + else + { + // In-order execution (branch first) + //DebugMessage(M64MSG_VERBOSE, "IOE"); + int nottaken=0; + if(!unconditional) { + //DebugMessage(M64MSG_VERBOSE, "branch(%d): eax=%d ecx=%d edx=%d ebx=%d ebp=%d esi=%d edi=%d",i,branch_regs[i].regmap[0],branch_regs[i].regmap[1],branch_regs[i].regmap[2],branch_regs[i].regmap[3],branch_regs[i].regmap[5],branch_regs[i].regmap[6],branch_regs[i].regmap[7]); + if(!only32) + { + assert(s1h>=0); + if((opcode2[i]&0x1d)==0) // BLTZ/BLTZL + { + emit_test(s1h,s1h); + nottaken=(int)out; + emit_jns(1); + } + if((opcode2[i]&0x1d)==1) // BGEZ/BGEZL + { + emit_test(s1h,s1h); + nottaken=(int)out; + emit_js(1); + } + } // if(!only32) + else + { + assert(s1l>=0); + if((opcode2[i]&0x1d)==0) // BLTZ/BLTZL + { + emit_test(s1l,s1l); + nottaken=(int)out; + emit_jns(1); + } + if((opcode2[i]&0x1d)==1) // BGEZ/BGEZL + { + emit_test(s1l,s1l); + nottaken=(int)out; + emit_js(1); + } + } + } // if(!unconditional) + int adj; + uint64_t ds_unneeded=branch_regs[i].u; + uint64_t ds_unneeded_upper=branch_regs[i].uu; + ds_unneeded&=~((1LL<>rt1[i+1])&1) ds_unneeded_upper&=~((1LL<>2]) { + ds_assemble_entry(i); + } + else { + add_to_linker((int)out,ba[i],internal); + emit_jmp(0); + } + } + // branch not taken + cop1_usable=prev_cop1_usable; + if(!unconditional) { + set_jump_target(nottaken,(int)out); + assem_debug("1:"); + if(!likely[i]) { + wb_invalidate(regs[i].regmap,branch_regs[i].regmap,regs[i].dirty,regs[i].is32, + ds_unneeded,ds_unneeded_upper); + load_regs(regs[i].regmap,branch_regs[i].regmap,regs[i].was32,rs1[i+1],rs2[i+1]); + address_generation(i+1,&branch_regs[i],0); + load_regs(regs[i].regmap,branch_regs[i].regmap,regs[i].was32,CCREG,CCREG); + ds_assemble(i+1,&branch_regs[i]); + } + cc=get_reg(branch_regs[i].regmap,CCREG); + if(cc==-1&&!likely[i]) { + // Cycle count isn't in a register, temporarily load it then write it out + emit_loadreg(CCREG,HOST_CCREG); + emit_addimm_and_set_flags(CLOCK_DIVIDER*(ccadj[i]+2),HOST_CCREG); + int jaddr=(int)out; + emit_jns(0); + add_stub(CC_STUB,jaddr,(int)out,0,i,start+i*4+8,NOTTAKEN,0); + emit_storereg(CCREG,HOST_CCREG); + } + else{ + cc=get_reg(i_regmap,CCREG); + assert(cc==HOST_CCREG); + emit_addimm_and_set_flags(CLOCK_DIVIDER*(ccadj[i]+2),cc); + int jaddr=(int)out; + emit_jns(0); + add_stub(CC_STUB,jaddr,(int)out,0,i,start+i*4+8,likely[i]?NULLDS:NOTTAKEN,0); + } + } + } +} + +static void fjump_assemble(int i,struct regstat *i_regs) +{ + signed char *i_regmap=i_regs->regmap; + int cc; + int match; + match=match_bt(branch_regs[i].regmap,branch_regs[i].is32,branch_regs[i].dirty,ba[i]); + assem_debug("fmatch=%d",match); + int fs,cs; + int eaddr; + int invert=0; + int internal=internal_branch(branch_regs[i].is32,ba[i]); + if(i==(ba[i]-start)>>2) assem_debug("idle loop"); + if(!match) invert=1; + #ifdef CORTEX_A8_BRANCH_PREDICTION_HACK + if(i>(ba[i]-start)>>2) invert=1; + #endif + + if(ooo[i]) { + fs=get_reg(branch_regs[i].regmap,FSREG); + address_generation(i+1,i_regs,regs[i].regmap_entry); // Is this okay? + } + else { + fs=get_reg(i_regmap,FSREG); + } + + // Check cop1 unusable + if(!cop1_usable) { + cs=get_reg(i_regmap,CSREG); + assert(cs>=0); + emit_testimm(cs,0x20000000); + eaddr=(int)out; + emit_jeq(0); + add_stub(FP_STUB,eaddr,(int)out,i,cs,(int)i_regs,0,0); + cop1_usable=1; + } + + if(ooo[i]) { + // Out of order execution (delay slot first) + //DebugMessage(M64MSG_VERBOSE, "OOOE"); + ds_assemble(i+1,i_regs); + int adj; + uint64_t bc_unneeded=branch_regs[i].u; + uint64_t bc_unneeded_upper=branch_regs[i].uu; + bc_unneeded&=~((1LL<=0); + emit_testimm(fs,0x800000); + if(source[i]&0x10000) // BC1T + { + if(invert){ + nottaken=(int)out; + emit_jeq(1); + }else{ + add_to_linker((int)out,ba[i],internal); + emit_jne(0); + } + } + else // BC1F + if(invert){ + nottaken=(int)out; + emit_jne(1); + }else{ + add_to_linker((int)out,ba[i],internal); + emit_jeq(0); + } + { + } + } // if(!only32) + + if(invert) { + if(adj) emit_addimm(cc,-CLOCK_DIVIDER*adj,cc); + #ifdef CORTEX_A8_BRANCH_PREDICTION_HACK + else if(match) emit_addnop(13); + #endif + store_regs_bt(branch_regs[i].regmap,branch_regs[i].is32,branch_regs[i].dirty,ba[i]); + load_regs_bt(branch_regs[i].regmap,branch_regs[i].is32,branch_regs[i].dirty,ba[i]); + if(internal) + assem_debug("branch: internal"); + else + assem_debug("branch: external"); + if(internal&&is_ds[(ba[i]-start)>>2]) { + ds_assemble_entry(i); + } + else { + add_to_linker((int)out,ba[i],internal); + emit_jmp(0); + } + set_jump_target(nottaken,(int)out); + } + + if(adj) { + if(!invert) emit_addimm(cc,CLOCK_DIVIDER*adj,cc); + } + } // (!unconditional) + } // if(ooo) + else + { + // In-order execution (branch first) + //DebugMessage(M64MSG_VERBOSE, "IOE"); + int nottaken=0; + if(1) { + //DebugMessage(M64MSG_VERBOSE, "branch(%d): eax=%d ecx=%d edx=%d ebx=%d ebp=%d esi=%d edi=%d",i,branch_regs[i].regmap[0],branch_regs[i].regmap[1],branch_regs[i].regmap[2],branch_regs[i].regmap[3],branch_regs[i].regmap[5],branch_regs[i].regmap[6],branch_regs[i].regmap[7]); + if(1) { + assert(fs>=0); + emit_testimm(fs,0x800000); + if(source[i]&0x10000) // BC1T + { + nottaken=(int)out; + emit_jeq(1); + } + else // BC1F + { + nottaken=(int)out; + emit_jne(1); + } + } + } // if(!unconditional) + int adj; + uint64_t ds_unneeded=branch_regs[i].u; + uint64_t ds_unneeded_upper=branch_regs[i].uu; + ds_unneeded&=~((1LL<>rt1[i+1])&1) ds_unneeded_upper&=~((1LL<>2]) { + ds_assemble_entry(i); + } + else { + add_to_linker((int)out,ba[i],internal); + emit_jmp(0); + } + + // branch not taken + if(1) { // <- FIXME (don't need this) + set_jump_target(nottaken,(int)out); + assem_debug("1:"); + if(!likely[i]) { + wb_invalidate(regs[i].regmap,branch_regs[i].regmap,regs[i].dirty,regs[i].is32, + ds_unneeded,ds_unneeded_upper); + load_regs(regs[i].regmap,branch_regs[i].regmap,regs[i].was32,rs1[i+1],rs2[i+1]); + address_generation(i+1,&branch_regs[i],0); + load_regs(regs[i].regmap,branch_regs[i].regmap,regs[i].was32,CCREG,CCREG); + ds_assemble(i+1,&branch_regs[i]); + } + cc=get_reg(branch_regs[i].regmap,CCREG); + if(cc==-1&&!likely[i]) { + // Cycle count isn't in a register, temporarily load it then write it out + emit_loadreg(CCREG,HOST_CCREG); + emit_addimm_and_set_flags(CLOCK_DIVIDER*(ccadj[i]+2),HOST_CCREG); + int jaddr=(int)out; + emit_jns(0); + add_stub(CC_STUB,jaddr,(int)out,0,i,start+i*4+8,NOTTAKEN,0); + emit_storereg(CCREG,HOST_CCREG); + } + else{ + cc=get_reg(i_regmap,CCREG); + assert(cc==HOST_CCREG); + emit_addimm_and_set_flags(CLOCK_DIVIDER*(ccadj[i]+2),cc); + int jaddr=(int)out; + emit_jns(0); + add_stub(CC_STUB,jaddr,(int)out,0,i,start+i*4+8,likely[i]?NULLDS:NOTTAKEN,0); + } + } + } +} + +static void pagespan_assemble(int i,struct regstat *i_regs) +{ + int s1l=get_reg(i_regs->regmap,rs1[i]); + int s1h=get_reg(i_regs->regmap,rs1[i]|64); + int s2l=get_reg(i_regs->regmap,rs2[i]); + int s2h=get_reg(i_regs->regmap,rs2[i]|64); + int taken=0; + int nottaken=0; + int unconditional=0; + if(rs1[i]==0) + { + s1l=s2l;s1h=s2h; + s2l=s2h=-1; + } + else if(rs2[i]==0) + { + s2l=s2h=-1; + } + if((i_regs->is32>>rs1[i])&(i_regs->is32>>rs2[i])&1) { + s1h=s2h=-1; + } + int hr=0; + int addr,alt,ntaddr; + if(i_regs->regmap[HOST_BTREG]<0) {addr=HOST_BTREG;} + else { + while(hrregmap[hr]&63)!=rs1[i] && + (i_regs->regmap[hr]&63)!=rs2[i] ) + { + addr=hr++;break; + } + hr++; + } + } + while(hrregmap[hr]&63)!=rs1[i] && + (i_regs->regmap[hr]&63)!=rs2[i] ) + { + alt=hr++;break; + } + hr++; + } + if((opcode[i]&0x2E)==6) // BLEZ/BGTZ needs another register + { + while(hrregmap[hr]&63)!=rs1[i] && + (i_regs->regmap[hr]&63)!=rs2[i] ) + { + ntaddr=hr;break; + } + hr++; + } + } + assert(hrregmap,31); + emit_movimm(start+i*4+8,rt); + unconditional=1; + } + if(opcode[i]==0&&(opcode2[i]&0x3E)==8) // JR/JALR + { + emit_mov(s1l,addr); + if(opcode2[i]==9) // JALR + { + int rt=get_reg(i_regs->regmap,rt1[i]); + emit_movimm(start+i*4+8,rt); + } + } + if((opcode[i]&0x3f)==4) // BEQ + { + if(rs1[i]==rs2[i]) + { + unconditional=1; + } + else + #ifdef HAVE_CMOV_IMM + if(s1h<0) { + if(s2l>=0) emit_cmp(s1l,s2l); + else emit_test(s1l,s1l); + emit_cmov2imm_e_ne_compact(ba[i],start+i*4+8,addr); + } + else + #endif + { + assert(s1l>=0); + emit_mov2imm_compact(ba[i],addr,start+i*4+8,alt); + if(s1h>=0) { + if(s2h>=0) emit_cmp(s1h,s2h); + else emit_test(s1h,s1h); + emit_cmovne_reg(alt,addr); + } + if(s2l>=0) emit_cmp(s1l,s2l); + else emit_test(s1l,s1l); + emit_cmovne_reg(alt,addr); + } + } + if((opcode[i]&0x3f)==5) // BNE + { + #ifdef HAVE_CMOV_IMM + if(s1h<0) { + if(s2l>=0) emit_cmp(s1l,s2l); + else emit_test(s1l,s1l); + emit_cmov2imm_e_ne_compact(start+i*4+8,ba[i],addr); + } + else + #endif + { + assert(s1l>=0); + emit_mov2imm_compact(start+i*4+8,addr,ba[i],alt); + if(s1h>=0) { + if(s2h>=0) emit_cmp(s1h,s2h); + else emit_test(s1h,s1h); + emit_cmovne_reg(alt,addr); + } + if(s2l>=0) emit_cmp(s1l,s2l); + else emit_test(s1l,s1l); + emit_cmovne_reg(alt,addr); + } + } + if((opcode[i]&0x3f)==0x14) // BEQL + { + if(s1h>=0) { + if(s2h>=0) emit_cmp(s1h,s2h); + else emit_test(s1h,s1h); + nottaken=(int)out; + emit_jne(0); + } + if(s2l>=0) emit_cmp(s1l,s2l); + else emit_test(s1l,s1l); + if(nottaken) set_jump_target(nottaken,(int)out); + nottaken=(int)out; + emit_jne(0); + } + if((opcode[i]&0x3f)==0x15) // BNEL + { + if(s1h>=0) { + if(s2h>=0) emit_cmp(s1h,s2h); + else emit_test(s1h,s1h); + taken=(int)out; + emit_jne(0); + } + if(s2l>=0) emit_cmp(s1l,s2l); + else emit_test(s1l,s1l); + nottaken=(int)out; + emit_jeq(0); + if(taken) set_jump_target(taken,(int)out); + } + if((opcode[i]&0x3f)==6) // BLEZ + { + emit_mov2imm_compact(ba[i],alt,start+i*4+8,addr); + emit_cmpimm(s1l,1); + if(s1h>=0) emit_mov(addr,ntaddr); + emit_cmovl_reg(alt,addr); + if(s1h>=0) { + emit_test(s1h,s1h); + emit_cmovne_reg(ntaddr,addr); + emit_cmovs_reg(alt,addr); + } + } + if((opcode[i]&0x3f)==7) // BGTZ + { + emit_mov2imm_compact(ba[i],addr,start+i*4+8,ntaddr); + emit_cmpimm(s1l,1); + if(s1h>=0) emit_mov(addr,alt); + emit_cmovl_reg(ntaddr,addr); + if(s1h>=0) { + emit_test(s1h,s1h); + emit_cmovne_reg(alt,addr); + emit_cmovs_reg(ntaddr,addr); + } + } + if((opcode[i]&0x3f)==0x16) // BLEZL + { + assert((opcode[i]&0x3f)!=0x16); + } + if((opcode[i]&0x3f)==0x17) // BGTZL + { + assert((opcode[i]&0x3f)!=0x17); + } + assert(opcode[i]!=1); // BLTZ/BGEZ + + //FIXME: Check CSREG + if(opcode[i]==0x11 && opcode2[i]==0x08 ) { + if((source[i]&0x30000)==0) // BC1F + { + emit_mov2imm_compact(ba[i],addr,start+i*4+8,alt); + emit_testimm(s1l,0x800000); + emit_cmovne_reg(alt,addr); + } + if((source[i]&0x30000)==0x10000) // BC1T + { + emit_mov2imm_compact(ba[i],alt,start+i*4+8,addr); + emit_testimm(s1l,0x800000); + emit_cmovne_reg(alt,addr); + } + if((source[i]&0x30000)==0x20000) // BC1FL + { + emit_testimm(s1l,0x800000); + nottaken=(int)out; + emit_jne(0); + } + if((source[i]&0x30000)==0x30000) // BC1TL + { + emit_testimm(s1l,0x800000); + nottaken=(int)out; + emit_jeq(0); + } + } + + assert(i_regs->regmap[HOST_CCREG]==CCREG); + wb_dirtys(regs[i].regmap,regs[i].is32,regs[i].dirty); + if(likely[i]||unconditional) + { + emit_movimm(ba[i],HOST_BTREG); + } + else if(addr!=HOST_BTREG) + { + emit_mov(addr,HOST_BTREG); + } + void *branch_addr=out; + emit_jmp(0); + int target_addr=start+i*4+5; + void *stub=out; + void *compiled_target_addr=check_addr(target_addr); + emit_extjump_ds((int)branch_addr,target_addr); + if(compiled_target_addr) { + set_jump_target((int)branch_addr,(int)compiled_target_addr); + add_link(target_addr,stub); + } + else set_jump_target((int)branch_addr,(int)stub); + if(likely[i]) { + // Not-taken path + set_jump_target((int)nottaken,(int)out); + wb_dirtys(regs[i].regmap,regs[i].is32,regs[i].dirty); + void *branch_addr=out; + emit_jmp(0); + int target_addr=start+i*4+8; + void *stub=out; + void *compiled_target_addr=check_addr(target_addr); + emit_extjump_ds((int)branch_addr,target_addr); + if(compiled_target_addr) { + set_jump_target((int)branch_addr,(int)compiled_target_addr); + add_link(target_addr,stub); + } + else set_jump_target((int)branch_addr,(int)stub); + } +} + +// Assemble the delay slot for the above +static void pagespan_ds() +{ + assem_debug("initial delay slot:"); + u_int vaddr=start+1; + u_int page=(0x80000000^vaddr)>>12; + u_int vpage=page; + if(page>262143&&tlb_LUT_r[vaddr>>12]) page=(tlb_LUT_r[page^0x80000]^0x80000000)>>12; + if(page>2048) page=2048+(page&2047); + if(vpage>262143&&tlb_LUT_r[vaddr>>12]) vpage&=2047; // jump_dirty uses a hash of the virtual address instead + if(vpage>2048) vpage=2048+(vpage&2047); + ll_add(jump_dirty+vpage,vaddr,(void *)out); + do_dirty_stub_ds(); + ll_add(jump_in+page,vaddr,(void *)out); + assert(regs[0].regmap_entry[HOST_CCREG]==CCREG); + if(regs[0].regmap[HOST_CCREG]!=CCREG) + wb_register(CCREG,regs[0].regmap_entry,regs[0].wasdirty,regs[0].was32); + if(regs[0].regmap[HOST_BTREG]!=BTREG) + emit_writeword(HOST_BTREG,(int)&branch_target); + load_regs(regs[0].regmap_entry,regs[0].regmap,regs[0].was32,rs1[0],rs2[0]); + address_generation(0,®s[0],regs[0].regmap_entry); + if(itype[0]==LOAD||itype[0]==LOADLR||itype[0]==STORE||itype[0]==STORELR||itype[0]==C1LS) + load_regs(regs[0].regmap_entry,regs[0].regmap,regs[0].was32,MMREG,ROREG); + if(itype[0]==STORE||itype[0]==STORELR||(opcode[0]&0x3b)==0x39) + load_regs(regs[0].regmap_entry,regs[0].regmap,regs[0].was32,INVCP,INVCP); + cop1_usable=0; + is_delayslot=0; + switch(itype[0]) { + case ALU: + alu_assemble(0,®s[0]);break; + case IMM16: + imm16_assemble(0,®s[0]);break; + case SHIFT: + shift_assemble(0,®s[0]);break; + case SHIFTIMM: + shiftimm_assemble(0,®s[0]);break; + case LOAD: + load_assemble(0,®s[0]);break; + case LOADLR: + loadlr_assemble(0,®s[0]);break; + case STORE: + store_assemble(0,®s[0]);break; + case STORELR: + storelr_assemble(0,®s[0]);break; + case COP0: + cop0_assemble(0,®s[0]);break; + case COP1: + cop1_assemble(0,®s[0]);break; + case C1LS: + c1ls_assemble(0,®s[0]);break; + case FCONV: + fconv_assemble(0,®s[0]);break; + case FLOAT: + float_assemble(0,®s[0]);break; + case FCOMP: + fcomp_assemble(0,®s[0]);break; + case MULTDIV: + multdiv_assemble(0,®s[0]);break; + case MOV: + mov_assemble(0,®s[0]);break; + case SYSCALL: + case SPAN: + case UJUMP: + case RJUMP: + case CJUMP: + case SJUMP: + case FJUMP: + DebugMessage(M64MSG_VERBOSE, "Jump in the delay slot. This is probably a bug."); + } + int btaddr=get_reg(regs[0].regmap,BTREG); + if(btaddr<0) { + btaddr=get_reg(regs[0].regmap,-1); + emit_readword((int)&branch_target,btaddr); + } + assert(btaddr!=HOST_CCREG); + if(regs[0].regmap[HOST_CCREG]!=CCREG) emit_loadreg(CCREG,HOST_CCREG); +#ifdef HOST_IMM8 + emit_movimm(start+4,HOST_TEMPREG); + emit_cmp(btaddr,HOST_TEMPREG); +#else + emit_cmpimm(btaddr,start+4); +#endif + int branch=(int)out; + emit_jeq(0); + store_regs_bt(regs[0].regmap,regs[0].is32,regs[0].dirty,-1); + emit_jmp(jump_vaddr_reg[btaddr]); + set_jump_target(branch,(int)out); + store_regs_bt(regs[0].regmap,regs[0].is32,regs[0].dirty,start+4); + load_regs_bt(regs[0].regmap,regs[0].is32,regs[0].dirty,start+4); +} + +// Basic liveness analysis for MIPS registers +static void unneeded_registers(int istart,int iend,int r) +{ + int i; + uint64_t u,uu,b,bu; + uint64_t temp_u,temp_uu; + uint64_t tdep; + if(iend==slen-1) { + u=1;uu=1; + }else{ + u=unneeded_reg[iend+1]; + uu=unneeded_reg_upper[iend+1]; + u=1;uu=1; + } + for (i=iend;i>=istart;i--) + { + //DebugMessage(M64MSG_VERBOSE, "unneeded registers i=%d (%d,%d) r=%d",i,istart,iend,r); + if(itype[i]==RJUMP||itype[i]==UJUMP||itype[i]==CJUMP||itype[i]==SJUMP||itype[i]==FJUMP) + { + // If subroutine call, flag return address as a possible branch target + if(rt1[i]==31 && i=(start+slen*4)) + { + // Branch out of this block, flush all regs + u=1; + uu=1; + /* Hexagon hack + if(itype[i]==UJUMP&&rt1[i]==31) + { + uu=u=0x300C00F; // Discard at, v0-v1, t6-t9 + } + if(itype[i]==RJUMP&&rs1[i]==31) + { + uu=u=0x300C0F3; // Discard at, a0-a3, t6-t9 + } + if(start>0x80000400&&start<0x80800000) { + if(itype[i]==UJUMP&&rt1[i]==31) + { + //uu=u=0x30300FF0FLL; // Discard at, v0-v1, t0-t9, lo, hi + uu=u=0x300FF0F; // Discard at, v0-v1, t0-t9 + } + if(itype[i]==RJUMP&&rs1[i]==31) + { + //uu=u=0x30300FFF3LL; // Discard at, a0-a3, t0-t9, lo, hi + uu=u=0x300FFF3; // Discard at, a0-a3, t0-t9 + } + }*/ + branch_unneeded_reg[i]=u; + branch_unneeded_reg_upper[i]=uu; + // Merge in delay slot + tdep=(~uu>>rt1[i+1])&1; + u|=(1LL<>2]=1; + if(ba[i]<=start+i*4) { + // Backward branch + if(itype[i]==RJUMP||itype[i]==UJUMP||(source[i]>>16)==0x1000) + { + // Unconditional branch + temp_u=1;temp_uu=1; + } else { + // Conditional branch (not taken case) + temp_u=unneeded_reg[i+2]; + temp_uu=unneeded_reg_upper[i+2]; + } + // Merge in delay slot + tdep=(~temp_uu>>rt1[i+1])&1; + temp_u|=(1LL<>rt1[i])&1; + temp_u|=(1LL<>2,i-1,r+1); + }else{ + unneeded_reg[(ba[i]-start)>>2]=1; + unneeded_reg_upper[(ba[i]-start)>>2]=1; + } + } /*else*/ if(1) { + if(itype[i]==RJUMP||itype[i]==UJUMP||(source[i]>>16)==0x1000) + { + // Unconditional branch + u=unneeded_reg[(ba[i]-start)>>2]; + uu=unneeded_reg_upper[(ba[i]-start)>>2]; + branch_unneeded_reg[i]=u; + branch_unneeded_reg_upper[i]=uu; + //u=1; + //uu=1; + //branch_unneeded_reg[i]=u; + //branch_unneeded_reg_upper[i]=uu; + // Merge in delay slot + tdep=(~uu>>rt1[i+1])&1; + u|=(1LL<>2]; + bu=unneeded_reg_upper[(ba[i]-start)>>2]; + branch_unneeded_reg[i]=b; + branch_unneeded_reg_upper[i]=bu; + //b=1; + //bu=1; + //branch_unneeded_reg[i]=b; + //branch_unneeded_reg_upper[i]=bu; + // Branch delay slot + tdep=(~uu>>rt1[i+1])&1; + b|=(1LL<>rt1[i])&1; + // Written registers are unneeded + u|=1LL<>r)&1) { + if(r==HIREG) DebugMessage(M64MSG_VERBOSE, " HI"); + else if(r==LOREG) DebugMessage(M64MSG_VERBOSE, " LO"); + else DebugMessage(M64MSG_VERBOSE, " r%d",r); + } + } + DebugMessage(M64MSG_VERBOSE, " UU:"); + for(r=1;r<=CCREG;r++) { + if(((unneeded_reg_upper[i]&~unneeded_reg[i])>>r)&1) { + if(r==HIREG) DebugMessage(M64MSG_VERBOSE, " HI"); + else if(r==LOREG) DebugMessage(M64MSG_VERBOSE, " LO"); + else DebugMessage(M64MSG_VERBOSE, " r%d",r); + } + }*/ + } +} + +// Identify registers which are likely to contain 32-bit values +// This is used to predict whether any branches will jump to a +// location with 64-bit values in registers. +static void provisional_32bit() +{ + int i,j; + uint64_t is32=1; + uint64_t lastbranch=1; + + for(i=0;i0) { + if(itype[i-1]==CJUMP||itype[i-1]==SJUMP||itype[i-1]==FJUMP) { + if(i>1) is32=lastbranch; + else is32=1; + } + } + if(i>1) + { + if(itype[i-2]==CJUMP||itype[i-2]==SJUMP||itype[i-2]==FJUMP) { + if(likely[i-2]) { + if(i>2) is32=lastbranch; + else is32=1; + } + } + if((opcode[i-2]&0x2f)==0x05) // BNE/BNEL + { + if(rs1[i-2]==0||rs2[i-2]==0) + { + if(rs1[i-2]) { + is32|=1LL<=0;j--) + { + if(ba[j]==start+i*4) + //temp_is32&=branch_regs[j].is32; + temp_is32&=p32[j]; + } + for(j=i;j>s1)&1LL)<>s1)&1LL); + is32&=~(1LL<=0x20&&op2<=0x23) { // ADD/ADDU/SUB/SUBU + is32|=1LL<=0x24&&op2<=0x27) { // AND/OR/XOR/NOR + uint64_t sr=((is32>>s1)&(is32>>s2)&1LL); + is32&=~(1LL<=0x2c&&op2<=0x2d) { // DADD/DADDU + if(s1==0&&s2==0) { + is32|=1LL<>s1)&1LL); + is32&=~(1LL<>s2)&1LL); + is32&=~(1LL<=0x2e&&op2<=0x2f) { // DSUB/DSUBU + if(s1==0&&s2==0) { + is32|=1LL<>s1)&1LL); + is32&=~(1LL<=0x1c&&op2<=0x1f) { // DMULT/DMULTU/DDIV/DDIVU + is32&=~((1LL<>s1)&1LL); + is32&=~(1LL<=0x14&&op2<=0x17) is32&=~(1LL<=0x38&&op2<0x3f) is32&=~(1LL<0) + { + if(itype[i-1]==UJUMP||itype[i-1]==RJUMP||(source[i-1]>>16)==0x1000) + { + if(rt1[i-1]==31) // JAL/JALR + { + // Subroutine call will return here, don't alloc any registers + is32=1; + } + else if(i+1=0;i--) + { + int hr; + if(itype[i]==RJUMP||itype[i]==UJUMP||itype[i]==CJUMP||itype[i]==SJUMP||itype[i]==FJUMP) + { + if(ba[i]=(start+slen*4)) + { + // Branch out of this block, don't need anything + r32=0; + } + else + { + // Internal branch + // Need whatever matches the target + // (and doesn't get overwritten by the delay slot instruction) + r32=0; + int t=(ba[i]-start)>>2; + if(ba[i]>start+i*4) { + // Forward branch + //if(!(requires_32bit[t]&~regs[i].was32)) + // r32|=requires_32bit[t]&(~(1LL<>16)!=0x1000) + { + if(i0) + { + if((regs[i].was32>>us1[i+1])&1) r32|=1LL<0) + { + if((regs[i].was32>>us2[i+1])&1) r32|=1LL<>dep1[i+1])&1)) + { + if((regs[i].was32>>dep1[i+1])&1) r32|=1LL<>dep2[i+1])&1)) + { + if((regs[i].was32>>dep2[i+1])&1) r32|=1LL<0) + { + if((regs[i].was32>>us1[i])&1) r32|=1LL<0) + { + if((regs[i].was32>>us2[i])&1) r32|=1LL<>dep1[i])&1)) + { + if((regs[i].was32>>dep1[i])&1) r32|=1LL<>dep2[i])&1)) + { + if((regs[i].was32>>dep2[i])&1) r32|=1LL<0&®s[i].regmap_entry[hr]<64) { + if((regs[i].was32>>regs[i].regmap_entry[hr])&(regs[i].wasdirty>>hr)&1) { + if(!((unneeded_reg_upper[i]>>regs[i].regmap_entry[hr])&1)) + pr32[i]|=1LL<=istart;i--) + { + if(itype[i]==RJUMP||itype[i]==UJUMP||itype[i]==CJUMP||itype[i]==SJUMP||itype[i]==FJUMP) + { + if(ba[i]=(start+slen*4)) + { + // Branch out of this block, flush all regs + if(itype[i]==RJUMP||itype[i]==UJUMP||(source[i]>>16)==0x1000) + { + // Unconditional branch + will_dirty_i=0; + wont_dirty_i=0; + // Merge in delay slot (will dirty) + for(r=0;r33) will_dirty_i&=~(1<33) will_dirty_i&=~(1<33) will_dirty_i&=~(1<33) will_dirty_i&=~(1<>16)==0x1000) + { + // Unconditional branch + temp_will_dirty=0; + temp_wont_dirty=0; + // Merge in delay slot (will dirty) + for(r=0;r33) temp_will_dirty&=~(1<33) temp_will_dirty&=~(1<33) temp_will_dirty&=~(1<33) temp_will_dirty&=~(1<0 && (regmap_pre[i][r]&63)<34) { + temp_will_dirty|=((unneeded_reg[i]>>(regmap_pre[i][r]&63))&1)<>(regmap_pre[i][r]&63))&1)<>2,i-1,0); + }else{ + // Limit recursion. It can take an excessive amount + // of time if there are a lot of nested loops. + will_dirty[(ba[i]-start)>>2]=0; + wont_dirty[(ba[i]-start)>>2]=-1; + } + } + /*else*/ if(1) + { + if(itype[i]==RJUMP||itype[i]==UJUMP||(source[i]>>16)==0x1000) + { + // Unconditional branch + will_dirty_i=0; + wont_dirty_i=0; + //if(ba[i]>start+i*4) { // Disable recursion (for debugging) + for(r=0;r>2].regmap_entry[r]) { + will_dirty_i|=will_dirty[(ba[i]-start)>>2]&(1<>2]&(1<=0) { + will_dirty_i|=((unneeded_reg[(ba[i]-start)>>2]>>(branch_regs[i].regmap[r]&63))&1)<>2]>>(branch_regs[i].regmap[r]&63))&1)<33) will_dirty_i&=~(1<33) will_dirty_i&=~(1<start+i*4) { // Disable recursion (for debugging) + for(r=0;r>2].regmap_entry[r]) { + will_dirty_i&=will_dirty[(ba[i]-start)>>2]&(1<>2]&(1<=0) { + will_dirty_i&=((unneeded_reg[(ba[i]-start)>>2]>>(target_reg&63))&1)<>2]>>(target_reg&63))&1)<>2].regmap_entry[r]) { + will_dirty[i+1]&=will_dirty[(ba[i]-start)>>2]&(1<>2]&(1<33) will_dirty_i&=~(1<33) will_dirty_i&=~(1<33) will_dirty_i&=~(1<istart) { + if(itype[i]!=RJUMP&&itype[i]!=UJUMP&&itype[i]!=CJUMP&&itype[i]!=SJUMP&&itype[i]!=FJUMP) + { + // Don't store a register immediately after writing it, + // may prevent dual-issue. + if((regs[i].regmap[r]&63)==rt1[i-1]) wont_dirty_i|=1<>r)&1) { + DebugMessage(M64MSG_VERBOSE, " r%d",r); + } + }*/ + + //if(i==istart||(itype[i-1]!=RJUMP&&itype[i-1]!=UJUMP&&itype[i-1]!=CJUMP&&itype[i-1]!=SJUMP&&itype[i-1]!=FJUMP)) { + regs[i].dirty|=will_dirty_i; + #ifndef DESTRUCTIVE_WRITEBACK + regs[i].dirty&=wont_dirty_i; + if(itype[i]==RJUMP||itype[i]==UJUMP||itype[i]==CJUMP||itype[i]==SJUMP||itype[i]==FJUMP) + { + if(i>16)!=0x1000) { + for(r=0;r>r)&1));*/} + } + } + } + } + else + { + if(i>r)&1));*/} + } + } + } + } + #endif + //} + } + // Deal with changed mappings + temp_will_dirty=will_dirty_i; + temp_wont_dirty=wont_dirty_i; + for(r=0;r=0) { + // Register moved to a different register + will_dirty_i&=~(1<>nr)&1)<>nr)&1)<0 && (regmap_pre[i][r]&63)<34) { + will_dirty_i|=((unneeded_reg[i]>>(regmap_pre[i][r]&63))&1)<>(regmap_pre[i][r]&63))&1)<>r)&1));*/ + } + } + } + } + } +} + +#ifdef ASSEM_DEBUG + /* disassembly */ +static void disassemble_inst(int i) +{ + if (bt[i]) DebugMessage(M64MSG_VERBOSE, "*"); else DebugMessage(M64MSG_VERBOSE, " "); + switch(itype[i]) { + case UJUMP: + printf (" %x: %s %8x",start+i*4,insn[i],ba[i]);break; + case CJUMP: + printf (" %x: %s r%d,r%d,%8x",start+i*4,insn[i],rs1[i],rs2[i],i?start+i*4+4+((signed int)((unsigned int)source[i]<<16)>>14):*ba);break; + case SJUMP: + printf (" %x: %s r%d,%8x",start+i*4,insn[i],rs1[i],start+i*4+4+((signed int)((unsigned int)source[i]<<16)>>14));break; + case FJUMP: + printf (" %x: %s %8x",start+i*4,insn[i],ba[i]);break; + case RJUMP: + if ((opcode2[i]&1)&&rt1[i]!=31) + printf (" %x: %s r%d,r%d",start+i*4,insn[i],rt1[i],rs1[i]); + else + printf (" %x: %s r%d",start+i*4,insn[i],rs1[i]); + break; + case SPAN: + printf (" %x: %s (pagespan) r%d,r%d,%8x",start+i*4,insn[i],rs1[i],rs2[i],ba[i]);break; + case IMM16: + if(opcode[i]==0xf) //LUI + printf (" %x: %s r%d,%4x0000",start+i*4,insn[i],rt1[i],imm[i]&0xffff); + else + printf (" %x: %s r%d,r%d,%d",start+i*4,insn[i],rt1[i],rs1[i],imm[i]); + break; + case LOAD: + case LOADLR: + printf (" %x: %s r%d,r%d+%x",start+i*4,insn[i],rt1[i],rs1[i],imm[i]); + break; + case STORE: + case STORELR: + printf (" %x: %s r%d,r%d+%x",start+i*4,insn[i],rs2[i],rs1[i],imm[i]); + break; + case ALU: + case SHIFT: + printf (" %x: %s r%d,r%d,r%d",start+i*4,insn[i],rt1[i],rs1[i],rs2[i]); + break; + case MULTDIV: + printf (" %x: %s r%d,r%d",start+i*4,insn[i],rs1[i],rs2[i]); + break; + case SHIFTIMM: + printf (" %x: %s r%d,r%d,%d",start+i*4,insn[i],rt1[i],rs1[i],imm[i]); + break; + case MOV: + if((opcode2[i]&0x1d)==0x10) + printf (" %x: %s r%d",start+i*4,insn[i],rt1[i]); + else if((opcode2[i]&0x1d)==0x11) + printf (" %x: %s r%d",start+i*4,insn[i],rs1[i]); + else + printf (" %x: %s",start+i*4,insn[i]); + break; + case COP0: + if(opcode2[i]==0) + printf (" %x: %s r%d,cpr0[%d]",start+i*4,insn[i],rt1[i],(source[i]>>11)&0x1f); // MFC0 + else if(opcode2[i]==4) + printf (" %x: %s r%d,cpr0[%d]",start+i*4,insn[i],rs1[i],(source[i]>>11)&0x1f); // MTC0 + else printf (" %x: %s",start+i*4,insn[i]); + break; + case COP1: + if(opcode2[i]<3) + printf (" %x: %s r%d,cpr1[%d]",start+i*4,insn[i],rt1[i],(source[i]>>11)&0x1f); // MFC1 + else if(opcode2[i]>3) + printf (" %x: %s r%d,cpr1[%d]",start+i*4,insn[i],rs1[i],(source[i]>>11)&0x1f); // MTC1 + else printf (" %x: %s",start+i*4,insn[i]); + break; + case C1LS: + printf (" %x: %s cpr1[%d],r%d+%x",start+i*4,insn[i],(source[i]>>16)&0x1f,rs1[i],imm[i]); + break; + default: + //printf (" %s %8x",insn[i],source[i]); + printf (" %x: %s",start+i*4,insn[i]); + } +} +#endif + +void new_dynarec_init() +{ + DebugMessage(M64MSG_INFO, "Init new dynarec"); + +#if NEW_DYNAREC == NEW_DYNAREC_ARM + if ((base_addr = mmap ((u_char *)BASE_ADDR, 1<>2; + for(n=526336;n<1048576;n++) // 0x80800000 .. 0xFFFFFFFF + memory_map[n]=-1; + for(n=0;n<0x8000;n++) { // 0 .. 0x7FFFFFFF + writemem[n] = write_nomem_new; + writememb[n] = write_nomemb_new; + writememh[n] = write_nomemh_new; + writememd[n] = write_nomemd_new; + readmem[n] = read_nomem_new; + readmemb[n] = read_nomemb_new; + readmemh[n] = read_nomemh_new; + readmemd[n] = read_nomemd_new; + } + for(n=0x8000;n<0x8080;n++) { // 0x80000000 .. 0x807FFFFF + writemem[n] = write_rdram_new; + writememb[n] = write_rdramb_new; + writememh[n] = write_rdramh_new; + writememd[n] = write_rdramd_new; + } + for(n=0xC000;n<0x10000;n++) { // 0xC0000000 .. 0xFFFFFFFF + writemem[n] = write_nomem_new; + writememb[n] = write_nomemb_new; + writememh[n] = write_nomemh_new; + writememd[n] = write_nomemd_new; + readmem[n] = read_nomem_new; + readmemb[n] = read_nomemb_new; + readmemh[n] = read_nomemh_new; + readmemd[n] = read_nomemd_new; + } + tlb_hacks(); + arch_init(); +} + +void new_dynarec_cleanup() +{ + int n; + if (munmap (base_addr, 1< %x", (int)addr, (int)out); +#if defined (COUNT_NOTCOMPILEDS ) + notcompiledCount++; + log_message( "notcompiledCount=%i", notcompiledCount ); +#endif + //DebugMessage(M64MSG_VERBOSE, "NOTCOMPILED: addr = %x -> %x", (int)addr, (int)out); + //DebugMessage(M64MSG_VERBOSE, "TRACE: count=%d next=%d (compile %x)",Count,next_interupt,addr); + //if(debug) + //DebugMessage(M64MSG_VERBOSE, "TRACE: count=%d next=%d (checksum %x)",Count,next_interupt,mchecksum()); + //DebugMessage(M64MSG_VERBOSE, "fpu mapping=%x enabled=%x",(Status & 0x04000000)>>26,(Status & 0x20000000)>>29); + /*if(Count>=312978186) { + rlist(); + }*/ + //rlist(); + start = (u_int)addr&~3; + //assert(((u_int)addr&1)==0); + if ((int)addr >= 0xa4000000 && (int)addr < 0xa4001000) { + source = (u_int *)((u_int)SP_DMEM+start-0xa4000000); + pagelimit = 0xa4001000; + } + else if ((int)addr >= 0x80000000 && (int)addr < 0x80800000) { + source = (u_int *)((u_int)rdram+start-0x80000000); + pagelimit = 0x80800000; + } + else if ((signed int)addr >= (signed int)0xC0000000) { + //DebugMessage(M64MSG_VERBOSE, "addr=%x mm=%x",(u_int)addr,(memory_map[start>>12]<<2)); + //if(tlb_LUT_r[start>>12]) + //source = (u_int *)(((int)rdram)+(tlb_LUT_r[start>>12]&0xFFFFF000)+(((int)addr)&0xFFF)-0x80000000); + if((signed int)memory_map[start>>12]>=0) { + source = (u_int *)((u_int)(start+(memory_map[start>>12]<<2))); + pagelimit=(start+4096)&0xFFFFF000; + int map=memory_map[start>>12]; + int i; + for(i=0;i<5;i++) { + //DebugMessage(M64MSG_VERBOSE, "start: %x next: %x",map,memory_map[pagelimit>>12]); + if((map&0xBFFFFFFF)==(memory_map[pagelimit>>12]&0xBFFFFFFF)) pagelimit+=4096; + } + assem_debug("pagelimit=%x",pagelimit); + assem_debug("mapping=%x (%x)",memory_map[start>>12],(memory_map[start>>12]<<2)+start); + } + else { + assem_debug("Compile at unmapped memory address: %x ", (int)addr); + //assem_debug("start: %x next: %x",memory_map[start>>12],memory_map[(start+4096)>>12]); + return 1; // Caller will invoke exception handler + } + //DebugMessage(M64MSG_VERBOSE, "source= %x",(int)source); + } + else { + //DebugMessage(M64MSG_VERBOSE, "Compile at bogus memory address: %x ", (int)addr); + log_message("Compile at bogus memory address: %x", (int)addr); + exit(1); + } + + /* Pass 1: disassemble */ + /* Pass 2: register dependencies, branch targets */ + /* Pass 3: register allocation */ + /* Pass 4: branch dependencies */ + /* Pass 5: pre-alloc */ + /* Pass 6: optimize clean/dirty state */ + /* Pass 7: flag 32-bit registers */ + /* Pass 8: assembly */ + /* Pass 9: linker */ + /* Pass 10: garbage collection / free memory */ + + int i,j; + int done=0; + unsigned int type,op,op2; + + //DebugMessage(M64MSG_VERBOSE, "addr = %x source = %x %x", addr,source,source[0]); + + /* Pass 1 disassembly */ + + for(i=0;!done;i++) { + bt[i]=0;likely[i]=0;ooo[i]=0;op2=0; + minimum_free_regs[i]=0; + opcode[i]=op=source[i]>>26; + switch(op) + { + case 0x00: strcpy(insn[i],"special"); type=NI; + op2=source[i]&0x3f; + switch(op2) + { + case 0x00: strcpy(insn[i],"SLL"); type=SHIFTIMM; break; + case 0x02: strcpy(insn[i],"SRL"); type=SHIFTIMM; break; + case 0x03: strcpy(insn[i],"SRA"); type=SHIFTIMM; break; + case 0x04: strcpy(insn[i],"SLLV"); type=SHIFT; break; + case 0x06: strcpy(insn[i],"SRLV"); type=SHIFT; break; + case 0x07: strcpy(insn[i],"SRAV"); type=SHIFT; break; + case 0x08: strcpy(insn[i],"JR"); type=RJUMP; break; + case 0x09: strcpy(insn[i],"JALR"); type=RJUMP; break; + case 0x0C: strcpy(insn[i],"SYSCALL"); type=SYSCALL; break; + case 0x0D: strcpy(insn[i],"BREAK"); type=OTHER; break; + case 0x0F: strcpy(insn[i],"SYNC"); type=OTHER; break; + case 0x10: strcpy(insn[i],"MFHI"); type=MOV; break; + case 0x11: strcpy(insn[i],"MTHI"); type=MOV; break; + case 0x12: strcpy(insn[i],"MFLO"); type=MOV; break; + case 0x13: strcpy(insn[i],"MTLO"); type=MOV; break; + case 0x14: strcpy(insn[i],"DSLLV"); type=SHIFT; break; + case 0x16: strcpy(insn[i],"DSRLV"); type=SHIFT; break; + case 0x17: strcpy(insn[i],"DSRAV"); type=SHIFT; break; + case 0x18: strcpy(insn[i],"MULT"); type=MULTDIV; break; + case 0x19: strcpy(insn[i],"MULTU"); type=MULTDIV; break; + case 0x1A: strcpy(insn[i],"DIV"); type=MULTDIV; break; + case 0x1B: strcpy(insn[i],"DIVU"); type=MULTDIV; break; + case 0x1C: strcpy(insn[i],"DMULT"); type=MULTDIV; break; + case 0x1D: strcpy(insn[i],"DMULTU"); type=MULTDIV; break; + case 0x1E: strcpy(insn[i],"DDIV"); type=MULTDIV; break; + case 0x1F: strcpy(insn[i],"DDIVU"); type=MULTDIV; break; + case 0x20: strcpy(insn[i],"ADD"); type=ALU; break; + case 0x21: strcpy(insn[i],"ADDU"); type=ALU; break; + case 0x22: strcpy(insn[i],"SUB"); type=ALU; break; + case 0x23: strcpy(insn[i],"SUBU"); type=ALU; break; + case 0x24: strcpy(insn[i],"AND"); type=ALU; break; + case 0x25: strcpy(insn[i],"OR"); type=ALU; break; + case 0x26: strcpy(insn[i],"XOR"); type=ALU; break; + case 0x27: strcpy(insn[i],"NOR"); type=ALU; break; + case 0x2A: strcpy(insn[i],"SLT"); type=ALU; break; + case 0x2B: strcpy(insn[i],"SLTU"); type=ALU; break; + case 0x2C: strcpy(insn[i],"DADD"); type=ALU; break; + case 0x2D: strcpy(insn[i],"DADDU"); type=ALU; break; + case 0x2E: strcpy(insn[i],"DSUB"); type=ALU; break; + case 0x2F: strcpy(insn[i],"DSUBU"); type=ALU; break; + case 0x30: strcpy(insn[i],"TGE"); type=NI; break; + case 0x31: strcpy(insn[i],"TGEU"); type=NI; break; + case 0x32: strcpy(insn[i],"TLT"); type=NI; break; + case 0x33: strcpy(insn[i],"TLTU"); type=NI; break; + case 0x34: strcpy(insn[i],"TEQ"); type=NI; break; + case 0x36: strcpy(insn[i],"TNE"); type=NI; break; + case 0x38: strcpy(insn[i],"DSLL"); type=SHIFTIMM; break; + case 0x3A: strcpy(insn[i],"DSRL"); type=SHIFTIMM; break; + case 0x3B: strcpy(insn[i],"DSRA"); type=SHIFTIMM; break; + case 0x3C: strcpy(insn[i],"DSLL32"); type=SHIFTIMM; break; + case 0x3E: strcpy(insn[i],"DSRL32"); type=SHIFTIMM; break; + case 0x3F: strcpy(insn[i],"DSRA32"); type=SHIFTIMM; break; + } + break; + case 0x01: strcpy(insn[i],"regimm"); type=NI; + op2=(source[i]>>16)&0x1f; + switch(op2) + { + case 0x00: strcpy(insn[i],"BLTZ"); type=SJUMP; break; + case 0x01: strcpy(insn[i],"BGEZ"); type=SJUMP; break; + case 0x02: strcpy(insn[i],"BLTZL"); type=SJUMP; break; + case 0x03: strcpy(insn[i],"BGEZL"); type=SJUMP; break; + case 0x08: strcpy(insn[i],"TGEI"); type=NI; break; + case 0x09: strcpy(insn[i],"TGEIU"); type=NI; break; + case 0x0A: strcpy(insn[i],"TLTI"); type=NI; break; + case 0x0B: strcpy(insn[i],"TLTIU"); type=NI; break; + case 0x0C: strcpy(insn[i],"TEQI"); type=NI; break; + case 0x0E: strcpy(insn[i],"TNEI"); type=NI; break; + case 0x10: strcpy(insn[i],"BLTZAL"); type=SJUMP; break; + case 0x11: strcpy(insn[i],"BGEZAL"); type=SJUMP; break; + case 0x12: strcpy(insn[i],"BLTZALL"); type=SJUMP; break; + case 0x13: strcpy(insn[i],"BGEZALL"); type=SJUMP; break; + } + break; + case 0x02: strcpy(insn[i],"J"); type=UJUMP; break; + case 0x03: strcpy(insn[i],"JAL"); type=UJUMP; break; + case 0x04: strcpy(insn[i],"BEQ"); type=CJUMP; break; + case 0x05: strcpy(insn[i],"BNE"); type=CJUMP; break; + case 0x06: strcpy(insn[i],"BLEZ"); type=CJUMP; break; + case 0x07: strcpy(insn[i],"BGTZ"); type=CJUMP; break; + case 0x08: strcpy(insn[i],"ADDI"); type=IMM16; break; + case 0x09: strcpy(insn[i],"ADDIU"); type=IMM16; break; + case 0x0A: strcpy(insn[i],"SLTI"); type=IMM16; break; + case 0x0B: strcpy(insn[i],"SLTIU"); type=IMM16; break; + case 0x0C: strcpy(insn[i],"ANDI"); type=IMM16; break; + case 0x0D: strcpy(insn[i],"ORI"); type=IMM16; break; + case 0x0E: strcpy(insn[i],"XORI"); type=IMM16; break; + case 0x0F: strcpy(insn[i],"LUI"); type=IMM16; break; + case 0x10: strcpy(insn[i],"cop0"); type=NI; + op2=(source[i]>>21)&0x1f; + switch(op2) + { + case 0x00: strcpy(insn[i],"MFC0"); type=COP0; break; + case 0x04: strcpy(insn[i],"MTC0"); type=COP0; break; + case 0x10: strcpy(insn[i],"tlb"); type=NI; + switch(source[i]&0x3f) + { + case 0x01: strcpy(insn[i],"TLBR"); type=COP0; break; + case 0x02: strcpy(insn[i],"TLBWI"); type=COP0; break; + case 0x06: strcpy(insn[i],"TLBWR"); type=COP0; break; + case 0x08: strcpy(insn[i],"TLBP"); type=COP0; break; + case 0x18: strcpy(insn[i],"ERET"); type=COP0; break; + } + } + break; + case 0x11: strcpy(insn[i],"cop1"); type=NI; + op2=(source[i]>>21)&0x1f; + switch(op2) + { + case 0x00: strcpy(insn[i],"MFC1"); type=COP1; break; + case 0x01: strcpy(insn[i],"DMFC1"); type=COP1; break; + case 0x02: strcpy(insn[i],"CFC1"); type=COP1; break; + case 0x04: strcpy(insn[i],"MTC1"); type=COP1; break; + case 0x05: strcpy(insn[i],"DMTC1"); type=COP1; break; + case 0x06: strcpy(insn[i],"CTC1"); type=COP1; break; + case 0x08: strcpy(insn[i],"BC1"); type=FJUMP; + switch((source[i]>>16)&0x3) + { + case 0x00: strcpy(insn[i],"BC1F"); break; + case 0x01: strcpy(insn[i],"BC1T"); break; + case 0x02: strcpy(insn[i],"BC1FL"); break; + case 0x03: strcpy(insn[i],"BC1TL"); break; + } + break; + case 0x10: strcpy(insn[i],"C1.S"); type=NI; + switch(source[i]&0x3f) + { + case 0x00: strcpy(insn[i],"ADD.S"); type=FLOAT; break; + case 0x01: strcpy(insn[i],"SUB.S"); type=FLOAT; break; + case 0x02: strcpy(insn[i],"MUL.S"); type=FLOAT; break; + case 0x03: strcpy(insn[i],"DIV.S"); type=FLOAT; break; + case 0x04: strcpy(insn[i],"SQRT.S"); type=FLOAT; break; + case 0x05: strcpy(insn[i],"ABS.S"); type=FLOAT; break; + case 0x06: strcpy(insn[i],"MOV.S"); type=FLOAT; break; + case 0x07: strcpy(insn[i],"NEG.S"); type=FLOAT; break; + case 0x08: strcpy(insn[i],"ROUND.L.S"); type=FCONV; break; + case 0x09: strcpy(insn[i],"TRUNC.L.S"); type=FCONV; break; + case 0x0A: strcpy(insn[i],"CEIL.L.S"); type=FCONV; break; + case 0x0B: strcpy(insn[i],"FLOOR.L.S"); type=FCONV; break; + case 0x0C: strcpy(insn[i],"ROUND.W.S"); type=FCONV; break; + case 0x0D: strcpy(insn[i],"TRUNC.W.S"); type=FCONV; break; + case 0x0E: strcpy(insn[i],"CEIL.W.S"); type=FCONV; break; + case 0x0F: strcpy(insn[i],"FLOOR.W.S"); type=FCONV; break; + case 0x21: strcpy(insn[i],"CVT.D.S"); type=FCONV; break; + case 0x24: strcpy(insn[i],"CVT.W.S"); type=FCONV; break; + case 0x25: strcpy(insn[i],"CVT.L.S"); type=FCONV; break; + case 0x30: strcpy(insn[i],"C.F.S"); type=FCOMP; break; + case 0x31: strcpy(insn[i],"C.UN.S"); type=FCOMP; break; + case 0x32: strcpy(insn[i],"C.EQ.S"); type=FCOMP; break; + case 0x33: strcpy(insn[i],"C.UEQ.S"); type=FCOMP; break; + case 0x34: strcpy(insn[i],"C.OLT.S"); type=FCOMP; break; + case 0x35: strcpy(insn[i],"C.ULT.S"); type=FCOMP; break; + case 0x36: strcpy(insn[i],"C.OLE.S"); type=FCOMP; break; + case 0x37: strcpy(insn[i],"C.ULE.S"); type=FCOMP; break; + case 0x38: strcpy(insn[i],"C.SF.S"); type=FCOMP; break; + case 0x39: strcpy(insn[i],"C.NGLE.S"); type=FCOMP; break; + case 0x3A: strcpy(insn[i],"C.SEQ.S"); type=FCOMP; break; + case 0x3B: strcpy(insn[i],"C.NGL.S"); type=FCOMP; break; + case 0x3C: strcpy(insn[i],"C.LT.S"); type=FCOMP; break; + case 0x3D: strcpy(insn[i],"C.NGE.S"); type=FCOMP; break; + case 0x3E: strcpy(insn[i],"C.LE.S"); type=FCOMP; break; + case 0x3F: strcpy(insn[i],"C.NGT.S"); type=FCOMP; break; + } + break; + case 0x11: strcpy(insn[i],"C1.D"); type=NI; + switch(source[i]&0x3f) + { + case 0x00: strcpy(insn[i],"ADD.D"); type=FLOAT; break; + case 0x01: strcpy(insn[i],"SUB.D"); type=FLOAT; break; + case 0x02: strcpy(insn[i],"MUL.D"); type=FLOAT; break; + case 0x03: strcpy(insn[i],"DIV.D"); type=FLOAT; break; + case 0x04: strcpy(insn[i],"SQRT.D"); type=FLOAT; break; + case 0x05: strcpy(insn[i],"ABS.D"); type=FLOAT; break; + case 0x06: strcpy(insn[i],"MOV.D"); type=FLOAT; break; + case 0x07: strcpy(insn[i],"NEG.D"); type=FLOAT; break; + case 0x08: strcpy(insn[i],"ROUND.L.D"); type=FCONV; break; + case 0x09: strcpy(insn[i],"TRUNC.L.D"); type=FCONV; break; + case 0x0A: strcpy(insn[i],"CEIL.L.D"); type=FCONV; break; + case 0x0B: strcpy(insn[i],"FLOOR.L.D"); type=FCONV; break; + case 0x0C: strcpy(insn[i],"ROUND.W.D"); type=FCONV; break; + case 0x0D: strcpy(insn[i],"TRUNC.W.D"); type=FCONV; break; + case 0x0E: strcpy(insn[i],"CEIL.W.D"); type=FCONV; break; + case 0x0F: strcpy(insn[i],"FLOOR.W.D"); type=FCONV; break; + case 0x20: strcpy(insn[i],"CVT.S.D"); type=FCONV; break; + case 0x24: strcpy(insn[i],"CVT.W.D"); type=FCONV; break; + case 0x25: strcpy(insn[i],"CVT.L.D"); type=FCONV; break; + case 0x30: strcpy(insn[i],"C.F.D"); type=FCOMP; break; + case 0x31: strcpy(insn[i],"C.UN.D"); type=FCOMP; break; + case 0x32: strcpy(insn[i],"C.EQ.D"); type=FCOMP; break; + case 0x33: strcpy(insn[i],"C.UEQ.D"); type=FCOMP; break; + case 0x34: strcpy(insn[i],"C.OLT.D"); type=FCOMP; break; + case 0x35: strcpy(insn[i],"C.ULT.D"); type=FCOMP; break; + case 0x36: strcpy(insn[i],"C.OLE.D"); type=FCOMP; break; + case 0x37: strcpy(insn[i],"C.ULE.D"); type=FCOMP; break; + case 0x38: strcpy(insn[i],"C.SF.D"); type=FCOMP; break; + case 0x39: strcpy(insn[i],"C.NGLE.D"); type=FCOMP; break; + case 0x3A: strcpy(insn[i],"C.SEQ.D"); type=FCOMP; break; + case 0x3B: strcpy(insn[i],"C.NGL.D"); type=FCOMP; break; + case 0x3C: strcpy(insn[i],"C.LT.D"); type=FCOMP; break; + case 0x3D: strcpy(insn[i],"C.NGE.D"); type=FCOMP; break; + case 0x3E: strcpy(insn[i],"C.LE.D"); type=FCOMP; break; + case 0x3F: strcpy(insn[i],"C.NGT.D"); type=FCOMP; break; + } + break; + case 0x14: strcpy(insn[i],"C1.W"); type=NI; + switch(source[i]&0x3f) + { + case 0x20: strcpy(insn[i],"CVT.S.W"); type=FCONV; break; + case 0x21: strcpy(insn[i],"CVT.D.W"); type=FCONV; break; + } + break; + case 0x15: strcpy(insn[i],"C1.L"); type=NI; + switch(source[i]&0x3f) + { + case 0x20: strcpy(insn[i],"CVT.S.L"); type=FCONV; break; + case 0x21: strcpy(insn[i],"CVT.D.L"); type=FCONV; break; + } + break; + } + break; + case 0x14: strcpy(insn[i],"BEQL"); type=CJUMP; break; + case 0x15: strcpy(insn[i],"BNEL"); type=CJUMP; break; + case 0x16: strcpy(insn[i],"BLEZL"); type=CJUMP; break; + case 0x17: strcpy(insn[i],"BGTZL"); type=CJUMP; break; + case 0x18: strcpy(insn[i],"DADDI"); type=IMM16; break; + case 0x19: strcpy(insn[i],"DADDIU"); type=IMM16; break; + case 0x1A: strcpy(insn[i],"LDL"); type=LOADLR; break; + case 0x1B: strcpy(insn[i],"LDR"); type=LOADLR; break; + case 0x20: strcpy(insn[i],"LB"); type=LOAD; break; + case 0x21: strcpy(insn[i],"LH"); type=LOAD; break; + case 0x22: strcpy(insn[i],"LWL"); type=LOADLR; break; + case 0x23: strcpy(insn[i],"LW"); type=LOAD; break; + case 0x24: strcpy(insn[i],"LBU"); type=LOAD; break; + case 0x25: strcpy(insn[i],"LHU"); type=LOAD; break; + case 0x26: strcpy(insn[i],"LWR"); type=LOADLR; break; + case 0x27: strcpy(insn[i],"LWU"); type=LOAD; break; + case 0x28: strcpy(insn[i],"SB"); type=STORE; break; + case 0x29: strcpy(insn[i],"SH"); type=STORE; break; + case 0x2A: strcpy(insn[i],"SWL"); type=STORELR; break; + case 0x2B: strcpy(insn[i],"SW"); type=STORE; break; + case 0x2C: strcpy(insn[i],"SDL"); type=STORELR; break; + case 0x2D: strcpy(insn[i],"SDR"); type=STORELR; break; + case 0x2E: strcpy(insn[i],"SWR"); type=STORELR; break; + case 0x2F: strcpy(insn[i],"CACHE"); type=NOP; break; + case 0x30: strcpy(insn[i],"LL"); type=NI; break; + case 0x31: strcpy(insn[i],"LWC1"); type=C1LS; break; + case 0x34: strcpy(insn[i],"LLD"); type=NI; break; + case 0x35: strcpy(insn[i],"LDC1"); type=C1LS; break; + case 0x37: strcpy(insn[i],"LD"); type=LOAD; break; + case 0x38: strcpy(insn[i],"SC"); type=NI; break; + case 0x39: strcpy(insn[i],"SWC1"); type=C1LS; break; + case 0x3C: strcpy(insn[i],"SCD"); type=NI; break; + case 0x3D: strcpy(insn[i],"SDC1"); type=C1LS; break; + case 0x3F: strcpy(insn[i],"SD"); type=STORE; break; + default: strcpy(insn[i],"???"); type=NI; break; + } + itype[i]=type; + opcode2[i]=op2; + /* Get registers/immediates */ + lt1[i]=0; + us1[i]=0; + us2[i]=0; + dep1[i]=0; + dep2[i]=0; + switch(type) { + case LOAD: + rs1[i]=(source[i]>>21)&0x1f; + rs2[i]=0; + rt1[i]=(source[i]>>16)&0x1f; + rt2[i]=0; + imm[i]=(short)source[i]; + break; + case STORE: + case STORELR: + rs1[i]=(source[i]>>21)&0x1f; + rs2[i]=(source[i]>>16)&0x1f; + rt1[i]=0; + rt2[i]=0; + imm[i]=(short)source[i]; + if(op==0x2c||op==0x2d||op==0x3f) us1[i]=rs2[i]; // 64-bit SDL/SDR/SD + break; + case LOADLR: + // LWL/LWR only load part of the register, + // therefore the target register must be treated as a source too + rs1[i]=(source[i]>>21)&0x1f; + rs2[i]=(source[i]>>16)&0x1f; + rt1[i]=(source[i]>>16)&0x1f; + rt2[i]=0; + imm[i]=(short)source[i]; + if(op==0x1a||op==0x1b) us1[i]=rs2[i]; // LDR/LDL + if(op==0x26) dep1[i]=rt1[i]; // LWR + break; + case IMM16: + if (op==0x0f) rs1[i]=0; // LUI instruction has no source register + else rs1[i]=(source[i]>>21)&0x1f; + rs2[i]=0; + rt1[i]=(source[i]>>16)&0x1f; + rt2[i]=0; + if(op>=0x0c&&op<=0x0e) { // ANDI/ORI/XORI + imm[i]=(unsigned short)source[i]; + }else{ + imm[i]=(short)source[i]; + } + if(op==0x18||op==0x19) us1[i]=rs1[i]; // DADDI/DADDIU + if(op==0x0a||op==0x0b) us1[i]=rs1[i]; // SLTI/SLTIU + if(op==0x0d||op==0x0e) dep1[i]=rs1[i]; // ORI/XORI + break; + case UJUMP: + rs1[i]=0; + rs2[i]=0; + rt1[i]=0; + rt2[i]=0; + // The JAL instruction writes to r31. + if (op&1) { + rt1[i]=31; + } + rs2[i]=CCREG; + break; + case RJUMP: + rs1[i]=(source[i]>>21)&0x1f; + rs2[i]=0; + rt1[i]=0; + rt2[i]=0; + // The JALR instruction writes to rd. + if (op2&1) { + rt1[i]=(source[i]>>11)&0x1f; + } + rs2[i]=CCREG; + break; + case CJUMP: + rs1[i]=(source[i]>>21)&0x1f; + rs2[i]=(source[i]>>16)&0x1f; + rt1[i]=0; + rt2[i]=0; + if(op&2) { // BGTZ/BLEZ + rs2[i]=0; + } + us1[i]=rs1[i]; + us2[i]=rs2[i]; + likely[i]=op>>4; + break; + case SJUMP: + rs1[i]=(source[i]>>21)&0x1f; + rs2[i]=CCREG; + rt1[i]=0; + rt2[i]=0; + us1[i]=rs1[i]; + if(op2&0x10) { // BxxAL + rt1[i]=31; + // NOTE: If the branch is not taken, r31 is still overwritten + } + likely[i]=(op2&2)>>1; + break; + case FJUMP: + rs1[i]=FSREG; + rs2[i]=CSREG; + rt1[i]=0; + rt2[i]=0; + likely[i]=((source[i])>>17)&1; + break; + case ALU: + rs1[i]=(source[i]>>21)&0x1f; // source + rs2[i]=(source[i]>>16)&0x1f; // subtract amount + rt1[i]=(source[i]>>11)&0x1f; // destination + rt2[i]=0; + if(op2==0x2a||op2==0x2b) { // SLT/SLTU + us1[i]=rs1[i];us2[i]=rs2[i]; + } + else if(op2>=0x24&&op2<=0x27) { // AND/OR/XOR/NOR + dep1[i]=rs1[i];dep2[i]=rs2[i]; + } + else if(op2>=0x2c&&op2<=0x2f) { // DADD/DSUB + dep1[i]=rs1[i];dep2[i]=rs2[i]; + } + break; + case MULTDIV: + rs1[i]=(source[i]>>21)&0x1f; // source + rs2[i]=(source[i]>>16)&0x1f; // divisor + rt1[i]=HIREG; + rt2[i]=LOREG; + if (op2>=0x1c&&op2<=0x1f) { // DMULT/DMULTU/DDIV/DDIVU + us1[i]=rs1[i];us2[i]=rs2[i]; + } + break; + case MOV: + rs1[i]=0; + rs2[i]=0; + rt1[i]=0; + rt2[i]=0; + if(op2==0x10) rs1[i]=HIREG; // MFHI + if(op2==0x11) rt1[i]=HIREG; // MTHI + if(op2==0x12) rs1[i]=LOREG; // MFLO + if(op2==0x13) rt1[i]=LOREG; // MTLO + if((op2&0x1d)==0x10) rt1[i]=(source[i]>>11)&0x1f; // MFxx + if((op2&0x1d)==0x11) rs1[i]=(source[i]>>21)&0x1f; // MTxx + dep1[i]=rs1[i]; + break; + case SHIFT: + rs1[i]=(source[i]>>16)&0x1f; // target of shift + rs2[i]=(source[i]>>21)&0x1f; // shift amount + rt1[i]=(source[i]>>11)&0x1f; // destination + rt2[i]=0; + // DSLLV/DSRLV/DSRAV are 64-bit + if(op2>=0x14&&op2<=0x17) us1[i]=rs1[i]; + break; + case SHIFTIMM: + rs1[i]=(source[i]>>16)&0x1f; + rs2[i]=0; + rt1[i]=(source[i]>>11)&0x1f; + rt2[i]=0; + imm[i]=(source[i]>>6)&0x1f; + // DSxx32 instructions + if(op2>=0x3c) imm[i]|=0x20; + // DSLL/DSRL/DSRA/DSRA32/DSRL32 but not DSLL32 require 64-bit source + if(op2>=0x38&&op2!=0x3c) us1[i]=rs1[i]; + break; + case COP0: + rs1[i]=0; + rs2[i]=0; + rt1[i]=0; + rt2[i]=0; + if(op2==0) rt1[i]=(source[i]>>16)&0x1F; // MFC0 + if(op2==4) rs1[i]=(source[i]>>16)&0x1F; // MTC0 + if(op2==4&&((source[i]>>11)&0x1f)==12) rt2[i]=CSREG; // Status + if(op2==16) if((source[i]&0x3f)==0x18) rs2[i]=CCREG; // ERET + break; + case COP1: + rs1[i]=0; + rs2[i]=0; + rt1[i]=0; + rt2[i]=0; + if(op2<3) rt1[i]=(source[i]>>16)&0x1F; // MFC1/DMFC1/CFC1 + if(op2>3) rs1[i]=(source[i]>>16)&0x1F; // MTC1/DMTC1/CTC1 + if(op2==5) us1[i]=rs1[i]; // DMTC1 + rs2[i]=CSREG; + break; + case C1LS: + rs1[i]=(source[i]>>21)&0x1F; + rs2[i]=CSREG; + rt1[i]=0; + rt2[i]=0; + imm[i]=(short)source[i]; + break; + case FLOAT: + case FCONV: + rs1[i]=0; + rs2[i]=CSREG; + rt1[i]=0; + rt2[i]=0; + break; + case FCOMP: + rs1[i]=FSREG; + rs2[i]=CSREG; + rt1[i]=FSREG; + rt2[i]=0; + break; + case SYSCALL: + rs1[i]=CCREG; + rs2[i]=0; + rt1[i]=0; + rt2[i]=0; + break; + default: + rs1[i]=0; + rs2[i]=0; + rt1[i]=0; + rt2[i]=0; + } + /* Calculate branch target addresses */ + if(type==UJUMP) + ba[i]=((start+i*4+4)&0xF0000000)|(((unsigned int)source[i]<<6)>>4); + else if(type==CJUMP&&rs1[i]==rs2[i]&&(op&1)) + ba[i]=start+i*4+8; // Ignore never taken branch + else if(type==SJUMP&&rs1[i]==0&&!(op2&1)) + ba[i]=start+i*4+8; // Ignore never taken branch + else if(type==CJUMP||type==SJUMP||type==FJUMP) + ba[i]=start+i*4+4+((signed int)((unsigned int)source[i]<<16)>>14); + else ba[i]=-1; + /* Is this the end of the block? */ + if(i>0&&(itype[i-1]==UJUMP||itype[i-1]==RJUMP||(source[i-1]>>16)==0x1000)) { + if(rt1[i-1]==0) { // Continue past subroutine call (JAL) + done=1; + // Does the block continue due to a branch? + for(j=i-1;j>=0;j--) + { + if(ba[j]==start+i*4) done=j=0; // Branch into delay slot + if(ba[j]==start+i*4+4) done=j=0; + if(ba[j]==start+i*4+8) done=j=0; + } + } + else { + if(stop_after_jal) done=1; + // Stop on BREAK + if((source[i+1]&0xfc00003f)==0x0d) done=1; + } + // Don't recompile stuff that's already compiled + if(check_addr(start+i*4+4)) done=1; + // Don't get too close to the limit + if(i>MAXBLOCK/2) done=1; + } + if(i>0&&itype[i-1]==SYSCALL&&stop_after_jal) done=1; + assert(i0); + + /* Pass 2 - Register dependencies and branch targets */ + + unneeded_registers(0,slen-1,0); + + /* Pass 3 - Register allocation */ + + struct regstat current; // Current register allocations/status + current.is32=1; + current.dirty=0; + current.u=unneeded_reg[0]; + current.uu=unneeded_reg_upper[0]; + clear_all_regs(current.regmap); + alloc_reg(¤t,0,CCREG); + dirty_reg(¤t,CCREG); + current.isconst=0; + current.wasconst=0; + int ds=0; + int cc=0; + int hr; + + provisional_32bit(); + + if((u_int)addr&1) { + // First instruction is delay slot + cc=-1; + bt[1]=1; + ds=1; + unneeded_reg[0]=1; + unneeded_reg_upper[0]=1; + current.regmap[HOST_BTREG]=BTREG; + } + + for(i=0;i1) + { + if((opcode[i-2]&0x2f)==0x05) // BNE/BNEL + { + if(rs1[i-2]==0||rs2[i-2]==0) + { + if(rs1[i-2]) { + current.is32|=1LL<=0) current.regmap[hr]=-1; + } + if(rs2[i-2]) { + current.is32|=1LL<=0) current.regmap[hr]=-1; + } + } + } + } + // If something jumps here with 64-bit values + // then promote those registers to 64 bits + if(bt[i]) + { + uint64_t temp_is32=current.is32; + for(j=i-1;j>=0;j--) + { + if(ba[j]==start+i*4) + temp_is32&=branch_regs[j].is32; + } + for(j=i;j0&&r<64) + { + if((current.dirty>>hr)&((current.is32&~temp_is32)>>r)&1) { + temp_is32|=1LL<=0;j--) + { + if(ba[j]==start+i*4+4) + temp_is32&=branch_regs[j].is32; + } + for(j=i;j0) + { + if((current.dirty>>hr)&((current.is32&~temp_is32)>>(r&63))&1) { + if(itype[i]!=UJUMP&&itype[i]!=CJUMP&&itype[i]!=SJUMP&&itype[i]!=RJUMP&&itype[i]!=FJUMP) + { + if(rs1[i]!=(r&63)&&rs2[i]!=(r&63)) + { + //DebugMessage(M64MSG_VERBOSE, "dump %d/r%d",hr,r); + current.regmap[hr]=-1; + if(get_reg(current.regmap,r|64)>=0) + current.regmap[get_reg(current.regmap,r|64)]=-1; + } + } + } + } + } + } + } + else if(i>16)!=0x1000&&(itype[i]==CJUMP||itype[i]==SJUMP||itype[i]==FJUMP)) + { + uint64_t temp_is32=current.is32; + for(j=i-1;j>=0;j--) + { + if(ba[j]==start+i*4+8) + temp_is32&=branch_regs[j].is32; + } + for(j=i;j0) + { + if((current.dirty>>hr)&((current.is32&~temp_is32)>>(r&63))&1) { + if(rs1[i]!=(r&63)&&rs2[i]!=(r&63)&&rs1[i+1]!=(r&63)&&rs2[i+1]!=(r&63)) + { + //DebugMessage(M64MSG_VERBOSE, "dump %d/r%d",hr,r); + current.regmap[hr]=-1; + if(get_reg(current.regmap,r|64)>=0) + current.regmap[get_reg(current.regmap,r|64)]=-1; + } + } + } + } + } + } + #endif + if(itype[i]!=UJUMP&&itype[i]!=CJUMP&&itype[i]!=SJUMP&&itype[i]!=RJUMP&&itype[i]!=FJUMP) { + if(i+1>rt1[i])&1) current.uu&=~((1LL<>rt1[i+1])&1) current.uu&=~((1LL<>rt1[i])&1) current.uu&=~((1LL<=0) { + if(r!=regmap_pre[i][hr]) { + regs[i].regmap_entry[hr]=-1; + } + else + { + if(r<64){ + if((current.u>>r)&1) { + regs[i].regmap_entry[hr]=-1; + regs[i].regmap[hr]=-1; + //Don't clear regs in the delay slot as the branch might need them + //current.regmap[hr]=-1; + }else + regs[i].regmap_entry[hr]=r; + } + else { + if((current.uu>>(r&63))&1) { + regs[i].regmap_entry[hr]=-1; + regs[i].regmap[hr]=-1; + //Don't clear regs in the delay slot as the branch might need them + //current.regmap[hr]=-1; + }else + regs[i].regmap_entry[hr]=r; + } + } + } else { + // First instruction expects CCREG to be allocated + if(i==0&&hr==HOST_CCREG) + regs[i].regmap_entry[hr]=CCREG; + else + regs[i].regmap_entry[hr]=-1; + } + } + } + else { // Not delay slot + switch(itype[i]) { + case UJUMP: + //current.isconst=0; // DEBUG + //current.wasconst=0; // DEBUG + //regs[i].wasconst=0; // DEBUG + clear_const(¤t,rt1[i]); + alloc_cc(¤t,i); + dirty_reg(¤t,CCREG); + if (rt1[i]==31) { + alloc_reg(¤t,i,31); + dirty_reg(¤t,31); + assert(rs1[i+1]!=31&&rs2[i+1]!=31); + #ifdef REG_PREFETCH + alloc_reg(¤t,i,PTEMP); + #endif + //current.is32|=1LL<>rs1[i])&(current.is32>>rs2[i])&1)) + { + if(rs1[i]) alloc_reg64(¤t,i,rs1[i]); + if(rs2[i]) alloc_reg64(¤t,i,rs2[i]); + } + if((rs1[i]&&(rs1[i]==rt1[i+1]||rs1[i]==rt2[i+1]))|| + (rs2[i]&&(rs2[i]==rt1[i+1]||rs2[i]==rt2[i+1]))) { + // The delay slot overwrites one of our conditions. + // Allocate the branch condition registers instead. + current.isconst=0; + current.wasconst=0; + regs[i].wasconst=0; + if(rs1[i]) alloc_reg(¤t,i,rs1[i]); + if(rs2[i]) alloc_reg(¤t,i,rs2[i]); + if(!((current.is32>>rs1[i])&(current.is32>>rs2[i])&1)) + { + if(rs1[i]) alloc_reg64(¤t,i,rs1[i]); + if(rs2[i]) alloc_reg64(¤t,i,rs2[i]); + } + } + else + { + ooo[i]=1; + delayslot_alloc(¤t,i+1); + } + } + else + if((opcode[i]&0x3E)==6) // BLEZ/BGTZ + { + alloc_cc(¤t,i); + dirty_reg(¤t,CCREG); + alloc_reg(¤t,i,rs1[i]); + if(!(current.is32>>rs1[i]&1)) + { + alloc_reg64(¤t,i,rs1[i]); + } + if(rs1[i]&&(rs1[i]==rt1[i+1]||rs1[i]==rt2[i+1])) { + // The delay slot overwrites one of our conditions. + // Allocate the branch condition registers instead. + current.isconst=0; + current.wasconst=0; + regs[i].wasconst=0; + if(rs1[i]) alloc_reg(¤t,i,rs1[i]); + if(!((current.is32>>rs1[i])&1)) + { + if(rs1[i]) alloc_reg64(¤t,i,rs1[i]); + } + } + else + { + ooo[i]=1; + delayslot_alloc(¤t,i+1); + } + } + else + // Don't alloc the delay slot yet because we might not execute it + if((opcode[i]&0x3E)==0x14) // BEQL/BNEL + { + current.isconst=0; + current.wasconst=0; + regs[i].wasconst=0; + alloc_cc(¤t,i); + dirty_reg(¤t,CCREG); + alloc_reg(¤t,i,rs1[i]); + alloc_reg(¤t,i,rs2[i]); + if(!((current.is32>>rs1[i])&(current.is32>>rs2[i])&1)) + { + alloc_reg64(¤t,i,rs1[i]); + alloc_reg64(¤t,i,rs2[i]); + } + } + else + if((opcode[i]&0x3E)==0x16) // BLEZL/BGTZL + { + current.isconst=0; + current.wasconst=0; + regs[i].wasconst=0; + alloc_cc(¤t,i); + dirty_reg(¤t,CCREG); + alloc_reg(¤t,i,rs1[i]); + if(!(current.is32>>rs1[i]&1)) + { + alloc_reg64(¤t,i,rs1[i]); + } + } + ds=1; + //current.isconst=0; + break; + case SJUMP: + //current.isconst=0; + //current.wasconst=0; + //regs[i].wasconst=0; + clear_const(¤t,rs1[i]); + clear_const(¤t,rt1[i]); + //if((opcode2[i]&0x1E)==0x0) // BLTZ/BGEZ + if((opcode2[i]&0x0E)==0x0) // BLTZ/BGEZ + { + alloc_cc(¤t,i); + dirty_reg(¤t,CCREG); + alloc_reg(¤t,i,rs1[i]); + if(!(current.is32>>rs1[i]&1)) + { + alloc_reg64(¤t,i,rs1[i]); + } + if (rt1[i]==31) { // BLTZAL/BGEZAL + alloc_reg(¤t,i,31); + dirty_reg(¤t,31); + assert(rs1[i+1]!=31&&rs2[i+1]!=31); + //#ifdef REG_PREFETCH + //alloc_reg(¤t,i,PTEMP); + //#endif + //current.is32|=1LL<>rs1[i])&1)) + { + if(rs1[i]) alloc_reg64(¤t,i,rs1[i]); + } + } + else + { + ooo[i]=1; + delayslot_alloc(¤t,i+1); + } + } + else + // Don't alloc the delay slot yet because we might not execute it + if((opcode2[i]&0x1E)==0x2) // BLTZL/BGEZL + { + current.isconst=0; + current.wasconst=0; + regs[i].wasconst=0; + alloc_cc(¤t,i); + dirty_reg(¤t,CCREG); + alloc_reg(¤t,i,rs1[i]); + if(!(current.is32>>rs1[i]&1)) + { + alloc_reg64(¤t,i,rs1[i]); + } + } + ds=1; + //current.isconst=0; + break; + case FJUMP: + current.isconst=0; + current.wasconst=0; + regs[i].wasconst=0; + if(likely[i]==0) // BC1F/BC1T + { + // TODO: Theoretically we can run out of registers here on x86. + // The delay slot can allocate up to six, and we need to check + // CSREG before executing the delay slot. Possibly we can drop + // the cycle count and then reload it after checking that the + // FPU is in a usable state, or don't do out-of-order execution. + alloc_cc(¤t,i); + dirty_reg(¤t,CCREG); + alloc_reg(¤t,i,FSREG); + alloc_reg(¤t,i,CSREG); + if(itype[i+1]==FCOMP) { + // The delay slot overwrites the branch condition. + // Allocate the branch condition registers instead. + alloc_cc(¤t,i); + dirty_reg(¤t,CCREG); + alloc_reg(¤t,i,CSREG); + alloc_reg(¤t,i,FSREG); + } + else { + ooo[i]=1; + delayslot_alloc(¤t,i+1); + alloc_reg(¤t,i+1,CSREG); + } + } + else + // Don't alloc the delay slot yet because we might not execute it + if(likely[i]) // BC1FL/BC1TL + { + alloc_cc(¤t,i); + dirty_reg(¤t,CCREG); + alloc_reg(¤t,i,CSREG); + alloc_reg(¤t,i,FSREG); + } + ds=1; + current.isconst=0; + break; + case IMM16: + imm16_alloc(¤t,i); + break; + case LOAD: + case LOADLR: + load_alloc(¤t,i); + break; + case STORE: + case STORELR: + store_alloc(¤t,i); + break; + case ALU: + alu_alloc(¤t,i); + break; + case SHIFT: + shift_alloc(¤t,i); + break; + case MULTDIV: + multdiv_alloc(¤t,i); + break; + case SHIFTIMM: + shiftimm_alloc(¤t,i); + break; + case MOV: + mov_alloc(¤t,i); + break; + case COP0: + cop0_alloc(¤t,i); + break; + case COP1: + cop1_alloc(¤t,i); + break; + case C1LS: + c1ls_alloc(¤t,i); + break; + case FCONV: + fconv_alloc(¤t,i); + break; + case FLOAT: + float_alloc(¤t,i); + break; + case FCOMP: + fcomp_alloc(¤t,i); + break; + case SYSCALL: + syscall_alloc(¤t,i); + break; + case SPAN: + pagespan_alloc(¤t,i); + break; + } + + // Drop the upper half of registers that have become 32-bit + current.uu|=current.is32&((1LL<>rt1[i])&1) current.uu&=~((1LL<>rt1[i+1])&1) current.uu&=~((1LL<=0) { + if(r!=regmap_pre[i][hr]) { + // TODO: delay slot (?) + or=get_reg(regmap_pre[i],r); // Get old mapping for this register + if(or<0||(r&63)>=TEMPREG){ + regs[i].regmap_entry[hr]=-1; + } + else + { + // Just move it to a different register + regs[i].regmap_entry[hr]=r; + // If it was dirty before, it's still dirty + if((regs[i].wasdirty>>or)&1) dirty_reg(¤t,r&63); + } + } + else + { + // Unneeded + if(r==0){ + regs[i].regmap_entry[hr]=0; + } + else + if(r<64){ + if((current.u>>r)&1) { + regs[i].regmap_entry[hr]=-1; + //regs[i].regmap[hr]=-1; + current.regmap[hr]=-1; + }else + regs[i].regmap_entry[hr]=r; + } + else { + if((current.uu>>(r&63))&1) { + regs[i].regmap_entry[hr]=-1; + //regs[i].regmap[hr]=-1; + current.regmap[hr]=-1; + }else + regs[i].regmap_entry[hr]=r; + } + } + } else { + // Branches expect CCREG to be allocated at the target + if(regmap_pre[i][hr]==CCREG) + regs[i].regmap_entry[hr]=CCREG; + else + regs[i].regmap_entry[hr]=-1; + } + } + memcpy(regs[i].regmap,current.regmap,sizeof(current.regmap)); + } + /* Branch post-alloc */ + if(i>0) + { + current.was32=current.is32; + current.wasdirty=current.dirty; + switch(itype[i-1]) { + case UJUMP: + memcpy(&branch_regs[i-1],¤t,sizeof(current)); + branch_regs[i-1].isconst=0; + branch_regs[i-1].wasconst=0; + branch_regs[i-1].u=branch_unneeded_reg[i-1]&~((1LL<>rt1[i])&1) current.uu&=~((1LL<>rs1[i-1])&(current.is32>>rs2[i-1])&1)) + { + if(rs1[i-1]) alloc_reg64(¤t,i-1,rs1[i-1]); + if(rs2[i-1]) alloc_reg64(¤t,i-1,rs2[i-1]); + } + } + memcpy(&branch_regs[i-1],¤t,sizeof(current)); + branch_regs[i-1].isconst=0; + branch_regs[i-1].wasconst=0; + memcpy(&branch_regs[i-1].regmap_entry,¤t.regmap,sizeof(current.regmap)); + memcpy(constmap[i],constmap[i-1],sizeof(current.constmap)); + } + else + if((opcode[i-1]&0x3E)==6) // BLEZ/BGTZ + { + alloc_cc(¤t,i-1); + dirty_reg(¤t,CCREG); + if(rs1[i-1]==rt1[i]||rs1[i-1]==rt2[i]) { + // The delay slot overwrote the branch condition + // Delay slot goes after the test (in order) + current.u=branch_unneeded_reg[i-1]&~((1LL<>rt1[i])&1) current.uu&=~((1LL<>rs1[i-1]&1)) + { + alloc_reg64(¤t,i-1,rs1[i-1]); + } + } + memcpy(&branch_regs[i-1],¤t,sizeof(current)); + branch_regs[i-1].isconst=0; + branch_regs[i-1].wasconst=0; + memcpy(&branch_regs[i-1].regmap_entry,¤t.regmap,sizeof(current.regmap)); + memcpy(constmap[i],constmap[i-1],sizeof(current.constmap)); + } + else + // Alloc the delay slot in case the branch is taken + if((opcode[i-1]&0x3E)==0x14) // BEQL/BNEL + { + memcpy(&branch_regs[i-1],¤t,sizeof(current)); + branch_regs[i-1].u=(branch_unneeded_reg[i-1]&~((1LL<>rt1[i])&1) branch_regs[i-1].uu&=~((1LL<>rt1[i])&1) branch_regs[i-1].uu&=~((1LL<>rt1[i])&1) current.uu&=~((1LL<>rs1[i-1]&1)) + { + alloc_reg64(¤t,i-1,rs1[i-1]); + } + } + memcpy(&branch_regs[i-1],¤t,sizeof(current)); + branch_regs[i-1].isconst=0; + branch_regs[i-1].wasconst=0; + memcpy(&branch_regs[i-1].regmap_entry,¤t.regmap,sizeof(current.regmap)); + memcpy(constmap[i],constmap[i-1],sizeof(current.constmap)); + } + else + // Alloc the delay slot in case the branch is taken + if((opcode2[i-1]&0x1E)==2) // BLTZL/BGEZL + { + memcpy(&branch_regs[i-1],¤t,sizeof(current)); + branch_regs[i-1].u=(branch_unneeded_reg[i-1]&~((1LL<>rt1[i])&1) branch_regs[i-1].uu&=~((1LL<>rt1[i])&1) branch_regs[i-1].uu&=~((1LL<>16)==0x1000) + { + if(rt1[i-1]==31) // JAL/JALR + { + // Subroutine call will return here, don't alloc any registers + current.is32=1; + current.dirty=0; + clear_all_regs(current.regmap); + alloc_reg(¤t,i,CCREG); + dirty_reg(¤t,CCREG); + } + else if(i+1=0;j--) + { + if(ba[j]==start+i*4+4) { + memcpy(current.regmap,branch_regs[j].regmap,sizeof(current.regmap)); + current.is32=branch_regs[j].is32; + current.dirty=branch_regs[j].dirty; + break; + } + } + while(j>=0) { + if(ba[j]==start+i*4+4) { + for(hr=0;hr0&&(itype[i-1]==RJUMP||itype[i-1]==UJUMP||itype[i-1]==CJUMP||itype[i-1]==SJUMP||itype[i-1]==FJUMP||itype[i]==SYSCALL)) + { + cc=0; + } + else + { + cc++; + } + + flush_dirty_uppers(¤t); + if(!is_ds[i]) { + regs[i].is32=current.is32; + regs[i].dirty=current.dirty; + regs[i].isconst=current.isconst; + memcpy(constmap[i],current.constmap,sizeof(current.constmap)); + } + for(hr=0;hr=0) { + if(regmap_pre[i][hr]!=regs[i].regmap[hr]) { + regs[i].wasconst&=~(1<=0;i--) + { + int hr; + if(itype[i]==RJUMP||itype[i]==UJUMP||itype[i]==CJUMP||itype[i]==SJUMP||itype[i]==FJUMP) + { + if(ba[i]=(start+slen*4)) + { + // Branch out of this block, don't need anything + nr=0; + } + else + { + // Internal branch + // Need whatever matches the target + nr=0; + int t=(ba[i]-start)>>2; + for(hr=0;hr=0) { + if(regs[i].regmap_entry[hr]==regs[t].regmap_entry[hr]) nr|=1<>16)!=0x1000) + { + if(i=0&&get_reg(regs[i+2].regmap_entry,regmap_pre[i+2][hr])<0) nr&=~(1<=0) if(!((nr>>hr)&1)) DebugMessage(M64MSG_VERBOSE, "%x-bogus(%d=%d)",start+i*4,hr,regmap_entry[i+2][hr]); + } + } + } + // Don't need stuff which is overwritten + if(regs[i].regmap[hr]!=regmap_pre[i][hr]) nr&=~(1<>dep1[i+1])&1)) { + if(dep1[i+1]==(regmap_pre[i][hr]&63)) nr|=1<>dep2[i+1])&1)) { + if(dep1[i+1]==(regs[i].regmap_entry[hr]&63)) nr|=1<=0&&get_reg(regs[i+1].regmap_entry,regmap_pre[i+1][hr])<0) nr&=~(1<>dep1[i])&1)) { + if(dep1[i]==(regmap_pre[i][hr]&63)) nr|=1<>dep2[i])&1)) { + if(dep2[i]==(regmap_pre[i][hr]&63)) nr|=1<0&&!bt[i]&&((regs[i].wasdirty>>hr)&1)) { + if((regmap_pre[i][hr]>0&®map_pre[i][hr]<64&&!((unneeded_reg[i]>>regmap_pre[i][hr])&1)) || + (regmap_pre[i][hr]>64&&!((unneeded_reg_upper[i]>>(regmap_pre[i][hr]&63))&1)) ) { + if(rt1[i-1]==(regmap_pre[i][hr]&63)) nr|=1<0&®s[i].regmap_entry[hr]<64&&!((unneeded_reg[i]>>regs[i].regmap_entry[hr])&1)) || + (regs[i].regmap_entry[hr]>64&&!((unneeded_reg_upper[i]>>(regs[i].regmap_entry[hr]&63))&1)) ) { + if(rt1[i-1]==(regs[i].regmap_entry[hr]&63)) nr|=1<>hr)&1)) { + if(regs[i].regmap_entry[hr]!=CCREG) regs[i].regmap_entry[hr]=-1; + if((regs[i].regmap[hr]&63)!=rs1[i] && (regs[i].regmap[hr]&63)!=rs2[i] && + (regs[i].regmap[hr]&63)!=rt1[i] && (regs[i].regmap[hr]&63)!=rt2[i] && + (regs[i].regmap[hr]&63)!=PTEMP && (regs[i].regmap[hr]&63)!=CCREG) + { + if(itype[i]!=RJUMP&&itype[i]!=UJUMP&&(source[i]>>16)!=0x1000) + { + if(likely[i]) { + regs[i].regmap[hr]=-1; + regs[i].isconst&=~(1<=0||get_reg(branch_regs[i].regmap,rt1[i+1]|64)>=0) + { + d1=dep1[i+1]; + d2=dep2[i+1]; + } + if(using_tlb) { + if(itype[i+1]==LOAD || itype[i+1]==LOADLR || + itype[i+1]==STORE || itype[i+1]==STORELR || + itype[i+1]==C1LS ) + map=TLREG; + } else + if(itype[i+1]==STORE || itype[i+1]==STORELR || (opcode[i+1]&0x3b)==0x39) { + map=INVCP; + } + if(itype[i+1]==LOADLR || itype[i+1]==STORELR || + itype[i+1]==C1LS ) + temp=FTEMP; + if((regs[i].regmap[hr]&63)!=rs1[i] && (regs[i].regmap[hr]&63)!=rs2[i] && + (regs[i].regmap[hr]&63)!=rt1[i] && (regs[i].regmap[hr]&63)!=rt2[i] && + (regs[i].regmap[hr]&63)!=rt1[i+1] && (regs[i].regmap[hr]&63)!=rt2[i+1] && + (regs[i].regmap[hr]^64)!=us1[i+1] && (regs[i].regmap[hr]^64)!=us2[i+1] && + (regs[i].regmap[hr]^64)!=d1 && (regs[i].regmap[hr]^64)!=d2 && + regs[i].regmap[hr]!=rs1[i+1] && regs[i].regmap[hr]!=rs2[i+1] && + (regs[i].regmap[hr]&63)!=temp && regs[i].regmap[hr]!=PTEMP && + regs[i].regmap[hr]!=RHASH && regs[i].regmap[hr]!=RHTBL && + regs[i].regmap[hr]!=RTEMP && regs[i].regmap[hr]!=CCREG && + regs[i].regmap[hr]!=map ) + { + regs[i].regmap[hr]=-1; + regs[i].isconst&=~(1<>16)!=0x1000) + { + if(!likely[i]&&i0) + { + int d1=0,d2=0,map=-1,temp=-1; + if(get_reg(regs[i].regmap,rt1[i]|64)>=0) + { + d1=dep1[i]; + d2=dep2[i]; + } + if(using_tlb) { + if(itype[i]==LOAD || itype[i]==LOADLR || + itype[i]==STORE || itype[i]==STORELR || + itype[i]==C1LS ) + map=TLREG; + } else if(itype[i]==STORE || itype[i]==STORELR || (opcode[i]&0x3b)==0x39) { + map=INVCP; + } + if(itype[i]==LOADLR || itype[i]==STORELR || + itype[i]==C1LS ) + temp=FTEMP; + if((regs[i].regmap[hr]&63)!=rt1[i] && (regs[i].regmap[hr]&63)!=rt2[i] && + (regs[i].regmap[hr]^64)!=us1[i] && (regs[i].regmap[hr]^64)!=us2[i] && + (regs[i].regmap[hr]^64)!=d1 && (regs[i].regmap[hr]^64)!=d2 && + regs[i].regmap[hr]!=rs1[i] && regs[i].regmap[hr]!=rs2[i] && + (regs[i].regmap[hr]&63)!=temp && regs[i].regmap[hr]!=map && + (itype[i]!=SPAN||regs[i].regmap[hr]!=CCREG)) + { + if(i>(regs[i].regmap[hr]&63))&1)) + { + DebugMessage(M64MSG_VERBOSE, "fail: %x (%d %d!=%d)",start+i*4,hr,regmap_pre[i+1][hr],regs[i].regmap[hr]); + assert(regmap_pre[i+1][hr]==regs[i].regmap[hr]); + } + regmap_pre[i+1][hr]=-1; + if(regs[i+1].regmap_entry[hr]==CCREG) regs[i+1].regmap_entry[hr]=-1; + regs[i+1].wasconst&=~(1<=start && ba[i]<(start+i*4)) + if(itype[i+1]==NOP||itype[i+1]==MOV||itype[i+1]==ALU + ||itype[i+1]==SHIFTIMM||itype[i+1]==IMM16||itype[i+1]==LOAD + ||itype[i+1]==STORE||itype[i+1]==STORELR||itype[i+1]==C1LS + ||itype[i+1]==SHIFT||itype[i+1]==COP1||itype[i+1]==FLOAT + ||itype[i+1]==FCOMP||itype[i+1]==FCONV) + { + int t=(ba[i]-start)>>2; + if(t>0&&(itype[t-1]!=UJUMP&&itype[t-1]!=RJUMP&&itype[t-1]!=CJUMP&&itype[t-1]!=SJUMP&&itype[t-1]!=FJUMP)) // loop_preload can't handle jumps into delay slots + if(t<2||(itype[t-2]!=UJUMP&&itype[t-2]!=RJUMP)||rt1[t-2]!=31) // call/ret assumes no registers allocated + for(hr=0;hr64) { + if(!((regs[i].dirty>>hr)&1)) + f_regmap[hr]=regs[i].regmap[hr]; + else f_regmap[hr]=-1; + } + else if(regs[i].regmap[hr]>=0) { + if(f_regmap[hr]!=regs[i].regmap[hr]) { + // dealloc old register + int n; + for(n=0;n64) { + if(!((branch_regs[i].dirty>>hr)&1)) + f_regmap[hr]=branch_regs[i].regmap[hr]; + else f_regmap[hr]=-1; + } + else if(branch_regs[i].regmap[hr]>=0) { + if(f_regmap[hr]!=branch_regs[i].regmap[hr]) { + // dealloc old register + int n; + for(n=0;nclean transition + #ifdef DESTRUCTIVE_WRITEBACK + if(t>0) if(get_reg(regmap_pre[t],f_regmap[hr])>=0) if((regs[t].wasdirty>>get_reg(regmap_pre[t],f_regmap[hr]))&1) f_regmap[hr]=-1; + #endif + // This check is only strictly required in the DESTRUCTIVE_WRITEBACK + // case above, however it's always a good idea. We can't hoist the + // load if the register was already allocated, so there's no point + // wasting time analyzing most of these cases. It only "succeeds" + // when the mapping was different and the load can be replaced with + // a mov, which is of negligible benefit. So such cases are + // skipped below. + if(f_regmap[hr]>0) { + if(regs[t].regmap[hr]==f_regmap[hr]||(regs[t].regmap_entry[hr]<0&&get_reg(regmap_pre[t],f_regmap[hr])<0)) { + int r=f_regmap[hr]; + for(j=t;j<=i;j++) + { + //DebugMessage(M64MSG_VERBOSE, "Test %x -> %x, %x %d/%d",start+i*4,ba[i],start+j*4,hr,r); + if(r<34&&((unneeded_reg[j]>>r)&1)) break; + if(r>63&&((unneeded_reg_upper[j]>>(r&63))&1)) break; + if(r>63) { + // NB This can exclude the case where the upper-half + // register is lower numbered than the lower-half + // register. Not sure if it's worth fixing... + if(get_reg(regs[j].regmap,r&63)<0) break; + if(get_reg(regs[j].regmap_entry,r&63)<0) break; + if(regs[j].is32&(1LL<<(r&63))) break; + } + if(regs[j].regmap[hr]==f_regmap[hr]&&(f_regmap[hr]&63) %x, %x %d/%d",start+i*4,ba[i],start+j*4,hr,r); + int k; + if(regs[i].regmap[hr]==-1&&branch_regs[i].regmap[hr]==-1) { + if(get_reg(regs[i+2].regmap,f_regmap[hr])>=0) break; + if(r>63) { + if(get_reg(regs[i].regmap,r&63)<0) break; + if(get_reg(branch_regs[i].regmap,r&63)<0) break; + } + k=i; + while(k>1&®s[k-1].regmap[hr]==-1) { + if(count_free_regs(regs[k-1].regmap)<=minimum_free_regs[k-1]) { + //DebugMessage(M64MSG_VERBOSE, "no free regs for store %x",start+(k-1)*4); + break; + } + if(get_reg(regs[k-1].regmap,f_regmap[hr])>=0) { + //DebugMessage(M64MSG_VERBOSE, "no-match due to different register"); + break; + } + if(itype[k-2]==UJUMP||itype[k-2]==RJUMP||itype[k-2]==CJUMP||itype[k-2]==SJUMP||itype[k-2]==FJUMP) { + //DebugMessage(M64MSG_VERBOSE, "no-match due to branch"); + break; + } + // call/ret fast path assumes no registers allocated + if(k>2&&(itype[k-3]==UJUMP||itype[k-3]==RJUMP)&&rt1[k-3]==31) { + break; + } + if(r>63) { + // NB This can exclude the case where the upper-half + // register is lower numbered than the lower-half + // register. Not sure if it's worth fixing... + if(get_reg(regs[k-1].regmap,r&63)<0) break; + if(regs[k-1].is32&(1LL<<(r&63))) break; + } + k--; + } + if(i",hr,start+k*4); + while(k",hr,start+k*4); + break; + } + assert(regs[i-1].regmap[hr]==f_regmap[hr]); + if(regs[i-1].regmap[hr]==f_regmap[hr]&®map_pre[i][hr]==f_regmap[hr]) { + //DebugMessage(M64MSG_VERBOSE, "OK fill %x (r%d)",start+i*4,hr); + regs[i].regmap_entry[hr]=f_regmap[hr]; + regs[i].regmap[hr]=f_regmap[hr]; + regs[i].wasdirty&=~(1<>16)!=0x1000) { + regmap_pre[i+2][hr]=f_regmap[hr]; + regs[i+2].wasdirty&=~(1<>16)!=0x1000) { + regmap_pre[k+2][hr]=f_regmap[hr]; + regs[k+2].wasdirty&=~(1<=0) + break; + if(get_reg(regs[j].regmap,f_regmap[hr])>=0) { + //DebugMessage(M64MSG_VERBOSE, "no-match due to different register"); + break; + } + if((regs[j+1].is32&(1LL<>16)==0x1000) + { + // Stop on unconditional branch + break; + } + if(itype[j]==CJUMP||itype[j]==SJUMP||itype[j]==FJUMP) + { + if(ooo[j]) { + if(count_free_regs(regs[j].regmap)<=minimum_free_regs[j+1]) + break; + }else{ + if(count_free_regs(branch_regs[j].regmap)<=minimum_free_regs[j+1]) + break; + } + if(get_reg(branch_regs[j].regmap,f_regmap[hr])>=0) { + //DebugMessage(M64MSG_VERBOSE, "no-match due to different register (branch)"); + break; + } + } + if(count_free_regs(regs[j].regmap)<=minimum_free_regs[j]) { + //DebugMessage(M64MSG_VERBOSE, "No free regs for store %x",start+j*4); + break; + } + if(f_regmap[hr]>=64) { + if(regs[j].is32&(1LL<<(f_regmap[hr]&63))) { + break; + } + else + { + if(get_reg(regs[j].regmap,f_regmap[hr]&63)<0) { + break; + } + } + } + } + } + } + } + } + }else{ + // Non branch or undetermined branch target + for(hr=0;hr64) { + if(!((regs[i].dirty>>hr)&1)) + f_regmap[hr]=regs[i].regmap[hr]; + } + else if(regs[i].regmap[hr]>=0) { + if(f_regmap[hr]!=regs[i].regmap[hr]) { + // dealloc old register + int n; + for(n=0;n %x",start+k*4,start+j*4); + while(ki&&f_regmap[HOST_CCREG]==CCREG) + { + //DebugMessage(M64MSG_VERBOSE, "Extend backwards"); + int k; + k=i; + while(regs[k-1].regmap[HOST_CCREG]==-1) { + if(count_free_regs(regs[k-1].regmap)<=minimum_free_regs[k-1]) { + //DebugMessage(M64MSG_VERBOSE, "no free regs for store %x",start+(k-1)*4); + break; + } + k--; + } + if(regs[k-1].regmap[HOST_CCREG]==CCREG) { + //DebugMessage(M64MSG_VERBOSE, "Extend CC, %x ->",start+k*4); + while(k<=i) { + regs[k].regmap_entry[HOST_CCREG]=CCREG; + regs[k].regmap[HOST_CCREG]=CCREG; + regmap_pre[k+1][HOST_CCREG]=CCREG; + regs[k+1].wasdirty|=1<",start+k*4); + } + } + } + if(itype[i]!=STORE&&itype[i]!=STORELR&&itype[i]!=C1LS&&itype[i]!=SHIFT&& + itype[i]!=NOP&&itype[i]!=MOV&&itype[i]!=ALU&&itype[i]!=SHIFTIMM&& + itype[i]!=IMM16&&itype[i]!=LOAD&&itype[i]!=COP1&&itype[i]!=FLOAT&& + itype[i]!=FCONV&&itype[i]!=FCOMP) + { + memcpy(f_regmap,regs[i].regmap,sizeof(f_regmap)); + } + } + } + + // Cache memory offset or tlb map pointer if a register is available + #ifndef HOST_IMM_ADDR32 + #ifndef RAM_OFFSET + if(using_tlb) + #endif + { + int earliest_available[HOST_REGS]; + int loop_start[HOST_REGS]; + int score[HOST_REGS]; + int end[HOST_REGS]; + int reg=using_tlb?MMREG:ROREG; + + // Init + for(hr=0;hr=0) { + score[hr]=0;earliest_available[hr]=i+1; + loop_start[hr]=MAXBLOCK; + } + if(itype[i]==UJUMP||itype[i]==RJUMP||itype[i]==CJUMP||itype[i]==SJUMP||itype[i]==FJUMP) { + if(branch_regs[i].regmap[hr]>=0) { + score[hr]=0;earliest_available[hr]=i+2; + loop_start[hr]=MAXBLOCK; + } + } + } + // No register allocations after unconditional jumps + if(itype[i]==UJUMP||itype[i]==RJUMP||(source[i]>>16)==0x1000) + { + for(hr=0;hr=0) break; + if(itype[j]==UJUMP||itype[j]==RJUMP||itype[j]==CJUMP||itype[j]==SJUMP||itype[j]==FJUMP) { + if(branch_regs[j].regmap[hr]>=0) break; + if(ooo[j]) { + if(count_free_regs(regs[j].regmap)<=minimum_free_regs[j+1]) break; + }else{ + if(count_free_regs(branch_regs[j].regmap)<=minimum_free_regs[j+1]) break; + } + } + else if(count_free_regs(regs[j].regmap)<=minimum_free_regs[j]) break; + if(itype[j]==UJUMP||itype[j]==RJUMP||itype[j]==CJUMP||itype[j]==SJUMP||itype[j]==FJUMP) { + int t=(ba[j]-start)>>2; + if(t=earliest_available[hr]) { + if(t==1||(t>1&&itype[t-2]!=UJUMP&&itype[t-2]!=RJUMP)||(t>1&&rt1[t-2]!=31)) { // call/ret assumes no registers allocated + // Score a point for hoisting loop invariant + if(t>16)==0x1000) + { + // Stop on unconditional branch + break; + } + else + if(itype[j]==LOAD||itype[j]==LOADLR|| + itype[j]==STORE||itype[j]==STORELR||itype[j]==C1LS) { + score[hr]++; + end[hr]=j; + } + } + } + } + // Find highest score and allocate that register + int maxscore=0; + for(hr=0;hrscore[maxscore]) { + maxscore=hr; + //DebugMessage(M64MSG_VERBOSE, "highest score: %d %d (%x->%x)",score[hr],hr,start+i*4,start+end[hr]*4); + } + } + } + if(score[maxscore]>1) + { + if(i=0) {DebugMessage(M64MSG_ERROR, "oops: %x %x was %d=%d",loop_start[maxscore]*4+start,j*4+start,maxscore,regs[j].regmap[maxscore]);} + assert(regs[j].regmap[maxscore]<0); + if(j>loop_start[maxscore]) regs[j].regmap_entry[maxscore]=reg; + regs[j].regmap[maxscore]=reg; + regs[j].dirty&=~(1<>16)!=0x1000) { + regmap_pre[j+2][maxscore]=reg; + regs[j+2].wasdirty&=~(1<>2; + if(t==loop_start[maxscore]) { + if(t==1||(t>1&&itype[t-2]!=UJUMP&&itype[t-2]!=RJUMP)||(t>1&&rt1[t-2]!=31)) // call/ret assumes no registers allocated + regs[t].regmap_entry[maxscore]=reg; + } + } + else + { + if(j<1||(itype[j-1]!=RJUMP&&itype[j-1]!=UJUMP&&itype[j-1]!=CJUMP&&itype[j-1]!=SJUMP&&itype[j-1]!=FJUMP)) { + regmap_pre[j+1][maxscore]=reg; + regs[j+1].wasdirty&=~(1<=0) + { + if(regs[i].regmap[hr]<0&®s[i+1].regmap_entry[hr]<0) + { + regs[i].regmap[hr]=regs[i+1].regmap[hr]; + regmap_pre[i+1][hr]=regs[i+1].regmap[hr]; + regs[i+1].regmap_entry[hr]=regs[i+1].regmap[hr]; + regs[i].isconst&=~(1<=0) + { + if(regs[i].regmap[hr]<0&®s[i+1].regmap_entry[hr]<0) + { + regs[i].regmap[hr]=regs[i+1].regmap[hr]; + regmap_pre[i+1][hr]=regs[i+1].regmap[hr]; + regs[i+1].regmap_entry[hr]=regs[i+1].regmap[hr]; + regs[i].isconst&=~(1<=0) + { + if(regs[i].regmap[hr]<0&®s[i+1].regmap_entry[hr]<0) + { + regs[i].regmap[hr]=rs1[i+1]; + regmap_pre[i+1][hr]=rs1[i+1]; + regs[i+1].regmap_entry[hr]=rs1[i+1]; + regs[i].isconst&=~(1<=0) + { + if(regs[i].regmap[hr]<0&®s[i+1].regmap_entry[hr]<0) + { + regs[i].regmap[hr]=rs1[i+1]; + regmap_pre[i+1][hr]=rs1[i+1]; + regs[i+1].regmap_entry[hr]=rs1[i+1]; + regs[i].isconst&=~(1<=0) { + int sr=get_reg(regs[i+1].regmap,rs1[i+1]); + if(sr>=0&&((regs[i+1].wasconst>>sr)&1)) { + int nr; + if(regs[i].regmap[hr]<0&®s[i+1].regmap_entry[hr]<0) + { + regs[i].regmap[hr]=MGEN1+((i+1)&1); + regmap_pre[i+1][hr]=MGEN1+((i+1)&1); + regs[i+1].regmap_entry[hr]=MGEN1+((i+1)&1); + regs[i].isconst&=~(1<=0) + { + // move it to another register + regs[i+1].regmap[hr]=-1; + regmap_pre[i+2][hr]=-1; + regs[i+1].regmap[nr]=TLREG; + regmap_pre[i+2][nr]=TLREG; + regs[i].regmap[nr]=MGEN1+((i+1)&1); + regmap_pre[i+1][nr]=MGEN1+((i+1)&1); + regs[i+1].regmap_entry[nr]=MGEN1+((i+1)&1); + regs[i].isconst&=~(1<=0); + if(regs[i].regmap[hr]<0&®s[i+1].regmap_entry[hr]<0) + { + regs[i].regmap[hr]=rs1[i+1]; + regmap_pre[i+1][hr]=rs1[i+1]; + regs[i+1].regmap_entry[hr]=rs1[i+1]; + regs[i].isconst&=~(1<=0); + if(regs[i].regmap[hr]<0&®s[i+1].regmap_entry[hr]<0) + { + regs[i].regmap[hr]=rs1[i+1]; + regmap_pre[i+1][hr]=rs1[i+1]; + regs[i+1].regmap_entry[hr]=rs1[i+1]; + regs[i].isconst&=~(1<=0) + { + // move it to another register + regs[i+1].regmap[hr]=-1; + regmap_pre[i+2][hr]=-1; + regs[i+1].regmap[nr]=FTEMP; + regmap_pre[i+2][nr]=FTEMP; + regs[i].regmap[nr]=rs1[i+1]; + regmap_pre[i+1][nr]=rs1[i+1]; + regs[i+1].regmap_entry[nr]=rs1[i+1]; + regs[i].isconst&=~(1<=0&®s[i].regmap[hr]<0) { + int rs=get_reg(regs[i+1].regmap,rs1[i+1]); + if(rs>=0&&((regs[i+1].wasconst>>rs)&1)) { + regs[i].regmap[hr]=AGEN1+((i+1)&1); + regmap_pre[i+1][hr]=AGEN1+((i+1)&1); + regs[i+1].regmap_entry[hr]=AGEN1+((i+1)&1); + regs[i].isconst&=~(1<=0;i--) + { + int hr; + if(itype[i]==RJUMP||itype[i]==UJUMP||itype[i]==CJUMP||itype[i]==SJUMP||itype[i]==FJUMP) + { + if(ba[i]=(start+slen*4)) + { + // Branch out of this block, don't need anything + r32=0; + } + else + { + // Internal branch + // Need whatever matches the target + // (and doesn't get overwritten by the delay slot instruction) + r32=0; + int t=(ba[i]-start)>>2; + if(ba[i]>start+i*4) { + // Forward branch + if(!(requires_32bit[t]&~regs[i].was32)) + r32|=requires_32bit[t]&(~(1LL<>16)!=0x1000) + { + if(i0) + { + if((regs[i].was32>>us1[i+1])&1) r32|=1LL<0) + { + if((regs[i].was32>>us2[i+1])&1) r32|=1LL<>dep1[i+1])&1)) + { + if((regs[i].was32>>dep1[i+1])&1) r32|=1LL<>dep2[i+1])&1)) + { + if((regs[i].was32>>dep2[i+1])&1) r32|=1LL<0) + { + if((regs[i].was32>>us1[i])&1) r32|=1LL<0) + { + if((regs[i].was32>>us2[i])&1) r32|=1LL<>dep1[i])&1)) + { + if((regs[i].was32>>dep1[i])&1) r32|=1LL<>dep2[i])&1)) + { + if((regs[i].was32>>dep2[i])&1) r32|=1LL<0&®s[i].regmap_entry[hr]<64) { + if((regs[i].was32>>regs[i].regmap_entry[hr])&(regs[i].wasdirty>>hr)&1) { + if(!((unneeded_reg_upper[i]>>regs[i].regmap_entry[hr])&1)) + requires_32bit[i]|=1LL<>r)&1) { + if(r==HIREG) DebugMessage(M64MSG_VERBOSE, " HI"); + else if(r==LOREG) DebugMessage(M64MSG_VERBOSE, " LO"); + else DebugMessage(M64MSG_VERBOSE, " r%d",r); + } + } + DebugMessage(M64MSG_VERBOSE, " UU:"); + for(r=1;r<=CCREG;r++) { + if(((unneeded_reg_upper[i]&~unneeded_reg[i])>>r)&1) { + if(r==HIREG) DebugMessage(M64MSG_VERBOSE, " HI"); + else if(r==LOREG) DebugMessage(M64MSG_VERBOSE, " LO"); + else DebugMessage(M64MSG_VERBOSE, " r%d",r); + } + } + DebugMessage(M64MSG_VERBOSE, " 32:"); + for(r=0;r<=CCREG;r++) { + //if(((is32[i]>>r)&(~unneeded_reg[i]>>r))&1) { + if((regs[i].was32>>r)&1) { + if(r==CCREG) DebugMessage(M64MSG_VERBOSE, " CC"); + else if(r==HIREG) DebugMessage(M64MSG_VERBOSE, " HI"); + else if(r==LOREG) DebugMessage(M64MSG_VERBOSE, " LO"); + else DebugMessage(M64MSG_VERBOSE, " r%d",r); + } + } + #if NEW_DYNAREC == NEW_DYNAREC_X86 + DebugMessage(M64MSG_VERBOSE, "pre: eax=%d ecx=%d edx=%d ebx=%d ebp=%d esi=%d edi=%d",regmap_pre[i][0],regmap_pre[i][1],regmap_pre[i][2],regmap_pre[i][3],regmap_pre[i][5],regmap_pre[i][6],regmap_pre[i][7]); + #endif + #if NEW_DYNAREC == NEW_DYNAREC_ARM + DebugMessage(M64MSG_VERBOSE, "pre: r0=%d r1=%d r2=%d r3=%d r4=%d r5=%d r6=%d r7=%d r8=%d r9=%d r10=%d r12=%d",regmap_pre[i][0],regmap_pre[i][1],regmap_pre[i][2],regmap_pre[i][3],regmap_pre[i][4],regmap_pre[i][5],regmap_pre[i][6],regmap_pre[i][7],regmap_pre[i][8],regmap_pre[i][9],regmap_pre[i][10],regmap_pre[i][12]); + #endif + DebugMessage(M64MSG_VERBOSE, "needs: "); + if(needed_reg[i]&1) DebugMessage(M64MSG_VERBOSE, "eax "); + if((needed_reg[i]>>1)&1) DebugMessage(M64MSG_VERBOSE, "ecx "); + if((needed_reg[i]>>2)&1) DebugMessage(M64MSG_VERBOSE, "edx "); + if((needed_reg[i]>>3)&1) DebugMessage(M64MSG_VERBOSE, "ebx "); + if((needed_reg[i]>>5)&1) DebugMessage(M64MSG_VERBOSE, "ebp "); + if((needed_reg[i]>>6)&1) DebugMessage(M64MSG_VERBOSE, "esi "); + if((needed_reg[i]>>7)&1) DebugMessage(M64MSG_VERBOSE, "edi "); + DebugMessage(M64MSG_VERBOSE, "r:"); + for(r=0;r<=CCREG;r++) { + //if(((requires_32bit[i]>>r)&(~unneeded_reg[i]>>r))&1) { + if((requires_32bit[i]>>r)&1) { + if(r==CCREG) DebugMessage(M64MSG_VERBOSE, " CC"); + else if(r==HIREG) DebugMessage(M64MSG_VERBOSE, " HI"); + else if(r==LOREG) DebugMessage(M64MSG_VERBOSE, " LO"); + else DebugMessage(M64MSG_VERBOSE, " r%d",r); + } + } + /*DebugMessage(M64MSG_VERBOSE, "pr:"); + for(r=0;r<=CCREG;r++) { + //if(((requires_32bit[i]>>r)&(~unneeded_reg[i]>>r))&1) { + if((pr32[i]>>r)&1) { + if(r==CCREG) DebugMessage(M64MSG_VERBOSE, " CC"); + else if(r==HIREG) DebugMessage(M64MSG_VERBOSE, " HI"); + else if(r==LOREG) DebugMessage(M64MSG_VERBOSE, " LO"); + else DebugMessage(M64MSG_VERBOSE, " r%d",r); + } + } + if(pr32[i]!=requires_32bit[i]) DebugMessage(M64MSG_ERROR, " OOPS");*/ + #if NEW_DYNAREC == NEW_DYNAREC_X86 + DebugMessage(M64MSG_VERBOSE, "entry: eax=%d ecx=%d edx=%d ebx=%d ebp=%d esi=%d edi=%d",regs[i].regmap_entry[0],regs[i].regmap_entry[1],regs[i].regmap_entry[2],regs[i].regmap_entry[3],regs[i].regmap_entry[5],regs[i].regmap_entry[6],regs[i].regmap_entry[7]); + DebugMessage(M64MSG_VERBOSE, "dirty: "); + if(regs[i].wasdirty&1) DebugMessage(M64MSG_VERBOSE, "eax "); + if((regs[i].wasdirty>>1)&1) DebugMessage(M64MSG_VERBOSE, "ecx "); + if((regs[i].wasdirty>>2)&1) DebugMessage(M64MSG_VERBOSE, "edx "); + if((regs[i].wasdirty>>3)&1) DebugMessage(M64MSG_VERBOSE, "ebx "); + if((regs[i].wasdirty>>5)&1) DebugMessage(M64MSG_VERBOSE, "ebp "); + if((regs[i].wasdirty>>6)&1) DebugMessage(M64MSG_VERBOSE, "esi "); + if((regs[i].wasdirty>>7)&1) DebugMessage(M64MSG_VERBOSE, "edi "); + #endif + #if NEW_DYNAREC == NEW_DYNAREC_ARM + DebugMessage(M64MSG_VERBOSE, "entry: r0=%d r1=%d r2=%d r3=%d r4=%d r5=%d r6=%d r7=%d r8=%d r9=%d r10=%d r12=%d",regs[i].regmap_entry[0],regs[i].regmap_entry[1],regs[i].regmap_entry[2],regs[i].regmap_entry[3],regs[i].regmap_entry[4],regs[i].regmap_entry[5],regs[i].regmap_entry[6],regs[i].regmap_entry[7],regs[i].regmap_entry[8],regs[i].regmap_entry[9],regs[i].regmap_entry[10],regs[i].regmap_entry[12]); + DebugMessage(M64MSG_VERBOSE, "dirty: "); + if(regs[i].wasdirty&1) DebugMessage(M64MSG_VERBOSE, "r0 "); + if((regs[i].wasdirty>>1)&1) DebugMessage(M64MSG_VERBOSE, "r1 "); + if((regs[i].wasdirty>>2)&1) DebugMessage(M64MSG_VERBOSE, "r2 "); + if((regs[i].wasdirty>>3)&1) DebugMessage(M64MSG_VERBOSE, "r3 "); + if((regs[i].wasdirty>>4)&1) DebugMessage(M64MSG_VERBOSE, "r4 "); + if((regs[i].wasdirty>>5)&1) DebugMessage(M64MSG_VERBOSE, "r5 "); + if((regs[i].wasdirty>>6)&1) DebugMessage(M64MSG_VERBOSE, "r6 "); + if((regs[i].wasdirty>>7)&1) DebugMessage(M64MSG_VERBOSE, "r7 "); + if((regs[i].wasdirty>>8)&1) DebugMessage(M64MSG_VERBOSE, "r8 "); + if((regs[i].wasdirty>>9)&1) DebugMessage(M64MSG_VERBOSE, "r9 "); + if((regs[i].wasdirty>>10)&1) DebugMessage(M64MSG_VERBOSE, "r10 "); + if((regs[i].wasdirty>>12)&1) DebugMessage(M64MSG_VERBOSE, "r12 "); + #endif + disassemble_inst(i); + //printf ("ccadj[%d] = %d",i,ccadj[i]); + #if NEW_DYNAREC == NEW_DYNAREC_X86 + DebugMessage(M64MSG_VERBOSE, "eax=%d ecx=%d edx=%d ebx=%d ebp=%d esi=%d edi=%d dirty: ",regs[i].regmap[0],regs[i].regmap[1],regs[i].regmap[2],regs[i].regmap[3],regs[i].regmap[5],regs[i].regmap[6],regs[i].regmap[7]); + if(regs[i].dirty&1) DebugMessage(M64MSG_VERBOSE, "eax "); + if((regs[i].dirty>>1)&1) DebugMessage(M64MSG_VERBOSE, "ecx "); + if((regs[i].dirty>>2)&1) DebugMessage(M64MSG_VERBOSE, "edx "); + if((regs[i].dirty>>3)&1) DebugMessage(M64MSG_VERBOSE, "ebx "); + if((regs[i].dirty>>5)&1) DebugMessage(M64MSG_VERBOSE, "ebp "); + if((regs[i].dirty>>6)&1) DebugMessage(M64MSG_VERBOSE, "esi "); + if((regs[i].dirty>>7)&1) DebugMessage(M64MSG_VERBOSE, "edi "); + #endif + #if NEW_DYNAREC == NEW_DYNAREC_ARM + DebugMessage(M64MSG_VERBOSE, "r0=%d r1=%d r2=%d r3=%d r4=%d r5=%d r6=%d r7=%d r8=%d r9=%d r10=%d r12=%d dirty: ",regs[i].regmap[0],regs[i].regmap[1],regs[i].regmap[2],regs[i].regmap[3],regs[i].regmap[4],regs[i].regmap[5],regs[i].regmap[6],regs[i].regmap[7],regs[i].regmap[8],regs[i].regmap[9],regs[i].regmap[10],regs[i].regmap[12]); + if(regs[i].dirty&1) DebugMessage(M64MSG_VERBOSE, "r0 "); + if((regs[i].dirty>>1)&1) DebugMessage(M64MSG_VERBOSE, "r1 "); + if((regs[i].dirty>>2)&1) DebugMessage(M64MSG_VERBOSE, "r2 "); + if((regs[i].dirty>>3)&1) DebugMessage(M64MSG_VERBOSE, "r3 "); + if((regs[i].dirty>>4)&1) DebugMessage(M64MSG_VERBOSE, "r4 "); + if((regs[i].dirty>>5)&1) DebugMessage(M64MSG_VERBOSE, "r5 "); + if((regs[i].dirty>>6)&1) DebugMessage(M64MSG_VERBOSE, "r6 "); + if((regs[i].dirty>>7)&1) DebugMessage(M64MSG_VERBOSE, "r7 "); + if((regs[i].dirty>>8)&1) DebugMessage(M64MSG_VERBOSE, "r8 "); + if((regs[i].dirty>>9)&1) DebugMessage(M64MSG_VERBOSE, "r9 "); + if((regs[i].dirty>>10)&1) DebugMessage(M64MSG_VERBOSE, "r10 "); + if((regs[i].dirty>>12)&1) DebugMessage(M64MSG_VERBOSE, "r12 "); + #endif + if(regs[i].isconst) { + DebugMessage(M64MSG_VERBOSE, "constants: "); + #if NEW_DYNAREC == NEW_DYNAREC_X86 + if(regs[i].isconst&1) DebugMessage(M64MSG_VERBOSE, "eax=%x ",(int)constmap[i][0]); + if((regs[i].isconst>>1)&1) DebugMessage(M64MSG_VERBOSE, "ecx=%x ",(int)constmap[i][1]); + if((regs[i].isconst>>2)&1) DebugMessage(M64MSG_VERBOSE, "edx=%x ",(int)constmap[i][2]); + if((regs[i].isconst>>3)&1) DebugMessage(M64MSG_VERBOSE, "ebx=%x ",(int)constmap[i][3]); + if((regs[i].isconst>>5)&1) DebugMessage(M64MSG_VERBOSE, "ebp=%x ",(int)constmap[i][5]); + if((regs[i].isconst>>6)&1) DebugMessage(M64MSG_VERBOSE, "esi=%x ",(int)constmap[i][6]); + if((regs[i].isconst>>7)&1) DebugMessage(M64MSG_VERBOSE, "edi=%x ",(int)constmap[i][7]); + #endif + #if NEW_DYNAREC == NEW_DYNAREC_ARM + if(regs[i].isconst&1) DebugMessage(M64MSG_VERBOSE, "r0=%x ",(int)constmap[i][0]); + if((regs[i].isconst>>1)&1) DebugMessage(M64MSG_VERBOSE, "r1=%x ",(int)constmap[i][1]); + if((regs[i].isconst>>2)&1) DebugMessage(M64MSG_VERBOSE, "r2=%x ",(int)constmap[i][2]); + if((regs[i].isconst>>3)&1) DebugMessage(M64MSG_VERBOSE, "r3=%x ",(int)constmap[i][3]); + if((regs[i].isconst>>4)&1) DebugMessage(M64MSG_VERBOSE, "r4=%x ",(int)constmap[i][4]); + if((regs[i].isconst>>5)&1) DebugMessage(M64MSG_VERBOSE, "r5=%x ",(int)constmap[i][5]); + if((regs[i].isconst>>6)&1) DebugMessage(M64MSG_VERBOSE, "r6=%x ",(int)constmap[i][6]); + if((regs[i].isconst>>7)&1) DebugMessage(M64MSG_VERBOSE, "r7=%x ",(int)constmap[i][7]); + if((regs[i].isconst>>8)&1) DebugMessage(M64MSG_VERBOSE, "r8=%x ",(int)constmap[i][8]); + if((regs[i].isconst>>9)&1) DebugMessage(M64MSG_VERBOSE, "r9=%x ",(int)constmap[i][9]); + if((regs[i].isconst>>10)&1) DebugMessage(M64MSG_VERBOSE, "r10=%x ",(int)constmap[i][10]); + if((regs[i].isconst>>12)&1) DebugMessage(M64MSG_VERBOSE, "r12=%x ",(int)constmap[i][12]); + #endif + } + DebugMessage(M64MSG_VERBOSE, " 32:"); + for(r=0;r<=CCREG;r++) { + if((regs[i].is32>>r)&1) { + if(r==CCREG) DebugMessage(M64MSG_VERBOSE, " CC"); + else if(r==HIREG) DebugMessage(M64MSG_VERBOSE, " HI"); + else if(r==LOREG) DebugMessage(M64MSG_VERBOSE, " LO"); + else DebugMessage(M64MSG_VERBOSE, " r%d",r); + } + } + /*DebugMessage(M64MSG_VERBOSE, " p32:"); + for(r=0;r<=CCREG;r++) { + if((p32[i]>>r)&1) { + if(r==CCREG) DebugMessage(M64MSG_VERBOSE, " CC"); + else if(r==HIREG) DebugMessage(M64MSG_VERBOSE, " HI"); + else if(r==LOREG) DebugMessage(M64MSG_VERBOSE, " LO"); + else DebugMessage(M64MSG_VERBOSE, " r%d",r); + } + } + if(p32[i]!=regs[i].is32) DebugMessage(M64MSG_VERBOSE, " NO MATCH");*/ + if(itype[i]==RJUMP||itype[i]==UJUMP||itype[i]==CJUMP||itype[i]==SJUMP||itype[i]==FJUMP) { + #if NEW_DYNAREC == NEW_DYNAREC_X86 + DebugMessage(M64MSG_VERBOSE, "branch(%d): eax=%d ecx=%d edx=%d ebx=%d ebp=%d esi=%d edi=%d dirty: ",i,branch_regs[i].regmap[0],branch_regs[i].regmap[1],branch_regs[i].regmap[2],branch_regs[i].regmap[3],branch_regs[i].regmap[5],branch_regs[i].regmap[6],branch_regs[i].regmap[7]); + if(branch_regs[i].dirty&1) DebugMessage(M64MSG_VERBOSE, "eax "); + if((branch_regs[i].dirty>>1)&1) DebugMessage(M64MSG_VERBOSE, "ecx "); + if((branch_regs[i].dirty>>2)&1) DebugMessage(M64MSG_VERBOSE, "edx "); + if((branch_regs[i].dirty>>3)&1) DebugMessage(M64MSG_VERBOSE, "ebx "); + if((branch_regs[i].dirty>>5)&1) DebugMessage(M64MSG_VERBOSE, "ebp "); + if((branch_regs[i].dirty>>6)&1) DebugMessage(M64MSG_VERBOSE, "esi "); + if((branch_regs[i].dirty>>7)&1) DebugMessage(M64MSG_VERBOSE, "edi "); + #endif + #if NEW_DYNAREC == NEW_DYNAREC_ARM + DebugMessage(M64MSG_VERBOSE, "branch(%d): r0=%d r1=%d r2=%d r3=%d r4=%d r5=%d r6=%d r7=%d r8=%d r9=%d r10=%d r12=%d dirty: ",i,branch_regs[i].regmap[0],branch_regs[i].regmap[1],branch_regs[i].regmap[2],branch_regs[i].regmap[3],branch_regs[i].regmap[4],branch_regs[i].regmap[5],branch_regs[i].regmap[6],branch_regs[i].regmap[7],branch_regs[i].regmap[8],branch_regs[i].regmap[9],branch_regs[i].regmap[10],branch_regs[i].regmap[12]); + if(branch_regs[i].dirty&1) DebugMessage(M64MSG_VERBOSE, "r0 "); + if((branch_regs[i].dirty>>1)&1) DebugMessage(M64MSG_VERBOSE, "r1 "); + if((branch_regs[i].dirty>>2)&1) DebugMessage(M64MSG_VERBOSE, "r2 "); + if((branch_regs[i].dirty>>3)&1) DebugMessage(M64MSG_VERBOSE, "r3 "); + if((branch_regs[i].dirty>>4)&1) DebugMessage(M64MSG_VERBOSE, "r4 "); + if((branch_regs[i].dirty>>5)&1) DebugMessage(M64MSG_VERBOSE, "r5 "); + if((branch_regs[i].dirty>>6)&1) DebugMessage(M64MSG_VERBOSE, "r6 "); + if((branch_regs[i].dirty>>7)&1) DebugMessage(M64MSG_VERBOSE, "r7 "); + if((branch_regs[i].dirty>>8)&1) DebugMessage(M64MSG_VERBOSE, "r8 "); + if((branch_regs[i].dirty>>9)&1) DebugMessage(M64MSG_VERBOSE, "r9 "); + if((branch_regs[i].dirty>>10)&1) DebugMessage(M64MSG_VERBOSE, "r10 "); + if((branch_regs[i].dirty>>12)&1) DebugMessage(M64MSG_VERBOSE, "r12 "); + #endif + DebugMessage(M64MSG_VERBOSE, " 32:"); + for(r=0;r<=CCREG;r++) { + if((branch_regs[i].is32>>r)&1) { + if(r==CCREG) DebugMessage(M64MSG_VERBOSE, " CC"); + else if(r==HIREG) DebugMessage(M64MSG_VERBOSE, " HI"); + else if(r==LOREG) DebugMessage(M64MSG_VERBOSE, " LO"); + else DebugMessage(M64MSG_VERBOSE, " r%d",r); + } + } + } + } +#endif + + /* Pass 8 - Assembly */ + linkcount=0;stubcount=0; + ds=0;is_delayslot=0; + cop1_usable=0; + #ifndef DESTRUCTIVE_WRITEBACK + uint64_t is32_pre=0; + u_int dirty_pre=0; + #endif + u_int beginning=(u_int)out; + if((u_int)addr&1) { + ds=1; + pagespan_ds(); + } + for(i=0;i>16)!=0x1000)) + { + wb_sx(regmap_pre[i],regs[i].regmap_entry,regs[i].wasdirty,is32_pre,regs[i].was32, + unneeded_reg[i],unneeded_reg_upper[i]); + wb_valid(regmap_pre[i],regs[i].regmap_entry,dirty_pre,regs[i].wasdirty,is32_pre, + unneeded_reg[i],unneeded_reg_upper[i]); + } + is32_pre=regs[i].is32; + dirty_pre=regs[i].dirty; + #endif + // write back + if(i<2||(itype[i-2]!=UJUMP&&itype[i-2]!=RJUMP&&(source[i-2]>>16)!=0x1000)) + { + wb_invalidate(regmap_pre[i],regs[i].regmap_entry,regs[i].wasdirty,regs[i].was32, + unneeded_reg[i],unneeded_reg_upper[i]); + loop_preload(regmap_pre[i],regs[i].regmap_entry); + } + // branch target entry point + instr_addr[i]=(u_int)out; + assem_debug("<->"); + // load regs + if(regs[i].regmap_entry[HOST_CCREG]==CCREG&®s[i].regmap[HOST_CCREG]!=CCREG) + wb_register(CCREG,regs[i].regmap_entry,regs[i].wasdirty,regs[i].was32); + load_regs(regs[i].regmap_entry,regs[i].regmap,regs[i].was32,rs1[i],rs2[i]); + address_generation(i,®s[i],regs[i].regmap_entry); + load_consts(regmap_pre[i],regs[i].regmap,regs[i].was32,i); + if(itype[i]==RJUMP||itype[i]==UJUMP||itype[i]==CJUMP||itype[i]==SJUMP||itype[i]==FJUMP) + { + // Load the delay slot registers if necessary + if(rs1[i+1]!=rs1[i]&&rs1[i+1]!=rs2[i]) + load_regs(regs[i].regmap_entry,regs[i].regmap,regs[i].was32,rs1[i+1],rs1[i+1]); + if(rs2[i+1]!=rs1[i+1]&&rs2[i+1]!=rs1[i]&&rs2[i+1]!=rs2[i]) + load_regs(regs[i].regmap_entry,regs[i].regmap,regs[i].was32,rs2[i+1],rs2[i+1]); + if(itype[i+1]==STORE||itype[i+1]==STORELR||(opcode[i+1]&0x3b)==0x39) + load_regs(regs[i].regmap_entry,regs[i].regmap,regs[i].was32,INVCP,INVCP); + } + else if(i+1>16)==0x1000) + literal_pool(1024); + else + literal_pool_jumpover(256); + } + } + //assert(itype[i-2]==UJUMP||itype[i-2]==RJUMP||(source[i-2]>>16)==0x1000); + // If the block did not end with an unconditional branch, + // add a jump to the next instruction. + if(i>1) { + if(itype[i-2]!=UJUMP&&itype[i-2]!=RJUMP&&(source[i-2]>>16)!=0x1000&&itype[i-1]!=SPAN) { + assert(itype[i-1]!=UJUMP&&itype[i-1]!=CJUMP&&itype[i-1]!=SJUMP&&itype[i-1]!=RJUMP&&itype[i-1]!=FJUMP); + assert(i==slen); + if(itype[i-2]!=CJUMP&&itype[i-2]!=SJUMP&&itype[i-2]!=FJUMP) { + store_regs_bt(regs[i-1].regmap,regs[i-1].is32,regs[i-1].dirty,start+i*4); + if(regs[i-1].regmap[HOST_CCREG]!=CCREG) + emit_loadreg(CCREG,HOST_CCREG); + emit_addimm(HOST_CCREG,CLOCK_DIVIDER*(ccadj[i-1]+1),HOST_CCREG); + } + else if(!likely[i-2]) + { + store_regs_bt(branch_regs[i-2].regmap,branch_regs[i-2].is32,branch_regs[i-2].dirty,start+i*4); + assert(branch_regs[i-2].regmap[HOST_CCREG]==CCREG); + } + else + { + store_regs_bt(regs[i-2].regmap,regs[i-2].is32,regs[i-2].dirty,start+i*4); + assert(regs[i-2].regmap[HOST_CCREG]==CCREG); + } + add_to_linker((int)out,start+i*4,0); + emit_jmp(0); + } + } + else + { + assert(i>0); + assert(itype[i-1]!=UJUMP&&itype[i-1]!=CJUMP&&itype[i-1]!=SJUMP&&itype[i-1]!=RJUMP&&itype[i-1]!=FJUMP); + store_regs_bt(regs[i-1].regmap,regs[i-1].is32,regs[i-1].dirty,start+i*4); + if(regs[i-1].regmap[HOST_CCREG]!=CCREG) + emit_loadreg(CCREG,HOST_CCREG); + emit_addimm(HOST_CCREG,CLOCK_DIVIDER*(ccadj[i-1]+1),HOST_CCREG); + add_to_linker((int)out,start+i*4,0); + emit_jmp(0); + } + + // TODO: delay slot stubs? + // Stubs + for(i=0;i %8x",link_addr[i][0],link_addr[i][1]); + literal_pool(64); + if(!link_addr[i][2]) + { + void *stub=out; + void *addr=check_addr(link_addr[i][1]); + emit_extjump(link_addr[i][0],link_addr[i][1]); + if(addr) { + set_jump_target(link_addr[i][0],(int)addr); + add_link(link_addr[i][1],stub); + } + else set_jump_target(link_addr[i][0],(int)stub); + } + else + { + // Internal branch + int target=(link_addr[i][1]-start)>>2; + assert(target>=0&&target>1); + //#else + set_jump_target(link_addr[i][0],instr_addr[target]); + //#endif + } + } + // External Branch Targets (jump_in) + if(copy+slen*4>(void *)shadow+sizeof(shadow)) copy=shadow; + for(i=0;i>12; + u_int vpage=page; + if(page>262143&&tlb_LUT_r[vaddr>>12]) page=(tlb_LUT_r[page^0x80000]^0x80000000)>>12; + if(page>2048) page=2048+(page&2047); + if(vpage>262143&&tlb_LUT_r[vaddr>>12]) vpage&=2047; // jump_dirty uses a hash of the virtual address instead + if(vpage>2048) vpage=2048+(vpage&2047); + literal_pool(256); + //if(!(is32[i]&(~unneeded_reg_upper[i])&~(1LL<>16)^vaddr)&0xFFFF]; + if(ht_bin[0]==vaddr) { + ht_bin[1]=entry_point; + } + if(ht_bin[2]==vaddr) { + ht_bin[3]=entry_point; + } + } + else + { + u_int r=requires_32bit[i]|!!(requires_32bit[i]>>32); + assem_debug("%8x (%d) <- %8x",instr_addr[i],i,start+i*4); + assem_debug("jump_in: %x (restricted - %x)",start+i*4,r); + //int entry_point=(int)out; + ////assem_debug("entry_point: %x",entry_point); + //load_regs_entry(i); + //if(entry_point==(int)out) + // entry_point=instr_addr[i]; + //else + // emit_jmp(instr_addr[i]); + //ll_add_32(jump_in+page,vaddr,r,(void *)entry_point); + ll_add_32(jump_dirty+vpage,vaddr,r,(void *)out); + int entry_point=do_dirty_stub(i); + ll_add_32(jump_in+page,vaddr,r,(void *)entry_point); + } + } + } + } + // Write out the literal pool if necessary + literal_pool(0); + #ifdef CORTEX_A8_BRANCH_PREDICTION_HACK + // Align code + if(((u_int)out)&7) emit_addnop(13); + #endif + assert((u_int)out-beginning (u_char *)(base_addr+(1<>12;i<=(start+slen*4)>>12;i++) { + invalid_code[i]=0; + memory_map[i]|=0x40000000; + if((signed int)start>=(signed int)0xC0000000) { + assert(using_tlb); + j=(((u_int)i<<12)+(memory_map[i]<<2)-(u_int)rdram+(u_int)0x80000000)>>12; + invalid_code[j]=0; + memory_map[j]|=0x40000000; + //DebugMessage(M64MSG_VERBOSE, "write protect physical page: %x (virtual %x)",j<<12,start); + } + } + + /* Pass 10 - Free memory by expiring oldest blocks */ + + int end=((((intptr_t)out-(intptr_t)base_addr)>>(TARGET_SIZE_2-16))+16384)&65535; + while(expirep!=end) + { + int shift=TARGET_SIZE_2-3; // Divide into 8 blocks + int base=(int)base_addr+((expirep>>13)<>11)&3) + { + case 0: + // Clear jump_in and jump_dirty + ll_remove_matching_addrs(jump_in+(expirep&2047),base,shift); + ll_remove_matching_addrs(jump_dirty+(expirep&2047),base,shift); + ll_remove_matching_addrs(jump_in+2048+(expirep&2047),base,shift); + ll_remove_matching_addrs(jump_dirty+2048+(expirep&2047),base,shift); + break; + case 1: + // Clear pointers + ll_kill_pointers(jump_out[expirep&2047],base,shift); + ll_kill_pointers(jump_out[(expirep&2047)+2048],base,shift); + break; + case 2: + // Clear hash table + for(i=0;i<32;i++) { + u_int *ht_bin=hash_table[((expirep&2047)<<5)+i]; + if((ht_bin[3]>>shift)==(base>>shift) || + ((ht_bin[3]-MAX_OUTPUT_BLOCK_SIZE)>>shift)==(base>>shift)) { + inv_debug("EXP: Remove hash %x -> %x\n",ht_bin[2],ht_bin[3]); + ht_bin[2]=ht_bin[3]=-1; + } + if((ht_bin[1]>>shift)==(base>>shift) || + ((ht_bin[1]-MAX_OUTPUT_BLOCK_SIZE)>>shift)==(base>>shift)) { + inv_debug("EXP: Remove hash %x -> %x\n",ht_bin[0],ht_bin[1]); + ht_bin[0]=ht_bin[2]; + ht_bin[1]=ht_bin[3]; + ht_bin[2]=ht_bin[3]=-1; + } + } + break; + case 3: + // Clear jump_out + #if NEW_DYNAREC == NEW_DYNAREC_ARM + if((expirep&2047)==0) + do_clear_cache(); + #endif + ll_remove_matching_addrs(jump_out+(expirep&2047),base,shift); + ll_remove_matching_addrs(jump_out+2048+(expirep&2047),base,shift); + break; + } + expirep=(expirep+1)&65535; + } + return 0; +} + +void TLBWI_new(void) +{ + unsigned int i; + /* Remove old entries */ + unsigned int old_start_even=tlb_e[Index&0x3F].start_even; + unsigned int old_end_even=tlb_e[Index&0x3F].end_even; + unsigned int old_start_odd=tlb_e[Index&0x3F].start_odd; + unsigned int old_end_odd=tlb_e[Index&0x3F].end_odd; + for (i=old_start_even>>12; i<=old_end_even>>12; i++) + { + if(i<0x80000||i>0xBFFFF) + { + invalidate_block(i); + memory_map[i]=-1; + } + } + for (i=old_start_odd>>12; i<=old_end_odd>>12; i++) + { + if(i<0x80000||i>0xBFFFF) + { + invalidate_block(i); + memory_map[i]=-1; + } + } + cached_interpreter_table.TLBWI(); + //DebugMessage(M64MSG_VERBOSE, "TLBWI: index=%d",Index); + //DebugMessage(M64MSG_VERBOSE, "TLBWI: start_even=%x end_even=%x phys_even=%x v=%d d=%d",tlb_e[Index&0x3F].start_even,tlb_e[Index&0x3F].end_even,tlb_e[Index&0x3F].phys_even,tlb_e[Index&0x3F].v_even,tlb_e[Index&0x3F].d_even); + //DebugMessage(M64MSG_VERBOSE, "TLBWI: start_odd=%x end_odd=%x phys_odd=%x v=%d d=%d",tlb_e[Index&0x3F].start_odd,tlb_e[Index&0x3F].end_odd,tlb_e[Index&0x3F].phys_odd,tlb_e[Index&0x3F].v_odd,tlb_e[Index&0x3F].d_odd); + /* Combine tlb_LUT_r, tlb_LUT_w, and invalid_code into a single table + for fast look up. */ + for (i=tlb_e[Index&0x3F].start_even>>12; i<=tlb_e[Index&0x3F].end_even>>12; i++) + { + //DebugMessage(M64MSG_VERBOSE, "%x: r:%8x w:%8x",i,tlb_LUT_r[i],tlb_LUT_w[i]); + if(i<0x80000||i>0xBFFFF) + { + if(tlb_LUT_r[i]) { + memory_map[i]=((tlb_LUT_r[i]&0xFFFFF000)-(i<<12)+(unsigned int)rdram-0x80000000)>>2; + // FIXME: should make sure the physical page is invalid too + if(!tlb_LUT_w[i]||!invalid_code[i]) { + memory_map[i]|=0x40000000; // Write protect + }else{ + assert(tlb_LUT_r[i]==tlb_LUT_w[i]); + } + if(!using_tlb) DebugMessage(M64MSG_VERBOSE, "Enabled TLB"); + // Tell the dynamic recompiler to generate tlb lookup code + using_tlb=1; + } + else memory_map[i]=-1; + } + //DebugMessage(M64MSG_VERBOSE, "memory_map[%x]: %8x (+%8x)",i,memory_map[i],memory_map[i]<<2); + } + for (i=tlb_e[Index&0x3F].start_odd>>12; i<=tlb_e[Index&0x3F].end_odd>>12; i++) + { + //DebugMessage(M64MSG_VERBOSE, "%x: r:%8x w:%8x",i,tlb_LUT_r[i],tlb_LUT_w[i]); + if(i<0x80000||i>0xBFFFF) + { + if(tlb_LUT_r[i]) { + memory_map[i]=((tlb_LUT_r[i]&0xFFFFF000)-(i<<12)+(unsigned int)rdram-0x80000000)>>2; + // FIXME: should make sure the physical page is invalid too + if(!tlb_LUT_w[i]||!invalid_code[i]) { + memory_map[i]|=0x40000000; // Write protect + }else{ + assert(tlb_LUT_r[i]==tlb_LUT_w[i]); + } + if(!using_tlb) DebugMessage(M64MSG_VERBOSE, "Enabled TLB"); + // Tell the dynamic recompiler to generate tlb lookup code + using_tlb=1; + } + else memory_map[i]=-1; + } + //DebugMessage(M64MSG_VERBOSE, "memory_map[%x]: %8x (+%8x)",i,memory_map[i],memory_map[i]<<2); + } +} + +void TLBWR_new(void) +{ + unsigned int i; + Random = (Count/2 % (32 - Wired)) + Wired; + /* Remove old entries */ + unsigned int old_start_even=tlb_e[Random&0x3F].start_even; + unsigned int old_end_even=tlb_e[Random&0x3F].end_even; + unsigned int old_start_odd=tlb_e[Random&0x3F].start_odd; + unsigned int old_end_odd=tlb_e[Random&0x3F].end_odd; + for (i=old_start_even>>12; i<=old_end_even>>12; i++) + { + if(i<0x80000||i>0xBFFFF) + { + invalidate_block(i); + memory_map[i]=-1; + } + } + for (i=old_start_odd>>12; i<=old_end_odd>>12; i++) + { + if(i<0x80000||i>0xBFFFF) + { + invalidate_block(i); + memory_map[i]=-1; + } + } + cached_interpreter_table.TLBWR(); + /* Combine tlb_LUT_r, tlb_LUT_w, and invalid_code into a single table + for fast look up. */ + for (i=tlb_e[Random&0x3F].start_even>>12; i<=tlb_e[Random&0x3F].end_even>>12; i++) + { + //DebugMessage(M64MSG_VERBOSE, "%x: r:%8x w:%8x",i,tlb_LUT_r[i],tlb_LUT_w[i]); + if(i<0x80000||i>0xBFFFF) + { + if(tlb_LUT_r[i]) { + memory_map[i]=((tlb_LUT_r[i]&0xFFFFF000)-(i<<12)+(unsigned int)rdram-0x80000000)>>2; + // FIXME: should make sure the physical page is invalid too + if(!tlb_LUT_w[i]||!invalid_code[i]) { + memory_map[i]|=0x40000000; // Write protect + }else{ + assert(tlb_LUT_r[i]==tlb_LUT_w[i]); + } + if(!using_tlb) DebugMessage(M64MSG_VERBOSE, "Enabled TLB"); + // Tell the dynamic recompiler to generate tlb lookup code + using_tlb=1; + } + else memory_map[i]=-1; + } + //DebugMessage(M64MSG_VERBOSE, "memory_map[%x]: %8x (+%8x)",i,memory_map[i],memory_map[i]<<2); + } + for (i=tlb_e[Random&0x3F].start_odd>>12; i<=tlb_e[Random&0x3F].end_odd>>12; i++) + { + //DebugMessage(M64MSG_VERBOSE, "%x: r:%8x w:%8x",i,tlb_LUT_r[i],tlb_LUT_w[i]); + if(i<0x80000||i>0xBFFFF) + { + if(tlb_LUT_r[i]) { + memory_map[i]=((tlb_LUT_r[i]&0xFFFFF000)-(i<<12)+(unsigned int)rdram-0x80000000)>>2; + // FIXME: should make sure the physical page is invalid too + if(!tlb_LUT_w[i]||!invalid_code[i]) { + memory_map[i]|=0x40000000; // Write protect + }else{ + assert(tlb_LUT_r[i]==tlb_LUT_w[i]); + } + if(!using_tlb) DebugMessage(M64MSG_VERBOSE, "Enabled TLB"); + // Tell the dynamic recompiler to generate tlb lookup code + using_tlb=1; + } + else memory_map[i]=-1; + } + //DebugMessage(M64MSG_VERBOSE, "memory_map[%x]: %8x (+%8x)",i,memory_map[i],memory_map[i]<<2); + } +} diff --git a/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/new_dynarec.h b/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/new_dynarec.h new file mode 100644 index 0000000000..8103920ecd --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/new_dynarec/new_dynarec.h @@ -0,0 +1,38 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - new_dynarec.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef NEW_DYNAREC_H +#define NEW_DYNAREC_H + +#define NEW_DYNAREC_X86 1 +#define NEW_DYNAREC_AMD64 2 +#define NEW_DYNAREC_ARM 3 + +extern int pcaddr; +extern int pending_exception; + +void invalidate_all_pages(void); +void invalidate_block(unsigned int block); +void new_dynarec_init(void); +void new_dyna_start(void); +void new_dynarec_cleanup(void); + +#endif /* NEW_DYNAREC_H */ diff --git a/libmupen64plus/mupen64plus-core/src/r4300/ops.h b/libmupen64plus/mupen64plus-core/src/r4300/ops.h new file mode 100644 index 0000000000..b63a7ad933 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/ops.h @@ -0,0 +1,322 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - ops.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +typedef struct _cpu_instruction_table +{ + /* All jump/branch instructions (except JR and JALR) have three versions: + * - JUMPNAME() which for jumps inside the current block. + * - JUMPNAME_OUT() which jumps outside the current block. + * - JUMPNAME_IDLE() which does busy wait optimization. + * + * Busy wait optimization is used when a jump jumps to itself, + * and the instruction on the delay slot is a NOP. + * The program is waiting for the next interrupt, so we can just + * increase Count until the point where the next interrupt happens. */ + + // Load and store instructions + void (*LB)(void); + void (*LBU)(void); + void (*LH)(void); + void (*LHU)(void); + void (*LW)(void); + void (*LWL)(void); + void (*LWR)(void); + void (*SB)(void); + void (*SH)(void); + void (*SW)(void); + void (*SWL)(void); + void (*SWR)(void); + + void (*LD)(void); + void (*LDL)(void); + void (*LDR)(void); + void (*LL)(void); + void (*LWU)(void); + void (*SC)(void); + void (*SD)(void); + void (*SDL)(void); + void (*SDR)(void); + void (*SYNC)(void); + + // Arithmetic instructions (ALU immediate) + void (*ADDI)(void); + void (*ADDIU)(void); + void (*SLTI)(void); + void (*SLTIU)(void); + void (*ANDI)(void); + void (*ORI)(void); + void (*XORI)(void); + void (*LUI)(void); + + void (*DADDI)(void); + void (*DADDIU)(void); + + // Arithmetic instructions (3-operand) + void (*ADD)(void); + void (*ADDU)(void); + void (*SUB)(void); + void (*SUBU)(void); + void (*SLT)(void); + void (*SLTU)(void); + void (*AND)(void); + void (*OR)(void); + void (*XOR)(void); + void (*NOR)(void); + + void (*DADD)(void); + void (*DADDU)(void); + void (*DSUB)(void); + void (*DSUBU)(void); + + // Multiply and divide instructions + void (*MULT)(void); + void (*MULTU)(void); + void (*DIV)(void); + void (*DIVU)(void); + void (*MFHI)(void); + void (*MTHI)(void); + void (*MFLO)(void); + void (*MTLO)(void); + + void (*DMULT)(void); + void (*DMULTU)(void); + void (*DDIV)(void); + void (*DDIVU)(void); + + // Jump and branch instructions + void (*J)(void); + void (*J_OUT)(void); + void (*J_IDLE)(void); + void (*JAL)(void); + void (*JAL_OUT)(void); + void (*JAL_IDLE)(void); + void (*JR)(void); + void (*JALR)(void); + void (*BEQ)(void); + void (*BEQ_OUT)(void); + void (*BEQ_IDLE)(void); + void (*BNE)(void); + void (*BNE_OUT)(void); + void (*BNE_IDLE)(void); + void (*BLEZ)(void); + void (*BLEZ_OUT)(void); + void (*BLEZ_IDLE)(void); + void (*BGTZ)(void); + void (*BGTZ_OUT)(void); + void (*BGTZ_IDLE)(void); + void (*BLTZ)(void); + void (*BLTZ_OUT)(void); + void (*BLTZ_IDLE)(void); + void (*BGEZ)(void); + void (*BGEZ_OUT)(void); + void (*BGEZ_IDLE)(void); + void (*BLTZAL)(void); + void (*BLTZAL_OUT)(void); + void (*BLTZAL_IDLE)(void); + void (*BGEZAL)(void); + void (*BGEZAL_OUT)(void); + void (*BGEZAL_IDLE)(void); + + void (*BEQL)(void); + void (*BEQL_OUT)(void); + void (*BEQL_IDLE)(void); + void (*BNEL)(void); + void (*BNEL_OUT)(void); + void (*BNEL_IDLE)(void); + void (*BLEZL)(void); + void (*BLEZL_OUT)(void); + void (*BLEZL_IDLE)(void); + void (*BGTZL)(void); + void (*BGTZL_OUT)(void); + void (*BGTZL_IDLE)(void); + void (*BLTZL)(void); + void (*BLTZL_OUT)(void); + void (*BLTZL_IDLE)(void); + void (*BGEZL)(void); + void (*BGEZL_OUT)(void); + void (*BGEZL_IDLE)(void); + void (*BLTZALL)(void); + void (*BLTZALL_OUT)(void); + void (*BLTZALL_IDLE)(void); + void (*BGEZALL)(void); + void (*BGEZALL_OUT)(void); + void (*BGEZALL_IDLE)(void); + void (*BC1TL)(void); + void (*BC1TL_OUT)(void); + void (*BC1TL_IDLE)(void); + void (*BC1FL)(void); + void (*BC1FL_OUT)(void); + void (*BC1FL_IDLE)(void); + + // Shift instructions + void (*SLL)(void); + void (*SRL)(void); + void (*SRA)(void); + void (*SLLV)(void); + void (*SRLV)(void); + void (*SRAV)(void); + + void (*DSLL)(void); + void (*DSRL)(void); + void (*DSRA)(void); + void (*DSLLV)(void); + void (*DSRLV)(void); + void (*DSRAV)(void); + void (*DSLL32)(void); + void (*DSRL32)(void); + void (*DSRA32)(void); + + // COP0 instructions + void (*MTC0)(void); + void (*MFC0)(void); + + void (*TLBR)(void); + void (*TLBWI)(void); + void (*TLBWR)(void); + void (*TLBP)(void); + void (*CACHE)(void); + void (*ERET)(void); + + // COP1 instructions + void (*LWC1)(void); + void (*SWC1)(void); + void (*MTC1)(void); + void (*MFC1)(void); + void (*CTC1)(void); + void (*CFC1)(void); + void (*BC1T)(void); + void (*BC1T_OUT)(void); + void (*BC1T_IDLE)(void); + void (*BC1F)(void); + void (*BC1F_OUT)(void); + void (*BC1F_IDLE)(void); + + void (*DMFC1)(void); + void (*DMTC1)(void); + void (*LDC1)(void); + void (*SDC1)(void); + + void (*CVT_S_D)(void); + void (*CVT_S_W)(void); + void (*CVT_S_L)(void); + void (*CVT_D_S)(void); + void (*CVT_D_W)(void); + void (*CVT_D_L)(void); + void (*CVT_W_S)(void); + void (*CVT_W_D)(void); + void (*CVT_L_S)(void); + void (*CVT_L_D)(void); + + void (*ROUND_W_S)(void); + void (*ROUND_W_D)(void); + void (*ROUND_L_S)(void); + void (*ROUND_L_D)(void); + + void (*TRUNC_W_S)(void); + void (*TRUNC_W_D)(void); + void (*TRUNC_L_S)(void); + void (*TRUNC_L_D)(void); + + void (*CEIL_W_S)(void); + void (*CEIL_W_D)(void); + void (*CEIL_L_S)(void); + void (*CEIL_L_D)(void); + + void (*FLOOR_W_S)(void); + void (*FLOOR_W_D)(void); + void (*FLOOR_L_S)(void); + void (*FLOOR_L_D)(void); + + void (*ADD_S)(void); + void (*ADD_D)(void); + + void (*SUB_S)(void); + void (*SUB_D)(void); + + void (*MUL_S)(void); + void (*MUL_D)(void); + + void (*DIV_S)(void); + void (*DIV_D)(void); + + void (*ABS_S)(void); + void (*ABS_D)(void); + + void (*MOV_S)(void); + void (*MOV_D)(void); + + void (*NEG_S)(void); + void (*NEG_D)(void); + + void (*SQRT_S)(void); + void (*SQRT_D)(void); + + void (*C_F_S)(void); + void (*C_F_D)(void); + void (*C_UN_S)(void); + void (*C_UN_D)(void); + void (*C_EQ_S)(void); + void (*C_EQ_D)(void); + void (*C_UEQ_S)(void); + void (*C_UEQ_D)(void); + void (*C_OLT_S)(void); + void (*C_OLT_D)(void); + void (*C_ULT_S)(void); + void (*C_ULT_D)(void); + void (*C_OLE_S)(void); + void (*C_OLE_D)(void); + void (*C_ULE_S)(void); + void (*C_ULE_D)(void); + void (*C_SF_S)(void); + void (*C_SF_D)(void); + void (*C_NGLE_S)(void); + void (*C_NGLE_D)(void); + void (*C_SEQ_S)(void); + void (*C_SEQ_D)(void); + void (*C_NGL_S)(void); + void (*C_NGL_D)(void); + void (*C_LT_S)(void); + void (*C_LT_D)(void); + void (*C_NGE_S)(void); + void (*C_NGE_D)(void); + void (*C_LE_S)(void); + void (*C_LE_D)(void); + void (*C_NGT_S)(void); + void (*C_NGT_D)(void); + + // Special instructions + void (*SYSCALL)(void); + + // Exception instructions + void (*TEQ)(void); + + // Emulator helper functions + void (*NOP)(void); // No operation (used to nullify R0 writes) + void (*RESERVED)(void); // Reserved instruction handler + void (*NI)(void); // Not implemented instruction handler + + void (*FIN_BLOCK)(void); // Handler for the end of a block + void (*NOTCOMPILED)(void); // Handler for not yet compiled code + void (*NOTCOMPILED2)(void); // TODOXXX +} cpu_instruction_table; + +extern const cpu_instruction_table cached_interpreter_table; +extern cpu_instruction_table current_instruction_table; diff --git a/libmupen64plus/mupen64plus-core/src/r4300/profile.c b/libmupen64plus/mupen64plus-core/src/r4300/profile.c new file mode 100644 index 0000000000..e73c2512ec --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/profile.c @@ -0,0 +1,100 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - profile.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2012 CasualJames * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifdef PROFILE +#include "r4300.h" + +#include "api/m64p_types.h" +#include "api/callbacks.h" + +static long long int time_in_section[5]; +static long long int last_start[5]; + +#if defined(WIN32) && !defined(__MINGW32__) + // timing + #include + static long long int get_time(void) + { + LARGE_INTEGER counter; + QueryPerformanceCounter(&counter); + return counter.QuadPart; + } + static long long int time_to_nsec(long long int time) + { + static LARGE_INTEGER freq = { 0 }; + if (freq.QuadPart == 0) + QueryPerformanceFrequency(&freq); + return time * 1000000000 / freq.QuadPart; + } + +#else /* Not WIN32 */ + // timing + #include + static long long int get_time(void) + { + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + return (long long int)ts.tv_sec * 1000000000 + ts.tv_nsec; + } + static long long int time_to_nsec(long long int time) + { + return time; + } +#endif + +void start_section(int section_type) +{ + last_start[section_type] = get_time(); +} + +void end_section(int section_type) +{ + long long int end = get_time(); + time_in_section[section_type] += end - last_start[section_type]; +} + +void refresh_stat() +{ + long long int curr_time = get_time(); + if(time_to_nsec(curr_time - last_start[ALL_SECTION]) >= 2000000000) + { + time_in_section[ALL_SECTION] = curr_time - last_start[ALL_SECTION]; + DebugMessage(M64MSG_INFO, "gfx=%f%% - audio=%f%% - compiler=%f%%, idle=%f%%", + 100.0 * (double)time_in_section[GFX_SECTION] / time_in_section[ALL_SECTION], + 100.0 * (double)time_in_section[AUDIO_SECTION] / time_in_section[ALL_SECTION], + 100.0 * (double)time_in_section[COMPILER_SECTION] / time_in_section[ALL_SECTION], + 100.0 * (double)time_in_section[IDLE_SECTION] / time_in_section[ALL_SECTION]); + DebugMessage(M64MSG_INFO, "gfx=%llins - audio=%llins - compiler %llins - idle=%llins", + time_to_nsec(time_in_section[GFX_SECTION]), + time_to_nsec(time_in_section[AUDIO_SECTION]), + time_to_nsec(time_in_section[COMPILER_SECTION]), + time_to_nsec(time_in_section[IDLE_SECTION])); + time_in_section[GFX_SECTION] = 0; + time_in_section[AUDIO_SECTION] = 0; + time_in_section[COMPILER_SECTION] = 0; + time_in_section[IDLE_SECTION] = 0; + last_start[ALL_SECTION] = curr_time; + } +} + +#endif + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/pure_interp.c b/libmupen64plus/mupen64plus-core/src/r4300/pure_interp.c new file mode 100644 index 0000000000..32083b7e63 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/pure_interp.c @@ -0,0 +1,424 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - pure_interp.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include + +#include "api/m64p_types.h" +#include "api/callbacks.h" +#include "api/debugger.h" +#include "memory/memory.h" +#include "main/rom.h" +#include "osal/preproc.h" + +#include "r4300.h" +#include "ops.h" +#include "exception.h" +#include "macros.h" +#include "interupt.h" + +#ifdef DBG +#include "debugger/dbg_types.h" +#include "debugger/debugger.h" +#endif + +static precomp_instr interp_PC; +unsigned int op; + +static void prefetch(void); + +#define PCADDR interp_PC.addr +#define ADD_TO_PC(x) interp_PC.addr += x*4; +#define DECLARE_INSTRUCTION(name) static void name(void) +#define DECLARE_JUMP(name, destination, condition, link, likely, cop1) \ + static void name(void) \ + { \ + const int take_jump = (condition); \ + const unsigned int jump_target = (destination); \ + long long int *link_register = (link); \ + if (cop1 && check_cop1_unusable()) return; \ + if (!likely || take_jump) \ + { \ + interp_PC.addr += 4; \ + delay_slot=1; \ + prefetch(); \ + PC->ops(); \ + update_count(); \ + delay_slot=0; \ + if (take_jump && !skip_jump) \ + { \ + if (link_register != ®[0]) \ + { \ + *link_register=interp_PC.addr; \ + sign_extended(*link_register); \ + } \ + interp_PC.addr = jump_target; \ + } \ + } \ + else \ + { \ + interp_PC.addr += 8; \ + update_count(); \ + } \ + last_addr = interp_PC.addr; \ + if (next_interupt <= Count) gen_interupt(); \ + } \ + static void name##_IDLE(void) \ + { \ + const int take_jump = (condition); \ + int skip; \ + if (cop1 && check_cop1_unusable()) return; \ + if (take_jump) \ + { \ + update_count(); \ + skip = next_interupt - Count; \ + if (skip > 3) Count += (skip & 0xFFFFFFFC); \ + else name(); \ + } \ + else name(); \ + } +#define CHECK_MEMORY(x) + +#include "interpreter.def" + +// two functions are defined from the macros above but never used +// these prototype declarations will prevent a warning +#if defined(__GNUC__) + void JR_IDLE(void) __attribute__((used)); + void JALR_IDLE(void) __attribute__((used)); +#endif + +static cpu_instruction_table pure_interpreter_table = { + LB, + LBU, + LH, + LHU, + LW, + LWL, + LWR, + SB, + SH, + SW, + SWL, + SWR, + + LD, + LDL, + LDR, + LL, + LWU, + SC, + SD, + SDL, + SDR, + SYNC, + + ADDI, + ADDIU, + SLTI, + SLTIU, + ANDI, + ORI, + XORI, + LUI, + + DADDI, + DADDIU, + + ADD, + ADDU, + SUB, + SUBU, + SLT, + SLTU, + AND, + OR, + XOR, + NOR, + + DADD, + DADDU, + DSUB, + DSUBU, + + MULT, + MULTU, + DIV, + DIVU, + MFHI, + MTHI, + MFLO, + MTLO, + + DMULT, + DMULTU, + DDIV, + DDIVU, + + J, + J, // _OUT (unused) + J_IDLE, + JAL, + JAL, // _OUT (unused) + JAL_IDLE, + JR, + JALR, + BEQ, + BEQ, // _OUT (unused) + BEQ_IDLE, + BNE, + BNE, // _OUT (unused) + BNE_IDLE, + BLEZ, + BLEZ, // _OUT (unused) + BLEZ_IDLE, + BGTZ, + BGTZ, // _OUT (unused) + BGTZ_IDLE, + BLTZ, + BLTZ, // _OUT (unused) + BLTZ_IDLE, + BGEZ, + BGEZ, // _OUT (unused) + BGEZ_IDLE, + BLTZAL, + BLTZAL, // _OUT (unused) + BLTZAL_IDLE, + BGEZAL, + BGEZAL, // _OUT (unused) + BGEZAL_IDLE, + + BEQL, + BEQL, // _OUT (unused) + BEQL_IDLE, + BNEL, + BNEL, // _OUT (unused) + BNEL_IDLE, + BLEZL, + BLEZL, // _OUT (unused) + BLEZL_IDLE, + BGTZL, + BGTZL, // _OUT (unused) + BGTZL_IDLE, + BLTZL, + BLTZL, // _OUT (unused) + BLTZL_IDLE, + BGEZL, + BGEZL, // _OUT (unused) + BGEZL_IDLE, + BLTZALL, + BLTZALL, // _OUT (unused) + BLTZALL_IDLE, + BGEZALL, + BGEZALL, // _OUT (unused) + BGEZALL_IDLE, + BC1TL, + BC1TL, // _OUT (unused) + BC1TL_IDLE, + BC1FL, + BC1FL, // _OUT (unused) + BC1FL_IDLE, + + SLL, + SRL, + SRA, + SLLV, + SRLV, + SRAV, + + DSLL, + DSRL, + DSRA, + DSLLV, + DSRLV, + DSRAV, + DSLL32, + DSRL32, + DSRA32, + + MTC0, + MFC0, + + TLBR, + TLBWI, + TLBWR, + TLBP, + CACHE, + ERET, + + LWC1, + SWC1, + MTC1, + MFC1, + CTC1, + CFC1, + BC1T, + BC1T, // _OUT (unused) + BC1T_IDLE, + BC1F, + BC1F, // _OUT (unused) + BC1F_IDLE, + + DMFC1, + DMTC1, + LDC1, + SDC1, + + CVT_S_D, + CVT_S_W, + CVT_S_L, + CVT_D_S, + CVT_D_W, + CVT_D_L, + CVT_W_S, + CVT_W_D, + CVT_L_S, + CVT_L_D, + + ROUND_W_S, + ROUND_W_D, + ROUND_L_S, + ROUND_L_D, + + TRUNC_W_S, + TRUNC_W_D, + TRUNC_L_S, + TRUNC_L_D, + + CEIL_W_S, + CEIL_W_D, + CEIL_L_S, + CEIL_L_D, + + FLOOR_W_S, + FLOOR_W_D, + FLOOR_L_S, + FLOOR_L_D, + + ADD_S, + ADD_D, + + SUB_S, + SUB_D, + + MUL_S, + MUL_D, + + DIV_S, + DIV_D, + + ABS_S, + ABS_D, + + MOV_S, + MOV_D, + + NEG_S, + NEG_D, + + SQRT_S, + SQRT_D, + + C_F_S, + C_F_D, + C_UN_S, + C_UN_D, + C_EQ_S, + C_EQ_D, + C_UEQ_S, + C_UEQ_D, + C_OLT_S, + C_OLT_D, + C_ULT_S, + C_ULT_D, + C_OLE_S, + C_OLE_D, + C_ULE_S, + C_ULE_D, + C_SF_S, + C_SF_D, + C_NGLE_S, + C_NGLE_D, + C_SEQ_S, + C_SEQ_D, + C_NGL_S, + C_NGL_D, + C_LT_S, + C_LT_D, + C_NGE_S, + C_NGE_D, + C_LE_S, + C_LE_D, + C_NGT_S, + C_NGT_D, + + SYSCALL, + + TEQ, + + NOP, + RESERVED, + NI, + + NULL, // FIN_BLOCK + NULL, // NOTCOMPILED + NULL, // NOTCOMPILED2 +}; + +static void prefetch(void) +{ + unsigned int *mem = fast_mem_access(interp_PC.addr); + if (mem != NULL) + { + prefetch_opcode(mem[0], mem[1]); + } + else + { + DebugMessage(M64MSG_ERROR, "prefetch() execute address :%x", PC->addr); + stop=1; + } +} + +void pure_interpreter(void) +{ + stop=0; + PC = &interp_PC; + PC->addr = last_addr = 0xa4000040; + +/*#ifdef DBG + if (g_DebuggerActive) + update_debugger(PC->addr); +#endif*/ + + current_instruction_table = pure_interpreter_table; + + while (!stop) + { + prefetch(); +#ifdef COMPARE_CORE + CoreCompareCallback(); +#endif +#ifdef DBG + if (g_DebuggerActive) update_debugger(PC->addr); +#endif + PC->ops(); + } +} diff --git a/libmupen64plus/mupen64plus-core/src/r4300/r4300.c b/libmupen64plus/mupen64plus-core/src/r4300/r4300.c new file mode 100644 index 0000000000..9a64fdb480 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/r4300.c @@ -0,0 +1,1100 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - r4300.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include + +#include "api/m64p_types.h" +#include "api/callbacks.h" +#include "api/debugger.h" +#include "memory/memory.h" +#include "main/main.h" +#include "main/rom.h" + +#include "r4300.h" +#include "ops.h" +#include "exception.h" +#include "interupt.h" +#include "macros.h" +#include "recomp.h" +#include "recomph.h" +#include "new_dynarec/new_dynarec.h" + +#ifdef DBG +#include "debugger/dbg_types.h" +#include "debugger/debugger.h" +#endif + +unsigned int r4300emu = 0; +int no_compiled_jump = 0; +int llbit, rompause; +#if NEW_DYNAREC != NEW_DYNAREC_ARM +int stop; +long long int reg[32], hi, lo; +unsigned int reg_cop0[32]; +float *reg_cop1_simple[32]; +double *reg_cop1_double[32]; +int FCR0, FCR31; +unsigned int next_interupt; +precomp_instr *PC; +#endif +long long int local_rs; +long long int reg_cop1_fgr_64[32]; +tlb tlb_e[32]; +unsigned int delay_slot, skip_jump = 0, dyna_interp = 0, last_addr; +unsigned long long int debug_count = 0; +unsigned int CIC_Chip; +char invalid_code[0x100000]; + +precomp_block *blocks[0x100000], *actual; +int rounding_mode = 0x33F, trunc_mode = 0xF3F, round_mode = 0x33F, + ceil_mode = 0xB3F, floor_mode = 0x73F; + +// ----------------------------------------------------------- +// Cached interpreter functions (and fallback for dynarec). +// ----------------------------------------------------------- +#ifdef DBG +#define UPDATE_DEBUGGER() if (g_DebuggerActive) update_debugger(PC->addr) +#else +#define UPDATE_DEBUGGER() do { } while(0) +#endif + +#define PCADDR PC->addr +#define ADD_TO_PC(x) PC += x; +#define DECLARE_INSTRUCTION(name) static void name(void) + +#define DECLARE_JUMP(name, destination, condition, link, likely, cop1) \ + static void name(void) \ + { \ + const int take_jump = (condition); \ + const unsigned int jump_target = (destination); \ + long long int *link_register = (link); \ + if (cop1 && check_cop1_unusable()) return; \ + if (!likely || take_jump) \ + { \ + PC++; \ + delay_slot=1; \ + UPDATE_DEBUGGER(); \ + PC->ops(); \ + update_count(); \ + delay_slot=0; \ + if (take_jump && !skip_jump) \ + { \ + if (link_register != ®[0]) \ + { \ + *link_register=PC->addr; \ + sign_extended(*link_register); \ + } \ + PC=actual->block+((jump_target-actual->start)>>2); \ + } \ + } \ + else \ + { \ + PC += 2; \ + update_count(); \ + } \ + last_addr = PC->addr; \ + if (next_interupt <= Count) gen_interupt(); \ + } \ + static void name##_OUT(void) \ + { \ + const int take_jump = (condition); \ + const unsigned int jump_target = (destination); \ + long long int *link_register = (link); \ + if (cop1 && check_cop1_unusable()) return; \ + if (!likely || take_jump) \ + { \ + PC++; \ + delay_slot=1; \ + UPDATE_DEBUGGER(); \ + PC->ops(); \ + update_count(); \ + delay_slot=0; \ + if (take_jump && !skip_jump) \ + { \ + if (link_register != ®[0]) \ + { \ + *link_register=PC->addr; \ + sign_extended(*link_register); \ + } \ + jump_to(jump_target); \ + } \ + } \ + else \ + { \ + PC += 2; \ + update_count(); \ + } \ + last_addr = PC->addr; \ + if (next_interupt <= Count) gen_interupt(); \ + } \ + static void name##_IDLE(void) \ + { \ + const int take_jump = (condition); \ + int skip; \ + if (cop1 && check_cop1_unusable()) return; \ + if (take_jump) \ + { \ + update_count(); \ + skip = next_interupt - Count; \ + if (skip > 3) Count += (skip & 0xFFFFFFFC); \ + else name(); \ + } \ + else name(); \ + } + +#define CHECK_MEMORY() \ + if (!invalid_code[address>>12]) \ + if (blocks[address>>12]->block[(address&0xFFF)/4].ops != \ + current_instruction_table.NOTCOMPILED) \ + invalid_code[address>>12] = 1; + +#include "interpreter.def" + +// two functions are defined from the macros above but never used +// these prototype declarations will prevent a warning +#if defined(__GNUC__) + void JR_IDLE(void) __attribute__((used)); + void JALR_IDLE(void) __attribute__((used)); +#endif + +// ----------------------------------------------------------- +// Flow control 'fake' instructions +// ----------------------------------------------------------- +static void FIN_BLOCK(void) +{ + if (!delay_slot) + { + jump_to((PC-1)->addr+4); +/*#ifdef DBG + if (g_DebuggerActive) update_debugger(PC->addr); +#endif +Used by dynarec only, check should be unnecessary +*/ + PC->ops(); + if (r4300emu == CORE_DYNAREC) dyna_jump(); + } + else + { + precomp_block *blk = actual; + precomp_instr *inst = PC; + jump_to((PC-1)->addr+4); + +/*#ifdef DBG + if (g_DebuggerActive) update_debugger(PC->addr); +#endif +Used by dynarec only, check should be unnecessary +*/ + if (!skip_jump) + { + PC->ops(); + actual = blk; + PC = inst+1; + } + else + PC->ops(); + + if (r4300emu == CORE_DYNAREC) dyna_jump(); + } +} + +static void NOTCOMPILED(void) +{ + unsigned int *mem = fast_mem_access(blocks[PC->addr>>12]->start); +#ifdef CORE_DBG + DebugMessage(M64MSG_INFO, "NOTCOMPILED: addr = %x ops = %lx", PC->addr, (long) PC->ops); +#endif + + if (mem != NULL) + recompile_block((int *)mem, blocks[PC->addr >> 12], PC->addr); + else + DebugMessage(M64MSG_ERROR, "not compiled exception"); + +/*#ifdef DBG + if (g_DebuggerActive) update_debugger(PC->addr); +#endif +The preceeding update_debugger SHOULD be unnecessary since it should have been +called before NOTCOMPILED would have been executed +*/ + PC->ops(); + if (r4300emu == CORE_DYNAREC) + dyna_jump(); +} + +static void NOTCOMPILED2(void) +{ + NOTCOMPILED(); +} + +// ----------------------------------------------------------- +// Cached interpreter instruction table +// ----------------------------------------------------------- +const cpu_instruction_table cached_interpreter_table = { + LB, + LBU, + LH, + LHU, + LW, + LWL, + LWR, + SB, + SH, + SW, + SWL, + SWR, + + LD, + LDL, + LDR, + LL, + LWU, + SC, + SD, + SDL, + SDR, + SYNC, + + ADDI, + ADDIU, + SLTI, + SLTIU, + ANDI, + ORI, + XORI, + LUI, + + DADDI, + DADDIU, + + ADD, + ADDU, + SUB, + SUBU, + SLT, + SLTU, + AND, + OR, + XOR, + NOR, + + DADD, + DADDU, + DSUB, + DSUBU, + + MULT, + MULTU, + DIV, + DIVU, + MFHI, + MTHI, + MFLO, + MTLO, + + DMULT, + DMULTU, + DDIV, + DDIVU, + + J, + J_OUT, + J_IDLE, + JAL, + JAL_OUT, + JAL_IDLE, + // Use the _OUT versions of JR and JALR, since we don't know + // until runtime if they're going to jump inside or outside the block + JR_OUT, + JALR_OUT, + BEQ, + BEQ_OUT, + BEQ_IDLE, + BNE, + BNE_OUT, + BNE_IDLE, + BLEZ, + BLEZ_OUT, + BLEZ_IDLE, + BGTZ, + BGTZ_OUT, + BGTZ_IDLE, + BLTZ, + BLTZ_OUT, + BLTZ_IDLE, + BGEZ, + BGEZ_OUT, + BGEZ_IDLE, + BLTZAL, + BLTZAL_OUT, + BLTZAL_IDLE, + BGEZAL, + BGEZAL_OUT, + BGEZAL_IDLE, + + BEQL, + BEQL_OUT, + BEQL_IDLE, + BNEL, + BNEL_OUT, + BNEL_IDLE, + BLEZL, + BLEZL_OUT, + BLEZL_IDLE, + BGTZL, + BGTZL_OUT, + BGTZL_IDLE, + BLTZL, + BLTZL_OUT, + BLTZL_IDLE, + BGEZL, + BGEZL_OUT, + BGEZL_IDLE, + BLTZALL, + BLTZALL_OUT, + BLTZALL_IDLE, + BGEZALL, + BGEZALL_OUT, + BGEZALL_IDLE, + BC1TL, + BC1TL_OUT, + BC1TL_IDLE, + BC1FL, + BC1FL_OUT, + BC1FL_IDLE, + + SLL, + SRL, + SRA, + SLLV, + SRLV, + SRAV, + + DSLL, + DSRL, + DSRA, + DSLLV, + DSRLV, + DSRAV, + DSLL32, + DSRL32, + DSRA32, + + MTC0, + MFC0, + + TLBR, + TLBWI, + TLBWR, + TLBP, + CACHE, + ERET, + + LWC1, + SWC1, + MTC1, + MFC1, + CTC1, + CFC1, + BC1T, + BC1T_OUT, + BC1T_IDLE, + BC1F, + BC1F_OUT, + BC1F_IDLE, + + DMFC1, + DMTC1, + LDC1, + SDC1, + + CVT_S_D, + CVT_S_W, + CVT_S_L, + CVT_D_S, + CVT_D_W, + CVT_D_L, + CVT_W_S, + CVT_W_D, + CVT_L_S, + CVT_L_D, + + ROUND_W_S, + ROUND_W_D, + ROUND_L_S, + ROUND_L_D, + + TRUNC_W_S, + TRUNC_W_D, + TRUNC_L_S, + TRUNC_L_D, + + CEIL_W_S, + CEIL_W_D, + CEIL_L_S, + CEIL_L_D, + + FLOOR_W_S, + FLOOR_W_D, + FLOOR_L_S, + FLOOR_L_D, + + ADD_S, + ADD_D, + + SUB_S, + SUB_D, + + MUL_S, + MUL_D, + + DIV_S, + DIV_D, + + ABS_S, + ABS_D, + + MOV_S, + MOV_D, + + NEG_S, + NEG_D, + + SQRT_S, + SQRT_D, + + C_F_S, + C_F_D, + C_UN_S, + C_UN_D, + C_EQ_S, + C_EQ_D, + C_UEQ_S, + C_UEQ_D, + C_OLT_S, + C_OLT_D, + C_ULT_S, + C_ULT_D, + C_OLE_S, + C_OLE_D, + C_ULE_S, + C_ULE_D, + C_SF_S, + C_SF_D, + C_NGLE_S, + C_NGLE_D, + C_SEQ_S, + C_SEQ_D, + C_NGL_S, + C_NGL_D, + C_LT_S, + C_LT_D, + C_NGE_S, + C_NGE_D, + C_LE_S, + C_LE_D, + C_NGT_S, + C_NGT_D, + + SYSCALL, + + TEQ, + + NOP, + RESERVED, + NI, + + FIN_BLOCK, + NOTCOMPILED, + NOTCOMPILED2 +}; + +cpu_instruction_table current_instruction_table; + +static unsigned int update_invalid_addr(unsigned int addr) +{ + if (addr >= 0x80000000 && addr < 0xa0000000) + { + if (invalid_code[addr>>12]) invalid_code[(addr+0x20000000)>>12] = 1; + if (invalid_code[(addr+0x20000000)>>12]) invalid_code[addr>>12] = 1; + return addr; + } + else if (addr >= 0xa0000000 && addr < 0xc0000000) + { + if (invalid_code[addr>>12]) invalid_code[(addr-0x20000000)>>12] = 1; + if (invalid_code[(addr-0x20000000)>>12]) invalid_code[addr>>12] = 1; + return addr; + } + else + { + unsigned int paddr = virtual_to_physical_address(addr, 2); + if (paddr) + { + unsigned int beg_paddr = paddr - (addr - (addr&~0xFFF)); + update_invalid_addr(paddr); + if (invalid_code[(beg_paddr+0x000)>>12]) invalid_code[addr>>12] = 1; + if (invalid_code[(beg_paddr+0xFFC)>>12]) invalid_code[addr>>12] = 1; + if (invalid_code[addr>>12]) invalid_code[(beg_paddr+0x000)>>12] = 1; + if (invalid_code[addr>>12]) invalid_code[(beg_paddr+0xFFC)>>12] = 1; + } + return paddr; + } +} + +#define addr jump_to_address +unsigned int jump_to_address; +void jump_to_func(void) +{ + unsigned int paddr; + if (skip_jump) return; + paddr = update_invalid_addr(addr); + if (!paddr) return; + actual = blocks[addr>>12]; + if (invalid_code[addr>>12]) + { + if (!blocks[addr>>12]) + { + blocks[addr>>12] = (precomp_block *) malloc(sizeof(precomp_block)); + actual = blocks[addr>>12]; + blocks[addr>>12]->code = NULL; + blocks[addr>>12]->block = NULL; + blocks[addr>>12]->jumps_table = NULL; + blocks[addr>>12]->riprel_table = NULL; + } + blocks[addr>>12]->start = addr & ~0xFFF; + blocks[addr>>12]->end = (addr & ~0xFFF) + 0x1000; + init_block(blocks[addr>>12]); + } + PC=actual->block+((addr-actual->start)>>2); + + if (r4300emu == CORE_DYNAREC) dyna_jump(); +} +#undef addr + +void generic_jump_to(unsigned int address) +{ + if (r4300emu == CORE_PURE_INTERPRETER) + PC->addr = address; + else { +#ifdef NEW_DYNAREC + if (r4300emu == CORE_DYNAREC) + last_addr = pcaddr; + else + jump_to(address); +#else + jump_to(address); +#endif + } +} + +/* Refer to Figure 6-2 on page 155 and explanation on page B-11 + of MIPS R4000 Microprocessor User's Manual (Second Edition) + by Joe Heinrich. +*/ +void shuffle_fpr_data(int oldStatus, int newStatus) +{ +#if defined(M64P_BIG_ENDIAN) + const int isBigEndian = 1; +#else + const int isBigEndian = 0; +#endif + + if ((newStatus & 0x04000000) != (oldStatus & 0x04000000)) + { + int i; + int temp_fgr_32[32]; + + // pack or unpack the FGR register data + if (newStatus & 0x04000000) + { // switching into 64-bit mode + // retrieve 32 FPR values from packed 32-bit FGR registers + for (i = 0; i < 32; i++) + { + temp_fgr_32[i] = *((int *) ®_cop1_fgr_64[i>>1] + ((i & 1) ^ isBigEndian)); + } + // unpack them into 32 64-bit registers, taking the high 32-bits from their temporary place in the upper 16 FGRs + for (i = 0; i < 32; i++) + { + int high32 = *((int *) ®_cop1_fgr_64[(i>>1)+16] + (i & 1)); + *((int *) ®_cop1_fgr_64[i] + isBigEndian) = temp_fgr_32[i]; + *((int *) ®_cop1_fgr_64[i] + (isBigEndian^1)) = high32; + } + } + else + { // switching into 32-bit mode + // retrieve the high 32 bits from each 64-bit FGR register and store in temp array + for (i = 0; i < 32; i++) + { + temp_fgr_32[i] = *((int *) ®_cop1_fgr_64[i] + (isBigEndian^1)); + } + // take the low 32 bits from each register and pack them together into 64-bit pairs + for (i = 0; i < 16; i++) + { + unsigned int least32 = *((unsigned int *) ®_cop1_fgr_64[i*2] + isBigEndian); + unsigned int most32 = *((unsigned int *) ®_cop1_fgr_64[i*2+1] + isBigEndian); + reg_cop1_fgr_64[i] = ((unsigned long long) most32 << 32) | (unsigned long long) least32; + } + // store the high bits in the upper 16 FGRs, which wont be accessible in 32-bit mode + for (i = 0; i < 32; i++) + { + *((int *) ®_cop1_fgr_64[(i>>1)+16] + (i & 1)) = temp_fgr_32[i]; + } + } + } +} + +void set_fpr_pointers(int newStatus) +{ + int i; +#if defined(M64P_BIG_ENDIAN) + const int isBigEndian = 1; +#else + const int isBigEndian = 0; +#endif + + // update the FPR register pointers + if (newStatus & 0x04000000) + { + for (i = 0; i < 32; i++) + { + reg_cop1_double[i] = (double*) ®_cop1_fgr_64[i]; + reg_cop1_simple[i] = ((float*) ®_cop1_fgr_64[i]) + isBigEndian; + } + } + else + { + for (i = 0; i < 32; i++) + { + reg_cop1_double[i] = (double*) ®_cop1_fgr_64[i>>1]; + reg_cop1_simple[i] = ((float*) ®_cop1_fgr_64[i>>1]) + ((i & 1) ^ isBigEndian); + } + } +} + +int check_cop1_unusable(void) +{ + if (!(Status & 0x20000000)) + { + Cause = (11 << 2) | 0x10000000; + exception_general(); + return 1; + } + return 0; +} + +void update_count(void) +{ +#ifdef NEW_DYNAREC + if (r4300emu != CORE_DYNAREC) + { +#endif + Count = Count + (PC->addr - last_addr)/2; + last_addr = PC->addr; +#ifdef NEW_DYNAREC + } +#endif + +#ifdef COMPARE_CORE + if (delay_slot) + CoreCompareCallback(); +#endif +/*#ifdef DBG + if (g_DebuggerActive && !delay_slot) update_debugger(PC->addr); +#endif +*/ +} + +void init_blocks(void) +{ + int i; + for (i=0; i<0x100000; i++) + { + invalid_code[i] = 1; + blocks[i] = NULL; + } +} + +void free_blocks(void) +{ + int i; + for (i=0; i<0x100000; i++) + { + if (blocks[i]) + { + free_block(blocks[i]); + free(blocks[i]); + blocks[i] = NULL; + } + } +} + +/* this hard reset function simulates the boot-up state of the R4300 CPU */ +void r4300_reset_hard(void) +{ + unsigned int i; + + // clear r4300 registers and TLB entries + for (i = 0; i < 32; i++) + { + reg[i]=0; + reg_cop0[i]=0; + reg_cop1_fgr_64[i]=0; + + // --------------tlb------------------------ + tlb_e[i].mask=0; + tlb_e[i].vpn2=0; + tlb_e[i].g=0; + tlb_e[i].asid=0; + tlb_e[i].pfn_even=0; + tlb_e[i].c_even=0; + tlb_e[i].d_even=0; + tlb_e[i].v_even=0; + tlb_e[i].pfn_odd=0; + tlb_e[i].c_odd=0; + tlb_e[i].d_odd=0; + tlb_e[i].v_odd=0; + tlb_e[i].r=0; + //tlb_e[i].check_parity_mask=0x1000; + + tlb_e[i].start_even=0; + tlb_e[i].end_even=0; + tlb_e[i].phys_even=0; + tlb_e[i].start_odd=0; + tlb_e[i].end_odd=0; + tlb_e[i].phys_odd=0; + } + for (i=0; i<0x100000; i++) + { + tlb_LUT_r[i] = 0; + tlb_LUT_w[i] = 0; + } + llbit=0; + hi=0; + lo=0; + FCR0=0x511; + FCR31=0; + + // set COP0 registers + Random = 31; + Status= 0x34000000; + set_fpr_pointers(Status); + Config= 0x6e463; + PRevID = 0xb00; + Count = 0x5000; + Cause = 0x5C; + Context = 0x7FFFF0; + EPC = 0xFFFFFFFF; + BadVAddr = 0xFFFFFFFF; + ErrorEPC = 0xFFFFFFFF; + + rounding_mode = 0x33F; +} + +/* this soft reset function simulates the actions of the PIF ROM, which may vary by region + * TODO: accurately simulate the effects of the PIF ROM in the case of a soft reset + * (e.g. Goldeneye crashes) */ +void r4300_reset_soft(void) +{ + long long CRC = 0; + unsigned int i; + + // copy boot code from ROM to SP_DMEM + memcpy((char *)SP_DMEM+0x40, rom+0x40, 0xFC0); + + // the following values are extracted from the pj64 source code + // thanks to Zilmar and Jabo + + reg[6] = 0xFFFFFFFFA4001F0CLL; + reg[7] = 0xFFFFFFFFA4001F08LL; + reg[8] = 0x00000000000000C0LL; + reg[10]= 0x0000000000000040LL; + reg[11]= 0xFFFFFFFFA4000040LL; + reg[29]= 0xFFFFFFFFA4001FF0LL; + + // figure out which ROM type is loaded + for (i = 0x40/4; i < (0x1000/4); i++) + CRC += SP_DMEM[i]; + switch(CRC) { + case 0x000000D0027FDF31LL: + case 0x000000CFFB631223LL: + CIC_Chip = 1; + break; + case 0x000000D057C85244LL: + CIC_Chip = 2; + break; + case 0x000000D6497E414BLL: + CIC_Chip = 3; + break; + case 0x0000011A49F60E96LL: + CIC_Chip = 5; + break; + case 0x000000D6D5BE5580LL: + CIC_Chip = 6; + break; + default: + CIC_Chip = 2; + } + + switch(ROM_PARAMS.systemtype) + { + case SYSTEM_PAL: + switch (CIC_Chip) { + case 2: + reg[5] = 0xFFFFFFFFC0F1D859LL; + reg[14]= 0x000000002DE108EALL; + break; + case 3: + reg[5] = 0xFFFFFFFFD4646273LL; + reg[14]= 0x000000001AF99984LL; + break; + case 5: + SP_IMEM[1] = 0xBDA807FC; + reg[5] = 0xFFFFFFFFDECAAAD1LL; + reg[14]= 0x000000000CF85C13LL; + reg[24]= 0x0000000000000002LL; + break; + case 6: + reg[5] = 0xFFFFFFFFB04DC903LL; + reg[14]= 0x000000001AF99984LL; + reg[24]= 0x0000000000000002LL; + break; + } + reg[23]= 0x0000000000000006LL; + reg[31]= 0xFFFFFFFFA4001554LL; + break; + case SYSTEM_NTSC: + default: + switch (CIC_Chip) { + case 2: + reg[5] = 0xFFFFFFFFC95973D5LL; + reg[14]= 0x000000002449A366LL; + break; + case 3: + reg[5] = 0xFFFFFFFF95315A28LL; + reg[14]= 0x000000005BACA1DFLL; + break; + case 5: + SP_IMEM[1] = 0x8DA807FC; + reg[5] = 0x000000005493FB9ALL; + reg[14]= 0xFFFFFFFFC2C20384LL; + break; + case 6: + reg[5] = 0xFFFFFFFFE067221FLL; + reg[14]= 0x000000005CD2B70FLL; + break; + } + reg[20]= 0x0000000000000001LL; + reg[24]= 0x0000000000000003LL; + reg[31]= 0xFFFFFFFFA4001550LL; + } + switch (CIC_Chip) { + case 1: + reg[22]= 0x000000000000003FLL; + break; + case 2: + reg[1] = 0x0000000000000001LL; + reg[2] = 0x000000000EBDA536LL; + reg[3] = 0x000000000EBDA536LL; + reg[4] = 0x000000000000A536LL; + reg[12]= 0xFFFFFFFFED10D0B3LL; + reg[13]= 0x000000001402A4CCLL; + reg[15]= 0x000000003103E121LL; + reg[22]= 0x000000000000003FLL; + reg[25]= 0xFFFFFFFF9DEBB54FLL; + break; + case 3: + reg[1] = 0x0000000000000001LL; + reg[2] = 0x0000000049A5EE96LL; + reg[3] = 0x0000000049A5EE96LL; + reg[4] = 0x000000000000EE96LL; + reg[12]= 0xFFFFFFFFCE9DFBF7LL; + reg[13]= 0xFFFFFFFFCE9DFBF7LL; + reg[15]= 0x0000000018B63D28LL; + reg[22]= 0x0000000000000078LL; + reg[25]= 0xFFFFFFFF825B21C9LL; + break; + case 5: + SP_IMEM[0] = 0x3C0DBFC0; + SP_IMEM[2] = 0x25AD07C0; + SP_IMEM[3] = 0x31080080; + SP_IMEM[4] = 0x5500FFFC; + SP_IMEM[5] = 0x3C0DBFC0; + SP_IMEM[6] = 0x8DA80024; + SP_IMEM[7] = 0x3C0BB000; + reg[2] = 0xFFFFFFFFF58B0FBFLL; + reg[3] = 0xFFFFFFFFF58B0FBFLL; + reg[4] = 0x0000000000000FBFLL; + reg[12]= 0xFFFFFFFF9651F81ELL; + reg[13]= 0x000000002D42AAC5LL; + reg[15]= 0x0000000056584D60LL; + reg[22]= 0x0000000000000091LL; + reg[25]= 0xFFFFFFFFCDCE565FLL; + break; + case 6: + reg[2] = 0xFFFFFFFFA95930A4LL; + reg[3] = 0xFFFFFFFFA95930A4LL; + reg[4] = 0x00000000000030A4LL; + reg[12]= 0xFFFFFFFFBCB59510LL; + reg[13]= 0xFFFFFFFFBCB59510LL; + reg[15]= 0x000000007A3C07F4LL; + reg[22]= 0x0000000000000085LL; + reg[25]= 0x00000000465E3F72LL; + break; + } + +} + +#if !defined(NO_ASM) +static void dynarec_setup_code(void) +{ + // The dynarec jumps here after we call dyna_start and it prepares + // Here we need to prepare the initial code block and jump to it + jump_to(0xa4000040); + + // Prevent segfault on failed jump_to + if (!actual->block || !actual->code) + dyna_stop(); +} +#endif + +void r4300_execute(void) +{ +#if defined(COUNT_INSTR) || (defined(DYNAREC) && defined(PROFILE_R4300)) + unsigned int i; +#endif + + current_instruction_table = cached_interpreter_table; + + debug_count = 0; + delay_slot=0; + stop = 0; + rompause = 0; + + /* clear instruction counters */ +#if defined(COUNT_INSTR) + for (i = 0; i < 131; i++) + instr_count[i] = 0; +#endif + + last_addr = 0xa4000040; + next_interupt = 624999; + init_interupt(); + + if (r4300emu == CORE_PURE_INTERPRETER) + { + DebugMessage(M64MSG_INFO, "Starting R4300 emulator: Pure Interpreter"); + r4300emu = CORE_PURE_INTERPRETER; + pure_interpreter(); + } +#if defined(DYNAREC) + else if (r4300emu >= 2) + { + DebugMessage(M64MSG_INFO, "Starting R4300 emulator: Dynamic Recompiler"); + r4300emu = CORE_DYNAREC; + init_blocks(); + +#ifdef NEW_DYNAREC + new_dynarec_init(); + new_dyna_start(); + new_dynarec_cleanup(); +#else + dyna_start(dynarec_setup_code); + PC++; +#endif +#if defined(PROFILE_R4300) + pfProfile = fopen("instructionaddrs.dat", "ab"); + for (i=0; i<0x100000; i++) + if (invalid_code[i] == 0 && blocks[i] != NULL && blocks[i]->code != NULL && blocks[i]->block != NULL) + { + unsigned char *x86addr; + int mipsop; + // store final code length for this block + mipsop = -1; /* -1 == end of x86 code block */ + x86addr = blocks[i]->code + blocks[i]->code_length; + if (fwrite(&mipsop, 1, 4, pfProfile) != 4 || + fwrite(&x86addr, 1, sizeof(char *), pfProfile) != sizeof(char *)) + DebugMessage(M64MSG_ERROR, "Error writing R4300 instruction address profiling data"); + } + fclose(pfProfile); + pfProfile = NULL; +#endif + free_blocks(); + } +#endif + else /* if (r4300emu == CORE_INTERPRETER) */ + { + DebugMessage(M64MSG_INFO, "Starting R4300 emulator: Cached Interpreter"); + r4300emu = CORE_INTERPRETER; + init_blocks(); + jump_to(0xa4000040); + + /* Prevent segfault on failed jump_to */ + if (!actual->block) + return; + + last_addr = PC->addr; + while (!stop) + { +#ifdef COMPARE_CORE + if (PC->ops == FIN_BLOCK && (PC->addr < 0x80000000 || PC->addr >= 0xc0000000)) + virtual_to_physical_address(PC->addr, 2); + CoreCompareCallback(); +#endif +#ifdef DBG + if (g_DebuggerActive) update_debugger(PC->addr); +#endif + PC->ops(); + } + + free_blocks(); + } + + debug_count+= Count; + DebugMessage(M64MSG_INFO, "R4300 emulator finished."); + + /* print instruction counts */ +#if defined(COUNT_INSTR) + if (r4300emu == CORE_DYNAREC) + { + unsigned int iTypeCount[11] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + unsigned int iTotal = 0; + char line[128], param[24]; + DebugMessage(M64MSG_INFO, "Instruction counters:"); + line[0] = 0; + for (i = 0; i < 131; i++) + { + sprintf(param, "%8s: %08i ", instr_name[i], instr_count[i]); + strcat(line, param); + if (i % 5 == 4) + { + DebugMessage(M64MSG_INFO, "%s", line); + line[0] = 0; + } + iTypeCount[instr_type[i]] += instr_count[i]; + iTotal += instr_count[i]; + } + DebugMessage(M64MSG_INFO, "Instruction type summary (total instructions = %i)", iTotal); + for (i = 0; i < 11; i++) + { + DebugMessage(M64MSG_INFO, "%20s: %04.1f%% (%i)", instr_typename[i], (float) iTypeCount[i] * 100.0 / iTotal, iTypeCount[i]); + } + } +#endif +} diff --git a/libmupen64plus/mupen64plus-core/src/r4300/r4300.h b/libmupen64plus/mupen64plus-core/src/r4300/r4300.h new file mode 100644 index 0000000000..399a9fbaa1 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/r4300.h @@ -0,0 +1,94 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - r4300.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef R4300_H +#define R4300_H + +#include "recomp.h" +#include "memory/tlb.h" + +extern precomp_instr *PC; + +extern precomp_block *blocks[0x100000], *actual; + +extern int stop, llbit, rompause; +extern long long int reg[32], hi, lo; +extern long long int local_rs; +extern unsigned int reg_cop0[32]; +extern double *reg_cop1_double[32]; +extern float *reg_cop1_simple[32]; +extern long long int reg_cop1_fgr_64[32]; +extern int FCR0, FCR31; +extern tlb tlb_e[32]; +extern unsigned int delay_slot, skip_jump, dyna_interp, op; +extern unsigned long long int debug_count; +extern unsigned int r4300emu; +extern unsigned int next_interupt, CIC_Chip; +extern int rounding_mode, trunc_mode, round_mode, ceil_mode, floor_mode; +extern unsigned int last_addr; +extern char invalid_code[0x100000]; +extern unsigned int jump_to_address; +extern int no_compiled_jump; + +void init_blocks(void); +void free_blocks(void); +void r4300_reset_hard(void); +void r4300_reset_soft(void); +void r4300_execute(void); +void pure_interpreter(void); +void compare_core(void); +void jump_to_func(void); +void update_count(void); +int check_cop1_unusable(void); +void shuffle_fpr_data(int oldStatus, int newStatus); +void set_fpr_pointers(int newStatus); + +/* Jumps to the given address. This is for the cached interpreter / dynarec. */ +#define jump_to(a) { jump_to_address = a; jump_to_func(); } + +/* Jump to the given address. This works for all r4300 emulator, but is slower. + * Use this for common code which can be executed from any r4300 emulator. */ +void generic_jump_to(unsigned int address); + +// r4300 emulators +#define CORE_PURE_INTERPRETER 0 +#define CORE_INTERPRETER 1 +#define CORE_DYNAREC 2 + +// profiling +#define ALL_SECTION 0 +#define GFX_SECTION 1 +#define AUDIO_SECTION 2 +#define COMPILER_SECTION 3 +#define IDLE_SECTION 4 + +#ifdef PROFILE + void start_section(int section_type); + void end_section(int section_type); + void refresh_stat(void); +#else + #define start_section(a) + #define end_section(a) + #define refresh_stat() +#endif + +#endif /* R4300_H */ + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/recomp.c b/libmupen64plus/mupen64plus-core/src/r4300/recomp.c new file mode 100644 index 0000000000..dfca49aa6c --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/recomp.c @@ -0,0 +1,2674 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - recomp.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include + +#if defined(__GNUC__) +#include +#ifndef __MINGW32__ +#include +#endif +#endif + +#include "api/m64p_types.h" +#include "api/callbacks.h" +#include "memory/memory.h" + +#include "recomp.h" +#include "recomph.h" //include for function prototypes +#include "macros.h" +#include "r4300.h" +#include "ops.h" + +static void *malloc_exec(size_t size); +static void free_exec(void *ptr, size_t length); + +// global variables : +precomp_instr *dst; // destination structure for the recompiled instruction +int code_length; // current real recompiled code length +int max_code_length; // current recompiled code's buffer length +unsigned char **inst_pointer; // output buffer for recompiled code +precomp_block *dst_block; // the current block that we are recompiling +int src; // the current recompiled instruction +int fast_memory; + +static void (*recomp_func)(void); // pointer to the dynarec's generator + // function for the latest decoded opcode + +#if defined(PROFILE_R4300) +FILE *pfProfile; +#endif + +static int *SRC; // currently recompiled instruction in the input stream +static int check_nop; // next instruction is nop ? +static int delay_slot_compiled = 0; + + + +static void RSV(void) +{ + dst->ops = current_instruction_table.RESERVED; + recomp_func = genreserved; +} + +static void RFIN_BLOCK(void) +{ + dst->ops = current_instruction_table.FIN_BLOCK; + recomp_func = genfin_block; +} + +static void RNOTCOMPILED(void) +{ + dst->ops = current_instruction_table.NOTCOMPILED; + recomp_func = gennotcompiled; +} + +static void recompile_standard_i_type(void) +{ + dst->f.i.rs = reg + ((src >> 21) & 0x1F); + dst->f.i.rt = reg + ((src >> 16) & 0x1F); + dst->f.i.immediate = src & 0xFFFF; +} + +static void recompile_standard_j_type(void) +{ + dst->f.j.inst_index = src & 0x3FFFFFF; +} + +static void recompile_standard_r_type(void) +{ + dst->f.r.rs = reg + ((src >> 21) & 0x1F); + dst->f.r.rt = reg + ((src >> 16) & 0x1F); + dst->f.r.rd = reg + ((src >> 11) & 0x1F); + dst->f.r.sa = (src >> 6) & 0x1F; +} + +static void recompile_standard_lf_type(void) +{ + dst->f.lf.base = (src >> 21) & 0x1F; + dst->f.lf.ft = (src >> 16) & 0x1F; + dst->f.lf.offset = src & 0xFFFF; +} + +static void recompile_standard_cf_type(void) +{ + dst->f.cf.ft = (src >> 16) & 0x1F; + dst->f.cf.fs = (src >> 11) & 0x1F; + dst->f.cf.fd = (src >> 6) & 0x1F; +} + +//------------------------------------------------------------------------- +// SPECIAL +//------------------------------------------------------------------------- + +static void RNOP(void) +{ + dst->ops = current_instruction_table.NOP; + recomp_func = gennop; +} + +static void RSLL(void) +{ + dst->ops = current_instruction_table.SLL; + recomp_func = gensll; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RSRL(void) +{ + dst->ops = current_instruction_table.SRL; + recomp_func = gensrl; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RSRA(void) +{ + dst->ops = current_instruction_table.SRA; + recomp_func = gensra; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RSLLV(void) +{ + dst->ops = current_instruction_table.SLLV; + recomp_func = gensllv; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RSRLV(void) +{ + dst->ops = current_instruction_table.SRLV; + recomp_func = gensrlv; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RSRAV(void) +{ + dst->ops = current_instruction_table.SRAV; + recomp_func = gensrav; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RJR(void) +{ + dst->ops = current_instruction_table.JR; + recomp_func = genjr; + recompile_standard_i_type(); +} + +static void RJALR(void) +{ + dst->ops = current_instruction_table.JALR; + recomp_func = genjalr; + recompile_standard_r_type(); +} + +static void RSYSCALL(void) +{ + dst->ops = current_instruction_table.SYSCALL; + recomp_func = gensyscall; +} + +static void RBREAK(void) +{ + dst->ops = current_instruction_table.NI; + recomp_func = genni; +} + +static void RSYNC(void) +{ + dst->ops = current_instruction_table.SYNC; + recomp_func = gensync; +} + +static void RMFHI(void) +{ + dst->ops = current_instruction_table.MFHI; + recomp_func = genmfhi; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RMTHI(void) +{ + dst->ops = current_instruction_table.MTHI; + recomp_func = genmthi; + recompile_standard_r_type(); +} + +static void RMFLO(void) +{ + dst->ops = current_instruction_table.MFLO; + recomp_func = genmflo; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RMTLO(void) +{ + dst->ops = current_instruction_table.MTLO; + recomp_func = genmtlo; + recompile_standard_r_type(); +} + +static void RDSLLV(void) +{ + dst->ops = current_instruction_table.DSLLV; + recomp_func = gendsllv; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RDSRLV(void) +{ + dst->ops = current_instruction_table.DSRLV; + recomp_func = gendsrlv; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RDSRAV(void) +{ + dst->ops = current_instruction_table.DSRAV; + recomp_func = gendsrav; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RMULT(void) +{ + dst->ops = current_instruction_table.MULT; + recomp_func = genmult; + recompile_standard_r_type(); +} + +static void RMULTU(void) +{ + dst->ops = current_instruction_table.MULTU; + recomp_func = genmultu; + recompile_standard_r_type(); +} + +static void RDIV(void) +{ + dst->ops = current_instruction_table.DIV; + recomp_func = gendiv; + recompile_standard_r_type(); +} + +static void RDIVU(void) +{ + dst->ops = current_instruction_table.DIVU; + recomp_func = gendivu; + recompile_standard_r_type(); +} + +static void RDMULT(void) +{ + dst->ops = current_instruction_table.DMULT; + recomp_func = gendmult; + recompile_standard_r_type(); +} + +static void RDMULTU(void) +{ + dst->ops = current_instruction_table.DMULTU; + recomp_func = gendmultu; + recompile_standard_r_type(); +} + +static void RDDIV(void) +{ + dst->ops = current_instruction_table.DDIV; + recomp_func = genddiv; + recompile_standard_r_type(); +} + +static void RDDIVU(void) +{ + dst->ops = current_instruction_table.DDIVU; + recomp_func = genddivu; + recompile_standard_r_type(); +} + +static void RADD(void) +{ + dst->ops = current_instruction_table.ADD; + recomp_func = genadd; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RADDU(void) +{ + dst->ops = current_instruction_table.ADDU; + recomp_func = genaddu; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RSUB(void) +{ + dst->ops = current_instruction_table.SUB; + recomp_func = gensub; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RSUBU(void) +{ + dst->ops = current_instruction_table.SUBU; + recomp_func = gensubu; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RAND(void) +{ + dst->ops = current_instruction_table.AND; + recomp_func = genand; + recompile_standard_r_type(); + if(dst->f.r.rd == reg) RNOP(); +} + +static void ROR(void) +{ + dst->ops = current_instruction_table.OR; + recomp_func = genor; + recompile_standard_r_type(); + if(dst->f.r.rd == reg) RNOP(); +} + +static void RXOR(void) +{ + dst->ops = current_instruction_table.XOR; + recomp_func = genxor; + recompile_standard_r_type(); + if(dst->f.r.rd == reg) RNOP(); +} + +static void RNOR(void) +{ + dst->ops = current_instruction_table.NOR; + recomp_func = gennor; + recompile_standard_r_type(); + if(dst->f.r.rd == reg) RNOP(); +} + +static void RSLT(void) +{ + dst->ops = current_instruction_table.SLT; + recomp_func = genslt; + recompile_standard_r_type(); + if(dst->f.r.rd == reg) RNOP(); +} + +static void RSLTU(void) +{ + dst->ops = current_instruction_table.SLTU; + recomp_func = gensltu; + recompile_standard_r_type(); + if(dst->f.r.rd == reg) RNOP(); +} + +static void RDADD(void) +{ + dst->ops = current_instruction_table.DADD; + recomp_func = gendadd; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RDADDU(void) +{ + dst->ops = current_instruction_table.DADDU; + recomp_func = gendaddu; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RDSUB(void) +{ + dst->ops = current_instruction_table.DSUB; + recomp_func = gendsub; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RDSUBU(void) +{ + dst->ops = current_instruction_table.DSUBU; + recomp_func = gendsubu; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RTGE(void) +{ + dst->ops = current_instruction_table.NI; + recomp_func = genni; +} + +static void RTGEU(void) +{ + dst->ops = current_instruction_table.NI; + recomp_func = genni; +} + +static void RTLT(void) +{ + dst->ops = current_instruction_table.NI; + recomp_func = genni; +} + +static void RTLTU(void) +{ + dst->ops = current_instruction_table.NI; + recomp_func = genni; +} + +static void RTEQ(void) +{ + dst->ops = current_instruction_table.TEQ; + recomp_func = genteq; + recompile_standard_r_type(); +} + +static void RTNE(void) +{ + dst->ops = current_instruction_table.NI; + recomp_func = genni; +} + +static void RDSLL(void) +{ + dst->ops = current_instruction_table.DSLL; + recomp_func = gendsll; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RDSRL(void) +{ + dst->ops = current_instruction_table.DSRL; + recomp_func = gendsrl; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RDSRA(void) +{ + dst->ops = current_instruction_table.DSRA; + recomp_func = gendsra; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RDSLL32(void) +{ + dst->ops = current_instruction_table.DSLL32; + recomp_func = gendsll32; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RDSRL32(void) +{ + dst->ops = current_instruction_table.DSRL32; + recomp_func = gendsrl32; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void RDSRA32(void) +{ + dst->ops = current_instruction_table.DSRA32; + recomp_func = gendsra32; + recompile_standard_r_type(); + if (dst->f.r.rd == reg) RNOP(); +} + +static void (*recomp_special[64])(void) = +{ + RSLL , RSV , RSRL , RSRA , RSLLV , RSV , RSRLV , RSRAV , + RJR , RJALR , RSV , RSV , RSYSCALL, RBREAK , RSV , RSYNC , + RMFHI, RMTHI , RMFLO, RMTLO, RDSLLV , RSV , RDSRLV , RDSRAV , + RMULT, RMULTU, RDIV , RDIVU, RDMULT , RDMULTU, RDDIV , RDDIVU , + RADD , RADDU , RSUB , RSUBU, RAND , ROR , RXOR , RNOR , + RSV , RSV , RSLT , RSLTU, RDADD , RDADDU , RDSUB , RDSUBU , + RTGE , RTGEU , RTLT , RTLTU, RTEQ , RSV , RTNE , RSV , + RDSLL, RSV , RDSRL, RDSRA, RDSLL32 , RSV , RDSRL32, RDSRA32 +}; + +//------------------------------------------------------------------------- +// REGIMM +//------------------------------------------------------------------------- + +static void RBLTZ(void) +{ + unsigned int target; + dst->ops = current_instruction_table.BLTZ; + recomp_func = genbltz; + recompile_standard_i_type(); + target = dst->addr + dst->f.i.immediate*4 + 4; + if (target == dst->addr) + { + if (check_nop) + { + dst->ops = current_instruction_table.BLTZ_IDLE; + recomp_func = genbltz_idle; + } + } + else if (r4300emu != CORE_PURE_INTERPRETER && (target < dst_block->start || target >= dst_block->end || dst->addr == (dst_block->end-4))) + { + dst->ops = current_instruction_table.BLTZ_OUT; + recomp_func = genbltz_out; + } +} + +static void RBGEZ(void) +{ + unsigned int target; + dst->ops = current_instruction_table.BGEZ; + recomp_func = genbgez; + recompile_standard_i_type(); + target = dst->addr + dst->f.i.immediate*4 + 4; + if (target == dst->addr) + { + if (check_nop) + { + dst->ops = current_instruction_table.BGEZ_IDLE; + recomp_func = genbgez_idle; + } + } + else if (r4300emu != CORE_PURE_INTERPRETER && (target < dst_block->start || target >= dst_block->end || dst->addr == (dst_block->end-4))) + { + dst->ops = current_instruction_table.BGEZ_OUT; + recomp_func = genbgez_out; + } +} + +static void RBLTZL(void) +{ + unsigned int target; + dst->ops = current_instruction_table.BLTZL; + recomp_func = genbltzl; + recompile_standard_i_type(); + target = dst->addr + dst->f.i.immediate*4 + 4; + if (target == dst->addr) + { + if (check_nop) + { + dst->ops = current_instruction_table.BLTZL_IDLE; + recomp_func = genbltzl_idle; + } + } + else if (r4300emu != CORE_PURE_INTERPRETER && (target < dst_block->start || target >= dst_block->end || dst->addr == (dst_block->end-4))) + { + dst->ops = current_instruction_table.BLTZL_OUT; + recomp_func = genbltzl_out; + } +} + +static void RBGEZL(void) +{ + unsigned int target; + dst->ops = current_instruction_table.BGEZL; + recomp_func = genbgezl; + recompile_standard_i_type(); + target = dst->addr + dst->f.i.immediate*4 + 4; + if (target == dst->addr) + { + if (check_nop) + { + dst->ops = current_instruction_table.BGEZL_IDLE; + recomp_func = genbgezl_idle; + } + } + else if (r4300emu != CORE_PURE_INTERPRETER && (target < dst_block->start || target >= dst_block->end || dst->addr == (dst_block->end-4))) + { + dst->ops = current_instruction_table.BGEZL_OUT; + recomp_func = genbgezl_out; + } +} + +static void RTGEI(void) +{ + dst->ops = current_instruction_table.NI; + recomp_func = genni; +} + +static void RTGEIU(void) +{ + dst->ops = current_instruction_table.NI; + recomp_func = genni; +} + +static void RTLTI(void) +{ + dst->ops = current_instruction_table.NI; + recomp_func = genni; +} + +static void RTLTIU(void) +{ + dst->ops = current_instruction_table.NI; + recomp_func = genni; +} + +static void RTEQI(void) +{ + dst->ops = current_instruction_table.NI; + recomp_func = genni; +} + +static void RTNEI(void) +{ + dst->ops = current_instruction_table.NI; + recomp_func = genni; +} + +static void RBLTZAL(void) +{ + unsigned int target; + dst->ops = current_instruction_table.BLTZAL; + recomp_func = genbltzal; + recompile_standard_i_type(); + target = dst->addr + dst->f.i.immediate*4 + 4; + if (target == dst->addr) + { + if (check_nop) + { + dst->ops = current_instruction_table.BLTZAL_IDLE; + recomp_func = genbltzal_idle; + } + } + else if (r4300emu != CORE_PURE_INTERPRETER && (target < dst_block->start || target >= dst_block->end || dst->addr == (dst_block->end-4))) + { + dst->ops = current_instruction_table.BLTZAL_OUT; + recomp_func = genbltzal_out; + } +} + +static void RBGEZAL(void) +{ + unsigned int target; + dst->ops = current_instruction_table.BGEZAL; + recomp_func = genbgezal; + recompile_standard_i_type(); + target = dst->addr + dst->f.i.immediate*4 + 4; + if (target == dst->addr) + { + if (check_nop) + { + dst->ops = current_instruction_table.BGEZAL_IDLE; + recomp_func = genbgezal_idle; + } + } + else if (r4300emu != CORE_PURE_INTERPRETER && (target < dst_block->start || target >= dst_block->end || dst->addr == (dst_block->end-4))) + { + dst->ops = current_instruction_table.BGEZAL_OUT; + recomp_func = genbgezal_out; + } +} + +static void RBLTZALL(void) +{ + unsigned int target; + dst->ops = current_instruction_table.BLTZALL; + recomp_func = genbltzall; + recompile_standard_i_type(); + target = dst->addr + dst->f.i.immediate*4 + 4; + if (target == dst->addr) + { + if (check_nop) + { + dst->ops = current_instruction_table.BLTZALL_IDLE; + recomp_func = genbltzall_idle; + } + } + else if (r4300emu != CORE_PURE_INTERPRETER && (target < dst_block->start || target >= dst_block->end || dst->addr == (dst_block->end-4))) + { + dst->ops = current_instruction_table.BLTZALL_OUT; + recomp_func = genbltzall_out; + } +} + +static void RBGEZALL(void) +{ + unsigned int target; + dst->ops = current_instruction_table.BGEZALL; + recomp_func = genbgezall; + recompile_standard_i_type(); + target = dst->addr + dst->f.i.immediate*4 + 4; + if (target == dst->addr) + { + if (check_nop) + { + dst->ops = current_instruction_table.BGEZALL_IDLE; + recomp_func = genbgezall_idle; + } + } + else if (r4300emu != CORE_PURE_INTERPRETER && (target < dst_block->start || target >= dst_block->end || dst->addr == (dst_block->end-4))) + { + dst->ops = current_instruction_table.BGEZALL_OUT; + recomp_func = genbgezall_out; + } +} + +static void (*recomp_regimm[32])(void) = +{ + RBLTZ , RBGEZ , RBLTZL , RBGEZL , RSV , RSV, RSV , RSV, + RTGEI , RTGEIU , RTLTI , RTLTIU , RTEQI, RSV, RTNEI, RSV, + RBLTZAL, RBGEZAL, RBLTZALL, RBGEZALL, RSV , RSV, RSV , RSV, + RSV , RSV , RSV , RSV , RSV , RSV, RSV , RSV +}; + +//------------------------------------------------------------------------- +// TLB +//------------------------------------------------------------------------- + +static void RTLBR(void) +{ + dst->ops = current_instruction_table.TLBR; + recomp_func = gentlbr; +} + +static void RTLBWI(void) +{ + dst->ops = current_instruction_table.TLBWI; + recomp_func = gentlbwi; +} + +static void RTLBWR(void) +{ + dst->ops = current_instruction_table.TLBWR; + recomp_func = gentlbwr; +} + +static void RTLBP(void) +{ + dst->ops = current_instruction_table.TLBP; + recomp_func = gentlbp; +} + +static void RERET(void) +{ + dst->ops = current_instruction_table.ERET; + recomp_func = generet; +} + +static void (*recomp_tlb[64])(void) = +{ + RSV , RTLBR, RTLBWI, RSV, RSV, RSV, RTLBWR, RSV, + RTLBP, RSV , RSV , RSV, RSV, RSV, RSV , RSV, + RSV , RSV , RSV , RSV, RSV, RSV, RSV , RSV, + RERET, RSV , RSV , RSV, RSV, RSV, RSV , RSV, + RSV , RSV , RSV , RSV, RSV, RSV, RSV , RSV, + RSV , RSV , RSV , RSV, RSV, RSV, RSV , RSV, + RSV , RSV , RSV , RSV, RSV, RSV, RSV , RSV, + RSV , RSV , RSV , RSV, RSV, RSV, RSV , RSV +}; + +//------------------------------------------------------------------------- +// COP0 +//------------------------------------------------------------------------- + +static void RMFC0(void) +{ + dst->ops = current_instruction_table.MFC0; + recomp_func = genmfc0; + recompile_standard_r_type(); + dst->f.r.rd = (long long*)(reg_cop0 + ((src >> 11) & 0x1F)); + dst->f.r.nrd = (src >> 11) & 0x1F; + if (dst->f.r.rt == reg) RNOP(); +} + +static void RMTC0(void) +{ + dst->ops = current_instruction_table.MTC0; + recomp_func = genmtc0; + recompile_standard_r_type(); + dst->f.r.nrd = (src >> 11) & 0x1F; +} + +static void RTLB(void) +{ + recomp_tlb[(src & 0x3F)](); +} + +static void (*recomp_cop0[32])(void) = +{ + RMFC0, RSV, RSV, RSV, RMTC0, RSV, RSV, RSV, + RSV , RSV, RSV, RSV, RSV , RSV, RSV, RSV, + RTLB , RSV, RSV, RSV, RSV , RSV, RSV, RSV, + RSV , RSV, RSV, RSV, RSV , RSV, RSV, RSV +}; + +//------------------------------------------------------------------------- +// BC +//------------------------------------------------------------------------- + +static void RBC1F(void) +{ + unsigned int target; + dst->ops = current_instruction_table.BC1F; + recomp_func = genbc1f; + recompile_standard_i_type(); + target = dst->addr + dst->f.i.immediate*4 + 4; + if (target == dst->addr) + { + if (check_nop) + { + dst->ops = current_instruction_table.BC1F_IDLE; + recomp_func = genbc1f_idle; + } + } + else if (r4300emu != CORE_PURE_INTERPRETER && (target < dst_block->start || target >= dst_block->end || dst->addr == (dst_block->end-4))) + { + dst->ops = current_instruction_table.BC1F_OUT; + recomp_func = genbc1f_out; + } +} + +static void RBC1T(void) +{ + unsigned int target; + dst->ops = current_instruction_table.BC1T; + recomp_func = genbc1t; + recompile_standard_i_type(); + target = dst->addr + dst->f.i.immediate*4 + 4; + if (target == dst->addr) + { + if (check_nop) + { + dst->ops = current_instruction_table.BC1T_IDLE; + recomp_func = genbc1t_idle; + } + } + else if (r4300emu != CORE_PURE_INTERPRETER && (target < dst_block->start || target >= dst_block->end || dst->addr == (dst_block->end-4))) + { + dst->ops = current_instruction_table.BC1T_OUT; + recomp_func = genbc1t_out; + } +} + +static void RBC1FL(void) +{ + unsigned int target; + dst->ops = current_instruction_table.BC1FL; + recomp_func = genbc1fl; + recompile_standard_i_type(); + target = dst->addr + dst->f.i.immediate*4 + 4; + if (target == dst->addr) + { + if (check_nop) + { + dst->ops = current_instruction_table.BC1FL_IDLE; + recomp_func = genbc1fl_idle; + } + } + else if (r4300emu != CORE_PURE_INTERPRETER && (target < dst_block->start || target >= dst_block->end || dst->addr == (dst_block->end-4))) + { + dst->ops = current_instruction_table.BC1FL_OUT; + recomp_func = genbc1fl_out; + } +} + +static void RBC1TL(void) +{ + unsigned int target; + dst->ops = current_instruction_table.BC1TL; + recomp_func = genbc1tl; + recompile_standard_i_type(); + target = dst->addr + dst->f.i.immediate*4 + 4; + if (target == dst->addr) + { + if (check_nop) + { + dst->ops = current_instruction_table.BC1TL_IDLE; + recomp_func = genbc1tl_idle; + } + } + else if (r4300emu != CORE_PURE_INTERPRETER && (target < dst_block->start || target >= dst_block->end || dst->addr == (dst_block->end-4))) + { + dst->ops = current_instruction_table.BC1TL_OUT; + recomp_func = genbc1tl_out; + } +} + +static void (*recomp_bc[4])(void) = +{ + RBC1F , RBC1T , + RBC1FL, RBC1TL +}; + +//------------------------------------------------------------------------- +// S +//------------------------------------------------------------------------- + +static void RADD_S(void) +{ + dst->ops = current_instruction_table.ADD_S; + recomp_func = genadd_s; + recompile_standard_cf_type(); +} + +static void RSUB_S(void) +{ + dst->ops = current_instruction_table.SUB_S; + recomp_func = gensub_s; + recompile_standard_cf_type(); +} + +static void RMUL_S(void) +{ + dst->ops = current_instruction_table.MUL_S; + recomp_func = genmul_s; + recompile_standard_cf_type(); +} + +static void RDIV_S(void) +{ + dst->ops = current_instruction_table.DIV_S; + recomp_func = gendiv_s; + recompile_standard_cf_type(); +} + +static void RSQRT_S(void) +{ + dst->ops = current_instruction_table.SQRT_S; + recomp_func = gensqrt_s; + recompile_standard_cf_type(); +} + +static void RABS_S(void) +{ + dst->ops = current_instruction_table.ABS_S; + recomp_func = genabs_s; + recompile_standard_cf_type(); +} + +static void RMOV_S(void) +{ + dst->ops = current_instruction_table.MOV_S; + recomp_func = genmov_s; + recompile_standard_cf_type(); +} + +static void RNEG_S(void) +{ + dst->ops = current_instruction_table.NEG_S; + recomp_func = genneg_s; + recompile_standard_cf_type(); +} + +static void RROUND_L_S(void) +{ + dst->ops = current_instruction_table.ROUND_L_S; + recomp_func = genround_l_s; + recompile_standard_cf_type(); +} + +static void RTRUNC_L_S(void) +{ + dst->ops = current_instruction_table.TRUNC_L_S; + recomp_func = gentrunc_l_s; + recompile_standard_cf_type(); +} + +static void RCEIL_L_S(void) +{ + dst->ops = current_instruction_table.CEIL_L_S; + recomp_func = genceil_l_s; + recompile_standard_cf_type(); +} + +static void RFLOOR_L_S(void) +{ + dst->ops = current_instruction_table.FLOOR_L_S; + recomp_func = genfloor_l_s; + recompile_standard_cf_type(); +} + +static void RROUND_W_S(void) +{ + dst->ops = current_instruction_table.ROUND_W_S; + recomp_func = genround_w_s; + recompile_standard_cf_type(); +} + +static void RTRUNC_W_S(void) +{ + dst->ops = current_instruction_table.TRUNC_W_S; + recomp_func = gentrunc_w_s; + recompile_standard_cf_type(); +} + +static void RCEIL_W_S(void) +{ + dst->ops = current_instruction_table.CEIL_W_S; + recomp_func = genceil_w_s; + recompile_standard_cf_type(); +} + +static void RFLOOR_W_S(void) +{ + dst->ops = current_instruction_table.FLOOR_W_S; + recomp_func = genfloor_w_s; + recompile_standard_cf_type(); +} + +static void RCVT_D_S(void) +{ + dst->ops = current_instruction_table.CVT_D_S; + recomp_func = gencvt_d_s; + recompile_standard_cf_type(); +} + +static void RCVT_W_S(void) +{ + dst->ops = current_instruction_table.CVT_W_S; + recomp_func = gencvt_w_s; + recompile_standard_cf_type(); +} + +static void RCVT_L_S(void) +{ + dst->ops = current_instruction_table.CVT_L_S; + recomp_func = gencvt_l_s; + recompile_standard_cf_type(); +} + +static void RC_F_S(void) +{ + dst->ops = current_instruction_table.C_F_S; + recomp_func = genc_f_s; + recompile_standard_cf_type(); +} + +static void RC_UN_S(void) +{ + dst->ops = current_instruction_table.C_UN_S; + recomp_func = genc_un_s; + recompile_standard_cf_type(); +} + +static void RC_EQ_S(void) +{ + dst->ops = current_instruction_table.C_EQ_S; + recomp_func = genc_eq_s; + recompile_standard_cf_type(); +} + +static void RC_UEQ_S(void) +{ + dst->ops = current_instruction_table.C_UEQ_S; + recomp_func = genc_ueq_s; + recompile_standard_cf_type(); +} + +static void RC_OLT_S(void) +{ + dst->ops = current_instruction_table.C_OLT_S; + recomp_func = genc_olt_s; + recompile_standard_cf_type(); +} + +static void RC_ULT_S(void) +{ + dst->ops = current_instruction_table.C_ULT_S; + recomp_func = genc_ult_s; + recompile_standard_cf_type(); +} + +static void RC_OLE_S(void) +{ + dst->ops = current_instruction_table.C_OLE_S; + recomp_func = genc_ole_s; + recompile_standard_cf_type(); +} + +static void RC_ULE_S(void) +{ + dst->ops = current_instruction_table.C_ULE_S; + recomp_func = genc_ule_s; + recompile_standard_cf_type(); +} + +static void RC_SF_S(void) +{ + dst->ops = current_instruction_table.C_SF_S; + recomp_func = genc_sf_s; + recompile_standard_cf_type(); +} + +static void RC_NGLE_S(void) +{ + dst->ops = current_instruction_table.C_NGLE_S; + recomp_func = genc_ngle_s; + recompile_standard_cf_type(); +} + +static void RC_SEQ_S(void) +{ + dst->ops = current_instruction_table.C_SEQ_S; + recomp_func = genc_seq_s; + recompile_standard_cf_type(); +} + +static void RC_NGL_S(void) +{ + dst->ops = current_instruction_table.C_NGL_S; + recomp_func = genc_ngl_s; + recompile_standard_cf_type(); +} + +static void RC_LT_S(void) +{ + dst->ops = current_instruction_table.C_LT_S; + recomp_func = genc_lt_s; + recompile_standard_cf_type(); +} + +static void RC_NGE_S(void) +{ + dst->ops = current_instruction_table.C_NGE_S; + recomp_func = genc_nge_s; + recompile_standard_cf_type(); +} + +static void RC_LE_S(void) +{ + dst->ops = current_instruction_table.C_LE_S; + recomp_func = genc_le_s; + recompile_standard_cf_type(); +} + +static void RC_NGT_S(void) +{ + dst->ops = current_instruction_table.C_NGT_S; + recomp_func = genc_ngt_s; + recompile_standard_cf_type(); +} + +static void (*recomp_s[64])(void) = +{ + RADD_S , RSUB_S , RMUL_S , RDIV_S , RSQRT_S , RABS_S , RMOV_S , RNEG_S , + RROUND_L_S, RTRUNC_L_S, RCEIL_L_S, RFLOOR_L_S, RROUND_W_S, RTRUNC_W_S, RCEIL_W_S, RFLOOR_W_S, + RSV , RSV , RSV , RSV , RSV , RSV , RSV , RSV , + RSV , RSV , RSV , RSV , RSV , RSV , RSV , RSV , + RSV , RCVT_D_S , RSV , RSV , RCVT_W_S , RCVT_L_S , RSV , RSV , + RSV , RSV , RSV , RSV , RSV , RSV , RSV , RSV , + RC_F_S , RC_UN_S , RC_EQ_S , RC_UEQ_S , RC_OLT_S , RC_ULT_S , RC_OLE_S , RC_ULE_S , + RC_SF_S , RC_NGLE_S , RC_SEQ_S , RC_NGL_S , RC_LT_S , RC_NGE_S , RC_LE_S , RC_NGT_S +}; + +//------------------------------------------------------------------------- +// D +//------------------------------------------------------------------------- + +static void RADD_D(void) +{ + dst->ops = current_instruction_table.ADD_D; + recomp_func = genadd_d; + recompile_standard_cf_type(); +} + +static void RSUB_D(void) +{ + dst->ops = current_instruction_table.SUB_D; + recomp_func = gensub_d; + recompile_standard_cf_type(); +} + +static void RMUL_D(void) +{ + dst->ops = current_instruction_table.MUL_D; + recomp_func = genmul_d; + recompile_standard_cf_type(); +} + +static void RDIV_D(void) +{ + dst->ops = current_instruction_table.DIV_D; + recomp_func = gendiv_d; + recompile_standard_cf_type(); +} + +static void RSQRT_D(void) +{ + dst->ops = current_instruction_table.SQRT_D; + recomp_func = gensqrt_d; + recompile_standard_cf_type(); +} + +static void RABS_D(void) +{ + dst->ops = current_instruction_table.ABS_D; + recomp_func = genabs_d; + recompile_standard_cf_type(); +} + +static void RMOV_D(void) +{ + dst->ops = current_instruction_table.MOV_D; + recomp_func = genmov_d; + recompile_standard_cf_type(); +} + +static void RNEG_D(void) +{ + dst->ops = current_instruction_table.NEG_D; + recomp_func = genneg_d; + recompile_standard_cf_type(); +} + +static void RROUND_L_D(void) +{ + dst->ops = current_instruction_table.ROUND_L_D; + recomp_func = genround_l_d; + recompile_standard_cf_type(); +} + +static void RTRUNC_L_D(void) +{ + dst->ops = current_instruction_table.TRUNC_L_D; + recomp_func = gentrunc_l_d; + recompile_standard_cf_type(); +} + +static void RCEIL_L_D(void) +{ + dst->ops = current_instruction_table.CEIL_L_D; + recomp_func = genceil_l_d; + recompile_standard_cf_type(); +} + +static void RFLOOR_L_D(void) +{ + dst->ops = current_instruction_table.FLOOR_L_D; + recomp_func = genfloor_l_d; + recompile_standard_cf_type(); +} + +static void RROUND_W_D(void) +{ + dst->ops = current_instruction_table.ROUND_W_D; + recomp_func = genround_w_d; + recompile_standard_cf_type(); +} + +static void RTRUNC_W_D(void) +{ + dst->ops = current_instruction_table.TRUNC_W_D; + recomp_func = gentrunc_w_d; + recompile_standard_cf_type(); +} + +static void RCEIL_W_D(void) +{ + dst->ops = current_instruction_table.CEIL_W_D; + recomp_func = genceil_w_d; + recompile_standard_cf_type(); +} + +static void RFLOOR_W_D(void) +{ + dst->ops = current_instruction_table.FLOOR_W_D; + recomp_func = genfloor_w_d; + recompile_standard_cf_type(); +} + +static void RCVT_S_D(void) +{ + dst->ops = current_instruction_table.CVT_S_D; + recomp_func = gencvt_s_d; + recompile_standard_cf_type(); +} + +static void RCVT_W_D(void) +{ + dst->ops = current_instruction_table.CVT_W_D; + recomp_func = gencvt_w_d; + recompile_standard_cf_type(); +} + +static void RCVT_L_D(void) +{ + dst->ops = current_instruction_table.CVT_L_D; + recomp_func = gencvt_l_d; + recompile_standard_cf_type(); +} + +static void RC_F_D(void) +{ + dst->ops = current_instruction_table.C_F_D; + recomp_func = genc_f_d; + recompile_standard_cf_type(); +} + +static void RC_UN_D(void) +{ + dst->ops = current_instruction_table.C_UN_D; + recomp_func = genc_un_d; + recompile_standard_cf_type(); +} + +static void RC_EQ_D(void) +{ + dst->ops = current_instruction_table.C_EQ_D; + recomp_func = genc_eq_d; + recompile_standard_cf_type(); +} + +static void RC_UEQ_D(void) +{ + dst->ops = current_instruction_table.C_UEQ_D; + recomp_func = genc_ueq_d; + recompile_standard_cf_type(); +} + +static void RC_OLT_D(void) +{ + dst->ops = current_instruction_table.C_OLT_D; + recomp_func = genc_olt_d; + recompile_standard_cf_type(); +} + +static void RC_ULT_D(void) +{ + dst->ops = current_instruction_table.C_ULT_D; + recomp_func = genc_ult_d; + recompile_standard_cf_type(); +} + +static void RC_OLE_D(void) +{ + dst->ops = current_instruction_table.C_OLE_D; + recomp_func = genc_ole_d; + recompile_standard_cf_type(); +} + +static void RC_ULE_D(void) +{ + dst->ops = current_instruction_table.C_ULE_D; + recomp_func = genc_ule_d; + recompile_standard_cf_type(); +} + +static void RC_SF_D(void) +{ + dst->ops = current_instruction_table.C_SF_D; + recomp_func = genc_sf_d; + recompile_standard_cf_type(); +} + +static void RC_NGLE_D(void) +{ + dst->ops = current_instruction_table.C_NGLE_D; + recomp_func = genc_ngle_d; + recompile_standard_cf_type(); +} + +static void RC_SEQ_D(void) +{ + dst->ops = current_instruction_table.C_SEQ_D; + recomp_func = genc_seq_d; + recompile_standard_cf_type(); +} + +static void RC_NGL_D(void) +{ + dst->ops = current_instruction_table.C_NGL_D; + recomp_func = genc_ngl_d; + recompile_standard_cf_type(); +} + +static void RC_LT_D(void) +{ + dst->ops = current_instruction_table.C_LT_D; + recomp_func = genc_lt_d; + recompile_standard_cf_type(); +} + +static void RC_NGE_D(void) +{ + dst->ops = current_instruction_table.C_NGE_D; + recomp_func = genc_nge_d; + recompile_standard_cf_type(); +} + +static void RC_LE_D(void) +{ + dst->ops = current_instruction_table.C_LE_D; + recomp_func = genc_le_d; + recompile_standard_cf_type(); +} + +static void RC_NGT_D(void) +{ + dst->ops = current_instruction_table.C_NGT_D; + recomp_func = genc_ngt_d; + recompile_standard_cf_type(); +} + +static void (*recomp_d[64])(void) = +{ + RADD_D , RSUB_D , RMUL_D , RDIV_D , RSQRT_D , RABS_D , RMOV_D , RNEG_D , + RROUND_L_D, RTRUNC_L_D, RCEIL_L_D, RFLOOR_L_D, RROUND_W_D, RTRUNC_W_D, RCEIL_W_D, RFLOOR_W_D, + RSV , RSV , RSV , RSV , RSV , RSV , RSV , RSV , + RSV , RSV , RSV , RSV , RSV , RSV , RSV , RSV , + RCVT_S_D , RSV , RSV , RSV , RCVT_W_D , RCVT_L_D , RSV , RSV , + RSV , RSV , RSV , RSV , RSV , RSV , RSV , RSV , + RC_F_D , RC_UN_D , RC_EQ_D , RC_UEQ_D , RC_OLT_D , RC_ULT_D , RC_OLE_D , RC_ULE_D , + RC_SF_D , RC_NGLE_D , RC_SEQ_D , RC_NGL_D , RC_LT_D , RC_NGE_D , RC_LE_D , RC_NGT_D +}; + +//------------------------------------------------------------------------- +// W +//------------------------------------------------------------------------- + +static void RCVT_S_W(void) +{ + dst->ops = current_instruction_table.CVT_S_W; + recomp_func = gencvt_s_w; + recompile_standard_cf_type(); +} + +static void RCVT_D_W(void) +{ + dst->ops = current_instruction_table.CVT_D_W; + recomp_func = gencvt_d_w; + recompile_standard_cf_type(); +} + +static void (*recomp_w[64])(void) = +{ + RSV , RSV , RSV, RSV, RSV, RSV, RSV, RSV, + RSV , RSV , RSV, RSV, RSV, RSV, RSV, RSV, + RSV , RSV , RSV, RSV, RSV, RSV, RSV, RSV, + RSV , RSV , RSV, RSV, RSV, RSV, RSV, RSV, + RCVT_S_W, RCVT_D_W, RSV, RSV, RSV, RSV, RSV, RSV, + RSV , RSV , RSV, RSV, RSV, RSV, RSV, RSV, + RSV , RSV , RSV, RSV, RSV, RSV, RSV, RSV, + RSV , RSV , RSV, RSV, RSV, RSV, RSV, RSV +}; + +//------------------------------------------------------------------------- +// L +//------------------------------------------------------------------------- + +static void RCVT_S_L(void) +{ + dst->ops = current_instruction_table.CVT_S_L; + recomp_func = gencvt_s_l; + recompile_standard_cf_type(); +} + +static void RCVT_D_L(void) +{ + dst->ops = current_instruction_table.CVT_D_L; + recomp_func = gencvt_d_l; + recompile_standard_cf_type(); +} + +static void (*recomp_l[64])(void) = +{ + RSV , RSV , RSV, RSV, RSV, RSV, RSV, RSV, + RSV , RSV , RSV, RSV, RSV, RSV, RSV, RSV, + RSV , RSV , RSV, RSV, RSV, RSV, RSV, RSV, + RSV , RSV , RSV, RSV, RSV, RSV, RSV, RSV, + RCVT_S_L, RCVT_D_L, RSV, RSV, RSV, RSV, RSV, RSV, + RSV , RSV , RSV, RSV, RSV, RSV, RSV, RSV, + RSV , RSV , RSV, RSV, RSV, RSV, RSV, RSV, + RSV , RSV , RSV, RSV, RSV, RSV, RSV, RSV, +}; + +//------------------------------------------------------------------------- +// COP1 +//------------------------------------------------------------------------- + +static void RMFC1(void) +{ + dst->ops = current_instruction_table.MFC1; + recomp_func = genmfc1; + recompile_standard_r_type(); + dst->f.r.nrd = (src >> 11) & 0x1F; + if (dst->f.r.rt == reg) RNOP(); +} + +static void RDMFC1(void) +{ + dst->ops = current_instruction_table.DMFC1; + recomp_func = gendmfc1; + recompile_standard_r_type(); + dst->f.r.nrd = (src >> 11) & 0x1F; + if (dst->f.r.rt == reg) RNOP(); +} + +static void RCFC1(void) +{ + dst->ops = current_instruction_table.CFC1; + recomp_func = gencfc1; + recompile_standard_r_type(); + dst->f.r.nrd = (src >> 11) & 0x1F; + if (dst->f.r.rt == reg) RNOP(); +} + +static void RMTC1(void) +{ + dst->ops = current_instruction_table.MTC1; + recompile_standard_r_type(); + recomp_func = genmtc1; + dst->f.r.nrd = (src >> 11) & 0x1F; +} + +static void RDMTC1(void) +{ + dst->ops = current_instruction_table.DMTC1; + recompile_standard_r_type(); + recomp_func = gendmtc1; + dst->f.r.nrd = (src >> 11) & 0x1F; +} + +static void RCTC1(void) +{ + dst->ops = current_instruction_table.CTC1; + recompile_standard_r_type(); + recomp_func = genctc1; + dst->f.r.nrd = (src >> 11) & 0x1F; +} + +static void RBC(void) +{ + recomp_bc[((src >> 16) & 3)](); +} + +static void RS(void) +{ + recomp_s[(src & 0x3F)](); +} + +static void RD(void) +{ + recomp_d[(src & 0x3F)](); +} + +static void RW(void) +{ + recomp_w[(src & 0x3F)](); +} + +static void RL(void) +{ + recomp_l[(src & 0x3F)](); +} + +static void (*recomp_cop1[32])(void) = +{ + RMFC1, RDMFC1, RCFC1, RSV, RMTC1, RDMTC1, RCTC1, RSV, + RBC , RSV , RSV , RSV, RSV , RSV , RSV , RSV, + RS , RD , RSV , RSV, RW , RL , RSV , RSV, + RSV , RSV , RSV , RSV, RSV , RSV , RSV , RSV +}; + +//------------------------------------------------------------------------- +// R4300 +//------------------------------------------------------------------------- + +static void RSPECIAL(void) +{ + recomp_special[(src & 0x3F)](); +} + +static void RREGIMM(void) +{ + recomp_regimm[((src >> 16) & 0x1F)](); +} + +static void RJ(void) +{ + unsigned int target; + dst->ops = current_instruction_table.J; + recomp_func = genj; + recompile_standard_j_type(); + target = (dst->f.j.inst_index<<2) | (dst->addr & 0xF0000000); + if (target == dst->addr) + { + if (check_nop) + { + dst->ops = current_instruction_table.J_IDLE; + recomp_func = genj_idle; + } + } + else if (r4300emu != CORE_PURE_INTERPRETER && (target < dst_block->start || target >= dst_block->end || dst->addr == (dst_block->end-4))) + { + dst->ops = current_instruction_table.J_OUT; + recomp_func = genj_out; + } +} + +static void RJAL(void) +{ + unsigned int target; + dst->ops = current_instruction_table.JAL; + recomp_func = genjal; + recompile_standard_j_type(); + target = (dst->f.j.inst_index<<2) | (dst->addr & 0xF0000000); + if (target == dst->addr) + { + if (check_nop) + { + dst->ops = current_instruction_table.JAL_IDLE; + recomp_func = genjal_idle; + } + } + else if (r4300emu != CORE_PURE_INTERPRETER && (target < dst_block->start || target >= dst_block->end || dst->addr == (dst_block->end-4))) + { + dst->ops = current_instruction_table.JAL_OUT; + recomp_func = genjal_out; + } +} + +static void RBEQ(void) +{ + unsigned int target; + dst->ops = current_instruction_table.BEQ; + recomp_func = genbeq; + recompile_standard_i_type(); + target = dst->addr + dst->f.i.immediate*4 + 4; + if (target == dst->addr) + { + if (check_nop) + { + dst->ops = current_instruction_table.BEQ_IDLE; + recomp_func = genbeq_idle; + } + } + else if (r4300emu != CORE_PURE_INTERPRETER && (target < dst_block->start || target >= dst_block->end || dst->addr == (dst_block->end-4))) + { + dst->ops = current_instruction_table.BEQ_OUT; + recomp_func = genbeq_out; + } +} + +static void RBNE(void) +{ + unsigned int target; + dst->ops = current_instruction_table.BNE; + recomp_func = genbne; + recompile_standard_i_type(); + target = dst->addr + dst->f.i.immediate*4 + 4; + if (target == dst->addr) + { + if (check_nop) + { + dst->ops = current_instruction_table.BNE_IDLE; + recomp_func = genbne_idle; + } + } + else if (r4300emu != CORE_PURE_INTERPRETER && (target < dst_block->start || target >= dst_block->end || dst->addr == (dst_block->end-4))) + { + dst->ops = current_instruction_table.BNE_OUT; + recomp_func = genbne_out; + } +} + +static void RBLEZ(void) +{ + unsigned int target; + dst->ops = current_instruction_table.BLEZ; + recomp_func = genblez; + recompile_standard_i_type(); + target = dst->addr + dst->f.i.immediate*4 + 4; + if (target == dst->addr) + { + if (check_nop) + { + dst->ops = current_instruction_table.BLEZ_IDLE; + recomp_func = genblez_idle; + } + } + else if (r4300emu != CORE_PURE_INTERPRETER && (target < dst_block->start || target >= dst_block->end || dst->addr == (dst_block->end-4))) + { + dst->ops = current_instruction_table.BLEZ_OUT; + recomp_func = genblez_out; + } +} + +static void RBGTZ(void) +{ + unsigned int target; + dst->ops = current_instruction_table.BGTZ; + recomp_func = genbgtz; + recompile_standard_i_type(); + target = dst->addr + dst->f.i.immediate*4 + 4; + if (target == dst->addr) + { + if (check_nop) + { + dst->ops = current_instruction_table.BGTZ_IDLE; + recomp_func = genbgtz_idle; + } + } + else if (r4300emu != CORE_PURE_INTERPRETER && (target < dst_block->start || target >= dst_block->end || dst->addr == (dst_block->end-4))) + { + dst->ops = current_instruction_table.BGTZ_OUT; + recomp_func = genbgtz_out; + } +} + +static void RADDI(void) +{ + dst->ops = current_instruction_table.ADDI; + recomp_func = genaddi; + recompile_standard_i_type(); + if(dst->f.i.rt == reg) RNOP(); +} + +static void RADDIU(void) +{ + dst->ops = current_instruction_table.ADDIU; + recomp_func = genaddiu; + recompile_standard_i_type(); + if(dst->f.i.rt == reg) RNOP(); +} + +static void RSLTI(void) +{ + dst->ops = current_instruction_table.SLTI; + recomp_func = genslti; + recompile_standard_i_type(); + if(dst->f.i.rt == reg) RNOP(); +} + +static void RSLTIU(void) +{ + dst->ops = current_instruction_table.SLTIU; + recomp_func = gensltiu; + recompile_standard_i_type(); + if(dst->f.i.rt == reg) RNOP(); +} + +static void RANDI(void) +{ + dst->ops = current_instruction_table.ANDI; + recomp_func = genandi; + recompile_standard_i_type(); + if(dst->f.i.rt == reg) RNOP(); +} + +static void RORI(void) +{ + dst->ops = current_instruction_table.ORI; + recomp_func = genori; + recompile_standard_i_type(); + if (dst->f.i.rt == reg) RNOP(); +} + +static void RXORI(void) +{ + dst->ops = current_instruction_table.XORI; + recomp_func = genxori; + recompile_standard_i_type(); + if (dst->f.i.rt == reg) RNOP(); +} + +static void RLUI(void) +{ + dst->ops = current_instruction_table.LUI; + recomp_func = genlui; + recompile_standard_i_type(); + if (dst->f.i.rt == reg) RNOP(); +} + +static void RCOP0(void) +{ + recomp_cop0[((src >> 21) & 0x1F)](); +} + +static void RCOP1(void) +{ + recomp_cop1[((src >> 21) & 0x1F)](); +} + +static void RBEQL(void) +{ + unsigned int target; + dst->ops = current_instruction_table.BEQL; + recomp_func = genbeql; + recompile_standard_i_type(); + target = dst->addr + dst->f.i.immediate*4 + 4; + if (target == dst->addr) + { + if (check_nop) + { + dst->ops = current_instruction_table.BEQL_IDLE; + recomp_func = genbeql_idle; + } + } + else if (r4300emu != CORE_PURE_INTERPRETER && (target < dst_block->start || target >= dst_block->end || dst->addr == (dst_block->end-4))) + { + dst->ops = current_instruction_table.BEQL_OUT; + recomp_func = genbeql_out; + } +} + +static void RBNEL(void) +{ + unsigned int target; + dst->ops = current_instruction_table.BNEL; + recomp_func = genbnel; + recompile_standard_i_type(); + target = dst->addr + dst->f.i.immediate*4 + 4; + if (target == dst->addr) + { + if (check_nop) + { + dst->ops = current_instruction_table.BNEL_IDLE; + recomp_func = genbnel_idle; + } + } + else if (r4300emu != CORE_PURE_INTERPRETER && (target < dst_block->start || target >= dst_block->end || dst->addr == (dst_block->end-4))) + { + dst->ops = current_instruction_table.BNEL_OUT; + recomp_func = genbnel_out; + } +} + +static void RBLEZL(void) +{ + unsigned int target; + dst->ops = current_instruction_table.BLEZL; + recomp_func = genblezl; + recompile_standard_i_type(); + target = dst->addr + dst->f.i.immediate*4 + 4; + if (target == dst->addr) + { + if (check_nop) + { + dst->ops = current_instruction_table.BLEZL_IDLE; + recomp_func = genblezl_idle; + } + } + else if (r4300emu != CORE_PURE_INTERPRETER && (target < dst_block->start || target >= dst_block->end || dst->addr == (dst_block->end-4))) + { + dst->ops = current_instruction_table.BLEZL_OUT; + recomp_func = genblezl_out; + } +} + +static void RBGTZL(void) +{ + unsigned int target; + dst->ops = current_instruction_table.BGTZL; + recomp_func = genbgtzl; + recompile_standard_i_type(); + target = dst->addr + dst->f.i.immediate*4 + 4; + if (target == dst->addr) + { + if (check_nop) + { + dst->ops = current_instruction_table.BGTZL_IDLE; + recomp_func = genbgtzl_idle; + } + } + else if (r4300emu != CORE_PURE_INTERPRETER && (target < dst_block->start || target >= dst_block->end || dst->addr == (dst_block->end-4))) + { + dst->ops = current_instruction_table.BGTZL_OUT; + recomp_func = genbgtzl_out; + } +} + +static void RDADDI(void) +{ + dst->ops = current_instruction_table.DADDI; + recomp_func = gendaddi; + recompile_standard_i_type(); + if(dst->f.i.rt == reg) RNOP(); +} + +static void RDADDIU(void) +{ + dst->ops = current_instruction_table.DADDIU; + recomp_func = gendaddiu; + recompile_standard_i_type(); + if(dst->f.i.rt == reg) RNOP(); +} + +static void RLDL(void) +{ + dst->ops = current_instruction_table.LDL; + recomp_func = genldl; + recompile_standard_i_type(); + if(dst->f.i.rt == reg) RNOP(); +} + +static void RLDR(void) +{ + dst->ops = current_instruction_table.LDR; + recomp_func = genldr; + recompile_standard_i_type(); + if(dst->f.i.rt == reg) RNOP(); +} + +static void RLB(void) +{ + dst->ops = current_instruction_table.LB; + recomp_func = genlb; + recompile_standard_i_type(); + if (dst->f.i.rt == reg) RNOP(); +} + +static void RLH(void) +{ + dst->ops = current_instruction_table.LH; + recomp_func = genlh; + recompile_standard_i_type(); + if (dst->f.i.rt == reg) RNOP(); +} + +static void RLWL(void) +{ + dst->ops = current_instruction_table.LWL; + recomp_func = genlwl; + recompile_standard_i_type(); + if (dst->f.i.rt == reg) RNOP(); +} + +static void RLW(void) +{ + dst->ops = current_instruction_table.LW; + recomp_func = genlw; + recompile_standard_i_type(); + if (dst->f.i.rt == reg) RNOP(); +} + +static void RLBU(void) +{ + dst->ops = current_instruction_table.LBU; + recomp_func = genlbu; + recompile_standard_i_type(); + if(dst->f.i.rt == reg) RNOP(); +} + +static void RLHU(void) +{ + dst->ops = current_instruction_table.LHU; + recomp_func = genlhu; + recompile_standard_i_type(); + if(dst->f.i.rt == reg) RNOP(); +} + +static void RLWR(void) +{ + dst->ops = current_instruction_table.LWR; + recomp_func = genlwr; + recompile_standard_i_type(); + if(dst->f.i.rt == reg) RNOP(); +} + +static void RLWU(void) +{ + dst->ops = current_instruction_table.LWU; + recomp_func = genlwu; + recompile_standard_i_type(); + if(dst->f.i.rt == reg) RNOP(); +} + +static void RSB(void) +{ + dst->ops = current_instruction_table.SB; + recomp_func = gensb; + recompile_standard_i_type(); +} + +static void RSH(void) +{ + dst->ops = current_instruction_table.SH; + recomp_func = gensh; + recompile_standard_i_type(); +} + +static void RSWL(void) +{ + dst->ops = current_instruction_table.SWL; + recomp_func = genswl; + recompile_standard_i_type(); +} + +static void RSW(void) +{ + dst->ops = current_instruction_table.SW; + recomp_func = gensw; + recompile_standard_i_type(); +} + +static void RSDL(void) +{ + dst->ops = current_instruction_table.SDL; + recomp_func = gensdl; + recompile_standard_i_type(); +} + +static void RSDR(void) +{ + dst->ops = current_instruction_table.SDR; + recomp_func = gensdr; + recompile_standard_i_type(); +} + +static void RSWR(void) +{ + dst->ops = current_instruction_table.SWR; + recomp_func = genswr; + recompile_standard_i_type(); +} + +static void RCACHE(void) +{ + recomp_func = gencache; + dst->ops = current_instruction_table.CACHE; +} + +static void RLL(void) +{ + recomp_func = genll; + dst->ops = current_instruction_table.LL; + recompile_standard_i_type(); + if(dst->f.i.rt == reg) RNOP(); +} + +static void RLWC1(void) +{ + dst->ops = current_instruction_table.LWC1; + recomp_func = genlwc1; + recompile_standard_lf_type(); +} + +static void RLLD(void) +{ + dst->ops = current_instruction_table.NI; + recomp_func = genni; + recompile_standard_i_type(); +} + +static void RLDC1(void) +{ + dst->ops = current_instruction_table.LDC1; + recomp_func = genldc1; + recompile_standard_lf_type(); +} + +static void RLD(void) +{ + dst->ops = current_instruction_table.LD; + recomp_func = genld; + recompile_standard_i_type(); + if (dst->f.i.rt == reg) RNOP(); +} + +static void RSC(void) +{ + dst->ops = current_instruction_table.SC; + recomp_func = gensc; + recompile_standard_i_type(); + if (dst->f.i.rt == reg) RNOP(); +} + +static void RSWC1(void) +{ + dst->ops = current_instruction_table.SWC1; + recomp_func = genswc1; + recompile_standard_lf_type(); +} + +static void RSCD(void) +{ + dst->ops = current_instruction_table.NI; + recomp_func = genni; + recompile_standard_i_type(); +} + +static void RSDC1(void) +{ + dst->ops = current_instruction_table.SDC1; + recomp_func = gensdc1; + recompile_standard_lf_type(); +} + +static void RSD(void) +{ + dst->ops = current_instruction_table.SD; + recomp_func = gensd; + recompile_standard_i_type(); +} + +static void (*recomp_ops[64])(void) = +{ + RSPECIAL, RREGIMM, RJ , RJAL , RBEQ , RBNE , RBLEZ , RBGTZ , + RADDI , RADDIU , RSLTI, RSLTIU, RANDI, RORI , RXORI , RLUI , + RCOP0 , RCOP1 , RSV , RSV , RBEQL, RBNEL, RBLEZL, RBGTZL, + RDADDI , RDADDIU, RLDL , RLDR , RSV , RSV , RSV , RSV , + RLB , RLH , RLWL , RLW , RLBU , RLHU , RLWR , RLWU , + RSB , RSH , RSWL , RSW , RSDL , RSDR , RSWR , RCACHE, + RLL , RLWC1 , RSV , RSV , RLLD , RLDC1, RSV , RLD , + RSC , RSWC1 , RSV , RSV , RSCD , RSDC1, RSV , RSD +}; + +static int get_block_length(const precomp_block *block) +{ + return (block->end-block->start)/4; +} + +static size_t get_block_memsize(const precomp_block *block) +{ + int length = get_block_length(block); + return ((length+1)+(length>>2)) * sizeof(precomp_instr); +} + +/********************************************************************** + ******************** initialize an empty block *********************** + **********************************************************************/ +void init_block(precomp_block *block) +{ + int i, length, already_exist = 1; + static int init_length; + start_section(COMPILER_SECTION); +#ifdef CORE_DBG + DebugMessage(M64MSG_INFO, "init block %x - %x", (int) block->start, (int) block->end); +#endif + + length = get_block_length(block); + + if (!block->block) + { + size_t memsize = get_block_memsize(block); + if (r4300emu == CORE_DYNAREC) { + block->block = (precomp_instr *) malloc_exec(memsize); + if (!block->block) { + DebugMessage(M64MSG_ERROR, "Memory error: couldn't allocate executable memory for dynamic recompiler. Try to use an interpreter mode."); + return; + } + } + else { + block->block = (precomp_instr *) malloc(memsize); + if (!block->block) { + DebugMessage(M64MSG_ERROR, "Memory error: couldn't allocate memory for cached interpreter."); + return; + } + } + + memset(block->block, 0, memsize); + already_exist = 0; + } + + if (r4300emu == CORE_DYNAREC) + { + if (!block->code) + { +#if defined(PROFILE_R4300) + max_code_length = 524288; /* allocate so much code space that we'll never have to realloc(), because this may */ + /* cause instruction locations to move, and break our profiling data */ +#else + max_code_length = 32768; +#endif + block->code = (unsigned char *) malloc_exec(max_code_length); + } + else + { + max_code_length = block->max_code_length; + } + code_length = 0; + inst_pointer = &block->code; + + if (block->jumps_table) + { + free(block->jumps_table); + block->jumps_table = NULL; + } + if (block->riprel_table) + { + free(block->riprel_table); + block->riprel_table = NULL; + } + init_assembler(NULL, 0, NULL, 0); + init_cache(block->block); + } + + if (!already_exist) + { +#if defined(PROFILE_R4300) + pfProfile = fopen("instructionaddrs.dat", "ab"); + long x86addr = (long) block->code; + int mipsop = -2; /* -2 == NOTCOMPILED block at beginning of x86 code */ + if (fwrite(&mipsop, 1, 4, pfProfile) != 4 || // write 4-byte MIPS opcode + fwrite(&x86addr, 1, sizeof(char *), pfProfile) != sizeof(char *)) // write pointer to dynamically generated x86 code for this MIPS instruction + DebugMessage(M64MSG_ERROR, "Error writing R4300 instruction address profiling data"); +#endif + + for (i=0; iblock + i; + dst->addr = block->start + i*4; + dst->reg_cache_infos.need_map = 0; + dst->local_addr = code_length; +#ifdef COMPARE_CORE + if (r4300emu == CORE_DYNAREC) gendebug(); +#endif + RNOTCOMPILED(); + if (r4300emu == CORE_DYNAREC) recomp_func(); + } +#if defined(PROFILE_R4300) + fclose(pfProfile); + pfProfile = NULL; +#endif + init_length = code_length; + } + else + { +#if defined(PROFILE_R4300) + code_length = block->code_length; /* leave old instructions in their place */ +#else + code_length = init_length; /* recompile everything, overwrite old recompiled instructions */ +#endif + for (i=0; iblock + i; + dst->reg_cache_infos.need_map = 0; + dst->local_addr = i * (init_length / length); + dst->ops = current_instruction_table.NOTCOMPILED; + } + } + + if (r4300emu == CORE_DYNAREC) + { + free_all_registers(); + /* calling pass2 of the assembler is not necessary here because all of the code emitted by + gennotcompiled() and gendebug() is position-independent and contains no jumps . */ + block->code_length = code_length; + block->max_code_length = max_code_length; + free_assembler(&block->jumps_table, &block->jumps_number, &block->riprel_table, &block->riprel_number); + } + + /* here we're marking the block as a valid code even if it's not compiled + * yet as the game should have already set up the code correctly. + */ + invalid_code[block->start>>12] = 0; + if (block->end < 0x80000000 || block->start >= 0xc0000000) + { + unsigned int paddr; + + paddr = virtual_to_physical_address(block->start, 2); + invalid_code[paddr>>12] = 0; + if (!blocks[paddr>>12]) + { + blocks[paddr>>12] = (precomp_block *) malloc(sizeof(precomp_block)); + blocks[paddr>>12]->code = NULL; + blocks[paddr>>12]->block = NULL; + blocks[paddr>>12]->jumps_table = NULL; + blocks[paddr>>12]->riprel_table = NULL; + blocks[paddr>>12]->start = paddr & ~0xFFF; + blocks[paddr>>12]->end = (paddr & ~0xFFF) + 0x1000; + } + init_block(blocks[paddr>>12]); + + paddr += block->end - block->start - 4; + invalid_code[paddr>>12] = 0; + if (!blocks[paddr>>12]) + { + blocks[paddr>>12] = (precomp_block *) malloc(sizeof(precomp_block)); + blocks[paddr>>12]->code = NULL; + blocks[paddr>>12]->block = NULL; + blocks[paddr>>12]->jumps_table = NULL; + blocks[paddr>>12]->riprel_table = NULL; + blocks[paddr>>12]->start = paddr & ~0xFFF; + blocks[paddr>>12]->end = (paddr & ~0xFFF) + 0x1000; + } + init_block(blocks[paddr>>12]); + } + else + { + if (block->start >= 0x80000000 && block->end < 0xa0000000 && invalid_code[(block->start+0x20000000)>>12]) + { + if (!blocks[(block->start+0x20000000)>>12]) + { + blocks[(block->start+0x20000000)>>12] = (precomp_block *) malloc(sizeof(precomp_block)); + blocks[(block->start+0x20000000)>>12]->code = NULL; + blocks[(block->start+0x20000000)>>12]->block = NULL; + blocks[(block->start+0x20000000)>>12]->jumps_table = NULL; + blocks[(block->start+0x20000000)>>12]->riprel_table = NULL; + blocks[(block->start+0x20000000)>>12]->start = (block->start+0x20000000) & ~0xFFF; + blocks[(block->start+0x20000000)>>12]->end = ((block->start+0x20000000) & ~0xFFF) + 0x1000; + } + init_block(blocks[(block->start+0x20000000)>>12]); + } + if (block->start >= 0xa0000000 && block->end < 0xc0000000 && invalid_code[(block->start-0x20000000)>>12]) + { + if (!blocks[(block->start-0x20000000)>>12]) + { + blocks[(block->start-0x20000000)>>12] = (precomp_block *) malloc(sizeof(precomp_block)); + blocks[(block->start-0x20000000)>>12]->code = NULL; + blocks[(block->start-0x20000000)>>12]->block = NULL; + blocks[(block->start-0x20000000)>>12]->jumps_table = NULL; + blocks[(block->start-0x20000000)>>12]->riprel_table = NULL; + blocks[(block->start-0x20000000)>>12]->start = (block->start-0x20000000) & ~0xFFF; + blocks[(block->start-0x20000000)>>12]->end = ((block->start-0x20000000) & ~0xFFF) + 0x1000; + } + init_block(blocks[(block->start-0x20000000)>>12]); + } + } + end_section(COMPILER_SECTION); +} + +void free_block(precomp_block *block) +{ + size_t memsize = get_block_memsize(block); + + if (block->block) { + if (r4300emu == CORE_DYNAREC) + free_exec(block->block, memsize); + else + free(block->block); + block->block = NULL; + } + if (block->code) { free_exec(block->code, block->max_code_length); block->code = NULL; } + if (block->jumps_table) { free(block->jumps_table); block->jumps_table = NULL; } + if (block->riprel_table) { free(block->riprel_table); block->riprel_table = NULL; } +} + +/********************************************************************** + ********************* recompile a block of code ********************** + **********************************************************************/ +void recompile_block(int *source, precomp_block *block, unsigned int func) +{ + int i, length, finished=0; + start_section(COMPILER_SECTION); + length = (block->end-block->start)/4; + dst_block = block; + + //for (i=0; i<16; i++) block->md5[i] = 0; + block->adler32 = 0; + + if (r4300emu == CORE_DYNAREC) + { + code_length = block->code_length; + max_code_length = block->max_code_length; + inst_pointer = &block->code; + init_assembler(block->jumps_table, block->jumps_number, block->riprel_table, block->riprel_number); + init_cache(block->block + (func & 0xFFF) / 4); + } + +#if defined(PROFILE_R4300) + pfProfile = fopen("instructionaddrs.dat", "ab"); +#endif + + for (i = (func & 0xFFF) / 4; finished != 2; i++) + { + if(block->start < 0x80000000 || block->start >= 0xc0000000) + { + unsigned int address2 = + virtual_to_physical_address(block->start + i*4, 0); + if(blocks[address2>>12]->block[(address2&0xFFF)/4].ops == current_instruction_table.NOTCOMPILED) + blocks[address2>>12]->block[(address2&0xFFF)/4].ops = current_instruction_table.NOTCOMPILED2; + } + + SRC = source + i; + src = source[i]; + check_nop = source[i+1] == 0; + dst = block->block + i; + dst->addr = block->start + i*4; + dst->reg_cache_infos.need_map = 0; + dst->local_addr = code_length; +#ifdef COMPARE_CORE + if (r4300emu == CORE_DYNAREC) gendebug(); +#endif +#if defined(PROFILE_R4300) + long x86addr = (long) (block->code + block->block[i].local_addr); + if (fwrite(source + i, 1, 4, pfProfile) != 4 || // write 4-byte MIPS opcode + fwrite(&x86addr, 1, sizeof(char *), pfProfile) != sizeof(char *)) // write pointer to dynamically generated x86 code for this MIPS instruction + DebugMessage(M64MSG_ERROR, "Error writing R4300 instruction address profiling data"); +#endif + recomp_func = NULL; + recomp_ops[((src >> 26) & 0x3F)](); + if (r4300emu == CORE_DYNAREC) recomp_func(); + dst = block->block + i; + + /*if ((dst+1)->ops != NOTCOMPILED && !delay_slot_compiled && + i < length) + { + if (r4300emu == CORE_DYNAREC) genlink_subblock(); + finished = 2; + }*/ + if (delay_slot_compiled) + { + delay_slot_compiled--; + free_all_registers(); + } + + if (i >= length-2+(length>>2)) finished = 2; + if (i >= (length-1) && (block->start == 0xa4000000 || + block->start >= 0xc0000000 || + block->end < 0x80000000)) finished = 2; + if (dst->ops == current_instruction_table.ERET || finished == 1) finished = 2; + if (/*i >= length &&*/ + (dst->ops == current_instruction_table.J || + dst->ops == current_instruction_table.J_OUT || + dst->ops == current_instruction_table.JR) && + !(i >= (length-1) && (block->start >= 0xc0000000 || + block->end < 0x80000000))) + finished = 1; + } + +#if defined(PROFILE_R4300) + long x86addr = (long) (block->code + code_length); + int mipsop = -3; /* -3 == block-postfix */ + if (fwrite(&mipsop, 1, 4, pfProfile) != 4 || // write 4-byte MIPS opcode + fwrite(&x86addr, 1, sizeof(char *), pfProfile) != sizeof(char *)) // write pointer to dynamically generated x86 code for this MIPS instruction + DebugMessage(M64MSG_ERROR, "Error writing R4300 instruction address profiling data"); +#endif + + if (i >= length) + { + dst = block->block + i; + dst->addr = block->start + i*4; + dst->reg_cache_infos.need_map = 0; + dst->local_addr = code_length; +#ifdef COMPARE_CORE + if (r4300emu == CORE_DYNAREC) gendebug(); +#endif + RFIN_BLOCK(); + if (r4300emu == CORE_DYNAREC) recomp_func(); + i++; + if (i < length-1+(length>>2)) // useful when last opcode is a jump + { + dst = block->block + i; + dst->addr = block->start + i*4; + dst->reg_cache_infos.need_map = 0; + dst->local_addr = code_length; +#ifdef COMPARE_CORE + if (r4300emu == CORE_DYNAREC) gendebug(); +#endif + RFIN_BLOCK(); + if (r4300emu == CORE_DYNAREC) recomp_func(); + i++; + } + } + else if (r4300emu == CORE_DYNAREC) genlink_subblock(); + + if (r4300emu == CORE_DYNAREC) + { + free_all_registers(); + passe2(block->block, (func&0xFFF)/4, i, block); + block->code_length = code_length; + block->max_code_length = max_code_length; + free_assembler(&block->jumps_table, &block->jumps_number, &block->riprel_table, &block->riprel_number); + } +#ifdef CORE_DBG + DebugMessage(M64MSG_INFO, "block recompiled (%x-%x)", (int)func, (int)(block->start+i*4)); +#endif +#if defined(PROFILE_R4300) + fclose(pfProfile); + pfProfile = NULL; +#endif + end_section(COMPILER_SECTION); +} + +static int is_jump(void) +{ + recomp_ops[((src >> 26) & 0x3F)](); + return + (dst->ops == current_instruction_table.J || + dst->ops == current_instruction_table.J_OUT || + dst->ops == current_instruction_table.J_IDLE || + dst->ops == current_instruction_table.JAL || + dst->ops == current_instruction_table.JAL_OUT || + dst->ops == current_instruction_table.JAL_IDLE || + dst->ops == current_instruction_table.BEQ || + dst->ops == current_instruction_table.BEQ_OUT || + dst->ops == current_instruction_table.BEQ_IDLE || + dst->ops == current_instruction_table.BNE || + dst->ops == current_instruction_table.BNE_OUT || + dst->ops == current_instruction_table.BNE_IDLE || + dst->ops == current_instruction_table.BLEZ || + dst->ops == current_instruction_table.BLEZ_OUT || + dst->ops == current_instruction_table.BLEZ_IDLE || + dst->ops == current_instruction_table.BGTZ || + dst->ops == current_instruction_table.BGTZ_OUT || + dst->ops == current_instruction_table.BGTZ_IDLE || + dst->ops == current_instruction_table.BEQL || + dst->ops == current_instruction_table.BEQL_OUT || + dst->ops == current_instruction_table.BEQL_IDLE || + dst->ops == current_instruction_table.BNEL || + dst->ops == current_instruction_table.BNEL_OUT || + dst->ops == current_instruction_table.BNEL_IDLE || + dst->ops == current_instruction_table.BLEZL || + dst->ops == current_instruction_table.BLEZL_OUT || + dst->ops == current_instruction_table.BLEZL_IDLE || + dst->ops == current_instruction_table.BGTZL || + dst->ops == current_instruction_table.BGTZL_OUT || + dst->ops == current_instruction_table.BGTZL_IDLE || + dst->ops == current_instruction_table.JR || + dst->ops == current_instruction_table.JALR || + dst->ops == current_instruction_table.BLTZ || + dst->ops == current_instruction_table.BLTZ_OUT || + dst->ops == current_instruction_table.BLTZ_IDLE || + dst->ops == current_instruction_table.BGEZ || + dst->ops == current_instruction_table.BGEZ_OUT || + dst->ops == current_instruction_table.BGEZ_IDLE || + dst->ops == current_instruction_table.BLTZL || + dst->ops == current_instruction_table.BLTZL_OUT || + dst->ops == current_instruction_table.BLTZL_IDLE || + dst->ops == current_instruction_table.BGEZL || + dst->ops == current_instruction_table.BGEZL_OUT || + dst->ops == current_instruction_table.BGEZL_IDLE || + dst->ops == current_instruction_table.BLTZAL || + dst->ops == current_instruction_table.BLTZAL_OUT || + dst->ops == current_instruction_table.BLTZAL_IDLE || + dst->ops == current_instruction_table.BGEZAL || + dst->ops == current_instruction_table.BGEZAL_OUT || + dst->ops == current_instruction_table.BGEZAL_IDLE || + dst->ops == current_instruction_table.BLTZALL || + dst->ops == current_instruction_table.BLTZALL_OUT || + dst->ops == current_instruction_table.BLTZALL_IDLE || + dst->ops == current_instruction_table.BGEZALL || + dst->ops == current_instruction_table.BGEZALL_OUT || + dst->ops == current_instruction_table.BGEZALL_IDLE || + dst->ops == current_instruction_table.BC1F || + dst->ops == current_instruction_table.BC1F_OUT || + dst->ops == current_instruction_table.BC1F_IDLE || + dst->ops == current_instruction_table.BC1T || + dst->ops == current_instruction_table.BC1T_OUT || + dst->ops == current_instruction_table.BC1T_IDLE || + dst->ops == current_instruction_table.BC1FL || + dst->ops == current_instruction_table.BC1FL_OUT || + dst->ops == current_instruction_table.BC1FL_IDLE || + dst->ops == current_instruction_table.BC1TL || + dst->ops == current_instruction_table.BC1TL_OUT || + dst->ops == current_instruction_table.BC1TL_IDLE); +} + +/********************************************************************** + ************ recompile only one opcode (use for delay slot) ********** + **********************************************************************/ +void recompile_opcode(void) +{ + SRC++; + src = *SRC; + dst++; + dst->addr = (dst-1)->addr + 4; + dst->reg_cache_infos.need_map = 0; + if(!is_jump()) + { +#if defined(PROFILE_R4300) + long x86addr = (long) ((*inst_pointer) + code_length); + if (fwrite(&src, 1, 4, pfProfile) != 4 || // write 4-byte MIPS opcode + fwrite(&x86addr, 1, sizeof(char *), pfProfile) != sizeof(char *)) // write pointer to dynamically generated x86 code for this MIPS instruction + DebugMessage(M64MSG_ERROR, "Error writing R4300 instruction address profiling data"); +#endif + recomp_func = NULL; + recomp_ops[((src >> 26) & 0x3F)](); + if (r4300emu == CORE_DYNAREC) recomp_func(); + } + else + { + RNOP(); + if (r4300emu == CORE_DYNAREC) recomp_func(); + } + delay_slot_compiled = 2; +} + +/********************************************************************** + ************** decode one opcode (for the interpreter) *************** + **********************************************************************/ +void prefetch_opcode(unsigned int op, unsigned int nextop) +{ + dst = PC; + src = op; + check_nop = nextop == 0; + recomp_ops[((src >> 26) & 0x3F)](); +} + +/********************************************************************** + ************** allocate memory with executable bit set *************** + **********************************************************************/ +static void *malloc_exec(size_t size) +{ +#if defined(WIN32) + return VirtualAlloc(NULL, size, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); +#elif defined(__GNUC__) + + #ifndef MAP_ANONYMOUS + #ifdef MAP_ANON + #define MAP_ANONYMOUS MAP_ANON + #endif + #endif + + void *block = mmap(NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + if (block == MAP_FAILED) + { DebugMessage(M64MSG_ERROR, "Memory error: couldn't allocate %zi byte block of aligned RWX memory.", size); return NULL; } + + return block; +#else + return malloc(size); +#endif +} + +/********************************************************************** + ************* reallocate memory with executable bit set ************** + **********************************************************************/ +void *realloc_exec(void *ptr, size_t oldsize, size_t newsize) +{ + void* block = malloc_exec(newsize); + if (block != NULL) + { + size_t copysize; + if (oldsize < newsize) + copysize = oldsize; + else + copysize = newsize; + memcpy(block, ptr, copysize); + } + free_exec(ptr, oldsize); + return block; +} + +/********************************************************************** + **************** frees memory with executable bit set **************** + **********************************************************************/ +static void free_exec(void *ptr, size_t length) +{ +#if defined(WIN32) + VirtualFree(ptr, 0, MEM_RELEASE); +#elif defined(__GNUC__) + munmap(ptr, length); +#else + free(ptr); +#endif +} diff --git a/libmupen64plus/mupen64plus-core/src/r4300/recomp.h b/libmupen64plus/mupen64plus-core/src/r4300/recomp.h new file mode 100644 index 0000000000..f161520b92 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/recomp.h @@ -0,0 +1,110 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - recomp.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef RECOMP_H +#define RECOMP_H + +#include +#if defined(__x86_64__) + #include "x86_64/assemble_struct.h" +#else + #include "x86/assemble_struct.h" +#endif + +typedef struct _precomp_instr +{ + void (*ops)(void); + union + { + struct + { + long long int *rs; + long long int *rt; + short immediate; + } i; + struct + { + unsigned int inst_index; + } j; + struct + { + long long int *rs; + long long int *rt; + long long int *rd; + unsigned char sa; + unsigned char nrd; + } r; + struct + { + unsigned char base; + unsigned char ft; + short offset; + } lf; + struct + { + unsigned char ft; + unsigned char fs; + unsigned char fd; + } cf; + } f; + unsigned int addr; /* word-aligned instruction address in r4300 address space */ + unsigned int local_addr; /* byte offset to start of corresponding x86_64 instructions, from start of code block */ + reg_cache_struct reg_cache_infos; +} precomp_instr; + +typedef struct _precomp_block +{ + precomp_instr *block; + unsigned int start; + unsigned int end; + unsigned char *code; + unsigned int code_length; + unsigned int max_code_length; + void *jumps_table; + int jumps_number; + void *riprel_table; + int riprel_number; + //unsigned char md5[16]; + unsigned int adler32; +} precomp_block; + +void recompile_block(int *source, precomp_block *block, unsigned int func); +void init_block(precomp_block *block); +void free_block(precomp_block *block); +void recompile_opcode(void); +void prefetch_opcode(unsigned int op, unsigned int nextop); +void dyna_jump(void); +void dyna_start(void *code); +void dyna_stop(void); +void *realloc_exec(void *ptr, size_t oldsize, size_t newsize); + +extern precomp_instr *dst; /* precomp_instr structure for instruction being recompiled */ + +#if defined(__x86_64__) + #include "x86_64/assemble.h" + #include "x86_64/regcache.h" +#else + #include "x86/assemble.h" + #include "x86/regcache.h" +#endif + +#endif + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/recomph.h b/libmupen64plus/mupen64plus-core/src/r4300/recomph.h new file mode 100644 index 0000000000..eb88c0f468 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/recomph.h @@ -0,0 +1,308 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - recomph.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef RECOMPH_H +#define RECOMPH_H + +#include "recomp.h" + +#if defined(COUNT_INSTR) +extern unsigned int instr_count[132]; +extern unsigned int instr_type[131]; +extern char instr_name[][10]; +extern char instr_typename[][20]; +#endif + +extern int code_length; +extern int max_code_length; +extern unsigned char **inst_pointer; +extern precomp_block* dst_block; +extern int fast_memory; +extern int src; /* opcode of r4300 instruction being recompiled */ + +#if defined(PROFILE_R4300) + #include + extern FILE *pfProfile; +#endif + +void passe2(precomp_instr *dest, int start, int end, precomp_block* block); +void init_assembler(void *block_jumps_table, int block_jumps_number, void *block_riprel_table, int block_riprel_number); +void free_assembler(void **block_jumps_table, int *block_jumps_number, void **block_riprel_table, int *block_riprel_number); + +void gencallinterp(unsigned long addr, int jump); + +void genupdate_system(int type); +void genbnel(void); +void genblezl(void); +void genlw(void); +void genlbu(void); +void genlhu(void); +void gensb(void); +void gensh(void); +void gensw(void); +void gencache(void); +void genlwc1(void); +void genld(void); +void gensd(void); +void genbeq(void); +void genbne(void); +void genblez(void); +void genaddi(void); +void genaddiu(void); +void genslti(void); +void gensltiu(void); +void genandi(void); +void genori(void); +void genxori(void); +void genlui(void); +void genbeql(void); +void genmul_s(void); +void gendiv_s(void); +void gencvt_d_s(void); +void genadd_d(void); +void gentrunc_w_d(void); +void gencvt_s_w(void); +void genmfc1(void); +void gencfc1(void); +void genmtc1(void); +void genctc1(void); +void genj(void); +void genjal(void); +void genslt(void); +void gensltu(void); +void gendsll32(void); +void gendsra32(void); +void genbgez(void); +void genbgezl(void); +void genbgezal(void); +void gentlbwi(void); +void generet(void); +void genmfc0(void); +void genadd_s(void); +void genmult(void); +void genmultu(void); +void genmflo(void); +void genmtlo(void); +void gendiv(void); +void gendmultu(void); +void genddivu(void); +void genadd(void); +void genaddu(void); +void gensubu(void); +void genand(void); +void genor(void); +void genxor(void); +void genreserved(void); +void gennop(void); +void gensll(void); +void gensrl(void); +void gensra(void); +void gensllv(void); +void gensrlv(void); +void genjr(void); +void genni(void); +void genmfhi(void); +void genmthi(void); +void genmtc0(void); +void genbltz(void); +void genlwl(void); +void genswl(void); +void gentlbp(void); +void gentlbr(void); +void genswr(void); +void genlwr(void); +void gensrav(void); +void genbgtz(void); +void genlb(void); +void genswc1(void); +void genldc1(void); +void gencvt_d_w(void); +void genmul_d(void); +void gensub_d(void); +void gendiv_d(void); +void gencvt_s_d(void); +void genmov_s(void); +void genc_le_s(void); +void genbc1t(void); +void gentrunc_w_s(void); +void genbc1tl(void); +void genc_lt_s(void); +void genbc1fl(void); +void genneg_s(void); +void genc_le_d(void); +void genbgezal_idle(void); +void genj_idle(void); +void genbeq_idle(void); +void genlh(void); +void genmov_d(void); +void genc_lt_d(void); +void genbc1f(void); +void gennor(void); +void genneg_d(void); +void gensub(void); +void genblez_idle(void); +void gendivu(void); +void gencvt_w_s(void); +void genbltzl(void); +void gensdc1(void); +void genc_eq_s(void); +void genjalr(void); +void gensub_s(void); +void gensqrt_s(void); +void genc_eq_d(void); +void gencvt_w_d(void); +void genfin_block(void); +void genddiv(void); +void gendaddiu(void); +void genbgtzl(void); +void gendsrav(void); +void gendsllv(void); +void gencvt_s_l(void); +void gendmtc1(void); +void gendsrlv(void); +void gendsra(void); +void gendmult(void); +void gendsll(void); +void genabs_s(void); +void gensc(void); +void gennotcompiled(void); +void genjal_idle(void); +void genjal_out(void); +void genbeq_out(void); +void gensyscall(void); +void gensync(void); +void gendadd(void); +void gendaddu(void); +void gendsub(void); +void gendsubu(void); +void genteq(void); +void gendsrl(void); +void gendsrl32(void); +void genbltz_idle(void); +void genbltz_out(void); +void genbgez_idle(void); +void genbgez_out(void); +void genbltzl_idle(void); +void genbltzl_out(void); +void genbgezl_idle(void); +void genbgezl_out(void); +void genbltzal_idle(void); +void genbltzal_out(void); +void genbltzal(void); +void genbgezal_out(void); +void genbltzall_idle(void); +void genbltzall_out(void); +void genbltzall(void); +void genbgezall_idle(void); +void genbgezall_out(void); +void genbgezall(void); +void gentlbwr(void); +void genbc1f_idle(void); +void genbc1f_out(void); +void genbc1t_idle(void); +void genbc1t_out(void); +void genbc1fl_idle(void); +void genbc1fl_out(void); +void genbc1tl_idle(void); +void genbc1tl_out(void); +void genround_l_s(void); +void gentrunc_l_s(void); +void genceil_l_s(void); +void genfloor_l_s(void); +void genround_w_s(void); +void genceil_w_s(void); +void genfloor_w_s(void); +void gencvt_l_s(void); +void genc_f_s(void); +void genc_un_s(void); +void genc_ueq_s(void); +void genc_olt_s(void); +void genc_ult_s(void); +void genc_ole_s(void); +void genc_ule_s(void); +void genc_sf_s(void); +void genc_ngle_s(void); +void genc_seq_s(void); +void genc_ngl_s(void); +void genc_nge_s(void); +void genc_ngt_s(void); +void gensqrt_d(void); +void genabs_d(void); +void genround_l_d(void); +void gentrunc_l_d(void); +void genceil_l_d(void); +void genfloor_l_d(void); +void genround_w_d(void); +void genceil_w_d(void); +void genfloor_w_d(void); +void gencvt_l_d(void); +void genc_f_d(void); +void genc_un_d(void); +void genc_ueq_d(void); +void genc_olt_d(void); +void genc_ult_d(void); +void genc_ole_d(void); +void genc_ule_d(void); +void genc_sf_d(void); +void genc_ngle_d(void); +void genc_seq_d(void); +void genc_ngl_d(void); +void genc_nge_d(void); +void genc_ngt_d(void); +void gencvt_d_l(void); +void gendmfc1(void); +void genj_out(void); +void genbne_idle(void); +void genbne_out(void); +void genblez_out(void); +void genbgtz_idle(void); +void genbgtz_out(void); +void genbeql_idle(void); +void genbeql_out(void); +void genbnel_idle(void); +void genbnel_out(void); +void genblezl_idle(void); +void genblezl_out(void); +void genbgtzl_idle(void); +void genbgtzl_out(void); +void gendaddi(void); +void genldl(void); +void genldr(void); +void genlwu(void); +void gensdl(void); +void gensdr(void); +void genlink_subblock(void); +void gendelayslot(void); +void gencheck_interupt_reg(void); +void gentest(void); +void gentest_out(void); +void gentest_idle(void); +void gentestl(void); +void gentestl_out(void); +void gencheck_cop1_unusable(void); +void genll(void); + +#ifdef COMPARE_CORE +void gendebug(void); +#endif + +#endif + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/reset.c b/libmupen64plus/mupen64plus-core/src/r4300/reset.c new file mode 100644 index 0000000000..9192d9e9d9 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/reset.c @@ -0,0 +1,59 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - reset.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2011 CasualJames * + * Copyright (C) 2008-2009 Richard Goedeken * + * Copyright (C) 2008 Ebenblues Nmn Okaygo Tillin9 * + * Hard reset based on code by hacktarux. * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "r4300/reset.h" +#include "r4300/r4300.h" +#include "r4300/interupt.h" +#include "memory/memory.h" + +int reset_hard_job = 0; + +void reset_hard(void) +{ + init_memory(0); + r4300_reset_hard(); + r4300_reset_soft(); + last_addr = 0xa4000040; + next_interupt = 624999; + init_interupt(); + if(r4300emu != CORE_PURE_INTERPRETER) + { + /* TODO + * The following code *should* work and avoid free_blocks() and init_blocks(), + * but it doesn't unless the last line is added (which causes a memory leak). + int i; + for (i=0; i<0x100000; i++) + invalid_code[i] = 1; + blocks[0xa4000000>>12]->block = NULL; */ + free_blocks(); + init_blocks(); + } + generic_jump_to(last_addr); +} + +void reset_soft(void) +{ + add_interupt_event(HW2_INT, 0); /* Hardware 2 Interrupt immediately */ + add_interupt_event(NMI_INT, 50000000); /* Non maskable Interrupt after 1/2 second */ +} diff --git a/libmupen64plus/mupen64plus-core/src/r4300/reset.h b/libmupen64plus/mupen64plus-core/src/r4300/reset.h new file mode 100644 index 0000000000..1d586edaed --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/reset.h @@ -0,0 +1,31 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - reset.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2011 CasualJames * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __RESET_H__ +#define __RESET_H__ + +/* For hard reset, set reset_hard_job and next interrupt will cause hard reset. + * For soft reset, call reset_soft() at any time. */ +extern int reset_hard_job; +void reset_hard(); +void reset_soft(); + +#endif /* __RESET_H__ */ diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86/assemble.c b/libmupen64plus/mupen64plus-core/src/r4300/x86/assemble.c new file mode 100644 index 0000000000..75cd54eb54 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86/assemble.c @@ -0,0 +1,140 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - assemble.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include + +#include "assemble.h" + +#include "api/m64p_types.h" +#include "api/callbacks.h" +#include "osal/preproc.h" +#include "r4300/recomph.h" +#include "r4300/recomp.h" +#include "r4300/r4300.h" + +typedef struct _jump_table +{ + unsigned int mi_addr; + unsigned int pc_addr; +} jump_table; + +static jump_table *jumps_table = NULL; +static int jumps_number, max_jumps_number; + +void init_assembler(void *block_jumps_table, int block_jumps_number, void *block_riprel_table, int block_riprel_number) +{ + if (block_jumps_table) + { + jumps_table = (jump_table *) block_jumps_table; + jumps_number = block_jumps_number; + max_jumps_number = jumps_number; + } + else + { + jumps_table = (jump_table *) malloc(1000*sizeof(jump_table)); + jumps_number = 0; + max_jumps_number = 1000; + } +} + +void free_assembler(void **block_jumps_table, int *block_jumps_number, void **block_riprel_table, int *block_riprel_number) +{ + *block_jumps_table = jumps_table; + *block_jumps_number = jumps_number; + *block_riprel_table = NULL; /* RIP-relative addressing is only for x86-64 */ + *block_riprel_number = 0; +} + +void add_jump(unsigned int pc_addr, unsigned int mi_addr) +{ + if (jumps_number == max_jumps_number) + { + max_jumps_number += 1000; + jumps_table = (jump_table *) realloc(jumps_table, max_jumps_number*sizeof(jump_table)); + } + jumps_table[jumps_number].pc_addr = pc_addr; + jumps_table[jumps_number].mi_addr = mi_addr; + jumps_number++; +} + +void passe2(precomp_instr *dest, int start, int end, precomp_block *block) +{ + unsigned int real_code_length, addr_dest; + int i; + build_wrappers(dest, start, end, block); + real_code_length = code_length; + + for (i=0; i < jumps_number; i++) + { + code_length = jumps_table[i].pc_addr; + if (dest[(jumps_table[i].mi_addr - dest[0].addr)/4].reg_cache_infos.need_map) + { + addr_dest = (unsigned int)dest[(jumps_table[i].mi_addr - dest[0].addr)/4].reg_cache_infos.jump_wrapper; + put32(addr_dest-((unsigned int)block->code+code_length)-4); + } + else + { + addr_dest = dest[(jumps_table[i].mi_addr - dest[0].addr)/4].local_addr; + put32(addr_dest-code_length-4); + } + } + code_length = real_code_length; +} + +static unsigned int g_jump_start8 = 0; +static unsigned int g_jump_start32 = 0; + +void jump_start_rel8(void) +{ + g_jump_start8 = code_length; +} + +void jump_start_rel32(void) +{ + g_jump_start32 = code_length; +} + +void jump_end_rel8(void) +{ + unsigned int jump_end = code_length; + int jump_vec = jump_end - g_jump_start8; + + if (jump_vec > 127 || jump_vec < -128) + { + DebugMessage(M64MSG_ERROR, "8-bit relative jump too long! From %x to %x", g_jump_start8, jump_end); + OSAL_BREAKPOINT_INTERRUPT; + } + + code_length = g_jump_start8 - 1; + put8(jump_vec); + code_length = jump_end; +} + +void jump_end_rel32(void) +{ + unsigned int jump_end = code_length; + int jump_vec = jump_end - g_jump_start32; + + code_length = g_jump_start32 - 4; + put32(jump_vec); + code_length = jump_end; +} diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86/assemble.h b/libmupen64plus/mupen64plus-core/src/r4300/x86/assemble.h new file mode 100644 index 0000000000..9b75f894c0 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86/assemble.h @@ -0,0 +1,837 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - assemble.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef ASSEMBLE_H +#define ASSEMBLE_H + +#include "r4300/recomph.h" +#include "api/callbacks.h" + +#include + +extern long long int reg[32]; + +#define EAX 0 +#define ECX 1 +#define EDX 2 +#define EBX 3 +#define ESP 4 +#define EBP 5 +#define ESI 6 +#define EDI 7 + +#define AX 0 +#define CX 1 +#define DX 2 +#define BX 3 +#define SP 4 +#define BP 5 +#define SI 6 +#define DI 7 + +#define AL 0 +#define CL 1 +#define DL 2 +#define BL 3 +#define AH 4 +#define CH 5 +#define DH 6 +#define BH 7 + +extern int branch_taken; + +void jump_start_rel8(void); +void jump_end_rel8(void); +void jump_start_rel32(void); +void jump_end_rel32(void); +void add_jump(unsigned int pc_addr, unsigned int mi_addr); + +static inline void put8(unsigned char octet) +{ + (*inst_pointer)[code_length] = octet; + code_length++; + if (code_length == max_code_length) + { + *inst_pointer = (unsigned char *) realloc_exec(*inst_pointer, max_code_length, max_code_length+8192); + max_code_length += 8192; + } +} + +static inline void put32(unsigned int dword) +{ + if ((code_length+4) >= max_code_length) + { + *inst_pointer = (unsigned char *) realloc_exec(*inst_pointer, max_code_length, max_code_length+8192); + max_code_length += 8192; + } + *((unsigned int *)(&(*inst_pointer)[code_length])) = dword; + code_length+=4; +} + +static inline void mov_eax_memoffs32(unsigned int *memoffs32) +{ + put8(0xA1); + put32((unsigned int)(memoffs32)); +} + +static inline void mov_memoffs32_eax(unsigned int *memoffs32) +{ + put8(0xA3); + put32((unsigned int)(memoffs32)); +} + +static inline void mov_m8_reg8(unsigned char *m8, int reg8) +{ + put8(0x88); + put8((reg8 << 3) | 5); + put32((unsigned int)(m8)); +} + +static inline void mov_reg16_m16(int reg16, unsigned short *m16) +{ + put8(0x66); + put8(0x8B); + put8((reg16 << 3) | 5); + put32((unsigned int)(m16)); +} + +static inline void mov_m16_reg16(unsigned short *m16, int reg16) +{ + put8(0x66); + put8(0x89); + put8((reg16 << 3) | 5); + put32((unsigned int)(m16)); +} + +static inline void cmp_reg32_m32(int reg32, unsigned int *m32) +{ + put8(0x3B); + put8((reg32 << 3) | 5); + put32((unsigned int)(m32)); +} + +static inline void cmp_reg32_reg32(int reg1, int reg2) +{ + put8(0x39); + put8((reg2 << 3) | reg1 | 0xC0); +} + +static inline void cmp_reg32_imm8(int reg32, unsigned char imm8) +{ + put8(0x83); + put8(0xF8 + reg32); + put8(imm8); +} + +static inline void cmp_preg32pimm32_imm8(int reg32, unsigned int imm32, unsigned char imm8) +{ + put8(0x80); + put8(0xB8 + reg32); + put32(imm32); + put8(imm8); +} + +static inline void cmp_reg32_imm32(int reg32, unsigned int imm32) +{ + put8(0x81); + put8(0xF8 + reg32); + put32(imm32); +} + +static inline void test_reg32_imm32(int reg32, unsigned int imm32) +{ + put8(0xF7); + put8(0xC0 + reg32); + put32(imm32); +} + +static inline void test_m32_imm32(unsigned int *m32, unsigned int imm32) +{ + put8(0xF7); + put8(0x05); + put32((unsigned int)m32); + put32(imm32); +} + +static inline void add_m32_reg32(unsigned int *m32, int reg32) +{ + put8(0x01); + put8((reg32 << 3) | 5); + put32((unsigned int)(m32)); +} + +static inline void sub_reg32_m32(int reg32, unsigned int *m32) +{ + put8(0x2B); + put8((reg32 << 3) | 5); + put32((unsigned int)(m32)); +} + +static inline void sub_reg32_reg32(int reg1, int reg2) +{ + put8(0x29); + put8((reg2 << 3) | reg1 | 0xC0); +} + +static inline void sbb_reg32_reg32(int reg1, int reg2) +{ + put8(0x19); + put8((reg2 << 3) | reg1 | 0xC0); +} + +static inline void sub_reg32_imm32(int reg32, unsigned int imm32) +{ + put8(0x81); + put8(0xE8 + reg32); + put32(imm32); +} + +static inline void sub_eax_imm32(unsigned int imm32) +{ + put8(0x2D); + put32(imm32); +} + +static inline void jne_rj(unsigned char saut) +{ + put8(0x75); + put8(saut); +} + +static inline void je_rj(unsigned char saut) +{ + put8(0x74); + put8(saut); +} + +static inline void jb_rj(unsigned char saut) +{ + put8(0x72); + put8(saut); +} + +static inline void jbe_rj(unsigned char saut) +{ + put8(0x76); + put8(saut); +} + +static inline void ja_rj(unsigned char saut) +{ + put8(0x77); + put8(saut); +} + +static inline void jae_rj(unsigned char saut) +{ + put8(0x73); + put8(saut); +} + +static inline void jle_rj(unsigned char saut) +{ + put8(0x7E); + put8(saut); +} + +static inline void jge_rj(unsigned char saut) +{ + put8(0x7D); + put8(saut); +} + +static inline void jg_rj(unsigned char saut) +{ + put8(0x7F); + put8(saut); +} + +static inline void jl_rj(unsigned char saut) +{ + put8(0x7C); + put8(saut); +} + +static inline void jp_rj(unsigned char saut) +{ + put8(0x7A); + put8(saut); +} + +static inline void je_near_rj(unsigned int saut) +{ + put8(0x0F); + put8(0x84); + put32(saut); +} + +static inline void mov_reg32_imm32(int reg32, unsigned int imm32) +{ + put8(0xB8+reg32); + put32(imm32); +} + +static inline void jmp_imm_short(char saut) +{ + put8(0xEB); + put8(saut); +} + +static inline void or_m32_imm32(unsigned int *m32, unsigned int imm32) +{ + put8(0x81); + put8(0x0D); + put32((unsigned int)(m32)); + put32(imm32); +} + +static inline void or_reg32_reg32(unsigned int reg1, unsigned int reg2) +{ + put8(0x09); + put8(0xC0 | (reg2 << 3) | reg1); +} + +static inline void and_reg32_reg32(unsigned int reg1, unsigned int reg2) +{ + put8(0x21); + put8(0xC0 | (reg2 << 3) | reg1); +} + +static inline void and_m32_imm32(unsigned int *m32, unsigned int imm32) +{ + put8(0x81); + put8(0x25); + put32((unsigned int)(m32)); + put32(imm32); +} + +static inline void xor_reg32_reg32(unsigned int reg1, unsigned int reg2) +{ + put8(0x31); + put8(0xC0 | (reg2 << 3) | reg1); +} + +static inline void sub_m32_imm32(unsigned int *m32, unsigned int imm32) +{ + put8(0x81); + put8(0x2D); + put32((unsigned int)(m32)); + put32(imm32); +} + +static inline void add_reg32_imm32(unsigned int reg32, unsigned int imm32) +{ + put8(0x81); + put8(0xC0+reg32); + put32(imm32); +} + +static inline void inc_m32(unsigned int *m32) +{ + put8(0xFF); + put8(0x05); + put32((unsigned int)(m32)); +} + +static inline void cmp_m32_imm32(unsigned int *m32, unsigned int imm32) +{ + put8(0x81); + put8(0x3D); + put32((unsigned int)(m32)); + put32(imm32); +} + +static inline void cmp_eax_imm32(unsigned int imm32) +{ + put8(0x3D); + put32(imm32); +} + +static inline void mov_m32_imm32(unsigned int *m32, unsigned int imm32) +{ + put8(0xC7); + put8(0x05); + put32((unsigned int)(m32)); + put32(imm32); +} + +static inline void jmp(unsigned int mi_addr) +{ + put8(0xE9); + put32(0); + add_jump(code_length-4, mi_addr); +} + +static inline void cdq(void) +{ + put8(0x99); +} + +static inline void mov_m32_reg32(unsigned int *m32, unsigned int reg32) +{ + put8(0x89); + put8((reg32 << 3) | 5); + put32((unsigned int)(m32)); +} + +static inline void call_reg32(unsigned int reg32) +{ + put8(0xFF); + put8(0xD0+reg32); +} + +static inline void shr_reg32_imm8(unsigned int reg32, unsigned char imm8) +{ + put8(0xC1); + put8(0xE8+reg32); + put8(imm8); +} + +static inline void shr_reg32_cl(unsigned int reg32) +{ + put8(0xD3); + put8(0xE8+reg32); +} + +static inline void sar_reg32_cl(unsigned int reg32) +{ + put8(0xD3); + put8(0xF8+reg32); +} + +static inline void shl_reg32_cl(unsigned int reg32) +{ + put8(0xD3); + put8(0xE0+reg32); +} + +static inline void shld_reg32_reg32_cl(unsigned int reg1, unsigned int reg2) +{ + put8(0x0F); + put8(0xA5); + put8(0xC0 | (reg2 << 3) | reg1); +} + +static inline void shld_reg32_reg32_imm8(unsigned int reg1, unsigned int reg2, unsigned char imm8) +{ + put8(0x0F); + put8(0xA4); + put8(0xC0 | (reg2 << 3) | reg1); + put8(imm8); +} + +static inline void shrd_reg32_reg32_cl(unsigned int reg1, unsigned int reg2) +{ + put8(0x0F); + put8(0xAD); + put8(0xC0 | (reg2 << 3) | reg1); +} + +static inline void sar_reg32_imm8(unsigned int reg32, unsigned char imm8) +{ + put8(0xC1); + put8(0xF8+reg32); + put8(imm8); +} + +static inline void shrd_reg32_reg32_imm8(unsigned int reg1, unsigned int reg2, unsigned char imm8) +{ + put8(0x0F); + put8(0xAC); + put8(0xC0 | (reg2 << 3) | reg1); + put8(imm8); +} + +static inline void mul_m32(unsigned int *m32) +{ + put8(0xF7); + put8(0x25); + put32((unsigned int)(m32)); +} + +static inline void imul_reg32(unsigned int reg32) +{ + put8(0xF7); + put8(0xE8+reg32); +} + +static inline void mul_reg32(unsigned int reg32) +{ + put8(0xF7); + put8(0xE0+reg32); +} + +static inline void idiv_reg32(unsigned int reg32) +{ + put8(0xF7); + put8(0xF8+reg32); +} + +static inline void div_reg32(unsigned int reg32) +{ + put8(0xF7); + put8(0xF0+reg32); +} + +static inline void add_reg32_reg32(unsigned int reg1, unsigned int reg2) +{ + put8(0x01); + put8(0xC0 | (reg2 << 3) | reg1); +} + +static inline void adc_reg32_reg32(unsigned int reg1, unsigned int reg2) +{ + put8(0x11); + put8(0xC0 | (reg2 << 3) | reg1); +} + +static inline void add_reg32_m32(unsigned int reg32, unsigned int *m32) +{ + put8(0x03); + put8((reg32 << 3) | 5); + put32((unsigned int)(m32)); +} + +static inline void adc_reg32_imm32(unsigned int reg32, unsigned int imm32) +{ + put8(0x81); + put8(0xD0 + reg32); + put32(imm32); +} + +static inline void jmp_reg32(unsigned int reg32) +{ + put8(0xFF); + put8(0xE0 + reg32); +} + +static inline void mov_reg32_preg32(unsigned int reg1, unsigned int reg2) +{ + put8(0x8B); + put8((reg1 << 3) | reg2); +} + +static inline void mov_preg32_reg32(int reg1, int reg2) +{ + put8(0x89); + put8((reg2 << 3) | reg1); +} + +static inline void mov_reg32_preg32preg32pimm32(int reg1, int reg2, int reg3, unsigned int imm32) +{ + put8(0x8B); + put8((reg1 << 3) | 0x84); + put8(reg2 | (reg3 << 3)); + put32(imm32); +} + +static inline void mov_reg32_preg32pimm32(int reg1, int reg2, unsigned int imm32) +{ + put8(0x8B); + put8(0x80 | (reg1 << 3) | reg2); + put32(imm32); +} + +static inline void mov_reg32_preg32x4pimm32(int reg1, int reg2, unsigned int imm32) +{ + put8(0x8B); + put8((reg1 << 3) | 4); + put8(0x80 | (reg2 << 3) | 5); + put32(imm32); +} + +static inline void mov_preg32pimm32_reg8(int reg32, unsigned int imm32, int reg8) +{ + put8(0x88); + put8(0x80 | reg32 | (reg8 << 3)); + put32(imm32); +} + +static inline void mov_preg32pimm32_imm8(int reg32, unsigned int imm32, unsigned char imm8) +{ + put8(0xC6); + put8(0x80 + reg32); + put32(imm32); + put8(imm8); +} + +static inline void mov_preg32pimm32_reg16(int reg32, unsigned int imm32, int reg16) +{ + put8(0x66); + put8(0x89); + put8(0x80 | reg32 | (reg16 << 3)); + put32(imm32); +} + +static inline void mov_preg32pimm32_reg32(int reg1, unsigned int imm32, int reg2) +{ + put8(0x89); + put8(0x80 | reg1 | (reg2 << 3)); + put32(imm32); +} + +static inline void add_eax_imm32(unsigned int imm32) +{ + put8(0x05); + put32(imm32); +} + +static inline void shl_reg32_imm8(unsigned int reg32, unsigned char imm8) +{ + put8(0xC1); + put8(0xE0 + reg32); + put8(imm8); +} + +static inline void mov_reg32_m32(unsigned int reg32, unsigned int* m32) +{ + put8(0x8B); + put8((reg32 << 3) | 5); + put32((unsigned int)(m32)); +} + +static inline void mov_reg8_m8(int reg8, unsigned char *m8) +{ + put8(0x8A); + put8((reg8 << 3) | 5); + put32((unsigned int)(m8)); +} + +static inline void and_eax_imm32(unsigned int imm32) +{ + put8(0x25); + put32(imm32); +} + +static inline void and_reg32_imm32(int reg32, unsigned int imm32) +{ + put8(0x81); + put8(0xE0 + reg32); + put32(imm32); +} + +static inline void or_reg32_imm32(int reg32, unsigned int imm32) +{ + put8(0x81); + put8(0xC8 + reg32); + put32(imm32); +} + +static inline void xor_reg32_imm32(int reg32, unsigned int imm32) +{ + put8(0x81); + put8(0xF0 + reg32); + put32(imm32); +} + +static inline void xor_reg8_imm8(int reg8, unsigned char imm8) +{ + put8(0x80); + put8(0xF0 + reg8); + put8(imm8); +} + +static inline void mov_reg32_reg32(unsigned int reg1, unsigned int reg2) +{ + if (reg1 == reg2) return; + put8(0x89); + put8(0xC0 | (reg2 << 3) | reg1); +} + +static inline void not_reg32(unsigned int reg32) +{ + put8(0xF7); + put8(0xD0 + reg32); +} + +static inline void movsx_reg32_m8(int reg32, unsigned char *m8) +{ + put8(0x0F); + put8(0xBE); + put8((reg32 << 3) | 5); + put32((unsigned int)(m8)); +} + +static inline void movsx_reg32_8preg32pimm32(int reg1, int reg2, unsigned int imm32) +{ + put8(0x0F); + put8(0xBE); + put8((reg1 << 3) | reg2 | 0x80); + put32(imm32); +} + +static inline void movsx_reg32_16preg32pimm32(int reg1, int reg2, unsigned int imm32) +{ + put8(0x0F); + put8(0xBF); + put8((reg1 << 3) | reg2 | 0x80); + put32(imm32); +} + +static inline void movsx_reg32_m16(int reg32, unsigned short *m16) +{ + put8(0x0F); + put8(0xBF); + put8((reg32 << 3) | 5); + put32((unsigned int)(m16)); +} + +static inline void fldcw_m16(unsigned short *m16) +{ + put8(0xD9); + put8(0x2D); + put32((unsigned int)(m16)); +} + +static inline void fld_preg32_dword(int reg32) +{ + put8(0xD9); + put8(reg32); +} + +static inline void fdiv_preg32_dword(int reg32) +{ + put8(0xD8); + put8(0x30 + reg32); +} + +static inline void fstp_preg32_dword(int reg32) +{ + put8(0xD9); + put8(0x18 + reg32); +} + +static inline void fchs(void) +{ + put8(0xD9); + put8(0xE0); +} + +static inline void fstp_preg32_qword(int reg32) +{ + put8(0xDD); + put8(0x18 + reg32); +} + +static inline void fadd_preg32_dword(int reg32) +{ + put8(0xD8); + put8(reg32); +} + +static inline void fsub_preg32_dword(int reg32) +{ + put8(0xD8); + put8(0x20 + reg32); +} + +static inline void fmul_preg32_dword(int reg32) +{ + put8(0xD8); + put8(0x08 + reg32); +} + +static inline void fistp_preg32_dword(int reg32) +{ + put8(0xDB); + put8(0x18 + reg32); +} + +static inline void fistp_preg32_qword(int reg32) +{ + put8(0xDF); + put8(0x38 + reg32); +} + +static inline void fld_preg32_qword(int reg32) +{ + put8(0xDD); + put8(reg32); +} + +static inline void fild_preg32_qword(int reg32) +{ + put8(0xDF); + put8(0x28+reg32); +} + +static inline void fild_preg32_dword(int reg32) +{ + put8(0xDB); + put8(reg32); +} + +static inline void fadd_preg32_qword(int reg32) +{ + put8(0xDC); + put8(reg32); +} + +static inline void fdiv_preg32_qword(int reg32) +{ + put8(0xDC); + put8(0x30 + reg32); +} + +static inline void fsub_preg32_qword(int reg32) +{ + put8(0xDC); + put8(0x20 + reg32); +} + +static inline void fmul_preg32_qword(int reg32) +{ + put8(0xDC); + put8(0x08 + reg32); +} + +static inline void fsqrt(void) +{ + put8(0xD9); + put8(0xFA); +} + +static inline void fabs_(void) +{ + put8(0xD9); + put8(0xE1); +} + +static inline void fcomip_fpreg(int fpreg) +{ + put8(0xDF); + put8(0xF0 + fpreg); +} + +static inline void fucomip_fpreg(int fpreg) +{ + put8(0xDF); + put8(0xE8 + fpreg); +} + +static inline void ffree_fpreg(int fpreg) +{ + put8(0xDD); + put8(0xC0 + fpreg); +} + +#endif // ASSEMBLE_H + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86/assemble_struct.h b/libmupen64plus/mupen64plus-core/src/r4300/x86/assemble_struct.h new file mode 100644 index 0000000000..1d88460ae9 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86/assemble_struct.h @@ -0,0 +1,33 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - assemble_struct.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __ASSEMBLE_STRUCT_H__ +#define __ASSEMBLE_STRUCT_H__ + +typedef struct _reg_cache_struct +{ + int need_map; + void *needed_registers[8]; + unsigned char jump_wrapper[62]; + int need_cop1_check; +} reg_cache_struct; + +#endif /* __ASSEMBLE_STRUCT_H__ */ diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86/gbc.c b/libmupen64plus/mupen64plus-core/src/r4300/x86/gbc.c new file mode 100644 index 0000000000..dcaef3e2d7 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86/gbc.c @@ -0,0 +1,276 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - gbc.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "assemble.h" +#include "interpret.h" + +#include "r4300/recomph.h" +#include "r4300/r4300.h" +#include "r4300/ops.h" + +static void genbc1f_test(void) +{ + test_m32_imm32((unsigned int*)&FCR31, 0x800000); + jne_rj(12); + mov_m32_imm32((unsigned int*)(&branch_taken), 1); // 10 + jmp_imm_short(10); // 2 + mov_m32_imm32((unsigned int*)(&branch_taken), 0); // 10 +} + +void genbc1f(void) +{ +#ifdef INTERPRET_BC1F + gencallinterp((unsigned int)cached_interpreter_table.BC1F, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BC1F, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1f_test(); + gendelayslot(); + gentest(); +#endif +} + +void genbc1f_out(void) +{ +#ifdef INTERPRET_BC1F_OUT + gencallinterp((unsigned int)cached_interpreter_table.BC1F_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BC1F_OUT, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1f_test(); + gendelayslot(); + gentest_out(); +#endif +} + +void genbc1f_idle(void) +{ +#ifdef INTERPRET_BC1F_IDLE + gencallinterp((unsigned int)cached_interpreter_table.BC1F_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BC1F_IDLE, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1f_test(); + gentest_idle(); + genbc1f(); +#endif +} + +static void genbc1t_test(void) +{ + test_m32_imm32((unsigned int*)&FCR31, 0x800000); + je_rj(12); + mov_m32_imm32((unsigned int*)(&branch_taken), 1); // 10 + jmp_imm_short(10); // 2 + mov_m32_imm32((unsigned int*)(&branch_taken), 0); // 10 +} + +void genbc1t(void) +{ +#ifdef INTERPRET_BC1T + gencallinterp((unsigned int)cached_interpreter_table.BC1T, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BC1T, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1t_test(); + gendelayslot(); + gentest(); +#endif +} + +void genbc1t_out(void) +{ +#ifdef INTERPRET_BC1T_OUT + gencallinterp((unsigned int)cached_interpreter_table.BC1T_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BC1T_OUT, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1t_test(); + gendelayslot(); + gentest_out(); +#endif +} + +void genbc1t_idle(void) +{ +#ifdef INTERPRET_BC1T_IDLE + gencallinterp((unsigned int)cached_interpreter_table.BC1T_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BC1T_IDLE, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1t_test(); + gentest_idle(); + genbc1t(); +#endif +} + +void genbc1fl(void) +{ +#ifdef INTERPRET_BC1FL + gencallinterp((unsigned int)cached_interpreter_table.BC1FL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BC1FL, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1f_test(); + free_all_registers(); + gentestl(); +#endif +} + +void genbc1fl_out(void) +{ +#ifdef INTERPRET_BC1FL_OUT + gencallinterp((unsigned int)cached_interpreter_table.BC1FL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BC1FL_OUT, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1f_test(); + free_all_registers(); + gentestl_out(); +#endif +} + +void genbc1fl_idle(void) +{ +#ifdef INTERPRET_BC1FL_IDLE + gencallinterp((unsigned int)cached_interpreter_table.BC1FL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BC1FL_IDLE, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1f_test(); + gentest_idle(); + genbc1fl(); +#endif +} + +void genbc1tl(void) +{ +#ifdef INTERPRET_BC1TL + gencallinterp((unsigned int)cached_interpreter_table.BC1TL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BC1TL, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1t_test(); + free_all_registers(); + gentestl(); +#endif +} + +void genbc1tl_out(void) +{ +#ifdef INTERPRET_BC1TL_OUT + gencallinterp((unsigned int)cached_interpreter_table.BC1TL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BC1TL_OUT, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1t_test(); + free_all_registers(); + gentestl_out(); +#endif +} + +void genbc1tl_idle(void) +{ +#ifdef INTERPRET_BC1TL_IDLE + gencallinterp((unsigned int)cached_interpreter_table.BC1TL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BC1TL_IDLE, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1t_test(); + gentest_idle(); + genbc1tl(); +#endif +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86/gcop0.c b/libmupen64plus/mupen64plus-core/src/r4300/x86/gcop0.c new file mode 100644 index 0000000000..d6ec935f03 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86/gcop0.c @@ -0,0 +1,42 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - gcop0.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "assemble.h" + +#include "r4300/recomp.h" +#include "r4300/recomph.h" +#include "r4300/r4300.h" +#include "r4300/ops.h" + +//static unsigned int pMFC0 = (unsigned int)(MFC0); +void genmfc0(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.MFC0, 0); +} + +//static unsigned int pMTC0 = (unsigned int)(MTC0); +void genmtc0(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.MTC0, 0); +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86/gcop1.c b/libmupen64plus/mupen64plus-core/src/r4300/x86/gcop1.c new file mode 100644 index 0000000000..d6705572c5 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86/gcop1.c @@ -0,0 +1,135 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - gcop1.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "assemble.h" +#include "interpret.h" + +#include "r4300/recomph.h" +#include "r4300/recomp.h" +#include "r4300/r4300.h" +#include "r4300/ops.h" +#include "r4300/macros.h" + +#include "memory/memory.h" + +void genmfc1(void) +{ +#ifdef INTERPRET_MFC1 + gencallinterp((unsigned int)cached_interpreter_table.MFC1, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_simple[dst->f.r.nrd])); + mov_reg32_preg32(EBX, EAX); + mov_m32_reg32((unsigned int*)dst->f.r.rt, EBX); + sar_reg32_imm8(EBX, 31); + mov_m32_reg32(((unsigned int*)dst->f.r.rt)+1, EBX); +#endif +} + +void gendmfc1(void) +{ +#ifdef INTERPRET_DMFC1 + gencallinterp((unsigned int)cached_interpreter_table.DMFC1, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.r.nrd])); + mov_reg32_preg32(EBX, EAX); + mov_reg32_preg32pimm32(ECX, EAX, 4); + mov_m32_reg32((unsigned int*)dst->f.r.rt, EBX); + mov_m32_reg32(((unsigned int*)dst->f.r.rt)+1, ECX); +#endif +} + +void gencfc1(void) +{ +#ifdef INTERPRET_CFC1 + gencallinterp((unsigned int)cached_interpreter_table.CFC1, 0); +#else + gencheck_cop1_unusable(); + if(dst->f.r.nrd == 31) mov_eax_memoffs32((unsigned int*)&FCR31); + else mov_eax_memoffs32((unsigned int*)&FCR0); + mov_memoffs32_eax((unsigned int*)dst->f.r.rt); + sar_reg32_imm8(EAX, 31); + mov_memoffs32_eax(((unsigned int*)dst->f.r.rt)+1); +#endif +} + +void genmtc1(void) +{ +#ifdef INTERPRET_MTC1 + gencallinterp((unsigned int)cached_interpreter_table.MTC1, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)dst->f.r.rt); + mov_reg32_m32(EBX, (unsigned int*)(®_cop1_simple[dst->f.r.nrd])); + mov_preg32_reg32(EBX, EAX); +#endif +} + +void gendmtc1(void) +{ +#ifdef INTERPRET_DMTC1 + gencallinterp((unsigned int)cached_interpreter_table.DMTC1, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)dst->f.r.rt); + mov_reg32_m32(EBX, ((unsigned int*)dst->f.r.rt)+1); + mov_reg32_m32(EDX, (unsigned int*)(®_cop1_double[dst->f.r.nrd])); + mov_preg32_reg32(EDX, EAX); + mov_preg32pimm32_reg32(EDX, 4, EBX); +#endif +} + +void genctc1(void) +{ +#ifdef INTERPRET_CTC1 + gencallinterp((unsigned int)cached_interpreter_table.CTC1, 0); +#else + gencheck_cop1_unusable(); + + if (dst->f.r.nrd != 31) return; + mov_eax_memoffs32((unsigned int*)dst->f.r.rt); + mov_memoffs32_eax((unsigned int*)&FCR31); + and_eax_imm32(3); + + cmp_eax_imm32(0); + jne_rj(12); + mov_m32_imm32((unsigned int*)&rounding_mode, 0x33F); // 10 + jmp_imm_short(48); // 2 + + cmp_eax_imm32(1); // 5 + jne_rj(12); // 2 + mov_m32_imm32((unsigned int*)&rounding_mode, 0xF3F); // 10 + jmp_imm_short(29); // 2 + + cmp_eax_imm32(2); // 5 + jne_rj(12); // 2 + mov_m32_imm32((unsigned int*)&rounding_mode, 0xB3F); // 10 + jmp_imm_short(10); // 2 + + mov_m32_imm32((unsigned int*)&rounding_mode, 0x73F); // 10 + + fldcw_m16((unsigned short*)&rounding_mode); +#endif +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86/gcop1_d.c b/libmupen64plus/mupen64plus-core/src/r4300/x86/gcop1_d.c new file mode 100644 index 0000000000..c82658f48b --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86/gcop1_d.c @@ -0,0 +1,604 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - gcop1_d.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "assemble.h" +#include "interpret.h" + +#include "r4300/recomph.h" +#include "r4300/r4300.h" +#include "r4300/ops.h" + +void genadd_d(void) +{ +#ifdef INTERPRET_ADD_D + gencallinterp((unsigned int)cached_interpreter_table.ADD_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.ft])); + fadd_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.fd])); + fstp_preg32_qword(EAX); +#endif +} + +void gensub_d(void) +{ +#ifdef INTERPRET_SUB_D + gencallinterp((unsigned int)cached_interpreter_table.SUB_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.ft])); + fsub_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.fd])); + fstp_preg32_qword(EAX); +#endif +} + +void genmul_d(void) +{ +#ifdef INTERPRET_MUL_D + gencallinterp((unsigned int)cached_interpreter_table.MUL_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.ft])); + fmul_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.fd])); + fstp_preg32_qword(EAX); +#endif +} + +void gendiv_d(void) +{ +#ifdef INTERPRET_DIV_D + gencallinterp((unsigned int)cached_interpreter_table.DIV_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.ft])); + fdiv_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.fd])); + fstp_preg32_qword(EAX); +#endif +} + +void gensqrt_d(void) +{ +#ifdef INTERPRET_SQRT_D + gencallinterp((unsigned int)cached_interpreter_table.SQRT_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + fsqrt(); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.fd])); + fstp_preg32_qword(EAX); +#endif +} + +void genabs_d(void) +{ +#ifdef INTERPRET_ABS_D + gencallinterp((unsigned int)cached_interpreter_table.ABS_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + fabs_(); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.fd])); + fstp_preg32_qword(EAX); +#endif +} + +void genmov_d(void) +{ +#ifdef INTERPRET_MOV_D + gencallinterp((unsigned int)cached_interpreter_table.MOV_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.fs])); + mov_reg32_preg32(EBX, EAX); + mov_reg32_preg32pimm32(ECX, EAX, 4); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.fd])); + mov_preg32_reg32(EAX, EBX); + mov_preg32pimm32_reg32(EAX, 4, ECX); +#endif +} + +void genneg_d(void) +{ +#ifdef INTERPRET_NEG_D + gencallinterp((unsigned int)cached_interpreter_table.NEG_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + fchs(); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.fd])); + fstp_preg32_qword(EAX); +#endif +} + +void genround_l_d(void) +{ +#ifdef INTERPRET_ROUND_L_D + gencallinterp((unsigned int)cached_interpreter_table.ROUND_L_D, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16((unsigned short*)&round_mode); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fd])); + fistp_preg32_qword(EAX); + fldcw_m16((unsigned short*)&rounding_mode); +#endif +} + +void gentrunc_l_d(void) +{ +#ifdef INTERPRET_TRUNC_L_D + gencallinterp((unsigned int)cached_interpreter_table.TRUNC_L_D, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16((unsigned short*)&trunc_mode); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fd])); + fistp_preg32_qword(EAX); + fldcw_m16((unsigned short*)&rounding_mode); +#endif +} + +void genceil_l_d(void) +{ +#ifdef INTERPRET_CEIL_L_D + gencallinterp((unsigned int)cached_interpreter_table.CEIL_L_D, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16((unsigned short*)&ceil_mode); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fd])); + fistp_preg32_qword(EAX); + fldcw_m16((unsigned short*)&rounding_mode); +#endif +} + +void genfloor_l_d(void) +{ +#ifdef INTERPRET_FLOOR_L_D + gencallinterp((unsigned int)cached_interpreter_table.FLOOR_L_D, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16((unsigned short*)&floor_mode); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fd])); + fistp_preg32_qword(EAX); + fldcw_m16((unsigned short*)&rounding_mode); +#endif +} + +void genround_w_d(void) +{ +#ifdef INTERPRET_ROUND_W_D + gencallinterp((unsigned int)cached_interpreter_table.ROUND_W_D, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16((unsigned short*)&round_mode); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_simple[dst->f.cf.fd])); + fistp_preg32_dword(EAX); + fldcw_m16((unsigned short*)&rounding_mode); +#endif +} + +void gentrunc_w_d(void) +{ +#ifdef INTERPRET_TRUNC_W_D + gencallinterp((unsigned int)cached_interpreter_table.TRUNC_W_D, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16((unsigned short*)&trunc_mode); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_simple[dst->f.cf.fd])); + fistp_preg32_dword(EAX); + fldcw_m16((unsigned short*)&rounding_mode); +#endif +} + +void genceil_w_d(void) +{ +#ifdef INTERPRET_CEIL_W_D + gencallinterp((unsigned int)cached_interpreter_table.CEIL_W_D, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16((unsigned short*)&ceil_mode); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_simple[dst->f.cf.fd])); + fistp_preg32_dword(EAX); + fldcw_m16((unsigned short*)&rounding_mode); +#endif +} + +void genfloor_w_d(void) +{ +#ifdef INTERPRET_FLOOR_W_D + gencallinterp((unsigned int)cached_interpreter_table.FLOOR_W_D, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16((unsigned short*)&floor_mode); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_simple[dst->f.cf.fd])); + fistp_preg32_dword(EAX); + fldcw_m16((unsigned short*)&rounding_mode); +#endif +} + +void gencvt_s_d(void) +{ +#ifdef INTERPRET_CVT_S_D + gencallinterp((unsigned int)cached_interpreter_table.CVT_S_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_simple[dst->f.cf.fd])); + fstp_preg32_dword(EAX); +#endif +} + +void gencvt_w_d(void) +{ +#ifdef INTERPRET_CVT_W_D + gencallinterp((unsigned int)cached_interpreter_table.CVT_W_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_simple[dst->f.cf.fd])); + fistp_preg32_dword(EAX); +#endif +} + +void gencvt_l_d(void) +{ +#ifdef INTERPRET_CVT_L_D + gencallinterp((unsigned int)cached_interpreter_table.CVT_L_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fd])); + fistp_preg32_qword(EAX); +#endif +} + +void genc_f_d(void) +{ +#ifdef INTERPRET_C_F_D + gencallinterp((unsigned int)cached_interpreter_table.C_F_D, 0); +#else + gencheck_cop1_unusable(); + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); +#endif +} + +void genc_un_d(void) +{ +#ifdef INTERPRET_C_UN_D + gencallinterp((unsigned int)cached_interpreter_table.C_UN_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.ft])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jp_rj(12); + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 + jmp_imm_short(10); // 2 + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 +#endif +} + +void genc_eq_d(void) +{ +#ifdef INTERPRET_C_EQ_D + gencallinterp((unsigned int)cached_interpreter_table.C_EQ_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.ft])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jne_rj(12); // 2 + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + +void genc_ueq_d(void) +{ +#ifdef INTERPRET_C_UEQ_D + gencallinterp((unsigned int)cached_interpreter_table.C_UEQ_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.ft])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jp_rj(14); + jne_rj(12); + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + +void genc_olt_d(void) +{ +#ifdef INTERPRET_C_OLT_D + gencallinterp((unsigned int)cached_interpreter_table.C_OLT_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.ft])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jae_rj(12); // 2 + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + +void genc_ult_d(void) +{ +#ifdef INTERPRET_C_ULT_D + gencallinterp((unsigned int)cached_interpreter_table.C_ULT_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.ft])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jp_rj(14); + jae_rj(12); // 2 + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + +void genc_ole_d(void) +{ +#ifdef INTERPRET_C_OLE_D + gencallinterp((unsigned int)cached_interpreter_table.C_OLE_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.ft])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + fucomip_fpreg(1); + ffree_fpreg(0); + ja_rj(12); // 2 + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + +void genc_ule_d(void) +{ +#ifdef INTERPRET_C_ULE_D + gencallinterp((unsigned int)cached_interpreter_table.C_ULE_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.ft])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jp_rj(14); + ja_rj(12); // 2 + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + +void genc_sf_d(void) +{ +#ifdef INTERPRET_C_SF_D + gencallinterp((unsigned int)cached_interpreter_table.C_SF_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.ft])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + fcomip_fpreg(1); + ffree_fpreg(0); + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); +#endif +} + +void genc_ngle_d(void) +{ +#ifdef INTERPRET_C_NGLE_D + gencallinterp((unsigned int)cached_interpreter_table.C_NGLE_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.ft])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jp_rj(12); + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 + jmp_imm_short(10); // 2 + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 +#endif +} + +void genc_seq_d(void) +{ +#ifdef INTERPRET_C_SEQ_D + gencallinterp((unsigned int)cached_interpreter_table.C_SEQ_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.ft])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jne_rj(12); // 2 + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + +void genc_ngl_d(void) +{ +#ifdef INTERPRET_C_NGL_D + gencallinterp((unsigned int)cached_interpreter_table.C_NGL_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.ft])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jp_rj(14); + jne_rj(12); + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + +void genc_lt_d(void) +{ +#ifdef INTERPRET_C_LT_D + gencallinterp((unsigned int)cached_interpreter_table.C_LT_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.ft])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jae_rj(12); // 2 + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + +void genc_nge_d(void) +{ +#ifdef INTERPRET_C_NGE_D + gencallinterp((unsigned int)cached_interpreter_table.C_NGE_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.ft])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jp_rj(14); + jae_rj(12); // 2 + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + +void genc_le_d(void) +{ +#ifdef INTERPRET_C_LE_D + gencallinterp((unsigned int)cached_interpreter_table.C_LE_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.ft])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + fcomip_fpreg(1); + ffree_fpreg(0); + ja_rj(12); // 2 + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + +void genc_ngt_d(void) +{ +#ifdef INTERPRET_C_NGT_D + gencallinterp((unsigned int)cached_interpreter_table.C_NGT_D, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.ft])); + fld_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fld_preg32_qword(EAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jp_rj(14); + ja_rj(12); // 2 + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86/gcop1_l.c b/libmupen64plus/mupen64plus-core/src/r4300/x86/gcop1_l.c new file mode 100644 index 0000000000..6dd6254aad --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86/gcop1_l.c @@ -0,0 +1,54 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - gcop1_l.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "assemble.h" +#include "interpret.h" + +#include "r4300/recomph.h" +#include "r4300/r4300.h" +#include "r4300/ops.h" + +void gencvt_s_l(void) +{ +#ifdef INTERPRET_CVT_S_L + gencallinterp((unsigned int)cached_interpreter_table.CVT_S_L, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fild_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_simple[dst->f.cf.fd])); + fstp_preg32_dword(EAX); +#endif +} + +void gencvt_d_l(void) +{ +#ifdef INTERPRET_CVT_D_L + gencallinterp((unsigned int)cached_interpreter_table.CVT_D_L, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fs])); + fild_preg32_qword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fd])); + fstp_preg32_qword(EAX); +#endif +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86/gcop1_s.c b/libmupen64plus/mupen64plus-core/src/r4300/x86/gcop1_s.c new file mode 100644 index 0000000000..b8a91a8afe --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86/gcop1_s.c @@ -0,0 +1,603 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - gcop1_s.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "assemble.h" +#include "interpret.h" + +#include "r4300/recomph.h" +#include "r4300/r4300.h" +#include "r4300/ops.h" +#include "r4300/macros.h" + +void genadd_s(void) +{ +#ifdef INTERPRET_ADD_S + gencallinterp((unsigned int)cached_interpreter_table.ADD_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.ft])); + fadd_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fd])); + fstp_preg32_dword(EAX); +#endif +} + +void gensub_s(void) +{ +#ifdef INTERPRET_SUB_S + gencallinterp((unsigned int)cached_interpreter_table.SUB_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.ft])); + fsub_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fd])); + fstp_preg32_dword(EAX); +#endif +} + +void genmul_s(void) +{ +#ifdef INTERPRET_MUL_S + gencallinterp((unsigned int)cached_interpreter_table.MUL_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.ft])); + fmul_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fd])); + fstp_preg32_dword(EAX); +#endif +} + +void gendiv_s(void) +{ +#ifdef INTERPRET_DIV_S + gencallinterp((unsigned int)cached_interpreter_table.DIV_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.ft])); + fdiv_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fd])); + fstp_preg32_dword(EAX); +#endif +} + +void gensqrt_s(void) +{ +#ifdef INTERPRET_SQRT_S + gencallinterp((unsigned int)cached_interpreter_table.SQRT_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + fsqrt(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fd])); + fstp_preg32_dword(EAX); +#endif +} + +void genabs_s(void) +{ +#ifdef INTERPRET_ABS_S + gencallinterp((unsigned int)cached_interpreter_table.ABS_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + fabs_(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fd])); + fstp_preg32_dword(EAX); +#endif +} + +void genmov_s(void) +{ +#ifdef INTERPRET_MOV_S + gencallinterp((unsigned int)cached_interpreter_table.MOV_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + mov_reg32_preg32(EBX, EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fd])); + mov_preg32_reg32(EAX, EBX); +#endif +} + +void genneg_s(void) +{ +#ifdef INTERPRET_NEG_S + gencallinterp((unsigned int)cached_interpreter_table.NEG_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + fchs(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fd])); + fstp_preg32_dword(EAX); +#endif +} + +void genround_l_s(void) +{ +#ifdef INTERPRET_ROUND_L_S + gencallinterp((unsigned int)cached_interpreter_table.ROUND_L_S, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16((unsigned short*)&round_mode); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.fd])); + fistp_preg32_qword(EAX); + fldcw_m16((unsigned short*)&rounding_mode); +#endif +} + +void gentrunc_l_s(void) +{ +#ifdef INTERPRET_TRUNC_L_S + gencallinterp((unsigned int)cached_interpreter_table.TRUNC_L_S, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16((unsigned short*)&trunc_mode); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.fd])); + fistp_preg32_qword(EAX); + fldcw_m16((unsigned short*)&rounding_mode); +#endif +} + +void genceil_l_s(void) +{ +#ifdef INTERPRET_CEIL_L_S + gencallinterp((unsigned int)cached_interpreter_table.CEIL_L_S, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16((unsigned short*)&ceil_mode); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.fd])); + fistp_preg32_qword(EAX); + fldcw_m16((unsigned short*)&rounding_mode); +#endif +} + +void genfloor_l_s(void) +{ +#ifdef INTERPRET_FLOOR_L_S + gencallinterp((unsigned int)cached_interpreter_table.FLOOR_L_S, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16((unsigned short*)&floor_mode); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.fd])); + fistp_preg32_qword(EAX); + fldcw_m16((unsigned short*)&rounding_mode); +#endif +} + +void genround_w_s(void) +{ +#ifdef INTERPRET_ROUND_W_S + gencallinterp((unsigned int)cached_interpreter_table.ROUND_W_S, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16((unsigned short*)&round_mode); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fd])); + fistp_preg32_dword(EAX); + fldcw_m16((unsigned short*)&rounding_mode); +#endif +} + +void gentrunc_w_s(void) +{ +#ifdef INTERPRET_TRUNC_W_S + gencallinterp((unsigned int)cached_interpreter_table.TRUNC_W_S, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16((unsigned short*)&trunc_mode); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fd])); + fistp_preg32_dword(EAX); + fldcw_m16((unsigned short*)&rounding_mode); +#endif +} + +void genceil_w_s(void) +{ +#ifdef INTERPRET_CEIL_W_S + gencallinterp((unsigned int)cached_interpreter_table.CEIL_W_S, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16((unsigned short*)&ceil_mode); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fd])); + fistp_preg32_dword(EAX); + fldcw_m16((unsigned short*)&rounding_mode); +#endif +} + +void genfloor_w_s(void) +{ +#ifdef INTERPRET_FLOOR_W_S + gencallinterp((unsigned int)cached_interpreter_table.FLOOR_W_S, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16((unsigned short*)&floor_mode); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fd])); + fistp_preg32_dword(EAX); + fldcw_m16((unsigned short*)&rounding_mode); +#endif +} + +void gencvt_d_s(void) +{ +#ifdef INTERPRET_CVT_D_S + gencallinterp((unsigned int)cached_interpreter_table.CVT_D_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.fd])); + fstp_preg32_qword(EAX); +#endif +} + +void gencvt_w_s(void) +{ +#ifdef INTERPRET_CVT_W_S + gencallinterp((unsigned int)cached_interpreter_table.CVT_W_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fd])); + fistp_preg32_dword(EAX); +#endif +} + +void gencvt_l_s(void) +{ +#ifdef INTERPRET_CVT_L_S + gencallinterp((unsigned int)cached_interpreter_table.CVT_L_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_double[dst->f.cf.fd])); + fistp_preg32_qword(EAX); +#endif +} + +void genc_f_s(void) +{ +#ifdef INTERPRET_C_F_S + gencallinterp((unsigned int)cached_interpreter_table.C_F_S, 0); +#else + gencheck_cop1_unusable(); + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); +#endif +} + +void genc_un_s(void) +{ +#ifdef INTERPRET_C_UN_S + gencallinterp((unsigned int)cached_interpreter_table.C_UN_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jp_rj(12); + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 + jmp_imm_short(10); // 2 + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 +#endif +} + +void genc_eq_s(void) +{ +#ifdef INTERPRET_C_EQ_S + gencallinterp((unsigned int)cached_interpreter_table.C_EQ_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jne_rj(12); + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + +void genc_ueq_s(void) +{ +#ifdef INTERPRET_C_UEQ_S + gencallinterp((unsigned int)cached_interpreter_table.C_UEQ_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jp_rj(14); + jne_rj(12); + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + +void genc_olt_s(void) +{ +#ifdef INTERPRET_C_OLT_S + gencallinterp((unsigned int)cached_interpreter_table.C_OLT_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jae_rj(12); + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + +void genc_ult_s(void) +{ +#ifdef INTERPRET_C_ULT_S + gencallinterp((unsigned int)cached_interpreter_table.C_ULT_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jp_rj(14); + jae_rj(12); + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + +void genc_ole_s(void) +{ +#ifdef INTERPRET_C_OLE_S + gencallinterp((unsigned int)cached_interpreter_table.C_OLE_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + fucomip_fpreg(1); + ffree_fpreg(0); + ja_rj(12); + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + +void genc_ule_s(void) +{ +#ifdef INTERPRET_C_ULE_S + gencallinterp((unsigned int)cached_interpreter_table.C_ULE_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jp_rj(14); + ja_rj(12); + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + +void genc_sf_s(void) +{ +#ifdef INTERPRET_C_SF_S + gencallinterp((unsigned int)cached_interpreter_table.C_SF_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + fcomip_fpreg(1); + ffree_fpreg(0); + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); +#endif +} + +void genc_ngle_s(void) +{ +#ifdef INTERPRET_C_NGLE_S + gencallinterp((unsigned int)cached_interpreter_table.C_NGLE_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jp_rj(12); + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 + jmp_imm_short(10); // 2 + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 +#endif +} + +void genc_seq_s(void) +{ +#ifdef INTERPRET_C_SEQ_S + gencallinterp((unsigned int)cached_interpreter_table.C_SEQ_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jne_rj(12); + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + +void genc_ngl_s(void) +{ +#ifdef INTERPRET_C_NGL_S + gencallinterp((unsigned int)cached_interpreter_table.C_NGL_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jp_rj(14); + jne_rj(12); + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + +void genc_lt_s(void) +{ +#ifdef INTERPRET_C_LT_S + gencallinterp((unsigned int)cached_interpreter_table.C_LT_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jae_rj(12); + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + +void genc_nge_s(void) +{ +#ifdef INTERPRET_C_NGE_S + gencallinterp((unsigned int)cached_interpreter_table.C_NGE_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jp_rj(14); + jae_rj(12); + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + +void genc_le_s(void) +{ +#ifdef INTERPRET_C_LE_S + gencallinterp((unsigned int)cached_interpreter_table.C_LE_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + fcomip_fpreg(1); + ffree_fpreg(0); + ja_rj(12); + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + +void genc_ngt_s(void) +{ +#ifdef INTERPRET_C_NGT_S + gencallinterp((unsigned int)cached_interpreter_table.C_NGT_S, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg32_dword(EAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jp_rj(14); + ja_rj(12); + or_m32_imm32((unsigned int*)&FCR31, 0x800000); // 10 + jmp_imm_short(10); // 2 + and_m32_imm32((unsigned int*)&FCR31, ~0x800000); // 10 +#endif +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86/gcop1_w.c b/libmupen64plus/mupen64plus-core/src/r4300/x86/gcop1_w.c new file mode 100644 index 0000000000..13e0a5c2c9 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86/gcop1_w.c @@ -0,0 +1,56 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - gcop1_w.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "assemble.h" +#include "interpret.h" + +#include "r4300/recomph.h" +#include "r4300/r4300.h" +#include "r4300/ops.h" + +void gencvt_s_w(void) +{ +#ifdef INTERPRET_CVT_S_W + gencallinterp((unsigned int)cached_interpreter_table.CVT_S_W, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_simple[dst->f.cf.fs])); + fild_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_simple[dst->f.cf.fd])); + fstp_preg32_dword(EAX); +#endif +} + +void gencvt_d_w(void) +{ +#ifdef INTERPRET_CVT_D_W + gencallinterp((unsigned int)cached_interpreter_table.CVT_D_W, 0); +#else + gencheck_cop1_unusable(); + mov_eax_memoffs32((unsigned int*)(®_cop1_simple[dst->f.cf.fs])); + fild_preg32_dword(EAX); + mov_eax_memoffs32((unsigned int*)(®_cop1_double[dst->f.cf.fd])); + fstp_preg32_qword(EAX); +#endif +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86/gr4300.c b/libmupen64plus/mupen64plus-core/src/r4300/x86/gr4300.c new file mode 100644 index 0000000000..d2ed999728 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86/gr4300.c @@ -0,0 +1,2050 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - gr4300.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "assemble.h" +#include "interpret.h" +#include "regcache.h" + +#include "api/debugger.h" + +#include "r4300/r4300.h" +#include "r4300/macros.h" +#include "r4300/interupt.h" +#include "r4300/ops.h" +#include "r4300/recomph.h" +#include "r4300/exception.h" + +#include "memory/memory.h" + +extern unsigned int op; + +static precomp_instr fake_instr; +#ifdef COMPARE_CORE +static int eax, ebx, ecx, edx, esp, ebp, esi, edi; +#endif + +int branch_taken; + +/* static functions */ + +static void genupdate_count(unsigned int addr) +{ +#ifndef COMPARE_CORE +#ifndef DBG + mov_reg32_imm32(EAX, addr); + sub_reg32_m32(EAX, (unsigned int*)(&last_addr)); + shr_reg32_imm8(EAX, 1); + add_m32_reg32((unsigned int*)(&Count), EAX); +#else + mov_m32_imm32((unsigned int*)(&PC), (unsigned int)(dst+1)); + mov_reg32_imm32(EAX, (unsigned int)update_count); + call_reg32(EAX); +#endif +#else + mov_m32_imm32((unsigned int*)(&PC), (unsigned int)(dst+1)); + mov_reg32_imm32(EAX, (unsigned int)update_count); + call_reg32(EAX); +#endif +} + +static void gencheck_interupt(unsigned int instr_structure) +{ + mov_eax_memoffs32(&next_interupt); + cmp_reg32_m32(EAX, &Count); + ja_rj(17); + mov_m32_imm32((unsigned int*)(&PC), instr_structure); // 10 + mov_reg32_imm32(EAX, (unsigned int)gen_interupt); // 5 + call_reg32(EAX); // 2 +} + +static void gencheck_interupt_out(unsigned int addr) +{ + mov_eax_memoffs32(&next_interupt); + cmp_reg32_m32(EAX, &Count); + ja_rj(27); + mov_m32_imm32((unsigned int*)(&fake_instr.addr), addr); + mov_m32_imm32((unsigned int*)(&PC), (unsigned int)(&fake_instr)); + mov_reg32_imm32(EAX, (unsigned int)gen_interupt); + call_reg32(EAX); +} + +static void genbeq_test(void) +{ + int rs_64bit = is64((unsigned int *)dst->f.i.rs); + int rt_64bit = is64((unsigned int *)dst->f.i.rt); + + if (!rs_64bit && !rt_64bit) + { + int rs = allocate_register((unsigned int *)dst->f.i.rs); + int rt = allocate_register((unsigned int *)dst->f.i.rt); + + cmp_reg32_reg32(rs, rt); + jne_rj(12); + mov_m32_imm32((unsigned int *)(&branch_taken), 1); // 10 + jmp_imm_short(10); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 0); // 10 + } + else if (rs_64bit == -1) + { + int rt1 = allocate_64_register1((unsigned int *)dst->f.i.rt); + int rt2 = allocate_64_register2((unsigned int *)dst->f.i.rt); + + cmp_reg32_m32(rt1, (unsigned int *)dst->f.i.rs); + jne_rj(20); + cmp_reg32_m32(rt2, ((unsigned int *)dst->f.i.rs)+1); // 6 + jne_rj(12); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 1); // 10 + jmp_imm_short(10); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 0); // 10 + } + else if (rt_64bit == -1) + { + int rs1 = allocate_64_register1((unsigned int *)dst->f.i.rs); + int rs2 = allocate_64_register2((unsigned int *)dst->f.i.rs); + + cmp_reg32_m32(rs1, (unsigned int *)dst->f.i.rt); + jne_rj(20); + cmp_reg32_m32(rs2, ((unsigned int *)dst->f.i.rt)+1); // 6 + jne_rj(12); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 1); // 10 + jmp_imm_short(10); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 0); // 10 + } + else + { + int rs1, rs2, rt1, rt2; + if (!rs_64bit) + { + rt1 = allocate_64_register1((unsigned int *)dst->f.i.rt); + rt2 = allocate_64_register2((unsigned int *)dst->f.i.rt); + rs1 = allocate_64_register1((unsigned int *)dst->f.i.rs); + rs2 = allocate_64_register2((unsigned int *)dst->f.i.rs); + } + else + { + rs1 = allocate_64_register1((unsigned int *)dst->f.i.rs); + rs2 = allocate_64_register2((unsigned int *)dst->f.i.rs); + rt1 = allocate_64_register1((unsigned int *)dst->f.i.rt); + rt2 = allocate_64_register2((unsigned int *)dst->f.i.rt); + } + cmp_reg32_reg32(rs1, rt1); + jne_rj(16); + cmp_reg32_reg32(rs2, rt2); // 2 + jne_rj(12); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 1); // 10 + jmp_imm_short(10); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 0); // 10 + } +} + +static void genbne_test(void) +{ + int rs_64bit = is64((unsigned int *)dst->f.i.rs); + int rt_64bit = is64((unsigned int *)dst->f.i.rt); + + if (!rs_64bit && !rt_64bit) + { + int rs = allocate_register((unsigned int *)dst->f.i.rs); + int rt = allocate_register((unsigned int *)dst->f.i.rt); + + cmp_reg32_reg32(rs, rt); + je_rj(12); + mov_m32_imm32((unsigned int *)(&branch_taken), 1); // 10 + jmp_imm_short(10); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 0); // 10 + } + else if (rs_64bit == -1) + { + int rt1 = allocate_64_register1((unsigned int *)dst->f.i.rt); + int rt2 = allocate_64_register2((unsigned int *)dst->f.i.rt); + + cmp_reg32_m32(rt1, (unsigned int *)dst->f.i.rs); + jne_rj(20); + cmp_reg32_m32(rt2, ((unsigned int *)dst->f.i.rs)+1); // 6 + jne_rj(12); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 0); // 10 + jmp_imm_short(10); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 1); // 10 + } + else if (rt_64bit == -1) + { + int rs1 = allocate_64_register1((unsigned int *)dst->f.i.rs); + int rs2 = allocate_64_register2((unsigned int *)dst->f.i.rs); + + cmp_reg32_m32(rs1, (unsigned int *)dst->f.i.rt); + jne_rj(20); + cmp_reg32_m32(rs2, ((unsigned int *)dst->f.i.rt)+1); // 6 + jne_rj(12); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 0); // 10 + jmp_imm_short(10); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 1); // 10 + } + else + { + int rs1, rs2, rt1, rt2; + if (!rs_64bit) + { + rt1 = allocate_64_register1((unsigned int *)dst->f.i.rt); + rt2 = allocate_64_register2((unsigned int *)dst->f.i.rt); + rs1 = allocate_64_register1((unsigned int *)dst->f.i.rs); + rs2 = allocate_64_register2((unsigned int *)dst->f.i.rs); + } + else + { + rs1 = allocate_64_register1((unsigned int *)dst->f.i.rs); + rs2 = allocate_64_register2((unsigned int *)dst->f.i.rs); + rt1 = allocate_64_register1((unsigned int *)dst->f.i.rt); + rt2 = allocate_64_register2((unsigned int *)dst->f.i.rt); + } + cmp_reg32_reg32(rs1, rt1); + jne_rj(16); + cmp_reg32_reg32(rs2, rt2); // 2 + jne_rj(12); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 0); // 10 + jmp_imm_short(10); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 1); // 10 + } +} + +static void genblez_test(void) +{ + int rs_64bit = is64((unsigned int *)dst->f.i.rs); + + if (!rs_64bit) + { + int rs = allocate_register((unsigned int *)dst->f.i.rs); + + cmp_reg32_imm32(rs, 0); + jg_rj(12); + mov_m32_imm32((unsigned int *)(&branch_taken), 1); // 10 + jmp_imm_short(10); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 0); // 10 + } + else if (rs_64bit == -1) + { + cmp_m32_imm32(((unsigned int *)dst->f.i.rs)+1, 0); + jg_rj(14); + jne_rj(24); // 2 + cmp_m32_imm32((unsigned int *)dst->f.i.rs, 0); // 10 + je_rj(12); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 0); // 10 + jmp_imm_short(10); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 1); // 10 + } + else + { + int rs1 = allocate_64_register1((unsigned int *)dst->f.i.rs); + int rs2 = allocate_64_register2((unsigned int *)dst->f.i.rs); + + cmp_reg32_imm32(rs2, 0); + jg_rj(10); + jne_rj(20); // 2 + cmp_reg32_imm32(rs1, 0); // 6 + je_rj(12); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 0); // 10 + jmp_imm_short(10); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 1); // 10 + } +} + +static void genbgtz_test(void) +{ + int rs_64bit = is64((unsigned int *)dst->f.i.rs); + + if (!rs_64bit) + { + int rs = allocate_register((unsigned int *)dst->f.i.rs); + + cmp_reg32_imm32(rs, 0); + jle_rj(12); + mov_m32_imm32((unsigned int *)(&branch_taken), 1); // 10 + jmp_imm_short(10); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 0); // 10 + } + else if (rs_64bit == -1) + { + cmp_m32_imm32(((unsigned int *)dst->f.i.rs)+1, 0); + jl_rj(14); + jne_rj(24); // 2 + cmp_m32_imm32((unsigned int *)dst->f.i.rs, 0); // 10 + jne_rj(12); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 0); // 10 + jmp_imm_short(10); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 1); // 10 + } + else + { + int rs1 = allocate_64_register1((unsigned int *)dst->f.i.rs); + int rs2 = allocate_64_register2((unsigned int *)dst->f.i.rs); + + cmp_reg32_imm32(rs2, 0); + jl_rj(10); + jne_rj(20); // 2 + cmp_reg32_imm32(rs1, 0); // 6 + jne_rj(12); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 0); // 10 + jmp_imm_short(10); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 1); // 10 + } +} + + +/* global functions */ + +void gennotcompiled(void) +{ + free_all_registers(); + simplify_access(); + + mov_m32_imm32((unsigned int*)(&PC), (unsigned int)(dst)); + mov_reg32_imm32(EAX, (unsigned int)cached_interpreter_table.NOTCOMPILED); + call_reg32(EAX); +} + +void genlink_subblock(void) +{ + free_all_registers(); + jmp(dst->addr+4); +} + +#ifdef COMPARE_CORE +void gendebug(void) +{ + free_all_registers(); + mov_m32_reg32((unsigned int*)&eax, EAX); + mov_m32_reg32((unsigned int*)&ebx, EBX); + mov_m32_reg32((unsigned int*)&ecx, ECX); + mov_m32_reg32((unsigned int*)&edx, EDX); + mov_m32_reg32((unsigned int*)&esp, ESP); + mov_m32_reg32((unsigned int*)&ebp, EBP); + mov_m32_reg32((unsigned int*)&esi, ESI); + mov_m32_reg32((unsigned int*)&edi, EDI); + + mov_m32_imm32((unsigned int*)(&PC), (unsigned int)(dst)); + mov_m32_imm32((unsigned int*)(&op), (unsigned int)(src)); + mov_reg32_imm32(EAX, (unsigned int) CoreCompareCallback); + call_reg32(EAX); + + mov_reg32_m32(EAX, (unsigned int*)&eax); + mov_reg32_m32(EBX, (unsigned int*)&ebx); + mov_reg32_m32(ECX, (unsigned int*)&ecx); + mov_reg32_m32(EDX, (unsigned int*)&edx); + mov_reg32_m32(ESP, (unsigned int*)&esp); + mov_reg32_m32(EBP, (unsigned int*)&ebp); + mov_reg32_m32(ESI, (unsigned int*)&esi); + mov_reg32_m32(EDI, (unsigned int*)&edi); +} +#endif + +void gencallinterp(unsigned long addr, int jump) +{ + free_all_registers(); + simplify_access(); + if (jump) + mov_m32_imm32((unsigned int*)(&dyna_interp), 1); + mov_m32_imm32((unsigned int*)(&PC), (unsigned int)(dst)); + mov_reg32_imm32(EAX, addr); + call_reg32(EAX); + if (jump) + { + mov_m32_imm32((unsigned int*)(&dyna_interp), 0); + mov_reg32_imm32(EAX, (unsigned int)dyna_jump); + call_reg32(EAX); + } +} + +void gendelayslot(void) +{ + mov_m32_imm32(&delay_slot, 1); + recompile_opcode(); + + free_all_registers(); + genupdate_count(dst->addr+4); + + mov_m32_imm32(&delay_slot, 0); +} + +void genni(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.NI, 0); +} + +void genreserved(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.RESERVED, 0); +} + +void genfin_block(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.FIN_BLOCK, 0); +} + +void gencheck_interupt_reg(void) // addr is in EAX +{ + mov_reg32_m32(EBX, &next_interupt); + cmp_reg32_m32(EBX, &Count); + ja_rj(22); + mov_memoffs32_eax((unsigned int*)(&fake_instr.addr)); // 5 + mov_m32_imm32((unsigned int*)(&PC), (unsigned int)(&fake_instr)); // 10 + mov_reg32_imm32(EAX, (unsigned int)gen_interupt); // 5 + call_reg32(EAX); // 2 +} + +void gennop(void) +{ +} + +void genj(void) +{ +#ifdef INTERPRET_J + gencallinterp((unsigned int)cached_interpreter_table.J, 1); +#else + unsigned int naddr; + + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.J, 1); + return; + } + + gendelayslot(); + naddr = ((dst-1)->f.j.inst_index<<2) | (dst->addr & 0xF0000000); + + mov_m32_imm32(&last_addr, naddr); + gencheck_interupt((unsigned int)&actual->block[(naddr-actual->start)/4]); + jmp(naddr); +#endif +} + +void genj_out(void) +{ +#ifdef INTERPRET_J_OUT + gencallinterp((unsigned int)cached_interpreter_table.J_OUT, 1); +#else + unsigned int naddr; + + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.J_OUT, 1); + return; + } + + gendelayslot(); + naddr = ((dst-1)->f.j.inst_index<<2) | (dst->addr & 0xF0000000); + + mov_m32_imm32(&last_addr, naddr); + gencheck_interupt_out(naddr); + mov_m32_imm32(&jump_to_address, naddr); + mov_m32_imm32((unsigned int*)(&PC), (unsigned int)(dst+1)); + mov_reg32_imm32(EAX, (unsigned int)jump_to_func); + call_reg32(EAX); +#endif +} + +void genj_idle(void) +{ +#ifdef INTERPRET_J_IDLE + gencallinterp((unsigned int)cached_interpreter_table.J_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.J_IDLE, 1); + return; + } + + mov_eax_memoffs32((unsigned int *)(&next_interupt)); + sub_reg32_m32(EAX, (unsigned int *)(&Count)); + cmp_reg32_imm8(EAX, 3); + jbe_rj(11); + + and_eax_imm32(0xFFFFFFFC); // 5 + add_m32_reg32((unsigned int *)(&Count), EAX); // 6 + + genj(); +#endif +} + +void genjal(void) +{ +#ifdef INTERPRET_JAL + gencallinterp((unsigned int)cached_interpreter_table.JAL, 1); +#else + unsigned int naddr; + + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.JAL, 1); + return; + } + + gendelayslot(); + + mov_m32_imm32((unsigned int *)(reg + 31), dst->addr + 4); + if (((dst->addr + 4) & 0x80000000)) + mov_m32_imm32((unsigned int *)(®[31])+1, 0xFFFFFFFF); + else + mov_m32_imm32((unsigned int *)(®[31])+1, 0); + + naddr = ((dst-1)->f.j.inst_index<<2) | (dst->addr & 0xF0000000); + + mov_m32_imm32(&last_addr, naddr); + gencheck_interupt((unsigned int)&actual->block[(naddr-actual->start)/4]); + jmp(naddr); +#endif +} + +void genjal_out(void) +{ +#ifdef INTERPRET_JAL_OUT + gencallinterp((unsigned int)cached_interpreter_table.JAL_OUT, 1); +#else + unsigned int naddr; + + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.JAL_OUT, 1); + return; + } + + gendelayslot(); + + mov_m32_imm32((unsigned int *)(reg + 31), dst->addr + 4); + if (((dst->addr + 4) & 0x80000000)) + mov_m32_imm32((unsigned int *)(®[31])+1, 0xFFFFFFFF); + else + mov_m32_imm32((unsigned int *)(®[31])+1, 0); + + naddr = ((dst-1)->f.j.inst_index<<2) | (dst->addr & 0xF0000000); + + mov_m32_imm32(&last_addr, naddr); + gencheck_interupt_out(naddr); + mov_m32_imm32(&jump_to_address, naddr); + mov_m32_imm32((unsigned int*)(&PC), (unsigned int)(dst+1)); + mov_reg32_imm32(EAX, (unsigned int)jump_to_func); + call_reg32(EAX); +#endif +} + +void genjal_idle(void) +{ +#ifdef INTERPRET_JAL_IDLE + gencallinterp((unsigned int)cached_interpreter_table.JAL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.JAL_IDLE, 1); + return; + } + + mov_eax_memoffs32((unsigned int *)(&next_interupt)); + sub_reg32_m32(EAX, (unsigned int *)(&Count)); + cmp_reg32_imm8(EAX, 3); + jbe_rj(11); + + and_eax_imm32(0xFFFFFFFC); + add_m32_reg32((unsigned int *)(&Count), EAX); + + genjal(); +#endif +} + +void gentest(void) +{ + cmp_m32_imm32((unsigned int *)(&branch_taken), 0); + je_near_rj(0); + + jump_start_rel32(); + + mov_m32_imm32(&last_addr, dst->addr + (dst-1)->f.i.immediate*4); + gencheck_interupt((unsigned int)(dst + (dst-1)->f.i.immediate)); + jmp(dst->addr + (dst-1)->f.i.immediate*4); + + jump_end_rel32(); + + mov_m32_imm32(&last_addr, dst->addr + 4); + gencheck_interupt((unsigned int)(dst + 1)); + jmp(dst->addr + 4); +} + +void genbeq(void) +{ +#ifdef INTERPRET_BEQ + gencallinterp((unsigned int)cached_interpreter_table.BEQ, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BEQ, 1); + return; + } + + genbeq_test(); + gendelayslot(); + gentest(); +#endif +} + +void gentest_out(void) +{ + cmp_m32_imm32((unsigned int *)(&branch_taken), 0); + je_near_rj(0); + + jump_start_rel32(); + + mov_m32_imm32(&last_addr, dst->addr + (dst-1)->f.i.immediate*4); + gencheck_interupt_out(dst->addr + (dst-1)->f.i.immediate*4); + mov_m32_imm32(&jump_to_address, dst->addr + (dst-1)->f.i.immediate*4); + mov_m32_imm32((unsigned int*)(&PC), (unsigned int)(dst+1)); + mov_reg32_imm32(EAX, (unsigned int)jump_to_func); + call_reg32(EAX); + + jump_end_rel32(); + + mov_m32_imm32(&last_addr, dst->addr + 4); + gencheck_interupt((unsigned int)(dst + 1)); + jmp(dst->addr + 4); +} + +void genbeq_out(void) +{ +#ifdef INTERPRET_BEQ_OUT + gencallinterp((unsigned int)cached_interpreter_table.BEQ_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BEQ_OUT, 1); + return; + } + + genbeq_test(); + gendelayslot(); + gentest_out(); +#endif +} + +void gentest_idle(void) +{ + int reg; + + reg = lru_register(); + free_register(reg); + + cmp_m32_imm32((unsigned int *)(&branch_taken), 0); + je_near_rj(0); + + jump_start_rel32(); + + mov_reg32_m32(reg, (unsigned int *)(&next_interupt)); + sub_reg32_m32(reg, (unsigned int *)(&Count)); + cmp_reg32_imm8(reg, 5); + jbe_rj(18); + + sub_reg32_imm32(reg, 2); // 6 + and_reg32_imm32(reg, 0xFFFFFFFC); // 6 + add_m32_reg32((unsigned int *)(&Count), reg); // 6 + + jump_end_rel32(); +} + +void genbeq_idle(void) +{ +#ifdef INTERPRET_BEQ_IDLE + gencallinterp((unsigned int)cached_interpreter_table.BEQ_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BEQ_IDLE, 1); + return; + } + + genbeq_test(); + gentest_idle(); + genbeq(); +#endif +} + +void genbne(void) +{ +#ifdef INTERPRET_BNE + gencallinterp((unsigned int)cached_interpreter_table.BNE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BNE, 1); + return; + } + + genbne_test(); + gendelayslot(); + gentest(); +#endif +} + +void genbne_out(void) +{ +#ifdef INTERPRET_BNE_OUT + gencallinterp((unsigned int)cached_interpreter_table.BNE_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BNE_OUT, 1); + return; + } + + genbne_test(); + gendelayslot(); + gentest_out(); +#endif +} + +void genbne_idle(void) +{ +#ifdef INTERPRET_BNE_IDLE + gencallinterp((unsigned int)cached_interpreter_table.BNE_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BNE_IDLE, 1); + return; + } + + genbne_test(); + gentest_idle(); + genbne(); +#endif +} + +void genblez(void) +{ +#ifdef INTERPRET_BLEZ + gencallinterp((unsigned int)cached_interpreter_table.BLEZ, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BLEZ, 1); + return; + } + + genblez_test(); + gendelayslot(); + gentest(); +#endif +} + +void genblez_out(void) +{ +#ifdef INTERPRET_BLEZ_OUT + gencallinterp((unsigned int)cached_interpreter_table.BLEZ_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BLEZ_OUT, 1); + return; + } + + genblez_test(); + gendelayslot(); + gentest_out(); +#endif +} + +void genblez_idle(void) +{ +#ifdef INTERPRET_BLEZ_IDLE + gencallinterp((unsigned int)cached_interpreter_table.BLEZ_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BLEZ_IDLE, 1); + return; + } + + genblez_test(); + gentest_idle(); + genblez(); +#endif +} + +void genbgtz(void) +{ +#ifdef INTERPRET_BGTZ + gencallinterp((unsigned int)cached_interpreter_table.BGTZ, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BGTZ, 1); + return; + } + + genbgtz_test(); + gendelayslot(); + gentest(); +#endif +} + +void genbgtz_out(void) +{ +#ifdef INTERPRET_BGTZ_OUT + gencallinterp((unsigned int)cached_interpreter_table.BGTZ_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BGTZ_OUT, 1); + return; + } + + genbgtz_test(); + gendelayslot(); + gentest_out(); +#endif +} + +void genbgtz_idle(void) +{ +#ifdef INTERPRET_BGTZ_IDLE + gencallinterp((unsigned int)cached_interpreter_table.BGTZ_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BGTZ_IDLE, 1); + return; + } + + genbgtz_test(); + gentest_idle(); + genbgtz(); +#endif +} + +void genaddi(void) +{ +#ifdef INTERPRET_ADDI + gencallinterp((unsigned int)cached_interpreter_table.ADDI, 0); +#else + int rs = allocate_register((unsigned int *)dst->f.i.rs); + int rt = allocate_register_w((unsigned int *)dst->f.i.rt); + + mov_reg32_reg32(rt, rs); + add_reg32_imm32(rt,(int)dst->f.i.immediate); +#endif +} + +void genaddiu(void) +{ +#ifdef INTERPRET_ADDIU + gencallinterp((unsigned int)cached_interpreter_table.ADDIU, 0); +#else + int rs = allocate_register((unsigned int *)dst->f.i.rs); + int rt = allocate_register_w((unsigned int *)dst->f.i.rt); + + mov_reg32_reg32(rt, rs); + add_reg32_imm32(rt,(int)dst->f.i.immediate); +#endif +} + +void genslti(void) +{ +#ifdef INTERPRET_SLTI + gencallinterp((unsigned int)cached_interpreter_table.SLTI, 0); +#else + int rs1 = allocate_64_register1((unsigned int *)dst->f.i.rs); + int rs2 = allocate_64_register2((unsigned int *)dst->f.i.rs); + int rt = allocate_register_w((unsigned int *)dst->f.i.rt); + long long imm = (long long)dst->f.i.immediate; + + cmp_reg32_imm32(rs2, (unsigned int)(imm >> 32)); + jl_rj(17); + jne_rj(8); // 2 + cmp_reg32_imm32(rs1, (unsigned int)imm); // 6 + jl_rj(7); // 2 + mov_reg32_imm32(rt, 0); // 5 + jmp_imm_short(5); // 2 + mov_reg32_imm32(rt, 1); // 5 +#endif +} + +void gensltiu(void) +{ +#ifdef INTERPRET_SLTIU + gencallinterp((unsigned int)cached_interpreter_table.SLTIU, 0); +#else + int rs1 = allocate_64_register1((unsigned int *)dst->f.i.rs); + int rs2 = allocate_64_register2((unsigned int *)dst->f.i.rs); + int rt = allocate_register_w((unsigned int *)dst->f.i.rt); + long long imm = (long long)dst->f.i.immediate; + + cmp_reg32_imm32(rs2, (unsigned int)(imm >> 32)); + jb_rj(17); + jne_rj(8); // 2 + cmp_reg32_imm32(rs1, (unsigned int)imm); // 6 + jb_rj(7); // 2 + mov_reg32_imm32(rt, 0); // 5 + jmp_imm_short(5); // 2 + mov_reg32_imm32(rt, 1); // 5 +#endif +} + +void genandi(void) +{ +#ifdef INTERPRET_ANDI + gencallinterp((unsigned int)cached_interpreter_table.ANDI, 0); +#else + int rs = allocate_register((unsigned int *)dst->f.i.rs); + int rt = allocate_register_w((unsigned int *)dst->f.i.rt); + + mov_reg32_reg32(rt, rs); + and_reg32_imm32(rt, (unsigned short)dst->f.i.immediate); +#endif +} + +void genori(void) +{ +#ifdef INTERPRET_ORI + gencallinterp((unsigned int)cached_interpreter_table.ORI, 0); +#else + int rs1 = allocate_64_register1((unsigned int *)dst->f.i.rs); + int rs2 = allocate_64_register2((unsigned int *)dst->f.i.rs); + int rt1 = allocate_64_register1_w((unsigned int *)dst->f.i.rt); + int rt2 = allocate_64_register2_w((unsigned int *)dst->f.i.rt); + + mov_reg32_reg32(rt1, rs1); + mov_reg32_reg32(rt2, rs2); + or_reg32_imm32(rt1, (unsigned short)dst->f.i.immediate); +#endif +} + +void genxori(void) +{ +#ifdef INTERPRET_XORI + gencallinterp((unsigned int)cached_interpreter_table.XORI, 0); +#else + int rs1 = allocate_64_register1((unsigned int *)dst->f.i.rs); + int rs2 = allocate_64_register2((unsigned int *)dst->f.i.rs); + int rt1 = allocate_64_register1_w((unsigned int *)dst->f.i.rt); + int rt2 = allocate_64_register2_w((unsigned int *)dst->f.i.rt); + + mov_reg32_reg32(rt1, rs1); + mov_reg32_reg32(rt2, rs2); + xor_reg32_imm32(rt1, (unsigned short)dst->f.i.immediate); +#endif +} + +void genlui(void) +{ +#ifdef INTERPRET_LUI + gencallinterp((unsigned int)cached_interpreter_table.LUI, 0); +#else + int rt = allocate_register_w((unsigned int *)dst->f.i.rt); + + mov_reg32_imm32(rt, (unsigned int)dst->f.i.immediate << 16); +#endif +} + +void gentestl(void) +{ + cmp_m32_imm32((unsigned int *)(&branch_taken), 0); + je_near_rj(0); + + jump_start_rel32(); + + gendelayslot(); + mov_m32_imm32(&last_addr, dst->addr + (dst-1)->f.i.immediate*4); + gencheck_interupt((unsigned int)(dst + (dst-1)->f.i.immediate)); + jmp(dst->addr + (dst-1)->f.i.immediate*4); + + jump_end_rel32(); + + genupdate_count(dst->addr+4); + mov_m32_imm32(&last_addr, dst->addr + 4); + gencheck_interupt((unsigned int)(dst + 1)); + jmp(dst->addr + 4); +} + +void genbeql(void) +{ +#ifdef INTERPRET_BEQL + gencallinterp((unsigned int)cached_interpreter_table.BEQL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BEQL, 1); + return; + } + + genbeq_test(); + free_all_registers(); + gentestl(); +#endif +} + +void gentestl_out(void) +{ + cmp_m32_imm32((unsigned int *)(&branch_taken), 0); + je_near_rj(0); + + jump_start_rel32(); + + gendelayslot(); + mov_m32_imm32(&last_addr, dst->addr + (dst-1)->f.i.immediate*4); + gencheck_interupt_out(dst->addr + (dst-1)->f.i.immediate*4); + mov_m32_imm32(&jump_to_address, dst->addr + (dst-1)->f.i.immediate*4); + mov_m32_imm32((unsigned int*)(&PC), (unsigned int)(dst+1)); + mov_reg32_imm32(EAX, (unsigned int)jump_to_func); + call_reg32(EAX); + + jump_end_rel32(); + + genupdate_count(dst->addr+4); + mov_m32_imm32(&last_addr, dst->addr + 4); + gencheck_interupt((unsigned int)(dst + 1)); + jmp(dst->addr + 4); +} + +void genbeql_out(void) +{ +#ifdef INTERPRET_BEQL_OUT + gencallinterp((unsigned int)cached_interpreter_table.BEQL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BEQL_OUT, 1); + return; + } + + genbeq_test(); + free_all_registers(); + gentestl_out(); +#endif +} + +void genbeql_idle(void) +{ +#ifdef INTERPRET_BEQL_IDLE + gencallinterp((unsigned int)cached_interpreter_table.BEQL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BEQL_IDLE, 1); + return; + } + + genbeq_test(); + gentest_idle(); + genbeql(); +#endif +} + +void genbnel(void) +{ +#ifdef INTERPRET_BNEL + gencallinterp((unsigned int)cached_interpreter_table.BNEL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BNEL, 1); + return; + } + + genbne_test(); + free_all_registers(); + gentestl(); +#endif +} + +void genbnel_out(void) +{ +#ifdef INTERPRET_BNEL_OUT + gencallinterp((unsigned int)cached_interpreter_table.BNEL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BNEL_OUT, 1); + return; + } + + genbne_test(); + free_all_registers(); + gentestl_out(); +#endif +} + +void genbnel_idle(void) +{ +#ifdef INTERPRET_BNEL_IDLE + gencallinterp((unsigned int)cached_interpreter_table.BNEL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BNEL_IDLE, 1); + return; + } + + genbne_test(); + gentest_idle(); + genbnel(); +#endif +} + +void genblezl(void) +{ +#ifdef INTERPRET_BLEZL + gencallinterp((unsigned int)cached_interpreter_table.BLEZL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BLEZL, 1); + return; + } + + genblez_test(); + free_all_registers(); + gentestl(); +#endif +} + +void genblezl_out(void) +{ +#ifdef INTERPRET_BLEZL_OUT + gencallinterp((unsigned int)cached_interpreter_table.BLEZL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BLEZL_OUT, 1); + return; + } + + genblez_test(); + free_all_registers(); + gentestl_out(); +#endif +} + +void genblezl_idle(void) +{ +#ifdef INTERPRET_BLEZL_IDLE + gencallinterp((unsigned int)cached_interpreter_table.BLEZL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BLEZL_IDLE, 1); + return; + } + + genblez_test(); + gentest_idle(); + genblezl(); +#endif +} + +void genbgtzl(void) +{ +#ifdef INTERPRET_BGTZL + gencallinterp((unsigned int)cached_interpreter_table.BGTZL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BGTZL, 1); + return; + } + + genbgtz_test(); + free_all_registers(); + gentestl(); +#endif +} + +void genbgtzl_out(void) +{ +#ifdef INTERPRET_BGTZL_OUT + gencallinterp((unsigned int)cached_interpreter_table.BGTZL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BGTZL_OUT, 1); + return; + } + + genbgtz_test(); + free_all_registers(); + gentestl_out(); +#endif +} + +void genbgtzl_idle(void) +{ +#ifdef INTERPRET_BGTZL_IDLE + gencallinterp((unsigned int)cached_interpreter_table.BGTZL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BGTZL_IDLE, 1); + return; + } + + genbgtz_test(); + gentest_idle(); + genbgtzl(); +#endif +} + +void gendaddi(void) +{ +#ifdef INTERPRET_DADDI + gencallinterp((unsigned int)cached_interpreter_table.DADDI, 0); +#else + int rs1 = allocate_64_register1((unsigned int *)dst->f.i.rs); + int rs2 = allocate_64_register2((unsigned int *)dst->f.i.rs); + int rt1 = allocate_64_register1_w((unsigned int *)dst->f.i.rt); + int rt2 = allocate_64_register2_w((unsigned int *)dst->f.i.rt); + + mov_reg32_reg32(rt1, rs1); + mov_reg32_reg32(rt2, rs2); + add_reg32_imm32(rt1, dst->f.i.immediate); + adc_reg32_imm32(rt2, (int)dst->f.i.immediate>>31); +#endif +} + +void gendaddiu(void) +{ +#ifdef INTERPRET_DADDIU + gencallinterp((unsigned int)cached_interpreter_table.DADDIU, 0); +#else + int rs1 = allocate_64_register1((unsigned int *)dst->f.i.rs); + int rs2 = allocate_64_register2((unsigned int *)dst->f.i.rs); + int rt1 = allocate_64_register1_w((unsigned int *)dst->f.i.rt); + int rt2 = allocate_64_register2_w((unsigned int *)dst->f.i.rt); + + mov_reg32_reg32(rt1, rs1); + mov_reg32_reg32(rt2, rs2); + add_reg32_imm32(rt1, dst->f.i.immediate); + adc_reg32_imm32(rt2, (int)dst->f.i.immediate>>31); +#endif +} + +void genldl(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.LDL, 0); +} + +void genldr(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.LDR, 0); +} + +void genlb(void) +{ +#ifdef INTERPRET_LB + gencallinterp((unsigned int)cached_interpreter_table.LB, 0); +#else + free_all_registers(); + simplify_access(); + mov_eax_memoffs32((unsigned int *)dst->f.i.rs); + add_eax_imm32((int)dst->f.i.immediate); + mov_reg32_reg32(EBX, EAX); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + shr_reg32_imm8(EAX, 16); + mov_reg32_preg32x4pimm32(EAX, EAX, (unsigned int)readmemb); + cmp_reg32_imm32(EAX, (unsigned int)read_rdramb); + } + je_rj(47); + + mov_m32_imm32((unsigned int *)&PC, (unsigned int)(dst+1)); // 10 + mov_m32_reg32((unsigned int *)(&address), EBX); // 6 + mov_m32_imm32((unsigned int *)(&rdword), (unsigned int)dst->f.i.rt); // 10 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg32_preg32x4pimm32(EBX, EBX, (unsigned int)readmemb); // 7 + call_reg32(EBX); // 2 + movsx_reg32_m8(EAX, (unsigned char *)dst->f.i.rt); // 7 + jmp_imm_short(16); // 2 + + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + xor_reg8_imm8(BL, 3); // 3 + movsx_reg32_8preg32pimm32(EAX, EBX, (unsigned int)rdram); // 7 + + set_register_state(EAX, (unsigned int*)dst->f.i.rt, 1); +#endif +} + +void genlh(void) +{ +#ifdef INTERPRET_LH + gencallinterp((unsigned int)cached_interpreter_table.LH, 0); +#else + free_all_registers(); + simplify_access(); + mov_eax_memoffs32((unsigned int *)dst->f.i.rs); + add_eax_imm32((int)dst->f.i.immediate); + mov_reg32_reg32(EBX, EAX); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + shr_reg32_imm8(EAX, 16); + mov_reg32_preg32x4pimm32(EAX, EAX, (unsigned int)readmemh); + cmp_reg32_imm32(EAX, (unsigned int)read_rdramh); + } + je_rj(47); + + mov_m32_imm32((unsigned int *)&PC, (unsigned int)(dst+1)); // 10 + mov_m32_reg32((unsigned int *)(&address), EBX); // 6 + mov_m32_imm32((unsigned int *)(&rdword), (unsigned int)dst->f.i.rt); // 10 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg32_preg32x4pimm32(EBX, EBX, (unsigned int)readmemh); // 7 + call_reg32(EBX); // 2 + movsx_reg32_m16(EAX, (unsigned short *)dst->f.i.rt); // 7 + jmp_imm_short(16); // 2 + + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + xor_reg8_imm8(BL, 2); // 3 + movsx_reg32_16preg32pimm32(EAX, EBX, (unsigned int)rdram); // 7 + + set_register_state(EAX, (unsigned int*)dst->f.i.rt, 1); +#endif +} + +void genlwl(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.LWL, 0); +} + +void genlw(void) +{ +#ifdef INTERPRET_LW + gencallinterp((unsigned int)cached_interpreter_table.LW, 0); +#else + free_all_registers(); + simplify_access(); + mov_eax_memoffs32((unsigned int *)dst->f.i.rs); + add_eax_imm32((int)dst->f.i.immediate); + mov_reg32_reg32(EBX, EAX); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + shr_reg32_imm8(EAX, 16); + mov_reg32_preg32x4pimm32(EAX, EAX, (unsigned int)readmem); + cmp_reg32_imm32(EAX, (unsigned int)read_rdram); + } + je_rj(45); + + mov_m32_imm32((unsigned int *)&PC, (unsigned int)(dst+1)); // 10 + mov_m32_reg32((unsigned int *)(&address), EBX); // 6 + mov_m32_imm32((unsigned int *)(&rdword), (unsigned int)dst->f.i.rt); // 10 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg32_preg32x4pimm32(EBX, EBX, (unsigned int)readmem); // 7 + call_reg32(EBX); // 2 + mov_eax_memoffs32((unsigned int *)(dst->f.i.rt)); // 5 + jmp_imm_short(12); // 2 + + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + mov_reg32_preg32pimm32(EAX, EBX, (unsigned int)rdram); // 6 + + set_register_state(EAX, (unsigned int*)dst->f.i.rt, 1); +#endif +} + +void genlbu(void) +{ +#ifdef INTERPRET_LBU + gencallinterp((unsigned int)cached_interpreter_table.LBU, 0); +#else + free_all_registers(); + simplify_access(); + mov_eax_memoffs32((unsigned int *)dst->f.i.rs); + add_eax_imm32((int)dst->f.i.immediate); + mov_reg32_reg32(EBX, EAX); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + shr_reg32_imm8(EAX, 16); + mov_reg32_preg32x4pimm32(EAX, EAX, (unsigned int)readmemb); + cmp_reg32_imm32(EAX, (unsigned int)read_rdramb); + } + je_rj(46); + + mov_m32_imm32((unsigned int *)&PC, (unsigned int)(dst+1)); // 10 + mov_m32_reg32((unsigned int *)(&address), EBX); // 6 + mov_m32_imm32((unsigned int *)(&rdword), (unsigned int)dst->f.i.rt); // 10 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg32_preg32x4pimm32(EBX, EBX, (unsigned int)readmemb); // 7 + call_reg32(EBX); // 2 + mov_reg32_m32(EAX, (unsigned int *)dst->f.i.rt); // 6 + jmp_imm_short(15); // 2 + + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + xor_reg8_imm8(BL, 3); // 3 + mov_reg32_preg32pimm32(EAX, EBX, (unsigned int)rdram); // 6 + + and_eax_imm32(0xFF); + + set_register_state(EAX, (unsigned int*)dst->f.i.rt, 1); +#endif +} + +void genlhu(void) +{ +#ifdef INTERPRET_LHU + gencallinterp((unsigned int)cached_interpreter_table.LHU, 0); +#else + free_all_registers(); + simplify_access(); + mov_eax_memoffs32((unsigned int *)dst->f.i.rs); + add_eax_imm32((int)dst->f.i.immediate); + mov_reg32_reg32(EBX, EAX); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + shr_reg32_imm8(EAX, 16); + mov_reg32_preg32x4pimm32(EAX, EAX, (unsigned int)readmemh); + cmp_reg32_imm32(EAX, (unsigned int)read_rdramh); + } + je_rj(46); + + mov_m32_imm32((unsigned int *)&PC, (unsigned int)(dst+1)); // 10 + mov_m32_reg32((unsigned int *)(&address), EBX); // 6 + mov_m32_imm32((unsigned int *)(&rdword), (unsigned int)dst->f.i.rt); // 10 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg32_preg32x4pimm32(EBX, EBX, (unsigned int)readmemh); // 7 + call_reg32(EBX); // 2 + mov_reg32_m32(EAX, (unsigned int *)dst->f.i.rt); // 6 + jmp_imm_short(15); // 2 + + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + xor_reg8_imm8(BL, 2); // 3 + mov_reg32_preg32pimm32(EAX, EBX, (unsigned int)rdram); // 6 + + and_eax_imm32(0xFFFF); + + set_register_state(EAX, (unsigned int*)dst->f.i.rt, 1); +#endif +} + +void genlwr(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.LWR, 0); +} + +void genlwu(void) +{ +#ifdef INTERPRET_LWU + gencallinterp((unsigned int)cached_interpreter_table.LWU, 0); +#else + free_all_registers(); + simplify_access(); + mov_eax_memoffs32((unsigned int *)dst->f.i.rs); + add_eax_imm32((int)dst->f.i.immediate); + mov_reg32_reg32(EBX, EAX); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + shr_reg32_imm8(EAX, 16); + mov_reg32_preg32x4pimm32(EAX, EAX, (unsigned int)readmem); + cmp_reg32_imm32(EAX, (unsigned int)read_rdram); + } + je_rj(45); + + mov_m32_imm32((unsigned int *)(&PC), (unsigned int)(dst+1)); // 10 + mov_m32_reg32((unsigned int *)(&address), EBX); // 6 + mov_m32_imm32((unsigned int *)(&rdword), (unsigned int)dst->f.i.rt); // 10 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg32_preg32x4pimm32(EBX, EBX, (unsigned int)readmem); // 7 + call_reg32(EBX); // 2 + mov_eax_memoffs32((unsigned int *)(dst->f.i.rt)); // 5 + jmp_imm_short(12); // 2 + + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + mov_reg32_preg32pimm32(EAX, EBX, (unsigned int)rdram); // 6 + + xor_reg32_reg32(EBX, EBX); + + set_64_register_state(EAX, EBX, (unsigned int*)dst->f.i.rt, 1); +#endif +} + +void gensb(void) +{ +#ifdef INTERPRET_SB + gencallinterp((unsigned int)cached_interpreter_table.SB, 0); +#else + free_all_registers(); + simplify_access(); + mov_reg8_m8(CL, (unsigned char *)dst->f.i.rt); + mov_eax_memoffs32((unsigned int *)dst->f.i.rs); + add_eax_imm32((int)dst->f.i.immediate); + mov_reg32_reg32(EBX, EAX); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + shr_reg32_imm8(EAX, 16); + mov_reg32_preg32x4pimm32(EAX, EAX, (unsigned int)writememb); + cmp_reg32_imm32(EAX, (unsigned int)write_rdramb); + } + je_rj(41); + + mov_m32_imm32((unsigned int *)(&PC), (unsigned int)(dst+1)); // 10 + mov_m32_reg32((unsigned int *)(&address), EBX); // 6 + mov_m8_reg8((unsigned char *)(&cpu_byte), CL); // 6 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg32_preg32x4pimm32(EBX, EBX, (unsigned int)writememb); // 7 + call_reg32(EBX); // 2 + mov_eax_memoffs32((unsigned int *)(&address)); // 5 + jmp_imm_short(17); // 2 + + mov_reg32_reg32(EAX, EBX); // 2 + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + xor_reg8_imm8(BL, 3); // 3 + mov_preg32pimm32_reg8(EBX, (unsigned int)rdram, CL); // 6 + + mov_reg32_reg32(EBX, EAX); + shr_reg32_imm8(EBX, 12); + cmp_preg32pimm32_imm8(EBX, (unsigned int)invalid_code, 0); + jne_rj(54); + mov_reg32_reg32(ECX, EBX); // 2 + shl_reg32_imm8(EBX, 2); // 3 + mov_reg32_preg32pimm32(EBX, EBX, (unsigned int)blocks); // 6 + mov_reg32_preg32pimm32(EBX, EBX, (int)&actual->block - (int)actual); // 6 + and_eax_imm32(0xFFF); // 5 + shr_reg32_imm8(EAX, 2); // 3 + mov_reg32_imm32(EDX, sizeof(precomp_instr)); // 5 + mul_reg32(EDX); // 2 + mov_reg32_preg32preg32pimm32(EAX, EAX, EBX, (int)&dst->ops - (int)dst); // 7 + cmp_reg32_imm32(EAX, (unsigned int)cached_interpreter_table.NOTCOMPILED); // 6 + je_rj(7); // 2 + mov_preg32pimm32_imm8(ECX, (unsigned int)invalid_code, 1); // 7 +#endif +} + +void gensh(void) +{ +#ifdef INTERPRET_SH + gencallinterp((unsigned int)cached_interpreter_table.SH, 0); +#else + free_all_registers(); + simplify_access(); + mov_reg16_m16(CX, (unsigned short *)dst->f.i.rt); + mov_eax_memoffs32((unsigned int *)dst->f.i.rs); + add_eax_imm32((int)dst->f.i.immediate); + mov_reg32_reg32(EBX, EAX); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + shr_reg32_imm8(EAX, 16); + mov_reg32_preg32x4pimm32(EAX, EAX, (unsigned int)writememh); + cmp_reg32_imm32(EAX, (unsigned int)write_rdramh); + } + je_rj(42); + + mov_m32_imm32((unsigned int *)(&PC), (unsigned int)(dst+1)); // 10 + mov_m32_reg32((unsigned int *)(&address), EBX); // 6 + mov_m16_reg16((unsigned short *)(&hword), CX); // 7 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg32_preg32x4pimm32(EBX, EBX, (unsigned int)writememh); // 7 + call_reg32(EBX); // 2 + mov_eax_memoffs32((unsigned int *)(&address)); // 5 + jmp_imm_short(18); // 2 + + mov_reg32_reg32(EAX, EBX); // 2 + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + xor_reg8_imm8(BL, 2); // 3 + mov_preg32pimm32_reg16(EBX, (unsigned int)rdram, CX); // 7 + + mov_reg32_reg32(EBX, EAX); + shr_reg32_imm8(EBX, 12); + cmp_preg32pimm32_imm8(EBX, (unsigned int)invalid_code, 0); + jne_rj(54); + mov_reg32_reg32(ECX, EBX); // 2 + shl_reg32_imm8(EBX, 2); // 3 + mov_reg32_preg32pimm32(EBX, EBX, (unsigned int)blocks); // 6 + mov_reg32_preg32pimm32(EBX, EBX, (int)&actual->block - (int)actual); // 6 + and_eax_imm32(0xFFF); // 5 + shr_reg32_imm8(EAX, 2); // 3 + mov_reg32_imm32(EDX, sizeof(precomp_instr)); // 5 + mul_reg32(EDX); // 2 + mov_reg32_preg32preg32pimm32(EAX, EAX, EBX, (int)&dst->ops - (int)dst); // 7 + cmp_reg32_imm32(EAX, (unsigned int)cached_interpreter_table.NOTCOMPILED); // 6 + je_rj(7); // 2 + mov_preg32pimm32_imm8(ECX, (unsigned int)invalid_code, 1); // 7 +#endif +} + +void genswl(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.SWL, 0); +} + +void gensw(void) +{ +#ifdef INTERPRET_SW + gencallinterp((unsigned int)cached_interpreter_table.SW, 0); +#else + free_all_registers(); + simplify_access(); + mov_reg32_m32(ECX, (unsigned int *)dst->f.i.rt); + mov_eax_memoffs32((unsigned int *)dst->f.i.rs); + add_eax_imm32((int)dst->f.i.immediate); + mov_reg32_reg32(EBX, EAX); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + shr_reg32_imm8(EAX, 16); + mov_reg32_preg32x4pimm32(EAX, EAX, (unsigned int)writemem); + cmp_reg32_imm32(EAX, (unsigned int)write_rdram); + } + je_rj(41); + + mov_m32_imm32((unsigned int *)(&PC), (unsigned int)(dst+1)); // 10 + mov_m32_reg32((unsigned int *)(&address), EBX); // 6 + mov_m32_reg32((unsigned int *)(&word), ECX); // 6 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg32_preg32x4pimm32(EBX, EBX, (unsigned int)writemem); // 7 + call_reg32(EBX); // 2 + mov_eax_memoffs32((unsigned int *)(&address)); // 5 + jmp_imm_short(14); // 2 + + mov_reg32_reg32(EAX, EBX); // 2 + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + mov_preg32pimm32_reg32(EBX, (unsigned int)rdram, ECX); // 6 + + mov_reg32_reg32(EBX, EAX); + shr_reg32_imm8(EBX, 12); + cmp_preg32pimm32_imm8(EBX, (unsigned int)invalid_code, 0); + jne_rj(54); + mov_reg32_reg32(ECX, EBX); // 2 + shl_reg32_imm8(EBX, 2); // 3 + mov_reg32_preg32pimm32(EBX, EBX, (unsigned int)blocks); // 6 + mov_reg32_preg32pimm32(EBX, EBX, (int)&actual->block - (int)actual); // 6 + and_eax_imm32(0xFFF); // 5 + shr_reg32_imm8(EAX, 2); // 3 + mov_reg32_imm32(EDX, sizeof(precomp_instr)); // 5 + mul_reg32(EDX); // 2 + mov_reg32_preg32preg32pimm32(EAX, EAX, EBX, (int)&dst->ops - (int)dst); // 7 + cmp_reg32_imm32(EAX, (unsigned int)cached_interpreter_table.NOTCOMPILED); // 6 + je_rj(7); // 2 + mov_preg32pimm32_imm8(ECX, (unsigned int)invalid_code, 1); // 7 +#endif +} + +void gensdl(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.SDL, 0); +} + +void gensdr(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.SDR, 0); +} + +void genswr(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.SWR, 0); +} + +void gencheck_cop1_unusable(void) +{ + free_all_registers(); + simplify_access(); + test_m32_imm32((unsigned int*)&Status, 0x20000000); + jne_rj(0); + + jump_start_rel8(); + + gencallinterp((unsigned int)check_cop1_unusable, 0); + + jump_end_rel8(); +} + +void genlwc1(void) +{ +#ifdef INTERPRET_LWC1 + gencallinterp((unsigned int)cached_interpreter_table.LWC1, 0); +#else + gencheck_cop1_unusable(); + + mov_eax_memoffs32((unsigned int *)(®[dst->f.lf.base])); + add_eax_imm32((int)dst->f.lf.offset); + mov_reg32_reg32(EBX, EAX); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + shr_reg32_imm8(EAX, 16); + mov_reg32_preg32x4pimm32(EAX, EAX, (unsigned int)readmem); + cmp_reg32_imm32(EAX, (unsigned int)read_rdram); + } + je_rj(42); + + mov_m32_imm32((unsigned int *)(&PC), (unsigned int)(dst+1)); // 10 + mov_m32_reg32((unsigned int *)(&address), EBX); // 6 + mov_reg32_m32(EDX, (unsigned int*)(®_cop1_simple[dst->f.lf.ft])); // 6 + mov_m32_reg32((unsigned int *)(&rdword), EDX); // 6 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg32_preg32x4pimm32(EBX, EBX, (unsigned int)readmem); // 7 + call_reg32(EBX); // 2 + jmp_imm_short(20); // 2 + + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + mov_reg32_preg32pimm32(EAX, EBX, (unsigned int)rdram); // 6 + mov_reg32_m32(EBX, (unsigned int*)(®_cop1_simple[dst->f.lf.ft])); // 6 + mov_preg32_reg32(EBX, EAX); // 2 +#endif +} + +void genldc1(void) +{ +#ifdef INTERPRET_LDC1 + gencallinterp((unsigned int)cached_interpreter_table.LDC1, 0); +#else + gencheck_cop1_unusable(); + + mov_eax_memoffs32((unsigned int *)(®[dst->f.lf.base])); + add_eax_imm32((int)dst->f.lf.offset); + mov_reg32_reg32(EBX, EAX); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + shr_reg32_imm8(EAX, 16); + mov_reg32_preg32x4pimm32(EAX, EAX, (unsigned int)readmemd); + cmp_reg32_imm32(EAX, (unsigned int)read_rdramd); + } + je_rj(42); + + mov_m32_imm32((unsigned int *)(&PC), (unsigned int)(dst+1)); // 10 + mov_m32_reg32((unsigned int *)(&address), EBX); // 6 + mov_reg32_m32(EDX, (unsigned int*)(®_cop1_double[dst->f.lf.ft])); // 6 + mov_m32_reg32((unsigned int *)(&rdword), EDX); // 6 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg32_preg32x4pimm32(EBX, EBX, (unsigned int)readmemd); // 7 + call_reg32(EBX); // 2 + jmp_imm_short(32); // 2 + + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + mov_reg32_preg32pimm32(EAX, EBX, ((unsigned int)rdram)+4); // 6 + mov_reg32_preg32pimm32(ECX, EBX, ((unsigned int)rdram)); // 6 + mov_reg32_m32(EBX, (unsigned int*)(®_cop1_double[dst->f.lf.ft])); // 6 + mov_preg32_reg32(EBX, EAX); // 2 + mov_preg32pimm32_reg32(EBX, 4, ECX); // 6 +#endif +} + +void gencache(void) +{ +} + +void genld(void) +{ +#ifdef INTERPRET_LD + gencallinterp((unsigned int)cached_interpreter_table.LD, 0); +#else + free_all_registers(); + simplify_access(); + mov_eax_memoffs32((unsigned int *)dst->f.i.rs); + add_eax_imm32((int)dst->f.i.immediate); + mov_reg32_reg32(EBX, EAX); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + shr_reg32_imm8(EAX, 16); + mov_reg32_preg32x4pimm32(EAX, EAX, (unsigned int)readmemd); + cmp_reg32_imm32(EAX, (unsigned int)read_rdramd); + } + je_rj(51); + + mov_m32_imm32((unsigned int *)(&PC), (unsigned int)(dst+1)); // 10 + mov_m32_reg32((unsigned int *)(&address), EBX); // 6 + mov_m32_imm32((unsigned int *)(&rdword), (unsigned int)dst->f.i.rt); // 10 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg32_preg32x4pimm32(EBX, EBX, (unsigned int)readmemd); // 7 + call_reg32(EBX); // 2 + mov_eax_memoffs32((unsigned int *)(dst->f.i.rt)); // 5 + mov_reg32_m32(ECX, (unsigned int *)(dst->f.i.rt)+1); // 6 + jmp_imm_short(18); // 2 + + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + mov_reg32_preg32pimm32(EAX, EBX, ((unsigned int)rdram)+4); // 6 + mov_reg32_preg32pimm32(ECX, EBX, ((unsigned int)rdram)); // 6 + + set_64_register_state(EAX, ECX, (unsigned int*)dst->f.i.rt, 1); +#endif +} + +void genswc1(void) +{ +#ifdef INTERPRET_SWC1 + gencallinterp((unsigned int)cached_interpreter_table.SWC1, 0); +#else + gencheck_cop1_unusable(); + + mov_reg32_m32(EDX, (unsigned int*)(®_cop1_simple[dst->f.lf.ft])); + mov_reg32_preg32(ECX, EDX); + mov_eax_memoffs32((unsigned int *)(®[dst->f.lf.base])); + add_eax_imm32((int)dst->f.lf.offset); + mov_reg32_reg32(EBX, EAX); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + shr_reg32_imm8(EAX, 16); + mov_reg32_preg32x4pimm32(EAX, EAX, (unsigned int)writemem); + cmp_reg32_imm32(EAX, (unsigned int)write_rdram); + } + je_rj(41); + + mov_m32_imm32((unsigned int *)(&PC), (unsigned int)(dst+1)); // 10 + mov_m32_reg32((unsigned int *)(&address), EBX); // 6 + mov_m32_reg32((unsigned int *)(&word), ECX); // 6 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg32_preg32x4pimm32(EBX, EBX, (unsigned int)writemem); // 7 + call_reg32(EBX); // 2 + mov_eax_memoffs32((unsigned int *)(&address)); // 5 + jmp_imm_short(14); // 2 + + mov_reg32_reg32(EAX, EBX); // 2 + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + mov_preg32pimm32_reg32(EBX, (unsigned int)rdram, ECX); // 6 + + mov_reg32_reg32(EBX, EAX); + shr_reg32_imm8(EBX, 12); + cmp_preg32pimm32_imm8(EBX, (unsigned int)invalid_code, 0); + jne_rj(54); + mov_reg32_reg32(ECX, EBX); // 2 + shl_reg32_imm8(EBX, 2); // 3 + mov_reg32_preg32pimm32(EBX, EBX, (unsigned int)blocks); // 6 + mov_reg32_preg32pimm32(EBX, EBX, (int)&actual->block - (int)actual); // 6 + and_eax_imm32(0xFFF); // 5 + shr_reg32_imm8(EAX, 2); // 3 + mov_reg32_imm32(EDX, sizeof(precomp_instr)); // 5 + mul_reg32(EDX); // 2 + mov_reg32_preg32preg32pimm32(EAX, EAX, EBX, (int)&dst->ops - (int)dst); // 7 + cmp_reg32_imm32(EAX, (unsigned int)cached_interpreter_table.NOTCOMPILED); // 6 + je_rj(7); // 2 + mov_preg32pimm32_imm8(ECX, (unsigned int)invalid_code, 1); // 7 +#endif +} + +void gensdc1(void) +{ +#ifdef INTERPRET_SDC1 + gencallinterp((unsigned int)cached_interpreter_table.SDC1, 0); +#else + gencheck_cop1_unusable(); + + mov_reg32_m32(ESI, (unsigned int*)(®_cop1_double[dst->f.lf.ft])); + mov_reg32_preg32(ECX, ESI); + mov_reg32_preg32pimm32(EDX, ESI, 4); + mov_eax_memoffs32((unsigned int *)(®[dst->f.lf.base])); + add_eax_imm32((int)dst->f.lf.offset); + mov_reg32_reg32(EBX, EAX); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + shr_reg32_imm8(EAX, 16); + mov_reg32_preg32x4pimm32(EAX, EAX, (unsigned int)writememd); + cmp_reg32_imm32(EAX, (unsigned int)write_rdramd); + } + je_rj(47); + + mov_m32_imm32((unsigned int *)(&PC), (unsigned int)(dst+1)); // 10 + mov_m32_reg32((unsigned int *)(&address), EBX); // 6 + mov_m32_reg32((unsigned int *)(&dword), ECX); // 6 + mov_m32_reg32((unsigned int *)(&dword)+1, EDX); // 6 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg32_preg32x4pimm32(EBX, EBX, (unsigned int)writememd); // 7 + call_reg32(EBX); // 2 + mov_eax_memoffs32((unsigned int *)(&address)); // 5 + jmp_imm_short(20); // 2 + + mov_reg32_reg32(EAX, EBX); // 2 + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + mov_preg32pimm32_reg32(EBX, ((unsigned int)rdram)+4, ECX); // 6 + mov_preg32pimm32_reg32(EBX, ((unsigned int)rdram)+0, EDX); // 6 + + mov_reg32_reg32(EBX, EAX); + shr_reg32_imm8(EBX, 12); + cmp_preg32pimm32_imm8(EBX, (unsigned int)invalid_code, 0); + jne_rj(54); + mov_reg32_reg32(ECX, EBX); // 2 + shl_reg32_imm8(EBX, 2); // 3 + mov_reg32_preg32pimm32(EBX, EBX, (unsigned int)blocks); // 6 + mov_reg32_preg32pimm32(EBX, EBX, (int)&actual->block - (int)actual); // 6 + and_eax_imm32(0xFFF); // 5 + shr_reg32_imm8(EAX, 2); // 3 + mov_reg32_imm32(EDX, sizeof(precomp_instr)); // 5 + mul_reg32(EDX); // 2 + mov_reg32_preg32preg32pimm32(EAX, EAX, EBX, (int)&dst->ops - (int)dst); // 7 + cmp_reg32_imm32(EAX, (unsigned int)cached_interpreter_table.NOTCOMPILED); // 6 + je_rj(7); // 2 + mov_preg32pimm32_imm8(ECX, (unsigned int)invalid_code, 1); // 7 +#endif +} + +void gensd(void) +{ +#ifdef INTERPRET_SD + gencallinterp((unsigned int)cached_interpreter_table.SD, 0); +#else + free_all_registers(); + simplify_access(); + + mov_reg32_m32(ECX, (unsigned int *)dst->f.i.rt); + mov_reg32_m32(EDX, ((unsigned int *)dst->f.i.rt)+1); + mov_eax_memoffs32((unsigned int *)dst->f.i.rs); + add_eax_imm32((int)dst->f.i.immediate); + mov_reg32_reg32(EBX, EAX); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + shr_reg32_imm8(EAX, 16); + mov_reg32_preg32x4pimm32(EAX, EAX, (unsigned int)writememd); + cmp_reg32_imm32(EAX, (unsigned int)write_rdramd); + } + je_rj(47); + + mov_m32_imm32((unsigned int *)(&PC), (unsigned int)(dst+1)); // 10 + mov_m32_reg32((unsigned int *)(&address), EBX); // 6 + mov_m32_reg32((unsigned int *)(&dword), ECX); // 6 + mov_m32_reg32((unsigned int *)(&dword)+1, EDX); // 6 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg32_preg32x4pimm32(EBX, EBX, (unsigned int)writememd); // 7 + call_reg32(EBX); // 2 + mov_eax_memoffs32((unsigned int *)(&address)); // 5 + jmp_imm_short(20); // 2 + + mov_reg32_reg32(EAX, EBX); // 2 + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + mov_preg32pimm32_reg32(EBX, ((unsigned int)rdram)+4, ECX); // 6 + mov_preg32pimm32_reg32(EBX, ((unsigned int)rdram)+0, EDX); // 6 + + mov_reg32_reg32(EBX, EAX); + shr_reg32_imm8(EBX, 12); + cmp_preg32pimm32_imm8(EBX, (unsigned int)invalid_code, 0); + jne_rj(54); + mov_reg32_reg32(ECX, EBX); // 2 + shl_reg32_imm8(EBX, 2); // 3 + mov_reg32_preg32pimm32(EBX, EBX, (unsigned int)blocks); // 6 + mov_reg32_preg32pimm32(EBX, EBX, (int)&actual->block - (int)actual); // 6 + and_eax_imm32(0xFFF); // 5 + shr_reg32_imm8(EAX, 2); // 3 + mov_reg32_imm32(EDX, sizeof(precomp_instr)); // 5 + mul_reg32(EDX); // 2 + mov_reg32_preg32preg32pimm32(EAX, EAX, EBX, (int)&dst->ops - (int)dst); // 7 + cmp_reg32_imm32(EAX, (unsigned int)cached_interpreter_table.NOTCOMPILED); // 6 + je_rj(7); // 2 + mov_preg32pimm32_imm8(ECX, (unsigned int)invalid_code, 1); // 7 +#endif +} + +void genll(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.LL, 0); +} + +void gensc(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.SC, 0); +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86/gregimm.c b/libmupen64plus/mupen64plus-core/src/r4300/x86/gregimm.c new file mode 100644 index 0000000000..298ec1235c --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86/gregimm.c @@ -0,0 +1,577 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - gregimm.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "assemble.h" +#include "interpret.h" + +#include "r4300/recomph.h" +#include "r4300/recomp.h" +#include "r4300/r4300.h" +#include "r4300/ops.h" +#include "r4300/macros.h" + +#include "memory/memory.h" + +static void genbltz_test(void) +{ + int rs_64bit = is64((unsigned int *)dst->f.i.rs); + + if (!rs_64bit) + { + int rs = allocate_register((unsigned int *)dst->f.i.rs); + + cmp_reg32_imm32(rs, 0); + jge_rj(12); + mov_m32_imm32((unsigned int *)(&branch_taken), 1); // 10 + jmp_imm_short(10); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 0); // 10 + } + else if (rs_64bit == -1) + { + cmp_m32_imm32(((unsigned int *)dst->f.i.rs)+1, 0); + jge_rj(12); + mov_m32_imm32((unsigned int *)(&branch_taken), 1); // 10 + jmp_imm_short(10); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 0); // 10 + } + else + { + int rs2 = allocate_64_register2((unsigned int *)dst->f.i.rs); + + cmp_reg32_imm32(rs2, 0); + jge_rj(12); + mov_m32_imm32((unsigned int *)(&branch_taken), 1); // 10 + jmp_imm_short(10); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 0); // 10 + } +} + +void genbltz(void) +{ +#ifdef INTERPRET_BLTZ + gencallinterp((unsigned int)cached_interpreter_table.BLTZ, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BLTZ, 1); + return; + } + + genbltz_test(); + gendelayslot(); + gentest(); +#endif +} + +void genbltz_out(void) +{ +#ifdef INTERPRET_BLTZ_OUT + gencallinterp((unsigned int)cached_interpreter_table.BLTZ_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BLTZ_OUT, 1); + return; + } + + genbltz_test(); + gendelayslot(); + gentest_out(); +#endif +} + +void genbltz_idle(void) +{ +#ifdef INTERPRET_BLTZ_IDLE + gencallinterp((unsigned int)cached_interpreter_table.BLTZ_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BLTZ_IDLE, 1); + return; + } + + genbltz_test(); + gentest_idle(); + genbltz(); +#endif +} + +static void genbgez_test(void) +{ + int rs_64bit = is64((unsigned int *)dst->f.i.rs); + + if (!rs_64bit) + { + int rs = allocate_register((unsigned int *)dst->f.i.rs); + + cmp_reg32_imm32(rs, 0); + jl_rj(12); + mov_m32_imm32((unsigned int *)(&branch_taken), 1); // 10 + jmp_imm_short(10); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 0); // 10 + } + else if (rs_64bit == -1) + { + cmp_m32_imm32(((unsigned int *)dst->f.i.rs)+1, 0); + jl_rj(12); + mov_m32_imm32((unsigned int *)(&branch_taken), 1); // 10 + jmp_imm_short(10); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 0); // 10 + } + else + { + int rs2 = allocate_64_register2((unsigned int *)dst->f.i.rs); + + cmp_reg32_imm32(rs2, 0); + jl_rj(12); + mov_m32_imm32((unsigned int *)(&branch_taken), 1); // 10 + jmp_imm_short(10); // 2 + mov_m32_imm32((unsigned int *)(&branch_taken), 0); // 10 + } +} + +void genbgez(void) +{ +#ifdef INTERPRET_BGEZ + gencallinterp((unsigned int)cached_interpreter_table.BGEZ, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BGEZ, 1); + return; + } + + genbgez_test(); + gendelayslot(); + gentest(); +#endif +} + +void genbgez_out(void) +{ +#ifdef INTERPRET_BGEZ_OUT + gencallinterp((unsigned int)cached_interpreter_table.BGEZ_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BGEZ_OUT, 1); + return; + } + + genbgez_test(); + gendelayslot(); + gentest_out(); +#endif +} + +void genbgez_idle(void) +{ +#ifdef INTERPRET_BGEZ_IDLE + gencallinterp((unsigned int)cached_interpreter_table.BGEZ_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BGEZ_IDLE, 1); + return; + } + + genbgez_test(); + gentest_idle(); + genbgez(); +#endif +} + +void genbltzl(void) +{ +#ifdef INTERPRET_BLTZL + gencallinterp((unsigned int)cached_interpreter_table.BLTZL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BLTZL, 1); + return; + } + + genbltz_test(); + free_all_registers(); + gentestl(); +#endif +} + +void genbltzl_out(void) +{ +#ifdef INTERPRET_BLTZL_OUT + gencallinterp((unsigned int)cached_interpreter_table.BLTZL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BLTZL_OUT, 1); + return; + } + + genbltz_test(); + free_all_registers(); + gentestl_out(); +#endif +} + +void genbltzl_idle(void) +{ +#ifdef INTERPRET_BLTZL_IDLE + gencallinterp((unsigned int)cached_interpreter_table.BLTZL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BLTZL_IDLE, 1); + return; + } + + genbltz_test(); + gentest_idle(); + genbltzl(); +#endif +} + +void genbgezl(void) +{ +#ifdef INTERPRET_BGEZL + gencallinterp((unsigned int)cached_interpreter_table.BGEZL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BGEZL, 1); + return; + } + + genbgez_test(); + free_all_registers(); + gentestl(); +#endif +} + +void genbgezl_out(void) +{ +#ifdef INTERPRET_BGEZL_OUT + gencallinterp((unsigned int)cached_interpreter_table.BGEZL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BGEZL_OUT, 1); + return; + } + + genbgez_test(); + free_all_registers(); + gentestl_out(); +#endif +} + +void genbgezl_idle(void) +{ +#ifdef INTERPRET_BGEZL_IDLE + gencallinterp((unsigned int)cached_interpreter_table.BGEZL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BGEZL_IDLE, 1); + return; + } + + genbgez_test(); + gentest_idle(); + genbgezl(); +#endif +} + +static void genbranchlink(void) +{ + int r31_64bit = is64((unsigned int*)®[31]); + + if (!r31_64bit) + { + int r31 = allocate_register_w((unsigned int *)®[31]); + + mov_reg32_imm32(r31, dst->addr+8); + } + else if (r31_64bit == -1) + { + mov_m32_imm32((unsigned int *)®[31], dst->addr + 8); + if (dst->addr & 0x80000000) + mov_m32_imm32(((unsigned int *)®[31])+1, 0xFFFFFFFF); + else + mov_m32_imm32(((unsigned int *)®[31])+1, 0); + } + else + { + int r311 = allocate_64_register1_w((unsigned int *)®[31]); + int r312 = allocate_64_register2_w((unsigned int *)®[31]); + + mov_reg32_imm32(r311, dst->addr+8); + if (dst->addr & 0x80000000) + mov_reg32_imm32(r312, 0xFFFFFFFF); + else + mov_reg32_imm32(r312, 0); + } +} + +void genbltzal(void) +{ +#ifdef INTERPRET_BLTZAL + gencallinterp((unsigned int)cached_interpreter_table.BLTZAL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BLTZAL, 1); + return; + } + + genbltz_test(); + genbranchlink(); + gendelayslot(); + gentest(); +#endif +} + +void genbltzal_out(void) +{ +#ifdef INTERPRET_BLTZAL_OUT + gencallinterp((unsigned int)cached_interpreter_table.BLTZAL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BLTZAL_OUT, 1); + return; + } + + genbltz_test(); + genbranchlink(); + gendelayslot(); + gentest_out(); +#endif +} + +void genbltzal_idle(void) +{ +#ifdef INTERPRET_BLTZAL_IDLE + gencallinterp((unsigned int)cached_interpreter_table.BLTZAL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BLTZAL_IDLE, 1); + return; + } + + genbltz_test(); + genbranchlink(); + gentest_idle(); + genbltzal(); +#endif +} + +void genbgezal(void) +{ +#ifdef INTERPRET_BGEZAL + gencallinterp((unsigned int)cached_interpreter_table.BGEZAL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BGEZAL, 1); + return; + } + + genbgez_test(); + genbranchlink(); + gendelayslot(); + gentest(); +#endif +} + +void genbgezal_out(void) +{ +#ifdef INTERPRET_BGEZAL_OUT + gencallinterp((unsigned int)cached_interpreter_table.BGEZAL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BGEZAL_OUT, 1); + return; + } + + genbgez_test(); + genbranchlink(); + gendelayslot(); + gentest_out(); +#endif +} + +void genbgezal_idle(void) +{ +#ifdef INTERPRET_BGEZAL_IDLE + gencallinterp((unsigned int)cached_interpreter_table.BGEZAL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BGEZAL_IDLE, 1); + return; + } + + genbgez_test(); + genbranchlink(); + gentest_idle(); + genbgezal(); +#endif +} + +void genbltzall(void) +{ +#ifdef INTERPRET_BLTZALL + gencallinterp((unsigned int)cached_interpreter_table.BLTZALL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BLTZALL, 1); + return; + } + + genbltz_test(); + genbranchlink(); + free_all_registers(); + gentestl(); +#endif +} + +void genbltzall_out(void) +{ +#ifdef INTERPRET_BLTZALL_OUT + gencallinterp((unsigned int)cached_interpreter_table.BLTZALL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BLTZALL_OUT, 1); + return; + } + + genbltz_test(); + genbranchlink(); + free_all_registers(); + gentestl_out(); +#endif +} + +void genbltzall_idle(void) +{ +#ifdef INTERPRET_BLTZALL_IDLE + gencallinterp((unsigned int)cached_interpreter_table.BLTZALL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BLTZALL_IDLE, 1); + return; + } + + genbltz_test(); + genbranchlink(); + gentest_idle(); + genbltzall(); +#endif +} + +void genbgezall(void) +{ +#ifdef INTERPRET_BGEZALL + gencallinterp((unsigned int)cached_interpreter_table.BGEZALL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BGEZALL, 1); + return; + } + + genbgez_test(); + genbranchlink(); + free_all_registers(); + gentestl(); +#endif +} + +void genbgezall_out(void) +{ +#ifdef INTERPRET_BGEZALL_OUT + gencallinterp((unsigned int)cached_interpreter_table.BGEZALL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BGEZALL_OUT, 1); + return; + } + + genbgez_test(); + genbranchlink(); + free_all_registers(); + gentestl_out(); +#endif +} + +void genbgezall_idle(void) +{ +#ifdef INTERPRET_BGEZALL_IDLE + gencallinterp((unsigned int)cached_interpreter_table.BGEZALL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.BGEZALL_IDLE, 1); + return; + } + + genbgez_test(); + genbranchlink(); + gentest_idle(); + genbgezall(); +#endif +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86/gspecial.c b/libmupen64plus/mupen64plus-core/src/r4300/x86/gspecial.c new file mode 100644 index 0000000000..053c7af876 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86/gspecial.c @@ -0,0 +1,1157 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - gspecial.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "assemble.h" +#include "interpret.h" + +#include "r4300/recomph.h" +#include "r4300/recomp.h" +#include "r4300/r4300.h" +#include "r4300/ops.h" +#include "r4300/macros.h" +#include "r4300/exception.h" + +void gensll(void) +{ +#ifdef INTERPRET_SLL + gencallinterp((unsigned int)cached_interpreter_table.SLL, 0); +#else + int rt = allocate_register((unsigned int *)dst->f.r.rt); + int rd = allocate_register_w((unsigned int *)dst->f.r.rd); + + mov_reg32_reg32(rd, rt); + shl_reg32_imm8(rd, dst->f.r.sa); +#endif +} + +void gensrl(void) +{ +#ifdef INTERPRET_SRL + gencallinterp((unsigned int)cached_interpreter_table.SRL, 0); +#else + int rt = allocate_register((unsigned int *)dst->f.r.rt); + int rd = allocate_register_w((unsigned int *)dst->f.r.rd); + + mov_reg32_reg32(rd, rt); + shr_reg32_imm8(rd, dst->f.r.sa); +#endif +} + +void gensra(void) +{ +#ifdef INTERPRET_SRA + gencallinterp((unsigned int)cached_interpreter_table.SRA, 0); +#else + int rt = allocate_register((unsigned int *)dst->f.r.rt); + int rd = allocate_register_w((unsigned int *)dst->f.r.rd); + + mov_reg32_reg32(rd, rt); + sar_reg32_imm8(rd, dst->f.r.sa); +#endif +} + +void gensllv(void) +{ +#ifdef INTERPRET_SLLV + gencallinterp((unsigned int)cached_interpreter_table.SLLV, 0); +#else + int rt, rd; + allocate_register_manually(ECX, (unsigned int *)dst->f.r.rs); + + rt = allocate_register((unsigned int *)dst->f.r.rt); + rd = allocate_register_w((unsigned int *)dst->f.r.rd); + + if (rd != ECX) + { + mov_reg32_reg32(rd, rt); + shl_reg32_cl(rd); + } + else + { + int temp = lru_register(); + free_register(temp); + mov_reg32_reg32(temp, rt); + shl_reg32_cl(temp); + mov_reg32_reg32(rd, temp); + } +#endif +} + +void gensrlv(void) +{ +#ifdef INTERPRET_SRLV + gencallinterp((unsigned int)cached_interpreter_table.SRLV, 0); +#else + int rt, rd; + allocate_register_manually(ECX, (unsigned int *)dst->f.r.rs); + + rt = allocate_register((unsigned int *)dst->f.r.rt); + rd = allocate_register_w((unsigned int *)dst->f.r.rd); + + if (rd != ECX) + { + mov_reg32_reg32(rd, rt); + shr_reg32_cl(rd); + } + else + { + int temp = lru_register(); + free_register(temp); + mov_reg32_reg32(temp, rt); + shr_reg32_cl(temp); + mov_reg32_reg32(rd, temp); + } +#endif +} + +void gensrav(void) +{ +#ifdef INTERPRET_SRAV + gencallinterp((unsigned int)cached_interpreter_table.SRAV, 0); +#else + int rt, rd; + allocate_register_manually(ECX, (unsigned int *)dst->f.r.rs); + + rt = allocate_register((unsigned int *)dst->f.r.rt); + rd = allocate_register_w((unsigned int *)dst->f.r.rd); + + if (rd != ECX) + { + mov_reg32_reg32(rd, rt); + sar_reg32_cl(rd); + } + else + { + int temp = lru_register(); + free_register(temp); + mov_reg32_reg32(temp, rt); + sar_reg32_cl(temp); + mov_reg32_reg32(rd, temp); + } +#endif +} + +void genjr(void) +{ +#ifdef INTERPRET_JR + gencallinterp((unsigned int)cached_interpreter_table.JR, 1); +#else + static unsigned int precomp_instr_size = sizeof(precomp_instr); + unsigned int diff = + (unsigned int)(&dst->local_addr) - (unsigned int)(dst); + unsigned int diff_need = + (unsigned int)(&dst->reg_cache_infos.need_map) - (unsigned int)(dst); + unsigned int diff_wrap = + (unsigned int)(&dst->reg_cache_infos.jump_wrapper) - (unsigned int)(dst); + + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.JR, 1); + return; + } + + free_all_registers(); + simplify_access(); + mov_eax_memoffs32((unsigned int *)dst->f.i.rs); + mov_memoffs32_eax((unsigned int *)&local_rs); + + gendelayslot(); + + mov_eax_memoffs32((unsigned int *)&local_rs); + mov_memoffs32_eax((unsigned int *)&last_addr); + + gencheck_interupt_reg(); + + mov_eax_memoffs32((unsigned int *)&local_rs); + mov_reg32_reg32(EBX, EAX); + and_eax_imm32(0xFFFFF000); + cmp_eax_imm32(dst_block->start & 0xFFFFF000); + je_near_rj(0); + + jump_start_rel32(); + + mov_m32_reg32(&jump_to_address, EBX); + mov_m32_imm32((unsigned int*)(&PC), (unsigned int)(dst+1)); + mov_reg32_imm32(EAX, (unsigned int)jump_to_func); + call_reg32(EAX); + + jump_end_rel32(); + + mov_reg32_reg32(EAX, EBX); + sub_eax_imm32(dst_block->start); + shr_reg32_imm8(EAX, 2); + mul_m32((unsigned int *)(&precomp_instr_size)); + + mov_reg32_preg32pimm32(EBX, EAX, (unsigned int)(dst_block->block)+diff_need); + cmp_reg32_imm32(EBX, 1); + jne_rj(7); + + add_eax_imm32((unsigned int)(dst_block->block)+diff_wrap); // 5 + jmp_reg32(EAX); // 2 + + mov_reg32_preg32pimm32(EAX, EAX, (unsigned int)(dst_block->block)+diff); + add_reg32_m32(EAX, (unsigned int *)(&dst_block->code)); + + jmp_reg32(EAX); +#endif +} + +void genjalr(void) +{ +#ifdef INTERPRET_JALR + gencallinterp((unsigned int)cached_interpreter_table.JALR, 0); +#else + static unsigned int precomp_instr_size = sizeof(precomp_instr); + unsigned int diff = + (unsigned int)(&dst->local_addr) - (unsigned int)(dst); + unsigned int diff_need = + (unsigned int)(&dst->reg_cache_infos.need_map) - (unsigned int)(dst); + unsigned int diff_wrap = + (unsigned int)(&dst->reg_cache_infos.jump_wrapper) - (unsigned int)(dst); + + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned int)cached_interpreter_table.JALR, 1); + return; + } + + free_all_registers(); + simplify_access(); + mov_eax_memoffs32((unsigned int *)dst->f.r.rs); + mov_memoffs32_eax((unsigned int *)&local_rs); + + gendelayslot(); + + mov_m32_imm32((unsigned int *)(dst-1)->f.r.rd, dst->addr+4); + if ((dst->addr+4) & 0x80000000) + mov_m32_imm32(((unsigned int *)(dst-1)->f.r.rd)+1, 0xFFFFFFFF); + else + mov_m32_imm32(((unsigned int *)(dst-1)->f.r.rd)+1, 0); + + mov_eax_memoffs32((unsigned int *)&local_rs); + mov_memoffs32_eax((unsigned int *)&last_addr); + + gencheck_interupt_reg(); + + mov_eax_memoffs32((unsigned int *)&local_rs); + mov_reg32_reg32(EBX, EAX); + and_eax_imm32(0xFFFFF000); + cmp_eax_imm32(dst_block->start & 0xFFFFF000); + je_near_rj(0); + + jump_start_rel32(); + + mov_m32_reg32(&jump_to_address, EBX); + mov_m32_imm32((unsigned int*)(&PC), (unsigned int)(dst+1)); + mov_reg32_imm32(EAX, (unsigned int)jump_to_func); + call_reg32(EAX); + + jump_end_rel32(); + + mov_reg32_reg32(EAX, EBX); + sub_eax_imm32(dst_block->start); + shr_reg32_imm8(EAX, 2); + mul_m32((unsigned int *)(&precomp_instr_size)); + + mov_reg32_preg32pimm32(EBX, EAX, (unsigned int)(dst_block->block)+diff_need); + cmp_reg32_imm32(EBX, 1); + jne_rj(7); + + add_eax_imm32((unsigned int)(dst_block->block)+diff_wrap); // 5 + jmp_reg32(EAX); // 2 + + mov_reg32_preg32pimm32(EAX, EAX, (unsigned int)(dst_block->block)+diff); + add_reg32_m32(EAX, (unsigned int *)(&dst_block->code)); + + jmp_reg32(EAX); +#endif +} + +void gensyscall(void) +{ +#ifdef INTERPRET_SYSCALL + gencallinterp((unsigned int)cached_interpreter_table.SYSCALL, 0); +#else + free_all_registers(); + simplify_access(); + mov_m32_imm32(&Cause, 8 << 2); + gencallinterp((unsigned int)exception_general, 0); +#endif +} + +void gensync(void) +{ +} + +void genmfhi(void) +{ +#ifdef INTERPRET_MFHI + gencallinterp((unsigned int)cached_interpreter_table.MFHI, 0); +#else + int rd1 = allocate_64_register1_w((unsigned int*)dst->f.r.rd); + int rd2 = allocate_64_register2_w((unsigned int*)dst->f.r.rd); + int hi1 = allocate_64_register1((unsigned int*)&hi); + int hi2 = allocate_64_register2((unsigned int*)&hi); + + mov_reg32_reg32(rd1, hi1); + mov_reg32_reg32(rd2, hi2); +#endif +} + +void genmthi(void) +{ +#ifdef INTERPRET_MTHI + gencallinterp((unsigned int)cached_interpreter_table.MTHI, 0); +#else + int hi1 = allocate_64_register1_w((unsigned int*)&hi); + int hi2 = allocate_64_register2_w((unsigned int*)&hi); + int rs1 = allocate_64_register1((unsigned int*)dst->f.r.rs); + int rs2 = allocate_64_register2((unsigned int*)dst->f.r.rs); + + mov_reg32_reg32(hi1, rs1); + mov_reg32_reg32(hi2, rs2); +#endif +} + +void genmflo(void) +{ +#ifdef INTERPRET_MFLO + gencallinterp((unsigned int)cached_interpreter_table.MFLO, 0); +#else + int rd1 = allocate_64_register1_w((unsigned int*)dst->f.r.rd); + int rd2 = allocate_64_register2_w((unsigned int*)dst->f.r.rd); + int lo1 = allocate_64_register1((unsigned int*)&lo); + int lo2 = allocate_64_register2((unsigned int*)&lo); + + mov_reg32_reg32(rd1, lo1); + mov_reg32_reg32(rd2, lo2); +#endif +} + +void genmtlo(void) +{ +#ifdef INTERPRET_MTLO + gencallinterp((unsigned int)cached_interpreter_table.MTLO, 0); +#else + int lo1 = allocate_64_register1_w((unsigned int*)&lo); + int lo2 = allocate_64_register2_w((unsigned int*)&lo); + int rs1 = allocate_64_register1((unsigned int*)dst->f.r.rs); + int rs2 = allocate_64_register2((unsigned int*)dst->f.r.rs); + + mov_reg32_reg32(lo1, rs1); + mov_reg32_reg32(lo2, rs2); +#endif +} + +void gendsllv(void) +{ +#ifdef INTERPRET_DSLLV + gencallinterp((unsigned int)cached_interpreter_table.DSLLV, 0); +#else + int rt1, rt2, rd1, rd2; + allocate_register_manually(ECX, (unsigned int *)dst->f.r.rs); + + rt1 = allocate_64_register1((unsigned int *)dst->f.r.rt); + rt2 = allocate_64_register2((unsigned int *)dst->f.r.rt); + rd1 = allocate_64_register1_w((unsigned int *)dst->f.r.rd); + rd2 = allocate_64_register2_w((unsigned int *)dst->f.r.rd); + + if (rd1 != ECX && rd2 != ECX) + { + mov_reg32_reg32(rd1, rt1); + mov_reg32_reg32(rd2, rt2); + shld_reg32_reg32_cl(rd2,rd1); + shl_reg32_cl(rd1); + test_reg32_imm32(ECX, 0x20); + je_rj(4); + mov_reg32_reg32(rd2, rd1); // 2 + xor_reg32_reg32(rd1, rd1); // 2 + } + else + { + int temp1, temp2; + force_32(ECX); + temp1 = lru_register(); + temp2 = lru_register_exc1(temp1); + free_register(temp1); + free_register(temp2); + + mov_reg32_reg32(temp1, rt1); + mov_reg32_reg32(temp2, rt2); + shld_reg32_reg32_cl(temp2, temp1); + shl_reg32_cl(temp1); + test_reg32_imm32(ECX, 0x20); + je_rj(4); + mov_reg32_reg32(temp2, temp1); // 2 + xor_reg32_reg32(temp1, temp1); // 2 + + mov_reg32_reg32(rd1, temp1); + mov_reg32_reg32(rd2, temp2); + } +#endif +} + +void gendsrlv(void) +{ +#ifdef INTERPRET_DSRLV + gencallinterp((unsigned int)cached_interpreter_table.DSRLV, 0); +#else + int rt1, rt2, rd1, rd2; + allocate_register_manually(ECX, (unsigned int *)dst->f.r.rs); + + rt1 = allocate_64_register1((unsigned int *)dst->f.r.rt); + rt2 = allocate_64_register2((unsigned int *)dst->f.r.rt); + rd1 = allocate_64_register1_w((unsigned int *)dst->f.r.rd); + rd2 = allocate_64_register2_w((unsigned int *)dst->f.r.rd); + + if (rd1 != ECX && rd2 != ECX) + { + mov_reg32_reg32(rd1, rt1); + mov_reg32_reg32(rd2, rt2); + shrd_reg32_reg32_cl(rd1,rd2); + shr_reg32_cl(rd2); + test_reg32_imm32(ECX, 0x20); + je_rj(4); + mov_reg32_reg32(rd1, rd2); // 2 + xor_reg32_reg32(rd2, rd2); // 2 + } + else + { + int temp1, temp2; + force_32(ECX); + temp1 = lru_register(); + temp2 = lru_register_exc1(temp1); + free_register(temp1); + free_register(temp2); + + mov_reg32_reg32(temp1, rt1); + mov_reg32_reg32(temp2, rt2); + shrd_reg32_reg32_cl(temp1, temp2); + shr_reg32_cl(temp2); + test_reg32_imm32(ECX, 0x20); + je_rj(4); + mov_reg32_reg32(temp1, temp2); // 2 + xor_reg32_reg32(temp2, temp2); // 2 + + mov_reg32_reg32(rd1, temp1); + mov_reg32_reg32(rd2, temp2); + } +#endif +} + +void gendsrav(void) +{ +#ifdef INTERPRET_DSRAV + gencallinterp((unsigned int)cached_interpreter_table.DSRAV, 0); +#else + int rt1, rt2, rd1, rd2; + allocate_register_manually(ECX, (unsigned int *)dst->f.r.rs); + + rt1 = allocate_64_register1((unsigned int *)dst->f.r.rt); + rt2 = allocate_64_register2((unsigned int *)dst->f.r.rt); + rd1 = allocate_64_register1_w((unsigned int *)dst->f.r.rd); + rd2 = allocate_64_register2_w((unsigned int *)dst->f.r.rd); + + if (rd1 != ECX && rd2 != ECX) + { + mov_reg32_reg32(rd1, rt1); + mov_reg32_reg32(rd2, rt2); + shrd_reg32_reg32_cl(rd1,rd2); + sar_reg32_cl(rd2); + test_reg32_imm32(ECX, 0x20); + je_rj(5); + mov_reg32_reg32(rd1, rd2); // 2 + sar_reg32_imm8(rd2, 31); // 3 + } + else + { + int temp1, temp2; + force_32(ECX); + temp1 = lru_register(); + temp2 = lru_register_exc1(temp1); + free_register(temp1); + free_register(temp2); + + mov_reg32_reg32(temp1, rt1); + mov_reg32_reg32(temp2, rt2); + shrd_reg32_reg32_cl(temp1, temp2); + sar_reg32_cl(temp2); + test_reg32_imm32(ECX, 0x20); + je_rj(5); + mov_reg32_reg32(temp1, temp2); // 2 + sar_reg32_imm8(temp2, 31); // 3 + + mov_reg32_reg32(rd1, temp1); + mov_reg32_reg32(rd2, temp2); + } +#endif +} + +void genmult(void) +{ +#ifdef INTERPRET_MULT + gencallinterp((unsigned int)cached_interpreter_table.MULT, 0); +#else + int rs, rt; + allocate_register_manually_w(EAX, (unsigned int *)&lo, 0); + allocate_register_manually_w(EDX, (unsigned int *)&hi, 0); + rs = allocate_register((unsigned int*)dst->f.r.rs); + rt = allocate_register((unsigned int*)dst->f.r.rt); + mov_reg32_reg32(EAX, rs); + imul_reg32(rt); +#endif +} + +void genmultu(void) +{ +#ifdef INTERPRET_MULTU + gencallinterp((unsigned int)cached_interpreter_table.MULTU, 0); +#else + int rs, rt; + allocate_register_manually_w(EAX, (unsigned int *)&lo, 0); + allocate_register_manually_w(EDX, (unsigned int *)&hi, 0); + rs = allocate_register((unsigned int*)dst->f.r.rs); + rt = allocate_register((unsigned int*)dst->f.r.rt); + mov_reg32_reg32(EAX, rs); + mul_reg32(rt); +#endif +} + +void gendiv(void) +{ +#ifdef INTERPRET_DIV + gencallinterp((unsigned int)cached_interpreter_table.DIV, 0); +#else + int rs, rt; + allocate_register_manually_w(EAX, (unsigned int *)&lo, 0); + allocate_register_manually_w(EDX, (unsigned int *)&hi, 0); + rs = allocate_register((unsigned int*)dst->f.r.rs); + rt = allocate_register((unsigned int*)dst->f.r.rt); + cmp_reg32_imm32(rt, 0); + je_rj((rs == EAX ? 0 : 2) + 1 + 2); + mov_reg32_reg32(EAX, rs); // 0 or 2 + cdq(); // 1 + idiv_reg32(rt); // 2 +#endif +} + +void gendivu(void) +{ +#ifdef INTERPRET_DIVU + gencallinterp((unsigned int)cached_interpreter_table.DIVU, 0); +#else + int rs, rt; + allocate_register_manually_w(EAX, (unsigned int *)&lo, 0); + allocate_register_manually_w(EDX, (unsigned int *)&hi, 0); + rs = allocate_register((unsigned int*)dst->f.r.rs); + rt = allocate_register((unsigned int*)dst->f.r.rt); + cmp_reg32_imm32(rt, 0); + je_rj((rs == EAX ? 0 : 2) + 2 + 2); + mov_reg32_reg32(EAX, rs); // 0 or 2 + xor_reg32_reg32(EDX, EDX); // 2 + div_reg32(rt); // 2 +#endif +} + +void gendmult(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.DMULT, 0); +} + +void gendmultu(void) +{ +#ifdef INTERPRET_DMULTU + gencallinterp((unsigned int)cached_interpreter_table.DMULTU, 0); +#else + free_all_registers(); + simplify_access(); + + mov_eax_memoffs32((unsigned int *)dst->f.r.rs); + mul_m32((unsigned int *)dst->f.r.rt); // EDX:EAX = temp1 + mov_memoffs32_eax((unsigned int *)(&lo)); + + mov_reg32_reg32(EBX, EDX); // EBX = temp1>>32 + mov_eax_memoffs32((unsigned int *)dst->f.r.rs); + mul_m32((unsigned int *)(dst->f.r.rt)+1); + add_reg32_reg32(EBX, EAX); + adc_reg32_imm32(EDX, 0); + mov_reg32_reg32(ECX, EDX); // ECX:EBX = temp2 + + mov_eax_memoffs32((unsigned int *)(dst->f.r.rs)+1); + mul_m32((unsigned int *)dst->f.r.rt); // EDX:EAX = temp3 + + add_reg32_reg32(EBX, EAX); + adc_reg32_imm32(ECX, 0); // ECX:EBX = result2 + mov_m32_reg32((unsigned int*)(&lo)+1, EBX); + + mov_reg32_reg32(ESI, EDX); // ESI = temp3>>32 + mov_eax_memoffs32((unsigned int *)(dst->f.r.rs)+1); + mul_m32((unsigned int *)(dst->f.r.rt)+1); + add_reg32_reg32(EAX, ESI); + adc_reg32_imm32(EDX, 0); // EDX:EAX = temp4 + + add_reg32_reg32(EAX, ECX); + adc_reg32_imm32(EDX, 0); // EDX:EAX = result3 + mov_memoffs32_eax((unsigned int *)(&hi)); + mov_m32_reg32((unsigned int *)(&hi)+1, EDX); +#endif +} + +void genddiv(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.DDIV, 0); +} + +void genddivu(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.DDIVU, 0); +} + +void genadd(void) +{ +#ifdef INTERPRET_ADD + gencallinterp((unsigned int)cached_interpreter_table.ADD, 0); +#else + int rs = allocate_register((unsigned int *)dst->f.r.rs); + int rt = allocate_register((unsigned int *)dst->f.r.rt); + int rd = allocate_register_w((unsigned int *)dst->f.r.rd); + + if (rt != rd && rs != rd) + { + mov_reg32_reg32(rd, rs); + add_reg32_reg32(rd, rt); + } + else + { + int temp = lru_register(); + free_register(temp); + mov_reg32_reg32(temp, rs); + add_reg32_reg32(temp, rt); + mov_reg32_reg32(rd, temp); + } +#endif +} + +void genaddu(void) +{ +#ifdef INTERPRET_ADDU + gencallinterp((unsigned int)cached_interpreter_table.ADDU, 0); +#else + int rs = allocate_register((unsigned int *)dst->f.r.rs); + int rt = allocate_register((unsigned int *)dst->f.r.rt); + int rd = allocate_register_w((unsigned int *)dst->f.r.rd); + + if (rt != rd && rs != rd) + { + mov_reg32_reg32(rd, rs); + add_reg32_reg32(rd, rt); + } + else + { + int temp = lru_register(); + free_register(temp); + mov_reg32_reg32(temp, rs); + add_reg32_reg32(temp, rt); + mov_reg32_reg32(rd, temp); + } +#endif +} + +void gensub(void) +{ +#ifdef INTERPRET_SUB + gencallinterp((unsigned int)cached_interpreter_table.SUB, 0); +#else + int rs = allocate_register((unsigned int *)dst->f.r.rs); + int rt = allocate_register((unsigned int *)dst->f.r.rt); + int rd = allocate_register_w((unsigned int *)dst->f.r.rd); + + if (rt != rd && rs != rd) + { + mov_reg32_reg32(rd, rs); + sub_reg32_reg32(rd, rt); + } + else + { + int temp = lru_register(); + free_register(temp); + mov_reg32_reg32(temp, rs); + sub_reg32_reg32(temp, rt); + mov_reg32_reg32(rd, temp); + } +#endif +} + +void gensubu(void) +{ +#ifdef INTERPRET_SUBU + gencallinterp((unsigned int)cached_interpreter_table.SUBU, 0); +#else + int rs = allocate_register((unsigned int *)dst->f.r.rs); + int rt = allocate_register((unsigned int *)dst->f.r.rt); + int rd = allocate_register_w((unsigned int *)dst->f.r.rd); + + if (rt != rd && rs != rd) + { + mov_reg32_reg32(rd, rs); + sub_reg32_reg32(rd, rt); + } + else + { + int temp = lru_register(); + free_register(temp); + mov_reg32_reg32(temp, rs); + sub_reg32_reg32(temp, rt); + mov_reg32_reg32(rd, temp); + } +#endif +} + +void genand(void) +{ +#ifdef INTERPRET_AND + gencallinterp((unsigned int)cached_interpreter_table.AND, 0); +#else + int rs1 = allocate_64_register1((unsigned int *)dst->f.r.rs); + int rs2 = allocate_64_register2((unsigned int *)dst->f.r.rs); + int rt1 = allocate_64_register1((unsigned int *)dst->f.r.rt); + int rt2 = allocate_64_register2((unsigned int *)dst->f.r.rt); + int rd1 = allocate_64_register1_w((unsigned int *)dst->f.r.rd); + int rd2 = allocate_64_register2_w((unsigned int *)dst->f.r.rd); + + if (rt1 != rd1 && rs1 != rd1) + { + mov_reg32_reg32(rd1, rs1); + mov_reg32_reg32(rd2, rs2); + and_reg32_reg32(rd1, rt1); + and_reg32_reg32(rd2, rt2); + } + else + { + int temp = lru_register(); + free_register(temp); + mov_reg32_reg32(temp, rs1); + and_reg32_reg32(temp, rt1); + mov_reg32_reg32(rd1, temp); + mov_reg32_reg32(temp, rs2); + and_reg32_reg32(temp, rt2); + mov_reg32_reg32(rd2, temp); + } +#endif +} + +void genor(void) +{ +#ifdef INTERPRET_OR + gencallinterp((unsigned int)cached_interpreter_table.OR, 0); +#else + int rs1 = allocate_64_register1((unsigned int *)dst->f.r.rs); + int rs2 = allocate_64_register2((unsigned int *)dst->f.r.rs); + int rt1 = allocate_64_register1((unsigned int *)dst->f.r.rt); + int rt2 = allocate_64_register2((unsigned int *)dst->f.r.rt); + int rd1 = allocate_64_register1_w((unsigned int *)dst->f.r.rd); + int rd2 = allocate_64_register2_w((unsigned int *)dst->f.r.rd); + + if (rt1 != rd1 && rs1 != rd1) + { + mov_reg32_reg32(rd1, rs1); + mov_reg32_reg32(rd2, rs2); + or_reg32_reg32(rd1, rt1); + or_reg32_reg32(rd2, rt2); + } + else + { + int temp = lru_register(); + free_register(temp); + mov_reg32_reg32(temp, rs1); + or_reg32_reg32(temp, rt1); + mov_reg32_reg32(rd1, temp); + mov_reg32_reg32(temp, rs2); + or_reg32_reg32(temp, rt2); + mov_reg32_reg32(rd2, temp); + } +#endif +} + +void genxor(void) +{ +#ifdef INTERPRET_XOR + gencallinterp((unsigned int)cached_interpreter_table.XOR, 0); +#else + int rs1 = allocate_64_register1((unsigned int *)dst->f.r.rs); + int rs2 = allocate_64_register2((unsigned int *)dst->f.r.rs); + int rt1 = allocate_64_register1((unsigned int *)dst->f.r.rt); + int rt2 = allocate_64_register2((unsigned int *)dst->f.r.rt); + int rd1 = allocate_64_register1_w((unsigned int *)dst->f.r.rd); + int rd2 = allocate_64_register2_w((unsigned int *)dst->f.r.rd); + + if (rt1 != rd1 && rs1 != rd1) + { + mov_reg32_reg32(rd1, rs1); + mov_reg32_reg32(rd2, rs2); + xor_reg32_reg32(rd1, rt1); + xor_reg32_reg32(rd2, rt2); + } + else + { + int temp = lru_register(); + free_register(temp); + mov_reg32_reg32(temp, rs1); + xor_reg32_reg32(temp, rt1); + mov_reg32_reg32(rd1, temp); + mov_reg32_reg32(temp, rs2); + xor_reg32_reg32(temp, rt2); + mov_reg32_reg32(rd2, temp); + } +#endif +} + +void gennor(void) +{ +#ifdef INTERPRET_NOR + gencallinterp((unsigned int)cached_interpreter_table.NOR, 0); +#else + int rs1 = allocate_64_register1((unsigned int *)dst->f.r.rs); + int rs2 = allocate_64_register2((unsigned int *)dst->f.r.rs); + int rt1 = allocate_64_register1((unsigned int *)dst->f.r.rt); + int rt2 = allocate_64_register2((unsigned int *)dst->f.r.rt); + int rd1 = allocate_64_register1_w((unsigned int *)dst->f.r.rd); + int rd2 = allocate_64_register2_w((unsigned int *)dst->f.r.rd); + + if (rt1 != rd1 && rs1 != rd1) + { + mov_reg32_reg32(rd1, rs1); + mov_reg32_reg32(rd2, rs2); + or_reg32_reg32(rd1, rt1); + or_reg32_reg32(rd2, rt2); + not_reg32(rd1); + not_reg32(rd2); + } + else + { + int temp = lru_register(); + free_register(temp); + mov_reg32_reg32(temp, rs1); + or_reg32_reg32(temp, rt1); + mov_reg32_reg32(rd1, temp); + mov_reg32_reg32(temp, rs2); + or_reg32_reg32(temp, rt2); + mov_reg32_reg32(rd2, temp); + not_reg32(rd1); + not_reg32(rd2); + } +#endif +} + +void genslt(void) +{ +#ifdef INTERPRET_SLT + gencallinterp((unsigned int)cached_interpreter_table.SLT, 0); +#else + int rs1 = allocate_64_register1((unsigned int *)dst->f.r.rs); + int rs2 = allocate_64_register2((unsigned int *)dst->f.r.rs); + int rt1 = allocate_64_register1((unsigned int *)dst->f.r.rt); + int rt2 = allocate_64_register2((unsigned int *)dst->f.r.rt); + int rd = allocate_register_w((unsigned int *)dst->f.r.rd); + + cmp_reg32_reg32(rs2, rt2); + jl_rj(13); + jne_rj(4); // 2 + cmp_reg32_reg32(rs1, rt1); // 2 + jl_rj(7); // 2 + mov_reg32_imm32(rd, 0); // 5 + jmp_imm_short(5); // 2 + mov_reg32_imm32(rd, 1); // 5 +#endif +} + +void gensltu(void) +{ +#ifdef INTERPRET_SLTU + gencallinterp((unsigned int)cached_interpreter_table.SLTU, 0); +#else + int rs1 = allocate_64_register1((unsigned int *)dst->f.r.rs); + int rs2 = allocate_64_register2((unsigned int *)dst->f.r.rs); + int rt1 = allocate_64_register1((unsigned int *)dst->f.r.rt); + int rt2 = allocate_64_register2((unsigned int *)dst->f.r.rt); + int rd = allocate_register_w((unsigned int *)dst->f.r.rd); + + cmp_reg32_reg32(rs2, rt2); + jb_rj(13); + jne_rj(4); // 2 + cmp_reg32_reg32(rs1, rt1); // 2 + jb_rj(7); // 2 + mov_reg32_imm32(rd, 0); // 5 + jmp_imm_short(5); // 2 + mov_reg32_imm32(rd, 1); // 5 +#endif +} + +void gendadd(void) +{ +#ifdef INTERPRET_DADD + gencallinterp((unsigned int)cached_interpreter_table.DADD, 0); +#else + int rs1 = allocate_64_register1((unsigned int *)dst->f.r.rs); + int rs2 = allocate_64_register2((unsigned int *)dst->f.r.rs); + int rt1 = allocate_64_register1((unsigned int *)dst->f.r.rt); + int rt2 = allocate_64_register2((unsigned int *)dst->f.r.rt); + int rd1 = allocate_64_register1_w((unsigned int *)dst->f.r.rd); + int rd2 = allocate_64_register2_w((unsigned int *)dst->f.r.rd); + + if (rt1 != rd1 && rs1 != rd1) + { + mov_reg32_reg32(rd1, rs1); + mov_reg32_reg32(rd2, rs2); + add_reg32_reg32(rd1, rt1); + adc_reg32_reg32(rd2, rt2); + } + else + { + int temp = lru_register(); + free_register(temp); + mov_reg32_reg32(temp, rs1); + add_reg32_reg32(temp, rt1); + mov_reg32_reg32(rd1, temp); + mov_reg32_reg32(temp, rs2); + adc_reg32_reg32(temp, rt2); + mov_reg32_reg32(rd2, temp); + } +#endif +} + +void gendaddu(void) +{ +#ifdef INTERPRET_DADDU + gencallinterp((unsigned int)cached_interpreter_table.DADDU, 0); +#else + int rs1 = allocate_64_register1((unsigned int *)dst->f.r.rs); + int rs2 = allocate_64_register2((unsigned int *)dst->f.r.rs); + int rt1 = allocate_64_register1((unsigned int *)dst->f.r.rt); + int rt2 = allocate_64_register2((unsigned int *)dst->f.r.rt); + int rd1 = allocate_64_register1_w((unsigned int *)dst->f.r.rd); + int rd2 = allocate_64_register2_w((unsigned int *)dst->f.r.rd); + + if (rt1 != rd1 && rs1 != rd1) + { + mov_reg32_reg32(rd1, rs1); + mov_reg32_reg32(rd2, rs2); + add_reg32_reg32(rd1, rt1); + adc_reg32_reg32(rd2, rt2); + } + else + { + int temp = lru_register(); + free_register(temp); + mov_reg32_reg32(temp, rs1); + add_reg32_reg32(temp, rt1); + mov_reg32_reg32(rd1, temp); + mov_reg32_reg32(temp, rs2); + adc_reg32_reg32(temp, rt2); + mov_reg32_reg32(rd2, temp); + } +#endif +} + +void gendsub(void) +{ +#ifdef INTERPRET_DSUB + gencallinterp((unsigned int)cached_interpreter_table.DSUB, 0); +#else + int rs1 = allocate_64_register1((unsigned int *)dst->f.r.rs); + int rs2 = allocate_64_register2((unsigned int *)dst->f.r.rs); + int rt1 = allocate_64_register1((unsigned int *)dst->f.r.rt); + int rt2 = allocate_64_register2((unsigned int *)dst->f.r.rt); + int rd1 = allocate_64_register1_w((unsigned int *)dst->f.r.rd); + int rd2 = allocate_64_register2_w((unsigned int *)dst->f.r.rd); + + if (rt1 != rd1 && rs1 != rd1) + { + mov_reg32_reg32(rd1, rs1); + mov_reg32_reg32(rd2, rs2); + sub_reg32_reg32(rd1, rt1); + sbb_reg32_reg32(rd2, rt2); + } + else + { + int temp = lru_register(); + free_register(temp); + mov_reg32_reg32(temp, rs1); + sub_reg32_reg32(temp, rt1); + mov_reg32_reg32(rd1, temp); + mov_reg32_reg32(temp, rs2); + sbb_reg32_reg32(temp, rt2); + mov_reg32_reg32(rd2, temp); + } +#endif +} + +void gendsubu(void) +{ +#ifdef INTERPRET_DSUBU + gencallinterp((unsigned int)cached_interpreter_table.DSUBU, 0); +#else + int rs1 = allocate_64_register1((unsigned int *)dst->f.r.rs); + int rs2 = allocate_64_register2((unsigned int *)dst->f.r.rs); + int rt1 = allocate_64_register1((unsigned int *)dst->f.r.rt); + int rt2 = allocate_64_register2((unsigned int *)dst->f.r.rt); + int rd1 = allocate_64_register1_w((unsigned int *)dst->f.r.rd); + int rd2 = allocate_64_register2_w((unsigned int *)dst->f.r.rd); + + if (rt1 != rd1 && rs1 != rd1) + { + mov_reg32_reg32(rd1, rs1); + mov_reg32_reg32(rd2, rs2); + sub_reg32_reg32(rd1, rt1); + sbb_reg32_reg32(rd2, rt2); + } + else + { + int temp = lru_register(); + free_register(temp); + mov_reg32_reg32(temp, rs1); + sub_reg32_reg32(temp, rt1); + mov_reg32_reg32(rd1, temp); + mov_reg32_reg32(temp, rs2); + sbb_reg32_reg32(temp, rt2); + mov_reg32_reg32(rd2, temp); + } +#endif +} + +void genteq(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.TEQ, 0); +} + +void gendsll(void) +{ +#ifdef INTERPRET_DSLL + gencallinterp((unsigned int)cached_interpreter_table.DSLL, 0); +#else + int rt1 = allocate_64_register1((unsigned int *)dst->f.r.rt); + int rt2 = allocate_64_register2((unsigned int *)dst->f.r.rt); + int rd1 = allocate_64_register1_w((unsigned int *)dst->f.r.rd); + int rd2 = allocate_64_register2_w((unsigned int *)dst->f.r.rd); + + mov_reg32_reg32(rd1, rt1); + mov_reg32_reg32(rd2, rt2); + shld_reg32_reg32_imm8(rd2, rd1, dst->f.r.sa); + shl_reg32_imm8(rd1, dst->f.r.sa); + if (dst->f.r.sa & 0x20) + { + mov_reg32_reg32(rd2, rd1); + xor_reg32_reg32(rd1, rd1); + } +#endif +} + +void gendsrl(void) +{ +#ifdef INTERPRET_DSRL + gencallinterp((unsigned int)cached_interpreter_table.DSRL, 0); +#else + int rt1 = allocate_64_register1((unsigned int *)dst->f.r.rt); + int rt2 = allocate_64_register2((unsigned int *)dst->f.r.rt); + int rd1 = allocate_64_register1_w((unsigned int *)dst->f.r.rd); + int rd2 = allocate_64_register2_w((unsigned int *)dst->f.r.rd); + + mov_reg32_reg32(rd1, rt1); + mov_reg32_reg32(rd2, rt2); + shrd_reg32_reg32_imm8(rd1, rd2, dst->f.r.sa); + shr_reg32_imm8(rd2, dst->f.r.sa); + if (dst->f.r.sa & 0x20) + { + mov_reg32_reg32(rd1, rd2); + xor_reg32_reg32(rd2, rd2); + } +#endif +} + +void gendsra(void) +{ +#ifdef INTERPRET_DSRA + gencallinterp((unsigned int)cached_interpreter_table.DSRA, 0); +#else + int rt1 = allocate_64_register1((unsigned int *)dst->f.r.rt); + int rt2 = allocate_64_register2((unsigned int *)dst->f.r.rt); + int rd1 = allocate_64_register1_w((unsigned int *)dst->f.r.rd); + int rd2 = allocate_64_register2_w((unsigned int *)dst->f.r.rd); + + mov_reg32_reg32(rd1, rt1); + mov_reg32_reg32(rd2, rt2); + shrd_reg32_reg32_imm8(rd1, rd2, dst->f.r.sa); + sar_reg32_imm8(rd2, dst->f.r.sa); + if (dst->f.r.sa & 0x20) + { + mov_reg32_reg32(rd1, rd2); + sar_reg32_imm8(rd2, 31); + } +#endif +} + +void gendsll32(void) +{ +#ifdef INTERPRET_DSLL32 + gencallinterp((unsigned int)cached_interpreter_table.DSLL32, 0); +#else + int rt1 = allocate_64_register1((unsigned int *)dst->f.r.rt); + int rd1 = allocate_64_register1_w((unsigned int *)dst->f.r.rd); + int rd2 = allocate_64_register2_w((unsigned int *)dst->f.r.rd); + + mov_reg32_reg32(rd2, rt1); + shl_reg32_imm8(rd2, dst->f.r.sa); + xor_reg32_reg32(rd1, rd1); +#endif +} + +void gendsrl32(void) +{ +#ifdef INTERPRET_DSRL32 + gencallinterp((unsigned int)cached_interpreter_table.DSRL32, 0); +#else + int rt2 = allocate_64_register2((unsigned int *)dst->f.r.rt); + int rd1 = allocate_64_register1_w((unsigned int *)dst->f.r.rd); + int rd2 = allocate_64_register2_w((unsigned int *)dst->f.r.rd); + + mov_reg32_reg32(rd1, rt2); + shr_reg32_imm8(rd1, dst->f.r.sa); + xor_reg32_reg32(rd2, rd2); +#endif +} + +void gendsra32(void) +{ +#ifdef INTERPRET_DSRA32 + gencallinterp((unsigned int)cached_interpreter_table.DSRA32, 0); +#else + int rt2 = allocate_64_register2((unsigned int *)dst->f.r.rt); + int rd = allocate_register_w((unsigned int *)dst->f.r.rd); + + mov_reg32_reg32(rd, rt2); + sar_reg32_imm8(rd, dst->f.r.sa); +#endif +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86/gtlb.c b/libmupen64plus/mupen64plus-core/src/r4300/x86/gtlb.c new file mode 100644 index 0000000000..c19f3dde50 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86/gtlb.c @@ -0,0 +1,76 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - gtlb.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "assemble.h" + +#include "r4300/recomph.h" +#include "r4300/r4300.h" +#include "r4300/ops.h" + +void gentlbwi(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.TLBWI, 0); + /*dst->local_addr = code_length; + mov_m32_imm32((void *)(&PC), (unsigned int)(dst)); + mov_reg32_imm32(EAX, (unsigned int)(TLBWI)); + call_reg32(EAX); + genupdate_system(0);*/ +} + +void gentlbp(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.TLBP, 0); + /*dst->local_addr = code_length; + mov_m32_imm32((void *)(&PC), (unsigned int)(dst)); + mov_reg32_imm32(EAX, (unsigned int)(TLBP)); + call_reg32(EAX); + genupdate_system(0);*/ +} + +void gentlbr(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.TLBR, 0); + /*dst->local_addr = code_length; + mov_m32_imm32((void *)(&PC), (unsigned int)(dst)); + mov_reg32_imm32(EAX, (unsigned int)(TLBR)); + call_reg32(EAX); + genupdate_system(0);*/ +} + +void generet(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.ERET, 1); + /*dst->local_addr = code_length; + mov_m32_imm32((void *)(&PC), (unsigned int)(dst)); + genupdate_system(0); + mov_reg32_imm32(EAX, (unsigned int)(ERET)); + call_reg32(EAX); + mov_reg32_imm32(EAX, (unsigned int)(jump_code)); + jmp_reg32(EAX);*/ +} + +void gentlbwr(void) +{ + gencallinterp((unsigned int)cached_interpreter_table.TLBWR, 0); +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86/interpret.h b/libmupen64plus/mupen64plus-core/src/r4300/x86/interpret.h new file mode 100644 index 0000000000..ef4fafcb12 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86/interpret.h @@ -0,0 +1,239 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - interpret.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef INTERPRET_H +#define INTERPRET_H + +//#define INTERPRET_J +//#define INTERPRET_J_OUT +//#define INTERPRET_J_IDLE +//#define INTERPRET_JAL +//#define INTERPRET_JAL_OUT +//#define INTERPRET_JAL_IDLE +//#define INTERPRET_BEQ +//#define INTERPRET_BEQ_OUT +//#define INTERPRET_BEQ_IDLE +//#define INTERPRET_BNE +//#define INTERPRET_BNE_OUT +//#define INTERPRET_BNE_IDLE +//#define INTERPRET_BLEZ +//#define INTERPRET_BLEZ_OUT +//#define INTERPRET_BLEZ_IDLE +//#define INTERPRET_BGTZ +//#define INTERPRET_BGTZ_OUT +//#define INTERPRET_BGTZ_IDLE +//#define INTERPRET_ADDI +//#define INTERPRET_ADDIU +//#define INTERPRET_SLTI +//#define INTERPRET_SLTIU +//#define INTERPRET_ANDI +//#define INTERPRET_ORI +//#define INTERPRET_XORI +//#define INTERPRET_LUI +//#define INTERPRET_BEQL +//#define INTERPRET_BEQL_OUT +//#define INTERPRET_BEQL_IDLE +//#define INTERPRET_BNEL +//#define INTERPRET_BNEL_OUT +//#define INTERPRET_BNEL_IDLE +//#define INTERPRET_BLEZL +//#define INTERPRET_BLEZL_OUT +//#define INTERPRET_BLEZL_IDLE +//#define INTERPRET_BGTZL +//#define INTERPRET_BGTZL_OUT +//#define INTERPRET_BGTZL_IDLE +//#define INTERPRET_DADDI +//#define INTERPRET_DADDIU +//#define INTERPRET_LB +//#define INTERPRET_LH +//#define INTERPRET_LW +//#define INTERPRET_LBU +//#define INTERPRET_LHU +//#define INTERPRET_LWU +//#define INTERPRET_SB +//#define INTERPRET_SH +//#define INTERPRET_SW +//#define INTERPRET_LWC1 +//#define INTERPRET_LDC1 +//#define INTERPRET_LD +//#define INTERPRET_SWC1 +//#define INTERPRET_SDC1 +//#define INTERPRET_SD +//#define INTERPRET_SLL +//#define INTERPRET_SRL +//#define INTERPRET_SRA +//#define INTERPRET_SLLV +//#define INTERPRET_SRLV +//#define INTERPRET_SRAV +//#define INTERPRET_JR +//#define INTERPRET_JALR +//#define INTERPRET_SYSCALL +//#define INTERPRET_MFHI +//#define INTERPRET_MTHI +//#define INTERPRET_MFLO +//#define INTERPRET_MTLO +//#define INTERPRET_DSLLV +//#define INTERPRET_DSRLV +//#define INTERPRET_DSRAV +//#define INTERPRET_MULT +//#define INTERPRET_MULTU +//#define INTERPRET_DIV +//#define INTERPRET_DIVU +//#define INTERPRET_DMULTU +//#define INTERPRET_ADD +//#define INTERPRET_ADDU +//#define INTERPRET_SUB +//#define INTERPRET_SUBU +//#define INTERPRET_AND +//#define INTERPRET_OR +//#define INTERPRET_XOR +//#define INTERPRET_NOR +//#define INTERPRET_SLT +//#define INTERPRET_SLTU +//#define INTERPRET_DADD +//#define INTERPRET_DADDU +//#define INTERPRET_DSUB +//#define INTERPRET_DSUBU +//#define INTERPRET_DSLL +//#define INTERPRET_DSRL +//#define INTERPRET_DSRA +//#define INTERPRET_DSLL32 +//#define INTERPRET_DSRL32 +//#define INTERPRET_DSRA32 +//#define INTERPRET_BLTZ +//#define INTERPRET_BLTZ_OUT +//#define INTERPRET_BLTZ_IDLE +//#define INTERPRET_BGEZ +//#define INTERPRET_BGEZ_OUT +//#define INTERPRET_BGEZ_IDLE +//#define INTERPRET_BLTZL +//#define INTERPRET_BLTZL_OUT +//#define INTERPRET_BLTZL_IDLE +//#define INTERPRET_BGEZL +//#define INTERPRET_BGEZL_OUT +//#define INTERPRET_BGEZL_IDLE +//#define INTERPRET_BLTZAL +//#define INTERPRET_BLTZAL_OUT +//#define INTERPRET_BLTZAL_IDLE +//#define INTERPRET_BGEZAL +//#define INTERPRET_BGEZAL_OUT +//#define INTERPRET_BGEZAL_IDLE +//#define INTERPRET_BLTZALL +//#define INTERPRET_BLTZALL_OUT +//#define INTERPRET_BLTZALL_IDLE +//#define INTERPRET_BGEZALL +//#define INTERPRET_BGEZALL_OUT +//#define INTERPRET_BGEZALL_IDLE +//#define INTERPRET_BC1F +//#define INTERPRET_BC1F_OUT +//#define INTERPRET_BC1F_IDLE +//#define INTERPRET_BC1T +//#define INTERPRET_BC1T_OUT +//#define INTERPRET_BC1T_IDLE +//#define INTERPRET_BC1FL +//#define INTERPRET_BC1FL_OUT +//#define INTERPRET_BC1FL_IDLE +//#define INTERPRET_BC1TL +//#define INTERPRET_BC1TL_OUT +//#define INTERPRET_BC1TL_IDLE +//#define INTERPRET_MFC1 +//#define INTERPRET_DMFC1 +//#define INTERPRET_CFC1 +//#define INTERPRET_MTC1 +//#define INTERPRET_DMTC1 +//#define INTERPRET_CTC1 +//#define INTERPRET_ADD_D +//#define INTERPRET_SUB_D +//#define INTERPRET_MUL_D +//#define INTERPRET_DIV_D +//#define INTERPRET_SQRT_D +//#define INTERPRET_ABS_D +//#define INTERPRET_MOV_D +//#define INTERPRET_NEG_D +//#define INTERPRET_ROUND_L_D +//#define INTERPRET_TRUNC_L_D +//#define INTERPRET_CEIL_L_D +//#define INTERPRET_FLOOR_L_D +//#define INTERPRET_ROUND_W_D +//#define INTERPRET_TRUNC_W_D +//#define INTERPRET_CEIL_W_D +//#define INTERPRET_FLOOR_W_D +//#define INTERPRET_CVT_S_D +//#define INTERPRET_CVT_W_D +//#define INTERPRET_CVT_L_D +//#define INTERPRET_C_F_D +//#define INTERPRET_C_UN_D +//#define INTERPRET_C_EQ_D +//#define INTERPRET_C_UEQ_D +//#define INTERPRET_C_OLT_D +//#define INTERPRET_C_ULT_D +//#define INTERPRET_C_OLE_D +//#define INTERPRET_C_ULE_D +//#define INTERPRET_C_SF_D +//#define INTERPRET_C_NGLE_D +//#define INTERPRET_C_SEQ_D +//#define INTERPRET_C_NGL_D +//#define INTERPRET_C_LT_D +//#define INTERPRET_C_NGE_D +//#define INTERPRET_C_LE_D +//#define INTERPRET_C_NGT_D +//#define INTERPRET_CVT_S_L +//#define INTERPRET_CVT_D_L +//#define INTERPRET_CVT_S_W +//#define INTERPRET_CVT_D_W +//#define INTERPRET_ADD_S +//#define INTERPRET_SUB_S +//#define INTERPRET_MUL_S +//#define INTERPRET_DIV_S +//#define INTERPRET_SQRT_S +//#define INTERPRET_ABS_S +//#define INTERPRET_MOV_S +//#define INTERPRET_NEG_S +//#define INTERPRET_ROUND_L_S +//#define INTERPRET_TRUNC_L_S +//#define INTERPRET_CEIL_L_S +//#define INTERPRET_FLOOR_L_S +//#define INTERPRET_ROUND_W_S +//#define INTERPRET_TRUNC_W_S +//#define INTERPRET_CEIL_W_S +//#define INTERPRET_FLOOR_W_S +//#define INTERPRET_CVT_D_S +//#define INTERPRET_CVT_W_S +//#define INTERPRET_CVT_L_S +//#define INTERPRET_C_F_S +//#define INTERPRET_C_UN_S +//#define INTERPRET_C_EQ_S +//#define INTERPRET_C_UEQ_S +//#define INTERPRET_C_OLT_S +//#define INTERPRET_C_ULT_S +//#define INTERPRET_C_OLE_S +//#define INTERPRET_C_ULE_S +//#define INTERPRET_C_SF_S +//#define INTERPRET_C_NGLE_S +//#define INTERPRET_C_SEQ_S +//#define INTERPRET_C_NGL_S +//#define INTERPRET_C_LT_S +//#define INTERPRET_C_NGE_S +//#define INTERPRET_C_LE_S +//#define INTERPRET_C_NGT_S + +#endif // INTERPRET_H + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86/regcache.c b/libmupen64plus/mupen64plus-core/src/r4300/x86/regcache.c new file mode 100644 index 0000000000..d5da08cbe4 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86/regcache.c @@ -0,0 +1,857 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - regcache.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "regcache.h" + +#include "r4300/recomp.h" +#include "r4300/r4300.h" +#include "r4300/recomph.h" + +static unsigned int* reg_content[8]; +static precomp_instr* last_access[8]; +static precomp_instr* free_since[8]; +static int dirty[8]; +static int r64[8]; +static unsigned int* r0; + +void init_cache(precomp_instr* start) +{ + int i; + for (i=0; i<8; i++) + { + last_access[i] = NULL; + free_since[i] = start; + } + r0 = (unsigned int*)reg; +} + +void free_all_registers(void) +{ +#if defined(PROFILE_R4300) + int freestart = code_length; + int flushed = 0; +#endif + + int i; + for (i=0; i<8; i++) + { +#if defined(PROFILE_R4300) + if (last_access[i] && dirty[i]) flushed = 1; +#endif + if (last_access[i]) free_register(i); + else + { + while (free_since[i] <= dst) + { + free_since[i]->reg_cache_infos.needed_registers[i] = NULL; + free_since[i]++; + } + } + } + +#if defined(PROFILE_R4300) + if (flushed == 1) + { + long x86addr = (long) ((*inst_pointer) + freestart); + int mipsop = -5; + fwrite(&mipsop, 1, 4, pfProfile); /* -5 = regcache flushing */ + fwrite(&x86addr, 1, sizeof(char *), pfProfile); // write pointer to start of register cache flushing instructions + x86addr = (long) ((*inst_pointer) + code_length); + fwrite(&src, 1, 4, pfProfile); // write 4-byte MIPS opcode for current instruction + fwrite(&x86addr, 1, sizeof(char *), pfProfile); // write pointer to dynamically generated x86 code for this MIPS instruction + } +#endif +} + +// this function frees a specific X86 GPR +void free_register(int reg) +{ + precomp_instr *last; + + if (last_access[reg] != NULL && + r64[reg] != -1 && (int)reg_content[reg] != (int)reg_content[r64[reg]]-4) + { + free_register(r64[reg]); + return; + } + + if (last_access[reg] != NULL) last = last_access[reg]+1; + else last = free_since[reg]; + + while (last <= dst) + { + if (last_access[reg] != NULL && dirty[reg]) + last->reg_cache_infos.needed_registers[reg] = reg_content[reg]; + else + last->reg_cache_infos.needed_registers[reg] = NULL; + + if (last_access[reg] != NULL && r64[reg] != -1) + { + if (dirty[r64[reg]]) + last->reg_cache_infos.needed_registers[r64[reg]] = reg_content[r64[reg]]; + else + last->reg_cache_infos.needed_registers[r64[reg]] = NULL; + } + + last++; + } + if (last_access[reg] == NULL) + { + free_since[reg] = dst+1; + return; + } + + if (dirty[reg]) + { + mov_m32_reg32(reg_content[reg], reg); + if (r64[reg] == -1) + { + sar_reg32_imm8(reg, 31); + mov_m32_reg32((unsigned int*)reg_content[reg]+1, reg); + } + else mov_m32_reg32(reg_content[r64[reg]], r64[reg]); + } + last_access[reg] = NULL; + free_since[reg] = dst+1; + if (r64[reg] != -1) + { + last_access[r64[reg]] = NULL; + free_since[r64[reg]] = dst+1; + } +} + +int lru_register(void) +{ + unsigned int oldest_access = 0xFFFFFFFF; + int i, reg = 0; + for (i=0; i<8; i++) + { + if (i != ESP && (unsigned int)last_access[i] < oldest_access) + { + oldest_access = (int)last_access[i]; + reg = i; + } + } + return reg; +} + +int lru_register_exc1(int exc1) +{ + unsigned int oldest_access = 0xFFFFFFFF; + int i, reg = 0; + for (i=0; i<8; i++) + { + if (i != ESP && i != exc1 && (unsigned int)last_access[i] < oldest_access) + { + oldest_access = (int)last_access[i]; + reg = i; + } + } + return reg; +} + +// this function finds a register to put the data contained in addr, +// if there was another value before it's cleanly removed of the +// register cache. After that, the register number is returned. +// If data are already cached, the function only returns the register number +int allocate_register(unsigned int *addr) +{ + unsigned int oldest_access = 0xFFFFFFFF; + int reg = 0, i; + + // is it already cached ? + if (addr != NULL) + { + for (i=0; i<8; i++) + { + if (last_access[i] != NULL && reg_content[i] == addr) + { + precomp_instr *last = last_access[i]+1; + + while (last <= dst) + { + last->reg_cache_infos.needed_registers[i] = reg_content[i]; + last++; + } + last_access[i] = dst; + if (r64[i] != -1) + { + last = last_access[r64[i]]+1; + + while (last <= dst) + { + last->reg_cache_infos.needed_registers[r64[i]] = reg_content[r64[i]]; + last++; + } + last_access[r64[i]] = dst; + } + + return i; + } + } + } + + // if it's not cached, we take the least recently used register + for (i=0; i<8; i++) + { + if (i != ESP && (unsigned int)last_access[i] < oldest_access) + { + oldest_access = (int)last_access[i]; + reg = i; + } + } + + if (last_access[reg]) free_register(reg); + else + { + while (free_since[reg] <= dst) + { + free_since[reg]->reg_cache_infos.needed_registers[reg] = NULL; + free_since[reg]++; + } + } + + last_access[reg] = dst; + reg_content[reg] = addr; + dirty[reg] = 0; + r64[reg] = -1; + + if (addr != NULL) + { + if (addr == r0 || addr == r0+1) + xor_reg32_reg32(reg, reg); + else + mov_reg32_m32(reg, addr); + } + + return reg; +} + +// this function is similar to allocate_register except it loads +// a 64 bits value, and return the register number of the LSB part +int allocate_64_register1(unsigned int *addr) +{ + int reg1, reg2, i; + + // is it already cached as a 32 bits value ? + for (i=0; i<8; i++) + { + if (last_access[i] != NULL && reg_content[i] == addr) + { + if (r64[i] == -1) + { + allocate_register(addr); + reg2 = allocate_register(dirty[i] ? NULL : addr+1); + r64[i] = reg2; + r64[reg2] = i; + + if (dirty[i]) + { + reg_content[reg2] = addr+1; + dirty[reg2] = 1; + mov_reg32_reg32(reg2, i); + sar_reg32_imm8(reg2, 31); + } + + return i; + } + } + } + + reg1 = allocate_register(addr); + reg2 = allocate_register(addr+1); + r64[reg1] = reg2; + r64[reg2] = reg1; + + return reg1; +} + +// this function is similar to allocate_register except it loads +// a 64 bits value, and return the register number of the MSB part +int allocate_64_register2(unsigned int *addr) +{ + int reg1, reg2, i; + + // is it already cached as a 32 bits value ? + for (i=0; i<8; i++) + { + if (last_access[i] != NULL && reg_content[i] == addr) + { + if (r64[i] == -1) + { + allocate_register(addr); + reg2 = allocate_register(dirty[i] ? NULL : addr+1); + r64[i] = reg2; + r64[reg2] = i; + + if (dirty[i]) + { + reg_content[reg2] = addr+1; + dirty[reg2] = 1; + mov_reg32_reg32(reg2, i); + sar_reg32_imm8(reg2, 31); + } + + return reg2; + } + } + } + + reg1 = allocate_register(addr); + reg2 = allocate_register(addr+1); + r64[reg1] = reg2; + r64[reg2] = reg1; + + return reg2; +} + +// this function checks if the data located at addr are cached in a register +// and then, it returns 1 if it's a 64 bit value +// 0 if it's a 32 bit value +// -1 if it's not cached +int is64(unsigned int *addr) +{ + int i; + for (i=0; i<8; i++) + { + if (last_access[i] != NULL && reg_content[i] == addr) + { + if (r64[i] == -1) return 0; + return 1; + } + } + return -1; +} + +int allocate_register_w(unsigned int *addr) +{ + unsigned int oldest_access = 0xFFFFFFFF; + int reg = 0, i; + + // is it already cached ? + for (i=0; i<8; i++) + { + if (last_access[i] != NULL && reg_content[i] == addr) + { + precomp_instr *last = last_access[i]+1; + + while (last <= dst) + { + last->reg_cache_infos.needed_registers[i] = NULL; + last++; + } + last_access[i] = dst; + dirty[i] = 1; + if (r64[i] != -1) + { + last = last_access[r64[i]]+1; + while (last <= dst) + { + last->reg_cache_infos.needed_registers[r64[i]] = NULL; + last++; + } + free_since[r64[i]] = dst+1; + last_access[r64[i]] = NULL; + r64[i] = -1; + } + + return i; + } + } + + // if it's not cached, we take the least recently used register + for (i=0; i<8; i++) + { + if (i != ESP && (unsigned int)last_access[i] < oldest_access) + { + oldest_access = (int)last_access[i]; + reg = i; + } + } + + if (last_access[reg]) free_register(reg); + else + { + while (free_since[reg] <= dst) + { + free_since[reg]->reg_cache_infos.needed_registers[reg] = NULL; + free_since[reg]++; + } + } + + last_access[reg] = dst; + reg_content[reg] = addr; + dirty[reg] = 1; + r64[reg] = -1; + + return reg; +} + +int allocate_64_register1_w(unsigned int *addr) +{ + int reg1, reg2, i; + + // is it already cached as a 32 bits value ? + for (i=0; i<8; i++) + { + if (last_access[i] != NULL && reg_content[i] == addr) + { + if (r64[i] == -1) + { + allocate_register_w(addr); + reg2 = lru_register(); + if (last_access[reg2]) free_register(reg2); + else + { + while (free_since[reg2] <= dst) + { + free_since[reg2]->reg_cache_infos.needed_registers[reg2] = NULL; + free_since[reg2]++; + } + } + r64[i] = reg2; + r64[reg2] = i; + last_access[reg2] = dst; + + reg_content[reg2] = addr+1; + dirty[reg2] = 1; + mov_reg32_reg32(reg2, i); + sar_reg32_imm8(reg2, 31); + + return i; + } + else + { + last_access[i] = dst; + last_access[r64[i]] = dst; + dirty[i] = dirty[r64[i]] = 1; + return i; + } + } + } + + reg1 = allocate_register_w(addr); + reg2 = lru_register(); + if (last_access[reg2]) free_register(reg2); + else + { + while (free_since[reg2] <= dst) + { + free_since[reg2]->reg_cache_infos.needed_registers[reg2] = NULL; + free_since[reg2]++; + } + } + r64[reg1] = reg2; + r64[reg2] = reg1; + last_access[reg2] = dst; + reg_content[reg2] = addr+1; + dirty[reg2] = 1; + + return reg1; +} + +int allocate_64_register2_w(unsigned int *addr) +{ + int reg1, reg2, i; + + // is it already cached as a 32 bits value ? + for (i=0; i<8; i++) + { + if (last_access[i] != NULL && reg_content[i] == addr) + { + if (r64[i] == -1) + { + allocate_register_w(addr); + reg2 = lru_register(); + if (last_access[reg2]) free_register(reg2); + else + { + while (free_since[reg2] <= dst) + { + free_since[reg2]->reg_cache_infos.needed_registers[reg2] = NULL; + free_since[reg2]++; + } + } + r64[i] = reg2; + r64[reg2] = i; + last_access[reg2] = dst; + + reg_content[reg2] = addr+1; + dirty[reg2] = 1; + mov_reg32_reg32(reg2, i); + sar_reg32_imm8(reg2, 31); + + return reg2; + } + else + { + last_access[i] = dst; + last_access[r64[i]] = dst; + dirty[i] = dirty[r64[i]] = 1; + return r64[i]; + } + } + } + + reg1 = allocate_register_w(addr); + reg2 = lru_register(); + if (last_access[reg2]) free_register(reg2); + else + { + while (free_since[reg2] <= dst) + { + free_since[reg2]->reg_cache_infos.needed_registers[reg2] = NULL; + free_since[reg2]++; + } + } + r64[reg1] = reg2; + r64[reg2] = reg1; + last_access[reg2] = dst; + reg_content[reg2] = addr+1; + dirty[reg2] = 1; + + return reg2; +} + +void set_register_state(int reg, unsigned int *addr, int d) +{ + last_access[reg] = dst; + reg_content[reg] = addr; + r64[reg] = -1; + dirty[reg] = d; +} + +void set_64_register_state(int reg1, int reg2, unsigned int *addr, int d) +{ + last_access[reg1] = dst; + last_access[reg2] = dst; + reg_content[reg1] = addr; + reg_content[reg2] = addr+1; + r64[reg1] = reg2; + r64[reg2] = reg1; + dirty[reg1] = d; + dirty[reg2] = d; +} + +void force_32(int reg) +{ + if (r64[reg] != -1) + { + precomp_instr *last = last_access[reg]+1; + + while (last <= dst) + { + if (dirty[reg]) + last->reg_cache_infos.needed_registers[reg] = reg_content[reg]; + else + last->reg_cache_infos.needed_registers[reg] = NULL; + + if (dirty[r64[reg]]) + last->reg_cache_infos.needed_registers[r64[reg]] = reg_content[r64[reg]]; + else + last->reg_cache_infos.needed_registers[r64[reg]] = NULL; + + last++; + } + + if (dirty[reg]) + { + mov_m32_reg32(reg_content[reg], reg); + mov_m32_reg32(reg_content[r64[reg]], r64[reg]); + dirty[reg] = 0; + } + last_access[r64[reg]] = NULL; + free_since[r64[reg]] = dst+1; + r64[reg] = -1; + } +} + +void allocate_register_manually(int reg, unsigned int *addr) +{ + int i; + + if (last_access[reg] != NULL && reg_content[reg] == addr) + { + precomp_instr *last = last_access[reg]+1; + + while (last <= dst) + { + last->reg_cache_infos.needed_registers[reg] = reg_content[reg]; + last++; + } + last_access[reg] = dst; + if (r64[reg] != -1) + { + last = last_access[r64[reg]]+1; + + while (last <= dst) + { + last->reg_cache_infos.needed_registers[r64[reg]] = reg_content[r64[reg]]; + last++; + } + last_access[r64[reg]] = dst; + } + return; + } + + if (last_access[reg]) free_register(reg); + else + { + while (free_since[reg] <= dst) + { + free_since[reg]->reg_cache_infos.needed_registers[reg] = NULL; + free_since[reg]++; + } + } + + // is it already cached ? + for (i=0; i<8; i++) + { + if (last_access[i] != NULL && reg_content[i] == addr) + { + precomp_instr *last = last_access[i]+1; + + while (last <= dst) + { + last->reg_cache_infos.needed_registers[i] = reg_content[i]; + last++; + } + last_access[i] = dst; + if (r64[i] != -1) + { + last = last_access[r64[i]]+1; + + while (last <= dst) + { + last->reg_cache_infos.needed_registers[r64[i]] = reg_content[r64[i]]; + last++; + } + last_access[r64[i]] = dst; + } + + mov_reg32_reg32(reg, i); + last_access[reg] = dst; + r64[reg] = r64[i]; + if (r64[reg] != -1) r64[r64[reg]] = reg; + dirty[reg] = dirty[i]; + reg_content[reg] = reg_content[i]; + free_since[i] = dst+1; + last_access[i] = NULL; + + return; + } + } + + last_access[reg] = dst; + reg_content[reg] = addr; + dirty[reg] = 0; + r64[reg] = -1; + + if (addr != NULL) + { + if (addr == r0 || addr == r0+1) + xor_reg32_reg32(reg, reg); + else + mov_reg32_m32(reg, addr); + } +} + +void allocate_register_manually_w(int reg, unsigned int *addr, int load) +{ + int i; + + if (last_access[reg] != NULL && reg_content[reg] == addr) + { + precomp_instr *last = last_access[reg]+1; + + while (last <= dst) + { + last->reg_cache_infos.needed_registers[reg] = reg_content[reg]; + last++; + } + last_access[reg] = dst; + + if (r64[reg] != -1) + { + last = last_access[r64[reg]]+1; + + while (last <= dst) + { + last->reg_cache_infos.needed_registers[r64[reg]] = reg_content[r64[reg]]; + last++; + } + last_access[r64[reg]] = NULL; + free_since[r64[reg]] = dst+1; + r64[reg] = -1; + } + dirty[reg] = 1; + return; + } + + if (last_access[reg]) free_register(reg); + else + { + while (free_since[reg] <= dst) + { + free_since[reg]->reg_cache_infos.needed_registers[reg] = NULL; + free_since[reg]++; + } + } + + // is it already cached ? + for (i=0; i<8; i++) + { + if (last_access[i] != NULL && reg_content[i] == addr) + { + precomp_instr *last = last_access[i]+1; + + while (last <= dst) + { + last->reg_cache_infos.needed_registers[i] = reg_content[i]; + last++; + } + last_access[i] = dst; + if (r64[i] != -1) + { + last = last_access[r64[i]]+1; + while (last <= dst) + { + last->reg_cache_infos.needed_registers[r64[i]] = NULL; + last++; + } + free_since[r64[i]] = dst+1; + last_access[r64[i]] = NULL; + r64[i] = -1; + } + + if (load) + mov_reg32_reg32(reg, i); + last_access[reg] = dst; + dirty[reg] = 1; + r64[reg] = -1; + reg_content[reg] = reg_content[i]; + free_since[i] = dst+1; + last_access[i] = NULL; + + return; + } + } + + last_access[reg] = dst; + reg_content[reg] = addr; + dirty[reg] = 1; + r64[reg] = -1; + + if (addr != NULL && load) + { + if (addr == r0 || addr == r0+1) + xor_reg32_reg32(reg, reg); + else + mov_reg32_m32(reg, addr); + } +} + +// 0x81 0xEC 0x4 0x0 0x0 0x0 sub esp, 4 +// 0xA1 0xXXXXXXXX mov eax, XXXXXXXX (&code start) +// 0x05 0xXXXXXXXX add eax, XXXXXXXX (local_addr) +// 0x89 0x04 0x24 mov [esp], eax +// 0x8B (reg<<3)|5 0xXXXXXXXX mov eax, [XXXXXXXX] +// 0x8B (reg<<3)|5 0xXXXXXXXX mov ebx, [XXXXXXXX] +// 0x8B (reg<<3)|5 0xXXXXXXXX mov ecx, [XXXXXXXX] +// 0x8B (reg<<3)|5 0xXXXXXXXX mov edx, [XXXXXXXX] +// 0x8B (reg<<3)|5 0xXXXXXXXX mov ebp, [XXXXXXXX] +// 0x8B (reg<<3)|5 0xXXXXXXXX mov esi, [XXXXXXXX] +// 0x8B (reg<<3)|5 0xXXXXXXXX mov edi, [XXXXXXXX] +// 0xC3 ret +// total : 62 bytes +static void build_wrapper(precomp_instr *instr, unsigned char* code, precomp_block* block) +{ + int i; + int j=0; + +#if defined(PROFILE_R4300) + long x86addr = (long) code; + int mipsop = -4; + fwrite(&mipsop, 1, 4, pfProfile); // write 4-byte MIPS opcode + fwrite(&x86addr, 1, sizeof(char *), pfProfile); // write pointer to dynamically generated x86 code for this MIPS instruction +#endif + + code[j++] = 0x81; + code[j++] = 0xEC; + code[j++] = 0x04; + code[j++] = 0x00; + code[j++] = 0x00; + code[j++] = 0x00; + + code[j++] = 0xA1; + *((unsigned int*)&code[j]) = (unsigned int)(&block->code); + j+=4; + + code[j++] = 0x05; + *((unsigned int*)&code[j]) = (unsigned int)instr->local_addr; + j+=4; + + code[j++] = 0x89; + code[j++] = 0x04; + code[j++] = 0x24; + + for (i=0; i<8; i++) + { + if (instr->reg_cache_infos.needed_registers[i] != NULL) + { + code[j++] = 0x8B; + code[j++] = (i << 3) | 5; + *((unsigned int*)&code[j]) = + (unsigned int)instr->reg_cache_infos.needed_registers[i]; + j+=4; + } + } + + code[j++] = 0xC3; +} + +void build_wrappers(precomp_instr *instr, int start, int end, precomp_block* block) +{ + int i, reg;; + for (i=start; ilocal_addr = code_length; + for(i=0; i<8; i++) dst->reg_cache_infos.needed_registers[i] = NULL; +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86/regcache.h b/libmupen64plus/mupen64plus-core/src/r4300/x86/regcache.h new file mode 100644 index 0000000000..7633e54b5a --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86/regcache.h @@ -0,0 +1,48 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - regcache.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef REGCACHE_H +#define REGCACHE_H + +#include "r4300/recomp.h" + +void init_cache(precomp_instr* start); +void free_all_registers(void); +void free_register(int reg); +int allocate_register(unsigned int *addr); +int allocate_64_register1(unsigned int *addr); +int allocate_64_register2(unsigned int *addr); +int is64(unsigned int *addr); +void build_wrappers(precomp_instr*, int, int, precomp_block*); +int lru_register(void); +int allocate_register_w(unsigned int *addr); +int allocate_64_register1_w(unsigned int *addr); +int allocate_64_register2_w(unsigned int *addr); +void set_register_state(int reg, unsigned int *addr, int dirty); +void set_64_register_state(int reg1, int reg2, unsigned int *addr, int dirty); +void allocate_register_manually(int reg, unsigned int *addr); +void allocate_register_manually_w(int reg, unsigned int *addr, int load); +void force_32(int reg); +int lru_register_exc1(int exc1); +void simplify_access(void); + +#endif // REGCACHE_H + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86/rjump.c b/libmupen64plus/mupen64plus-core/src/r4300/x86/rjump.c new file mode 100644 index 0000000000..5073279f13 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86/rjump.c @@ -0,0 +1,167 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - rjump.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "api/m64p_types.h" +#include "api/callbacks.h" +#include "r4300/recomp.h" +#include "r4300/r4300.h" +#include "r4300/macros.h" +#include "r4300/ops.h" +#include "r4300/recomph.h" + + #ifdef __GNUC__ +# define ASM_NAME(name) asm(name) +#else +# define ASM_NAME(name) +#endif + +static long save_ebp ASM_NAME("save_ebp") = 0; +static long save_ebx ASM_NAME("save_ebx") = 0; +static long save_esi ASM_NAME("save_esi") = 0; +static long save_edi ASM_NAME("save_edi") = 0; +static long save_esp ASM_NAME("save_esp") = 0; +static long save_eip ASM_NAME("save_eip") = 0; + +// that's where the dynarec will restart when going back from a C function +static unsigned long *return_address ASM_NAME("return_address"); + +void dyna_jump() +{ + if (stop == 1) + { + dyna_stop(); + return; + } + + if (PC->reg_cache_infos.need_map) + *return_address = (unsigned long) (PC->reg_cache_infos.jump_wrapper); + else + *return_address = (unsigned long) (actual->code + PC->local_addr); +} + +#if defined(WIN32) && !defined(__GNUC__) /* this warning disable only works if placed outside of the scope of a function */ +#pragma warning(disable:4731) /* frame pointer register 'ebp' modified by inline assembly code */ +#endif + +void dyna_start(void *code) +{ + /* save the base and stack pointers */ + /* make a call and a pop to retrieve the instruction pointer and save it too */ + /* then call the code(), which should theoretically never return. */ + /* When dyna_stop() sets the *return_address to the saved EIP, the emulator thread will come back here. */ + /* It will jump to label 2, restore the base and stack pointers, and exit this function */ +#if defined(WIN32) && !defined(__GNUC__) + __asm + { + mov save_ebp, ebp + mov save_esp, esp + mov save_ebx, ebx + mov save_esi, esi + mov save_edi, edi + call point1 + jmp point2 + point1: + pop eax + mov save_eip, eax + + sub esp, 0x10 + and esp, 0xfffffff0 + mov return_address, esp + sub return_address, 4 + + mov eax, code + call eax + point2: + mov ebp, save_ebp + mov esp, save_esp + mov ebx, save_ebx + mov esi, save_esi + mov edi, save_edi + } +#elif defined(__GNUC__) && defined(__i386__) + #if defined(__PIC__) + /* for -fPIC (shared libraries) */ + #if __GNUC_PREREQ (4, 7) + # define GET_PC_THUNK_STR(reg) "__x86.get_pc_thunk." #reg + #else + # define GET_PC_THUNK_STR(reg) "__i686.get_pc_thunk." #reg + #endif + #define STORE_EBX + #define LOAD_EBX "call " GET_PC_THUNK_STR(bx) " \n" \ + "addl $_GLOBAL_OFFSET_TABLE_, %%ebx \n" + #else + /* for non-PIC binaries */ + #define STORE_EBX "movl %%ebx, %[save_ebx] \n" + #define LOAD_EBX "movl %[save_ebx], %%ebx \n" + #endif + + asm volatile + (STORE_EBX + " movl %%ebp, %[save_ebp] \n" + " movl %%esp, %[save_esp] \n" + " movl %%esi, %[save_esi] \n" + " movl %%edi, %[save_edi] \n" + " call 1f \n" + " jmp 2f \n" + "1: \n" + " popl %%eax \n" + " movl %%eax, %[save_eip] \n" + + " subl $16, %%esp \n" /* save 16 bytes of padding just in case */ + " andl $-16, %%esp \n" /* align stack on 16-byte boundary for OSX */ + " movl %%esp, %[return_address] \n" + " subl $4, %[return_address] \n" + + " call *%[codeptr] \n" + "2: \n" + LOAD_EBX + " movl %[save_ebp], %%ebp \n" + " movl %[save_esp], %%esp \n" + " movl %[save_esi], %%esi \n" + " movl %[save_edi], %%edi \n" + : [save_ebp]"=m"(save_ebp), [save_esp]"=m"(save_esp), [save_ebx]"=m"(save_ebx), [save_esi]"=m"(save_esi), [save_edi]"=m"(save_edi), [save_eip]"=m"(save_eip), [return_address]"=m"(return_address) + : [codeptr]"r"(code) + : "eax", "ecx", "edx", "memory" + ); +#endif + + /* clear the registers so we don't return here a second time; that would be a bug */ + /* this is also necessary to prevent compiler from optimizing out the static variables */ + save_edi=0; + save_esi=0; + save_ebx=0; + save_ebp=0; + save_esp=0; + save_eip=0; +} + +void dyna_stop() +{ + if (save_eip == 0) + DebugMessage(M64MSG_WARNING, "instruction pointer is 0 at dyna_stop()"); + else + { + *return_address = (unsigned long) save_eip; + } +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86_64/assemble.c b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/assemble.c new file mode 100644 index 0000000000..eabb136752 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/assemble.c @@ -0,0 +1,219 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - assemble.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2007 Richard Goedeken (Richard42) * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include + +#include "assemble.h" + +#include "api/m64p_types.h" +#include "api/callbacks.h" +#include "r4300/recomph.h" +#include "r4300/recomp.h" +#include "r4300/r4300.h" + +/* Placeholder for RIP-relative offsets is maxmimum 32-bit signed value. + * So, if recompiled code is run without running passe2() first, it will + * cause an exception. +*/ +#define REL_PLACEHOLDER 0x7fffffff + +typedef struct _jump_table +{ + unsigned int mi_addr; + unsigned int pc_addr; + unsigned int absolute64; +} jump_table; + +static jump_table *jumps_table = NULL; +static int jumps_number = 0, max_jumps_number = 0; + +typedef struct _riprelative_table +{ + unsigned int pc_addr; /* index in bytes from start of x86_64 code block to the displacement value to write */ + unsigned int extra_bytes; /* number of remaining instruction bytes (immediate data) after 4-byte displacement */ + unsigned char *global_dst; /* 64-bit pointer to the data object */ +} riprelative_table; + +static riprelative_table *riprel_table = NULL; +static int riprel_number = 0, max_riprel_number = 0; + +/* Static Functions */ + +void add_jump(unsigned int pc_addr, unsigned int mi_addr, unsigned int absolute64) +{ + if (jumps_number == max_jumps_number) + { + max_jumps_number += 512; + jumps_table = realloc(jumps_table, max_jumps_number*sizeof(jump_table)); + } + jumps_table[jumps_number].pc_addr = pc_addr; + jumps_table[jumps_number].mi_addr = mi_addr; + jumps_table[jumps_number].absolute64 = absolute64; + jumps_number++; +} + +/* Global Functions */ + +void init_assembler(void *block_jumps_table, int block_jumps_number, void *block_riprel_table, int block_riprel_number) +{ + if (block_jumps_table) + { + jumps_table = block_jumps_table; + jumps_number = block_jumps_number; + if (jumps_number <= 512) + max_jumps_number = 512; + else + max_jumps_number = (jumps_number + 511) & 0xfffffe00; + } + else + { + jumps_table = malloc(512*sizeof(jump_table)); + jumps_number = 0; + max_jumps_number = 512; + } + + if (block_riprel_table) + { + riprel_table = block_riprel_table; + riprel_number = block_riprel_number; + if (riprel_number <= 512) + max_riprel_number = 512; + else + max_riprel_number = (riprel_number + 511) & 0xfffffe00; + } + else + { + riprel_table = malloc(512 * sizeof(riprelative_table)); + riprel_number = 0; + max_riprel_number = 512; + } +} + +void free_assembler(void **block_jumps_table, int *block_jumps_number, void **block_riprel_table, int *block_riprel_number) +{ + *block_jumps_table = jumps_table; + *block_jumps_number = jumps_number; + *block_riprel_table = riprel_table; + *block_riprel_number = riprel_number; +} + +void passe2(precomp_instr *dest, int start, int end, precomp_block *block) +{ + unsigned int i; + + build_wrappers(dest, start, end, block); + + /* First, fix up all the jumps. This involves a table lookup to find the offset into the block of x86_64 code for + * for start of a recompiled r4300i instruction corresponding to the given jump destination address in the N64 + * address space. Next, the relative offset between this destination and the location of the jump instruction is + * computed and stored in memory, so that the jump will branch to the right place in the recompiled code. + */ + for (i = 0; i < jumps_number; i++) + { + precomp_instr *jump_instr = dest + ((jumps_table[i].mi_addr - dest[0].addr) / 4); + unsigned int jmp_offset_loc = jumps_table[i].pc_addr; + unsigned char *addr_dest = NULL; + /* calculate the destination address to jump to */ + if (jump_instr->reg_cache_infos.need_map) + { + addr_dest = jump_instr->reg_cache_infos.jump_wrapper; + } + else + { + addr_dest = block->code + jump_instr->local_addr; + } + /* write either a 32-bit IP-relative offset or a 64-bit absolute address */ + if (jumps_table[i].absolute64) + { + *((unsigned long long *) (block->code + jmp_offset_loc)) = (unsigned long long) addr_dest; + } + else + { + long jump_rel_offset = (long) (addr_dest - (block->code + jmp_offset_loc + 4)); + *((int *) (block->code + jmp_offset_loc)) = (int) jump_rel_offset; + if (jump_rel_offset >= 0x7fffffffLL || jump_rel_offset < -0x80000000LL) + { + DebugMessage(M64MSG_ERROR, "assembler pass2 error: offset too big for relative jump from %p to %p", + (block->code + jmp_offset_loc + 4), addr_dest); + asm(" int $3; "); + } + } + } + + /* Next, fix up all of the RIP-relative memory accesses. This is unique to the x86_64 architecture, because + * the 32-bit absolute displacement addressing mode is not available (and there's no 64-bit absolute displacement + * mode either). + */ + for (i = 0; i < riprel_number; i++) + { + unsigned char *rel_offset_ptr = block->code + riprel_table[i].pc_addr; + long rip_rel_offset = (long) (riprel_table[i].global_dst - (rel_offset_ptr + 4 + riprel_table[i].extra_bytes)); + if (rip_rel_offset >= 0x7fffffffLL || rip_rel_offset < -0x80000000LL) + { + DebugMessage(M64MSG_ERROR, "assembler pass2 error: offset too big between mem target: %p and code position: %p", + riprel_table[i].global_dst, rel_offset_ptr); + asm(" int $3; "); + } + *((int *) rel_offset_ptr) = (int) rip_rel_offset; + } + +} + +static unsigned int g_jump_start8 = 0; +static unsigned int g_jump_start32 = 0; + +void jump_start_rel8(void) +{ + g_jump_start8 = code_length; +} + +void jump_start_rel32(void) +{ + g_jump_start32 = code_length; +} + +void jump_end_rel8(void) +{ + unsigned int jump_end = code_length; + int jump_vec = jump_end - g_jump_start8; + + if (jump_vec > 127 || jump_vec < -128) + { + DebugMessage(M64MSG_ERROR, "Error: 8-bit relative jump too long! From %x to %x", g_jump_start8, jump_end); + asm(" int $3; "); + } + + code_length = g_jump_start8 - 1; + put8(jump_vec); + code_length = jump_end; +} + +void jump_end_rel32(void) +{ + unsigned int jump_end = code_length; + int jump_vec = jump_end - g_jump_start32; + + code_length = g_jump_start32 - 4; + put32(jump_vec); + code_length = jump_end; +} diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86_64/assemble.h b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/assemble.h new file mode 100644 index 0000000000..087646b253 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/assemble.h @@ -0,0 +1,1182 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - assemble.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2007 Richard Goedeken (Richard42) * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __ASSEMBLE_H__ +#define __ASSEMBLE_H__ + +#include "r4300/recomph.h" +#include "api/callbacks.h" + +#include + +extern long long int reg[32]; + +#define RAX 0 +#define RCX 1 +#define RDX 2 +#define RBX 3 +#define RSP 4 +#define RBP 5 +#define RSI 6 +#define RDI 7 + +#define EAX 0 +#define ECX 1 +#define EDX 2 +#define EBX 3 +#define ESP 4 +#define EBP 5 +#define ESI 6 +#define EDI 7 + +#define AX 0 +#define CX 1 +#define DX 2 +#define BX 3 +#define SP 4 +#define BP 5 +#define SI 6 +#define DI 7 + +#define AL 0 +#define CL 1 +#define DL 2 +#define BL 3 +#define AH 4 +#define CH 5 +#define DH 6 +#define BH 7 + +extern int branch_taken; + +void jump_start_rel8(void); +void jump_end_rel8(void); +void jump_start_rel32(void); +void jump_end_rel32(void); +void add_jump(unsigned int pc_addr, unsigned int mi_addr, unsigned int absolute64); + +static inline void put8(unsigned char octet) +{ + (*inst_pointer)[code_length] = octet; + code_length++; + if (code_length == max_code_length) + { + *inst_pointer = realloc_exec(*inst_pointer, max_code_length, max_code_length+8192); + max_code_length += 8192; + } +} + +static inline void put32(unsigned int dword) +{ + if ((code_length + 4) >= max_code_length) + { + *inst_pointer = realloc_exec(*inst_pointer, max_code_length, max_code_length+8192); + max_code_length += 8192; + } + *((unsigned int *) (*inst_pointer + code_length)) = dword; + code_length += 4; +} + +static inline void put64(unsigned long long qword) +{ + if ((code_length + 8) >= max_code_length) + { + *inst_pointer = realloc_exec(*inst_pointer, max_code_length, max_code_length+8192); + max_code_length += 8192; + } + *((unsigned long long *) (*inst_pointer + code_length)) = qword; + code_length += 8; +} + +static inline int rel_r15_offset(void *dest, const char *op_name) +{ + /* calculate the destination pointer's offset from the base of the r4300 registers */ + long long rel_offset = (long long) ((unsigned char *) dest - (unsigned char *) reg); + + if (llabs(rel_offset) > 0x7fffffff) + { + DebugMessage(M64MSG_ERROR, "Error: destination %p more than 2GB away from r15 base %p in %s()", dest, reg, op_name); + asm(" int $3; "); + } + + return (int) rel_offset; +} + +static inline void mov_memoffs32_eax(unsigned int *memoffs32) +{ + put8(0xA3); + put64((unsigned long long) memoffs32); +} + +static inline void mov_rax_memoffs64(unsigned long long *memoffs64) +{ + put8(0x48); + put8(0xA1); + put64((unsigned long long) memoffs64); +} + +static inline void mov_memoffs64_rax(unsigned long long *memoffs64) +{ + put8(0x48); + put8(0xA3); + put64((unsigned long long) memoffs64); +} + +static inline void mov_m8rel_xreg8(unsigned char *m8, int xreg8) +{ + int offset = rel_r15_offset(m8, "mov_m8rel_xreg8"); + + put8(0x41 | ((xreg8 & 8) >> 1)); + put8(0x88); + put8(0x87 | ((xreg8 & 7) << 3)); + put32(offset); +} + +static inline void mov_xreg16_m16rel(int xreg16, unsigned short *m16) +{ + int offset = rel_r15_offset(m16, "mov_xreg16_m16rel"); + + put8(0x66); + put8(0x41 | ((xreg16 & 8) >> 1)); + put8(0x8B); + put8(0x87 | ((xreg16 & 7) << 3)); + put32(offset); +} + +static inline void mov_m16rel_xreg16(unsigned short *m16, int xreg16) +{ + int offset = rel_r15_offset(m16, "mov_m16rel_xreg16"); + + put8(0x66); + put8(0x41 | ((xreg16 & 8) >> 1)); + put8(0x89); + put8(0x87 | ((xreg16 & 7) << 3)); + put32(offset); +} + +static inline void cmp_xreg32_m32rel(int xreg32, unsigned int *m32) +{ + int offset = rel_r15_offset(m32, "cmp_xreg32_m32rel"); + + put8(0x41 | ((xreg32 & 8) >> 1)); + put8(0x3B); + put8(0x87 | ((xreg32 & 7) << 3)); + put32(offset); +} + +static inline void cmp_xreg64_m64rel(int xreg64, unsigned long long *m64) +{ + int offset = rel_r15_offset(m64, "cmp_xreg64_m64rel"); + + put8(0x49 | ((xreg64 & 8) >> 1)); + put8(0x3B); + put8(0x87 | ((xreg64 & 7) << 3)); + put32(offset); +} + +static inline void cmp_reg32_reg32(int reg1, int reg2) +{ + put8(0x39); + put8((reg2 << 3) | reg1 | 0xC0); +} + +static inline void cmp_reg64_reg64(int reg1, int reg2) +{ + put8(0x48); + put8(0x39); + put8((reg2 << 3) | reg1 | 0xC0); +} + +static inline void cmp_reg32_imm8(int reg32, unsigned char imm8) +{ + put8(0x83); + put8(0xF8 + reg32); + put8(imm8); +} + +static inline void cmp_reg64_imm8(int reg64, unsigned char imm8) +{ + put8(0x48); + put8(0x83); + put8(0xF8 + reg64); + put8(imm8); +} + +static inline void cmp_reg32_imm32(int reg32, unsigned int imm32) +{ + put8(0x81); + put8(0xF8 + reg32); + put32(imm32); +} + +static inline void cmp_reg64_imm32(int reg64, unsigned int imm32) +{ + put8(0x48); + put8(0x81); + put8(0xF8 + reg64); + put32(imm32); +} + +static inline void cmp_preg64preg64_imm8(int reg1, int reg2, unsigned char imm8) +{ + put8(0x80); + put8(0x3C); + put8((reg1 << 3) | reg2); + put8(imm8); +} + +static inline void sete_m8rel(unsigned char *m8) +{ + int offset = rel_r15_offset(m8, "sete_m8rel"); + + put8(0x41); + put8(0x0F); + put8(0x94); + put8(0x87); + put32(offset); +} + +static inline void setne_m8rel(unsigned char *m8) +{ + int offset = rel_r15_offset(m8, "setne_m8rel"); + + put8(0x41); + put8(0x0F); + put8(0x95); + put8(0x87); + put32(offset); +} + +static inline void setl_m8rel(unsigned char *m8) +{ + int offset = rel_r15_offset(m8, "setl_m8rel"); + + put8(0x41); + put8(0x0F); + put8(0x9C); + put8(0x87); + put32(offset); +} + +static inline void setle_m8rel(unsigned char *m8) +{ + int offset = rel_r15_offset(m8, "setle_m8rel"); + + put8(0x41); + put8(0x0F); + put8(0x9E); + put8(0x87); + put32(offset); +} + +static inline void setg_m8rel(unsigned char *m8) +{ + int offset = rel_r15_offset(m8, "setg_m8rel"); + + put8(0x41); + put8(0x0F); + put8(0x9F); + put8(0x87); + put32(offset); +} + +static inline void setge_m8rel(unsigned char *m8) +{ + int offset = rel_r15_offset(m8, "setge_m8rel"); + + put8(0x41); + put8(0x0F); + put8(0x9D); + put8(0x87); + put32(offset); +} + +static inline void setl_reg8(unsigned int reg8) +{ + put8(0x40); /* we need an REX prefix to use the uniform byte registers */ + put8(0x0F); + put8(0x9C); + put8(0xC0 | reg8); +} + +static inline void setb_reg8(unsigned int reg8) +{ + put8(0x40); /* we need an REX prefix to use the uniform byte registers */ + put8(0x0F); + put8(0x92); + put8(0xC0 | reg8); +} + +static inline void test_m32rel_imm32(unsigned int *m32, unsigned int imm32) +{ + int offset = rel_r15_offset(m32, "test_m32rel_imm32"); + + put8(0x41); + put8(0xF7); + put8(0x87); + put32(offset); + put32(imm32); +} + +static inline void add_m32rel_xreg32(unsigned int *m32, int xreg32) +{ + int offset = rel_r15_offset(m32, "add_m32rel_xreg32"); + + put8(0x41 | ((xreg32 & 8) >> 1)); + put8(0x01); + put8(0x87 | ((xreg32 & 7) << 3)); + put32(offset); +} + +static inline void sub_xreg32_m32rel(int xreg32, unsigned int *m32) +{ + int offset = rel_r15_offset(m32, "sub_xreg32_m32rel"); + + put8(0x41 | ((xreg32 & 8) >> 1)); + put8(0x2B); + put8(0x87 | ((xreg32 & 7) << 3)); + put32(offset); +} + +static inline void sub_reg32_reg32(int reg1, int reg2) +{ + put8(0x29); + put8((reg2 << 3) | reg1 | 0xC0); +} + +static inline void sub_reg64_reg64(int reg1, int reg2) +{ + put8(0x48); + put8(0x29); + put8((reg2 << 3) | reg1 | 0xC0); +} + +static inline void sub_reg64_imm32(int reg64, unsigned int imm32) +{ + put8(0x48); + put8(0x81); + put8(0xE8 + reg64); + put32(imm32); +} + +static inline void sub_eax_imm32(unsigned int imm32) +{ + put8(0x2D); + put32(imm32); +} + +static inline void jne_rj(unsigned char saut) +{ + put8(0x75); + put8(saut); +} + +static inline void je_rj(unsigned char saut) +{ + put8(0x74); + put8(saut); +} + +static inline void jbe_rj(unsigned char saut) +{ + put8(0x76); + put8(saut); +} + +static inline void ja_rj(unsigned char saut) +{ + put8(0x77); + put8(saut); +} + +static inline void jae_rj(unsigned char saut) +{ + put8(0x73); + put8(saut); +} + +static inline void jp_rj(unsigned char saut) +{ + put8(0x7A); + put8(saut); +} + +static inline void je_near_rj(unsigned int saut) +{ + put8(0x0F); + put8(0x84); + put32(saut); +} + +static inline void mov_reg32_imm32(int reg32, unsigned int imm32) +{ + put8(0xB8+reg32); + put32(imm32); +} + +static inline void mov_reg64_imm64(int reg64, unsigned long long imm64) +{ + put8(0x48); + put8(0xB8+reg64); + put64(imm64); +} + +static inline void jmp_imm_short(char saut) +{ + put8(0xEB); + put8(saut); +} + +static inline void or_m32rel_imm32(unsigned int *m32, unsigned int imm32) +{ + int offset = rel_r15_offset(m32, "or_m32rel_imm32"); + + put8(0x41); + put8(0x81); + put8(0x8F); + put32(offset); + put32(imm32); +} + +static inline void or_reg64_reg64(unsigned int reg1, unsigned int reg2) +{ + put8(0x48); + put8(0x09); + put8(0xC0 | (reg2 << 3) | reg1); +} + +static inline void and_reg64_reg64(unsigned int reg1, unsigned int reg2) +{ + put8(0x48); + put8(0x21); + put8(0xC0 | (reg2 << 3) | reg1); +} + +static inline void and_m32rel_imm32(unsigned int *m32, unsigned int imm32) +{ + int offset = rel_r15_offset(m32, "and_m32rel_imm32"); + + put8(0x41); + put8(0x81); + put8(0xA7); + put32(offset); + put32(imm32); +} + +static inline void xor_reg32_reg32(unsigned int reg1, unsigned int reg2) +{ + put8(0x31); + put8(0xC0 | (reg2 << 3) | reg1); +} + +static inline void xor_reg64_reg64(unsigned int reg1, unsigned int reg2) +{ + put8(0x48); + put8(0x31); + put8(0xC0 | (reg2 << 3) | reg1); +} + +static inline void add_reg64_imm32(unsigned int reg64, unsigned int imm32) +{ + put8(0x48); + put8(0x81); + put8(0xC0+reg64); + put32(imm32); +} + +static inline void add_reg32_imm32(unsigned int reg32, unsigned int imm32) +{ + put8(0x81); + put8(0xC0+reg32); + put32(imm32); +} + +static inline void inc_m32rel(unsigned int *m32) +{ + int offset = rel_r15_offset(m32, "inc_m32rel"); + + put8(0x41); + put8(0xFF); + put8(0x87); + put32(offset); +} + +static inline void cmp_m32rel_imm32(unsigned int *m32, unsigned int imm32) +{ + int offset = rel_r15_offset(m32, "cmp_m32rel_imm32"); + + put8(0x41); + put8(0x81); + put8(0xBF); + put32(offset); + put32(imm32); +} + +static inline void cmp_eax_imm32(unsigned int imm32) +{ + put8(0x3D); + put32(imm32); +} + +static inline void mov_m32rel_imm32(unsigned int *m32, unsigned int imm32) +{ + int offset = rel_r15_offset(m32, "mov_m32rel_imm32"); + + put8(0x41); + put8(0xC7); + put8(0x87); + put32(offset); + put32(imm32); +} + +static inline void jmp(unsigned int mi_addr) +{ + put8(0xFF); + put8(0x25); + put32(0); + put64(0); + add_jump(code_length-8, mi_addr, 1); +} + +static inline void cdq(void) +{ + put8(0x99); +} + +static inline void call_reg64(unsigned int reg64) +{ + put8(0xFF); + put8(0xD0+reg64); +} + +static inline void shr_reg64_imm8(unsigned int reg64, unsigned char imm8) +{ + put8(0x48); + put8(0xC1); + put8(0xE8+reg64); + put8(imm8); +} + +static inline void shr_reg32_imm8(unsigned int reg32, unsigned char imm8) +{ + put8(0xC1); + put8(0xE8+reg32); + put8(imm8); +} + +static inline void shr_reg32_cl(unsigned int reg32) +{ + put8(0xD3); + put8(0xE8+reg32); +} + +static inline void shr_reg64_cl(unsigned int reg64) +{ + put8(0x48); + put8(0xD3); + put8(0xE8+reg64); +} + +static inline void sar_reg32_cl(unsigned int reg32) +{ + put8(0xD3); + put8(0xF8+reg32); +} + +static inline void sar_reg64_cl(unsigned int reg64) +{ + put8(0x48); + put8(0xD3); + put8(0xF8+reg64); +} + +static inline void shl_reg32_cl(unsigned int reg32) +{ + put8(0xD3); + put8(0xE0+reg32); +} + +static inline void shl_reg64_cl(unsigned int reg64) +{ + put8(0x48); + put8(0xD3); + put8(0xE0+reg64); +} + +static inline void sar_reg32_imm8(unsigned int reg32, unsigned char imm8) +{ + put8(0xC1); + put8(0xF8+reg32); + put8(imm8); +} + +static inline void sar_reg64_imm8(unsigned int reg64, unsigned char imm8) +{ + put8(0x48); + put8(0xC1); + put8(0xF8+reg64); + put8(imm8); +} + +static inline void mul_m32rel(unsigned int *m32) +{ + int offset = rel_r15_offset(m32, "mul_m32rel"); + + put8(0x41); + put8(0xF7); + put8(0xA7); + put32(offset); +} + +static inline void imul_reg32(unsigned int reg32) +{ + put8(0xF7); + put8(0xE8+reg32); +} + +static inline void mul_reg64(unsigned int reg64) +{ + put8(0x48); + put8(0xF7); + put8(0xE0+reg64); +} + +static inline void mul_reg32(unsigned int reg32) +{ + put8(0xF7); + put8(0xE0+reg32); +} + +static inline void idiv_reg32(unsigned int reg32) +{ + put8(0xF7); + put8(0xF8+reg32); +} + +static inline void div_reg32(unsigned int reg32) +{ + put8(0xF7); + put8(0xF0+reg32); +} + +static inline void add_reg32_reg32(unsigned int reg1, unsigned int reg2) +{ + put8(0x01); + put8(0xC0 | (reg2 << 3) | reg1); +} + +static inline void add_reg64_reg64(unsigned int reg1, unsigned int reg2) +{ + put8(0x48); + put8(0x01); + put8(0xC0 | (reg2 << 3) | reg1); +} + +static inline void jmp_reg64(unsigned int reg64) +{ + put8(0xFF); + put8(0xE0 + reg64); +} + +static inline void mov_reg32_preg64(unsigned int reg1, unsigned int reg2) +{ + put8(0x8B); + put8((reg1 << 3) | reg2); +} + +static inline void mov_preg64_reg32(int reg1, int reg2) +{ + put8(0x89); + put8((reg2 << 3) | reg1); +} + +static inline void mov_reg64_preg64(int reg1, int reg2) +{ + put8(0x48); + put8(0x8B); + put8((reg1 << 3) | reg2); +} + +static inline void mov_reg32_preg64preg64pimm32(int reg1, int reg2, int reg3, unsigned int imm32) +{ + put8(0x8B); + put8((reg1 << 3) | 0x84); + put8(reg2 | (reg3 << 3)); + put32(imm32); +} + +static inline void mov_preg64preg64pimm32_reg32(int reg1, int reg2, unsigned int imm32, int reg3) +{ + put8(0x89); + put8((reg3 << 3) | 0x84); + put8(reg1 | (reg2 << 3)); + put32(imm32); +} + +static inline void mov_reg64_preg64preg64pimm32(int reg1, int reg2, int reg3, unsigned int imm32) +{ + put8(0x48); + put8(0x8B); + put8((reg1 << 3) | 0x84); + put8(reg2 | (reg3 << 3)); + put32(imm32); +} + +static inline void mov_reg32_preg64preg64(int reg1, int reg2, int reg3) +{ + put8(0x8B); + put8((reg1 << 3) | 0x04); + put8((reg2 << 3) | reg3); +} + +static inline void mov_reg64_preg64preg64(int reg1, int reg2, int reg3) +{ + put8(0x48); + put8(0x8B); + put8((reg1 << 3) | 0x04); + put8(reg2 | (reg3 << 3)); +} + +static inline void mov_reg32_preg64pimm32(int reg1, int reg2, unsigned int imm32) +{ + put8(0x8B); + put8(0x80 | (reg1 << 3) | reg2); + put32(imm32); +} + +static inline void mov_reg64_preg64pimm32(int reg1, int reg2, unsigned int imm32) +{ + put8(0x48); + put8(0x8B); + put8(0x80 | (reg1 << 3) | reg2); + put32(imm32); +} + +static inline void mov_reg64_preg64pimm8(int reg1, int reg2, unsigned int imm8) +{ + put8(0x48); + put8(0x8B); + put8(0x40 | (reg1 << 3) | reg2); + put8(imm8); +} + +static inline void mov_reg64_preg64x8preg64(int reg1, int reg2, int reg3) +{ + put8(0x48); + put8(0x8B); + put8((reg1 << 3) | 4); + put8(0xC0 | (reg2 << 3) | reg3); +} + +static inline void mov_preg64preg64_reg8(int reg1, int reg2, int reg8) +{ + put8(0x88); + put8(0x04 | (reg8 << 3)); + put8((reg1 << 3) | reg2); +} + +static inline void mov_preg64preg64_imm8(int reg1, int reg2, unsigned char imm8) +{ + put8(0xC6); + put8(0x04); + put8((reg1 << 3) | reg2); + put8(imm8); +} + +static inline void mov_preg64preg64_reg16(int reg1, int reg2, int reg16) +{ + put8(0x66); + put8(0x89); + put8(0x04 | (reg16 << 3)); + put8((reg1 << 3) | reg2); +} + +static inline void mov_preg64preg64_reg32(int reg1, int reg2, int reg32) +{ + put8(0x89); + put8(0x04 | (reg32 << 3)); + put8((reg1 << 3) | reg2); +} + +static inline void mov_preg64pimm32_reg32(int reg1, unsigned int imm32, int reg2) +{ + put8(0x89); + put8(0x80 | reg1 | (reg2 << 3)); + put32(imm32); +} + +static inline void mov_preg64pimm8_reg64(int reg1, unsigned int imm8, int reg2) +{ + put8(0x48); + put8(0x89); + put8(0x40 | (reg2 << 3) | reg1); + put8(imm8); +} + +static inline void add_eax_imm32(unsigned int imm32) +{ + put8(0x05); + put32(imm32); +} + +static inline void shl_reg32_imm8(unsigned int reg32, unsigned char imm8) +{ + put8(0xC1); + put8(0xE0 + reg32); + put8(imm8); +} + +static inline void shl_reg64_imm8(unsigned int reg64, unsigned char imm8) +{ + put8(0x48); + put8(0xC1); + put8(0xE0 + reg64); + put8(imm8); +} + +static inline void mov_reg32_reg32(unsigned int reg1, unsigned int reg2) +{ + if (reg1 == reg2) return; + put8(0x89); + put8(0xC0 | (reg2 << 3) | reg1); +} + +static inline void mov_reg64_reg64(unsigned int reg1, unsigned int reg2) +{ + if (reg1 == reg2) return; + put8(0x48); + put8(0x89); + put8(0xC0 | (reg2 << 3) | reg1); +} + +static inline void mov_xreg32_m32rel(unsigned int xreg32, unsigned int *m32) +{ + int offset = rel_r15_offset(m32, "mov_xreg32_m32rel"); + + put8(0x41 | ((xreg32 & 8) >> 1)); + put8(0x8B); + put8(0x87 | ((xreg32 & 7) << 3)); + put32(offset); +} + +static inline void mov_m32rel_xreg32(unsigned int *m32, unsigned int xreg32) +{ + int offset = rel_r15_offset(m32, "mov_m32rel_xreg32"); + + put8(0x41 | ((xreg32 & 8) >> 1)); + put8(0x89); + put8(0x87 | ((xreg32 & 7) << 3)); + put32(offset); +} + +static inline void mov_xreg64_m64rel(unsigned int xreg64, unsigned long long* m64) +{ + int offset = rel_r15_offset(m64, "mov_xreg64_m64rel"); + + put8(0x49 | ((xreg64 & 8) >> 1)); + put8(0x8B); + put8(0x87 | ((xreg64 & 7) << 3)); + put32(offset); +} + +static inline void mov_m64rel_xreg64(unsigned long long *m64, unsigned int xreg64) +{ + int offset = rel_r15_offset(m64, "mov_m64rel_xreg64"); + + put8(0x49 | ((xreg64 & 8) >> 1)); + put8(0x89); + put8(0x87 | ((xreg64 & 7) << 3)); + put32(offset); +} + +static inline void mov_xreg8_m8rel(int xreg8, unsigned char *m8) +{ + int offset = rel_r15_offset(m8, "mov_xreg8_m8rel"); + + put8(0x41 | ((xreg8 & 8) >> 1)); + put8(0x8A); + put8(0x87 | ((xreg8 & 7) << 3)); + put32(offset); +} + +static inline void and_eax_imm32(unsigned int imm32) +{ + put8(0x25); + put32(imm32); +} + +static inline void or_reg64_imm32(int reg64, unsigned int imm32) +{ + put8(0x48); + put8(0x81); + put8(0xC8 + reg64); + put32(imm32); +} + +static inline void and_reg32_imm32(int reg32, unsigned int imm32) +{ + put8(0x81); + put8(0xE0 + reg32); + put32(imm32); +} + +static inline void and_reg64_imm32(int reg64, unsigned int imm32) +{ + put8(0x48); + put8(0x81); + put8(0xE0 + reg64); + put32(imm32); +} + +static inline void and_reg64_imm8(int reg64, unsigned char imm8) +{ + put8(0x48); + put8(0x83); + put8(0xE0 + reg64); + put8(imm8); +} + +static inline void xor_reg64_imm32(int reg64, unsigned int imm32) +{ + put8(0x48); + put8(0x81); + put8(0xF0 + reg64); + put32(imm32); +} + +static inline void xor_reg8_imm8(int reg8, unsigned char imm8) +{ + put8(0x40); /* we need an REX prefix to use the uniform byte registers */ + put8(0x80); + put8(0xF0 + reg8); + put8(imm8); +} + +static inline void not_reg64(unsigned int reg64) +{ + put8(0x48); + put8(0xF7); + put8(0xD0 + reg64); +} + +static inline void neg_reg32(unsigned int reg32) +{ + put8(0xF7); + put8(0xD8 + reg32); +} + +static inline void neg_reg64(unsigned int reg64) +{ + put8(0x48); + put8(0xF7); + put8(0xD8 + reg64); +} + +static inline void movsx_xreg32_m8rel(int xreg32, unsigned char *m8) +{ + int offset = rel_r15_offset(m8, "movsx_xreg32_m8rel"); + + put8(0x41 | ((xreg32 & 8) >> 1)); + put8(0x0F); + put8(0xBE); + put8(0x87 | ((xreg32 & 7) << 3)); + put32(offset); +} + +static inline void movsx_reg32_8preg64preg64(int reg1, int reg2, int reg3) +{ + put8(0x0F); + put8(0xBE); + put8((reg1 << 3) | 0x04); + put8((reg2 << 3) | reg3); +} + +static inline void movsx_reg32_16preg64preg64(int reg1, int reg2, int reg3) +{ + put8(0x0F); + put8(0xBF); + put8((reg1 << 3) | 0x04); + put8((reg2 << 3) | reg3); +} + +static inline void movsx_xreg32_m16rel(int xreg32, unsigned short *m16) +{ + int offset = rel_r15_offset(m16, "movsx_xreg32_m16rel"); + + put8(0x41 | ((xreg32 & 8) >> 1)); + put8(0x0F); + put8(0xBF); + put8(0x87 | ((xreg32 & 7) << 3)); + put32(offset); +} + +static inline void movsxd_reg64_reg32(int reg64, int reg32) +{ + put8(0x48); + put8(0x63); + put8((reg64 << 3) | reg32 | 0xC0); +} + +static inline void fldcw_m16rel(unsigned short *m16) +{ + int offset = rel_r15_offset(m16, "fldcw_m16rel"); + + put8(0x41); + put8(0xD9); + put8(0xAF); + put32(offset); +} + +static inline void fld_preg64_dword(int reg64) +{ + put8(0xD9); + put8(reg64); +} + +static inline void fdiv_preg64_dword(int reg64) +{ + put8(0xD8); + put8(0x30 + reg64); +} + +static inline void fstp_preg64_dword(int reg64) +{ + put8(0xD9); + put8(0x18 + reg64); +} + +static inline void fchs(void) +{ + put8(0xD9); + put8(0xE0); +} + +static inline void fstp_preg64_qword(int reg64) +{ + put8(0xDD); + put8(0x18 + reg64); +} + +static inline void fadd_preg64_dword(int reg64) +{ + put8(0xD8); + put8(reg64); +} + +static inline void fsub_preg64_dword(int reg64) +{ + put8(0xD8); + put8(0x20 + reg64); +} + +static inline void fmul_preg64_dword(int reg64) +{ + put8(0xD8); + put8(0x08 + reg64); +} + +static inline void fistp_preg64_dword(int reg64) +{ + put8(0xDB); + put8(0x18 + reg64); +} + +static inline void fistp_preg64_qword(int reg64) +{ + put8(0xDF); + put8(0x38 + reg64); +} + +static inline void fld_preg64_qword(int reg64) +{ + put8(0xDD); + put8(reg64); +} + +static inline void fild_preg64_qword(int reg64) +{ + put8(0xDF); + put8(0x28+reg64); +} + +static inline void fild_preg64_dword(int reg64) +{ + put8(0xDB); + put8(reg64); +} + +static inline void fadd_preg64_qword(int reg64) +{ + put8(0xDC); + put8(reg64); +} + +static inline void fdiv_preg64_qword(int reg64) +{ + put8(0xDC); + put8(0x30 + reg64); +} + +static inline void fsub_preg64_qword(int reg64) +{ + put8(0xDC); + put8(0x20 + reg64); +} + +static inline void fmul_preg64_qword(int reg64) +{ + put8(0xDC); + put8(0x08 + reg64); +} + +static inline void fsqrt(void) +{ + put8(0xD9); + put8(0xFA); +} + +static inline void fabs_(void) +{ + put8(0xD9); + put8(0xE1); +} + +static inline void fcomip_fpreg(int fpreg) +{ + put8(0xDF); + put8(0xF0 + fpreg); +} + +static inline void fucomip_fpreg(int fpreg) +{ + put8(0xDF); + put8(0xE8 + fpreg); +} + +static inline void ffree_fpreg(int fpreg) +{ + put8(0xDD); + put8(0xC0 + fpreg); +} + +#endif /* __ASSEMBLE_H__ */ + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86_64/assemble_struct.h b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/assemble_struct.h new file mode 100644 index 0000000000..12bb9b814a --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/assemble_struct.h @@ -0,0 +1,34 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - assemble_struct.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2007 Richard Goedeken (Richard42) * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __ASSEMBLE_STRUCT_H__ +#define __ASSEMBLE_STRUCT_H__ + +typedef struct _reg_cache_struct +{ + int need_map; + void *needed_registers[8]; + unsigned char jump_wrapper[84]; + int need_cop1_check; +} reg_cache_struct; + +#endif /* __ASSEMBLE_STRUCT_H__ */ diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gbc.c b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gbc.c new file mode 100644 index 0000000000..1b032cf771 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gbc.c @@ -0,0 +1,295 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - gbc.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2007 Richard Goedeken (Richard42) * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "assemble.h" +#include "interpret.h" + +#include "r4300/recomph.h" +#include "r4300/r4300.h" +#include "r4300/ops.h" + +static void genbc1f_test(void) +{ + test_m32rel_imm32((unsigned int*)&FCR31, 0x800000); + sete_m8rel((unsigned char *) &branch_taken); +} + +void genbc1f(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[100]); +#endif +#ifdef INTERPRET_BC1F + gencallinterp((unsigned long long)cached_interpreter_table.BC1F, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BC1F, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1f_test(); + gendelayslot(); + gentest(); +#endif +} + +void genbc1f_out(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[100]); +#endif +#ifdef INTERPRET_BC1F_OUT + gencallinterp((unsigned long long)cached_interpreter_table.BC1F_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BC1F_OUT, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1f_test(); + gendelayslot(); + gentest_out(); +#endif +} + +void genbc1f_idle(void) +{ +#ifdef INTERPRET_BC1F_IDLE + gencallinterp((unsigned long long)cached_interpreter_table.BC1F_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BC1F_IDLE, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1f_test(); + gentest_idle(); + genbc1f(); +#endif +} + +static void genbc1t_test(void) +{ + test_m32rel_imm32((unsigned int*)&FCR31, 0x800000); + setne_m8rel((unsigned char *) &branch_taken); +} + +void genbc1t(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[101]); +#endif +#ifdef INTERPRET_BC1T + gencallinterp((unsigned long long)cached_interpreter_table.BC1T, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BC1T, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1t_test(); + gendelayslot(); + gentest(); +#endif +} + +void genbc1t_out(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[101]); +#endif +#ifdef INTERPRET_BC1T_OUT + gencallinterp((unsigned long long)cached_interpreter_table.BC1T_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BC1T_OUT, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1t_test(); + gendelayslot(); + gentest_out(); +#endif +} + +void genbc1t_idle(void) +{ +#ifdef INTERPRET_BC1T_IDLE + gencallinterp((unsigned long long)cached_interpreter_table.BC1T_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BC1T_IDLE, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1t_test(); + gentest_idle(); + genbc1t(); +#endif +} + +void genbc1fl(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[102]); +#endif +#ifdef INTERPRET_BC1FL + gencallinterp((unsigned long long)cached_interpreter_table.BC1FL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BC1FL, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1f_test(); + free_all_registers(); + gentestl(); +#endif +} + +void genbc1fl_out(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[102]); +#endif +#ifdef INTERPRET_BC1FL_OUT + gencallinterp((unsigned long long)cached_interpreter_table.BC1FL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BC1FL_OUT, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1f_test(); + free_all_registers(); + gentestl_out(); +#endif +} + +void genbc1fl_idle(void) +{ +#ifdef INTERPRET_BC1FL_IDLE + gencallinterp((unsigned long long)cached_interpreter_table.BC1FL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BC1FL_IDLE, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1f_test(); + gentest_idle(); + genbc1fl(); +#endif +} + +void genbc1tl(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[103]); +#endif +#ifdef INTERPRET_BC1TL + gencallinterp((unsigned long long)cached_interpreter_table.BC1TL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BC1TL, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1t_test(); + free_all_registers(); + gentestl(); +#endif +} + +void genbc1tl_out(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[103]); +#endif +#ifdef INTERPRET_BC1TL_OUT + gencallinterp((unsigned long long)cached_interpreter_table.BC1TL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BC1TL_OUT, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1t_test(); + free_all_registers(); + gentestl_out(); +#endif +} + +void genbc1tl_idle(void) +{ +#ifdef INTERPRET_BC1TL_IDLE + gencallinterp((unsigned long long)cached_interpreter_table.BC1TL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BC1TL_IDLE, 1); + return; + } + + gencheck_cop1_unusable(); + genbc1t_test(); + gentest_idle(); + genbc1tl(); +#endif +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gcop0.c b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gcop0.c new file mode 100644 index 0000000000..7244da0087 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gcop0.c @@ -0,0 +1,47 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - gcop0.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2007 Richard Goedeken (Richard42) * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "assemble.h" + +#include "r4300/recomp.h" +#include "r4300/recomph.h" +#include "r4300/r4300.h" +#include "r4300/ops.h" + +void genmfc0(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[109]); +#endif + gencallinterp((unsigned long long)cached_interpreter_table.MFC0, 0); +} + +void genmtc0(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[110]); +#endif + gencallinterp((unsigned long long)cached_interpreter_table.MTC0, 0); +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gcop1.c b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gcop1.c new file mode 100644 index 0000000000..8ec5623c50 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gcop1.c @@ -0,0 +1,154 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - gcop1.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2007 Richard Goedeken (Richard42) * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "assemble.h" +#include "interpret.h" + +#include "r4300/recomph.h" +#include "r4300/recomp.h" +#include "r4300/r4300.h" +#include "r4300/ops.h" +#include "r4300/macros.h" + +#include "memory/memory.h" + +void genmfc1(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[111]); +#endif +#ifdef INTERPRET_MFC1 + gencallinterp((unsigned long long)cached_interpreter_table.MFC1, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.r.nrd])); + mov_reg32_preg64(EBX, RAX); + mov_m32rel_xreg32((unsigned int*)dst->f.r.rt, EBX); + sar_reg32_imm8(EBX, 31); + mov_m32rel_xreg32(((unsigned int*)dst->f.r.rt)+1, EBX); +#endif +} + +void gendmfc1(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[112]); +#endif +#ifdef INTERPRET_DMFC1 + gencallinterp((unsigned long long)cached_interpreter_table.DMFC1, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *) (®_cop1_double[dst->f.r.nrd])); + mov_reg32_preg64(EBX, RAX); + mov_reg32_preg64pimm32(ECX, RAX, 4); + mov_m32rel_xreg32((unsigned int*)dst->f.r.rt, EBX); + mov_m32rel_xreg32(((unsigned int*)dst->f.r.rt)+1, ECX); +#endif +} + +void gencfc1(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[113]); +#endif +#ifdef INTERPRET_CFC1 + gencallinterp((unsigned long long)cached_interpreter_table.CFC1, 0); +#else + gencheck_cop1_unusable(); + if(dst->f.r.nrd == 31) mov_xreg32_m32rel(EAX, (unsigned int*)&FCR31); + else mov_xreg32_m32rel(EAX, (unsigned int*)&FCR0); + mov_m32rel_xreg32((unsigned int*)dst->f.r.rt, EAX); + sar_reg32_imm8(EAX, 31); + mov_m32rel_xreg32(((unsigned int*)dst->f.r.rt)+1, EAX); +#endif +} + +void genmtc1(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[114]); +#endif +#ifdef INTERPRET_MTC1 + gencallinterp((unsigned long long)cached_interpreter_table.MTC1, 0); +#else + gencheck_cop1_unusable(); + mov_xreg32_m32rel(EAX, (unsigned int*)dst->f.r.rt); + mov_xreg64_m64rel(RBX, (unsigned long long *)(®_cop1_simple[dst->f.r.nrd])); + mov_preg64_reg32(RBX, EAX); +#endif +} + +void gendmtc1(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[115]); +#endif +#ifdef INTERPRET_DMTC1 + gencallinterp((unsigned long long)cached_interpreter_table.DMTC1, 0); +#else + gencheck_cop1_unusable(); + mov_xreg32_m32rel(EAX, (unsigned int*)dst->f.r.rt); + mov_xreg32_m32rel(EBX, ((unsigned int*)dst->f.r.rt)+1); + mov_xreg64_m64rel(RDX, (unsigned long long *)(®_cop1_double[dst->f.r.nrd])); + mov_preg64_reg32(RDX, EAX); + mov_preg64pimm32_reg32(RDX, 4, EBX); +#endif +} + +void genctc1(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[116]); +#endif +#ifdef INTERPRET_CTC1 + gencallinterp((unsigned long long)cached_interpreter_table.CTC1, 0); +#else + gencheck_cop1_unusable(); + + if (dst->f.r.nrd != 31) return; + mov_xreg32_m32rel(EAX, (unsigned int*)dst->f.r.rt); + mov_m32rel_xreg32((unsigned int*)&FCR31, EAX); + and_eax_imm32(3); + + cmp_eax_imm32(0); + jne_rj(13); + mov_m32rel_imm32((unsigned int*)&rounding_mode, 0x33F); // 11 + jmp_imm_short(51); // 2 + + cmp_eax_imm32(1); // 5 + jne_rj(13); // 2 + mov_m32rel_imm32((unsigned int*)&rounding_mode, 0xF3F); // 11 + jmp_imm_short(31); // 2 + + cmp_eax_imm32(2); // 5 + jne_rj(13); // 2 + mov_m32rel_imm32((unsigned int*)&rounding_mode, 0xB3F); // 11 + jmp_imm_short(11); // 2 + + mov_m32rel_imm32((unsigned int*)&rounding_mode, 0x73F); // 11 + + fldcw_m16rel((unsigned short*)&rounding_mode); +#endif +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gcop1_d.c b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gcop1_d.c new file mode 100644 index 0000000000..3d9653eede --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gcop1_d.c @@ -0,0 +1,710 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - gcop1_d.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2007 Richard Goedeken (Richard42) * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "assemble.h" +#include "interpret.h" + +#include "r4300/recomph.h" +#include "r4300/r4300.h" +#include "r4300/ops.h" + +void genadd_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[119]); +#endif +#ifdef INTERPRET_ADD_D + gencallinterp((unsigned long long)cached_interpreter_table.ADD_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.ft])); + fadd_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fd])); + fstp_preg64_qword(RAX); +#endif +} + +void gensub_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[120]); +#endif +#ifdef INTERPRET_SUB_D + gencallinterp((unsigned long long)cached_interpreter_table.SUB_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.ft])); + fsub_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fd])); + fstp_preg64_qword(RAX); +#endif +} + +void genmul_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[121]); +#endif +#ifdef INTERPRET_MUL_D + gencallinterp((unsigned long long)cached_interpreter_table.MUL_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.ft])); + fmul_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fd])); + fstp_preg64_qword(RAX); +#endif +} + +void gendiv_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[122]); +#endif +#ifdef INTERPRET_DIV_D + gencallinterp((unsigned long long)cached_interpreter_table.DIV_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.ft])); + fdiv_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fd])); + fstp_preg64_qword(RAX); +#endif +} + +void gensqrt_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[123]); +#endif +#ifdef INTERPRET_SQRT_D + gencallinterp((unsigned long long)cached_interpreter_table.SQRT_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + fsqrt(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fd])); + fstp_preg64_qword(RAX); +#endif +} + +void genabs_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[124]); +#endif +#ifdef INTERPRET_ABS_D + gencallinterp((unsigned long long)cached_interpreter_table.ABS_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + fabs_(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fd])); + fstp_preg64_qword(RAX); +#endif +} + +void genmov_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[125]); +#endif +#ifdef INTERPRET_MOV_D + gencallinterp((unsigned long long)cached_interpreter_table.MOV_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + mov_reg32_preg64(EBX, RAX); + mov_reg32_preg64pimm32(ECX, RAX, 4); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fd])); + mov_preg64_reg32(RAX, EBX); + mov_preg64pimm32_reg32(RAX, 4, ECX); +#endif +} + +void genneg_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[126]); +#endif +#ifdef INTERPRET_NEG_D + gencallinterp((unsigned long long)cached_interpreter_table.NEG_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + fchs(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fd])); + fstp_preg64_qword(RAX); +#endif +} + +void genround_l_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[127]); +#endif +#ifdef INTERPRET_ROUND_L_D + gencallinterp((unsigned long long)cached_interpreter_table.ROUND_L_D, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16rel((unsigned short*)&round_mode); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fd])); + fistp_preg64_qword(RAX); + fldcw_m16rel((unsigned short*)&rounding_mode); +#endif +} + +void gentrunc_l_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[128]); +#endif +#ifdef INTERPRET_TRUNC_L_D + gencallinterp((unsigned long long)cached_interpreter_table.TRUNC_L_D, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16rel((unsigned short*)&trunc_mode); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fd])); + fistp_preg64_qword(RAX); + fldcw_m16rel((unsigned short*)&rounding_mode); +#endif +} + +void genceil_l_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[129]); +#endif +#ifdef INTERPRET_CEIL_L_D + gencallinterp((unsigned long long)cached_interpreter_table.CEIL_L_D, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16rel((unsigned short*)&ceil_mode); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fd])); + fistp_preg64_qword(RAX); + fldcw_m16rel((unsigned short*)&rounding_mode); +#endif +} + +void genfloor_l_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[130]); +#endif +#ifdef INTERPRET_FLOOR_L_D + gencallinterp((unsigned long long)cached_interpreter_table.FLOOR_L_D, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16rel((unsigned short*)&floor_mode); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fd])); + fistp_preg64_qword(RAX); + fldcw_m16rel((unsigned short*)&rounding_mode); +#endif +} + +void genround_w_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[127]); +#endif +#ifdef INTERPRET_ROUND_W_D + gencallinterp((unsigned long long)cached_interpreter_table.ROUND_W_D, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16rel((unsigned short*)&round_mode); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fd])); + fistp_preg64_dword(RAX); + fldcw_m16rel((unsigned short*)&rounding_mode); +#endif +} + +void gentrunc_w_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[128]); +#endif +#ifdef INTERPRET_TRUNC_W_D + gencallinterp((unsigned long long)cached_interpreter_table.TRUNC_W_D, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16rel((unsigned short*)&trunc_mode); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fd])); + fistp_preg64_dword(RAX); + fldcw_m16rel((unsigned short*)&rounding_mode); +#endif +} + +void genceil_w_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[129]); +#endif +#ifdef INTERPRET_CEIL_W_D + gencallinterp((unsigned long long)cached_interpreter_table.CEIL_W_D, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16rel((unsigned short*)&ceil_mode); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fd])); + fistp_preg64_dword(RAX); + fldcw_m16rel((unsigned short*)&rounding_mode); +#endif +} + +void genfloor_w_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[130]); +#endif +#ifdef INTERPRET_FLOOR_W_D + gencallinterp((unsigned long long)cached_interpreter_table.FLOOR_W_D, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16rel((unsigned short*)&floor_mode); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fd])); + fistp_preg64_dword(RAX); + fldcw_m16rel((unsigned short*)&rounding_mode); +#endif +} + +void gencvt_s_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[117]); +#endif +#ifdef INTERPRET_CVT_S_D + gencallinterp((unsigned long long)cached_interpreter_table.CVT_S_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fd])); + fstp_preg64_dword(RAX); +#endif +} + +void gencvt_w_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[117]); +#endif +#ifdef INTERPRET_CVT_W_D + gencallinterp((unsigned long long)cached_interpreter_table.CVT_W_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fd])); + fistp_preg64_dword(RAX); +#endif +} + +void gencvt_l_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[117]); +#endif +#ifdef INTERPRET_CVT_L_D + gencallinterp((unsigned long long)cached_interpreter_table.CVT_L_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fd])); + fistp_preg64_qword(RAX); +#endif +} + +void genc_f_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_F_D + gencallinterp((unsigned long long)cached_interpreter_table.C_F_D, 0); +#else + gencheck_cop1_unusable(); + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); +#endif +} + +void genc_un_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_UN_D + gencallinterp((unsigned long long)cached_interpreter_table.C_UN_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.ft])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jp_rj(13); + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 + jmp_imm_short(11); // 2 + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 +#endif +} + +void genc_eq_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_EQ_D + gencallinterp((unsigned long long)cached_interpreter_table.C_EQ_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.ft])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jne_rj(13); // 2 + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + +void genc_ueq_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_UEQ_D + gencallinterp((unsigned long long)cached_interpreter_table.C_UEQ_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.ft])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jp_rj(15); + jne_rj(13); + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + +void genc_olt_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_OLT_D + gencallinterp((unsigned long long)cached_interpreter_table.C_OLT_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.ft])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jae_rj(13); // 2 + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + +void genc_ult_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_ULT_D + gencallinterp((unsigned long long)cached_interpreter_table.C_ULT_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.ft])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jp_rj(15); + jae_rj(13); // 2 + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + +void genc_ole_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_OLE_D + gencallinterp((unsigned long long)cached_interpreter_table.C_OLE_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.ft])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + fucomip_fpreg(1); + ffree_fpreg(0); + ja_rj(13); // 2 + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + +void genc_ule_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_ULE_D + gencallinterp((unsigned long long)cached_interpreter_table.C_ULE_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.ft])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jp_rj(15); + ja_rj(13); // 2 + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + +void genc_sf_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_SF_D + gencallinterp((unsigned long long)cached_interpreter_table.C_SF_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.ft])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + fcomip_fpreg(1); + ffree_fpreg(0); + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); +#endif +} + +void genc_ngle_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_NGLE_D + gencallinterp((unsigned long long)cached_interpreter_table.C_NGLE_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.ft])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jp_rj(13); + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 + jmp_imm_short(11); // 2 + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 +#endif +} + +void genc_seq_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_SEQ_D + gencallinterp((unsigned long long)cached_interpreter_table.C_SEQ_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.ft])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jne_rj(13); // 2 + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + +void genc_ngl_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_NGL_D + gencallinterp((unsigned long long)cached_interpreter_table.C_NGL_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.ft])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jp_rj(15); + jne_rj(13); + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + +void genc_lt_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_LT_D + gencallinterp((unsigned long long)cached_interpreter_table.C_LT_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.ft])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jae_rj(13); // 2 + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + +void genc_nge_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_NGE_D + gencallinterp((unsigned long long)cached_interpreter_table.C_NGE_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.ft])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jp_rj(15); + jae_rj(13); // 2 + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + +void genc_le_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_LE_D + gencallinterp((unsigned long long)cached_interpreter_table.C_LE_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.ft])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + fcomip_fpreg(1); + ffree_fpreg(0); + ja_rj(13); // 2 + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + +void genc_ngt_d(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_NGT_D + gencallinterp((unsigned long long)cached_interpreter_table.C_NGT_D, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.ft])); + fld_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fld_preg64_qword(RAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jp_rj(15); + ja_rj(13); // 2 + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gcop1_l.c b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gcop1_l.c new file mode 100644 index 0000000000..d53afff557 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gcop1_l.c @@ -0,0 +1,61 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - g_cop1_l.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2007 Richard Goedeken (Richard42) * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "assemble.h" +#include "interpret.h" + +#include "r4300/recomph.h" +#include "r4300/r4300.h" +#include "r4300/ops.h" + +void gencvt_s_l(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[117]); +#endif +#ifdef INTERPRET_CVT_S_L + gencallinterp((unsigned long long)cached_interpreter_table.CVT_S_L, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fild_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fd])); + fstp_preg64_dword(RAX); +#endif +} + +void gencvt_d_l(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[117]); +#endif +#ifdef INTERPRET_CVT_D_L + gencallinterp((unsigned long long)cached_interpreter_table.CVT_D_L, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fs])); + fild_preg64_qword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fd])); + fstp_preg64_qword(RAX); +#endif +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gcop1_s.c b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gcop1_s.c new file mode 100644 index 0000000000..0bf5598d40 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gcop1_s.c @@ -0,0 +1,709 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - gcop1_s.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2007 Richard Goedeken (Richard42) * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "assemble.h" +#include "interpret.h" + +#include "r4300/recomph.h" +#include "r4300/r4300.h" +#include "r4300/ops.h" +#include "r4300/macros.h" + +void genadd_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[119]); +#endif +#ifdef INTERPRET_ADD_S + gencallinterp((unsigned long long)cached_interpreter_table.ADD_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.ft])); + fadd_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fd])); + fstp_preg64_dword(RAX); +#endif +} + +void gensub_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[120]); +#endif +#ifdef INTERPRET_SUB_S + gencallinterp((unsigned long long)cached_interpreter_table.SUB_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.ft])); + fsub_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fd])); + fstp_preg64_dword(RAX); +#endif +} + +void genmul_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[121]); +#endif +#ifdef INTERPRET_MUL_S + gencallinterp((unsigned long long)cached_interpreter_table.MUL_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.ft])); + fmul_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fd])); + fstp_preg64_dword(RAX); +#endif +} + +void gendiv_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[122]); +#endif +#ifdef INTERPRET_DIV_S + gencallinterp((unsigned long long)cached_interpreter_table.DIV_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.ft])); + fdiv_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fd])); + fstp_preg64_dword(RAX); +#endif +} + +void gensqrt_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[123]); +#endif +#ifdef INTERPRET_SQRT_S + gencallinterp((unsigned long long)cached_interpreter_table.SQRT_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + fsqrt(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fd])); + fstp_preg64_dword(RAX); +#endif +} + +void genabs_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[124]); +#endif +#ifdef INTERPRET_ABS_S + gencallinterp((unsigned long long)cached_interpreter_table.ABS_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + fabs_(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fd])); + fstp_preg64_dword(RAX); +#endif +} + +void genmov_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[125]); +#endif +#ifdef INTERPRET_MOV_S + gencallinterp((unsigned long long)cached_interpreter_table.MOV_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + mov_reg32_preg64(EBX, RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fd])); + mov_preg64_reg32(RAX, EBX); +#endif +} + +void genneg_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[126]); +#endif +#ifdef INTERPRET_NEG_S + gencallinterp((unsigned long long)cached_interpreter_table.NEG_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + fchs(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fd])); + fstp_preg64_dword(RAX); +#endif +} + +void genround_l_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[127]); +#endif +#ifdef INTERPRET_ROUND_L_S + gencallinterp((unsigned long long)cached_interpreter_table.ROUND_L_S, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16rel((unsigned short*)&round_mode); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fd])); + fistp_preg64_qword(RAX); + fldcw_m16rel((unsigned short*)&rounding_mode); +#endif +} + +void gentrunc_l_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[128]); +#endif +#ifdef INTERPRET_TRUNC_L_S + gencallinterp((unsigned long long)cached_interpreter_table.TRUNC_L_S, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16rel((unsigned short*)&trunc_mode); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fd])); + fistp_preg64_qword(RAX); + fldcw_m16rel((unsigned short*)&rounding_mode); +#endif +} + +void genceil_l_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[129]); +#endif +#ifdef INTERPRET_CEIL_L_S + gencallinterp((unsigned long long)cached_interpreter_table.CEIL_L_S, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16rel((unsigned short*)&ceil_mode); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fd])); + fistp_preg64_qword(RAX); + fldcw_m16rel((unsigned short*)&rounding_mode); +#endif +} + +void genfloor_l_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[130]); +#endif +#ifdef INTERPRET_FLOOR_L_S + gencallinterp((unsigned long long)cached_interpreter_table.FLOOR_L_S, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16rel((unsigned short*)&floor_mode); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fd])); + fistp_preg64_qword(RAX); + fldcw_m16rel((unsigned short*)&rounding_mode); +#endif +} + +void genround_w_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[127]); +#endif +#ifdef INTERPRET_ROUND_W_S + gencallinterp((unsigned long long)cached_interpreter_table.ROUND_W_S, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16rel((unsigned short*)&round_mode); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fd])); + fistp_preg64_dword(RAX); + fldcw_m16rel((unsigned short*)&rounding_mode); +#endif +} + +void gentrunc_w_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[128]); +#endif +#ifdef INTERPRET_TRUNC_W_S + gencallinterp((unsigned long long)cached_interpreter_table.TRUNC_W_S, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16rel((unsigned short*)&trunc_mode); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fd])); + fistp_preg64_dword(RAX); + fldcw_m16rel((unsigned short*)&rounding_mode); +#endif +} + +void genceil_w_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[129]); +#endif +#ifdef INTERPRET_CEIL_W_S + gencallinterp((unsigned long long)cached_interpreter_table.CEIL_W_S, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16rel((unsigned short*)&ceil_mode); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fd])); + fistp_preg64_dword(RAX); + fldcw_m16rel((unsigned short*)&rounding_mode); +#endif +} + +void genfloor_w_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[130]); +#endif +#ifdef INTERPRET_FLOOR_W_S + gencallinterp((unsigned long long)cached_interpreter_table.FLOOR_W_S, 0); +#else + gencheck_cop1_unusable(); + fldcw_m16rel((unsigned short*)&floor_mode); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fd])); + fistp_preg64_dword(RAX); + fldcw_m16rel((unsigned short*)&rounding_mode); +#endif +} + +void gencvt_d_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[117]); +#endif +#ifdef INTERPRET_CVT_D_S + gencallinterp((unsigned long long)cached_interpreter_table.CVT_D_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fd])); + fstp_preg64_qword(RAX); +#endif +} + +void gencvt_w_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[117]); +#endif +#ifdef INTERPRET_CVT_W_S + gencallinterp((unsigned long long)cached_interpreter_table.CVT_W_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fd])); + fistp_preg64_dword(RAX); +#endif +} + +void gencvt_l_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[117]); +#endif +#ifdef INTERPRET_CVT_L_S + gencallinterp((unsigned long long)cached_interpreter_table.CVT_L_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fd])); + fistp_preg64_qword(RAX); +#endif +} + +void genc_f_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_F_S + gencallinterp((unsigned long long)cached_interpreter_table.C_F_S, 0); +#else + gencheck_cop1_unusable(); + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); +#endif +} + +void genc_un_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_UN_S + gencallinterp((unsigned long long)cached_interpreter_table.C_UN_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jp_rj(13); + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 + jmp_imm_short(11); // 2 + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 +#endif +} + +void genc_eq_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_EQ_S + gencallinterp((unsigned long long)cached_interpreter_table.C_EQ_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jne_rj(13); + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + +void genc_ueq_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_UEQ_S + gencallinterp((unsigned long long)cached_interpreter_table.C_UEQ_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jp_rj(15); + jne_rj(13); + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + +void genc_olt_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_OLT_S + gencallinterp((unsigned long long)cached_interpreter_table.C_OLT_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jae_rj(13); + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + +void genc_ult_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_ULT_S + gencallinterp((unsigned long long)cached_interpreter_table.C_ULT_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jp_rj(15); + jae_rj(13); + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + +void genc_ole_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_OLE_S + gencallinterp((unsigned long long)cached_interpreter_table.C_OLE_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + fucomip_fpreg(1); + ffree_fpreg(0); + ja_rj(13); + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + +void genc_ule_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_ULE_S + gencallinterp((unsigned long long)cached_interpreter_table.C_ULE_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + fucomip_fpreg(1); + ffree_fpreg(0); + jp_rj(15); + ja_rj(13); + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + +void genc_sf_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_SF_S + gencallinterp((unsigned long long)cached_interpreter_table.C_SF_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + fcomip_fpreg(1); + ffree_fpreg(0); + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); +#endif +} + +void genc_ngle_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_NGLE_S + gencallinterp((unsigned long long)cached_interpreter_table.C_NGLE_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jp_rj(13); + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 + jmp_imm_short(11); // 2 + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 +#endif +} + +void genc_seq_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_SEQ_S + gencallinterp((unsigned long long)cached_interpreter_table.C_SEQ_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jne_rj(13); + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + +void genc_ngl_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_NGL_S + gencallinterp((unsigned long long)cached_interpreter_table.C_NGL_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jp_rj(15); + jne_rj(13); + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + +void genc_lt_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_LT_S + gencallinterp((unsigned long long)cached_interpreter_table.C_LT_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jae_rj(13); + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + +void genc_nge_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_NGE_S + gencallinterp((unsigned long long)cached_interpreter_table.C_NGE_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jp_rj(15); + jae_rj(13); + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + +void genc_le_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_LE_S + gencallinterp((unsigned long long)cached_interpreter_table.C_LE_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + fcomip_fpreg(1); + ffree_fpreg(0); + ja_rj(13); + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + +void genc_ngt_s(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[118]); +#endif +#ifdef INTERPRET_C_NGT_S + gencallinterp((unsigned long long)cached_interpreter_table.C_NGT_S, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.ft])); + fld_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fld_preg64_dword(RAX); + fcomip_fpreg(1); + ffree_fpreg(0); + jp_rj(15); + ja_rj(13); + or_m32rel_imm32((unsigned int*)&FCR31, 0x800000); // 11 + jmp_imm_short(11); // 2 + and_m32rel_imm32((unsigned int*)&FCR31, ~0x800000); // 11 +#endif +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gcop1_w.c b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gcop1_w.c new file mode 100644 index 0000000000..fdc83ca009 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gcop1_w.c @@ -0,0 +1,63 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - gcop1_w.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2007 Richard Goedeken (Richard42) * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "assemble.h" +#include "interpret.h" + +#include "r4300/recomph.h" +#include "r4300/r4300.h" +#include "r4300/ops.h" + +void gencvt_s_w(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[117]); +#endif +#ifdef INTERPRET_CVT_S_W + gencallinterp((unsigned long long)cached_interpreter_table.CVT_S_W, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fild_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fd])); + fstp_preg64_dword(RAX); +#endif +} + +void gencvt_d_w(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[117]); +#endif +#ifdef INTERPRET_CVT_D_W + gencallinterp((unsigned long long)cached_interpreter_table.CVT_D_W, 0); +#else + gencheck_cop1_unusable(); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_simple[dst->f.cf.fs])); + fild_preg64_dword(RAX); + mov_xreg64_m64rel(RAX, (unsigned long long *)(®_cop1_double[dst->f.cf.fd])); + fstp_preg64_qword(RAX); +#endif +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gr4300.c b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gr4300.c new file mode 100644 index 0000000000..15db43fd54 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gr4300.c @@ -0,0 +1,2284 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - gr4300.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2007 Richard Goedeken (Richard42) * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "assemble.h" +#include "regcache.h" +#include "interpret.h" + +#include "api/debugger.h" + +#include "r4300/r4300.h" +#include "r4300/macros.h" +#include "r4300/interupt.h" +#include "r4300/ops.h" +#include "r4300/recomph.h" +#include "r4300/exception.h" + +#include "memory/memory.h" + +#if !defined(offsetof) +# define offsetof(TYPE,MEMBER) ((unsigned int) &((TYPE*)0)->MEMBER) +#endif + +#if defined(COUNT_INSTR) +unsigned int instr_count[132]; +char instr_name[][10] = +{ + "reserved", "NI", "J", "JAL", "BEQ", "BNE", "BLEZ", "BGTZ", + "ADDI", "ADDIU", "SLTI", "SLTIU", "ANDI", "ORI", "XORI", "LUI", + "BEQL", "BNEL", "BLEZL", "BGTZL", "DADDI", "DADDIU", "LDL", "LDR", + "LB", "LH", "LW", "LWL", "LBU", "LHU", "LWU", "LWR", + "SB", "SH", "SW", "SWL", "SWR", "SDL", "SDR", "LWC1", + "LDC1", "LD", "LL", "SWC1", "SDC1", "SD", "SC", "BLTZ", + "BGEZ", "BLTZL", "BGEZL", "BLTZAL", "BGEZAL", "BLTZALL", "BGEZALL", "SLL", + "SRL", "SRA", "SLLV", "SRLV", "SRAV", "JR", "JALR", "SYSCALL", + "MFHI", "MTHI", "MFLO", "MTLO", "DSLLV", "DSRLV", "DSRAV", "MULT", + "MULTU", "DIV", "DIVU", "DMULT", "DMULTU", "DDIV", "DDIVU", "ADD", + "ADDU", "SUB", "SUBU", "AND", "OR", "XOR", "NOR", "SLT", + "SLTU", "DADD", "DADDU", "DSUB", "DSUBU", "DSLL", "DSRL", "DSRA", + "TEQ", "DSLL32", "DSRL32", "DSRA32", "BC1F", "BC1T", "BC1FL", "BC1TL", + "TLBWI", "TLBP", "TLBR", "TLBWR", "ERET", "MFC0", "MTC0", "MFC1", + "DMFC1", "CFC1", "MTC1", "DMTC1", "CTC1", "f.CVT", "f.CMP", "f.ADD", + "f.SUB", "f.MUL", "f.DIV", "f.SQRT", "f.ABS", "f.MOV", "f.NEG", "f.ROUND", + "f.TRUNC", "f.CEIL", "f.FLOOR" +}; +unsigned int instr_type[131] = { 9, 10, 6, 6, 7, 7, 7, 7, 3, 3, 4, 4, 3, 4, 4, 0, + 7, 7, 7, 7, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 7, + 7, 7, 7, 7, 7, 7, 7, 3, 3, 3, 3, 3, 3, 6, 6, 10, + 2, 2, 2, 2, 4, 4, 4, 3, 3, 3, 3, 4, 4, 4, 4, 3, + 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 8, 4, 4, 4, 7, 7, 7, 7, 10, 10, 10, 10, 8, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 5, 5, 5, 5, 5, 5, 5, 2, 5, 5, + 5, 5, 5 }; +char instr_typename[][20] = { "Load", "Store", "Data move/convert", "32-bit math", "64-bit math", "Float Math", + "Jump", "Branch", "Exceptions", "Reserved", "Other" }; +#endif + +extern unsigned int op; + +static precomp_instr fake_instr; +#ifdef COMPARE_CORE +static long long debug_reg_storage[8]; +#endif + +int branch_taken = 0; + +/* static functions */ + +static void genupdate_count(unsigned int addr) +{ +#if !defined(COMPARE_CORE) && !defined(DBG) + mov_reg32_imm32(EAX, addr); + sub_xreg32_m32rel(EAX, (unsigned int*)(&last_addr)); + shr_reg32_imm8(EAX, 1); + add_m32rel_xreg32((unsigned int*)(&Count), EAX); +#else + mov_reg64_imm64(RAX, (unsigned long long) (dst+1)); + mov_m64rel_xreg64((unsigned long long *)(&PC), RAX); + mov_reg64_imm64(RAX, (unsigned long long)update_count); + call_reg64(RAX); +#endif +} + +static void gencheck_interupt(unsigned long long instr_structure) +{ + mov_xreg32_m32rel(EAX, (void*)(&next_interupt)); + cmp_xreg32_m32rel(EAX, (void*)&Count); + ja_rj(0); + jump_start_rel8(); + + mov_reg64_imm64(RAX, (unsigned long long) instr_structure); + mov_m64rel_xreg64((unsigned long long *)(&PC), RAX); + mov_reg64_imm64(RAX, (unsigned long long) gen_interupt); + call_reg64(RAX); + + jump_end_rel8(); +} + +static void gencheck_interupt_out(unsigned int addr) +{ + mov_xreg32_m32rel(EAX, (void*)(&next_interupt)); + cmp_xreg32_m32rel(EAX, (void*)&Count); + ja_rj(0); + jump_start_rel8(); + + mov_m32rel_imm32((unsigned int*)(&fake_instr.addr), addr); + mov_reg64_imm64(RAX, (unsigned long long) (&fake_instr)); + mov_m64rel_xreg64((unsigned long long *)(&PC), RAX); + mov_reg64_imm64(RAX, (unsigned long long) gen_interupt); + call_reg64(RAX); + + jump_end_rel8(); +} + +static void genbeq_test(void) +{ + int rs_64bit = is64((unsigned int *)dst->f.i.rs); + int rt_64bit = is64((unsigned int *)dst->f.i.rt); + + if (rs_64bit == 0 && rt_64bit == 0) + { + int rs = allocate_register_32((unsigned int *)dst->f.i.rs); + int rt = allocate_register_32((unsigned int *)dst->f.i.rt); + + cmp_reg32_reg32(rs, rt); + sete_m8rel((unsigned char *) &branch_taken); + } + else if (rs_64bit == -1) + { + int rt = allocate_register_64((unsigned long long *)dst->f.i.rt); + + cmp_xreg64_m64rel(rt, (unsigned long long *) dst->f.i.rs); + sete_m8rel((unsigned char *) &branch_taken); + } + else if (rt_64bit == -1) + { + int rs = allocate_register_64((unsigned long long *)dst->f.i.rs); + + cmp_xreg64_m64rel(rs, (unsigned long long *)dst->f.i.rt); + sete_m8rel((unsigned char *) &branch_taken); + } + else + { + int rs = allocate_register_64((unsigned long long *)dst->f.i.rs); + int rt = allocate_register_64((unsigned long long *)dst->f.i.rt); + cmp_reg64_reg64(rs, rt); + sete_m8rel((unsigned char *) &branch_taken); + } +} + +static void genbne_test(void) +{ + int rs_64bit = is64((unsigned int *)dst->f.i.rs); + int rt_64bit = is64((unsigned int *)dst->f.i.rt); + + if (rs_64bit == 0 && rt_64bit == 0) + { + int rs = allocate_register_32((unsigned int *)dst->f.i.rs); + int rt = allocate_register_32((unsigned int *)dst->f.i.rt); + + cmp_reg32_reg32(rs, rt); + setne_m8rel((unsigned char *) &branch_taken); + } + else if (rs_64bit == -1) + { + int rt = allocate_register_64((unsigned long long *) dst->f.i.rt); + + cmp_xreg64_m64rel(rt, (unsigned long long *)dst->f.i.rs); + setne_m8rel((unsigned char *) &branch_taken); + } + else if (rt_64bit == -1) + { + int rs = allocate_register_64((unsigned long long *) dst->f.i.rs); + + cmp_xreg64_m64rel(rs, (unsigned long long *)dst->f.i.rt); + setne_m8rel((unsigned char *) &branch_taken); + } + else + { + int rs = allocate_register_64((unsigned long long *)dst->f.i.rs); + int rt = allocate_register_64((unsigned long long *)dst->f.i.rt); + + cmp_reg64_reg64(rs, rt); + setne_m8rel((unsigned char *) &branch_taken); + } +} + +static void genblez_test(void) +{ + int rs_64bit = is64((unsigned int *)dst->f.i.rs); + + if (rs_64bit == 0) + { + int rs = allocate_register_32((unsigned int *)dst->f.i.rs); + + cmp_reg32_imm32(rs, 0); + setle_m8rel((unsigned char *) &branch_taken); + } + else + { + int rs = allocate_register_64((unsigned long long *)dst->f.i.rs); + + cmp_reg64_imm8(rs, 0); + setle_m8rel((unsigned char *) &branch_taken); + } +} + +static void genbgtz_test(void) +{ + int rs_64bit = is64((unsigned int *)dst->f.i.rs); + + if (rs_64bit == 0) + { + int rs = allocate_register_32((unsigned int *)dst->f.i.rs); + + cmp_reg32_imm32(rs, 0); + setg_m8rel((unsigned char *) &branch_taken); + } + else + { + int rs = allocate_register_64((unsigned long long *)dst->f.i.rs); + + cmp_reg64_imm8(rs, 0); + setg_m8rel((unsigned char *) &branch_taken); + } +} + +static void ld_register_alloc(int *pGpr1, int *pGpr2, int *pBase1, int *pBase2) +{ + int gpr1, gpr2, base1, base2 = 0; + +#ifdef COMPARE_CORE + free_registers_move_start(); // to maintain parity with 32-bit core +#endif + + if (dst->f.i.rs == dst->f.i.rt) + { + allocate_register_32((unsigned int*)dst->f.r.rs); // tell regcache we need to read RS register here + gpr1 = allocate_register_32_w((unsigned int*)dst->f.r.rt); // tell regcache we will modify RT register during this instruction + gpr2 = lock_register(lru_register()); // free and lock least recently used register for usage here + add_reg32_imm32(gpr1, (int)dst->f.i.immediate); + mov_reg32_reg32(gpr2, gpr1); + } + else + { + gpr2 = allocate_register_32((unsigned int*)dst->f.r.rs); // tell regcache we need to read RS register here + gpr1 = allocate_register_32_w((unsigned int*)dst->f.r.rt); // tell regcache we will modify RT register during this instruction + free_register(gpr2); // write out gpr2 if dirty because I'm going to trash it right now + add_reg32_imm32(gpr2, (int)dst->f.i.immediate); + mov_reg32_reg32(gpr1, gpr2); + lock_register(gpr2); // lock the freed gpr2 it so it doesn't get returned in the lru query + } + base1 = lock_register(lru_base_register()); // get another lru register + if (!fast_memory) + { + base2 = lock_register(lru_base_register()); // and another one if necessary + unlock_register(base2); + } + unlock_register(base1); // unlock the locked registers (they are + unlock_register(gpr2); + set_register_state(gpr1, NULL, 0, 0); // clear gpr1 state because it hasn't been written yet - + // we don't want it to be pushed/popped around read_rdramX call + *pGpr1 = gpr1; + *pGpr2 = gpr2; + *pBase1 = base1; + *pBase2 = base2; +} + + +/* global functions */ + +void gennotcompiled(void) +{ + free_registers_move_start(); + + mov_reg64_imm64(RAX, (unsigned long long) dst); + mov_memoffs64_rax((unsigned long long *) &PC); /* RIP-relative will not work here */ + mov_reg64_imm64(RAX, (unsigned long long) cached_interpreter_table.NOTCOMPILED); + call_reg64(RAX); +} + +void genlink_subblock(void) +{ + free_all_registers(); + jmp(dst->addr+4); +} + +#ifdef COMPARE_CORE +void gendebug(void) +{ + free_all_registers(); + + mov_memoffs64_rax((unsigned long long *) &debug_reg_storage); + mov_reg64_imm64(RAX, (unsigned long long) &debug_reg_storage); + mov_preg64pimm8_reg64(RAX, 8, RBX); + mov_preg64pimm8_reg64(RAX, 16, RCX); + mov_preg64pimm8_reg64(RAX, 24, RDX); + mov_preg64pimm8_reg64(RAX, 32, RSP); + mov_preg64pimm8_reg64(RAX, 40, RBP); + mov_preg64pimm8_reg64(RAX, 48, RSI); + mov_preg64pimm8_reg64(RAX, 56, RDI); + + mov_reg64_imm64(RAX, (unsigned long long) dst); + mov_memoffs64_rax((unsigned long long *) &PC); + mov_reg32_imm32(EAX, (unsigned int) src); + mov_memoffs32_eax((unsigned int *) &op); + mov_reg64_imm64(RAX, (unsigned long long) CoreCompareCallback); + call_reg64(RAX); + + mov_reg64_imm64(RAX, (unsigned long long) &debug_reg_storage); + mov_reg64_preg64pimm8(RDI, RAX, 56); + mov_reg64_preg64pimm8(RSI, RAX, 48); + mov_reg64_preg64pimm8(RBP, RAX, 40); + mov_reg64_preg64pimm8(RSP, RAX, 32); + mov_reg64_preg64pimm8(RDX, RAX, 24); + mov_reg64_preg64pimm8(RCX, RAX, 16); + mov_reg64_preg64pimm8(RBX, RAX, 8); + mov_reg64_preg64(RAX, RAX); +} +#endif + +void gencallinterp(unsigned long addr, int jump) +{ + free_registers_move_start(); + + if (jump) + mov_m32rel_imm32((unsigned int*)(&dyna_interp), 1); + + mov_reg64_imm64(RAX, (unsigned long long) dst); + mov_m64rel_xreg64((unsigned long long *)(&PC), RAX); + mov_reg64_imm64(RAX, addr); + call_reg64(RAX); + + if (jump) + { + mov_m32rel_imm32((unsigned int*)(&dyna_interp), 0); + mov_reg64_imm64(RAX, (unsigned long long)dyna_jump); + call_reg64(RAX); + } +} + +void gendelayslot(void) +{ + mov_m32rel_imm32((void*)(&delay_slot), 1); + recompile_opcode(); + + free_all_registers(); + genupdate_count(dst->addr+4); + + mov_m32rel_imm32((void*)(&delay_slot), 0); +} + +void genni(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[1]); +#endif + gencallinterp((unsigned long long)cached_interpreter_table.NI, 0); +} + +void genreserved(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[0]); +#endif + gencallinterp((unsigned long long)cached_interpreter_table.RESERVED, 0); +} + +void genfin_block(void) +{ + gencallinterp((unsigned long long)cached_interpreter_table.FIN_BLOCK, 0); +} + +void gencheck_interupt_reg(void) // addr is in EAX +{ + mov_xreg32_m32rel(EBX, (void*)&next_interupt); + cmp_xreg32_m32rel(EBX, (void*)&Count); + ja_rj(0); + jump_start_rel8(); + + mov_m32rel_xreg32((unsigned int*)(&fake_instr.addr), EAX); + mov_reg64_imm64(RAX, (unsigned long long) (&fake_instr)); + mov_m64rel_xreg64((unsigned long long *)(&PC), RAX); + mov_reg64_imm64(RAX, (unsigned long long) gen_interupt); + call_reg64(RAX); + + jump_end_rel8(); +} + +void gennop(void) +{ +} + +void genj(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[2]); +#endif +#ifdef INTERPRET_J + gencallinterp((unsigned long long)cached_interpreter_table.J, 1); +#else + unsigned int naddr; + + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.J, 1); + return; + } + + gendelayslot(); + naddr = ((dst-1)->f.j.inst_index<<2) | (dst->addr & 0xF0000000); + + mov_m32rel_imm32((void*)(&last_addr), naddr); + gencheck_interupt((unsigned long long) &actual->block[(naddr-actual->start)/4]); + jmp(naddr); +#endif +} + +void genj_out(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[2]); +#endif +#ifdef INTERPRET_J_OUT + gencallinterp((unsigned long long)cached_interpreter_table.J_OUT, 1); +#else + unsigned int naddr; + + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.J_OUT, 1); + return; + } + + gendelayslot(); + naddr = ((dst-1)->f.j.inst_index<<2) | (dst->addr & 0xF0000000); + + mov_m32rel_imm32((void*)(&last_addr), naddr); + gencheck_interupt_out(naddr); + mov_m32rel_imm32(&jump_to_address, naddr); + mov_reg64_imm64(RAX, (unsigned long long) (dst+1)); + mov_m64rel_xreg64((unsigned long long *)(&PC), RAX); + mov_reg64_imm64(RAX, (unsigned long long)jump_to_func); + call_reg64(RAX); +#endif +} + +void genj_idle(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[2]); +#endif +#ifdef INTERPRET_J_IDLE + gencallinterp((unsigned long long)cached_interpreter_table.J_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.J_IDLE, 1); + return; + } + + mov_xreg32_m32rel(EAX, (unsigned int *)(&next_interupt)); + sub_xreg32_m32rel(EAX, (unsigned int *)(&Count)); + cmp_reg32_imm8(EAX, 3); + jbe_rj(12); + + and_eax_imm32(0xFFFFFFFC); // 5 + add_m32rel_xreg32((unsigned int *)(&Count), EAX); // 7 + + genj(); +#endif +} + +void genjal(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[3]); +#endif +#ifdef INTERPRET_JAL + gencallinterp((unsigned long long)cached_interpreter_table.JAL, 1); +#else + unsigned int naddr; + + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.JAL, 1); + return; + } + + gendelayslot(); + + mov_m32rel_imm32((unsigned int *)(reg + 31), dst->addr + 4); + if (((dst->addr + 4) & 0x80000000)) + mov_m32rel_imm32((unsigned int *)(®[31])+1, 0xFFFFFFFF); + else + mov_m32rel_imm32((unsigned int *)(®[31])+1, 0); + + naddr = ((dst-1)->f.j.inst_index<<2) | (dst->addr & 0xF0000000); + + mov_m32rel_imm32((void*)(&last_addr), naddr); + gencheck_interupt((unsigned long long) &actual->block[(naddr-actual->start)/4]); + jmp(naddr); +#endif +} + +void genjal_out(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[3]); +#endif +#ifdef INTERPRET_JAL_OUT + gencallinterp((unsigned long long)cached_interpreter_table.JAL_OUT, 1); +#else + unsigned int naddr; + + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.JAL_OUT, 1); + return; + } + + gendelayslot(); + + mov_m32rel_imm32((unsigned int *)(reg + 31), dst->addr + 4); + if (((dst->addr + 4) & 0x80000000)) + mov_m32rel_imm32((unsigned int *)(®[31])+1, 0xFFFFFFFF); + else + mov_m32rel_imm32((unsigned int *)(®[31])+1, 0); + + naddr = ((dst-1)->f.j.inst_index<<2) | (dst->addr & 0xF0000000); + + mov_m32rel_imm32((void*)(&last_addr), naddr); + gencheck_interupt_out(naddr); + mov_m32rel_imm32(&jump_to_address, naddr); + mov_reg64_imm64(RAX, (unsigned long long) (dst+1)); + mov_m64rel_xreg64((unsigned long long *)(&PC), RAX); + mov_reg64_imm64(RAX, (unsigned long long) jump_to_func); + call_reg64(RAX); +#endif +} + +void genjal_idle(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[3]); +#endif +#ifdef INTERPRET_JAL_IDLE + gencallinterp((unsigned long long)cached_interpreter_table.JAL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.JAL_IDLE, 1); + return; + } + + mov_xreg32_m32rel(EAX, (unsigned int *)(&next_interupt)); + sub_xreg32_m32rel(EAX, (unsigned int *)(&Count)); + cmp_reg32_imm8(EAX, 3); + jbe_rj(12); + + and_eax_imm32(0xFFFFFFFC); // 5 + add_m32rel_xreg32((unsigned int *)(&Count), EAX); // 7 + + genjal(); +#endif +} + +void gentest(void) +{ + cmp_m32rel_imm32((unsigned int *)(&branch_taken), 0); + je_near_rj(0); + jump_start_rel32(); + + mov_m32rel_imm32((void*)(&last_addr), dst->addr + (dst-1)->f.i.immediate*4); + gencheck_interupt((unsigned long long) (dst + (dst-1)->f.i.immediate)); + jmp(dst->addr + (dst-1)->f.i.immediate*4); + + jump_end_rel32(); + + mov_m32rel_imm32((void*)(&last_addr), dst->addr + 4); + gencheck_interupt((unsigned long long)(dst + 1)); + jmp(dst->addr + 4); +} + +void genbeq(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[4]); +#endif +#ifdef INTERPRET_BEQ + gencallinterp((unsigned long long)cached_interpreter_table.BEQ, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BEQ, 1); + return; + } + + genbeq_test(); + gendelayslot(); + gentest(); +#endif +} + +void gentest_out(void) +{ + cmp_m32rel_imm32((unsigned int *)(&branch_taken), 0); + je_near_rj(0); + jump_start_rel32(); + + mov_m32rel_imm32((void*)(&last_addr), dst->addr + (dst-1)->f.i.immediate*4); + gencheck_interupt_out(dst->addr + (dst-1)->f.i.immediate*4); + mov_m32rel_imm32(&jump_to_address, dst->addr + (dst-1)->f.i.immediate*4); + mov_reg64_imm64(RAX, (unsigned long long) (dst+1)); + mov_m64rel_xreg64((unsigned long long *)(&PC), RAX); + mov_reg64_imm64(RAX, (unsigned long long) jump_to_func); + call_reg64(RAX); + jump_end_rel32(); + + mov_m32rel_imm32((void*)(&last_addr), dst->addr + 4); + gencheck_interupt((unsigned long long) (dst + 1)); + jmp(dst->addr + 4); +} + +void genbeq_out(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[4]); +#endif +#ifdef INTERPRET_BEQ_OUT + gencallinterp((unsigned long long)cached_interpreter_table.BEQ_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BEQ_OUT, 1); + return; + } + + genbeq_test(); + gendelayslot(); + gentest_out(); +#endif +} + +void gentest_idle(void) +{ + int reg; + + reg = lru_register(); + free_register(reg); + + cmp_m32rel_imm32((unsigned int *)(&branch_taken), 0); + je_near_rj(0); + jump_start_rel32(); + + mov_xreg32_m32rel(reg, (unsigned int *)(&next_interupt)); + sub_xreg32_m32rel(reg, (unsigned int *)(&Count)); + cmp_reg32_imm8(reg, 3); + jbe_rj(0); + jump_start_rel8(); + + and_reg32_imm32(reg, 0xFFFFFFFC); + add_m32rel_xreg32((unsigned int *)(&Count), reg); + + jump_end_rel8(); + jump_end_rel32(); +} + +void genbeq_idle(void) +{ +#ifdef INTERPRET_BEQ_IDLE + gencallinterp((unsigned long long)cached_interpreter_table.BEQ_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BEQ_IDLE, 1); + return; + } + + genbeq_test(); + gentest_idle(); + genbeq(); +#endif +} + +void genbne(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[5]); +#endif +#ifdef INTERPRET_BNE + gencallinterp((unsigned long long)cached_interpreter_table.BNE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BNE, 1); + return; + } + + genbne_test(); + gendelayslot(); + gentest(); +#endif +} + +void genbne_out(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[5]); +#endif +#ifdef INTERPRET_BNE_OUT + gencallinterp((unsigned long long)cached_interpreter_table.BNE_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BNE_OUT, 1); + return; + } + + genbne_test(); + gendelayslot(); + gentest_out(); +#endif +} + +void genbne_idle(void) +{ +#ifdef INTERPRET_BNE_IDLE + gencallinterp((unsigned long long)cached_interpreter_table.BNE_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BNE_IDLE, 1); + return; + } + + genbne_test(); + gentest_idle(); + genbne(); +#endif +} + +void genblez(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[6]); +#endif +#ifdef INTERPRET_BLEZ + gencallinterp((unsigned long long)cached_interpreter_table.BLEZ, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BLEZ, 1); + return; + } + + genblez_test(); + gendelayslot(); + gentest(); +#endif +} + +void genblez_out(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[6]); +#endif +#ifdef INTERPRET_BLEZ_OUT + gencallinterp((unsigned long long)cached_interpreter_table.BLEZ_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BLEZ_OUT, 1); + return; + } + + genblez_test(); + gendelayslot(); + gentest_out(); +#endif +} + +void genblez_idle(void) +{ +#ifdef INTERPRET_BLEZ_IDLE + gencallinterp((unsigned long long)cached_interpreter_table.BLEZ_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BLEZ_IDLE, 1); + return; + } + + genblez_test(); + gentest_idle(); + genblez(); +#endif +} + +void genbgtz(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[7]); +#endif +#ifdef INTERPRET_BGTZ + gencallinterp((unsigned long long)cached_interpreter_table.BGTZ, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BGTZ, 1); + return; + } + + genbgtz_test(); + gendelayslot(); + gentest(); +#endif +} + +void genbgtz_out(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[7]); +#endif +#ifdef INTERPRET_BGTZ_OUT + gencallinterp((unsigned long long)cached_interpreter_table.BGTZ_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BGTZ_OUT, 1); + return; + } + + genbgtz_test(); + gendelayslot(); + gentest_out(); +#endif +} + +void genbgtz_idle(void) +{ +#ifdef INTERPRET_BGTZ_IDLE + gencallinterp((unsigned long long)cached_interpreter_table.BGTZ_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BGTZ_IDLE, 1); + return; + } + + genbgtz_test(); + gentest_idle(); + genbgtz(); +#endif +} + +void genaddi(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[8]); +#endif +#ifdef INTERPRET_ADDI + gencallinterp((unsigned long long)cached_interpreter_table.ADDI, 0); +#else + int rs = allocate_register_32((unsigned int *)dst->f.i.rs); + int rt = allocate_register_32_w((unsigned int *)dst->f.i.rt); + + mov_reg32_reg32(rt, rs); + add_reg32_imm32(rt,(int)dst->f.i.immediate); +#endif +} + +void genaddiu(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[9]); +#endif +#ifdef INTERPRET_ADDIU + gencallinterp((unsigned long long)cached_interpreter_table.ADDIU, 0); +#else + int rs = allocate_register_32((unsigned int *)dst->f.i.rs); + int rt = allocate_register_32_w((unsigned int *)dst->f.i.rt); + + mov_reg32_reg32(rt, rs); + add_reg32_imm32(rt,(int)dst->f.i.immediate); +#endif +} + +void genslti(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[10]); +#endif +#ifdef INTERPRET_SLTI + gencallinterp((unsigned long long)cached_interpreter_table.SLTI, 0); +#else + int rs = allocate_register_64((unsigned long long *) dst->f.i.rs); + int rt = allocate_register_64_w((unsigned long long *) dst->f.i.rt); + int imm = (int) dst->f.i.immediate; + + cmp_reg64_imm32(rs, imm); + setl_reg8(rt); + and_reg64_imm8(rt, 1); +#endif +} + +void gensltiu(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[11]); +#endif +#ifdef INTERPRET_SLTIU + gencallinterp((unsigned long long)cached_interpreter_table.SLTIU, 0); +#else + int rs = allocate_register_64((unsigned long long *)dst->f.i.rs); + int rt = allocate_register_64_w((unsigned long long *)dst->f.i.rt); + int imm = (int) dst->f.i.immediate; + + cmp_reg64_imm32(rs, imm); + setb_reg8(rt); + and_reg64_imm8(rt, 1); +#endif +} + +void genandi(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[12]); +#endif +#ifdef INTERPRET_ANDI + gencallinterp((unsigned long long)cached_interpreter_table.ANDI, 0); +#else + int rs = allocate_register_64((unsigned long long *)dst->f.i.rs); + int rt = allocate_register_64_w((unsigned long long *)dst->f.i.rt); + + mov_reg64_reg64(rt, rs); + and_reg64_imm32(rt, (unsigned short)dst->f.i.immediate); +#endif +} + +void genori(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[13]); +#endif +#ifdef INTERPRET_ORI + gencallinterp((unsigned long long)cached_interpreter_table.ORI, 0); +#else + int rs = allocate_register_64((unsigned long long *) dst->f.i.rs); + int rt = allocate_register_64_w((unsigned long long *) dst->f.i.rt); + + mov_reg64_reg64(rt, rs); + or_reg64_imm32(rt, (unsigned short)dst->f.i.immediate); +#endif +} + +void genxori(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[14]); +#endif +#ifdef INTERPRET_XORI + gencallinterp((unsigned long long)cached_interpreter_table.XORI, 0); +#else + int rs = allocate_register_64((unsigned long long *)dst->f.i.rs); + int rt = allocate_register_64_w((unsigned long long *)dst->f.i.rt); + + mov_reg64_reg64(rt, rs); + xor_reg64_imm32(rt, (unsigned short)dst->f.i.immediate); +#endif +} + +void genlui(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[15]); +#endif +#ifdef INTERPRET_LUI + gencallinterp((unsigned long long)cached_interpreter_table.LUI, 0); +#else + int rt = allocate_register_32_w((unsigned int *)dst->f.i.rt); + + mov_reg32_imm32(rt, (unsigned int)dst->f.i.immediate << 16); +#endif +} + +void gentestl(void) +{ + cmp_m32rel_imm32((unsigned int *)(&branch_taken), 0); + je_near_rj(0); + jump_start_rel32(); + + gendelayslot(); + mov_m32rel_imm32((void*)(&last_addr), dst->addr + (dst-1)->f.i.immediate*4); + gencheck_interupt((unsigned long long) (dst + (dst-1)->f.i.immediate)); + jmp(dst->addr + (dst-1)->f.i.immediate*4); + + jump_end_rel32(); + + genupdate_count(dst->addr-4); + mov_m32rel_imm32((void*)(&last_addr), dst->addr + 4); + gencheck_interupt((unsigned long long) (dst + 1)); + jmp(dst->addr + 4); +} + +void genbeql(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[16]); +#endif +#ifdef INTERPRET_BEQL + gencallinterp((unsigned long long)cached_interpreter_table.BEQL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BEQL, 1); + return; + } + + genbeq_test(); + free_all_registers(); + gentestl(); +#endif +} + +void gentestl_out(void) +{ + cmp_m32rel_imm32((unsigned int *)(&branch_taken), 0); + je_near_rj(0); + jump_start_rel32(); + + gendelayslot(); + mov_m32rel_imm32((void*)(&last_addr), dst->addr + (dst-1)->f.i.immediate*4); + gencheck_interupt_out(dst->addr + (dst-1)->f.i.immediate*4); + mov_m32rel_imm32(&jump_to_address, dst->addr + (dst-1)->f.i.immediate*4); + + mov_reg64_imm64(RAX, (unsigned long long) (dst+1)); + mov_m64rel_xreg64((unsigned long long *)(&PC), RAX); + mov_reg64_imm64(RAX, (unsigned long long) jump_to_func); + call_reg64(RAX); + + jump_end_rel32(); + + genupdate_count(dst->addr-4); + mov_m32rel_imm32((void*)(&last_addr), dst->addr + 4); + gencheck_interupt((unsigned long long) (dst + 1)); + jmp(dst->addr + 4); +} + +void genbeql_out(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[16]); +#endif +#ifdef INTERPRET_BEQL_OUT + gencallinterp((unsigned long long)cached_interpreter_table.BEQL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BEQL_OUT, 1); + return; + } + + genbeq_test(); + free_all_registers(); + gentestl_out(); +#endif +} + +void genbeql_idle(void) +{ +#ifdef INTERPRET_BEQL_IDLE + gencallinterp((unsigned long long)cached_interpreter_table.BEQL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BEQL_IDLE, 1); + return; + } + + genbeq_test(); + gentest_idle(); + genbeql(); +#endif +} + +void genbnel(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[17]); +#endif +#ifdef INTERPRET_BNEL + gencallinterp((unsigned long long)cached_interpreter_table.BNEL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BNEL, 1); + return; + } + + genbne_test(); + free_all_registers(); + gentestl(); +#endif +} + +void genbnel_out(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[17]); +#endif +#ifdef INTERPRET_BNEL_OUT + gencallinterp((unsigned long long)cached_interpreter_table.BNEL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BNEL_OUT, 1); + return; + } + + genbne_test(); + free_all_registers(); + gentestl_out(); +#endif +} + +void genbnel_idle(void) +{ +#ifdef INTERPRET_BNEL_IDLE + gencallinterp((unsigned long long)cached_interpreter_table.BNEL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BNEL_IDLE, 1); + return; + } + + genbne_test(); + gentest_idle(); + genbnel(); +#endif +} + +void genblezl(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[18]); +#endif +#ifdef INTERPRET_BLEZL + gencallinterp((unsigned long long)cached_interpreter_table.BLEZL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BLEZL, 1); + return; + } + + genblez_test(); + free_all_registers(); + gentestl(); +#endif +} + +void genblezl_out(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[18]); +#endif +#ifdef INTERPRET_BLEZL_OUT + gencallinterp((unsigned long long)cached_interpreter_table.BLEZL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BLEZL_OUT, 1); + return; + } + + genblez_test(); + free_all_registers(); + gentestl_out(); +#endif +} + +void genblezl_idle(void) +{ +#ifdef INTERPRET_BLEZL_IDLE + gencallinterp((unsigned long long)cached_interpreter_table.BLEZL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BLEZL_IDLE, 1); + return; + } + + genblez_test(); + gentest_idle(); + genblezl(); +#endif +} + +void genbgtzl(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[19]); +#endif +#ifdef INTERPRET_BGTZL + gencallinterp((unsigned long long)cached_interpreter_table.BGTZL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BGTZL, 1); + return; + } + + genbgtz_test(); + free_all_registers(); + gentestl(); +#endif +} + +void genbgtzl_out(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[19]); +#endif +#ifdef INTERPRET_BGTZL_OUT + gencallinterp((unsigned long long)cached_interpreter_table.BGTZL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BGTZL_OUT, 1); + return; + } + + genbgtz_test(); + free_all_registers(); + gentestl_out(); +#endif +} + +void genbgtzl_idle(void) +{ +#ifdef INTERPRET_BGTZL_IDLE + gencallinterp((unsigned long long)cached_interpreter_table.BGTZL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BGTZL_IDLE, 1); + return; + } + + genbgtz_test(); + gentest_idle(); + genbgtzl(); +#endif +} + +void gendaddi(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[20]); +#endif +#ifdef INTERPRET_DADDI + gencallinterp((unsigned long long)cached_interpreter_table.DADDI, 0); +#else + int rs = allocate_register_64((unsigned long long *)dst->f.i.rs); + int rt = allocate_register_64_w((unsigned long long *)dst->f.i.rt); + + mov_reg64_reg64(rt, rs); + add_reg64_imm32(rt, (int) dst->f.i.immediate); +#endif +} + +void gendaddiu(void) +{ +#ifdef INTERPRET_DADDIU + gencallinterp((unsigned long long)cached_interpreter_table.DADDIU, 0); +#else + int rs = allocate_register_64((unsigned long long *)dst->f.i.rs); + int rt = allocate_register_64_w((unsigned long long *)dst->f.i.rt); + + mov_reg64_reg64(rt, rs); + add_reg64_imm32(rt, (int) dst->f.i.immediate); +#endif +} + +void genldl(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[22]); +#endif + gencallinterp((unsigned long long)cached_interpreter_table.LDL, 0); +} + +void genldr(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[23]); +#endif + gencallinterp((unsigned long long)cached_interpreter_table.LDR, 0); +} + +void genlb(void) +{ + int gpr1, gpr2, base1, base2 = 0; +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[24]); +#endif +#ifdef INTERPRET_LB + gencallinterp((unsigned long long)cached_interpreter_table.LB, 0); +#else + free_registers_move_start(); + + ld_register_alloc(&gpr1, &gpr2, &base1, &base2); + + mov_reg64_imm64(base1, (unsigned long long) readmemb); + if(fast_memory) + { + and_reg32_imm32(gpr1, 0xDF800000); + cmp_reg32_imm32(gpr1, 0x80000000); + } + else + { + mov_reg64_imm64(base2, (unsigned long long) read_rdramb); + shr_reg32_imm8(gpr1, 16); + mov_reg64_preg64x8preg64(gpr1, gpr1, base1); + cmp_reg64_reg64(gpr1, base2); + } + je_rj(0); + jump_start_rel8(); + + mov_reg64_imm64(gpr1, (unsigned long long) (dst+1)); + mov_m64rel_xreg64((unsigned long long *)(&PC), gpr1); + mov_m32rel_xreg32((unsigned int *)(&address), gpr2); + mov_reg64_imm64(gpr1, (unsigned long long) dst->f.i.rt); + mov_m64rel_xreg64((unsigned long long *)(&rdword), gpr1); + shr_reg32_imm8(gpr2, 16); + mov_reg64_preg64x8preg64(gpr2, gpr2, base1); + call_reg64(gpr2); + movsx_xreg32_m8rel(gpr1, (unsigned char *)dst->f.i.rt); + jmp_imm_short(24); + + jump_end_rel8(); + mov_reg64_imm64(base1, (unsigned long long) rdram); // 10 + and_reg32_imm32(gpr2, 0x7FFFFF); // 6 + xor_reg8_imm8(gpr2, 3); // 4 + movsx_reg32_8preg64preg64(gpr1, gpr2, base1); // 4 + + set_register_state(gpr1, (unsigned int*)dst->f.i.rt, 1, 0); +#endif +} + +void genlh(void) +{ + int gpr1, gpr2, base1, base2 = 0; +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[25]); +#endif +#ifdef INTERPRET_LH + gencallinterp((unsigned long long)cached_interpreter_table.LH, 0); +#else + free_registers_move_start(); + + ld_register_alloc(&gpr1, &gpr2, &base1, &base2); + + mov_reg64_imm64(base1, (unsigned long long) readmemh); + if(fast_memory) + { + and_reg32_imm32(gpr1, 0xDF800000); + cmp_reg32_imm32(gpr1, 0x80000000); + } + else + { + mov_reg64_imm64(base2, (unsigned long long) read_rdramh); + shr_reg32_imm8(gpr1, 16); + mov_reg64_preg64x8preg64(gpr1, gpr1, base1); + cmp_reg64_reg64(gpr1, base2); + } + je_rj(0); + jump_start_rel8(); + + mov_reg64_imm64(gpr1, (unsigned long long) (dst+1)); + mov_m64rel_xreg64((unsigned long long *)(&PC), gpr1); + mov_m32rel_xreg32((unsigned int *)(&address), gpr2); + mov_reg64_imm64(gpr1, (unsigned long long) dst->f.i.rt); + mov_m64rel_xreg64((unsigned long long *)(&rdword), gpr1); + shr_reg32_imm8(gpr2, 16); + mov_reg64_preg64x8preg64(gpr2, gpr2, base1); + call_reg64(gpr2); + movsx_xreg32_m16rel(gpr1, (unsigned short *)dst->f.i.rt); + jmp_imm_short(24); + + jump_end_rel8(); + mov_reg64_imm64(base1, (unsigned long long) rdram); // 10 + and_reg32_imm32(gpr2, 0x7FFFFF); // 6 + xor_reg8_imm8(gpr2, 2); // 4 + movsx_reg32_16preg64preg64(gpr1, gpr2, base1); // 4 + + set_register_state(gpr1, (unsigned int*)dst->f.i.rt, 1, 0); +#endif +} + +void genlwl(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[27]); +#endif + gencallinterp((unsigned long long)cached_interpreter_table.LWL, 0); +} + +void genlw(void) +{ + int gpr1, gpr2, base1, base2 = 0; +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[26]); +#endif +#ifdef INTERPRET_LW + gencallinterp((unsigned long long)cached_interpreter_table.LW, 0); +#else + free_registers_move_start(); + + ld_register_alloc(&gpr1, &gpr2, &base1, &base2); + + mov_reg64_imm64(base1, (unsigned long long) readmem); + if(fast_memory) + { + and_reg32_imm32(gpr1, 0xDF800000); + cmp_reg32_imm32(gpr1, 0x80000000); + } + else + { + mov_reg64_imm64(base2, (unsigned long long) read_rdram); + shr_reg32_imm8(gpr1, 16); + mov_reg64_preg64x8preg64(gpr1, gpr1, base1); + cmp_reg64_reg64(gpr1, base2); + } + jne_rj(21); + + mov_reg64_imm64(base1, (unsigned long long) rdram); // 10 + and_reg32_imm32(gpr2, 0x7FFFFF); // 6 + mov_reg32_preg64preg64(gpr1, gpr2, base1); // 3 + jmp_imm_short(0); // 2 + jump_start_rel8(); + + mov_reg64_imm64(gpr1, (unsigned long long) (dst+1)); + mov_m64rel_xreg64((unsigned long long *)(&PC), gpr1); + mov_m32rel_xreg32((unsigned int *)(&address), gpr2); + mov_reg64_imm64(gpr1, (unsigned long long) dst->f.i.rt); + mov_m64rel_xreg64((unsigned long long *)(&rdword), gpr1); + shr_reg32_imm8(gpr2, 16); + mov_reg64_preg64x8preg64(gpr1, gpr2, base1); + call_reg64(gpr1); + mov_xreg32_m32rel(gpr1, (unsigned int *)(dst->f.i.rt)); + + jump_end_rel8(); + + set_register_state(gpr1, (unsigned int*)dst->f.i.rt, 1, 0); // set gpr1 state as dirty, and bound to r4300 reg RT +#endif +} + +void genlbu(void) +{ + int gpr1, gpr2, base1, base2 = 0; +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[28]); +#endif +#ifdef INTERPRET_LBU + gencallinterp((unsigned long long)cached_interpreter_table.LBU, 0); +#else + free_registers_move_start(); + + ld_register_alloc(&gpr1, &gpr2, &base1, &base2); + + mov_reg64_imm64(base1, (unsigned long long) readmemb); + if(fast_memory) + { + and_reg32_imm32(gpr1, 0xDF800000); + cmp_reg32_imm32(gpr1, 0x80000000); + } + else + { + mov_reg64_imm64(base2, (unsigned long long) read_rdramb); + shr_reg32_imm8(gpr1, 16); + mov_reg64_preg64x8preg64(gpr1, gpr1, base1); + cmp_reg64_reg64(gpr1, base2); + } + je_rj(0); + jump_start_rel8(); + + mov_reg64_imm64(gpr1, (unsigned long long) (dst+1)); + mov_m64rel_xreg64((unsigned long long *)(&PC), gpr1); + mov_m32rel_xreg32((unsigned int *)(&address), gpr2); + mov_reg64_imm64(gpr1, (unsigned long long) dst->f.i.rt); + mov_m64rel_xreg64((unsigned long long *)(&rdword), gpr1); + shr_reg32_imm8(gpr2, 16); + mov_reg64_preg64x8preg64(gpr2, gpr2, base1); + call_reg64(gpr2); + mov_xreg32_m32rel(gpr1, (unsigned int *)dst->f.i.rt); + jmp_imm_short(23); + + jump_end_rel8(); + mov_reg64_imm64(base1, (unsigned long long) rdram); // 10 + and_reg32_imm32(gpr2, 0x7FFFFF); // 6 + xor_reg8_imm8(gpr2, 3); // 4 + mov_reg32_preg64preg64(gpr1, gpr2, base1); // 3 + + and_reg32_imm32(gpr1, 0xFF); + set_register_state(gpr1, (unsigned int*)dst->f.i.rt, 1, 0); +#endif +} + +void genlhu(void) +{ + int gpr1, gpr2, base1, base2 = 0; +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[29]); +#endif +#ifdef INTERPRET_LHU + gencallinterp((unsigned long long)cached_interpreter_table.LHU, 0); +#else + free_registers_move_start(); + + ld_register_alloc(&gpr1, &gpr2, &base1, &base2); + + mov_reg64_imm64(base1, (unsigned long long) readmemh); + if(fast_memory) + { + and_reg32_imm32(gpr1, 0xDF800000); + cmp_reg32_imm32(gpr1, 0x80000000); + } + else + { + mov_reg64_imm64(base2, (unsigned long long) read_rdramh); + shr_reg32_imm8(gpr1, 16); + mov_reg64_preg64x8preg64(gpr1, gpr1, base1); + cmp_reg64_reg64(gpr1, base2); + } + je_rj(0); + jump_start_rel8(); + + mov_reg64_imm64(gpr1, (unsigned long long) (dst+1)); + mov_m64rel_xreg64((unsigned long long *)(&PC), gpr1); + mov_m32rel_xreg32((unsigned int *)(&address), gpr2); + mov_reg64_imm64(gpr1, (unsigned long long) dst->f.i.rt); + mov_m64rel_xreg64((unsigned long long *)(&rdword), gpr1); + shr_reg32_imm8(gpr2, 16); + mov_reg64_preg64x8preg64(gpr2, gpr2, base1); + call_reg64(gpr2); + mov_xreg32_m32rel(gpr1, (unsigned int *)dst->f.i.rt); + jmp_imm_short(23); + + jump_end_rel8(); + mov_reg64_imm64(base1, (unsigned long long) rdram); // 10 + and_reg32_imm32(gpr2, 0x7FFFFF); // 6 + xor_reg8_imm8(gpr2, 2); // 4 + mov_reg32_preg64preg64(gpr1, gpr2, base1); // 3 + + and_reg32_imm32(gpr1, 0xFFFF); + set_register_state(gpr1, (unsigned int*)dst->f.i.rt, 1, 0); +#endif +} + +void genlwr(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[31]); +#endif + gencallinterp((unsigned long long)cached_interpreter_table.LWR, 0); +} + +void genlwu(void) +{ + int gpr1, gpr2, base1, base2 = 0; +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[30]); +#endif +#ifdef INTERPRET_LWU + gencallinterp((unsigned long long)cached_interpreter_table.LWU, 0); +#else + free_registers_move_start(); + + ld_register_alloc(&gpr1, &gpr2, &base1, &base2); + + mov_reg64_imm64(base1, (unsigned long long) readmem); + if(fast_memory) + { + and_reg32_imm32(gpr1, 0xDF800000); + cmp_reg32_imm32(gpr1, 0x80000000); + } + else + { + mov_reg64_imm64(base2, (unsigned long long) read_rdram); + shr_reg32_imm8(gpr1, 16); + mov_reg64_preg64x8preg64(gpr1, gpr1, base1); + cmp_reg64_reg64(gpr1, base2); + } + je_rj(0); + jump_start_rel8(); + + mov_reg64_imm64(gpr1, (unsigned long long) (dst+1)); + mov_m64rel_xreg64((unsigned long long *)(&PC), gpr1); + mov_m32rel_xreg32((unsigned int *)(&address), gpr2); + mov_reg64_imm64(gpr1, (unsigned long long) dst->f.i.rt); + mov_m64rel_xreg64((unsigned long long *)(&rdword), gpr1); + shr_reg32_imm8(gpr2, 16); + mov_reg64_preg64x8preg64(gpr2, gpr2, base1); + call_reg64(gpr2); + mov_xreg32_m32rel(gpr1, (unsigned int *)dst->f.i.rt); + jmp_imm_short(19); + + jump_end_rel8(); + mov_reg64_imm64(base1, (unsigned long long) rdram); // 10 + and_reg32_imm32(gpr2, 0x7FFFFF); // 6 + mov_reg32_preg64preg64(gpr1, gpr2, base1); // 3 + + set_register_state(gpr1, (unsigned int*)dst->f.i.rt, 1, 1); +#endif +} + +void gensb(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[32]); +#endif +#ifdef INTERPRET_SB + gencallinterp((unsigned long long)cached_interpreter_table.SB, 0); +#else + free_registers_move_start(); + + mov_xreg8_m8rel(CL, (unsigned char *)dst->f.i.rt); + mov_xreg32_m32rel(EAX, (unsigned int *)dst->f.i.rs); + add_eax_imm32((int)dst->f.i.immediate); + mov_reg32_reg32(EBX, EAX); + mov_reg64_imm64(RSI, (unsigned long long) writememb); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + mov_reg64_imm64(RDI, (unsigned long long) write_rdramb); + shr_reg32_imm8(EAX, 16); + mov_reg64_preg64x8preg64(RAX, RAX, RSI); + cmp_reg64_reg64(RAX, RDI); + } + je_rj(49); + + mov_reg64_imm64(RAX, (unsigned long long) (dst+1)); // 10 + mov_m64rel_xreg64((unsigned long long *)(&PC), RAX); // 7 + mov_m32rel_xreg32((unsigned int *)(&address), EBX); // 7 + mov_m8rel_xreg8((unsigned char *)(&cpu_byte), CL); // 7 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg64_preg64x8preg64(RBX, RBX, RSI); // 4 + call_reg64(RBX); // 2 + mov_xreg32_m32rel(EAX, (unsigned int *)(&address)); // 7 + jmp_imm_short(25); // 2 + + mov_reg64_imm64(RSI, (unsigned long long) rdram); // 10 + mov_reg32_reg32(EAX, EBX); // 2 + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + xor_reg8_imm8(BL, 3); // 4 + mov_preg64preg64_reg8(RBX, RSI, CL); // 3 + + mov_reg64_imm64(RSI, (unsigned long long) invalid_code); + mov_reg32_reg32(EBX, EAX); + shr_reg32_imm8(EBX, 12); + cmp_preg64preg64_imm8(RBX, RSI, 0); + jne_rj(65); + + mov_reg64_imm64(RDI, (unsigned long long) blocks); // 10 + mov_reg32_reg32(ECX, EBX); // 2 + mov_reg64_preg64x8preg64(RBX, RBX, RDI); // 4 + mov_reg64_preg64pimm32(RBX, RBX, (int) offsetof(precomp_block, block)); // 7 + mov_reg64_imm64(RDI, (unsigned long long) cached_interpreter_table.NOTCOMPILED); // 10 + and_eax_imm32(0xFFF); // 5 + shr_reg32_imm8(EAX, 2); // 3 + mov_reg32_imm32(EDX, sizeof(precomp_instr)); // 5 + mul_reg32(EDX); // 2 + mov_reg64_preg64preg64pimm32(RAX, RAX, RBX, (int) offsetof(precomp_instr, ops)); // 8 + cmp_reg64_reg64(RAX, RDI); // 3 + je_rj(4); // 2 + mov_preg64preg64_imm8(RCX, RSI, 1); // 4 +#endif +} + +void gensh(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[33]); +#endif +#ifdef INTERPRET_SH + gencallinterp((unsigned long long)cached_interpreter_table.SH, 0); +#else + free_registers_move_start(); + + mov_xreg16_m16rel(CX, (unsigned short *)dst->f.i.rt); + mov_xreg32_m32rel(EAX, (unsigned int *)dst->f.i.rs); + add_eax_imm32((int)dst->f.i.immediate); + mov_reg32_reg32(EBX, EAX); + mov_reg64_imm64(RSI, (unsigned long long) writememh); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + mov_reg64_imm64(RDI, (unsigned long long) write_rdramh); + shr_reg32_imm8(EAX, 16); + mov_reg64_preg64x8preg64(RAX, RAX, RSI); + cmp_reg64_reg64(RAX, RDI); + } + je_rj(50); + + mov_reg64_imm64(RAX, (unsigned long long) (dst+1)); // 10 + mov_m64rel_xreg64((unsigned long long *)(&PC), RAX); // 7 + mov_m32rel_xreg32((unsigned int *)(&address), EBX); // 7 + mov_m16rel_xreg16((unsigned short *)(&hword), CX); // 8 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg64_preg64x8preg64(RBX, RBX, RSI); // 4 + call_reg64(RBX); // 2 + mov_xreg32_m32rel(EAX, (unsigned int *)(&address)); // 7 + jmp_imm_short(26); // 2 + + mov_reg64_imm64(RSI, (unsigned long long) rdram); // 10 + mov_reg32_reg32(EAX, EBX); // 2 + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + xor_reg8_imm8(BL, 2); // 4 + mov_preg64preg64_reg16(RBX, RSI, CX); // 4 + + mov_reg64_imm64(RSI, (unsigned long long) invalid_code); + mov_reg32_reg32(EBX, EAX); + shr_reg32_imm8(EBX, 12); + cmp_preg64preg64_imm8(RBX, RSI, 0); + jne_rj(65); + + mov_reg64_imm64(RDI, (unsigned long long) blocks); // 10 + mov_reg32_reg32(ECX, EBX); // 2 + mov_reg64_preg64x8preg64(RBX, RBX, RDI); // 4 + mov_reg64_preg64pimm32(RBX, RBX, (int) offsetof(precomp_block, block)); // 7 + mov_reg64_imm64(RDI, (unsigned long long) cached_interpreter_table.NOTCOMPILED); // 10 + and_eax_imm32(0xFFF); // 5 + shr_reg32_imm8(EAX, 2); // 3 + mov_reg32_imm32(EDX, sizeof(precomp_instr)); // 5 + mul_reg32(EDX); // 2 + mov_reg64_preg64preg64pimm32(RAX, RAX, RBX, (int) offsetof(precomp_instr, ops)); // 8 + cmp_reg64_reg64(RAX, RDI); // 3 + je_rj(4); // 2 + mov_preg64preg64_imm8(RCX, RSI, 1); // 4 +#endif +} + +void genswl(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[35]); +#endif + gencallinterp((unsigned long long)cached_interpreter_table.SWL, 0); +} + +void gensw(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[34]); +#endif +#ifdef INTERPRET_SW + gencallinterp((unsigned long long)cached_interpreter_table.SW, 0); +#else + free_registers_move_start(); + + mov_xreg32_m32rel(ECX, (unsigned int *)dst->f.i.rt); + mov_xreg32_m32rel(EAX, (unsigned int *)dst->f.i.rs); + add_eax_imm32((int)dst->f.i.immediate); + mov_reg32_reg32(EBX, EAX); + mov_reg64_imm64(RSI, (unsigned long long) writemem); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + mov_reg64_imm64(RDI, (unsigned long long) write_rdram); + shr_reg32_imm8(EAX, 16); + mov_reg64_preg64x8preg64(RAX, RAX, RSI); + cmp_reg64_reg64(RAX, RDI); + } + je_rj(49); + + mov_reg64_imm64(RAX, (unsigned long long) (dst+1)); // 10 + mov_m64rel_xreg64((unsigned long long *)(&PC), RAX); // 7 + mov_m32rel_xreg32((unsigned int *)(&address), EBX); // 7 + mov_m32rel_xreg32((unsigned int *)(&word), ECX); // 7 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg64_preg64x8preg64(RBX, RBX, RSI); // 4 + call_reg64(RBX); // 2 + mov_xreg32_m32rel(EAX, (unsigned int *)(&address)); // 7 + jmp_imm_short(21); // 2 + + mov_reg64_imm64(RSI, (unsigned long long) rdram); // 10 + mov_reg32_reg32(EAX, EBX); // 2 + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + mov_preg64preg64_reg32(RBX, RSI, ECX); // 3 + + mov_reg64_imm64(RSI, (unsigned long long) invalid_code); + mov_reg32_reg32(EBX, EAX); + shr_reg32_imm8(EBX, 12); + cmp_preg64preg64_imm8(RBX, RSI, 0); + jne_rj(65); + + mov_reg64_imm64(RDI, (unsigned long long) blocks); // 10 + mov_reg32_reg32(ECX, EBX); // 2 + mov_reg64_preg64x8preg64(RBX, RBX, RDI); // 4 + mov_reg64_preg64pimm32(RBX, RBX, (int) offsetof(precomp_block, block)); // 7 + mov_reg64_imm64(RDI, (unsigned long long) cached_interpreter_table.NOTCOMPILED); // 10 + and_eax_imm32(0xFFF); // 5 + shr_reg32_imm8(EAX, 2); // 3 + mov_reg32_imm32(EDX, sizeof(precomp_instr)); // 5 + mul_reg32(EDX); // 2 + mov_reg64_preg64preg64pimm32(RAX, RAX, RBX, (int) offsetof(precomp_instr, ops)); // 8 + cmp_reg64_reg64(RAX, RDI); // 3 + je_rj(4); // 2 + mov_preg64preg64_imm8(RCX, RSI, 1); // 4 +#endif +} + +void gensdl(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[37]); +#endif + gencallinterp((unsigned long long)cached_interpreter_table.SDL, 0); +} + +void gensdr(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[38]); +#endif + gencallinterp((unsigned long long)cached_interpreter_table.SDR, 0); +} + +void genswr(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[36]); +#endif + gencallinterp((unsigned long long)cached_interpreter_table.SWR, 0); +} + +void gencheck_cop1_unusable(void) +{ + free_registers_move_start(); + + test_m32rel_imm32((unsigned int*)&Status, 0x20000000); + jne_rj(0); + jump_start_rel8(); + + gencallinterp((unsigned long long)check_cop1_unusable, 0); + + jump_end_rel8(); +} + +void genlwc1(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[39]); +#endif +#ifdef INTERPRET_LWC1 + gencallinterp((unsigned long long)cached_interpreter_table.LWC1, 0); +#else + gencheck_cop1_unusable(); + + mov_xreg32_m32rel(EAX, (unsigned int *)(®[dst->f.lf.base])); + add_eax_imm32((int)dst->f.lf.offset); + mov_reg32_reg32(EBX, EAX); + mov_reg64_imm64(RSI, (unsigned long long) readmem); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + mov_reg64_imm64(RDI, (unsigned long long) read_rdram); + shr_reg32_imm8(EAX, 16); + mov_reg64_preg64x8preg64(RAX, RAX, RSI); + cmp_reg64_reg64(RAX, RDI); + } + je_rj(49); + + mov_reg64_imm64(RAX, (unsigned long long) (dst+1)); // 10 + mov_m64rel_xreg64((unsigned long long *)(&PC), RAX); // 7 + mov_m32rel_xreg32((unsigned int *)(&address), EBX); // 7 + mov_xreg64_m64rel(RDX, (unsigned long long *)(®_cop1_simple[dst->f.lf.ft])); // 7 + mov_m64rel_xreg64((unsigned long long *)(&rdword), RDX); // 7 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg64_preg64x8preg64(RBX, RBX, RSI); // 4 + call_reg64(RBX); // 2 + jmp_imm_short(28); // 2 + + mov_reg64_imm64(RSI, (unsigned long long) rdram); // 10 + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + mov_reg32_preg64preg64(EAX, RBX, RSI); // 3 + mov_xreg64_m64rel(RBX, (unsigned long long *)(®_cop1_simple[dst->f.lf.ft])); // 7 + mov_preg64_reg32(RBX, EAX); // 2 +#endif +} + +void genldc1(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[40]); +#endif +#ifdef INTERPRET_LDC1 + gencallinterp((unsigned long long)cached_interpreter_table.LDC1, 0); +#else + gencheck_cop1_unusable(); + + mov_xreg32_m32rel(EAX, (unsigned int *)(®[dst->f.lf.base])); + add_eax_imm32((int)dst->f.lf.offset); + mov_reg32_reg32(EBX, EAX); + mov_reg64_imm64(RSI, (unsigned long long) readmemd); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + mov_reg64_imm64(RDI, (unsigned long long) read_rdramd); + shr_reg32_imm8(EAX, 16); + mov_reg64_preg64x8preg64(RAX, RAX, RSI); + cmp_reg64_reg64(RAX, RDI); + } + je_rj(49); + + mov_reg64_imm64(RAX, (unsigned long long) (dst+1)); // 10 + mov_m64rel_xreg64((unsigned long long *)(&PC), RAX); // 7 + mov_m32rel_xreg32((unsigned int *)(&address), EBX); // 7 + mov_xreg64_m64rel(RDX, (unsigned long long *)(®_cop1_double[dst->f.lf.ft])); // 7 + mov_m64rel_xreg64((unsigned long long *)(&rdword), RDX); // 7 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg64_preg64x8preg64(RBX, RBX, RSI); // 4 + call_reg64(RBX); // 2 + jmp_imm_short(39); // 2 + + mov_reg64_imm64(RSI, (unsigned long long) rdram); // 10 + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + mov_reg64_preg64preg64(RAX, RBX, RSI); // 4 + mov_xreg64_m64rel(RBX, (unsigned long long *)(®_cop1_double[dst->f.lf.ft])); // 7 + mov_preg64pimm32_reg32(RBX, 4, EAX); // 6 + shr_reg64_imm8(RAX, 32); // 4 + mov_preg64_reg32(RBX, EAX); // 2 +#endif +} + +void gencache(void) +{ +} + +void genld(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[41]); +#endif +#ifdef INTERPRET_LD + gencallinterp((unsigned long long)cached_interpreter_table.LD, 0); +#else + free_registers_move_start(); + + mov_xreg32_m32rel(EAX, (unsigned int *)dst->f.i.rs); + add_eax_imm32((int)dst->f.i.immediate); + mov_reg32_reg32(EBX, EAX); + mov_reg64_imm64(RSI, (unsigned long long) readmemd); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + mov_reg64_imm64(RDI, (unsigned long long) read_rdramd); + shr_reg32_imm8(EAX, 16); + mov_reg64_preg64x8preg64(RAX, RAX, RSI); + cmp_reg64_reg64(RAX, RDI); + } + je_rj(59); + + mov_reg64_imm64(RAX, (unsigned long long) (dst+1)); // 10 + mov_m64rel_xreg64((unsigned long long *)(&PC), RAX); // 7 + mov_m32rel_xreg32((unsigned int *)(&address), EBX); // 7 + mov_reg64_imm64(RAX, (unsigned long long) dst->f.i.rt); // 10 + mov_m64rel_xreg64((unsigned long long *)(&rdword), RAX); // 7 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg64_preg64x8preg64(RBX, RBX, RSI); // 4 + call_reg64(RBX); // 2 + mov_xreg64_m64rel(RAX, (unsigned long long *)(dst->f.i.rt)); // 7 + jmp_imm_short(33); // 2 + + mov_reg64_imm64(RSI, (unsigned long long) rdram); // 10 + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + + mov_reg32_preg64preg64(EAX, RBX, RSI); // 3 + mov_reg32_preg64preg64pimm32(EBX, RBX, RSI, 4); // 7 + shl_reg64_imm8(RAX, 32); // 4 + or_reg64_reg64(RAX, RBX); // 3 + + set_register_state(RAX, (unsigned int*)dst->f.i.rt, 1, 1); +#endif +} + +void genswc1(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[43]); +#endif +#ifdef INTERPRET_SWC1 + gencallinterp((unsigned long long)cached_interpreter_table.SWC1, 0); +#else + gencheck_cop1_unusable(); + + mov_xreg64_m64rel(RDX, (unsigned long long *)(®_cop1_simple[dst->f.lf.ft])); + mov_reg32_preg64(ECX, RDX); + mov_xreg32_m32rel(EAX, (unsigned int *)(®[dst->f.lf.base])); + add_eax_imm32((int)dst->f.lf.offset); + mov_reg32_reg32(EBX, EAX); + mov_reg64_imm64(RSI, (unsigned long long) writemem); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + mov_reg64_imm64(RDI, (unsigned long long) write_rdram); + shr_reg32_imm8(EAX, 16); + mov_reg64_preg64x8preg64(RAX, RAX, RSI); + cmp_reg64_reg64(RAX, RDI); + } + je_rj(49); + + mov_reg64_imm64(RAX, (unsigned long long) (dst+1)); // 10 + mov_m64rel_xreg64((unsigned long long *)(&PC), RAX); // 7 + mov_m32rel_xreg32((unsigned int *)(&address), EBX); // 7 + mov_m32rel_xreg32((unsigned int *)(&word), ECX); // 7 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg64_preg64x8preg64(RBX, RBX, RSI); // 4 + call_reg64(RBX); // 2 + mov_xreg32_m32rel(EAX, (unsigned int *)(&address)); // 7 + jmp_imm_short(21); // 2 + + mov_reg64_imm64(RSI, (unsigned long long) rdram); // 10 + mov_reg32_reg32(EAX, EBX); // 2 + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + mov_preg64preg64_reg32(RBX, RSI, ECX); // 3 + + mov_reg64_imm64(RSI, (unsigned long long) invalid_code); + mov_reg32_reg32(EBX, EAX); + shr_reg32_imm8(EBX, 12); + cmp_preg64preg64_imm8(RBX, RSI, 0); + jne_rj(65); + + mov_reg64_imm64(RDI, (unsigned long long) blocks); // 10 + mov_reg32_reg32(ECX, EBX); // 2 + mov_reg64_preg64x8preg64(RBX, RBX, RDI); // 4 + mov_reg64_preg64pimm32(RBX, RBX, (int) offsetof(precomp_block, block)); // 7 + mov_reg64_imm64(RDI, (unsigned long long) cached_interpreter_table.NOTCOMPILED); // 10 + and_eax_imm32(0xFFF); // 5 + shr_reg32_imm8(EAX, 2); // 3 + mov_reg32_imm32(EDX, sizeof(precomp_instr)); // 5 + mul_reg32(EDX); // 2 + mov_reg64_preg64preg64pimm32(RAX, RAX, RBX, (int) offsetof(precomp_instr, ops)); // 8 + cmp_reg64_reg64(RAX, RDI); // 3 + je_rj(4); // 2 + mov_preg64preg64_imm8(RCX, RSI, 1); // 4 +#endif +} + +void gensdc1(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[44]); +#endif +#ifdef INTERPRET_SDC1 + gencallinterp((unsigned long long)cached_interpreter_table.SDC1, 0); +#else + gencheck_cop1_unusable(); + + mov_xreg64_m64rel(RSI, (unsigned long long *)(®_cop1_double[dst->f.lf.ft])); + mov_reg32_preg64(ECX, RSI); + mov_reg32_preg64pimm32(EDX, RSI, 4); + mov_xreg32_m32rel(EAX, (unsigned int *)(®[dst->f.lf.base])); + add_eax_imm32((int)dst->f.lf.offset); + mov_reg32_reg32(EBX, EAX); + mov_reg64_imm64(RSI, (unsigned long long) writememd); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + mov_reg64_imm64(RDI, (unsigned long long) write_rdramd); + shr_reg32_imm8(EAX, 16); + mov_reg64_preg64x8preg64(RAX, RAX, RSI); + cmp_reg64_reg64(RAX, RDI); + } + je_rj(56); + + mov_reg64_imm64(RAX, (unsigned long long) (dst+1)); // 10 + mov_m64rel_xreg64((unsigned long long *)(&PC), RAX); // 7 + mov_m32rel_xreg32((unsigned int *)(&address), EBX); // 7 + mov_m32rel_xreg32((unsigned int *)(&dword), ECX); // 7 + mov_m32rel_xreg32((unsigned int *)(&dword)+1, EDX); // 7 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg64_preg64x8preg64(RBX, RBX, RSI); // 4 + call_reg64(RBX); // 2 + mov_xreg32_m32rel(EAX, (unsigned int *)(&address)); // 7 + jmp_imm_short(28); // 2 + + mov_reg64_imm64(RSI, (unsigned long long) rdram); // 10 + mov_reg32_reg32(EAX, EBX); // 2 + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + mov_preg64preg64pimm32_reg32(RBX, RSI, 4, ECX); // 7 + mov_preg64preg64_reg32(RBX, RSI, EDX); // 3 + + mov_reg64_imm64(RSI, (unsigned long long) invalid_code); + mov_reg32_reg32(EBX, EAX); + shr_reg32_imm8(EBX, 12); + cmp_preg64preg64_imm8(RBX, RSI, 0); + jne_rj(65); + + mov_reg64_imm64(RDI, (unsigned long long) blocks); // 10 + mov_reg32_reg32(ECX, EBX); // 2 + mov_reg64_preg64x8preg64(RBX, RBX, RDI); // 4 + mov_reg64_preg64pimm32(RBX, RBX, (int) offsetof(precomp_block, block)); // 7 + mov_reg64_imm64(RDI, (unsigned long long) cached_interpreter_table.NOTCOMPILED); // 10 + and_eax_imm32(0xFFF); // 5 + shr_reg32_imm8(EAX, 2); // 3 + mov_reg32_imm32(EDX, sizeof(precomp_instr)); // 5 + mul_reg32(EDX); // 2 + mov_reg64_preg64preg64pimm32(RAX, RAX, RBX, (int) offsetof(precomp_instr, ops)); // 8 + cmp_reg64_reg64(RAX, RDI); // 3 + je_rj(4); // 2 + mov_preg64preg64_imm8(RCX, RSI, 1); // 4 +#endif +} + +void gensd(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[45]); +#endif +#ifdef INTERPRET_SD + gencallinterp((unsigned long long)cached_interpreter_table.SD, 0); +#else + free_registers_move_start(); + + mov_xreg32_m32rel(ECX, (unsigned int *)dst->f.i.rt); + mov_xreg32_m32rel(EDX, ((unsigned int *)dst->f.i.rt)+1); + mov_xreg32_m32rel(EAX, (unsigned int *)dst->f.i.rs); + add_eax_imm32((int)dst->f.i.immediate); + mov_reg32_reg32(EBX, EAX); + mov_reg64_imm64(RSI, (unsigned long long) writememd); + if(fast_memory) + { + and_eax_imm32(0xDF800000); + cmp_eax_imm32(0x80000000); + } + else + { + mov_reg64_imm64(RDI, (unsigned long long) write_rdramd); + shr_reg32_imm8(EAX, 16); + mov_reg64_preg64x8preg64(RAX, RAX, RSI); + cmp_reg64_reg64(RAX, RDI); + } + je_rj(56); + + mov_reg64_imm64(RAX, (unsigned long long) (dst+1)); // 10 + mov_m64rel_xreg64((unsigned long long *)(&PC), RAX); // 7 + mov_m32rel_xreg32((unsigned int *)(&address), EBX); // 7 + mov_m32rel_xreg32((unsigned int *)(&dword), ECX); // 7 + mov_m32rel_xreg32((unsigned int *)(&dword)+1, EDX); // 7 + shr_reg32_imm8(EBX, 16); // 3 + mov_reg64_preg64x8preg64(RBX, RBX, RSI); // 4 + call_reg64(RBX); // 2 + mov_xreg32_m32rel(EAX, (unsigned int *)(&address)); // 7 + jmp_imm_short(28); // 2 + + mov_reg64_imm64(RSI, (unsigned long long) rdram); // 10 + mov_reg32_reg32(EAX, EBX); // 2 + and_reg32_imm32(EBX, 0x7FFFFF); // 6 + mov_preg64preg64pimm32_reg32(RBX, RSI, 4, ECX); // 7 + mov_preg64preg64_reg32(RBX, RSI, EDX); // 3 + + mov_reg64_imm64(RSI, (unsigned long long) invalid_code); + mov_reg32_reg32(EBX, EAX); + shr_reg32_imm8(EBX, 12); + cmp_preg64preg64_imm8(RBX, RSI, 0); + jne_rj(65); + + mov_reg64_imm64(RDI, (unsigned long long) blocks); // 10 + mov_reg32_reg32(ECX, EBX); // 2 + mov_reg64_preg64x8preg64(RBX, RBX, RDI); // 4 + mov_reg64_preg64pimm32(RBX, RBX, (int) offsetof(precomp_block, block)); // 7 + mov_reg64_imm64(RDI, (unsigned long long) cached_interpreter_table.NOTCOMPILED); // 10 + and_eax_imm32(0xFFF); // 5 + shr_reg32_imm8(EAX, 2); // 3 + mov_reg32_imm32(EDX, sizeof(precomp_instr)); // 5 + mul_reg32(EDX); // 2 + mov_reg64_preg64preg64pimm32(RAX, RAX, RBX, (int) offsetof(precomp_instr, ops)); // 8 + cmp_reg64_reg64(RAX, RDI); // 3 + je_rj(4); // 2 + mov_preg64preg64_imm8(RCX, RSI, 1); // 4 +#endif +} + +void genll(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[42]); +#endif + gencallinterp((unsigned long long)cached_interpreter_table.LL, 0); +} + +void gensc(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[46]); +#endif + gencallinterp((unsigned long long)cached_interpreter_table.SC, 0); +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gregimm.c b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gregimm.c new file mode 100644 index 0000000000..6feb3f591b --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gregimm.c @@ -0,0 +1,602 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - gregimm.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2007 Richard Goedeken (Richard42) * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "assemble.h" +#include "interpret.h" + +#include "r4300/recomph.h" +#include "r4300/recomp.h" +#include "r4300/r4300.h" +#include "r4300/ops.h" +#include "r4300/macros.h" + +#include "memory/memory.h" + +static void genbltz_test(void) +{ + int rs_64bit = is64((unsigned int *)dst->f.i.rs); + + if (rs_64bit == 0) + { + int rs = allocate_register_32((unsigned int *)dst->f.i.rs); + + cmp_reg32_imm32(rs, 0); + setl_m8rel((unsigned char *) &branch_taken); + } + else if (rs_64bit == -1) + { + cmp_m32rel_imm32(((unsigned int *)dst->f.i.rs)+1, 0); + setl_m8rel((unsigned char *) &branch_taken); + } + else + { + int rs = allocate_register_64((unsigned long long *)dst->f.i.rs); + + cmp_reg64_imm8(rs, 0); + setl_m8rel((unsigned char *) &branch_taken); + } +} + +void genbltz(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[47]); +#endif +#ifdef INTERPRET_BLTZ + gencallinterp((unsigned long long)cached_interpreter_table.BLTZ, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BLTZ, 1); + return; + } + + genbltz_test(); + gendelayslot(); + gentest(); +#endif +} + +void genbltz_out(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[47]); +#endif +#ifdef INTERPRET_BLTZ_OUT + gencallinterp((unsigned long long)cached_interpreter_table.BLTZ_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BLTZ_OUT, 1); + return; + } + + genbltz_test(); + gendelayslot(); + gentest_out(); +#endif +} + +void genbltz_idle(void) +{ +#ifdef INTERPRET_BLTZ_IDLE + gencallinterp((unsigned long long)cached_interpreter_table.BLTZ_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BLTZ_IDLE, 1); + return; + } + + genbltz_test(); + gentest_idle(); + genbltz(); +#endif +} + +static void genbgez_test(void) +{ + int rs_64bit = is64((unsigned int *)dst->f.i.rs); + + if (rs_64bit == 0) + { + int rs = allocate_register_32((unsigned int *)dst->f.i.rs); + cmp_reg32_imm32(rs, 0); + setge_m8rel((unsigned char *) &branch_taken); + } + else if (rs_64bit == -1) + { + cmp_m32rel_imm32(((unsigned int *)dst->f.i.rs)+1, 0); + setge_m8rel((unsigned char *) &branch_taken); + } + else + { + int rs = allocate_register_64((unsigned long long *)dst->f.i.rs); + cmp_reg64_imm8(rs, 0); + setge_m8rel((unsigned char *) &branch_taken); + } +} + +void genbgez(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[48]); +#endif +#ifdef INTERPRET_BGEZ + gencallinterp((unsigned long long)cached_interpreter_table.BGEZ, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BGEZ, 1); + return; + } + + genbgez_test(); + gendelayslot(); + gentest(); +#endif +} + +void genbgez_out(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[48]); +#endif +#ifdef INTERPRET_BGEZ_OUT + gencallinterp((unsigned long long)cached_interpreter_table.BGEZ_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BGEZ_OUT, 1); + return; + } + + genbgez_test(); + gendelayslot(); + gentest_out(); +#endif +} + +void genbgez_idle(void) +{ +#ifdef INTERPRET_BGEZ_IDLE + gencallinterp((unsigned long long)cached_interpreter_table.BGEZ_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BGEZ_IDLE, 1); + return; + } + + genbgez_test(); + gentest_idle(); + genbgez(); +#endif +} + +void genbltzl(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[49]); +#endif +#ifdef INTERPRET_BLTZL + gencallinterp((unsigned long long)cached_interpreter_table.BLTZL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BLTZL, 1); + return; + } + + genbltz_test(); + free_all_registers(); + gentestl(); +#endif +} + +void genbltzl_out(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[49]); +#endif +#ifdef INTERPRET_BLTZL_OUT + gencallinterp((unsigned long long)cached_interpreter_table.BLTZL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BLTZL_OUT, 1); + return; + } + + genbltz_test(); + free_all_registers(); + gentestl_out(); +#endif +} + +void genbltzl_idle(void) +{ +#ifdef INTERPRET_BLTZL_IDLE + gencallinterp((unsigned long long)cached_interpreter_table.BLTZL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BLTZL_IDLE, 1); + return; + } + + genbltz_test(); + gentest_idle(); + genbltzl(); +#endif +} + +void genbgezl(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[50]); +#endif +#ifdef INTERPRET_BGEZL + gencallinterp((unsigned long long)cached_interpreter_table.BGEZL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BGEZL, 1); + return; + } + + genbgez_test(); + free_all_registers(); + gentestl(); +#endif +} + +void genbgezl_out(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[50]); +#endif +#ifdef INTERPRET_BGEZL_OUT + gencallinterp((unsigned long long)cached_interpreter_table.BGEZL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BGEZL_OUT, 1); + return; + } + + genbgez_test(); + free_all_registers(); + gentestl_out(); +#endif +} + +void genbgezl_idle(void) +{ +#ifdef INTERPRET_BGEZL_IDLE + gencallinterp((unsigned long long)cached_interpreter_table.BGEZL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BGEZL_IDLE, 1); + return; + } + + genbgez_test(); + gentest_idle(); + genbgezl(); +#endif +} + +static void genbranchlink(void) +{ + int r31_64bit = is64((unsigned int*)®[31]); + + if (r31_64bit == 0) + { + int r31 = allocate_register_32_w((unsigned int *)®[31]); + + mov_reg32_imm32(r31, dst->addr+8); + } + else if (r31_64bit == -1) + { + mov_m32rel_imm32((unsigned int *)®[31], dst->addr + 8); + if (dst->addr & 0x80000000) + mov_m32rel_imm32(((unsigned int *)®[31])+1, 0xFFFFFFFF); + else + mov_m32rel_imm32(((unsigned int *)®[31])+1, 0); + } + else + { + int r31 = allocate_register_64_w((unsigned long long *)®[31]); + + mov_reg32_imm32(r31, dst->addr+8); + movsxd_reg64_reg32(r31, r31); + } +} + +void genbltzal(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[51]); +#endif +#ifdef INTERPRET_BLTZAL + gencallinterp((unsigned long long)cached_interpreter_table.BLTZAL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BLTZAL, 1); + return; + } + + genbltz_test(); + genbranchlink(); + gendelayslot(); + gentest(); +#endif +} + +void genbltzal_out(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[51]); +#endif +#ifdef INTERPRET_BLTZAL_OUT + gencallinterp((unsigned long long)cached_interpreter_table.BLTZAL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BLTZAL_OUT, 1); + return; + } + + genbltz_test(); + genbranchlink(); + gendelayslot(); + gentest_out(); +#endif +} + +void genbltzal_idle(void) +{ +#ifdef INTERPRET_BLTZAL_IDLE + gencallinterp((unsigned long long)cached_interpreter_table.BLTZAL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BLTZAL_IDLE, 1); + return; + } + + genbltz_test(); + genbranchlink(); + gentest_idle(); + genbltzal(); +#endif +} + +void genbgezal(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[52]); +#endif +#ifdef INTERPRET_BGEZAL + gencallinterp((unsigned long long)cached_interpreter_table.BGEZAL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BGEZAL, 1); + return; + } + + genbgez_test(); + genbranchlink(); + gendelayslot(); + gentest(); +#endif +} + +void genbgezal_out(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[52]); +#endif +#ifdef INTERPRET_BGEZAL_OUT + gencallinterp((unsigned long long)cached_interpreter_table.BGEZAL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BGEZAL_OUT, 1); + return; + } + + genbgez_test(); + genbranchlink(); + gendelayslot(); + gentest_out(); +#endif +} + +void genbgezal_idle(void) +{ +#ifdef INTERPRET_BGEZAL_IDLE + gencallinterp((unsigned long long)cached_interpreter_table.BGEZAL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BGEZAL_IDLE, 1); + return; + } + + genbgez_test(); + genbranchlink(); + gentest_idle(); + genbgezal(); +#endif +} + +void genbltzall(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[53]); +#endif +#ifdef INTERPRET_BLTZALL + gencallinterp((unsigned long long)cached_interpreter_table.BLTZALL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BLTZALL, 1); + return; + } + + genbltz_test(); + genbranchlink(); + free_all_registers(); + gentestl(); +#endif +} + +void genbltzall_out(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[53]); +#endif +#ifdef INTERPRET_BLTZALL_OUT + gencallinterp((unsigned long long)cached_interpreter_table.BLTZALL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BLTZALL_OUT, 1); + return; + } + + genbltz_test(); + genbranchlink(); + free_all_registers(); + gentestl_out(); +#endif +} + +void genbltzall_idle(void) +{ +#ifdef INTERPRET_BLTZALL_IDLE + gencallinterp((unsigned long long)cached_interpreter_table.BLTZALL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BLTZALL_IDLE, 1); + return; + } + + genbltz_test(); + genbranchlink(); + gentest_idle(); + genbltzall(); +#endif +} + +void genbgezall(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[54]); +#endif +#ifdef INTERPRET_BGEZALL + gencallinterp((unsigned long long)cached_interpreter_table.BGEZALL, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BGEZALL, 1); + return; + } + + genbgez_test(); + genbranchlink(); + free_all_registers(); + gentestl(); +#endif +} + +void genbgezall_out(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[54]); +#endif +#ifdef INTERPRET_BGEZALL_OUT + gencallinterp((unsigned long long)cached_interpreter_table.BGEZALL_OUT, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BGEZALL_OUT, 1); + return; + } + + genbgez_test(); + genbranchlink(); + free_all_registers(); + gentestl_out(); +#endif +} + +void genbgezall_idle(void) +{ +#ifdef INTERPRET_BGEZALL_IDLE + gencallinterp((unsigned long long)cached_interpreter_table.BGEZALL_IDLE, 1); +#else + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.BGEZALL_IDLE, 1); + return; + } + + genbgez_test(); + genbranchlink(); + gentest_idle(); + genbgezall(); +#endif +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gspecial.c b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gspecial.c new file mode 100644 index 0000000000..e162464475 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gspecial.c @@ -0,0 +1,1062 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - gspecial.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2007 Richard Goedeken (Richard42) * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "assemble.h" +#include "interpret.h" + +#include "r4300/recomph.h" +#include "r4300/recomp.h" +#include "r4300/r4300.h" +#include "r4300/ops.h" +#include "r4300/macros.h" +#include "r4300/exception.h" + +#if !defined(offsetof) +# define offsetof(TYPE,MEMBER) ((unsigned int) &((TYPE*)0)->MEMBER) +#endif + +void gensll(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[55]); +#endif +#ifdef INTERPRET_SLL + gencallinterp((unsigned long long)cached_interpreter_table.SLL, 0); +#else + int rt = allocate_register_32((unsigned int *)dst->f.r.rt); + int rd = allocate_register_32_w((unsigned int *)dst->f.r.rd); + + mov_reg32_reg32(rd, rt); + shl_reg32_imm8(rd, dst->f.r.sa); +#endif +} + +void gensrl(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[56]); +#endif +#ifdef INTERPRET_SRL + gencallinterp((unsigned long long)cached_interpreter_table.SRL, 0); +#else + int rt = allocate_register_32((unsigned int *)dst->f.r.rt); + int rd = allocate_register_32_w((unsigned int *)dst->f.r.rd); + + mov_reg32_reg32(rd, rt); + shr_reg32_imm8(rd, dst->f.r.sa); +#endif +} + +void gensra(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[57]); +#endif +#ifdef INTERPRET_SRA + gencallinterp((unsigned long long)cached_interpreter_table.SRA, 0); +#else + int rt = allocate_register_32((unsigned int *)dst->f.r.rt); + int rd = allocate_register_32_w((unsigned int *)dst->f.r.rd); + + mov_reg32_reg32(rd, rt); + sar_reg32_imm8(rd, dst->f.r.sa); +#endif +} + +void gensllv(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[58]); +#endif +#ifdef INTERPRET_SLLV + gencallinterp((unsigned long long)cached_interpreter_table.SLLV, 0); +#else + int rt, rd; + allocate_register_32_manually(ECX, (unsigned int *)dst->f.r.rs); + + rt = allocate_register_32((unsigned int *)dst->f.r.rt); + rd = allocate_register_32_w((unsigned int *)dst->f.r.rd); + + if (rd != ECX) + { + mov_reg32_reg32(rd, rt); + shl_reg32_cl(rd); + } + else + { + int temp = lru_register(); + free_register(temp); + mov_reg32_reg32(temp, rt); + shl_reg32_cl(temp); + mov_reg32_reg32(rd, temp); + } +#endif +} + +void gensrlv(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[59]); +#endif +#ifdef INTERPRET_SRLV + gencallinterp((unsigned long long)cached_interpreter_table.SRLV, 0); +#else + int rt, rd; + allocate_register_32_manually(ECX, (unsigned int *)dst->f.r.rs); + + rt = allocate_register_32((unsigned int *)dst->f.r.rt); + rd = allocate_register_32_w((unsigned int *)dst->f.r.rd); + + if (rd != ECX) + { + mov_reg32_reg32(rd, rt); + shr_reg32_cl(rd); + } + else + { + int temp = lru_register(); + free_register(temp); + mov_reg32_reg32(temp, rt); + shr_reg32_cl(temp); + mov_reg32_reg32(rd, temp); + } +#endif +} + +void gensrav(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[60]); +#endif +#ifdef INTERPRET_SRAV + gencallinterp((unsigned long long)cached_interpreter_table.SRAV, 0); +#else + int rt, rd; + allocate_register_32_manually(ECX, (unsigned int *)dst->f.r.rs); + + rt = allocate_register_32((unsigned int *)dst->f.r.rt); + rd = allocate_register_32_w((unsigned int *)dst->f.r.rd); + + if (rd != ECX) + { + mov_reg32_reg32(rd, rt); + sar_reg32_cl(rd); + } + else + { + int temp = lru_register(); + free_register(temp); + mov_reg32_reg32(temp, rt); + sar_reg32_cl(temp); + mov_reg32_reg32(rd, temp); + } +#endif +} + +void genjr(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[61]); +#endif +#ifdef INTERPRET_JR + gencallinterp((unsigned long long)cached_interpreter_table.JR, 1); +#else + static unsigned int precomp_instr_size = sizeof(precomp_instr); + unsigned int diff = (unsigned int) offsetof(precomp_instr, local_addr); + unsigned int diff_need = (unsigned int) offsetof(precomp_instr, reg_cache_infos.need_map); + unsigned int diff_wrap = (unsigned int) offsetof(precomp_instr, reg_cache_infos.jump_wrapper); + + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.JR, 1); + return; + } + + free_registers_move_start(); + + mov_xreg32_m32rel(EAX, (unsigned int *)dst->f.i.rs); + mov_m32rel_xreg32((unsigned int *)&local_rs, EAX); + + gendelayslot(); + + mov_xreg32_m32rel(EAX, (unsigned int *)&local_rs); + mov_m32rel_xreg32((unsigned int *)&last_addr, EAX); + + gencheck_interupt_reg(); + + mov_xreg32_m32rel(EAX, (unsigned int *)&local_rs); + mov_reg32_reg32(EBX, EAX); + and_eax_imm32(0xFFFFF000); + cmp_eax_imm32(dst_block->start & 0xFFFFF000); + je_near_rj(0); + + jump_start_rel32(); + + mov_m32rel_xreg32(&jump_to_address, EBX); + mov_reg64_imm64(RAX, (unsigned long long) (dst+1)); + mov_m64rel_xreg64((unsigned long long *)(&PC), RAX); + mov_reg64_imm64(RAX, (unsigned long long) jump_to_func); + call_reg64(RAX); /* will never return from call */ + + jump_end_rel32(); + + mov_reg64_imm64(RSI, (unsigned long long) dst_block->block); + mov_reg32_reg32(EAX, EBX); + sub_eax_imm32(dst_block->start); + shr_reg32_imm8(EAX, 2); + mul_m32rel((unsigned int *)(&precomp_instr_size)); + + mov_reg32_preg64preg64pimm32(EBX, RAX, RSI, diff_need); + cmp_reg32_imm32(EBX, 1); + jne_rj(11); + + add_reg32_imm32(EAX, diff_wrap); // 6 + add_reg64_reg64(RAX, RSI); // 3 + jmp_reg64(RAX); // 2 + + mov_reg32_preg64preg64pimm32(EBX, RAX, RSI, diff); + mov_rax_memoffs64((unsigned long long *) &dst_block->code); + add_reg64_reg64(RAX, RBX); + jmp_reg64(RAX); +#endif +} + +void genjalr(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[62]); +#endif +#ifdef INTERPRET_JALR + gencallinterp((unsigned long long)cached_interpreter_table.JALR, 0); +#else + static unsigned int precomp_instr_size = sizeof(precomp_instr); + unsigned int diff = (unsigned int) offsetof(precomp_instr, local_addr); + unsigned int diff_need = (unsigned int) offsetof(precomp_instr, reg_cache_infos.need_map); + unsigned int diff_wrap = (unsigned int) offsetof(precomp_instr, reg_cache_infos.jump_wrapper); + + if (((dst->addr & 0xFFF) == 0xFFC && + (dst->addr < 0x80000000 || dst->addr >= 0xC0000000))||no_compiled_jump) + { + gencallinterp((unsigned long long)cached_interpreter_table.JALR, 1); + return; + } + + free_registers_move_start(); + + mov_xreg32_m32rel(EAX, (unsigned int *)dst->f.r.rs); + mov_m32rel_xreg32((unsigned int *)&local_rs, EAX); + + gendelayslot(); + + mov_m32rel_imm32((unsigned int *)(dst-1)->f.r.rd, dst->addr+4); + if ((dst->addr+4) & 0x80000000) + mov_m32rel_imm32(((unsigned int *)(dst-1)->f.r.rd)+1, 0xFFFFFFFF); + else + mov_m32rel_imm32(((unsigned int *)(dst-1)->f.r.rd)+1, 0); + + mov_xreg32_m32rel(EAX, (unsigned int *)&local_rs); + mov_m32rel_xreg32((unsigned int *)&last_addr, EAX); + + gencheck_interupt_reg(); + + mov_xreg32_m32rel(EAX, (unsigned int *)&local_rs); + mov_reg32_reg32(EBX, EAX); + and_eax_imm32(0xFFFFF000); + cmp_eax_imm32(dst_block->start & 0xFFFFF000); + je_near_rj(0); + + jump_start_rel32(); + + mov_m32rel_xreg32(&jump_to_address, EBX); + mov_reg64_imm64(RAX, (unsigned long long) (dst+1)); + mov_m64rel_xreg64((unsigned long long *)(&PC), RAX); + mov_reg64_imm64(RAX, (unsigned long long) jump_to_func); + call_reg64(RAX); /* will never return from call */ + + jump_end_rel32(); + + mov_reg64_imm64(RSI, (unsigned long long) dst_block->block); + mov_reg32_reg32(EAX, EBX); + sub_eax_imm32(dst_block->start); + shr_reg32_imm8(EAX, 2); + mul_m32rel((unsigned int *)(&precomp_instr_size)); + + mov_reg32_preg64preg64pimm32(EBX, RAX, RSI, diff_need); + cmp_reg32_imm32(EBX, 1); + jne_rj(11); + + add_reg32_imm32(EAX, diff_wrap); // 6 + add_reg64_reg64(RAX, RSI); // 3 + jmp_reg64(RAX); // 2 + + mov_reg32_preg64preg64pimm32(EBX, RAX, RSI, diff); + mov_rax_memoffs64((unsigned long long *) &dst_block->code); + add_reg64_reg64(RAX, RBX); + jmp_reg64(RAX); +#endif +} + +void gensyscall(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[63]); +#endif +#ifdef INTERPRET_SYSCALL + gencallinterp((unsigned long long)cached_interpreter_table.SYSCALL, 0); +#else + free_registers_move_start(); + + mov_m32rel_imm32(&Cause, 8 << 2); + gencallinterp((unsigned long long)exception_general, 0); +#endif +} + +void gensync(void) +{ +} + +void genmfhi(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[64]); +#endif +#ifdef INTERPRET_MFHI + gencallinterp((unsigned long long)cached_interpreter_table.MFHI, 0); +#else + int rd = allocate_register_64_w((unsigned long long *) dst->f.r.rd); + int _hi = allocate_register_64((unsigned long long *) &hi); + + mov_reg64_reg64(rd, _hi); +#endif +} + +void genmthi(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[65]); +#endif +#ifdef INTERPRET_MTHI + gencallinterp((unsigned long long)cached_interpreter_table.MTHI, 0); +#else + int _hi = allocate_register_64_w((unsigned long long *) &hi); + int rs = allocate_register_64((unsigned long long *) dst->f.r.rs); + + mov_reg64_reg64(_hi, rs); +#endif +} + +void genmflo(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[66]); +#endif +#ifdef INTERPRET_MFLO + gencallinterp((unsigned long long)cached_interpreter_table.MFLO, 0); +#else + int rd = allocate_register_64_w((unsigned long long *) dst->f.r.rd); + int _lo = allocate_register_64((unsigned long long *) &lo); + + mov_reg64_reg64(rd, _lo); +#endif +} + +void genmtlo(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[67]); +#endif +#ifdef INTERPRET_MTLO + gencallinterp((unsigned long long)cached_interpreter_table.MTLO, 0); +#else + int _lo = allocate_register_64_w((unsigned long long *)&lo); + int rs = allocate_register_64((unsigned long long *)dst->f.r.rs); + + mov_reg64_reg64(_lo, rs); +#endif +} + +void gendsllv(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[68]); +#endif +#ifdef INTERPRET_DSLLV + gencallinterp((unsigned long long)cached_interpreter_table.DSLLV, 0); +#else + int rt, rd; + allocate_register_32_manually(ECX, (unsigned int *)dst->f.r.rs); + + rt = allocate_register_64((unsigned long long *)dst->f.r.rt); + rd = allocate_register_64_w((unsigned long long *)dst->f.r.rd); + + if (rd != ECX) + { + mov_reg64_reg64(rd, rt); + shl_reg64_cl(rd); + } + else + { + int temp; + temp = lru_register(); + free_register(temp); + + mov_reg64_reg64(temp, rt); + shl_reg64_cl(temp); + mov_reg64_reg64(rd, temp); + } +#endif +} + +void gendsrlv(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[69]); +#endif +#ifdef INTERPRET_DSRLV + gencallinterp((unsigned long long)cached_interpreter_table.DSRLV, 0); +#else + int rt, rd; + allocate_register_32_manually(ECX, (unsigned int *)dst->f.r.rs); + + rt = allocate_register_64((unsigned long long *)dst->f.r.rt); + rd = allocate_register_64_w((unsigned long long *)dst->f.r.rd); + + if (rd != ECX) + { + mov_reg64_reg64(rd, rt); + shr_reg64_cl(rd); + } + else + { + int temp; + temp = lru_register(); + free_register(temp); + + mov_reg64_reg64(temp, rt); + shr_reg64_cl(temp); + mov_reg64_reg64(rd, temp); + } +#endif +} + +void gendsrav(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[70]); +#endif +#ifdef INTERPRET_DSRAV + gencallinterp((unsigned long long)cached_interpreter_table.DSRAV, 0); +#else + int rt, rd; + allocate_register_32_manually(ECX, (unsigned int *)dst->f.r.rs); + + rt = allocate_register_64((unsigned long long *)dst->f.r.rt); + rd = allocate_register_64_w((unsigned long long *)dst->f.r.rd); + + if (rd != ECX) + { + mov_reg64_reg64(rd, rt); + sar_reg64_cl(rd); + } + else + { + int temp; + temp = lru_register(); + free_register(temp); + + mov_reg64_reg64(temp, rt); + sar_reg64_cl(temp); + mov_reg64_reg64(rd, temp); + } +#endif +} + +void genmult(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[71]); +#endif +#ifdef INTERPRET_MULT + gencallinterp((unsigned long long)cached_interpreter_table.MULT, 0); +#else + int rs, rt; + allocate_register_32_manually_w(EAX, (unsigned int *)&lo); /* these must be done first so they are not assigned by allocate_register() */ + allocate_register_32_manually_w(EDX, (unsigned int *)&hi); + rs = allocate_register_32((unsigned int*)dst->f.r.rs); + rt = allocate_register_32((unsigned int*)dst->f.r.rt); + mov_reg32_reg32(EAX, rs); + imul_reg32(rt); +#endif +} + +void genmultu(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[72]); +#endif +#ifdef INTERPRET_MULTU + gencallinterp((unsigned long long)cached_interpreter_table.MULTU, 0); +#else + int rs, rt; + allocate_register_32_manually_w(EAX, (unsigned int *)&lo); + allocate_register_32_manually_w(EDX, (unsigned int *)&hi); + rs = allocate_register_32((unsigned int*)dst->f.r.rs); + rt = allocate_register_32((unsigned int*)dst->f.r.rt); + mov_reg32_reg32(EAX, rs); + mul_reg32(rt); +#endif +} + +void gendiv(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[73]); +#endif +#ifdef INTERPRET_DIV + gencallinterp((unsigned long long)cached_interpreter_table.DIV, 0); +#else + int rs, rt; + allocate_register_32_manually_w(EAX, (unsigned int *)&lo); + allocate_register_32_manually_w(EDX, (unsigned int *)&hi); + rs = allocate_register_32((unsigned int*)dst->f.r.rs); + rt = allocate_register_32((unsigned int*)dst->f.r.rt); + cmp_reg32_imm32(rt, 0); + je_rj((rs == EAX ? 0 : 2) + 1 + 2); + mov_reg32_reg32(EAX, rs); // 0 or 2 + cdq(); // 1 + idiv_reg32(rt); // 2 +#endif +} + +void gendivu(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[74]); +#endif +#ifdef INTERPRET_DIVU + gencallinterp((unsigned long long)cached_interpreter_table.DIVU, 0); +#else + int rs, rt; + allocate_register_32_manually_w(EAX, (unsigned int *)&lo); + allocate_register_32_manually_w(EDX, (unsigned int *)&hi); + rs = allocate_register_32((unsigned int*)dst->f.r.rs); + rt = allocate_register_32((unsigned int*)dst->f.r.rt); + cmp_reg32_imm32(rt, 0); + je_rj((rs == EAX ? 0 : 2) + 2 + 2); + mov_reg32_reg32(EAX, rs); // 0 or 2 + xor_reg32_reg32(EDX, EDX); // 2 + div_reg32(rt); // 2 +#endif +} + +void gendmult(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[75]); +#endif + gencallinterp((unsigned long long)cached_interpreter_table.DMULT, 0); +} + +void gendmultu(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[76]); +#endif +#ifdef INTERPRET_DMULTU + gencallinterp((unsigned long long)cached_interpreter_table.DMULTU, 0); +#else + free_registers_move_start(); + + mov_xreg64_m64rel(RAX, (unsigned long long *) dst->f.r.rs); + mov_xreg64_m64rel(RDX, (unsigned long long *) dst->f.r.rt); + mul_reg64(RDX); + mov_m64rel_xreg64((unsigned long long *) &lo, RAX); + mov_m64rel_xreg64((unsigned long long *) &hi, RDX); +#endif +} + +void genddiv(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[77]); +#endif + gencallinterp((unsigned long long)cached_interpreter_table.DDIV, 0); +} + +void genddivu(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[78]); +#endif + gencallinterp((unsigned long long)cached_interpreter_table.DDIVU, 0); +} + +void genadd(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[79]); +#endif +#ifdef INTERPRET_ADD + gencallinterp((unsigned long long)cached_interpreter_table.ADD, 0); +#else + int rs = allocate_register_32((unsigned int *)dst->f.r.rs); + int rt = allocate_register_32((unsigned int *)dst->f.r.rt); + int rd = allocate_register_32_w((unsigned int *)dst->f.r.rd); + + if (rs == rd) + add_reg32_reg32(rd, rt); + else if (rt == rd) + add_reg32_reg32(rd, rs); + else + { + mov_reg32_reg32(rd, rs); + add_reg32_reg32(rd, rt); + } +#endif +} + +void genaddu(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[80]); +#endif +#ifdef INTERPRET_ADDU + gencallinterp((unsigned long long)cached_interpreter_table.ADDU, 0); +#else + int rs = allocate_register_32((unsigned int *)dst->f.r.rs); + int rt = allocate_register_32((unsigned int *)dst->f.r.rt); + int rd = allocate_register_32_w((unsigned int *)dst->f.r.rd); + + if (rs == rd) + add_reg32_reg32(rd, rt); + else if (rt == rd) + add_reg32_reg32(rd, rs); + else + { + mov_reg32_reg32(rd, rs); + add_reg32_reg32(rd, rt); + } +#endif +} + +void gensub(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[81]); +#endif +#ifdef INTERPRET_SUB + gencallinterp((unsigned long long)cached_interpreter_table.SUB, 0); +#else + int rs = allocate_register_32((unsigned int *)dst->f.r.rs); + int rt = allocate_register_32((unsigned int *)dst->f.r.rt); + int rd = allocate_register_32_w((unsigned int *)dst->f.r.rd); + + if (rs == rd) + sub_reg32_reg32(rd, rt); + else if (rt == rd) + { + neg_reg32(rd); + add_reg32_reg32(rd, rs); + } + else + { + mov_reg32_reg32(rd, rs); + sub_reg32_reg32(rd, rt); + } +#endif +} + +void gensubu(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[82]); +#endif +#ifdef INTERPRET_SUBU + gencallinterp((unsigned long long)cached_interpreter_table.SUBU, 0); +#else + int rs = allocate_register_32((unsigned int *)dst->f.r.rs); + int rt = allocate_register_32((unsigned int *)dst->f.r.rt); + int rd = allocate_register_32_w((unsigned int *)dst->f.r.rd); + + if (rs == rd) + sub_reg32_reg32(rd, rt); + else if (rt == rd) + { + neg_reg32(rd); + add_reg32_reg32(rd, rs); + } + else + { + mov_reg32_reg32(rd, rs); + sub_reg32_reg32(rd, rt); + } +#endif +} + +void genand(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[83]); +#endif +#ifdef INTERPRET_AND + gencallinterp((unsigned long long)cached_interpreter_table.AND, 0); +#else + int rs = allocate_register_64((unsigned long long *)dst->f.r.rs); + int rt = allocate_register_64((unsigned long long *)dst->f.r.rt); + int rd = allocate_register_64_w((unsigned long long *)dst->f.r.rd); + + if (rs == rd) + and_reg64_reg64(rd, rt); + else if (rt == rd) + and_reg64_reg64(rd, rs); + else + { + mov_reg64_reg64(rd, rs); + and_reg64_reg64(rd, rt); + } +#endif +} + +void genor(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[84]); +#endif +#ifdef INTERPRET_OR + gencallinterp((unsigned long long)cached_interpreter_table.OR, 0); +#else + int rs = allocate_register_64((unsigned long long *)dst->f.r.rs); + int rt = allocate_register_64((unsigned long long *)dst->f.r.rt); + int rd = allocate_register_64_w((unsigned long long *)dst->f.r.rd); + + if (rs == rd) + or_reg64_reg64(rd, rt); + else if (rt == rd) + or_reg64_reg64(rd, rs); + else + { + mov_reg64_reg64(rd, rs); + or_reg64_reg64(rd, rt); + } +#endif +} + +void genxor(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[85]); +#endif +#ifdef INTERPRET_XOR + gencallinterp((unsigned long long)cached_interpreter_table.XOR, 0); +#else + int rs = allocate_register_64((unsigned long long *)dst->f.r.rs); + int rt = allocate_register_64((unsigned long long *)dst->f.r.rt); + int rd = allocate_register_64_w((unsigned long long *)dst->f.r.rd); + + if (rs == rd) + xor_reg64_reg64(rd, rt); + else if (rt == rd) + xor_reg64_reg64(rd, rs); + else + { + mov_reg64_reg64(rd, rs); + xor_reg64_reg64(rd, rt); + } +#endif +} + +void gennor(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[86]); +#endif +#ifdef INTERPRET_NOR + gencallinterp((unsigned long long)cached_interpreter_table.NOR, 0); +#else + int rs = allocate_register_64((unsigned long long *)dst->f.r.rs); + int rt = allocate_register_64((unsigned long long *)dst->f.r.rt); + int rd = allocate_register_64_w((unsigned long long *)dst->f.r.rd); + + if (rs == rd) + { + or_reg64_reg64(rd, rt); + not_reg64(rd); + } + else if (rt == rd) + { + or_reg64_reg64(rd, rs); + not_reg64(rd); + } + else + { + mov_reg64_reg64(rd, rs); + or_reg64_reg64(rd, rt); + not_reg64(rd); + } +#endif +} + +void genslt(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[87]); +#endif +#ifdef INTERPRET_SLT + gencallinterp((unsigned long long)cached_interpreter_table.SLT, 0); +#else + int rs = allocate_register_64((unsigned long long *)dst->f.r.rs); + int rt = allocate_register_64((unsigned long long *)dst->f.r.rt); + int rd = allocate_register_64_w((unsigned long long *)dst->f.r.rd); + + cmp_reg64_reg64(rs, rt); + setl_reg8(rd); + and_reg64_imm8(rd, 1); +#endif +} + +void gensltu(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[88]); +#endif +#ifdef INTERPRET_SLTU + gencallinterp((unsigned long long)cached_interpreter_table.SLTU, 0); +#else + int rs = allocate_register_64((unsigned long long *)dst->f.r.rs); + int rt = allocate_register_64((unsigned long long *)dst->f.r.rt); + int rd = allocate_register_64_w((unsigned long long *)dst->f.r.rd); + + cmp_reg64_reg64(rs, rt); + setb_reg8(rd); + and_reg64_imm8(rd, 1); +#endif +} + +void gendadd(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[89]); +#endif +#ifdef INTERPRET_DADD + gencallinterp((unsigned long long)cached_interpreter_table.DADD, 0); +#else + int rs = allocate_register_64((unsigned long long *)dst->f.r.rs); + int rt = allocate_register_64((unsigned long long *)dst->f.r.rt); + int rd = allocate_register_64_w((unsigned long long *)dst->f.r.rd); + + if (rs == rd) + add_reg64_reg64(rd, rt); + else if (rt == rd) + add_reg64_reg64(rd, rs); + else + { + mov_reg64_reg64(rd, rs); + add_reg64_reg64(rd, rt); + } +#endif +} + +void gendaddu(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[90]); +#endif +#ifdef INTERPRET_DADDU + gencallinterp((unsigned long long)cached_interpreter_table.DADDU, 0); +#else + int rs = allocate_register_64((unsigned long long *)dst->f.r.rs); + int rt = allocate_register_64((unsigned long long *)dst->f.r.rt); + int rd = allocate_register_64_w((unsigned long long *)dst->f.r.rd); + + if (rs == rd) + add_reg64_reg64(rd, rt); + else if (rt == rd) + add_reg64_reg64(rd, rs); + else + { + mov_reg64_reg64(rd, rs); + add_reg64_reg64(rd, rt); + } +#endif +} + +void gendsub(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[91]); +#endif +#ifdef INTERPRET_DSUB + gencallinterp((unsigned long long)cached_interpreter_table.DSUB, 0); +#else + int rs = allocate_register_64((unsigned long long *)dst->f.r.rs); + int rt = allocate_register_64((unsigned long long *)dst->f.r.rt); + int rd = allocate_register_64_w((unsigned long long *)dst->f.r.rd); + + if (rs == rd) + sub_reg64_reg64(rd, rt); + else if (rt == rd) + { + neg_reg64(rd); + add_reg64_reg64(rd, rs); + } + else + { + mov_reg64_reg64(rd, rs); + sub_reg64_reg64(rd, rt); + } +#endif +} + +void gendsubu(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[92]); +#endif +#ifdef INTERPRET_DSUBU + gencallinterp((unsigned long long)cached_interpreter_table.DSUBU, 0); +#else + int rs = allocate_register_64((unsigned long long *)dst->f.r.rs); + int rt = allocate_register_64((unsigned long long *)dst->f.r.rt); + int rd = allocate_register_64_w((unsigned long long *)dst->f.r.rd); + + if (rs == rd) + sub_reg64_reg64(rd, rt); + else if (rt == rd) + { + neg_reg64(rd); + add_reg64_reg64(rd, rs); + } + else + { + mov_reg64_reg64(rd, rs); + sub_reg64_reg64(rd, rt); + } +#endif +} + +void genteq(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[96]); +#endif + gencallinterp((unsigned long long)cached_interpreter_table.TEQ, 0); +} + +void gendsll(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[93]); +#endif +#ifdef INTERPRET_DSLL + gencallinterp((unsigned long long)cached_interpreter_table.DSLL, 0); +#else + int rt = allocate_register_64((unsigned long long *)dst->f.r.rt); + int rd = allocate_register_64_w((unsigned long long *)dst->f.r.rd); + + mov_reg64_reg64(rd, rt); + shl_reg64_imm8(rd, dst->f.r.sa); +#endif +} + +void gendsrl(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[94]); +#endif +#ifdef INTERPRET_DSRL + gencallinterp((unsigned long long)cached_interpreter_table.DSRL, 0); +#else + int rt = allocate_register_64((unsigned long long *)dst->f.r.rt); + int rd = allocate_register_64_w((unsigned long long *)dst->f.r.rd); + + mov_reg64_reg64(rd, rt); + shr_reg64_imm8(rd, dst->f.r.sa); +#endif +} + +void gendsra(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[95]); +#endif +#ifdef INTERPRET_DSRA + gencallinterp((unsigned long long)cached_interpreter_table.DSRA, 0); +#else + int rt = allocate_register_64((unsigned long long *)dst->f.r.rt); + int rd = allocate_register_64_w((unsigned long long *)dst->f.r.rd); + + mov_reg64_reg64(rd, rt); + sar_reg64_imm8(rd, dst->f.r.sa); +#endif +} + +void gendsll32(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[97]); +#endif +#ifdef INTERPRET_DSLL32 + gencallinterp((unsigned long long)cached_interpreter_table.DSLL32, 0); +#else + int rt = allocate_register_64((unsigned long long *)dst->f.r.rt); + int rd = allocate_register_64_w((unsigned long long *)dst->f.r.rd); + + mov_reg64_reg64(rd, rt); + shl_reg64_imm8(rd, dst->f.r.sa + 32); +#endif +} + +void gendsrl32(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[98]); +#endif +#ifdef INTERPRET_DSRL32 + gencallinterp((unsigned long long)cached_interpreter_table.DSRL32, 0); +#else + int rt = allocate_register_64((unsigned long long *)dst->f.r.rt); + int rd = allocate_register_64_w((unsigned long long *)dst->f.r.rd); + + mov_reg64_reg64(rd, rt); + shr_reg64_imm8(rd, dst->f.r.sa + 32); +#endif +} + +void gendsra32(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[99]); +#endif +#ifdef INTERPRET_DSRA32 + gencallinterp((unsigned long long)cached_interpreter_table.DSRA32, 0); +#else + int rt = allocate_register_64((unsigned long long *)dst->f.r.rt); + int rd = allocate_register_64_w((unsigned long long *)dst->f.r.rd); + + mov_reg64_reg64(rd, rt); + sar_reg64_imm8(rd, dst->f.r.sa + 32); +#endif +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gtlb.c b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gtlb.c new file mode 100644 index 0000000000..294d009e9c --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/gtlb.c @@ -0,0 +1,92 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - gtlb.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2007 Richard Goedeken (Richard42) * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "assemble.h" + +#include "r4300/recomph.h" +#include "r4300/r4300.h" +#include "r4300/ops.h" + +void gentlbwi(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[104]); +#endif + gencallinterp((unsigned long long)cached_interpreter_table.TLBWI, 0); + /*dst->local_addr = code_length; + mov_m32_imm32((void *)(&PC), (unsigned int)(dst)); + mov_reg32_imm32(EAX, (unsigned int)(TLBWI)); + call_reg32(EAX); + genupdate_system(0);*/ +} + +void gentlbp(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[105]); +#endif + gencallinterp((unsigned long long)cached_interpreter_table.TLBP, 0); + /*dst->local_addr = code_length; + mov_m32_imm32((void *)(&PC), (unsigned int)(dst)); + mov_reg32_imm32(EAX, (unsigned int)(TLBP)); + call_reg32(EAX); + genupdate_system(0);*/ +} + +void gentlbr(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[106]); +#endif + gencallinterp((unsigned long long)cached_interpreter_table.TLBR, 0); + /*dst->local_addr = code_length; + mov_m32_imm32((void *)(&PC), (unsigned int)(dst)); + mov_reg32_imm32(EAX, (unsigned int)(TLBR)); + call_reg32(EAX); + genupdate_system(0);*/ +} + +void generet(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[108]); +#endif + gencallinterp((unsigned long long)cached_interpreter_table.ERET, 1); + /*dst->local_addr = code_length; + mov_m32_imm32((void *)(&PC), (unsigned int)(dst)); + genupdate_system(0); + mov_reg32_imm32(EAX, (unsigned int)(ERET)); + call_reg32(EAX); + mov_reg32_imm32(EAX, (unsigned int)(jump_code)); + jmp_reg32(EAX);*/ +} + +void gentlbwr(void) +{ +#if defined(COUNT_INSTR) + inc_m32rel(&instr_count[107]); +#endif + gencallinterp((unsigned long long)cached_interpreter_table.TLBWR, 0); +} + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86_64/interpret.h b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/interpret.h new file mode 100644 index 0000000000..c521d61320 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/interpret.h @@ -0,0 +1,240 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - interpret.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2007 Richard Goedeken (Richard42) * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __INTERPRET_H__ +#define __INTERPRET_H__ + +//#define INTERPRET_J +//#define INTERPRET_J_OUT +//#define INTERPRET_J_IDLE +//#define INTERPRET_JAL +//#define INTERPRET_JAL_OUT +//#define INTERPRET_JAL_IDLE +//#define INTERPRET_BEQ +//#define INTERPRET_BEQ_OUT +//#define INTERPRET_BEQ_IDLE +//#define INTERPRET_BNE +//#define INTERPRET_BNE_OUT +//#define INTERPRET_BNE_IDLE +//#define INTERPRET_BLEZ +//#define INTERPRET_BLEZ_OUT +//#define INTERPRET_BLEZ_IDLE +//#define INTERPRET_BGTZ +//#define INTERPRET_BGTZ_OUT +//#define INTERPRET_BGTZ_IDLE +//#define INTERPRET_ADDI +//#define INTERPRET_ADDIU +//#define INTERPRET_SLTI +//#define INTERPRET_SLTIU +//#define INTERPRET_ANDI +//#define INTERPRET_ORI +//#define INTERPRET_XORI +//#define INTERPRET_LUI +//#define INTERPRET_BEQL +//#define INTERPRET_BEQL_OUT +//#define INTERPRET_BEQL_IDLE +//#define INTERPRET_BNEL +//#define INTERPRET_BNEL_OUT +//#define INTERPRET_BNEL_IDLE +//#define INTERPRET_BLEZL +//#define INTERPRET_BLEZL_OUT +//#define INTERPRET_BLEZL_IDLE +//#define INTERPRET_BGTZL +//#define INTERPRET_BGTZL_OUT +//#define INTERPRET_BGTZL_IDLE +//#define INTERPRET_DADDI +//#define INTERPRET_DADDIU +//#define INTERPRET_LB +//#define INTERPRET_LH +//#define INTERPRET_LW +//#define INTERPRET_LBU +//#define INTERPRET_LHU +//#define INTERPRET_LWU +//#define INTERPRET_SB +//#define INTERPRET_SH +//#define INTERPRET_SW +//#define INTERPRET_LWC1 +//#define INTERPRET_LDC1 +//#define INTERPRET_LD +//#define INTERPRET_SWC1 +//#define INTERPRET_SDC1 +//#define INTERPRET_SD +//#define INTERPRET_SLL +//#define INTERPRET_SRL +//#define INTERPRET_SRA +//#define INTERPRET_SLLV +//#define INTERPRET_SRLV +//#define INTERPRET_SRAV +//#define INTERPRET_JR +//#define INTERPRET_JALR +//#define INTERPRET_SYSCALL +//#define INTERPRET_MFHI +//#define INTERPRET_MTHI +//#define INTERPRET_MFLO +//#define INTERPRET_MTLO +//#define INTERPRET_DSLLV +//#define INTERPRET_DSRLV +//#define INTERPRET_DSRAV +//#define INTERPRET_MULT +//#define INTERPRET_MULTU +//#define INTERPRET_DIV +//#define INTERPRET_DIVU +//#define INTERPRET_DMULTU +//#define INTERPRET_ADD +//#define INTERPRET_ADDU +//#define INTERPRET_SUB +//#define INTERPRET_SUBU +//#define INTERPRET_AND +//#define INTERPRET_OR +//#define INTERPRET_XOR +//#define INTERPRET_NOR +//#define INTERPRET_SLT +//#define INTERPRET_SLTU +//#define INTERPRET_DADD +//#define INTERPRET_DADDU +//#define INTERPRET_DSUB +//#define INTERPRET_DSUBU +//#define INTERPRET_DSLL +//#define INTERPRET_DSRL +//#define INTERPRET_DSRA +//#define INTERPRET_DSLL32 +//#define INTERPRET_DSRL32 +//#define INTERPRET_DSRA32 +//#define INTERPRET_BLTZ +//#define INTERPRET_BLTZ_OUT +//#define INTERPRET_BLTZ_IDLE +//#define INTERPRET_BGEZ +//#define INTERPRET_BGEZ_OUT +//#define INTERPRET_BGEZ_IDLE +//#define INTERPRET_BLTZL +//#define INTERPRET_BLTZL_OUT +//#define INTERPRET_BLTZL_IDLE +//#define INTERPRET_BGEZL +//#define INTERPRET_BGEZL_OUT +//#define INTERPRET_BGEZL_IDLE +//#define INTERPRET_BLTZAL +//#define INTERPRET_BLTZAL_OUT +//#define INTERPRET_BLTZAL_IDLE +//#define INTERPRET_BGEZAL +//#define INTERPRET_BGEZAL_OUT +//#define INTERPRET_BGEZAL_IDLE +//#define INTERPRET_BLTZALL +//#define INTERPRET_BLTZALL_OUT +//#define INTERPRET_BLTZALL_IDLE +//#define INTERPRET_BGEZALL +//#define INTERPRET_BGEZALL_OUT +//#define INTERPRET_BGEZALL_IDLE +//#define INTERPRET_BC1F +//#define INTERPRET_BC1F_OUT +//#define INTERPRET_BC1F_IDLE +//#define INTERPRET_BC1T +//#define INTERPRET_BC1T_OUT +//#define INTERPRET_BC1T_IDLE +//#define INTERPRET_BC1FL +//#define INTERPRET_BC1FL_OUT +//#define INTERPRET_BC1FL_IDLE +//#define INTERPRET_BC1TL +//#define INTERPRET_BC1TL_OUT +//#define INTERPRET_BC1TL_IDLE +//#define INTERPRET_MFC1 +//#define INTERPRET_DMFC1 +//#define INTERPRET_CFC1 +//#define INTERPRET_MTC1 +//#define INTERPRET_DMTC1 +//#define INTERPRET_CTC1 +//#define INTERPRET_ADD_D +//#define INTERPRET_SUB_D +//#define INTERPRET_MUL_D +//#define INTERPRET_DIV_D +//#define INTERPRET_SQRT_D +//#define INTERPRET_ABS_D +//#define INTERPRET_MOV_D +//#define INTERPRET_NEG_D +//#define INTERPRET_ROUND_L_D +//#define INTERPRET_TRUNC_L_D +//#define INTERPRET_CEIL_L_D +//#define INTERPRET_FLOOR_L_D +//#define INTERPRET_ROUND_W_D +//#define INTERPRET_TRUNC_W_D +//#define INTERPRET_CEIL_W_D +//#define INTERPRET_FLOOR_W_D +//#define INTERPRET_CVT_S_D +//#define INTERPRET_CVT_W_D +//#define INTERPRET_CVT_L_D +//#define INTERPRET_C_F_D +//#define INTERPRET_C_UN_D +//#define INTERPRET_C_EQ_D +//#define INTERPRET_C_UEQ_D +//#define INTERPRET_C_OLT_D +//#define INTERPRET_C_ULT_D +//#define INTERPRET_C_OLE_D +//#define INTERPRET_C_ULE_D +//#define INTERPRET_C_SF_D +//#define INTERPRET_C_NGLE_D +//#define INTERPRET_C_SEQ_D +//#define INTERPRET_C_NGL_D +//#define INTERPRET_C_LT_D +//#define INTERPRET_C_NGE_D +//#define INTERPRET_C_LE_D +//#define INTERPRET_C_NGT_D +//#define INTERPRET_CVT_S_L +//#define INTERPRET_CVT_D_L +//#define INTERPRET_CVT_S_W +//#define INTERPRET_CVT_D_W +//#define INTERPRET_ADD_S +//#define INTERPRET_SUB_S +//#define INTERPRET_MUL_S +//#define INTERPRET_DIV_S +//#define INTERPRET_SQRT_S +//#define INTERPRET_ABS_S +//#define INTERPRET_MOV_S +//#define INTERPRET_NEG_S +//#define INTERPRET_ROUND_L_S +//#define INTERPRET_TRUNC_L_S +//#define INTERPRET_CEIL_L_S +//#define INTERPRET_FLOOR_L_S +//#define INTERPRET_ROUND_W_S +//#define INTERPRET_TRUNC_W_S +//#define INTERPRET_CEIL_W_S +//#define INTERPRET_FLOOR_W_S +//#define INTERPRET_CVT_D_S +//#define INTERPRET_CVT_W_S +//#define INTERPRET_CVT_L_S +//#define INTERPRET_C_F_S +//#define INTERPRET_C_UN_S +//#define INTERPRET_C_EQ_S +//#define INTERPRET_C_UEQ_S +//#define INTERPRET_C_OLT_S +//#define INTERPRET_C_ULT_S +//#define INTERPRET_C_OLE_S +//#define INTERPRET_C_ULE_S +//#define INTERPRET_C_SF_S +//#define INTERPRET_C_NGLE_S +//#define INTERPRET_C_SEQ_S +//#define INTERPRET_C_NGL_S +//#define INTERPRET_C_LT_S +//#define INTERPRET_C_NGE_S +//#define INTERPRET_C_LE_S +//#define INTERPRET_C_NGT_S + +#endif /* __INTERPRET_H__ */ + diff --git a/libmupen64plus/mupen64plus-core/src/r4300/x86_64/regcache.c b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/regcache.c new file mode 100644 index 0000000000..34cd329666 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/src/r4300/x86_64/regcache.c @@ -0,0 +1,657 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - regcache.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2007 Richard Goedeken (Richard42) * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "regcache.h" + +#include "api/m64p_types.h" +#include "api/callbacks.h" +#include "r4300/recomp.h" +#include "r4300/r4300.h" +#include "r4300/recomph.h" + +static unsigned long long * reg_content[8]; +static precomp_instr* last_access[8]; +static precomp_instr* free_since[8]; +static int dirty[8]; +static int is64bits[8]; +static unsigned long long *r0; + +void init_cache(precomp_instr* start) +{ + int i; + for (i=0; i<8; i++) + { + reg_content[i] = NULL; + last_access[i] = NULL; + free_since[i] = start; + dirty[i] = 0; + is64bits[i] = 0; + } + r0 = (unsigned long long *) reg; +} + +void free_all_registers(void) +{ +#if defined(PROFILE_R4300) + int freestart = code_length; + int flushed = 0; +#endif + + int i; + for (i=0; i<8; i++) + { +#if defined(PROFILE_R4300) + if (last_access[i] && dirty[i]) flushed = 1; +#endif + if (last_access[i]) + { + free_register(i); + } + else + { + while (free_since[i] <= dst) + { + free_since[i]->reg_cache_infos.needed_registers[i] = NULL; + free_since[i]++; + } + } + } + +#if defined(PROFILE_R4300) + if (flushed == 1) + { + long long x86addr = (long long) ((*inst_pointer) + freestart); + int mipsop = -5; + if (fwrite(&mipsop, 1, 4, pfProfile) != 4 || /* -5 = regcache flushing */ + fwrite(&x86addr, 1, sizeof(char *), pfProfile) != sizeof(char *)) // write pointer to start of register cache flushing instructions + DebugMessage(M64MSG_ERROR, "Error writing R4300 instruction address profiling data"); + x86addr = (long long) ((*inst_pointer) + code_length); + if (fwrite(&src, 1, 4, pfProfile) != 4 || // write 4-byte MIPS opcode for current instruction + fwrite(&x86addr, 1, sizeof(char *), pfProfile) != sizeof(char *)) // write pointer to dynamically generated x86 code for this MIPS instruction + DebugMessage(M64MSG_ERROR, "Error writing R4300 instruction address profiling data"); + } +#endif +} + +static void simplify_access(void) +{ + int i; + dst->local_addr = code_length; + for(i=0; i<8; i++) dst->reg_cache_infos.needed_registers[i] = NULL; +} + +void free_registers_move_start(void) +{ + /* flush all dirty registers and clear needed_registers table */ + free_all_registers(); + + /* now move the start of the new instruction down past the flushing instructions */ + simplify_access(); + +} + +// this function frees a specific X86 GPR +void free_register(int reg) +{ + precomp_instr *last; + + if (last_access[reg] != NULL) + last = last_access[reg]+1; + else + last = free_since[reg]; + + while (last <= dst) + { + if (last_access[reg] != NULL && dirty[reg]) + last->reg_cache_infos.needed_registers[reg] = reg_content[reg]; + else + last->reg_cache_infos.needed_registers[reg] = NULL; + last++; + } + if (last_access[reg] == NULL) + { + free_since[reg] = dst+1; + return; + } + + if (dirty[reg]) + { + if (is64bits[reg]) + { + mov_m64rel_xreg64((unsigned long long *) reg_content[reg], reg); + } + else + { + movsxd_reg64_reg32(reg, reg); + mov_m64rel_xreg64((unsigned long long *) reg_content[reg], reg); + } + } + + last_access[reg] = NULL; + free_since[reg] = dst+1; +} + +int lru_register(void) +{ + unsigned long long oldest_access = 0xFFFFFFFFFFFFFFFFULL; + int i, reg = 0; + for (i=0; i<8; i++) + { + if (i != ESP && (unsigned long long) last_access[i] < oldest_access) + { + oldest_access = (unsigned long long) last_access[i]; + reg = i; + } + } + return reg; +} + +int lru_base_register(void) /* EBP cannot be used as a base register for SIB addressing byte */ +{ + unsigned long long oldest_access = 0xFFFFFFFFFFFFFFFFULL; + int i, reg = 0; + for (i=0; i<8; i++) + { + if (i != ESP && i != EBP && (unsigned long long) last_access[i] < oldest_access) + { + oldest_access = (unsigned long long) last_access[i]; + reg = i; + } + } + return reg; +} + +void set_register_state(int reg, unsigned int *addr, int _dirty, int _is64bits) +{ + if (addr == NULL) + last_access[reg] = NULL; + else + last_access[reg] = dst; + reg_content[reg] = (unsigned long long *) addr; + is64bits[reg] = _is64bits; + dirty[reg] = _dirty; +} + +int lock_register(int reg) +{ + free_register(reg); + last_access[reg] = (precomp_instr *) 0xFFFFFFFFFFFFFFFFULL; + reg_content[reg] = NULL; + return reg; +} + +void unlock_register(int reg) +{ + last_access[reg] = NULL; +} + +// this function finds a register to put the data contained in addr, +// if there was another value before it's cleanly removed of the +// register cache. After that, the register number is returned. +// If data are already cached, the function only returns the register number +int allocate_register_32(unsigned int *addr) +{ + int reg = 0, i; + + // is it already cached ? + if (addr != NULL) + { + for (i = 0; i < 8; i++) + { + if (last_access[i] != NULL && (unsigned int *) reg_content[i] == addr) + { + precomp_instr *last = last_access[i]+1; + + while (last <= dst) + { + last->reg_cache_infos.needed_registers[i] = reg_content[i]; + last++; + } + last_access[i] = dst; + is64bits[i] = 0; + return i; + } + } + } + + // it's not cached, so take the least recently used register + reg = lru_register(); + + if (last_access[reg]) + free_register(reg); + else + { + while (free_since[reg] <= dst) + { + free_since[reg]->reg_cache_infos.needed_registers[reg] = NULL; + free_since[reg]++; + } + } + + last_access[reg] = dst; + reg_content[reg] = (unsigned long long *) addr; + dirty[reg] = 0; + is64bits[reg] = 0; + + if (addr != NULL) + { + if (addr == (unsigned int *) r0) + xor_reg32_reg32(reg, reg); + else + mov_xreg32_m32rel(reg, addr); + } + + return reg; +} + +// this function is similar to allocate_register except it loads +// a 64 bits value, and return the register number of the LSB part +int allocate_register_64(unsigned long long *addr) +{ + int reg, i; + + // is it already cached? + if (addr != NULL) + { + for (i = 0; i < 8; i++) + { + if (last_access[i] != NULL && reg_content[i] == addr) + { + precomp_instr *last = last_access[i]+1; + + while (last <= dst) + { + last->reg_cache_infos.needed_registers[i] = reg_content[i]; + last++; + } + last_access[i] = dst; + if (is64bits[i] == 0) + { + movsxd_reg64_reg32(i, i); + is64bits[i] = 1; + } + return i; + } + } + } + + // it's not cached, so take the least recently used register + reg = lru_register(); + + if (last_access[reg]) + free_register(reg); + else + { + while (free_since[reg] <= dst) + { + free_since[reg]->reg_cache_infos.needed_registers[reg] = NULL; + free_since[reg]++; + } + } + + last_access[reg] = dst; + reg_content[reg] = addr; + dirty[reg] = 0; + is64bits[reg] = 1; + + if (addr != NULL) + { + if (addr == r0) + xor_reg64_reg64(reg, reg); + else + mov_xreg64_m64rel(reg, addr); + } + + return reg; +} + +// this function checks if the data located at addr are cached in a register +// and then, it returns 1 if it's a 64 bit value +// 0 if it's a 32 bit value +// -1 if it's not cached +int is64(unsigned int *addr) +{ + int i; + for (i = 0; i < 8; i++) + { + if (last_access[i] != NULL && reg_content[i] == (unsigned long long *) addr) + { + return is64bits[i]; + } + } + return -1; +} + +int allocate_register_32_w(unsigned int *addr) +{ + int reg = 0, i; + + // is it already cached ? + for (i = 0; i < 8; i++) + { + if (last_access[i] != NULL && reg_content[i] == (unsigned long long *) addr) + { + precomp_instr *last = last_access[i] + 1; + + while (last <= dst) + { + last->reg_cache_infos.needed_registers[i] = NULL; + last++; + } + last_access[i] = dst; + dirty[i] = 1; + is64bits[i] = 0; + return i; + } + } + + // it's not cached, so take the least recently used register + reg = lru_register(); + + if (last_access[reg]) + free_register(reg); + else + { + while (free_since[reg] <= dst) + { + free_since[reg]->reg_cache_infos.needed_registers[reg] = NULL; + free_since[reg]++; + } + } + + last_access[reg] = dst; + reg_content[reg] = (unsigned long long *) addr; + dirty[reg] = 1; + is64bits[reg] = 0; + + return reg; +} + +int allocate_register_64_w(unsigned long long *addr) +{ + int reg, i; + + // is it already cached? + for (i = 0; i < 8; i++) + { + if (last_access[i] != NULL && reg_content[i] == addr) + { + precomp_instr *last = last_access[i] + 1; + + while (last <= dst) + { + last->reg_cache_infos.needed_registers[i] = NULL; + last++; + } + last_access[i] = dst; + is64bits[i] = 1; + dirty[i] = 1; + return i; + } + } + + // it's not cached, so take the least recently used register + reg = lru_register(); + + if (last_access[reg]) + free_register(reg); + else + { + while (free_since[reg] <= dst) + { + free_since[reg]->reg_cache_infos.needed_registers[reg] = NULL; + free_since[reg]++; + } + } + + last_access[reg] = dst; + reg_content[reg] = addr; + dirty[reg] = 1; + is64bits[reg] = 1; + + return reg; +} + +void allocate_register_32_manually(int reg, unsigned int *addr) +{ + int i; + + /* check if we just happen to already have this r4300 reg cached in the requested x86 reg */ + if (last_access[reg] != NULL && reg_content[reg] == (unsigned long long *) addr) + { + precomp_instr *last = last_access[reg] + 1; + while (last <= dst) + { + last->reg_cache_infos.needed_registers[reg] = reg_content[reg]; + last++; + } + last_access[reg] = dst; + /* we won't touch is64bits or dirty; the register returned is "read-only" */ + return; + } + + /* otherwise free up the requested x86 register */ + if (last_access[reg]) + free_register(reg); + else + { + while (free_since[reg] <= dst) + { + free_since[reg]->reg_cache_infos.needed_registers[reg] = NULL; + free_since[reg]++; + } + } + + /* if the r4300 register is already cached in a different x86 register, then copy it to the requested x86 register */ + for (i=0; i<8; i++) + { + if (last_access[i] != NULL && reg_content[i] == (unsigned long long *) addr) + { + precomp_instr *last = last_access[i]+1; + while (last <= dst) + { + last->reg_cache_infos.needed_registers[i] = reg_content[i]; + last++; + } + last_access[i] = dst; + if (is64bits[i]) + mov_reg64_reg64(reg, i); + else + mov_reg32_reg32(reg, i); + last_access[reg] = dst; + is64bits[reg] = is64bits[i]; + dirty[reg] = dirty[i]; + reg_content[reg] = reg_content[i]; + /* free the previous x86 register used to cache this r4300 register */ + free_since[i] = dst + 1; + last_access[i] = NULL; + return; + } + } + + /* otherwise just load the 32-bit value into the requested register */ + last_access[reg] = dst; + reg_content[reg] = (unsigned long long *) addr; + dirty[reg] = 0; + is64bits[reg] = 0; + + if ((unsigned long long *) addr == r0) + xor_reg32_reg32(reg, reg); + else + mov_xreg32_m32rel(reg, addr); +} + +void allocate_register_32_manually_w(int reg, unsigned int *addr) +{ + int i; + + /* check if we just happen to already have this r4300 reg cached in the requested x86 reg */ + if (last_access[reg] != NULL && reg_content[reg] == (unsigned long long *) addr) + { + precomp_instr *last = last_access[reg]+1; + while (last <= dst) + { + last->reg_cache_infos.needed_registers[reg] = NULL; + last++; + } + last_access[reg] = dst; + is64bits[reg] = 0; + dirty[reg] = 1; + return; + } + + /* otherwise free up the requested x86 register */ + if (last_access[reg]) + free_register(reg); + else + { + while (free_since[reg] <= dst) + { + free_since[reg]->reg_cache_infos.needed_registers[reg] = NULL; + free_since[reg]++; + } + } + + /* if the r4300 register is already cached in a different x86 register, then free it and bind to the requested x86 register */ + for (i = 0; i < 8; i++) + { + if (last_access[i] != NULL && reg_content[i] == (unsigned long long *) addr) + { + precomp_instr *last = last_access[i] + 1; + while (last <= dst) + { + last->reg_cache_infos.needed_registers[i] = NULL; + last++; + } + last_access[reg] = dst; + reg_content[reg] = reg_content[i]; + dirty[reg] = 1; + is64bits[reg] = 0; + /* free the previous x86 register used to cache this r4300 register */ + free_since[i] = dst+1; + last_access[i] = NULL; + return; + } + } + + /* otherwise just set up the requested register as 32-bit */ + last_access[reg] = dst; + reg_content[reg] = (unsigned long long *) addr; + dirty[reg] = 1; + is64bits[reg] = 0; +} + + +// 0x48 0x83 0xEC 0x8 sub rsp, byte 8 +// 0x48 0xA1 0xXXXXXXXXXXXXXXXX mov rax, qword (&code start) +// 0x48 0x05 0xXXXXXXXX add rax, dword (local_addr) +// 0x48 0x89 0x04 0x24 mov [rsp], rax +// 0x48 0xB8 0xXXXXXXXXXXXXXXXX mov rax, ®[0] +// 0x48 0x8B (reg<<3)|0x80 0xXXXXXXXX mov rdi, [rax + XXXXXXXX] +// 0x48 0x8B (reg<<3)|0x80 0xXXXXXXXX mov rsi, [rax + XXXXXXXX] +// 0x48 0x8B (reg<<3)|0x80 0xXXXXXXXX mov rbp, [rax + XXXXXXXX] +// 0x48 0x8B (reg<<3)|0x80 0xXXXXXXXX mov rdx, [rax + XXXXXXXX] +// 0x48 0x8B (reg<<3)|0x80 0xXXXXXXXX mov rcx, [rax + XXXXXXXX] +// 0x48 0x8B (reg<<3)|0x80 0xXXXXXXXX mov rbx, [rax + XXXXXXXX] +// 0x48 0x8B (reg<<3)|0x80 0xXXXXXXXX mov rax, [rax + XXXXXXXX] +// 0xC3 ret +// total : 84 bytes + +static void build_wrapper(precomp_instr *instr, unsigned char* pCode, precomp_block* block) +{ + int i; + +#if defined(PROFILE_R4300) + long long x86addr = (long long) pCode; + int mipsop = -4; + if (fwrite(&mipsop, 1, 4, pfProfile) != 4 || // write 4-byte MIPS opcode + fwrite(&x86addr, 1, sizeof(char *), pfProfile) != sizeof(char *)) // write pointer to dynamically generated x86 code for this MIPS instruction + DebugMessage(M64MSG_ERROR, "Error writing R4300 instruction address profiling data"); +#endif + + *pCode++ = 0x48; + *pCode++ = 0x83; + *pCode++ = 0xEC; + *pCode++ = 0x08; + + *pCode++ = 0x48; + *pCode++ = 0xA1; + *((unsigned long long *) pCode) = (unsigned long long) (&block->code); + pCode += 8; + + *pCode++ = 0x48; + *pCode++ = 0x05; + *((unsigned int *) pCode) = (unsigned int) instr->local_addr; + pCode += 4; + + *pCode++ = 0x48; + *pCode++ = 0x89; + *pCode++ = 0x04; + *pCode++ = 0x24; + + *pCode++ = 0x48; + *pCode++ = 0xB8; + *((unsigned long long *) pCode) = (unsigned long long) ®[0]; + pCode += 8; + + for (i=7; i>=0; i--) + { + long long riprel; + if (instr->reg_cache_infos.needed_registers[i] != NULL) + { + *pCode++ = 0x48; + *pCode++ = 0x8B; + *pCode++ = 0x80 | (i << 3); + riprel = (long long) ((unsigned char *) instr->reg_cache_infos.needed_registers[i] - (unsigned char *) ®[0]); + *((int *) pCode) = (int) riprel; + pCode += 4; + if (riprel >= 0x7fffffffLL || riprel < -0x80000000LL) + { + DebugMessage(M64MSG_ERROR, "build_wrapper error: reg[%i] offset too big for relative address from %p to %p", + i, (®[0]), instr->reg_cache_infos.needed_registers[i]); + asm(" int $3; "); + } + } + } + *pCode++ = 0xC3; +} + +void build_wrappers(precomp_instr *instr, int start, int end, precomp_block* block) +{ + int i, reg; + for (i=start; i + +#include "api/m64p_types.h" +#include "api/callbacks.h" +#include "r4300/recomp.h" +#include "r4300/r4300.h" +#include "r4300/macros.h" +#include "r4300/ops.h" +#include "r4300/recomph.h" + +// that's where the dynarec will restart when going back from a C function +static unsigned long long *return_address; + +void dyna_jump(void) +{ + if (stop == 1) + { + dyna_stop(); + return; + } + + if (PC->reg_cache_infos.need_map) + *return_address = (unsigned long long) (PC->reg_cache_infos.jump_wrapper); + else + *return_address = (unsigned long long) (actual->code + PC->local_addr); +} + +static long long save_rsp = 0; +static long long save_rip = 0; + +void dyna_start(void *code) +{ + /* save the base and stack pointers */ + /* make a call and a pop to retrieve the instruction pointer and save it too */ + /* then call the code(), which should theoretically never return. */ + /* When dyna_stop() sets the *return_address to the saved RIP, the emulator thread will come back here. */ + /* It will jump to label 2, restore the base and stack pointers, and exit this function */ + DebugMessage(M64MSG_INFO, "R4300: starting 64-bit dynamic recompiler at: %p", code); +#if defined(__GNUC__) && defined(__x86_64__) + asm volatile + (" push %%rbx \n" /* we must push an even # of registers to keep stack 16-byte aligned */ + " push %%r12 \n" + " push %%r13 \n" + " push %%r14 \n" + " push %%r15 \n" + " push %%rbp \n" + " mov %%rsp, %[save_rsp] \n" + " lea %[reg], %%r15 \n" /* store the base location of the r4300 registers in r15 for addressing */ + " call 1f \n" + " jmp 2f \n" + "1: \n" + " pop %%rax \n" + " mov %%rax, %[save_rip] \n" + + " sub $0x10, %%rsp \n" + " and $-16, %%rsp \n" /* ensure that stack is 16-byte aligned */ + " mov %%rsp, %%rax \n" + " sub $8, %%rax \n" + " mov %%rax, %[return_address]\n" + + " call *%%rbx \n" + "2: \n" + " mov %[save_rsp], %%rsp \n" + " pop %%rbp \n" + " pop %%r15 \n" + " pop %%r14 \n" + " pop %%r13 \n" + " pop %%r12 \n" + " pop %%rbx \n" + : [save_rsp]"=m"(save_rsp), [save_rip]"=m"(save_rip), [return_address]"=m"(return_address) + : "b" (code), [reg]"m"(*reg) + : "%rax", "memory" + ); +#endif + + /* clear the registers so we don't return here a second time; that would be a bug */ + save_rsp=0; + save_rip=0; +} + +void dyna_stop(void) +{ + if (save_rip == 0) + DebugMessage(M64MSG_WARNING, "Instruction pointer is 0 at dyna_stop()"); + else + { + *return_address = (unsigned long long) save_rip; + } +} + diff --git a/libmupen64plus/mupen64plus-core/tools/build_bundle_bin.sh b/libmupen64plus/mupen64plus-core/tools/build_bundle_bin.sh new file mode 100644 index 0000000000..1b0144600a --- /dev/null +++ b/libmupen64plus/mupen64plus-core/tools/build_bundle_bin.sh @@ -0,0 +1,64 @@ +#!/bin/sh +#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# * Mupen64plus - build_bundle_bin.sh * +# * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * +# * Copyright (C) 2009 Richard Goedeken * +# * * +# * 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. * +# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +# terminate the script if any commands return a non-zero error code +set -e + +if [ $# -lt 2 ]; then + echo "Usage: build_bundle_bin.sh [ ...]" + exit 1 +fi + +TEMPDIR="mupen64plus-temp-build" + +rm -rf ${TEMPDIR} +mkdir -p ${TEMPDIR}/source +cd ${TEMPDIR}/source + +echo "************************************ Downloading Mupen64Plus module source code" +hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-core +hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-rom +hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-ui-console +hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-audio-sdl +hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-input-sdl +hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-rsp-hle +hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-video-rice +shift +for dirname in ./mupen64plus-*; do rm -rf ${dirname}/.hg*; done + +OUTPUTDIR="mupen64plus-bundle-$1" +shift + +echo "************************************ Building Mupen64Plus modules" +cd .. +tar xzvf source/mupen64plus-core/tools/m64p_helper_scripts.tar.gz + +./m64p_build.sh $@ +mv "test" "${OUTPUTDIR}" + +echo "************************************ Creating archive" +cp source/mupen64plus-core/tools/install_binary_bundle.sh "${OUTPUTDIR}/install.sh" +cp source/mupen64plus-core/tools/uninstall_binary_bundle.sh "${OUTPUTDIR}/uninstall.sh" + +tar c "${OUTPUTDIR}" --owner 0 --group 0 --numeric-owner | gzip -n > "../${OUTPUTDIR}.tar.gz" +cd .. +rm -rf "${TEMPDIR}" diff --git a/libmupen64plus/mupen64plus-core/tools/build_bundle_src.sh b/libmupen64plus/mupen64plus-core/tools/build_bundle_src.sh new file mode 100644 index 0000000000..d7dd5b1e85 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/tools/build_bundle_src.sh @@ -0,0 +1,58 @@ +#!/bin/sh +#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# * Mupen64plus - build_bundle_src.sh * +# * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * +# * Copyright (C) 2009 Richard Goedeken * +# * * +# * 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. * +# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +# terminate the script if any commands return a non-zero error code +set -e + +if [ $# -lt 2 ]; then + echo "Usage: build_bundle_src.sh " + exit 1 +fi + +OUTPUTDIR="mupen64plus-bundle-$2" + +echo "************************************ Creating directory: " ${OUTPUTDIR} +rm -rf ${OUTPUTDIR} +mkdir -p ${OUTPUTDIR}/source +cd ${OUTPUTDIR}/source + +echo "************************************ Downloading Mupen64Plus module source code" +hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-core +hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-rom +hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-ui-console +hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-audio-sdl +hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-input-sdl +hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-rsp-hle +hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-video-rice +for dirname in ./mupen64plus-*; do rm -rf ${dirname}/.hg*; done + +# unzip the helper scripts and remove the Mercurial scripts +cd .. +tar xzvf source/mupen64plus-core/tools/m64p_helper_scripts.tar.gz +rm -f m64p_get.sh m64p_update.sh + +echo "************************************ Creating archive" +cd .. +tar c "${OUTPUTDIR}" --owner 0 --group 0 --numeric-owner | gzip -n > "${OUTPUTDIR}.tar.gz" +rm -rf "${OUTPUTDIR}" + + diff --git a/libmupen64plus/mupen64plus-core/tools/build_modules_src.sh b/libmupen64plus/mupen64plus-core/tools/build_modules_src.sh new file mode 100644 index 0000000000..126d3fbe44 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/tools/build_modules_src.sh @@ -0,0 +1,44 @@ +#!/bin/sh +#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# * Mupen64plus - build_modules_src.sh * +# * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * +# * Copyright (C) 2009 Richard Goedeken * +# * * +# * 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. * +# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +# terminate the script if any commands return a non-zero error code +set -e + +if [ $# -lt 2 ]; then + echo "Usage: build_modules_src.sh " + exit 1 +fi + +modules='mupen64plus-core mupen64plus-rom mupen64plus-ui-console mupen64plus-audio-sdl mupen64plus-input-sdl mupen64plus-rsp-hle mupen64plus-video-rice' +for modname in ${modules}; do + echo "************************************ Downloading and packaging module source code: ${modname}" + rm -rf "tmp" + EXCLUDE="--exclude .hgtags --exclude .hg_archival.txt --exclude .hgignore" + TARTAG="" + OUTPUTDIR="${modname}-$2" + hg clone --noupdate "http://bitbucket.org/richard42/$modname" "tmp" + cd tmp + hg archive --no-decode --type tar --prefix "${OUTPUTDIR}/" ${EXCLUDE} -r $1 "../${OUTPUTDIR}${TARTAG}.tar" + cd .. + gzip -n -f "${OUTPUTDIR}${TARTAG}.tar" + rm -rf "tmp" +done diff --git a/libmupen64plus/mupen64plus-core/tools/cheat_code_convert.py b/libmupen64plus/mupen64plus-core/tools/cheat_code_convert.py new file mode 100644 index 0000000000..28e6806928 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/tools/cheat_code_convert.py @@ -0,0 +1,118 @@ +#!/usr/bin/python +'''* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - code_convert.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2010 Rhett Osborne * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + +Usage: + +python code_convert.py > ../data/mupencheat.txt < ../data/mupen64plus.cht + +''' + +from sys import stdin + +class cheat: + def __init__(self): + self.n="" + self.d="" + self.c=[] + self.v=0 + self.hb='00' + def add(self, l): + if(self.n == ""): + return + l.append(" cn %s"%(self.n)) + if(self.d != ""): l.append(" cd %s"%(self.d)) + for code in self.c: + l.append(" "+code) + def clear(self): + self.n="" + self.d="" + self.c=[] + self.v=0 + + +l=[] +cCount=0 +_cs = [] +for i in range(225): + _cs.append(cheat()) +cs = _cs[:] + +def print_l(): + global l, cs + for cheat in cs: + cheat.add(l) + for line in l: + print line.replace("\x00", "") + l=[] + cCount=0 + for i in range(225): + cs[i].clear() + +lines = stdin.read().split("\n") + +for line in lines: + if len(line) < 2: continue + elif(line[:2] == "//" and line != "//----" and line != "//---" ): + l.append(line) + elif len(line) < 4: continue + elif(line[0] == '[' and line[-1] == ']' and len(line) > 23): + print_l() + l.append("\ncrc %s" % line[1:-1]) + elif(line[:5] == "Name="): + l.append("gn %s" % (line[5:])) + elif(line[:5] == "Cheat"): + t = line[5:].split('=')[0] + if (len(t)>1 and t[-2] == '_'): + n = int(t[:-2]) + if(t[-1] == 'N'): + cs[n].d = line.split("=")[1] + else: + for option in line.split("=")[1].split("$")[1:]: + if(len(option) < 4): + break; + if(option[-1]==','): end =-1 + else: end = None + if(option[2] == " "): + cs[n].c[cs[n].v] += "%s%s:\"%s\""%(cs[n].hb,option[:2],option[3:end].replace("\"", "\\\"")) + else: + cs[n].c[cs[n].v] += "%s:\"%s\""%(option[:4],option[5:end].replace("\"", "\\\"")) + cs[n].c[cs[n].v]+=',' + cs[n].c[cs[n].v] = cs[n].c[cs[n].v][:-1] + else: + n = int(t) + cn = line.split('"') + cs[n].c = cn[2][1:].split(',') + cs[n].n = cn[1]; + i=0 + for cheat in cs[n].c: + if(cheat[-1] == '?'): + if(cheat[-2:] == '??' and cheat[-4:-2] != '??'): + cs[n].hb = cheat[-4:-2] + else: + cs[n].hb = '00' + cs[n].c[i] = cheat[:9] + "???? "; + cs[n].v=i + i+=1 + if(n > cCount): + cCount = n + elif(line != "//----" and line != "//---" ): + l.append("//%s" %line) diff --git a/libmupen64plus/mupen64plus-core/tools/install_binary_bundle.sh b/libmupen64plus/mupen64plus-core/tools/install_binary_bundle.sh new file mode 100644 index 0000000000..5ae84951af --- /dev/null +++ b/libmupen64plus/mupen64plus-core/tools/install_binary_bundle.sh @@ -0,0 +1,96 @@ +#!/bin/sh +# +# mupen64plus binary bundle install script +# +# Copyright 2007-2009 The Mupen64Plus Development Team +# +# 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. +# + +set -e + +export PATH=/bin:/usr/bin + +GINSTALLFLAG=-D + +if `which ginstall >/dev/null 2>&1`; then + INSTALL=ginstall +elif install --help >/dev/null 2>&1; then + INSTALL=install +elif [ -e "`which install 2>/dev/null`" ]; then + printf "warning: GNU install not found, assuming BSD install\n" >&2 + INSTALL=install + GINSTALLFLAG= +else + printf "error: install tool not found\n" >&2 + exit 1 +fi + +INSTALL_STRIP_FLAG="${INSTALL_STRIP_FLAG:=-s}" + +usage() +{ +printf "usage: $(basename $0) [PREFIX] [SHAREDIR] [BINDIR] [LIBDIR] [PLUGINDIR] [MANDIR] +\tPREFIX - installation directories prefix (default: /usr/local) +\tSHAREDIR - path to Mupen64Plus shared data files (default: \$PREFIX/share/mupen64plus) +\tBINDIR - path to Mupen64Plus binary program files (default: \$PREFIX/bin) +\tLIBDIR - path to Mupen64Plus core library (default: \$PREFIX/lib) +\tPLUGINDIR - path to Mupen64Plus plugin libraries (default: \$PREFIX/lib/mupen64plus) +\tMANDIR - path to manual files (default: \$PREFIX/share/man) +" +} + +if [ $# -gt 6 ]; then + usage + exit 1 +fi + +PREFIX="${1:-/usr/local}" +SHAREDIR="${2:-${PREFIX}/share/mupen64plus}" +BINDIR="${3:-${PREFIX}/bin}" +LIBDIR="${4:-${PREFIX}/lib}" +PLUGINDIR="${5:-${PREFIX}/lib/mupen64plus}" +MANDIR="${6:-${PREFIX}/share/man}" + +printf "Installing Mupen64Plus Binary Bundle to ${PREFIX}\n" +# Mupen64Plus-Core +$INSTALL -d -v "${LIBDIR}" +$INSTALL -m 0644 "${INSTALL_STRIP_FLAG}" libmupen64plus.so.2.* "${LIBDIR}" +/sbin/ldconfig +$INSTALL -d -v "${SHAREDIR}" +$INSTALL -m 0644 font.ttf "${SHAREDIR}" +$INSTALL -m 0644 mupen64plus.cht "${SHAREDIR}" +$INSTALL -m 0644 mupen64plus.ini "${SHAREDIR}" +$INSTALL -d -v "${SHAREDIR}/doc" +$INSTALL -m 0644 doc/* "${SHAREDIR}/doc" +# Mupen64Plus-ROM +$INSTALL -m 0644 m64p_test_rom.v64 "${SHAREDIR}" +# Mupen64Plus-UI-Console +$INSTALL -d -v "${BINDIR}" +$INSTALL $GINSTALLFLAG -m 0755 mupen64plus "${BINDIR}" +$INSTALL -d -v "${MANDIR}/man6" +$INSTALL -m 0644 man6/mupen64plus.6 "${MANDIR}/man6" +# Plugins +$INSTALL -d -v "${PLUGINDIR}" +$INSTALL -m 0644 "${INSTALL_STRIP_FLAG}" mupen64plus-audio-sdl.so "${PLUGINDIR}" +$INSTALL -m 0644 "${INSTALL_STRIP_FLAG}" mupen64plus-input-sdl.so "${PLUGINDIR}" +$INSTALL -m 0644 "${INSTALL_STRIP_FLAG}" mupen64plus-rsp-hle.so "${PLUGINDIR}" +$INSTALL -m 0644 "${INSTALL_STRIP_FLAG}" mupen64plus-video-rice.so "${PLUGINDIR}" +$INSTALL -m 0644 RiceVideoLinux.ini "${SHAREDIR}" +$INSTALL -m 0644 InputAutoCfg.ini "${SHAREDIR}" + +printf "Installation successful.\n" + diff --git a/libmupen64plus/mupen64plus-core/tools/m64p_helper_scripts.tar.gz b/libmupen64plus/mupen64plus-core/tools/m64p_helper_scripts.tar.gz new file mode 100644 index 0000000000..093fab4e35 Binary files /dev/null and b/libmupen64plus/mupen64plus-core/tools/m64p_helper_scripts.tar.gz differ diff --git a/libmupen64plus/mupen64plus-core/tools/profiling.txt b/libmupen64plus/mupen64plus-core/tools/profiling.txt new file mode 100644 index 0000000000..3df1f9d769 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/tools/profiling.txt @@ -0,0 +1,91 @@ +How to profile R4300 instructions with mupen64plus: + +Pre-requisites: + - either 32-bit (x86) or 64-bit (amd64) Linux system + - Lots of memory. It doesn't cause swapping in a machine with 2GB of ram, but it probably would with 1GB + - OProfile (http://oprofile.sourceforge.net/) + - Mupen64plus source code + +Procedure: + 1. Install OProfile linux tool + + 2. Build r4300 profile tool with "gcc -o r4300prof r4300prof.c" + + 3. Build mupen64plus with "make DBGSYM=1 DBG_PROFILE=1" + + 4. Delete any pre-existing profiling files: "rm instructionaddrs.dat" + + 5. Clear any residual profiling data in oprofile: "sudo opcontrol --reset" + + 6. Make profiling run by typing in console: + sudo opcontrol --start ; ./mupen64plus --nogui --emumode 2 --audio ./plugins/dummyaudio.so ; sudo opcontrol --stop + + 7. Exit emulator with Escape key after running for desired time + + 7. Move data file into tools folder: "mv instructionaddrs.dat tools/" + + 8. Dump instruction-level profiling data for mupen64plus with oprofile: + opreport -d -l ./mupen64plus > ./tools/prof-mupen64-detail.txt + + 9. Run tool to generate r4300 instruction profile report: + cd tools ; ./r4300prof instructionaddrs.dat prof-mupen64-detail.txt + + +Example profile output: + +Loading instructionaddrs.dat... +283844 r4300 instruction locations read. +247911 non-empty MIPS instructions. +Loading prof-mupen64-detail.txt... +118181 lines in sample data file. +Found 117905 profile hits. + +Instruction time (samples): +reserved: 00007515 NI: 00000000 J: 00000043 JAL: 00003345 BEQ: 00004498 + BNE: 00003424 BLEZ: 00000222 BGTZ: 00000029 ADDI: 00000585 ADDIU: 00017439 + SLTI: 00000765 SLTIU: 00000089 ANDI: 00003847 ORI: 00000381 XORI: 00000035 + LUI: 00010389 BEQL: 00001873 BNEL: 00002617 BLEZL: 00000013 BGTZL: 00000010 + DADDI: 00000000 DADDIU: 00000000 LDL: 00000000 LDR: 00000000 LB: 00002600 + LH: 00006653 LW: 00024840 LWL: 00000001 LBU: 00003525 LHU: 00004954 + LWU: 00000000 LWR: 00000003 SB: 00003007 SH: 00004133 SW: 00023221 + SWL: 00000000 SWR: 00000000 SDL: 00000000 SDR: 00000000 LWC1: 00012405 + LDC1: 00001855 LD: 00000815 LL: 00000000 SWC1: 00007671 SDC1: 00001326 + SD: 00001233 SC: 00000000 BLTZ: 00000383 BGEZ: 00000331 BLTZL: 00000161 + BGEZL: 00000168 BLTZAL: 00000000 BGEZAL: 00000115 BLTZALL: 00000000 BGEZALL: 00000000 + SLL: 00003376 SRL: 00000604 SRA: 00000686 SLLV: 00000015 SRLV: 00000039 + SRAV: 00000000 JR: 00001358 JALR: 00000004 SYSCALL: 00000000 MFHI: 00000058 + MTHI: 00000002 MFLO: 00000277 MTLO: 00000004 DSLLV: 00000000 DSRLV: 00000000 + DSRAV: 00000000 MULT: 00000000 MULTU: 00000583 DIV: 00000941 DIVU: 00000000 + DMULT: 00000000 DMULTU: 00000000 DDIV: 00000000 DDIVU: 00000000 ADD: 00000170 + ADDU: 00001706 SUB: 00000037 SUBU: 00000833 AND: 00000909 OR: 00006360 + XOR: 00000079 NOR: 00000004 SLT: 00000925 SLTU: 00001401 DADD: 00000000 + DADDU: 00000000 DSUB: 00000000 DSUBU: 00000000 DSLL: 00000000 DSRL: 00000000 + DSRA: 00000000 TEQ: 00000000 DSLL32: 00000000 DSRL32: 00000000 DSRA32: 00000000 + BC1F: 00000286 BC1T: 00000032 BC1FL: 00000775 BC1TL: 00000077 TLBWI: 00000000 + TLBP: 00000000 TLBR: 00000000 TLBWR: 00000000 ERET: 00000036 MFC0: 00000396 + MTC0: 00000034 MFC1: 00000929 DMFC1: 00000000 CFC1: 00000141 MTC1: 00003081 + DMTC1: 00000000 CTC1: 00000163 f.CVT: 00001113 f.CMP: 00002149 f.ADD: 00001387 + f.SUB: 00000947 f.MUL: 00002696 f.DIV: 00000315 f.SQRT: 00000025 f.ABS: 00000000 + f.MOV: 00000631 f.NEG: 00000323 f.ROUND: 00000000 f.TRUNC: 00000867 f.CEIL: 00000000 + f.FLOOR: 00000000 + +Special code samples: + Regcache flushing: 12371 + Jump wrappers: 15520 + NOTCOMPILED: 33 + block postfix & link samples: 619 + +Unaccounted samples: 19929 +Total accounted instruction samples: 221836 + Load: 35.2% (68040) + Store: 21.0% (40591) + Data move/convert: 03.5% (6829) + 32-bit math: 16.0% (30861) + 64-bit math: 05.7% (10948) + Float Math: 04.5% (8709) + Jump: 02.5% (4750) + Branch: 07.8% (15014) + Exceptions: 00.0% (36) + Reserved: 03.9% (7515) + Other: 00.0% (0) + diff --git a/libmupen64plus/mupen64plus-core/tools/r4300prof.c b/libmupen64plus/mupen64plus-core/tools/r4300prof.c new file mode 100644 index 0000000000..7578d3b0ad --- /dev/null +++ b/libmupen64plus/mupen64plus-core/tools/r4300prof.c @@ -0,0 +1,520 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - r4300prof.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2008 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include + +/* Global data */ +unsigned int instr_samples[132]; +char instr_name[][10] = +{ + "reserved", "NI", "J", "JAL", "BEQ", "BNE", "BLEZ", "BGTZ", + "ADDI", "ADDIU", "SLTI", "SLTIU", "ANDI", "ORI", "XORI", "LUI", + "BEQL", "BNEL", "BLEZL", "BGTZL", "DADDI", "DADDIU", "LDL", "LDR", + "LB", "LH", "LW", "LWL", "LBU", "LHU", "LWU", "LWR", + "SB", "SH", "SW", "SWL", "SWR", "SDL", "SDR", "LWC1", + "LDC1", "LD", "LL", "SWC1", "SDC1", "SD", "SC", "BLTZ", + "BGEZ", "BLTZL", "BGEZL", "BLTZAL", "BGEZAL", "BLTZALL", "BGEZALL", "SLL", + "SRL", "SRA", "SLLV", "SRLV", "SRAV", "JR", "JALR", "SYSCALL", + "MFHI", "MTHI", "MFLO", "MTLO", "DSLLV", "DSRLV", "DSRAV", "MULT", + "MULTU", "DIV", "DIVU", "DMULT", "DMULTU", "DDIV", "DDIVU", "ADD", + "ADDU", "SUB", "SUBU", "AND", "OR", "XOR", "NOR", "SLT", + "SLTU", "DADD", "DADDU", "DSUB", "DSUBU", "DSLL", "DSRL", "DSRA", + "TEQ", "DSLL32", "DSRL32", "DSRA32", "BC1F", "BC1T", "BC1FL", "BC1TL", + "TLBWI", "TLBP", "TLBR", "TLBWR", "ERET", "MFC0", "MTC0", "MFC1", + "DMFC1", "CFC1", "MTC1", "DMTC1", "CTC1", "f.CVT", "f.CMP", "f.ADD", + "f.SUB", "f.MUL", "f.DIV", "f.SQRT", "f.ABS", "f.MOV", "f.NEG", "f.ROUND", + "f.TRUNC", "f.CEIL", "f.FLOOR" +}; +unsigned int instr_type[131] = { 9, 10, 6, 6, 7, 7, 7, 7, 3, 3, 4, 4, 3, 4, 4, 0, + 7, 7, 7, 7, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 7, + 7, 7, 7, 7, 7, 7, 7, 3, 3, 3, 3, 3, 3, 6, 6, 10, + 2, 2, 2, 2, 4, 4, 4, 3, 3, 3, 3, 4, 4, 4, 4, 3, + 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 8, 4, 4, 4, 7, 7, 7, 7, 10, 10, 10, 10, 8, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 5, 5, 5, 5, 5, 5, 5, 2, 5, 5, + 5, 5, 5 }; +char instr_typename[][20] = { "Load", "Store", "Data move/convert", "32-bit math", "64-bit math", "Float Math", + "Jump", "Branch", "Exceptions", "Reserved", "Other" }; + +/* Global functions */ +int GetInstrType(int opcode); +int AddrCompare(const void *, const void *); +int ParseProfLine(const char *pchIn, long *plAddress, int *piSamples, float *pfPercentage); + +/* defined types */ +typedef struct __attribute__ ((__packed__)) +{ + int mipsop; + long x86addr; +} r4300op; + +typedef struct +{ + long x86addr; + int samples; +} profilehit; + +/* static functions */ +static int isSpace(char ch) +{ + return (ch == ' ' || ch == '\t' ? 1 : 0); +} + +static int isNum(char ch) +{ + return (ch >= '0' && ch <= '9' ? 1 : 0); +} + +static int isFloat(char ch) +{ + return ((ch >= '0' && ch <= '9') || ch == '.' || ch == '+' || ch == '-' || ch == 'e' ? 1 : 0); +} + +static int isHex(char ch) +{ + return ((ch >= '0' && ch <= '9') || ((ch & 0xdf) >= 'A' && (ch & 0xdf) <= 'F') ? 1 : 0); +} + +/* main */ +int main(int argc, void *argv[]) +{ + long lOpStart, lOpEnd; + int flength, oplistlength, totaltime, proflistlength; + int samp_unknown, samp_blockend, samp_notcompiled, samp_wrappers, samp_flush; + int i, j; + FILE *pfIn; + r4300op *pOpAddrTable; + profilehit *pProfTable; + char *pch, *pchSampleData; + + /* check arguments */ + if (argc < 3) + { + printf("Usage: r4300prof r4300addr.dat x86profile.txt\n\n"); + printf("r4300addr.dat - binary table of r4300 opcodes and corresponding x86 starting addresses\n"); + printf("x86profile.txt - text file containing a list of profile sample counts by x86 address on the heap\n\n"); + return 1; + } + + /* open r4300 opcode/x86 address table generated from emulator run */ + printf("Loading %s...\n", argv[1]); + pfIn = fopen(argv[1], "rb"); + if (pfIn == NULL) + { + printf("Couldn't open input file: %s\n", argv[1]); + return 2; + } + + /* get file length and calculate number of r4300op table entries */ + fseek(pfIn, 0L, SEEK_END); + flength = (int) ftell(pfIn); + fseek(pfIn, 0L, SEEK_SET); + oplistlength = flength / sizeof(r4300op); + + /* read the file */ + pOpAddrTable = (r4300op *) malloc(flength); + if (pOpAddrTable == NULL) + { + printf("Failed to allocate %i bytes for OpAddrTable!\n", flength); + fclose(pfIn); + return 3; + } + fread(pOpAddrTable, 1, flength, pfIn); + fclose(pfIn); + printf("%i r4300 instruction locations read.\n", oplistlength); + + /* sort the opcode/address table according to x86addr */ + qsort(pOpAddrTable, oplistlength, sizeof(r4300op), AddrCompare); + + /* remove any 0-length r4300 instructions */ + i = 0; + j = 0; + while (i < oplistlength) + { + pOpAddrTable[j].mipsop = pOpAddrTable[i].mipsop; + pOpAddrTable[j].x86addr = pOpAddrTable[i].x86addr; + i++; + if (pOpAddrTable[j].x86addr != pOpAddrTable[i].x86addr) + j++; + } + oplistlength = j; + printf("%i non-empty MIPS instructions.\n", oplistlength); + + /* convert each r4300 opcode to an instruction type index */ + for (i = 0; i < oplistlength; i++) + if (pOpAddrTable[i].mipsop > 0 || pOpAddrTable[i].mipsop < -16) + pOpAddrTable[i].mipsop = GetInstrType(pOpAddrTable[i].mipsop); + + /* open the profiling sample data file */ + printf("Loading %s...\n", argv[2]); + pfIn = fopen(argv[2], "rb"); + if (pfIn == NULL) + { + printf("Couldn't open input file: %s\n", argv[2]); + free(pOpAddrTable); + return 4; + } + + /* load it */ + fseek(pfIn, 0L, SEEK_END); + flength = (int) ftell(pfIn); + fseek(pfIn, 0L, SEEK_SET); + pchSampleData = (char *) malloc(flength + 16); + if (pchSampleData == NULL) + { + printf("Failed to allocate %i bytes for pchSampleData!\n", flength + 16); + fclose(pfIn); + free(pOpAddrTable); + return 5; + } + fread(pchSampleData, 1, flength, pfIn); + pchSampleData[flength] = 0; + fclose(pfIn); + + /* count the number of newlines in the ascii-formatted sample data file */ + proflistlength = 1; + pch = pchSampleData; + while (pch = strchr(pch, '\n')) + { + proflistlength++; + pch++; + } + printf("%i lines in sample data file.\n", proflistlength); + + /* extract text data into binary table */ + pProfTable = (profilehit *) malloc(proflistlength * sizeof(profilehit)); + if (pProfTable == NULL) + { + printf("Failed to allocate %i bytes for pProfTable!\n", proflistlength * sizeof(profilehit)); + free(pOpAddrTable); + free(pchSampleData); + return 6; + } + pch = pchSampleData; + j = 0; + long long llOffset = 0; + while (j < proflistlength) + { + long lAddress; + int iSamples; + float fPercentage; + char *pchNext = strchr(pch, '\n'); + if (pchNext != NULL) *pchNext++ = 0; // null-terminate this line + if (strstr(pch, "range:0x") != NULL) // search for offset change + { + pch = strstr(pch, "range:0x") + 8; // extract hex value and update our offset + char *pch2 = pch; + while (isHex(*pch2)) pch2++; + *pch2 = 0; + llOffset = strtoll(pch, NULL, 16); + } + else // parse line for sample point + { + int rval = ParseProfLine(pch, &lAddress, &iSamples, &fPercentage); + if (rval != 0) + { + pProfTable[j].x86addr = (unsigned long) (lAddress + llOffset); + pProfTable[j].samples = iSamples; + j++; + } + } + pch = pchNext; + if (pch == NULL) break; + } + free(pchSampleData); + proflistlength = j; + printf("Found %i profile hits.\n", proflistlength); + + /* clear r4300 instruction sample data table */ + for (i = 0; i < 132; i++) + instr_samples[i] = 0; + + /* calculate r4300 instruction profiling data by merging the tables */ + samp_unknown = 0; + samp_blockend = 0; + samp_notcompiled = 0; + samp_wrappers = 0; + samp_flush = 0; + i = 0; // i == OpAddrTable index + lOpStart = pOpAddrTable[0].x86addr; + lOpEnd = pOpAddrTable[1].x86addr; + for (j = 0; j < proflistlength; j++) // j == pProfTable index + { + long lOpx86addr = pProfTable[j].x86addr; + if (lOpx86addr >= lOpStart && lOpx86addr <= lOpEnd) /* these profile samples lie within current r4300 instruction */ + { + int instr = pOpAddrTable[i].mipsop; + if (instr == -1) printf("%lx sample point lies between %i/%lx and %i/%lx\n", lOpx86addr, instr, lOpStart, pOpAddrTable[i+1].mipsop, lOpEnd); + + if (instr == -1) + samp_unknown += pProfTable[j].samples; + else if (instr == -2) + samp_notcompiled += pProfTable[j].samples; + else if (instr == -3) + samp_blockend += pProfTable[j].samples; + else if (instr == -4) + samp_wrappers += pProfTable[j].samples; + else if (instr == -5) + samp_flush += pProfTable[j].samples; + else + instr_samples[instr] += pProfTable[j].samples; + continue; + } + if (lOpx86addr < pOpAddrTable[0].x86addr || lOpx86addr >= pOpAddrTable[oplistlength-1].x86addr) + { /* outside the range of all recompiled instructions */ + samp_unknown += pProfTable[j].samples; + continue; + } + if (lOpx86addr < lOpStart) /* discontinuity in profile list, go back to start */ + { + i = 0; + lOpStart = pOpAddrTable[0].x86addr; + lOpEnd = pOpAddrTable[1].x86addr; + j--; + continue; + } + /* this profile point is ahead of current r4300 instruction */ + do /* race ahead in r4300 opcode list until we hit this profile sample point */ + { + i++; + } while (i+1 < oplistlength && lOpx86addr > pOpAddrTable[i+1].x86addr); + lOpStart = pOpAddrTable[i].x86addr; + lOpEnd = pOpAddrTable[i+1].x86addr; + if (lOpx86addr < lOpStart || lOpx86addr > lOpEnd) + { + printf("Error: lOpx86addr = %lx but lOpStart, lOpEnd = %lx, %lx\n", lOpx86addr, lOpStart, lOpEnd); + return 7; + } + /* we have found the correct r4300 instruction corresponding to this profile point */ + j--; + } + + /* print the results */ + unsigned int iTypeCount[11] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + printf("\nInstruction time (samples):\n"); + totaltime = 0; + for (i = 0; i < 131; i++) + { + printf("%8s: %08i ", instr_name[i], instr_samples[i]); + if (i % 5 == 4) printf("\n"); + iTypeCount[instr_type[i]] += instr_samples[i]; + totaltime += instr_samples[i]; + } + int special = samp_flush + samp_wrappers + samp_notcompiled + samp_blockend; + printf("\n\nSpecial code samples:\n"); + printf(" Regcache flushing: %i\n", samp_flush); + printf(" Jump wrappers: %i\n", samp_wrappers); + printf(" NOTCOMPILED: %i\n", samp_notcompiled); + printf(" block postfix & link samples: %i\n", samp_blockend); + + printf("\nUnaccounted samples: %i\n", samp_unknown); + printf("Total accounted instruction samples: %i\n", totaltime + special); + for (i = 0; i < 11; i++) + { + printf("%20s: %04.1f%% (%i)\n", instr_typename[i], (float) iTypeCount[i] * 100.0 / totaltime, iTypeCount[i]); + } + + free(pOpAddrTable); + free(pProfTable); + return 0; +} + +int AddrCompare(const void *p1, const void *p2) +{ + const r4300op *pOp1 = (const r4300op *) p1; + const r4300op *pOp2 = (const r4300op *) p2; + + if (pOp1->x86addr < pOp2->x86addr) + return -1; + else if (pOp1->x86addr == pOp2->x86addr) + return (int) (pOp1 - pOp2); /* this forces qsort to be stable */ + else + return 1; +} + +int ParseProfLine(const char *pchIn, long *plAddress, int *piSamples, float *pfPercentage) +{ + char chVal[128], *pchOut; + + /* skip any initial whitespace */ + while (isSpace(*pchIn)) pchIn++; + if (!isHex(*pchIn)) return 0; + + /* parse hexadecimal address value */ + pchOut = chVal; + while (isHex(*pchIn)) *pchOut++ = *pchIn++; + *pchOut = 0; + if (!isSpace(*pchIn)) return 0; + *plAddress = strtol(chVal, NULL, 16); + + /* skip more whitespace */ + while (isSpace(*pchIn)) pchIn++; + if (!isNum(*pchIn)) return 0; + + /* parse decimal sample count value */ + pchOut = chVal; + while (isNum(*pchIn)) *pchOut++ = *pchIn++; + *pchOut = 0; + if (!isSpace(*pchIn)) return 0; + *piSamples = atoi(chVal); + + /* skip more whitespace */ + while (isSpace(*pchIn)) pchIn++; + if (!isFloat(*pchIn)) return 0; + + /* parse floating-point percentage value */ + pchOut = chVal; + while (isFloat(*pchIn)) *pchOut++ = *pchIn++; + *pchOut = 0; + if (!isSpace(*pchIn) && *pchIn != '\r' && *pchIn != '\n' && *pchIn != 0) return 0; + *pfPercentage = atof(chVal); + + /* if this isn't the end of the line, it's not a valid sample point */ + while (isSpace(*pchIn)) pchIn++; + if (*pchIn != '\r' && *pchIn != '\n' && *pchIn != 0) return 0; + + return 1; +} + +static int InstrTypeStd[64] = +{ + -1, -1, 02, 03, 04, 05, 06, 07, 8, 9, 10, 11, 12, 13, 14, 15, + -1, -1, 00, 00, 16, 17, 18, 19, 20, 21, 22, 23, 00, 00, 00, 00, + 24, 25, 27, 26, 28, 29, 31, 30, 32, 33, 35, 34, 37, 38, 36, 01, + 42, 39, 00, 00, 01, 40, 00, 41, 46, 43, 00, 00, 01, 44, 00, 45 +}; + +static int InstrTypeSpecial[64] = +{ + 55, 00, 56, 57, 58, 00, 59, 60, + 61, 62, 00, 00, 63, 01, 00, 00, + 64, 65, 66, 67, 68, 00, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, + 00, 00, 87, 88, 89, 90, 91, 92, + 01, 01, 01, 01, 96, 00, 01, 00, + 93, 00, 94, 95, 97, 00, 98, 99 +}; + +static int InstrTypeRegImm[32] = +{ + 47, 48, 49, 50, 00, 00, 00, 00, 01, 01, 01, 01, 01, 00, 01, 00, + 51, 52, 53, 54, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 +}; + +static int InstrTypeCop1[32] = +{ + 111, 112, 113, 00, 114, 115, 116, 00, + -1, 00, 00, 00, 00, 00, 00, 00, + -1, -1, 00, 00, -1, -1, 00, 00, + 00, 00, 00, 00, 00, 00, 00, 00 +}; + +static int InstrTypeCop1Math[64] = +{ + 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 127, 128, 129, 130, + 00, 00, 00, 00, 00, 00, 00, 00, + 00, 00, 00, 00, 00, 00, 00, 00, + 117, 117, 00, 00, 117, 117, 00, 00, + 00, 00, 00, 00, 00, 00, 00, 00, + 118, 118, 118, 118, 118, 118, 118, 118, + 118, 118, 118, 118, 118, 118, 118, 118 +}; + + +int GetInstrType(int opcode) +{ + int iType = (opcode >> 26) & 63; + + if (iType == 0) + { + /* SPECIAL instruction */ + iType = opcode & 63; + return InstrTypeSpecial[iType]; + } + else if (iType == 1) + { + /* REGIMM instruction */ + iType = (opcode >> 16) & 31; + return InstrTypeRegImm[iType]; + } + else if (iType == 16) + { + /* COP0 instruction */ + int iType1 = opcode & 0x01FFFFFF; + int iType2 = (opcode >> 21) & 31; + if (iType1 == 1) + return 106; // TLBR + else if (iType1 == 2) + return 104; // TLBWI + else if (iType1 == 6) + return 107; // TLBWR + else if (iType1 == 8) + return 105; // TLBP + else if (iType1 == 24) + return 108; // ERET + else if ((opcode & 0x7FF) == 0 && iType2 == 0) + return 109; // MFC0 + else if ((opcode & 0x7FF) == 0 && iType2 == 4) + return 110; // MTC0 + else + return 0; // reserved + } + else if (iType == 17) + { + /* COP1 instruction */ + int iType1 = (opcode >> 21) & 31; + if (iType1 == 8) + { + /* conditional branch */ + int iType2 = (opcode >> 16) & 31; + if (iType2 == 0) + return 100; // BC1F + else if (iType2 == 1) + return 101; // BC1T + else if (iType2 == 2) + return 102; // BC1FL + else if (iType2 == 3) + return 103; // BC1TL + else + return 0; // reserved + } + else if (iType1 == 16 || iType1 == 17 || iType1 == 20 || iType1 == 21) + { + /* Single, Double, Word, Long instructions */ + int iType2 = opcode & 63; + return InstrTypeCop1Math[iType2]; + } + else + { + /* other Cop1 (move) */ + return InstrTypeCop1[iType1]; + } + } + + /* standard MIPS instruction */ + return InstrTypeStd[iType]; +} + diff --git a/libmupen64plus/mupen64plus-core/tools/regtests/daily-tests.cfg b/libmupen64plus/mupen64plus-core/tools/regtests/daily-tests.cfg new file mode 100644 index 0000000000..631c10cbf0 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/tools/regtests/daily-tests.cfg @@ -0,0 +1,188 @@ +#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# * Mupen64plus - daily-tests.cfg * +# * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * +# * Copyright (C) 2008-2009 Richard Goedeken * +# * * +# * 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. * +# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +# Daily regression test config file for Mupen64Plus +# +# To set up an automatic nightly test, run "crontab -e" and add a line like this: +# +# 30 03 * * * export DISPLAY=:0 ; /home/username/software/regtests/regression-video.py +# +# This will launch the test at 3:30am each night. You will need to replace the path to the +# regression-video.py script with the correct path for your system. You may also need to +# disable your screen saver to make this work. + +# Global test settings +rompath = /path/to/N64/ROMs +sendemail = me@mydomain.com +{Core Library} +url = http://bitbucket.org/richard42/mupen64plus-core +outputfiles = libmupen64plus.so.2 +testbuilds = 32-bit build on 64-bit system, LIRC build, No Assembly build, Debug Info build, R4300 Debugger build +testbuildparams = all BITS=32, all LIRC=1, all NO_ASM=1, all DEBUG=1 DBG_CORE=1 DBG_COUNT=1 DBG_COMPARE=1 DBG_PROFILE=1, all DEBUGGER=1 +videobuild = 64-bit basic build +videobuildparams = all +{Console UI} +url = http://bitbucket.org/richard42/mupen64plus-ui-console +outputfiles = mupen64plus +testbuilds = 32-bit build +testbuildparams = all BITS=32 +videobuild = 64-bit +videobuildparams = all +{Video-Rice} +url = http://bitbucket.org/richard42/mupen64plus-video-rice +outputfiles = mupen64plus-video-rice.so +testbuilds = 32-bit build, no assembly build, debug build +testbuildparams = all BITS=32, all NO_ASM=1, all DEBUG=1 +videobuild = 64-bit +videobuildparams = all +{Audio-SDL} +url = http://bitbucket.org/richard42/mupen64plus-audio-sdl +outputfiles = mupen64plus-audio-sdl.so +testbuilds = 32-bit build +testbuildparams = all BITS=32 +videobuild = 64-bit +videobuildparams = all +{Input-SDL} +url = http://bitbucket.org/richard42/mupen64plus-input-sdl +outputfiles = mupen64plus-input-sdl.so +testbuilds = 32-bit build +testbuildparams = all BITS=32 +videobuild = 64-bit +videobuildparams = all +{RSP-HLE} +url = http://bitbucket.org/richard42/mupen64plus-rsp-hle +outputfiles = mupen64plus-rsp-hle.so +testbuilds = 32-bit build +testbuildparams = all BITS=32 +videobuild = 64-bit +videobuildparams = all + +# Game-specific settings +[1080 Snowboarding (E) (M4) [!].z64] +screenshots = 22, 147, 276, 354, 540, 684 + +[Airboarders 64.z64] +screenshots = 46, 450, 475, 508, 548, 632 + +[Automobili Lamborghini.z64] +screenshots = 35, 226, 532, 586, 632, 682, 752, 838 + +[Banjo-Kazooie.z64] +screenshots = 26, 129, 287, 536, 581, 627 + +[Batman Beyond - Return of the Joker.z64] +screenshots = 42, 352, 613, 1178 + +[Bomberman 64 (U) [!].z64] +screenshots = 72, 578, 767, 950, 1110, 1219 + +[Bust-A-Move '99.z64] +screenshots = 119,966,1186,1282,1378,1479,1691,2082 + +[Cruis'n USA.z64] +screenshots = 0, 93, 191, 250, 308, 420 + +[Doom 64.z64] +screenshots = 18, 364, 469 + +[Earthworm Jim 3D.z64] +screenshots = 42, 354, 770, 877, 991, 1285, 1364, 1487 + +[Elmo's Letter Adventure.z64] +screenshots = 49, 393, 1389 + +[Fighting Force 64.z64] +screenshots = 35, 353, 919 ,1044, 1401, 2267 + +[Forsaken 64.z64] +screenshots = 27, 527 + +[Gauntlet Legends.v64] +screenshots = 31, 503, 792, 929, 1038, 1228, 1284, 1412, 1589 +skipvideo = glN64 + +[Iggy's Reckin' Balls.z64] +screenshots = 142, 493, 531, 726, 824 + +[Kirby 64 - The Crystal Shards (U) [!].z64] +screenshots = 28, 164, 439, 606, 859, 979, 1115, 1203, 1384, 1612, 1921, 2170 + +[Mario Kart 64 (U) [!].z64] +screenshots = 41, 104, 260, 572, 629, 897, 961 + +[Micro Machines 64 Turbo.z64] +screenshots = 52, 142, 250, 511, 623, 690, 743 + +[Mischief Makers.z64] +screenshots = 85, 360, 607, 882, 1043, 1155, 1259, 1334, 1489 + +[Mortal Kombat 4 (U) [!].z64] +screenshots = 37, 171, 319, 517 + +[Paper Mario (U) [!].z64] +screenshots = 57, 235, 595, 843, 1177, 1401 + +[Penny Racers.z64] +screenshots = 24, 462, 620, 755 +skipvideo = rice, glide64 + +[Quake 64 (U) [!].z64] +screenshots = 35, 319, 427 + +[Road Rash 64.z64] +screenshots = 44, 330, 459, 634 + +[San Francisco Rush - Extreme Racing.z64] +screenshots = 17, 93, 246, 282, 397, 509, 704 + +[Star Fox 64 (U) (V1.1) [!].z64] +screenshots = 35, 295, 458, 794, 929, 1390 + +[Super Mario 64 (U) [!].z64] +screenshots = 17, 119, 199, 330, 421 + +[Super Smash Bros..z64] +screenshots = 40, 78, 185, 590, 1008, 1117, 1349, 1566, 1639, 1683, 1745, 1805 + +[Taz Express (E) (M6) [!].z64] +screenshots = 25, 119, 167, 322 + +[TheLegendofZeldaOcarinaofTime.v64] +screenshots = 84, 299, 380, 513, 601, 706, 770 + +[Top Gear Rally.z64] +screenshots = 62, 194, 299, 454, 557, 861, 937, 970, 1072, 1228, 1273, 1342 + +[Turok - Dinosaur Hunter.z64] +screenshots = 51, 222, 301, 438, 554, 910, 975, 1004 + +[Wave Race 64.z64] +screenshots = 25, 99, 214, 275, 333, 389, 426 + +[Wetrix.N64] +screenshots = 66, 176, 353, 440, 545, 742, 827, 863 + +[Worms - Armageddon (U) (M3) [!].z64] +screenshots = 38, 375 + +[Yoshi's Story (U) (M2) [!].z64] +screenshots = 68, 276, 340, 572, 638 + diff --git a/libmupen64plus/mupen64plus-core/tools/regtests/regression-video.py b/libmupen64plus/mupen64plus-core/tools/regtests/regression-video.py new file mode 100644 index 0000000000..1d438b7c5c --- /dev/null +++ b/libmupen64plus/mupen64plus-core/tools/regtests/regression-video.py @@ -0,0 +1,527 @@ +#!/usr/bin/env python + +#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# * Mupen64plus - regression-video.py * +# * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * +# * Copyright (C) 2008-2012 Richard Goedeken * +# * * +# * 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. * +# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +from optparse import OptionParser +from threading import Thread +from datetime import date +import subprocess +import commands +import shutil +import stat +import sys +import os + +# set global report string +report = "Mupen64Plus Regression Test report\n----------------------------------\n" + +#****************************************************************************** +# main functions +# + +def main(rootdir, cfgfile, nobuild, noemail): + global report + # set up child directory paths + srcdir = os.path.join(rootdir, "source") + shotdir = os.path.join(rootdir, "current") + refdir = os.path.join(rootdir, "reference") + archivedir = os.path.join(rootdir, "archive") + # run the test procedure + tester = RegTester(rootdir, srcdir, shotdir) + rval = 0 + while True: + # Step 1: load the test config file + if not tester.LoadConfig(cfgfile): + rval = 1 + break + # Step 2: check out from Mercurial + if not nobuild: + if not tester.CheckoutSource(srcdir): + rval = 2 + break + # Step 3: run test builds + if not nobuild: + for modname in tester.modulesAndParams: + module = tester.modulesAndParams[modname] + if "testbuilds" not in module: + continue + modurl = module["url"] + modfilename = modurl.split('/')[-1] + testlist = [ name.strip() for name in module["testbuilds"].split(',') ] + makeparams = [ params.strip() for params in module["testbuildparams"].split(',') ] + if len(testlist) != len(makeparams): + report += "Config file error for test builds in %s. Build name list and makefile parameter list have different lengths.\n" % modname + testbuilds = min(len(testlist), len(makeparams)) + for i in range(testbuilds): + buildname = testlist[i] + buildmake = makeparams[i] + BuildSource(srcdir, modfilename, modname, buildname, buildmake, module["outputfiles"], True) + # Step 4: build the binary for the video regression test + if not nobuild: + for modname in tester.modulesAndParams: + module = tester.modulesAndParams[modname] + modurl = module["url"] + modfilename = modurl.split('/')[-1] + videobuild = module["videobuild"] + videomake = module["videobuildparams"] + if not BuildSource(srcdir, modfilename, modname, videobuild, videomake, module["outputfiles"], False): + rval = 3 + break + if rval != 0: + break + # Step 5: run the tests, check the results + if not tester.RunTests(): + rval = 4 + break + if not tester.CheckResults(refdir): + rval = 5 + break + # test procedure is finished + break + # Step 6: send email report and archive the results + if not noemail: + if not tester.SendReport(): + rval = 6 + if not tester.ArchiveResults(archivedir): + rval = 7 + # all done with test process + return rval + +#****************************************************************************** +# Checkout & build functions +# + +def BuildSource(srcdir, moddir, modname, buildname, buildmake, outputfiles, istest): + global report + makepath = os.path.join(srcdir, moddir, "projects", "unix") + # print build report message and clear counters + testbuildcommand = "make -C %s %s" % (makepath, buildmake) + if istest: + report += "Running %s test build \"%s\"\n" % (modname, buildname) + else: + report += "Building %s \"%s\" for video test\n" % (modname, buildname) + warnings = 0 + errors = 0 + # run make and capture the output + output = commands.getoutput(testbuildcommand) + makelines = output.split("\n") + # print warnings and errors + for line in makelines: + if "error:" in line: + report += " " + line + "\n" + errors += 1 + if "warning:" in line: + report += " " + line + "\n" + warnings += 1 + report += "%i errors. %i warnings.\n" % (errors, warnings) + if errors > 0 and not istest: + return False + # check for output files + for filename in outputfiles.split(','): + if not os.path.exists(os.path.join(makepath, filename)): + report += "Build failed: '%s' not found\n" % filename + errors += 1 + if errors > 0 and not istest: + return False + # clean up if this was a test + if istest: + os.system("make -C %s clean" % makepath) + # if this wasn't a test, then copy our output files and data files + if not istest: + for filename in outputfiles.split(','): + shutil.move(os.path.join(makepath, filename), srcdir) + datapath = os.path.join(srcdir, moddir, "data") + if os.path.isdir(datapath): + copytree(datapath, os.path.join(srcdir, "data")) + # build was successful! + return True + +#****************************************************************************** +# Test execution classes +# +class RegTester: + def __init__(self, rootdir, bindir, screenshotdir): + self.rootdir = rootdir + self.bindir = bindir + self.screenshotdir = screenshotdir + self.generalParams = { } + self.gamesAndParams = { } + self.modulesAndParams = { } + self.videoplugins = [ "mupen64plus-video-rice.so" ] + self.thisdate = str(date.today()) + + def LoadConfig(self, filename): + global report + # read the config file + report += "\nLoading regression test configuration.\n" + try: + cfgfile = open(os.path.join(self.rootdir, filename), "r") + cfglines = cfgfile.read().split("\n") + cfgfile.close() + except Exception, e: + report += "Error in RegTestConfigParser::LoadConfig(): %s" % e + return False + # parse the file + GameFilename = None + ModuleName = None + for line in cfglines: + # strip leading and trailing whitespace + line = line.strip() + # test for comment + if len(line) == 0 or line[0] == '#': + continue + # test for new game filename + if line[0] == '[' and line [-1] == ']': + GameFilename = line[1:-1] + if GameFilename in self.gamesAndParams: + report += " Warning: Config file '%s' contains duplicate game entry '%s'\n" % (filename, GameFilename) + else: + self.gamesAndParams[GameFilename] = { } + continue + # test for new source module build + if line[0] == '{' and line [-1] == '}': + ModuleName = line[1:-1] + if ModuleName in self.modulesAndParams: + report += " Warning: Config file '%s' contains duplicate source module '%s'\n" % (filename, ModuleName) + else: + self.modulesAndParams[ModuleName] = { } + continue + # print warning and continue if it's not a (key = value) pair + pivot = line.find('=') + if pivot == -1: + report += " Warning: Config file '%s' contains unrecognized line: '%s'\n" % (filename, line) + continue + # parse key, value + key = line[:pivot].strip().lower() + value = line[pivot+1:].strip() + if ModuleName is None: + paramDict = self.generalParams + elif GameFilename is None: + paramDict = self.modulesAndParams[ModuleName] + else: + paramDict = self.gamesAndParams[GameFilename] + if key in paramDict: + report += " Warning: duplicate key '%s'\n" % key + continue + paramDict[key] = value + # check for required parameters + if "rompath" not in self.generalParams: + report += " Error: rompath is not given in config file\n" + return False + # config is loaded + return True + + def CheckoutSource(self, srcdir): + global report + # remove any current source directory + if not deltree(srcdir): + return False + os.mkdir(srcdir) + os.mkdir(os.path.join(srcdir, "data")) + # loop through all of the source modules + for modname in self.modulesAndParams: + module = self.modulesAndParams[modname] + if "url" not in module: + report += "Error: no Hg repository URL for module %s\n\n" % modname + return False + modurl = module["url"] + modfilename = modurl.split("/")[-1] + # call Hg to checkout Mupen64Plus source module + output = commands.getoutput("hg clone --cwd %s %s" % (srcdir, modurl)) + # parse the output + lastline = output.split("\n")[-1] + if "0 files unresolved" not in lastline: + report += "Hg Error: %s\n\n" % lastline + return False + # get the revision info + RevFound = False + output = commands.getoutput("hg tip -R %s" % os.path.join(srcdir, modfilename)) + for line in output.split('\n'): + words = line.split() + if len(words) == 2 and words[0] == 'changeset:': + report += "Hg Checkout %s: changeset %s\n" % (modfilename, words[1]) + RevFound = True + if not RevFound: + report += "Hg Error: couldn't find revision information\n\n" + return False + return True + + def RunTests(self): + global report + rompath = self.generalParams["rompath"] + if not os.path.exists(rompath): + report += " Error: ROM directory '%s' does not exist!\n" % rompath + return False + # Remove any current screenshot directory + if not deltree(self.screenshotdir): + return False + # Data initialization and start message + os.mkdir(self.screenshotdir) + for plugin in self.videoplugins: + videoname = plugin[:plugin.find('.')] + os.mkdir(os.path.join(self.screenshotdir, videoname)) + report += "\nRunning regression tests on %i games.\n" % len(self.gamesAndParams) + # loop over each game filename given in regtest config file + for GameFilename in self.gamesAndParams: + GameParams = self.gamesAndParams[GameFilename] + # if no screenshots parameter given for this game then skip it + if "screenshots" not in GameParams: + report += " Warning: no screenshots taken for game '%s'\n" % GameFilename + continue + # make a list of screenshots and check it + shotlist = [ str(int(framenum.strip())) for framenum in GameParams["screenshots"].split(',') ] + if len(shotlist) < 1 or (len(shotlist) == 1 and shotlist[0] == '0'): + report += " Warning: invalid screenshot list for game '%s'\n" % GameFilename + continue + # run a test for each video plugin + for plugin in self.videoplugins: + videoname = plugin[:plugin.find('.')] + # check if this plugin should be skipped + if "skipvideo" in GameParams: + skipit = False + skiplist = [ name.strip() for name in GameParams["skipvideo"].split(',') ] + for skiptag in skiplist: + if skiptag.lower() in plugin.lower(): + skipit = True + if skipit: + continue + # construct the command line + exepath = os.path.join(self.bindir, "mupen64plus") + exeparms = [ "--corelib", os.path.join(self.bindir, "libmupen64plus.so.2") ] + exeparms += [ "--testshots", ",".join(shotlist) ] + exeparms += [ "--sshotdir", os.path.join(self.screenshotdir, videoname) ] + exeparms += [ "--plugindir", self.bindir ] + exeparms += [ "--datadir", os.path.join(self.bindir, "data") ] + myconfig = os.path.join(self.rootdir, "config") + exeparms += [ "--configdir", myconfig ] + exeparms += [ "--gfx", plugin ] + exeparms += [ "--emumode", "2" ] + exeparms += [ os.path.join(rompath, GameFilename) ] + # run it, but if it takes too long print an error and kill it + testrun = RegTestRunner(exepath, exeparms) + testrun.start() + testrun.join(60.0) + if testrun.isAlive(): + report += " Error: Test run timed out after 60 seconds: '%s'\n" % " ".join(exeparms) + os.kill(testrun.pid, 9) + testrun.join(10.0) + + # all tests have been run + return True + + def CheckResults(self, refdir): + global report + # print message + warnings = 0 + errors = 0 + report += "\nChecking regression test results\n" + # get lists of files in the reference folders + refshots = { } + if not os.path.exists(refdir): + os.mkdir(refdir) + for plugin in self.videoplugins: + videoname = plugin[:plugin.find('.')] + videodir = os.path.join(refdir, videoname) + if not os.path.exists(videodir): + os.mkdir(videodir) + refshots[videoname] = [ ] + else: + refshots[videoname] = [ filename for filename in os.listdir(videodir) ] + # get lists of files produced by current test runs + newshots = { } + for plugin in self.videoplugins: + videoname = plugin[:plugin.find('.')] + videodir = os.path.join(self.screenshotdir, videoname) + if not os.path.exists(videodir): + newshots[videoname] = [ ] + else: + newshots[videoname] = [ filename for filename in os.listdir(videodir) ] + # make list of matching ref/test screenshots, and look for missing reference screenshots + checklist = { } + for plugin in self.videoplugins: + videoname = plugin[:plugin.find('.')] + checklist[videoname] = [ ] + for filename in newshots[videoname]: + if filename in refshots[videoname]: + checklist[videoname] += [ filename ] + else: + report += " Warning: reference screenshot '%s/%s' missing. Copying from current test run\n" % (videoname, filename) + shutil.copy(os.path.join(self.screenshotdir, videoname, filename), os.path.join(refdir, videoname)) + warnings += 1 + # look for missing test screenshots + for plugin in self.videoplugins: + videoname = plugin[:plugin.find('.')] + for filename in refshots[videoname]: + if filename not in newshots[videoname]: + report += " Error: Test screenshot '%s/%s' missing.\n" % (videoname, filename) + errors += 1 + # do image comparisons + for plugin in self.videoplugins: + videoname = plugin[:plugin.find('.')] + for filename in checklist[videoname]: + refimage = os.path.join(refdir, videoname, filename) + testimage = os.path.join(self.screenshotdir, videoname, filename) + diffimage = os.path.join(self.screenshotdir, videoname, os.path.splitext(filename)[0] + "_DIFF.png") + cmd = ("/usr/bin/compare", "-metric", "PSNR", refimage, testimage, diffimage) + pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout + similarity = pipe.read().strip() + pipe.close() + try: + db = float(similarity) + except: + db = 0 + if db > 60.0: + os.unlink(diffimage) + else: + report += " Warning: test image '%s/%s' does not match reference. PSNR = %s\n" % (videoname, filename, similarity) + warnings += 1 + # give report and return + report += "%i errors. %i warnings.\n" % (errors, warnings) + return True + + def SendReport(self): + global report + # if there are no email addresses in the config file, then just we're done + if "sendemail" not in self.generalParams: + return True + if len(self.generalParams["sendemail"]) < 5: + return True + # construct the email message header + emailheader = "To: %s\n" % self.generalParams["sendemail"] + emailheader += "From: Mupen64Plus-Tester@fascination.homelinux.net\n" + emailheader += "Subject: %s Regression Test Results for Mupen64Plus\n" % self.thisdate + emailheader += "Reply-to: do-not-reply@fascination.homelinux.net\n" + emailheader += "Content-Type: text/plain; charset=UTF-8\n" + emailheader += "Content-Transfer-Encoding: 8bit\n\n" + # open a pipe to sendmail and dump our report + try: + pipe = subprocess.Popen(("/usr/sbin/sendmail", "-t"), stdin=subprocess.PIPE).stdin + pipe.write(emailheader) + pipe.write(report) + pipe.close() + except Exception, e: + report += "Exception encountered when calling sendmail: '%s'\n" % e + report += "Email header:\n%s\n" % emailheader + return False + return True + + def ArchiveResults(self, archivedir): + global report + # create archive dir if it doesn't exist + if not os.path.exists(archivedir): + os.mkdir(archivedir) + # move the images into a subdirectory of 'archive' given by date + subdir = os.path.join(archivedir, self.thisdate) + if os.path.exists(subdir): + if not deltree(subdir): + return False + if os.path.exists(self.screenshotdir): + shutil.move(self.screenshotdir, subdir) + # copy the report into the archive directory + f = open(os.path.join(archivedir, "report_%s.txt" % self.thisdate), "w") + f.write(report) + f.close() + # archival is complete + return True + + +class RegTestRunner(Thread): + def __init__(self, exepath, exeparms): + self.exepath = exepath + self.exeparms = exeparms + self.pid = 0 + self.returnval = None + Thread.__init__(self) + + def run(self): + # start the process + testprocess = subprocess.Popen([self.exepath] + self.exeparms) + # get the PID of the new test process + self.pid = testprocess.pid + # wait for the test to complete + self.returnval = testprocess.wait() + + +#****************************************************************************** +# Generic helper functions +# + +def deltree(dirname): + global report + if not os.path.exists(dirname): + return True + try: + for path in (os.path.join(dirname, filename) for filename in os.listdir(dirname)): + if os.path.isdir(path): + if not deltree(path): + return False + else: + os.unlink(path) + os.rmdir(dirname) + except Exception, e: + report += "Error in deltree(): %s\n" % e + return False + + return True + +def copytree(srcpath, dstpath): + if not os.path.isdir(srcpath) or not os.path.isdir(dstpath): + return False + for filename in os.listdir(srcpath): + filepath = os.path.join(srcpath, filename) + if os.path.isdir(filepath): + subdstpath = os.path.join(dstpath, filename) + os.mkdir(subdstpath) + copytree(filepath, subdstpath) + else: + shutil.copy(filepath, dstpath) + return True + +#****************************************************************************** +# main function call for standard script execution +# + +if __name__ == "__main__": + # parse the command-line arguments + parser = OptionParser() + parser.add_option("-n", "--nobuild", dest="nobuild", default=False, action="store_true", + help="Assume source code is present; don't check out and build") + parser.add_option("-e", "--noemail", dest="noemail", default=False, action="store_true", + help="don't send email or archive results") + parser.add_option("-t", "--testpath", dest="testpath", + help="Set root of testing directory to PATH", metavar="PATH") + parser.add_option("-c", "--cfgfile", dest="cfgfile", default="daily-tests.cfg", + help="Use regression test config file FILE", metavar="FILE") + (opts, args) = parser.parse_args() + # check test path + if opts.testpath is None: + # change directory to the directory containing this script and set root test path to "." + scriptdir = os.path.dirname(sys.argv[0]) + os.chdir(scriptdir) + rootdir = "." + else: + rootdir = opts.testpath + # call the main function + rval = main(rootdir, opts.cfgfile, opts.nobuild, opts.noemail) + sys.exit(rval) + + diff --git a/libmupen64plus/mupen64plus-core/tools/savestate_convert.c b/libmupen64plus/mupen64plus-core/tools/savestate_convert.c new file mode 100644 index 0000000000..f639d31a68 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/tools/savestate_convert.c @@ -0,0 +1,396 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - savestate_convert.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2008 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include +#include + +/* savestate file header: magic number and version number */ +const char *savestate_magic = "M64+SAVE"; +const int savestate_newest_version = 0x00010000; // 1.0 + +/* Data field lengths */ + +#define SIZE_REG_RDRAM 40 +#define SIZE_REG_MIPS 36 +#define SIZE_REG_PI 52 +#define SIZE_REG_SP 52 +#define SIZE_REG_RSP 8 +#define SIZE_REG_SI 16 +#define SIZE_REG_VI 60 +#define SIZE_REG_RI 32 +#define SIZE_REG_AI 40 +#define SIZE_REG_DPC 48 +#define SIZE_REG_DPS 16 + +#define SIZE_FLASHRAM_INFO 24 +#define SIZE_TLB_ENTRY 52 + +#define SIZE_MAX_EVENTQUEUE 1024 + +/* Arrays and pointers for savestate data */ + +char rom_md5[32]; + +char rdram_register[SIZE_REG_RDRAM]; +char mips_register[SIZE_REG_MIPS]; +char pi_register[SIZE_REG_PI]; +char sp_register[SIZE_REG_SP]; +char rsp_register[SIZE_REG_RSP]; +char si_register[SIZE_REG_SI]; +char vi_register[SIZE_REG_VI]; +char ri_register[SIZE_REG_RI]; +char ai_register[SIZE_REG_AI]; +char dpc_register[SIZE_REG_DPC]; +char dps_register[SIZE_REG_DPS]; + +char *rdram; /* 0x800000 bytes */ +char SP_DMEM[0x1000]; +char SP_IMEM[0x1000]; +char PIF_RAM[0x40]; + +char flashram[SIZE_FLASHRAM_INFO]; + +char *tlb_LUT_r; /* 0x400000 bytes */ +char *tlb_LUT_w; /* 0x400000 bytes */ + +char llbit[4]; +char reg[32][8]; +char reg_cop0[32][4]; +char lo[8]; +char hi[8]; +char reg_cop1_fgr_64[32][8]; +char FCR0[4]; +char FCR31[4]; +char tlb_e[32][SIZE_TLB_ENTRY]; +char PCaddr[4]; + +char next_interupt[4]; +char next_vi[4]; +char vi_field[4]; + +char eventqueue[SIZE_MAX_EVENTQUEUE]; + +/* savestate data parameters calculated from file contents */ +int queuelength = 0; + +/* Forward declarations for functions */ +void printhelp(const char *progname); + +int allocate_memory(void); +void free_memory(void); + +int load_original_mupen64(const char *filename); +int save_newest(const char *filename); + +/* Main Function - parse arguments, check version, load state file, overwrite state file with new one */ +int main(int argc, char *argv[]) +{ + FILE *pfTest; + gzFile f; + char *filename; + char magictag[8]; + unsigned char inbuf[4]; + int (*load_function)(const char *) = NULL; + int iVersion; + + /* start by parsing the command-line arguments */ + if (argc != 2 || strncmp(argv[1], "-h", 2) == 0 || strncmp(argv[1], "--help", 6) == 0) + { + printhelp(argv[0]); + return 1; + } + filename = argv[1]; + pfTest = fopen(filename, "rb"); + if (pfTest == NULL) + { + printf("Error: cannot open savestate file '%s' for reading.\n", filename); + return 2; + } + fclose(pfTest); + + /* try to determine the version of this savestate file */ + f = gzopen(filename, "rb"); + if (f == NULL) + { + printf("Error: state file '%s' is corrupt\n", filename); + return 3; + } + if (gzread(f, magictag, 8) != 8 || gzread(f, inbuf, 4) != 4) + { + printf("Error: state file '%s' is corrupt: end of savestate file while reading header.\n", filename); + gzclose(f); + return 4; + } + gzclose(f); + iVersion = inbuf[0]; + iVersion = (iVersion << 8) | inbuf[1]; + iVersion = (iVersion << 8) | inbuf[2]; + iVersion = (iVersion << 8) | inbuf[3]; + + /* determine which type of savestate file to load, based on savestate version */ + if (strncmp(magictag, savestate_magic, 8) != 0) + { + printf("Warning: old savestate file format. This is presumed to be from the original Mupen64 or Mupen64Plus version 1.4 or earlier.\n"); + load_function = load_original_mupen64; + } + else if (iVersion == savestate_newest_version) + { + printf("This savestate file is already up to date (version %08x)\n", savestate_newest_version); + return 0; + } + else + { + printf("This savestate file uses an unknown version (%08x)\n", iVersion); + return 5; + } + + /* allocate memory for savestate data */ + if (allocate_memory() != 0) + { + printf("Error: couldn't allocate memory for savestate data storage.\n"); + return 6; + } + + /* load the savestate file */ + if (load_function(filename) != 0) + { + free_memory(); + return 7; + } + + /* write new updated savestate file */ + if (save_newest(filename) != 0) + { + free_memory(); + return 8; + } + + /* free the memory and return */ + printf("Savestate file '%s' successfully converted to latest version (%08x).\n", filename, savestate_newest_version); + free_memory(); + return 0; +} + +void printhelp(const char *progname) +{ + printf("%s - convert older Mupen64Plus savestate files to most recent version.\n\n", progname); + printf("Usage: %s [-h] [--help] \n\n", progname); + printf(" -h, --help: display this message\n"); + printf(" : full path to savestate file which will be overwritten with latest version.\n"); +} + +int allocate_memory(void) +{ + rdram = malloc(0x800000); + if (rdram == NULL) + return 1; + + tlb_LUT_r = malloc(0x400000); + if (tlb_LUT_r == NULL) + { + free_memory(); + return 2; + } + + tlb_LUT_w = malloc(0x400000); + if (tlb_LUT_w == NULL) + { + free_memory(); + return 3; + } + + return 0; +} + +void free_memory(void) +{ + if (rdram != NULL) + { + free(rdram); + rdram = NULL; + } + + if (tlb_LUT_r != NULL) + { + free(tlb_LUT_r); + tlb_LUT_r = NULL; + } + + if (tlb_LUT_w != NULL) + { + free(tlb_LUT_w); + tlb_LUT_w = NULL; + } +} + +/* State Loading Functions */ +int load_original_mupen64(const char *filename) +{ + char buffer[4]; + int i; + gzFile f; + + f = gzopen(filename, "rb"); + + if (f == NULL) + { + printf("Error: savestate file '%s' is corrupt.\n", filename); + return 1; + } + + gzread(f, rom_md5, 32); + + gzread(f, rdram_register, SIZE_REG_RDRAM); + gzread(f, mips_register, SIZE_REG_MIPS); + gzread(f, pi_register, SIZE_REG_PI); + gzread(f, sp_register, SIZE_REG_SP); + gzread(f, rsp_register, SIZE_REG_RSP); + gzread(f, si_register, SIZE_REG_SI); + gzread(f, vi_register, SIZE_REG_VI); + gzread(f, ri_register, SIZE_REG_RI); + gzread(f, ai_register, SIZE_REG_AI); + gzread(f, dpc_register, SIZE_REG_DPC); + gzread(f, dps_register, SIZE_REG_DPS); + + gzread(f, rdram, 0x800000); + gzread(f, SP_DMEM, 0x1000); + gzread(f, SP_IMEM, 0x1000); + gzread(f, PIF_RAM, 0x40); + + gzread(f, flashram, SIZE_FLASHRAM_INFO); + + memset(tlb_LUT_r, 0, 0x400000); + memset(tlb_LUT_w, 0, 0x400000); + gzread(f, tlb_LUT_r, 0x100000); + gzread(f, tlb_LUT_w, 0x100000); + + gzread(f, llbit, 4); + gzread(f, reg, 32*8); + for (i = 0; i < 32; i++) + { + gzread(f, reg_cop0[i], 4); + gzread(f, buffer, 4); /* for compatibility with older versions. */ + } + gzread(f, lo, 8); + gzread(f, hi, 8); + gzread(f, reg_cop1_fgr_64[0], 32 * 8); + gzread(f, FCR0, 4); + gzread(f, FCR31, 4); + gzread(f, tlb_e[0], 32 * SIZE_TLB_ENTRY); + gzread(f, PCaddr, 4); + + gzread(f, next_interupt, 4); + gzread(f, next_vi, 4); + gzread(f, vi_field, 4); + + queuelength = 0; + while(queuelength < SIZE_MAX_EVENTQUEUE) + { + if (gzread(f, eventqueue + queuelength, 4) != 4) + { + printf("Error: savestate file '%s' is corrupt.\n", filename); + return 2; + } + if (*((unsigned int*) &eventqueue[queuelength]) == 0xFFFFFFFF) + { + queuelength += 4; + break; + } + gzread(f, eventqueue + queuelength + 4, 4); + queuelength += 8; + } + + if (queuelength >= SIZE_MAX_EVENTQUEUE) + { + printf("Error: savestate file '%s' has event queue larger than %i bytes.\n", filename, SIZE_MAX_EVENTQUEUE); + return 3; + } + + gzclose(f); + return 0; +} + +/* State Saving Functions */ + +int save_newest(const char *filename) +{ + unsigned char outbuf[4]; + gzFile f; + + f = gzopen(filename, "wb"); + + /* write magic number */ + gzwrite(f, savestate_magic, 8); + + /* write savestate file version in big-endian */ + outbuf[0] = (savestate_newest_version >> 24) & 0xff; + outbuf[1] = (savestate_newest_version >> 16) & 0xff; + outbuf[2] = (savestate_newest_version >> 8) & 0xff; + outbuf[3] = (savestate_newest_version >> 0) & 0xff; + gzwrite(f, outbuf, 4); + + gzwrite(f, rom_md5, 32); + + gzwrite(f, rdram_register, SIZE_REG_RDRAM); + gzwrite(f, mips_register, SIZE_REG_MIPS); + gzwrite(f, pi_register, SIZE_REG_PI); + gzwrite(f, sp_register, SIZE_REG_SP); + gzwrite(f, rsp_register, SIZE_REG_RSP); + gzwrite(f, si_register, SIZE_REG_SI); + gzwrite(f, vi_register, SIZE_REG_VI); + gzwrite(f, ri_register, SIZE_REG_RI); + gzwrite(f, ai_register, SIZE_REG_AI); + gzwrite(f, dpc_register, SIZE_REG_DPC); + gzwrite(f, dps_register, SIZE_REG_DPS); + + gzwrite(f, rdram, 0x800000); + gzwrite(f, SP_DMEM, 0x1000); + gzwrite(f, SP_IMEM, 0x1000); + gzwrite(f, PIF_RAM, 0x40); + + gzwrite(f, flashram, SIZE_FLASHRAM_INFO); + + gzwrite(f, tlb_LUT_r, 0x400000); + gzwrite(f, tlb_LUT_w, 0x400000); + + gzwrite(f, llbit, 4); + gzwrite(f, reg[0], 32*8); + gzwrite(f, reg_cop0[0], 32*4); + gzwrite(f, lo, 8); + gzwrite(f, hi, 8); + gzwrite(f, reg_cop1_fgr_64[0], 32*8); + gzwrite(f, FCR0, 4); + gzwrite(f, FCR31, 4); + gzwrite(f, tlb_e[0], 32 * SIZE_TLB_ENTRY); + gzwrite(f, PCaddr, 4); + + gzwrite(f, next_interupt, 4); + gzwrite(f, next_vi, 4); + gzwrite(f, vi_field, 4); + + gzwrite(f, eventqueue, queuelength); + + gzclose(f); + return 0; +} + diff --git a/libmupen64plus/mupen64plus-core/tools/savestate_convert.txt b/libmupen64plus/mupen64plus-core/tools/savestate_convert.txt new file mode 100644 index 0000000000..ac872251a0 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/tools/savestate_convert.txt @@ -0,0 +1,36 @@ +============================================================================== +savestate_convert.txt - Mupen64Plus - July 12th, 2008 + +This conversion tool was written to help users migrate their savestate files +when there are changes to the savestate file format which break backward +compatibility. + +To compile the conversion tool, open a console window, go to the root of your +Mupen64Plus source code, and type: + +gcc -o savestate_convert -lz tools/savestate_convert.c + +This will create a small command-line application called 'savestate_convert'. +This program takes only one command-line parameter, which is a path to the +savestate file that you want to update. The old savestate file will be +overwritten with the new one, so you may wish to first make a backup copy +of the savestate file. If you update a savestate file to a newer version, +older versions of Mupen64Plus will not be able to load it. + +If you wish to update all of the savestate files in your home directory, you +may do so with the following bash command: + +for file in ~/.mupen64plus/save/*.st*; do ./savestate_convert "${file}"; done + +============================================================================== +Savestate File Format History: + +version 0: + - Original (Unversioned) file format + - used by Mupen64 v0.5 and Mupen64Plus up to v1.4 + +version 1.0: + - bugfix: TLB was not being entirely saved and restored + - added small header with magic number and version number + - introduced in rev 758 of Mupen64Plus SVN repository (trunk) + diff --git a/libmupen64plus/mupen64plus-core/tools/uninstall_binary_bundle.sh b/libmupen64plus/mupen64plus-core/tools/uninstall_binary_bundle.sh new file mode 100644 index 0000000000..331909c7c9 --- /dev/null +++ b/libmupen64plus/mupen64plus-core/tools/uninstall_binary_bundle.sh @@ -0,0 +1,81 @@ +#!/bin/sh +# +# mupen64plus binary bundle uninstall script +# +# Copyright 2007-2009 The Mupen64Plus Development Team +# +# 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. +# + +set -e + +export PATH=/bin:/usr/bin + +usage() +{ +printf "usage: $(basename $0) [PREFIX] [SHAREDIR] [BINDIR] [LIBDIR] [PLUGINDIR] [MANDIR] +\tPREFIX - installation directories prefix (default: /usr/local) +\tSHAREDIR - path to Mupen64Plus shared data files (default: \$PREFIX/share/mupen64plus) +\tBINDIR - path to Mupen64Plus binary program files (default: \$PREFIX/bin) +\tLIBDIR - path to Mupen64Plus core library (default: \$PREFIX/lib) +\tPLUGINDIR - path to Mupen64Plus plugin libraries (default: \$PREFIX/lib/mupen64plus) +\tMANDIR - path to manual files (default: \$PREFIX/man) +" +} + +if [ $# -gt 6 ]; then + usage + exit 1 +fi + +PREFIX="${1:-/usr/local}" +SHAREDIR="${2:-${PREFIX}/share/mupen64plus}" +BINDIR="${3:-${PREFIX}/bin}" +LIBDIR="${4:-${PREFIX}/lib}" +PLUGINDIR="${5:-${PREFIX}/lib/mupen64plus}" +MANDIR="${6:-${PREFIX}/share/man}" + +printf "Uninstalling Mupen64Plus Binary Bundle from ${PREFIX}\n" +# Mupen64Plus-Core +rm -f "${LIBDIR}"/libmupen64plus.so* +/sbin/ldconfig +rm -f "${SHAREDIR}/font.ttf" +rm -f "${SHAREDIR}/mupen64plus.cht" +rm -f "${SHAREDIR}/mupen64plus.ini" +rm -f "${SHAREDIR}"/doc/* +# Mupen64Plus-ROM +rm -f "${SHAREDIR}/m64p_test_rom.v64" +# Mupen64Plus-UI-Console +rm -f "${BINDIR}/mupen64plus" +rm -f "${MANDIR}/man6/mupen64plus.6" +# Plugins +rm -f "${PLUGINDIR}/mupen64plus-audio-sdl.so" +rm -f "${PLUGINDIR}/mupen64plus-input-sdl.so" +rm -f "${PLUGINDIR}/mupen64plus-rsp-hle.so" +rm -f "${PLUGINDIR}/mupen64plus-video-rice.so" +rm -f "${SHAREDIR}/RiceVideoLinux.ini" +rm -f "${SHAREDIR}/InputAutoCfg.ini" +# get rid of the empty dirs +rmdir --ignore-fail-on-non-empty "${SHAREDIR}/doc" +rmdir --ignore-fail-on-non-empty "${SHAREDIR}" +rmdir --ignore-fail-on-non-empty "${BINDIR}" +rmdir --ignore-fail-on-non-empty "${LIBDIR}" +rmdir --ignore-fail-on-non-empty "${PLUGINDIR}" +rmdir --ignore-fail-on-non-empty "${MANDIR}/man6" +rmdir --ignore-fail-on-non-empty "${MANDIR}" + +printf "Done.\n" + diff --git a/libmupen64plus/mupen64plus-input-sdl/AUTHORS b/libmupen64plus/mupen64plus-input-sdl/AUTHORS new file mode 100644 index 0000000000..afcbe3e227 --- /dev/null +++ b/libmupen64plus/mupen64plus-input-sdl/AUTHORS @@ -0,0 +1,4 @@ +Original author: Gregor Anich + +Subsequent authors: many people from the Mupen64Plus team have worked on this code. + diff --git a/libmupen64plus/mupen64plus-input-sdl/COPYING b/libmupen64plus/mupen64plus-input-sdl/COPYING new file mode 100644 index 0000000000..60549be514 --- /dev/null +++ b/libmupen64plus/mupen64plus-input-sdl/COPYING @@ -0,0 +1,340 @@ + 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. + + + Copyright (C) 19yy + + 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) 19yy 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. + + , 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. diff --git a/libmupen64plus/mupen64plus-input-sdl/INSTALL b/libmupen64plus/mupen64plus-input-sdl/INSTALL new file mode 100644 index 0000000000..9319528a61 --- /dev/null +++ b/libmupen64plus/mupen64plus-input-sdl/INSTALL @@ -0,0 +1,26 @@ +Mupen64Plus-Input-SDL INSTALL +----------------------------- + +This text file was written to explain the installation process of the +Mupen64Plus-Input-SDL module. + +If this module is part of a Mupen64Plus source code bundle, the user should run +the "m64p_install.sh" script in the root of the unzipped bundle to install all +of the included modules in the bundle. + +If this module is a standalone source code release, you should build the library +from source code and install it via the makefile, like this: + +$ cd projects/unix +$ make all +$ sudo make install + +If you want to build the Mupen64Plus-Input-SDL module for installation in a +home folder for a single user, you may build it like this (replacing + with your desired local installation path): + +$ cd projects/unix +$ make all +$ make install LIBDIR= + + diff --git a/libmupen64plus/mupen64plus-input-sdl/LICENSES b/libmupen64plus/mupen64plus-input-sdl/LICENSES new file mode 100644 index 0000000000..a14c6fc69b --- /dev/null +++ b/libmupen64plus/mupen64plus-input-sdl/LICENSES @@ -0,0 +1,368 @@ +Mupen64Plus-input-sdl LICENSE +----------------------------- + +Mupen64Plus-input-sdl is licensed under the GNU General Public License version 2. + +The authors of Mupen64Plus are: + * Richard Goedeken (Richard42) + * John Chadwick (NMN) + * James Hood (Ebenblues) + * Scott Gorman (okaygo) + * Scott Knauert (Tillin9) + * Jesse Dean (DarkJezter) + * Louai Al-Khanji (slougi) + * Bob Forder (orbitaldecay) + * Jason Espinosa (hasone) + * HyperHacker + * and others. + +Mupen64Plus is based on GPL-licensed source code from Mupen64 v0.5, originally written by: + * Hacktarux + * Dave2001 + * Zilmar + * Gregor Anich (Blight) + * Juha Luotio (JttL) + * and others. + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, 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 + + + Appendix: 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. + + + Copyright (C) 19yy + + 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., 675 Mass Ave, Cambridge, MA 02139, 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) 19yy 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. + + , 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. + diff --git a/libmupen64plus/mupen64plus-input-sdl/README b/libmupen64plus/mupen64plus-input-sdl/README new file mode 100644 index 0000000000..41e58432bb --- /dev/null +++ b/libmupen64plus/mupen64plus-input-sdl/README @@ -0,0 +1,125 @@ +********Notes about usage of SDL input plugin: + - If one of the enabled controllers has the "mouse" general-purpose config parameters set + to True, the plugin will hide the mouse cursor and 'grab' the mouse pointer. The user + may press the Left Control and Alt keys together to toggle the mouse cursor on and off. + - If X/Y analog axes are mapped to keys, a plain keypress will simulate the joystick + being pressed all the way to the edge. To decrease the amount of simulated joystick + deflection, the user may press Right Control, Right Shift, or Right Ctrl+Right Shift. + +********Notes for supported joysticks for auto-configuration: + +1. Jess Tech Rumble Pad (Saitek Rumble) +The left D-pad is mapped to the D-pad; The joystick is mapped to the left joystick of the gamepad; the C buttons are mapped to the gampad's right joystick. Start button is mapped to start; the A-button is mapped to the lowest button on the gamepad's right front; the B-button to the left button (buttons marked 3 and 1 on my gamepad). The L and R buttons are mapped to the lower left and right rear triggers; the Z button is mapped to the left upper rear trigger. All other buttons are unused. + +2. Logitech Dual Action gamepad, Logitech Cordless Rumblepad 2: +The digital pad maps to the N64 d-pad. The left analog stick maps to the N64 analog stick. +The right analog stick maps to the C-buttons, and the buttons 2 and 1 map to A and B. +Button 4 is the Z trigger, and the top shoulder buttons map to the left and right N64 triggers. +Button 10 is the start button. +The bottom shoulder buttons select the memory pack or rumble pak. + +3. Logitech Logitech(R) Precision(TM) Gamepad, Gravis GamePad Pro USB +I came up with what I see as one of the few decent configurations (SSB aside) since it allows access to everything but the dpad. +A is L1, B is R1, Z is L2, R is R2, L is select. C buttons are the four buttons, and the dpad acts as the joystick. Not the most orthodox, but it works well. + +4. Microsoft X-Box 360 pad: +C button U (up) and C button R (right) are assigned to the Y and B buttons. +All 4 C buttons are assigned to the U and V axis (including the already configured up and right C buttons). +The Z button has been assigned to the left trigger and switching the rumble on and off can be done with the right trigger. +Because there are no other buttons left I decided to use the button click behavior of the left joystick to switch Mempak on and off. + +5. MP-8866 Dual USB Joypad: +This is a USB adapter for PlayStation controllers (2). + +D-Pad: hat(0) +L-Stick: x:0, y:1 +R-Stick: x:2, y:3 +Triangle: button(0) +Circle: button(1) +Cross: button(2) +Square: button(3) +L2: button(4) +R2: button(5) +L1: button(6) +R1: button(7) +Start: button(8) +Select: button(9) +L3: button(10) +R3: button(11) +Note: This is when analog mode is selected. If analog is off then D-Pad becomes axes 0/1 and both sticks are disabled (including L3/R3). + +6. N64 controller: +All controls are mapped to their proper place on the N64 controller with an Adaptoid or custom hardware with Gamecon driver. +Rumble and Memory packs can be selected with the 'r' and 'm' keys, respectively. + +7. Playstation 3 Controller: +Left analog stick - analog stick +Right analog stick - C-pad +D-Pad - D-Pad +Cross - A +Square - B +L1 / R1 - L / R +L2 - Z +Start - Start + +8. SAITEK P880: +The gamepad doesnt have enough keys to real assign all buttons. The second +analog stick can be used as button by pushing him insight. + +General Configuration: +Digital Pad was used as N64 digital pad, First analog stick was used as N64 +Analog stick. The red button was used as N64 Start button. L and R was used +for N64 L and R. Second analog stick axes was used for N64 C buttons and +second "analog stick button" was used for C-down. The first column of keys was +used for A and B and the second and third row was used for C-Buttons - except +for the Button next to the A button which would be C-Down but got the Z +button. + +9. Xbox Gamepad (userspace driver) +I created an Input Config for a Xbox 360 controller running with +xboxdrv on a Linux system (http://pingus.seul.org/~grumbel/xboxdrv/). + +Z = Left shoulder button +L = Left shoulder trigger +A = A Button +B = X Button + +everything else should be obvious. + +Unfortunately, you will also have to make some configuration to +xboxdrv to make this work properly. xboxdrv has to be started with the +following config file. The "-as-button" options make sure that the D- +Pad and Trigger are emulated as buttons and the deadzone options make +the C buttons work much better. +The guide=KEY_ESC allows you to quit the emulator by pressing the +guide key on the controller. This is obviously just nice-to-have and +not actually neccessary for the config to work. + +[xboxdrv] +silent=true +trigger-as-button=true +dpad-as-button=true + +[ui-buttonmap] +guide=KEY_ESC + +[axismap] +x2^deadzone:27000 +y2^deadzone:27000 + +10. Saitek Cyborg V.3 Rumble Pad (aka Saitek PS2700) +Honestly, it's one of the best pads that I've used in a long time, so thought I'd contribute this quick config. Basically, Dpad and Analog sticks are unchanged, C-buttons are mapped to the right analog stick, L-R triggers are L1 and R1, Z is mapped to R2, A + B are mapped to X and Square, respectively, start is mapped to the Home button, and Triangle, Square, L2, Start, Select, and the Analog triggers are unused, since it's not intuitive to use them for what's left. + +11. Default Keyboard interface: +Analog Pad is "Arrow Keys" +C Up/Left/Down/Right are "I", "J", "K", "L" +DPad Up/Left/Down/Right are "W", "A", "S", "D" +Z trig is "z" key +L and R trigs are "x" and "c" +Start is "Enter" ("Return") +A is "left shift" +B is "left control" +Select Mempack = "," +Select Rumblepack = "." + + diff --git a/libmupen64plus/mupen64plus-input-sdl/RELEASE b/libmupen64plus/mupen64plus-input-sdl/RELEASE new file mode 100644 index 0000000000..5fa901174f --- /dev/null +++ b/libmupen64plus/mupen64plus-input-sdl/RELEASE @@ -0,0 +1,146 @@ +SDL Input plugin for Mupen64Plus +-------------------------------- + +Mupen64Plus-input-sdl v1.99.5 - March 10, 2012 +------------------------------------------------- + - Improved input setup behavior (auto-config) to make some use cases more friendly + - Updated input plugin for new Mupen64plus 2.0 API versioning scheme + - Added version number to SDL Input plugin parameters + - Add new parameter for mouse sensitivity, handle mouse movement differently so mouse is easier to use as controller + - New auto-configuration for controllers: + - raphnet technologies GC/N64 usb converter + - Logitech Chillstream Controller + - Jess Tech Colour Rumble + - Xbox 360 linux userspace driver + - Generic X-Box pad + - Saitek P2900 Wireless Pad + - Jess Tech USB 4-Axis 12-Button Gamepad + - bugfix: #392 - when switching between rumble pak and memory pak, simulate removing the pack, waiting 1 second, then inserting the new one + - bugfix: #424 - problem with USB devices supporting multiple controllers per device + - bugfix: #409 - PS3 controller not auto-detected in Gentoo when connected via bluetooth + - bugfix: correctly handle USB devices with multiple game pads, from Peter Helbing + - makefile fixes and improvements + +Mupen64Plus-input-sdl v1.99.4 - November 22, 2010 +------------------------------------------------- + - Bugfix: Do configuration during PluginStart(), so GUI will see defaults (auto-configured) the first time it is run + - Move axis value reducers to right shift and right ctrl, to avoid conflict with A/B buttons + - New feature: extra deadzone parameter in axis() config parameter clause when mapping an analog joystick axis to an N64 button + - many new joystick auto-configurations + - makefile fixes and improvements + +Mupen64Plus-input-sdl v1.99.3 - February 13, 2010 +------------------------------------------------- + - New feature: auto-configuration uses an .ini file instead of hard-coding the controllers in the source code + - New controller auto-configurations: + - Original X-Box (and compatible clones) + - HuiJia USB GamePad + - USB Human(2p) Interface Device + - sync with core<-->plugin API change for RomOpen() + - Bugfix: controller pak was fixed at startup, switching b/w mempak and rumblepak did not work + - Bugfix: Xbox 360 and PS3 controllers need slightly different names under OSX + - Makefile improvements: + - plugin must be linked with CC instead of LD because 'sdl-config --libs' can give "-Wl,-rpath" + - added OS type GNU/kFreeBSD + +Mupen64Plus-input-sdl v1.99.2 - January 6, 2010 +------------------------------------------------- + - new feature: added MSVC8 project file, minor code refactoring for VC compatibility + - added auto-configuration for: + - Xbox 360 Wireless Receiver + - PS3 controller + - Jess Tech Dual Analog Pad + - Makefile improvements: + - throw error if OS/CPU not supported + - use DESTDIR in install/uninstall paths + - Allow user-specified CC/CXX/LD paths + +Mupen64Plus-input-sdl v1.99.1 - December 14, 2009 +------------------------------------------------- + - New feature: Joystick/Keyboard auto-configuration + - New feature: deadzone and peak analog joystick values are now configurable + - Converted to new Mupen64Plus 2.0 API + - Refactored build system to separate source and object files + - Major code cleanup: mouse movement and analog axis code was terrible, removed non-standard data types + - Improved debug messages + - bugfix: mapping the X/Y analog sticks to keypresses didnt work + - bugfix: LeftCtrl-LeftAlt key command when mouse is enabled to now toggles between grabbing and releasing the mouse pointer + +Mupen64Plus Pre-2.0 +------------------- + - numerous fixes and enhancements were made to this code during the mupen64plus project before v2.0 + +Original Blight Changelog +------------------------- + +0.0.10: + - when the keyboard is used to control an axis left shift and left control can be + pressed to change the axis movement. shift reduces the movement by 25%, control + reduces it by 50%, control and shift together reduce the movement by 75% + - when the mouse is used left ctrl + left alt can be used to release the mouse, + clicking into the window will grab the mouse again. + +0.0.9: + - import new version of SDL_tff (2.0.7) + - when the keyboard is used to control an axis left shift can be pressed to change + the axis movement to 25% of the original value + +0.0.8-b: + - fixed bug which didn't put analog axis back into default position when a key + which was assigned to it was pressed and released again + +0.0.8: + - fixed a stupid bug which disabled analog axis + +0.0.7-b: + - sdl config dialog: input event queue is flushed before a + button/whatever is assigned + +0.0.7: mouse support! + - mouse support (x and y axis automatically mapped to analog stick, + mouse buttons mapable onto n64 buttons) + +0.0.6: + - keyboard and gamepad can be used at the same time (the keyboard will work always, + even if you choose another device. if you want to use only the keyboard select + keyboard as device + +0.0.5: + - sdl about dialog + - fixed config routine (incorrectly read X- axis) + - fixed small sdl config dialog drawing bug + - corrected config dialog c button labels + +0.0.4: joystick hat support + - fixed a segfault when the rom was closed + - less axis sensibility when assigning a new mapping (changed from 10 to 50 percent) + - less sensibility for axis mapped to buttons (changed from 10 to 20 percent) + - it's possible to clear assignments and cancel an assignment + - joystick hat support (mapable to axis and buttons) + - fixed some bugs in the input reading function + - fixed all compiler warnings + +0.0.3: + - no more need for the SDL_image library + - no longer link against gtk library + +0.0.2-2: + - fixed a bug which didn't allow to assign anything to a pad button + +0.0.2-1: *BROKEN* + - help for the SDL gui + +0.0.2: new SDL config dialog! *BROKEN* + - fixed a bug where it wouldn't open the joystick device if you change the controller + - sdl config dialog + - some other lil' fixes + +0.0.1: made some small fixes + - now it's possible to map an axis (i.e. X Axis +) to a button (i.e. DPAD_UP) + - configuration is saved and displayed for all devices + - changed the config dialog a bit (bigger text entries, bigger device combo) + - new config file format + +0.0.1b: initial version + - should work :-) + diff --git a/libmupen64plus/mupen64plus-input-sdl/data/InputAutoCfg.ini b/libmupen64plus/mupen64plus-input-sdl/data/InputAutoCfg.ini new file mode 100644 index 0000000000..a33a64cf6d --- /dev/null +++ b/libmupen64plus/mupen64plus-input-sdl/data/InputAutoCfg.ini @@ -0,0 +1,969 @@ +; InputAutoCfg.ini for Mupen64Plus SDL Input plugin + +[Keyboard] +plugged = True +plugin = 2 +mouse = False +DPad R = key(100) +DPad L = key(97) +DPad D = key(115) +DPad U = key(119) +Start = key(13) +Z Trig = key(122) +B Button = key(306) +A Button = key(304) +C Button R = key(108) +C Button L = key(106) +C Button D = key(107) +C Button U = key(105) +R Trig = key(99) +L Trig = key(120) +Mempak switch = key(44) +Rumblepak switch = key(46) +X Axis = key(276,275) +Y Axis = key(273,274) + +; Boom Smart Joy Converter +[HID 6666:0667] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = button(13) +DPad L = button(15) +DPad D = button(14) +DPad U = button(12) +Start = button(11) +Z Trig = button(10) +B Button = button(4) +A Button = button(5) +C Button R = button(1) +C Button L = button(3) +C Button D = button(2) +C Button U = button(0) +R Trig = button(7) +L Trig = button(6) +Mempak switch = key(109) +Rumblepak switch = key(114) +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +[Cyborg V.3 Rumble Pad] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = axis(4+) +DPad L = axis(4-) +DPad D = axis(5+) +DPad U = axis(5-) +Start = button(12) +Z Trig = button(7) +B Button = button(0) +A Button = button(1) +C Button R = button(8) axis(2+) +C Button L = button(3) axis(2-) +C Button D = button(2) axis(3+) +C Button U = button(9) axis(3-) +R Trig = button(5) +L Trig = button(4) +Mempak switch = +Rumblepak switch = +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +[DragonRise Inc. Generic USB Joystick] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = key(275) axis(0+) +DPad L = key(276) axis(0-) +DPad D = key(274) axis(1+) +DPad U = key(273) axis(1-) +Start = button(9) +Z Trig = button(4) +B Button = button(3) +A Button = button(2) +C Button R = button(7) axis(3+) +C Button L = button(6) axis(3-) +C Button D = button(1) axis(4+) +C Button U = button(0) axis(4-) +R Trig = button(5) +L Trig = button(4) +Mempak switch = +Rumblepak switch = +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +; FuSa is a homebrew program which allows a PSP to be used as a gamepad +[FuSa FuSa GamePad] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = +DPad L = +DPad D = +DPad U = +Start = button(7) +Z Trig = button(4) +B Button = button(2) +A Button = button(0) +C Button R = hat(0 Right) +C Button L = hat(0 Left) +C Button D = hat(0 Down) +C Button U = hat(0 Up) +R Trig = button(5) +L Trig = button(3) +Mempak switch = +Rumblepak switch = +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +[Gasia Co.,Ltd PS(R) Gamepad] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = key(275) axis(0+) hat(0 Right) +DPad L = key(276) axis(0-) +DPad D = key(274) axis(1+) hat(0 Down) +DPad U = key(273) axis(1-) +Start = button(9) +Z Trig = button(6) +B Button = button(3) +A Button = button(2) +C Button R = axis(2+) +C Button L = axis(2-) +C Button D = axis(3+) +C Button U = axis(3-) +R Trig = button(5) +L Trig = button(4) +Mempak switch = button(1) +Rumblepak switch = button(0) +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +; raphnet technologies USB converter (http://www.raphnet-tech.com/) +[GC/N64_USB] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = button(13) +DPad L = button(12) +DPad D = button(11) +DPad U = button(10) +Start = button(3) +Z Trig = button(2) +B Button = button(1) +A Button = button(0) +C Button R = button(7) +C Button L = button(6) +C Button D = button(5) +C Button U = button(4) +R Trig = button(9) +L Trig = button(8) +Mempak switch = +Rumblepak switch = +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +[GreenAsia Inc. USB Joystick] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = hat(0 Right) +DPad L = hat(0 Left) +DPad D = hat(0 Down) +DPad U = hat(0 Up) +Start = button(9) +Z Trig = button(1) +B Button = button(3) +A Button = button(2) +C Button R = axis(3+) +C Button L = axis(3-) +C Button D = axis(2+) +C Button U = axis(2-) +R Trig = button(7) +L Trig = button(6) +Mempak switch = +Rumblepak switch = +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +[Jess Tech Dual Analog Pad] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = hat(0 Right) +DPad L = hat(0 Left) +DPad D = hat(0 Down) +DPad U = hat(0 Up) +Start = button(9) +Z Trig = button(7) +B Button = button(0) +A Button = button(2) +C Button R = axis(3+) +C Button L = axis(3-) +C Button D = axis(2+) +C Button U = axis(2-) +R Trig = button(6) +L Trig = button(4) +Mempak switch = +Rumblepak switch = +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +[Jess Tech Colour Rumble Pad] +plugged = True +plugin = 1 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = hat(0 Right) +DPad L = hat(0 Left) +DPad D = hat(0 Down) +DPad U = hat(0 Up) +Start = button(9) +Z Trig = button(4) +B Button = button(0) +A Button = button(2) +C Button R = axis(3+) +C Button L = axis(3-) +C Button D = axis(2+) +C Button U = axis(2-) +R Trig = button(7) +L Trig = button(5) +Mempak switch = +Rumblepak switch = +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +[Jess Tech USB 4-Axis 12-Button Gamepad] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = hat(0 Right) +DPad L = hat(0 Left) +DPad D = hat(0 Down) +DPad U = hat(0 Up) +Start = button(4) +Z Trig = button(5) +B Button = button(8) +A Button = button(9) +C Button R = button(1) +C Button L = button(3) +C Button D = button(2) +C Button U = button(0) +R Trig = button(7) +L Trig = button(6) +Mempak switch = +Rumblepak switch = +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +; X-box controllers and compatible clones +[Logitech Chillstream Controller] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = hat(0 Right) +DPad L = hat(0 Left) +DPad D = hat(0 Down) +DPad U = hat(0 Up) +Start = button(7) +Z Trig = axis(2+) +B Button = button(2) +A Button = button(0) +C Button R = axis(3+) +C Button L = axis(3-) +C Button D = axis(4+) +C Button U = axis(4-) +R Trig = button(5) +L Trig = button(4) +Mempak switch = button(6) +Rumblepak switch = button(8) +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +[Logitech Cordless Rumblepad 2] +[Logitech Cordless RumblePad 2] +[Logitech RumblePad 2 USB] +[Logitech Dual Action] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = axis(4+) hat(0 Right) +DPad L = axis(4-) hat(0 Left) +DPad D = axis(5+) hat(0 Down) +DPad U = axis(5-) hat(0 Up) +Start = button(9) +Z Trig = button(6) +B Button = button(0) +A Button = button(1) +C Button R = axis(2+) +C Button L = axis(2-) +C Button D = axis(3+) +C Button U = axis(3-) +R Trig = button(5) +L Trig = button(4) +Mempak switch = button(8) +Rumblepak switch = button(7) +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +[Logitech Logitech(R) Precision(TM) Gamepad] +[Gravis GamePad Pro USB] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 100,100 +AnalogPeak = 32768,32768 +DPad R = axis(0+) +DPad L = axis(0-) +DPad D = axis(1+) +Dpad U = axis(1-) +Start = button(9) +Z Trig = button(6) +B Button = button(5) +A Button = button(4) +C Button R = button(2) +C Button L = button(0) +C Button D = button(1) +C Button U = button(3) +R Trig = button(7) +L Trig = button(8) +Mempack switch = +Rumblepak Switch = +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +[Logitech WingMan Action Pad] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = button(13) +DPad L = button(15) +DPad D = button(14) +DPad U = button(12) +Start = button(8) +Z Trig = button(6) +B Button = button(3) +A Button = button(0) +C Button R = button(2) +C Button L = button(4) +C Button D = button(1) +C Button U = button(5) +R Trig = button(7) +L Trig = +Mempak switch = +Rumblepak switch = +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +[Mega World USB Game Controllers] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = hat(0 Right) +DPad L = hat(0 Left) +DPad D = hat(0 Down) +DPad U = hat(0 Up) +Start = button(9) +Z Trig = button(7) +B Button = button(0) +A Button = button(2) +C Button R = axis(3+) +C Button L = axis(3-) +C Button D = axis(2+) +C Button U = axis(2-) +R Trig = button(6) +L Trig = button(4) +Mempak switch = +Rumblepak switch = +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +[MP-8866 Dual USB Joypad] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = hat(0 Right) +DPad L = hat(0 Left) +DPad D = hat(0 Down) +DPad U = hat(0 Up) +Start = button(8) +Z Trig = button(6) +B Button = button(3) +A Button = button(2) +C Button R = axis(2+) +C Button L = axis(2-) +C Button D = axis(3+) +C Button U = axis(3-) +R Trig = button(7) +L Trig = button(4) +Mempak switch = button(10) +Rumblepak switch = button(11) +Y Axis = axis(1-,1+) +X Axis = axis(0-,0+) + +[Microsoft X-Box 360 pad] +[Win32: Controller (XBOX 360 For Windows)] +[Win32: XBOX 360 For Windows (Controller)] +[Win32: XBOX 360 For Windows] +[Xbox 360 Wireless Receiver] +[OSX: Wireless 360 Controller] +[OSX: Controller] +[Linux: Xbox Gamepad (userspace driver)] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = hat(0 Right) +DPad L = hat(0 Left) +DPad D = hat(0 Down) +DPad U = hat(0 Up) +Start = button(7) +Z Trig = axis(2+) +B Button = button(2) +A Button = button(0) +C Button R = axis(4+) +C Button L = axis(4-) button(3) +C Button D = axis(3+) button(1) +C Button U = axis(3-) +R Trig = button(5) axis(2-) +L Trig = button(4) +Mempak switch = +Rumblepak switch = +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +[N64 controller] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = hat(0 Right) +DPad L = hat(0 Left) +DPad D = hat(0 Down) +DPad U = hat(0 Up) +Start = button(9) +Z Trig = button(0) +B Button = button(2) +A Button = button(1) +C Button R = button(4) +C Button L = button(5) +C Button D = button(3) +C Button U = button(6) +R Trig = button(8) +L Trig = button(7) +Mempak switch = key(109) +Rumblepak switch = key(114) +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +[PC Game Controller] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = hat(0 Right) +DPad L = hat(0 Left) +DPad D = hat(0 Down) +DPad U = hat(0 Up) +Start = button(9) +Z Trig = button(8) +B Button = button(4) +A Button = button(5) +C Button R = button(1) +C Button L = button(3) +C Button D = button(2) +C Button U = button(0) +R Trig = button(7) +L Trig = button(6) +Mempak switch = key(109) +Rumblepak switch = key(114) +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +[SAITEK P880] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = hat(0 Right) +DPad L = hat(0 Left) +DPad D = hat(0 Down) +DPad U = hat(0 Up) +Start = button(10) +Z Trig = button(3) +B Button = button(0) +A Button = button(2) +C Button R = button(5) axis(3+) +C Button L = button(1) axis(3-) +C Button D = button(9) axis(2+) +C Button U = button(4) axis(2-) +R Trig = button(7) +L Trig = button(6) +Mempak switch = +Rumblepak switch = +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +[Saitek P990 Dual Analog Pad] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = hat(0 Right) +DPad L = hat(0 Left) +DPad D = hat(0 Down) +DPad U = hat(0 Up) +Start = button(5) +Z Trig = button(4) +B Button = button(0) +A Button = button(1) +C Button R = button(8) axis(3+) +C Button L = button(3) axis(3-) +C Button D = button(2) axis(2+) +C Button U = button(9) axis(2-) +R Trig = button(7) +L Trig = button(6) +Mempak switch = button(11) +Rumblepak switch = axis(10+) +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +[Saitek P2900 Wireless Pad] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = axis(4+) +DPad L = axis(4-) +DPad D = axis(5+) +DPad U = axis(5-) +Start = button(6) +Z Trig = button(7) +B Button = button(0) +A Button = button(1) +C Button R = button(8) axis(3+) +C Button L = button(3) axis(3-) +C Button D = button(2) axis(2+) +C Button U = button(9) axis(2-) +R Trig = button(5) +L Trig = button(4) +Mempak switch = button(11) +Rumblepak switch = axis(10+) +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +[Thrustmaster Dual Trigger 3-in-1] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = hat(0 Right) +DPad L = hat(0 Left) +DPad D = hat(0 Down) +DPad U = hat(0 Up) +Start = button(9) +Z Trig = button(3) +B Button = button(0) +A Button = button(1) +C Button R = axis(2+) +C Button L = axis(2-) +C Button D = axis(5+) +C Button U = axis(5-) +R Trig = button(5) +L Trig = button(4) +Mempak switch = button(6) +Rumblepak switch = button(7) +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +[THRUSTMASTER Firestorm Dual Power 2] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = hat(0 Right) +DPad L = hat(0 Left) +DPad D = hat(0 Down) +DPad U = hat(0 Up) +Start = button(5) +Z Trig = button(8) +B Button = button(1) +A Button = button(0) +C Button R = axis(2+) +C Button L = axis(2-) +C Button D = axis(3+) +C Button U = axis(3-) +R Trig = button(6) +L Trig = button(4) +Mempak switch = +Rumblepak switch = +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +[Twin USB Joystick] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = hat(0 Right) +DPad L = hat(0 Left) +DPad D = hat(0 Down) +DPad U = hat(0 Up) +Start = button(9) +Z Trig = button(4) +B Button = button(6) +A Button = button(7) +C Button R = button(1) +C Button L = button(3) +C Button D = button(2) +C Button U = button(0) +R Trig = button(5) +L Trig = button(11) +Mempak switch = +Rumblepak switch = +Y Axis = axis(1-,1+) +X Axis = axis(0-,0+) + +[PLAYSTATION(R)3 Controller] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = button(5) +DPad L = button(7) +DPad D = button(6) +DPad U = button(4) +Start = button(3) +Z Trig = button(8) +B Button = button(15) +A Button = button(14) +C Button R = axis(2+) +C Button L = axis(2-) +C Button D = axis(3+) +C Button U = axis(3-) +R Trig = button(11) +L Trig = button(10) +Mempak switch = +Rumblepak switch = +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +[WiseGroup.,Ltd TigerGame XBOX+PS2+GC Game Controller Adapter] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = button(9) +DPad L = button(8) +DPad D = button(10) +DPad U = button(11) +Start = button(7) +Z Trig = button(6) +B Button = button(1) +A Button = button(0) +C Button R = axis(2+) +C Button L = axis(2-) +C Button D = axis(3+) +C Button U = axis(3-) +R Trig = axis(4+) +L Trig = axis(5+) +Mempak switch = +Rumblepak switch = +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +[Wish Technologies Adaptoid] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = button(13) +DPad L = button(12) +DPad D = button(11) +DPad U = button(10) +Start = button(8) +Z Trig = button(9) +B Button = button(3) +A Button = button(0) +C Button R = button(2) +C Button L = button(4) +C Button D = button(1) +C Button U = button(5) +R Trig = button(7) +L Trig = button(6) +Mempak switch = +Rumblepak switch = +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +; X-box controllers and compatible clones +[Microsoft X-Box pad v1 (US)] +[Microsoft X-Box pad v2 (US)] +[Microsoft X-Box pad (Japan)] +[Microsoft Xbox Controller S] +[Thrustmaster, Inc. Controller] +[Logitech Xbox Cordless Controller] +[Logitech Compact Controller for Xbox] +[Mad Catz Controller (unverified)] +[InterAct 'PowerPad Pro' X-Box pad (Germany)] +[Mad Catz Control Pad] +[Mad Catz LumiCON] +[Mad Catz Control Pad Pro] +[Mad Catz MicroCON] +[Mad Catz Lynx Wireless Controller] +[Zeroplus Xbox Controller] +[Pelican Eclipse PL-2023] +[Zeroplus Xbox Controller] +[Radica Gamester Controller] +[Radica Games Jtech Controller] +[Logic3 Freebird wireless Controller] +[Eclipse wireless Controller] +[Edge wireless Controller] +[SmartJoy Frag Xpad/PS2 adaptor] +[Joytech Advanced Controller] +[BigBen XBMiniPad Controller] +[Joytech Wireless Advanced Controller] +[Chinese-made Xbox Controller] +[Generic X-Box pad] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = hat(0 Right) +DPad L = hat(0 Left) +DPad D = hat(0 Down) +DPad U = hat(0 Up) +Start = button(6) +Z Trig = button(7) +B Button = button(1) +A Button = button(0) +C Button R = axis(3+) +C Button L = axis(3-) +C Button D = axis(4+) +C Button U = axis(4-) +R Trig = axis(5+) +L Trig = axis(2+) +Mempak switch = button(5) +Rumblepak switch = button(2) +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) + +[OSX: USB GamePad] +; this is a 2-port USB device. The Right port is controller #1, the Left port is #2 +; this is the "MayFlash" adapter, aka HuiJia. The OSX driver seems to have a +; different button mapping +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 2500,2500 +AnalogPeak = 20000,20000 +DPad R = button(13) +DPad L = button(15) +DPad D = button(14) +DPad U = button(12) +Start = button(9) +Z Trig = button(8) +B Button = button(2) +A Button = button(1) +C Button R = axis(1-) +C Button L = axis(1+) +C Button D = axis(0+) +C Button U = axis(0-) +R Trig = button(7) +L Trig = button(6) +Mempak switch = key(109) +Rumblepak switch = key(114) +X Axis = axis(2-,2+) +Y Axis = axis(3-,3+) +__NextController: +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 2500,2500 +AnalogPeak = 20000,20000 +DPad R = button(29) +DPad L = button(31) +DPad D = button(30) +DPad U = button(28) +Start = button(25) +Z Trig = button(24) +B Button = button(18) +A Button = button(17) +C Button R = axis(5-) +C Button L = axis(5+) +C Button D = axis(4+) +C Button U = axis(4-) +R Trig = button(23) +L Trig = button(22) +Mempak switch = key(109) +Rumblepak switch = key(114) +X Axis = axis(6-,6+) +Y Axis = axis(7-,7+) + +[Linux: HuiJia USB GamePad] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 100,100 +AnalogPeak = 20000,20000 +DPad R = button(13) +DPad L = button(15) +DPad D = button(14) +DPad U = button(12) +Start = button(9) +Z Trig = button(8) +B Button = button(2) +A Button = button(1) +C Button R = axis(3-) +C Button L = axis(3+) +C Button D = axis(2+) +C Button U = axis(2-) +R Trig = button(7) +L Trig = button(6) +Mempak switch = key(109) +Rumblepak switch = key(114) +X Axis = axis(0-,0+) +Y Axis = axis(1-,1+) +__NextController: +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 100,100 +AnalogPeak = 20000,20000 +DPad R = button(29) +DPad L = button(31) +DPad D = button(30) +DPad U = button(28) +Start = button(25) +Z Trig = button(24) +B Button = button(18) +A Button = button(17) +C Button R = axis(7-) +C Button L = axis(7+) +C Button D = axis(6+) +C Button U = axis(6-) +R Trig = button(23) +L Trig = button(22) +Mempak switch = key(109) +Rumblepak switch = key(114) +X Axis = axis(4-,4+) +Y Axis = axis(5-,5+) + +; Mayflah N64 Controller Adapter (for PC USB) - With two N64 gamepads connected +; this is a 2-port USB device. The Right port is controller #1, the Left port is #2 +[Win32: USB GamePad] +plugged = True +plugin = 2 +mouse = False +AnalogDeadzone = 4096,4096 +AnalogPeak = 32768,32768 +DPad R = hat(0 Right) +DPad L = hat(0 Left) +DPad D = hat(0 Down) +DPad U = hat(0 Up) +Start = button(9) +Z Trig = button(8) +B Button = button(2) +A Button = button(1) +C Button R = axis(3-) +C Button L = axis(3+) +C Button D = axis(2+) +C Button U = axis(2-) +R Trig = button(7) +L Trig = button(6) +Mempak switch = key(109) +Rumblepak switch = key(114) +Y Axis = axis(1-,1+) +X Axis = axis(0-,0+) + +; Asikgame - Super Dual Box (with two PS2 gamepads connected) +; this is a 2-port USB device. The Right port is controller #1, the Left port is #2 +[USB Human(2p) Interface Device] +plugged = True +plugin = 2 +mouse = False +DPad R= axis(2+) +DPad L= axis(2-) +DPad D= axis(5+) +DPad U= axis(5-) +Start= button(0) +Z Trig= button(1) +B Button= button(3) +A Button= button(2) +C Button R= hat(0 Right) +C Button L= hat(0 Left) +C Button D= hat(0 Down) +C Button U= hat(0 Up) +R Trig= button(5) +L Trig= button(4) +Mempak switch= button(9) +Rumblepak switch= button(8) +Y Axis= axis(1-,1+) +X Axis= axis(0-,0+) +__NextController: +plugged = True +plugin = 2 +mouse = False +DPad R= axis(6+) +DPad L= axis(6-) +DPad D= axis(7+) +DPad U= axis(7-) +Start= button(12) +Z Trig= button(13) +B Button= button(15) +A Button= button(14) +C Button R= hat(1 Right) +C Button L= hat(1 Left) +C Button D= hat(1 Down) +C Button U= hat(1 Up) +R Trig= button(17) +L Trig= button(16) +Mempak switch= button(21) +Rumblepak switch= button(20) +Y Axis= axis(4-,4+) +X Axis= axis(3-,3+) + + diff --git a/libmupen64plus/mupen64plus-input-sdl/projects/msvc11/mupen64plus-input-sdl.vcxproj b/libmupen64plus/mupen64plus-input-sdl/projects/msvc11/mupen64plus-input-sdl.vcxproj new file mode 100644 index 0000000000..f317fb58ea --- /dev/null +++ b/libmupen64plus/mupen64plus-input-sdl/projects/msvc11/mupen64plus-input-sdl.vcxproj @@ -0,0 +1,110 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {7F3178D0-0E2E-471B-9160-69F0354F9DE9} + mupen64plusinputsdl + Win32Proj + + + + DynamicLibrary + MultiByte + true + + + DynamicLibrary + MultiByte + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + true + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + ..\..\..\mupen64plus-win32-deps\SDL-1.2.14\lib\SDL.lib;%(AdditionalDependencies) + true + Windows + MachineX86 + + + + + ..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + Default + + + ..\..\..\mupen64plus-win32-deps\SDL-1.2.14\lib\SDL.lib;%(AdditionalDependencies) + true + Windows + true + true + MachineX86 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libmupen64plus/mupen64plus-input-sdl/projects/msvc8/mupen64plus-input-sdl.vcproj b/libmupen64plus/mupen64plus-input-sdl/projects/msvc8/mupen64plus-input-sdl.vcproj new file mode 100644 index 0000000000..122bcb182c --- /dev/null +++ b/libmupen64plus/mupen64plus-input-sdl/projects/msvc8/mupen64plus-input-sdl.vcproj @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libmupen64plus/mupen64plus-input-sdl/projects/unix/Makefile b/libmupen64plus/mupen64plus-input-sdl/projects/unix/Makefile new file mode 100644 index 0000000000..e10e58f4a0 --- /dev/null +++ b/libmupen64plus/mupen64plus-input-sdl/projects/unix/Makefile @@ -0,0 +1,336 @@ +#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# * Mupen64plus-input-sdl - Makefile * +# * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * +# * Copyright (C) 2007-2009 Richard Goedeken * +# * * +# * 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. * +# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +# Makefile for SDL Input plugin in Mupen64plus + +# detect operating system +UNAME ?= $(shell uname -s) +OS := NONE +ifeq ("$(UNAME)","Linux") + OS = LINUX + SO_EXTENSION = so + SHARED = -shared +endif +ifeq ("$(UNAME)","linux") + OS = LINUX + SO_EXTENSION = so + SHARED = -shared +endif +ifneq ("$(filter GNU hurd,$(UNAME))","") + OS = LINUX + SO_EXTENSION = so + SHARED = -shared +endif +ifeq ("$(UNAME)","Darwin") + OS = OSX + SO_EXTENSION = dylib + SHARED = -bundle +endif +ifeq ("$(UNAME)","FreeBSD") + OS = FREEBSD + SO_EXTENSION = so + SHARED = -shared +endif +ifeq ("$(UNAME)","OpenBSD") + OS = FREEBSD + SO_EXTENSION = so + SHARED = -shared + $(warning OS type "$(UNAME)" not officially supported.') +endif +ifneq ("$(filter GNU/kFreeBSD kfreebsd,$(UNAME))","") + OS = LINUX + SO_EXTENSION = so + SHARED = -shared +endif +ifeq ("$(patsubst MINGW%,MINGW,$(UNAME))","MINGW") + OS = MINGW + SO_EXTENSION = dll + SHARED = -shared + PIC = 0 +endif +ifeq ("$(OS)","NONE") + $(error OS type "$(UNAME)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') +endif + +# detect system architecture +HOST_CPU ?= $(shell uname -m) +NO_ASM ?= 1 +CPU := NONE +ifneq ("$(filter x86_64 amd64,$(HOST_CPU))","") + CPU := X86 + ifeq ("$(BITS)", "32") + ARCH_DETECTED := 64BITS_32 + PIC ?= 0 + else + ARCH_DETECTED := 64BITS + PIC ?= 1 + endif +endif +ifneq ("$(filter pentium i%86,$(HOST_CPU))","") + CPU := X86 + ARCH_DETECTED := 32BITS + PIC ?= 0 +endif +ifneq ("$(filter ppc macppc socppc powerpc,$(HOST_CPU))","") + CPU := PPC + ARCH_DETECTED := 32BITS + BIG_ENDIAN := 1 + PIC ?= 1 + $(warning Architecture "$(HOST_CPU)" not officially supported.') +endif +ifneq ("$(filter ppc64 powerpc64,$(HOST_CPU))","") + CPU := PPC + ARCH_DETECTED := 64BITS + BIG_ENDIAN := 1 + PIC ?= 1 + $(warning Architecture "$(HOST_CPU)" not officially supported.') +endif +ifneq ("$(filter arm%,$(HOST_CPU))","") + ifeq ("$(filter arm%b,$(HOST_CPU))","") + CPU := ARM + ARCH_DETECTED := 32BITS + PIC ?= 1 + $(warning Architecture "$(HOST_CPU)" not officially supported.') + endif +endif +ifeq ("$(CPU)","NONE") + $(error CPU type "$(HOST_CPU)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') +endif + +# base CFLAGS, LDLIBS, and LDFLAGS +OPTFLAGS ?= -O3 +WARNFLAGS ?= -Wall +CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src +LDFLAGS += $(SHARED) + +# default configuration programs +SDL_CONFIG = $(CROSS_COMPILE)sdl-config + +# Since we are building a shared library, we must compile with -fPIC on some architectures +# On 32-bit x86 systems we do not want to use -fPIC because we don't have to and it has a big performance penalty on this arch +ifeq ($(PIC), 1) + CFLAGS += -fPIC + LDFLAGS += -fPIC +else + CFLAGS += -fno-PIC + LDFLAGS += -fno-PIC +endif + +ifeq ($(BIG_ENDIAN), 1) + CFLAGS += -DM64P_BIG_ENDIAN +endif + +# tweak flags for 32-bit build on 64-bit system +ifeq ($(ARCH_DETECTED), 64BITS_32) + CFLAGS += -m32 + LDFLAGS += -m32 -Wl,-m,elf_i386 +endif + +# set special flags per-system +ifeq ($(OS), FREEBSD) + ifeq ($(ARCH_DETECTED), 64BITS_32) + $(error Do not use the BITS=32 option with FreeBSD, use -m32 and -m elf_i386) + endif +endif +ifeq ($(OS), LINUX) + LDLIBS += -ldl +endif +ifeq ($(OS), OSX) + # Select the proper SDK + # Also, SDKs are stored in a different location since XCode 4.3 + OSX_SDK ?= $(shell sw_vers -productVersion | cut -f1 -f2 -d .) + OSX_XCODEMAJ = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f1 -d .) + OSX_XCODEMIN = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f2 -d .) + OSX_XCODEGE43 = $(shell echo "`expr $(OSX_XCODEMAJ) \>= 4``expr $(OSX_XCODEMIN) \>= 3`") + ifeq ($(OSX_XCODEGE43), 11) + OSX_SYSROOT := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs + else + OSX_SYSROOT := /Developer/SDKs + endif + + ifeq ($(CPU), X86) + ifeq ($(ARCH_DETECTED), 64BITS) + CFLAGS += -arch x86_64 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk + LDLIBS += -ldl + else + CFLAGS += -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk + LDFLAGS += -arch i686 + LDLIBS += -ldl -read_only_relocs suppress + endif + endif +endif + +# test for presence of SDL +ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),) + $(error No SDL development libraries found!) +endif +CFLAGS += $(shell $(SDL_CONFIG) --cflags) +LDLIBS += $(shell $(SDL_CONFIG) --libs) + +# set mupen64plus core API header path +ifneq ("$(APIDIR)","") + CFLAGS += "-I$(APIDIR)" +else + TRYDIR = ../../../mupen64plus-core/src/api + ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") + CFLAGS += -I$(TRYDIR) + else + TRYDIR = /usr/local/include/mupen64plus + ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") + CFLAGS += -I$(TRYDIR) + else + TRYDIR = /usr/include/mupen64plus + ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") + CFLAGS += -I$(TRYDIR) + else + $(error Mupen64Plus API header files not found! Use makefile parameter APIDIR to force a location.) + endif + endif + endif +endif + +# reduced compile output when running make without V=1 +ifneq ($(findstring $(MAKEFLAGS),s),s) +ifndef V + Q_CC = @echo ' CC '$@; + Q_LD = @echo ' LD '$@; +endif +endif + +# set base program pointers and flags +CC = $(CROSS_COMPILE)gcc +CXX = $(CROSS_COMPILE)g++ +RM ?= rm -f +INSTALL ?= install +MKDIR ?= mkdir -p +COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c +LINK.o = $(Q_LD)$(CC) $(LDFLAGS) $(TARGET_ARCH) + +# set special flags for given Makefile parameters +ifeq ($(DEBUG),1) + CFLAGS += -g + INSTALL_STRIP_FLAG ?= +else + ifneq ($(OS),OSX) + INSTALL_STRIP_FLAG ?= -s + endif +endif +ifeq ($(PLUGINDBG), 1) + CFLAGS += -D_DEBUG +endif + +# set installation options +ifeq ($(PREFIX),) + PREFIX := /usr/local +endif +ifeq ($(SHAREDIR),) + SHAREDIR := $(PREFIX)/share/mupen64plus +endif +ifeq ($(LIBDIR),) + LIBDIR := $(PREFIX)/lib +endif +ifeq ($(PLUGINDIR),) + PLUGINDIR := $(LIBDIR)/mupen64plus +endif + +SRCDIR = ../../src +OBJDIR = _obj$(POSTFIX) + +# list of source files to compile +SOURCE = \ + $(SRCDIR)/plugin.c \ + $(SRCDIR)/autoconfig.c \ + $(SRCDIR)/config.c + +ifeq ($(OS),MINGW) +SOURCE += $(SRCDIR)/osal_dynamiclib_win32.c +else +SOURCE += $(SRCDIR)/osal_dynamiclib_unix.c +endif + +# generate a list of object files build, make a temporary directory for them +OBJECTS := $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(filter %.c, $(SOURCE))) +OBJDIRS = $(dir $(OBJECTS)) +$(shell $(MKDIR) $(OBJDIRS)) + +# build targets +TARGET = mupen64plus-input-sdl$(POSTFIX).$(SO_EXTENSION) + +targets: + @echo "Mupen64Plus-input-sdl makefile. " + @echo " Targets:" + @echo " all == Build Mupen64Plus SDL input plugin" + @echo " clean == remove object files" + @echo " rebuild == clean and re-build all" + @echo " install == Install Mupen64Plus SDL input plugin" + @echo " uninstall == Uninstall Mupen64Plus SDL input plugin" + @echo " Options:" + @echo " BITS=32 == build 32-bit binaries on 64-bit machine" + @echo " APIDIR=path == path to find Mupen64Plus Core headers" + @echo " OPTFLAGS=flag == compiler optimization (default: -O3)" + @echo " WARNFLAGS=flag == compiler warning levels (default: -Wall)" + @echo " PIC=(1|0) == Force enable/disable of position independent code" + @echo " POSTFIX=name == String added to the name of the the build (default: '')" + @echo " Install Options:" + @echo " PREFIX=path == install/uninstall prefix (default: /usr/local)" + @echo " SHAREDIR=path == path to install shared data files (default: PREFIX/share/mupen64plus)" + @echo " LIBDIR=path == library prefix (default: PREFIX/lib)" + @echo " PLUGINDIR=path == path to install plugin libraries (default: LIBDIR/mupen64plus)" + @echo " DESTDIR=path == path to prepend to all installation paths (only for packagers)" + @echo " Debugging Options:" + @echo " DEBUG=1 == add debugging symbols" + @echo " PLUGINDBG=1 == print extra debugging information while running" + @echo " LTO=1 == enable experimental build with link-time optimization" + @echo " V=1 == show verbose compiler output" + +all: $(TARGET) + +install: $(TARGET) + $(INSTALL) -d "$(DESTDIR)$(PLUGINDIR)" + $(INSTALL) -m 0644 $(INSTALL_STRIP_FLAG) $(TARGET) "$(DESTDIR)$(PLUGINDIR)" + $(INSTALL) -d "$(DESTDIR)$(SHAREDIR)" + $(INSTALL) -m 0644 "../../data/InputAutoCfg.ini" "$(DESTDIR)$(SHAREDIR)" + +uninstall: + $(RM) "$(DESTDIR)$(PLUGINDIR)/$(TARGET)" + $(RM) "$(DESTDIR)$(SHAREDIR)/InputAutoCfg.ini" + +clean: + $(RM) -r $(OBJDIR) $(TARGET) + +rebuild: clean all + +# build dependency files +CFLAGS += -MD +-include $(OBJECTS:.o=.d) + +ifeq ($(LTO), 1) + CFLAGS += -flto + LDFLAGS += -fuse-linker-plugin $(CFLAGS) +endif + +# standard build rules +$(OBJDIR)/%.o: $(SRCDIR)/%.c + $(COMPILE.c) -o $@ $< + +$(TARGET): $(OBJECTS) + $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@ + +.PHONY: all clean install uninstall targets diff --git a/libmupen64plus/mupen64plus-input-sdl/src/autoconfig.c b/libmupen64plus/mupen64plus-input-sdl/src/autoconfig.c new file mode 100644 index 0000000000..d3aa03e2ff --- /dev/null +++ b/libmupen64plus/mupen64plus-input-sdl/src/autoconfig.c @@ -0,0 +1,270 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-input-sdl - autoconfig.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "m64p_types.h" +#include "m64p_config.h" +#include "osal_preproc.h" +#include "autoconfig.h" +#include "plugin.h" + +/* local definitions */ +#define INI_FILE_NAME "InputAutoCfg.ini" + +/* local functions */ +static char *StripSpace(char *pIn) +{ + char *pEnd = pIn + strlen(pIn) - 1; + + while (*pIn == ' ' || *pIn == '\t' || *pIn == '\r' || *pIn == '\n') + pIn++; + + while (pIn <= pEnd && (*pEnd == ' ' || *pEnd == '\t' || *pEnd == '\r' || *pEnd == '\n')) + *pEnd-- = 0; + + return pIn; +} + +/* global functions */ +int auto_set_defaults(int iDeviceIdx, const char *joySDLName) +{ + FILE *pfIn; + m64p_handle pConfig = NULL; + const char *CfgFilePath = ConfigGetSharedDataFilepath(INI_FILE_NAME); + enum { E_NAME_SEARCH, E_NAME_FOUND, E_PARAM_READ } eParseState; + char *pchIni, *pchNextLine, *pchCurLine; + long iniLength; + int ControllersFound = 0; + + /* if we couldn't get a name (no joystick plugged in to given port), then return with a failure */ + if (joySDLName == NULL) + return 0; + /* if we couldn't find the shared data file, dump an error and return */ + if (CfgFilePath == NULL || strlen(CfgFilePath) < 1) + { + DebugMessage(M64MSG_ERROR, "Couldn't find config file '%s'", INI_FILE_NAME); + return 0; + } + + /* read the input auto-config .ini file */ + pfIn = fopen(CfgFilePath, "rb"); + if (pfIn == NULL) + { + DebugMessage(M64MSG_ERROR, "Couldn't open config file '%s'", CfgFilePath); + return 0; + } + fseek(pfIn, 0L, SEEK_END); + iniLength = ftell(pfIn); + fseek(pfIn, 0L, SEEK_SET); + pchIni = (char *) malloc(iniLength + 1); + if (pchIni == NULL) + { + DebugMessage(M64MSG_ERROR, "Couldn't allocate %li bytes for config file '%s'", iniLength, CfgFilePath); + fclose(pfIn); + return 0; + } + if (fread(pchIni, 1, iniLength, pfIn) != iniLength) + { + DebugMessage(M64MSG_ERROR, "File read failed for %li bytes of config file '%s'", iniLength, CfgFilePath); + free(pchIni); + fclose(pfIn); + return 0; + } + fclose(pfIn); + pchIni[iniLength] = 0; + + /* parse the INI file, line by line */ + pchNextLine = pchIni; + eParseState = E_NAME_SEARCH; + while (pchNextLine != NULL && *pchNextLine != 0) + { + char *pivot = NULL; + /* set up character pointers */ + pchCurLine = pchNextLine; + pchNextLine = strchr(pchNextLine, '\n'); + if (pchNextLine != NULL) + *pchNextLine++ = 0; + pchCurLine = StripSpace(pchCurLine); + + /* handle blank/comment lines */ + if (strlen(pchCurLine) < 1 || *pchCurLine == ';' || *pchCurLine == '#') + continue; + + /* handle section (joystick name in ini file) */ + if (*pchCurLine == '[' && pchCurLine[strlen(pchCurLine)-1] == ']') + { + char Word[64]; + char *wordPtr; + int joyFound = 1; + + if (eParseState == E_PARAM_READ) + { + /* we've finished parsing all parameters for the discovered input device */ + free(pchIni); + return ControllersFound; + } + else if (eParseState == E_NAME_FOUND) + { + /* this is an equivalent device name to the one we're looking for (and found); keep looking for parameters */ + continue; + } + /* we need to look through the device name word by word to see if it matches the joySDLName that we're looking for */ + pchCurLine[strlen(pchCurLine)-1] = 0; + wordPtr = StripSpace(pchCurLine + 1); + /* first, if there is a preceding system name in this .ini device name, and the system matches, then strip out */ +#if defined(__unix__) + if (strncmp(wordPtr, "Unix:", 5) == 0) + wordPtr = StripSpace(wordPtr + 5); +#endif +#if defined(__linux__) + if (strncmp(wordPtr, "Linux:", 6) == 0) + wordPtr = StripSpace(wordPtr + 6); +#endif +#if defined(__APPLE__) + if (strncmp(wordPtr, "OSX:", 4) == 0) + wordPtr = StripSpace(wordPtr + 4); +#endif +#if defined(WIN32) + if (strncmp(wordPtr, "Win32:", 6) == 0) + wordPtr = StripSpace(wordPtr + 6); +#endif + /* search in the .ini device name for all the words in the joystick name. If any are missing, then this is not the right joystick model */ + while (wordPtr != NULL && strlen(wordPtr) > 0) + { + char *nextSpace = strchr(wordPtr, ' '); + if (nextSpace == NULL) + { + strncpy(Word, wordPtr, 63); + Word[63] = 0; + wordPtr = NULL; + } + else + { + int length = (int) (nextSpace - wordPtr); + if (length > 63) length = 63; + strncpy(Word, wordPtr, length); + Word[length] = 0; + wordPtr = nextSpace + 1; + } + if (strcasestr(joySDLName, Word) == NULL) + joyFound = 0; + } + /* if we found the right joystick, then open up the core config section to store parameters and set the 'device' param */ + if (joyFound) + { + char SectionName[32]; + sprintf(SectionName, "AutoConfig%i", ControllersFound); + if (ConfigOpenSection(SectionName, &pConfig) != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_ERROR, "auto_set_defaults(): Couldn't open config section '%s'", SectionName); + free(pchIni); + return 0; + } + eParseState = E_NAME_FOUND; + ControllersFound++; + DebugMessage(M64MSG_INFO, "Using auto-configuration for device '%s'", joySDLName); + ConfigSetParameter(pConfig, "device", M64TYPE_INT, &iDeviceIdx); + } + continue; + } + + /* handle parameters */ + pivot = strchr(pchCurLine, '='); + if (pivot != NULL) + { + /* if we haven't found the correct section yet, just skip this */ + if (eParseState == E_NAME_SEARCH) + continue; + eParseState = E_PARAM_READ; + /* otherwise, store this parameter in the current active joystick config */ + *pivot++ = 0; + pchCurLine = StripSpace(pchCurLine); + pivot = StripSpace(pivot); + if (strcasecmp(pchCurLine, "plugin") == 0 || strcasecmp(pchCurLine, "device") == 0) + { + int iVal = atoi(pivot); + ConfigSetParameter(pConfig, pchCurLine, M64TYPE_INT, &iVal); + } + else if (strcasecmp(pchCurLine, "plugged") == 0 || strcasecmp(pchCurLine, "mouse") == 0) + { + int bVal = (strcasecmp(pivot, "true") == 0); + ConfigSetParameter(pConfig, pchCurLine, M64TYPE_BOOL, &bVal); + } + else + { + ConfigSetParameter(pConfig, pchCurLine, M64TYPE_STRING, pivot); + } + continue; + } + + /* handle keywords */ + if (pchCurLine[strlen(pchCurLine)-1] == ':') + { + /* if we haven't found the correct section yet, just skip this */ + if (eParseState == E_NAME_SEARCH) + continue; + /* otherwise parse the keyword */ + if (strcmp(pchCurLine, "__NextController:") == 0) + { + char SectionName[32]; + /* if there are no more N64 controller spaces left, then exit */ + if (ControllersFound == 4) + { + free(pchIni); + return ControllersFound; + } + /* otherwise go to the next N64 controller */ + sprintf(SectionName, "AutoConfig%i", ControllersFound); + if (ConfigOpenSection(SectionName, &pConfig) != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_ERROR, "auto_set_defaults(): Couldn't open config section '%s'", SectionName); + free(pchIni); + return ControllersFound; + } + ControllersFound++; + DebugMessage(M64MSG_INFO, "Using auto-configuration for device '%s': %i controllers for this device", joySDLName, ControllersFound); + ConfigSetParameter(pConfig, "device", M64TYPE_INT, &iDeviceIdx); + } + else + { + DebugMessage(M64MSG_ERROR, "Unknown keyword '%s' in %s", pchCurLine, INI_FILE_NAME); + } + continue; + } + + /* unhandled line in .ini file */ + DebugMessage(M64MSG_ERROR, "Invalid line in %s: '%s'", INI_FILE_NAME, pchCurLine); + } + + if (eParseState == E_PARAM_READ) + { + /* we've finished parsing all parameters for the discovered input device, which is the last in the .ini file */ + free(pchIni); + return ControllersFound; + } + + DebugMessage(M64MSG_INFO, "No auto-configuration found for device '%s'", joySDLName); + free(pchIni); + return 0; +} + + diff --git a/libmupen64plus/mupen64plus-input-sdl/src/autoconfig.h b/libmupen64plus/mupen64plus-input-sdl/src/autoconfig.h new file mode 100644 index 0000000000..24e7d7daa4 --- /dev/null +++ b/libmupen64plus/mupen64plus-input-sdl/src/autoconfig.h @@ -0,0 +1,28 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-input-sdl - autoconfig.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __AUTOCONFIG_H__ +#define __AUTOCONFIG_H__ + +extern int auto_set_defaults(int iDeviceIdx, const char *joySDLName); + +#endif /* __AUTOCONFIG_H__ */ + diff --git a/libmupen64plus/mupen64plus-input-sdl/src/config.c b/libmupen64plus/mupen64plus-input-sdl/src/config.c new file mode 100644 index 0000000000..e777478e9d --- /dev/null +++ b/libmupen64plus/mupen64plus-input-sdl/src/config.c @@ -0,0 +1,592 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-input-sdl - config.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#define M64P_PLUGIN_PROTOTYPES 1 +#include "m64p_types.h" +#include "m64p_plugin.h" +#include "m64p_config.h" + +#include "osal_preproc.h" +#include "autoconfig.h" +#include "plugin.h" + +#include "config.h" + +#define HAT_POS_NAME( hat ) \ + ((hat == SDL_HAT_UP) ? "Up" : \ + ((hat == SDL_HAT_DOWN) ? "Down" : \ + ((hat == SDL_HAT_LEFT) ? "Left" : \ + ((hat == SDL_HAT_RIGHT) ? "Right" : \ + "None")))) + + +static const char *button_names[] = { + "DPad R", // R_DPAD + "DPad L", // L_DPAD + "DPad D", // D_DPAD + "DPad U", // U_DPAD + "Start", // START_BUTTON + "Z Trig", // Z_TRIG + "B Button", // B_BUTTON + "A Button", // A_BUTTON + "C Button R", // R_CBUTTON + "C Button L", // L_CBUTTON + "C Button D", // D_CBUTTON + "C Button U", // U_CBUTTON + "R Trig", // R_TRIG + "L Trig", // L_TRIG + "Mempak switch", + "Rumblepak switch", + "X Axis", // X_AXIS + "Y Axis" // Y_AXIS +}; + + +/* static functions */ +static int get_hat_pos_by_name( const char *name ) +{ + if( !strcasecmp( name, "up" ) ) + return SDL_HAT_UP; + if( !strcasecmp( name, "down" ) ) + return SDL_HAT_DOWN; + if( !strcasecmp( name, "left" ) ) + return SDL_HAT_LEFT; + if( !strcasecmp( name, "right" ) ) + return SDL_HAT_RIGHT; + DebugMessage(M64MSG_WARNING, "get_hat_pos_by_name(): direction '%s' unknown", name); + return -1; +} + +static void clear_controller(int iCtrlIdx) +{ + int b; + + controller[iCtrlIdx].device = DEVICE_AUTO; + controller[iCtrlIdx].control->Present = 0; + controller[iCtrlIdx].control->RawData = 0; + controller[iCtrlIdx].control->Plugin = PLUGIN_NONE; + for( b = 0; b < 16; b++ ) + { + controller[iCtrlIdx].button[b].button = -1; + controller[iCtrlIdx].button[b].key = SDL_SCANCODE_UNKNOWN; + controller[iCtrlIdx].button[b].axis = -1; + controller[iCtrlIdx].button[b].axis_deadzone = -1; + controller[iCtrlIdx].button[b].hat = -1; + controller[iCtrlIdx].button[b].hat_pos = -1; + controller[iCtrlIdx].button[b].mouse = -1; + } + for( b = 0; b < 2; b++ ) + { + controller[iCtrlIdx].mouse_sens[b] = 2.0; + controller[iCtrlIdx].axis_deadzone[b] = 4096; + controller[iCtrlIdx].axis_peak[b] = 32768; + controller[iCtrlIdx].axis[b].button_a = controller[iCtrlIdx].axis[b].button_b = -1; + controller[iCtrlIdx].axis[b].key_a = controller[iCtrlIdx].axis[b].key_b = SDL_SCANCODE_UNKNOWN; + controller[iCtrlIdx].axis[b].axis_a = -1; + controller[iCtrlIdx].axis[b].axis_dir_a = 1; + controller[iCtrlIdx].axis[b].axis_b = -1; + controller[iCtrlIdx].axis[b].axis_dir_b = 1; + controller[iCtrlIdx].axis[b].hat = -1; + controller[iCtrlIdx].axis[b].hat_pos_a = -1; + controller[iCtrlIdx].axis[b].hat_pos_b = -1; + } +} + +static const char * get_sdl_joystick_name(int iCtrlIdx) +{ + static char JoyName[256]; + const char *joySDLName; + int joyWasInit = SDL_WasInit(SDL_INIT_JOYSTICK); + + /* initialize the joystick subsystem if necessary */ + if (!joyWasInit) + if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) == -1) + { + DebugMessage(M64MSG_ERROR, "Couldn't init SDL joystick subsystem: %s", SDL_GetError() ); + return NULL; + } + + /* get the name of the corresponding joystick */ + joySDLName = SDL_JoystickName(iCtrlIdx); + + /* copy the name to our local string */ + if (joySDLName != NULL) + { + strncpy(JoyName, joySDLName, 255); + JoyName[255] = 0; + } + + /* quit the joystick subsystem if necessary */ + if (!joyWasInit) + SDL_QuitSubSystem(SDL_INIT_JOYSTICK); + + /* if the SDL function had an error, then return NULL, otherwise return local copy of joystick name */ + if (joySDLName == NULL) + return NULL; + else + return JoyName; +} + +///////////////////////////////////// +// load_controller_config() +// return value: 1 = OK +// 0 = fail: couldn't open config section +// -1 = fail: stored configuration incomplete - missing parameters +// -2 = fail: AutoKeyboard stored in mupen64plus.cfg file +// -3 = fail: joystick name stored in mupen64plus.cfg doesn't match SDL joystick name for given SDL joystick # + +static int load_controller_config(const char *SectionName, int i, int bIsAutoconfig) +{ + m64p_handle pConfig; + char input_str[256], value1_str[16], value2_str[16]; + const char *config_ptr; + int j; + + /* Open the configuration section for this controller */ + if (ConfigOpenSection(SectionName, &pConfig) != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_ERROR, "Couldn't open config section '%s'", SectionName); + return 0; + } + /* Check version number, and if it doesn't match: delete the config section and return with error */ + if (!bIsAutoconfig) + { + float fVersion = 0.0f; + if (ConfigGetParameter(pConfig, "version", M64TYPE_FLOAT, &fVersion, sizeof(float)) != M64ERR_SUCCESS) + { + ConfigDeleteSection(SectionName); + return -1; + } + if (((int) fVersion) != ((int) CONFIG_VERSION)) + { + DebugMessage(M64MSG_WARNING, "Incompatible version %.2f in config section '%s': current is %.2f. Clearing.", fVersion, SectionName, (float) CONFIG_VERSION); + ConfigDeleteSection(SectionName); + return -1; + } + } + /* check for the required parameters */ + if (ConfigGetParameter(pConfig, "plugged", M64TYPE_BOOL, &controller[i].control->Present, sizeof(int)) != M64ERR_SUCCESS) + return -1; + if (ConfigGetParameter(pConfig, "plugin", M64TYPE_INT, &controller[i].control->Plugin, sizeof(int)) != M64ERR_SUCCESS) + return -1; + if (ConfigGetParameter(pConfig, "device", M64TYPE_INT, &controller[i].device, sizeof(int)) != M64ERR_SUCCESS) + return -1; + /* Name validation only applies to stored configurations (not auto-configs) */ + if (!bIsAutoconfig) + { + char device_name[256]; + if (ConfigGetParameter(pConfig, "name", M64TYPE_STRING, device_name, 256) != M64ERR_SUCCESS) + device_name[0] = 0; + if (controller[i].device == DEVICE_NOT_JOYSTICK) + { + /* do not load automatically generated keyboard config that was stored to disk (prefer any joysticks attached) */ + if (strcmp(device_name, "AutoKeyboard") == 0) + return -2; + } + else if (controller[i].device >= 0 && device_name[0] != 0) + { + /* check that the SDL device name matches the name stored in the config section */ + const char *sdl_name = get_sdl_joystick_name(controller[i].device); + if (sdl_name == NULL || strncmp(device_name, sdl_name, 255) != 0) + { + DebugMessage(M64MSG_WARNING, "N64 Controller #%i: SDL joystick name '%s' doesn't match stored configuration name '%s'", i + 1, sdl_name, device_name); + return -3; + } + } + } + /* then do the optional parameters */ + ConfigGetParameter(pConfig, "mouse", M64TYPE_BOOL, &controller[i].mouse, sizeof(int)); + if (ConfigGetParameter(pConfig, "MouseSensitivity", M64TYPE_STRING, input_str, 256) == M64ERR_SUCCESS) + { + if (sscanf(input_str, "%f,%f", &controller[i].mouse_sens[0], &controller[i].mouse_sens[1]) != 2) + DebugMessage(M64MSG_WARNING, "parsing error in MouseSensitivity parameter for controller %i", i + 1); + } + if (ConfigGetParameter(pConfig, "AnalogDeadzone", M64TYPE_STRING, input_str, 256) == M64ERR_SUCCESS) + { + if (sscanf(input_str, "%i,%i", &controller[i].axis_deadzone[0], &controller[i].axis_deadzone[1]) != 2) + DebugMessage(M64MSG_WARNING, "parsing error in AnalogDeadzone parameter for controller %i", i + 1); + } + if (ConfigGetParameter(pConfig, "AnalogPeak", M64TYPE_STRING, input_str, 256) == M64ERR_SUCCESS) + { + if (sscanf(input_str, "%i,%i", &controller[i].axis_peak[0], &controller[i].axis_peak[1]) != 2) + DebugMessage(M64MSG_WARNING, "parsing error in AnalogPeak parameter for controller %i", i + 1); + } + /* load configuration for all the digital buttons */ + for (j = 0; j < X_AXIS; j++) + { + if (ConfigGetParameter(pConfig, button_names[j], M64TYPE_STRING, input_str, 256) != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_WARNING, "missing config key '%s' for controller %i button %i", button_names[j], i+1, j); + continue; + } + if ((config_ptr = strstr(input_str, "key")) != NULL) + if (sscanf(config_ptr, "key(%i)", (int *) &controller[i].button[j].key) != 1) + DebugMessage(M64MSG_WARNING, "parsing error in key() parameter of button '%s' for controller %i", button_names[j], i + 1); + if ((config_ptr = strstr(input_str, "button")) != NULL) + if (sscanf(config_ptr, "button(%i)", &controller[i].button[j].button) != 1) + DebugMessage(M64MSG_WARNING, "parsing error in button() parameter of button '%s' for controller %i", button_names[j], i + 1); + if ((config_ptr = strstr(input_str, "axis")) != NULL) + { + char chAxisDir; + if (sscanf(config_ptr, "axis(%d%c,%d", &controller[i].button[j].axis, &chAxisDir, &controller[i].button[j].axis_deadzone) != 3 && + sscanf(config_ptr, "axis(%i%c", &controller[i].button[j].axis, &chAxisDir) != 2) + DebugMessage(M64MSG_WARNING, "parsing error in axis() parameter of button '%s' for controller %i", button_names[j], i + 1); + controller[i].button[j].axis_dir = (chAxisDir == '+' ? 1 : (chAxisDir == '-' ? -1 : 0)); + } + if ((config_ptr = strstr(input_str, "hat")) != NULL) + { + char *lastchar = NULL; + if (sscanf(config_ptr, "hat(%i %15s", &controller[i].button[j].hat, value1_str) != 2) + DebugMessage(M64MSG_WARNING, "parsing error in hat() parameter of button '%s' for controller %i", button_names[j], i + 1); + value1_str[15] = 0; + /* chop off the last character of value1_str if it is the closing parenthesis */ + lastchar = &value1_str[strlen(value1_str) - 1]; + if (lastchar > value1_str && *lastchar == ')') *lastchar = 0; + controller[i].button[j].hat_pos = get_hat_pos_by_name(value1_str); + } + if ((config_ptr = strstr(input_str, "mouse")) != NULL) + if (sscanf(config_ptr, "mouse(%i)", &controller[i].button[j].mouse) != 1) + DebugMessage(M64MSG_WARNING, "parsing error in mouse() parameter of button '%s' for controller %i", button_names[j], i + 1); + } + /* load configuration for the 2 analog joystick axes */ + for (j = X_AXIS; j <= Y_AXIS; j++) + { + int axis_idx = j - X_AXIS; + if (ConfigGetParameter(pConfig, button_names[j], M64TYPE_STRING, input_str, 256) != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_WARNING, "missing config key '%s' for controller %i axis %i", button_names[j], i+1, axis_idx); + continue; + } + if ((config_ptr = strstr(input_str, "key")) != NULL) + if (sscanf(config_ptr, "key(%i,%i)", (int *) &controller[i].axis[axis_idx].key_a, (int *) &controller[i].axis[axis_idx].key_b) != 2) + DebugMessage(M64MSG_WARNING, "parsing error in key() parameter of axis '%s' for controller %i", button_names[j], i + 1); + if ((config_ptr = strstr(input_str, "button")) != NULL) + if (sscanf(config_ptr, "button(%i,%i)", &controller[i].axis[axis_idx].button_a, &controller[i].axis[axis_idx].button_b) != 2) + DebugMessage(M64MSG_WARNING, "parsing error in button() parameter of axis '%s' for controller %i", button_names[j], i + 1); + if ((config_ptr = strstr(input_str, "axis")) != NULL) + { + char chAxisDir1, chAxisDir2; + if (sscanf(config_ptr, "axis(%i%c,%i%c)", &controller[i].axis[axis_idx].axis_a, &chAxisDir1, + &controller[i].axis[axis_idx].axis_b, &chAxisDir2) != 4) + DebugMessage(M64MSG_WARNING, "parsing error in axis() parameter of axis '%s' for controller %i", button_names[j], i + 1); + controller[i].axis[axis_idx].axis_dir_a = (chAxisDir1 == '+' ? 1 : (chAxisDir1 == '-' ? -1 : 0)); + controller[i].axis[axis_idx].axis_dir_b = (chAxisDir2 == '+' ? 1 : (chAxisDir2 == '-' ? -1 : 0)); + } + if ((config_ptr = strstr(input_str, "hat")) != NULL) + { + char *lastchar = NULL; + if (sscanf(config_ptr, "hat(%i %15s %15s", &controller[i].axis[axis_idx].hat, value1_str, value2_str) != 3) + DebugMessage(M64MSG_WARNING, "parsing error in hat() parameter of axis '%s' for controller %i", button_names[j], i + 1); + value1_str[15] = value2_str[15] = 0; + /* chop off the last character of value2_str if it is the closing parenthesis */ + lastchar = &value2_str[strlen(value2_str) - 1]; + if (lastchar > value2_str && *lastchar == ')') *lastchar = 0; + controller[i].axis[axis_idx].hat_pos_a = get_hat_pos_by_name(value1_str); + controller[i].axis[axis_idx].hat_pos_b = get_hat_pos_by_name(value2_str); + } + } + + return 1; +} + +static void save_controller_config(int iCtrlIdx, const char *pccDeviceName) +{ + m64p_handle pConfig; + char SectionName[32], Param[32], ParamString[128]; + int j; + + /* Delete the configuration section for this controller, so we can use SetDefaults and save the help comments also */ + sprintf(SectionName, "Input-SDL-Control%i", iCtrlIdx + 1); + ConfigDeleteSection(SectionName); + /* Open the configuration section for this controller (create a new one) */ + if (ConfigOpenSection(SectionName, &pConfig) != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_ERROR, "Couldn't open config section '%s'", SectionName); + return; + } + + /* save the general controller parameters */ + ConfigSetDefaultFloat(pConfig, "version", CONFIG_VERSION, "Mupen64Plus SDL Input Plugin config parameter version number. Please don't change this version number."); + ConfigSetDefaultBool(pConfig, "plugged", controller[iCtrlIdx].control->Present, "Specifies whether this controller is 'plugged in' to the simulated N64"); + ConfigSetDefaultInt(pConfig, "plugin", controller[iCtrlIdx].control->Plugin, "Specifies which type of expansion pak is in the controller: 1=None, 2=Mem pak, 5=Rumble pak"); + ConfigSetDefaultBool(pConfig, "mouse", controller[iCtrlIdx].mouse, "If True, then mouse buttons may be used with this controller"); + ConfigSetDefaultInt(pConfig, "device", controller[iCtrlIdx].device, "Specifies which joystick is bound to this controller: -2=Keyboard/mouse, -1=Auto config, 0 or more= SDL Joystick number"); + ConfigSetDefaultString(pConfig, "name", pccDeviceName, "SDL joystick name (name check disabled if this is empty string)"); + + sprintf(Param, "%.2f,%.2f", controller[iCtrlIdx].mouse_sens[0], controller[iCtrlIdx].mouse_sens[1]); + ConfigSetDefaultString(pConfig, "MouseSensitivity", Param, "Scaling factor for mouse movements. For X, Y axes."); + sprintf(Param, "%i,%i", controller[iCtrlIdx].axis_deadzone[0], controller[iCtrlIdx].axis_deadzone[1]); + ConfigSetDefaultString(pConfig, "AnalogDeadzone", Param, "The minimum absolute value of the SDL analog joystick axis to move the N64 controller axis value from 0. For X, Y axes."); + sprintf(Param, "%i,%i", controller[iCtrlIdx].axis_peak[0], controller[iCtrlIdx].axis_peak[1]); + ConfigSetDefaultString(pConfig, "AnalogPeak", Param, "An absolute value of the SDL joystick axis >= AnalogPeak will saturate the N64 controller axis value (at 80). For X, Y axes. For each axis, this must be greater than the corresponding AnalogDeadzone value"); + + /* save configuration for all the digital buttons */ + for (j = 0; j < X_AXIS; j++ ) + { + const char *Help; + int len = 0; + ParamString[0] = 0; + if (controller[iCtrlIdx].button[j].key > 0) + { + sprintf(Param, "key(%i) ", controller[iCtrlIdx].button[j].key); + strcat(ParamString, Param); + } + if (controller[iCtrlIdx].button[j].button >= 0) + { + sprintf(Param, "button(%i) ", controller[iCtrlIdx].button[j].button); + strcat(ParamString, Param); + } + if (controller[iCtrlIdx].button[j].axis >= 0) + { + if (controller[iCtrlIdx].button[j].axis_deadzone >= 0) + sprintf(Param, "axis(%i%c,%i) ", controller[iCtrlIdx].button[j].axis, (controller[iCtrlIdx].button[j].axis_dir == -1) ? '-' : '+', + controller[iCtrlIdx].button[j].axis_deadzone); + else + sprintf(Param, "axis(%i%c) ", controller[iCtrlIdx].button[j].axis, (controller[iCtrlIdx].button[j].axis_dir == -1) ? '-' : '+'); + strcat(ParamString, Param); + } + if (controller[iCtrlIdx].button[j].hat >= 0) + { + sprintf(Param, "hat(%i %s) ", controller[iCtrlIdx].button[j].hat, HAT_POS_NAME(controller[iCtrlIdx].button[j].hat_pos)); + strcat(ParamString, Param); + } + if (controller[iCtrlIdx].button[j].mouse >= 0) + { + sprintf(Param, "mouse(%i) ", controller[iCtrlIdx].button[j].mouse); + strcat(ParamString, Param); + } + if (j == 0) + Help = "Digital button configuration mappings"; + else + Help = NULL; + /* if last character is a space, chop it off */ + len = strlen(ParamString); + if (len > 0 && ParamString[len-1] == ' ') + ParamString[len-1] = 0; + ConfigSetDefaultString(pConfig, button_names[j], ParamString, Help); + } + + /* save configuration for the 2 analog axes */ + for (j = 0; j < 2; j++ ) + { + const char *Help; + int len = 0; + ParamString[0] = 0; + if (controller[iCtrlIdx].axis[j].key_a > 0 && controller[iCtrlIdx].axis[j].key_b > 0) + { + sprintf(Param, "key(%i,%i) ", controller[iCtrlIdx].axis[j].key_a, controller[iCtrlIdx].axis[j].key_b); + strcat(ParamString, Param); + } + if (controller[iCtrlIdx].axis[j].button_a >= 0 && controller[iCtrlIdx].axis[j].button_b >= 0) + { + sprintf(Param, "button(%i,%i) ", controller[iCtrlIdx].axis[j].button_a, controller[iCtrlIdx].axis[j].button_b); + strcat(ParamString, Param); + } + if (controller[iCtrlIdx].axis[j].axis_a >= 0 && controller[iCtrlIdx].axis[j].axis_b >= 0) + { + sprintf(Param, "axis(%i%c,%i%c) ", controller[iCtrlIdx].axis[j].axis_a, (controller[iCtrlIdx].axis[j].axis_dir_a <= 0) ? '-' : '+', + controller[iCtrlIdx].axis[j].axis_b, (controller[iCtrlIdx].axis[j].axis_dir_b <= 0) ? '-' : '+' ); + strcat(ParamString, Param); + } + if (controller[iCtrlIdx].axis[j].hat >= 0) + { + sprintf(Param, "hat(%i %s %s) ", controller[iCtrlIdx].axis[j].hat, + HAT_POS_NAME(controller[iCtrlIdx].axis[j].hat_pos_a), + HAT_POS_NAME(controller[iCtrlIdx].axis[j].hat_pos_b)); + strcat(ParamString, Param); + } + if (j == 0) + Help = "Analog axis configuration mappings"; + else + Help = NULL; + /* if last character is a space, chop it off */ + len = strlen(ParamString); + if (len > 0 && ParamString[len-1] == ' ') + ParamString[len-1] = 0; + ConfigSetDefaultString(pConfig, button_names[X_AXIS + j], ParamString, Help); + } + +} + +static void force_controller_keyboard(int n64CtrlIdx) +{ + if (n64CtrlIdx < 0 || n64CtrlIdx > 3) + { + DebugMessage(M64MSG_ERROR, "internal assert in ForceControllerKeyboard. n64CtrlIdx=%i", n64CtrlIdx); + return; + } + + DebugMessage(M64MSG_INFO, "N64 Controller #%i: Forcing default keyboard configuration", n64CtrlIdx+1); + auto_set_defaults(DEVICE_NOT_JOYSTICK, "Keyboard"); + if (load_controller_config("AutoConfig0", n64CtrlIdx, 1) > 0) + { + /* use ConfigSetDefault*() to save this auto-config if config section was empty */ + save_controller_config(n64CtrlIdx, "AutoKeyboard"); + } + else + { + DebugMessage(M64MSG_ERROR, "Autoconfig keyboard setup invalid"); + } + ConfigDeleteSection("AutoConfig0"); +} + +/* global functions */ + +/* The reason why the architecture of this config-handling code is so wacky is that it tries to balance + * several different user scenarios. From a high-level perspective, it works like this: + * 1. If there is a valid configuration setup already in the config file, it should not be changed + * - if a user sets up a joystick in a GUI dialog, this code should not cause the setup to magically change under any circumstances + * - if the config setup references an SDL joystick, and that device is not connected, then the controller is disabled + * 2. If there is no valid setup for an N64 controller in the config file, or the device is set to AUTO, then we will try to auto-configure it + * - there must be a joystick connected which SDL recognizes + * - the auto-configuration is based on the joystick's name (usually USB device name) + * - if the auto-configuration is successful, then the input plugin's internal data structures are configured for use but the config file parameters are not overwritten + * - However, if the config data section (Input-SDL-Control*) was previously empty, then the auto-configured parameters *will* be written to the config file + * - this allows a user to run the emulator once and save the auto-configured parameters, then later tweak the settings from a GUI + * 3. If for any reason there are no joysticks enabled after trying to set up all 4 controllers, then Controller #1 will be auto-configured for Keyboard usage + * - the keyboard config parameters will never be written to the config file, even if the Input-SDL-Control1 section was previously empty + */ + +void load_configuration(int bPrintSummary) +{ + char SectionName[32]; + const char *JoyName; + int joy_found = 0, joy_plugged = 0; + int readOK; + int n64CtrlIdx, sdlCtrlIdx, j; + + /* loop through all 4 simulated N64 controllers */ + for (n64CtrlIdx=0,sdlCtrlIdx=0; n64CtrlIdx < 4; n64CtrlIdx++) + { + /* reset the controller configuration */ + clear_controller(n64CtrlIdx); + /* try to load the config from the core's configuration api */ + sprintf(SectionName, "Input-SDL-Control%i", n64CtrlIdx + 1); + readOK = load_controller_config(SectionName, n64CtrlIdx, 0); + + if (readOK <= 0 || controller[n64CtrlIdx].device == DEVICE_AUTO) + { + int ControllersFound = 0; + /* make sure that SDL device number hasn't already been used for a different N64 controller */ + for (j = 0; j < n64CtrlIdx; j++) + { + if (controller[j].device == sdlCtrlIdx) + { + sdlCtrlIdx++; + j = -1; + } + } + /* if auto / bad config, get joystick name based on SDL order */ + JoyName = get_sdl_joystick_name(sdlCtrlIdx); + /* reset the controller configuration again and try to auto-configure */ + ControllersFound = auto_set_defaults(sdlCtrlIdx, JoyName); + sdlCtrlIdx++; + if (ControllersFound == 0) + { + controller[n64CtrlIdx].device = DEVICE_AUTO; + controller[n64CtrlIdx].control->Present = 0; + DebugMessage(M64MSG_VERBOSE, "N64 Controller #%i: Disabled, SDL joystick %i is not available", n64CtrlIdx+1, sdlCtrlIdx-1); + } + else + { + for (j = 0; j < ControllersFound; j++) /* a USB device may have > 1 controller */ + { + sprintf(SectionName, "AutoConfig%i", j); + if (n64CtrlIdx + j > 3) + { + ConfigDeleteSection(SectionName); + continue; + } + clear_controller(n64CtrlIdx + j); + if (load_controller_config(SectionName, n64CtrlIdx + j, 1) > 0) + { + /* use ConfigSetDefault*() to save this auto-config if config section was empty */ + save_controller_config(n64CtrlIdx + j, JoyName); + DebugMessage(M64MSG_INFO, "N64 Controller #%i: Using auto-config for SDL joystick %i ('%s')", n64CtrlIdx+1, controller[n64CtrlIdx].device, JoyName); + } + else + { + DebugMessage(M64MSG_ERROR, "Autoconfig data invalid for controller #%i in device '%s'", j + 1, JoyName); + } + ConfigDeleteSection(SectionName); + } + n64CtrlIdx += ControllersFound - 1; + continue; + } + } + else if (controller[n64CtrlIdx].device >= 0) + { + /* if joystick found in cfg, take its SDL number from there */ + JoyName = get_sdl_joystick_name(controller[n64CtrlIdx].device); + /* valid joystick configuration was read; check if the specified joystick is available in SDL */ + if (JoyName == NULL) + { + controller[n64CtrlIdx].device = DEVICE_AUTO; + controller[n64CtrlIdx].control->Present = 0; + DebugMessage(M64MSG_WARNING, "N64 Controller #%i: Disabled, SDL joystick %i is not available", n64CtrlIdx+1, controller[n64CtrlIdx].device); + } + else + DebugMessage(M64MSG_INFO, "N64 Controller #%i: Using stored config for SDL joystick %i ('%s')", n64CtrlIdx+1, controller[n64CtrlIdx].device, JoyName); + } + else /* controller is configured for keyboard/mouse */ + { + DebugMessage(M64MSG_INFO, "N64 Controller #%i: Using keyboard/mouse", n64CtrlIdx+1); + } + } + + /* see how many joysticks were found */ + joy_found = 0, joy_plugged = 0; + for (j = 0; j < 4; j++) + { + if (controller[j].device >= 0 || controller[j].device == DEVICE_NOT_JOYSTICK) + { + joy_found++; + if (controller[j].control->Present) + joy_plugged++; + } + } + + /* fallback to keyboard if no joysticks are available and 'plugged in' */ + if (joy_found == 0 || joy_plugged == 0) + { + force_controller_keyboard(0); + } + + if (bPrintSummary) + { + if (joy_found > 0 && joy_plugged > 0) + { + DebugMessage(M64MSG_INFO, "%i controller(s) found, %i plugged in and usable in the emulator", joy_found, joy_plugged); + } + else + { + if (joy_found == 0) + DebugMessage(M64MSG_WARNING, "No joysticks/controllers found"); + else if (joy_plugged == 0) + DebugMessage(M64MSG_WARNING, "%i controllers found, but none were 'plugged in'", joy_found); + } + } + +} + + diff --git a/libmupen64plus/mupen64plus-input-sdl/src/config.h b/libmupen64plus/mupen64plus-input-sdl/src/config.h new file mode 100644 index 0000000000..2547f2405d --- /dev/null +++ b/libmupen64plus/mupen64plus-input-sdl/src/config.h @@ -0,0 +1,30 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-input-sdl - config.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __CONFIG_H__ +#define __CONFIG_H__ + +#define CONFIG_VERSION 1.00 + +extern void load_configuration(int bPrintSummary); + +#endif /* __CONFIG_H__ */ + diff --git a/libmupen64plus/mupen64plus-input-sdl/src/osal_dynamiclib.h b/libmupen64plus/mupen64plus-input-sdl/src/osal_dynamiclib.h new file mode 100644 index 0000000000..daef1541c0 --- /dev/null +++ b/libmupen64plus/mupen64plus-input-sdl/src/osal_dynamiclib.h @@ -0,0 +1,30 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - osal/dynamiclib.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#if !defined(OSAL_DYNAMICLIB_H) +#define OSAL_DYNAMICLIB_H + +#include "m64p_types.h" + +void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName); + +#endif /* #define OSAL_DYNAMICLIB_H */ + diff --git a/libmupen64plus/mupen64plus-input-sdl/src/osal_dynamiclib_unix.c b/libmupen64plus/mupen64plus-input-sdl/src/osal_dynamiclib_unix.c new file mode 100644 index 0000000000..b3b7ba52dc --- /dev/null +++ b/libmupen64plus/mupen64plus-input-sdl/src/osal_dynamiclib_unix.c @@ -0,0 +1,37 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - osal/dynamiclib_unix.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include + +#include "m64p_types.h" +#include "osal_dynamiclib.h" + +void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName) +{ + if (pccProcedureName == NULL) + return NULL; + + return dlsym(LibHandle, pccProcedureName); +} + + diff --git a/libmupen64plus/mupen64plus-input-sdl/src/osal_dynamiclib_win32.c b/libmupen64plus/mupen64plus-input-sdl/src/osal_dynamiclib_win32.c new file mode 100644 index 0000000000..4455cee52b --- /dev/null +++ b/libmupen64plus/mupen64plus-input-sdl/src/osal_dynamiclib_win32.c @@ -0,0 +1,74 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-ui-console - osal_dynamiclib_win32.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include + +#include "m64p_types.h" +#include "osal_dynamiclib.h" + +m64p_error osal_dynlib_open(m64p_dynlib_handle *pLibHandle, const char *pccLibraryPath) +{ + if (pLibHandle == NULL || pccLibraryPath == NULL) + return M64ERR_INPUT_ASSERT; + + *pLibHandle = LoadLibrary(pccLibraryPath); + + if (*pLibHandle == NULL) + { + char *pchErrMsg; + DWORD dwErr = GetLastError(); + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pchErrMsg, 0, NULL); + fprintf(stderr, "LoadLibrary('%s') error: %s\n", pccLibraryPath, pchErrMsg); + LocalFree(pchErrMsg); + return M64ERR_INPUT_NOT_FOUND; + } + + return M64ERR_SUCCESS; +} + +void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName) +{ + if (pccProcedureName == NULL) + return NULL; + + return GetProcAddress(LibHandle, pccProcedureName); +} + +m64p_error osal_dynlib_close(m64p_dynlib_handle LibHandle) +{ + int rval = FreeLibrary(LibHandle); + + if (rval == 0) + { + char *pchErrMsg; + DWORD dwErr = GetLastError(); + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pchErrMsg, 0, NULL); + fprintf(stderr, "FreeLibrary() error: %s\n", pchErrMsg); + LocalFree(pchErrMsg); + return M64ERR_INTERNAL; + } + + return M64ERR_SUCCESS; +} diff --git a/libmupen64plus/mupen64plus-input-sdl/src/osal_preproc.h b/libmupen64plus/mupen64plus-input-sdl/src/osal_preproc.h new file mode 100644 index 0000000000..37c7dc4a86 --- /dev/null +++ b/libmupen64plus/mupen64plus-input-sdl/src/osal_preproc.h @@ -0,0 +1,33 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - osal_preproc.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* this header file is for system-dependent #defines, #includes, and typedefs */ + +#if !defined(OSAL_PREPROC_H) +#define OSAL_PREPROC_H + +#if defined(WIN32) + #define strcasestr strstr + #define strcasecmp _stricmp +#endif // WIN32 + +#endif // OSAL_PREPROC_H diff --git a/libmupen64plus/mupen64plus-input-sdl/src/plugin.c b/libmupen64plus/mupen64plus-input-sdl/src/plugin.c new file mode 100644 index 0000000000..299229026a --- /dev/null +++ b/libmupen64plus/mupen64plus-input-sdl/src/plugin.c @@ -0,0 +1,919 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-input-sdl - plugin.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2008-2011 Richard Goedeken * + * Copyright (C) 2008 Tillin9 * + * Copyright (C) 2002 Blight * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include + +#include + +#define M64P_PLUGIN_PROTOTYPES 1 +#include "m64p_types.h" +#include "m64p_plugin.h" +#include "m64p_common.h" +#include "m64p_config.h" + +#include "plugin.h" +#include "config.h" +#include "version.h" +#include "osal_dynamiclib.h" + +#ifdef __linux__ +#include +#include +#include +#include +#include +#endif /* __linux__ */ + +#include + +/* defines for the force feedback rumble support */ +#ifdef __linux__ +#define BITS_PER_LONG (sizeof(long) * 8) +#define OFF(x) ((x)%BITS_PER_LONG) +#define BIT(x) (1UL<> OFF(bit)) & 1) +#endif //__linux__ + +/* definitions of pointers to Core config functions */ +ptr_ConfigOpenSection ConfigOpenSection = NULL; +ptr_ConfigDeleteSection ConfigDeleteSection = NULL; +ptr_ConfigSetParameter ConfigSetParameter = NULL; +ptr_ConfigGetParameter ConfigGetParameter = NULL; +ptr_ConfigGetParameterHelp ConfigGetParameterHelp = NULL; +ptr_ConfigSetDefaultInt ConfigSetDefaultInt = NULL; +ptr_ConfigSetDefaultFloat ConfigSetDefaultFloat = NULL; +ptr_ConfigSetDefaultBool ConfigSetDefaultBool = NULL; +ptr_ConfigSetDefaultString ConfigSetDefaultString = NULL; +ptr_ConfigGetParamInt ConfigGetParamInt = NULL; +ptr_ConfigGetParamFloat ConfigGetParamFloat = NULL; +ptr_ConfigGetParamBool ConfigGetParamBool = NULL; +ptr_ConfigGetParamString ConfigGetParamString = NULL; + +ptr_ConfigGetSharedDataFilepath ConfigGetSharedDataFilepath = NULL; +ptr_ConfigGetUserConfigPath ConfigGetUserConfigPath = NULL; +ptr_ConfigGetUserDataPath ConfigGetUserDataPath = NULL; +ptr_ConfigGetUserCachePath ConfigGetUserCachePath = NULL; + +/* global data definitions */ +SController controller[4]; // 4 controllers + +/* static data definitions */ +static void (*l_DebugCallback)(void *, int, const char *) = NULL; +static void *l_DebugCallContext = NULL; +static int l_PluginInit = 0; + +static unsigned short button_bits[] = { + 0x0001, // R_DPAD + 0x0002, // L_DPAD + 0x0004, // D_DPAD + 0x0008, // U_DPAD + 0x0010, // START_BUTTON + 0x0020, // Z_TRIG + 0x0040, // B_BUTTON + 0x0080, // A_BUTTON + 0x0100, // R_CBUTTON + 0x0200, // L_CBUTTON + 0x0400, // D_CBUTTON + 0x0800, // U_CBUTTON + 0x1000, // R_TRIG + 0x2000, // L_TRIG + 0x4000, // Mempak switch + 0x8000 // Rumblepak switch +}; + +static int romopen = 0; // is a rom opened + +static unsigned char myKeyState[SDL_NUM_SCANCODES]; + +#ifdef __linux__ +static struct ff_effect ffeffect[3]; +static struct ff_effect ffstrong[3]; +static struct ff_effect ffweak[3]; +#endif //__linux__ + +/* Global functions */ +void DebugMessage(int level, const char *message, ...) +{ + char msgbuf[1024]; + va_list args; + + if (l_DebugCallback == NULL) + return; + + va_start(args, message); + vsprintf(msgbuf, message, args); + + (*l_DebugCallback)(l_DebugCallContext, level, msgbuf); + + va_end(args); +} + +static CONTROL temp_core_controlinfo[4]; + +/* Mupen64Plus plugin functions */ +EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle CoreLibHandle, void *Context, + void (*DebugCallback)(void *, int, const char *)) +{ + ptr_CoreGetAPIVersions CoreAPIVersionFunc; + + int i, ConfigAPIVersion, DebugAPIVersion, VidextAPIVersion; + + if (l_PluginInit) + return M64ERR_ALREADY_INIT; + + /* first thing is to set the callback function for debug info */ + l_DebugCallback = DebugCallback; + l_DebugCallContext = Context; + + /* attach and call the CoreGetAPIVersions function, check Config API version for compatibility */ + CoreAPIVersionFunc = (ptr_CoreGetAPIVersions) osal_dynlib_getproc(CoreLibHandle, "CoreGetAPIVersions"); + if (CoreAPIVersionFunc == NULL) + { + DebugMessage(M64MSG_ERROR, "Core emulator broken; no CoreAPIVersionFunc() function found."); + return M64ERR_INCOMPATIBLE; + } + + (*CoreAPIVersionFunc)(&ConfigAPIVersion, &DebugAPIVersion, &VidextAPIVersion, NULL); + if ((ConfigAPIVersion & 0xffff0000) != (CONFIG_API_VERSION & 0xffff0000)) + { + DebugMessage(M64MSG_ERROR, "Emulator core Config API (v%i.%i.%i) incompatible with plugin (v%i.%i.%i)", + VERSION_PRINTF_SPLIT(ConfigAPIVersion), VERSION_PRINTF_SPLIT(CONFIG_API_VERSION)); + return M64ERR_INCOMPATIBLE; + } + + /* Get the core config function pointers from the library handle */ + ConfigOpenSection = (ptr_ConfigOpenSection) osal_dynlib_getproc(CoreLibHandle, "ConfigOpenSection"); + ConfigDeleteSection = (ptr_ConfigDeleteSection) osal_dynlib_getproc(CoreLibHandle, "ConfigDeleteSection"); + ConfigSetParameter = (ptr_ConfigSetParameter) osal_dynlib_getproc(CoreLibHandle, "ConfigSetParameter"); + ConfigGetParameter = (ptr_ConfigGetParameter) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParameter"); + ConfigSetDefaultInt = (ptr_ConfigSetDefaultInt) osal_dynlib_getproc(CoreLibHandle, "ConfigSetDefaultInt"); + ConfigSetDefaultFloat = (ptr_ConfigSetDefaultFloat) osal_dynlib_getproc(CoreLibHandle, "ConfigSetDefaultFloat"); + ConfigSetDefaultBool = (ptr_ConfigSetDefaultBool) osal_dynlib_getproc(CoreLibHandle, "ConfigSetDefaultBool"); + ConfigSetDefaultString = (ptr_ConfigSetDefaultString) osal_dynlib_getproc(CoreLibHandle, "ConfigSetDefaultString"); + ConfigGetParamInt = (ptr_ConfigGetParamInt) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParamInt"); + ConfigGetParamFloat = (ptr_ConfigGetParamFloat) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParamFloat"); + ConfigGetParamBool = (ptr_ConfigGetParamBool) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParamBool"); + ConfigGetParamString = (ptr_ConfigGetParamString) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParamString"); + + ConfigGetSharedDataFilepath = (ptr_ConfigGetSharedDataFilepath) osal_dynlib_getproc(CoreLibHandle, "ConfigGetSharedDataFilepath"); + ConfigGetUserConfigPath = (ptr_ConfigGetUserConfigPath) osal_dynlib_getproc(CoreLibHandle, "ConfigGetUserConfigPath"); + ConfigGetUserDataPath = (ptr_ConfigGetUserDataPath) osal_dynlib_getproc(CoreLibHandle, "ConfigGetUserDataPath"); + ConfigGetUserCachePath = (ptr_ConfigGetUserCachePath) osal_dynlib_getproc(CoreLibHandle, "ConfigGetUserCachePath"); + + if (!ConfigOpenSection || !ConfigDeleteSection || !ConfigSetParameter || !ConfigGetParameter || + !ConfigSetDefaultInt || !ConfigSetDefaultFloat || !ConfigSetDefaultBool || !ConfigSetDefaultString || + !ConfigGetParamInt || !ConfigGetParamFloat || !ConfigGetParamBool || !ConfigGetParamString || + !ConfigGetSharedDataFilepath || !ConfigGetUserConfigPath || !ConfigGetUserDataPath || !ConfigGetUserCachePath) + { + DebugMessage(M64MSG_ERROR, "Couldn't connect to Core configuration functions"); + return M64ERR_INCOMPATIBLE; + } + + /* reset controllers */ + memset(controller, 0, sizeof(SController) * 4); + for (i = 0; i < SDL_NUM_SCANCODES; i++) + { + myKeyState[i] = 0; + } + /* set CONTROL struct pointers to the temporary static array */ + /* this small struct is used to tell the core whether each controller is plugged in, and what type of pak is connected */ + /* we only need it so that we can call load_configuration below, to auto-config for a GUI front-end */ + for (i = 0; i < 4; i++) + controller[i].control = temp_core_controlinfo + i; + + /* read plugin config from core config database, auto-config if necessary and update core database */ + load_configuration(0); + + l_PluginInit = 1; + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL PluginShutdown(void) +{ + if (!l_PluginInit) + return M64ERR_NOT_INIT; + + /* reset some local variables */ + l_DebugCallback = NULL; + l_DebugCallContext = NULL; + + l_PluginInit = 0; + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL PluginGetVersion(m64p_plugin_type *PluginType, int *PluginVersion, int *APIVersion, const char **PluginNamePtr, int *Capabilities) +{ + /* set version info */ + if (PluginType != NULL) + *PluginType = M64PLUGIN_INPUT; + + if (PluginVersion != NULL) + *PluginVersion = PLUGIN_VERSION; + + if (APIVersion != NULL) + *APIVersion = INPUT_PLUGIN_API_VERSION; + + if (PluginNamePtr != NULL) + *PluginNamePtr = PLUGIN_NAME; + + if (Capabilities != NULL) + { + *Capabilities = 0; + } + + return M64ERR_SUCCESS; +} + +/* Helper function to handle the SDL keys */ +static void +doSdlKeys(unsigned char* keystate) +{ + int c, b, axis_val, axis_max_val; + static int grabmouse = 1, grabtoggled = 0; + + axis_max_val = 80; + if (keystate[SDL_SCANCODE_RCTRL]) + axis_max_val -= 40; + if (keystate[SDL_SCANCODE_RSHIFT]) + axis_max_val -= 20; + + for( c = 0; c < 4; c++ ) + { + for( b = 0; b < 16; b++ ) + { + if( controller[c].button[b].key == SDL_SCANCODE_UNKNOWN || ((int) controller[c].button[b].key) < 0) + continue; + if( keystate[controller[c].button[b].key] ) + controller[c].buttons.Value |= button_bits[b]; + } + for( b = 0; b < 2; b++ ) + { + // from the N64 func ref: The 3D Stick data is of type signed char and in + // the range between 80 and -80. (32768 / 409 = ~80.1) + if( b == 0 ) + axis_val = controller[c].buttons.X_AXIS; + else + axis_val = -controller[c].buttons.Y_AXIS; + + if( controller[c].axis[b].key_a != SDL_SCANCODE_UNKNOWN && ((int) controller[c].axis[b].key_a) > 0) + if( keystate[controller[c].axis[b].key_a] ) + axis_val = -axis_max_val; + if( controller[c].axis[b].key_b != SDL_SCANCODE_UNKNOWN && ((int) controller[c].axis[b].key_b) > 0) + if( keystate[controller[c].axis[b].key_b] ) + axis_val = axis_max_val; + + if( b == 0 ) + controller[c].buttons.X_AXIS = axis_val; + else + controller[c].buttons.Y_AXIS = -axis_val; + } + if (controller[c].mouse) + { + if (keystate[SDL_SCANCODE_LCTRL] && keystate[SDL_SCANCODE_LALT]) + { + if (!grabtoggled) + { + grabtoggled = 1; + grabmouse = !grabmouse; + // grab/ungrab mouse +#if SDL_VERSION_ATLEAST(2,0,0) +#warning SDL mouse grabbing not yet supported with SDL 2.0 +#else + SDL_WM_GrabInput( grabmouse ? SDL_GRAB_ON : SDL_GRAB_OFF ); +#endif + SDL_ShowCursor( grabmouse ? 0 : 1 ); + } + } + else grabtoggled = 0; + } + } +} + +static unsigned char DataCRC( unsigned char *Data, int iLenght ) +{ + unsigned char Remainder = Data[0]; + + int iByte = 1; + unsigned char bBit = 0; + + while( iByte <= iLenght ) + { + int HighBit = ((Remainder & 0x80) != 0); + Remainder = Remainder << 1; + + Remainder += ( iByte < iLenght && Data[iByte] & (0x80 >> bBit )) ? 1 : 0; + + Remainder ^= (HighBit) ? 0x85 : 0; + + bBit++; + iByte += bBit/8; + bBit %= 8; + } + + return Remainder; +} + +/****************************************************************** + Function: ControllerCommand + Purpose: To process the raw data that has just been sent to a + specific controller. + input: - Controller Number (0 to 3) and -1 signalling end of + processing the pif ram. + - Pointer of data to be processed. + output: none + + note: This function is only needed if the DLL is allowing raw + data, or the plugin is set to raw + + the data that is being processed looks like this: + initilize controller: 01 03 00 FF FF FF + read controller: 01 04 01 FF FF FF FF +*******************************************************************/ +EXPORT void CALL ControllerCommand(int Control, unsigned char *Command) +{ + unsigned char *Data = &Command[5]; + + if (Control == -1) + return; + + switch (Command[2]) + { + case RD_GETSTATUS: +#ifdef _DEBUG + DebugMessage(M64MSG_INFO, "Get status"); +#endif + break; + case RD_READKEYS: +#ifdef _DEBUG + DebugMessage(M64MSG_INFO, "Read keys"); +#endif + break; + case RD_READPAK: +#ifdef _DEBUG + DebugMessage(M64MSG_INFO, "Read pak"); +#endif + if (controller[Control].control->Plugin == PLUGIN_RAW) + { + unsigned int dwAddress = (Command[3] << 8) + (Command[4] & 0xE0); + + if(( dwAddress >= 0x8000 ) && ( dwAddress < 0x9000 ) ) + memset( Data, 0x80, 32 ); + else + memset( Data, 0x00, 32 ); + + Data[32] = DataCRC( Data, 32 ); + } + break; + case RD_WRITEPAK: +#ifdef _DEBUG + DebugMessage(M64MSG_INFO, "Write pak"); +#endif + if (controller[Control].control->Plugin == PLUGIN_RAW) + { + unsigned int dwAddress = (Command[3] << 8) + (Command[4] & 0xE0); + if (dwAddress == PAK_IO_RUMBLE && *Data) + DebugMessage(M64MSG_VERBOSE, "Triggering rumble pack."); +#ifdef __linux__ + struct input_event play; + if( dwAddress == PAK_IO_RUMBLE && controller[Control].event_joystick != 0) + { + if( *Data ) + { + play.type = EV_FF; + play.code = ffeffect[Control].id; + play.value = 1; + + if (write(controller[Control].event_joystick, (const void*) &play, sizeof(play)) == -1) + perror("Error starting rumble effect"); + + } + else + { + play.type = EV_FF; + play.code = ffeffect[Control].id; + play.value = 0; + + if (write(controller[Control].event_joystick, (const void*) &play, sizeof(play)) == -1) + perror("Error stopping rumble effect"); + } + } +#endif //__linux__ + Data[32] = DataCRC( Data, 32 ); + } + break; + case RD_RESETCONTROLLER: +#ifdef _DEBUG + DebugMessage(M64MSG_INFO, "Reset controller"); +#endif + break; + case RD_READEEPROM: +#ifdef _DEBUG + DebugMessage(M64MSG_INFO, "Read eeprom"); +#endif + break; + case RD_WRITEEPROM: +#ifdef _DEBUG + DebugMessage(M64MSG_INFO, "Write eeprom"); +#endif + break; + } +} + +/****************************************************************** + Function: GetKeys + Purpose: To get the current state of the controllers buttons. + input: - Controller Number (0 to 3) + - A pointer to a BUTTONS structure to be filled with + the controller state. + output: none +*******************************************************************/ +EXPORT void CALL GetKeys( int Control, BUTTONS *Keys ) +{ + static int mousex_residual = 0; + static int mousey_residual = 0; + int b, axis_val; + SDL_Event event; + unsigned char mstate; + + // Handle keyboard input first + doSdlKeys(SDL_GetKeyboardState(NULL)); + doSdlKeys(myKeyState); + + // read joystick state + SDL_JoystickUpdate(); + + if( controller[Control].device >= 0 ) + { + for( b = 0; b < 16; b++ ) + { + if( controller[Control].button[b].button >= 0 ) + if( SDL_JoystickGetButton( controller[Control].joystick, controller[Control].button[b].button ) ) + controller[Control].buttons.Value |= button_bits[b]; + + if( controller[Control].button[b].axis >= 0 ) + { + int deadzone = controller[Control].button[b].axis_deadzone; + axis_val = SDL_JoystickGetAxis( controller[Control].joystick, controller[Control].button[b].axis ); + if (deadzone < 0) + deadzone = 6000; /* default */ + if( (controller[Control].button[b].axis_dir < 0) && (axis_val <= -deadzone) ) + controller[Control].buttons.Value |= button_bits[b]; + else if( (controller[Control].button[b].axis_dir > 0) && (axis_val >= deadzone) ) + controller[Control].buttons.Value |= button_bits[b]; + } + + if( controller[Control].button[b].hat >= 0 ) + { + if( controller[Control].button[b].hat_pos > 0 ) + if( SDL_JoystickGetHat( controller[Control].joystick, controller[Control].button[b].hat ) & controller[Control].button[b].hat_pos ) + controller[Control].buttons.Value |= button_bits[b]; + } + } + for( b = 0; b < 2; b++ ) + { + /* from the N64 func ref: The 3D Stick data is of type signed char and in the range between -80 and +80 */ + int deadzone = controller[Control].axis_deadzone[b]; + int range = controller[Control].axis_peak[b] - controller[Control].axis_deadzone[b]; + /* skip this axis if the deadzone/peak values are invalid */ + if (deadzone < 0 || range < 1) + continue; + + if( b == 0 ) + axis_val = controller[Control].buttons.X_AXIS; + else + axis_val = -controller[Control].buttons.Y_AXIS; + + if( controller[Control].axis[b].axis_a >= 0 ) /* up and left for N64 */ + { + int joy_val = SDL_JoystickGetAxis(controller[Control].joystick, controller[Control].axis[b].axis_a); + int axis_dir = controller[Control].axis[b].axis_dir_a; + if (joy_val * axis_dir > deadzone) + axis_val = -((abs(joy_val) - deadzone) * 80 / range); + if (axis_val < -80) + axis_val = -80; + } + if( controller[Control].axis[b].axis_b >= 0 ) /* down and right for N64 */ + { + int joy_val = SDL_JoystickGetAxis(controller[Control].joystick, controller[Control].axis[b].axis_b); + int axis_dir = controller[Control].axis[b].axis_dir_b; + if (joy_val * axis_dir > deadzone) + axis_val = ((abs(joy_val) - deadzone) * 80 / range); + if (axis_val > 80) + axis_val = 80; + } + if( controller[Control].axis[b].hat >= 0 ) + { + if( controller[Control].axis[b].hat_pos_a >= 0 ) + if( SDL_JoystickGetHat( controller[Control].joystick, controller[Control].axis[b].hat ) & controller[Control].axis[b].hat_pos_a ) + axis_val = -80; + if( controller[Control].axis[b].hat_pos_b >= 0 ) + if( SDL_JoystickGetHat( controller[Control].joystick, controller[Control].axis[b].hat ) & controller[Control].axis[b].hat_pos_b ) + axis_val = 80; + } + + if( controller[Control].axis[b].button_a >= 0 ) + if( SDL_JoystickGetButton( controller[Control].joystick, controller[Control].axis[b].button_a ) ) + axis_val = -80; + if( controller[Control].axis[b].button_b >= 0 ) + if( SDL_JoystickGetButton( controller[Control].joystick, controller[Control].axis[b].button_b ) ) + axis_val = 80; + + if( b == 0 ) + controller[Control].buttons.X_AXIS = axis_val; + else + controller[Control].buttons.Y_AXIS = -axis_val; + } + } + + // process mouse events + mstate = SDL_GetMouseState( NULL, NULL ); + for( b = 0; b < 16; b++ ) + { + if( controller[Control].button[b].mouse < 1 ) + continue; + if( mstate & SDL_BUTTON(controller[Control].button[b].mouse) ) + controller[Control].buttons.Value |= button_bits[b]; + } + + if (controller[Control].mouse) + { +#if SDL_VERSION_ATLEAST(2,0,0) +#warning SDL mouse grabbing not yet supported with SDL 2.0 +#else + if (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON) + { + SDL_PumpEvents(); +#if SDL_VERSION_ATLEAST(1,3,0) + while (SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_MOUSEMOTION, SDL_MOUSEMOTION) == 1) +#else + while (SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_EVENTMASK(SDL_MOUSEMOTION)) == 1) +#endif + { + if (event.motion.xrel) + { + mousex_residual += (int) (event.motion.xrel * controller[Control].mouse_sens[0]); + } + if (event.motion.yrel) + { + mousey_residual += (int) (event.motion.yrel * controller[Control].mouse_sens[1]); + } + } + } + else +#endif + { + mousex_residual = 0; + mousey_residual = 0; + } + axis_val = mousex_residual; + if (axis_val < -80) + axis_val = -80; + else if (axis_val > 80) + axis_val = 80; + controller[Control].buttons.X_AXIS = axis_val; + axis_val = mousey_residual; + if (axis_val < -80) + axis_val = -80; + else if (axis_val > 80) + axis_val = 80; + controller[Control].buttons.Y_AXIS = -axis_val; + /* the mouse x/y values decay exponentially */ + mousex_residual = (mousex_residual * 224) / 256; + mousey_residual = (mousey_residual * 224) / 256; + } + +#ifdef _DEBUG + DebugMessage(M64MSG_VERBOSE, "Controller #%d value: 0x%8.8X", Control, *(int *)&controller[Control].buttons ); +#endif + *Keys = controller[Control].buttons; + + /* handle mempack / rumblepak switching (only if rumble is active on joystick) */ +#ifdef __linux__ + if (controller[Control].event_joystick != 0) + { + struct input_event play; + static unsigned int SwitchPackTime[4] = {0, 0, 0, 0}, SwitchPackType[4] = {0, 0, 0, 0}; + // when the user switches packs, we should mimick the act of removing 1 pack, and then inserting another 1 second later + if (controller[Control].buttons.Value & button_bits[14]) + { + SwitchPackTime[Control] = SDL_GetTicks(); // time at which the 'switch pack' command was given + SwitchPackType[Control] = PLUGIN_MEMPAK; // type of new pack to insert + controller[Control].control->Plugin = PLUGIN_NONE;// remove old pack + play.type = EV_FF; + play.code = ffweak[Control].id; + play.value = 1; + if (write(controller[Control].event_joystick, (const void*) &play, sizeof(play)) == -1) + perror("Error starting rumble effect"); + } + if (controller[Control].buttons.Value & button_bits[15]) + { + SwitchPackTime[Control] = SDL_GetTicks(); // time at which the 'switch pack' command was given + SwitchPackType[Control] = PLUGIN_RAW; // type of new pack to insert + controller[Control].control->Plugin = PLUGIN_NONE;// remove old pack + play.type = EV_FF; + play.code = ffstrong[Control].id; + play.value = 1; + if (write(controller[Control].event_joystick, (const void*) &play, sizeof(play)) == -1) + perror("Error starting rumble effect"); + } + // handle inserting new pack if the time has arrived + if (SwitchPackTime[Control] != 0 && (SDL_GetTicks() - SwitchPackTime[Control]) >= 1000) + { + controller[Control].control->Plugin = SwitchPackType[Control]; + SwitchPackTime[Control] = 0; + } + } +#endif /* __linux__ */ + + controller[Control].buttons.Value = 0; +} + +static void InitiateRumble(int cntrl) +{ +#ifdef __linux__ + DIR* dp; + struct dirent* ep; + unsigned long features[4]; + char temp[128]; + char temp2[128]; + int iFound = 0; + + controller[cntrl].event_joystick = 0; + + sprintf(temp,"/sys/class/input/js%d/device", controller[cntrl].device); + dp = opendir(temp); + + if(dp==NULL) + return; + + while ((ep=readdir(dp))) + { + if (strncmp(ep->d_name, "event",5)==0) + { + sprintf(temp, "/dev/input/%s", ep->d_name); + iFound = 1; + break; + } + else if(strncmp(ep->d_name,"input:event", 11)==0) + { + sscanf(ep->d_name, "input:%s", temp2); + sprintf(temp, "/dev/input/%s", temp2); + iFound = 1; + break; + } + else if(strncmp(ep->d_name,"input:input", 11)==0) + { + strcat(temp, "/"); + strcat(temp, ep->d_name); + closedir (dp); + dp = opendir(temp); + if(dp==NULL) + return; + } + } + + closedir(dp); + + if (!iFound) + { + DebugMessage(M64MSG_WARNING, "Couldn't find input event for rumble support."); + return; + } + + controller[cntrl].event_joystick = open(temp, O_RDWR); + if(controller[cntrl].event_joystick==-1) + { + DebugMessage(M64MSG_WARNING, "Couldn't open device file '%s' for rumble support.", temp); + controller[cntrl].event_joystick = 0; + return; + } + + if(ioctl(controller[cntrl].event_joystick, EVIOCGBIT(EV_FF, sizeof(unsigned long) * 4), features)==-1) + { + DebugMessage(M64MSG_WARNING, "Linux kernel communication failed for force feedback (rumble).\n"); + controller[cntrl].event_joystick = 0; + return; + } + + if(!test_bit(FF_RUMBLE, features)) + { + DebugMessage(M64MSG_WARNING, "No rumble supported on N64 joystick #%i", cntrl + 1); + controller[cntrl].event_joystick = 0; + return; + } + + ffeffect[cntrl].type = FF_RUMBLE; + ffeffect[cntrl].id = -1; + ffeffect[cntrl].u.rumble.strong_magnitude = 0xFFFF; + ffeffect[cntrl].u.rumble.weak_magnitude = 0xFFFF; + + ioctl(controller[cntrl].event_joystick, EVIOCSFF, &ffeffect[cntrl]); + + ffstrong[cntrl].type = FF_RUMBLE; + ffstrong[cntrl].id = -1; + ffstrong[cntrl].u.rumble.strong_magnitude = 0xFFFF; + ffstrong[cntrl].u.rumble.weak_magnitude = 0x0000; + ffstrong[cntrl].replay.length = 500; + ffstrong[cntrl].replay.delay = 0; + + ioctl(controller[cntrl].event_joystick, EVIOCSFF, &ffstrong[cntrl]); + + ffweak[cntrl].type = FF_RUMBLE; + ffweak[cntrl].id = -1; + ffweak[cntrl].u.rumble.strong_magnitude = 0x0000; + ffweak[cntrl].u.rumble.weak_magnitude = 0xFFFF; + ffweak[cntrl].replay.length = 500; + ffweak[cntrl].replay.delay = 0; + + ioctl(controller[cntrl].event_joystick, EVIOCSFF, &ffweak[cntrl]); + + DebugMessage(M64MSG_INFO, "Rumble activated on N64 joystick #%i", cntrl + 1); +#endif /* __linux__ */ +} + +/****************************************************************** + Function: InitiateControllers + Purpose: This function initialises how each of the controllers + should be handled. + input: - The handle to the main window. + - A controller structure that needs to be filled for + the emulator to know how to handle each controller. + output: none +*******************************************************************/ +EXPORT void CALL InitiateControllers(CONTROL_INFO ControlInfo) +{ + int i; + + // reset controllers + memset( controller, 0, sizeof( SController ) * 4 ); + for ( i = 0; i < SDL_NUM_SCANCODES; i++) + { + myKeyState[i] = 0; + } + // set our CONTROL struct pointers to the array that was passed in to this function from the core + // this small struct tells the core whether each controller is plugged in, and what type of pak is connected + for (i = 0; i < 4; i++) + controller[i].control = ControlInfo.Controls + i; + + // read configuration + load_configuration(1); + + for( i = 0; i < 4; i++ ) + { + // test for rumble support for this joystick + InitiateRumble(i); + // if rumble not supported, switch to mempack + if (controller[i].control->Plugin == PLUGIN_RAW && controller[i].event_joystick == 0) + controller[i].control->Plugin = PLUGIN_MEMPAK; + } + + DebugMessage(M64MSG_INFO, "%s version %i.%i.%i initialized.", PLUGIN_NAME, VERSION_PRINTF_SPLIT(PLUGIN_VERSION)); +} + +/****************************************************************** + Function: ReadController + Purpose: To process the raw data in the pif ram that is about to + be read. + input: - Controller Number (0 to 3) and -1 signalling end of + processing the pif ram. + - Pointer of data to be processed. + output: none + note: This function is only needed if the DLL is allowing raw + data. +*******************************************************************/ +EXPORT void CALL ReadController(int Control, unsigned char *Command) +{ +#ifdef _DEBUG + if (Command != NULL) + DebugMessage(M64MSG_INFO, "Raw Read (cont=%d): %02X %02X %02X %02X %02X %02X", Control, + Command[0], Command[1], Command[2], Command[3], Command[4], Command[5]); +#endif +} + +/****************************************************************** + Function: RomClosed + Purpose: This function is called when a rom is closed. + input: none + output: none +*******************************************************************/ +EXPORT void CALL RomClosed(void) +{ + int i; + + // close joysticks + for( i = 0; i < 4; i++ ) + if( controller[i].joystick ) + { + SDL_JoystickClose( controller[i].joystick ); + controller[i].joystick = NULL; + } + + // quit SDL joystick subsystem + SDL_QuitSubSystem( SDL_INIT_JOYSTICK ); + + // release/ungrab mouse +#if SDL_VERSION_ATLEAST(2,0,0) +#warning SDL mouse grabbing not yet supported with SDL 2.0 +#else + SDL_WM_GrabInput( SDL_GRAB_OFF ); +#endif + SDL_ShowCursor( 1 ); + + romopen = 0; +} + +/****************************************************************** + Function: RomOpen + Purpose: This function is called when a rom is open. (from the + emulation thread) + input: none + output: none +*******************************************************************/ +EXPORT int CALL RomOpen(void) +{ + int i; + + // init SDL joystick subsystem + if( !SDL_WasInit( SDL_INIT_JOYSTICK ) ) + if( SDL_InitSubSystem( SDL_INIT_JOYSTICK ) == -1 ) + { + DebugMessage(M64MSG_ERROR, "Couldn't init SDL joystick subsystem: %s", SDL_GetError() ); + return 0; + } + + // open joysticks + for( i = 0; i < 4; i++ ) + if( controller[i].device >= 0 ) + { + controller[i].joystick = SDL_JoystickOpen( controller[i].device ); + if( controller[i].joystick == NULL ) + DebugMessage(M64MSG_WARNING, "Couldn't open joystick for controller #%d: %s", i + 1, SDL_GetError() ); + } + else + controller[i].joystick = NULL; + + // grab mouse + if (controller[0].mouse || controller[1].mouse || controller[2].mouse || controller[3].mouse) + { +#if SDL_VERSION_ATLEAST(2,0,0) +#warning SDL mouse grabbing not yet supported with SDL 2.0 +#else + SDL_ShowCursor( 0 ); + if (SDL_WM_GrabInput( SDL_GRAB_ON ) != SDL_GRAB_ON) + { + DebugMessage(M64MSG_WARNING, "Couldn't grab input! Mouse support won't work!"); + } +#endif + } + + romopen = 1; + return 1; +} + +/****************************************************************** + Function: SDL_KeyDown + Purpose: To pass the SDL_KeyDown message from the emulator to the + plugin. + input: keymod and keysym of the SDL_KEYDOWN message. + output: none +*******************************************************************/ +EXPORT void CALL SDL_KeyDown(int keymod, int keysym) +{ + myKeyState[keysym] = 1; +} + +/****************************************************************** + Function: SDL_KeyUp + Purpose: To pass the SDL_KeyUp message from the emulator to the + plugin. + input: keymod and keysym of the SDL_KEYUP message. + output: none +*******************************************************************/ +EXPORT void CALL SDL_KeyUp(int keymod, int keysym) +{ + myKeyState[keysym] = 0; +} + diff --git a/libmupen64plus/mupen64plus-input-sdl/src/plugin.h b/libmupen64plus/mupen64plus-input-sdl/src/plugin.h new file mode 100644 index 0000000000..882d422cbb --- /dev/null +++ b/libmupen64plus/mupen64plus-input-sdl/src/plugin.h @@ -0,0 +1,175 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-input-sdl - plugin.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2008-2009 Richard Goedeken * + * Copyright (C) 2008 Tillin9 * + * Copyright (C) 2002 Blight * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __PLUGIN_H__ +#define __PLUGIN_H__ + +#include +#if ! SDL_VERSION_ATLEAST(1,3,0) + +#define SDL_GetKeyboardState SDL_GetKeyState +#define SDL_SCANCODE_UNKNOWN SDLK_UNKNOWN +#define SDL_NUM_SCANCODES SDLK_LAST +#define SDL_SCANCODE_RCTRL SDLK_RCTRL +#define SDL_SCANCODE_RSHIFT SDLK_RSHIFT +#define SDL_SCANCODE_LCTRL SDLK_LCTRL +#define SDL_SCANCODE_LALT SDLK_LALT +#define SDL_Scancode SDLKey + +#endif + +#if SDL_VERSION_ATLEAST(2,0,0) + +static inline const char* _SDL_JoystickName(int device_index) +{ + SDL_Joystick *joystick; + const char *name; + static char JoyName[256]; + + joystick = SDL_JoystickOpen(device_index); + if (!joystick) + return NULL; + + name = SDL_JoystickName(joystick); + if (name) + { + strncpy(JoyName, name, 255); + JoyName[255] = 0; + } + SDL_JoystickClose(joystick); + + return JoyName; +} + +#define SDL_JoystickName(device_index) _SDL_JoystickName(device_index) + +#endif + +#define M64P_PLUGIN_PROTOTYPES 1 +#include "m64p_plugin.h" +#include "m64p_config.h" + +#define DEVICE_AUTO (-1) +#define DEVICE_NOT_JOYSTICK (-2) + +// Some stuff from n-rage plugin +#define RD_GETSTATUS 0x00 // get status +#define RD_READKEYS 0x01 // read button values +#define RD_READPAK 0x02 // read from controllerpack +#define RD_WRITEPAK 0x03 // write to controllerpack +#define RD_RESETCONTROLLER 0xff // reset controller +#define RD_READEEPROM 0x04 // read eeprom +#define RD_WRITEEPROM 0x05 // write eeprom + +#define PAK_IO_RUMBLE 0xC000 // the address where rumble-commands are sent to + +enum EButton +{ + R_DPAD = 0, + L_DPAD, + D_DPAD, + U_DPAD, + START_BUTTON, + Z_TRIG, + B_BUTTON, + A_BUTTON, + R_CBUTTON, + L_CBUTTON, + D_CBUTTON, + U_CBUTTON, + R_TRIG, + L_TRIG, + MEMPAK, + RUMBLEPAK, + X_AXIS, + Y_AXIS, + NUM_BUTTONS +}; + +typedef struct +{ + int button; // button index; -1 if notassigned + SDL_Scancode key; // sdl keysym; SDL_SCANCODE_UNKNOWN if not assigned + int axis, axis_dir; // aixs + direction (i.e. 0, 1 = X Axis +; 0, -1 = X Axis -); -1 if notassigned + int axis_deadzone; // -1 for default, or >= 0 for custom value + int hat, hat_pos; // hat + hat position; -1 if not assigned + int mouse; // mouse button +} SButtonMap; + +typedef struct +{ + int button_a, button_b; // up/down or left/right; -1 if not assigned + SDL_Scancode key_a, key_b; // up/down or left/right; SDL_SCANCODE_UNKNOWN if not assigned + int axis_a, axis_b; // axis index; -1 if not assigned + int axis_dir_a, axis_dir_b; // direction (1 = X+, 0, -1 = X-) + int hat, hat_pos_a, hat_pos_b; // hat + hat position up/down and left/right; -1 if not assigned +} SAxisMap; + +typedef struct +{ + CONTROL *control; // pointer to CONTROL struct in Core library + BUTTONS buttons; + + // mappings + SButtonMap button[16]; // 14 buttons; in the order of EButton + mempak/rumblepak switches + SAxisMap axis[2]; // 2 axis + int device; // joystick device; -1 = keyboard; -2 = none + int mouse; // mouse enabled: 0 = no; 1 = yes + SDL_Joystick *joystick; // SDL joystick device + int event_joystick; // the /dev/input/eventX device for force feeback + int axis_deadzone[2]; // minimum absolute value before analog movement is recognized + int axis_peak[2]; // highest analog value returned by SDL, used for scaling + float mouse_sens[2]; // mouse sensitivity +} SController; + +/* global data definitions */ +extern SController controller[4]; // 4 controllers + +/* global function definitions */ +extern void DebugMessage(int level, const char *message, ...); + +/* declarations of pointers to Core config functions */ +extern ptr_ConfigListSections ConfigListSections; +extern ptr_ConfigOpenSection ConfigOpenSection; +extern ptr_ConfigDeleteSection ConfigDeleteSection; +extern ptr_ConfigListParameters ConfigListParameters; +extern ptr_ConfigSaveFile ConfigSaveFile; +extern ptr_ConfigSetParameter ConfigSetParameter; +extern ptr_ConfigGetParameter ConfigGetParameter; +extern ptr_ConfigGetParameterHelp ConfigGetParameterHelp; +extern ptr_ConfigSetDefaultInt ConfigSetDefaultInt; +extern ptr_ConfigSetDefaultFloat ConfigSetDefaultFloat; +extern ptr_ConfigSetDefaultBool ConfigSetDefaultBool; +extern ptr_ConfigSetDefaultString ConfigSetDefaultString; +extern ptr_ConfigGetParamInt ConfigGetParamInt; +extern ptr_ConfigGetParamFloat ConfigGetParamFloat; +extern ptr_ConfigGetParamBool ConfigGetParamBool; +extern ptr_ConfigGetParamString ConfigGetParamString; + +extern ptr_ConfigGetSharedDataFilepath ConfigGetSharedDataFilepath; +extern ptr_ConfigGetUserConfigPath ConfigGetUserConfigPath; +extern ptr_ConfigGetUserDataPath ConfigGetUserDataPath; +extern ptr_ConfigGetUserCachePath ConfigGetUserCachePath; + +#endif // __PLUGIN_H__ + diff --git a/libmupen64plus/mupen64plus-input-sdl/src/version.h b/libmupen64plus/mupen64plus-input-sdl/src/version.h new file mode 100644 index 0000000000..5bc2913742 --- /dev/null +++ b/libmupen64plus/mupen64plus-input-sdl/src/version.h @@ -0,0 +1,37 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-input-sdl - version.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009-2012 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This header file is for versioning information + * + */ + +#if !defined(VERSION_H) +#define VERSION_H + +#define PLUGIN_NAME "Mupen64Plus SDL Input Plugin" +#define PLUGIN_VERSION 0x016305 +#define INPUT_PLUGIN_API_VERSION 0x020000 +#define CONFIG_API_VERSION 0x020000 + +#define VERSION_PRINTF_SPLIT(x) (((x) >> 16) & 0xffff), (((x) >> 8) & 0xff), ((x) & 0xff) + +#endif /* #define VERSION_H */ + diff --git a/libmupen64plus/mupen64plus-rsp-hle/INSTALL b/libmupen64plus/mupen64plus-rsp-hle/INSTALL new file mode 100644 index 0000000000..746f9bdd2d --- /dev/null +++ b/libmupen64plus/mupen64plus-rsp-hle/INSTALL @@ -0,0 +1,26 @@ +Mupen64Plus-RSP-HLE INSTALL +--------------------------- + +This text file was written to explain the installation process of the +Mupen64Plus-RSP-HLE plugin. + +If this module is part of a Mupen64Plus source code bundle, the user should run +the "m64p_install.sh" script in the root of the unzipped bundle to install all +of the included modules in the bundle. + +If this module is a standalone source code release, you should build the library +from source code and install it via the makefile, like this: + +$ cd projects/unix +$ make all +$ sudo make install + +If you want to build the Mupen64Plus-RSP-HLE module for installation in a home +folder for a single user, you may build it like this (replacing +with your desired local installation path): + +$ cd projects/unix +$ make all +$ make install LIBDIR= + + diff --git a/libmupen64plus/mupen64plus-rsp-hle/LICENSES b/libmupen64plus/mupen64plus-rsp-hle/LICENSES new file mode 100644 index 0000000000..5103f7288a --- /dev/null +++ b/libmupen64plus/mupen64plus-rsp-hle/LICENSES @@ -0,0 +1,368 @@ +Mupen64Plus-rsp-hle LICENSE +--------------------------- + +Mupen64Plus-rsp-hle is licensed under the GNU General Public License version 2. + +The authors of Mupen64Plus are: + * Richard Goedeken (Richard42) + * John Chadwick (NMN) + * James Hood (Ebenblues) + * Scott Gorman (okaygo) + * Scott Knauert (Tillin9) + * Jesse Dean (DarkJezter) + * Louai Al-Khanji (slougi) + * Bob Forder (orbitaldecay) + * Jason Espinosa (hasone) + * HyperHacker + * and others. + +Mupen64Plus is based on GPL-licensed source code from Mupen64 v0.5, originally written by: + * Hacktarux + * Dave2001 + * Zilmar + * Gregor Anich (Blight) + * Juha Luotio (JttL) + * and others. + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, 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 + + + Appendix: 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. + + + Copyright (C) 19yy + + 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., 675 Mass Ave, Cambridge, MA 02139, 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) 19yy 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. + + , 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. + diff --git a/libmupen64plus/mupen64plus-rsp-hle/RELEASE b/libmupen64plus/mupen64plus-rsp-hle/RELEASE new file mode 100644 index 0000000000..b28a6ca15c --- /dev/null +++ b/libmupen64plus/mupen64plus-rsp-hle/RELEASE @@ -0,0 +1,34 @@ +RSP High-Level Emulation plugin for Mupen64Plus +----------------------------------------------- + +Mupen64Plus-rsp-hle v1.99.5 - March 10, 2012 +------------------------------------------------- + - Handle JPEG decompression, used in Ogre Battle 64 and Pokemon Stadium + - updated RSP plugin for new Mupen64plus 2.0 API versioning scheme + - bugfix: #102 - Missing backgrounds in Ogre Battle 64 + - many makefile fixes and improvements + +Mupen64Plus-rsp-hle v1.99.4 - November 22, 2010 +------------------------------------------------- + - merged all big-endian fixes from mupen64gc project + - makefile fixes and improvements + +Mupen64Plus-rsp-hle v1.99.3 - February 13, 2010 +------------------------------------------------- + - Makefile improvement: added OS type GNU/kFreeBSD + +Mupen64Plus-rsp-hle v1.99.2 - January 6, 2010 +------------------------------------------------- + - new feature: added MSVC8 project file for RSP-HLE plugin, fixed a few minor incompatibilities + - Makefile improvements: + - throw error if OS/CPU not supported + - use DESTDIR in install/uninstall paths + - Allow user-specified CC/CXX/LD paths + - use C++ compiler to link instead of LD, because the compiler knows where the standard C++ libs are + +Mupen64Plus-rsp-hle v1.99.1 - December 14, 2009 +------------------------------------------------- + - Converted to new Mupen64Plus 2.0 API + - Refactored build system to separate source and object files + - Refactored all code to remove win32-specific things, unnecessary functions, and clean up + diff --git a/libmupen64plus/mupen64plus-rsp-hle/projects/msvc11/mupen64plus-rsp-hle.vcxproj b/libmupen64plus/mupen64plus-rsp-hle/projects/msvc11/mupen64plus-rsp-hle.vcxproj new file mode 100644 index 0000000000..4980677ffc --- /dev/null +++ b/libmupen64plus/mupen64plus-rsp-hle/projects/msvc11/mupen64plus-rsp-hle.vcxproj @@ -0,0 +1,112 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A} + mupen64plusrsphle + Win32Proj + + + + DynamicLibrary + MultiByte + true + + + DynamicLibrary + MultiByte + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + true + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + Default + + + true + Windows + MachineX86 + + + + + ..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + Default + + + true + Windows + true + true + MachineX86 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libmupen64plus/mupen64plus-rsp-hle/projects/msvc8/mupen64plus-rsp-hle.vcproj b/libmupen64plus/mupen64plus-rsp-hle/projects/msvc8/mupen64plus-rsp-hle.vcproj new file mode 100644 index 0000000000..1b9522852c --- /dev/null +++ b/libmupen64plus/mupen64plus-rsp-hle/projects/msvc8/mupen64plus-rsp-hle.vcproj @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libmupen64plus/mupen64plus-rsp-hle/projects/unix/Makefile b/libmupen64plus/mupen64plus-rsp-hle/projects/unix/Makefile new file mode 100644 index 0000000000..d643b30ccf --- /dev/null +++ b/libmupen64plus/mupen64plus-rsp-hle/projects/unix/Makefile @@ -0,0 +1,322 @@ +#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# * mupen64plus-rsp-hle - Makefile * +# * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * +# * Copyright (C) 2008-2009 Richard Goedeken * +# * Copyright (C) 2007-2008 DarkJeztr Tillin9 * +# * * +# * 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. * +# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +# Makefile for Mupen64 HLE RSP plugin in Mupen64plus. + +# detect operating system +UNAME ?= $(shell uname -s) +OS := NONE +ifeq ("$(UNAME)","Linux") + OS = LINUX + SO_EXTENSION = so + SHARED = -shared +endif +ifeq ("$(UNAME)","linux") + OS = LINUX + SO_EXTENSION = so + SHARED = -shared +endif +ifneq ("$(filter GNU hurd,$(UNAME))","") + OS = LINUX + SO_EXTENSION = so + SHARED = -shared +endif +ifeq ("$(UNAME)","Darwin") + OS = OSX + SO_EXTENSION = dylib + SHARED = -bundle +endif +ifeq ("$(UNAME)","FreeBSD") + OS = FREEBSD + SO_EXTENSION = so + SHARED = -shared +endif +ifeq ("$(UNAME)","OpenBSD") + OS = FREEBSD + SO_EXTENSION = so + SHARED = -shared + $(warning OS type "$(UNAME)" not officially supported.') +endif +ifneq ("$(filter GNU/kFreeBSD kfreebsd,$(UNAME))","") + OS = LINUX + SO_EXTENSION = so + SHARED = -shared +endif +ifeq ("$(patsubst MINGW%,MINGW,$(UNAME))","MINGW") + OS = MINGW + SO_EXTENSION = dll + SHARED = -shared + PIC = 0 +endif +ifeq ("$(OS)","NONE") + $(error OS type "$(UNAME)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') +endif + +# detect system architecture +HOST_CPU ?= $(shell uname -m) +NO_ASM ?= 1 +CPU := NONE +ifneq ("$(filter x86_64 amd64,$(HOST_CPU))","") + CPU := X86 + ifeq ("$(BITS)", "32") + ARCH_DETECTED := 64BITS_32 + PIC ?= 0 + else + ARCH_DETECTED := 64BITS + PIC ?= 1 + endif +endif +ifneq ("$(filter pentium i%86,$(HOST_CPU))","") + CPU := X86 + ARCH_DETECTED := 32BITS + PIC ?= 0 +endif +ifneq ("$(filter ppc macppc socppc powerpc,$(HOST_CPU))","") + CPU := PPC + ARCH_DETECTED := 32BITS + BIG_ENDIAN := 1 + PIC ?= 1 + $(warning Architecture "$(HOST_CPU)" not officially supported.') +endif +ifneq ("$(filter ppc64 powerpc64,$(HOST_CPU))","") + CPU := PPC + ARCH_DETECTED := 64BITS + BIG_ENDIAN := 1 + PIC ?= 1 + $(warning Architecture "$(HOST_CPU)" not officially supported.') +endif +ifneq ("$(filter arm%,$(HOST_CPU))","") + ifeq ("$(filter arm%b,$(HOST_CPU))","") + CPU := ARM + ARCH_DETECTED := 32BITS + PIC ?= 1 + $(warning Architecture "$(HOST_CPU)" not officially supported.') + endif +endif +ifeq ("$(CPU)","NONE") + $(error CPU type "$(HOST_CPU)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') +endif + +# base CFLAGS, LDLIBS, and LDFLAGS +OPTFLAGS ?= -O3 +WARNFLAGS ?= -Wall +CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src +CXXFLAGS += -fvisibility-inlines-hidden +LDFLAGS += $(SHARED) + +# Since we are building a shared library, we must compile with -fPIC on some architectures +# On 32-bit x86 systems we do not want to use -fPIC because we don't have to and it has a big performance penalty on this arch +ifeq ($(PIC), 1) + CFLAGS += -fPIC + LDFLAGS += -fPIC +else + CFLAGS += -fno-PIC + LDFLAGS += -fno-PIC +endif + +ifeq ($(BIG_ENDIAN), 1) + CFLAGS += -DM64P_BIG_ENDIAN +endif + +# tweak flags for 32-bit build on 64-bit system +ifeq ($(ARCH_DETECTED), 64BITS_32) + ifeq ($(OS), FREEBSD) + $(error Do not use the BITS=32 option with FreeBSD, use -m32 and -m elf_i386) + endif + CFLAGS += -m32 + LDFLAGS += -m32 -Wl,-m,elf_i386 +endif + +# set special flags per-system +ifeq ($(OS), LINUX) + # only export api symbols + LDFLAGS += -Wl,-version-script,$(SRCDIR)/rsp_api_export.ver +endif +ifeq ($(OS), OSX) + # Select the proper SDK + # Also, SDKs are stored in a different location since XCode 4.3 + OSX_SDK ?= $(shell sw_vers -productVersion | cut -f1 -f2 -d .) + OSX_XCODEMAJ = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f1 -d .) + OSX_XCODEMIN = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f2 -d .) + OSX_XCODEGE43 = $(shell echo "`expr $(OSX_XCODEMAJ) \>= 4``expr $(OSX_XCODEMIN) \>= 3`") + ifeq ($(OSX_XCODEGE43), 11) + OSX_SYSROOT := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs + else + OSX_SYSROOT := /Developer/SDKs + endif + + ifeq ($(CPU), X86) + ifeq ($(ARCH_DETECTED), 64BITS) + CFLAGS += -pipe -arch x86_64 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk + LDFLAGS += -arch x86_64 + else + CFLAGS += -pipe -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk + LDFLAGS += -arch i686 -read_only_relocs suppress + endif + endif +endif + +# set mupen64plus core API header path +ifneq ("$(APIDIR)","") + CFLAGS += "-I$(APIDIR)" +else + TRYDIR = ../../../mupen64plus-core/src/api + ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") + CFLAGS += -I$(TRYDIR) + else + TRYDIR = /usr/local/include/mupen64plus + ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") + CFLAGS += -I$(TRYDIR) + else + TRYDIR = /usr/include/mupen64plus + ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") + CFLAGS += -I$(TRYDIR) + else + $(error Mupen64Plus API header files not found! Use makefile parameter APIDIR to force a location.) + endif + endif + endif +endif + +# reduced compile output when running make without V=1 +ifneq ($(findstring $(MAKEFLAGS),s),s) +ifndef V + Q_CC = @echo ' CC '$@; + Q_CXX = @echo ' CXX '$@; + Q_LD = @echo ' LD '$@; +endif +endif + +# set base program pointers and flags +CC = $(CROSS_COMPILE)gcc +CXX = $(CROSS_COMPILE)g++ +RM ?= rm -f +INSTALL ?= install +MKDIR ?= mkdir -p +COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c +COMPILE.cc = $(Q_CXX)$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c +LINK.o = $(Q_LD)$(CXX) $(LDFLAGS) $(TARGET_ARCH) + +# set special flags for given Makefile parameters +ifeq ($(DEBUG),1) + CFLAGS += -g + INSTALL_STRIP_FLAG ?= +else + ifneq ($(OS),OSX) + INSTALL_STRIP_FLAG ?= -s + endif +endif + +# set installation options +ifeq ($(PREFIX),) + PREFIX := /usr/local +endif +ifeq ($(LIBDIR),) + LIBDIR := $(PREFIX)/lib +endif +ifeq ($(PLUGINDIR),) + PLUGINDIR := $(LIBDIR)/mupen64plus +endif + +SRCDIR = ../../src +OBJDIR = _obj$(POSTFIX) + +# list of source files to compile +SOURCE = \ + $(SRCDIR)/main.c \ + $(SRCDIR)/alist.c \ + $(SRCDIR)/cicx105.c \ + $(SRCDIR)/jpeg.c \ + $(SRCDIR)/ucode3.cpp \ + $(SRCDIR)/ucode2.cpp \ + $(SRCDIR)/ucode1.cpp \ + $(SRCDIR)/ucode3mp3.cpp + +# generate a list of object files build, make a temporary directory for them +OBJECTS := $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(filter %.c, $(SOURCE))) +OBJECTS += $(patsubst $(SRCDIR)/%.cpp, $(OBJDIR)/%.o, $(filter %.cpp, $(SOURCE))) +OBJDIRS = $(dir $(OBJECTS)) +$(shell $(MKDIR) $(OBJDIRS)) + +# build targets +TARGET = mupen64plus-rsp-hle$(POSTFIX).$(SO_EXTENSION) + +targets: + @echo "Mupen64Plus-rsp-hle makefile. " + @echo " Targets:" + @echo " all == Build Mupen64Plus rsp-hle plugin" + @echo " clean == remove object files" + @echo " rebuild == clean and re-build all" + @echo " install == Install Mupen64Plus rsp-hle plugin" + @echo " uninstall == Uninstall Mupen64Plus rsp-hle plugin" + @echo " Options:" + @echo " BITS=32 == build 32-bit binaries on 64-bit machine" + @echo " APIDIR=path == path to find Mupen64Plus Core headers" + @echo " OPTFLAGS=flag == compiler optimization (default: -O3)" + @echo " WARNFLAGS=flag == compiler warning levels (default: -Wall)" + @echo " PIC=(1|0) == Force enable/disable of position independent code" + @echo " POSTFIX=name == String added to the name of the the build (default: '')" + @echo " Install Options:" + @echo " PREFIX=path == install/uninstall prefix (default: /usr/local)" + @echo " LIBDIR=path == library prefix (default: PREFIX/lib)" + @echo " PLUGINDIR=path == path to install plugin libraries (default: LIBDIR/mupen64plus)" + @echo " DESTDIR=path == path to prepend to all installation paths (only for packagers)" + @echo " Debugging Options:" + @echo " DEBUG=1 == add debugging symbols" + @echo " LTO=1 == enable experimental build with link-time optimization" + @echo " V=1 == show verbose compiler output" + +all: $(TARGET) + +install: $(TARGET) + $(INSTALL) -d "$(DESTDIR)$(PLUGINDIR)" + $(INSTALL) -m 0644 $(INSTALL_STRIP_FLAG) $(TARGET) "$(DESTDIR)$(PLUGINDIR)" + +uninstall: + $(RM) "$(DESTDIR)$(PLUGINDIR)/$(TARGET)" + +clean: + $(RM) -r $(OBJDIR) $(TARGET) + +rebuild: clean all + +# build dependency files +CFLAGS += -MD +-include $(OBJECTS:.o=.d) + +CXXFLAGS += $(CFLAGS) +ifeq ($(LTO), 1) + CFLAGS += -flto + CXXFLAGS += -flto + LDFLAGS += -fuse-linker-plugin $(CXXFLAGS) +endif + +# standard build rules +$(OBJDIR)/%.o: $(SRCDIR)/%.c + $(COMPILE.c) -o $@ $< + +$(OBJDIR)/%.o: $(SRCDIR)/%.cpp + $(COMPILE.cc) -o $@ $< + +$(TARGET): $(OBJECTS) + $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@ + +.PHONY: all clean install uninstall targets diff --git a/libmupen64plus/mupen64plus-rsp-hle/src/alist.c b/libmupen64plus/mupen64plus-rsp-hle/src/alist.c new file mode 100644 index 0000000000..c1418939e2 --- /dev/null +++ b/libmupen64plus/mupen64plus-rsp-hle/src/alist.c @@ -0,0 +1,82 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-rsp-hle - alist.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2012 Bobby Smiles * + * Copyright (C) 2009 Richard Goedeken * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "hle.h" +#include "alist_internal.h" + +// FIXME: this decomposition into 3 ABI is not accurate, +// there are a least 9 or 10 different ABI, each with one or a few revisions +// for a total of almost 16 differents audio ucode. +// +// ABI2 in fact is a mix of at least 7 differents ABI which are mostly compatible +// but not totally, that's why there is a isZeldaABI/isMKABI workaround. +// +extern const acmd_callback_t ABI1[0x10]; +extern const acmd_callback_t ABI2[0x20]; +extern const acmd_callback_t ABI3[0x10]; + +/* local functions */ +static void alist_process(const acmd_callback_t abi[], unsigned int abi_size) +{ + u32 inst1, inst2; + unsigned int acmd; + const OSTask_t * const task = get_task(); + + const unsigned int *alist = (unsigned int*)(rsp.RDRAM + task->data_ptr); + const unsigned int * const alist_end = alist + (task->data_size >> 2); + + while (alist != alist_end) + { + inst1 = *(alist++); + inst2 = *(alist++); + + acmd = inst1 >> 24; + + if (acmd < abi_size) + { + (*abi[acmd])(inst1, inst2); + } + else + { + DebugMessage(M64MSG_WARNING, "Invalid ABI command %u", acmd); + } + } +} + +/* global functions */ +void alist_process_ABI1() +{ + alist_process(ABI1, 0x10); +} + +void alist_process_ABI2() +{ + alist_process(ABI2, 0x20); +} + +void alist_process_ABI3() +{ + alist_process(ABI3, 0x10); +} + + diff --git a/libmupen64plus/mupen64plus-rsp-hle/src/alist.h b/libmupen64plus/mupen64plus-rsp-hle/src/alist.h new file mode 100644 index 0000000000..43f9f04bcb --- /dev/null +++ b/libmupen64plus/mupen64plus-rsp-hle/src/alist.h @@ -0,0 +1,33 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-rsp-hle - alist.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef ALIST_H +#define ALIST_H + +void alist_process_ABI1(); +void alist_process_ABI2(); +void alist_process_ABI3(); + +// FIXME: to remove when isZeldaABI/isMKABI workaround is gone +void init_ucode2(); + +#endif + diff --git a/libmupen64plus/mupen64plus-rsp-hle/src/alist_internal.h b/libmupen64plus/mupen64plus-rsp-hle/src/alist_internal.h new file mode 100644 index 0000000000..ae39883b45 --- /dev/null +++ b/libmupen64plus/mupen64plus-rsp-hle/src/alist_internal.h @@ -0,0 +1,50 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-rsp-hle - alist_internal.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef ALIST_INTERNAL_H +#define ALIST_INTERNAL_H + +#include "hle.h" + +typedef void (*acmd_callback_t)(u32 inst1, u32 inst2); + +/* + * Audio flags + */ + +#define A_INIT 0x01 +#define A_CONTINUE 0x00 +#define A_LOOP 0x02 +#define A_OUT 0x02 +#define A_LEFT 0x02 +#define A_RIGHT 0x00 +#define A_VOL 0x04 +#define A_RATE 0x00 +#define A_AUX 0x08 +#define A_NOAUX 0x00 +#define A_MAIN 0x00 +#define A_MIX 0x10 + +extern u16 AudioInBuffer, AudioOutBuffer, AudioCount; +extern u16 AudioAuxA, AudioAuxC, AudioAuxE; +extern u32 loopval; // Value set by A_SETLOOP : Possible conflict with SETVOLUME??? + +#endif diff --git a/libmupen64plus/mupen64plus-rsp-hle/src/cicx105.c b/libmupen64plus/mupen64plus-rsp-hle/src/cicx105.c new file mode 100644 index 0000000000..1e89056915 --- /dev/null +++ b/libmupen64plus/mupen64plus-rsp-hle/src/cicx105.c @@ -0,0 +1,55 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-rsp-hle - cicx105.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2012 Bobby Smiles * + * Copyright (C) 2009 Richard Goedeken * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "hle.h" + +/** + * During IPL3 stage of CIC x105 games, the RSP performs some checks and transactions + * necessary for booting the game. + * + * We only implement the needed DMA transactions for booting. + * + * Found in Banjo-Tooie, Zelda, Perfect Dark, ...) + **/ +void cicx105_ucode() +{ + // memcpy is okay to use because access constrains are met (alignment, size) + unsigned int i; + unsigned char * dst = rsp.RDRAM + 0x2fb1f0; + unsigned char * src = rsp.IMEM + 0x120; + + /* dma_read(0x1120, 0x1e8, 0x1e8) */ + memcpy(rsp.IMEM + 0x120, rsp.RDRAM + 0x1e8, 0x1f0); + + /* dma_write(0x1120, 0x2fb1f0, 0xfe817000) */ + for (i = 0; i < 24; ++i) + { + memcpy(dst, src, 8); + dst += 0xff0; + src += 0x8; + + } +} + diff --git a/libmupen64plus/mupen64plus-rsp-hle/src/cicx105.h b/libmupen64plus/mupen64plus-rsp-hle/src/cicx105.h new file mode 100644 index 0000000000..fbfcfad0a7 --- /dev/null +++ b/libmupen64plus/mupen64plus-rsp-hle/src/cicx105.h @@ -0,0 +1,28 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-rsp-hle - cicx105.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef CICX105_H +#define CICX105_H + +void cicx105_ucode(); + +#endif + diff --git a/libmupen64plus/mupen64plus-rsp-hle/src/hle.h b/libmupen64plus/mupen64plus-rsp-hle/src/hle.h new file mode 100644 index 0000000000..ceb1eea007 --- /dev/null +++ b/libmupen64plus/mupen64plus-rsp-hle/src/hle.h @@ -0,0 +1,89 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-rsp-hle - hle.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef HLE_H +#define HLE_H + +#define M64P_PLUGIN_PROTOTYPES 1 +#include "m64p_plugin.h" + +#define RSP_HLE_VERSION 0x016305 +#define RSP_PLUGIN_API_VERSION 0x020000 + +#ifdef M64P_BIG_ENDIAN +#define S 0 +#define S16 0 +#define S8 0 +#else +#define S 1 +#define S16 2 +#define S8 3 +#endif + +// types +typedef unsigned char u8; +typedef unsigned short u16; +typedef unsigned int u32; +typedef unsigned long long u64; + +typedef signed char s8; +typedef signed short s16; +typedef signed int s32; +typedef signed long long s64; + +extern RSP_INFO rsp; + +typedef struct +{ + unsigned int type; + unsigned int flags; + + unsigned int ucode_boot; + unsigned int ucode_boot_size; + + unsigned int ucode; + unsigned int ucode_size; + + unsigned int ucode_data; + unsigned int ucode_data_size; + + unsigned int dram_stack; + unsigned int dram_stack_size; + + unsigned int output_buff; + unsigned int output_buff_size; + + unsigned int data_ptr; + unsigned int data_size; + + unsigned int yield_data_ptr; + unsigned int yield_data_size; +} OSTask_t; + +static inline const OSTask_t * const get_task() +{ + return (OSTask_t*)(rsp.DMEM + 0xfc0); +} + +void DebugMessage(int level, const char *message, ...); + +#endif + diff --git a/libmupen64plus/mupen64plus-rsp-hle/src/jpeg.c b/libmupen64plus/mupen64plus-rsp-hle/src/jpeg.c new file mode 100644 index 0000000000..28fcc8bdd9 --- /dev/null +++ b/libmupen64plus/mupen64plus-rsp-hle/src/jpeg.c @@ -0,0 +1,683 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-rsp-hle - jpeg.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2012 Bobby Smiles * + * Copyright (C) 2009 Richard Goedeken * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include + +#define M64P_PLUGIN_PROTOTYPES 1 +#include "m64p_types.h" +#include "m64p_plugin.h" +#include "hle.h" + +#define SUBBLOCK_SIZE 64 + +typedef void (*tile_line_emitter_t)(const int16_t *y, const int16_t *u, uint32_t address); +typedef void (*std_macroblock_decoder_t)(int16_t *macroblock, unsigned int subblock_count, const int16_t qtables[3][SUBBLOCK_SIZE]); + +/* rdram operations */ +// FIXME: these functions deserve their own module +static void rdram_read_many_u16(uint16_t *dst, uint32_t address, unsigned int count); +static void rdram_write_many_u16(const uint16_t *src, uint32_t address, unsigned int count); +static uint32_t rdram_read_u32(uint32_t address); +static void rdram_write_many_u32(const uint32_t *src, uint32_t address, unsigned int count); + +/* standard jpeg ucode decoder */ +static void jpeg_decode_std(const char * const version, const std_macroblock_decoder_t decode_mb, const tile_line_emitter_t emit_line); + +/* helper functions */ +static uint8_t clamp_u8(int16_t x); +static int16_t clamp_s12(int16_t x); +static int16_t clamp_s16(int32_t x); +static uint16_t clamp_RGBA_component(int16_t x); + +/* pixel conversion & foratting */ +static uint32_t GetUYVY(int16_t y1, int16_t y2, int16_t u, int16_t v); +static uint16_t GetRGBA(int16_t y, int16_t u, int16_t v); + +/* tile line emitters */ +static void EmitYUVTileLine(const int16_t *y, const int16_t *u, uint32_t address); +static void EmitRGBATileLine(const int16_t *y, const int16_t *u, uint32_t address); + +/* macroblocks operations */ +static void DecodeMacroblock1(int16_t *macroblock, int32_t *y_dc, int32_t *u_dc, int32_t *v_dc, const int16_t *qtable); +static void DecodeMacroblock2(int16_t *macroblock, unsigned int subblock_count, const int16_t qtables[3][SUBBLOCK_SIZE]); +static void DecodeMacroblock3(int16_t *macroblock, unsigned int subblock_count, const int16_t qtables[3][SUBBLOCK_SIZE]); +static void EmitTilesMode0(const tile_line_emitter_t emit_line, const int16_t *macroblock, uint32_t address); +static void EmitTilesMode2(const tile_line_emitter_t emit_line, const int16_t *macroblock, uint32_t address); + +/* subblocks operations */ +static void TransposeSubBlock(int16_t *dst, const int16_t *src); +static void ZigZagSubBlock(int16_t *dst, const int16_t *src); +static void ReorderSubBlock(int16_t *dst, const int16_t *src, const unsigned int *table); +static void MultSubBlocks(int16_t *dst, const int16_t *src1, const int16_t *src2, unsigned int shift); +static void ScaleSubBlock(int16_t *dst, const int16_t *src, int16_t scale); +static void RShiftSubBlock(int16_t *dst, const int16_t *src, unsigned int shift); +static void InverseDCT1D(const float * const x, float *dst, unsigned int stride); +static void InverseDCTSubBlock(int16_t *dst, const int16_t *src); +static void RescaleYSubBlock(int16_t *dst, const int16_t *src); +static void RescaleUVSubBlock(int16_t *dst, const int16_t *src); + +/* transposed dequantization table */ +static const int16_t DEFAULT_QTABLE[SUBBLOCK_SIZE] = +{ + 16, 12, 14, 14, 18, 24, 49, 72, + 11, 12, 13, 17, 22, 35, 64, 92, + 10, 14, 16, 22, 37, 55, 78, 95, + 16, 19, 24, 29, 56, 64, 87, 98, + 24, 26, 40, 51, 68, 81, 103, 112, + 40, 58, 57, 87, 109, 104, 121, 100, + 51, 60, 69, 80, 103, 113, 120, 103, + 61, 55, 56, 62, 77, 92, 101, 99 +}; + +/* zig-zag indices */ +static const unsigned int ZIGZAG_TABLE[SUBBLOCK_SIZE] = +{ + 0, 1, 5, 6, 14, 15, 27, 28, + 2, 4, 7, 13, 16, 26, 29, 42, + 3, 8, 12, 17, 25, 30, 41, 43, + 9, 11, 18, 24, 31, 40, 44, 53, + 10, 19, 23, 32, 39, 45, 52, 54, + 20, 22, 33, 38, 46, 51, 55, 60, + 21, 34, 37, 47, 50, 56, 59, 61, + 35, 36, 48, 49, 57, 58, 62, 63 +}; + +/* transposition indices */ +static const unsigned int TRANSPOSE_TABLE[SUBBLOCK_SIZE] = +{ + 0, 8, 16, 24, 32, 40, 48, 56, + 1, 9, 17, 25, 33, 41, 49, 57, + 2, 10, 18, 26, 34, 42, 50, 58, + 3, 11, 19, 27, 35, 43, 51, 59, + 4, 12, 20, 28, 36, 44, 52, 60, + 5, 13, 21, 29, 37, 45, 53, 61, + 6, 14, 22, 30, 38, 46, 54, 62, + 7, 15, 23, 31, 39, 47, 55, 63 +}; + + + +/* IDCT related constants + * Cn = alpha * cos(n * PI / 16) (alpha is chosen such as C4 = 1) */ +static const float IDCT_C3 = 1.175875602f; +static const float IDCT_C6 = 0.541196100f; +static const float IDCT_K[10] = +{ + 0.765366865f, /* C2-C6 */ + -1.847759065f, /* -C2-C6 */ + -0.390180644f, /* C5-C3 */ + -1.961570561f, /* -C5-C3 */ + 1.501321110f, /* C1+C3-C5-C7 */ + 2.053119869f, /* C1+C3-C5+C7 */ + 3.072711027f, /* C1+C3+C5-C7 */ + 0.298631336f, /* -C1+C3+C5-C7 */ + -0.899976223f, /* C7-C3 */ + -2.562915448f /* -C1-C3 */ +}; + + +/* global functions */ + +/*************************************************************************** + * JPEG decoding ucode found in Japanese exclusive version of Pokemon Stadium. + **************************************************************************/ +void jpeg_decode_PS0() +{ + jpeg_decode_std("PS0", DecodeMacroblock3, EmitYUVTileLine); +} + +/*************************************************************************** + * JPEG decoding ucode found in Ocarina of Time, Pokemon Stadium 1 and + * Pokemon Stadium 2. + **************************************************************************/ +void jpeg_decode_PS() +{ + jpeg_decode_std("PS", DecodeMacroblock2, EmitRGBATileLine); +} + +/*************************************************************************** + * JPEG decoding ucode found in Ogre Battle and Bottom of the 9th. + **************************************************************************/ +void jpeg_decode_OB() +{ + int16_t qtable[SUBBLOCK_SIZE]; + unsigned int mb; + + int32_t y_dc = 0; + int32_t u_dc = 0; + int32_t v_dc = 0; + + const OSTask_t * const task = get_task(); + + uint32_t address = task->data_ptr; + const unsigned int macroblock_count = task->data_size; + const int qscale = task->yield_data_size; + + DebugMessage(M64MSG_VERBOSE, "jpeg_decode_OB: *buffer=%x, #MB=%d, qscale=%d", + address, + macroblock_count, + qscale); + + if (qscale != 0) + { + if (qscale > 0) + { + ScaleSubBlock(qtable, DEFAULT_QTABLE, qscale); + } + else + { + RShiftSubBlock(qtable, DEFAULT_QTABLE, -qscale); + } + } + + for (mb = 0; mb < macroblock_count; ++mb) + { + int16_t macroblock[6*SUBBLOCK_SIZE]; + + rdram_read_many_u16((uint16_t*)macroblock, address, 6*SUBBLOCK_SIZE); + DecodeMacroblock1(macroblock, &y_dc, &u_dc, &v_dc, (qscale != 0) ? qtable : NULL); + EmitTilesMode2(EmitYUVTileLine, macroblock, address); + + address += (2*6*SUBBLOCK_SIZE); + } +} + + +/* local functions */ +static void jpeg_decode_std(const char * const version, const std_macroblock_decoder_t decode_mb, const tile_line_emitter_t emit_line) +{ + int16_t qtables[3][SUBBLOCK_SIZE]; + unsigned int mb; + uint32_t address; + uint32_t macroblock_count; + uint32_t mode; + uint32_t qtableY_ptr; + uint32_t qtableU_ptr; + uint32_t qtableV_ptr; + unsigned int subblock_count; + unsigned int macroblock_size; + int16_t *macroblock; + const OSTask_t * const task = get_task(); + + if (task->flags & 0x1) + { + DebugMessage(M64MSG_WARNING, "jpeg_decode_%s: task yielding not implemented", version); + return; + } + + address = rdram_read_u32(task->data_ptr); + macroblock_count = rdram_read_u32(task->data_ptr + 4); + mode = rdram_read_u32(task->data_ptr + 8); + qtableY_ptr = rdram_read_u32(task->data_ptr + 12); + qtableU_ptr = rdram_read_u32(task->data_ptr + 16); + qtableV_ptr = rdram_read_u32(task->data_ptr + 20); + + DebugMessage(M64MSG_VERBOSE, "jpeg_decode_%s: *buffer=%x, #MB=%d, mode=%d, *Qy=%x, *Qu=%x, *Qv=%x", + version, + address, + macroblock_count, + mode, + qtableY_ptr, + qtableU_ptr, + qtableV_ptr); + + if (mode != 0 && mode != 2) + { + DebugMessage(M64MSG_WARNING, "jpeg_decode_%s: invalid mode %d", version, mode); + return; + } + + subblock_count = mode + 4; + macroblock_size = 2*subblock_count*SUBBLOCK_SIZE; + + rdram_read_many_u16((uint16_t*)qtables[0], qtableY_ptr, SUBBLOCK_SIZE); + rdram_read_many_u16((uint16_t*)qtables[1], qtableU_ptr, SUBBLOCK_SIZE); + rdram_read_many_u16((uint16_t*)qtables[2], qtableV_ptr, SUBBLOCK_SIZE); + + macroblock = malloc(sizeof(*macroblock) * macroblock_size); + if (!macroblock) + { + DebugMessage(M64MSG_WARNING, "jpeg_decode_%s: could not allocate macroblock", version); + return; + } + + for (mb = 0; mb < macroblock_count; ++mb) + { + rdram_read_many_u16((uint16_t*)macroblock, address, macroblock_size >> 1); + decode_mb(macroblock, subblock_count, (const int16_t (*)[SUBBLOCK_SIZE])qtables); + + if (mode == 0) + { + EmitTilesMode0(emit_line, macroblock, address); + } + else + { + EmitTilesMode2(emit_line, macroblock, address); + } + + address += macroblock_size; + } + free(macroblock); +} + +static uint8_t clamp_u8(int16_t x) +{ + return (x & (0xff00)) ? ((-x) >> 15) & 0xff : x; +} + +static int16_t clamp_s12(int16_t x) +{ + if (x < -0x800) { x = -0x800; } else if (x > 0x7f0) { x = 0x7f0; } + return x; +} + +static int16_t clamp_s16(int32_t x) +{ + if (x > 32767) { x = 32767; } else if (x < -32768) { x = -32768; } + return x; +} + +static uint16_t clamp_RGBA_component(int16_t x) +{ + if (x > 0xff0) { x = 0xff0; } else if (x < 0) { x = 0; } + return (x & 0xf80); +} + +static uint32_t GetUYVY(int16_t y1, int16_t y2, int16_t u, int16_t v) +{ + return (uint32_t)clamp_u8(u) << 24 + | (uint32_t)clamp_u8(y1) << 16 + | (uint32_t)clamp_u8(v) << 8 + | (uint32_t)clamp_u8(y2); +} + +static uint16_t GetRGBA(int16_t y, int16_t u, int16_t v) +{ + const float fY = (float)y + 2048.0f; + const float fU = (float)u; + const float fV = (float)v; + + const uint16_t r = clamp_RGBA_component((int16_t)(fY + 1.4025*fV)); + const uint16_t g = clamp_RGBA_component((int16_t)(fY - 0.3443*fU - 0.7144*fV)); + const uint16_t b = clamp_RGBA_component((int16_t)(fY + 1.7729*fU )); + + return (r << 4) | (g >> 1) | (b >> 6) | 1; +} + +static void EmitYUVTileLine(const int16_t *y, const int16_t *u, uint32_t address) +{ + uint32_t uyvy[8]; + + const int16_t * const v = u + SUBBLOCK_SIZE; + const int16_t * const y2 = y + SUBBLOCK_SIZE; + + uyvy[0] = GetUYVY(y[0], y[1], u[0], v[0]); + uyvy[1] = GetUYVY(y[2], y[3], u[1], v[1]); + uyvy[2] = GetUYVY(y[4], y[5], u[2], v[2]); + uyvy[3] = GetUYVY(y[6], y[7], u[3], v[3]); + uyvy[4] = GetUYVY(y2[0], y2[1], u[4], v[4]); + uyvy[5] = GetUYVY(y2[2], y2[3], u[5], v[5]); + uyvy[6] = GetUYVY(y2[4], y2[5], u[6], v[6]); + uyvy[7] = GetUYVY(y2[6], y2[7], u[7], v[7]); + + rdram_write_many_u32(uyvy, address, 8); +} + +static void EmitRGBATileLine(const int16_t *y, const int16_t *u, uint32_t address) +{ + uint16_t rgba[16]; + + const int16_t * const v = u + SUBBLOCK_SIZE; + const int16_t * const y2 = y + SUBBLOCK_SIZE; + + rgba[0] = GetRGBA(y[0], u[0], v[0]); + rgba[1] = GetRGBA(y[1], u[0], v[0]); + rgba[2] = GetRGBA(y[2], u[1], v[1]); + rgba[3] = GetRGBA(y[3], u[1], v[1]); + rgba[4] = GetRGBA(y[4], u[2], v[2]); + rgba[5] = GetRGBA(y[5], u[2], v[2]); + rgba[6] = GetRGBA(y[6], u[3], v[3]); + rgba[7] = GetRGBA(y[7], u[3], v[3]); + rgba[8] = GetRGBA(y2[0], u[4], v[4]); + rgba[9] = GetRGBA(y2[1], u[4], v[4]); + rgba[10] = GetRGBA(y2[2], u[5], v[5]); + rgba[11] = GetRGBA(y2[3], u[5], v[5]); + rgba[12] = GetRGBA(y2[4], u[6], v[6]); + rgba[13] = GetRGBA(y2[5], u[6], v[6]); + rgba[14] = GetRGBA(y2[6], u[7], v[7]); + rgba[15] = GetRGBA(y2[7], u[7], v[7]); + + rdram_write_many_u16(rgba, address, 16); +} + +static void EmitTilesMode0(const tile_line_emitter_t emit_line, const int16_t *macroblock, uint32_t address) +{ + unsigned int i; + + unsigned int y_offset = 0; + unsigned int u_offset = 2*SUBBLOCK_SIZE; + + for (i = 0; i < 8; ++i) + { + emit_line(¯oblock[y_offset], ¯oblock[u_offset], address); + + y_offset += 8; + u_offset += 8; + address += 32; + } +} + +static void EmitTilesMode2(const tile_line_emitter_t emit_line, const int16_t *macroblock, uint32_t address) +{ + unsigned int i; + + unsigned int y_offset = 0; + unsigned int u_offset = 4*SUBBLOCK_SIZE; + + for (i = 0; i < 8; ++i) + { + emit_line(¯oblock[y_offset], ¯oblock[u_offset], address); + emit_line(¯oblock[y_offset + 8], ¯oblock[u_offset], address + 32); + + y_offset += (i == 3) ? SUBBLOCK_SIZE+16 : 16; + u_offset += 8; + address += 64; + } +} + +static void DecodeMacroblock1(int16_t *macroblock, int32_t *y_dc, int32_t *u_dc, int32_t *v_dc, const int16_t *qtable) +{ + int sb; + + for (sb = 0; sb < 6; ++sb) + { + int16_t tmp_sb[SUBBLOCK_SIZE]; + + /* update DC */ + int32_t dc = (int32_t)macroblock[0]; + switch(sb) + { + case 0: case 1: case 2: case 3: + *y_dc += dc; macroblock[0] = *y_dc & 0xffff; break; + case 4: *u_dc += dc; macroblock[0] = *u_dc & 0xffff; break; + case 5: *v_dc += dc; macroblock[0] = *v_dc & 0xffff; break; + } + + ZigZagSubBlock(tmp_sb, macroblock); + if (qtable != NULL) { MultSubBlocks(tmp_sb, tmp_sb, qtable, 0); } + TransposeSubBlock(macroblock, tmp_sb); + InverseDCTSubBlock(macroblock, macroblock); + + macroblock += SUBBLOCK_SIZE; + } +} + +static void DecodeMacroblock2(int16_t *macroblock, unsigned int subblock_count, const int16_t qtables[3][SUBBLOCK_SIZE]) +{ + unsigned int sb; + unsigned int q = 0; + + for (sb = 0; sb < subblock_count; ++sb) + { + int16_t tmp_sb[SUBBLOCK_SIZE]; + const int isChromaSubBlock = (subblock_count - sb <= 2); + + if (isChromaSubBlock) { ++q; } + + MultSubBlocks(macroblock, macroblock, qtables[q], 4); + ZigZagSubBlock(tmp_sb, macroblock); + InverseDCTSubBlock(macroblock, tmp_sb); + + macroblock += SUBBLOCK_SIZE; + } + +} + +static void DecodeMacroblock3(int16_t *macroblock, unsigned int subblock_count, const int16_t qtables[3][SUBBLOCK_SIZE]) +{ + unsigned int sb; + unsigned int q = 0; + + for (sb = 0; sb < subblock_count; ++sb) + { + int16_t tmp_sb[SUBBLOCK_SIZE]; + const int isChromaSubBlock = (subblock_count - sb <= 2); + + if (isChromaSubBlock) { ++q; } + + MultSubBlocks(macroblock, macroblock, qtables[q], 4); + ZigZagSubBlock(tmp_sb, macroblock); + InverseDCTSubBlock(macroblock, tmp_sb); + + if (isChromaSubBlock) + { + RescaleUVSubBlock(macroblock, macroblock); + } + else + { + RescaleYSubBlock(macroblock, macroblock); + } + + macroblock += SUBBLOCK_SIZE; + } +} + +static void TransposeSubBlock(int16_t *dst, const int16_t *src) +{ + ReorderSubBlock(dst, src, TRANSPOSE_TABLE); +} + +static void ZigZagSubBlock(int16_t *dst, const int16_t *src) +{ + ReorderSubBlock(dst, src, ZIGZAG_TABLE); +} + +static void ReorderSubBlock(int16_t *dst, const int16_t *src, const unsigned int *table) +{ + unsigned int i; + + /* source and destination sublocks cannot overlap */ + assert(abs(dst - src) > SUBBLOCK_SIZE); + + for (i = 0; i < SUBBLOCK_SIZE; ++i) + { + dst[i] = src[table[i]]; + } +} + +static void MultSubBlocks(int16_t *dst, const int16_t *src1, const int16_t *src2, unsigned int shift) +{ + unsigned int i; + + for (i = 0; i < SUBBLOCK_SIZE; ++i) + { + int32_t v = src1[i] * src2[i]; + dst[i] = clamp_s16(v) << shift; + } +} + +static void ScaleSubBlock(int16_t *dst, const int16_t *src, int16_t scale) +{ + unsigned int i; + + for (i = 0; i < SUBBLOCK_SIZE; ++i) + { + int32_t v = src[i] * scale; + dst[i] = clamp_s16(v); + } +} + +static void RShiftSubBlock(int16_t *dst, const int16_t *src, unsigned int shift) +{ + unsigned int i; + + for (i = 0; i < SUBBLOCK_SIZE; ++i) + { + dst[i] = src[i] >> shift; + } +} + +/*************************************************************************** + * Fast 2D IDCT using separable formulation and normalization + * Computations use single precision floats + * Implementation based on Wikipedia : + * http://fr.wikipedia.org/wiki/Transform%C3%A9e_en_cosinus_discr%C3%A8te + **************************************************************************/ +static void InverseDCT1D(const float * const x, float *dst, unsigned int stride) +{ + float e[4]; + float f[4]; + float x26, x1357, x15, x37, x17, x35; + + x15 = IDCT_K[2] * (x[1] + x[5]); + x37 = IDCT_K[3] * (x[3] + x[7]); + x17 = IDCT_K[8] * (x[1] + x[7]); + x35 = IDCT_K[9] * (x[3] + x[5]); + x1357 = IDCT_C3 * (x[1] + x[3] + x[5] + x[7]); + x26 = IDCT_C6 * (x[2] + x[6]); + + f[0] = x[0] + x[4]; + f[1] = x[0] - x[4]; + f[2] = x26 + IDCT_K[0]*x[2]; + f[3] = x26 + IDCT_K[1]*x[6]; + + e[0] = x1357 + x15 + IDCT_K[4]*x[1] + x17; + e[1] = x1357 + x37 + IDCT_K[6]*x[3] + x35; + e[2] = x1357 + x15 + IDCT_K[5]*x[5] + x35; + e[3] = x1357 + x37 + IDCT_K[7]*x[7] + x17; + + *dst = f[0] + f[2] + e[0]; dst += stride; + *dst = f[1] + f[3] + e[1]; dst += stride; + *dst = f[1] - f[3] + e[2]; dst += stride; + *dst = f[0] - f[2] + e[3]; dst += stride; + *dst = f[0] - f[2] - e[3]; dst += stride; + *dst = f[1] - f[3] - e[2]; dst += stride; + *dst = f[1] + f[3] - e[1]; dst += stride; + *dst = f[0] + f[2] - e[0]; dst += stride; +} + +static void InverseDCTSubBlock(int16_t *dst, const int16_t *src) +{ + float x[8]; + float block[SUBBLOCK_SIZE]; + unsigned int i, j; + + /* idct 1d on rows (+transposition) */ + for (i = 0; i < 8; ++i) + { + for (j = 0; j < 8; ++j) + { + x[j] = (float)src[i*8+j]; + } + + InverseDCT1D(x, &block[i], 8); + } + + /* idct 1d on columns (thanks to previous transposition) */ + for (i = 0; i < 8; ++i) + { + InverseDCT1D(&block[i*8], x, 1); + + /* C4 = 1 normalization implies a division by 8 */ + for (j = 0; j < 8; ++j) + { + dst[i+j*8] = (int16_t)x[j] >> 3; + } + } +} + +static void RescaleYSubBlock(int16_t *dst, const int16_t *src) +{ + unsigned int i; + + for (i = 0; i < SUBBLOCK_SIZE; ++i) + { + dst[i] = (((uint32_t)(clamp_s12(src[i]) + 0x800) * 0xdb0) >> 16) + 0x10; + } +} + +static void RescaleUVSubBlock(int16_t *dst, const int16_t *src) +{ + unsigned int i; + + for (i = 0; i < SUBBLOCK_SIZE; ++i) + { + dst[i] = (((int)clamp_s12(src[i]) * 0xe00) >> 16) + 0x80; + } +} + + + +/* FIXME: assume presence of expansion pack */ +#define MEMMASK 0x7fffff + +static void rdram_read_many_u16(uint16_t *dst, uint32_t address, unsigned int count) +{ + while (count != 0) + { + uint16_t s = rsp.RDRAM[((address++)^S8) & MEMMASK]; + s <<= 8; + s |= rsp.RDRAM[((address++)^S8) & MEMMASK]; + + *(dst++) = s; + + --count; + } +} + +static void rdram_write_many_u16(const uint16_t *src, uint32_t address, unsigned int count) +{ + while (count != 0) + { + rsp.RDRAM[((address++)^S8) & MEMMASK] = (uint8_t)(*src >> 8); + rsp.RDRAM[((address++)^S8) & MEMMASK] = (uint8_t)(*(src++) & 0xff); + + --count; + } +} + +static uint32_t rdram_read_u32(uint32_t address) +{ + uint32_t r = rsp.RDRAM[((address++) ^ S8) & MEMMASK]; r <<= 8; + r |= rsp.RDRAM[((address++) ^ S8) & MEMMASK]; r <<= 8; + r |= rsp.RDRAM[((address++) ^ S8) & MEMMASK]; r <<= 8; + r |= rsp.RDRAM[((address++) ^ S8) & MEMMASK]; + + return r; +} + +static void rdram_write_many_u32(const uint32_t *src, uint32_t address, unsigned int count) +{ + while (count != 0) + { + rsp.RDRAM[((address++)^S8) & MEMMASK] = (uint8_t)(*src >> 24); + rsp.RDRAM[((address++)^S8) & MEMMASK] = (uint8_t)(*src >> 16); + rsp.RDRAM[((address++)^S8) & MEMMASK] = (uint8_t)(*src >> 8); + rsp.RDRAM[((address++)^S8) & MEMMASK] = (uint8_t)(*(src++) & 0xff); + + --count; + } +} + diff --git a/libmupen64plus/mupen64plus-rsp-hle/src/jpeg.h b/libmupen64plus/mupen64plus-rsp-hle/src/jpeg.h new file mode 100644 index 0000000000..b7deaf6cc4 --- /dev/null +++ b/libmupen64plus/mupen64plus-rsp-hle/src/jpeg.h @@ -0,0 +1,30 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-rsp-hle - jpeg.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef JPEG_H +#define JPEG_H + +void jpeg_decode_PS0(); +void jpeg_decode_PS(); +void jpeg_decode_OB(); + +#endif + diff --git a/libmupen64plus/mupen64plus-rsp-hle/src/main.c b/libmupen64plus/mupen64plus-rsp-hle/src/main.c new file mode 100644 index 0000000000..ff6525aefa --- /dev/null +++ b/libmupen64plus/mupen64plus-rsp-hle/src/main.c @@ -0,0 +1,476 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-rsp-hle - main.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2012 Bobby Smiles * + * Copyright (C) 2009 Richard Goedeken * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include + +#define M64P_PLUGIN_PROTOTYPES 1 +#include "m64p_types.h" +#include "m64p_common.h" +#include "m64p_plugin.h" +#include "hle.h" +#include "alist.h" +#include "cicx105.h" +#include "jpeg.h" + +#define min(a,b) (((a) < (b)) ? (a) : (b)) + +/* some rsp status flags */ +#define RSP_STATUS_HALT 0x1 +#define RSP_STATUS_BROKE 0x2 +#define RSP_STATUS_INTR_ON_BREAK 0x40 +#define RSP_STATUS_TASKDONE 0x200 + +/* some rdp status flags */ +#define DP_STATUS_FREEZE 0x2 + +/* some mips interface interrupt flags */ +#define MI_INTR_SP 0x1 + + +/* helper functions prototypes */ +static unsigned int sum_bytes(const unsigned char *bytes, unsigned int size); +static void dump_binary(const char * const filename, const unsigned char * const bytes, + unsigned int size); +static void dump_task(const char * const filename, const OSTask_t * const task); + +static void handle_unknown_task(unsigned int sum); +static void handle_unknown_non_task(unsigned int sum); + +/* global variables */ +RSP_INFO rsp; + +/* local variables */ +static const int FORWARD_AUDIO = 0, FORWARD_GFX = 1; +static void (*l_DebugCallback)(void *, int, const char *) = NULL; +static void *l_DebugCallContext = NULL; +static int l_PluginInit = 0; + +/* local functions */ + + +/** + * Try to figure if the RSP was launched using osSpTask* functions + * and not run directly (in which case DMEM[0xfc0-0xfff] is meaningless). + * + * Previously, the ucode_size field was used to determine this, + * but it is not robust enough (hi Pokemon Stadium !) because games could write anything + * in this field : most ucode_boot discard the value and just use 0xf7f anyway. + * + * Using ucode_boot_size should be more robust in this regard. + **/ +static int is_task() +{ + return (get_task()->ucode_boot_size <= 0x1000); +} + +static void rsp_break(unsigned int setbits) +{ + *rsp.SP_STATUS_REG |= setbits | RSP_STATUS_BROKE | RSP_STATUS_HALT; + + if ((*rsp.SP_STATUS_REG & RSP_STATUS_INTR_ON_BREAK)) + { + *rsp.MI_INTR_REG |= MI_INTR_SP; + rsp.CheckInterrupts(); + } +} + +static void forward_gfx_task() +{ + if (rsp.ProcessDlistList != NULL) + { + rsp.ProcessDlistList(); + *rsp.DPC_STATUS_REG &= ~DP_STATUS_FREEZE; + } +} + +static void forward_audio_task() +{ + if (rsp.ProcessAlistList != NULL) + { + rsp.ProcessAlistList(); + } +} + +static void show_cfb() +{ + if (rsp.ShowCFB != NULL) + { + rsp.ShowCFB(); + } +} + +static int try_fast_audio_dispatching() +{ + /* identify audio ucode by using the content of ucode_data */ + const OSTask_t * const task = get_task(); + const unsigned char * const udata_ptr = rsp.RDRAM + task->ucode_data; + + if (*(unsigned int*)(udata_ptr + 0) == 0x00000001) + { + if (*(unsigned int*)(udata_ptr + 0x30) == 0xf0000f00) + { + /** + * Many games including: + * Super Mario 64, Diddy Kong Racing, BlastCorp, GoldenEye, ... (most common) + **/ + alist_process_ABI1(); return 1; + } + else + { + /** + * Mario Kart / Wave Race, + * LylatWars, + * FZeroX, + * Yoshi Story, + * 1080 Snowboarding, + * Zelda Ocarina of Time, + * Zelda Majoras Mask / Pokemon Stadium 2, + * Animal Crossing + * + * FIXME: in fact, all these games do not share the same ABI. + * That's the reason of the workaround in ucode2.cpp with isZeldaABI and isMKABI + **/ + alist_process_ABI2(); return 1; + } + } + else + { + if (*(unsigned int*)(udata_ptr + 0x10) == 0x00000001) + { + /** + * Musyx ucode found in following games: + * RogueSquadron, ResidentEvil2, SnowCrossPolaris, TheWorldIsNotEnough, + * RugratsInParis, NBAShowTime, HydroThunder, Tarzan, + * GauntletLegend, Rush2049, IndianaJones, BattleForNaboo + * TODO: implement ucode + **/ + DebugMessage(M64MSG_WARNING, "MusyX ucode not implemented."); + /* return 1; */ + } + else + { + /** + * Many games including: + * Pokemon Stadium, Banjo Kazooie, Donkey Kong, Banjo Tooie, Jet Force Gemini, + * Mickey SpeedWay USA, Perfect Dark, Conker Bad Fur Day ... + **/ + alist_process_ABI3(); return 1; + } + } + + return 0; +} + +static int try_fast_task_dispatching() +{ + /* identify task ucode by its type */ + const OSTask_t * const task = get_task(); + + switch (task->type) + { + case 1: if (FORWARD_GFX) { forward_gfx_task(); return 1; } break; + + case 2: + if (FORWARD_AUDIO) { forward_audio_task(); return 1; } + else if (try_fast_audio_dispatching()) { return 1; } + break; + + case 7: show_cfb(); return 1; + } + + return 0; +} + +static void normal_task_dispatching() +{ + const OSTask_t * const task = get_task(); + const unsigned int sum = + sum_bytes(rsp.RDRAM + task->ucode, min(task->ucode_size, 0xf80) >> 1); + + switch (sum) + { + /* StoreVe12: found in Zelda Ocarina of Time [misleading task->type == 4] */ + case 0x278: /* Nothing to emulate */ return; + + /* GFX: Twintris [misleading task->type == 0] */ + case 0x212ee: + if (FORWARD_GFX) { forward_gfx_task(); return; } + break; + + /* JPEG: found in Pokemon Stadium J */ + case 0x2c85a: jpeg_decode_PS0(); return; + + /* JPEG: found in Zelda Ocarina of Time, Pokemon Stadium 1, Pokemon Stadium 2 */ + case 0x2caa6: jpeg_decode_PS(); return; + + /* JPEG: found in Ogre Battle, Bottom of the 9th */ + case 0x130de: jpeg_decode_OB(); return; + } + + handle_unknown_task(sum); +} + +static void non_task_dispatching() +{ + const unsigned int sum = sum_bytes(rsp.IMEM, 0x1000 >> 1); + + switch(sum) + { + /* CIC x105 ucode (used during boot of CIC x105 games) */ + case 0x9e2: /* CIC 6105 */ + case 0x9f2: /* CIC 7105 */ + cicx105_ucode(); return; + } + + handle_unknown_non_task(sum); +} + +static void handle_unknown_task(unsigned int sum) +{ + char filename[256]; + const OSTask_t * const task = get_task(); + + DebugMessage(M64MSG_WARNING, "unknown OSTask: sum %x PC:%x", sum, *rsp.SP_PC_REG); + + sprintf(&filename[0], "task_%x.log", sum); + dump_task(filename, task); + + // dump ucode_boot + sprintf(&filename[0], "ucode_boot_%x.bin", sum); + dump_binary(filename, rsp.RDRAM + (task->ucode_boot & 0x7fffff), task->ucode_boot_size); + + // dump ucode + if (task->ucode != 0) + { + sprintf(&filename[0], "ucode_%x.bin", sum); + dump_binary(filename, rsp.RDRAM + (task->ucode & 0x7fffff), 0xf80); + } + + // dump ucode_data + if (task->ucode_data != 0) + { + sprintf(&filename[0], "ucode_data_%x.bin", sum); + dump_binary(filename, rsp.RDRAM + (task->ucode_data & 0x7fffff), task->ucode_data_size); + } + + // dump data + if (task->data_ptr != 0) + { + sprintf(&filename[0], "data_%x.bin", sum); + dump_binary(filename, rsp.RDRAM + (task->data_ptr & 0x7fffff), task->data_size); + } +} + +static void handle_unknown_non_task(unsigned int sum) +{ + char filename[256]; + + DebugMessage(M64MSG_WARNING, "unknown RSP code: sum: %x PC:%x", sum, *rsp.SP_PC_REG); + + // dump IMEM & DMEM for further analysis + sprintf(&filename[0], "imem_%x.bin", sum); + dump_binary(filename, rsp.IMEM, 0x1000); + + sprintf(&filename[0], "dmem_%x.bin", sum); + dump_binary(filename, rsp.DMEM, 0x1000); +} + + +/* Global functions */ +void DebugMessage(int level, const char *message, ...) +{ + char msgbuf[1024]; + va_list args; + + if (l_DebugCallback == NULL) + return; + + va_start(args, message); + vsprintf(msgbuf, message, args); + + (*l_DebugCallback)(l_DebugCallContext, level, msgbuf); + + va_end(args); +} + +/* DLL-exported functions */ +EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle CoreLibHandle, void *Context, + void (*DebugCallback)(void *, int, const char *)) +{ + if (l_PluginInit) + return M64ERR_ALREADY_INIT; + + /* first thing is to set the callback function for debug info */ + l_DebugCallback = DebugCallback; + l_DebugCallContext = Context; + + /* this plugin doesn't use any Core library functions (ex for Configuration), so no need to keep the CoreLibHandle */ + + l_PluginInit = 1; + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL PluginShutdown(void) +{ + if (!l_PluginInit) + return M64ERR_NOT_INIT; + + /* reset some local variable */ + l_DebugCallback = NULL; + l_DebugCallContext = NULL; + + l_PluginInit = 0; + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL PluginGetVersion(m64p_plugin_type *PluginType, int *PluginVersion, int *APIVersion, const char **PluginNamePtr, int *Capabilities) +{ + /* set version info */ + if (PluginType != NULL) + *PluginType = M64PLUGIN_RSP; + + if (PluginVersion != NULL) + *PluginVersion = RSP_HLE_VERSION; + + if (APIVersion != NULL) + *APIVersion = RSP_PLUGIN_API_VERSION; + + if (PluginNamePtr != NULL) + *PluginNamePtr = "Hacktarux/Azimer High-Level Emulation RSP Plugin"; + + if (Capabilities != NULL) + { + *Capabilities = 0; + } + + return M64ERR_SUCCESS; +} + +EXPORT unsigned int CALL DoRspCycles(unsigned int Cycles) +{ + if (is_task()) + { + if (!try_fast_task_dispatching()) { normal_task_dispatching(); } + rsp_break(RSP_STATUS_TASKDONE); + } + else + { + non_task_dispatching(); + rsp_break(0); + } + + return Cycles; +} + +EXPORT void CALL InitiateRSP(RSP_INFO Rsp_Info, unsigned int *CycleCount) +{ + rsp = Rsp_Info; +} + +EXPORT void CALL RomClosed(void) +{ + memset(rsp.DMEM, 0, 0x1000); + memset(rsp.IMEM, 0, 0x1000); + + init_ucode2(); +} + + +/* local helper functions */ +static unsigned int sum_bytes(const unsigned char *bytes, unsigned int size) +{ + unsigned int sum = 0; + const unsigned char * const bytes_end = bytes + size; + + while (bytes != bytes_end) + sum += *bytes++; + + return sum; +} + + +static void dump_binary(const char * const filename, const unsigned char * const bytes, + unsigned int size) +{ + FILE *f; + + // if file already exists, do nothing + f = fopen(filename, "r"); + if (f == NULL) + { + // else we write bytes to the file + f= fopen(filename, "wb"); + if (f != NULL) { + if (fwrite(bytes, 1, size, f) != size) + { + DebugMessage(M64MSG_ERROR, "Writing error on %s", filename); + } + fclose(f); + } + else + { + DebugMessage(M64MSG_ERROR, "Couldn't open %s for writing !", filename); + } + } + else + { + fclose(f); + } +} + +static void dump_task(const char * const filename, const OSTask_t * const task) +{ + FILE *f; + + f = fopen(filename, "r"); + if (f == NULL) + { + f = fopen(filename, "w"); + fprintf(f, + "type = %d\n" + "flags = %d\n" + "ucode_boot = %#08x size = %#x\n" + "ucode = %#08x size = %#x\n" + "ucode_data = %#08x size = %#x\n" + "dram_stack = %#08x size = %#x\n" + "output_buff = %#08x *size = %#x\n" + "data = %#08x size = %#x\n" + "yield_data = %#08x size = %#x\n", + task->type, task->flags, + task->ucode_boot, task->ucode_boot_size, + task->ucode, task->ucode_size, + task->ucode_data, task->ucode_data_size, + task->dram_stack, task->dram_stack_size, + task->output_buff, task->output_buff_size, + task->data_ptr, task->data_size, + task->yield_data_ptr, task->yield_data_size); + fclose(f); + } + else + { + fclose(f); + } +} + diff --git a/libmupen64plus/mupen64plus-rsp-hle/src/rsp_api_export.ver b/libmupen64plus/mupen64plus-rsp-hle/src/rsp_api_export.ver new file mode 100644 index 0000000000..27e8138f95 --- /dev/null +++ b/libmupen64plus/mupen64plus-rsp-hle/src/rsp_api_export.ver @@ -0,0 +1,8 @@ +{ global: +PluginStartup; +PluginShutdown; +PluginGetVersion; +DoRspCycles; +InitiateRSP; +RomClosed; +local: *; }; diff --git a/libmupen64plus/mupen64plus-rsp-hle/src/ucode1.cpp b/libmupen64plus/mupen64plus-rsp-hle/src/ucode1.cpp new file mode 100644 index 0000000000..eb869cbb7b --- /dev/null +++ b/libmupen64plus/mupen64plus-rsp-hle/src/ucode1.cpp @@ -0,0 +1,951 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-rsp-hle - ucode1.cpp * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +# include + +extern "C" { + #include "hle.h" + #include "alist_internal.h" +} + +//#include "rsp.h" +//#define SAFE_MEMORY +/* +#ifndef SAFE_MEMORY +# define wr8 (src , address); +# define rd8 (dest, address); +# define wr16 (src, address); +# define rd16 (dest, address); +# define wr32 (src, address); +# define rd32 (dest, address); +# define wr64 (src, address); +# define rd64 (dest, address); +# define dmamem (dest, src, size) memcpy (dest, src, size); +# define clrmem (dest, size) memset (dest, 0, size); +#else + void wr8 (u8 src, void *address); + void rd8 (u8 dest, void *address); + void wr16 (u16 src, void *address); + void rd16 (u16 dest, void *address); + void wr32 (u16 src, void *address); + void rd32 (u16 dest, void *address); + void wr64 (u16 src, void *address); + void rd64 (u16 dest, void *address); + void dmamem (void *dest, void *src, int size); + void clrmem (void *dest, int size); +#endif +*/ +/******** DMEM Memory Map for ABI 1 *************** +Address/Range Description +------------- ------------------------------- +0x000..0x2BF UCodeData + 0x000-0x00F Constants - 0000 0001 0002 FFFF 0020 0800 7FFF 4000 + 0x010-0x02F Function Jump Table (16 Functions * 2 bytes each = 32) 0x20 + 0x030-0x03F Constants - F000 0F00 00F0 000F 0001 0010 0100 1000 + 0x040-0x03F Used by the Envelope Mixer (But what for?) + 0x070-0x07F Used by the Envelope Mixer (But what for?) +0x2C0..0x31F +0x320..0x35F Segments +0x360 Audio In Buffer (Location) +0x362 Audio Out Buffer (Location) +0x364 Audio Buffer Size (Location) +0x366 Initial Volume for Left Channel +0x368 Initial Volume for Right Channel +0x36A Auxillary Buffer #1 (Location) +0x36C Auxillary Buffer #2 (Location) +0x36E Auxillary Buffer #3 (Location) +0x370 Loop Value (shared location) +0x370 Target Volume (Left) +0x372 Ramp?? (Left) +0x374 Rate?? (Left) +0x376 Target Volume (Right) +0x378 Ramp?? (Right) +0x37A Rate?? (Right) +0x37C Dry?? +0x37E Wet?? +0x380..0x4BF Alist data +0x4C0..0x4FF ADPCM CodeBook +0x500..0x5BF +0x5C0..0xF7F Buffers... +0xF80..0xFFF +***************************************************/ +#ifdef USE_EXPANSION + #define MEMMASK 0x7FFFFF +#else + #define MEMMASK 0x3FFFFF +#endif + +static void SPNOOP (u32 inst1, u32 inst2) { + //MessageBox (NULL, "Unknown Audio Command in ABI 1", "Audio HLE Error", MB_OK); +} + +u32 SEGMENTS[0x10]; // 0x0320 +// T8 = 0x360 +u16 AudioInBuffer; // 0x0000(T8) +u16 AudioOutBuffer; // 0x0002(T8) +u16 AudioCount; // 0x0004(T8) +s16 Vol_Left; // 0x0006(T8) +s16 Vol_Right; // 0x0008(T8) +u16 AudioAuxA; // 0x000A(T8) +u16 AudioAuxC; // 0x000C(T8) +u16 AudioAuxE; // 0x000E(T8) +u32 loopval; // 0x0010(T8) // Value set by A_SETLOOP : Possible conflict with SETVOLUME??? +s16 VolTrg_Left; // 0x0010(T8) +s32 VolRamp_Left; // m_LeftVolTarget +//u16 VolRate_Left; // m_LeftVolRate +s16 VolTrg_Right; // m_RightVol +s32 VolRamp_Right; // m_RightVolTarget +//u16 VolRate_Right; // m_RightVolRate +s16 Env_Dry; // 0x001C(T8) +s16 Env_Wet; // 0x001E(T8) + +u8 BufferSpace[0x10000]; + +short hleMixerWorkArea[256]; +u16 adpcmtable[0x88]; + +extern const u16 ResampleLUT [0x200] = { + 0x0C39, 0x66AD, 0x0D46, 0xFFDF, 0x0B39, 0x6696, 0x0E5F, 0xFFD8, + 0x0A44, 0x6669, 0x0F83, 0xFFD0, 0x095A, 0x6626, 0x10B4, 0xFFC8, + 0x087D, 0x65CD, 0x11F0, 0xFFBF, 0x07AB, 0x655E, 0x1338, 0xFFB6, + 0x06E4, 0x64D9, 0x148C, 0xFFAC, 0x0628, 0x643F, 0x15EB, 0xFFA1, + 0x0577, 0x638F, 0x1756, 0xFF96, 0x04D1, 0x62CB, 0x18CB, 0xFF8A, + 0x0435, 0x61F3, 0x1A4C, 0xFF7E, 0x03A4, 0x6106, 0x1BD7, 0xFF71, + 0x031C, 0x6007, 0x1D6C, 0xFF64, 0x029F, 0x5EF5, 0x1F0B, 0xFF56, + 0x022A, 0x5DD0, 0x20B3, 0xFF48, 0x01BE, 0x5C9A, 0x2264, 0xFF3A, + 0x015B, 0x5B53, 0x241E, 0xFF2C, 0x0101, 0x59FC, 0x25E0, 0xFF1E, + 0x00AE, 0x5896, 0x27A9, 0xFF10, 0x0063, 0x5720, 0x297A, 0xFF02, + 0x001F, 0x559D, 0x2B50, 0xFEF4, 0xFFE2, 0x540D, 0x2D2C, 0xFEE8, + 0xFFAC, 0x5270, 0x2F0D, 0xFEDB, 0xFF7C, 0x50C7, 0x30F3, 0xFED0, + 0xFF53, 0x4F14, 0x32DC, 0xFEC6, 0xFF2E, 0x4D57, 0x34C8, 0xFEBD, + 0xFF0F, 0x4B91, 0x36B6, 0xFEB6, 0xFEF5, 0x49C2, 0x38A5, 0xFEB0, + 0xFEDF, 0x47ED, 0x3A95, 0xFEAC, 0xFECE, 0x4611, 0x3C85, 0xFEAB, + 0xFEC0, 0x4430, 0x3E74, 0xFEAC, 0xFEB6, 0x424A, 0x4060, 0xFEAF, + 0xFEAF, 0x4060, 0x424A, 0xFEB6, 0xFEAC, 0x3E74, 0x4430, 0xFEC0, + 0xFEAB, 0x3C85, 0x4611, 0xFECE, 0xFEAC, 0x3A95, 0x47ED, 0xFEDF, + 0xFEB0, 0x38A5, 0x49C2, 0xFEF5, 0xFEB6, 0x36B6, 0x4B91, 0xFF0F, + 0xFEBD, 0x34C8, 0x4D57, 0xFF2E, 0xFEC6, 0x32DC, 0x4F14, 0xFF53, + 0xFED0, 0x30F3, 0x50C7, 0xFF7C, 0xFEDB, 0x2F0D, 0x5270, 0xFFAC, + 0xFEE8, 0x2D2C, 0x540D, 0xFFE2, 0xFEF4, 0x2B50, 0x559D, 0x001F, + 0xFF02, 0x297A, 0x5720, 0x0063, 0xFF10, 0x27A9, 0x5896, 0x00AE, + 0xFF1E, 0x25E0, 0x59FC, 0x0101, 0xFF2C, 0x241E, 0x5B53, 0x015B, + 0xFF3A, 0x2264, 0x5C9A, 0x01BE, 0xFF48, 0x20B3, 0x5DD0, 0x022A, + 0xFF56, 0x1F0B, 0x5EF5, 0x029F, 0xFF64, 0x1D6C, 0x6007, 0x031C, + 0xFF71, 0x1BD7, 0x6106, 0x03A4, 0xFF7E, 0x1A4C, 0x61F3, 0x0435, + 0xFF8A, 0x18CB, 0x62CB, 0x04D1, 0xFF96, 0x1756, 0x638F, 0x0577, + 0xFFA1, 0x15EB, 0x643F, 0x0628, 0xFFAC, 0x148C, 0x64D9, 0x06E4, + 0xFFB6, 0x1338, 0x655E, 0x07AB, 0xFFBF, 0x11F0, 0x65CD, 0x087D, + 0xFFC8, 0x10B4, 0x6626, 0x095A, 0xFFD0, 0x0F83, 0x6669, 0x0A44, + 0xFFD8, 0x0E5F, 0x6696, 0x0B39, 0xFFDF, 0x0D46, 0x66AD, 0x0C39 +}; + +static void CLEARBUFF (u32 inst1, u32 inst2) { + u32 addr = (u32)(inst1 & 0xffff); + u32 count = (u32)(inst2 & 0xffff); + addr &= 0xFFFC; + memset(BufferSpace+addr, 0, (count+3)&0xFFFC); +} + +//FILE *dfile = fopen ("d:\\envmix.txt", "wt"); + +static void ENVMIXER (u32 inst1, u32 inst2) { + //static int envmixcnt = 0; + u8 flags = (u8)((inst1 >> 16) & 0xff); + u32 addy = (inst2 & 0xFFFFFF);// + SEGMENTS[(inst2>>24)&0xf]; + //static +// ********* Make sure these conditions are met... *********** + /*if ((AudioInBuffer | AudioOutBuffer | AudioAuxA | AudioAuxC | AudioAuxE | AudioCount) & 0x3) { + MessageBox (NULL, "Unaligned EnvMixer... please report this to Azimer with the following information: RomTitle, Place in the rom it occurred, and any save state just before the error", "AudioHLE Error", MB_OK); + }*/ +// ------------------------------------------------------------ + short *inp=(short *)(BufferSpace+AudioInBuffer); + short *out=(short *)(BufferSpace+AudioOutBuffer); + short *aux1=(short *)(BufferSpace+AudioAuxA); + short *aux2=(short *)(BufferSpace+AudioAuxC); + short *aux3=(short *)(BufferSpace+AudioAuxE); + s32 MainR; + s32 MainL; + s32 AuxR; + s32 AuxL; + int i1,o1,a1,a2=0,a3=0; + unsigned short AuxIncRate=1; + short zero[8]; + memset(zero,0,16); + s32 LVol, RVol; + s32 LAcc, RAcc; + s32 LTrg, RTrg; + s16 Wet, Dry; + u32 ptr = 0; + s32 RRamp, LRamp; + s32 LAdderStart, RAdderStart, LAdderEnd, RAdderEnd; + s32 oMainR, oMainL, oAuxR, oAuxL; + + //envmixcnt++; + + //fprintf (dfile, "\n----------------------------------------------------\n"); + if (flags & A_INIT) { + LVol = ((Vol_Left * (s32)VolRamp_Left)); + RVol = ((Vol_Right * (s32)VolRamp_Right)); + Wet = (s16)Env_Wet; Dry = (s16)Env_Dry; // Save Wet/Dry values + LTrg = (VolTrg_Left << 16); RTrg = (VolTrg_Right << 16); // Save Current Left/Right Targets + LAdderStart = Vol_Left << 16; + RAdderStart = Vol_Right << 16; + LAdderEnd = LVol; + RAdderEnd = RVol; + RRamp = VolRamp_Right; + LRamp = VolRamp_Left; + } else { + // Load LVol, RVol, LAcc, and RAcc (all 32bit) + // Load Wet, Dry, LTrg, RTrg + memcpy((u8 *)hleMixerWorkArea, (rsp.RDRAM+addy), 80); + Wet = *(s16 *)(hleMixerWorkArea + 0); // 0-1 + Dry = *(s16 *)(hleMixerWorkArea + 2); // 2-3 + LTrg = *(s32 *)(hleMixerWorkArea + 4); // 4-5 + RTrg = *(s32 *)(hleMixerWorkArea + 6); // 6-7 + LRamp= *(s32 *)(hleMixerWorkArea + 8); // 8-9 (hleMixerWorkArea is a 16bit pointer) + RRamp= *(s32 *)(hleMixerWorkArea + 10); // 10-11 + LAdderEnd = *(s32 *)(hleMixerWorkArea + 12); // 12-13 + RAdderEnd = *(s32 *)(hleMixerWorkArea + 14); // 14-15 + LAdderStart = *(s32 *)(hleMixerWorkArea + 16); // 12-13 + RAdderStart = *(s32 *)(hleMixerWorkArea + 18); // 14-15 + } + + if(!(flags&A_AUX)) { + AuxIncRate=0; + aux2=aux3=zero; + } + + oMainL = (Dry * (LTrg>>16) + 0x4000) >> 15; + oAuxL = (Wet * (LTrg>>16) + 0x4000) >> 15; + oMainR = (Dry * (RTrg>>16) + 0x4000) >> 15; + oAuxR = (Wet * (RTrg>>16) + 0x4000) >> 15; + + for (int y = 0; y < AudioCount; y += 0x10) { + + if (LAdderStart != LTrg) { + LAcc = LAdderStart; + LVol = (LAdderEnd - LAdderStart) >> 3; + LAdderEnd = (s32) (((s64)LAdderEnd * (s64)LRamp) >> 16); + LAdderStart = (s32) (((s64)LAcc * (s64)LRamp) >> 16); + } else { + LAcc = LTrg; + LVol = 0; + } + + if (RAdderStart != RTrg) { + RAcc = RAdderStart; + RVol = (RAdderEnd - RAdderStart) >> 3; + RAdderEnd = (s32) (((s64)RAdderEnd * (s64)RRamp) >> 16); + RAdderStart = (s32) (((s64)RAcc * (s64)RRamp) >> 16); + } else { + RAcc = RTrg; + RVol = 0; + } + + for (int x = 0; x < 8; x++) { + i1=(int)inp[ptr^S]; + o1=(int)out[ptr^S]; + a1=(int)aux1[ptr^S]; + if (AuxIncRate) { + a2=(int)aux2[ptr^S]; + a3=(int)aux3[ptr^S]; + } + // TODO: here... + //LAcc = LTrg; + //RAcc = RTrg; + + LAcc += LVol; + RAcc += RVol; + + if (LVol <= 0) { // Decrementing + if (LAcc < LTrg) { + LAcc = LTrg; + LAdderStart = LTrg; + MainL = oMainL; + AuxL = oAuxL; + } else { + MainL = (Dry * ((s32)LAcc>>16) + 0x4000) >> 15; + AuxL = (Wet * ((s32)LAcc>>16) + 0x4000) >> 15; + } + } else { + if (LAcc > LTrg) { + LAcc = LTrg; + LAdderStart = LTrg; + MainL = oMainL; + AuxL = oAuxL; + } else { + MainL = (Dry * ((s32)LAcc>>16) + 0x4000) >> 15; + AuxL = (Wet * ((s32)LAcc>>16) + 0x4000) >> 15; + } + } + + if (RVol <= 0) { // Decrementing + if (RAcc < RTrg) { + RAcc = RTrg; + RAdderStart = RTrg; + MainR = oMainR; + AuxR = oAuxR; + } else { + MainR = (Dry * ((s32)RAcc>>16) + 0x4000) >> 15; + AuxR = (Wet * ((s32)RAcc>>16) + 0x4000) >> 15; + } + } else { + if (RAcc > RTrg) { + RAcc = RTrg; + RAdderStart = RTrg; + MainR = oMainR; + AuxR = oAuxR; + } else { + MainR = (Dry * ((s32)RAcc>>16) + 0x4000) >> 15; + AuxR = (Wet * ((s32)RAcc>>16) + 0x4000) >> 15; + } + } + + //fprintf (dfile, "%04X ", (LAcc>>16)); + + /*MainL = (((s64)Dry*2 * (s64)(LAcc>>16)) + 0x8000) >> 16; + MainR = (((s64)Dry*2 * (s64)(RAcc>>16)) + 0x8000) >> 16; + AuxL = (((s64)Wet*2 * (s64)(LAcc>>16)) + 0x8000) >> 16; + AuxR = (((s64)Wet*2 * (s64)(RAcc>>16)) + 0x8000) >> 16;*/ +/* + if (MainL>32767) MainL = 32767; + else if (MainL<-32768) MainL = -32768; + if (MainR>32767) MainR = 32767; + else if (MainR<-32768) MainR = -32768; + if (AuxL>32767) AuxL = 32767; + else if (AuxL<-32768) AuxR = -32768; + if (AuxR>32767) AuxR = 32767; + else if (AuxR<-32768) AuxR = -32768;*/ + /* + MainR = (Dry * RTrg + 0x10000) >> 15; + MainL = (Dry * LTrg + 0x10000) >> 15; + AuxR = (Wet * RTrg + 0x8000) >> 16; + AuxL = (Wet * LTrg + 0x8000) >> 16;*/ + + o1+=(/*(o1*0x7fff)+*/(i1*MainR)+0x4000)>>15; + a1+=(/*(a1*0x7fff)+*/(i1*MainL)+0x4000)>>15; + +/* o1=((s64)(((s64)o1*0xfffe)+((s64)i1*MainR*2)+0x8000)>>16); + + a1=((s64)(((s64)a1*0xfffe)+((s64)i1*MainL*2)+0x8000)>>16);*/ + + if(o1>32767) o1=32767; + else if(o1<-32768) o1=-32768; + + if(a1>32767) a1=32767; + else if(a1<-32768) a1=-32768; + + out[ptr^S]=o1; + aux1[ptr^S]=a1; + if (AuxIncRate) { + //a2=((s64)(((s64)a2*0xfffe)+((s64)i1*AuxR*2)+0x8000)>>16); + + //a3=((s64)(((s64)a3*0xfffe)+((s64)i1*AuxL*2)+0x8000)>>16); + a2+=(/*(a2*0x7fff)+*/(i1*AuxR)+0x4000)>>15; + a3+=(/*(a3*0x7fff)+*/(i1*AuxL)+0x4000)>>15; + + if(a2>32767) a2=32767; + else if(a2<-32768) a2=-32768; + + if(a3>32767) a3=32767; + else if(a3<-32768) a3=-32768; + + aux2[ptr^S]=a2; + aux3[ptr^S]=a3; + } + ptr++; + } + } + + /*LAcc = LAdderEnd; + RAcc = RAdderEnd;*/ + + *(s16 *)(hleMixerWorkArea + 0) = Wet; // 0-1 + *(s16 *)(hleMixerWorkArea + 2) = Dry; // 2-3 + *(s32 *)(hleMixerWorkArea + 4) = LTrg; // 4-5 + *(s32 *)(hleMixerWorkArea + 6) = RTrg; // 6-7 + *(s32 *)(hleMixerWorkArea + 8) = LRamp; // 8-9 (hleMixerWorkArea is a 16bit pointer) + *(s32 *)(hleMixerWorkArea + 10) = RRamp; // 10-11 + *(s32 *)(hleMixerWorkArea + 12) = LAdderEnd; // 12-13 + *(s32 *)(hleMixerWorkArea + 14) = RAdderEnd; // 14-15 + *(s32 *)(hleMixerWorkArea + 16) = LAdderStart; // 12-13 + *(s32 *)(hleMixerWorkArea + 18) = RAdderStart; // 14-15 + memcpy(rsp.RDRAM+addy, (u8 *)hleMixerWorkArea,80); +} + +static void RESAMPLE (u32 inst1, u32 inst2) { + unsigned char Flags=(u8)((inst1>>16)&0xff); + unsigned int Pitch=((inst1&0xffff))<<1; + u32 addy = (inst2 & 0xffffff);// + SEGMENTS[(inst2>>24)&0xf]; + unsigned int Accum=0; + unsigned int location; + s16 *lut/*, *lut2*/; + short *dst; + s16 *src; + dst=(short *)(BufferSpace); + src=(s16 *)(BufferSpace); + u32 srcPtr=(AudioInBuffer/2); + u32 dstPtr=(AudioOutBuffer/2); + s32 temp; + s32 accum; +/* + if (addy > (1024*1024*8)) + addy = (inst2 & 0xffffff); +*/ + srcPtr -= 4; + + if ((Flags & 0x1) == 0) { + //memcpy (src+srcPtr, rsp.RDRAM+addy, 0x8); + for (int x=0; x < 4; x++) + src[(srcPtr+x)^S] = ((u16 *)rsp.RDRAM)[((addy/2)+x)^S]; + Accum = *(u16 *)(rsp.RDRAM+addy+10); + } else { + for (int x=0; x < 4; x++) + src[(srcPtr+x)^S] = 0;//*(u16 *)(rsp.RDRAM+((addy+x)^2)); + } + + for(int i=0;i < ((AudioCount+0xf)&0xFFF0)/2;i++) { + //location = (((Accum * 0x40) >> 0x10) * 8); + // location is the fractional position between two samples + location = (Accum >> 0xa) * 4; + lut = (s16*)ResampleLUT + location; + + // mov eax, dword ptr [src+srcPtr]; + // movsx edx, word ptr [lut]; + // shl edx, 1 + // imul edx + // test eax, 08000h + // setz ecx + // shl ecx, 16 + // xor eax, 08000h + // add eax, ecx + // and edx, 0f000h + + // imul + temp = ((s32)*(s16*)(src+((srcPtr+0)^S))*((s32)((s16)lut[0]))); + accum = (s32)(temp >> 15); + + temp = ((s32)*(s16*)(src+((srcPtr+1)^S))*((s32)((s16)lut[1]))); + accum += (s32)(temp >> 15); + + temp = ((s32)*(s16*)(src+((srcPtr+2)^S))*((s32)((s16)lut[2]))); + accum += (s32)(temp >> 15); + + temp = ((s32)*(s16*)(src+((srcPtr+3)^S))*((s32)((s16)lut[3]))); + accum += (s32)(temp >> 15); + + if (accum > 32767) accum = 32767; + if (accum < -32768) accum = -32768; + + dst[dstPtr^S] = (accum); + dstPtr++; + Accum += Pitch; + srcPtr += (Accum>>16); + Accum&=0xffff; + } + for (int x=0; x < 4; x++) + ((u16 *)rsp.RDRAM)[((addy/2)+x)^S] = src[(srcPtr+x)^S]; + //memcpy (RSWORK, src+srcPtr, 0x8); + *(u16 *)(rsp.RDRAM+addy+10) = Accum; +} + +static void SETVOL (u32 inst1, u32 inst2) { +// Might be better to unpack these depending on the flags... + u8 flags = (u8)((inst1 >> 16) & 0xff); + u16 vol = (s16)(inst1 & 0xffff); + //u16 voltarg =(u16)((inst2 >> 16)&0xffff); + u16 volrate = (u16)((inst2 & 0xffff)); + + if (flags & A_AUX) { + Env_Dry = (s16)vol; // m_MainVol + Env_Wet = (s16)volrate; // m_AuxVol + return; + } + + if(flags & A_VOL) { // Set the Source(start) Volumes + if(flags & A_LEFT) { + Vol_Left = (s16)vol; // m_LeftVolume + } else { // A_RIGHT + Vol_Right = (s16)vol; // m_RightVolume + } + return; + } + +//0x370 Loop Value (shared location) +//0x370 Target Volume (Left) +//u16 VolRamp_Left; // 0x0012(T8) + if(flags & A_LEFT) { // Set the Ramping values Target, Ramp + //loopval = (((u32)vol << 0x10) | (u32)voltarg); + VolTrg_Left = (s16)inst1; // m_LeftVol + //VolRamp_Left = (s32)inst2; + VolRamp_Left = (s32)inst2;//(u16)(inst2) | (s32)(s16)(inst2 << 0x10); + //fprintf (dfile, "Ramp Left: %f\n", (float)VolRamp_Left/65536.0); + //fprintf (dfile, "Ramp Left: %08X\n", inst2); + //VolRamp_Left = (s16)voltarg; // m_LeftVolTarget + //VolRate_Left = (s16)volrate; // m_LeftVolRate + } else { // A_RIGHT + VolTrg_Right = (s16)inst1; // m_RightVol + //VolRamp_Right = (s32)inst2; + VolRamp_Right = (s32)inst2;//(u16)(inst2 >> 0x10) | (s32)(s16)(inst2 << 0x10); + //fprintf (dfile, "Ramp Right: %f\n", (float)VolRamp_Right/65536.0); + //fprintf (dfile, "Ramp Right: %08X\n", inst2); + //VolRamp_Right = (s16)voltarg; // m_RightVolTarget + //VolRate_Right = (s16)volrate; // m_RightVolRate + } +} + +static void UNKNOWN (u32 inst1, u32 inst2) {} + +static void SETLOOP (u32 inst1, u32 inst2) { + loopval = (inst2 & 0xffffff);// + SEGMENTS[(inst2>>24)&0xf]; + //VolTrg_Left = (s16)(loopval>>16); // m_LeftVol + //VolRamp_Left = (s16)(loopval); // m_LeftVolTarget +} + +static void ADPCM (u32 inst1, u32 inst2) { // Work in progress! :) + unsigned char Flags=(u8)(inst1>>16)&0xff; + //unsigned short Gain=(u16)(inst1&0xffff); + unsigned int Address=(inst2 & 0xffffff);// + SEGMENTS[(inst2>>24)&0xf]; + unsigned short inPtr=0; + //short *out=(s16 *)(testbuff+(AudioOutBuffer>>2)); + short *out=(short *)(BufferSpace+AudioOutBuffer); + //unsigned char *in=(unsigned char *)(BufferSpace+AudioInBuffer); + short count=(short)AudioCount; + unsigned char icode; + unsigned char code; + int vscale; + unsigned short index; + unsigned short j; + int a[8]; + short *book1,*book2; +/* + if (Address > (1024*1024*8)) + Address = (inst2 & 0xffffff); +*/ + memset(out,0,32); + + if(!(Flags&0x1)) + { + if(Flags&0x2) { + memcpy(out,&rsp.RDRAM[loopval&MEMMASK],32); + } else { + memcpy(out,&rsp.RDRAM[Address],32); + } + } + + int l1=out[14^S]; + int l2=out[15^S]; + int inp1[8]; + int inp2[8]; + out+=16; + while(count>0) + { + // the first interation through, these values are + // either 0 in the case of A_INIT, from a special + // area of memory in the case of A_LOOP or just + // the values we calculated the last time + + code=BufferSpace[(AudioInBuffer+inPtr)^S8]; + index=code&0xf; + index<<=4; // index into the adpcm code table + book1=(short *)&adpcmtable[index]; + book2=book1+8; + code>>=4; // upper nibble is scale + vscale=(0x8000>>((12-code)-1)); // very strange. 0x8000 would be .5 in 16:16 format + // so this appears to be a fractional scale based + // on the 12 based inverse of the scale value. note + // that this could be negative, in which case we do + // not use the calculated vscale value... see the + // if(code>12) check below + + inPtr++; // coded adpcm data lies next + j=0; + while(j<8) // loop of 8, for 8 coded nibbles from 4 bytes + // which yields 8 short pcm values + { + icode=BufferSpace[(AudioInBuffer+inPtr)^S8]; + inPtr++; + + inp1[j]=(s16)((icode&0xf0)<<8); // this will in effect be signed + if(code<12) + inp1[j]=((int)((int)inp1[j]*(int)vscale)>>16); + /*else + int catchme=1;*/ + j++; + + inp1[j]=(s16)((icode&0xf)<<12); + if(code<12) + inp1[j]=((int)((int)inp1[j]*(int)vscale)>>16); + /*else + int catchme=1;*/ + j++; + } + j=0; + while(j<8) + { + icode=BufferSpace[(AudioInBuffer+inPtr)^S8]; + inPtr++; + + inp2[j]=(short)((icode&0xf0)<<8); // this will in effect be signed + if(code<12) + inp2[j]=((int)((int)inp2[j]*(int)vscale)>>16); + /*else + int catchme=1;*/ + j++; + + inp2[j]=(short)((icode&0xf)<<12); + if(code<12) + inp2[j]=((int)((int)inp2[j]*(int)vscale)>>16); + /*else + int catchme=1;*/ + j++; + } + + a[0]= (int)book1[0]*(int)l1; + a[0]+=(int)book2[0]*(int)l2; + a[0]+=(int)inp1[0]*(int)2048; + + a[1] =(int)book1[1]*(int)l1; + a[1]+=(int)book2[1]*(int)l2; + a[1]+=(int)book2[0]*inp1[0]; + a[1]+=(int)inp1[1]*(int)2048; + + a[2] =(int)book1[2]*(int)l1; + a[2]+=(int)book2[2]*(int)l2; + a[2]+=(int)book2[1]*inp1[0]; + a[2]+=(int)book2[0]*inp1[1]; + a[2]+=(int)inp1[2]*(int)2048; + + a[3] =(int)book1[3]*(int)l1; + a[3]+=(int)book2[3]*(int)l2; + a[3]+=(int)book2[2]*inp1[0]; + a[3]+=(int)book2[1]*inp1[1]; + a[3]+=(int)book2[0]*inp1[2]; + a[3]+=(int)inp1[3]*(int)2048; + + a[4] =(int)book1[4]*(int)l1; + a[4]+=(int)book2[4]*(int)l2; + a[4]+=(int)book2[3]*inp1[0]; + a[4]+=(int)book2[2]*inp1[1]; + a[4]+=(int)book2[1]*inp1[2]; + a[4]+=(int)book2[0]*inp1[3]; + a[4]+=(int)inp1[4]*(int)2048; + + a[5] =(int)book1[5]*(int)l1; + a[5]+=(int)book2[5]*(int)l2; + a[5]+=(int)book2[4]*inp1[0]; + a[5]+=(int)book2[3]*inp1[1]; + a[5]+=(int)book2[2]*inp1[2]; + a[5]+=(int)book2[1]*inp1[3]; + a[5]+=(int)book2[0]*inp1[4]; + a[5]+=(int)inp1[5]*(int)2048; + + a[6] =(int)book1[6]*(int)l1; + a[6]+=(int)book2[6]*(int)l2; + a[6]+=(int)book2[5]*inp1[0]; + a[6]+=(int)book2[4]*inp1[1]; + a[6]+=(int)book2[3]*inp1[2]; + a[6]+=(int)book2[2]*inp1[3]; + a[6]+=(int)book2[1]*inp1[4]; + a[6]+=(int)book2[0]*inp1[5]; + a[6]+=(int)inp1[6]*(int)2048; + + a[7] =(int)book1[7]*(int)l1; + a[7]+=(int)book2[7]*(int)l2; + a[7]+=(int)book2[6]*inp1[0]; + a[7]+=(int)book2[5]*inp1[1]; + a[7]+=(int)book2[4]*inp1[2]; + a[7]+=(int)book2[3]*inp1[3]; + a[7]+=(int)book2[2]*inp1[4]; + a[7]+=(int)book2[1]*inp1[5]; + a[7]+=(int)book2[0]*inp1[6]; + a[7]+=(int)inp1[7]*(int)2048; + + for(j=0;j<8;j++) + { + a[j^S]>>=11; + if(a[j^S]>32767) a[j^S]=32767; + else if(a[j^S]<-32768) a[j^S]=-32768; + *(out++)=a[j^S]; + } + l1=a[6]; + l2=a[7]; + + a[0]= (int)book1[0]*(int)l1; + a[0]+=(int)book2[0]*(int)l2; + a[0]+=(int)inp2[0]*(int)2048; + + a[1] =(int)book1[1]*(int)l1; + a[1]+=(int)book2[1]*(int)l2; + a[1]+=(int)book2[0]*inp2[0]; + a[1]+=(int)inp2[1]*(int)2048; + + a[2] =(int)book1[2]*(int)l1; + a[2]+=(int)book2[2]*(int)l2; + a[2]+=(int)book2[1]*inp2[0]; + a[2]+=(int)book2[0]*inp2[1]; + a[2]+=(int)inp2[2]*(int)2048; + + a[3] =(int)book1[3]*(int)l1; + a[3]+=(int)book2[3]*(int)l2; + a[3]+=(int)book2[2]*inp2[0]; + a[3]+=(int)book2[1]*inp2[1]; + a[3]+=(int)book2[0]*inp2[2]; + a[3]+=(int)inp2[3]*(int)2048; + + a[4] =(int)book1[4]*(int)l1; + a[4]+=(int)book2[4]*(int)l2; + a[4]+=(int)book2[3]*inp2[0]; + a[4]+=(int)book2[2]*inp2[1]; + a[4]+=(int)book2[1]*inp2[2]; + a[4]+=(int)book2[0]*inp2[3]; + a[4]+=(int)inp2[4]*(int)2048; + + a[5] =(int)book1[5]*(int)l1; + a[5]+=(int)book2[5]*(int)l2; + a[5]+=(int)book2[4]*inp2[0]; + a[5]+=(int)book2[3]*inp2[1]; + a[5]+=(int)book2[2]*inp2[2]; + a[5]+=(int)book2[1]*inp2[3]; + a[5]+=(int)book2[0]*inp2[4]; + a[5]+=(int)inp2[5]*(int)2048; + + a[6] =(int)book1[6]*(int)l1; + a[6]+=(int)book2[6]*(int)l2; + a[6]+=(int)book2[5]*inp2[0]; + a[6]+=(int)book2[4]*inp2[1]; + a[6]+=(int)book2[3]*inp2[2]; + a[6]+=(int)book2[2]*inp2[3]; + a[6]+=(int)book2[1]*inp2[4]; + a[6]+=(int)book2[0]*inp2[5]; + a[6]+=(int)inp2[6]*(int)2048; + + a[7] =(int)book1[7]*(int)l1; + a[7]+=(int)book2[7]*(int)l2; + a[7]+=(int)book2[6]*inp2[0]; + a[7]+=(int)book2[5]*inp2[1]; + a[7]+=(int)book2[4]*inp2[2]; + a[7]+=(int)book2[3]*inp2[3]; + a[7]+=(int)book2[2]*inp2[4]; + a[7]+=(int)book2[1]*inp2[5]; + a[7]+=(int)book2[0]*inp2[6]; + a[7]+=(int)inp2[7]*(int)2048; + + for(j=0;j<8;j++) + { + a[j^S]>>=11; + if(a[j^S]>32767) a[j^S]=32767; + else if(a[j^S]<-32768) a[j^S]=-32768; + *(out++)=a[j^S]; + } + l1=a[6]; + l2=a[7]; + + count-=32; + } + out-=16; + memcpy(&rsp.RDRAM[Address],out,32); +} + +static void LOADBUFF (u32 inst1, u32 inst2) { // memcpy causes static... endianess issue :( + u32 v0; + //u32 cnt; + if (AudioCount == 0) + return; + v0 = (inst2 & 0xfffffc);// + SEGMENTS[(inst2>>24)&0xf]; + memcpy (BufferSpace+(AudioInBuffer&0xFFFC), rsp.RDRAM+v0, (AudioCount+3)&0xFFFC); +} + +static void SAVEBUFF (u32 inst1, u32 inst2) { // memcpy causes static... endianess issue :( + u32 v0; + //u32 cnt; + if (AudioCount == 0) + return; + v0 = (inst2 & 0xfffffc);// + SEGMENTS[(inst2>>24)&0xf]; + memcpy (rsp.RDRAM+v0, BufferSpace+(AudioOutBuffer&0xFFFC), (AudioCount+3)&0xFFFC); +} + +static void SETBUFF (u32 inst1, u32 inst2) { // Should work ;-) + if ((inst1 >> 0x10) & 0x8) { // A_AUX - Auxillary Sound Buffer Settings + AudioAuxA = u16(inst1); + AudioAuxC = u16((inst2 >> 0x10)); + AudioAuxE = u16(inst2); + } else { // A_MAIN - Main Sound Buffer Settings + AudioInBuffer = u16(inst1); // 0x00 + AudioOutBuffer = u16((inst2 >> 0x10)); // 0x02 + AudioCount = u16(inst2); // 0x04 + } +} + +static void DMEMMOVE (u32 inst1, u32 inst2) { // Doesn't sound just right?... will fix when HLE is ready - 03-11-01 + u32 v0, v1; + u32 cnt; + if ((inst2 & 0xffff)==0) + return; + v0 = (inst1 & 0xFFFF); + v1 = (inst2 >> 0x10); + //assert ((v1 & 0x3) == 0); + //assert ((v0 & 0x3) == 0); + u32 count = ((inst2+3) & 0xfffc); + //v0 = (v0) & 0xfffc; + //v1 = (v1) & 0xfffc; + + //memcpy (BufferSpace+v1, BufferSpace+v0, count-1); + for (cnt = 0; cnt < count; cnt++) { + *(u8 *)(BufferSpace+((cnt+v1)^S8)) = *(u8 *)(BufferSpace+((cnt+v0)^S8)); + } +} + +static void LOADADPCM (u32 inst1, u32 inst2) { // Loads an ADPCM table - Works 100% Now 03-13-01 + u32 v0; + v0 = (inst2 & 0xffffff);// + SEGMENTS[(inst2>>24)&0xf]; +/* if (v0 > (1024*1024*8)) + v0 = (inst2 & 0xffffff);*/ + //memcpy (dmem+0x4c0, rsp.RDRAM+v0, inst1&0xffff); // Could prolly get away with not putting this in dmem + //assert ((inst1&0xffff) <= 0x80); + u16 *table = (u16 *)(rsp.RDRAM+v0); + for (u32 x = 0; x < ((inst1&0xffff)>>0x4); x++) { + adpcmtable[(0x0+(x<<3))^S] = table[0]; + adpcmtable[(0x1+(x<<3))^S] = table[1]; + + adpcmtable[(0x2+(x<<3))^S] = table[2]; + adpcmtable[(0x3+(x<<3))^S] = table[3]; + + adpcmtable[(0x4+(x<<3))^S] = table[4]; + adpcmtable[(0x5+(x<<3))^S] = table[5]; + + adpcmtable[(0x6+(x<<3))^S] = table[6]; + adpcmtable[(0x7+(x<<3))^S] = table[7]; + table += 8; + } +} + + +static void INTERLEAVE (u32 inst1, u32 inst2) { // Works... - 3-11-01 + u32 inL, inR; + u16 *outbuff = (u16 *)(AudioOutBuffer+BufferSpace); + u16 *inSrcR; + u16 *inSrcL; + u16 Left, Right, Left2, Right2; + + inL = inst2 & 0xFFFF; + inR = (inst2 >> 16) & 0xFFFF; + + inSrcR = (u16 *)(BufferSpace+inR); + inSrcL = (u16 *)(BufferSpace+inL); + + for (int x = 0; x < (AudioCount/4); x++) { + Left=*(inSrcL++); + Right=*(inSrcR++); + Left2=*(inSrcL++); + Right2=*(inSrcR++); + +#ifdef M64P_BIG_ENDIAN + *(outbuff++)=Right; + *(outbuff++)=Left; + *(outbuff++)=Right2; + *(outbuff++)=Left2; +#else + *(outbuff++)=Right2; + *(outbuff++)=Left2; + *(outbuff++)=Right; + *(outbuff++)=Left; +#endif + } +} + + +static void MIXER (u32 inst1, u32 inst2) { // Fixed a sign issue... 03-14-01 + u32 dmemin = (u16)(inst2 >> 0x10); + u32 dmemout = (u16)(inst2 & 0xFFFF); + //u8 flags = (u8)((inst1 >> 16) & 0xff); + s32 gain = (s16)(inst1 & 0xFFFF); + s32 temp; + + if (AudioCount == 0) + return; + + for (int x=0; x < AudioCount; x+=2) { // I think I can do this a lot easier + temp = (*(s16 *)(BufferSpace+dmemin+x) * gain) >> 15; + temp += *(s16 *)(BufferSpace+dmemout+x); + + if ((s32)temp > 32767) + temp = 32767; + if ((s32)temp < -32768) + temp = -32768; + + *(u16 *)(BufferSpace+dmemout+x) = (u16)(temp & 0xFFFF); + } +} + +// TOP Performance Hogs: +//Command: ADPCM - Calls: 48 - Total Time: 331226 - Avg Time: 6900.54 - Percent: 31.53% +//Command: ENVMIXER - Calls: 48 - Total Time: 408563 - Avg Time: 8511.73 - Percent: 38.90% +//Command: LOADBUFF - Calls: 56 - Total Time: 21551 - Avg Time: 384.84 - Percent: 2.05% +//Command: RESAMPLE - Calls: 48 - Total Time: 225922 - Avg Time: 4706.71 - Percent: 21.51% + +//Command: ADPCM - Calls: 48 - Total Time: 391600 - Avg Time: 8158.33 - Percent: 32.52% +//Command: ENVMIXER - Calls: 48 - Total Time: 444091 - Avg Time: 9251.90 - Percent: 36.88% +//Command: LOADBUFF - Calls: 58 - Total Time: 29945 - Avg Time: 516.29 - Percent: 2.49% +//Command: RESAMPLE - Calls: 48 - Total Time: 276354 - Avg Time: 5757.38 - Percent: 22.95% + + +extern "C" const acmd_callback_t ABI1[0x10] = { // TOP Performace Hogs: MIXER, RESAMPLE, ENVMIXER + SPNOOP , ADPCM , CLEARBUFF, ENVMIXER , LOADBUFF, RESAMPLE , SAVEBUFF, UNKNOWN, + SETBUFF, SETVOL, DMEMMOVE , LOADADPCM , MIXER , INTERLEAVE, UNKNOWN , SETLOOP +}; + +/* BACKUPS +void MIXER (u32 inst1, u32 inst2) { // Fixed a sign issue... 03-14-01 + u16 dmemin = (u16)(inst2 >> 0x10); + u16 dmemout = (u16)(inst2 & 0xFFFF); + u16 gain = (u16)(inst1 & 0xFFFF); + u8 flags = (u8)((inst1 >> 16) & 0xff); + u64 temp; + + if (AudioCount == 0) + return; + + for (int x=0; x < AudioCount; x+=2) { // I think I can do this a lot easier + temp = (s64)(*(s16 *)(BufferSpace+dmemout+x)) * (s64)((s16)(0x7FFF)*2); + + if (temp & 0x8000) + temp = (temp^0x8000) + 0x10000; + else + temp = (temp^0x8000); + + temp = (temp & 0xFFFFFFFFFFFF); + + temp += ((*(s16 *)(BufferSpace+dmemin+x) * (s64)((s16)gain*2))) & 0xFFFFFFFFFFFF; + + temp = (s32)(temp >> 16); + if ((s32)temp > 32767) + temp = 32767; + if ((s32)temp < -32768) + temp = -32768; + + *(u16 *)(BufferSpace+dmemout+x) = (u16)(temp & 0xFFFF); + } +} +*/ + + diff --git a/libmupen64plus/mupen64plus-rsp-hle/src/ucode2.cpp b/libmupen64plus/mupen64plus-rsp-hle/src/ucode2.cpp new file mode 100644 index 0000000000..dd15689fcb --- /dev/null +++ b/libmupen64plus/mupen64plus-rsp-hle/src/ucode2.cpp @@ -0,0 +1,930 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-rsp-hle - ucode2.cpp * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +# include +# include + +extern "C" { + #include "m64p_types.h" + #include "hle.h" + #include "alist_internal.h" +} + +extern u8 BufferSpace[0x10000]; + +static void SPNOOP (u32 inst1, u32 inst2) { + DebugMessage(M64MSG_ERROR, "Unknown/Unimplemented Audio Command %i in ABI 2", (int)(inst1 >> 24)); +} +extern u16 AudioInBuffer; // 0x0000(T8) +extern u16 AudioOutBuffer; // 0x0002(T8) +extern u16 AudioCount; // 0x0004(T8) +extern u32 loopval; // 0x0010(T8) +extern u32 SEGMENTS[0x10]; + +extern u16 adpcmtable[0x88]; + +extern const u16 ResampleLUT [0x200]; + +bool isMKABI = false; +bool isZeldaABI = false; + +extern "C" void init_ucode2() { isMKABI = isZeldaABI = false; } + +static void LOADADPCM2 (u32 inst1, u32 inst2) { // Loads an ADPCM table - Works 100% Now 03-13-01 + u32 v0; + v0 = (inst2 & 0xffffff);// + SEGMENTS[(inst2>>24)&0xf]; + u16 *table = (u16 *)(rsp.RDRAM+v0); // Zelda2 Specific... + + for (u32 x = 0; x < ((inst1&0xffff)>>0x4); x++) { + adpcmtable[(0x0+(x<<3))^S] = table[0]; + adpcmtable[(0x1+(x<<3))^S] = table[1]; + + adpcmtable[(0x2+(x<<3))^S] = table[2]; + adpcmtable[(0x3+(x<<3))^S] = table[3]; + + adpcmtable[(0x4+(x<<3))^S] = table[4]; + adpcmtable[(0x5+(x<<3))^S] = table[5]; + + adpcmtable[(0x6+(x<<3))^S] = table[6]; + adpcmtable[(0x7+(x<<3))^S] = table[7]; + table += 8; + } +} + +static void SETLOOP2 (u32 inst1, u32 inst2) { + loopval = inst2 & 0xffffff; // No segment? +} + +static void SETBUFF2 (u32 inst1, u32 inst2) { + AudioInBuffer = u16(inst1); // 0x00 + AudioOutBuffer = u16((inst2 >> 0x10)); // 0x02 + AudioCount = u16(inst2); // 0x04 +} + +static void ADPCM2 (u32 inst1, u32 inst2) { // Verified to be 100% Accurate... + unsigned char Flags=(u8)(inst1>>16)&0xff; + //unsigned short Gain=(u16)(inst1&0xffff); + unsigned int Address=(inst2 & 0xffffff);// + SEGMENTS[(inst2>>24)&0xf]; + unsigned short inPtr=0; + //short *out=(s16 *)(testbuff+(AudioOutBuffer>>2)); + short *out=(short *)(BufferSpace+AudioOutBuffer); + //unsigned char *in=(unsigned char *)(BufferSpace+AudioInBuffer); + short count=(short)AudioCount; + unsigned char icode; + unsigned char code; + int vscale; + unsigned short index; + unsigned short j; + int a[8]; + short *book1,*book2; + + u8 srange; + u8 mask1; + u8 mask2; + u8 shifter; + + memset(out,0,32); + + if (Flags & 0x4) { // Tricky lil Zelda MM and ABI2!!! hahaha I know your secrets! :DDD + srange = 0xE; + mask1 = 0xC0; + mask2 = 0x30; + shifter = 10; + } else { + srange = 0xC; + mask1 = 0xf0; + mask2 = 0x0f; + shifter = 12; + } + + if(!(Flags&0x1)) + { + if(Flags&0x2) + {/* + for(int i=0;i<16;i++) + { + out[i]=*(short *)&rsp.RDRAM[(loopval+i*2)^2]; + }*/ + memcpy(out,&rsp.RDRAM[loopval],32); + } + else + {/* + for(int i=0;i<16;i++) + { + out[i]=*(short *)&rsp.RDRAM[(Address+i*2)^2]; + }*/ + memcpy(out,&rsp.RDRAM[Address],32); + } + } + + int l1=out[14^S]; + int l2=out[15^S]; + int inp1[8]; + int inp2[8]; + out+=16; + while(count>0) { + code=BufferSpace[(AudioInBuffer+inPtr)^S8]; + index=code&0xf; + index<<=4; + book1=(short *)&adpcmtable[index]; + book2=book1+8; + code>>=4; + vscale=(0x8000>>((srange-code)-1)); + + inPtr++; + j=0; + + while(j<8) { + icode=BufferSpace[(AudioInBuffer+inPtr)^S8]; + inPtr++; + + inp1[j]=(s16)((icode&mask1) << 8); // this will in effect be signed + if(code>16); + //else int catchme=1; + j++; + + inp1[j]=(s16)((icode&mask2)<>16); + //else int catchme=1; + j++; + + if (Flags & 4) { + inp1[j]=(s16)((icode&0xC) << 12); // this will in effect be signed + if(code < 0xE) inp1[j]=((int)((int)inp1[j]*(int)vscale)>>16); + //else int catchme=1; + j++; + + inp1[j]=(s16)((icode&0x3) << 14); + if(code < 0xE) inp1[j]=((int)((int)inp1[j]*(int)vscale)>>16); + //else int catchme=1; + j++; + } // end flags + } // end while + + + + j=0; + while(j<8) { + icode=BufferSpace[(AudioInBuffer+inPtr)^S8]; + inPtr++; + + inp2[j]=(s16)((icode&mask1) << 8); + if(code>16); + //else int catchme=1; + j++; + + inp2[j]=(s16)((icode&mask2)<>16); + //else int catchme=1; + j++; + + if (Flags & 4) { + inp2[j]=(s16)((icode&0xC) << 12); + if(code < 0xE) inp2[j]=((int)((int)inp2[j]*(int)vscale)>>16); + //else int catchme=1; + j++; + + inp2[j]=(s16)((icode&0x3) << 14); + if(code < 0xE) inp2[j]=((int)((int)inp2[j]*(int)vscale)>>16); + //else int catchme=1; + j++; + } // end flags + } + + a[0]= (int)book1[0]*(int)l1; + a[0]+=(int)book2[0]*(int)l2; + a[0]+=(int)inp1[0]*(int)2048; + + a[1] =(int)book1[1]*(int)l1; + a[1]+=(int)book2[1]*(int)l2; + a[1]+=(int)book2[0]*inp1[0]; + a[1]+=(int)inp1[1]*(int)2048; + + a[2] =(int)book1[2]*(int)l1; + a[2]+=(int)book2[2]*(int)l2; + a[2]+=(int)book2[1]*inp1[0]; + a[2]+=(int)book2[0]*inp1[1]; + a[2]+=(int)inp1[2]*(int)2048; + + a[3] =(int)book1[3]*(int)l1; + a[3]+=(int)book2[3]*(int)l2; + a[3]+=(int)book2[2]*inp1[0]; + a[3]+=(int)book2[1]*inp1[1]; + a[3]+=(int)book2[0]*inp1[2]; + a[3]+=(int)inp1[3]*(int)2048; + + a[4] =(int)book1[4]*(int)l1; + a[4]+=(int)book2[4]*(int)l2; + a[4]+=(int)book2[3]*inp1[0]; + a[4]+=(int)book2[2]*inp1[1]; + a[4]+=(int)book2[1]*inp1[2]; + a[4]+=(int)book2[0]*inp1[3]; + a[4]+=(int)inp1[4]*(int)2048; + + a[5] =(int)book1[5]*(int)l1; + a[5]+=(int)book2[5]*(int)l2; + a[5]+=(int)book2[4]*inp1[0]; + a[5]+=(int)book2[3]*inp1[1]; + a[5]+=(int)book2[2]*inp1[2]; + a[5]+=(int)book2[1]*inp1[3]; + a[5]+=(int)book2[0]*inp1[4]; + a[5]+=(int)inp1[5]*(int)2048; + + a[6] =(int)book1[6]*(int)l1; + a[6]+=(int)book2[6]*(int)l2; + a[6]+=(int)book2[5]*inp1[0]; + a[6]+=(int)book2[4]*inp1[1]; + a[6]+=(int)book2[3]*inp1[2]; + a[6]+=(int)book2[2]*inp1[3]; + a[6]+=(int)book2[1]*inp1[4]; + a[6]+=(int)book2[0]*inp1[5]; + a[6]+=(int)inp1[6]*(int)2048; + + a[7] =(int)book1[7]*(int)l1; + a[7]+=(int)book2[7]*(int)l2; + a[7]+=(int)book2[6]*inp1[0]; + a[7]+=(int)book2[5]*inp1[1]; + a[7]+=(int)book2[4]*inp1[2]; + a[7]+=(int)book2[3]*inp1[3]; + a[7]+=(int)book2[2]*inp1[4]; + a[7]+=(int)book2[1]*inp1[5]; + a[7]+=(int)book2[0]*inp1[6]; + a[7]+=(int)inp1[7]*(int)2048; + + for(j=0;j<8;j++) + { + a[j^S]>>=11; + if(a[j^S]>32767) a[j^S]=32767; + else if(a[j^S]<-32768) a[j^S]=-32768; + *(out++)=a[j^S]; + } + l1=a[6]; + l2=a[7]; + + a[0]= (int)book1[0]*(int)l1; + a[0]+=(int)book2[0]*(int)l2; + a[0]+=(int)inp2[0]*(int)2048; + + a[1] =(int)book1[1]*(int)l1; + a[1]+=(int)book2[1]*(int)l2; + a[1]+=(int)book2[0]*inp2[0]; + a[1]+=(int)inp2[1]*(int)2048; + + a[2] =(int)book1[2]*(int)l1; + a[2]+=(int)book2[2]*(int)l2; + a[2]+=(int)book2[1]*inp2[0]; + a[2]+=(int)book2[0]*inp2[1]; + a[2]+=(int)inp2[2]*(int)2048; + + a[3] =(int)book1[3]*(int)l1; + a[3]+=(int)book2[3]*(int)l2; + a[3]+=(int)book2[2]*inp2[0]; + a[3]+=(int)book2[1]*inp2[1]; + a[3]+=(int)book2[0]*inp2[2]; + a[3]+=(int)inp2[3]*(int)2048; + + a[4] =(int)book1[4]*(int)l1; + a[4]+=(int)book2[4]*(int)l2; + a[4]+=(int)book2[3]*inp2[0]; + a[4]+=(int)book2[2]*inp2[1]; + a[4]+=(int)book2[1]*inp2[2]; + a[4]+=(int)book2[0]*inp2[3]; + a[4]+=(int)inp2[4]*(int)2048; + + a[5] =(int)book1[5]*(int)l1; + a[5]+=(int)book2[5]*(int)l2; + a[5]+=(int)book2[4]*inp2[0]; + a[5]+=(int)book2[3]*inp2[1]; + a[5]+=(int)book2[2]*inp2[2]; + a[5]+=(int)book2[1]*inp2[3]; + a[5]+=(int)book2[0]*inp2[4]; + a[5]+=(int)inp2[5]*(int)2048; + + a[6] =(int)book1[6]*(int)l1; + a[6]+=(int)book2[6]*(int)l2; + a[6]+=(int)book2[5]*inp2[0]; + a[6]+=(int)book2[4]*inp2[1]; + a[6]+=(int)book2[3]*inp2[2]; + a[6]+=(int)book2[2]*inp2[3]; + a[6]+=(int)book2[1]*inp2[4]; + a[6]+=(int)book2[0]*inp2[5]; + a[6]+=(int)inp2[6]*(int)2048; + + a[7] =(int)book1[7]*(int)l1; + a[7]+=(int)book2[7]*(int)l2; + a[7]+=(int)book2[6]*inp2[0]; + a[7]+=(int)book2[5]*inp2[1]; + a[7]+=(int)book2[4]*inp2[2]; + a[7]+=(int)book2[3]*inp2[3]; + a[7]+=(int)book2[2]*inp2[4]; + a[7]+=(int)book2[1]*inp2[5]; + a[7]+=(int)book2[0]*inp2[6]; + a[7]+=(int)inp2[7]*(int)2048; + + for(j=0;j<8;j++) + { + a[j^S]>>=11; + if(a[j^S]>32767) a[j^S]=32767; + else if(a[j^S]<-32768) a[j^S]=-32768; + *(out++)=a[j^S]; + } + l1=a[6]; + l2=a[7]; + + count-=32; + } + out-=16; + memcpy(&rsp.RDRAM[Address],out,32); +} + +static void CLEARBUFF2 (u32 inst1, u32 inst2) { + u16 addr = (u16)(inst1 & 0xffff); + u16 count = (u16)(inst2 & 0xffff); + if (count > 0) + memset(BufferSpace+addr, 0, count); +} + +static void LOADBUFF2 (u32 inst1, u32 inst2) { // Needs accuracy verification... + u32 v0; + u32 cnt = (((inst1 >> 0xC)+3)&0xFFC); + v0 = (inst2 & 0xfffffc);// + SEGMENTS[(inst2>>24)&0xf]; + memcpy (BufferSpace+(inst1&0xfffc), rsp.RDRAM+v0, (cnt+3)&0xFFFC); +} + +static void SAVEBUFF2 (u32 inst1, u32 inst2) { // Needs accuracy verification... + u32 v0; + u32 cnt = (((inst1 >> 0xC)+3)&0xFFC); + v0 = (inst2 & 0xfffffc);// + SEGMENTS[(inst2>>24)&0xf]; + memcpy (rsp.RDRAM+v0, BufferSpace+(inst1&0xfffc), (cnt+3)&0xFFFC); +} + + +static void MIXER2 (u32 inst1, u32 inst2) { // Needs accuracy verification... + u16 dmemin = (u16)(inst2 >> 0x10); + u16 dmemout = (u16)(inst2 & 0xFFFF); + u32 count = ((inst1 >> 12) & 0xFF0); + s32 gain = (s16)(inst1 & 0xFFFF); + s32 temp; + + for (unsigned int x=0; x < count; x+=2) { // I think I can do this a lot easier + + temp = (*(s16 *)(BufferSpace+dmemin+x) * gain) >> 15; + temp += *(s16 *)(BufferSpace+dmemout+x); + + if ((s32)temp > 32767) + temp = 32767; + if ((s32)temp < -32768) + temp = -32768; + + *(u16 *)(BufferSpace+dmemout+x) = (u16)(temp & 0xFFFF); + } +} + + +static void RESAMPLE2 (u32 inst1, u32 inst2) { + unsigned char Flags=(u8)((inst1>>16)&0xff); + unsigned int Pitch=((inst1&0xffff))<<1; + u32 addy = (inst2 & 0xffffff);// + SEGMENTS[(inst2>>24)&0xf]; + unsigned int Accum=0; + unsigned int location; + s16 *lut; + short *dst; + s16 *src; + dst=(short *)(BufferSpace); + src=(s16 *)(BufferSpace); + u32 srcPtr=(AudioInBuffer/2); + u32 dstPtr=(AudioOutBuffer/2); + s32 temp; + s32 accum; + + if (addy > (1024*1024*8)) + addy = (inst2 & 0xffffff); + + srcPtr -= 4; + + if ((Flags & 0x1) == 0) { + for (int x=0; x < 4; x++) //memcpy (src+srcPtr, rsp.RDRAM+addy, 0x8); + src[(srcPtr+x)^S] = ((u16 *)rsp.RDRAM)[((addy/2)+x)^S]; + Accum = *(u16 *)(rsp.RDRAM+addy+10); + } else { + for (int x=0; x < 4; x++) + src[(srcPtr+x)^S] = 0;//*(u16 *)(rsp.RDRAM+((addy+x)^2)); + } + + for(int i=0;i < ((AudioCount+0xf)&0xFFF0)/2;i++) { + location = (((Accum * 0x40) >> 0x10) * 8); + //location = (Accum >> 0xa) << 0x3; + lut = (s16 *)(((u8 *)ResampleLUT) + location); + + temp = ((s32)*(s16*)(src+((srcPtr+0)^S))*((s32)((s16)lut[0]))); + accum = (s32)(temp >> 15); + + temp = ((s32)*(s16*)(src+((srcPtr+1)^S))*((s32)((s16)lut[1]))); + accum += (s32)(temp >> 15); + + temp = ((s32)*(s16*)(src+((srcPtr+2)^S))*((s32)((s16)lut[2]))); + accum += (s32)(temp >> 15); + + temp = ((s32)*(s16*)(src+((srcPtr+3)^S))*((s32)((s16)lut[3]))); + accum += (s32)(temp >> 15); + + if (accum > 32767) accum = 32767; + if (accum < -32768) accum = -32768; + + dst[dstPtr^S] = (s16)(accum); + dstPtr++; + Accum += Pitch; + srcPtr += (Accum>>16); + Accum&=0xffff; + } + for (int x=0; x < 4; x++) + ((u16 *)rsp.RDRAM)[((addy/2)+x)^S] = src[(srcPtr+x)^S]; + *(u16 *)(rsp.RDRAM+addy+10) = (u16)Accum; + //memcpy (RSWORK, src+srcPtr, 0x8); +} + +static void DMEMMOVE2 (u32 inst1, u32 inst2) { // Needs accuracy verification... + u32 v0, v1; + u32 cnt; + if ((inst2 & 0xffff)==0) + return; + v0 = (inst1 & 0xFFFF); + v1 = (inst2 >> 0x10); + //assert ((v1 & 0x3) == 0); + //assert ((v0 & 0x3) == 0); + u32 count = ((inst2+3) & 0xfffc); + //v0 = (v0) & 0xfffc; + //v1 = (v1) & 0xfffc; + + //memcpy (dmem+v1, dmem+v0, count-1); + for (cnt = 0; cnt < count; cnt++) { + *(u8 *)(BufferSpace+((cnt+v1)^S8)) = *(u8 *)(BufferSpace+((cnt+v0)^S8)); + } +} + +static u32 t3, s5, s6; +static u16 env[8]; + +static void ENVSETUP1 (u32 inst1, u32 inst2) { + u32 tmp; + + //fprintf (dfile, "ENVSETUP1: inst1 = %08X, inst2 = %08X\n", inst1, inst2); + t3 = inst1 & 0xFFFF; + tmp = (inst1 >> 0x8) & 0xFF00; + env[4] = (u16)tmp; + tmp += t3; + env[5] = (u16)tmp; + s5 = inst2 >> 0x10; + s6 = inst2 & 0xFFFF; + //fprintf (dfile, " t3 = %X / s5 = %X / s6 = %X / env[4] = %X / env[5] = %X\n", t3, s5, s6, env[4], env[5]); +} + +static void ENVSETUP2 (u32 inst1, u32 inst2) { + u32 tmp; + + //fprintf (dfile, "ENVSETUP2: inst1 = %08X, inst2 = %08X\n", inst1, inst2); + tmp = (inst2 >> 0x10); + env[0] = (u16)tmp; + tmp += s5; + env[1] = (u16)tmp; + tmp = inst2 & 0xffff; + env[2] = (u16)tmp; + tmp += s6; + env[3] = (u16)tmp; + //fprintf (dfile, " env[0] = %X / env[1] = %X / env[2] = %X / env[3] = %X\n", env[0], env[1], env[2], env[3]); +} + +static void ENVMIXER2 (u32 inst1, u32 inst2) { + //fprintf (dfile, "ENVMIXER: inst1 = %08X, inst2 = %08X\n", inst1, inst2); + + s16 *bufft6, *bufft7, *buffs0, *buffs1; + s16 *buffs3; + s32 count; + u32 adder; + + s16 vec9, vec10; + + s16 v2[8]; + + buffs3 = (s16 *)(BufferSpace + ((inst1 >> 0x0c)&0x0ff0)); + bufft6 = (s16 *)(BufferSpace + ((inst2 >> 0x14)&0x0ff0)); + bufft7 = (s16 *)(BufferSpace + ((inst2 >> 0x0c)&0x0ff0)); + buffs0 = (s16 *)(BufferSpace + ((inst2 >> 0x04)&0x0ff0)); + buffs1 = (s16 *)(BufferSpace + ((inst2 << 0x04)&0x0ff0)); + + + v2[0] = 0 - (s16)((inst1 & 0x2) >> 1); + v2[1] = 0 - (s16)((inst1 & 0x1)); + v2[2] = 0 - (s16)((inst1 & 0x8) >> 1); + v2[3] = 0 - (s16)((inst1 & 0x4) >> 1); + + count = (inst1 >> 8) & 0xff; + + if (!isMKABI) { + s5 *= 2; s6 *= 2; t3 *= 2; + adder = 0x10; + } else { + inst1 = 0; + adder = 0x8; + t3 = 0; + } + + + while (count > 0) { + int temp, x; + for (x=0; x < 0x8; x++) { + vec9 = (s16)(((s32)buffs3[x^S] * (u32)env[0]) >> 0x10) ^ v2[0]; + vec10 = (s16)(((s32)buffs3[x^S] * (u32)env[2]) >> 0x10) ^ v2[1]; + temp = bufft6[x^S] + vec9; + if (temp > 32767) temp = 32767; if (temp < -32768) temp = -32768; + bufft6[x^S] = temp; + temp = bufft7[x^S] + vec10; + if (temp > 32767) temp = 32767; if (temp < -32768) temp = -32768; + bufft7[x^S] = temp; + vec9 = (s16)(((s32)vec9 * (u32)env[4]) >> 0x10) ^ v2[2]; + vec10 = (s16)(((s32)vec10 * (u32)env[4]) >> 0x10) ^ v2[3]; + if (inst1 & 0x10) { + temp = buffs0[x^S] + vec10; + if (temp > 32767) temp = 32767; if (temp < -32768) temp = -32768; + buffs0[x^S] = temp; + temp = buffs1[x^S] + vec9; + if (temp > 32767) temp = 32767; if (temp < -32768) temp = -32768; + buffs1[x^S] = temp; + } else { + temp = buffs0[x^S] + vec9; + if (temp > 32767) temp = 32767; if (temp < -32768) temp = -32768; + buffs0[x^S] = temp; + temp = buffs1[x^S] + vec10; + if (temp > 32767) temp = 32767; if (temp < -32768) temp = -32768; + buffs1[x^S] = temp; + } + } + + if (!isMKABI) + for (x=0x8; x < 0x10; x++) { + vec9 = (s16)(((s32)buffs3[x^S] * (u32)env[1]) >> 0x10) ^ v2[0]; + vec10 = (s16)(((s32)buffs3[x^S] * (u32)env[3]) >> 0x10) ^ v2[1]; + temp = bufft6[x^S] + vec9; + if (temp > 32767) temp = 32767; if (temp < -32768) temp = -32768; + bufft6[x^S] = temp; + temp = bufft7[x^S] + vec10; + if (temp > 32767) temp = 32767; if (temp < -32768) temp = -32768; + bufft7[x^S] = temp; + vec9 = (s16)(((s32)vec9 * (u32)env[5]) >> 0x10) ^ v2[2]; + vec10 = (s16)(((s32)vec10 * (u32)env[5]) >> 0x10) ^ v2[3]; + if (inst1 & 0x10) { + temp = buffs0[x^S] + vec10; + if (temp > 32767) temp = 32767; if (temp < -32768) temp = -32768; + buffs0[x^S] = temp; + temp = buffs1[x^S] + vec9; + if (temp > 32767) temp = 32767; if (temp < -32768) temp = -32768; + buffs1[x^S] = temp; + } else { + temp = buffs0[x^S] + vec9; + if (temp > 32767) temp = 32767; if (temp < -32768) temp = -32768; + buffs0[x^S] = temp; + temp = buffs1[x^S] + vec10; + if (temp > 32767) temp = 32767; if (temp < -32768) temp = -32768; + buffs1[x^S] = temp; + } + } + bufft6 += adder; bufft7 += adder; + buffs0 += adder; buffs1 += adder; + buffs3 += adder; count -= adder; + env[0] += (u16)s5; env[1] += (u16)s5; + env[2] += (u16)s6; env[3] += (u16)s6; + env[4] += (u16)t3; env[5] += (u16)t3; + } +} + +static void DUPLICATE2(u32 inst1, u32 inst2) { + unsigned short Count = (inst1 >> 16) & 0xff; + unsigned short In = inst1&0xffff; + unsigned short Out = (inst2>>16); + + unsigned short buff[64]; + + memcpy(buff,BufferSpace+In,128); + + while(Count) { + memcpy(BufferSpace+Out,buff,128); + Out+=128; + Count--; + } +} +/* +static void INTERL2 (u32 inst1, u32 inst2) { // Make your own... + short Count = inst1 & 0xffff; + unsigned short Out = inst2 & 0xffff; + unsigned short In = (inst2 >> 16); + + short *src,*dst,tmp; + src=(short *)&BufferSpace[In]; + dst=(short *)&BufferSpace[Out]; + while(Count) + { + *(dst++)=*(src++); + src++; + *(dst++)=*(src++); + src++; + *(dst++)=*(src++); + src++; + *(dst++)=*(src++); + src++; + *(dst++)=*(src++); + src++; + *(dst++)=*(src++); + src++; + *(dst++)=*(src++); + src++; + *(dst++)=*(src++); + src++; + Count-=8; + } +} +*/ + +static void INTERL2 (u32 inst1, u32 inst2) { + short Count = inst1 & 0xffff; + unsigned short Out = inst2 & 0xffff; + unsigned short In = (inst2 >> 16); + + unsigned char *src,*dst/*,tmp*/; + src=(unsigned char *)(BufferSpace);//[In]; + dst=(unsigned char *)(BufferSpace);//[Out]; + while(Count) { + *(short *)(dst+(Out^S8)) = *(short *)(src+(In^S8)); + Out += 2; + In += 4; + Count--; + } +} + +static void INTERLEAVE2 (u32 inst1, u32 inst2) { // Needs accuracy verification... + u32 inL, inR; + u16 *outbuff; + u16 *inSrcR; + u16 *inSrcL; + u16 Left, Right, Left2, Right2; + u32 count; + count = ((inst1 >> 12) & 0xFF0); + if (count == 0) { + outbuff = (u16 *)(AudioOutBuffer+BufferSpace); + count = AudioCount; + } else { + outbuff = (u16 *)((inst1&0xFFFF)+BufferSpace); + } + + inR = inst2 & 0xFFFF; + inL = (inst2 >> 16) & 0xFFFF; + + inSrcR = (u16 *)(BufferSpace+inR); + inSrcL = (u16 *)(BufferSpace+inL); + + for (u32 x = 0; x < (count/4); x++) { + Left=*(inSrcL++); + Right=*(inSrcR++); + Left2=*(inSrcL++); + Right2=*(inSrcR++); + +#ifdef M64P_BIG_ENDIAN + *(outbuff++)=Right; + *(outbuff++)=Left; + *(outbuff++)=Right2; + *(outbuff++)=Left2; +#else + *(outbuff++)=Right2; + *(outbuff++)=Left2; + *(outbuff++)=Right; + *(outbuff++)=Left; +#endif + } +} + +static void ADDMIXER (u32 inst1, u32 inst2) { + short Count = (inst1 >> 12) & 0x00ff0; + u16 InBuffer = (inst2 >> 16); + u16 OutBuffer = inst2 & 0xffff; + + s16 *inp, *outp; + s32 temp; + inp = (s16 *)(BufferSpace + InBuffer); + outp = (s16 *)(BufferSpace + OutBuffer); + for (int cntr = 0; cntr < Count; cntr+=2) { + temp = *outp + *inp; + if (temp > 32767) temp = 32767; if (temp < -32768) temp = -32768; + *(outp++) = temp; + inp++; + } +} + +static void HILOGAIN (u32 inst1, u32 inst2) { + u16 cnt = inst1 & 0xffff; + u16 out = (inst2 >> 16) & 0xffff; + s16 hi = (s16)((inst1 >> 4) & 0xf000); + u16 lo = (inst1 >> 20) & 0xf; + s16 *src; + + src = (s16 *)(BufferSpace+out); + s32 tmp, val; + + while(cnt) { + val = (s32)*src; + //tmp = ((val * (s32)hi) + ((u64)(val * lo) << 16) >> 16); + tmp = ((val * (s32)hi) >> 16) + (u32)(val * lo); + if ((s32)tmp > 32767) tmp = 32767; + else if ((s32)tmp < -32768) tmp = -32768; + *src = tmp; + src++; + cnt -= 2; + } +} + +static void FILTER2 (u32 inst1, u32 inst2) { + static int cnt = 0; + static s16 *lutt6; + static s16 *lutt5; + u8 *save = (rsp.RDRAM+(inst2&0xFFFFFF)); + u8 t4 = (u8)((inst1 >> 0x10) & 0xFF); + int x; + + if (t4 > 1) { // Then set the cnt variable + cnt = (inst1 & 0xFFFF); + lutt6 = (s16 *)save; +// memcpy (dmem+0xFE0, rsp.RDRAM+(inst2&0xFFFFFF), 0x10); + return; + } + + if (t4 == 0) { +// memcpy (dmem+0xFB0, rsp.RDRAM+(inst2&0xFFFFFF), 0x20); + lutt5 = (short *)(save+0x10); + } + + lutt5 = (short *)(save+0x10); + +// lutt5 = (short *)(dmem + 0xFC0); +// lutt6 = (short *)(dmem + 0xFE0); + for (x = 0; x < 8; x++) { + s32 a; + a = (lutt5[x] + lutt6[x]) >> 1; + lutt5[x] = lutt6[x] = (short)a; + } + short *inp1, *inp2; + s32 out1[8]; + s16 outbuff[0x3c0], *outp; + u32 inPtr = (u32)(inst1&0xffff); + inp1 = (short *)(save); + outp = outbuff; + inp2 = (short *)(BufferSpace+inPtr); + for (x = 0; x < cnt; x+=0x10) { + out1[1] = inp1[0]*lutt6[6]; + out1[1] += inp1[3]*lutt6[7]; + out1[1] += inp1[2]*lutt6[4]; + out1[1] += inp1[5]*lutt6[5]; + out1[1] += inp1[4]*lutt6[2]; + out1[1] += inp1[7]*lutt6[3]; + out1[1] += inp1[6]*lutt6[0]; + out1[1] += inp2[1]*lutt6[1]; // 1 + + out1[0] = inp1[3]*lutt6[6]; + out1[0] += inp1[2]*lutt6[7]; + out1[0] += inp1[5]*lutt6[4]; + out1[0] += inp1[4]*lutt6[5]; + out1[0] += inp1[7]*lutt6[2]; + out1[0] += inp1[6]*lutt6[3]; + out1[0] += inp2[1]*lutt6[0]; + out1[0] += inp2[0]*lutt6[1]; + + out1[3] = inp1[2]*lutt6[6]; + out1[3] += inp1[5]*lutt6[7]; + out1[3] += inp1[4]*lutt6[4]; + out1[3] += inp1[7]*lutt6[5]; + out1[3] += inp1[6]*lutt6[2]; + out1[3] += inp2[1]*lutt6[3]; + out1[3] += inp2[0]*lutt6[0]; + out1[3] += inp2[3]*lutt6[1]; + + out1[2] = inp1[5]*lutt6[6]; + out1[2] += inp1[4]*lutt6[7]; + out1[2] += inp1[7]*lutt6[4]; + out1[2] += inp1[6]*lutt6[5]; + out1[2] += inp2[1]*lutt6[2]; + out1[2] += inp2[0]*lutt6[3]; + out1[2] += inp2[3]*lutt6[0]; + out1[2] += inp2[2]*lutt6[1]; + + out1[5] = inp1[4]*lutt6[6]; + out1[5] += inp1[7]*lutt6[7]; + out1[5] += inp1[6]*lutt6[4]; + out1[5] += inp2[1]*lutt6[5]; + out1[5] += inp2[0]*lutt6[2]; + out1[5] += inp2[3]*lutt6[3]; + out1[5] += inp2[2]*lutt6[0]; + out1[5] += inp2[5]*lutt6[1]; + + out1[4] = inp1[7]*lutt6[6]; + out1[4] += inp1[6]*lutt6[7]; + out1[4] += inp2[1]*lutt6[4]; + out1[4] += inp2[0]*lutt6[5]; + out1[4] += inp2[3]*lutt6[2]; + out1[4] += inp2[2]*lutt6[3]; + out1[4] += inp2[5]*lutt6[0]; + out1[4] += inp2[4]*lutt6[1]; + + out1[7] = inp1[6]*lutt6[6]; + out1[7] += inp2[1]*lutt6[7]; + out1[7] += inp2[0]*lutt6[4]; + out1[7] += inp2[3]*lutt6[5]; + out1[7] += inp2[2]*lutt6[2]; + out1[7] += inp2[5]*lutt6[3]; + out1[7] += inp2[4]*lutt6[0]; + out1[7] += inp2[7]*lutt6[1]; + + out1[6] = inp2[1]*lutt6[6]; + out1[6] += inp2[0]*lutt6[7]; + out1[6] += inp2[3]*lutt6[4]; + out1[6] += inp2[2]*lutt6[5]; + out1[6] += inp2[5]*lutt6[2]; + out1[6] += inp2[4]*lutt6[3]; + out1[6] += inp2[7]*lutt6[0]; + out1[6] += inp2[6]*lutt6[1]; + outp[1] = /*CLAMP*/((out1[1]+0x4000) >> 0xF); + outp[0] = /*CLAMP*/((out1[0]+0x4000) >> 0xF); + outp[3] = /*CLAMP*/((out1[3]+0x4000) >> 0xF); + outp[2] = /*CLAMP*/((out1[2]+0x4000) >> 0xF); + outp[5] = /*CLAMP*/((out1[5]+0x4000) >> 0xF); + outp[4] = /*CLAMP*/((out1[4]+0x4000) >> 0xF); + outp[7] = /*CLAMP*/((out1[7]+0x4000) >> 0xF); + outp[6] = /*CLAMP*/((out1[6]+0x4000) >> 0xF); + inp1 = inp2; + inp2 += 8; + outp += 8; + } +// memcpy (rsp.RDRAM+(inst2&0xFFFFFF), dmem+0xFB0, 0x20); + memcpy (save, inp2-8, 0x10); + memcpy (BufferSpace+(inst1&0xffff), outbuff, cnt); +} + +static void SEGMENT2 (u32 inst1, u32 inst2) { + if (isZeldaABI) { + FILTER2 (inst1, inst2); + return; + } + if ((inst1 & 0xffffff) == 0) { + isMKABI = true; + //SEGMENTS[(inst2>>24)&0xf] = (inst2 & 0xffffff); + } else { + isMKABI = false; + isZeldaABI = true; + FILTER2 (inst1, inst2); + } +} + +static void UNKNOWN (u32 inst1, u32 inst2) { +} +/* +void (*ABI2[0x20])(void) = { + SPNOOP, ADPCM2, CLEARBUFF2, SPNOOP, SPNOOP, RESAMPLE2, SPNOOP, SEGMENT2, + SETBUFF2, SPNOOP, DMEMMOVE2, LOADADPCM2, MIXER2, INTERLEAVE2, HILOGAIN, SETLOOP2, + SPNOOP, INTERL2, ENVSETUP1, ENVMIXER2, LOADBUFF2, SAVEBUFF2, ENVSETUP2, SPNOOP, + SPNOOP, SPNOOP, SPNOOP, SPNOOP, SPNOOP, SPNOOP, SPNOOP, SPNOOP +};*/ + +extern "C" const acmd_callback_t ABI2[0x20] = { + SPNOOP , ADPCM2, CLEARBUFF2, UNKNOWN, ADDMIXER, RESAMPLE2, UNKNOWN, SEGMENT2, + SETBUFF2 , DUPLICATE2, DMEMMOVE2, LOADADPCM2, MIXER2, INTERLEAVE2, HILOGAIN, SETLOOP2, + SPNOOP, INTERL2 , ENVSETUP1, ENVMIXER2, LOADBUFF2, SAVEBUFF2, ENVSETUP2, SPNOOP, + HILOGAIN , SPNOOP, DUPLICATE2 , UNKNOWN , SPNOOP , SPNOOP , SPNOOP , SPNOOP +}; +/* +void (*ABI2[0x20])(void) = { + SPNOOP , ADPCM2, CLEARBUFF2, SPNOOP, SPNOOP, RESAMPLE2 , SPNOOP , SEGMENT2, + SETBUFF2 , DUPLICATE2, DMEMMOVE2, LOADADPCM2, MIXER2, INTERLEAVE2, SPNOOP, SETLOOP2, + SPNOOP, INTERL2 , ENVSETUP1, ENVMIXER2, LOADBUFF2, SAVEBUFF2, ENVSETUP2, SPNOOP, + SPNOOP , SPNOOP, SPNOOP , SPNOOP , SPNOOP , SPNOOP , SPNOOP , SPNOOP +};*/ +/* NOTES: + + FILTER/SEGMENT - Still needs to be finished up... add FILTER? + UNKNOWWN #27 - Is this worth doing? Looks like a pain in the ass just for WaveRace64 +*/ + diff --git a/libmupen64plus/mupen64plus-rsp-hle/src/ucode3.cpp b/libmupen64plus/mupen64plus-rsp-hle/src/ucode3.cpp new file mode 100644 index 0000000000..b63fbe27c2 --- /dev/null +++ b/libmupen64plus/mupen64plus-rsp-hle/src/ucode3.cpp @@ -0,0 +1,834 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-rsp-hle - ucode3.cpp * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +# include +# include + +extern "C" { + #include "m64p_types.h" + #include "hle.h" + #include "alist_internal.h" +} + +/* +static void SPNOOP (u32 inst1, u32 inst2) { + DebugMessage(M64MSG_ERROR, "Unknown/Unimplemented Audio Command %i in ABI 3", (int)(inst1 >> 24)); +} +*/ + +extern const u16 ResampleLUT [0x200]; + +extern u32 loopval; + +extern s16 Env_Dry; +extern s16 Env_Wet; +extern s16 Vol_Left; +extern s16 Vol_Right; +extern s16 VolTrg_Left; +extern s32 VolRamp_Left; +//extern u16 VolRate_Left; +extern s16 VolTrg_Right; +extern s32 VolRamp_Right; +//extern u16 VolRate_Right; + + +extern short hleMixerWorkArea[256]; +extern u16 adpcmtable[0x88]; + +extern u8 BufferSpace[0x10000]; + +/* +static void SETVOL3 (u32 inst1, u32 inst2) { // Swapped Rate_Left and Vol + u8 Flags = (u8)(inst1 >> 0x10); + if (Flags & 0x4) { // 288 + if (Flags & 0x2) { // 290 + VolTrg_Left = *(s16*)&inst1; + VolRamp_Left = *(s32*)&inst2; + } else { + VolTrg_Right = *(s16*)&inst1; + VolRamp_Right = *(s32*)&inst2; + } + } else { + Vol_Left = *(s16*)&inst1; + Env_Dry = (s16)(*(s32*)&inst2 >> 0x10); + Env_Wet = *(s16*)&inst2; + } +} +*/ +static void SETVOL3 (u32 inst1, u32 inst2) { + u8 Flags = (u8)(inst1 >> 0x10); + if (Flags & 0x4) { // 288 + if (Flags & 0x2) { // 290 + Vol_Left = (s16)inst1; // 0x50 + Env_Dry = (s16)(inst2 >> 0x10); // 0x4E + Env_Wet = (s16)inst2; // 0x4C + } else { + VolTrg_Right = (s16)inst1; // 0x46 + //VolRamp_Right = (u16)(inst2 >> 0x10) | (s32)(s16)(inst2 << 0x10); + VolRamp_Right = (s32)inst2; // 0x48/0x4A + } + } else { + VolTrg_Left = (s16)inst1; // 0x40 + VolRamp_Left = (s32)inst2; // 0x42/0x44 + } +} + +static void ENVMIXER3 (u32 inst1, u32 inst2) { + u8 flags = (u8)((inst1 >> 16) & 0xff); + u32 addy = (inst2 & 0xFFFFFF); + + short *inp=(short *)(BufferSpace+0x4F0); + short *out=(short *)(BufferSpace+0x9D0); + short *aux1=(short *)(BufferSpace+0xB40); + short *aux2=(short *)(BufferSpace+0xCB0); + short *aux3=(short *)(BufferSpace+0xE20); + s32 MainR; + s32 MainL; + s32 AuxR; + s32 AuxL; + int i1,o1,a1,a2,a3; + //unsigned short AuxIncRate=1; + short zero[8]; + memset(zero,0,16); + + s32 LAdder, LAcc, LVol; + s32 RAdder, RAcc, RVol; + s16 RSig, LSig; // Most significant part of the Ramp Value + s16 Wet, Dry; + s16 LTrg, RTrg; + + Vol_Right = (s16)inst1; + + if (flags & A_INIT) { + LAdder = VolRamp_Left / 8; + LAcc = 0; + LVol = Vol_Left; + LSig = (s16)(VolRamp_Left >> 16); + + RAdder = VolRamp_Right / 8; + RAcc = 0; + RVol = Vol_Right; + RSig = (s16)(VolRamp_Right >> 16); + + Wet = (s16)Env_Wet; Dry = (s16)Env_Dry; // Save Wet/Dry values + LTrg = VolTrg_Left; RTrg = VolTrg_Right; // Save Current Left/Right Targets + } else { + memcpy((u8 *)hleMixerWorkArea, rsp.RDRAM+addy, 80); + Wet = *(s16 *)(hleMixerWorkArea + 0); // 0-1 + Dry = *(s16 *)(hleMixerWorkArea + 2); // 2-3 + LTrg = *(s16 *)(hleMixerWorkArea + 4); // 4-5 + RTrg = *(s16 *)(hleMixerWorkArea + 6); // 6-7 + LAdder = *(s32 *)(hleMixerWorkArea + 8); // 8-9 (hleMixerWorkArea is a 16bit pointer) + RAdder = *(s32 *)(hleMixerWorkArea + 10); // 10-11 + LAcc = *(s32 *)(hleMixerWorkArea + 12); // 12-13 + RAcc = *(s32 *)(hleMixerWorkArea + 14); // 14-15 + LVol = *(s32 *)(hleMixerWorkArea + 16); // 16-17 + RVol = *(s32 *)(hleMixerWorkArea + 18); // 18-19 + LSig = *(s16 *)(hleMixerWorkArea + 20); // 20-21 + RSig = *(s16 *)(hleMixerWorkArea + 22); // 22-23 + //u32 test = *(s32 *)(hleMixerWorkArea + 24); // 22-23 + //if (test != 0x13371337) + } + + + //if(!(flags&A_AUX)) { + // AuxIncRate=0; + // aux2=aux3=zero; + //} + + for (int y = 0; y < (0x170/2); y++) { + + // Left + LAcc += LAdder; + LVol += (LAcc >> 16); + LAcc &= 0xFFFF; + + // Right + RAcc += RAdder; + RVol += (RAcc >> 16); + RAcc &= 0xFFFF; +// **************************************************************** + // Clamp Left + if (LSig >= 0) { // VLT + if (LVol > LTrg) { + LVol = LTrg; + } + } else { // VGE + if (LVol < LTrg) { + LVol = LTrg; + } + } + + // Clamp Right + if (RSig >= 0) { // VLT + if (RVol > RTrg) { + RVol = RTrg; + } + } else { // VGE + if (RVol < RTrg) { + RVol = RTrg; + } + } +// **************************************************************** + MainL = ((Dry * LVol) + 0x4000) >> 15; + MainR = ((Dry * RVol) + 0x4000) >> 15; + + o1 = out [y^S]; + a1 = aux1[y^S]; + i1 = inp [y^S]; + + o1+=((i1*MainL)+0x4000)>>15; + a1+=((i1*MainR)+0x4000)>>15; + +// **************************************************************** + + if(o1>32767) o1=32767; + else if(o1<-32768) o1=-32768; + + if(a1>32767) a1=32767; + else if(a1<-32768) a1=-32768; + +// **************************************************************** + + out[y^S]=o1; + aux1[y^S]=a1; + +// **************************************************************** + //if (!(flags&A_AUX)) { + a2 = aux2[y^S]; + a3 = aux3[y^S]; + + AuxL = ((Wet * LVol) + 0x4000) >> 15; + AuxR = ((Wet * RVol) + 0x4000) >> 15; + + a2+=((i1*AuxL)+0x4000)>>15; + a3+=((i1*AuxR)+0x4000)>>15; + + if(a2>32767) a2=32767; + else if(a2<-32768) a2=-32768; + + if(a3>32767) a3=32767; + else if(a3<-32768) a3=-32768; + + aux2[y^S]=a2; + aux3[y^S]=a3; + } + //} + + *(s16 *)(hleMixerWorkArea + 0) = Wet; // 0-1 + *(s16 *)(hleMixerWorkArea + 2) = Dry; // 2-3 + *(s16 *)(hleMixerWorkArea + 4) = LTrg; // 4-5 + *(s16 *)(hleMixerWorkArea + 6) = RTrg; // 6-7 + *(s32 *)(hleMixerWorkArea + 8) = LAdder; // 8-9 (hleMixerWorkArea is a 16bit pointer) + *(s32 *)(hleMixerWorkArea + 10) = RAdder; // 10-11 + *(s32 *)(hleMixerWorkArea + 12) = LAcc; // 12-13 + *(s32 *)(hleMixerWorkArea + 14) = RAcc; // 14-15 + *(s32 *)(hleMixerWorkArea + 16) = LVol; // 16-17 + *(s32 *)(hleMixerWorkArea + 18) = RVol; // 18-19 + *(s16 *)(hleMixerWorkArea + 20) = LSig; // 20-21 + *(s16 *)(hleMixerWorkArea + 22) = RSig; // 22-23 + //*(u32 *)(hleMixerWorkArea + 24) = 0x13371337; // 22-23 + memcpy(rsp.RDRAM+addy, (u8 *)hleMixerWorkArea,80); +} + +static void CLEARBUFF3 (u32 inst1, u32 inst2) { + u16 addr = (u16)(inst1 & 0xffff); + u16 count = (u16)(inst2 & 0xffff); + memset(BufferSpace+addr+0x4f0, 0, count); +} + +static void MIXER3 (u32 inst1, u32 inst2) { // Needs accuracy verification... + u16 dmemin = (u16)(inst2 >> 0x10) + 0x4f0; + u16 dmemout = (u16)(inst2 & 0xFFFF) + 0x4f0; + //u8 flags = (u8)((inst1 >> 16) & 0xff); + s32 gain = (s16)(inst1 & 0xFFFF); + s32 temp; + + for (int x=0; x < 0x170; x+=2) { // I think I can do this a lot easier + temp = (*(s16 *)(BufferSpace+dmemin+x) * gain) >> 15; + temp += *(s16 *)(BufferSpace+dmemout+x); + + if ((s32)temp > 32767) + temp = 32767; + if ((s32)temp < -32768) + temp = -32768; + + *(u16 *)(BufferSpace+dmemout+x) = (u16)(temp & 0xFFFF); + } +} + +static void LOADBUFF3 (u32 inst1, u32 inst2) { + u32 v0; + u32 cnt = (((inst1 >> 0xC)+3)&0xFFC); + v0 = (inst2 & 0xfffffc); + u32 src = (inst1&0xffc)+0x4f0; + memcpy (BufferSpace+src, rsp.RDRAM+v0, cnt); +} + +static void SAVEBUFF3 (u32 inst1, u32 inst2) { + u32 v0; + u32 cnt = (((inst1 >> 0xC)+3)&0xFFC); + v0 = (inst2 & 0xfffffc); + u32 src = (inst1&0xffc)+0x4f0; + memcpy (rsp.RDRAM+v0, BufferSpace+src, cnt); +} + +static void LOADADPCM3 (u32 inst1, u32 inst2) { // Loads an ADPCM table - Works 100% Now 03-13-01 + u32 v0; + v0 = (inst2 & 0xffffff); + //memcpy (dmem+0x3f0, rsp.RDRAM+v0, inst1&0xffff); + //assert ((inst1&0xffff) <= 0x80); + u16 *table = (u16 *)(rsp.RDRAM+v0); + for (u32 x = 0; x < ((inst1&0xffff)>>0x4); x++) { + adpcmtable[(0x0+(x<<3))^S] = table[0]; + adpcmtable[(0x1+(x<<3))^S] = table[1]; + + adpcmtable[(0x2+(x<<3))^S] = table[2]; + adpcmtable[(0x3+(x<<3))^S] = table[3]; + + adpcmtable[(0x4+(x<<3))^S] = table[4]; + adpcmtable[(0x5+(x<<3))^S] = table[5]; + + adpcmtable[(0x6+(x<<3))^S] = table[6]; + adpcmtable[(0x7+(x<<3))^S] = table[7]; + table += 8; + } +} + +static void DMEMMOVE3 (u32 inst1, u32 inst2) { // Needs accuracy verification... + u32 v0, v1; + u32 cnt; + v0 = (inst1 & 0xFFFF) + 0x4f0; + v1 = (inst2 >> 0x10) + 0x4f0; + u32 count = ((inst2+3) & 0xfffc); + + //memcpy (dmem+v1, dmem+v0, count-1); + for (cnt = 0; cnt < count; cnt++) { + *(u8 *)(BufferSpace+((cnt+v1)^S8)) = *(u8 *)(BufferSpace+((cnt+v0)^S8)); + } +} + +static void SETLOOP3 (u32 inst1, u32 inst2) { + loopval = (inst2 & 0xffffff); +} + +static void ADPCM3 (u32 inst1, u32 inst2) { // Verified to be 100% Accurate... + unsigned char Flags=(u8)(inst2>>0x1c)&0xff; + //unsigned short Gain=(u16)(inst1&0xffff); + unsigned int Address=(inst1 & 0xffffff);// + SEGMENTS[(inst2>>24)&0xf]; + unsigned short inPtr=(inst2>>12)&0xf; + //short *out=(s16 *)(testbuff+(AudioOutBuffer>>2)); + short *out=(short *)(BufferSpace+(inst2&0xfff)+0x4f0); + //unsigned char *in=(unsigned char *)(BufferSpace+((inst2>>12)&0xf)+0x4f0); + short count=(short)((inst2 >> 16)&0xfff); + unsigned char icode; + unsigned char code; + int vscale; + unsigned short index; + unsigned short j; + int a[8]; + short *book1,*book2; + + memset(out,0,32); + + if(!(Flags&0x1)) + { + if(Flags&0x2) + {/* + for(int i=0;i<16;i++) + { + out[i]=*(short *)&rsp.RDRAM[(loopval+i*2)^2]; + }*/ + memcpy(out,&rsp.RDRAM[loopval],32); + } + else + {/* + for(int i=0;i<16;i++) + { + out[i]=*(short *)&rsp.RDRAM[(Address+i*2)^2]; + }*/ + memcpy(out,&rsp.RDRAM[Address],32); + } + } + + int l1=out[14^S]; + int l2=out[15^S]; + int inp1[8]; + int inp2[8]; + out+=16; + while(count>0) + { + // the first interation through, these values are + // either 0 in the case of A_INIT, from a special + // area of memory in the case of A_LOOP or just + // the values we calculated the last time + + code=BufferSpace[(0x4f0+inPtr)^S8]; + index=code&0xf; + index<<=4; // index into the adpcm code table + book1=(short *)&adpcmtable[index]; + book2=book1+8; + code>>=4; // upper nibble is scale + vscale=(0x8000>>((12-code)-1)); // very strange. 0x8000 would be .5 in 16:16 format + // so this appears to be a fractional scale based + // on the 12 based inverse of the scale value. note + // that this could be negative, in which case we do + // not use the calculated vscale value... see the + // if(code>12) check below + + inPtr++; // coded adpcm data lies next + j=0; + while(j<8) // loop of 8, for 8 coded nibbles from 4 bytes + // which yields 8 short pcm values + { + icode=BufferSpace[(0x4f0+inPtr)^S8]; + inPtr++; + + inp1[j]=(s16)((icode&0xf0)<<8); // this will in effect be signed + if(code<12) + inp1[j]=((int)((int)inp1[j]*(int)vscale)>>16); + /*else + int catchme=1;*/ + j++; + + inp1[j]=(s16)((icode&0xf)<<12); + if(code<12) + inp1[j]=((int)((int)inp1[j]*(int)vscale)>>16); + /*else + int catchme=1;*/ + j++; + } + j=0; + while(j<8) + { + icode=BufferSpace[(0x4f0+inPtr)^S8]; + inPtr++; + + inp2[j]=(short)((icode&0xf0)<<8); // this will in effect be signed + if(code<12) + inp2[j]=((int)((int)inp2[j]*(int)vscale)>>16); + /*else + int catchme=1;*/ + j++; + + inp2[j]=(short)((icode&0xf)<<12); + if(code<12) + inp2[j]=((int)((int)inp2[j]*(int)vscale)>>16); + /*else + int catchme=1;*/ + j++; + } + + a[0]= (int)book1[0]*(int)l1; + a[0]+=(int)book2[0]*(int)l2; + a[0]+=(int)inp1[0]*(int)2048; + + a[1] =(int)book1[1]*(int)l1; + a[1]+=(int)book2[1]*(int)l2; + a[1]+=(int)book2[0]*inp1[0]; + a[1]+=(int)inp1[1]*(int)2048; + + a[2] =(int)book1[2]*(int)l1; + a[2]+=(int)book2[2]*(int)l2; + a[2]+=(int)book2[1]*inp1[0]; + a[2]+=(int)book2[0]*inp1[1]; + a[2]+=(int)inp1[2]*(int)2048; + + a[3] =(int)book1[3]*(int)l1; + a[3]+=(int)book2[3]*(int)l2; + a[3]+=(int)book2[2]*inp1[0]; + a[3]+=(int)book2[1]*inp1[1]; + a[3]+=(int)book2[0]*inp1[2]; + a[3]+=(int)inp1[3]*(int)2048; + + a[4] =(int)book1[4]*(int)l1; + a[4]+=(int)book2[4]*(int)l2; + a[4]+=(int)book2[3]*inp1[0]; + a[4]+=(int)book2[2]*inp1[1]; + a[4]+=(int)book2[1]*inp1[2]; + a[4]+=(int)book2[0]*inp1[3]; + a[4]+=(int)inp1[4]*(int)2048; + + a[5] =(int)book1[5]*(int)l1; + a[5]+=(int)book2[5]*(int)l2; + a[5]+=(int)book2[4]*inp1[0]; + a[5]+=(int)book2[3]*inp1[1]; + a[5]+=(int)book2[2]*inp1[2]; + a[5]+=(int)book2[1]*inp1[3]; + a[5]+=(int)book2[0]*inp1[4]; + a[5]+=(int)inp1[5]*(int)2048; + + a[6] =(int)book1[6]*(int)l1; + a[6]+=(int)book2[6]*(int)l2; + a[6]+=(int)book2[5]*inp1[0]; + a[6]+=(int)book2[4]*inp1[1]; + a[6]+=(int)book2[3]*inp1[2]; + a[6]+=(int)book2[2]*inp1[3]; + a[6]+=(int)book2[1]*inp1[4]; + a[6]+=(int)book2[0]*inp1[5]; + a[6]+=(int)inp1[6]*(int)2048; + + a[7] =(int)book1[7]*(int)l1; + a[7]+=(int)book2[7]*(int)l2; + a[7]+=(int)book2[6]*inp1[0]; + a[7]+=(int)book2[5]*inp1[1]; + a[7]+=(int)book2[4]*inp1[2]; + a[7]+=(int)book2[3]*inp1[3]; + a[7]+=(int)book2[2]*inp1[4]; + a[7]+=(int)book2[1]*inp1[5]; + a[7]+=(int)book2[0]*inp1[6]; + a[7]+=(int)inp1[7]*(int)2048; + + for(j=0;j<8;j++) + { + a[j^S]>>=11; + if(a[j^S]>32767) a[j^S]=32767; + else if(a[j^S]<-32768) a[j^S]=-32768; + *(out++)=a[j^S]; + //*(out+j)=a[j^S]; + } + //out += 0x10; + l1=a[6]; + l2=a[7]; + + a[0]= (int)book1[0]*(int)l1; + a[0]+=(int)book2[0]*(int)l2; + a[0]+=(int)inp2[0]*(int)2048; + + a[1] =(int)book1[1]*(int)l1; + a[1]+=(int)book2[1]*(int)l2; + a[1]+=(int)book2[0]*inp2[0]; + a[1]+=(int)inp2[1]*(int)2048; + + a[2] =(int)book1[2]*(int)l1; + a[2]+=(int)book2[2]*(int)l2; + a[2]+=(int)book2[1]*inp2[0]; + a[2]+=(int)book2[0]*inp2[1]; + a[2]+=(int)inp2[2]*(int)2048; + + a[3] =(int)book1[3]*(int)l1; + a[3]+=(int)book2[3]*(int)l2; + a[3]+=(int)book2[2]*inp2[0]; + a[3]+=(int)book2[1]*inp2[1]; + a[3]+=(int)book2[0]*inp2[2]; + a[3]+=(int)inp2[3]*(int)2048; + + a[4] =(int)book1[4]*(int)l1; + a[4]+=(int)book2[4]*(int)l2; + a[4]+=(int)book2[3]*inp2[0]; + a[4]+=(int)book2[2]*inp2[1]; + a[4]+=(int)book2[1]*inp2[2]; + a[4]+=(int)book2[0]*inp2[3]; + a[4]+=(int)inp2[4]*(int)2048; + + a[5] =(int)book1[5]*(int)l1; + a[5]+=(int)book2[5]*(int)l2; + a[5]+=(int)book2[4]*inp2[0]; + a[5]+=(int)book2[3]*inp2[1]; + a[5]+=(int)book2[2]*inp2[2]; + a[5]+=(int)book2[1]*inp2[3]; + a[5]+=(int)book2[0]*inp2[4]; + a[5]+=(int)inp2[5]*(int)2048; + + a[6] =(int)book1[6]*(int)l1; + a[6]+=(int)book2[6]*(int)l2; + a[6]+=(int)book2[5]*inp2[0]; + a[6]+=(int)book2[4]*inp2[1]; + a[6]+=(int)book2[3]*inp2[2]; + a[6]+=(int)book2[2]*inp2[3]; + a[6]+=(int)book2[1]*inp2[4]; + a[6]+=(int)book2[0]*inp2[5]; + a[6]+=(int)inp2[6]*(int)2048; + + a[7] =(int)book1[7]*(int)l1; + a[7]+=(int)book2[7]*(int)l2; + a[7]+=(int)book2[6]*inp2[0]; + a[7]+=(int)book2[5]*inp2[1]; + a[7]+=(int)book2[4]*inp2[2]; + a[7]+=(int)book2[3]*inp2[3]; + a[7]+=(int)book2[2]*inp2[4]; + a[7]+=(int)book2[1]*inp2[5]; + a[7]+=(int)book2[0]*inp2[6]; + a[7]+=(int)inp2[7]*(int)2048; + + for(j=0;j<8;j++) + { + a[j^S]>>=11; + if(a[j^S]>32767) a[j^S]=32767; + else if(a[j^S]<-32768) a[j^S]=-32768; + *(out++)=a[j^S]; + //*(out+j+0x1f8)=a[j^S]; + } + l1=a[6]; + l2=a[7]; + + count-=32; + } + out-=16; + memcpy(&rsp.RDRAM[Address],out,32); +} + +static void RESAMPLE3 (u32 inst1, u32 inst2) { + unsigned char Flags=(u8)((inst2>>0x1e)); + unsigned int Pitch=((inst2>>0xe)&0xffff)<<1; + u32 addy = (inst1 & 0xffffff); + unsigned int Accum=0; + unsigned int location; + s16 *lut; + short *dst; + s16 *src; + dst=(short *)(BufferSpace); + src=(s16 *)(BufferSpace); + u32 srcPtr=((((inst2>>2)&0xfff)+0x4f0)/2); + u32 dstPtr;//=(AudioOutBuffer/2); + s32 temp; + s32 accum; + + //if (addy > (1024*1024*8)) + // addy = (inst2 & 0xffffff); + + srcPtr -= 4; + + if (inst2 & 0x3) { + dstPtr = 0x660/2; + } else { + dstPtr = 0x4f0/2; + } + + if ((Flags & 0x1) == 0) { + for (int x=0; x < 4; x++) //memcpy (src+srcPtr, rsp.RDRAM+addy, 0x8); + src[(srcPtr+x)^S] = ((u16 *)rsp.RDRAM)[((addy/2)+x)^S]; + Accum = *(u16 *)(rsp.RDRAM+addy+10); + } else { + for (int x=0; x < 4; x++) + src[(srcPtr+x)^S] = 0;//*(u16 *)(rsp.RDRAM+((addy+x)^2)); + } + + for(int i=0;i < 0x170/2;i++) { + location = (((Accum * 0x40) >> 0x10) * 8); + //location = (Accum >> 0xa) << 0x3; + lut = (s16 *)(((u8 *)ResampleLUT) + location); + + temp = ((s32)*(s16*)(src+((srcPtr+0)^S))*((s32)((s16)lut[0]))); + accum = (s32)(temp >> 15); + + temp = ((s32)*(s16*)(src+((srcPtr+1)^S))*((s32)((s16)lut[1]))); + accum += (s32)(temp >> 15); + + temp = ((s32)*(s16*)(src+((srcPtr+2)^S))*((s32)((s16)lut[2]))); + accum += (s32)(temp >> 15); + + temp = ((s32)*(s16*)(src+((srcPtr+3)^S))*((s32)((s16)lut[3]))); + accum += (s32)(temp >> 15); +/* temp = ((s64)*(s16*)(src+((srcPtr+0)^S))*((s64)((s16)lut[0]<<1))); + if (temp & 0x8000) temp = (temp^0x8000) + 0x10000; + else temp = (temp^0x8000); + temp = (s32)(temp >> 16); + if ((s32)temp > 32767) temp = 32767; + if ((s32)temp < -32768) temp = -32768; + accum = (s32)(s16)temp; + + temp = ((s64)*(s16*)(src+((srcPtr+1)^S))*((s64)((s16)lut[1]<<1))); + if (temp & 0x8000) temp = (temp^0x8000) + 0x10000; + else temp = (temp^0x8000); + temp = (s32)(temp >> 16); + if ((s32)temp > 32767) temp = 32767; + if ((s32)temp < -32768) temp = -32768; + accum += (s32)(s16)temp; + + temp = ((s64)*(s16*)(src+((srcPtr+2)^S))*((s64)((s16)lut[2]<<1))); + if (temp & 0x8000) temp = (temp^0x8000) + 0x10000; + else temp = (temp^0x8000); + temp = (s32)(temp >> 16); + if ((s32)temp > 32767) temp = 32767; + if ((s32)temp < -32768) temp = -32768; + accum += (s32)(s16)temp; + + temp = ((s64)*(s16*)(src+((srcPtr+3)^S))*((s64)((s16)lut[3]<<1))); + if (temp & 0x8000) temp = (temp^0x8000) + 0x10000; + else temp = (temp^0x8000); + temp = (s32)(temp >> 16); + if ((s32)temp > 32767) temp = 32767; + if ((s32)temp < -32768) temp = -32768; + accum += (s32)(s16)temp;*/ + + if (accum > 32767) accum = 32767; + if (accum < -32768) accum = -32768; + + dst[dstPtr^S] = (accum); + dstPtr++; + Accum += Pitch; + srcPtr += (Accum>>16); + Accum&=0xffff; + } + for (int x=0; x < 4; x++) + ((u16 *)rsp.RDRAM)[((addy/2)+x)^S] = src[(srcPtr+x)^S]; + *(u16 *)(rsp.RDRAM+addy+10) = Accum; +} + +static void INTERLEAVE3 (u32 inst1, u32 inst2) { // Needs accuracy verification... + //u32 inL, inR; + u16 *outbuff = (u16 *)(BufferSpace + 0x4f0);//(u16 *)(AudioOutBuffer+dmem); + u16 *inSrcR; + u16 *inSrcL; + u16 Left, Right, Left2, Right2; + + //inR = inst2 & 0xFFFF; + //inL = (inst2 >> 16) & 0xFFFF; + + inSrcR = (u16 *)(BufferSpace+0xb40); + inSrcL = (u16 *)(BufferSpace+0x9d0); + + for (int x = 0; x < (0x170/4); x++) { + Left=*(inSrcL++); + Right=*(inSrcR++); + Left2=*(inSrcL++); + Right2=*(inSrcR++); + +#ifdef M64P_BIG_ENDIAN + *(outbuff++)=Right; + *(outbuff++)=Left; + *(outbuff++)=Right2; + *(outbuff++)=Left2; +#else + *(outbuff++)=Right2; + *(outbuff++)=Left2; + *(outbuff++)=Right; + *(outbuff++)=Left; +#endif +/* + Left=*(inSrcL++); + Right=*(inSrcR++); + *(outbuff++)=(u16)Left; + Left >>= 16; + *(outbuff++)=(u16)Right; + Right >>= 16; + *(outbuff++)=(u16)Left; + *(outbuff++)=(u16)Right;*/ + } +} + +//static void UNKNOWN (u32 inst1, u32 inst2); +/* +typedef struct { + unsigned char sync; + + unsigned char error_protection : 1; // 0=yes, 1=no + unsigned char lay : 2; // 4-lay = layerI, II or III + unsigned char version : 1; // 3=mpeg 1.0, 2=mpeg 2.5 0=mpeg 2.0 + unsigned char sync2 : 4; + + unsigned char extension : 1; // Unknown + unsigned char padding : 1; // padding + unsigned char sampling_freq : 2; // see table below + unsigned char bitrate_index : 4; // see table below + + unsigned char emphasis : 2; //see table below + unsigned char original : 1; // 0=no 1=yes + unsigned char copyright : 1; // 0=no 1=yes + unsigned char mode_ext : 2; // used with "joint stereo" mode + unsigned char mode : 2; // Channel Mode +} mp3struct; + +mp3struct mp3; +FILE *mp3dat; +*/ + +static void WHATISTHIS (u32 inst1, u32 inst2) { +} + +//static FILE *fp = fopen ("d:\\mp3info.txt", "wt"); +u32 setaddr; +static void MP3ADDY (u32 inst1, u32 inst2) { + setaddr = (inst2 & 0xffffff); +} + +extern "C" { + void rsp_run(void); + void mp3setup (unsigned int inst1, unsigned int inst2, unsigned int t8); +} + +extern u32 base, dmembase; +extern "C" { + extern char *pDMEM; +} +void MP3 (u32 inst1, u32 inst2); +/* + { +// return; + // Setup Registers... + mp3setup (inst1, inst2, 0xFA0); + + // Setup Memory Locations... + //u32 base = ((u32*)dmem)[0xFD0/4]; // Should be 000291A0 + memcpy (BufferSpace, dmembase+rsp.RDRAM, 0x10); + ((u32*)BufferSpace)[0x0] = base; + ((u32*)BufferSpace)[0x008/4] += base; + ((u32*)BufferSpace)[0xFFC/4] = loopval; + ((u32*)BufferSpace)[0xFF8/4] = dmembase; + + memcpy (imem+0x238, rsp.RDRAM+((u32*)BufferSpace)[0x008/4], 0x9C0); + ((u32*)BufferSpace)[0xFF4/4] = setaddr; + pDMEM = (char *)BufferSpace; + rsp_run (void); + dmembase = ((u32*)BufferSpace)[0xFF8/4]; + loopval = ((u32*)BufferSpace)[0xFFC/4]; +//0x1A98 SW S1, 0x0FF4 (R0) +//0x1A9C SW S0, 0x0FF8 (R0) +//0x1AA0 SW T7, 0x0FFC (R0) +//0x1AA4 SW T3, 0x0FF0 (R0) + //fprintf (fp, "mp3: inst1: %08X, inst2: %08X\n", inst1, inst2); +}*/ +/* +FFT = Fast Fourier Transform +DCT = Discrete Cosine Transform +MPEG-1 Layer 3 retains Layer 2's 1152-sample window, as well as the FFT polyphase filter for +backward compatibility, but adds a modified DCT filter. DCT's advantages over DFTs (discrete +Fourier transforms) include half as many multiply-accumulate operations and half the +generated coefficients because the sinusoidal portion of the calculation is absent, and DCT +generally involves simpler math. The finite lengths of a conventional DCTs' bandpass impulse +responses, however, may result in block-boundary effects. MDCTs overlap the analysis blocks +and lowpass-filter the decoded audio to remove aliases, eliminating these effects. MDCTs also +have a higher transform coding gain than the standard DCT, and their basic functions +correspond to better bandpass response. + +MPEG-1 Layer 3's DCT sub-bands are unequally sized, and correspond to the human auditory +system's critical bands. In Layer 3 decoders must support both constant- and variable-bit-rate +bit streams. (However, many Layer 1 and 2 decoders also handle variable bit rates). Finally, +Layer 3 encoders Huffman-code the quantized coefficients before archiving or transmission for +additional lossless compression. Bit streams range from 32 to 320 kbps, and 128-kbps rates +achieve near-CD quality, an important specification to enable dual-channel ISDN +(integrated-services-digital-network) to be the future high-bandwidth pipe to the home. + +*/ +static void DISABLE (u32 inst1, u32 inst2) { + //MessageBox (NULL, "Help", "ABI 3 Command 0", MB_OK); + //ChangeABI (5); +} + + +extern "C" const acmd_callback_t ABI3[0x10] = { + DISABLE , ADPCM3 , CLEARBUFF3, ENVMIXER3 , LOADBUFF3, RESAMPLE3 , SAVEBUFF3, MP3, + MP3ADDY, SETVOL3, DMEMMOVE3 , LOADADPCM3 , MIXER3 , INTERLEAVE3, WHATISTHIS , SETLOOP3 +}; + + diff --git a/libmupen64plus/mupen64plus-rsp-hle/src/ucode3mp3.cpp b/libmupen64plus/mupen64plus-rsp-hle/src/ucode3mp3.cpp new file mode 100644 index 0000000000..21caa33772 --- /dev/null +++ b/libmupen64plus/mupen64plus-rsp-hle/src/ucode3mp3.cpp @@ -0,0 +1,604 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-rsp-hle - ucode3mp3.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +# include +# include + +extern "C" { + #include "hle.h" + #include "alist_internal.h" +} + +static const u16 DeWindowLUT [0x420] = { + 0x0000, 0xFFF3, 0x005D, 0xFF38, 0x037A, 0xF736, 0x0B37, 0xC00E, + 0x7FFF, 0x3FF2, 0x0B37, 0x08CA, 0x037A, 0x00C8, 0x005D, 0x000D, + 0x0000, 0xFFF3, 0x005D, 0xFF38, 0x037A, 0xF736, 0x0B37, 0xC00E, + 0x7FFF, 0x3FF2, 0x0B37, 0x08CA, 0x037A, 0x00C8, 0x005D, 0x000D, + 0x0000, 0xFFF2, 0x005F, 0xFF1D, 0x0369, 0xF697, 0x0A2A, 0xBCE7, + 0x7FEB, 0x3CCB, 0x0C2B, 0x082B, 0x0385, 0x00AF, 0x005B, 0x000B, + 0x0000, 0xFFF2, 0x005F, 0xFF1D, 0x0369, 0xF697, 0x0A2A, 0xBCE7, + 0x7FEB, 0x3CCB, 0x0C2B, 0x082B, 0x0385, 0x00AF, 0x005B, 0x000B, + 0x0000, 0xFFF1, 0x0061, 0xFF02, 0x0354, 0xF5F9, 0x0905, 0xB9C4, + 0x7FB0, 0x39A4, 0x0D08, 0x078C, 0x038C, 0x0098, 0x0058, 0x000A, + 0x0000, 0xFFF1, 0x0061, 0xFF02, 0x0354, 0xF5F9, 0x0905, 0xB9C4, + 0x7FB0, 0x39A4, 0x0D08, 0x078C, 0x038C, 0x0098, 0x0058, 0x000A, + 0x0000, 0xFFEF, 0x0062, 0xFEE6, 0x033B, 0xF55C, 0x07C8, 0xB6A4, + 0x7F4D, 0x367E, 0x0DCE, 0x06EE, 0x038F, 0x0080, 0x0056, 0x0009, + 0x0000, 0xFFEF, 0x0062, 0xFEE6, 0x033B, 0xF55C, 0x07C8, 0xB6A4, + 0x7F4D, 0x367E, 0x0DCE, 0x06EE, 0x038F, 0x0080, 0x0056, 0x0009, + 0x0000, 0xFFEE, 0x0063, 0xFECA, 0x031C, 0xF4C3, 0x0671, 0xB38C, + 0x7EC2, 0x335D, 0x0E7C, 0x0652, 0x038E, 0x006B, 0x0053, 0x0008, + 0x0000, 0xFFEE, 0x0063, 0xFECA, 0x031C, 0xF4C3, 0x0671, 0xB38C, + 0x7EC2, 0x335D, 0x0E7C, 0x0652, 0x038E, 0x006B, 0x0053, 0x0008, + 0x0000, 0xFFEC, 0x0064, 0xFEAC, 0x02F7, 0xF42C, 0x0502, 0xB07C, + 0x7E12, 0x3041, 0x0F14, 0x05B7, 0x038A, 0x0056, 0x0050, 0x0007, + 0x0000, 0xFFEC, 0x0064, 0xFEAC, 0x02F7, 0xF42C, 0x0502, 0xB07C, + 0x7E12, 0x3041, 0x0F14, 0x05B7, 0x038A, 0x0056, 0x0050, 0x0007, + 0x0000, 0xFFEB, 0x0064, 0xFE8E, 0x02CE, 0xF399, 0x037A, 0xAD75, + 0x7D3A, 0x2D2C, 0x0F97, 0x0520, 0x0382, 0x0043, 0x004D, 0x0007, + 0x0000, 0xFFEB, 0x0064, 0xFE8E, 0x02CE, 0xF399, 0x037A, 0xAD75, + 0x7D3A, 0x2D2C, 0x0F97, 0x0520, 0x0382, 0x0043, 0x004D, 0x0007, + 0xFFFF, 0xFFE9, 0x0063, 0xFE6F, 0x029E, 0xF30B, 0x01D8, 0xAA7B, + 0x7C3D, 0x2A1F, 0x1004, 0x048B, 0x0377, 0x0030, 0x004A, 0x0006, + 0xFFFF, 0xFFE9, 0x0063, 0xFE6F, 0x029E, 0xF30B, 0x01D8, 0xAA7B, + 0x7C3D, 0x2A1F, 0x1004, 0x048B, 0x0377, 0x0030, 0x004A, 0x0006, + 0xFFFF, 0xFFE7, 0x0062, 0xFE4F, 0x0269, 0xF282, 0x001F, 0xA78D, + 0x7B1A, 0x271C, 0x105D, 0x03F9, 0x036A, 0x001F, 0x0046, 0x0006, + 0xFFFF, 0xFFE7, 0x0062, 0xFE4F, 0x0269, 0xF282, 0x001F, 0xA78D, + 0x7B1A, 0x271C, 0x105D, 0x03F9, 0x036A, 0x001F, 0x0046, 0x0006, + 0xFFFF, 0xFFE4, 0x0061, 0xFE2F, 0x022F, 0xF1FF, 0xFE4C, 0xA4AF, + 0x79D3, 0x2425, 0x10A2, 0x036C, 0x0359, 0x0010, 0x0043, 0x0005, + 0xFFFF, 0xFFE4, 0x0061, 0xFE2F, 0x022F, 0xF1FF, 0xFE4C, 0xA4AF, + 0x79D3, 0x2425, 0x10A2, 0x036C, 0x0359, 0x0010, 0x0043, 0x0005, + 0xFFFF, 0xFFE2, 0x005E, 0xFE10, 0x01EE, 0xF184, 0xFC61, 0xA1E1, + 0x7869, 0x2139, 0x10D3, 0x02E3, 0x0346, 0x0001, 0x0040, 0x0004, + 0xFFFF, 0xFFE2, 0x005E, 0xFE10, 0x01EE, 0xF184, 0xFC61, 0xA1E1, + 0x7869, 0x2139, 0x10D3, 0x02E3, 0x0346, 0x0001, 0x0040, 0x0004, + 0xFFFF, 0xFFE0, 0x005B, 0xFDF0, 0x01A8, 0xF111, 0xFA5F, 0x9F27, + 0x76DB, 0x1E5C, 0x10F2, 0x025E, 0x0331, 0xFFF3, 0x003D, 0x0004, + 0xFFFF, 0xFFE0, 0x005B, 0xFDF0, 0x01A8, 0xF111, 0xFA5F, 0x9F27, + 0x76DB, 0x1E5C, 0x10F2, 0x025E, 0x0331, 0xFFF3, 0x003D, 0x0004, + 0xFFFF, 0xFFDE, 0x0057, 0xFDD0, 0x015B, 0xF0A7, 0xF845, 0x9C80, + 0x752C, 0x1B8E, 0x1100, 0x01DE, 0x0319, 0xFFE7, 0x003A, 0x0003, + 0xFFFF, 0xFFDE, 0x0057, 0xFDD0, 0x015B, 0xF0A7, 0xF845, 0x9C80, + 0x752C, 0x1B8E, 0x1100, 0x01DE, 0x0319, 0xFFE7, 0x003A, 0x0003, + 0xFFFE, 0xFFDB, 0x0053, 0xFDB0, 0x0108, 0xF046, 0xF613, 0x99EE, + 0x735C, 0x18D1, 0x10FD, 0x0163, 0x0300, 0xFFDC, 0x0037, 0x0003, + 0xFFFE, 0xFFDB, 0x0053, 0xFDB0, 0x0108, 0xF046, 0xF613, 0x99EE, + 0x735C, 0x18D1, 0x10FD, 0x0163, 0x0300, 0xFFDC, 0x0037, 0x0003, + 0xFFFE, 0xFFD8, 0x004D, 0xFD90, 0x00B0, 0xEFF0, 0xF3CC, 0x9775, + 0x716C, 0x1624, 0x10EA, 0x00EE, 0x02E5, 0xFFD2, 0x0033, 0x0003, + 0xFFFE, 0xFFD8, 0x004D, 0xFD90, 0x00B0, 0xEFF0, 0xF3CC, 0x9775, + 0x716C, 0x1624, 0x10EA, 0x00EE, 0x02E5, 0xFFD2, 0x0033, 0x0003, + 0xFFFE, 0xFFD6, 0x0047, 0xFD72, 0x0051, 0xEFA6, 0xF16F, 0x9514, + 0x6F5E, 0x138A, 0x10C8, 0x007E, 0x02CA, 0xFFC9, 0x0030, 0x0003, + 0xFFFE, 0xFFD6, 0x0047, 0xFD72, 0x0051, 0xEFA6, 0xF16F, 0x9514, + 0x6F5E, 0x138A, 0x10C8, 0x007E, 0x02CA, 0xFFC9, 0x0030, 0x0003, + 0xFFFE, 0xFFD3, 0x0040, 0xFD54, 0xFFEC, 0xEF68, 0xEEFC, 0x92CD, + 0x6D33, 0x1104, 0x1098, 0x0014, 0x02AC, 0xFFC0, 0x002D, 0x0002, + 0xFFFE, 0xFFD3, 0x0040, 0xFD54, 0xFFEC, 0xEF68, 0xEEFC, 0x92CD, + 0x6D33, 0x1104, 0x1098, 0x0014, 0x02AC, 0xFFC0, 0x002D, 0x0002, + 0x0030, 0xFFC9, 0x02CA, 0x007E, 0x10C8, 0x138A, 0x6F5E, 0x9514, + 0xF16F, 0xEFA6, 0x0051, 0xFD72, 0x0047, 0xFFD6, 0xFFFE, 0x0003, + 0x0030, 0xFFC9, 0x02CA, 0x007E, 0x10C8, 0x138A, 0x6F5E, 0x9514, + 0xF16F, 0xEFA6, 0x0051, 0xFD72, 0x0047, 0xFFD6, 0xFFFE, 0x0003, + 0x0033, 0xFFD2, 0x02E5, 0x00EE, 0x10EA, 0x1624, 0x716C, 0x9775, + 0xF3CC, 0xEFF0, 0x00B0, 0xFD90, 0x004D, 0xFFD8, 0xFFFE, 0x0003, + 0x0033, 0xFFD2, 0x02E5, 0x00EE, 0x10EA, 0x1624, 0x716C, 0x9775, + 0xF3CC, 0xEFF0, 0x00B0, 0xFD90, 0x004D, 0xFFD8, 0xFFFE, 0x0003, + 0x0037, 0xFFDC, 0x0300, 0x0163, 0x10FD, 0x18D1, 0x735C, 0x99EE, + 0xF613, 0xF046, 0x0108, 0xFDB0, 0x0053, 0xFFDB, 0xFFFE, 0x0003, + 0x0037, 0xFFDC, 0x0300, 0x0163, 0x10FD, 0x18D1, 0x735C, 0x99EE, + 0xF613, 0xF046, 0x0108, 0xFDB0, 0x0053, 0xFFDB, 0xFFFE, 0x0003, + 0x003A, 0xFFE7, 0x0319, 0x01DE, 0x1100, 0x1B8E, 0x752C, 0x9C80, + 0xF845, 0xF0A7, 0x015B, 0xFDD0, 0x0057, 0xFFDE, 0xFFFF, 0x0003, + 0x003A, 0xFFE7, 0x0319, 0x01DE, 0x1100, 0x1B8E, 0x752C, 0x9C80, + 0xF845, 0xF0A7, 0x015B, 0xFDD0, 0x0057, 0xFFDE, 0xFFFF, 0x0004, + 0x003D, 0xFFF3, 0x0331, 0x025E, 0x10F2, 0x1E5C, 0x76DB, 0x9F27, + 0xFA5F, 0xF111, 0x01A8, 0xFDF0, 0x005B, 0xFFE0, 0xFFFF, 0x0004, + 0x003D, 0xFFF3, 0x0331, 0x025E, 0x10F2, 0x1E5C, 0x76DB, 0x9F27, + 0xFA5F, 0xF111, 0x01A8, 0xFDF0, 0x005B, 0xFFE0, 0xFFFF, 0x0004, + 0x0040, 0x0001, 0x0346, 0x02E3, 0x10D3, 0x2139, 0x7869, 0xA1E1, + 0xFC61, 0xF184, 0x01EE, 0xFE10, 0x005E, 0xFFE2, 0xFFFF, 0x0004, + 0x0040, 0x0001, 0x0346, 0x02E3, 0x10D3, 0x2139, 0x7869, 0xA1E1, + 0xFC61, 0xF184, 0x01EE, 0xFE10, 0x005E, 0xFFE2, 0xFFFF, 0x0005, + 0x0043, 0x0010, 0x0359, 0x036C, 0x10A2, 0x2425, 0x79D3, 0xA4AF, + 0xFE4C, 0xF1FF, 0x022F, 0xFE2F, 0x0061, 0xFFE4, 0xFFFF, 0x0005, + 0x0043, 0x0010, 0x0359, 0x036C, 0x10A2, 0x2425, 0x79D3, 0xA4AF, + 0xFE4C, 0xF1FF, 0x022F, 0xFE2F, 0x0061, 0xFFE4, 0xFFFF, 0x0006, + 0x0046, 0x001F, 0x036A, 0x03F9, 0x105D, 0x271C, 0x7B1A, 0xA78D, + 0x001F, 0xF282, 0x0269, 0xFE4F, 0x0062, 0xFFE7, 0xFFFF, 0x0006, + 0x0046, 0x001F, 0x036A, 0x03F9, 0x105D, 0x271C, 0x7B1A, 0xA78D, + 0x001F, 0xF282, 0x0269, 0xFE4F, 0x0062, 0xFFE7, 0xFFFF, 0x0006, + 0x004A, 0x0030, 0x0377, 0x048B, 0x1004, 0x2A1F, 0x7C3D, 0xAA7B, + 0x01D8, 0xF30B, 0x029E, 0xFE6F, 0x0063, 0xFFE9, 0xFFFF, 0x0006, + 0x004A, 0x0030, 0x0377, 0x048B, 0x1004, 0x2A1F, 0x7C3D, 0xAA7B, + 0x01D8, 0xF30B, 0x029E, 0xFE6F, 0x0063, 0xFFE9, 0xFFFF, 0x0007, + 0x004D, 0x0043, 0x0382, 0x0520, 0x0F97, 0x2D2C, 0x7D3A, 0xAD75, + 0x037A, 0xF399, 0x02CE, 0xFE8E, 0x0064, 0xFFEB, 0x0000, 0x0007, + 0x004D, 0x0043, 0x0382, 0x0520, 0x0F97, 0x2D2C, 0x7D3A, 0xAD75, + 0x037A, 0xF399, 0x02CE, 0xFE8E, 0x0064, 0xFFEB, 0x0000, 0x0007, + 0x0050, 0x0056, 0x038A, 0x05B7, 0x0F14, 0x3041, 0x7E12, 0xB07C, + 0x0502, 0xF42C, 0x02F7, 0xFEAC, 0x0064, 0xFFEC, 0x0000, 0x0007, + 0x0050, 0x0056, 0x038A, 0x05B7, 0x0F14, 0x3041, 0x7E12, 0xB07C, + 0x0502, 0xF42C, 0x02F7, 0xFEAC, 0x0064, 0xFFEC, 0x0000, 0x0008, + 0x0053, 0x006B, 0x038E, 0x0652, 0x0E7C, 0x335D, 0x7EC2, 0xB38C, + 0x0671, 0xF4C3, 0x031C, 0xFECA, 0x0063, 0xFFEE, 0x0000, 0x0008, + 0x0053, 0x006B, 0x038E, 0x0652, 0x0E7C, 0x335D, 0x7EC2, 0xB38C, + 0x0671, 0xF4C3, 0x031C, 0xFECA, 0x0063, 0xFFEE, 0x0000, 0x0009, + 0x0056, 0x0080, 0x038F, 0x06EE, 0x0DCE, 0x367E, 0x7F4D, 0xB6A4, + 0x07C8, 0xF55C, 0x033B, 0xFEE6, 0x0062, 0xFFEF, 0x0000, 0x0009, + 0x0056, 0x0080, 0x038F, 0x06EE, 0x0DCE, 0x367E, 0x7F4D, 0xB6A4, + 0x07C8, 0xF55C, 0x033B, 0xFEE6, 0x0062, 0xFFEF, 0x0000, 0x000A, + 0x0058, 0x0098, 0x038C, 0x078C, 0x0D08, 0x39A4, 0x7FB0, 0xB9C4, + 0x0905, 0xF5F9, 0x0354, 0xFF02, 0x0061, 0xFFF1, 0x0000, 0x000A, + 0x0058, 0x0098, 0x038C, 0x078C, 0x0D08, 0x39A4, 0x7FB0, 0xB9C4, + 0x0905, 0xF5F9, 0x0354, 0xFF02, 0x0061, 0xFFF1, 0x0000, 0x000B, + 0x005B, 0x00AF, 0x0385, 0x082B, 0x0C2B, 0x3CCB, 0x7FEB, 0xBCE7, + 0x0A2A, 0xF697, 0x0369, 0xFF1D, 0x005F, 0xFFF2, 0x0000, 0x000B, + 0x005B, 0x00AF, 0x0385, 0x082B, 0x0C2B, 0x3CCB, 0x7FEB, 0xBCE7, + 0x0A2A, 0xF697, 0x0369, 0xFF1D, 0x005F, 0xFFF2, 0x0000, 0x000D, + 0x005D, 0x00C8, 0x037A, 0x08CA, 0x0B37, 0x3FF2, 0x7FFF, 0xC00E, + 0x0B37, 0xF736, 0x037A, 0xFF38, 0x005D, 0xFFF3, 0x0000, 0x000D, + 0x005D, 0x00C8, 0x037A, 0x08CA, 0x0B37, 0x3FF2, 0x7FFF, 0xC00E, + 0x0B37, 0xF736, 0x037A, 0xFF38, 0x005D, 0xFFF3, 0x0000, 0x0000 +}; + +//static u16 myVector[32][8]; + +static u8 mp3data[0x1000]; + +static s32 v[32]; + +static void MP3AB0 () { + // Part 2 - 100% Accurate + const u16 LUT2[8] = { 0xFEC4, 0xF4FA, 0xC5E4, 0xE1C4, + 0x1916, 0x4A50, 0xA268, 0x78AE }; + const u16 LUT3[4] = { 0xFB14, 0xD4DC, 0x31F2, 0x8E3A }; + int i; + + for (i = 0; i < 8; i++) { + v[16+i] = v[0+i] + v[8+i]; + v[24+i] = ((v[0+i] - v[8+i]) * LUT2[i]) >> 0x10; + } + + // Part 3: 4-wide butterflies + + for (i=0; i < 4; i++) { + v[0+i] = v[16+i] + v[20+i]; + v[4+i] = ((v[16+i] - v[20+i]) * LUT3[i]) >> 0x10; + + v[8+i] = v[24+i] + v[28+i]; + v[12+i] = ((v[24+i] - v[28+i]) * LUT3[i]) >> 0x10; + } + + // Part 4: 2-wide butterflies - 100% Accurate + + for (i = 0; i < 16; i+=4) { + v[16+i] = v[0+i] + v[2+i]; + v[18+i] = ((v[0+i] - v[2+i]) * 0xEC84) >> 0x10; + + v[17+i] = v[1+i] + v[3+i]; + v[19+i] = ((v[1+i] - v[3+i]) * 0x61F8) >> 0x10; + } +} + +static void InnerLoop (); + +static u32 inPtr, outPtr; + +static u32 t6;// = 0x08A0; // I think these are temporary storage buffers +static u32 t5;// = 0x0AC0; +static u32 t4;// = (inst1 & 0x1E); + +void MP3 (u32 inst1, u32 inst2) { + // Initialization Code + u32 readPtr; // s5 + u32 writePtr; // s6 + //u32 Count = 0x0480; // s4 + u32 tmp; + //u32 inPtr, outPtr; + + t6 = 0x08A0; // I think these are temporary storage buffers + t5 = 0x0AC0; + t4 = (inst1 & 0x1E); + + writePtr = inst2 & 0xFFFFFF; + readPtr = writePtr; + memcpy (mp3data+0xCE8, rsp.RDRAM+readPtr, 8); // Just do that for efficiency... may remove and use directly later anyway + readPtr += 8; // This must be a header byte or whatnot + + for (int cnt = 0; cnt < 0x480; cnt += 0x180) { + memcpy (mp3data+0xCF0, rsp.RDRAM+readPtr, 0x180); // DMA: 0xCF0 <- RDRAM[s5] : 0x180 + inPtr = 0xCF0; // s7 + outPtr = 0xE70; // s3 +// --------------- Inner Loop Start -------------------- + for (int cnt2 = 0; cnt2 < 0x180; cnt2 += 0x40) { + t6 &= 0xFFE0; + t5 &= 0xFFE0; + t6 |= t4; + t5 |= t4; + InnerLoop (); + t4 = (t4-2)&0x1E; + tmp = t6; + t6 = t5; + t5 = tmp; + //outPtr += 0x40; + inPtr += 0x40; + } +// --------------- Inner Loop End -------------------- + memcpy (rsp.RDRAM+writePtr, mp3data+0xe70, 0x180); + writePtr += 0x180; + readPtr += 0x180; + } +} + + + +static void InnerLoop () { + // Part 1: 100% Accurate + + int i; + v[0] = *(s16 *)(mp3data+inPtr+(0x00^S16)); v[31] = *(s16 *)(mp3data+inPtr+(0x3E^S16)); v[0] += v[31]; + v[1] = *(s16 *)(mp3data+inPtr+(0x02^S16)); v[30] = *(s16 *)(mp3data+inPtr+(0x3C^S16)); v[1] += v[30]; + v[2] = *(s16 *)(mp3data+inPtr+(0x06^S16)); v[28] = *(s16 *)(mp3data+inPtr+(0x38^S16)); v[2] += v[28]; + v[3] = *(s16 *)(mp3data+inPtr+(0x04^S16)); v[29] = *(s16 *)(mp3data+inPtr+(0x3A^S16)); v[3] += v[29]; + + v[4] = *(s16 *)(mp3data+inPtr+(0x0E^S16)); v[24] = *(s16 *)(mp3data+inPtr+(0x30^S16)); v[4] += v[24]; + v[5] = *(s16 *)(mp3data+inPtr+(0x0C^S16)); v[25] = *(s16 *)(mp3data+inPtr+(0x32^S16)); v[5] += v[25]; + v[6] = *(s16 *)(mp3data+inPtr+(0x08^S16)); v[27] = *(s16 *)(mp3data+inPtr+(0x36^S16)); v[6] += v[27]; + v[7] = *(s16 *)(mp3data+inPtr+(0x0A^S16)); v[26] = *(s16 *)(mp3data+inPtr+(0x34^S16)); v[7] += v[26]; + + v[8] = *(s16 *)(mp3data+inPtr+(0x1E^S16)); v[16] = *(s16 *)(mp3data+inPtr+(0x20^S16)); v[8] += v[16]; + v[9] = *(s16 *)(mp3data+inPtr+(0x1C^S16)); v[17] = *(s16 *)(mp3data+inPtr+(0x22^S16)); v[9] += v[17]; + v[10]= *(s16 *)(mp3data+inPtr+(0x18^S16)); v[19] = *(s16 *)(mp3data+inPtr+(0x26^S16)); v[10]+= v[19]; + v[11]= *(s16 *)(mp3data+inPtr+(0x1A^S16)); v[18] = *(s16 *)(mp3data+inPtr+(0x24^S16)); v[11]+= v[18]; + + v[12]= *(s16 *)(mp3data+inPtr+(0x10^S16)); v[23] = *(s16 *)(mp3data+inPtr+(0x2E^S16)); v[12]+= v[23]; + v[13]= *(s16 *)(mp3data+inPtr+(0x12^S16)); v[22] = *(s16 *)(mp3data+inPtr+(0x2C^S16)); v[13]+= v[22]; + v[14]= *(s16 *)(mp3data+inPtr+(0x16^S16)); v[20] = *(s16 *)(mp3data+inPtr+(0x28^S16)); v[14]+= v[20]; + v[15]= *(s16 *)(mp3data+inPtr+(0x14^S16)); v[21] = *(s16 *)(mp3data+inPtr+(0x2A^S16)); v[15]+= v[21]; + + // Part 2-4 + + MP3AB0 (); + + // Part 5 - 1-Wide Butterflies - 100% Accurate but need SSVs!!! + + u32 t0 = t6 + 0x100; + u32 t1 = t6 + 0x200; + u32 t2 = t5 + 0x100; + u32 t3 = t5 + 0x200; + /*RSP_GPR[0x8].W = t0; + RSP_GPR[0x9].W = t1; + RSP_GPR[0xA].W = t2; + RSP_GPR[0xB].W = t3; + + RSP_Vect[0].DW[1] = 0xB504A57E00016A09; + RSP_Vect[0].DW[0] = 0x0002D4130005A827; +*/ + + // 0x13A8 + v[1] = 0; + v[11] = ((v[16] - v[17]) * 0xB504) >> 0x10; + + v[16] = -v[16] -v[17]; + v[2] = v[18] + v[19]; + // ** Store v[11] -> (T6 + 0)** + *(s16 *)(mp3data+((t6+(short)0x0))) = (short)v[11]; + + + v[11] = -v[11]; + // ** Store v[16] -> (T3 + 0)** + *(s16 *)(mp3data+((t3+(short)0x0))) = (short)v[16]; + // ** Store v[11] -> (T5 + 0)** + *(s16 *)(mp3data+((t5+(short)0x0))) = (short)v[11]; + // 0x13E8 - Verified.... + v[2] = -v[2]; + // ** Store v[2] -> (T2 + 0)** + *(s16 *)(mp3data+((t2+(short)0x0))) = (short)v[2]; + v[3] = (((v[18] - v[19]) * 0x16A09) >> 0x10) + v[2]; + // ** Store v[3] -> (T0 + 0)** + *(s16 *)(mp3data+((t0+(short)0x0))) = (short)v[3]; + // 0x1400 - Verified + v[4] = -v[20] -v[21]; + v[6] = v[22] + v[23]; + v[5] = ((v[20] - v[21]) * 0x16A09) >> 0x10; + // ** Store v[4] -> (T3 + 0xFF80) + *(s16 *)(mp3data+((t3+(short)0xFF80))) = (short)v[4]; + v[7] = ((v[22] - v[23]) * 0x2D413) >> 0x10; + v[5] = v[5] - v[4]; + v[7] = v[7] - v[5]; + v[6] = v[6] + v[6]; + v[5] = v[5] - v[6]; + v[4] = -v[4] - v[6]; + // *** Store v[7] -> (T1 + 0xFF80) + *(s16 *)(mp3data+((t1+(short)0xFF80))) = (short)v[7]; + // *** Store v[4] -> (T2 + 0xFF80) + *(s16 *)(mp3data+((t2+(short)0xFF80))) = (short)v[4]; + // *** Store v[5] -> (T0 + 0xFF80) + *(s16 *)(mp3data+((t0+(short)0xFF80))) = (short)v[5]; + v[8] = v[24] + v[25]; + + + v[9] = ((v[24] - v[25]) * 0x16A09) >> 0x10; + v[2] = v[8] + v[9]; + v[11] = ((v[26] - v[27]) * 0x2D413) >> 0x10; + v[13] = ((v[28] - v[29]) * 0x2D413) >> 0x10; + + v[10] = v[26] + v[27]; v[10] = v[10] + v[10]; + v[12] = v[28] + v[29]; v[12] = v[12] + v[12]; + v[14] = v[30] + v[31]; + v[3] = v[8] + v[10]; + v[14] = v[14] + v[14]; + v[13] = (v[13] - v[2]) + v[12]; + v[15] = (((v[30] - v[31]) * 0x5A827) >> 0x10) - (v[11] + v[2]); + v[14] = -(v[14] + v[14]) + v[3]; + v[17] = v[13] - v[10]; + v[9] = v[9] + v[14]; + // ** Store v[9] -> (T6 + 0x40) + *(s16 *)(mp3data+((t6+(short)0x40))) = (short)v[9]; + v[11] = v[11] - v[13]; + // ** Store v[17] -> (T0 + 0xFFC0) + *(s16 *)(mp3data+((t0+(short)0xFFC0))) = (short)v[17]; + v[12] = v[8] - v[12]; + // ** Store v[11] -> (T0 + 0x40) + *(s16 *)(mp3data+((t0+(short)0x40))) = (short)v[11]; + v[8] = -v[8]; + // ** Store v[15] -> (T1 + 0xFFC0) + *(s16 *)(mp3data+((t1+(short)0xFFC0))) = (short)v[15]; + v[10] = -v[10] -v[12]; + // ** Store v[12] -> (T2 + 0x40) + *(s16 *)(mp3data+((t2+(short)0x40))) = (short)v[12]; + // ** Store v[8] -> (T3 + 0xFFC0) + *(s16 *)(mp3data+((t3+(short)0xFFC0))) = (short)v[8]; + // ** Store v[14] -> (T5 + 0x40) + *(s16 *)(mp3data+((t5+(short)0x40))) = (short)v[14]; + // ** Store v[10] -> (T2 + 0xFFC0) + *(s16 *)(mp3data+((t2+(short)0xFFC0))) = (short)v[10]; + // 0x14FC - Verified... + + // Part 6 - 100% Accurate + + v[0] = *(s16 *)(mp3data+inPtr+(0x00^S16)); v[31] = *(s16 *)(mp3data+inPtr+(0x3E^S16)); v[0] -= v[31]; + v[1] = *(s16 *)(mp3data+inPtr+(0x02^S16)); v[30] = *(s16 *)(mp3data+inPtr+(0x3C^S16)); v[1] -= v[30]; + v[2] = *(s16 *)(mp3data+inPtr+(0x06^S16)); v[28] = *(s16 *)(mp3data+inPtr+(0x38^S16)); v[2] -= v[28]; + v[3] = *(s16 *)(mp3data+inPtr+(0x04^S16)); v[29] = *(s16 *)(mp3data+inPtr+(0x3A^S16)); v[3] -= v[29]; + + v[4] = *(s16 *)(mp3data+inPtr+(0x0E^S16)); v[24] = *(s16 *)(mp3data+inPtr+(0x30^S16)); v[4] -= v[24]; + v[5] = *(s16 *)(mp3data+inPtr+(0x0C^S16)); v[25] = *(s16 *)(mp3data+inPtr+(0x32^S16)); v[5] -= v[25]; + v[6] = *(s16 *)(mp3data+inPtr+(0x08^S16)); v[27] = *(s16 *)(mp3data+inPtr+(0x36^S16)); v[6] -= v[27]; + v[7] = *(s16 *)(mp3data+inPtr+(0x0A^S16)); v[26] = *(s16 *)(mp3data+inPtr+(0x34^S16)); v[7] -= v[26]; + + v[8] = *(s16 *)(mp3data+inPtr+(0x1E^S16)); v[16] = *(s16 *)(mp3data+inPtr+(0x20^S16)); v[8] -= v[16]; + v[9] = *(s16 *)(mp3data+inPtr+(0x1C^S16)); v[17] = *(s16 *)(mp3data+inPtr+(0x22^S16)); v[9] -= v[17]; + v[10]= *(s16 *)(mp3data+inPtr+(0x18^S16)); v[19] = *(s16 *)(mp3data+inPtr+(0x26^S16)); v[10]-= v[19]; + v[11]= *(s16 *)(mp3data+inPtr+(0x1A^S16)); v[18] = *(s16 *)(mp3data+inPtr+(0x24^S16)); v[11]-= v[18]; + + v[12]= *(s16 *)(mp3data+inPtr+(0x10^S16)); v[23] = *(s16 *)(mp3data+inPtr+(0x2E^S16)); v[12]-= v[23]; + v[13]= *(s16 *)(mp3data+inPtr+(0x12^S16)); v[22] = *(s16 *)(mp3data+inPtr+(0x2C^S16)); v[13]-= v[22]; + v[14]= *(s16 *)(mp3data+inPtr+(0x16^S16)); v[20] = *(s16 *)(mp3data+inPtr+(0x28^S16)); v[14]-= v[20]; + v[15]= *(s16 *)(mp3data+inPtr+(0x14^S16)); v[21] = *(s16 *)(mp3data+inPtr+(0x2A^S16)); v[15]-= v[21]; + + //0, 1, 3, 2, 7, 6, 4, 5, 7, 6, 4, 5, 0, 1, 3, 2 + const u16 LUT6[16] = { 0xFFB2, 0xFD3A, 0xF10A, 0xF854, + 0xBDAE, 0xCDA0, 0xE76C, 0xDB94, + 0x1920, 0x4B20, 0xAC7C, 0x7C68, + 0xABEC, 0x9880, 0xDAE8, 0x839C }; + for (i = 0; i < 16; i++) { + v[0+i] = (v[0+i] * LUT6[i]) >> 0x10; + } + v[0] = v[0] + v[0]; v[1] = v[1] + v[1]; + v[2] = v[2] + v[2]; v[3] = v[3] + v[3]; v[4] = v[4] + v[4]; + v[5] = v[5] + v[5]; v[6] = v[6] + v[6]; v[7] = v[7] + v[7]; + v[12] = v[12] + v[12]; v[13] = v[13] + v[13]; v[15] = v[15] + v[15]; + + MP3AB0 (); + + // Part 7: - 100% Accurate + SSV - Unoptimized + + v[0] = ( v[17] + v[16] ) >> 1; + v[1] = ((v[17] * (int)((short)0xA57E * 2)) + (v[16] * 0xB504)) >> 0x10; + v[2] = -v[18] -v[19]; + v[3] = ((v[18] - v[19]) * 0x16A09) >> 0x10; + v[4] = v[20] + v[21] + v[0]; + v[5] = (((v[20] - v[21]) * 0x16A09) >> 0x10) + v[1]; + v[6] = (((v[22] + v[23]) << 1) + v[0]) - v[2]; + v[7] = (((v[22] - v[23]) * 0x2D413) >> 0x10) + v[0] + v[1] + v[3]; + // 0x16A8 + // Save v[0] -> (T3 + 0xFFE0) + *(s16 *)(mp3data+((t3+(short)0xFFE0))) = (short)-v[0]; + v[8] = v[24] + v[25]; + v[9] = ((v[24] - v[25]) * 0x16A09) >> 0x10; + v[10] = ((v[26] + v[27]) << 1) + v[8]; + v[11] = (((v[26] - v[27]) * 0x2D413) >> 0x10) + v[8] + v[9]; + v[12] = v[4] - ((v[28] + v[29]) << 1); + // ** Store v12 -> (T2 + 0x20) + *(s16 *)(mp3data+((t2+(short)0x20))) = (short)v[12]; + v[13] = (((v[28] - v[29]) * 0x2D413) >> 0x10) - v[12] - v[5]; + v[14] = v[30] + v[31]; + v[14] = v[14] + v[14]; + v[14] = v[14] + v[14]; + v[14] = v[6] - v[14]; + v[15] = (((v[30] - v[31]) * 0x5A827) >> 0x10) - v[7]; + // Store v14 -> (T5 + 0x20) + *(s16 *)(mp3data+((t5+(short)0x20))) = (short)v[14]; + v[14] = v[14] + v[1]; + // Store v[14] -> (T6 + 0x20) + *(s16 *)(mp3data+((t6+(short)0x20))) = (short)v[14]; + // Store v[15] -> (T1 + 0xFFE0) + *(s16 *)(mp3data+((t1+(short)0xFFE0))) = (short)v[15]; + v[9] = v[9] + v[10]; + v[1] = v[1] + v[6]; + v[6] = v[10] - v[6]; + v[1] = v[9] - v[1]; + // Store v[6] -> (T5 + 0x60) + *(s16 *)(mp3data+((t5+(short)0x60))) = (short)v[6]; + v[10] = v[10] + v[2]; + v[10] = v[4] - v[10]; + // Store v[10] -> (T2 + 0xFFA0) + *(s16 *)(mp3data+((t2+(short)0xFFA0))) = (short)v[10]; + v[12] = v[2] - v[12]; + // Store v[12] -> (T2 + 0xFFE0) + *(s16 *)(mp3data+((t2+(short)0xFFE0))) = (short)v[12]; + v[5] = v[4] + v[5]; + v[4] = v[8] - v[4]; + // Store v[4] -> (T2 + 0x60) + *(s16 *)(mp3data+((t2+(short)0x60))) = (short)v[4]; + v[0] = v[0] - v[8]; + // Store v[0] -> (T3 + 0xFFA0) + *(s16 *)(mp3data+((t3+(short)0xFFA0))) = (short)v[0]; + v[7] = v[7] - v[11]; + // Store v[7] -> (T1 + 0xFFA0) + *(s16 *)(mp3data+((t1+(short)0xFFA0))) = (short)v[7]; + v[11] = v[11] - v[3]; + // Store v[1] -> (T6 + 0x60) + *(s16 *)(mp3data+((t6+(short)0x60))) = (short)v[1]; + v[11] = v[11] - v[5]; + // Store v[11] -> (T0 + 0x60) + *(s16 *)(mp3data+((t0+(short)0x60))) = (short)v[11]; + v[3] = v[3] - v[13]; + // Store v[3] -> (T0 + 0x20) + *(s16 *)(mp3data+((t0+(short)0x20))) = (short)v[3]; + v[13] = v[13] + v[2]; + // Store v[13] -> (T0 + 0xFFE0) + *(s16 *)(mp3data+((t0+(short)0xFFE0))) = (short)v[13]; + //v[2] = ; + v[2] = (v[5] - v[2]) - v[9]; + // Store v[2] -> (T0 + 0xFFA0) + *(s16 *)(mp3data+((t0+(short)0xFFA0))) = (short)v[2]; + // 0x7A8 - Verified... + + // Step 8 - Dewindowing + + //u64 *DW = (u64 *)&DeWindowLUT[0x10-(t4>>1)]; + u32 offset = 0x10-(t4>>1); + + u32 addptr = t6 & 0xFFE0; + offset = 0x10-(t4>>1); + + s32 v2=0, v4=0, v6=0, v8=0; + //s32 z2=0, z4=0, z6=0, z8=0; + + offset = 0x10-(t4>>1);// + x*0x40; + int x; + for (x = 0; x < 8; x++) { + v2 = v4 = v6 = v8 = 0; + + //addptr = t1; + + for (i = 7; i >= 0; i--) { + v2 += ((int)*(s16 *)(mp3data+(addptr)+0x00) * (short)DeWindowLUT[offset+0x00] + 0x4000) >> 0xF; + v4 += ((int)*(s16 *)(mp3data+(addptr)+0x10) * (short)DeWindowLUT[offset+0x08] + 0x4000) >> 0xF; + v6 += ((int)*(s16 *)(mp3data+(addptr)+0x20) * (short)DeWindowLUT[offset+0x20] + 0x4000) >> 0xF; + v8 += ((int)*(s16 *)(mp3data+(addptr)+0x30) * (short)DeWindowLUT[offset+0x28] + 0x4000) >> 0xF; + addptr+=2; offset++; + } + s32 v0 = v2 + v4; + s32 v18 = v6 + v8; + //Clamp(v0); + //Clamp(v18); + // clamp??? + *(s16 *)(mp3data+(outPtr^S16)) = v0; + *(s16 *)(mp3data+((outPtr+2)^S16)) = v18; + outPtr+=4; + addptr += 0x30; + offset += 0x38; + } + + offset = 0x10-(t4>>1) + 8*0x40; + v2 = v4 = 0; + for (i = 0; i < 4; i++) { + v2 += ((int)*(s16 *)(mp3data+(addptr)+0x00) * (short)DeWindowLUT[offset+0x00] + 0x4000) >> 0xF; + v2 += ((int)*(s16 *)(mp3data+(addptr)+0x10) * (short)DeWindowLUT[offset+0x08] + 0x4000) >> 0xF; + addptr+=2; offset++; + v4 += ((int)*(s16 *)(mp3data+(addptr)+0x00) * (short)DeWindowLUT[offset+0x00] + 0x4000) >> 0xF; + v4 += ((int)*(s16 *)(mp3data+(addptr)+0x10) * (short)DeWindowLUT[offset+0x08] + 0x4000) >> 0xF; + addptr+=2; offset++; + } + s32 mult6 = *(s32 *)(mp3data+0xCE8); + s32 mult4 = *(s32 *)(mp3data+0xCEC); + if (t4 & 0x2) { + v2 = (v2 * *(u32 *)(mp3data+0xCE8)) >> 0x10; + *(s16 *)(mp3data+(outPtr^S16)) = v2; + } else { + v4 = (v4 * *(u32 *)(mp3data+0xCE8)) >> 0x10; + *(s16 *)(mp3data+(outPtr^S16)) = v4; + mult4 = *(u32 *)(mp3data+0xCE8); + } + addptr -= 0x50; + + for (x = 0; x < 8; x++) { + v2 = v4 = v6 = v8 = 0; + + offset = (0x22F-(t4>>1) + x*0x40); + + for (i = 0; i < 4; i++) { + v2 += ((int)*(s16 *)(mp3data+(addptr )+0x20) * (short)DeWindowLUT[offset+0x00] + 0x4000) >> 0xF; + v2 -= ((int)*(s16 *)(mp3data+((addptr+2))+0x20) * (short)DeWindowLUT[offset+0x01] + 0x4000) >> 0xF; + v4 += ((int)*(s16 *)(mp3data+(addptr )+0x30) * (short)DeWindowLUT[offset+0x08] + 0x4000) >> 0xF; + v4 -= ((int)*(s16 *)(mp3data+((addptr+2))+0x30) * (short)DeWindowLUT[offset+0x09] + 0x4000) >> 0xF; + v6 += ((int)*(s16 *)(mp3data+(addptr )+0x00) * (short)DeWindowLUT[offset+0x20] + 0x4000) >> 0xF; + v6 -= ((int)*(s16 *)(mp3data+((addptr+2))+0x00) * (short)DeWindowLUT[offset+0x21] + 0x4000) >> 0xF; + v8 += ((int)*(s16 *)(mp3data+(addptr )+0x10) * (short)DeWindowLUT[offset+0x28] + 0x4000) >> 0xF; + v8 -= ((int)*(s16 *)(mp3data+((addptr+2))+0x10) * (short)DeWindowLUT[offset+0x29] + 0x4000) >> 0xF; + addptr+=4; offset+=2; + } + s32 v0 = v2 + v4; + s32 v18 = v6 + v8; + //Clamp(v0); + //Clamp(v18); + // clamp??? + *(s16 *)(mp3data+((outPtr+2)^S16)) = v0; + *(s16 *)(mp3data+((outPtr+4)^S16)) = v18; + outPtr+=4; + addptr -= 0x50; + } + + int tmp = outPtr; + s32 hi0 = mult6; + s32 hi1 = mult4; + s32 v; + + hi0 = (int)hi0 >> 0x10; + hi1 = (int)hi1 >> 0x10; + for (i = 0; i < 8; i++) { + // v0 + v = (*(s16 *)(mp3data+((tmp-0x40)^S16)) * hi0); + if (v > 32767) v = 32767; else if (v < -32767) v = -32767; + *(s16 *)((u8 *)mp3data+((tmp-0x40)^S16)) = (s16)v; + // v17 + v = (*(s16 *)(mp3data+((tmp-0x30)^S16)) * hi0); + if (v > 32767) v = 32767; else if (v < -32767) v = -32767; + *(s16 *)((u8 *)mp3data+((tmp-0x30)^S16)) = v; + // v2 + v = (*(s16 *)(mp3data+((tmp-0x1E)^S16)) * hi1); + if (v > 32767) v = 32767; else if (v < -32767) v = -32767; + *(s16 *)((u8 *)mp3data+((tmp-0x1E)^S16)) = v; + // v4 + v = (*(s16 *)(mp3data+((tmp-0xE)^S16)) * hi1); + if (v > 32767) v = 32767; else if (v < -32767) v = -32767; + *(s16 *)((u8 *)mp3data+((tmp-0xE)^S16)) = v; + tmp += 2; + } +} + diff --git a/libmupen64plus/mupen64plus-ui-console/INSTALL b/libmupen64plus/mupen64plus-ui-console/INSTALL new file mode 100644 index 0000000000..51c97cea7d --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/INSTALL @@ -0,0 +1,26 @@ +Mupen64Plus-UI-Console INSTALL +------------------------------ + +This text file was written to explain the installation process of the +Mupen64Plus-UI-Console front-end module. + +If this module is part of a Mupen64Plus source code bundle, the user should run +the "m64p_install.sh" script in the root of the unzipped bundle to install all +of the included modules in the bundle. + +If this module is a standalone source code release, you should build the program +from source code and install it via the makefile, like this: + +$ cd projects/unix +$ make all +$ sudo make install + +If you want to build the Mupen64Plus-UI-Console for installation in a home +folder for a single user, you may build it like this (replacing +with your desired local installation path): + +$ cd projects/unix +$ make all COREDIR= PLUGINDIR= +$ make install BINDIR= MANDIR= + + diff --git a/libmupen64plus/mupen64plus-ui-console/LICENSES b/libmupen64plus/mupen64plus-ui-console/LICENSES new file mode 100644 index 0000000000..346a1815db --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/LICENSES @@ -0,0 +1,358 @@ +Mupen64Plus-ui-console LICENSE +------------------------------ + +Mupen64Plus-ui-console is licensed under the GNU General Public License version 2. + +The authors of Mupen64Plus-ui-console are: + * Richard Goedeken (Richard42) + +Mupen64Plus is based on GPL-licensed source code from Mupen64 v0.5, originally written by: + * Hacktarux + * Dave2001 + * Zilmar + * Gregor Anich (Blight) + * Juha Luotio (JttL) + * and others. + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, 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 + + + Appendix: 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. + + + Copyright (C) 19yy + + 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., 675 Mass Ave, Cambridge, MA 02139, 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) 19yy 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. + + , 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. + diff --git a/libmupen64plus/mupen64plus-ui-console/README b/libmupen64plus/mupen64plus-ui-console/README new file mode 100644 index 0000000000..6c755dd4ba --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/README @@ -0,0 +1,52 @@ +Mupen64Plus-UI-Console README +----------------------------- + +README Sections + 1. Command-line options + +1. Command-line options +------------------------ + +Run 'mupen64plus --help' for a complete list of command-line options: + + $ mupen64plus --help +Usage: mupen64plus [parameter(s)] [romfile] + +Parameters: + --noosd : disable onscreen display + --osd : enable onscreen display + --fullscreen : use fullscreen display mode + --windowed : use windowed display mode + --resolution (res) : display resolution (640x480, 800x600, 1024x768, etc) + --nospeedlimit : disable core speed limiter (should be used with dummy audio plugin) + --cheats (cheat-spec) : enable or list cheat codes for the given rom file + --corelib (filepath) : use core library (filepath) (can be only filename or full path) + --configdir (dir) : force configation directory to (dir); should contain mupen64plus.conf + --datadir (dir) : search for shared data files (.ini files, languages, etc) in (dir) + --plugindir (dir) : search for plugins in (dir) + --sshotdir (dir) : set screenshot directory to (dir) + --gfx (plugin-spec) : use gfx plugin given by (plugin-spec) + --audio (plugin-spec) : use audio plugin given by (plugin-spec) + --input (plugin-spec) : use input plugin given by (plugin-spec) + --rsp (plugin-spec) : use rsp plugin given by (plugin-spec) + --emumode (mode) : set emu mode to: 0=Pure Interpreter 1=Interpreter 2=DynaRec + --testshots (list) : take screenshots at frames given in comma-separated (list), then quit + --set (param-spec) : set a configuration variable, format: ParamSection[ParamName]=Value + --core-compare-send : use the Core Comparison debugging feature, in data sending mode + --core-compare-recv : use the Core Comparison debugging feature, in data receiving mode + --nosaveoptions : do not save the given command-line options in configuration file + --verbose : print lots of information + --help : see this help message + +(plugin-spec): + (pluginname) : filename (without path) of plugin to find in plugin directory + (pluginpath) : full path and filename of plugin + 'dummy' : use dummy plugin + +(cheat-spec): + 'list' : show all of the available cheat codes + 'all' : enable all of the available cheat codes + (codelist) : a comma-separated list of cheat code numbers to enable, + with dashes to use code variables (ex 1-2 to use cheat 1 option 2) + + diff --git a/libmupen64plus/mupen64plus-ui-console/RELEASE b/libmupen64plus/mupen64plus-ui-console/RELEASE new file mode 100644 index 0000000000..ab52f5eb61 --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/RELEASE @@ -0,0 +1,39 @@ +Mupen64Plus-UI-Console RELEASE +------------------------------ + +Mupen64Plus-UI-Console Front-End v1.99.5 - March 10, 2012 +--------------------------------------------------------- + - New option to disable internal core speed limiter (for benchmarking) + - Updated Console-UI front-end for new Mupen64plus 2.0 API versioning + - Added config version number for UI-Console section + - makefile fixes and improvements + +Mupen64Plus-UI-Console Front-End v1.99.4 - November 22, 2010 +------------------------------------------------------------ + - add some parameter checking for --emumode option + - new cheat file format from spinout182 + - makefile fixes and improvements + +Mupen64Plus-UI-Console Front-End v1.99.3 - February 13, 2010 +------------------------------------------------------------ + - New feature: command-line option --set for setting arbitrary configuration variables + - updated MAN pgae for all the changes made in the 2.0 re-architecture + - Makefile improvements: + - added OS type GNU/kFreeBSD + - add -lpthread to LIBS so that GDB will run the emulator without throwing a warning right after starting + +Mupen64Plus-UI-Console Front-End v1.99.2 - January 6, 2010 +------------------------------------------------------------ + - new feature: added MSVC8 project/solution files, minor refactoring for VC compatibility + - Makefile improvements: + - throw error if OS/CPU not supported + - use DESTDIR in install/uninstall paths + - Allow user-specified CC/CXX/LD paths + +Mupen64Plus-UI-Console Front-End v1.99.1 - December 14, 2009 +------------------------------------------------------------ + - Brand new Console-based front-end for Mupen64Plus 2.0 + - New feature: R4300 Core Comparison for debugging + - New feature: Cheat code support from command-line + + diff --git a/libmupen64plus/mupen64plus-ui-console/doc/mupen64plus.6 b/libmupen64plus/mupen64plus-ui-console/doc/mupen64plus.6 new file mode 100644 index 0000000000..00f6dbd4e1 --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/doc/mupen64plus.6 @@ -0,0 +1,188 @@ +.TH "mupen64plus" 6 +.SH NAME +mupen64plus \- Console front\(hyend for the Mupen64Plus N64 emulator +.SH SYNOPSIS +.B mupen64plus +[parameters(s)] [romfile] +.SH DESCRIPTION +Mupen64Plus is a plugin\(hybased N64 emulator for Linux/Unix, OSX, and Windows which is capable of accurately playing many games. +Included are four MIPS R4300 CPU emulators, with dynamic recompilers for 32\(hybit x86 and 64\(hybit amd64 systems, and necessary plugins for audio, graphical rendering (RDP), signal co\(hyprocessor (RSP), and input. +There are currently two OpenGL video plugins available: the included Rice Video, and Arachnoid (at http://bitbucket.org/wahrhaft/mupen64plus\-video\-arachnoid/). + +The most current documentation can be found at the project's homepage: + +http://code.google.com/p/mupen64plus +.TP +.B \-h, \-\-help +Print help message. +.TP +.B \-\-noosd +Disable onscreen display. +.TP +.B \-\-osd +Enable onscreen display. +.TP +.B \-\-fullscreen +Run emulator in fullscreen display mode. +.TP +.B \-\-windowed +Run emulator in windowed display mode. +.TP +.B \-\-resolution \fRres +Display resolution (640\(mu480, 800\(mu600, 1024\(mu768, etc) +.TP +.B \-\-cheats \fRcheat\(hyspec +Enable or list cheat codes for the given rom file. +.TP +.B \-\-corelib \fRfilepath +Specifies a filename (optionally with a preceding directory path) to load a specific Mupen64Plus core library. +.TP +.B \-\-configdir \fRdirectory +Specifies a directory to look for the mupen64plus.cfg file. +Default is \fI~/.config/mupen64plus/\fR. +.TP +.B \-\-datadir \fRdirectory +Specifies a directory to search for shared data files (fonts, cheat codes, .ini files). +Default is \fIPREFIX/share/mupen64plus/\fR. +.TP +.B \-\-plugindir \fRdirectory +Specifies a directory to search for plugin files. +Default is \fIPREFIX/lib/mupen64plus/\fR. +.TP +.B \-\-sshotdir \fRdirectory +Specifies a directory to save screenshots captured during gameplay. +Default is \fI~/.local/share/mupen64plus/screenshot/\fR. +.TP +.B \-\-gfx \fRplugin\(hyspec +Specifies a \fIplugin\(hyspec\fR to select a graphics plugin for use during emulation. +.TP +.B \-\-audio \fRplugin\(hyspec +Specifies a \fIplugin\(hyspec\fR to select an audio plugin for use during emulation. +.TP +.B \-\-input \fRplugin\(hyspec +Specifies a \fIplugin\(hyspec\fR to select an input plugin for use during emulation. +.TP +.B \-\-rsp \fRplugin\(hyspec +Specifies a \fIplugin\(hyspec\fR to select an RSP plugin for use during emulation. +.TP +.B \-\-emumode \fRmode +Specifies which mode the emulator core should run in. +\fImode\fR should be set to one of the following numbers: 0=Pure Interpreter, 1=Cached Interpreter, 2=Dynamic Recompiler (DynaRec). +.TP +.B \-\-testshots \fRlist +Take screenshots at frames given in the comma\(hyseparated \fIlist\fR, then quit. +.TP +.B \-\-core\-compare\-send +Use the core comparison debugging feature, in data sending mode. +If the core was not compiled with support for the Core Comparison feature, then the emulator will exit with an error. +.TP +.B \-\-core\-compare\-recv +Use the core comparison debugging feature, in data receiving mode. +If the core was not compiled with support for the Core Comparison feature, then the emulator will exit with an error. +.TP +.B \-\-set \fRparam\(hyspec +Set the value of a Mupen64Plus configuration parameter. +This option may be used multiple times. +The format of \fIparam\(hyspec\fR is Section\(hyName[Param\(hyName]=Value +.TP +.B \-\-saveoptions +Save the given command\(hyline options into the mupen64plus configuration file to use as defaults in the future. +Since the console front\(hyend needs to load the core library before reading the configuration file, the \-\-corelib option cannot be saved. +.TP +.B \-\-verbose +Print lots of information. +Useful for debugging but unnecessary for normal use. +.SH plugin\(hyspec +.TP +.B (plugin\-name) +Filename (without path) of plugin to use. +Application will search through several directories to look for a matching plugin name. +.TP +.B (plugin\-path) +Full directory path and filename of plugin. +.TP +.B 'dummy' +Use the dummy plugin. +.SH cheat\(hyspec +.TP +.B 'list' +Show all of the available cheat codes. +.TP +.B 'all' +Enable all of the available cheat codes. +.TP +.B (codelist) +A comma separated list of cheat code numbers to enable. +.SH KEY COMMANDS +The following shortcut keys can be used during emulation. +These are the default key values; nearly all of them may be set to different keys by editing the mupen64plus configuration file. +.TP +.B Escape +Quit the emulator. +.TP +.B 0\-9 +Select virtual 'slot' for save/load state. +.TP +.B F5 +Save emulator state to current slot. +.TP +.B F7 +Load emulator state from current slot. +.TP +.B F9 +Reset emulator. +.TP +.B F10 +Slow down emulator speed by 5 percent. +.TP +.B F11 +Speed up emulator speed by 5 percent. +.TP +.B F12 +Take screenshot. +.TP +.B Alt\(hyEnter +Toggle fullscreen mode. +This is not supported on Windows. +.TP +.B p or P +Pause/continue emulation. +.TP +.B m or M +Mute/unmute sound. +.TP +.B f or F +Fast Forward (playback at 250% normal speed as long as key is pressed). +.TP +.B g or G +Press GameShark button (if cheats are enabled). +.TP +.B / or ? +Advance one frame if paused. +.TP +.B [ +Decrease volume. +.TP +.B ] +Increase volume. +.SH FILES +The default location for the Mupen64plus configuration file is \fI~/.config/mupen64plus/\fR. +The default location of the saved screenshots is \fI~/.local/share/mupen64plus/screenshot/\fR. +The default location of the save states is \fI~/.local/share/mupen64plus/save/\fR. +.SH BUGS +To report bugs or make feature requests, use the issue tracker on the Mupen64Plus project site: + +http://code.google.com/p/mupen64plus/issues/list +.SH AUTHORS +Mupen64Plus was originally started by Richard42 and nmn, and is based on Mupen64 (originally written by Hacktarux). + +This man page was written by ebenblues, and updated by Richard42. + +.SH COPYRIGHT +Mupen64Plus is \(co 2008\-2010 The Mupen64Plus Team +License GPLv2+: GNU GPL version 2 or later + +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. + + diff --git a/libmupen64plus/mupen64plus-ui-console/projects/msvc11/mupen64plus-ui-console.sln b/libmupen64plus/mupen64plus-ui-console/projects/msvc11/mupen64plus-ui-console.sln new file mode 100644 index 0000000000..69a5354f19 --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/projects/msvc11/mupen64plus-ui-console.sln @@ -0,0 +1,55 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-ui-console", "mupen64plus-ui-console.vcxproj", "{0E29D9F8-C675-4D21-AF16-AA80EDDB264E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-core", "..\..\..\mupen64plus-core\projects\msvc11\mupen64plus-core.vcxproj", "{92D3FEB9-2129-41C5-8577-BCD7D961EF41}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-input-sdl", "..\..\..\mupen64plus-input-sdl\projects\msvc11\mupen64plus-input-sdl.vcxproj", "{7F3178D0-0E2E-471B-9160-69F0354F9DE9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-rsp-hle", "..\..\..\mupen64plus-rsp-hle\projects\msvc11\mupen64plus-rsp-hle.vcxproj", "{2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-video-rice", "..\..\..\mupen64plus-video-rice\projects\msvc11\mupen64plus-video-rice.vcxproj", "{7D4AFF6A-B7D9-4C25-975A-038B8079098E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-audio-sdl", "..\..\..\mupen64plus-audio-sdl\projects\msvc11\mupen64plus-audio-sdl.vcxproj", "{96969748-EA54-43FC-8103-A346E9AD98E7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-video-glide64mk2", "..\..\..\mupen64plus-video-glide64mk2\projects\msvc10\mupen64plus-video-glide64mk2.vcxproj", "{A4D13408-A794-4199-8FC7-4A9A32505005}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0E29D9F8-C675-4D21-AF16-AA80EDDB264E}.Debug|Win32.ActiveCfg = Debug|Win32 + {0E29D9F8-C675-4D21-AF16-AA80EDDB264E}.Debug|Win32.Build.0 = Debug|Win32 + {0E29D9F8-C675-4D21-AF16-AA80EDDB264E}.Release|Win32.ActiveCfg = Release|Win32 + {0E29D9F8-C675-4D21-AF16-AA80EDDB264E}.Release|Win32.Build.0 = Release|Win32 + {92D3FEB9-2129-41C5-8577-BCD7D961EF41}.Debug|Win32.ActiveCfg = Debug|Win32 + {92D3FEB9-2129-41C5-8577-BCD7D961EF41}.Debug|Win32.Build.0 = Debug|Win32 + {92D3FEB9-2129-41C5-8577-BCD7D961EF41}.Release|Win32.ActiveCfg = Release|Win32 + {92D3FEB9-2129-41C5-8577-BCD7D961EF41}.Release|Win32.Build.0 = Release|Win32 + {7F3178D0-0E2E-471B-9160-69F0354F9DE9}.Debug|Win32.ActiveCfg = Debug|Win32 + {7F3178D0-0E2E-471B-9160-69F0354F9DE9}.Debug|Win32.Build.0 = Debug|Win32 + {7F3178D0-0E2E-471B-9160-69F0354F9DE9}.Release|Win32.ActiveCfg = Release|Win32 + {7F3178D0-0E2E-471B-9160-69F0354F9DE9}.Release|Win32.Build.0 = Release|Win32 + {2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}.Debug|Win32.ActiveCfg = Debug|Win32 + {2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}.Debug|Win32.Build.0 = Debug|Win32 + {2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}.Release|Win32.ActiveCfg = Release|Win32 + {2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}.Release|Win32.Build.0 = Release|Win32 + {7D4AFF6A-B7D9-4C25-975A-038B8079098E}.Debug|Win32.ActiveCfg = Debug|Win32 + {7D4AFF6A-B7D9-4C25-975A-038B8079098E}.Debug|Win32.Build.0 = Debug|Win32 + {7D4AFF6A-B7D9-4C25-975A-038B8079098E}.Release|Win32.ActiveCfg = Release|Win32 + {7D4AFF6A-B7D9-4C25-975A-038B8079098E}.Release|Win32.Build.0 = Release|Win32 + {96969748-EA54-43FC-8103-A346E9AD98E7}.Debug|Win32.ActiveCfg = Debug|Win32 + {96969748-EA54-43FC-8103-A346E9AD98E7}.Debug|Win32.Build.0 = Debug|Win32 + {96969748-EA54-43FC-8103-A346E9AD98E7}.Release|Win32.ActiveCfg = Release|Win32 + {96969748-EA54-43FC-8103-A346E9AD98E7}.Release|Win32.Build.0 = Release|Win32 + {A4D13408-A794-4199-8FC7-4A9A32505005}.Debug|Win32.ActiveCfg = Debug|Win32 + {A4D13408-A794-4199-8FC7-4A9A32505005}.Debug|Win32.Build.0 = Debug|Win32 + {A4D13408-A794-4199-8FC7-4A9A32505005}.Release|Win32.ActiveCfg = Release|Win32 + {A4D13408-A794-4199-8FC7-4A9A32505005}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libmupen64plus/mupen64plus-ui-console/projects/msvc11/mupen64plus-ui-console.vcxproj b/libmupen64plus/mupen64plus-ui-console/projects/msvc11/mupen64plus-ui-console.vcxproj new file mode 100644 index 0000000000..59d482b8d7 --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/projects/msvc11/mupen64plus-ui-console.vcxproj @@ -0,0 +1,139 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {0E29D9F8-C675-4D21-AF16-AA80EDDB264E} + mupen64plusuiconsole + Win32Proj + + + + Application + MultiByte + true + + + Application + MultiByte + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + true + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + CompileAsCpp + + + ..\..\..\mupen64plus-win32-deps\SDL-1.2.14\lib\SDLmain.lib;%(AdditionalDependencies) + true + Console + MachineX86 + + + Copying shared data and libraries to build directory... + copy ..\..\..\mupen64plus-core\data\* "$(OutDir)" +copy ..\..\..\mupen64plus-video-rice\data\* "$(OutDir)" +copy ..\..\..\mupen64plus-input-sdl\data\* "$(OutDir)" +copy ..\..\..\mupen64plus-win32-deps\freetype-2.3.5-1\bin\*.dll "$(OutDir)" +copy ..\..\..\mupen64plus-win32-deps\libpng-1.2.37\bin\*.dll "$(OutDir)" +copy ..\..\..\mupen64plus-win32-deps\SDL-1.2.14\lib\*.dll "$(OutDir)" +copy ..\..\..\mupen64plus-win32-deps\zlib-1.2.3\bin\*.dll "$(OutDir)" + + + + + + ..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + CompileAsCpp + + + ..\..\..\mupen64plus-win32-deps\SDL-1.2.14\lib\SDLmain.lib;%(AdditionalDependencies) + true + Console + true + true + MachineX86 + + + Copying shared data and libraries to build directory... + copy ..\..\..\mupen64plus-core\data\* "$(OutDir)" +copy ..\..\..\mupen64plus-video-rice\data\* "$(OutDir)" +copy ..\..\..\mupen64plus-input-sdl\data\* "$(OutDir)" +copy ..\..\..\mupen64plus-win32-deps\freetype-2.3.5-1\bin\*.dll "$(OutDir)" +copy ..\..\..\mupen64plus-win32-deps\libpng-1.2.37\bin\*.dll "$(OutDir)" +copy ..\..\..\mupen64plus-win32-deps\SDL-1.2.14\lib\*.dll "$(OutDir)" +copy ..\..\..\mupen64plus-win32-deps\zlib-1.2.3\bin\*.dll "$(OutDir)" + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libmupen64plus/mupen64plus-ui-console/projects/msvc8/mupen64plus-ui-console.sln b/libmupen64plus/mupen64plus-ui-console/projects/msvc8/mupen64plus-ui-console.sln new file mode 100644 index 0000000000..08eb3808c9 --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/projects/msvc8/mupen64plus-ui-console.sln @@ -0,0 +1,56 @@ +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-ui-console", "mupen64plus-ui-console.vcproj", "{0E29D9F8-C675-4D21-AF16-AA80EDDB264E}" + ProjectSection(ProjectDependencies) = postProject + {96969748-EA54-43FC-8103-A346E9AD98E7} = {96969748-EA54-43FC-8103-A346E9AD98E7} + {7D4AFF6A-B7D9-4C25-975A-038B8079098E} = {7D4AFF6A-B7D9-4C25-975A-038B8079098E} + {92D3FEB9-2129-41C5-8577-BCD7D961EF41} = {92D3FEB9-2129-41C5-8577-BCD7D961EF41} + {7F3178D0-0E2E-471B-9160-69F0354F9DE9} = {7F3178D0-0E2E-471B-9160-69F0354F9DE9} + {2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A} = {2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-core", "..\..\..\mupen64plus-core\projects\msvc8\mupen64plus-core.vcproj", "{92D3FEB9-2129-41C5-8577-BCD7D961EF41}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-video-rice", "..\..\..\mupen64plus-video-rice\projects\msvc8\mupen64plus-video-rice.vcproj", "{7D4AFF6A-B7D9-4C25-975A-038B8079098E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-rsp-hle", "..\..\..\mupen64plus-rsp-hle\projects\msvc8\mupen64plus-rsp-hle.vcproj", "{2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-input-sdl", "..\..\..\mupen64plus-input-sdl\projects\msvc8\mupen64plus-input-sdl.vcproj", "{7F3178D0-0E2E-471B-9160-69F0354F9DE9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-audio-sdl", "..\..\..\mupen64plus-audio-sdl\projects\msvc8\mupen64plus-audio-sdl.vcproj", "{96969748-EA54-43FC-8103-A346E9AD98E7}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0E29D9F8-C675-4D21-AF16-AA80EDDB264E}.Debug|Win32.ActiveCfg = Debug|Win32 + {0E29D9F8-C675-4D21-AF16-AA80EDDB264E}.Debug|Win32.Build.0 = Debug|Win32 + {0E29D9F8-C675-4D21-AF16-AA80EDDB264E}.Release|Win32.ActiveCfg = Release|Win32 + {0E29D9F8-C675-4D21-AF16-AA80EDDB264E}.Release|Win32.Build.0 = Release|Win32 + {92D3FEB9-2129-41C5-8577-BCD7D961EF41}.Debug|Win32.ActiveCfg = Debug|Win32 + {92D3FEB9-2129-41C5-8577-BCD7D961EF41}.Debug|Win32.Build.0 = Debug|Win32 + {92D3FEB9-2129-41C5-8577-BCD7D961EF41}.Release|Win32.ActiveCfg = Release|Win32 + {92D3FEB9-2129-41C5-8577-BCD7D961EF41}.Release|Win32.Build.0 = Release|Win32 + {7D4AFF6A-B7D9-4C25-975A-038B8079098E}.Debug|Win32.ActiveCfg = Debug|Win32 + {7D4AFF6A-B7D9-4C25-975A-038B8079098E}.Debug|Win32.Build.0 = Debug|Win32 + {7D4AFF6A-B7D9-4C25-975A-038B8079098E}.Release|Win32.ActiveCfg = Release|Win32 + {7D4AFF6A-B7D9-4C25-975A-038B8079098E}.Release|Win32.Build.0 = Release|Win32 + {2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}.Debug|Win32.ActiveCfg = Debug|Win32 + {2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}.Debug|Win32.Build.0 = Debug|Win32 + {2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}.Release|Win32.ActiveCfg = Release|Win32 + {2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}.Release|Win32.Build.0 = Release|Win32 + {7F3178D0-0E2E-471B-9160-69F0354F9DE9}.Debug|Win32.ActiveCfg = Debug|Win32 + {7F3178D0-0E2E-471B-9160-69F0354F9DE9}.Debug|Win32.Build.0 = Debug|Win32 + {7F3178D0-0E2E-471B-9160-69F0354F9DE9}.Release|Win32.ActiveCfg = Release|Win32 + {7F3178D0-0E2E-471B-9160-69F0354F9DE9}.Release|Win32.Build.0 = Release|Win32 + {96969748-EA54-43FC-8103-A346E9AD98E7}.Debug|Win32.ActiveCfg = Debug|Win32 + {96969748-EA54-43FC-8103-A346E9AD98E7}.Debug|Win32.Build.0 = Debug|Win32 + {96969748-EA54-43FC-8103-A346E9AD98E7}.Release|Win32.ActiveCfg = Release|Win32 + {96969748-EA54-43FC-8103-A346E9AD98E7}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libmupen64plus/mupen64plus-ui-console/projects/msvc8/mupen64plus-ui-console.vcproj b/libmupen64plus/mupen64plus-ui-console/projects/msvc8/mupen64plus-ui-console.vcproj new file mode 100644 index 0000000000..09cb69b9e1 --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/projects/msvc8/mupen64plus-ui-console.vcproj @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libmupen64plus/mupen64plus-ui-console/projects/unix/Makefile b/libmupen64plus/mupen64plus-ui-console/projects/unix/Makefile new file mode 100644 index 0000000000..d574a66e8c --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/projects/unix/Makefile @@ -0,0 +1,331 @@ +#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# * Mupen64plus - Makefile * +# * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * +# * Copyright (C) 2009 Richard42 * +# * * +# * 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. * +# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +# Makefile for Mupen64plus-ui-console + +# detect operation system +UNAME ?= $(shell uname -s) +OS := NONE +ifeq ("$(UNAME)","Linux") + OS = LINUX +endif +ifeq ("$(UNAME)","linux") + OS = LINUX +endif +ifneq ("$(filter GNU hurd,$(UNAME))","") + OS = LINUX +endif +ifeq ("$(UNAME)","Darwin") + OS = OSX +endif +ifeq ("$(UNAME)","FreeBSD") + OS = FREEBSD +endif +ifeq ("$(UNAME)","OpenBSD") + OS = FREEBSD + $(warning OS type "$(UNAME)" not officially supported.') +endif +ifneq ("$(filter GNU/kFreeBSD kfreebsd,$(UNAME))","") + OS = LINUX +endif +ifeq ("$(patsubst MINGW%,MINGW,$(UNAME))","MINGW") + OS = MINGW +endif +ifeq ("$(OS)","NONE") + $(error OS type "$(UNAME)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') +endif + +# detect system architecture +HOST_CPU ?= $(shell uname -m) +NO_ASM ?= 1 +CPU := NONE +ifneq ("$(filter x86_64 amd64,$(HOST_CPU))","") + CPU := X86 + ifeq ("$(BITS)", "32") + ARCH_DETECTED := 64BITS_32 + else + ARCH_DETECTED := 64BITS + endif +endif +ifneq ("$(filter pentium i%86,$(HOST_CPU))","") + CPU := X86 + ARCH_DETECTED := 32BITS +endif +ifneq ("$(filter ppc macppc socppc powerpc,$(HOST_CPU))","") + CPU := PPC + ARCH_DETECTED := 32BITS + BIG_ENDIAN := 1 + $(warning Architecture "$(HOST_CPU)" not officially supported.') +endif +ifneq ("$(filter ppc64 powerpc64,$(HOST_CPU))","") + CPU := PPC + ARCH_DETECTED := 64BITS + BIG_ENDIAN := 1 + $(warning Architecture "$(HOST_CPU)" not officially supported.') +endif +ifneq ("$(filter arm%,$(HOST_CPU))","") + ifeq ("$(filter arm%b,$(HOST_CPU))","") + CPU := ARM + ARCH_DETECTED := 32BITS + $(warning Architecture "$(HOST_CPU)" not officially supported.') + endif +endif +ifeq ("$(CPU)","NONE") + $(error CPU type "$(HOST_CPU)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') +endif + +# base CFLAGS, LDLIBS, and LDFLAGS +OPTFLAGS ?= -O3 +WARNFLAGS ?= -Wall + +# default configuration programs +SDL_CONFIG = $(CROSS_COMPILE)sdl-config + +CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -I../../src +ifeq ($(OS), MINGW) + CFLAGS += -lpthread + LDLIBS += -lpthread +else + CFLAGS += -pthread + LDLIBS += -pthread +endif + +ifeq ($(PIE), 1) + CFLAGS += -fPIE + LDFLAGS += -fPIE -pie +else + CFLAGS += -fno-PIE + LDFLAGS += -fno-PIE +endif + +# set special flags per-system +ifeq ($(OS), LINUX) + LDLIBS += -ldl +endif +ifeq ($(OS), OSX) + # Select the proper SDK + # Also, SDKs are stored in a different location since XCode 4.3 + OSX_SDK ?= $(shell sw_vers -productVersion | cut -f1 -f2 -d .) + OSX_XCODEMAJ = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f1 -d .) + OSX_XCODEMIN = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f2 -d .) + OSX_XCODEGE43 = $(shell echo "`expr $(OSX_XCODEMAJ) \>= 4``expr $(OSX_XCODEMIN) \>= 3`") + ifeq ($(OSX_XCODEGE43), 11) + OSX_SYSROOT := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs + else + OSX_SYSROOT := /Developer/SDKs + endif + + # The mac version of SDL requires inclusion of SDL_main in the executable + CFLAGS += $(shell $(SDL_CONFIG) --cflags) + LDLIBS += -ldl $(shell $(SDL_CONFIG) --libs) + ifeq ($(CPU), X86) + ifeq ($(ARCH_DETECTED), 64BITS) + CFLAGS += -pipe -arch x86_64 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk + LDFLAGS += -arch x86_64 + else + CFLAGS += -pipe -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk + LDFLAGS += -arch i686 + endif + endif +endif + +ifeq ($(OS), MINGW) + # Do NOT include SDL_main for Windows; we are building a console app! + # NO -mwindows either! (it will still be a valid 32-bit Windows program) + CFLAGS += -I/usr/local/include/SDL -D_GNU_SOURCE=1 + LDLIBS += -L/usr/local/lib -lmingw32 -lSDL +endif + +ifeq ($(BIG_ENDIAN), 1) + CFLAGS += -DM64P_BIG_ENDIAN +endif + +# tweak flags for 32-bit build on 64-bit system +ifeq ($(ARCH_DETECTED), 64BITS_32) + ifeq ($(OS), FREEBSD) + $(error Do not use the BITS=32 option with FreeBSD, use -m32 and -m elf_i386) + endif + CFLAGS += -m32 + LDFLAGS += -m32 -Wl,-m,elf_i386 +endif + +# set mupen64plus core API header path +ifneq ("$(APIDIR)","") + CFLAGS += "-I$(APIDIR)" +else + TRYDIR = ../../../mupen64plus-core/src/api + ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") + CFLAGS += -I$(TRYDIR) + else + TRYDIR = /usr/local/include/mupen64plus + ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") + CFLAGS += -I$(TRYDIR) + else + TRYDIR = /usr/include/mupen64plus + ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") + CFLAGS += -I$(TRYDIR) + else + $(error Mupen64Plus API header files not found! Use makefile parameter APIDIR to force a location.) + endif + endif + endif +endif + +# reduced compile output when running make without V=1 +ifneq ($(findstring $(MAKEFLAGS),s),s) +ifndef V + Q_CC = @echo ' CC '$@; + Q_LD = @echo ' LD '$@; +endif +endif + +# set base program pointers and flags +CC = $(CROSS_COMPILE)gcc +CXX = $(CROSS_COMPILE)g++ +RM ?= rm -f +INSTALL ?= install +MKDIR ?= mkdir -p +COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c +LINK.o = $(Q_LD)$(CC) $(LDFLAGS) $(TARGET_ARCH) + +# set special flags for given Makefile parameters +# note: COREDIR _must_ end in a slash if you want it to work; not necessary for the others +ifneq ($(PLUGINDIR),) + CFLAGS += '-DPLUGINDIR="$(PLUGINDIR)"' +endif +ifneq ($(COREDIR),) + CFLAGS += '-DCOREDIR="$(COREDIR)"' +endif +ifneq ($(SHAREDIR),) + CFLAGS += '-DSHAREDIR="$(SHAREDIR)"' +endif +ifeq ($(DEBUG),1) + CFLAGS += -g + INSTALL_STRIP_FLAG ?= +else + INSTALL_STRIP_FLAG ?= -s +endif + +# set installation options +ifeq ($(PREFIX),) + PREFIX := /usr/local +endif +ifeq ($(BINDIR),) + BINDIR := $(PREFIX)/bin +endif +ifeq ($(MANDIR),) + MANDIR := $(PREFIX)/share/man +endif + +SRCDIR = ../../src +OBJDIR = _obj$(POSTFIX) + +ifeq ("$(OS)","MINGW") + EXEEXT = .exe +else + EXEEXT = +endif + +# list of source files to compile +SOURCE = \ + $(SRCDIR)/cheat.c \ + $(SRCDIR)/compare_core.c \ + $(SRCDIR)/core_interface.c \ + $(SRCDIR)/main.c \ + $(SRCDIR)/plugin.c + +ifeq ($(OS), MINGW) +SOURCE += \ + $(SRCDIR)/osal_dynamiclib_win32.c \ + $(SRCDIR)/osal_files_win32.c +else +SOURCE += \ + $(SRCDIR)/osal_dynamiclib_unix.c \ + $(SRCDIR)/osal_files_unix.c +endif + +# generate a list of object files build, make a temporary directory for them +OBJECTS := $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(filter %.c, $(SOURCE))) +OBJDIRS = $(dir $(OBJECTS)) +$(shell $(MKDIR) $(OBJDIRS)) + +# build targets +TARGET = mupen64plus$(POSTFIX)$(EXEEXT) + +targets: + @echo "Mupen64Plus-ui-console makefile." + @echo " Targets:" + @echo " all == Build Mupen64Plus console front-end application" + @echo " clean == remove object files and build products" + @echo " rebuild == clean and re-build all" + @echo " install == Install Mupen64Plus console front-end application" + @echo " uninstall == Uninstall Mupen64Plus console front-end application" + @echo " Options:" + @echo " COREDIR=path == default path to search for Mupen64Plus Core (must end with slash)" + @echo " PLUGINDIR=path == default path to search for plugins" + @echo " SHAREDIR=path == default path to search for shared data files" + @echo " APIDIR=path == path to find Mupen64Plus Core headers" + @echo " OPTFLAGS=flags == compiler optimization (default: -O3)" + @echo " WARNFLAGS=flag == compiler warning levels (default: -Wall)" + @echo " PIE=(1|0) == Force enable/disable of position independent executables" + @echo " POSTFIX=name == String added to the name of the the build (default: '')" + @echo " Install Options:" + @echo " PREFIX=path == install/uninstall prefix (default: /usr/local/)" + @echo " BINDIR=path == path to install mupen64plus binary (default: PREFIX/bin/)" + @echo " MANDIR=path == path to install mupen64plus manual page (default: PREFIX/share/man)" + @echo " DESTDIR=path == path to prepend to all installation paths (only for packagers)" + @echo " Debugging Options:" + @echo " DEBUG=1 == add debugging symbols to application binary" + @echo " LTO=1 == enable experimental build with link-time optimization" + @echo " V=1 == show verbose compiler output" + +all: $(TARGET) + +clean: + $(RM) -r $(OBJDIR) $(TARGET) + +rebuild: clean all + +install: $(TARGET) + $(INSTALL) -d "$(DESTDIR)$(BINDIR)" + $(INSTALL) -m 0755 $(INSTALL_STRIP_FLAG) $(TARGET) "$(DESTDIR)$(BINDIR)" + $(INSTALL) -d "$(DESTDIR)$(MANDIR)/man6" + $(INSTALL) -m 0644 ../../doc/mupen64plus.6 "$(DESTDIR)$(MANDIR)/man6" + +uninstall: + $(RM) "$(DESTDIR)$(BINDIR)/$(TARGET)" "$(DESTDIR)$(MANDIR)/man6/mupen64plus.6" + +# build dependency files +CFLAGS += -MD +-include $(OBJECTS:.o=.d) + +ifeq ($(LTO), 1) + CFLAGS += -flto + LDFLAGS += -fuse-linker-plugin -fwhole-program $(CFLAGS) +endif + +# standard build rules +$(OBJDIR)/%.o: $(SRCDIR)/%.c + $(COMPILE.c) -o $@ $< + +$(TARGET): $(OBJECTS) + $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@ + +.PHONY: all clean install uninstall targets diff --git a/libmupen64plus/mupen64plus-ui-console/src/cheat.c b/libmupen64plus/mupen64plus-ui-console/src/cheat.c new file mode 100644 index 0000000000..d491cbf0a8 --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/src/cheat.c @@ -0,0 +1,458 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - cheat.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009-2010 Richard Goedeken * + * Copyright (C) 2010 Rhett Osborne (spinout) * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include + +#include "m64p_types.h" + +#include "main.h" +#include "cheat.h" +#include "core_interface.h" + +/* local definitions */ +#define CHEAT_FILE "mupencheat.txt" + +typedef struct { + int address; + int *variables; + char **variable_names; + int var_to_use; + int var_count; +} cheat_code; + +typedef struct _sCheatInfo { + int Number; + int Count; + int VariableLine; + const char *Name; + const char *Description; + cheat_code *Codes; + struct _sCheatInfo *Next; + } sCheatInfo; + +/* local variables */ +static m64p_rom_header l_RomHeader; +static char *l_IniText = NULL; +static char *l_CheatGameName = NULL; +static sCheatInfo *l_CheatList = NULL; +static int l_CheatCodesFound = 0; +static int l_RomFound = 0; + +/********************************************************************************************************* + * Static (Local) functions + */ + +static int isSpace(char ch) +{ + return (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n'); +} + +/* Find cheat code */ +static sCheatInfo *CheatFindCode(int Number) +{ + sCheatInfo *pCur = l_CheatList; + while (pCur != NULL) + { + if (pCur->Number == Number) break; + pCur = pCur->Next; + } + return pCur; +} + + +/* Activate a code */ +static void CheatActivate(sCheatInfo *pCheat) +{ + int i; + + /* Get a m64p_cheat_code object */ + m64p_cheat_code * code = (m64p_cheat_code*) calloc(pCheat->Count, sizeof(m64p_cheat_code)); + if (code == NULL) + { + DebugMessage(M64MSG_WARNING, "could not allocate memory for code '%s'", pCheat->Name); + return; + } + /* Fill in members */ + for (i = 0; i < pCheat->Count; i++) + { + code[i].address = pCheat->Codes[i].address; + code[i].value = pCheat->Codes[i].variables[pCheat->Codes[i].var_to_use]; + } + /* Enable cheat */ + if (CoreAddCheat(pCheat->Name, code, pCheat->Count) != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_WARNING, "CoreAddCheat() failed for cheat code %i (%s)", pCheat->Number, pCheat->Name); + free(code); + return; + } + + free(code); + DebugMessage(M64MSG_STATUS, "activated cheat code %i: %s", pCheat->Number, pCheat->Name); +} + +static void CheatFreeAll(void) +{ + if (l_IniText != NULL) + free(l_IniText); + l_IniText = NULL; + + sCheatInfo *pCur = l_CheatList; + while (pCur != NULL) + { + sCheatInfo *pNext = pCur->Next; + if (pCur->Codes != NULL) + { + int i; + for (i=0; i < pCur->Count; i++) + { + if (pCur->Codes[i].variables != NULL) + free(pCur->Codes[i].variables); + if (pCur->Codes[i].variable_names != NULL) + free(pCur->Codes[i].variable_names); + } + free(pCur->Codes); + } + free(pCur); + pCur = pNext; + } + + l_CheatList = NULL; +} + +/* Append new code */ +static sCheatInfo * NewCode(char *CheatName, int CheatNum) +{ + /* allocate memory for a new sCheatInfo struct */ + sCheatInfo *pNew = (sCheatInfo *) malloc(sizeof(sCheatInfo)); + if (pNew == NULL) return NULL; + + /* fill in the data members */ + pNew->Number = CheatNum; + pNew->Count = 0; + pNew->VariableLine = -1; + pNew->Name = CheatName; + pNew->Description = NULL; + pNew->Codes = NULL; + pNew->Next = NULL; + + l_CheatCodesFound++; + + /* stick it at the end of the list */ + if (l_CheatList == NULL) + { + l_CheatList = pNew; + return pNew; + } + sCheatInfo *pLast = l_CheatList; + while (pLast->Next != NULL) pLast = pLast->Next; + pLast->Next = pNew; + return pNew; +} + +static void CheatAddVariables(cheat_code * Code, char *varlist) +{ + /* needs to be more verbose? */ + Code->variables = NULL; + Code->variable_names = NULL; + Code->var_count = 0; + while (*varlist != 0) + { + if ((Code->variables = (int*) realloc(Code->variables, sizeof(int) * (Code->var_count + 1))) == NULL) + return; + if ((Code->variable_names = (char**) realloc(Code->variable_names, sizeof(char*) * (Code->var_count + 1))) == NULL) + return; + if (sscanf(varlist, "%04X", &Code->variables[Code->var_count]) != 1) + Code->variables[Code->var_count] = 0; + if (strchr(varlist, '"') == NULL) + return; + Code->variable_names[Code->var_count] = strchr(varlist, '"') + 1; + if ((varlist = strchr(Code->variable_names[Code->var_count], '"')) == NULL) + return; + *varlist++ = 0; + if (*varlist == ',') + varlist++; + Code->var_count++; + } +} + +/********************************************************************************************************* +* global functions +*/ + +static void ReadCheats(char *RomSection) +{ + sCheatInfo *curr_code = NULL; + const char *romdbpath = ConfigGetSharedDataFilepath(CHEAT_FILE); + if (romdbpath == NULL) + { + DebugMessage(M64MSG_WARNING, "cheat code database file '%s' not found.", CHEAT_FILE); + return; + } + + /* read the INI file into a new buffer */ + FILE *fPtr = NULL; + fPtr = fopen(romdbpath, "rb"); + if (fPtr == NULL) + { + DebugMessage(M64MSG_WARNING, "Couldn't open cheat code database file '%s'.", romdbpath); + return; + } + fseek(fPtr, 0L, SEEK_END); + long IniLength = ftell(fPtr); + fseek(fPtr, 0L, SEEK_SET); + l_IniText = (char *) malloc(IniLength + 1); + if (l_IniText == NULL) + { + DebugMessage(M64MSG_WARNING, "Couldn't allocate %li bytes of memory to read cheat file.", IniLength); + fclose(fPtr); + return; + } + if (fread(l_IniText, 1, IniLength, fPtr) != IniLength) + { + DebugMessage(M64MSG_WARNING, "Couldn't read %li bytes from cheat file.", IniLength); + free(l_IniText); + l_IniText = NULL; + fclose(fPtr); + return; + } + fclose(fPtr); + l_IniText[IniLength] = 0; /* null-terminate the text data */ + + /* parse lines from cheat database */ + char *curline = NULL; + char *nextline = l_IniText; + + while(nextline != NULL && *nextline != 0) + { + curline = nextline; + /* get pointer to next line and NULL-terminate the current line */ + nextline = strchr(curline, '\n'); + if (nextline != NULL) + { + *nextline = 0; + nextline++; + } + + /* remove leading and trailing white space */ + while(isSpace(*curline)) curline++; + char *endptr = curline + strlen(curline) - 1; + while(isSpace(*endptr)) *endptr-- = 0; + + /* ignore line if comment or empty */ + if (*curline == '#' || strncmp(curline, "//", 2) == 0 || *curline == 0) + continue; + + /* handle beginning of new rom section */ + if (strncmp(curline, "crc ", 4) == 0) + { + /* if we have already found cheats for the given ROM file, then exit upon encountering a new ROM section */ + if (l_RomFound && (l_CheatGameName != NULL || l_CheatList != NULL)) + return; + /* else see if this Rom Section matches */ + if (strcmp(curline+4, RomSection) == 0) + l_RomFound = 1; + continue; + } + + /* if we haven't found the specified ROM section, then continue looking */ + if (!l_RomFound) + continue; + + /* Game name */ + if (strncmp(curline, "gn ", 3) == 0) + { + l_CheatGameName = curline+3; + continue; + } + + /* code name */ + if (strncmp(curline, "cn ", 3) == 0) + { + curr_code = NewCode(curline + 3, l_CheatCodesFound); + if (curr_code == NULL) + DebugMessage(M64MSG_WARNING, "error getting new code (%s)", curline+3); + continue; + } + + /* if curr_code is NULL, don't do these checks */ + if (curr_code == NULL) + continue; + + /* code description */ + if (strncmp(curline, "cd ", 3) == 0) + { + curr_code->Description = curline+3; + continue; + } + + /* code line */ + int address; + if (sscanf(curline, "%8X %*s", &address) == 1) + { + curr_code->Codes = (cheat_code*) realloc(curr_code->Codes, sizeof(cheat_code) * (curr_code->Count + 1)); + if (strncmp(curline+9, "????", 4) == 0) + { + curr_code->Codes[curr_code->Count].var_count = 0; + CheatAddVariables(&curr_code->Codes[curr_code->Count], curline+14); + curr_code->VariableLine = curr_code->Count; + } + else + { + int var; + curr_code->Codes[curr_code->Count].var_count = 1; + curr_code->Codes[curr_code->Count].variables = (int*) malloc(sizeof(int)); + if(curr_code->Codes[curr_code->Count].variables == NULL) + { + DebugMessage(M64MSG_WARNING, "couldn't allocate memory; ignoring line: '%s'", curline); + continue; + } + if (sscanf(curline+9, "%04X", &var) != 1) + var = 0; + curr_code->Codes[curr_code->Count].variables[0] = var; + curr_code->Codes[curr_code->Count].variable_names = NULL; + } + curr_code->Codes[curr_code->Count].var_to_use = 0; + curr_code->Codes[curr_code->Count].address = address; + curr_code->Count++; + continue; + } + + /* otherwise we don't know what this line is */ + DebugMessage(M64MSG_WARNING, "unrecognized line in cheat file: '%s'", curline); + } + +} + +void CheatStart(eCheatMode CheatMode, char *CheatNumList) +{ + /* if cheat codes are disabled, then we don't have to do anything */ + if (CheatMode == CHEAT_DISABLE || (CheatMode == CHEAT_LIST && strlen(CheatNumList) == 0)) + { + DebugMessage(M64MSG_STATUS, "Cheat codes disabled."); + return; + } + + /* get the ROM header for the currently loaded ROM image from the core */ + if ((*CoreDoCommand)(M64CMD_ROM_GET_HEADER, sizeof(l_RomHeader), &l_RomHeader) != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_WARNING, "couldn't get ROM header information from core library"); + return; + } + + /* generate section name from ROM's CRC and country code */ + char RomSection[24]; + sprintf(RomSection, "%08X-%08X-C:%X", sl(l_RomHeader.CRC1), sl(l_RomHeader.CRC2), l_RomHeader.Country_code & 0xff); + + /* parse through the cheat INI file and load up any cheat codes found for this ROM */ + ReadCheats(RomSection); + if (!l_RomFound || l_CheatCodesFound == 0) + { + DebugMessage(M64MSG_WARNING, "no cheat codes found for ROM image '%.20s'", l_RomHeader.Name); + CheatFreeAll(); + return; + } + + /* handle the list command */ + if (CheatMode == CHEAT_SHOW_LIST) + { + DebugMessage(M64MSG_INFO, "%i cheat code(s) found for ROM '%s'", l_CheatCodesFound, l_CheatGameName); + sCheatInfo *pCur = l_CheatList; + while (pCur != NULL) + { + if (pCur->Description == NULL) + DebugMessage(M64MSG_INFO, " %i: %s", pCur->Number, pCur->Name); + else + DebugMessage(M64MSG_INFO, " %i: %s (%s)", pCur->Number, pCur->Name, pCur->Description); + if(pCur->VariableLine != -1) + { + int i; + for (i = 0; i < pCur->Codes[pCur->VariableLine].var_count; i++) + DebugMessage(M64MSG_INFO, " %i: %s", i, pCur->Codes[pCur->VariableLine].variable_names[i]); + } + pCur = pCur->Next; + } + CheatFreeAll(); + return; + } + + /* handle all cheats enabled mode */ + if (CheatMode == CHEAT_ALL) + { + sCheatInfo *pCur = l_CheatList; + while (pCur != NULL) + { + CheatActivate(pCur); + pCur = pCur->Next; + } + CheatFreeAll(); + return; + } + + /* handle list of cheats enabled mode */ + if (CheatMode == CHEAT_LIST) + { + int option, number; + char *cheat_next; + sCheatInfo *pCheat; + while(CheatNumList != NULL && *CheatNumList) + { + if ((cheat_next = strchr(CheatNumList, ',')) != NULL) + { + *cheat_next = 0; + cheat_next ++; + } + + if (strchr(CheatNumList, '-') != NULL) + { + sscanf(CheatNumList, "%i-%i", &number, &option); /* option */ + } + else + { + option=0; + sscanf(CheatNumList, "%i", &number); + } + + pCheat = CheatFindCode(number); + if (pCheat == NULL) + DebugMessage(M64MSG_WARNING, "invalid cheat code number %i", number); + else + { + if (pCheat->VariableLine != -1 && pCheat->Count > pCheat->VariableLine && option < pCheat->Codes[pCheat->VariableLine].var_count) + pCheat->Codes[pCheat->VariableLine].var_to_use = option; + CheatActivate(pCheat); + } + + CheatNumList = cheat_next; + } + CheatFreeAll(); + + return; + } + + /* otherwise the mode is invalid */ + DebugMessage(M64MSG_WARNING, "internal error; invalid CheatMode in CheatStart()"); + + return; +} + diff --git a/libmupen64plus/mupen64plus-ui-console/src/cheat.h b/libmupen64plus/mupen64plus-ui-console/src/cheat.h new file mode 100644 index 0000000000..e44ac05cf2 --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/src/cheat.h @@ -0,0 +1,41 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - cheat.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef CHEAT_H +#define CHEAT_H + +#ifdef M64P_BIG_ENDIAN + #define sl(mot) mot +#else + #define sl(mot) (((mot & 0xFF) << 24) | ((mot & 0xFF00) << 8) | ((mot & 0xFF0000) >> 8) | ((mot & 0xFF000000) >> 24)) +#endif + +typedef enum { + CHEAT_DISABLE, + CHEAT_LIST, + CHEAT_ALL, + CHEAT_SHOW_LIST + } eCheatMode; + +void CheatStart(eCheatMode CheatMode, char *CheatNumList); + +#endif // #define CHEAT_H + diff --git a/libmupen64plus/mupen64plus-ui-console/src/compare_core.c b/libmupen64plus/mupen64plus-ui-console/src/compare_core.c new file mode 100644 index 0000000000..bdc4f8783e --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/src/compare_core.c @@ -0,0 +1,230 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - compare_core.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include + +#include "m64p_types.h" +#include "main.h" +#include "compare_core.h" +#include "core_interface.h" + +/* local variables */ + +static FILE *fPipe = NULL; +static int comp_reg_32[32]; +static long long comp_reg_64[32]; +static unsigned int old_op = 0; +static int l_CoreCompareMode = CORE_COMPARE_DISABLE; + +static long long *ptr_reg = NULL; /* pointer to the 64-bit general purpose registers in the core */ +static int *ptr_cop0 = NULL; /* pointer to the 32-bit Co-processor 0 registers in the core */ +static long long *ptr_fgr = NULL; /* pointer to the 64-bit floating-point registers in the core */ +static int *ptr_PC = NULL; /* pointer to 32-bit R4300 Program Counter */ + +/* local functions */ +static void stop_it(void) +{ + static int errors = 0; + + (*CoreDoCommand)(M64CMD_STOP, 0, NULL); + + errors++; +#if !defined(WIN32) + #if defined(__i386__) || defined(__x86_64__) + if (errors > 7) + asm("int $3;"); + #endif +#endif +} + +static void display_error(char *txt) +{ + int i; + + printf("err: %6s addr:%x\t ", txt, *ptr_PC); + + if (!strcmp(txt, "PC")) + { + printf("My PC: %x Ref PC: %x\t ", *ptr_PC, *comp_reg_32); + } + else if (!strcmp(txt, "gpr")) + { + for (i=0; i<32; i++) + { + if (ptr_reg[i] != comp_reg_64[i]) + printf("My: reg[%d]=%llx\t Ref: reg[%d]=%llx\t ", i, ptr_reg[i], i, comp_reg_64[i]); + } + } + else if (!strcmp(txt, "cop0")) + { + for (i=0; i<32; i++) + { + if (ptr_cop0[i] != comp_reg_32[i]) + printf("My: reg_cop0[%d]=%x\t Ref: reg_cop0[%d]=%x\t ", i, (unsigned int)ptr_cop0[i], i, (unsigned int)comp_reg_32[i]); + } + } + else if (!strcmp(txt, "cop1")) + { + for (i=0; i<32; i++) + { + if (ptr_fgr[i] != comp_reg_64[i]) + printf("My: reg[%d]=%llx\t Ref: reg[%d]=%llx\t ", i, ptr_fgr[i], i, comp_reg_64[i]); + } + } + printf("\n"); + /*for (i=0; i<32; i++) + { + if (reg_cop0[i] != comp_reg[i]) + printf("reg_cop0[%d]=%llx != reg[%d]=%llx\n", + i, reg_cop0[i], i, comp_reg[i]); + }*/ + + stop_it(); +} + +static void compare_core_sync_data(int length, void *value) +{ + if (l_CoreCompareMode == CORE_COMPARE_RECV) + { + if (fread(value, 1, length, fPipe) != length) + stop_it(); + } + else if (l_CoreCompareMode == CORE_COMPARE_SEND) + { + if (fwrite(value, 1, length, fPipe) != length) + stop_it(); + } +} + +static void compare_core_check(unsigned int cur_opcode) +{ + static int comparecnt = 0; + int iFirst = 1; + char errHead[128]; + sprintf(errHead, "Compare #%i old_op: %x op: %x\n", comparecnt++, old_op, cur_opcode); + + /* get pointer to current R4300 Program Counter address */ + ptr_PC = (int *) DebugGetCPUDataPtr(M64P_CPU_PC); /* this changes for every instruction */ + + if (l_CoreCompareMode == CORE_COMPARE_RECV) + { + if (fread(comp_reg_32, sizeof(int), 4, fPipe) != 4) + printf("compare_core_check: fread() failed"); + if (*ptr_PC != *comp_reg_32) + { + if (iFirst) + { + printf("%s", errHead); + iFirst = 0; + } + display_error("PC"); + } + if (fread (comp_reg_64, sizeof(long long int), 32, fPipe) != 32) + printf("compare_core_check: fread() failed"); + if (memcmp(ptr_reg, comp_reg_64, 32*sizeof(long long int)) != 0) + { + if (iFirst) + { + printf("%s", errHead); + iFirst = 0; + } + display_error("gpr"); + } + if (fread(comp_reg_32, sizeof(int), 32, fPipe) != 32) + printf("compare_core_check: fread() failed"); + if (memcmp(ptr_cop0, comp_reg_32, 32*sizeof(int)) != 0) + { + if (iFirst) + { + printf("%s", errHead); + iFirst = 0; + } + display_error("cop0"); + } + if (fread(comp_reg_64, sizeof(long long int), 32, fPipe) != 32) + printf("compare_core_check: fread() failed"); + if (memcmp(ptr_fgr, comp_reg_64, 32*sizeof(long long int))) + { + if (iFirst) + { + printf("%s", errHead); + iFirst = 0; + } + display_error("cop1"); + } + /*fread(comp_reg, 1, sizeof(int), f); + if (memcmp(&rdram[0x31280/4], comp_reg, sizeof(int))) + display_error("mem");*/ + /*fread (comp_reg, 4, 1, f); + if (memcmp(&FCR31, comp_reg, 4)) + display_error();*/ + old_op = cur_opcode; + } + else if (l_CoreCompareMode == CORE_COMPARE_SEND) + { + if (fwrite(ptr_PC, sizeof(int), 4, fPipe) != 4 || + fwrite(ptr_reg, sizeof(long long int), 32, fPipe) != 32 || + fwrite(ptr_cop0, sizeof(int), 32, fPipe) != 32 || + fwrite(ptr_fgr, sizeof(long long int), 32, fPipe) != 32) + printf("compare_core_check: fwrite() failed"); + /*fwrite(&rdram[0x31280/4], 1, sizeof(int), f); + fwrite(&FCR31, 4, 1, f);*/ + } +} + +/* global functions */ +void compare_core_init(int mode) +{ +#if defined(WIN32) + DebugMessage(M64MSG_VERBOSE, "core comparison feature not supported on Windows platform."); + return; +#else + /* set mode */ + l_CoreCompareMode = mode; + /* set callback functions in core */ + if (DebugSetCoreCompare(compare_core_check, compare_core_sync_data) != M64ERR_SUCCESS) + { + l_CoreCompareMode = CORE_COMPARE_DISABLE; + DebugMessage(M64MSG_WARNING, "DebugSetCoreCompare() failed, core comparison disabled."); + return; + } + /* get pointers to emulated R4300 CPU registers */ + ptr_reg = (long long *) DebugGetCPUDataPtr(M64P_CPU_REG_REG); + ptr_cop0 = (int *) DebugGetCPUDataPtr(M64P_CPU_REG_COP0); + ptr_fgr = (long long *) DebugGetCPUDataPtr(M64P_CPU_REG_COP1_FGR_64); + /* open file handle to FIFO pipe */ + if (l_CoreCompareMode == CORE_COMPARE_RECV) + { + mkfifo("compare_pipe", 0600); + DebugMessage(M64MSG_INFO, "Core Comparison Waiting to read pipe."); + fPipe = fopen("compare_pipe", "r"); + } + else if (l_CoreCompareMode == CORE_COMPARE_SEND) + { + DebugMessage(M64MSG_INFO, "Core Comparison Waiting to write pipe."); + fPipe = fopen("compare_pipe", "w"); + } +#endif +} + diff --git a/libmupen64plus/mupen64plus-ui-console/src/compare_core.h b/libmupen64plus/mupen64plus-ui-console/src/compare_core.h new file mode 100644 index 0000000000..1d54c8d715 --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/src/compare_core.h @@ -0,0 +1,34 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - compare_core.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#if !defined(COMPARE_CORE_H) +#define COMPARE_CORE_H + +typedef enum { + CORE_COMPARE_DISABLE = 0, + CORE_COMPARE_SEND = 1, + CORE_COMPARE_RECV = 2 +} CoreCompareMode; + +void compare_core_init(int mode); + +#endif /* COMPARE_CORE_H */ + diff --git a/libmupen64plus/mupen64plus-ui-console/src/core_interface.c b/libmupen64plus/mupen64plus-ui-console/src/core_interface.c new file mode 100644 index 0000000000..09dd817470 --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/src/core_interface.c @@ -0,0 +1,344 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-ui-console - core_interface.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This file contains the routines for attaching to the Mupen64Plus core + * library and pointers to the core functions + */ + +#include + +#include "m64p_types.h" +#include "m64p_common.h" +#include "m64p_frontend.h" +#include "m64p_config.h" +#include "m64p_debugger.h" + +#include "osal_preproc.h" +#include "osal_dynamiclib.h" + +#include "main.h" +#include "version.h" +#include "core_interface.h" + +/* global data definitions */ +int g_CoreCapabilities; +int g_CoreAPIVersion; + +/* definitions of pointers to Core common functions */ +ptr_CoreErrorMessage CoreErrorMessage = NULL; + +/* definitions of pointers to Core front-end functions */ +ptr_CoreStartup CoreStartup = NULL; +ptr_CoreShutdown CoreShutdown = NULL; +ptr_CoreAttachPlugin CoreAttachPlugin = NULL; +ptr_CoreDetachPlugin CoreDetachPlugin = NULL; +ptr_CoreDoCommand CoreDoCommand = NULL; +ptr_CoreOverrideVidExt CoreOverrideVidExt = NULL; +ptr_CoreAddCheat CoreAddCheat = NULL; +ptr_CoreCheatEnabled CoreCheatEnabled = NULL; + +/* definitions of pointers to Core config functions */ +ptr_ConfigListSections ConfigListSections = NULL; +ptr_ConfigOpenSection ConfigOpenSection = NULL; +ptr_ConfigDeleteSection ConfigDeleteSection = NULL; +ptr_ConfigSaveSection ConfigSaveSection = NULL; +ptr_ConfigListParameters ConfigListParameters = NULL; +ptr_ConfigSaveFile ConfigSaveFile = NULL; +ptr_ConfigSetParameter ConfigSetParameter = NULL; +ptr_ConfigGetParameter ConfigGetParameter = NULL; +ptr_ConfigGetParameterType ConfigGetParameterType = NULL; +ptr_ConfigGetParameterHelp ConfigGetParameterHelp = NULL; +ptr_ConfigSetDefaultInt ConfigSetDefaultInt = NULL; +ptr_ConfigSetDefaultFloat ConfigSetDefaultFloat = NULL; +ptr_ConfigSetDefaultBool ConfigSetDefaultBool = NULL; +ptr_ConfigSetDefaultString ConfigSetDefaultString = NULL; +ptr_ConfigGetParamInt ConfigGetParamInt = NULL; +ptr_ConfigGetParamFloat ConfigGetParamFloat = NULL; +ptr_ConfigGetParamBool ConfigGetParamBool = NULL; +ptr_ConfigGetParamString ConfigGetParamString = NULL; + +ptr_ConfigGetSharedDataFilepath ConfigGetSharedDataFilepath = NULL; +ptr_ConfigGetUserConfigPath ConfigGetUserConfigPath = NULL; +ptr_ConfigGetUserDataPath ConfigGetUserDataPath = NULL; +ptr_ConfigGetUserCachePath ConfigGetUserCachePath = NULL; + +/* definitions of pointers to Core debugger functions */ +ptr_DebugSetCallbacks DebugSetCallbacks = NULL; +ptr_DebugSetCoreCompare DebugSetCoreCompare = NULL; +ptr_DebugSetRunState DebugSetRunState = NULL; +ptr_DebugGetState DebugGetState = NULL; +ptr_DebugStep DebugStep = NULL; +ptr_DebugDecodeOp DebugDecodeOp = NULL; +ptr_DebugMemGetRecompInfo DebugMemGetRecompInfo = NULL; +ptr_DebugMemGetMemInfo DebugMemGetMemInfo = NULL; +ptr_DebugMemGetPointer DebugMemGetPointer = NULL; + +ptr_DebugMemRead64 DebugMemRead64 = NULL; +ptr_DebugMemRead32 DebugMemRead32 = NULL; +ptr_DebugMemRead16 DebugMemRead16 = NULL; +ptr_DebugMemRead8 DebugMemRead8 = NULL; + +ptr_DebugMemWrite64 DebugMemWrite64 = NULL; +ptr_DebugMemWrite32 DebugMemWrite32 = NULL; +ptr_DebugMemWrite16 DebugMemWrite16 = NULL; +ptr_DebugMemWrite8 DebugMemWrite8 = NULL; + +ptr_DebugGetCPUDataPtr DebugGetCPUDataPtr = NULL; +ptr_DebugBreakpointLookup DebugBreakpointLookup = NULL; +ptr_DebugBreakpointCommand DebugBreakpointCommand = NULL; + +/* global variables */ +m64p_dynlib_handle CoreHandle = NULL; + +/* functions */ +m64p_error AttachCoreLib(const char *CoreLibFilepath) +{ + /* check if Core DLL is already attached */ + if (CoreHandle != NULL) + return M64ERR_INVALID_STATE; + + /* load the DLL */ + m64p_error rval = M64ERR_INTERNAL; + /* first, try a library path+name that was given on the command-line */ + if (CoreLibFilepath != NULL) + { + rval = osal_dynlib_open(&CoreHandle, CoreLibFilepath); + } + /* then try a library path that was given at compile time */ +#if defined(COREDIR) + if (rval != M64ERR_SUCCESS || CoreHandle == NULL) + { + rval = osal_dynlib_open(&CoreHandle, COREDIR OSAL_DEFAULT_DYNLIB_FILENAME); + } +#endif + /* then try just the filename of the shared library, to let dlopen() look through the system lib dirs */ + if (rval != M64ERR_SUCCESS || CoreHandle == NULL) + { + rval = osal_dynlib_open(&CoreHandle, OSAL_DEFAULT_DYNLIB_FILENAME); + } + /* as a last-ditch effort, try loading library in current directory */ + if (rval != M64ERR_SUCCESS || CoreHandle == NULL) + { + rval = osal_dynlib_open(&CoreHandle, OSAL_CURRENT_DIR OSAL_DEFAULT_DYNLIB_FILENAME); + } + /* if we haven't found a good core library by now, then we're screwed */ + if (rval != M64ERR_SUCCESS || CoreHandle == NULL) + { + DebugMessage(M64MSG_ERROR, "AttachCoreLib() Error: failed to find Mupen64Plus Core library"); + CoreHandle = NULL; + return M64ERR_INPUT_NOT_FOUND; + } + + /* attach and call the PluginGetVersion function, check the Core and API versions for compatibility with this front-end */ + ptr_PluginGetVersion CoreVersionFunc; + CoreVersionFunc = (ptr_PluginGetVersion) osal_dynlib_getproc(CoreHandle, "PluginGetVersion"); + if (CoreVersionFunc == NULL) + { + DebugMessage(M64MSG_ERROR, "AttachCoreLib() Error: Shared library '%s' invalid; no PluginGetVersion() function found.", CoreLibFilepath); + osal_dynlib_close(CoreHandle); + CoreHandle = NULL; + return M64ERR_INPUT_INVALID; + } + m64p_plugin_type PluginType = (m64p_plugin_type) 0; + int Compatible = 0; + int CoreVersion = 0; + const char *CoreName = NULL; + (*CoreVersionFunc)(&PluginType, &CoreVersion, &g_CoreAPIVersion, &CoreName, &g_CoreCapabilities); + if (PluginType != M64PLUGIN_CORE) + DebugMessage(M64MSG_ERROR, "AttachCoreLib() Error: Shared library '%s' invalid; this is not the emulator core.", CoreLibFilepath); + else if (CoreVersion < MINIMUM_CORE_VERSION) + DebugMessage(M64MSG_ERROR, "AttachCoreLib() Error: Shared library '%s' incompatible; core version %i.%i.%i is below minimum supported %i.%i.%i", + CoreLibFilepath, VERSION_PRINTF_SPLIT(CoreVersion), VERSION_PRINTF_SPLIT(MINIMUM_CORE_VERSION)); + else if ((g_CoreAPIVersion & 0xffff0000) != (CORE_API_VERSION & 0xffff0000)) + DebugMessage(M64MSG_ERROR, "AttachCoreLib() Error: Shared library '%s' incompatible; core API major version %i.%i.%i doesn't match with this application (%i.%i.%i)", + CoreLibFilepath, VERSION_PRINTF_SPLIT(g_CoreAPIVersion), VERSION_PRINTF_SPLIT(CORE_API_VERSION)); + else + Compatible = 1; + /* exit if not compatible */ + if (Compatible == 0) + { + osal_dynlib_close(CoreHandle); + CoreHandle = NULL; + return M64ERR_INCOMPATIBLE; + } + + /* attach and call the CoreGetAPIVersion function, check Config API version for compatibility */ + ptr_CoreGetAPIVersions CoreAPIVersionFunc; + CoreAPIVersionFunc = (ptr_CoreGetAPIVersions) osal_dynlib_getproc(CoreHandle, "CoreGetAPIVersions"); + if (CoreAPIVersionFunc == NULL) + { + DebugMessage(M64MSG_ERROR, "AttachCoreLib() Error: Library '%s' broken; no CoreAPIVersionFunc() function found.", CoreLibFilepath); + osal_dynlib_close(CoreHandle); + CoreHandle = NULL; + return M64ERR_INPUT_INVALID; + } + int ConfigAPIVersion, DebugAPIVersion, VidextAPIVersion; + (*CoreAPIVersionFunc)(&ConfigAPIVersion, &DebugAPIVersion, &VidextAPIVersion, NULL); + if ((ConfigAPIVersion & 0xffff0000) != (CONFIG_API_VERSION & 0xffff0000)) + { + DebugMessage(M64MSG_ERROR, "AttachCoreLib() Error: Emulator core '%s' incompatible; Config API major version %i.%i.%i doesn't match application: %i.%i.%i", + CoreLibFilepath, VERSION_PRINTF_SPLIT(ConfigAPIVersion), VERSION_PRINTF_SPLIT(CONFIG_API_VERSION)); + osal_dynlib_close(CoreHandle); + CoreHandle = NULL; + return M64ERR_INCOMPATIBLE; + } + + /* print some information about the core library */ + DebugMessage(M64MSG_INFO, "attached to core library '%s' version %i.%i.%i", CoreName, VERSION_PRINTF_SPLIT(CoreVersion)); + if (g_CoreCapabilities & M64CAPS_DYNAREC) + DebugMessage(M64MSG_INFO, " Includes support for Dynamic Recompiler."); + if (g_CoreCapabilities & M64CAPS_DEBUGGER) + DebugMessage(M64MSG_INFO, " Includes support for MIPS r4300 Debugger."); + if (g_CoreCapabilities & M64CAPS_CORE_COMPARE) + DebugMessage(M64MSG_INFO, " Includes support for r4300 Core Comparison."); + + /* get function pointers to the common and front-end functions */ + CoreErrorMessage = (ptr_CoreErrorMessage) osal_dynlib_getproc(CoreHandle, "CoreErrorMessage"); + CoreStartup = (ptr_CoreStartup) osal_dynlib_getproc(CoreHandle, "CoreStartup"); + CoreShutdown = (ptr_CoreShutdown) osal_dynlib_getproc(CoreHandle, "CoreShutdown"); + CoreAttachPlugin = (ptr_CoreAttachPlugin) osal_dynlib_getproc(CoreHandle, "CoreAttachPlugin"); + CoreDetachPlugin = (ptr_CoreDetachPlugin) osal_dynlib_getproc(CoreHandle, "CoreDetachPlugin"); + CoreDoCommand = (ptr_CoreDoCommand) osal_dynlib_getproc(CoreHandle, "CoreDoCommand"); + CoreOverrideVidExt = (ptr_CoreOverrideVidExt) osal_dynlib_getproc(CoreHandle, "CoreOverrideVidExt"); + CoreAddCheat = (ptr_CoreAddCheat) osal_dynlib_getproc(CoreHandle, "CoreAddCheat"); + CoreCheatEnabled = (ptr_CoreCheatEnabled) osal_dynlib_getproc(CoreHandle, "CoreCheatEnabled"); + + /* get function pointers to the configuration functions */ + ConfigListSections = (ptr_ConfigListSections) osal_dynlib_getproc(CoreHandle, "ConfigListSections"); + ConfigOpenSection = (ptr_ConfigOpenSection) osal_dynlib_getproc(CoreHandle, "ConfigOpenSection"); + ConfigDeleteSection = (ptr_ConfigDeleteSection) osal_dynlib_getproc(CoreHandle, "ConfigDeleteSection"); + ConfigSaveSection = (ptr_ConfigSaveSection) osal_dynlib_getproc(CoreHandle, "ConfigSaveSection"); + ConfigListParameters = (ptr_ConfigListParameters) osal_dynlib_getproc(CoreHandle, "ConfigListParameters"); + ConfigSaveFile = (ptr_ConfigSaveFile) osal_dynlib_getproc(CoreHandle, "ConfigSaveFile"); + ConfigSetParameter = (ptr_ConfigSetParameter) osal_dynlib_getproc(CoreHandle, "ConfigSetParameter"); + ConfigGetParameter = (ptr_ConfigGetParameter) osal_dynlib_getproc(CoreHandle, "ConfigGetParameter"); + ConfigGetParameterType = (ptr_ConfigGetParameterType) osal_dynlib_getproc(CoreHandle, "ConfigGetParameterType"); + ConfigGetParameterHelp = (ptr_ConfigGetParameterHelp) osal_dynlib_getproc(CoreHandle, "ConfigGetParameterHelp"); + ConfigSetDefaultInt = (ptr_ConfigSetDefaultInt) osal_dynlib_getproc(CoreHandle, "ConfigSetDefaultInt"); + ConfigSetDefaultFloat = (ptr_ConfigSetDefaultFloat) osal_dynlib_getproc(CoreHandle, "ConfigSetDefaultFloat"); + ConfigSetDefaultBool = (ptr_ConfigSetDefaultBool) osal_dynlib_getproc(CoreHandle, "ConfigSetDefaultBool"); + ConfigSetDefaultString = (ptr_ConfigSetDefaultString) osal_dynlib_getproc(CoreHandle, "ConfigSetDefaultString"); + ConfigGetParamInt = (ptr_ConfigGetParamInt) osal_dynlib_getproc(CoreHandle, "ConfigGetParamInt"); + ConfigGetParamFloat = (ptr_ConfigGetParamFloat) osal_dynlib_getproc(CoreHandle, "ConfigGetParamFloat"); + ConfigGetParamBool = (ptr_ConfigGetParamBool) osal_dynlib_getproc(CoreHandle, "ConfigGetParamBool"); + ConfigGetParamString = (ptr_ConfigGetParamString) osal_dynlib_getproc(CoreHandle, "ConfigGetParamString"); + + ConfigGetSharedDataFilepath = (ptr_ConfigGetSharedDataFilepath) osal_dynlib_getproc(CoreHandle, "ConfigGetSharedDataFilepath"); + ConfigGetUserConfigPath = (ptr_ConfigGetUserConfigPath) osal_dynlib_getproc(CoreHandle, "ConfigGetUserConfigPath"); + ConfigGetUserDataPath = (ptr_ConfigGetUserDataPath) osal_dynlib_getproc(CoreHandle, "ConfigGetUserDataPath"); + ConfigGetUserCachePath = (ptr_ConfigGetUserCachePath) osal_dynlib_getproc(CoreHandle, "ConfigGetUserCachePath"); + + /* get function pointers to the debugger functions */ + DebugSetCallbacks = (ptr_DebugSetCallbacks) osal_dynlib_getproc(CoreHandle, "DebugSetCallbacks"); + DebugSetCoreCompare = (ptr_DebugSetCoreCompare) osal_dynlib_getproc(CoreHandle, "DebugSetCoreCompare"); + DebugSetRunState = (ptr_DebugSetRunState) osal_dynlib_getproc(CoreHandle, "DebugSetRunState"); + DebugGetState = (ptr_DebugGetState) osal_dynlib_getproc(CoreHandle, "DebugGetState"); + DebugStep = (ptr_DebugStep) osal_dynlib_getproc(CoreHandle, "DebugStep"); + DebugDecodeOp = (ptr_DebugDecodeOp) osal_dynlib_getproc(CoreHandle, "DebugDecodeOp"); + DebugMemGetRecompInfo = (ptr_DebugMemGetRecompInfo) osal_dynlib_getproc(CoreHandle, "DebugMemGetRecompInfo"); + DebugMemGetMemInfo = (ptr_DebugMemGetMemInfo) osal_dynlib_getproc(CoreHandle, "DebugMemGetMemInfo"); + DebugMemGetPointer = (ptr_DebugMemGetPointer) osal_dynlib_getproc(CoreHandle, "DebugMemGetPointer"); + + DebugMemRead64 = (ptr_DebugMemRead64) osal_dynlib_getproc(CoreHandle, "DebugMemRead64"); + DebugMemRead32 = (ptr_DebugMemRead32) osal_dynlib_getproc(CoreHandle, "DebugMemRead32"); + DebugMemRead16 = (ptr_DebugMemRead16) osal_dynlib_getproc(CoreHandle, "DebugMemRead16"); + DebugMemRead8 = (ptr_DebugMemRead8) osal_dynlib_getproc(CoreHandle, "DebugMemRead8"); + + DebugMemWrite64 = (ptr_DebugMemWrite64) osal_dynlib_getproc(CoreHandle, "DebugMemRead64"); + DebugMemWrite32 = (ptr_DebugMemWrite32) osal_dynlib_getproc(CoreHandle, "DebugMemRead32"); + DebugMemWrite16 = (ptr_DebugMemWrite16) osal_dynlib_getproc(CoreHandle, "DebugMemRead16"); + DebugMemWrite8 = (ptr_DebugMemWrite8) osal_dynlib_getproc(CoreHandle, "DebugMemRead8"); + + DebugGetCPUDataPtr = (ptr_DebugGetCPUDataPtr) osal_dynlib_getproc(CoreHandle, "DebugGetCPUDataPtr"); + DebugBreakpointLookup = (ptr_DebugBreakpointLookup) osal_dynlib_getproc(CoreHandle, "DebugBreakpointLookup"); + DebugBreakpointCommand = (ptr_DebugBreakpointCommand) osal_dynlib_getproc(CoreHandle, "DebugBreakpointCommand"); + + return M64ERR_SUCCESS; +} + +m64p_error DetachCoreLib(void) +{ + if (CoreHandle == NULL) + return M64ERR_INVALID_STATE; + + /* set the core function pointers to NULL */ + CoreErrorMessage = NULL; + CoreStartup = NULL; + CoreShutdown = NULL; + CoreAttachPlugin = NULL; + CoreDetachPlugin = NULL; + CoreDoCommand = NULL; + CoreOverrideVidExt = NULL; + CoreAddCheat = NULL; + CoreCheatEnabled = NULL; + + ConfigListSections = NULL; + ConfigOpenSection = NULL; + ConfigDeleteSection = NULL; + ConfigSaveSection = NULL; + ConfigListParameters = NULL; + ConfigSetParameter = NULL; + ConfigGetParameter = NULL; + ConfigGetParameterType = NULL; + ConfigGetParameterHelp = NULL; + ConfigSetDefaultInt = NULL; + ConfigSetDefaultBool = NULL; + ConfigSetDefaultString = NULL; + ConfigGetParamInt = NULL; + ConfigGetParamBool = NULL; + ConfigGetParamString = NULL; + + ConfigGetSharedDataFilepath = NULL; + ConfigGetUserDataPath = NULL; + ConfigGetUserCachePath = NULL; + + DebugSetCallbacks = NULL; + DebugSetCoreCompare = NULL; + DebugSetRunState = NULL; + DebugGetState = NULL; + DebugStep = NULL; + DebugDecodeOp = NULL; + DebugMemGetRecompInfo = NULL; + DebugMemGetMemInfo = NULL; + DebugMemGetPointer = NULL; + + DebugMemRead64 = NULL; + DebugMemRead32 = NULL; + DebugMemRead16 = NULL; + DebugMemRead8 = NULL; + + DebugMemWrite64 = NULL; + DebugMemWrite32 = NULL; + DebugMemWrite16 = NULL; + DebugMemWrite8 = NULL; + + DebugGetCPUDataPtr = NULL; + DebugBreakpointLookup = NULL; + DebugBreakpointCommand = NULL; + + /* detach the shared library */ + osal_dynlib_close(CoreHandle); + CoreHandle = NULL; + + return M64ERR_SUCCESS; +} + + diff --git a/libmupen64plus/mupen64plus-ui-console/src/core_interface.h b/libmupen64plus/mupen64plus-ui-console/src/core_interface.h new file mode 100644 index 0000000000..295daae697 --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/src/core_interface.h @@ -0,0 +1,104 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-ui-console - core_interface.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#if !defined(CORE_INTERFACE_H) +#define CORE_INTERFACE_H + +#include "m64p_types.h" +#include "m64p_common.h" +#include "m64p_frontend.h" +#include "m64p_config.h" +#include "m64p_debugger.h" + +/* function declarations */ +extern m64p_error AttachCoreLib(const char *CoreLibFilepath); +extern m64p_error DetachCoreLib(void); + +/* global variables from core_interface.c */ +extern int g_CoreCapabilities; +extern int g_CoreAPIVersion; + +/* declarations of Core library handle and pointers to common functions */ +extern m64p_dynlib_handle CoreHandle; +extern ptr_CoreErrorMessage CoreErrorMessage; + +/* declarations of pointers to Core front-end functions */ +extern ptr_CoreStartup CoreStartup; +extern ptr_CoreShutdown CoreShutdown; +extern ptr_CoreAttachPlugin CoreAttachPlugin; +extern ptr_CoreDetachPlugin CoreDetachPlugin; +extern ptr_CoreDoCommand CoreDoCommand; +extern ptr_CoreOverrideVidExt CoreOverrideVidExt; +extern ptr_CoreAddCheat CoreAddCheat; +extern ptr_CoreCheatEnabled CoreCheatEnabled; + +/* declarations of pointers to Core config functions */ +extern ptr_ConfigListSections ConfigListSections; +extern ptr_ConfigOpenSection ConfigOpenSection; +extern ptr_ConfigDeleteSection ConfigDeleteSection; +extern ptr_ConfigSaveSection ConfigSaveSection; +extern ptr_ConfigListParameters ConfigListParameters; +extern ptr_ConfigSaveFile ConfigSaveFile; +extern ptr_ConfigSetParameter ConfigSetParameter; +extern ptr_ConfigGetParameter ConfigGetParameter; +extern ptr_ConfigGetParameterType ConfigGetParameterType; +extern ptr_ConfigGetParameterHelp ConfigGetParameterHelp; +extern ptr_ConfigSetDefaultInt ConfigSetDefaultInt; +extern ptr_ConfigSetDefaultFloat ConfigSetDefaultFloat; +extern ptr_ConfigSetDefaultBool ConfigSetDefaultBool; +extern ptr_ConfigSetDefaultString ConfigSetDefaultString; +extern ptr_ConfigGetParamInt ConfigGetParamInt; +extern ptr_ConfigGetParamFloat ConfigGetParamFloat; +extern ptr_ConfigGetParamBool ConfigGetParamBool; +extern ptr_ConfigGetParamString ConfigGetParamString; + +extern ptr_ConfigGetSharedDataFilepath ConfigGetSharedDataFilepath; +extern ptr_ConfigGetUserConfigPath ConfigGetUserConfigPath; +extern ptr_ConfigGetUserDataPath ConfigGetUserDataPath; +extern ptr_ConfigGetUserCachePath ConfigGetUserCachePath; + +/* declarations of pointers to Core debugger functions */ +extern ptr_DebugSetCallbacks DebugSetCallbacks; +extern ptr_DebugSetCoreCompare DebugSetCoreCompare; +extern ptr_DebugSetRunState DebugSetRunState; +extern ptr_DebugGetState DebugGetState; +extern ptr_DebugStep DebugStep; +extern ptr_DebugDecodeOp DebugDecodeOp; +extern ptr_DebugMemGetRecompInfo DebugMemGetRecompInfo; +extern ptr_DebugMemGetMemInfo DebugMemGetMemInfo; +extern ptr_DebugMemGetPointer DebugMemGetPointer; + +extern ptr_DebugMemRead64 DebugMemRead64; +extern ptr_DebugMemRead32 DebugMemRead32; +extern ptr_DebugMemRead16 DebugMemRead16; +extern ptr_DebugMemRead8 DebugMemRead8; + +extern ptr_DebugMemWrite64 DebugMemWrite64; +extern ptr_DebugMemWrite32 DebugMemWrite32; +extern ptr_DebugMemWrite16 DebugMemWrite16; +extern ptr_DebugMemWrite8 DebugMemWrite8; + +extern ptr_DebugGetCPUDataPtr DebugGetCPUDataPtr; +extern ptr_DebugBreakpointLookup DebugBreakpointLookup; +extern ptr_DebugBreakpointCommand DebugBreakpointCommand; + +#endif /* #define CORE_INTERFACE_H */ + diff --git a/libmupen64plus/mupen64plus-ui-console/src/main.c b/libmupen64plus/mupen64plus-ui-console/src/main.c new file mode 100644 index 0000000000..c7f20e23a3 --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/src/main.c @@ -0,0 +1,756 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-ui-console - main.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2007-2010 Richard42 * + * Copyright (C) 2008 Ebenblues Nmn Okaygo Tillin9 * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This is the main application entry point for the console-only front-end + * for Mupen64Plus v2.0. + */ + +#include +#include +#include +#include + +// The mac version of SDL requires inclusion of SDL_main in the executable +#ifdef __APPLE__ + #include +#endif + +#include "cheat.h" +#include "main.h" +#include "plugin.h" +#include "version.h" +#include "core_interface.h" +#include "compare_core.h" +#include "osal_preproc.h" + +/* Version number for UI-Console config section parameters */ +#define CONFIG_PARAM_VERSION 1.00 + +/** global variables **/ +int g_Verbose = 0; + +/** static (local) variables **/ +static m64p_handle l_ConfigCore = NULL; +static m64p_handle l_ConfigVideo = NULL; +static m64p_handle l_ConfigUI = NULL; + +static const char *l_CoreLibPath = NULL; +static const char *l_ConfigDirPath = NULL; +static const char *l_ROMFilepath = NULL; // filepath of ROM to load & run at startup + +#if defined(SHAREDIR) + static const char *l_DataDirPath = SHAREDIR; +#else + static const char *l_DataDirPath = NULL; +#endif + +static int *l_TestShotList = NULL; // list of screenshots to take for regression test support +static int l_TestShotIdx = 0; // index of next screenshot frame in list +static int l_SaveOptions = 1; // save command-line options in configuration file (enabled by default) +static int l_CoreCompareMode = 0; // 0 = disable, 1 = send, 2 = receive + +static eCheatMode l_CheatMode = CHEAT_DISABLE; +static char *l_CheatNumList = NULL; + +/********************************************************************************************************* + * Callback functions from the core + */ + +void DebugMessage(int level, const char *message, ...) +{ + char msgbuf[1024]; + va_list args; + + va_start(args, message); + vsnprintf(msgbuf, 1024, message, args); + + DebugCallback("UI-Console", level, msgbuf); + + va_end(args); +} + +void DebugCallback(void *Context, int level, const char *message) +{ + if (level == M64MSG_ERROR) + printf("%s Error: %s\n", (const char *) Context, message); + else if (level == M64MSG_WARNING) + printf("%s Warning: %s\n", (const char *) Context, message); + else if (level == M64MSG_INFO) + printf("%s: %s\n", (const char *) Context, message); + else if (level == M64MSG_STATUS) + printf("%s Status: %s\n", (const char *) Context, message); + else if (level == M64MSG_VERBOSE) + { + if (g_Verbose) + printf("%s: %s\n", (const char *) Context, message); + } + else + printf("%s Unknown: %s\n", (const char *) Context, message); +} + +static void FrameCallback(unsigned int FrameIndex) +{ + // take a screenshot if we need to + if (l_TestShotList != NULL) + { + int nextshot = l_TestShotList[l_TestShotIdx]; + if (nextshot == FrameIndex) + { + (*CoreDoCommand)(M64CMD_TAKE_NEXT_SCREENSHOT, 0, NULL); /* tell the core take a screenshot */ + // advance list index to next screenshot frame number. If it's 0, then quit + l_TestShotIdx++; + } + else if (nextshot == 0) + { + (*CoreDoCommand)(M64CMD_STOP, 0, NULL); /* tell the core to shut down ASAP */ + free(l_TestShotList); + l_TestShotList = NULL; + } + } +} +/********************************************************************************************************* + * Configuration handling + */ + +static m64p_error OpenConfigurationHandles(void) +{ + float fConfigParamsVersion; + int bSaveConfig = 0; + m64p_error rval; + + /* Open Configuration sections for core library and console User Interface */ + rval = (*ConfigOpenSection)("Core", &l_ConfigCore); + if (rval != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_ERROR, "failed to open 'Core' configuration section"); + return rval; + } + + rval = (*ConfigOpenSection)("Video-General", &l_ConfigVideo); + if (rval != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_ERROR, "failed to open 'Video-General' configuration section"); + return rval; + } + + rval = (*ConfigOpenSection)("UI-Console", &l_ConfigUI); + if (rval != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_ERROR, "failed to open 'UI-Console' configuration section"); + return rval; + } + + if ((*ConfigGetParameter)(l_ConfigUI, "Version", M64TYPE_FLOAT, &fConfigParamsVersion, sizeof(float)) != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_WARNING, "No version number in 'UI-Console' config section. Setting defaults."); + (*ConfigDeleteSection)("UI-Console"); + (*ConfigOpenSection)("UI-Console", &l_ConfigUI); + bSaveConfig = 1; + } + else if (((int) fConfigParamsVersion) != ((int) CONFIG_PARAM_VERSION)) + { + DebugMessage(M64MSG_WARNING, "Incompatible version %.2f in 'UI-Console' config section: current is %.2f. Setting defaults.", fConfigParamsVersion, (float) CONFIG_PARAM_VERSION); + (*ConfigDeleteSection)("UI-Console"); + (*ConfigOpenSection)("UI-Console", &l_ConfigUI); + bSaveConfig = 1; + } + else if ((CONFIG_PARAM_VERSION - fConfigParamsVersion) >= 0.0001f) + { + /* handle upgrades */ + float fVersion = CONFIG_PARAM_VERSION; + ConfigSetParameter(l_ConfigUI, "Version", M64TYPE_FLOAT, &fVersion); + DebugMessage(M64MSG_INFO, "Updating parameter set version in 'UI-Console' config section to %.2f", fVersion); + bSaveConfig = 1; + } + + /* Set default values for my Config parameters */ + (*ConfigSetDefaultFloat)(l_ConfigUI, "Version", CONFIG_PARAM_VERSION, "Mupen64Plus UI-Console config parameter set version number. Please don't change this version number."); + (*ConfigSetDefaultString)(l_ConfigUI, "PluginDir", OSAL_CURRENT_DIR, "Directory in which to search for plugins"); + (*ConfigSetDefaultString)(l_ConfigUI, "VideoPlugin", "mupen64plus-video-rice" OSAL_DLL_EXTENSION, "Filename of video plugin"); + (*ConfigSetDefaultString)(l_ConfigUI, "AudioPlugin", "mupen64plus-audio-sdl" OSAL_DLL_EXTENSION, "Filename of audio plugin"); + (*ConfigSetDefaultString)(l_ConfigUI, "InputPlugin", "mupen64plus-input-sdl" OSAL_DLL_EXTENSION, "Filename of input plugin"); + (*ConfigSetDefaultString)(l_ConfigUI, "RspPlugin", "mupen64plus-rsp-hle" OSAL_DLL_EXTENSION, "Filename of RSP plugin"); + + if (bSaveConfig && ConfigSaveSection != NULL) /* ConfigSaveSection was added in Config API v2.1.0 */ + (*ConfigSaveSection)("UI-Console"); + + return M64ERR_SUCCESS; +} + +static m64p_error SaveConfigurationOptions(void) +{ + /* if shared data directory was given on the command line, write it into the config file */ + if (l_DataDirPath != NULL) + (*ConfigSetParameter)(l_ConfigCore, "SharedDataPath", M64TYPE_STRING, l_DataDirPath); + + /* if any plugin filepaths were given on the command line, write them into the config file */ + if (g_PluginDir != NULL) + (*ConfigSetParameter)(l_ConfigUI, "PluginDir", M64TYPE_STRING, g_PluginDir); + if (g_GfxPlugin != NULL) + (*ConfigSetParameter)(l_ConfigUI, "VideoPlugin", M64TYPE_STRING, g_GfxPlugin); + if (g_AudioPlugin != NULL) + (*ConfigSetParameter)(l_ConfigUI, "AudioPlugin", M64TYPE_STRING, g_AudioPlugin); + if (g_InputPlugin != NULL) + (*ConfigSetParameter)(l_ConfigUI, "InputPlugin", M64TYPE_STRING, g_InputPlugin); + if (g_RspPlugin != NULL) + (*ConfigSetParameter)(l_ConfigUI, "RspPlugin", M64TYPE_STRING, g_RspPlugin); + + return (*ConfigSaveFile)(); +} + +/********************************************************************************************************* + * Command-line parsing + */ + +static void printUsage(const char *progname) +{ + printf("Usage: %s [parameters] [romfile]\n" + "\n" + "Parameters:\n" + " --noosd : disable onscreen display\n" + " --osd : enable onscreen display\n" + " --fullscreen : use fullscreen display mode\n" + " --windowed : use windowed display mode\n" + " --resolution (res) : display resolution (640x480, 800x600, 1024x768, etc)\n" + " --nospeedlimit : disable core speed limiter (should be used with dummy audio plugin)\n" + " --cheats (cheat-spec) : enable or list cheat codes for the given rom file\n" + " --corelib (filepath) : use core library (filepath) (can be only filename or full path)\n" + " --configdir (dir) : force configation directory to (dir); should contain mupen64plus.conf\n" + " --datadir (dir) : search for shared data files (.ini files, languages, etc) in (dir)\n" + " --plugindir (dir) : search for plugins in (dir)\n" + " --sshotdir (dir) : set screenshot directory to (dir)\n" + " --gfx (plugin-spec) : use gfx plugin given by (plugin-spec)\n" + " --audio (plugin-spec) : use audio plugin given by (plugin-spec)\n" + " --input (plugin-spec) : use input plugin given by (plugin-spec)\n" + " --rsp (plugin-spec) : use rsp plugin given by (plugin-spec)\n" + " --emumode (mode) : set emu mode to: 0=Pure Interpreter 1=Interpreter 2=DynaRec\n" + " --testshots (list) : take screenshots at frames given in comma-separated (list), then quit\n" + " --set (param-spec) : set a configuration variable, format: ParamSection[ParamName]=Value\n" + " --core-compare-send : use the Core Comparison debugging feature, in data sending mode\n" + " --core-compare-recv : use the Core Comparison debugging feature, in data receiving mode\n" + " --nosaveoptions : do not save the given command-line options in configuration file\n" + " --verbose : print lots of information\n" + " --help : see this help message\n\n" + "(plugin-spec):\n" + " (pluginname) : filename (without path) of plugin to find in plugin directory\n" + " (pluginpath) : full path and filename of plugin\n" + " 'dummy' : use dummy plugin\n\n" + "(cheat-spec):\n" + " 'list' : show all of the available cheat codes\n" + " 'all' : enable all of the available cheat codes\n" + " (codelist) : a comma-separated list of cheat code numbers to enable,\n" + " with dashes to use code variables (ex 1-2 to use cheat 1 option 2)\n" + "\n", progname); + + return; +} + +static int SetConfigParameter(const char *ParamSpec) +{ + char *ParsedString, *VarName, *VarValue=NULL; + m64p_handle ConfigSection; + m64p_type VarType; + m64p_error rval; + + if (ParamSpec == NULL) + { + DebugMessage(M64MSG_ERROR, "ParamSpec is NULL in SetConfigParameter()"); + return 1; + } + + /* make a copy of the input string */ + ParsedString = (char *) malloc(strlen(ParamSpec) + 1); + if (ParsedString == NULL) + { + DebugMessage(M64MSG_ERROR, "SetConfigParameter() couldn't allocate memory for temporary string."); + return 2; + } + strcpy(ParsedString, ParamSpec); + + /* parse it for the simple section[name]=value format */ + VarName = strchr(ParsedString, '['); + if (VarName != NULL) + { + *VarName++ = 0; + VarValue = strchr(VarName, ']'); + if (VarValue != NULL) + { + *VarValue++ = 0; + } + } + if (VarName == NULL || VarValue == NULL || *VarValue != '=') + { + DebugMessage(M64MSG_ERROR, "invalid (param-spec) '%s'", ParamSpec); + free(ParsedString); + return 3; + } + VarValue++; + + /* then set the value */ + rval = (*ConfigOpenSection)(ParsedString, &ConfigSection); + if (rval != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_ERROR, "SetConfigParameter failed to open config section '%s'", ParsedString); + free(ParsedString); + return 4; + } + if ((*ConfigGetParameterType)(ConfigSection, VarName, &VarType) == M64ERR_SUCCESS) + { + switch(VarType) + { + int ValueInt; + float ValueFloat; + case M64TYPE_INT: + ValueInt = atoi(VarValue); + ConfigSetParameter(ConfigSection, VarName, M64TYPE_INT, &ValueInt); + break; + case M64TYPE_FLOAT: + ValueFloat = (float) atof(VarValue); + ConfigSetParameter(ConfigSection, VarName, M64TYPE_FLOAT, &ValueFloat); + break; + case M64TYPE_BOOL: + ValueInt = (int) (osal_insensitive_strcmp(VarValue, "true") == 0); + ConfigSetParameter(ConfigSection, VarName, M64TYPE_BOOL, &ValueInt); + break; + case M64TYPE_STRING: + ConfigSetParameter(ConfigSection, VarName, M64TYPE_STRING, VarValue); + break; + default: + DebugMessage(M64MSG_ERROR, "invalid VarType in SetConfigParameter()"); + return 5; + } + } + else + { + ConfigSetParameter(ConfigSection, VarName, M64TYPE_STRING, VarValue); + } + + free(ParsedString); + return 0; +} + +static int *ParseNumberList(const char *InputString, int *ValuesFound) +{ + const char *str; + int *OutputList; + + /* count the number of integers in the list */ + int values = 1; + str = InputString; + while ((str = strchr(str, ',')) != NULL) + { + str++; + values++; + } + + /* create a list and populate it with the frame counter values at which to take screenshots */ + if ((OutputList = (int *) malloc(sizeof(int) * (values + 1))) != NULL) + { + int idx = 0; + str = InputString; + while (str != NULL) + { + OutputList[idx++] = atoi(str); + str = strchr(str, ','); + if (str != NULL) str++; + } + OutputList[idx] = 0; + } + + if (ValuesFound != NULL) + *ValuesFound = values; + return OutputList; +} + +static int ParseCommandLineInitial(int argc, const char **argv) +{ + int i; + + /* look through commandline options */ + for (i = 1; i < argc; i++) + { + int ArgsLeft = argc - i - 1; + + if (strcmp(argv[i], "--corelib") == 0 && ArgsLeft >= 1) + { + l_CoreLibPath = argv[i+1]; + i++; + } + else if (strcmp(argv[i], "--configdir") == 0 && ArgsLeft >= 1) + { + l_ConfigDirPath = argv[i+1]; + i++; + } + else if (strcmp(argv[i], "--datadir") == 0 && ArgsLeft >= 1) + { + l_DataDirPath = argv[i+1]; + i++; + } + else if (strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-h") == 0) + { + printUsage(argv[0]); + return 1; + } + } + + return 0; +} + +static m64p_error ParseCommandLineFinal(int argc, const char **argv) +{ + int i; + + /* parse commandline options */ + for (i = 1; i < argc; i++) + { + int ArgsLeft = argc - i - 1; + if (strcmp(argv[i], "--noosd") == 0) + { + int Osd = 0; + (*ConfigSetParameter)(l_ConfigCore, "OnScreenDisplay", M64TYPE_BOOL, &Osd); + } + else if (strcmp(argv[i], "--osd") == 0) + { + int Osd = 1; + (*ConfigSetParameter)(l_ConfigCore, "OnScreenDisplay", M64TYPE_BOOL, &Osd); + } + else if (strcmp(argv[i], "--fullscreen") == 0) + { + int Fullscreen = 1; + (*ConfigSetParameter)(l_ConfigVideo, "Fullscreen", M64TYPE_BOOL, &Fullscreen); + } + else if (strcmp(argv[i], "--windowed") == 0) + { + int Fullscreen = 0; + (*ConfigSetParameter)(l_ConfigVideo, "Fullscreen", M64TYPE_BOOL, &Fullscreen); + } + else if (strcmp(argv[i], "--nospeedlimit") == 0) + { + int EnableSpeedLimit = 0; + if (g_CoreAPIVersion < 0x020001) + DebugMessage(M64MSG_WARNING, "core library doesn't support --nospeedlimit"); + else + { + if ((*CoreDoCommand)(M64CMD_CORE_STATE_SET, M64CORE_SPEED_LIMITER, &EnableSpeedLimit) != M64ERR_SUCCESS) + DebugMessage(M64MSG_ERROR, "core gave error while setting --nospeedlimit option"); + } + } + else if ((strcmp(argv[i], "--corelib") == 0 || strcmp(argv[i], "--configdir") == 0 || + strcmp(argv[i], "--datadir") == 0) && ArgsLeft >= 1) + { /* these are handled in ParseCommandLineInitial */ + i++; + } + else if (strcmp(argv[i], "--resolution") == 0 && ArgsLeft >= 1) + { + const char *res = argv[i+1]; + int xres, yres; + i++; + if (sscanf(res, "%ix%i", &xres, &yres) != 2) + DebugMessage(M64MSG_WARNING, "couldn't parse resolution '%s'", res); + else + { + (*ConfigSetParameter)(l_ConfigVideo, "ScreenWidth", M64TYPE_INT, &xres); + (*ConfigSetParameter)(l_ConfigVideo, "ScreenHeight", M64TYPE_INT, &yres); + } + } + else if (strcmp(argv[i], "--cheats") == 0 && ArgsLeft >= 1) + { + if (strcmp(argv[i+1], "all") == 0) + l_CheatMode = CHEAT_ALL; + else if (strcmp(argv[i+1], "list") == 0) + l_CheatMode = CHEAT_SHOW_LIST; + else + { + l_CheatMode = CHEAT_LIST; + l_CheatNumList = (char*) argv[i+1]; + } + i++; + } + else if (strcmp(argv[i], "--plugindir") == 0 && ArgsLeft >= 1) + { + g_PluginDir = argv[i+1]; + i++; + } + else if (strcmp(argv[i], "--sshotdir") == 0 && ArgsLeft >= 1) + { + (*ConfigSetParameter)(l_ConfigCore, "ScreenshotPath", M64TYPE_STRING, argv[i+1]); + i++; + } + else if (strcmp(argv[i], "--gfx") == 0 && ArgsLeft >= 1) + { + g_GfxPlugin = argv[i+1]; + i++; + } + else if (strcmp(argv[i], "--audio") == 0 && ArgsLeft >= 1) + { + g_AudioPlugin = argv[i+1]; + i++; + } + else if (strcmp(argv[i], "--input") == 0 && ArgsLeft >= 1) + { + g_InputPlugin = argv[i+1]; + i++; + } + else if (strcmp(argv[i], "--rsp") == 0 && ArgsLeft >= 1) + { + g_RspPlugin = argv[i+1]; + i++; + } + else if (strcmp(argv[i], "--emumode") == 0 && ArgsLeft >= 1) + { + int emumode = atoi(argv[i+1]); + i++; + if (emumode < 0 || emumode > 2) + { + DebugMessage(M64MSG_WARNING, "invalid --emumode value '%i'", emumode); + continue; + } + if (emumode == 2 && !(g_CoreCapabilities & M64CAPS_DYNAREC)) + { + DebugMessage(M64MSG_WARNING, "Emulator core doesn't support Dynamic Recompiler."); + emumode = 1; + } + (*ConfigSetParameter)(l_ConfigCore, "R4300Emulator", M64TYPE_INT, &emumode); + } + else if (strcmp(argv[i], "--testshots") == 0 && ArgsLeft >= 1) + { + l_TestShotList = ParseNumberList(argv[i+1], NULL); + i++; + } + else if (strcmp(argv[i], "--set") == 0 && ArgsLeft >= 1) + { + if (SetConfigParameter(argv[i+1]) != 0) + return M64ERR_INPUT_INVALID; + i++; + } + else if (strcmp(argv[i], "--core-compare-send") == 0) + { + l_CoreCompareMode = 1; + } + else if (strcmp(argv[i], "--core-compare-recv") == 0) + { + l_CoreCompareMode = 2; + } + else if (strcmp(argv[i], "--nosaveoptions") == 0) + { + l_SaveOptions = 0; + } + else if (ArgsLeft == 0) + { + /* this is the last arg, it should be a ROM filename */ + l_ROMFilepath = argv[i]; + return M64ERR_SUCCESS; + } + else if (strcmp(argv[i], "--verbose") == 0) + { + g_Verbose = 1; + } + else + { + DebugMessage(M64MSG_WARNING, "unrecognized command-line parameter '%s'", argv[i]); + } + /* continue argv loop */ + } + + /* missing ROM filepath */ + DebugMessage(M64MSG_ERROR, "no ROM filepath given"); + return M64ERR_INPUT_INVALID; +} + +/********************************************************************************************************* +* main function +*/ +int main(int argc, char *argv[]) +{ + int i; + + printf(" __ __ __ _ _ ____ _ \n"); + printf("| \\/ |_ _ _ __ ___ _ __ / /_ | || | | _ \\| |_ _ ___ \n"); + printf("| |\\/| | | | | '_ \\ / _ \\ '_ \\| '_ \\| || |_| |_) | | | | / __| \n"); + printf("| | | | |_| | |_) | __/ | | | (_) |__ _| __/| | |_| \\__ \\ \n"); + printf("|_| |_|\\__,_| .__/ \\___|_| |_|\\___/ |_| |_| |_|\\__,_|___/ \n"); + printf(" |_| http://code.google.com/p/mupen64plus/ \n"); + printf("%s Version %i.%i.%i\n\n", CONSOLE_UI_NAME, VERSION_PRINTF_SPLIT(CONSOLE_UI_VERSION)); + + /* bootstrap some special parameters from the command line */ + if (ParseCommandLineInitial(argc, (const char **) argv) != 0) + return 1; + + /* load the Mupen64Plus core library */ + if (AttachCoreLib(l_CoreLibPath) != M64ERR_SUCCESS) + return 2; + + /* start the Mupen64Plus core library, load the configuration file */ + m64p_error rval = (*CoreStartup)(CORE_API_VERSION, l_ConfigDirPath, l_DataDirPath, "Core", DebugCallback, NULL, NULL); + if (rval != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_ERROR, "couldn't start Mupen64Plus core library."); + DetachCoreLib(); + return 3; + } + + /* Open configuration sections */ + rval = OpenConfigurationHandles(); + if (rval != M64ERR_SUCCESS) + { + (*CoreShutdown)(); + DetachCoreLib(); + return 4; + } + + /* parse command-line options */ + rval = ParseCommandLineFinal(argc, (const char **) argv); + if (rval != M64ERR_SUCCESS) + { + (*CoreShutdown)(); + DetachCoreLib(); + return 5; + } + + /* Handle the core comparison feature */ + if (l_CoreCompareMode != 0 && !(g_CoreCapabilities & M64CAPS_CORE_COMPARE)) + { + DebugMessage(M64MSG_ERROR, "can't use --core-compare feature with this Mupen64Plus core library."); + DetachCoreLib(); + return 6; + } + compare_core_init(l_CoreCompareMode); + + /* save the given command-line options in configuration file if requested */ + if (l_SaveOptions) + SaveConfigurationOptions(); + + /* load ROM image */ + FILE *fPtr = fopen(l_ROMFilepath, "rb"); + if (fPtr == NULL) + { + DebugMessage(M64MSG_ERROR, "couldn't open ROM file '%s' for reading.", l_ROMFilepath); + (*CoreShutdown)(); + DetachCoreLib(); + return 7; + } + + /* get the length of the ROM, allocate memory buffer, load it from disk */ + long romlength = 0; + fseek(fPtr, 0L, SEEK_END); + romlength = ftell(fPtr); + fseek(fPtr, 0L, SEEK_SET); + unsigned char *ROM_buffer = (unsigned char *) malloc(romlength); + if (ROM_buffer == NULL) + { + DebugMessage(M64MSG_ERROR, "couldn't allocate %li-byte buffer for ROM image file '%s'.", romlength, l_ROMFilepath); + fclose(fPtr); + (*CoreShutdown)(); + DetachCoreLib(); + return 8; + } + else if (fread(ROM_buffer, 1, romlength, fPtr) != romlength) + { + DebugMessage(M64MSG_ERROR, "couldn't read %li bytes from ROM image file '%s'.", romlength, l_ROMFilepath); + free(ROM_buffer); + fclose(fPtr); + (*CoreShutdown)(); + DetachCoreLib(); + return 9; + } + fclose(fPtr); + + /* Try to load the ROM image into the core */ + if ((*CoreDoCommand)(M64CMD_ROM_OPEN, (int) romlength, ROM_buffer) != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_ERROR, "core failed to open ROM image file '%s'.", l_ROMFilepath); + free(ROM_buffer); + (*CoreShutdown)(); + DetachCoreLib(); + return 10; + } + free(ROM_buffer); /* the core copies the ROM image, so we can release this buffer immediately */ + + /* handle the cheat codes */ + CheatStart(l_CheatMode, l_CheatNumList); + if (l_CheatMode == CHEAT_SHOW_LIST) + { + (*CoreDoCommand)(M64CMD_ROM_CLOSE, 0, NULL); + (*CoreShutdown)(); + DetachCoreLib(); + return 11; + } + + /* search for and load plugins */ + rval = PluginSearchLoad(l_ConfigUI); + if (rval != M64ERR_SUCCESS) + { + (*CoreDoCommand)(M64CMD_ROM_CLOSE, 0, NULL); + (*CoreShutdown)(); + DetachCoreLib(); + return 12; + } + + /* attach plugins to core */ + for (i = 0; i < 4; i++) + { + if ((*CoreAttachPlugin)(g_PluginMap[i].type, g_PluginMap[i].handle) != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_ERROR, "core error while attaching %s plugin.", g_PluginMap[i].name); + (*CoreDoCommand)(M64CMD_ROM_CLOSE, 0, NULL); + (*CoreShutdown)(); + DetachCoreLib(); + return 13; + } + } + + /* set up Frame Callback if --testshots is enabled */ + if (l_TestShotList != NULL) + { + if ((*CoreDoCommand)(M64CMD_SET_FRAME_CALLBACK, 0, FrameCallback) != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_WARNING, "couldn't set frame callback, so --testshots won't work."); + } + } + + /* run the game */ + (*CoreDoCommand)(M64CMD_EXECUTE, 0, NULL); + + /* detach plugins from core and unload them */ + for (i = 0; i < 4; i++) + (*CoreDetachPlugin)(g_PluginMap[i].type); + PluginUnload(); + + /* close the ROM image */ + (*CoreDoCommand)(M64CMD_ROM_CLOSE, 0, NULL); + + /* save the configuration file again if --nosaveoptions was not specified, to keep any updated parameters from the core/plugins */ + if (l_SaveOptions) + SaveConfigurationOptions(); + + /* Shut down and release the Core library */ + (*CoreShutdown)(); + DetachCoreLib(); + + /* free allocated memory */ + if (l_TestShotList != NULL) + free(l_TestShotList); + + return 0; +} + diff --git a/libmupen64plus/mupen64plus-ui-console/src/main.h b/libmupen64plus/mupen64plus-ui-console/src/main.h new file mode 100644 index 0000000000..5ab3752640 --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/src/main.h @@ -0,0 +1,31 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - main.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard42 * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __MAIN_H__ +#define __MAIN_H__ + +extern void DebugMessage(int level, const char *message, ...); +extern void DebugCallback(void *Context, int level, const char *message); + +extern int g_Verbose; + +#endif /* __MAIN_H__ */ + diff --git a/libmupen64plus/mupen64plus-ui-console/src/osal_dynamiclib.h b/libmupen64plus/mupen64plus-ui-console/src/osal_dynamiclib.h new file mode 100644 index 0000000000..15b45d3aa6 --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/src/osal_dynamiclib.h @@ -0,0 +1,34 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-ui-console - osal_dynamiclib.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#if !defined(OSAL_DYNAMICLIB_H) +#define OSAL_DYNAMICLIB_H + +#include "m64p_types.h" + +m64p_error osal_dynlib_open(m64p_dynlib_handle *pLibHandle, const char *pccLibraryPath); + +void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName); + +m64p_error osal_dynlib_close(m64p_dynlib_handle LibHandle); + +#endif /* #define OSAL_DYNAMICLIB_H */ + diff --git a/libmupen64plus/mupen64plus-ui-console/src/osal_dynamiclib_unix.c b/libmupen64plus/mupen64plus-ui-console/src/osal_dynamiclib_unix.c new file mode 100644 index 0000000000..870db48cc8 --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/src/osal_dynamiclib_unix.c @@ -0,0 +1,71 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-ui-console - osal_dynamiclib_unix.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include +#include + +#include "main.h" +#include "m64p_types.h" +#include "osal_dynamiclib.h" + +m64p_error osal_dynlib_open(m64p_dynlib_handle *pLibHandle, const char *pccLibraryPath) +{ + if (pLibHandle == NULL || pccLibraryPath == NULL) + return M64ERR_INPUT_ASSERT; + + *pLibHandle = dlopen(pccLibraryPath, RTLD_NOW); + + if (*pLibHandle == NULL) + { + /* only print an error message if there is a directory separator (/) in the pathname */ + /* this prevents us from throwing an error for the use case where Mupen64Plus is not installed */ + if (strchr(pccLibraryPath, '/') != NULL) + DebugMessage(M64MSG_ERROR, "dlopen('%s') failed: %s", pccLibraryPath, dlerror()); + return M64ERR_INPUT_NOT_FOUND; + } + + return M64ERR_SUCCESS; +} + +void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName) +{ + if (pccProcedureName == NULL) + return NULL; + + return dlsym(LibHandle, pccProcedureName); +} + +m64p_error osal_dynlib_close(m64p_dynlib_handle LibHandle) +{ + int rval = dlclose(LibHandle); + + if (rval != 0) + { + DebugMessage(M64MSG_ERROR, "dlclose() failed: %s", dlerror()); + return M64ERR_INTERNAL; + } + + return M64ERR_SUCCESS; +} + + diff --git a/libmupen64plus/mupen64plus-ui-console/src/osal_dynamiclib_win32.c b/libmupen64plus/mupen64plus-ui-console/src/osal_dynamiclib_win32.c new file mode 100644 index 0000000000..052fd79c75 --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/src/osal_dynamiclib_win32.c @@ -0,0 +1,75 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-ui-console - osal_dynamiclib_win32.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include + +#include "main.h" +#include "m64p_types.h" +#include "osal_dynamiclib.h" + +m64p_error osal_dynlib_open(m64p_dynlib_handle *pLibHandle, const char *pccLibraryPath) +{ + if (pLibHandle == NULL || pccLibraryPath == NULL) + return M64ERR_INPUT_ASSERT; + + *pLibHandle = LoadLibrary(pccLibraryPath); + + if (*pLibHandle == NULL) + { + char *pchErrMsg; + DWORD dwErr = GetLastError(); + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pchErrMsg, 0, NULL); + DebugMessage(M64MSG_ERROR, "LoadLibrary('%s') error: %s", pccLibraryPath, pchErrMsg); + LocalFree(pchErrMsg); + return M64ERR_INPUT_NOT_FOUND; + } + + return M64ERR_SUCCESS; +} + +void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName) +{ + if (pccProcedureName == NULL) + return NULL; + + return GetProcAddress(LibHandle, pccProcedureName); +} + +m64p_error osal_dynlib_close(m64p_dynlib_handle LibHandle) +{ + int rval = FreeLibrary(LibHandle); + + if (rval == 0) + { + char *pchErrMsg; + DWORD dwErr = GetLastError(); + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pchErrMsg, 0, NULL); + DebugMessage(M64MSG_ERROR, "FreeLibrary() error: %s", pchErrMsg); + LocalFree(pchErrMsg); + return M64ERR_INTERNAL; + } + + return M64ERR_SUCCESS; +} diff --git a/libmupen64plus/mupen64plus-ui-console/src/osal_files.h b/libmupen64plus/mupen64plus-ui-console/src/osal_files.h new file mode 100644 index 0000000000..31ef4a6a9d --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/src/osal_files.h @@ -0,0 +1,49 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-ui-console - osal_files.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This header file is for all kinds of system-dependent file handling + * + */ + +#if !defined(OSAL_FILES_H) +#define OSAL_FILES_H + +#include "m64p_types.h" +#include "osal_preproc.h" + +/* data structure for linked list of shared libraries found in a directory */ +typedef struct _osal_lib_search { + char filepath[PATH_MAX]; + char *filename; + m64p_plugin_type plugin_type; + struct _osal_lib_search *next; + } osal_lib_search; + +/* const definitions for system directories to search when looking for mupen64plus plugins */ +extern const int osal_libsearchdirs; +extern const char *osal_libsearchpath[]; + +/* functions for searching for shared libraries in a given directory */ +extern osal_lib_search *osal_library_search(const char *searchpath); +extern void osal_free_lib_list(osal_lib_search *head); + +#endif /* #define OSAL_FILES_H */ + diff --git a/libmupen64plus/mupen64plus-ui-console/src/osal_files_unix.c b/libmupen64plus/mupen64plus-ui-console/src/osal_files_unix.c new file mode 100644 index 0000000000..2199271d45 --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/src/osal_files_unix.c @@ -0,0 +1,113 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-ui-console - osal_files_unix.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This implements all kinds of system-dependent file handling + * + */ + +#include +#include +#include +#include +#include // for opendir(), readdir(), closedir() + +#include "main.h" +#include "m64p_types.h" +#include "osal_preproc.h" +#include "osal_files.h" + +/* definitions for system directories to search when looking for mupen64plus plugins */ +#if defined(PLUGINDIR) + const int osal_libsearchdirs = 4; + const char *osal_libsearchpath[4] = { PLUGINDIR, "/usr/local/lib/mupen64plus", "/usr/lib/mupen64plus", "./" }; +#else + const int osal_libsearchdirs = 3; + const char *osal_libsearchpath[3] = { "/usr/local/lib/mupen64plus", "/usr/lib/mupen64plus", "./" }; +#endif + +osal_lib_search *osal_library_search(const char *searchpath) +{ + osal_lib_search *head = NULL, *curr = NULL; + DIR *dir; + struct dirent *entry; + +#ifdef __APPLE__ + const char* suffix = ".dylib"; +#else + const char* suffix = ".so"; +#endif + + dir = opendir(searchpath); + if (dir == NULL) + return NULL; + + /* look for any shared libraries in this folder */ + while ((entry = readdir(dir)) != NULL) + { + osal_lib_search *newlib = NULL; + if (strcmp(entry->d_name + strlen(entry->d_name) - strlen(suffix), suffix) != 0) + continue; + /* this is a .so file, so add it to the list */ + newlib = malloc(sizeof(osal_lib_search)); + if (newlib == NULL) + { + DebugMessage(M64MSG_ERROR, "Memory allocation error in osal_library_search()!"); + osal_free_lib_list(head); + closedir(dir); + return NULL; + } + if (head == NULL) + { + head = curr = newlib; + } + else + { + curr->next = newlib; + curr = newlib; + } + /* set up the filepath and filename members */ + strncpy(curr->filepath, searchpath, PATH_MAX-2); + curr->filepath[PATH_MAX-2] = 0; + if (curr->filepath[strlen(curr->filepath)-1] != '/') + strcat(curr->filepath, "/"); + int pathlen = strlen(curr->filepath); + curr->filename = curr->filepath + pathlen; + strncat(curr->filepath, entry->d_name, PATH_MAX - pathlen - 1); + curr->filepath[PATH_MAX-1] = 0; + /* set plugin_type and next pointer */ + curr->plugin_type = 0; + curr->next = NULL; + } + + closedir(dir); + return head; +} + +void osal_free_lib_list(osal_lib_search *head) +{ + while (head != NULL) + { + osal_lib_search *next = head->next; + free(head); + head = next; + } +} + diff --git a/libmupen64plus/mupen64plus-ui-console/src/osal_files_win32.c b/libmupen64plus/mupen64plus-ui-console/src/osal_files_win32.c new file mode 100644 index 0000000000..0cd3f2c328 --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/src/osal_files_win32.c @@ -0,0 +1,106 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-ui-console - osal_files_win32.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This implements all kinds of system-dependent file handling + * + */ + +#include +#include +#include +#include + +#include "main.h" +#include "m64p_types.h" +#include "osal_preproc.h" +#include "osal_files.h" + +/* definitions for system directories to search when looking for mupen64plus plugins */ +const int osal_libsearchdirs = 1; +const char *osal_libsearchpath[1] = { ".\\" }; + +osal_lib_search *osal_library_search(const char *searchpath) +{ + osal_lib_search *head = NULL, *curr = NULL; + WIN32_FIND_DATA entry; + HANDLE hDir; + + char *pchSearchPath = (char *) malloc(strlen(searchpath) + 16); + if (pchSearchPath == NULL) + { + DebugMessage(M64MSG_ERROR, "Couldn't allocate memory for file search path in osal_library_search()!"); + return NULL; + } + sprintf(pchSearchPath, "%s\\*.dll", searchpath); + hDir = FindFirstFile(pchSearchPath, &entry); + free(pchSearchPath); + if (hDir == INVALID_HANDLE_VALUE) + return NULL; + + /* look for any shared libraries in this folder */ + do + { + osal_lib_search *newlib = NULL; + /* this is a .dll file, so add it to the list */ + newlib = (osal_lib_search *) malloc(sizeof(osal_lib_search)); + if (newlib == NULL) + { + DebugMessage(M64MSG_ERROR, "Memory allocation error in osal_library_search()!"); + osal_free_lib_list(head); + FindClose(hDir); + return NULL; + } + if (head == NULL) + { + head = curr = newlib; + } + else + { + curr->next = newlib; + curr = newlib; + } + /* set up the filepath and filename members */ + strncpy(curr->filepath, searchpath, PATH_MAX-2); + curr->filepath[PATH_MAX-2] = 0; + if (curr->filepath[strlen(curr->filepath)-1] != '\\') + strcat(curr->filepath, "\\"); + int pathlen = (int) strlen(curr->filepath); + curr->filename = curr->filepath + pathlen; + strncat(curr->filepath, entry.cFileName, PATH_MAX - pathlen - 1); + curr->filepath[PATH_MAX-1] = 0; + /* set plugin_type and next pointer */ + curr->plugin_type = (m64p_plugin_type) 0; + curr->next = NULL; + } while (FindNextFile(hDir, &entry)); + + FindClose(hDir); + return head; +} + +void osal_free_lib_list(osal_lib_search *head) +{ + while (head != NULL) + { + osal_lib_search *next = head->next; + free(head); + head = next; + } +} diff --git a/libmupen64plus/mupen64plus-ui-console/src/osal_preproc.h b/libmupen64plus/mupen64plus-ui-console/src/osal_preproc.h new file mode 100644 index 0000000000..8503ff6982 --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/src/osal_preproc.h @@ -0,0 +1,65 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-ui-console - osal_preproc.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This header file is for OS-specific #includes and #defines + * + */ + +#if !defined(OSAL_PREPROC_H) +#define OSAL_PREPROC_H + +#if defined(WIN32) + + #include + #define PATH_MAX 2048 + #define OSAL_DEFAULT_DYNLIB_FILENAME "mupen64plus.dll" + #define OSAL_DIR_SEPARATOR '\\' + #define OSAL_CURRENT_DIR ".\\" + #define OSAL_DLL_EXTENSION ".dll" + #define osal_insensitive_strcmp(x, y) _stricmp(x, y) + +#elif defined(__APPLE__) + + #include // for PATH_MAX + #define OSAL_DEFAULT_DYNLIB_FILENAME "libmupen64plus.dylib" + #define OSAL_DIR_SEPARATOR '/' + #define OSAL_CURRENT_DIR "./" + #define OSAL_DLL_EXTENSION ".dylib" + #define osal_insensitive_strcmp(x, y) strcasecmp(x, y) + +#else /* Linux-like UNIX */ + + #include // for PATH_MAX + #define OSAL_DEFAULT_DYNLIB_FILENAME "libmupen64plus.so.2" + #define OSAL_DIR_SEPARATOR '/' + #define OSAL_CURRENT_DIR "./" + #define OSAL_DLL_EXTENSION ".so" + #define osal_insensitive_strcmp(x, y) strcasecmp(x, y) + + /* PATH_MAX only may be defined by limits.h */ + #ifndef PATH_MAX + #define PATH_MAX 4096 + #endif + +#endif + +#endif /* #define OSAL_PREPROC_H */ + diff --git a/libmupen64plus/mupen64plus-ui-console/src/plugin.c b/libmupen64plus/mupen64plus-ui-console/src/plugin.c new file mode 100644 index 0000000000..a8edb7877c --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/src/plugin.c @@ -0,0 +1,261 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-ui-console - plugin.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard42 * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include + +#include "m64p_types.h" +#include "m64p_common.h" +#include "core_interface.h" +#include "osal_dynamiclib.h" +#include "osal_files.h" +#include "plugin.h" +#include "main.h" /* for the debug callback function */ +#include "version.h" + +/* global variables */ +const char *g_PluginDir = NULL; +const char *g_GfxPlugin = NULL; // pointer to graphics plugin specified at commandline (if any) +const char *g_AudioPlugin = NULL; // pointer to audio plugin specified at commandline (if any) +const char *g_InputPlugin = NULL; // pointer to input plugin specified at commandline (if any) +const char *g_RspPlugin = NULL; // pointer to rsp plugin specified at commandline (if any) + +plugin_map_node g_PluginMap[] = {{M64PLUGIN_GFX, "Video", NULL, "", NULL, 0 }, + {M64PLUGIN_AUDIO, "Audio", NULL, "", NULL, 0 }, + {M64PLUGIN_INPUT, "Input", NULL, "", NULL, 0 }, + {M64PLUGIN_RSP, "RSP", NULL, "", NULL, 0 } }; + +/* local functions */ +static m64p_error PluginLoadTry(const char *filepath, int MapIndex) +{ + /* try to open a shared library at the given filepath */ + m64p_dynlib_handle handle; + m64p_error rval = osal_dynlib_open(&handle, filepath); + if (rval != M64ERR_SUCCESS) + return rval; + + /* call the GetVersion function for the plugin and check compatibility */ + ptr_PluginGetVersion PluginGetVersion = (ptr_PluginGetVersion) osal_dynlib_getproc(handle, "PluginGetVersion"); + if (PluginGetVersion == NULL) + { + if (g_Verbose) + DebugMessage(M64MSG_ERROR, "library '%s' is not a Mupen64Plus library.", filepath); + osal_dynlib_close(handle); + return M64ERR_INCOMPATIBLE; + } + m64p_plugin_type PluginType = (m64p_plugin_type) 0; + int PluginVersion = 0; + const char *PluginName = NULL; + (*PluginGetVersion)(&PluginType, &PluginVersion, NULL, &PluginName, NULL); + if (PluginType != g_PluginMap[MapIndex].type) + { + /* the type of this plugin doesn't match with the type that was requested by the caller */ + osal_dynlib_close(handle); + return M64ERR_INCOMPATIBLE; + } + /* the front-end doesn't talk to the plugins, so we don't care about the plugin version or api version */ + + /* call the plugin's initialization function and make sure it starts okay */ + ptr_PluginStartup PluginStartup = (ptr_PluginStartup) osal_dynlib_getproc(handle, "PluginStartup"); + if (PluginStartup == NULL) + { + DebugMessage(M64MSG_ERROR, "library '%s' broken. No PluginStartup() function found.", filepath); + osal_dynlib_close(handle); + return M64ERR_INCOMPATIBLE; + } + rval = (*PluginStartup)(CoreHandle, g_PluginMap[MapIndex].name, DebugCallback); /* DebugCallback is in main.c */ + if (rval != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_ERROR, "Error: %s plugin library '%s' failed to start.", g_PluginMap[MapIndex].name, filepath); + osal_dynlib_close(handle); + return rval; + } + + /* plugin loaded successfully, so set the plugin map's members */ + g_PluginMap[MapIndex].handle = handle; + strcpy(g_PluginMap[MapIndex].filename, filepath); + g_PluginMap[MapIndex].libname = PluginName; + g_PluginMap[MapIndex].libversion = PluginVersion; + + return M64ERR_SUCCESS; +} + +/* global functions */ +m64p_error PluginSearchLoad(m64p_handle ConfigUI) +{ + osal_lib_search *lib_filelist = NULL; + int i; + + /* start by checking the directory given on the command line */ + if (g_PluginDir != NULL) + { + lib_filelist = osal_library_search(g_PluginDir); + if (lib_filelist == NULL) + { + DebugMessage(M64MSG_ERROR, "No plugins found in --plugindir path: %s", g_PluginDir); + return M64ERR_INPUT_NOT_FOUND; + } + } + + /* if no plugins found, search the PluginDir in the UI-console section of the config file */ + if (lib_filelist == NULL) + { + const char *plugindir = (*ConfigGetParamString)(ConfigUI, "PluginDir"); + lib_filelist = osal_library_search(plugindir); + } + + /* if still no plugins found, search some common system folders */ + if (lib_filelist == NULL) + { + for (i = 0; i < osal_libsearchdirs; i++) + { + lib_filelist = osal_library_search(osal_libsearchpath[i]); + if (lib_filelist != NULL) + break; + } + } + + /* try to load one of each type of plugin */ + for (i = 0; i < 4; i++) + { + m64p_plugin_type type = g_PluginMap[i].type; + const char *cmdline_path = NULL; + const char *config_var = NULL; + int use_dummy = 0; + switch (type) + { + case M64PLUGIN_RSP: cmdline_path = g_RspPlugin; config_var = "RspPlugin"; break; + case M64PLUGIN_GFX: cmdline_path = g_GfxPlugin; config_var = "VideoPlugin"; break; + case M64PLUGIN_AUDIO: cmdline_path = g_AudioPlugin; config_var = "AudioPlugin"; break; + case M64PLUGIN_INPUT: cmdline_path = g_InputPlugin; config_var = "InputPlugin"; break; + default: cmdline_path = NULL; config_var = ""; + } + /* first search for a plugin matching what was given on the command line */ + if (cmdline_path != NULL) + { + /* if full path was given, try loading exactly this file */ + if (strchr(cmdline_path, OSAL_DIR_SEPARATOR) != NULL) + { + PluginLoadTry(cmdline_path, i); + } + else if (strcmp(cmdline_path, "dummy") == 0) + { + use_dummy = 1; + } + else /* otherwise search through the plugin directory to find a match with this name */ + { + osal_lib_search *curr = lib_filelist; + while (curr != NULL && g_PluginMap[i].handle == NULL) + { + if (strncmp(curr->filename, cmdline_path, strlen(cmdline_path)) == 0) + PluginLoadTry(curr->filepath, i); + curr = curr->next; + } + } + /* exit with error if we couldn't find the specified plugin */ + if (!use_dummy && g_PluginMap[i].handle == NULL) + { + DebugMessage(M64MSG_ERROR, "Specified %s plugin not found: %s", g_PluginMap[i].name, cmdline_path); + osal_free_lib_list(lib_filelist); + return M64ERR_INPUT_NOT_FOUND; + } + } + else /* otherwise search for a plugin specified in the config file */ + { + const char *config_path = (*ConfigGetParamString)(ConfigUI, config_var); + if (config_path != NULL && strlen(config_path) > 0) + { + /* if full path was given, try loading exactly this file */ + if (strchr(config_path, OSAL_DIR_SEPARATOR) != NULL) + { + PluginLoadTry(config_path, i); + } + else if (strcmp(config_path, "dummy") == 0) + { + use_dummy = 1; + } + else /* otherwise search through the plugin directory to find a match with this name */ + { + osal_lib_search *curr = lib_filelist; + while (curr != NULL && g_PluginMap[i].handle == NULL) + { + if (strncmp(curr->filename, config_path, strlen(config_path)) == 0) + PluginLoadTry(curr->filepath, i); + curr = curr->next; + } + } + } + } + /* As a last resort, search for any appropriate plugin in search directory */ + if (!use_dummy && g_PluginMap[i].handle == NULL) + { + osal_lib_search *curr = lib_filelist; + while (curr != NULL && g_PluginMap[i].handle == NULL) + { + PluginLoadTry(curr->filepath, i); + curr = curr->next; + } + } + /* print out the particular plugin used */ + if (g_PluginMap[i].handle == NULL) + { + DebugMessage(M64MSG_INFO, "using %s plugin: ", g_PluginMap[i].name); + } + else + { + DebugMessage(M64MSG_INFO, "using %s plugin: '%s' v%i.%i.%i", g_PluginMap[i].name, + g_PluginMap[i].libname, VERSION_PRINTF_SPLIT(g_PluginMap[i].libversion)); + DebugMessage(M64MSG_VERBOSE, "%s plugin library: %s", g_PluginMap[i].name, g_PluginMap[i].filename); + } + } + + /* free up the list of library files in the plugin search directory */ + osal_free_lib_list(lib_filelist); + return M64ERR_SUCCESS; +} + +m64p_error PluginUnload(void) +{ + typedef m64p_error (*ptr_PluginShutdown)(void); + ptr_PluginShutdown PluginShutdown; + int i; + + /* shutdown each type of plugin */ + for (i = 0; i < 4; i++) + { + if (g_PluginMap[i].handle == NULL) + continue; + /* call the destructor function for the plugin and release the library */ + PluginShutdown = (ptr_PluginShutdown) osal_dynlib_getproc(g_PluginMap[i].handle, "PluginShutdown"); + if (PluginShutdown != NULL) + (*PluginShutdown)(); + osal_dynlib_close(g_PluginMap[i].handle); + /* clear out the plugin map's members */ + g_PluginMap[i].handle = NULL; + g_PluginMap[i].filename[0] = 0; + g_PluginMap[i].libname = NULL; + g_PluginMap[i].libversion = 0; + } + + return M64ERR_SUCCESS; +} + diff --git a/libmupen64plus/mupen64plus-ui-console/src/plugin.h b/libmupen64plus/mupen64plus-ui-console/src/plugin.h new file mode 100644 index 0000000000..3d9a1f381a --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/src/plugin.h @@ -0,0 +1,50 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-ui-console - plugin.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard42 * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#if !defined(PLUGIN_H) +#define PLUGIN_H + +#include "m64p_types.h" +#include "osal_preproc.h" + +extern m64p_error PluginSearchLoad(m64p_handle ConfigUI); +extern m64p_error PluginUnload(void); + +extern const char *g_PluginDir; // directory to search for plugins +extern const char *g_GfxPlugin; // graphics plugin specified at commandline (if any) +extern const char *g_AudioPlugin; // audio plugin specified at commandline (if any) +extern const char *g_InputPlugin; // input plugin specified at commandline (if any) +extern const char *g_RspPlugin; // rsp plugin specified at commandline (if any) + +typedef struct { + m64p_plugin_type type; + char name[8]; + m64p_dynlib_handle handle; + char filename[PATH_MAX]; + const char *libname; + int libversion; + } plugin_map_node; + +extern plugin_map_node g_PluginMap[4]; + +#endif /* #define PLUGIN_H */ + + diff --git a/libmupen64plus/mupen64plus-ui-console/src/version.h b/libmupen64plus/mupen64plus-ui-console/src/version.h new file mode 100644 index 0000000000..d26973d362 --- /dev/null +++ b/libmupen64plus/mupen64plus-ui-console/src/version.h @@ -0,0 +1,39 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-ui-console - version.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This header file is for versioning information + * + */ + +#if !defined(VERSION_H) +#define VERSION_H + +#define CONSOLE_UI_NAME "Mupen64Plus Console User-Interface" +#define CONSOLE_UI_VERSION 0x016305 +#define CORE_API_VERSION 0x20001 +#define CONFIG_API_VERSION 0x20000 + +#define MINIMUM_CORE_VERSION 0x016300 + +#define VERSION_PRINTF_SPLIT(x) (((x) >> 16) & 0xffff), (((x) >> 8) & 0xff), ((x) & 0xff) + +#endif /* #define VERSION_H */ + diff --git a/libmupen64plus/mupen64plus-video-rice/INSTALL b/libmupen64plus/mupen64plus-video-rice/INSTALL new file mode 100644 index 0000000000..e0bd5c3d8b --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/INSTALL @@ -0,0 +1,26 @@ +Mupen64Plus-Video-Rice INSTALL +------------------------------ + +This text file was written to explain the installation process of the +Mupen64Plus-Video-Rice module. + +If this module is part of a Mupen64Plus source code bundle, the user should run +the "m64p_install.sh" script in the root of the unzipped bundle to install all +of the included modules in the bundle. + +If this module is a standalone source code release, you should build the library +from source code and install it via the makefile, like this: + +$ cd projects/unix +$ make all +$ sudo make install + +If you want to build the Mupen64Plus-Video-Rice module for installation in a +home folder for a single user, you may build it like this (replacing + with your desired local installation path): + +$ cd projects/unix +$ make all +$ make install LIBDIR= SHAREDIR= + + diff --git a/libmupen64plus/mupen64plus-video-rice/LICENSES b/libmupen64plus/mupen64plus-video-rice/LICENSES new file mode 100644 index 0000000000..48d8a27f5d --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/LICENSES @@ -0,0 +1,365 @@ +Mupen64Plus-video-rice LICENSE +------------------------------ + +Mupen64Plus-video-rice is licensed under the GNU General Public License version 2. + +The authors of Mupen64Plus are: + * Richard Goedeken (Richard42) + * John Chadwick (NMN) + * James Hood (Ebenblues) + * Scott Gorman (okaygo) + * Scott Knauert (Tillin9) + * Jesse Dean (DarkJezter) + * Louai Al-Khanji (slougi) + * Bob Forder (orbitaldecay) + * Jason Espinosa (hasone) + * HyperHacker + * and others. + +Mupen64Plus-video-rice is based on the Rice Video plugin, which is GPL-licensed +and was originally written by: + * Rice1964 + * Mudlord + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, 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 + + + Appendix: 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. + + + Copyright (C) 19yy + + 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., 675 Mass Ave, Cambridge, MA 02139, 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) 19yy 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. + + , 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. + diff --git a/libmupen64plus/mupen64plus-video-rice/README b/libmupen64plus/mupen64plus-video-rice/README new file mode 100644 index 0000000000..1c504c00de --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/README @@ -0,0 +1,114 @@ +How to use high resolution textures in Rice Video 6.1.0 and after + +1. There are two new options added in Rice Video version 6.1.0 under the "Texture Filters" tab + LOAD option: "Loading hi-res textures if available" + DUMP option: "Dump textures to files" + + +2. Dumping textures + a. If DUMP option is enabled, all textures used during the game play will be dumpped + into a folder "[your_emulator_main_folder]\plugin\texture_dump\[current game name]\". + + [current game name] refers to N64 game internal name. + For example, name for Zelda OoT is "THE LEGEND OF ZELDA". + + You can use your N64 emulator to check it. For 1964, the internal name is shown + as one of the "Rom Information". + + b. Textures from different games will be dumpped into different folders. + The plugin will create the folder if the folder does not exist. + + c. Textures are dumpped in either PNG or BMP format + - RGBA, IA (intensity and alpha) textures are dumpped in 3 (or 2) files + [filename part 1 - 4]_all.png + [filename part 1 - 4]_rgb.png + [filename part 1 - 4]_a.png if the alpha channel is not all 0xFF + + Please read the later section regarding filenameing. + *_all.png files are 32bit per pixel PNG files with RGBA channels + *_rgb.png files are 24bit per pixel PNG files with RGB channels. + *_a.png files are 24bit per pixel PNG files with alpha channel only as intensity. + + - I (intensity only) textures are dumpped in 2 files, the alpha channel is not needed + [filename part 1 - 4]_rgb.png + [filename part 1 - 4]_all.png + + - Color indexed textures are dumpped in 1 file + [filename part 1 - 4]_ci.bmp + ATTENTION here: the color indexed bmp image is palletted image. If you want to modify + this image, you MUST NOT change the pallettes. + These palletted BMP files could have either 16 pallettes or 256 pallettes, depending + on the original texture format in the N64 game. + + d. texture dump option can be enabled/disabled during the game play. + + e. The plugin keeps tracking all dumpped textures of the current game. Textures + will not be redumpped if the texture has been dumpped. + + +3. Loading high resolution textures + a. If LOAD option is enabled, the plugin will try to load it when corresponding texture is used + in the game. + + b. LOAD option can be enabled/disabled during the game play + + c. All high resolution textures must be placed under folder: + "[your_emulator_main_folder]\plugin\hires_texture\[current game name]\" + + d. [current game name] must match the N64 game internal name + + e. Under the [current game name] folder, subfolders can be created and textures can be placed + into the subfolders. The plugin will search all the subfolders recursively. Subfolders can help + to manage all the textures. + + f. File files and format: + In general, high resolution files to be loaded must follow the same filenames as dumpped. + + - Color indexed textures must be still in palletted BMP format + - For RGBA, IA and I textures, you can provide + *_rgb.png, *_a.png or + *_rgb.bmp, *_a.bmp or + *_all.png + - Don't provide duplicate files for the same textures. If you provide the *_rgb, *_a files + and also *_all.png file, the actually loaded files are not determined. + +4. File naming + + Example: THE LEGEND OF ZELDA#0A74F78C#4#1_rgb.png + + [part 1]#[part 2]#[part 3]#[part 4]_[part 5].[extension] + + part 1: The N64 game internal name + part 2: CRC32 + part 3: Texture format in N64 game + 0 = RGBA + 1 = YUV + 2 = CI + 3 = IA + 4 = I + part 4: Texture size in N64 game + 0 = 4 bit + 1 = 8 bit + 2 = 16 bit + 3 = 32 bit + part 5: dumpped texture format + rgb = 24 bit RGB format + a = 24 bit alpha channel only in 24 bit RGB intensity + all = 32 bit RGB format + ci = color indexed (BMP) format + extension: + PNG + BMP + +5. How to make your own hi-rez textures + a. The hi-rez texture size could be 2, 3 or 4 times as the orginal N64 texture size + b. Don't use other customerized texture sizes + c. If the original texture has alpha channel, you MUST also provide the alpha channel by + - Use *_all.png 32bit format + - use both *_rgb and *_a files to provide RGB and alpha separately + d. Color indexed textures must be prepared in color indexed format, not in RGB/A format + e. Instead of *_rgb.png and *_a.png, you can provide your textures in *_rgb.bmp and *_a.bmp. + BMP files are uncompressed, can be loaded faster + f. *_rgb.png, *_a.png, *_rgb.bmp, *_a.bmp must be provided in 24 bit RGB format, not in other + formats. Alpha *_a.* files must be 24 bit, only in 2 bit or 8 bit + g. Filename must be kept the same as the original dumped texture filenames diff --git a/libmupen64plus/mupen64plus-video-rice/RELEASE b/libmupen64plus/mupen64plus-video-rice/RELEASE new file mode 100644 index 0000000000..8dd3de713e --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/RELEASE @@ -0,0 +1,70 @@ +Mupen64Plus-Video-Rice RELEASE +------------------------------ + +Mupen64Plus-Video-Rice v1.99.5 - March 10, 2012 +----------------------------------------------- + - Hires texture loading: support for 8-bit PNG images + - New config option for forcing vertical sync + - Check OpenGL attributes after creating video window and report any that failed to set + - Updated video plugin for new Mupen64plus 2.0 API versioning scheme + - Update to Video API version 2.1.0. + - Bugfix: hi-res textures: Scale highres textures by precalculated scaleShift exponent + - Bugfix: dont call CoreVideo_Init() inside of the InitializeGFX() function. This will fix some front-end use cases + - Bugfix: Fix z coordinate in 3d line rendering + - Bugfix: double infinite loop in GetValidTmemInfoIndex + - Bugfix: Perfect Dark randomly crashes due to divide-by-zero error + - Bugfix: crash in loading Celda 2009 hi-res texture pack for Zelda Ocarina of Time + - makefile fixes, improvements, and code cleanups + +Mupen64Plus-Video-Rice v1.99.4 - November 22, 2010 +-------------------------------------------------- + - new feature: anisotropic filtering + - new feature: trilinear filtering + - new feature: mipmaps + - cleaned up FindScaleFactor function based upon r45 of the 1964 repo + - bugfix: buffer overrun (and crash) when reading vendor string info on some opengl implementations + - API change for reading the video buffer: new interface is more flexible and avoids some potential problems + - support for anti-aliasing (GL_MULTISAMPLE) + - makefile fixes, improvements, and code cleanups + +Mupen64Plus-Video-Rice v1.99.3 - February 13, 2010 +-------------------------------------------------- + - sync with core<-->plugin API change for RomOpen() + - Changed default ScreenUpdateSetting to 1 for Linux, and 4 for Windows + - use custom opengl extension function pointer typedefs, to avoid compilation errors with some drivers including hosed gl.h headers + - merged some changes from Tillin9 commits in r1142-rice-video-gtk-refactor branch, to be more lenient in hi-res texture loading + - bugfix: hi-res textures did not work in Windows + - bugfix: #329: remove some deprecated types and a function call to prevent build errors with libpng 1.4 + - bugfix: fixed mirroring bugs in Rice Video hi-resolution texture loading, based on Tillin9 rev 1337 in r1142-rice-video-gtk-refactor branch + - bugfix: in ConvertImage.cpp none of the 4-bit conversion functions could handle 1-pixel wide textures + - Makefile improvements: + - added OS type GNU/kFreeBSD + +Mupen64Plus-Video-Rice v1.99.2 - January 6, 2010 +-------------------------------------------------- + - bugfix: fix fragment program combiner for Intel drivers in Win32, by ensuring that program does not allocate unused temp vars or call TEX commands for texture units that are not enabled + - new feature: compile-time option for opengl debugging by calling glGetError after each opengl command (except inside of glBegin/glEnd) + - portability: use ALIGN() for aligned data member declarations in header files as well as the definitions in CPP files + - portability: refactor opengl code to use VidExt_GL_GetProc() for all opengl functions newer than v1.1, so that this will work in Windows + - portability: Abstracted directory-handling code with new osal_files* source code + - portability: replaced unix gettimeofday() function calls with SDL_GetTicks() + - new feature: added MSVC8 project file, fixed minor incompatibilities with VC compiler + - Makefile improvements: + - throw error if OS/CPU not supported + - use DESTDIR in install/uninstall paths + - Allow user-specified CC/CXX/LD paths + - use C++ compiler to link instead of LD, because the compiler knows where the standard C++ libs are + - OSX hack for inline assembly code: mismatch between function names with-w/o preceding underscores + +Mupen64Plus-Video-Rice v1.99.1 - December 14, 2009 +-------------------------------------------------- + - Converted to new Mupen64Plus 2.0 API + - Major code cleanup, removed all non-standard data types + - Refactored build system to separate source and object files + - added NO_ASM build option + - removed some unused configuration parameters + - bugfix: handle fullscreen video mode properly: start up in this mode instead + of always starting in windowed and needing the core to switch to fullscreen + - bugfix #209: setjmp/longjmp fixes in the BMP writer and PNG reader + - bugfix: eliminated duplicate 'Found ROM ...' messages + diff --git a/libmupen64plus/mupen64plus-video-rice/data/RiceVideoLinux.ini b/libmupen64plus/mupen64plus-video-rice/data/RiceVideoLinux.ini new file mode 100644 index 0000000000..adc671fcbb --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/data/RiceVideoLinux.ini @@ -0,0 +1,1552 @@ +{e2f35d53f1899760-4a} +Name=Wave Race 64 SE +FastTextureCRC=2 +FrameBufferEmulation=4 + +{b09d00f82318296b-4a} +Name=CITY TOUR GP +IncTexRectEdge + +{542540b304c04073-45} +Name=Cruis'n USA + +{faf1b9fb8986f86b-45} +Name=LT DUCK DODGERS + +{231f2836cf569700-45} +Name=KEN GRIFFEY SLUGFEST + +{5b05a00a65df3776-50} +Name=DAFFY DUCK STARRING + +{ec939031ef09c20f-45} +Name=OFFROAD + +{378f8f658dd21318-44} +Name=RTL WLS2000 + +{a2eca9b98ee4aa17-45} +Name=Rush 2049 + +{54ddbcae4a83ff15-50} +Name=Taz Express + +{e07359beb8edb089-45} +Name=TOP GEAR RALLY 2 + +{aaccfabcefd814b8-45} +Name=BASSMASTERS2000 + +{696b64f4951075c5-4a} +Name=BattlePhoenix64 +FastLoadTile + +{cec4d4558ac75377-45} +Name=BATTLEZONE +ForceScreenClear=2 + +{45f48871680a4184-4a} +Name=DDR DISNEY D MUSEUM +FastLoadTile + +{181a33df44e0d45f-45} +Name=NASCAR 2000 +PrimaryDepthHack + +{437f1c551c834991-4a} +Name=TOUKON ROAD2 + +{4707dec0d372dfa2-4a} +Name=PUZZLEBOBBLE64 + +{421886079fbc2ea1-45} +Name=EXCITEBIKE64 +FastTextureCRC=1 +RenderToTexture=3 + +{9803f7728ba95665-45} +Name=STAR WARS EP1 RACER +ZHack + +{afe66a73c7e91741-4a} +Name=MICKEY USA +FastTextureCRC=1 +AlternativeTxtSizeMethod=1 +FrameBufferEmulation=3 +RenderToTexture=3 + +{955f5df3693dfe8a-45} +Name=CASTLEVANIA +FrameBufferEmulation=1 + +{9aaae9c2aa705d47-45} +Name=BANJO TOOIE + +{0693bfa4d1df0cbf-45} +Name=Banjo-Kazooie +FrameBufferEmulation=8 +RenderToTexture=4 +ScreenUpdateSetting=4 + +{ff2b5a632623028b-45} +Name=SUPER MARIO 64 +AlternativeTxtSizeMethod=1 + +{b655503e52da922e-45} +Name=Mario Kart 64 +FastTextureCRC=1 +FrameBufferEmulation=3 +RenderToTexture=3 + +{ec4ba2664fd9ad2e-45} +Name=Rogue Squadron +FrameBufferEmulation=2 + +{3863c01c26893887-45} +Name=CASTLEVANIA2 + +{5cb6f92ad7a2e285-45} +Name=MULTI RACING +ForceScreenClear=2 + +{9c33b2d5edcabcca-50} +Name=BUCK BUMBLE + +{9b98023de281a3d4-45} +Name=Battle for Naboo + +{15cc9daf883d721a-45} +Name=Indiana Jones + +{452fefaef1307ef9-45} +Name=FIGHTER DESTINY2 + +{c33022a6884483f0-45} +Name=Dual heroes USA + +{fc06d8d3a8a23ab4-50} +Name=MTM64 + +{71d10ea66ed0853d-45} +Name=SPIDERMAN + +{9deaf4dbc0823e33-45} +Name=SNOWBOARD KIDS + +{b71170ec2bd71676-45} +Name=THE LEGEND OF ZELDA +FrameBufferEmulation=3 +RenderToTexture=3 + +{b49f03462c823703-45} +Name=Kirby64 + +{0aff1ce6710d1cce-50} +Name=NEWTETRIS +IncTexRectEdge + +{1c9651c8faaafc78-45} +Name=Pilot Wings64 + +{3afc8a4ff22d91f7-50} +Name=South Park Rally + +{7ebc10dd51b300f9-50} +Name=V8: SECOND OFFENSE +FrameBufferEmulation=3 +RenderToTexture=3 + +{a819f4edcc0419bf-45} +Name=Beetle Adventure Rac +Texture1Hack + +{fc9ddf9889c10666-45} +Name=HARVESTMOON64 + +{73f0868a4be545cd-45} +Name=Bust A Move 2 +FastLoadTile +TexRectScaleHack + +{2ecf221e13c8aa42-45} +Name=BRUNSWICKBOWLING + +{21cbbcfc6b3c9072-45} +Name=Mystical Ninja +FastLoadTile +FrameBufferEmulation=1 + +{80205766e148e328-4a} +Name=SUPERROBOTSPIRITS + +{4f5aa9e623ead2ba-45} +Name=AIDYN_CHRONICLES + +{0b15d45cf1c20c47-45} +Name=Extreme G 2 +PrimaryDepthHack + +{0be1d56046eded8b-50} +Name=Rayman 2 +FastTextureCRC=1 + +{1c635453f0dea203-45} +Name=ZELDA MAJORA'S MASK +FrameBufferEmulation=3 +RenderToTexture=3 + +{67cf7503aa3fa956-4a} +Name=OgreBattle64 +FrameBufferEmulation=3 +RenderToTexture=3 + +{3ae5ee653c737ded-45} +Name=PAPER MARIO +FrameBufferEmulation=3 +RenderToTexture=3 +ScreenUpdateSetting=4 + +{7e260025cec37e2a-45} +Name=RIDGE RACER 64 + +{4fcf0150bdb30cf3-45} +Name=MarioTennis +AccurateTextureMapping=1 +FastTextureCRC=1 +AlternativeTxtSizeMethod=1 +FrameBufferEmulation=4 +RenderToTexture=4 + +{5c52381956966e58-45} +Name=MS. PAC-MAN MM + +{d0b4b8cd2d353288-45} +Name=JET FORCE GEMINI +FrameBufferEmulation=1 + +{db0e7e142cb1c536-4a} +Name=EVANGELION +AccurateTextureMapping=1 +FastTextureCRC=1 + +{cc60f4ddc034a63c-45} +Name=Perfect Dark + +{85e05e0c3edd67a1-45} +Name=ROCKETROBOTONWHEELS +FastTextureCRC=1 + +{8438e2bfafea48ef-45} +Name=Silicon Valley +AlternativeTxtSizeMethod=1 +RenderToTexture=3 + +{0c28d5b12abca74b-4a} +Name=SIM CITY 2000 + +{325e9b7280d928b7-45} +Name=GAUNTLET LEGENDS +FrameBufferEmulation=1 + +{0d4302e49dfcfcd2-45} +Name=Diddy Kong Racing + +{22c04e2085d119b1-45} +Name=TONY HAWK PRO SKATER + +{b2bb524c6b0fabce-45} +Name=ARMYMENAIRCOMBAT +IncTexRectEdge + +{b6ce09347a51c8ce-45} +Name=SMASH BROTHERS + +{50acc7302d070477-45} +Name=CONKER BFD +FrameBufferEmulation=3 +RenderToTexture=4 + +{a5b118aaeb6adb07-45} +Name=Resident Evil II +ForceScreenClear=1 + +{d150bcdca31afd09-45} +Name=GOLDENEYE +ZHack +FrameBufferEmulation=1 +ScreenUpdateSetting=4 + +{e8d83723ec7c8e6b-45} +Name=YOSHI STORY +FrameBufferEmulation=3 +RenderToTexture=3 + +{78d90eb3f9c90330-45} +Name=F-ZERO X + +{3603165ab0377bbc-50} +Name=BOMBERMAN64E + +{0390a59064980831-45} +Name=WRESTLEMANIA 2000 + +{6d208ebd1c5ec398-4a} +Name=DOUBUTSUNOMORI + +{96fa0e65a7f9dd30-50} +Name=WAVE RACE 64 +VIWidth=320 +VIHeight=240 + +{72e270fcaae7ff08-50} +Name=Silicon Valley + +{bbe8e07eaa11e449-50} +Name=Rogue Squadron + +{38a59bd089541a1c-50} +Name=Top Gear Overdrive + +{f4791f15e5c8ed8e-50} +Name=VIGILANTE 8 + +{7b5bf45be8ee6b59-50} +Name=WWF: Attitude + +{485f9493302e0f5c-50} +Name=SMASH BROTHERS + +{36f03ca0d2c5c1bc-50} +Name=SUPER MARIO 64 +FastTextureCRC=1 + +{8616b80c815ad85f-45} +Name=Madden NFL 2000 + +{a475a233594450b8-50} +Name=WWF War Zone +RenderToTexture=3 + +{a526899f09b48705-50} +Name=TONY HAWK SKATEBOARD + +{84ea4ed8b4f1b245-50} +Name=SHADOWGATE64 + +{bfe514d6c1bc6da7-50} +Name=TARZAN + +{4a831839290cb515-45} +Name=RAZOR FREESTYLE + +{4d675728da3743cc-45} +Name=NIGHTMARE CREATURES + +{9940307f7652cf52-4a} +Name=LASTLEGION UX + +{782706acb8fcaddf-50} +Name=WORLD DRIVER CHAMP +FullTMEM=1 + +{f336411da9ee63af-45} +Name=ZELDA MASTER QUEST + +{614b2f496a14e504-45} +Name=WAVE RACE 64 + +{b1cc3f73f9924844-50} +Name=Banjo-Kazooie + +{e74bc5a2b2cb1967-50} +Name=CASTLEVANIA2 +FastTextureCRC=1 + +{b609608a50e1ac94-45} +Name=JET FORCE GEMINI +AccurateTextureMapping=1 +FastTextureCRC=1 +RenderToTexture=3 + +{b3d9f590f0dc0e9d-45} +Name=POKEMON STADIUM +FrameBufferEmulation=3 +RenderToTexture=3 + +{a059e913b0ca930e-45} +Name=WORMS ARMAGEDDON + +{d7d81095d20d1035-45} +Name=Stunt Racer 64 +FullTMEM=1 + +{bfea58ec69717cad-45} +Name=DONKEY KONG 64 +EmulateClear=2 + +{40064b4efbbc491b-45} +Name=WWF No Mercy + +{d68cbe33126918ec-45} +Name=WCW MAYHEM + +{bd193e2c5eee1351-45} +Name=WCWvs.NWO:World Tour +FrameBufferEmulation=4 +ScreenUpdateSetting=4 + +{b960be713cfbdb1d-45} +Name=WCWvs.NWO:World Tour +FrameBufferEmulation=1 +ScreenUpdateSetting=4 + +{ab96e5dee77a3baf-45} +Name=WCW / nWo REVENGE +ScreenUpdateSetting=4 + +{253ffd588daa2ed9-50} +Name=1080 SNOWBOARDING + +{47cfa352fc3bc14e-50} +Name=NFL QBC '99 + +{497df9d35b132469-50} +Name=YOSHI STORY +FrameBufferEmulation=3 +RenderToTexture=3 + +{af29ab1928cd1bc7-50} +Name=PAPER MARIO + +{7d1d6172d2bd1999-58} +Name=HSV ADVENTURE RACING +Texture1Hack + +{ad84d7df036642ae-50} +Name=ALL STAR TENNIS '99 + +{b4fb88b01d4b1e44-50} +Name=BASS HUNTER 64 + +{d3dd3f71efa0d672-20} +Name=Bike Race by NaN +ForceScreenClear=2 + +{16d3794d331b50e8-45} +Name=BEAST WARS US + +{d0483cfb9ff6288d-50} +Name=CHARLIE BLAST'S + +{e89d2b491cc8ccc6-50} +Name=EARTHWORM JIM 3D + +{3421cfdc7835d69d-50} +Name=Centre Court Tennis +UseCIWidthAndRatio=1 + +{9531740f95dba6d8-50} +Name=DAIKATANA + +{b3c83ccca405c40e-50} +Name=F1 WORLD GRAND PRIX + +{9d127b27ff7938dd-50} +Name=Holy Magic Century + +{98da8b41580f8a24-50} +Name=MISCHIEF MAKERS + +{f10bfd20871dcff5-50} +Name=RAT ATTACK + +{7bc5212d8cc5e48f-50} +Name=WORMS N64 + +{9bbfc5f3e2330f16-45} +Name=Rayman 2 +FastTextureCRC=1 + +{118a08497e959464-45} +Name=Turok 2: Seeds of Ev +AccurateTextureMapping=1 + +{4e2d0ff0f4aa0f34-45} +Name=CARMAGEDDON64 +FastTextureCRC=1 + +{ababd40d1ea9a2b5-45} +Name=D K DISPLAY + +{32d9b51f1b48a93b-45} +Name=Armorines Project S. + +{b46e28958fd56ab7-45} +Name=Command&Conquer + +{9addd0dea72582e7-50} +Name=MICKEY USA PAL + +{75d474fcab78029a-45} +Name=PPG CHEMICAL X + +{b5707f1afdb9b700-45} +Name=THPS3 + +{6a0571ea474821e4-45} +Name=VIGILANTE 8 +FullTMEM=2 +RenderToTexture=3 + +{e7dda46ae7f4e2e3-45} +Name=BATTLETANX + +{47e2a4753d960860-45} +Name=BATTLETANXGA + +{ca243cf0cc7b23c5-45} +Name=CLAYFIGHTER 63 + +{cbc7ef32203feac3-45} +Name=Fighting Force + +{1a103ea89db637e9-45} +Name=Doom64 + +{ff016e8e48f9b4cc-45} +Name=Glover +AccurateTextureMapping=1 + +{3f14532151632d99-45} +Name=NEWTETRIS +VIWidth=400 +VIHeight=300 + +{a35ecf42df34139a-50} +Name=STARCRAFT 64 +NormalAlphaBlender=2 +UseCIWidthAndRatio=1 +RenderToTexture=3 + +{ac47477a23ecee44-44} +Name=PUZZLE LEAGUE N64 +VIWidth=320 +VIHeight=240 +FrameBufferEmulation=4 +RenderToTexture=3 + +{fd04dc82f4822dcf-45} +Name=A Bug's Life + +{f628fef7c3acf2c3-45} +Name=WAR GODS + +{3f22456b565c0ef0-45} +Name=W.G. 3DHOCKEY + +{59389d5a10e7aa97-45} +Name=W.G 3D Hockey 98 + +{329dc9bb80aa7d11-45} +Name=TWISTED EDGE + +{3e7450a1cd2225cf-45} +Name=Toy Story 2 +FrameBufferEmulation=2 + +{3d9b2662e8b111fe-45} +Name=TOP GEAR RALLY +ScreenUpdateSetting=2 + +{beda1f3cbae0a402-45} +Name=TETRISPHERE +IncTexRectEdge + +{5bf3e8a2d987dcc9-45} +Name=SUPERMAN + +{c8615eab9675faa2-45} +Name=PENNY RACERS + +{669464dcd9f02f57-4a} +Name=ONEGAI MONSTER + +{1a5ac4d45eb225f4-45} +Name=NITRO64 + +{eeb0255fdbc12762-45} +Name=NBA LIVE 2000 + +{ada552424ebf6fae-45} +Name=GOEMONS GREAT ADV + +{c59b41e6e31d0169-45} +Name=OgreBattle64 + +{e5522da955b6261d-45} +Name=FLYING DRAGON +FastLoadTile + +{d6fd4644088278e3-45} +Name=BOMBERMAN HERO + +{b42f2fff9a1461d1-45} +Name=Cruis'n USA + +{5c7e4d2622468718-45} +Name=Shadow of the Empire +DisableObjBG=1 +ScreenUpdateSetting=4 + +{63cff584dc7eee08-45} +Name=KNIFE EDGE + +{9fd8224237b6e0af-45} +Name=Bust A Move '99 +FastLoadTile + +{a43c70efc99a4a4d-4a} +Name=TOUKON ROAD + +{b3c83ccca405c40e-45} +Name=F1 WORLD GRAND PRIX + +{8e8fc9c7de5d1442-45} +Name=HOT WHEELS TURBO + +{36cee20de6291dd4-4a} +Name=HYBRID HEAVEN JP + +{374cff6dfd63b7b1-4a} +Name=̧н?64 + +{180e1599a5e66612-45} +Name=THPS2 + +{7ff0da0488e6180d-45} +Name=DUKE NUKEM ZERO HOUR + +{7a6882ae8d383f9a-45} +Name=F1 POLE POSITION 64 + +{6e86c107decc7557-50} +Name=F1 WORLD GRAND PRIX2 + +{5858a99e18b672af-45} +Name=MarioParty2 + +{d929387cce47826e-45} +Name=MarioParty3 +FastTextureCRC=1 +TexRectScaleHack + +{9207384145e067a1-45} +Name=POLARISSNOCROSS +TexRectScaleHack +DisableAlphaBlender=1 + +{31e0d6ed13601368-45} +Name=RUSH 2 + +{0d7ddff78f0152ed-00} +Name=Shufflepuck 64 + +{ac3363d79d21b60c-4a} +Name=Bass Rush + +{fab428e3e1284a00-50} +Name=Bust A Move 3 DX + +{20186b2a66f4bc6a-45} +Name=S.F. RUSH +IncTexRectEdge + +{4d7a545e9507e690-45} +Name=All-Star Baseball '0 + +{30a61376f396d63e-45} +Name=FIFA 99 +FastTextureCRC=1 + +{996e30b6b2d23eb6-4a} +Name=ÄÞ×´ÓÝ2 ˶ØÉ¼ÝÃÞ + +{049805d8119b7392-4a} +Name=ÄÞ×´ÓÝ3 ÉËÞÀÉÏÁSOS! + +{4cca08f927434636-45} +Name=Killer Instinct Gold +ForceScreenClear=1 + +{ac0443c321c0792d-45} +Name=MK_MYTHOLOGIES + +{b9019507ab3202ab-4a} +Name=CUSTOMROBOV2 + +{582ba5a441987523-45} +Name=DARK RIFT +EmulateClear=1 + +{c18944202bcf8612-45} +Name=BATMAN BEYOND RETURN + +{b4737e23376b3bd6-45} +Name=BOMBERMAN64U2 +AccurateTextureMapping=1 +FastTextureCRC=1 + +{bf2ff236f2128931-4a} +Name=64ÊÅÌÀ?~ÃݼÉÔ¸¿¸~ + +{ec7c7fc26f80e085-50} +Name=MYSTICAL NINJA2 SG + +{33ddbf4e849d4c66-45} +Name=Tigger's Honey Hunt + +{dd5a6f39a7ec9366-45} +Name=WCW BACKSTAGE + +{8c1168f44ee42ee3-4a} +Name=Ultraman Battle JAPA + +{aff7a346d091750f-45} +Name=CruisnExotica +ForceScreenClear=1 +FrameBufferEmulation=2 + +{e1a49e51e88475eb-4a} +Name=KING HILL 64 + +{f002cc8e81de8b7f-45} +Name=Top Gear Hyper Bike + +{54edd74d7d28f974-45} +Name=Shadow of the Empire +FrameBufferEmulation=3 +ScreenUpdateSetting=3 + +{6c7450f00b827b24-45} +Name=ROAD RASH 64 +AccurateTextureMapping=1 + +{6a6d63bdba541f5d-45} +Name=World Cup 98 + +{9516943beb5e0af9-50} +Name=TWINE +UseCIWidthAndRatio=1 + +{95351208def11005-45} +Name=BIOFREAKS + +{abd8f7d146043b29-45} +Name=Asteroids Hyper 64 + +{0588f752b7ca8f8b-45} +Name=Fighter's Destiny + +{a2dc9ac4621b50f1-45} +Name=GT64 +IncTexRectEdge + +{ea406a09100abe8a-45} +Name=LEGORacers +FrameBufferEmulation=2 + +{87b4694e90e218fe-45} +Name=NBA HANGTIME +FastLoadTile +FullTMEM=1 + +{47b512cae44efa71-45} +Name=POKEMON SNAP +FastTextureCRC=1 +RenderToTexture=3 + +{1a1d75c2ff9bc1f8-50} +Name=SNOWBOARD KIDS2 + +{f85c032635912b80-45} +Name=Mission Impossible + +{f18b591b459ba2ec-45} +Name=AERO FIGHTERS ASSAUL + +{20d568510dcd5fca-4a} +Name=Banjo-Kazooie + +{eeea74f73eb1d8f0-4a} +Name=F3 ̳ײɼÚÝ2 +AccurateTextureMapping=1 +FastTextureCRC=1 + +{6d8d76286c9779b3-45} +Name=Monaco Grand Prix + +{821157036dd02f89-45} +Name=POKEMON STADIUM 2 +FrameBufferEmulation=3 + +{b8a5ed9403e97386-45} +Name=Starshot + +{127edc3ec91c6ce2-45} +Name=Gex 3 Deep Cover Gec + +{98ae2b8dbf2537d7-45} +Name=NAGANO OLYMPICS + +{6b7e8094e462cc60-4a} +Name=PUYO PUYO SUN 64 + +{f34791760ec13320-45} +Name=SCARS +VIWidth=320 +VIHeight=240 +FullTMEM=1 + +{2d16e69f37407ee9-4a} +Name=TROUBLE MAKERS + +{8ad56680c1cadec3-45} +Name=Waialae Country Club + +{20f9b837efb38ba5-45} +Name=Twintris + +{9dae5305c1e0d8ea-45} +Name=XENAWARRIORPRINCESS + +{f179a589ef977e66-45} +Name=Turok 3: Shadow of O + +{3d8ea87371c5c53a-45} +Name=RALLY CHALLENGE +RenderToTexture=3 + +{9cf75b9fa008fed2-45} +Name=Quake +ForceScreenClear=1 + +{a7233ec41a68b140-45} +Name=All Star Baseball 99 + +{d025c427c1992d8c-50} +Name=AIR BOARDER 64 + +{941a95b6af49c863-4a} +Name=DRACULA MOKUSHIROKU + +{2907d2674c7796f6-4a} +Name=SMASH BROTHERS + +{c73b072011013b5e-45} +Name=ITF 2000 + +{4fd5ea30f60b6231-45} +Name=NFL BLITZ SPECIAL ED + +{80cd41d712b9a9ac-45} +Name=Top Gear Overdrive + +{2b0996e84e4d24dc-45} +Name=WHEEL OF FORTUNE + +{3e46beae4b4671cc-45} +Name=AEROGAUGE + +{ec620158f18b10e3-58} +Name=CARMAGEDDON64 + +{d245a2fd473d4aa7-45} +Name=extremeg + +{74d7fe891be2afca-45} +Name=GEX: ENTER THE GECKO + +{6064256986f5a3b9-45} +Name=JEOPARDY! + +{bcb516e6888b65c9-45} +Name=Iggy's Reckin' Balls + +{32272d1318910ec7-45} +Name=Wipeout 64 + +{14979eef7d2c3bc0-45} +Name=Tonic Trouble + +{163ed509b968b23a-45} +Name=PIAZZA STRIKEZONE + +{f4d47d41e22f481b-45} +Name=MORTAL KOMBAT 4 + +{4f47294f7a70cb30-4a} +Name=KAKUTOU DENSHOU + +{6910969c8d48eaf5-4a} +Name=64 OHZUMOU +FastLoadTile + +{1462a21e0f9090e7-50} +Name=Turok: Rage Wars + +{f6290781c1cf3fe0-45} +Name=NBA JAM 99 + +{cab7f1645537a271-50} +Name=CASTLEVANIA + +{5991f1c35abcd265-45} +Name=FIFA Soccer 64 + +{dce23ae1e85cb64f-4a} +Name=Eltail + +{514423656f34d3eb-4a} +Name=Blastdozer + +{e48c53cdf9fc8a61-45} +Name=Chameleon Twist2 +ScreenUpdateSetting=4 + +{56ab73a29adb33da-45} +Name=DUKE NUKEM + +{657e647c05d34819-45} +Name=Blast Corps + +{e167f6a51fbd1fda-4a} +Name=DERBYSTALLION 64 + +{92f738eb46a20e19-45} +Name=Madden NFL 2001 +ScreenUpdateSetting=4 + +{d4a34b66b7808a67-45} +Name=MarioGolf64 +FrameBufferEmulation=4 +RenderToTexture=4 + +{83c871d5cf3f2d82-50} +Name=BLUES BROTHERS 2000 + +{134d9d76fe3f23da-45} +Name=DR.MARIO 64 +FastTextureCRC=2 +TexRectScaleHack +FrameBufferEmulation=7 +RenderToTexture=3 + +{f815d0a743aa8922-45} +Name=STARFOX64 + +{a284e5de8711160f-45} +Name=DESTRUCT DERBY + +{7e652928771862a0-45} +Name=MarioParty +FastTextureCRC=1 +ScreenUpdateSetting=4 + +{c8fe8d30f6b52ece-45} +Name=WORLD DRIVER CHAMP + +{d94dbbc80b435fcc-45} +Name=Quest 64 + +{4fb5a8ce03d5217f-45} +Name=Wetrix +AccurateTextureMapping=1 +FastTextureCRC=1 + +{436b4bfea7291d08-45} +Name=TRIPLE PLAY 2000 + +{77eb3c7f0a038189-45} +Name=HERCULES + +{b7a4ff08b653f401-45} +Name=Big Mountain 2000 + +{d66abc75c92b5578-4a} +Name=·×¯Ä¶²¹Â 64ÀÝòÀÞ + +{65973ce4bec1b105-4a} +Name=Wonder Project J2 + +{78957423fd58dc80-45} +Name=NASCAR 99 +PrimaryDepthHack + +{b6730fb234fc7529-45} +Name=ARMYMEN SARGE 2 + +{1cfb9046446dd54c-45} +Name=GOLDEN NUGGET 64 + +{8074f13d5aed3d19-50} +Name=Donald Duck Quack At +FastTextureCRC=1 + +{cdb8580bd291b2b7-50} +Name=Body Harvest +ScreenUpdateSetting=2 + +{4dd12fd7c432ed1f-45} +Name=Bottom of the 9th +VIWidth=320 +VIHeight=240 + +{c2b1f7bf8e14bfae-4a} +Name=ÄÞ×´ÓÝ Ð¯Âɾ²Ú²¾· + +{405127a8e856b0b9-4a} +Name=ÄÞ×´ÓÝ3 ÉËÞÀÉÏÁSOS! + +{26f7fc68bc8c6549-50} +Name=G.A.S.P!!Fighters'NE + +{978d9fab66a7ea95-00} +Name=Kings of Porn Vol 01 + +{4c5eb3e4c95cc41a-45} +Name=MGAH VOL1 + +{2f96deac7ff8cbb2-50} +Name=NBA PRO 98 + +{a55f70280e6909b5-50} +Name=Monaco GP Racing 2 + +{420c2a397de790b7-45} +Name=RAINBOW SIX + +{5d0ef1d379a52e05-45} +Name=hey you, pikachu + +{d44a7da4f981fa8b-45} +Name=Manic Miner 64 + +{231b1c14259ef43e-00} +Name=(C) DATEL D&D NU10:0 + +{0cf10110c1d8513d-45} +Name=Mia Hamm Soccer 64 + +{bbdd9849bcaeb7f7-45} +Name=NUCLEARSTRIKE64 + +{25d625395ec7838c-50} +Name=MADDEN NFL 99 + +{bf882810ca884843-45} +Name=HYBRID HEAVEN USA + +{7a4636e49b8fde82-45} +Name=INDY RACING 2000 + +{d04eabe3d20d0483-45} +Name=NFL QBC 2000 + +{6960bfac62e1beea-45} +Name=CHOPPER_ATTACK + +{707ae874d4ae9362-50} +Name=ROADSTERS TROPHY + +{c463275fe52a4162-45} +Name=I S S 64 +ScreenUpdateSetting=3 + +{43f1a8bd622dafb1-45} +Name=QUAKE II +ForceScreenClear=2 + +{127341ec5fde31eb-4a} +Name=THE MASK OF MUJURA +DisableObjBG=1 + +{c26661e3e5a21386-58} +Name=MO WORLD LEAGUE SOCC + +{5a211daa9abecb91-45} +Name=SUPER BOWLING + +{e2a2bb4bb2bbf38b-00} +Name=Puzzle Master 64 + +{9e5abd88bfdf1fe8-50} +Name=NFL QBC 2000 + +{48a90cc04bd3608e-45} +Name=South Park: Chef's L +TexRectScaleHack +FullTMEM=1 +AlternativeTxtSizeMethod=1 + +{4b45d50895ccaaff-4a} +Name=TETRIS64 + +{5a53206462800250-45} +Name=Chameleon Twist + +{493336f51bd2f9db-45} +Name=DeadlyArts + +{c7c4eb0c32e99c0c-4a} +Name=WILD CHOPPERS + +{57062c866d89fd8d-45} +Name=Army Men Sarge + +{a18efce89183739f-45} +Name=CyberTiger + +{010c339eba14038c-45} +Name=Forsaken + +{36fecce375bc8f39-45} +Name=YOSHI STORY + +{1d5bce9c83e25163-00} +Name= + +{e98889b5e84bfcb1-50} +Name=Hydro Thunder + +{6e84e4bab0fe8ebb-45} +Name=PAPERBOY + +{ec4716df47a9a2be-50} +Name=MYSTICAL NINJA2 SG + +{532a11638fa89fa2-4a} +Name=PERFECT STRIKER2 + +{2d56d52850aed5e4-4a} +Name=ÃÞÝØ­³²×²×ÎÞ +ScreenUpdateSetting=2 + +{fbabf721e8a78a6a-50} +Name=Jeremy McGrath Super + +{0df1702fff87415c-45} +Name=TUROK_DINOSAUR_HUNTE + +{efc64654bb478ee1-45} +Name=All-Star Baseball 20 + +{e8603e5e95d4b54a-4a} +Name=»²·®³ÊÌÞ¼®³· + +{cd0d702fc9c56c17-50} +Name=TUROK_DINOSAUR_HUNTE + +{db4d6b0b82e67196-45} +Name=ROADSTERS TROPHY + +{aea23b699f4ef1b7-45} +Name=THE LEGEND OF ZELDA + +{3890053c8221bfc8-45} +Name=V-RALLY + +{5b8b6b91a4850b78-45} +Name=SMASH BROTHERS + +{89638313763c5b26-45} +Name=MADDEN 64 + +{a93af3830dd401a9-45} +Name=MortalKombatTrilogy + +{29b4b7ea572cc9ba-45} +Name=READY 2 RUMBLE + +{5e6c6384fa4a9e94-4a} +Name=TETRIS64 + +{c45db2418667721b-45} +Name=Lamborghini 64 + +{5007706bfe21d629-45} +Name=MACE + +{865877637b0eb85f-4a} +Name=POKEMON STADIUM 2 +FrameBufferEmulation=3 +RenderToTexture=3 + +{d0f2f9989cf0d903-50} +Name=Virtual Pool 64 +ScreenUpdateSetting=3 + +{f311e83524277999-4a} +Name=½½?À²¾ÝÊß½ÞÙÀÞÏ +TexRectScaleHack + +{2dac77289a13dcc3-44} +Name=Racing Simulation 2 +FastLoadTile + +{d8526891efeadb73-45} +Name=NBA Courtside 2 + +{3754838eb44857cd-45} +Name=I.S.S.2000 + +{f336411da9ee63af-50} +Name=THE LEGEND OF ZELDA +FrameBufferEmulation=7 + +{0000000000000000-00} +Name= + +{decd1acbf21d29cf-45} +Name=FIFA: RTWC 98 +ScreenUpdateSetting=2 + +{6930669c804af280-50} +Name=MarioParty + +{79c712671d78723b-50} +Name=IT&F SUMMERGAMES + +{f49e624b9b1db299-50} +Name=quarterback_club_98 + +{8725c27e23e31aef-45} +Name=OLYMPIC HOCKEY + +{f0ed310ed54972c3-50} +Name=FIFA: RTWC 98 + +{51a69801849d21fc-50} +Name=FIFA 99 + +{dbe5388cd7277cb3-50} +Name=ECW Hardcore Revolut + +{2ce9cbf412ed92b3-50} +Name=STARFOX64 + +{796690e4053f249f-50} +Name=MAGICAL TETRIS + +{7e9598edacdc4282-45} +Name=WIN BACK + +{ba8bb7de9dbdf652-45} +Name=MADDEN NFL 99 + +{604167c53c455f0f-50} +Name=MarioParty3 +TexRectScaleHack + +{d057e9625d5ac17f-50} +Name=MarioGolf64 +FrameBufferEmulation=3 +RenderToTexture=3 + +{396d17c9d17947ea-50} +Name=BANJO TOOIE + +{185bf98d7b49daec-45} +Name=NBA IN THE ZONE 2000 + +{9c9094082dd8d4da-45} +Name=Knockout Kings 2000 +UseCIWidthAndRatio=1 +RenderToTexture=3 + +{fb4e4f2bfe11c543-50} +Name=TOM AND JERRY + +{dadf3a4daefc9875-50} +Name=RUGRATSTREASUREHUNT + +{02c608eea6d5c26b-50} +Name=PGA European Tour Go + +{94ad4c21243b1abe-45} +Name=CHOPPER_ATTACK + +{4716b67578bfda7a-45} +Name=MAGICAL TETRIS + +{350c85f11279e0ac-45} +Name=MICROMACHINES64TURBO + +{e183c35a87e312d7-45} +Name=monopoly + +{168bc185af2296df-4a} +Name=64 µµ½ÞÓ³ 2 + +{fbb1ab739360ca9c-45} +Name=PENNY RACERS + +{e4f99fc27dfe4b26-45} +Name=RAMPAGE + +{99d7e0fc546c3165-45} +Name=KNIFE EDGE + +{0ca3d88317c15285-00} +Name=YOSHI BOOT EMU + +{8d3bda777c0d2b16-4a} +Name=²ÃÞÖ³½¹Éϰ¼Þ¬Ý¼Þ­¸ + +{986c006081a30526-4a} +Name=VIOLENCEKILLER + +{cd0c011cfab7d322-4a} +Name=½Þ°Ù ϼޭ³Â¶²ÃÞݾ + +{222ee09cb0f16e20-4a} +Name=SUPER SPEED RACE 64 + +{dccda73ba0524e46-4a} +Name=MARIO STORY + +{1e82cccc838ae896-4a} +Name=ϰ¼Þ¬Ýγ۳·CLASSIC + +{20b93bd8166440cc-4a} +Name=ǼÂÞØ64 + +{3b4b5574b5bcaef4-4a} +Name=PACHINKO365NICHI + +{ad5b4934269d2e50-4a} +Name=PAWAFURU PUROYAKYU4 + +{da4329d2c0772bac-4a} +Name=PAWAFURU PUROYAKYU5 + +{b7205eb7fdfdfeb3-4a} +Name=PAWAFURU PUROYAKYU6 + +{547fd2f3f9ac11c1-50} +Name=Premier Manager 64 + +{3b5966d6075ca2d7-4a} +Name=RockMan Dash + +{ff04fc84e93c25b1-4a} +Name=½ÉÎÞ·¯½Þ +ScreenUpdateSetting=4 + +{c1a7caff37858568-4a} +Name=STARFOX64 + +{87a91f0fa6afc1bf-45} +Name=Re-Volt + +{5db998df78098458-4a} +Name=BANGAIOH +IncTexRectEdge + +{8824ae7e5aa3409d-4a} +Name=BioHazard II + +{c4085c048b79fd4a-4a} +Name=ÊÞ°Á¬Ù ÌßÛÚ½ØÝ¸Þ 64 +FrameBufferEmulation=2 +ScreenUpdateSetting=3 + +{9c167989a0f689f1-4a} +Name=DEZAEMON3D + +{819b9b3911ad33d5-4a} +Name=´¸½ÄذÑG2 +PrimaryDepthHack + +{66e8703ee8ba3844-4a} +Name=HEIWA ÊßÁݺ ܰÙÄÞ64 +RenderToTexture=3 + +{f5d919afcc2302b7-4a} +Name=G1STABLE + +{ac90989adf13c3f0-4a} +Name=ÏØµÉÌ«ÄËß° + +{0f692b27777a0aad-4a} +Name=Robopon64 +FrameBufferEmulation=3 +RenderToTexture=3 + +{339521e9bdaffb13-45} +Name=Ready to Rumble + +{f480fe3f7e5fc1a7-45} +Name=NBA SHOWTIME + +{56a48bb9af762b5b-4a} +Name=ÐÝÅÃÞÀϺޯÁܰÙÄÞ +FastLoadTile +FullTMEM=1 + +{69025b840295de57-4a} +Name=Top Gear Hyper Bike + +{e6849c48f9496e4c-4a} +Name=Getter Love!! + +{b157ae0937562a18-4a} +Name=MASTERS'98 + +{f127177deb836b6c-00} +Name=Test Program + +{93b8a075b521a34c-00} +Name= + +{321536813f64eb2a-00} +Name= + +{e04dda1e8d69bf22-00} +Name=Test Program + +{0ab5b39a056166bc-44} +Name=HEXEN + +{6805ed0d5e510215-4a} +Name=´²º³É¾ÝıÝÄÞØ­°½ + +{c851318f45f53a4f-44} +Name=WWF: Attitude + +{8ef08d6dcfc308d0-50} +Name=WWF No Mercy + +{dbe6647cdb24b955-50} +Name=Blast Corps + +{ce97680354fad4e0-45} +Name=SHADOWGATE64 + +{324b8eac2673b4e7-45} +Name=ROBOTRON-64 + +{424a5554fb5f98e4-4a} +Name=J LEAGUE LIVE 64 + +{d218739cc10dae24-4a} +Name=BEETLE ADVENTURE JP +Texture1Hack + +{614ab6a10b9414d0-50} +Name=Beetle Adventure Rac +Texture1Hack + +{5cc0c180f45e06ea-45} +Name=MLB FEATURING K G JR +FastLoadTile + +{be98b9cdc8a52410-50} +Name=MLB FEATURING K G JR +FastLoadTile +AlternativeTxtSizeMethod=1 + +{1e93f3833d2272cb-50} +Name=CRUIS'N WORLD +UseCIWidthAndRatio=2 + +{80064660720e5f30-50} +Name=Lode Runner 3D +ScreenUpdateSetting=1 + +{140efa7505d1b3c9-44} +Name=Holy Magic Century + +{3e269b97040047f8-50} +Name=Killer Instinct Gold + +{2bc6673d5031d031-4a} +Name=LET'S SMASH + +{87a9c3c94c341058-4a} +Name=MARIOKART64 + +{b8a588e6183f4bb1-50} +Name=TWISTED EDGE + +{30dcef8261246a80-45} +Name=BLADES OF STEEL '99 + +{b01a15d04ba15cfe-45} +Name=DAIKATANA + +{bae28f9e7007278b-45} +Name=KILLER INSTINCT GOLD +ForceScreenClear=1 + +{61f1ba1ff1541c2c-41} +Name=1080 SNOWBOARDING +FastTextureCRC=2 +ScreenUpdateSetting=2 + +{e08b138c460e7095-45} +Name=BASS HUNTER 64 + +{8b24b3824d243ee7-45} +Name=VIRTUALCHESS + +{9369a7da7cf7acd8-00} +Name= + +{4986248e52de1c2e-00} +Name= + +{74ab4cb4299a0207-50} +Name=SUPERMAN + +{1ed568f51eba497e-45} +Name=BOMBERMAN64U + +{f558c10e96683efb-45} +Name=Mega Man 64 + +{dab629518c3cef9d-45} +Name=NAMCOMUSEUM64 + +{60a73e50960e30e1-50} +Name=Cruis'n USA + +{9723feeb34da74ff-45} +Name=SPACE INVADERS + +{0e4016ac1a075dcf-45} +Name=CAL SPEED + +{e8960e1e6b82284e-45} +Name=CHARLIE BLAST'S + +{a00b78ba34db210f-45} +Name=STARFOX64 + +{e740d45311b01975-45} +Name=Diddy Kong Racing + +{134c3f03a7e79e31-45} +Name=TWINE + +{ccffc42d215affc8-50} +Name=AIDYN_CHRONICLES + +{91e285e16d76504e-45} +Name=ALL STAR TENNIS '99 + +{df1850253aaed657-45} +Name=Lode Runner 3D + +{71458cfac0f9e7bb-45} +Name=MICKEY USA + diff --git a/libmupen64plus/mupen64plus-video-rice/projects/msvc11/mupen64plus-video-rice.vcxproj b/libmupen64plus/mupen64plus-video-rice/projects/msvc11/mupen64plus-video-rice.vcxproj new file mode 100644 index 0000000000..4df6c63fda --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/projects/msvc11/mupen64plus-video-rice.vcxproj @@ -0,0 +1,215 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {7D4AFF6A-B7D9-4C25-975A-038B8079098E} + mupen64plusvideorice + Win32Proj + + + + DynamicLibrary + MultiByte + true + + + DynamicLibrary + MultiByte + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + true + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\include;..\..\..\mupen64plus-win32-deps\libpng-1.2.37\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.3\include;%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + user32.lib;gdi32.lib;opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\lib\SDL.lib;..\..\..\mupen64plus-win32-deps\libpng-1.2.37\lib\libpng.lib;%(AdditionalDependencies) + true + Windows + MachineX86 + + + + + ..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\include;..\..\..\mupen64plus-win32-deps\libpng-1.2.37\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.3\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + Default + + + user32.lib;gdi32.lib;opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\lib\SDL.lib;..\..\..\mupen64plus-win32-deps\libpng-1.2.37\lib\libpng.lib;%(AdditionalDependencies) + true + Windows + true + true + MachineX86 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libmupen64plus/mupen64plus-video-rice/projects/msvc8/mupen64plus-video-rice.vcproj b/libmupen64plus/mupen64plus-video-rice/projects/msvc8/mupen64plus-video-rice.vcproj new file mode 100644 index 0000000000..34cc0b8679 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/projects/msvc8/mupen64plus-video-rice.vcproj @@ -0,0 +1,652 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libmupen64plus/mupen64plus-video-rice/projects/unix/Makefile b/libmupen64plus/mupen64plus-video-rice/projects/unix/Makefile new file mode 100644 index 0000000000..179fefdb0f --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/projects/unix/Makefile @@ -0,0 +1,438 @@ +#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# * Mupen64plus-video-rice - Makefile * +# * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * +# * Copyright (C) 2007-2009 Richard Goedeken * +# * Copyright (C) 2007-2008 DarkJeztr Tillin9 * +# * * +# * 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. * +# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +# Makefile for RiceVideo plugin in Mupen64Plus + +# detect operating system +UNAME ?= $(shell uname -s) +OS := NONE +ifeq ("$(UNAME)","Linux") + OS = LINUX + SO_EXTENSION = so + SHARED = -shared +endif +ifeq ("$(UNAME)","linux") + OS = LINUX + SO_EXTENSION = so + SHARED = -shared +endif +ifneq ("$(filter GNU hurd,$(UNAME))","") + OS = LINUX + SO_EXTENSION = so + SHARED = -shared +endif +ifeq ("$(UNAME)","Darwin") + OS = OSX + SO_EXTENSION = dylib + SHARED = -bundle + PIC = 1 # force PIC under OSX +endif +ifeq ("$(UNAME)","FreeBSD") + OS = FREEBSD + SO_EXTENSION = so + SHARED = -shared +endif +ifeq ("$(UNAME)","OpenBSD") + OS = FREEBSD + SO_EXTENSION = so + SHARED = -shared + $(warning OS type "$(UNAME)" not officially supported.') +endif +ifneq ("$(filter GNU/kFreeBSD kfreebsd,$(UNAME))","") + OS = LINUX + SO_EXTENSION = so + SHARED = -shared +endif +ifeq ("$(patsubst MINGW%,MINGW,$(UNAME))","MINGW") + OS = MINGW + SO_EXTENSION = dll + SHARED = -shared + PIC = 0 +endif +ifeq ("$(OS)","NONE") + $(error OS type "$(UNAME)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') +endif + +# detect system architecture +HOST_CPU ?= $(shell uname -m) +CPU := NONE +ifneq ("$(filter x86_64 amd64,$(HOST_CPU))","") + CPU := X86 + ifeq ("$(BITS)", "32") + ARCH_DETECTED := 64BITS_32 + PIC ?= 0 + else + ARCH_DETECTED := 64BITS + PIC ?= 1 + endif +endif +ifneq ("$(filter pentium i%86,$(HOST_CPU))","") + CPU := X86 + ARCH_DETECTED := 32BITS + PIC ?= 0 +endif +ifneq ("$(filter ppc macppc socppc powerpc,$(HOST_CPU))","") + CPU := PPC + ARCH_DETECTED := 32BITS + BIG_ENDIAN := 1 + PIC ?= 1 + NO_ASM := 1 + $(warning Architecture "$(HOST_CPU)" not officially supported.') +endif +ifneq ("$(filter ppc64 powerpc64,$(HOST_CPU))","") + CPU := PPC + ARCH_DETECTED := 64BITS + BIG_ENDIAN := 1 + PIC ?= 1 + NO_ASM := 1 + $(warning Architecture "$(HOST_CPU)" not officially supported.') +endif +ifneq ("$(filter arm%,$(HOST_CPU))","") + ifeq ("$(filter arm%b,$(HOST_CPU))","") + CPU := ARM + ARCH_DETECTED := 32BITS + PIC ?= 1 + NO_ASM := 1 + $(warning Architecture "$(HOST_CPU)" not officially supported.') + endif +endif +ifeq ("$(CPU)","NONE") + $(error CPU type "$(HOST_CPU)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') +endif + +# base CFLAGS, LDLIBS, and LDFLAGS +OPTFLAGS ?= -O3 +WARNFLAGS ?= -Wall +CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src +CXXFLAGS += -fvisibility-inlines-hidden +LDFLAGS += $(SHARED) + +# default configuration programs +SDL_CONFIG = $(CROSS_COMPILE)sdl-config +PKG_CONFIG = $(CROSS_COMPILE)pkg-config + +ifeq ($(CPU), X86) + CFLAGS += -msse +endif + +# Since we are building a shared library, we must compile with -fPIC on some architectures +# On 32-bit x86 systems we do not want to use -fPIC because we don't have to and it has a big performance penalty on this arch +ifeq ($(PIC), 1) + CFLAGS += -fPIC + LDFLAGS += -fPIC +else + CFLAGS += -fno-PIC + LDFLAGS += -fno-PIC +endif + +ifeq ($(BIG_ENDIAN), 1) + CFLAGS += -DM64P_BIG_ENDIAN +endif + +# tweak flags for 32-bit build on 64-bit system +ifeq ($(ARCH_DETECTED), 64BITS_32) + ifeq ($(OS), FREEBSD) + $(error Do not use the BITS=32 option with FreeBSD, use -m32 and -m elf_i386) + endif + CFLAGS += -m32 + LDFLAGS += -m32 -Wl,-m,elf_i386 +endif + +# set special flags per-system +ifeq ($(OS), LINUX) + LDLIBS += -ldl + # only export api symbols + LDFLAGS += -Wl,-version-script,$(SRCDIR)/video_api_export.ver +endif +ifeq ($(OS), OSX) + # Select the proper SDK + # Also, SDKs are stored in a different location since XCode 4.3 + OSX_SDK ?= $(shell sw_vers -productVersion | cut -f1 -f2 -d .) + OSX_XCODEMAJ = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f1 -d .) + OSX_XCODEMIN = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f2 -d .) + OSX_XCODEGE43 = $(shell echo "`expr $(OSX_XCODEMAJ) \>= 4``expr $(OSX_XCODEMIN) \>= 3`") + ifeq ($(OSX_XCODEGE43), 11) + OSX_SYSROOT := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs + else + OSX_SYSROOT := /Developer/SDKs + endif + + ifeq ($(CPU), X86) + ifeq ($(ARCH_DETECTED), 64BITS) + CFLAGS += -pipe -arch x86_64 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk + LDFLAGS += -bundle -arch x86_64 + LDLIBS += -ldl + else + CFLAGS += -pipe -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk + LDFLAGS += -bundle -arch i686 + LDLIBS += -ldl + endif + endif +endif + +# test for essential build dependencies +ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null),) + $(error $(PKG_CONFIG) not found) +endif +CFLAGS += $(shell $(PKG_CONFIG) --cflags libpng) +LDLIBS += $(shell $(PKG_CONFIG) --libs libpng) + +# search for OpenGL libraries +GL_LIBS= +ifeq ($(OS), OSX) + GL_LIBS = -framework OpenGL +endif +ifeq ($(OS), MINGW) + GL_LIBS = -lopengl32 +endif +ifeq ("$(GL_LIBS)", "") + ifeq ($(shell $(PKG_CONFIG) --modversion gl 2>/dev/null),) + $(error No OpenGL development libraries found!) + endif + CFLAGS += $(shell $(PKG_CONFIG) --cflags gl) + GL_LIBS = $(shell $(PKG_CONFIG) --libs gl) +endif +LDLIBS += $(GL_LIBS) + +# test for presence of SDL +ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),) + $(error No SDL development libraries found!) +endif +ifeq ($(OS),FREEBSD) + CFLAGS += $(shell $(SDL_CONFIG) --cflags) + LDLIBS += $(shell $(SDL_CONFIG) --libs) +endif +ifeq ($(OS),OSX) + CFLAGS += $(shell $(SDL_CONFIG) --cflags) + LDLIBS += $(shell $(SDL_CONFIG) --libs) +endif +ifeq ($(OS),LINUX) + CFLAGS += $(shell $(SDL_CONFIG) --cflags) + LDLIBS += $(shell $(SDL_CONFIG) --libs) +endif +ifeq ($(OS), MINGW) + CFLAGS += $(shell $(SDL_CONFIG) --cflags) + LDLIBS += $(shell $(SDL_CONFIG) --libs) +endif + +# set mupen64plus core API header path +ifneq ("$(APIDIR)","") + CFLAGS += "-I$(APIDIR)" +else + TRYDIR = ../../../mupen64plus-core/src/api + ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") + CFLAGS += -I$(TRYDIR) + else + TRYDIR = /usr/local/include/mupen64plus + ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") + CFLAGS += -I$(TRYDIR) + else + TRYDIR = /usr/include/mupen64plus + ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") + CFLAGS += -I$(TRYDIR) + else + $(error Mupen64Plus API header files not found! Use makefile parameter APIDIR to force a location.) + endif + endif + endif +endif + +# reduced compile output when running make without V=1 +ifneq ($(findstring $(MAKEFLAGS),s),s) +ifndef V + Q_CC = @echo ' CC '$@; + Q_CXX = @echo ' CXX '$@; + Q_LD = @echo ' LD '$@; +endif +endif + +# set base program pointers and flags +CC = $(CROSS_COMPILE)gcc +CXX = $(CROSS_COMPILE)g++ +RM ?= rm -f +INSTALL ?= install +MKDIR ?= mkdir -p +COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c +COMPILE.cc = $(Q_CXX)$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c +LINK.o = $(Q_LD)$(CXX) $(LDFLAGS) $(TARGET_ARCH) + +# set special flags for given Makefile parameters +ifeq ($(DEBUG),1) + CFLAGS += -g + INSTALL_STRIP_FLAG ?= +else + ifneq ($(OS),OSX) + INSTALL_STRIP_FLAG ?= -s + endif +endif +ifeq ($(NO_ASM), 1) + CFLAGS += -DNO_ASM +endif + +# set installation options +ifeq ($(PREFIX),) + PREFIX := /usr/local +endif +ifeq ($(SHAREDIR),) + SHAREDIR := $(PREFIX)/share/mupen64plus +endif +ifeq ($(LIBDIR),) + LIBDIR := $(PREFIX)/lib +endif +ifeq ($(PLUGINDIR),) + PLUGINDIR := $(LIBDIR)/mupen64plus +endif + +SRCDIR = ../../src +OBJDIR = _obj$(POSTFIX) + +# list of source files to compile +SOURCE = \ + $(SRCDIR)/liblinux/BMGImage.c \ + $(SRCDIR)/liblinux/BMGUtils.cpp \ + $(SRCDIR)/liblinux/bmp.c \ + $(SRCDIR)/liblinux/pngrw.c \ + $(SRCDIR)/Blender.cpp \ + $(SRCDIR)/Combiner.cpp \ + $(SRCDIR)/CombinerTable.cpp \ + $(SRCDIR)/Config.cpp \ + $(SRCDIR)/ConvertImage.cpp \ + $(SRCDIR)/ConvertImage16.cpp \ + $(SRCDIR)/CNvTNTCombiner.cpp \ + $(SRCDIR)/Debugger.cpp \ + $(SRCDIR)/DecodedMux.cpp \ + $(SRCDIR)/DirectXDecodedMux.cpp \ + $(SRCDIR)/DeviceBuilder.cpp \ + $(SRCDIR)/FrameBuffer.cpp \ + $(SRCDIR)/GeneralCombiner.cpp \ + $(SRCDIR)/GraphicsContext.cpp \ + $(SRCDIR)/OGLCombiner.cpp \ + $(SRCDIR)/OGLCombinerNV.cpp \ + $(SRCDIR)/OGLCombinerTNT2.cpp \ + $(SRCDIR)/OGLDecodedMux.cpp \ + $(SRCDIR)/OGLExtCombiner.cpp \ + $(SRCDIR)/OGLExtensions.cpp \ + $(SRCDIR)/OGLExtRender.cpp \ + $(SRCDIR)/OGLFragmentShaders.cpp \ + $(SRCDIR)/OGLGraphicsContext.cpp \ + $(SRCDIR)/OGLRender.cpp \ + $(SRCDIR)/OGLRenderExt.cpp \ + $(SRCDIR)/OGLTexture.cpp \ + $(SRCDIR)/Render.cpp \ + $(SRCDIR)/RenderBase.cpp \ + $(SRCDIR)/RenderExt.cpp \ + $(SRCDIR)/RenderTexture.cpp \ + $(SRCDIR)/RSP_Parser.cpp \ + $(SRCDIR)/RSP_S2DEX.cpp \ + $(SRCDIR)/Texture.cpp \ + $(SRCDIR)/TextureFilters.cpp \ + $(SRCDIR)/TextureFilters_2xsai.cpp \ + $(SRCDIR)/TextureFilters_hq2x.cpp \ + $(SRCDIR)/TextureFilters_hq4x.cpp \ + $(SRCDIR)/TextureManager.cpp \ + $(SRCDIR)/VectorMath.cpp \ + $(SRCDIR)/Video.cpp + +ifeq ($(OS),MINGW) +SOURCE += \ + $(SRCDIR)/osal_dynamiclib_win32.c \ + $(SRCDIR)/osal_files_win32.c +else +SOURCE += \ + $(SRCDIR)/osal_dynamiclib_unix.c \ + $(SRCDIR)/osal_files_unix.c +endif + +# generate a list of object files build, make a temporary directory for them +OBJECTS := $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(filter %.c, $(SOURCE))) +OBJECTS += $(patsubst $(SRCDIR)/%.cpp, $(OBJDIR)/%.o, $(filter %.cpp, $(SOURCE))) +OBJDIRS = $(dir $(OBJECTS)) +$(shell $(MKDIR) $(OBJDIRS)) + +# build targets +TARGET = mupen64plus-video-rice$(POSTFIX).$(SO_EXTENSION) + +targets: + @echo "Mupen64plus-video-rice N64 Graphics plugin makefile. " + @echo " Targets:" + @echo " all == Build Mupen64plus-video-rice plugin" + @echo " clean == remove object files" + @echo " rebuild == clean and re-build all" + @echo " install == Install Mupen64Plus-video-rice plugin" + @echo " uninstall == Uninstall Mupen64Plus-video-rice plugin" + @echo " Options:" + @echo " BITS=32 == build 32-bit binaries on 64-bit machine" + @echo " NO_ASM=1 == build without inline assembly code (x86 MMX/SSE)" + @echo " APIDIR=path == path to find Mupen64Plus Core headers" + @echo " OPTFLAGS=flag == compiler optimization (default: -O3)" + @echo " WARNFLAGS=flag == compiler warning levels (default: -Wall)" + @echo " PIC=(1|0) == Force enable/disable of position independent code" + @echo " POSTFIX=name == String added to the name of the the build (default: '')" + @echo " Install Options:" + @echo " PREFIX=path == install/uninstall prefix (default: /usr/local)" + @echo " SHAREDIR=path == path to install shared data files (default: PREFIX/share/mupen64plus)" + @echo " LIBDIR=path == library prefix (default: PREFIX/lib)" + @echo " PLUGINDIR=path == path to install plugin libraries (default: LIBDIR/mupen64plus)" + @echo " DESTDIR=path == path to prepend to all installation paths (only for packagers)" + @echo " Debugging Options:" + @echo " DEBUG=1 == add debugging symbols" + @echo " LTO=1 == enable experimental build with link-time optimization" + @echo " V=1 == show verbose compiler output" + +all: $(TARGET) + +install: $(TARGET) + $(INSTALL) -d "$(DESTDIR)$(PLUGINDIR)" + $(INSTALL) -m 0644 $(INSTALL_STRIP_FLAG) $(TARGET) "$(DESTDIR)$(PLUGINDIR)" + $(INSTALL) -d "$(DESTDIR)$(SHAREDIR)" + $(INSTALL) -m 0644 "../../data/RiceVideoLinux.ini" "$(DESTDIR)$(SHAREDIR)" + +uninstall: + $(RM) "$(DESTDIR)$(PLUGINDIR)/$(TARGET)" + $(RM) "$(DESTDIR)$(SHAREDIR)/RiceVideoLinux.ini" + +clean: + $(RM) -r $(OBJDIR) $(TARGET) + +rebuild: clean all + +# build dependency files +CFLAGS += -MD +-include $(OBJECTS:.o=.d) + +CXXFLAGS += $(CFLAGS) +ifeq ($(LTO), 1) + CFLAGS += -flto + CXXFLAGS += -flto + LDFLAGS += -fuse-linker-plugin $(CXXFLAGS) +endif + +# standard build rules +$(OBJDIR)/%.o: $(SRCDIR)/%.c + $(COMPILE.c) -o $@ $< + +$(OBJDIR)/%.o: $(SRCDIR)/%.cpp + $(COMPILE.cc) -o $@ $< + +$(TARGET): $(OBJECTS) + $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@ + +.PHONY: all clean install uninstall targets diff --git a/libmupen64plus/mupen64plus-video-rice/src/Blender.cpp b/libmupen64plus/mupen64plus-video-rice/src/Blender.cpp new file mode 100644 index 0000000000..6a720a8f63 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/Blender.cpp @@ -0,0 +1,405 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#include "Render.h" + +const char * sc_szBlClr[4] = { "In", "Mem", "Bl", "Fog" }; +const char * sc_szBlA1[4] = { "AIn", "AFog", "AShade", "0" }; +const char * sc_szBlA2[4] = { "1-A", "AMem", "1", "0" }; + +//======================================================================== +void CBlender::InitBlenderMode(void) // Set Alpha Blender mode +{ + //1. Z_COMPARE -- Enable / Disable Zbuffer compare + // 1 - Enable ZBuffer + // 0 - Disable ZBuffer + + //2. Z_UPDATE -- Enable / Disable Zbuffer update + // 1 - Enable ZBuffer writeable + // 0 - Zbuffer not writeable + + //3. AA_EN and IM_RD -- Anti-Alias + // AA_EN - Enable anti-aliase + // AA_EN | IM_RD - Reduced anti-aliase + // IM_RD - ?? + // - - Disable anti-aliase + + //4. ZMode + // #define ZMODE_OPA 0 -- Usually used with Z_COMPARE and Z_UPDATE + // or used without neither Z_COMPARE or Z_UPDATE + // if used with Z_COMPARE and Z_UPDATE, then this is + // the regular ZBuffer mode, with compare and update + // #define ZMODE_INTER 0x400 + // #define ZMODE_XLU 0x800 -- Usually used with Z_COMPARE, but not with Z_UPDATE + // Do only compare, no zbuffer update. + // Not output if the z value is the same + // #define ZMODE_DEC 0xc00 -- Usually used with Z_COMPARE, but not with Z_UPDATE + // Do only compare, no update, but because this is + // decal mode, so image should be updated even + // the z value is the same as compared. + + CRender *render = CRender::g_pRender; + + // Alpha Blender Modes + + /* +6. FORCE_BL - Alpha blending at blender stage + 1 - Enable alpha blending at blender + 0 - Disable alpha blending at blender + + Alpha blending at blender is usually used to render XLU surface + if enabled, then use the blending setting of C1 and C2 + +7. ALPHA_CVG_SEL - Output full alpha from the color combiner, usually not used together + with FORCE_BL. If it is used together with FORCE_BL, then ignore this + +8. CVG_X_ALPHA - Before output the color from color combiner, mod it with alpha + +9. TEX_EDGE - Ignore this + +10.CLR_ON_CVG - Used with XLU surfaces, ignore it + +11.CVG_DST +#define CVG_DST_CLAMP 0 - Usually used with OPA surface +#define CVG_DST_WRAP 0x100 - Usually used with XLU surface or OPA line +#define CVG_DST_FULL 0x200 - ? +#define CVG_DST_SAVE 0x300 - ? + + +Possible Blending Inputs: + + In - Input from color combiner + Mem - Input from current frame buffer + Fog - Fog generator + BL - Blender + +Possible Blending Factors: + A-IN - Alpha from color combiner + A-MEM - Alpha from current frame buffer + (1-A) - + A-FOG - Alpha of fog color + A-SHADE - Alpha of shade + 1 - 1 + 0 - 0 +*/ +#define BLEND_NOOP 0x0000 + +#define BLEND_NOOP5 0xcc48 // Fog * 0 + Mem * 1 +#define BLEND_NOOP4 0xcc08 // Fog * 0 + In * 1 +#define BLEND_FOG_ASHADE 0xc800 +#define BLEND_FOG_3 0xc000 // Fog * AIn + In * 1-A +#define BLEND_FOG_MEM 0xc440 // Fog * AFog + Mem * 1-A +#define BLEND_FOG_APRIM 0xc400 // Fog * AFog + In * 1-A + +#define BLEND_BLENDCOLOR 0x8c88 +#define BLEND_BI_AFOG 0x8400 // Bl * AFog + In * 1-A +#define BLEND_BI_AIN 0x8040 // Bl * AIn + Mem * 1-A + +#define BLEND_MEM 0x4c40 // Mem*0 + Mem*(1-0)?! +#define BLEND_FOG_MEM_3 0x44c0 // Mem * AFog + Fog * 1-A + +#define BLEND_NOOP3 0x0c48 // In * 0 + Mem * 1 +#define BLEND_PASS 0x0c08 // In * 0 + In * 1 +#define BLEND_FOG_MEM_IN_MEM 0x0440 // In * AFog + Mem * 1-A +#define BLEND_FOG_MEM_FOG_MEM 0x04c0 // In * AFog + Fog * 1-A +#define BLEND_OPA 0x0044 // In * AIn + Mem * AMem +#define BLEND_XLU 0x0040 +#define BLEND_MEM_ALPHA_IN 0x4044 // Mem * AIn + Mem * AMem + + + uint32 blendmode_1 = (uint32)( gRDP.otherMode.blender & 0xcccc ); + uint32 blendmode_2 = (uint32)( gRDP.otherMode.blender & 0x3333 ); + uint32 cycletype = gRDP.otherMode.cycle_type; + + switch( cycletype ) + { + case CYCLE_TYPE_FILL: + //BlendFunc(BLEND_ONE, BLEND_ZERO); + //Enable(); + Disable(); + break; + case CYCLE_TYPE_COPY: + //Disable(); + BlendFunc(BLEND_ONE, BLEND_ZERO); + Enable(); + break; + case CYCLE_TYPE_2: + if( gRDP.otherMode.force_bl && gRDP.otherMode.z_cmp ) + { + BlendFunc(BLEND_SRCALPHA, BLEND_INVSRCALPHA); + Enable(); + break; + } + + /* + if( gRDP.otherMode.alpha_cvg_sel && gRDP.otherMode.cvg_x_alpha==0 ) + { + BlendFunc(BLEND_ONE, BLEND_ZERO); + Enable(); + break; + } + */ + + switch( blendmode_1+blendmode_2 ) + { + case BLEND_PASS+(BLEND_PASS>>2): // In * 0 + In * 1 + case BLEND_FOG_APRIM+(BLEND_PASS>>2): + BlendFunc(BLEND_ONE, BLEND_ZERO); + if( gRDP.otherMode.alpha_cvg_sel ) + { + Enable(); + } + else + { + Disable(); + } + + render->SetAlphaTestEnable( ((gRDP.otherModeL >> RSP_SETOTHERMODE_SHIFT_ALPHACOMPARE) & 0x3)==1 ? TRUE : FALSE); + break; + case BLEND_PASS+(BLEND_OPA>>2): + // 0x0c19 + // Cycle1: In * 0 + In * 1 + // Cycle2: In * AIn + Mem * AMem + if( gRDP.otherMode.cvg_x_alpha && gRDP.otherMode.alpha_cvg_sel ) + { + BlendFunc(BLEND_SRCALPHA, BLEND_INVSRCALPHA); + Enable(); + } + else + { + BlendFunc(BLEND_ONE, BLEND_ZERO); + Enable(); + } + break; + case BLEND_PASS + (BLEND_XLU>>2): + // 0x0c18 + // Cycle1: In * 0 + In * 1 + // Cycle2: In * AIn + Mem * 1-A + case BLEND_FOG_ASHADE + (BLEND_XLU>>2): + //Cycle1: Fog * AShade + In * 1-A + //Cycle2: In * AIn + Mem * 1-A + case BLEND_FOG_APRIM + (BLEND_XLU>>2): + //Cycle1: Fog * AFog + In * 1-A + //Cycle2: In * AIn + Mem * 1-A + //case BLEND_FOG_MEM_FOG_MEM + (BLEND_OPA>>2): + //Cycle1: In * AFog + Fog * 1-A + //Cycle2: In * AIn + Mem * AMem + case BLEND_FOG_MEM_FOG_MEM + (BLEND_PASS>>2): + //Cycle1: In * AFog + Fog * 1-A + //Cycle2: In * 0 + In * 1 + case BLEND_XLU + (BLEND_XLU>>2): + //Cycle1: Fog * AFog + In * 1-A + //Cycle2: In * AIn + Mem * 1-A + case BLEND_BI_AFOG + (BLEND_XLU>>2): + //Cycle1: Bl * AFog + In * 1-A + //Cycle2: In * AIn + Mem * 1-A + case BLEND_XLU + (BLEND_FOG_MEM_IN_MEM>>2): + //Cycle1: In * AIn + Mem * 1-A + //Cycle2: In * AFog + Mem * 1-A + case BLEND_PASS + (BLEND_FOG_MEM_IN_MEM>>2): + //Cycle1: In * 0 + In * 1 + //Cycle2: In * AFog + Mem * 1-A + BlendFunc(BLEND_SRCALPHA, BLEND_INVSRCALPHA); + Enable(); + break; + case BLEND_FOG_MEM_FOG_MEM + (BLEND_OPA>>2): + //Cycle1: In * AFog + Fog * 1-A + //Cycle2: In * AIn + Mem * AMem + BlendFunc(BLEND_ONE, BLEND_ZERO); + Enable(); + break; + + case BLEND_FOG_APRIM + (BLEND_OPA>>2): + // For Golden Eye + //Cycle1: Fog * AFog + In * 1-A + //Cycle2: In * AIn + Mem * AMem + case BLEND_FOG_ASHADE + (BLEND_OPA>>2): + //Cycle1: Fog * AShade + In * 1-A + //Cycle2: In * AIn + Mem * AMem + case BLEND_BI_AFOG + (BLEND_OPA>>2): + //Cycle1: Bl * AFog + In * 1-A + //Cycle2: In * AIn + Mem * 1-AMem + case BLEND_FOG_ASHADE + (BLEND_NOOP>>2): + //Cycle1: Fog * AShade + In * 1-A + //Cycle2: In * AIn + In * 1-A + case BLEND_NOOP + (BLEND_OPA>>2): + //Cycle1: In * AIn + In * 1-A + //Cycle2: In * AIn + Mem * AMem + case BLEND_NOOP4 + (BLEND_NOOP>>2): + //Cycle1: Fog * AIn + In * 1-A + //Cycle2: In * 0 + In * 1 + case BLEND_FOG_ASHADE+(BLEND_PASS>>2): + //Cycle1: Fog * AShade + In * 1-A + //Cycle2: In * 0 + In * 1 + case BLEND_FOG_3+(BLEND_PASS>>2): + BlendFunc(BLEND_ONE, BLEND_ZERO); + Enable(); + break; + case BLEND_FOG_ASHADE+0x0301: + // c800 - Cycle1: Fog * AShade + In * 1-A + // 0301 - Cycle2: In * 0 + In * AMem + BlendFunc(BLEND_SRCALPHA, BLEND_ZERO); + Enable(); + break; + case 0x0c08+0x1111: + // 0c08 - Cycle1: In * 0 + In * 1 + // 1111 - Cycle2: Mem * AFog + Mem * AMem + BlendFunc(BLEND_ZERO, BLEND_DESTALPHA); + Enable(); + break; + default: +#ifdef DEBUGGER + if( pauseAtNext ) + { + uint32 dwM1A_1 = (gRDP.otherMode.blender>>14) & 0x3; + uint32 dwM1B_1 = (gRDP.otherMode.blender>>10) & 0x3; + uint32 dwM2A_1 = (gRDP.otherMode.blender>>6) & 0x3; + uint32 dwM2B_1 = (gRDP.otherMode.blender>>2) & 0x3; + + uint32 dwM1A_2 = (gRDP.otherMode.blender>>12) & 0x3; + uint32 dwM1B_2 = (gRDP.otherMode.blender>>8) & 0x3; + uint32 dwM2A_2 = (gRDP.otherMode.blender>>4) & 0x3; + uint32 dwM2B_2 = (gRDP.otherMode.blender ) & 0x3; + + TRACE0("Unknown Blender Mode: 2 cycle"); + DebuggerAppendMsg( "\tblender:\t\t%04x - Cycle1:\t%s * %s + %s * %s\n\t\t%04x - Cycle2:\t%s * %s + %s * %s", blendmode_1, + sc_szBlClr[dwM1A_1], sc_szBlA1[dwM1B_1], sc_szBlClr[dwM2A_1], sc_szBlA2[dwM2B_1], blendmode_2, + sc_szBlClr[dwM1A_2], sc_szBlA1[dwM1B_2], sc_szBlClr[dwM2A_2], sc_szBlA2[dwM2B_2]); + + } +#endif + if( blendmode_2 == (BLEND_PASS>>2) ) + { + BlendFunc(BLEND_ONE, BLEND_ZERO); + } + else + { + BlendFunc(BLEND_SRCALPHA, BLEND_INVSRCALPHA); + } + Enable(); + break; + } + break; + default: // 1/2 Cycle or Copy + if( gRDP.otherMode.force_bl && gRDP.otherMode.z_cmp && blendmode_1 != BLEND_FOG_ASHADE ) + { + BlendFunc(BLEND_SRCALPHA, BLEND_INVSRCALPHA); + Enable(); + break; + } + if( gRDP.otherMode.force_bl && options.enableHackForGames == HACK_FOR_COMMANDCONQUER ) + { + BlendFunc(BLEND_SRCALPHA, BLEND_INVSRCALPHA); + Enable(); + break; + } + +#ifdef DEBUGGER + //if( (blendmode_1>>2) != blendmode_2 ) + //{ + // DebuggerAppendMsg("Warning: in 1 cycle mode, blend1!=blend2"); + //} +#endif + + switch ( blendmode_1 ) + //switch ( blendmode_2<<2 ) + { + case BLEND_XLU: // IN * A_IN + MEM * (1-A_IN) + case BLEND_BI_AIN: // Bl * AIn + Mem * 1-A + case BLEND_FOG_MEM: // c440 - Cycle1: Fog * AFog + Mem * 1-A + case BLEND_FOG_MEM_IN_MEM: // c440 - Cycle1: In * AFog + Mem * 1-A + case BLEND_BLENDCOLOR: //Bl * 0 + Bl * 1 + case 0x00c0: //In * AIn + Fog * 1-A + BlendFunc(BLEND_SRCALPHA, BLEND_INVSRCALPHA); + Enable(); + break; + case BLEND_MEM_ALPHA_IN: // Mem * AIn + Mem * AMem + BlendFunc(BLEND_ZERO, BLEND_DESTALPHA); + Enable(); + break; + case BLEND_PASS: // IN * 0 + IN * 1 + BlendFunc(BLEND_ONE, BLEND_ZERO); + if( gRDP.otherMode.alpha_cvg_sel ) + { + Enable(); + } + else + { + Disable(); + } + break; + case BLEND_OPA: // IN * A_IN + MEM * A_MEM + if( options.enableHackForGames == HACK_FOR_MARIO_TENNIS ) + { + BlendFunc(BLEND_SRCALPHA, BLEND_INVSRCALPHA); + } + else + { + BlendFunc(BLEND_ONE, BLEND_ZERO); + } + Enable(); + break; + case BLEND_NOOP: // IN * A_IN + IN * (1 - A_IN) + case BLEND_FOG_ASHADE: // Fog * AShade + In * 1-A + case BLEND_FOG_MEM_3: // Mem * AFog + Fog * 1-A + case BLEND_BI_AFOG: // Bl * AFog + In * 1-A + BlendFunc(BLEND_ONE, BLEND_ZERO); + Enable(); + break; + case BLEND_FOG_APRIM: // Fog * AFog + In * 1-A + BlendFunc(BLEND_INVSRCALPHA, BLEND_ZERO); + Enable(); + break; + case BLEND_NOOP3: // In * 0 + Mem * 1 + case BLEND_NOOP5: // Fog * 0 + Mem * 1 + BlendFunc(BLEND_ZERO, BLEND_ONE); + Enable(); + break; + case BLEND_MEM: // Mem * 0 + Mem * 1-A + // WaveRace + BlendFunc(BLEND_ZERO, BLEND_ONE); + Enable(); + break; + default: +#ifdef DEBUGGER + if( pauseAtNext ) + { + uint32 dwM1A_1 = (gRDP.otherMode.blender>>14) & 0x3; + uint32 dwM1B_1 = (gRDP.otherMode.blender>>10) & 0x3; + uint32 dwM2A_1 = (gRDP.otherMode.blender>>6) & 0x3; + uint32 dwM2B_1 = (gRDP.otherMode.blender>>2) & 0x3; + + uint32 dwM1A_2 = (gRDP.otherMode.blender>>12) & 0x3; + uint32 dwM1B_2 = (gRDP.otherMode.blender>>8) & 0x3; + uint32 dwM2A_2 = (gRDP.otherMode.blender>>4) & 0x3; + uint32 dwM2B_2 = (gRDP.otherMode.blender ) & 0x3; + + TRACE0("Unknown Blender Mode: 1 cycle"); + DebuggerAppendMsg( "\tblender:\t\t%04x - Cycle1:\t%s * %s + %s * %s\n\t\t\tCycle2:\t%s * %s + %s * %s", blendmode_1, + sc_szBlClr[dwM1A_1], sc_szBlA1[dwM1B_1], sc_szBlClr[dwM2A_1], sc_szBlA2[dwM2B_1], + sc_szBlClr[dwM1A_2], sc_szBlA1[dwM1B_2], sc_szBlClr[dwM2A_2], sc_szBlA2[dwM2B_2]); + } +#endif + BlendFunc(BLEND_SRCALPHA, BLEND_INVSRCALPHA); + Enable(); + render->SetAlphaTestEnable(TRUE); + break; + } + } +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/Blender.h b/libmupen64plus/mupen64plus-video-rice/src/Blender.h new file mode 100644 index 0000000000..9ea3ec0249 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/Blender.h @@ -0,0 +1,67 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#ifndef _BLENDER_H_ +#define _BLENDER_H_ + +#include "typedefs.h" + +class CRender; + +class CBlender +{ +public: + virtual ~CBlender() {} + + virtual void InitBlenderMode(void); + virtual void NormalAlphaBlender(void)=0; + virtual void DisableAlphaBlender(void)=0; + + virtual void BlendFunc(uint32 srcFunc, uint32 desFunc)=0; + + virtual void Enable()=0; + virtual void Disable()=0; +protected: + CBlender(CRender *pRender) : m_pRender(pRender) {} + CRender *m_pRender; +}; + +typedef enum _BLEND +{ + BLEND_ZERO = 1, + BLEND_ONE = 2, + BLEND_SRCCOLOR = 3, + BLEND_INVSRCCOLOR = 4, + BLEND_SRCALPHA = 5, + BLEND_INVSRCALPHA = 6, + BLEND_DESTALPHA = 7, + BLEND_INVDESTALPHA = 8, + BLEND_DESTCOLOR = 9, + BLEND_INVDESTCOLOR = 10, + BLEND_SRCALPHASAT = 11, + BLEND_BOTHSRCALPHA = 12, + BLEND_BOTHINVSRCALPHA = 13, + BLEND_BLENDFACTOR = 14, + BLEND_INVBLENDFACTOR = 15, + BLEND_FORCE_DWORD = 0x7fffffff +} BLEND; + +#endif + + + diff --git a/libmupen64plus/mupen64plus-video-rice/src/CNvTNTCombiner.cpp b/libmupen64plus/mupen64plus-video-rice/src/CNvTNTCombiner.cpp new file mode 100644 index 0000000000..c79b4a241d --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/CNvTNTCombiner.cpp @@ -0,0 +1,325 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#include + +#include "CNvTNTCombiner.h" + +CNvTNTCombiner::CNvTNTCombiner() +{ + m_lastIndexTNT = 0; +} + +CNvTNTCombiner::~CNvTNTCombiner() +{ +} + + +int CNvTNTCombiner::FindCompiledMux( ) +{ + for( uint32 i=0; im_dwMux0 && m_vCompiledTNTSettings[i].dwMux1 == (*m_ppDecodedMux)->m_dwMux1 ) + { + m_lastIndexTNT = i; + return i; + } + } + + return -1; +} + +bool isTex(uint32 val); +bool isComb(uint32 val); + +int CNvTNTCombiner::ParseDecodedMux() +{ + TNT2CombinerSaveType res; + res.numOfUnits = 2; + + (*m_ppDecodedMux)->To_AB_Add_CD_Format(); + + for( int i=0; isplitType[i]; + N64CombinerType &m = (*m_ppDecodedMux)->m_n64Combiners[i]; + + comb.arg0 = comb.arg1 = comb.arg2 = comb.arg3 = MUX_0; + unit.ops[i%2] = 0x0104; //Add; + //Subtract + + switch( type ) + { + case CM_FMT_TYPE_NOT_USED: + comb.arg0 = MUX_COMBINED; + comb.arg1 = MUX_1; + comb.arg2 = MUX_0; + comb.arg3 = MUX_1; + case CM_FMT_TYPE_D: // = A + comb.arg0 = m.d; + comb.arg1 = MUX_1; + comb.arg2 = MUX_0; + comb.arg3 = MUX_0; + break; + case CM_FMT_TYPE_A_ADD_D: // = A+D + comb.arg0 = m.a; + comb.arg1 = MUX_1; + comb.arg2 = m.d; + comb.arg3 = MUX_1; + if( isComb(m.d) ) + { + swap(comb.arg0, comb.arg2); + swap(comb.arg1, comb.arg3); + } + break; + case CM_FMT_TYPE_A_SUB_B: // = A-B + comb.arg0 = m.a^MUX_COMPLEMENT; + comb.arg1 = MUX_1; + unit.ops[i%2] = GL_SUBTRACT_ARB; + comb.arg2 = m.b; + comb.arg3 = MUX_1; + break; + case CM_FMT_TYPE_A_MOD_C: // = A*C + comb.arg0 = m.a; + comb.arg1 = m.c; + comb.arg2 = MUX_0; + comb.arg3 = MUX_0; + break; + case CM_FMT_TYPE_A_MOD_C_ADD_D: // = A*C+D + comb.arg0 = m.a; + comb.arg1 = m.c; + comb.arg2 = m.d; + comb.arg3 = MUX_1; + if( isComb(m.d) ) + { + swap(comb.arg0, comb.arg2); + swap(comb.arg1, comb.arg3); + } + break; + case CM_FMT_TYPE_A_LERP_B_C: // = (A-B)*C+B + comb.arg0 = m.a; + comb.arg1 = m.c; + comb.arg2 = m.c^MUX_COMPLEMENT; + comb.arg3 = m.b; + if( isComb(m.b) ) + { + swap(comb.arg0, comb.arg2); + swap(comb.arg1, comb.arg3); + } + break; + case CM_FMT_TYPE_A_SUB_B_ADD_D: // = A-B+D + // fix me, to use 2 texture units + if( isTex(m.b) && isTex(m.d) ) + { + comb.arg0 = m.a; + comb.arg1 = m.b; + comb.arg2 = m.d; + comb.arg3 = MUX_1; + if( isComb(m.d) ) + { + swap(comb.arg0, comb.arg2); + swap(comb.arg1, comb.arg3); + } + } + else if( isTex(m.b) && !isComb(m.d) ) + { + comb.arg0 = m.a^MUX_COMPLEMENT; + comb.arg1 = MUX_1; + comb.arg2 = m.b; + comb.arg3 = MUX_1; + unit.ops[i%2] = GL_SUBTRACT_ARB; + } + else if( !isTex(m.b) && isTex(m.d) ) + { + comb.arg0 = m.a; + comb.arg1 = MUX_1; + comb.arg2 = m.d; + comb.arg3 = MUX_1; + if( isComb(m.d) ) + { + swap(comb.arg0, comb.arg2); + swap(comb.arg1, comb.arg3); + } + } + else + { + comb.arg0 = m.a; + comb.arg1 = m.b; + comb.arg2 = m.d; + comb.arg3 = MUX_1; + if( isComb(m.d) ) + { + swap(comb.arg0, comb.arg2); + swap(comb.arg1, comb.arg3); + } + } + break; + case CM_FMT_TYPE_A_SUB_B_MOD_C: // = (A-B)*C + comb.arg0 = m.a^MUX_COMPLEMENT; + comb.arg1 = m.c; + comb.arg2 = m.c; + comb.arg3 = m.b; + unit.ops[i%2] = GL_SUBTRACT_ARB; + break; + case CM_FMT_TYPE_AB_ADD_CD: // = AB+CD + comb.arg0 = m.a; + comb.arg1 = m.b; + comb.arg2 = m.c; + comb.arg3 = m.d; + if( isComb(m.d) || isComb(m.c) ) + { + swap(comb.arg0, comb.arg2); + swap(comb.arg1, comb.arg3); + } + + break; + case CM_FMT_TYPE_AB_SUB_CD: // = AB-CD + comb.arg0 = m.a^MUX_COMPLEMENT; + comb.arg1 = m.b; + unit.ops[i%2] = GL_SUBTRACT_ARB; + comb.arg2 = m.c; + comb.arg3 = m.d; + break; + case CM_FMT_TYPE_A_B_C_D: // = (A-B)*C+D + default: + if( !isComb(m.d) && !isTex(m.d) ) + { + comb.arg0 = m.a^MUX_COMPLEMENT; + comb.arg1 = m.c; + unit.ops[i%2] = GL_SUBTRACT_ARB; + comb.arg2 = m.c; + comb.arg3 = m.b; + } + else if( !isComb(m.b) && !isTex(m.b) ) + { + comb.arg0 = m.a; + comb.arg1 = m.c; + comb.arg2 = m.d; + comb.arg3 = MUX_1; + if( isComb(m.d) ) + { + swap(comb.arg0, comb.arg2); + swap(comb.arg1, comb.arg3); + } + } + else if( !isComb(m.c) && !isTex(m.c) ) + { + comb.arg0 = m.a; + comb.arg1 = m.b; + comb.arg2 = m.d; + comb.arg3 = MUX_1; + if( isComb(m.d) ) + { + swap(comb.arg0, comb.arg2); + swap(comb.arg1, comb.arg3); + } + } + else + { + comb.arg0 = m.a; + comb.arg1 = m.c; + comb.arg2 = m.d; + comb.arg3 = MUX_1; + if( isComb(m.d) ) + { + swap(comb.arg0, comb.arg2); + swap(comb.arg1, comb.arg3); + } + } + break; + } + } + + ParseDecodedMuxForConstants(res); + return SaveParserResult(res); +} + +int CNvTNTCombiner::SaveParserResult(TNT2CombinerSaveType &result) +{ + result.dwMux0 = (*m_ppDecodedMux)->m_dwMux0; + result.dwMux1 = (*m_ppDecodedMux)->m_dwMux1; + + m_vCompiledTNTSettings.push_back(result); + m_lastIndexTNT = m_vCompiledTNTSettings.size()-1; + +#ifdef DEBUGGER + if( logCombiners ) + { + DisplaySimpleMuxString(); + } +#endif + + return m_lastIndexTNT; +} + +void CNvTNTCombiner::ParseDecodedMuxForConstants(TNT2CombinerSaveType &res) +{ + res.unit1.constant = MUX_0; + res.unit2.constant = MUX_0; + + for( int i=0; i<2; i++ ) + { + if( (*m_ppDecodedMux)->isUsedInCycle(MUX_PRIM, i,COLOR_CHANNEL) || (*m_ppDecodedMux)->isUsedInCycle(MUX_PRIM, i,ALPHA_CHANNEL) ) + { + res.units[i].constant = MUX_PRIM; + } + else if( (*m_ppDecodedMux)->isUsedInCycle(MUX_ENV, i,COLOR_CHANNEL) || (*m_ppDecodedMux)->isUsedInCycle(MUX_ENV, i,ALPHA_CHANNEL) ) + { + res.units[i].constant = MUX_ENV; + } + else if( (*m_ppDecodedMux)->isUsedInCycle(MUX_LODFRAC, i,COLOR_CHANNEL) || (*m_ppDecodedMux)->isUsedInCycle(MUX_LODFRAC, i,ALPHA_CHANNEL) ) + { + res.units[i].constant = MUX_LODFRAC; + } + else if( (*m_ppDecodedMux)->isUsedInCycle(MUX_PRIMLODFRAC, i,COLOR_CHANNEL) || (*m_ppDecodedMux)->isUsedInCycle(MUX_PRIMLODFRAC, i,ALPHA_CHANNEL) ) + { + res.units[i].constant = MUX_PRIMLODFRAC; + } + } +} + +#ifdef DEBUGGER +extern const char *translatedCombTypes[]; +void CNvTNTCombiner::DisplaySimpleMuxString() +{ + char buf0[30]; + char buf1[30]; + char buf2[30]; + char buf3[30]; + + TNT2CombinerSaveType &result = m_vCompiledTNTSettings[m_lastIndexTNT]; + + TRACE0("\nNVidia TNT2+ Combiner\n"); + DebuggerAppendMsg("//aRGB0:\t(%s * %s) %s (%s * %s)\n", DecodedMux::FormatStr(result.unit1.rgbArg0,buf0), DecodedMux::FormatStr(result.unit1.rgbArg1,buf1), result.unit1.rgbOp==0x0104?"+":"-", DecodedMux::FormatStr(result.unit1.rgbArg2,buf2), DecodedMux::FormatStr(result.unit1.rgbArg3,buf3)); + DebuggerAppendMsg("//aRGB1:\t(%s * %s) %s (%s * %s)\n", DecodedMux::FormatStr(result.unit2.rgbArg0,buf0), DecodedMux::FormatStr(result.unit2.rgbArg1,buf1), result.unit2.rgbOp==0x0104?"+":"-", DecodedMux::FormatStr(result.unit2.rgbArg2,buf2), DecodedMux::FormatStr(result.unit2.rgbArg3,buf3)); + DebuggerAppendMsg("//aAlpha0:\t(%s * %s) %s (%s * %s)\n", DecodedMux::FormatStr(result.unit1.alphaArg0,buf0), DecodedMux::FormatStr(result.unit1.alphaArg1,buf1), result.unit1.alphaOp==0x0104?"+":"-", DecodedMux::FormatStr(result.unit1.alphaArg2,buf2), DecodedMux::FormatStr(result.unit1.alphaArg3,buf3)); + DebuggerAppendMsg("//aAlpha1:\t(%s * %s) %s (%s * %s)\n", DecodedMux::FormatStr(result.unit2.alphaArg0,buf0), DecodedMux::FormatStr(result.unit2.alphaArg1,buf1), result.unit2.alphaOp==0x0104?"+":"-", DecodedMux::FormatStr(result.unit2.alphaArg2,buf2), DecodedMux::FormatStr(result.unit2.alphaArg3,buf3)); + if( result.unit1.constant != MUX_0 ) + DebuggerAppendMsg("//Constant for unit 1:\t%s\n", DecodedMux::FormatStr(result.unit1.constant,buf0)); + if( result.unit2.constant != MUX_0 ) + DebuggerAppendMsg("//Constant for unit 2:\t%s\n", DecodedMux::FormatStr(result.unit2.constant,buf0)); + TRACE0("\n\n"); +} +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/CNvTNTCombiner.h b/libmupen64plus/mupen64plus-video-rice/src/CNvTNTCombiner.h new file mode 100644 index 0000000000..13da609796 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/CNvTNTCombiner.h @@ -0,0 +1,94 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#ifndef _NVIDIA_TNT_COMBINER_H_ +#define _NVIDIA_TNT_COMBINER_H_ + +#include + +#include "Combiner.h" + +typedef struct +{ + uint8 arg0; + uint8 arg1; + uint8 arg2; + uint8 arg3; +} TNT2CombType; + +typedef struct { + union { + struct { + unsigned int rgbOp; + unsigned int alphaOp; + }; + unsigned int ops[2]; + }; + + union { + struct { + uint8 rgbArg0; + uint8 rgbArg1; + uint8 rgbArg2; + uint8 rgbArg3; + uint8 alphaArg0; + uint8 alphaArg1; + uint8 alphaArg2; + uint8 alphaArg3; + }; + TNT2CombType Combs[2]; + uint8 args[2][4]; + }; + + int constant; +} TNT2CombinerType; + +typedef struct { + uint32 dwMux0; + uint32 dwMux1; + union { + struct { + TNT2CombinerType unit1; + TNT2CombinerType unit2; + }; + TNT2CombinerType units[2]; + }; + int numOfUnits; +} TNT2CombinerSaveType; + +class CNvTNTCombiner +{ +protected: + CNvTNTCombiner(); + virtual ~CNvTNTCombiner(); + + int FindCompiledMux(); + int ParseDecodedMux(); // Compile the decodedMux into NV register combiner setting + virtual void ParseDecodedMuxForConstants(TNT2CombinerSaveType &res); + int SaveParserResult(TNT2CombinerSaveType &result); + +#ifdef DEBUGGER + void DisplaySimpleMuxString(); +#endif + std::vector m_vCompiledTNTSettings; + int m_lastIndexTNT; + DecodedMux **m_ppDecodedMux; +}; + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/COLOR.h b/libmupen64plus/mupen64plus-video-rice/src/COLOR.h new file mode 100644 index 0000000000..cc1e4e38cf --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/COLOR.h @@ -0,0 +1,84 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - COLOR.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Rice1964 * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef XCOLOR_H +#define XCOLOR_H + +typedef struct _COLORVALUE +{ + float r; + float g; + float b; + float a; +} COLORVALUE; + + +typedef struct XCOLOR { + float r, g, b, a; +#ifdef __cplusplus +public: + XCOLOR() + { + } + + XCOLOR( unsigned int argb ); + XCOLOR( const float * ); + XCOLOR( const COLORVALUE& ); + XCOLOR( float r, float g, float b, float a ); + + // casting + operator unsigned int () const; + + operator float* (); + operator const float* () const; + + operator COLORVALUE* (); + operator const COLORVALUE* () const; + + operator COLORVALUE& (); + operator const COLORVALUE& () const; + + // assignment operators + XCOLOR& operator += ( const XCOLOR& ); + XCOLOR& operator -= ( const XCOLOR& ); + XCOLOR& operator *= ( float ); + XCOLOR& operator /= ( float ); + + // unary operators + XCOLOR operator + () const; + XCOLOR operator - () const; + + // binary operators + XCOLOR operator + ( const XCOLOR& ) const; + XCOLOR operator - ( const XCOLOR& ) const; + XCOLOR operator * ( float ) const; + XCOLOR operator / ( float ) const; + + friend XCOLOR operator * (float, const XCOLOR& ); + + bool operator == ( const XCOLOR& ) const; + bool operator != ( const XCOLOR& ) const; + +#endif //__cplusplus +} XCOLOR; + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/CSortedList.h b/libmupen64plus/mupen64plus-video-rice/src/CSortedList.h new file mode 100644 index 0000000000..91fa9fa3a9 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/CSortedList.h @@ -0,0 +1,164 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#ifndef _SORTED_LIST_H_ +#define _SORTED_LIST_H_ + +#include + +template +class CSortedList +{ +private: + Key *keys; + Element *elements; + int curSize; + int maxSize; + +public: + CSortedList(int size=1000) + { + maxSize = size; + curSize = 0; + keys = new Key[size]; + elements = new Element[size]; + } + + ~CSortedList() + { + delete [] keys; + delete [] elements; + } + + int size() + { + return curSize; + } + + void clear() + { + curSize = 0; + } + + void add(Key key, Element ele) + { + int i = find(key); + if( i >= 0 ) + { + elements[i] = ele; + return; + } + + if( curSize == maxSize ) + { + // Need to increase maxSize + Key *oldkeys = keys; + Element *oldelements = elements; + int oldmaxsize = maxSize; + maxSize *= 2; + + keys = new Key[maxSize]; + elements = new Element[maxSize]; + std::memcpy(keys,oldkeys,oldmaxsize*sizeof(Key)); + std::memcpy(elements,oldelements,oldmaxsize*sizeof(Element)); + } + + for( i=0; i key ) + { + // Found the spot + break; + } + } + + for( int j=curSize; j>i; j-- ) + { + keys[j] = keys[j-1]; + elements[j] = elements[j-1]; + } + + keys[i] = key; + elements[i] = ele; + curSize++; + } + + Element operator[](int index) + { + if( index >= curSize ) + index = curSize-1; + else if( index < 0 ) + index = 0; + + return elements[index]; + } + + Element get(Key key) + { + int index = Find(key); + return this->operator[](index); + } + + // Binary search + int find(Key key) + { + if( curSize <= 0 ) + return -1; + + int dwMin = 0; + int dwMax = curSize - 1; + int index = -1; + + int dwRange; + int dwIndex; + + while (true) + { + dwRange = dwMax - dwMin; + dwIndex = dwMin + (dwRange/2); + + if( keys[dwIndex] == key ) + { + index = dwIndex; + break; + } + + // If the range is 0, and we didn't match above, then it must be unmatched + if (dwRange == 0) + break; + + // If lower, check from min..index + // If higher, check from index..max + if (key < keys[dwIndex]) + { + // Lower + dwMax = dwIndex; + } + else + { + // Higher + dwMin = dwIndex + 1; + } + } + + return index; + } +}; + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/Combiner.cpp b/libmupen64plus/mupen64plus-video-rice/src/Combiner.cpp new file mode 100644 index 0000000000..bc121c6f0f --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/Combiner.cpp @@ -0,0 +1,465 @@ +/* +Copyright (C) 2002 Rice1964 + +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. + +*/ + +#include "Combiner.h" +#include "Config.h" +#include "RenderBase.h" + +//static BOOL g_bHiliteRGBAHack = FALSE; + + +#ifdef DEBUGGER +const char *constStrs[] = { + "MUX_0", + "MUX_1", + "MUX_COMBINED", + "MUX_TEXEL0", + "MUX_TEXEL1", + "MUX_PRIM", + "MUX_SHADE", + "MUX_ENV", + "MUX_COMBALPHA", + "MUX_T0_ALPHA", + "MUX_T1_ALPHA", + "MUX_PRIM_ALPHA", + "MUX_SHADE_ALPHA", + "MUX_ENV_ALPHA", + "MUX_LODFRAC", + "MUX_PRIMLODFRAC", + "MUX_K5", + "MUX_UNK", +}; + +const char *cycleTypeStrs[] = { + "1 Cycle", + "2 Cycle", + "Copy Mode", + "Fill Mode" +}; + +const char* constStr(uint32 op) +{ +if(op<=MUX_UNK) + return constStrs[op]; +else + return "Invalid-Const"; +} +#endif + +void swap(uint8 &a, uint8 &b) +{ + uint8 c=a; + a=b; + b=c; +} + + +//======================================================================== + +//======================================================================== + +inline IColor GetIColor(uint8 flag, uint32 curCol) +{ + IColor newc; + switch(flag&MUX_MASK) + { + case MUX_0: + newc = 0; + break; + case MUX_1: + newc = 0xFFFFFFFF; + break; + case MUX_PRIM: + newc = gRDP.primitiveColor; + break; + case MUX_ENV: + newc = gRDP.envColor; + break; + case MUX_COMBINED: + case MUX_SHADE: + newc = curCol; + break; + case MUX_K5: + newc = 0xFFFFFFFF; + break; + case MUX_UNK: + newc = curCol; + if( options.enableHackForGames == HACK_FOR_CONKER ) + newc = 0xFFFFFFFF; + break; + default: + newc = curCol; + break; + } + + if( flag&MUX_COMPLEMENT ) + { + newc.Complement(); + } + + if( flag&MUX_ALPHAREPLICATE ) + { + newc.AlphaReplicate(); + } + + return newc; +} + +COLOR CalculateConstFactor(uint32 colorOp, uint32 alphaOp, uint32 curCol) +{ + N64CombinerType m; + IColor color(curCol); + IColor alpha(curCol); + + // For color channel + *(uint32*)&m = colorOp; + if( m.c != MUX_0 && m.a!=m.b) + { + if( m.a != MUX_0 ) color = GetIColor(m.a, curCol); + if( m.b != MUX_0 ) color -= GetIColor(m.b, curCol); + if( m.c != MUX_1 ) color *= GetIColor(m.c, curCol); + } + if( m.d != MUX_0 ) color += GetIColor(m.d, curCol); + + // For alpha channel + *(uint32*)&m = alphaOp; + if( m.c != MUX_0 && m.a!=m.b) + { + if( m.a != MUX_0 ) alpha = GetIColor(m.a, curCol); + if( m.b != MUX_0 ) alpha -= GetIColor(m.b, curCol); + if( m.c != MUX_1 ) alpha *= GetIColor(m.c, curCol); + } + if( m.d != MUX_0 ) alpha += GetIColor(m.d, curCol); + + return (COLOR)(((uint32)color&0x00FFFFFF)|((uint32)alpha&0xFF000000)); +} + + +COLOR CColorCombiner::GetConstFactor(uint32 colorFlag, uint32 alphaFlag, uint32 defaultColor) +{ + // Allows a combine mode to select what TFACTOR should be + uint32 color = defaultColor; + uint32 alpha = defaultColor; + + switch (colorFlag&MUX_MASK) + { + case MUX_0: + break; + case MUX_FORCE_0: + color = 0; + break; + case MUX_1: + color = 0xFFFFFFFF; + break; + case MUX_PRIM: + color = gRDP.primitiveColor; + break; + case MUX_ENV: + color = gRDP.envColor; + break; + case MUX_LODFRAC: + color = COLOR_RGBA(gRDP.LODFrac, gRDP.LODFrac, gRDP.LODFrac, gRDP.LODFrac); + break; + case MUX_PRIMLODFRAC: + color = COLOR_RGBA(gRDP.primLODFrac, gRDP.primLODFrac, gRDP.primLODFrac, gRDP.primLODFrac); + break; + case MUX_PRIM_ALPHA: + { + IColor col(gRDP.primitiveColor); + col.AlphaReplicate(); + color = (COLOR)col; + } + break; + case MUX_ENV_ALPHA: + { + IColor col(gRDP.envColor); + col.AlphaReplicate(); + color = (COLOR)col; + } + break; + case MUX_K5: + color = 0xFFFFFFFF; + break; + case MUX_UNK: + color = defaultColor; + if( options.enableHackForGames == HACK_FOR_CONKER ) color = 0xFFFFFFFF; + break; + default: + color = defaultColor; + break; + } + + if( colorFlag & MUX_COMPLEMENT ) + { + color = 0xFFFFFFFF - color; + } + if( colorFlag & MUX_ALPHAREPLICATE ) + { + color = color>>24; + color = color | (color<<8) | (color <<16) | (color<<24); + } + + color &= 0x00FFFFFF; // For color channel only, not the alpha channel + + + switch (alphaFlag&MUX_MASK) + { + case MUX_0: + break; + case MUX_FORCE_0: + alpha = 0; + break; + case MUX_1: + alpha = 0xFFFFFFFF; + break; + case MUX_PRIM: + alpha = gRDP.primitiveColor; + break; + case MUX_ENV: + alpha = gRDP.envColor; + break; + case MUX_LODFRAC: + alpha = COLOR_RGBA(gRDP.LODFrac, gRDP.LODFrac, gRDP.LODFrac, gRDP.LODFrac); + break; + case MUX_PRIMLODFRAC: + alpha = COLOR_RGBA(gRDP.primLODFrac, gRDP.primLODFrac, gRDP.primLODFrac, gRDP.primLODFrac); + break; + case MUX_PRIM_ALPHA: + { + IColor col(gRDP.primitiveColor); + col.AlphaReplicate(); + alpha = (COLOR)col; + } + break; + case MUX_ENV_ALPHA: + { + IColor col(gRDP.envColor); + col.AlphaReplicate(); + alpha = (COLOR)col; + } + break; + default: + alpha = defaultColor; + break; + } + + if( alphaFlag & MUX_COMPLEMENT ) + { + alpha = 0xFFFFFFFF - alpha; + } + + alpha &= 0xFF000000; + + return (color|alpha); +} + +//***************************************************************************** +// +//***************************************************************************** +bool gUsingPrimColour = false; +bool gUsingEnvColour = false; + +int CountTexel1Cycle(N64CombinerType &m) +{ + int hasTexel[2]; + uint8 *p = (uint8*)&m; + + for( int i=0; i<2; i++) + { + hasTexel[i]=0; + for( int j=0; j<4; j++) + { + if( (p[j]&MUX_MASK) == MUX_TEXEL0+i ) + { + hasTexel[i]=1; + break; + } + } + } + + return hasTexel[0]+hasTexel[1]; +} + +uint32 GetTexelNumber(N64CombinerType &m) +{ + if( (m.a&MUX_MASK) == MUX_TEXEL1 || (m.b&MUX_MASK) == MUX_TEXEL1 || (m.c&MUX_MASK) == MUX_TEXEL1 || (m.d&MUX_MASK) == MUX_TEXEL1 ) + return TEX_1; + else + return TEX_0; +} + +bool IsTxtrUsed(N64CombinerType &m) +{ + if( (m.a&MUX_MASK) == MUX_TEXEL1 || (m.b&MUX_MASK) == MUX_TEXEL1 || (m.c&MUX_MASK) == MUX_TEXEL1 || (m.d&MUX_MASK) == MUX_TEXEL1 ) + return true; + if( (m.a&MUX_MASK) == MUX_TEXEL0 || (m.b&MUX_MASK) == MUX_TEXEL0 || (m.c&MUX_MASK) == MUX_TEXEL0 || (m.d&MUX_MASK) == MUX_TEXEL0 ) + return true; + else + return false; +} + +//======================================================================== + +void CColorCombiner::InitCombinerMode(void) +{ +#ifdef DEBUGGER + LOG_UCODE(cycleTypeStrs[gRDP.otherMode.cycle_type]); + if( debuggerDropDecodedMux ) + { + UpdateCombiner(m_pDecodedMux->m_dwMux0, m_pDecodedMux->m_dwMux1); + } +#endif + + if( currentRomOptions.bNormalCombiner ) + { + DisableCombiner(); + } + else if( gRDP.otherMode.cycle_type == CYCLE_TYPE_COPY ) + { + InitCombinerCycleCopy(); + m_bCycleChanged = true; + } + else if ( gRDP.otherMode.cycle_type == CYCLE_TYPE_FILL ) + //else if ( gRDP.otherMode.cycle_type == CYCLE_TYPE_FILL && gRSP.ucode != 5 ) //hack + { + InitCombinerCycleFill(); + m_bCycleChanged = true; + } + else + { + InitCombinerCycle12(); + m_bCycleChanged = false; + } +} + + +bool bConkerHideShadow=false; +void CColorCombiner::UpdateCombiner(uint32 dwMux0, uint32 dwMux1) +{ +#ifdef DEBUGGER + if( debuggerDropDecodedMux ) + { + debuggerDropDecodedMux = false; + m_pDecodedMux->m_dwMux0 = m_pDecodedMux->m_dwMux1 = 0; + m_DecodedMuxList.clear(); + } +#endif + + DecodedMux &m_decodedMux = *m_pDecodedMux; + if( m_decodedMux.m_dwMux0 != dwMux0 || m_decodedMux.m_dwMux1 != dwMux1 ) + { + if( options.enableHackForGames == HACK_FOR_DR_MARIO ) + { + // Hack for Dr. Mario + if( dwMux1 == 0xfffcf239 && + ((m_decodedMux.m_dwMux0 == dwMux0 && dwMux0 == 0x00ffffff && + m_decodedMux.m_dwMux1 != dwMux1 && m_decodedMux.m_dwMux1 == 0xfffcf279 ) || + (m_decodedMux.m_dwMux0 == 0x00ffb3ff && m_decodedMux.m_dwMux1 == 0xff64fe7f && dwMux0 == 0x00ffffff ) )) + { + //dwMux1 = 0xffcf23A; + dwMux1 = 0xfffcf438; + } + } + uint64 mux64 = (((uint64)dwMux1)<<32)+dwMux0; + int index=m_DecodedMuxList.find(mux64); + + if( options.enableHackForGames == HACK_FOR_CONKER ) + { + // Conker's shadow, to disable the shadow + //Mux=0x00ffe9ff Used in CONKER BFD + //Color0: (0 - 0) * 0 + SHADE + //Color1: (0 - 0) * 0 + SHADE + //Alpha0: (1 - TEXEL0) * SHADE + 0 + //Alpha1: (1 - TEXEL0) * SHADE + 0 + if( dwMux1 == 0xffd21f0f && dwMux0 == 0x00ffe9ff ) + { + bConkerHideShadow = true; + } + else + { + bConkerHideShadow = false; + } + } + + if( index >= 0 ) + { + m_decodedMux = m_DecodedMuxList[index]; + } + else + { + m_decodedMux.Decode(dwMux0, dwMux1); + m_decodedMux.splitType[0] = CM_FMT_TYPE_NOT_CHECKED; + m_decodedMux.splitType[1] = CM_FMT_TYPE_NOT_CHECKED; + m_decodedMux.splitType[2] = CM_FMT_TYPE_NOT_CHECKED; + m_decodedMux.splitType[3] = CM_FMT_TYPE_NOT_CHECKED; + + m_decodedMux.Hack(); + + if( !m_bSupportMultiTexture ) + { + m_decodedMux.ReplaceVal(MUX_TEXEL1, MUX_TEXEL0); + m_decodedMux.ReplaceVal(MUX_LODFRAC,1); + m_decodedMux.ReplaceVal(MUX_PRIMLODFRAC,1); + } + + m_decodedMux.Simplify(); + if( m_supportedStages>1) + m_decodedMux.SplitComplexStages(); + + m_DecodedMuxList.add(m_decodedMux.m_u64Mux, *m_pDecodedMux); +#ifdef DEBUGGER + if( logCombiners ) + { + TRACE0("Add a new mux"); + DisplayMuxString(); + } +#endif + } + + m_bTex0Enabled = m_decodedMux.m_bTexel0IsUsed; + m_bTex1Enabled = m_decodedMux.m_bTexel1IsUsed; + m_bTexelsEnable = m_bTex0Enabled||m_bTex1Enabled; + + gRSP.bProcessDiffuseColor = (m_decodedMux.m_dwShadeColorChannelFlag != MUX_0 || m_decodedMux.m_dwShadeAlphaChannelFlag != MUX_0); + gRSP.bProcessSpecularColor = false; + } +} + + +#ifdef DEBUGGER +void CColorCombiner::DisplayMuxString(void) +{ + if( gRDP.otherMode.cycle_type == CYCLE_TYPE_COPY) + { + TRACE0("COPY Mode\n"); + } + else if( gRDP.otherMode.cycle_type == CYCLE_TYPE_FILL) + { + TRACE0("FILL Mode\n"); + } + + m_pDecodedMux->DisplayMuxString("Used"); +} + +void CColorCombiner::DisplaySimpleMuxString(void) +{ + m_pDecodedMux->DisplaySimpliedMuxString("Used"); +} +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/Combiner.h b/libmupen64plus/mupen64plus-video-rice/src/Combiner.h new file mode 100644 index 0000000000..d1a6c819aa --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/Combiner.h @@ -0,0 +1,103 @@ +/* +Copyright (C) 2002 Rice1964 + +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. + +*/ + +#ifndef _COMBINER_H_ +#define _COMBINER_H_ + +#include "typedefs.h" +#include "CombinerDefs.h" +#include "CSortedList.h" +#include "DecodedMux.h" + +class CRender; + +extern const char* cycleTypeStrs[]; + +class CColorCombiner +{ + friend class CRender; +public: + virtual ~CColorCombiner() {}; + COLOR GetConstFactor(uint32 colorFlag, uint32 alphaFlag, uint32 defaultColor = 0); + virtual void InitCombinerMode(void); + + virtual bool Initialize(void)=0; + virtual void CleanUp(void) {}; + virtual void UpdateCombiner(uint32 dwMux0, uint32 dwMux1); + virtual void InitCombinerBlenderForSimpleTextureDraw(uint32 tile=0)=0; + virtual void DisableCombiner(void)=0; + +#ifdef DEBUGGER + virtual void DisplaySimpleMuxString(void); + virtual void DisplayMuxString(void); +#endif + + DecodedMux *m_pDecodedMux; +protected: + CColorCombiner(CRender *pRender) : + m_pDecodedMux(NULL), m_bTex0Enabled(false),m_bTex1Enabled(false),m_bTexelsEnable(false), + m_bCycleChanged(false), m_supportedStages(1),m_bSupportMultiTexture(true),m_pRender(pRender) + { + } + + virtual void InitCombinerCycleCopy(void)=0; + virtual void InitCombinerCycleFill(void)=0; + virtual void InitCombinerCycle12(void)=0; + + bool m_bTex0Enabled; + bool m_bTex1Enabled; + bool m_bTexelsEnable; + + bool m_bCycleChanged; // A flag will be set if cycle is changed to FILL or COPY + + int m_supportedStages; + bool m_bSupportMultiTexture; + + CRender *m_pRender; + + CSortedList m_DecodedMuxList; +}; + +uint32 GetTexelNumber(N64CombinerType &m); +int CountTexel1Cycle(N64CombinerType &m); +bool IsTxtrUsed(N64CombinerType &m); + +void swap(uint8 &a, uint8 &b); + + +inline bool isEqual(uint8 val1, uint8 val2) +{ + if( (val1&MUX_MASK) == (val2&MUX_MASK) ) + return true; + else + return false; +} + +inline bool isTexel(uint8 val) +{ + if( (val&MUX_MASK) == MUX_TEXEL0 || (val&MUX_MASK) == MUX_TEXEL1 ) + return true; + else + return false; +} + +COLOR CalculateConstFactor(uint32 colorOp, uint32 alphaOp, uint32 curCol=0); + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/CombinerDefs.h b/libmupen64plus/mupen64plus-video-rice/src/CombinerDefs.h new file mode 100644 index 0000000000..e56df56359 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/CombinerDefs.h @@ -0,0 +1,135 @@ +/* +Copyright (C) 2002 Rice1964 + +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. + +*/ + +#ifndef _COMBINER_DEFS_H_ +#define _COMBINER_DEFS_H_ + +#include "typedefs.h" + +#define MUX_MASK 0x1F +#define MUX_MASK_WITH_ALPHA 0x5F +#define MUX_MASK_WITH_NEG 0x3F +#define MUX_MASK_WITH_COMP 0x9F +enum +{ + MUX_0 = 0, + MUX_1, + MUX_COMBINED, + MUX_TEXEL0, + MUX_TEXEL1, + MUX_PRIM, + MUX_SHADE, + MUX_ENV, + MUX_COMBALPHA, + MUX_T0_ALPHA, + MUX_T1_ALPHA, + MUX_PRIM_ALPHA, + MUX_SHADE_ALPHA, + MUX_ENV_ALPHA, + MUX_LODFRAC, + MUX_PRIMLODFRAC, + MUX_K5, + MUX_UNK, //Use this if you want to factor to be set to 0 + + // Don't change value of these three flags, then need to be within 1 uint8 + MUX_NEG = 0x20, //Support by NVidia register combiner + MUX_ALPHAREPLICATE = 0x40, + MUX_COMPLEMENT = 0x80, + MUX_FORCE_0 = 0xFE, + MUX_ERR = 0xFF, +}; + + +enum CombinerFormatType +{ + CM_FMT_TYPE_NOT_USED, + CM_FMT_TYPE_D, // = A can mapped to SEL(arg1) + CM_FMT_TYPE_A_MOD_C, // = A*C can mapped to MOD(arg1,arg2) + CM_FMT_TYPE_A_ADD_D, // = A+D can mapped to ADD(arg1,arg2) + CM_FMT_TYPE_A_SUB_B, // = A-B can mapped to SUB(arg1,arg2) + CM_FMT_TYPE_A_MOD_C_ADD_D, // = A*C+D can mapped to MULTIPLYADD(arg1,arg2,arg0) + CM_FMT_TYPE_A_LERP_B_C, // = (A-B)*C+B can mapped to LERP(arg1,arg2,arg0) + // or mapped to BLENDALPHA(arg1,arg2) if C is + // alpha channel or DIF, TEX, FAC, CUR + CM_FMT_TYPE_A_SUB_B_ADD_D, // = A-B+C can not map very well in 1 stage + CM_FMT_TYPE_A_SUB_B_MOD_C, // = (A-B)*C can not map very well in 1 stage + CM_FMT_TYPE_A_ADD_B_MOD_C, // = (A+B)*C can not map very well in 1 stage + CM_FMT_TYPE_A_B_C_D, // = (A-B)*C+D can not map very well in 1 stage + CM_FMT_TYPE_A_B_C_A, // = (A-B)*C+D can not map very well in 1 stage + + // Don't use these two types in default functions + CM_FMT_TYPE_AB_ADD_CD, // = A*B+C*D Use by nvidia video cards + CM_FMT_TYPE_AB_SUB_CD, // = A*B-C*D Use by nvidia video cards + CM_FMT_TYPE_AB_ADD_C, // = A*B+C Use by ATI video cards + CM_FMT_TYPE_AB_SUB_C, // = A*B-C Use by ATI video cards + CM_FMT_TYPE_NOT_CHECKED = 0xFF, +}; + + +typedef enum { + ENABLE_BOTH, + DISABLE_ALPHA, + DISABLE_COLOR, + DISABLE_BOTH, + COLOR_ONE, + ALPHA_ONE, +} BlendingFunc; + + +typedef enum { + COLOR_CHANNEL, + ALPHA_CHANNEL, +} CombineChannel; + + + +typedef struct { + uint8 a; + uint8 b; + uint8 c; + uint8 d; +} N64CombinerType; + +#define CONST_FLAG4(a,b,c,d) (a|(b<<8)|(c<<16)|(d<<24)) //(A-B)*C+D +#define CONST_MOD(a,b) (a|(b<<16)) //A*B +#define CONST_SEL(a) (a<<24) //=D +#define CONST_ADD(a,b) (a|b<<24) //A+D +#define CONST_SUB(a,b) (a|b<<8) //A-B +#define CONST_MULADD(a,b,c) (a|b<<16|c<<24) //A*C+D + +#define G_CCMUX_TEXEL1 2 +#define G_ACMUX_TEXEL1 2 + +#define NOTUSED MUX_0 + +enum { TEX_0=0, TEX_1=1}; + + + +typedef struct { + uint32 op; + uint32 Arg1; + uint32 Arg2; + uint32 Arg0; +} StageOperate; + +#endif + + + diff --git a/libmupen64plus/mupen64plus-video-rice/src/CombinerTable.cpp b/libmupen64plus/mupen64plus-video-rice/src/CombinerTable.cpp new file mode 100644 index 0000000000..e6a18c413a --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/CombinerTable.cpp @@ -0,0 +1,5125 @@ +/* +Copyright (C) 2002 Rice1964 + +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. + +*/ + +#include "GeneralCombiner.h" + +//Attention +// If using CUR as an argument, use it as Arg2, not Arg1. I don't know why, +// Geforce2 seems to be picky about this + +// LERP and MULTIPLYADD are actually implemented in 2 stages in video chip +// they can only be used with SEL() before it, or use 1 stage only + +// SEL(SPE) only is not good for alpha channel +// In fact, Specular color does not have alpha channel + +// ADDSMOOTH does not work + +// When using MOD with TEX and other, TEX must be the first argument, Arg1 +// When MOD the DIF and FAC, using MOD(FAC,DIF) instead of MOD(DIF,FAC) + +// Don't MOD(TEX,DIF) at Alpha channel, I don't know why this does not work +// probably there is not alpha blending for DIFFUSE at alpha channel + +// Modifier COMPLEMENT and ALPHAREPLICATE only works as the first argument of the MOD operate +// Modifier ALPHAREPLICATE works +// Combined modifier of COMPLEMENT and ALPHAREPLICATE also works + +#define MUX_T0 MUX_TEXEL0 +#define MUX_T1 MUX_TEXEL1 +#define MUX_DIF MUX_SHADE +#define MUX_COM MUX_COMBINED +#define MUX_CUR MUX_COMBINED +#define MUX_PRI MUX_PRIM + +#define MUX_T0A (MUX_TEXEL0|MUX_ALPHAREPLICATE) +#define MUX_T1A (MUX_TEXEL1|MUX_ALPHAREPLICATE) +#define MUX_DIFA (MUX_SHADE|MUX_ALPHAREPLICATE) +#define MUX_COMA (MUX_COMBINED|MUX_ALPHAREPLICATE) +#define MUX_CURA (MUX_COMBINED|MUX_ALPHAREPLICATE) +#define MUX_PRIA (MUX_PRIM|MUX_ALPHAREPLICATE) +#define MUX_ENVA (MUX_ENV|MUX_ALPHAREPLICATE) + +#define MUX_T0C (MUX_TEXEL0|MUX_COMPLEMENT) +#define MUX_T1C (MUX_TEXEL1|MUX_COMPLEMENT) +#define MUX_DIFC (MUX_SHADE|MUX_COMPLEMENT) +#define MUX_COMC (MUX_COMBINED|MUX_COMPLEMENT) +#define MUX_CURC (MUX_COMBINED|MUX_COMPLEMENT) +#define MUX_PRIC (MUX_PRIM|MUX_COMPLEMENT) +#define MUX_ENVC (MUX_ENV|MUX_COMPLEMENT) + +#define MUX_T0AC (MUX_TEXEL0|MUX_COMPLEMENT|MUX_ALPHAREPLICATE) +#define MUX_T1AC (MUX_TEXEL1|MUX_COMPLEMENT|MUX_ALPHAREPLICATE) +#define MUX_DIFAC (MUX_SHADE|MUX_COMPLEMENT|MUX_ALPHAREPLICATE) +#define MUX_COMAC (MUX_COMBINED|MUX_COMPLEMENT|MUX_ALPHAREPLICATE) +#define MUX_CURAC (MUX_COMBINED|MUX_COMPLEMENT|MUX_ALPHAREPLICATE) +#define MUX_PRIAC (MUX_PRIM|MUX_COMPLEMENT|MUX_ALPHAREPLICATE) +#define MUX_ENVAC (MUX_ENV|MUX_COMPLEMENT|MUX_ALPHAREPLICATE) + +#define ONEARGS(op, arg1) {CM_##op, MUX_##arg1} +#define TWOARGS(op, arg1,arg2) {CM_##op, MUX_##arg1, MUX_##arg2} +#define TRIARGS(op, arg1,arg2,arg3) {CM_##op, MUX_##arg1, MUX_##arg2, MUX_##arg3} +#define SEL(arg1) ONEARGS(REPLACE,arg1) +#define MOD(arg1,arg2) TWOARGS(MODULATE,arg1,arg2) +#define ADD(arg1,arg2) TWOARGS(ADD,arg1,arg2) +#define SUB(arg1,arg2) TWOARGS(SUBTRACT,arg1,arg2) +#define ADDSMOOTH(arg1,arg2) TWOARGS(ADDSMOOTH,arg1,arg2) +#define LERP(arg1,arg2,arg3) TRIARGS(INTERPOLATE,arg1,arg2,arg3) +#define MULADD(arg1,arg2,arg3) TRIARGS(MULTIPLYADD,arg1,arg2,arg3) +#define SKIP SEL(CUR) + +GeneralCombinerInfo twostages[]= +{ +/* +Stage overflow +//Mux=0x00267e60350cf37f Overflowed in THE LEGEND OF ZELDA +Color0: (TEXEL1 - PRIM) * ENV|A + TEXEL0 +Color1: (PRIM - ENV) * COMBINED + ENV +Alpha0: (0 - 0) * 0 + TEXEL0 +Alpha1: (COMBINED - 0) * PRIM + 0 + +//Simplied Mux=0x00267e60350cf37f Overflowed in THE LEGEND OF ZELDA +Simplied DWORDs=03470604, 00060003, 07020706, 02000000 +Color0: (TEXEL1 - SHADE) * ENV|A + TEXEL0 +Color1: (SHADE - ENV) * COMBINED + ENV +Alpha0: (TEXEL0 - 0) * SHADE + 0 +Alpha1: (0 - 0) * 0 + COMBINED +Simplfied type: CM_FMT_TYPE_NOT_CHECKED +Shade = PRIM in color channel +Shade = PRIM in alpha channel +*/ + + { + {0x03470604, 0x00060003, 0x07020706, 0x02000000}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000005, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {SUB(T1,DIF), SKIP, 1, true}, // Stage 0 + {MULADD(CUR,ENVA,T0), MOD(T0,DIF), 0, true}, // Stage 1 + } + }, + + /* + //Mux=0x002527ff1ffc9238 Overflowed in THE LEGEND OF ZELDA + Color0: (TEXEL1 - TEXEL0) * PRIM|A + TEXEL0 + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL1 - TEXEL0) * PRIM + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x002527ff1ffc9238 Overflowed in THE LEGEND OF ZELDA + Simplied DWORDs=03460304, 03060304, 02000000, 02000000 + Color0: (TEXEL1 - TEXEL0) * SHADE|A + TEXEL0 + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Shade = PRIM in alpha channel + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: BlDifA - TEXEL1, COMBINED, -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlDifA - TEXEL1, COMBINED, -Tex1 + + */ + + + { + {0x03460304, 0x03060304, 0x02000000, 0x02000000}, // Simplified mux + 0x002527FF, 0x1FFC9238, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000000, 0, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T1,PRIA), MOD(T1,PRI), 1, true}, // Stage 0 + {ADD(T0,CUR), ADD(T0,CUR), 0, true}, // Stage 1 + } + }, + + { + {0x03460304, 0x03060304, 0x02000000, 0x02000000}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + 0, // Constant color + 0x00000000, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T1,DIFA), MOD(T1,DIF), 1, true}, // Stage 0 + {ADD(T0,CUR), ADD(T0,CUR), 0, true}, // Stage 1 + } + }, + + + + /* + //Mux=0x00262a60150c937f Overflowed in THE LEGEND OF ZELDA + Color0: (TEXEL1 - TEXEL0) * ENV|A + TEXEL0 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (TEXEL1 - TEXEL0) * ENV + TEXEL0 + Alpha1: (COMBINED - 0) * PRIM + 0 + + + //Simplied Mux=0x00262a60150c937f Overflowed in THE LEGEND OF ZELDA + Simplied DWORDs=03460304, 03060304, 06020605, 00020005 + Color0: (TEXEL1 - TEXEL0) * SHADE|A + TEXEL0 + Color1: (PRIM - SHADE) * COMBINED + SHADE + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (PRIM - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Shade = ENV in color channel + Shade = ENV in alpha channel + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: BlDifA - TEXEL1, COMBINED, -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlDifA - TEXEL1, COMBINED, -Tex1 + + */ + + { + {0x03460304, 0x03060304, 0x06020605, 0x00020005}, // Simplified mux + 0x00262A60, 0x150C937F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0, 0, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T1,ENVA), MOD(T1,ENV), 1, true}, // Stage 0 + {ADD(T0,CUR), ADD(T0,CUR), 0, true}, // Stage 1 + } + }, + + { + {0x03460304, 0x03060304, 0x06020605, 0x00020005}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + 0, // Constant color + 0x00000007, 0x00000007, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T1,DIFA), MOD(T1,DIF), 1, true}, // Stage 0 + {ADD(T0,CUR), ADD(T0,CUR), 0, true}, // Stage 1 + } + }, + + + /* + //Mux=0x00267e041ffcfdf8 Overflowed in THE LEGEND OF ZELDA + Color0: (TEXEL1 - TEXEL0) * ENV|A + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (0 - 0) * 0 + 1 + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x00267e041ffcfdf8 Overflowed in THE LEGEND OF ZELDA + Simplied DWORDs=03460304, 01000000, 00020006, 02000000 + Color0: (TEXEL1 - TEXEL0) * SHADE|A + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + 1 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Shade = ENV in alpha channel + + Generated combiners: + + Stages:2, Alpha:DISABLE_ALPHA, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: BlDifA - TEXEL1, COMBINED, -Tex1 + 0:Alpha: Sel - COMBINED, , + 1:Alpha: Sel - COMBINED, , -Tex1 + */ + + { + {0x03460304, 0x01000000, 0x00020006, 0x02000000}, // Simplified mux + 0x00267e04, 0x1ffcfdf8, // 64bit Mux + 2, // number of stages + DISABLE_ALPHA, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + //{MOD(T1,DIFA), SKIP, 1, true}, // Stage 0 + {MOD(T0,DIF), SKIP, 0, true}, // Stage 0 + //{MULADD(T0,CUR,DIF), SKIP, 0, true}, // Stage 1 + {LERP(T1,CUR,ENVA), SKIP, 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x00267e041f0cfdff Overflowed in THE LEGEND OF ZELDA + Color0: (TEXEL1 - TEXEL0) * ENV|A + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (0 - 0) * 0 + 1 + Alpha1: (COMBINED - 0) * PRIM + 0 + + + //Simplied Mux=0x00267e041f0cfdff Overflowed in THE LEGEND OF ZELDA + Simplied DWORDs=03470304, 06000000, 00020006, 02000000 + Color0: (TEXEL1 - TEXEL0) * ENV|A + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + SHADE + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Shade = PRIM in alpha channel + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: BlFacA - TEXEL1, COMBINED, -Tex1 + 0:Alpha: Sel - SHADE, , + 1:Alpha: Sel - COMBINED, , -Tex1 + + + + */ + + { + {0x03470304, 0x06000000, 0x00020006, 0x02000000}, // Simplified mux + 0x00267E04, 0x1F0CFDFF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T1,ENVA), SEL(DIFA), 1, true}, // Stage 0 + {MULADD(T0,DIF,CUR), SKIP, 0, true}, // Stage 1 + } + }, + + + + /* + //Mux=0x00117ffffffdfc38 Overflowed in MarioTennis + Color0: (TEXEL0 - 0) * TEXEL1 + PRIM + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (0 - 0) * 0 + 1 + Alpha1: (0 - 0) * 0 + COMBINED + + //Simplied Mux=0x00117ffffffdfc38 Overflowed in MarioTennis + Simplied DWORDs=00030004, 01000000, 02010006, 02000000 + Color0: (TEXEL1 - 0) * TEXEL0 + 0 + Color1: (SHADE - 0) * 1 + COMBINED + Alpha0: (0 - 0) * 0 + 1 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE5_A_MOD_C_ADD_D + Shade = PRIM in color channel + + Generated combiners: + + Stages:2, Alpha:DISABLE_ALPHA, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL1, , + 1:Color: Mod - TEXEL0, COMBINED, + 0:Alpha: Sel - COMBINED, , + 1:Alpha: Sel - COMBINED, , + + + */ + + { + {0x00030004, 0x01000000, 0x02010006, 0x02000000}, // Simplified mux + 0x00117FFF, 0xFFFDFC38, // 64bit Mux + 2, // number of stages + DISABLE_ALPHA, + 0, // Constant color + 0x00000005, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {SEL(T0), SKIP, 0, true}, // Stage 0 + {MULADD(T1,CUR,DIF), SKIP, 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00ffa1ffff0d923f Overflowed in MarioTennis + Color0: (0 - 0) * 0 + PRIM + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL1 - TEXEL0) * COMBINED + TEXEL0 + Alpha1: (COMBINED - 0) * PRIM + 0 + + //Simplied Mux=0x00ffa1ffff0d923f Overflowed in MarioTennis + Simplied DWORDs=05000000, 03060304, 02000000, 00020005 + Color0: (0 - 0) * 0 + PRIM + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (PRIM - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - PRIM, , + 1:Color: Sel - COMBINED, , -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlDifA - TEXEL1, COMBINED, -Tex1 + + + */ + + + { + {0x05000000, 0x03060304, 0x02000000, 0x00020005}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + 0, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {SEL(PRI), MOD(T0,PRIM), 0, true}, // Stage 0 + {SKIP, TRIARGS(BLENDDIFFUSEALPHA,T1,CUR,DIFA), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x00ffb9ffffebdbc0 Used in MarioTennis + Color0: (0 - 0) * 0 + 0 + Color1: (0 - 0) * 0 + 0 + Alpha0: (PRIM - ENV) * SHADE + ENV + Alpha1: (0 - COMBINED) * TEXEL1 + COMBINED + + //Simplied Mux=0x00ffb9ffffebdbc0 Used in MarioTennis + Simplied DWORDs=00000000, 00060083, 02000000, 02000000 + Color0: (0 - 0) * 0 + 0 + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL0|C - 0) * SHADE + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE2_A_ADD_D + Shade = 07060705 in alpha channel + Generated combiners: + + */ + + + { + {0x00000000, 0x00060083, 0x02000000, 0x02000000}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + DISABLE_COLOR, + 0, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {SKIP, MOD(T0,PRIM), 0, true}, // Stage 0 + {SKIP, TRIARGS(BLENDDIFFUSEALPHA,T0,CUR,DIFA), 0, true}, // Stage 1 + } + }, + + /* + //Mux=0x0030b2045ffefff8 Used in THE LEGEND OF ZELDA + Color0: (PRIM - ENV) * TEXEL0 + ENV + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (PRIM - 0) * TEXEL0 + 0 + Alpha1: (0 - 0) * 0 + COMBINED + + //Simplied Mux=0x0030b2045ffefff8 Used in THE LEGEND OF ZELDA + Simplied DWORDs=07030704, 04000000, 00020006, 00020003 + Color0: (TEXEL1 - ENV) * TEXEL0 + ENV + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + TEXEL1 + Alpha1: (TEXEL0 - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Tex 1 = PRIM + + + + Stages:2, Alpha:ENABLE_BOTH, Factor:MUX_ENV, Specular:MUX_0 Dif Color:0x0 Dif Alpha:0x0 + 0:Color: SELECTARG1 - TEXTURE, _, _ + 1:Color: LERP - TEXTURE, TFACTOR, CURRENT -Tex1 + 0:Alpha: SELECTARG1 - CURRENT, _, _ + 1:Alpha: SELECTARG1 - TEXTURE, _, _ -Tex1 + */ + + { + {0x07030704, 0x04000000, 0x00020006, 0x00020003}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + DISABLE_COLOR, + 0, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000005}, // constant color texture flags + { + {MOD(T0,DIF), SEL(T0), 0, true}, // Stage 0 + {LERP(T1,ENV,CUR), MOD(T1,CUR), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x0026a0041f1093ff Overflowed in Perfect Dark + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL1 - TEXEL0) * COMBINED + TEXEL0 + Alpha1: (COMBINED - 0) * SHADE + 0 + + //Simplied Mux=0x0026a0041f1093ff Overflowed in Perfect Dark + Simplied DWORDs=030E0304, 03060304, 00020006, 00020006 + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (SHADE - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: Lerp - TEXEL1, COMBINED, LODFRAC -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlDifA - TEXEL1, COMBINED, -Tex1 + + + */ + + + { + {0x030E0304, 0x03060304, 0x00020006, 0x00020006}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + 0, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + //{LERP(T1,CUR,LODFRAC), LERP(T1,CUR,LODFRAC), 1, true}, // Stage 1 + {SKIP, SKIP, 0, false}, // Stage 1 + } + }, + + + /* + //Mux=0x0026a0041ffc93fc Overflowed in Perfect Dark + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL1 - TEXEL0) * COMBINED + TEXEL0 + Alpha1: (0 - 0) * 0 + SHADE + + //Simplied Mux=0x0026a0041ffc93fc Overflowed in Perfect Dark + Simplied DWORDs=030E0304, 06000000, 00020006, 02000000 + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + SHADE + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: Lerp - TEXEL1, COMBINED, LODFRAC -Tex1 + 0:Alpha: Sel - SHADE, , + 1:Alpha: Sel - COMBINED, , -Tex1 + + + */ + + + { + {0x030E0304, 0x06000000, 0x00020006, 0x02000000}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + 0, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SEL(DIF), 0, true}, // Stage 0 + //{LERP(T1,CUR,LODFRAC), SKIP, 1, true}, // Stage 1 + {SKIP, SKIP, 0, false}, // Stage 1 + } + }, + + + /* + //Mux=0x002526041f1093ff Overflowed in Perfect Dark + Color0: (TEXEL1 - TEXEL0) * PRIM|A + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL1 - TEXEL0) * PRIM + TEXEL0 + Alpha1: (COMBINED - 0) * SHADE + 0 + + //Simplied Mux=0x002526041f1093ff Overflowed in Perfect Dark + Simplied DWORDs=03450304, 03050304, 00020006, 00020006 + Color0: (TEXEL1 - TEXEL0) * PRIM|A + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL1 - TEXEL0) * PRIM + TEXEL0 + Alpha1: (SHADE - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: BlFacA - TEXEL1, COMBINED, -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlFacA - TEXEL1, COMBINED, -Tex1 + + + */ + + + { + {0x03450304, 0x03050304, 0x00020006, 0x00020006}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SEL(DIF), 0, true}, // Stage 0 + {TRIARGS(BLENDDIFFUSEALPHA,T1,CUR,DIFA), SKIP, 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x0026a0041f1093fb Overflowed in Perfect Dark + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL1 - TEXEL0) * COMBINED + TEXEL0 + Alpha1: (COMBINED - 0) * SHADE + PRIM + + //Simplied Mux=0x0026a0041f1093fb Overflowed in Perfect Dark + Simplied DWORDs=030E0304, 03060304, 00020006, 05020006 + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (SHADE - 0) * COMBINED + PRIM + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: Lerp - TEXEL1, COMBINED, LODFRAC -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlDifA - TEXEL1, COMBINED, -Tex1 + + + */ + + + { + {0x030E0304, 0x03060304, 0x00020006, 0x05020006}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {SKIP, ADD(CUR,PRI), 0, false}, // Stage 1 + } + }, + + + + /* + //Mux=0x00272c041f1093ff Overflowed in GOLDENEYE + Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL1 - TEXEL0) * 1 + TEXEL0 + Alpha1: (COMBINED - 0) * SHADE + 0 + + //Simplied Mux=0x00272c041f1093ff Overflowed in GOLDENEYE + Simplied DWORDs=030F0304, 00060004, 00020006, 02000000 + Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL1 - 0) * SHADE + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: Lerp - TEXEL1, COMBINED, PRIMLODFRAC -Tex1 + 0:Alpha: Sel - COMBINED, , + 1:Alpha: Mod - TEXEL1, SHADE, -Tex1 + + + */ + + + { + {0x030F0304, 0x00060004, 0x00020006, 0x02000000}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIMLODFRAC, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SKIP, 0, true}, // Stage 0 + {SKIP, MOD(T1,DIF), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x0026a0041f1493ff Overflowed in GOLDENEYE + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL1 - TEXEL0) * COMBINED + TEXEL0 + Alpha1: (COMBINED - 0) * ENV + 0 + + //Simplied Mux=0x0026a0041f1493ff Overflowed in GOLDENEYE + Simplied DWORDs=00060003, 03060304, 02000000, 00020007 + Color0: (TEXEL0 - 0) * SHADE + 0 + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (ENV - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Mod - TEXEL0, SHADE, + 1:Color: Sel - COMBINED, , -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlDifA - TEXEL1, COMBINED, -Tex1 + + + */ + + + { + {0x00060003, 0x03060304, 0x02000000, 0x00020007}, // Simplified mux + 0x0026A004, 0x1F1493FF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000007, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {SKIP, SKIP, 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x0030fe045ffefdf8 Overflowed in Kirby64 + Color0: (PRIM - ENV) * TEXEL0 + ENV + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (0 - 0) * 0 + 1 + Alpha1: (0 - 0) * 0 + COMBINED + + //Simplied Mux=0x0030fe045ffefdf8 Overflowed in Kirby64 + Simplied DWORDs=07030704, 01000000, 00020006, 02000000 + Color0: (TEXEL1 - ENV) * TEXEL0 + ENV + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + 1 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Tex 1 = PRIM + + Generated combiners: + + Stages:2, Alpha:DISABLE_ALPHA, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: Lerp - TEXEL1, ENV, COMBINED -Tex1 + 0:Alpha: Sel - COMBINED, , + 1:Alpha: Sel - COMBINED, , -Tex1 + + + */ + + + { + {0x07030704, 0x01000000, 0x00020006, 0x02000000}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + DISABLE_ALPHA, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000005}, // constant color texture flags + { + {MOD(T0,DIF), SKIP, 0, true}, // Stage 0 + {LERP(T1,ENV,CUR), SKIP, 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00309e045ffefdf8 Overflowed in Kirby64 + Color0: (PRIM - ENV) * TEXEL0 + ENV + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL0 - 0) * 0 + 1 + Alpha1: (0 - 0) * 0 + COMBINED + + //Simplied Mux=0x00309e045ffefdf8 Overflowed in Kirby64 + Simplied DWORDs=07030704, 01000000, 00020006, 02000000 + Color0: (TEXEL1 - ENV) * TEXEL0 + ENV + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + 1 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Tex 1 = PRIM + + Generated combiners: + + Stages:2, Alpha:DISABLE_ALPHA, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: Lerp - TEXEL1, ENV, COMBINED -Tex1 + 0:Alpha: Sel - COMBINED, , + 1:Alpha: Sel - COMBINED, , -Tex1 + + + */ + + + { + {0x07030704, 0x01000000, 0x00020006, 0x02000000}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000005}, // constant color texture flags + { + {MOD(T0,DIF), SEL(T0), 0, true}, // Stage 0 + {LERP(T1,ENV,CUR), SKIP, 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x0026a0041ffc93f8 Overflowed in ZELDA MAJORA'S MASK + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL1 - TEXEL0) * COMBINED + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + + //Simplied Mux=0x0026a0041ffc93f8 Overflowed in ZELDA MAJORA'S MASK + Simplied DWORDs=030E0304, 03060304, 00020006, 02000000 + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: Lerp - TEXEL1, COMBINED, LODFRAC -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlDifA - TEXEL1, COMBINED, -Tex1 + + + */ + + + { + {0x030E0304, 0x03060304, 0x00020006, 0x02000000}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_LODFRAC, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SEL(T0), 0, true}, // Stage 0 + {SKIP, LERP(T1,CUR,LODFRAC), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x00209c03ff0f93ff Overflowed in ZELDA MAJORA'S MASK + Color0: (TEXEL1 - 0) * TEXEL0 + 0 + Color1: (COMBINED - 0) * PRIM + 0 + Alpha0: (TEXEL0 - TEXEL0) * 1 + TEXEL0 + Alpha1: (COMBINED - 0) * PRIM + 0 + + //Simplied Mux=0x00209c03ff0f93ff Overflowed in ZELDA MAJORA'S MASK + Simplied DWORDs=00050004, 00050003, 00020003, 02000000 + Color0: (TEXEL1 - 0) * PRIM + 0 + Color1: (TEXEL0 - 0) * COMBINED + 0 + Alpha0: (TEXEL0 - 0) * PRIM + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE2_A_ADD_D + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Mod - TEXEL1, PRIM, -Tex1 + 1:Color: Mod - TEXEL0, COMBINED, + 0:Alpha: Sel - COMBINED, , -Tex1 + 1:Alpha: Mod - TEXEL0, PRIM, + + + */ + + + { + {0x00050004, 0x00050003, 0x00020003, 0x02000000}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,PRI), MOD(T0,PRI), 0, true}, // Stage 0 + {MOD(T1,CUR), SKIP, 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x001229ffff17fe3f Overflowed in Rayman 2 + Color0: (TEXEL0 - 0) * SHADE + 0 + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL1 - 0) * SHADE + 0 + Alpha1: (COMBINED - 0) * ENV + 0 + + //Simplied Mux=0x001229ffff17fe3f Overflowed in Rayman 2 + Simplied DWORDs=00060003, 00060004, 02000000, 00020007 + Color0: (TEXEL0 - 0) * SHADE + 0 + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL1 - 0) * SHADE + 0 + Alpha1: (ENV - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE2_A_ADD_D + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Mod - TEXEL0, SHADE, + 1:Color: Sel - COMBINED, , -Tex1 + 0:Alpha: Sel - COMBINED, , + 1:Alpha: Mod - TEXEL1, SHADE, -Tex1 + + + */ + + + { + {0x00060003, 0x00060004, 0x02000000, 0x00020007}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(DIF,ENV), 0, true}, // Stage 0 + {SKIP, MOD(T1,CUR), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x0030fe0254feff3e Overflowed in Beetle Adventure Rac + Color0: (PRIM - ENV) * TEXEL0 + ENV + Color1: (COMBINED - SHADE) * TEXEL1 + SHADE + Alpha0: (0 - 0) * 0 + 0 + Alpha1: (0 - 0) * 0 + 1 + + //Simplied Mux=0x0030fe0254feff3e Overflowed in Beetle Adventure Rac + Simplied DWORDs=07030704, 01000000, 06030602, 02000000 + Color0: (TEXEL1 - ENV) * TEXEL0 + ENV + Color1: (COMBINED - SHADE) * TEXEL0 + SHADE + Alpha0: (0 - 0) * 0 + 1 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Tex 1 = PRIM + + Generated combiners: + + Stages:2, Alpha:DISABLE_ALPHA, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: Lerp - TEXEL1, ENV, COMBINED -Tex1 + 0:Alpha: Sel - COMBINED, , + 1:Alpha: Sel - COMBINED, , -Tex1 + + + */ + + + { + {0x07030704, 0x01000000, 0x06030602, 0x02000000}, // Simplified mux + 0x0030FE02, 0x54FEFF3E, // 64bit Mux + 2, // number of stages + DISABLE_ALPHA, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {LERP(DIFA,ENV,T0), SKIP, 0, true}, // Stage 0 + {LERP(CUR,DIF,T1), SKIP, 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x0015fe042ffd79fc Overflowed in Beetle Adventure Rac + Color0: (TEXEL0 - TEXEL1) * SHADE|A + TEXEL1 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (0 - 0) * 0 + SHADE + Alpha1: (0 - 0) * 0 + SHADE + + //Simplied Mux=0x0015fe042ffd79fc Overflowed in Beetle Adventure Rac + Simplied DWORDs=04460403, 06000000, 00020006, 02000000 + Color0: (TEXEL0 - TEXEL1) * SHADE|A + TEXEL1 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + SHADE + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: BlDifA - COMBINED, TEXEL1, -Tex1 + 0:Alpha: Sel - SHADE, , + 1:Alpha: Sel - COMBINED, , -Tex1 + + + */ + + + { + {0x04460403, 0x06000000, 0x00020006, 0x02000000}, // Simplified mux + 0x0015FE04, 0x2FFD79FC, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + 0, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIFA), SEL(DIF), 0, true}, // Stage 0 + {LERP(CUR,T1,DIF), SKIP, 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x0020fe0a14fcf938 Overflowed in Beetle Adventure Rac + Color0: (TEXEL1 - TEXEL0) * TEXEL0 + TEXEL0 + Color1: (COMBINED - SHADE) * PRIM|A + SHADE + Alpha0: (0 - 0) * 0 + SHADE + Alpha1: (0 - 0) * 0 + COMBINED + + //Simplied Mux=0x0020fe0a14fcf938 Overflowed in Beetle Adventure Rac + Simplied DWORDs=03030304, 06000000, 06450602, 02000000 + Color0: (TEXEL1 - TEXEL0) * TEXEL0 + TEXEL0 + Color1: (COMBINED - SHADE) * PRIM|A + SHADE + Alpha0: (0 - 0) * 0 + SHADE + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: Lerp - TEXEL1, COMBINED, COMBINED -Tex1 + 0:Alpha: Sel - SHADE, , + 1:Alpha: Sel - COMBINED, , -Tex1 + + + */ + + + { + {0x03030304, 0x06000000, 0x06450602, 0x02000000}, // Simplified mux + 0x0020FE0A, 0x14FCF938, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {SEL(T0), SEL(DIF), 0, true}, // Stage 0 + {LERP(CUR,DIF,PRIA), SKIP, 0, true}, // Stage 1 + } + }, + + /* + //Mux=0x0017fe042ffd73f8 Overflowed in Beetle Adventure Rac + Color0: (TEXEL0 - TEXEL1) * UNK + TEXEL1 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (0 - 0) * 0 + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + + //Simplied Mux=0x0017fe042ffd73f8 Overflowed in Beetle Adventure Rac + Simplied DWORDs=04100403, 03000000, 00020006, 02000000 + Color0: (TEXEL0 - TEXEL1) * UNK + TEXEL1 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: Lerp - COMBINED, TEXEL1, UNK -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: Sel - COMBINED, , -Tex1 + + + */ + + + { + {0x04100403, 0x03000000, 0x00020006, 0x02000000}, // Simplified mux + 0x0017FE04, 0x2FFD73F8, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + 0, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {SEL(T0), SEL(T0), 0, true}, // Stage 0 + {LERP(CUR,T1,DIF), SKIP, 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x001218245531feff Overflowed in CONKER BFD + Color0: (TEXEL0 - ENV) * SHADE + PRIM + Color1: (TEXEL0 - ENV) * SHADE + PRIM + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (TEXEL0 - 0) * SHADE + 0 + + //Simplied Mux=0x001218245531feff Overflowed in CONKER BFD + Simplied DWORDs=00060703, 00060003, 02010004, 02000000 + Color0: (TEXEL0 - ENV) * SHADE + 0 + Color1: (TEXEL1 - 0) * 1 + COMBINED + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE_NOT_CHECKED + Tex 1 = PRIM + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sub - TEXEL0, ENV, + 1:Color: Mod - COMBINED, SHADE, + 0:Alpha: Mod - TEXEL0, SHADE, + 1:Alpha: Sel - COMBINED, , + + + */ + + + { + {0x00060703, 0x00060003, 0x02010004, 0x02000000}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000005}, // constant color texture flags + { + {SUB(T0,ENV), MOD(T0,DIF), 0, true}, // Stage 0 + {MULADD(CUR,DIF,T1), SKIP, 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00127e2455fdf2f9 Overflowed in CONKER BFD + Color0: (TEXEL0 - ENV) * SHADE + PRIM + Color1: (TEXEL0 - ENV) * SHADE + PRIM + Alpha0: (0 - 0) * 0 + TEXEL0 + Alpha1: (0 - 0) * 0 + TEXEL0 + + //Simplied Mux=0x00127e2455fdf2f9 Overflowed in CONKER BFD + Simplied DWORDs=00060703, 03000000, 02010004, 02000000 + Color0: (TEXEL0 - ENV) * SHADE + 0 + Color1: (TEXEL1 - 0) * 1 + COMBINED + Alpha0: (0 - 0) * 0 + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE_NOT_CHECKED + Tex 1 = PRIM + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sub - TEXEL0, ENV, + 1:Color: Mod - COMBINED, SHADE, + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: Sel - COMBINED, , + + + */ + + + { + {0x00060703, 0x03000000, 0x02010004, 0x02000000}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000005}, // constant color texture flags + { + {SUB(T0,ENV), SEL(T0), 0, true}, // Stage 0 + {MULADD(CUR,DIF,T1), SKIP, 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x0026a004151092ff Overflowed in CONKER BFD + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (COMBINED - ENV) * SHADE + PRIM + Alpha0: (TEXEL1 - TEXEL0) * COMBINED + TEXEL0 + Alpha1: (COMBINED - 0) * SHADE + 0 + + //Simplied Mux=0x0026a004151092ff Overflowed in CONKER BFD + Simplied DWORDs=00060703, 03060304, 02010005, 00020006 + Color0: (TEXEL0 - ENV) * SHADE + 0 + Color1: (PRIM - 0) * 1 + COMBINED + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (SHADE - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE_NOT_CHECKED + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sub - TEXEL0, ENV, + 1:Color: Mod - COMBINED, SHADE, -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlDifA - TEXEL1, COMBINED, -Tex1 + + + */ + + + { + {0x00060703, 0x03060304, 0x02010005, 0x00020006}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + //{LERP(T1,CUR,LODFRAC), LERP(T1,CUR,LODFRAC), 1, true}, // Stage 1 + {ADD(CUR,PRI), SKIP, 0, false}, // Stage 1 + } + }, + + /* + //Mux=0x0026a00415fc92f8 Overflowed in CONKER BFD + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (COMBINED - ENV) * SHADE + PRIM + Alpha0: (TEXEL1 - TEXEL0) * COMBINED + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + + //Simplied Mux=0x0026a00415fc92f8 Overflowed in CONKER BFD + Simplied DWORDs=00060703, 03060304, 02010005, 02000000 + Color0: (TEXEL0 - ENV) * SHADE + 0 + Color1: (PRIM - 0) * 1 + COMBINED + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE_NOT_CHECKED + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sub - TEXEL0, ENV, + 1:Color: Mod - COMBINED, SHADE, -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlDifA - TEXEL1, COMBINED, -Tex1 + + + */ + + + { + {0x00060703, 0x03060304, 0x02010005, 0x02000000}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_LODFRAC, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SEL(T0), 0, true}, // Stage 0 + {SKIP, LERP(T1,CUR,LODFRAC), 1, true}, // Stage 1 + } + + }, + + + /* + //Mux=0x001219ff5f15fe3f Overflowed in CONKER BFD + Color0: (TEXEL0 - ENV) * SHADE + PRIM + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (COMBINED - 0) * ENV + 0 + + //Simplied Mux=0x001219ff5f15fe3f Overflowed in CONKER BFD + Simplied DWORDs=00060703, 00060003, 02010004, 00020007 + Color0: (TEXEL0 - ENV) * SHADE + 0 + Color1: (TEXEL1 - 0) * 1 + COMBINED + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (ENV - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE_NOT_CHECKED + Tex 1 = PRIM + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sub - TEXEL0, ENV, + 1:Color: Mod - COMBINED, SHADE, + 0:Alpha: Mod - TEXEL0, SHADE, + 1:Alpha: Mod - ENV, COMBINED, + + + */ + + + { + {0x00060703, 0x00060003, 0x02010004, 0x00020007}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000005}, // constant color texture flags + { + {SUB(T0,ENV), MOD(T0,DIF), 0, true}, // Stage 0 + {MULADD(CUR,DIF,T1), MOD(CUR,ENV), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x00ff9880f514feff Overflowed in CONKER BFD + Color0: (0 - 0) * 0 + TEXEL0 + Color1: (SHADE - ENV) * COMBINED + PRIM + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (COMBINED - 0) * ENV + 0 + + //Simplied Mux=0x00ff9880f514feff Overflowed in CONKER BFD + Simplied DWORDs=00030706, 00060003, 02010004, 00020007 + Color0: (SHADE - ENV) * TEXEL0 + 0 + Color1: (TEXEL1 - 0) * 1 + COMBINED + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (ENV - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE_NOT_CHECKED + Shade = 00000706 in color channel + Tex 1 = PRIM + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sub - SHADE, ENV, + 1:Color: Mod - COMBINED, TEXEL0, + 0:Alpha: Mod - TEXEL0, SHADE, + 1:Alpha: Mod - ENV, COMBINED, + + + */ + + + { + {0x00030706, 0x00060003, 0x02010004, 0x00020007}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000005}, // constant color texture flags + { + {SUB(T0,ENV), MOD(T0,DIF), 0, true}, // Stage 0 + {MULADD(CUR,DIF,T1), MOD(CUR,ENV), 1, true}, // Stage 1 + } + }, + + + + + /* + //Mux=0x0026a080151492ff Overflowed in CONKER BFD + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (SHADE - ENV) * COMBINED + PRIM + Alpha0: (TEXEL1 - TEXEL0) * COMBINED + TEXEL0 + Alpha1: (COMBINED - 0) * ENV + 0 + + //Simplied Mux=0x0026a080151492ff Overflowed in CONKER BFD + Simplied DWORDs=030E0304, 03060304, 05020706, 00020007 + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (SHADE - ENV) * COMBINED + PRIM + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (ENV - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE_NOT_CHECKED + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: Lerp - TEXEL1, COMBINED, LODFRAC -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlDifA - TEXEL1, COMBINED, -Tex1 + + + */ + + + { + {0x030E0304, 0x03060304, 0x05020706, 0x00020007}, // Simplified mux + 0x0026A080, 0x151492FF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000706, 0x00000007, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + //{LERP(T1,CUR,LODFRAC), LERP(T1,CUR,LODFRAC), 1, true}, // Stage 1 + {ADD(CUR,PRI), SKIP, 0, false}, // Stage 1 + } + }, + + /* + //Mux=0x0026a004151092ff Overflowed in CONKER BFD + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (COMBINED - ENV) * SHADE + PRIM + Alpha0: (TEXEL1 - TEXEL0) * COMBINED + TEXEL0 + Alpha1: (COMBINED - 0) * SHADE + 0 + + + //Simplied Mux=0x0026a004151092ff Overflowed in CONKER BFD + Simplied DWORDs=030E0304, 03060304, 05060702, 00020006 + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (COMBINED - ENV) * SHADE + PRIM + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (SHADE - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE_NOT_CHECKEDGenerated combiners: + */ + + + { + {0x030E0304, 0x03060304, 0x05060702, 0x00020006}, // Simplified mux + 0x0026A004, 0x151092FF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_LODFRAC, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SEL(T0), 0, true}, // Stage 0 + //{LERP(T1,CUR,LODFRAC), LERP(T1,CUR,LODFRAC), 1, true}, // Stage 1 + {SKIP, LERP(T1,CUR,LODFRAC), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00ff9880f514feff Overflowed in CONKER BFD + Color0: (0 - 0) * 0 + TEXEL0 + Color1: (SHADE - ENV) * COMBINED + PRIM + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (COMBINED - 0) * ENV + 0 + + //Simplied Mux=0x00ff9880f514feff Overflowed in CONKER BFD + Simplied DWORDs=00030706, 00060003, 02010004, 00020007 + Color0: (SHADE - ENV) * TEXEL0 + 0 + Color1: (TEXEL1 - 0) * 1 + COMBINED + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (ENV - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE_NOT_CHECKED + Shade = 00000706 in color channel + Tex 1 = PRIM + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sub - SHADE, ENV, + 1:Color: Mod - COMBINED, TEXEL0, + 0:Alpha: Mod - TEXEL0, SHADE, + 1:Alpha: Mod - ENV, COMBINED, + + + */ + + + { + {0x00030706, 0x00060003, 0x02010004, 0x00020007}, // Simplified mux + 0x00FF9880, 0xF514FEFF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000706, 0x00070006, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {ADD(CUR,PRI), SKIP, 0, false}, // Stage 1 + } + }, + + /* + //Mux=0x00262a041f0c93ff Overflowed in JET FORCE GEMINI + Color0: (TEXEL1 - TEXEL0) * ENV|A + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL1 - TEXEL0) * ENV + TEXEL0 + Alpha1: (COMBINED - 0) * PRIM + 0 + + //Simplied Mux=0x00262a041f0c93ff Overflowed in JET FORCE GEMINI + Simplied DWORDs=03460304, 03060304, 00020006, 00020005 + Color0: (TEXEL1 - TEXEL0) * SHADE|A + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (PRIM - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Shade = ENV in alpha channel + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: BlDifA - TEXEL1, COMBINED, -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlDifA - TEXEL1, COMBINED, -Tex1 + + + */ + + + { + {0x03460304, 0x03060304, 0x00020006, 0x00020005}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000007, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {LERP(T1,CUR,ENVA), LERP(T1,CUR,ENV), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00262a6014fc9338 Overflowed in JET FORCE GEMINI + Color0: (TEXEL1 - TEXEL0) * ENV|A + TEXEL0 + Color1: (PRIM - SHADE) * COMBINED + SHADE + Alpha0: (TEXEL1 - TEXEL0) * ENV + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + + //Simplied Mux=0x00262a6014fc9338 Overflowed in JET FORCE GEMINI + Simplied DWORDs=03460304, 03060304, 06020605, 02000000 + Color0: (TEXEL1 - TEXEL0) * SHADE|A + TEXEL0 + Color1: (PRIM - SHADE) * COMBINED + SHADE + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Shade = ENV in alpha channel + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: BlDifA - TEXEL1, COMBINED, -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlDifA - TEXEL1, COMBINED, -Tex1 + + + */ + + + { + {0x03460304, 0x03060304, 0x06020605, 0x02000000}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000007, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SEL(T0), 0, true}, // Stage 0 + {LERP(T1,CUR,ENVA), LERP(T1,CUR,ENV), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x00127e2455fdf8fc Overflowed in KILLER INSTINCT GOLD + Color0: (TEXEL0 - ENV) * SHADE + PRIM + Color1: (TEXEL0 - ENV) * SHADE + PRIM + Alpha0: (0 - 0) * 0 + SHADE + Alpha1: (0 - 0) * 0 + SHADE + + //Simplied Mux=0x00127e2455fdf8fc Overflowed in KILLER INSTINCT GOLD + Simplied DWORDs=00060703, 06000000, 02010004, 02000000 + Color0: (TEXEL0 - ENV) * SHADE + 0 + Color1: (TEXEL1 - 0) * 1 + COMBINED + Alpha0: (0 - 0) * 0 + SHADE + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE_NOT_CHECKED + Tex 1 = PRIM + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sub - TEXEL0, ENV, + 1:Color: Mod - COMBINED, SHADE, + 0:Alpha: Sel - SHADE, , + 1:Alpha: Sel - COMBINED, , + + + */ + + + { + {0x00060703, 0x06000000, 0x02010004, 0x02000000}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000005}, // constant color texture flags + { + {SUB(T0,ENV), SEL(DIF), 0, true}, // Stage 0 + {MULADD(CUR,DIF,T1), SKIP, 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x00fffe6af5fcf438 Overflowed in KILLER INSTINCT GOLD + Color0: (0 - 0) * 0 + TEXEL0 + Color1: (PRIM - ENV) * PRIM|A + COMBINED + Alpha0: (0 - 0) * 0 + TEXEL1 + Alpha1: (0 - 0) * 0 + COMBINED + + //Simplied Mux=0x00fffe6af5fcf438 Overflowed in KILLER INSTINCT GOLD + Simplied DWORDs=00460706, 04000000, 02010003, 02000000 + Color0: (SHADE - ENV) * SHADE|A + 0 + Color1: (TEXEL0 - 0) * 1 + COMBINED + Alpha0: (0 - 0) * 0 + TEXEL1 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE_NOT_CHECKED + Shade = PRIM in color channel + Shade = PRIM in alpha channel + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sub - SHADE, ENV, -Tex1 + 1:Color: Mod - COMBINED, SHADE|A, + 0:Alpha: Sel - TEXEL1, , -Tex1 + 1:Alpha: Sel - COMBINED, , + + + */ + + + { + {0x00460706, 0x04000000, 0x02010003, 0x02000000}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000005, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {SUB(DIF,ENV), SEL(T1), 1, true}, // Stage 0 + {MULADD(CUR,DIFA,T0), SKIP, 0, true}, // Stage 1 + } + }, + + + /* + //Mux=0x00262a041f5893f8 Overflowed in THE LEGEND OF ZELDA + Color0: (TEXEL1 - TEXEL0) * ENV|A + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL1 - TEXEL0) * ENV + TEXEL0 + Alpha1: (TEXEL1 - 0) * 1 + COMBINED + + //Simplied Mux=0x00262a041f5893f8 Overflowed in THE LEGEND OF ZELDA + Simplied DWORDs=03460304, 03060304, 00020006, 02010004 + Color0: (TEXEL1 - TEXEL0) * SHADE|A + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (TEXEL1 - 0) * 1 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Shade = ENV in alpha channel + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: BlDifA - TEXEL1, COMBINED, -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlDifA - TEXEL1, COMBINED, -Tex1 + + + */ + + + { + {0x03460304, 0x03060304, 0x00020006, 0x02010004}, // Simplified mux + 0x00262A04, 0x1F5893F8, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SEL(T0), 0, true}, // Stage 0 + {LERP(T1,CUR,ENVA), LERP(T1,CUR,ENV), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x00272c60350ce37f Overflowed in THE LEGEND OF ZELDA + Color0: (TEXEL1 - PRIM) * PRIMLODFRAC + TEXEL0 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (TEXEL1 - 1) * 1 + TEXEL0 + Alpha1: (COMBINED - 0) * PRIM + 0 + + //Simplied Mux=0x00272c60350ce37f Overflowed in THE LEGEND OF ZELDA + Simplied DWORDs=030F0604, 00060003, 07020706, 02000000 + Color0: (TEXEL1 - SHADE) * PRIMLODFRAC + TEXEL0 + Color1: (SHADE - ENV) * COMBINED + ENV + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE_NOT_CHECKED + Shade = PRIM in color channel + Shade = PRIM in alpha channel + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Mod - TEXEL1, PRIMLODFRAC, -Tex1 + 1:Color: Add - COMBINED, TEXEL0, + 0:Alpha: Sel - COMBINED, , -Tex1 + 1:Alpha: Mod - TEXEL0, SHADE, + + + */ + + + { + {0x030F0604, 0x00060003, 0x07020706, 0x02000000}, // Simplified mux + 0x00272C60, 0x350CE37F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000005, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T1,DIF), MOD(T1,DIF), 1, true}, // Stage 0 + {MULADD(DIF,T0,CUR), MOD(T0,CUR), 0, true}, // Stage 1 + } + }, + + + + /* + //Mux=0x0026a0041f1093ff Overflowed in Perfect Dark + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL1 - TEXEL0) * COMBINED + TEXEL0 + Alpha1: (COMBINED - 0) * SHADE + 0 + + //Simplied Mux=0x0026a0041f1093ff Overflowed in Perfect Dark + Simplied DWORDs=00060003, 03060304, 02000000, 00020006 + Color0: (TEXEL0 - 0) * SHADE + 0 + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (SHADE - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Mod - TEXEL0, SHADE, + 1:Color: Sel - COMBINED, , -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlDifA - TEXEL1, COMBINED, -Tex1 + + + */ + + + { + {0x00060003, 0x03060304, 0x02000000, 0x00020006}, // Simplified mux + 0x0026A004, 0x1F1093FF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_LODFRAC, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {SKIP, SKIP, 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x0026a08015fc937b Overflowed in ROCKETROBOTONWHEELS + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (SHADE - ENV) * COMBINED + ENV + Alpha0: (TEXEL1 - TEXEL0) * COMBINED + TEXEL0 + Alpha1: (0 - 0) * 0 + PRIM + + //Simplied Mux=0x0026a08015fc937b Overflowed in ROCKETROBOTONWHEELS + Simplied DWORDs=030E0304, 06000000, 07020706, 02000000 + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (SHADE - ENV) * COMBINED + ENV + Alpha0: (0 - 0) * 0 + SHADE + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Shade = PRIM in alpha channel + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: Lerp - TEXEL1, COMBINED, LODFRAC -Tex1 + 0:Alpha: Sel - SHADE, , + 1:Alpha: Sel - COMBINED, , -Tex1 + + + */ + + + { + {0x030E0304, 0x06000000, 0x07020706, 0x02000000}, // Simplified mux + 0x0026A080, 0x15FC937B, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_LODFRAC, // Constant color + 0x00000000, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {LERP(T1,CUR,LODFRAC), LERP(T1,CUR,LODFRAC), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x0026a0801ffc93fb Overflowed in ROCKETROBOTONWHEELS + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL1 - TEXEL0) * COMBINED + TEXEL0 + Alpha1: (0 - 0) * 0 + PRIM + + //Simplied Mux=0x0026a0801ffc93fb Overflowed in ROCKETROBOTONWHEELS + Simplied DWORDs=030E0304, 06000000, 00020006, 02000000 + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + SHADE + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Shade = PRIM in alpha channel + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: Lerp - TEXEL1, COMBINED, LODFRAC -Tex1 + 0:Alpha: Sel - SHADE, , + 1:Alpha: Sel - COMBINED, , -Tex1 + + + */ + + + { + {0x030E0304, 0x06000000, 0x00020006, 0x02000000}, // Simplified mux + 0x0026A080, 0x1FFC93FB, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_LODFRAC, // Constant color + 0x00000000, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {LERP(T1,CUR,LODFRAC), LERP(T1,CUR,LODFRAC), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x0025a8801f1493ff Overflowed in ROCKETROBOTONWHEELS + Color0: (TEXEL1 - TEXEL0) * SHADE|A + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (COMBINED - 0) * ENV + 0 + + //Simplied Mux=0x0025a8801f1493ff Overflowed in ROCKETROBOTONWHEELS + Simplied DWORDs=03460304, 03060304, 00020006, 00020007 + Color0: (TEXEL1 - TEXEL0) * SHADE|A + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (ENV - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: BlDifA - TEXEL1, COMBINED, -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlDifA - TEXEL1, COMBINED, -Tex1 + + + */ + + + { + {0x03460304, 0x03060304, 0x00020006, 0x00020007}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,ENV), 0, true}, // Stage 0 + {LERP(T1,CUR,DIFA), LERP(T1,CUR,DIF), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x0026a0801510937f Overflowed in ROCKETROBOTONWHEELS + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (SHADE - ENV) * COMBINED + ENV + Alpha0: (TEXEL1 - TEXEL0) * COMBINED + TEXEL0 + Alpha1: (COMBINED - 0) * SHADE + 0 + + //Simplied Mux=0x0026a0801510937f Overflowed in ROCKETROBOTONWHEELS + Simplied DWORDs=030E0304, 03060304, 07020706, 00020006 + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (SHADE - ENV) * COMBINED + ENV + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (SHADE - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: Lerp - TEXEL1, COMBINED, LODFRAC -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlDifA - TEXEL1, COMBINED, -Tex1 + + + */ + + + { + {0x030E0304, 0x03060304, 0x07020706, 0x00020006}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_LODFRAC, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {LERP(T1,CUR,LODFRAC), LERP(T1,CUR,LODFRAC), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x004099ff5f0efe3f Overflowed in ROCKETROBOTONWHEELS + Color0: (SHADE - ENV) * TEXEL0 + ENV + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (COMBINED - 0) * PRIM + 0 + + //Simplied Mux=0x004099ff5f0efe3f Overflowed in ROCKETROBOTONWHEELS + Simplied DWORDs=07030706, 00060003, 02000000, 00020004 + Color0: (SHADE - ENV) * TEXEL0 + ENV + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (TEXEL1 - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Shade = 00000706 in color channel + Tex 1 = PRIM + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Lerp - SHADE, ENV, TEXEL0 + 1:Color: Sel - COMBINED, , -Tex1 + 0:Alpha: Mod - TEXEL0, SHADE, + 1:Alpha: Mod - TEXEL1, COMBINED, -Tex1 + + + */ + + + { + {0x07030706, 0x00060003, 0x02000000, 0x00020004}, // Simplified mux + 0x004099FF, 0x5F0EFE3F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000005}, // constant color texture flags + { + {LERP(DIF,ENV,T0), MOD(T0,DIF), 0, true}, // Stage 0 + {SKIP, MOD(T1,CUR), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x0025a8a01414933f Overflowed in ROCKETROBOTONWHEELS + Color0: (TEXEL1 - TEXEL0) * SHADE|A + TEXEL0 + Color1: (ENV - SHADE) * COMBINED + SHADE + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (COMBINED - 0) * ENV + 0 + + //Simplied Mux=0x0025a8a01414933f Overflowed in ROCKETROBOTONWHEELS + Simplied DWORDs=03460304, 03060304, 06020607, 00020007 + Color0: (TEXEL1 - TEXEL0) * SHADE|A + TEXEL0 + Color1: (ENV - SHADE) * COMBINED + SHADE + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (ENV - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: BlDifA - TEXEL1, COMBINED, -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlDifA - TEXEL1, COMBINED, -Tex1 + + + */ + + + { + {0x03460304, 0x03060304, 0x06020607, 0x00020007}, // Simplified mux + 0x0025A8A0, 0x1414933F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000005}, // constant color texture flags + { + {LERP(ENV,DIF,T0), MOD(T0,ENV), 0, true}, // Stage 0 + {LERP(T1,CUR,DIFA), LERP(T1,CUR,DIF), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x001298043f15ffff Overflowed in BANJO TOOIE + Color0: (TEXEL0 - PRIM) * ENV + PRIM + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (COMBINED - 0) * ENV + 0 + + //Simplied Mux=0x001298043f15ffff Overflowed in BANJO TOOIE + Simplied DWORDs=04070403, 00060003, 00020006, 00020007 + Color0: (TEXEL0 - TEXEL1) * ENV + TEXEL1 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (ENV - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Tex 1 = PRIM + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: Lerp - COMBINED, TEXEL1, ENV + 0:Alpha: Mod - TEXEL0, SHADE, + 1:Alpha: Mod - ENV, COMBINED, + + + */ + + + { + {0x04070403, 0x00060003, 0x00020006, 0x00020007}, // Simplified mux + 0x00129804, 0x3F15FFFF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000005}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {LERP(CUR,T1,ENV), MOD(CUR,ENV), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x0062fe043f15f9ff Overflowed in BANJO TOOIE + Color0: (1 - PRIM) * ENV + PRIM + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (0 - 0) * 0 + SHADE + Alpha1: (COMBINED - 0) * ENV + 0 + + //Simplied Mux=0x0062fe043f15f9ff Overflowed in BANJO TOOIE + Simplied DWORDs=03070301, 06000000, 00020006, 02000000 + Color0: (1 - TEXEL0) * ENV + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + SHADE + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Shade = 00070006 in alpha channel + Tex 0 = PRIM + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: AddSmooth - TEXEL0, ENV, + 1:Color: Mod - SHADE, COMBINED, + 0:Alpha: Sel - SHADE, , + 1:Alpha: Sel - COMBINED, , + + + */ + + + { + {0x03070301, 0x06000000, 0x00020006, 0x02000000}, // Simplified mux + 0x0062FE04, 0x3F15F9FF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000005, 0x00000000}, // constant color texture flags + { + {MULADD(T0C,ENV,T0), SEL(DIF), 0, true}, // Stage 0 + {MOD(CUR,DIF), SKIP, 0, true}, // Stage 1 + } + }, + + + /* + //Mux=0x0025266015fc9378 Overflowed in ZELDA MAJORA'S MASK + Color0: (TEXEL1 - TEXEL0) * PRIM|A + TEXEL0 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (TEXEL1 - TEXEL0) * PRIM + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + + //Simplied Mux=0x0025266015fc9378 Overflowed in ZELDA MAJORA'S MASK + Simplied DWORDs=03460304, 03060304, 06020605, 02000000 + Color0: (TEXEL1 - TEXEL0) * SHADE|A + TEXEL0 + Color1: (PRIM - SHADE) * COMBINED + SHADE + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Shade = ENV in color channel + Shade = PRIM in alpha channel + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: BlDifA - TEXEL1, COMBINED, -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlDifA - TEXEL1, COMBINED, -Tex1 + + + */ + + + { + {0x03460304, 0x03060304, 0x06020605, 0x02000000}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000007, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {LERP(PRI,DIF,T0), SEL(T0), 0, true}, // Stage 0 + {LERP(T1,CUR,DIFA), SKIP, 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x0061a5ff1f10d23f Overflowed in PAPER MARIO + Color0: (1 - TEXEL0) * PRIM + TEXEL0 + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL1 - ENV) * TEXEL1 + TEXEL0 + Alpha1: (COMBINED - 0) * SHADE + 0 + + //Simplied Mux=0x0061a5ff1f10d23f Overflowed in PAPER MARIO + Simplied DWORDs=03060301, 03040704, 02000000, 00020006 + Color0: (1 - TEXEL0) * SHADE + TEXEL0 + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL1 - ENV) * TEXEL1 + TEXEL0 + Alpha1: (SHADE - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE_NOT_CHECKED + Shade = PRIM in color channel + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: AddSmooth - TEXEL0, SHADE, + 1:Color: Sel - COMBINED, , -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: Mod - COMBINED, TEXEL1, -Tex1 + + + */ + + + { + {0x03060301, 0x03040704, 0x02000000, 0x00020006}, // Simplified mux + 0x0061A5FF, 0x1F10D23F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000005, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MULADD(T0C,DIF,T0), MOD(T0,DIF), 0, true}, // Stage 0 + {SKIP, LERP(T1,ENV,CUR), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x00322bff5f0e923f Overflowed in PAPER MARIO + Color0: (PRIM - ENV) * SHADE + ENV + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL1 - TEXEL0) * ENV + TEXEL0 + Alpha1: (COMBINED - 0) * PRIM + 0 + + //Simplied Mux=0x00322bff5f0e923f Overflowed in PAPER MARIO + Simplied DWORDs=06000000, 03070304, 02000000, 00020006 + Color0: (0 - 0) * 0 + SHADE + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL1 - TEXEL0) * ENV + TEXEL0 + Alpha1: (SHADE - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Shade = 07060705 in color channel + Shade = PRIM in alpha channel + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - SHADE, , + 1:Color: Sel - COMBINED, , -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlFacA - TEXEL1, COMBINED, -Tex1 + + + */ + + + { + {0x06000000, 0x03070304, 0x02000000, 0x00020006}, // Simplified mux + 0x00322BFF, 0x5F0E923F, // 64bit Mux + 23, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x07060705, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {SEL(DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {SKIP, LERP(T1,CUR,ENV), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x0010e5e0230b157f Overflowed in PAPER MARIO + Color0: (TEXEL0 - TEXEL1) * TEXEL0 + 1 + Color1: (0 - PRIM) * COMBINED + ENV + Alpha0: (1 - TEXEL0) * TEXEL1 + TEXEL1 + Alpha1: (COMBINED - 0) * TEXEL1 + 0 + + //Simplied Mux=0x0010e5e0230b157f Overflowed in PAPER MARIO + Simplied DWORDs=00010600, 04830004, 02010007, 00020004 + Color0: (0 - SHADE) * 1 + 0 + Color1: (ENV - 0) * 1 + COMBINED + Alpha0: (TEXEL1 - 0) * TEXEL0|C + TEXEL1 + Alpha1: (TEXEL1 - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE7_A_SUB_B_ADD_D + Shade = PRIM in color channel + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sub - 0, SHADE, + 1:Color: Add - ENV, COMBINED, -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: MulAdd - TEXEL1, COMBINED|C, TEXEL1 -Tex1 + + + */ + + + { + {0x00010600, 0x04830004, 0x02010007, 0x00020004}, // Simplified mux + 0x0010E5E0, 0x230B157F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000005, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MULADD(T0,DIF,ENV), SEL(T0), 0, true}, // Stage 0 + {SKIP, MULADD(CURC,T1,T1), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x00117e045ffef3f8 Overflowed in RIDGE RACER 64 + Color0: (TEXEL0 - ENV) * TEXEL1 + ENV + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (0 - 0) * 0 + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + + //Simplied Mux=0x00117e045ffef3f8 Overflowed in RIDGE RACER 64 + Simplied DWORDs=07040703, 03000000, 00020006, 02000000 + Color0: (TEXEL0 - ENV) * TEXEL1 + ENV + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: Lerp - COMBINED, ENV, TEXEL1 -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: Sel - COMBINED, , -Tex1 + + + */ + + + { + {0x07040703, 0x03000000, 0x00020006, 0x02000000}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T1,DIF), SKIP, 1, true}, // Stage 0 + {LERP(T0,ENV,CUR), SEL(T0), 0, true}, // Stage 1 + } + }, + + + /* + //Mux=0x0040b467f0fffe3e Overflowed in RIDGE RACER 64 + Color0: (SHADE - 0) * TEXEL0 + 0 + Color1: (PRIM - COMBINED) * COMBINED|A + COMBINED + Alpha0: (PRIM - 0) * TEXEL1 + 0 + Alpha1: (0 - 0) * 0 + 1 + + //Simplied Mux=0x0040b467f0fffe3e Overflowed in RIDGE RACER 64 + Simplied DWORDs=00060003, 00050004, 02420205, 01000000 + Color0: (TEXEL0 - 0) * SHADE + 0 + Color1: (PRIM - COMBINED) * COMBINED|A + COMBINED + Alpha0: (TEXEL1 - 0) * PRIM + 0 + Alpha1: (0 - 0) * 0 + 1 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + + Generated combiners: + + Stages:2, Alpha:DISABLE_ALPHA, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Mod - TEXEL0, SHADE, + 1:Color: BlCurA - PRIM, COMBINED, -Tex1 + 0:Alpha: Sel - COMBINED, , + 1:Alpha: Mod - TEXEL1, PRIM, -Tex1 + + + */ + + + { + {0x00060003, 0x00050004, 0x02420205, 0x01000000}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SKIP, 0, true}, // Stage 0 + //{LERP(PRI,CUR,CURA), MOD(T1,PRI), 1, true}, // Stage 1 + {SKIP, MOD(T1,PRI), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x0022aa041f0c93ff Overflowed in RIDGE RACER 64 + Color0: (TEXEL1 - TEXEL0) * ENV + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL1 - TEXEL0) * ENV + TEXEL0 + Alpha1: (COMBINED - 0) * PRIM + 0 + + //Simplied Mux=0x0022aa041f0c93ff Overflowed in RIDGE RACER 64 + Simplied DWORDs=03070304, 03070304, 00020006, 00020006 + Color0: (TEXEL1 - TEXEL0) * ENV + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL1 - TEXEL0) * ENV + TEXEL0 + Alpha1: (SHADE - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Shade = PRIM in alpha channel + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: Lerp - TEXEL1, COMBINED, ENV -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlFacA - TEXEL1, COMBINED, -Tex1 + + + */ + + + { + {0x03070304, 0x03070304, 0x00020006, 0x00020006}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {LERP(T1,CUR,ENV), LERP(T1,CUR,ENV), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x0030fe045ffef3f8 Overflowed in RIDGE RACER 64 + Color0: (PRIM - ENV) * TEXEL0 + ENV + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (0 - 0) * 0 + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + + //Simplied Mux=0x0030fe045ffef3f8 Overflowed in RIDGE RACER 64 + Simplied DWORDs=07030704, 03000000, 00020006, 02000000 + Color0: (TEXEL1 - ENV) * TEXEL0 + ENV + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Tex 1 = PRIM + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: Lerp - TEXEL1, ENV, COMBINED -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: Sel - COMBINED, , -Tex1 + + + */ + + + { + {0x07030704, 0x03000000, 0x00020006, 0x02000000}, // Simplified mux + 0x0030FE04, 0x5FFEF3F8, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000005}, // constant color texture flags + { + {MOD(T0,DIF), SEL(T0), 0, true}, // Stage 0 + {LERP(T1,ENV,CUR), SKIP, 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x00272c041ffc93f8 Overflowed in RIDGE RACER 64 + Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL1 - TEXEL0) * 1 + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + + //Simplied Mux=0x00272c041ffc93f8 Overflowed in RIDGE RACER 64 + Simplied DWORDs=030F0304, 04000000, 00020006, 02000000 + Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + TEXEL1 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: Lerp - TEXEL1, COMBINED, PRIMLODFRAC -Tex1 + 0:Alpha: Sel - COMBINED, , + 1:Alpha: Sel - TEXEL1, , -Tex1 + + + */ + + + { + {0x030F0304, 0x04000000, 0x00020006, 0x02000000}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIMLODFRAC, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SKIP, 0, true}, // Stage 0 + {LERP(T1,CUR,PRIMLODFRAC), SEL(T1), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x00272c6015fc9378 Overflowed in RIDGE RACER 64 + Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (TEXEL1 - TEXEL0) * 1 + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + + //Simplied Mux=0x00272c6015fc9378 Overflowed in RIDGE RACER 64 + Simplied DWORDs=030F0304, 04000000, 06020605, 02000000 + Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (PRIM - SHADE) * COMBINED + SHADE + Alpha0: (0 - 0) * 0 + TEXEL1 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Shade = ENV in color channel + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: Lerp - TEXEL1, COMBINED, PRIMLODFRAC -Tex1 + 0:Alpha: Sel - COMBINED, , + 1:Alpha: Sel - TEXEL1, , -Tex1 + + + */ + + + { + {0x030F0304, 0x04000000, 0x06020605, 0x02000000}, // Simplified mux + 0x00272C60, 0x15FC9378, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIMLODFRAC, // Constant color + 0x00000705, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(DIF,T0), SKIP, 0, true}, // Stage 0 + {LERP(T1,CUR,PRIMLODFRAC), SEL(T1), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x001516032f1125ff Overflowed in CASTLEVANIA2 + Color0: (TEXEL0 - TEXEL1) * PRIM|A + TEXEL1 + Color1: (COMBINED - 0) * PRIM + 0 + Alpha0: (TEXEL0 - TEXEL1) * PRIM + TEXEL1 + Alpha1: (COMBINED - 0) * SHADE + 0 + + //Simplied Mux=0x001516032f1125ff Overflowed in CASTLEVANIA2 + Simplied DWORDs=04460403, 04060403, 00020006, 00020006 + Color0: (TEXEL0 - TEXEL1) * SHADE|A + TEXEL1 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL0 - TEXEL1) * SHADE + TEXEL1 + Alpha1: (SHADE - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Shade = PRIM in color channel + Shade = PRIM in alpha channel + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: BlDifA - COMBINED, TEXEL1, -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlDifA - COMBINED, TEXEL1, -Tex1 + + + */ + + + { + {0x04460403, 0x04060403, 0x00020006, 0x00020006}, // Simplified mux + 0x00151603, 0x2F1125FF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,PRI), MOD(T0,DIF), 0, true}, // Stage 0 + {LERP(T0,T1,PRIA), LERP(T0,T1,PRI), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x001516602515257f Overflowed in CASTLEVANIA2 + Color0: (TEXEL0 - TEXEL1) * PRIM|A + TEXEL1 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (TEXEL0 - TEXEL1) * PRIM + TEXEL1 + Alpha1: (COMBINED - 0) * ENV + 0 + + //Simplied Mux=0x001516602515257f Overflowed in CASTLEVANIA2 + Simplied DWORDs=04450403, 04050403, 06020605, 00020006 + Color0: (TEXEL0 - TEXEL1) * PRIM|A + TEXEL1 + Color1: (PRIM - SHADE) * COMBINED + SHADE + Alpha0: (TEXEL0 - TEXEL1) * PRIM + TEXEL1 + Alpha1: (SHADE - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Shade = ENV in color channel + Shade = ENV in alpha channel + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: BlFacA - COMBINED, TEXEL1, -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlFacA - COMBINED, TEXEL1, -Tex1 + + + */ + + + { + {0x04450403, 0x04050403, 0x06020605, 0x00020006}, // Simplified mux + 0x00151660, 0x2515257F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000007, 0x00000007, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {LERP(PRI,DIF,T0), MOD(T0,DIF), 0, true}, // Stage 0 + {LERP(T0,T1,PRIA), LERP(T0,T1,PRI), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x001516032f1525ff Overflowed in CASTLEVANIA2 + Color0: (TEXEL0 - TEXEL1) * PRIM|A + TEXEL1 + Color1: (COMBINED - 0) * PRIM + 0 + Alpha0: (TEXEL0 - TEXEL1) * PRIM + TEXEL1 + Alpha1: (COMBINED - 0) * ENV + 0 + + //Simplied Mux=0x001516032f1525ff Overflowed in CASTLEVANIA2 + Simplied DWORDs=04460403, 04060403, 00020006, 00020007 + Color0: (TEXEL0 - TEXEL1) * SHADE|A + TEXEL1 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL0 - TEXEL1) * SHADE + TEXEL1 + Alpha1: (ENV - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Shade = PRIM in color channel + Shade = PRIM in alpha channel + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: BlDifA - COMBINED, TEXEL1, -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlDifA - COMBINED, TEXEL1, -Tex1 + + + */ + + + { + {0x04460403, 0x04060403, 0x00020006, 0x00020007}, // Simplified mux + 0x00151603, 0x2F1525FF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000005, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,ENV), 0, true}, // Stage 0 + {LERP(T0,T1,DIFA), LERP(T0,T1,DIF), 1, true}, // Stage 1 + } + }, + + + + /* + //Mux=0x00ffd5fffffcf238 Overflowed in CASTLEVANIA + Color0: (0 - 0) * 0 + TEXEL0 + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (ENV - 0) * TEXEL1 + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + + //Simplied Mux=0x00ffd5fffffcf238 Overflowed in CASTLEVANIA + Simplied DWORDs=03000000, 00060004, 02000000, 02010003 + Color0: (0 - 0) * 0 + TEXEL0 + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL1 - 0) * SHADE + 0 + Alpha1: (TEXEL0 - 0) * 1 + COMBINED + Simplfied type: CM_FMT_TYPE5_A_MOD_C_ADD_D + Shade = ENV in alpha channel + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: Sel - COMBINED, , -Tex1 + 0:Alpha: Sel - COMBINED, , + 1:Alpha: Mod - TEXEL1, SHADE, -Tex1 + + + */ + + + { + {0x03000000, 0x00060004, 0x02000000, 0x02010003}, // Simplified mux + 0x00FFD5FF, 0xFFFCF238, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {SKIP, MOD(T0,DIF), 1, true}, // Stage 0 + {SEL(T0), ADD(T0,CUR), 0, true}, // Stage 1 + } + }, + + + /* + //Mux=0x0026a0041f0c93ff Overflowed in NEWTETRIS + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL1 - TEXEL0) * COMBINED + TEXEL0 + Alpha1: (COMBINED - 0) * PRIM + 0 + + //Simplied Mux=0x0026a0041f0c93ff Overflowed in NEWTETRIS + Simplied DWORDs=00060003, 03060304, 02000000, 00020005 + Color0: (TEXEL0 - 0) * SHADE + 0 + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (PRIM - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Mod - TEXEL0, SHADE, + 1:Color: Sel - COMBINED, , -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlDifA - TEXEL1, COMBINED, -Tex1 + + + */ + + + { + {0x00060003, 0x03060304, 0x02000000, 0x00020005}, // Simplified mux + 0x0026A004, 0x1F0C93FF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_LODFRAC, // Constant color + 0x00000000, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {LERP(T1,CUR,LODFRAC), LERP(T1,CUR,LODFRAC), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x0017166045fe7f78 Overflowed in DOUBUTSUNOMORI + Color0: (TEXEL0 - SHADE) * PRIMLODFRAC + SHADE + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (TEXEL0 - 0) * PRIM + 0 + Alpha1: (0 - 0) * 0 + COMBINED + + //Simplied Mux=0x0017166045fe7f78 Overflowed in DOUBUTSUNOMORI + Simplied DWORDs=060F0603, 04000000, 07020704, 00020003 + Color0: (TEXEL0 - SHADE) * PRIMLODFRAC + SHADE + Color1: (TEXEL1 - ENV) * COMBINED + ENV + Alpha0: (0 - 0) * 0 + TEXEL1 + Alpha1: (TEXEL0 - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Tex 1 = PRIM + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Lerp - TEXEL0, SHADE, PRIMLODFRAC + 1:Color: Lerp - TEXEL1, ENV, COMBINED -Tex1 + 0:Alpha: Sel - COMBINED, , + 1:Alpha: Sel - TEXEL1, , -Tex1 + + + */ + + + { + {0x060F0603, 0x04000000, 0x07020704, 0x00020003}, // Simplified mux + 0x00171660, 0x45FE7F78, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIMLODFRAC, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000005}, // constant color texture flags + { + {MOD(T1,DIF), SEL(T1), 1, true}, // Stage 0 + {LERP(T0,CUR,PRIMLODFRAC), MOD(T0,CUR), 0, true}, // Stage 1 + } + }, + + + /* + //Mux=0x003095ff5f1af43f Overflowed in DOUBUTSUNOMORI + Color0: (PRIM - ENV) * TEXEL0 + ENV + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL0 - 0) * TEXEL1 + TEXEL1 + Alpha1: (COMBINED - 0) * 1 + 0 + + //Simplied Mux=0x003095ff5f1af43f Overflowed in DOUBUTSUNOMORI + Simplied DWORDs=06030605, 00030004, 02000000, 02010004 + Color0: (PRIM - SHADE) * TEXEL0 + SHADE + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL1 - 0) * TEXEL0 + 0 + Alpha1: (TEXEL1 - 0) * 1 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Shade = ENV in color channel + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Lerp - PRIM, SHADE, TEXEL0 -Tex1 + 1:Color: Sel - COMBINED, , + 0:Alpha: Sel - TEXEL1, , -Tex1 + 1:Alpha: Mod - TEXEL0, COMBINED, + + + */ + + + { + {0x06030605, 0x00030004, 0x02000000, 0x02010004}, // Simplified mux + 0x003095FF, 0x5F1AF43F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000007, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {LERP(PRI,DIF,T0), SEL(T0), 0, true}, // Stage 0 + {SKIP, MULADD(CUR,T1,T1), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x003717fffffefe38 Overflowed in DOUBUTSUNOMORI + Color0: (PRIM - 0) * PRIMLODFRAC + ENV + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL0 - 0) * PRIM + 0 + Alpha1: (0 - 0) * 0 + COMBINED + + //Simplied Mux=0x003717fffffefe38 Overflowed in DOUBUTSUNOMORI + Simplied DWORDs=000F0006, 00060003, 02010004, 02000000 + Color0: (SHADE - 0) * PRIMLODFRAC + 0 + Color1: (TEXEL1 - 0) * 1 + COMBINED + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE5_A_MOD_C_ADD_D + Shade = PRIM in color channel + Shade = PRIM in alpha channel + Tex 1 = ENV + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Mod - SHADE, PRIMLODFRAC, + 1:Color: Add - TEXEL1, COMBINED, -Tex1 + 0:Alpha: Mod - TEXEL0, SHADE, + 1:Alpha: Sel - COMBINED, , -Tex1 + + + */ + + { + {0x000F0006, 0x00060003, 0x02010004, 0x02000000}, // Simplified mux + 0x003717FF, 0xFFFEFE38, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIMLODFRAC, // Constant color + 0x00000005, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000007}, // constant color texture flags + { + {MOD(DIF,PRIMLODFRAC), MOD(T0,DIF), 0, true}, // Stage 0 + {ADD(T1,CUR), SKIP, 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x00272a8013fc92f8 Overflowed in THE LEGEND OF ZELDA + Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (SHADE - PRIM) * COMBINED + PRIM + Alpha0: (TEXEL1 - TEXEL0) * ENV + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + + //Simplied Mux=0x00272a8013fc92f8 Overflowed in THE LEGEND OF ZELDA + Simplied DWORDs=030F0304, 03060304, 05020506, 02000000 + Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (SHADE - PRIM) * COMBINED + PRIM + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Shade = ENV in alpha channel + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sel - TEXEL0, , + 1:Color: Lerp - TEXEL1, COMBINED, PRIMLODFRAC -Tex1 + 0:Alpha: Sel - TEXEL0, , + 1:Alpha: BlDifA - TEXEL1, COMBINED, -Tex1 + + + */ + + + { + {0x030F0304, 0x03060304, 0x05020506, 0x02000000}, // Simplified mux + 0x00272A80, 0x13FC92F8, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000000, 0x00000007, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {LERP(DIF,PRI,T0), SEL(T0), 0, true}, // Stage 0 + {SKIP, LERP(T1,CUR,DIF), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00127e60f5fffd78 Overflowed in THE LEGEND OF ZELDA + Color0: (TEXEL0 - 0) * SHADE + 0 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (0 - 0) * 0 + 1 + Alpha1: (0 - 0) * 0 + COMBINED + + //Simplied Mux=0x00127e60f5fffd78 Overflowed in THE LEGEND OF ZELDA + Simplied DWORDs=00060003, 01000000, 07020704, 02000000 + Color0: (TEXEL0 - 0) * SHADE + 0 + Color1: (TEXEL1 - ENV) * COMBINED + ENV + Alpha0: (0 - 0) * 0 + 1 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_C + Tex 1 = PRIM + + Generated combiners: + + Stages:2, Alpha:DISABLE_ALPHA, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Mod - TEXEL0, SHADE, + 1:Color: Lerp - TEXEL1, ENV, COMBINED -Tex1 + 0:Alpha: Sel - COMBINED, , + 1:Alpha: Sel - COMBINED, , -Tex1 + + + */ + + + { + {0x00060003, 0x01000000, 0x07020704, 0x02000000}, // Simplified mux + 0x00127E60, 0xF5FFFD78, // 64bit Mux + 2, // number of stages + DISABLE_ALPHA, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000005}, // constant color texture flags + { + {MOD(T0,DIF), SKIP, 0, true}, // Stage 0 + {LERP(T1,ENV,CUR), SKIP, 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x0020ac60350c937f Overflowed in THE LEGEND OF ZELDA + Color0: (TEXEL1 - PRIM) * TEXEL0 + TEXEL0 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (TEXEL1 - TEXEL0) * 1 + TEXEL0 + Alpha1: (COMBINED - 0) * PRIM + 0 + + //Simplied Mux=0x0020ac60350c937f Overflowed in THE LEGEND OF ZELDA + Simplied DWORDs=00038604, 00060004, 07020706, 02000000 + Color0: (TEXEL1 - SHADE|C) * TEXEL0 + 0 + Color1: (SHADE - ENV) * COMBINED + ENV + Alpha0: (TEXEL1 - 0) * SHADE + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE8_A_SUB_B_MOD_C + Shade = PRIM in color channel + Shade = PRIM in alpha channel + + Generated combiners: + + Stages:2, Alpha:ENABLE_BOTH, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Sub - TEXEL1, SHADE|C, -Tex1 + 1:Color: Mod - COMBINED, TEXEL0, + 0:Alpha: Mod - TEXEL1, SHADE, -Tex1 + 1:Alpha: Sel - COMBINED, , + + + */ + + + { + {0x00038604, 0x00060004, 0x07020706, 0x02000000}, // Simplified mux + 0x0020AC60, 0x350C937F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000005, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {LERP(DIF,ENV,T0), MOD(T0,DIF), 0, true}, // Stage 0 + {MOD(T1,CUR), MOD(T1,DIF), 1, true}, // Stage 1 + } + }, + + + /* + //Mux=0x00177e6035fcfd7e Overflowed in THE LEGEND OF ZELDA + Color0: (TEXEL0 - PRIM) * PRIMLODFRAC + TEXEL0 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (0 - 0) * 0 + 1 + Alpha1: (0 - 0) * 0 + 1 + + //Simplied Mux=0x00177e6035fcfd7e Overflowed in THE LEGEND OF ZELDA + Simplied DWORDs=030F0603, 01000000, 04020406, 02000000 + Color0: (TEXEL0 - SHADE) * PRIMLODFRAC + TEXEL0 + Color1: (SHADE - TEXEL1) * COMBINED + TEXEL1 + Alpha0: (0 - 0) * 0 + 1 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: Color0 + Shade = PRIM in color channel + Tex 1 = ENV + + Generated combiners: + + Stages:2, Alpha:DISABLE_ALPHA, Factor:0, Specular:0 Dif Color:0xCCCCCCCC Dif Alpha:0xCCCCCCCC + 0:Color: Lerp - TEXEL0, SHADE, PRIMLODFRAC + 1:Color: Lerp - SHADE, TEXEL1, COMBINED -Tex1 + 0:Alpha: Sel - COMBINED, , + 1:Alpha: Sel - COMBINED, , -Tex1 + + + */ + + + { + {0x030F0603, 0x01000000, 0x04020406, 0x02000000}, // Simplified mux + 0x00177E60, 0x35FCFD7E, // 64bit Mux + 2, // number of stages + DISABLE_ALPHA, + MUX_PRIMLODFRAC, // Constant color + 0x00000005, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000007}, // constant color texture flags + { + {LERP(T0,DIF,PRIMLODFRAC), SKIP, 0, true}, // Stage 0 + {LERP(DIF,T1,CUR), SKIP, 0, true}, // Stage 1 + } + }, + + + /* + //Mux=0x00276c6035d8ed76 Overflowed in THE LEGEND OF ZELDA + Color0: (TEXEL1 - PRIM) * PRIMLODFRAC + TEXEL0 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (1 - 1) * 1 + 1 + Alpha1: (1 - 1) * 1 + 1 + //Simplied Mux=0x00276c6035d8ed76 Overflowed in THE LEGEND OF ZELDA + Simplied DWORDs=030F0604, 01000000, 07020706, 02000000Color0: (TEXEL1 - SHADE) * PRIMLODFRAC + TEXEL0 + Color1: (SHADE - ENV) * COMBINED + ENV + Alpha0: (0 - 0) * 0 + 1 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE_NOT_CHECKEDGenerated combiners: + */ + + + { + {0x030F0604, 0x01000000, 0x07020706, 0x02000000}, // Simplified mux + 0x00276C60, 0x35D8ED76, // 64bit Mux + 2, // number of stages + DISABLE_ALPHA, + MUX_PRIMLODFRAC, // Constant color + 0x00000005, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SKIP, 0, true}, // Stage 0 + {LERP(T1,CUR,PRIMLODFRAC), SKIP, 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00277e60150cf37f Overflowed in THE LEGEND OF ZELDA + Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (0 - 0) * 0 + TEXEL0 + Alpha1: (COMBINED - 0) * PRIM + 0 + + //Simplied Mux=0x00277e60150cf37f Overflowed in THE LEGEND OF ZELDA + Simplied DWORDs=030F0304, 00060003, 06020605, 02000000Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (PRIM - SHADE) * COMBINED + SHADE + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x030F0304, 0x00060003, 0x06020605, 0x02000000}, // Simplified mux + 0x00277E60, 0x150CF37F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIMLODFRAC, // Constant color + 0x00000007, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {LERP(T1,CUR,PRIMLODFRAC), SKIP, 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x001596a430fdfe38 Overflowed in Diddy Kong Racing + Color0: (TEXEL0 - PRIM) * SHADE|A + PRIM + Color1: (ENV - COMBINED) * SHADE + COMBINED + Alpha0: (TEXEL0 - 0) * PRIM + 0 + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x001596a430fdfe38 Overflowed in Diddy Kong Racing + Simplied DWORDs=04460403, 04000000, 02060207, 00020003Color0: (TEXEL0 - TEXEL1) * SHADE|A + TEXEL1 + Color1: (ENV - COMBINED) * SHADE + COMBINED + Alpha0: (0 - 0) * 0 + TEXEL1 + Alpha1: (TEXEL0 - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x04460403, 0x04000000, 0x02060207, 0x00020003}, // Simplified mux + 0x001596A4, 0x30FDFE38, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000007}, // constant color texture flags + { + {LERP(T0,PRI,DIFA), MOD(T0,PRI), 0, true}, // Stage 0 + {LERP(T1,CUR,DIF), SKIP, 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x001218acf00ffe3f Overflowed in Diddy Kong Racing + Color0: (TEXEL0 - 0) * SHADE + 0 + Color1: (ENV - COMBINED) * ENV|A + COMBINED + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (COMBINED - 0) * PRIM + 0 + + + //Simplied Mux=0x001218acf00ffe3f Overflowed in Diddy Kong Racing + Simplied DWORDs=00060003, 00060003, 02470207, 00020004Color0: (TEXEL0 - 0) * SHADE + 0 + Color1: (ENV - COMBINED) * ENV|A + COMBINED + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (TEXEL1 - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x00060003, 0x00060003, 0x02470207, 0x00020004}, // Simplified mux + 0x001218AC, 0xF00FFE3F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000005}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {LERP(ENV,CUR,ENVA), MOD(T1,CUR), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x002266ac1010923f Overflowed in Diddy Kong Racing + Color0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Color1: (ENV - COMBINED) * ENV|A + COMBINED + Alpha0: (1 - TEXEL0) * PRIM + TEXEL0 + Alpha1: (COMBINED - 0) * SHADE + 0 + + + //Simplied Mux=0x002266ac1010923f Overflowed in Diddy Kong Racing + Simplied DWORDs=03060304, 03050301, 02470207, 00020006Color0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Color1: (ENV - COMBINED) * ENV|A + COMBINED + Alpha0: (1 - TEXEL0) * PRIM + TEXEL0 + Alpha1: (SHADE - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x03060304, 0x03050301, 0x02470207, 0x00020006}, // Simplified mux + 0x002266AC, 0x1010923F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {LERP(ENV,T0,ENVA), MOD(T0,DIF), 0, true}, // Stage 0 + {LERP(T1,CUR,DIF), SKIP, 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x0030fe045ffefbf8 Overflowed in F-ZERO X + Color0: (PRIM - ENV) * TEXEL0 + ENV + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (0 - 0) * 0 + ENV + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x0030fe045ffefbf8 Overflowed in F-ZERO X + Simplied DWORDs=07030704, 06000000, 00020006, 02000000Color0: (TEXEL1 - ENV) * TEXEL0 + ENV + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + SHADE + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x07030704, 0x06000000, 0x00020006, 0x02000000}, // Simplified mux + 0x0030FE04, 0x5FFEFBF8, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000005}, // constant color texture flags + { + {MOD(T0,DIF), SEL(ENV), 0, true}, // Stage 0 + {LERP(T1,ENV,CUR), SKIP, 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x0026a0801f0c93ff Overflowed in ROCKETROBOTONWHEELS + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL1 - TEXEL0) * COMBINED + TEXEL0 + Alpha1: (COMBINED - 0) * PRIM + 0 + + + //Simplied Mux=0x0026a0801f0c93ff Overflowed in ROCKETROBOTONWHEELS + Simplied DWORDs=030E0304, 03060304, 00020006, 00020005Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (PRIM - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x030E0304, 0x03060304, 0x00020006, 0x00020005}, // Simplified mux + 0x0026A080, 0x1F0C93FF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_LODFRAC, // Constant color + 0x00000000, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {LERP(T1,CUR,LODFRAC), LERP(T1,CUR,LODFRAC), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00272c60150c937f Overflowed in POKEMON STADIUM + Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (TEXEL1 - TEXEL0) * 1 + TEXEL0 + Alpha1: (COMBINED - 0) * PRIM + 0 + + + //Simplied Mux=0x00272c60150c937f Overflowed in POKEMON STADIUM + Simplied DWORDs=030F0304, 00060004, 06020605, 02000000Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (PRIM - SHADE) * COMBINED + SHADE + Alpha0: (TEXEL1 - 0) * SHADE + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x030F0304, 0x00060004, 0x06020605, 0x02000000}, // Simplified mux + 0x00272C60, 0x150C937F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIMLODFRAC, // Constant color + 0x00000007, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SKIP, 0, true}, // Stage 0 + {LERP(T1,CUR,PRIMLODFRAC), MOD(T1,DIF), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00162a0325fe13f8 Overflowed in POKEMON STADIUM + Color0: (TEXEL0 - TEXEL1) * ENV|A + SHADE + Color1: (COMBINED - ENV) * PRIM + 0 + Alpha0: (TEXEL1 - TEXEL0) * ENV + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x00162a0325fe13f8 Overflowed in POKEMON STADIUM + Simplied DWORDs=06460403, 03060304, 00050702, 02000000Color0: (TEXEL0 - TEXEL1) * SHADE|A + SHADE + Color1: (COMBINED - ENV) * PRIM + 0 + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE_NOT_CHECKEDGenerated combiners: + */ + + + { + {0x06460403, 0x03060304, 0x00050702, 0x02000000}, // Simplified mux + 0x00162A03, 0x25FE13F8, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SEL(T0), 0, true}, // Stage 0 + {LERP(CUR,T1,ENVA), LERP(T1,CUR,ENV), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00167e03f5fe77f8 Overflowed in POKEMON STADIUM + Color0: (TEXEL0 - 0) * ENV|A + SHADE + Color1: (COMBINED - ENV) * PRIM + 0 + Alpha0: (0 - 0) * 0 + PRIM + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x00167e03f5fe77f8 Overflowed in POKEMON STADIUM + Simplied DWORDs=06470003, 04000000, 00040702, 02000000Color0: (TEXEL0 - 0) * ENV|A + SHADE + Color1: (COMBINED - ENV) * TEXEL1 + 0 + Alpha0: (0 - 0) * 0 + TEXEL1 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE8_A_SUB_B_MOD_CGenerated combiners: + */ + + + { + {0x06470003, 0x04000000, 0x00040702, 0x02000000}, // Simplified mux + 0x00167E03, 0xF5FE77F8, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000005}, // constant color texture flags + { + {MULADD(T0,ENVA,DIF), SKIP, 0, true}, // Stage 0 + {MOD(CUR,T1), SEL(T1), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x002698801514feff Overflowed in CONKER BFD + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (SHADE - ENV) * COMBINED + PRIM + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (COMBINED - 0) * ENV + 0 + + + //Simplied Mux=0x002698801514feff Overflowed in CONKER BFD + Simplied DWORDs=00030706, 00060003, 02010004, 00020007Color0: (SHADE - ENV) * TEXEL0 + 0 + Color1: (TEXEL1 - 0) * 1 + COMBINED + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (ENV - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE_NOT_CHECKEDShade = 00000706 in color channelGenerated combiners: + */ + + + { + {0x00030706, 0x00060003, 0x02010004, 0x00020007}, // Simplified mux + 0x00269880, 0x1514FEFF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_LODFRAC, // Constant color + 0x00000706, 0x00070006, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {LERP(T1,CUR,LODFRAC), SKIP, 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00127e04f513f4ff Overflowed in CONKER BFD + Color0: (TEXEL0 - 0) * SHADE + 0 + Color1: (COMBINED - ENV) * SHADE + PRIM + Alpha0: (0 - 0) * 0 + TEXEL1 + Alpha1: (COMBINED - 0) * SHADE + 0 + + + //Simplied Mux=0x00127e04f513f4ff Overflowed in CONKER BFD + Simplied DWORDs=00060003, 00060004, 05060702, 02000000Color0: (TEXEL0 - 0) * SHADE + 0 + Color1: (COMBINED - ENV) * SHADE + PRIM + Alpha0: (TEXEL1 - 0) * SHADE + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE_NOT_CHECKEDGenerated combiners: + */ + + + { + {0x00060003, 0x00060004, 0x05060702, 0x02000000}, // Simplified mux + 0x00127E04, 0xF513F4FF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SKIP, 0, true}, // Stage 0 + {MULADD(CUR,DIF,PRI), MOD(T1,DIF), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00277e60350cf37f Overflowed in THE MASK OF MUJURA + Color0: (TEXEL1 - PRIM) * PRIMLODFRAC + TEXEL0 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (0 - 0) * 0 + TEXEL0 + Alpha1: (COMBINED - 0) * PRIM + 0 + + + //Simplied Mux=0x00277e60350cf37f Overflowed in THE MASK OF MUJURA + Simplied DWORDs=030F0604, 00060003, 07020706, 02000000Color0: (TEXEL1 - SHADE) * PRIMLODFRAC + TEXEL0 + Color1: (SHADE - ENV) * COMBINED + ENV + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE_NOT_CHECKEDGenerated combiners: + */ + + + { + {0x030F0604, 0x00060003, 0x07020706, 0x02000000}, // Simplified mux + 0x00277E60, 0x350CF37F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIMLODFRAC, // Constant color + 0x00000005, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {MULADD(T1,PRIMLODFRAC,CUR), SKIP, 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00272c041f0c93ff Overflowed in THE MASK OF MUJURA + Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL1 - TEXEL0) * 1 + TEXEL0 + Alpha1: (COMBINED - 0) * PRIM + 0 + + + //Simplied Mux=0x00272c041f0c93ff Overflowed in THE MASK OF MUJURA + Simplied DWORDs=030F0304, 00060004, 00020006, 02000000Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL1 - 0) * SHADE + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x030F0304, 0x00060004, 0x00020006, 0x02000000}, // Simplified mux + 0x00272C04, 0x1F0C93FF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIMLODFRAC, // Constant color + 0x00000000, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SKIP, 0, true}, // Stage 0 + {LERP(T1,CUR,PRIMLODFRAC), MOD(T1,DIF), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x002714041f0cffff Overflowed in THE MASK OF MUJURA + Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL0 - 0) * TEXEL1 + 0 + Alpha1: (COMBINED - 0) * PRIM + 0 + + + //Simplied Mux=0x002714041f0cffff Overflowed in THE MASK OF MUJURA + Simplied DWORDs=030F0304, 00060003, 00020006, 00020004Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (TEXEL1 - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x030F0304, 0x00060003, 0x00020006, 0x00020004}, // Simplified mux + 0x00271404, 0x1F0CFFFF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIMLODFRAC, // Constant color + 0x00000000, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {LERP(T1,CUR,PRIMLODFRAC), MOD(T1,CUR), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x002722041f0cffff Overflowed in THE MASK OF MUJURA + Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL1 - 0) * TEXEL0 + 0 + Alpha1: (COMBINED - 0) * PRIM + 0 + + + //Simplied Mux=0x002722041f0cffff Overflowed in THE MASK OF MUJURA + Simplied DWORDs=030F0304, 00060004, 00020006, 00020003Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL1 - 0) * SHADE + 0 + Alpha1: (TEXEL0 - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x030F0304, 0x00060004, 0x00020006, 0x00020003}, // Simplified mux + 0x00272204, 0x1F0CFFFF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIMLODFRAC, // Constant color + 0x00000000, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {LERP(T1,CUR,PRIMLODFRAC), MOD(T1,CUR), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00272c603510f37f Overflowed in THE MASK OF MUJURA + Color0: (TEXEL1 - PRIM) * PRIMLODFRAC + TEXEL0 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (TEXEL1 - 0) * 1 + TEXEL0 + Alpha1: (COMBINED - 0) * SHADE + 0 + + + //Simplied Mux=0x00272c603510f37f Overflowed in THE MASK OF MUJURA + Simplied DWORDs=030F0604, 04010003, 07020706, 00020006Color0: (TEXEL1 - SHADE) * PRIMLODFRAC + TEXEL0 + Color1: (SHADE - ENV) * COMBINED + ENV + Alpha0: (TEXEL0 - 0) * 1 + TEXEL1 + Alpha1: (SHADE - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE_NOT_CHECKEDGenerated combiners: + */ + + + { + {0x030F0604, 0x04010003, 0x07020706, 0x00020006}, // Simplified mux + 0x00272C60, 0x3510F37F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIMLODFRAC, // Constant color + 0x00000005, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {MULADD(T1,PRIMLODFRAC,CUR), MOD(T1,CUR), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00209204ff0fffff Overflowed in THE MASK OF MUJURA + Color0: (TEXEL1 - 0) * TEXEL0 + 0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL0 - 0) * TEXEL0 + 0 + Alpha1: (COMBINED - 0) * PRIM + 0 + + + //Simplied Mux=0x00209204ff0fffff Overflowed in THE MASK OF MUJURA + Simplied DWORDs=00060004, 00030003, 00020003, 00020005Color0: (TEXEL1 - 0) * SHADE + 0 + Color1: (TEXEL0 - 0) * COMBINED + 0 + Alpha0: (TEXEL0 - 0) * TEXEL0 + 0 + Alpha1: (PRIM - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE2_A_ADD_DGenerated combiners: + */ + + + { + {0x00060004, 0x00030003, 0x00020003, 0x00020005}, // Simplified mux + 0x00209204, 0xFF0FFFFF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,T0), 0, true}, // Stage 0 + {MOD(T1,CUR), MOD(PRI,CUR), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x002714031f0cffff Overflowed in THE MASK OF MUJURA + Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (COMBINED - 0) * PRIM + 0 + Alpha0: (TEXEL0 - 0) * TEXEL1 + 0 + Alpha1: (COMBINED - 0) * PRIM + 0 + + + //Simplied Mux=0x002714031f0cffff Overflowed in THE MASK OF MUJURA + Simplied DWORDs=030F0304, 00060003, 00020006, 00020004Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (TEXEL1 - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x030F0304, 0x00060003, 0x00020006, 0x00020004}, // Simplified mux + 0x00271403, 0x1F0CFFFF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIMLODFRAC, // Constant color + 0x00000005, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {LERP(T1,T0,PRIMLODFRAC), MOD(T1,CUR), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00272c031f1093ff Overflowed in THE MASK OF MUJURA + Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (COMBINED - 0) * PRIM + 0 + Alpha0: (TEXEL1 - TEXEL0) * 1 + TEXEL0 + Alpha1: (COMBINED - 0) * SHADE + 0 + + + //Simplied Mux=0x00272c031f1093ff Overflowed in THE MASK OF MUJURA + Simplied DWORDs=030F0304, 00060004, 00020006, 02000000Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL1 - 0) * SHADE + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x030F0304, 0x00060004, 0x00020006, 0x02000000}, // Simplified mux + 0x00272C03, 0x1F1093FF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIMLODFRAC, // Constant color + 0x00000005, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SKIP, 0, true}, // Stage 0 + {LERP(T1,CUR,PRIMLODFRAC), MOD(T1,DIF), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x0012fe043ffe77f8 Overflowed in THE MASK OF MUJURA + Color0: (TEXEL0 - PRIM) * ENV + SHADE + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (0 - 0) * 0 + PRIM + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x0012fe043ffe77f8 Overflowed in THE MASK OF MUJURA + Simplied DWORDs=06070403, 04000000, 00020006, 02000000Color0: (TEXEL0 - TEXEL1) * ENV + SHADE + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + TEXEL1 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE_NOT_CHECKEDGenerated combiners: + */ + + + { + {0x06070403, 0x04000000, 0x00020006, 0x02000000}, // Simplified mux + 0x0012FE04, 0x3FFE77F8, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MULADD(T0,ENV,DIF), SEL(DIF), 0, true}, // Stage 0 + {MOD(CUR,DIF), SKIP, 0, false}, // Stage 1 + } + }, + + /* + //Mux=0x0020fe05f3fff738 Overflowed in THE MASK OF MUJURA + Color0: (TEXEL1 - 0) * TEXEL0 + 0 + Color1: (COMBINED - PRIM) * ENV + SHADE + Alpha0: (0 - 0) * 0 + PRIM + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x0020fe05f3fff738 Overflowed in THE MASK OF MUJURA + Simplied DWORDs=00030004, 06000000, 06070502, 02000000Color0: (TEXEL1 - 0) * TEXEL0 + 0 + Color1: (COMBINED - PRIM) * ENV + SHADE + Alpha0: (0 - 0) * 0 + SHADE + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE_NOT_CHECKEDGenerated combiners: + */ + + + { + {0x00030004, 0x06000000, 0x06070502, 0x02000000}, // Simplified mux + 0x0020FE05, 0xF3FFF738, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,ENV), SEL(DIF), 0, true}, // Stage 0 + {MULADD(T1,CUR,DIF), SKIP, 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x0012fe043f1677ff Overflowed in THE MASK OF MUJURA + Color0: (TEXEL0 - PRIM) * ENV + SHADE + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (0 - 0) * 0 + PRIM + Alpha1: (COMBINED - 0) * ENV + 0 + + + //Simplied Mux=0x0012fe043f1677ff Overflowed in THE MASK OF MUJURA + Simplied DWORDs=06070403, 00070004, 00020006, 02000000Color0: (TEXEL0 - TEXEL1) * ENV + SHADE + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL1 - 0) * ENV + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE_NOT_CHECKEDGenerated combiners: + */ + + + { + {0x06070403, 0x00070004, 0x00020006, 0x02000000}, // Simplified mux + 0x0012FE04, 0x3F1677FF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MULADD(T0,ENV,DIF), MOD(DIF,ENV), 0, true}, // Stage 0 + {MOD(CUR,DIF), SKIP, 0, false}, // Stage 1 + } + }, + + /* + //Mux=0x0011fe04ff17f7ff Overflowed in THE MASK OF MUJURA + Color0: (TEXEL0 - 0) * PRIM + 0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (0 - 0) * 0 + PRIM + Alpha1: (COMBINED - 0) * ENV + 0 + + + //Simplied Mux=0x0011fe04ff17f7ff Overflowed in THE MASK OF MUJURA + Simplied DWORDs=00030006, 00070004, 00020004, 02000000Color0: (SHADE - 0) * TEXEL0 + 0 + Color1: (TEXEL1 - 0) * COMBINED + 0 + Alpha0: (TEXEL1 - 0) * ENV + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE2_A_ADD_DGenerated combiners: + */ + + + { + {0x00030006, 0x00070004, 0x00020004, 0x02000000}, // Simplified mux + 0x0011FE04, 0xFF17F7FF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000005}, // constant color texture flags + { + {MOD(T0,DIF), SKIP, 0, true}, // Stage 0 + {MOD(T1,CUR), MOD(T1,DIF), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00272c031f0c93ff Overflowed in MULTI RACING + Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (COMBINED - 0) * PRIM + 0 + Alpha0: (TEXEL1 - TEXEL0) * 1 + TEXEL0 + Alpha1: (COMBINED - 0) * PRIM + 0 + + + //Simplied Mux=0x00272c031f0c93ff Overflowed in MULTI RACING + Simplied DWORDs=030F0304, 00060004, 00020006, 02000000Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL1 - 0) * SHADE + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x030F0304, 0x00060004, 0x00020006, 0x02000000}, // Simplified mux + 0x00272C03, 0x1F0C93FF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIMLODFRAC, // Constant color + 0x00000005, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SKIP, 0, true}, // Stage 0 + {LERP(T1,CUR,PRIMLODFRAC), MOD(T1,DIF), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00272c041f0c93ff Overflowed in MULTI RACING + Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL1 - TEXEL0) * 1 + TEXEL0 + Alpha1: (COMBINED - 0) * PRIM + 0 + + + //Simplied Mux=0x00272c041f0c93ff Overflowed in MULTI RACING + Simplied DWORDs=030F0304, 00060004, 00020006, 02000000Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL1 - 0) * SHADE + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x030F0304, 0x00060004, 0x00020006, 0x02000000}, // Simplified mux + 0x00272C04, 0x1F0C93FF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIMLODFRAC, // Constant color + 0x00000000, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SKIP, 0, true}, // Stage 0 + {LERP(T1,CUR,PRIMLODFRAC), MOD(T1,DIF), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x0030fe045ffef7f8 Overflowed in MULTI RACING + Color0: (PRIM - ENV) * TEXEL0 + ENV + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (0 - 0) * 0 + PRIM + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x0030fe045ffef7f8 Overflowed in MULTI RACING + Simplied DWORDs=07030704, 04000000, 00020006, 02000000Color0: (TEXEL1 - ENV) * TEXEL0 + ENV + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + TEXEL1 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x07030704, 0x04000000, 0x00020006, 0x02000000}, // Simplified mux + 0x0030FE04, 0x5FFEF7F8, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000005}, // constant color texture flags + { + {MOD(T0,DIF), SKIP, 0, true}, // Stage 0 + {LERP(T1,ENV,CUR), SEL(T1), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x0026a08015fc93f8 Overflowed in Monaco Grand Prix + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (SHADE - ENV) * COMBINED + 0 + Alpha0: (TEXEL1 - TEXEL0) * COMBINED + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x0026a08015fc93f8 Overflowed in Monaco Grand Prix + Simplied DWORDs=030E0304, 03060304, 00020706, 02000000Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (SHADE - ENV) * COMBINED + 0 + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE8_A_SUB_B_MOD_CGenerated combiners: + */ + + + { + {0x030E0304, 0x03060304, 0x00020706, 0x02000000}, // Simplified mux + 0x0026A080, 0x15FC93F8, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_LODFRAC, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SEL(T0), 0, true}, // Stage 0 + {LERP(T1,CUR,LODFRAC), LERP(T1,CUR,LODFRAC), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x0050fe043ffdf3f8 Overflowed in KING HILL 64 + Color0: (ENV - PRIM) * TEXEL0 + PRIM + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (0 - 0) * 0 + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x0050fe043ffdf3f8 Overflowed in KING HILL 64 + Simplied DWORDs=04030407, 03000000, 00020006, 02000000Color0: (ENV - TEXEL1) * TEXEL0 + TEXEL1 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x04030407, 0x03000000, 0x00020006, 0x02000000}, // Simplified mux + 0x0050FE04, 0x3FFDF3F8, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000007}, // constant color texture flags + { + {MOD(T0,DIF), SEL(T0), 0, true}, // Stage 0 + {LERP(T1,PRI,CUR), SKIP, 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00209a04ffcfffc8 Overflowed in HSV ADVENTURE RACING + Color0: (TEXEL1 - 0) * TEXEL0 + 0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL0 - 0) * ENV + 0 + Alpha1: (1 - TEXEL0) * PRIM + COMBINED + + + //Simplied Mux=0x00209a04ffcfffc8 Overflowed in HSV ADVENTURE RACING + Simplied DWORDs=00060004, 00070003, 00020003, 02060083Color0: (TEXEL1 - 0) * SHADE + 0 + Color1: (TEXEL0 - 0) * COMBINED + 0 + Alpha0: (TEXEL0 - 0) * ENV + 0 + Alpha1: (TEXEL0|C - 0) * SHADE + COMBINED + Simplfied type: CM_FMT_TYPE5_A_MOD_C_ADD_DGenerated combiners: + */ + + + { + {0x00060004, 0x00070003, 0x00020003, 0x02060083}, // Simplified mux + 0x00209A04, 0xFFCFFFC8, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,ENV), 0, true}, // Stage 0 + {MOD(T1,CUR), MULADD(T0C,DIF,CUR), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00ffa1ffff12123f Overflowed in HSV ADVENTURE RACING + Color0: (0 - 0) * 0 + SHADE + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL1 - TEXEL0) * COMBINED + TEXEL0 + Alpha1: (COMBINED - 0) * SHADE + 0 + + + //Simplied Mux=0x00ffa1ffff12123f Overflowed in HSV ADVENTURE RACING + Simplied DWORDs=06000000, 03060304, 02000000, 00020006Color0: (0 - 0) * 0 + SHADE + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (SHADE - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x06000000, 0x03060304, 0x02000000, 0x00020006}, // Simplified mux + 0x00FFA1FF, 0xFF12123F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {SEL(DIF), SEL(T0), 0, true}, // Stage 0 + {SKIP, LERP(T1,T0,DIF), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x0020980a14fcff38 Overflowed in HSV ADVENTURE RACING + Color0: (TEXEL1 - TEXEL0) * TEXEL0 + TEXEL0 + Color1: (COMBINED - SHADE) * PRIM|A + SHADE + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x0020980a14fcff38 Overflowed in HSV ADVENTURE RACING + Simplied DWORDs=03030304, 00060003, 06450602, 02000000Color0: (TEXEL1 - TEXEL0) * TEXEL0 + TEXEL0 + Color1: (COMBINED - SHADE) * PRIM|A + SHADE + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x03030304, 0x00060003, 0x06450602, 0x02000000}, // Simplified mux + 0x0020980A, 0x14FCFF38, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MULADD(T0,PRIA,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {LERP(T1,T0,CUR), SKIP, 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00247ec0f2fffebe Overflowed in HSV ADVENTURE RACING + Color0: (TEXEL1 - 0) * TEXEL0|A + 0 + Color1: (1 - TEXEL1) * COMBINED + TEXEL1 + Alpha0: (0 - 0) * 0 + 0 + Alpha1: (0 - 0) * 0 + 1 + + + //Simplied Mux=0x00247ec0f2fffebe Overflowed in HSV ADVENTURE RACING + Simplied DWORDs=00430004, 01000000, 03020301, 02000000Color0: (TEXEL1 - 0) * TEXEL0|A + 0 + Color1: (1 - TEXEL0) * COMBINED + TEXEL0 + Alpha0: (0 - 0) * 0 + 1 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x00430004, 0x01000000, 0x03020301, 0x02000000}, // Simplified mux + 0x00247EC0, 0xF2FFFEBE, // 64bit Mux + 2, // number of stages + DISABLE_ALPHA, + 0, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {SEL(T0), SKIP, 0, true}, // Stage 0 + {MULADD(T1C,CUR,T1), SKIP, 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x0020fe0411fd7ebe Overflowed in HSV ADVENTURE RACING + Color0: (TEXEL1 - TEXEL0) * TEXEL0 + TEXEL1 + Color1: (COMBINED - TEXEL0) * SHADE + TEXEL1 + Alpha0: (0 - 0) * 0 + 0 + Alpha1: (0 - 0) * 0 + 1 + + + //Simplied Mux=0x0020fe0411fd7ebe Overflowed in HSV ADVENTURE RACING + Simplied DWORDs=04030304, 01000000, 03060302, 02000000Color0: (TEXEL1 - TEXEL0) * TEXEL0 + TEXEL1 + Color1: (COMBINED - TEXEL0) * SHADE + TEXEL0 + Alpha0: (0 - 0) * 0 + 1 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: Color0Generated combiners: + */ + + + { + {0x04030304, 0x01000000, 0x03060302, 0x02000000}, // Simplified mux + 0x0020FE04, 0x11FD7EBE, // 64bit Mux + 2, // number of stages + DISABLE_ALPHA, + 0, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SKIP, 0, true}, // Stage 0 + {MOD(T1,CUR), SKIP, 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00111480f513ff7f Overflowed in HSV ADVENTURE RACING + Color0: (TEXEL0 - 0) * TEXEL1 + 0 + Color1: (SHADE - ENV) * COMBINED + ENV + Alpha0: (TEXEL0 - 0) * TEXEL1 + 0 + Alpha1: (COMBINED - 0) * SHADE + 0 + + + //Simplied Mux=0x00111480f513ff7f Overflowed in HSV ADVENTURE RACING + Simplied DWORDs=00040003, 00060003, 07020706, 00020004Color0: (TEXEL0 - 0) * TEXEL1 + 0 + Color1: (SHADE - ENV) * COMBINED + ENV + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (TEXEL1 - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x00040003, 0x00060003, 0x07020706, 0x00020004}, // Simplified mux + 0x00111480, 0xF513FF7F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {LERP(DIF,ENV,T0), MOD(T0,DIF), 0, true}, // Stage 0 + {MOD(T1,CUR), MOD(T1,CUR), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00117e042ffd79f8 Overflowed in HSV ADVENTURE RACING + Color0: (TEXEL0 - TEXEL1) * TEXEL1 + TEXEL1 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (0 - 0) * 0 + SHADE + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x00117e042ffd79f8 Overflowed in HSV ADVENTURE RACING + Simplied DWORDs=04040403, 06000000, 00020006, 02000000Color0: (TEXEL0 - TEXEL1) * TEXEL1 + TEXEL1 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + SHADE + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x04040403, 0x06000000, 0x00020006, 0x02000000}, // Simplified mux + 0x00117E04, 0x2FFD79F8, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + 0, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SEL(DIF), 0, true}, // Stage 0 + {MOD(T1,CUR), SKIP, 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00257e041ffcf3f8 Overflowed in G.A.S.P!!Fighters'NE + Color0: (TEXEL1 - TEXEL0) * PRIM|A + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (0 - 0) * 0 + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x00257e041ffcf3f8 Overflowed in G.A.S.P!!Fighters'NE + Simplied DWORDs=03460304, 03000000, 00020006, 02000000 + Color0: (TEXEL1 - TEXEL0) * SHADE|A + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x03460304, 0x03000000, 0x00020006, 0x02000000}, // Simplified mux + 0x00257E04, 0x1FFCF3F8, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SEL(T0), 0, true}, // Stage 0 + {LERP(T1,CUR,PRI), SKIP, 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00ff9480fffcfff8 Overflowed in G.A.S.P!!Fighters'NE + Color0: (0 - 0) * 0 + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL0 - 0) * TEXEL1 + 0 + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x00ff9480fffcfff8 Overflowed in G.A.S.P!!Fighters'NE + Simplied DWORDs=00060003, 04000000, 02000000, 00020003 + Color0: (TEXEL0 - 0) * SHADE + 0 + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (0 - 0) * 0 + TEXEL1 + Alpha1: (TEXEL0 - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE2_A_ADD_DGenerated combiners: + */ + + + { + {0x00060003, 0x04000000, 0x02000000, 0x00020003}, // Simplified mux + 0, 0, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + 0, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SEL(T0), 0, true}, // Stage 0 + {SKIP, MOD(T1,CUR), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00612680fffcf3f8 Overflowed in G.A.S.P!!Fighters'NE + Color0: (1 - 0) * TEXEL1 + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL1 - 0) * PRIM + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x00612680fffcf3f8 Overflowed in G.A.S.P!!Fighters'NE + Simplied DWORDs=03010004, 00060004, 00020006, 02010003Color0: (TEXEL1 - 0) * 1 + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL1 - 0) * SHADE + 0 + Alpha1: (TEXEL0 - 0) * 1 + COMBINED + Simplfied type: CM_FMT_TYPE5_A_MOD_C_ADD_DGenerated combiners: + */ + + + { + {0x03010004, 0x00060004, 0x00020006, 0x02010003}, // Simplified mux + 0x00612680, 0xFFFCF3F8, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000000, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T1,DIF), MOD(T1,PRI), 1, true}, // Stage 0 + {MOD(T0,CUR), ADD(T0,CUR), 0, true}, // Stage 1 + } + }, + + /* + //Mux=0x0026a06015fc9378 Overflowed in FIFA Soccer 64 + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (TEXEL1 - TEXEL0) * COMBINED + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x0026a06015fc9378 Overflowed in FIFA Soccer 64 + Simplied DWORDs=030E0304, 03060304, 06020605, 02000000Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (PRIM - SHADE) * COMBINED + SHADE + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x030E0304, 0x03060304, 0x06020605, 0x02000000}, // Simplified mux + 0x0026A060, 0x15FC9378, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_LODFRAC, // Constant color + 0x00000005, 0x00000007, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {LERP(DIF,DIFA,T0), SEL(T0), 0, true}, // Stage 0 + {LERP(T1,CUR,LODFRAC), LERP(T1,CUR,LODFRAC), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x0026a0041ffc93fe Overflowed in Taz Express + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL1 - TEXEL0) * COMBINED + TEXEL0 + Alpha1: (0 - 0) * 0 + 1 + + + //Simplied Mux=0x0026a0041ffc93fe Overflowed in Taz Express + Simplied DWORDs=030E0304, 01000000, 00020006, 02000000 + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + 1 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x030E0304, 0x01000000, 0x00020006, 0x02000000}, // Simplified mux + 0x0026A004, 0x1FFC93FE, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_LODFRAC, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SEL(T0), 0, true}, // Stage 0 + {LERP(T1,CUR,LODFRAC), LERP(T1,CUR,LODFRAC), 1, true}, // Stage 1 + } + }, + /* + //Mux=0x003716041ffcfff8 Overflowed in GAUNTLET LEGENDS + Color0: (PRIM - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL0 - 0) * PRIM + 0 + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x003716041ffcfff8 Overflowed in GAUNTLET LEGENDS + Simplied DWORDs=030F0304, 04000000, 00020006, 00020003 + Color0: (TEXEL1 - TEXEL0) * PRIMLODFRAC + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + TEXEL1 + Alpha1: (TEXEL0 - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x030F0304, 0x04000000, 0x00020006, 0x00020003}, // Simplified mux + 0x00371604, 0x1FFCFFF8, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIMLODFRAC, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000005}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {LERP(T1,CUR,PRIMLODFRAC), SKIP, 1, true}, // Stage 1 + } + }, + /* + //Mux=0x00157e602ffd77f8 Overflowed in MarioTennis + Color0: (TEXEL0 - TEXEL1) * PRIM|A + TEXEL1 + Color1: (PRIM - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + PRIM + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x00157e602ffd77f8 Overflowed in MarioTennis + Simplied DWORDs=04460403, 06000000, 00020006, 02000000 + Color0: (TEXEL0 - TEXEL1) * SHADE|A + TEXEL1 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + SHADE + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x04460403, 0x06000000, 0x00020006, 0x02000000}, // Simplified mux + 0x00157E60, 0x2FFD77F8, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000005, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SEL(DIF), 0, true}, // Stage 0 + {LERP(T1,CUR,DIFA), SKIP, 1, true}, // Stage 1 + } + }, + /* + //Mux=0x00157e6025fd7778 Overflowed in MarioTennis + Color0: (TEXEL0 - TEXEL1) * PRIM|A + TEXEL1 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (0 - 0) * 0 + PRIM + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x00157e6025fd7778 Overflowed in MarioTennis + Simplied DWORDs=04460403, 06000000, 06020605, 02000000 + Color0: (TEXEL0 - TEXEL1) * SHADE|A + TEXEL1 + Color1: (PRIM - SHADE) * COMBINED + SHADE + Alpha0: (0 - 0) * 0 + SHADE + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x04460403, 0x06000000, 0x06020605, 0x02000000}, // Simplified mux + 0x00157E60, 0x25FD7778, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x000000007, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {LERP(PRI,DIF,T0), SEL(DIF), 0, true}, // Stage 0 + {LERP(CUR,T1,DIFA), SKIP, 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00fffe80f514f8ff Overflowed in CONKER BFD + Color0: (0 - 0) * 0 + TEXEL0 + Color1: (SHADE - ENV) * COMBINED + PRIM + Alpha0: (0 - 0) * 0 + SHADE + Alpha1: (COMBINED - 0) * ENV + 0 + */ + + { + {0x00030706, 0x06000000, 0x02010004, 0x02000000}, // Simplified mux + 0x00FFFE80, 0xF514F8FF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000706, 0x00070006, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), SEL(DIF), 0, true}, // Stage 0 + {ADD(PRI,CUR), SKIP, 0, false}, // Stage 1 + } + }, + + /* + //Mux=0x0017166035fcff78 Overflowed in THE LEGEND OF ZELDA + Color0: (TEXEL0 - PRIM) * PRIMLODFRAC + TEXEL0 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (TEXEL0 - 0) * PRIM + 0 + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x0017166035fcff78 Overflowed in THE LEGEND OF ZELDA + Simplied DWORDs=030F0603, 00060003, 04020406, 02000000 + Color0: (TEXEL0 - SHADE) * PRIMLODFRAC + TEXEL0 + Color1: (SHADE - TEXEL1) * COMBINED + TEXEL1 + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: Color0Generated combiners: + */ + + { + {0x030F0603, 0x00060003, 0x04020406, 0x02000000}, // Simplified mux + 0x00171660, 0x35FCFF78, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIMLODFRAC, // Constant color + 0x00000005, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000007}, // constant color texture flags + { + {LERP(T0,DIF,PRIMLODFRAC), MOD(T0,DIF), 0, true}, // Stage 0 + {LERP(DIF,T1,CUR), SKIP, 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00262a041f1093ff Overflowed in THE LEGEND OF ZELDA + Color0: (TEXEL1 - TEXEL0) * ENV|A + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL1 - TEXEL0) * ENV + TEXEL0 + Alpha1: (COMBINED - 0) * SHADE + 0 + + + //Simplied Mux=0x00262a041f1093ff Overflowed in THE LEGEND OF ZELDA + Simplied DWORDs=03470304, 03070304, 00020006, 00020006 + Color0: (TEXEL1 - TEXEL0) * ENV|A + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (TEXEL1 - TEXEL0) * ENV + TEXEL0 + Alpha1: (SHADE - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + { + {0x03470304, 0x03070304, 0x00020006, 0x00020006}, // Simplified mux + 0x00262A04, 0x1F1093FF, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {LERP(T1,CUR,ENVA), LERP(T1,CUR,ENV), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00267e051ffcfdf8 Overflowed in THE LEGEND OF ZELDA + Color0: (TEXEL1 - TEXEL0) * ENV|A + TEXEL0 + Color1: (COMBINED - 0) * ENV + 0 + Alpha0: (0 - 0) * 0 + 1 + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x00267e051ffcfdf8 Overflowed in THE LEGEND OF ZELDA + Simplied DWORDs=03460304, 01000000, 00020006, 02000000 + Color0: (TEXEL1 - TEXEL0) * SHADE|A + TEXEL0 + Color1: (SHADE - 0) * COMBINED + 0 + Alpha0: (0 - 0) * 0 + 1 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x03460304, 0x01000000, 0x00020006, 0x02000000}, // Simplified mux + 0x00267E05, 0x1FFCFDF8, // 64bit Mux + 2, // number of stages + DISABLE_ALPHA, + MUX_ENV, // Constant color + 0x00000007, 0x00000007, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,ENV), SKIP, 0, true}, // Stage 0 + {LERP(T1,CUR,ENVA), SKIP, 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x0026a0041f1093fb Overflowed in GOLDENEYE + Color0: (TEXEL1 - TEXEL0) * LODFRAC + TEXEL0 + Color1: (COMBINED - 0) * SHADE + 0 + Alpha0: (TEXEL1 - TEXEL0) * COMBINED + TEXEL0 + Alpha1: (COMBINED - 0) * SHADE + PRIM + + + //Simplied Mux=0x0026a0041f1093fb Overflowed in GOLDENEYE + Simplied DWORDs=00060003, 03060304, 02000000, 05020006 + Color0: (TEXEL0 - 0) * SHADE + 0 + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL1 - TEXEL0) * SHADE + TEXEL0 + Alpha1: (SHADE - 0) * COMBINED + PRIM + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + + { + {0x00060003, 0x03060304, 0x02000000, 0x05020006}, // Simplified mux + 0x0026A004, 0x1F1093FB, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {MOD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {SKIP, ADD(CUR,PRI), 0, false}, // Stage 1 + } + }, + + /* + //Mux=0x0017666025fd7f78 Overflowed in POKEMON STADIUM 2 + Color0: (TEXEL0 - TEXEL1) * PRIMLODFRAC + TEXEL1 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (1 - 0) * PRIM + 0 + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x0017666025fd7f78 Overflowed in POKEMON STADIUM 2 + Simplied DWORDs=040F0403, 06000000, 06020605, 02000000 + Color0: (TEXEL0 - TEXEL1) * PRIMLODFRAC + TEXEL1 + Color1: (PRIM - SHADE) * COMBINED + SHADE + Alpha0: (0 - 0) * 0 + SHADE + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + { + {0x040F0403, 0x06000000, 0x06020605, 0x02000000}, // Simplified mux + 0x00176660, 0x25FD7F78, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {LERP(DIF,ENV,T0), SEL(DIF), 0, true}, // Stage 0 + {SKIP, SKIP, 0, false}, // Stage 1 + } + }, + + /* + //Mux=0x0077666045fd7f78 Overflowed in POKEMON STADIUM 2 + Color0: (COMBALPHA - SHADE) * PRIMLODFRAC + TEXEL1 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (1 - 0) * PRIM + 0 + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x0077666045fd7f78 Overflowed in POKEMON STADIUM 2 + Simplied DWORDs=040F0608, 03000000, 07020703, 02000000 + Color0: (COMBALPHA - SHADE) * PRIMLODFRAC + TEXEL1 + Color1: (TEXEL0 - ENV) * COMBINED + ENV + Alpha0: (0 - 0) * 0 + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE_NOT_CHECKEDShade = 000F0608 in color channelGenerated combiners: + */ + + { + {0x040F0608, 0x03000000, 0x07020703, 0x02000000}, // Simplified mux + 0x00776660, 0x45FD7F78, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000005, 0x00000000}, // constant color texture flags + { + {MOD(T1,DIF), SKIP, 1, true}, // Stage 0 + {LERP(T1,ENV,CUR), SEL(T0), 0, true}, // Stage 1 + } + }, + + /* + //Mux=0x00457fff3ffcfe3f Overflowed in POKEMON STADIUM 2 + Color0: (SHADE - PRIM) * PRIM|A + TEXEL0 + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (0 - 0) * 0 + 0 + Alpha1: (0 - 0) * 0 + 0 + + + //Simplied Mux=0x00457fff3ffcfe3f Overflowed in POKEMON STADIUM 2 + Simplied DWORDs=00460506, 00000000, 02010003, 02000000 + Color0: (SHADE - PRIM) * SHADE|A + 0 + Color1: (TEXEL0 - 0) * 1 + COMBINED + Alpha0: (0 - 0) * 0 + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE_NOT_CHECKEDShade = 00460506 in color channelGenerated combiners: + */ + + { + {0x00460506, 0x00000000, 0x02010003, 0x02000000}, // Simplified mux + 0x00457FFF, 0x3FFCFE3F, // 64bit Mux + 2, // number of stages + DISABLE_ALPHA, + MUX_PRIM, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {SUB(DIF,PRI), SKIP, 0, false}, // Stage 0 + {MULADD(CUR,PRIA,T0), SKIP, 0, true}, // Stage 1 + } + }, + + /* + //Mux=0x00272c603510e37f Overflowed in POKEMON STADIUM 2 + Color0: (TEXEL1 - PRIM) * PRIMLODFRAC + TEXEL0 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (TEXEL1 - 1) * 1 + TEXEL0 + Alpha1: (COMBINED - 0) * SHADE + 0 + + + //Simplied Mux=0x00272c603510e37f Overflowed in POKEMON STADIUM 2 + Simplied DWORDs=030F0604, 00060003, 07020706, 02000000 + Color0: (TEXEL1 - SHADE) * PRIMLODFRAC + TEXEL0 + Color1: (SHADE - ENV) * COMBINED + ENV + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE_NOT_CHECKEDGenerated combiners: + */ + + { + {0x030F0604, 0x00060003, 0x07020706, 0x02000000}, // Simplified mux + 0x00272C60, 0x3510E37F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000005, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {LERP(DIF,ENV,T0), MOD(T0,DIF), 0, true}, // Stage 0 + {SKIP, MULADD(T1,DIF,CUR), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x0025a660f510f37f Overflowed in POKEMON STADIUM 2 + Color0: (TEXEL1 - 0) * SHADE|A + TEXEL0 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (TEXEL1 - 0) * PRIM + TEXEL0 + Alpha1: (COMBINED - 0) * SHADE + 0 + + + //Simplied Mux=0x0025a660f510f37f Overflowed in POKEMON STADIUM 2 + Simplied DWORDs=03460004, 03050004, 07020705, 00020006 + Color0: (TEXEL1 - 0) * SHADE|A + TEXEL0 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (TEXEL1 - 0) * PRIM + TEXEL0 + Alpha1: (SHADE - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + { + {0x03460004, 0x03050004, 0x07020705, 0x00020006}, // Simplified mux + 0x0025A660, 0xF510F37F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000005, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {LERP(DIF,ENV,T0), MOD(T0,DIF), 0, true}, // Stage 0 + {MULADD(T1,DIFA,CUR), MULADD(T1,DIF,CUR), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00171607f511a97f Overflowed in POKEMON STADIUM 2 + Color0: (TEXEL0 - 0) * PRIMLODFRAC + PRIM + Color1: (COMBINED - ENV) * COMBINED|A + ENV + Alpha0: (TEXEL0 - TEXEL1) * PRIM + SHADE + Alpha1: (COMBINED - 0) * SHADE + 0 + + + //Simplied Mux=0x00171607f511a97f Overflowed in POKEMON STADIUM 2 + Simplied DWORDs=050F0003, 06050403, 06420602, 00020006 + Color0: (TEXEL0 - 0) * PRIMLODFRAC + PRIM + Color1: (COMBINED - SHADE) * COMBINED|A + SHADE + Alpha0: (TEXEL0 - TEXEL1) * PRIM + SHADE + Alpha1: (SHADE - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE_NOT_CHECKEDGenerated combiners: + */ + + { + {0x050F0003, 0x06050403, 0x06420602, 0x00020006}, // Simplified mux + 0x00171607, 0xF511A97F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000005, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {ADD(T0,DIF), MOD(T0,DIF), 0, true}, // Stage 0 + {LERP(CUR,ENV,CURA), SUB(CUR,T1), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00177e6025fd7378 Overflowed in POKEMON STADIUM 2 + Color0: (TEXEL0 - TEXEL1) * PRIMLODFRAC + TEXEL1 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (0 - 0) * 0 + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x00177e6025fd7378 Overflowed in POKEMON STADIUM 2 + Simplied DWORDs=040F0403, 03000000, 06020605, 02000000 + Color0: (TEXEL0 - TEXEL1) * PRIMLODFRAC + TEXEL1 + Color1: (PRIM - SHADE) * COMBINED + SHADE + Alpha0: (0 - 0) * 0 + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + { + {0x040F0403, 0x03000000, 0x06020605, 0x02000000}, // Simplified mux + 0x00177E60, 0x25FD7378, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000005, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {LERP(DIF,ENV,T0), SEL(T0), 0, true}, // Stage 0 + {SKIP, SKIP, 0, true}, // Stage 1 + } + }, + + /* + //Mux=0x0017666025fd7f78 Overflowed in POKEMON STADIUM 2 + Color0: (TEXEL0 - TEXEL1) * PRIMLODFRAC + TEXEL1 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (1 - 0) * PRIM + 0 + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x0017666025fd7f78 Overflowed in POKEMON STADIUM 2 + Simplied DWORDs=040F0403, 06000000, 06020605, 02000000 + Color0: (TEXEL0 - TEXEL1) * PRIMLODFRAC + TEXEL1 + Color1: (PRIM - SHADE) * COMBINED + SHADE + Alpha0: (0 - 0) * 0 + SHADE + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + { + {0x040F0403, 0x06000000, 0x06020605, 0x02000000}, // Simplified mux + 0x00176660, 0x25FD7F78, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000007, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {LERP(PRI,DIF,T0), SEL(PRI), 0, true}, // Stage 0 + {SKIP, SKIP, 0, false}, // Stage 1 + } + }, + + /* + //Mux=0x00177e6025fd7378 Overflowed in POKEMON STADIUM 2 + Color0: (TEXEL0 - TEXEL1) * PRIMLODFRAC + TEXEL1 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (0 - 0) * 0 + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x00177e6025fd7378 Overflowed in POKEMON STADIUM 2 + Simplied DWORDs=040F0403, 03000000, 06020605, 02000000 + Color0: (TEXEL0 - TEXEL1) * PRIMLODFRAC + TEXEL1 + Color1: (PRIM - SHADE) * COMBINED + SHADE + Alpha0: (0 - 0) * 0 + TEXEL0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + { + {0x040F0403, 0x03000000, 0x06020605, 0x02000000}, // Simplified mux + 0x00177E60, 0x25FD7378, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000007, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {LERP(PRI,DIF,T0), SEL(T0), 0, true}, // Stage 0 + {SKIP, SKIP, 0, false}, // Stage 1 + } + }, + + /* + //Mux=0x00457fff3ffcfe3f Overflowed in POKEMON STADIUM 2 + Color0: (SHADE - PRIM) * PRIM|A + TEXEL0 + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (0 - 0) * 0 + 0 + Alpha1: (0 - 0) * 0 + 0 + + + //Simplied Mux=0x00457fff3ffcfe3f Overflowed in POKEMON STADIUM 2 + Simplied DWORDs=00460506, 00000000, 02010003, 02000000 + Color0: (SHADE - PRIM) * SHADE|A + 0 + Color1: (TEXEL0 - 0) * 1 + COMBINED + Alpha0: (0 - 0) * 0 + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE_NOT_CHECKEDShade = 00460506 in color channelGenerated combiners: + */ + + { + {0x00460506, 0x00000000, 0x02010003, 0x02000000}, // Simplified mux + 0x00457FFF, 0x3FFCFE3F, // 64bit Mux + 2, // number of stages + DISABLE_ALPHA, + MUX_ENV, // Constant color + 0x00460506, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {ADD(T0,DIF), SKIP, 0, true}, // Stage 0 + {SKIP, SKIP, 0, false}, // Stage 1 + } + }, + + /* + //Mux=0x00272c60350c937f Overflowed in POKEMON STADIUM 2 + Color0: (TEXEL1 - PRIM) * PRIMLODFRAC + TEXEL0 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (TEXEL1 - TEXEL0) * 1 + TEXEL0 + Alpha1: (COMBINED - 0) * PRIM + 0 + + + //Simplied Mux=0x00272c60350c937f Overflowed in POKEMON STADIUM 2 + Simplied DWORDs=030F0604, 00060004, 07020706, 02000000 + Color0: (TEXEL1 - SHADE) * PRIMLODFRAC + TEXEL0 + Color1: (SHADE - ENV) * COMBINED + ENV + Alpha0: (TEXEL1 - 0) * SHADE + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE_NOT_CHECKEDGenerated combiners: + */ + + { + {0x030F0604, 0x00060004, 0x07020706, 0x02000000}, // Simplified mux + 0x00272C60, 0x350C937F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000007, 0x00000005, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {LERP(PRI,DIF,T0),SKIP, 0, true}, // Stage 0 + {SKIP, MOD(T1,DIF), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00272c603510e37f Overflowed in POKEMON STADIUM 2 + Color0: (TEXEL1 - PRIM) * PRIMLODFRAC + TEXEL0 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (TEXEL1 - 1) * 1 + TEXEL0 + Alpha1: (COMBINED - 0) * SHADE + 0 + + + //Simplied Mux=0x00272c603510e37f Overflowed in POKEMON STADIUM 2 + Simplied DWORDs=030F0604, 00060003, 07020706, 02000000 + Color0: (TEXEL1 - SHADE) * PRIMLODFRAC + TEXEL0 + Color1: (SHADE - ENV) * COMBINED + ENV + Alpha0: (TEXEL0 - 0) * SHADE + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE_NOT_CHECKEDGenerated combiners: + */ + + { + {0x030F0604, 0x00060003, 0x07020706, 0x02000000}, // Simplified mux + 0x00272C60, 0x3510E37F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000005, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {SKIP,MOD(T1,DIF), 1, true}, // Stage 0 + {LERP(DIF,ENV,T0), MULADD(T0,DIF,CUR), 0, true}, // Stage 1 + } + }, + + /* + //Mux=0x0030e5ff5f16f63f Overflowed in POKEMON STADIUM 2 + Color0: (PRIM - ENV) * TEXEL0 + ENV + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (1 - 0) * TEXEL1 + PRIM + Alpha1: (COMBINED - 0) * ENV + 0 + + + //Simplied Mux=0x0030e5ff5f16f63f Overflowed in POKEMON STADIUM 2 + Simplied DWORDs=06030605, 05010004, 02000000, 00020006 + Color0: (PRIM - SHADE) * TEXEL0 + SHADE + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL1 - 0) * 1 + PRIM + Alpha1: (SHADE - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + { + {0x06030605, 0x05010004, 0x02000000, 0x00020006}, // Simplified mux + 0x0030E5FF, 0x5F16F63F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000007, 0x00000007, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {LERP(PRI,DIF,T0), MOD(PRI,DIF), 0, true}, // Stage 0 + {SKIP, MULADD(T1,DIF,CUR), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x003117ff5f16fe3f Overflowed in POKEMON STADIUM 2 + Color0: (PRIM - ENV) * TEXEL1 + ENV + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL0 - 0) * PRIM + 0 + Alpha1: (COMBINED - 0) * ENV + 0 + + + //Simplied Mux=0x003117ff5f16fe3f Overflowed in POKEMON STADIUM 2 + Simplied DWORDs=06040605, 00050003, 02000000, 00020006 + Color0: (PRIM - SHADE) * TEXEL1 + SHADE + Color1: (0 - 0) * 0 + COMBINED + Alpha0: (TEXEL0 - 0) * PRIM + 0 + Alpha1: (SHADE - 0) * COMBINED + 0 + Simplfied type: CM_FMT_TYPE6_A_LERP_B_CGenerated combiners: + */ + + { + {0x06040605, 0x00050003, 0x02000000, 0x00020006}, // Simplified mux + 0x003117FF, 0x5F16FE3F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000007, 0x00000007, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {SKIP, MOD(T0,PRI), 0, true}, // Stage 0 + {LERP(PRI,DIF,T1), MOD(DIF,CUR), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00272c603410933f Overflowed in POKEMON STADIUM 2 + Color0: (TEXEL1 - PRIM) * PRIMLODFRAC + TEXEL0 + Color1: (PRIM - SHADE) * COMBINED + SHADE + Alpha0: (TEXEL1 - TEXEL0) * 1 + TEXEL0 + Alpha1: (COMBINED - 0) * SHADE + 0 + + + //Simplied Mux=0x00272c603410933f Overflowed in POKEMON STADIUM 2 + Simplied DWORDs=030F0504, 00060004, 06020605, 02000000 + Color0: (TEXEL1 - PRIM) * PRIMLODFRAC + TEXEL0 + Color1: (PRIM - SHADE) * COMBINED + SHADE + Alpha0: (TEXEL1 - 0) * SHADE + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE_NOT_CHECKEDGenerated combiners: + */ + + { + {0x030F0504, 0x00060004, 0x06020605, 0x02000000}, // Simplified mux + 0x00272C60, 0x3410933F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_PRIM, // Constant color + 0x00000000, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {LERP(PRI,DIF,T0), SKIP, 0, true}, // Stage 0 + {SKIP, MOD(T1,DIF), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00272c603510937f Overflowed in POKEMON STADIUM 2 + Color0: (TEXEL1 - PRIM) * PRIMLODFRAC + TEXEL0 + Color1: (PRIM - ENV) * COMBINED + ENV + Alpha0: (TEXEL1 - TEXEL0) * 1 + TEXEL0 + Alpha1: (COMBINED - 0) * SHADE + 0 + + + //Simplied Mux=0x00272c603510937f Overflowed in POKEMON STADIUM 2 + Simplied DWORDs=030F0604, 00060004, 07020706, 02000000 + Color0: (TEXEL1 - SHADE) * PRIMLODFRAC + TEXEL0 + Color1: (SHADE - ENV) * COMBINED + ENV + Alpha0: (TEXEL1 - 0) * SHADE + 0 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE_NOT_CHECKEDGenerated combiners: + */ + + { + {0x030F0604, 0x00060004, 0x07020706, 0x02000000}, // Simplified mux + 0x00272C60, 0x3510937F, // 64bit Mux + 2, // number of stages + ENABLE_BOTH, + MUX_ENV, // Constant color + 0x00000005, 0x00000000, 0, // Shade and specular color flags + {0x00000000, 0x00000000}, // constant color texture flags + { + {LERP(DIF,ENV,T0), SKIP, 0, true}, // Stage 0 + {SKIP, MOD(T1,DIF), 1, true}, // Stage 1 + } + }, + + /* + //Mux=0x00167e835ffffc38 Overflowed in POKEMON STADIUM 2 + Color0: (TEXEL0 - ENV) * ENV|A + 0 + Color1: (SHADE - 0) * PRIM + COMBINED + Alpha0: (0 - 0) * 0 + 1 + Alpha1: (0 - 0) * 0 + COMBINED + + + //Simplied Mux=0x00167e835ffffc38 Overflowed in POKEMON STADIUM 2 + Simplied DWORDs=00460703, 01000000, 02060004, 02000000 + Color0: (TEXEL0 - ENV) * SHADE|A + 0 + Color1: (TEXEL1 - 0) * SHADE + COMBINED + Alpha0: (0 - 0) * 0 + 1 + Alpha1: (0 - 0) * 0 + COMBINED + Simplfied type: CM_FMT_TYPE8_A_SUB_B_MOD_CGenerated combiners: + */ + + { + {0x00460703, 0x01000000, 0x02060004, 0x02000000}, // Simplified mux + 0x00167E83, 0x5FFFFC38, // 64bit Mux + 2, // number of stages + DISABLE_ALPHA, + MUX_ENV, // Constant color + 0x00050006, 0x00000007, 0, // Shade and specular color flags + {0x00000000, 0x00000005}, // constant color texture flags + { + {SUB(T0,ENV), SKIP, 0, true}, // Stage 0 + {MULADD(CUR,ENVA,DIF), SKIP, 1, true}, // Stage 1 + } + }, +}; + +int noOfTwoStages = sizeof(twostages)/sizeof(GeneralCombinerInfo); + diff --git a/libmupen64plus/mupen64plus-video-rice/src/Config.cpp b/libmupen64plus/mupen64plus-video-rice/src/Config.cpp new file mode 100644 index 0000000000..125be0b19d --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/Config.cpp @@ -0,0 +1,1470 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + +#include +#include + +#include + +#define M64P_PLUGIN_PROTOTYPES 1 +#include "osal_preproc.h" +#include "m64p_types.h" +#include "m64p_plugin.h" +#include "m64p_config.h" + +#include "Config.h" +#include "Debugger.h" +#include "DeviceBuilder.h" +#include "RenderBase.h" +#include "TextureManager.h" +#include "Video.h" + +#define INI_FILE "RiceVideoLinux.ini" + +static m64p_handle l_ConfigVideoRice = NULL; +static m64p_handle l_ConfigVideoGeneral = NULL; + +static int FindIniEntry(uint32 dwCRC1, uint32 dwCRC2, uint8 nCountryID, char* szName, int PrintInfo); + +const char *frameBufferSettings[] = +{ +"None (default)", +"Hide Framebuffer Effects", +"Basic Framebuffer", +"Basic & Write Back", +"Write Back & Reload", +"Write Back Every Frame", +"With Emulator", +"Basic Framebuffer & With Emulator", +"With Emulator Read Only", +"With Emulator Write Only", +}; + +const int resolutions[][2] = +{ +{320, 240}, +{400, 300}, +{480, 360}, +{512, 384}, +{640, 480}, +{800, 600}, +{1024, 768}, +{1152, 864}, +{1280, 960}, +{1400, 1050}, +{1600, 1200}, +{1920, 1440}, +{2048, 1536}, +}; +const int numberOfResolutions = sizeof(resolutions)/sizeof(int)/2; + +const char* resolutionsS[] = +{ +"320 x 240", +"400 x 300", +"480 x 360", +"512 x 384", +"640 x 480", +"800 x 600", +"1024 x 768", +"1152 x 864", +"1280 x 960", +"1400 x 1050", +"1600 x 1200", +"1920 x 1440", +"2048 x 1536" +}; + +const char *frameBufferWriteBackControlSettings[] = +{ +"Every Frame (default)", +"Every 2 Frames", +"Every 3 Frames", +"Every 4 Frames", +"Every 5 Frames", +"Every 6 Frames", +"Every 7 Frames", +"Every 8 Frames", +}; + +const char *renderToTextureSettings[] = +{ +"None (default)", +"Hide Render-to-texture Effects", +"Basic Render-to-texture", +"Basic & Write Back", +"Write Back & Reload", +}; + +const char *screenUpdateSettings[] = +{ +"At VI origin update", +"At VI origin change", +"At CI change", +"At the 1st CI change", +"At the 1st drawing", +"Before clear the screen", +"At VI origin update after screen is drawn (default)", +}; + +WindowSettingStruct windowSetting; +GlobalOptions options; +RomOptions defaultRomOptions; +RomOptions currentRomOptions; +FrameBufferOptions frameBufferOptions; +std::vector IniSections; +bool bIniIsChanged = false; +char szIniFileName[300]; + +SettingInfo TextureQualitySettings[] = +{ +{"Default", FORCE_DEFAULT_FILTER}, +{"32-bit Texture", FORCE_POINT_FILTER}, +{"16-bit Texture", FORCE_LINEAR_FILTER}, +}; + +SettingInfo ForceTextureFilterSettings[] = +{ +{"N64 Default Texture Filter", FORCE_DEFAULT_FILTER}, +{"Force Nearest Filter (faster, low quality)", FORCE_POINT_FILTER}, +{"Force Linear Filter (slower, better quality)", FORCE_LINEAR_FILTER}, +}; + +SettingInfo TextureEnhancementSettings[] = +{ +{"N64 original texture (No enhancement)", TEXTURE_NO_ENHANCEMENT}, +{"2x (Double the texture size)", TEXTURE_2X_ENHANCEMENT}, +{"2xSaI", TEXTURE_2XSAI_ENHANCEMENT}, +{"hq2x", TEXTURE_HQ2X_ENHANCEMENT}, +{"lq2x", TEXTURE_LQ2X_ENHANCEMENT}, +{"hq4x", TEXTURE_HQ4X_ENHANCEMENT}, +{"Sharpen", TEXTURE_SHARPEN_ENHANCEMENT}, +{"Sharpen More", TEXTURE_SHARPEN_MORE_ENHANCEMENT}, +}; + +SettingInfo TextureEnhancementControlSettings[] = +{ +{"Normal", TEXTURE_ENHANCEMENT_NORMAL}, +{"Smooth", TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_1}, +{"Less smooth", TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_2}, +{"2xSaI smooth", TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_3}, +{"Less 2xSaI smooth", TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_4}, +}; + +SettingInfo colorQualitySettings[] = +{ +{"16-bit", TEXTURE_FMT_A4R4G4B4}, +{"32-bit (def)", TEXTURE_FMT_A8R8G8B8}, +}; + +const char* strDXDeviceDescs[] = { "HAL", "REF" }; + +SettingInfo openGLDepthBufferSettings[] = +{ +{"16-bit (def)", 16}, +{"32-bit", 32}, +}; + +RenderEngineSetting OpenGLRenderSettings[] = +{ +{"To Fit Your Video Card", OGL_DEVICE}, +{"OpenGL 1.1 (Lowest)", OGL_1_1_DEVICE}, +{"OpenGL 1.2/1.3", OGL_1_2_DEVICE}, +{"OpenGL 1.4", OGL_1_4_DEVICE}, +//{"OpenGL 1.4, the 2nd combiner", OGL_1_4_V2_DEVICE}, +{"OpenGL for Nvidia TNT or better", OGL_TNT2_DEVICE}, +{"OpenGL for Nvidia GeForce or better ", NVIDIA_OGL_DEVICE}, +{"OpenGL Fragment Program Extension", OGL_FRAGMENT_PROGRAM}, +}; + +SettingInfo OnScreenDisplaySettings[] = +{ +{"Display Nothing", ONSCREEN_DISPLAY_NOTHING}, +{"Display DList Per Second", ONSCREEN_DISPLAY_DLIST_PER_SECOND}, +{"Display Frame Per Second", ONSCREEN_DISPLAY_FRAME_PER_SECOND}, +{"Display Debug Information Only", ONSCREEN_DISPLAY_DEBUG_INFORMATION_ONLY}, +{"Display Messages From CPU Core Only", ONSCREEN_DISPLAY_TEXT_FROM_CORE_ONLY}, +{"Display DList Per Second With Core Msgs", ONSCREEN_DISPLAY_DLIST_PER_SECOND_WITH_CORE_MSG}, +{"Display Frame Per Second With Core Msgs", ONSCREEN_DISPLAY_FRAME_PER_SECOND_WITH_CORE_MSG}, +{"Display Debug Information With Core Msgs", ONSCREEN_DISPLAY_DEBUG_INFORMATION_WITH_CORE_MSG}, +}; + +const int numberOfOpenGLRenderEngineSettings = sizeof(OpenGLRenderSettings)/sizeof(RenderEngineSetting); + +void GenerateFrameBufferOptions(void) +{ + if( CDeviceBuilder::GetGeneralDeviceType() == OGL_DEVICE ) + { + // OpenGL does not support much yet + if( currentRomOptions.N64FrameBufferEmuType != FRM_BUF_NONE ) + currentRomOptions.N64FrameBufferEmuType = FRM_BUF_IGNORE; + if( currentRomOptions.N64RenderToTextureEmuType != TXT_BUF_NONE ) + currentRomOptions.N64RenderToTextureEmuType = TXT_BUF_IGNORE; + } + + frameBufferOptions.bUpdateCIInfo = false; + + frameBufferOptions.bCheckBackBufs = false; + frameBufferOptions.bWriteBackBufToRDRAM = false; + frameBufferOptions.bLoadBackBufFromRDRAM = false; + + frameBufferOptions.bIgnore = true; + + frameBufferOptions.bSupportRenderTextures = false; + frameBufferOptions.bCheckRenderTextures = false; + frameBufferOptions.bRenderTextureWriteBack = false; + frameBufferOptions.bLoadRDRAMIntoRenderTexture = false; + + frameBufferOptions.bProcessCPUWrite = false; + frameBufferOptions.bProcessCPURead = false; + frameBufferOptions.bAtEachFrameUpdate = false; + frameBufferOptions.bIgnoreRenderTextureIfHeightUnknown = false; + + switch( currentRomOptions.N64FrameBufferEmuType ) + { + case FRM_BUF_NONE: + break; + case FRM_BUF_COMPLETE: + frameBufferOptions.bAtEachFrameUpdate = true; + frameBufferOptions.bProcessCPUWrite = true; + frameBufferOptions.bProcessCPURead = true; + frameBufferOptions.bUpdateCIInfo = true; + break; + case FRM_BUF_WRITEBACK_AND_RELOAD: + frameBufferOptions.bLoadBackBufFromRDRAM = true; + case FRM_BUF_BASIC_AND_WRITEBACK: + frameBufferOptions.bWriteBackBufToRDRAM = true; + case FRM_BUF_BASIC: + frameBufferOptions.bCheckBackBufs = true; + case FRM_BUF_IGNORE: + frameBufferOptions.bUpdateCIInfo = true; + break; + case FRM_BUF_BASIC_AND_WITH_EMULATOR: + // Banjo Kazooie + frameBufferOptions.bCheckBackBufs = true; + case FRM_BUF_WITH_EMULATOR: + frameBufferOptions.bUpdateCIInfo = true; + frameBufferOptions.bProcessCPUWrite = true; + frameBufferOptions.bProcessCPURead = true; + break; + case FRM_BUF_WITH_EMULATOR_READ_ONLY: + frameBufferOptions.bUpdateCIInfo = true; + frameBufferOptions.bProcessCPURead = true; + break; + case FRM_BUF_WITH_EMULATOR_WRITE_ONLY: + frameBufferOptions.bUpdateCIInfo = true; + frameBufferOptions.bProcessCPUWrite = true; + break; + } + + switch( currentRomOptions.N64RenderToTextureEmuType ) + { + case TXT_BUF_NONE: + frameBufferOptions.bSupportRenderTextures = false; + break; + case TXT_BUF_WRITE_BACK_AND_RELOAD: + frameBufferOptions.bLoadRDRAMIntoRenderTexture = true; + case TXT_BUF_WRITE_BACK: + frameBufferOptions.bRenderTextureWriteBack = true; + case TXT_BUF_NORMAL: + frameBufferOptions.bCheckRenderTextures = true; + frameBufferOptions.bIgnore = false; + case TXT_BUF_IGNORE: + frameBufferOptions.bUpdateCIInfo = true; + frameBufferOptions.bSupportRenderTextures = true; + break; + } + + if( currentRomOptions.screenUpdateSetting >= SCREEN_UPDATE_AT_CI_CHANGE ) + { + frameBufferOptions.bUpdateCIInfo = true; + } +} + +BOOL InitConfiguration(void) +{ + if (ConfigOpenSection("Video-General", &l_ConfigVideoGeneral) != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_ERROR, "Unable to open Video-General configuration section"); + return FALSE; + } + if (ConfigOpenSection("Video-Rice", &l_ConfigVideoRice) != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_ERROR, "Unable to open Video-Rice configuration section"); + return FALSE; + } + + ConfigSetDefaultBool(l_ConfigVideoGeneral, "Fullscreen", 0, "Use fullscreen mode if True, or windowed mode if False "); + ConfigSetDefaultInt(l_ConfigVideoGeneral, "ScreenWidth", 640, "Width of output window or fullscreen width"); + ConfigSetDefaultInt(l_ConfigVideoGeneral, "ScreenHeight", 480, "Height of output window or fullscreen height"); + ConfigSetDefaultBool(l_ConfigVideoGeneral, "VerticalSync", 0, "If true, activate the SDL_GL_SWAP_CONTROL attribute"); + + ConfigSetDefaultInt(l_ConfigVideoRice, "FrameBufferSetting", FRM_BUF_NONE, "Frame Buffer Emulation (0=ROM default, 1=disable)"); + ConfigSetDefaultInt(l_ConfigVideoRice, "FrameBufferWriteBackControl", FRM_BUF_WRITEBACK_NORMAL, "Frequency to write back the frame buffer (0=every frame, 1=every other frame, etc)"); + ConfigSetDefaultInt(l_ConfigVideoRice, "RenderToTexture", TXT_BUF_NONE, "Render-to-texture emulation (0=none, 1=ignore, 2=normal, 3=write back, 4=write back and reload)"); +#if defined(WIN32) + ConfigSetDefaultInt(l_ConfigVideoRice, "ScreenUpdateSetting", SCREEN_UPDATE_AT_1ST_CI_CHANGE, "Control when the screen will be updated (0=ROM default, 1=VI origin update, 2=VI origin change, 3=CI change, 4=first CI change, 5=first primitive draw, 6=before screen clear, 7=after screen drawn)"); // SCREEN_UPDATE_AT_VI_UPDATE_AND_DRAWN +#else + ConfigSetDefaultInt(l_ConfigVideoRice, "ScreenUpdateSetting", SCREEN_UPDATE_AT_VI_UPDATE, "Control when the screen will be updated (0=ROM default, 1=VI origin update, 2=VI origin change, 3=CI change, 4=first CI change, 5=first primitive draw, 6=before screen clear, 7=after screen drawn)"); // SCREEN_UPDATE_AT_VI_UPDATE_AND_DRAWN +#endif + ConfigSetDefaultBool(l_ConfigVideoRice, "NormalAlphaBlender", FALSE, "Force to use normal alpha blender"); + ConfigSetDefaultBool(l_ConfigVideoRice, "FastTextureLoading", FALSE, "Use a faster algorithm to speed up texture loading and CRC computation"); + ConfigSetDefaultBool(l_ConfigVideoRice, "AccurateTextureMapping", TRUE, "Use different texture coordinate clamping code"); + ConfigSetDefaultBool(l_ConfigVideoRice, "InN64Resolution", FALSE, "Force emulated frame buffers to be in N64 native resolution"); + ConfigSetDefaultBool(l_ConfigVideoRice, "SaveVRAM", FALSE, "Try to reduce Video RAM usage (should never be used)"); + ConfigSetDefaultBool(l_ConfigVideoRice, "DoubleSizeForSmallTxtrBuf", FALSE, "Enable this option to have better render-to-texture quality"); + ConfigSetDefaultBool(l_ConfigVideoRice, "DefaultCombinerDisable", FALSE, "Force to use normal color combiner"); + + ConfigSetDefaultBool(l_ConfigVideoRice, "EnableHacks", TRUE, "Enable game-specific settings from INI file"); + ConfigSetDefaultBool(l_ConfigVideoRice, "WinFrameMode", FALSE, "If enabled, graphics will be drawn in WinFrame mode instead of solid and texture mode"); + ConfigSetDefaultBool(l_ConfigVideoRice, "FullTMEMEmulation", FALSE, "N64 Texture Memory Full Emulation (may fix some games, may break others)"); + ConfigSetDefaultBool(l_ConfigVideoRice, "OpenGLVertexClipper", FALSE, "Enable vertex clipper for fog operations"); + ConfigSetDefaultBool(l_ConfigVideoRice, "EnableSSE", TRUE, "Enable/Disable SSE optimizations for capable CPUs"); + ConfigSetDefaultBool(l_ConfigVideoRice, "EnableVertexShader", FALSE, "Use GPU vertex shader"); + ConfigSetDefaultBool(l_ConfigVideoRice, "SkipFrame", FALSE, "If this option is enabled, the plugin will skip every other frame"); + ConfigSetDefaultBool(l_ConfigVideoRice, "TexRectOnly", FALSE, "If enabled, texture enhancement will be done only for TxtRect ucode"); + ConfigSetDefaultBool(l_ConfigVideoRice, "SmallTextureOnly", FALSE, "If enabled, texture enhancement will be done only for textures width+height<=128"); + ConfigSetDefaultBool(l_ConfigVideoRice, "LoadHiResCRCOnly", TRUE, "Select hi-resolution textures based only on the CRC and ignore format+size information (Glide64 compatibility)"); + ConfigSetDefaultBool(l_ConfigVideoRice, "LoadHiResTextures", FALSE, "Enable hi-resolution texture file loading"); + ConfigSetDefaultBool(l_ConfigVideoRice, "DumpTexturesToFiles", FALSE, "Enable texture dumping"); + ConfigSetDefaultBool(l_ConfigVideoRice, "ShowFPS", FALSE, "Display On-screen FPS"); + + ConfigSetDefaultInt(l_ConfigVideoRice, "Mipmapping", 2, "Use Mipmapping? 0=no, 1=nearest, 2=bilinear, 3=trilinear"); + ConfigSetDefaultInt(l_ConfigVideoRice, "FogMethod", 0, "Enable, Disable or Force fog generation (0=Disable, 1=Enable n64 choose, 2=Force Fog)"); + ConfigSetDefaultInt(l_ConfigVideoRice, "ForceTextureFilter", 0, "Force to use texture filtering or not (0=auto: n64 choose, 1=force no filtering, 2=force filtering)"); + ConfigSetDefaultInt(l_ConfigVideoRice, "TextureEnhancement", 0, "Primary texture enhancement filter (0=None, 1=2X, 2=2XSAI, 3=HQ2X, 4=LQ2X, 5=HQ4X, 6=Sharpen, 7=Sharpen More, 8=External, 9=Mirrored)"); + ConfigSetDefaultInt(l_ConfigVideoRice, "TextureEnhancementControl", 0, "Secondary texture enhancement filter (0 = none, 1-4 = filtered)"); + ConfigSetDefaultInt(l_ConfigVideoRice, "TextureQuality", TXT_QUALITY_DEFAULT, "Color bit depth to use for textures (0=default, 1=32 bits, 2=16 bits)"); + ConfigSetDefaultInt(l_ConfigVideoRice, "OpenGLDepthBufferSetting", 16, "Z-buffer depth (only 16 or 32)"); + ConfigSetDefaultInt(l_ConfigVideoRice, "MultiSampling", 0, "Enable/Disable MultiSampling (0=off, 2,4,8,16=quality)"); + ConfigSetDefaultInt(l_ConfigVideoRice, "ColorQuality", TEXTURE_FMT_A8R8G8B8, "Color bit depth for rendering window (0=32 bits, 1=16 bits)"); + ConfigSetDefaultInt(l_ConfigVideoRice, "OpenGLRenderSetting", OGL_DEVICE, "OpenGL level to support (0=auto, 1=OGL_1.1, 2=OGL_1.2, 3=OGL_1.3, 4=OGL_1.4, 5=OGL_1.4_V2, 6=OGL_TNT2, 7=NVIDIA_OGL, 8=OGL_FRAGMENT_PROGRAM)"); + ConfigSetDefaultInt(l_ConfigVideoRice, "AnisotropicFiltering", 0, "Enable/Disable Anisotropic Filtering for Mipmapping (0=no filtering, 2-16=quality). This is uneffective if Mipmapping is 0. If the given value is to high to be supported by your graphic card, the value will be the highest value your graphic card can support. Better result with Trilinear filtering"); + return TRUE; +} + +bool isMMXSupported() +{ + int IsMMXSupported = 0; + +#if !defined(__GNUC__) && !defined(NO_ASM) + __asm + { + mov eax,1 // CPUID level 1 + cpuid // EDX = feature flag + and edx,0x800000 // test bit 23 of feature flag + mov IsMMXSupported,edx // != 0 if MMX is supported + } +#elif defined(__GNUC__) && defined(__x86_64__) && !defined(NO_ASM) + return true; +#elif !defined(NO_ASM) // GCC assumed + asm volatile ( + "push %%ebx \n" + "mov $1, %%eax \n" // CPUID level 1 + "cpuid \n" // EDX = feature flag + "and $0x800000, %%edx \n" // test bit 23 of feature flag + "pop %%ebx \n" + : "=d"(IsMMXSupported) + : + : "memory", "cc", "eax", "ecx" + ); +#endif + if (IsMMXSupported != 0) + return true; + else + return false; +} + +bool isSSESupported() +{ + int SSESupport = 0; + +// And finally, check the CPUID for Streaming SIMD Extensions support. +#if !defined(__GNUC__) && !defined(NO_ASM) + _asm + { + mov eax, 1 // Put a "1" in eax to tell CPUID to get the feature bits + cpuid // Perform CPUID (puts processor feature info into EDX) + and edx, 02000000h // Test bit 25, for Streaming SIMD Extensions existence. + mov SSESupport, edx // SIMD Extensions). Set return value to 1 to indicate, + } +#elif defined(__GNUC__) && defined(__x86_64__) && !defined(NO_ASM) + return true; +#elif !defined(NO_ASM) // GCC assumed + asm volatile ( + "push %%ebx \n" + "mov $1, %%eax \n" // Put a "1" in eax to tell CPUID to get the feature bits + "cpuid \n" // Perform CPUID (puts processor feature info into EDX) + "and $0x02000000, %%edx \n" // Test bit 25, for Streaming SIMD Extensions existence. + "pop %%ebx \n" + : "=d"(SSESupport) + : + : "memory", "cc", "eax", "ecx" + ); +# endif + + if (SSESupport != 0) + return true; + else + return false; +} + +static void ReadConfiguration(void) +{ + windowSetting.bDisplayFullscreen = ConfigGetParamBool(l_ConfigVideoGeneral, "Fullscreen"); + windowSetting.uDisplayWidth = ConfigGetParamInt(l_ConfigVideoGeneral, "ScreenWidth"); + windowSetting.uDisplayHeight = ConfigGetParamInt(l_ConfigVideoGeneral, "ScreenHeight"); + windowSetting.bVerticalSync = ConfigGetParamBool(l_ConfigVideoGeneral, "VerticalSync"); + + defaultRomOptions.N64FrameBufferEmuType = ConfigGetParamInt(l_ConfigVideoRice, "FrameBufferSetting"); + defaultRomOptions.N64FrameBufferWriteBackControl = ConfigGetParamInt(l_ConfigVideoRice, "FrameBufferWriteBackControl"); + defaultRomOptions.N64RenderToTextureEmuType = ConfigGetParamInt(l_ConfigVideoRice, "RenderToTexture"); + defaultRomOptions.screenUpdateSetting = ConfigGetParamInt(l_ConfigVideoRice, "screenUpdateSetting"); + + defaultRomOptions.bNormalBlender = ConfigGetParamBool(l_ConfigVideoRice, "NormalAlphaBlender"); + defaultRomOptions.bFastTexCRC = ConfigGetParamBool(l_ConfigVideoRice, "FastTextureLoading"); + defaultRomOptions.bAccurateTextureMapping = ConfigGetParamBool(l_ConfigVideoRice, "AccurateTextureMapping"); + defaultRomOptions.bInN64Resolution = ConfigGetParamBool(l_ConfigVideoRice, "InN64Resolution"); + defaultRomOptions.bSaveVRAM = ConfigGetParamBool(l_ConfigVideoRice, "SaveVRAM"); + defaultRomOptions.bDoubleSizeForSmallTxtrBuf = ConfigGetParamBool(l_ConfigVideoRice, "DoubleSizeForSmallTxtrBuf"); + defaultRomOptions.bNormalCombiner = ConfigGetParamBool(l_ConfigVideoRice, "DefaultCombinerDisable"); + + options.bEnableHacks = ConfigGetParamBool(l_ConfigVideoRice, "EnableHacks"); + options.bWinFrameMode = ConfigGetParamBool(l_ConfigVideoRice, "WinFrameMode"); + options.bFullTMEM = ConfigGetParamBool(l_ConfigVideoRice, "FullTMEMEmulation"); + options.bOGLVertexClipper = ConfigGetParamBool(l_ConfigVideoRice, "OpenGLVertexClipper"); + options.bEnableSSE = ConfigGetParamBool(l_ConfigVideoRice, "EnableSSE"); + options.bEnableVertexShader = ConfigGetParamBool(l_ConfigVideoRice, "EnableVertexShader"); + options.bSkipFrame = ConfigGetParamBool(l_ConfigVideoRice, "SkipFrame"); + options.bTexRectOnly = ConfigGetParamBool(l_ConfigVideoRice, "TexRectOnly"); + options.bSmallTextureOnly = ConfigGetParamBool(l_ConfigVideoRice, "SmallTextureOnly"); + options.bLoadHiResTextures = ConfigGetParamBool(l_ConfigVideoRice, "LoadHiResTextures"); + options.bLoadHiResCRCOnly = ConfigGetParamBool(l_ConfigVideoRice, "LoadHiResCRCOnly"); + options.bDumpTexturesToFiles = ConfigGetParamBool(l_ConfigVideoRice, "DumpTexturesToFiles"); + options.bShowFPS = ConfigGetParamBool(l_ConfigVideoRice, "ShowFPS"); + + options.mipmapping = ConfigGetParamInt(l_ConfigVideoRice, "Mipmapping"); + options.fogMethod = ConfigGetParamInt(l_ConfigVideoRice, "FogMethod"); + options.forceTextureFilter = ConfigGetParamInt(l_ConfigVideoRice, "ForceTextureFilter"); + options.textureEnhancement = ConfigGetParamInt(l_ConfigVideoRice, "TextureEnhancement"); + options.textureEnhancementControl = ConfigGetParamInt(l_ConfigVideoRice, "TextureEnhancementControl"); + options.textureQuality = ConfigGetParamInt(l_ConfigVideoRice, "TextureQuality"); + options.OpenglDepthBufferSetting = ConfigGetParamInt(l_ConfigVideoRice, "OpenGLDepthBufferSetting"); + options.multiSampling = ConfigGetParamInt(l_ConfigVideoRice, "MultiSampling"); + options.colorQuality = ConfigGetParamInt(l_ConfigVideoRice, "ColorQuality"); + options.OpenglRenderSetting = ConfigGetParamInt(l_ConfigVideoRice, "OpenGLRenderSetting"); + options.anisotropicFiltering = ConfigGetParamInt(l_ConfigVideoRice, "AnisotropicFiltering"); + + CDeviceBuilder::SelectDeviceType((SupportedDeviceType)options.OpenglRenderSetting); + + status.isMMXSupported = isMMXSupported(); + status.isSSESupported = isSSESupported(); + status.isVertexShaderSupported = false; + + status.isSSEEnabled = status.isSSESupported && options.bEnableSSE; +#if !defined(NO_ASM) + if( status.isSSEEnabled ) + { + ProcessVertexData = ProcessVertexDataSSE; + DebugMessage(M64MSG_INFO, "SSE processing enabled."); + } + else +#endif + { + ProcessVertexData = ProcessVertexDataNoSSE; + DebugMessage(M64MSG_INFO, "Disabled SSE processing."); + } + + status.isVertexShaderEnabled = status.isVertexShaderSupported && options.bEnableVertexShader; + status.bUseHW_T_L = false; +} + +BOOL LoadConfiguration(void) +{ + IniSections.clear(); + bIniIsChanged = false; + strcpy(szIniFileName, INI_FILE); + + if (!ReadIniFile()) + { + DebugMessage(M64MSG_ERROR, "Unable to read ini file from disk"); + return FALSE; + } + + if (l_ConfigVideoGeneral == NULL || l_ConfigVideoRice == NULL) + { + DebugMessage(M64MSG_ERROR, "Rice Video configuration sections are not open!"); + return FALSE; + } + + // Read config parameters from core config API and set up internal variables + ReadConfiguration(); + + return TRUE; +} + +void GenerateCurrentRomOptions() +{ + currentRomOptions.N64FrameBufferEmuType =g_curRomInfo.dwFrameBufferOption; + currentRomOptions.N64FrameBufferWriteBackControl =defaultRomOptions.N64FrameBufferWriteBackControl; + currentRomOptions.N64RenderToTextureEmuType =g_curRomInfo.dwRenderToTextureOption; + currentRomOptions.screenUpdateSetting =g_curRomInfo.dwScreenUpdateSetting; + currentRomOptions.bNormalCombiner =g_curRomInfo.dwNormalCombiner; + currentRomOptions.bNormalBlender =g_curRomInfo.dwNormalBlender; + currentRomOptions.bFastTexCRC =g_curRomInfo.dwFastTextureCRC; + currentRomOptions.bAccurateTextureMapping =g_curRomInfo.dwAccurateTextureMapping; + + options.enableHackForGames = NO_HACK_FOR_GAME; + if ((strncmp((char*)g_curRomInfo.szGameName, "BANJO TOOIE", 11) == 0)) + { + options.enableHackForGames = HACK_FOR_BANJO_TOOIE; + } + else if ((strncmp((char*)g_curRomInfo.szGameName, "DR.MARIO", 8) == 0)) + { + options.enableHackForGames = HACK_FOR_DR_MARIO; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "Pilot", 5) == 0)) + { + options.enableHackForGames = HACK_FOR_PILOT_WINGS; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "YOSHI", 5) == 0)) + { + options.enableHackForGames = HACK_FOR_YOSHI; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "NITRO", 5) == 0)) + { + options.enableHackForGames = HACK_FOR_NITRO; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "TONY HAWK", 9) == 0)) + { + options.enableHackForGames = HACK_FOR_TONYHAWK; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "THPS", 4) == 0)) + { + options.enableHackForGames = HACK_FOR_TONYHAWK; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "SPIDERMAN", 9) == 0)) + { + options.enableHackForGames = HACK_FOR_TONYHAWK; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "NASCAR", 6) == 0)) + { + options.enableHackForGames = HACK_FOR_NASCAR; + } + else if ((strstr((char*)g_curRomInfo.szGameName, "ZELDA") != 0) && (strstr((char*)g_curRomInfo.szGameName, "MASK") != 0)) + { + options.enableHackForGames = HACK_FOR_ZELDA_MM; + } + else if ((strstr((char*)g_curRomInfo.szGameName, "ZELDA") != 0)) + { + options.enableHackForGames = HACK_FOR_ZELDA; + } + else if ((strstr((char*)g_curRomInfo.szGameName, "Ogre") != 0)) + { + options.enableHackForGames = HACK_FOR_OGRE_BATTLE; + } + else if ((strstr((char*)g_curRomInfo.szGameName, "TWINE") != 0)) + { + options.enableHackForGames = HACK_FOR_TWINE; + } + else if ((strstr((char*)g_curRomInfo.szGameName, "Squadron") != 0)) + { + options.enableHackForGames = HACK_FOR_ROGUE_SQUADRON; + } + else if ((strstr((char*)g_curRomInfo.szGameName, "Baseball") != 0) && (strstr((char*)g_curRomInfo.szGameName, "Star") != 0)) + { + options.enableHackForGames = HACK_FOR_ALL_STAR_BASEBALL; + } + else if ((strstr((char*)g_curRomInfo.szGameName, "Tigger") != 0) && (strstr((char*)g_curRomInfo.szGameName, "Honey") != 0)) + { + options.enableHackForGames = HACK_FOR_TIGER_HONEY_HUNT; + } + else if ((strstr((char*)g_curRomInfo.szGameName, "Bust") != 0) && (strstr((char*)g_curRomInfo.szGameName, "Move") != 0)) + { + options.enableHackForGames = HACK_FOR_BUST_A_MOVE; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "MarioTennis",11) == 0)) + { + options.enableHackForGames = HACK_FOR_MARIO_TENNIS; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "SUPER BOWLING",13) == 0)) + { + options.enableHackForGames = HACK_FOR_SUPER_BOWLING; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "CONKER",6) == 0)) + { + options.enableHackForGames = HACK_FOR_CONKER; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "MK_MYTHOLOGIES",14) == 0)) + { + options.enableHackForGames = HACK_REVERSE_Y_COOR; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "Fighting Force",14) == 0)) + { + options.enableHackForGames = HACK_REVERSE_XY_COOR; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "GOLDENEYE",9) == 0)) + { + options.enableHackForGames = HACK_FOR_GOLDEN_EYE; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "F-ZERO",6) == 0)) + { + options.enableHackForGames = HACK_FOR_FZERO; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "Command&Conquer",15) == 0)) + { + options.enableHackForGames = HACK_FOR_COMMANDCONQUER; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "READY 2 RUMBLE",14) == 0)) + { + options.enableHackForGames = HACK_FOR_RUMBLE; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "READY to RUMBLE",15) == 0)) + { + options.enableHackForGames = HACK_FOR_RUMBLE; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "South Park Rally",16) == 0)) + { + options.enableHackForGames = HACK_FOR_SOUTH_PARK_RALLY; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "Extreme G 2",11) == 0)) + { + options.enableHackForGames = HACK_FOR_EXTREME_G2; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "MarioGolf64",11) == 0)) + { + options.enableHackForGames = HACK_FOR_MARIO_GOLF; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "MLB FEATURING",13) == 0)) + { + options.enableHackForGames = HACK_FOR_MLB; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "POLARISSNOCROSS",15) == 0)) + { + options.enableHackForGames = HACK_FOR_POLARISSNOCROSS; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "TOP GEAR RALLY",14) == 0)) + { + options.enableHackForGames = HACK_FOR_TOPGEARRALLY; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "DUKE NUKEM",10) == 0)) + { + options.enableHackForGames = HACK_FOR_DUKE_NUKEM; + } + else if ((strncasecmp((char*)g_curRomInfo.szGameName, "MARIOKART64",11) == 0)) + { + options.enableHackForGames = HACK_FOR_MARIO_KART; + } + + if (options.enableHackForGames != NO_HACK_FOR_GAME) + DebugMessage(M64MSG_INFO, "Enabled hacks for game: '%s'", g_curRomInfo.szGameName); + + if( currentRomOptions.N64FrameBufferEmuType == 0 ) currentRomOptions.N64FrameBufferEmuType = defaultRomOptions.N64FrameBufferEmuType; + else currentRomOptions.N64FrameBufferEmuType--; + if( currentRomOptions.N64RenderToTextureEmuType == 0 ) currentRomOptions.N64RenderToTextureEmuType = defaultRomOptions.N64RenderToTextureEmuType; + else currentRomOptions.N64RenderToTextureEmuType--; + if( currentRomOptions.screenUpdateSetting == 0 ) currentRomOptions.screenUpdateSetting = defaultRomOptions.screenUpdateSetting; + if( currentRomOptions.bNormalCombiner == 0 ) currentRomOptions.bNormalCombiner = defaultRomOptions.bNormalCombiner; + else currentRomOptions.bNormalCombiner--; + if( currentRomOptions.bNormalBlender == 0 ) currentRomOptions.bNormalBlender = defaultRomOptions.bNormalBlender; + else currentRomOptions.bNormalBlender--; + if( currentRomOptions.bFastTexCRC == 0 ) currentRomOptions.bFastTexCRC = defaultRomOptions.bFastTexCRC; + else currentRomOptions.bFastTexCRC--; + if( currentRomOptions.bAccurateTextureMapping == 0 ) currentRomOptions.bAccurateTextureMapping = defaultRomOptions.bAccurateTextureMapping; + else currentRomOptions.bAccurateTextureMapping--; + + options.bUseFullTMEM = ((options.bFullTMEM && (g_curRomInfo.dwFullTMEM == 0)) || g_curRomInfo.dwFullTMEM == 2); + + GenerateFrameBufferOptions(); + + if( options.enableHackForGames == HACK_FOR_MARIO_GOLF || options.enableHackForGames == HACK_FOR_MARIO_TENNIS ) + { + frameBufferOptions.bIgnoreRenderTextureIfHeightUnknown = true; + } +} + +void Ini_GetRomOptions(LPGAMESETTING pGameSetting) +{ + int i; + + i = FindIniEntry(pGameSetting->romheader.dwCRC1, + pGameSetting->romheader.dwCRC2, + pGameSetting->romheader.nCountryID, + (char*)pGameSetting->szGameName, 1); + + pGameSetting->bDisableTextureCRC = IniSections[i].bDisableTextureCRC; + pGameSetting->bDisableCulling = IniSections[i].bDisableCulling; + pGameSetting->bIncTexRectEdge = IniSections[i].bIncTexRectEdge; + pGameSetting->bZHack = IniSections[i].bZHack; + pGameSetting->bTextureScaleHack = IniSections[i].bTextureScaleHack; + pGameSetting->bPrimaryDepthHack = IniSections[i].bPrimaryDepthHack; + pGameSetting->bTexture1Hack = IniSections[i].bTexture1Hack; + pGameSetting->bFastLoadTile = IniSections[i].bFastLoadTile; + pGameSetting->bUseSmallerTexture = IniSections[i].bUseSmallerTexture; + + pGameSetting->VIWidth = IniSections[i].VIWidth; + pGameSetting->VIHeight = IniSections[i].VIHeight; + pGameSetting->UseCIWidthAndRatio = IniSections[i].UseCIWidthAndRatio; + pGameSetting->dwFullTMEM = IniSections[i].dwFullTMEM; + pGameSetting->bTxtSizeMethod2 = IniSections[i].bTxtSizeMethod2; + pGameSetting->bEnableTxtLOD = IniSections[i].bEnableTxtLOD; + + pGameSetting->dwFastTextureCRC = IniSections[i].dwFastTextureCRC; + pGameSetting->bEmulateClear = IniSections[i].bEmulateClear; + pGameSetting->bForceScreenClear = IniSections[i].bForceScreenClear; + pGameSetting->dwAccurateTextureMapping = IniSections[i].dwAccurateTextureMapping; + pGameSetting->dwNormalBlender = IniSections[i].dwNormalBlender; + pGameSetting->bDisableBlender = IniSections[i].bDisableBlender; + pGameSetting->dwNormalCombiner = IniSections[i].dwNormalCombiner; + pGameSetting->bForceDepthBuffer = IniSections[i].bForceDepthBuffer; + pGameSetting->bDisableObjBG = IniSections[i].bDisableObjBG; + pGameSetting->dwFrameBufferOption = IniSections[i].dwFrameBufferOption; + pGameSetting->dwRenderToTextureOption = IniSections[i].dwRenderToTextureOption; + pGameSetting->dwScreenUpdateSetting = IniSections[i].dwScreenUpdateSetting; +} + +void Ini_StoreRomOptions(LPGAMESETTING pGameSetting) +{ + int i; + + i = FindIniEntry(pGameSetting->romheader.dwCRC1, + pGameSetting->romheader.dwCRC2, + pGameSetting->romheader.nCountryID, + (char*)pGameSetting->szGameName, 0); + + if( IniSections[i].bDisableTextureCRC !=pGameSetting->bDisableTextureCRC ) + { + IniSections[i].bDisableTextureCRC =pGameSetting->bDisableTextureCRC ; + bIniIsChanged=true; + } + + if( IniSections[i].bDisableCulling !=pGameSetting->bDisableCulling ) + { + IniSections[i].bDisableCulling =pGameSetting->bDisableCulling ; + bIniIsChanged=true; + } + + if( IniSections[i].dwFastTextureCRC !=pGameSetting->dwFastTextureCRC ) + { + IniSections[i].dwFastTextureCRC =pGameSetting->dwFastTextureCRC ; + bIniIsChanged=true; + } + + if( IniSections[i].bEmulateClear !=pGameSetting->bEmulateClear ) + { + IniSections[i].bEmulateClear =pGameSetting->bEmulateClear ; + bIniIsChanged=true; + } + + if( IniSections[i].dwNormalBlender !=pGameSetting->dwNormalBlender ) + { + IniSections[i].dwNormalBlender =pGameSetting->dwNormalBlender ; + bIniIsChanged=true; + } + + if( IniSections[i].bDisableBlender !=pGameSetting->bDisableBlender ) + { + IniSections[i].bDisableBlender =pGameSetting->bDisableBlender ; + bIniIsChanged=true; + } + + if( IniSections[i].bForceScreenClear !=pGameSetting->bForceScreenClear ) + { + IniSections[i].bForceScreenClear =pGameSetting->bForceScreenClear ; + bIniIsChanged=true; + } + if( IniSections[i].dwAccurateTextureMapping !=pGameSetting->dwAccurateTextureMapping ) + { + IniSections[i].dwAccurateTextureMapping =pGameSetting->dwAccurateTextureMapping ; + bIniIsChanged=true; + } + if( IniSections[i].dwNormalCombiner !=pGameSetting->dwNormalCombiner ) + { + IniSections[i].dwNormalCombiner =pGameSetting->dwNormalCombiner ; + bIniIsChanged=true; + } + if( IniSections[i].bForceDepthBuffer !=pGameSetting->bForceDepthBuffer ) + { + IniSections[i].bForceDepthBuffer =pGameSetting->bForceDepthBuffer ; + bIniIsChanged=true; + } + if( IniSections[i].bDisableObjBG !=pGameSetting->bDisableObjBG ) + { + IniSections[i].bDisableObjBG =pGameSetting->bDisableObjBG ; + bIniIsChanged=true; + } + if( IniSections[i].dwFrameBufferOption !=pGameSetting->dwFrameBufferOption ) + { + IniSections[i].dwFrameBufferOption =pGameSetting->dwFrameBufferOption ; + bIniIsChanged=true; + } + if( IniSections[i].dwRenderToTextureOption !=pGameSetting->dwRenderToTextureOption ) + { + IniSections[i].dwRenderToTextureOption =pGameSetting->dwRenderToTextureOption ; + bIniIsChanged=true; + } + if( IniSections[i].dwScreenUpdateSetting !=pGameSetting->dwScreenUpdateSetting ) + { + IniSections[i].dwScreenUpdateSetting =pGameSetting->dwScreenUpdateSetting ; + bIniIsChanged=true; + } + if( IniSections[i].bIncTexRectEdge != pGameSetting->bIncTexRectEdge ) + { + IniSections[i].bIncTexRectEdge =pGameSetting->bIncTexRectEdge; + bIniIsChanged=true; + } + if( IniSections[i].bZHack != pGameSetting->bZHack ) + { + IniSections[i].bZHack =pGameSetting->bZHack; + bIniIsChanged=true; + } + if( IniSections[i].bTextureScaleHack != pGameSetting->bTextureScaleHack ) + { + IniSections[i].bTextureScaleHack =pGameSetting->bTextureScaleHack; + bIniIsChanged=true; + } + if( IniSections[i].bPrimaryDepthHack != pGameSetting->bPrimaryDepthHack ) + { + IniSections[i].bPrimaryDepthHack =pGameSetting->bPrimaryDepthHack; + bIniIsChanged=true; + } + if( IniSections[i].bTexture1Hack != pGameSetting->bTexture1Hack ) + { + IniSections[i].bTexture1Hack =pGameSetting->bTexture1Hack; + bIniIsChanged=true; + } + if( IniSections[i].bFastLoadTile != pGameSetting->bFastLoadTile ) + { + IniSections[i].bFastLoadTile =pGameSetting->bFastLoadTile; + bIniIsChanged=true; + } + if( IniSections[i].bUseSmallerTexture != pGameSetting->bUseSmallerTexture ) + { + IniSections[i].bUseSmallerTexture =pGameSetting->bUseSmallerTexture; + bIniIsChanged=true; + } + if( IniSections[i].VIWidth != pGameSetting->VIWidth ) + { + IniSections[i].VIWidth =pGameSetting->VIWidth; + bIniIsChanged=true; + } + if( IniSections[i].VIHeight != pGameSetting->VIHeight ) + { + IniSections[i].VIHeight =pGameSetting->VIHeight; + bIniIsChanged=true; + } + if( IniSections[i].UseCIWidthAndRatio != pGameSetting->UseCIWidthAndRatio ) + { + IniSections[i].UseCIWidthAndRatio =pGameSetting->UseCIWidthAndRatio; + bIniIsChanged=true; + } + if( IniSections[i].dwFullTMEM != pGameSetting->dwFullTMEM ) + { + IniSections[i].dwFullTMEM =pGameSetting->dwFullTMEM; + bIniIsChanged=true; + } + if( IniSections[i].bTxtSizeMethod2 != pGameSetting->bTxtSizeMethod2 ) + { + IniSections[i].bTxtSizeMethod2 =pGameSetting->bTxtSizeMethod2; + bIniIsChanged=true; + } + if( IniSections[i].bEnableTxtLOD != pGameSetting->bEnableTxtLOD ) + { + IniSections[i].bEnableTxtLOD =pGameSetting->bEnableTxtLOD; + bIniIsChanged=true; + } + + if( bIniIsChanged ) + { + WriteIniFile(); + TRACE0("Rom option is changed and saved"); + } +} + +std::ifstream& getline( std::ifstream &is, char *str ); + +char * left(const char * src, int nchars) +{ + static char dst[300]; + strncpy(dst,src,nchars); + dst[nchars]=0; + return dst; +} + +char * right(const char *src, int nchars) +{ + static char dst[300]; + int srclen = strlen(src); + if (nchars >= srclen) + { + strcpy(dst, src); + } + else + { + strncpy(dst, src + srclen - nchars, nchars); + dst[nchars]=0; + } + return dst; +} + +char * tidy(char * s) +{ + char * p = s + strlen(s); + + p--; + while (p >= s && (*p == ' ' || *p == 0xa || *p == '\n') ) + { + *p = 0; + p--; + } + return s; + +} + +BOOL ReadIniFile() +{ + std::ifstream inifile; + char readinfo[100]; + const char *ini_filepath = ConfigGetSharedDataFilepath(szIniFileName); + + DebugMessage(M64MSG_VERBOSE, "Reading .ini file: %s", ini_filepath); + inifile.open(ini_filepath); + + if (inifile.fail()) + { + return FALSE; + } + + while (getline(inifile,readinfo)/*&§ionno<999*/) + { + tidy(readinfo); + + if (readinfo[0] == '/') + continue; + + if (!strcasecmp(readinfo,"")==0) + { + if (readinfo[0] == '{') //if a section heading + { + section newsection; + + readinfo[strlen(readinfo)-1]='\0'; + strcpy(newsection.crccheck, readinfo+1); + + newsection.bDisableTextureCRC = FALSE; + newsection.bDisableCulling = FALSE; + newsection.bIncTexRectEdge = FALSE; + newsection.bZHack = FALSE; + newsection.bTextureScaleHack = FALSE; + newsection.bFastLoadTile = FALSE; + newsection.bUseSmallerTexture = FALSE; + newsection.bPrimaryDepthHack = FALSE; + newsection.bTexture1Hack = FALSE; + newsection.bDisableObjBG = FALSE; + newsection.VIWidth = -1; + newsection.VIHeight = -1; + newsection.UseCIWidthAndRatio = NOT_USE_CI_WIDTH_AND_RATIO; + newsection.dwFullTMEM = 0; + newsection.bTxtSizeMethod2 = FALSE; + newsection.bEnableTxtLOD = FALSE; + + newsection.bEmulateClear = FALSE; + newsection.bForceScreenClear = FALSE; + newsection.bDisableBlender = FALSE; + newsection.bForceDepthBuffer = FALSE; + newsection.dwFastTextureCRC = 0; + newsection.dwAccurateTextureMapping = 0; + newsection.dwNormalBlender = 0; + newsection.dwNormalCombiner = 0; + newsection.dwFrameBufferOption = 0; + newsection.dwRenderToTextureOption = 0; + newsection.dwScreenUpdateSetting = 0; + + IniSections.push_back(newsection); + + } + else + { + int sectionno = IniSections.size() - 1; + + if (strcasecmp(left(readinfo,4), "Name")==0) + strcpy(IniSections[sectionno].name,right(readinfo,strlen(readinfo)-5)); + + if (strcasecmp(left(readinfo,17), "DisableTextureCRC")==0) + IniSections[sectionno].bDisableTextureCRC=true; + + if (strcasecmp(left(readinfo,14), "DisableCulling")==0) + IniSections[sectionno].bDisableCulling=true; + + if (strcasecmp(left(readinfo,16), "PrimaryDepthHack")==0) + IniSections[sectionno].bPrimaryDepthHack=true; + + if (strcasecmp(left(readinfo,12), "Texture1Hack")==0) + IniSections[sectionno].bTexture1Hack=true; + + if (strcasecmp(left(readinfo,12), "FastLoadTile")==0) + IniSections[sectionno].bFastLoadTile=true; + + if (strcasecmp(left(readinfo,17), "UseSmallerTexture")==0) + IniSections[sectionno].bUseSmallerTexture=true; + + if (strcasecmp(left(readinfo,14), "IncTexRectEdge")==0) + IniSections[sectionno].bIncTexRectEdge=true; + + if (strcasecmp(left(readinfo,5), "ZHack")==0) + IniSections[sectionno].bZHack=true; + + if (strcasecmp(left(readinfo,16), "TexRectScaleHack")==0) + IniSections[sectionno].bTextureScaleHack=true; + + if (strcasecmp(left(readinfo,7), "VIWidth")==0) + IniSections[sectionno].VIWidth = strtol(right(readinfo,3),NULL,10); + + if (strcasecmp(left(readinfo,8), "VIHeight")==0) + IniSections[sectionno].VIHeight = strtol(right(readinfo,3),NULL,10); + + if (strcasecmp(left(readinfo,18), "UseCIWidthAndRatio")==0) + IniSections[sectionno].UseCIWidthAndRatio = strtol(right(readinfo,1),NULL,10); + + if (strcasecmp(left(readinfo,8), "FullTMEM")==0) + IniSections[sectionno].dwFullTMEM = strtol(right(readinfo,1),NULL,10); + + if (strcasecmp(left(readinfo,24), "AlternativeTxtSizeMethod")==0) + IniSections[sectionno].bTxtSizeMethod2 = strtol(right(readinfo,1),NULL,10); + + if (strcasecmp(left(readinfo,12), "EnableTxtLOD")==0) + IniSections[sectionno].bEnableTxtLOD = strtol(right(readinfo,1),NULL,10); + + if (strcasecmp(left(readinfo,12), "DisableObjBG")==0) + IniSections[sectionno].bDisableObjBG = strtol(right(readinfo,1),NULL,10); + + if (strcasecmp(left(readinfo,16), "ForceScreenClear")==0) + IniSections[sectionno].bForceScreenClear = strtol(right(readinfo,1),NULL,10); + + if (strcasecmp(left(readinfo,22), "AccurateTextureMapping")==0) + IniSections[sectionno].dwAccurateTextureMapping = strtol(right(readinfo,1),NULL,10); + + if (strcasecmp(left(readinfo,14), "FastTextureCRC")==0) + IniSections[sectionno].dwFastTextureCRC = strtol(right(readinfo,1),NULL,10); + + if (strcasecmp(left(readinfo,12), "EmulateClear")==0) + IniSections[sectionno].bEmulateClear = strtol(right(readinfo,1),NULL,10); + + if (strcasecmp(left(readinfo,18), "NormalAlphaBlender")==0) + IniSections[sectionno].dwNormalBlender = strtol(right(readinfo,1),NULL,10); + + if (strcasecmp(left(readinfo,19), "DisableAlphaBlender")==0) + IniSections[sectionno].bDisableBlender = strtol(right(readinfo,1),NULL,10); + + if (strcasecmp(left(readinfo,19), "NormalColorCombiner")==0) + IniSections[sectionno].dwNormalCombiner = strtol(right(readinfo,1),NULL,10); + + if (strcasecmp(left(readinfo,16), "ForceDepthBuffer")==0) + IniSections[sectionno].bForceDepthBuffer = strtol(right(readinfo,1),NULL,10); + + if (strcasecmp(left(readinfo,20), "FrameBufferEmulation")==0) + IniSections[sectionno].dwFrameBufferOption = strtol(readinfo+21,NULL,10); + + if (strcasecmp(left(readinfo,15), "RenderToTexture")==0) + IniSections[sectionno].dwRenderToTextureOption = strtol(right(readinfo,1),NULL,10); + + if (strcasecmp(left(readinfo,19), "ScreenUpdateSetting")==0) + IniSections[sectionno].dwScreenUpdateSetting = strtol(right(readinfo,1),NULL,10); + } + } + } + inifile.close(); + + return TRUE; +} + +//read a line from the ini file +std::ifstream & getline(std::ifstream & is, char *str) +{ + char buf[100]; + + is.getline(buf,100); + strcpy( str,buf); + return is; +} + +void WriteIniFile() +{ + uint32 i; + FILE * fhIn; + FILE * fhOut; + + /* get path to game-hack INI file and read it */ + const char *ini_filepath = ConfigGetSharedDataFilepath(szIniFileName); + if (ini_filepath == NULL) + return; + fhIn = fopen(ini_filepath, "r"); + if (fhIn == NULL) + return; + fseek(fhIn, 0L, SEEK_END); + long filelen = ftell(fhIn); + fseek(fhIn, 0L, SEEK_SET); + char *chIniData = (char *) malloc(filelen + 1); + if (chIniData == NULL) + { + fclose(fhIn); + return; + } + long bytesread = fread(chIniData, 1, filelen, fhIn); + fclose(fhIn); + if (bytesread != filelen) + { + free(chIniData); + return; + } + chIniData[filelen] = 0; + + /* now try to open the file for writing */ + fhOut = fopen(ini_filepath, "w"); + if (fhOut == NULL) + { + free(chIniData); + return; + } + + // Mark all sections and needing to be written + for (i = 0; i < IniSections.size(); i++) + { + IniSections[i].bOutput = false; + } + + char *thisline = chIniData; + while ((thisline - chIniData) < filelen) + { + char *nextline = strchr(thisline, '\n'); + if (nextline == NULL) + nextline = thisline + strlen(thisline) + 1; + else + nextline++; + if (thisline[0] == '{') + { + BOOL bFound = FALSE; + // Start of section + tidy((char*) thisline); + thisline[strlen(thisline) - 1] = '\0'; + for (i = 0; i < IniSections.size(); i++) + { + if (IniSections[i].bOutput) + continue; + if (strcasecmp((char*) thisline + 1, IniSections[i].crccheck) == 0) + { + // Output this CRC + OutputSectionDetails(i, fhOut); + IniSections[i].bOutput = true; + bFound = TRUE; + break; + } + } + if (!bFound) + { + // Do what? This should never happen, unless the user + // replaces the inifile while game is running! + } + } + else if (thisline[0] == '/') + { + // Comment + fputs((char*) thisline, fhOut); + } + thisline = nextline; + } + + // Input buffer done- process any new entries! + for (i = 0; i < IniSections.size(); i++) + { + // Skip any that have not been done. + if (IniSections[i].bOutput) + continue; + // Output this CRC + OutputSectionDetails(i, fhOut); + IniSections[i].bOutput = true; + } + + fclose(fhOut); + free(chIniData); + + bIniIsChanged = false; +} + +void OutputSectionDetails(uint32 i, FILE * fh) +{ + fprintf(fh, "{%s}\n", IniSections[i].crccheck); + + fprintf(fh, "Name=%s\n", IniSections[i].name); + //fprintf(fh, "UCode=%d\n", IniSections[i].ucode); + + // Tri-state variables + if (IniSections[i].dwAccurateTextureMapping != 0) + fprintf(fh, "AccurateTextureMapping=%d\n", IniSections[i].dwAccurateTextureMapping); + + if (IniSections[i].dwFastTextureCRC != 0) + fprintf(fh, "FastTextureCRC=%d\n", IniSections[i].dwFastTextureCRC); + + if (IniSections[i].dwNormalBlender != 0) + fprintf(fh, "NormalAlphaBlender=%d\n", IniSections[i].dwNormalBlender); + + if (IniSections[i].dwNormalCombiner != 0) + fprintf(fh, "NormalColorCombiner=%d\n", IniSections[i].dwNormalCombiner); + + + // Normal bi-state variables + if (IniSections[i].bDisableTextureCRC) + fprintf(fh, "DisableTextureCRC\n"); + + if (IniSections[i].bDisableCulling) + fprintf(fh, "DisableCulling\n"); + + if (IniSections[i].bPrimaryDepthHack) + fprintf(fh, "PrimaryDepthHack\n"); + + if (IniSections[i].bTexture1Hack) + fprintf(fh, "Texture1Hack\n"); + + if (IniSections[i].bFastLoadTile) + fprintf(fh, "FastLoadTile\n"); + + if (IniSections[i].bUseSmallerTexture) + fprintf(fh, "UseSmallerTexture\n"); + + if (IniSections[i].bIncTexRectEdge) + fprintf(fh, "IncTexRectEdge\n"); + + if (IniSections[i].bZHack) + fprintf(fh, "ZHack\n"); + + if (IniSections[i].bTextureScaleHack) + fprintf(fh, "TexRectScaleHack\n"); + + if (IniSections[i].VIWidth > 0) + fprintf(fh, "VIWidth=%d\n", IniSections[i].VIWidth); + + if (IniSections[i].VIHeight > 0) + fprintf(fh, "VIHeight=%d\n", IniSections[i].VIHeight); + + if (IniSections[i].UseCIWidthAndRatio > 0) + fprintf(fh, "UseCIWidthAndRatio=%d\n", IniSections[i].UseCIWidthAndRatio); + + if (IniSections[i].dwFullTMEM > 0) + fprintf(fh, "FullTMEM=%d\n", IniSections[i].dwFullTMEM); + + if (IniSections[i].bTxtSizeMethod2 != FALSE ) + fprintf(fh, "AlternativeTxtSizeMethod=%d\n", IniSections[i].bTxtSizeMethod2); + + if (IniSections[i].bEnableTxtLOD != FALSE ) + fprintf(fh, "EnableTxtLOD=%d\n", IniSections[i].bEnableTxtLOD); + + if (IniSections[i].bDisableObjBG != 0 ) + fprintf(fh, "DisableObjBG=%d\n", IniSections[i].bDisableObjBG); + + if (IniSections[i].bForceScreenClear != 0) + fprintf(fh, "ForceScreenClear=%d\n", IniSections[i].bForceScreenClear); + + if (IniSections[i].bEmulateClear != 0) + fprintf(fh, "EmulateClear=%d\n", IniSections[i].bEmulateClear); + + if (IniSections[i].bDisableBlender != 0) + fprintf(fh, "DisableAlphaBlender=%d\n", IniSections[i].bDisableBlender); + + if (IniSections[i].bForceDepthBuffer != 0) + fprintf(fh, "ForceDepthBuffer=%d\n", IniSections[i].bForceDepthBuffer); + + if (IniSections[i].dwFrameBufferOption != 0) + fprintf(fh, "FrameBufferEmulation=%d\n", IniSections[i].dwFrameBufferOption); + + if (IniSections[i].dwRenderToTextureOption != 0) + fprintf(fh, "RenderToTexture=%d\n", IniSections[i].dwRenderToTextureOption); + + if (IniSections[i].dwScreenUpdateSetting != 0) + fprintf(fh, "ScreenUpdateSetting=%d\n", IniSections[i].dwScreenUpdateSetting); + + fprintf(fh, "\n"); // Spacer +} + +// Find the entry corresponding to the specified rom. +// If the rom is not found, a new entry is created +// The resulting value is returned +void __cdecl DebuggerAppendMsg (const char * Message, ...); + +static int FindIniEntry(uint32 dwCRC1, uint32 dwCRC2, uint8 nCountryID, char* szName, int PrintInfo) +{ + uint32 i; + unsigned char szCRC[50+1]; + + // Generate the CRC-ID for this rom: + sprintf((char*)szCRC, "%08x%08x-%02x", (unsigned int)dwCRC1, (unsigned int)dwCRC2, nCountryID); + + for (i = 0; i < IniSections.size(); i++) + { + if (strcasecmp((char*)szCRC, IniSections[i].crccheck) == 0) + { + if (PrintInfo) + DebugMessage(M64MSG_INFO, "Found ROM '%s', CRC %s", IniSections[i].name, szCRC); + return i; + } + } + + // Add new entry!!! + section newsection; + + if (PrintInfo) + DebugMessage(M64MSG_INFO, "ROM (CRC %s) not found in INI file", szCRC); + + strcpy(newsection.crccheck, (char*)szCRC); + + strncpy(newsection.name, szName, 50); + newsection.bDisableTextureCRC = FALSE; + newsection.bDisableCulling = FALSE; + newsection.bIncTexRectEdge = FALSE; + newsection.bZHack = FALSE; + newsection.bTextureScaleHack = FALSE; + newsection.bFastLoadTile = FALSE; + newsection.bUseSmallerTexture = FALSE; + newsection.bPrimaryDepthHack = FALSE; + newsection.bTexture1Hack = FALSE; + newsection.bDisableObjBG = FALSE; + newsection.VIWidth = -1; + newsection.VIHeight = -1; + newsection.UseCIWidthAndRatio = NOT_USE_CI_WIDTH_AND_RATIO; + newsection.dwFullTMEM = 0; + newsection.bTxtSizeMethod2 = FALSE; + newsection.bEnableTxtLOD = FALSE; + + newsection.bEmulateClear = FALSE; + newsection.bForceScreenClear = FALSE; + newsection.bDisableBlender = FALSE; + newsection.bForceDepthBuffer = FALSE; + newsection.dwFastTextureCRC = 0; + newsection.dwAccurateTextureMapping = 0; + newsection.dwNormalBlender = 0; + newsection.dwNormalCombiner = 0; + newsection.dwFrameBufferOption = 0; + newsection.dwRenderToTextureOption = 0; + newsection.dwScreenUpdateSetting = 0; + + IniSections.push_back(newsection); + + bIniIsChanged = true; // Flag to indicate we should be updated + return IniSections.size()-1; // -1 takes into account increment +} + +GameSetting g_curRomInfo; + +void ROM_GetRomNameFromHeader(unsigned char * szName, ROMHeader * pHdr) +{ + unsigned char * p; + + memcpy(szName, pHdr->szName, 20); + szName[20] = '\0'; + + p = szName + (strlen((char*)szName) -1); // -1 to skip null + while (p >= szName && *p == ' ') + { + *p = 0; + p--; + } +} + +uint32 CountryCodeToTVSystem(uint32 countryCode) +{ + uint32 system; + switch(countryCode) + { + /* Demo */ + case 0: + system = TV_SYSTEM_NTSC; + break; + + case '7': + system = TV_SYSTEM_NTSC; + break; + + case 0x41: + system = TV_SYSTEM_NTSC; + break; + + /* Germany */ + case 0x44: + system = TV_SYSTEM_PAL; + break; + + /* USA */ + case 0x45: + system = TV_SYSTEM_NTSC; + break; + + /* France */ + case 0x46: + system = TV_SYSTEM_PAL; + break; + + /* Italy */ + case 'I': + system = TV_SYSTEM_PAL; + break; + + /* Japan */ + case 0x4A: + system = TV_SYSTEM_NTSC; + break; + + /* Europe - PAL */ + case 0x50: + system = TV_SYSTEM_PAL; + break; + + case 'S': /* Spain */ + system = TV_SYSTEM_PAL; + break; + + /* Australia */ + case 0x55: + system = TV_SYSTEM_PAL; + break; + + case 0x58: + system = TV_SYSTEM_PAL; + break; + + /* Australia */ + case 0x59: + system = TV_SYSTEM_PAL; + break; + + case 0x20: + case 0x21: + case 0x38: + case 0x70: + system = TV_SYSTEM_PAL; + break; + + /* ??? */ + default: + system = TV_SYSTEM_PAL; + break; + } + + return system; +} + + diff --git a/libmupen64plus/mupen64plus-video-rice/src/Config.h b/libmupen64plus/mupen64plus-video-rice/src/Config.h new file mode 100644 index 0000000000..c834b972c5 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/Config.h @@ -0,0 +1,409 @@ +/* +Copyright (C) 2002 Rice1964 + +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. + +*/ + +#ifndef _RICE_CONFIG_H_ +#define _RICE_CONFIG_H_ + +#include + +#include "typedefs.h" + +typedef enum +{ + OGL_DEVICE, + OGL_1_1_DEVICE, + OGL_1_2_DEVICE, + OGL_1_3_DEVICE, + OGL_1_4_DEVICE, + OGL_1_4_V2_DEVICE, + OGL_TNT2_DEVICE, + NVIDIA_OGL_DEVICE, + OGL_FRAGMENT_PROGRAM, + + DIRECTX_DEVICE, +} SupportedDeviceType; + +enum DirectXCombinerType +{ + DX_DISABLE_COMBINER, + DX_BEST_FIT, + DX_LOW_END, + DX_HIGH_END, + DX_NVIDIA_TNT, + DX_2_STAGES, + DX_3_STAGES, + DX_4_STAGES, + DX_PIXEL_SHADER, + DX_SEMI_PIXEL_SHADER, +}; + + +typedef struct +{ + const char* name; + SupportedDeviceType type; +} RenderEngineSetting; + +enum { + FRM_BUF_NONE, + FRM_BUF_IGNORE, + FRM_BUF_BASIC, + FRM_BUF_BASIC_AND_WRITEBACK, + FRM_BUF_WRITEBACK_AND_RELOAD, + FRM_BUF_COMPLETE, + FRM_BUF_WITH_EMULATOR, + FRM_BUF_BASIC_AND_WITH_EMULATOR, + FRM_BUF_WITH_EMULATOR_READ_ONLY, + FRM_BUF_WITH_EMULATOR_WRITE_ONLY, +}; + +enum { + FRM_BUF_WRITEBACK_NORMAL, + FRM_BUF_WRITEBACK_1_2, + FRM_BUF_WRITEBACK_1_3, + FRM_BUF_WRITEBACK_1_4, + FRM_BUF_WRITEBACK_1_5, + FRM_BUF_WRITEBACK_1_6, + FRM_BUF_WRITEBACK_1_7, + FRM_BUF_WRITEBACK_1_8, +}; + +enum { + TXT_BUF_NONE, + TXT_BUF_IGNORE, + TXT_BUF_NORMAL, + TXT_BUF_WRITE_BACK, + TXT_BUF_WRITE_BACK_AND_RELOAD, +}; + +enum { + TXT_QUALITY_DEFAULT, + TXT_QUALITY_32BIT, + TXT_QUALITY_16BIT, +}; + +enum { + FORCE_DEFAULT_FILTER, + FORCE_POINT_FILTER, + FORCE_LINEAR_FILTER, +}; + +enum { + TEXTURE_NO_MIPMAP = 0, + TEXTURE_NO_FILTER, + TEXTURE_BILINEAR_FILTER, + TEXTURE_TRILINEAR_FILTER, +}; + +enum { + TEXTURE_NO_ENHANCEMENT, + TEXTURE_2X_ENHANCEMENT, + TEXTURE_2XSAI_ENHANCEMENT, + TEXTURE_HQ2X_ENHANCEMENT, + TEXTURE_LQ2X_ENHANCEMENT, + TEXTURE_HQ4X_ENHANCEMENT, + TEXTURE_SHARPEN_ENHANCEMENT, + TEXTURE_SHARPEN_MORE_ENHANCEMENT, + TEXTURE_EXTERNAL, + TEXTURE_MIRRORED, +}; + +enum { + TEXTURE_ENHANCEMENT_NORMAL, + TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_1, + TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_2, + TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_3, + TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_4, +}; + +enum { + SCREEN_UPDATE_DEFAULT = 0, + SCREEN_UPDATE_AT_VI_UPDATE = 1, + SCREEN_UPDATE_AT_VI_CHANGE = 2, + SCREEN_UPDATE_AT_CI_CHANGE = 3, + SCREEN_UPDATE_AT_1ST_CI_CHANGE = 4, + SCREEN_UPDATE_AT_1ST_PRIMITIVE = 5, + SCREEN_UPDATE_BEFORE_SCREEN_CLEAR = 6, + SCREEN_UPDATE_AT_VI_UPDATE_AND_DRAWN = 7, // Update screen at VI origin is updated and the screen has been drawn +}; + +enum { + ONSCREEN_DISPLAY_NOTHING = 0, + ONSCREEN_DISPLAY_DLIST_PER_SECOND, + ONSCREEN_DISPLAY_FRAME_PER_SECOND, + ONSCREEN_DISPLAY_DEBUG_INFORMATION_ONLY, + ONSCREEN_DISPLAY_TEXT_FROM_CORE_ONLY, + ONSCREEN_DISPLAY_DLIST_PER_SECOND_WITH_CORE_MSG, + ONSCREEN_DISPLAY_FRAME_PER_SECOND_WITH_CORE_MSG, + ONSCREEN_DISPLAY_DEBUG_INFORMATION_WITH_CORE_MSG, +}; + +enum HACK_FOR_GAMES +{ + NO_HACK_FOR_GAME, + HACK_FOR_BANJO_TOOIE, + HACK_FOR_DR_MARIO, + HACK_FOR_ZELDA, + HACK_FOR_MARIO_TENNIS, + HACK_FOR_BANJO, + HACK_FOR_PD, + HACK_FOR_GE, + HACK_FOR_PILOT_WINGS, + HACK_FOR_YOSHI, + HACK_FOR_NITRO, + HACK_FOR_TONYHAWK, + HACK_FOR_NASCAR, + HACK_FOR_SUPER_BOWLING, + HACK_FOR_CONKER, + HACK_FOR_ALL_STAR_BASEBALL, + HACK_FOR_TIGER_HONEY_HUNT, + HACK_REVERSE_XY_COOR, + HACK_REVERSE_Y_COOR, + HACK_FOR_GOLDEN_EYE, + HACK_FOR_FZERO, + HACK_FOR_COMMANDCONQUER, + HACK_FOR_RUMBLE, + HACK_FOR_SOUTH_PARK_RALLY, + HACK_FOR_BUST_A_MOVE, + HACK_FOR_OGRE_BATTLE, + HACK_FOR_TWINE, + HACK_FOR_EXTREME_G2, + HACK_FOR_ROGUE_SQUADRON, + HACK_FOR_MARIO_GOLF, + HACK_FOR_MLB, + HACK_FOR_POLARISSNOCROSS, + HACK_FOR_TOPGEARRALLY, + HACK_FOR_DUKE_NUKEM, + HACK_FOR_ZELDA_MM, + HACK_FOR_MARIO_KART, +}; + +enum { + NOT_USE_CI_WIDTH_AND_RATIO, + USE_CI_WIDTH_AND_RATIO_FOR_NTSC, + USE_CI_WIDTH_AND_RATIO_FOR_PAL, +}; + +typedef struct { + BOOL bEnableHacks; + BOOL bWinFrameMode; + BOOL bOGLVertexClipper; + BOOL bEnableSSE; + BOOL bEnableVertexShader; + BOOL bSkipFrame; + BOOL bFullTMEM; + BOOL bUseFullTMEM; + + BOOL bShowFPS; + + uint32 mipmapping; + uint32 fogMethod; + uint32 forceTextureFilter; + uint32 textureEnhancement; + uint32 textureEnhancementControl; + uint32 textureQuality; + uint32 anisotropicFiltering; + uint32 multiSampling; + BOOL bTexRectOnly; + BOOL bSmallTextureOnly; + BOOL bDumpTexturesToFiles; + BOOL bLoadHiResTextures; + BOOL bLoadHiResCRCOnly; + + int OpenglDepthBufferSetting; + int OpenglRenderSetting; + uint32 colorQuality; + + HACK_FOR_GAMES enableHackForGames; +} GlobalOptions; + +typedef struct { + bool bUpdateCIInfo; + + bool bCheckBackBufs; // Check texture again against the recent backbuffer addresses + bool bWriteBackBufToRDRAM; // If a recent backbuffer is used, write its content back to RDRAM + bool bLoadBackBufFromRDRAM; // Load content from RDRAM and draw into backbuffer + bool bIgnore; // Ignore all rendering into texture buffers + + bool bSupportRenderTextures; // Support render-to-texture + bool bCheckRenderTextures; // Check texture again against the the last render_texture addresses + bool bRenderTextureWriteBack; // Write back render_texture into RDRAM + bool bLoadRDRAMIntoRenderTexture; // Load RDRAM content and render into render_texture + + bool bAtEachFrameUpdate; // Reload and write back at each frame buffer and CI update + + bool bProcessCPUWrite; + bool bProcessCPURead; + + bool bFillRectNextTextureBuffer; + bool bIgnoreRenderTextureIfHeightUnknown; + //bool bFillColor; +} FrameBufferOptions; + +typedef struct { + uint32 N64FrameBufferEmuType; + uint32 N64FrameBufferWriteBackControl; + uint32 N64RenderToTextureEmuType; + uint32 screenUpdateSetting; + BOOL bNormalCombiner; + BOOL bNormalBlender; + BOOL bFastTexCRC; + BOOL bAccurateTextureMapping; + BOOL bInN64Resolution; + BOOL bDoubleSizeForSmallTxtrBuf; + BOOL bSaveVRAM; +} RomOptions; + +typedef struct IniSection +{ + bool bOutput; + char crccheck[50]; + char name[50]; + + // Options with changeable default values + uint32 dwNormalCombiner; + uint32 dwNormalBlender; + uint32 dwFastTextureCRC; + uint32 dwAccurateTextureMapping; + uint32 dwFrameBufferOption; + uint32 dwRenderToTextureOption; + uint32 dwScreenUpdateSetting; + + // Options with FALSE as default values + BOOL bDisableBlender; + BOOL bForceScreenClear; + BOOL bEmulateClear; + BOOL bForceDepthBuffer; + + // Less useful options + BOOL bDisableObjBG; + BOOL bDisableTextureCRC; + BOOL bIncTexRectEdge; + BOOL bZHack; + BOOL bTextureScaleHack; + BOOL bFastLoadTile; + BOOL bUseSmallerTexture; + BOOL bPrimaryDepthHack; + BOOL bTexture1Hack; + BOOL bDisableCulling; + + int VIWidth; + int VIHeight; + uint32 UseCIWidthAndRatio; + + uint32 dwFullTMEM; + BOOL bTxtSizeMethod2; + BOOL bEnableTxtLOD; +} section; + +struct ROMHeader +{ + uint8 x1, x2, x3, x4; + uint32 dwClockRate; + uint32 dwBootAddressOffset; + uint32 dwRelease; + uint32 dwCRC1; + uint32 dwCRC2; + uint64 qwUnknown1; + char szName[20]; + uint32 dwUnknown2; + uint16 wUnknown3; + uint8 nUnknown4; + uint8 nManufacturer; + uint16 wCartID; + s8 nCountryID; + uint8 nUnknown5; +}; + +typedef struct +{ + // Other info from the rom. This is for convenience + unsigned char szGameName[50+1]; + s8 nCountryID; + + // Copy of the ROM header + ROMHeader romheader; + + // With changeable default values + uint32 dwNormalCombiner; + uint32 dwNormalBlender; + uint32 dwAccurateTextureMapping; + uint32 dwFastTextureCRC; + uint32 dwFrameBufferOption; + uint32 dwRenderToTextureOption; + uint32 dwScreenUpdateSetting; + + // With FALSE as its default values + BOOL bForceScreenClear; + BOOL bEmulateClear; + BOOL bForceDepthBuffer; + BOOL bDisableBlender; + + // Less useful options + BOOL bDisableObjBG; + BOOL bDisableTextureCRC; + BOOL bIncTexRectEdge; + BOOL bZHack; + BOOL bTextureScaleHack; + BOOL bFastLoadTile; + BOOL bUseSmallerTexture; + BOOL bPrimaryDepthHack; + BOOL bTexture1Hack; + BOOL bDisableCulling; + int VIWidth; + int VIHeight; + uint32 UseCIWidthAndRatio; + + uint32 dwFullTMEM; + BOOL bTxtSizeMethod2; + BOOL bEnableTxtLOD; +} GameSetting, *LPGAMESETTING; + +typedef struct +{ + s8 nCountryID; + char* szName; + uint32 nTvType; +} CountryIDInfo; + +#define TV_SYSTEM_NTSC 1 +#define TV_SYSTEM_PAL 0 + +extern GlobalOptions options; +extern FrameBufferOptions frameBufferOptions; +extern RomOptions defaultRomOptions; +extern RomOptions currentRomOptions; +extern const CountryIDInfo g_CountryCodeInfo[]; +extern GameSetting g_curRomInfo; +extern bool bIniIsChanged; +extern char szIniFileName[300]; + +extern BOOL InitConfiguration(void); +extern BOOL LoadConfiguration(void); +extern void WriteIniFile(); +extern BOOL ReadIniFile(); +extern void OutputSectionDetails(uint32 i, FILE * fh); +extern void GenerateCurrentRomOptions(); +extern void Ini_GetRomOptions(LPGAMESETTING pGameSetting); +extern void Ini_StoreRomOptions(LPGAMESETTING pGameSetting); +extern uint32 CountryCodeToTVSystem(uint32 countryCode); +extern void ROM_GetRomNameFromHeader(unsigned char * szName, ROMHeader * pHdr); + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/ConvertImage.cpp b/libmupen64plus/mupen64plus-video-rice/src/ConvertImage.cpp new file mode 100644 index 0000000000..f295936446 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/ConvertImage.cpp @@ -0,0 +1,1470 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + +#include "Config.h" +#include "ConvertImage.h" +#include "RenderBase.h" + +ConvertFunction gConvertFunctions_FullTMEM[ 8 ][ 4 ] = +{ + // 4bpp 8bpp 16bpp 32bpp + { Convert4b, Convert8b, Convert16b, ConvertRGBA32 }, // RGBA + { NULL, NULL, ConvertYUV, NULL }, // YUV + { Convert4b, Convert8b, NULL, NULL }, // CI + { Convert4b, Convert8b, Convert16b, NULL }, // IA + { Convert4b, Convert8b, Convert16b, NULL }, // I + { NULL, NULL, NULL, NULL }, // ? + { NULL, NULL, NULL, NULL }, // ? + { NULL, NULL, NULL, NULL } // ? +}; +ConvertFunction gConvertFunctions[ 8 ][ 4 ] = +{ + // 4bpp 8bpp 16bpp 32bpp + { ConvertCI4, ConvertCI8, ConvertRGBA16, ConvertRGBA32 }, // RGBA + { NULL, NULL, ConvertYUV, NULL }, // YUV + { ConvertCI4, ConvertCI8, NULL, NULL }, // CI + { ConvertIA4, ConvertIA8, ConvertIA16, NULL }, // IA + { ConvertI4, ConvertI8, ConvertIA16, NULL }, // I + { NULL, NULL, NULL, NULL }, // ? + { NULL, NULL, NULL, NULL }, // ? + { NULL, NULL, NULL, NULL } // ? +}; + +ConvertFunction gConvertTlutFunctions[ 8 ][ 4 ] = +{ + // 4bpp 8bpp 16bpp 32bpp + { ConvertCI4, ConvertCI8, ConvertRGBA16, ConvertRGBA32 }, // RGBA + { NULL, NULL, ConvertYUV, NULL }, // YUV + { ConvertCI4, ConvertCI8, NULL, NULL }, // CI + { ConvertCI4, ConvertCI8, ConvertIA16, NULL }, // IA + { ConvertCI4, ConvertCI8, ConvertIA16, NULL }, // I + { NULL, NULL, NULL, NULL }, // ? + { NULL, NULL, NULL, NULL }, // ? + { NULL, NULL, NULL, NULL } // ? +}; + +extern bool conkerSwapHack; + +void ConvertRGBA16(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + + // Copy of the base pointer + uint16 * pSrc = (uint16*)(tinfo.pPhysicalAddress); + + uint8 * pByteSrc = (uint8 *)pSrc; + if (!pTexture->StartUpdate(&dInfo)) + return; + + uint32 nFiddle; + + if (tinfo.bSwapped) + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + if ((y&1) == 0) + nFiddle = 0x2; + else + nFiddle = 0x2 | 0x4; + + // dwDst points to start of destination row + uint32 * dwDst = (uint32 *)((uint8 *)dInfo.lpSurface + y*dInfo.lPitch); + + // DWordOffset points to the current dword we're looking at + // (process 2 pixels at a time). May be a problem if we don't start on even pixel + uint32 dwWordOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad * 2); + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + uint16 w = *(uint16 *)&pByteSrc[dwWordOffset ^ nFiddle]; + + dwDst[x] = Convert555ToRGBA(w); + + // Increment word offset to point to the next two pixels + dwWordOffset += 2; + } + } + } + else + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + // dwDst points to start of destination row + uint32 * dwDst = (uint32 *)((uint8 *)dInfo.lpSurface + y*dInfo.lPitch); + + // DWordOffset points to the current dword we're looking at + // (process 2 pixels at a time). May be a problem if we don't start on even pixel + uint32 dwWordOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad * 2); + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + uint16 w = *(uint16 *)&pByteSrc[dwWordOffset ^ 0x2]; + + dwDst[x] = Convert555ToRGBA(w); + + // Increment word offset to point to the next two pixels + dwWordOffset += 2; + } + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); +} + +void ConvertRGBA32(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + if (!pTexture->StartUpdate(&dInfo)) + return; + + uint32 * pSrc = (uint32*)(tinfo.pPhysicalAddress); + + if( options.bUseFullTMEM ) + { + Tile &tile = gRDP.tiles[tinfo.tileNo]; + + uint32 *pWordSrc; + if( tinfo.tileNo >= 0 ) + { + pWordSrc = (uint32*)&g_Tmem.g_Tmem64bit[tile.dwTMem]; + + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint32 * dwDst = (uint32 *)((uint8 *)dInfo.lpSurface + y*dInfo.lPitch); + + uint32 nFiddle = ( y&1 )? 0x2 : 0; + int idx = tile.dwLine*4*y; + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++, idx++) + { + uint32 w = pWordSrc[idx^nFiddle]; + uint8* psw = (uint8*)&w; + uint8* pdw = (uint8*)&dwDst[x]; + pdw[0] = psw[2]; // Blue + pdw[1] = psw[1]; // Green + pdw[2] = psw[0]; // Red + pdw[3] = psw[3]; // Alpha + } + } + } + } + else + { + if (tinfo.bSwapped) + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + if ((y%2) == 0) + { + uint8 *pDst = (uint8 *)dInfo.lpSurface + y * dInfo.lPitch; + uint8 *pS = (uint8 *)pSrc + (y+tinfo.TopToLoad) * tinfo.Pitch + (tinfo.LeftToLoad*4); + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + pDst[0] = pS[1]; // Blue + pDst[1] = pS[2]; // Green + pDst[2] = pS[3]; // Red + pDst[3] = pS[0]; // Alpha + pS+=4; + pDst+=4; + } + } + else + { + uint32 *pDst = (uint32 *)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + uint8 *pS = (uint8 *)pSrc; + int n; + + n = (y+tinfo.TopToLoad) * tinfo.Pitch + (tinfo.LeftToLoad*4); + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + *pDst++ = COLOR_RGBA(pS[(n+3)^0x8], + pS[(n+2)^0x8], + pS[(n+1)^0x8], + pS[(n+0)^0x8]); + + n += 4; + } + } + } + } + else + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint8 *pDst = (uint8 *)dInfo.lpSurface + y * dInfo.lPitch; + uint8 *pS = (uint8 *)pSrc + (y+tinfo.TopToLoad) * tinfo.Pitch + (tinfo.LeftToLoad*4); + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + pDst[0] = pS[1]; // Blue + pDst[1] = pS[2]; // Green + pDst[2] = pS[3]; // Red + pDst[3] = pS[0]; // Alpha + pS+=4; + pDst+=4; + } + } + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); +} + +// E.g. Dear Mario text +// Copy, Score etc +void ConvertIA4(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + uint32 nFiddle; + + uint8 * pSrc = (uint8*)(tinfo.pPhysicalAddress); + +#ifdef DEBUGGER + if (((long long)pSrc) % 4) TRACE0("Texture src addr is not aligned to 4 bytes, check me"); +#endif + + if (!pTexture->StartUpdate(&dInfo)) + return; + + if (tinfo.bSwapped) + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint8 *pDst = (uint8 *)dInfo.lpSurface + y * dInfo.lPitch; + + // For odd lines, swap words too + if ((y%2) == 0) + nFiddle = 0x3; + else + nFiddle = 0x7; + + + // This may not work if X is not even? + uint32 dwByteOffset = (y+tinfo.TopToLoad) * tinfo.Pitch + (tinfo.LeftToLoad/2); + + if (tinfo.WidthToLoad == 1) + { + // corner case + uint8 b = pSrc[dwByteOffset ^ nFiddle]; + *pDst++ = ThreeToEight[(b & 0xE0) >> 5]; + *pDst++ = ThreeToEight[(b & 0xE0) >> 5]; + *pDst++ = ThreeToEight[(b & 0xE0) >> 5]; + *pDst++ = OneToEight[(b & 0x10) >> 4]; + } + else for (uint32 x = 0; x < tinfo.WidthToLoad; x+=2) + { + // Do two pixels at a time + uint8 b = pSrc[dwByteOffset ^ nFiddle]; + + // Even + *pDst++ = ThreeToEight[(b & 0xE0) >> 5]; + *pDst++ = ThreeToEight[(b & 0xE0) >> 5]; + *pDst++ = ThreeToEight[(b & 0xE0) >> 5]; + *pDst++ = OneToEight[(b & 0x10) >> 4]; + // Odd + *pDst++ = ThreeToEight[(b & 0x0E) >> 1]; + *pDst++ = ThreeToEight[(b & 0x0E) >> 1]; + *pDst++ = ThreeToEight[(b & 0x0E) >> 1]; + *pDst++ = OneToEight[(b & 0x01) ]; + + dwByteOffset++; + } + } + } + else + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint8 *pDst = (uint8 *)dInfo.lpSurface + (y * dInfo.lPitch); + + // This may not work if X is not even? + uint32 dwByteOffset = (y+tinfo.TopToLoad) * tinfo.Pitch + (tinfo.LeftToLoad/2); + + if (tinfo.WidthToLoad == 1) + { + // corner case + uint8 b = pSrc[dwByteOffset ^ 0x3]; + *pDst++ = ThreeToEight[(b & 0xE0) >> 5]; + *pDst++ = ThreeToEight[(b & 0xE0) >> 5]; + *pDst++ = ThreeToEight[(b & 0xE0) >> 5]; + *pDst++ = OneToEight[(b & 0x10) >> 4]; + } + else for (uint32 x = 0; x < tinfo.WidthToLoad; x+=2) + { + // Do two pixels at a time + uint8 b = pSrc[dwByteOffset ^ 0x3]; + + // Even + *pDst++ = ThreeToEight[(b & 0xE0) >> 5]; + *pDst++ = ThreeToEight[(b & 0xE0) >> 5]; + *pDst++ = ThreeToEight[(b & 0xE0) >> 5]; + *pDst++ = OneToEight[(b & 0x10) >> 4]; + // Odd + *pDst++ = ThreeToEight[(b & 0x0E) >> 1]; + *pDst++ = ThreeToEight[(b & 0x0E) >> 1]; + *pDst++ = ThreeToEight[(b & 0x0E) >> 1]; + *pDst++ = OneToEight[(b & 0x01) ]; + + dwByteOffset++; + } + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); + +} + +// E.g Mario's head textures +void ConvertIA8(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + uint32 nFiddle; + + uint8 * pSrc = (uint8*)(tinfo.pPhysicalAddress); + +#ifdef DEBUGGER + if (((long long)pSrc) % 4) TRACE0("Texture src addr is not aligned to 4 bytes, check me"); +#endif + + if (!pTexture->StartUpdate(&dInfo)) + return; + + if (tinfo.bSwapped) + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + // For odd lines, swap words too + if ((y%2) == 0) + nFiddle = 0x3; + else + nFiddle = 0x7; + + uint8 *pDst = (uint8 *)dInfo.lpSurface + y * dInfo.lPitch; + // Points to current byte + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + tinfo.LeftToLoad; + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + uint8 b = pSrc[dwByteOffset ^ nFiddle]; + uint8 I = FourToEight[(b & 0xf0)>>4]; + + *pDst++ = I; + *pDst++ = I; + *pDst++ = I; + *pDst++ = FourToEight[(b & 0x0f) ]; + + dwByteOffset++; + } + } + } + else + { + register const uint8* FourToEightArray = &FourToEight[0]; + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint8 *pDst = (uint8 *)dInfo.lpSurface + y * dInfo.lPitch; + + // Points to current byte + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + tinfo.LeftToLoad; + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + register uint8 b = pSrc[(dwByteOffset++) ^ 0x3]; + uint8 I = *(FourToEightArray+(b>>4)); + + *pDst++ = I; + *pDst++ = I; + *pDst++ = I; + *pDst++ = *(FourToEightArray+(b&0xF)); + } + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); + +} + +// E.g. camera's clouds, shadows +void ConvertIA16(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + uint32 nFiddle; + + uint16 * pSrc = (uint16*)(tinfo.pPhysicalAddress); + uint8 * pByteSrc = (uint8 *)pSrc; + + if (!pTexture->StartUpdate(&dInfo)) + return; + + if (tinfo.bSwapped) + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint8 *pDst = (uint8 *)dInfo.lpSurface + y * dInfo.lPitch; + + if ((y%2) == 0) + nFiddle = 0x2; + else + nFiddle = 0x4 | 0x2; + + // Points to current word + uint32 dwWordOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad * 2); + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + uint16 w = *(uint16 *)&pByteSrc[dwWordOffset^nFiddle]; + + *pDst++ = (uint8)(w >> 8); + *pDst++ = (uint8)(w >> 8); + *pDst++ = (uint8)(w >> 8); + *pDst++ = (uint8)(w & 0xFF); + + dwWordOffset += 2; + } + } + } + else + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint8 *pDst = (uint8 *)dInfo.lpSurface + y * dInfo.lPitch; + + // Points to current word + uint32 dwWordOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad * 2); + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + uint16 w = *(uint16 *)&pByteSrc[dwWordOffset^0x2]; + + *pDst++ = (uint8)(w >> 8); + *pDst++ = (uint8)(w >> 8); + *pDst++ = (uint8)(w >> 8); + *pDst++ = (uint8)(w & 0xFF); + + dwWordOffset += 2; + } + } + } + + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); +} + + + +// Used by MarioKart +void ConvertI4(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + uint32 nFiddle; + + uint8 * pSrc = (uint8*)(tinfo.pPhysicalAddress); + +#ifdef DEBUGGER + if (((long long) pSrc) % 4) TRACE0("Texture src addr is not aligned to 4 bytes, check me"); +#endif + + if (!pTexture->StartUpdate(&dInfo)) + return; + + if (tinfo.bSwapped) + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint8 *pDst = (uint8 *)dInfo.lpSurface + y * dInfo.lPitch; + + // Might not work with non-even starting X + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad / 2); + + // For odd lines, swap words too + if( !conkerSwapHack || (y&4) == 0 ) + { + if ((y%2) == 0) + nFiddle = 0x3; + else + nFiddle = 0x7; + } + else + { + if ((y%2) == 1) + nFiddle = 0x3; + else + nFiddle = 0x7; + } + + if (tinfo.WidthToLoad == 1) + { + // corner case + uint8 b = pSrc[dwByteOffset ^ nFiddle]; + *pDst++ = FourToEight[(b & 0xF0)>>4]; + *pDst++ = FourToEight[(b & 0xF0)>>4]; + *pDst++ = FourToEight[(b & 0xF0)>>4]; + *pDst++ = FourToEight[(b & 0xF0)>>4]; + } + else for (uint32 x = 0; x < tinfo.WidthToLoad; x+=2) + { + // two pixels at a time + uint8 b = pSrc[dwByteOffset ^ nFiddle]; + + // Even + *pDst++ = FourToEight[(b & 0xF0)>>4]; // Other implementations seem to or in (b&0xF0)>>4 + *pDst++ = FourToEight[(b & 0xF0)>>4]; // why? + *pDst++ = FourToEight[(b & 0xF0)>>4]; + *pDst++ = FourToEight[(b & 0xF0)>>4]; + // Odd + *pDst++ = FourToEight[(b & 0x0F)]; + *pDst++ = FourToEight[(b & 0x0F)]; + *pDst++ = FourToEight[(b & 0x0F)]; + *pDst++ = FourToEight[(b & 0x0F)]; + + dwByteOffset++; + } + } + + conkerSwapHack = false; + } + else + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint8 *pDst = (uint8 *)dInfo.lpSurface + y * dInfo.lPitch; + + // Might not work with non-even starting X + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad / 2); + + if (tinfo.WidthToLoad == 1) + { + // corner case + uint8 b = pSrc[dwByteOffset ^ 0x3]; + *pDst++ = FourToEight[(b & 0xF0)>>4]; + *pDst++ = FourToEight[(b & 0xF0)>>4]; + *pDst++ = FourToEight[(b & 0xF0)>>4]; + *pDst++ = FourToEight[(b & 0xF0)>>4]; + } + else for (uint32 x = 0; x < tinfo.WidthToLoad; x+=2) + { + // two pixels at a time + uint8 b = pSrc[dwByteOffset ^ 0x3]; + + // Even + *pDst++ = FourToEight[(b & 0xF0)>>4]; // Other implementations seem to or in (b&0xF0)>>4 + *pDst++ = FourToEight[(b & 0xF0)>>4]; // why? + *pDst++ = FourToEight[(b & 0xF0)>>4]; + *pDst++ = FourToEight[(b & 0xF0)>>4]; + // Odd + *pDst++ = FourToEight[(b & 0x0F)]; + *pDst++ = FourToEight[(b & 0x0F)]; + *pDst++ = FourToEight[(b & 0x0F)]; + *pDst++ = FourToEight[(b & 0x0F)]; + + dwByteOffset++; + } + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); +} + +// Used by MarioKart +void ConvertI8(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + uint32 nFiddle; + + long long pSrc = (long long) tinfo.pPhysicalAddress; + if (!pTexture->StartUpdate(&dInfo)) + return; + + if (tinfo.bSwapped) + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + if ((y%2) == 0) + nFiddle = 0x3; + else + nFiddle = 0x7; + + uint8 *pDst = (uint8 *)dInfo.lpSurface + y * dInfo.lPitch; + + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + tinfo.LeftToLoad; + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + uint8 b = *(uint8*)((pSrc+dwByteOffset)^nFiddle); + + *pDst++ = b; + *pDst++ = b; + *pDst++ = b; + *pDst++ = b; // Alpha not 255? + + dwByteOffset++; + } + } + } + else + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint8 *pDst = (uint8 *)dInfo.lpSurface + y * dInfo.lPitch; + + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + tinfo.LeftToLoad; + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + uint8 b = *(uint8*)((pSrc+dwByteOffset)^0x3); + + *pDst++ = b; + *pDst++ = b; + *pDst++ = b; + *pDst++ = b; // Alpha not 255? + + dwByteOffset++; + } + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); + +} + +//***************************************************************************** +// Convert CI4 images. We need to switch on the palette type +//***************************************************************************** +void ConvertCI4( CTexture * p_texture, const TxtrInfo & tinfo ) +{ + if ( tinfo.TLutFmt == TLUT_FMT_RGBA16 ) + { + ConvertCI4_RGBA16( p_texture, tinfo ); + } + else if ( tinfo.TLutFmt == TLUT_FMT_IA16 ) + { + ConvertCI4_IA16( p_texture, tinfo ); + } +} + +//***************************************************************************** +// Convert CI8 images. We need to switch on the palette type +//***************************************************************************** +void ConvertCI8( CTexture * p_texture, const TxtrInfo & tinfo ) +{ + if ( tinfo.TLutFmt == TLUT_FMT_RGBA16 ) + { + ConvertCI8_RGBA16( p_texture, tinfo ); + } + else if ( tinfo.TLutFmt == TLUT_FMT_IA16 ) + { + ConvertCI8_IA16( p_texture, tinfo ); + } +} + +// Used by Starfox intro +void ConvertCI4_RGBA16(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + uint32 nFiddle; + + uint8 * pSrc = (uint8*)(tinfo.pPhysicalAddress); + uint16 * pPal = (uint16 *)tinfo.PalAddress; + bool bIgnoreAlpha = (tinfo.TLutFmt==TLUT_FMT_NONE); + + if (!pTexture->StartUpdate(&dInfo)) + return; + + if (tinfo.bSwapped) + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + if ((y%2) == 0) + nFiddle = 0x3; + else + nFiddle = 0x7; + + uint32 * pDst = (uint32 *)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch); + + if (tinfo.WidthToLoad == 1) + { + // corner case + uint8 b = pSrc[dwByteOffset ^ nFiddle]; + uint8 bhi = (b&0xf0)>>4; + *pDst = Convert555ToRGBA(pPal[bhi^1]); // Remember palette is in different endian order! + if( bIgnoreAlpha ) + { + *pDst |= 0xFF000000; + } + } + else for (uint32 x = 0; x < tinfo.WidthToLoad; x+=2) + { + // two at a time + uint8 b = pSrc[dwByteOffset ^ nFiddle]; + + uint8 bhi = (b&0xf0)>>4; + uint8 blo = (b&0x0f); + + pDst[0] = Convert555ToRGBA(pPal[bhi^1]); // Remember palette is in different endian order! + pDst[1] = Convert555ToRGBA(pPal[blo^1]); // Remember palette is in different endian order! + + if( bIgnoreAlpha ) + { + pDst[0] |= 0xFF000000; + pDst[1] |= 0xFF000000; + } + + pDst+=2; + + dwByteOffset++; + } + } + } + else + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint32 * pDst = (uint32 *)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad / 2); + + if (tinfo.WidthToLoad == 1) + { + // corner case + uint8 b = pSrc[dwByteOffset ^ 0x3]; + uint8 bhi = (b&0xf0)>>4; + *pDst = Convert555ToRGBA(pPal[bhi^1]); // Remember palette is in different endian order! + if( bIgnoreAlpha ) + { + *pDst |= 0xFF000000; + } + } + else for (uint32 x = 0; x < tinfo.WidthToLoad; x+=2) + { + // two at a time + uint8 b = pSrc[dwByteOffset ^ 0x3]; + + uint8 bhi = (b&0xf0)>>4; + uint8 blo = (b&0x0f); + + pDst[0] = Convert555ToRGBA(pPal[bhi^1]); // Remember palette is in different endian order! + pDst[1] = Convert555ToRGBA(pPal[blo^1]); // Remember palette is in different endian order! + + if( bIgnoreAlpha ) + { + pDst[0] |= 0xFF000000; + pDst[1] |= 0xFF000000; + } + + pDst+=2; + + dwByteOffset++; + } + } + } + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); +} + +// Used by Starfox intro +void ConvertCI4_IA16(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + uint32 nFiddle; + + uint8 * pSrc = (uint8*)(tinfo.pPhysicalAddress); + +#ifdef DEBUGGER + if (((long long) pSrc) % 4) TRACE0("Texture src addr is not aligned to 4 bytes, check me"); +#endif + + uint16 * pPal = (uint16 *)tinfo.PalAddress; + bool bIgnoreAlpha = (tinfo.TLutFmt==TLUT_FMT_UNKNOWN); + + if (!pTexture->StartUpdate(&dInfo)) + return; + + if (tinfo.bSwapped) + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + if ((y%2) == 0) + nFiddle = 0x3; + else + nFiddle = 0x7; + + uint32 * pDst = (uint32 *)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad / 2); + + if (tinfo.WidthToLoad == 1) + { + // corner case + uint8 b = pSrc[dwByteOffset ^ nFiddle]; + uint8 bhi = (b&0xf0)>>4; + *pDst = ConvertIA16ToRGBA(pPal[bhi^1]); // Remember palette is in different endian order! + if( bIgnoreAlpha ) + *pDst |= 0xFF000000; + } + else for (uint32 x = 0; x < tinfo.WidthToLoad; x+=2) + { + // two at a time + uint8 b = pSrc[dwByteOffset ^ nFiddle]; + + uint8 bhi = (b&0xf0)>>4; + uint8 blo = (b&0x0f); + + pDst[0] = ConvertIA16ToRGBA(pPal[bhi^1]); // Remember palette is in different endian order! + pDst[1] = ConvertIA16ToRGBA(pPal[blo^1]); // Remember palette is in different endian order! + + if( bIgnoreAlpha ) + { + pDst[0] |= 0xFF000000; + pDst[1] |= 0xFF000000; + } + + pDst+=2; + + dwByteOffset++; + } + } + } + else + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint32 * pDst = (uint32 *)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad / 2); + + if (tinfo.WidthToLoad == 1) + { + // corner case + uint8 b = pSrc[dwByteOffset ^ 0x3]; + uint8 bhi = (b&0xf0)>>4; + *pDst = ConvertIA16ToRGBA(pPal[bhi^1]); // Remember palette is in different endian order! + if( bIgnoreAlpha ) + *pDst |= 0xFF000000; + } + else for (uint32 x = 0; x < tinfo.WidthToLoad; x+=2) + { + // two pixels at a time + uint8 b = pSrc[dwByteOffset ^ 0x3]; + + uint8 bhi = (b&0xf0)>>4; + uint8 blo = (b&0x0f); + + pDst[0] = ConvertIA16ToRGBA(pPal[bhi^1]); // Remember palette is in different endian order! + pDst[1] = ConvertIA16ToRGBA(pPal[blo^1]); // Remember palette is in different endian order! + + if( bIgnoreAlpha ) + { + pDst[0] |= 0xFF000000; + pDst[1] |= 0xFF000000; + } + + pDst+=2; + + dwByteOffset++; + } + } + } + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); +} + + +// Used by MarioKart for Cars etc +void ConvertCI8_RGBA16(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + uint32 nFiddle; + + uint8 * pSrc = (uint8*)(tinfo.pPhysicalAddress); + +#ifdef DEBUGGER + if (((long long) pSrc) % 4) TRACE0("Texture src addr is not aligned to 4 bytes, check me"); +#endif + + uint16 * pPal = (uint16 *)tinfo.PalAddress; + bool bIgnoreAlpha = (tinfo.TLutFmt==TLUT_FMT_NONE); + + if (!pTexture->StartUpdate(&dInfo)) + return; + + if (tinfo.bSwapped) + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + if ((y%2) == 0) + nFiddle = 0x3; + else + nFiddle = 0x7; + + uint32 *pDst = (uint32 *)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + tinfo.LeftToLoad; + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + uint8 b = pSrc[dwByteOffset ^ nFiddle]; + + *pDst++ = Convert555ToRGBA(pPal[b^1]); // Remember palette is in different endian order! + + if( bIgnoreAlpha ) + { + *(pDst-1) |= 0xFF000000; + } + + dwByteOffset++; + } + } + } + else + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint32 *pDst = (uint32 *)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + int dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + tinfo.LeftToLoad; + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + uint8 b = pSrc[dwByteOffset ^ 0x3]; + + *pDst++ = Convert555ToRGBA(pPal[b^1]); // Remember palette is in different endian order! + if( bIgnoreAlpha ) + { + *(pDst-1) |= 0xFF000000; + } + + dwByteOffset++; + } + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); + +} + + +// Used by MarioKart for Cars etc +void ConvertCI8_IA16(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + uint32 nFiddle; + + uint8 * pSrc = (uint8*)(tinfo.pPhysicalAddress); + +#ifdef DEBUGGER + if (((long long) pSrc) % 4) TRACE0("Texture src addr is not aligned to 4 bytes, check me"); +#endif + + uint16 * pPal = (uint16 *)tinfo.PalAddress; + bool bIgnoreAlpha = (tinfo.TLutFmt==TLUT_FMT_UNKNOWN); + + if (!pTexture->StartUpdate(&dInfo)) + return; + + if (tinfo.bSwapped) + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + if ((y%2) == 0) + nFiddle = 0x3; + else + nFiddle = 0x7; + + uint32 *pDst = (uint32 *)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + tinfo.LeftToLoad; + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + uint8 b = pSrc[dwByteOffset ^ nFiddle]; + + *pDst++ = ConvertIA16ToRGBA(pPal[b^1]); // Remember palette is in different endian order! + if( bIgnoreAlpha ) + { + *(pDst-1) |= 0xFF000000; + } + + dwByteOffset++; + } + } + } + else + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint32 *pDst = (uint32 *)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + tinfo.LeftToLoad; + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + uint8 b = pSrc[dwByteOffset ^ 0x3]; + + *pDst++ = ConvertIA16ToRGBA(pPal[b^1]); // Remember palette is in different endian order! + if( bIgnoreAlpha ) + { + *(pDst-1) |= 0xFF000000; + } + + dwByteOffset++; + } + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); +} + +void ConvertYUV(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + if (!pTexture->StartUpdate(&dInfo)) + return; + + uint32 x, y; + uint32 nFiddle; + + if( options.bUseFullTMEM ) + { + Tile &tile = gRDP.tiles[tinfo.tileNo]; + + uint16 * pSrc; + if( tinfo.tileNo >= 0 ) + pSrc = (uint16*)&g_Tmem.g_Tmem64bit[tile.dwTMem]; + else + pSrc = (uint16*)(tinfo.pPhysicalAddress); + + uint8 * pByteSrc = (uint8 *)pSrc; + for (y = 0; y < tinfo.HeightToLoad; y++) + { + nFiddle = ( y&1 )? 0x4 : 0; + int dwWordOffset = tinfo.tileNo>=0? tile.dwLine*8*y : ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad * 2); + uint32 * dwDst = (uint32 *)((uint8 *)dInfo.lpSurface + y*dInfo.lPitch); + + for (x = 0; x < tinfo.WidthToLoad/2; x++) + { + int y0 = *(uint8*)&pByteSrc[(dwWordOffset+1)^nFiddle]; + int y1 = *(uint8*)&pByteSrc[(dwWordOffset+3)^nFiddle]; + int u0 = *(uint8*)&pByteSrc[(dwWordOffset )^nFiddle]; + int v0 = *(uint8*)&pByteSrc[(dwWordOffset+2)^nFiddle]; + + dwDst[x*2+0] = ConvertYUV16ToR8G8B8(y0,u0,v0); + dwDst[x*2+1] = ConvertYUV16ToR8G8B8(y1,u0,v0); + + dwWordOffset += 4; + } + } + } + else + { + uint16 * pSrc = (uint16*)(tinfo.pPhysicalAddress); + uint8 * pByteSrc = (uint8 *)pSrc; + + if (tinfo.bSwapped) + { + for (y = 0; y < tinfo.HeightToLoad; y++) + { + if ((y&1) == 0) + nFiddle = 0x3; + else + nFiddle = 0x7; + + // dwDst points to start of destination row + uint32 * dwDst = (uint32 *)((uint8 *)dInfo.lpSurface + y*dInfo.lPitch); + + // DWordOffset points to the current dword we're looking at + // (process 2 pixels at a time). May be a problem if we don't start on even pixel + uint32 dwWordOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad * 2); + + for (x = 0; x < tinfo.WidthToLoad/2; x++) + { + int y0 = *(uint8*)&pByteSrc[(dwWordOffset+2)^nFiddle]; + int v0 = *(uint8*)&pByteSrc[(dwWordOffset+1)^nFiddle]; + int y1 = *(uint8*)&pByteSrc[(dwWordOffset )^nFiddle]; + int u0 = *(uint8*)&pByteSrc[(dwWordOffset+3)^nFiddle]; + + dwDst[x*2+0] = ConvertYUV16ToR8G8B8(y0,u0,v0); + dwDst[x*2+1] = ConvertYUV16ToR8G8B8(y1,u0,v0); + + dwWordOffset += 4; + } + } + } + else + { + for (y = 0; y < tinfo.HeightToLoad; y++) + { + // dwDst points to start of destination row + uint32 * dwDst = (uint32 *)((uint8 *)dInfo.lpSurface + y*dInfo.lPitch); + uint32 dwByteOffset = y * 32; + + for (x = 0; x < tinfo.WidthToLoad/2; x++) + { + int y0 = *(uint8*)&pByteSrc[(dwByteOffset+2)]; + int v0 = *(uint8*)&pByteSrc[(dwByteOffset+1)]; + int y1 = *(uint8*)&pByteSrc[(dwByteOffset )]; + int u0 = *(uint8*)&pByteSrc[(dwByteOffset+3)]; + + dwDst[x*2+0] = ConvertYUV16ToR8G8B8(y0,u0,v0); + dwDst[x*2+1] = ConvertYUV16ToR8G8B8(y1,u0,v0); + + // Increment word offset to point to the next two pixels + dwByteOffset += 4; + } + } + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); +} + +uint32 ConvertYUV16ToR8G8B8(int Y, int U, int V) +{ + /* + int R = int(g_convc0 *(Y-16) + g_convc1 * V); + int G = int(g_convc0 *(Y-16) + g_convc2 * U - g_convc3 * V); + int B = int(g_convc0 *(Y-16) + g_convc4 * U); + */ + + Y += 80; + int R = int(Y + (1.370705f * (V-128))); + int G = int(Y - (0.698001f * (V-128)) - (0.337633f * (U-128))); + int B = int(Y + (1.732446f * (U-128))); + + R = R < 0 ? 0 : (R>255 ? 255 : R); + G = G < 0 ? 0 : (G>255 ? 255 : G); + B = B < 0 ? 0 : (B>255 ? 255 : B); + + return COLOR_RGBA(R, G, B, 0xFF); +} + + +// Used by Starfox intro +void Convert4b(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + + if (!pTexture->StartUpdate(&dInfo)) + return; + + uint16 * pPal = (uint16 *)tinfo.PalAddress; + bool bIgnoreAlpha = (tinfo.TLutFmt==TLUT_FMT_UNKNOWN); + if( tinfo.Format <= TXT_FMT_CI ) bIgnoreAlpha = (tinfo.TLutFmt==TLUT_FMT_NONE); + + Tile &tile = gRDP.tiles[tinfo.tileNo]; + + uint8 *pByteSrc = tinfo.tileNo >= 0 ? (uint8*)&g_Tmem.g_Tmem64bit[tile.dwTMem] : (uint8*)(tinfo.pPhysicalAddress); + + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint32 nFiddle; + if( tinfo.tileNo < 0 ) + { + if (tinfo.bSwapped) + { + if ((y%2) == 0) + nFiddle = 0x3; + else + nFiddle = 0x7; + } + else + { + nFiddle = 3; + } + } + else + { + nFiddle = ( y&1 )? 0x4 : 0; + } + + uint32 * pDst = (uint32 *)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + int idx = tinfo.tileNo>=0 ? tile.dwLine*8*y : ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad / 2); + + if (tinfo.WidthToLoad == 1) + { + // corner case + uint8 b = pByteSrc[idx^nFiddle]; + uint8 bhi = (b&0xf0)>>4; + if( gRDP.otherMode.text_tlut>=2 || ( tinfo.Format != TXT_FMT_IA && tinfo.Format != TXT_FMT_I) ) + { + if( tinfo.TLutFmt == TLUT_FMT_IA16 ) + { + if( tinfo.tileNo>=0 ) + *pDst = ConvertIA16ToRGBA(g_Tmem.g_Tmem16bit[0x400+tinfo.Palette*0x40+(bhi<<2)]); + else + *pDst = ConvertIA16ToRGBA(pPal[bhi^1]); + } + else + { + if( tinfo.tileNo>=0 ) + *pDst = Convert555ToRGBA(g_Tmem.g_Tmem16bit[0x400+tinfo.Palette*0x40+(bhi<<2)]); + else + *pDst = Convert555ToRGBA(pPal[bhi^1]); + } + } + else if( tinfo.Format == TXT_FMT_IA ) + *pDst = ConvertIA4ToRGBA(b>>4); + else // if( tinfo.Format == TXT_FMT_I ) + *pDst = ConvertI4ToRGBA(b>>4); + if( bIgnoreAlpha ) + *pDst |= 0xFF000000; + } + else for (uint32 x = 0; x < tinfo.WidthToLoad; x+=2, idx++) + { + // two pixels at a time + uint8 b = pByteSrc[idx^nFiddle]; + uint8 bhi = (b&0xf0)>>4; + uint8 blo = (b&0x0f); + + if( gRDP.otherMode.text_tlut>=2 || ( tinfo.Format != TXT_FMT_IA && tinfo.Format != TXT_FMT_I) ) + { + if( tinfo.TLutFmt == TLUT_FMT_IA16 ) + { + if( tinfo.tileNo>=0 ) + { + pDst[0] = ConvertIA16ToRGBA(g_Tmem.g_Tmem16bit[0x400+tinfo.Palette*0x40+(bhi<<2)]); + pDst[1] = ConvertIA16ToRGBA(g_Tmem.g_Tmem16bit[0x400+tinfo.Palette*0x40+(blo<<2)]); + } + else + { + pDst[0] = ConvertIA16ToRGBA(pPal[bhi^1]); + pDst[1] = ConvertIA16ToRGBA(pPal[blo^1]); + } + } + else + { + if( tinfo.tileNo>=0 ) + { + pDst[0] = Convert555ToRGBA(g_Tmem.g_Tmem16bit[0x400+tinfo.Palette*0x40+(bhi<<2)]); + pDst[1] = Convert555ToRGBA(g_Tmem.g_Tmem16bit[0x400+tinfo.Palette*0x40+(blo<<2)]); + } + else + { + pDst[0] = Convert555ToRGBA(pPal[bhi^1]); + pDst[1] = Convert555ToRGBA(pPal[blo^1]); + } + } + } + else if( tinfo.Format == TXT_FMT_IA ) + { + pDst[0] = ConvertIA4ToRGBA(b>>4); + pDst[1] = ConvertIA4ToRGBA(b&0xF); + } + else // if( tinfo.Format == TXT_FMT_I ) + { + pDst[0] = ConvertI4ToRGBA(b>>4); + pDst[1] = ConvertI4ToRGBA(b&0xF); + } + + if( bIgnoreAlpha ) + { + pDst[0] |= 0xFF000000; + pDst[1] |= 0xFF000000; + } + pDst+=2; + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); +} + +void Convert8b(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + if (!pTexture->StartUpdate(&dInfo)) + return; + + uint16 * pPal = (uint16 *)tinfo.PalAddress; + bool bIgnoreAlpha = (tinfo.TLutFmt==TLUT_FMT_UNKNOWN); + if( tinfo.Format <= TXT_FMT_CI ) bIgnoreAlpha = (tinfo.TLutFmt==TLUT_FMT_NONE); + + Tile &tile = gRDP.tiles[tinfo.tileNo]; + + uint8 *pByteSrc; + if( tinfo.tileNo >= 0 ) + { + pByteSrc = (uint8*)&g_Tmem.g_Tmem64bit[tile.dwTMem]; + } + else + { + pByteSrc = (uint8*)(tinfo.pPhysicalAddress); + } + + + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint32 * pDst = (uint32 *)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + uint32 nFiddle; + if( tinfo.tileNo < 0 ) + { + if (tinfo.bSwapped) + { + if ((y%2) == 0) + nFiddle = 0x3; + else + nFiddle = 0x7; + } + else + { + nFiddle = 3; + } + } + else + { + nFiddle = ( y&1 )? 0x4 : 0; + } + + + int idx = tinfo.tileNo>=0? tile.dwLine*8*y : ((y+tinfo.TopToLoad) * tinfo.Pitch) + tinfo.LeftToLoad; + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++, idx++) + { + uint8 b = pByteSrc[idx^nFiddle]; + + if( gRDP.otherMode.text_tlut>=2 || ( tinfo.Format != TXT_FMT_IA && tinfo.Format != TXT_FMT_I) ) + { + if( tinfo.TLutFmt == TLUT_FMT_IA16 ) + { + if( tinfo.tileNo>=0 ) + *pDst = ConvertIA16ToRGBA(g_Tmem.g_Tmem16bit[0x400+(b<<2)]); + else + *pDst = ConvertIA16ToRGBA(pPal[b^1]); + } + else + { + if( tinfo.tileNo>=0 ) + *pDst = Convert555ToRGBA(g_Tmem.g_Tmem16bit[0x400+(b<<2)]); + else + *pDst = Convert555ToRGBA(pPal[b^1]); + } + } + else if( tinfo.Format == TXT_FMT_IA ) + { + uint8 I = FourToEight[(b & 0xf0)>>4]; + uint8 * pByteDst = (uint8*)pDst; + pByteDst[0] = I; + pByteDst[1] = I; + pByteDst[2] = I; + pByteDst[3] = FourToEight[(b & 0x0f) ]; + } + else // if( tinfo.Format == TXT_FMT_I ) + { + uint8 * pByteDst = (uint8*)pDst; + pByteDst[0] = b; + pByteDst[1] = b; + pByteDst[2] = b; + pByteDst[3] = b; + } + + if( bIgnoreAlpha ) + { + *pDst |= 0xFF000000; + } + pDst++; + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); +} + + +void Convert16b(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + if (!pTexture->StartUpdate(&dInfo)) + return; + + Tile &tile = gRDP.tiles[tinfo.tileNo]; + + uint16 *pWordSrc; + if( tinfo.tileNo >= 0 ) + pWordSrc = (uint16*)&g_Tmem.g_Tmem64bit[tile.dwTMem]; + else + pWordSrc = (uint16*)(tinfo.pPhysicalAddress); + + + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint32 * dwDst = (uint32 *)((uint8 *)dInfo.lpSurface + y*dInfo.lPitch); + + uint32 nFiddle; + if( tinfo.tileNo < 0 ) + { + if (tinfo.bSwapped) + { + if ((y&1) == 0) + nFiddle = 0x1; + else + nFiddle = 0x3; + } + else + { + nFiddle = 0x1; + } + } + else + { + nFiddle = ( y&1 )? 0x2 : 0; + } + + + int idx = tinfo.tileNo>=0? tile.dwLine*4*y : (((y+tinfo.TopToLoad) * tinfo.Pitch)>>1) + tinfo.LeftToLoad; + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++, idx++) + { + uint16 w = pWordSrc[idx^nFiddle]; + uint16 w2 = tinfo.tileNo>=0? ((w>>8)|(w<<8)) : w; + + if( tinfo.Format == TXT_FMT_RGBA ) + { + dwDst[x] = Convert555ToRGBA(w2); + } + else if( tinfo.Format == TXT_FMT_YUV ) + { + } + else if( tinfo.Format >= TXT_FMT_IA ) + { + uint8 * pByteDst = (uint8*)&dwDst[x]; + *pByteDst++ = (uint8)(w2 >> 8); + *pByteDst++ = (uint8)(w2 >> 8); + *pByteDst++ = (uint8)(w2 >> 8); + *pByteDst++ = (uint8)(w2 & 0xFF); + } + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/ConvertImage.h b/libmupen64plus/mupen64plus-video-rice/src/ConvertImage.h new file mode 100644 index 0000000000..6c004cb90b --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/ConvertImage.h @@ -0,0 +1,300 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + +#ifndef __CONVERTIMAGE_H__ +#define __CONVERTIMAGE_H__ + +#include "typedefs.h" +#include "Texture.h" +#include "TextureManager.h" + + +static const uint8 OneToEight[2] = +{ + 0x00, // 0 -> 00 00 00 00 + 0xff // 1 -> 11 11 11 11 +}; + +static const uint8 OneToFour[2] = +{ + 0x00, // 0 -> 00 00 + 0x0f // 1 -> 11 11 +}; + +static const uint8 TwoToEight[4] = +{ + 0x00, // 00 -> 00 00 00 00 + 0x55, // 01 -> 01 01 01 01 + 0xaa, // 10 -> 10 10 10 10 + 0xff // 11 -> 11 11 11 11 +}; + +static const uint8 TwoToFour[4] = +{ + 0x0, // 00 -> 00 00 + 0x5, // 01 -> 01 01 + 0xa, // 10 -> 10 10 + 0xf // 11 -> 11 11 +}; + +static const uint8 ThreeToEight[8] = +{ + 0x00, // 000 -> 00 00 00 00 + 0x24, // 001 -> 00 10 01 00 + 0x49, // 010 -> 01 00 10 01 + 0x6d, // 011 -> 01 10 11 01 + 0x92, // 100 -> 10 01 00 10 + 0xb6, // 101 -> 10 11 01 10 + 0xdb, // 110 -> 11 01 10 11 + 0xff // 111 -> 11 11 11 11 +}; + +static const uint8 ThreeToFour[8] = +{ + 0x0, // 000 -> 00 00 00 00 + 0x2, // 001 -> 00 10 01 00 + 0x4, // 010 -> 01 00 10 01 + 0x6, // 011 -> 01 10 11 01 + 0x9, // 100 -> 10 01 00 10 + 0xb, // 101 -> 10 11 01 10 + 0xd, // 110 -> 11 01 10 11 + 0xf // 111 -> 11 11 11 11 +}; + +static const uint8 FourToEight[16] = +{ + 0x00, 0x11, 0x22, 0x33, + 0x44, 0x55, 0x66, 0x77, + 0x88, 0x99, 0xaa, 0xbb, + 0xcc, 0xdd, 0xee, 0xff +}; + +static const uint16 FourToSixteen[16] = +{ + 0x0000, 0x1111, 0x2222, 0x3333, + 0x4444, 0x5555, 0x6666, 0x7777, + 0x8888, 0x9999, 0xaaaa, 0xbbbb, + 0xcccc, 0xdddd, 0xeeee, 0xffff +}; + +static const uint8 FiveToEight[32] = +{ + 0x00, // 00000 -> 00000000 + 0x08, // 00001 -> 00001000 + 0x10, // 00010 -> 00010000 + 0x18, // 00011 -> 00011000 + 0x21, // 00100 -> 00100001 + 0x29, // 00101 -> 00101001 + 0x31, // 00110 -> 00110001 + 0x39, // 00111 -> 00111001 + 0x42, // 01000 -> 01000010 + 0x4a, // 01001 -> 01001010 + 0x52, // 01010 -> 01010010 + 0x5a, // 01011 -> 01011010 + 0x63, // 01100 -> 01100011 + 0x6b, // 01101 -> 01101011 + 0x73, // 01110 -> 01110011 + 0x7b, // 01111 -> 01111011 + + 0x84, // 10000 -> 10000100 + 0x8c, // 10001 -> 10001100 + 0x94, // 10010 -> 10010100 + 0x9c, // 10011 -> 10011100 + 0xa5, // 10100 -> 10100101 + 0xad, // 10101 -> 10101101 + 0xb5, // 10110 -> 10110101 + 0xbd, // 10111 -> 10111101 + 0xc6, // 11000 -> 11000110 + 0xce, // 11001 -> 11001110 + 0xd6, // 11010 -> 11010110 + 0xde, // 11011 -> 11011110 + 0xe7, // 11100 -> 11100111 + 0xef, // 11101 -> 11101111 + 0xf7, // 11110 -> 11110111 + 0xff // 11111 -> 11111111 +}; + + +#define RGBA5551_RedMask (0xF800) +#define RGBA5551_GreenMask (0x07C0) +#define RGBA5551_BlueMask (0x003E) +#define RGBA5551_AlphaMask (0x0001) + + +#define RGBA5551_RedShift 11 +#define RGBA5551_GreenShift 6 +#define RGBA5551_BlueShift 1 +#define RGBA5551_AlphaShift 0 + +#define RGBA565_RedMask (0xF800) +#define RGBA565_GreenMask (0x07E0) +#define RGBA565_BlueMask (0x001F) + +#define RGBA565_RedShift 11 +#define RGBA565_GreenShift 5 +#define RGBA565_BlueShift 0 + +inline uint16 ConvertRGBTo555(uint8 red, uint8 grn, uint8 blu) +{ + return (uint16)(((uint16)(red >> 3) << RGBA5551_RedShift) | + ((uint16)(grn >> 3) << RGBA5551_GreenShift) | + ((uint16)(blu >> 3) << RGBA5551_BlueShift) | + ((uint16)(1) << RGBA5551_AlphaShift)); +} + +inline uint16 ConvertRGBTo565(uint8 red, uint8 grn, uint8 blu) +{ + return (uint16)(((uint16)(red >> 3) << RGBA565_RedShift) | + ((uint16)(grn >> 2) << RGBA565_GreenShift) | + ((uint16)(blu >> 3) << RGBA565_BlueShift)); +} +inline uint16 Convert555To565(uint16 w555) +{ + // Probably a faster method by fudging the low bits.. + + uint8 red = FiveToEight[(w555&RGBA5551_RedMask) >> RGBA5551_RedShift]; + uint8 grn = FiveToEight[(w555&RGBA5551_GreenMask)>> RGBA5551_GreenShift]; + uint8 blu = FiveToEight[(w555&RGBA5551_BlueMask) >> RGBA5551_BlueShift]; + + return ConvertRGBTo565(red, grn, blu); +} + +#define R4G4B4A4_MAKE(r,g,b,a) ((uint16)(((a) << 12) | ((r)<< 8) | ((g)<<4) | (b))) + + +inline uint32 Convert555ToRGBA(uint16 w555) +{ + uint32 dwRed = FiveToEight[(w555&RGBA5551_RedMask) >> RGBA5551_RedShift]; + uint32 dwGreen = FiveToEight[(w555&RGBA5551_GreenMask)>> RGBA5551_GreenShift]; + uint32 dwBlue = FiveToEight[(w555&RGBA5551_BlueMask) >> RGBA5551_BlueShift]; + uint32 dwAlpha = (w555&RGBA5551_AlphaMask) ? 0xFF : 0x00; + return COLOR_RGBA(dwRed, dwGreen, dwBlue, dwAlpha); + +} +inline uint16 Convert555ToR4G4B4A4(uint16 w555) +{ + uint8 dwRed = ((w555&RGBA5551_RedMask) >> RGBA5551_RedShift)>>1; + uint8 dwGreen = ((w555&RGBA5551_GreenMask)>> RGBA5551_GreenShift)>>1; + uint8 dwBlue = ((w555&RGBA5551_BlueMask) >> RGBA5551_BlueShift)>>1; + uint8 dwAlpha = (w555&RGBA5551_AlphaMask) ? 0xF : 0x0; + + return R4G4B4A4_MAKE(dwRed, dwGreen, dwBlue, dwAlpha); +} + +inline uint32 ConvertIA4ToRGBA(uint8 IA4) +{ + uint32 I = ThreeToEight[(IA4 & 0x0F) >> 1]; + uint32 A = OneToEight[(IA4 & 0x01)]; + return COLOR_RGBA(I, I, I, A); +} + +inline uint16 ConvertIA4ToR4G4B4A4(uint8 IA4) +{ + uint32 I = ThreeToFour[(IA4 & 0x0F) >> 1]; + uint32 A = OneToFour[(IA4 & 0x01)]; + return R4G4B4A4_MAKE(I, I, I, A); +} +inline uint32 ConvertI4ToRGBA(uint8 I4) +{ + uint32 I = FourToEight[I4 & 0x0F]; + return COLOR_RGBA(I, I, I, I); +} + +inline uint16 ConvertI4ToR4G4B4A4(uint8 I4) +{ + return FourToSixteen[I4 & 0x0F]; +} + +inline uint32 ConvertIA16ToRGBA(uint16 wIA) +{ + uint32 dwIntensity = (wIA >> 8) & 0xFF; + uint32 dwAlpha = (wIA ) & 0xFF; + return COLOR_RGBA(dwIntensity, dwIntensity, dwIntensity, dwAlpha); +} + +inline uint16 ConvertIA16ToR4G4B4A4(uint16 wIA) +{ + uint16 dwIntensity = (wIA >> 12) & 0x0F; + uint16 dwAlpha = (wIA >> 4) & 0x0F; + + return R4G4B4A4_MAKE(dwIntensity, dwIntensity, dwIntensity, dwAlpha); +} + +extern int g_convk0,g_convk1,g_convk2,g_convk3,g_convk4,g_convk5; +extern float g_convc0,g_convc1,g_convc2,g_convc3,g_convc4,g_convc5; + +uint32 ConvertYUV16ToR8G8B8(int Y, int U, int V); +uint16 ConvertYUV16ToR4G4B4(int Y, int U, int V); + + +typedef void ( * ConvertFunction )( CTexture * p_texture, const TxtrInfo & ti ); + +void ConvertRGBA16(CTexture *pTexture, const TxtrInfo &tinfo); +void ConvertRGBA32(CTexture *pTexture, const TxtrInfo &tinfo); + + +void ConvertIA4(CTexture *pTexture, const TxtrInfo &tinfo); +void ConvertIA8(CTexture *pTexture, const TxtrInfo &tinfo); +void ConvertIA16(CTexture *pTexture, const TxtrInfo &tinfo); + +void ConvertI4(CTexture *pTexture, const TxtrInfo &tinfo); +void ConvertI8(CTexture *pTexture, const TxtrInfo &tinfo); + +void ConvertCI4( CTexture *pTexture, const TxtrInfo & ti ); +void ConvertCI8( CTexture *pTexture, const TxtrInfo & ti ); + +void ConvertCI4_RGBA16(CTexture *pTexture, const TxtrInfo &tinfo); +void ConvertCI4_IA16(CTexture *pTexture, const TxtrInfo &tinfo); +void ConvertCI8_RGBA16(CTexture *pTexture, const TxtrInfo &tinfo); +void ConvertCI8_IA16(CTexture *pTexture, const TxtrInfo &tinfo); + +void ConvertYUV(CTexture *pTexture, const TxtrInfo &tinfo); + +// 16 a4r4g4b4 +void ConvertRGBA16_16(CTexture *pTexture, const TxtrInfo &tinfo); +void ConvertRGBA32_16(CTexture *pTexture, const TxtrInfo &tinfo); + + +void ConvertIA4_16(CTexture *pTexture, const TxtrInfo &tinfo); +void ConvertIA8_16(CTexture *pTexture, const TxtrInfo &tinfo); +void ConvertIA16_16(CTexture *pTexture, const TxtrInfo &tinfo); + +void ConvertI4_16(CTexture *pTexture, const TxtrInfo &tinfo); +void ConvertI8_16(CTexture *pTexture, const TxtrInfo &tinfo); + +void ConvertCI4_16( CTexture *pTexture, const TxtrInfo & ti ); +void ConvertCI8_16( CTexture *pTexture, const TxtrInfo & ti ); + +void ConvertCI4_RGBA16_16(CTexture *pTexture, const TxtrInfo &tinfo); +void ConvertCI4_IA16_16(CTexture *pTexture, const TxtrInfo &tinfo); +void ConvertCI8_RGBA16_16(CTexture *pTexture, const TxtrInfo &tinfo); +void ConvertCI8_IA16_16(CTexture *pTexture, const TxtrInfo &tinfo); + +void ConvertYUV_16(CTexture *pTexture, const TxtrInfo &tinfo); + +void Convert4b(CTexture *pTexture, const TxtrInfo &tinfo); +void Convert8b(CTexture *pTexture, const TxtrInfo &tinfo); +void Convert16b(CTexture *pTexture, const TxtrInfo &tinfo); + +void Convert4b_16(CTexture *pTexture, const TxtrInfo &tinfo); +void Convert8b_16(CTexture *pTexture, const TxtrInfo &tinfo); +void Convert16b_16(CTexture *pTexture, const TxtrInfo &tinfo); + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/ConvertImage16.cpp b/libmupen64plus/mupen64plus-video-rice/src/ConvertImage16.cpp new file mode 100644 index 0000000000..319388be50 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/ConvertImage16.cpp @@ -0,0 +1,1213 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + +#include "Config.h" +#include "ConvertImage.h" +#include "RenderBase.h" + +// Still to be swapped: +// IA16 + +ConvertFunction gConvertFunctions_16_FullTMEM[ 8 ][ 4 ] = +{ + // 4bpp 8bpp 16bpp 32bpp + { Convert4b_16, Convert8b_16, Convert16b_16, ConvertRGBA32_16 }, // RGBA + { NULL, NULL, ConvertYUV_16, NULL }, // YUV + { Convert4b_16, Convert8b_16, NULL, NULL }, // CI + { Convert4b_16, Convert8b_16, Convert16b_16, NULL }, // IA + { Convert4b_16, Convert8b_16, Convert16b_16, NULL }, // I + { NULL, NULL, NULL, NULL }, // ? + { NULL, NULL, NULL, NULL }, // ? + { NULL, NULL, NULL, NULL } // ? +}; +ConvertFunction gConvertFunctions_16[ 8 ][ 4 ] = +{ + // 4bpp 8bpp 16bpp 32bpp + { ConvertCI4_16, ConvertCI8_16, ConvertRGBA16_16, ConvertRGBA32_16 }, // RGBA + { NULL, NULL, ConvertYUV_16, NULL }, // YUV + { ConvertCI4_16, ConvertCI8_16, NULL, NULL }, // CI + { ConvertIA4_16, ConvertIA8_16, ConvertIA16_16, NULL }, // IA + { ConvertI4_16, ConvertI8_16, ConvertRGBA16_16, NULL }, // I + { NULL, NULL, NULL, NULL }, // ? + { NULL, NULL, NULL, NULL }, // ? + { NULL, NULL, NULL, NULL } // ? +}; + +ConvertFunction gConvertTlutFunctions_16[ 8 ][ 4 ] = +{ + // 4bpp 8bpp 16bpp 32bpp + { ConvertCI4_16, ConvertCI8_16, ConvertRGBA16_16, ConvertRGBA32_16 }, // RGBA + { NULL, NULL, ConvertYUV_16, NULL }, // YUV + { ConvertCI4_16, ConvertCI8_16, NULL, NULL }, // CI + { ConvertCI4_16, ConvertCI8_16, ConvertIA16_16, NULL }, // IA + { ConvertCI4_16, ConvertCI8_16, ConvertRGBA16_16, NULL }, // I + { NULL, NULL, NULL, NULL }, // ? + { NULL, NULL, NULL, NULL }, // ? + { NULL, NULL, NULL, NULL } // ? +}; + +extern bool conkerSwapHack; + +void ConvertRGBA16_16(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + uint32 x, y; + uint32 nFiddle; + + // Copy of the base pointer + uint16 * pSrc = (uint16*)(tinfo.pPhysicalAddress); + uint8 * pByteSrc = (uint8 *)pSrc; + + if (!pTexture->StartUpdate(&dInfo)) + return; + + if (tinfo.bSwapped) + { + for (y = 0; y < tinfo.HeightToLoad; y++) + { + if ((y%2) == 0) + nFiddle = 0x2; + else + nFiddle = 0x2 | 0x4; + + // dwDst points to start of destination row + uint16 * wDst = (uint16 *)((uint8 *)dInfo.lpSurface + y*dInfo.lPitch); + + // DWordOffset points to the current dword we're looking at + // (process 2 pixels at a time). May be a problem if we don't start on even pixel + uint32 dwWordOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad * 2); + + for (x = 0; x < tinfo.WidthToLoad; x++) + { + uint16 w = *(uint16 *)&pByteSrc[dwWordOffset ^ nFiddle]; + + wDst[x] = Convert555ToR4G4B4A4(w); + + // Increment word offset to point to the next two pixels + dwWordOffset += 2; + } + } + } + else + { + for (y = 0; y < tinfo.HeightToLoad; y++) + { + // dwDst points to start of destination row + uint16 * wDst = (uint16 *)((uint8 *)dInfo.lpSurface + y*dInfo.lPitch); + + // DWordOffset points to the current dword we're looking at + // (process 2 pixels at a time). May be a problem if we don't start on even pixel + uint32 dwWordOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad * 2); + + for (x = 0; x < tinfo.WidthToLoad; x++) + { + uint16 w = *(uint16 *)&pByteSrc[dwWordOffset ^ 0x2]; + + wDst[x] = Convert555ToR4G4B4A4(w); + + // Increment word offset to point to the next two pixels + dwWordOffset += 2; + } + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); +} + +void ConvertRGBA32_16(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + uint32 * pSrc = (uint32*)(tinfo.pPhysicalAddress); + if (!pTexture->StartUpdate(&dInfo)) + return; + + if( options.bUseFullTMEM ) + { + Tile &tile = gRDP.tiles[tinfo.tileNo]; + + uint32 *pWordSrc; + if( tinfo.tileNo >= 0 ) + { + pWordSrc = (uint32*)&g_Tmem.g_Tmem64bit[tile.dwTMem]; + + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint16 * dwDst = (uint16 *)((uint8 *)dInfo.lpSurface + y*dInfo.lPitch); + + uint32 nFiddle = ( y&1 )? 0x2 : 0; + int idx = tile.dwLine*4*y; + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++, idx++) + { + uint32 w = pWordSrc[idx^nFiddle]; + uint8* psw = (uint8*)&w; + dwDst[x] = R4G4B4A4_MAKE( (psw[0]>>4), (psw[1]>>4), (psw[2]>>4), (psw[3]>>4)); + } + } + } + } + else + { + if (tinfo.bSwapped) + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + if ((y%2) == 0) + { + uint16 *pDst = (uint16*)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + uint8 *pS = (uint8 *)pSrc + (y+tinfo.TopToLoad) * tinfo.Pitch + (tinfo.LeftToLoad*4); + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + + *pDst++ = R4G4B4A4_MAKE((pS[3]>>4), // Red + (pS[2]>>4), // Green + (pS[1]>>4), // Blue + (pS[0]>>4)); // Alpha + pS+=4; + } + } + else + { + uint16 *pDst = (uint16*)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + uint8 *pS = (uint8 *)pSrc + (y+tinfo.TopToLoad) * tinfo.Pitch + (tinfo.LeftToLoad*4); + int n; + + n = 0; + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + *pDst++ = R4G4B4A4_MAKE((pS[(n^0x8) + 3]>>4), // Red + (pS[(n^0x8) + 2]>>4), // Green + (pS[(n^0x8) + 1]>>4), // Blue + (pS[(n^0x8) + 0]>>4)); // Alpha + + n += 4; + } + } + } + } + else + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint16 *pDst = (uint16*)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + uint8 *pS = (uint8 *)pSrc + (y+tinfo.TopToLoad) * tinfo.Pitch + (tinfo.LeftToLoad*4); + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + *pDst++ = R4G4B4A4_MAKE((pS[3]>>4), // Red + (pS[2]>>4), // Green + (pS[1]>>4), // Blue + (pS[0]>>4)); // Alpha + pS+=4; + } + } + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); + +} + +// E.g. Dear Mario text +// Copy, Score etc +void ConvertIA4_16(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + uint32 nFiddle; + + uint8 * pSrc = (uint8*)(tinfo.pPhysicalAddress); + if (!pTexture->StartUpdate(&dInfo)) + return; + + if (tinfo.bSwapped) + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint16 *pDst = (uint16*)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + // For odd lines, swap words too + if ((y%2) == 0) + nFiddle = 0x3; + else + nFiddle = 0x7; + + + // This may not work if X is not even? + uint32 dwByteOffset = (y+tinfo.TopToLoad) * tinfo.Pitch + (tinfo.LeftToLoad/2); + + // Do two pixels at a time + for (uint32 x = 0; x < tinfo.WidthToLoad; x+=2) + { + uint8 b = pSrc[dwByteOffset ^ nFiddle]; + + // Even + *pDst++ = R4G4B4A4_MAKE(ThreeToFour[(b & 0xE0) >> 5], + ThreeToFour[(b & 0xE0) >> 5], + ThreeToFour[(b & 0xE0) >> 5], + OneToFour[(b & 0x10) >> 4]); + + // Odd + *pDst++ = R4G4B4A4_MAKE(ThreeToFour[(b & 0x0E) >> 1], + ThreeToFour[(b & 0x0E) >> 1], + ThreeToFour[(b & 0x0E) >> 1], + OneToFour[(b & 0x01)] ); + + dwByteOffset++; + } + } + } + else + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint16 *pDst = (uint16*)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + // This may not work if X is not even? + uint32 dwByteOffset = (y+tinfo.TopToLoad) * tinfo.Pitch + (tinfo.LeftToLoad/2); + + // Do two pixels at a time + for (uint32 x = 0; x < tinfo.WidthToLoad; x+=2) + { + uint8 b = pSrc[dwByteOffset ^ 0x3]; + + // Even + *pDst++ = R4G4B4A4_MAKE(ThreeToFour[(b & 0xE0) >> 5], + ThreeToFour[(b & 0xE0) >> 5], + ThreeToFour[(b & 0xE0) >> 5], + OneToFour[(b & 0x10) >> 4]); + + // Odd + *pDst++ = R4G4B4A4_MAKE(ThreeToFour[(b & 0x0E) >> 1], + ThreeToFour[(b & 0x0E) >> 1], + ThreeToFour[(b & 0x0E) >> 1], + OneToFour[(b & 0x01)] ); + + dwByteOffset++; + } + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); +} + +// E.g Mario's head textures +void ConvertIA8_16(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + uint32 nFiddle; + + uint8 * pSrc = (uint8*)(tinfo.pPhysicalAddress); + if (!pTexture->StartUpdate(&dInfo)) + return; + + if (tinfo.bSwapped) + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + // For odd lines, swap words too + if ((y%2) == 0) + nFiddle = 0x3; + else + nFiddle = 0x7; + + + uint16 *pDst = (uint16 *)((uint8*)dInfo.lpSurface + y * dInfo.lPitch); + // Points to current byte + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + tinfo.LeftToLoad; + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + uint8 b = pSrc[dwByteOffset ^ nFiddle]; + + *pDst++ = R4G4B4A4_MAKE( ((b&0xf0)>>4),((b&0xf0)>>4),((b&0xf0)>>4),(b&0x0f)); + + dwByteOffset++; + } + } + } + else + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint16 *pDst = (uint16*)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + // Points to current byte + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + tinfo.LeftToLoad; + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + uint8 b = pSrc[dwByteOffset ^ 0x3]; + + *pDst++ = R4G4B4A4_MAKE(((b&0xf0)>>4),((b&0xf0)>>4),((b&0xf0)>>4),(b&0x0f)); + + dwByteOffset++; + } + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); + +} + +// E.g. camera's clouds, shadows +void ConvertIA16_16(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + + uint16 * pSrc = (uint16*)(tinfo.pPhysicalAddress); + uint8 * pByteSrc = (uint8 *)pSrc; + + if (!pTexture->StartUpdate(&dInfo)) + return; + + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint16 *pDst = (uint16*)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + // Points to current word + uint32 dwWordOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad * 2); + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + uint16 w = *(uint16 *)&pByteSrc[dwWordOffset^0x2]; + + uint8 i = (uint8)(w >> 12); + uint8 a = (uint8)(w & 0xFF); + + *pDst++ = R4G4B4A4_MAKE(i, i, i, (a>>4)); + + dwWordOffset += 2; + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); +} + + + +// Used by MarioKart +void ConvertI4_16(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + uint32 nFiddle; + + uint8 * pSrc = (uint8*)(tinfo.pPhysicalAddress); + if (!pTexture->StartUpdate(&dInfo)) + return; + + if (tinfo.bSwapped) + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint16 *pDst = (uint16*)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + // Might not work with non-even starting X + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad / 2); + + // For odd lines, swap words too + if( !conkerSwapHack || (y&4) == 0 ) + { + if ((y%2) == 0) + nFiddle = 0x3; + else + nFiddle = 0x7; + } + else + { + if ((y%2) == 1) + nFiddle = 0x3; + else + nFiddle = 0x7; + } + + for (uint32 x = 0; x < tinfo.WidthToLoad; x+=2) + { + uint8 b = pSrc[dwByteOffset ^ nFiddle]; + + // Even + //*pDst++ = R4G4B4A4_MAKE(b>>4, b>>4, b>>4, b>>4); + *pDst++ = FourToSixteen[(b & 0xF0)>>4]; + // Odd + //*pDst++ = R4G4B4A4_MAKE(b & 0x0f, b & 0x0f, b & 0x0f, b & 0x0f); + *pDst++ = FourToSixteen[b & 0x0f]; + + dwByteOffset++; + } + } + } + else + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint8 *pDst = (uint8 *)dInfo.lpSurface + y * dInfo.lPitch; + + // Might not work with non-even starting X + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad / 2); + + for (uint32 x = 0; x < tinfo.WidthToLoad; x+=2) + { + uint8 b = pSrc[dwByteOffset ^ 0x3]; + + // Even + //*pDst++ = R4G4B4A4_MAKE(b>>4, b>>4, b>>4, b>>4); + *pDst++ = FourToEight[(b & 0xF0)>>4]; + + // Odd + //*pDst++ = R4G4B4A4_MAKE(b & 0x0f, b & 0x0f, b & 0x0f, b & 0x0f); + *pDst++ = FourToEight[b & 0x0f]; + + dwByteOffset++; + } + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); +} + +// Used by MarioKart +void ConvertI8_16(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + uint32 nFiddle; + + long long pSrc = (long long) (tinfo.pPhysicalAddress); + if (!pTexture->StartUpdate(&dInfo)) + return; + + if (tinfo.bSwapped) + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + if ((y%2) == 0) + nFiddle = 0x3; + else + nFiddle = 0x7; + + uint16 *pDst = (uint16*)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + tinfo.LeftToLoad; + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + uint8 b = *(uint8*)((pSrc+dwByteOffset)^nFiddle); + + *pDst++ = R4G4B4A4_MAKE(b>>4, + b>>4, + b>>4, + b>>4); + + dwByteOffset++; + } + } + } + else + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint16 *pDst = (uint16*)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + tinfo.LeftToLoad; + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + uint8 b = *(uint8*)((pSrc+dwByteOffset)^0x3); + + *pDst++ = R4G4B4A4_MAKE(b>>4, + b>>4, + b>>4, + b>>4); + + dwByteOffset++; + } + } + + } + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); + +} + + +// Used by Starfox intro +void ConvertCI4_RGBA16_16(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + uint32 nFiddle; + + uint8 * pSrc = (uint8*)(tinfo.pPhysicalAddress); + uint16 * pPal = (uint16 *)tinfo.PalAddress; + if (!pTexture->StartUpdate(&dInfo)) + return; + + if (tinfo.bSwapped) + { + + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + if ((y%2) == 0) + nFiddle = 0x3; + else + nFiddle = 0x7; + + + uint16 * pDst = (uint16 *)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad / 2); + + for (uint32 x = 0; x < tinfo.WidthToLoad; x+=2) + { + uint8 b = pSrc[dwByteOffset ^ nFiddle]; + + uint8 bhi = (b&0xf0)>>4; + uint8 blo = (b&0x0f); + + pDst[0] = Convert555ToR4G4B4A4(pPal[bhi^1]); // Remember palette is in different endian order! + pDst[1] = Convert555ToR4G4B4A4(pPal[blo^1]); // Remember palette is in different endian order! + pDst+=2; + + dwByteOffset++; + } + } + + } + else + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint16 * pDst = (uint16 *)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad / 2); + + for (uint32 x = 0; x < tinfo.WidthToLoad; x+=2) + { + uint8 b = pSrc[dwByteOffset ^ 0x3]; + + uint8 bhi = (b&0xf0)>>4; + uint8 blo = (b&0x0f); + + pDst[0] = Convert555ToR4G4B4A4(pPal[bhi^1]); // Remember palette is in different endian order! + pDst[1] = Convert555ToR4G4B4A4(pPal[blo^1]); // Remember palette is in different endian order! + pDst+=2; + + dwByteOffset++; + } + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); +} + +//***************************************************************************** +// Convert CI4 images. We need to switch on the palette type +//***************************************************************************** +void ConvertCI4_16( CTexture * p_texture, const TxtrInfo & tinfo ) +{ + if ( tinfo.TLutFmt == TLUT_FMT_RGBA16 ) + { + ConvertCI4_RGBA16_16( p_texture, tinfo ); + } + else if ( tinfo.TLutFmt == TLUT_FMT_IA16 ) + { + ConvertCI4_IA16_16( p_texture, tinfo ); + } +} + +//***************************************************************************** +// Convert CI8 images. We need to switch on the palette type +//***************************************************************************** +void ConvertCI8_16( CTexture * p_texture, const TxtrInfo & tinfo ) +{ + if ( tinfo.TLutFmt == TLUT_FMT_RGBA16 ) + { + ConvertCI8_RGBA16_16( p_texture, tinfo ); + } + else if ( tinfo.TLutFmt == TLUT_FMT_IA16 ) + { + ConvertCI8_IA16_16( p_texture, tinfo ); + } +} + +// Used by Starfox intro +void ConvertCI4_IA16_16(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + uint32 nFiddle; + + uint8 * pSrc = (uint8*)(tinfo.pPhysicalAddress); + uint16 * pPal = (uint16 *)tinfo.PalAddress; + if (!pTexture->StartUpdate(&dInfo)) + return; + + if (tinfo.bSwapped) + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + if ((y%2) == 0) + nFiddle = 0x3; + else + nFiddle = 0x7; + + uint16 * pDst = (uint16 *)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad / 2); + + for (uint32 x = 0; x < tinfo.WidthToLoad; x+=2) + { + uint8 b = pSrc[dwByteOffset ^ nFiddle]; + + uint8 bhi = (b&0xf0)>>4; + uint8 blo = (b&0x0f); + + pDst[0] = ConvertIA16ToR4G4B4A4(pPal[bhi^1]); // Remember palette is in different endian order! + pDst[1] = ConvertIA16ToR4G4B4A4(pPal[blo^1]); // Remember palette is in different endian order! + pDst += 2; + dwByteOffset++; + } + } + } + else + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint16 * pDst = (uint16 *)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad / 2); + + for (uint32 x = 0; x < tinfo.WidthToLoad; x+=2) + { + uint8 b = pSrc[dwByteOffset ^ 0x3]; + + uint8 bhi = (b&0xf0)>>4; + uint8 blo = (b&0x0f); + + pDst[0] = ConvertIA16ToR4G4B4A4(pPal[bhi^1]); // Remember palette is in different endian order! + pDst[1] = ConvertIA16ToR4G4B4A4(pPal[blo^1]); // Remember palette is in different endian order! + pDst+=2; + + dwByteOffset++; + } + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); +} + + +// Used by MarioKart for Cars etc +void ConvertCI8_RGBA16_16(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + uint32 nFiddle; + + uint8 * pSrc = (uint8*)(tinfo.pPhysicalAddress); + uint16 * pPal = (uint16 *)tinfo.PalAddress; + if (!pTexture->StartUpdate(&dInfo)) + return; + + if (tinfo.bSwapped) + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + if ((y%2) == 0) + nFiddle = 0x3; + else + nFiddle = 0x7; + + uint16 *pDst = (uint16 *)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + tinfo.LeftToLoad; + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + uint8 b = pSrc[dwByteOffset ^ nFiddle]; + + *pDst++ = Convert555ToR4G4B4A4(pPal[b^1]); // Remember palette is in different endian order! + + dwByteOffset++; + } + } + } + else + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint16 *pDst = (uint16 *)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + tinfo.LeftToLoad; + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + uint8 b = pSrc[dwByteOffset ^ 0x3]; + + *pDst++ = Convert555ToR4G4B4A4(pPal[b^1]); // Remember palette is in different endian order! + + dwByteOffset++; + } + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); +} + + +// Used by MarioKart for Cars etc +void ConvertCI8_IA16_16(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + uint32 nFiddle; + + uint8 * pSrc = (uint8*)(tinfo.pPhysicalAddress); + uint16 * pPal = (uint16 *)tinfo.PalAddress; + if (!pTexture->StartUpdate(&dInfo)) + return; + + if (tinfo.bSwapped) + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + if ((y%2) == 0) + nFiddle = 0x3; + else + nFiddle = 0x7; + + uint16 *pDst = (uint16 *)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + tinfo.LeftToLoad; + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + uint8 b = pSrc[dwByteOffset ^ nFiddle]; + + *pDst++ = ConvertIA16ToR4G4B4A4(pPal[b^1]); // Remember palette is in different endian order! + + dwByteOffset++; + } + } + } + else + { + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint16 *pDst = (uint16 *)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + uint32 dwByteOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + tinfo.LeftToLoad; + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++) + { + uint8 b = pSrc[dwByteOffset ^ 0x3]; + + *pDst++ = ConvertIA16ToR4G4B4A4(pPal[b^1]); // Remember palette is in different endian order! + + dwByteOffset++; + } + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); +} + + +void ConvertYUV_16(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + if (!pTexture->StartUpdate(&dInfo)) + return; + + uint32 x, y; + uint32 nFiddle; + + if( options.bUseFullTMEM ) + { + Tile &tile = gRDP.tiles[tinfo.tileNo]; + + uint16 * pSrc; + if( tinfo.tileNo >= 0 ) + pSrc = (uint16*)&g_Tmem.g_Tmem64bit[tile.dwTMem]; + else + pSrc = (uint16*)(tinfo.pPhysicalAddress); + + uint8 * pByteSrc = (uint8 *)pSrc; + for (y = 0; y < tinfo.HeightToLoad; y++) + { + nFiddle = ( y&1 )? 0x4 : 0; + int dwWordOffset = tinfo.tileNo>=0? tile.dwLine*8*y : ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad * 2); + uint16 * wDst = (uint16 *)((uint8 *)dInfo.lpSurface + y*dInfo.lPitch); + + for (x = 0; x < tinfo.WidthToLoad/2; x++) + { + int y0 = *(uint8*)&pByteSrc[(dwWordOffset+1)^nFiddle]; + int y1 = *(uint8*)&pByteSrc[(dwWordOffset+3)^nFiddle]; + int u0 = *(uint8*)&pByteSrc[(dwWordOffset )^nFiddle]; + int v0 = *(uint8*)&pByteSrc[(dwWordOffset+2)^nFiddle]; + + wDst[x*2+0] = ConvertYUV16ToR4G4B4(y0,u0,v0); + wDst[x*2+1] = ConvertYUV16ToR4G4B4(y1,u0,v0); + + dwWordOffset += 4; + } + } + } + else + { + // Copy of the base pointer + uint16 * pSrc = (uint16*)(tinfo.pPhysicalAddress); + uint8 * pByteSrc = (uint8 *)pSrc; + + + if (tinfo.bSwapped) + { + for (y = 0; y < tinfo.HeightToLoad; y++) + { + if ((y%2) == 0) + nFiddle = 0x2; + else + nFiddle = 0x2 | 0x4; + + // dwDst points to start of destination row + uint16 * wDst = (uint16 *)((uint8 *)dInfo.lpSurface + y*dInfo.lPitch); + + // DWordOffset points to the current dword we're looking at + // (process 2 pixels at a time). May be a problem if we don't start on even pixel + uint32 dwWordOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad * 2); + + for (x = 0; x < tinfo.WidthToLoad/2; x++) + { + uint32 y0 = *(uint8*)&pByteSrc[(dwWordOffset+1)^nFiddle]; + uint32 y1 = *(uint8*)&pByteSrc[(dwWordOffset+3)^nFiddle]; + uint32 u0 = *(uint8*)&pByteSrc[(dwWordOffset )^nFiddle]; + uint32 v0 = *(uint8*)&pByteSrc[(dwWordOffset+2)^nFiddle]; + + wDst[x*2+0] = ConvertYUV16ToR4G4B4(y0,u0,v0); + wDst[x*2+1] = ConvertYUV16ToR4G4B4(y1,u0,v0); + + dwWordOffset += 4; + } + } + } + else + { + for (y = 0; y < tinfo.HeightToLoad; y++) + { + // dwDst points to start of destination row + uint16 * wDst = (uint16 *)((uint8 *)dInfo.lpSurface + y*dInfo.lPitch); + + // DWordOffset points to the current dword we're looking at + // (process 2 pixels at a time). May be a problem if we don't start on even pixel + uint32 dwWordOffset = ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad * 2); + + for (x = 0; x < tinfo.WidthToLoad/2; x++) + { + uint32 y0 = *(uint8*)&pByteSrc[(dwWordOffset+1)^3]; + uint32 y1 = *(uint8*)&pByteSrc[(dwWordOffset+3)^3]; + uint32 u0 = *(uint8*)&pByteSrc[(dwWordOffset )^3]; + uint32 v0 = *(uint8*)&pByteSrc[(dwWordOffset+2)^3]; + + wDst[x*2+0] = ConvertYUV16ToR4G4B4(y0,u0,v0); + wDst[x*2+1] = ConvertYUV16ToR4G4B4(y1,u0,v0); + + dwWordOffset += 4; + } + } + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); +} + +uint16 ConvertYUV16ToR4G4B4(int Y, int U, int V) +{ + uint32 A=1; + uint32 R1 = Y + g_convk0 * V; + uint32 G1 = Y + g_convk1 * U + g_convk2 * V; + uint32 B1 = Y + g_convk3 * U; + uint32 R = (R1 - g_convk4) * g_convk5 + R1; + uint32 G = (G1 - g_convk4) * g_convk5 + G1; + uint32 B = (B1 - g_convk4) * g_convk5 + B1; + return (uint16)R4G4B4A4_MAKE((R>>4), (G>>4), (B>>4), 0xF*A); +} + + +// Used by Starfox intro +void Convert4b_16(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + + if (!pTexture->StartUpdate(&dInfo)) + return; + + uint16 * pPal = (uint16 *)tinfo.PalAddress; + bool bIgnoreAlpha = (tinfo.TLutFmt==TLUT_FMT_UNKNOWN); + if( tinfo.Format <= TXT_FMT_CI ) bIgnoreAlpha = (tinfo.TLutFmt==TLUT_FMT_NONE); + + Tile &tile = gRDP.tiles[tinfo.tileNo]; + + uint8 *pByteSrc = tinfo.tileNo >= 0 ? (uint8*)&g_Tmem.g_Tmem64bit[tile.dwTMem] : (uint8*)(tinfo.pPhysicalAddress); + + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint16 * pDst = (uint16 *)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + uint32 nFiddle; + if( tinfo.tileNo < 0 ) + { + if (tinfo.bSwapped) + { + if ((y%2) == 0) + nFiddle = 0x3; + else + nFiddle = 0x7; + } + else + { + nFiddle = 3; + } + } + else + { + nFiddle = ( y&1 )? 0x4 : 0; + } + + int idx = tinfo.tileNo>=0 ? tile.dwLine*8*y : ((y+tinfo.TopToLoad) * tinfo.Pitch) + (tinfo.LeftToLoad / 2); + + for (uint32 x = 0; x < tinfo.WidthToLoad; x+=2, idx++) + { + uint8 b = pByteSrc[idx^nFiddle]; + uint8 bhi = (b&0xf0)>>4; + uint8 blo = (b&0x0f); + + if( gRDP.otherMode.text_tlut>=2 || ( tinfo.Format != TXT_FMT_IA && tinfo.Format != TXT_FMT_I) ) + { + if( tinfo.TLutFmt == TLUT_FMT_IA16 ) + { + if( tinfo.tileNo>=0 ) + { + pDst[0] = ConvertIA16ToR4G4B4A4(g_Tmem.g_Tmem16bit[0x400+tinfo.Palette*0x40+(bhi<<2)]); + pDst[1] = ConvertIA16ToR4G4B4A4(g_Tmem.g_Tmem16bit[0x400+tinfo.Palette*0x40+(blo<<2)]); + } + else + { + pDst[0] = ConvertIA16ToR4G4B4A4(pPal[bhi^1]); + pDst[1] = ConvertIA16ToR4G4B4A4(pPal[blo^1]); + } + } + else + { + if( tinfo.tileNo>=0 ) + { + pDst[0] = Convert555ToR4G4B4A4(g_Tmem.g_Tmem16bit[0x400+tinfo.Palette*0x40+(bhi<<2)]); + pDst[1] = Convert555ToR4G4B4A4(g_Tmem.g_Tmem16bit[0x400+tinfo.Palette*0x40+(blo<<2)]); + } + else + { + pDst[0] = Convert555ToR4G4B4A4(pPal[bhi^1]); + pDst[1] = Convert555ToR4G4B4A4(pPal[blo^1]); + } + } + } + else if( tinfo.Format == TXT_FMT_IA ) + { + pDst[0] = ConvertIA4ToR4G4B4A4(b>>4); + pDst[1] = ConvertIA4ToR4G4B4A4(b&0xF); + } + else //if( tinfo.Format == TXT_FMT_I ) + { + pDst[0] = ConvertI4ToR4G4B4A4(b>>4); + pDst[1] = ConvertI4ToR4G4B4A4(b&0xF); + } + + if( bIgnoreAlpha ) + { + pDst[0] |= 0xF000; + pDst[1] |= 0xF000; + } + pDst+=2; + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); +} + +void Convert8b_16(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + if (!pTexture->StartUpdate(&dInfo)) + return; + + + uint16 * pPal = (uint16 *)tinfo.PalAddress; + bool bIgnoreAlpha = (tinfo.TLutFmt==TLUT_FMT_UNKNOWN); + if( tinfo.Format <= TXT_FMT_CI ) bIgnoreAlpha = (tinfo.TLutFmt==TLUT_FMT_NONE); + + Tile &tile = gRDP.tiles[tinfo.tileNo]; + + uint8 *pByteSrc; + if( tinfo.tileNo >= 0 ) + pByteSrc = (uint8*)&g_Tmem.g_Tmem64bit[tile.dwTMem]; + else + pByteSrc = (uint8*)(tinfo.pPhysicalAddress); + + + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint16 * pDst = (uint16 *)((uint8 *)dInfo.lpSurface + y * dInfo.lPitch); + + uint32 nFiddle; + if( tinfo.tileNo < 0 ) + { + if (tinfo.bSwapped) + { + if ((y%2) == 0) + nFiddle = 0x3; + else + nFiddle = 0x7; + } + else + { + nFiddle = 3; + } + } + else + { + nFiddle = ( y&1 )? 0x4 : 0; + } + + int idx = tinfo.tileNo>=0? tile.dwLine*8*y : ((y+tinfo.TopToLoad) * tinfo.Pitch) + tinfo.LeftToLoad; + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++, idx++) + { + uint8 b = pByteSrc[idx^nFiddle]; + + if( gRDP.otherMode.text_tlut>=2 || ( tinfo.Format != TXT_FMT_IA && tinfo.Format != TXT_FMT_I) ) + { + if( tinfo.TLutFmt == TLUT_FMT_IA16 ) + { + if( tinfo.tileNo>=0 ) + *pDst = ConvertIA16ToR4G4B4A4(g_Tmem.g_Tmem16bit[0x400+(b<<2)]); + else + *pDst = ConvertIA16ToR4G4B4A4(pPal[b^1]); + } + else + { + if( tinfo.tileNo>=0 ) + *pDst = Convert555ToR4G4B4A4(g_Tmem.g_Tmem16bit[0x400+(b<<2)]); + else + *pDst = Convert555ToR4G4B4A4(pPal[b^1]); + } + } + else if( tinfo.Format == TXT_FMT_IA ) + { + *pDst = R4G4B4A4_MAKE( ((b&0xf0)>>4),((b&0xf0)>>4),((b&0xf0)>>4),(b&0x0f)); + } + else //if( tinfo.Format == TXT_FMT_I ) + { + *pDst = R4G4B4A4_MAKE(b>>4, b>>4, b>>4, b>>4); + } + + if( bIgnoreAlpha ) + { + *pDst |= 0xFF000000; + } + pDst++; + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); +} + + +void Convert16b_16(CTexture *pTexture, const TxtrInfo &tinfo) +{ + DrawInfo dInfo; + if (!pTexture->StartUpdate(&dInfo)) + return; + + Tile &tile = gRDP.tiles[tinfo.tileNo]; + + uint16 *pWordSrc; + if( tinfo.tileNo >= 0 ) + pWordSrc = (uint16*)&g_Tmem.g_Tmem64bit[tile.dwTMem]; + else + pWordSrc = (uint16*)(tinfo.pPhysicalAddress); + + + for (uint32 y = 0; y < tinfo.HeightToLoad; y++) + { + uint16 * dwDst = (uint16 *)((uint8 *)dInfo.lpSurface + y*dInfo.lPitch); + + uint32 nFiddle; + if( tinfo.tileNo < 0 ) + { + if (tinfo.bSwapped) + { + if ((y&1) == 0) + nFiddle = 0x1; + else + nFiddle = 0x3; + } + else + { + nFiddle = 0x1; + } + } + else + { + nFiddle = ( y&1 )? 0x2 : 0; + } + + int idx = tinfo.tileNo>=0? tile.dwLine*4*y : (((y+tinfo.TopToLoad) * tinfo.Pitch)>>1) + tinfo.LeftToLoad; + + for (uint32 x = 0; x < tinfo.WidthToLoad; x++, idx++) + { + uint16 w = pWordSrc[idx^nFiddle]; + uint16 w2 = tinfo.tileNo>=0? ((w>>8)|(w<<8)) : w; + + if( tinfo.Format == TXT_FMT_RGBA ) + { + dwDst[x] = Convert555ToR4G4B4A4(w2); + } + else if( tinfo.Format == TXT_FMT_YUV ) + { + } + else if( tinfo.Format >= TXT_FMT_IA ) + { + uint8 i = (uint8)(w2 >> 12); + uint8 a = (uint8)(w2 & 0xFF); + dwDst[x] = R4G4B4A4_MAKE(i, i, i, (a>>4)); + } + } + } + + pTexture->EndUpdate(&dInfo); + pTexture->SetOthersVariables(); +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/CritSect.h b/libmupen64plus/mupen64plus-video-rice/src/CritSect.h new file mode 100644 index 0000000000..b1793c9620 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/CritSect.h @@ -0,0 +1,62 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + +#if !defined(CRITSECT_H) +#define CRITSECT_H + +#include + +class CCritSect +{ +public: + CCritSect() + { + cs = SDL_CreateMutex(); + locked = 0; + } + + ~CCritSect() + { + SDL_DestroyMutex(cs); + } + + void Lock() + { + SDL_LockMutex(cs); + locked = 1; + } + + void Unlock() + { + locked = 0; + SDL_UnlockMutex(cs); + } + + bool IsLocked() + { + return (locked != 0); + } + +protected: + SDL_mutex *cs; + int locked; +}; + +#endif // !defined(CRITSECT_H) + diff --git a/libmupen64plus/mupen64plus-video-rice/src/Debugger.cpp b/libmupen64plus/mupen64plus-video-rice/src/Debugger.cpp new file mode 100644 index 0000000000..438931e052 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/Debugger.cpp @@ -0,0 +1,710 @@ +/* +Copyright (C) 2002 Rice1964 + +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. + +*/ + +#define M64P_PLUGIN_PROTOTYPES 1 +#include "m64p_plugin.h" +#include "typedefs.h" + +#ifndef DEBUGGER +void __cdecl DebuggerAppendMsg(const char * Message, ...) {} + +#else + +void DumpMatrix2(const Matrix &mtx, const char* prompt); + +bool debuggerWinOpened = false; +bool debuggerDrawRenderTexture = false; +int debuggerDrawRenderTextureNo = 0; + +bool logCombiners = false; +bool logWarning = true; +bool logTriangles = false; +bool logMatrix = false; +bool logVertex = false; +bool logTextures = false; +bool logTextureBuffer = false; +bool logToScreen = true; +bool logToFile = false; +bool logUcodes = false; +bool logMicrocode = false; +bool logFog = false; +bool logDetails = false; + +FILE *logFp = NULL; + +bool debuggerEnableTexture=true; +bool debuggerEnableZBuffer=true; +bool debuggerEnableCullFace=true; +bool debuggerEnableTestTris=true; +bool debuggerEnableAlphaTest=true; +bool debuggerContinueWithUnknown=false; + +bool debuggerPause = false; +bool pauseAtNext = true; +int eventToPause = NEXT_FRAME; +int debuggerPauseCount = 340; +int countToPause = 1; + +bool debuggerDropCombiners=false; +bool debuggerDropGeneralCombiners=false; +bool debuggerDropDecodedMux=false; +bool debuggerDropCombinerInfos=false; + +char msgBuf[0x20000+2]; +bool msgBufUpdated = false; +extern FiddledVtx * g_pVtxBase; + +uint32 CachedTexIndex = 0; + +const char* otherNexts[] = { + "Frame", + "Flush Tri", + "TextRect", + "Triangle", + "Set CImg", + "ObjTxt Cmd", + "Obj BG", + "Sprite2D", + "FillRect", + "DList", + "Ucode", + "Texture Buffer", + "Matrix Cmd", + "Vertex Cmd", + "New Texture", + "Set Texture", + "Mux", + "Set Light", + "Set Mode Cmd", + "Set Prim Color", + "Texture Cmd", + "Unknown Ops", + "Scale Image", + "LoadTlut", + "Ucode Switching", +}; +int numberOfNextOthers = sizeof(otherNexts)/sizeof(char*); + +const char* thingsToDump[] = { + "Cur Texture RGBA", + "Cur+1 Texture RGBA", + "Colors", + "Memory At", + "Mux", + "Simple Mux", + "Other Modes", + "Texture #", + "Tile #", + "VI Regs", + "Cur Txt to file", + "Cur+1 Txt to file", + "Cur Texture RGB", + "Cur Texture Alpha", + "Cur+1 Texture RGB", + "Cur+1 Texture Alpha", + "Light Info", + "Tlut", + "Obj Tlut", + "Vertexes", + "Cached Texture", + "Next Texture", + "Prev Texture", + "Dlist At", + "Matrix At", + "Combined Matrix", + "World Top Matrix", + "Projection Matrix", + "World Matrix #", + "Frame Buffer in RDRAM", + "BackBuffer", + "TexBuffer #", +}; +int numberOfThingsToDump = sizeof(thingsToDump)/sizeof(char*); + +enum { + DUMP_CUR_TEXTURE_RGBA, + DUMP_CUR_1_TEXTURE_RGBA, + DUMP_COLORS, + DUMP_CONTENT_AT, + DUMP_CUR_MUX, + DUMP_SIMPLE_MUX, + DUMP_OTHER_MODE, + DUMP_TEXTURE_AT, + DUMP_TILE_AT, + DUMP_VI_REGS, + DUMP_CUR_TEXTURE_TO_FILE, + DUMP_CUR_1_TEXTURE_TO_FILE, + DUMP_CUR_TEXTURE_RGB, + DUMP_CUR_TEXTURE_ALPHA, + DUMP_CUR_1_TEXTURE_RGB, + DUMP_CUR_1_TEXTURE_ALPHA, + DUMP_LIGHT, + DUMP_TLUT, + DUMP_OBJ_TLUT, + DUMP_VERTEXES, + DUMP_CACHED_TEX, + DUMP_NEXT_TEX, + DUMP_PREV_TEX, + DUMP_DLIST_AT, + DUMP_MATRIX_AT, + DUMP_COMBINED_MATRIX, + DUMP_WORLD_TOP_MATRIX, + DUMP_PROJECTION_MATRIX, + DUMP_WORLD_MATRIX_AT, + DUMP_FRAME_BUFFER, + DUMP_BACKBUFFER, + DUMP_TEXBUFFER_AT, +}; + +//--------------------------------------------------------------------- +void DumpVIRegisters(void) +{ + DebuggerAppendMsg("----VI Registers----\nSTATUS:\t%08X\nORIGIN:\t%08X\nWIDTH:\t%08X\n\ +V_SYNC:\t%08X\nH_SYNC:\t%08X\nX_SCALE:\t%08X\nY_SCALE:\t%08X\n\ +H_START:\t%08X\nV_START:\t%08X\nVI Width=%f(x %f), VI Height=%f(x %f)\n\n", + *g_GraphicsInfo.VI_STATUS_REG, *g_GraphicsInfo.VI_ORIGIN_REG, *g_GraphicsInfo.VI_WIDTH_REG, *g_GraphicsInfo.VI_V_SYNC_REG, + *g_GraphicsInfo.VI_H_SYNC_REG, *g_GraphicsInfo.VI_X_SCALE_REG, *g_GraphicsInfo.VI_Y_SCALE_REG, + *g_GraphicsInfo.VI_H_START_REG, *g_GraphicsInfo.VI_V_START_REG, windowSetting.fViWidth,windowSetting.fMultX, + windowSetting.fViHeight,windowSetting.fMultY); + DebuggerAppendMsg("Scissor: x0=%d y0=%d x1=%d y1=%d mode=%d", + gRDP.scissor.left, gRDP.scissor.top, + gRDP.scissor.right, gRDP.scissor.bottom, + gRDP.scissor.mode); + DebuggerAppendMsg("Effective scissor: x0=%d y0=%d x1=%d y1=%d", + gRSP.real_clip_scissor_left, gRSP.real_clip_scissor_top, + gRSP.real_clip_scissor_right, gRSP.real_clip_scissor_bottom); + DebuggerAppendMsg("Clipping: (%d) left=%f top=%f right=%f bottom=%f", + gRSP.clip_ratio_posx, gRSP.real_clip_ratio_negx , gRSP.real_clip_ratio_negy, + gRSP.real_clip_ratio_posx, gRSP.real_clip_ratio_posy); + DebuggerAppendMsg("Viewport: left=%d top=%d right=%d bottom=%d", + gRSP.nVPLeftN, gRSP.nVPTopN , gRSP.nVPRightN, + gRSP.nVPBottomN); + DebuggerAppendMsg("Current CImg: Addr=0x%08X, Fmt:%s-%sb, Width=%d\n", + g_CI.dwAddr, pszImgFormat[g_CI.dwFormat], pszImgSize[g_CI.dwSize], g_CI.dwWidth); + DebuggerAppendMsg("Current ZImg: Addr=0x%08X, Fmt:%s-%sb, Width=%d\n", + g_ZI.dwAddr, pszImgFormat[g_ZI.dwFormat], pszImgSize[g_ZI.dwSize], g_ZI.dwWidth); +} + +void DumpVertexArray(void) +{ + DebuggerAppendMsg("----Vertexes----\n"); + try + { + for( int i=0; i<32; i++ ) + { + FiddledVtx &v = g_pVtxBase[i]; + DebuggerAppendMsg("[%d] x=%d,y=%d,z=%d -- r=%d,g=%d,b=%d,a=%d\n", i, v.x, v.y, v.z, + v.rgba.r, v.rgba.g, v.rgba.b, v.rgba.a); + DebuggerAppendMsg("\tx=%f,y=%f,z=%f,rhw=%f\n", g_vecProjected[i].x, g_vecProjected[i].y, g_vecProjected[i].z, g_vecProjected[i].w); + } + } + catch(...) + { + DebuggerAppendMsg("Invalid memory pointer of vertex array\n"); + } +} + +void DumpHex(uint32 rdramAddr, int count); +uint32 StrToHex(char *HexStr); + +void DumpTileInfo(uint32 dwTile) +{ + const char *pszOnOff[2] = {"Off", "On"}; + + DebuggerAppendMsg("Tile: %d\nFmt: %s/%s Line:%d (Pitch %d) TMem:0x%04x Palette:%d\n", + dwTile, pszImgFormat[gRDP.tiles[dwTile].dwFormat], pszImgSize[gRDP.tiles[dwTile].dwSize], + gRDP.tiles[dwTile].dwLine, gRDP.tiles[dwTile].dwPitch, gRDP.tiles[dwTile].dwTMem, gRDP.tiles[dwTile].dwPalette); + DebuggerAppendMsg("S: Clamp: %s Mirror:%s Mask:0x%x Shift:0x%x\n", + pszOnOff[gRDP.tiles[dwTile].bClampS],pszOnOff[gRDP.tiles[dwTile].bMirrorS], + gRDP.tiles[dwTile].dwMaskS, gRDP.tiles[dwTile].dwShiftS); + DebuggerAppendMsg("T: Clamp: %s Mirror:%s Mask:0x%x Shift:0x%x\n", + pszOnOff[gRDP.tiles[dwTile].bClampT],pszOnOff[gRDP.tiles[dwTile].bMirrorT], + gRDP.tiles[dwTile].dwMaskT, gRDP.tiles[dwTile].dwShiftT); + DebuggerAppendMsg("(%d,%d) -> (%d,%d), hilite [%d, %d]\n", + gRDP.tiles[dwTile].sl, gRDP.tiles[dwTile].tl, gRDP.tiles[dwTile].sh, gRDP.tiles[dwTile].th, + gRDP.tiles[dwTile].hilite_sl,gRDP.tiles[dwTile].hilite_tl); +} + +void DumpTexture(int tex, TextureChannel channel = TXT_RGB ) +{ + CRender::GetRender()->DrawTexture(tex, channel); +} + +void DumpRenderTexture(int tex=-1) +{ + if( CDeviceBuilder::GetBuilder()->GetGeneralDeviceType() == DIRECTX_DEVICE ) + { + g_pFrameBufferManager->DisplayRenderTexture(tex); + } + else + { + debuggerDrawRenderTextureNo = tex; + debuggerDrawRenderTexture = true; + } +} + +void DumpTextureToFile(int tex, TextureChannel channel = TXT_RGB) +{ + CRender::GetRender()->SaveTextureToFile(tex, channel,false); +} + +void DumpTlut(uint16* palAddr) +{ + for( uint32 i=0; i<0x100; i+=8 ) + { + DebuggerAppendMsg("0x%4X 0x%4X 0x%4X 0x%4X 0x%4X 0x%4X 0x%4X 0x%4X ", + g_wRDPTlut[i], g_wRDPTlut[i+1], g_wRDPTlut[i+2], g_wRDPTlut[i+2], + g_wRDPTlut[i+4], g_wRDPTlut[i+5], g_wRDPTlut[i+6], g_wRDPTlut[i+7]); + } +} + +extern char ucodeNames_GBI1[256]; +extern char ucodeNames_GBI2[256]; + +void DumpDlistAt(uint32 dwPC) +{ + uint32 word0, word1, opcode; + char *name; + switch( gRSP.ucode ) + { + case 2: + case 10: + //case 8: + name=ucodeNames_GBI2; + break; + default: + name=ucodeNames_GBI1; + } + + DebuggerAppendMsg("\n\n"); + //if( dwPC>100 ) dwPC -= 40; + for( uint32 i=0; i<20; i++) + { + word0 = g_pRDRAMu32[(dwPC>>2)+0]; + word1 = g_pRDRAMu32[(dwPC>>2)+1]; + opcode = word0>>24; + DebuggerAppendMsg("%08X: %08X, %08X - %s", dwPC, word0, word1, name[opcode] ); + dwPC+=8; + } + DebuggerAppendMsg("\n\n"); +} + +void DumpMatrixAt(uint32 dwPC) +{ + Matrix mat; + const float fRecip = 1.0f / 65536.0f; + + for (uint32 dwI = 0; dwI < 4; dwI++) + { + for (uint32 dwJ = 0; dwJ < 4; dwJ++) + { + int nDataHi = *(short *)(g_pRDRAMu8 + ((dwPC+(dwI<<3)+(dwJ<<1) )^0x2)); + int nDataLo = *(uint16 *)(g_pRDRAMu8 + ((dwPC+(dwI<<3)+(dwJ<<1) + 32)^0x2)); + mat.m[dwI][dwJ] = (float)((nDataHi << 16) | nDataLo) * fRecip; + } + } + + TRACE0("Dump Matrix in Memory"); + DebuggerAppendMsg( + " %#+12.5f %#+12.5f %#+12.5f %#+12.5f\n" + " %#+12.5f %#+12.5f %#+12.5f %#+12.5f\n" + " %#+12.5f %#+12.5f %#+12.5f %#+12.5f\n" + " %#+12.5f %#+12.5f %#+12.5f %#+12.5f\n", + mat.m[0][0], mat.m[0][1], mat.m[0][2], mat.m[0][3], + mat.m[1][0], mat.m[1][1], mat.m[1][2], mat.m[1][3], + mat.m[2][0], mat.m[2][1], mat.m[2][2], mat.m[2][3], + mat.m[3][0], mat.m[3][1], mat.m[3][2], mat.m[3][3]); +} + +// High +static const char *alphadithertypes[4] = {"Pattern", "NotPattern", "Noise", "Disable"}; +static const char *rgbdithertype[4] = {"MagicSQ", "Bayer", "Noise", "Disable"}; +static const char *convtype[8] = {"Conv", "?", "?", "?", "?", "FiltConv", "Filt", "?"}; +static const char *filtertype[4] = {"Point", "?", "Bilinear", "Average"}; +static const char *cycletype[4] = {"1Cycle", "2Cycle", "Copy", "Fill"}; +static const char *alphacomptype[4] = {"None", "Threshold", "?", "Dither"}; +static const char * szCvgDstMode[4] = { "Clamp", "Wrap", "Full", "Save" }; +static const char * szZMode[4] = { "Opa", "Inter", "XLU", "Decal" }; +static const char * szZSrcSel[2] = { "Pixel", "Primitive" }; +static const char * sc_szBlClr[4] = { "In", "Mem", "Bl", "Fog" }; +static const char * sc_szBlA1[4] = { "AIn", "AFog", "AShade", "0" }; +static const char * sc_szBlA2[4] = { "1-A", "AMem", "1", "0" }; + +void DumpOtherMode() +{ + uint16 blender = gRDP.otherMode.blender; + RDP_BlenderSetting &bl = *(RDP_BlenderSetting*)(&(blender)); + DebuggerAppendMsg( "Other Modes"); + DebuggerAppendMsg( "\talpha_compare:\t%s", alphacomptype[ gRDP.otherMode.alpha_compare ]); + DebuggerAppendMsg( "\tdepth_source:\t%s", szZSrcSel[ gRDP.otherMode.depth_source ]); + DebuggerAppendMsg( "\taa_en:\t\t%d", gRDP.otherMode.aa_en ); + DebuggerAppendMsg( "\tz_cmp:\t\t%d", gRDP.otherMode.z_cmp ); + DebuggerAppendMsg( "\tz_upd:\t\t%d", gRDP.otherMode.z_upd ); + DebuggerAppendMsg( "\tim_rd:\t\t%d", gRDP.otherMode.im_rd ); + DebuggerAppendMsg( "\tclr_on_cvg:\t%d", gRDP.otherMode.clr_on_cvg ); + DebuggerAppendMsg( "\tcvg_dst:\t\t%s", szCvgDstMode[ gRDP.otherMode.cvg_dst ] ); + DebuggerAppendMsg( "\tzmode:\t\t%s", szZMode[ gRDP.otherMode.zmode ] ); + DebuggerAppendMsg( "\tcvg_x_alpha:\t%d", gRDP.otherMode.cvg_x_alpha ); + DebuggerAppendMsg( "\talpha_cvg_sel:\t%d", gRDP.otherMode.alpha_cvg_sel ); + DebuggerAppendMsg( "\tforce_bl:\t\t%d", gRDP.otherMode.force_bl ); + DebuggerAppendMsg( "\ttex_edge:\t\t%d", gRDP.otherMode.tex_edge ); + DebuggerAppendMsg( "\tblender:\t\t%04x - Cycle1:\t%s * %s + %s * %s\n\t\t\tCycle2:\t%s * %s + %s * %s", gRDP.otherMode.blender, + sc_szBlClr[bl.c1_m1a], sc_szBlA1[bl.c1_m1b], sc_szBlClr[bl.c1_m2a], sc_szBlA2[bl.c1_m2b], + sc_szBlClr[bl.c2_m1a], sc_szBlA1[bl.c2_m1b], sc_szBlClr[bl.c2_m2a], sc_szBlA2[bl.c2_m2b]); + DebuggerAppendMsg( "\tblend_mask:\t%d", gRDP.otherMode.blend_mask ); + DebuggerAppendMsg( "\talpha_dither:\t%s", alphadithertypes[ gRDP.otherMode.alpha_dither ] ); + DebuggerAppendMsg( "\trgb_dither:\t\t%s", rgbdithertype[ gRDP.otherMode.rgb_dither ] ); + DebuggerAppendMsg( "\tcomb_key:\t%s", gRDP.otherMode.key_en ? "Key" : "None" ); + DebuggerAppendMsg( "\ttext_conv:\t\t%s", convtype[ gRDP.otherMode.text_conv ] ); + DebuggerAppendMsg( "\ttext_filt:\t\t%s", filtertype[ gRDP.otherMode.text_filt ] ); + DebuggerAppendMsg( "\ttext_tlut:\t\t%s", textluttype[ gRDP.otherMode.text_tlut ] ); + DebuggerAppendMsg( "\ttext_lod:\t\t%s", gRDP.otherMode.text_lod ? "Yes": "No" ); + DebuggerAppendMsg( "\ttext_detail:\t\t%s", gRDP.otherMode.text_detail ? "Yes": "No" ); + DebuggerAppendMsg( "\ttext_sharpen:\t\t%s", gRDP.otherMode.text_sharpen ? "Yes": "No" ); + DebuggerAppendMsg( "\ttext_persp:\t%s", gRDP.otherMode.text_persp ? "On" : "Off" ); + DebuggerAppendMsg( "\tcycle_type:\t%s", cycletype[ gRDP.otherMode.cycle_type ] ); + DebuggerAppendMsg( "\tpipeline:\t\t%s", gRDP.otherMode.atomic_prim ? "1Primitive" : "NPrimitive" ); + + DebuggerAppendMsg("\n\nSP render flags:"); + DebuggerAppendMsg("\tCull mode: %s%s", gRSP.bCullFront?"Cull Front":"", gRSP.bCullBack?" Cull Back":""); + DebuggerAppendMsg("\tShade mode: %d", gRSP.shadeMode); + DebuggerAppendMsg("\tFog: %s", gRSP.bFogEnabled?"enabled":"disabled"); + DebuggerAppendMsg("\tZbuffer in SP: %s", gRSP.bZBufferEnabled?"enabled":"disabled"); + DebuggerAppendMsg("\tLighting: %s", gRSP.bLightingEnable?"enabled":"disabled"); + DebuggerAppendMsg("\\Number of lights: %d", gRSPnumLights); + DebuggerAppendMsg("\tTexture Gen: %s", gRSP.bTextureGen?"enabled":"disabled"); + DebuggerAppendMsg("\tTexture Gen Linear: %s", (gRDP.geometryMode & G_TEXTURE_GEN_LINEAR)?"enabled":"disabled"); +} + +void DumpCachedTexture(uint32 index) +{ + TxtrCacheEntry *p = gTextureManager.GetCachedTexture(index); + if( p != NULL ) + { + char filename[80]; + sprintf(filename,"\\Texture%d_rgb", index); + CRender::GetRender()->SaveTextureToFile(*(p->pTexture), filename, TXT_RGB); + DebuggerAppendMsg("Display cached texture #%d of %d\n", index, gTextureManager.GetNumOfCachedTexture()); + DebuggerAppendMsg("W:%d, H:%d, RealW:%d, RealH:%d, D3DW:%d, D3DH: %d", p->ti.WidthToCreate, p->ti.HeightToCreate, + p->ti.WidthToLoad, p->ti.HeightToLoad, p->pTexture->m_dwCreatedTextureWidth, p->pTexture->m_dwCreatedTextureHeight); + DebuggerAppendMsg("ScaledS:%s, ScaledT:%s", p->pTexture->m_bScaledS?"T":"F", p->pTexture->m_bScaledT?"T":"F"); + } + else + { + DebuggerAppendMsg("No cached texture at index = %d\n", index); + } +} + +extern uint32 gObjTlutAddr; +void DumpInfo(int thingToDump) +{ + switch(thingToDump) + { + case DUMP_COLORS: + DebuggerAppendMsg("----Colors----\nPrim Color:\t%08X\nEnv Color:\t%08X\n" + "Fill Color:\t%08X\nFog Color:\t%08X\n" + "Prim Depth:\t%f\nPrim LOD Frac:\t%08X\n", + GetPrimitiveColor(), GetEnvColor(), gRDP.fillColor, + CRender::GetRender()->GetFogColor(), GetPrimitiveDepth(), GetLODFrac()); + break; + case DUMP_CUR_MUX: + CRender::GetRender()->m_pColorCombiner->DisplayMuxString(); + break; + case DUMP_LIGHT: + DebuggerAppendMsg("----Light Colors----\nNumber of Lights: %d\n",GetNumLights()); + for( uint32 i=0; im_pColorCombiner->DisplaySimpleMuxString(); + break; + case DUMP_OTHER_MODE: + DumpOtherMode(); + break; + case DUMP_FRAME_BUFFER: + CRender::GetRender()->DrawFrameBuffer(true); + break; + case DUMP_CONTENT_AT: + { + } + break; + case DUMP_DLIST_AT: + { + } + break; + case DUMP_MATRIX_AT: + { + } + break; + case DUMP_NEXT_TEX: + CachedTexIndex++; + if( CachedTexIndex >= gTextureManager.GetNumOfCachedTexture() ) + { + CachedTexIndex = 0; + } + DumpCachedTexture(CachedTexIndex); + break; + case DUMP_PREV_TEX: + CachedTexIndex--; + if( CachedTexIndex < 0 || CachedTexIndex >= gTextureManager.GetNumOfCachedTexture() ) + CachedTexIndex = 0; + DumpCachedTexture(CachedTexIndex); + break; + case DUMP_CACHED_TEX: + DumpCachedTexture(CachedTexIndex); + break; + case DUMP_TEXBUFFER_AT: + { + } + break; + case DUMP_COMBINED_MATRIX: + DumpMatrix2(gRSPworldProject,"Combined Matrix"); + break; + case DUMP_WORLD_TOP_MATRIX: + DumpMatrix2(gRSP.modelviewMtxs[gRSP.modelViewMtxTop],"World Top Matrix"); + break; + case DUMP_WORLD_MATRIX_AT: + { + } + break; + case DUMP_PROJECTION_MATRIX: + DumpMatrix2(gRSP.projectionMtxs[gRSP.projectionMtxTop],"Projection Top Matrix"); + break; + } +} + + +void SetLogToFile(bool log) +{ + if( log ) + { + if( logFp == NULL ) + { + logFp = fopen("\\RiceVideo.log", "at"); + } + } + else + { + if( logFp != NULL ) + { + fclose(logFp); + logFp = NULL; + } + } +} + + +void __cdecl DebuggerAppendMsg(const char * Message, ...) +{ + if( !logToScreen && !logToFile ) + return; + + char Msg[5000]; + va_list ap; + + va_start( ap, Message ); + vsprintf( Msg, Message, ap ); + va_end( ap ); + + if( Msg[strlen(Msg)-1]!='\n' ) strcat(Msg,"\n"); + + if( logToScreen ) + { + DebugMessage(M64MSG_INFO, "Rice Debug: %s", Msg); + } + + if( logToFile ) + { + fprintf(logFp, "%s\n", Msg); + } +} + + +void DebuggerPause() +{ + while( debuggerPause ) + { + if( debuggerDrawRenderTexture ) + { + g_pFrameBufferManager->DisplayRenderTexture(debuggerDrawRenderTextureNo); + debuggerDrawRenderTexture = false; + } + usleep(100 * 1000); + debuggerPause = false; + } +} + +void __cdecl LOG_UCODE(const char* szFormat, ...) +{ + if( logUcodes) + { + char Msg[400]; + va_list va; + va_start(va, szFormat); + vsprintf( Msg, szFormat, va ); + va_end(va); + DebuggerAppendMsg("%s\n", Msg); + } +} + +void DumpHex(uint32 rdramAddr, int count) +{ + rdramAddr &= 0xFFFFFFF0; + uint32 *ptr = (uint32 *)((rdramAddr&(g_dwRamSize-1))+g_pRDRAMu8); + + for( int i=0; i<(count+3)/4; i++) + { + DebuggerAppendMsg("%08X: %08X, %08X, %08X, %08X\n", + rdramAddr+i*16, ptr[i*4], ptr[i*4+1], ptr[i*4+2], ptr[i*4+3]); + } + DebuggerAppendMsg("\n"); +} + +uint32 StrToHex(char *HexStr) +{ + uint32 temp = 0; + + for(uint32 k = 0; k < strlen(HexStr); k++) + { + if(HexStr[k] <= '9' && HexStr[k] >= '0') + { + temp = temp << 4; + temp += HexStr[k] - '0'; + } + else if(HexStr[k] <= 'F' && HexStr[k] >= 'A') + { + temp = temp << 4; + temp += HexStr[k] - 'A' + 10; + } + else if(HexStr[k] <= 'f' && HexStr[k] >= 'a') + { + temp = temp << 4; + temp += HexStr[k] - 'a' + 10; + } + else + { + return(temp); + } + } + + return(temp); +} + +void DEBUGGER_PAUSE_COUNT_N(uint32 val) +{ + if (eventToPause == (int)val) + { + if(debuggerPauseCount>0) + debuggerPauseCount--; + if(debuggerPauseCount==0) + { + CGraphicsContext::Get()->UpdateFrame(); + debuggerPause = true; + } + } +} + +void DEBUGGER_PAUSE_COUNT_N_WITHOUT_UPDATE(uint32 val) +{ + if(eventToPause == (int)val) + { + if(debuggerPauseCount>0) + debuggerPauseCount--; + if(debuggerPauseCount==0) + { + debuggerPauseCount = countToPause; + debuggerPause = true; + } + } +} + +void DumpMatrix2(const Matrix &mat, const char* prompt) +{ + DebuggerAppendMsg(prompt); + DebuggerAppendMsg( + " %#+12.5f %#+12.5f %#+12.5f %#+12.5f\n" + " %#+12.5f %#+12.5f %#+12.5f %#+12.5f\n" + " %#+12.5f %#+12.5f %#+12.5f %#+12.5f\n" + " %#+12.5f %#+12.5f %#+12.5f %#+12.5f\n", + mat.m[0][0], mat.m[0][1], mat.m[0][2], mat.m[0][3], + mat.m[1][0], mat.m[1][1], mat.m[1][2], mat.m[1][3], + mat.m[2][0], mat.m[2][1], mat.m[2][2], mat.m[2][3], + mat.m[3][0], mat.m[3][1], mat.m[3][2], mat.m[3][3]); +} + +void DumpMatrix(const Matrix &mat, const char* prompt) +{ + if( pauseAtNext && logMatrix ) + { + DumpMatrix2(mat, prompt); + } +} + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/Debugger.h b/libmupen64plus/mupen64plus-video-rice/src/Debugger.h new file mode 100644 index 0000000000..04c44b414d --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/Debugger.h @@ -0,0 +1,197 @@ +/* +Copyright (C) 2002 Rice1964 + +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. + +*/ + +#if !defined(DEBUGGER_H) +#define DEBUGGER_H + +#include "typedefs.h" + +#if defined(DEBUGGER) + +// Debugger.h : header file +// + +///////////////////////////////////////////////////////////////////////////// +// CDebugger dialog +extern bool debuggerWinOpened; + +extern bool logCombiners; +extern bool logTriangles; +extern bool logVertex; +extern bool logWarning; +extern bool logTextures; +extern bool logTextureBuffer; +extern bool logMatrix; +extern bool logToScreen; +extern bool logToFile; +extern bool logUcodes; +extern bool logMicrocode; +extern bool logFog; +extern bool logDetails; + + +extern bool debuggerEnableTexture; +extern bool debuggerEnableZBuffer; +extern bool debuggerEnableCullFace; +extern bool debuggerEnableTestTris; +extern bool debuggerEnableAlphaTest; +extern bool debuggerContinueWithUnknown; + +extern bool debuggerPause; +extern bool pauseAtNext; +extern int eventToPause; +extern int debuggerPauseCount; +extern int countToPause; + +extern bool debuggerDropCombiners; +extern bool debuggerDropGeneralCombiners; +extern bool debuggerDropDecodedMux; +extern bool debuggerDropCombinerInfos; + +enum { + NEXT_FRAME, + NEXT_FLUSH_TRI, + NEXT_TEXTRECT, + NEXT_TRIANGLE, + NEXT_SET_CIMG, + NEXT_OBJ_TXT_CMD, + NEXT_OBJ_BG, + NEXT_SPRITE_2D, + NEXT_FILLRECT, + NEXT_DLIST, + NEXT_UCODE, + NEXT_RENDER_TEXTURE, + NEXT_MATRIX_CMD, + NEXT_VERTEX_CMD, + NEXT_NEW_TEXTURE, + NEXT_SET_TEXTURE, + NEXT_MUX, + NEXT_SET_LIGHT, + NEXT_SET_MODE_CMD, + NEXT_SET_PRIM_COLOR, + NEXT_TEXTURE_CMD, + NEXT_UNKNOWN_OP, + NEXT_SCALE_IMG, + NEXT_LOADTLUT, + NEXT_SWITCH_UCODE, +}; + +void DebuggerPause(); +void __cdecl DebuggerAppendMsg(const char * Message, ...); +void DumpHex(uint32 rdramAddr, int count); + +void DumpMatrix(const Matrix &mtx, const char* prompt); + +//Some common used macros +#define DEBUG_DUMP_VERTEXES(str, v0, v1, v2) \ + if( (pauseAtNext && (eventToPause == NEXT_TRIANGLE || eventToPause == NEXT_FLUSH_TRI)) && logTriangles ) \ + { \ + DebuggerAppendMsg("%s:%d(%08X),%d(%08X),%d(%08X)\n", (str),\ + (v0), GetVertexDiffuseColor((v0)), \ + (v1), GetVertexDiffuseColor((v1)), \ + (v2), GetVertexDiffuseColor((v2))); \ + } + +#define DEBUGGER_IF(op) if(op) +#define DEBUGGER_PAUSE(op) if(pauseAtNext && eventToPause == op){pauseAtNext = false;CGraphicsContext::Get()->UpdateFrame(); debuggerPause = true;} +extern void DEBUGGER_PAUSE_COUNT_N(uint32 event); +extern void DEBUGGER_PAUSE_COUNT_N_WITHOUT_UPDATE(uint32 val); +#define DebuggerPauseCountN DEBUGGER_PAUSE_COUNT_N +#define DEBUGGER_PAUSE_AND_DUMP(op,dumpfuc) \ + if(pauseAtNext && eventToPause == op) \ + { pauseAtNext = false;debuggerPause = true; CGraphicsContext::Get()->UpdateFrame(); dumpfuc;} +#define DEBUGGER_PAUSE_AND_DUMP_NO_UPDATE(op,dumpfuc) \ + if(pauseAtNext && eventToPause == op) \ + { pauseAtNext = false;debuggerPause = true; dumpfuc;} + +#define DEBUGGER_PAUSE_AND_DUMP_COUNT_N(op,dumpfuc) \ + if(pauseAtNext && eventToPause == op) \ +{ if( debuggerPauseCount > 0 ) debuggerPauseCount--; if( debuggerPauseCount == 0 ){pauseAtNext = false;debuggerPause = true; CGraphicsContext::Get()->UpdateFrame(); dumpfuc;}} + +#define DEBUGGER_PAUSE_AT_COND_AND_DUMP_COUNT_N(cond,dumpfuc) \ + if(pauseAtNext && (cond) ) \ +{ if( debuggerPauseCount > 0 ) debuggerPauseCount--; if( debuggerPauseCount == 0 ){pauseAtNext = false;debuggerPause = true; CGraphicsContext::Get()->UpdateFrame(); dumpfuc;}} + +void RDP_NOIMPL_Real(const char* op,uint32,uint32) ; +#define RSP_RDP_NOIMPL RDP_NOIMPL_Real +#define DEBUGGER_IF_DUMP(cond, dumpfunc) {if(cond) {dumpfunc}} +#define TXTRBUF_DUMP(dumpfunc) DEBUGGER_IF_DUMP((logTextureBuffer), dumpfunc) +#define TXTRBUF_DETAIL_DUMP(dumpfunc) DEBUGGER_IF_DUMP((logTextureBuffer&&logDetails), dumpfunc) +#define TXTRBUF_OR_CI_DUMP(dumpfunc) DEBUGGER_IF_DUMP((logTextureBuffer || (pauseAtNext && eventToPause == NEXT_SET_CIMG)), dumpfunc) +#define TXTRBUF_OR_CI_DETAIL_DUMP(dumpfunc) DEBUGGER_IF_DUMP(((logTextureBuffer || (pauseAtNext && eventToPause == NEXT_SET_CIMG))&&logDetails), dumpfunc) +#define VTX_DUMP(dumpfunc) DEBUGGER_IF_DUMP((logVertex && pauseAtNext), dumpfunc) +#define TRI_DUMP(dumpfunc) DEBUGGER_IF_DUMP((logTriangles && pauseAtNext), dumpfunc) +#define LIGHT_DUMP(dumpfunc) DEBUGGER_IF_DUMP((eventToPause == NEXT_SET_LIGHT && pauseAtNext), dumpfunc) +#define WARNING(dumpfunc) DEBUGGER_IF_DUMP(logWarning, dumpfunc) +#define FOG_DUMP(dumpfunc) DEBUGGER_IF_DUMP(logFog, dumpfunc) +#define LOG_TEXTURE(dumpfunc) DEBUGGER_IF_DUMP((logTextures || (pauseAtNext && eventToPause==NEXT_TEXTURE_CMD) ), dumpfunc) +#define DEBUGGER_ONLY_IF DEBUGGER_IF_DUMP +#define DEBUGGER_ONLY(func) {func} + +#define TRACE0(arg0) {DebuggerAppendMsg(arg0);} +#define TRACE1(arg0,arg1) {DebuggerAppendMsg(arg0,arg1);} +#define TRACE2(arg0,arg1,arg2) {DebuggerAppendMsg(arg0,arg1,arg2);} +#define TRACE3(arg0,arg1,arg2,arg3) {DebuggerAppendMsg(arg0,arg1,arg2,arg3);} +#define TRACE4(arg0,arg1,arg2,arg3,arg4) {DebuggerAppendMsg(arg0,arg1,arg2,arg3,arg4);} +#define TRACE5(arg0,arg1,arg2,arg3,arg4,arg5) {DebuggerAppendMsg(arg0,arg1,arg2,arg3,arg4,arg5);} + +#define DEBUG_TRIANGLE(dumpfunc) { if(pauseAtNext && eventToPause==NEXT_TRIANGLE ) { eventToPause = NEXT_FLUSH_TRI; debuggerPause = true; DEBUGGER_PAUSE(NEXT_FLUSH_TRI); dumpfunc} } + +#else +#define DEBUG_DUMP_VERTEXES(str, v0, v1, v2) +#define DEBUGGER_IF(op) +#define DEBUGGER_PAUSE(op) +#define DEBUGGER_PAUSE_COUNT_N(op) +#define DEBUGGER_PAUSE_AND_DUMP(op,dumpfuc) +#define DebuggerPauseCountN DEBUGGER_PAUSE_COUNT_N +#define DEBUGGER_PAUSE_AT_COND_AND_DUMP_COUNT_N(cond,dumpfuc) +#define DEBUGGER_PAUSE_AND_DUMP_COUNT_N(op,dumpfuc) +#define DEBUGGER_PAUSE_COUNT_N_WITHOUT_UPDATE(op) +#define DEBUGGER_PAUSE_AND_DUMP_NO_UPDATE(op,dumpfuc) +#define RSP_RDP_NOIMPL(a,b,c) +void __cdecl DebuggerAppendMsg(const char * Message, ...); +#define DumpHex(rdramAddr, count) +#define DEBUGGER_IF_DUMP(cond, dumpfunc) +#define TXTRBUF_DUMP(dumpfunc) +#define TXTRBUF_DETAIL_DUMP(dumpfunc) +#define TXTRBUF_OR_CI_DUMP(dumpfunc) +#define TXTRBUF_OR_CI_DETAIL_DUMP(dumpfunc) +#define VTX_DUMP(dumpfunc) +#define TRI_DUMP(dumpfunc) +#define LIGHT_DUMP(dumpfunc) +#define WARNING(dumpfunc) +#define FOG_DUMP(dumpfunc) +#define LOG_TEXTURE(dumpfunc) +#define DEBUGGER_ONLY_IF DEBUGGER_IF_DUMP +#define DEBUGGER_ONLY(func) +#define DumpMatrix(a,b) + +#define TRACE0(arg0) {} +#define TRACE1(arg0,arg1) {} +#define TRACE2(arg0,arg1,arg2) {} +#define TRACE3(arg0,arg1,arg2,arg3) {} +#define TRACE4(arg0,arg1,arg2,arg3,arg4) {} +#define TRACE5(arg0,arg1,arg2,arg3,arg4,arg5) {} + +#define DEBUG_TRIANGLE(arg0) {} + +#endif + +#endif // !defined(DEBUGGER_H) + diff --git a/libmupen64plus/mupen64plus-video-rice/src/DecodedMux.cpp b/libmupen64plus/mupen64plus-video-rice/src/DecodedMux.cpp new file mode 100644 index 0000000000..f776c19a12 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/DecodedMux.cpp @@ -0,0 +1,1559 @@ +/* +Copyright (C) 2002 Rice1964 + +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. +*/ + +#include + +#include "GeneralCombiner.h" +#include "Combiner.h" +#include "Config.h" +#include "RenderBase.h" + +#define ALLOW_USE_TEXTURE_FOR_CONSTANTS + +static const uint8 sc_Mux32[32] = +{ + MUX_COMBINED, MUX_TEXEL0, MUX_TEXEL1, MUX_PRIM, + MUX_SHADE, MUX_ENV, MUX_1, MUX_COMBINED|MUX_ALPHAREPLICATE, + MUX_TEXEL0|MUX_ALPHAREPLICATE, MUX_TEXEL1|MUX_ALPHAREPLICATE, MUX_PRIM|MUX_ALPHAREPLICATE, MUX_SHADE|MUX_ALPHAREPLICATE, + MUX_ENV|MUX_ALPHAREPLICATE, MUX_LODFRAC, MUX_PRIMLODFRAC, MUX_K5, // Actually k5 + MUX_UNK, MUX_UNK, MUX_UNK, MUX_UNK, + MUX_UNK, MUX_UNK, MUX_UNK, MUX_UNK, + MUX_UNK, MUX_UNK, MUX_UNK, MUX_UNK, + MUX_UNK, MUX_UNK, MUX_UNK, MUX_0 +}; + +static const uint8 sc_Mux16[16] = +{ + MUX_COMBINED, MUX_TEXEL0, MUX_TEXEL1, MUX_PRIM, + MUX_SHADE, MUX_ENV, MUX_1, MUX_COMBALPHA, + MUX_TEXEL0|MUX_ALPHAREPLICATE, MUX_TEXEL1|MUX_ALPHAREPLICATE, MUX_PRIM|MUX_ALPHAREPLICATE, MUX_SHADE|MUX_ALPHAREPLICATE, + MUX_ENV|MUX_ALPHAREPLICATE, MUX_LODFRAC, MUX_PRIMLODFRAC, MUX_0 +}; +static const uint8 sc_Mux8[8] = +{ + MUX_COMBINED, MUX_TEXEL0, MUX_TEXEL1, MUX_PRIM, + MUX_SHADE, MUX_ENV, MUX_1, MUX_0 +}; + + +const char * translatedCombTypes[] = +{ + "0", + "1", + "COMBINED", + "TEXEL0", + "TEXEL1", + "PRIM", + "SHADE", + "ENV", + "COMBALPHA", + "T0_ALPHA_wrong", + "T1_ALPHA_wrong", + "PRIM_ALPHA_wrong", + "SHADE_ALPHA_wrong", + "ENV_ALPHA_wrong", + "LODFRAC", + "PRIMLODFRAC", + "K5", + "UNK", + "FACTOR_PRIM_MINUS_ENV", + "FACTOR_ENV_MINUS_PRIM", + "FACTOR_1_MINUS_PRIM", + "FACTOR_0_MINUS_PRIM", + "FACTOR_1_MINUS_ENV", + "FACTOR_0_MINUS_ENV", + "FACTOR_1_MINUS_PRIMALPHA", + "FACTOR_1_MINUS_ENVALPHA", + "FACTOR_HALF", + "PRIM_X_PRIMALPHA", + "1_MINUS_PRIM_X_ENV_PLUS_PRIM", + "ENV_X_PRIM", + "PRIM_X_1_MINUS_ENV", + "PRIM_X_PRIM", + "ENV_X_ENV", +}; + +const char* muxTypeStrs[] = { + "CM_FMT_TYPE_NOT_USED", + "CM_FMT_TYPE1_D", + "CM_FMT_TYPE2_A_ADD_D", + "CM_FMT_TYPE3_A_MOD_C", + "CM_FMT_TYPE4_A_SUB_B", + "CM_FMT_TYPE5_A_MOD_C_ADD_D", + "CM_FMT_TYPE6_A_LERP_B_C", + "CM_FMT_TYPE7_A_SUB_B_ADD_D", + "CM_FMT_TYPE8_A_SUB_B_MOD_C", + "CM_FMT_TYPE9_A_B_C_D", + "CM_FMT_TYPE_NOT_CHECKED", +}; + +void DecodedMux::Decode(uint32 dwMux0, uint32 dwMux1) +{ + m_dwMux0 = dwMux0; + m_dwMux1 = dwMux1; + + aRGB0 = uint8((dwMux0>>20)&0x0F); // c1 c1 // a0 + bRGB0 = uint8((dwMux1>>28)&0x0F); // c1 c2 // b0 + cRGB0 = uint8((dwMux0>>15)&0x1F); // c1 c3 // c0 + dRGB0 = uint8((dwMux1>>15)&0x07); // c1 c4 // d0 + + aA0 = uint8((dwMux0>>12)&0x07); // c1 a1 // Aa0 + bA0 = uint8((dwMux1>>12)&0x07); // c1 a2 // Ab0 + cA0 = uint8((dwMux0>>9 )&0x07); // c1 a3 // Ac0 + dA0 = uint8((dwMux1>>9 )&0x07); // c1 a4 // Ad0 + + aRGB1 = uint8((dwMux0>>5 )&0x0F); // c2 c1 // a1 + bRGB1 = uint8((dwMux1>>24)&0x0F); // c2 c2 // b1 + cRGB1 = uint8((dwMux0 )&0x1F); // c2 c3 // c1 + dRGB1 = uint8((dwMux1>>6 )&0x07); // c2 c4 // d1 + + aA1 = uint8((dwMux1>>21)&0x07); // c2 a1 // Aa1 + bA1 = uint8((dwMux1>>3 )&0x07); // c2 a2 // Ab1 + cA1 = uint8((dwMux1>>18)&0x07); // c2 a3 // Ac1 + dA1 = uint8((dwMux1 )&0x07); // c2 a4 // Ad1 + + //This fuction will translate the decode mux info further, so we can use + //the decode data better. + //Will translate A,B,C,D to unified presentation + aRGB0 = sc_Mux16[aRGB0]; + bRGB0 = sc_Mux16[bRGB0]; + cRGB0 = sc_Mux32[cRGB0]; + dRGB0 = sc_Mux8[dRGB0]; + + aA0 = sc_Mux8[aA0]; + bA0 = sc_Mux8[bA0]; + cA0 = sc_Mux8[cA0]; + dA0 = sc_Mux8[dA0]; + + aRGB1 = sc_Mux16[aRGB1]; + bRGB1 = sc_Mux16[bRGB1]; + cRGB1 = sc_Mux32[cRGB1]; + dRGB1 = sc_Mux8[dRGB1]; + + aA1 = sc_Mux8[aA1]; + bA1 = sc_Mux8[bA1]; + cA1 = sc_Mux8[cA1]; + dA1 = sc_Mux8[dA1]; + + m_bShadeIsUsed[1] = isUsedInAlphaChannel(MUX_SHADE); + m_bShadeIsUsed[0] = isUsedInColorChannel(MUX_SHADE); + m_bTexel0IsUsed = isUsed(MUX_TEXEL0); + m_bTexel1IsUsed = isUsed(MUX_TEXEL1); + + m_dwShadeColorChannelFlag = 0; + m_dwShadeAlphaChannelFlag = 0; + m_ColorTextureFlag[0] = 0; + m_ColorTextureFlag[1] = 0; +} + +int DecodedMux::Count(uint8 val, int cycle, uint8 mask) +{ + uint8* pmux = m_bytes; + int count=0; + int start=0; + int end=16; + + if( cycle >= 0 ) + { + start = cycle*4; + end = start+4; + } + + + for( int i=start; i=N64Cycle1RGB ) splitType[i] = CM_FMT_TYPE_NOT_USED; + } + else if( (m.b == MUX_0 && m.c == MUX_1 && m.d == MUX_0 ) || ( m.c == MUX_1 && m.b==m.d ) ) + { + splitType[i] = CM_FMT_TYPE_D; //All Type 1 will be changed to = D + m.d = m.a; + m.a = m.b = m.c = MUX_0; + if( m.d == MUX_COMBINED && i>=N64Cycle1RGB ) splitType[i] = CM_FMT_TYPE_NOT_USED; + } + else if( m.a == MUX_1 && m.b == MUX_0 && m.d == MUX_0 ) + { + splitType[i] = CM_FMT_TYPE_D; //All Type 1 will be changed to = D + m.d = m.c; + m.a = m.b = m.c = MUX_0; + if( m.d == MUX_COMBINED && i>=N64Cycle1RGB ) splitType[i] = CM_FMT_TYPE_NOT_USED; + } + else if( m.a == MUX_1 && m.c == MUX_1 && m.d == MUX_0 && do_complement ) + { + splitType[i] = CM_FMT_TYPE_D; //All Type 1 will be changed to = D + m.d = m.b^MUX_COMPLEMENT; + m.a = m.b = m.c = MUX_0; + if( m.d == MUX_COMBINED && i>=N64Cycle1RGB ) splitType[i] = CM_FMT_TYPE_NOT_USED; + } + + if( splitType[i] == CM_FMT_TYPE_NOT_USED ) + continue; + + if( splitType[i] == CM_FMT_TYPE_D ) + { + if( (i == N64Cycle0RGB || i == N64Cycle0Alpha) && splitType[i+2]!=CM_FMT_TYPE_NOT_USED ) //Cycle 1's Color or Alpha + { + uint8 saveD = m.d; + for( int j=0; j<4; j++ ) + { + if( (m_bytes[j+i*4+8]&MUX_MASK) == MUX_COMBINED ) + { + m_bytes[j+i*4+8] = saveD|(m_bytes[j+i*4+8]&0xC0); //Replace cycle's CMB with D from cycle 1 + } + } + m_dWords[i] = m_dWords[i+2]; + splitType[i+2]=CM_FMT_TYPE_NOT_USED; + m_dWords[i+2] = 0x02000000; + i=i-1; // Throw the first cycle result away, use 2nd cycle for the 1st cycle + // and then redo the 1st cycle + continue; + } + + if( (i==2 || i == 3) && (m.d&MUX_MASK) == MUX_COMBINED ) + { + splitType[i] = CM_FMT_TYPE_NOT_USED; + } + continue; + } + + + //Type 2: A+D ' ADD + //B=0, C=1 = A+D + //A=1, B=0 = C+D + splitType[i] = CM_FMT_TYPE_A_ADD_D; //All Type 2 will be changed to = A+D + if( m.b == MUX_0 && m.c == MUX_1 ) + { + if( m.d == MUX_TEXEL0 || m.d == MUX_TEXEL1 ) swap(m.a, m.d); + if( m.a == MUX_COMBINED ) swap(m.a, m.d); + continue; + } + + if( m.a == MUX_1 && m.b == MUX_0 ) + { + m.a = m.c; //Change format A+D + m.c = MUX_1; + if( m.d == MUX_TEXEL0 || m.d == MUX_TEXEL1 ) swap(m.a, m.d); + continue; + } + + + //Type 3: A*C + //B=0, D=0 = A*C + //A=1, D=0 = (1-A)*C + splitType[i] = CM_FMT_TYPE_A_MOD_C; //A*C + if( m.b == MUX_0 && m.d == MUX_0 ) + { + if( m.c == MUX_TEXEL0 || m.c == MUX_TEXEL1 ) swap(m.a, m.c); + if( m.a == MUX_COMBINED ) swap(m.a, m.c); + continue; + } + + if( m.a == MUX_1 && m.d == MUX_0 && do_complement ) + { + m.a = m.b^MUX_COMPLEMENT; + m.b = MUX_0; + if( m.c == MUX_TEXEL0 || m.c == MUX_TEXEL1 ) swap(m.a, m.c); + if( m.a == MUX_COMBINED ) swap(m.a, m.c); + continue; + } + + //Type 4: A-B ' SUB + //C=1, D=0 = A-B + splitType[i] = CM_FMT_TYPE_A_SUB_B; //A-B + if( m.c == MUX_1 && m.d == MUX_0 ) + { + continue; + } + + //Type 5: A*C+D , ' MULTIPLYADD + //B=0 = A*C+D + //A=1 = (1-B) * C + D + splitType[i] = CM_FMT_TYPE_A_MOD_C_ADD_D; + if( m.b == MUX_0 ) + { + if( m.c == MUX_TEXEL0 || m.c == MUX_TEXEL1 ) swap(m.a, m.c); + if( m.a == MUX_COMBINED ) swap(m.a, m.c); + continue; + } + + if( m.a == MUX_1 && m.b!=m.d && do_complement ) + { + m.a = m.b^MUX_COMPLEMENT; + m.b = MUX_0; + if( m.c == MUX_TEXEL0 || m.c == MUX_TEXEL1 ) swap(m.a, m.c); + if( m.a == MUX_COMBINED ) swap(m.a, m.c); + continue; + } + + //Type 6: (A-B)*C+B Map to LERP, or BLENDALPHA + //D==B + splitType[i] = CM_FMT_TYPE_A_LERP_B_C; + if( m.b == m.d ) + { + continue; + } + + + //Type 7: A-B+D + //C=1 = A-B+D + splitType[i] = CM_FMT_TYPE_A_SUB_B_ADD_D; + if( m.c == MUX_1 ) + { + if( m.c == MUX_TEXEL0 || m.c == MUX_TEXEL1 ) swap(m.a, m.c); + continue; + } + + //Type 8: (A-B)*C + splitType[i] = CM_FMT_TYPE_A_SUB_B_MOD_C; + if( m.d == MUX_0 ) + { + continue; + } + + if( m.c == m.d && do_complement ) // (A-B)*C+C ==> (A + B|C ) * C + { + m.d = MUX_0; + m.b |= MUX_COMPLEMENT; + continue; + } + + if( m.a == m.d ) + { + splitType[i] = CM_FMT_TYPE_A_B_C_A; + continue; + } + + //Type 9: (A-B)*C+D + splitType[i] = CM_FMT_TYPE_A_B_C_D; + } + + if( (splitType[0] == CM_FMT_TYPE_D && splitType[2]!= CM_FMT_TYPE_NOT_USED ) || //Cycle 1 Color + (isUsedInCycle(MUX_COMBINED,1,COLOR_CHANNEL) == false && isUsedInCycle(MUX_COMBINED,1,ALPHA_CHANNEL) == false && splitType[2]!= CM_FMT_TYPE_NOT_USED) ) + { + //Replace cycle 1 color with cycle 2 color because we have already replace cycle2's cmb + aRGB0 = aRGB1; + bRGB0 = bRGB1; + cRGB0 = cRGB1; + dRGB0 = dRGB1; + aRGB1 = MUX_0; + bRGB1 = MUX_0; + cRGB1 = MUX_0; + dRGB1 = MUX_COMBINED; + splitType[0] = splitType[2]; + splitType[2] = CM_FMT_TYPE_NOT_USED; + } + + if( (splitType[1] == CM_FMT_TYPE_D && splitType[3]!= CM_FMT_TYPE_NOT_USED ) || //Cycle 2 Alpha + ( isUsedInCycle(MUX_COMBINED,1,ALPHA_CHANNEL) == false && isUsedInCycle(MUX_COMBINED|MUX_ALPHAREPLICATE,1,COLOR_CHANNEL,MUX_MASK_WITH_ALPHA) == false && splitType[3]!= CM_FMT_TYPE_NOT_USED) ) + { + //Replace cycle 1 alpha with cycle 2 alpha because we have already replace cycle2's cmb + aA0 = aA1; + bA0 = bA1; + cA0 = cA1; + dA0 = dA1; + aA1 = MUX_0; + bA1 = MUX_0; + cA1 = MUX_0; + dA1 = MUX_COMBINED; + splitType[1] = splitType[3]; + splitType[3] = CM_FMT_TYPE_NOT_USED; + } + + if( splitType[0] == CM_FMT_TYPE_A_MOD_C && splitType[2] == CM_FMT_TYPE_A_ADD_D ) + { + m_n64Combiners[0].d = (m_n64Combiners[2].a & MUX_MASK) == MUX_COMBINED ? m_n64Combiners[2].d : m_n64Combiners[2].a; + splitType[0] = CM_FMT_TYPE_A_MOD_C_ADD_D; + splitType[2] = CM_FMT_TYPE_NOT_USED; + m_n64Combiners[2].a = MUX_0; + m_n64Combiners[2].c = MUX_0; + m_n64Combiners[2].d = MUX_COMBINED; + } + + if( splitType[1] == CM_FMT_TYPE_A_MOD_C && splitType[3] == CM_FMT_TYPE_A_ADD_D ) + { + m_n64Combiners[1].d = (m_n64Combiners[3].a & MUX_MASK) == MUX_COMBINED ? m_n64Combiners[3].d : m_n64Combiners[3].a; + splitType[1] = CM_FMT_TYPE_A_MOD_C_ADD_D; + splitType[3] = CM_FMT_TYPE_NOT_USED; + m_n64Combiners[3].a = MUX_0; + m_n64Combiners[3].c = MUX_0; + m_n64Combiners[3].d = MUX_COMBINED; + } + + mType = max(max(max(splitType[0], splitType[1]),splitType[2]),splitType[3]); +} + +const char* MuxGroupStr[4] = +{ + "Color0", + "Alpha0", + "Color1", + "Alpha1", +}; + +char* DecodedMux::FormatStr(uint8 val, char *buf) +{ + if( val == CM_IGNORE_BYTE ) + { + strcpy(buf," "); + } + else + { + strcpy(buf, translatedCombTypes[val&MUX_MASK]); + if( val&MUX_ALPHAREPLICATE ) + strcat(buf,"|A"); + if( val&MUX_COMPLEMENT ) + strcat(buf,"|C"); + if( val&MUX_NEG ) + strcat(buf,"|N"); + } + + return buf; +} + +void DecodedMux::Display(bool simplified,FILE *fp) +{ + DecodedMux decodedMux; + DecodedMux *mux; + if( simplified ) + { + mux = this; + } + else + { + decodedMux.Decode(m_dwMux0, m_dwMux1); + mux = &decodedMux; + } + + char buf0[30]; + char buf1[30]; + char buf2[30]; + char buf3[30]; + + for( int i=0; i<2; i++ ) + { + for(int j=0;j<2;j++) + { + N64CombinerType &m = mux->m_n64Combiners[i+2*j]; + if( fp ) + { + fprintf(fp,"%s: (%s - %s) * %s + %s\n", MuxGroupStr[i+2*j], FormatStr(m.a,buf0), + FormatStr(m.b,buf1), FormatStr(m.c,buf2), FormatStr(m.d,buf3)); + } + else + { + DebuggerAppendMsg("%s: (%s - %s) * %s + %s\n", MuxGroupStr[i+2*j], FormatStr(m.a,buf0), + FormatStr(m.b,buf1), FormatStr(m.c,buf2), FormatStr(m.d,buf3)); + } + } + } +} + +int DecodedMux::HowManyConstFactors() +{ + int n=0; + if( isUsed(MUX_PRIM) ) n++; + if( isUsed(MUX_ENV) ) n++; + if( isUsed(MUX_LODFRAC) ) n++; + if( isUsed(MUX_PRIMLODFRAC) ) n++; + return n; +} + +int DecodedMux::HowManyTextures() +{ + int n=0; + if( isUsed(MUX_TEXEL0) ) n++; + if( isUsed(MUX_TEXEL1) ) n++; + return n; +} + +int DecodedMux::CountTexels(void) +{ + int count=0; + + for( int i=0; i<4; i++ ) + { + N64CombinerType &m = m_n64Combiners[i]; + count = max(count, ::CountTexel1Cycle(m)); + if( count == 2 ) + break; + } + + return count; +} + +void DecodedMux::ReplaceVal(uint8 val1, uint8 val2, int cycle, uint8 mask) +{ + int start = 0; + int end = 16; + + if( cycle >= 0 ) + { + start = cycle*4; + end = start+4; + } + + uint8* pmux = m_bytes; + for( int i=start; im_maxConstants; + + if( !isUsedInColorChannel(MUX_SHADE) && (forceToUsed || max(splitType[0], splitType[2]) >= CM_FMT_TYPE_A_MOD_C_ADD_D) ) + { + int countEnv = Count(MUX_ENV, N64Cycle0RGB, mask) + Count(MUX_ENV, N64Cycle1RGB, mask); + int countPrim = Count(MUX_PRIM, N64Cycle0RGB, mask) + Count(MUX_PRIM, N64Cycle1RGB, mask); + if( countEnv+countPrim > 0 ) + { + if( countPrim >= countEnv ) + { + //TRACE0("Use Shade for PRIM in color channel"); + ReplaceVal(MUX_PRIM, MUX_SHADE, N64Cycle0RGB); + ReplaceVal(MUX_PRIM, MUX_SHADE, N64Cycle1RGB); + m_dwShadeColorChannelFlag = MUX_PRIM; + } + else if( countEnv>0 ) + { + //TRACE0("Use Shade for ENV in color channel"); + ReplaceVal(MUX_ENV, MUX_SHADE, N64Cycle0RGB); + ReplaceVal(MUX_ENV, MUX_SHADE, N64Cycle1RGB); + m_dwShadeColorChannelFlag = MUX_ENV; + } + + if( isUsedInColorChannel(MUX_SHADE|MUX_ALPHAREPLICATE, mask) ) + { + m_dwShadeAlphaChannelFlag = m_dwShadeColorChannelFlag; + ReplaceVal((uint8)m_dwShadeColorChannelFlag, MUX_SHADE, N64Cycle0Alpha); + ReplaceVal((uint8)m_dwShadeColorChannelFlag, MUX_SHADE, N64Cycle1Alpha); + doAlphaChannel = false; + } + } + } + + if( doAlphaChannel && !isUsedInAlphaChannel(MUX_SHADE) && !isUsedInColorChannel(MUX_SHADE|MUX_ALPHAREPLICATE,MUX_MASK_WITH_ALPHA)) + { + int countEnv = Count(MUX_ENV|MUX_ALPHAREPLICATE, N64Cycle0RGB, mask) + Count(MUX_ENV|MUX_ALPHAREPLICATE, N64Cycle1RGB, mask); + int countPrim = Count(MUX_PRIM|MUX_ALPHAREPLICATE, N64Cycle0RGB, mask) + Count(MUX_PRIM|MUX_ALPHAREPLICATE, N64Cycle1RGB, mask); + + if( forceToUsed || max(splitType[1], splitType[3]) >= CM_FMT_TYPE_A_MOD_C_ADD_D || + (max(splitType[0], splitType[2]) >= CM_FMT_TYPE_A_MOD_C_ADD_D && countEnv+countPrim > 0 ) ) + { + countEnv = Count(MUX_ENV, N64Cycle0Alpha) + Count(MUX_ENV, N64Cycle1Alpha) + + Count(MUX_ENV|MUX_ALPHAREPLICATE, N64Cycle0RGB, mask) + Count(MUX_ENV|MUX_ALPHAREPLICATE, N64Cycle1RGB, mask); + countPrim = Count(MUX_PRIM, N64Cycle0Alpha) + Count(MUX_PRIM, N64Cycle1Alpha) + + Count(MUX_PRIM|MUX_ALPHAREPLICATE, N64Cycle0RGB, mask) + Count(MUX_PRIM|MUX_ALPHAREPLICATE, N64Cycle1RGB, mask); + if( countEnv+countPrim > 0 ) + { + if( countPrim>0 && m_dwShadeColorChannelFlag == MUX_PRIM ) + { + //TRACE0("Use Shade for PRIM in alpha channel"); + ReplaceVal(MUX_PRIM, MUX_SHADE, N64Cycle0Alpha); + ReplaceVal(MUX_PRIM, MUX_SHADE, N64Cycle1Alpha); + ReplaceVal(MUX_PRIM|MUX_ALPHAREPLICATE, MUX_SHADE|MUX_ALPHAREPLICATE, N64Cycle0RGB, mask); + ReplaceVal(MUX_PRIM|MUX_ALPHAREPLICATE, MUX_SHADE|MUX_ALPHAREPLICATE, N64Cycle1RGB, mask); + m_dwShadeAlphaChannelFlag = MUX_PRIM; + } + else if( countEnv>0 && m_dwShadeColorChannelFlag == MUX_ENV ) + { + //TRACE0("Use Shade for PRIM in alpha channel"); + ReplaceVal(MUX_ENV, MUX_SHADE, N64Cycle0Alpha); + ReplaceVal(MUX_ENV, MUX_SHADE, N64Cycle1Alpha); + ReplaceVal(MUX_ENV|MUX_ALPHAREPLICATE, MUX_SHADE|MUX_ALPHAREPLICATE, N64Cycle0RGB, mask); + ReplaceVal(MUX_ENV|MUX_ALPHAREPLICATE, MUX_SHADE|MUX_ALPHAREPLICATE, N64Cycle1RGB, mask); + m_dwShadeAlphaChannelFlag = MUX_ENV; + } + else if( countPrim >= countEnv ) + { + //TRACE0("Use Shade for PRIM in alpha channel"); + ReplaceVal(MUX_PRIM, MUX_SHADE, N64Cycle0Alpha); + ReplaceVal(MUX_PRIM, MUX_SHADE, N64Cycle1Alpha); + ReplaceVal(MUX_PRIM|MUX_ALPHAREPLICATE, MUX_SHADE|MUX_ALPHAREPLICATE, N64Cycle0RGB, mask); + ReplaceVal(MUX_PRIM|MUX_ALPHAREPLICATE, MUX_SHADE|MUX_ALPHAREPLICATE, N64Cycle1RGB, mask); + m_dwShadeAlphaChannelFlag = MUX_PRIM; + } + else if( countEnv>0 ) + { + //TRACE0("Use Shade for ENV in alpha channel"); + ReplaceVal(MUX_ENV, MUX_SHADE, N64Cycle0Alpha); + ReplaceVal(MUX_ENV, MUX_SHADE, N64Cycle1Alpha); + ReplaceVal(MUX_ENV|MUX_ALPHAREPLICATE, MUX_SHADE|MUX_ALPHAREPLICATE, N64Cycle0RGB, mask); + ReplaceVal(MUX_ENV|MUX_ALPHAREPLICATE, MUX_SHADE|MUX_ALPHAREPLICATE, N64Cycle1RGB, mask); + m_dwShadeAlphaChannelFlag = MUX_ENV; + } + } + } + } +} + +void DecodedMux::UseTextureForConstant(void) +{ + int numofconst = HowManyConstFactors(); + int numOftex = HowManyTextures(); + + if( numofconst > m_maxConstants && numOftex < m_maxTextures ) + { + // We can use a texture for a constant + for( int i=0; i<2 && numofconst > m_maxConstants ; i++ ) + { + if( isUsed(MUX_TEXEL0+i) ) + { + continue; // can not use this texture + } + + if( isUsed(MUX_PRIM) ) + { + ReplaceVal(MUX_PRIM, MUX_TEXEL0+i); + m_ColorTextureFlag[i] = MUX_PRIM; + numofconst--; + continue; + } + + if( isUsed(MUX_ENV) ) + { + ReplaceVal(MUX_ENV, MUX_TEXEL0+i); + m_ColorTextureFlag[i] = MUX_ENV; + numofconst--; + continue; + } + + if( isUsed(MUX_LODFRAC) ) + { + ReplaceVal(MUX_LODFRAC, MUX_TEXEL0+i); + m_ColorTextureFlag[i] = MUX_LODFRAC; + numofconst--; + continue; + } + + if( isUsed(MUX_PRIMLODFRAC) ) + { + ReplaceVal(MUX_PRIMLODFRAC, MUX_TEXEL0+i); + m_ColorTextureFlag[i] = MUX_PRIMLODFRAC; + numofconst--; + continue; + } + } + } +} + + +void DecodedMuxForOGL14V2::UseTextureForConstant(void) +{ + bool envused = isUsed(MUX_ENV); + bool lodused = isUsed(MUX_LODFRAC); + + int numofconst = 0; + if( envused ) numofconst++; + if( lodused ) numofconst++; + + int numOftex = HowManyTextures(); + + if( numofconst > 0 && numOftex < 2 ) + { + // We can use a texture for a constant + for( int i=0; i<2 && numofconst > 0 ; i++ ) + { + if( isUsed(MUX_TEXEL0+i) ) + { + continue; // can not use this texture + } + + if( envused ) + { + ReplaceVal(MUX_ENV, MUX_TEXEL0+i); + m_ColorTextureFlag[i] = MUX_ENV; + numofconst--; + envused = false; + continue; + } + + if( isUsed(MUX_LODFRAC) ) + { + ReplaceVal(MUX_LODFRAC, MUX_TEXEL0+i); + m_ColorTextureFlag[i] = MUX_LODFRAC; + numofconst--; + continue; + } + + if( isUsed(MUX_PRIMLODFRAC) ) + { + ReplaceVal(MUX_PRIMLODFRAC, MUX_TEXEL0+i); + m_ColorTextureFlag[i] = MUX_PRIMLODFRAC; + numofconst--; + continue; + } + } + } +} + +#ifdef DEBUGGER +extern const char *translatedCombTypes[]; +void DecodedMux::DisplayMuxString(const char *prompt) +{ + DebuggerAppendMsg("//Mux=0x%08x%08x\t%s in %s\n", m_dwMux0, m_dwMux1, prompt, g_curRomInfo.szGameName); + Display(false); + TRACE0("\n"); +} + +void DecodedMux::DisplaySimpliedMuxString(const char *prompt) +{ + DebuggerAppendMsg("//Simplied Mux=0x%08x%08x\t%s in %s\n", m_dwMux0, m_dwMux1, prompt, g_curRomInfo.szGameName); + DebuggerAppendMsg("Simplied DWORDs=%08X, %08X, %08X, %08X", m_dWords[0],m_dWords[1],m_dWords[2],m_dWords[3]); + Display(true); + DebuggerAppendMsg("Simplfied type: %s", muxTypeStrs[mType]); + if( m_dwShadeColorChannelFlag != 0 ) + { + if( m_dwShadeColorChannelFlag == MUX_ENV ) + TRACE0("Shade = ENV in color channel") + else if( m_dwShadeColorChannelFlag == MUX_PRIM ) + TRACE0("Shade = PRIM in color channel") + else if( m_dwShadeColorChannelFlag == MUX_LODFRAC ) + TRACE0("Shade = MUX_LODFRAC in color channel") + else if( m_dwShadeColorChannelFlag == MUX_PRIMLODFRAC ) + TRACE0("Shade = MUX_PRIMLODFRAC in color channel") + else + DisplayConstantsWithShade(m_dwShadeColorChannelFlag,COLOR_CHANNEL); + } + if( m_dwShadeAlphaChannelFlag != 0 ) + { + if( m_dwShadeAlphaChannelFlag == MUX_ENV ) + TRACE0("Shade = ENV in alpha channel") + else if( m_dwShadeAlphaChannelFlag == MUX_PRIM ) + TRACE0("Shade = PRIM in alpha channel") + else if( m_dwShadeAlphaChannelFlag == MUX_LODFRAC ) + TRACE0("Shade = MUX_LODFRAC in alpha channel") + else if( m_dwShadeAlphaChannelFlag == MUX_PRIMLODFRAC ) + TRACE0("Shade = MUX_PRIMLODFRAC in alpha channel") + else + DisplayConstantsWithShade(m_dwShadeAlphaChannelFlag,ALPHA_CHANNEL); + } + + for( int i=0; i<2; i++ ) + { + if( m_ColorTextureFlag[i] != 0 ) + { + if( m_ColorTextureFlag[i] == MUX_ENV ) + TRACE1("Tex %d = ENV", i) + else if( m_ColorTextureFlag[i] == MUX_PRIM ) + TRACE1("Tex %d = PRIM", i) + else if( m_ColorTextureFlag[i] == MUX_LODFRAC ) + TRACE1("Tex %d = MUX_LODFRAC", i) + else if( m_ColorTextureFlag[i] == MUX_PRIMLODFRAC ) + TRACE1("Tex %d = MUX_PRIMLODFRAC", i) + } + } + + + TRACE0("\n"); +} + +void DecodedMux::DisplayConstantsWithShade(uint32 flag,CombineChannel channel) +{ + DebuggerAppendMsg("Shade = %08X in %s channel",flag,channel==COLOR_CHANNEL?"color":"alpha"); +} +#else + +extern const char *translatedCombTypes[]; +void DecodedMux::LogMuxString(const char *prompt, FILE *fp) +{ + fprintf(fp,"//Mux=0x%08x%08x\t%s in %s\n", m_dwMux0, m_dwMux1, prompt, g_curRomInfo.szGameName); + Display(false,fp); + TRACE0("\n"); +} + +void DecodedMux::LogSimpliedMuxString(const char *prompt, FILE *fp) +{ + fprintf(fp,"//Simplied Mux=0x%08x%08x\t%s in %s\n", m_dwMux0, m_dwMux1, prompt, g_curRomInfo.szGameName); + fprintf(fp,"Simplied DWORDs=%08X, %08X, %08X, %08X\n", m_dWords[0],m_dWords[1],m_dWords[2],m_dWords[3]); + Display(true,fp); + fprintf(fp,"Simplfied type: %s", muxTypeStrs[mType]); + if( m_dwShadeColorChannelFlag != 0 ) + { + if( m_dwShadeColorChannelFlag == MUX_ENV ) + TRACE0("Shade = ENV in color channel") + else if( m_dwShadeColorChannelFlag == MUX_PRIM ) + TRACE0("Shade = PRIM in color channel") + else if( m_dwShadeColorChannelFlag == MUX_LODFRAC ) + TRACE0("Shade = MUX_LODFRAC in color channel") + else if( m_dwShadeColorChannelFlag == MUX_PRIMLODFRAC ) + TRACE0("Shade = MUX_PRIMLODFRAC in color channel") + else + LogConstantsWithShade(m_dwShadeColorChannelFlag,COLOR_CHANNEL,fp); + } + if( m_dwShadeAlphaChannelFlag != 0 ) + { + if( m_dwShadeAlphaChannelFlag == MUX_ENV ) + TRACE0("Shade = ENV in alpha channel") + else if( m_dwShadeAlphaChannelFlag == MUX_PRIM ) + TRACE0("Shade = PRIM in alpha channel") + else if( m_dwShadeAlphaChannelFlag == MUX_LODFRAC ) + TRACE0("Shade = MUX_LODFRAC in alpha channel") + else if( m_dwShadeAlphaChannelFlag == MUX_PRIMLODFRAC ) + TRACE0("Shade = MUX_PRIMLODFRAC in alpha channel") + else + LogConstantsWithShade(m_dwShadeAlphaChannelFlag,ALPHA_CHANNEL,fp); + } + + for( int i=0; i<2; i++ ) + { + if( m_ColorTextureFlag[i] != 0 ) + { + if( m_ColorTextureFlag[i] == MUX_ENV ) + TRACE1("Tex %d = ENV", i) + else if( m_ColorTextureFlag[i] == MUX_PRIM ) + TRACE1("Tex %d = PRIM", i) + else if( m_ColorTextureFlag[i] == MUX_LODFRAC ) + TRACE1("Tex %d = MUX_LODFRAC", i) + else if( m_ColorTextureFlag[i] == MUX_PRIMLODFRAC ) + TRACE1("Tex %d = MUX_PRIMLODFRAC", i) + } + } + + + TRACE0("\n"); +} + +void DecodedMux::LogConstantsWithShade(uint32 flag,CombineChannel channel, FILE *fp) +{ + fprintf(fp,"Shade = %08X in %s channel",flag,channel==COLOR_CHANNEL?"color":"alpha"); +} +#endif + + +void DecodedMux::To_AB_Add_CD_Format(void) // Use by TNT,Geforce +{ + // This function should be called after calling reformat + // This function will not be called by default, can be called optionally + // by TNT/Geforce combiner compilers + + for( int i=0; i<2; i++ ) + { + N64CombinerType &m0 = m_n64Combiners[i]; + N64CombinerType &m1 = m_n64Combiners[i+2]; + switch( splitType[i] ) + { + case CM_FMT_TYPE_A_SUB_B_ADD_D: // = A-B+D can not map very well in 1 stage + if( splitType[i+2] == CM_FMT_TYPE_NOT_USED ) + { + m1.a = m0.d; + m1.d = MUX_COMBINED; + splitType[i+2] = CM_FMT_TYPE_A_ADD_D; + + m0.d = MUX_0; + splitType[i] = CM_FMT_TYPE_A_SUB_B; + } + else if( splitType[i+2] == CM_FMT_TYPE_A_MOD_C ) + { + if( (m1.c&MUX_MASK) == MUX_COMBINED ) swap(m1.a, m1.c); + m1.b = m1.d = m1.c; + m1.c = (m0.d | (m1.a & (~MUX_MASK))); + splitType[i+2] = CM_FMT_TYPE_AB_ADD_CD; + + m0.d = MUX_0; + splitType[i] = CM_FMT_TYPE_A_SUB_B; + } + break; + case CM_FMT_TYPE_A_SUB_B_MOD_C: // = (A-B)*C can not map very well in 1 stage + m0.d = m0.b; + m0.b = m0.c; + splitType[i] = CM_FMT_TYPE_AB_SUB_CD; + break; + case CM_FMT_TYPE_A_ADD_B_MOD_C: // = (A+B)*C can not map very well in 1 stage + m0.d = m0.b; + m0.b = m0.c; + splitType[i] = CM_FMT_TYPE_AB_ADD_CD; + break; + case CM_FMT_TYPE_A_B_C_D: // = (A-B)*C+D + case CM_FMT_TYPE_A_B_C_A: // = (A-B)*C+D + if( splitType[i+2] == CM_FMT_TYPE_NOT_USED ) + { + m1.a = m0.d; + m1.d = MUX_COMBINED; + splitType[i+2] = CM_FMT_TYPE_A_ADD_D; + + m0.d = m0.b; + m0.b = m0.c; + splitType[i] = CM_FMT_TYPE_AB_SUB_CD; + } + else if( splitType[i+2] == CM_FMT_TYPE_A_MOD_C ) + { + if( (m1.c&MUX_MASK) == MUX_COMBINED ) swap(m1.a, m1.c); + m1.b = m1.d = m1.c; + m1.c = (m0.d | (m1.a & (~MUX_MASK))); + splitType[i+2] = CM_FMT_TYPE_AB_ADD_CD; + + m0.d = m0.b; + m0.b = m0.c; + splitType[i] = CM_FMT_TYPE_AB_ADD_CD; + } + break; + default: + break; + } + } +} + +void DecodedMux::To_AB_Add_C_Format(void) // Use by ATI Radeon +{ + // This function should be called after calling reformat + // This function will not be called by default, can be called optionally + // by ATI combiner compilers +} + +void DecodedMux::CheckCombineInCycle1(void) +{ + if( isUsedInCycle(MUX_COMBINED,0,COLOR_CHANNEL) ) + { + ReplaceVal(MUX_COMBINED, MUX_SHADE, 0); + } + + if( isUsedInCycle(MUX_COMBALPHA,0,COLOR_CHANNEL) ) + { + ReplaceVal(MUX_COMBALPHA, MUX_SHADE|MUX_ALPHAREPLICATE, 0); + } + + if( isUsedInCycle(MUX_COMBINED,0,ALPHA_CHANNEL) ) + { + if( cA0 == MUX_COMBINED && cRGB0 == MUX_LODFRAC && bRGB0 == dRGB0 && bA0 == dA0 ) + { + cA0 = MUX_LODFRAC; + } + else + { + ReplaceVal(MUX_COMBINED, MUX_SHADE, 1); + } + } + if( isUsedInCycle(MUX_COMBALPHA,0,ALPHA_CHANNEL) ) + { + ReplaceVal(MUX_COMBALPHA, MUX_SHADE, 1); + } +} + +void DecodedMux::SplitComplexStages() +{ + for( int i=0; i<2; i++) // Color channel and alpha channel + { + if( splitType[i+2] != CM_FMT_TYPE_NOT_USED ) + continue; + + N64CombinerType &m = m_n64Combiners[i]; + N64CombinerType &m2 = m_n64Combiners[i+2]; + + switch( splitType[i] ) + { + case CM_FMT_TYPE_A_MOD_C_ADD_D: // = A*C+D can mapped to MULTIPLYADD(arg1,arg2,arg0) + m2.a = m.d; + m2.d = MUX_COMBINED; + m2.c = MUX_1; + m2.b = 0; + splitType[i+2] = CM_FMT_TYPE_A_ADD_D; + m.d = MUX_0; + splitType[i] = CM_FMT_TYPE_A_MOD_C; + break; + case CM_FMT_TYPE_A_SUB_B_ADD_D: // = A-B+D can not map very well in 1 stage + m2.a = m.d; + m2.d = MUX_COMBINED; + m2.c = MUX_1; + m2.b=0; + splitType[i+2] = CM_FMT_TYPE_A_ADD_D; + m.d = MUX_0; + splitType[i] = CM_FMT_TYPE_A_SUB_B; + break; + case CM_FMT_TYPE_A_SUB_B_MOD_C: // = (A-B)*C can not map very well in 1 stage + m2.a = m.c; + m2.c = MUX_COMBINED; + m2.d = m2.b=0; + splitType[i+2] = CM_FMT_TYPE_A_MOD_C; + m.c = MUX_1; + splitType[i] = CM_FMT_TYPE_A_SUB_B; + break; + case CM_FMT_TYPE_A_ADD_B_MOD_C: // = (A+B)*C can not map very well in 1 stage + m2.a = m.c; + m2.c = MUX_COMBINED; + m2.d = m2.b = 0; + splitType[i+2] = CM_FMT_TYPE_A_MOD_C; + m.c = MUX_1; + m.d = m.b; + m.b = MUX_0; + splitType[i] = CM_FMT_TYPE_A_ADD_D; + break; + case CM_FMT_TYPE_A_B_C_D: // = (A-B)*C+D can not map very well in 1 stage + m2.a = m.d; + m2.d = MUX_COMBINED; + m2.c = MUX_1; + m2.b = 0; + splitType[i+2] = CM_FMT_TYPE_A_ADD_D; + m.d = MUX_0; + splitType[i] = CM_FMT_TYPE_A_SUB_B_MOD_C; + break; + case CM_FMT_TYPE_A_B_C_A: // = (A-B)*C+A can not map very well in 1 stage + m2.a = m.d; + m2.d = MUX_COMBINED; + m2.c = MUX_1; + m2.b = 0; + splitType[i+2] = CM_FMT_TYPE_A_ADD_D; + m.d = MUX_0; + splitType[i] = CM_FMT_TYPE_A_SUB_B_MOD_C; + break; + default: + break; + } + } + //Reformat(); + //UseShadeForConstant(); +} + + +void DecodedMux::ConvertLODFracTo0() +{ + ReplaceVal(MUX_LODFRAC,MUX_0); + ReplaceVal(MUX_PRIMLODFRAC,MUX_0); +} + + +void DecodedMux::Hack(void) +{ + if( options.enableHackForGames == HACK_FOR_TONYHAWK ) + { + if( gRSP.curTile == 1 ) + { + ReplaceVal(MUX_TEXEL1, MUX_TEXEL0); + } + } + else if( options.enableHackForGames == HACK_FOR_ZELDA || options.enableHackForGames == HACK_FOR_ZELDA_MM) + { + if( m_dwMux1 == 0xfffd9238 && m_dwMux0 == 0x00ffadff ) + { + ReplaceVal(MUX_TEXEL1, MUX_TEXEL0); + } + else if( m_dwMux1 == 0xff5bfff8 && m_dwMux0 == 0x00121603 ) + { + // The Zelda road trace + ReplaceVal(MUX_TEXEL1, MUX_0); + } + } + else if( options.enableHackForGames == HACK_FOR_MARIO_TENNIS ) + { + if( m_dwMux1 == 0xffebdbc0 && m_dwMux0 == 0x00ffb9ff ) + { + // Player shadow + //m_decodedMux.dRGB0 = MUX_TEXEL0; + //m_decodedMux.dRGB1 = MUX_COMBINED; + cA1 = MUX_TEXEL0; + } + } + else if( options.enableHackForGames == HACK_FOR_MARIO_GOLF ) + { + // Hack for Mario Golf + if( m_dwMux1 == 0xf1ffca7e || m_dwMux0 == 0x00115407 ) + { + // The grass + ReplaceVal(MUX_TEXEL0, MUX_TEXEL1); + } + } + else if( options.enableHackForGames == HACK_FOR_TOPGEARRALLY ) + { + //Mux=0x00317e025ffef3fa Used in TOP GEAR RALLY + //Color0: (PRIM - ENV) * TEXEL1 + ENV + //Color1: (COMBINED - 0) * TEXEL1 + 0 + //Alpha0: (0 - 0) * 0 + TEXEL0 + //Alpha1: (0 - 0) * 0 + TEXEL1 + if( m_dwMux1 == 0x5ffef3fa || m_dwMux0 == 0x00317e02 ) + { + // The grass + //ReplaceVal(MUX_TEXEL0, MUX_TEXEL1); + dA1 = MUX_COMBINED; + //aA1 = MUX_COMBINED; + //cA1 = MUX_TEXEL1; + //dA1 = MUX_0; + cRGB1 = MUX_TEXEL0; + } + } +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/DecodedMux.h b/libmupen64plus/mupen64plus-video-rice/src/DecodedMux.h new file mode 100644 index 0000000000..3e9698bfed --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/DecodedMux.h @@ -0,0 +1,244 @@ +/* +Copyright (C) 2002 Rice1964 + +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. +*/ + +#ifndef _DECODEDMUX_H_ +#define _DECODEDMUX_H_ + +#include +#include + +#include "typedefs.h" +#include "CombinerDefs.h" + +typedef enum { + N64Cycle0RGB=0, + N64Cycle0Alpha=1, + N64Cycle1RGB=2, + N64Cycle1Alpha=3, +} N64StageNumberType; + +typedef union { + struct { + uint32 dwMux0; + uint32 dwMux1; + }; + uint64 Mux64; +} MuxType; + +typedef struct { + MuxType ori_mux; + MuxType simple_mux; +} SimpleMuxMapType; + +class DecodedMux +{ +public: + union { + struct { + uint8 aRGB0; + uint8 bRGB0; + uint8 cRGB0; + uint8 dRGB0; + + uint8 aA0; + uint8 bA0; + uint8 cA0; + uint8 dA0; + + uint8 aRGB1; + uint8 bRGB1; + uint8 cRGB1; + uint8 dRGB1; + + uint8 aA1; + uint8 bA1; + uint8 cA1; + uint8 dA1; + }; + uint8 m_bytes[16]; + uint32 m_dWords[4]; + N64CombinerType m_n64Combiners[4]; + }; + + union { + struct { + uint32 m_dwMux0; + uint32 m_dwMux1; + }; + uint64 m_u64Mux; + }; + + CombinerFormatType splitType[4]; + CombinerFormatType mType; + + uint32 m_dwShadeColorChannelFlag; + uint32 m_dwShadeAlphaChannelFlag; + uint32 m_ColorTextureFlag[2]; // I may use a texture to represent a constant color + // when there are more constant colors are used than + // the system can support + + bool m_bShadeIsUsed[2]; // 0 for color channel, 1 for alpha channel + bool m_bTexel0IsUsed; + bool m_bTexel1IsUsed; + + int m_maxConstants; // OpenGL 1.1 does not really support a constant color in combiner + // must use shade for constants; + int m_maxTextures; // 1 or 2 + + + void Decode(uint32 dwMux0, uint32 dwMux1); + virtual void Hack(void); + bool isUsed(uint8 fac, uint8 mask=MUX_MASK); + bool isUsedInAlphaChannel(uint8 fac, uint8 mask=MUX_MASK); + bool isUsedInColorChannel(uint8 fac, uint8 mask=MUX_MASK); + bool isUsedInCycle(uint8 fac, int cycle, CombineChannel channel, uint8 mask=MUX_MASK); + bool isUsedInCycle(uint8 fac, int cycle, uint8 mask=MUX_MASK); + uint32 GetCycle(int cycle, CombineChannel channel); + uint32 GetCycle(int cycle); + CombinerFormatType GetCombinerFormatType(uint32 cycle); + void Display(bool simplified=true, FILE *fp=NULL); + static char* FormatStr(uint8 val, char *buf); + void CheckCombineInCycle1(void); + virtual void Simplify(void); + virtual void Reformat(bool do_complement = true); + virtual void To_AB_Add_CD_Format(void); // Use by TNT,Geforce + virtual void To_AB_Add_C_Format(void); // Use by ATI Radeon + + virtual void MergeShadeWithConstants(void); + virtual void MergeShadeWithConstantsInChannel(CombineChannel channel); + virtual void MergeConstants(void); + virtual void UseShadeForConstant(void); + virtual void UseTextureForConstant(void); + + void ConvertComplements(); + int HowManyConstFactors(); + int HowManyTextures(); + void MergeConstFactors(); + virtual void SplitComplexStages(); // Only used if the combiner supports more than 1 stages + void ConvertLODFracTo0(); + void ReplaceVal(uint8 val1, uint8 val2, int cycle= -1, uint8 mask = MUX_MASK); + void Replace1Val(uint8 &val1, const uint8 val2, uint8 mask = MUX_MASK) + { + val1 &= (~mask); + val1 |= val2; + } + int CountTexels(void); + int Count(uint8 val, int cycle= -1, uint8 mask = MUX_MASK); + +#ifdef DEBUGGER + void DisplayMuxString(const char *prompt); + void DisplaySimpliedMuxString(const char *prompt); + void DisplayConstantsWithShade(uint32 flag,CombineChannel channel); +#else + void DisplayMuxString(const char *prompt) {} + void DisplaySimpliedMuxString(const char *prompt){} + void DisplayConstantsWithShade(uint32 flag,CombineChannel channel){} + void LogMuxString(const char *prompt, FILE *fp); + void LogSimpliedMuxString(const char *prompt, FILE *fp); + void LogConstantsWithShade(uint32 flag,CombineChannel channel, FILE *fp); +#endif + + virtual DecodedMux& operator=(const DecodedMux& mux) + { + m_dWords[0] = mux.m_dWords[0]; + m_dWords[1] = mux.m_dWords[1]; + m_dWords[2] = mux.m_dWords[2]; + m_dWords[3] = mux.m_dWords[3]; + m_u64Mux = mux.m_u64Mux; + splitType[0] = mux.splitType[0]; + splitType[1] = mux.splitType[1]; + splitType[2] = mux.splitType[2]; + splitType[3] = mux.splitType[3]; + mType = mux.mType; + + m_dwShadeColorChannelFlag = mux.m_dwShadeColorChannelFlag; + m_dwShadeAlphaChannelFlag = mux.m_dwShadeAlphaChannelFlag; + + m_bShadeIsUsed[0] = mux.m_bShadeIsUsed[0]; + m_bShadeIsUsed[1] = mux.m_bShadeIsUsed[1]; + m_bTexel0IsUsed = mux.m_bTexel0IsUsed; + m_bTexel1IsUsed = mux.m_bTexel1IsUsed; + + m_maxConstants = mux.m_maxConstants; + m_maxTextures = mux.m_maxTextures; + m_ColorTextureFlag[0] = mux.m_ColorTextureFlag[0]; + m_ColorTextureFlag[1] = mux.m_ColorTextureFlag[1]; + + return *this; + } + + static inline bool IsConstFactor(uint8 val) + { + uint8 v = val&MUX_MASK; + return( v == MUX_0 || v == MUX_1 || v == MUX_PRIM || v == MUX_ENV || v == MUX_LODFRAC || v == MUX_PRIMLODFRAC ); + } + + DecodedMux() + { + memset(m_bytes, 0, sizeof(m_bytes)); + mType=CM_FMT_TYPE_NOT_CHECKED; + for( int i=0; i<4; i++ ) + { + splitType[i] = CM_FMT_TYPE_NOT_CHECKED; + } + m_maxConstants = 1; + m_maxTextures = 2; + } + + virtual ~DecodedMux() {} +}; + +class DecodedMuxForPixelShader : public DecodedMux +{ +public: + virtual void Simplify(void); + void SplitComplexStages() {}; +}; + +class DecodedMuxForSemiPixelShader : public DecodedMux +{ +public: + void Reset(void); +}; + +class DecodedMuxForOGL14V2 : public DecodedMuxForPixelShader +{ +public: + virtual void Simplify(void); + void UseTextureForConstant(void); +}; + +typedef struct +{ + bool bFurtherFormatForOGL2; + bool bUseShadeForConstants; + bool bUseTextureForConstants; + bool bUseMoreThan2TextureForConstants; + bool bReformatToAB_CD; + bool bAllowHack; + bool bAllowComplimentary; + bool bCheckCombineInCycle1; + bool bSetLODFracTo0; + bool bMergeShadeWithConstants; + bool bSplitComplexStage; + bool bReformatAgainWithTwoTexels; +} MuxConverterOptions; + +#endif + + diff --git a/libmupen64plus/mupen64plus-video-rice/src/DeviceBuilder.cpp b/libmupen64plus/mupen64plus-video-rice/src/DeviceBuilder.cpp new file mode 100644 index 0000000000..c1363c92ff --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/DeviceBuilder.cpp @@ -0,0 +1,373 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + +#include "osal_opengl.h" + +#include "DeviceBuilder.h" +#include "FrameBuffer.h" +#include "OGLCombiner.h" +#include "OGLDebug.h" +#include "OGLExtRender.h" +#include "OGLGraphicsContext.h" +#include "OGLTexture.h" +#if SDL_VIDEO_OPENGL +#include "OGLCombinerNV.h" +#include "OGLCombinerTNT2.h" +#include "OGLExtensions.h" +#include "OGLFragmentShaders.h" +#elif SDL_VIDEO_OPENGL_ES2 +#include "OGLES2FragmentShaders.h" +#endif + +//======================================================================== +CDeviceBuilder* CDeviceBuilder::m_pInstance=NULL; +SupportedDeviceType CDeviceBuilder::m_deviceType = DIRECTX_DEVICE; +SupportedDeviceType CDeviceBuilder::m_deviceGeneralType = DIRECTX_DEVICE; + +CDeviceBuilder* CDeviceBuilder::GetBuilder(void) +{ + if( m_pInstance == NULL ) + CreateBuilder(m_deviceType); + + return m_pInstance; +} + +void CDeviceBuilder::SelectDeviceType(SupportedDeviceType type) +{ + if( type != m_deviceType && m_pInstance != NULL ) + { + DeleteBuilder(); + } + + CDeviceBuilder::m_deviceType = type; + switch(type) + { + case OGL_DEVICE: + case OGL_1_1_DEVICE: + case OGL_1_2_DEVICE: + case OGL_1_3_DEVICE: + case OGL_1_4_DEVICE: + case OGL_1_4_V2_DEVICE: + case OGL_TNT2_DEVICE: + case NVIDIA_OGL_DEVICE: + case OGL_FRAGMENT_PROGRAM: + CDeviceBuilder::m_deviceGeneralType = OGL_DEVICE; + break; + default: + break; + } +} + +SupportedDeviceType CDeviceBuilder::GetDeviceType(void) +{ + return CDeviceBuilder::m_deviceType; +} + +SupportedDeviceType CDeviceBuilder::GetGeneralDeviceType(void) +{ + return CDeviceBuilder::m_deviceGeneralType; +} + +CDeviceBuilder* CDeviceBuilder::CreateBuilder(SupportedDeviceType type) +{ + if( m_pInstance == NULL ) + { + switch( type ) + { + case OGL_DEVICE: + case OGL_1_1_DEVICE: + case OGL_1_2_DEVICE: + case OGL_1_3_DEVICE: + case OGL_1_4_DEVICE: + case OGL_1_4_V2_DEVICE: + case OGL_TNT2_DEVICE: + case NVIDIA_OGL_DEVICE: + case OGL_FRAGMENT_PROGRAM: + m_pInstance = new OGLDeviceBuilder(); + break; + default: + DebugMessage(M64MSG_ERROR, "CreateBuilder: unknown OGL device type"); + exit(1); + } + + SAFE_CHECK(m_pInstance); + } + + return m_pInstance; +} + +void CDeviceBuilder::DeleteBuilder(void) +{ + delete m_pInstance; + m_pInstance = NULL; +} + +CDeviceBuilder::CDeviceBuilder() : + m_pRender(NULL), + m_pGraphicsContext(NULL), + m_pColorCombiner(NULL), + m_pAlphaBlender(NULL) +{ +} + +CDeviceBuilder::~CDeviceBuilder() +{ + DeleteGraphicsContext(); + DeleteRender(); + DeleteColorCombiner(); + DeleteAlphaBlender(); +} + +void CDeviceBuilder::DeleteGraphicsContext(void) +{ + if( m_pGraphicsContext != NULL ) + { + delete m_pGraphicsContext; + CGraphicsContext::g_pGraphicsContext = m_pGraphicsContext = NULL; + } + + SAFE_DELETE(g_pFrameBufferManager); +} + +void CDeviceBuilder::DeleteRender(void) +{ + if( m_pRender != NULL ) + { + delete m_pRender; + CRender::g_pRender = m_pRender = NULL; + CRender::gRenderReferenceCount = 0; + } +} + +void CDeviceBuilder::DeleteColorCombiner(void) +{ + if( m_pColorCombiner != NULL ) + { + delete m_pColorCombiner; + m_pColorCombiner = NULL; + } +} + +void CDeviceBuilder::DeleteAlphaBlender(void) +{ + if( m_pAlphaBlender != NULL ) + { + delete m_pAlphaBlender; + m_pAlphaBlender = NULL; + } +} + + +//======================================================================== + +CGraphicsContext * OGLDeviceBuilder::CreateGraphicsContext(void) +{ + if( m_pGraphicsContext == NULL ) + { + m_pGraphicsContext = new COGLGraphicsContext(); + SAFE_CHECK(m_pGraphicsContext); + CGraphicsContext::g_pGraphicsContext = m_pGraphicsContext; + } + + g_pFrameBufferManager = new FrameBufferManager; + return m_pGraphicsContext; +} + +CRender * OGLDeviceBuilder::CreateRender(void) +{ + if( m_pRender == NULL ) + { + if( CGraphicsContext::g_pGraphicsContext == NULL && CGraphicsContext::g_pGraphicsContext->Ready() ) + { + DebugMessage(M64MSG_ERROR, "Can not create ColorCombiner before creating and initializing GraphicsContext"); + m_pRender = NULL; + SAFE_CHECK(m_pRender); + } + + COGLGraphicsContext &context = *((COGLGraphicsContext*)CGraphicsContext::g_pGraphicsContext); + + if( context.m_bSupportMultiTexture ) + { + // OGL extension render + m_pRender = new COGLExtRender(); + } + else + { + // Basic OGL Render + m_pRender = new OGLRender(); + } + SAFE_CHECK(m_pRender); + CRender::g_pRender = m_pRender; + } + + return m_pRender; +} + +CTexture * OGLDeviceBuilder::CreateTexture(uint32 dwWidth, uint32 dwHeight, TextureUsage usage) +{ + COGLTexture *txtr = new COGLTexture(dwWidth, dwHeight, usage); + if( txtr->m_pTexture == NULL ) + { + delete txtr; + TRACE0("Cannot create new texture, out of video memory"); + return NULL; + } + else + return txtr; +} + +CColorCombiner * OGLDeviceBuilder::CreateColorCombiner(CRender *pRender) +{ + if( m_pColorCombiner == NULL ) + { + if( CGraphicsContext::g_pGraphicsContext == NULL && CGraphicsContext::g_pGraphicsContext->Ready() ) + { + DebugMessage(M64MSG_ERROR, "Can not create ColorCombiner before creating and initializing GraphicsContext"); + } + else + { + m_deviceType = (SupportedDeviceType)options.OpenglRenderSetting; + +#if SDL_VIDEO_OPENGL + + if (m_deviceType == NVIDIA_OGL_DEVICE && !bNvidiaExtensionsSupported) + { + DebugMessage(M64MSG_WARNING, "Your video card does not support Nvidia OpenGL extensions. Falling back to auto device."); + m_deviceType = OGL_DEVICE; + } + if( m_deviceType == OGL_DEVICE ) // Best fit + { + GLint maxUnit = 2; + COGLGraphicsContext *pcontext = (COGLGraphicsContext *)(CGraphicsContext::g_pGraphicsContext); + glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB,&maxUnit); + OPENGL_CHECK_ERRORS; + + if( pcontext->IsExtensionSupported("GL_ARB_fragment_program") ) + { + m_pColorCombiner = new COGL_FragmentProgramCombiner(pRender); + DebugMessage(M64MSG_INFO, "OpenGL Combiner: Fragment Program"); + } + else if( pcontext->IsExtensionSupported("GL_NV_texture_env_combine4") || + pcontext->IsExtensionSupported("GL_NV_register_combiners") ) + { + m_pColorCombiner = new COGLColorCombinerNvidia(pRender); + DebugMessage(M64MSG_INFO, "OpenGL Combiner: NVidia"); + } + else if( pcontext->IsExtensionSupported("GL_NV_texture_env_combine4") ) + { + m_pColorCombiner = new COGLColorCombinerTNT2(pRender); + DebugMessage(M64MSG_INFO, "OpenGL Combiner: TNT2"); + } + else if( pcontext->IsExtensionSupported("GL_EXT_texture_env_combine") || + pcontext->IsExtensionSupported("GL_ARB_texture_env_combine") ) + { + if( pcontext->IsExtensionSupported("GL_ARB_texture_env_crossbar") ) + { + if( maxUnit > 2 ) + { + m_pColorCombiner = new COGLColorCombiner4v2(pRender); + DebugMessage(M64MSG_INFO, "OpenGL Combiner: OGL 1.4 version 2"); + } + else + { + m_pColorCombiner = new COGLColorCombiner4(pRender); + DebugMessage(M64MSG_INFO, "OpenGL Combiner: OGL 1.4"); + } + } + else + { + if( maxUnit > 2 ) + { + m_pColorCombiner = new COGLColorCombiner4v2(pRender); + DebugMessage(M64MSG_INFO, "OpenGL Combiner: OGL 1.4 version 2 (w/o env crossbar)"); + } + else + { + m_pColorCombiner = new COGLColorCombiner2(pRender); + DebugMessage(M64MSG_INFO, "OpenGL Combiner: OGL 1.2/1.3"); + } + } + } + else + { + m_pColorCombiner = new COGLColorCombiner(pRender); + DebugMessage(M64MSG_INFO, "OpenGL Combiner: Basic OGL"); + } + } + else + { + switch(m_deviceType) + { + case OGL_1_1_DEVICE: + m_pColorCombiner = new COGLColorCombiner(pRender); + DebugMessage(M64MSG_INFO, "OpenGL Combiner: Basic OGL"); + break; + case OGL_1_2_DEVICE: + case OGL_1_3_DEVICE: + m_pColorCombiner = new COGLColorCombiner2(pRender); + DebugMessage(M64MSG_INFO, "OpenGL Combiner: OGL 1.2/1.3"); + break; + case OGL_1_4_DEVICE: + m_pColorCombiner = new COGLColorCombiner4(pRender); + DebugMessage(M64MSG_INFO, "OpenGL Combiner: OGL 1.4"); + break; + case OGL_1_4_V2_DEVICE: + m_pColorCombiner = new COGLColorCombiner4v2(pRender); + DebugMessage(M64MSG_INFO, "OpenGL Combiner: OGL 1.4 Version 2"); + break; + case OGL_TNT2_DEVICE: + m_pColorCombiner = new COGLColorCombinerTNT2(pRender); + DebugMessage(M64MSG_INFO, "OpenGL Combiner: TNT2"); + break; + case NVIDIA_OGL_DEVICE: + m_pColorCombiner = new COGLColorCombinerNvidia(pRender); + DebugMessage(M64MSG_INFO, "OpenGL Combiner: Nvidia"); + break; + case OGL_FRAGMENT_PROGRAM: + m_pColorCombiner = new COGL_FragmentProgramCombiner(pRender); + DebugMessage(M64MSG_INFO, "OpenGL Combiner: Fragment Program"); + break; + default: + break; + } + } + +#elif SDL_VIDEO_OPENGL_ES2 + m_pColorCombiner = new COGL_FragmentProgramCombiner(pRender); + DebugMessage(M64MSG_INFO, "OpenGL Combiner: Fragment Program"); +#endif + } + + SAFE_CHECK(m_pColorCombiner); + } + + return m_pColorCombiner; +} + +CBlender * OGLDeviceBuilder::CreateAlphaBlender(CRender *pRender) +{ + if( m_pAlphaBlender == NULL ) + { + m_pAlphaBlender = new COGLBlender(pRender); + SAFE_CHECK(m_pAlphaBlender); + } + + return m_pAlphaBlender; +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/DeviceBuilder.h b/libmupen64plus/mupen64plus-video-rice/src/DeviceBuilder.h new file mode 100644 index 0000000000..0d6961bea0 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/DeviceBuilder.h @@ -0,0 +1,83 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + +#ifndef _DEVICE_BUILDER_H +#define _DEVICE_BUILDER_H + +#include "Blender.h" +#include "Combiner.h" +#include "Config.h" +#include "GraphicsContext.h" +#include "TextureManager.h" + +//======================================================================== + +class CDeviceBuilder +{ +public: + virtual CGraphicsContext * CreateGraphicsContext(void)=0; + virtual CRender * CreateRender(void)=0; + virtual CTexture * CreateTexture(uint32 dwWidth, uint32 dwHeight, TextureUsage usage = AS_NORMAL)=0; + virtual CColorCombiner * CreateColorCombiner(CRender *pRender)=0; + virtual CBlender * CreateAlphaBlender(CRender *pRender)=0; + + void DeleteGraphicsContext(void); + void DeleteRender(void); + void DeleteColorCombiner(void); + void DeleteAlphaBlender(void); + + static void DeleteBuilder(void); + static CDeviceBuilder* GetBuilder(void); + static void SelectDeviceType(SupportedDeviceType type); + static SupportedDeviceType GetDeviceType(void); + static SupportedDeviceType GetGeneralDeviceType(void); + static SupportedDeviceType m_deviceGeneralType; +protected: + CDeviceBuilder(); + virtual ~CDeviceBuilder(); + + static CDeviceBuilder* CreateBuilder(SupportedDeviceType type); + static SupportedDeviceType m_deviceType; + static CDeviceBuilder* m_pInstance; + + CRender* m_pRender; + CGraphicsContext* m_pGraphicsContext; + CColorCombiner* m_pColorCombiner; + CBlender* m_pAlphaBlender; +}; + +class OGLDeviceBuilder : public CDeviceBuilder +{ + friend class CDeviceBuilder; +public: + CGraphicsContext * CreateGraphicsContext(void); + CRender * CreateRender(void); + CTexture * CreateTexture(uint32 dwWidth, uint32 dwHeight, TextureUsage usage = AS_NORMAL); + CColorCombiner * CreateColorCombiner(CRender *pRender); + CBlender * CreateAlphaBlender(CRender *pRender); + +protected: + OGLDeviceBuilder() {}; + virtual ~OGLDeviceBuilder() {}; + +}; + +#endif + + diff --git a/libmupen64plus/mupen64plus-video-rice/src/DirectXDecodedMux.cpp b/libmupen64plus/mupen64plus-video-rice/src/DirectXDecodedMux.cpp new file mode 100644 index 0000000000..2fab96359f --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/DirectXDecodedMux.cpp @@ -0,0 +1,169 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#include "Combiner.h" +#include "DirectXDecodedMux.h" +#include + +#ifdef min +#undef min +#endif +#ifdef max +#undef max +#endif + +//This function is called after Reformat to handel two texels in 1 cycle, D3D can not handle +//two texels in a single stage, the texels must be splited into multiple stages +void CDirectXDecodedMux::ReformatAgainWithTwoTexels(void) +{ + if( CountTexels() < 2 ) + return; + + for( int i=0; i<2; i++ ) + { + N64CombinerType &m = m_n64Combiners[i]; + if( CountTexel1Cycle(m) < 2 ) + { + continue; //1st cycle does not have two texels, do nothing here + } + else + { + N64CombinerType &m2 = m_n64Combiners[i+2]; + + if( splitType[i] == CM_FMT_TYPE_A_MOD_C ) //Texel0*Texel1 + { + if( splitType[i+2] == CM_FMT_TYPE_NOT_USED ) + { + //Change Texel1*Texel0 to (SEL(tex1), MOD(tex0)) + m.d = m.a; + m.a = MUX_0; + m2.a = m.c; + m2.c = MUX_COMBINED; + m2.d = m2.b = MUX_0; + m.c = MUX_0; + splitType[i+2] = CM_FMT_TYPE_A_MOD_C; + splitType[i] = CM_FMT_TYPE_D; + } + else if( splitType[i+2] == CM_FMT_TYPE_A_MOD_C ) + { + if( m2.a == MUX_COMBINED ) + { + swap(m2.a, m2.c); + } + + if( m2.a != MUX_TEXEL0 && m2.a != MUX_TEXEL1 ) + { + //cool, we can swap m2.a to cycle1 and swap texel from cycle 1 to cycle 2 + swap(m.a, m2.a); + } + else + { + if( m.a == m2.a ) + { + swap(m.c, m2.a); + } + else + { + swap(m.a, m2.a); + } + } + } + else if( splitType[i+2] == CM_FMT_TYPE_A_MOD_C_ADD_D ) + { + if( m2.a == MUX_COMBINED ) + { + swap(m2.a, m2.c); + } + + if( m2.c == MUX_COMBINED && m2.d != MUX_COMBINED ) + { + //Cycle1: texel0*texel1 + //Cycle2: a*cmd+d + if( m2.a != MUX_TEXEL0 && m2.a != MUX_TEXEL1 ) + { + //cool, we can swap m2.a to cycle1 and swap texel from cycle 1 to cycle 2 + swap(m.a, m2.a); + } + else + { + if( m.a == m2.a ) + { + swap(m.c, m2.a); + } + else + { + swap(m.a, m2.a); + } + } + } + } + else if( splitType[i] == CM_FMT_TYPE_A_ADD_D ) //Texel0+Texel1 + { + if( splitType[i+2] == CM_FMT_TYPE_NOT_USED ) + { + //Change Texel1*Texel0 to (SEL(tex1), MOD(tex0)) + m2.a = m.d; + m2.d = MUX_COMBINED; + m2.b = m2.c = MUX_0; + m.d = m.a; + m.a = MUX_0; + splitType[i+2] = CM_FMT_TYPE_A_ADD_D; + splitType[i] = CM_FMT_TYPE_D; + } + else if( splitType[i+2] == CM_FMT_TYPE_A_ADD_D ) + { + if( m2.a == MUX_COMBINED ) + { + swap(m2.a, m2.d); + } + + if( m2.a != MUX_TEXEL0 && m2.a != MUX_TEXEL1 ) + { + swap(m2.a, m.a); + } + else + { + if( m.a == m2.a ) + { + swap(m.d, m2.a); + } + else + { + swap(m.a, m2.a); + } + } + } + } + } + + if( CountTexel1Cycle(m2) < 2 ) + { + continue; //2nd cycle does not have two texels + } + } + } +} + +void CDirectXDecodedMux::Reformat(bool do_complement) +{ + DecodedMux::Reformat(do_complement); + ReformatAgainWithTwoTexels(); + mType = std::max(std::max(std::max(splitType[0], splitType[1]),splitType[2]),splitType[3]); +} + + diff --git a/libmupen64plus/mupen64plus-video-rice/src/DirectXDecodedMux.h b/libmupen64plus/mupen64plus-video-rice/src/DirectXDecodedMux.h new file mode 100644 index 0000000000..318ff3127c --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/DirectXDecodedMux.h @@ -0,0 +1,32 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#include "DecodedMux.h" + +#ifndef _DIRECTX_DECODEDMUX_H_ +#define _DIRECTX_DECODEDMUX_H_ + +class CDirectXDecodedMux : public DecodedMux +{ + void ReformatAgainWithTwoTexels(void); + virtual void Reformat(bool do_complement = true); +}; + +#endif + + diff --git a/libmupen64plus/mupen64plus-video-rice/src/ExtendedRender.h b/libmupen64plus/mupen64plus-video-rice/src/ExtendedRender.h new file mode 100644 index 0000000000..180e84c01b --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/ExtendedRender.h @@ -0,0 +1,59 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#ifndef _EXTENDED_RENDER_H_ +#define _EXTENDED_RENDER_H_ + +#include "RSP_Parser.h" +#include "RSP_S2DEX.h" + +// Define the render extension interface and provide empty implementation of +// the render extension functions. +// Real render can either implement or not implement these extended render functions + +// These extended render functions are in different groups: +// - Group #1: Related to frame buffer +// - Group #2: Related to 2D sprite +// - Group #3: Related BG and ScaledBG +class CExtendedRender +{ +public: + virtual ~CExtendedRender() {} + + virtual void DrawFrameBuffer(bool useVIreg=false, uint32 left=0, uint32 top=0, uint32 width=0, uint32 height=0) {}; + virtual void LoadFrameBuffer(bool useVIreg=false, uint32 left=0, uint32 top=0, uint32 width=0, uint32 height=0) {}; + virtual void LoadTxtrBufFromRDRAM(void) {}; + virtual void LoadTxtrBufIntoTexture(void) {}; + + virtual void DrawSprite2D(Sprite2DInfo &info, uint32 ucode) {}; + virtual void LoadSprite2D(Sprite2DInfo &info, uint32 ucode) {}; + + + virtual void DrawSprite(uObjTxSprite &sprite, bool rectR = true) {}; + virtual void DrawObjBG1CYC(uObjScaleBg &bg, bool scaled=true) {}; + virtual void DrawObjBGCopy(uObjBg &info) {}; + virtual void LoadObjBGCopy(uObjBg &info) {}; + virtual void LoadObjBG1CYC(uObjScaleBg &info) {}; + virtual void LoadObjSprite(uObjTxSprite &info, bool useTIAddr=false) {}; + + virtual void DrawText(const char* str, RECT *rect) {}; +}; + + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/FrameBuffer.cpp b/libmupen64plus/mupen64plus-video-rice/src/FrameBuffer.cpp new file mode 100644 index 0000000000..95fc81cb7b --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/FrameBuffer.cpp @@ -0,0 +1,2086 @@ +/* +Copyright (C) 2005 Rice1964 + +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. + +*/ + +// =========================================================================== + +#include + +#include "ConvertImage.h" +#include "DeviceBuilder.h" +#include "FrameBuffer.h" +#include "UcodeDefs.h" +#include "RSP_Parser.h" +#include "Render.h" + +extern TMEMLoadMapInfo g_tmemLoadAddrMap[0x200]; // Totally 4KB TMEM; + +// 0 keeps the most recent CI info +// 1 keeps the frame buffer CI info which is being displayed now +// 2 keeps the older frame buffer CI info. This can be used if we are using triple buffer +/* Overview of framebuffer implementation +1) Check if backbuffer has changed, via different detection techniques +2) If changed, we copy the GFX card's backbuffer to main RAM +3) This is slow due to the reading process, not the writing +*/ + +RecentCIInfo g_RecentCIInfo[5]; +RecentCIInfo *g_uRecentCIInfoPtrs[5] = +{ + &g_RecentCIInfo[0], + &g_RecentCIInfo[1], + &g_RecentCIInfo[2], + &g_RecentCIInfo[3], + &g_RecentCIInfo[4], +}; + +int numOfRecentCIInfos = 5; + +RecentViOriginInfo g_RecentVIOriginInfo[5]; +uint32 dwBackBufferSavedAtFrame=0; + +RenderTextureInfo gRenderTextureInfos[20]; +int numOfTxtBufInfos = sizeof(gRenderTextureInfos)/sizeof(RenderTextureInfo); +RenderTextureInfo *g_pRenderTextureInfo = NULL; + +FrameBufferManager* g_pFrameBufferManager = NULL; + +bool LastCIIsNewCI=false; + +FrameBufferManager::FrameBufferManager() : + m_isRenderingToTexture(false), + m_curRenderTextureIndex(-1), + m_lastTextureBufferIndex(-1) +{ +} + +FrameBufferManager::~FrameBufferManager() +{ +} + +void FrameBufferManager::CloseUp() +{ + for( int i=0; i=0x20?1:0; + return ((r>>3)<>3)<>3)<>7); +} + +uint16 ConvertRGBATo555(uint32 color32) +{ + return (uint16)((((color32>>19)&0x1F)<>11)&0x1F)<>3)&0x1F)<>31)));; +} + +void FrameBufferManager::UpdateRecentCIAddr(SetImgInfo &ciinfo) +{ + if( ciinfo.dwAddr == g_uRecentCIInfoPtrs[0]->dwAddr ) + return; + + RecentCIInfo *temp; + + int i; + for( i=1; idwAddr ) + { + temp = g_uRecentCIInfoPtrs[i]; + + for( int j=i; j>0; j-- ) + { + g_uRecentCIInfoPtrs[j] = g_uRecentCIInfoPtrs[j-1]; + } + break; + } + } + + if( i >= numOfRecentCIInfos ) + { + temp = g_uRecentCIInfoPtrs[4]; + g_uRecentCIInfoPtrs[4] = g_uRecentCIInfoPtrs[3]; + g_uRecentCIInfoPtrs[3] = g_uRecentCIInfoPtrs[2]; + g_uRecentCIInfoPtrs[2] = g_uRecentCIInfoPtrs[1]; + g_uRecentCIInfoPtrs[1] = g_uRecentCIInfoPtrs[0]; + temp->dwCopiedAtFrame = 0; + temp->bCopied = false; + } + + g_uRecentCIInfoPtrs[0] = temp; + + // Fix me here for Mario Tennis + temp->dwLastWidth = windowSetting.uViWidth; + temp->dwLastHeight = windowSetting.uViHeight; + + temp->dwFormat = ciinfo.dwFormat; + temp->dwAddr = ciinfo.dwAddr; + temp->dwSize = ciinfo.dwSize; + temp->dwWidth = ciinfo.dwWidth; + temp->dwHeight = gRDP.scissor.bottom; + temp->dwMemSize = (temp->dwWidth*temp->dwHeight/2)<dwSize; + temp->bCopied = false; + temp->lastUsedFrame = status.gDlistCount; + temp->lastSetAtUcode = status.gUcodeCount; +} + + +/************************************************************************/ +/* Mark the ciinfo entry that the ciinfo is used by VI origin register */ +/* in another word, this is a real frame buffer, not a fake frame buffer*/ +/* Fake frame buffers are never really used by VI origin */ +/************************************************************************/ +void FrameBufferManager::SetAddrBeDisplayed(uint32 addr) +{ + uint32 viwidth = *g_GraphicsInfo.VI_WIDTH_REG; + addr &= (g_dwRamSize-1); + + int i; + for( i=0; idwAddr+2*viwidth == addr ) + { + g_uRecentCIInfoPtrs[i]->bUsedByVIAtFrame = status.gDlistCount; + } + else if( addr >= g_uRecentCIInfoPtrs[i]->dwAddr && addr < g_uRecentCIInfoPtrs[i]->dwAddr+0x1000 ) + { + g_uRecentCIInfoPtrs[i]->bUsedByVIAtFrame = status.gDlistCount; + } + } + + for( i=0; idwAddr == 0 ) + continue; + + if( g_uRecentCIInfoPtrs[i]->dwAddr == addr ) + { + if( status.gDlistCount-g_uRecentCIInfoPtrs[i]->bUsedByVIAtFrame < 20 ) + //if( g_uRecentCIInfoPtrs[i]->bUsedByVIAtFrame != 0 ) + { + return true; + } + else + { + TXTRBUF_DUMP(TRACE0("This is a new buffer address, the addr is never a displayed buffer");); + return false; + } + } + } + + for( i=0; i addr && + (g_RecentVIOriginInfo[i].addr - addr)%width == 0 && + (g_RecentVIOriginInfo[i].addr - addr)/width <= 4) + { + if( status.gDlistCount-g_RecentVIOriginInfo[i].FrameCount < 20 ) + //if( g_RecentVIOriginInfo[i].FrameCount != 0 ) + { + return true; + } + else + { + TXTRBUF_DUMP(DebuggerAppendMsg("This is a new buffer address, the addr is never a displayed buffer");); + return false; + } + } + } + } + + if( status.gDlistCount > 20 ) + return false; + else + { + TXTRBUF_DUMP({DebuggerAppendMsg("This is a new buffer address, the addr is never a displayed buffer");}); + return true; + } +} + +int FrameBufferManager::FindRecentCIInfoIndex(uint32 addr) +{ + for( int i=0; idwAddr <= addr && addr < g_uRecentCIInfoPtrs[i]->dwAddr+g_uRecentCIInfoPtrs[i]->dwMemSize ) + { + return i; + } + } + return -1; +} + +bool FrameBufferManager::IsDIaRenderTexture() +{ + // Knowing g_CI and g_ZI + + //if( g_CI.dwWidth ) + + bool foundSetScissor=false; + bool foundFillRect=false; + bool foundSetFillColor=false; + bool foundSetCImg=false; + uint32 newFillColor = 0; + + uint32 dwPC = gDlistStack[gDlistStackPointer].pc; // This points to the next instruction + + for( int i=0; i<10; i++ ) + { + uint32 w0 = *(uint32 *)(g_pRDRAMu8 + dwPC + i*8); + uint32 w1 = *(uint32 *)(g_pRDRAMu8 + dwPC + 4 + i*8); + + if( (w0>>24) == RDP_SETSCISSOR ) + { + foundSetScissor = true; + continue; + } + + if( (w0>>24) == RDP_SETFILLCOLOR ) + { + foundSetFillColor = true; + newFillColor = w1; + continue; + } + + if( (w0>>24) == RDP_FILLRECT ) + { + uint32 x0 = ((w1>>12)&0xFFF)/4; + uint32 y0 = ((w1>>0 )&0xFFF)/4; + uint32 x1 = ((w0>>12)&0xFFF)/4; + + if( x0 == 0 && y0 == 0 ) + { + if( x1 == g_CI.dwWidth ) + { + foundFillRect = true; + continue; + } + + if(x1 == (unsigned int)(g_CI.dwWidth-1)) + { + foundFillRect = true; + continue; + } + } + } + + if( (w0>>24) == RDP_TEXRECT ) + { + break; + } + + if( (w0>>24) == RDP_SETCIMG ) + { + foundSetCImg = true; + break; + } + } + + /* + bool foundSetScissor=false; + bool foundFillRect=false; + bool foundSetFillColor=false; + bool foundSetCImg=false; + bool foundTxtRect=false; + int ucodeLength=10; + uint32 newFillColor; + */ + + if( foundFillRect ) + { + if( foundSetFillColor ) + { + if( newFillColor != 0xFFFCFFFC ) + return true; // this is a render_texture + else + return false; + } + + if( gRDP.fillColor != 0x00FFFFF7 ) + return true; // this is a render_texture + else + return false; // this is a normal ZImg + } + else if( foundSetFillColor && newFillColor == 0xFFFCFFFC && foundSetCImg ) + { + return false; + } + else + { + return true; + } + + + if( !foundSetCImg ) + return true; + + if( foundSetScissor ) + return true; +} + +int FrameBufferManager::CheckAddrInBackBuffers(uint32 addr, uint32 memsize, bool copyToRDRAM) +{ + int r = FindRecentCIInfoIndex(addr); + + if( r >= 0 ) + { + // Also check if the address is overwritten by a recent render_texture + //int t = CheckAddrInRenderTextures(addr,false); + int t =-1; + for( int i=0; i=gRenderTextureInfos[i].CI_Info.dwAddr && addr < gRenderTextureInfos[i].CI_Info.dwAddr+bufMemSize) + { + if( g_uRecentCIInfoPtrs[r]->lastSetAtUcode < gRenderTextureInfos[i].updateAtUcodeCount ) + { + t = i; + break; + } + } + } + + if( t >= 0 ) + return -1; + } + + if( r >= 0 && status.gDlistCount - g_uRecentCIInfoPtrs[r]->lastUsedFrame <= 3 && g_uRecentCIInfoPtrs[r]->bCopied == false ) + { + DEBUGGER_IF_DUMP((logTextureBuffer&&r==1),TRACE2("Hit current front buffer at %08X, size=0x%X", addr, memsize)); + DEBUGGER_IF_DUMP((logTextureBuffer&&r==0),TRACE2("Hit current back buffer at %08X, size=0x%X", addr, memsize)); + DEBUGGER_IF_DUMP((logTextureBuffer&&r>1),TRACE2("Hit old back buffer at %08X, size=0x%X", addr, memsize)); + + SaveBackBuffer(r, NULL, true); + } + + return r; +} + + +uint8 CIFindIndex(uint16 val) +{ + for( int i=0; i<=0xFF; i++ ) + { + if( val == g_wRDPTlut[i] ) + { + return (uint8)i; + } + } + return 0; +} + + +void TexRectToFrameBuffer_8b(uint32 dwXL, uint32 dwYL, uint32 dwXH, uint32 dwYH, float t0u0, float t0v0, float t0u1, float t0v1, uint32 dwTile) +{ + // Copy the framebuffer texture into the N64 framebuffer memory + // Used in Yoshi + + /* + uint32 maxW = g_pRenderTextureInfo->CI_Info.dwWidth; + uint32 maxH = maxW*3/4; + if( status.dwTvSystem == TV_SYSTEM_PAL ) + { + maxH = maxW*9/11; + } + */ + + uint32 maxW = g_pRenderTextureInfo->N64Width; + uint32 maxH = g_pRenderTextureInfo->N64Height; + + uint32 maxOff = maxW*maxH; + + TMEMLoadMapInfo &info = g_tmemLoadAddrMap[gRDP.tiles[dwTile].dwTMem]; + uint32 dwWidth = dwXH-dwXL; + uint32 dwHeight = dwYH-dwYL; + + float xScale = (t0u1-t0u0)/dwWidth; + float yScale = (t0v1-t0v0)/dwHeight; + + uint8* dwSrc = g_pRDRAMu8 + info.dwLoadAddress; + uint8* dwDst = g_pRDRAMu8 + g_pRenderTextureInfo->CI_Info.dwAddr; + + uint32 dwSrcPitch = gRDP.tiles[dwTile].dwPitch; + uint32 dwDstPitch = g_pRenderTextureInfo->CI_Info.dwWidth; + + uint32 dwSrcOffX = gRDP.tiles[dwTile].hilite_sl; + uint32 dwSrcOffY = gRDP.tiles[dwTile].hilite_tl; + + uint32 dwLeft = dwXL; + uint32 dwTop = dwYL; + + dwWidth = min(dwWidth, maxW-dwLeft); + dwHeight = min(dwHeight, maxH-dwTop); + + if( maxH <= dwTop ) + return; + + for (uint32 y = 0; y < dwHeight; y++) + { + uint32 dwByteOffset = (uint32)(((y*yScale+dwSrcOffY) * dwSrcPitch) + dwSrcOffX); + + for (uint32 x = 0; x < dwWidth; x++) + { + if( (((y+dwTop)*dwDstPitch+x+dwLeft)^0x3) > maxOff ) + { +#ifdef DEBUGGER + TRACE0("Warning: Offset exceeds limit"); +#endif + continue; + } + dwDst[((y+dwTop)*dwDstPitch+x+dwLeft)^0x3] = dwSrc[(uint32)(dwByteOffset+x*xScale) ^ 0x3]; + } + } + + TXTRBUF_DUMP(DebuggerAppendMsg("TexRect To FrameBuffer: X0=%d, Y0=%d, X1=%d, Y1=%d,\n\t\tfS0=%f, fT0=%f, fS1=%f, fT1=%f ", + dwXL, dwYL, dwXH, dwYH, t0v0, t0v0, t0u1, t0v1);); +} + +void TexRectToN64FrameBuffer_16b(uint32 x0, uint32 y0, uint32 width, uint32 height, uint32 dwTile) +{ + // Copy the framebuffer texture into the N64 RDRAM framebuffer memory structure + + DrawInfo srcInfo; + if( g_textures[dwTile].m_pCTexture->StartUpdate(&srcInfo) == false ) + { + DebuggerAppendMsg("Fail to lock texture:TexRectToN64FrameBuffer_16b" ); + return; + } + + uint32 n64CIaddr = g_CI.dwAddr; + uint32 n64CIwidth = g_CI.dwWidth; + + for (uint32 y = 0; y < height; y++) + { + uint32* pSrc = (uint32*)((uint8*)srcInfo.lpSurface + y * srcInfo.lPitch); + uint16* pN64Buffer = (uint16*)(g_pRDRAMu8+(n64CIaddr&(g_dwRamSize-1)))+(y+y0)*n64CIwidth; + + for (uint32 x = 0; x < width; x++) + { + pN64Buffer[x+x0] = ConvertRGBATo555(pSrc[x]); + } + } + + g_textures[dwTile].m_pCTexture->EndUpdate(&srcInfo); +} + +#define FAST_CRC_CHECKING_INC_X 13 +#define FAST_CRC_CHECKING_INC_Y 11 +#define FAST_CRC_MIN_Y_INC 2 +#define FAST_CRC_MIN_X_INC 2 +#define FAST_CRC_MAX_X_INC 7 +#define FAST_CRC_MAX_Y_INC 3 +extern uint32 dwAsmHeight; +extern uint32 dwAsmPitch; +extern uint32 dwAsmdwBytesPerLine; +extern uint32 dwAsmCRC; +extern uint8* pAsmStart; + +uint32 CalculateRDRAMCRC(void *pPhysicalAddress, uint32 left, uint32 top, uint32 width, uint32 height, uint32 size, uint32 pitchInBytes ) +{ + dwAsmCRC = 0; + dwAsmdwBytesPerLine = ((width<=32 || (dwAsmdwBytesPerLine>>2)>=16)) + { + uint32 realWidthInDWORD = dwAsmdwBytesPerLine>>2; + uint32 xinc = realWidthInDWORD / FAST_CRC_CHECKING_INC_X; + if( xinc < FAST_CRC_MIN_X_INC ) + { + xinc = min(FAST_CRC_MIN_X_INC, width); + } + if( xinc > FAST_CRC_MAX_X_INC ) + { + xinc = FAST_CRC_MAX_X_INC; + } + + uint32 yinc = height / FAST_CRC_CHECKING_INC_Y; + if( yinc < FAST_CRC_MIN_Y_INC ) + { + yinc = min(FAST_CRC_MIN_Y_INC, height); + } + if( yinc > FAST_CRC_MAX_Y_INC ) + { + yinc = FAST_CRC_MAX_Y_INC; + } + + uint32 pitch = pitchInBytes>>2; + register uint32 *pStart = (uint32*)(pPhysicalAddress); + pStart += (top * pitch) + (((left<>3); + + // The original assembly code had a bug in it (it incremented pStart by 'pitch' in bytes, not in dwords) + // This C code implements the same algorithm as the ASM but without the bug + uint32 y = 0; + while (y < height) + { + uint32 x = 0; + while (x < realWidthInDWORD) + { + dwAsmCRC = (dwAsmCRC << 4) + ((dwAsmCRC >> 28) & 15); + dwAsmCRC += pStart[x]; + x += xinc; + dwAsmCRC += x; + } + dwAsmCRC ^= y; + y += yinc; + pStart += pitch; + } + } + else + { + try + { + dwAsmdwBytesPerLine = ((width<>1); + + dwAsmHeight = height - 1; + dwAsmPitch = pitchInBytes; + +#if defined(NO_ASM) + uint32 pitch = pitchInBytes>>2; + uint32* pStart = (uint32*)pPhysicalAddress; + pStart += (top * pitch) + (((left<>3); + + uint32 y = dwAsmHeight; + uint32 x,esi; + + while((int)y >= 0) + { + x = dwAsmdwBytesPerLine - 4; + while((int)x >= 0) + { + esi = *(uint32*)(pAsmStart + x); + esi ^= x; + + dwAsmCRC = (dwAsmCRC << 4) + ((dwAsmCRC >> 28) & 15); + dwAsmCRC += esi; + x-=4; + } + esi ^= y; + dwAsmCRC += esi; + pAsmStart += dwAsmPitch; + y--; + } + +#elif !defined(__GNUC__) // !defined(NO_ASM) + __asm + { + push eax + push ebx + push ecx + push edx + push esi + + mov ecx, pAsmStart; // = pStart + mov edx, 0 // The CRC + mov eax, dwAsmHeight // = y +l2: mov ebx, dwAsmdwBytesPerLine // = x + sub ebx, 4 +l1: mov esi, [ecx+ebx] + xor esi, ebx + rol edx, 4 + add edx, esi + sub ebx, 4 + jge l1 + xor esi, eax + add edx, esi + add ecx, dwAsmPitch + dec eax + jge l2 + + mov dwAsmCRC, edx + + pop esi + pop edx + pop ecx + pop ebx + pop eax + } +#elif defined(__x86_64__) // defined(__GNUC__) && !defined(NO_ASM) + asm volatile(" xorl %k2, %k2 \n" + " movslq %k4, %q4 \n" + "0: \n" + " movslq %3, %%rbx \n" + " sub $4, %%rbx \n" + "1: \n" + " movl (%0,%%rbx,1), %%eax \n" + " xorl %%ebx, %%eax \n" + " roll $4, %k2 \n" + " addl %%eax, %k2 \n" + " sub $4, %%rbx \n" + " jge 1b \n" + " xorl %k1, %%eax \n" + " addl %%eax, %k2 \n" + " add %q4, %0 \n" + " decl %k1 \n" + " jge 0b \n" + : "+r"(pAsmStart), "+r"(dwAsmHeight), "=&r"(dwAsmCRC) + : "m"(dwAsmdwBytesPerLine), "r"(dwAsmPitch) + : "%rbx", "%rax", "memory", "cc" + ); +#elif !defined(__PIC__) // !defined(__x86_64__) && defined(__GNUC__) && !defined(NO_ASM) + asm volatile("pusha \n" + "mov %[pAsmStart], %%ecx \n" // = pStart + "mov $0, %%edx \n" // The CRC + "mov %[dwAsmHeight], %%eax \n" // = y + "0: \n" //l2: + "mov %[dwAsmdwBytesPerLine], %%ebx \n" // = x + "sub $4, %%ebx \n" + "1: \n" //l1: + "mov (%%ecx,%%ebx), %%esi \n" + "xor %%ebx, %%esi \n" + "rol $4, %%edx \n" + "add %%esi, %%edx \n" + "sub $4, %%ebx \n" + "jge 1b \n" //jge l1 + "xor %%eax, %%esi \n" + "add %%esi, %%edx \n" + "add %[dwAsmPitch], %%ecx \n" + "dec %%eax \n" + "jge 0b \n" //jge l2 + + "mov %%edx, %[dwAsmCRC] \n" + "popa \n" + : [pAsmStart]"+m"(pAsmStart), [dwAsmHeight]"+m"(dwAsmHeight), [dwAsmCRC]"=m"(dwAsmCRC) + : [dwAsmdwBytesPerLine]"m"(dwAsmdwBytesPerLine), [dwAsmPitch]"m"(dwAsmPitch) + : "memory", "cc" + ); +#else // defined(__PIC__) && !defined(__x86_64__) && defined(__GNUC__) && !defined(NO_ASM) + unsigned int saveEBX; + unsigned int saveEAX; + unsigned int saveECX; + unsigned int saveEDX; + unsigned int saveESI; + unsigned int asmdwBytesPerLine = dwAsmdwBytesPerLine; + unsigned int asmPitch = dwAsmPitch; + unsigned int asmHeight = dwAsmHeight; + unsigned int asmCRC; + asm volatile("mov %%ebx, %2 \n" + "mov %%eax, %5 \n" + "mov %%ecx, %7 \n" + "mov %%edx, %8 \n" + "mov %%esi, %9 \n" + "mov %0, %%ecx \n" // = pStart + "mov $0, %%edx \n" // The CRC + "mov %1, %%eax \n" // = y + "0: \n" //l2: + "mov %3, %%ebx \n" // = x + "sub $4, %%ebx \n" + "1: \n" //l1: + "mov (%%ecx,%%ebx), %%esi \n" + "xor %%ebx, %%esi \n" + "rol $4, %%edx \n" + "add %%esi, %%edx \n" + "sub $4, %%ebx \n" + "jge 1b \n" //jge l1 + "xor %%eax, %%esi \n" + "add %%esi, %%edx \n" + "add %4, %%ecx \n" + "dec %%eax \n" + "jge 0b \n" //jge l2 + + "mov %2, %%ebx \n" + "mov %%edx, %6 \n" + "mov %5, %%eax \n" + "mov %7, %%ecx \n" + "mov %8, %%edx \n" + "mov %9, %%esi \n" + : + : "m"(pAsmStart), "m"(asmHeight), "m"(saveEBX), "m"(asmdwBytesPerLine), "m"(asmPitch), "m"(saveEAX), + "m"(asmCRC), "m"(saveECX), "m"(saveEDX), "m"(saveESI) + : "memory", "cc" + ); + dwAsmCRC = asmCRC; +#endif + } + catch(...) + { + TRACE0("Exception in texture CRC calculation"); + } + } + return dwAsmCRC; +} +unsigned char CalculateMaxCI(void *pPhysicalAddress, uint32 left, uint32 top, uint32 width, uint32 height, uint32 size, uint32 pitchInBytes ) +{ + uint32 x, y; + unsigned char *buf; + unsigned char val = 0; + + if( TXT_SIZE_8b == size ) + { + for( y = 0; y val ) val = buf[x]; + if( val == 0xFF ) + return 0xFF; + } + } + } + else + { + unsigned char val1,val2; + left >>= 1; + width >>= 1; + for( y = 0; y>4; + val2 = buf[x]&0xF; + if( val1 > val ) val = val1; + if( val2 > val ) val = val2; + if( val == 0xF ) + return 0xF; + } + } + } + + return val; +} + +bool FrameBufferManager::FrameBufferInRDRAMCheckCRC() +{ + RecentCIInfo &p = *(g_uRecentCIInfoPtrs[0]); + uint8 *pFrameBufferBase = (uint8*)(g_pRDRAMu8+p.dwAddr); + uint32 pitch = (p.dwWidth << p.dwSize ) >> 1; + uint32 crc = CalculateRDRAMCRC(pFrameBufferBase, 0, 0, p.dwWidth, p.dwHeight, p.dwSize, pitch); + if( crc != p.dwCRC ) + { + p.dwCRC = crc; + TRACE0("Frame Buffer CRC mismitch, it is modified by CPU"); + return false; + } + else + { + return true; + } +} + +extern std::vector frameWriteRecord; +void FrameBufferManager::FrameBufferWriteByCPU(uint32 addr, uint32 size) +{ + if( !frameBufferOptions.bProcessCPUWrite ) return; + //WARNING(TRACE2("Frame Buffer Write, addr=%08X, CI Addr=%08X", addr, g_CI.dwAddr)); + status.frameWriteByCPU = TRUE; + frameWriteRecord.push_back(addr&(g_dwRamSize-1)); +} + +extern RECT frameWriteByCPURect; +extern std::vector frameWriteByCPURects; +extern RECT frameWriteByCPURectArray[20][20]; +extern bool frameWriteByCPURectFlag[20][20]; +#define FRAMEBUFFER_IN_BLOCK +bool FrameBufferManager::ProcessFrameWriteRecord() +{ + int size = frameWriteRecord.size(); + if( size == 0 ) return false; + + int index = FindRecentCIInfoIndex(frameWriteRecord[0]); + if( index == -1 ) + { + LOG_TEXTURE(TRACE1("Frame Buffer Write to non-record addr = %08X", frameWriteRecord[0])); + frameWriteRecord.clear(); + return false; + } + else + { + uint32 base = g_uRecentCIInfoPtrs[index]->dwAddr; + uint32 uwidth = g_uRecentCIInfoPtrs[index]->dwWidth; + uint32 uheight = g_uRecentCIInfoPtrs[index]->dwHeight; + uint32 upitch = uwidth<<1; + + frameWriteByCPURect.left=uwidth-1; + frameWriteByCPURect.top = uheight-1; + + frameWriteByCPURect.right=0; + frameWriteByCPURect.bottom = 0; + + int x, y, off; + + for( int i=0; idwMemSize ) + { + y = off/upitch; + x = (off - y*upitch)>>1; + +#ifdef FRAMEBUFFER_IN_BLOCK + int xidx=x/32; + int yidx=y/24; + + RECT &rect = frameWriteByCPURectArray[xidx][yidx]; + + if( !frameWriteByCPURectFlag[xidx][yidx] ) + { + rect.left=rect.right=x; + rect.top=rect.bottom=y; + frameWriteByCPURectFlag[xidx][yidx]=true; + } + else + { + if( x < rect.left ) rect.left = x; + if( x > rect.right ) rect.right = x; + if( y < rect.top ) rect.top = y; + if( y > rect.bottom ) rect.bottom = y; + } +#else + if( x < frameWriteByCPURect.left ) frameWriteByCPURect.left = x; + if( x > frameWriteByCPURect.right ) frameWriteByCPURect.right = x; + if( y < frameWriteByCPURect.top ) frameWriteByCPURect.top = y; + if( y > frameWriteByCPURect.bottom ) frameWriteByCPURect.bottom = y; +#endif + } + } + + frameWriteRecord.clear(); + LOG_TEXTURE(TRACE4("Frame Buffer Write: Left=%d, Top=%d, Right=%d, Bottom=%d", frameWriteByCPURect.left, + frameWriteByCPURect.top, frameWriteByCPURect.right, frameWriteByCPURect.bottom)); + return true; + } +} + +void FrameBufferManager::FrameBufferReadByCPU( uint32 addr ) +{ + ///return; // it does not work very well anyway + + + if( !frameBufferOptions.bProcessCPURead ) return; + + addr &= (g_dwRamSize-1); + int index = FindRecentCIInfoIndex(addr); + if( index == -1 ) + { + // Check if this is the depth buffer + uint32 size = 2*g_RecentCIInfo[0].dwWidth*g_RecentCIInfo[0].dwHeight; + addr &= 0x3FFFFFFF; + + if( addr >= g_ZI.dwAddr && addr < g_ZI.dwAddr + size ) + { + TXTRBUF_OR_CI_DUMP(TRACE1("Depth Buffer read, reported by emulator, addr=%08X", addr)); + } + else + { + return; + } + } + + if( status.gDlistCount - g_uRecentCIInfoPtrs[index]->lastUsedFrame > 3 ) + { + // Ok, we don't have this frame anymore + return; + } + + //TXTRBUF_OR_CI_DUMP(TRACE1("FB Read By CPU at %08X", addr)); + if( g_uRecentCIInfoPtrs[index]->bCopied ) return; + //if( addr != g_uRecentCIInfoPtrs[index]->dwAddr ) return; + + TXTRBUF_OR_CI_DUMP(TRACE1("Frame Buffer read, reported by emulator, addr=%08X", addr)); + uint32 size = 0x1000 - addr%0x1000; + CheckAddrInBackBuffers(addr, size, true); + + DEBUGGER_IF_DUMP(pauseAtNext,{TRACE0("Frame Buffer read");}); + DEBUGGER_PAUSE_AND_DUMP_NO_UPDATE(NEXT_RENDER_TEXTURE, + {DebuggerAppendMsg("Paused after setting Frame Buffer read:\n Cur CI Addr: 0x%08x, Fmt: %s Size: %s Width: %d", + g_CI.dwAddr, pszImgFormat[g_CI.dwFormat], pszImgSize[g_CI.dwSize], g_CI.dwWidth);}); +} + + + +extern RECT frameWriteByCPURect; +extern std::vector frameWriteByCPURects; +extern RECT frameWriteByCPURectArray[20][20]; +extern bool frameWriteByCPURectFlag[20][20]; +#define FRAMEBUFFER_IN_BLOCK + +void FrameBufferManager::UpdateFrameBufferBeforeUpdateFrame() +{ + if( (frameBufferOptions.bProcessCPUWrite && status.frameWriteByCPU ) || + (frameBufferOptions.bLoadBackBufFromRDRAM && !FrameBufferInRDRAMCheckCRC() ) ) + // Checks if frame buffer has been modified by CPU + // Only happens to Dr. Mario + { + if( frameBufferOptions.bProcessCPUWrite ) + { + if( ProcessFrameWriteRecord() ) + { +#ifdef FRAMEBUFFER_IN_BLOCK + int i,j; + for( i=0; i<20; i++) + { + for( j=0; j<20; j++ ) + { + if( frameWriteByCPURectFlag[i][j] ) + { + CRender::GetRender()->DrawFrameBuffer(false, frameWriteByCPURectArray[i][j].left, frameWriteByCPURectArray[i][j].top, + frameWriteByCPURectArray[i][j].right-frameWriteByCPURectArray[i][j].left+1, frameWriteByCPURectArray[i][j].bottom-frameWriteByCPURectArray[i][j].top+1); + } + } + } + for( i=0; i<20; i++) + { + for( j=0; j<20; j++ ) + { + if( frameWriteByCPURectFlag[i][j] ) + { + ClearN64FrameBufferToBlack(frameWriteByCPURectArray[i][j].left, frameWriteByCPURectArray[i][j].top, + frameWriteByCPURectArray[i][j].right-frameWriteByCPURectArray[i][j].left+1, frameWriteByCPURectArray[i][j].bottom-frameWriteByCPURectArray[i][j].top+1); + frameWriteByCPURectFlag[i][j] = false; + } + } + } + //memset(frameWriteByCPURectArray, 0, sizeof(frameWriteByCPURectArray)); + //memset(frameWriteByCPURectFlag, 0, sizeof(frameWriteByCPURectFlag)); +#else + CRender::GetRender()->DrawFrameBuffer(false, frameWriteByCPURect.left, frameWriteByCPURect.top, + frameWriteByCPURect.right-frameWriteByCPURect.left, frameWriteByCPURect.bottom-frameWriteByCPURect.top); + ClearN64FrameBufferToBlack(frameWriteByCPURect.left, frameWriteByCPURect.top, + frameWriteByCPURect.right-frameWriteByCPURect.left+1, frameWriteByCPURect.bottom-frameWriteByCPURect.top+1); + + /* + int size = frameWriteByCPURects.size(); + for( int i=0; iDrawFrameBuffer(false, frameWriteByCPURects[i].left, frameWriteByCPURects[i].top, + frameWriteByCPURects[i].right-frameWriteByCPURects[i].left, frameWriteByCPURects[i].bottom-frameWriteByCPURects[i].top); + ClearN64FrameBufferToBlack(frameWriteByCPURects[i].left, frameWriteByCPURects[i].top, + frameWriteByCPURects[i].right-frameWriteByCPURects[i].left+1, frameWriteByCPURects[i].bottom-frameWriteByCPURects[i].top+1); + } + frameWriteByCPURects.clear(); + */ +#endif + } + status.frameWriteByCPU = FALSE; + } + else + { + if (CRender::IsAvailable()) + { + RecentCIInfo &p = *(g_uRecentCIInfoPtrs[0]); + CRender::GetRender()->DrawFrameBuffer(false, 0,0,p.dwWidth,p.dwHeight); + ClearN64FrameBufferToBlack(); + } + } + } +} + +uint32 FrameBufferManager::ComputeCImgHeight(SetImgInfo &info, uint32 &height) +{ + uint32 dwPC = gDlistStack[gDlistStackPointer].pc; // This points to the next instruction + + for( int i=0; i<10; i++ ) + { + uint32 w0 = *(uint32 *)(g_pRDRAMu8 + dwPC + i*8); + uint32 w1 = *(uint32 *)(g_pRDRAMu8 + dwPC + 4 + i*8); + + if( (w0>>24) == RDP_SETSCISSOR ) + { + height = ((w1>>0 )&0xFFF)/4; + TXTRBUF_DETAIL_DUMP(TRACE1("buffer height = %d", height)); + return RDP_SETSCISSOR; + } + + if( (w0>>24) == RDP_FILLRECT ) + { + uint32 x0 = ((w1>>12)&0xFFF)/4; + uint32 y0 = ((w1>>0 )&0xFFF)/4; + uint32 x1 = ((w0>>12)&0xFFF)/4; + uint32 y1 = ((w0>>0 )&0xFFF)/4; + + if( x0 == 0 && y0 == 0 ) + { + if( x1 == info.dwWidth ) + { + height = y1; + TXTRBUF_DETAIL_DUMP(TRACE1("buffer height = %d", height)); + return RDP_FILLRECT; + } + + if(x1 == (unsigned int)(info.dwWidth-1)) + { + height = y1+1; + TXTRBUF_DETAIL_DUMP(TRACE1("buffer height = %d", height)); + return RDP_FILLRECT; + } + } + } + + if( (w0>>24) == RDP_SETCIMG ) + { + goto step2; + } + + if( (w0>>24) == RDP_SETCIMG ) + { + goto step2; + } + } + + if( gRDP.scissor.left == 0 && gRDP.scissor.top == 0 && (unsigned int)gRDP.scissor.right == info.dwWidth ) + { + height = gRDP.scissor.bottom; + TXTRBUF_DETAIL_DUMP(TRACE1("buffer height = %d", height)); + return RDP_SETSCISSOR+1; + } + +step2: + TXTRBUF_DETAIL_DUMP(TRACE0("Not sure about buffer height")); + + height = info.dwWidth*3/4; + if( status.dwTvSystem == TV_SYSTEM_PAL ) + { + height = info.dwWidth*9/11; + } + + if( gRDP.scissor.bottom < (int)height && gRDP.scissor.bottom != 0 ) + { + height = gRDP.scissor.bottom; + } + + if( info.dwAddr + height*info.dwWidth*info.dwSize >= g_dwRamSize ) + { + height = info.dwWidth*3/4; + if( status.dwTvSystem == TV_SYSTEM_PAL ) + { + height = info.dwWidth*9/11; + } + + if( gRDP.scissor.bottom < (int)height && gRDP.scissor.bottom != 0 ) + { + height = gRDP.scissor.bottom; + } + + if( info.dwAddr + height*info.dwWidth*info.dwSize >= g_dwRamSize ) + { + height = ( g_dwRamSize - info.dwAddr ) / info.dwWidth; + } + } + + TXTRBUF_DETAIL_DUMP(TRACE1("render_texture height = %d", height)); + return 0; +} + +int FrameBufferManager::CheckRenderTexturesWithNewCI(SetImgInfo &CIinfo, uint32 height, bool byNewTxtrBuf) +{ + int matchidx = -1; + uint32 memsize = ((height*CIinfo.dwWidth)>>1)<>1)< CIinfo.dwAddr && info.CI_Info.dwAddr < CIinfo.dwAddr + memsize) + covered = true; + else if( info.CI_Info.dwAddr+memsize2 > CIinfo.dwAddr && info.CI_Info.dwAddr+memsize2 < CIinfo.dwAddr + memsize) + covered = true; + else if( CIinfo.dwAddr > info.CI_Info.dwAddr && CIinfo.dwAddr < info.CI_Info.dwAddr + memsize2 ) + covered = true; + else if( CIinfo.dwAddr+ memsize > info.CI_Info.dwAddr && CIinfo.dwAddr+ memsize < info.CI_Info.dwAddr + memsize2 ) + covered = true; + } + + if( covered ) + { + //SAFE_DELETE(info.psurf); + if( info.pRenderTexture->IsBeingRendered() ) + { + TRACE0("Error, covering a render_texture which is being rendered"); + TRACE3("New addrr=%08X, width=%d, height=%d", CIinfo.dwAddr, CIinfo.dwWidth, height ); + TRACE3("Old addrr=%08X, width=%d, height=%d", info.CI_Info.dwAddr, info.N64Width, info.N64Height ); + } + info.isUsed = false; + TXTRBUF_DUMP(TRACE5("Delete txtr buf %d at %08X, covered by new CI at %08X, Width=%d, Height=%d", + i, info.CI_Info.dwAddr, CIinfo.dwAddr, CIinfo.dwWidth, height )); + SAFE_DELETE(info.pRenderTexture); + info.txtEntry.pTexture = NULL; + continue; + } + } + + return matchidx; +} + +extern RecentCIInfo *g_uRecentCIInfoPtrs[5]; +RenderTextureInfo newRenderTextureInfo; + +int FrameBufferManager::FindASlot(void) +{ + int idx; + + // Find an empty slot + bool found = false; + for( int i=0; iN64Height);}); +} + +int FrameBufferManager::SetBackBufferAsRenderTexture(SetImgInfo &CIinfo, int ciInfoIdx) +{ + // MUDLORD: + // OK, heres the drill! + // + // We set the graphics card's back buffer's contents as a render_texure + // This is done due to how the current framebuffer implementation detects + // changes to the backbuffer memory pointer and then we do a texture + // copy. This might be slow since it doesnt use hardware auxillary buffers + + RenderTextureInfo tempRenderTextureInfo; + + memcpy(&(tempRenderTextureInfo.CI_Info), &CIinfo, sizeof(SetImgInfo)); + + tempRenderTextureInfo.N64Width = g_uRecentCIInfoPtrs[ciInfoIdx]->dwLastWidth; + tempRenderTextureInfo.N64Height = g_uRecentCIInfoPtrs[ciInfoIdx]->dwLastHeight; + tempRenderTextureInfo.knownHeight = true; + tempRenderTextureInfo.maxUsedHeight = 0; + + tempRenderTextureInfo.bufferWidth = windowSetting.uDisplayWidth; + tempRenderTextureInfo.bufferHeight = windowSetting.uDisplayHeight; + + tempRenderTextureInfo.scaleX = tempRenderTextureInfo.bufferWidth / float(tempRenderTextureInfo.N64Width); + tempRenderTextureInfo.scaleY = tempRenderTextureInfo.bufferHeight / float(tempRenderTextureInfo.N64Height); + + status.bFrameBufferIsDrawn = false; + status.bFrameBufferDrawnByTriangles = false; + + tempRenderTextureInfo.updateAtFrame = status.gDlistCount; + tempRenderTextureInfo.updateAtUcodeCount = status.gUcodeCount; + + // Checking against previous render_texture infos + //uint32 memsize = ((tempRenderTextureInfo.N64Height*tempRenderTextureInfo.N64Width)>>1)<= 0) ? matchidx : FindASlot(); + + if( gRenderTextureInfos[idxToUse].pRenderTexture == NULL || matchidx < 0 ) + { + gRenderTextureInfos[idxToUse].pRenderTexture = + new COGLRenderTexture(tempRenderTextureInfo.bufferWidth, tempRenderTextureInfo.bufferHeight, &gRenderTextureInfos[idxToUse], AS_BACK_BUFFER_SAVE); + } + + // Need to set all variables for gRenderTextureInfos[idxToUse] + CRenderTexture *pRenderTexture = gRenderTextureInfos[idxToUse].pRenderTexture; + memcpy(&gRenderTextureInfos[idxToUse], &tempRenderTextureInfo, sizeof(RenderTextureInfo) ); + gRenderTextureInfos[idxToUse].pRenderTexture = pRenderTexture; + gRenderTextureInfos[idxToUse].isUsed = true; + gRenderTextureInfos[idxToUse].txtEntry.pTexture = pRenderTexture->m_pTexture; + gRenderTextureInfos[idxToUse].txtEntry.txtrBufIdx = idxToUse+1; + + TXTRBUF_DUMP(TRACE2("Set back buf as render_texture %d, addr=%08X", idxToUse, CIinfo.dwAddr)); + DEBUGGER_PAUSE_AND_DUMP_NO_UPDATE(NEXT_RENDER_TEXTURE, + {DebuggerAppendMsg("Paused after setting render_texture:\nAddr: 0x%08x, Fmt: %s Size: %s Width: %d, Height:%d", + CIinfo.dwAddr, pszImgFormat[CIinfo.dwFormat], pszImgSize[CIinfo.dwSize], CIinfo.dwWidth, g_pRenderTextureInfo->N64Height);}); + + return idxToUse; +} + +void FrameBufferManager::CloseRenderTexture(bool toSave) +{ + if( m_curRenderTextureIndex < 0 ) + return; + + status.bHandleN64RenderTexture = false; + if( status.bDirectWriteIntoRDRAM ) + { + // TODO: Implement + } + else + { + RestoreNormalBackBuffer(); + if( !toSave || !status.bFrameBufferIsDrawn || !status.bFrameBufferDrawnByTriangles ) + { + TXTRBUF_DUMP(TRACE0("Closing render_texture without save");); + SAFE_DELETE(gRenderTextureInfos[m_curRenderTextureIndex].pRenderTexture); + gRenderTextureInfos[m_curRenderTextureIndex].isUsed = false; + TXTRBUF_DUMP(TRACE1("Delete render_texture %d",m_curRenderTextureIndex);); + } + else + { + TXTRBUF_DUMP(TRACE1("Closing render_texture %d", m_curRenderTextureIndex);); + StoreRenderTextureToRDRAM(); + + if( frameBufferOptions.bRenderTextureWriteBack ) + { + SAFE_DELETE(gRenderTextureInfos[m_curRenderTextureIndex].pRenderTexture); + gRenderTextureInfos[m_curRenderTextureIndex].isUsed = false; + TXTRBUF_DUMP(TRACE1("Delete render_texture %d after writing back to RDRAM",m_curRenderTextureIndex);); + } + else + { + g_pRenderTextureInfo->crcInRDRAM = ComputeRenderTextureCRCInRDRAM(m_curRenderTextureIndex); + g_pRenderTextureInfo->crcCheckedAtFrame = status.gDlistCount; + } + } + } + + SetScreenMult(windowSetting.uDisplayWidth/windowSetting.fViWidth, windowSetting.uDisplayHeight/windowSetting.fViHeight); + CRender::g_pRender->UpdateClipRectangle(); + CRender::g_pRender->ApplyScissorWithClipRatio(); + + DEBUGGER_PAUSE_AND_DUMP_NO_UPDATE(NEXT_RENDER_TEXTURE, + { + DebuggerAppendMsg("Paused after saving render_texture %d:\nAddr: 0x%08x, Fmt: %s Size: %s Width: %d", m_curRenderTextureIndex, + g_pRenderTextureInfo->CI_Info.dwAddr, pszImgFormat[g_pRenderTextureInfo->CI_Info.dwFormat], pszImgSize[g_pRenderTextureInfo->CI_Info.dwSize], g_pRenderTextureInfo->CI_Info.dwWidth); + }); +} + +void FrameBufferManager::ClearN64FrameBufferToBlack(uint32 left, uint32 top, uint32 width, uint32 height) +{ + RecentCIInfo &p = *(g_uRecentCIInfoPtrs[0]); + uint16 *frameBufferBase = (uint16*)(g_pRDRAMu8+p.dwAddr); + uint32 pitch = p.dwWidth; + + if( width == 0 || height == 0 ) + { + uint32 len = p.dwHeight*p.dwWidth*p.dwSize; + if( p.dwSize == TXT_SIZE_4b ) len = (p.dwHeight*p.dwWidth)>>1; + memset(frameBufferBase, 0, len); + } + else + { + for( uint32 y=0; yUpdateFrame(); + RecentCIInfo *info = g_uRecentCIInfoPtrs[i]; + StoreBackBufferToRDRAM( info->dwAddr, info->dwFormat, info->dwSize, info->dwWidth, info->dwHeight, + windowSetting.uDisplayWidth, windowSetting.uDisplayHeight, addr, 0x1000-addr%0x1000); + TRACE1("Copy back for CI Addr=%08X", info->dwAddr); + } +} + +// We do these checks to see if a render_texture operation is occurring... +void FrameBufferManager::CheckRenderTextureCRCInRDRAM(void) +{ + for( int i=0; iIsBeingRendered() ) + continue; + + if( gRenderTextureInfos[i].crcCheckedAtFrame < status.gDlistCount ) + { + uint32 crc = ComputeRenderTextureCRCInRDRAM(i); + if( gRenderTextureInfos[i].crcInRDRAM != crc ) + { + // RDRAM has been modified by CPU core + TXTRBUF_DUMP(TRACE2("Delete txtr buf %d at %08X, CRC in RDRAM changed", i, gRenderTextureInfos[i].CI_Info.dwAddr )); + SAFE_DELETE(gRenderTextureInfos[i].pRenderTexture); + gRenderTextureInfos[i].isUsed = false; + continue; + } + else + { + gRenderTextureInfos[i].crcCheckedAtFrame = status.gDlistCount; + } + } + } +} + +// Check render_texture memory addresses +int FrameBufferManager::CheckAddrInRenderTextures(uint32 addr, bool checkcrc) +{ + for( int i=0; iIsBeingRendered() ) + continue; + + uint32 bufHeight = gRenderTextureInfos[i].knownHeight ? gRenderTextureInfos[i].N64Height : gRenderTextureInfos[i].maxUsedHeight; + uint32 bufMemSize = gRenderTextureInfos[i].CI_Info.dwSize*gRenderTextureInfos[i].N64Width*bufHeight; + if( addr >=gRenderTextureInfos[i].CI_Info.dwAddr && addr < gRenderTextureInfos[i].CI_Info.dwAddr+bufMemSize) + { + if(checkcrc) + { + // Check the CRC in RDRAM + if( gRenderTextureInfos[i].crcCheckedAtFrame < status.gDlistCount ) + { + uint32 crc = ComputeRenderTextureCRCInRDRAM(i); + if( gRenderTextureInfos[i].crcInRDRAM != crc ) + { + // RDRAM has been modified by CPU core + TRACE3("Buf %d CRC in RDRAM changed from %08X to %08X", i, gRenderTextureInfos[i].crcInRDRAM, crc ); + TXTRBUF_DUMP(TRACE2("Delete txtr buf %d at %08X, crcInRDRAM failed.", i, gRenderTextureInfos[i].CI_Info.dwAddr )); + SAFE_DELETE(gRenderTextureInfos[i].pRenderTexture); + gRenderTextureInfos[i].isUsed = false; + continue; + } + else + { + gRenderTextureInfos[i].crcCheckedAtFrame = status.gDlistCount; + } + } + } + + TXTRBUF_DUMP(TRACE2("Loading texture addr = %08X from txtr buf %d", addr, i)); + return i; + } + } + + return -1; +} + +// Load texture from render_texture buffer +void FrameBufferManager::LoadTextureFromRenderTexture(TxtrCacheEntry* pEntry, int infoIdx) +{ + if( infoIdx < 0 || infoIdx >= numOfTxtBufInfos ) + { + infoIdx = CheckAddrInRenderTextures(pEntry->ti.Address); + } + + if( infoIdx >= 0 && gRenderTextureInfos[infoIdx].isUsed && gRenderTextureInfos[infoIdx].pRenderTexture ) + { + TXTRBUF_DUMP(TRACE1("Loading from render_texture %d", infoIdx)); + gRenderTextureInfos[infoIdx].pRenderTexture->LoadTexture(pEntry); + } +} + +void FrameBufferManager::RestoreNormalBackBuffer() +{ + if( m_curRenderTextureIndex >= 0 && m_curRenderTextureIndex < numOfTxtBufInfos ) + { + if( gRenderTextureInfos[m_curRenderTextureIndex].pRenderTexture ) + gRenderTextureInfos[m_curRenderTextureIndex].pRenderTexture->SetAsRenderTarget(false); + m_isRenderingToTexture = false; + m_lastTextureBufferIndex = m_curRenderTextureIndex; + } + + if( !status.bFrameBufferIsDrawn || !status.bFrameBufferDrawnByTriangles ) + { + gRenderTextureInfos[m_curRenderTextureIndex].isUsed = false; + TXTRBUF_DUMP(TRACE2("Delete txtr buf %d at %08X, it is never rendered", m_curRenderTextureIndex, gRenderTextureInfos[m_curRenderTextureIndex].CI_Info.dwAddr )); + SAFE_DELETE(gRenderTextureInfos[m_curRenderTextureIndex].pRenderTexture); + } +} + +uint32 FrameBufferManager::ComputeRenderTextureCRCInRDRAM(int infoIdx) +{ + if( infoIdx >= numOfTxtBufInfos || infoIdx < 0 || !gRenderTextureInfos[infoIdx].isUsed ) + return 0; + + RenderTextureInfo &info = gRenderTextureInfos[infoIdx]; + uint32 height = info.knownHeight ? info.N64Height : info.maxUsedHeight; + uint8 *pAddr = (uint8*)(g_pRDRAMu8+info.CI_Info.dwAddr); + uint32 pitch = (info.N64Width << info.CI_Info.dwSize ) >> 1; + + return CalculateRDRAMCRC(pAddr, 0, 0, info.N64Width, height, info.CI_Info.dwSize, pitch); +} + +// Activates texture buffer for drawing +void FrameBufferManager::ActiveTextureBuffer(void) +{ + status.bCIBufferIsRendered = true; + + if( status.bHandleN64RenderTexture ) + { + // Checking against previous render_texture infos + int matchidx = -1; + + //uint32 memsize = ((newRenderTextureInfo.N64Height*newRenderTextureInfo.N64Width)>>1)<= 0 ) + { + // Reuse the matched slot + idxToUse = matchidx; + } + else + { + idxToUse = FindASlot(); + } + + if( gRenderTextureInfos[idxToUse].pRenderTexture == NULL || matchidx < 0 ) + { + int w = newRenderTextureInfo.bufferWidth; + if( newRenderTextureInfo.knownHeight == RDP_SETSCISSOR && newRenderTextureInfo.CI_Info.dwAddr == g_ZI.dwAddr ) + { + w = gRDP.scissor.right; + } + + gRenderTextureInfos[idxToUse].pRenderTexture = + new COGLRenderTexture(w, newRenderTextureInfo.bufferHeight, &gRenderTextureInfos[idxToUse], AS_RENDER_TARGET); + } + + // Need to set all variables for gRenderTextureInfos[idxToUse] + CRenderTexture *pRenderTexture = gRenderTextureInfos[idxToUse].pRenderTexture; + memcpy(&gRenderTextureInfos[idxToUse], &newRenderTextureInfo, sizeof(RenderTextureInfo) ); + gRenderTextureInfos[idxToUse].pRenderTexture = pRenderTexture; + gRenderTextureInfos[idxToUse].isUsed = true; + gRenderTextureInfos[idxToUse].txtEntry.pTexture = pRenderTexture->m_pTexture; + gRenderTextureInfos[idxToUse].txtEntry.txtrBufIdx = idxToUse+1; + + g_pRenderTextureInfo = &gRenderTextureInfos[idxToUse]; + + // Active the render_texture + if( m_curRenderTextureIndex >= 0 && gRenderTextureInfos[m_curRenderTextureIndex].isUsed && gRenderTextureInfos[m_curRenderTextureIndex].pRenderTexture ) + { + gRenderTextureInfos[m_curRenderTextureIndex].pRenderTexture->SetAsRenderTarget(false); + m_isRenderingToTexture = false; + } + + if( gRenderTextureInfos[idxToUse].pRenderTexture->SetAsRenderTarget(true) ) + { + m_isRenderingToTexture = true; + + //Clear(CLEAR_COLOR_AND_DEPTH_BUFFER,0x80808080,1.0f); + if( frameBufferOptions.bFillRectNextTextureBuffer ) + CGraphicsContext::g_pGraphicsContext->Clear(CLEAR_COLOR_BUFFER,gRDP.fillColor,1.0f); + else if( options.enableHackForGames == HACK_FOR_MARIO_TENNIS && g_pRenderTextureInfo->N64Width > 64 && g_pRenderTextureInfo->N64Width < 300 ) + { + CGraphicsContext::g_pGraphicsContext->Clear(CLEAR_COLOR_BUFFER,0,1.0f); + } + else if( options.enableHackForGames == HACK_FOR_MARIO_TENNIS && g_pRenderTextureInfo->N64Width < 64 && g_pRenderTextureInfo->N64Width > 32 ) + { + CGraphicsContext::g_pGraphicsContext->Clear(CLEAR_COLOR_BUFFER,0,1.0f); + } + + m_curRenderTextureIndex = idxToUse; + + status.bDirectWriteIntoRDRAM = false; + + //SetScreenMult(1, 1); + SetScreenMult(gRenderTextureInfos[m_curRenderTextureIndex].scaleX, gRenderTextureInfos[m_curRenderTextureIndex].scaleY); + CRender::g_pRender->UpdateClipRectangle(); + + // If needed, draw RDRAM into the render_texture + //if( frameBufferOptions.bLoadRDRAMIntoRenderTexture ) + //{ + // CRender::GetRender()->LoadTxtrBufFromRDRAM(); + //} + } + else + { + if( CDeviceBuilder::m_deviceGeneralType == DIRECTX_DEVICE ) + { + TRACE1("Error to set Render Target: %d", idxToUse); + TRACE1("Addr = %08X", gRenderTextureInfos[idxToUse].CI_Info.dwAddr); + TRACE2("Width = %d, Height=%d", gRenderTextureInfos[idxToUse].N64Width, gRenderTextureInfos[idxToUse].N64Height); + } + } + + + TXTRBUF_DUMP(TRACE2("Rendering to render_texture %d, addr=%08X", idxToUse, g_CI.dwAddr)); + DEBUGGER_PAUSE_AND_DUMP_NO_UPDATE(NEXT_RENDER_TEXTURE, + {DebuggerAppendMsg("Paused after activating render_texture:\nAddr: 0x%08x, Fmt: %s Size: %s Width: %d, Height:%d", + g_CI.dwAddr, pszImgFormat[g_CI.dwFormat], pszImgSize[g_CI.dwSize], g_CI.dwWidth, g_pRenderTextureInfo->N64Height);}); + } + else + { + UpdateRecentCIAddr(g_CI); + CheckRenderTexturesWithNewCI(g_CI,gRDP.scissor.bottom,false); + } +} + +#define SAVE_CI {g_CI.dwAddr = newCI.dwAddr;g_CI.dwFormat = newCI.dwFormat;g_CI.dwSize = newCI.dwSize;g_CI.dwWidth = newCI.dwWidth;g_CI.bpl=newCI.bpl;} + +// Sets CI address for framebuffer copies +void FrameBufferManager::Set_CI_addr(SetImgInfo &newCI) +{ + bool wasDrawingTextureBuffer = status.bN64IsDrawingTextureBuffer; + status.bN64IsDrawingTextureBuffer = ( newCI.dwSize != TXT_SIZE_16b || newCI.dwFormat != TXT_FMT_RGBA || newCI.dwWidth < 200 || ( newCI.dwAddr != g_ZI.dwAddr && newCI.dwWidth != 512 && !g_pFrameBufferManager->HasAddrBeenDisplayed(newCI.dwAddr, newCI.dwWidth)) ); + status.bN64FrameBufferIsUsed = status.bN64IsDrawingTextureBuffer; + + if( !wasDrawingTextureBuffer && g_CI.dwAddr == g_ZI.dwAddr && status.bCIBufferIsRendered ) + { + TXTRBUF_DUMP(TRACE0("ZI is rendered")); + + if( options.enableHackForGames != HACK_FOR_CONKER && g_uRecentCIInfoPtrs[0]->bCopied == false ) + { + // Conker is not actually using a backbuffer + g_pFrameBufferManager->UpdateRecentCIAddr(g_CI); + if( status.leftRendered != -1 && status.topRendered != -1 && status.rightRendered != -1 && status.bottomRendered != -1 ) + { + RECT rect={status.leftRendered,status.topRendered,status.rightRendered,status.bottomRendered}; + g_pFrameBufferManager->SaveBackBuffer(0,&rect); + } + else + { + g_pFrameBufferManager->SaveBackBuffer(0,NULL); + } + } + } + + frameBufferOptions.bFillRectNextTextureBuffer = false; + if( g_CI.dwAddr == newCI.dwAddr && status.bHandleN64RenderTexture && (g_CI.dwFormat != newCI.dwFormat || g_CI.dwSize != newCI.dwSize || g_CI.dwWidth != newCI.dwWidth ) ) + { + // Mario Tennis player shadow + g_pFrameBufferManager->CloseRenderTexture(true); + if( options.enableHackForGames == HACK_FOR_MARIO_TENNIS ) + frameBufferOptions.bFillRectNextTextureBuffer = true; // Hack for Mario Tennis + } + + SAVE_CI; + + if( g_CI.dwAddr == g_ZI.dwAddr && !status.bN64IsDrawingTextureBuffer ) + { + if( g_pFrameBufferManager->IsDIaRenderTexture() ) + { + status.bN64IsDrawingTextureBuffer = true; + status.bN64FrameBufferIsUsed = status.bN64IsDrawingTextureBuffer; + } + } + + status.bCIBufferIsRendered = false; + status.leftRendered = status.topRendered = status.rightRendered = status.bottomRendered = -1; + + if( currentRomOptions.screenUpdateSetting==SCREEN_UPDATE_AT_CI_CHANGE && !status.bN64IsDrawingTextureBuffer ) + { + if( status.curRenderBuffer == 0 ) + { + status.curRenderBuffer = g_CI.dwAddr; + } + else if( status.curRenderBuffer != g_CI.dwAddr ) + { + status.curDisplayBuffer = status.curRenderBuffer; + CGraphicsContext::Get()->UpdateFrame(); + status.curRenderBuffer = g_CI.dwAddr; + DEBUGGER_IF_DUMP(pauseAtNext,{DebuggerAppendMsg("Screen Update because CI change to %08X, Display Buf=%08X", status.curRenderBuffer, status.curDisplayBuffer);}); + } + } + + if( frameBufferOptions.bAtEachFrameUpdate && !status.bHandleN64RenderTexture ) + { + if( status.curRenderBuffer != g_CI.dwAddr ) + { + if( status.gDlistCount%(currentRomOptions.N64FrameBufferWriteBackControl+1) == 0 ) + { + g_pFrameBufferManager->StoreBackBufferToRDRAM(status.curRenderBuffer, + newCI.dwFormat, newCI.dwSize, windowSetting.uViWidth, windowSetting.uViHeight, + windowSetting.uDisplayWidth, windowSetting.uDisplayHeight); + } + } + + //status.curDisplayBuffer = status.curRenderBuffer; + status.curRenderBuffer = g_CI.dwAddr; + } + + + switch( currentRomOptions.N64RenderToTextureEmuType ) + { + case TXT_BUF_NONE: + if( status.bHandleN64RenderTexture ) + g_pFrameBufferManager->CloseRenderTexture(false); + status.bHandleN64RenderTexture = false; // Don't handle N64 render_texture stuffs + if( !status.bN64IsDrawingTextureBuffer ) + g_pFrameBufferManager->UpdateRecentCIAddr(g_CI); + break; + default: + if( status.bHandleN64RenderTexture ) + { +#ifdef DEBUGGER + if( pauseAtNext && eventToPause == NEXT_RENDER_TEXTURE ) + { + pauseAtNext = TRUE; + eventToPause = NEXT_RENDER_TEXTURE; + } +#endif + g_pFrameBufferManager->CloseRenderTexture(true); + } + + status.bHandleN64RenderTexture = status.bN64IsDrawingTextureBuffer; + if( status.bHandleN64RenderTexture ) + { + if( options.enableHackForGames != HACK_FOR_BANJO_TOOIE ) + { + g_pFrameBufferManager->SetRenderTexture(); + } + } + else + { +#ifdef DEBUGGER + if( g_CI.dwWidth == 512 && pauseAtNext && (eventToPause==NEXT_OBJ_BG || eventToPause==NEXT_SET_CIMG) ) + { + DebuggerAppendMsg("Warning SetCImg: new Addr=0x%08X, fmt:%s size=%sb, Width=%d\n", + g_CI.dwAddr, pszImgFormat[newCI.dwFormat], pszImgSize[newCI.dwSize], newCI.dwWidth); + } +#endif + //g_pFrameBufferManager->UpdateRecentCIAddr(g_CI); // Delay this until the CI buffer is actally drawn + } + break; + } + + TXTRBUF_DUMP(TRACE4("SetCImg : Addr=0x%08X, Fmt:%s-%sb, Width=%d\n", + g_CI.dwAddr, pszImgFormat[newCI.dwFormat], pszImgSize[newCI.dwSize], newCI.dwWidth)); + + DEBUGGER_PAUSE_AND_DUMP_NO_UPDATE(NEXT_SET_CIMG, + { + DebuggerAppendMsg("Pause after SetCImg: Addr=0x%08X, Fmt:%s-%sb, Width=%d\n", + g_CI.dwAddr, pszImgFormat[newCI.dwFormat], pszImgSize[newCI.dwSize], newCI.dwWidth); + } + ); +} + + +void FrameBufferManager::StoreRenderTextureToRDRAM(int infoIdx) +{ + if( !frameBufferOptions.bRenderTextureWriteBack ) + return; + + if( infoIdx < 0 ) + infoIdx = m_lastTextureBufferIndex; + + if( !gRenderTextureInfos[infoIdx].pRenderTexture ) + return; + + if( gRenderTextureInfos[infoIdx].pRenderTexture->IsBeingRendered() ) + { + TXTRBUF_DUMP(TRACE1("Cannot SaveTextureBuffer %d, it is being rendered", infoIdx)); + return; + } + + gRenderTextureInfos[infoIdx].pRenderTexture->StoreToRDRAM(infoIdx); +} + + +//does FB copy to N64 RDAM structure +void FrameBufferManager::CopyBufferToRDRAM(uint32 addr, uint32 fmt, uint32 siz, uint32 width, uint32 height, uint32 bufWidth, uint32 bufHeight, uint32 startaddr, uint32 memsize, uint32 pitch, TextureFmt bufFmt, void *buffer, uint32 bufPitch) +{ + uint32 startline=0; + + if( startaddr == 0xFFFFFFFF ) + startaddr = addr; + + startline = (startaddr-addr)/siz/pitch; + if( startline >= height ) + { + //TRACE0("Warning: check me"); + startline = height; + } + + uint32 endline = height; + if( memsize != 0xFFFFFFFF ) + { + endline = (startaddr+memsize-addr)/siz; + if( endline % pitch == 0 ) + endline /= pitch; + else + endline = endline/pitch+1; + } + if( endline > height ) + { + endline = height; + } + + if( memsize != 0xFFFFFFFF ) + { + TXTRBUF_DUMP(DebuggerAppendMsg("Start at: 0x%X, from line %d to %d", startaddr-addr, startline, endline);); + } + + int indexes[600]; + { + float sx; + int sx0; + float ratio = bufWidth/(float)width; + for( uint32 j=0; jIsBeingRendered() ) + { + TRACE1("Render texture %d is being rendered, cannot display", infoIdx); + } + else + { + TRACE1("Texture buffer %d:", infoIdx); + TRACE1("Addr=%08X", gRenderTextureInfos[infoIdx].CI_Info.dwAddr); + TRACE2("Width=%d, Created Height=%d", gRenderTextureInfos[infoIdx].N64Width,gRenderTextureInfos[infoIdx].N64Height); + TRACE2("Fmt=%d, Size=%d", gRenderTextureInfos[infoIdx].CI_Info.dwFormat,gRenderTextureInfos[infoIdx].CI_Info.dwSize); + } + } + else + { + TRACE1("Texture buffer %d is not used", infoIdx); + } +} +#endif + + + +// Saves backbuffer +// this is the core to the current framebuffer code +// We need to save backbuffer when changed by framebuffer +// so that we can use it for framebuffer effects +void FrameBufferManager::SaveBackBuffer(int ciInfoIdx, RECT* pSrcRect, bool forceToSaveToRDRAM) +{ + RecentCIInfo &ciInfo = *g_uRecentCIInfoPtrs[ciInfoIdx]; + + if( ciInfoIdx == 1 ) // to save the current front buffer + { + CGraphicsContext::g_pGraphicsContext->UpdateFrame(true); + } + + if( frameBufferOptions.bWriteBackBufToRDRAM || forceToSaveToRDRAM ) + { + uint32 width = ciInfo.dwWidth; + uint32 height = ciInfo.dwHeight; + + if( ciInfo.dwWidth == *g_GraphicsInfo.VI_WIDTH_REG && ciInfo.dwWidth != windowSetting.uViWidth ) + { + width = windowSetting.uViWidth; + height = windowSetting.uViHeight; + } + + StoreBackBufferToRDRAM( ciInfo.dwAddr, ciInfo.dwFormat, ciInfo.dwSize, width, height, + windowSetting.uDisplayWidth, windowSetting.uDisplayHeight); + + g_uRecentCIInfoPtrs[ciInfoIdx]->bCopied = true; + if( ciInfoIdx == 1 ) // to save the current front buffer + { + CGraphicsContext::g_pGraphicsContext->UpdateFrame(true); + } + return; + } + + + SetImgInfo tempinfo; + tempinfo.dwAddr = ciInfo.dwAddr; + tempinfo.dwFormat = ciInfo.dwFormat; + tempinfo.dwSize = ciInfo.dwSize; + tempinfo.dwWidth = ciInfo.dwWidth; + + int idx = SetBackBufferAsRenderTexture(tempinfo, ciInfoIdx); + + CopyBackBufferToRenderTexture(idx, ciInfo, pSrcRect); + + gRenderTextureInfos[idx].crcCheckedAtFrame = status.gDlistCount; + gRenderTextureInfos[idx].crcInRDRAM = ComputeRenderTextureCRCInRDRAM(idx); + + DEBUGGER_IF_DUMP((logTextureBuffer&&pSrcRect==NULL),TRACE1("SaveBackBuffer at 0x%08X", ciInfo.dwAddr)); + DEBUGGER_IF_DUMP((logTextureBuffer&&pSrcRect),TRACE5("SaveBackBuffer at 0x%08X, {%d,%d -%d,%d)", ciInfo.dwAddr, + pSrcRect->left,pSrcRect->top,pSrcRect->right,pSrcRect->bottom)); + DEBUGGER_IF_DUMP(( pauseAtNext && eventToPause == NEXT_RENDER_TEXTURE),{g_pFrameBufferManager->DisplayRenderTexture(idx);}); + + g_uRecentCIInfoPtrs[ciInfoIdx]->bCopied = true; +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/FrameBuffer.h b/libmupen64plus/mupen64plus-video-rice/src/FrameBuffer.h new file mode 100644 index 0000000000..1d796e9ee6 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/FrameBuffer.h @@ -0,0 +1,146 @@ +/* +Copyright (C) 2002 Rice1964 + +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. + +*/ + +#ifndef _FRAME_BUFFER_H_ +#define _FRAME_BUFFER_H_ + +#include "typedefs.h" +#include "RenderTexture.h" +#include "TextureManager.h" + +typedef int SURFFORMAT; + +extern void TexRectToN64FrameBuffer_16b(uint32 x0, uint32 y0, uint32 width, uint32 height, uint32 dwTile); +extern void TexRectToFrameBuffer_8b(uint32 dwXL, uint32 dwYL, uint32 dwXH, uint32 dwYH, float t0u0, float t0v0, float t0u1, float t0v1, uint32 dwTile); + +class FrameBufferManager +{ + friend class CGraphicsContext; + friend class CDXGraphicsContext; +public: + FrameBufferManager(); + virtual ~FrameBufferManager(); + + void Initialize(); + void CloseUp(); + void Set_CI_addr(SetImgInfo &newCI); + void UpdateRecentCIAddr(SetImgInfo &ciinfo); + void SetAddrBeDisplayed(uint32 addr); + bool HasAddrBeenDisplayed(uint32 addr, uint32 width); + int FindRecentCIInfoIndex(uint32 addr); + bool IsDIaRenderTexture(); + + int CheckAddrInRenderTextures(uint32 addr, bool checkcrc = true); + uint32 ComputeRenderTextureCRCInRDRAM(int infoIdx); + void CheckRenderTextureCRCInRDRAM(void); + int CheckRenderTexturesWithNewCI(SetImgInfo &CIinfo, uint32 height, bool byNewTxtrBuf); + virtual void ClearN64FrameBufferToBlack(uint32 left=0, uint32 top=0, uint32 width=0, uint32 height=0); + virtual int SetBackBufferAsRenderTexture(SetImgInfo &CIinfo, int ciInfoIdx); + void LoadTextureFromRenderTexture(TxtrCacheEntry* pEntry, int infoIdx); + void UpdateFrameBufferBeforeUpdateFrame(); + virtual void RestoreNormalBackBuffer(); // restore the normal back buffer + virtual void CopyBackToFrameBufferIfReadByCPU(uint32 addr); + virtual void SetRenderTexture(void); + virtual void CloseRenderTexture(bool toSave); + virtual void ActiveTextureBuffer(void); + + int IsAddrInRecentFrameBuffers(uint32 addr); + int CheckAddrInBackBuffers(uint32 addr, uint32 memsize, bool copyToRDRAM = false); + + uint8 CIFindIndex(uint16 val); + uint32 ComputeCImgHeight(SetImgInfo &info, uint32 &height); + + int FindASlot(void); + + bool ProcessFrameWriteRecord(); + void FrameBufferWriteByCPU(uint32 addr, uint32 size); + void FrameBufferReadByCPU( uint32 addr ); + bool FrameBufferInRDRAMCheckCRC(); + void StoreRenderTextureToRDRAM(int infoIdx = -1); + + virtual bool IsRenderingToTexture() {return m_isRenderingToTexture;} + + // Device dependent functions + virtual void SaveBackBuffer(int ciInfoIdx, RECT* pRect=NULL, bool forceToSaveToRDRAM = false); // Copy the current back buffer to temp buffer + virtual void CopyBackBufferToRenderTexture(int idx, RecentCIInfo &ciInfo, RECT* pRect=NULL) {} // Copy the current back buffer to temp buffer + virtual void CopyBufferToRDRAM(uint32 addr, uint32 fmt, uint32 siz, uint32 width, + uint32 height, uint32 bufWidth, uint32 bufHeight, uint32 startaddr, + uint32 memsize, uint32 pitch, TextureFmt bufFmt, void *surf, uint32 bufPitch); + virtual void StoreBackBufferToRDRAM(uint32 addr, uint32 fmt, uint32 siz, uint32 width, + uint32 height, uint32 bufWidth, uint32 bufHeight, uint32 startaddr=0xFFFFFFFF, + uint32 memsize=0xFFFFFFFF, uint32 pitch=0, SURFFORMAT surf_fmt=SURFFMT_A8R8G8B8) {} +#ifdef DEBUGGER + virtual void DisplayRenderTexture(int infoIdx = -1); +#endif + +protected: + bool m_isRenderingToTexture; + int m_curRenderTextureIndex; + int m_lastTextureBufferIndex; +}; + +class DXFrameBufferManager : public FrameBufferManager +{ + virtual ~DXFrameBufferManager() {} + +public: + // Device dependent functions + virtual void CopyBackBufferToRenderTexture(int idx, RecentCIInfo &ciInfo, RECT* pRect=NULL); // Copy the current back buffer to temp buffer + virtual void StoreBackBufferToRDRAM(uint32 addr, uint32 fmt, uint32 siz, uint32 width, + uint32 height, uint32 bufWidth, uint32 bufHeight, uint32 startaddr=0xFFFFFFFF, + uint32 memsize=0xFFFFFFFF, uint32 pitch=0, SURFFORMAT surf_fmt=SURFFMT_A8R8G8B8); +}; + +class OGLFrameBufferManager : public FrameBufferManager +{ + virtual ~OGLFrameBufferManager() {} + +public: + // Device dependent functions + virtual void CopyBackBufferToRenderTexture(int idx, RecentCIInfo &ciInfo, RECT* pRect=NULL); // Copy the current back buffer to temp buffer + virtual void StoreBackBufferToRDRAM(uint32 addr, uint32 fmt, uint32 siz, uint32 width, + uint32 height, uint32 bufWidth, uint32 bufHeight, uint32 startaddr=0xFFFFFFFF, + uint32 memsize=0xFFFFFFFF, uint32 pitch=0, SURFFORMAT surf_fmt=SURFFMT_A8R8G8B8); +}; + +extern RenderTextureInfo gRenderTextureInfos[]; +extern RenderTextureInfo newRenderTextureInfo; + +#define NEW_TEXTURE_BUFFER + +extern RenderTextureInfo g_ZI_saves[2]; +extern RenderTextureInfo *g_pRenderTextureInfo; + + +extern FrameBufferManager* g_pFrameBufferManager; + +extern RecentCIInfo g_RecentCIInfo[]; +extern RecentViOriginInfo g_RecentVIOriginInfo[]; +extern RenderTextureInfo gRenderTextureInfos[]; +extern int numOfTxtBufInfos; +extern RecentCIInfo *g_uRecentCIInfoPtrs[5]; +extern uint8 RevTlutTable[0x10000]; + +extern uint32 CalculateRDRAMCRC(void *pAddr, uint32 left, uint32 top, uint32 width, uint32 height, uint32 size, uint32 pitchInBytes ); +extern uint16 ConvertRGBATo555(uint8 r, uint8 g, uint8 b, uint8 a); +extern uint16 ConvertRGBATo555(uint32 color32); +extern void InitTlutReverseLookup(void); + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/GeneralCombiner.cpp b/libmupen64plus/mupen64plus-video-rice/src/GeneralCombiner.cpp new file mode 100644 index 0000000000..9329bd2b61 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/GeneralCombiner.cpp @@ -0,0 +1,1308 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#include + +#include "GeneralCombiner.h" +#include "Combiner.h" +#include "Debugger.h" + +extern const int numOf3StageCombiners; +extern const int numOf2StageCombiners; +extern GeneralCombinerInfo CombinerTable2Stages[]; +extern GeneralCombinerInfo CombinerTable3Stages[]; + +CGeneralCombiner::CGeneralCombiner() +{ + m_lastGeneralIndex=0; + m_ppGeneralDecodedMux=NULL; + + m_bTxtOpAdd=true; + m_bTxtOpSub=false; + m_bTxtOpLerp=false; + m_bTxtOpAddSmooth=false; + m_bTxtOpBlendCurAlpha=false; + m_bTxtOpBlendDifAlpha=true; + m_bTxtOpBlendFacAlpha=false; + m_bTxtOpBlendTxtAlpha=true; + m_bTxtOpMulAdd=false; + + m_dwGeneralMaxStages=2; +} + +bool isTex(uint32 val) +{ + return ( (val&MUX_MASK) == MUX_TEXEL0 || (val&MUX_MASK) == MUX_TEXEL1 ); +} +int toTex(uint32 val) +{ + return (val&MUX_MASK)-MUX_TEXEL0; +} + +bool isComb(uint32 val) +{ + return (val&MUX_MASK)==MUX_COMBINED; +} + +#ifdef DEBUGGER +const char* BlendFuncStr[] = { + "Enable both", + "Disable alpha", + "Disable color", + "Disable both", + "Color one", + "Alpha one", +}; +const char* cmopstrs[] = { + "Sel", + "Mod", + "Add", + "Sub", + "Lerp", + "AddSmooth", + "BlCurA", + "BlDifA", + "BlFacA", + "BlTexA", + "MulAdd", +}; + +void CGeneralCombiner::General_DisplayBlendingStageInfo(GeneralCombinerInfo &gci) +{ + char str1[30],str2[30],str3[30]; + DebuggerAppendMsg("\nStages:%d, Alpha:%s, Factor:%s, Specular:%s Dif Color:0x%X Dif Alpha:0x%X\n", + gci.nStages, BlendFuncStr[gci.blendingFunc], DecodedMux::FormatStr((uint8)gci.TFactor,str1), + DecodedMux::FormatStr((uint8)gci.specularPostOp,str2), gci.m_dwShadeColorChannelFlag, gci.m_dwShadeAlphaChannelFlag); + + for( int i=0; im_n64Combiners[curN64Stage]; + StageOperate *op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + (curN64Stage%2); + if( ( m.d == MUX_0 || m.d == MUX_1 ) && curN64Stage==1 ) + { + //if( m.d == MUX_0 ) + // gci.blendingFunc = DISABLE_COLOR; + //if( m.d == MUX_1 ) + // gci.blendingFunc = DISABLE_ALPHA; + + op->op = CM_REPLACE; + op->Arg1 = MUX_COMBINED; + op->Arg2 = CM_IGNORE; + op->Arg0 = CM_IGNORE; + } + else + { + if( isTex(m.d) ) Check1TxtrForAlpha(curN64Stage, curStage, gci, toTex(m.d)); + op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + (curN64Stage%2); + + op->op = CM_REPLACE; + op->Arg1 = m.d; + op->Arg2 = CM_IGNORE; + op->Arg0 = CM_IGNORE; + } + + if( !gci.stages[curStage].bTextureUsed ) + gci.stages[curStage].dwTexture = GetTexelNumber(m); + textureUsedInStage[curStage][curN64Stage%2] = IsTxtrUsed(m); + return curStage; +} + +int CGeneralCombiner::GenCI_Type_A_MOD_C(int curN64Stage, int curStage, GeneralCombinerInfo &gci, uint32 dxop) +{ + N64CombinerType &m = (*m_ppGeneralDecodedMux)->m_n64Combiners[curN64Stage]; + StageOperate *op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + (curN64Stage%2); + + if( CountTexel1Cycle(m) == 2 ) + { + // As we can not use both texture in one stage + // we split them to two stages + // Stage1: SELECT txt1 + // Stage2: MOD txt2 + + if( gci.stages[curStage].bTextureUsed && gci.stages[curStage].dwTexture != (unsigned int)toTex(m.a) ) + swap(m.a,m.c); + + op->op =CM_REPLACE; + op->Arg1 = m.a; + op->Arg2 = CM_IGNORE; + op->Arg0 = CM_IGNORE; + gci.stages[curStage].dwTexture = toTex(m.a); + textureUsedInStage[curStage][curN64Stage%2] = true; + + NextStage(curStage); + Check1TxtrForAlpha(curN64Stage, curStage, gci, toTex(m.c)); + op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + (curN64Stage%2); + + op->op =dxop; + op->Arg1 = (m.c); + op->Arg2 = MUX_COMBINED; + op->Arg0 = CM_IGNORE; + gci.stages[curStage].dwTexture = toTex(m.c); + textureUsedInStage[curStage][curN64Stage%2] = true; + } + else + { + if( CountTexel1Cycle(m) == 1) + { + Check1TxtrForAlpha(curN64Stage, curStage, gci, GetTexelNumber(m)); + op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + (curN64Stage%2); + } + + op->op = dxop; + op->Arg1 = (m.a); + op->Arg2 = (m.c); + op->Arg0 = CM_IGNORE; + if( !gci.stages[curStage].bTextureUsed ) + gci.stages[curStage].dwTexture = GetTexelNumber(m); + textureUsedInStage[curStage][curN64Stage%2] = IsTxtrUsed(m); + } + + return curStage; +} +int CGeneralCombiner::GenCI_Type_A_ADD_D(int curN64Stage, int curStage, GeneralCombinerInfo &gci) +{ + uint32 opToUse = m_bTxtOpAdd?CM_ADD:CM_MODULATE; + N64CombinerType &m = (*m_ppGeneralDecodedMux)->m_n64Combiners[curN64Stage]; + swap(m.c, m.d); + curStage = GenCI_Type_A_MOD_C(curN64Stage, curStage, gci, opToUse); + swap(m.c, m.d); + return curStage; +} + +int CGeneralCombiner::GenCI_Type_A_SUB_B(int curN64Stage, int curStage, GeneralCombinerInfo &gci) +{ + N64CombinerType &m = (*m_ppGeneralDecodedMux)->m_n64Combiners[curN64Stage]; + if( !m_bTxtOpSub ) + { + swap(m.c, m.b); + curStage = GenCI_Type_A_MOD_C(curN64Stage, curStage, gci); + swap(m.c, m.b); + return curStage; + } + + StageOperate *op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + (curN64Stage%2); + + if( CountTexel1Cycle(m) == 2 ) + { + Check1TxtrForAlpha(curN64Stage, curStage, gci, toTex(m.b)); + op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + (curN64Stage%2); + + op->op =CM_REPLACE; + op->Arg1 = (m.b); + op->Arg2 = CM_IGNORE; + op->Arg0 = CM_IGNORE; + gci.stages[curStage].dwTexture = toTex(m.b); + textureUsedInStage[curStage][curN64Stage%2] = true; + + NextStage(curStage); + Check1TxtrForAlpha(curN64Stage, curStage, gci, toTex(m.a)); + op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + (curN64Stage%2); + + op->op =CM_SUBTRACT; + op->Arg1 = (m.a); + op->Arg2 = MUX_COMBINED; + op->Arg0 = CM_IGNORE; + gci.stages[curStage].dwTexture = toTex(m.a); + textureUsedInStage[curStage][curN64Stage%2] = true; + } + else + { + if( CountTexel1Cycle(m) == 1) + { + Check1TxtrForAlpha(curN64Stage, curStage, gci, GetTexelNumber(m)); + op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + (curN64Stage%2); + } + + op->op = CM_SUBTRACT; + op->Arg1 = (m.a); + op->Arg2 = (m.b); + op->Arg0 = CM_IGNORE; + if( !gci.stages[curStage].bTextureUsed ) + gci.stages[curStage].dwTexture = GetTexelNumber(m); + textureUsedInStage[curStage][curN64Stage%2] = IsTxtrUsed(m); + } + return curStage; +} + +int CGeneralCombiner::GenCI_Type_A_MOD_C_ADD_D(int curN64Stage, int curStage, GeneralCombinerInfo &gci) +{ + N64CombinerType &m = (*m_ppGeneralDecodedMux)->m_n64Combiners[curN64Stage]; + StageOperate *op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + (curN64Stage%2); + + if( !m_bTxtOpMulAdd ) + { + N64CombinerType save = m; + m.d = MUX_0; + curStage = GenCI_Type_A_MOD_C(curN64Stage, curStage, gci); + m = save; + m.c = MUX_0; + m.a = MUX_COMBINED; + NextStage(curStage); + curStage = GenCI_Type_A_ADD_D(curN64Stage, curStage, gci); + m = save; + return curStage; + } + + if( CountTexel1Cycle(m) == 2 ) + { + if( !gci.stages[curStage].bTextureUsed ) + { + gci.stages[curStage].dwTexture = 0; + gci.stages[curStage].bTextureUsed = true; + } + + op->op = CM_REPLACE; + op->Arg2 = CM_IGNORE; + op->Arg0 = CM_IGNORE; + op->Arg1 = MUX_TEXEL0 + gci.stages[curStage].dwTexture ; + + N64CombinerType m2 = m; + + uint8* vals = (uint8*)&m2; + for( int i=0; i<4; i++ ) + { + if( (unsigned int)(vals[i]&MUX_MASK) == MUX_TEXEL0 + gci.stages[curStage].dwTexture ) + { + vals[i] = MUX_COMBINED | (vals[i]&0xe0); + } + } + + NextStage(curStage); + + Check1TxtrForAlpha(curN64Stage, curStage, gci, GetTexelNumber(m2)); + op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + (curN64Stage%2); + + op->op = CM_MULTIPLYADD; + op->Arg1 = m2.a; + op->Arg2 = m2.c; + op->Arg0 = m2.d; + if( !gci.stages[curStage].bTextureUsed ) + gci.stages[curStage].dwTexture = GetTexelNumber(m2); + textureUsedInStage[curStage][curN64Stage%2] = IsTxtrUsed(m2); + } + else + { + Check1TxtrForAlpha(curN64Stage, curStage, gci, GetTexelNumber(m)); + op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + (curN64Stage%2); + + op->op = CM_MULTIPLYADD; + op->Arg1 = (m.a); + op->Arg2 = (m.c); + op->Arg0 = (m.d); + if( !gci.stages[curStage].bTextureUsed ) + gci.stages[curStage].dwTexture = GetTexelNumber(m); + textureUsedInStage[curStage][curN64Stage%2] = IsTxtrUsed(m); + } + + return curStage; +} + + +int CGeneralCombiner::GenCI_Type_A_LERP_B_C(int curN64Stage, int curStage, GeneralCombinerInfo &gci) +{ + N64CombinerType &m = (*m_ppGeneralDecodedMux)->m_n64Combiners[curN64Stage]; + StageOperate *op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + (curN64Stage%2); + + N64CombinerType save = m; + + if( CountTexel1Cycle(m) == 2 ) + { + // There are two textures + int texToUse = CheckWhichTexToUseInThisStage(curN64Stage, curStage, gci); + op->op =CM_REPLACE; + op->Arg1 = (MUX_TEXEL0+texToUse); + op->Arg2 = CM_IGNORE; + op->Arg0 = CM_IGNORE; + gci.stages[curStage].dwTexture = texToUse; + textureUsedInStage[curStage][curN64Stage%2] = true; + + (*m_ppGeneralDecodedMux)->ReplaceVal(MUX_TEXEL0+texToUse, MUX_COMBINED, curN64Stage); + NextStage(curStage); + Check1TxtrForAlpha(curN64Stage, curStage, gci, GetTexelNumber(m)); + op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + (curN64Stage%2); + } + + // Now we have only 1 texture left + + Check1TxtrForAlpha(curN64Stage, curStage, gci, GetTexelNumber(m)); + op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + (curN64Stage%2); + + if( m.a == MUX_1 ) + { + op->op = CM_ADDSMOOTH; + op->Arg1 = (m.b); + op->Arg2 = (m.c); + op->Arg0 = CM_IGNORE; + } + else if( m.a == MUX_0 ) + { + op->op = CM_MODULATE; + m.a = 0; + op->Arg1 = (m.b); + op->Arg2 = (m.c^MUX_COMPLEMENT); + op->Arg0 = CM_IGNORE; + } + else + { + if( ((m.c&MUX_ALPHAREPLICATE) || (curN64Stage%2)==1 || m_bTxtOpLerp == false) && ((m.c&MUX_MASK)==MUX_SHADE || (m.c&MUX_MASK)==MUX_COMBINED || (m.c&MUX_MASK)==MUX_TEXEL0 || (m.c&MUX_MASK)==MUX_TEXEL1 ) ) + { + if( curN64Stage == 2 && (m.c&MUX_ALPHAREPLICATE) == 0 ) + { + op->op = CM_MODULATE; + op->Arg1 = m.b; + op->Arg2 = m.c|MUX_COMPLEMENT; + op->Arg0 = CM_IGNORE; + resultIsGood = false; + } + else + { + if( (m.c&MUX_MASK)==MUX_SHADE ) + { + op->op = CM_BLENDDIFFUSEALPHA; + } + else if( (m.c&MUX_MASK) == MUX_COMBINED ) + { + op->op = CM_BLENDCURRENTALPHA; + } + else if( (m.c&MUX_MASK) == MUX_TEXEL0 ) + { + op->op = CM_BLENDTEXTUREALPHA; + } + else if( (m.c&MUX_MASK)==MUX_TEXEL1 ) + { + op->op = CM_BLENDTEXTUREALPHA; + } + else + { + op->op = CM_BLENDDIFFUSEALPHA; + } + op->Arg1 = (m.a); + op->Arg2 = (m.b); + op->Arg0 = m.c|MUX_ALPHAREPLICATE; + } + } + else + { + if( ((m.c&MUX_ALPHAREPLICATE) || (curN64Stage%2)==1 || m_bTxtOpLerp == false) && ((((m.c&MUX_MASK)==MUX_ENV) || ((m.c&MUX_MASK)==MUX_PRIM)) )) + { + op->op = CM_BLENDFACTORALPHA; + op->Arg1 = (m.a); + op->Arg2 = (m.b); + op->Arg0 = m.c|MUX_ALPHAREPLICATE; + } + else + { + op->op = CM_INTERPOLATE; + op->Arg0 = (m.c); + op->Arg1 = (m.a); + op->Arg2 = (m.b); + } + } + } + gci.stages[curStage].dwTexture = GetTexelNumber(m); + textureUsedInStage[curStage][curN64Stage%2] = IsTxtrUsed(m); + + m = save; + return curStage; +} + + +int CGeneralCombiner::GenCI_Type_A_B_C_D(int curN64Stage, int curStage, GeneralCombinerInfo &gci) +{ + N64CombinerType &m = (*m_ppGeneralDecodedMux)->m_n64Combiners[curN64Stage]; + StageOperate *op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + (curN64Stage%2); + + N64CombinerType save = m; + if( CountTexel1Cycle(m) == 2 ) + { + if( isTex(m.a) && !isTex(m.c) && curN64Stage == 0 && isTex(m.d) && toTex(m.a) != toTex(m.d) ) + { + if( m_dwGeneralMaxStages >= 4 ) + { + op->op = CM_SUBTRACT; + op->Arg1 = m.a; + op->Arg2 = m.b; + op->Arg0 = CM_IGNORE; + gci.stages[curStage].dwTexture = toTex(m.a); + textureUsedInStage[curStage][curN64Stage%2] = true; + NextStage(curStage); + op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + (curN64Stage%2); + op->op = CM_MULTIPLYADD; + op->Arg1 = MUX_COMBINED; + op->Arg2 = m.c; + op->Arg0 = m.d; + gci.stages[curStage].dwTexture = toTex(m.d); + textureUsedInStage[curStage][curN64Stage%2] = true; + resultIsGood = true; + } + else + { + op->op = CM_MODULATE; + op->Arg1 = m.a; + op->Arg2 = m.c; + op->Arg0 = CM_IGNORE; + gci.stages[curStage].dwTexture = toTex(m.a); + textureUsedInStage[curStage][curN64Stage%2] = true; + NextStage(curStage); + op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + (curN64Stage%2); + op->op = CM_ADD; + op->Arg1 = MUX_COMBINED; + op->Arg2 = m.d; + op->Arg0 = CM_IGNORE; + gci.stages[curStage].dwTexture = toTex(m.d); + textureUsedInStage[curStage][curN64Stage%2] = true; + resultIsGood = false; + } + } + else + { + // There are two textures + int texToUse = CheckWhichTexToUseInThisStage(curN64Stage, curStage, gci); + op->op =CM_REPLACE; + op->Arg1 = (MUX_TEXEL0+texToUse); + op->Arg2 = CM_IGNORE; + op->Arg0 = CM_IGNORE; + gci.stages[curStage].dwTexture = texToUse; + textureUsedInStage[curStage][curN64Stage%2] = true; + + (*m_ppGeneralDecodedMux)->ReplaceVal(MUX_TEXEL0+texToUse, MUX_COMBINED, curN64Stage); + + NextStage(curStage); + Check1TxtrForAlpha(curN64Stage, curStage, gci, GetTexelNumber(m)); + op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + (curN64Stage%2); + + m.a = MUX_COMBINED; + m.c = MUX_TEXEL0+(1-texToUse); + m.b = m.d = 0; + curStage = GenCI_Type_A_MOD_C(curN64Stage, curStage, gci); + } + } + else if( CountTexel1Cycle(m) == 1 ) + { + if( m_dwGeneralMaxStages < 4 ) + { + Check1TxtrForAlpha(curN64Stage, curStage, gci, GetTexelNumber(m)); + op->Arg1 = (MUX_TEXEL0+GetTexelNumber(m)); + if( (*m_ppGeneralDecodedMux)->isUsedInCycle(MUX_SHADE, curN64Stage) ) + { + op->op =CM_MODULATE; + op->Arg2 = MUX_SHADE; + } + else + { + op->op =CM_REPLACE; + op->Arg2 = 0; + } + op->Arg0 = CM_IGNORE; + gci.stages[curStage].dwTexture = GetTexelNumber(m); + textureUsedInStage[curStage][curN64Stage%2] = true; + } + else + { + curStage = GenCI_Type_A_SUB_B_MOD_C(curN64Stage, curStage, gci); + m.a = MUX_COMBINED; + NextStage(curStage); + curStage = GenCI_Type_A_ADD_D(curN64Stage, curStage, gci); + } + } + else + { + m.d = 0; + curStage = GenCI_Type_A_SUB_B_MOD_C(curN64Stage, curStage, gci); + m = save; + m.a = MUX_COMBINED; + m.b = m.c = 0; + NextStage(curStage); + curStage = GenCI_Type_A_ADD_D(curN64Stage, curStage, gci); + } + + m = save; + return curStage; +} + +int CGeneralCombiner::GenCI_Type_A_SUB_B_ADD_D(int curN64Stage, int curStage, GeneralCombinerInfo &gci) +{ + N64CombinerType &m = (*m_ppGeneralDecodedMux)->m_n64Combiners[curN64Stage]; + + N64CombinerType save = m; + m.d = MUX_0; + curStage = GenCI_Type_A_SUB_B(curN64Stage, curStage, gci); + m = save; + m.a = MUX_COMBINED; + m.b = MUX_0; + NextStage(curStage); + curStage = GenCI_Type_A_ADD_D(curN64Stage, curStage, gci); + m = save; + + return curStage; +} + + +int CGeneralCombiner::GenCI_Type_A_ADD_B_MOD_C(int curN64Stage, int curStage, GeneralCombinerInfo &gci) +{ + N64CombinerType &m = (*m_ppGeneralDecodedMux)->m_n64Combiners[curN64Stage]; + + N64CombinerType save = m; + m.d = m.b; m.b = 0; + curStage = GenCI_Type_A_ADD_D(curN64Stage, curStage, gci); + m = save; + m.b = MUX_0; + m.a = MUX_COMBINED; + NextStage(curStage); + curStage = GenCI_Type_A_MOD_C(curN64Stage, curStage, gci); + m = save; + + return curStage; +} + +int CGeneralCombiner::GenCI_Type_A_B_C_A(int curN64Stage, int curStage, GeneralCombinerInfo &gci) +{ + // We can not do too much with this type, it is not a bad idea to use LERP to simplify it. + //return GenCI_Type_A_LERP_B_C(curN64Stage, curStage, gci); + return GenCI_Type_A_B_C_D(curN64Stage, curStage, gci); +} + +int CGeneralCombiner::GenCI_Type_A_SUB_B_MOD_C(int curN64Stage, int curStage, GeneralCombinerInfo &gci) +{ + N64CombinerType &m = (*m_ppGeneralDecodedMux)->m_n64Combiners[curN64Stage]; + + N64CombinerType save = m; + m.c = MUX_0; + curStage = GenCI_Type_A_SUB_B(curN64Stage, curStage, gci); + m = save; + m.b = MUX_0; + m.a = MUX_COMBINED; + NextStage(curStage); + curStage = GenCI_Type_A_MOD_C(curN64Stage, curStage, gci); + m = save; + + return curStage; +} + + ///////////////////////////////////// + // End of gci generating functions // + ///////////////////////////////////// + + +void CGeneralCombiner::SkipStage(StageOperate &op, int &curStage) +{ + op.op = CM_REPLACE; + op.Arg1 = MUX_COMBINED; + op.Arg2 = CM_IGNORE; + op.Arg0 = CM_IGNORE; + NextStage(curStage); +} + +void CGeneralCombiner::NextStage(int &curStage) +{ + if( curStage < m_dwGeneralMaxStages-1 ) + { + curStage++; + } + else + { + curStage++; + resultIsGood = false; + TRACE0("Stage overflow"); + } +} + +void CGeneralCombiner::Check1TxtrForAlpha(int curN64Stage, int &curStage, GeneralCombinerInfo &gci, int tex) +{ + N64CombinerType &m = (*m_ppGeneralDecodedMux)->m_n64Combiners[curN64Stage]; + if( curN64Stage%2 && IsTxtrUsed(m) ) + { + while (curStagem_n64Combiners[curN64Stage]; + if( curN64Stage%2 && IsTxtrUsed(m) ) + { + if( tex1 == tex2 ) + { + while (curStage m_dwGeneralMaxStages ) + { + resultIsGood = false; + gci.nStages = m_dwGeneralMaxStages; + } + + if( mux.m_ColorTextureFlag[0] != 0 || mux.m_ColorTextureFlag[1] != 0 ) + { + resultIsGood = false; + } + + // The bResultIsGoodWithinStages is for Semi-Pixel shader combiner, don't move the code down + gci.bResultIsGoodWithinStages = resultIsGood; + if( mux.HowManyConstFactors() > 1 || gci.specularPostOp != MUX_0 || gci.blendingFunc != ENABLE_BOTH ) + { + gci.bResultIsGoodWithinStages = false; + } + + if( gci.nStages > stages[0] ) // Color has less stages + { + for( int i=stages[0]; i stages[1] ) // Color has less stages + { + for( int i=stages[1]; i= m_dwGeneralMaxStages ) + { + extern int noOfTwoStages; + extern GeneralCombinerInfo twostages[]; + + for( int k=0; km_dWords[0]; + result.muxDWords[1] = (*m_ppGeneralDecodedMux)->m_dWords[1]; + result.muxDWords[2] = (*m_ppGeneralDecodedMux)->m_dWords[2]; + result.muxDWords[3] = (*m_ppGeneralDecodedMux)->m_dWords[3]; + result.m_dwShadeAlphaChannelFlag = (*m_ppGeneralDecodedMux)->m_dwShadeAlphaChannelFlag; + result.m_dwShadeColorChannelFlag = (*m_ppGeneralDecodedMux)->m_dwShadeColorChannelFlag; + result.colorTextureFlag[0] = (*m_ppGeneralDecodedMux)->m_ColorTextureFlag[0]; + result.colorTextureFlag[1] = (*m_ppGeneralDecodedMux)->m_ColorTextureFlag[1]; + result.dwMux0 = (*m_ppGeneralDecodedMux)->m_dwMux0; + result.dwMux1 = (*m_ppGeneralDecodedMux)->m_dwMux1; + + m_vCompiledCombinerStages.push_back(result); + m_lastGeneralIndex = m_vCompiledCombinerStages.size()-1; + + return m_lastGeneralIndex; +} + + +int CGeneralCombiner::FindCompiledMux( ) +{ +#ifdef DEBUGGER + if( debuggerDropCombiners || debuggerDropGeneralCombiners ) + { + m_vCompiledCombinerStages.clear(); + //m_dwLastMux0 = m_dwLastMux1 = 0; + debuggerDropCombiners = false; + debuggerDropGeneralCombiners = false; + } +#endif + + for( uint32 i=0; im_dwMux0 && m_vCompiledCombinerStages[i].dwMux1 == (*m_ppGeneralDecodedMux)->m_dwMux1 ) + { + m_lastGeneralIndex = i; + return i; + } + } + + return -1; +} + + + +bool LM_textureUsedInStage[8]; +void CGeneralCombiner::LM_GenCI_Init(GeneralCombinerInfo &gci) +{ + gci.specularPostOp=gci.TFactor=MUX_0; + + gci.blendingFunc = ENABLE_BOTH; + + for( int i=0; i<8; i++) + { + gci.stages[i].dwTexture = 0; + LM_textureUsedInStage[i] = false; + } +} + + +//#define fillstage(opr,a1,a2,a3) {op->op=opr;op->Arg1=a1;op->Arg2=a2;op->Arg0=a3;curStage++;} +inline void FillStage(StageOperate &op, uint32 opr, uint32 a1, uint32 a2, uint32 a3) +{ + op.op = opr; + op.Arg1 = a1; + op.Arg2 = a2; + op.Arg0 = a3; +} + +/************************************************************************/ +/* New functions, will generate stages within stage limited */ +/* and return the number of stages used. */ +/************************************************************************/ +int CGeneralCombiner::LM_GenCI_Type_D(N64CombinerType &m, int curStage, int limit, int channel, bool checktexture, GeneralCombinerInfo &gci) +{ + int originalstage=curStage; + StageOperate *op = ((StageOperate*)(&(gci.stages[curStage]))) + channel; + if( checktexture && LM_Check1TxtrForAlpha(curStage, gci, m.d ) ) + { + if( limit > 1 ) + { + FillStage(*op,CM_REPLACE,MUX_COMBINED,CM_IGNORE,CM_IGNORE); + curStage++; + op = ((StageOperate*)(&(gci.stages[curStage]))) + channel; + FillStage(*op,CM_REPLACE,m.d,CM_IGNORE,CM_IGNORE); + } + else + { + // It is not allowed to use two stages, what to do? + // It should not happen anyway + TRACE0("Check me here, at LM_GenCI_Type_D"); + } + } + else + { + FillStage(*op,CM_REPLACE,m.d,CM_IGNORE,CM_IGNORE); + } + + gci.stages[curStage].dwTexture = GetTexelNumber(m); + LM_textureUsedInStage[curStage] = IsTxtrUsed(m); + curStage++; + + return curStage-originalstage; +} +int CGeneralCombiner::LM_GenCI_Type_A_MOD_C(N64CombinerType &m, int curStage, int limit, int channel, bool checktexture, GeneralCombinerInfo &gci, uint32 dxop) +{ + int originalstage=curStage; + StageOperate *op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + channel; + + int numberOfTex = CountTexel1Cycle(m); + + if( numberOfTex == 2 ) + { + // As we can not use both texture in one stage + // we split them to two stages + // Stage1: SELECT txt1 + // Stage2: MOD txt2 + + if( checktexture ) + { + if( LM_Check1TxtrForAlpha(curStage, gci, m.a ) ) + { + FillStage(*op,CM_REPLACE,m.c,CM_IGNORE,CM_IGNORE); + gci.stages[curStage].dwTexture = toTex(m.c); + LM_textureUsedInStage[curStage] = true; + curStage++; + + op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + channel; + FillStage(*op,dxop,m.a,MUX_COMBINED,CM_IGNORE); + gci.stages[curStage].dwTexture = toTex(m.a); + LM_textureUsedInStage[curStage] = true; + curStage++; + } + else + { + FillStage(*op,CM_REPLACE,m.a,CM_IGNORE,CM_IGNORE); + gci.stages[curStage].dwTexture = toTex(m.a); + LM_textureUsedInStage[curStage] = true; + curStage++; + + op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + channel; + FillStage(*op,dxop,m.c,MUX_COMBINED,CM_IGNORE); + gci.stages[curStage].dwTexture = toTex(m.c); + LM_textureUsedInStage[curStage] = true; + curStage++; + } + } + else + { + FillStage(*op,CM_REPLACE,m.a,CM_IGNORE,CM_IGNORE); + gci.stages[curStage].dwTexture = toTex(m.a); + LM_textureUsedInStage[curStage] = true; + curStage++; + + op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + channel; + FillStage(*op,dxop,m.c,MUX_COMBINED,CM_IGNORE); + gci.stages[curStage].dwTexture = toTex(m.c); + LM_textureUsedInStage[curStage] = true; + curStage++; + } + } + else if( numberOfTex == 1) + { + if( checktexture ) + { + if( isTex(m.a) ) + { + if( LM_Check1TxtrForAlpha(curStage, gci, m.a ) ) + { + FillStage(*op,CM_REPLACE,m.c,CM_IGNORE,CM_IGNORE); + curStage++; + + op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + channel; + FillStage(*op,dxop,m.a,MUX_COMBINED,CM_IGNORE); + gci.stages[curStage].dwTexture = toTex(m.a); + LM_textureUsedInStage[curStage] = true; + curStage++; + } + else + { + FillStage(*op,CM_REPLACE,m.a,CM_IGNORE,CM_IGNORE); + gci.stages[curStage].dwTexture = toTex(m.a); + LM_textureUsedInStage[curStage] = true; + curStage++; + + op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + channel; + FillStage(*op,dxop,m.c,MUX_COMBINED,CM_IGNORE); + curStage++; + } + } + else + { + if( LM_Check1TxtrForAlpha(curStage, gci, m.c ) ) + { + FillStage(*op,CM_REPLACE,m.a,CM_IGNORE,CM_IGNORE); + curStage++; + + op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + channel; + FillStage(*op,dxop,m.c,MUX_COMBINED,CM_IGNORE); + gci.stages[curStage].dwTexture = toTex(m.c); + LM_textureUsedInStage[curStage] = true; + curStage++; + } + else + { + FillStage(*op,CM_REPLACE,m.c,CM_IGNORE,CM_IGNORE); + gci.stages[curStage].dwTexture = toTex(m.c); + LM_textureUsedInStage[curStage] = true; + curStage++; + + op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + channel; + FillStage(*op,dxop,m.a,MUX_COMBINED,CM_IGNORE); + curStage++; + } + } + } + else + { + if( isTex(m.a) ) + { + FillStage(*op,CM_REPLACE,m.a,CM_IGNORE,CM_IGNORE); + gci.stages[curStage].dwTexture = toTex(m.a); + LM_textureUsedInStage[curStage] = true; + curStage++; + + op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + channel; + FillStage(*op,dxop,m.c,MUX_COMBINED,CM_IGNORE); + curStage++; + } + else + { + FillStage(*op,CM_REPLACE,m.c,CM_IGNORE,CM_IGNORE); + gci.stages[curStage].dwTexture = toTex(m.c); + LM_textureUsedInStage[curStage] = true; + curStage++; + + op = ((StageOperate*)(&(gci.stages[curStage].colorOp))) + channel; + FillStage(*op,dxop,m.a,MUX_COMBINED,CM_IGNORE); + curStage++; + } + + } + } + else + { + FillStage(*op,dxop,m.a,m.c,CM_IGNORE); + curStage++; + } + + return curStage-originalstage; +} +int CGeneralCombiner::LM_GenCI_Type_A_ADD_D(N64CombinerType &m, int curStage, int limit, int channel, bool checktexture, GeneralCombinerInfo &gci) +{ + return 0; +} +int CGeneralCombiner::LM_GenCI_Type_A_SUB_B(N64CombinerType &m, int curStage, int limit, int channel, bool checktexture, GeneralCombinerInfo &gci) +{ + return 0; +} +int CGeneralCombiner::LM_GenCI_Type_A_LERP_B_C(N64CombinerType &m, int curStage, int limit, int channel, bool checktexture, GeneralCombinerInfo &gci) +{ + return 0; +} +int CGeneralCombiner::LM_GenCI_Type_A_MOD_C_ADD_D(N64CombinerType &m, int curStage, int limit, int channel, bool checktexture, GeneralCombinerInfo &gci) +{ + return 0; +} +int CGeneralCombiner::LM_GenCI_Type_A_SUB_B_ADD_D(N64CombinerType &m, int curStage, int limit, int channel, bool checktexture, GeneralCombinerInfo &gci) +{ + return 0; +} +int CGeneralCombiner::LM_GenCI_Type_A_SUB_B_MOD_C(N64CombinerType &m, int curStage, int limit, int channel, bool checktexture, GeneralCombinerInfo &gci) +{ + return 0; +} +int CGeneralCombiner::LM_GenCI_Type_A_ADD_B_MOD_C(N64CombinerType &m, int curStage, int limit, int channel, bool checktexture, GeneralCombinerInfo &gci) +{ + return 0; +} +int CGeneralCombiner::LM_GenCI_Type_A_B_C_D(N64CombinerType &m, int curStage, int limit, int channel, bool checktexture, GeneralCombinerInfo &gci) +{ + return 0; +} +int CGeneralCombiner::LM_GenCI_Type_A_B_C_A(N64CombinerType &m, int curStage, int limit, int channel, bool checktexture, GeneralCombinerInfo &gci) +{ + return 0; +} + +int CGeneralCombiner::LM_ParseDecodedMux() +{ + return 0; +} + +bool CGeneralCombiner::LM_Check1TxtrForAlpha(int curStage, GeneralCombinerInfo &gci, uint32 val ) +{ + return !( isTex(val) && LM_textureUsedInStage[curStage] && gci.stages[curStage].dwTexture != (unsigned int)toTex(val) ); +} + + +void CGeneralCombiner::LM_SkipStage(StageOperate &op) +{ + op.op = CM_REPLACE; + op.Arg1 = MUX_COMBINED; + op.Arg2 = CM_IGNORE; + op.Arg0 = CM_IGNORE; +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/GeneralCombiner.h b/libmupen64plus/mupen64plus-video-rice/src/GeneralCombiner.h new file mode 100644 index 0000000000..0e0d412743 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/GeneralCombiner.h @@ -0,0 +1,225 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#ifndef _GENERAL_COMBINER_H_ +#define _GENERAL_COMBINER_H_ + +#include + +#include "DecodedMux.h" + +class GeneralCombineStage +{ +public: + StageOperate colorOp; + StageOperate alphaOp; + uint32 dwTexture; //Which texture to apply, 0 or 1 + bool bTextureUsed; + + BOOL operator!=(const GeneralCombineStage & cs) const { return !(operator==(cs)); } + BOOL operator==(const GeneralCombineStage & cs) const + { + return ( + cs.colorOp.Arg1 == colorOp.Arg1 && + cs.colorOp.Arg2 == colorOp.Arg2 && + cs.colorOp.Arg0 == colorOp.Arg0 && + cs.alphaOp.Arg1 == alphaOp.Arg1 && + cs.alphaOp.Arg2 == alphaOp.Arg2 && + cs.alphaOp.Arg0 == alphaOp.Arg0 && + cs.colorOp.op == colorOp.op && + cs.alphaOp.op == alphaOp.op && + cs.dwTexture == dwTexture&& + cs.bTextureUsed==bTextureUsed); + } +}; + +class GeneralCombinerInfo +{ +public: + uint32 muxDWords[4]; // Simplified Mux + uint32 dwMux0; + uint32 dwMux1; + int nStages; + + BlendingFunc blendingFunc; + uint32 TFactor; + uint32 m_dwShadeColorChannelFlag; + uint32 m_dwShadeAlphaChannelFlag; + uint32 specularPostOp; + uint32 colorTextureFlag[2]; + + GeneralCombineStage stages[8]; + + bool bResultIsGoodWithinStages; + + BOOL operator!=(const GeneralCombinerInfo & sci) const { return !(operator==(sci)); } + BOOL operator==(const GeneralCombinerInfo & sci) const + { + int i; + + if (sci.nStages != nStages) + return FALSE; + if (sci.blendingFunc != blendingFunc) + return FALSE; + + for (i = 0; i < nStages; i++) + { + if (sci.stages[i] != stages[i]) + return FALSE; + } + + if( sci.TFactor != TFactor ) + return FALSE; + if( sci.specularPostOp != specularPostOp ) + return FALSE; + if( sci.m_dwShadeColorChannelFlag != m_dwShadeColorChannelFlag ) + return FALSE; + if( sci.m_dwShadeAlphaChannelFlag != m_dwShadeAlphaChannelFlag ) + return FALSE; + if( sci.colorTextureFlag[0] != colorTextureFlag[0] ) + return FALSE; + if( sci.colorTextureFlag[1] != colorTextureFlag[1] ) + return FALSE; + + return TRUE; + } +}; + +enum CombinerOp +{ + CM_REPLACE, + CM_MODULATE, + CM_ADD, + CM_SUBTRACT, + CM_INTERPOLATE, // == LERP in DirectX, INTERPOLATE = OpenGL + + CM_ADDSMOOTH, // For DirectX only, for OpenGL, use INTERPOLATE + CM_BLENDCURRENTALPHA, // For DirectX only, for OpenGL, use INTERPOLATE + CM_BLENDDIFFUSEALPHA, // For DirectX only, for OpenGL, use INTERPOLATE + CM_BLENDFACTORALPHA, // For DirectX only, for OpenGL, use INTERPOLATE + CM_BLENDTEXTUREALPHA, // For DirectX only, for OpenGL, use INTERPOLATE + CM_MULTIPLYADD, // For DirectX only +}; + +#define CM_IGNORE 0 +#define CM_IGNORE_BYTE 0xFF + +/************************************************************************/ +/* This general combiner class is designed for general DirectX combiner */ +/* and OpenGL 1.2/1.3 combiner. Such combiners have the following */ +/* limitions and conditions: */ +/* */ +/* - Supporting at least 2 textures */ +/* - Supporting at least 2 combiner stages */ +/* - At each combiner stages, only 1 texture can be used */ +/* - Supporting only 1 constant color */ +/* - Supporting more or less texture combine operations, depending */ +/* on devices caps */ +/* */ +/* Before using this class, device caps boolean flags must be set */ +/* externally by owner of the class object (or a subclass object). */ +/* */ +/* */ +/************************************************************************/ +class CGeneralCombiner +{ +protected: + CGeneralCombiner(); + + int FindCompiledMux(); + int ParseDecodedMux(); + void ParseDecodedMuxForConstants(GeneralCombinerInfo &res); + int SaveParserResult(GeneralCombinerInfo &result); + + int m_lastGeneralIndex; + DecodedMux **m_ppGeneralDecodedMux; + + /* + * Texture ops flags + */ + + bool m_bTxtOpAdd; + bool m_bTxtOpSub; + bool m_bTxtOpLerp; // LERP is for DirectX, INTERPOLATE is for OpenGL + + bool m_bTxtOpAddSmooth; // For DirectX only, for OpenGL, use INTERPOLATE + bool m_bTxtOpBlendCurAlpha; // For DirectX only, for OpenGL, use INTERPOLATE + bool m_bTxtOpBlendDifAlpha; // For DirectX only, for OpenGL, use INTERPOLATE + bool m_bTxtOpBlendFacAlpha; // For DirectX only, for OpenGL, use INTERPOLATE + bool m_bTxtOpBlendTxtAlpha; // For DirectX only, for OpenGL, use INTERPOLATE + bool m_bTxtOpMulAdd; // For DirectX only + + int m_dwGeneralMaxStages; + + std::vector m_vCompiledCombinerStages; + +protected: + // combiner info generating functions + void GenCI_Init(GeneralCombinerInfo &ci); + void SkipStage(StageOperate &op, int &curStage); + void NextStage(int &curStage); + void Check1TxtrForAlpha(int curN64Stage, int &curStage, GeneralCombinerInfo &ci, int tex); + int Check2TxtrForAlpha(int curN64Stage, int &curStage, GeneralCombinerInfo &ci, int tex1, int tex2); + int CheckWhichTexToUseInThisStage(int curN64Stage, int curStage, GeneralCombinerInfo &ci); + + int GenCI_Type_D(int curN64Stage, int curStage, GeneralCombinerInfo &ci); + int GenCI_Type_A_MOD_C(int curN64Stage, int curStage, GeneralCombinerInfo &ci, uint32 dxop=CM_MODULATE); + int GenCI_Type_A_ADD_D(int curN64Stage, int curStage, GeneralCombinerInfo &ci); + int GenCI_Type_A_SUB_B(int curN64Stage, int curStage, GeneralCombinerInfo &ci); + int GenCI_Type_A_LERP_B_C(int curN64Stage, int curStage, GeneralCombinerInfo &ci); + int GenCI_Type_A_MOD_C_ADD_D(int curN64Stage, int curStage, GeneralCombinerInfo &ci); + int GenCI_Type_A_SUB_B_ADD_D(int curN64Stage, int curStage, GeneralCombinerInfo &ci); + int GenCI_Type_A_SUB_B_MOD_C(int curN64Stage, int curStage, GeneralCombinerInfo &ci); + int GenCI_Type_A_ADD_B_MOD_C(int curN64Stage, int curStage, GeneralCombinerInfo &ci); + int GenCI_Type_A_B_C_D(int curN64Stage, int curStage, GeneralCombinerInfo &ci); + int GenCI_Type_A_B_C_A(int curN64Stage, int curStage, GeneralCombinerInfo &ci); + + + // New functions, generate stages within the stage limition + // And return the number of stages used + // channel = 0 for color channel + // channel = 1 for alpha channel + // checktexture = true, need to use if texture matching in the stage + // checktexture = false, no check, just use any texture in the stage (since this stage hasn't been used) + int LM_GenCI_Type_D(N64CombinerType &m, int curStage, int limit, int channel, bool checktexture, GeneralCombinerInfo &ci); + int LM_GenCI_Type_A_MOD_C(N64CombinerType &m, int curStage, int limit, int channel, bool checktexture, GeneralCombinerInfo &ci, uint32 dxop=CM_MODULATE); + int LM_GenCI_Type_A_ADD_D(N64CombinerType &m, int curStage, int limit, int channel, bool checktexture, GeneralCombinerInfo &ci); + int LM_GenCI_Type_A_SUB_B(N64CombinerType &m, int curStage, int limit, int channel, bool checktexture, GeneralCombinerInfo &ci); + int LM_GenCI_Type_A_LERP_B_C(N64CombinerType &m, int curStage, int limit, int channel, bool checktexture, GeneralCombinerInfo &ci); + int LM_GenCI_Type_A_MOD_C_ADD_D(N64CombinerType &m, int curStage, int limit, int channel, bool checktexture, GeneralCombinerInfo &ci); + int LM_GenCI_Type_A_SUB_B_ADD_D(N64CombinerType &m, int curStage, int limit, int channel, bool checktexture, GeneralCombinerInfo &ci); + int LM_GenCI_Type_A_SUB_B_MOD_C(N64CombinerType &m, int curStage, int limit, int channel, bool checktexture, GeneralCombinerInfo &ci); + int LM_GenCI_Type_A_ADD_B_MOD_C(N64CombinerType &m, int curStage, int limit, int channel, bool checktexture, GeneralCombinerInfo &ci); + int LM_GenCI_Type_A_B_C_D(N64CombinerType &m, int curStage, int limit, int channel, bool checktexture, GeneralCombinerInfo &ci); + int LM_GenCI_Type_A_B_C_A(N64CombinerType &m, int curStage, int limit, int channel, bool checktexture, GeneralCombinerInfo &ci); + void LM_GenCI_Init(GeneralCombinerInfo &ci); + int LM_ParseDecodedMux(); + bool LM_Check1TxtrForAlpha(int curStage, GeneralCombinerInfo &ci, uint32 val); + void LM_SkipStage(StageOperate &op); + + + bool IsTextureUsedInStage(GeneralCombineStage &stage); + +#ifdef DEBUGGER + void General_DisplayBlendingStageInfo(GeneralCombinerInfo &ci); +#endif + +}; + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/GraphicsContext.cpp b/libmupen64plus/mupen64plus-video-rice/src/GraphicsContext.cpp new file mode 100644 index 0000000000..271a250d50 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/GraphicsContext.cpp @@ -0,0 +1,113 @@ +/* + + Copyright (C) 2003 Rice1964 + + 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. + +*/ + +#define M64P_PLUGIN_PROTOTYPES 1 +#include "m64p_plugin.h" +#include "m64p_vidext.h" + +#include "FrameBuffer.h" +#include "OGLGraphicsContext.h" +#include "Video.h" + +CGraphicsContext* CGraphicsContext::g_pGraphicsContext = NULL; +bool CGraphicsContext::m_deviceCapsIsInitialized = false; +bool CGraphicsContext::needCleanScene = false; +int CGraphicsContext::m_maxFSAA = 16; +int CGraphicsContext::m_maxAnisotropy = 16; + +CGraphicsContext * CGraphicsContext::Get(void) +{ + return CGraphicsContext::g_pGraphicsContext; +} + +CGraphicsContext::CGraphicsContext() : + m_supportTextureMirror(false), + m_bReady(false), + m_bActive(false), + m_bWindowed(true) +{ +} +CGraphicsContext::~CGraphicsContext() +{ + g_pFrameBufferManager->CloseUp(); +} + +uint32 CGraphicsContext::m_dwWindowStyle=0; // Saved window style for mode switches +uint32 CGraphicsContext::m_dwWindowExStyle=0; // Saved window style for mode switches +uint32 CGraphicsContext::m_dwStatusWindowStyle=0; // Saved window style for mode switches + +void CGraphicsContext::InitWindowInfo() +{ +} + +bool CGraphicsContext::Initialize(uint32 dwWidth, uint32 dwHeight, BOOL bWindowed) +{ + m_bWindowed = (bWindowed != 0); + + g_pFrameBufferManager->Initialize(); + return true; +} + +void CGraphicsContext::CleanUp() +{ + m_bActive = false; + m_bReady = false; +} + + +int __cdecl SortFrequenciesCallback( const void* arg1, const void* arg2 ) +{ + unsigned int* p1 = (unsigned int*)arg1; + unsigned int* p2 = (unsigned int*)arg2; + + if( *p1 < *p2 ) + return -1; + else if( *p1 > *p2 ) + return 1; + else + return 0; +} +int __cdecl SortResolutionsCallback( const void* arg1, const void* arg2 ) +{ + unsigned int* p1 = (unsigned int*)arg1; + unsigned int* p2 = (unsigned int*)arg2; + + if( *p1 < *p2 ) + return -1; + else if( *p1 > *p2 ) + return 1; + else + { + if( p1[1] < p2[1] ) + return -1; + else if( p1[1] > p2[1] ) + return 1; + else + return 0; + } +} + +// This is a static function, will be called when the plugin DLL is initialized +void CGraphicsContext::InitDeviceParameters(void) +{ + // To initialze device parameters for OpenGL + COGLGraphicsContext::InitDeviceParameters(); +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/GraphicsContext.h b/libmupen64plus/mupen64plus-video-rice/src/GraphicsContext.h new file mode 100644 index 0000000000..51139e0356 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/GraphicsContext.h @@ -0,0 +1,101 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + +#ifndef GFXCONTEXT_H +#define GFXCONTEXT_H + +#include "typedefs.h" +#include "CritSect.h" + +enum ClearFlag +{ + CLEAR_COLOR_BUFFER=0x01, + CLEAR_DEPTH_BUFFER=0x02, + CLEAR_COLOR_AND_DEPTH_BUFFER=0x03, +}; + + +typedef struct +{ + uint32 addr; //N64 RDRAM address + uint32 size; //N64 buffer size + uint32 format; //N64 format + uint32 width; + uint32 height; +} TextureBufferShortInfo; + + +// This class basically provides an extra level of security for our +// multithreaded code. Threads can Grab the CGraphicsContext to prevent +// other threads from changing/releasing any of the pointers while it is +// running. + +// It is based on CCritSect for Lock() and Unlock() + +class CGraphicsContext : public CCritSect +{ + friend class CDeviceBuilder; + +public: + bool Ready() { return m_bReady; } + bool IsWindowed() {return m_bWindowed;} + + virtual bool Initialize(uint32 dwWidth, uint32 dwHeight, BOOL bWindowed ); + virtual void CleanUp(); + + virtual void Clear(ClearFlag flags, uint32 color=0xFF000000, float depth=1.0f) = 0; + virtual void UpdateFrame(bool swaponly=false) = 0; + virtual int ToggleFullscreen()=0; // return 0 as the result is windowed + + static void InitWindowInfo(); + static void InitDeviceParameters(); + + bool m_supportTextureMirror; + +public: + static int m_maxFSAA; + static int m_maxAnisotropy; + +protected: + static uint32 m_dwWindowStyle; // Saved window style for mode switches + static uint32 m_dwWindowExStyle; // Saved window style for mode switches + static uint32 m_dwStatusWindowStyle; // Saved window style for mode switches + + static bool m_deviceCapsIsInitialized; + + bool m_bReady; + bool m_bActive; + + bool m_bWindowed; + RECT m_rcWindowBounds; + + char m_strDeviceStats[256]; + + virtual ~CGraphicsContext(); + CGraphicsContext(); + +public: + static CGraphicsContext *g_pGraphicsContext; + static CGraphicsContext * Get(void); + inline const char* GetDeviceStr() {return m_strDeviceStats;} + static bool needCleanScene; +}; + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/IColor.h b/libmupen64plus/mupen64plus-video-rice/src/IColor.h new file mode 100644 index 0000000000..179f6c0be9 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/IColor.h @@ -0,0 +1,191 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + +#ifndef _ICOLOR_H_ +#define _ICOLOR_H_ + +#ifndef min +#define min(a,b) ((a) < (b) ? (a) : (b)) +#endif +#ifndef max +#define max(a,b) ((a) > (b) ? (a) : (b)) +#endif + +class IColor { +public: + uint8 r; + uint8 g; + uint8 b; + uint8 a; + + IColor(COLOR rgba) + { + *((COLOR*)this) = rgba; + } + + IColor() + { + *((COLOR*)this) = 0; + } + + IColor(XCOLOR &rgba) + { + *((COLOR*)this) = (unsigned int) rgba; + } + + inline IColor operator = (const IColor &sec) const + { + *((COLOR*)this) = *((COLOR*)&sec); + return *this; + } + + inline IColor operator = (COLOR col) const + { + *((COLOR*)this) = col; + return *this; + } + + inline IColor operator + (const IColor &sec) const + { + IColor newc; + newc.r = (uint8)min((unsigned int) r + (unsigned int) sec.r, 0xFF); + newc.g = (uint8)min((unsigned int) g + (unsigned int) sec.g, 0xFF); + newc.b = (uint8)min((unsigned int) b + (unsigned int) sec.b, 0xFF); + newc.a = (uint8)min((unsigned int) a + (unsigned int) sec.a, 0xFF); + + return newc; + } + + inline IColor operator - (const IColor &sec) const + { + IColor newc; + newc.r = max(int(r)-int(sec.r),0); + newc.g = max(int(g)-int(sec.g),0); + newc.b = max(int(b)-int(sec.b),0); + newc.a = max(int(a)-int(sec.a),0); + + return newc; + } + inline IColor operator * (const IColor &sec) const + { + IColor newc; + newc.r = (uint8)min((unsigned int) r * (unsigned int) sec.r / 256,255); + newc.g = (uint8)min((unsigned int) g * (unsigned int) sec.g / 256,255); + newc.b = (uint8)min((unsigned int) b * (unsigned int) sec.b / 256,255); + newc.a = (uint8)min((unsigned int) a * (unsigned int) sec.a / 256,255); + return newc; + } + + inline IColor& operator += (const IColor &sec) + { + r = uint8(min((unsigned int) r + (unsigned int) sec.r, 255)); + g = uint8(min((unsigned int) g + (unsigned int) sec.g, 255)); + b = uint8(min((unsigned int) b + (unsigned int) sec.b, 255)); + a = uint8(min((unsigned int) a + (unsigned int) sec.a, 255)); + return *this; + } + + inline IColor& operator -= (const IColor &sec) + { + r = uint8(max(int(r)-int(sec.r),0)); + g = uint8(max(int(g)-int(sec.g),0)); + b = uint8(max(int(b)-int(sec.b),0)); + a = uint8(max(int(a)-int(sec.a),0)); + return *this; + } + + inline IColor& operator *= (const IColor &sec) + { + r = uint8(min((unsigned int) r * (unsigned int) sec.r / 256,255)); + g = uint8(min((unsigned int) g * (unsigned int) sec.g / 256,255)); + b = uint8(min((unsigned int) b * (unsigned int) sec.b / 256,255)); + a = uint8(min((unsigned int) a * (unsigned int) sec.a / 256,255)); + return *this; + } + + inline IColor& operator += (XCOLOR val) + { + IColor newc(val); + return this->operator += (newc); + } + + inline IColor& operator -= (XCOLOR val) + { + IColor newc(val); + return this->operator-=(newc); + } + + inline IColor& operator *= (XCOLOR val) + { + IColor newc(val); + return this->operator*=(newc); + } + + inline IColor operator + (XCOLOR val) const + { + IColor newc(val); + return this->operator+(newc); + } + + inline IColor operator - (XCOLOR val) const + { + IColor newc(val); + return this->operator-(newc); + } + + inline IColor operator * (XCOLOR val) const + { + IColor newc(val); + return this->operator*(newc); + } + + inline operator COLOR() const + { + return *((COLOR*)this); + } + + inline operator XCOLOR() const + { + XCOLOR rgba; + rgba.r = (float)r/256.0f; + rgba.g = (float)g/256.0f; + rgba.b = (float)b/256.0f; + rgba.a = (float)a/256.0f; + + return rgba; + } + + inline void Complement() + { + r = 0xFF-r; + g = 0xFF-g; + b = 0xFF-b; + a = 0xFF-a; + } + + inline void AlphaReplicate() + { + r=g=b=a; + } +}; + + +#endif + + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLCombiner.cpp b/libmupen64plus/mupen64plus-video-rice/src/OGLCombiner.cpp new file mode 100644 index 0000000000..10c5334ef7 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLCombiner.cpp @@ -0,0 +1,356 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - OGLCombiner.cpp * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2003 Rice1964 * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "osal_opengl.h" + +#include "OGLCombiner.h" +#include "OGLDebug.h" +#include "OGLRender.h" +#include "OGLGraphicsContext.h" +#include "OGLDecodedMux.h" +#include "OGLTexture.h" + +//======================================================================== +uint32 DirectX_OGL_BlendFuncMaps [] = +{ + GL_SRC_ALPHA, //Nothing + GL_ZERO, //BLEND_ZERO = 1, + GL_ONE, //BLEND_ONE = 2, + GL_SRC_COLOR, //BLEND_SRCCOLOR = 3, + GL_ONE_MINUS_SRC_COLOR, //BLEND_INVSRCCOLOR = 4, + GL_SRC_ALPHA, //BLEND_SRCALPHA = 5, + GL_ONE_MINUS_SRC_ALPHA, //BLEND_INVSRCALPHA = 6, + GL_DST_ALPHA, //BLEND_DESTALPHA = 7, + GL_ONE_MINUS_DST_ALPHA, //BLEND_INVDESTALPHA = 8, + GL_DST_COLOR, //BLEND_DESTCOLOR = 9, + GL_ONE_MINUS_DST_COLOR, //BLEND_INVDESTCOLOR = 10, + GL_SRC_ALPHA_SATURATE, //BLEND_SRCALPHASAT = 11, + GL_SRC_ALPHA_SATURATE, //BLEND_BOTHSRCALPHA = 12, + GL_SRC_ALPHA_SATURATE, //BLEND_BOTHINVSRCALPHA = 13, +}; + +//======================================================================== +COGLColorCombiner::COGLColorCombiner(CRender *pRender) : + CColorCombiner(pRender), + m_pOGLRender((OGLRender*)pRender), + m_bSupportAdd(false), m_bSupportSubtract(false) +{ + m_pDecodedMux = new COGLDecodedMux; + m_pDecodedMux->m_maxConstants = 0; + m_pDecodedMux->m_maxTextures = 1; +} + +COGLColorCombiner::~COGLColorCombiner() +{ + delete m_pDecodedMux; + m_pDecodedMux = NULL; +} + +bool COGLColorCombiner::Initialize(void) +{ + m_bSupportAdd = false; + m_bSupportSubtract = false; + m_supportedStages = 1; + m_bSupportMultiTexture = false; + + COGLGraphicsContext *pcontext = (COGLGraphicsContext *)(CGraphicsContext::g_pGraphicsContext); + if( pcontext->IsExtensionSupported(OSAL_GL_ARB_TEXTURE_ENV_ADD) || pcontext->IsExtensionSupported("GL_EXT_texture_env_add") ) + { + m_bSupportAdd = true; + } + + if( pcontext->IsExtensionSupported("GL_EXT_blend_subtract") ) + { + m_bSupportSubtract = true; + } + + return true; +} + +void COGLColorCombiner::DisableCombiner(void) +{ + m_pOGLRender->DisableMultiTexture(); + glEnable(GL_BLEND); + OPENGL_CHECK_ERRORS; + glBlendFunc(GL_ONE, GL_ZERO); + OPENGL_CHECK_ERRORS; + + if( m_bTexelsEnable ) + { + COGLTexture* pTexture = g_textures[gRSP.curTile].m_pCOGLTexture; + if( pTexture ) + { + m_pOGLRender->EnableTexUnit(0,TRUE); + m_pOGLRender->BindTexture(pTexture->m_dwTextureName, 0); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + OPENGL_CHECK_ERRORS; + m_pOGLRender->SetAllTexelRepeatFlag(); + } +#ifdef DEBUGGER + else + { + DebuggerAppendMsg("Check me, texture is NULL but it is enabled"); + } +#endif + } + else + { + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + OPENGL_CHECK_ERRORS; + m_pOGLRender->EnableTexUnit(0,FALSE); + } +} + +void COGLColorCombiner::InitCombinerCycleCopy(void) +{ + m_pOGLRender->DisableMultiTexture(); + m_pOGLRender->EnableTexUnit(0,TRUE); + COGLTexture* pTexture = g_textures[gRSP.curTile].m_pCOGLTexture; + if( pTexture ) + { + m_pOGLRender->BindTexture(pTexture->m_dwTextureName, 0); + m_pOGLRender->SetTexelRepeatFlags(gRSP.curTile); + } +#ifdef DEBUGGER + else + { + DebuggerAppendMsg("Check me, texture is NULL"); + } +#endif + + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + OPENGL_CHECK_ERRORS; +} + +void COGLColorCombiner::InitCombinerCycleFill(void) +{ + m_pOGLRender->DisableMultiTexture(); + m_pOGLRender->EnableTexUnit(0,FALSE); +} + + +void COGLColorCombiner::InitCombinerCycle12(void) +{ + m_pOGLRender->DisableMultiTexture(); + if( !m_bTexelsEnable ) + { + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + OPENGL_CHECK_ERRORS; + m_pOGLRender->EnableTexUnit(0,FALSE); + return; + } + +#if SDL_VIDEO_OPENGL + uint32 mask = 0x1f; + COGLTexture* pTexture = g_textures[gRSP.curTile].m_pCOGLTexture; + if( pTexture ) + { + m_pOGLRender->EnableTexUnit(0,TRUE); + m_pOGLRender->BindTexture(pTexture->m_dwTextureName, 0); + m_pOGLRender->SetAllTexelRepeatFlag(); + } +#ifdef DEBUGGER + else + { + DebuggerAppendMsg("Check me, texture is NULL"); + } +#endif + + bool texIsUsed = m_pDecodedMux->isUsed(MUX_TEXEL0); + bool shadeIsUsedInColor = m_pDecodedMux->isUsedInCycle(MUX_SHADE, 0, COLOR_CHANNEL); + bool texIsUsedInColor = m_pDecodedMux->isUsedInCycle(MUX_TEXEL0, 0, COLOR_CHANNEL); + + if( texIsUsed ) + { + // Parse the simplified the mux, because the OGL 1.1 combiner function is so much + // limited, we only parse the 1st N64 combiner setting and only the RGB part + + N64CombinerType & comb = m_pDecodedMux->m_n64Combiners[0]; + switch( m_pDecodedMux->mType ) + { + case CM_FMT_TYPE_NOT_USED: + case CM_FMT_TYPE_D: // = A + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + OPENGL_CHECK_ERRORS; + break; + case CM_FMT_TYPE_A_ADD_D: // = A+D + if( shadeIsUsedInColor && texIsUsedInColor ) + { + if( m_bSupportAdd ) + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD); + else + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_BLEND); + } + else if( texIsUsedInColor ) + { + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + } + else + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + OPENGL_CHECK_ERRORS; + break; + case CM_FMT_TYPE_A_SUB_B: // = A-B + if( shadeIsUsedInColor && texIsUsedInColor ) + { + if( m_bSupportSubtract ) + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_SUBTRACT_ARB); + else + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_BLEND); + } + else if( texIsUsedInColor ) + { + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + } + else + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + OPENGL_CHECK_ERRORS; + break; + case CM_FMT_TYPE_A_MOD_C: // = A*C + case CM_FMT_TYPE_A_MOD_C_ADD_D: // = A*C+D + if( shadeIsUsedInColor && texIsUsedInColor ) + { + if( ((comb.c & mask) == MUX_SHADE && !(comb.c&MUX_COMPLEMENT)) || + ((comb.a & mask) == MUX_SHADE && !(comb.a&MUX_COMPLEMENT)) ) + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + else + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + } + else if( texIsUsedInColor ) + { + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + } + else + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + OPENGL_CHECK_ERRORS; + break; + case CM_FMT_TYPE_A_LERP_B_C: // = A*C+D + if( (comb.b&mask) == MUX_SHADE && (comb.c&mask)==MUX_TEXEL0 && ((comb.a&mask)==MUX_PRIM||(comb.a&mask)==MUX_ENV)) + { + float *fv; + if( (comb.a&mask)==MUX_PRIM ) + { + fv = GetPrimitiveColorfv(); + } + else + { + fv = GetEnvColorfv(); + } + + glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR,fv); + OPENGL_CHECK_ERRORS; + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_BLEND); + OPENGL_CHECK_ERRORS; + break; + } + default: // = (A-B)*C+D + if( shadeIsUsedInColor ) + { + if( ((comb.c & mask) == MUX_SHADE && !(comb.c&MUX_COMPLEMENT)) || + ((comb.a & mask) == MUX_SHADE && !(comb.a&MUX_COMPLEMENT)) ) + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + else + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + } + else + { + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + } + OPENGL_CHECK_ERRORS; + break; + } + } + else + { + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + OPENGL_CHECK_ERRORS; + } +#endif +} + +void COGLBlender::NormalAlphaBlender(void) +{ + glEnable(GL_BLEND); + OPENGL_CHECK_ERRORS; + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + OPENGL_CHECK_ERRORS; +} + +void COGLBlender::DisableAlphaBlender(void) +{ + glEnable(GL_BLEND); + OPENGL_CHECK_ERRORS; + glBlendFunc(GL_ONE, GL_ZERO); + OPENGL_CHECK_ERRORS; +} + + +void COGLBlender::BlendFunc(uint32 srcFunc, uint32 desFunc) +{ + glBlendFunc(DirectX_OGL_BlendFuncMaps[srcFunc], DirectX_OGL_BlendFuncMaps[desFunc]); + OPENGL_CHECK_ERRORS; +} + +void COGLBlender::Enable() +{ + glEnable(GL_BLEND); + OPENGL_CHECK_ERRORS; +} + +void COGLBlender::Disable() +{ + glDisable(GL_BLEND); + OPENGL_CHECK_ERRORS; +} + +void COGLColorCombiner::InitCombinerBlenderForSimpleTextureDraw(uint32 tile) +{ + m_pOGLRender->DisableMultiTexture(); + if( g_textures[tile].m_pCTexture ) + { + m_pOGLRender->EnableTexUnit(0,TRUE); + glBindTexture(GL_TEXTURE_2D, ((COGLTexture*)(g_textures[tile].m_pCTexture))->m_dwTextureName); + OPENGL_CHECK_ERRORS; + } + m_pOGLRender->SetAllTexelRepeatFlag(); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + OPENGL_CHECK_ERRORS; + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + OPENGL_CHECK_ERRORS; + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); // Linear Filtering + OPENGL_CHECK_ERRORS; + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); // Linear Filtering + OPENGL_CHECK_ERRORS; + + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + OPENGL_CHECK_ERRORS; + m_pOGLRender->SetAlphaTestEnable(FALSE); +} + +#ifdef DEBUGGER +extern const char *translatedCombTypes[]; +void COGLColorCombiner::DisplaySimpleMuxString(void) +{ + TRACE0("\nSimplified Mux\n"); + m_pDecodedMux->DisplaySimpliedMuxString("Used"); +} +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLCombiner.h b/libmupen64plus/mupen64plus-video-rice/src/OGLCombiner.h new file mode 100644 index 0000000000..0846918c05 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLCombiner.h @@ -0,0 +1,77 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - OGLCombiner.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Rice1964 * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef _OGL_COMBINER_H_ +#define _OGL_COMBINER_H_ + +#include "Blender.h" +#include "Combiner.h" + +class OGLRender; + +class COGLColorCombiner : public CColorCombiner +{ +public: + bool Initialize(void); + void InitCombinerBlenderForSimpleTextureDraw(uint32 tile=0); +protected: + friend class OGLDeviceBuilder; + + void DisableCombiner(void); + void InitCombinerCycleCopy(void); + void InitCombinerCycleFill(void); + void InitCombinerCycle12(void); + + COGLColorCombiner(CRender *pRender); + ~COGLColorCombiner(); + OGLRender *m_pOGLRender; + + bool m_bSupportAdd; + bool m_bSupportSubtract; + +#ifdef DEBUGGER + void DisplaySimpleMuxString(void); +#endif + +}; + +class COGLBlender : public CBlender +{ +public: + void NormalAlphaBlender(void); + void DisableAlphaBlender(void); + void BlendFunc(uint32 srcFunc, uint32 desFunc); + void Enable(); + void Disable(); + +protected: + friend class OGLDeviceBuilder; + COGLBlender(CRender *pRender) : CBlender(pRender), m_pOGLRender((OGLRender*)pRender) {}; + ~COGLBlender() {}; + + OGLRender *m_pOGLRender; +}; + + +#endif + + + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLCombinerNV.cpp b/libmupen64plus/mupen64plus-video-rice/src/OGLCombinerNV.cpp new file mode 100644 index 0000000000..5331ae3aa4 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLCombinerNV.cpp @@ -0,0 +1,1146 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#include "OGLExtensions.h" + +#include "OGLCombinerNV.h" +#include "OGLRender.h" +#include "OGLGraphicsContext.h" + +//======================================================================== +#define MUX_E_F (MUX_PRIMLODFRAC+1) +#define MUX_SPARE1 (MUX_E_F+1) +#define MUX_SECONDARY_COLOR (MUX_SPARE1+1) +#define MUX_NOT_USED MUX_ERR +#define MUX_COMBINED_SIGNED (MUX_SECONDARY_COLOR+1) //Use only by Nvidia register combiner + + +typedef struct { + GLenum input; + GLenum mapping; + GLenum componentUsage; +}RGBMapType; + +RGBMapType RGBmap1[] = +{ + {GL_ZERO, GL_UNSIGNED_IDENTITY_NV, GL_RGB}, //MUX_0 = 0, + {GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_RGB}, //MUX_1, = ZERO NEG + {GL_SPARE0_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB}, //MUX_COMBINED, + {GL_TEXTURE0_ARB, GL_UNSIGNED_IDENTITY_NV, GL_RGB}, //MUX_TEXEL0, + {GL_TEXTURE1_ARB, GL_UNSIGNED_IDENTITY_NV, GL_RGB}, //MUX_TEXEL1, + {GL_CONSTANT_COLOR0_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB}, //MUX_PRIM, + {GL_PRIMARY_COLOR_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB}, //MUX_SHADE, + {GL_CONSTANT_COLOR1_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB}, //MUX_ENV, + {GL_SPARE0_NV, GL_UNSIGNED_IDENTITY_NV, GL_ALPHA}, //MUX_COMBALPHA, + {GL_TEXTURE0_ARB, GL_UNSIGNED_IDENTITY_NV, GL_ALPHA}, //MUX_T0_ALPHA, + {GL_TEXTURE1_ARB, GL_UNSIGNED_IDENTITY_NV, GL_ALPHA}, //MUX_T1_ALPHA, + {GL_CONSTANT_COLOR0_NV, GL_UNSIGNED_IDENTITY_NV, GL_ALPHA}, //MUX_PRIM_ALPHA, + {GL_PRIMARY_COLOR_NV, GL_UNSIGNED_IDENTITY_NV, GL_ALPHA}, //MUX_SHADE_ALPHA, + {GL_CONSTANT_COLOR1_NV, GL_UNSIGNED_IDENTITY_NV, GL_ALPHA}, //MUX_ENV_ALPHA, + {GL_CONSTANT_COLOR1_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB}, //MUX_LODFRAC, + {GL_CONSTANT_COLOR1_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB}, //MUX_PRIMLODFRAC, + {GL_E_TIMES_F_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB}, //MUX_E_F, + {GL_SPARE1_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB}, //MUX_SPARE1, + {GL_SECONDARY_COLOR_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB}, //MUX_SECONDARY_COLOR, + {GL_SPARE0_NV, GL_SIGNED_IDENTITY_NV, GL_RGB}, //MUX_COMBINED_SIGNED, +}; + + +//======================================================================== +COGLColorCombinerNvidia::COGLColorCombinerNvidia(CRender *pRender) : + COGLColorCombiner4(pRender) +{ + m_bNVSupported = false; + delete m_pDecodedMux; + m_pDecodedMux = new COGLDecodedMux; + m_pDecodedMux->m_maxConstants=2; +} + +COGLColorCombinerNvidia::~COGLColorCombinerNvidia() +{ + m_vCompiledSettings.clear(); +} + + +bool COGLColorCombinerNvidia::Initialize(void) +{ + m_bNVSupported = false; + + if( COGLColorCombiner4::Initialize() ) + { + m_bSupportMultiTexture = true; + + COGLGraphicsContext *pcontext = (COGLGraphicsContext *)(CGraphicsContext::g_pGraphicsContext); + if( pcontext->IsExtensionSupported("GL_NV_texture_env_combine4") || pcontext->IsExtensionSupported("GL_NV_register_combiners") ) + { + m_bNVSupported = true; + glEnable(GL_REGISTER_COMBINERS_NV); + return true; + } + else + { + DebugMessage(M64MSG_ERROR, "Your video card does not support Nvidia OpenGL extension combiner"); + glDisable(GL_REGISTER_COMBINERS_NV); + return false; + } + } + + glDisable(GL_REGISTER_COMBINERS_NV); + return false; +} + +void COGLColorCombinerNvidia::InitCombinerCycle12(void) +{ + if( !m_bNVSupported ) {COGLColorCombiner4::InitCombinerCycle12(); return;} + + glEnable(GL_REGISTER_COMBINERS_NV); + +#ifdef DEBUGGER + if( debuggerDropCombiners ) + { + m_vCompiledSettings.clear(); + m_dwLastMux0 = m_dwLastMux1 = 0; + debuggerDropCombiners = false; + } +#endif + + m_pOGLRender->EnableMultiTexture(); + bool combinerIsChanged = false; + + if( m_pDecodedMux->m_dwMux0 != m_dwLastMux0 || m_pDecodedMux->m_dwMux1 != m_dwLastMux1 || m_lastIndex < 0 ) + { + combinerIsChanged = true; + m_lastIndex = FindCompiledMux(); + if( m_lastIndex < 0 ) // Can not found + { + NVRegisterCombinerParserType result; + ParseDecodedMux(result); + m_lastIndex= SaveParserResult(result); + } + + m_dwLastMux0 = m_pDecodedMux->m_dwMux0; + m_dwLastMux1 = m_pDecodedMux->m_dwMux1; + GenerateNVRegisterCombinerSetting(m_lastIndex); + } + + m_pOGLRender->SetAllTexelRepeatFlag(); + + if( m_bCycleChanged || combinerIsChanged || gRDP.texturesAreReloaded || gRDP.colorsAreReloaded ) + { + gRDP.texturesAreReloaded = false; + if( m_bCycleChanged || combinerIsChanged ) + { + GenerateNVRegisterCombinerSettingConstants(m_lastIndex); + GenerateNVRegisterCombinerSetting(m_lastIndex); + ApplyFogAtFinalStage(); + } + else if( gRDP.colorsAreReloaded ) + { + GenerateNVRegisterCombinerSettingConstants(m_lastIndex); + } + + gRDP.colorsAreReloaded = false; + } +} + +void COGLColorCombinerNvidia::ParseDecodedMux(NVRegisterCombinerParserType &result) // Compile the decodedMux into NV register combiner setting +{ + //int stagesForRGB=0; + //int stagesForAlpha=0; + //int stages=0; + + COGLDecodedMux &mux = *(COGLDecodedMux*)m_pDecodedMux; + mux.To_AB_Add_CD_Format(); + + result.stagesUsed=0; + + if( StagesNeedToUse(mux, N64Cycle0RGB) == 0 ) + { + // Nothing to be done for RGB + ByPassGeneralStage(result.s1rgb); + ByPassGeneralStage(result.s2rgb); + ByPassFinalStage(result.finalrgb); + } + else if( StagesNeedToUse(mux, N64Cycle0RGB) == 1 ) + { + result.stagesUsed = 1; + Parse1Mux(mux, N64Cycle0RGB, result.s1rgb); + if( StagesNeedToUse(mux, N64Cycle1RGB) == 0 ) + { + ByPassGeneralStage(result.s2rgb); + ByPassFinalStage(result.finalrgb); + } + else + { + result.stagesUsed = 2; + Parse1MuxForStage2AndFinalStage(mux, N64Cycle1RGB, result.s2rgb, result.finalrgb); + } + } + else + { + result.stagesUsed = 2; + Parse1Mux2Stages(mux, N64Cycle0RGB, result.s1rgb, result.s2rgb); + Parse1MuxForFinalStage(mux, N64Cycle1RGB, result.finalrgb); + } + + // Debug texel1 + /* + if( m_pDecodedMux->m_bTexel0IsUsed && m_pDecodedMux->m_bTexel1IsUsed ) + { + result.finalrgb.a = MUX_TEXEL0; + result.finalrgb.b = MUX_TEXEL1; + result.finalrgb.c = MUX_0; + result.finalrgb.d = MUX_0; + } + */ + + if( StagesNeedToUse(mux, N64Cycle0Alpha) == 0 ) + { + // Nothing to be done for Alpha + ByPassGeneralStage(result.s1alpha); + ByPassGeneralStage(result.s2alpha); + ByPassFinalStage(result.finalalpha); + } + else if( Parse1Mux2Stages(mux, N64Cycle0Alpha, result.s1alpha, result.s2alpha) == 1 ) + { + // Only 1 NV stage is used + if( result.stagesUsed == 0 ) result.stagesUsed = 1; + if( StagesNeedToUse(mux, N64Cycle1Alpha) == 0 ) + { + ByPassGeneralStage(result.s2alpha); + } + else + { + Parse1Mux(mux, N64Cycle1Alpha, result.s2alpha); + result.stagesUsed = 2; + } + } + else + { + // The 1st is used 2 stages, skip the 2nd N64 alpha setting + result.stagesUsed = 2; + result.s2alpha.a=MUX_COMBINED; + result.s2alpha.b=MUX_1; + result.s2alpha.c=m_pDecodedMux->m_n64Combiners[N64Cycle0Alpha].d; + result.s2alpha.d=MUX_1; + } + + // Parse Alpha setting, alpha does not have a final stage + ByPassFinalStage(result.finalalpha); + ParseDecodedMuxForConstant(result); +} + +void COGLColorCombinerNvidia::ParseDecodedMuxForConstant(NVRegisterCombinerParserType &result) +{ + result.constant0 = MUX_0; + result.constant1 = MUX_0; + bool const0Used=false; + bool const1Used=false; + if( m_pDecodedMux->isUsed(MUX_PRIM) ) + { + result.constant0 = MUX_PRIM; + const0Used = true; + } + if( m_pDecodedMux->isUsed(MUX_ENV) ) + { + if( const0Used ) + { + result.constant1 = MUX_ENV; + const1Used = true; + } + else + { + result.constant0 = MUX_ENV; + const0Used = true; + } + } + if( m_pDecodedMux->isUsed(MUX_LODFRAC) && !const1Used ) + { + if( !const1Used ) + { + result.constant1 = MUX_LODFRAC; + const1Used = true; + } + else if( !const0Used ) + { + result.constant0 = MUX_LODFRAC; + const0Used = true; + } + } + + if( m_pDecodedMux->isUsed(MUX_PRIMLODFRAC) && !const1Used ) + { + if( !const1Used ) + { + result.constant1 = MUX_PRIMLODFRAC; + const1Used = true; + } + else if( !const0Used ) + { + result.constant0 = MUX_PRIMLODFRAC; + const0Used = true; + } + } +} + +int COGLColorCombinerNvidia::StagesNeedToUse(COGLDecodedMux &mux, N64StageNumberType stage) +{ + N64CombinerType &m = mux.m_n64Combiners[stage]; + + switch(mux.splitType[stage]) + { + case CM_FMT_TYPE_NOT_USED: + return 0; + case CM_FMT_TYPE_D: // = A ==> can be done in 1 NV stage + case CM_FMT_TYPE_A_ADD_D: // = A+D ==> can be done in 1 NV stage + case CM_FMT_TYPE_A_MOD_C: // = A*C ==> can be done in 1 NV stage + case CM_FMT_TYPE_A_SUB_B: // = A-B ==> can be done in 1 NV stage + case CM_FMT_TYPE_A_MOD_C_ADD_D: // = A*C+D ==> can be done in 1 NV stage + case CM_FMT_TYPE_A_LERP_B_C: // = (A-B)*C+B ==> can be done in 1 NV stage + case CM_FMT_TYPE_A_SUB_B_MOD_C: // = (A-B)*C ==> can be done in 1 NV stage + case CM_FMT_TYPE_AB_ADD_CD: // = AB+CD + case CM_FMT_TYPE_AB_SUB_CD: // = AB-CD + return 1; + case CM_FMT_TYPE_A_SUB_B_ADD_D: // = A-B+D ==> can not be done in 1 stage + if( m.a == m.d ) // = 2A-B, simply it to A-B, in fact,we can do 2A-B with NV register combiner + return 1; + else // Need two NV stages for this N64 combiner + return 2; + case CM_FMT_TYPE_A_B_C_D: // = (A-B)*C+D ==> can not be done in 1 stage + default: + //if( m.a == m.d ) // = (A-B)*C+A = A(C+1)-B*C = A-B*C + // return 1; + //else + if( m.d == m.c ) // = (A-B)*C+C = A*C+(1-B)*C + return 1; + else // = (A-B)*C+D, need two NV stages + return 2; + } +} + +bool isTex(uint8 val) +{ + if( (val&MUX_MASK) == MUX_TEXEL0 || (val&MUX_MASK) == MUX_TEXEL1 ) + return true; + else + return false; +} +int COGLColorCombinerNvidia::Parse1Mux(COGLDecodedMux &mux, N64StageNumberType stage, NVGeneralCombinerType &res) // Compile the decodedMux into NV register combiner setting +{ + // Parse 1 N64 combiner, generate result and return how many NV stage is needed. + // result will be put into only 1 NV stage, not the 2nd one even if 2nd one is needed. + // The caller of this function will handle the 2nd NV stage if it is needed + + + // Up to here, the m_pDecodedMux is already simplied, N64 stage 1 and stage 2 have been + // adjusted so stage1 is almost always complicated than stage 2 + + // The stage type in decodedMux is still in (A-B)*C+D format + // we need to parser and translate it to A*B+C*D format for NV register general combiner + // and to A*D+(1-A)*C+D format for the NV final combiner + + // Remember that N64 has two stages, NV has two general combiner stages and 1 final combiner stage + // NV should be able to simulate exactly all possible N64 combiner settings +/* + CM_FMT_TYPE1_D, // = A ==> can be done in 1 NV stage + CM_FMT_TYPE2_A_ADD_D, // = A+D ==> can be done in 1 NV stage + CM_FMT_TYPE3_A_MOD_C, // = A*C ==> can be done in 1 NV stage + CM_FMT_TYPE4_A_SUB_B, // = A-B ==> can be done in 1 NV stage + CM_FMT_TYPE5_A_MOD_C_ADD_D, // = A*C+D ==> can be done in 1 NV stage + CM_FMT_TYPE6_A_LERP_B_C, // = (A-B)*C+B ==> can be done in 1 NV stage + CM_FMT_TYPE8_A_SUB_B_MOD_C, // = (A-B)*C ==> can be done in 1 NV stage + + CM_FMT_TYPE7_A_SUB_B_ADD_D, // = A-B+C ==> can not be done in 1 stage + CM_FMT_TYPE9_A_B_C_D, // = (A-B)*C+D ==> can not be done in 1 stage + + the last two ones, since we can neither do it in the final stage, if the 1st N64 stage + happen to be one of the two types and have used the two NV general combiners, and if the 2nd N64 + combiner happens to be one of the two types as well, then we have to simplify the N64 combiner so + to implement it. In such as case, the N64 combiners are too complicated, we just do what either as + we can to implement it. + + Use UNSIGNED_INVERT of ZERO ==> ONE + + // If the 1st N64 stage can not be done in 1 NV stage, then we will do 1st N64 stage + // by using 2 NV general combiner stages, and the 2nd N64 stage by using the NV final + // combiner stage. + + // RGB channel and alpha channel is the same in the general combiner, but different in + // the final combiner. In fact, final combiner does not do anything for alpha channel + // so alpha channel setting of both N64 combiner must be implemented by the two NV general + // combiner + + If we can not implement the two alpha setting in 2 NV combiner stages, we will do what either + as we can. + + */ + N64CombinerType &m = mux.m_n64Combiners[stage]; + + switch(mux.splitType[stage]) + { + case CM_FMT_TYPE_NOT_USED: + res.a=MUX_0; + res.b=MUX_0; + res.c=MUX_0; + res.d=MUX_0; + return 0; + break; + case CM_FMT_TYPE_D: // = A ==> can be done in 1 NV stage + res.a=m.d; + res.b=MUX_1; + res.c=MUX_0; + res.d=MUX_0; + return 1; + break; + case CM_FMT_TYPE_A_ADD_D: // = A+D ==> can be done in 1 NV stage + res.a=m.a; + res.b=MUX_1; + res.c=m.d; + res.d=MUX_1; + return 1; + break; + case CM_FMT_TYPE_A_MOD_C: // = A*C ==> can be done in 1 NV stage + res.a=m.a; + res.b=m.c; + res.c=MUX_0; + res.d=MUX_0; + return 1; + break; + case CM_FMT_TYPE_A_SUB_B: // = A-B ==> can be done in 1 NV stage + res.a=m.a; + res.b=MUX_1; + res.c=m.b|MUX_NEG; + res.d=MUX_1; + return 1; + break; + case CM_FMT_TYPE_A_MOD_C_ADD_D: // = A*C+D ==> can be done in 1 NV stage + res.a=m.a; + res.b=m.c; + res.c=m.d; + res.d=MUX_1; + return 1; + break; + case CM_FMT_TYPE_A_LERP_B_C: // = (A-B)*C+B ==> can be done in 1 NV stage + // = AC+(1-C)B + res.a=m.a; + res.b=m.c; + res.c=m.c^MUX_COMPLEMENT; + res.d=m.b; + return 1; + break; + case CM_FMT_TYPE_A_SUB_B_MOD_C: // = (A-B)*C ==> can be done in 1 NV stage + res.a=m.a; + res.b=m.c; + res.c=m.b|MUX_NEG; + res.d=m.c; + return 1; + break; + case CM_FMT_TYPE_AB_ADD_CD: // = AB+CD + res.a = m.a; + res.b = m.b; + res.c = m.c; + res.d = m.d; + return 1; + break; + case CM_FMT_TYPE_AB_SUB_CD: // = AB-CD + res.a = m.a; + res.b = m.b; + res.c = m.c|MUX_NEG; + res.d = m.d; + return 1; + break; + case CM_FMT_TYPE_A_SUB_B_ADD_D: // = A-B+D ==> can not be done in 1 stage + if( m.a == m.d ) // = 2A-B, simply it to A-B, in fact,we can do 2A-B with NV register combiner + { + res.a=m.a; + res.b=MUX_1; + res.c=m.b|MUX_NEG; + res.d=MUX_1; + return 1; + } + else // Need two NV stages for this N64 combiner + { + // Stage 1: R1=A-B + res.a=m.a; + res.b=MUX_1; + + if( isTex(res.b) || !isTex(res.d) ) + { + res.c=m.b|MUX_NEG; + res.d=MUX_1; + } + else + { + res.c=m.d; + res.d=MUX_1; + } + return 2; + } + break; + case CM_FMT_TYPE_A_B_C_D: // = (A-B)*C+D ==> can not be done in 1 stage + default: + if( m.a == m.d ) // = (A-B)*C+A = A(C+1)-B*C = A-B*C + { + res.a=m.a; + res.b=m.c; + res.c=m.b|MUX_NEG; + res.d=m.c; + return 1; + } + else if( m.d == m.c ) // = (A-B)*C+C = A*C+(1-B)*C + { + res.a=m.a; + res.b=m.c; + res.c=m.b^MUX_COMPLEMENT; + res.d=m.c; + return 1; + } + else // = (A-B)*C+D, need two NV stages + { + // Stage 1: R1=(A-B)*C = AC-BC + if( isTex(m.d) ) + { + // = A*C+D + res.a=m.a; + res.b=m.c; + res.c=m.d; + res.d=MUX_1; + } + else + { + // = (A-B)*C = A*C - B*C + res.a=m.a; + res.b=m.c; + res.c=m.b|MUX_NEG; + res.d=m.c; + } + return 2; + } + break; + } +} + +int COGLColorCombinerNvidia::Parse1Mux2Stages(COGLDecodedMux &mux, N64StageNumberType stage, NVGeneralCombinerType &res, NVGeneralCombinerType &res2) +{ + N64CombinerType &m = mux.m_n64Combiners[stage]; + switch(mux.splitType[stage]) + { + case CM_FMT_TYPE_A_SUB_B_ADD_D: // = A-B+D ==> can not be done in 1 stage + if( m.a != m.d ) // = 2A-B, simply it to A-B, in fact,we can do 2A-B with NV register combiner + { + // Stage 1: R1=A-B + res.a=m.a; + res.b=MUX_1; + res.c=m.b|MUX_NEG; + res.d=MUX_1; + + res2.a=MUX_COMBINED_SIGNED; + res2.b=MUX_1; + res2.c=m.d; + res2.d=MUX_1; + + return 2; + } + break; + case CM_FMT_TYPE_A_B_C_D: // = (A-B)*C+D ==> can not be done in 1 stage + case CM_FMT_TYPE_A_B_C_A: // = (A-B)*C+D ==> can not be done in 1 stage + //if( m.a != m.d && m.d != m.c ) + { + // Stage 1: R1=(A-B)*C = AC-BC + res.a=m.a; + res.b=m.c; + res.c=m.b|MUX_NEG; + res.d=m.c; + + res2.a=MUX_COMBINED_SIGNED; + res2.b=MUX_1; + res2.c=m.d; + res2.d=MUX_1; + + return 2; + } + break; + default: + break; + } + return Parse1Mux(mux, stage, res); +} + + +void COGLColorCombinerNvidia::Parse1MuxForFinalStage(COGLDecodedMux &mux, N64StageNumberType stage, NVFinalCombinerType &res) +{ + N64CombinerType &m = mux.m_n64Combiners[stage]; + + // Final stage equation is: AB+(1-A)C+D + switch(mux.splitType[stage]) + { + case CM_FMT_TYPE_NOT_USED: + res.a=MUX_0; + res.b=MUX_0; + res.c=MUX_0; + res.d=MUX_0; + break; + case CM_FMT_TYPE_D: // = A ==> can be done in 1 NV stage + res.a=m.a; + res.b=MUX_1; + res.c=MUX_0; + res.d=MUX_0; + break; + case CM_FMT_TYPE_A_ADD_D: // = A+D ==> can be done in 1 NV stage + res.a=m.a; + res.b=MUX_1; + res.c=MUX_0; + res.d=m.d; + break; + case CM_FMT_TYPE_A_MOD_C: // = A*C ==> can be done in 1 NV stage + res.a=m.a; + res.b=m.c; + res.c=MUX_0; + res.d=MUX_0; + break; + case CM_FMT_TYPE_A_SUB_B: // = A-B ==> can be done in 1 NV stage + res.a=m.a; + res.b=MUX_1; + res.c=MUX_0; + res.d=m.b|MUX_NEG; + break; + case CM_FMT_TYPE_A_MOD_C_ADD_D: // = A*C+D ==> can be done in 1 NV stage + res.a=m.a; + res.b=m.c; + res.c=MUX_0; + res.d=m.d; + break; + case CM_FMT_TYPE_A_LERP_B_C: // = (A-B)*C+B ==> can be done in 1 NV stage + // = AC+(1-B)C + res.a = m.c; + res.b = MUX_0; + res.c = m.b; + res.d = MUX_E_F; + res.e = m.a; + res.f = m.c; + break; + case CM_FMT_TYPE_A_SUB_B_MOD_C: // = (A-B)*C ==> can be done in 1 NV stage + res.a=m.c; + res.b=m.a; + res.c=m.b; + res.d=m.b|MUX_NEG; + break; + case CM_FMT_TYPE_AB_ADD_CD: // = AB+CD + res.a = m.a; + res.b = m.b; + res.e = m.c; + res.f = m.d; + res.c = MUX_0; + res.d = MUX_E_F; + break; + case CM_FMT_TYPE_AB_SUB_CD: // = AB-CD + res.a = m.a; + res.b = m.b; + res.e = m.c|MUX_NEG; + res.f = m.d; + res.c = MUX_0; + res.d = MUX_E_F; + break; + case CM_FMT_TYPE_A_SUB_B_ADD_D: // = A-B+D ==> can not be done in 1 stage + if( m.a == m.d ) // = 2A-B, simply it to A-B, in fact,we can do 2A-B with NV register combiner + { + res.a=m.a; + res.b=MUX_1; + res.c=MUX_0; + res.d=m.b|MUX_NEG; + } + else // Need two NV stages for this N64 combiner + { + TRACE0("NV Combiner parse, check me, not fully support this combiner"); + // final combiner can not fully support this combiner setting + // Stage 1: R1=A-B + res.a=m.a; + res.b=MUX_1; + res.c=MUX_0; + res.d=m.b|MUX_NEG; + } + break; + case CM_FMT_TYPE_A_B_C_D: // = (A-B)*C+D ==> can not be done in 1 stage + default: + if( m.a == m.d ) // = (A-B)*C+A = A(C+1)-B*C = A-B*C + { + /* + res.a=m.c; + res.b=m.b|MUX_NEG; + res.c=MUX_0; + res.d=m.a; + */ + res.a=m.c; + res.b=m.a; + res.c=m.b; + res.d=MUX_0; + } + else if( m.d == m.c ) // = (A-B)*C+C = A*C+(1-B)*C + { + res.a=m.b; + res.b=MUX_0; + res.c=m.c; + res.d=MUX_E_F; + res.e=m.a; + res.f=m.c; + } + else // = (A-B)*C+D, need two NV stages + { + TRACE0("NV Combiner parse, check me, not fully support this combiner"); + // final combiner can not fully support this combiner setting + // Stage 1: R1=(A-B)*C = AC-BC + res.a=m.c; + res.b=m.a; + res.c=m.b; + res.d=m.b|MUX_NEG; + } + break; + } + res.g=MUX_COMBINED; +} + +int COGLColorCombinerNvidia::Parse1MuxForStage2AndFinalStage(COGLDecodedMux &mux, N64StageNumberType stage, NVGeneralCombinerType &res, NVFinalCombinerType &fres) +{ + if( Parse1Mux(mux, stage, res) == 1 ) + { + ByPassFinalStage(fres); + return 1; + } + else + { + ByPassFinalStage(fres); + fres.a=MUX_COMBINED; + fres.b=MUX_1; + fres.d = mux.m_n64Combiners[stage].d; + fres.g=MUX_COMBINED; + return 2; + } +} + +void COGLColorCombinerNvidia::ByPassFinalStage(NVFinalCombinerType &fres) +{ + fres.a=MUX_0; + fres.b=MUX_0; + fres.c=MUX_0; + fres.d=MUX_COMBINED; + fres.e=MUX_0; + fres.f=MUX_0; + fres.g=MUX_COMBINED; +} + +void COGLColorCombinerNvidia::ByPassGeneralStage(NVGeneralCombinerType &res) +{ + res.a=MUX_1; + res.b=MUX_COMBINED; + res.c=MUX_0; + res.d=MUX_0; +} + +int COGLColorCombinerNvidia::FindCompiledMux(void) +{ + for( uint32 i=0; im_dwMux0 && m_vCompiledSettings[i].dwMux1 == m_pDecodedMux->m_dwMux1 ) + return i; + } + + return -1; +} +void COGLColorCombinerNvidia::GenerateNVRegisterCombinerSettingConstants(int index) +{ + NVRegisterCombinerSettingType &info = m_vCompiledSettings[index]; + uint8 consts[2] = {info.constant0,info.constant1}; + + float *pf; + + for( int i=0; i<2; i++ ) + { + switch( consts[i] ) + { + case MUX_PRIM: + pf = GetPrimitiveColorfv(); + pglCombinerParameterfvNV(GL_CONSTANT_COLOR0_NV+i,pf); + break; + case MUX_ENV: + pf = GetEnvColorfv(); + pglCombinerParameterfvNV(GL_CONSTANT_COLOR0_NV+i,pf); + break; + case MUX_LODFRAC: + case MUX_PRIMLODFRAC: + { + float frac = gRDP.primLODFrac / 255.0f; + float tempf[4] = {frac,frac,frac,frac}; + pglCombinerParameterfvNV(GL_CONSTANT_COLOR0_NV+i,tempf); + break; + } + } + } +} + +void COGLColorCombinerNvidia::GenerateNVRegisterCombinerSetting(int index) +{ + if( index < 0 || index >= (int)m_vCompiledSettings.size() ) + { + TRACE0("NV Register combiner, vector index out of range"); + return; + } + + NVRegisterCombinerSettingType &info = m_vCompiledSettings[index]; + + pglCombinerParameteriNV(GL_NUM_GENERAL_COMBINERS_NV,info.numOfStages); + + uint32 i; + + if( info.numOfStages > 0 ) + { + for( i=0; i<4; i++ ) + { + pglCombinerInputNV(GL_COMBINER0_NV, GL_RGB, info.stage1RGB[i].variable, info.stage1RGB[i].input, + info.stage1RGB[i].mapping, info.stage1RGB[i].componentUsage ); + } + + for( i=0; i<4; i++ ) + { + pglCombinerInputNV(GL_COMBINER0_NV, GL_ALPHA, info.stage1Alpha[i].variable, info.stage1Alpha[i].input, + info.stage1Alpha[i].mapping, info.stage1Alpha[i].componentUsage ); + } + + pglCombinerOutputNV(GL_COMBINER0_NV, GL_RGB, info.stage1outputRGB.abOutput, info.stage1outputRGB.cdOutput, + info.stage1outputRGB.sumOutput, info.stage1outputRGB.scale, info.stage1outputRGB.bias, info.stage1outputRGB.abDotProduct, + info.stage1outputRGB.cdDotProduct, info.stage1outputRGB.muxSum); + + pglCombinerOutputNV(GL_COMBINER0_NV, GL_ALPHA, info.stage2outputAlpha.abOutput, info.stage2outputAlpha.cdOutput, + info.stage2outputAlpha.sumOutput, info.stage2outputAlpha.scale, info.stage2outputAlpha.bias, info.stage2outputAlpha.abDotProduct, + info.stage2outputAlpha.cdDotProduct, info.stage2outputAlpha.muxSum); + + if( info.numOfStages > 1 ) + { + for( i=0; i<4; i++ ) + { + pglCombinerInputNV(GL_COMBINER1_NV, GL_RGB, info.stage2RGB[i].variable, + info.stage2RGB[i].input, info.stage2RGB[i].mapping, info.stage2RGB[i].componentUsage ); + } + + for( i=0; i<4; i++ ) + { + pglCombinerInputNV(GL_COMBINER1_NV, GL_ALPHA, info.stage2Alpha[i].variable, info.stage2Alpha[i].input, + info.stage2Alpha[i].mapping, info.stage2Alpha[i].componentUsage ); + } + + pglCombinerOutputNV(GL_COMBINER1_NV, GL_RGB, info.stage2outputRGB.abOutput, info.stage2outputRGB.cdOutput, + info.stage2outputRGB.sumOutput, info.stage2outputRGB.scale, info.stage2outputRGB.bias, info.stage2outputRGB.abDotProduct, + info.stage2outputRGB.cdDotProduct, info.stage2outputRGB.muxSum); + + pglCombinerOutputNV(GL_COMBINER1_NV, GL_ALPHA, info.stage2outputAlpha.abOutput, info.stage2outputAlpha.cdOutput, + info.stage2outputAlpha.sumOutput, info.stage2outputAlpha.scale, info.stage2outputAlpha.bias, info.stage2outputAlpha.abDotProduct, + info.stage2outputAlpha.cdDotProduct, info.stage2outputAlpha.muxSum); + } + } + + for( i=0; i<7; i++ ) + { + pglFinalCombinerInputNV(info.finalStage[i].variable, info.finalStage[i].input, + info.finalStage[i].mapping, info.finalStage[i].componentUsage ); + } +} + +GLenum COGLColorCombinerNvidia::ConstMap(uint8 c) +{ + switch(c) + { + case MUX_0: + return GL_ZERO; + case MUX_1: + return GL_ZERO; + case MUX_COMBINED: + case MUX_TEXEL0: + case MUX_TEXEL1: + case MUX_PRIM: + case MUX_SHADE: + case MUX_ENV: + case MUX_COMBALPHA: + case MUX_T0_ALPHA: + case MUX_T1_ALPHA: + case MUX_PRIM_ALPHA: + case MUX_SHADE_ALPHA: + case MUX_ENV_ALPHA: + case MUX_LODFRAC: + case MUX_PRIMLODFRAC: + break; + } + return GL_ZERO; + +} + +void Set1Variable(GLenum variable, uint8 val, NVCombinerInputType &record, const NVRegisterCombinerParserType &result, bool forRGB=true) +{ + record.variable = variable; + record.componentUsage = RGBmap1[val&MUX_MASK].componentUsage; + record.input = RGBmap1[val&MUX_MASK].input; + record.mapping = RGBmap1[val&MUX_MASK].mapping; + + switch( val&MUX_MASK ) + { + case MUX_PRIM: + case MUX_ENV: + case MUX_PRIMLODFRAC: + case MUX_LODFRAC: + if( (val&MUX_MASK) == result.constant0 ) + { + record.input = GL_CONSTANT_COLOR0_NV; + } + else if( (val&MUX_MASK) == result.constant1 ) + { + record.input = GL_CONSTANT_COLOR1_NV; + } + else + { + record.input = GL_ZERO; + } + break; + } + + if( val&MUX_NEG ) + { + record.mapping = GL_SIGNED_NEGATE_NV; + } + else if( val == MUX_1 ) + { + record.mapping = GL_UNSIGNED_INVERT_NV; + } + else if( val & MUX_COMPLEMENT ) + { + record.mapping = GL_UNSIGNED_INVERT_NV; + } + + if( val & MUX_ALPHAREPLICATE || !forRGB ) + { + record.componentUsage = GL_ALPHA; + } +} + +int COGLColorCombinerNvidia::SaveParserResult(const NVRegisterCombinerParserType &result) +{ + NVRegisterCombinerSettingType save; + + // Stage 1 RGB + Set1Variable(GL_VARIABLE_A_NV, result.s1rgb.a, save.stage1RGB[0], result); + Set1Variable(GL_VARIABLE_B_NV, result.s1rgb.b, save.stage1RGB[1], result); + Set1Variable(GL_VARIABLE_C_NV, result.s1rgb.c, save.stage1RGB[2], result); + Set1Variable(GL_VARIABLE_D_NV, result.s1rgb.d, save.stage1RGB[3], result); + + // Stage 1 Alpha + Set1Variable(GL_VARIABLE_A_NV, result.s1alpha.a, save.stage1Alpha[0], result, false); + Set1Variable(GL_VARIABLE_B_NV, result.s1alpha.b, save.stage1Alpha[1], result, false); + Set1Variable(GL_VARIABLE_C_NV, result.s1alpha.c, save.stage1Alpha[2], result, false); + Set1Variable(GL_VARIABLE_D_NV, result.s1alpha.d, save.stage1Alpha[3], result, false); + + // Stage 2 RGB + Set1Variable(GL_VARIABLE_A_NV, result.s2rgb.a, save.stage2RGB[0], result); + Set1Variable(GL_VARIABLE_B_NV, result.s2rgb.b, save.stage2RGB[1], result); + Set1Variable(GL_VARIABLE_C_NV, result.s2rgb.c, save.stage2RGB[2], result); + Set1Variable(GL_VARIABLE_D_NV, result.s2rgb.d, save.stage2RGB[3], result); + + // Stage 2 Alpha + Set1Variable(GL_VARIABLE_A_NV, result.s2alpha.a, save.stage2Alpha[0], result, false); + Set1Variable(GL_VARIABLE_B_NV, result.s2alpha.b, save.stage2Alpha[1], result, false); + Set1Variable(GL_VARIABLE_C_NV, result.s2alpha.c, save.stage2Alpha[2], result, false); + Set1Variable(GL_VARIABLE_D_NV, result.s2alpha.d, save.stage2Alpha[3], result, false); + + // Final Stage RGB + Set1Variable(GL_VARIABLE_A_NV, result.finalrgb.a, save.finalStage[0], result); + Set1Variable(GL_VARIABLE_B_NV, result.finalrgb.b, save.finalStage[1], result); + Set1Variable(GL_VARIABLE_C_NV, result.finalrgb.c, save.finalStage[2], result); + Set1Variable(GL_VARIABLE_D_NV, result.finalrgb.d, save.finalStage[3], result); + Set1Variable(GL_VARIABLE_E_NV, result.finalrgb.e, save.finalStage[4], result); + //save.finalStage[4].componentUsage = GL_ALPHA; + Set1Variable(GL_VARIABLE_F_NV, result.finalrgb.f, save.finalStage[5], result); + //save.finalStage[5].componentUsage = GL_ALPHA; + Set1Variable(GL_VARIABLE_G_NV, result.finalrgb.g, save.finalStage[6], result); + save.finalStage[6].componentUsage = GL_ALPHA; + + save.numOfStages = result.stagesUsed; + save.dwMux0 = m_pDecodedMux->m_dwMux0; + save.dwMux1 = m_pDecodedMux->m_dwMux1; + + save.stage1outputRGB.scale = GL_NONE; + save.stage1outputRGB.sumOutput = GL_SPARE0_NV; + save.stage1outputRGB.abDotProduct = GL_FALSE; + save.stage1outputRGB.cdDotProduct = GL_FALSE; + save.stage1outputRGB.abOutput = GL_SPARE1_NV; + save.stage1outputRGB.cdOutput = GL_SECONDARY_COLOR_NV; + save.stage1outputRGB.bias = GL_NONE; + save.stage1outputRGB.muxSum = GL_FALSE; + + save.stage1outputAlpha.scale = GL_NONE; + save.stage1outputAlpha.sumOutput = GL_SPARE0_NV; + save.stage1outputAlpha.abDotProduct = GL_FALSE; + save.stage1outputAlpha.cdDotProduct = GL_FALSE; + save.stage1outputAlpha.abOutput = GL_SPARE1_NV; + save.stage1outputAlpha.cdOutput = GL_SECONDARY_COLOR_NV; + save.stage1outputAlpha.bias = GL_NONE; + save.stage1outputAlpha.muxSum = GL_FALSE; + + save.stage2outputRGB.scale = GL_NONE; + save.stage2outputRGB.sumOutput = GL_SPARE0_NV; + save.stage2outputRGB.abDotProduct = GL_FALSE; + save.stage2outputRGB.cdDotProduct = GL_FALSE; + save.stage2outputRGB.abOutput = GL_SPARE1_NV; + save.stage2outputRGB.cdOutput = GL_SECONDARY_COLOR_NV; + save.stage2outputRGB.bias = GL_NONE; + save.stage2outputRGB.muxSum = GL_FALSE; + + save.stage2outputAlpha.scale = GL_NONE; + save.stage2outputAlpha.sumOutput = GL_SPARE0_NV; + save.stage2outputAlpha.abDotProduct = GL_FALSE; + save.stage2outputAlpha.cdDotProduct = GL_FALSE; + save.stage2outputAlpha.abOutput = GL_SPARE1_NV; + save.stage2outputAlpha.cdOutput = GL_SECONDARY_COLOR_NV; + save.stage2outputAlpha.bias = GL_NONE; + save.stage2outputAlpha.muxSum = GL_FALSE; + + save.constant0 = result.constant0; + save.constant1 = result.constant1; + +#ifdef DEBUGGER + memcpy(&(save.parseResult),&result, sizeof(result)); + if( logCombiners ) + { + TRACE0("\nNew Mux:\n"); + DisplayMuxString(); + COGLColorCombiner::DisplaySimpleMuxString(); + DisplayNVCombinerString(save); + } +#endif + + m_vCompiledSettings.push_back(save); + + return m_vCompiledSettings.size()-1; // Return the index of the last element +} + + +void COGLColorCombinerNvidia::DisableCombiner(void) +{ + glDisable(GL_REGISTER_COMBINERS_NV); + COGLColorCombiner4::DisableCombiner(); +} + +void COGLColorCombinerNvidia::InitCombinerCycleCopy(void) +{ + glDisable(GL_REGISTER_COMBINERS_NV); + COGLColorCombiner4::InitCombinerCycleCopy(); +} + +void COGLColorCombinerNvidia::InitCombinerCycleFill(void) +{ + glDisable(GL_REGISTER_COMBINERS_NV); + COGLColorCombiner4::InitCombinerCycleFill(); +} + +void COGLColorCombinerNvidia::InitCombinerBlenderForSimpleTextureDraw(uint32 tile) +{ + glDisable(GL_REGISTER_COMBINERS_NV); + COGLColorCombiner::InitCombinerBlenderForSimpleTextureDraw(tile); +} + +void COGLColorCombinerNvidia::ApplyFogAtFinalStage() +{ + // If we need to enable fog at final stage, the current flag stage setting + // will be affect, which means correct combiner setting at final stage is lost + // in order to use fog + if( glIsEnabled(GL_FOG) ) + { + // Use final stage as: cmb*fogfactor+fog*(1-fogfactor) + pglFinalCombinerInputNV(GL_VARIABLE_A_NV, GL_FOG, GL_UNSIGNED_IDENTITY_NV, GL_ALPHA ); + pglFinalCombinerInputNV(GL_VARIABLE_B_NV, GL_SPARE0_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB ); + pglFinalCombinerInputNV(GL_VARIABLE_C_NV, GL_FOG, GL_UNSIGNED_IDENTITY_NV, GL_RGB ); + pglFinalCombinerInputNV(GL_VARIABLE_D_NV, GL_ZERO, GL_UNSIGNED_IDENTITY_NV, GL_RGB ); + } +} + +#ifdef DEBUGGER +extern const char *translatedCombTypes[]; +void COGLColorCombinerNvidia::DisplaySimpleMuxString(void) +{ + COGLColorCombiner::DisplaySimpleMuxString(); + TRACE0("\nNV Combiner setting\n"); + uint32 index = FindCompiledMux(); + if( index >= 0 ) + { + NVRegisterCombinerSettingType &record = m_vCompiledSettings[index]; + DisplayNVCombinerString(record); + } +} + +char* FormatStrForFinalStage(uint8 val, char* buf) +{ + if( (val&MUX_MASK) == MUX_E_F ) + { + strcpy(buf, "E_F"); + return buf; + } + else + return DecodedMux::FormatStr(val, buf); +} + +void COGLColorCombinerNvidia::DisplayNVCombinerString(NVRegisterCombinerSettingType &record) +{ + NVRegisterCombinerParserType &result = record.parseResult; + + char buf[2000]; + char buf0[30]; + char buf1[30]; + char buf2[30]; + char buf3[30]; + char buf4[30]; + char buf5[30]; + char buf6[30]; + buf[0]='\0'; + + TRACE0("\n\n"); + TRACE0("\nNvidia combiner stages:\n"); + + DebuggerAppendMsg("//aRGB0:\t%s * %s + %s * %s\n", DecodedMux::FormatStr(result.s1rgb.a, buf0), + DecodedMux::FormatStr(result.s1rgb.b, buf1), DecodedMux::FormatStr(result.s1rgb.c, buf2),DecodedMux::FormatStr(result.s1rgb.d, buf3)); + DebuggerAppendMsg("//aA0:\t%s * %s + %s * %s\n", DecodedMux::FormatStr(result.s1alpha.a, buf0), + DecodedMux::FormatStr(result.s1alpha.b, buf1), DecodedMux::FormatStr(result.s1alpha.c, buf2),DecodedMux::FormatStr(result.s1alpha.d, buf3)); + if( record.numOfStages == 2 ) + { + DebuggerAppendMsg("//aRGB1:\t%s * %s + %s * %s\n", DecodedMux::FormatStr(result.s2rgb.a, buf0), + DecodedMux::FormatStr(result.s2rgb.b, buf1), DecodedMux::FormatStr(result.s2rgb.c, buf2),DecodedMux::FormatStr(result.s2rgb.d, buf3)); + DebuggerAppendMsg("//aA1:\t%s * %s + %s * %s\n", DecodedMux::FormatStr(result.s2alpha.a, buf0), + DecodedMux::FormatStr(result.s2alpha.b, buf1), DecodedMux::FormatStr(result.s2alpha.c, buf2),DecodedMux::FormatStr(result.s2alpha.d, buf3)); + } + DebuggerAppendMsg("//Final:\t%s * %s + (1 - %s) * %s + %s\n\tE=%s, F=%s\n", FormatStrForFinalStage(result.finalrgb.a, buf0), + FormatStrForFinalStage(result.finalrgb.b, buf1), FormatStrForFinalStage(result.finalrgb.a, buf2), + FormatStrForFinalStage(result.finalrgb.c, buf3), FormatStrForFinalStage(result.finalrgb.d, buf4), + FormatStrForFinalStage(result.finalrgb.e, buf5), FormatStrForFinalStage(result.finalrgb.f, buf6)); + + if( result.constant0 != MUX_0 ) + { + DebuggerAppendMsg("//Constant 0:\t%s\n", DecodedMux::FormatStr(result.constant0, buf0)); + } + if( result.constant1 != MUX_0 ) + { + DebuggerAppendMsg("//Constant 1:\t%s\n", DecodedMux::FormatStr(result.constant1, buf0)); + } + TRACE0("\n\n"); +} + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLCombinerNV.h b/libmupen64plus/mupen64plus-video-rice/src/OGLCombinerNV.h new file mode 100644 index 0000000000..b9ee16d3b3 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLCombinerNV.h @@ -0,0 +1,158 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#ifndef _OGL_COMBINER_NV_H_ +#define _OGL_COMBINER_NV_H_ + +#include + +#include + +#include "OGLExtCombiner.h" +#include "OGLDecodedMux.h" + +typedef struct { + uint8 a; + uint8 b; + uint8 c; + uint8 d; +} NVGeneralCombinerType; + +typedef struct { + uint8 a; + uint8 b; + uint8 c; + uint8 d; + uint8 e; + uint8 f; + uint8 g; +} NVFinalCombinerType; + +typedef struct { + GLenum variable; + GLenum input; + GLenum mapping; + GLenum componentUsage; +} NVCombinerInputType; + +typedef struct { + GLenum abOutput; + GLenum cdOutput; + GLenum sumOutput; + GLenum scale; + GLenum bias; + GLboolean abDotProduct; + GLboolean cdDotProduct; + GLboolean muxSum; +} NVCombinerOutputType; + + +typedef struct { + union { + struct { + NVGeneralCombinerType s1rgb; + NVGeneralCombinerType s1alpha; + NVGeneralCombinerType s2rgb; + NVGeneralCombinerType s2alpha; + NVFinalCombinerType finalrgb; + NVFinalCombinerType finalalpha; + }; + struct { + NVGeneralCombinerType generalCombiners[4]; + NVFinalCombinerType finalCombiners[2]; + }; + }; + int stagesUsed; + uint8 constant0; + uint8 constant1; +} NVRegisterCombinerParserType; + +typedef struct { + NVCombinerInputType stage1RGB[4]; + NVCombinerInputType stage1Alpha[4]; + NVCombinerOutputType stage1outputRGB; + NVCombinerOutputType stage1outputAlpha; + + NVCombinerInputType stage2RGB[4]; + NVCombinerInputType stage2Alpha[4]; + NVCombinerOutputType stage2outputRGB; + NVCombinerOutputType stage2outputAlpha; + + NVCombinerInputType finalStage[7]; + + int numOfStages; + + uint32 dwMux0; + uint32 dwMux1; + + uint8 constant0; + uint8 constant1; +#ifdef DEBUGGER + NVRegisterCombinerParserType parseResult; +#endif +} NVRegisterCombinerSettingType; + +class COGLColorCombinerNvidia : public COGLColorCombiner4 +{ +public: + bool Initialize(void); + void InitCombinerBlenderForSimpleTextureDraw(uint32 tile=0); +protected: + friend class OGLDeviceBuilder; + + void InitCombinerCycle12(void); + void DisableCombiner(void); + void InitCombinerCycleCopy(void); + void InitCombinerCycleFill(void); + + + int FindCompiledMux(void); + void GenerateNVRegisterCombinerSetting(int); + void GenerateNVRegisterCombinerSettingConstants(int); // Compile the decodedMux into NV register combiner setting + void ApplyFogAtFinalStage(); + + void ParseDecodedMux(NVRegisterCombinerParserType &result); // Compile the decodedMux into NV register combiner setting + void ParseDecodedMuxForConstant(NVRegisterCombinerParserType &result); // Compile the decodedMux into NV register combiner setting + int SaveParserResult(const NVRegisterCombinerParserType &result); + + int StagesNeedToUse(COGLDecodedMux &mux, N64StageNumberType stage); + int Parse1Mux(COGLDecodedMux &mux, N64StageNumberType stage, NVGeneralCombinerType &res); // Compile the decodedMux into NV register combiner setting + int Parse1Mux2Stages(COGLDecodedMux &mux, N64StageNumberType stage, NVGeneralCombinerType &res, NVGeneralCombinerType &res2); + int Parse1MuxForStage2AndFinalStage(COGLDecodedMux &mux, N64StageNumberType stage, NVGeneralCombinerType &res, NVFinalCombinerType &fres); + void Parse1MuxForFinalStage(COGLDecodedMux &mux, N64StageNumberType stage, NVFinalCombinerType &fres); + void ByPassFinalStage(NVFinalCombinerType &fres); + void ByPassGeneralStage(NVGeneralCombinerType &res); + + GLenum ConstMap(uint8 c); + + COGLColorCombinerNvidia(CRender *pRender); + ~COGLColorCombinerNvidia(); + + std::vector m_vCompiledSettings; + + bool m_bNVSupported; // Is this NV OGL extension combiner supported by the video card driver? + +#ifdef DEBUGGER + void DisplaySimpleMuxString(void); + void DisplayNVCombinerString(NVRegisterCombinerSettingType &record); +#endif + +}; + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLCombinerTNT2.cpp b/libmupen64plus/mupen64plus-video-rice/src/OGLCombinerTNT2.cpp new file mode 100644 index 0000000000..03c6c45df3 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLCombinerTNT2.cpp @@ -0,0 +1,332 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#include "OGLExtensions.h" + +#include "OGLCombinerTNT2.h" +#include "OGLRender.h" +#include "OGLGraphicsContext.h" +#include "OGLTexture.h" + +//======================================================================== +COGLColorCombinerTNT2::COGLColorCombinerTNT2(CRender *pRender) +:COGLColorCombiner4(pRender) +{ + m_bTNT2Supported=false; + delete m_pDecodedMux; + m_pDecodedMux = new COGLDecodedMux; + m_ppDecodedMux = &m_pDecodedMux; +} + + +bool COGLColorCombinerTNT2::Initialize(void) +{ + m_bTNT2Supported = false; + + if( COGLColorCombiner4::Initialize() ) + { + m_bSupportMultiTexture = true; + COGLGraphicsContext *pcontext = (COGLGraphicsContext *)(CGraphicsContext::g_pGraphicsContext); + if( pcontext->IsExtensionSupported("GL_NV_texture_env_combine4") ) + { + m_bTNT2Supported = true; + } + else + { + DebugMessage(M64MSG_ERROR, "Your video card does not support OpenGL TNT2 extension combiner, you can only use the OpenGL Ext combiner functions"); + } + return true; + } + return false; +} + +//======================================================================== + +void COGLColorCombinerTNT2::InitCombinerCycle12(void) +{ + if( !m_bOGLExtCombinerSupported ) { COGLColorCombiner4::InitCombinerCycle12(); return;} + +#ifdef DEBUGGER + if( debuggerDropCombiners ) + { + m_vCompiledTNTSettings.clear(); + m_dwLastMux0 = m_dwLastMux1 = 0; + debuggerDropCombiners = false; + } +#endif + + m_pOGLRender->EnableMultiTexture(); + + bool combinerIsChanged = false; + + if( m_pDecodedMux->m_dwMux0 != m_dwLastMux0 || m_pDecodedMux->m_dwMux1 != m_dwLastMux1 || m_lastIndex < 0 ) + { + combinerIsChanged = true; + m_lastIndex = CNvTNTCombiner::FindCompiledMux(); + if( m_lastIndex < 0 ) // Can not found + { + m_lastIndex = CNvTNTCombiner::ParseDecodedMux(); + } + m_dwLastMux0 = m_pDecodedMux->m_dwMux0; + m_dwLastMux1 = m_pDecodedMux->m_dwMux1; + } + + m_pOGLRender->SetAllTexelRepeatFlag(); + + if( m_bCycleChanged || combinerIsChanged || gRDP.texturesAreReloaded || gRDP.colorsAreReloaded ) + { + gRDP.texturesAreReloaded = false; + + if( m_bCycleChanged || combinerIsChanged ) + { + GenerateCombinerSettingConstants(m_lastIndex); + GenerateCombinerSetting(m_lastIndex); + } + else if( gRDP.colorsAreReloaded ) + { + GenerateCombinerSettingConstants(m_lastIndex); + } + + gRDP.colorsAreReloaded = false; + } +} + +const char* COGLColorCombinerTNT2::GetOpStr(GLenum op) +{ + switch( op ) + { + case GL_ADD: + return "MOD"; + default: + return "ADD_SIGNED"; + } +} + + +#ifdef DEBUGGER +void COGLColorCombinerTNT2::DisplaySimpleMuxString(void) +{ + COGLColorCombiner::DisplaySimpleMuxString(); + CNvTNTCombiner::DisplaySimpleMuxString(); +} +#endif + +//======================================================================== + +GLint COGLColorCombinerTNT2::RGBArgsMap[] = +{ + GL_ZERO, //MUX_0 + GL_ZERO, //MUX_1 + GL_PREVIOUS_EXT, //MUX_COMBINED, + GL_TEXTURE0_ARB, //MUX_TEXEL0, + GL_TEXTURE1_ARB, //MUX_TEXEL1, + GL_CONSTANT_EXT, //MUX_PRIM, + GL_PRIMARY_COLOR_EXT, //MUX_SHADE, + GL_CONSTANT_EXT, //MUX_ENV, + GL_PREVIOUS_EXT, //MUX_COMBALPHA, + GL_TEXTURE0_ARB, //MUX_T0_ALPHA, + GL_TEXTURE1_ARB, //MUX_T1_ALPHA, + GL_CONSTANT_EXT, //MUX_PRIM_ALPHA, + GL_PRIMARY_COLOR_EXT, //MUX_SHADE_ALPHA, + GL_CONSTANT_EXT, //MUX_ENV_ALPHA, + GL_CONSTANT_EXT, //MUX_LODFRAC, + GL_CONSTANT_EXT, //MUX_PRIMLODFRAC, + GL_ZERO, //MUX_K5 + GL_ZERO //MUX_UNK +}; + + +//======================================================================== + +GLint COGLColorCombinerTNT2::MapRGBArgs(uint8 arg) +{ + return RGBArgsMap[arg&MUX_MASK]; +} + +GLint COGLColorCombinerTNT2::MapRGBArgFlags(uint8 arg) +{ + if( (arg & MUX_ALPHAREPLICATE) && (arg & MUX_COMPLEMENT) ) + { + return GL_ONE_MINUS_SRC_ALPHA; + } + else if( (arg & MUX_ALPHAREPLICATE) ) + { + if( arg == MUX_1 ) + return GL_ONE_MINUS_SRC_ALPHA; + else + return GL_SRC_ALPHA; + } + else if(arg & MUX_COMPLEMENT || arg == MUX_1) + { + return GL_ONE_MINUS_SRC_COLOR; + } + else + return GL_SRC_COLOR; +} + +GLint COGLColorCombinerTNT2::MapAlphaArgs(uint8 arg) +{ + return RGBArgsMap[arg&MUX_MASK]; +} + +GLint COGLColorCombinerTNT2::MapAlphaArgFlags(uint8 arg) +{ + if(arg & MUX_COMPLEMENT || arg == MUX_1) + { + return GL_ONE_MINUS_SRC_ALPHA; + } + else + return GL_SRC_ALPHA; +} + +//======================================================================== + +void COGLColorCombinerTNT2::GenerateCombinerSetting(int index) +{ + TNT2CombinerSaveType &res = m_vCompiledTNTSettings[index]; + + // Texture unit 0 + COGLTexture* pTexture = g_textures[gRSP.curTile].m_pCOGLTexture; + COGLTexture* pTexture1 = g_textures[(gRSP.curTile+1)&7].m_pCOGLTexture; + + if( pTexture ) m_pOGLRender->BindTexture(pTexture->m_dwTextureName, 0); + if( pTexture1 ) m_pOGLRender->BindTexture(pTexture1->m_dwTextureName, 1); + + // Texture unit 0 + pglActiveTexture(GL_TEXTURE0_ARB); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE4_NV); + m_pOGLRender->EnableTexUnit(0,TRUE); + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, res.unit1.rgbOp); + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_ARB, res.unit1.alphaOp); + + if( res.unit1.rgbOp == GL_SUBTRACT_ARB ) + { + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, MapRGBArgs(res.unit1.rgbArg0^MUX_COMPLEMENT)); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_ARB, MapRGBArgFlags(res.unit1.rgbArg0^MUX_COMPLEMENT)); + } + else + { + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, MapRGBArgs(res.unit1.rgbArg0)); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_ARB, MapRGBArgFlags(res.unit1.rgbArg0)); + } + + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_ARB, MapRGBArgs(res.unit1.rgbArg1)); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_ARB, MapRGBArgFlags(res.unit1.rgbArg1)); + + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_ARB, MapRGBArgs(res.unit1.rgbArg2)); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_ARB, MapRGBArgFlags(res.unit1.rgbArg2)); + + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_EXT, MapRGBArgs(res.unit1.rgbArg3)); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_EXT, MapRGBArgFlags(res.unit1.rgbArg3)); + + if( res.unit1.alphaOp == GL_SUBTRACT_ARB ) + { + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, MapRGBArgs(res.unit1.alphaArg0^MUX_COMPLEMENT)); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, MapAlphaArgFlags(res.unit1.alphaArg0^MUX_COMPLEMENT)); + } + else + { + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, MapRGBArgs(res.unit1.alphaArg0)); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, MapAlphaArgFlags(res.unit1.alphaArg0)); + } + + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_ARB, MapRGBArgs(res.unit1.alphaArg1)); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_ARB, MapAlphaArgFlags(res.unit1.alphaArg1)); + + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA_ARB, MapRGBArgs(res.unit1.alphaArg2)); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA_ARB, MapAlphaArgFlags(res.unit1.alphaArg2)); + + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_ALPHA_EXT, MapRGBArgs(res.unit1.rgbArg3)); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_ALPHA_EXT, MapAlphaArgFlags(res.unit1.rgbArg3)); + + pglActiveTexture(GL_TEXTURE1_ARB); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE4_NV); + + if( m_maxTexUnits > 1 && res.numOfUnits > 1 ) + { + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, res.unit2.rgbOp); + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_ARB, res.unit2.alphaOp); + + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, MapRGBArgs(res.unit2.rgbArg0)); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_ARB, MapRGBArgFlags(res.unit2.rgbArg0)); + + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_ARB, MapRGBArgs(res.unit2.rgbArg1)); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_ARB, MapRGBArgFlags(res.unit2.rgbArg1)); + + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_ARB, MapRGBArgs(res.unit2.rgbArg2)); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_ARB, MapRGBArgFlags(res.unit2.rgbArg2)); + + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_EXT, MapRGBArgs(res.unit2.rgbArg3)); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_EXT, MapRGBArgFlags(res.unit2.rgbArg3)); + + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, MapRGBArgs(res.unit2.alphaArg0)); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, MapAlphaArgFlags(res.unit2.alphaArg0)); + + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_ARB, MapRGBArgs(res.unit2.alphaArg1)); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_ARB, MapAlphaArgFlags(res.unit2.alphaArg1)); + + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA_ARB, MapRGBArgs(res.unit2.alphaArg2)); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA_ARB, MapAlphaArgFlags(res.unit2.alphaArg2)); + + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_ALPHA_EXT, MapRGBArgs(res.unit2.alphaArg3)); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_ALPHA_EXT, MapAlphaArgFlags(res.unit2.alphaArg3)); + + m_pOGLRender->EnableTexUnit(1,TRUE); + } + else + { + //m_pOGLRender->EnableTexUnit(1,FALSE); + } +} + +void COGLColorCombinerTNT2::GenerateCombinerSettingConstants(int index) +{ + TNT2CombinerSaveType &res = m_vCompiledTNTSettings[index]; + for( int i=0; i<2; i++ ) + { + float *fv; + pglActiveTextureARB(GL_TEXTURE0_ARB+i); + switch( res.units[i].constant & MUX_MASK ) + { + case MUX_PRIM: + fv = GetPrimitiveColorfv(); + glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR,fv); + break; + case MUX_ENV: + fv = GetEnvColorfv(); + glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR,fv); + break; + case MUX_LODFRAC: + { + float frac = gRDP.LODFrac / 255.0f; + float tempf[4] = {frac,frac,frac,frac}; + glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR,tempf); + break; + } + case MUX_PRIMLODFRAC: + { + float frac = gRDP.primLODFrac / 255.0f; + float tempf[4] = {frac,frac,frac,frac}; + glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR,tempf); + break; + } + } + } +} + + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLCombinerTNT2.h b/libmupen64plus/mupen64plus-video-rice/src/OGLCombinerTNT2.h new file mode 100644 index 0000000000..0571aab39a --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLCombinerTNT2.h @@ -0,0 +1,69 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#ifndef _OGL_COMBINER_TNT2_H_ +#define _OGL_COMBINER_TNT2_H_ + +#include + +#define GL_SOURCE3_RGB_EXT 0x8583 +#define GL_SOURCE3_ALPHA_EXT 0x858B +#define GL_OPERAND3_RGB_EXT 0x8593 +#define GL_OPERAND3_ALPHA_EXT 0x859B + +#include "OGLExtCombiner.h" +#include "OGLDecodedMux.h" +#include "CNvTNTCombiner.h" + +//======================================================================== + +class COGLColorCombinerTNT2 : public COGLColorCombiner4, CNvTNTCombiner +{ +public: + bool Initialize(void); +protected: + friend class OGLDeviceBuilder; + + void InitCombinerCycle12(void); + + virtual void GenerateCombinerSetting(int); + virtual void GenerateCombinerSettingConstants(int); + + COGLColorCombinerTNT2(CRender *pRender); + ~COGLColorCombinerTNT2() {} ; + + bool m_bTNT2Supported; // Is this NV OGL extension combiner supported by the video card driver? + +#ifdef DEBUGGER + void DisplaySimpleMuxString(void); +#endif + +private: + virtual GLint MapRGBArgs(uint8 arg); + static GLint MapRGBArgFlags(uint8 arg); + virtual GLint MapAlphaArgs(uint8 arg); + static GLint MapAlphaArgFlags(uint8 arg); + static GLint RGBArgsMap[]; + static const char* GetOpStr(GLenum op); + +}; + + + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLDebug.h b/libmupen64plus/mupen64plus-video-rice/src/OGLDebug.h new file mode 100644 index 0000000000..dccf2f3f96 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLDebug.h @@ -0,0 +1,49 @@ +/* OGLDebug.h +Copyright (C) 2009 Richard Goedeken + +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. +*/ + +#if !defined(OPENGL_DEBUG_H) +#define OPENGL_DEBUG_H + +#if defined(OPENGL_DEBUG) + #define OPENGL_CHECK_ERRORS { const GLenum errcode = glGetError(); if (errcode != GL_NO_ERROR) fprintf(stderr, "OpenGL Error code %i in '%s' line %i\n", errcode, __FILE__, __LINE__-1); } +#else + #define OPENGL_CHECK_ERRORS +#endif + +/* Dump client state (for informational purposes) + int rval = 0; + void *ptr; + glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &rval); + printf("GL_ARRAY_BUFFER_BINDING: %i\n", rval); + glGetPointerv(GL_COLOR_ARRAY_POINTER, &ptr); + printf("GL_COLOR_ARRAY: %i (%lx)\n", (int) glIsEnabled(GL_COLOR_ARRAY), (int) ptr); + glGetPointerv(GL_FOG_COORD_ARRAY_POINTER, &ptr); + printf("GL_FOG_COORDINATE_ARRAY_EXT: %i (%lx)\n", (int) glIsEnabled(GL_FOG_COORDINATE_ARRAY_EXT), (int) ptr); + glGetPointerv(GL_INDEX_ARRAY_POINTER, &ptr); + printf("GL_INDEX_ARRAY: %i (%lx)\n", (int) glIsEnabled(GL_INDEX_ARRAY), (int) ptr); + glGetPointerv(GL_NORMAL_ARRAY_POINTER, &ptr); + printf("GL_NORMAL_ARRAY: %i (%lx)\n", (int) glIsEnabled(GL_NORMAL_ARRAY), (int) ptr); + glGetPointerv(GL_SECONDARY_COLOR_ARRAY_POINTER, &ptr); + printf("GL_SECONDARY_COLOR_ARRAY: %i (%lx)\n", (int) glIsEnabled(GL_SECONDARY_COLOR_ARRAY), (int) ptr); + glGetPointerv(GL_TEXTURE_COORD_ARRAY_POINTER, &ptr); + printf("GL_TEXTURE_COORD_ARRAY: %i (%lx)\n", (int) glIsEnabled(GL_TEXTURE_COORD_ARRAY), (int) ptr); + glGetPointerv(GL_VERTEX_ARRAY_POINTER, &ptr); + printf("GL_VERTEX_ARRAY: %i (%lx)\n", (int) glIsEnabled(GL_VERTEX_ARRAY), (int) ptr); +*/ + +#endif /* OPENGL_DEBUG_H */ diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLDecodedMux.cpp b/libmupen64plus/mupen64plus-video-rice/src/OGLDecodedMux.cpp new file mode 100644 index 0000000000..ed98307734 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLDecodedMux.cpp @@ -0,0 +1,117 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#include "OGLDecodedMux.h" + +//======================================================================== +void COGLDecodedMux::Simplify(void) +{ + DecodedMux::Simplify(); +} + +void COGLDecodedMux::Reformat(void) +{ + DecodedMux::Reformat(); + mType = max(max(max(splitType[0], splitType[1]),splitType[2]),splitType[3]); +} + +void COGLExtDecodedMux::Simplify(void) +//======================================================================== +{ + COGLDecodedMux::Simplify(); + FurtherFormatForOGL2(); + Reformat(); // Reformat again +} + +void COGLExtDecodedMux::FurtherFormatForOGL2(void) +{ + // This function is used by OGL 1.2, no need to call this function + // for Nvidia register combiner + + // And OGL 1.2 extension only supports 1 constant color, we can not use both PRIM and ENV + // constant color, and we can not use SPECULAR color as the 2nd color. + + // To futher format the mux. + // - For each stage, allow only 1 texel, change the 2nd texel in the same stage to MUX_SHADE + // - Only allow 1 constant color. Count PRIM and ENV, left the most used one, and change + // the 2nd one to MUX_SHADE + + if( Count(MUX_PRIM) >= Count(MUX_ENV) ) + { + ReplaceVal(MUX_ENV, MUX_PRIM); + //ReplaceVal(MUX_ENV, MUX_SHADE); + //ReplaceVal(MUX_ENV, MUX_1); + //ReplaceVal(MUX_PRIM, MUX_0); + } + else + { + //ReplaceVal(MUX_PRIM, MUX_ENV); + //ReplaceVal(MUX_PRIM, MUX_SHADE); + ReplaceVal(MUX_PRIM, MUX_0); + } + + /* + // Because OGL 1.2, we may use more than 1 texture unit, but for each texture unit, + // we can not use multitexture to do color combiner. Each combiner stage can only + // use 1 texture. + + if( isUsed(MUX_TEXEL0) && isUsed(MUX_TEXEL1) ) + { + if( Count(MUX_TEXEL0,0)+Count(MUX_TEXEL0,1) >= Count(MUX_TEXEL1,0)+Count(MUX_TEXEL1,1) ) + { + ReplaceVal(MUX_TEXEL1, MUX_TEXEL0, 0); + ReplaceVal(MUX_TEXEL1, MUX_TEXEL0, 1); + } + else + { + ReplaceVal(MUX_TEXEL0, MUX_TEXEL1, 0); + ReplaceVal(MUX_TEXEL0, MUX_TEXEL1, 1); + } + + if( Count(MUX_TEXEL0,2)+Count(MUX_TEXEL0,3) >= Count(MUX_TEXEL1,2)+Count(MUX_TEXEL1,3) ) + { + ReplaceVal(MUX_TEXEL1, MUX_TEXEL0, 2); + ReplaceVal(MUX_TEXEL1, MUX_TEXEL0, 3); + } + else + { + ReplaceVal(MUX_TEXEL0, MUX_TEXEL1, 2); + ReplaceVal(MUX_TEXEL0, MUX_TEXEL1, 3); + } + } + */ +} + + +void COGLExtDecodedMuxTNT2::FurtherFormatForOGL2(void) +{ + if( Count(MUX_PRIM) >= Count(MUX_ENV) ) + { + //ReplaceVal(MUX_ENV, MUX_PRIM); + //ReplaceVal(MUX_ENV, MUX_SHADE); + ReplaceVal(MUX_ENV, MUX_1); + //ReplaceVal(MUX_PRIM, MUX_0); + } + else + { + //ReplaceVal(MUX_PRIM, MUX_ENV); + //ReplaceVal(MUX_PRIM, MUX_SHADE); + ReplaceVal(MUX_PRIM, MUX_0); + } +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLDecodedMux.h b/libmupen64plus/mupen64plus-video-rice/src/OGLDecodedMux.h new file mode 100644 index 0000000000..2edfd659f7 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLDecodedMux.h @@ -0,0 +1,46 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#include "DecodedMux.h" + +#ifndef _OGL_DECODEDMUX_H_ +#define _OGL_DECODEDMUX_H_ + +class COGLDecodedMux : public DecodedMux +{ +protected: + virtual void Simplify(void); + virtual void Reformat(void); +}; + +class COGLExtDecodedMux : public COGLDecodedMux +{ +protected: + virtual void FurtherFormatForOGL2(void); + virtual void Simplify(void); +}; + +class COGLExtDecodedMuxTNT2 : public COGLExtDecodedMux +{ +protected: + virtual void FurtherFormatForOGL2(void); +}; + +#endif + + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLES2FragmentShaders.cpp b/libmupen64plus/mupen64plus-video-rice/src/OGLES2FragmentShaders.cpp new file mode 100644 index 0000000000..6e2f4afda1 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLES2FragmentShaders.cpp @@ -0,0 +1,822 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#include "OGLDebug.h" +#include "OGLES2FragmentShaders.h" +#include "OGLRender.h" +#include "OGLGraphicsContext.h" +#include "OGLTexture.h" + +#define ALPHA_TEST " if(gl_FragColor.a < AlphaRef) discard; \n" +//#define ALPHA_TEST + + +GLuint vertexProgram = 9999; +const char *vertexShader = +"#version " GLSL_VERSION "\n" +"attribute mediump vec4 aPosition; \n"\ +"attribute lowp vec4 aColor; \n"\ +"attribute lowp vec2 aTexCoord0; \n"\ +"attribute lowp vec2 aTexCoord1; \n"\ +"attribute lowp vec2 aAtlasTransform; \n"\ +" \n"\ +"uniform lowp vec2 FogMinMax; \n"\ +" \n"\ +"varying lowp float vFactor; \n"\ +"varying lowp vec4 vShadeColor; \n"\ +"varying mediump vec2 vTexCoord0; \n"\ +"varying lowp vec2 vTexCoord1; \n"\ +"varying lowp float vFog; \n"\ +" \n"\ +"void main() \n"\ +"{ \n"\ +"gl_Position = aPosition; //gl_Position.z = max(0.0,gl_Position.z); \n"\ +"vShadeColor = aColor; \n"\ +"vTexCoord0 = aTexCoord0; \n"\ +"vTexCoord1 = aTexCoord1; \n"\ +"vFog = clamp((FogMinMax[1] - (gl_Position.z/aPosition.w))/(FogMinMax[1]-FogMinMax[0]),0.0,1.0); \n"\ +" \n"\ +"} \n"\ +" \n"; + +const char *fragmentHeader = +"#define saturate(x) clamp( x, 0.0, 1.0 ) \n"\ +"precision lowp float; \n"\ +"#ifdef NEED_TEX0 \n"\ +"uniform sampler2D uTex0; \n"\ +"#endif \n"\ +" \n"\ +"#ifdef NEED_TEX1 \n"\ +"uniform sampler2D uTex1; \n"\ +"#endif \n"\ +" \n"\ +"uniform vec4 EnvColor; \n"\ +"uniform vec4 PrimColor; \n"\ +"uniform vec4 EnvFrac; \n"\ +"uniform vec4 PrimFrac; \n"\ +"uniform float AlphaRef; \n"\ +"uniform vec4 FogColor; \n"\ +" \n"\ +"varying lowp float vFactor; \n"\ +"varying lowp vec4 vShadeColor; \n"\ +"varying mediump vec2 vTexCoord0; \n"\ +"varying lowp vec2 vTexCoord1; \n"\ +"varying lowp float vFog; \n"\ +" \n"\ +"void main() \n"\ +"{ \n"\ +"vec4 comb,comb2; \n"\ +" \n"\ +"#ifdef NEED_TEX0 \n"\ +"vec4 t0 = texture2D(uTex0,vTexCoord0); \n"\ +"#endif \n"\ +" \n"\ +"#ifdef NEED_TEX1 \n"\ +"vec4 t1 = texture2D(uTex1,vTexCoord1); \n"\ +"#endif \n"; + +const char *fragmentFooter = +" \n"\ +"#ifdef FOG \n"\ +"gl_FragColor.rgb = mix(FogColor.rgb,comb.rgb,vFog * step(0.5,1.0-FogColor.a)); \n"\ +"gl_FragColor.a = comb.a; \n"\ +"#else \n"\ +"gl_FragColor = comb; \n"\ +"#endif \n"\ +" \n"\ +"#ifdef ALPHA_TEST \n"\ +ALPHA_TEST +"#endif \n"\ +" \n"\ +" \n"\ +" \n"\ +" \n"\ +"} \n"; + +//Fragment shader for InitCycleCopy +const char *fragmentCopy = +"#version " GLSL_VERSION "\n"\ +"precision lowp float; \n"\ +"uniform sampler2D uTex0; \n"\ +"uniform float AlphaRef; \n"\ +"varying lowp vec2 vTexCoord0; \n"\ +"void main() \n"\ +"{ \n"\ +" gl_FragColor = texture2D(uTex0,vTexCoord0).bgra; \n"\ +ALPHA_TEST +"}"; + +GLuint copyProgram,copyAlphaLocation; + +//Fragment shader for InitCycleFill +const char *fragmentFill = +"#version " GLSL_VERSION "\n"\ +"precision lowp float; \n" +"uniform vec4 uColor; \n" +"void main() \n" +"{ \n" +" gl_FragColor = uColor; \n" +"}"; + +GLuint fillProgram,fillColorLocation; + +COGLFragmentShaderCombiner::COGLFragmentShaderCombiner(CRender *pRender) +: COGLColorCombiner(pRender) +{ + m_bShaderIsSupported = true; +} +COGLFragmentShaderCombiner::~COGLFragmentShaderCombiner() +{ +} + +bool COGLFragmentShaderCombiner::Initialize(void) +{ + if( !COGLColorCombiner::Initialize() ) + return false; + + COGLGraphicsContext *pcontext = (COGLGraphicsContext *)(CGraphicsContext::g_pGraphicsContext); +// if( pcontext->IsExtensionSupported("GL_fragment_shader") ) +// { + m_bShaderIsSupported = true; +// } + + return true; +} + +void COGLFragmentShaderCombiner::InitCombinerCycle12(void) +{ +} +void COGLFragmentShaderCombiner::DisableCombiner(void) +{ + COGLColorCombiner::DisableCombiner(); +} + +void COGLFragmentShaderCombiner::InitCombinerCycleCopy(void) +{ + COGLColorCombiner::InitCombinerCycleCopy(); +} + +void COGLFragmentShaderCombiner::InitCombinerCycleFill(void) +{ + COGLColorCombiner::InitCombinerCycleFill(); +} +void COGLFragmentShaderCombiner::InitCombinerBlenderForSimpleTextureDraw(uint32 tile) +{ + COGLColorCombiner::InitCombinerBlenderForSimpleTextureDraw(tile); +} + +#ifdef DEBUGGER +void COGLFragmentShaderCombiner::DisplaySimpleMuxString(void) +{ + COGLColorCombiner::DisplaySimpleMuxString(); +} +#endif + + + +COGL_FragmentProgramCombiner::COGL_FragmentProgramCombiner(CRender *pRender) +: COGLColorCombiner4(pRender) +{ + delete m_pDecodedMux; + m_pDecodedMux = new DecodedMuxForPixelShader; + m_bFragmentProgramIsSupported = true; + m_AlphaRef = 0.0f; + + //Create shaders for fill and copy + GLint success; + GLuint vs,fs; + copyProgram = glCreateProgram(); + vs = glCreateShader(GL_VERTEX_SHADER); + glShaderSource(vs,1,&vertexShader,NULL); + glCompileShader(vs); + + glGetShaderiv(vs,GL_COMPILE_STATUS,&success); + if(!success) + { + char log[1024]; + glGetShaderInfoLog(vs,1024,NULL,log); + printf("%s\n",log); + } + + fs = glCreateShader(GL_FRAGMENT_SHADER); + glShaderSource(fs,1,&fragmentCopy,NULL); + glCompileShader(fs); + + glGetShaderiv(fs,GL_COMPILE_STATUS,&success); + if(!success) + { + char log[1024]; + glGetShaderInfoLog(fs,1024,NULL,log); + printf("%s\n",log); + } + + glAttachShader(copyProgram,vs); + glAttachShader(copyProgram,fs); + + glBindAttribLocation(copyProgram,VS_TEXCOORD0,"aTexCoord0"); + OPENGL_CHECK_ERRORS; + glBindAttribLocation(copyProgram,VS_POSITION,"aPosition"); + OPENGL_CHECK_ERRORS; + + glLinkProgram(copyProgram); + copyAlphaLocation = glGetUniformLocation(copyProgram,"AlphaRef"); + glGetProgramiv(copyProgram,GL_LINK_STATUS,&success); + if(!success) + { + char log[1024]; + glGetProgramInfoLog(copyProgram,1024,NULL,log); + printf("%s\n",log); + } + + glDeleteShader(fs); + + //Fill shader + fs = glCreateShader(GL_FRAGMENT_SHADER); + glShaderSource(fs,1,&fragmentFill,NULL); + glCompileShader(fs); + + glGetShaderiv(fs,GL_COMPILE_STATUS,&success); + if(!success) + { + char log[1024]; + glGetShaderInfoLog(fs,1024,NULL,log); + printf("%s\n",log); + } + + fillProgram = glCreateProgram(); + glAttachShader(fillProgram,vs); + glAttachShader(fillProgram,fs); + + glBindAttribLocation(fillProgram,VS_POSITION,"aPosition"); + OPENGL_CHECK_ERRORS; + + glLinkProgram(fillProgram); + + + fillColorLocation = glGetUniformLocation(fillProgram,"uColor"); + + glDeleteShader(fs); + glDeleteShader(vs); +} +COGL_FragmentProgramCombiner::~COGL_FragmentProgramCombiner() +{ + int size = m_vCompiledShaders.size(); + for (int i=0; iIsExtensionSupported("GL_fragment_program") ) +// { + m_bFragmentProgramIsSupported = true; +// } + + return true; +} + + + +void COGL_FragmentProgramCombiner::DisableCombiner(void) +{ + //glDisable(GL_FRAGMENT_PROGRAM); + //OPENGL_CHECK_ERRORS; + COGLColorCombiner4::DisableCombiner(); +} + +void COGL_FragmentProgramCombiner::InitCombinerCycleCopy(void) +{ + m_pOGLRender->DisableMultiTexture(); + m_pOGLRender->EnableTexUnit(0,TRUE); + glUseProgram(copyProgram); + glUniform1f(copyAlphaLocation,m_AlphaRef); + OPENGL_CHECK_ERRORS; + glEnableVertexAttribArray(VS_POSITION); + OPENGL_CHECK_ERRORS; + glEnableVertexAttribArray(VS_TEXCOORD0); + OPENGL_CHECK_ERRORS; + glDisableVertexAttribArray(VS_COLOR); + OPENGL_CHECK_ERRORS; + glDisableVertexAttribArray(VS_TEXCOORD1); + OPENGL_CHECK_ERRORS; + COGLTexture* pTexture = g_textures[gRSP.curTile].m_pCOGLTexture; + if( pTexture ) + { + m_pOGLRender->BindTexture(pTexture->m_dwTextureName, 0); + m_pOGLRender->SetTexelRepeatFlags(gRSP.curTile); + } +} + +void COGL_FragmentProgramCombiner::InitCombinerCycleFill(void) +{ + glUseProgram(fillProgram); + glUniform4f(fillColorLocation,((gRDP.fillColor>>16)&0xFF)/255.0f,((gRDP.fillColor>>8)&0xFF)/255.0f,((gRDP.fillColor)&0xFF)/255.0f,((gRDP.fillColor>>24)&0xFF)/255.0f); + OPENGL_CHECK_ERRORS; +} + +#ifdef BGR_SHADER +const char *muxToFP_Maps[][2] = { +//color -- alpha +{"vec3(0.0)", "0.0"}, //MUX_0 = 0, +{"vec3(1.0)", "1.0"}, //MUX_1, +{"comb.rgb", "comb.a"}, //MUX_COMBINED, +{"t0.rgb", "t0.a"}, //MUX_TEXEL0, +{"t1.rgb", "t1.a"}, //MUX_TEXEL1, +{"PrimColor.rgb", "PrimColor.a"}, //MUX_PRIM, +{"vShadeColor.rgb", "vShadeColor.a"}, //MUX_SHADE, +{"EnvColor.rgb", "EnvColor.a"}, //MUX_ENV, +{"comb.rgb", "comb.a"}, //MUX_COMBALPHA, +{"t0.rgb", "t0.a"}, //MUX_T0_ALPHA, +{"t1.rgb", "t1.a"}, //MUX_T1_ALPHA, +{"PrimColor.rgb", "PrimColor.a"}, //MUX_PRIM_ALPHA, +{"vShadeColor.rgb", "vShadeColor.a"}, //MUX_SHADE_ALPHA, +{"EnvColor.rgb", "EnvColor.a"}, //MUX_ENV_ALPHA, +{"EnvFrac.a", "EnvFrac.a"}, //MUX_LODFRAC, +{"PrimFrac.a", "PrimFrac.a"}, //MUX_PRIMLODFRAC, +{"vec3(1.0)", "1.0"}, //MUX_K5, +{"vec3(1.0)", "1.0"}, //MUX_UNK, // Should not be used +}; +#else +const char *muxToFP_Maps[][2] = { +//color -- alpha +{"vec3(0.0)", "0.0"}, //MUX_0 = 0, +{"vec3(1.0)", "1.0"}, //MUX_1, +{"comb.rgb", "comb.a"}, //MUX_COMBINED, +{"t0.bgr", "t0.a"}, //MUX_TEXEL0, +{"t1.bgr", "t1.a"}, //MUX_TEXEL1, +{"PrimColor.rgb", "PrimColor.a"}, //MUX_PRIM, +{"vShadeColor.rgb", "vShadeColor.a"}, //MUX_SHADE, +{"EnvColor.rgb", "EnvColor.a"}, //MUX_ENV, +{"comb.rgb", "comb.a"}, //MUX_COMBALPHA, +{"t0.bgr", "t0.a"}, //MUX_T0_ALPHA, +{"t1.bgr", "t1.a"}, //MUX_T1_ALPHA, +{"PrimColor.rgb", "PrimColor.a"}, //MUX_PRIM_ALPHA, +{"vShadeColor.rgb", "vShadeColor.a"}, //MUX_SHADE_ALPHA, +{"EnvColor.rgb", "EnvColor.a"}, //MUX_ENV_ALPHA, +{"EnvFrac.a", "EnvFrac.a"}, //MUX_LODFRAC, +{"PrimFrac.a", "PrimFrac.a"}, //MUX_PRIMLODFRAC, +{"vec3(1.0)", "1.0"}, //MUX_K5, +{"vec3(1.0)", "1.0"}, //MUX_UNK, // Should not be used +}; +#endif + + +char oglNewFP[4092]; + +char* MuxToOC(uint8 val) +{ +// For color channel +if( val&MUX_ALPHAREPLICATE ) + return (char*)muxToFP_Maps[val&0x1F][1]; +else + return (char*)muxToFP_Maps[val&0x1F][0]; +} + +char* MuxToOA(uint8 val) +{ +// For alpha channel +return (char*)muxToFP_Maps[val&0x1F][1]; +} + +static void CheckFpVars(uint8 MuxVar, bool &bNeedT0, bool &bNeedT1) +{ + MuxVar &= 0x1f; + if (MuxVar == MUX_TEXEL0 || MuxVar == MUX_T0_ALPHA) + bNeedT0 = true; + if (MuxVar == MUX_TEXEL1 || MuxVar == MUX_T1_ALPHA) + bNeedT1 = true; +} + +void COGL_FragmentProgramCombiner::GenerateProgramStr() +{ + DecodedMuxForPixelShader &mux = *(DecodedMuxForPixelShader*)m_pDecodedMux; + + mux.splitType[0] = mux.splitType[1] = mux.splitType[2] = mux.splitType[3] = CM_FMT_TYPE_NOT_CHECKED; + m_pDecodedMux->Reformat(false); + + char tempstr[500], newFPBody[4092]; + bool bNeedT0 = false, bNeedT1 = false, bNeedComb2 = false; + newFPBody[0] = 0; + + for( int cycle=0; cycle<2; cycle++ ) + { + for( int channel=0; channel<2; channel++) + { + char* (*func)(uint8) = channel==0?MuxToOC:MuxToOA; + char *dst = channel==0?(char*)"rgb":(char*)"a"; + N64CombinerType &m = mux.m_n64Combiners[cycle*2+channel]; + switch( mux.splitType[cycle*2+channel] ) + { + case CM_FMT_TYPE_NOT_USED: + tempstr[0] = 0; + break; + case CM_FMT_TYPE_D: + sprintf(tempstr, "comb.%s = %s;\n", dst, func(m.d)); + CheckFpVars(m.d, bNeedT0, bNeedT1); + break; + case CM_FMT_TYPE_A_MOD_C: + sprintf(tempstr, "comb.%s = %s * %s;\n", dst, func(m.a), func(m.c)); + CheckFpVars(m.a, bNeedT0, bNeedT1); + CheckFpVars(m.c, bNeedT0, bNeedT1); + break; + case CM_FMT_TYPE_A_ADD_D: + sprintf(tempstr, "comb.%s = saturate(%s + %s);\n", dst, func(m.a), func(m.d)); + CheckFpVars(m.a, bNeedT0, bNeedT1); + CheckFpVars(m.d, bNeedT0, bNeedT1); + break; + case CM_FMT_TYPE_A_SUB_B: + sprintf(tempstr, "comb.%s = %s - %s;\n", dst, func(m.a), func(m.b)); + CheckFpVars(m.a, bNeedT0, bNeedT1); + CheckFpVars(m.b, bNeedT0, bNeedT1); + break; + case CM_FMT_TYPE_A_MOD_C_ADD_D: + sprintf(tempstr, "comb.%s = saturate(%s * %s + %s);\n", dst, func(m.a), func(m.c),func(m.d)); + CheckFpVars(m.a, bNeedT0, bNeedT1); + CheckFpVars(m.c, bNeedT0, bNeedT1); + CheckFpVars(m.d, bNeedT0, bNeedT1); + break; + case CM_FMT_TYPE_A_LERP_B_C: + //ARB ASM LERP and mix have different parameter ordering. + //sprintf(tempstr, "comb.%s = saturate(mix(%s, %s, %s));\n", dst,func(m.a),func(m.b), func(m.c)); + sprintf(tempstr, "comb.%s = (%s - %s) * %s + %s;\n", dst,func(m.a),func(m.b), func(m.c),func(m.b)); + CheckFpVars(m.a, bNeedT0, bNeedT1); + CheckFpVars(m.b, bNeedT0, bNeedT1); + CheckFpVars(m.c, bNeedT0, bNeedT1); + //sprintf(tempstr, "SUB comb.%s, %s, %s;\nMAD_SAT comb.%s, comb, %s, %s;\n", dst, func(m.a), func(m.b), dst, func(m.c), func(m.b)); + break; + default: + sprintf(tempstr, "comb2.%s = %s - %s;\ncomb.%s = saturate(comb2.%s * %s + %s);\n", dst, func(m.a), func(m.b), dst,dst, func(m.c),func(m.d)); + CheckFpVars(m.a, bNeedT0, bNeedT1); + CheckFpVars(m.b, bNeedT0, bNeedT1); + CheckFpVars(m.c, bNeedT0, bNeedT1); + CheckFpVars(m.d, bNeedT0, bNeedT1); + bNeedComb2 = true; + break; + } + strcat(newFPBody, tempstr); + } + } + + oglNewFP[0] = 0; + if (bNeedT0) + strcat(oglNewFP, "#define NEED_TEX0\n"); + if (bNeedT1) + strcat(oglNewFP, "#define NEED_TEX1\n"); + if(gRDP.bFogEnableInBlender && gRSP.bFogEnabled && options.fogMethod > 0) + strcat(oglNewFP,"#define FOG"); + strcat(oglNewFP, fragmentHeader); + strcat(oglNewFP, newFPBody); + strcat(oglNewFP, fragmentFooter); + +} + +int COGL_FragmentProgramCombiner::ParseDecodedMux() +{ + if( !m_bFragmentProgramIsSupported ) + return COGLColorCombiner4::ParseDecodedMux(); + + OGLShaderCombinerSaveType res; + GLint success; + + if(vertexProgram == 9999) + { + vertexProgram = res.vertexShaderID = glCreateShader(GL_VERTEX_SHADER); + glShaderSource(res.vertexShaderID, 1, &vertexShader,NULL); + OPENGL_CHECK_ERRORS; + glCompileShader(res.vertexShaderID); + OPENGL_CHECK_ERRORS; + } + else + { + res.vertexShaderID = vertexProgram; + } + + + //Create 2 shaders, with and without alphatest + GenerateProgramStr(); + + for(int alphaTest = 0;alphaTest < 2;alphaTest++) + { + res.fragmentShaderID = glCreateShader(GL_FRAGMENT_SHADER); + + char* tmpShader = (char*)malloc(sizeof(char) * 4096); + strcpy(tmpShader,"#version " GLSL_VERSION "\n"); + + if(alphaTest == 1) + { + strcat(tmpShader,"#define ALPHA_TEST\n"); + } + + res.alphaTest = alphaTest == 1; + strcat(tmpShader,oglNewFP); + + glShaderSource(res.fragmentShaderID, 1,(const char**) &tmpShader,NULL); + free(tmpShader); + + + OPENGL_CHECK_ERRORS; + glCompileShader(res.fragmentShaderID); + + glGetShaderiv(res.fragmentShaderID, GL_COMPILE_STATUS, &success); + if (!success) + { + char Log[1024]; + GLint nLength; + glGetShaderInfoLog(res.fragmentShaderID, 1024, &nLength, Log); + printf("Error compiling shader!\n %s",oglNewFP); + printf(Log); + } + + res.programID = glCreateProgram(); + glAttachShader(res.programID,res.vertexShaderID); + glAttachShader(res.programID,res.fragmentShaderID); + + //Bind Attributes + glBindAttribLocation(res.programID,VS_COLOR,"aColor"); + OPENGL_CHECK_ERRORS; + glBindAttribLocation(res.programID,VS_TEXCOORD0,"aTexCoord0"); + OPENGL_CHECK_ERRORS; + glBindAttribLocation(res.programID,VS_TEXCOORD1,"aTexCoord1"); + OPENGL_CHECK_ERRORS; + glBindAttribLocation(res.programID,VS_POSITION,"aPosition"); + OPENGL_CHECK_ERRORS; + + glLinkProgram(res.programID); + OPENGL_CHECK_ERRORS; + + glGetProgramiv(res.programID, GL_LINK_STATUS, &success); + if (!success) + { + char Log[1024]; + GLint nLength; + glGetShaderInfoLog(res.fragmentShaderID, 1024, &nLength, Log); + printf("Error linking program!\n"); + printf("%s\n",Log); + } + + glUseProgram(res.programID); + OPENGL_CHECK_ERRORS; + + //Bind texture samplers + GLint tex0 = glGetUniformLocation(res.programID,"uTex0"); + GLint tex1 = glGetUniformLocation(res.programID,"uTex1"); + + if(tex0 != -1) + glUniform1i(tex0,0); + if(tex1 != -1) + glUniform1i(tex1,1); + + //Bind Uniforms + res.PrimColorLocation = glGetUniformLocation(res.programID,"PrimColor"); + OPENGL_CHECK_ERRORS; + res.EnvColorLocation = glGetUniformLocation(res.programID,"EnvColor"); + OPENGL_CHECK_ERRORS; + res.PrimFracLocation = glGetUniformLocation(res.programID,"PrimFrac"); + OPENGL_CHECK_ERRORS; + res.EnvFracLocation = glGetUniformLocation(res.programID,"EnvFrac"); + OPENGL_CHECK_ERRORS; + res.AlphaRefLocation = glGetUniformLocation(res.programID,"AlphaRef"); + OPENGL_CHECK_ERRORS; + res.FogColorLocation = glGetUniformLocation(res.programID,"FogColor"); + OPENGL_CHECK_ERRORS; + res.FogMinMaxLocation = glGetUniformLocation(res.programID,"FogMinMax"); + OPENGL_CHECK_ERRORS; + + res.dwMux0 = m_pDecodedMux->m_dwMux0; + res.dwMux1 = m_pDecodedMux->m_dwMux1; + res.fogIsUsed = gRDP.bFogEnableInBlender && gRSP.bFogEnabled; + + m_vCompiledShaders.push_back(res); + } + m_lastIndex = m_vCompiledShaders.size()-2; + + return m_lastIndex; +} + +void COGL_FragmentProgramCombiner::GenerateCombinerSetting(int index) +{ + GLuint ID = m_vCompiledShaders[index].programID; + + glUseProgram(ID); + glEnableVertexAttribArray(VS_POSITION); + OPENGL_CHECK_ERRORS; + glVertexAttribPointer(VS_POSITION,4,GL_FLOAT,GL_FALSE,sizeof(float)*5,&(g_vtxProjected5[0][0])); + OPENGL_CHECK_ERRORS; + + glEnableVertexAttribArray(VS_TEXCOORD0); + OPENGL_CHECK_ERRORS; + glVertexAttribPointer(VS_TEXCOORD0,2,GL_FLOAT,GL_FALSE, sizeof( TLITVERTEX ), &(g_vtxBuffer[0].tcord[0].u)); + OPENGL_CHECK_ERRORS; + + glEnableVertexAttribArray(VS_TEXCOORD1); + OPENGL_CHECK_ERRORS; + glVertexAttribPointer(VS_TEXCOORD1,2,GL_FLOAT,GL_FALSE, sizeof( TLITVERTEX ), &(g_vtxBuffer[0].tcord[1].u)); + OPENGL_CHECK_ERRORS; + + glEnableVertexAttribArray(VS_COLOR); + OPENGL_CHECK_ERRORS; + glVertexAttribPointer(VS_COLOR, 4, GL_UNSIGNED_BYTE,GL_TRUE, sizeof(uint8)*4, &(g_oglVtxColors[0][0]) ); + OPENGL_CHECK_ERRORS; +} + +void COGL_FragmentProgramCombiner::GenerateCombinerSettingConstants(int index) +{ + OGLShaderCombinerSaveType prog = m_vCompiledShaders[index]; + + glUseProgram(prog.programID); + float *pf; + if(prog.EnvColorLocation != -1) + { + pf = GetEnvColorfv(); + glUniform4fv(prog.EnvColorLocation,1, pf); + OPENGL_CHECK_ERRORS; + } + + if(prog.PrimColorLocation != -1) + { + pf = GetPrimitiveColorfv(); + glUniform4fv(prog.PrimColorLocation,1, pf); + OPENGL_CHECK_ERRORS; + } + + if(prog.EnvFracLocation != -1) + { + float frac = gRDP.LODFrac / 255.0f; + float tempf[4] = {frac,frac,frac,frac}; + glUniform4fv(prog.EnvFracLocation,1, tempf); + OPENGL_CHECK_ERRORS; + } + + if(prog.PrimFracLocation != -1) + { + float frac2 = gRDP.primLODFrac / 255.0f; + float tempf2[4] = {frac2,frac2,frac2,frac2}; + glUniform4fv(prog.PrimFracLocation,1, tempf2); + OPENGL_CHECK_ERRORS; + } + + //if(prog.FogColorLocation != -1 && prog.FogMinMaxLocation != -1) + //{ + // //Pass fog colour and distance, use 0 alpha if fog disabled + // glUniform4f(prog.FogColorLocation, gRDP.fvFogColor[0],gRDP.fvFogColor[1],gRDP.fvFogColor[2], + // gRSP.bFogEnabled ? gRDP.fvFogColor[0] : 0.0f); + // glUniform2f(prog.FogMinMaxLocation,gRSPfFogMin,gRSPfFogMax); + //} + + if(prog.AlphaRefLocation != -1) + glUniform1f(prog.AlphaRefLocation,m_AlphaRef); + OPENGL_CHECK_ERRORS; +} + +void COGL_FragmentProgramCombiner::UpdateFog(bool bEnable) +{ + if(m_lastIndex < 0 || m_lastIndex >= m_vCompiledShaders.size()) + return; + OGLShaderCombinerSaveType prog = m_vCompiledShaders[m_lastIndex]; + + //if(bEnable) + // DebugMessage(M64MSG_INFO,"Fog Color %x Min %f Max %f",gRDP.fogColor,gRSPfFogMin,gRSPfFogMax); + + if(prog.FogColorLocation != -1 && prog.FogMinMaxLocation != -1) + { + //Pass fog colour and distance, use 0 alpha if fog disabled + glUniform4f(prog.FogColorLocation, gRDP.fvFogColor[0],gRDP.fvFogColor[1],gRDP.fvFogColor[2], + bEnable ? gRDP.fvFogColor[0] : 0.0f); + //glUniform4f(prog.FogColorLocation, 1.0f,0.3f,0.3f,1.0f); + //OPENGL_CHECK_ERRORS; + glUniform2f(prog.FogMinMaxLocation,gRSPfFogMin,gRSPfFogMax); + OPENGL_CHECK_ERRORS; + } +} + +int COGL_FragmentProgramCombiner::FindCompiledMux() +{ +#ifdef DEBUGGER + if( debuggerDropCombiners ) + { + m_vCompiledShaders.clear(); + //m_dwLastMux0 = m_dwLastMux1 = 0; + debuggerDropCombiners = false; + } +#endif + for( uint32 i=0; im_dwMux0 + && m_vCompiledShaders[i].dwMux1 == m_pDecodedMux->m_dwMux1 + && m_vCompiledShaders[i].fogIsUsed == (gRDP.bFogEnableInBlender && gRSP.bFogEnabled) + && m_vCompiledShaders[i].alphaTest == m_AlphaRef > 0.0f) + { + return (int)i; + } + } + + return -1; +} + +////////////////////////////////////////////////////////////////////////// +void COGL_FragmentProgramCombiner::InitCombinerCycle12(void) +{ + if( !m_bFragmentProgramIsSupported ) + { + COGLColorCombiner4::InitCombinerCycle12(); + return; + } + +#ifdef DEBUGGER + if( debuggerDropCombiners ) + { + UpdateCombiner(m_pDecodedMux->m_dwMux0,m_pDecodedMux->m_dwMux1); + m_vCompiledShaders.clear(); + m_dwLastMux0 = m_dwLastMux1 = 0; + debuggerDropCombiners = false; + } +#endif + + m_pOGLRender->EnableMultiTexture(); + + bool combinerIsChanged = false; + + if( m_pDecodedMux->m_dwMux0 != m_dwLastMux0 || m_pDecodedMux->m_dwMux1 != m_dwLastMux1 || m_lastIndex < 0 ) + { + combinerIsChanged = true; + m_lastIndex = FindCompiledMux(); + if( m_lastIndex < 0 ) // Can not found + { + m_lastIndex = ParseDecodedMux(); + } + + m_dwLastMux0 = m_pDecodedMux->m_dwMux0; + m_dwLastMux1 = m_pDecodedMux->m_dwMux1; + } + + + GenerateCombinerSettingConstants(m_lastIndex); + if( m_bCycleChanged || combinerIsChanged || gRDP.texturesAreReloaded || gRDP.colorsAreReloaded ) + { + if( m_bCycleChanged || combinerIsChanged ) + { + GenerateCombinerSettingConstants(m_lastIndex); + GenerateCombinerSetting(m_lastIndex); + } + else if( gRDP.colorsAreReloaded ) + { + GenerateCombinerSettingConstants(m_lastIndex); + } + + m_pOGLRender->SetAllTexelRepeatFlag(); + + gRDP.colorsAreReloaded = false; + gRDP.texturesAreReloaded = false; + } + else + { + m_pOGLRender->SetAllTexelRepeatFlag(); + } +} + +#ifdef DEBUGGER +void COGL_FragmentProgramCombiner::DisplaySimpleMuxString(void) +{ + COGLColorCombiner::DisplaySimpleMuxString(); + DecodedMuxForPixelShader &mux = *(DecodedMuxForPixelShader*)m_pDecodedMux; + mux.Reformat(false); + GenerateProgramStr(); + //sprintf(oglNewFP, oglFP, + // MuxToOC(mux.aRGB0), MuxToOC(mux.bRGB0), MuxToOC(mux.cRGB0), MuxToOC(mux.dRGB0), + // MuxToOA(mux.aA0), MuxToOA(mux.bA0), MuxToOA(mux.cA0), MuxToOA(mux.dA0), + // MuxToOC(mux.aRGB1), MuxToOC(mux.bRGB1), MuxToOC(mux.cRGB1), MuxToOC(mux.dRGB1), + // MuxToOA(mux.aA1), MuxToOA(mux.bA1), MuxToOA(mux.cA1), MuxToOA(mux.dA1) + // ); + + TRACE0("OGL Fragment Program:"); + TRACE0(oglNewFP); +} +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLES2FragmentShaders.h b/libmupen64plus/mupen64plus-video-rice/src/OGLES2FragmentShaders.h new file mode 100644 index 0000000000..9e77eaa28d --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLES2FragmentShaders.h @@ -0,0 +1,113 @@ +/* +Copyright (C) 2005 Rice1964 + +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. +*/ + +#ifndef _OGL_FRAGMENT_SHADER_H_ +#define _OGL_FRAGMENT_SHADER_H_ + +#include + +#include "osal_opengl.h" + +#include "OGLCombiner.h" +#include "OGLExtCombiner.h" +#include "GeneralCombiner.h" + +typedef struct { + uint32 dwMux0; + uint32 dwMux1; + + bool fogIsUsed; + bool alphaTest; + GLuint fragmentShaderID; + GLuint vertexShaderID; + GLuint programID; + + GLint PrimColorLocation; + GLint EnvColorLocation; + GLint PrimFracLocation; + GLint EnvFracLocation; + GLint AlphaRefLocation; + GLint FogColorLocation; + GLint FogMinMaxLocation; + +} OGLShaderCombinerSaveType; + + +class COGL_FragmentProgramCombiner : public COGLColorCombiner4 +{ +public: + bool Initialize(void); + float m_AlphaRef; + void UpdateFog(bool bEnable); + +protected: + friend class OGLDeviceBuilder; + + void DisableCombiner(void); + void InitCombinerCycleCopy(void); + void InitCombinerCycleFill(void); + void InitCombinerCycle12(void); + + COGL_FragmentProgramCombiner(CRender *pRender); + ~COGL_FragmentProgramCombiner(); + + bool m_bFragmentProgramIsSupported; + std::vector m_vCompiledShaders; + +private: + virtual int ParseDecodedMux(); + virtual void GenerateProgramStr(); + int FindCompiledMux(); + virtual void GenerateCombinerSetting(int index); + virtual void GenerateCombinerSettingConstants(int index); + +#ifdef DEBUGGER + void DisplaySimpleMuxString(void); +#endif + +}; + + + +class COGLFragmentShaderCombiner : public COGLColorCombiner +{ +public: + bool Initialize(void); + void InitCombinerBlenderForSimpleTextureDraw(uint32 tile=0); +protected: + friend class OGLDeviceBuilder; + + void DisableCombiner(void); + void InitCombinerCycleCopy(void); + void InitCombinerCycleFill(void); + void InitCombinerCycle12(void); + + COGLFragmentShaderCombiner(CRender *pRender); + ~COGLFragmentShaderCombiner(); + + bool m_bShaderIsSupported; + +#ifdef DEBUGGER + void DisplaySimpleMuxString(void); +#endif + +}; + + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLExtCombiner.cpp b/libmupen64plus/mupen64plus-video-rice/src/OGLExtCombiner.cpp new file mode 100644 index 0000000000..9a249d04de --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLExtCombiner.cpp @@ -0,0 +1,1258 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#include +#include "osal_opengl.h" + +#if SDL_VIDEO_OPENGL +#include "OGLExtensions.h" +#endif +#include "OGLDebug.h" +#include "OGLExtCombiner.h" +#include "OGLExtRender.h" +#include "OGLDecodedMux.h" +#include "OGLGraphicsContext.h" +#include "OGLTexture.h" +#include "DirectXDecodedMux.h" + +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 + +//======================================================================== +COGLColorCombiner4::COGLColorCombiner4(CRender *pRender) + :COGLColorCombiner(pRender), m_maxTexUnits(0), m_lastIndex(-1), + m_dwLastMux0(0), m_dwLastMux1(0) +{ + m_bOGLExtCombinerSupported=false; + m_bSupportModAdd_ATI = false; + m_bSupportModSub_ATI = false; + delete m_pDecodedMux; + m_pDecodedMux = new COGLExtDecodedMux; +} + +COGLColorCombiner4v2::COGLColorCombiner4v2(CRender *pRender) + :COGLColorCombiner4(pRender) +{ + delete m_pDecodedMux; + m_pDecodedMux = new DecodedMuxForOGL14V2; +} + +COGLColorCombiner2::COGLColorCombiner2(CRender *pRender) + :COGLColorCombiner4(pRender) +{ + delete m_pDecodedMux; + m_pDecodedMux = new CDirectXDecodedMux; // Use Mux for DirectX because we support only 1 texture for each stage + m_ppGeneralDecodedMux = &m_pDecodedMux; +} + +////////////////////////////////////////////////////////////////////////// +bool COGLColorCombiner4::Initialize(void) +{ + m_bOGLExtCombinerSupported = false; + m_bSupportModAdd_ATI = false; + m_bSupportModSub_ATI = false; + m_maxTexUnits = 1; + +#if SDL_VIDEO_OPENGL + if( COGLColorCombiner::Initialize() ) + { + m_bSupportMultiTexture = true; + COGLGraphicsContext *pcontext = (COGLGraphicsContext *)(CGraphicsContext::g_pGraphicsContext); + + if( pcontext->IsExtensionSupported("GL_EXT_texture_env_combine") || pcontext->IsExtensionSupported("GL_ARB_texture_env_combine") ) + { + m_bOGLExtCombinerSupported = true; + glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB,&m_maxTexUnits); + OPENGL_CHECK_ERRORS; + if( m_maxTexUnits > 8 ) m_maxTexUnits = 8; + + TRACE0("Starting Ogl 1.4 multitexture combiner" ); + TRACE1("m_maxTexUnits = %d", m_maxTexUnits); + if( pcontext->IsExtensionSupported("ATI_texture_env_combine3") ) + { + m_bSupportModAdd_ATI = true; + m_bSupportModSub_ATI = true; + } + } + else + { + DebugMessage(M64MSG_ERROR, "Your video card does not support OpenGL extension combiner, you can only use the basic OpenGL combiner functions"); + } + m_supportedStages = m_maxTexUnits; + return true; + } + return false; + +#elif SDL_VIDEO_OPENGL_ES2 + return true; +#endif +} + +bool COGLColorCombiner2::Initialize(void) +{ + TRACE0("Starting Ogl 1.2/1.3 multitexture combiner" ); + if( COGLColorCombiner4::Initialize() ) + { + // For general combiner flags + m_dwGeneralMaxStages = m_supportedStages; + + m_bTxtOpAdd = m_bSupportAdd; + m_bTxtOpSub = m_bSupportSubtract; + m_bTxtOpLerp = true; + + m_bTxtOpAddSmooth = true; + m_bTxtOpBlendCurAlpha = true; + m_bTxtOpBlendDifAlpha = true; + m_bTxtOpBlendFacAlpha = true; + m_bTxtOpBlendTxtAlpha = true; + m_bTxtOpMulAdd = m_bSupportModAdd_ATI; + + return true; + } + else + { + return false; + } +} +//======================================================================== +void COGLColorCombiner4::InitCombinerCycleFill(void) +{ + for( int i=0; iEnableTexUnit(i,FALSE); + } + + //pglActiveTexture(GL_TEXTURE0_ARB); + //m_pOGLRender->EnableTexUnit(0,FALSE); + //pglActiveTexture(GL_TEXTURE1_ARB); + //m_pOGLRender->EnableTexUnit(1,FALSE); +} + +////////////////////////////////////////////////////////////////////////// +void COGLColorCombiner4::InitCombinerCycle12(void) +{ + if( !m_bOGLExtCombinerSupported ) + { + COGLColorCombiner::InitCombinerCycle12(); + return; + } + +#ifdef DEBUGGER + if( debuggerDropCombiners ) + { + UpdateCombiner(m_pDecodedMux->m_dwMux0,m_pDecodedMux->m_dwMux1); + m_vCompiledSettings.clear(); + m_dwLastMux0 = m_dwLastMux1 = 0; + debuggerDropCombiners = false; + } +#endif + + m_pOGLRender->EnableMultiTexture(); + + bool combinerIsChanged = false; + + if( m_pDecodedMux->m_dwMux0 != m_dwLastMux0 || m_pDecodedMux->m_dwMux1 != m_dwLastMux1 || m_lastIndex < 0 ) + { + combinerIsChanged = true; + m_lastIndex = FindCompiledMux(); + if( m_lastIndex < 0 ) // Can not found + { + m_lastIndex = ParseDecodedMux(); +#ifdef DEBUGGER + DisplaySimpleMuxString(); +#endif + } + + m_dwLastMux0 = m_pDecodedMux->m_dwMux0; + m_dwLastMux1 = m_pDecodedMux->m_dwMux1; + } + + + if( m_bCycleChanged || combinerIsChanged || gRDP.texturesAreReloaded || gRDP.colorsAreReloaded ) + { + if( m_bCycleChanged || combinerIsChanged ) + { + GenerateCombinerSettingConstants(m_lastIndex); + GenerateCombinerSetting(m_lastIndex); + } + else if( gRDP.colorsAreReloaded ) + { + GenerateCombinerSettingConstants(m_lastIndex); + } + + m_pOGLRender->SetAllTexelRepeatFlag(); + + gRDP.colorsAreReloaded = false; + gRDP.texturesAreReloaded = false; + } + else + { + m_pOGLRender->SetAllTexelRepeatFlag(); + } +} + +////////////////////////////////////////////////////////////////////////// +int COGLColorCombiner4::ParseDecodedMux() +{ +#define nextUnit() {unitNo++;} +#if SDL_VIDEO_OPENGL + if( m_maxTexUnits<3) + return ParseDecodedMux2Units(); + + OGLExtCombinerSaveType res; + for( int k=0; k<8; k++ ) + res.units[k].tex = -1; + + COGLDecodedMux &mux = *(COGLDecodedMux*)m_pDecodedMux; + + int unitNos[2]; + for( int rgbalpha = 0; rgbalpha<2; rgbalpha++ ) + { + unitNos[rgbalpha] = 0; + for( int cycle = 0; cycle<2; cycle++ ) + { + int &unitNo = unitNos[rgbalpha]; + OGLExtCombinerType &unit = res.units[unitNo]; + OGLExt1CombType &comb = unit.Combs[rgbalpha]; + CombinerFormatType type = m_pDecodedMux->splitType[cycle*2+rgbalpha]; + N64CombinerType &m = m_pDecodedMux->m_n64Combiners[cycle*2+rgbalpha]; + comb.arg0 = comb.arg1 = comb.arg2 = CM_IGNORE_BYTE; + + switch( type ) + { + case CM_FMT_TYPE_NOT_USED: + comb.arg0 = MUX_COMBINED; + unit.ops[rgbalpha] = GL_REPLACE; + nextUnit(); + break; + case CM_FMT_TYPE_D: // = A + comb.arg0 = m.d; + unit.ops[rgbalpha] = GL_REPLACE; + nextUnit(); + break; + case CM_FMT_TYPE_A_ADD_D: // = A+D + comb.arg0 = m.a; + comb.arg1 = m.d; + unit.ops[rgbalpha] = GL_ADD; + nextUnit(); + break; + case CM_FMT_TYPE_A_SUB_B: // = A-B + comb.arg0 = m.a; + comb.arg1 = m.b; + unit.ops[rgbalpha] = GL_SUBTRACT_ARB; + nextUnit(); + break; + case CM_FMT_TYPE_A_MOD_C: // = A*C + comb.arg0 = m.a; + comb.arg1 = m.c; + unit.ops[rgbalpha] = GL_MODULATE; + nextUnit(); + break; + case CM_FMT_TYPE_A_MOD_C_ADD_D: // = A*C+D + if( m_bSupportModAdd_ATI ) + { + comb.arg0 = m.a; + comb.arg2 = m.c; + comb.arg1 = m.d; + unit.ops[rgbalpha] = GL_MODULATE_ADD_ATI; + nextUnit(); + } + else + { + if( unitNo < m_maxTexUnits-1 ) + { + comb.arg0 = m.a; + comb.arg1 = m.c; + unit.ops[rgbalpha] = GL_MODULATE; + nextUnit(); + res.units[unitNo].Combs[rgbalpha].arg0 = MUX_COMBINED; + res.units[unitNo].Combs[rgbalpha].arg1 = m.d; + res.units[unitNo].ops[rgbalpha] = GL_ADD; + nextUnit(); + } + else + { + comb.arg0 = m.a; + comb.arg1 = m.c; + comb.arg2 = m.d; + unit.ops[rgbalpha] = GL_INTERPOLATE_ARB; + nextUnit(); + } + } + break; + case CM_FMT_TYPE_A_LERP_B_C: // = (A-B)*C+B + comb.arg0 = m.a; + comb.arg1 = m.b; + comb.arg2 = m.c; + unit.ops[rgbalpha] = GL_INTERPOLATE_ARB; + nextUnit(); + break; + case CM_FMT_TYPE_A_SUB_B_ADD_D: // = A-B+D + if( unitNo < m_maxTexUnits-1 ) + { + comb.arg0 = m.a; + comb.arg1 = m.b; + unit.ops[rgbalpha] = GL_SUBTRACT_ARB; + nextUnit(); + res.units[unitNo].Combs[rgbalpha].arg0 = MUX_COMBINED; + res.units[unitNo].Combs[rgbalpha].arg1 = m.d; + res.units[unitNo].ops[rgbalpha] = GL_ADD; + nextUnit(); + } + else + { + comb.arg0 = m.a; + comb.arg1 = m.c; + comb.arg2 = m.d; + unit.ops[rgbalpha] = GL_INTERPOLATE_ARB; + nextUnit(); + } + break; + case CM_FMT_TYPE_A_SUB_B_MOD_C: // = (A-B)*C + if( unitNo < m_maxTexUnits-1 ) + { + comb.arg0 = m.a; + comb.arg1 = m.b; + unit.ops[rgbalpha] = GL_SUBTRACT_ARB; + nextUnit(); + res.units[unitNo].Combs[rgbalpha].arg0 = MUX_COMBINED; + res.units[unitNo].Combs[rgbalpha].arg1 = m.c; + res.units[unitNo].ops[rgbalpha] = GL_MODULATE; + nextUnit(); + } + else + { + comb.arg0 = m.a; + comb.arg1 = m.c; + comb.arg2 = m.d; + unit.ops[rgbalpha] = GL_INTERPOLATE_ARB; + nextUnit(); + } + break; + case CM_FMT_TYPE_A_B_C_D: // = (A-B)*C+D + default: + if( unitNo < m_maxTexUnits-1 ) + { + comb.arg0 = m.a; + comb.arg1 = m.b; + unit.ops[rgbalpha] = GL_SUBTRACT_ARB; + nextUnit(); + if( m_bSupportModAdd_ATI ) + { + res.units[unitNo].Combs[rgbalpha].arg0 = MUX_COMBINED; + res.units[unitNo].Combs[rgbalpha].arg2 = m.c; + res.units[unitNo].Combs[rgbalpha].arg1 = m.d; + res.units[unitNo].ops[rgbalpha] = GL_MODULATE_ADD_ATI; + nextUnit(); + } + else + { + res.units[unitNo].Combs[rgbalpha].arg0 = m.a; + res.units[unitNo].Combs[rgbalpha].arg1 = m.b; + res.units[unitNo].Combs[rgbalpha].arg2 = m.c; + res.units[unitNo].ops[rgbalpha] = GL_INTERPOLATE_ARB; + nextUnit(); + } + } + else + { + comb.arg0 = m.a; + comb.arg1 = m.c; + comb.arg2 = m.d; + unit.ops[rgbalpha] = GL_INTERPOLATE_ARB; + nextUnit(); + } + break; + } + } + } + + res.numOfUnits = min(m_maxTexUnits, max(unitNos[0],unitNos[1])); + + if( unitNos[0]>m_maxTexUnits || unitNos[1]>m_maxTexUnits ) + { + TRACE0("Unit overflows"); + } + + for( int j=0; j<2; j++ ) + { + if( unitNos[j]splitType[i]; + N64CombinerType &m = m_pDecodedMux->m_n64Combiners[i]; + + comb.arg0 = comb.arg1 = comb.arg2 = MUX_0; + + switch( type ) + { + case CM_FMT_TYPE_NOT_USED: + comb.arg0 = MUX_COMBINED; + unit.ops[i%2] = GL_REPLACE; + break; + case CM_FMT_TYPE_D: // = A + comb.arg0 = m.d; + unit.ops[i%2] = GL_REPLACE; + break; +#if SDL_VIDEO_OPENGL + case CM_FMT_TYPE_A_ADD_D: // = A+D + comb.arg0 = m.a; + comb.arg1 = m.d; + unit.ops[i%2] = GL_ADD; + break; + case CM_FMT_TYPE_A_SUB_B: // = A-B + comb.arg0 = m.a; + comb.arg1 = m.b; + unit.ops[i%2] = GL_SUBTRACT_ARB; + break; + case CM_FMT_TYPE_A_MOD_C: // = A*C + comb.arg0 = m.a; + comb.arg1 = m.c; + unit.ops[i%2] = GL_MODULATE; + break; + case CM_FMT_TYPE_A_MOD_C_ADD_D: // = A*C+D + comb.arg0 = m.a; + comb.arg1 = m.c; + comb.arg2 = m.d; + unit.ops[i%2] = GL_INTERPOLATE_ARB; + break; + case CM_FMT_TYPE_A_LERP_B_C: // = (A-B)*C+B + comb.arg0 = m.a; + comb.arg1 = m.b; + comb.arg2 = m.c; + unit.ops[i%2] = GL_INTERPOLATE_ARB; + break; + case CM_FMT_TYPE_A_SUB_B_ADD_D: // = A-B+D + // fix me, to use 2 texture units + comb.arg0 = m.a; + comb.arg1 = m.b; + unit.ops[i%2] = GL_SUBTRACT_ARB; + break; + case CM_FMT_TYPE_A_SUB_B_MOD_C: // = (A-B)*C + // fix me, to use 2 texture units + comb.arg0 = m.a; + comb.arg1 = m.c; + unit.ops[i%2] = GL_MODULATE; + break; + break; + case CM_FMT_TYPE_A_B_C_D: // = (A-B)*C+D +#endif + default: + comb.arg0 = m.a; + comb.arg1 = m.b; + comb.arg2 = m.c; + unit.ops[i%2] = GL_INTERPOLATE_ARB; + break; + } + } + + if( m_pDecodedMux->splitType[2] == CM_FMT_TYPE_NOT_USED && m_pDecodedMux->splitType[3] == CM_FMT_TYPE_NOT_USED && !m_bTex1Enabled ) + { + res.numOfUnits = 1; + } + + res.units[0].tex = 0; + res.units[1].tex = 1; + + return SaveParsedResult(res); +} + +const char* COGLColorCombiner4::GetOpStr(GLenum op) +{ + switch( op ) + { + case GL_REPLACE: + return "REPLACE"; +#if SDL_VIDEO_OPENGL + case GL_MODULATE: + return "MOD"; + case GL_ADD: + return "ADD"; + case GL_ADD_SIGNED_ARB: + return "ADD_SIGNED"; + case GL_INTERPOLATE_ARB: + return "INTERPOLATE"; + case GL_SUBTRACT_ARB: + return "SUB"; +#endif + case GL_MODULATE_ADD_ATI: + return "MULADD"; + default: + return "SUB"; + } +} + +int COGLColorCombiner4::SaveParsedResult(OGLExtCombinerSaveType &result) +{ + result.dwMux0 = m_pDecodedMux->m_dwMux0; + result.dwMux1 = m_pDecodedMux->m_dwMux1; + + for( int n=0; n= GL_TEXTURE0_ARB && val <= GL_TEXTURE7_ARB ) + return true; + else + return false; +} + +int COGLColorCombiner4v2::SaveParsedResult(OGLExtCombinerSaveType &result) +{ + result.dwMux0 = m_pDecodedMux->m_dwMux0; + result.dwMux1 = m_pDecodedMux->m_dwMux1; + + int n; + + for( n=0; nm_dwMux0 && m_vCompiledSettings[i].dwMux1 == m_pDecodedMux->m_dwMux1 ) + return (int)i; + } + + return -1; +} + +//======================================================================== + +GLint COGLColorCombiner4::RGBArgsMap4[] = +{ +#if SDL_VIDEO_OPENGL + GL_PRIMARY_COLOR_ARB, //MUX_0 + GL_PRIMARY_COLOR_ARB, //MUX_1 + GL_PREVIOUS_ARB, //MUX_COMBINED, +#endif + GL_TEXTURE0_ARB, //MUX_TEXEL0, +#if SDL_VIDEO_OPENGL + GL_TEXTURE1_ARB, //MUX_TEXEL1, + GL_CONSTANT_ARB, //MUX_PRIM, + GL_PRIMARY_COLOR_ARB, //MUX_SHADE, + GL_CONSTANT_ARB, //MUX_ENV, + GL_PREVIOUS_ARB, //MUX_COMBALPHA, +#endif + GL_TEXTURE0_ARB, //MUX_T0_ALPHA, +#if SDL_VIDEO_OPENGL + GL_TEXTURE1_ARB, //MUX_T1_ALPHA, + GL_CONSTANT_ARB, //MUX_PRIM_ALPHA, + GL_PRIMARY_COLOR_ARB, //MUX_SHADE_ALPHA, + GL_CONSTANT_ARB, //MUX_ENV_ALPHA, + GL_CONSTANT_ARB, //MUX_LODFRAC, + GL_CONSTANT_ARB, //MUX_PRIMLODFRAC, + GL_PRIMARY_COLOR_ARB, //MUX_K5 + GL_PRIMARY_COLOR_ARB //MUX_UNK +#endif +}; + +GLint COGLColorCombiner4v2::RGBArgsMap4v2[] = +{ +#if SDL_VIDEO_OPENGL + GL_PRIMARY_COLOR_ARB, //MUX_0 + GL_PRIMARY_COLOR_ARB, //MUX_1 + GL_PREVIOUS_ARB, //MUX_COMBINED, +#endif + GL_TEXTURE0_ARB, //MUX_TEXEL0, +#if SDL_VIDEO_OPENGL + GL_TEXTURE1_ARB, //MUX_TEXEL1, + GL_CONSTANT_ARB, //MUX_PRIM, + GL_PRIMARY_COLOR_ARB, //MUX_SHADE, + GL_TEXTURE2_ARB, //MUX_ENV, + //{GL_TEXTURE1_ARB, }, //MUX_ENV, + GL_PREVIOUS_ARB, //MUX_COMBALPHA, + GL_TEXTURE0_ARB, //MUX_T0_ALPHA, + GL_TEXTURE1_ARB, //MUX_T1_ALPHA, + GL_CONSTANT_ARB, //MUX_PRIM_ALPHA, + GL_PRIMARY_COLOR_ARB, //MUX_SHADE_ALPHA, + GL_TEXTURE2_ARB, //MUX_ENV_ALPHA, + //{GL_TEXTURE1_ARB, }, //MUX_ENV_ALPHA, + //{GL_TEXTURE3_ARB, }, //MUX_LODFRAC, + //{GL_TEXTURE3_ARB, }, //MUX_PRIMLODFRAC, + GL_TEXTURE1_ARB, //MUX_LODFRAC, + GL_TEXTURE1_ARB, //MUX_PRIMLODFRAC, + GL_PRIMARY_COLOR_ARB, //MUX_K5 + GL_PRIMARY_COLOR_ARB //MUX_UNK +#endif +}; + +GLint COGLColorCombiner2::RGBArgsMap2[] = +{ +#if SDL_VIDEO_OPENGL + GL_PRIMARY_COLOR_ARB, //MUX_0 + GL_PRIMARY_COLOR_ARB, //MUX_1 + GL_PREVIOUS_ARB, //MUX_COMBINED, + //{GL_TEXTURE, }, //MUX_TEXEL0, + //{GL_TEXTURE, }, //MUX_TEXEL1, +#endif + GL_TEXTURE0_ARB, //MUX_TEXEL0, +#if SDL_VIDEO_OPENGL + GL_TEXTURE1_ARB, //MUX_TEXEL1, + GL_CONSTANT_ARB, //MUX_PRIM, + GL_PRIMARY_COLOR_ARB, //MUX_SHADE, + GL_CONSTANT_ARB, //MUX_ENV, + GL_PREVIOUS_ARB, //MUX_COMBALPHA, + //{GL_TEXTURE, }, //MUX_T0_ALPHA, + //{GL_TEXTURE, }, //MUX_T1_ALPHA, + GL_TEXTURE0_ARB, //MUX_TEXEL0, + GL_TEXTURE1_ARB, //MUX_TEXEL1, + GL_CONSTANT_ARB, //MUX_PRIM_ALPHA, + GL_PRIMARY_COLOR_ARB, //MUX_SHADE_ALPHA, + GL_CONSTANT_ARB, //MUX_ENV_ALPHA, + GL_CONSTANT_ARB, //MUX_LODFRAC, + GL_CONSTANT_ARB, //MUX_PRIMLODFRAC, + GL_PRIMARY_COLOR_ARB, //MUX_K5 + GL_PRIMARY_COLOR_ARB //MUX_UNK +#endif +}; + +//======================================================================== + +GLint COGLColorCombiner4::MapRGBArgs(uint8 arg) +{ + return RGBArgsMap4[arg&MUX_MASK]; +} + +GLint COGLColorCombiner4v2::MapRGBArgs(uint8 arg) +{ + return RGBArgsMap4v2[arg&MUX_MASK]; +} + +GLint COGLColorCombiner2::MapRGBArgs(uint8 arg) +{ + return RGBArgsMap2[arg&MUX_MASK]; +} + +GLint COGLColorCombiner4::MapRGBArgFlags(uint8 arg) +{ + if( (arg & MUX_ALPHAREPLICATE) && (arg & MUX_COMPLEMENT) ) + { + return GL_ONE_MINUS_SRC_ALPHA; + } + else if( (arg & MUX_ALPHAREPLICATE) ) + { + return GL_SRC_ALPHA; + } + else if(arg & MUX_COMPLEMENT) + { + return GL_ONE_MINUS_SRC_COLOR; + } + else + return GL_SRC_COLOR; +} + +GLint COGLColorCombiner4::MapAlphaArgs(uint8 arg) +{ + return RGBArgsMap4[arg&MUX_MASK]; +} + +GLint COGLColorCombiner4v2::MapAlphaArgs(uint8 arg) +{ + return RGBArgsMap4v2[arg&MUX_MASK]; +} + +GLint COGLColorCombiner2::MapAlphaArgs(uint8 arg) +{ + return RGBArgsMap2[arg&MUX_MASK]; +} + +GLint COGLColorCombiner4::MapAlphaArgFlags(uint8 arg) +{ + if(arg & MUX_COMPLEMENT) + { + return GL_ONE_MINUS_SRC_ALPHA; + } + else + return GL_SRC_ALPHA; +} + +//======================================================================== + +void ApplyFor1Unit(OGLExtCombinerType &unit) +{ +#if SDL_VIDEO_OPENGL + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, unit.rgbOp); + OPENGL_CHECK_ERRORS; + + if( unit.rgbArg0 != CM_IGNORE_BYTE ) + { + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, (unit.rgbArg0gl)); + OPENGL_CHECK_ERRORS; + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_ARB, (unit.rgbFlag0gl)); + OPENGL_CHECK_ERRORS; + } + + if( unit.rgbArg1 != CM_IGNORE_BYTE ) + { + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_ARB, (unit.rgbArg1gl)); + OPENGL_CHECK_ERRORS; + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_ARB, (unit.rgbFlag1gl)); + OPENGL_CHECK_ERRORS; + } + + if( unit.rgbArg2 != CM_IGNORE_BYTE ) + { + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_ARB, (unit.rgbArg2gl)); + OPENGL_CHECK_ERRORS; + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_ARB, (unit.rgbFlag2gl)); + OPENGL_CHECK_ERRORS; + } + + if( unit.alphaArg0 != CM_IGNORE_BYTE ) + { + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, (unit.alphaArg0gl)); + OPENGL_CHECK_ERRORS; + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, (unit.alphaFlag0gl)); + OPENGL_CHECK_ERRORS; + } + + if( unit.alphaArg1 != CM_IGNORE_BYTE ) + { + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_ARB, (unit.alphaArg1gl)); + OPENGL_CHECK_ERRORS; + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_ARB, (unit.alphaFlag1gl)); + OPENGL_CHECK_ERRORS; + } + + if( unit.alphaArg2 != CM_IGNORE_BYTE ) + { + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA_ARB, (unit.alphaArg2gl)); + OPENGL_CHECK_ERRORS; + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA_ARB, (unit.alphaFlag2gl)); + OPENGL_CHECK_ERRORS; + } +#endif +} + +////////////////////////////////////////////////////////////////////////// + +void COGLColorCombiner4::GenerateCombinerSetting(int index) +{ + OGLExtCombinerSaveType &res = m_vCompiledSettings[index]; + + // Texture unit 0 + COGLTexture* pTexture = NULL; + COGLTexture* pTexture1 = NULL; + + if( m_bTex0Enabled || m_bTex1Enabled || gRDP.otherMode.cycle_type == CYCLE_TYPE_COPY ) + { + if( m_bTex0Enabled || gRDP.otherMode.cycle_type == CYCLE_TYPE_COPY ) + { + pTexture = g_textures[gRSP.curTile].m_pCOGLTexture; + if( pTexture ) m_pOGLRender->BindTexture(pTexture->m_dwTextureName, 0); + } + if( m_bTex1Enabled ) + { + pTexture1 = g_textures[(gRSP.curTile+1)&7].m_pCOGLTexture; + if( pTexture1 ) m_pOGLRender->BindTexture(pTexture1->m_dwTextureName, 1); + } + } + + + + for( int i=0; iEnableTexUnit(i,TRUE); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); + OPENGL_CHECK_ERRORS; + ApplyFor1Unit(res.units[i]); + } + + if( res.numOfUnits < m_maxTexUnits ) + { + for( int i=res.numOfUnits; iDisBindTexture(0, i); + m_pOGLRender->EnableTexUnit(i,FALSE); + } + } +} + + +void COGLColorCombiner4::GenerateCombinerSettingConstants(int index) +{ + OGLExtCombinerSaveType &res = m_vCompiledSettings[index]; + + float *fv; + float tempf[4]; + + bool isused = true; + + if( res.primIsUsed ) + { + fv = GetPrimitiveColorfv(); // CONSTANT COLOR + } + else if( res.envIsUsed ) + { + fv = GetEnvColorfv(); // CONSTANT COLOR + } + else if( res.lodFracIsUsed ) + { + float frac = gRDP.LODFrac / 255.0f; + tempf[0] = tempf[1] = tempf[2] = tempf[3] = frac; + fv = &tempf[0]; + } + else + { + isused = false; + } + + if( isused ) + { + for( int i=0; iEnableTexUnit(2,TRUE); + TxtrCacheEntry *pEntry = gTextureManager.GetConstantColorTexture(MUX_ENV); + prender->SetCurrentTexture( (gRSP.curTile+2)%7, pEntry->pTexture, 4, 4, pEntry); + prender->SetTexelRepeatFlags((gRSP.curTile+2)%7); + } + + if( res.lodFracIsUsed) + { + int unit = 3; + if( !res.envIsUsed ) + unit = 2; + + // Set Texture unit 3 to LODFRAC + pglActiveTexture(GL_TEXTURE0_ARB+unit); + OPENGL_CHECK_ERRORS; + prender->EnableTexUnit(unit,TRUE); + TxtrCacheEntry *pEntry = gTextureManager.GetConstantColorTexture(MUX_LODFRAC); + prender->SetCurrentTexture( (gRSP.curTile+unit)%7, pEntry->pTexture, 4, 4, pEntry); + prender->SetTexelRepeatFlags((gRSP.curTile+unit)%7); + } + else + { + int unit = 3; + if( !res.envIsUsed ) + unit = 2; + + // Disable texture unit 3 + pglActiveTexture(GL_TEXTURE0_ARB+unit); + OPENGL_CHECK_ERRORS; + prender->EnableTexUnit(unit,FALSE); + prender->SetTextureToTextureUnitMap(-1,unit); + } +} + + +GLenum GeneralToGLMaps[]= +{ + GL_REPLACE, //CM_REPLACE, +#if SDL_VIDEO_OPENGL + GL_MODULATE, //CM_MODULATE, + GL_ADD, //CM_ADD, + GL_SUBTRACT_ARB, //CM_SUBTRACT, + GL_INTERPOLATE_ARB, //CM_INTERPOLATE, + GL_INTERPOLATE_ARB, //CM_ADDSMOOTH, + GL_INTERPOLATE_ARB, //CM_BLENDCURRENTALPHA + GL_INTERPOLATE_ARB, //CM_BLENDDIFFUSEALPHA + GL_INTERPOLATE_ARB, //CM_BLENDFACTORALPHA, + GL_INTERPOLATE_ARB, //CM_BLENDTEXTUREALPHA +#endif + GL_MODULATE_ADD_ATI, //CM_MULTIPLYADD, +}; + + +////////////////////////////////////////////////////////////////////////// +int COGLColorCombiner2::ParseDecodedMux() +{ + //return COGLColorCombiner4::ParseDecodedMux(); + + int generalCombinerIndex = CGeneralCombiner::FindCompiledMux(); + if( generalCombinerIndex < 0 ) // Can not found + { + generalCombinerIndex = CGeneralCombiner::ParseDecodedMux(); + } + + GeneralCombinerInfo &generalRes = m_vCompiledCombinerStages[generalCombinerIndex]; + OGLExtCombinerSaveType res; + + // Convert generalRes to OGLExtCombinerSaveType + for( int unitNo=0; unitNoSetTextureToTextureUnitMap(res.units[i].tex,i); + m_pOGLRender->EnableTexUnit(i,TRUE); + COGLTexture* pTexture = g_textures[(gRSP.curTile+res.units[i].tex)&7].m_pCOGLTexture; + if( pTexture ) m_pOGLRender->BindTexture(pTexture->m_dwTextureName, i); + } + /* + else + { + m_pOGLRender->EnableTexUnit(i,TRUE); + prender->SetTextureToTextureUnitMap(-1,i); + //m_pOGLRender->EnableTexUnit(i,FALSE); + //m_pOGLRender->DisBindTexture(0, i); + } + */ + + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); + OPENGL_CHECK_ERRORS; + ApplyFor1Unit(res.units[i]); + } + + if( res.numOfUnits < m_maxTexUnits ) + { + for( int i=res.numOfUnits; iEnableTexUnit(i,FALSE); + prender->SetTextureToTextureUnitMap(-1,i); + } + } +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLExtCombiner.h b/libmupen64plus/mupen64plus-video-rice/src/OGLExtCombiner.h new file mode 100644 index 0000000000..8281c4d562 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLExtCombiner.h @@ -0,0 +1,221 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#ifndef _OGLEXT_COMBINER_H_ +#define _OGLEXT_COMBINER_H_ + +#include + +#include "osal_opengl.h" + +#include "OGLCombiner.h" +#include "GeneralCombiner.h" + +typedef union +{ + struct { + uint8 arg0; + uint8 arg1; + uint8 arg2; + }; + uint8 args[3]; +} OGLExt1CombType; + +typedef struct { + union { + struct { + GLenum rgbOp; + GLenum alphaOp; + }; + GLenum ops[2]; + }; + + union { + struct { + uint8 rgbArg0; + uint8 rgbArg1; + uint8 rgbArg2; + uint8 alphaArg0; + uint8 alphaArg1; + uint8 alphaArg2; + }; + struct { + OGLExt1CombType rgbComb; + OGLExt1CombType alphaComb; + }; + OGLExt1CombType Combs[2]; + }; + + union { + struct { + GLint rgbArg0gl; + GLint rgbArg1gl; + GLint rgbArg2gl; + }; + GLint glRGBArgs[3]; + }; + + union { + struct { + GLint rgbFlag0gl; + GLint rgbFlag1gl; + GLint rgbFlag2gl; + }; + GLint glRGBFlags[3]; + }; + + union { + struct { + GLint alphaArg0gl; + GLint alphaArg1gl; + GLint alphaArg2gl; + }; + GLint glAlphaArgs[3]; + }; + + union { + struct { + GLint alphaFlag0gl; + GLint alphaFlag1gl; + GLint alphaFlag2gl; + }; + GLint glAlphaFlags[3]; + }; + + int tex; + bool textureIsUsed; + //float scale; //Will not be used +} OGLExtCombinerType; + +typedef struct { + uint32 dwMux0; + uint32 dwMux1; + OGLExtCombinerType units[8]; + int numOfUnits; + uint32 constantColor; + + // For 1.4 v2 combiner + bool primIsUsed; + bool envIsUsed; + bool lodFracIsUsed; +} OGLExtCombinerSaveType; + + +//======================================================================== +// OpenGL 1.4 combiner which support Texture Crossbar feature +class COGLColorCombiner4 : public COGLColorCombiner +{ +public: + bool Initialize(void); +protected: + friend class OGLDeviceBuilder; + void InitCombinerCycle12(void); + void InitCombinerCycleFill(void); + virtual void GenerateCombinerSetting(int index); + virtual void GenerateCombinerSettingConstants(int index); + virtual int ParseDecodedMux(); + + COGLColorCombiner4(CRender *pRender); + ~COGLColorCombiner4() {}; + + bool m_bOGLExtCombinerSupported; // Is this OGL extension combiner supported by the video card driver? + bool m_bSupportModAdd_ATI; + bool m_bSupportModSub_ATI; + GLint m_maxTexUnits; + int m_lastIndex; + uint32 m_dwLastMux0; + uint32 m_dwLastMux1; + +#ifdef DEBUGGER + void DisplaySimpleMuxString(void); +#endif + +protected: + virtual int SaveParsedResult(OGLExtCombinerSaveType &result); + static GLint MapRGBArgFlags(uint8 arg); + static GLint MapAlphaArgFlags(uint8 arg); + std::vector m_vCompiledSettings; + static GLint RGBArgsMap4[]; + static const char* GetOpStr(GLenum op); + +private: + virtual int ParseDecodedMux2Units(); + virtual int FindCompiledMux(); + + virtual GLint MapRGBArgs(uint8 arg); + virtual GLint MapAlphaArgs(uint8 arg); +}; + + +class COGLColorCombiner4v2 : public COGLColorCombiner4 +{ + /************************************************************************ + * Version 2 of OGL 1.4 combiner + * Will support up to 4 texture units + * Texture unit 0 and 1 are for N64 texture T0 and T1 + * Texture unit 2 and 3 will be used to map constant colors + * Constant color mapping: + * OGL constant factor: MUX_PRIM + * ARB_TEXTURE2: MUX_ENV + * ARB_TEXTURE3: MUX_LODFRAC + ************************************************************************/ +protected: + friend class OGLDeviceBuilder; + virtual void GenerateCombinerSettingConstants(int index); + virtual int SaveParsedResult(OGLExtCombinerSaveType &result); + + COGLColorCombiner4v2(CRender *pRender); + ~COGLColorCombiner4v2() {}; + + static GLint RGBArgsMap4v2[]; + +private: + virtual GLint MapRGBArgs(uint8 arg); + virtual GLint MapAlphaArgs(uint8 arg); +}; + +////////////////////////////////////////////////////////////////////////// +// OpenGL 1.2, 1.3 combiner which does not support Texture Crossbar feature +class COGLColorCombiner2 : public COGLColorCombiner4, CGeneralCombiner +{ +public: + bool Initialize(void); + +#ifdef DEBUGGER + void DisplaySimpleMuxString(void); +#endif + +protected: + friend class OGLDeviceBuilder; + + COGLColorCombiner2(CRender *pRender); + ~COGLColorCombiner2() {}; + +private: + virtual int ParseDecodedMux(); + virtual void GenerateCombinerSetting(int index); + virtual void GenerateCombinerSettingConstants(int index); + + virtual GLint MapRGBArgs(uint8 arg); + virtual GLint MapAlphaArgs(uint8 arg); + static GLint RGBArgsMap2[]; +}; + + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLExtRender.cpp b/libmupen64plus/mupen64plus-video-rice/src/OGLExtRender.cpp new file mode 100644 index 0000000000..b87c80c88f --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLExtRender.cpp @@ -0,0 +1,333 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#include "osal_opengl.h" + +#if SDL_VIDEO_OPENGL +#include "OGLExtensions.h" +#endif +#include "OGLDebug.h" +#include "OGLExtRender.h" +#include "OGLTexture.h" + +void COGLExtRender::Initialize(void) +{ + OGLRender::Initialize(); + + // Initialize multitexture + glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB,&m_maxTexUnits); + OPENGL_CHECK_ERRORS; + + for( int i=0; i<8; i++ ) + m_textureUnitMap[i] = -1; + m_textureUnitMap[0] = 0; // T0 is usually using texture unit 0 + m_textureUnitMap[1] = 1; // T1 is usually using texture unit 1 +} + + +void COGLExtRender::BindTexture(GLuint texture, int unitno) +{ + if( m_bEnableMultiTexture ) + { + if( unitno < m_maxTexUnits ) + { + if( m_curBoundTex[unitno] != texture ) + { + pglActiveTexture(GL_TEXTURE0_ARB+unitno); + OPENGL_CHECK_ERRORS; + glBindTexture(GL_TEXTURE_2D,texture); + OPENGL_CHECK_ERRORS; + m_curBoundTex[unitno] = texture; + } + } + } + else + { + OGLRender::BindTexture(texture, unitno); + } +} + +void COGLExtRender::DisBindTexture(GLuint texture, int unitno) +{ + if( m_bEnableMultiTexture ) + { + pglActiveTexture(GL_TEXTURE0_ARB+unitno); + OPENGL_CHECK_ERRORS; + glBindTexture(GL_TEXTURE_2D, 0); //Not to bind any texture + OPENGL_CHECK_ERRORS; + } + else + OGLRender::DisBindTexture(texture, unitno); +} + +void COGLExtRender::TexCoord2f(float u, float v) +{ +#if SDL_VIDEO_OPENGL + if( m_bEnableMultiTexture ) + { + for( int i=0; i<8; i++ ) + { + if( m_textureUnitMap[i] >= 0 ) + { + pglMultiTexCoord2f(GL_TEXTURE0_ARB+i, u, v); + } + } + } + else + { + OGLRender::TexCoord2f(u,v); + } +#endif +} + +void COGLExtRender::TexCoord(TLITVERTEX &vtxInfo) +{ +#if SDL_VIDEO_OPENGL + if( m_bEnableMultiTexture ) + { + for( int i=0; i<8; i++ ) + { + if( m_textureUnitMap[i] >= 0 ) + { + pglMultiTexCoord2fv(GL_TEXTURE0_ARB+i, &(vtxInfo.tcord[m_textureUnitMap[i]].u)); + } + } + } + else + { + OGLRender::TexCoord(vtxInfo); + } +#endif +} + + +void COGLExtRender::SetTexWrapS(int unitno,GLuint flag) +{ + static GLuint mflag[8]; + static GLuint mtex[8]; + if( m_curBoundTex[unitno] != mtex[unitno] || mflag[unitno] != flag ) + { + mtex[unitno] = m_curBoundTex[0]; + mflag[unitno] = flag; + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, flag); + OPENGL_CHECK_ERRORS; + } +} +void COGLExtRender::SetTexWrapT(int unitno,GLuint flag) +{ + static GLuint mflag[8]; + static GLuint mtex[8]; + if( m_curBoundTex[unitno] != mtex[unitno] || mflag[unitno] != flag ) + { + mtex[unitno] = m_curBoundTex[0]; + mflag[unitno] = flag; + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, flag); + OPENGL_CHECK_ERRORS; + } +} + +extern UVFlagMap OGLXUVFlagMaps[]; +void COGLExtRender::SetTextureUFlag(TextureUVFlag dwFlag, uint32 dwTile) +{ + TileUFlags[dwTile] = dwFlag; + if( !m_bEnableMultiTexture ) + { + OGLRender::SetTextureUFlag(dwFlag, dwTile); + return; + } + + int tex; + if( dwTile == gRSP.curTile ) + tex=0; + else if( dwTile == ((gRSP.curTile+1)&7) ) + tex=1; + else + { + if( dwTile == ((gRSP.curTile+2)&7) ) + tex=2; + else if( dwTile == ((gRSP.curTile+3)&7) ) + tex=3; + else + { + TRACE2("Incorrect tile number for OGL SetTextureUFlag: cur=%d, tile=%d", gRSP.curTile, dwTile); + return; + } + } + + for( int textureNo=0; textureNo<8; textureNo++) + { + if( m_textureUnitMap[textureNo] == tex ) + { + pglActiveTexture(GL_TEXTURE0_ARB+textureNo); + OPENGL_CHECK_ERRORS; + COGLTexture* pTexture = g_textures[(gRSP.curTile+tex)&7].m_pCOGLTexture; + if( pTexture ) + { + EnableTexUnit(textureNo,TRUE); + BindTexture(pTexture->m_dwTextureName, textureNo); + } + SetTexWrapS(textureNo, OGLXUVFlagMaps[dwFlag].realFlag); + } + } +} +void COGLExtRender::SetTextureVFlag(TextureUVFlag dwFlag, uint32 dwTile) +{ + TileVFlags[dwTile] = dwFlag; + if( !m_bEnableMultiTexture ) + { + OGLRender::SetTextureVFlag(dwFlag, dwTile); + return; + } + + int tex; + if( dwTile == gRSP.curTile ) + tex=0; + else if( dwTile == ((gRSP.curTile+1)&7) ) + tex=1; + else + { + if( dwTile == ((gRSP.curTile+2)&7) ) + tex=2; + else if( dwTile == ((gRSP.curTile+3)&7) ) + tex=3; + else + { + TRACE2("Incorrect tile number for OGL SetTextureVFlag: cur=%d, tile=%d", gRSP.curTile, dwTile); + return; + } + } + + for( int textureNo=0; textureNo<8; textureNo++) + { + if( m_textureUnitMap[textureNo] == tex ) + { + COGLTexture* pTexture = g_textures[(gRSP.curTile+tex)&7].m_pCOGLTexture; + if( pTexture ) + { + EnableTexUnit(textureNo,TRUE); + BindTexture(pTexture->m_dwTextureName, textureNo); + } + SetTexWrapT(textureNo, OGLXUVFlagMaps[dwFlag].realFlag); + } + } +} + +void COGLExtRender::EnableTexUnit(int unitno, BOOL flag) +{ + if( m_texUnitEnabled[unitno] != flag ) + { + m_texUnitEnabled[unitno] = flag; + pglActiveTexture(GL_TEXTURE0_ARB+unitno); + OPENGL_CHECK_ERRORS; + if( flag == TRUE ) + glEnable(GL_TEXTURE_2D); + else + glDisable(GL_TEXTURE_2D); + OPENGL_CHECK_ERRORS; + } +} + +void COGLExtRender::ApplyTextureFilter() +{ + static uint32 minflag[8], magflag[8]; + static uint32 mtex[8]; + + int iMinFilter, iMagFilter; + + for( int i=0; i= -1 || tex <= 1)) + m_textureUnitMap[unit] = tex; +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLExtRender.h b/libmupen64plus/mupen64plus-video-rice/src/OGLExtRender.h new file mode 100644 index 0000000000..8a8eab8f1c --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLExtRender.h @@ -0,0 +1,50 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#ifndef _OGL_EXT_RENDER_H_ +#define _OGL_EXT_RENDER_H_ + +#include "OGLRender.h" + +class COGLExtRender : public OGLRender +{ +public: + void Initialize(void); + void BindTexture(GLuint texture, int unitno); + void DisBindTexture(GLuint texture, int unitno); + void TexCoord2f(float u, float v); + void TexCoord(TLITVERTEX &vtxInfo); + void SetTextureUFlag(TextureUVFlag dwFlag, uint32 tile); + void SetTextureVFlag(TextureUVFlag dwFlag, uint32 tile); + void EnableTexUnit(int unitno, BOOL flag); + void SetTexWrapS(int unitno,GLuint flag); + void SetTexWrapT(int unitno,GLuint flag); + void ApplyTextureFilter(); + + void SetTextureToTextureUnitMap(int tex, int unit); + +protected: + friend class OGLDeviceBuilder; + COGLExtRender() {}; + ~COGLExtRender() {}; + GLint m_maxTexUnits; + int m_textureUnitMap[8]; +}; + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLExtensions.cpp b/libmupen64plus/mupen64plus-video-rice/src/OGLExtensions.cpp new file mode 100644 index 0000000000..a8897f355e --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLExtensions.cpp @@ -0,0 +1,80 @@ +/* OGLExtensions.cpp +Copyright (C) 2009 Richard Goedeken + +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. +*/ + +/* This source file contains code for assigning function pointers to some OpenGL functions */ +/* This is only necessary because Windows does not contain development support for OpenGL versions beyond 1.1 */ + +#include +#include "OGLExtensions.h" +#include "Video.h" + +static void APIENTRY EmptyFunc(void) { return; } + +bool bNvidiaExtensionsSupported = false; +PFUNCGLCOMBINERPARAMETERFVNVPROC pglCombinerParameterfvNV = (PFUNCGLCOMBINERPARAMETERFVNVPROC) EmptyFunc; +PFUNCGLFINALCOMBINERINPUTNVPROC pglFinalCombinerInputNV = (PFUNCGLFINALCOMBINERINPUTNVPROC) EmptyFunc; +PFUNCGLCOMBINEROUTPUTNVPROC pglCombinerOutputNV = (PFUNCGLCOMBINEROUTPUTNVPROC) EmptyFunc; +PFUNCGLCOMBINERINPUTNVPROC pglCombinerInputNV = (PFUNCGLCOMBINERINPUTNVPROC) EmptyFunc; +PFUNCGLCOMBINERPARAMETERINVPROC pglCombinerParameteriNV = (PFUNCGLCOMBINERPARAMETERINVPROC) EmptyFunc; + +PFUNCGLACTIVETEXTUREPROC pglActiveTexture = (PFUNCGLACTIVETEXTUREPROC) EmptyFunc; +PFUNCGLACTIVETEXTUREARBPROC pglActiveTextureARB = (PFUNCGLACTIVETEXTUREARBPROC) EmptyFunc; +PFUNCGLMULTITEXCOORD2FPROC pglMultiTexCoord2f = (PFUNCGLMULTITEXCOORD2FPROC) EmptyFunc; +PFUNCGLMULTITEXCOORD2FVPROC pglMultiTexCoord2fv = (PFUNCGLMULTITEXCOORD2FVPROC) EmptyFunc; +PFUNCGLDELETEPROGRAMSARBPROC pglDeleteProgramsARB = (PFUNCGLDELETEPROGRAMSARBPROC) EmptyFunc; +PFUNCGLPROGRAMSTRINGARBPROC pglProgramStringARB = (PFUNCGLPROGRAMSTRINGARBPROC) EmptyFunc; +PFUNCGLBINDPROGRAMARBPROC pglBindProgramARB = (PFUNCGLBINDPROGRAMARBPROC) EmptyFunc; +PFUNCGLGENPROGRAMSARBPROC pglGenProgramsARB = (PFUNCGLGENPROGRAMSARBPROC) EmptyFunc; +PFUNCGLPROGRAMENVPARAMETER4FVARBPROC pglProgramEnvParameter4fvARB = (PFUNCGLPROGRAMENVPARAMETER4FVARBPROC) EmptyFunc; +PFUNCGLFOGCOORDPOINTEREXTPROC pglFogCoordPointerEXT = (PFUNCGLFOGCOORDPOINTEREXTPROC) EmptyFunc; +PFUNCGLCLIENTACTIVETEXTUREARBPROC pglClientActiveTextureARB = (PFUNCGLCLIENTACTIVETEXTUREARBPROC) EmptyFunc; + +#define INIT_ENTRY_POINT(type, funcname) \ + p##funcname = (type) CoreVideo_GL_GetProcAddress(#funcname); \ + if (p##funcname == NULL) { DebugMessage(M64MSG_WARNING, \ + "Couldn't get address of OpenGL function: '%s'", #funcname); p##funcname = (type) EmptyFunc; } + +void OGLExtensions_Init(void) +{ + /* nvidia extensions are a special case */ + bNvidiaExtensionsSupported = true; + pglCombinerParameterfvNV = (PFUNCGLCOMBINERPARAMETERFVNVPROC) CoreVideo_GL_GetProcAddress("glCombinerParameterfvNV"); + if (pglCombinerParameterfvNV == NULL) bNvidiaExtensionsSupported = false; + pglFinalCombinerInputNV = (PFUNCGLFINALCOMBINERINPUTNVPROC) CoreVideo_GL_GetProcAddress("glFinalCombinerInputNV"); + if (pglFinalCombinerInputNV == NULL) bNvidiaExtensionsSupported = false; + pglCombinerOutputNV = (PFUNCGLCOMBINEROUTPUTNVPROC) CoreVideo_GL_GetProcAddress("glCombinerOutputNV"); + if (pglCombinerOutputNV == NULL) bNvidiaExtensionsSupported = false; + pglCombinerInputNV = (PFUNCGLCOMBINERINPUTNVPROC) CoreVideo_GL_GetProcAddress("glCombinerInputNV"); + if (pglCombinerInputNV == NULL) bNvidiaExtensionsSupported = false; + pglCombinerParameteriNV = (PFUNCGLCOMBINERPARAMETERINVPROC) CoreVideo_GL_GetProcAddress("glCombinerParameteriNV"); + if (pglCombinerParameteriNV == NULL) bNvidiaExtensionsSupported = false; + + INIT_ENTRY_POINT(PFUNCGLACTIVETEXTUREPROC, glActiveTexture); + INIT_ENTRY_POINT(PFUNCGLACTIVETEXTUREARBPROC, glActiveTextureARB); + INIT_ENTRY_POINT(PFUNCGLMULTITEXCOORD2FPROC, glMultiTexCoord2f); + INIT_ENTRY_POINT(PFUNCGLMULTITEXCOORD2FVPROC, glMultiTexCoord2fv); + INIT_ENTRY_POINT(PFUNCGLDELETEPROGRAMSARBPROC, glDeleteProgramsARB); + INIT_ENTRY_POINT(PFUNCGLPROGRAMSTRINGARBPROC, glProgramStringARB); + INIT_ENTRY_POINT(PFUNCGLBINDPROGRAMARBPROC, glBindProgramARB); + INIT_ENTRY_POINT(PFUNCGLGENPROGRAMSARBPROC, glGenProgramsARB); + INIT_ENTRY_POINT(PFUNCGLPROGRAMENVPARAMETER4FVARBPROC, glProgramEnvParameter4fvARB); + INIT_ENTRY_POINT(PFUNCGLFOGCOORDPOINTEREXTPROC, glFogCoordPointerEXT); + INIT_ENTRY_POINT(PFUNCGLCLIENTACTIVETEXTUREARBPROC, glClientActiveTextureARB); +} + + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLExtensions.h b/libmupen64plus/mupen64plus-video-rice/src/OGLExtensions.h new file mode 100644 index 0000000000..2b3cdef6bb --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLExtensions.h @@ -0,0 +1,71 @@ +/* OGLExtensions.h +Copyright (C) 2009 Richard Goedeken + +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. +*/ + +/* This header file contains function pointers to some OpenGL functions */ +/* This is only necessary because Windows does not contain development support for OpenGL versions beyond 1.1 */ + +#if !defined(OGL_EXTENSIONS_H) +#define OGL_EXTENSIONS_H + +#include + +/* Just call this one function to load up the function pointers. */ +void OGLExtensions_Init(void); + +/* The function pointer types are defined here because as of 2009 some OpenGL drivers under Linux do 'incorrect' things which + mess up the SDL_opengl.h header, resulting in no function pointer typedefs at all, and thus compilation errors. +*/ +typedef void (APIENTRYP PFUNCGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFUNCGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFUNCGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (APIENTRYP PFUNCGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFUNCGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); + +typedef void (APIENTRYP PFUNCGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFUNCGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFUNCGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFUNCGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFUNCGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFUNCGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (APIENTRYP PFUNCGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (APIENTRYP PFUNCGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFUNCGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFUNCGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFUNCGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); + +extern bool bNvidiaExtensionsSupported; +extern PFUNCGLCOMBINERPARAMETERFVNVPROC pglCombinerParameterfvNV; +extern PFUNCGLFINALCOMBINERINPUTNVPROC pglFinalCombinerInputNV; +extern PFUNCGLCOMBINEROUTPUTNVPROC pglCombinerOutputNV; +extern PFUNCGLCOMBINERINPUTNVPROC pglCombinerInputNV; +extern PFUNCGLCOMBINERPARAMETERINVPROC pglCombinerParameteriNV; + +extern PFUNCGLACTIVETEXTUREPROC pglActiveTexture; +extern PFUNCGLACTIVETEXTUREARBPROC pglActiveTextureARB; +extern PFUNCGLMULTITEXCOORD2FPROC pglMultiTexCoord2f; +extern PFUNCGLMULTITEXCOORD2FVPROC pglMultiTexCoord2fv; +extern PFUNCGLDELETEPROGRAMSARBPROC pglDeleteProgramsARB; +extern PFUNCGLPROGRAMSTRINGARBPROC pglProgramStringARB; +extern PFUNCGLBINDPROGRAMARBPROC pglBindProgramARB; +extern PFUNCGLGENPROGRAMSARBPROC pglGenProgramsARB; +extern PFUNCGLPROGRAMENVPARAMETER4FVARBPROC pglProgramEnvParameter4fvARB; +extern PFUNCGLFOGCOORDPOINTEREXTPROC pglFogCoordPointerEXT; +extern PFUNCGLCLIENTACTIVETEXTUREARBPROC pglClientActiveTextureARB; + +#endif // OGL_EXTENSIONS_H + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLFragmentShaders.cpp b/libmupen64plus/mupen64plus-video-rice/src/OGLFragmentShaders.cpp new file mode 100644 index 0000000000..8c38ba6319 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLFragmentShaders.cpp @@ -0,0 +1,487 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#include "OGLExtensions.h" +#include "OGLDebug.h" +#include "OGLFragmentShaders.h" +#include "OGLRender.h" +#include "OGLGraphicsContext.h" + +COGLFragmentShaderCombiner::COGLFragmentShaderCombiner(CRender *pRender) +: COGLColorCombiner(pRender) +{ + m_bShaderIsSupported = false; +} +COGLFragmentShaderCombiner::~COGLFragmentShaderCombiner() +{ +} + +bool COGLFragmentShaderCombiner::Initialize(void) +{ + if( !COGLColorCombiner::Initialize() ) + return false; + + COGLGraphicsContext *pcontext = (COGLGraphicsContext *)(CGraphicsContext::g_pGraphicsContext); + if( pcontext->IsExtensionSupported("GL_ARB_fragment_shader") ) + { + m_bShaderIsSupported = true; + } + + return true; +} + +void COGLFragmentShaderCombiner::InitCombinerCycle12(void) +{ +} +void COGLFragmentShaderCombiner::DisableCombiner(void) +{ + COGLColorCombiner::DisableCombiner(); +} + +void COGLFragmentShaderCombiner::InitCombinerCycleCopy(void) +{ + COGLColorCombiner::InitCombinerCycleCopy(); +} + +void COGLFragmentShaderCombiner::InitCombinerCycleFill(void) +{ + COGLColorCombiner::InitCombinerCycleFill(); +} +void COGLFragmentShaderCombiner::InitCombinerBlenderForSimpleTextureDraw(uint32 tile) +{ + COGLColorCombiner::InitCombinerBlenderForSimpleTextureDraw(tile); +} + +#ifdef DEBUGGER +void COGLFragmentShaderCombiner::DisplaySimpleMuxString(void) +{ + COGLColorCombiner::DisplaySimpleMuxString(); +} +#endif + + + +COGL_FragmentProgramCombiner::COGL_FragmentProgramCombiner(CRender *pRender) +: COGLColorCombiner4(pRender) +{ + delete m_pDecodedMux; + m_pDecodedMux = new DecodedMuxForPixelShader; + m_bFragmentProgramIsSupported = false; +} +COGL_FragmentProgramCombiner::~COGL_FragmentProgramCombiner() +{ + int size = m_vCompiledShaders.size(); + for (int i=0; iIsExtensionSupported("GL_ARB_fragment_program") ) + { + m_bFragmentProgramIsSupported = true; + } + + return true; +} + + + +void COGL_FragmentProgramCombiner::DisableCombiner(void) +{ + glDisable(GL_FRAGMENT_PROGRAM_ARB); + OPENGL_CHECK_ERRORS; + COGLColorCombiner4::DisableCombiner(); +} + +void COGL_FragmentProgramCombiner::InitCombinerCycleCopy(void) +{ + glDisable(GL_FRAGMENT_PROGRAM_ARB); + OPENGL_CHECK_ERRORS; + COGLColorCombiner4::InitCombinerCycleCopy(); +} + +void COGL_FragmentProgramCombiner::InitCombinerCycleFill(void) +{ + glDisable(GL_FRAGMENT_PROGRAM_ARB); + OPENGL_CHECK_ERRORS; + COGLColorCombiner4::InitCombinerCycleFill(); +} + +const char *muxToFP_Maps[][2] = { +//color -- alpha +{"0", "0"}, //MUX_0 = 0, +{"1", "1"}, //MUX_1, +{"comb", "comb.a"}, //MUX_COMBINED, +{"t0", "t0.a"}, //MUX_TEXEL0, +{"t1", "t1.a"}, //MUX_TEXEL1, +{"program.env[2]", "program.env[2].a"}, //MUX_PRIM, +{"fragment.color", "fragment.color.a"}, //MUX_SHADE, +{"program.env[1]", "program.env[1].a"}, //MUX_ENV, +{"comb.a", "comb.a"}, //MUX_COMBALPHA, +{"t0.a", "t0.a"}, //MUX_T0_ALPHA, +{"t1.a", "t1.a"}, //MUX_T1_ALPHA, +{"primcolor.a", "primcolor.a"}, //MUX_PRIM_ALPHA, +{"fragment.color.a", "fragment.color.a"}, //MUX_SHADE_ALPHA, +{"envcolor.a", "envcolor.a"}, //MUX_ENV_ALPHA, +{"program.env[3]", "program.env[3]"}, //MUX_LODFRAC, +{"program.env[4]", "program.env[4]"}, //MUX_PRIMLODFRAC, +{"1", "1"}, //MUX_K5, +{"1", "1"}, //MUX_UNK, // Should not be used +}; + + +const char *oglFPTest = +"!!ARBfp1.0\n" +"#Declarations\n" +"TEMP t0;\n" +"TEMP t1;\n" +"TEMP comb;\n" +"TEMP comb2;\n" +"\n" +"ATTRIB coord0 = fragment.texcoord[0];\n" +"ATTRIB coord1 = fragment.texcoord[1];\n" +"ATTRIB shade = fragment.color;\n" +"ATTRIB fogfactor = fragment.fogcoord;\n" +"\n" +"OUTPUT out = result.color;\n" +"\n" +"#Instructions\n" +"TEX t0, coord0, texture[0], 2D;\n" +"TEX t1, coord1, texture[1], 2D;\n" +"\n" +"MAD_SAT out, t0, program.env[1],program.env[0];\n" +//"SUB comb.rgb, t0, 0;\n" +//"MAD_SAT out.rgb, comb, program.env[1], 0;\n" +//"SUB comb.a, t0, 0;\n" +//"MAD_SAT out.a, comb, program.env[1], 0;\n" +"END\n"; + +char oglNewFP[4092]; + +char* MuxToOC(uint8 val) +{ +// For color channel +if( val&MUX_ALPHAREPLICATE ) + return (char*)muxToFP_Maps[val&0x1F][1]; +else + return (char*)muxToFP_Maps[val&0x1F][0]; +} + +char* MuxToOA(uint8 val) +{ +// For alpha channel +return (char*)muxToFP_Maps[val&0x1F][0]; +} + +static void CheckFpVars(uint8 MuxVar, bool &bNeedT0, bool &bNeedT1) +{ + MuxVar &= 0x1f; + if (MuxVar == MUX_TEXEL0 || MuxVar == MUX_T0_ALPHA) + bNeedT0 = true; + if (MuxVar == MUX_TEXEL1 || MuxVar == MUX_T1_ALPHA) + bNeedT1 = true; +} + +void COGL_FragmentProgramCombiner::GenerateProgramStr() +{ + DecodedMuxForPixelShader &mux = *(DecodedMuxForPixelShader*)m_pDecodedMux; + + mux.splitType[0] = mux.splitType[1] = mux.splitType[2] = mux.splitType[3] = CM_FMT_TYPE_NOT_CHECKED; + m_pDecodedMux->Reformat(false); + + char tempstr[500], newFPBody[4092]; + bool bNeedT0 = false, bNeedT1 = false, bNeedComb2 = false; + newFPBody[0] = 0; + + for( int cycle=0; cycle<2; cycle++ ) + { + for( int channel=0; channel<2; channel++) + { + char* (*func)(uint8) = channel==0?MuxToOC:MuxToOA; + char *dst = channel==0?(char*)"rgb":(char*)"a"; + N64CombinerType &m = mux.m_n64Combiners[cycle*2+channel]; + switch( mux.splitType[cycle*2+channel] ) + { + case CM_FMT_TYPE_NOT_USED: + tempstr[0] = 0; + break; + case CM_FMT_TYPE_D: + sprintf(tempstr, "MOV comb.%s, %s;\n", dst, func(m.d)); + CheckFpVars(m.d, bNeedT0, bNeedT1); + break; + case CM_FMT_TYPE_A_MOD_C: + sprintf(tempstr, "MUL comb.%s, %s, %s;\n", dst, func(m.a), func(m.c)); + CheckFpVars(m.a, bNeedT0, bNeedT1); + CheckFpVars(m.c, bNeedT0, bNeedT1); + break; + case CM_FMT_TYPE_A_ADD_D: + sprintf(tempstr, "ADD_SAT comb.%s, %s, %s;\n", dst, func(m.a), func(m.d)); + CheckFpVars(m.a, bNeedT0, bNeedT1); + CheckFpVars(m.d, bNeedT0, bNeedT1); + break; + case CM_FMT_TYPE_A_SUB_B: + sprintf(tempstr, "SUB comb.%s, %s, %s;\n", dst, func(m.a), func(m.b)); + CheckFpVars(m.a, bNeedT0, bNeedT1); + CheckFpVars(m.b, bNeedT0, bNeedT1); + break; + case CM_FMT_TYPE_A_MOD_C_ADD_D: + sprintf(tempstr, "MAD_SAT comb.%s, %s, %s, %s;\n", dst, func(m.a), func(m.c), func(m.d)); + CheckFpVars(m.a, bNeedT0, bNeedT1); + CheckFpVars(m.c, bNeedT0, bNeedT1); + CheckFpVars(m.d, bNeedT0, bNeedT1); + break; + case CM_FMT_TYPE_A_LERP_B_C: + sprintf(tempstr, "LRP_SAT comb.%s, %s, %s, %s;\n", dst, func(m.c), func(m.a), func(m.b)); + CheckFpVars(m.a, bNeedT0, bNeedT1); + CheckFpVars(m.b, bNeedT0, bNeedT1); + CheckFpVars(m.c, bNeedT0, bNeedT1); + //sprintf(tempstr, "SUB comb.%s, %s, %s;\nMAD_SAT comb.%s, comb, %s, %s;\n", dst, func(m.a), func(m.b), dst, func(m.c), func(m.b)); + break; + default: + sprintf(tempstr, "SUB comb2.%s, %s, %s;\nMAD_SAT comb.%s, comb2, %s, %s;\n", dst, func(m.a), func(m.b), dst, func(m.c), func(m.d)); + CheckFpVars(m.a, bNeedT0, bNeedT1); + CheckFpVars(m.b, bNeedT0, bNeedT1); + CheckFpVars(m.c, bNeedT0, bNeedT1); + CheckFpVars(m.d, bNeedT0, bNeedT1); + bNeedComb2 = true; + break; + } + strcat(newFPBody, tempstr); + } + } + + strcpy(oglNewFP, "!!ARBfp1.0\n"); + strcat(oglNewFP, "#Declarations\n"); + if (gRDP.bFogEnableInBlender && gRSP.bFogEnabled) + strcat(oglNewFP, "OPTION ARB_fog_linear;\n"); + if (bNeedT0) + strcat(oglNewFP, "TEMP t0;\n"); + if (bNeedT1) + strcat(oglNewFP, "TEMP t1;\n"); + strcat(oglNewFP, "TEMP comb;\n"); + if (bNeedComb2) + strcat(oglNewFP, "TEMP comb2;\n"); + strcat(oglNewFP, "#Instructions\n"); + if (bNeedT0) + strcat(oglNewFP, "TEX t0, fragment.texcoord[0], texture[0], 2D;\n"); + if (bNeedT1) + strcat(oglNewFP, "TEX t1, fragment.texcoord[1], texture[1], 2D;\n"); + strcat(oglNewFP, "# N64 cycle 1, result is in comb\n"); + + strcat(oglNewFP, newFPBody); + + strcat(oglNewFP, "MOV result.color, comb;\n"); + strcat(oglNewFP, "END\n\n"); +} + +int COGL_FragmentProgramCombiner::ParseDecodedMux() +{ + if( !m_bFragmentProgramIsSupported ) + return COGLColorCombiner4::ParseDecodedMux(); + + OGLShaderCombinerSaveType res; + + pglGenProgramsARB( 1, &res.programID); + OPENGL_CHECK_ERRORS; + pglBindProgramARB( GL_FRAGMENT_PROGRAM_ARB, res.programID); + OPENGL_CHECK_ERRORS; + GenerateProgramStr(); + + pglProgramStringARB( GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, strlen(oglNewFP), oglNewFP); + OPENGL_CHECK_ERRORS; + //pglProgramStringARB( GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, strlen(oglFPTest), oglFPTest); + + if (glGetError() != 0) + { + GLint position; +#ifdef DEBUGGER + char *str = (char*)glGetString(GL_PROGRAM_ERROR_STRING_ARB); +#endif + glGetIntegerv( GL_PROGRAM_ERROR_POSITION_ARB, &position); + if( position >= 0 ) + { +#ifdef DEBUGGER + if( m_lastIndex >= 0 ) COGLColorCombiner4::DisplaySimpleMuxString(); + DebugMessage(M64MSG_ERROR, "%s - %s", str, oglNewFP+position); +#endif + glDisable(GL_FRAGMENT_PROGRAM_ARB); + return COGLColorCombiner4::ParseDecodedMux(); + } + } + + glEnable(GL_FRAGMENT_PROGRAM_ARB); + OPENGL_CHECK_ERRORS; + res.dwMux0 = m_pDecodedMux->m_dwMux0; + res.dwMux1 = m_pDecodedMux->m_dwMux1; + res.fogIsUsed = gRDP.bFogEnableInBlender && gRSP.bFogEnabled; + + m_vCompiledShaders.push_back(res); + m_lastIndex = m_vCompiledShaders.size()-1; + + return m_lastIndex; +} + +void COGL_FragmentProgramCombiner::GenerateCombinerSetting(int index) +{ + GLuint ID = m_vCompiledShaders[index].programID; + pglBindProgramARB( GL_FRAGMENT_PROGRAM_ARB, ID ); + OPENGL_CHECK_ERRORS; + glEnable(GL_FRAGMENT_PROGRAM_ARB); + OPENGL_CHECK_ERRORS; +} + +void COGL_FragmentProgramCombiner::GenerateCombinerSettingConstants(int index) +{ + float *pf; + pf = GetEnvColorfv(); + pglProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, 1, pf); + OPENGL_CHECK_ERRORS; + pf = GetPrimitiveColorfv(); + pglProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, 2, pf); + OPENGL_CHECK_ERRORS; + + float frac = gRDP.LODFrac / 255.0f; + float tempf[4] = {frac,frac,frac,frac}; + pglProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, 3, tempf); + OPENGL_CHECK_ERRORS; + + float frac2 = gRDP.primLODFrac / 255.0f; + float tempf2[4] = {frac2,frac2,frac2,frac2}; + pglProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, 4, tempf2); + OPENGL_CHECK_ERRORS; + + float tempf3[4] = {0,0,0,0}; + pglProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, 0, tempf3); + OPENGL_CHECK_ERRORS; + pglProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, 6, tempf3); + OPENGL_CHECK_ERRORS; +} + +int COGL_FragmentProgramCombiner::FindCompiledMux() +{ +#ifdef DEBUGGER + if( debuggerDropCombiners ) + { + m_vCompiledShaders.clear(); + //m_dwLastMux0 = m_dwLastMux1 = 0; + debuggerDropCombiners = false; + } +#endif + for( uint32 i=0; im_dwMux0 + && m_vCompiledShaders[i].dwMux1 == m_pDecodedMux->m_dwMux1 + && m_vCompiledShaders[i].fogIsUsed == (gRDP.bFogEnableInBlender && gRSP.bFogEnabled) ) + return (int)i; + } + + return -1; +} + +////////////////////////////////////////////////////////////////////////// +void COGL_FragmentProgramCombiner::InitCombinerCycle12(void) +{ + if( !m_bFragmentProgramIsSupported ) + { + COGLColorCombiner4::InitCombinerCycle12(); + return; + } + +#ifdef DEBUGGER + if( debuggerDropCombiners ) + { + UpdateCombiner(m_pDecodedMux->m_dwMux0,m_pDecodedMux->m_dwMux1); + m_vCompiledShaders.clear(); + m_dwLastMux0 = m_dwLastMux1 = 0; + debuggerDropCombiners = false; + } +#endif + + m_pOGLRender->EnableMultiTexture(); + + bool combinerIsChanged = false; + + if( m_pDecodedMux->m_dwMux0 != m_dwLastMux0 || m_pDecodedMux->m_dwMux1 != m_dwLastMux1 || m_lastIndex < 0 ) + { + combinerIsChanged = true; + m_lastIndex = FindCompiledMux(); + if( m_lastIndex < 0 ) // Can not found + { + m_lastIndex = ParseDecodedMux(); + } + + m_dwLastMux0 = m_pDecodedMux->m_dwMux0; + m_dwLastMux1 = m_pDecodedMux->m_dwMux1; + } + + + GenerateCombinerSettingConstants(m_lastIndex); + if( m_bCycleChanged || combinerIsChanged || gRDP.texturesAreReloaded || gRDP.colorsAreReloaded ) + { + if( m_bCycleChanged || combinerIsChanged ) + { + GenerateCombinerSettingConstants(m_lastIndex); + GenerateCombinerSetting(m_lastIndex); + } + else if( gRDP.colorsAreReloaded ) + { + GenerateCombinerSettingConstants(m_lastIndex); + } + + m_pOGLRender->SetAllTexelRepeatFlag(); + + gRDP.colorsAreReloaded = false; + gRDP.texturesAreReloaded = false; + } + else + { + m_pOGLRender->SetAllTexelRepeatFlag(); + } +} + +#ifdef DEBUGGER +void COGL_FragmentProgramCombiner::DisplaySimpleMuxString(void) +{ + COGLColorCombiner::DisplaySimpleMuxString(); + DecodedMuxForPixelShader &mux = *(DecodedMuxForPixelShader*)m_pDecodedMux; + mux.Reformat(false); + GenerateProgramStr(); + //sprintf(oglNewFP, oglFP, + // MuxToOC(mux.aRGB0), MuxToOC(mux.bRGB0), MuxToOC(mux.cRGB0), MuxToOC(mux.dRGB0), + // MuxToOA(mux.aA0), MuxToOA(mux.bA0), MuxToOA(mux.cA0), MuxToOA(mux.dA0), + // MuxToOC(mux.aRGB1), MuxToOC(mux.bRGB1), MuxToOC(mux.cRGB1), MuxToOC(mux.dRGB1), + // MuxToOA(mux.aA1), MuxToOA(mux.bA1), MuxToOA(mux.cA1), MuxToOA(mux.dA1) + // ); + + TRACE0("OGL Fragment Program:"); + TRACE0(oglNewFP); +} +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLFragmentShaders.h b/libmupen64plus/mupen64plus-video-rice/src/OGLFragmentShaders.h new file mode 100644 index 0000000000..4f98f4f1cc --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLFragmentShaders.h @@ -0,0 +1,99 @@ +/* +Copyright (C) 2005 Rice1964 + +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. +*/ + +#ifndef _OGL_FRAGMENT_SHADER_H_ +#define _OGL_FRAGMENT_SHADER_H_ + +#include + +#include + +#include "OGLCombiner.h" +#include "OGLExtCombiner.h" +#include "GeneralCombiner.h" + +typedef struct { + uint32 dwMux0; + uint32 dwMux1; + + bool fogIsUsed; + GLuint programID; +} OGLShaderCombinerSaveType; + + +class COGL_FragmentProgramCombiner : public COGLColorCombiner4 +{ +public: + bool Initialize(void); + +protected: + friend class OGLDeviceBuilder; + + void DisableCombiner(void); + void InitCombinerCycleCopy(void); + void InitCombinerCycleFill(void); + void InitCombinerCycle12(void); + + COGL_FragmentProgramCombiner(CRender *pRender); + ~COGL_FragmentProgramCombiner(); + + bool m_bFragmentProgramIsSupported; + std::vector m_vCompiledShaders; + +private: + virtual int ParseDecodedMux(); + virtual void GenerateProgramStr(); + int FindCompiledMux(); + virtual void GenerateCombinerSetting(int index); + virtual void GenerateCombinerSettingConstants(int index); + +#ifdef DEBUGGER + void DisplaySimpleMuxString(void); +#endif + +}; + + + +class COGLFragmentShaderCombiner : public COGLColorCombiner +{ +public: + bool Initialize(void); + void InitCombinerBlenderForSimpleTextureDraw(uint32 tile=0); +protected: + friend class OGLDeviceBuilder; + + void DisableCombiner(void); + void InitCombinerCycleCopy(void); + void InitCombinerCycleFill(void); + void InitCombinerCycle12(void); + + COGLFragmentShaderCombiner(CRender *pRender); + ~COGLFragmentShaderCombiner(); + + bool m_bShaderIsSupported; + +#ifdef DEBUGGER + void DisplaySimpleMuxString(void); +#endif + +}; + + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLGraphicsContext.cpp b/libmupen64plus/mupen64plus-video-rice/src/OGLGraphicsContext.cpp new file mode 100644 index 0000000000..2e84bb6c52 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLGraphicsContext.cpp @@ -0,0 +1,472 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#include "osal_opengl.h" + +#define M64P_PLUGIN_PROTOTYPES 1 +#include "m64p_plugin.h" +#include "Config.h" +#include "Debugger.h" +#if SDL_VIDEO_OPENGL +#include "OGLExtensions.h" +#endif +#include "OGLDebug.h" +#include "OGLGraphicsContext.h" +#include "TextureManager.h" +#include "Video.h" +#include "version.h" + +COGLGraphicsContext::COGLGraphicsContext() : + m_bSupportMultiTexture(false), + m_bSupportTextureEnvCombine(false), + m_bSupportSeparateSpecularColor(false), + m_bSupportSecondColor(false), + m_bSupportFogCoord(false), + m_bSupportTextureObject(false), + m_bSupportRescaleNormal(false), + m_bSupportLODBias(false), + m_bSupportTextureMirrorRepeat(false), + m_bSupportTextureLOD(false), + m_bSupportNVRegisterCombiner(false), + m_bSupportBlendColor(false), + m_bSupportBlendSubtract(false), + m_bSupportNVTextureEnvCombine4(false), + m_pVendorStr(NULL), + m_pRenderStr(NULL), + m_pExtensionStr(NULL), + m_pVersionStr(NULL) +{ +} + + +COGLGraphicsContext::~COGLGraphicsContext() +{ +} + +bool COGLGraphicsContext::Initialize(uint32 dwWidth, uint32 dwHeight, BOOL bWindowed ) +{ + DebugMessage(M64MSG_INFO, "Initializing OpenGL Device Context."); + Lock(); + + CGraphicsContext::Get()->m_supportTextureMirror = false; + CGraphicsContext::Initialize(dwWidth, dwHeight, bWindowed ); + + if( bWindowed ) + { + windowSetting.statusBarHeightToUse = windowSetting.statusBarHeight; + windowSetting.toolbarHeightToUse = windowSetting.toolbarHeight; + } + else + { + windowSetting.statusBarHeightToUse = 0; + windowSetting.toolbarHeightToUse = 0; + } + + int depthBufferDepth = options.OpenglDepthBufferSetting; + int colorBufferDepth = 32; + int bVerticalSync = windowSetting.bVerticalSync; + if( options.colorQuality == TEXTURE_FMT_A4R4G4B4 ) colorBufferDepth = 16; + + // init sdl & gl + DebugMessage(M64MSG_VERBOSE, "Initializing video subsystem..."); + if (CoreVideo_Init() != M64ERR_SUCCESS) + return false; + + /* hard-coded attribute values */ + const int iDOUBLEBUFFER = 1; + + /* set opengl attributes */ + CoreVideo_GL_SetAttribute(M64P_GL_DOUBLEBUFFER, iDOUBLEBUFFER); + CoreVideo_GL_SetAttribute(M64P_GL_SWAP_CONTROL, bVerticalSync); + CoreVideo_GL_SetAttribute(M64P_GL_BUFFER_SIZE, colorBufferDepth); + CoreVideo_GL_SetAttribute(M64P_GL_DEPTH_SIZE, depthBufferDepth); + + /* set multisampling */ + if (options.multiSampling > 0) + { + CoreVideo_GL_SetAttribute(M64P_GL_MULTISAMPLEBUFFERS, 1); + if (options.multiSampling <= 2) + CoreVideo_GL_SetAttribute(M64P_GL_MULTISAMPLESAMPLES, 2); + else if (options.multiSampling <= 4) + CoreVideo_GL_SetAttribute(M64P_GL_MULTISAMPLESAMPLES, 4); + else if (options.multiSampling <= 8) + CoreVideo_GL_SetAttribute(M64P_GL_MULTISAMPLESAMPLES, 8); + else + CoreVideo_GL_SetAttribute(M64P_GL_MULTISAMPLESAMPLES, 16); + } + + /* Set the video mode */ + m64p_video_mode ScreenMode = bWindowed ? M64VIDEO_WINDOWED : M64VIDEO_FULLSCREEN; + if (CoreVideo_SetVideoMode(windowSetting.uDisplayWidth, windowSetting.uDisplayHeight, colorBufferDepth, ScreenMode) != M64ERR_SUCCESS) + { + DebugMessage(M64MSG_ERROR, "Failed to set %i-bit video mode: %ix%i", colorBufferDepth, (int)windowSetting.uDisplayWidth, (int)windowSetting.uDisplayHeight); + CoreVideo_Quit(); + return false; + } + + /* check that our opengl attributes were properly set */ + int iActual; + if (CoreVideo_GL_GetAttribute(M64P_GL_DOUBLEBUFFER, &iActual) == M64ERR_SUCCESS) + if (iActual != iDOUBLEBUFFER) + DebugMessage(M64MSG_WARNING, "Failed to set GL_DOUBLEBUFFER to %i. (it's %i)", iDOUBLEBUFFER, iActual); + if (CoreVideo_GL_GetAttribute(M64P_GL_SWAP_CONTROL, &iActual) == M64ERR_SUCCESS) + if (iActual != bVerticalSync) + DebugMessage(M64MSG_WARNING, "Failed to set GL_SWAP_CONTROL to %i. (it's %i)", bVerticalSync, iActual); + if (CoreVideo_GL_GetAttribute(M64P_GL_BUFFER_SIZE, &iActual) == M64ERR_SUCCESS) + if (iActual != colorBufferDepth) + DebugMessage(M64MSG_WARNING, "Failed to set GL_BUFFER_SIZE to %i. (it's %i)", colorBufferDepth, iActual); + if (CoreVideo_GL_GetAttribute(M64P_GL_DEPTH_SIZE, &iActual) == M64ERR_SUCCESS) + if (iActual != depthBufferDepth) + DebugMessage(M64MSG_WARNING, "Failed to set GL_DEPTH_SIZE to %i. (it's %i)", depthBufferDepth, iActual); + +#if SDL_VIDEO_OPENGL + /* Get function pointers to OpenGL extensions (blame Microsoft Windows for this) */ + OGLExtensions_Init(); +#endif + + char caption[500]; + sprintf(caption, "%s v%i.%i.%i", PLUGIN_NAME, VERSION_PRINTF_SPLIT(PLUGIN_VERSION)); + CoreVideo_SetCaption(caption); + SetWindowMode(); + + InitState(); + InitOGLExtension(); + sprintf(m_strDeviceStats, "%.60s - %.128s : %.60s", m_pVendorStr, m_pRenderStr, m_pVersionStr); + TRACE0(m_strDeviceStats); + DebugMessage(M64MSG_INFO, "Using OpenGL: %s", m_strDeviceStats); + + Unlock(); + + Clear(CLEAR_COLOR_AND_DEPTH_BUFFER); // Clear buffers + UpdateFrame(); + Clear(CLEAR_COLOR_AND_DEPTH_BUFFER); + UpdateFrame(); + + m_bReady = true; + status.isVertexShaderEnabled = false; + + return true; +} + +void COGLGraphicsContext::InitState(void) +{ + m_pRenderStr = glGetString(GL_RENDERER); + m_pExtensionStr = glGetString(GL_EXTENSIONS); + m_pVersionStr = glGetString(GL_VERSION); + m_pVendorStr = glGetString(GL_VENDOR); + glMatrixMode(GL_PROJECTION); + OPENGL_CHECK_ERRORS; + glLoadIdentity(); + OPENGL_CHECK_ERRORS; + + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + OPENGL_CHECK_ERRORS; + glClearDepth(1.0f); + OPENGL_CHECK_ERRORS; + +#if SDL_VIDEO_OPENGL + glShadeModel(GL_SMOOTH); + OPENGL_CHECK_ERRORS; + + //position viewer + //glMatrixMode(GL_MODELVIEW); + //glLoadIdentity(); + + glDisable(GL_ALPHA_TEST); + OPENGL_CHECK_ERRORS; +#endif + + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + OPENGL_CHECK_ERRORS; + glDisable(GL_BLEND); + OPENGL_CHECK_ERRORS; + + glFrontFace(GL_CCW); + OPENGL_CHECK_ERRORS; + glDisable(GL_CULL_FACE); + OPENGL_CHECK_ERRORS; +#if SDL_VIDEO_OPENGL + glDisable(GL_NORMALIZE); + OPENGL_CHECK_ERRORS; +#endif + + glDepthFunc(GL_LEQUAL); + OPENGL_CHECK_ERRORS; + glEnable(GL_DEPTH_TEST); + OPENGL_CHECK_ERRORS; + +#if SDL_VIDEO_OPENGL + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); + OPENGL_CHECK_ERRORS; +#endif + + glEnable(GL_BLEND); + OPENGL_CHECK_ERRORS; +#if SDL_VIDEO_OPENGL + glEnable(GL_ALPHA_TEST); + OPENGL_CHECK_ERRORS; + + glMatrixMode(GL_PROJECTION); + OPENGL_CHECK_ERRORS; + glLoadIdentity(); + OPENGL_CHECK_ERRORS; + + glDepthRange(-1, 1); + +#elif SDL_VIDEO_OPENGL_ES2 + glDepthRangef(0.0f, 1.0f); +#endif + OPENGL_CHECK_ERRORS; +} + +void COGLGraphicsContext::InitOGLExtension(void) +{ + // important extension features, it is very bad not to have these feature + m_bSupportMultiTexture = IsExtensionSupported(OSAL_GL_ARB_MULTITEXTURE); + m_bSupportTextureEnvCombine = IsExtensionSupported("GL_EXT_texture_env_combine"); + + m_bSupportSeparateSpecularColor = IsExtensionSupported("GL_EXT_separate_specular_color"); + m_bSupportSecondColor = IsExtensionSupported("GL_EXT_secondary_color"); + m_bSupportFogCoord = IsExtensionSupported("GL_EXT_fog_coord"); + m_bSupportTextureObject = IsExtensionSupported("GL_EXT_texture_object"); + + // Optional extension features + m_bSupportRescaleNormal = IsExtensionSupported("GL_EXT_rescale_normal"); + m_bSupportLODBias = IsExtensionSupported("GL_EXT_texture_lod_bias"); + m_bSupportAnisotropicFiltering = IsExtensionSupported("GL_EXT_texture_filter_anisotropic"); + + // Compute maxAnisotropicFiltering + m_maxAnisotropicFiltering = 0; + + if( m_bSupportAnisotropicFiltering + && (options.anisotropicFiltering == 2 + || options.anisotropicFiltering == 4 + || options.anisotropicFiltering == 8 + || options.anisotropicFiltering == 16)) + { + //Get the max value of aniso that the graphic card support + glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &m_maxAnisotropicFiltering); + OPENGL_CHECK_ERRORS; + + // If user want more aniso than hardware can do + if(options.anisotropicFiltering > (uint32) m_maxAnisotropicFiltering) + { + DebugMessage(M64MSG_INFO, "A value of '%i' is set for AnisotropicFiltering option but the hardware has a maximum value of '%i' so this will be used", options.anisotropicFiltering, m_maxAnisotropicFiltering); + } + + //check if user want less anisotropy than hardware can do + if((uint32) m_maxAnisotropicFiltering > options.anisotropicFiltering) + m_maxAnisotropicFiltering = options.anisotropicFiltering; + } + + // Nvidia only extension features (optional) + m_bSupportNVRegisterCombiner = IsExtensionSupported("GL_NV_register_combiners"); + m_bSupportTextureMirrorRepeat = IsExtensionSupported("GL_IBM_texture_mirrored_repeat") || IsExtensionSupported("ARB_texture_mirrored_repeat"); + m_supportTextureMirror = m_bSupportTextureMirrorRepeat; + m_bSupportTextureLOD = IsExtensionSupported("GL_EXT_texture_lod"); + m_bSupportBlendColor = IsExtensionSupported("GL_EXT_blend_color"); + m_bSupportBlendSubtract = IsExtensionSupported("GL_EXT_blend_subtract"); + m_bSupportNVTextureEnvCombine4 = IsExtensionSupported("GL_NV_texture_env_combine4"); + +} + +bool COGLGraphicsContext::IsExtensionSupported(const char* pExtName) +{ + if (strstr((const char*)m_pExtensionStr, pExtName) != NULL) + { + DebugMessage(M64MSG_VERBOSE, "OpenGL Extension '%s' is supported.", pExtName); + return true; + } + else + { + DebugMessage(M64MSG_VERBOSE, "OpenGL Extension '%s' is NOT supported.", pExtName); + return false; + } +} + +bool COGLGraphicsContext::IsWglExtensionSupported(const char* pExtName) +{ + if( m_pWglExtensionStr == NULL ) + return false; + + if( strstr((const char*)m_pWglExtensionStr, pExtName) != NULL ) + return true; + else + return false; +} + + +void COGLGraphicsContext::CleanUp() +{ + CoreVideo_Quit(); + m_bReady = false; +} + + +void COGLGraphicsContext::Clear(ClearFlag dwFlags, uint32 color, float depth) +{ + uint32 flag=0; + if( dwFlags&CLEAR_COLOR_BUFFER ) flag |= GL_COLOR_BUFFER_BIT; + if( dwFlags&CLEAR_DEPTH_BUFFER ) flag |= GL_DEPTH_BUFFER_BIT; + + float r = ((color>>16)&0xFF)/255.0f; + float g = ((color>> 8)&0xFF)/255.0f; + float b = ((color )&0xFF)/255.0f; + float a = ((color>>24)&0xFF)/255.0f; + glClearColor(r, g, b, a); + OPENGL_CHECK_ERRORS; + glClearDepth(depth); + OPENGL_CHECK_ERRORS; + glClear(flag); //Clear color buffer and depth buffer + OPENGL_CHECK_ERRORS; +} + +void COGLGraphicsContext::UpdateFrame(bool swaponly) +{ + status.gFrameCount++; + + glFlush(); + OPENGL_CHECK_ERRORS; + //glFinish(); + //wglSwapIntervalEXT(0); + + /* + if (debuggerPauseCount == countToPause) + { + static int iShotNum = 0; + // get width, height, allocate buffer to store image + int width = windowSetting.uDisplayWidth; + int height = windowSetting.uDisplayHeight; + printf("Saving debug images: width=%i height=%i\n", width, height); + short *buffer = (short *) malloc(((width+3)&~3)*(height+1)*4); + glReadBuffer( GL_FRONT ); + // set up a BMGImage struct + struct BMGImageStruct img; + memset(&img, 0, sizeof(BMGImageStruct)); + InitBMGImage(&img); + img.bits = (unsigned char *) buffer; + img.bits_per_pixel = 32; + img.height = height; + img.width = width; + img.scan_width = width * 4; + // store the RGB color image + char chFilename[64]; + sprintf(chFilename, "dbg_rgb_%03i.png", iShotNum); + glReadPixels(0,0,width,height, GL_BGRA, GL_UNSIGNED_BYTE, buffer); + WritePNG(chFilename, img); + // store the Z buffer + sprintf(chFilename, "dbg_Z_%03i.png", iShotNum); + glReadPixels(0,0,width,height, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, buffer); + //img.bits_per_pixel = 16; + //img.scan_width = width * 2; + WritePNG(chFilename, img); + // dump a subset of the Z data + for (int y = 0; y < 480; y += 16) + { + for (int x = 0; x < 640; x+= 16) + printf("%4hx ", buffer[y*640 + x]); + printf("\n"); + } + printf("\n"); + // free memory and get out of here + free(buffer); + iShotNum++; + } + */ + + + // if emulator defined a render callback function, call it before buffer swap + if(renderCallback) + (*renderCallback)(status.bScreenIsDrawn); + + CoreVideo_GL_SwapBuffers(); + + /*if(options.bShowFPS) + { + static unsigned int lastTick=0; + static int frames=0; + unsigned int nowTick = SDL_GetTicks(); + frames++; + if(lastTick + 5000 <= nowTick) + { + char caption[200]; + sprintf(caption, "%s v%i.%i.%i - %.3f VI/S", PLUGIN_NAME, VERSION_PRINTF_SPLIT(PLUGIN_VERSION), frames/5.0); + CoreVideo_SetCaption(caption); + frames = 0; + lastTick = nowTick; + } + }*/ + + glDepthMask(GL_TRUE); + OPENGL_CHECK_ERRORS; + glClearDepth(1.0f); + OPENGL_CHECK_ERRORS; + if( !g_curRomInfo.bForceScreenClear ) + { + glClear(GL_DEPTH_BUFFER_BIT); + OPENGL_CHECK_ERRORS; + } + else + needCleanScene = true; + + status.bScreenIsDrawn = false; +} + +bool COGLGraphicsContext::SetFullscreenMode() +{ + windowSetting.statusBarHeightToUse = 0; + windowSetting.toolbarHeightToUse = 0; + return true; +} + +bool COGLGraphicsContext::SetWindowMode() +{ + windowSetting.statusBarHeightToUse = windowSetting.statusBarHeight; + windowSetting.toolbarHeightToUse = windowSetting.toolbarHeight; + return true; +} +int COGLGraphicsContext::ToggleFullscreen() +{ + if (CoreVideo_ToggleFullScreen() == M64ERR_SUCCESS) + { + m_bWindowed = !m_bWindowed; + if(m_bWindowed) + SetWindowMode(); + else + SetFullscreenMode(); + } + + return m_bWindowed?0:1; +} + +// This is a static function, will be called when the plugin DLL is initialized +void COGLGraphicsContext::InitDeviceParameters() +{ + status.isVertexShaderEnabled = false; // Disable it for now +} + +// Get methods +bool COGLGraphicsContext::IsSupportAnisotropicFiltering() +{ + return m_bSupportAnisotropicFiltering; +} + +int COGLGraphicsContext::getMaxAnisotropicFiltering() +{ + return m_maxAnisotropicFiltering; +} diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLGraphicsContext.h b/libmupen64plus/mupen64plus-video-rice/src/OGLGraphicsContext.h new file mode 100644 index 0000000000..a16d152e6d --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLGraphicsContext.h @@ -0,0 +1,91 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#ifndef _OGL_CONTEXT_H_ +#define _OGL_CONTEXT_H_ + +#include "typedefs.h" +#include "GraphicsContext.h" + +class COGLGraphicsContext : public CGraphicsContext +{ + friend class OGLRender; + friend class COGLRenderTexture; +public: + virtual ~COGLGraphicsContext(); + + bool Initialize(uint32 dwWidth, uint32 dwHeight, BOOL bWindowed ); + void CleanUp(); + void Clear(ClearFlag dwFlags, uint32 color=0xFF000000, float depth=1.0f); + + void UpdateFrame(bool swaponly=false); + int ToggleFullscreen(); // return 0 as the result is windowed + + bool IsExtensionSupported(const char* pExtName); + bool IsWglExtensionSupported(const char* pExtName); + static void InitDeviceParameters(); + + //Get methods (TODO, remove all friend class and use get methods instead) + bool IsSupportAnisotropicFiltering(); + int getMaxAnisotropicFiltering(); + +protected: + friend class OGLDeviceBuilder; + COGLGraphicsContext(); + void InitState(void); + void InitOGLExtension(void); + bool SetFullscreenMode(); + bool SetWindowMode(); + + // Important OGL extension features + bool m_bSupportMultiTexture; + bool m_bSupportTextureEnvCombine; + bool m_bSupportSeparateSpecularColor; + bool m_bSupportSecondColor; + bool m_bSupportFogCoord; + bool m_bSupportTextureObject; + + // Optional OGL extension features; + bool m_bSupportRescaleNormal; + bool m_bSupportLODBias; + bool m_bSupportAnisotropicFiltering; + int m_maxAnisotropicFiltering; + + // Nvidia OGL only features + bool m_bSupportTextureMirrorRepeat; + bool m_bSupportTextureLOD; + bool m_bSupportNVRegisterCombiner; + bool m_bSupportBlendColor; + bool m_bSupportBlendSubtract; + bool m_bSupportNVTextureEnvCombine4; + + // Minimal requirements, I will even not check them at runtime + //bool m_bSupportTextureEnvAdd; + //bool m_bSupportVertexArray; + + const unsigned char* m_pVendorStr; + const unsigned char* m_pRenderStr; + const unsigned char* m_pExtensionStr; + const char* m_pWglExtensionStr; + const unsigned char* m_pVersionStr; +}; + +#endif + + + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLRender.cpp b/libmupen64plus/mupen64plus-video-rice/src/OGLRender.cpp new file mode 100644 index 0000000000..792c4bf841 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLRender.cpp @@ -0,0 +1,1278 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#include "osal_opengl.h" + +#if SDL_VIDEO_OPENGL +#include "OGLExtensions.h" +#elif SDL_VIDEO_OPENGL_ES2 +#include "OGLES2FragmentShaders.h" +#endif +#include "OGLDebug.h" +#include "OGLRender.h" +#include "OGLGraphicsContext.h" +#include "OGLTexture.h" +#include "TextureManager.h" + +// FIXME: Use OGL internal L/T and matrix stack +// FIXME: Use OGL lookupAt function +// FIXME: Use OGL DisplayList + +UVFlagMap OGLXUVFlagMaps[] = +{ + {TEXTURE_UV_FLAG_WRAP, GL_REPEAT}, + {TEXTURE_UV_FLAG_MIRROR, GL_MIRRORED_REPEAT_ARB}, + {TEXTURE_UV_FLAG_CLAMP, GL_CLAMP}, +}; + +#if SDL_VIDEO_OPENGL_ES2 + static GLuint disabledTextureID; +#endif + +//=================================================================== +OGLRender::OGLRender() +{ + COGLGraphicsContext *pcontext = (COGLGraphicsContext *)(CGraphicsContext::g_pGraphicsContext); + m_bSupportFogCoordExt = pcontext->m_bSupportFogCoord; + m_bMultiTexture = pcontext->m_bSupportMultiTexture; + m_bSupportClampToEdge = false; + for( int i=0; i<8; i++ ) + { + m_curBoundTex[i]=0; + m_texUnitEnabled[i]=FALSE; + } + +#if SDL_VIDEO_OPENGL + m_bEnableMultiTexture = false; + +#elif SDL_VIDEO_OPENGL_ES2 + m_bEnableMultiTexture = true; + + //Create a texture as replacement for glEnable/Disable(GL_TEXTURE_2D) + TLITVERTEX white; + white.r = white.g = white.b = 0; + white.a = 0; + glGenTextures(1,&disabledTextureID); + OPENGL_CHECK_ERRORS; + glBindTexture(GL_TEXTURE_2D, disabledTextureID); + OPENGL_CHECK_ERRORS; + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + OPENGL_CHECK_ERRORS; + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, &white.dcDiffuse); + OPENGL_CHECK_ERRORS; +#endif +} + +OGLRender::~OGLRender() +{ + ClearDeviceObjects(); +} + +bool OGLRender::InitDeviceObjects() +{ + // enable Z-buffer by default + ZBufferEnable(true); + return true; +} + +bool OGLRender::ClearDeviceObjects() +{ + return true; +} + +void OGLRender::Initialize(void) +{ + glMatrixMode(GL_MODELVIEW); + OPENGL_CHECK_ERRORS; + glLoadIdentity(); + OPENGL_CHECK_ERRORS; + + glViewportWrapper(0, windowSetting.statusBarHeightToUse, windowSetting.uDisplayWidth, windowSetting.uDisplayHeight); + OPENGL_CHECK_ERRORS; + +#if SDL_VIDEO_OPENGL + COGLGraphicsContext *pcontext = (COGLGraphicsContext *)(CGraphicsContext::g_pGraphicsContext); + if( pcontext->IsExtensionSupported("GL_IBM_texture_mirrored_repeat") ) + { + OGLXUVFlagMaps[TEXTURE_UV_FLAG_MIRROR].realFlag = GL_MIRRORED_REPEAT_IBM; + } + else if( pcontext->IsExtensionSupported("ARB_texture_mirrored_repeat") ) + { + OGLXUVFlagMaps[TEXTURE_UV_FLAG_MIRROR].realFlag = GL_MIRRORED_REPEAT_ARB; + } + else + { + OGLXUVFlagMaps[TEXTURE_UV_FLAG_MIRROR].realFlag = GL_REPEAT; + } + + if( pcontext->IsExtensionSupported("GL_ARB_texture_border_clamp") || pcontext->IsExtensionSupported("GL_EXT_texture_edge_clamp") ) + { + m_bSupportClampToEdge = true; + OGLXUVFlagMaps[TEXTURE_UV_FLAG_CLAMP].realFlag = GL_CLAMP_TO_EDGE; + } + else + { + m_bSupportClampToEdge = false; + OGLXUVFlagMaps[TEXTURE_UV_FLAG_CLAMP].realFlag = GL_CLAMP; + } + + glVertexPointer( 4, GL_FLOAT, sizeof(float)*5, &(g_vtxProjected5[0][0]) ); + OPENGL_CHECK_ERRORS; + glEnableClientState( GL_VERTEX_ARRAY ); + OPENGL_CHECK_ERRORS; + + if( m_bMultiTexture ) + { + pglClientActiveTextureARB( GL_TEXTURE0_ARB ); + OPENGL_CHECK_ERRORS; + glTexCoordPointer( 2, GL_FLOAT, sizeof( TLITVERTEX ), &(g_vtxBuffer[0].tcord[0].u) ); + OPENGL_CHECK_ERRORS; + glEnableClientState( GL_TEXTURE_COORD_ARRAY ); + OPENGL_CHECK_ERRORS; + + pglClientActiveTextureARB( GL_TEXTURE1_ARB ); + OPENGL_CHECK_ERRORS; + glTexCoordPointer( 2, GL_FLOAT, sizeof( TLITVERTEX ), &(g_vtxBuffer[0].tcord[1].u) ); + OPENGL_CHECK_ERRORS; + glEnableClientState( GL_TEXTURE_COORD_ARRAY ); + OPENGL_CHECK_ERRORS; + } + else + { + glTexCoordPointer( 2, GL_FLOAT, sizeof( TLITVERTEX ), &(g_vtxBuffer[0].tcord[0].u) ); + OPENGL_CHECK_ERRORS; + glEnableClientState( GL_TEXTURE_COORD_ARRAY ); + OPENGL_CHECK_ERRORS; + } + + if (m_bSupportFogCoordExt) + { + pglFogCoordPointerEXT( GL_FLOAT, sizeof(float)*5, &(g_vtxProjected5[0][4]) ); + OPENGL_CHECK_ERRORS; + glEnableClientState( GL_FOG_COORDINATE_ARRAY_EXT ); + OPENGL_CHECK_ERRORS; + glFogi( GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT ); + OPENGL_CHECK_ERRORS; + glFogi(GL_FOG_MODE, GL_LINEAR); // Fog Mode + OPENGL_CHECK_ERRORS; + glFogf(GL_FOG_DENSITY, 1.0f); // How Dense Will The Fog Be + OPENGL_CHECK_ERRORS; + glHint(GL_FOG_HINT, GL_FASTEST); // Fog Hint Value + OPENGL_CHECK_ERRORS; + glFogi( GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT ); + OPENGL_CHECK_ERRORS; + glFogf( GL_FOG_START, 0.0f ); + OPENGL_CHECK_ERRORS; + glFogf( GL_FOG_END, 1.0f ); + OPENGL_CHECK_ERRORS; + } + + //glColorPointer( 1, GL_UNSIGNED_BYTE, sizeof(TLITVERTEX), &g_vtxBuffer[0].r); + glColorPointer( 4, GL_UNSIGNED_BYTE, sizeof(uint8)*4, &(g_oglVtxColors[0][0]) ); + OPENGL_CHECK_ERRORS; + glEnableClientState( GL_COLOR_ARRAY ); + OPENGL_CHECK_ERRORS; + + if( pcontext->IsExtensionSupported("GL_NV_depth_clamp") ) + { + glEnable(GL_DEPTH_CLAMP_NV); + OPENGL_CHECK_ERRORS; + } + +#elif SDL_VIDEO_OPENGL_ES2 + OGLXUVFlagMaps[TEXTURE_UV_FLAG_MIRROR].realFlag = GL_MIRRORED_REPEAT; + m_bSupportClampToEdge = true; + OGLXUVFlagMaps[TEXTURE_UV_FLAG_CLAMP].realFlag = GL_CLAMP_TO_EDGE; +#endif +} +//=================================================================== +TextureFilterMap OglTexFilterMap[2]= +{ + {FILTER_POINT, GL_NEAREST}, + {FILTER_LINEAR, GL_LINEAR}, +}; + +void OGLRender::ApplyTextureFilter() +{ + static uint32 minflag=0xFFFF, magflag=0xFFFF; + static uint32 mtex; + + if( m_texUnitEnabled[0] ) + { + if( mtex != m_curBoundTex[0] ) + { + mtex = m_curBoundTex[0]; + minflag = m_dwMinFilter; + magflag = m_dwMagFilter; + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, OglTexFilterMap[m_dwMinFilter].realFilter); + OPENGL_CHECK_ERRORS; + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, OglTexFilterMap[m_dwMagFilter].realFilter); + OPENGL_CHECK_ERRORS; + } + else + { + if( minflag != (unsigned int)m_dwMinFilter ) + { + minflag = m_dwMinFilter; + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, OglTexFilterMap[m_dwMinFilter].realFilter); + OPENGL_CHECK_ERRORS; + } + if( magflag != (unsigned int)m_dwMagFilter ) + { + magflag = m_dwMagFilter; + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, OglTexFilterMap[m_dwMagFilter].realFilter); + OPENGL_CHECK_ERRORS; + } + } + } +} + +void OGLRender::SetShadeMode(RenderShadeMode mode) +{ +#if SDL_VIDEO_OPENGL + if( mode == SHADE_SMOOTH ) + glShadeModel(GL_SMOOTH); + else + glShadeModel(GL_FLAT); + OPENGL_CHECK_ERRORS; +#endif +} + +void OGLRender::ZBufferEnable(BOOL bZBuffer) +{ + gRSP.bZBufferEnabled = bZBuffer; + if( g_curRomInfo.bForceDepthBuffer ) + bZBuffer = TRUE; + if( bZBuffer ) + { + glDepthMask(GL_TRUE); + OPENGL_CHECK_ERRORS; + //glEnable(GL_DEPTH_TEST); + glDepthFunc( GL_LEQUAL ); + OPENGL_CHECK_ERRORS; + } + else + { + glDepthMask(GL_FALSE); + OPENGL_CHECK_ERRORS; + //glDisable(GL_DEPTH_TEST); + glDepthFunc( GL_ALWAYS ); + OPENGL_CHECK_ERRORS; + } +} + +void OGLRender::ClearBuffer(bool cbuffer, bool zbuffer) +{ + uint32 flag=0; + if( cbuffer ) flag |= GL_COLOR_BUFFER_BIT; + if( zbuffer ) flag |= GL_DEPTH_BUFFER_BIT; + float depth = ((gRDP.originalFillColor&0xFFFF)>>2)/(float)0x3FFF; + glClearDepth(depth); + OPENGL_CHECK_ERRORS; + glClear(flag); + OPENGL_CHECK_ERRORS; +} + +void OGLRender::ClearZBuffer(float depth) +{ + uint32 flag=GL_DEPTH_BUFFER_BIT; + glClearDepth(depth); + OPENGL_CHECK_ERRORS; + glClear(flag); + OPENGL_CHECK_ERRORS; +} + +void OGLRender::SetZCompare(BOOL bZCompare) +{ + if( g_curRomInfo.bForceDepthBuffer ) + bZCompare = TRUE; + + gRSP.bZBufferEnabled = bZCompare; + if( bZCompare == TRUE ) + { + //glEnable(GL_DEPTH_TEST); + glDepthFunc( GL_LEQUAL ); + OPENGL_CHECK_ERRORS; + } + else + { + //glDisable(GL_DEPTH_TEST); + glDepthFunc( GL_ALWAYS ); + OPENGL_CHECK_ERRORS; + } +} + +void OGLRender::SetZUpdate(BOOL bZUpdate) +{ + if( g_curRomInfo.bForceDepthBuffer ) + bZUpdate = TRUE; + + if( bZUpdate ) + { + //glEnable(GL_DEPTH_TEST); + glDepthMask(GL_TRUE); + OPENGL_CHECK_ERRORS; + } + else + { + glDepthMask(GL_FALSE); + OPENGL_CHECK_ERRORS; + } +} + +void OGLRender::ApplyZBias(int bias) +{ + float f1 = bias > 0 ? -3.0f : 0.0f; // z offset = -3.0 * max(abs(dz/dx),abs(dz/dy)) per pixel delta z slope + float f2 = bias > 0 ? -3.0f : 0.0f; // z offset += -3.0 * 1 bit + if (bias > 0) + { + glEnable(GL_POLYGON_OFFSET_FILL); // enable z offsets + OPENGL_CHECK_ERRORS; + } + else + { + glDisable(GL_POLYGON_OFFSET_FILL); // disable z offsets + OPENGL_CHECK_ERRORS; + } + glPolygonOffset(f1, f2); // set bias functions + OPENGL_CHECK_ERRORS; +} + +void OGLRender::SetZBias(int bias) +{ +#if defined(DEBUGGER) + if( pauseAtNext == true ) + DebuggerAppendMsg("Set zbias = %d", bias); +#endif + // set member variable and apply the setting in opengl + m_dwZBias = bias; + ApplyZBias(bias); +} + +void OGLRender::SetAlphaRef(uint32 dwAlpha) +{ + if (m_dwAlpha != dwAlpha) + { + m_dwAlpha = dwAlpha; +#if SDL_VIDEO_OPENGL + glAlphaFunc(GL_GEQUAL, (float)dwAlpha); + OPENGL_CHECK_ERRORS; +#endif + } +} + +void OGLRender::ForceAlphaRef(uint32 dwAlpha) +{ +#if SDL_VIDEO_OPENGL + float ref = dwAlpha/255.0f; + glAlphaFunc(GL_GEQUAL, ref); + OPENGL_CHECK_ERRORS; +#elif SDL_VIDEO_OPENGL_ES2 + m_dwAlpha = dwAlpha; +#endif +} + +void OGLRender::SetFillMode(FillMode mode) +{ +#if SDL_VIDEO_OPENGL + if( mode == RICE_FILLMODE_WINFRAME ) + { + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + OPENGL_CHECK_ERRORS; + } + else + { + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + OPENGL_CHECK_ERRORS; + } +#endif +} + +void OGLRender::SetCullMode(bool bCullFront, bool bCullBack) +{ + CRender::SetCullMode(bCullFront, bCullBack); + if( bCullFront && bCullBack ) + { + glCullFace(GL_FRONT_AND_BACK); + OPENGL_CHECK_ERRORS; + glEnable(GL_CULL_FACE); + OPENGL_CHECK_ERRORS; + } + else if( bCullFront ) + { + glCullFace(GL_FRONT); + OPENGL_CHECK_ERRORS; + glEnable(GL_CULL_FACE); + OPENGL_CHECK_ERRORS; + } + else if( bCullBack ) + { + glCullFace(GL_BACK); + OPENGL_CHECK_ERRORS; + glEnable(GL_CULL_FACE); + OPENGL_CHECK_ERRORS; + } + else + { + glDisable(GL_CULL_FACE); + OPENGL_CHECK_ERRORS; + } +} + +bool OGLRender::SetCurrentTexture(int tile, CTexture *handler,uint32 dwTileWidth, uint32 dwTileHeight, TxtrCacheEntry *pTextureEntry) +{ + RenderTexture &texture = g_textures[tile]; + texture.pTextureEntry = pTextureEntry; + + if( handler!= NULL && texture.m_lpsTexturePtr != handler->GetTexture() ) + { + texture.m_pCTexture = handler; + texture.m_lpsTexturePtr = handler->GetTexture(); + + texture.m_dwTileWidth = dwTileWidth; + texture.m_dwTileHeight = dwTileHeight; + + if( handler->m_bIsEnhancedTexture ) + { + texture.m_fTexWidth = (float)pTextureEntry->pTexture->m_dwCreatedTextureWidth; + texture.m_fTexHeight = (float)pTextureEntry->pTexture->m_dwCreatedTextureHeight; + } + else + { + texture.m_fTexWidth = (float)handler->m_dwCreatedTextureWidth; + texture.m_fTexHeight = (float)handler->m_dwCreatedTextureHeight; + } + } + + return true; +} + +bool OGLRender::SetCurrentTexture(int tile, TxtrCacheEntry *pEntry) +{ + if (pEntry != NULL && pEntry->pTexture != NULL) + { + SetCurrentTexture( tile, pEntry->pTexture, pEntry->ti.WidthToCreate, pEntry->ti.HeightToCreate, pEntry); + return true; + } + else + { + SetCurrentTexture( tile, NULL, 64, 64, NULL ); + return false; + } + return true; +} + +void OGLRender::SetAddressUAllStages(uint32 dwTile, TextureUVFlag dwFlag) +{ + SetTextureUFlag(dwFlag, dwTile); +} + +void OGLRender::SetAddressVAllStages(uint32 dwTile, TextureUVFlag dwFlag) +{ + SetTextureVFlag(dwFlag, dwTile); +} + +void OGLRender::SetTexWrapS(int unitno,GLuint flag) +{ + static GLuint mflag; + static GLuint mtex; +#ifdef DEBUGGER + if( unitno != 0 ) + { + DebuggerAppendMsg("Check me, unitno != 0 in base ogl"); + } +#endif + if( m_curBoundTex[0] != mtex || mflag != flag ) + { + mtex = m_curBoundTex[0]; + mflag = flag; + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, flag); + OPENGL_CHECK_ERRORS; + } +} +void OGLRender::SetTexWrapT(int unitno,GLuint flag) +{ + static GLuint mflag; + static GLuint mtex; + if( m_curBoundTex[0] != mtex || mflag != flag ) + { + mtex = m_curBoundTex[0]; + mflag = flag; + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, flag); + OPENGL_CHECK_ERRORS; + } +} + +void OGLRender::SetTextureUFlag(TextureUVFlag dwFlag, uint32 dwTile) +{ + TileUFlags[dwTile] = dwFlag; + if( dwTile == gRSP.curTile ) // For basic OGL, only support the 1st texel + { + COGLTexture* pTexture = g_textures[gRSP.curTile].m_pCOGLTexture; + if( pTexture ) + { + EnableTexUnit(0,TRUE); + BindTexture(pTexture->m_dwTextureName, 0); + } + SetTexWrapS(0, OGLXUVFlagMaps[dwFlag].realFlag); + } +} +void OGLRender::SetTextureVFlag(TextureUVFlag dwFlag, uint32 dwTile) +{ + TileVFlags[dwTile] = dwFlag; + if( dwTile == gRSP.curTile ) // For basic OGL, only support the 1st texel + { + COGLTexture* pTexture = g_textures[gRSP.curTile].m_pCOGLTexture; + if( pTexture ) + { + EnableTexUnit(0,TRUE); + BindTexture(pTexture->m_dwTextureName, 0); + } + SetTexWrapT(0, OGLXUVFlagMaps[dwFlag].realFlag); + } +} + +// Basic render drawing functions + +bool OGLRender::RenderTexRect() +{ + glViewportWrapper(0, windowSetting.statusBarHeightToUse, windowSetting.uDisplayWidth, windowSetting.uDisplayHeight); + OPENGL_CHECK_ERRORS; + + GLboolean cullface = glIsEnabled(GL_CULL_FACE); + glDisable(GL_CULL_FACE); + OPENGL_CHECK_ERRORS; + + float depth = -(g_texRectTVtx[3].z*2-1); + +#if SDL_VIDEO_OPENGL + + glBegin(GL_TRIANGLE_FAN); + + glColor4f(g_texRectTVtx[3].r, g_texRectTVtx[3].g, g_texRectTVtx[3].b, g_texRectTVtx[3].a); + TexCoord(g_texRectTVtx[3]); + glVertex3f(g_texRectTVtx[3].x, g_texRectTVtx[3].y, depth); + + glColor4f(g_texRectTVtx[2].r, g_texRectTVtx[2].g, g_texRectTVtx[2].b, g_texRectTVtx[2].a); + TexCoord(g_texRectTVtx[2]); + glVertex3f(g_texRectTVtx[2].x, g_texRectTVtx[2].y, depth); + + glColor4f(g_texRectTVtx[1].r, g_texRectTVtx[1].g, g_texRectTVtx[1].b, g_texRectTVtx[1].a); + TexCoord(g_texRectTVtx[1]); + glVertex3f(g_texRectTVtx[1].x, g_texRectTVtx[1].y, depth); + + glColor4f(g_texRectTVtx[0].r, g_texRectTVtx[0].g, g_texRectTVtx[0].b, g_texRectTVtx[0].a); + TexCoord(g_texRectTVtx[0]); + glVertex3f(g_texRectTVtx[0].x, g_texRectTVtx[0].y, depth); + + glEnd(); + OPENGL_CHECK_ERRORS; + +#elif SDL_VIDEO_OPENGL_ES2 + + GLfloat colour[] = { + g_texRectTVtx[3].r, g_texRectTVtx[3].g, g_texRectTVtx[3].b, g_texRectTVtx[3].a, + g_texRectTVtx[2].r, g_texRectTVtx[2].g, g_texRectTVtx[2].b, g_texRectTVtx[2].a, + g_texRectTVtx[1].r, g_texRectTVtx[1].g, g_texRectTVtx[1].b, g_texRectTVtx[1].a, + g_texRectTVtx[0].r, g_texRectTVtx[0].g, g_texRectTVtx[0].b, g_texRectTVtx[0].a + }; + + GLfloat tex[] = { + g_texRectTVtx[3].tcord[0].u,g_texRectTVtx[3].tcord[0].v, + g_texRectTVtx[2].tcord[0].u,g_texRectTVtx[2].tcord[0].v, + g_texRectTVtx[1].tcord[0].u,g_texRectTVtx[1].tcord[0].v, + g_texRectTVtx[0].tcord[0].u,g_texRectTVtx[0].tcord[0].v + }; + + float w = windowSetting.uDisplayWidth / 2.0f, h = windowSetting.uDisplayHeight / 2.0f, inv = 1.0f; + + GLfloat vertices[] = { + -inv + g_texRectTVtx[3].x / w, inv - g_texRectTVtx[3].y / h, depth, 1, + -inv + g_texRectTVtx[2].x / w, inv - g_texRectTVtx[2].y / h, depth, 1, + -inv + g_texRectTVtx[1].x / w, inv - g_texRectTVtx[1].y / h, depth, 1, + -inv + g_texRectTVtx[0].x / w, inv - g_texRectTVtx[0].y / h, depth, 1 + }; + + glVertexAttribPointer(VS_COLOR, 4, GL_FLOAT,GL_TRUE, 0, &colour ); + glVertexAttribPointer(VS_POSITION,4,GL_FLOAT,GL_FALSE,0,&vertices); + glVertexAttribPointer(VS_TEXCOORD0,2,GL_FLOAT,GL_FALSE, 0, &tex); + OPENGL_CHECK_ERRORS; + glDrawArrays(GL_TRIANGLE_FAN,0,4); + OPENGL_CHECK_ERRORS; + + //Restore old pointers + glVertexAttribPointer(VS_COLOR, 4, GL_UNSIGNED_BYTE,GL_TRUE, sizeof(uint8)*4, &(g_oglVtxColors[0][0]) ); + glVertexAttribPointer(VS_POSITION,4,GL_FLOAT,GL_FALSE,sizeof(float)*5,&(g_vtxProjected5[0][0])); + glVertexAttribPointer(VS_TEXCOORD0,2,GL_FLOAT,GL_FALSE, sizeof( TLITVERTEX ), &(g_vtxBuffer[0].tcord[0].u)); + +#endif + + if( cullface ) glEnable(GL_CULL_FACE); + OPENGL_CHECK_ERRORS; + + return true; +} + +bool OGLRender::RenderFillRect(uint32 dwColor, float depth) +{ + float a = (dwColor>>24)/255.0f; + float r = ((dwColor>>16)&0xFF)/255.0f; + float g = ((dwColor>>8)&0xFF)/255.0f; + float b = (dwColor&0xFF)/255.0f; + glViewportWrapper(0, windowSetting.statusBarHeightToUse, windowSetting.uDisplayWidth, windowSetting.uDisplayHeight); + OPENGL_CHECK_ERRORS; + + GLboolean cullface = glIsEnabled(GL_CULL_FACE); + glDisable(GL_CULL_FACE); + OPENGL_CHECK_ERRORS; + +#if SDL_VIDEO_OPENGL + + glBegin(GL_TRIANGLE_FAN); + glColor4f(r,g,b,a); + glVertex4f(m_fillRectVtx[0].x, m_fillRectVtx[1].y, depth, 1); + glVertex4f(m_fillRectVtx[1].x, m_fillRectVtx[1].y, depth, 1); + glVertex4f(m_fillRectVtx[1].x, m_fillRectVtx[0].y, depth, 1); + glVertex4f(m_fillRectVtx[0].x, m_fillRectVtx[0].y, depth, 1); + glEnd(); + OPENGL_CHECK_ERRORS; + +#elif SDL_VIDEO_OPENGL_ES2 + + GLfloat colour[] = { + r,g,b,a, + r,g,b,a, + r,g,b,a, + r,g,b,a}; + + float w = windowSetting.uDisplayWidth / 2.0f, h = windowSetting.uDisplayHeight / 2.0f, inv = 1.0f; + + GLfloat vertices[] = { + -inv + m_fillRectVtx[0].x / w, inv - m_fillRectVtx[1].y / h, depth, 1, + -inv + m_fillRectVtx[1].x / w, inv - m_fillRectVtx[1].y / h, depth, 1, + -inv + m_fillRectVtx[1].x / w, inv - m_fillRectVtx[0].y / h, depth, 1, + -inv + m_fillRectVtx[0].x / w, inv - m_fillRectVtx[0].y / h, depth, 1 + }; + + glVertexAttribPointer(VS_COLOR, 4, GL_FLOAT,GL_FALSE, 0, &colour ); + glVertexAttribPointer(VS_POSITION,4,GL_FLOAT,GL_FALSE,0,&vertices); + glDisableVertexAttribArray(VS_TEXCOORD0); + OPENGL_CHECK_ERRORS; + glDrawArrays(GL_TRIANGLE_FAN,0,4); + OPENGL_CHECK_ERRORS; + + //Restore old pointers + glVertexAttribPointer(VS_COLOR, 4, GL_UNSIGNED_BYTE,GL_TRUE, sizeof(uint8)*4, &(g_oglVtxColors[0][0]) ); + glVertexAttribPointer(VS_POSITION,4,GL_FLOAT,GL_FALSE,sizeof(float)*5,&(g_vtxProjected5[0][0])); + glEnableVertexAttribArray(VS_TEXCOORD0); + +#endif + + if( cullface ) glEnable(GL_CULL_FACE); + OPENGL_CHECK_ERRORS; + + return true; +} + +bool OGLRender::RenderLine3D() +{ +#if SDL_VIDEO_OPENGL + ApplyZBias(0); // disable z offsets + + glBegin(GL_TRIANGLE_FAN); + + glColor4f(m_line3DVtx[1].r, m_line3DVtx[1].g, m_line3DVtx[1].b, m_line3DVtx[1].a); + glVertex3f(m_line3DVector[3].x, m_line3DVector[3].y, -m_line3DVtx[1].z); + glVertex3f(m_line3DVector[2].x, m_line3DVector[2].y, -m_line3DVtx[0].z); + + glColor4ub(m_line3DVtx[0].r, m_line3DVtx[0].g, m_line3DVtx[0].b, m_line3DVtx[0].a); + glVertex3f(m_line3DVector[1].x, m_line3DVector[1].y, -m_line3DVtx[1].z); + glVertex3f(m_line3DVector[0].x, m_line3DVector[0].y, -m_line3DVtx[0].z); + + glEnd(); + OPENGL_CHECK_ERRORS; + + ApplyZBias(m_dwZBias); // set Z offset back to previous value +#endif + + return true; +} + +extern FiddledVtx * g_pVtxBase; + +// This is so weired that I can not do vertex transform by myself. I have to use +// OpenGL internal transform +bool OGLRender::RenderFlushTris() +{ + if( !m_bSupportFogCoordExt ) + SetFogFlagForNegativeW(); + else + { + if( !gRDP.bFogEnableInBlender && gRSP.bFogEnabled ) + { + TurnFogOnOff(false); + } + } + + ApplyZBias(m_dwZBias); // set the bias factors + + glViewportWrapper(windowSetting.vpLeftW, windowSetting.uDisplayHeight-windowSetting.vpTopW-windowSetting.vpHeightW+windowSetting.statusBarHeightToUse, windowSetting.vpWidthW, windowSetting.vpHeightW, false); + OPENGL_CHECK_ERRORS; + + //if options.bOGLVertexClipper == FALSE ) + { + glDrawElements( GL_TRIANGLES, gRSP.numVertices, GL_UNSIGNED_SHORT, g_vtxIndex ); + OPENGL_CHECK_ERRORS; + } +/* else + { + //ClipVertexesOpenGL(); + // Redo the index + // Set the array + glVertexPointer( 4, GL_FLOAT, sizeof(float)*5, &(g_vtxProjected5Clipped[0][0]) ); + glEnableClientState( GL_VERTEX_ARRAY ); + + pglClientActiveTextureARB( GL_TEXTURE0_ARB ); + glTexCoordPointer( 2, GL_FLOAT, sizeof( TLITVERTEX ), &(g_clippedVtxBuffer[0].tcord[0].u) ); + glEnableClientState( GL_TEXTURE_COORD_ARRAY ); + + pglClientActiveTextureARB( GL_TEXTURE1_ARB ); + glTexCoordPointer( 2, GL_FLOAT, sizeof( TLITVERTEX ), &(g_clippedVtxBuffer[0].tcord[1].u) ); + glEnableClientState( GL_TEXTURE_COORD_ARRAY ); + + glDrawElements( GL_TRIANGLES, gRSP.numVertices, GL_UNSIGNED_INT, g_vtxIndex ); + + // Reset the array + pglClientActiveTextureARB( GL_TEXTURE0_ARB ); + glTexCoordPointer( 2, GL_FLOAT, sizeof( TLITVERTEX ), &(g_vtxBuffer[0].tcord[0].u) ); + glEnableClientState( GL_TEXTURE_COORD_ARRAY ); + + pglClientActiveTextureARB( GL_TEXTURE1_ARB ); + glTexCoordPointer( 2, GL_FLOAT, sizeof( TLITVERTEX ), &(g_vtxBuffer[0].tcord[1].u) ); + glEnableClientState( GL_TEXTURE_COORD_ARRAY ); + + glVertexPointer( 4, GL_FLOAT, sizeof(float)*5, &(g_vtxProjected5[0][0]) ); + glEnableClientState( GL_VERTEX_ARRAY ); + } +*/ + + if( !m_bSupportFogCoordExt ) + RestoreFogFlag(); + else + { + if( !gRDP.bFogEnableInBlender && gRSP.bFogEnabled ) + { + TurnFogOnOff(true); + } + } + return true; +} + +void OGLRender::DrawSimple2DTexture(float x0, float y0, float x1, float y1, float u0, float v0, float u1, float v1, COLOR dif, COLOR spe, float z, float rhw) +{ + if( status.bVIOriginIsUpdated == true && currentRomOptions.screenUpdateSetting==SCREEN_UPDATE_AT_1ST_PRIMITIVE ) + { + status.bVIOriginIsUpdated=false; + CGraphicsContext::Get()->UpdateFrame(); + DEBUGGER_PAUSE_AND_DUMP_NO_UPDATE(NEXT_SET_CIMG,{DebuggerAppendMsg("Screen Update at 1st Simple2DTexture");}); + } + + StartDrawSimple2DTexture(x0, y0, x1, y1, u0, v0, u1, v1, dif, spe, z, rhw); + + GLboolean cullface = glIsEnabled(GL_CULL_FACE); + glDisable(GL_CULL_FACE); + OPENGL_CHECK_ERRORS; + + glViewportWrapper(0, windowSetting.statusBarHeightToUse, windowSetting.uDisplayWidth, windowSetting.uDisplayHeight); + OPENGL_CHECK_ERRORS; + + float a = (g_texRectTVtx[0].dcDiffuse >>24)/255.0f; + float r = ((g_texRectTVtx[0].dcDiffuse>>16)&0xFF)/255.0f; + float g = ((g_texRectTVtx[0].dcDiffuse>>8)&0xFF)/255.0f; + float b = (g_texRectTVtx[0].dcDiffuse&0xFF)/255.0f; + +#if SDL_VIDEO_OPENGL + + glBegin(GL_TRIANGLES); + + glColor4f(r,g,b,a); + + OGLRender::TexCoord(g_texRectTVtx[0]); + glVertex3f(g_texRectTVtx[0].x, g_texRectTVtx[0].y, -g_texRectTVtx[0].z); + + OGLRender::TexCoord(g_texRectTVtx[1]); + glVertex3f(g_texRectTVtx[1].x, g_texRectTVtx[1].y, -g_texRectTVtx[1].z); + + OGLRender::TexCoord(g_texRectTVtx[2]); + glVertex3f(g_texRectTVtx[2].x, g_texRectTVtx[2].y, -g_texRectTVtx[2].z); + + OGLRender::TexCoord(g_texRectTVtx[0]); + glVertex3f(g_texRectTVtx[0].x, g_texRectTVtx[0].y, -g_texRectTVtx[0].z); + + OGLRender::TexCoord(g_texRectTVtx[2]); + glVertex3f(g_texRectTVtx[2].x, g_texRectTVtx[2].y, -g_texRectTVtx[2].z); + + OGLRender::TexCoord(g_texRectTVtx[3]); + glVertex3f(g_texRectTVtx[3].x, g_texRectTVtx[3].y, -g_texRectTVtx[3].z); + + glEnd(); + OPENGL_CHECK_ERRORS; + +#elif SDL_VIDEO_OPENGL_ES2 + + GLfloat colour[] = { + r,g,b,a, + r,g,b,a, + r,g,b,a, + r,g,b,a, + r,g,b,a, + r,g,b,a + }; + + GLfloat tex[] = { + g_texRectTVtx[0].tcord[0].u,g_texRectTVtx[0].tcord[0].v, + g_texRectTVtx[1].tcord[0].u,g_texRectTVtx[1].tcord[0].v, + g_texRectTVtx[2].tcord[0].u,g_texRectTVtx[2].tcord[0].v, + + g_texRectTVtx[0].tcord[0].u,g_texRectTVtx[0].tcord[0].v, + g_texRectTVtx[2].tcord[0].u,g_texRectTVtx[2].tcord[0].v, + g_texRectTVtx[3].tcord[0].u,g_texRectTVtx[3].tcord[0].v, + }; + + float w = windowSetting.uDisplayWidth / 2.0f, h = windowSetting.uDisplayHeight / 2.0f, inv = 1.0f; + + GLfloat vertices[] = { + -inv + g_texRectTVtx[0].x/ w, inv - g_texRectTVtx[0].y/ h, -g_texRectTVtx[0].z,1, + -inv + g_texRectTVtx[1].x/ w, inv - g_texRectTVtx[1].y/ h, -g_texRectTVtx[1].z,1, + -inv + g_texRectTVtx[2].x/ w, inv - g_texRectTVtx[2].y/ h, -g_texRectTVtx[2].z,1, + + -inv + g_texRectTVtx[0].x/ w, inv - g_texRectTVtx[0].y/ h, -g_texRectTVtx[0].z,1, + -inv + g_texRectTVtx[2].x/ w, inv - g_texRectTVtx[2].y/ h, -g_texRectTVtx[2].z,1, + -inv + g_texRectTVtx[3].x/ w, inv - g_texRectTVtx[3].y/ h, -g_texRectTVtx[3].z,1 + }; + + glVertexAttribPointer(VS_COLOR, 4, GL_FLOAT,GL_FALSE, 0, &colour ); + glVertexAttribPointer(VS_POSITION,4,GL_FLOAT,GL_FALSE,0,&vertices); + glVertexAttribPointer(VS_TEXCOORD0,2,GL_FLOAT,GL_FALSE, 0, &tex); + OPENGL_CHECK_ERRORS; + glDrawArrays(GL_TRIANGLES,0,6); + OPENGL_CHECK_ERRORS; + + //Restore old pointers + glVertexAttribPointer(VS_COLOR, 4, GL_UNSIGNED_BYTE,GL_TRUE, sizeof(uint8)*4, &(g_oglVtxColors[0][0]) ); + glVertexAttribPointer(VS_POSITION,4,GL_FLOAT,GL_FALSE,sizeof(float)*5,&(g_vtxProjected5[0][0])); + glVertexAttribPointer(VS_TEXCOORD0,2,GL_FLOAT,GL_FALSE, sizeof( TLITVERTEX ), &(g_vtxBuffer[0].tcord[0].u)); + +#endif + + if( cullface ) glEnable(GL_CULL_FACE); + OPENGL_CHECK_ERRORS; +} + +void OGLRender::DrawSimpleRect(int nX0, int nY0, int nX1, int nY1, uint32 dwColor, float depth, float rhw) +{ + StartDrawSimpleRect(nX0, nY0, nX1, nY1, dwColor, depth, rhw); + + GLboolean cullface = glIsEnabled(GL_CULL_FACE); + glDisable(GL_CULL_FACE); + OPENGL_CHECK_ERRORS; + + float a = (dwColor>>24)/255.0f; + float r = ((dwColor>>16)&0xFF)/255.0f; + float g = ((dwColor>>8)&0xFF)/255.0f; + float b = (dwColor&0xFF)/255.0f; + +#if SDL_VIDEO_OPENGL + + glBegin(GL_TRIANGLE_FAN); + + glColor4f(r,g,b,a); + glVertex3f(m_simpleRectVtx[1].x, m_simpleRectVtx[0].y, -depth); + glVertex3f(m_simpleRectVtx[1].x, m_simpleRectVtx[1].y, -depth); + glVertex3f(m_simpleRectVtx[0].x, m_simpleRectVtx[1].y, -depth); + glVertex3f(m_simpleRectVtx[0].x, m_simpleRectVtx[0].y, -depth); + + glEnd(); + OPENGL_CHECK_ERRORS; + +#elif SDL_VIDEO_OPENGL_ES2 + + GLfloat colour[] = { + r,g,b,a, + r,g,b,a, + r,g,b,a, + r,g,b,a}; + float w = windowSetting.uDisplayWidth / 2.0f, h = windowSetting.uDisplayHeight / 2.0f, inv = 1.0f; + + GLfloat vertices[] = { + -inv + m_simpleRectVtx[1].x / w, inv - m_simpleRectVtx[0].y / h, -depth, 1, + -inv + m_simpleRectVtx[1].x / w, inv - m_simpleRectVtx[1].y / h, -depth, 1, + -inv + m_simpleRectVtx[0].x / w, inv - m_simpleRectVtx[1].y / h, -depth, 1, + -inv + m_simpleRectVtx[0].x / w, inv - m_simpleRectVtx[0].y / h, -depth, 1 + }; + + glVertexAttribPointer(VS_COLOR, 4, GL_FLOAT,GL_FALSE, 0, &colour ); + glVertexAttribPointer(VS_POSITION,4,GL_FLOAT,GL_FALSE,0,&vertices); + glDisableVertexAttribArray(VS_TEXCOORD0); + OPENGL_CHECK_ERRORS; + glDrawArrays(GL_TRIANGLE_FAN,0,4); + OPENGL_CHECK_ERRORS; + + //Restore old pointers + glVertexAttribPointer(VS_COLOR, 4, GL_UNSIGNED_BYTE,GL_TRUE, sizeof(uint8)*4, &(g_oglVtxColors[0][0]) ); + glVertexAttribPointer(VS_POSITION,4,GL_FLOAT,GL_FALSE,sizeof(float)*5,&(g_vtxProjected5[0][0])); + glEnableVertexAttribArray(VS_TEXCOORD0); + +#endif + + if( cullface ) glEnable(GL_CULL_FACE); + OPENGL_CHECK_ERRORS; +} + +void OGLRender::InitCombinerBlenderForSimpleRectDraw(uint32 tile) +{ + //glEnable(GL_CULL_FACE); + EnableTexUnit(0,FALSE); + OPENGL_CHECK_ERRORS; + glEnable(GL_BLEND); + OPENGL_CHECK_ERRORS; + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + OPENGL_CHECK_ERRORS; + //glEnable(GL_ALPHA_TEST); +} + +COLOR OGLRender::PostProcessDiffuseColor(COLOR curDiffuseColor) +{ + uint32 color = curDiffuseColor; + uint32 colorflag = m_pColorCombiner->m_pDecodedMux->m_dwShadeColorChannelFlag; + uint32 alphaflag = m_pColorCombiner->m_pDecodedMux->m_dwShadeAlphaChannelFlag; + if( colorflag+alphaflag != MUX_0 ) + { + if( (colorflag & 0xFFFFFF00) == 0 && (alphaflag & 0xFFFFFF00) == 0 ) + { + color = (m_pColorCombiner->GetConstFactor(colorflag, alphaflag, curDiffuseColor)); + } + else + color = (CalculateConstFactor(colorflag, alphaflag, curDiffuseColor)); + } + + //return (color<<8)|(color>>24); + return color; +} + +COLOR OGLRender::PostProcessSpecularColor() +{ + return 0; +} + +void OGLRender::SetViewportRender() +{ + glViewportWrapper(windowSetting.vpLeftW, windowSetting.uDisplayHeight-windowSetting.vpTopW-windowSetting.vpHeightW+windowSetting.statusBarHeightToUse, windowSetting.vpWidthW, windowSetting.vpHeightW); + OPENGL_CHECK_ERRORS; +} + +void OGLRender::RenderReset() +{ + CRender::RenderReset(); + + glMatrixMode(GL_PROJECTION); + OPENGL_CHECK_ERRORS; + glLoadIdentity(); + OPENGL_CHECK_ERRORS; + glOrtho(0, windowSetting.uDisplayWidth, windowSetting.uDisplayHeight, 0, -1, 1); + OPENGL_CHECK_ERRORS; + + // position viewer + glMatrixMode(GL_MODELVIEW); + OPENGL_CHECK_ERRORS; + glLoadIdentity(); + OPENGL_CHECK_ERRORS; +} + +void OGLRender::SetAlphaTestEnable(BOOL bAlphaTestEnable) +{ +#ifdef DEBUGGER + if( bAlphaTestEnable && debuggerEnableAlphaTest ) +#else + if( bAlphaTestEnable ) +#endif +#if SDL_VIDEO_OPENGL + glEnable(GL_ALPHA_TEST); + else + glDisable(GL_ALPHA_TEST); +#elif SDL_VIDEO_OPENGL_ES2 + { + COGL_FragmentProgramCombiner* frag = (COGL_FragmentProgramCombiner*)m_pColorCombiner; + frag->m_AlphaRef = m_dwAlpha / 255.0f; + } + else + { + COGL_FragmentProgramCombiner* frag = (COGL_FragmentProgramCombiner*)m_pColorCombiner; + frag->m_AlphaRef = 0.0f; + } +#endif + OPENGL_CHECK_ERRORS; +} + +void OGLRender::BindTexture(GLuint texture, int unitno) +{ +#ifdef DEBUGGER + if( unitno != 0 ) + { + DebuggerAppendMsg("Check me, base ogl bind texture, unit no != 0"); + } +#endif + if( m_curBoundTex[0] != texture ) + { + glBindTexture(GL_TEXTURE_2D,texture); + OPENGL_CHECK_ERRORS; + m_curBoundTex[0] = texture; + } +} + +void OGLRender::DisBindTexture(GLuint texture, int unitno) +{ + //EnableTexUnit(0,FALSE); + //glBindTexture(GL_TEXTURE_2D, 0); //Not to bind any texture +} + +void OGLRender::EnableTexUnit(int unitno, BOOL flag) +{ +#ifdef DEBUGGER + if( unitno != 0 ) + { + DebuggerAppendMsg("Check me, in the base ogl render, unitno!=0"); + } +#endif + if( m_texUnitEnabled[0] != flag ) + { + m_texUnitEnabled[0] = flag; +#if SDL_VIDEO_OPENGL + if( flag == TRUE ) + glEnable(GL_TEXTURE_2D); + else + glDisable(GL_TEXTURE_2D); +#elif SDL_VIDEO_OPENGL_ES2 + if(flag) + { + pglActiveTexture(GL_TEXTURE0_ARB + unitno); + OPENGL_CHECK_ERRORS; + glBindTexture(GL_TEXTURE_2D,m_curBoundTex[unitno]); + } + else + { + pglActiveTexture(GL_TEXTURE0_ARB + unitno); + OPENGL_CHECK_ERRORS; + glEnable(GL_BLEND); //Need blend for transparent disabled texture + glBindTexture(GL_TEXTURE_2D,disabledTextureID); + } +#endif + OPENGL_CHECK_ERRORS; + } +} + +void OGLRender::TexCoord2f(float u, float v) +{ + glTexCoord2f(u, v); +} + +void OGLRender::TexCoord(TLITVERTEX &vtxInfo) +{ + glTexCoord2f(vtxInfo.tcord[0].u, vtxInfo.tcord[0].v); +} + +void OGLRender::UpdateScissor() +{ + if( options.bEnableHacks && g_CI.dwWidth == 0x200 && gRDP.scissor.right == 0x200 && g_CI.dwWidth>(*g_GraphicsInfo.VI_WIDTH_REG & 0xFFF) ) + { + // Hack for RE2 + uint32 width = *g_GraphicsInfo.VI_WIDTH_REG & 0xFFF; + uint32 height = (gRDP.scissor.right*gRDP.scissor.bottom)/width; + glEnable(GL_SCISSOR_TEST); + OPENGL_CHECK_ERRORS; + glScissor(0, int(height*windowSetting.fMultY+windowSetting.statusBarHeightToUse), + int(width*windowSetting.fMultX), int(height*windowSetting.fMultY) ); + OPENGL_CHECK_ERRORS; + } + else + { + UpdateScissorWithClipRatio(); + } +} + +void OGLRender::ApplyRDPScissor(bool force) +{ + if( !force && status.curScissor == RDP_SCISSOR ) return; + + if( options.bEnableHacks && g_CI.dwWidth == 0x200 && gRDP.scissor.right == 0x200 && g_CI.dwWidth>(*g_GraphicsInfo.VI_WIDTH_REG & 0xFFF) ) + { + // Hack for RE2 + uint32 width = *g_GraphicsInfo.VI_WIDTH_REG & 0xFFF; + uint32 height = (gRDP.scissor.right*gRDP.scissor.bottom)/width; + glEnable(GL_SCISSOR_TEST); + OPENGL_CHECK_ERRORS; + glScissor(0, int(height*windowSetting.fMultY+windowSetting.statusBarHeightToUse), + int(width*windowSetting.fMultX), int(height*windowSetting.fMultY) ); + OPENGL_CHECK_ERRORS; + } + else + { + glScissor(int(gRDP.scissor.left*windowSetting.fMultX), int((windowSetting.uViHeight-gRDP.scissor.bottom)*windowSetting.fMultY+windowSetting.statusBarHeightToUse), + int((gRDP.scissor.right-gRDP.scissor.left)*windowSetting.fMultX), int((gRDP.scissor.bottom-gRDP.scissor.top)*windowSetting.fMultY )); + OPENGL_CHECK_ERRORS; + } + + status.curScissor = RDP_SCISSOR; +} + +void OGLRender::ApplyScissorWithClipRatio(bool force) +{ + if( !force && status.curScissor == RSP_SCISSOR ) return; + + glEnable(GL_SCISSOR_TEST); + OPENGL_CHECK_ERRORS; + glScissor(windowSetting.clipping.left, int((windowSetting.uViHeight-gRSP.real_clip_scissor_bottom)*windowSetting.fMultY)+windowSetting.statusBarHeightToUse, + windowSetting.clipping.width, windowSetting.clipping.height); + OPENGL_CHECK_ERRORS; + + status.curScissor = RSP_SCISSOR; +} + +void OGLRender::SetFogMinMax(float fMin, float fMax) +{ +#if SDL_VIDEO_OPENGL + glFogf(GL_FOG_START, gRSPfFogMin); // Fog Start Depth + OPENGL_CHECK_ERRORS; + glFogf(GL_FOG_END, gRSPfFogMax); // Fog End Depth + OPENGL_CHECK_ERRORS; +#elif SDL_VIDEO_OPENGL_ES2 + ((COGL_FragmentProgramCombiner*)m_pColorCombiner)->UpdateFog(gRSP.bFogEnabled); + OPENGL_CHECK_ERRORS; +#endif +} + +void OGLRender::TurnFogOnOff(bool flag) +{ +#if SDL_VIDEO_OPENGL + if( flag ) + glEnable(GL_FOG); + else + glDisable(GL_FOG); + OPENGL_CHECK_ERRORS; +#elif SDL_VIDEO_OPENGL_ES2 + ((COGL_FragmentProgramCombiner*)m_pColorCombiner)->UpdateFog(flag); + OPENGL_CHECK_ERRORS; +#endif +} + +void OGLRender::SetFogEnable(bool bEnable) +{ + DEBUGGER_IF_DUMP( (gRSP.bFogEnabled != (bEnable==TRUE) && logFog ), TRACE1("Set Fog %s", bEnable? "enable":"disable")); + + gRSP.bFogEnabled = bEnable&&(options.fogMethod == 1); + + // If force fog + if(options.fogMethod == 2) + { + gRSP.bFogEnabled = true; + } + +#if SDL_VIDEO_OPENGL + if( gRSP.bFogEnabled ) + { + //TRACE2("Enable fog, min=%f, max=%f",gRSPfFogMin,gRSPfFogMax ); + glFogfv(GL_FOG_COLOR, gRDP.fvFogColor); // Set Fog Color + OPENGL_CHECK_ERRORS; + glFogf(GL_FOG_START, gRSPfFogMin); // Fog Start Depth + OPENGL_CHECK_ERRORS; + glFogf(GL_FOG_END, gRSPfFogMax); // Fog End Depth + OPENGL_CHECK_ERRORS; + glEnable(GL_FOG); + OPENGL_CHECK_ERRORS; + } + else + { + glDisable(GL_FOG); + OPENGL_CHECK_ERRORS; + } +#elif SDL_VIDEO_OPENGL_ES2 + ((COGL_FragmentProgramCombiner*)m_pColorCombiner)->UpdateFog(gRSP.bFogEnabled); + OPENGL_CHECK_ERRORS; +#endif +} + +void OGLRender::SetFogColor(uint32 r, uint32 g, uint32 b, uint32 a) +{ + gRDP.fogColor = COLOR_RGBA(r, g, b, a); + gRDP.fvFogColor[0] = r/255.0f; //r + gRDP.fvFogColor[1] = g/255.0f; //g + gRDP.fvFogColor[2] = b/255.0f; //b + gRDP.fvFogColor[3] = a/255.0f; //a +#if SDL_VIDEO_OPENGL + glFogfv(GL_FOG_COLOR, gRDP.fvFogColor); // Set Fog Color +#endif + OPENGL_CHECK_ERRORS; +} + +void OGLRender::DisableMultiTexture() +{ + pglActiveTexture(GL_TEXTURE1_ARB); + OPENGL_CHECK_ERRORS; + EnableTexUnit(1,FALSE); + pglActiveTexture(GL_TEXTURE0_ARB); + OPENGL_CHECK_ERRORS; + EnableTexUnit(0,FALSE); + pglActiveTexture(GL_TEXTURE0_ARB); + OPENGL_CHECK_ERRORS; + EnableTexUnit(0,TRUE); +} + +void OGLRender::EndRendering(void) +{ +#if SDL_VIDEO_OPENGL + glFlush(); + OPENGL_CHECK_ERRORS; +#endif + if( CRender::gRenderReferenceCount > 0 ) + CRender::gRenderReferenceCount--; +} + +void OGLRender::glViewportWrapper(GLint x, GLint y, GLsizei width, GLsizei height, bool flag) +{ + static GLint mx=0,my=0; + static GLsizei m_width=0, m_height=0; + static bool mflag=true; + + if( x!=mx || y!=my || width!=m_width || height!=m_height || mflag!=flag) + { + mx=x; + my=y; + m_width=width; + m_height=height; + mflag=flag; + glMatrixMode(GL_PROJECTION); + OPENGL_CHECK_ERRORS; + glLoadIdentity(); + OPENGL_CHECK_ERRORS; + if( flag ) glOrtho(0, windowSetting.uDisplayWidth, windowSetting.uDisplayHeight, 0, -1, 1); + OPENGL_CHECK_ERRORS; + glViewport(x,y,width,height); + OPENGL_CHECK_ERRORS; + } +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLRender.h b/libmupen64plus/mupen64plus-video-rice/src/OGLRender.h new file mode 100644 index 0000000000..d5fb387aba --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLRender.h @@ -0,0 +1,116 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#ifndef _OGL_RENDER_H_ +#define _OGL_RENDER_H_ + +#include "Combiner.h" +#include "Render.h" + +class OGLRender : public CRender +{ + friend class COGLColorCombiner; + friend class COGLBlender; + friend class OGLDeviceBuilder; + +protected: + OGLRender(); + +public: + ~OGLRender(); + void Initialize(void); + + bool InitDeviceObjects(); + bool ClearDeviceObjects(); + + void ApplyTextureFilter(); + + void SetShadeMode(RenderShadeMode mode); + void ZBufferEnable(BOOL bZBuffer); + void ClearBuffer(bool cbuffer, bool zbuffer); + void ClearZBuffer(float depth); + void SetZCompare(BOOL bZCompare); + void SetZUpdate(BOOL bZUpdate); + void SetZBias(int bias); + void ApplyZBias(int bias); + void SetAlphaRef(uint32 dwAlpha); + void ForceAlphaRef(uint32 dwAlpha); + void SetFillMode(FillMode mode); + void SetViewportRender(); + void RenderReset(); + void SetCullMode(bool bCullFront, bool bCullBack); + void SetAlphaTestEnable(BOOL bAlphaTestEnable); + void UpdateScissor(); + void ApplyRDPScissor(bool force=false); + void ApplyScissorWithClipRatio(bool force=false); + + bool SetCurrentTexture(int tile, CTexture *handler,uint32 dwTileWidth, uint32 dwTileHeight, TxtrCacheEntry *pTextureEntry); + bool SetCurrentTexture(int tile, TxtrCacheEntry *pTextureEntry); + void SetAddressUAllStages(uint32 dwTile, TextureUVFlag dwFlag); + void SetAddressVAllStages(uint32 dwTile, TextureUVFlag dwFlag); + void SetTextureUFlag(TextureUVFlag dwFlag, uint32 tile); + void SetTextureVFlag(TextureUVFlag dwFlag, uint32 tile); + virtual void BindTexture(GLuint texture, int unitno); + virtual void DisBindTexture(GLuint texture, int unitno); + virtual void TexCoord2f(float u, float v); + virtual void TexCoord(TLITVERTEX &vtxInfo); + + void DrawSimple2DTexture(float x0, float y0, float x1, float y1, float u0, float v0, float u1, float v1, COLOR dif, COLOR spe, float z, float rhw); + void DrawSimpleRect(int nX0, int nY0, int nX1, int nY1, uint32 dwColor, float depth, float rhw); + void InitCombinerBlenderForSimpleRectDraw(uint32 tile=0); + void DrawSpriteR_Render(); + void DrawObjBGCopy(uObjBg &info); + void DrawText(const char* str, RECT *rect); + + void SetFogMinMax(float fMin, float fMax); + void SetFogEnable(bool bEnable); + void TurnFogOnOff(bool flag); + void SetFogColor(uint32 r, uint32 g, uint32 b, uint32 a); + + void DisableMultiTexture(); + void EnableMultiTexture() {m_bEnableMultiTexture=true;} + void EndRendering(void); + + void glViewportWrapper(GLint x, GLint y, GLsizei width, GLsizei height, bool flag=true); + virtual void EnableTexUnit(int unitno, BOOL flag); + virtual void SetTexWrapS(int unitno,GLuint flag); + virtual void SetTexWrapT(int unitno,GLuint flag); + +protected: + COLOR PostProcessDiffuseColor(COLOR curDiffuseColor); + COLOR PostProcessSpecularColor(); + + // Basic render drawing functions + bool RenderFlushTris(); + bool RenderTexRect(); + bool RenderFillRect(uint32 dwColor, float depth); + bool RenderLine3D(); + + bool m_bSupportFogCoordExt; + bool m_bMultiTexture; + bool m_bSupportClampToEdge; + + GLuint m_curBoundTex[8]; + BOOL m_texUnitEnabled[8]; + + bool m_bEnableMultiTexture; +}; + +#endif + + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLRenderExt.cpp b/libmupen64plus/mupen64plus-video-rice/src/OGLRenderExt.cpp new file mode 100644 index 0000000000..e6322085f7 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLRenderExt.cpp @@ -0,0 +1,132 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#include "osal_opengl.h" + +#include "OGLRender.h" + +extern Matrix g_MtxReal; +extern uObjMtxReal gObjMtxReal; + +//======================================================================== + +void OGLRender::DrawText(const char* str, RECT *rect) +{ + return; +} + +void OGLRender::DrawSpriteR_Render() // With Rotation +{ + glViewportWrapper(0, windowSetting.statusBarHeightToUse, windowSetting.uDisplayWidth, windowSetting.uDisplayHeight); + + GLboolean cullface = glIsEnabled(GL_CULL_FACE); + glDisable(GL_CULL_FACE); + +#if SDL_VIDEO_OPENGL + + glBegin(GL_TRIANGLES); + glColor4fv(gRDP.fvPrimitiveColor); + + OGLRender::TexCoord(g_texRectTVtx[0]); + glVertex3f(g_texRectTVtx[0].x, g_texRectTVtx[0].y, -g_texRectTVtx[0].z); + + OGLRender::TexCoord(g_texRectTVtx[1]); + glVertex3f(g_texRectTVtx[1].x, g_texRectTVtx[1].y, -g_texRectTVtx[1].z); + + OGLRender::TexCoord(g_texRectTVtx[2]); + glVertex3f(g_texRectTVtx[2].x, g_texRectTVtx[2].y, -g_texRectTVtx[2].z); + + OGLRender::TexCoord(g_texRectTVtx[0]); + glVertex3f(g_texRectTVtx[0].x, g_texRectTVtx[0].y, -g_texRectTVtx[0].z); + + OGLRender::TexCoord(g_texRectTVtx[2]); + glVertex3f(g_texRectTVtx[2].x, g_texRectTVtx[2].y, -g_texRectTVtx[2].z); + + OGLRender::TexCoord(g_texRectTVtx[3]); + glVertex3f(g_texRectTVtx[3].x, g_texRectTVtx[3].y, -g_texRectTVtx[3].z); + + glEnd(); + +#elif SDL_VIDEO_OPENGL_ES2 + + GLfloat colour[] = { + gRDP.fvPrimitiveColor[0], gRDP.fvPrimitiveColor[1], gRDP.fvPrimitiveColor[2], gRDP.fvPrimitiveColor[3], + gRDP.fvPrimitiveColor[0], gRDP.fvPrimitiveColor[1], gRDP.fvPrimitiveColor[2], gRDP.fvPrimitiveColor[3], + gRDP.fvPrimitiveColor[0], gRDP.fvPrimitiveColor[1], gRDP.fvPrimitiveColor[2], gRDP.fvPrimitiveColor[3], + + gRDP.fvPrimitiveColor[0], gRDP.fvPrimitiveColor[1], gRDP.fvPrimitiveColor[2], gRDP.fvPrimitiveColor[3], + gRDP.fvPrimitiveColor[0], gRDP.fvPrimitiveColor[1], gRDP.fvPrimitiveColor[2], gRDP.fvPrimitiveColor[3], + gRDP.fvPrimitiveColor[0], gRDP.fvPrimitiveColor[1], gRDP.fvPrimitiveColor[2], gRDP.fvPrimitiveColor[3], + }; + + GLfloat tex[] = { + g_texRectTVtx[0].tcord[0].u,g_texRectTVtx[0].tcord[0].v, + g_texRectTVtx[1].tcord[0].u,g_texRectTVtx[1].tcord[0].v, + g_texRectTVtx[2].tcord[0].u,g_texRectTVtx[2].tcord[0].v, + + g_texRectTVtx[0].tcord[0].u,g_texRectTVtx[0].tcord[0].v, + g_texRectTVtx[2].tcord[0].u,g_texRectTVtx[2].tcord[0].v, + g_texRectTVtx[3].tcord[0].u,g_texRectTVtx[3].tcord[0].v, + }; + + float w = windowSetting.uDisplayWidth / 2.0f, h = windowSetting.uDisplayHeight / 2.0f, inv = 1.0f; + + GLfloat vertices[] = { + -inv + g_texRectTVtx[0].x/ w, inv - g_texRectTVtx[0].y/ h, -g_texRectTVtx[0].z,1, + -inv + g_texRectTVtx[1].x/ w, inv - g_texRectTVtx[1].y/ h, -g_texRectTVtx[1].z,1, + -inv + g_texRectTVtx[2].x/ w, inv - g_texRectTVtx[2].y/ h, -g_texRectTVtx[2].z,1, + + -inv + g_texRectTVtx[0].x/ w, inv - g_texRectTVtx[0].y/ h, -g_texRectTVtx[0].z,1, + -inv + g_texRectTVtx[2].x/ w, inv - g_texRectTVtx[2].y/ h, -g_texRectTVtx[2].z,1, + -inv + g_texRectTVtx[3].x/ w, inv - g_texRectTVtx[3].y/ h, -g_texRectTVtx[3].z,1 + }; + + + glVertexAttribPointer(VS_COLOR, 4, GL_FLOAT,GL_FALSE, 0, &colour ); + glVertexAttribPointer(VS_POSITION,4,GL_FLOAT,GL_FALSE,0,&vertices); + glVertexAttribPointer(VS_TEXCOORD0,2,GL_FLOAT,GL_FALSE, 0, &tex); + //OPENGL_CHECK_ERRORS; + glDrawArrays(GL_TRIANGLES,0,6); + //OPENGL_CHECK_ERRORS; + + //Restore old pointers + glVertexAttribPointer(VS_COLOR, 4, GL_UNSIGNED_BYTE,GL_TRUE, sizeof(uint8)*4, &(g_oglVtxColors[0][0]) ); + glVertexAttribPointer(VS_POSITION,4,GL_FLOAT,GL_FALSE,sizeof(float)*5,&(g_vtxProjected5[0][0])); + glVertexAttribPointer(VS_TEXCOORD0,2,GL_FLOAT,GL_FALSE, sizeof( TLITVERTEX ), &(g_vtxBuffer[0].tcord[0].u)); + +#endif + + if( cullface ) glEnable(GL_CULL_FACE); +} + + +void OGLRender::DrawObjBGCopy(uObjBg &info) +{ + if( IsUsedAsDI(g_CI.dwAddr) ) + { + DebugMessage(M64MSG_WARNING, "Unimplemented: write into Z buffer. Was mostly commented out in Rice Video 6.1.0"); + return; + } + else + { + CRender::LoadObjBGCopy(info); + CRender::DrawObjBGCopy(info); + } +} + + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLTexture.cpp b/libmupen64plus/mupen64plus-video-rice/src/OGLTexture.cpp new file mode 100644 index 0000000000..55d6d64b5f --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLTexture.cpp @@ -0,0 +1,150 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#include + +#include "Config.h" +#include "Debugger.h" +#include "OGLDebug.h" +#include "OGLGraphicsContext.h" +#include "OGLTexture.h" +#include "TextureManager.h" + +COGLTexture::COGLTexture(uint32 dwWidth, uint32 dwHeight, TextureUsage usage) : + CTexture(dwWidth,dwHeight,usage), + m_glFmt(GL_RGBA) +{ + // FIXME: If usage is AS_RENDER_TARGET, we need to create pbuffer instead of regular texture + + m_dwTextureFmt = TEXTURE_FMT_A8R8G8B8; // Always use 32bit to load texture + glGenTextures( 1, &m_dwTextureName ); + OPENGL_CHECK_ERRORS; + + // Make the width and height be the power of 2 + uint32 w; + for (w = 1; w < dwWidth; w <<= 1); + m_dwCreatedTextureWidth = w; + for (w = 1; w < dwHeight; w <<= 1); + m_dwCreatedTextureHeight = w; + + if (dwWidth*dwHeight > 256*256) + TRACE4("Large texture: (%d x %d), created as (%d x %d)", + dwWidth, dwHeight,m_dwCreatedTextureWidth,m_dwCreatedTextureHeight); + + m_fYScale = (float)m_dwCreatedTextureHeight/(float)m_dwHeight; + m_fXScale = (float)m_dwCreatedTextureWidth/(float)m_dwWidth; + + m_pTexture = malloc(m_dwCreatedTextureWidth * m_dwCreatedTextureHeight * GetPixelSize()); + + switch( options.textureQuality ) + { + case TXT_QUALITY_DEFAULT: + if( options.colorQuality == TEXTURE_FMT_A4R4G4B4 ) + m_glFmt = GL_RGBA4; + break; + case TXT_QUALITY_32BIT: + break; + case TXT_QUALITY_16BIT: + m_glFmt = GL_RGBA4; + break; + }; + LOG_TEXTURE(TRACE2("New texture: (%d, %d)", dwWidth, dwHeight)); +} + +COGLTexture::~COGLTexture() +{ + // FIXME: If usage is AS_RENDER_TARGET, we need to destroy the pbuffer + + glDeleteTextures(1, &m_dwTextureName ); + OPENGL_CHECK_ERRORS; + free(m_pTexture); + m_pTexture = NULL; + m_dwWidth = 0; + m_dwHeight = 0; +} + +bool COGLTexture::StartUpdate(DrawInfo *di) +{ + if (m_pTexture == NULL) + return false; + + di->dwHeight = (uint16)m_dwHeight; + di->dwWidth = (uint16)m_dwWidth; + di->dwCreatedHeight = m_dwCreatedTextureHeight; + di->dwCreatedWidth = m_dwCreatedTextureWidth; + di->lpSurface = m_pTexture; + di->lPitch = GetPixelSize()*m_dwCreatedTextureWidth; + + return true; +} + +void COGLTexture::EndUpdate(DrawInfo *di) +{ + COGLGraphicsContext *pcontext = (COGLGraphicsContext *)(CGraphicsContext::g_pGraphicsContext); // we need this to check if the GL extension is avaible + + glBindTexture(GL_TEXTURE_2D, m_dwTextureName); + OPENGL_CHECK_ERRORS; + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + OPENGL_CHECK_ERRORS; + + // mipmap support + if(options.mipmapping) + { + int m_maximumAnistropy = pcontext->getMaxAnisotropicFiltering(); //if getMaxAnisotropicFiltering() return more than 0, so aniso is supported and maxAnisotropicFiltering is set + + // Set Anisotropic filtering (mipmapping have to be activated, aniso filtering is not effective without) + if( m_maximumAnistropy ) + { + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, m_maximumAnistropy); + OPENGL_CHECK_ERRORS; + } + + // Set Mipmap + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); + OPENGL_CHECK_ERRORS; + +#if SDL_VIDEO_OPENGL + // Tell to hardware to generate mipmap (himself) when glTexImage2D is called + glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE); +#elif SDL_VIDEO_OPENGL_ES2 + glGenerateMipmap(GL_TEXTURE_2D); +#endif + OPENGL_CHECK_ERRORS; + } + else + { + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + OPENGL_CHECK_ERRORS; + } + + // Copy the image data from main memory to video card texture memory +#if SDL_VIDEO_OPENGL + glTexImage2D(GL_TEXTURE_2D, 0, m_glFmt, m_dwCreatedTextureWidth, m_dwCreatedTextureHeight, 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, m_pTexture); +#elif SDL_VIDEO_OPENGL_ES2 + //GL_BGRA_IMG works on adreno but not inside profiler. + glTexImage2D(GL_TEXTURE_2D, 0, m_glFmt, m_dwCreatedTextureWidth, m_dwCreatedTextureHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, m_pTexture); +#endif + OPENGL_CHECK_ERRORS; +} + + +// Keep in mind that the real texture is not scaled to fix the created opengl texture yet. +// when the image is need to be scaled, ScaleImageToSurface in CTexure will be called to +// scale the image automatically + diff --git a/libmupen64plus/mupen64plus-video-rice/src/OGLTexture.h b/libmupen64plus/mupen64plus-video-rice/src/OGLTexture.h new file mode 100644 index 0000000000..a2642b8873 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/OGLTexture.h @@ -0,0 +1,46 @@ +/* +Copyright (C) 2003 Rice1964 + +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. +*/ + +#ifndef _OGL_TEXTURE_H_ +#define _OGL_TEXTURE_H_ + +#include "osal_opengl.h" + +#include "TextureManager.h" + +class COGLTexture : public CTexture +{ + friend class COGLRenderTexture; +public: + ~COGLTexture(); + + bool StartUpdate(DrawInfo *di); + void EndUpdate(DrawInfo *di); + + GLuint m_dwTextureName; + GLuint m_glFmt; +protected: + friend class OGLDeviceBuilder; + COGLTexture(uint32 dwWidth, uint32 dwHeight, TextureUsage usage = AS_NORMAL); +}; + + +#endif + + + diff --git a/libmupen64plus/mupen64plus-video-rice/src/RDP_Texture.h b/libmupen64plus/mupen64plus-video-rice/src/RDP_Texture.h new file mode 100644 index 0000000000..eb35d5ce45 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/RDP_Texture.h @@ -0,0 +1,2246 @@ +/* +Copyright (C) 2002 Rice1964 + +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. + +*/ + +// Texture related ucode + +#include + +#include +#include "Render.h" + +uint32 g_TmemFlag[16]; +void SetTmemFlag(uint32 tmemAddr, uint32 size); +bool IsTmemFlagValid(uint32 tmemAddr); +uint32 GetValidTmemInfoIndex(uint32 tmemAddr); + +void EnhanceTexture(TxtrCacheEntry *pEntry); +void MirrorTexture(uint32 tileno, TxtrCacheEntry *pEntry); +void LoadHiresTexture( TxtrCacheEntry &entry ); + + +extern TMEMLoadMapInfo g_tmemInfo0; // Info for Tmem=0 +extern TMEMLoadMapInfo g_tmemInfo1; // Info for Tmem=0x100 + +TmemType g_Tmem; + +/************************************************************************/ +/* */ +/************************************************************************/ +uint32 sizeShift[4] = {2,1,0,0}; +uint32 sizeIncr[4] = {3,1,0,0}; +uint32 sizeBytes[4] = {0,1,2,4}; + +inline uint32 Txl2Words(uint32 width, uint32 size) +{ + if( size == TXT_SIZE_4b ) + return max(1, width/16); + else + return max(1, width*sizeBytes[size]/8); +} + +inline uint32 CalculateImgSize(uint32 width, uint32 height, uint32 size) +{ + //(((width)*(height) + siz##_INCR) >> siz##_SHIFT) -1 + return (((width)*(height) + sizeIncr[size]) >> sizeShift[size]) -1; +} + + +inline uint32 CalculateDXT(uint32 txl2words) +{ + //#define CALC_DXT(width, b_txl) ((2048 + TXL2WORDS(width, b_txl) - 1) / TXL2WORDS(width, b_txl)) + if( txl2words == 0 ) return 1; + else return (2048+txl2words-1)/txl2words; +} + +inline uint32 ReverseDXT(uint32 val, uint32 lrs, uint32 width, uint32 size) +{ + //#define TXL2WORDS(txls, b_txl) MAX(1, ((txls)*(b_txl)/8)) + if( val == 0x800 ) return 1; + + unsigned int low = 2047/val; + if( CalculateDXT(low) > val ) low++; + unsigned int high = 2047/(val-1); + + if( low == high ) return low; + + for( unsigned int i=low; i<=high; i++ ) + { + if( Txl2Words(width, size) == i ) + return i; + } + + return (low+high)/2; //dxt = 2047 / (dxt-1); +} + +// The following inline assemble routines are borrowed from glN64, I am too tired to +// rewrite these routine by myself. +// Rice, 02/24/2004 + +inline void UnswapCopy( void *src, void *dest, uint32 numBytes ) +{ +#if !defined(__GNUC__) && !defined(NO_ASM) + __asm + { + mov ecx, 0 + mov esi, dword ptr [src] + mov edi, dword ptr [dest] + + mov ebx, esi + and ebx, 3 // ebx = number of leading bytes + + cmp ebx, 0 + jz StartDWordLoop + neg ebx + add ebx, 4 + + cmp ebx, [numBytes] + jle NotGreater + mov ebx, [numBytes] +NotGreater: + mov ecx, ebx + xor esi, 3 +LeadingLoop: // Copies leading bytes, in reverse order (un-swaps) + mov al, byte ptr [esi] + mov byte ptr [edi], al + sub esi, 1 + add edi, 1 + loop LeadingLoop + add esi, 5 + +StartDWordLoop: + mov ecx, dword ptr [numBytes] + sub ecx, ebx // Don't copy what's already been copied + + mov ebx, ecx + and ebx, 3 + // add ecx, 3 // Round up to nearest dword + shr ecx, 2 + + cmp ecx, 0 // If there's nothing to do, don't do it + jle StartTrailingLoop + + // Copies from source to destination, bswap-ing first +DWordLoop: + mov eax, dword ptr [esi] + bswap eax + mov dword ptr [edi], eax + add esi, 4 + add edi, 4 + loop DWordLoop +StartTrailingLoop: + cmp ebx, 0 + jz Done + mov ecx, ebx + xor esi, 3 + +TrailingLoop: + mov al, byte ptr [esi] + mov byte ptr [edi], al + sub esi, 1 + add edi, 1 + loop TrailingLoop +Done: + } +#elif defined(__GNUC__) && defined(__x86_64__) && !defined(NO_ASM) + asm volatile(" movl %k1, %%ebx \n" + " andl $3, %%ebx \n" + " cmpl $0, %%ebx \n" + " jz 2f \n" + " negl %%ebx \n" + " addl $4, %%ebx \n" + " cmpl %k2, %%ebx \n" + " jle 0f \n" + " movl %k2, %%ebx \n" + "0: \n" + " movl %%ebx, %%ecx \n" + " xor $3, %1 \n" + "1: \n" + " movb (%1), %%al \n" + " movb %%al, (%0) \n" + " sub $1, %1 \n" + " add $1, %0 \n" + " decl %%ecx \n" + " jne 1b \n" + " add $5, %1 \n" + "2: \n" + " movl %k2, %%ecx \n" + " subl %%ebx, %%ecx \n" + " movl %%ecx, %%ebx \n" + " andl $3, %%ebx \n" + " shrl $2, %%ecx \n" + " cmpl $0, %%ecx \n" + " jle 4f \n" + "3: \n" + " movl (%1), %%eax \n" + " bswapl %%eax \n" + " movl %%eax, (%0) \n" + " add $4, %1 \n" + " add $4, %0 \n" + " decl %%ecx \n" + " jne 3b \n" + "4: \n" + " cmpl $0, %%ebx \n" + " jz 6f \n" + " xor $3, %1 \n" + "5: \n" + " movb (%1), %%al \n" + " movb %%al, (%0) \n" + " sub $1, %1 \n" + " add $1, %0 \n" + " decl %%ebx \n" + " jne 5b \n" + "6: \n" + :"+r"(dest), "+r"(src) + :"r"(numBytes) + : "memory", "cc", "%rax", "%rbx", "%rcx" + ); + +#elif !defined(NO_ASM) + unsigned int saveEBX; + asm volatile ("mov %%ebx, %2 \n" + "mov $0, %%ecx \n" + "mov %0, %%esi \n" + "mov %1, %%edi \n" + + "mov %%esi, %%ebx \n" + "and $3, %%ebx \n" // ebx = number of leading bytes + + "cmp $0, %%ebx \n" + "jz 2f \n" //jz StartDWordLoop + "neg %%ebx \n" + "add $4, %%ebx \n" + + "cmp %3, %%ebx \n" + "jle 0f \n" //jle NotGreater + "mov %3, %%ebx \n" + "0: \n" //NotGreater: + "mov %%ebx, %%ecx \n" + "xor $3, %%esi \n" + "1: \n" //LeadingLoop: // Copies leading bytes, in reverse order (un-swaps) + "mov (%%esi), %%al \n" + "mov %%al, (%%edi) \n" + "sub $1, %%esi \n" + "add $1, %%edi \n" + "loop 1b \n" //loop LeadingLoop + "add $5, %%esi \n" + + "2: \n" //StartDWordLoop: + "mov %3, %%ecx \n" + "sub %%ebx, %%ecx \n" // Don't copy what's already been copied + + "mov %%ecx, %%ebx \n" + "and $3, %%ebx \n" + // add ecx, 3 // Round up to nearest dword + "shr $2, %%ecx \n" + + "cmp $0, %%ecx \n" // If there's nothing to do, don't do it + "jle 4f \n" //jle StartTrailingLoop + + // Copies from source to destination, bswap-ing first + "3: \n" //DWordLoop: + "mov (%%esi), %%eax \n" + "bswap %%eax \n" + "mov %%eax, (%%edi) \n" + "add $4, %%esi \n" + "add $4, %%edi \n" + "loop 3b \n" //loop DWordLoop + "4: \n" //StartTrailingLoop: + "cmp $0, %%ebx \n" + "jz 6f \n" //jz Done + "mov %%ebx, %%ecx \n" + "xor $3, %%esi \n" + + "5: \n" //TrailingLoop: + "mov (%%esi), %%al \n" + "mov %%al, (%%edi) \n" + "sub $1, %%esi \n" + "add $1, %%edi \n" + "loop 5b \n" //loop TrailingLoop + "6: \n" //Done: + "mov %2, %%ebx \n" + : + : "m"(src), "m"(dest), "m"(saveEBX), "m"(numBytes) + : "memory", "cc", "%ecx", "%esi", "%edi", "%eax" + ); +#endif +} + +inline void DWordInterleave( void *mem, uint32 numDWords ) +{ +#if !defined(__GNUC__) && !defined(NO_ASM) + __asm { + mov esi, dword ptr [mem] + mov edi, dword ptr [mem] + add edi, 4 + mov ecx, dword ptr [numDWords] +DWordInterleaveLoop: + mov eax, dword ptr [esi] + mov ebx, dword ptr [edi] + mov dword ptr [esi], ebx + mov dword ptr [edi], eax + add esi, 8 + add edi, 8 + loop DWordInterleaveLoop + } +#elif defined(__GNUC__) && defined(__x86_64__) && !defined(NO_ASM) + asm volatile("0: \n" + " movl (%0), %%eax \n" + " movl 8(%0), %%ebx \n" + " movl %%eax, 8(%0) \n" + " movl %%ebx, (%0) \n" + " add $8, %0 \n" + " decl %k1 \n" + " jne 0b \n" + : "+r"(mem), "+r"(numDWords) + : + : "memory", "cc", "%rax", "%rbx" + ); +#elif !defined(NO_ASM) + unsigned int saveEBX; + asm volatile ("mov %%ebx, %2 \n" + "mov %0, %%esi \n" + "mov %0, %%edi \n" + "add $4, %%edi \n" + "mov %1, %%ecx \n" + "0: \n" //DWordInterleaveLoop: + "mov (%%esi), %%eax \n" + "mov (%%edi), %%ebx \n" + "mov %%ebx, (%%esi) \n" + "mov %%eax, (%%edi) \n" + "add $8, %%esi \n" + "add $8, %%edi \n" + "loop 0b \n" //loop DWordInterleaveLoop + "mov %2, %%ebx \n" + : + : "m"(mem), "m"(numDWords), "m"(saveEBX) + : "memory", "cc", "%esi", "%edi", "%ecx", "%eax" + ); +#endif +} + +inline void QWordInterleave( void *mem, uint32 numDWords ) +{ +#if !defined(__GNUC__) && !defined(NO_ASM) + __asm + { + // Interleave the line on the qword + mov esi, dword ptr [mem] + mov edi, dword ptr [mem] + add edi, 8 + mov ecx, dword ptr [numDWords] + shr ecx, 1 +QWordInterleaveLoop: + mov eax, dword ptr [esi] + mov ebx, dword ptr [edi] + mov dword ptr [esi], ebx + mov dword ptr [edi], eax + add esi, 4 + add edi, 4 + mov eax, dword ptr [esi] + mov ebx, dword ptr [edi] + mov dword ptr [esi], ebx + mov dword ptr [edi], eax + add esi, 12 + add edi, 12 + loop QWordInterleaveLoop + } +#elif defined(__GNUC__) && defined(__x86_64__) && !defined(NO_ASM) + asm volatile(" shr $1, %k1 \n" + "0: \n" + " mov (%0), %%rax \n" + " mov 8(%0), %%rbx \n" + " mov %%rax, 8(%0) \n" + " mov %%rbx, (%0) \n" + " add $16, %0 \n" + " decl %k1 \n" + " jne 0b \n" + : "+r"(mem), "+r"(numDWords) + : + : "memory", "cc", "%rax", "%rbx" + ); +#elif !defined(NO_ASM) // GCC assumed + + unsigned int saveEBX; + asm volatile("mov %%ebx, %2 \n" + // Interleave the line on the qword + "mov %0, %%esi \n" + "mov %0, %%edi \n" + "add $8, %%edi \n" + "mov %1, %%ecx \n" + "shr $1, %%ecx \n" + "0: \n" //QWordInterleaveLoop: + "mov (%%esi), %%eax \n" + "mov (%%edi), %%ebx \n" + "mov %%ebx, (%%esi) \n" + "mov %%eax, (%%edi) \n" + "add $4, %%esi \n" + "add $4, %%edi \n" + "mov (%%esi), %%eax \n" + "mov (%%edi), %%ebx \n" + "mov %%ebx, (%%esi) \n" + "mov %%eax, (%%edi) \n" + "add $12, %%esi \n" + "add $12, %%edi \n" + "loop 0b \n" //loop QWordInterleaveLoop + "mov %2, %%ebx \n" + : + : "m"(mem), "m"(numDWords), "m"(saveEBX) + : "memory", "cc", "%esi", "%edi", "%ecx", "%eax" + ); +#endif +} + +inline uint32 swapdword( uint32 value ) +{ +#if defined(__INTEL_COMPILER) && !defined(NO_ASM) + __asm + { + mov eax, dword ptr [value] + bswap eax + } +#elif defined(__GNUC__) && defined(__x86_64__) && !defined(NO_ASM) + asm volatile(" bswapl %k0 \n" + : "+r"(value) + : + : + ); + return value; +#elif defined(__GNUC__) && defined(__i386__) && !defined(NO_ASM) + asm volatile("bswapl %0 \n" + : "+r"(value) + : + : + ); + return value; +#else + return ((value & 0xff000000) >> 24) | + ((value & 0x00ff0000) >> 8) | + ((value & 0x0000ff00) << 8) | + ((value & 0x000000ff) << 24); +#endif +} + +inline uint16 swapword( uint16 value ) +{ +#if defined(__INTEL_COMPILER) && !defined(NO_ASM) + __asm + { + mov ax, word ptr [value] + xchg ah, al + } +#elif defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__)) && !defined(NO_ASM) + asm volatile("xchg %%al, %%ah \n" + : "+a"(value) + : + : + ); + return value; +#else + return ((value & 0xff00) >> 8) | + ((value & 0x00ff) << 8); +#endif +} + + +void ComputeTileDimension(int mask, int clamp, int mirror, int width, uint32 &widthToCreate, uint32 &widthToLoad) +{ + int maskwidth = mask > 0 ? (1< 0 ) + { + if( width > maskwidth ) + { + if( clamp == 0 ) + { + // clamp is not used, so just use the dwTileMaskWidth as the real width + widthToCreate = widthToLoad = maskwidth; + } + else + { + widthToLoad = maskwidth; + //gti.WidthToCreate = dwTileWidth; + // keep the current WidthToCreate, we will do mirror/wrap + // during texture loading, not during rendering + } + } + else if( width < maskwidth ) + { + // dwTileWidth < dwTileMaskWidth + + if( clamp == 0 ) + { + if( maskwidth%width == 0 ) + { + if( (maskwidth/width)%2 == 0 || mirror == 0 ) + { + // Do nothing + // gti.WidthToLoad = gti.WidthToCreate = gRDP.tiles[tileno].dwWidth = dwTileWidth + } + else + { + widthToCreate = maskwidth; + } + } + else + { + widthToCreate = maskwidth; + //widthToLoad = maskwidth; + } + } + else + { + widthToCreate = maskwidth; + //widthToLoad = maskwidth; + } + } + else // dwTileWidth == dwTileMaskWidth + { + } + + // Some hacks, to limit the image size + if( mask >= 8 ) + { + if( maskwidth / width >= 2 ) + { + widthToCreate = width; + } + } + } +} + +bool conkerSwapHack=false; + +bool CalculateTileSizes_method_2(int tileno, TMEMLoadMapInfo *info, TxtrInfo >i) +{ + Tile &tile = gRDP.tiles[tileno]; + Tile &loadtile = gRDP.tiles[RDP_TXT_LOADTILE]; + + uint32 dwPitch; + + // Now Initialize the texture dimension + int dwTileWidth; + int dwTileHeight; + if( info->bSetBy == CMD_LOADTILE ) + { + if( tile.sl >= tile.sh ) + { + dwTileWidth = info->dwWidth; // From SetTImage + dwTileWidth = dwTileWidth << info->dwSize >> tile.dwSize; + } + else + { + dwTileWidth= tile.sh - tile.sl + 1; + } + + if( tile.tl >= tile.th ) + { + dwTileHeight= info->th - info->tl + 1; + } + else + { + dwTileHeight= tile.th - tile.tl + 1; + } + } + else + { + if( tile.dwMaskS == 0 || tile.bClampS ) + { + dwTileWidth = tile.hilite_sh - tile.hilite_sl +1; + if( dwTileWidth < tile.sh - tile.sl +1 ) + dwTileWidth = tile.sh - tile.sl +1; + if( dwTileWidth <= 0 ) + { + DebuggerAppendMsg("Error"); + } + } + else + { + if( tile.dwMaskS < 8 ) + dwTileWidth = (1 << tile.dwMaskS ); + else if( tile.dwLine ) + { + dwTileWidth = (tile.dwLine<<5)>>tile.dwSize; + } + else + { + if( tile.sl <= tile.sh ) + { + dwTileWidth = tile.sh - tile.sl +1; + } + else if( loadtile.sl <= loadtile.sh ) + { + dwTileWidth = loadtile.sh - loadtile.sl +1; + } + else + { + dwTileWidth = tile.sh - tile.sl +1; + } + } + } + + if( tile.dwMaskT == 0 || tile.bClampT ) + { + dwTileHeight= tile.hilite_th - tile.hilite_tl +1; + if( dwTileHeight < tile.th - tile.tl +1 ) + dwTileHeight = tile.th - tile.tl +1; + + if( dwTileHeight <= 0 ) + { + DebuggerAppendMsg("Error"); + } + } + else + { + if( tile.dwMaskT < 8 ) + dwTileHeight = (1 << tile.dwMaskT ); + else if( tile.tl <= tile.th ) + { + dwTileHeight = tile.th - tile.tl +1; + } + else if( loadtile.tl <= loadtile.th ) + { + dwTileHeight = loadtile.th - loadtile.tl +1; + } + else + { + dwTileHeight = tile.th - tile.tl +1; + } + } + } + + int dwTileMaskWidth = tile.dwMaskS > 0 ? (1 << tile.dwMaskS ) : 0; + int dwTileMaskHeight = tile.dwMaskT > 0 ? (1 << tile.dwMaskT ) : 0; + + if( dwTileWidth < 0 || dwTileHeight < 0) + { + if( dwTileMaskWidth > 0 ) + dwTileWidth = dwTileMaskWidth; + else if( dwTileWidth < 0 ) + dwTileWidth = -dwTileWidth; + + if( dwTileMaskHeight > 0 ) + dwTileHeight = dwTileMaskHeight; + else if( dwTileHeight < 0 ) + dwTileHeight = -dwTileHeight; + } + + + + if( dwTileWidth-dwTileMaskWidth == 1 && dwTileMaskWidth && dwTileHeight-dwTileMaskHeight == 1 && dwTileMaskHeight ) + { + // Hack for Mario Kart + dwTileWidth--; + dwTileHeight--; + } + + ComputeTileDimension(tile.dwMaskS, tile.bClampS, + tile.bMirrorS, dwTileWidth, gti.WidthToCreate, gti.WidthToLoad); + tile.dwWidth = gti.WidthToCreate; + + ComputeTileDimension(tile.dwMaskT, tile.bClampT, + tile.bMirrorT, dwTileHeight, gti.HeightToCreate, gti.HeightToLoad); + tile.dwHeight = gti.HeightToCreate; + +#ifdef DEBUGGER + if( gti.WidthToCreate < gti.WidthToLoad ) + TRACE2("Check me, width to create = %d, width to load = %d", gti.WidthToCreate, gti.WidthToLoad); + if( gti.HeightToCreate < gti.HeightToLoad ) + TRACE2("Check me, height to create = %d, height to load = %d", gti.HeightToCreate, gti.HeightToLoad); +#endif + + + gti.bSwapped = info->bSwapped; + + if( info->bSetBy == CMD_LOADTILE ) + { + // It was a tile - the pitch is set by LoadTile + dwPitch = info->dwWidth<<(info->dwSize-1); + + if( dwPitch == 0 ) + { + dwPitch = 1024; // Hack for Bust-A-Move + } + } + else //Set by LoadBlock + { + // It was a block load - the pitch is determined by the tile size + if (info->dxt == 0 || info->dwTmem != tile.dwTMem ) + { + dwPitch = tile.dwLine << 3; + gti.bSwapped = TRUE; + if( info->dwTmem != tile.dwTMem && info->dxt != 0 && info->dwSize == TXT_SIZE_16b && tile.dwSize == TXT_SIZE_4b ) + conkerSwapHack = true; + } + else + { + uint32 DXT = info->dxt; + if( info->dxt > 1 ) + { + DXT = ReverseDXT(info->dxt, info->sh, dwTileWidth, tile.dwSize); + } + dwPitch = DXT << 3; + } + + if (tile.dwSize == TXT_SIZE_32b) + dwPitch = tile.dwLine << 4; + } + + gti.Pitch = tile.dwPitch = dwPitch; + + if( (gti.WidthToLoad < gti.WidthToCreate || tile.bSizeIsValid == false) && tile.dwMaskS > 0 && gti.WidthToLoad != (unsigned int)dwTileMaskWidth && + info->bSetBy == CMD_LOADBLOCK ) + //if( (gti.WidthToLoad < gti.WidthToCreate ) && tile.dwMaskS > 0 && gti.WidthToLoad != dwTileMaskWidth && + // info->bSetBy == CMD_LOADBLOCK ) + { + // We have got the pitch now, recheck the width_to_load + uint32 pitchwidth = dwPitch<<1>>tile.dwSize; + if( pitchwidth == (unsigned int)dwTileMaskWidth ) + { + gti.WidthToLoad = pitchwidth; + } + } + if( (gti.HeightToLoad < gti.HeightToCreate || tile.bSizeIsValid == false) && tile.dwMaskT > 0 && gti.HeightToLoad != (unsigned int)dwTileMaskHeight && + info->bSetBy == CMD_LOADBLOCK ) + //if( (gti.HeightToLoad < gti.HeightToCreate ) && tile.dwMaskT > 0 && gti.HeightToLoad != dwTileMaskHeight && + // info->bSetBy == CMD_LOADBLOCK ) + { + //uint32 pitchwidth = dwPitch<<1>>tile.dwSize; + uint32 pitchHeight = (info->dwTotalWords<<1)/dwPitch; + if( pitchHeight == (unsigned int)dwTileMaskHeight || gti.HeightToLoad == 1 ) + { + gti.HeightToLoad = pitchHeight; + } + } + if( gti.WidthToCreate < gti.WidthToLoad ) gti.WidthToCreate = gti.WidthToLoad; + if( gti.HeightToCreate < gti.HeightToLoad ) gti.HeightToCreate = gti.HeightToLoad; + + if( info->bSetBy == CMD_LOADTILE ) + { + gti.LeftToLoad = (info->sl<dwSize)>>tile.dwSize; + gti.TopToLoad = info->tl; + } + else + { + gti.LeftToLoad = (info->sl<dwSize)>>tile.dwSize; + gti.TopToLoad = (info->tl<dwSize)>>tile.dwSize; + } + + uint32 total64BitWordsToLoad = (gti.HeightToLoad*gti.WidthToLoad)>>(4-tile.dwSize); + if( total64BitWordsToLoad + tile.dwTMem > 0x200 ) + { + //TRACE0("Warning: texture loading tmem is over range"); + if( gti.WidthToLoad > gti.HeightToLoad ) + { + uint32 newheight = (dwPitch << 1 )>> tile.dwSize; + tile.dwWidth = gti.WidthToLoad = gti.WidthToCreate = min(newheight, (gti.WidthToLoad&0xFFFFFFFE)); + tile.dwHeight = gti.HeightToCreate = gti.HeightToLoad = ((0x200 - tile.dwTMem) << (4-tile.dwSize)) / gti.WidthToLoad; + } + else + { + tile.dwHeight = gti.HeightToCreate = gti.HeightToLoad = info->dwTotalWords / ((gti.WidthToLoad << tile.dwSize) >> 1); + } + } + + // Check the info + if( (info->dwTotalWords>>2) < total64BitWordsToLoad+tile.dwTMem-info->dwTmem - 4 ) + { + // Hack here + if( (options.enableHackForGames == HACK_FOR_ZELDA||options.enableHackForGames == HACK_FOR_ZELDA_MM) && (unsigned int)tileno != gRSP.curTile ) + { + return false; + } + + if( total64BitWordsToLoad+tile.dwTMem-info->dwTmem <= 0x200 ) + { + LOG_TEXTURE(TRACE4("Fix me, info is not covering this Tmem address,Info start: 0x%x, total=0x%x, Tmem start: 0x%x, total=0x%x", + info->dwTmem,info->dwTotalWords>>2, tile.dwTMem, total64BitWordsToLoad)); + } + } + + //Check memory boundary + if( gti.Address + gti.HeightToLoad*gti.Pitch >= g_dwRamSize ) + { + WARNING(TRACE0("Warning: texture loading tmem is over range 3")); + gti.HeightToCreate = gti.HeightToLoad = tile.dwHeight = (g_dwRamSize-gti.Address)/gti.Pitch; + } + + return true; +} + +bool CalculateTileSizes_method_1(int tileno, TMEMLoadMapInfo *info, TxtrInfo >i) +{ + Tile &tile = gRDP.tiles[tileno]; + //Tile &loadtile = gRDP.tiles[RDP_TXT_LOADTILE]; + + // Now Initialize the texture dimension + int loadwidth, loadheight; + + int maskwidth = tile.dwMaskS ? (1 << tile.dwMaskS ) : 0; + int maskheight = tile.dwMaskT ? (1 << tile.dwMaskT ) : 0; + int clampwidth = abs(tile.hilite_sh - tile.hilite_sl) +1; + int clampheight = abs(tile.hilite_th - tile.hilite_tl) +1; + int linewidth = tile.dwLine << (5 - tile.dwSize); + + gti.bSwapped = info->bSwapped; + + if( info->bSetBy == CMD_LOADTILE ) + { + loadwidth = (abs(info->sh - info->sl) + 1) << info->dwSize >> tile.dwSize; + loadheight = (abs(info->th - info->tl) + 1) << info->dwSize >> tile.dwSize; + + tile.dwPitch = info->dwWidth << info->dwSize >> 1; + if( tile.dwPitch == 0 ) tile.dwPitch = 1024; // Hack for Bust-A-Move + + gti.LeftToLoad = (info->sl<dwSize)>>tile.dwSize; + gti.TopToLoad = info->tl; + } + else + { + loadwidth = abs(tile.sh - tile.sl) +1; + if( tile.dwMaskS ) + { + loadwidth = maskwidth; + } + + loadheight = abs(tile.th - tile.tl) +1; + if( tile.dwMaskT ) + { + loadheight = maskheight; + } + + + // It was a block load - the pitch is determined by the tile size + if (tile.dwSize == TXT_SIZE_32b) + tile.dwPitch = tile.dwLine << 4; + else if (info->dxt == 0 ) + { + tile.dwPitch = tile.dwLine << 3; + gti.bSwapped = TRUE; + if( info->dwTmem != tile.dwTMem && info->dxt != 0 && info->dwSize == TXT_SIZE_16b && tile.dwSize == TXT_SIZE_4b ) + conkerSwapHack = true; + } + else + { + uint32 DXT = info->dxt; + if( info->dxt > 1 ) + { + DXT = ReverseDXT(info->dxt, info->sh, loadwidth, tile.dwSize); + } + tile.dwPitch = DXT << 3; + } + + gti.LeftToLoad = (info->sl<dwSize)>>tile.dwSize; + gti.TopToLoad = (info->tl<dwSize)>>tile.dwSize; + } + + if( options.enableHackForGames == HACK_FOR_MARIO_KART ) + { + if( loadwidth-maskwidth == 1 && tile.dwMaskS ) + { + loadwidth--; + if( loadheight%2 ) loadheight--; + } + + if( loadheight-maskheight == 1 && tile.dwMaskT ) + { + loadheight--; + if(loadwidth%2) loadwidth--; + } + + if( loadwidth - ((g_TI.dwWidth<>tile.dwSize) == 1 ) + { + loadwidth--; + if( loadheight%2 ) loadheight--; + } + } + + + // Limit the texture size + if( g_curRomInfo.bUseSmallerTexture ) + { + if( tile.dwMaskS && tile.bClampS ) + { + if( !tile.bMirrorS ) + { + if( clampwidth/maskwidth >= 2 ) + { + clampwidth = maskwidth; + tile.bForceWrapS = true; + } + else if( clampwidth && maskwidth/clampwidth >= 2 ) + { + maskwidth = clampwidth; + tile.bForceClampS = true; + } + } + else + { + if( clampwidth/maskwidth == 2 ) + { + clampwidth = maskwidth*2; + tile.bForceWrapS = false; + } + else if( clampwidth/maskwidth > 2 ) + { + clampwidth = maskwidth*2; + tile.bForceWrapS = true; + } + } + } + + if( tile.dwMaskT && tile.bClampT ) + { + if( !tile.bMirrorT ) + { + if( clampheight/maskheight >= 2 ) + { + clampheight = maskheight; + tile.bForceWrapT = true; + } + else if( clampheight && maskheight/clampheight >= 2 ) + { + maskwidth = clampwidth; + tile.bForceClampT = true; + } + } + else + { + if( clampheight/maskheight == 2 ) + { + clampheight = maskheight*2; + tile.bForceWrapT = false; + } + else if( clampheight/maskheight >= 2 ) + { + clampheight = maskheight*2; + tile.bForceWrapT = true; + } + } + } + } + else + { + //if( clampwidth > linewidth ) clampwidth = linewidth; + if( clampwidth > 512 && clampheight > 512 ) + { + if( clampwidth > maskwidth && maskwidth && clampheight > 256 ) clampwidth = maskwidth; + if( clampheight > maskheight && maskheight && clampheight > 256 ) clampheight = maskheight; + } + + if( tile.dwMaskS > 8 && tile.dwMaskT > 8 ) + { + maskwidth = loadwidth; + maskheight = loadheight; + } + else + { + if( tile.dwMaskS > 10 ) + maskwidth = loadwidth; + if( tile.dwMaskT > 10 ) + maskheight = loadheight; + } + } + + gti.Pitch = tile.dwPitch; + + if( tile.dwMaskS == 0 || tile.bClampS ) + { + gti.WidthToLoad = linewidth ? min( linewidth, maskwidth ? min(clampwidth,maskwidth) : clampwidth ) : clampwidth; + if( tile.dwMaskS && clampwidth < maskwidth ) + tile.dwWidth = gti.WidthToCreate = clampwidth; + else + tile.dwWidth = gti.WidthToCreate = max(clampwidth,maskwidth); + } + else + { + gti.WidthToLoad = loadwidth > 2 ? min(loadwidth,maskwidth) : maskwidth; + if( linewidth ) gti.WidthToLoad = min( linewidth, (int)gti.WidthToLoad ); + tile.dwWidth = gti.WidthToCreate = maskwidth; + } + + if( tile.dwMaskT == 0 || tile.bClampT ) + { + gti.HeightToLoad = maskheight ? min(clampheight,maskheight) : clampheight; + if( tile.dwMaskT && clampheight < maskheight ) + tile.dwHeight = gti.HeightToCreate = clampheight; + else + tile.dwHeight = gti.HeightToCreate = max(clampheight,maskheight); + } + else + { + gti.HeightToLoad = loadheight > 2 ? min(loadheight,maskheight) : maskheight; + tile.dwHeight = gti.HeightToCreate = maskheight; + } + + if( options.enableHackForGames == HACK_FOR_MARIO_KART ) + { + if( gti.WidthToLoad - ((g_TI.dwWidth<>tile.dwSize) == 1 ) + { + gti.WidthToLoad--; + if( gti.HeightToLoad%2 ) gti.HeightToLoad--; + } + } + + // Double check + uint32 total64BitWordsToLoad = (gti.HeightToLoad*gti.WidthToLoad)>>(4-tile.dwSize); + if( total64BitWordsToLoad + tile.dwTMem > 0x200 ) + { + //TRACE0("Warning: texture loading tmem is over range"); + if( gti.WidthToLoad > gti.HeightToLoad ) + { + uint32 newheight = (tile.dwPitch << 1 )>> tile.dwSize; + tile.dwWidth = gti.WidthToLoad = gti.WidthToCreate = min(newheight, (gti.WidthToLoad&0xFFFFFFFE)); + tile.dwHeight = gti.HeightToCreate = gti.HeightToLoad = ((0x200 - tile.dwTMem) << (4-tile.dwSize)) / gti.WidthToLoad; + } + else + { + tile.dwHeight = gti.HeightToCreate = gti.HeightToLoad = info->dwTotalWords / ((gti.WidthToLoad << tile.dwSize) >> 1); + } + } + + // Check the info + if( (info->dwTotalWords>>2) < total64BitWordsToLoad+tile.dwTMem-info->dwTmem - 4 ) + { + // Hack here + if( (options.enableHackForGames == HACK_FOR_ZELDA||options.enableHackForGames == HACK_FOR_ZELDA_MM) && (unsigned int)tileno != gRSP.curTile ) + { + return false; + } + + if( total64BitWordsToLoad+tile.dwTMem-info->dwTmem <= 0x200 ) + { + LOG_TEXTURE(TRACE4("Fix me, info is not covering this Tmem address,Info start: 0x%x, total=0x%x, Tmem start: 0x%x, total=0x%x", + info->dwTmem,info->dwTotalWords>>2, tile.dwTMem, total64BitWordsToLoad)); + } + } + + //Check memory boundary + if( gti.Address + gti.HeightToLoad*gti.Pitch >= g_dwRamSize ) + { + WARNING(TRACE0("Warning: texture loading tmem is over range 3")); + gti.HeightToCreate = gti.HeightToLoad = tile.dwHeight = (g_dwRamSize-gti.Address)/gti.Pitch; + } + + return true; +} + +TxtrCacheEntry* LoadTexture(uint32 tileno) +{ + //TxtrCacheEntry *pEntry = NULL; + TxtrInfo gti; + + Tile &tile = gRDP.tiles[tileno]; + + // Retrieve the tile loading info + uint32 infoTmemAddr = tile.dwTMem; + TMEMLoadMapInfo *info = &g_tmemLoadAddrMap[infoTmemAddr]; + if( !IsTmemFlagValid(infoTmemAddr) ) + { + infoTmemAddr = GetValidTmemInfoIndex(infoTmemAddr); + info = &g_tmemLoadAddrMap[infoTmemAddr]; + } + + if( info->dwFormat != tile.dwFormat ) + { + // Check the tile format, hack for Zelda's road + if( tileno != gRSP.curTile && tile.dwTMem == gRDP.tiles[gRSP.curTile].dwTMem && + tile.dwFormat != gRDP.tiles[gRSP.curTile].dwFormat ) + { + //TRACE1("Tile %d format is not matching the loaded texture format", tileno); + return NULL; + } + } + + gti = tile; // Copy tile info to textureInfo entry + + gti.TLutFmt = gRDP.otherMode.text_tlut <dwLoadAddress+(tile.dwTMem-infoTmemAddr)*8) & (g_dwRamSize-1) ; + gti.pPhysicalAddress = ((uint8*)g_pRDRAMu32)+gti.Address; + gti.tileNo = tileno; + + if( g_curRomInfo.bTxtSizeMethod2 ) + { + if( !CalculateTileSizes_method_2(tileno, info, gti) ) + return NULL; + } + else + { + if( !CalculateTileSizes_method_1(tileno, info, gti) ) + return NULL; + } + + LOG_TEXTURE( + { + TRACE0("Loading texture:\n"); + DebuggerAppendMsg("Left: %d, Top: %d, Width: %d, Height: %d, Size to Load (%d, %d)", + gti.LeftToLoad, gti.TopToLoad, gti.WidthToCreate, gti.HeightToCreate, gti.WidthToLoad, gti.HeightToLoad); + DebuggerAppendMsg("Pitch: %d, Addr: 0x%08x", gti.Pitch, gti.Address); + }); + + // Option for faster loading tiles + if( g_curRomInfo.bFastLoadTile && info->bSetBy == CMD_LOADTILE && ((gti.Pitch<<1)>>gti.Size) <= 0x400 + //&& ((gti.Pitch<<1)>>gti.Size) > 128 && status.primitiveType == PRIM_TEXTRECT + ) + { + uint32 idx = tileno-gRSP.curTile; + status.LargerTileRealLeft[idx] = gti.LeftToLoad; + gti.LeftToLoad=0; + gti.WidthToLoad = gti.WidthToCreate = ((gti.Pitch<<1)>>gti.Size); + status.UseLargerTile[idx]=true; + } + + // Loading the textures by using texture cache manager + return gTextureManager.GetTexture(>i, true, true, true); // Load the texture by using texture cache +} + +void PrepareTextures() +{ + if( gRDP.textureIsChanged || !currentRomOptions.bFastTexCRC || + CRender::g_pRender->m_pColorCombiner->m_pDecodedMux->m_ColorTextureFlag[0] || + CRender::g_pRender->m_pColorCombiner->m_pDecodedMux->m_ColorTextureFlag[1] ) + { + status.UseLargerTile[0]=false; + status.UseLargerTile[1]=false; + + int tilenos[2]; + if( CRender::g_pRender->IsTexel0Enable() || gRDP.otherMode.cycle_type == CYCLE_TYPE_COPY ) + tilenos[0] = gRSP.curTile; + else + tilenos[0] = -1; + + if( gRSP.curTile<7 && CRender::g_pRender->IsTexel1Enable() ) + tilenos[1] = gRSP.curTile+1; + else + tilenos[1] = -1; + + + for( int i=0; i<2; i++ ) + { + if( tilenos[i] < 0 ) continue; + + if( CRender::g_pRender->m_pColorCombiner->m_pDecodedMux->m_ColorTextureFlag[i] ) + { + TxtrCacheEntry *pEntry = gTextureManager.GetConstantColorTexture(CRender::g_pRender->m_pColorCombiner->m_pDecodedMux->m_ColorTextureFlag[i]); + CRender::g_pRender->SetCurrentTexture( tilenos[i], pEntry->pTexture, 4, 4, pEntry); + } + else + { + TxtrCacheEntry *pEntry = LoadTexture(tilenos[i]); + if (pEntry && pEntry->pTexture ) + { + if( pEntry->txtrBufIdx <= 0 ) + { + if( pEntry->pEnhancedTexture && pEntry->dwEnhancementFlag == TEXTURE_EXTERNAL && !options.bLoadHiResTextures ) + { + SAFE_DELETE(pEntry->pEnhancedTexture); + } + + if( pEntry->pEnhancedTexture == NULL ) + { + MirrorTexture(tilenos[i], pEntry);; + } + + if( options.bLoadHiResTextures && (pEntry->pEnhancedTexture == NULL || pEntry->dwEnhancementFlag < TEXTURE_EXTERNAL ) ) + { + LoadHiresTexture(*pEntry); + } + + if( pEntry->pEnhancedTexture == NULL || (pEntry->dwEnhancementFlag != options.textureEnhancement && pEntry->dwEnhancementFlag < TEXTURE_EXTERNAL ) ) + { + EnhanceTexture(pEntry); + } + } + + CRender::g_pRender->SetCurrentTexture( tilenos[i], + (pEntry->pEnhancedTexture)?pEntry->pEnhancedTexture:pEntry->pTexture, + pEntry->ti.WidthToLoad, pEntry->ti.HeightToLoad, pEntry); + } + else + { + pEntry = gTextureManager.GetBlackTexture(); + CRender::g_pRender->SetCurrentTexture( tilenos[i], pEntry->pTexture, 4, 4, pEntry); + _VIDEO_DisplayTemporaryMessage("Fail to load texture, use black to replace"); + } + + } + } + + gRDP.textureIsChanged = false; + } +} + +extern uint32 g_TxtLoadBy;; + +void DLParser_LoadTLut(Gfx *gfx) +{ +gRDP.textureIsChanged = true; + +uint32 tileno = gfx->loadtile.tile; +uint32 uls = gfx->loadtile.sl/4; +uint32 ult = gfx->loadtile.tl/4; +uint32 lrs = gfx->loadtile.sh/4; +uint32 lrt = gfx->loadtile.th/4; + +#ifdef DEBUGGER +uint32 dwTLutFmt = (gRDP.otherModeH >> RSP_SETOTHERMODE_SHIFT_TEXTLUT)&0x3; +#endif + +uint32 dwCount; +// starting location in the palettes +uint32 dwTMEMOffset = gRDP.tiles[tileno].dwTMem - 256; +// number to copy +dwCount = ((uint16)((gfx->words.w1) >> 14) & 0x03FF) + 1; +uint32 dwRDRAMOffset = 0; + +Tile &tile = gRDP.tiles[tileno]; +tile.bForceWrapS = tile.bForceWrapT = tile.bForceClampS = tile.bForceClampT = false; + +tile.hilite_sl = tile.sl = uls; +tile.hilite_tl = tile.tl = ult; +tile.sh = lrs; +tile.th = lrt; +tile.bSizeIsValid = true; + +tile.lastTileCmd = CMD_LOADTLUT; + +#ifdef DEBUGGER +/* +if((((gfx->words.w0)>>12)&0x3) != 0 || (((gfx->words.w0))&0x3) != 0 || (((gfx->words.w1)>>12)&0x3) != 0 || (((gfx->words.w1))&0x3) != 0) + TRACE0("Load tlut, sl,tl,sh,th are not integers"); +*/ +#endif + +dwCount = (lrs - uls)+1; +dwRDRAMOffset = (uls + ult*g_TI.dwWidth )*2; +uint32 dwPalAddress = g_TI.dwAddr + dwRDRAMOffset; + +//Copy PAL to the PAL memory +uint16 *srcPal = (uint16*)(g_pRDRAMu8 + (dwPalAddress& (g_dwRamSize-1)) ); +for (uint32 i=0; iloadtile.tile; + uint32 uls = gfx->loadtile.sl; + uint32 ult = gfx->loadtile.tl; + uint32 lrs = gfx->loadtile.sh; + uint32 dxt = gfx->loadtile.th; // 1.11 fixed point + + Tile &tile = gRDP.tiles[tileno]; + tile.bForceWrapS = tile.bForceWrapT = tile.bForceClampS = tile.bForceClampT = false; + + uint32 size = lrs+1; + if( tile.dwSize == TXT_SIZE_32b ) size<<=1; + + SetTmemFlag(tile.dwTMem, size>>2); + + TMEMLoadMapInfo &info = g_tmemLoadAddrMap[tile.dwTMem]; + + info.bSwapped = (dxt == 0? TRUE : FALSE); + + info.sl = tile.hilite_sl = tile.sl = uls; + info.sh = tile.hilite_sh = tile.sh = lrs; + info.tl = tile.tl = ult; + info.th = tile.th = dxt; + tile.bSizeIsValid = false; + + for( int i=0; i<8; i++ ) + { + if( tile.dwTMem == tile.dwTMem ) + tile.lastTileCmd = CMD_LOADBLOCK; + } + + info.dwLoadAddress = g_TI.dwAddr; + info.bSetBy = CMD_LOADBLOCK; + info.dxt = dxt; + info.dwLine = tile.dwLine; + + info.dwFormat = g_TI.dwFormat; + info.dwSize = g_TI.dwSize; + info.dwWidth = g_TI.dwWidth; + info.dwTotalWords = size; + info.dwTmem = tile.dwTMem; + + if( gRDP.tiles[tileno].dwTMem == 0 ) + { + if( size >= 1024 ) + { + memcpy(&g_tmemInfo0, &info, sizeof(TMEMLoadMapInfo) ); + g_tmemInfo0.dwTotalWords = size>>2; + } + + if( size == 2048 ) + { + memcpy(&g_tmemInfo1, &info, sizeof(TMEMLoadMapInfo) ); + g_tmemInfo1.dwTotalWords = size>>2; + } + } + else if( tile.dwTMem == 0x100 ) + { + if( size == 1024 ) + { + memcpy(&g_tmemInfo1, &info, sizeof(TMEMLoadMapInfo) ); + g_tmemInfo1.dwTotalWords = size>>2; + } + } + + g_TxtLoadBy = CMD_LOADBLOCK; + + + if( options.bUseFullTMEM ) + { + uint32 bytes = (lrs + 1) << tile.dwSize >> 1; + uint32 address = g_TI.dwAddr + ult * g_TI.bpl + (uls << g_TI.dwSize >> 1); + if ((bytes == 0) || ((address + bytes) > g_dwRamSize) || (((tile.dwTMem << 3) + bytes) > 4096)) + { + return; + } + uint64* src = (uint64*)(g_pRDRAMu8+address); + uint64* dest = &g_Tmem.g_Tmem64bit[tile.dwTMem]; + + if( dxt > 0) + { + void (*Interleave)( void *mem, uint32 numDWords ); + + uint32 line = (2047 + dxt) / dxt; + uint32 bpl = line << 3; + uint32 height = bytes / bpl; + + if (tile.dwSize == TXT_SIZE_32b) + Interleave = QWordInterleave; + else + Interleave = DWordInterleave; + + for (uint32 y = 0; y < height; y++) + { + UnswapCopy( src, dest, bpl ); + if (y & 1) Interleave( dest, line ); + + src += line; + dest += line; + } + } + else + UnswapCopy( src, dest, bytes ); + } + + + LOG_UCODE(" Tile:%d (%d,%d - %d) DXT:0x%04x\n", tileno, uls, ult, lrs, dxt); + + LOG_TEXTURE( + { + DebuggerAppendMsg("LoadBlock:%d (%d,%d,%d) DXT:0x%04x(%X)\n", + tileno, uls, ult, (((gfx->words.w1)>>12)&0x0FFF), dxt, ((gfx->words.w1)&0x0FFF)); + }); + + DEBUGGER_PAUSE_COUNT_N(NEXT_TEXTURE_CMD); +} + +void swap(uint32 &a, uint32 &b) +{ + uint32 temp = a; + a = b; + b = temp; +} +void DLParser_LoadTile(Gfx *gfx) +{ + gRDP.textureIsChanged = true; + + uint32 tileno = gfx->loadtile.tile; + uint32 uls = gfx->loadtile.sl/4; + uint32 ult = gfx->loadtile.tl/4; + uint32 lrs = gfx->loadtile.sh/4; + uint32 lrt = gfx->loadtile.th/4; + + Tile &tile = gRDP.tiles[tileno]; + tile.bForceWrapS = tile.bForceWrapT = tile.bForceClampS = tile.bForceClampT = false; + + if (lrt < ult) swap(lrt, ult); + if (lrs < uls) swap(lrs, uls); + + tile.hilite_sl = tile.sl = uls; + tile.hilite_tl = tile.tl = ult; + tile.hilite_sh = tile.sh = lrs; + tile.hilite_th = tile.th = lrt; + tile.bSizeIsValid = true; + + // compute block height, and bpl of source and destination + uint32 bpl = (lrs - uls + 1) << tile.dwSize >> 1; + uint32 height = lrt - ult + 1; + uint32 line = tile.dwLine; + if (tile.dwSize == TXT_SIZE_32b) line <<= 1; + + if (((tile.dwTMem << 3) + line * height) > 4096) // check destination ending point (TMEM is 4k bytes) + return; + + if( options.bUseFullTMEM ) + { + void (*Interleave)( void *mem, uint32 numDWords ); + uint32 address, y; + uint64 *dest; + uint8 *src; + + if( g_TI.bpl == 0 ) + { + if( options.enableHackForGames == HACK_FOR_BUST_A_MOVE ) + { + g_TI.bpl = 1024; // Hack for Bust-A-Move + } + else + { + TRACE0("Warning: g_TI.bpl = 0" ); + } + } + + address = g_TI.dwAddr + tile.tl * g_TI.bpl + (tile.sl << g_TI.dwSize >> 1); + src = &g_pRDRAMu8[address]; + dest = &g_Tmem.g_Tmem64bit[tile.dwTMem]; + + if ((address + height * bpl) > g_dwRamSize) // check source ending point + { + return; + } + + // Line given for 32-bit is half what it seems it should since they split the + // high and low words. I'm cheating by putting them together. + if (tile.dwSize == TXT_SIZE_32b) + { + Interleave = QWordInterleave; + } + else + { + Interleave = DWordInterleave; + } + + if( tile.dwLine == 0 ) + { + //tile.dwLine = 1; + return; + } + + for (y = 0; y < height; y++) + { + UnswapCopy( src, dest, bpl ); + if (y & 1) Interleave( dest, line ); + + src += g_TI.bpl; + dest += line; + } + } + + + for( int i=0; i<8; i++ ) + { + if( gRDP.tiles[i].dwTMem == tile.dwTMem ) + gRDP.tiles[i].lastTileCmd = CMD_LOADTILE; + } + + uint32 size = line * height; + SetTmemFlag(tile.dwTMem,size ); + + LOG_TEXTURE( + { + DebuggerAppendMsg("LoadTile:%d (%d,%d) -> (%d,%d) [%d x %d]\n", + tileno, uls, ult, lrs, lrt, + (lrs - uls)+1, (lrt - ult)+1); + }); + + + DEBUGGER_PAUSE_COUNT_N(NEXT_TEXTURE_CMD); + + LOG_UCODE(" Tile:%d (%d,%d) -> (%d,%d) [%d x %d]", + tileno, uls, ult, lrs, lrt, + (lrs - uls)+1, (lrt - ult)+1); + + TMEMLoadMapInfo &info = g_tmemLoadAddrMap[tile.dwTMem]; + + info.dwLoadAddress = g_TI.dwAddr; + info.dwFormat = g_TI.dwFormat; + info.dwSize = g_TI.dwSize; + info.dwWidth = g_TI.dwWidth; + + info.sl = uls; + info.sh = lrs; + info.tl = ult; + info.th = lrt; + + info.dxt = 0; + info.dwLine = tile.dwLine; + info.dwTmem = tile.dwTMem; + info.dwTotalWords = size<<2; + + info.bSetBy = CMD_LOADTILE; + info.bSwapped =FALSE; + + g_TxtLoadBy = CMD_LOADTILE; + + if( tile.dwTMem == 0 ) + { + if( size >= 256 ) + { + memcpy(&g_tmemInfo0, &info, sizeof(TMEMLoadMapInfo) ); + g_tmemInfo0.dwTotalWords = size; + } + + if( size == 512 ) + { + memcpy(&g_tmemInfo1, &info, sizeof(TMEMLoadMapInfo) ); + g_tmemInfo1.dwTotalWords = size; + } + } + else if( tile.dwTMem == 0x100 ) + { + if( size == 256 ) + { + memcpy(&g_tmemInfo1, &info, sizeof(TMEMLoadMapInfo) ); + g_tmemInfo1.dwTotalWords = size; + } + } +} + + +const char *pszOnOff[2] = {"Off", "On"}; +uint32 lastSetTile; +void DLParser_SetTile(Gfx *gfx) +{ + gRDP.textureIsChanged = true; + + uint32 tileno = gfx->settile.tile; + Tile &tile = gRDP.tiles[tileno]; + tile.bForceWrapS = tile.bForceWrapT = tile.bForceClampS = tile.bForceClampT = false; + + lastSetTile = tileno; + + tile.dwFormat = gfx->settile.fmt; + tile.dwSize = gfx->settile.siz; + tile.dwLine = gfx->settile.line; + tile.dwTMem = gfx->settile.tmem; + + tile.dwPalette = gfx->settile.palette; + tile.bClampT = gfx->settile.ct; + tile.bMirrorT = gfx->settile.mt; + tile.dwMaskT = gfx->settile.maskt; + tile.dwShiftT = gfx->settile.shiftt; + tile.bClampS = gfx->settile.cs; + tile.bMirrorS = gfx->settile.ms; + tile.dwMaskS = gfx->settile.masks; + tile.dwShiftS = gfx->settile.shifts; + + + tile.fShiftScaleS = 1.0f; + if( tile.dwShiftS ) + { + if( tile.dwShiftS > 10 ) + { + tile.fShiftScaleS = (float)(1 << (16 - tile.dwShiftS)); + } + else + { + tile.fShiftScaleS = (float)1.0f/(1 << tile.dwShiftS); + } + } + + tile.fShiftScaleT = 1.0f; + if( tile.dwShiftT ) + { + if( tile.dwShiftT > 10 ) + { + tile.fShiftScaleT = (float)(1 << (16 - tile.dwShiftT)); + } + else + { + tile.fShiftScaleT = (float)1.0f/(1 << tile.dwShiftT); + } + } + + // Hack for DK64 + /* + if( tile.dwMaskS > 0 && tile.dwMaskT > 0 && tile.dwMaskS < 8 && tile.dwMaskT < 8 ) + { + tile.sh = tile.sl + (1<loadtile.tile; + int sl = gfx->loadtile.sl; + int tl = gfx->loadtile.tl; + int sh = gfx->loadtile.sh; + int th = gfx->loadtile.th; + + Tile &tile = gRDP.tiles[tileno]; + tile.bForceWrapS = tile.bForceWrapT = tile.bForceClampS = tile.bForceClampT = false; + + if( options.bUseFullTMEM ) + { + tile.bSizeIsValid = true; + tile.hilite_sl = tile.sl = sl / 4; + tile.hilite_tl = tile.tl = tl / 4; + tile.hilite_sh = tile.sh = sh / 4; + tile.hilite_th = tile.th = th / 4; + + tile.fhilite_sl = tile.fsl = sl / 4.0f; + tile.fhilite_tl = tile.ftl = tl / 4.0f; + tile.fhilite_sh = tile.fsh = sh / 4.0f; + tile.fhilite_th = tile.fth = th / 4.0f; + + tile.lastTileCmd = CMD_SETTILE_SIZE; + } + else + { + if( tile.lastTileCmd != CMD_SETTILE_SIZE ) + { + tile.bSizeIsValid = true; + if( sl/4 > sh/4 || tl/4 > th/4 || (sh == 0 && tile.dwShiftS==0 && th == 0 && tile.dwShiftT ==0 ) ) + { +#ifdef DEBUGGER + if( sl != 0 || tl != 0 || sh != 0 || th != 0 ) + { + if( tile.dwMaskS==0 || tile.dwMaskT==0 ) + TRACE0("Check me, setTileSize is not correct"); + } +#endif + tile.bSizeIsValid = false; + } + tile.hilite_sl = tile.sl = sl / 4; + tile.hilite_tl = tile.tl = tl / 4; + tile.hilite_sh = tile.sh = sh / 4; + tile.hilite_th = tile.th = th / 4; + + tile.fhilite_sl = tile.fsl = sl / 4.0f; + tile.fhilite_tl = tile.ftl = tl / 4.0f; + tile.fhilite_sh = tile.fsh = sh / 4.0f; + tile.fhilite_th = tile.fth = th / 4.0f; + + tile.lastTileCmd = CMD_SETTILE_SIZE; + } + else + { + tile.fhilite_sh = tile.fsh; + tile.fhilite_th = tile.fth; + tile.fhilite_sl = tile.fsl = (sl>0x7ff ? (sl-0xfff) : sl)/4.0f; + tile.fhilite_tl = tile.ftl = (tl>0x7ff ? (tl-0xfff) : tl)/4.0f; + + tile.hilite_sl = sl>0x7ff ? (sl-0xfff) : sl; + tile.hilite_tl = tl>0x7ff ? (tl-0xfff) : tl; + tile.hilite_sl /= 4; + tile.hilite_tl /= 4; + tile.hilite_sh = sh/4; + tile.hilite_th = th/4; + + tile.lastTileCmd = CMD_SETTILE_SIZE; + } + } + + LOG_TEXTURE( + { + DebuggerAppendMsg("SetTileSize:%d (%d/4,%d/4) -> (%d/4,%d/4) [%d x %d]\n", + tileno, sl, tl, sh, th, + ((sh/4) - (sl/4)) + 1, ((th/4) - (tl/4)) + 1); + }); + DEBUGGER_PAUSE_COUNT_N(NEXT_TEXTURE_CMD); + + LOG_UCODE(" Tile:%d (%d,%d) -> (%d,%d) [%d x %d]", + tileno, sl/4, tl/4, sh/4, th/4, + ((sh/4) - (sl/4)) + 1, ((th/4) - (tl/4)) + 1); +} + +extern const char *pszImgFormat[8];// = {"RGBA", "YUV", "CI", "IA", "I", "?1", "?2", "?3"}; +extern const char *pszImgSize[4];// = {"4", "8", "16", "32"}; +void DLParser_SetTImg(Gfx *gfx) +{ + gRDP.textureIsChanged = true; + + g_TI.dwFormat = gfx->setimg.fmt; + g_TI.dwSize = gfx->setimg.siz; + g_TI.dwWidth = gfx->setimg.width + 1; + g_TI.dwAddr = RSPSegmentAddr((gfx->setimg.addr)); + g_TI.bpl = g_TI.dwWidth << g_TI.dwSize >> 1; + +#ifdef DEBUGGER + if( g_TI.dwAddr == 0x00ffffff) + { + TRACE0("Check me here in setTimg"); + } + + LOG_TEXTURE(TRACE4("SetTImage: 0x%08x Fmt: %s/%s Width in Pixel: %d\n", g_TI.dwAddr, + pszImgFormat[g_TI.dwFormat], pszImgSize[g_TI.dwSize], g_TI.dwWidth)); + + DEBUGGER_PAUSE_COUNT_N(NEXT_TEXTURE_CMD); + + LOG_UCODE("Image: 0x%08x Fmt: %s/%s Width in Pixel: %d", g_TI.dwAddr, + pszImgFormat[g_TI.dwFormat], pszImgSize[g_TI.dwSize], g_TI.dwWidth); +#endif +} + +void DLParser_TexRect(Gfx *gfx) +{ + //Gtexrect *gtextrect = (Gtexrect *)gfx; + + if( !status.bCIBufferIsRendered ) g_pFrameBufferManager->ActiveTextureBuffer(); + + status.primitiveType = PRIM_TEXTRECT; + + // This command used 128bits, and not 64 bits. This means that we have to look one + // Command ahead in the buffer, and update the PC. + uint32 dwPC = gDlistStack[gDlistStackPointer].pc; // This points to the next instruction + uint32 dwCmd2 = *(uint32 *)(g_pRDRAMu8 + dwPC+4); + uint32 dwCmd3 = *(uint32 *)(g_pRDRAMu8 + dwPC+4+8); + uint32 dwHalf1 = *(uint32 *)(g_pRDRAMu8 + dwPC); + uint32 dwHalf2 = *(uint32 *)(g_pRDRAMu8 + dwPC+8); + + if( options.enableHackForGames == HACK_FOR_ALL_STAR_BASEBALL || options.enableHackForGames == HACK_FOR_MLB ) + { + if( ((dwHalf1>>24) == 0xb4 || (dwHalf1>>24) == 0xb3 || (dwHalf1>>24) == 0xb2 || (dwHalf1>>24) == 0xe1) && + ((dwHalf2>>24) == 0xb4 || (dwHalf2>>24) == 0xb3 || (dwHalf2>>24) == 0xb2 || (dwHalf2>>24) == 0xf1) ) + { + // Increment PC so that it points to the right place + gDlistStack[gDlistStackPointer].pc += 16; + } + else + { + // Hack for some games, All_Star_Baseball_2000 + gDlistStack[gDlistStackPointer].pc += 8; + dwCmd3 = dwCmd2; + //dwCmd2 = dwHalf1; + //dwCmd2 = 0; + + // fix me here + dwCmd2 = (((dwHalf1>>12)&0x03FF)<<17) | (((dwHalf1)&0x03FF)<<1); + } + } + else + { + gDlistStack[gDlistStackPointer].pc += 16; + } + + + // Hack for Mario Tennis + if( !status.bHandleN64RenderTexture && g_CI.dwAddr == g_ZI.dwAddr ) + { + return; + } + + + LOG_UCODE("0x%08x: %08x %08x", dwPC, *(uint32 *)(g_pRDRAMu8 + dwPC+0), *(uint32 *)(g_pRDRAMu8 + dwPC+4)); + LOG_UCODE("0x%08x: %08x %08x", dwPC+8, *(uint32 *)(g_pRDRAMu8 + dwPC+8), *(uint32 *)(g_pRDRAMu8 + dwPC+8+4)); + + uint32 dwXH = (((gfx->words.w0)>>12)&0x0FFF)/4; + uint32 dwYH = (((gfx->words.w0) )&0x0FFF)/4; + uint32 tileno = ((gfx->words.w1)>>24)&0x07; + uint32 dwXL = (((gfx->words.w1)>>12)&0x0FFF)/4; + uint32 dwYL = (((gfx->words.w1) )&0x0FFF)/4; + uint16 uS = (uint16)( dwCmd2>>16)&0xFFFF; + uint16 uT = (uint16)( dwCmd2 )&0xFFFF; + uint16 uDSDX = (uint16)(( dwCmd3>>16)&0xFFFF); + uint16 uDTDY = (uint16)(( dwCmd3 )&0xFFFF); + + + if( (int)dwXL >= gRDP.scissor.right || (int)dwYL >= gRDP.scissor.bottom || (int)dwXH < gRDP.scissor.left || (int)dwYH < gRDP.scissor.top ) + { + // Clipping + return; + } + + short s16S = *(short*)(&uS); + short s16T = *(short*)(&uT); + + short s16DSDX = *(short*)(&uDSDX); + short s16DTDY = *(short*)(&uDTDY); + + uint32 curTile = gRSP.curTile; + ForceMainTextureIndex(tileno); + + float fS0 = s16S / 32.0f; + float fT0 = s16T / 32.0f; + + float fDSDX = s16DSDX / 1024.0f; + float fDTDY = s16DTDY / 1024.0f; + + uint32 cycletype = gRDP.otherMode.cycle_type; + + if (cycletype == CYCLE_TYPE_COPY) + { + fDSDX /= 4.0f; // In copy mode 4 pixels are copied at once. + dwXH++; + dwYH++; + } + else if (cycletype == CYCLE_TYPE_FILL) + { + dwXH++; + dwYH++; + } + + if( fDSDX == 0 ) fDSDX = 1; + if( fDTDY == 0 ) fDTDY = 1; + + float fS1 = fS0 + (fDSDX * (dwXH - dwXL)); + float fT1 = fT0 + (fDTDY * (dwYH - dwYL)); + + LOG_UCODE(" Tile:%d Screen(%d,%d) -> (%d,%d)", tileno, dwXL, dwYL, dwXH, dwYH); + LOG_UCODE(" Tex:(%#5f,%#5f) -> (%#5f,%#5f) (DSDX:%#5f DTDY:%#5f)", + fS0, fT0, fS1, fT1, fDSDX, fDTDY); + LOG_UCODE(""); + + float t0u0 = (fS0-gRDP.tiles[tileno].hilite_sl) * gRDP.tiles[tileno].fShiftScaleS; + float t0v0 = (fT0-gRDP.tiles[tileno].hilite_tl) * gRDP.tiles[tileno].fShiftScaleT; + float t0u1 = t0u0 + (fDSDX * (dwXH - dwXL))*gRDP.tiles[tileno].fShiftScaleS; + float t0v1 = t0v0 + (fDTDY * (dwYH - dwYL))*gRDP.tiles[tileno].fShiftScaleT; + + if( dwXL==0 && dwYL==0 && dwXH==windowSetting.fViWidth-1 && dwYH==windowSetting.fViHeight-1 && + t0u0 == 0 && t0v0==0 && t0u1==0 && t0v1==0 ) + { + //Using TextRect to clear the screen + } + else + { + if( status.bHandleN64RenderTexture && //status.bDirectWriteIntoRDRAM && + g_pRenderTextureInfo->CI_Info.dwFormat == gRDP.tiles[tileno].dwFormat && + g_pRenderTextureInfo->CI_Info.dwSize == gRDP.tiles[tileno].dwSize && + gRDP.tiles[tileno].dwFormat == TXT_FMT_CI && gRDP.tiles[tileno].dwSize == TXT_SIZE_8b ) + { + if( options.enableHackForGames == HACK_FOR_YOSHI ) + { + // Hack for Yoshi background image + PrepareTextures(); + TexRectToFrameBuffer_8b(dwXL, dwYL, dwXH, dwYH, t0u0, t0v0, t0u1, t0v1, tileno); + DEBUGGER_PAUSE_AT_COND_AND_DUMP_COUNT_N((eventToPause == NEXT_FLUSH_TRI || eventToPause == NEXT_TEXTRECT), { + DebuggerAppendMsg("TexRect: tile=%d, X0=%d, Y0=%d, X1=%d, Y1=%d,\nfS0=%f, fT0=%f, ScaleS=%f, ScaleT=%f\n", + gRSP.curTile, dwXL, dwYL, dwXH, dwYH, fS0, fT0, fDSDX, fDTDY); + DebuggerAppendMsg("Pause after TexRect for Yoshi\n"); + }); + + } + else + { + if( frameBufferOptions.bUpdateCIInfo ) + { + PrepareTextures(); + TexRectToFrameBuffer_8b(dwXL, dwYL, dwXH, dwYH, t0u0, t0v0, t0u1, t0v1, tileno); + } + + if( !status.bDirectWriteIntoRDRAM ) + { + CRender::g_pRender->TexRect(dwXL, dwYL, dwXH, dwYH, fS0, fT0, fDSDX, fDTDY); + + status.dwNumTrisRendered += 2; + } + } + } + else + { + CRender::g_pRender->TexRect(dwXL, dwYL, dwXH, dwYH, fS0, fT0, fDSDX, fDTDY); + status.bFrameBufferDrawnByTriangles = true; + + status.dwNumTrisRendered += 2; + } + } + + if( status.bHandleN64RenderTexture ) g_pRenderTextureInfo->maxUsedHeight = max(g_pRenderTextureInfo->maxUsedHeight,(int)dwYH); + + ForceMainTextureIndex(curTile); +} + + +void DLParser_TexRectFlip(Gfx *gfx) +{ + status.bCIBufferIsRendered = true; + status.primitiveType = PRIM_TEXTRECTFLIP; + + // This command used 128bits, and not 64 bits. This means that we have to look one + // Command ahead in the buffer, and update the PC. + uint32 dwPC = gDlistStack[gDlistStackPointer].pc; // This points to the next instruction + uint32 dwCmd2 = *(uint32 *)(g_pRDRAMu8 + dwPC+4); + uint32 dwCmd3 = *(uint32 *)(g_pRDRAMu8 + dwPC+4+8); + + // Increment PC so that it points to the right place + gDlistStack[gDlistStackPointer].pc += 16; + + uint32 dwXH = (((gfx->words.w0)>>12)&0x0FFF)/4; + uint32 dwYH = (((gfx->words.w0) )&0x0FFF)/4; + uint32 tileno = ((gfx->words.w1)>>24)&0x07; + uint32 dwXL = (((gfx->words.w1)>>12)&0x0FFF)/4; + uint32 dwYL = (((gfx->words.w1) )&0x0FFF)/4; + uint32 dwS = ( dwCmd2>>16)&0xFFFF; + uint32 dwT = ( dwCmd2 )&0xFFFF; + int nDSDX = (int)(short)(( dwCmd3>>16)&0xFFFF); + int nDTDY = (int)(short)(( dwCmd3 )&0xFFFF); + + uint32 curTile = gRSP.curTile; + ForceMainTextureIndex(tileno); + + float fS0 = (float)dwS / 32.0f; + float fT0 = (float)dwT / 32.0f; + + float fDSDX = (float)nDSDX / 1024.0f; + float fDTDY = (float)nDTDY / 1024.0f; + + uint32 cycletype = gRDP.otherMode.cycle_type; + + if (cycletype == CYCLE_TYPE_COPY) + { + fDSDX /= 4.0f; // In copy mode 4 pixels are copied at once. + dwXH++; + dwYH++; + } + else if (cycletype == CYCLE_TYPE_FILL) + { + dwXH++; + dwYH++; + } + + float fS1 = fS0 + (fDSDX * (dwYH - dwYL)); + float fT1 = fT0 + (fDTDY * (dwXH - dwXL)); + + LOG_UCODE(" Tile:%d (%d,%d) -> (%d,%d)", + tileno, dwXL, dwYL, dwXH, dwYH); + LOG_UCODE(" Tex:(%#5f,%#5f) -> (%#5f,%#5f) (DSDX:%#5f DTDY:%#5f)", + fS0, fT0, fS1, fT1, fDSDX, fDTDY); + LOG_UCODE(""); + + float t0u0 = (fS0) * gRDP.tiles[tileno].fShiftScaleS-gRDP.tiles[tileno].sl; + float t0v0 = (fT0) * gRDP.tiles[tileno].fShiftScaleT-gRDP.tiles[tileno].tl; + float t0u1 = t0u0 + (fDSDX * (dwYH - dwYL))*gRDP.tiles[tileno].fShiftScaleS; + float t0v1 = t0v0 + (fDTDY * (dwXH - dwXL))*gRDP.tiles[tileno].fShiftScaleT; + + CRender::g_pRender->TexRectFlip(dwXL, dwYL, dwXH, dwYH, t0u0, t0v0, t0u1, t0v1); + status.dwNumTrisRendered += 2; + + if( status.bHandleN64RenderTexture ) g_pRenderTextureInfo->maxUsedHeight = max(g_pRenderTextureInfo->maxUsedHeight,int(dwYL+(dwXH-dwXL))); + + ForceMainTextureIndex(curTile); +} + +/************************************************************************/ +/* */ +/************************************************************************/ +/* + * TMEM emulation + * There are 0x200's 64bits entry in TMEM + * Usually, textures are loaded into TMEM at 0x0, and TLUT is loaded at 0x100 + * of course, the whole TMEM can be used by textures if TLUT is not used, and TLUT + * can be at other address of TMEM. + * + * We don't want to emulate TMEM by creating a block of memory for TMEM and load + * everything into the block of memory, this will be slow. + */ +typedef struct TmemInfoEntry{ + uint32 start; + uint32 length; + uint32 rdramAddr; + TmemInfoEntry* next; +} TmemInfoEntry; + +const int tmenMaxEntry=20; +TmemInfoEntry tmenEntryBuffer[20]={{0}}; +TmemInfoEntry *g_pTMEMInfo=NULL; +TmemInfoEntry *g_pTMEMFreeList=tmenEntryBuffer; + +void TMEM_Init() +{ + g_pTMEMInfo=NULL; + g_pTMEMFreeList=tmenEntryBuffer; + int i; + for( i=0; inext; + + p->start = tmemstart; + p->length = length; + p->rdramAddr = rdramaddr; + p->next = NULL; + } + else + { + while ( tmemstart > (p->start+p->length) ) + { + if( p->next != NULL ) { + p = p->next; + continue; + } + else { + break; + } + } + + if ( p->start == tmemstart ) + { + // need to replace the block of 'p' + // or append a new block depend the block lengths + if( length == p->length ) + { + p->rdramAddr = rdramaddr; + return; + } + else if( length < p->length ) + { + TmemInfoEntry *newentry = g_pTMEMFreeList; + g_pTMEMFreeList = g_pTMEMFreeList->next; + + newentry->length = p->length - length; + newentry->next = p->next; + newentry->rdramAddr = p->rdramAddr + p->length; + newentry->start = p->start + p->length; + + p->length = length; + p->next = newentry; + p->rdramAddr = rdramaddr; + } + } + else if( p->start > tmemstart ) + { + // p->start > tmemstart, need to insert the new block before 'p' + TmemInfoEntry *newentry = g_pTMEMFreeList; + g_pTMEMFreeList = g_pTMEMFreeList->next; + + if( length+tmemstart < p->start+p->length ) + { + newentry->length = p->length - length; + newentry->next = p->next; + newentry->rdramAddr = p->rdramAddr + p->length; + newentry->start = p->start + p->length; + + p->length = length; + p->next = newentry; + p->rdramAddr = rdramaddr; + p->start = tmemstart; + } + else if( length+tmemstart == p->start+p->length ) + { + + } + } + else + { + } + } +} + +uint32 TMEM_GetRdramAddr(uint32 tmemstart, uint32 length) +{ + return 0; +} + + +/* + * New implementation of texture loading + */ + +bool IsTmemFlagValid(uint32 tmemAddr) +{ + uint32 index = tmemAddr>>5; + uint32 bitIndex = (tmemAddr&0x1F); + return ((g_TmemFlag[index] & (1<>5; + uint32 bitIndex = (tmemAddr&0x1F); + + if ((g_TmemFlag[index] & (1<>5; + uint32 bitIndex = (tmemAddr&0x1F); + +#ifdef DEBUGGER + if( size > 0x200 ) + { + DebuggerAppendMsg("Check me: tmemaddr=%X, size=%x", tmemAddr, size); + size = 0x200-tmemAddr; + } +#endif + + if( bitIndex == 0 ) + { + uint32 i; + for( i=0; i< (size>>5); i++ ) + { + g_TmemFlag[index+i] = 0; + } + + if( (size&0x1F) != 0 ) + { + //ErrorMsg("Check me: tmemaddr=%X, size=%x", tmemAddr, size); + g_TmemFlag[index+i] &= ~((1<<(size&0x1F))-1); + } + + g_TmemFlag[index] |= 1; + } + else + { + if( bitIndex + size <= 0x1F ) + { + uint32 val = g_TmemFlag[index]; + uint32 mask = (1<<(bitIndex))-1; + mask |= ~((1<<(bitIndex + size))-1); + val &= mask; + val |= (1<>5); i++ ) + { + g_TmemFlag[index+i] = 0; + } + + if( (size&0x1F) != 0 ) + { + //ErrorMsg("Check me: tmemaddr=%X, size=%x", tmemAddr, size); + g_TmemFlag[index+i] &= ~((1<<(size&0x1F))-1); + } + } + } +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/RSP_GBI0.h b/libmupen64plus/mupen64plus-video-rice/src/RSP_GBI0.h new file mode 100644 index 0000000000..bf28e04ad2 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/RSP_GBI0.h @@ -0,0 +1,904 @@ +/* +Copyright (C) 2002 Rice1964 + +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. + +*/ + +#include +#include "Render.h" +#include "Timing.h" + +void RSP_GBI1_SpNoop(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_SpNoop); + + if( (gfx+1)->words.cmd == 0x00 && gRSP.ucode >= 17 ) + { + RSP_RDP_NOIMPL("Double SPNOOP, Skip remain ucodes, PC=%08X, Cmd1=%08X", gDlistStack[gDlistStackPointer].pc, gfx->words.w1); + RDP_GFX_PopDL(); + //if( gRSP.ucode < 17 ) TriggerDPInterrupt(); + } +} + +void RSP_GBI0_Mtx(Gfx *gfx) +{ + SP_Timing(RSP_GBI0_Mtx); + + uint32 addr = RSPSegmentAddr((gfx->gbi0matrix.addr)); + + LOG_UCODE(" Command: %s %s %s Length %d Address 0x%08x", + gfx->gbi0matrix.projection == 1 ? "Projection" : "ModelView", + gfx->gbi0matrix.load == 1 ? "Load" : "Mul", + gfx->gbi0matrix.push == 1 ? "Push" : "NoPush", + gfx->gbi0matrix.len, addr); + + if (addr + 64 > g_dwRamSize) + { + TRACE1("Mtx: Address invalid (0x%08x)", addr); + return; + } + + LoadMatrix(addr); + + if (gfx->gbi0matrix.projection) + { + CRender::g_pRender->SetProjection(matToLoad, gfx->gbi0matrix.push, gfx->gbi0matrix.load); + } + else + { + CRender::g_pRender->SetWorldView(matToLoad, gfx->gbi0matrix.push, gfx->gbi0matrix.load); + } + +#ifdef DEBUGGER + const char *loadstr = gfx->gbi0matrix.load == 1 ? "Load" : "Mul"; + const char *pushstr = gfx->gbi0matrix.push == 1 ? "Push" : "Nopush"; + int projlevel = CRender::g_pRender->GetProjectMatrixLevel(); + int worldlevel = CRender::g_pRender->GetWorldViewMatrixLevel(); + if( pauseAtNext && eventToPause == NEXT_MATRIX_CMD ) + { + pauseAtNext = false; + debuggerPause = true; + if (gfx->gbi0matrix.projection) + { + TRACE3("Pause after %s and %s Matrix: Projection, level=%d\n", loadstr, pushstr, projlevel ); + } + else + { + TRACE3("Pause after %s and %s Matrix: WorldView level=%d\n", loadstr, pushstr, worldlevel); + } + } + else + { + if( pauseAtNext && logMatrix ) + { + if (gfx->gbi0matrix.projection) + { + TRACE3("Matrix: %s and %s Projection level=%d\n", loadstr, pushstr, projlevel); + } + else + { + TRACE3("Matrix: %s and %s WorldView\n level=%d", loadstr, pushstr, worldlevel); + } + } + } +#endif +} + + +void RSP_GBI1_Reserved(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_Reserved); + RSP_RDP_NOIMPL("RDP: Reserved (0x%08x 0x%08x)", (gfx->words.w0), (gfx->words.w1)); +} + + +void RSP_GBI1_MoveMem(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_MoveMem); + + uint32 type = ((gfx->words.w0)>>16)&0xFF; + uint32 dwLength = ((gfx->words.w0))&0xFFFF; + uint32 addr = RSPSegmentAddr((gfx->words.w1)); + + switch (type) + { + case RSP_GBI1_MV_MEM_VIEWPORT: + { + LOG_UCODE(" RSP_GBI1_MV_MEM_VIEWPORT. Address: 0x%08x, Length: 0x%04x", addr, dwLength); + RSP_MoveMemViewport(addr); + } + break; + case RSP_GBI1_MV_MEM_LOOKATY: + LOG_UCODE(" RSP_GBI1_MV_MEM_LOOKATY"); + break; + case RSP_GBI1_MV_MEM_LOOKATX: + LOG_UCODE(" RSP_GBI1_MV_MEM_LOOKATX"); + break; + case RSP_GBI1_MV_MEM_L0: + case RSP_GBI1_MV_MEM_L1: + case RSP_GBI1_MV_MEM_L2: + case RSP_GBI1_MV_MEM_L3: + case RSP_GBI1_MV_MEM_L4: + case RSP_GBI1_MV_MEM_L5: + case RSP_GBI1_MV_MEM_L6: + case RSP_GBI1_MV_MEM_L7: + { + uint32 dwLight = (type-RSP_GBI1_MV_MEM_L0)/2; + LOG_UCODE(" RSP_GBI1_MV_MEM_L%d", dwLight); + LOG_UCODE(" Light%d: Length:0x%04x, Address: 0x%08x", dwLight, dwLength, addr); + + RSP_MoveMemLight(dwLight, addr); + } + break; + case RSP_GBI1_MV_MEM_TXTATT: + LOG_UCODE(" RSP_GBI1_MV_MEM_TXTATT"); + break; + case RSP_GBI1_MV_MEM_MATRIX_1: + RSP_GFX_Force_Matrix(addr); + break; + case RSP_GBI1_MV_MEM_MATRIX_2: + break; + case RSP_GBI1_MV_MEM_MATRIX_3: + break; + case RSP_GBI1_MV_MEM_MATRIX_4: + break; + default: + RSP_RDP_NOIMPL("MoveMem: Unknown Move Type, cmd=%08X, %08X", gfx->words.w0, gfx->words.w1); + break; + } +} + + +void RSP_GBI0_Vtx(Gfx *gfx) +{ + SP_Timing(RSP_GBI0_Vtx); + + int n = gfx->gbi0vtx.n + 1; + int v0 = gfx->gbi0vtx.v0; + uint32 addr = RSPSegmentAddr((gfx->gbi0vtx.addr)); + + LOG_UCODE(" Address 0x%08x, v0: %d, Num: %d, Length: 0x%04x", addr, v0, n, gfx->gbi0vtx.len); + + if ((v0 + n) > 80) + { + TRACE3("Warning, invalid vertex positions, N=%d, v0=%d, Addr=0x%08X", n, v0, addr); + n = 32 - v0; + } + + // Check that address is valid... + if ((addr + n*16) > g_dwRamSize) + { + TRACE1("Vertex Data: Address out of range (0x%08x)", addr); + } + else + { + ProcessVertexData(addr, v0, n); + status.dwNumVertices += n; + DisplayVertexInfo(addr, v0, n); + } +} + + +void RSP_GBI0_DL(Gfx *gfx) +{ + SP_Timing(RSP_GBI0_DL); + + uint32 addr = RSPSegmentAddr((gfx->gbi0dlist.addr)) & (g_dwRamSize-1); + + LOG_UCODE(" Address=0x%08x Push: 0x%02x", addr, gfx->gbi0dlist.param); + if( addr > g_dwRamSize ) + { + RSP_RDP_NOIMPL("Error: DL addr = %08X out of range, PC=%08X", addr, gDlistStack[gDlistStackPointer].pc ); + addr &= (g_dwRamSize-1); + DebuggerPauseCountN( NEXT_DLIST ); + } + + if( gfx->gbi0dlist.param == RSP_DLIST_PUSH ) + gDlistStackPointer++; + + gDlistStack[gDlistStackPointer].pc = addr; + gDlistStack[gDlistStackPointer].countdown = MAX_DL_COUNT; + + LOG_UCODE("Level=%d", gDlistStackPointer+1); + LOG_UCODE("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"); +} + + +void RSP_GBI1_RDPHalf_Cont(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_RDPHalf_Cont); + + LOG_UCODE("RDPHalf_Cont: (Ignored)"); +} +void RSP_GBI1_RDPHalf_2(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_RDPHalf_2); + + LOG_UCODE("RDPHalf_2: (Ignored)"); +} + +void RSP_GBI1_RDPHalf_1(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_RDPHalf_1); + + LOG_UCODE("RDPHalf_1: (Ignored)"); +} + +void RSP_GBI1_Line3D(Gfx *gfx) +{ + status.primitiveType = PRIM_LINE3D; + + uint32 dwPC = gDlistStack[gDlistStackPointer].pc; + + BOOL bTrisAdded = FALSE; + + if( gfx->ln3dtri2.v3 == 0 ) + { + // Flying Dragon + uint32 dwV0 = gfx->ln3dtri2.v0/gRSP.vertexMult; + uint32 dwV1 = gfx->ln3dtri2.v1/gRSP.vertexMult; + uint32 dwWidth = gfx->ln3dtri2.v2; + //uint32 dwFlag = gfx->ln3dtri2.v3/gRSP.vertexMult; + + CRender::g_pRender->SetCombinerAndBlender(); + + status.dwNumTrisRendered++; + + CRender::g_pRender->Line3D(dwV0, dwV1, dwWidth); + SP_Timing(RSP_GBI1_Line3D); + DP_Timing(RSP_GBI1_Line3D); + } + else + { + do { + uint32 dwV3 = gfx->ln3dtri2.v3/gRSP.vertexMult; + uint32 dwV0 = gfx->ln3dtri2.v0/gRSP.vertexMult; + uint32 dwV1 = gfx->ln3dtri2.v1/gRSP.vertexMult; + uint32 dwV2 = gfx->ln3dtri2.v2/gRSP.vertexMult; + + LOG_UCODE(" Line3D: V0: %d, V1: %d, V2: %d, V3: %d", dwV0, dwV1, dwV2, dwV3); + + // Do first tri + if (IsTriangleVisible(dwV0, dwV1, dwV2)) + { + DEBUG_DUMP_VERTEXES("Line3D 1/2", dwV0, dwV1, dwV2); + if (!bTrisAdded && CRender::g_pRender->IsTextureEnabled()) + { + PrepareTextures(); + InitVertexTextureConstants(); + } + + if( !bTrisAdded ) + { + CRender::g_pRender->SetCombinerAndBlender(); + } + + bTrisAdded = true; + PrepareTriangle(dwV0, dwV1, dwV2); + } + + // Do second tri + if (IsTriangleVisible(dwV2, dwV3, dwV0)) + { + DEBUG_DUMP_VERTEXES("Line3D 2/2", dwV0, dwV1, dwV2); + if (!bTrisAdded && CRender::g_pRender->IsTextureEnabled()) + { + PrepareTextures(); + InitVertexTextureConstants(); + } + + if( !bTrisAdded ) + { + CRender::g_pRender->SetCombinerAndBlender(); + } + + bTrisAdded = true; + PrepareTriangle(dwV2, dwV3, dwV0); + } + + gfx++; + dwPC += 8; +#ifdef DEBUGGER + } while (gfx->words.cmd == (uint8)RSP_LINE3D && !(pauseAtNext && eventToPause==NEXT_FLUSH_TRI)); +#else + } while (gfx->words.cmd == (uint8)RSP_LINE3D); +#endif + + gDlistStack[gDlistStackPointer].pc = dwPC-8; + + if (bTrisAdded) + { + CRender::g_pRender->DrawTriangles(); + } + } +} + + +void RSP_GBI1_ClearGeometryMode(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_ClearGeometryMode); + uint32 dwMask = ((gfx->words.w1)); + +#ifdef DEBUGGER + LOG_UCODE(" Mask=0x%08x", dwMask); + if (dwMask & G_ZBUFFER) LOG_UCODE(" Disabling ZBuffer"); + if (dwMask & G_TEXTURE_ENABLE) LOG_UCODE(" Disabling Texture"); + if (dwMask & G_SHADE) LOG_UCODE(" Disabling Shade"); + if (dwMask & G_SHADING_SMOOTH) LOG_UCODE(" Disabling Smooth Shading"); + if (dwMask & G_CULL_FRONT) LOG_UCODE(" Disabling Front Culling"); + if (dwMask & G_CULL_BACK) LOG_UCODE(" Disabling Back Culling"); + if (dwMask & G_FOG) LOG_UCODE(" Disabling Fog"); + if (dwMask & G_LIGHTING) LOG_UCODE(" Disabling Lighting"); + if (dwMask & G_TEXTURE_GEN) LOG_UCODE(" Disabling Texture Gen"); + if (dwMask & G_TEXTURE_GEN_LINEAR) LOG_UCODE(" Disabling Texture Gen Linear"); + if (dwMask & G_LOD) LOG_UCODE(" Disabling LOD (no impl)"); +#endif + + gRDP.geometryMode &= ~dwMask; + RSP_GFX_InitGeometryMode(); +} + + + +void RSP_GBI1_SetGeometryMode(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_SetGeometryMode); + uint32 dwMask = ((gfx->words.w1)); + +#ifdef DEBUGGER + LOG_UCODE(" Mask=0x%08x", dwMask); + if (dwMask & G_ZBUFFER) LOG_UCODE(" Enabling ZBuffer"); + if (dwMask & G_TEXTURE_ENABLE) LOG_UCODE(" Enabling Texture"); + if (dwMask & G_SHADE) LOG_UCODE(" Enabling Shade"); + if (dwMask & G_SHADING_SMOOTH) LOG_UCODE(" Enabling Smooth Shading"); + if (dwMask & G_CULL_FRONT) LOG_UCODE(" Enabling Front Culling"); + if (dwMask & G_CULL_BACK) LOG_UCODE(" Enabling Back Culling"); + if (dwMask & G_FOG) LOG_UCODE(" Enabling Fog"); + if (dwMask & G_LIGHTING) LOG_UCODE(" Enabling Lighting"); + if (dwMask & G_TEXTURE_GEN) LOG_UCODE(" Enabling Texture Gen"); + if (dwMask & G_TEXTURE_GEN_LINEAR) LOG_UCODE(" Enabling Texture Gen Linear"); + if (dwMask & G_LOD) LOG_UCODE(" Enabling LOD (no impl)"); +#endif // DEBUGGER + gRDP.geometryMode |= dwMask; + RSP_GFX_InitGeometryMode(); +} + + +void RSP_GBI1_EndDL(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_EndDL); + RDP_GFX_PopDL(); +} + + +//static const char * sc_szBlClr[4] = { "In", "Mem", "Bl", "Fog" }; +//static const char * sc_szBlA1[4] = { "AIn", "AFog", "AShade", "0" }; +//static const char * sc_szBlA2[4] = { "1-A", "AMem", "1", "?" }; + +void RSP_GBI1_SetOtherModeL(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_SetOtherModeL); + + uint32 dwShift = ((gfx->words.w0)>>8)&0xFF; + uint32 dwLength= ((gfx->words.w0) )&0xFF; + uint32 dwData = (gfx->words.w1); + + uint32 dwMask = ((1<words.w0)>>8)&0xFF; + uint32 dwLength= ((gfx->words.w0) )&0xFF; + uint32 dwData = (gfx->words.w1); + + uint32 dwMask = ((1<texture.scaleS) / (65536.0f * 32.0f); + float fTextureScaleT = (float)(gfx->texture.scaleT) / (65536.0f * 32.0f); + + if( (((gfx->words.w1)>>16)&0xFFFF) == 0xFFFF ) + { + fTextureScaleS = 1/32.0f; + } + else if( (((gfx->words.w1)>>16)&0xFFFF) == 0x8000 ) + { + fTextureScaleS = 1/64.0f; + } +#ifdef DEBUGGER + else if( ((gfx->words.w1>>16)&0xFFFF) != 0 ) + { + //DebuggerAppendMsg("Warning, texture scale = %08X is not integer", (word1>>16)&0xFFFF); + } +#endif + + if( (((gfx->words.w1) )&0xFFFF) == 0xFFFF ) + { + fTextureScaleT = 1/32.0f; + } + else if( (((gfx->words.w1) )&0xFFFF) == 0x8000 ) + { + fTextureScaleT = 1/64.0f; + } +#ifdef DEBUGGER + else if( (gfx->words.w1&0xFFFF) != 0 ) + { + //DebuggerAppendMsg("Warning, texture scale = %08X is not integer", (word1)&0xFFFF); + } +#endif + + if( gRSP.ucode == 6 ) + { + if( fTextureScaleS == 0 ) fTextureScaleS = 1.0f/32.0f; + if( fTextureScaleT == 0 ) fTextureScaleT = 1.0f/32.0f; + } + + CRender::g_pRender->SetTextureEnableAndScale(gfx->texture.tile, gfx->texture.enable_gbi0, fTextureScaleS, fTextureScaleT); + + // What happens if these are 0? Interpret as 1.0f? + + LOG_TEXTURE( + { + DebuggerAppendMsg("SetTexture: Level: %d Tile: %d %s\n", gfx->texture.level, gfx->texture.tile, gfx->texture.enable_gbi0 ? "enabled":"disabled"); + DebuggerAppendMsg(" ScaleS: %f, ScaleT: %f\n", fTextureScaleS*32.0f, fTextureScaleT*32.0f); + }); + + DEBUGGER_PAUSE_COUNT_N(NEXT_SET_TEXTURE); + LOG_UCODE(" Level: %d Tile: %d %s", gfx->texture.level, gfx->texture.tile, gfx->texture.enable_gbi0 ? "enabled":"disabled"); + LOG_UCODE(" ScaleS: %f, ScaleT: %f", fTextureScaleS*32.0f, fTextureScaleT*32.0f); +} + +extern void RSP_RDP_InsertMatrix(uint32 word0, uint32 word1); +void RSP_GBI1_MoveWord(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_MoveWord); + + switch (gfx->gbi0moveword.type) + { + case RSP_MOVE_WORD_MATRIX: + RSP_RDP_InsertMatrix(gfx); + break; + case RSP_MOVE_WORD_NUMLIGHT: + { + uint32 dwNumLights = (((gfx->gbi0moveword.value)-0x80000000)/32)-1; + LOG_UCODE(" RSP_MOVE_WORD_NUMLIGHT: Val:%d", dwNumLights); + + gRSP.ambientLightIndex = dwNumLights; + SetNumLights(dwNumLights); + } + break; + case RSP_MOVE_WORD_CLIP: + { + switch (gfx->gbi0moveword.offset) + { + case RSP_MV_WORD_OFFSET_CLIP_RNX: + case RSP_MV_WORD_OFFSET_CLIP_RNY: + case RSP_MV_WORD_OFFSET_CLIP_RPX: + case RSP_MV_WORD_OFFSET_CLIP_RPY: + CRender::g_pRender->SetClipRatio(gfx->gbi0moveword.offset, gfx->gbi0moveword.value); + break; + default: + LOG_UCODE(" RSP_MOVE_WORD_CLIP ? : 0x%08x", gfx->words.w1); + break; + } + } + break; + case RSP_MOVE_WORD_SEGMENT: + { + uint32 dwSegment = (gfx->gbi0moveword.offset >> 2) & 0xF; + uint32 dwBase = (gfx->gbi0moveword.value)&0x00FFFFFF; + LOG_UCODE(" RSP_MOVE_WORD_SEGMENT Seg[%d] = 0x%08x", dwSegment, dwBase); + if( dwBase > g_dwRamSize ) + { + gRSP.segments[dwSegment] = dwBase; +#ifdef DEBUGGER + if( pauseAtNext ) + DebuggerAppendMsg("warning: Segment %d addr is %8X", dwSegment, dwBase); +#endif + } + else + { + gRSP.segments[dwSegment] = dwBase; + } + } + break; + case RSP_MOVE_WORD_FOG: + { + uint16 wMult = (uint16)(((gfx->gbi0moveword.value) >> 16) & 0xFFFF); + uint16 wOff = (uint16)(((gfx->gbi0moveword.value) ) & 0xFFFF); + + float fMult = (float)(short)wMult; + float fOff = (float)(short)wOff; + + float rng = 128000.0f / fMult; + float fMin = 500.0f - (fOff*rng/256.0f); + float fMax = rng + fMin; + + FOG_DUMP(TRACE4("Set Fog: Min=%f, Max=%f, Mul=%f, Off=%f", fMin, fMax, fMult, fOff)); + //if( fMult <= 0 || fMin > fMax || fMax < 0 || fMin > 1000 ) + if( fMult <= 0 || fMax < 0 ) + { + // Hack + fMin = 996; + fMax = 1000; + fMult = 0; + fOff = 1; + } + + LOG_UCODE(" RSP_MOVE_WORD_FOG/Mul=%d: Off=%d", wMult, wOff); + FOG_DUMP(TRACE3("Set Fog: Min=%f, Max=%f, Data=%08X", fMin, fMax, gfx->gbi0moveword.value)); + SetFogMinMax(fMin, fMax, fMult, fOff); + } + break; + case RSP_MOVE_WORD_LIGHTCOL: + { + uint32 dwLight = gfx->gbi0moveword.offset / 0x20; + uint32 dwField = (gfx->gbi0moveword.offset & 0x7); + + LOG_UCODE(" RSP_MOVE_WORD_LIGHTCOL/0x%08x: 0x%08x", gfx->gbi0moveword.offset, gfx->words.w1); + + switch (dwField) + { + case 0: + if (dwLight == gRSP.ambientLightIndex) + { + SetAmbientLight( ((gfx->gbi0moveword.value)>>8) ); + } + else + { + SetLightCol(dwLight, gfx->gbi0moveword.value); + } + break; + + case 4: + break; + + default: + TRACE1("RSP_MOVE_WORD_LIGHTCOL with unknown offset 0x%08x", dwField); + break; + } + } + break; + case RSP_MOVE_WORD_POINTS: + { + uint32 vtx = gfx->gbi0moveword.offset/40; + uint32 where = gfx->gbi0moveword.offset - vtx*40; + ModifyVertexInfo(where, vtx, gfx->gbi0moveword.value); + } + break; + case RSP_MOVE_WORD_PERSPNORM: + LOG_UCODE(" RSP_MOVE_WORD_PERSPNORM"); + //if( word1 != 0x1A ) DebuggerAppendMsg("PerspNorm: 0x%04x", (short)word1); + break; + default: + RSP_RDP_NOIMPL("Unknown MoveWord, %08X, %08X", gfx->words.w0, gfx->words.w1); + break; + } + +} + + +void RSP_GBI1_PopMtx(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_PopMtx); + + LOG_UCODE(" Command: (%s)", gfx->gbi0popmatrix.projection ? "Projection" : "ModelView"); + + // Do any of the other bits do anything? + // So far only Extreme-G seems to Push/Pop projection matrices + + if (gfx->gbi0popmatrix.projection) + { + CRender::g_pRender->PopProjection(); + } + else + { + CRender::g_pRender->PopWorldView(); + } +#ifdef DEBUGGER + if( pauseAtNext && eventToPause == NEXT_MATRIX_CMD ) + { + pauseAtNext = false; + debuggerPause = true; + DebuggerAppendMsg("Pause after Pop Matrix: %s\n", gfx->gbi0popmatrix.projection ? "Proj":"World"); + } + else + { + if( pauseAtNext && logMatrix ) + { + DebuggerAppendMsg("Pause after Pop Matrix: %s\n", gfx->gbi0popmatrix.projection ? "Proj":"World"); + } + } +#endif +} + + +void RSP_GBI1_CullDL(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_CullDL); + +#ifdef DEBUGGER + if( !debuggerEnableCullFace ) + { + return; //Disable Culling + } +#endif + if( g_curRomInfo.bDisableCulling ) + { + return; //Disable Culling + } + + uint32 dwVFirst = ((gfx->words.w0) & 0xFFF) / gRSP.vertexMult; + uint32 dwVLast = (((gfx->words.w1)) & 0xFFF) / gRSP.vertexMult; + + LOG_UCODE(" Culling using verts %d to %d", dwVFirst, dwVLast); + + // Mask into range + dwVFirst &= 0x1f; + dwVLast &= 0x1f; + + if( dwVLast < dwVFirst ) return; + if( !gRSP.bRejectVtx ) return; + + for (uint32 i = dwVFirst; i <= dwVLast; i++) + { + if (g_clipFlag[i] == 0) + { + LOG_UCODE(" Vertex %d is visible, continuing with display list processing", i); + return; + } + } + + status.dwNumDListsCulled++; + + LOG_UCODE(" No vertices were visible, culling rest of display list"); + + RDP_GFX_PopDL(); +} + + + +void RSP_GBI1_Tri1(Gfx *gfx) +{ + status.primitiveType = PRIM_TRI1; + bool bTrisAdded = false; + bool bTexturesAreEnabled = CRender::g_pRender->IsTextureEnabled(); + + // While the next command pair is Tri1, add vertices + uint32 dwPC = gDlistStack[gDlistStackPointer].pc; + //uint32 * pCmdBase = (uint32 *)(g_pRDRAMu8 + dwPC); + + do + { + uint32 dwV0 = gfx->tri1.v0/gRSP.vertexMult; + uint32 dwV1 = gfx->tri1.v1/gRSP.vertexMult; + uint32 dwV2 = gfx->tri1.v2/gRSP.vertexMult; + + if (IsTriangleVisible(dwV0, dwV1, dwV2)) + { + DEBUG_DUMP_VERTEXES("Tri1", dwV0, dwV1, dwV2); + LOG_UCODE(" Tri1: 0x%08x 0x%08x %d,%d,%d", gfx->words.w0, gfx->words.w1, dwV0, dwV1, dwV2); + + if (!bTrisAdded) + { + if( bTexturesAreEnabled ) + { + PrepareTextures(); + InitVertexTextureConstants(); + } + CRender::g_pRender->SetCombinerAndBlender(); + bTrisAdded = true; + } + PrepareTriangle(dwV0, dwV1, dwV2); + } + + gfx++; + dwPC += 8; + +#ifdef DEBUGGER + } while (!(pauseAtNext && eventToPause==NEXT_TRIANGLE) && gfx->words.cmd == (uint8)RSP_TRI1); +#else + } while (gfx->words.cmd == (uint8)RSP_TRI1); +#endif + + gDlistStack[gDlistStackPointer].pc = dwPC-8; + + if (bTrisAdded) + { + CRender::g_pRender->DrawTriangles(); + } + + DEBUG_TRIANGLE(TRACE0("Pause at GBI0 TRI1")); +} + + +void RSP_GBI0_Tri4(Gfx *gfx) +{ + uint32 w0 = gfx->words.w0; + uint32 w1 = gfx->words.w1; + + status.primitiveType = PRIM_TRI2; + + // While the next command pair is Tri2, add vertices + uint32 dwPC = gDlistStack[gDlistStackPointer].pc; + + BOOL bTrisAdded = FALSE; + + do { + uint32 dwFlag = (w0>>16)&0xFF; + LOG_UCODE(" PD Tri4: 0x%08x 0x%08x Flag: 0x%02x", gfx->words.w0, gfx->words.w1, dwFlag); + + BOOL bVisible; + for( int i=0; i<4; i++) + { + uint32 v0 = (w1>>(4+(i<<3))) & 0xF; + uint32 v1 = (w1>>( (i<<3))) & 0xF; + uint32 v2 = (w0>>( (i<<2))) & 0xF; + bVisible = IsTriangleVisible(v0, v2, v1); + LOG_UCODE(" (%d, %d, %d) %s", v0, v1, v2, bVisible ? "": "(clipped)"); + if (bVisible) + { + DEBUG_DUMP_VERTEXES("Tri4_PerfectDark 1/2", v0, v1, v2); + if (!bTrisAdded && CRender::g_pRender->IsTextureEnabled()) + { + PrepareTextures(); + InitVertexTextureConstants(); + } + + if( !bTrisAdded ) + { + CRender::g_pRender->SetCombinerAndBlender(); + } + + bTrisAdded = true; + PrepareTriangle(v0, v2, v1); + } + } + + w0 = *(uint32 *)(g_pRDRAMu8 + dwPC+0); + w1 = *(uint32 *)(g_pRDRAMu8 + dwPC+4); + dwPC += 8; + +#ifdef DEBUGGER + } while (!(pauseAtNext && eventToPause==NEXT_TRIANGLE) && (w0>>24) == (uint8)RSP_TRI2); +#else + } while (((w0)>>24) == (uint8)RSP_TRI2); +#endif + + + gDlistStack[gDlistStackPointer].pc = dwPC-8; + + if (bTrisAdded) + { + CRender::g_pRender->DrawTriangles(); + } + + DEBUG_TRIANGLE(TRACE0("Pause at GBI0 TRI4")); + + gRSP.DKRVtxCount=0; +} + +//Nintro64 uses Sprite2d + + +void RSP_RDP_Nothing(Gfx *gfx) +{ + SP_Timing(RSP_RDP_Nothing); + +#ifdef DEBUGGER + if( logWarning ) + { + TRACE0("Stack Trace"); + for( int i=0; iwords.w0, gfx->words.w1); + } + DEBUGGER_PAUSE_AND_DUMP_COUNT_N(NEXT_UNKNOWN_OP, {TRACE0("Paused at unknown ucode\n");}) + if( debuggerContinueWithUnknown ) + { + return; + } +#endif + + if( options.bEnableHacks ) + return; + + gDlistStackPointer=-1; +} + + +void RSP_RDP_InsertMatrix(Gfx *gfx) +{ + float fraction; + + UpdateCombinedMatrix(); + + if ((gfx->words.w0) & 0x20) + { + int x = ((gfx->words.w0) & 0x1F) >> 1; + int y = x >> 2; + x &= 3; + + fraction = ((gfx->words.w1)>>16)/65536.0f; + gRSPworldProject.m[y][x] = (float)(int)gRSPworldProject.m[y][x]; + gRSPworldProject.m[y][x] += fraction; + + fraction = ((gfx->words.w1)&0xFFFF)/65536.0f; + gRSPworldProject.m[y][x+1] = (float)(int)gRSPworldProject.m[y][x+1]; + gRSPworldProject.m[y][x+1] += fraction; + } + else + { + int x = ((gfx->words.w0) & 0x1F) >> 1; + int y = x >> 2; + x &= 3; + + fraction = (float)fabs(gRSPworldProject.m[y][x] - (int)gRSPworldProject.m[y][x]); + gRSPworldProject.m[y][x] = (short)((gfx->words.w1)>>16) + fraction; + + fraction = (float)fabs(gRSPworldProject.m[y][x+1] - (int)gRSPworldProject.m[y][x+1]); + gRSPworldProject.m[y][x+1] = (short)((gfx->words.w1)&0xFFFF) + fraction; + } + + gRSP.bMatrixIsUpdated = false; + gRSP.bCombinedMatrixIsUpdated = true; + +#ifdef DEBUGGER + if( pauseAtNext && eventToPause == NEXT_MATRIX_CMD ) + { + pauseAtNext = false; + debuggerPause = true; + DebuggerAppendMsg("Pause after insert matrix: %08X, %08X", gfx->words.w0, gfx->words.w1); + } + else + { + if( pauseAtNext && logMatrix ) + { + DebuggerAppendMsg("insert matrix: %08X, %08X", gfx->words.w0, gfx->words.w1); + } + } +#endif +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/RSP_GBI1.h b/libmupen64plus/mupen64plus-video-rice/src/RSP_GBI1.h new file mode 100644 index 0000000000..ace52ab06b --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/RSP_GBI1.h @@ -0,0 +1,400 @@ +/* +Copyright (C) 2002 Rice1964 + +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. + +*/ + +#include "Render.h" +#include "Timing.h" + +void RSP_GBI1_Vtx(Gfx *gfx) +{ + uint32 addr = RSPSegmentAddr((gfx->gbi1vtx.addr)); + uint32 v0 = gfx->gbi1vtx.v0; + uint32 n = gfx->gbi1vtx.n; + + LOG_UCODE(" Address 0x%08x, v0: %d, Num: %d, Length: 0x%04x", addr, v0, n, gfx->gbi1vtx.len); + + if (addr > g_dwRamSize) + { + TRACE0(" Address out of range - ignoring load"); + return; + } + + if ((v0 + n) > 80) + { + TRACE5("Warning, invalid vertex positions, N=%d, v0=%d, Addr=0x%08X, Cmd=%08X-%08X", + n, v0, addr, gfx->words.w0, gfx->words.w1); + return; + } + + ProcessVertexData(addr, v0, n); + status.dwNumVertices += n; + DisplayVertexInfo(addr, v0, n); +} + +void RSP_GBI1_ModifyVtx(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_ModifyVtx); + + if( gRSP.ucode == 5 && ((gfx->words.w0)&0x00FFFFFF) == 0 && ((gfx->words.w1)&0xFF000000) == 0x80000000 ) + { + DLParser_Bomberman2TextRect(gfx); + } + else + { + uint32 dwWhere = ((gfx->words.w0) >> 16) & 0xFF; + uint32 dwVert = (((gfx->words.w0) ) & 0xFFFF) / 2; + uint32 dwValue = (gfx->words.w1); + + if( dwVert > 80 ) + { + RSP_RDP_NOIMPL("RSP_GBI1_ModifyVtx: Invalid vertex number: %d", dwVert, 0); + return; + } + + // Data for other commands? + switch (dwWhere) + { + case RSP_MV_WORD_OFFSET_POINT_RGBA: // Modify RGBA + case RSP_MV_WORD_OFFSET_POINT_XYSCREEN: // Modify X,Y + case RSP_MV_WORD_OFFSET_POINT_ZSCREEN: // Modify C + case RSP_MV_WORD_OFFSET_POINT_ST: // Texture + ModifyVertexInfo(dwWhere, dwVert, dwValue); + break; + default: + RSP_RDP_NOIMPL("RSP_GBI1_ModifyVtx: Setting unk value: 0x%02x, 0x%08x", dwWhere, dwValue); + break; + } + } +} + +void RSP_GBI1_Tri2(Gfx *gfx) +{ + status.primitiveType = PRIM_TRI2; + bool bTrisAdded = false; + bool bTexturesAreEnabled = CRender::g_pRender->IsTextureEnabled(); + + // While the next command pair is Tri2, add vertices + uint32 dwPC = gDlistStack[gDlistStackPointer].pc; + + do { + // Vertex indices are multiplied by 10 for Mario64, by 2 for MarioKart + uint32 dwV0 = gfx->gbi1tri2.v0/gRSP.vertexMult; + uint32 dwV1 = gfx->gbi1tri2.v1/gRSP.vertexMult; + uint32 dwV2 = gfx->gbi1tri2.v2/gRSP.vertexMult; + + uint32 dwV3 = gfx->gbi1tri2.v3/gRSP.vertexMult; + uint32 dwV4 = gfx->gbi1tri2.v4/gRSP.vertexMult; + uint32 dwV5 = gfx->gbi1tri2.v5/gRSP.vertexMult; + + // Do first tri + if (IsTriangleVisible(dwV0, dwV1, dwV2)) + { + DEBUG_DUMP_VERTEXES("Tri2 1/2", dwV0, dwV1, dwV2); + if (!bTrisAdded) + { + if( bTexturesAreEnabled ) + { + PrepareTextures(); + InitVertexTextureConstants(); + } + + CRender::g_pRender->SetCombinerAndBlender(); + bTrisAdded = true; + } + PrepareTriangle(dwV0, dwV1, dwV2); + } + + // Do second tri + if (IsTriangleVisible(dwV3, dwV4, dwV5)) + { + DEBUG_DUMP_VERTEXES("Tri2 2/2", dwV3, dwV4, dwV5); + if (!bTrisAdded) + { + if( bTexturesAreEnabled ) + { + PrepareTextures(); + InitVertexTextureConstants(); + } + + CRender::g_pRender->SetCombinerAndBlender(); + bTrisAdded = true; + } + PrepareTriangle(dwV3, dwV4, dwV5); + } + + gfx++; + dwPC += 8; +#ifdef DEBUGGER + } while (!(pauseAtNext && eventToPause==NEXT_TRIANGLE) && gfx->words.cmd == (uint8)RSP_TRI2); +#else + } while( gfx->words.cmd == (uint8)RSP_TRI2); +#endif + + + gDlistStack[gDlistStackPointer].pc = dwPC-8; + + + if (bTrisAdded) + { + CRender::g_pRender->DrawTriangles(); + } + + DEBUG_TRIANGLE(TRACE0("Pause at GBI1 TRI1")); +} + +extern XVECTOR4 g_vtxNonTransformed[MAX_VERTS]; + +void RSP_GBI1_BranchZ(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_BranchZ); + + uint32 vtx = ((gfx->words.w0)&0xFFF)>>1; + float vtxdepth = g_vecProjected[vtx].z/g_vecProjected[vtx].w; + +#ifdef DEBUGGER + if( debuggerEnableZBuffer==FALSE || vtxdepth <= (s32)gfx->words.w1 || g_curRomInfo.bForceDepthBuffer ) +#else + if( vtxdepth <= (s32)(gfx->words.w1) || g_curRomInfo.bForceDepthBuffer ) +#endif + { + uint32 dwPC = gDlistStack[gDlistStackPointer].pc; // This points to the next instruction + uint32 dwDL = *(uint32 *)(g_pRDRAMu8 + dwPC-12); + uint32 dwAddr = RSPSegmentAddr(dwDL); + + dwAddr = RSPSegmentAddr(dwDL);; + + LOG_UCODE("BranchZ to DisplayList 0x%08x", dwAddr); + gDlistStack[gDlistStackPointer].pc = dwAddr; + gDlistStack[gDlistStackPointer].countdown = MAX_DL_COUNT; + } +} + +#ifdef DEBUGGER +void DumpUcodeInfo(UcodeInfo &info) +{ + DebuggerAppendMsg("Loading Unknown Ucode:\n%08X-%08X-%08X-%08X, Size=0x%X, CRC=0x%08X\nCode:\n", + info.ucDWORD1, info.ucDWORD2, info.ucDWORD3, info.ucDWORD4, + info.ucSize, info.ucCRC); + DumpHex(info.ucStart,20); + TRACE0("Data:\n"); + DumpHex(info.ucDStart,20); +} +#endif + +void RSP_GBI1_LoadUCode(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_LoadUCode); + + //TRACE0("Load ucode"); + uint32 dwPC = gDlistStack[gDlistStackPointer].pc; + uint32 dwUcStart = RSPSegmentAddr((gfx->words.w1)); + uint32 dwSize = ((gfx->words.w0)&0xFFFF)+1; + uint32 dwUcDStart = RSPSegmentAddr(*(uint32 *)(g_pRDRAMu8 + dwPC-12)); + + uint32 ucode = DLParser_CheckUcode(dwUcStart, dwUcDStart, dwSize, 8); + RSP_SetUcode(ucode, dwUcStart, dwUcDStart, dwSize); + + DEBUGGER_PAUSE_AND_DUMP(NEXT_SWITCH_UCODE,{DebuggerAppendMsg("Pause at loading ucode");}); +} + +void RSP_GFX_Force_Matrix(uint32 dwAddr) +{ + if (dwAddr + 64 > g_dwRamSize) + { + DebuggerAppendMsg("ForceMtx: Address invalid (0x%08x)", dwAddr); + return; + } + + // Load matrix from dwAddr + LoadMatrix(dwAddr); + + CRender::g_pRender->SetWorldProjectMatrix(matToLoad); + + DEBUGGER_PAUSE_AND_DUMP(NEXT_MATRIX_CMD,{TRACE0("Paused at ModMatrix Cmd");}); +} + + +void DisplayVertexInfo(uint32 dwAddr, uint32 dwV0, uint32 dwN) +{ +#ifdef DEBUGGER + s8 *pcSrc = (s8 *)(g_pRDRAMu8 + dwAddr); + short *psSrc = (short *)(g_pRDRAMu8 + dwAddr); + + for (uint32 dwV = dwV0; dwV < dwV0 + dwN; dwV++) + { + float x = (float)psSrc[0^0x1]; + float y = (float)psSrc[1^0x1]; + float z = (float)psSrc[2^0x1]; + + //uint32 wFlags = g_dwVtxFlags[dwV]; //(uint16)psSrc[3^0x1]; + uint32 wFlags = 0; + + uint8 a = pcSrc[12^0x3]; + uint8 b = pcSrc[13^0x3]; + uint8 c = pcSrc[14^0x3]; + uint8 d = pcSrc[15^0x3]; + + //int nTU = (int)(short)(psSrc[4^0x1]<<4); + //int nTV = (int)(short)(psSrc[5^0x1]<<4); + + //float tu = (float)(nTU>>4); + //float tv = (float)(nTV>>4); + float tu = (float)(short)(psSrc[4^0x1]); + float tv = (float)(short)(psSrc[5^0x1]); + + XVECTOR4 & t = g_vecProjected[dwV]; + + psSrc += 8; // Increase by 16 bytes + pcSrc += 16; + + LOG_UCODE(" #%02d Flags: 0x%04x Pos: {% 6f,% 6f,% 6f} Tex: {%+7.2f,%+7.2f}, Extra: %02x %02x %02x %02x (transf: {% 6f,% 6f,% 6f})", + dwV, wFlags, x, y, z, tu, tv, a, b, c, d, t.x, t.y, t.z ); + } +#endif +} + +void RSP_MoveMemLight(uint32 dwLight, uint32 dwAddr) +{ + if( dwLight >= 16 ) + { + DebuggerAppendMsg("Warning: invalid light # = %d", dwLight); + return; + } + + s8 * pcBase = g_pRDRAMs8 + dwAddr; + uint32 * pdwBase = (uint32 *)pcBase; + + + float range = 0, x, y, z; + if( options.enableHackForGames == HACK_FOR_ZELDA_MM && (pdwBase[0]&0xFF) == 0x08 && (pdwBase[1]&0xFF) == 0xFF ) + { + gRSPn64lights[dwLight].dwRGBA = pdwBase[0]; + gRSPn64lights[dwLight].dwRGBACopy = pdwBase[1]; + short* pdwBase16 = (short*)pcBase; + x = pdwBase16[5]; + y = pdwBase16[4]; + z = pdwBase16[7]; + range = pdwBase16[6]; + } + else + { + gRSPn64lights[dwLight].dwRGBA = pdwBase[0]; + gRSPn64lights[dwLight].dwRGBACopy = pdwBase[1]; + x = pcBase[8 ^ 0x3]; + y = pcBase[9 ^ 0x3]; + z = pcBase[10 ^ 0x3]; + } + + + LOG_UCODE(" RGBA: 0x%08x, RGBACopy: 0x%08x, x: %d, y: %d, z: %d", + gRSPn64lights[dwLight].dwRGBA, + gRSPn64lights[dwLight].dwRGBACopy, + x, y, z); + + LIGHT_DUMP(TRACE3("Move Light: %08X, %08X, %08X", pdwBase[0], pdwBase[1], pdwBase[2])); + + + if (dwLight == gRSP.ambientLightIndex) + { + LOG_UCODE(" (Ambient Light)"); + + uint32 dwCol = COLOR_RGBA( (gRSPn64lights[dwLight].dwRGBA >> 24)&0xFF, + (gRSPn64lights[dwLight].dwRGBA >> 16)&0xFF, + (gRSPn64lights[dwLight].dwRGBA >> 8)&0xFF, 0xff); + + SetAmbientLight( dwCol ); + } + else + { + LOG_UCODE(" (Normal Light)"); + + SetLightCol(dwLight, gRSPn64lights[dwLight].dwRGBA); + if (pdwBase[2] == 0) // Direction is 0! + { + LOG_UCODE(" Light is invalid"); + } + SetLightDirection(dwLight, x, y, z, range); + } +} + +void RSP_MoveMemViewport(uint32 dwAddr) +{ + if( dwAddr+16 >= g_dwRamSize ) + { + TRACE0("MoveMem Viewport, invalid memory"); + return; + } + + short scale[4]; + short trans[4]; + + // dwAddr is offset into RD_RAM of 8 x 16bits of data... + scale[0] = *(short *)(g_pRDRAMu8 + ((dwAddr+(0*2))^0x2)); + scale[1] = *(short *)(g_pRDRAMu8 + ((dwAddr+(1*2))^0x2)); + scale[2] = *(short *)(g_pRDRAMu8 + ((dwAddr+(2*2))^0x2)); + scale[3] = *(short *)(g_pRDRAMu8 + ((dwAddr+(3*2))^0x2)); + + trans[0] = *(short *)(g_pRDRAMu8 + ((dwAddr+(4*2))^0x2)); + trans[1] = *(short *)(g_pRDRAMu8 + ((dwAddr+(5*2))^0x2)); + trans[2] = *(short *)(g_pRDRAMu8 + ((dwAddr+(6*2))^0x2)); + trans[3] = *(short *)(g_pRDRAMu8 + ((dwAddr+(7*2))^0x2)); + + + int nCenterX = trans[0]/4; + int nCenterY = trans[1]/4; + int nWidth = scale[0]/4; + int nHeight = scale[1]/4; + + // Check for some strange games + if( nWidth < 0 ) nWidth = -nWidth; + if( nHeight < 0 ) nHeight = -nHeight; + + int nLeft = nCenterX - nWidth; + int nTop = nCenterY - nHeight; + int nRight= nCenterX + nWidth; + int nBottom= nCenterY + nHeight; + + //int maxZ = scale[2]; + int maxZ = 0x3FF; + + CRender::g_pRender->SetViewport(nLeft, nTop, nRight, nBottom, maxZ); + + LOG_UCODE(" Scale: %d %d %d %d = %d,%d", scale[0], scale[1], scale[2], scale[3], nWidth, nHeight); + LOG_UCODE(" Trans: %d %d %d %d = %d,%d", trans[0], trans[1], trans[2], trans[3], nCenterX, nCenterY); +} + + +// S2DEX uses this - 0xc1 +void RSP_S2DEX_SPObjLoadTxtr_Ucode1(Gfx *gfx) +{ + SP_Timing(RSP_S2DEX_SPObjLoadTxtr_Ucode1); + + // Add S2DEX ucode supporting to F3DEX, see game DT and others + status.bUseModifiedUcodeMap = true; + RSP_SetUcode(1); + memcpy( &LoadedUcodeMap, &ucodeMap1, sizeof(UcodeMap)); + + LoadedUcodeMap[S2DEX_OBJ_MOVEMEM] = &RSP_S2DEX_OBJ_MOVEMEM; + LoadedUcodeMap[S2DEX_OBJ_LOADTXTR] = &RSP_S2DEX_SPObjLoadTxtr; + LoadedUcodeMap[S2DEX_OBJ_LDTX_SPRITE] = &RSP_S2DEX_SPObjLoadTxSprite; + LoadedUcodeMap[S2DEX_OBJ_LDTX_RECT] = &RSP_S2DEX_SPObjLoadTxRect; + LoadedUcodeMap[S2DEX_OBJ_LDTX_RECT_R] = &RSP_S2DEX_SPObjLoadTxRectR; + + RSP_S2DEX_SPObjLoadTxtr(gfx); +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/RSP_GBI2.h b/libmupen64plus/mupen64plus-video-rice/src/RSP_GBI2.h new file mode 100644 index 0000000000..22eb286216 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/RSP_GBI2.h @@ -0,0 +1,923 @@ +/* +Copyright (C) 2002 Rice1964 + +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. + +*/ + +#include "Render.h" +#include "Timing.h" + +void RSP_GBI2_Vtx(Gfx *gfx) +{ + uint32 addr = RSPSegmentAddr((gfx->gbi2vtx.addr)); + int vend = gfx->gbi2vtx.vend/2; + int n = gfx->gbi2vtx.n; + int v0 = vend - n; + + LOG_UCODE(" Vtx: Address 0x%08x, vEnd: %d, v0: %d, Num: %d", addr, vend, v0, n); + + if( vend > 64 ) + { + DebuggerAppendMsg("Warning, attempting to load into invalid vertex positions, v0=%d, n=%d", v0, n); + return; + } + + if ((addr + (n*16)) > g_dwRamSize) + { + DebuggerAppendMsg("ProcessVertexData: Address out of range (0x%08x)", addr); + } + else + { + ProcessVertexData(addr, v0, n); + status.dwNumVertices += n; + DisplayVertexInfo(addr, v0, n); + } +} + +void RSP_GBI2_EndDL(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_EndDL); + + RDP_GFX_PopDL(); +} + +void RSP_GBI2_CullDL(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_CullDL); + +#ifdef DEBUGGER + if( !debuggerEnableCullFace ) + { + return; //Disable Culling + } +#endif + if( g_curRomInfo.bDisableCulling ) + { + return; //Disable Culling + } + + uint32 dwVFirst = (((gfx->words.w0)) & 0xfff) / gRSP.vertexMult; + uint32 dwVLast = (((gfx->words.w1)) & 0xfff) / gRSP.vertexMult; + + LOG_UCODE(" Culling using verts %d to %d", dwVFirst, dwVLast); + + // Mask into range + dwVFirst &= 0x1f; + dwVLast &= 0x1f; + + if( dwVLast < dwVFirst ) return; + if( !gRSP.bRejectVtx ) return; + + for (uint32 i = dwVFirst; i <= dwVLast; i++) + { + //if (g_dwVtxFlags[i] == 0) + if (g_clipFlag[i] == 0) + { + LOG_UCODE(" Vertex %d is visible, returning", i); + return; + } + } + + status.dwNumDListsCulled++; + + LOG_UCODE(" No vertices were visible, culling"); + + RDP_GFX_PopDL(); +} + +void RSP_GBI2_MoveWord(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_MoveWord); + + switch (gfx->gbi2moveword.type) + { + case RSP_MOVE_WORD_MATRIX: + RSP_RDP_InsertMatrix(gfx); + break; + case RSP_MOVE_WORD_NUMLIGHT: + { + uint32 dwNumLights = gfx->gbi2moveword.value/24; + gRSP.ambientLightIndex = dwNumLights; + SetNumLights(dwNumLights); + } + break; + + case RSP_MOVE_WORD_CLIP: + { + switch (gfx->gbi2moveword.offset) + { + case RSP_MV_WORD_OFFSET_CLIP_RNX: + case RSP_MV_WORD_OFFSET_CLIP_RNY: + case RSP_MV_WORD_OFFSET_CLIP_RPX: + case RSP_MV_WORD_OFFSET_CLIP_RPY: + CRender::g_pRender->SetClipRatio(gfx->gbi2moveword.offset, gfx->gbi2moveword.value); + default: + LOG_UCODE(" RSP_MOVE_WORD_CLIP ? : 0x%08x", gfx->words.w1); + break; + } + } + break; + + case RSP_MOVE_WORD_SEGMENT: + { + uint32 dwSeg = gfx->gbi2moveword.offset / 4; + uint32 dwAddr = gfx->gbi2moveword.value & 0x00FFFFFF; // Hack - convert to physical + + LOG_UCODE(" RSP_MOVE_WORD_SEGMENT Segment[%d] = 0x%08x", dwSeg, dwAddr); + if( dwAddr > g_dwRamSize ) + { + gRSP.segments[dwSeg] = dwAddr; +#ifdef DEBUGGER + if( pauseAtNext ) + DebuggerAppendMsg("warning: Segment %d addr is %8X", dwSeg, dwAddr); +#endif + } + else + { + gRSP.segments[dwSeg] = dwAddr; + } + } + break; + case RSP_MOVE_WORD_FOG: + { + uint16 wMult = (uint16)((gfx->gbi2moveword.value >> 16) & 0xFFFF); + uint16 wOff = (uint16)((gfx->gbi2moveword.value ) & 0xFFFF); + + float fMult = (float)(short)wMult; + float fOff = (float)(short)wOff; + + float rng = 128000.0f / fMult; + float fMin = 500.0f - (fOff*rng/256.0f); + float fMax = rng + fMin; + + FOG_DUMP(TRACE4("Set Fog: Min=%f, Max=%f, Mul=%f, Off=%f", fMin, fMax, fMult, fOff)); + //if( fMult <= 0 || fMin > fMax || fMax < 0 || fMin > 1000 ) + if( fMult <= 0 || fMax < 0 ) + { + // Hack + fMin = 996; + fMax = 1000; + fMult = 0; + fOff = 1; + } + + SetFogMinMax(fMin, fMax, fMult, fOff); + FOG_DUMP(TRACE3("Set Fog: Min=%f, Max=%f, Data=0x%08X", fMin, fMax, gfx->gbi2moveword.value)); + } + break; + case RSP_MOVE_WORD_LIGHTCOL: + { + uint32 dwLight = gfx->gbi2moveword.offset / 0x18; + uint32 dwField = (gfx->gbi2moveword.offset & 0x7); + + switch (dwField) + { + case 0: + if (dwLight == gRSP.ambientLightIndex) + { + SetAmbientLight( (gfx->gbi2moveword.value>>8) ); + } + else + { + SetLightCol(dwLight, gfx->gbi2moveword.value); + } + break; + + case 4: + break; + + default: + DebuggerAppendMsg("RSP_MOVE_WORD_LIGHTCOL with unknown offset 0x%08x", dwField); + break; + } + + + } + break; + + case RSP_MOVE_WORD_PERSPNORM: + LOG_UCODE(" RSP_MOVE_WORD_PERSPNORM 0x%04x", (short)gfx->words.w1); + break; + + case RSP_MOVE_WORD_POINTS: + LOG_UCODE(" 2nd cmd of Force Matrix"); + break; + + default: + { + LOG_UCODE(" Ignored!!"); + + } + break; + } +} + +void RSP_GBI2_Tri1(Gfx *gfx) +{ + if( gfx->words.w0 == 0x05000017 && gfx->gbi2tri1.flag == 0x80 ) + { + // The ObjLoadTxtr / Tlut cmd for Evangelion.v64 + RSP_S2DEX_SPObjLoadTxtr(gfx); + DebuggerAppendMsg("Fix me, SPObjLoadTxtr as RSP_GBI2_Tri2"); + } + else + { + status.primitiveType = PRIM_TRI1; + bool bTrisAdded = false; + bool bTexturesAreEnabled = CRender::g_pRender->IsTextureEnabled(); + + // While the next command pair is Tri1, add vertices + uint32 dwPC = gDlistStack[gDlistStackPointer].pc; + //uint32 * pCmdBase = (uint32 *)(g_pRDRAMu8 + dwPC); + + do + { + uint32 dwV2 = gfx->gbi2tri1.v2/gRSP.vertexMult; + uint32 dwV1 = gfx->gbi2tri1.v1/gRSP.vertexMult; + uint32 dwV0 = gfx->gbi2tri1.v0/gRSP.vertexMult; + + if (IsTriangleVisible(dwV0, dwV1, dwV2)) + { + DEBUG_DUMP_VERTEXES("ZeldaTri1", dwV0, dwV1, dwV2); + LOG_UCODE(" ZeldaTri1: 0x%08x 0x%08x %d,%d,%d", gfx->words.w0, gfx->words.w1, dwV0, dwV1, dwV2); + if (!bTrisAdded) + { + if( bTexturesAreEnabled ) + { + PrepareTextures(); + InitVertexTextureConstants(); + } + + CRender::g_pRender->SetCombinerAndBlender(); + bTrisAdded = true; + } + PrepareTriangle(dwV0, dwV1, dwV2); + } + + gfx++; + dwPC += 8; + +#ifdef DEBUGGER + } while (!(pauseAtNext && eventToPause==NEXT_TRIANGLE) && gfx->words.cmd == (uint8)RSP_ZELDATRI1); +#else + } while( gfx->words.cmd == (uint8)RSP_ZELDATRI1); +#endif + + gDlistStack[gDlistStackPointer].pc = dwPC-8; + + if (bTrisAdded) + { + CRender::g_pRender->DrawTriangles(); + } + + DEBUG_TRIANGLE(TRACE0("Pause at GBI2 TRI1")); + } +} + +void RSP_GBI2_Tri2(Gfx *gfx) +{ + if( gfx->words.w0 == 0x0600002f && gfx->gbi2tri2.flag == 0x80 ) + { + // The ObjTxSprite cmd for Evangelion.v64 + RSP_S2DEX_SPObjLoadTxSprite(gfx); + DebuggerAppendMsg("Fix me, SPObjLoadTxSprite as RSP_GBI2_Tri2"); + } + else + { + status.primitiveType = PRIM_TRI2; + BOOL bTrisAdded = FALSE; + + // While the next command pair is Tri2, add vertices + uint32 dwPC = gDlistStack[gDlistStackPointer].pc; + bool bTexturesAreEnabled = CRender::g_pRender->IsTextureEnabled(); + + do { + uint32 dwV2 = gfx->gbi2tri2.v2; + uint32 dwV1 = gfx->gbi2tri2.v1; + uint32 dwV0 = gfx->gbi2tri2.v0; + + uint32 dwV5 = gfx->gbi2tri2.v5; + uint32 dwV4 = gfx->gbi2tri2.v4; + uint32 dwV3 = gfx->gbi2tri2.v3; + + LOG_UCODE(" ZeldaTri2: 0x%08x 0x%08x", gfx->words.w0, gfx->words.w1); + LOG_UCODE(" V0: %d, V1: %d, V2: %d", dwV0, dwV1, dwV2); + LOG_UCODE(" V3: %d, V4: %d, V5: %d", dwV3, dwV4, dwV5); + + // Do first tri + if (IsTriangleVisible(dwV0, dwV1, dwV2)) + { + DEBUG_DUMP_VERTEXES("ZeldaTri2 1/2", dwV0, dwV1, dwV2); + if (!bTrisAdded) + { + if( bTexturesAreEnabled ) + { + PrepareTextures(); + InitVertexTextureConstants(); + } + + CRender::g_pRender->SetCombinerAndBlender(); + bTrisAdded = true; + } + + PrepareTriangle(dwV0, dwV1, dwV2); + } + + // Do second tri + if (IsTriangleVisible(dwV3, dwV4, dwV5)) + { + DEBUG_DUMP_VERTEXES("ZeldaTri2 2/2", dwV3, dwV4, dwV5); + if (!bTrisAdded) + { + if( bTexturesAreEnabled ) + { + PrepareTextures(); + InitVertexTextureConstants(); + } + + CRender::g_pRender->SetCombinerAndBlender(); + bTrisAdded = true; + } + + PrepareTriangle(dwV3, dwV4, dwV5); + } + + gfx++; + dwPC += 8; + +#ifdef DEBUGGER + } while (!(pauseAtNext && eventToPause==NEXT_TRIANGLE) && gfx->words.cmd == (uint8)RSP_ZELDATRI2); +#else + } while ( gfx->words.cmd == (uint8)RSP_ZELDATRI2 );//&& status.dwNumTrisRendered < 50); +#endif + + + gDlistStack[gDlistStackPointer].pc = dwPC-8; + + if (bTrisAdded) + { + CRender::g_pRender->DrawTriangles(); + } + + DEBUG_TRIANGLE(TRACE0("Pause at GBI2 TRI2")); + } +} + +void RSP_GBI2_Line3D(Gfx *gfx) +{ + if( gfx->words.w0 == 0x0700002f && (gfx->words.w1>>24) == 0x80 ) + { + // The ObjTxSprite cmd for Evangelion.v64 + RSP_S2DEX_SPObjLoadTxRect(gfx); + } + else + { + status.primitiveType = PRIM_TRI3; + + uint32 dwPC = gDlistStack[gDlistStackPointer].pc; + + BOOL bTrisAdded = FALSE; + + do { + uint32 dwV0 = gfx->gbi2line3d.v0/gRSP.vertexMult; + uint32 dwV1 = gfx->gbi2line3d.v1/gRSP.vertexMult; + uint32 dwV2 = gfx->gbi2line3d.v2/gRSP.vertexMult; + + uint32 dwV3 = gfx->gbi2line3d.v3/gRSP.vertexMult; + uint32 dwV4 = gfx->gbi2line3d.v4/gRSP.vertexMult; + uint32 dwV5 = gfx->gbi2line3d.v5/gRSP.vertexMult; + + LOG_UCODE(" ZeldaTri3: 0x%08x 0x%08x", gfx->words.w0, gfx->words.w1); + LOG_UCODE(" V0: %d, V1: %d, V2: %d", dwV0, dwV1, dwV2); + LOG_UCODE(" V3: %d, V4: %d, V5: %d", dwV3, dwV4, dwV5); + + // Do first tri + if (IsTriangleVisible(dwV0, dwV1, dwV2)) + { + DEBUG_DUMP_VERTEXES("ZeldaTri3 1/2", dwV0, dwV1, dwV2); + if (!bTrisAdded && CRender::g_pRender->IsTextureEnabled()) + { + PrepareTextures(); + InitVertexTextureConstants(); + } + + if( !bTrisAdded ) + { + CRender::g_pRender->SetCombinerAndBlender(); + } + + bTrisAdded = true; + PrepareTriangle(dwV0, dwV1, dwV2); + } + + // Do second tri + if (IsTriangleVisible(dwV3, dwV4, dwV5)) + { + DEBUG_DUMP_VERTEXES("ZeldaTri3 2/2", dwV3, dwV4, dwV5); + if (!bTrisAdded && CRender::g_pRender->IsTextureEnabled()) + { + PrepareTextures(); + InitVertexTextureConstants(); + } + + if( !bTrisAdded ) + { + CRender::g_pRender->SetCombinerAndBlender(); + } + + bTrisAdded = true; + PrepareTriangle(dwV3, dwV4, dwV5); + } + + gfx++; + dwPC += 8; + +#ifdef DEBUGGER + } while (!(pauseAtNext && eventToPause==NEXT_TRIANGLE) && gfx->words.cmd == (uint8)RSP_LINE3D); +#else + } while ( gfx->words.cmd == (uint8)RSP_LINE3D); +#endif + + gDlistStack[gDlistStackPointer].pc = dwPC-8; + + + if (bTrisAdded) + { + CRender::g_pRender->DrawTriangles(); + } + + DEBUG_TRIANGLE(TRACE0("Pause at GBI2 Line3D")); + } +} + +void RSP_GBI2_Texture(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_Texture); + + float fTextureScaleS = (float)(gfx->texture.scaleS) / (65536.0f * 32.0f); + float fTextureScaleT = (float)(gfx->texture.scaleT) / (65536.0f * 32.0f); + + if( (((gfx->words.w1)>>16)&0xFFFF) == 0xFFFF ) + { + fTextureScaleS = 1/32.0f; + } + else if( (((gfx->words.w1)>>16)&0xFFFF) == 0x8000 ) + { + fTextureScaleS = 1/64.0f; + } + if( (((gfx->words.w1) )&0xFFFF) == 0xFFFF ) + { + fTextureScaleT = 1/32.0f; + } + else if( (((gfx->words.w1) )&0xFFFF) == 0x8000 ) + { + fTextureScaleT = 1/64.0f; + } + + CRender::g_pRender->SetTextureEnableAndScale(gfx->texture.tile, gfx->texture.enable_gbi2, fTextureScaleS, fTextureScaleT); + + /* + if( g_curRomInfo.bTextureScaleHack ) + { + // Hack, need to verify, refer to N64 programming manual + // that if scale = 0.5 (1/64), vtx s,t are also doubled + + if( ((word1>>16)&0xFFFF) == 0x8000 ) + { + fTextureScaleS = 1/128.0f; + if( ((word1)&0xFFFF) == 0xFFFF ) + { + fTextureScaleT = 1/64.0f; + } + } + + if( ((word1 )&0xFFFF) == 0x8000 ) + { + fTextureScaleT = 1/128.0f; + if( ((word1>>16)&0xFFFF) == 0xFFFF ) + { + fTextureScaleS = 1/64.0f; + } + } + } + */ + + CRender::g_pRender->SetTextureEnableAndScale(gfx->texture.tile, gfx->texture.enable_gbi2, fTextureScaleS, fTextureScaleT); + + LOG_TEXTURE( + { + DebuggerAppendMsg("SetTexture: Level: %d Tile: %d %s\n", gfx->texture.level, gfx->texture.tile, gfx->texture.enable_gbi2 ? "enabled":"disabled"); + DebuggerAppendMsg(" ScaleS: %f, ScaleT: %f\n", fTextureScaleS*32.0f, fTextureScaleT*32.0f); + }); + + DEBUGGER_PAUSE_COUNT_N(NEXT_SET_TEXTURE); + + LOG_UCODE(" Level: %d Tile: %d %s", gfx->texture.level, gfx->texture.tile, gfx->texture.enable_gbi2 ? "enabled":"disabled"); + LOG_UCODE(" ScaleS: %f, ScaleT: %f", fTextureScaleS*32.0f, fTextureScaleT*32.0f); +} + + + +void RSP_GBI2_PopMtx(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_PopMtx); + + uint8 nCommand = (uint8)(gfx->words.w0 & 0xFF); + + LOG_UCODE(" PopMtx: 0x%02x (%s)", + nCommand, + (nCommand & RSP_ZELDA_MTX_PROJECTION) ? "Projection" : "ModelView"); + + +/* if (nCommand & RSP_ZELDA_MTX_PROJECTION) + { + CRender::g_pRender->PopProjection(); + } + else*/ + { + CRender::g_pRender->PopWorldView(); + } +#ifdef DEBUGGER + if( pauseAtNext && eventToPause == NEXT_MATRIX_CMD ) + { + pauseAtNext = false; + debuggerPause = true; + TRACE0("Pause after Pop GBI2_PopMtx:"); + } + else + { + if( pauseAtNext && logMatrix ) + { + TRACE0("Pause after Pop GBI2_PopMtx:"); + } + } +#endif + +} + + +#define RSP_ZELDA_ZBUFFER 0x00000001 // Guess +#define RSP_ZELDA_CULL_BACK 0x00000200 +#define RSP_ZELDA_CULL_FRONT 0x00000400 +#define RSP_ZELDA_FOG 0x00010000 +#define RSP_ZELDA_LIGHTING 0x00020000 +#define RSP_ZELDA_TEXTURE_GEN 0x00040000 +#define RSP_ZELDA_TEXTURE_GEN_LINEAR 0x00080000 +#define RSP_ZELDA_SHADING_SMOOTH 0x00200000 + +void RSP_GBI2_GeometryMode(Gfx *gfx) +{ + SP_Timing(RSP_GBI2_GeometryMode); + + uint32 dwAnd = ((gfx->words.w0)) & 0x00FFFFFF; + uint32 dwOr = ((gfx->words.w1)) & 0x00FFFFFF; + +#ifdef DEBUGGER + LOG_UCODE(" 0x%08x 0x%08x =(x & 0x%08x) | 0x%08x", gfx->words.w0, gfx->words.w1, dwAnd, dwOr); + + if ((~dwAnd) & RSP_ZELDA_ZBUFFER) LOG_UCODE(" Disabling ZBuffer"); + //if ((~dwAnd) & RSP_ZELDA_TEXTURE_ENABLE) LOG_UCODE(" Disabling Texture"); + //if ((~dwAnd) & RSP_ZELDA_SHADE) LOG_UCODE(" Disabling Shade"); + if ((~dwAnd) & RSP_ZELDA_SHADING_SMOOTH) LOG_UCODE(" Disabling Flat Shading"); + if ((~dwAnd) & RSP_ZELDA_CULL_FRONT) LOG_UCODE(" Disabling Front Culling"); + if ((~dwAnd) & RSP_ZELDA_CULL_BACK) LOG_UCODE(" Disabling Back Culling"); + if ((~dwAnd) & RSP_ZELDA_FOG) LOG_UCODE(" Disabling Fog"); + if ((~dwAnd) & RSP_ZELDA_LIGHTING) LOG_UCODE(" Disabling Lighting"); + if ((~dwAnd) & RSP_ZELDA_TEXTURE_GEN) LOG_UCODE(" Disabling Texture Gen"); + if ((~dwAnd) & RSP_ZELDA_TEXTURE_GEN_LINEAR) LOG_UCODE(" Disabling Texture Gen Linear"); + // if ((~dwAnd) & RSP_ZELDA_LOD) LOG_UCODE(" Disabling LOD (no impl)"); + + if (dwOr & RSP_ZELDA_ZBUFFER) LOG_UCODE(" Enabling ZBuffer"); + //if (dwOr & RSP_ZELDA_TEXTURE_ENABLE) LOG_UCODE(" Enabling Texture"); + //if (dwOr & RSP_ZELDA_SHADE) LOG_UCODE(" Enabling Shade"); + if (dwOr & RSP_ZELDA_SHADING_SMOOTH) LOG_UCODE(" Enabling Flat Shading"); + if (dwOr & RSP_ZELDA_CULL_FRONT) LOG_UCODE(" Enabling Front Culling"); + if (dwOr & RSP_ZELDA_CULL_BACK) LOG_UCODE(" Enabling Back Culling"); + if (dwOr & RSP_ZELDA_FOG) LOG_UCODE(" Enabling Fog"); + if (dwOr & RSP_ZELDA_LIGHTING) LOG_UCODE(" Enabling Lighting"); + if (dwOr & RSP_ZELDA_TEXTURE_GEN) LOG_UCODE(" Enabling Texture Gen"); + if (dwOr & RSP_ZELDA_TEXTURE_GEN_LINEAR) LOG_UCODE(" Enabling Texture Gen Linear"); + ///if (dwOr & RSP_ZELDA_LOD) LOG_UCODE(" Enabling LOD (no impl)"); +#endif // DEBUGGER + + gRDP.geometryMode &= dwAnd; + gRDP.geometryMode |= dwOr; + + + bool bCullFront = (gRDP.geometryMode & RSP_ZELDA_CULL_FRONT) ? true : false; + bool bCullBack = (gRDP.geometryMode & RSP_ZELDA_CULL_BACK) ? true : false; + + //BOOL bShade = (gRDP.geometryMode & G_SHADE) ? TRUE : FALSE; + //BOOL bFlatShade = (gRDP.geometryMode & RSP_ZELDA_SHADING_SMOOTH) ? TRUE : FALSE; + BOOL bFlatShade = (gRDP.geometryMode & RSP_ZELDA_TEXTURE_GEN_LINEAR) ? TRUE : FALSE; + if( options.enableHackForGames == HACK_FOR_TIGER_HONEY_HUNT ) + bFlatShade = FALSE; + + bool bFog = (gRDP.geometryMode & RSP_ZELDA_FOG) ? true : false; + bool bTextureGen = (gRDP.geometryMode & RSP_ZELDA_TEXTURE_GEN) ? true : false; + + bool bLighting = (gRDP.geometryMode & RSP_ZELDA_LIGHTING) ? true : false; + BOOL bZBuffer = (gRDP.geometryMode & RSP_ZELDA_ZBUFFER) ? TRUE : FALSE; + + CRender::g_pRender->SetCullMode(bCullFront, bCullBack); + + //if (bFlatShade||!bShade) CRender::g_pRender->SetShadeMode( SHADE_FLAT ); + if (bFlatShade) CRender::g_pRender->SetShadeMode( SHADE_FLAT ); + else CRender::g_pRender->SetShadeMode( SHADE_SMOOTH ); + + SetTextureGen(bTextureGen); + + SetLighting( bLighting ); + CRender::g_pRender->ZBufferEnable( bZBuffer ); + CRender::g_pRender->SetFogEnable( bFog ); +} + + +int dlistMtxCount=0; +extern uint32 dwConkerVtxZAddr; + +void RSP_GBI2_Mtx(Gfx *gfx) +{ + SP_Timing(RSP_GBI0_Mtx); + dwConkerVtxZAddr = 0; // For Conker BFD + + uint32 addr = RSPSegmentAddr((gfx->gbi2matrix.addr)); + + if( gfx->gbi2matrix.param == 0 && gfx->gbi2matrix.len == 0 ) + { + DLParser_Bomberman2TextRect(gfx); + return; + } + + LOG_UCODE(" Mtx: %s %s %s Length %d Address 0x%08x", + gfx->gbi2matrix.projection ? "Projection" : "ModelView", + gfx->gbi2matrix.load ? "Load" : "Mul", + gfx->gbi2matrix.nopush==0 ? "Push" : "No Push", + gfx->gbi2matrix.len, addr); + + if (addr + 64 > g_dwRamSize) + { + DebuggerAppendMsg("ZeldaMtx: Address invalid (0x%08x)", addr); + return; + } + + LoadMatrix(addr); + + if (gfx->gbi2matrix.projection) + { + // So far only Extreme-G seems to Push/Pop projection matrices + CRender::g_pRender->SetProjection(matToLoad, gfx->gbi2matrix.nopush==0, gfx->gbi2matrix.load); + } + else + { + CRender::g_pRender->SetWorldView(matToLoad, gfx->gbi2matrix.nopush==0, gfx->gbi2matrix.load); + + if( options.enableHackForGames == HACK_FOR_SOUTH_PARK_RALLY ) + { + dlistMtxCount++; + if( dlistMtxCount == 2 ) + { + CRender::g_pRender->ClearZBuffer(1.0f); + } + } + } + +#ifdef DEBUGGER + const char *loadstr = gfx->gbi2matrix.load?"Load":"Mul"; + const char *pushstr = gfx->gbi2matrix.nopush==0?"Push":"Nopush"; + int projlevel = CRender::g_pRender->GetProjectMatrixLevel(); + int worldlevel = CRender::g_pRender->GetWorldViewMatrixLevel(); + if( pauseAtNext && eventToPause == NEXT_MATRIX_CMD ) + { + pauseAtNext = false; + debuggerPause = true; + if (gfx->gbi2matrix.projection) + { + DebuggerAppendMsg("Pause after %s and %s Matrix: Projection, level=%d\n", loadstr, pushstr, projlevel ); + } + else + { + DebuggerAppendMsg("Pause after %s and %s Matrix: WorldView level=%d\n", loadstr, pushstr, worldlevel); + } + } + else + { + if( pauseAtNext && logMatrix ) + { + if (gfx->gbi2matrix.projection) + { + DebuggerAppendMsg("Matrix: %s and %s Projection level=%d\n", loadstr, pushstr, projlevel); + } + else + { + DebuggerAppendMsg("Matrix: %s and %s WorldView\n level=%d", loadstr, pushstr, worldlevel); + } + } + } +#endif +} + +void RSP_GBI2_MoveMem(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_MoveMem); + + uint32 addr = RSPSegmentAddr((gfx->words.w1)); + uint32 type = ((gfx->words.w0) ) & 0xFE; + + //uint32 dwLen = ((gfx->words.w0) >> 16) & 0xFF; + //uint32 dwOffset = ((gfx->words.w0) >> 8) & 0xFFFF; + + switch (type) + { + case RSP_GBI2_MV_MEM__VIEWPORT: + { + RSP_MoveMemViewport(addr); + } + break; + case RSP_GBI2_MV_MEM__LIGHT: + { + uint32 dwOffset2 = ((gfx->words.w0) >> 5) & 0x3FFF; + switch (dwOffset2) + { + case 0x00: + { + s8 * pcBase = g_pRDRAMs8 + addr; + LOG_UCODE(" RSP_GBI1_MV_MEM_LOOKATX %f %f %f", + (float)pcBase[8 ^ 0x3], + (float)pcBase[9 ^ 0x3], + (float)pcBase[10 ^ 0x3]); + + } + break; + case 0x18: + { + s8 * pcBase = g_pRDRAMs8 + addr; + LOG_UCODE(" RSP_GBI1_MV_MEM_LOOKATY %f %f %f", + (float)pcBase[8 ^ 0x3], + (float)pcBase[9 ^ 0x3], + (float)pcBase[10 ^ 0x3]); + } + break; + default: //0x30/48/60 + { + uint32 dwLight = (dwOffset2 - 0x30)/0x18; + LOG_UCODE(" Light %d:", dwLight); + RSP_MoveMemLight(dwLight, addr); + } + break; + } + break; + + } + case RSP_GBI2_MV_MEM__MATRIX: + LOG_UCODE("Force Matrix: addr=%08X", addr); + RSP_GFX_Force_Matrix(addr); + break; + case RSP_GBI2_MV_MEM_O_L0: + case RSP_GBI2_MV_MEM_O_L1: + case RSP_GBI2_MV_MEM_O_L2: + case RSP_GBI2_MV_MEM_O_L3: + case RSP_GBI2_MV_MEM_O_L4: + case RSP_GBI2_MV_MEM_O_L5: + case RSP_GBI2_MV_MEM_O_L6: + case RSP_GBI2_MV_MEM_O_L7: + LOG_UCODE("Zelda Move Light"); + RDP_NOIMPL_WARN("Zelda Move Light"); + break; + + case RSP_GBI2_MV_MEM__POINT: + LOG_UCODE("Zelda Move Point"); + void RDP_NOIMPL_WARN(const char* op); + RDP_NOIMPL_WARN("Zelda Move Point"); + break; + + case RSP_GBI2_MV_MEM_O_LOOKATX: + if( (gfx->words.w0) == 0xDC170000 && ((gfx->words.w1)&0xFF000000) == 0x80000000 ) + { + // Ucode for Evangelion.v64, the ObjMatrix cmd + RSP_S2DEX_OBJ_MOVEMEM(gfx); + } + break; + case RSP_GBI2_MV_MEM_O_LOOKATY: + RSP_RDP_NOIMPL("Not implemented ZeldaMoveMem LOOKATY, Cmd0=0x%08X, Cmd1=0x%08X", gfx->words.w0, gfx->words.w1); + break; + case 0x02: + if( (gfx->words.w0) == 0xDC070002 && ((gfx->words.w1)&0xFF000000) == 0x80000000 ) + { + RSP_S2DEX_OBJ_MOVEMEM(gfx); + break; + } + default: + LOG_UCODE("ZeldaMoveMem Type: Unknown"); + RSP_RDP_NOIMPL("Unknown ZeldaMoveMem Type, type=0x%X, Addr=%08X", type, addr); + break; + } +} + + + +void RSP_GBI2_DL(Gfx *gfx) +{ + SP_Timing(RSP_GBI0_DL); + + uint32 dwPush = ((gfx->words.w0) >> 16) & 0xFF; + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + + if( dwAddr > g_dwRamSize ) + { + RSP_RDP_NOIMPL("Error: DL addr = %08X out of range, PC=%08X", dwAddr, gDlistStack[gDlistStackPointer].pc ); + dwAddr &= (g_dwRamSize-1); + DebuggerPauseCountN( NEXT_DLIST ); + } + + LOG_UCODE(" DL: Push:0x%02x Addr: 0x%08x", dwPush, dwAddr); + + switch (dwPush) + { + case RSP_DLIST_PUSH: + LOG_UCODE(" Pushing ZeldaDisplayList 0x%08x", dwAddr); + gDlistStackPointer++; + gDlistStack[gDlistStackPointer].pc = dwAddr; + gDlistStack[gDlistStackPointer].countdown = MAX_DL_COUNT; + + break; + case RSP_DLIST_NOPUSH: + LOG_UCODE(" Jumping to ZeldaDisplayList 0x%08x", dwAddr); + if( gDlistStack[gDlistStackPointer].pc == dwAddr+8 ) //Is this a loop + { + //Hack for Gauntlet Legends + gDlistStack[gDlistStackPointer].pc = dwAddr+8; + } + else + gDlistStack[gDlistStackPointer].pc = dwAddr; + gDlistStack[gDlistStackPointer].countdown = MAX_DL_COUNT; + break; + } + + LOG_UCODE(""); + LOG_UCODE("\\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/"); + LOG_UCODE("#############################################"); +} + + +void RSP_GBI2_SetOtherModeL(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_SetOtherModeL); + + uint32 dwShift = ((gfx->words.w0)>>8)&0xFF; + uint32 dwLength= ((gfx->words.w0) )&0xFF; + uint32 dwData = (gfx->words.w1); + + // Mask is constructed slightly differently + uint32 dwMask = (uint32)((s32)(0x80000000)>>dwLength)>>dwShift; + dwData &= dwMask; + + uint32 modeL = gRDP.otherModeL; + modeL = (modeL&(~dwMask)) | dwData; + + Gfx tempgfx; + tempgfx.words.w0 = gRDP.otherModeH; + tempgfx.words.w1 = modeL; + DLParser_RDPSetOtherMode(&tempgfx ); +} + + +void RSP_GBI2_SetOtherModeH(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_SetOtherModeH); + + uint32 dwLength= (((gfx->words.w0))&0xFF)+1; + uint32 dwShift = 32 - (((gfx->words.w0)>>8)&0xFF) - dwLength; + uint32 dwData = (gfx->words.w1); + + uint32 dwMask2 = ((1<words.w0), (gfx->words.w1)); +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/RSP_GBI2_ext.h b/libmupen64plus/mupen64plus-video-rice/src/RSP_GBI2_ext.h new file mode 100644 index 0000000000..76f7da003c --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/RSP_GBI2_ext.h @@ -0,0 +1,49 @@ +/* +Copyright (C) 2002 Rice1964 + +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. + +*/ + +// Some new GBI2 extension ucodes +void RSP_GBI2_DL_Count(Gfx *gfx) +{ + SP_Timing(DP_Minimal); + DP_Timing(DP_Minimal); + + // This cmd is likely to execute number of ucode at the given address + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + { + gDlistStackPointer++; + gDlistStack[gDlistStackPointer].pc = dwAddr; + gDlistStack[gDlistStackPointer].countdown = ((gfx->words.w0)&0xFFFF); + } +} + + +void RSP_GBI2_0x8(Gfx *gfx) +{ + if( ((gfx->words.w0)&0x00FFFFFF) == 0x2F && ((gfx->words.w1)&0xFF000000) == 0x80000000 ) + { + // V-Rally 64 + RSP_S2DEX_SPObjLoadTxRectR(gfx); + } + else + { + RSP_RDP_Nothing(gfx); + } +} + + diff --git a/libmupen64plus/mupen64plus-video-rice/src/RSP_GBI_Others.h b/libmupen64plus/mupen64plus-video-rice/src/RSP_GBI_Others.h new file mode 100644 index 0000000000..c8649d6ae4 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/RSP_GBI_Others.h @@ -0,0 +1,1731 @@ +/* +Copyright (C) 2002 Rice1964 + +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. + +*/ + +// A few ucode used in DKR and Others Special games + +#include + +#include "Render.h" +#include "Timing.h" +#include "osal_preproc.h" + +uint32 dwConkerVtxZAddr=0; + +static void RDP_GFX_DumpVtxInfoDKR(uint32 dwAddr, uint32 dwV0, uint32 dwN); + +void RDP_GFX_DLInMem(Gfx *gfx) +{ + uint32 dwLimit = ((gfx->words.w0) >> 16) & 0xFF; + uint32 dwPush = RSP_DLIST_PUSH; //((gfx->words.w0) >> 16) & 0xFF; + uint32 dwAddr = 0x00000000 | (gfx->words.w1); //RSPSegmentAddr((gfx->words.w1)); + + LOG_UCODE(" Address=0x%08x Push: 0x%02x", dwAddr, dwPush); + + switch (dwPush) + { + case RSP_DLIST_PUSH: + LOG_UCODE(" Pushing DisplayList 0x%08x", dwAddr); + gDlistStackPointer++; + gDlistStack[gDlistStackPointer].pc = dwAddr; + gDlistStack[gDlistStackPointer].countdown = dwLimit; + + break; + case RSP_DLIST_NOPUSH: + LOG_UCODE(" Jumping to DisplayList 0x%08x", dwAddr); + gDlistStack[gDlistStackPointer].pc = dwAddr; + gDlistStack[gDlistStackPointer].countdown = dwLimit; + break; + } + + LOG_UCODE(""); + LOG_UCODE("\\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/"); + LOG_UCODE("#############################################"); +} + +extern Matrix ALIGN(16, dkrMatrixTransposed) +void RSP_Mtx_DKR(Gfx *gfx) +{ + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + uint32 dwCommand = ((gfx->words.w0)>>16)&0xFF; + //uint32 dwLength = ((gfx->words.w0)) &0xFFFF; + + dwAddr = (gfx->words.w1)+RSPSegmentAddr(gRSP.dwDKRMatrixAddr); + + //gRSP.DKRCMatrixIndex = ((gfx->words.w0)>>22)&3; + bool mul=false; + int index = 0; + switch( dwCommand ) + { + case 0xC0: // DKR + gRSP.DKRCMatrixIndex = index = 3; + break; + case 0x80: // DKR + gRSP.DKRCMatrixIndex = index = 2; + break; + case 0x40: // DKR + gRSP.DKRCMatrixIndex = index = 1; + break; + case 0x20: // DKR + gRSP.DKRCMatrixIndex = index = 0; + break; + case 0x00: + gRSP.DKRCMatrixIndex = index = 0; + break; + case 0x01: + //mul = true; + gRSP.DKRCMatrixIndex = index = 1; + break; + case 0x02: + //mul = true; + gRSP.DKRCMatrixIndex = index = 2; + break; + case 0x03: + //mul = true; + gRSP.DKRCMatrixIndex = index = 3; + break; + case 0x81: + index = 1; + mul = true; + break; + case 0x82: + index = 2; + mul = true; + break; + case 0x83: + index = 3; + mul = true; + break; + default: + DebuggerAppendMsg("Fix me, mtx DKR, cmd=%08X", dwCommand); + break; + } + + // Load matrix from dwAddr + Matrix &mat = gRSP.DKRMatrixes[index]; + LoadMatrix(dwAddr); + + if( mul ) + { + mat = matToLoad*gRSP.DKRMatrixes[0]; + } + else + { + mat = matToLoad; + } + + if( status.isSSEEnabled ) + MatrixTranspose(&dkrMatrixTransposed, &mat); + + DEBUGGER_IF_DUMP(logMatrix,TRACE3("DKR Matrix: cmd=0x%X, idx = %d, mul=%d", dwCommand, index, mul)); + LOG_UCODE(" DKR Loading Mtx: %d, command=%d", index, dwCommand); + DEBUGGER_PAUSE_AND_DUMP(NEXT_MATRIX_CMD,{TRACE0("Paused at DKR Matrix Cmd");}); +} + +void RSP_Vtx_DKR(Gfx *gfx) +{ + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + uint32 dwV0 = (((gfx->words.w0) >> 9 )&0x1F); + uint32 dwN = (((gfx->words.w0) >>19 )&0x1F)+1; + + if( gfx->words.w0 & 0x00010000 ) + { + if( gRSP.DKRBillBoard ) + gRSP.DKRVtxCount = 1; + } + else + { + gRSP.DKRVtxCount = 0; + } + + dwV0 += gRSP.DKRVtxCount; + + LOG_UCODE(" Address 0x%08x, v0: %d, Num: %d", dwAddr, dwV0, dwN); + DEBUGGER_ONLY_IF( (pauseAtNext && (eventToPause==NEXT_VERTEX_CMD||eventToPause==NEXT_MATRIX_CMD)), {DebuggerAppendMsg("DKR Vtx: Cmd0=%08X, Cmd1=%08X", (gfx->words.w0), (gfx->words.w1));}); + + VTX_DUMP(TRACE2("Vtx_DKR, cmd0=%08X cmd1=%08X", (gfx->words.w0), (gfx->words.w1))); + VTX_DUMP(TRACE2("Vtx_DKR, v0=%d n=%d", dwV0, dwN)); + + if (dwV0 >= 32) + dwV0 = 31; + + if ((dwV0 + dwN) > 32) + { + WARNING(TRACE0("Warning, attempting to load into invalid vertex positions")); + dwN = 32 - dwV0; + } + + + //if( dwAddr == 0 || dwAddr < 0x2000) + { + dwAddr = (gfx->words.w1)+RSPSegmentAddr(gRSP.dwDKRVtxAddr); + } + + // Check that address is valid... + if ((dwAddr + (dwN*16)) > g_dwRamSize) + { + WARNING(TRACE1("ProcessVertexData: Address out of range (0x%08x)", dwAddr)); + } + else + { + ProcessVertexDataDKR(dwAddr, dwV0, dwN); + + status.dwNumVertices += dwN; + + RDP_GFX_DumpVtxInfoDKR(dwAddr, dwV0, dwN); + } +} + + +void RSP_Vtx_Gemini(Gfx *gfx) +{ + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + uint32 dwV0 = (((gfx->words.w0)>>9)&0x1F); + uint32 dwN = (((gfx->words.w0) >>19 )&0x1F); + + LOG_UCODE(" Address 0x%08x, v0: %d, Num: %d", dwAddr, dwV0, dwN); + DEBUGGER_ONLY_IF( (pauseAtNext && (eventToPause==NEXT_VERTEX_CMD||eventToPause==NEXT_MATRIX_CMD)), {DebuggerAppendMsg("DKR Vtx: Cmd0=%08X, Cmd1=%08X", (gfx->words.w0), (gfx->words.w1));}); + + VTX_DUMP(TRACE2("Vtx_DKR, cmd0=%08X cmd1=%08X", (gfx->words.w0), (gfx->words.w1))); + + if (dwV0 >= 32) + dwV0 = 31; + + if ((dwV0 + dwN) > 32) + { + TRACE0("Warning, attempting to load into invalid vertex positions"); + dwN = 32 - dwV0; + } + + + //if( dwAddr == 0 || dwAddr < 0x2000) + { + dwAddr = (gfx->words.w1)+RSPSegmentAddr(gRSP.dwDKRVtxAddr); + } + + // Check that address is valid... + if ((dwAddr + (dwN*16)) > g_dwRamSize) + { + TRACE1("ProcessVertexData: Address out of range (0x%08x)", dwAddr); + } + else + { + ProcessVertexDataDKR(dwAddr, dwV0, dwN); + + status.dwNumVertices += dwN; + + RDP_GFX_DumpVtxInfoDKR(dwAddr, dwV0, dwN); + } +} + +// DKR verts are extra 4 bytes +void RDP_GFX_DumpVtxInfoDKR(uint32 dwAddr, uint32 dwV0, uint32 dwN) +{ +#ifdef DEBUGGER + uint32 dwV; + int i; + + short * psSrc = (short *)(g_pRDRAMu8 + dwAddr); + + i = 0; + for (dwV = dwV0; dwV < dwV0 + dwN; dwV++) + { + float x = (float)psSrc[(i + 0) ^ 1]; + float y = (float)psSrc[(i + 1) ^ 1]; + float z = (float)psSrc[(i + 2) ^ 1]; + + //uint16 wFlags = CRender::g_pRender->m_dwVecFlags[dwV]; //(uint16)psSrc[3^0x1]; + + uint16 wA = psSrc[(i + 3) ^ 1]; + uint16 wB = psSrc[(i + 4) ^ 1]; + + uint8 a = wA>>8; + uint8 b = (uint8)wA; + uint8 c = wB>>8; + uint8 d = (uint8)wB; + + XVECTOR4 & t = g_vecProjected[dwV]; + + + LOG_UCODE(" #%02d Pos: {% 6f,% 6f,% 6f} Extra: %02x %02x %02x %02x (transf: {% 6f,% 6f,% 6f})", + dwV, x, y, z, a, b, c, d, t.x, t.y, t.z ); + + i+=5; + } + + + uint16 * pwSrc = (uint16 *)(g_pRDRAMu8 + dwAddr); + i = 0; + for (dwV = dwV0; dwV < dwV0 + dwN; dwV++) + { + LOG_UCODE(" #%02d %04x %04x %04x %04x %04x", + dwV, pwSrc[(i + 0) ^ 1], + pwSrc[(i + 1) ^ 1], + pwSrc[(i + 2) ^ 1], + pwSrc[(i + 3) ^ 1], + pwSrc[(i + 4) ^ 1]); + + i += 5; + } + +#endif // DEBUGGER +} + +void DLParser_Set_Addr_Ucode6(Gfx *gfx) +{ + gRSP.dwDKRMatrixAddr = (gfx->words.w0)&0x00FFFFFF; + gRSP.dwDKRVtxAddr = (gfx->words.w1)&0x00FFFFFF; + gRSP.DKRVtxCount=0; +} + + + +void RSP_Vtx_WRUS(Gfx *gfx) +{ + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + uint32 dwLength = ((gfx->words.w0))&0xFFFF; + + uint32 dwN= (dwLength + 1) / 0x210; + //uint32 dwN= (dwLength >> 9); + //uint32 dwV0 = (((gfx->words.w0)>>16)&0x3f)/5; + uint32 dwV0 = (((gfx->words.w0)>>16)&0xFF)/5; + + LOG_UCODE(" Address 0x%08x, v0: %d, Num: %d, Length: 0x%04x", dwAddr, dwV0, dwN, dwLength); + + if (dwV0 >= 32) + dwV0 = 31; + + if ((dwV0 + dwN) > 32) + { + TRACE0("Warning, attempting to load into invalid vertex positions"); + dwN = 32 - dwV0; + } + + ProcessVertexData(dwAddr, dwV0, dwN); + + status.dwNumVertices += dwN; + + DisplayVertexInfo(dwAddr, dwV0, dwN); +} + +void RSP_Vtx_ShadowOfEmpire(Gfx *gfx) +{ + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + uint32 dwLength = ((gfx->words.w0))&0xFFFF; + + uint32 dwN= (((gfx->words.w0) >> 4) & 0xFFF) / 33 + 1; + uint32 dwV0 = 0; + + LOG_UCODE(" Address 0x%08x, v0: %d, Num: %d, Length: 0x%04x", dwAddr, dwV0, dwN, dwLength); + + if (dwV0 >= 32) + dwV0 = 31; + + if ((dwV0 + dwN) > 32) + { + TRACE0("Warning, attempting to load into invalid vertex positions"); + dwN = 32 - dwV0; + } + + ProcessVertexData(dwAddr, dwV0, dwN); + + status.dwNumVertices += dwN; + + DisplayVertexInfo(dwAddr, dwV0, dwN); +} + + +void RSP_DL_In_MEM_DKR(Gfx *gfx) +{ + // This cmd is likely to execute number of ucode at the given address + uint32 dwAddr = (gfx->words.w1);//RSPSegmentAddr((gfx->words.w1)); + { + gDlistStackPointer++; + gDlistStack[gDlistStackPointer].pc = dwAddr; + gDlistStack[gDlistStackPointer].countdown = (((gfx->words.w0)>>16)&0xFF); + } +} +uint16 ConvertYUVtoR5G5B5X1(int y, int u, int v) +{ + float r = y + (1.370705f * (v-128)); + float g = y - (0.698001f * (v-128)) - (0.337633f * (u-128)); + float b = y + (1.732446f * (u-128)); + r *= 0.125f; + g *= 0.125f; + b *= 0.125f; + + //clipping the result + if (r > 32) r = 32; + if (g > 32) g = 32; + if (b > 32) b = 32; + if (r < 0) r = 0; + if (g < 0) g = 0; + if (b < 0) b = 0; + + uint16 c = (uint16)(((uint16)(r) << 11) | + ((uint16)(g) << 6) | + ((uint16)(b) << 1) | 1); + return c; +} + +void TexRectToN64FrameBuffer_YUV_16b(uint32 x0, uint32 y0, uint32 width, uint32 height) +{ + // Convert YUV image at TImg and Copy the texture into the N64 RDRAM framebuffer memory + + uint32 n64CIaddr = g_CI.dwAddr; + uint32 n64CIwidth = g_CI.dwWidth; + + for (uint32 y = 0; y < height; y++) + { + uint32* pN64Src = (uint32*)(g_pRDRAMu8+(g_TI.dwAddr&(g_dwRamSize-1)))+y*(g_TI.dwWidth>>1); + uint16* pN64Dst = (uint16*)(g_pRDRAMu8+(n64CIaddr&(g_dwRamSize-1)))+(y+y0)*n64CIwidth; + + for (uint32 x = 0; x < width; x+=2) + { + uint32 val = *pN64Src++; + int y0 = (uint8)val&0xFF; + int v = (uint8)(val>>8)&0xFF; + int y1 = (uint8)(val>>16)&0xFF; + int u = (uint8)(val>>24)&0xFF; + + pN64Dst[x+x0] = ConvertYUVtoR5G5B5X1(y0,u,v); + pN64Dst[x+x0+1] = ConvertYUVtoR5G5B5X1(y1,u,v); + } + } +} + +extern uObjMtxReal gObjMtxReal; +void DLParser_OgreBatter64BG(Gfx *gfx) +{ +#ifdef DEBUGGER +uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); +uObjTxSprite *ptr = (uObjTxSprite*)(g_pRDRAMu8+dwAddr); +#endif + +PrepareTextures(); + +CTexture *ptexture = g_textures[0].m_pCTexture; +TexRectToN64FrameBuffer_16b( (uint32)gObjMtxReal.X, (uint32)gObjMtxReal.Y, ptexture->m_dwWidth, ptexture->m_dwHeight, gRSP.curTile); + +#ifdef DEBUGGER +CRender::g_pRender->DrawSpriteR(*ptr, false); + +DEBUGGER_PAUSE_AT_COND_AND_DUMP_COUNT_N((pauseAtNext && +(eventToPause==NEXT_OBJ_TXT_CMD|| eventToPause==NEXT_FLUSH_TRI)), +{DebuggerAppendMsg("OgreBatter 64 BG: Addr=%08X\n", dwAddr);}); +#endif +} + +void DLParser_Bomberman2TextRect(Gfx *gfx) +{ + // Bomberman 64 - The Second Attack! (U) [!] + // The 0x02 cmd, list a TexRect cmd + + if( options.enableHackForGames == HACK_FOR_OGRE_BATTLE && gRDP.tiles[7].dwFormat == TXT_FMT_YUV ) + { + TexRectToN64FrameBuffer_YUV_16b( (uint32)gObjMtxReal.X, (uint32)gObjMtxReal.Y, 16, 16); + //DLParser_OgreBatter64BG((gfx->words.w0), (gfx->words.w1)); + return; + } + + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + uObjSprite *info = (uObjSprite*)(g_pRDRAMu8+dwAddr); + + uint32 dwTile = gRSP.curTile; + + PrepareTextures(); + + //CRender::g_pRender->SetCombinerAndBlender(); + + uObjTxSprite drawinfo; + memcpy( &(drawinfo.sprite), info, sizeof(uObjSprite)); + CRender::g_pRender->DrawSpriteR(drawinfo, false, dwTile, 0, 0, drawinfo.sprite.imageW/32, drawinfo.sprite.imageH/32); + + DEBUGGER_PAUSE_AT_COND_AND_DUMP_COUNT_N((pauseAtNext && (eventToPause==NEXT_TRIANGLE|| eventToPause==NEXT_FLUSH_TRI)), + { + DebuggerAppendMsg("Bomberman 64 - TextRect: Addr=%08X\n", dwAddr); + dwAddr &= (g_dwRamSize-1); + DebuggerAppendMsg("%08X-%08X-%08X-%08X-%08X-%08X\n", RDRAM_UWORD(dwAddr), RDRAM_UWORD(dwAddr+4), + RDRAM_UWORD(dwAddr+8), RDRAM_UWORD(dwAddr+12), RDRAM_UWORD(dwAddr+16), RDRAM_UWORD(dwAddr+20) ); + } + ); +} + + +void RSP_MoveWord_DKR(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_MoveWord); + uint32 dwNumLights; + + switch ((gfx->words.w0) & 0xFF) + { + case RSP_MOVE_WORD_NUMLIGHT: + dwNumLights = (gfx->words.w1)&0x7; + LOG_UCODE(" RSP_MOVE_WORD_NUMLIGHT: Val:%d", dwNumLights); + + gRSP.ambientLightIndex = dwNumLights; + SetNumLights(dwNumLights); + //gRSP.DKRBillBoard = (gfx->words.w1)&0x1 ? true : false; + gRSP.DKRBillBoard = (gfx->words.w1)&0x7 ? true : false; + + LOG_UCODE(" gRSP.DKRBillBoard = %d", gRSP.DKRBillBoard); + DEBUGGER_PAUSE_AND_DUMP_COUNT_N(NEXT_MATRIX_CMD, {DebuggerAppendMsg("DKR Moveword, select gRSP.DKRBillBoard %s, cmd0=%08X, cmd1=%08X", gRSP.DKRBillBoard?"true":"false", (gfx->words.w0), (gfx->words.w1));}); + break; + case RSP_MOVE_WORD_LIGHTCOL: + gRSP.DKRCMatrixIndex = ((gfx->words.w1)>>6)&7; + //gRSP.DKRCMatrixIndex = ((gfx->words.w1)>>6)&3; + LOG_UCODE(" gRSP.DKRCMatrixIndex = %d", gRSP.DKRCMatrixIndex); + DEBUGGER_PAUSE_AND_DUMP_COUNT_N(NEXT_MATRIX_CMD, {DebuggerAppendMsg("DKR Moveword, select matrix %d, cmd0=%08X, cmd1=%08X", gRSP.DKRCMatrixIndex, (gfx->words.w0), (gfx->words.w1));}); + break; + default: + RSP_GBI1_MoveWord(gfx); + break; + } +} + + +void RSP_DMA_Tri_DKR(Gfx *gfx) +{ + BOOL bTrisAdded = FALSE; + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + uint32 flag = ((gfx->words.w0) & 0xFF0000) >> 16; + if (flag&1) + CRender::g_pRender->SetCullMode(false,true); + else + CRender::g_pRender->SetCullMode(false,false); + + uint32 dwNum = (((gfx->words.w0) & 0xFFF0) >>4 ); + uint32 * pData = (uint32*)&g_pRDRAMu32[dwAddr/4]; + + if( dwAddr+16*dwNum >= g_dwRamSize ) + { + TRACE0("DMATRI invalid memory pointer"); + return; + } + + TRI_DUMP(TRACE2("DMATRI, addr=%08X, Cmd0=%08X\n", dwAddr, (gfx->words.w0))); + + status.primitiveType = PRIM_DMA_TRI; + + for (uint32 i = 0; i < dwNum; i++) + { + LOG_UCODE(" 0x%08x: %08x %08x %08x %08x", dwAddr + i*16, + pData[0], pData[1], pData[2], pData[3]); + + uint32 dwInfo = pData[0]; + + uint32 dwV0 = (dwInfo >> 16) & 0x1F; + uint32 dwV1 = (dwInfo >> 8) & 0x1F; + uint32 dwV2 = (dwInfo ) & 0x1F; + + TRI_DUMP(TRACE5("DMATRI: %d, %d, %d (%08X-%08X)", dwV0,dwV1,dwV2,(gfx->words.w0),(gfx->words.w1))); + + //if (IsTriangleVisible(dwV0, dwV1, dwV2)) + { + DEBUG_DUMP_VERTEXES("DmaTri", dwV0, dwV1, dwV2); + LOG_UCODE(" Tri: %d,%d,%d", dwV0, dwV1, dwV2); + if (!bTrisAdded )//&& CRender::g_pRender->IsTextureEnabled()) + { + PrepareTextures(); + InitVertexTextureConstants(); + } + + // Generate texture coordinates + short s0 = ((short)(pData[1]>>16)); + short t0 = ((short)(pData[1]&0xFFFF)); + short s1 = ((short)(pData[2]>>16)); + short t1 = ((short)(pData[2]&0xFFFF)); + short s2 = ((short)(pData[3]>>16)); + short t2 = ((short)(pData[3]&0xFFFF)); + + TRI_DUMP( + { + DebuggerAppendMsg(" (%d,%d), (%d,%d), (%d,%d)",s0,t0,s1,t1,s2,t2); + DebuggerAppendMsg(" (%08X), (%08X), (%08X), (%08X)",pData[0],pData[1],pData[2],pData[3]); + }); + CRender::g_pRender->SetVtxTextureCoord(dwV0, s0, t0); + CRender::g_pRender->SetVtxTextureCoord(dwV1, s1, t1); + CRender::g_pRender->SetVtxTextureCoord(dwV2, s2, t2); + + if( !bTrisAdded ) + { + CRender::g_pRender->SetCombinerAndBlender(); + } + + bTrisAdded = true; + PrepareTriangle(dwV0, dwV1, dwV2); + } + + pData += 4; + + } + + if (bTrisAdded) + { + CRender::g_pRender->DrawTriangles(); + } + gRSP.DKRVtxCount=0; +} + +uint32 dwPDCIAddr = 0; +void ProcessVertexDataPD(uint32 dwAddr, uint32 dwV0, uint32 dwNum); +void RSP_Vtx_PD(Gfx *gfx) +{ + SP_Timing(RSP_GBI0_Vtx); + + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + uint32 dwV0 = ((gfx->words.w0)>>16)&0x0F; + uint32 dwN = (((gfx->words.w0)>>20)&0x0F)+1; + //uint32 dwLength = ((gfx->words.w0))&0xFFFF; + + LOG_UCODE(" Address 0x%08x, v0: %d, Num: %d", dwAddr, dwV0, dwN); + + ProcessVertexDataPD(dwAddr, dwV0, dwN); + status.dwNumVertices += dwN; +} + +void RSP_Set_Vtx_CI_PD(Gfx *gfx) +{ + // Color index buf address + dwPDCIAddr = RSPSegmentAddr((gfx->words.w1)); +} + +void RSP_Tri4_PD(Gfx *gfx) +{ + uint32 w0 = gfx->words.w0; + uint32 w1 = gfx->words.w1; + + status.primitiveType = PRIM_TRI2; + + // While the next command pair is Tri2, add vertices + uint32 dwPC = gDlistStack[gDlistStackPointer].pc; + + BOOL bTrisAdded = FALSE; + + do { + uint32 dwFlag = (w0>>16)&0xFF; + LOG_UCODE(" PD Tri4: 0x%08x 0x%08x Flag: 0x%02x", w0, w1, dwFlag); + + BOOL bVisible; + for( uint32 i=0; i<4; i++) + { + uint32 v0 = (w1>>(4+(i<<3))) & 0xF; + uint32 v1 = (w1>>( (i<<3))) & 0xF; + uint32 v2 = (w0>>( (i<<2))) & 0xF; + bVisible = IsTriangleVisible(v0, v2, v1); + LOG_UCODE(" (%d, %d, %d) %s", v0, v1, v2, bVisible ? "": "(clipped)"); + if (bVisible) + { + DEBUG_DUMP_VERTEXES("Tri4_PerfectDark 1/2", v0, v1, v2); + if (!bTrisAdded && CRender::g_pRender->IsTextureEnabled()) + { + PrepareTextures(); + InitVertexTextureConstants(); + } + + if( !bTrisAdded ) + { + CRender::g_pRender->SetCombinerAndBlender(); + } + + bTrisAdded = true; + PrepareTriangle(v0, v2, v1); + } + } + + w0 = *(uint32 *)(g_pRDRAMu8 + dwPC+0); + w1 = *(uint32 *)(g_pRDRAMu8 + dwPC+4); + dwPC += 8; + +#ifdef DEBUGGER + } while (!(pauseAtNext && eventToPause==NEXT_TRIANGLE) && (w0>>24) == (uint8)RSP_TRI2); +#else + } while ((w0>>24) == (uint8)RSP_TRI2); +#endif + + gDlistStack[gDlistStackPointer].pc = dwPC-8; + + if (bTrisAdded) + { + CRender::g_pRender->DrawTriangles(); + } + + DEBUG_TRIANGLE(TRACE0("Pause at PD Tri4")); +} + + +void DLParser_Tri4_Conker(Gfx *gfx) +{ + uint32 w0 = gfx->words.w0; + uint32 w1 = gfx->words.w1; + + status.primitiveType = PRIM_TRI2; + + // While the next command pair is Tri2, add vertices + uint32 dwPC = gDlistStack[gDlistStackPointer].pc; + + BOOL bTrisAdded = FALSE; + + do { + LOG_UCODE(" Conker Tri4: 0x%08x 0x%08x", w0, w1); + uint32 idx[12]; + idx[0] = (w1 )&0x1F; + idx[1] = (w1>> 5)&0x1F; + idx[2] = (w1>>10)&0x1F; + idx[3] = (w1>>15)&0x1F; + idx[4] = (w1>>20)&0x1F; + idx[5] = (w1>>25)&0x1F; + + idx[6] = (w0 )&0x1F; + idx[7] = (w0>> 5)&0x1F; + idx[8] = (w0>>10)&0x1F; + + idx[ 9] = (((w0>>15)&0x7)<<2)|(w1>>30); + idx[10] = (w0>>18)&0x1F; + idx[11] = (w0>>23)&0x1F; + + BOOL bVisible; + for( uint32 i=0; i<4; i++) + { + uint32 v0=idx[i*3 ]; + uint32 v1=idx[i*3+1]; + uint32 v2=idx[i*3+2]; + bVisible = IsTriangleVisible(v0, v1, v2); + LOG_UCODE(" (%d, %d, %d) %s", v0, v1, v2, bVisible ? "": "(clipped)"); + if (bVisible) + { + DEBUG_DUMP_VERTEXES("Tri4 Conker:", v0, v1, v2); + if (!bTrisAdded && CRender::g_pRender->IsTextureEnabled()) + { + PrepareTextures(); + InitVertexTextureConstants(); + } + + if( !bTrisAdded ) + { + CRender::g_pRender->SetCombinerAndBlender(); + } + + bTrisAdded = true; + PrepareTriangle(v0, v1, v2); + } + } + + w0 = *(uint32 *)(g_pRDRAMu8 + dwPC+0); + w1 = *(uint32 *)(g_pRDRAMu8 + dwPC+4); + dwPC += 8; + +#ifdef DEBUGGER + } while (!(pauseAtNext && eventToPause==NEXT_TRIANGLE) && (w0>>28) == 1 ); +#else + } while ((w0>>28) == 1); +#endif + + gDlistStack[gDlistStackPointer].pc = dwPC-8; + + if (bTrisAdded) + { + CRender::g_pRender->DrawTriangles(); + } + + DEBUG_TRIANGLE(TRACE0("Pause at Conker Tri4")); +} + +void RDP_GFX_Force_Vertex_Z_Conker(uint32 dwAddr) +{ + VTX_DUMP( + { + s8 * pcBase = g_pRDRAMs8 + (dwAddr&(g_dwRamSize-1)); + uint32 * pdwBase = (uint32 *)pcBase; + + for (int i = 0; i < 4; i++) + { + DebuggerAppendMsg(" %08x %08x %08x %08x", pdwBase[0], pdwBase[1], pdwBase[2], pdwBase[3]); + pdwBase+=4; + } + }); + + dwConkerVtxZAddr = dwAddr; + DEBUGGER_PAUSE_AND_DUMP(NEXT_VERTEX_CMD,{TRACE0("Paused at RDP_GFX_Force_Matrix_Conker Cmd");}); +} + + + +void DLParser_MoveMem_Conker(Gfx *gfx) +{ + uint32 dwType = ((gfx->words.w0) ) & 0xFE; + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + if( dwType == RSP_GBI2_MV_MEM__MATRIX ) + { + LOG_UCODE(" DLParser_MoveMem_Conker"); + RDP_GFX_Force_Vertex_Z_Conker(dwAddr); + } + else if( dwType == RSP_GBI2_MV_MEM__LIGHT ) + { + LOG_UCODE(" MoveMem Light Conker"); + uint32 dwOffset2 = ((gfx->words.w0) >> 5) & 0x3FFF; + uint32 dwLight=0xFF; + if( dwOffset2 >= 0x30 ) + { + dwLight = (dwOffset2 - 0x30)/0x30; + LOG_UCODE(" Light %d:", dwLight); + RSP_MoveMemLight(dwLight, dwAddr); + } + else + { + // fix me + //TRACE0("Check me in DLParser_MoveMem_Conker - MoveMem Light"); + } + DEBUGGER_PAUSE_AND_DUMP_COUNT_N( NEXT_SET_LIGHT, + { + DebuggerAppendMsg("RSP_MoveMemLight: %d, Addr=%08X, cmd0=%08X", dwLight, dwAddr, (gfx->words.w0)); + TRACE0("Pause after MoveMemLight"); + }); + } + else + { + RSP_GBI2_MoveMem(gfx); + } +} + +extern void ProcessVertexDataConker(uint32 dwAddr, uint32 dwV0, uint32 dwNum); +void RSP_Vtx_Conker(Gfx *gfx) +{ + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + uint32 dwVEnd = (((gfx->words.w0) )&0xFFF)/2; + uint32 dwN = (((gfx->words.w0)>>12)&0xFFF); + uint32 dwV0 = dwVEnd - dwN; + + LOG_UCODE(" Vtx: Address 0x%08x, vEnd: %d, v0: %d, Num: %d", dwAddr, dwVEnd, dwV0, dwN); + + ProcessVertexDataConker(dwAddr, dwV0, dwN); + status.dwNumVertices += dwN; + DisplayVertexInfo(dwAddr, dwV0, dwN); +} + + +void DLParser_MoveWord_Conker(Gfx *gfx) +{ + uint32 dwType = ((gfx->words.w0) >> 16) & 0xFF; + if( dwType != RSP_MOVE_WORD_NUMLIGHT ) + { + RSP_GBI2_MoveWord(gfx); + } + else + { + uint32 dwNumLights = ((gfx->words.w1)/48); + LOG_UCODE("Conker RSP_MOVE_WORD_NUMLIGHT: %d", dwNumLights); + gRSP.ambientLightIndex = dwNumLights+1; + SetNumLights(dwNumLights); + DEBUGGER_PAUSE_AND_DUMP_COUNT_N( NEXT_SET_LIGHT, + { + DebuggerAppendMsg("SetNumLights: %d", dwNumLights); + TRACE0("Pause after SetNumLights"); + }); + } +} + +void DLParser_Ucode8_0x0(Gfx *gfx) +{ + LOG_UCODE("DLParser_Ucode8_0x0"); + + if( (gfx->words.w0) == 0 && (gfx->words.w1) ) + { + uint32 newaddr = RSPSegmentAddr((gfx->words.w1)); + + if( newaddr && newaddr < g_dwRamSize) + { + if( gDlistStackPointer < MAX_DL_STACK_SIZE-1 ) + { + gDlistStackPointer++; + gDlistStack[gDlistStackPointer].pc = newaddr+8; // Always skip the first 2 entries + gDlistStack[gDlistStackPointer].countdown = MAX_DL_COUNT; + } + else + { + DebuggerAppendMsg("Error, gDlistStackPointer overflow"); + } + } + } + else + { + LOG_UCODE("DLParser_Ucode8_0x0, skip 0x%08X, 0x%08x", (gfx->words.w0), (gfx->words.w1)); + gDlistStack[gDlistStackPointer].pc += 8; + } +} + + +uint32 Rogue_Squadron_Vtx_XYZ_Cmd; +uint32 Rogue_Squadron_Vtx_XYZ_Addr; +uint32 Rogue_Squadron_Vtx_Color_Cmd; +uint32 Rogue_Squadron_Vtx_Color_Addr; +uint32 GSBlkAddrSaves[100][2]; + +void ProcessVertexData_Rogue_Squadron(uint32 dwXYZAddr, uint32 dwColorAddr, uint32 dwXYZCmd, uint32 dwColorCmd); + +void DLParser_RS_Color_Buffer(Gfx *gfx) +{ + uint32 dwPC = gDlistStack[gDlistStackPointer].pc-8; + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + + if( dwAddr > g_dwRamSize ) + { + TRACE0("DL, addr is wrong"); + dwAddr = (gfx->words.w1)&(g_dwRamSize-1); + } + + Rogue_Squadron_Vtx_Color_Cmd = (gfx->words.w0); + Rogue_Squadron_Vtx_Color_Addr = dwAddr; + + LOG_UCODE("Vtx_Color at PC=%08X: 0x%08x 0x%08x\n", dwPC-8, (gfx->words.w0), (gfx->words.w1)); +#ifdef DEBUGGER + if( pauseAtNext && (eventToPause == NEXT_VERTEX_CMD ) ) + { + DebuggerAppendMsg("Vtx_Color at PC=%08X: 0x%08x 0x%08x\n", dwPC-8, (gfx->words.w0), (gfx->words.w1)); + if( dwAddr < g_dwRamSize ) + { + DumpHex(dwAddr, min(64, g_dwRamSize-dwAddr)); + } + } +#endif + + ProcessVertexData_Rogue_Squadron(Rogue_Squadron_Vtx_XYZ_Addr, Rogue_Squadron_Vtx_Color_Addr, Rogue_Squadron_Vtx_XYZ_Cmd, Rogue_Squadron_Vtx_Color_Cmd); + +} + + +void DLParser_RS_Vtx_Buffer(Gfx *gfx) +{ + uint32 dwPC = gDlistStack[gDlistStackPointer].pc-8; + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + if( dwAddr > g_dwRamSize ) + { + TRACE0("DL, addr is wrong"); + dwAddr = (gfx->words.w1)&(g_dwRamSize-1); + } + + LOG_UCODE("Vtx_XYZ at PC=%08X: 0x%08x 0x%08x\n", dwPC-8, (gfx->words.w0), (gfx->words.w1)); + Rogue_Squadron_Vtx_XYZ_Cmd = (gfx->words.w0); + Rogue_Squadron_Vtx_XYZ_Addr = dwAddr; + +#ifdef DEBUGGER + if( pauseAtNext && (eventToPause == NEXT_VERTEX_CMD ) ) + { + DebuggerAppendMsg("Vtx_XYZ at PC=%08X: 0x%08x 0x%08x\n", dwPC-8, (gfx->words.w0), (gfx->words.w1)); + if( dwAddr < g_dwRamSize ) + { + DumpHex(dwAddr, min(64, g_dwRamSize-dwAddr)); + } + } +#endif +} + + +void DLParser_RS_Block(Gfx *gfx) +{ + uint32 dwPC = gDlistStack[gDlistStackPointer].pc-8; + LOG_UCODE("ucode 0x80 at PC=%08X: 0x%08x 0x%08x\n", dwPC, (gfx->words.w0), (gfx->words.w1)); +} + +void DLParser_RS_MoveMem(Gfx *gfx) +{ + //uint32 dwPC = gDlistStack[gDlistStackPointer].pc; + //uint32 cmd1 = ((dwPC)&0x00FFFFFF)|0x80000000; + RSP_GBI1_MoveMem(gfx); + /* + LOG_UCODE("RS_MoveMem", ((gfx->words.w0)>>24)); + LOG_UCODE("\tPC=%08X: 0x%08x 0x%08x", dwPC, (gfx->words.w0), (gfx->words.w1)); + dwPC+=8; + uint32 dwCmd2 = *(uint32 *)(g_pRDRAMu8 + dwPC); + uint32 dwCmd3 = *(uint32 *)(g_pRDRAMu8 + dwPC+4); + LOG_UCODE("\tPC=%08X: 0x%08x 0x%08x", dwPC, dwCmd2, dwCmd3); + dwPC+=8; + uint32 dwCmd4 = *(uint32 *)(g_pRDRAMu8 + dwPC); + uint32 dwCmd5 = *(uint32 *)(g_pRDRAMu8 + dwPC+4); + LOG_UCODE("\tPC=%08X: 0x%08x 0x%08x\n", dwPC, dwCmd4, dwCmd5); + */ + gDlistStack[gDlistStackPointer].pc += 16; + + //DEBUGGER_PAUSE_AND_DUMP(NEXT_SET_MODE_CMD, { + // DebuggerAppendMsg("Pause after RS_MoveMem at: %08X\n", dwPC-8); + //}); + +} + +void DLParser_RS_0xbe(Gfx *gfx) +{ + uint32 dwPC = gDlistStack[gDlistStackPointer].pc-8; + LOG_UCODE("ucode %02X, skip 1", ((gfx->words.w0)>>24)); + LOG_UCODE("\tPC=%08X: 0x%08x 0x%08x", dwPC, (gfx->words.w0), (gfx->words.w1)); + dwPC+=8; + uint32 dwCmd2 = *(uint32 *)(g_pRDRAMu8 + dwPC); + uint32 dwCmd3 = *(uint32 *)(g_pRDRAMu8 + dwPC+4); + LOG_UCODE("\tPC=%08X: 0x%08x 0x%08x\n", dwPC, dwCmd2, dwCmd3); + gDlistStack[gDlistStackPointer].pc += 8; + + DEBUGGER_PAUSE_AND_DUMP(NEXT_SET_MODE_CMD, { + DebuggerAppendMsg("Pause after RS_0xbe at: %08X\n", dwPC-8); + DebuggerAppendMsg("\t0x%08x 0x%08x", (gfx->words.w0), (gfx->words.w1)); + DebuggerAppendMsg("\t0x%08x 0x%08x", dwCmd2, dwCmd3); + }); +} + + +void DLParser_Ucode8_EndDL(Gfx *gfx) +{ +#ifdef DEBUGGER + uint32 dwPC = gDlistStack[gDlistStackPointer].pc-8; +#endif + + RDP_GFX_PopDL(); + DEBUGGER_PAUSE_AND_DUMP(NEXT_DLIST, DebuggerAppendMsg("PC=%08X: EndDL, return to %08X\n\n", dwPC, gDlistStack[gDlistStackPointer].pc)); +} + +void DLParser_Ucode8_DL(Gfx *gfx) // DL Function Call +{ +#ifdef DEBUGGER + uint32 dwPC = gDlistStack[gDlistStackPointer].pc-8; +#endif + + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + uint32 dwCmd2 = *(uint32 *)(g_pRDRAMu8 + dwAddr); + uint32 dwCmd3 = *(uint32 *)(g_pRDRAMu8 + dwAddr+4); + + if( dwAddr > g_dwRamSize ) + { + TRACE0("DL, addr is wrong"); + dwAddr = (gfx->words.w1)&(g_dwRamSize-1); + } + + // Detect looping + /*if(gDlistStackPointer>0 ) + { + for( int i=0; i>24) == 0x80 ) + { + GSBlkAddrSaves[gDlistStackPointer][0] = dwCmd2; + GSBlkAddrSaves[gDlistStackPointer][1] = dwCmd3; + } + + DEBUGGER_PAUSE_AND_DUMP(NEXT_DLIST, + DebuggerAppendMsg("\nPC=%08X: Call DL at Address %08X - %08X, %08X\n\n", + dwPC, dwAddr, dwCmd2, dwCmd3)); +} + +void DLParser_Ucode8_JUMP(Gfx *gfx) // DL Function Call +{ + if( ((gfx->words.w0)&0x00FFFFFF) == 0 ) + { +#ifdef DEBUGGER + uint32 dwPC = gDlistStack[gDlistStackPointer].pc-8; +#endif + + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + + if( dwAddr > g_dwRamSize ) + { + TRACE0("DL, addr is wrong"); + dwAddr = (gfx->words.w1)&(g_dwRamSize-1); + } + +#ifdef DEBUGGER + uint32 dwCmd2 = *(uint32 *)(g_pRDRAMu8 + dwAddr); + uint32 dwCmd3 = *(uint32 *)(g_pRDRAMu8 + dwAddr+4); +#endif + + gDlistStack[gDlistStackPointer].pc = dwAddr+8; // Jump to new address + DEBUGGER_PAUSE_AND_DUMP(NEXT_DLIST, + DebuggerAppendMsg("\nPC=%08X: Jump to Address %08X - %08X, %08X\n\n", dwPC, dwAddr, dwCmd2, dwCmd3)); + } + else + { + uint32 dwPC = gDlistStack[gDlistStackPointer].pc-8; + LOG_UCODE("ucode 0x07 at PC=%08X: 0x%08x 0x%08x\n", dwPC, (gfx->words.w0), (gfx->words.w1)); + } +} + +void DLParser_Ucode8_Unknown(Gfx *gfx) +{ + uint32 dwPC = gDlistStack[gDlistStackPointer].pc-8; + LOG_UCODE("ucode %02X at PC=%08X: 0x%08x 0x%08x\n", ((gfx->words.w0)>>24), dwPC, (gfx->words.w0), (gfx->words.w1)); +} + +void DLParser_Unknown_Skip1(Gfx *gfx) +{ + uint32 dwPC = gDlistStack[gDlistStackPointer].pc-8; + LOG_UCODE("ucode %02X, skip 1", ((gfx->words.w0)>>24)); + gfx++; + LOG_UCODE("\tPC=%08X: 0x%08x 0x%08x", dwPC, (gfx->words.w0), (gfx->words.w1)); + dwPC+=8; + gfx++; + LOG_UCODE("\tPC=%08X: 0x%08x 0x%08x\n", dwPC, (gfx->words.w0), (gfx->words.w1)); + gDlistStack[gDlistStackPointer].pc += 8; +} + +void DLParser_Unknown_Skip2(Gfx *gfx) +{ + uint32 dwPC = gDlistStack[gDlistStackPointer].pc-8; + LOG_UCODE("ucode %02X, skip 2", ((gfx->words.w0)>>24)); + gfx++; + LOG_UCODE("\tPC=%08X: 0x%08x 0x%08x", dwPC, (gfx->words.w0), (gfx->words.w1)); + dwPC+=8; + gfx++; + LOG_UCODE("\tPC=%08X: 0x%08x 0x%08x", dwPC, (gfx->words.w0), (gfx->words.w1)); + dwPC+=8; + gfx++; + LOG_UCODE("\tPC=%08X: 0x%08x 0x%08x\n", dwPC, (gfx->words.w0), (gfx->words.w1)); + gDlistStack[gDlistStackPointer].pc += 16; +} + +void DLParser_Unknown_Skip3(Gfx *gfx) +{ + uint32 dwPC = gDlistStack[gDlistStackPointer].pc-8; + LOG_UCODE("ucode %02X, skip 3", ((gfx->words.w0)>>24)); + gfx++; + LOG_UCODE("\tPC=%08X: 0x%08x 0x%08x", dwPC, (gfx->words.w0), (gfx->words.w1)); + dwPC+=8; + gfx++; + LOG_UCODE("\tPC=%08X: 0x%08x 0x%08x", dwPC, (gfx->words.w0), (gfx->words.w1)); + dwPC+=8; + gfx++; + LOG_UCODE("\tPC=%08X: 0x%08x 0x%08x", dwPC, (gfx->words.w0), (gfx->words.w1)); + dwPC+=8; + gfx++; + LOG_UCODE("\tPC=%08X: 0x%08x 0x%08x\n", dwPC, (gfx->words.w0), (gfx->words.w1)); + gDlistStack[gDlistStackPointer].pc += 24; +} + +void DLParser_Unknown_Skip4(Gfx *gfx) +{ + uint32 dwPC = gDlistStack[gDlistStackPointer].pc-8; + LOG_UCODE("ucode %02X, skip 4", ((gfx->words.w0)>>24)); + gfx++; + LOG_UCODE("\tPC=%08X: 0x%08x 0x%08x", dwPC, (gfx->words.w0), (gfx->words.w1)); + dwPC+=8; + gfx++; + LOG_UCODE("\tPC=%08X: 0x%08x 0x%08x", dwPC, (gfx->words.w0), (gfx->words.w1)); + dwPC+=8; + gfx++; + LOG_UCODE("\tPC=%08X: 0x%08x 0x%08x", dwPC, (gfx->words.w0), (gfx->words.w1)); + dwPC+=8; + gfx++; + LOG_UCODE("\tPC=%08X: 0x%08x 0x%08x", dwPC, (gfx->words.w0), (gfx->words.w1)); + dwPC+=8; + gfx++; + LOG_UCODE("\tPC=%08X: 0x%08x 0x%08x\n", dwPC, (gfx->words.w0), (gfx->words.w1)); + gDlistStack[gDlistStackPointer].pc += 32; +} + +void DLParser_Ucode8_0x05(Gfx *gfx) +{ + // Be careful, 0x05 is variable length ucode + /* + 0028E4E0: 05020088, 04D0000F - Reserved1 + 0028E4E8: 6BDC0306, 00000000 - G_NOTHING + 0028E4F0: 05010130, 01B0000F - Reserved1 + 0028E4F8: 918A01CA, 1EC5FF3B - G_NOTHING + 0028E500: 05088C68, F5021809 - Reserved1 + 0028E508: 04000405, 00000000 - RSP_VTX + 0028E510: 102ECE60, 202F2AA0 - G_NOTHING + 0028E518: 05088C90, F5021609 - Reserved1 + 0028E520: 04050405, F0F0F0F0 - RSP_VTX + 0028E528: 102ED0C0, 202F2D00 - G_NOTHING + 0028E530: B5000000, 00000000 - RSP_LINE3D + 0028E538: 8028E640, 8028E430 - G_NOTHING + 0028E540: 00000000, 00000000 - RSP_SPNOOP + */ + + if((gfx->words.w1) == 0) + return; + else + DLParser_Unknown_Skip4(gfx); +} + +void DLParser_Ucode8_0xb4(Gfx *gfx) +{ +#ifdef DEBUGGER + uint32 dwPC = gDlistStack[gDlistStackPointer].pc; +#endif + + if(((gfx->words.w0)&0xFF) == 0x06) + DLParser_Unknown_Skip3(gfx); + else if(((gfx->words.w0)&0xFF) == 0x04) + DLParser_Unknown_Skip1(gfx); + else if(((gfx->words.w0)&0xFFF) == 0x600) + DLParser_Unknown_Skip3(gfx); + else + { +#ifdef DEBUGGER + if(pauseAtNext) + { + DebuggerAppendMsg("ucode 0xb4 at PC=%08X: 0x%08x 0x%08x\n", dwPC-8, + (gfx->words.w0), (gfx->words.w1)); + } +#endif + DLParser_Unknown_Skip3(gfx); + } +} + +void DLParser_Ucode8_0xb5(Gfx *gfx) +{ + uint32 dwPC = gDlistStack[gDlistStackPointer].pc-8; + LOG_UCODE("ucode 0xB5 at PC=%08X: 0x%08x 0x%08x\n", dwPC-8, (gfx->words.w0), (gfx->words.w1)); + + uint32 dwCmd2 = *(uint32 *)(g_pRDRAMu8 + dwPC+8); + uint32 dwCmd3 = *(uint32 *)(g_pRDRAMu8 + dwPC+12); + LOG_UCODE(" : 0x%08x 0x%08x\n", dwCmd2, dwCmd3); + + //if( dwCmd2 == 0 && dwCmd3 == 0 ) + { + DLParser_Ucode8_EndDL(gfx); // Check me + return; + } + + gDlistStack[gDlistStackPointer].pc += 8; + return; + + + if( GSBlkAddrSaves[gDlistStackPointer][0] == 0 || GSBlkAddrSaves[gDlistStackPointer][1] == 0 ) + { +#ifdef DEBUGGER + if( pauseAtNext && eventToPause == NEXT_DLIST) + { + DebuggerAppendMsg("PC=%08X: 0xB5 - %08X : %08X, %08X, EndDL, no next blk\n", dwPC, (gfx->words.w1), dwCmd2, dwCmd3); + } +#endif + DLParser_Ucode8_EndDL(gfx); // Check me + return; + } + + if( ((dwCmd2>>24)!=0x80 && (dwCmd2>>24)!=0x00 ) || ((dwCmd3>>24)!=0x80 && (dwCmd3>>24)!=0x00 ) ) + { +#ifdef DEBUGGER + if( pauseAtNext && eventToPause == NEXT_DLIST) + { + DebuggerAppendMsg("PC=%08X: 0xB5 - %08X : %08X, %08X, EndDL, Unknown\n", dwPC, (gfx->words.w1), dwCmd2, dwCmd3); + } +#endif + DLParser_Ucode8_EndDL(gfx); // Check me + return; + } + + if( (dwCmd2>>24)!= (dwCmd3>>24) ) + { +#ifdef DEBUGGER + if( pauseAtNext && eventToPause == NEXT_DLIST) + { + DebuggerAppendMsg("PC=%08X: 0xB5 - %08X : %08X, %08X, EndDL, Unknown\n", dwPC, (gfx->words.w1), dwCmd2, dwCmd3); + } +#endif + DLParser_Ucode8_EndDL(gfx); // Check me + return; + } + + + if( (dwCmd2>>24)==0x80 && (dwCmd3>>24)==0x80 ) + { + if( dwCmd2 < dwCmd3 ) + { + // All right, the next block is not ucode, but data +#ifdef DEBUGGER + if( pauseAtNext && eventToPause == NEXT_DLIST) + { + DebuggerAppendMsg("PC=%08X: 0xB5 - %08X : %08X, %08X, EndDL, next blk is data\n", dwPC, (gfx->words.w1), dwCmd2, dwCmd3); + } +#endif + DLParser_Ucode8_EndDL(gfx); // Check me + return; + } + + uint32 dwCmd4 = *(uint32 *)(g_pRDRAMu8 + (dwCmd2&0x00FFFFFF)); + uint32 dwCmd5 = *(uint32 *)(g_pRDRAMu8 + (dwCmd2&0x00FFFFFF)+4); + uint32 dwCmd6 = *(uint32 *)(g_pRDRAMu8 + (dwCmd3&0x00FFFFFF)); + uint32 dwCmd7 = *(uint32 *)(g_pRDRAMu8 + (dwCmd3&0x00FFFFFF)+4); + if( (dwCmd4>>24) != 0x80 || (dwCmd5>>24) != 0x80 || (dwCmd6>>24) != 0x80 || (dwCmd7>>24) != 0x80 || dwCmd4 < dwCmd5 || dwCmd6 < dwCmd7 ) + { + // All right, the next block is not ucode, but data +#ifdef DEBUGGER + if( pauseAtNext && eventToPause == NEXT_DLIST) + { + DebuggerAppendMsg("PC=%08X: 0xB5 - %08X : %08X, %08X, EndDL, next blk is data\n", dwPC, (gfx->words.w1), dwCmd2, dwCmd3); + DebuggerAppendMsg("%08X, %08X %08X,%08X\n", dwCmd4, dwCmd5, dwCmd6, dwCmd7); + } +#endif + DLParser_Ucode8_EndDL(gfx); // Check me + return; + } + + gDlistStack[gDlistStackPointer].pc += 8; + DEBUGGER_PAUSE_AND_DUMP(NEXT_DLIST, + DebuggerAppendMsg("PC=%08X: 0xB5 - %08X : %08X, %08X, continue\n", dwPC, (gfx->words.w1), dwCmd2, dwCmd3); + ); + return; + } + else if( (dwCmd2>>24)==0x00 && (dwCmd3>>24)==0x00 ) + { +#ifdef DEBUGGER + if( pauseAtNext && eventToPause == NEXT_DLIST) + { + DebuggerAppendMsg("PC=%08X: 0xB5 - %08X : %08X, %08X, EndDL, next blk is data\n", dwPC, (gfx->words.w1), dwCmd2, dwCmd3); + } +#endif + DLParser_Ucode8_EndDL(gfx); // Check me + return; + } + else if( (dwCmd2>>24)==0x00 && (dwCmd3>>24)==0x00 ) + { + dwCmd2 = *(uint32 *)(g_pRDRAMu8 + dwPC+16); + dwCmd3 = *(uint32 *)(g_pRDRAMu8 + dwPC+20); + if( (dwCmd2>>24)==0x80 && (dwCmd3>>24)==0x80 && dwCmd2 < dwCmd3 ) + { + // All right, the next block is not ucode, but data +#ifdef DEBUGGER + if( pauseAtNext && eventToPause == NEXT_DLIST) + { + DebuggerAppendMsg("PC=%08X: 0xB5 - %08X : %08X, %08X, EndDL, next blk is data\n", dwPC, (gfx->words.w1), dwCmd2, dwCmd3); + } +#endif + DLParser_Ucode8_EndDL(gfx); // Check me + return; + } + else + { + gDlistStack[gDlistStackPointer].pc += 8; + DEBUGGER_PAUSE_AND_DUMP(NEXT_DLIST, + DebuggerAppendMsg("PC=%08X: 0xB5 - %08X : %08X, %08X, continue\n", dwPC, (gfx->words.w1), dwCmd2, dwCmd3) + ); + return; + } + } + +#ifdef DEBUGGER +uint32 dwAddr1 = RSPSegmentAddr(dwCmd2); +uint32 dwAddr2 = RSPSegmentAddr(dwCmd3); + + if( (gfx->words.w1) != 0 ) + { + DebuggerAppendMsg("!!!! PC=%08X: 0xB5 - %08X : %08X, %08X\n", dwPC, (gfx->words.w1), dwCmd2, dwCmd3); + } +#endif + + DEBUGGER_PAUSE_AND_DUMP(NEXT_DLIST, + DebuggerAppendMsg("PC=%08X: 0xB5 - %08X : %08X, %08X, continue\n", dwPC, (gfx->words.w1), dwAddr1, dwAddr2) + ); + + return; +} + +void DLParser_Ucode8_0xbc(Gfx *gfx) +{ + if( ((gfx->words.w0)&0xFFF) == 0x58C ) + { + DLParser_Ucode8_DL(gfx); + } + else + { + uint32 dwPC = gDlistStack[gDlistStackPointer].pc-8; + LOG_UCODE("ucode 0xBC at PC=%08X: 0x%08x 0x%08x\n", dwPC, (gfx->words.w0), (gfx->words.w1)); + } +} + +void DLParser_Ucode8_0xbd(Gfx *gfx) +{ + /* + 00359A68: BD000000, DB5B0077 - RSP_POPMTX + 00359A70: C8C0A000, 00240024 - RDP_TriFill + 00359A78: 01000100, 00000000 - RSP_MTX + 00359A80: BD000501, DB5B0077 - RSP_POPMTX + 00359A88: C8C0A000, 00240024 - RDP_TriFill + 00359A90: 01000100, 00000000 - RSP_MTX + 00359A98: BD000A02, DB5B0077 - RSP_POPMTX + 00359AA0: C8C0A000, 00240024 - RDP_TriFill + 00359AA8: 01000100, 00000000 - RSP_MTX + 00359AB0: BD000F04, EB6F0087 - RSP_POPMTX + 00359AB8: C8C0A000, 00280028 - RDP_TriFill + 00359AC0: 01000100, 00000000 - RSP_MTX + 00359AC8: BD001403, DB5B0077 - RSP_POPMTX + 00359AD0: C8C0A000, 00240024 - RDP_TriFill + 00359AD8: 01000100, 00000000 - RSP_MTX + 00359AE0: B5000000, 00000000 - RSP_LINE3D + 00359AE8: 1A000000, 16000200 - G_NOTHING + */ + + if( (gfx->words.w1) != 0 ) + { + DLParser_Unknown_Skip2(gfx); + return; + } + + uint32 dwPC = gDlistStack[gDlistStackPointer].pc; + LOG_UCODE("ucode 0xbd at PC=%08X: 0x%08x 0x%08x\n", dwPC-8, (gfx->words.w0), (gfx->words.w1)); +} + +void DLParser_Ucode8_0xbf(Gfx *gfx) +{ + if( ((gfx->words.w0)&0xFF) == 0x02 ) + DLParser_Unknown_Skip3(gfx); + else + DLParser_Unknown_Skip1(gfx); +} + +void PD_LoadMatrix_0xb4(uint32 addr) +{ + const float fRecip = 1.0f / 65536.0f; + + uint32 data[16]; + data[0] = *(uint32*)(g_pRDRAMu8+addr+4+ 0); + data[1] = *(uint32*)(g_pRDRAMu8+addr+4+ 8); + data[2] = *(uint32*)(g_pRDRAMu8+addr+4+16); + data[3] = *(uint32*)(g_pRDRAMu8+addr+4+24); + + data[8] = *(uint32*)(g_pRDRAMu8+addr+4+32); + data[9] = *(uint32*)(g_pRDRAMu8+addr+4+40); + data[10] = *(uint32*)(g_pRDRAMu8+addr+4+48); + data[11] = *(uint32*)(g_pRDRAMu8+addr+4+56); + + data[4] = *(uint32*)(g_pRDRAMu8+addr+4+ 0+64); + data[5] = *(uint32*)(g_pRDRAMu8+addr+4+ 8+64); + data[6] = *(uint32*)(g_pRDRAMu8+addr+4+16+64); + data[7] = *(uint32*)(g_pRDRAMu8+addr+4+24+64); + + data[12] = *(uint32*)(g_pRDRAMu8+addr+4+32+64); + data[13] = *(uint32*)(g_pRDRAMu8+addr+4+40+64); + data[14] = *(uint32*)(g_pRDRAMu8+addr+4+48+64); + data[15] = *(uint32*)(g_pRDRAMu8+addr+4+56+64); + + + for (int i = 0; i < 4; i++) + { + for (int j = 0; j < 4; j++) + { + int hi = *(short *)((unsigned char*)data + (((i<<3)+(j<<1) )^0x2)); + int lo = *(uint16*)((unsigned char*)data + (((i<<3)+(j<<1) + 32)^0x2)); + matToLoad.m[i][j] = (float)((hi<<16) | lo) * fRecip; + } + } + + +#ifdef DEBUGGER + LOG_UCODE( + " %#+12.5f %#+12.5f %#+12.5f %#+12.5f\r\n" + " %#+12.5f %#+12.5f %#+12.5f %#+12.5f\r\n" + " %#+12.5f %#+12.5f %#+12.5f %#+12.5f\r\n" + " %#+12.5f %#+12.5f %#+12.5f %#+12.5f\r\n", + matToLoad.m[0][0], matToLoad.m[0][1], matToLoad.m[0][2], matToLoad.m[0][3], + matToLoad.m[1][0], matToLoad.m[1][1], matToLoad.m[1][2], matToLoad.m[1][3], + matToLoad.m[2][0], matToLoad.m[2][1], matToLoad.m[2][2], matToLoad.m[2][3], + matToLoad.m[3][0], matToLoad.m[3][1], matToLoad.m[3][2], matToLoad.m[3][3]); +#endif // DEBUGGER +} + +void DLParser_RDPHalf_1_0xb4_GoldenEye(Gfx *gfx) +{ + SP_Timing(RSP_GBI1_RDPHalf_1); + if( ((gfx->words.w1)>>24) == 0xce ) + { + PrepareTextures(); + CRender::g_pRender->SetCombinerAndBlender(); + + uint32 dwPC = gDlistStack[gDlistStackPointer].pc; // This points to the next instruction + + //PD_LoadMatrix_0xb4(dwPC + 8*16 - 8); + + uint32 dw1 = *(uint32 *)(g_pRDRAMu8 + dwPC+8*0+4); + //uint32 dw2 = *(uint32 *)(g_pRDRAMu8 + dwPC+8*1+4); + //uint32 dw3 = *(uint32 *)(g_pRDRAMu8 + dwPC+8*2+4); + //uint32 dw4 = *(uint32 *)(g_pRDRAMu8 + dwPC+8*3+4); + //uint32 dw5 = *(uint32 *)(g_pRDRAMu8 + dwPC+8*4+4); + //uint32 dw6 = *(uint32 *)(g_pRDRAMu8 + dwPC+8*5+4); + //uint32 dw7 = *(uint32 *)(g_pRDRAMu8 + dwPC+8*6+4); + uint32 dw8 = *(uint32 *)(g_pRDRAMu8 + dwPC+8*7+4); + uint32 dw9 = *(uint32 *)(g_pRDRAMu8 + dwPC+8*8+4); + + uint32 r = (dw8>>16)&0xFF; + uint32 g = (dw8 )&0xFF; + uint32 b = (dw9>>16)&0xFF; + uint32 a = (dw9 )&0xFF; + uint32 color = COLOR_RGBA(r, g, b, a); + + //int x0 = 0; + //int x1 = gRDP.scissor.right; + int x0 = gRSP.nVPLeftN; + int x1 = gRSP.nVPRightN; + int y0 = int(dw1&0xFFFF)/4; + int y1 = int(dw1>>16)/4; + + float xscale = g_textures[0].m_pCTexture->m_dwWidth / (float)(x1-x0); + float yscale = g_textures[0].m_pCTexture->m_dwHeight / (float)(y1-y0); + //float fs0 = (short)(dw3&0xFFFF)/32768.0f*g_textures[0].m_pCTexture->m_dwWidth; + //float ft0 = (short)(dw3>>16)/32768.0f*256; + CRender::g_pRender->TexRect(x0,y0,x1,y1,0,0,xscale,yscale,true,color); + + gDlistStack[gDlistStackPointer].pc += 312; + +#ifdef DEBUGGER + if( logUcodes) + { + dwPC -= 8; + LOG_UCODE("GoldenEye Sky at PC=%08X: 0x%08x 0x%08x", dwPC, (gfx->words.w0), (gfx->words.w1)); + uint32 *ptr = (uint32 *)(g_pRDRAMu8 + dwPC); + for( int i=0; i<21; i++, dwPC+=16,ptr+=4 ) + { + LOG_UCODE("%08X: %08X %08X %08X %08X", dwPC, ptr[0], ptr[1], ptr[2], ptr[3]); + } + } +#endif + + DEBUGGER_PAUSE_AND_DUMP_COUNT_N(NEXT_FLUSH_TRI, { + TRACE0("Pause after Golden Sky Drawing\n"); + }); + } +} + +void DLParser_RSP_DL_WorldDriver(Gfx *gfx) +{ + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + if( dwAddr > g_dwRamSize ) + { + RSP_RDP_NOIMPL("Error: DL addr = %08X out of range, PC=%08X", dwAddr, gDlistStack[gDlistStackPointer].pc ); + dwAddr &= (g_dwRamSize-1); + DebuggerPauseCountN( NEXT_DLIST ); + } + + LOG_UCODE(" WorldDriver DisplayList 0x%08x", dwAddr); + gDlistStackPointer++; + gDlistStack[gDlistStackPointer].pc = dwAddr; + gDlistStack[gDlistStackPointer].countdown = MAX_DL_COUNT; + + LOG_UCODE("Level=%d", gDlistStackPointer+1); + LOG_UCODE("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"); +} + +void DLParser_RSP_Pop_DL_WorldDriver(Gfx *gfx) +{ + RDP_GFX_PopDL(); +} + +void DLParser_RSP_Last_Legion_0x80(Gfx *gfx) +{ + gDlistStack[gDlistStackPointer].pc += 16; + LOG_UCODE("DLParser_RSP_Last_Legion_0x80"); +} + +void DLParser_RSP_Last_Legion_0x00(Gfx *gfx) +{ + LOG_UCODE("DLParser_RSP_Last_Legion_0x00"); + gDlistStack[gDlistStackPointer].pc += 16; + + if( (gfx->words.w0) == 0 && (gfx->words.w1) ) + { + uint32 newaddr = RSPSegmentAddr((gfx->words.w1)); + if( newaddr >= g_dwRamSize ) + { + RDP_GFX_PopDL(); + return; + } + + //uint32 dw1 = *(uint32 *)(g_pRDRAMu8 + newaddr+8*0+4); + uint32 pc1 = *(uint32 *)(g_pRDRAMu8 + newaddr+8*1+4); + uint32 pc2 = *(uint32 *)(g_pRDRAMu8 + newaddr+8*4+4); + pc1 = RSPSegmentAddr(pc1); + pc2 = RSPSegmentAddr(pc2); + + if( pc1 && pc1 != 0xffffff && pc1 < g_dwRamSize) + { + // Need to call both DL + gDlistStackPointer++; + gDlistStack[gDlistStackPointer].pc = pc1; + gDlistStack[gDlistStackPointer].countdown = MAX_DL_COUNT; + } + + if( pc2 && pc2 != 0xffffff && pc2 < g_dwRamSize ) + { + gDlistStackPointer++; + gDlistStack[gDlistStackPointer].pc = pc2; + gDlistStack[gDlistStackPointer].countdown = MAX_DL_COUNT; + } + } + else if( (gfx->words.w1) == 0 ) + { + RDP_GFX_PopDL(); + } + else + { + // (gfx->words.w0) != 0 + RSP_RDP_Nothing(gfx); + RDP_GFX_PopDL(); + } +} + +void DLParser_TexRect_Last_Legion(Gfx *gfx) +{ + if( !status.bCIBufferIsRendered ) + g_pFrameBufferManager->ActiveTextureBuffer(); + + status.primitiveType = PRIM_TEXTRECT; + + // This command used 128bits, and not 64 bits. This means that we have to look one + // Command ahead in the buffer, and update the PC. + uint32 dwPC = gDlistStack[gDlistStackPointer].pc; // This points to the next instruction + uint32 dwCmd2 = *(uint32 *)(g_pRDRAMu8 + dwPC); + uint32 dwCmd3 = *(uint32 *)(g_pRDRAMu8 + dwPC+4); + + gDlistStack[gDlistStackPointer].pc += 8; + + + LOG_UCODE("0x%08x: %08x %08x", dwPC, *(uint32 *)(g_pRDRAMu8 + dwPC+0), *(uint32 *)(g_pRDRAMu8 + dwPC+4)); + + uint32 dwXH = (((gfx->words.w0)>>12)&0x0FFF)/4; + uint32 dwYH = (((gfx->words.w0) )&0x0FFF)/4; + uint32 tileno = ((gfx->words.w1)>>24)&0x07; + uint32 dwXL = (((gfx->words.w1)>>12)&0x0FFF)/4; + uint32 dwYL = (((gfx->words.w1) )&0x0FFF)/4; + + + if( (int)dwXL >= gRDP.scissor.right || (int)dwYL >= gRDP.scissor.bottom || (int)dwXH < gRDP.scissor.left || (int)dwYH < gRDP.scissor.top ) + { + // Clipping + return; + } + + uint16 uS = (uint16)( dwCmd2>>16)&0xFFFF; + uint16 uT = (uint16)( dwCmd2 )&0xFFFF; + short s16S = *(short*)(&uS); + short s16T = *(short*)(&uT); + + uint16 uDSDX = (uint16)(( dwCmd3>>16)&0xFFFF); + uint16 uDTDY = (uint16)(( dwCmd3 )&0xFFFF); + short s16DSDX = *(short*)(&uDSDX); + short s16DTDY = *(short*)(&uDTDY); + + uint32 curTile = gRSP.curTile; + ForceMainTextureIndex(tileno); + + float fS0 = s16S / 32.0f; + float fT0 = s16T / 32.0f; + + float fDSDX = s16DSDX / 1024.0f; + float fDTDY = s16DTDY / 1024.0f; + + uint32 cycletype = gRDP.otherMode.cycle_type; + + if (cycletype == CYCLE_TYPE_COPY) + { + fDSDX /= 4.0f; // In copy mode 4 pixels are copied at once. + dwXH++; + dwYH++; + } + else if (cycletype == CYCLE_TYPE_FILL) + { + dwXH++; + dwYH++; + } + + if( fDSDX == 0 ) fDSDX = 1; + if( fDTDY == 0 ) fDTDY = 1; + + float fS1 = fS0 + (fDSDX * (dwXH - dwXL)); + float fT1 = fT0 + (fDTDY * (dwYH - dwYL)); + + LOG_UCODE(" Tile:%d Screen(%d,%d) -> (%d,%d)", tileno, dwXL, dwYL, dwXH, dwYH); + LOG_UCODE(" Tex:(%#5f,%#5f) -> (%#5f,%#5f) (DSDX:%#5f DTDY:%#5f)", + fS0, fT0, fS1, fT1, fDSDX, fDTDY); + LOG_UCODE(""); + + float t0u0 = (fS0-gRDP.tiles[tileno].hilite_sl) * gRDP.tiles[tileno].fShiftScaleS; + float t0v0 = (fT0-gRDP.tiles[tileno].hilite_tl) * gRDP.tiles[tileno].fShiftScaleT; + float t0u1 = t0u0 + (fDSDX * (dwXH - dwXL))*gRDP.tiles[tileno].fShiftScaleS; + float t0v1 = t0v0 + (fDTDY * (dwYH - dwYL))*gRDP.tiles[tileno].fShiftScaleT; + + if( dwXL==0 && dwYL==0 && dwXH==windowSetting.fViWidth-1 && dwYH==windowSetting.fViHeight-1 && + t0u0 == 0 && t0v0==0 && t0u1==0 && t0v1==0 ) + { + //Using TextRect to clear the screen + } + else + { + if( status.bHandleN64RenderTexture && //status.bDirectWriteIntoRDRAM && + g_pRenderTextureInfo->CI_Info.dwFormat == gRDP.tiles[tileno].dwFormat && + g_pRenderTextureInfo->CI_Info.dwSize == gRDP.tiles[tileno].dwSize && + gRDP.tiles[tileno].dwFormat == TXT_FMT_CI && gRDP.tiles[tileno].dwSize == TXT_SIZE_8b ) + { + if( options.enableHackForGames == HACK_FOR_YOSHI ) + { + // Hack for Yoshi background image + PrepareTextures(); + TexRectToFrameBuffer_8b(dwXL, dwYL, dwXH, dwYH, t0u0, t0v0, t0u1, t0v1, tileno); + DEBUGGER_PAUSE_AT_COND_AND_DUMP_COUNT_N((eventToPause == NEXT_FLUSH_TRI || eventToPause == NEXT_TEXTRECT), { + DebuggerAppendMsg("TexRect: tile=%d, X0=%d, Y0=%d, X1=%d, Y1=%d,\nfS0=%f, fT0=%f, ScaleS=%f, ScaleT=%f\n", + gRSP.curTile, dwXL, dwYL, dwXH, dwYH, fS0, fT0, fDSDX, fDTDY); + DebuggerAppendMsg("Pause after TexRect for Yoshi\n"); + }); + } + else + { + if( frameBufferOptions.bUpdateCIInfo ) + { + PrepareTextures(); + TexRectToFrameBuffer_8b(dwXL, dwYL, dwXH, dwYH, t0u0, t0v0, t0u1, t0v1, tileno); + } + + if( !status.bDirectWriteIntoRDRAM ) + { + CRender::g_pRender->TexRect(dwXL, dwYL, dwXH, dwYH, fS0, fT0, fDSDX, fDTDY); + + status.dwNumTrisRendered += 2; + } + } + } + else + { + CRender::g_pRender->TexRect(dwXL, dwYL, dwXH, dwYH, fS0, fT0, fDSDX, fDTDY); + status.bFrameBufferDrawnByTriangles = true; + + status.dwNumTrisRendered += 2; + } + } + + if( status.bHandleN64RenderTexture ) + g_pRenderTextureInfo->maxUsedHeight = max(g_pRenderTextureInfo->maxUsedHeight,(int)dwYH); + + ForceMainTextureIndex(curTile); +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/RSP_GBI_Sprite2D.h b/libmupen64plus/mupen64plus-video-rice/src/RSP_GBI_Sprite2D.h new file mode 100644 index 0000000000..a69d35485c --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/RSP_GBI_Sprite2D.h @@ -0,0 +1,169 @@ +/* +Copyright (C) 2002 Rice1964 + +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. + +*/ + +// Sprite2D Ucodes + +#include "Render.h" + +Sprite2DInfo g_Sprite2DInfo; +uint32 g_SavedUcode=1; + +void RSP_GBI_Sprite2DBase(Gfx *gfx) +{ + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + dwAddr &= (g_dwRamSize-1); + + //RSP_RDP_NOIMPL("RDP: Sprite2D (0x%08x 0x%08x)", (gfx->words.w0), (gfx->words.w1)); + + g_Sprite2DInfo.spritePtr = (SpriteStruct *)(g_pRDRAMs8+dwAddr); + + DEBUGGER_PAUSE_AND_DUMP_COUNT_N(NEXT_SPRITE_2D, {DebuggerAppendMsg("Pause after Sprite2DBase: Addr=%08X\n", dwAddr);}); +} + +typedef struct{ + uint32 SourceImagePointer; + uint32 TlutPointer; + + short SubImageWidth; + short Stride; + + char SourceImageBitSize; + char SourceImageType; + short SubImageHeight; + + short scaleY; + short scaleX; + + short SourceImageOffsetS; + char dummy1[2]; + + short px; + short SourceImageOffsetT; + + char dummy2[2]; + short py; + +} PuzzleMasterSprite; + +void RSP_GBI_Sprite2D_PuzzleMaster64(Gfx *gfx) +{ + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + dwAddr &= (g_dwRamSize-1); + + g_Sprite2DInfo.spritePtr = (SpriteStruct *)(g_pRDRAMs8+dwAddr); + + g_Sprite2DInfo.flipX = 0; + g_Sprite2DInfo.flipY = 0; + g_Sprite2DInfo.px = 0; + g_Sprite2DInfo.py = 0; + + SpriteStruct tempInfo; + memcpy(&tempInfo, g_Sprite2DInfo.spritePtr, sizeof(SpriteStruct)); + PuzzleMasterSprite info; + memcpy(&info, g_Sprite2DInfo.spritePtr, sizeof(PuzzleMasterSprite)); + + g_Sprite2DInfo.px = info.px>>2; + g_Sprite2DInfo.py = info.py>>2; + g_Sprite2DInfo.scaleX = info.scaleX / 1024.0f; + g_Sprite2DInfo.scaleY = info.scaleY / 1024.0f; + + tempInfo.SourceImageOffsetS = info.SourceImageOffsetS; + tempInfo.SourceImageOffsetT = info.SourceImageOffsetT; + g_Sprite2DInfo.spritePtr = &tempInfo; + + CRender::g_pRender->DrawSprite2D(g_Sprite2DInfo, 1); + DEBUGGER_PAUSE_AND_DUMP_COUNT_N(NEXT_SPRITE_2D, {DebuggerAppendMsg("Pause after Sprite2DBase: Addr=%08X\n", dwAddr);}); +} + + +void RSP_GBI1_Sprite2DDraw(Gfx *gfx) +{ + // This ucode is shared by PopMtx and gSPSprite2DDraw + g_Sprite2DInfo.px = (short)(((gfx->words.w1)>>16)&0xFFFF)/4; + g_Sprite2DInfo.py = (short)((gfx->words.w1)&0xFFFF)/4; + + //RSP_RDP_NOIMPL("gSPSprite2DDraw is not implemented", (gfx->words.w0), (gfx->words.w1)); + CRender::g_pRender->DrawSprite2D(g_Sprite2DInfo, 1); + DEBUGGER_PAUSE_AND_DUMP_COUNT_N(NEXT_SPRITE_2D, + {DebuggerAppendMsg("Pause after Sprite2DDraw at (%d, %d)\n", g_Sprite2DInfo.px, g_Sprite2DInfo.py);}); + + LoadedUcodeMap[RSP_SPRITE2D_SCALEFLIP] = &RSP_GBI1_CullDL; + LoadedUcodeMap[RSP_SPRITE2D_DRAW] = &RSP_GBI1_PopMtx; + LoadedUcodeMap[RSP_SPRITE2D_BASE] = &RSP_GBI1_Sprite2DBase; + +} + +void RSP_GBI0_Sprite2DDraw(Gfx *gfx) +{ + // This ucode is shared by PopMtx and gSPSprite2DDraw + g_Sprite2DInfo.px = (short)(((gfx->words.w1)>>16)&0xFFFF)/4; + g_Sprite2DInfo.py = (short)((gfx->words.w1)&0xFFFF)/4; + + //RSP_RDP_NOIMPL("gSPSprite2DDraw is not implemented", (gfx->words.w0), (gfx->words.w1)); + CRender::g_pRender->DrawSprite2D(g_Sprite2DInfo, 0); + DEBUGGER_PAUSE_AND_DUMP_COUNT_N(NEXT_SPRITE_2D, {TRACE0("Pause after Sprite2DDraw\n");}); +} + + +void RSP_GBI1_Sprite2DScaleFlip(Gfx *gfx) +{ + g_Sprite2DInfo.scaleX = (((gfx->words.w1)>>16)&0xFFFF)/1024.0f; + g_Sprite2DInfo.scaleY = ((gfx->words.w1)&0xFFFF)/1024.0f; + + if( ((gfx->words.w1)&0xFFFF) < 0x100 ) + { + g_Sprite2DInfo.scaleY = g_Sprite2DInfo.scaleX; + } + + g_Sprite2DInfo.flipX = (uint8)(((gfx->words.w0)>>8)&0xFF); + g_Sprite2DInfo.flipY = (uint8)((gfx->words.w0)&0xFF); + //RSP_RDP_NOIMPL("RSP_SPRITE2D_SCALEFLIP is not implemented", (gfx->words.w0), (gfx->words.w1)); + DEBUGGER_PAUSE_AND_DUMP_COUNT_N(NEXT_SPRITE_2D, + {DebuggerAppendMsg("Pause after Sprite2DScaleFlip, Flip (%d,%d), Scale (%f, %f)\n", g_Sprite2DInfo.flipX, g_Sprite2DInfo.flipY, + g_Sprite2DInfo.scaleX, g_Sprite2DInfo.scaleY);}); +} + + +void RSP_GBI1_Sprite2DBase(Gfx *gfx) +{ + if( !status.bUseModifiedUcodeMap ) + { + memcpy( &LoadedUcodeMap, &ucodeMap1, sizeof(UcodeMap)); + status.bUseModifiedUcodeMap = true; + } + + LoadedUcodeMap[RSP_SPRITE2D_BASE] = &RSP_GBI_Sprite2DBase; + LoadedUcodeMap[RSP_SPRITE2D_SCALEFLIP] = &RSP_GBI1_Sprite2DScaleFlip; + LoadedUcodeMap[RSP_SPRITE2D_DRAW] = &RSP_GBI1_Sprite2DDraw; + + TRACE0("Adding Sprite2D ucodes to ucode 1"); + RSP_GBI_Sprite2DBase(gfx); +} + + +void RSP_GBI0_Sprite2DBase(Gfx *gfx) +{ + //Weired, this ucode 0 game is using ucode 1, but sprite2D cmd is working differently from + //normal ucode1 sprite2D game + + TRACE0("Ucode 0 game is using Sprite2D, and using ucode 1 codes, create a new ucode for me"); + + RSP_GBI_Sprite2DBase(gfx); +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/RSP_Parser.cpp b/libmupen64plus/mupen64plus-video-rice/src/RSP_Parser.cpp new file mode 100644 index 0000000000..d3a69d308c --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/RSP_Parser.cpp @@ -0,0 +1,1787 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + +#include +#include + +#include "ConvertImage.h" +#include "GraphicsContext.h" +#include "Render.h" +#include "RenderTexture.h" +#include "Video.h" +#include "ucode.h" +#include + +////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////// +// uCode Config // +////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////// +#define MAX_UCODE_INFO 16 +UcodeInfo ucodeInfo[MAX_UCODE_INFO]; + +RDPInstruction LoadedUcodeMap[256]; +char* LoadedUcodeNameMap[256]; + +OSTask *g_pOSTask = NULL; +UcodeInfo lastUcodeInfo; +UcodeInfo UsedUcodes[MAX_UCODE_INFO]; +const uint32 maxUsedUcodes = sizeof(UsedUcodes)/sizeof(UcodeInfo); + +////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////// +// Ucodes // +////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////// + +UcodeMap *ucodeMaps[] = +{ + &ucodeMap0, // ucode 0 - Mario + &ucodeMap1, // ucode 1 - GBI1 + NULL, // ucode 2 - Golden Eye + &ucodeMap3, // ucode 3 - S2DEX GBI2 + NULL, // ucode 4 - Wave Racer + &ucodeMap5, // ucode 5 - BGI2 + NULL, // ucode 6 - DKR + &ucodeMap7, // ucode 7 - S2DEX + NULL, // ucode 8 - ucode 0 with sprite2D, for Demo Puzzle Master 64 + NULL, // ucode 9 - Perfect Dark + NULL, // ucode 10 - Conker + NULL, // ucode 11 - Gemini + NULL, // ucode 12 - Silicon Valley, Spacestation + NULL, // ucode 13 - modified ucode S2DEX + NULL, // ucode 14 - OgreBattle Background + NULL, // ucode 15 - ucode 0 with sprite2D + NULL, // ucode 16 - Star War, Shadow of Empire + NULL, // ucode 17 - Star Wars - Rogue Squadron, + NULL, // ucode 18 - World Driver Championship + NULL, // ucode 19 - Last Legion UX + &ucodeMap1, // ucode 20 - ZSortp +}; + +uint32 vertexMultVals[] = +{ + 10, // ucode 0 - Mario + 2, // ucode 1 - GBI1 + 10, // ucode 2 - Golden Eye + 2, // ucode 3 - S2DEX GBI2 + 5, // ucode 4 - Wave Racer + 2, // ucode 5 - BGI2 + 10, // ucode 6 - DKR + 2, // ucode 7 - S2DEX + 10, // ucode 8 - ucode 0 with sprite2D, for Demo Puzzle Master 64 + 10, // ucode 9 - Perfect Dark + 2, // ucode 10 - Conker + 10, // ucode 11 - Gemini + 2, // ucode 12 - Silicon Valley, Spacestation + 2, // ucode 13 - modified ucode S2DEX + 2, // ucode 14 - OgreBattle Background + 10, // ucode 15 - ucode 0 with sprite2D + 5, // ucode 16 - Star War, Shadow of Empire + + 2, // ucode 17 - Star Wars - Rogue Squadron, + 2, // ucode 18 - World Driver Championship, check me here + 2, // ucode 19 - Last Legion UX, check me here + 2, // ucode 20 - ZSortp +}; + +unsigned char gLastMicrocodeString[ 300 ] = ""; + +//***************************************************************************** +// +//***************************************************************************** +static UcodeData g_UcodeData[] = +{ + //crc_size, crc_800; + + {0, 0x150c3ce8, 0x150c3ce8, (unsigned char*)"RSP SW Version: 2.0D, 04-01-96",}, // Super Mario 64 + {4, 0x2b94276f, 0x2b94276f, (unsigned char*)"RSP SW Version: 2.0D, 04-01-96",}, // Wave Race 64 (v1.0) + {16,0xb1870454, 0xb1870454, (unsigned char*)"RSP SW Version: 2.0D, 04-01-96",}, // Star Wars - Shadows of the Empire (v1.0), + {0, 0x51671ae4, 0x51671ae4, (unsigned char*)"RSP SW Version: 2.0D, 04-01-96",}, // Pilot Wings 64, + {0, 0x67b5ac55, 0x67b5ac55, (unsigned char*)"RSP SW Version: 2.0D, 04-01-96",}, // Wibble, + {0, 0x64dc8104, 0x64dc8104, (unsigned char*)"RSP SW Version: 2.0D, 04-01-96",}, // Dark Rift, + {0, 0x309f363d, 0x309f363d, (unsigned char*)"RSP SW Version: 2.0D, 04-01-96",}, // Killer Instinct Gold, + {0, 0xfcb57e57, 0xfcb57e57, (unsigned char*)"RSP SW Version: 2.0D, 04-01-96",}, // Blast Corps, + {0, 0xb420f35a, 0xb420f35a, (unsigned char*)"RSP SW Version: 2.0D, 04-01-96",}, // Blast Corps, + {0, 0x6e26c1df, 0x7c98e9c2, (unsigned char*)"RSP SW Version: 2.0D, 04-01-96",}, + {2, 0xc02ac7bc, 0xc02ac7bc, (unsigned char*)"RSP SW Version: 2.0G, 09-30-96",}, // GoldenEye 007, + {0, 0xe5fee3bc, 0xe5fee3bc, (unsigned char*)"RSP SW Version: 2.0G, 09-30-96",}, // Aero Fighters Assault, + {8, 0xe4bb5ad8, 0x80129845, (unsigned char*)"RSP SW Version: 2.0G, 09-30-96",}, // Puzzle Master 64, + {0, 0x72109ec6, 0x72109ec6, (unsigned char*)"RSP SW Version: 2.0H, 02-12-97",}, // Duke Nukem 64, + {0, 0xf24a9a04, 0xf24a9a04, (unsigned char*)"RSP SW Version: 2.0H, 02-12-97",}, // Tetrisphere, + {15,0x700de42e, 0x700de42e, (unsigned char*)"RSP SW Version: 2.0H, 02-12-97",}, // Wipeout 64 (uses GBI1 too!), + {15,0x1b304a74, 0x1b304a74, (unsigned char*)"RSP SW Version: 2.0H, 02-12-97",}, // Flying Dragon, + {15,0xe4bb5ad8, 0xa7b2f704, (unsigned char*)"RSP SW Version: 2.0H, 02-12-97",}, // Silicon Valley, + {15,0xe4bb5ad8, 0x88202781, (unsigned char*)"RSP SW Version: 2.0H, 02-12-97",}, // Glover, + {0, 0xe466b5bd, 0xe466b5bd, (unsigned char*)"Unknown 0xe466b5bd, 0xe466b5bd",}, // Dark Rift, + {9, 0x7064a163, 0x7064a163, (unsigned char*)"Unknown 0x7064a163, 0x7064a163",}, // Perfect Dark (v1.0), + {0, 0x6522df69, 0x71bd078d, (unsigned char*)"Unknown 0x6522df69, 0x71bd078d",}, // Tetris + {0, 0x6522df69, 0x1b0c23a8, (unsigned char*)"Unknown 0x6522df69, 0x1b0c23a8",}, // Pachinko Nichi + + // GBI1 + + {1, 0x45ca328e, 0x45ca328e, (unsigned char*)"RSP Gfx ucode F3DLX 0.95 Yoshitaka Yasumoto Nintendo.",}, // Mario Kart 64, + {1, 0x98e3b909, 0x98e3b909, (unsigned char*)"RSP Gfx ucode F3DEX 0.95 Yoshitaka Yasumoto Nintendo.",}, // Mario Kart 64 + {1, 0x5d446090, 0x5d446090, (unsigned char*)"RSP Gfx ucode F3DLP.Rej 0.96 Yoshitaka Yasumoto Nintendo.",0,1}, // Jikkyou J. League Perfect Striker, + {1, 0x244f5ca3, 0x244f5ca3, (unsigned char*)"RSP Gfx ucode F3DEX 1.00 Yoshitaka Yasumoto Nintendo.",}, // F-1 Pole Position 64, + {1, 0x6a022585, 0x6a022585, (unsigned char*)"RSP Gfx ucode F3DEX.NoN 1.00 Yoshitaka Yasumoto Nintendo.",1}, // Turok - The Dinosaur Hunter (v1.0), + {1, 0x150706be, 0x150706be, (unsigned char*)"RSP Gfx ucode F3DLX.NoN 1.00 Yoshitaka Yasumoto Nintendo.",1}, // Extreme-G, + {1, 0x503f2c53, 0x503f2c53, (unsigned char*)"RSP Gfx ucode F3DEX.NoN 1.21 Yoshitaka Yasumoto Nintendo.",1}, // Bomberman 64, + {1, 0xc705c37c, 0xc705c37c, (unsigned char*)"RSP Gfx ucode F3DLX 1.21 Yoshitaka Yasumoto Nintendo.",}, // Fighting Force 64, Wipeout 64 + {1, 0xa2146075, 0xa2146075, (unsigned char*)"RSP Gfx ucode F3DLX.NoN 1.21 Yoshitaka Yasumoto Nintendo.",1}, // San Francisco Rush - Extreme Racing, + {1, 0xb65aa2da, 0xb65aa2da, (unsigned char*)"RSP Gfx ucode L3DEX 1.21 Yoshitaka Yasumoto Nintendo.",}, // Wipeout 64, + {1, 0x0c8e5ec9, 0x0c8e5ec9, (unsigned char*)"RSP Gfx ucode F3DEX 1.21 Yoshitaka Yasumoto Nintendo.",}, // + {1, 0xe30795f2, 0xa53df3c4, (unsigned char*)"RSP Gfx ucode F3DLP.Rej 1.21 Yoshitaka Yasumoto Nintendo.",0,1}, + + {1, 0xaebeda7d, 0xaebeda7d, (unsigned char*)"RSP Gfx ucode F3DLX.Rej 1.21 Yoshitaka Yasumoto Nintendo.",0,1}, // Jikkyou World Soccer 3, + {1, 0x0c8e5ec9, 0x0c8e5ec9, (unsigned char*)"RSP Gfx ucode F3DEX 1.23 Yoshitaka Yasumoto Nintendo" ,}, // Wave Race 64 (Rev. 2) - Shindou Rumble Edition (JAP) + {1, 0xc705c37c, 0xc705c37c, (unsigned char*)"RSP Gfx ucode F3DLX 1.23 Yoshitaka Yasumoto Nintendo.",}, // GT + {1, 0x2a61350d, 0x2a61350d, (unsigned char*)"RSP Gfx ucode F3DLX 1.23 Yoshitaka Yasumoto Nintendo.",}, // Toy Story2 + {1, 0x0c8e5ec9, 0x0c8e5ec9, (unsigned char*)"RSP Gfx ucode F3DEX 1.23 Yoshitaka Yasumoto Nintendo.",}, // Wave Race 64 Shindou Edition + {12,0xfc6529aa, 0xfc6529aa, (unsigned char*)"RSP Gfx ucode F3DEX 1.23 Yoshitaka Yasumoto Nintendo.",}, // Superman - The Animated Series, + {1, 0xa56cf996, 0xa56cf996, (unsigned char*)"RSP Gfx ucode L3DEX 1.23 Yoshitaka Yasumoto Nintendo.",}, // Flying Dragon, + {1, 0xcc83b43f, 0xcc83b43f, (unsigned char*)"RSP Gfx ucode F3DEX.NoN 1.23 Yoshitaka Yasumoto Nintendo.",1}, // AeroGauge, + {1, 0xca8927a0, 0xca8927a0, (unsigned char*)"RSP Gfx ucode F3DLX.Rej 1.23 Yoshitaka Yasumoto Nintendo.",0,1}, // Puzzle Bobble 64, + {1, 0x25689c75, 0xbe481ae8, (unsigned char*)"RSP Gfx ucode F3DLP.Rej 1.23 Yoshitaka Yasumoto Nintendo.",0,1}, + {1, 0xd2d747b7, 0xd2d747b7, (unsigned char*)"RSP Gfx ucode F3DLX.NoN 1.23 Yoshitaka Yasumoto Nintendo.",1}, // Penny Racers, + {1, 0xa849c858, 0x5bd32b5a, (unsigned char*)"RSP Gfx ucode F3DTEX/A 1.23 Yoshitaka Yasumoto Nintendo.",}, // Tamagotchi + + {7, 0xecd8b772, 0xecd8b772, (unsigned char*)"RSP Gfx ucode S2DEX 1.06 Yoshitaka Yasumoto Nintendo.",}, // Yoshi's Story, + {7, 0xf59132f5, 0xf59132f5, (unsigned char*)"RSP Gfx ucode S2DEX 1.07 Yoshitaka Yasumoto Nintendo.",}, // Bakuretsu Muteki Bangaioh, + {7, 0x961dd811, 0x961dd811, (unsigned char*)"RSP Gfx ucode S2DEX 1.03 Yoshitaka Yasumoto Nintendo.",}, // GT + + {5, 0x3e083afa, 0x722f97cc, (unsigned char*)"RSP Gfx ucode F3DEX.NoN fifo 2.03 Yoshitaka Yasumoto 1998 Nintendo.",1}, // F-Zero X, + {5, 0xa8050bd1, 0xa8050bd1, (unsigned char*)"RSP Gfx ucode F3DEX fifo 2.03 Yoshitaka Yasumoto 1998 Nintendo.",}, // F-Zero X, + {5, 0x4e8055f0, 0x4e8055f0, (unsigned char*)"RSP Gfx ucode F3DLX.Rej fifo 2.03 Yoshitaka Yasumoto 1998 Nintendo.",0,1}, // F-Zero X, + {5, 0xabf001f5, 0xabf001f5, (unsigned char*)"RSP Gfx ucode F3DFLX.Rej fifo 2.03F Yoshitaka Yasumoto 1998 Nintendo.",0,1}, // F-Zero X, + {5, 0xadb4b686, 0xadb4b686, (unsigned char*)"RSP Gfx ucode F3DEX fifo 2.04 Yoshitaka Yasumoto 1998 Nintendo.",}, // Top Gear Rally 2, + {5, 0x779e2a9b, 0x779e2a9b, (unsigned char*)"RSP Gfx ucode F3DEX.NoN fifo 2.04 Yoshitaka Yasumoto 1998 Nintendo.",1}, // California Speed, + {5, 0xa8cb3e09, 0xa8cb3e09, (unsigned char*)"RSP Gfx ucode L3DEX fifo 2.04 Yoshitaka Yasumoto 1998 Nintendo.",}, // In-Fisherman Bass Hunter 64, + {5, 0x2a1341d6, 0x2a1341d6, (unsigned char*)"RSP Gfx ucode F3DEX fifo 2.04H Yoshitaka Yasumoto 1998 Nintendo.",}, // Kirby 64 - The Crystal Shards, + {5, 0x3e083afa, 0x89a8e0ed, (unsigned char*)"RSP Gfx ucode F3DEX.NoN fifo 2.05 Yoshitaka Yasumoto 1998 Nintendo.",1}, // Carmageddon 64 (uncensored), + {5, 0x4964b75d, 0x4964b75d, (unsigned char*)"RSP Gfx ucode F3DEX.NoN fifo 2.05 Yoshitaka Yasumoto 1998 Nintendo.",1}, + {5, 0x39e3e95a, 0x39e3e95a, (unsigned char*)"RSP Gfx ucode F3DEX fifo 2.05 Yoshitaka Yasumoto 1998 Nintendo."}, // Knife Edge - Nose Gunner, + {5, 0xd2913522, 0xd2913522, (unsigned char*)"RSP Gfx ucode F3DAM fifo 2.05 Yoshitaka Yasumoto 1998 Nintendo."}, // Hey You, Pikachu!, + {5, 0x3e083afa, 0xc998443f, (unsigned char*)"RSP Gfx ucode F3DEX xbus 2.05 Yoshitaka Yasumoto 1998 Nintendo."}, //Triple play + {5, 0xf4184a7d, 0xf4184a7d, (unsigned char*)"RSP Gfx ucode F3DEX fifo 2.06 Yoshitaka Yasumoto 1998 Nintendo.",}, // Hey You, Pikachu!, + {5, 0x595a88de, 0x595a88de, (unsigned char*)"RSP Gfx ucode F3DEX.Rej fifo 2.06 Yoshitaka Yasumoto 1998 Nintendo.",0,1}, // Bio Hazard 2, + {5, 0x0259f764, 0x0259f764, (unsigned char*)"RSP Gfx ucode F3DLX.Rej fifo 2.06 Yoshitaka Yasumoto 1998 Nintendo.",0,1}, // Mario Party, + {5, 0xe1a5477a, 0xe1a5477a, (unsigned char*)"RSP Gfx ucode F3DEX.NoN xbus 2.06 Yoshitaka Yasumoto 1998 Nintendo.",1}, // Command & Conquer, + {5, 0x4cfa0a19, 0x4cfa0a19, (unsigned char*)"RSP Gfx ucode F3DZEX.NoN fifo 2.06H Yoshitaka Yasumoto 1998 Nintendo.",1}, // The Legend of Zelda - Ocarina of Time (v1.0), + {5, 0x2cbd9514, 0x5f40b9f5, (unsigned char*)"RSP Gfx ucode F3DZEX.NoN fifo 2.06H Yoshitaka Yasumoto 1998 Nintendo.",1}, + + {5, 0x3e083afa, 0x882680f4, (unsigned char*)"RSP Gfx ucode L3DEX fifo 2.07 Yoshitaka Yasumoto 1998 Nintendo."}, // Polaris Sno + + {5, 0xdeb1cac0, 0xdeb1cac0, (unsigned char*)"RSP Gfx ucode F3DEX.NoN fifo 2.07 Yoshitaka Yasumoto 1998 Nintendo.",1}, // Knockout Kings 2000, + {5, 0xf4184a7d, 0xf4184a7d, (unsigned char*)"RSP Gfx ucode F3DEX fifo 2.07 Yoshitaka Yasumoto 1998 Nintendo.",}, // Xena Warrior Princess - Talisman of Fate, Army Men - Air Combat, Destruction Derby + {5, 0x4b013e60, 0x4b013e60, (unsigned char*)"RSP Gfx ucode F3DEX xbus 2.07 Yoshitaka Yasumoto 1998 Nintendo.",}, // Lode Runner 3-D, + {5, 0xd1a63836, 0xd1a63836, (unsigned char*)"RSP Gfx ucode L3DEX fifo 2.08 Yoshitaka Yasumoto 1999 Nintendo.",}, // Hey You, Pikachu!, + {5, 0x97193667, 0x97193667, (unsigned char*)"RSP Gfx ucode F3DEX fifo 2.08 Yoshitaka Yasumoto 1999 Nintendo.",}, // Top Gear Hyper-Bike, + {5, 0x92149ba8, 0x92149ba8, (unsigned char*)"RSP Gfx ucode F3DEX fifo 2.08 Yoshitaka Yasumoto/Kawasedo 1999.",}, // Paper Mario, + {5, 0xae0fb88f, 0xae0fb88f, (unsigned char*)"RSP Gfx ucode F3DEX xbus 2.08 Yoshitaka Yasumoto 1999 Nintendo.",}, // WWF WrestleMania 2000, + {5, 0xc572f368, 0xc572f368, (unsigned char*)"RSP Gfx ucode F3DLX.Rej xbus 2.08 Yoshitaka Yasumoto 1999 Nintendo.",}, // WWF No Mercy, + {5, 0x3e083afa, 0x74252492, (unsigned char*)"RSP Gfx ucode F3DEX.NoN xbus 2.08 Yoshitaka Yasumoto 1999 Nintendo.",1}, + + {5, 0x9c2edb70, 0xea98e740, (unsigned char*)"RSP Gfx ucode F3DEX.NoN fifo 2.08 Yoshitaka Yasumoto 1999 Nintendo.",1}, // LEGO Racers, + {5, 0x79e004a6, 0x79e004a6, (unsigned char*)"RSP Gfx ucode F3DLX.Rej fifo 2.08 Yoshitaka Yasumoto 1999 Nintendo.",0,1}, // Mario Party 2, + {5, 0xaa6ab3ca, 0xaa6ab3ca, (unsigned char*)"RSP Gfx ucode F3DEX.Rej fifo 2.08 Yoshitaka Yasumoto 1999 Nintendo.",0,1}, // V-Rally Edition 99, + {5, 0x2c597e0f, 0x2c597e0f, (unsigned char*)"RSP Gfx ucode F3DEX fifo 2.08 Yoshitaka Yasumoto 1999 Nintendo.",}, // Cruis'n Exotica, + {10, 0x4e5f3e3b, 0x4e5f3e3b,(unsigned char*)"RSP Gfx ucode F3DEXBG.NoN fifo 2.08 Yoshitaka Yasumoto 1999 Nintendo.",1}, // Conker The Bad Fur Day + {5, 0x61f31862, 0x61f31862, (unsigned char*)"RSP Gfx ucode F3DEX.NoN fifo 2.08H Yoshitaka Yasumoto 1999 Nintendo.",1}, // Pokemon Snap, + {5, 0x005f5b71, 0x005f5b71, (unsigned char*)"RSP Gfx ucode F3DZEX.NoN fifo 2.08I Yoshitaka Yasumoto/Kawasedo 1999.",1}, // The Legend of Zelda 2 - Majora's Mask, + + {3, 0x41839d1e, 0x41839d1e, (unsigned char*)"RSP Gfx ucode S2DEX fifo 2.05 Yoshitaka Yasumoto 1998 Nintendo.",}, // Chou Snobow Kids, + {3, 0x2cbd9514, 0xc639dbb9, (unsigned char*)"RSP Gfx ucode S2DEX xbus 2.06 Yoshitaka Yasumoto 1998 Nintendo.",}, + {3, 0xec89e273, 0xec89e273, (unsigned char*)"RSP Gfx ucode S2DEX fifo 2.08 Yoshitaka Yasumoto 1999 Nintendo.",}, // V-Rally Edition 99, + {3, 0x9429b7d6, 0x9429b7d6, (unsigned char*)"RSP Gfx ucode S2DEX xbus 2.08 Yoshitaka Yasumoto 1999 Nintendo.",}, // Star Craft, + //{14,0x5a72397b, 0xec89e273, "RSP Gfx ucode S2DEX fifo 2.08 Yoshitaka Yasumoto 1999 Nintendo.",}, // OgreBattle Background, + {3, 0x2cbd9514, 0xec89e273, (unsigned char*)"RSP Gfx ucode S2DEX fifo 2.08 Yoshitaka Yasumoto 1999 Nintendo.",}, // Zelda MM, + + {6, 0x6aef74f8, 0x6aef74f8, (unsigned char*)"Unknown 0x6aef74f8, 0x6aef74f8",}, // Diddy Kong Racing (v1.0), + {6, 0x4c4eead8, 0x4c4eead8, (unsigned char*)"Unknown 0x4c4eead8, 0x4c4eead8",}, // Diddy Kong Racing (v1.1), + + {1, 0xed421e9a, 0xed421e9a, (unsigned char*)"Unknown 0xed421e9a, 0xed421e9a",}, // Kuiki Uhabi Suigo, + {5, 0x37751932, 0x55c0fd25, (unsigned char*)"Unknown 0x37751932, 0x55c0fd25",}, // Bio Hazard 2, + {11,0xbe0b83e7, 0xbe0b83e7,(unsigned char*)"Unknown 0xbe0b83e7, 0xbe0b83e7",}, // Jet Force Gemini, + + {17, 0x02e882cf, 0x2ad17281, (unsigned char*)"Unknown 0x02e882cf, 0x2ad17281",}, // Indiana Jones, + {17, 0x1f7d9118, 0xdab2199b, (unsigned char*)"Unknown 0x1f7d9118, 0xdab2199b",}, // Battle Naboo, + {17, 0x74583614, 0x74583614, (unsigned char*)"Unknown 0x74583614, 0x74583614",}, // Star Wars - Rogue Squadron, + {17, 0xe37e2f49, 0x1eb63fd8, (unsigned char*)"Unknown 0xe37e2f49, 0x1eb63fd8",}, // Star Wars - Rogue Squadron, + {17, 0x8ce1af3d, 0xb2760ea2, (unsigned char*)"Unknown 0x8ce1af3d, 0xb2760ea2",}, // Star Wars - Rogue Squadron, + + {18, 0x7b685972, 0x57b8095a, (unsigned char*)"Unknown 0x7b685972, 0x57b8095a",}, // World Driver Championship + {18, 0xe92dbb9b, 0x57b8095a, (unsigned char*)"Unknown 0xe92dbb9b, 0x57b8095a",}, // World Driver Championship + {18, 0xe6c9acc1, 0x65f80845, (unsigned char*)"Unknown 0xe6c9acc1, 0x65f80845",}, // World Driver Championship + {18, 0x6522df69, 0x720b88a0, (unsigned char*)"Unknown 0x6522df69, 0x720b88a0",}, // World Driver Championship + {18, 0x6522df69, 0xf1e8ba9e, (unsigned char*)"Unknown 0x6522df69, 0xf1e8ba9e",}, // World Driver Championship + + {19, 0xa486bed3, 0xa486bed3, (unsigned char*)"Unknown 0xa486bed3, 0xa486bed3",}, // Last Legion UX, + {19, 0x6b519381, 0xfebacfd8, (unsigned char*)"Unknown in Toukan Road",}, // I don't know which ucode + + {20, 0x6d2a01b1, 0x6d2a01b1, (unsigned char*)"RSP Gfx ucode ZSortp 0.33 Yoshitaka Yasumoto Nintendo.",}, // Mia Hamm Soccer 64, +}; + +FiddledVtx * g_pVtxBase=NULL; + +SetImgInfo g_TI = { TXT_FMT_RGBA, TXT_SIZE_16b, 1, 0 }; +SetImgInfo g_CI = { TXT_FMT_RGBA, TXT_SIZE_16b, 1, 0 }; +SetImgInfo g_ZI = { TXT_FMT_RGBA, TXT_SIZE_16b, 1, 0 }; +RenderTextureInfo g_ZI_saves[2]; + +DListStack gDlistStack[MAX_DL_STACK_SIZE]; +int gDlistStackPointer= -1; + +TMEMLoadMapInfo g_tmemLoadAddrMap[0x200]; // Totally 4KB TMEM +TMEMLoadMapInfo g_tmemInfo0; // Info for Tmem=0 +TMEMLoadMapInfo g_tmemInfo1; // Info for Tmem=0x100 + +const char *pszImgSize[4] = {"4", "8", "16", "32"}; +const char *textluttype[4] = {"RGB16", "I16?", "RGBA16", "IA16"}; +uint16 g_wRDPTlut[0x200]; +uint32 g_dwRDPPalCrc[16]; + +#include "FrameBuffer.h" +#include "RSP_GBI0.h" +#include "RSP_GBI1.h" +#include "RSP_GBI2.h" +#include "RSP_GBI2_ext.h" +#include "RSP_GBI_Others.h" +#include "RSP_GBI_Sprite2D.h" +#include "RDP_Texture.h" + +////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////// +// Init and Reset // +////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////// + +void DLParser_Init() +{ + int i; + + status.gRDPTime = 0; + status.gDlistCount = 0; + status.gUcodeCount = 0; + status.frameReadByCPU = FALSE; + status.frameWriteByCPU = FALSE; + status.SPCycleCount = 0; + status.DPCycleCount = 0; + status.bN64IsDrawingTextureBuffer = false; + status.bDirectWriteIntoRDRAM = false; + status.bHandleN64RenderTexture = false; + + status.bUcodeIsKnown = FALSE; + status.lastPurgeTimeTime = status.gRDPTime; + + status.curRenderBuffer = 0; + status.curDisplayBuffer = 0; + status.curVIOriginReg = 0; + + status.primitiveType = PRIM_TRI1; + + status.lastPurgeTimeTime = 0; // Time textures were last purged + + status.UseLargerTile[0] = false; + status.LargerTileRealLeft[0] = status.LargerTileRealLeft[1] = 0; + memset(&g_ZI_saves, 0, sizeof(RenderTextureInfo)*2); + + for( i=0; i<8; i++ ) + { + memset(&gRDP.tiles[i], 0, sizeof(Tile)); + } + memset(g_tmemLoadAddrMap, 0, sizeof(g_tmemLoadAddrMap)); + + for( i=0; iCloseRenderTexture(false); + } +} + +void RDP_SetUcodeMap(int ucode) +{ + status.bUseModifiedUcodeMap = false; + switch( ucode ) + { + case 0: // Mario and demos + break; + case 1: // F3DEX GBI1 + case 20: + break; + case 2: // Golden Eye + memcpy( &LoadedUcodeMap, &ucodeMap0, sizeof(UcodeMap)); + //LoadedUcodeMap[9]=RSP_GBI1_Sprite2DBase; + //LoadedUcodeMap[0xaf]=RSP_GBI1_LoadUCode; + //LoadedUcodeMap[0xb0]=RSP_GBI1_BranchZ; + LoadedUcodeMap[0xb4]=DLParser_RDPHalf_1_0xb4_GoldenEye; + status.bUseModifiedUcodeMap = true; + break; + case 3: // S2DEX GBI2 + break; + case 4: + memcpy( &LoadedUcodeMap, &ucodeMap0, sizeof(UcodeMap)); + LoadedUcodeMap[4]=RSP_Vtx_WRUS; + LoadedUcodeMap[0xb1]=RSP_GBI1_Tri2; + //LoadedUcodeMap[9]=RSP_GBI1_Sprite2DBase; + //LoadedUcodeMap[0xaf]=RSP_GBI1_LoadUCode; + //LoadedUcodeMap[0xb0]=RSP_GBI1_BranchZ; + //LoadedUcodeMap[0xb2]=RSP_GBI1_ModifyVtx; + status.bUseModifiedUcodeMap = true; + break; + case 5: // F3DEX GBI2 + break; + case 6: // DKR, Jet Force Gemini, Mickey + case 11: // DKR, Jet Force Gemini, Mickey + memcpy( &LoadedUcodeMap, &ucodeMap0, sizeof(UcodeMap)); + LoadedUcodeMap[1]=RSP_Mtx_DKR; + LoadedUcodeMap[4]=RSP_Vtx_DKR; + if( ucode == 11 ) LoadedUcodeMap[4]=RSP_Vtx_Gemini; + LoadedUcodeMap[5]=RSP_DMA_Tri_DKR; + LoadedUcodeMap[7]=RSP_DL_In_MEM_DKR; + LoadedUcodeMap[0xbc]=RSP_MoveWord_DKR; + LoadedUcodeMap[0xbf]=DLParser_Set_Addr_Ucode6; + //LoadedUcodeMap[9]=RSP_GBI1_Sprite2DBase; + //LoadedUcodeMap[0xb0]=RSP_GBI1_BranchZ; + //LoadedUcodeMap[0xb2]=RSP_GBI1_ModifyVtx; + status.bUseModifiedUcodeMap = true; + break; + case 7: // S2DEX GBI1 + break; + case 8: // Ucode 0 with Sprite2D, Puzzle Master 64 + memcpy( &LoadedUcodeMap, &ucodeMap0, sizeof(UcodeMap)); + LoadedUcodeMap[RSP_SPRITE2D_BASE] = RSP_GBI_Sprite2D_PuzzleMaster64; + LoadedUcodeMap[RSP_SPRITE2D_SCALEFLIP] = RSP_GBI1_Sprite2DScaleFlip; + LoadedUcodeMap[RSP_SPRITE2D_DRAW] = RSP_GBI0_Sprite2DDraw; + status.bUseModifiedUcodeMap = true; + break; + case 9: // Perfect Dark + memcpy( &LoadedUcodeMap, &ucodeMap0, sizeof(UcodeMap)); + LoadedUcodeMap[4]=RSP_Vtx_PD; + LoadedUcodeMap[7]=RSP_Set_Vtx_CI_PD; + LoadedUcodeMap[0xb1]=RSP_Tri4_PD; + LoadedUcodeMap[0xb4]=DLParser_RDPHalf_1_0xb4_GoldenEye; + status.bUseModifiedUcodeMap = true; + break; + case 10: // Conker BFD + memcpy( &LoadedUcodeMap, &ucodeMap5, sizeof(UcodeMap)); + LoadedUcodeMap[1]=RSP_Vtx_Conker; + LoadedUcodeMap[0x10]=DLParser_Tri4_Conker; + LoadedUcodeMap[0x11]=DLParser_Tri4_Conker; + LoadedUcodeMap[0x12]=DLParser_Tri4_Conker; + LoadedUcodeMap[0x13]=DLParser_Tri4_Conker; + LoadedUcodeMap[0x14]=DLParser_Tri4_Conker; + LoadedUcodeMap[0x15]=DLParser_Tri4_Conker; + LoadedUcodeMap[0x16]=DLParser_Tri4_Conker; + LoadedUcodeMap[0x17]=DLParser_Tri4_Conker; + LoadedUcodeMap[0x18]=DLParser_Tri4_Conker; + LoadedUcodeMap[0x19]=DLParser_Tri4_Conker; + LoadedUcodeMap[0x1a]=DLParser_Tri4_Conker; + LoadedUcodeMap[0x1b]=DLParser_Tri4_Conker; + LoadedUcodeMap[0x1c]=DLParser_Tri4_Conker; + LoadedUcodeMap[0x1d]=DLParser_Tri4_Conker; + LoadedUcodeMap[0x1e]=DLParser_Tri4_Conker; + LoadedUcodeMap[0x1f]=DLParser_Tri4_Conker; + LoadedUcodeMap[0xdb]=DLParser_MoveWord_Conker; + LoadedUcodeMap[0xdc]=DLParser_MoveMem_Conker; + status.bUseModifiedUcodeMap = true; + break; + case 12: // Silicon Velley, Space Station + memcpy( &LoadedUcodeMap, &ucodeMap1, sizeof(UcodeMap)); + LoadedUcodeMap[0x01]=RSP_GBI0_Mtx; + status.bUseModifiedUcodeMap = true; + break; + case 13: // modified S2DEX + memcpy( &LoadedUcodeMap, &ucodeMap7, sizeof(UcodeMap)); + //LoadedUcodeMap[S2DEX_BG_1CYC] = ucodeMap1[S2DEX_BG_1CYC]; + LoadedUcodeMap[S2DEX_OBJ_RECTANGLE] = ucodeMap1[S2DEX_OBJ_RECTANGLE]; + LoadedUcodeMap[S2DEX_OBJ_SPRITE] = ucodeMap1[S2DEX_OBJ_SPRITE]; + //LoadedUcodeMap[S2DEX_OBJ_RENDERMODE] = ucodeMap1[S2DEX_OBJ_RENDERMODE]; + //LoadedUcodeMap[S2DEX_OBJ_RECTANGLE_R] = ucodeMap1[S2DEX_OBJ_RECTANGLE_R]; + LoadedUcodeMap[S2DEX_RDPHALF_0] = ucodeMap1[S2DEX_RDPHALF_0]; + status.bUseModifiedUcodeMap = true; + break; + case 14: // OgreBattle Background + memcpy( &LoadedUcodeMap, &ucodeMap5, sizeof(UcodeMap)); + LoadedUcodeMap[0xda] = DLParser_OgreBatter64BG; + LoadedUcodeMap[0xdc] = RSP_S2DEX_OBJ_MOVEMEM; + status.bUseModifiedUcodeMap = true; + break; + case 15: // Ucode 0 with Sprite2D + memcpy( &LoadedUcodeMap, &ucodeMap0, sizeof(UcodeMap)); + LoadedUcodeMap[RSP_SPRITE2D_BASE] = RSP_GBI_Sprite2DBase; + LoadedUcodeMap[RSP_SPRITE2D_SCALEFLIP] = RSP_GBI1_Sprite2DScaleFlip; + LoadedUcodeMap[RSP_SPRITE2D_DRAW] = RSP_GBI0_Sprite2DDraw; + status.bUseModifiedUcodeMap = true; + break; + case 16: // Star War, Shadow Of Empire + memcpy( &LoadedUcodeMap, &ucodeMap0, sizeof(UcodeMap)); + LoadedUcodeMap[4]=RSP_Vtx_ShadowOfEmpire; + status.bUseModifiedUcodeMap = true; + break; + case 17: //Indiana Jones, does not work anyway + memcpy( &LoadedUcodeMap, &ucodeMap1, sizeof(UcodeMap)); + LoadedUcodeMap[0]=DLParser_Ucode8_0x0; + //LoadedUcodeMap[1]=RSP_RDP_Nothing; + LoadedUcodeMap[2]=DLParser_RS_Color_Buffer; + LoadedUcodeMap[3]=DLParser_RS_MoveMem; + LoadedUcodeMap[4]=DLParser_RS_Vtx_Buffer; + LoadedUcodeMap[5]=DLParser_Ucode8_0x05; + LoadedUcodeMap[6]=DLParser_Ucode8_DL; + LoadedUcodeMap[7]=DLParser_Ucode8_JUMP; + LoadedUcodeMap[8]=RSP_RDP_Nothing; + LoadedUcodeMap[9]=RSP_RDP_Nothing; + LoadedUcodeMap[10]=RSP_RDP_Nothing; + LoadedUcodeMap[11]=RSP_RDP_Nothing; + LoadedUcodeMap[0x80]=DLParser_RS_Block; + LoadedUcodeMap[0xb4]=DLParser_Ucode8_0xb4; + LoadedUcodeMap[0xb5]=DLParser_Ucode8_0xb5; + LoadedUcodeMap[0xb8]=DLParser_Ucode8_EndDL; + LoadedUcodeMap[0xbc]=DLParser_Ucode8_0xbc; + LoadedUcodeMap[0xbd]=DLParser_Ucode8_0xbd; + LoadedUcodeMap[0xbe]=DLParser_RS_0xbe; + LoadedUcodeMap[0xbF]=DLParser_Ucode8_0xbf; + LoadedUcodeMap[0xe4]=DLParser_TexRect_Last_Legion; + status.bUseModifiedUcodeMap = true; + break; + case 18: // World Driver Championship + memcpy( &LoadedUcodeMap, &ucodeMap1, sizeof(UcodeMap)); + LoadedUcodeMap[0xe]=DLParser_RSP_DL_WorldDriver; + LoadedUcodeMap[0x2]=DLParser_RSP_Pop_DL_WorldDriver; + LoadedUcodeMap[0xdf]=DLParser_RSP_Pop_DL_WorldDriver; + LoadedUcodeMap[0x6]=RSP_RDP_Nothing; + status.bUseModifiedUcodeMap = true; + break; + case 19: // Last Legion UX + memcpy( &LoadedUcodeMap, &ucodeMap1, sizeof(UcodeMap)); + LoadedUcodeMap[0x80]=DLParser_RSP_Last_Legion_0x80; + LoadedUcodeMap[0x00]=DLParser_RSP_Last_Legion_0x00; + LoadedUcodeMap[0xe4]=DLParser_TexRect_Last_Legion; + status.bUseModifiedUcodeMap = true; + break; + default: + memcpy( &LoadedUcodeMap, &ucodeMap5, sizeof(UcodeMap)); + status.bUseModifiedUcodeMap = true; + break; + } + +#ifdef DEBUGGER + if( logMicrocode ) + TRACE1("Using ucode %d", ucode); +#endif +} + +void RSP_SetUcode(int ucode, uint32 ucStart, uint32 ucDStart, uint32 ucSize) +{ + if( status.ucodeHasBeenSet && gRSP.ucode == ucode ) + return; + + status.ucodeHasBeenSet = true; + + if( ucode < 0 ) + ucode = 5; + + RDP_SetUcodeMap(ucode); + if( status.bUseModifiedUcodeMap ) + { + currentUcodeMap = &LoadedUcodeMap[0]; + } + else + { + currentUcodeMap = *ucodeMaps[ucode]; + } + + gRSP.vertexMult = vertexMultVals[ucode]; + + //if( gRSP.ucode != ucode ) DebuggerAppendMsg("Set to ucode: %d", ucode); + gRSP.ucode = ucode; + + lastUcodeInfo.used = true; + if( ucStart == 0 ) + { + lastUcodeInfo.ucStart = g_pOSTask->t.ucode; + lastUcodeInfo.ucDStart = g_pOSTask->t.ucode_data; + lastUcodeInfo.ucSize = g_pOSTask->t.ucode_size; + } + else + { + lastUcodeInfo.ucStart = ucStart; + lastUcodeInfo.ucDStart = ucDStart; + lastUcodeInfo.ucSize = ucSize; + } +} + +//***************************************************************************** +// +//***************************************************************************** +static uint32 DLParser_IdentifyUcodeFromString( const unsigned char * str_ucode ) +{ + const unsigned char str_ucode0[] = "RSP SW Version: 2.0"; + const unsigned char str_ucode1[] = "RSP Gfx ucode "; + + if ( strncasecmp( (char*)str_ucode, (char*)str_ucode0, strlen((char*)str_ucode0) ) == 0 ) + { + return 0; + } + + if ( strncasecmp( (char*)str_ucode, (char*)str_ucode1, strlen((char*)str_ucode1) ) == 0 ) + { + if( strstr((char*)str_ucode,"1.") != 0 ) + { + if( strstr((char*)str_ucode,"S2DEX") != 0 ) + { + return 7; + } + else + return 1; + } + else if( strstr((char*)str_ucode,"2.") != 0 ) + { + if( strstr((char*)str_ucode,"S2DEX") != 0 ) + { + return 3; + } + else + return 5; + } + } + + return 5; +} + +//***************************************************************************** +// +//***************************************************************************** +static uint32 DLParser_IdentifyUcode( uint32 crc_size, uint32 crc_800, char* str ) +{ + for ( uint32 i = 0; i < sizeof(g_UcodeData)/sizeof(UcodeData); i++ ) + { +#ifdef DEBUGGER + if ( crc_800 == g_UcodeData[i].crc_800 ) + { + if( strlen(str)==0 || strcmp((const char *) g_UcodeData[i].ucode_name, str) == 0 ) + { + TRACE0((const char *) g_UcodeData[i].ucode_name); + } + else + { + DebuggerAppendMsg("Incorrect description for this ucode:\n%x, %x, %s",crc_800, crc_size, str); + } + status.bUcodeIsKnown = TRUE; + gRSP.bNearClip = !g_UcodeData[i].non_nearclip; + gRSP.bRejectVtx = g_UcodeData[i].reject; + DebuggerAppendMsg("Identify ucode = %d, crc = %08X, %s", g_UcodeData[i].ucode, crc_800, str); + return g_UcodeData[i].ucode; + } +#else + if ( crc_800 == g_UcodeData[i].crc_800 ) + { + status.bUcodeIsKnown = TRUE; + gRSP.bNearClip = !g_UcodeData[i].non_nearclip; + gRSP.bRejectVtx = g_UcodeData[i].reject; + return g_UcodeData[i].ucode; + } +#endif + } + +#ifdef DEBUGGER + { + static bool warned = false; + if( warned == false ) + { + warned = true; + TRACE0("Can not identify ucode for this game"); + } + } +#endif + gRSP.bNearClip = false; + gRSP.bRejectVtx = false; + status.bUcodeIsKnown = FALSE; + return ~0; +} + +uint32 DLParser_CheckUcode(uint32 ucStart, uint32 ucDStart, uint32 ucSize, uint32 ucDSize) +{ + if( options.enableHackForGames == HACK_FOR_ROGUE_SQUADRON ) + { + return 17; + } + + // Check the used ucode table first + int usedUcodeIndex = 0; + for( usedUcodeIndex=0; (unsigned int)usedUcodeIndex= ' ') + { + *p++ = g_pRDRAMs8[ base + (i ^ 3) ]; + i++; + } + *p++ = 0; + break; + } + } + } + + //if ( strcmp( str, gLastMicrocodeString ) != 0 ) + { + //uint32 size = ucDSize; + base = ucStart & 0x1fffffff; + + uint32 crc_size = ComputeCRC32( 0, &g_pRDRAMu8[ base ], 8);//size ); + uint32 crc_800 = ComputeCRC32( 0, &g_pRDRAMu8[ base ], 0x800 ); + uint32 ucode; + ucode = DLParser_IdentifyUcode( crc_size, crc_800, (char*)str ); + if ( (int)ucode == ~0 ) + { +#ifdef DEBUGGER + static bool warned=false; + //if( warned == false ) + { + char message[300]; + + sprintf(message, "Unable to find ucode to use for '%s' CRCSize: 0x%08x CRC800: 0x%08x", + str, crc_size, crc_800); + TRACE0(message); + DebugMessage(M64MSG_ERROR, message); + warned = true; + } +#endif + ucode = DLParser_IdentifyUcodeFromString(str); + if ( (int)ucode == ~0 ) + { + ucode=5; + } + } + + //DLParser_SetuCode( ucode ); + +#ifdef DEBUGGER + { + static bool warned=false; + if( warned == false ) + { + warned = true; + if( strlen((char *) str) == 0 ) + DebuggerAppendMsg("Can not find RSP string in the DLIST, CRC800: 0x%08x, CRCSize: 0x%08x", crc_800, crc_size); + else + TRACE0((char *) str); + } + } +#endif + strcpy( (char*)gLastMicrocodeString, (char*)str ); + + if( usedUcodeIndex >= MAX_UCODE_INFO ) + { + usedUcodeIndex = rand()%MAX_UCODE_INFO; + } + + UsedUcodes[usedUcodeIndex].ucStart = ucStart; + UsedUcodes[usedUcodeIndex].ucSize = ucSize; + UsedUcodes[usedUcodeIndex].ucDStart = ucDStart; + UsedUcodes[usedUcodeIndex].ucDSize = ucDSize; + UsedUcodes[usedUcodeIndex].ucode = ucode; + UsedUcodes[usedUcodeIndex].crc_800 = crc_800; + UsedUcodes[usedUcodeIndex].crc_size = crc_size; + UsedUcodes[usedUcodeIndex].used = true; + strcpy( UsedUcodes[usedUcodeIndex].rspstr, (char*)str ); + + TRACE2("New ucode has been detected:\n%s, ucode=%d", str, ucode); + + return ucode; + } +} + +extern int dlistMtxCount; +extern bool bHalfTxtScale; + +void DLParser_Process(OSTask * pTask) +{ + static int skipframe=0; + //BOOL menuWaiting = FALSE; + + dlistMtxCount = 0; + bHalfTxtScale = false; + + if ( CRender::g_pRender == NULL) + { + TriggerDPInterrupt(); + TriggerSPInterrupt(); + return; + } + + status.bScreenIsDrawn = true; + if( options.bSkipFrame ) + { + skipframe++; + if(skipframe%2) + { + TriggerDPInterrupt(); + TriggerSPInterrupt(); + return; + } + } + + if( currentRomOptions.N64RenderToTextureEmuType != TXT_BUF_NONE && defaultRomOptions.bSaveVRAM ) + { + g_pFrameBufferManager->CheckRenderTextureCRCInRDRAM(); + } + + g_pOSTask = pTask; + + DebuggerPauseCountN( NEXT_DLIST ); + status.gRDPTime = (uint32) SDL_GetTicks(); + + status.gDlistCount++; + + if ( lastUcodeInfo.ucStart != (uint32)(pTask->t.ucode) ) + { + uint32 ucode = DLParser_CheckUcode(pTask->t.ucode, pTask->t.ucode_data, pTask->t.ucode_size, pTask->t.ucode_data_size); + RSP_SetUcode(ucode, pTask->t.ucode, pTask->t.ucode_data, pTask->t.ucode_size); + DEBUGGER_PAUSE_AND_DUMP(NEXT_SWITCH_UCODE,{DebuggerAppendMsg("Pause at switching ucode");}); + } + + // Initialize stack + status.bN64FrameBufferIsUsed = false; + gDlistStackPointer=0; + gDlistStack[gDlistStackPointer].pc = (uint32)pTask->t.data_ptr; + gDlistStack[gDlistStackPointer].countdown = MAX_DL_COUNT; + DEBUGGER_PAUSE_AT_COND_AND_DUMP_COUNT_N((gDlistStack[gDlistStackPointer].pc == 0 && pauseAtNext && eventToPause==NEXT_UNKNOWN_OP), + {DebuggerAppendMsg("Start Task without DLIST: ucode=%08X, data=%08X", (uint32)pTask->t.ucode, (uint32)pTask->t.ucode_data);}); + + + // Check if we need to purge (every 5 milliseconds) + if (status.gRDPTime - status.lastPurgeTimeTime > 5) + { + gTextureManager.PurgeOldTextures(); + status.lastPurgeTimeTime = status.gRDPTime; + } + + status.dwNumDListsCulled = 0; + status.dwNumTrisRendered = 0; + status.dwNumTrisClipped = 0; + status.dwNumVertices = 0; + status.dwBiggestVertexIndex = 0; + + if( g_curRomInfo.bForceScreenClear && CGraphicsContext::needCleanScene ) + { + CRender::g_pRender->ClearBuffer(true,true); + CGraphicsContext::needCleanScene = false; + } + + SetVIScales(); + CRender::g_pRender->RenderReset(); + CRender::g_pRender->BeginRendering(); + CRender::g_pRender->SetViewport(0, 0, windowSetting.uViWidth, windowSetting.uViHeight, 0x3FF); + CRender::g_pRender->SetFillMode(options.bWinFrameMode? RICE_FILLMODE_WINFRAME : RICE_FILLMODE_SOLID); + + try + { + // The main loop + while( gDlistStackPointer >= 0 ) + { +#ifdef DEBUGGER + DEBUGGER_PAUSE_COUNT_N(NEXT_UCODE); + if( debuggerPause ) + { + DebuggerPause(); + CRender::g_pRender->SetFillMode(options.bWinFrameMode? RICE_FILLMODE_WINFRAME : RICE_FILLMODE_SOLID); + } + + if (gDlistStack[gDlistStackPointer].pc > g_dwRamSize) + { + DebuggerAppendMsg("Error: dwPC is %08X", gDlistStack[gDlistStackPointer].pc ); + break; + } +#endif + + status.gUcodeCount++; + + Gfx *pgfx = (Gfx*)&g_pRDRAMu32[(gDlistStack[gDlistStackPointer].pc>>2)]; +#ifdef DEBUGGER + LOG_UCODE("0x%08x: %08x %08x %-10s", + gDlistStack[gDlistStackPointer].pc, pgfx->words.w0, pgfx->words.w1, (gRSP.ucode!=5&&gRSP.ucode!=10)?ucodeNames_GBI1[(pgfx->words.w0>>24)]:ucodeNames_GBI2[(pgfx->words.w0>>24)]); +#endif + gDlistStack[gDlistStackPointer].pc += 8; + currentUcodeMap[pgfx->words.w0 >>24](pgfx); + + if ( gDlistStackPointer >= 0 && --gDlistStack[gDlistStackPointer].countdown < 0 ) + { + LOG_UCODE("**EndDLInMem"); + gDlistStackPointer--; + } + } + + } + catch(...) + { + TRACE0("Unknown exception happens in ProcessDList"); + TriggerDPInterrupt(); + } + + CRender::g_pRender->EndRendering(); + + if( gRSP.ucode >= 17) + TriggerDPInterrupt(); + TriggerSPInterrupt(); +} + +////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////// +// Util Functions // +////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////// + +void RDP_NOIMPL_Real(const char* op, uint32 word0, uint32 word1) +{ +#ifdef DEBUGGER + if( logWarning ) + { + TRACE0("Stack Trace"); + for( int i=0; iSetCullMode(bCullFront, bCullBack); + + BOOL bShade = (gRDP.geometryMode & G_SHADE) ? TRUE : FALSE; + BOOL bShadeSmooth = (gRDP.geometryMode & G_SHADING_SMOOTH) ? TRUE : FALSE; + if (bShade && bShadeSmooth) CRender::g_pRender->SetShadeMode( SHADE_SMOOTH ); + else CRender::g_pRender->SetShadeMode( SHADE_FLAT ); + + CRender::g_pRender->SetFogEnable( gRDP.geometryMode & G_FOG ? true : false ); + SetTextureGen((gRDP.geometryMode & G_TEXTURE_GEN) ? true : false ); + SetLighting( (gRDP.geometryMode & G_LIGHTING ) ? true : false ); + CRender::g_pRender->ZBufferEnable( gRDP.geometryMode & G_ZBUFFER ); +} + +////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////// +// DP Ucodes // +////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////// + +void DLParser_SetKeyGB(Gfx *gfx) +{ + DP_Timing(DLParser_SetKeyGB); + + gRDP.keyB = ((gfx->words.w1)>>8)&0xFF; + gRDP.keyG = ((gfx->words.w1)>>24)&0xFF; + gRDP.keyA = (gRDP.keyR+gRDP.keyG+gRDP.keyB)/3; + gRDP.fKeyA = gRDP.keyA/255.0f; +} +void DLParser_SetKeyR(Gfx *gfx) +{ + DP_Timing(DLParser_SetKeyR); + + gRDP.keyR = ((gfx->words.w1)>>8)&0xFF; + gRDP.keyA = (gRDP.keyR+gRDP.keyG+gRDP.keyB)/3; + gRDP.fKeyA = gRDP.keyA/255.0f; +} + +int g_convk0,g_convk1,g_convk2,g_convk3,g_convk4,g_convk5; +float g_convc0,g_convc1,g_convc2,g_convc3,g_convc4,g_convc5; +void DLParser_SetConvert(Gfx *gfx) +{ + DP_Timing(DLParser_SetConvert); + + int temp; + + temp = ((gfx->words.w0)>>13)&0x1FF; + g_convk0 = temp>0xFF ? -(temp-0x100) : temp; + + temp = ((gfx->words.w0)>>4)&0x1FF; + g_convk1 = temp>0xFF ? -(temp-0x100) : temp; + + temp = (gfx->words.w0)&0xF; + temp = (temp<<5)|(((gfx->words.w1)>>27)&0x1F); + g_convk2 = temp>0xFF ? -(temp-0x100) : temp; + + temp = ((gfx->words.w1)>>18)&0x1FF; + g_convk3 = temp>0xFF ? -(temp-0x100) : temp; + + temp = ((gfx->words.w1)>>9)&0x1FF; + g_convk4 = temp>0xFF ? -(temp-0x100) : temp; + + temp = (gfx->words.w1)&0x1FF; + g_convk5 = temp>0xFF ? -(temp-0x100) : temp; + + g_convc0 = g_convk5/255.0f+1.0f; + g_convc1 = g_convk0/255.0f*g_convc0; + g_convc2 = g_convk1/255.0f*g_convc0; + g_convc3 = g_convk2/255.0f*g_convc0; + g_convc4 = g_convk3/255.0f*g_convc0; +} +void DLParser_SetPrimDepth(Gfx *gfx) +{ + DP_Timing(DLParser_SetPrimDepth); + uint32 dwZ = ((gfx->words.w1) >> 16) & 0xFFFF; + uint32 dwDZ = ((gfx->words.w1) ) & 0xFFFF; + + LOG_UCODE("SetPrimDepth: 0x%08x 0x%08x - z: 0x%04x dz: 0x%04x", + gfx->words.w0, gfx->words.w1, dwZ, dwDZ); + + SetPrimitiveDepth(dwZ, dwDZ); + DEBUGGER_PAUSE(NEXT_SET_PRIM_COLOR); +} + +void DLParser_RDPSetOtherMode(Gfx *gfx) +{ + DP_Timing(DLParser_RDPSetOtherMode); + gRDP.otherMode._u32[1] = (gfx->words.w0); // High + gRDP.otherMode._u32[0] = (gfx->words.w1); // Low + + if( gRDP.otherModeH != ((gfx->words.w0) & 0x0FFFFFFF) ) + { + gRDP.otherModeH = ((gfx->words.w0) & 0x0FFFFFFF); + + uint32 dwTextFilt = (gRDP.otherModeH>>RSP_SETOTHERMODE_SHIFT_TEXTFILT)&0x3; + CRender::g_pRender->SetTextureFilter(dwTextFilt<words.w1) ) + { + if( (gRDP.otherModeL&ZMODE_DEC) != ((gfx->words.w1)&ZMODE_DEC) ) + { + if( ((gfx->words.w1)&ZMODE_DEC) == ZMODE_DEC ) + CRender::g_pRender->SetZBias( 2 ); + else + CRender::g_pRender->SetZBias( 0 ); + } + + gRDP.otherModeL = (gfx->words.w1); + + BOOL bZCompare = (gRDP.otherModeL & Z_COMPARE) ? TRUE : FALSE; + BOOL bZUpdate = (gRDP.otherModeL & Z_UPDATE) ? TRUE : FALSE; + + CRender::g_pRender->SetZCompare( bZCompare ); + CRender::g_pRender->SetZUpdate( bZUpdate ); + + uint32 dwAlphaTestMode = (gRDP.otherModeL >> RSP_SETOTHERMODE_SHIFT_ALPHACOMPARE) & 0x3; + + if ((dwAlphaTestMode) != 0) + CRender::g_pRender->SetAlphaTestEnable( TRUE ); + else + CRender::g_pRender->SetAlphaTestEnable( FALSE ); + } + + uint16 blender = gRDP.otherMode.blender; + RDP_BlenderSetting &bl = *(RDP_BlenderSetting*)(&(blender)); + if( bl.c1_m1a==3 || bl.c1_m2a == 3 || bl.c2_m1a == 3 || bl.c2_m2a == 3 ) + { + gRDP.bFogEnableInBlender = true; + } + else + { + gRDP.bFogEnableInBlender = false; + } +} + + + +void DLParser_RDPLoadSync(Gfx *gfx) +{ + DP_Timing(DLParser_RDPLoadSync); + LOG_UCODE("LoadSync: (Ignored)"); +} + +void DLParser_RDPPipeSync(Gfx *gfx) +{ + DP_Timing(DLParser_RDPPipeSync); + LOG_UCODE("PipeSync: (Ignored)"); +} +void DLParser_RDPTileSync(Gfx *gfx) +{ + DP_Timing(DLParser_RDPTileSync); + LOG_UCODE("TileSync: (Ignored)"); +} + +void DLParser_RDPFullSync(Gfx *gfx) +{ + DP_Timing(DLParser_RDPFullSync); + TriggerDPInterrupt(); +} + +void DLParser_SetScissor(Gfx *gfx) +{ + DP_Timing(DLParser_SetScissor); + + ScissorType tempScissor; + // The coords are all in 8:2 fixed point + tempScissor.x0 = ((gfx->words.w0)>>12)&0xFFF; + tempScissor.y0 = ((gfx->words.w0)>>0 )&0xFFF; + tempScissor.mode = ((gfx->words.w1)>>24)&0x03; + tempScissor.x1 = ((gfx->words.w1)>>12)&0xFFF; + tempScissor.y1 = ((gfx->words.w1)>>0 )&0xFFF; + + tempScissor.left = tempScissor.x0/4; + tempScissor.top = tempScissor.y0/4; + tempScissor.right = tempScissor.x1/4; + tempScissor.bottom = tempScissor.y1/4; + + if( options.bEnableHacks ) + { + if( g_CI.dwWidth == 0x200 && tempScissor.right == 0x200 ) + { + uint32 width = *g_GraphicsInfo.VI_WIDTH_REG & 0xFFF; + + if( width != 0x200 ) + { + // Hack for RE2 + tempScissor.bottom = tempScissor.right*tempScissor.bottom/width; + tempScissor.right = width; + } + + } + } + + if( gRDP.scissor.left != tempScissor.left || gRDP.scissor.top != tempScissor.top || + gRDP.scissor.right != tempScissor.right || gRDP.scissor.bottom != tempScissor.bottom || + gRSP.real_clip_scissor_left != tempScissor.left || gRSP.real_clip_scissor_top != tempScissor.top || + gRSP.real_clip_scissor_right != tempScissor.right || gRSP.real_clip_scissor_bottom != tempScissor.bottom) + { + memcpy(&(gRDP.scissor), &tempScissor, sizeof(ScissorType) ); + if( !status.bHandleN64RenderTexture ) + SetVIScales(); + + if( options.enableHackForGames == HACK_FOR_SUPER_BOWLING && g_CI.dwAddr%0x100 != 0 ) + { + // right half screen + gRDP.scissor.left += 160; + gRDP.scissor.right += 160; + CRender::g_pRender->SetViewport(160, 0, 320, 240, 0xFFFF); + } + + CRender::g_pRender->UpdateClipRectangle(); + CRender::g_pRender->UpdateScissor(); + CRender::g_pRender->SetViewportRender(); + } + + LOG_UCODE("SetScissor: x0=%d y0=%d x1=%d y1=%d mode=%d", + gRDP.scissor.left, gRDP.scissor.top, + gRDP.scissor.right, gRDP.scissor.bottom, + gRDP.scissor.mode); + + ///TXTRBUF_DETAIL_DUMP(DebuggerAppendMsg("SetScissor: x0=%d y0=%d x1=%d y1=%d mode=%d", gRDP.scissor.left, gRDP.scissor.top, + //gRDP.scissor.right, gRDP.scissor.bottom, gRDP.scissor.mode);); +} + + +void DLParser_FillRect(Gfx *gfx) +{ + DP_Timing(DLParser_FillRect); // fix me + status.primitiveType = PRIM_FILLRECT; + + if( status.bN64IsDrawingTextureBuffer && frameBufferOptions.bIgnore ) + { + return; + } + + if( options.enableHackForGames == HACK_FOR_MARIO_TENNIS ) + { + uint32 dwPC = gDlistStack[gDlistStackPointer].pc; // This points to the next instruction + uint32 w2 = *(uint32 *)(g_pRDRAMu8 + dwPC); + if( (w2>>24) == RDP_FILLRECT ) + { + // Mario Tennis, a lot of FillRect ucodes, skip all of them + while( (w2>>24) == RDP_FILLRECT ) + { + dwPC += 8; + w2 = *(uint32 *)(g_pRDRAMu8 + dwPC); + } + + gDlistStack[gDlistStackPointer].pc = dwPC; + return; + } + } + + uint32 x0 = (((gfx->words.w1)>>12)&0xFFF)/4; + uint32 y0 = (((gfx->words.w1)>>0 )&0xFFF)/4; + uint32 x1 = (((gfx->words.w0)>>12)&0xFFF)/4; + uint32 y1 = (((gfx->words.w0)>>0 )&0xFFF)/4; + + // Note, in some modes, the right/bottom lines aren't drawn + + LOG_UCODE(" (%d,%d) (%d,%d)", x0, y0, x1, y1); + + if( gRDP.otherMode.cycle_type >= CYCLE_TYPE_COPY ) + { + x1++; + y1++; + } + + //TXTRBUF_DETAIL_DUMP(DebuggerAppendMsg("FillRect: X0=%d, Y0=%d, X1=%d, Y1=%d, Color=0x%08X", x0, y0, x1, y1, gRDP.originalFillColor);); + + if( status.bHandleN64RenderTexture && options.enableHackForGames == HACK_FOR_BANJO_TOOIE ) + { + // Skip this + return; + } + + if (IsUsedAsDI(g_CI.dwAddr)) + { + // Clear the Z Buffer + if( x0!=0 || y0!=0 || windowSetting.uViWidth-x1>1 || windowSetting.uViHeight-y1>1) + { + if( options.enableHackForGames == HACK_FOR_GOLDEN_EYE ) + { + // GoldenEye is using double zbuffer + if( g_CI.dwAddr == g_ZI.dwAddr ) + { + // The zbuffer is the upper screen + COORDRECT rect={int(x0*windowSetting.fMultX),int(y0*windowSetting.fMultY),int(x1*windowSetting.fMultX),int(y1*windowSetting.fMultY)}; + CRender::g_pRender->ClearBuffer(false,true,rect); //Check me + LOG_UCODE(" Clearing ZBuffer"); + } + else + { + // The zbuffer is the lower screen + int h = (g_CI.dwAddr-g_ZI.dwAddr)/g_CI.dwWidth/2; + COORDRECT rect={int(x0*windowSetting.fMultX),int((y0+h)*windowSetting.fMultY),int(x1*windowSetting.fMultX),int((y1+h)*windowSetting.fMultY)}; + CRender::g_pRender->ClearBuffer(false,true,rect); //Check me + LOG_UCODE(" Clearing ZBuffer"); + } + } + else + { + COORDRECT rect={int(x0*windowSetting.fMultX),int(y0*windowSetting.fMultY),int(x1*windowSetting.fMultX),int(y1*windowSetting.fMultY)}; + CRender::g_pRender->ClearBuffer(false,true,rect); //Check me + LOG_UCODE(" Clearing ZBuffer"); + } + } + else + { + CRender::g_pRender->ClearBuffer(false,true); //Check me + LOG_UCODE(" Clearing ZBuffer"); + } + + DEBUGGER_PAUSE_AND_DUMP_COUNT_N( NEXT_FLUSH_TRI,{TRACE0("Pause after FillRect: ClearZbuffer\n");}); + DEBUGGER_PAUSE_AND_DUMP_COUNT_N( NEXT_FILLRECT, {DebuggerAppendMsg("ClearZbuffer: X0=%d, Y0=%d, X1=%d, Y1=%d, Color=0x%08X", x0, y0, x1, y1, gRDP.originalFillColor); + DebuggerAppendMsg("Pause after ClearZbuffer: Color=%08X\n", gRDP.originalFillColor);}); + + if( g_curRomInfo.bEmulateClear ) + { + // Emulating Clear, by write the memory in RDRAM + uint16 color = (uint16)gRDP.originalFillColor; + uint32 pitch = g_CI.dwWidth<<1; + long long base = (long long) (g_pRDRAMu8 + g_CI.dwAddr); + for( uint32 i =y0; iActiveTextureBuffer(); + + status.leftRendered = status.leftRendered<0 ? x0 : min((int)x0,status.leftRendered); + status.topRendered = status.topRendered<0 ? y0 : min((int)y0,status.topRendered); + status.rightRendered = status.rightRendered<0 ? x1 : max((int)x1,status.rightRendered); + status.bottomRendered = status.bottomRendered<0 ? y1 : max((int)y1,status.bottomRendered); + + g_pRenderTextureInfo->maxUsedHeight = max(g_pRenderTextureInfo->maxUsedHeight,(int)y1); + + if( status.bDirectWriteIntoRDRAM || ( x0==0 && y0==0 && (x1 == g_pRenderTextureInfo->N64Width || x1 == g_pRenderTextureInfo->N64Width-1 ) ) ) + { + if( g_pRenderTextureInfo->CI_Info.dwSize == TXT_SIZE_16b ) + { + uint16 color = (uint16)gRDP.originalFillColor; + uint32 pitch = g_pRenderTextureInfo->N64Width<<1; + long long base = (long long) (g_pRDRAMu8 + g_pRenderTextureInfo->CI_Info.dwAddr); + for( uint32 i =y0; iN64Width; + long long base = (long long) (g_pRDRAMu8 + g_pRenderTextureInfo->CI_Info.dwAddr); + for( uint32 i=y0; iN64Width || x1 == g_pRenderTextureInfo->N64Width-1 ) && gRDP.fillColor == 0) + //{ + // CRender::g_pRender->ClearBuffer(true,false); + //} + //else + { + if( gRDP.otherMode.cycle_type == CYCLE_TYPE_FILL ) + { + CRender::g_pRender->FillRect(x0, y0, x1, y1, gRDP.fillColor); + } + else + { + COLOR primColor = GetPrimitiveColor(); + CRender::g_pRender->FillRect(x0, y0, x1, y1, primColor); + } + } + } + + DEBUGGER_PAUSE_AND_DUMP_COUNT_N( NEXT_FLUSH_TRI,{TRACE0("Pause after FillRect\n");}); + DEBUGGER_PAUSE_AND_DUMP_COUNT_N( NEXT_FILLRECT, {DebuggerAppendMsg("FillRect: X0=%d, Y0=%d, X1=%d, Y1=%d, Color=0x%08X", x0, y0, x1, y1, gRDP.originalFillColor); + DebuggerAppendMsg("Pause after FillRect: Color=%08X\n", gRDP.originalFillColor);}); + } + else + { + LOG_UCODE(" Filling Rectangle"); + if( frameBufferOptions.bSupportRenderTextures || frameBufferOptions.bCheckBackBufs ) + { + if( !status.bCIBufferIsRendered ) g_pFrameBufferManager->ActiveTextureBuffer(); + + status.leftRendered = status.leftRendered<0 ? x0 : min((int)x0,status.leftRendered); + status.topRendered = status.topRendered<0 ? y0 : min((int)y0,status.topRendered); + status.rightRendered = status.rightRendered<0 ? x1 : max((int)x1,status.rightRendered); + status.bottomRendered = status.bottomRendered<0 ? y1 : max((int)y1,status.bottomRendered); + } + + if( gRDP.otherMode.cycle_type == CYCLE_TYPE_FILL ) + { + if( !status.bHandleN64RenderTexture || g_pRenderTextureInfo->CI_Info.dwSize == TXT_SIZE_16b ) + { + CRender::g_pRender->FillRect(x0, y0, x1, y1, gRDP.fillColor); + } + } + else + { + COLOR primColor = GetPrimitiveColor(); + //if( RGBA_GETALPHA(primColor) != 0 ) + { + CRender::g_pRender->FillRect(x0, y0, x1, y1, primColor); + } + } + DEBUGGER_PAUSE_AND_DUMP_COUNT_N( NEXT_FLUSH_TRI,{TRACE0("Pause after FillRect\n");}); + DEBUGGER_PAUSE_AND_DUMP_COUNT_N( NEXT_FILLRECT, {DebuggerAppendMsg("FillRect: X0=%d, Y0=%d, X1=%d, Y1=%d, Color=0x%08X", x0, y0, x1, y1, gRDP.originalFillColor); + DebuggerAppendMsg("Pause after FillRect: Color=%08X\n", gRDP.originalFillColor);}); + } +} + + +#define STORE_CI {g_CI.dwAddr = dwNewAddr;g_CI.dwFormat = dwFmt;g_CI.dwSize = dwSiz;g_CI.dwWidth = dwWidth;g_CI.bpl=dwBpl;} + +void DLParser_SetCImg(Gfx *gfx) +{ + uint32 dwFmt = gfx->setimg.fmt; + uint32 dwSiz = gfx->setimg.siz; + uint32 dwWidth = gfx->setimg.width + 1; + uint32 dwNewAddr = RSPSegmentAddr((gfx->setimg.addr)) & 0x00FFFFFF ; + uint32 dwBpl = dwWidth << dwSiz >> 1; + + TXTRBUF_DETAIL_DUMP(DebuggerAppendMsg("SetCImg: Addr=0x%08X, Fmt:%s-%sb, Width=%d\n", dwNewAddr, pszImgFormat[dwFmt], pszImgSize[dwSiz], dwWidth);); + + if( dwFmt == TXT_FMT_YUV || dwFmt == TXT_FMT_IA ) + { + WARNING(TRACE4("Check me: SetCImg Addr=0x%08X, Fmt:%s-%sb, Width=%d\n", + g_CI.dwAddr, pszImgFormat[dwFmt], pszImgSize[dwSiz], dwWidth)); + } + + LOG_UCODE(" Image: 0x%08x", RSPSegmentAddr(gfx->words.w1)); + LOG_UCODE(" Fmt: %s Size: %s Width: %d", + pszImgFormat[dwFmt], pszImgSize[dwSiz], dwWidth); + + if( g_CI.dwAddr == dwNewAddr && g_CI.dwFormat == dwFmt && g_CI.dwSize == dwSiz && g_CI.dwWidth == dwWidth ) + { + TXTRBUF_OR_CI_DETAIL_DUMP({ + TRACE0("Set CIMG to the same address, no change, skipped"); + DebuggerAppendMsg("Pause after SetCImg: Addr=0x%08X, Fmt:%s-%sb, Width=%d\n", + g_CI.dwAddr, pszImgFormat[dwFmt], pszImgSize[dwSiz], dwWidth); + }); + return; + } + + if( status.bVIOriginIsUpdated == true && currentRomOptions.screenUpdateSetting==SCREEN_UPDATE_AT_1ST_CI_CHANGE ) + { + status.bVIOriginIsUpdated=false; + CGraphicsContext::Get()->UpdateFrame(); + TXTRBUF_OR_CI_DETAIL_DUMP(TRACE0("Screen Update at 1st CI change");); + } + + if( options.enableHackForGames == HACK_FOR_SUPER_BOWLING ) + { + if( dwNewAddr%0x100 == 0 ) + { + if( dwWidth < 320 ) + { + // Left half screen + gRDP.scissor.left = 0; + gRDP.scissor.right = 160; + CRender::g_pRender->SetViewport(0, 0, 160, 240, 0xFFFF); + CRender::g_pRender->UpdateClipRectangle(); + CRender::g_pRender->UpdateScissor(); + } + else + { + gRDP.scissor.left = 0; + gRDP.scissor.right = 320; + CRender::g_pRender->SetViewport(0, 0, 320, 240, 0xFFFF); + CRender::g_pRender->UpdateClipRectangle(); + CRender::g_pRender->UpdateScissor(); + } + } + else + { + // right half screen + gRDP.scissor.left = 160; + gRDP.scissor.right = 320; + gRSP.nVPLeftN = 160; + gRSP.nVPRightN = 320; + CRender::g_pRender->UpdateClipRectangle(); + CRender::g_pRender->UpdateScissor(); + CRender::g_pRender->SetViewport(160, 0, 320, 240, 0xFFFF); + } + } + + + if( !frameBufferOptions.bUpdateCIInfo ) + { + STORE_CI; + status.bCIBufferIsRendered = false; + status.bN64IsDrawingTextureBuffer = false; + + TXTRBUF_DUMP(TRACE4("SetCImg : Addr=0x%08X, Fmt:%s-%sb, Width=%d\n", + g_CI.dwAddr, pszImgFormat[dwFmt], pszImgSize[dwSiz], dwWidth)); + + DEBUGGER_PAUSE_AND_DUMP_NO_UPDATE(NEXT_SET_CIMG, + { + DebuggerAppendMsg("Pause after SetCImg: Addr=0x%08X, Fmt:%s-%sb, Width=%d\n", + dwNewAddr, pszImgFormat[dwFmt], pszImgSize[dwSiz], dwWidth); + } + ); + return; + } + + SetImgInfo newCI; + newCI.bpl = dwBpl; + newCI.dwAddr = dwNewAddr; + newCI.dwFormat = dwFmt; + newCI.dwSize = dwSiz; + newCI.dwWidth = dwWidth; + + g_pFrameBufferManager->Set_CI_addr(newCI); +} + +void DLParser_SetZImg(Gfx *gfx) +{ + DP_Timing(DLParser_SetZImg); + LOG_UCODE(" Image: 0x%08x", RSPSegmentAddr(gfx->words.w1)); + + uint32 dwFmt = gfx->setimg.fmt; + uint32 dwSiz = gfx->setimg.siz; + uint32 dwWidth = gfx->setimg.width + 1; + uint32 dwAddr = RSPSegmentAddr((gfx->setimg.addr)); + + if( dwAddr != g_ZI_saves[0].CI_Info.dwAddr ) + { + g_ZI_saves[1].CI_Info.dwAddr = g_ZI.dwAddr; + g_ZI_saves[1].CI_Info.dwFormat = g_ZI.dwFormat; + g_ZI_saves[1].CI_Info.dwSize = g_ZI.dwSize; + g_ZI_saves[1].CI_Info.dwWidth = g_ZI.dwWidth; + g_ZI_saves[1].updateAtFrame = g_ZI_saves[0].updateAtFrame; + + g_ZI_saves[0].CI_Info.dwAddr = g_ZI.dwAddr = dwAddr; + g_ZI_saves[0].CI_Info.dwFormat = g_ZI.dwFormat = dwFmt; + g_ZI_saves[0].CI_Info.dwSize = g_ZI.dwSize = dwSiz; + g_ZI_saves[0].CI_Info.dwWidth = g_ZI.dwWidth = dwWidth; + g_ZI_saves[0].updateAtFrame = status.gDlistCount; + } + else + { + g_ZI.dwAddr = dwAddr; + g_ZI.dwFormat = dwFmt; + g_ZI.dwSize = dwSiz; + g_ZI.dwWidth = dwWidth; + } + + DEBUGGER_IF_DUMP((pauseAtNext) , + {DebuggerAppendMsg("SetZImg: Addr=0x%08X, Fmt:%s-%sb, Width=%d\n", + g_ZI.dwAddr, pszImgFormat[dwFmt], pszImgSize[dwSiz], dwWidth);} + ); + + DEBUGGER_PAUSE_AND_DUMP_NO_UPDATE(NEXT_SET_CIMG, + { + DebuggerAppendMsg("Pause after SetZImg: Addr=0x%08X, Fmt:%s-%sb, Width=%d\n", + g_ZI.dwAddr, pszImgFormat[dwFmt], pszImgSize[dwSiz], dwWidth); + } + ); +} + +bool IsUsedAsDI(uint32 addr) +{ + if( addr == g_ZI_saves[0].CI_Info.dwAddr ) + return true; + else if( addr == g_ZI_saves[1].CI_Info.dwAddr && status.gDlistCount - g_ZI_saves[1].updateAtFrame < 10 + && g_ZI_saves[1].CI_Info.dwAddr != 0 ) + return true; + else + return false; +} + +void DLParser_SetCombine(Gfx *gfx) +{ + DP_Timing(DLParser_SetCombine); + uint32 dwMux0 = (gfx->words.w0)&0x00FFFFFF; + uint32 dwMux1 = (gfx->words.w1); + CRender::g_pRender->SetMux(dwMux0, dwMux1); +} + +void DLParser_SetFillColor(Gfx *gfx) +{ + DP_Timing(DLParser_SetFillColor); + gRDP.fillColor = Convert555ToRGBA(gfx->setcolor.fillcolor); + gRDP.originalFillColor = (gfx->setcolor.color); + + LOG_UCODE(" Color5551=0x%04x = 0x%08x", (uint16)gfx->words.w1, gRDP.fillColor); + +} + +void DLParser_SetFogColor(Gfx *gfx) +{ + DP_Timing(DLParser_SetFogColor); + CRender::g_pRender->SetFogColor( gfx->setcolor.r, gfx->setcolor.g, gfx->setcolor.b, gfx->setcolor.a ); + FOG_DUMP(TRACE1("Set Fog color: %08X", gfx->setcolor.color)); +} + +void DLParser_SetBlendColor(Gfx *gfx) +{ + DP_Timing(DLParser_SetBlendColor); + CRender::g_pRender->SetAlphaRef(gfx->setcolor.a); +} + + +void DLParser_SetPrimColor(Gfx *gfx) +{ + DP_Timing(DLParser_SetPrimColor); + SetPrimitiveColor( COLOR_RGBA(gfx->setcolor.r, gfx->setcolor.g, gfx->setcolor.b, gfx->setcolor.a), + gfx->setcolor.prim_min_level, gfx->setcolor.prim_level); +} + +void DLParser_SetEnvColor(Gfx *gfx) +{ + DP_Timing(DLParser_SetEnvColor); + SetEnvColor( COLOR_RGBA(gfx->setcolor.r, gfx->setcolor.g, gfx->setcolor.b, gfx->setcolor.a) ); +} + + +void RDP_DLParser_Process(void) +{ + status.gRDPTime = (uint32) SDL_GetTicks(); + + status.gDlistCount++; + + uint32 start = *(g_GraphicsInfo.DPC_START_REG); + uint32 end = *(g_GraphicsInfo.DPC_END_REG); + + gDlistStackPointer=0; + gDlistStack[gDlistStackPointer].pc = start; + gDlistStack[gDlistStackPointer].countdown = MAX_DL_COUNT; + + // Check if we need to purge (every 5 milliseconds) + if (status.gRDPTime - status.lastPurgeTimeTime > 5) + { + gTextureManager.PurgeOldTextures(); + status.lastPurgeTimeTime = status.gRDPTime; + } + + // Lock the graphics context here. + CRender::g_pRender->SetFillMode(RICE_FILLMODE_SOLID); + + SetVIScales(); + + CRender::g_pRender->RenderReset(); + CRender::g_pRender->BeginRendering(); + CRender::g_pRender->SetViewport(0, 0, windowSetting.uViWidth, windowSetting.uViHeight, 0x3FF); + + while( gDlistStack[gDlistStackPointer].pc < end ) + { + Gfx *pgfx = (Gfx*)&g_pRDRAMu32[(gDlistStack[gDlistStackPointer].pc>>2)]; + gDlistStack[gDlistStackPointer].pc += 8; + currentUcodeMap[pgfx->words.w0 >>24](pgfx); + } + + CRender::g_pRender->EndRendering(); +} + +void RDP_TriFill(Gfx *gfx) +{ +} + +void RDP_TriFillZ(Gfx *gfx) +{ +} + +void RDP_TriTxtr(Gfx *gfx) +{ +} + +void RDP_TriTxtrZ(Gfx *gfx) +{ +} + +void RDP_TriShade(Gfx *gfx) +{ +} + +void RDP_TriShadeZ(Gfx *gfx) +{ +} + +void RDP_TriShadeTxtr(Gfx *gfx) +{ +} + +void RDP_TriShadeTxtrZ(Gfx *gfx) +{ +} + +static int crc_table_empty = 1; +static unsigned int crc_table[256]; +static void make_crc_table(void); + +static void make_crc_table() +{ + unsigned int c; + int n, k; + unsigned int poly; /* polynomial exclusive-or pattern */ + /* terms of polynomial defining this crc (except x^32): */ + static const uint8 p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; + + /* make exclusive-or pattern from polynomial (0xedb88320L) */ + poly = 0L; + for (n = 0; (unsigned int)n < sizeof(p)/sizeof(uint8); n++) + poly |= 1L << (31 - p[n]); + + for (n = 0; n < 256; n++) + { + c = (unsigned int)n; + for (k = 0; k < 8; k++) + c = (c & 1) ? (poly ^ (c >> 1)) : c >> 1; + crc_table[n] = c; + } + crc_table_empty = 0; +} + +/* ========================================================================= */ +#define DO1(buf) crc = crc_table[((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8); +#define DO2(buf) DO1(buf); DO1(buf); +#define DO4(buf) DO2(buf); DO2(buf); +#define DO8(buf) DO4(buf); DO4(buf); + +/* ========================================================================= */ +unsigned int ComputeCRC32(unsigned int crc, const uint8 *buf, unsigned int len) +{ + if (buf == NULL) + return 0L; + + if (crc_table_empty) + make_crc_table(); + + crc = crc ^ 0xffffffffL; + while (len >= 8) + { + DO8(buf); + len -= 8; + } + if (len) do { + DO1(buf); + } while (--len); + return crc ^ 0xffffffffL; +} + +Matrix matToLoad; +void LoadMatrix(uint32 addr) +{ + const float fRecip = 1.0f / 65536.0f; + if (addr + 64 > g_dwRamSize) + { + TRACE1("Mtx: Address invalid (0x%08x)", addr); + return; + } + + for (int i = 0; i < 4; i++) + { + for (int j = 0; j < 4; j++) + { + int hi = *(short *)(g_pRDRAMu8 + ((addr+(i<<3)+(j<<1) )^0x2)); + int lo = *(unsigned short *)(g_pRDRAMu8 + ((addr+(i<<3)+(j<<1) + 32)^0x2)); + matToLoad.m[i][j] = (float)((hi<<16) | lo) * fRecip; + } + } + + +#ifdef DEBUGGER + LOG_UCODE( + " %#+12.5f %#+12.5f %#+12.5f %#+12.5f\r\n" + " %#+12.5f %#+12.5f %#+12.5f %#+12.5f\r\n" + " %#+12.5f %#+12.5f %#+12.5f %#+12.5f\r\n" + " %#+12.5f %#+12.5f %#+12.5f %#+12.5f\r\n", + matToLoad.m[0][0], matToLoad.m[0][1], matToLoad.m[0][2], matToLoad.m[0][3], + matToLoad.m[1][0], matToLoad.m[1][1], matToLoad.m[1][2], matToLoad.m[1][3], + matToLoad.m[2][0], matToLoad.m[2][1], matToLoad.m[2][2], matToLoad.m[2][3], + matToLoad.m[3][0], matToLoad.m[3][1], matToLoad.m[3][2], matToLoad.m[3][3]); +#endif // DEBUGGER +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/RSP_Parser.h b/libmupen64plus/mupen64plus-video-rice/src/RSP_Parser.h new file mode 100644 index 0000000000..2e4b6ae624 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/RSP_Parser.h @@ -0,0 +1,630 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + + +#ifndef __RICE_RDP_GFX_H__ +#define __RICE_RDP_GFX_H__ + +#define RSP_SPNOOP 0 // handle 0 gracefully +#define RSP_MTX 1 +#define RSP_RESERVED0 2 // unknown +#define RSP_MOVEMEM 3 // move a block of memory (up to 4 words) to dmem +#define RSP_VTX 4 +#define RSP_RESERVED1 5 // unknown +#define RSP_DL 6 +#define RSP_RESERVED2 7 // unknown +#define RSP_RESERVED3 8 // unknown +#define RSP_SPRITE2D 9 // sprite command +#define RSP_SPRITE2D_BASE 9 // sprite command + + +#define RSP_1ST 0xBF +#define RSP_TRI1 (RSP_1ST-0) +#define RSP_CULLDL (RSP_1ST-1) +#define RSP_POPMTX (RSP_1ST-2) +#define RSP_MOVEWORD (RSP_1ST-3) +#define RSP_TEXTURE (RSP_1ST-4) +#define RSP_SETOTHERMODE_H (RSP_1ST-5) +#define RSP_SETOTHERMODE_L (RSP_1ST-6) +#define RSP_ENDDL (RSP_1ST-7) +#define RSP_SETGEOMETRYMODE (RSP_1ST-8) +#define RSP_CLEARGEOMETRYMODE (RSP_1ST-9) +#define RSP_LINE3D (RSP_1ST-10) +#define RSP_RDPHALF_1 (RSP_1ST-11) +#define RSP_RDPHALF_2 (RSP_1ST-12) +#define RSP_RDPHALF_CONT (RSP_1ST-13) + +#define RSP_MODIFYVTX (RSP_1ST-13) +#define RSP_TRI2 (RSP_1ST-14) +#define RSP_BRANCH_Z (RSP_1ST-15) +#define RSP_LOAD_UCODE (RSP_1ST-16) + +#define RSP_SPRITE2D_SCALEFLIP (RSP_1ST-1) +#define RSP_SPRITE2D_DRAW (RSP_1ST-2) + +#define RSP_ZELDAVTX 1 +#define RSP_ZELDAMODIFYVTX 2 +#define RSP_ZELDACULLDL 3 +#define RSP_ZELDABRANCHZ 4 +#define RSP_ZELDATRI1 5 +#define RSP_ZELDATRI2 6 +#define RSP_ZELDALINE3D 7 +#define RSP_ZELDARDPHALF_2 0xf1 +#define RSP_ZELDASETOTHERMODE_H 0xe3 +#define RSP_ZELDASETOTHERMODE_L 0xe2 +#define RSP_ZELDARDPHALF_1 0xe1 +#define RSP_ZELDASPNOOP 0xe0 +#define RSP_ZELDAENDDL 0xdf +#define RSP_ZELDADL 0xde +#define RSP_ZELDALOAD_UCODE 0xdd +#define RSP_ZELDAMOVEMEM 0xdc +#define RSP_ZELDAMOVEWORD 0xdb +#define RSP_ZELDAMTX 0xda +#define RSP_ZELDAGEOMETRYMODE 0xd9 +#define RSP_ZELDAPOPMTX 0xd8 +#define RSP_ZELDATEXTURE 0xd7 +#define RSP_ZELDASUBMODULE 0xd6 + +// 4 is something like a conditional DL +#define RSP_DMATRI 0x05 +#define G_DLINMEM 0x07 + +// RDP commands: +#define RDP_NOOP 0xc0 +#define RDP_SETCIMG 0xff +#define RDP_SETZIMG 0xfe +#define RDP_SETTIMG 0xfd +#define RDP_SETCOMBINE 0xfc +#define RDP_SETENVCOLOR 0xfb +#define RDP_SETPRIMCOLOR 0xfa +#define RDP_SETBLENDCOLOR 0xf9 +#define RDP_SETFOGCOLOR 0xf8 +#define RDP_SETFILLCOLOR 0xf7 +#define RDP_FILLRECT 0xf6 +#define RDP_SETTILE 0xf5 +#define RDP_LOADTILE 0xf4 +#define RDP_LOADBLOCK 0xf3 +#define RDP_SETTILESIZE 0xf2 +#define RDP_LOADTLUT 0xf0 +#define RDP_RDPSETOTHERMODE 0xef +#define RDP_SETPRIMDEPTH 0xee +#define RDP_SETSCISSOR 0xed +#define RDP_SETCONVERT 0xec +#define RDP_SETKEYR 0xeb +#define RDP_SETKEYGB 0xea +#define RDP_FULLSYNC 0xe9 +#define RDP_TILESYNC 0xe8 +#define RDP_PIPESYNC 0xe7 +#define RDP_LOADSYNC 0xe6 +#define RDP_TEXRECT_FLIP 0xe5 +#define RDP_TEXRECT 0xe4 + + + + +#define RSP_ZELDA_MTX_MODELVIEW 0x00 +#define RSP_ZELDA_MTX_PROJECTION 0x04 +#define RSP_ZELDA_MTX_MUL 0x00 +#define RSP_ZELDA_MTX_LOAD 0x02 +#define RSP_ZELDA_MTX_PUSH 0x00 +#define RSP_ZELDA_MTX_NOPUSH 0x01 + + + +// +// RSP_SETOTHERMODE_L sft: shift count + +#define RSP_SETOTHERMODE_SHIFT_ALPHACOMPARE 0 +#define RSP_SETOTHERMODE_SHIFT_ZSRCSEL 2 +#define RSP_SETOTHERMODE_SHIFT_RENDERMODE 3 +#define RSP_SETOTHERMODE_SHIFT_BLENDER 16 + +// +// RSP_SETOTHERMODE_H sft: shift count + +#define RSP_SETOTHERMODE_SHIFT_BLENDMASK 0 // unsupported +#define RSP_SETOTHERMODE_SHIFT_ALPHADITHER 4 +#define RSP_SETOTHERMODE_SHIFT_RGBDITHER 6 + +#define RSP_SETOTHERMODE_SHIFT_COMBKEY 8 +#define RSP_SETOTHERMODE_SHIFT_TEXTCONV 9 +#define RSP_SETOTHERMODE_SHIFT_TEXTFILT 12 +#define RSP_SETOTHERMODE_SHIFT_TEXTLUT 14 +#define RSP_SETOTHERMODE_SHIFT_TEXTLOD 16 +#define RSP_SETOTHERMODE_SHIFT_TEXTDETAIL 17 +#define RSP_SETOTHERMODE_SHIFT_TEXTPERSP 19 +#define RSP_SETOTHERMODE_SHIFT_CYCLETYPE 20 +#define RSP_SETOTHERMODE_SHIFT_COLORDITHER 22 // unsupported in HW 2.0 +#define RSP_SETOTHERMODE_SHIFT_PIPELINE 23 + +// RSP_SETOTHERMODE_H gPipelineMode +#define RSP_PIPELINE_MODE_1PRIMITIVE (1 << RSP_SETOTHERMODE_SHIFT_PIPELINE) +#define RSP_PIPELINE_MODE_NPRIMITIVE (0 << RSP_SETOTHERMODE_SHIFT_PIPELINE) + +// RSP_SETOTHERMODE_H gSetCycleType +#define CYCLE_TYPE_1 0 +#define CYCLE_TYPE_2 1 +#define CYCLE_TYPE_COPY 2 +#define CYCLE_TYPE_FILL 3 + +// RSP_SETOTHERMODE_H gSetTextureLUT +#define TLUT_FMT_NONE (0 << RSP_SETOTHERMODE_SHIFT_TEXTLUT) +#define TLUT_FMT_UNKNOWN (1 << RSP_SETOTHERMODE_SHIFT_TEXTLUT) +#define TLUT_FMT_RGBA16 (2 << RSP_SETOTHERMODE_SHIFT_TEXTLUT) +#define TLUT_FMT_IA16 (3 << RSP_SETOTHERMODE_SHIFT_TEXTLUT) + +// RSP_SETOTHERMODE_H gSetTextureFilter +#define RDP_TFILTER_POINT (0 << RSP_SETOTHERMODE_SHIFT_TEXTFILT) +#define RDP_TFILTER_AVERAGE (3 << RSP_SETOTHERMODE_SHIFT_TEXTFILT) +#define RDP_TFILTER_BILERP (2 << RSP_SETOTHERMODE_SHIFT_TEXTFILT) + +// RSP_SETOTHERMODE_L gSetAlphaCompare +#define RDP_ALPHA_COMPARE_NONE (0 << RSP_SETOTHERMODE_SHIFT_ALPHACOMPARE) +#define RDP_ALPHA_COMPARE_THRESHOLD (1 << RSP_SETOTHERMODE_SHIFT_ALPHACOMPARE) +#define RDP_ALPHA_COMPARE_DITHER (3 << RSP_SETOTHERMODE_SHIFT_ALPHACOMPARE) + +// RSP_SETOTHERMODE_L gSetRenderMode +#define Z_COMPARE 0x0010 +#define Z_UPDATE 0x0020 +#define ZMODE_DEC 0x0c00 + + +// +// flags for RSP_SETGEOMETRYMODE +// +#define G_ZBUFFER 0x00000001 +#define G_TEXTURE_ENABLE 0x00000002 // Microcode use only +#define G_SHADE 0x00000004 // enable Gouraud interp +// +#define G_SHADING_SMOOTH 0x00000200 // flat or smooth shaded +#define G_CULL_FRONT 0x00001000 +#define G_CULL_BACK 0x00002000 +#define G_CULL_BOTH 0x00003000 // To make code cleaner +#define G_FOG 0x00010000 +#define G_LIGHTING 0x00020000 +#define G_TEXTURE_GEN 0x00040000 +#define G_TEXTURE_GEN_LINEAR 0x00080000 +#define G_LOD 0x00100000 // NOT IMPLEMENTED + +// +// G_SETIMG fmt: set image formats +// +#define TXT_FMT_RGBA 0 +#define TXT_FMT_YUV 1 +#define TXT_FMT_CI 2 +#define TXT_FMT_IA 3 +#define TXT_FMT_I 4 + +// +// G_SETIMG siz: set image pixel size +// +#define TXT_SIZE_4b 0 +#define TXT_SIZE_8b 1 +#define TXT_SIZE_16b 2 +#define TXT_SIZE_32b 3 + +// +// Texturing macros +// + +#define RDP_TXT_LOADTILE 7 +#define RDP_TXT_RENDERTILE 0 + +#define RDP_TXT_NOMIRROR 0 +#define RDP_TXT_WRAP 0 +#define RDP_TXT_MIRROR 0x1 +#define RDP_TXT_CLAMP 0x2 +#define RDP_TXT_NOMASK 0 +#define RDP_TXT_NOLOD 0 + + + +// +// MOVEMEM indices +// +// Each of these indexes an entry in a dmem table +// which points to a 1-4 word block of dmem in +// which to store a 1-4 word DMA. +// +// +#define RSP_GBI1_MV_MEM_VIEWPORT 0x80 +#define RSP_GBI1_MV_MEM_LOOKATY 0x82 +#define RSP_GBI1_MV_MEM_LOOKATX 0x84 +#define RSP_GBI1_MV_MEM_L0 0x86 +#define RSP_GBI1_MV_MEM_L1 0x88 +#define RSP_GBI1_MV_MEM_L2 0x8a +#define RSP_GBI1_MV_MEM_L3 0x8c +#define RSP_GBI1_MV_MEM_L4 0x8e +#define RSP_GBI1_MV_MEM_L5 0x90 +#define RSP_GBI1_MV_MEM_L6 0x92 +#define RSP_GBI1_MV_MEM_L7 0x94 +#define RSP_GBI1_MV_MEM_TXTATT 0x96 +#define RSP_GBI1_MV_MEM_MATRIX_1 0x9e // NOTE: this is in moveword table +#define RSP_GBI1_MV_MEM_MATRIX_2 0x98 +#define RSP_GBI1_MV_MEM_MATRIX_3 0x9a +#define RSP_GBI1_MV_MEM_MATRIX_4 0x9c + +# define RSP_GBI2_MV_MEM__VIEWPORT 8 +# define RSP_GBI2_MV_MEM__LIGHT 10 +# define RSP_GBI2_MV_MEM__POINT 12 +# define RSP_GBI2_MV_MEM__MATRIX 14 /* NOTE: this is in moveword table */ +# define RSP_GBI2_MV_MEM_O_LOOKATX (0*24) +# define RSP_GBI2_MV_MEM_O_LOOKATY (1*24) +# define RSP_GBI2_MV_MEM_O_L0 (2*24) +# define RSP_GBI2_MV_MEM_O_L1 (3*24) +# define RSP_GBI2_MV_MEM_O_L2 (4*24) +# define RSP_GBI2_MV_MEM_O_L3 (5*24) +# define RSP_GBI2_MV_MEM_O_L4 (6*24) +# define RSP_GBI2_MV_MEM_O_L5 (7*24) +# define RSP_GBI2_MV_MEM_O_L6 (8*24) +# define RSP_GBI2_MV_MEM_O_L7 (9*24) + + +// +// MOVEWORD indices +// +// Each of these indexes an entry in a dmem table +// which points to a word in dmem in dmem where +// an immediate word will be stored. +// +// +#define RSP_MOVE_WORD_MATRIX 0x00 // NOTE: also used by movemem +#define RSP_MOVE_WORD_NUMLIGHT 0x02 +#define RSP_MOVE_WORD_CLIP 0x04 +#define RSP_MOVE_WORD_SEGMENT 0x06 +#define RSP_MOVE_WORD_FOG 0x08 +#define RSP_MOVE_WORD_LIGHTCOL 0x0a +#define RSP_MOVE_WORD_POINTS 0x0c +#define RSP_MOVE_WORD_PERSPNORM 0x0e + +// +// These are offsets from the address in the dmem table +// +#define RSP_MV_WORD_OFFSET_NUMLIGHT 0x00 +#define RSP_MV_WORD_OFFSET_CLIP_RNX 0x04 +#define RSP_MV_WORD_OFFSET_CLIP_RNY 0x0c +#define RSP_MV_WORD_OFFSET_CLIP_RPX 0x14 +#define RSP_MV_WORD_OFFSET_CLIP_RPY 0x1c +#define RSP_MV_WORD_OFFSET_FOG 0x00 +#define RSP_MV_WORD_OFFSET_POINT_RGBA 0x10 +#define RSP_MV_WORD_OFFSET_POINT_ST 0x14 +#define RSP_MV_WORD_OFFSET_POINT_XYSCREEN 0x18 +#define RSP_MV_WORD_OFFSET_POINT_ZSCREEN 0x1c + + + +// flags to inhibit pushing of the display list (on branch) +#define RSP_DLIST_PUSH 0x00 +#define RSP_DLIST_NOPUSH 0x01 + + +// +// RSP_MTX: parameter flags +// +#define RSP_MATRIX_MODELVIEW 0x00 +#define RSP_MATRIX_PROJECTION 0x01 + +#define RSP_MATRIX_MUL 0x00 +#define RSP_MATRIX_LOAD 0x02 + +#define RSP_MATRIX_NOPUSH 0x00 +#define RSP_MATRIX_PUSH 0x04 + + + +typedef struct +{ + uint32 type; + uint32 flags; + + uint32 ucode_boot; + uint32 ucode_boot_size; + + uint32 ucode; + uint32 ucode_size; + + uint32 ucode_data; + uint32 ucode_data_size; + + uint32 dram_stack; + uint32 dram_stack_size; + + uint32 output_buff; + uint32 output_buff_size; + + uint32 data_ptr; + uint32 data_size; + + uint32 yield_data_ptr; + uint32 yield_data_size; +} OSTask_t; + +typedef union { + OSTask_t t; + uint64 force_structure_alignment; +} OSTask; + +#define MAX_DL_STACK_SIZE 32 +#define MAX_DL_COUNT 1000000 + +typedef struct { + bool used; + uint32 crc_size; + uint32 crc_800; + uint32 ucode; + uint32 minor_ver; + uint32 variant; + char rspstr[200]; + + uint32 ucStart; + uint32 ucSize; + uint32 ucDStart; + uint32 ucDSize; + uint32 ucCRC; + uint32 ucDWORD1; + uint32 ucDWORD2; + uint32 ucDWORD3; + uint32 ucDWORD4; +} UcodeInfo; + + +typedef struct +{ + uint32 ucode; + uint32 crc_size; + uint32 crc_800; + const unsigned char * ucode_name; + bool non_nearclip; + bool reject; +} UcodeData; + +struct TileDescriptor +{ + // Set by SetTile + unsigned int dwFormat :3; // e.g. RGBA, YUV etc + unsigned int dwSize :2; // e.g 4/8/16/32bpp + unsigned int dwLine :9; // Ummm... + unsigned int dwPalette :4; // 0..15 - a palette index? + uint32 dwTMem; // Texture memory location + + unsigned int bClampS :1; + unsigned int bClampT :1; + unsigned int bMirrorS :1; + unsigned int bMirrorT :1; + + unsigned int dwMaskS :4; + unsigned int dwMaskT :4; + unsigned int dwShiftS :4; + unsigned int dwShiftT :4; + + // Set by SetTileSize + unsigned int sl :10; // Upper left S - 8:3 + unsigned int tl :10; // Upper Left T - 8:3 + unsigned int sh :10; // Lower Right S + unsigned int th :10; // Lower Right T +}; + +enum LoadType +{ + BY_NEVER_SET, + BY_LOAD_BLOCK, + BY_LOAD_TILE, + BY_LOAD_TLUT, +}; + +struct LoadCmdInfo +{ + LoadType loadtype; + unsigned int sl :10; // Upper left S - 8:3 + unsigned int tl :10; // Upper Left T - 8:3 + unsigned int sh :10; // Lower Right S + unsigned int th :10; // Lower Right T + unsigned int dxt :12; +}; + +typedef struct { // This is in Intel format + uint32 SourceImagePointer; + uint32 TlutPointer; + + short SubImageWidth; + short Stride; + + char SourceImageBitSize; + char SourceImageType; + short SubImageHeight; + + short SourceImageOffsetT; + short SourceImageOffsetS; + + char dummy[4]; +} SpriteStruct; //Converted Sprint struct in Intel format + +typedef struct{ + short px; + short py; + float scaleX; + float scaleY; + uint8 flipX; + uint8 flipY; + SpriteStruct *spritePtr; +} Sprite2DInfo; + + +typedef struct +{ + unsigned int c2_m2b:2; + unsigned int c1_m2b:2; + unsigned int c2_m2a:2; + unsigned int c1_m2a:2; + unsigned int c2_m1b:2; + unsigned int c1_m1b:2; + unsigned int c2_m1a:2; + unsigned int c1_m1a:2; +} RDP_BlenderSetting; + +typedef struct +{ + union + { + struct + { + // Low bits + unsigned int alpha_compare : 2; // 0..1 + unsigned int depth_source : 1; // 2..2 + + // unsigned int render_mode : 13; // 3..15 + unsigned int aa_en : 1; // 3 + unsigned int z_cmp : 1; // 4 + unsigned int z_upd : 1; // 5 + unsigned int im_rd : 1; // 6 + unsigned int clr_on_cvg : 1; // 7 + + unsigned int cvg_dst : 2; // 8..9 + unsigned int zmode : 2; // 10..11 + + unsigned int cvg_x_alpha : 1; // 12 + unsigned int alpha_cvg_sel : 1; // 13 + unsigned int force_bl : 1; // 14 + unsigned int tex_edge : 1; // 15 - Not used + + unsigned int blender : 16; // 16..31 + + // High bits + unsigned int blend_mask : 4; // 0..3 - not supported + unsigned int alpha_dither : 2; // 4..5 + unsigned int rgb_dither : 2; // 6..7 + + unsigned int key_en : 1; // 8..8 + unsigned int text_conv : 3; // 9..11 + unsigned int text_filt : 2; // 12..13 + unsigned int text_tlut : 2; // 14..15 + + unsigned int text_lod : 1; // 16..16 + unsigned int text_sharpen : 1; // 17..18 + unsigned int text_detail : 1; // 17..18 + unsigned int text_persp : 1; // 19..19 + unsigned int cycle_type : 2; // 20..21 + unsigned int reserved : 1; // 22..22 - not supported + unsigned int atomic_prim : 1; // 23..23 + + unsigned int pad : 8; // 24..31 - padding + + }; + uint64 _u64; + uint32 _u32[2]; + }; +} RDP_OtherMode; + + +typedef enum +{ + CMD_SETTILE, + CMD_SETTILE_SIZE, + CMD_LOADBLOCK, + CMD_LOADTILE, + CMD_LOADTLUT, + CMD_SET_TEXTURE, + CMD_LOAD_OBJ_TXTR, +} SetTileCmdType; + + +// The display list PC stack. Before this was an array of 10 +// items, but this way we can nest as deeply as necessary. + +typedef struct +{ + uint32 pc; + int countdown; +} DListStack; + +typedef struct +{ + int x0, y0, x1, y1, mode; + int left, top, right, bottom; +} ScissorType; + +// Mask down to 0x003FFFFF? +#define RSPSegmentAddr(seg) ( gRSP.segments[((seg)>>24)&0x0F] + ((seg)&0x00FFFFFF) ) +#define RDRAM_UWORD(addr) (*(uint32 *)((addr)+g_pRDRAMu8)) +#define RDRAM_SWORD(addr) (*(s32 *)((addr)+g_pRDRAMu8)) +#define RDRAM_UHALF(addr) (*(uint16 *)(((addr)^2)+g_pRDRAMu8)) +#define RDRAM_SHALF(addr) (*(short *)(((addr)^2)+g_pRDRAMu8)) +#define RDRAM_UBYTE(addr) (*(uint8 *)(((addr)^3)+g_pRDRAMu8)) +#define RDRAM_SBYTE(addr) (*(s8 *)(((addr)^3)+g_pRDRAMu8)) +#define pRDRAM_UWORD(addr) ((uint32 *)((addr)+g_pRDRAMu8)) +#define pRDRAM_SWORD(addr) ((s32 *)((addr)+g_pRDRAMu8)) +#define pRDRAM_UHALF(addr) ((uint16 *)(((addr)^2)+g_pRDRAMu8)) +#define pRDRAM_SHALF(addr) ((short *)(((addr)^2)+g_pRDRAMu8)) +#define pRDRAM_UBYTE(addr) ((uint8 *)(((addr)^3)+g_pRDRAMu8)) +#define pRDRAM_SBYTE(addr) ((s8 *)(((addr)^3)+g_pRDRAMu8)) + +extern uint16 g_wRDPTlut[]; +extern const char *textluttype[4]; + +extern const char *pszImgFormat[8]; +extern const char *pszImgSize[4]; +extern uint8 pnImgSize[4]; +extern const char *textlutname[4]; + +extern SetImgInfo g_CI; +extern SetImgInfo g_ZI; +extern SetImgInfo g_TI; +extern TmemType g_Tmem; + +extern DListStack gDlistStack[MAX_DL_STACK_SIZE]; + +extern int gDlistStackPointer; + +void DLParser_Init(); +void RDP_GFX_Reset(); +void RDP_Cleanup(); +void DLParser_Process(OSTask * pTask); +void RDP_DLParser_Process(void); + +void PrepareTextures(); +void RDP_InitRenderState(); +void DisplayVertexInfo(uint32 dwAddr, uint32 dwV0, uint32 dwN); +void RSP_MoveMemLight(uint32 dwLight, uint32 dwAddr); +void RSP_MoveMemViewport(uint32 dwAddr); +void RDP_NOIMPL_WARN(const char* op); +void RSP_GFX_Force_Matrix(uint32 dwAddr); +void RSP_GFX_InitGeometryMode(); +void RSP_SetUcode(int ucode, uint32 ucStart=0, uint32 ucDStart=0, uint32 cdSize=0); +uint32 CalcalateCRC(uint32* srcPtr, uint32 srcSize); +void RDP_GFX_PopDL(); + +extern Matrix matToLoad; +void LoadMatrix(uint32 addr); + +unsigned int ComputeCRC32(unsigned int crc, const uint8 *buf, unsigned int len); + +void TriggerDPInterrupt(); +void TriggerSPInterrupt(); +uint32 DLParser_CheckUcode(uint32 ucStart, uint32 ucDStart, uint32 ucSize, uint32 ucDSize); + +bool IsUsedAsDI(uint32 addr); + +#if defined(DEBUGGER) + void __cdecl LOG_UCODE(const char* szFormat, ...); +#else + inline void LOG_UCODE(...) {} +#endif + +#endif // __RICE_RDP_GFX_H__ + diff --git a/libmupen64plus/mupen64plus-video-rice/src/RSP_S2DEX.cpp b/libmupen64plus/mupen64plus-video-rice/src/RSP_S2DEX.cpp new file mode 100644 index 0000000000..7623360737 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/RSP_S2DEX.cpp @@ -0,0 +1,566 @@ +/* +Copyright (C) 2002 Rice1964 + +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. + +*/ + + +// This file implements the S2DEX ucode, Yoshi story is using this ucodes + +#include "UcodeDefs.h" +#include "Render.h" +#include "Timing.h" + +uObjTxtr *gObjTxtr = NULL; +uObjTxtrTLUT *gObjTlut = NULL; +uint32 gObjTlutAddr = 0; +uObjMtx *gObjMtx = NULL; +uObjSubMtx *gSubObjMtx = NULL; +uObjMtxReal gObjMtxReal = {1, 0, 0, 1, 0, 0, 0, 0}; +Matrix g_MtxReal(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1); + +uint32 g_TxtLoadBy = CMD_LOAD_OBJ_TXTR; + + +// Yoshi's Story uses this - 0x02 +void RSP_S2DEX_BG_COPY(Gfx *gfx) +{ + SP_Timing(DP_Minimal16); + DP_Timing(DP_Minimal16); + + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + uObjBg *sbgPtr = (uObjBg*)(g_pRDRAMu8+dwAddr); + CRender::g_pRender->LoadObjBGCopy(*sbgPtr); + CRender::g_pRender->DrawObjBGCopy(*sbgPtr); +} + +// Yoshi's Story uses this - 0x03 +void RSP_S2DEX_OBJ_RECTANGLE(Gfx *gfx) +{ + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + uObjSprite *ptr = (uObjSprite*)(g_pRDRAMu8+dwAddr); + + uObjTxSprite objtx; + memcpy(&objtx.sprite,ptr,sizeof(uObjSprite)); + + if( g_TxtLoadBy == CMD_LOAD_OBJ_TXTR ) + { + memcpy(&(objtx.txtr.block),&(gObjTxtr->block),sizeof(uObjTxtr)); + CRender::g_pRender->LoadObjSprite(objtx,true); + } + else + { + PrepareTextures(); + } + CRender::g_pRender->DrawSprite(objtx, false); + +#ifdef DEBUGGER + if( (pauseAtNext && (eventToPause == NEXT_OBJ_TXT_CMD||eventToPause == NEXT_FLUSH_TRI)) || logTextures ) + { + if( debuggerPauseCount > 0 ) + debuggerPauseCount--; + if( debuggerPauseCount == 0 ) + { + eventToPause = false; + debuggerPause = true; + TRACE3("Paused at RSP_S2DEX_OBJ_RECTANGLE\nptr=%08X, img=%08X, Tmem=%08X", + dwAddr,objtx.txtr.block.image, ptr->imageAdrs); + CGraphicsContext::g_pGraphicsContext->UpdateFrame(); + } + } +#endif +} + +// Yoshi's Story uses this - 0x04 +void RSP_S2DEX_OBJ_SPRITE(Gfx *gfx) +{ + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + uObjSprite *info = (uObjSprite*)(g_pRDRAMu8+dwAddr); + + uint32 dwTile = gRSP.curTile; + status.bAllowLoadFromTMEM = false; // Because we need to use TLUT loaded by ObjTlut cmd + PrepareTextures(); + status.bAllowLoadFromTMEM = true; + + //CRender::g_pRender->SetCombinerAndBlender(); + + uObjTxSprite drawinfo; + memcpy( &(drawinfo.sprite), info, sizeof(uObjSprite)); + CRender::g_pRender->DrawSpriteR(drawinfo, false, dwTile, 0, 0, drawinfo.sprite.imageW/32, drawinfo.sprite.imageH/32); + + + /* + static BOOL bWarned = FALSE; + //if (!bWarned) + { + RSP_RDP_NOIMPL("RDP: RSP_S2DEX_OBJ_SPRITE (0x%08x 0x%08x)", (gfx->words.w0), (gfx->words.w1)); + bWarned = TRUE; + } + */ + +#ifdef DEBUGGER + if( (pauseAtNext && (eventToPause == NEXT_OBJ_TXT_CMD||eventToPause == NEXT_FLUSH_TRI)) || logTextures ) + { + eventToPause = false; + debuggerPause = true; + TRACE0("Paused at RSP_S2DEX_OBJ_SPRITE"); + CGraphicsContext::g_pGraphicsContext->UpdateFrame(); + } +#endif +} + +// Yoshi's Story uses this - 0xb0 +void RSP_S2DEX_SELECT_DL(Gfx *gfx) +{ + //static BOOL bWarned = FALSE; + //if (!bWarned) + { + RSP_RDP_NOIMPL("RDP: RSP_S2DEX_SELECT_DL (0x%08x 0x%08x)", (gfx->words.w0), (gfx->words.w1)); + //bWarned = TRUE; + } + + DEBUGGER_PAUSE_AND_DUMP_COUNT_N(NEXT_OBJ_TXT_CMD, {DebuggerAppendMsg("Paused at RSP_S2DEX_SELECT_DL");}); +} + +void RSP_S2DEX_OBJ_RENDERMODE(Gfx *gfx) +{ + /* + static BOOL bWarned = FALSE; + //if (!bWarned) + { + RSP_RDP_NOIMPL("RDP: RSP_S2DEX_OBJ_RENDERMODE (0x%08x 0x%08x)", (gfx->words.w0), (gfx->words.w1)); + bWarned = TRUE; + } + */ +} + +// Yoshi's Story uses this - 0xb1 +void RSP_GBI1_Tri2(Gfx *gfx); +void RSP_S2DEX_OBJ_RENDERMODE_2(Gfx *gfx) +{ + if( ((gfx->words.w0)&0xFFFFFF) != 0 || ((gfx->words.w1)&0xFFFFFF00) != 0 ) + { + // This is a TRI2 cmd + RSP_GBI1_Tri2(gfx); + return; + } + + RSP_S2DEX_OBJ_RENDERMODE(gfx); +} + +#ifdef DEBUGGER +void DumpBlockParameters(uObjTxtrBlock &ptr) +{ + /* + typedef struct { //Intel format + uint32 type; // S2DEX_OBJLT_TXTRBLOCK divided into types. + uint64 *image; // The texture source address on DRAM. + + uint16 tsize; // The Texture size. Specified by the macro GS_TB_TSIZE(). + uint16 tmem; // The transferred TMEM word address. (8byteWORD) + + uint16 sid; // STATE ID Multipled by 4. Either one of 0,4,8 and 12. + uint16 tline; // The width of the Texture 1-line. Specified by the macro GS_TB_TLINE() + + uint32 flag; // STATE flag + uint32 mask; // STATE mask + } uObjTxtrBlock; // 24 bytes + */ + + DebuggerAppendMsg("uObjTxtrBlock Header in RDRAM: 0x%08X", (uint32) ((char *) &ptr - (char *) g_pRDRAMu8)); + DebuggerAppendMsg("ImgAddr=0x%08X(0x%08X), tsize=0x%X, \nTMEM=0x%X, sid=%d, tline=%d, flag=0x%X, mask=0x%X\n\n", + RSPSegmentAddr(ptr.image), ptr.image, ptr.tsize, ptr.tmem, ptr.sid/4, ptr.tline, ptr.flag, ptr.mask); +} + +void DumpSpriteParameters(uObjSprite &ptr) +{ + /* + typedef struct { // Intel format + uint16 scaleW; // Scaling of the u5.10 width direction. + short objX; // The x-coordinate of the upper-left end. s10.2 OBJ + + uint16 paddingX; // Unused. Always 0. + uint16 imageW; // The width of the u10.5 texture. (The length of the S-direction.) + + uint16 scaleH; // Scaling of the u5.10 height direction. + short objY; // The y-coordinate of the s10.2 OBJ upper-left end. + + uint16 paddingY; // Unused. Always 0. + uint16 imageH; // The height of the u10.5 texture. (The length of the T-direction.) + + uint16 imageAdrs; // The texture header position in TMEM. (In units of 64bit word.) + uint16 imageStride; // The folding width of the texel. (In units of 64bit word.) + + uint8 imageFlags; // The display flag. S2DEX_OBJ_FLAG_FLIP* + uint8 imagePal; //The pallet number. 0-7 + uint8 imageSiz; // The size of the texel. TXT_SIZE_* + uint8 imageFmt; // The format of the texel. TXT_FMT_* + } uObjSprite; // 24 bytes + */ + + if( logTextures || (pauseAtNext && eventToPause == NEXT_OBJ_TXT_CMD) ) + { + DebuggerAppendMsg("uObjSprite Header in RDRAM: 0x%08X", (uint32) ((char *) &ptr - (char *) g_pRDRAMu8)); + DebuggerAppendMsg("X=%d, Y=%d, W=%d, H=%d, scaleW=%f, scaleH=%f\n" + "TAddr=0x%X, Stride=%d, Flag=0x%X, Pal=%d, Fmt=%s-%db\n\n", + ptr.objX/4, ptr.objY/4, ptr.imageW/32, ptr.imageH/32, ptr.scaleW/1024.0f, ptr.scaleH/1024.0f, + ptr.imageAdrs, ptr.imageStride, ptr.imageFlags, ptr.imagePal, pszImgFormat[ptr.imageFmt], pnImgSize[ptr.imageSiz]); + } +} + +void DumpTileParameters(uObjTxtrTile &tile) +{ +} + +void DumpTlutParameters(uObjTxtrTLUT &tlut) +{ + /* + typedef struct { // Intel Format + uint32 type; // S2DEX_OBJLT_TLUT divided into types. + uint32 image; + + uint16 pnum; // The loading pallet number -1. + uint16 phead; // The pallet number of the load header. Between 256 and 511. + + uint16 sid; // STATE ID Multiplied by 4. Either one of 0,4,8 and 12. + uint16 zero; // Assign 0 all the time. + + uint32 flag; // STATE flag + uint32 mask; // STATE mask + } uObjTxtrTLUT; // 24 bytes + */ + DebuggerAppendMsg("ImgAddr=0x%08X(0x%08X), pnum=%d, phead=%d, sid=%d, flag=0x%X, mask=0x%X\n\n", + RSPSegmentAddr(tlut.image), tlut.image, tlut.pnum+1, tlut.phead, tlut.sid/4, tlut.flag, tlut.mask); +} + + +void DumpTxtrInfo(uObjTxtr *ptr) +{ + if( logTextures || (pauseAtNext && eventToPause == NEXT_OBJ_TXT_CMD) ) + { + DebuggerAppendMsg("uObjTxtr Header in RDRAM: 0x%08X", (uint32) ((char *) ptr - (char *) g_pRDRAMu8)); + switch( ptr->block.type ) + { + case S2DEX_OBJLT_TXTRBLOCK: + TRACE0("Loading ObjTxtr: type=BLOCK"); + DumpBlockParameters(ptr->block); + break; + case S2DEX_OBJLT_TXTRTILE: + TRACE0("Loading ObjTxtr: type=TILE"); + DumpTileParameters(ptr->tile); + break; + case S2DEX_OBJLT_TLUT: + TRACE0("Loading ObjTxtr: type=TLUT"); + DumpTlutParameters(ptr->tlut); + break; + } + } +} + +void DumpObjMtx(bool fullmtx = true) +{ + if( logTextures || (pauseAtNext && eventToPause == NEXT_OBJ_TXT_CMD) ) + { + if( fullmtx ) + DebuggerAppendMsg("A=%X, B=%X, C=%X, D=%X, X=%X, Y=%X, BaseX=%X, BaseY=%X", + gObjMtx->A, gObjMtx->B, gObjMtx->C, gObjMtx->D, gObjMtx->X, gObjMtx->Y, gObjMtx->BaseScaleX, gObjMtx->BaseScaleY); + else + DebuggerAppendMsg("SubMatrix: X=%X, Y=%X, BaseX=%X, BaseY=%X", gSubObjMtx->X, gSubObjMtx->Y, gSubObjMtx->BaseScaleX, gSubObjMtx->BaseScaleY); + + DebuggerAppendMsg("A=%f, B=%f, C=%f, D=%f, X=%f, Y=%f, BaseX=%f, BaseY=%f", + gObjMtxReal.A, gObjMtxReal.B, gObjMtxReal.C, gObjMtxReal.D, gObjMtxReal.X, gObjMtxReal.Y, gObjMtxReal.BaseScaleX, gObjMtxReal.BaseScaleY); + } +} + +#endif + +void ObjMtxTranslate(float &x, float &y) +{ + float x1 = gObjMtxReal.A*x + gObjMtxReal.B*y + gObjMtxReal.X; + float y1 = gObjMtxReal.C*x + gObjMtxReal.D*y + gObjMtxReal.Y; + + x = x1; + y = y1; +} + +void RSP_S2DEX_SPObjLoadTxtr(Gfx *gfx) +{ + gObjTxtr = (uObjTxtr*)(g_pRDRAMu8+(RSPSegmentAddr((gfx->words.w1))&(g_dwRamSize-1))); + if( gObjTxtr->block.type == S2DEX_OBJLT_TLUT ) + { + gObjTlut = (uObjTxtrTLUT*)gObjTxtr; + gObjTlutAddr = (uint32)(RSPSegmentAddr(gObjTlut->image)); + + // Copy tlut + int size = gObjTlut->pnum+1; + int offset = gObjTlut->phead-0x100; + + if( offset+size>0x100) + { + size = 0x100 - offset; + } + + uint32 addr = (gObjTlutAddr);//&0xFFFFFFFC); + //if( addr & 3 ) addr = (addr&0xFFFFFFF0)+8;; + //uint16 *srcPal = (uint16*)(g_pRDRAMu8 + (addr& (g_dwRamSize-1)) ); + + for( int i=offset; iwords.w1))&(g_dwRamSize-1))); + gObjTxtr = (uObjTxtr*)ptr; + + //Now draw the sprite + CRender::g_pRender->LoadObjSprite(*ptr); + CRender::g_pRender->DrawSpriteR(*ptr); + + DEBUGGER_PAUSE_AT_COND_AND_DUMP_COUNT_N((eventToPause == NEXT_OBJ_TXT_CMD||eventToPause == NEXT_FLUSH_TRI), + { + DumpTxtrInfo(gObjTxtr); + DumpSpriteParameters(ptr->sprite); + TRACE0("Paused at RSP_S2DEX_SPObjLoadTxSprite"); + } + ); +} + + +// Yoshi's Story uses this - 0xc3 +void RSP_S2DEX_SPObjLoadTxRect(Gfx *gfx) +{ + + + + uObjTxSprite* ptr = (uObjTxSprite*)(g_pRDRAMu8+(RSPSegmentAddr((gfx->words.w1))&(g_dwRamSize-1))); + gObjTxtr = (uObjTxtr*)ptr; + + //Now draw the sprite + CRender::g_pRender->LoadObjSprite(*ptr); + CRender::g_pRender->DrawSprite(*ptr, false); + + DEBUGGER_PAUSE_AT_COND_AND_DUMP_COUNT_N((eventToPause == NEXT_OBJ_TXT_CMD||eventToPause == NEXT_FLUSH_TRI), + { + DumpTxtrInfo(gObjTxtr); + DumpSpriteParameters(ptr->sprite); + TRACE0("Paused at RSP_S2DEX_SPObjLoadTxRect"); + } + ); +} + +// Yoshi's Story uses this - 0xc4 +void RSP_S2DEX_SPObjLoadTxRectR(Gfx *gfx) +{ + uObjTxSprite* ptr = (uObjTxSprite*)(g_pRDRAMu8+(RSPSegmentAddr((gfx->words.w1))&(g_dwRamSize-1))); + gObjTxtr = (uObjTxtr*)ptr; + + //Now draw the sprite + CRender::g_pRender->LoadObjSprite(*ptr); + CRender::g_pRender->DrawSprite(*ptr, true); + + DEBUGGER_PAUSE_AT_COND_AND_DUMP_COUNT_N((eventToPause == NEXT_OBJ_TXT_CMD||eventToPause == NEXT_FLUSH_TRI), + { + DumpTxtrInfo(gObjTxtr); + DumpSpriteParameters(ptr->sprite); + TRACE0("Paused at RSP_S2DEX_SPObjLoadTxRect"); + } + ); +} + +void DLParser_TexRect(Gfx *gfx); +// Yoshi's Story uses this - 0xe4 +void RSP_S2DEX_RDPHALF_0(Gfx *gfx) +{ + //RDP: RSP_S2DEX_RDPHALF_0 (0xe449c0a8 0x003b40a4) + //0x001d3c88: e449c0a8 003b40a4 RDP_TEXRECT + //0x001d3c90: b4000000 00000000 RSP_RDPHALF_1 + //0x001d3c98: b3000000 04000400 RSP_RDPHALF_2 + + uint32 dwPC = gDlistStack[gDlistStackPointer].pc; // This points to the next instruction + uint32 dwNextUcode = *(uint32 *)(g_pRDRAMu8 + dwPC); + + if( (dwNextUcode>>24) != S2DEX_SELECT_DL ) + { + // Pokemom Puzzle League + if( (dwNextUcode>>24) == 0xB4 ) + { + DLParser_TexRect(gfx); + } + else + { + RSP_RDP_NOIMPL("RDP: RSP_S2DEX_RDPHALF_0 (0x%08x 0x%08x)", (gfx->words.w0), (gfx->words.w1)); + } + } + else + { + RSP_RDP_NOIMPL("RDP: RSP_S2DEX_RDPHALF_0 (0x%08x 0x%08x)", (gfx->words.w0), (gfx->words.w1)); + DEBUGGER_PAUSE_COUNT_N(NEXT_OBJ_TXT_CMD); + } +} + +// Yoshi's Story uses this - 0x05 +void RSP_S2DEX_OBJ_MOVEMEM(Gfx *gfx) +{ + uint32 dwCommand = ((gfx->words.w0)>>16)&0xFF; + uint32 dwLength = ((gfx->words.w0)) &0xFFFF; + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + + if( dwAddr >= g_dwRamSize ) + { + TRACE0("ObjMtx: memory ptr is invalid"); + } + + if( dwLength == 0 && dwCommand == 23 ) + { + gObjMtx = (uObjMtx *)(dwAddr+g_pRDRAMu8); + gObjMtxReal.A = gObjMtx->A/65536.0f; + gObjMtxReal.B = gObjMtx->B/65536.0f; + gObjMtxReal.C = gObjMtx->C/65536.0f; + gObjMtxReal.D = gObjMtx->D/65536.0f; + gObjMtxReal.X = float(gObjMtx->X>>2); + gObjMtxReal.Y = float(gObjMtx->Y>>2); + gObjMtxReal.BaseScaleX = gObjMtx->BaseScaleX/1024.0f; + gObjMtxReal.BaseScaleY = gObjMtx->BaseScaleY/1024.0f; + +#ifdef DEBUGGER + DumpObjMtx(); +#endif + } + else if( dwLength == 2 && dwCommand == 7 ) + { + gSubObjMtx = (uObjSubMtx*)(dwAddr+g_pRDRAMu8); + gObjMtxReal.X = float(gSubObjMtx->X>>2); + gObjMtxReal.Y = float(gSubObjMtx->Y>>2); + gObjMtxReal.BaseScaleX = gSubObjMtx->BaseScaleX/1024.0f; + gObjMtxReal.BaseScaleY = gSubObjMtx->BaseScaleY/1024.0f; + +#ifdef DEBUGGER + DumpObjMtx(false); +#endif + } + + g_MtxReal._11 = gObjMtxReal.A; + g_MtxReal._12 = gObjMtxReal.C; + g_MtxReal._13 = 0; + g_MtxReal._14 = 0;//gObjMtxReal.X; + + g_MtxReal._21 = gObjMtxReal.B; + g_MtxReal._22 = gObjMtxReal.D; + g_MtxReal._23 = 0; + g_MtxReal._24 = 0;//gObjMtxReal.Y; + + g_MtxReal._31 = 0; + g_MtxReal._32 = 0; + g_MtxReal._33 = 1.0; + g_MtxReal._34 = 0; + + g_MtxReal._41 = gObjMtxReal.X; + g_MtxReal._42 = gObjMtxReal.Y; + g_MtxReal._43 = 0; + g_MtxReal._44 = 1.0; + + DEBUGGER_PAUSE_COUNT_N(NEXT_OBJ_TXT_CMD); +} + +// Yoshi's Story uses this - 0x01 +extern void RSP_GBI0_Mtx(Gfx *gfx); + +void RSP_S2DEX_BG_1CYC(Gfx *gfx) +{ + SP_Timing(DP_Minimal16); + DP_Timing(DP_Minimal16); + + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + uObjScaleBg *sbgPtr = (uObjScaleBg *)(dwAddr+g_pRDRAMu8); + CRender::g_pRender->LoadObjBG1CYC(*sbgPtr); + CRender::g_pRender->DrawObjBG1CYC(*sbgPtr); + + DEBUGGER_PAUSE_AT_COND_AND_DUMP_COUNT_N((eventToPause == NEXT_OBJ_TXT_CMD||eventToPause == NEXT_FLUSH_TRI||eventToPause == NEXT_OBJ_BG), + { + DebuggerAppendMsg("S2DEX BG 1CYC: %08X-%08X\n", (gfx->words.w0), (gfx->words.w1) ); + TRACE0("Paused at RSP_S2DEX_BG_1CYC"); + } + ); +} + +void RSP_S2DEX_BG_1CYC_2(Gfx *gfx) +{ + if( ((gfx->words.w0)&0x00FFFFFF) != 0 ) + { + RSP_GBI0_Mtx(gfx); + return; + } + + RSP_S2DEX_BG_1CYC(gfx); +} + + +// Yoshi's Story uses this - 0xb2 +void RSP_S2DEX_OBJ_RECTANGLE_R(Gfx *gfx) +{ + uint32 dwAddr = RSPSegmentAddr((gfx->words.w1)); + uObjSprite *ptr = (uObjSprite*)(g_pRDRAMu8+dwAddr); + + uObjTxSprite objtx; + memcpy(&objtx.sprite,ptr,sizeof(uObjSprite)); + + + //uObjTxSprite* ptr = (uObjTxSprite*)(g_pRDRAMu8+(RSPSegmentAddr((gfx->words.w1))&(g_dwRamSize-1))); + //gObjTxtr = (uObjTxtr*)ptr; + + //Now draw the sprite + if( g_TxtLoadBy == CMD_LOAD_OBJ_TXTR ) + { + memcpy(&(objtx.txtr.block),&(gObjTxtr->block),sizeof(uObjTxtr)); + //CRender::g_pRender->LoadObjSprite(*ptr,true); + CRender::g_pRender->LoadObjSprite(objtx,true); + } + else + { + PrepareTextures(); + } + //CRender::g_pRender->DrawSprite(*ptr, true); + CRender::g_pRender->DrawSprite(objtx, true); + + DEBUGGER_PAUSE_AT_COND_AND_DUMP_COUNT_N((eventToPause == NEXT_OBJ_TXT_CMD||eventToPause == NEXT_FLUSH_TRI), + { + DumpTxtrInfo(gObjTxtr); + DumpSpriteParameters(*ptr); + TRACE0("Paused at RSP_S2DEX_OBJ_RECTANGLE_R"); + } + ); +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/RSP_S2DEX.h b/libmupen64plus/mupen64plus-video-rice/src/RSP_S2DEX.h new file mode 100644 index 0000000000..8acd904269 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/RSP_S2DEX.h @@ -0,0 +1,204 @@ +/* +Copyright (C) 2002 Rice1964 + +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. + +*/ + +#ifndef _RSP_S2DEX_H_ +#define _RSP_S2DEX_H_ + +#define S2DEX_BG_1CYC 0x01 +#define S2DEX_BG_COPY 0x02 +#define S2DEX_OBJ_RECTANGLE 0x03 +#define S2DEX_OBJ_SPRITE 0x04 +#define S2DEX_OBJ_MOVEMEM 0x05 +#define S2DEX_SELECT_DL 0xb0 +#define S2DEX_OBJ_RENDERMODE 0xb1 +#define S2DEX_OBJ_RECTANGLE_R 0xb2 +#define S2DEX_OBJ_LOADTXTR 0xc1 +#define S2DEX_OBJ_LDTX_SPRITE 0xc2 +#define S2DEX_OBJ_LDTX_RECT 0xc3 +#define S2DEX_OBJ_LDTX_RECT_R 0xc4 +#define S2DEX_RDPHALF_0 0xe4 + +#define S2DEX_OBJLT_TXTRBLOCK 0x00001033 +#define S2DEX_OBJLT_TXTRTILE 0x00fc1034 +#define S2DEX_OBJLT_TLUT 0x00000030 +#define S2DEX_BGLT_LOADBLOCK 0x0033 +#define S2DEX_BGLT_LOADTILE 0xfff4 + +typedef struct { //Intel format + uint32 type; + uint32 image; + + uint16 tsize; + uint16 tmem; + + uint16 sid; + uint16 tline; + + uint32 flag; + uint32 mask; +} uObjTxtrBlock; + +typedef struct { //Intel Format + uint32 type; + uint32 image; + + uint16 twidth; + uint16 tmem; + + uint16 sid; + uint16 theight; + + uint32 flag; + uint32 mask; +} uObjTxtrTile; // 24 bytes + +typedef struct { // Intel Format + uint32 type; + uint32 image; + + uint16 pnum; + uint16 phead; + + uint16 sid; + uint16 zero; + + uint32 flag; + uint32 mask; +} uObjTxtrTLUT; + +typedef union { + uObjTxtrBlock block; + uObjTxtrTile tile; + uObjTxtrTLUT tlut; +} uObjTxtr; + +typedef struct { // Intel format + uint16 scaleW; + short objX; + + uint16 paddingX; + uint16 imageW; + + uint16 scaleH; + short objY; + + uint16 paddingY; + uint16 imageH; + + uint16 imageAdrs; + uint16 imageStride; + + uint8 imageFlags; + uint8 imagePal; + uint8 imageSiz; + uint8 imageFmt; +} uObjSprite; + + +typedef struct { + uObjTxtr txtr; + uObjSprite sprite; +} uObjTxSprite; /* 48 bytes */ + +typedef struct { // Intel format + s32 A, B, C, D; + + short Y; + short X; + + uint16 BaseScaleY; + uint16 BaseScaleX; +} uObjMtx; + +typedef struct { + float A, B, C, D; + float X; + float Y; + float BaseScaleX; + float BaseScaleY; +} uObjMtxReal; + +typedef struct { //Intel format + short Y; + short X; + uint16 BaseScaleY; + uint16 BaseScaleX; +} uObjSubMtx; + +typedef struct { // Intel Format + uint16 imageW; + uint16 imageX; + + uint16 frameW; + short frameX; + + uint16 imageH; + uint16 imageY; + + uint16 frameH; + short frameY; + + uint32 imagePtr; + + uint8 imageSiz; + uint8 imageFmt; + uint16 imageLoad; + + uint16 imageFlip; + uint16 imagePal; + + uint16 tmemH; + uint16 tmemW; + uint16 tmemLoadTH; + uint16 tmemLoadSH; + uint16 tmemSize; + uint16 tmemSizeW; +} uObjBg; + +typedef struct { // Intel Format + uint16 imageW; + uint16 imageX; + + uint16 frameW; + short frameX; + + uint16 imageH; + uint16 imageY; + + uint16 frameH; + short frameY; + + uint32 imagePtr; + + uint8 imageSiz; + uint8 imageFmt; + uint16 imageLoad; + + uint16 imageFlip; + uint16 imagePal; + + uint16 scaleH; + uint16 scaleW; + + s32 imageYorig; + uint8 padding[4]; +} uObjScaleBg; + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/Render.cpp b/libmupen64plus/mupen64plus-video-rice/src/Render.cpp new file mode 100644 index 0000000000..d90633fb59 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/Render.cpp @@ -0,0 +1,2086 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + +#define M64P_PLUGIN_PROTOTYPES 1 +#include "osal_preproc.h" +#include "m64p_plugin.h" + +#include "ConvertImage.h" +#include "DeviceBuilder.h" +#include "FrameBuffer.h" +#include "Render.h" + +#include "liblinux/BMGLibPNG.h" + +#include + +extern FiddledVtx * g_pVtxBase; +CRender * CRender::g_pRender=NULL; +int CRender::gRenderReferenceCount=0; + +XMATRIX reverseXY(-1,0,0,0,0,-1,0,0,0,0,1,0,0,0,0,1); +XMATRIX reverseY(1,0,0,0,0,-1,0,0,0,0,1,0,0,0,0,1); +extern char* right (const char * src, int nchars); + +#if defined(WIN32) + #define strcasecmp _stricmp +#endif + +#ifdef min +#undef min +#endif +#ifdef max +#undef max +#endif + +//======================================================================== +CRender * CRender::GetRender(void) +{ + if( CRender::g_pRender == NULL ) + { + DebugMessage(M64MSG_ERROR, "g_pRender is NULL"); + exit(0); + } + else + return CRender::g_pRender; +} +bool CRender::IsAvailable() +{ + return CRender::g_pRender != NULL; +} + +CRender::CRender() : + m_fScreenViewportMultX(2.0f), + m_fScreenViewportMultY(2.0f), + + m_dwTexturePerspective(FALSE), + m_bAlphaTestEnable(FALSE), + m_bZUpdate(FALSE), + m_bZCompare(FALSE), + m_dwZBias(0), + + m_dwMinFilter(FILTER_POINT), + m_dwMagFilter(FILTER_POINT), + m_dwAlpha(0xFF), + m_Mux(0), + m_bBlendModeValid(FALSE) +{ + int i; + InitRenderBase(); + + for( i=0; iCreateColorCombiner(this); + m_pColorCombiner->Initialize(); + + m_pAlphaBlender = CDeviceBuilder::GetBuilder()->CreateAlphaBlender(this); + +} + +CRender::~CRender() +{ + if( m_pColorCombiner != NULL ) + { + CDeviceBuilder::GetBuilder()->DeleteColorCombiner(); + m_pColorCombiner = NULL; + } + + if( m_pAlphaBlender != NULL ) + { + CDeviceBuilder::GetBuilder()->DeleteAlphaBlender(); + m_pAlphaBlender = NULL; + } +} + +void CRender::ResetMatrices() +{ + Matrix mat; + + mat.m[0][1] = mat.m[0][2] = mat.m[0][3] = + mat.m[1][0] = mat.m[1][2] = mat.m[1][3] = + mat.m[2][0] = mat.m[2][1] = mat.m[2][3] = + mat.m[3][0] = mat.m[3][1] = mat.m[3][2] = 0.0f; + + mat.m[0][0] = mat.m[1][1] = mat.m[2][2] = mat.m[3][3] = 1.0f; + + gRSP.projectionMtxTop = 0; + gRSP.modelViewMtxTop = 0; + gRSP.projectionMtxs[0] = mat; + gRSP.modelviewMtxs[0] = mat; + + gRSP.bMatrixIsUpdated = true; + gRSP.bWorldMatrixIsUpdated = true; + UpdateCombinedMatrix(); +} + +void CRender::SetProjection(const Matrix & mat, bool bPush, bool bReplace) +{ + if (bPush) + { + if (gRSP.projectionMtxTop >= (RICE_MATRIX_STACK-1)) + { + TRACE0("Pushing past proj stack limits!"); + } + else + gRSP.projectionMtxTop++; + + if (bReplace) + { + // Load projection matrix + gRSP.projectionMtxs[gRSP.projectionMtxTop] = mat; + } + else + { + gRSP.projectionMtxs[gRSP.projectionMtxTop] = mat * gRSP.projectionMtxs[gRSP.projectionMtxTop-1]; + } + + } + else + { + if (bReplace) + { + // Load projection matrix + gRSP.projectionMtxs[gRSP.projectionMtxTop] = mat; + } + else + { + gRSP.projectionMtxs[gRSP.projectionMtxTop] = mat * gRSP.projectionMtxs[gRSP.projectionMtxTop]; + } + } + + gRSP.bMatrixIsUpdated = true; + + DumpMatrix(mat,"Set Projection Matrix"); +} + +bool mtxPopUpError = false; +void CRender::SetWorldView(const Matrix & mat, bool bPush, bool bReplace) +{ + if (bPush) + { + if (gRSP.modelViewMtxTop >= (RICE_MATRIX_STACK-1)) + DebuggerAppendMsg("Pushing past modelview stack limits! %s", bReplace?"Load":"Mul"); + else + gRSP.modelViewMtxTop++; + + // We should store the current projection matrix... + if (bReplace) + { + // Load projection matrix + gRSP.modelviewMtxs[gRSP.modelViewMtxTop] = mat; + } + else // Multiply projection matrix + { + gRSP.modelviewMtxs[gRSP.modelViewMtxTop] = mat * gRSP.modelviewMtxs[gRSP.modelViewMtxTop-1]; + } + } + else // NoPush + { + if (bReplace) + { + // Load projection matrix + gRSP.modelviewMtxs[gRSP.modelViewMtxTop] = mat; + } + else + { + // Multiply projection matrix + gRSP.modelviewMtxs[gRSP.modelViewMtxTop] = mat * gRSP.modelviewMtxs[gRSP.modelViewMtxTop]; + } + } + + gRSPmodelViewTop = gRSP.modelviewMtxs[gRSP.modelViewMtxTop]; + if( options.enableHackForGames == HACK_REVERSE_XY_COOR ) + { + gRSPmodelViewTop = gRSPmodelViewTop * reverseXY; + } + if( options.enableHackForGames == HACK_REVERSE_Y_COOR ) + { + gRSPmodelViewTop = gRSPmodelViewTop * reverseY; + } + MatrixTranspose(&gRSPmodelViewTopTranspose, &gRSPmodelViewTop); + + gRSP.bMatrixIsUpdated = true; + gRSP.bWorldMatrixIsUpdated = true; + + DumpMatrix(mat,"Set WorldView Matrix"); +} + + +void CRender::PopWorldView() +{ + if (gRSP.modelViewMtxTop > 0) + { + gRSP.modelViewMtxTop--; + gRSPmodelViewTop = gRSP.modelviewMtxs[gRSP.modelViewMtxTop]; + if( options.enableHackForGames == HACK_REVERSE_XY_COOR ) + { + gRSPmodelViewTop = gRSPmodelViewTop * reverseXY; + } + if( options.enableHackForGames == HACK_REVERSE_Y_COOR ) + { + gRSPmodelViewTop = gRSPmodelViewTop * reverseY; + } + MatrixTranspose(&gRSPmodelViewTopTranspose, &gRSPmodelViewTop); + gRSP.bMatrixIsUpdated = true; + gRSP.bWorldMatrixIsUpdated = true; + } + else + { +#ifdef DEBUGGER + if( pauseAtNext ) + TRACE0("Popping past worldview stack limits"); +#endif + mtxPopUpError = true; + } +} + + +Matrix & CRender::GetWorldProjectMatrix(void) +{ + return gRSPworldProject; +} + +void CRender::SetWorldProjectMatrix(Matrix &mtx) +{ +#ifdef DEBUGGER + if( pauseAtNext && (eventToPause == NEXT_TRIANGLE || eventToPause == NEXT_FLUSH_TRI || eventToPause == NEXT_MATRIX_CMD ) ) + { + uint32 dwPC = gDlistStack[gDlistStackPointer].pc-8; + DebuggerAppendMsg("Force Matrix: pc=%08X", dwPC); + DumpMatrix(mtx, "Force Matrix, loading new world-project matrix"); + } +#endif + gRSPworldProject = mtx; + + gRSP.bMatrixIsUpdated = false; + gRSP.bCombinedMatrixIsUpdated = true; +} + +void CRender::SetMux(uint32 dwMux0, uint32 dwMux1) +{ + uint64 tempmux = (((uint64)dwMux0) << 32) | (uint64)dwMux1; + if( m_Mux != tempmux ) + { + m_Mux = tempmux; + m_bBlendModeValid = FALSE; + m_pColorCombiner->UpdateCombiner(dwMux0, dwMux1); + } +} + + +void CRender::SetCombinerAndBlender() +{ + InitOtherModes(); + + if( g_curRomInfo.bDisableBlender ) + m_pAlphaBlender->DisableAlphaBlender(); + else if( currentRomOptions.bNormalBlender ) + m_pAlphaBlender->NormalAlphaBlender(); + else + m_pAlphaBlender->InitBlenderMode(); + + m_pColorCombiner->InitCombinerMode(); +} + +void CRender::RenderReset() +{ + UpdateClipRectangle(); + ResetMatrices(); + SetZBias(0); + gRSP.numVertices = 0; + gRSP.maxVertexID = 0; + gRSP.curTile = 0; + gRSP.fTexScaleX = 1/32.0f;; + gRSP.fTexScaleY = 1/32.0f; +} + +bool CRender::FillRect(int nX0, int nY0, int nX1, int nY1, uint32 dwColor) +{ + LOG_UCODE("FillRect: X0=%d, Y0=%d, X1=%d, Y1=%d, Color=0x%8X", nX0, nY0, nX1, nY1, dwColor); + + if (g_CI.dwSize != TXT_SIZE_16b && frameBufferOptions.bIgnore) + return true; + + if (status.bHandleN64RenderTexture && !status.bDirectWriteIntoRDRAM) + status.bFrameBufferIsDrawn = true; + + if(status.bVIOriginIsUpdated == true && currentRomOptions.screenUpdateSetting==SCREEN_UPDATE_AT_1ST_PRIMITIVE) + { + status.bVIOriginIsUpdated=false; + CGraphicsContext::Get()->UpdateFrame(); + DEBUGGER_PAUSE_AND_DUMP_NO_UPDATE(NEXT_SET_CIMG, {DebuggerAppendMsg("Screen Update at 1st FillRectangle");}); + } + + if (status.bCIBufferIsRendered && status.bVIOriginIsUpdated == true && currentRomOptions.screenUpdateSetting==SCREEN_UPDATE_BEFORE_SCREEN_CLEAR ) + { + if ((nX0==0 && nY0 == 0 && (nX1 == (int) g_CI.dwWidth || nX1 == (int) g_CI.dwWidth-1)) || + (nX0==gRDP.scissor.left && nY0 == gRDP.scissor.top && (nX1 == gRDP.scissor.right || nX1 == gRDP.scissor.right-1)) || + ((nX0+nX1 == (int)g_CI.dwWidth || nX0+nX1 == (int)g_CI.dwWidth-1 || nX0+nX1 == gRDP.scissor.left+gRDP.scissor.right || nX0+nX1 == gRDP.scissor.left+gRDP.scissor.right-1) && (nY0 == gRDP.scissor.top || nY0 == 0 || nY0+nY1 == gRDP.scissor.top+gRDP.scissor.bottom || nY0+nY1 == gRDP.scissor.top+gRDP.scissor.bottom-1))) + { + status.bVIOriginIsUpdated=false; + CGraphicsContext::Get()->UpdateFrame(); + DEBUGGER_PAUSE_AND_DUMP_NO_UPDATE(NEXT_SET_CIMG,{DebuggerAppendMsg("Screen Update Before Screen Clear");}); + } + } + + + SetFillMode(RICE_FILLMODE_SOLID); + + bool res=true; + + /* + // I don't know why this does not work for OpenGL + if( gRDP.otherMode.cycle_type == CYCLE_TYPE_FILL && nX0 == 0 && nY0 == 0 && ((nX1==windowSetting.uViWidth && nY1==windowSetting.uViHeight)||(nX1==windowSetting.uViWidth-1 && nY1==windowSetting.uViHeight-1)) ) + { + CGraphicsContext::g_pGraphicsContext->Clear(CLEAR_COLOR_BUFFER,dwColor); + } + else + */ + { + //BOOL m_savedZBufferFlag = gRSP.bZBufferEnabled; // Save ZBuffer state + ZBufferEnable( FALSE ); + + m_fillRectVtx[0].x = ViewPortTranslatei_x(nX0); + m_fillRectVtx[0].y = ViewPortTranslatei_y(nY0); + m_fillRectVtx[1].x = ViewPortTranslatei_x(nX1); + m_fillRectVtx[1].y = ViewPortTranslatei_y(nY1); + + SetCombinerAndBlender(); + + if( gRDP.otherMode.cycle_type >= CYCLE_TYPE_COPY ) + { + ZBufferEnable(FALSE); + } + else + { + //dwColor = PostProcessDiffuseColor(0); + dwColor = PostProcessDiffuseColor(gRDP.primitiveColor); + } + + float depth = (gRDP.otherMode.depth_source == 1 ? gRDP.fPrimitiveDepth : 0 ); + + ApplyRDPScissor(); + TurnFogOnOff(false); + res = RenderFillRect(dwColor, depth); + TurnFogOnOff(gRSP.bFogEnabled); + + if( gRDP.otherMode.cycle_type >= CYCLE_TYPE_COPY ) + { + ZBufferEnable(gRSP.bZBufferEnabled); + } + } + + if( options.bWinFrameMode ) SetFillMode(RICE_FILLMODE_WINFRAME ); + + DEBUGGER_PAUSE_AND_DUMP_COUNT_N( NEXT_FILLRECT, {DebuggerAppendMsg("FillRect: X0=%d, Y0=%d, X1=%d, Y1=%d, Color=0x%08X", nX0, nY0, nX1, nY1, dwColor); + DebuggerAppendMsg("Pause after FillRect: Color=%08X\n", dwColor);if( logCombiners ) m_pColorCombiner->DisplayMuxString();}); + DEBUGGER_PAUSE_AND_DUMP_COUNT_N( NEXT_FLUSH_TRI, {DebuggerAppendMsg("FillRect: X0=%d, Y0=%d, X1=%d, Y1=%d, Color=0x%08X", nX0, nY0, nX1, nY1, dwColor); + DebuggerAppendMsg("Pause after FillRect: Color=%08X\n", dwColor);if( logCombiners ) m_pColorCombiner->DisplayMuxString();}); + + return res; +} + + +bool CRender::Line3D(uint32 dwV0, uint32 dwV1, uint32 dwWidth) +{ + LOG_UCODE("Line3D: Vtx0=%d, Vtx1=%d, Width=%d", dwV0, dwV1, dwWidth); + if( !status.bCIBufferIsRendered ) g_pFrameBufferManager->ActiveTextureBuffer(); + + m_line3DVtx[0].z = (g_vecProjected[dwV0].z + 1.0f) * 0.5f; + m_line3DVtx[1].z = (g_vecProjected[dwV1].z + 1.0f) * 0.5f; + + if( m_line3DVtx[0].z != m_line3DVtx[1].z ) + return false; + + if( status.bHandleN64RenderTexture && !status.bDirectWriteIntoRDRAM ) status.bFrameBufferIsDrawn = true; + if( status.bHandleN64RenderTexture ) + { + g_pRenderTextureInfo->maxUsedHeight = g_pRenderTextureInfo->N64Height; + if( status.bHandleN64RenderTexture && !status.bDirectWriteIntoRDRAM ) + { + status.bFrameBufferIsDrawn = true; + status.bFrameBufferDrawnByTriangles = true; + } + } + + m_line3DVtx[0].x = ViewPortTranslatef_x(g_vecProjected[dwV0].x); + m_line3DVtx[0].y = ViewPortTranslatef_y(g_vecProjected[dwV0].y); + m_line3DVtx[0].rhw = g_vecProjected[dwV0].w; + m_line3DVtx[0].dcDiffuse = PostProcessDiffuseColor(g_dwVtxDifColor[dwV0]); + m_line3DVtx[0].dcSpecular = PostProcessSpecularColor(); + + m_line3DVtx[1].x = ViewPortTranslatef_x(g_vecProjected[dwV1].x); + m_line3DVtx[1].y = ViewPortTranslatef_y(g_vecProjected[dwV1].y); + m_line3DVtx[1].rhw = g_vecProjected[dwV1].w; + m_line3DVtx[1].dcDiffuse = PostProcessDiffuseColor(g_dwVtxDifColor[dwV1]); + m_line3DVtx[1].dcSpecular = m_line3DVtx[0].dcSpecular; + + float width = dwWidth*0.5f+1.5f; + + if( m_line3DVtx[0].y == m_line3DVtx[1].y ) + { + m_line3DVector[0].x = m_line3DVector[1].x = m_line3DVtx[0].x; + m_line3DVector[2].x = m_line3DVector[3].x = m_line3DVtx[1].x; + + m_line3DVector[0].y = m_line3DVector[2].y = m_line3DVtx[0].y-width/2*windowSetting.fMultY; + m_line3DVector[1].y = m_line3DVector[3].y = m_line3DVtx[0].y+width/2*windowSetting.fMultY; + } + else + { + m_line3DVector[0].y = m_line3DVector[1].y = m_line3DVtx[0].y; + m_line3DVector[2].y = m_line3DVector[3].y = m_line3DVtx[1].y; + + m_line3DVector[0].x = m_line3DVector[2].x = m_line3DVtx[0].x-width/2*windowSetting.fMultX; + m_line3DVector[1].x = m_line3DVector[3].x = m_line3DVtx[0].x+width/2*windowSetting.fMultX; + } + + SetCombinerAndBlender(); + + bool res=RenderLine3D(); + + DEBUGGER_PAUSE_AND_DUMP_COUNT_N(NEXT_FLUSH_TRI, { + DebuggerAppendMsg("Pause after Line3D: v%d(%f,%f,%f), v%d(%f,%f,%f), Width=%d\n", dwV0, m_line3DVtx[0].x, m_line3DVtx[0].y, m_line3DVtx[0].z, + dwV1, m_line3DVtx[1].x, m_line3DVtx[1].y, m_line3DVtx[1].z, dwWidth); + }); + + DEBUGGER_PAUSE_AND_DUMP_COUNT_N(NEXT_OBJ_TXT_CMD, { + DebuggerAppendMsg("Pause after Line3D: v%d(%f,%f,%f), v%d(%f,%f,%f), Width=%d\n", dwV0, m_line3DVtx[0].x, m_line3DVtx[0].y, m_line3DVtx[0].z, + dwV1, m_line3DVtx[1].x, m_line3DVtx[1].y, m_line3DVtx[1].z, dwWidth); + }); + + return res; +} + +bool CRender::RemapTextureCoordinate + (float t0, float t1, uint32 tileWidth, uint32 mask, float textureWidth, float &u0, float &u1) +{ + int s0 = (int)t0; + int s1 = (int)t1; + int width = mask>0 ? (1< s0 ) divs0--; + int divs1 = s1/width; if( divs1*width > s1 ) divs1--; + + if( divs0 == divs1 ) + { + s0 -= divs0*width; + s1 -= divs1*width; + //if( s0 > s1 ) + // s0++; + //else if( s1 > s0 ) + // s1++; + u0 = s0/textureWidth; + u1 = s1/textureWidth; + + return true; + } + else if( divs0+1 == divs1 && s0%width==0 && s1%width == 0 ) + { + u0 = 0; + u1 = tileWidth/textureWidth; + return true; + } + else if( divs0 == divs1+1 && s0%width==0 && s1%width == 0 ) + { + u1 = 0; + u0 = tileWidth/textureWidth; + return true; + } + else + { + //if( s0 > s1 ) + //{ + //s0++; + // u0 = s0/textureWidth; + //} + //else if( s1 > s0 ) + //{ + //s1++; + // u1 = s1/textureWidth; + //} + + return false; + } +} + +bool CRender::TexRect(int nX0, int nY0, int nX1, int nY1, float fS0, float fT0, float fScaleS, float fScaleT, bool colorFlag, uint32 diffuseColor) +{ + if( options.enableHackForGames == HACK_FOR_DUKE_NUKEM ) + { + colorFlag = true; + diffuseColor = 0; + } + + if( status.bVIOriginIsUpdated == true && currentRomOptions.screenUpdateSetting==SCREEN_UPDATE_AT_1ST_PRIMITIVE ) + { + status.bVIOriginIsUpdated=false; + CGraphicsContext::Get()->UpdateFrame(); + DEBUGGER_PAUSE_AND_DUMP_NO_UPDATE(NEXT_SET_CIMG,{DebuggerAppendMsg("Screen Update at 1st textRect");}); + } + + if( options.enableHackForGames == HACK_FOR_BANJO_TOOIE ) + { + // Hack for Banjo shadow in Banjo Tooie + if( g_TI.dwWidth == g_CI.dwWidth && g_TI.dwFormat == TXT_FMT_CI && g_TI.dwSize == TXT_SIZE_8b ) + { + if( nX0 == fS0 && nY0 == fT0 )//&& nX0 > 90 && nY0 > 130 && nX1-nX0 > 80 && nY1-nY0 > 20 ) + { + // Skip the text rect + return true; + } + } + } + + if( status.bN64IsDrawingTextureBuffer ) + { + if( frameBufferOptions.bIgnore || ( frameBufferOptions.bIgnoreRenderTextureIfHeightUnknown && newRenderTextureInfo.knownHeight == 0 ) ) + { + return true; + } + } + + PrepareTextures(); + + if( status.bHandleN64RenderTexture && g_pRenderTextureInfo->CI_Info.dwSize == TXT_SIZE_8b ) + { + return true; + } + + if( !IsTextureEnabled() && gRDP.otherMode.cycle_type != CYCLE_TYPE_COPY ) + { + FillRect(nX0, nY0, nX1, nY1, gRDP.primitiveColor); + return true; + } + + + if( IsUsedAsDI(g_CI.dwAddr) && !status.bHandleN64RenderTexture ) + { + status.bFrameBufferIsDrawn = true; + } + + if( status.bHandleN64RenderTexture && !status.bDirectWriteIntoRDRAM ) status.bFrameBufferIsDrawn = true; + + LOG_UCODE("TexRect: X0=%d, Y0=%d, X1=%d, Y1=%d,\n\t\tfS0=%f, fT0=%f, ScaleS=%f, ScaleT=%f ", + nX0, nY0, nX1, nY1, fS0, fT0, fScaleS, fScaleT); + + if( options.bEnableHacks ) + { + // Goldeneye HACK + if( nY1 - nY0 < 2 ) + nY1 = nY1+2; + + //// Text edge hack + else if( gRDP.otherMode.cycle_type == CYCLE_TYPE_1 && fScaleS == 1 && fScaleT == 1 && + (int)g_textures[gRSP.curTile].m_dwTileWidth == nX1-nX0+1 && (int)g_textures[gRSP.curTile].m_dwTileHeight == nY1-nY0+1 && + g_textures[gRSP.curTile].m_dwTileWidth%2 == 0 && g_textures[gRSP.curTile].m_dwTileHeight%2 == 0 ) + { + nY1++; + nX1++; + } + else if( g_curRomInfo.bIncTexRectEdge ) + { + nX1++; + nY1++; + } + } + + + // Scale to Actual texture coords + // The two cases are to handle the oversized textures hack on voodoos + + SetCombinerAndBlender(); + + + if( gRDP.otherMode.cycle_type >= CYCLE_TYPE_COPY || !gRDP.otherMode.z_cmp ) + { + ZBufferEnable(FALSE); + } + + BOOL accurate = currentRomOptions.bAccurateTextureMapping; + + RenderTexture &tex0 = g_textures[gRSP.curTile]; + Tile &tile0 = gRDP.tiles[gRSP.curTile]; + + float widthDiv = tex0.m_fTexWidth; + float heightDiv = tex0.m_fTexHeight; + float t0u0; + if( options.enableHackForGames == HACK_FOR_ALL_STAR_BASEBALL || options.enableHackForGames == HACK_FOR_MLB ) + { + t0u0 = (fS0 -tile0.fhilite_sl); + } + else + { + t0u0 = (fS0 * tile0.fShiftScaleS -tile0.fhilite_sl); + } + + float t0u1; + if( accurate && gRDP.otherMode.cycle_type >= CYCLE_TYPE_COPY ) + { + t0u1 = t0u0 + (fScaleS * (nX1 - nX0 - 1))*tile0.fShiftScaleS; + } + else + { + t0u1 = t0u0 + (fScaleS * (nX1 - nX0))*tile0.fShiftScaleS; + } + + + if( status.UseLargerTile[0] ) + { + m_texRectTex1UV[0].u = (t0u0+status.LargerTileRealLeft[0])/widthDiv; + m_texRectTex1UV[1].u = (t0u1+status.LargerTileRealLeft[0])/widthDiv; + } + else + { + m_texRectTex1UV[0].u = t0u0/widthDiv; + m_texRectTex1UV[1].u = t0u1/widthDiv; + if( accurate && !tile0.bMirrorS && RemapTextureCoordinate(t0u0, t0u1, tex0.m_dwTileWidth, tile0.dwMaskS, widthDiv, m_texRectTex1UV[0].u, m_texRectTex1UV[1].u) ) + SetTextureUFlag(TEXTURE_UV_FLAG_CLAMP, gRSP.curTile); + } + + float t0v0; + if( options.enableHackForGames == HACK_FOR_ALL_STAR_BASEBALL || options.enableHackForGames == HACK_FOR_MLB ) + { + t0v0 = (fT0 -tile0.fhilite_tl); + } + else + { + t0v0 = (fT0 * tile0.fShiftScaleT -tile0.fhilite_tl); + } + + float t0v1; + if ( accurate && gRDP.otherMode.cycle_type >= CYCLE_TYPE_COPY) + { + t0v1 = t0v0 + (fScaleT * (nY1 - nY0-1))*tile0.fShiftScaleT; + } + else + { + t0v1 = t0v0 + (fScaleT * (nY1 - nY0))*tile0.fShiftScaleT; + } + + m_texRectTex1UV[0].v = t0v0/heightDiv; + m_texRectTex1UV[1].v = t0v1/heightDiv; + if( accurate && !tile0.bMirrorT && RemapTextureCoordinate(t0v0, t0v1, tex0.m_dwTileHeight, tile0.dwMaskT, heightDiv, m_texRectTex1UV[0].v, m_texRectTex1UV[1].v) ) + SetTextureVFlag(TEXTURE_UV_FLAG_CLAMP, gRSP.curTile); + + COLOR speColor = PostProcessSpecularColor(); + COLOR difColor; + if( colorFlag ) + difColor = PostProcessDiffuseColor(diffuseColor); + else + //difColor = PostProcessDiffuseColor(0); + difColor = PostProcessDiffuseColor(gRDP.primitiveColor); + + g_texRectTVtx[0].x = ViewPortTranslatei_x(nX0); + g_texRectTVtx[0].y = ViewPortTranslatei_y(nY0); + g_texRectTVtx[0].dcDiffuse = difColor; + g_texRectTVtx[0].dcSpecular = speColor; + + g_texRectTVtx[1].x = ViewPortTranslatei_x(nX1); + g_texRectTVtx[1].y = ViewPortTranslatei_y(nY0); + g_texRectTVtx[1].dcDiffuse = difColor; + g_texRectTVtx[1].dcSpecular = speColor; + + g_texRectTVtx[2].x = ViewPortTranslatei_x(nX1); + g_texRectTVtx[2].y = ViewPortTranslatei_y(nY1); + g_texRectTVtx[2].dcDiffuse = difColor; + g_texRectTVtx[2].dcSpecular = speColor; + + g_texRectTVtx[3].x = ViewPortTranslatei_x(nX0); + g_texRectTVtx[3].y = ViewPortTranslatei_y(nY1); + g_texRectTVtx[3].dcDiffuse = difColor; + g_texRectTVtx[3].dcSpecular = speColor; + + float depth = (gRDP.otherMode.depth_source == 1 ? gRDP.fPrimitiveDepth : 0 ); + + g_texRectTVtx[0].z = g_texRectTVtx[1].z = g_texRectTVtx[2].z = g_texRectTVtx[3].z = depth; + g_texRectTVtx[0].rhw = g_texRectTVtx[1].rhw = g_texRectTVtx[2].rhw = g_texRectTVtx[3].rhw = 1; + + if( IsTexel1Enable() ) + { + RenderTexture &tex1 = g_textures[(gRSP.curTile+1)&7]; + Tile &tile1 = gRDP.tiles[(gRSP.curTile+1)&7]; + + widthDiv = tex1.m_fTexWidth; + heightDiv = tex1.m_fTexHeight; + //if( tile1.dwMaskS == 0 ) widthDiv = tile1.dwWidth; + //if( tile1.dwMaskT == 0 ) heightDiv = tile1.dwHeight; + + float t0u0 = fS0 * tile1.fShiftScaleS -tile1.fhilite_sl; + float t0v0 = fT0 * tile1.fShiftScaleT -tile1.fhilite_tl; + float t0u1; + float t0v1; + if ( accurate && gRDP.otherMode.cycle_type >= CYCLE_TYPE_COPY) + { + t0u1 = t0u0 + (fScaleS * (nX1 - nX0 - 1))*tile1.fShiftScaleS; + t0v1 = t0v0 + (fScaleT * (nY1 - nY0 - 1))*tile1.fShiftScaleT; + } + else + { + t0u1 = t0u0 + (fScaleS * (nX1 - nX0))*tile1.fShiftScaleS; + t0v1 = t0v0 + (fScaleT * (nY1 - nY0))*tile1.fShiftScaleT; + } + + if( status.UseLargerTile[1] ) + { + m_texRectTex2UV[0].u = (t0u0+status.LargerTileRealLeft[1])/widthDiv; + m_texRectTex2UV[1].u = (t0u1+status.LargerTileRealLeft[1])/widthDiv; + } + else + { + m_texRectTex2UV[0].u = t0u0/widthDiv; + m_texRectTex2UV[1].u = t0u1/widthDiv; + if( accurate && !tile1.bMirrorS && RemapTextureCoordinate(t0u0, t0u1, tex1.m_dwTileWidth, tile1.dwMaskS, widthDiv, m_texRectTex2UV[0].u, m_texRectTex2UV[1].u) ) + SetTextureUFlag(TEXTURE_UV_FLAG_CLAMP, (gRSP.curTile+1)&7); + } + + m_texRectTex2UV[0].v = t0v0/heightDiv; + m_texRectTex2UV[1].v = t0v1/heightDiv; + + if( accurate && !tile1.bMirrorT && RemapTextureCoordinate(t0v0, t0v1, tex1.m_dwTileHeight, tile1.dwMaskT, heightDiv, m_texRectTex2UV[0].v, m_texRectTex2UV[1].v) ) + SetTextureVFlag(TEXTURE_UV_FLAG_CLAMP, (gRSP.curTile+1)&7); + + SetVertexTextureUVCoord(g_texRectTVtx[0], m_texRectTex1UV[0].u, m_texRectTex1UV[0].v, m_texRectTex2UV[0].u, m_texRectTex2UV[0].v); + SetVertexTextureUVCoord(g_texRectTVtx[1], m_texRectTex1UV[1].u, m_texRectTex1UV[0].v, m_texRectTex2UV[1].u, m_texRectTex2UV[0].v); + SetVertexTextureUVCoord(g_texRectTVtx[2], m_texRectTex1UV[1].u, m_texRectTex1UV[1].v, m_texRectTex2UV[1].u, m_texRectTex2UV[1].v); + SetVertexTextureUVCoord(g_texRectTVtx[3], m_texRectTex1UV[0].u, m_texRectTex1UV[1].v, m_texRectTex2UV[0].u, m_texRectTex2UV[1].v); + } + else + { + SetVertexTextureUVCoord(g_texRectTVtx[0], m_texRectTex1UV[0].u, m_texRectTex1UV[0].v); + SetVertexTextureUVCoord(g_texRectTVtx[1], m_texRectTex1UV[1].u, m_texRectTex1UV[0].v); + SetVertexTextureUVCoord(g_texRectTVtx[2], m_texRectTex1UV[1].u, m_texRectTex1UV[1].v); + SetVertexTextureUVCoord(g_texRectTVtx[3], m_texRectTex1UV[0].u, m_texRectTex1UV[1].v); + } + + + bool res; + TurnFogOnOff(false); + if( TileUFlags[gRSP.curTile]==TEXTURE_UV_FLAG_CLAMP && TileVFlags[gRSP.curTile]==TEXTURE_UV_FLAG_CLAMP && options.forceTextureFilter == FORCE_DEFAULT_FILTER ) + { + TextureFilter dwFilter = m_dwMagFilter; + m_dwMagFilter = m_dwMinFilter = FILTER_LINEAR; + ApplyTextureFilter(); + ApplyRDPScissor(); + res = RenderTexRect(); + m_dwMagFilter = m_dwMinFilter = dwFilter; + ApplyTextureFilter(); + } + else if( fScaleS >= 1 && fScaleT >= 1 && options.forceTextureFilter == FORCE_DEFAULT_FILTER ) + { + TextureFilter dwFilter = m_dwMagFilter; + m_dwMagFilter = m_dwMinFilter = FILTER_POINT; + ApplyTextureFilter(); + ApplyRDPScissor(); + res = RenderTexRect(); + m_dwMagFilter = m_dwMinFilter = dwFilter; + ApplyTextureFilter(); + } + else + { + ApplyRDPScissor(); + res = RenderTexRect(); + } + TurnFogOnOff(gRSP.bFogEnabled); + + if( gRDP.otherMode.cycle_type >= CYCLE_TYPE_COPY || !gRDP.otherMode.z_cmp ) + { + ZBufferEnable(gRSP.bZBufferEnabled); + } + + DEBUGGER_PAUSE_AT_COND_AND_DUMP_COUNT_N((eventToPause == NEXT_FLUSH_TRI || eventToPause == NEXT_TEXTRECT), { + DebuggerAppendMsg("TexRect: tile=%d, X0=%d, Y0=%d, X1=%d, Y1=%d,\nfS0=%f, fT0=%f, ScaleS=%f, ScaleT=%f\n", + gRSP.curTile, nX0, nY0, nX1, nY1, fS0, fT0, fScaleS, fScaleT); + DebuggerAppendMsg(" : x0=%f, y0=%f, x1=%f, y1=%f\n", g_texRectTVtx[0].x, g_texRectTVtx[0].y, g_texRectTVtx[2].x, g_texRectTVtx[2].y); + DebuggerAppendMsg(" Tex0: u0=%f, v0=%f, u1=%f, v1=%f\n", m_texRectTex1UV[0].u, m_texRectTex1UV[0].v, m_texRectTex1UV[1].u, m_texRectTex1UV[1].v); + if( IsTexel1Enable() ) + { + DebuggerAppendMsg(" Tex1: u0=%f, v0=%f, u1=%f, v1=%f\n", m_texRectTex2UV[0].u, m_texRectTex2UV[0].v, m_texRectTex2UV[1].u, m_texRectTex2UV[1].v); + } + DebuggerAppendMsg("color=%08X, %08X\n", g_texRectTVtx[0].dcDiffuse, g_texRectTVtx[0].dcSpecular); + DebuggerAppendMsg("Pause after TexRect\n"); + if( logCombiners ) m_pColorCombiner->DisplayMuxString(); + }); + + return res; +} + + +bool CRender::TexRectFlip(int nX0, int nY0, int nX1, int nY1, float fS0, float fT0, float fS1, float fT1) +{ + LOG_UCODE("TexRectFlip: X0=%d, Y0=%d, X1=%d, Y1=%d,\n\t\tfS0=%f, fT0=%f, fS1=%f, fT1=%f ", + nX0, nY0, nX1, nY1, fS0, fT0, fS1, fT1); + + if( status.bHandleN64RenderTexture && !status.bDirectWriteIntoRDRAM ) + { + status.bFrameBufferIsDrawn = true; + status.bFrameBufferDrawnByTriangles = true; + } + + PrepareTextures(); + + // Save ZBuffer state + m_savedZBufferFlag = gRSP.bZBufferEnabled; + if( gRDP.otherMode.depth_source == 0 ) ZBufferEnable( FALSE ); + + float widthDiv = g_textures[gRSP.curTile].m_fTexWidth; + float heightDiv = g_textures[gRSP.curTile].m_fTexHeight; + + //Tile &tile0 = gRDP.tiles[gRSP.curTile]; + + float t0u0 = fS0 / widthDiv; + float t0v0 = fT0 / heightDiv; + + float t0u1 = (fS1 - fS0)/ widthDiv + t0u0; + float t0v1 = (fT1 - fT0)/ heightDiv + t0v0; + + float depth = (gRDP.otherMode.depth_source == 1 ? gRDP.fPrimitiveDepth : 0 ); + + if( t0u0 >= 0 && t0u1 <= 1 && t0u1 >= t0u0 ) SetTextureUFlag(TEXTURE_UV_FLAG_CLAMP, gRSP.curTile); + if( t0v0 >= 0 && t0v1 <= 1 && t0v1 >= t0v0 ) SetTextureVFlag(TEXTURE_UV_FLAG_CLAMP, gRSP.curTile); + + SetCombinerAndBlender(); + + COLOR speColor = PostProcessSpecularColor(); + COLOR difColor = PostProcessDiffuseColor(gRDP.primitiveColor); + + // Same as TexRect, but with texcoords 0,2 swapped + g_texRectTVtx[0].x = ViewPortTranslatei_x(nX0); + g_texRectTVtx[0].y = ViewPortTranslatei_y(nY0); + g_texRectTVtx[0].dcDiffuse = difColor; + g_texRectTVtx[0].dcSpecular = speColor; + + g_texRectTVtx[1].x = ViewPortTranslatei_x(nX1); + g_texRectTVtx[1].y = ViewPortTranslatei_y(nY0); + g_texRectTVtx[1].dcDiffuse = difColor; + g_texRectTVtx[1].dcSpecular = speColor; + + g_texRectTVtx[2].x = ViewPortTranslatei_x(nX1); + g_texRectTVtx[2].y = ViewPortTranslatei_y(nY1); + g_texRectTVtx[2].dcDiffuse = difColor; + g_texRectTVtx[2].dcSpecular = speColor; + + g_texRectTVtx[3].x = ViewPortTranslatei_x(nX0); + g_texRectTVtx[3].y = ViewPortTranslatei_y(nY1); + g_texRectTVtx[3].dcDiffuse = difColor; + g_texRectTVtx[3].dcSpecular = speColor; + + g_texRectTVtx[0].z = g_texRectTVtx[1].z = g_texRectTVtx[2].z = g_texRectTVtx[3].z = depth; + g_texRectTVtx[0].rhw = g_texRectTVtx[1].rhw = g_texRectTVtx[2].rhw = g_texRectTVtx[3].rhw = 1.0f; + + SetVertexTextureUVCoord(g_texRectTVtx[0], t0u0, t0v0); + SetVertexTextureUVCoord(g_texRectTVtx[1], t0u0, t0v1); + SetVertexTextureUVCoord(g_texRectTVtx[2], t0u1, t0v1); + SetVertexTextureUVCoord(g_texRectTVtx[3], t0u1, t0v0); + + TurnFogOnOff(false); + ApplyRDPScissor(); + bool res = RenderTexRect(); + + TurnFogOnOff(gRSP.bFogEnabled); + + // Restore state + ZBufferEnable( m_savedZBufferFlag ); + + DEBUGGER_PAUSE_AT_COND_AND_DUMP_COUNT_N((eventToPause == NEXT_FLUSH_TRI || eventToPause == NEXT_TEXTRECT), { + DebuggerAppendMsg("TexRectFlip: tile=%d, X0=%d, Y0=%d, X1=%d, Y1=%d,\nfS0=%f, fT0=%f, nfS1=%f, fT1=%f\n", + gRSP.curTile, nX0, nY0, nX1, nY1, fS0, fT0, fS1, fT1); + DebuggerAppendMsg(" : x0=%f, y0=%f, x1=%f, y1=%f\n", g_texRectTVtx[0].x, g_texRectTVtx[0].y, g_texRectTVtx[2].x, g_texRectTVtx[2].y); + DebuggerAppendMsg(" Tex0: u0=%f, v0=%f, u1=%f, v1=%f\n", g_texRectTVtx[0].tcord[0].u, g_texRectTVtx[0].tcord[0].v, g_texRectTVtx[2].tcord[0].u, g_texRectTVtx[2].tcord[0].v); + TRACE0("Pause after TexRectFlip\n"); + if( logCombiners ) m_pColorCombiner->DisplayMuxString(); + }); + + return res; +} + + +void CRender::StartDrawSimple2DTexture(float x0, float y0, float x1, float y1, float u0, float v0, float u1, float v1, COLOR dif, COLOR spe, float z, float rhw) +{ + g_texRectTVtx[0].x = ViewPortTranslatei_x(x0); // << Error here, shouldn't divid by 4 + g_texRectTVtx[0].y = ViewPortTranslatei_y(y0); + g_texRectTVtx[0].dcDiffuse = dif; + g_texRectTVtx[0].dcSpecular = spe; + g_texRectTVtx[0].tcord[0].u = u0; + g_texRectTVtx[0].tcord[0].v = v0; + + + g_texRectTVtx[1].x = ViewPortTranslatei_x(x1); + g_texRectTVtx[1].y = ViewPortTranslatei_y(y0); + g_texRectTVtx[1].dcDiffuse = dif; + g_texRectTVtx[1].dcSpecular = spe; + g_texRectTVtx[1].tcord[0].u = u1; + g_texRectTVtx[1].tcord[0].v = v0; + + g_texRectTVtx[2].x = ViewPortTranslatei_x(x1); + g_texRectTVtx[2].y = ViewPortTranslatei_y(y1); + g_texRectTVtx[2].dcDiffuse = dif; + g_texRectTVtx[2].dcSpecular = spe; + g_texRectTVtx[2].tcord[0].u = u1; + g_texRectTVtx[2].tcord[0].v = v1; + + g_texRectTVtx[3].x = ViewPortTranslatei_x(x0); + g_texRectTVtx[3].y = ViewPortTranslatei_y(y1); + g_texRectTVtx[3].dcDiffuse = dif; + g_texRectTVtx[3].dcSpecular = spe; + g_texRectTVtx[3].tcord[0].u = u0; + g_texRectTVtx[3].tcord[0].v = v1; + + RenderTexture &txtr = g_textures[0]; + if( txtr.pTextureEntry && txtr.pTextureEntry->txtrBufIdx > 0 ) + { + RenderTextureInfo &info = gRenderTextureInfos[txtr.pTextureEntry->txtrBufIdx-1]; + g_texRectTVtx[0].tcord[0].u *= info.scaleX; + g_texRectTVtx[0].tcord[0].v *= info.scaleY; + g_texRectTVtx[1].tcord[0].u *= info.scaleX; + g_texRectTVtx[1].tcord[0].v *= info.scaleY; + g_texRectTVtx[2].tcord[0].u *= info.scaleX; + g_texRectTVtx[2].tcord[0].v *= info.scaleY; + g_texRectTVtx[3].tcord[0].u *= info.scaleX; + g_texRectTVtx[3].tcord[0].v *= info.scaleY; + } + + g_texRectTVtx[0].z = g_texRectTVtx[1].z = g_texRectTVtx[2].z = g_texRectTVtx[3].z = z; + g_texRectTVtx[0].rhw = g_texRectTVtx[1].rhw = g_texRectTVtx[2].rhw = g_texRectTVtx[3].rhw = rhw; +} + +void CRender::StartDrawSimpleRect(int nX0, int nY0, int nX1, int nY1, uint32 dwColor, float depth, float rhw) +{ + m_simpleRectVtx[0].x = ViewPortTranslatei_x(nX0); + m_simpleRectVtx[1].x = ViewPortTranslatei_x(nX1); + m_simpleRectVtx[0].y = ViewPortTranslatei_y(nY0); + m_simpleRectVtx[1].y = ViewPortTranslatei_y(nY1); +} + +void CRender::SetAddressUAllStages(uint32 dwTile, TextureUVFlag dwFlag) +{ +} + +void CRender::SetAddressVAllStages(uint32 dwTile, TextureUVFlag dwFlag) +{ +} + +void CRender::SetAllTexelRepeatFlag() +{ + if( IsTextureEnabled() ) + { + if( IsTexel0Enable() || gRDP.otherMode.cycle_type == CYCLE_TYPE_COPY ) + SetTexelRepeatFlags(gRSP.curTile); + if( IsTexel1Enable() ) + SetTexelRepeatFlags((gRSP.curTile+1)&7); + } +} + + +void CRender::SetTexelRepeatFlags(uint32 dwTile) +{ + Tile &tile = gRDP.tiles[dwTile]; + + if( tile.bForceClampS ) + SetTextureUFlag(TEXTURE_UV_FLAG_CLAMP, dwTile); + else if( tile.bForceWrapS ) + SetTextureUFlag(TEXTURE_UV_FLAG_WRAP, dwTile); + else if( tile.dwMaskS == 0 || tile.bClampS ) + { + if( gRDP.otherMode.cycle_type >= CYCLE_TYPE_COPY ) + SetTextureUFlag(TEXTURE_UV_FLAG_WRAP, dwTile); // Can not clamp in COPY/FILL mode + else + SetTextureUFlag(TEXTURE_UV_FLAG_CLAMP, dwTile); + } + else if (tile.bMirrorS ) + SetTextureUFlag(TEXTURE_UV_FLAG_MIRROR, dwTile); + else + SetTextureUFlag(TEXTURE_UV_FLAG_WRAP, dwTile); + + if( tile.bForceClampT ) + SetTextureVFlag(TEXTURE_UV_FLAG_CLAMP, dwTile); + else if( tile.bForceWrapT ) + SetTextureVFlag(TEXTURE_UV_FLAG_WRAP, dwTile); + else if( tile.dwMaskT == 0 || tile.bClampT) + { + if( gRDP.otherMode.cycle_type >= CYCLE_TYPE_COPY ) + SetTextureVFlag(TEXTURE_UV_FLAG_WRAP, dwTile); // Can not clamp in COPY/FILL mode + else + SetTextureVFlag(TEXTURE_UV_FLAG_CLAMP, dwTile); + } + else if (tile.bMirrorT ) + SetTextureVFlag(TEXTURE_UV_FLAG_MIRROR, dwTile); + else + SetTextureVFlag(TEXTURE_UV_FLAG_WRAP, dwTile); +} + +void CRender::Initialize(void) +{ + ClearDeviceObjects(); + InitDeviceObjects(); +} + +void CRender::CleanUp(void) +{ + m_pColorCombiner->CleanUp(); + ClearDeviceObjects(); +} + +void myVec3Transform(float *vecout, float *vecin, float* m) +{ + float w = m[3]*vecin[0]+m[7]*vecin[1]+m[11]*vecin[2]+m[15]; + vecout[0] = (m[0]*vecin[0]+m[4]*vecin[1]+m[8]*vecin[2]+m[12])/w; + vecout[1] = (m[1]*vecin[0]+m[5]*vecin[1]+m[9]*vecin[2]+m[13])/w; + vecout[2] = (m[2]*vecin[0]+m[6]*vecin[1]+m[10]*vecin[2]+m[14])/w; +} + +void CRender::SetTextureEnableAndScale(int dwTile, bool bEnable, float fScaleX, float fScaleY) +{ + gRSP.bTextureEnabled = bEnable; + + if( bEnable ) + { + if( gRSP.curTile != (unsigned int)dwTile ) + gRDP.textureIsChanged = true; + + gRSP.curTile = dwTile; + + gRSP.fTexScaleX = fScaleX; + gRSP.fTexScaleY = fScaleY; + + if( fScaleX == 0 || fScaleY == 0 ) + { + gRSP.fTexScaleX = 1/32.0f; + gRSP.fTexScaleY = 1/32.0f; + } + } +} + +void CRender::SetFogFlagForNegativeW() +{ + if( !gRSP.bFogEnabled ) return; + + m_bFogStateSave = gRSP.bFogEnabled; + + bool flag=gRSP.bFogEnabled; + + for (uint32 i = 0; i < gRSP.numVertices; i++) + { + if( g_vtxBuffer[i].rhw < 0 ) + flag = FALSE; + } + + TurnFogOnOff(flag); +} + +void CRender::RestoreFogFlag() +{ + if( !gRSP.bFogEnabled ) return; + TurnFogOnOff(m_bFogStateSave); +} + +void CRender::SetViewport(int nLeft, int nTop, int nRight, int nBottom, int maxZ) +{ + if( status.bHandleN64RenderTexture ) + return; + + static float MultX=0, MultY=0; + + if( gRSP.nVPLeftN == nLeft && gRSP.nVPTopN == nTop && + gRSP.nVPRightN == nRight && gRSP.nVPBottomN == nBottom && + MultX==windowSetting.fMultX && MultY==windowSetting.fMultY) + { + // no changes + return; + } + + MultX=windowSetting.fMultX; + MultY=windowSetting.fMultY; + + gRSP.maxZ = maxZ; + gRSP.nVPLeftN = nLeft; + gRSP.nVPTopN = nTop; + gRSP.nVPRightN = nRight; + gRSP.nVPBottomN = nBottom; + gRSP.nVPWidthN = nRight - nLeft + 1; + gRSP.nVPHeightN = nBottom - nTop + 1; + + UpdateClipRectangle(); + SetViewportRender(); + + LOG_UCODE("SetViewport (%d,%d - %d,%d)",gRSP.nVPLeftN, gRSP.nVPTopN, gRSP.nVPRightN, gRSP.nVPBottomN); +} + +extern bool bHalfTxtScale; + +bool CRender::DrawTriangles() +{ + if( !status.bCIBufferIsRendered ) g_pFrameBufferManager->ActiveTextureBuffer(); + + DEBUGGER_ONLY_IF( (!debuggerEnableZBuffer), {ZBufferEnable( FALSE );} ); + + if( status.bVIOriginIsUpdated == true && currentRomOptions.screenUpdateSetting==SCREEN_UPDATE_AT_1ST_PRIMITIVE ) + { + status.bVIOriginIsUpdated=false; + CGraphicsContext::Get()->UpdateFrame(); + DEBUGGER_PAUSE_AND_DUMP_NO_UPDATE(NEXT_SET_CIMG,{DebuggerAppendMsg("Screen Update at 1st triangle");}); + } + + // Hack for Pilotwings 64 (U) [!].v64 + static bool skipNext=false; + if( options.enableHackForGames == HACK_FOR_PILOT_WINGS ) + { + if( IsUsedAsDI(g_CI.dwAddr) && gRDP.otherMode.z_cmp+gRDP.otherMode.z_upd > 0 ) + { + TRACE0("Warning: using Flushtris to write Zbuffer" ); + gRSP.numVertices = 0; + gRSP.maxVertexID = 0; + skipNext = true; + return true; + } + else if( skipNext ) + { + skipNext = false; + gRSP.numVertices = 0; + gRSP.maxVertexID = 0; + return true; + } + } + + if( status.bN64IsDrawingTextureBuffer && frameBufferOptions.bIgnore ) + { + gRSP.numVertices = 0; + gRSP.maxVertexID = 0; + return true; + } + + extern bool bConkerHideShadow; + if( options.enableHackForGames == HACK_FOR_CONKER && bConkerHideShadow ) + { + gRSP.numVertices = 0; + gRSP.maxVertexID = 0; + return true; + } + + if( IsUsedAsDI(g_CI.dwAddr) && !status.bHandleN64RenderTexture ) + { + status.bFrameBufferIsDrawn = true; + } + + /* + if( status.bHandleN64RenderTexture && g_pRenderTextureInfo->CI_Info.dwSize == TXT_SIZE_8b ) + { + gRSP.numVertices = 0; + gRSP.maxVertexID = 0; + return true; + } + */ + + if (gRSP.numVertices == 0) return true; + if( status.bHandleN64RenderTexture ) + { + g_pRenderTextureInfo->maxUsedHeight = g_pRenderTextureInfo->N64Height; + if( !status.bDirectWriteIntoRDRAM ) + { + status.bFrameBufferIsDrawn = true; + status.bFrameBufferDrawnByTriangles = true; + } + } + + if( !gRDP.bFogEnableInBlender && gRSP.bFogEnabled ) + { + TurnFogOnOff(false); + } + + for( int t=0; t<2; t++ ) + { + float halfscaleS = 1; + + // This will get rid of the thin black lines + if( t==0 && !(m_pColorCombiner->m_bTex0Enabled) ) + continue; + else + { + if( ( gRDP.tiles[gRSP.curTile].dwSize == TXT_SIZE_32b && options.enableHackForGames == HACK_FOR_RUMBLE ) || + (bHalfTxtScale && g_curRomInfo.bTextureScaleHack ) || + (options.enableHackForGames == HACK_FOR_POLARISSNOCROSS && gRDP.tiles[7].dwFormat == TXT_FMT_CI && gRDP.tiles[7].dwSize == TXT_SIZE_8b + && gRDP.tiles[0].dwFormat == TXT_FMT_CI && gRDP.tiles[0].dwSize == TXT_SIZE_8b && gRSP.curTile == 0 )) + { + halfscaleS = 0.5; + } + } + + if( t==1 && !(m_pColorCombiner->m_bTex1Enabled) ) + break; + + if( halfscaleS < 1 ) + { + for( uint32 i=0; i 1.0 || g_vtxBuffer[i].tcord[t].u < 0.0 ) + { + clampS = false; + break; + } + } + + for( uint32 i=0; i 1.0 || g_vtxBuffer[i].tcord[t].v < 0.0 ) + { + clampT = false; + break; + } + } + + if( clampS ) + { + SetTextureUFlag(TEXTURE_UV_FLAG_CLAMP, gRSP.curTile+t); + } + if( clampT ) + { + SetTextureVFlag(TEXTURE_UV_FLAG_CLAMP, gRSP.curTile+t); + } + */ + } + + if( status.bHandleN64RenderTexture && g_pRenderTextureInfo->CI_Info.dwSize == TXT_SIZE_8b ) + { + ZBufferEnable(FALSE); + } + + ApplyScissorWithClipRatio(); + + if( g_curRomInfo.bZHack ) + { + extern void HackZAll(); + HackZAll(); + } + + bool res = RenderFlushTris(); + g_clippedVtxCount = 0; + + LOG_UCODE("DrawTriangles: Draw %d Triangles", gRSP.numVertices/3); + + gRSP.numVertices = 0; // Reset index + gRSP.maxVertexID = 0; + + DEBUGGER_PAUSE_AND_DUMP_COUNT_N(NEXT_FLUSH_TRI, { + TRACE0("Pause after DrawTriangles\n"); + if( logCombiners ) m_pColorCombiner->DisplayMuxString(); + }); + + if( !gRDP.bFogEnableInBlender && gRSP.bFogEnabled ) + { + TurnFogOnOff(true); + } + + return res; +} + +inline int ReverseCITableLookup(uint32 *pTable, int size, uint32 val) +{ + for( int i=0; i=2 || entry.ti.Format == TXT_FMT_CI || entry.ti.Format == TXT_FMT_RGBA) && entry.ti.Size <= TXT_SIZE_8b ) ) + { + // No a CI texture + return false; + } + if ( entry.ti.TLutFmt != TLUT_FMT_RGBA16 && entry.ti.TLutFmt != TLUT_FMT_IA16 ) + { + TRACE0("Invalid Tlut format"); + return false; + } + + if( !entry.pTexture ) + { + TRACE0("Null texture"); + return false; + } + + uint32 *pTable = NULL; + int tableSize; + uint16 * pPal = (uint16 *)entry.ti.PalAddress; + + // Create the pallette table + if( entry.ti.Size == TXT_SIZE_4b ) + { + // 4-bit table + tableSize = 16; + pTable = new uint32[16]; + + for( int i=0; i<16; i++ ) + { + pTable[i] = entry.ti.TLutFmt == TLUT_FMT_RGBA16 ? Convert555ToRGBA(pPal[i^1]) : ConvertIA16ToRGBA(pPal[i^1]); + } + } + else + { + // 8-bit table + tableSize = 256; + pTable = new uint32[256]; + + for( int i=0; i<256; i++ ) + { + pTable[i] = entry.ti.TLutFmt == TLUT_FMT_RGBA16 ? Convert555ToRGBA(pPal[i^1]) : ConvertIA16ToRGBA(pPal[i^1]); + } + } + + // Reversely convert current texture to indexed textures + CTexture &texture = *entry.pTexture; + //int width = bWholeTexture ? texture.m_dwCreatedTextureWidth : texture.m_dwWidth; + //int height = bWholeTexture ? texture.m_dwCreatedTextureHeight : texture.m_dwHeight; + int width = bWholeTexture ? texture.m_dwCreatedTextureWidth : entry.ti.WidthToLoad; + int height = bWholeTexture ? texture.m_dwCreatedTextureHeight : entry.ti.HeightToLoad; + int bufSizePerLine = (((((width << entry.ti.Size) + 1 ) >> 1)+3) >> 2)*4; // pad to 32bit boundary + int bufSize = bufSizePerLine*height; + unsigned char *pbuf = new unsigned char[bufSize]; + + DrawInfo srcInfo; + if( texture.StartUpdate(&srcInfo) ) + { + int idx = 0; + for( int i=height-1; i>=0; i--) + { + uint32 *pSrc = (uint32*)((unsigned char*)srcInfo.lpSurface+srcInfo.lPitch * i); + for( int j=0; j>1] = (pbuf[idx>>1]<<4) | val; + idx++; + } + else + { + // 0 + pbuf[idx>>1] = (unsigned char)val; + idx++; + } + } + else + { + // 8 bits + pbuf[idx++] = (unsigned char)val; + } + } + if( entry.ti.Size == TXT_SIZE_4b ) + { + if( idx%8 ) idx = (idx/8+1)*8; + } + else + { + if( idx%4 ) idx = (idx/4+1)*4; + } + } + + + texture.EndUpdate(&srcInfo); + } + + // Create BMP color indexed file + if( strcasecmp(right(filename,4),".bmp") != 0 ) + strcat(filename,".bmp"); + + BITMAPFILEHEADER fileHeader; + BITMAPINFOHEADER infoHeader; + + infoHeader.biSize = sizeof( BITMAPINFOHEADER ); + infoHeader.biWidth = width; + infoHeader.biHeight = height; + infoHeader.biPlanes = 1; + infoHeader.biBitCount = entry.ti.Size == TXT_SIZE_4b ? 4 : 8; + infoHeader.biCompression = BI_RGB; + infoHeader.biSizeImage = bufSize; + infoHeader.biXPelsPerMeter = 0; + infoHeader.biYPelsPerMeter = 0; + infoHeader.biClrUsed = 0; + infoHeader.biClrImportant = 0; + + fileHeader.bfType = 19778; + fileHeader.bfSize = sizeof( BITMAPFILEHEADER ) + sizeof( BITMAPINFOHEADER ) + infoHeader.biSizeImage + tableSize*4; + fileHeader.bfReserved1 = fileHeader.bfReserved2 = 0; + fileHeader.bfOffBits = sizeof( BITMAPFILEHEADER ) + sizeof( BITMAPINFOHEADER ) + tableSize*4; + + + FILE *f; + f = fopen(filename, "wb"); + if(f != NULL) + { + if (fwrite(&fileHeader, sizeof(BITMAPFILEHEADER), 1, f) != 1 || + fwrite(&infoHeader, sizeof(BITMAPINFOHEADER), 1, f) != 1 || + fwrite(pTable, tableSize*4, 1, f) != 1 || + fwrite(pbuf, infoHeader.biSizeImage, 1, f) != 1) + printf("failed to write out texture data to image file '%s'", filename); + + fclose(f); + } + else + { + // Do something + TRACE1("Fail to create file %s", filename); + } + + // Clean up + delete [] pTable; + delete [] pbuf; + + return true; +} + +void CRender::SaveTextureToFile(CTexture &texture, char *filename, TextureChannel channel, bool bShow, bool bWholeTexture, int width, int height) +{ + if( width < 0 || height < 0 ) + { + width = bWholeTexture ? texture.m_dwCreatedTextureWidth : texture.m_dwWidth; + height = bWholeTexture ? texture.m_dwCreatedTextureHeight : texture.m_dwHeight; + } + + unsigned char *pbuf = new unsigned char[width*height* (channel == TXT_RGBA ? 4 : 3)]; + if( pbuf ) + { + DrawInfo srcInfo; + if( texture.StartUpdate(&srcInfo) ) + { + if( channel == TXT_RGBA ) + { + uint32 *pbuf2 = (uint32*)pbuf; + for( int i=height-1; i>=0; i--) + { + uint32 *pSrc = (uint32*)((unsigned char*)srcInfo.lpSurface+srcInfo.lPitch * i); + for( int j=0; j=0; i--) + { + unsigned char *pSrc = (unsigned char*)srcInfo.lpSurface+srcInfo.lPitch * i; + for( int j=0; j=2 || g_textures[tex].pTextureEntry->ti.Format == TXT_FMT_CI || g_textures[tex].pTextureEntry->ti.Format == TXT_FMT_RGBA) && g_textures[tex].pTextureEntry->ti.Size <= TXT_SIZE_8b ) + { + sprintf(filename, "\\%s#%08X#%d#%d_ci", g_curRomInfo.szGameName, g_textures[tex].pTextureEntry->dwCRC, + g_textures[tex].pTextureEntry->ti.Format, + g_textures[tex].pTextureEntry->ti.Size); + SaveCITextureToFile(*(g_textures[tex].pTextureEntry), filename, bShow && bInWhole, false); + + sprintf(filename, "\\%s#%08X#%d#%d#%08X_ci", g_curRomInfo.szGameName, g_textures[tex].pTextureEntry->dwCRC, + g_textures[tex].pTextureEntry->ti.Format, + g_textures[tex].pTextureEntry->ti.Size, g_textures[tex].pTextureEntry->dwPalCRC); + SaveCITextureToFile(*(g_textures[tex].pTextureEntry), filename, false, false); + + sprintf(filename, "\\%s#%08X#%d#%d#%08X_ciByRGBA", g_curRomInfo.szGameName, g_textures[tex].pTextureEntry->dwCRC, + g_textures[tex].pTextureEntry->ti.Format, + g_textures[tex].pTextureEntry->ti.Size, g_textures[tex].pTextureEntry->dwPalCRC); + SaveTextureToFile(*pBaseTexture, filename, TXT_RGBA, false, false, g_textures[tex].pTextureEntry->ti.WidthToLoad, g_textures[tex].pTextureEntry->ti.HeightToLoad); + + DebuggerAppendMsg("Base texture is stored at: %s", filename); + + if( !bInWhole && bShow ) + { + sprintf(filename, "\\%s#%08X#%d#%d_ci_%s_debugger", g_curRomInfo.szGameName, g_textures[tex].pTextureEntry->dwCRC, + g_textures[tex].pTextureEntry->ti.Format, + g_textures[tex].pTextureEntry->ti.Size, channel == TXT_ALPHA ? "a" : channel == TXT_RGBA ? "all" : "rgb"); + SaveTextureToFile(*pEnhancedTexture, filename, channel, true, true); + DebuggerAppendMsg("Whole texture is stored at: %s", filename); + } + } + else + { + sprintf(filename, "\\%s#%08X#%d#%d_%s", g_curRomInfo.szGameName, g_textures[tex].pTextureEntry->dwCRC, + g_textures[tex].pTextureEntry->ti.Format, + g_textures[tex].pTextureEntry->ti.Size, channel == TXT_ALPHA ? "a" : channel == TXT_RGBA ? "all" : "rgb"); + SaveTextureToFile(*pBaseTexture, filename, channel, bShow && bInWhole, false,g_textures[tex].pTextureEntry->ti.WidthToLoad, g_textures[tex].pTextureEntry->ti.HeightToLoad); + DebuggerAppendMsg("Base texture is stored at: %s", filename); + + if( !bInWhole && bShow ) + { + sprintf(filename, "\\%s#%08X#%d#%d_%s_debugger", g_curRomInfo.szGameName, g_textures[tex].pTextureEntry->dwCRC, + g_textures[tex].pTextureEntry->ti.Format, + g_textures[tex].pTextureEntry->ti.Size, channel == TXT_ALPHA ? "a" : channel == TXT_RGBA ? "all" : "rgb"); + SaveTextureToFile(*pEnhancedTexture, filename, channel, true, true); + DebuggerAppendMsg("Whole texture is stored at: %s", filename); + } + } +} +#endif + +extern RenderTextureInfo gRenderTextureInfos[]; +void SetVertexTextureUVCoord(TexCord &dst, float s, float t, int tile, TxtrCacheEntry *pEntry) +{ + RenderTexture &txtr = g_textures[tile]; + RenderTextureInfo &info = gRenderTextureInfos[pEntry->txtrBufIdx-1]; + + uint32 addrOffset = g_TI.dwAddr-info.CI_Info.dwAddr; + uint32 extraTop = (addrOffset>>(info.CI_Info.dwSize-1)) /info.CI_Info.dwWidth; + uint32 extraLeft = (addrOffset>>(info.CI_Info.dwSize-1))%info.CI_Info.dwWidth; + + if( pEntry->txtrBufIdx > 0 ) + { + // Loading from render_texture or back buffer + s += (extraLeft+pEntry->ti.LeftToLoad)/txtr.m_fTexWidth; + t += (extraTop+pEntry->ti.TopToLoad)/txtr.m_fTexHeight; + + s *= info.scaleX; + t *= info.scaleY; + } + + dst.u = s; + dst.v = t; +} + +void CRender::SetVertexTextureUVCoord(TLITVERTEX &v, float fTex0S, float fTex0T) +{ + RenderTexture &txtr = g_textures[0]; + if( txtr.pTextureEntry && txtr.pTextureEntry->txtrBufIdx > 0 ) + { + ::SetVertexTextureUVCoord(v.tcord[0], fTex0S, fTex0T, 0, txtr.pTextureEntry); + } + else + { + v.tcord[0].u = fTex0S; + v.tcord[0].v = fTex0T; + } +} +void CRender::SetVertexTextureUVCoord(TLITVERTEX &v, float fTex0S, float fTex0T, float fTex1S, float fTex1T) +{ + if( (options.enableHackForGames == HACK_FOR_ZELDA||options.enableHackForGames == HACK_FOR_ZELDA_MM) && m_Mux == 0x00262a60150c937fLL && gRSP.curTile == 0 ) + { + // Hack for Zelda Sun + Tile &t0 = gRDP.tiles[0]; + Tile &t1 = gRDP.tiles[1]; + if( t0.dwFormat == TXT_FMT_I && t0.dwSize == TXT_SIZE_8b && t0.dwWidth == 64 && + t1.dwFormat == TXT_FMT_I && t1.dwSize == TXT_SIZE_8b && t1.dwWidth == 64 && + t0.dwHeight == t1.dwHeight ) + { + fTex0S /= 2; + fTex0T /= 2; + fTex1S /= 2; + fTex1T /= 2; + } + } + + RenderTexture &txtr0 = g_textures[0]; + if( txtr0.pTextureEntry && txtr0.pTextureEntry->txtrBufIdx > 0 ) + { + ::SetVertexTextureUVCoord(v.tcord[0], fTex0S, fTex0T, 0, txtr0.pTextureEntry); + } + else + { + v.tcord[0].u = fTex0S; + v.tcord[0].v = fTex0T; + } + + RenderTexture &txtr1 = g_textures[1]; + if( txtr1.pTextureEntry && txtr1.pTextureEntry->txtrBufIdx > 0 ) + { + ::SetVertexTextureUVCoord(v.tcord[1], fTex1S, fTex1T, 1, txtr1.pTextureEntry); + } + else + { + v.tcord[1].u = fTex1S; + v.tcord[1].v = fTex1T; + } +} + +void CRender::SetClipRatio(uint32 type, uint32 w1) +{ + bool modified = false; + switch(type) + { + case RSP_MV_WORD_OFFSET_CLIP_RNX: + LOG_UCODE(" RSP_MOVE_WORD_CLIP NegX: %d", (int)(short)w1); + if( gRSP.clip_ratio_negx != (short)w1 ) + { + gRSP.clip_ratio_negx = (short)w1; + modified = true; + } + break; + case RSP_MV_WORD_OFFSET_CLIP_RNY: + LOG_UCODE(" RSP_MOVE_WORD_CLIP NegY: %d", (int)(short)w1); + if( gRSP.clip_ratio_negy != (short)w1 ) + { + gRSP.clip_ratio_negy = (short)w1; + modified = true; + } + break; + case RSP_MV_WORD_OFFSET_CLIP_RPX: + LOG_UCODE(" RSP_MOVE_WORD_CLIP PosX: %d", (int)(short)w1); + if( gRSP.clip_ratio_posx != -(short)w1 ) + { + gRSP.clip_ratio_posx = -(short)w1; + modified = true; + } + break; + case RSP_MV_WORD_OFFSET_CLIP_RPY: + LOG_UCODE(" RSP_MOVE_WORD_CLIP PosY: %d", (int)(short)w1); + if( gRSP.clip_ratio_posy != -(short)w1 ) + { + gRSP.clip_ratio_posy = -(short)w1; + modified = true; + } + break; + } + + if( modified ) + { + UpdateClipRectangle(); + } + +} +void CRender::UpdateClipRectangle() +{ + if( status.bHandleN64RenderTexture ) + { + //windowSetting.fMultX = windowSetting.fMultY = 1; + windowSetting.vpLeftW = 0; + windowSetting.vpTopW = 0; + windowSetting.vpRightW = newRenderTextureInfo.bufferWidth; + windowSetting.vpBottomW = newRenderTextureInfo.bufferHeight; + windowSetting.vpWidthW = newRenderTextureInfo.bufferWidth; + windowSetting.vpHeightW = newRenderTextureInfo.bufferHeight; + + gRSP.vtxXMul = windowSetting.vpWidthW/2.0f; + gRSP.vtxXAdd = gRSP.vtxXMul + windowSetting.vpLeftW; + gRSP.vtxYMul = -windowSetting.vpHeightW/2.0f; + gRSP.vtxYAdd = windowSetting.vpHeightW/2.0f + windowSetting.vpTopW+windowSetting.toolbarHeightToUse; + + // Update clip rectangle by setting scissor + + int halfx = newRenderTextureInfo.bufferWidth/2; + int halfy = newRenderTextureInfo.bufferHeight/2; + int centerx = halfx; + int centery = halfy; + + gRSP.clip_ratio_left = centerx - halfx * gRSP.clip_ratio_negx; + gRSP.clip_ratio_top = centery - halfy * gRSP.clip_ratio_negy; + gRSP.clip_ratio_right = centerx + halfx * gRSP.clip_ratio_posx; + gRSP.clip_ratio_bottom = centery + halfy * gRSP.clip_ratio_posy; + } + else + { + windowSetting.vpLeftW = int(gRSP.nVPLeftN * windowSetting.fMultX); + windowSetting.vpTopW = int(gRSP.nVPTopN * windowSetting.fMultY); + windowSetting.vpRightW = int(gRSP.nVPRightN* windowSetting.fMultX); + windowSetting.vpBottomW = int(gRSP.nVPBottomN* windowSetting.fMultY); + windowSetting.vpWidthW = int((gRSP.nVPRightN - gRSP.nVPLeftN + 1) * windowSetting.fMultX); + windowSetting.vpHeightW = int((gRSP.nVPBottomN - gRSP.nVPTopN + 1) * windowSetting.fMultY); + + gRSP.vtxXMul = windowSetting.vpWidthW/2.0f; + gRSP.vtxXAdd = gRSP.vtxXMul + windowSetting.vpLeftW; + gRSP.vtxYMul = -windowSetting.vpHeightW/2.0f; + gRSP.vtxYAdd = windowSetting.vpHeightW/2.0f + windowSetting.vpTopW+windowSetting.toolbarHeightToUse; + + // Update clip rectangle by setting scissor + + int halfx = gRSP.nVPWidthN/2; + int halfy = gRSP.nVPHeightN/2; + int centerx = gRSP.nVPLeftN+halfx; + int centery = gRSP.nVPTopN+halfy; + + gRSP.clip_ratio_left = centerx - halfx * gRSP.clip_ratio_negx; + gRSP.clip_ratio_top = centery - halfy * gRSP.clip_ratio_negy; + gRSP.clip_ratio_right = centerx + halfx * gRSP.clip_ratio_posx; + gRSP.clip_ratio_bottom = centery + halfy * gRSP.clip_ratio_posy; + } + + UpdateScissorWithClipRatio(); +} + +void CRender::UpdateScissorWithClipRatio() +{ + gRSP.real_clip_scissor_left = std::max(gRDP.scissor.left, gRSP.clip_ratio_left); + gRSP.real_clip_scissor_top = std::max(gRDP.scissor.top, gRSP.clip_ratio_top); + gRSP.real_clip_scissor_right = std::min(gRDP.scissor.right,gRSP.clip_ratio_right); + gRSP.real_clip_scissor_bottom = std::min(gRDP.scissor.bottom, gRSP.clip_ratio_bottom); + + gRSP.real_clip_scissor_left = std::max(gRSP.real_clip_scissor_left, 0); + gRSP.real_clip_scissor_top = std::max(gRSP.real_clip_scissor_top, 0); + gRSP.real_clip_scissor_right = std::min(gRSP.real_clip_scissor_right,windowSetting.uViWidth-1); + gRSP.real_clip_scissor_bottom = std::min(gRSP.real_clip_scissor_bottom, windowSetting.uViHeight-1); + + WindowSettingStruct &w = windowSetting; + w.clipping.left = (uint32)(gRSP.real_clip_scissor_left*windowSetting.fMultX); + w.clipping.top = (uint32)(gRSP.real_clip_scissor_top*windowSetting.fMultY); + w.clipping.bottom = (uint32)(gRSP.real_clip_scissor_bottom*windowSetting.fMultY); + w.clipping.right = (uint32)(gRSP.real_clip_scissor_right*windowSetting.fMultX); + if( w.clipping.left > 0 || w.clipping.top > 0 || w.clipping.right < (uint32)windowSetting.uDisplayWidth-1 || + w.clipping.bottom < (uint32)windowSetting.uDisplayHeight-1 ) + { + w.clipping.needToClip = true; + } + else + { + w.clipping.needToClip = false; + } + w.clipping.width = (uint32)((gRSP.real_clip_scissor_right-gRSP.real_clip_scissor_left+1)*windowSetting.fMultX); + w.clipping.height = (uint32)((gRSP.real_clip_scissor_bottom-gRSP.real_clip_scissor_top+1)*windowSetting.fMultY); + + float halfx = gRSP.nVPWidthN/2.0f; + float halfy = gRSP.nVPHeightN/2.0f; + float centerx = gRSP.nVPLeftN+halfx; + float centery = gRSP.nVPTopN+halfy; + + gRSP.real_clip_ratio_negx = (gRSP.real_clip_scissor_left - centerx)/halfx; + gRSP.real_clip_ratio_negy = (gRSP.real_clip_scissor_top - centery)/halfy; + gRSP.real_clip_ratio_posx = (gRSP.real_clip_scissor_right - centerx)/halfx; + gRSP.real_clip_ratio_posy = (gRSP.real_clip_scissor_bottom - centery)/halfy; + + ApplyScissorWithClipRatio(true); +} + + +// Set other modes not covered by color combiner or alpha blender +void CRender::InitOtherModes(void) +{ + ApplyTextureFilter(); + + // + // I can't think why the hand in mario's menu screen is rendered with an opaque rendermode, + // and no alpha threshold. We set the alpha reference to 1 to ensure that the transparent pixels + // don't get rendered. I hope this doesn't fuck anything else up. + // + if ( gRDP.otherMode.alpha_compare == 0 ) + { + if ( gRDP.otherMode.cvg_x_alpha && (gRDP.otherMode.alpha_cvg_sel || gRDP.otherMode.aa_en ) ) + { + ForceAlphaRef(128); // Strange, I have to use value=2 for pixel shader combiner for Nvidia FX5200 + // for other video cards, value=1 is good enough. + SetAlphaTestEnable(TRUE); + } + else + { + SetAlphaTestEnable(FALSE); + } + } + else if ( gRDP.otherMode.alpha_compare == 3 ) + { + //RDP_ALPHA_COMPARE_DITHER + SetAlphaTestEnable(FALSE); + } + else + { + if( (gRDP.otherMode.alpha_cvg_sel ) && !gRDP.otherMode.cvg_x_alpha ) + { + // Use CVG for pixel alpha + SetAlphaTestEnable(FALSE); + } + else + { + // RDP_ALPHA_COMPARE_THRESHOLD || RDP_ALPHA_COMPARE_DITHER + if( m_dwAlpha==0 ) + ForceAlphaRef(1); + else + ForceAlphaRef(m_dwAlpha); + SetAlphaTestEnable(TRUE); + } + } + + if( options.enableHackForGames == HACK_FOR_SOUTH_PARK_RALLY && m_Mux == 0x00121824ff33ffffLL && + gRSP.bCullFront && gRDP.otherMode.aa_en && gRDP.otherMode.z_cmp && gRDP.otherMode.z_upd ) + { + SetZCompare(FALSE); + } + + + if( gRDP.otherMode.cycle_type >= CYCLE_TYPE_COPY ) + { + // Disable zbuffer for COPY and FILL mode + SetZCompare(FALSE); + } + else + { + SetZCompare(gRDP.otherMode.z_cmp); + SetZUpdate(gRDP.otherMode.z_upd); + } + + /* + if( options.enableHackForGames == HACK_FOR_SOUTH_PARK_RALLY && m_Mux == 0x00121824ff33ffff && + gRSP.bCullFront && gRDP.otherMode.z_cmp && gRDP.otherMode.z_upd )//&& gRDP.otherMode.aa_en ) + { + SetZCompare(FALSE); + SetZUpdate(FALSE); + } + */ +} + + +void CRender::SetTextureFilter(uint32 dwFilter) +{ + if( options.forceTextureFilter == FORCE_DEFAULT_FILTER ) + { + switch(dwFilter) + { + case RDP_TFILTER_AVERAGE: //? + case RDP_TFILTER_BILERP: + m_dwMinFilter = m_dwMagFilter = FILTER_LINEAR; + break; + default: + m_dwMinFilter = m_dwMagFilter = FILTER_POINT; + break; + } + } + else + { + switch( options.forceTextureFilter ) + { + case FORCE_POINT_FILTER: + m_dwMinFilter = m_dwMagFilter = FILTER_POINT; + break; + case FORCE_LINEAR_FILTER: + m_dwMinFilter = m_dwMagFilter = FILTER_LINEAR; + break; + } + } + + ApplyTextureFilter(); +} + +bool SaveRGBBufferToFile(char *filename, unsigned char *buf, int width, int height, int pitch) +{ + if( pitch == -1 ) + pitch = width*3; + + if( strcasecmp(right(filename,3),"bmp") == 0 ) + { + BITMAPFILEHEADER fileHeader; + BITMAPINFOHEADER infoHeader; + + infoHeader.biSize = sizeof( BITMAPINFOHEADER ); + infoHeader.biWidth = width; + infoHeader.biHeight = height; + infoHeader.biPlanes = 1; + infoHeader.biBitCount = 24; + infoHeader.biCompression = BI_RGB; + infoHeader.biSizeImage = width * height * 3; + infoHeader.biXPelsPerMeter = 0; + infoHeader.biYPelsPerMeter = 0; + infoHeader.biClrUsed = 0; + infoHeader.biClrImportant = 0; + + fileHeader.bfType = 19778; + fileHeader.bfSize = sizeof( BITMAPFILEHEADER ) + sizeof( BITMAPINFOHEADER ) + infoHeader.biSizeImage; + fileHeader.bfReserved1 = fileHeader.bfReserved2 = 0; + fileHeader.bfOffBits = sizeof( BITMAPFILEHEADER ) + sizeof( BITMAPINFOHEADER ); + + + FILE *f; + f = fopen(filename, "wb"); + if(f != NULL) + { + if (fwrite(&fileHeader, sizeof(BITMAPFILEHEADER), 1, f) != 1 || + fwrite(&infoHeader, sizeof(BITMAPINFOHEADER), 1, f) != 1 || + fwrite(buf, infoHeader.biSizeImage, 1, f) != 1) + printf("failed to write out texture data to image file '%s'", filename); + + fclose(f); + return true; + } + else + { + // Do something + TRACE1("Fail to create file %s", filename); + return false; + } + } + else + { + if( strcasecmp(right(filename,4),".png") != 0 ) strcat(filename,".png"); + + struct BMGImageStruct img; + memset(&img, 0, sizeof(BMGImageStruct)); + InitBMGImage(&img); + img.bits = buf; + img.bits_per_pixel = 24; + img.height = height; + img.width = width; + img.scan_width = pitch; + BMG_Error code = WritePNG(filename, img); + + if( code == BMG_OK ) + return true; + else + return false; + } +} + +bool SaveRGBABufferToPNGFile(char *filename, unsigned char *buf, int width, int height, int pitch) +{ + if( pitch == -1 ) + pitch = width*4; + + if( strcasecmp(right(filename,4),".png") != 0 ) strcat(filename,".png"); + + struct BMGImageStruct img; + memset(&img, 0, sizeof(BMGImageStruct)); + InitBMGImage(&img); + img.bits = buf; + img.bits_per_pixel = 32; + img.height = height; + img.width = width; + img.scan_width = pitch; + BMG_Error code = WritePNG(filename, img); + + if( code == BMG_OK ) + return true; + else + return false; +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/Render.h b/libmupen64plus/mupen64plus-video-rice/src/Render.h new file mode 100644 index 0000000000..9ae2849fe0 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/Render.h @@ -0,0 +1,268 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + +#ifndef _RICE_RENDER_H +#define _RICE_RENDER_H + +#include "Blender.h" +#include "Combiner.h" +#include "Config.h" +#include "Debugger.h" +#include "RenderBase.h" +#include "ExtendedRender.h" +#include "RSP_Parser.h" +#include "RSP_S2DEX.h" + +enum TextureChannel +{ + TXT_RGB, + TXT_ALPHA, + TXT_RGBA, +}; + +class CRender : public CExtendedRender +{ +protected: + CRender(); + + TextureUVFlag TileUFlags[8]; + TextureUVFlag TileVFlags[8]; + +public: + + float m_fScreenViewportMultX; + float m_fScreenViewportMultY; + + + uint32 m_dwTexturePerspective; + BOOL m_bAlphaTestEnable; + + BOOL m_bZUpdate; + BOOL m_bZCompare; + uint32 m_dwZBias; + + TextureFilter m_dwMinFilter; + TextureFilter m_dwMagFilter; + + uint32 m_dwAlpha; + + uint64 m_Mux; + BOOL m_bBlendModeValid; + + CColorCombiner *m_pColorCombiner; + CBlender *m_pAlphaBlender; + + + virtual ~CRender(); + + inline bool IsTexel0Enable() {return m_pColorCombiner->m_bTex0Enabled;} + inline bool IsTexel1Enable() {return m_pColorCombiner->m_bTex1Enabled;} + inline bool IsTextureEnabled() { return (m_pColorCombiner->m_bTex0Enabled||m_pColorCombiner->m_bTex1Enabled); } + + inline RenderTexture& GetCurrentTexture() { return g_textures[gRSP.curTile]; } + inline RenderTexture& GetTexture(uint32 dwTile) { return g_textures[dwTile]; } + void SetViewport(int nLeft, int nTop, int nRight, int nBottom, int maxZ); + virtual void SetViewportRender() {} + virtual void SetClipRatio(uint32 type, uint32 value); + virtual void UpdateScissor() {} + virtual void ApplyRDPScissor(bool force=false) {} + virtual void UpdateClipRectangle(); + virtual void UpdateScissorWithClipRatio(); + virtual void ApplyScissorWithClipRatio(bool force=false) {} + + void SetTextureEnableAndScale(int dwTile, bool enable, float fScaleX, float fScaleY); + + virtual void SetFogEnable(bool bEnable) + { + DEBUGGER_IF_DUMP( (gRSP.bFogEnabled != bEnable && logFog ), TRACE1("Set Fog %s", bEnable? "enable":"disable")); + gRSP.bFogEnabled = bEnable&&(options.fogMethod > 0); + } + virtual void SetFogMinMax(float fMin, float fMax) = 0; + virtual void TurnFogOnOff(bool flag)=0; + bool m_bFogStateSave; + void SetFogFlagForNegativeW(); + void RestoreFogFlag(); + + virtual void SetFogColor(uint32 r, uint32 g, uint32 b, uint32 a) + { + gRDP.fogColor = COLOR_RGBA(r, g, b, a); + } + uint32 GetFogColor() { return gRDP.fogColor; } + + void SetProjection(const Matrix & mat, bool bPush, bool bReplace); + void SetWorldView(const Matrix & mat, bool bPush, bool bReplace); + inline int GetProjectMatrixLevel(void) { return gRSP.projectionMtxTop; } + inline int GetWorldViewMatrixLevel(void) { return gRSP.modelViewMtxTop; } + + inline void PopProjection() + { + if (gRSP.projectionMtxTop > 0) + gRSP.projectionMtxTop--; + else + TRACE0("Popping past projection stack limits"); + } + + void PopWorldView(); + Matrix & GetWorldProjectMatrix(void); + void SetWorldProjectMatrix(Matrix &mtx); + + void ResetMatrices(); + + inline RenderShadeMode GetShadeMode() { return gRSP.shadeMode; } + + void SetVtxTextureCoord(uint32 dwV, float tu, float tv) + { + g_fVtxTxtCoords[dwV].x = tu; + g_fVtxTxtCoords[dwV].y = tv; + } + + virtual void RenderReset(); + virtual void SetCombinerAndBlender(); + virtual void SetMux(uint32 dwMux0, uint32 dwMux1); + virtual void SetCullMode(bool bCullFront, bool bCullBack) { gRSP.bCullFront = bCullFront; gRSP.bCullBack = bCullBack; } + + virtual void BeginRendering(void) {CRender::gRenderReferenceCount++;} // For DirectX only + virtual void EndRendering(void) + { + if( CRender::gRenderReferenceCount > 0 ) + CRender::gRenderReferenceCount--; + } + + virtual void ClearBuffer(bool cbuffer, bool zbuffer)=0; + virtual void ClearZBuffer(float depth)=0; + virtual void ClearBuffer(bool cbuffer, bool zbuffer, COORDRECT &rect) + { + ClearBuffer(cbuffer, zbuffer); + } + virtual void ZBufferEnable(BOOL bZBuffer)=0; + virtual void SetZCompare(BOOL bZCompare)=0; + virtual void SetZUpdate(BOOL bZUpdate)=0; + virtual void SetZBias(int bias)=0; + virtual void SetAlphaTestEnable(BOOL bAlphaTestEnable)=0; + + void SetTextureFilter(uint32 dwFilter); + virtual void ApplyTextureFilter() {} + + virtual void SetShadeMode(RenderShadeMode mode)=0; + + virtual void SetAlphaRef(uint32 dwAlpha)=0; + virtual void ForceAlphaRef(uint32 dwAlpha)=0; + + virtual void InitOtherModes(void); + + void SetVertexTextureUVCoord(TLITVERTEX &v, float fTex0S, float fTex0T, float fTex1S, float fTex1T); + void SetVertexTextureUVCoord(TLITVERTEX &v, float fTex0S, float fTex0T); + virtual COLOR PostProcessDiffuseColor(COLOR curDiffuseColor)=0; + virtual COLOR PostProcessSpecularColor()=0; + + bool DrawTriangles(); + virtual bool RenderFlushTris()=0; + + bool TexRect(int nX0, int nY0, int nX1, int nY1, float fS0, float fT0, float fScaleS, float fScaleT, bool colorFlag=false, uint32 difcolor=0xFFFFFFFF); + bool TexRectFlip(int nX0, int nY0, int nX1, int nY1, float fS0, float fT0, float fS1, float fT1); + bool FillRect(int nX0, int nY0, int nX1, int nY1, uint32 dwColor); + bool Line3D(uint32 dwV0, uint32 dwV1, uint32 dwWidth); + + virtual void SetAddressUAllStages(uint32 dwTile, TextureUVFlag dwFlag); // For DirectX only, fix me + virtual void SetAddressVAllStages(uint32 dwTile, TextureUVFlag dwFlag); // For DirectX only, fix me + virtual void SetTextureUFlag(TextureUVFlag dwFlag, uint32 tile)=0; + virtual void SetTextureVFlag(TextureUVFlag dwFlag, uint32 tile)=0; + virtual void SetTexelRepeatFlags(uint32 dwTile); + virtual void SetAllTexelRepeatFlag(); + + virtual bool SetCurrentTexture(int tile, TxtrCacheEntry *pTextureEntry)=0; + virtual bool SetCurrentTexture(int tile, CTexture *handler, uint32 dwTileWidth, uint32 dwTileHeight, TxtrCacheEntry *pTextureEntry) = 0; + + virtual bool InitDeviceObjects()=0; + virtual bool ClearDeviceObjects()=0; + virtual void Initialize(void); + virtual void CleanUp(void); + + virtual void SetFillMode(FillMode mode)=0; + +#ifdef DEBUGGER + virtual bool DrawTexture(int tex, TextureChannel channel = TXT_RGB ); + virtual void SaveTextureToFile(int tex, TextureChannel channel = TXT_RGB, bool bShow = false); +#endif + + virtual void SaveTextureToFile(CTexture &texture, char *filename, TextureChannel channel = TXT_RGB, bool bShow = false, bool bWholeTexture = true, int width = -1, int height = -1); + + void LoadSprite2D(Sprite2DInfo &info, uint32 ucode); + void LoadObjBGCopy(uObjBg &info); + void LoadObjBG1CYC(uObjScaleBg &info); + void LoadObjSprite(uObjTxSprite &info, bool useTIAddr=false); + + void LoadFrameBuffer(bool useVIreg=false, uint32 left=0, uint32 top=0, uint32 width=0, uint32 height=0); + void LoadTextureFromMemory(void *buf, uint32 left, uint32 top, uint32 width, uint32 height, uint32 pitch, uint32 format); + void LoadTxtrBufIntoTexture(void); + void DrawSprite2D(Sprite2DInfo &info, uint32 ucode); + void DrawSpriteR(uObjTxSprite &sprite, bool initCombiner=true, uint32 tile=0, uint32 left=0, uint32 top=0, uint32 width=0, uint32 height=0); + void DrawSprite(uObjTxSprite &sprite, bool rectR = true); + void DrawObjBGCopy(uObjBg &info); + virtual void DrawSpriteR_Render(){}; + virtual void DrawSimple2DTexture(float x0, float y0, float x1, float y1, float u0, float v0, float u1, float v1, COLOR dif, COLOR spe, float z, float rhw)=0; + void DrawFrameBuffer(bool useVIreg=false, uint32 left=0, uint32 top=0, uint32 width=0, uint32 height=0); + void DrawObjBG1CYC(uObjScaleBg &bg, bool scaled=true); + + static CRender * g_pRender; + static int gRenderReferenceCount; + static CRender * GetRender(void); + static bool IsAvailable(); + + +protected: + BOOL m_savedZBufferFlag; + uint32 m_savedMinFilter; + uint32 m_savedMagFilter; + + // FillRect + virtual bool RenderFillRect(uint32 dwColor, float depth)=0; + VECTOR2 m_fillRectVtx[2]; + + // Line3D + virtual bool RenderLine3D()=0; + + LITVERTEX m_line3DVtx[2]; + VECTOR2 m_line3DVector[4]; + + // TexRect + virtual bool RenderTexRect()=0; + + TexCord m_texRectTex1UV[2]; + TexCord m_texRectTex2UV[2]; + + // DrawSimple2DTexture + virtual void StartDrawSimple2DTexture(float x0, float y0, float x1, float y1, float u0, float v0, float u1, float v1, COLOR dif, COLOR spe, float z, float rhw); + + // DrawSimpleRect + virtual void StartDrawSimpleRect(int nX0, int nY0, int nX1, int nY1, uint32 dwColor, float depth, float rhw); + VECTOR2 m_simpleRectVtx[2]; + + bool RemapTextureCoordinate(float s0, float s1, uint32 tileWidth, uint32 mask, float textureWidth, + float &u0, float &u1); + +}; + +#define ffloor(a) (((int(a))<=(a))?(float)(int(a)):((float)(int(a))-1)) + +bool SaveRGBBufferToFile(char *filename, unsigned char *buf, int width, int height, int pitch = -1); +bool SaveRGBABufferToPNGFile(char *filename, unsigned char *buf, int width, int height, int pitch = -1); + +#endif //_RICE_RENDER_H + diff --git a/libmupen64plus/mupen64plus-video-rice/src/RenderBase.cpp b/libmupen64plus/mupen64plus-video-rice/src/RenderBase.cpp new file mode 100644 index 0000000000..d5d2f7c466 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/RenderBase.cpp @@ -0,0 +1,2406 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + +#include +#include + +#include "osal_preproc.h" +#include "float.h" +#include "DeviceBuilder.h" +#include "VertexShaderConstantDef.h" +#include "Render.h" +#include "Timing.h" + +extern FiddledVtx * g_pVtxBase; + +#define ENABLE_CLIP_TRI +#define X_CLIP_MAX 0x1 +#define X_CLIP_MIN 0x2 +#define Y_CLIP_MAX 0x4 +#define Y_CLIP_MIN 0x8 +#define Z_CLIP_MAX 0x10 +#define Z_CLIP_MIN 0x20 + +#ifdef ENABLE_CLIP_TRI + +inline void RSP_Vtx_Clipping(int i) +{ + g_clipFlag[i] = 0; + g_clipFlag2[i] = 0; + if( g_vecProjected[i].w > 0 ) + { + /* + if( gRSP.bRejectVtx ) + { + if( g_vecProjected[i].x > 1 ) + { + g_clipFlag2[i] |= X_CLIP_MAX; + if( g_vecProjected[i].x > gRSP.real_clip_ratio_posx ) + g_clipFlag[i] |= X_CLIP_MAX; + } + + if( g_vecProjected[i].x < -1 ) + { + g_clipFlag2[i] |= X_CLIP_MIN; + if( g_vecProjected[i].x < gRSP.real_clip_ratio_negx ) + g_clipFlag[i] |= X_CLIP_MIN; + } + + if( g_vecProjected[i].y > 1 ) + { + g_clipFlag2[i] |= Y_CLIP_MAX; + if( g_vecProjected[i].y > gRSP.real_clip_ratio_posy ) + g_clipFlag[i] |= Y_CLIP_MAX; + } + + if( g_vecProjected[i].y < -1 ) + { + g_clipFlag2[i] |= Y_CLIP_MIN; + if( g_vecProjected[i].y < gRSP.real_clip_ratio_negy ) + g_clipFlag[i] |= Y_CLIP_MIN; + } + + //if( g_vecProjected[i].z > 1.0f ) + //{ + // g_clipFlag2[i] |= Z_CLIP_MAX; + // g_clipFlag[i] |= Z_CLIP_MAX; + //} + + //if( gRSP.bNearClip && g_vecProjected[i].z < -1.0f ) + //{ + // g_clipFlag2[i] |= Z_CLIP_MIN; + // g_clipFlag[i] |= Z_CLIP_MIN; + //} + } + else + */ + { + if( g_vecProjected[i].x > 1 ) g_clipFlag2[i] |= X_CLIP_MAX; + if( g_vecProjected[i].x < -1 ) g_clipFlag2[i] |= X_CLIP_MIN; + if( g_vecProjected[i].y > 1 ) g_clipFlag2[i] |= Y_CLIP_MAX; + if( g_vecProjected[i].y < -1 ) g_clipFlag2[i] |= Y_CLIP_MIN; + //if( g_vecProjected[i].z > 1.0f ) g_clipFlag2[i] |= Z_CLIP_MAX; + //if( gRSP.bNearClip && g_vecProjected[i].z < -1.0f ) g_clipFlag2[i] |= Z_CLIP_MIN; + } + + } +} + +#else +inline void RSP_Vtx_Clipping(int i) {} +#endif + +/* + * Global variables + */ +ALIGN(16,RSP_Options gRSP) +ALIGN(16,RDP_Options gRDP) + +static ALIGN(16,XVECTOR4 g_normal) +//static int norms[3]; + +ALIGN(16,XVECTOR4 g_vtxNonTransformed[MAX_VERTS]) +ALIGN(16,XVECTOR4 g_vecProjected[MAX_VERTS]) +ALIGN(16,XVECTOR4 g_vtxTransformed[MAX_VERTS]) + +float g_vtxProjected5[1000][5]; +float g_vtxProjected5Clipped[2000][5]; + +//uint32 g_dwVtxFlags[MAX_VERTS]; // Z_POS Z_NEG etc +VECTOR2 g_fVtxTxtCoords[MAX_VERTS]; +uint32 g_dwVtxDifColor[MAX_VERTS]; +uint32 g_clipFlag[MAX_VERTS]; +uint32 g_clipFlag2[MAX_VERTS]; +RenderTexture g_textures[MAX_TEXTURES]; +float g_fFogCoord[MAX_VERTS]; + +EXTERNAL_VERTEX g_vtxForExternal[MAX_VERTS]; + +TLITVERTEX g_vtxBuffer[1000]; +TLITVERTEX g_clippedVtxBuffer[2000]; +uint8 g_oglVtxColors[1000][4]; +int g_clippedVtxCount=0; +TLITVERTEX g_texRectTVtx[4]; +unsigned short g_vtxIndex[1000]; +unsigned int g_minIndex, g_maxIndex; + +float gRSPfFogMin; +float gRSPfFogMax; +float gRSPfFogDivider; + +uint32 gRSPnumLights; +Light gRSPlights[16]; + +ALIGN(16,Matrix gRSPworldProjectTransported) +ALIGN(16,Matrix gRSPworldProject) +ALIGN(16,Matrix gRSPmodelViewTop) +ALIGN(16,Matrix gRSPmodelViewTopTranspose) +ALIGN(16,Matrix dkrMatrixTransposed) + +N64Light gRSPn64lights[16]; + + +void (*ProcessVertexData)(uint32 dwAddr, uint32 dwV0, uint32 dwNum)=NULL; + +/* + * + */ + + +/*n.x = (g_normal.x * matWorld.m00) + (g_normal.y * matWorld.m10) + (g_normal.z * matWorld.m20); +n.y = (g_normal.x * matWorld.m01) + (g_normal.y * matWorld.m11) + (g_normal.z * matWorld.m21); +n.z = (g_normal.x * matWorld.m02) + (g_normal.y * matWorld.m12) + (g_normal.z * matWorld.m22);*/ + +// Multiply (x,y,z,0) by matrix m, then normalize +#if defined(__INTEL_COMPILER) && !defined(NO_ASM) +#define Vec3TransformNormal(vec, m) __asm \ +{ \ + __asm fld dword ptr [vec + 0] \ + __asm fmul dword ptr [m + 0] \ /* x m00*/ + __asm fld dword ptr [vec + 0] \ + __asm fmul dword ptr [m + 4] \ /* x m01 x m00*/ + __asm fld dword ptr [vec + 0] \ + __asm fmul dword ptr [m + 8] \ /* x m02 x m01 x m00*/ + \ + __asm fld dword ptr [vec + 4] \ + __asm fmul dword ptr [m + 16] \ /* y m10 x m02 x m01 x m00*/ + __asm fld dword ptr [vec + 4] \ + __asm fmul dword ptr [m + 20] \ /* y m11 y m10 x m02 x m01 x m00*/ + __asm fld dword ptr [vec + 4] \ + __asm fmul dword ptr [m + 24] \ /* y m12 y m11 y m10 x m02 x m01 x m00*/ + \ + __asm fxch st(2) \ /* y m10 y m11 y m12 x m02 x m01 x m00*/ + __asm faddp st(5), st(0) \ /* y m11 y m12 x m02 x m01 (x m00 + y m10)*/ + __asm faddp st(3), st(0) \ /* y m12 x m02 (x m01 + ym11) (x m00 + y m10)*/ + __asm faddp st(1), st(0) \ /* (x m02 + y m12) (x m01 + ym11) (x m00 + y m10)*/ + \ + __asm fld dword ptr [vec + 8] \ + __asm fmul dword ptr [m + 32] \ /* z m20 (x m02 + y m12) (x m01 + ym11) (x m00 + y m10)*/ + __asm fld dword ptr [vec + 8] \ + __asm fmul dword ptr [m + 36] \ /* z m21 z m20 (x m02 + y m12) (x m01 + ym11) (x m00 + y m10)*/ + __asm fld dword ptr [vec + 8] \ + __asm fmul dword ptr [m + 40] \ /* z m22 z m21 z m20 (x m02 + y m12) (x m01 + ym11) (x m00 + y m10)*/ + \ + __asm fxch st(2) \ /* z m20 z m21 z m22 (x m02 + y m12) (x m01 + ym11) (x m00 + y m10)*/ + __asm faddp st(5), st(0) \ /* z m21 z m22 (x m02 + y m12) (x m01 + ym11) (x m00 + y m10 + z m20)*/ + __asm faddp st(3), st(0) \ /* z m22 (x m02 + y m12) (x m01 + ym11 + z m21) (x m00 + y m10 + z m20)*/ + __asm faddp st(1), st(0) \ /* (x m02 + y m12 + z m 22) (x m01 + ym11 + z m21) (x m00 + y m10 + z m20)*/ + \ + __asm fxch st(2) \ /* (x m00 + y m10 + z m20) (x m01 + ym11 + z m21) (x m02 + y m12 + z m 22) */ + \ + __asm fld1 \ /* 1 x y z */ + __asm fld st(1) \ /* x 1 x y z */ + __asm fmul st(0),st(0) \ /* xx 1 x y z */ + __asm fld st(3) \ /* y xx 1 x y z */ + __asm fmul st(0),st(0) \ /* yy xx 1 x y z */ + __asm fld st(5) \ /* z yy xx 1 x y z */ + __asm fmul st(0),st(0) \ /* zz yy xx 1 x y z */ + \ + __asm fxch st(2) \ /* xx yy zz 1 x y z */ + \ + __asm faddp st(1),st(0) \ /* (xx+yy) zz 1 x y z */ + __asm faddp st(1),st(0) \ /* (xx+yy+zz) 1 x y z */ + \ + __asm ftst \ /* Compare ST to 0 */ + __asm fstsw ax \ /* Store FPU status word in a */ + __asm sahf \ /* Transfer ax to flags register */ + __asm jz l2 \ /* Skip if length is zero */ + \ + __asm fsqrt \ /* l 1 x y z */ + \ + __asm fdivp st(1),st(0) \ /* (1/l) x y z */ + \ + __asm fmul st(3),st(0) \ /* f x y fz */ + __asm fmul st(2),st(0) \ /* f x fy fz */ + __asm fmulp st(1),st(0) \ /* fx fy fz */ + \ + __asm fstp dword ptr [vec + 0] \ /* fy fz*/ + __asm fstp dword ptr [vec + 4] \ /* fz */ + __asm fstp dword ptr [vec + 8] \ /* done */ + __asm jmp l3 \ +__asm l2: \ + __asm mov dword ptr [vec + 0], 0 \ + __asm mov dword ptr [vec + 4], 0 \ + __asm mov dword ptr [vec + 8], 0 \ +__asm l3: \ +} \ + +#else // use C code in other cases, this is probably faster anyway +#define Vec3TransformNormal(vec, m) \ + VECTOR3 temp; \ + temp.x = (vec.x * m._11) + (vec.y * m._21) + (vec.z * m._31); \ + temp.y = (vec.x * m._12) + (vec.y * m._22) + (vec.z * m._32); \ + temp.z = (vec.x * m._13) + (vec.y * m._23) + (vec.z * m._33); \ + float norm = sqrt(temp.x*temp.x+temp.y*temp.y+temp.z*temp.z); \ + if (norm == 0.0) { vec.x = 0.0; vec.y = 0.0; vec.z = 0.0;} else \ + { vec.x = temp.x/norm; vec.y = temp.y/norm; vec.z = temp.z/norm; } +#endif + + +#if !defined(__GNUC__) && !defined(NO_ASM) +__declspec( naked ) void __fastcall SSEVec3Transform(int i) +{ + __asm + { + shl ecx,4; // ecx = i + + movaps xmm1, DWORD PTR g_vtxNonTransformed [ecx]; // xmm1 as original vector + + movaps xmm4, DWORD PTR gRSPworldProjectTransported; // row1 + movaps xmm5, DWORD PTR gRSPworldProjectTransported[0x10]; // row2 + movaps xmm6, DWORD PTR gRSPworldProjectTransported[0x20]; // row3 + movaps xmm7, DWORD PTR gRSPworldProjectTransported[0x30]; // row4 + + mulps xmm4, xmm1; // row 1 + mulps xmm5, xmm1; // row 2 + mulps xmm6, xmm1; // row 3 + mulps xmm7, xmm1; // row 4 + + movhlps xmm0, xmm4; // xmm4 high to xmm0 low + movlhps xmm0, xmm5; // xmm5 low to xmm0 high + + addps xmm4, xmm0; // result of add are in xmm4 low + addps xmm5, xmm0; // result of add are in xmm5 high + + shufps xmm0, xmm4, 0x44; // move xmm4 low DWORDs to xmm0 high + shufps xmm4, xmm5, 0xe4; // move xmm5 high DWORS to xmm4 + movhlps xmm5, xmm0; // xmm4, xmm5 are mirrored + + shufps xmm4, xmm4, 0x08; // move xmm4's 3rd uint32 to its 2nd uint32 + shufps xmm5, xmm5, 0x0d; // move xmm5's 4th uint32 to its 2nd uint32, + // and move its 2nd uint32 to its 1st uint32 + + addps xmm4, xmm5; // results are in 1st and 2nd uint32 + + + movhlps xmm0, xmm6; // xmm6 high to xmm0 low + movlhps xmm0, xmm7; // xmm7 low to xmm0 high + + addps xmm6, xmm0; // result of add are in xmm6 low + addps xmm7, xmm0; // result of add are in xmm7 high + + shufps xmm0, xmm6, 0x44; // move xmm6 low DWORDs to xmm0 high + shufps xmm6, xmm7, 0xe4; // move xmm7 high DWORS to xmm6 + movhlps xmm7, xmm0; // xmm6, xmm7 are mirrored + + shufps xmm6, xmm6, 0x08; // move xmm6's 3rd uint32 to its 2nd uint32 + shufps xmm7, xmm7, 0x0d; // move xmm7's 4th uint32 to its 2nd uint32, + // and move its 2nd uint32 to its 1st uint32 + + addps xmm6, xmm7; // results are in 1st and 2nd uint32 + + movlhps xmm4, xmm6; // final result is in xmm4 + movaps DWORD PTR g_vtxTransformed [ecx], xmm4; + + movaps xmm0,xmm4; + shufps xmm0,xmm0,0xff; + divps xmm4,xmm0; + rcpps xmm0,xmm0; + movhlps xmm0,xmm4; + shufps xmm0,xmm0,0xe8; + movlhps xmm4,xmm0; + + movaps DWORD PTR g_vecProjected [ecx], xmm4; + + emms; + ret; + } +} + +// Only used by DKR +__declspec( naked ) void __fastcall SSEVec3TransformDKR(XVECTOR4 &pOut, const XVECTOR4 &pV) +{ + __asm + { + movaps xmm1, DWORD PTR [edx]; // xmm1 as original vector + + movaps xmm4, DWORD PTR dkrMatrixTransposed; // row1 + movaps xmm5, DWORD PTR dkrMatrixTransposed[0x10]; // row2 + movaps xmm6, DWORD PTR dkrMatrixTransposed[0x20]; // row3 + movaps xmm7, DWORD PTR dkrMatrixTransposed[0x30]; // row4 + + mulps xmm4, xmm1; // row 1 + mulps xmm5, xmm1; // row 2 + mulps xmm6, xmm1; // row 3 + mulps xmm7, xmm1; // row 4 + + movhlps xmm0, xmm4; // xmm4 high to xmm0 low + movlhps xmm0, xmm5; // xmm5 low to xmm0 high + + addps xmm4, xmm0; // result of add are in xmm4 low + addps xmm5, xmm0; // result of add are in xmm5 high + + shufps xmm0, xmm4, 0x44; // move xmm4 low DWORDs to xmm0 high + shufps xmm4, xmm5, 0xe4; // move xmm5 high DWORS to xmm4 + movhlps xmm5, xmm0; // xmm4, xmm5 are mirrored + + shufps xmm4, xmm4, 0x08; // move xmm4's 3rd uint32 to its 2nd uint32 + shufps xmm5, xmm5, 0x0d; // move xmm5's 4th uint32 to its 2nd uint32, + // and move its 2nd uint32 to its 1st uint32 + + addps xmm4, xmm5; // results are in 1st and 2nd uint32 + + + movhlps xmm0, xmm6; // xmm6 high to xmm0 low + movlhps xmm0, xmm7; // xmm7 low to xmm0 high + + addps xmm6, xmm0; // result of add are in xmm6 low + addps xmm7, xmm0; // result of add are in xmm7 high + + shufps xmm0, xmm6, 0x44; // move xmm6 low DWORDs to xmm0 high + shufps xmm6, xmm7, 0xe4; // move xmm7 high DWORS to xmm6 + movhlps xmm7, xmm0; // xmm6, xmm7 are mirrored + + shufps xmm6, xmm6, 0x08; // move xmm6's 3rd uint32 to its 2nd uint32 + shufps xmm7, xmm7, 0x0d; // move xmm7's 4th uint32 to its 2nd uint32, + // and move its 2nd uint32 to its 1st uint32 + + addps xmm6, xmm7; // results are in 1st and 2nd uint32 + + movlhps xmm4, xmm6; // final result is in xmm4 + movaps DWORD PTR [ecx], xmm4; + + emms; + ret; + } +} +#elif defined(__GNUC__) && defined(__x86_64__) && !defined(NO_ASM) +void SSEVec3Transform(int i) +{ + asm volatile(" shl $4, %0 \n" + " movslq %k0, %q0 \n" + " movaps (%1,%q0), %%xmm1 \n" + " movaps 0(%2), %%xmm4 \n" + " movaps 16(%2), %%xmm5 \n" + " movaps 32(%2), %%xmm6 \n" + " movaps 48(%2), %%xmm7 \n" + " mulps %%xmm1, %%xmm4 \n" + " mulps %%xmm1, %%xmm5 \n" + " mulps %%xmm1, %%xmm6 \n" + " mulps %%xmm1, %%xmm7 \n" + " movhlps %%xmm4, %%xmm0 \n" + " movlhps %%xmm5, %%xmm0 \n" + " addps %%xmm0, %%xmm4 \n" + " addps %%xmm0, %%xmm5 \n" + " shufps $0x44, %%xmm4, %%xmm0 \n" + " shufps $0xe4, %%xmm5, %%xmm4 \n" + " movhlps %%xmm0, %%xmm5 \n" + " shufps $0x08, %%xmm4, %%xmm4 \n" + " shufps $0x0d, %%xmm5, %%xmm5 \n" + " addps %%xmm5, %%xmm4 \n" + " movhlps %%xmm6, %%xmm0 \n" + " movlhps %%xmm7, %%xmm0 \n" + " addps %%xmm0, %%xmm6 \n" + " addps %%xmm0, %%xmm7 \n" + " shufps $0x44, %%xmm6, %%xmm0 \n" + " shufps $0xe4, %%xmm7, %%xmm6 \n" + " movhlps %%xmm0, %%xmm7 \n" + " shufps $0x08, %%xmm6, %%xmm6 \n" + " shufps $0x0d, %%xmm7, %%xmm7 \n" + " addps %%xmm7, %%xmm6 \n" + " movlhps %%xmm6, %%xmm4 \n" + " movaps %%xmm4, (%3,%q0) \n" + " movaps %%xmm4, %%xmm0 \n" + " shufps $0xff, %%xmm0, %%xmm0 \n" + " divps %%xmm0, %%xmm4 \n" + " rcpps %%xmm0, %%xmm0 \n" + " movhlps %%xmm4, %%xmm0 \n" + " shufps $0xe8, %%xmm0, %%xmm0 \n" + " movlhps %%xmm0, %%xmm4 \n" + " movaps %%xmm4, (%4,%q0) \n" + : "+r"(i) + : "r"(g_vtxNonTransformed), "r"(&gRSPworldProjectTransported.m[0][0]), "r"(g_vtxTransformed), "r"(g_vecProjected) + : "memory", "%xmm0", "%xmm1", "%xmm4", "%xmm5", "%xmm6", "%xmm7" + ); +} +#elif !defined(NO_ASM) // 32-bit GCC assumed +void SSEVec3Transform(int i) +{ + asm volatile(" shl $4, %0 \n" + " movaps (%1,%0), %%xmm1 \n" + " movaps 0(%2), %%xmm4 \n" + " movaps 16(%2), %%xmm5 \n" + " movaps 32(%2), %%xmm6 \n" + " movaps 48(%2), %%xmm7 \n" + " mulps %%xmm1, %%xmm4 \n" + " mulps %%xmm1, %%xmm5 \n" + " mulps %%xmm1, %%xmm6 \n" + " mulps %%xmm1, %%xmm7 \n" + " movhlps %%xmm4, %%xmm0 \n" + " movlhps %%xmm5, %%xmm0 \n" + " addps %%xmm0, %%xmm4 \n" + " addps %%xmm0, %%xmm5 \n" + " shufps $0x44, %%xmm4, %%xmm0 \n" + " shufps $0xe4, %%xmm5, %%xmm4 \n" + " movhlps %%xmm0, %%xmm5 \n" + " shufps $0x08, %%xmm4, %%xmm4 \n" + " shufps $0x0d, %%xmm5, %%xmm5 \n" + " addps %%xmm5, %%xmm4 \n" + " movhlps %%xmm6, %%xmm0 \n" + " movlhps %%xmm7, %%xmm0 \n" + " addps %%xmm0, %%xmm6 \n" + " addps %%xmm0, %%xmm7 \n" + " shufps $0x44, %%xmm6, %%xmm0 \n" + " shufps $0xe4, %%xmm7, %%xmm6 \n" + " movhlps %%xmm0, %%xmm7 \n" + " shufps $0x08, %%xmm6, %%xmm6 \n" + " shufps $0x0d, %%xmm7, %%xmm7 \n" + " addps %%xmm7, %%xmm6 \n" + " movlhps %%xmm6, %%xmm4 \n" + " movaps %%xmm4, (%3,%0) \n" + " movaps %%xmm4, %%xmm0 \n" + " shufps $0xff, %%xmm0, %%xmm0 \n" + " divps %%xmm0, %%xmm4 \n" + " rcpps %%xmm0, %%xmm0 \n" + " movhlps %%xmm4, %%xmm0 \n" + " shufps $0xe8, %%xmm0, %%xmm0 \n" + " movlhps %%xmm0, %%xmm4 \n" + " movaps %%xmm4, (%4,%0) \n" + : "+r"(i) + : "r"(g_vtxNonTransformed), "r"(&gRSPworldProjectTransported.m[0][0]), "r"(g_vtxTransformed), "r"(g_vecProjected) + : "memory", "%xmm0", "%xmm1", "%xmm4", "%xmm5", "%xmm6", "%xmm7" + ); +} +#endif +float real255 = 255.0f; +float real128 = 128.0f; + +#if !defined(__GNUC__) && !defined(NO_ASM) +__declspec( naked ) void __fastcall SSEVec3TransformNormal() +{ + __asm + { + mov DWORD PTR [g_normal][12], 0; + + movaps xmm4, DWORD PTR gRSPmodelViewTopTranspose; // row1 + movaps xmm5, DWORD PTR gRSPmodelViewTopTranspose[0x10]; // row2 + movaps xmm1, DWORD PTR [g_normal]; // xmm1 as the normal vector + movaps xmm6, DWORD PTR gRSPmodelViewTopTranspose[0x20]; // row3 + + mulps xmm4, xmm1; // row 1 + mulps xmm5, xmm1; // row 2 + mulps xmm6, xmm1; // row 3 + + movhlps xmm0, xmm4; // xmm4 high to xmm0 low + movlhps xmm0, xmm5; // xmm5 low to xmm0 high + + addps xmm4, xmm0; // result of add are in xmm4 low + addps xmm5, xmm0; // result of add are in xmm5 high + + shufps xmm0, xmm4, 0x44; // move xmm4 low DWORDs to xmm0 high + shufps xmm4, xmm5, 0xe4; // move xmm5 high DWORS to xmm4 + movhlps xmm5, xmm0; // xmm4, xmm5 are mirrored + + shufps xmm4, xmm4, 0x08; // move xmm4's 3rd uint32 to its 2nd uint32 + shufps xmm5, xmm5, 0x0d; // move xmm5's 4th uint32 to its 2nd uint32, + + addps xmm4, xmm5; // results are in 1st and 2nd uint32 + + movaps xmm1,xmm4; + mulps xmm1,xmm1; //square + movlhps xmm7, xmm1; + shufps xmm7, xmm7,0x03; + addss xmm7, xmm1; + + movhlps xmm0, xmm6; // xmm6 high to xmm0 low + addps xmm6, xmm0; // result of add are in xmm6 low + + movlhps xmm0, xmm6; + shufps xmm0, xmm0, 0x03; + addss xmm0, xmm6; // result of add is at xmm0's 1st uint32 + + movlhps xmm4, xmm0; + + mulss xmm0,xmm0; + addss xmm7,xmm0; // xmm7 1st uint32 is the sum of squares + +#ifdef DEBUGGER + movaps DWORD PTR [g_normal], xmm4; + movss DWORD PTR [g_normal][12], xmm7; +#endif + xorps xmm0,xmm0; + ucomiss xmm0,xmm7; + jz l2 + + rsqrtss xmm7,xmm7; + shufps xmm7,xmm7,0; +#ifdef DEBUGGER + movss DWORD PTR [g_normal][12], xmm7; +#endif + mulps xmm4,xmm7; + + movaps DWORD PTR [g_normal], xmm4; // Normalized + mov DWORD PTR [g_normal][12], 0; + + emms; + ret; +l2: + movss DWORD PTR [g_normal], xmm0; + movss DWORD PTR [g_normal][12], xmm0; + emms; + ret; + } +} +#elif defined(__GNUC__) && !defined(NO_ASM) // this code should compile for both 64-bit and 32-bit architectures +void SSEVec3TransformNormal(void) +{ + asm volatile(" movl $0, 12(%0) \n" + " movaps (%1), %%xmm4 \n" + " movaps 16(%1), %%xmm5 \n" + " movaps (%0), %%xmm1 \n" + " movaps 32(%1), %%xmm6 \n" + " mulps %%xmm1, %%xmm4 \n" + " mulps %%xmm1, %%xmm5 \n" + " mulps %%xmm1, %%xmm6 \n" + " movhlps %%xmm4, %%xmm0 \n" + " movlhps %%xmm5, %%xmm0 \n" + " addps %%xmm0, %%xmm4 \n" + " addps %%xmm0, %%xmm5 \n" + " shufps $0x44, %%xmm4, %%xmm0 \n" + " shufps $0xe4, %%xmm5, %%xmm4 \n" + " movhlps %%xmm0, %%xmm5 \n" + " shufps $0x08, %%xmm4, %%xmm4 \n" + " shufps $0x0d, %%xmm5, %%xmm5 \n" + " addps %%xmm5, %%xmm4 \n" + " movaps %%xmm4, %%xmm1 \n" + " mulps %%xmm1, %%xmm1 \n" + " movlhps %%xmm1, %%xmm7 \n" + " shufps $0x03, %%xmm7, %%xmm7 \n" + " addss %%xmm1, %%xmm7 \n" + " movhlps %%xmm6, %%xmm0 \n" + " addps %%xmm0, %%xmm6 \n" + " movlhps %%xmm6, %%xmm0 \n" + " shufps $0x03, %%xmm0, %%xmm0 \n" + " addss %%xmm6, %%xmm0 \n" + " movlhps %%xmm0, %%xmm4 \n" + " mulss %%xmm0, %%xmm0 \n" + " addss %%xmm0, %%xmm7 \n" +#ifdef DEBUGGER + " movaps %%xmm4, (%0) \n" + " movss %%xmm7, 12(%0) \n" +#endif + " xorps %%xmm0, %%xmm0 \n" + " ucomiss %%xmm7, %%xmm0 \n" + " jz 0f \n" + " rsqrtss %%xmm7, %%xmm7 \n" + " shufps $0x00, %%xmm7, %%xmm7 \n" +#ifdef DEBUGGER + " movss %%xmm7, 12(%0) \n" +#endif + " mulps %%xmm7, %%xmm4 \n" + " movaps %%xmm4, (%0) \n" + " movl $0, 12(%0) \n" + " jmp 1f \n" + "0: \n" + " movss %%xmm0, (%0) \n" + " movss %%xmm0, 12(%0) \n" + "1: \n" + : + : "r"(&g_normal.x), "r"(&gRSPmodelViewTopTranspose.m[0][0]) + : "memory", "cc", "%xmm0", "%xmm1", "%xmm4", "%xmm5", "%xmm6", "%xmm7" + ); +} +#endif + +void NormalizeNormalVec() +{ + float w = 1/sqrtf(g_normal.x*g_normal.x + g_normal.y*g_normal.y + g_normal.z*g_normal.z); + g_normal.x *= w; + g_normal.y *= w; + g_normal.z *= w; +} + + +void InitRenderBase() +{ +#if !defined(NO_ASM) + if( status.isSSEEnabled && !g_curRomInfo.bPrimaryDepthHack && options.enableHackForGames != HACK_FOR_NASCAR) + { + ProcessVertexData = ProcessVertexDataSSE; + } + else +#endif + { + ProcessVertexData = ProcessVertexDataNoSSE; + } + + gRSPfFogMin = gRSPfFogMax = 0.0f; + windowSetting.fMultX = windowSetting.fMultY = 2.0f; + windowSetting.vpLeftW = windowSetting.vpTopW = 0; + windowSetting.vpRightW = windowSetting.vpWidthW = 640; + windowSetting.vpBottomW = windowSetting.vpHeightW = 480; + gRSP.maxZ = 0; + gRSP.nVPLeftN = gRSP.nVPTopN = 0; + gRSP.nVPRightN = 640; + gRSP.nVPBottomN = 640; + gRSP.nVPWidthN = 640; + gRSP.nVPHeightN = 640; + gRDP.scissor.left=gRDP.scissor.top=0; + gRDP.scissor.right=gRDP.scissor.bottom=640; + + gRSP.bLightingEnable = gRSP.bTextureGen = false; + gRSP.curTile=gRSPnumLights=gRSP.ambientLightColor=gRSP.ambientLightIndex= 0; + gRSP.fAmbientLightR=gRSP.fAmbientLightG=gRSP.fAmbientLightB=0; + gRSP.projectionMtxTop = gRSP.modelViewMtxTop = 0; + gRDP.fogColor = gRDP.primitiveColor = gRDP.envColor = gRDP.primitiveDepth = gRDP.primLODMin = gRDP.primLODFrac = gRDP.LODFrac = 0; + gRDP.fPrimitiveDepth = 0; + gRSP.numVertices = 0; + gRSP.maxVertexID = 0; + gRSP.bCullFront=false; + gRSP.bCullBack=true; + gRSP.bFogEnabled=gRDP.bFogEnableInBlender=false; + gRSP.bZBufferEnabled=true; + gRSP.shadeMode=SHADE_SMOOTH; + gRDP.keyR=gRDP.keyG=gRDP.keyB=gRDP.keyA=gRDP.keyRGB=gRDP.keyRGBA = 0; + gRDP.fKeyA = 0; + gRSP.DKRCMatrixIndex = gRSP.dwDKRVtxAddr = gRSP.dwDKRMatrixAddr = 0; + gRSP.DKRBillBoard = false; + + gRSP.fTexScaleX = 1/32.0f; + gRSP.fTexScaleY = 1/32.0f; + gRSP.bTextureEnabled = FALSE; + + gRSP.clip_ratio_left = 0; + gRSP.clip_ratio_top = 0; + gRSP.clip_ratio_right = 640; + gRSP.clip_ratio_bottom = 480; + gRSP.clip_ratio_negx = 1; + gRSP.clip_ratio_negy = 1; + gRSP.clip_ratio_posx = 1; + gRSP.clip_ratio_posy = 1; + gRSP.real_clip_scissor_left = 0; + gRSP.real_clip_scissor_top = 0; + gRSP.real_clip_scissor_right = 640; + gRSP.real_clip_scissor_bottom = 480; + windowSetting.clipping.left = 0; + windowSetting.clipping.top = 0; + windowSetting.clipping.right = 640; + windowSetting.clipping.bottom = 480; + windowSetting.clipping.width = 640; + windowSetting.clipping.height = 480; + windowSetting.clipping.needToClip = false; + gRSP.real_clip_ratio_negx = 1; + gRSP.real_clip_ratio_negy = 1; + gRSP.real_clip_ratio_posx = 1; + gRSP.real_clip_ratio_posy = 1; + + gRSP.DKRCMatrixIndex=0; + gRSP.DKRVtxCount=0; + gRSP.DKRBillBoard = false; + gRSP.dwDKRVtxAddr=0; + gRSP.dwDKRMatrixAddr=0; + + + gRDP.geometryMode = 0; + gRDP.otherModeL = 0; + gRDP.otherModeH = 0; + gRDP.fillColor = 0xFFFFFFFF; + gRDP.originalFillColor =0; + + gRSP.ucode = 1; + gRSP.vertexMult = 10; + gRSP.bNearClip = false; + gRSP.bRejectVtx = false; + + gRDP.texturesAreReloaded = false; + gRDP.textureIsChanged = false; + gRDP.colorsAreReloaded = false; + + memset(&gRDP.otherMode,0,sizeof(RDP_OtherMode)); + memset(&gRDP.tiles,0,sizeof(Tile)*8); + + for( int i=0; i fMax ) + { + float temp = fMin; + fMin = fMax; + fMax = temp; + } + + { + gRSPfFogMin = max(0,fMin/500-1); + gRSPfFogMax = fMax/500-1; + } + + gRSPfFogDivider = 255/(gRSPfFogMax-gRSPfFogMin); + CRender::g_pRender->SetFogMinMax(fMin, fMax); +} + +void InitVertexColors() +{ +} + +void InitVertexTextureConstants() +{ + float scaleX; + float scaleY; + + RenderTexture &tex0 = g_textures[gRSP.curTile]; + //CTexture *surf = tex0.m_pCTexture; + Tile &tile0 = gRDP.tiles[gRSP.curTile]; + + scaleX = gRSP.fTexScaleX; + scaleY = gRSP.fTexScaleY; + + gRSP.tex0scaleX = scaleX * tile0.fShiftScaleS/tex0.m_fTexWidth; + gRSP.tex0scaleY = scaleY * tile0.fShiftScaleT/tex0.m_fTexHeight; + + gRSP.tex0OffsetX = tile0.fhilite_sl/tex0.m_fTexWidth; + gRSP.tex0OffsetY = tile0.fhilite_tl/tex0.m_fTexHeight; + + if( CRender::g_pRender->IsTexel1Enable() ) + { + RenderTexture &tex1 = g_textures[(gRSP.curTile+1)&7]; + //CTexture *surf = tex1.m_pCTexture; + Tile &tile1 = gRDP.tiles[(gRSP.curTile+1)&7]; + + gRSP.tex1scaleX = scaleX * tile1.fShiftScaleS/tex1.m_fTexWidth; + gRSP.tex1scaleY = scaleY * tile1.fShiftScaleT/tex1.m_fTexHeight; + + gRSP.tex1OffsetX = tile1.fhilite_sl/tex1.m_fTexWidth; + gRSP.tex1OffsetY = tile1.fhilite_tl/tex1.m_fTexHeight; + } + + gRSP.texGenXRatio = tile0.fShiftScaleS; + gRSP.texGenYRatio = gRSP.fTexScaleX/gRSP.fTexScaleY*tex0.m_fTexWidth/tex0.m_fTexHeight*tile0.fShiftScaleT; +} + +void TexGen(float &s, float &t) +{ + if (gRDP.geometryMode & G_TEXTURE_GEN_LINEAR) + { + s = acosf(g_normal.x) / 3.14159f; + t = acosf(g_normal.y) / 3.14159f; + } + else + { + s = 0.5f * ( 1.0f + g_normal.x); + t = 0.5f * ( 1.0f - g_normal.y); + } +} + +void ComputeLOD(bool openGL) +{ + TLITVERTEX &v0 = g_vtxBuffer[0]; + TLITVERTEX &v1 = g_vtxBuffer[1]; + RenderTexture &tex0 = g_textures[gRSP.curTile]; + + float d,dt; + if( openGL ) + { + float x = g_vtxProjected5[0][0] / g_vtxProjected5[0][4] - g_vtxProjected5[1][0] / g_vtxProjected5[1][4]; + float y = g_vtxProjected5[0][1] / g_vtxProjected5[0][4] - g_vtxProjected5[1][1] / g_vtxProjected5[1][4]; + + x = windowSetting.vpWidthW*x/windowSetting.fMultX/2; + y = windowSetting.vpHeightW*y/windowSetting.fMultY/2; + d = sqrtf(x*x+y*y); + } + else + { + float x = (v0.x - v1.x)/ windowSetting.fMultX; + float y = (v0.y - v1.y)/ windowSetting.fMultY; + d = sqrtf(x*x+y*y); + } + + float s0 = v0.tcord[0].u * tex0.m_fTexWidth; + float t0 = v0.tcord[0].v * tex0.m_fTexHeight; + float s1 = v1.tcord[0].u * tex0.m_fTexWidth; + float t1 = v1.tcord[0].v * tex0.m_fTexHeight; + + dt = sqrtf((s0-s1)*(s0-s1)+(t0-t1)*(t0-t1)); + + float lod = dt/d; + float frac = log10f(lod)/log10f(2.0f); + //DEBUGGER_IF_DUMP(pauseAtNext,{DebuggerAppendMsg("LOD frac = %f", frac);}); + frac = (lod / powf(2.0f,floorf(frac))); + frac = frac - floorf(frac); + //DEBUGGER_IF_DUMP(pauseAtNext,{DebuggerAppendMsg("LOD = %f, frac = %f", lod, frac);}); + gRDP.LODFrac = (uint32)(frac*255); + CRender::g_pRender->SetCombinerAndBlender(); +} + +bool bHalfTxtScale=false; +extern uint32 lastSetTile; + +void InitVertex(uint32 dwV, uint32 vtxIndex, bool bTexture, bool openGL) +{ + VTX_DUMP(TRACE2("Init vertex (%d) to vtx buf[%d]:", dwV, vtxIndex)); + + TLITVERTEX &v = g_vtxBuffer[vtxIndex]; + VTX_DUMP(TRACE4(" Trans: x=%f, y=%f, z=%f, w=%f", g_vtxTransformed[dwV].x,g_vtxTransformed[dwV].y,g_vtxTransformed[dwV].z,g_vtxTransformed[dwV].w)); + if( openGL ) + { + g_vtxProjected5[vtxIndex][0] = g_vtxTransformed[dwV].x; + g_vtxProjected5[vtxIndex][1] = g_vtxTransformed[dwV].y; + g_vtxProjected5[vtxIndex][2] = g_vtxTransformed[dwV].z; + g_vtxProjected5[vtxIndex][3] = g_vtxTransformed[dwV].w; + g_vtxProjected5[vtxIndex][4] = g_vecProjected[dwV].z; + + if( g_vtxTransformed[dwV].w < 0 ) + g_vtxProjected5[vtxIndex][4] = 0; + + g_vtxIndex[vtxIndex] = vtxIndex; + } + + if( !openGL || options.bOGLVertexClipper == TRUE ) + { + v.x = g_vecProjected[dwV].x*gRSP.vtxXMul+gRSP.vtxXAdd; + v.y = g_vecProjected[dwV].y*gRSP.vtxYMul+gRSP.vtxYAdd; + v.z = (g_vecProjected[dwV].z + 1.0f) * 0.5f; // DirectX minZ=0, maxZ=1 + //v.z = g_vecProjected[dwV].z; // DirectX minZ=0, maxZ=1 + v.rhw = g_vecProjected[dwV].w; + VTX_DUMP(TRACE4(" Proj : x=%f, y=%f, z=%f, rhw=%f", v.x,v.y,v.z,v.rhw)); + + if( gRSP.bProcessSpecularColor ) + { + v.dcSpecular = CRender::g_pRender->PostProcessSpecularColor(); + if( gRSP.bFogEnabled ) + { + v.dcSpecular &= 0x00FFFFFF; + uint32 fogFct = 0xFF-(uint8)((g_fFogCoord[dwV]-gRSPfFogMin)*gRSPfFogDivider); + v.dcSpecular |= (fogFct<<24); + } + } + else if( gRSP.bFogEnabled ) + { + uint32 fogFct = 0xFF-(uint8)((g_fFogCoord[dwV]-gRSPfFogMin)*gRSPfFogDivider); + v.dcSpecular = (fogFct<<24); + } + } + VTX_DUMP(TRACE2(" (U,V): %f, %f", g_fVtxTxtCoords[dwV].x,g_fVtxTxtCoords[dwV].y)); + + v.dcDiffuse = g_dwVtxDifColor[dwV]; + if( gRDP.otherMode.key_en ) + { + v.dcDiffuse &= 0x00FFFFFF; + v.dcDiffuse |= (gRDP.keyA<<24); + } + else if( gRDP.otherMode.aa_en && gRDP.otherMode.clr_on_cvg==0 ) + { + v.dcDiffuse |= 0xFF000000; + } + + if( gRSP.bProcessDiffuseColor ) + { + v.dcDiffuse = CRender::g_pRender->PostProcessDiffuseColor(v.dcDiffuse); + } + if( options.bWinFrameMode ) + { + v.dcDiffuse = g_dwVtxDifColor[dwV]; + } + + if( openGL ) + { + g_oglVtxColors[vtxIndex][0] = v.r; + g_oglVtxColors[vtxIndex][1] = v.g; + g_oglVtxColors[vtxIndex][2] = v.b; + g_oglVtxColors[vtxIndex][3] = v.a; + } + + if( bTexture ) + { + // If the vert is already lit, then there is no normal (and hence we can't generate tex coord) + // Only scale if not generated automatically + if (gRSP.bTextureGen && gRSP.bLightingEnable) + { + // Correction for texGen result + float u0,u1,v0,v1; + RenderTexture &tex0 = g_textures[gRSP.curTile]; + u0 = g_fVtxTxtCoords[dwV].x * 32 * 1024 * gRSP.fTexScaleX / tex0.m_fTexWidth; + v0 = g_fVtxTxtCoords[dwV].y * 32 * 1024 * gRSP.fTexScaleY / tex0.m_fTexHeight; + u0 *= (gRDP.tiles[gRSP.curTile].fShiftScaleS); + v0 *= (gRDP.tiles[gRSP.curTile].fShiftScaleT); + + if( CRender::g_pRender->IsTexel1Enable() ) + { + RenderTexture &tex1 = g_textures[(gRSP.curTile+1)&7]; + u1 = g_fVtxTxtCoords[dwV].x * 32 * 1024 * gRSP.fTexScaleX / tex1.m_fTexWidth; + v1 = g_fVtxTxtCoords[dwV].y * 32 * 1024 * gRSP.fTexScaleY / tex1.m_fTexHeight; + u1 *= gRDP.tiles[(gRSP.curTile+1)&7].fShiftScaleS; + v1 *= gRDP.tiles[(gRSP.curTile+1)&7].fShiftScaleT; + CRender::g_pRender->SetVertexTextureUVCoord(v, u0, v0, u1, v1); + } + else + { + CRender::g_pRender->SetVertexTextureUVCoord(v, u0, v0); + } + } + else + { + float tex0u = g_fVtxTxtCoords[dwV].x *gRSP.tex0scaleX - gRSP.tex0OffsetX ; + float tex0v = g_fVtxTxtCoords[dwV].y *gRSP.tex0scaleY - gRSP.tex0OffsetY ; + + if( CRender::g_pRender->IsTexel1Enable() ) + { + float tex1u = g_fVtxTxtCoords[dwV].x *gRSP.tex1scaleX - gRSP.tex1OffsetX ; + float tex1v = g_fVtxTxtCoords[dwV].y *gRSP.tex1scaleY - gRSP.tex1OffsetY ; + + CRender::g_pRender->SetVertexTextureUVCoord(v, tex0u, tex0v, tex1u, tex1v); + VTX_DUMP(TRACE2(" (tex0): %f, %f", tex0u,tex0v)); + VTX_DUMP(TRACE2(" (tex1): %f, %f", tex1u,tex1v)); + } + else + { + CRender::g_pRender->SetVertexTextureUVCoord(v, tex0u, tex0v); + VTX_DUMP(TRACE2(" (tex0): %f, %f", tex0u,tex0v)); + } + } + + // Check for txt scale hack + if( !bHalfTxtScale && g_curRomInfo.bTextureScaleHack && + (gRDP.tiles[lastSetTile].dwSize == TXT_SIZE_32b || gRDP.tiles[lastSetTile].dwSize == TXT_SIZE_4b ) ) + { + int width = ((gRDP.tiles[lastSetTile].sh-gRDP.tiles[lastSetTile].sl+1)<<1); + int height = ((gRDP.tiles[lastSetTile].th-gRDP.tiles[lastSetTile].tl+1)<<1); + if( g_fVtxTxtCoords[dwV].x*gRSP.fTexScaleX == width || g_fVtxTxtCoords[dwV].y*gRSP.fTexScaleY == height ) + { + bHalfTxtScale=true; + } + } + } + + if( g_curRomInfo.bEnableTxtLOD && vtxIndex == 1 && gRDP.otherMode.text_lod ) + { + if( CRender::g_pRender->IsTexel1Enable() && CRender::g_pRender->m_pColorCombiner->m_pDecodedMux->isUsed(MUX_LODFRAC) ) + { + ComputeLOD(openGL); + } + else + { + gRDP.LODFrac = 0; + } + } + + VTX_DUMP(TRACE2(" DIF(%08X), SPE(%08X)", v.dcDiffuse, v.dcSpecular)); + VTX_DUMP(TRACE0("")); +} + +uint32 LightVert(XVECTOR4 & norm, int vidx) +{ + float fCosT; + + // Do ambient + register float r = gRSP.fAmbientLightR; + register float g = gRSP.fAmbientLightG; + register float b = gRSP.fAmbientLightB; + + if( options.enableHackForGames != HACK_FOR_ZELDA_MM ) + { + for (register unsigned int l=0; l < gRSPnumLights; l++) + { + fCosT = norm.x*gRSPlights[l].x + norm.y*gRSPlights[l].y + norm.z*gRSPlights[l].z; + + if (fCosT > 0 ) + { + r += gRSPlights[l].fr * fCosT; + g += gRSPlights[l].fg * fCosT; + b += gRSPlights[l].fb * fCosT; + } + } + } + else + { + XVECTOR4 v; + bool transformed = false; + + for (register unsigned int l=0; l < gRSPnumLights; l++) + { + if( gRSPlights[l].range == 0 ) + { + // Regular directional light + fCosT = norm.x*gRSPlights[l].x + norm.y*gRSPlights[l].y + norm.z*gRSPlights[l].z; + + if (fCosT > 0 ) + { + r += gRSPlights[l].fr * fCosT; + g += gRSPlights[l].fg * fCosT; + b += gRSPlights[l].fb * fCosT; + } + } + else //if( (gRSPlights[l].col&0x00FFFFFF) != 0x00FFFFFF ) + { + // Point light + if( !transformed ) + { + Vec3Transform(&v, (XVECTOR3*)&g_vtxNonTransformed[vidx], &gRSPmodelViewTop); // Convert to w=1 + transformed = true; + } + + XVECTOR3 dir(gRSPlights[l].x - v.x, gRSPlights[l].y - v.y, gRSPlights[l].z - v.z); + //XVECTOR3 dir(v.x-gRSPlights[l].x, v.y-gRSPlights[l].y, v.z-gRSPlights[l].z); + float d2 = sqrtf(dir.x*dir.x+dir.y*dir.y+dir.z*dir.z); + dir.x /= d2; + dir.y /= d2; + dir.z /= d2; + + fCosT = norm.x*dir.x + norm.y*dir.y + norm.z*dir.z; + + if (fCosT > 0 ) + { + //float f = d2/gRSPlights[l].range*50; + float f = d2/15000*50; + f = 1 - min(f,1); + fCosT *= f*f; + + r += gRSPlights[l].fr * fCosT; + g += gRSPlights[l].fg * fCosT; + b += gRSPlights[l].fb * fCosT; + } + } + } + } + + if (r > 255) r = 255; + if (g > 255) g = 255; + if (b > 255) b = 255; + return ((0xff000000)|(((uint32)r)<<16)|(((uint32)g)<<8)|((uint32)b)); +} + +uint32 LightVertNew(XVECTOR4 & norm) +{ + float fCosT; + + // Do ambient + register float r = gRSP.fAmbientLightR; + register float g = gRSP.fAmbientLightG; + register float b = gRSP.fAmbientLightB; + + + for (register unsigned int l=0; l < gRSPnumLights; l++) + { + fCosT = norm.x*gRSPlights[l].tx + norm.y*gRSPlights[l].ty + norm.z*gRSPlights[l].tz; + + if (fCosT > 0 ) + { + r += gRSPlights[l].fr * fCosT; + g += gRSPlights[l].fg * fCosT; + b += gRSPlights[l].fb * fCosT; + } + } + + if (r > 255) r = 255; + if (g > 255) g = 255; + if (b > 255) b = 255; + return ((0xff000000)|(((uint32)r)<<16)|(((uint32)g)<<8)|((uint32)b)); +} + + +float zero = 0.0f; +float onef = 1.0f; +float fcosT; + +#if !defined(__GNUC__) && !defined(NO_ASM) +__declspec( naked ) uint32 __fastcall SSELightVert() +{ + __asm + { + movaps xmm3, DWORD PTR gRSP; // loading Ambient colors, xmm3 is the result color + movaps xmm4, DWORD PTR [g_normal]; // xmm4 is the normal + + mov ecx, 0; +loopback: + cmp ecx, DWORD PTR gRSPnumLights; + jae breakout; + mov eax,ecx; + imul eax,0x44; + movups xmm5, DWORD PTR gRSPlights[eax]; // Light Dir + movups xmm1, DWORD PTR gRSPlights[0x14][eax]; // Light color + mulps xmm5, xmm4; // Lightdir * normals + + movhlps xmm0,xmm5; + addps xmm0,xmm5; + shufps xmm5,xmm0,0x01; + addps xmm0,xmm5; + + comiss xmm0,zero; + jc endloop + + shufps xmm0,xmm0,0; // fcosT + mulps xmm1,xmm0; + addps xmm3,xmm1; +endloop: + inc ecx; + jmp loopback; +breakout: + + movss xmm0,DWORD PTR real255; + shufps xmm0,xmm0,0; + minps xmm0,xmm3; + + // Without using a memory + cvtss2si eax,xmm0; // move the 1st uint32 to eax + shl eax,10h; + or eax,0FF000000h; + shufps xmm0,xmm0,0E5h; // move the 2nd uint32 to the 1st uint32 + cvtss2si ecx,xmm0; // move the 1st uint32 to ecx + shl ecx,8; + or eax,ecx; + shufps xmm0,xmm0,0E6h; // Move the 3rd uint32 to the 1st uint32 + cvtss2si ecx,xmm0; + or eax,ecx; + + ret; + } +} +#elif defined(__GNUC__) && defined(__x86_64__) && !defined(NO_ASM) +uint32 SSELightVert(void) +{ + uint32 rval; + float f255 = 255.0, fZero = 0.0; + + asm volatile(" movaps %1, %%xmm3 \n" // xmm3 == gRSP.fAmbientLight{RGBA} + " movaps %2, %%xmm4 \n" // xmm4 == g_normal.{xyz} + " xor %%rcx, %%rcx \n" + "0: \n" + " cmpl %3, %%ecx \n" + " jae 2f \n" + " mov %%rcx, %%rax \n" + " imul $0x44, %%rax, %%rax \n" + " movups (%4,%%rax,), %%xmm5 \n" // xmm5 == gRSPlights[l].{xyzr} + " movups 20(%4,%%rax,), %%xmm1 \n" // xmm1 == gRSPlights[l].{frfgfbfa} + " mulps %%xmm4, %%xmm5 \n" + " movhlps %%xmm5, %%xmm0 \n" + " addps %%xmm5, %%xmm0 \n" + " shufps $0x01, %%xmm0, %%xmm5 \n" + " addps %%xmm5, %%xmm0 \n" + " comiss %6, %%xmm0 \n" + " jc 1f \n" + " shufps $0x00, %%xmm0, %%xmm0 \n" + " mulps %%xmm0, %%xmm1 \n" + " addps %%xmm1, %%xmm3 \n" + "1: \n" + " inc %%rcx \n" + " jmp 0b \n" + "2: \n" + " movss %5, %%xmm0 \n" + " shufps $0x00, %%xmm0, %%xmm0 \n" + " minps %%xmm3, %%xmm0 \n" + " cvtss2si %%xmm0, %%eax \n" + " shll $0x10, %%eax \n" + " orl $0xff000000, %%eax \n" + " shufps $0xe5, %%xmm0, %%xmm0 \n" + " cvtss2si %%xmm0, %%ecx \n" + " shll $8, %%ecx \n" + " orl %%ecx, %%eax \n" + " shufps $0xe6, %%xmm0, %%xmm0 \n" + " cvtss2si %%xmm0, %%ecx \n" + " orl %%ecx, %%eax \n" + : "=&a"(rval) + : "m"(gRSP), "m"(g_normal), "m"(gRSPnumLights), "r"(gRSPlights), "m"(f255), "m"(fZero) + : "%rcx", "memory", "cc", "%xmm0", "%xmm1", "%xmm3", "%xmm4", "%xmm5" + ); + return rval; +} +#elif !defined(NO_ASM) // 32-bit GCC assumed +uint32 SSELightVert(void) +{ + uint32 rval; + float f255 = 255.0, fZero = 0.0; + + asm volatile(" movaps %1, %%xmm3 \n" + " movaps %2, %%xmm4 \n" + " xor %%ecx, %%ecx \n" + "0: \n" + " cmpl %3, %%ecx \n" + " jae 2f \n" + " mov %%ecx, %%eax \n" + " imul $0x44, %%eax, %%eax \n" + " movups (%4,%%eax,), %%xmm5 \n" + " movups 20(%4,%%eax,), %%xmm1 \n" + " mulps %%xmm4, %%xmm5 \n" + " movhlps %%xmm5, %%xmm0 \n" + " addps %%xmm5, %%xmm0 \n" + " shufps $0x01, %%xmm0, %%xmm5 \n" + " addps %%xmm5, %%xmm0 \n" + " comiss %6, %%xmm0 \n" + " jc 1f \n" + " shufps $0x00, %%xmm0, %%xmm0 \n" + " mulps %%xmm0, %%xmm1 \n" + " addps %%xmm1, %%xmm3 \n" + "1: \n" + " inc %%ecx \n" + " jmp 0b \n" + "2: \n" + " movss %5, %%xmm0 \n" + " shufps $0x00, %%xmm0, %%xmm0 \n" + " minps %%xmm3, %%xmm0 \n" + " cvtss2si %%xmm0, %%eax \n" + " shll $0x10, %%eax \n" + " orl $0xff000000, %%eax \n" + " shufps $0xe5, %%xmm0, %%xmm0 \n" + " cvtss2si %%xmm0, %%ecx \n" + " shll $8, %%ecx \n" + " orl %%ecx, %%eax \n" + " shufps $0xe6, %%xmm0, %%xmm0 \n" + " cvtss2si %%xmm0, %%ecx \n" + " orl %%ecx, %%eax \n" + : "=&a"(rval) + : "m"(gRSP), "m"(g_normal), "m"(gRSPnumLights), "r"(gRSPlights), "m"(f255), "m"(fZero) + : "%rcx", "memory", "cc", "%xmm0", "%xmm1", "%xmm3", "%xmm4", "%xmm5" + ); + return rval; +} +#endif + +inline void ReplaceAlphaWithFogFactor(int i) +{ + if( gRDP.geometryMode & G_FOG ) + { + // Use fog factor to replace vertex alpha + if( g_vecProjected[i].z > 1 ) + *(((uint8*)&(g_dwVtxDifColor[i]))+3) = 0xFF; + if( g_vecProjected[i].z < 0 ) + *(((uint8*)&(g_dwVtxDifColor[i]))+3) = 0; + else + *(((uint8*)&(g_dwVtxDifColor[i]))+3) = (uint8)(g_vecProjected[i].z*255); + } +} + + +// Bits +// +-+-+- +// xxyyzz +#define Z_NEG 0x01 +#define Z_POS 0x02 +#define Y_NEG 0x04 +#define Y_POS 0x08 +#define X_NEG 0x10 +#define X_POS 0x20 + +// Assumes dwAddr has already been checked! +// Don't inline - it's too big with the transform macros + +#if !defined(NO_ASM) +void ProcessVertexDataSSE(uint32 dwAddr, uint32 dwV0, uint32 dwNum) +{ + UpdateCombinedMatrix(); + + // This function is called upon SPvertex + // - do vertex matrix transform + // - do vertex lighting + // - do texture cooridinate transform if needed + // - calculate normal vector + + // Output: - g_vecProjected[i] -> transformed vertex x,y,z + // - g_vecProjected[i].w -> saved vertex 1/w + // - g_dwVtxFlags[i] -> flags + // - g_dwVtxDifColor[i] -> vertex color + // - g_fVtxTxtCoords[i] -> vertex texture cooridinates + + FiddledVtx * pVtxBase = (FiddledVtx*)(g_pRDRAMu8 + dwAddr); + g_pVtxBase = pVtxBase; + + for (uint32 i = dwV0; i < dwV0 + dwNum; i++) + { + SP_Timing(RSP_GBI0_Vtx); + + FiddledVtx & vert = pVtxBase[i - dwV0]; + + g_vtxNonTransformed[i].x = (float)vert.x; + g_vtxNonTransformed[i].y = (float)vert.y; + g_vtxNonTransformed[i].z = (float)vert.z; + + SSEVec3Transform(i); + + if( gRSP.bFogEnabled ) + { + g_fFogCoord[i] = g_vecProjected[i].z; + if( g_vecProjected[i].w < 0 || g_vecProjected[i].z < 0 || g_fFogCoord[i] < gRSPfFogMin ) + g_fFogCoord[i] = gRSPfFogMin; + } + + ReplaceAlphaWithFogFactor(i); + + + VTX_DUMP( + { + uint32 *dat = (uint32*)(&vert); + DebuggerAppendMsg("vtx %d: %08X %08X %08X %08X", i, dat[0],dat[1],dat[2],dat[3]); + DebuggerAppendMsg(" : %f, %f, %f, %f", + g_vtxTransformed[i].x,g_vtxTransformed[i].y,g_vtxTransformed[i].z,g_vtxTransformed[i].w); + DebuggerAppendMsg(" : %f, %f, %f, %f", + g_vecProjected[i].x,g_vecProjected[i].y,g_vecProjected[i].z,g_vecProjected[i].w); + }); + + RSP_Vtx_Clipping(i); + + if( gRSP.bLightingEnable ) + { + g_normal.x = (float)vert.norma.nx; + g_normal.y = (float)vert.norma.ny; + g_normal.z = (float)vert.norma.nz; + + SSEVec3TransformNormal(); + if( options.enableHackForGames != HACK_FOR_ZELDA_MM ) + g_dwVtxDifColor[i] = SSELightVert(); + else + g_dwVtxDifColor[i] = LightVert(g_normal, i); + *(((uint8*)&(g_dwVtxDifColor[i]))+3) = vert.rgba.a; // still use alpha from the vertex + } + else + { + if( (gRDP.geometryMode & G_SHADE) == 0 && gRSP.ucode < 5 ) //Shade is disabled + { + //FLAT shade + g_dwVtxDifColor[i] = gRDP.primitiveColor; + } + else + { + register IColor &color = *(IColor*)&g_dwVtxDifColor[i]; + color.b = vert.rgba.r; + color.g = vert.rgba.g; + color.r = vert.rgba.b; + color.a = vert.rgba.a; + } + } + + if( options.bWinFrameMode ) + { + g_dwVtxDifColor[i] = COLOR_RGBA(vert.rgba.r, vert.rgba.g, vert.rgba.b, vert.rgba.a); + } + + // Update texture coords n.b. need to divide tu/tv by bogus scale on addition to buffer + + // If the vert is already lit, then there is no normal (and hence we + // can't generate tex coord) + if (gRSP.bTextureGen && gRSP.bLightingEnable ) + { + TexGen(g_fVtxTxtCoords[i].x, g_fVtxTxtCoords[i].y); + } + else + { + g_fVtxTxtCoords[i].x = (float)vert.tu; + g_fVtxTxtCoords[i].y = (float)vert.tv; + } + } + + VTX_DUMP(TRACE2("Setting Vertexes: %d - %d\n", dwV0, dwV0+dwNum-1)); + DEBUGGER_PAUSE_AND_DUMP(NEXT_VERTEX_CMD,{TRACE0("Paused at Vertex Cmd");}); +} +#endif + +void ProcessVertexDataNoSSE(uint32 dwAddr, uint32 dwV0, uint32 dwNum) +{ + + UpdateCombinedMatrix(); + + // This function is called upon SPvertex + // - do vertex matrix transform + // - do vertex lighting + // - do texture cooridinate transform if needed + // - calculate normal vector + + // Output: - g_vecProjected[i] -> transformed vertex x,y,z + // - g_vecProjected[i].w -> saved vertex 1/w + // - g_dwVtxFlags[i] -> flags + // - g_dwVtxDifColor[i] -> vertex color + // - g_fVtxTxtCoords[i] -> vertex texture cooridinates + + FiddledVtx * pVtxBase = (FiddledVtx*)(g_pRDRAMu8 + dwAddr); + g_pVtxBase = pVtxBase; + + for (uint32 i = dwV0; i < dwV0 + dwNum; i++) + { + SP_Timing(RSP_GBI0_Vtx); + + FiddledVtx & vert = pVtxBase[i - dwV0]; + + g_vtxNonTransformed[i].x = (float)vert.x; + g_vtxNonTransformed[i].y = (float)vert.y; + g_vtxNonTransformed[i].z = (float)vert.z; + + Vec3Transform(&g_vtxTransformed[i], (XVECTOR3*)&g_vtxNonTransformed[i], &gRSPworldProject); // Convert to w=1 + + g_vecProjected[i].w = 1.0f / g_vtxTransformed[i].w; + g_vecProjected[i].x = g_vtxTransformed[i].x * g_vecProjected[i].w; + g_vecProjected[i].y = g_vtxTransformed[i].y * g_vecProjected[i].w; + if ((g_curRomInfo.bPrimaryDepthHack || options.enableHackForGames == HACK_FOR_NASCAR ) && gRDP.otherMode.depth_source ) + { + g_vecProjected[i].z = gRDP.fPrimitiveDepth; + g_vtxTransformed[i].z = gRDP.fPrimitiveDepth*g_vtxTransformed[i].w; + } + else + { + g_vecProjected[i].z = g_vtxTransformed[i].z * g_vecProjected[i].w; + } + + if( gRSP.bFogEnabled ) + { + g_fFogCoord[i] = g_vecProjected[i].z; + if( g_vecProjected[i].w < 0 || g_vecProjected[i].z < 0 || g_fFogCoord[i] < gRSPfFogMin ) + g_fFogCoord[i] = gRSPfFogMin; + } + + VTX_DUMP( + { + uint32 *dat = (uint32*)(&vert); + DebuggerAppendMsg("vtx %d: %08X %08X %08X %08X", i, dat[0],dat[1],dat[2],dat[3]); + DebuggerAppendMsg(" : %f, %f, %f, %f", + g_vtxTransformed[i].x,g_vtxTransformed[i].y,g_vtxTransformed[i].z,g_vtxTransformed[i].w); + DebuggerAppendMsg(" : %f, %f, %f, %f", + g_vecProjected[i].x,g_vecProjected[i].y,g_vecProjected[i].z,g_vecProjected[i].w); + }); + + RSP_Vtx_Clipping(i); + + if( gRSP.bLightingEnable ) + { + g_normal.x = (float)vert.norma.nx; + g_normal.y = (float)vert.norma.ny; + g_normal.z = (float)vert.norma.nz; + + Vec3TransformNormal(g_normal, gRSPmodelViewTop); + g_dwVtxDifColor[i] = LightVert(g_normal, i); + *(((uint8*)&(g_dwVtxDifColor[i]))+3) = vert.rgba.a; // still use alpha from the vertex + } + else + { + if( (gRDP.geometryMode & G_SHADE) == 0 && gRSP.ucode < 5 ) //Shade is disabled + { + //FLAT shade + g_dwVtxDifColor[i] = gRDP.primitiveColor; + } + else + { + register IColor &color = *(IColor*)&g_dwVtxDifColor[i]; + color.b = vert.rgba.r; + color.g = vert.rgba.g; + color.r = vert.rgba.b; + color.a = vert.rgba.a; + } + } + + if( options.bWinFrameMode ) + { + g_dwVtxDifColor[i] = COLOR_RGBA(vert.rgba.r, vert.rgba.g, vert.rgba.b, vert.rgba.a); + } + + ReplaceAlphaWithFogFactor(i); + + // Update texture coords n.b. need to divide tu/tv by bogus scale on addition to buffer + + // If the vert is already lit, then there is no normal (and hence we + // can't generate tex coord) + if (gRSP.bTextureGen && gRSP.bLightingEnable ) + { + TexGen(g_fVtxTxtCoords[i].x, g_fVtxTxtCoords[i].y); + } + else + { + g_fVtxTxtCoords[i].x = (float)vert.tu; + g_fVtxTxtCoords[i].y = (float)vert.tv; + } + } + + VTX_DUMP(TRACE2("Setting Vertexes: %d - %d\n", dwV0, dwV0+dwNum-1)); + DEBUGGER_PAUSE_AND_DUMP(NEXT_VERTEX_CMD,{TRACE0("Paused at Vertex Cmd");}); +} + +bool PrepareTriangle(uint32 dwV0, uint32 dwV1, uint32 dwV2) +{ + if( status.isVertexShaderEnabled || status.bUseHW_T_L ) + { + g_vtxIndex[gRSP.numVertices++] = dwV0; + g_vtxIndex[gRSP.numVertices++] = dwV1; + g_vtxIndex[gRSP.numVertices++] = dwV2; + status.dwNumTrisRendered++; + gRSP.maxVertexID = max(gRSP.maxVertexID,max(dwV0,max(dwV1,dwV2))); + } + else + { + SP_Timing(SP_Each_Triangle); + + bool textureFlag = (CRender::g_pRender->IsTextureEnabled() || gRSP.ucode == 6 ); + bool openGL = CDeviceBuilder::m_deviceGeneralType == OGL_DEVICE; + + InitVertex(dwV0, gRSP.numVertices, textureFlag, openGL); + InitVertex(dwV1, gRSP.numVertices+1, textureFlag, openGL); + InitVertex(dwV2, gRSP.numVertices+2, textureFlag, openGL); + + gRSP.numVertices += 3; + status.dwNumTrisRendered++; + } + + return true; +} + + + +// Returns TRUE if it thinks the triangle is visible +// Returns FALSE if it is clipped +bool IsTriangleVisible(uint32 dwV0, uint32 dwV1, uint32 dwV2) +{ + //return true; //fix me + + if( status.isVertexShaderEnabled || status.bUseHW_T_L ) return true; // We won't have access to transformed vertex data + + DEBUGGER_ONLY_IF( (!debuggerEnableTestTris || !debuggerEnableCullFace), {return TRUE;}); + +#ifdef DEBUGGER + // Check vertices are valid! + if (dwV0 >= MAX_VERTS || dwV1 >= MAX_VERTS || dwV2 >= MAX_VERTS) + return false; +#endif + + // Here we AND all the flags. If any of the bits is set for all + // 3 vertices, it means that all three x, y or z lie outside of + // the current viewing volume. + // Currently disabled - still seems a bit dodgy + if ((gRSP.bCullFront || gRSP.bCullBack) && gRDP.otherMode.zmode != 3) + { + XVECTOR4 & v0 = g_vecProjected[dwV0]; + XVECTOR4 & v1 = g_vecProjected[dwV1]; + XVECTOR4 & v2 = g_vecProjected[dwV2]; + + // Only try to clip if the tri is onscreen. For some reason, this + // method doesnt' work well when the z value is outside of screenspace + //if (v0.z < 1 && v1.z < 1 && v2.z < 1) + { + float V1 = v2.x - v0.x; + float V2 = v2.y - v0.y; + + float W1 = v2.x - v1.x; + float W2 = v2.y - v1.y; + + float fDirection = (V1 * W2) - (V2 * W1); + fDirection = fDirection * v1.w * v2.w * v0.w; + //float fDirection = v0.x*v1.y-v1.x*v0.y+v1.x*v2.y-v2.x*v1.y+v2.x*v0.y-v0.x*v2.y; + + if (fDirection < 0 && gRSP.bCullBack) + { + status.dwNumTrisClipped++; + return false; + } + else if (fDirection > 0 && gRSP.bCullFront) + { + status.dwNumTrisClipped++; + return false; + } + } + } + +#ifdef ENABLE_CLIP_TRI + //if( gRSP.bRejectVtx && (g_clipFlag[dwV0]|g_clipFlag[dwV1]|g_clipFlag[dwV2]) ) + // return; + if( g_clipFlag2[dwV0]&g_clipFlag2[dwV1]&g_clipFlag2[dwV2] ) + { + //DebuggerAppendMsg("Clipped"); + return false; + } +#endif + + return true; +} + + +void SetPrimitiveColor(uint32 dwCol, uint32 LODMin, uint32 LODFrac) +{ + gRDP.colorsAreReloaded = true; + gRDP.primitiveColor = dwCol; + gRDP.primLODMin = LODMin; + gRDP.primLODFrac = LODFrac; + if( gRDP.primLODFrac < gRDP.primLODMin ) + { + gRDP.primLODFrac = gRDP.primLODMin; + } + + gRDP.fvPrimitiveColor[0] = ((dwCol>>16)&0xFF)/255.0f; //r + gRDP.fvPrimitiveColor[1] = ((dwCol>>8)&0xFF)/255.0f; //g + gRDP.fvPrimitiveColor[2] = ((dwCol)&0xFF)/255.0f; //b + gRDP.fvPrimitiveColor[3] = ((dwCol>>24)&0xFF)/255.0f; //a +} + +void SetPrimitiveDepth(uint32 z, uint32 dwDZ) +{ + gRDP.primitiveDepth = z & 0x7FFF; + gRDP.fPrimitiveDepth = (float)(gRDP.primitiveDepth)/(float)0x8000; + + //gRDP.fPrimitiveDepth = gRDP.fPrimitiveDepth*2-1; + /* + z=0xFFFF -> 1 the farest + z=0 -> -1 the nearest + */ + + //how to use dwDZ? + +#ifdef DEBUGGER + if( (pauseAtNext && (eventToPause == NEXT_VERTEX_CMD || eventToPause == NEXT_FLUSH_TRI )) )//&& logTriangles ) + { + DebuggerAppendMsg("Set prim Depth: %f, (%08X, %08X)", gRDP.fPrimitiveDepth, z, dwDZ); + } +#endif +} + +void SetVertexXYZ(uint32 vertex, float x, float y, float z) +{ + g_vecProjected[vertex].x = x; + g_vecProjected[vertex].y = y; + g_vecProjected[vertex].z = z; + + g_vtxTransformed[vertex].x = x*g_vtxTransformed[vertex].w; + g_vtxTransformed[vertex].y = y*g_vtxTransformed[vertex].w; + g_vtxTransformed[vertex].z = z*g_vtxTransformed[vertex].w; +} + +void ModifyVertexInfo(uint32 where, uint32 vertex, uint32 val) +{ + switch (where) + { + case RSP_MV_WORD_OFFSET_POINT_RGBA: // Modify RGBA + { + uint32 r = (val>>24)&0xFF; + uint32 g = (val>>16)&0xFF; + uint32 b = (val>>8)&0xFF; + uint32 a = val&0xFF; + g_dwVtxDifColor[vertex] = COLOR_RGBA(r, g, b, a); + LOG_UCODE("Modify vert %d color, 0x%08x", vertex, g_dwVtxDifColor[vertex]); + } + break; + case RSP_MV_WORD_OFFSET_POINT_XYSCREEN: // Modify X,Y + { + uint16 nX = (uint16)(val>>16); + short x = *((short*)&nX); + x /= 4; + + uint16 nY = (uint16)(val&0xFFFF); + short y = *((short*)&nY); + y /= 4; + + // Should do viewport transform. + + + x -= windowSetting.uViWidth/2; + y = windowSetting.uViHeight/2-y; + + if( options.bEnableHacks && ((*g_GraphicsInfo.VI_X_SCALE_REG)&0xF) != 0 ) + { + // Tarzan + // I don't know why Tarzan is different + SetVertexXYZ(vertex, x/windowSetting.fViWidth, y/windowSetting.fViHeight, g_vecProjected[vertex].z); + } + else + { + // Toy Story 2 and other games + SetVertexXYZ(vertex, x*2/windowSetting.fViWidth, y*2/windowSetting.fViHeight, g_vecProjected[vertex].z); + } + + LOG_UCODE("Modify vert %d: x=%d, y=%d", vertex, x, y); + VTX_DUMP(TRACE3("Modify vert %d: (%d,%d)", vertex, x, y)); + } + break; + case RSP_MV_WORD_OFFSET_POINT_ZSCREEN: // Modify C + { + int z = val>>16; + + SetVertexXYZ(vertex, g_vecProjected[vertex].x, g_vecProjected[vertex].y, (((float)z/0x03FF)+0.5f)/2.0f ); + LOG_UCODE("Modify vert %d: z=%d", vertex, z); + VTX_DUMP(TRACE2("Modify vert %d: z=%d", vertex, z)); + } + break; + case RSP_MV_WORD_OFFSET_POINT_ST: // Texture + { + short tu = short(val>>16); + short tv = short(val & 0xFFFF); + float ftu = tu / 32.0f; + float ftv = tv / 32.0f; + LOG_UCODE(" Setting vertex %d tu/tv to %f, %f", vertex, (float)tu, (float)tv); + CRender::g_pRender->SetVtxTextureCoord(vertex, ftu/gRSP.fTexScaleX, ftv/gRSP.fTexScaleY); + } + break; + } + DEBUGGER_PAUSE_AND_DUMP(NEXT_VERTEX_CMD,{TRACE0("Paused at ModVertex Cmd");}); +} + +void ProcessVertexDataDKR(uint32 dwAddr, uint32 dwV0, uint32 dwNum) +{ + UpdateCombinedMatrix(); + + long long pVtxBase = (long long) (g_pRDRAMu8 + dwAddr); + g_pVtxBase = (FiddledVtx*)pVtxBase; + + Matrix &matWorldProject = gRSP.DKRMatrixes[gRSP.DKRCMatrixIndex]; + + int nOff; + + bool addbase=false; + if ((!gRSP.DKRBillBoard) || (gRSP.DKRCMatrixIndex != 2) ) + addbase = false; + else + addbase = true; + + if( addbase && gRSP.DKRVtxCount == 0 && dwNum > 1 ) + { + gRSP.DKRVtxCount++; + } + + LOG_UCODE(" ProcessVertexDataDKR, CMatrix = %d, Add base=%s", gRSP.DKRCMatrixIndex, gRSP.DKRBillBoard?"true":"false"); + VTX_DUMP(TRACE2("DKR Setting Vertexes\nCMatrix = %d, Add base=%s", gRSP.DKRCMatrixIndex, gRSP.DKRBillBoard?"true":"false")); + + nOff = 0; + uint32 end = dwV0 + dwNum; + for (uint32 i = dwV0; i < end; i++) + { + XVECTOR3 w; + + g_vtxNonTransformed[i].x = (float)*(short*)((pVtxBase+nOff + 0) ^ 2); + g_vtxNonTransformed[i].y = (float)*(short*)((pVtxBase+nOff + 2) ^ 2); + g_vtxNonTransformed[i].z = (float)*(short*)((pVtxBase+nOff + 4) ^ 2); + + //if( status.isSSEEnabled ) + // SSEVec3TransformDKR(g_vtxTransformed[i], g_vtxNonTransformed[i]); + //else + Vec3Transform(&g_vtxTransformed[i], (XVECTOR3*)&g_vtxNonTransformed[i], &matWorldProject); // Convert to w=1 + + if( gRSP.DKRVtxCount == 0 && dwNum==1 ) + { + gRSP.DKRBaseVec.x = g_vtxTransformed[i].x; + gRSP.DKRBaseVec.y = g_vtxTransformed[i].y; + gRSP.DKRBaseVec.z = g_vtxTransformed[i].z; + gRSP.DKRBaseVec.w = g_vtxTransformed[i].w; + } + else if( addbase ) + { + g_vtxTransformed[i].x += gRSP.DKRBaseVec.x; + g_vtxTransformed[i].y += gRSP.DKRBaseVec.y; + g_vtxTransformed[i].z += gRSP.DKRBaseVec.z; + g_vtxTransformed[i].w = gRSP.DKRBaseVec.w; + } + + g_vecProjected[i].w = 1.0f / g_vtxTransformed[i].w; + g_vecProjected[i].x = g_vtxTransformed[i].x * g_vecProjected[i].w; + g_vecProjected[i].y = g_vtxTransformed[i].y * g_vecProjected[i].w; + g_vecProjected[i].z = g_vtxTransformed[i].z * g_vecProjected[i].w; + + gRSP.DKRVtxCount++; + + VTX_DUMP(TRACE5("vtx %d: %f, %f, %f, %f", i, + g_vtxTransformed[i].x,g_vtxTransformed[i].y,g_vtxTransformed[i].z,g_vtxTransformed[i].w)); + + if( gRSP.bFogEnabled ) + { + g_fFogCoord[i] = g_vecProjected[i].z; + if( g_vecProjected[i].w < 0 || g_vecProjected[i].z < 0 || g_fFogCoord[i] < gRSPfFogMin ) + g_fFogCoord[i] = gRSPfFogMin; + } + + RSP_Vtx_Clipping(i); + + short wA = *(short*)((pVtxBase+nOff + 6) ^ 2); + short wB = *(short*)((pVtxBase+nOff + 8) ^ 2); + + s8 r = (s8)(wA >> 8); + s8 g = (s8)(wA); + s8 b = (s8)(wB >> 8); + s8 a = (s8)(wB); + + if (gRSP.bLightingEnable) + { + g_normal.x = (char)r; //norma.nx; + g_normal.y = (char)g; //norma.ny; + g_normal.z = (char)b; //norma.nz; + + Vec3TransformNormal(g_normal, matWorldProject) +#if !defined(NO_ASM) + if( status.isSSEEnabled ) + g_dwVtxDifColor[i] = SSELightVert(); + else +#endif + g_dwVtxDifColor[i] = LightVert(g_normal, i); + } + else + { + int nR, nG, nB, nA; + + nR = r; + nG = g; + nB = b; + nA = a; + // Assign true vert colour after lighting/fogging + g_dwVtxDifColor[i] = COLOR_RGBA(nR, nG, nB, nA); + } + + ReplaceAlphaWithFogFactor(i); + + g_fVtxTxtCoords[i].x = g_fVtxTxtCoords[i].y = 1; + + nOff += 10; + } + + + DEBUGGER_PAUSE_AND_DUMP(NEXT_VERTEX_CMD,{DebuggerAppendMsg("Paused at DKR Vertex Cmd, v0=%d, vn=%d, addr=%08X", dwV0, dwNum, dwAddr);}); +} + + +extern uint32 dwPDCIAddr; +void ProcessVertexDataPD(uint32 dwAddr, uint32 dwV0, uint32 dwNum) +{ + UpdateCombinedMatrix(); + + N64VtxPD * pVtxBase = (N64VtxPD*)(g_pRDRAMu8 + dwAddr); + g_pVtxBase = (FiddledVtx*)pVtxBase; // Fix me + + for (uint32 i = dwV0; i < dwV0 + dwNum; i++) + { + N64VtxPD &vert = pVtxBase[i - dwV0]; + + g_vtxNonTransformed[i].x = (float)vert.x; + g_vtxNonTransformed[i].y = (float)vert.y; + g_vtxNonTransformed[i].z = (float)vert.z; + +#if !defined(NO_ASM) + if( status.isSSEEnabled ) + SSEVec3Transform(i); + else +#endif + { + Vec3Transform(&g_vtxTransformed[i], (XVECTOR3*)&g_vtxNonTransformed[i], &gRSPworldProject); // Convert to w=1 + g_vecProjected[i].w = 1.0f / g_vtxTransformed[i].w; + g_vecProjected[i].x = g_vtxTransformed[i].x * g_vecProjected[i].w; + g_vecProjected[i].y = g_vtxTransformed[i].y * g_vecProjected[i].w; + g_vecProjected[i].z = g_vtxTransformed[i].z * g_vecProjected[i].w; + } + + g_fFogCoord[i] = g_vecProjected[i].z; + if( g_vecProjected[i].w < 0 || g_vecProjected[i].z < 0 || g_fFogCoord[i] < gRSPfFogMin ) + g_fFogCoord[i] = gRSPfFogMin; + + RSP_Vtx_Clipping(i); + + uint8 *addr = g_pRDRAMu8+dwPDCIAddr+ (vert.cidx&0xFF); + uint32 a = addr[0]; + uint32 r = addr[3]; + uint32 g = addr[2]; + uint32 b = addr[1]; + + if( gRSP.bLightingEnable ) + { + g_normal.x = (char)r; + g_normal.y = (char)g; + g_normal.z = (char)b; +#if !defined(NO_ASM) + if( status.isSSEEnabled ) + { + SSEVec3TransformNormal(); + g_dwVtxDifColor[i] = SSELightVert(); + } + else +#endif + { + Vec3TransformNormal(g_normal, gRSPmodelViewTop); + g_dwVtxDifColor[i] = LightVert(g_normal, i); + } + *(((uint8*)&(g_dwVtxDifColor[i]))+3) = (uint8)a; // still use alpha from the vertex + } + else + { + if( (gRDP.geometryMode & G_SHADE) == 0 && gRSP.ucode < 5 ) //Shade is disabled + { + g_dwVtxDifColor[i] = gRDP.primitiveColor; + } + else //FLAT shade + { + g_dwVtxDifColor[i] = COLOR_RGBA(r, g, b, a); + } + } + + if( options.bWinFrameMode ) + { + g_dwVtxDifColor[i] = COLOR_RGBA(r, g, b, a); + } + + ReplaceAlphaWithFogFactor(i); + + VECTOR2 & t = g_fVtxTxtCoords[i]; + if (gRSP.bTextureGen && gRSP.bLightingEnable ) + { + // Not sure if we should transform the normal here + //Matrix & matWV = gRSP.projectionMtxs[gRSP.projectionMtxTop]; + //Vec3TransformNormal(g_normal, matWV); + + TexGen(g_fVtxTxtCoords[i].x, g_fVtxTxtCoords[i].y); + } + else + { + t.x = vert.s; + t.y = vert.t; + } + + + VTX_DUMP( + { + DebuggerAppendMsg("vtx %d: %d %d %d", i, vert.x,vert.y,vert.z); + DebuggerAppendMsg(" : %f, %f, %f, %f", + g_vtxTransformed[i].x,g_vtxTransformed[i].y,g_vtxTransformed[i].z,g_vtxTransformed[i].w); + DebuggerAppendMsg(" : %X, %X, %X, %X", r,g,b,a); + DebuggerAppendMsg(" : u=%f, v=%f", t.x, t.y); + }); + } + + VTX_DUMP(TRACE2("Setting Vertexes: %d - %d\n", dwV0, dwV0+dwNum-1)); + DEBUGGER_PAUSE_AND_DUMP(NEXT_VERTEX_CMD,{TRACE0("Paused at Vertex Cmd");}); +} + +extern uint32 dwConkerVtxZAddr; +void ProcessVertexDataConker(uint32 dwAddr, uint32 dwV0, uint32 dwNum) +{ + UpdateCombinedMatrix(); + + FiddledVtx * pVtxBase = (FiddledVtx*)(g_pRDRAMu8 + dwAddr); + g_pVtxBase = pVtxBase; + //short *vertexColoraddr = (short*)(g_pRDRAMu8+dwConkerVtxZAddr); + + for (uint32 i = dwV0; i < dwV0 + dwNum; i++) + { + SP_Timing(RSP_GBI0_Vtx); + + FiddledVtx & vert = pVtxBase[i - dwV0]; + + g_vtxNonTransformed[i].x = (float)vert.x; + g_vtxNonTransformed[i].y = (float)vert.y; + g_vtxNonTransformed[i].z = (float)vert.z; + +#if !defined(NO_ASM) + if( status.isSSEEnabled ) + SSEVec3Transform(i); + else +#endif + { + Vec3Transform(&g_vtxTransformed[i], (XVECTOR3*)&g_vtxNonTransformed[i], &gRSPworldProject); // Convert to w=1 + g_vecProjected[i].w = 1.0f / g_vtxTransformed[i].w; + g_vecProjected[i].x = g_vtxTransformed[i].x * g_vecProjected[i].w; + g_vecProjected[i].y = g_vtxTransformed[i].y * g_vecProjected[i].w; + g_vecProjected[i].z = g_vtxTransformed[i].z * g_vecProjected[i].w; + } + + g_fFogCoord[i] = g_vecProjected[i].z; + if( g_vecProjected[i].w < 0 || g_vecProjected[i].z < 0 || g_fFogCoord[i] < gRSPfFogMin ) + g_fFogCoord[i] = gRSPfFogMin; + + VTX_DUMP( + { + uint32 *dat = (uint32*)(&vert); + DebuggerAppendMsg("vtx %d: %08X %08X %08X %08X", i, dat[0],dat[1],dat[2],dat[3]); + DebuggerAppendMsg(" : %f, %f, %f, %f", + g_vtxTransformed[i].x,g_vtxTransformed[i].y,g_vtxTransformed[i].z,g_vtxTransformed[i].w); + DebuggerAppendMsg(" : %f, %f, %f, %f", + g_vecProjected[i].x,g_vecProjected[i].y,g_vecProjected[i].z,g_vecProjected[i].w); + }); + + RSP_Vtx_Clipping(i); + + if( gRSP.bLightingEnable ) + { + { + uint32 r= ((gRSP.ambientLightColor>>16)&0xFF); + uint32 g= ((gRSP.ambientLightColor>> 8)&0xFF); + uint32 b= ((gRSP.ambientLightColor )&0xFF); + for( uint32 k=1; k<=gRSPnumLights; k++) + { + r += gRSPlights[k].r; + g += gRSPlights[k].g; + b += gRSPlights[k].b; + } + if( r>255 ) r=255; + if( g>255 ) g=255; + if( b>255 ) b=255; + r *= vert.rgba.r ; + g *= vert.rgba.g ; + b *= vert.rgba.b ; + r >>= 8; + g >>= 8; + b >>= 8; + g_dwVtxDifColor[i] = 0xFF000000; + g_dwVtxDifColor[i] |= (r<<16); + g_dwVtxDifColor[i] |= (g<< 8); + g_dwVtxDifColor[i] |= (b ); + } + + *(((uint8*)&(g_dwVtxDifColor[i]))+3) = vert.rgba.a; // still use alpha from the vertex + } + else + { + if( (gRDP.geometryMode & G_SHADE) == 0 && gRSP.ucode < 5 ) //Shade is disabled + { + g_dwVtxDifColor[i] = gRDP.primitiveColor; + } + else //FLAT shade + { + g_dwVtxDifColor[i] = COLOR_RGBA(vert.rgba.r, vert.rgba.g, vert.rgba.b, vert.rgba.a); + } + } + + if( options.bWinFrameMode ) + { + //g_vecProjected[i].z = 0; + g_dwVtxDifColor[i] = COLOR_RGBA(vert.rgba.r, vert.rgba.g, vert.rgba.b, vert.rgba.a); + } + + ReplaceAlphaWithFogFactor(i); + + // Update texture coords n.b. need to divide tu/tv by bogus scale on addition to buffer + //VECTOR2 & t = g_fVtxTxtCoords[i]; + + // If the vert is already lit, then there is no normal (and hence we + // can't generate tex coord) + if (gRSP.bTextureGen && gRSP.bLightingEnable ) + { + g_normal.x = (float)*(char*)(g_pRDRAMu8+ (((i<<1)+0)^3)+dwConkerVtxZAddr); + g_normal.y = (float)*(char*)(g_pRDRAMu8+ (((i<<1)+1)^3)+dwConkerVtxZAddr); + g_normal.z = (float)*(char*)(g_pRDRAMu8+ (((i<<1)+2)^3)+dwConkerVtxZAddr); + Vec3TransformNormal(g_normal, gRSPmodelViewTop); + TexGen(g_fVtxTxtCoords[i].x, g_fVtxTxtCoords[i].y); + } + else + { + g_fVtxTxtCoords[i].x = (float)vert.tu; + g_fVtxTxtCoords[i].y = (float)vert.tv; + } + } + + VTX_DUMP(TRACE2("Setting Vertexes: %d - %d\n", dwV0, dwV0+dwNum-1)); + DEBUGGER_PAUSE_AND_DUMP(NEXT_VERTEX_CMD,{DebuggerAppendMsg("Paused at Vertex Cmd");}); +} + + +typedef struct{ + short y; + short x; + short flag; + short z; +} RS_Vtx_XYZ; + +typedef union { + struct { + uint8 a; + uint8 b; + uint8 g; + uint8 r; + }; + struct { + char na; //a + char nz; //b + char ny; //g + char nx; //r + }; +} RS_Vtx_Color; + + +void ProcessVertexData_Rogue_Squadron(uint32 dwXYZAddr, uint32 dwColorAddr, uint32 dwXYZCmd, uint32 dwColorCmd) +{ + UpdateCombinedMatrix(); + + uint32 dwV0 = 0; + uint32 dwNum = (dwXYZCmd&0xFF00)>>10; + + RS_Vtx_XYZ * pVtxXYZBase = (RS_Vtx_XYZ*)(g_pRDRAMu8 + dwXYZAddr); + RS_Vtx_Color * pVtxColorBase = (RS_Vtx_Color*)(g_pRDRAMu8 + dwColorAddr); + + uint32 i; + for (i = dwV0; i < dwV0 + dwNum; i++) + { + RS_Vtx_XYZ & vertxyz = pVtxXYZBase[i - dwV0]; + RS_Vtx_Color & vertcolors = pVtxColorBase[i - dwV0]; + + g_vtxNonTransformed[i].x = (float)vertxyz.x; + g_vtxNonTransformed[i].y = (float)vertxyz.y; + g_vtxNonTransformed[i].z = (float)vertxyz.z; + +#if !defined(NO_ASM) + if( status.isSSEEnabled ) + SSEVec3Transform(i); + else +#endif + { + Vec3Transform(&g_vtxTransformed[i], (XVECTOR3*)&g_vtxNonTransformed[i], &gRSPworldProject); // Convert to w=1 + g_vecProjected[i].w = 1.0f / g_vtxTransformed[i].w; + g_vecProjected[i].x = g_vtxTransformed[i].x * g_vecProjected[i].w; + g_vecProjected[i].y = g_vtxTransformed[i].y * g_vecProjected[i].w; + g_vecProjected[i].z = g_vtxTransformed[i].z * g_vecProjected[i].w; + } + + VTX_DUMP( + { + DebuggerAppendMsg(" : %f, %f, %f, %f", + g_vtxTransformed[i].x,g_vtxTransformed[i].y,g_vtxTransformed[i].z,g_vtxTransformed[i].w); + DebuggerAppendMsg(" : %f, %f, %f, %f", + g_vecProjected[i].x,g_vecProjected[i].y,g_vecProjected[i].z,g_vecProjected[i].w); + }); + + g_fFogCoord[i] = g_vecProjected[i].z; + if( g_vecProjected[i].w < 0 || g_vecProjected[i].z < 0 || g_fFogCoord[i] < gRSPfFogMin ) + g_fFogCoord[i] = gRSPfFogMin; + + RSP_Vtx_Clipping(i); + + if( gRSP.bLightingEnable ) + { + g_normal.x = (float)vertcolors.nx; + g_normal.y = (float)vertcolors.ny; + g_normal.z = (float)vertcolors.nz; + +#if !defined(NO_ASM) + if( status.isSSEEnabled ) + { + SSEVec3TransformNormal(); + g_dwVtxDifColor[i] = SSELightVert(); + } + else +#endif + { + Vec3TransformNormal(g_normal, gRSPmodelViewTop); + g_dwVtxDifColor[i] = LightVert(g_normal, i); + } + *(((uint8*)&(g_dwVtxDifColor[i]))+3) = vertcolors.a; // still use alpha from the vertex + } + else + { + if( (gRDP.geometryMode & G_SHADE) == 0 && gRSP.ucode < 5 ) //Shade is disabled + { + g_dwVtxDifColor[i] = gRDP.primitiveColor; + } + else //FLAT shade + { + g_dwVtxDifColor[i] = COLOR_RGBA(vertcolors.r, vertcolors.g, vertcolors.b, vertcolors.a); + } + } + + if( options.bWinFrameMode ) + { + g_dwVtxDifColor[i] = COLOR_RGBA(vertcolors.r, vertcolors.g, vertcolors.b, vertcolors.a); + } + + ReplaceAlphaWithFogFactor(i); + + /* + // Update texture coords n.b. need to divide tu/tv by bogus scale on addition to buffer + VECTOR2 & t = g_fVtxTxtCoords[i]; + + // If the vert is already lit, then there is no normal (and hence we + // can't generate tex coord) + if (gRSP.bTextureGen && gRSP.bLightingEnable && g_textures[gRSP.curTile].m_bTextureEnable ) + { + TexGen(g_fVtxTxtCoords[i].x, g_fVtxTxtCoords[i].y); + } + else + { + t.x = (float)vert.tu; + t.y = (float)vert.tv; + } + */ + } + + VTX_DUMP(TRACE2("Setting Vertexes: %d - %d\n", dwV0, dwV0+dwNum-1)); + DEBUGGER_PAUSE_AND_DUMP(NEXT_VERTEX_CMD,{TRACE0("Paused at Vertex Cmd");}); +} + +void SetLightCol(uint32 dwLight, uint32 dwCol) +{ + gRSPlights[dwLight].r = (uint8)((dwCol >> 24)&0xFF); + gRSPlights[dwLight].g = (uint8)((dwCol >> 16)&0xFF); + gRSPlights[dwLight].b = (uint8)((dwCol >> 8)&0xFF); + gRSPlights[dwLight].a = 255; // Ignore light alpha + gRSPlights[dwLight].fr = (float)gRSPlights[dwLight].r; + gRSPlights[dwLight].fg = (float)gRSPlights[dwLight].g; + gRSPlights[dwLight].fb = (float)gRSPlights[dwLight].b; + gRSPlights[dwLight].fa = 255; // Ignore light alpha + + //TRACE1("Set light %d color", dwLight); + LIGHT_DUMP(TRACE2("Set Light %d color: %08X", dwLight, dwCol)); +} + +void SetLightDirection(uint32 dwLight, float x, float y, float z, float range) +{ + //gRSP.bLightIsUpdated = true; + + //gRSPlights[dwLight].ox = x; + //gRSPlights[dwLight].oy = y; + //gRSPlights[dwLight].oz = z; + + register float w = range == 0 ? (float)sqrt(x*x+y*y+z*z) : 1; + + gRSPlights[dwLight].x = x/w; + gRSPlights[dwLight].y = y/w; + gRSPlights[dwLight].z = z/w; + gRSPlights[dwLight].range = range; + DEBUGGER_PAUSE_AND_DUMP(NEXT_SET_LIGHT,TRACE5("Set Light %d dir: %.4f, %.4f, %.4f, %.4f", dwLight, x, y, z, range)); +} + +static float maxS0, maxT0; +static float maxS1, maxT1; +static bool validS0, validT0; +static bool validS1, validT1; + +void LogTextureCoords(float fTex0S, float fTex0T, float fTex1S, float fTex1T) +{ + if( validS0 ) + { + if( fTex0S<0 || fTex0S>maxS0 ) validS0 = false; + } + if( validT0 ) + { + if( fTex0T<0 || fTex0T>maxT0 ) validT0 = false; + } + if( validS1 ) + { + if( fTex1S<0 || fTex1S>maxS1 ) validS1 = false; + } + if( validT1 ) + { + if( fTex1T<0 || fTex1T>maxT1 ) validT1 = false; + } +} + +bool CheckTextureCoords(int tex) +{ + if( tex==0 ) + { + return validS0&&validT0; + } + else + { + return validS1&&validT1; + } +} + +void ResetTextureCoordsLog(float maxs0, float maxt0, float maxs1, float maxt1) +{ + maxS0 = maxs0; + maxT0 = maxt0; + maxS1 = maxs1; + maxT1 = maxt1; + validS0 = validT0 = true; + validS1 = validT1 = true; +} + +void ForceMainTextureIndex(int dwTile) +{ + if( dwTile == 1 && !(CRender::g_pRender->IsTexel0Enable()) && CRender::g_pRender->IsTexel1Enable() ) + { + // Hack + gRSP.curTile = 0; + } + else + { + gRSP.curTile = dwTile; + } +} + +float HackZ2(float z) +{ + z = (z+9)/10; + return z; +} + +float HackZ(float z) +{ + return HackZ2(z); + + if( z < 0.1 && z >= 0 ) + z = (.1f+z)/2; + else if( z < 0 ) + //return (10+z)/100; + z = (expf(z)/20); + return z; +} + +void HackZ(std::vector& points) +{ + int size = points.size(); + for( int i=0; i>16)&0xFF)/255.0f; //r + gRDP.fvEnvColor[1] = ((dwCol>>8)&0xFF)/255.0f; //g + gRDP.fvEnvColor[2] = ((dwCol)&0xFF)/255.0f; //b + gRDP.fvEnvColor[3] = ((dwCol>>24)&0xFF)/255.0f; //a +} +inline uint32 GetEnvColor() { return gRDP.envColor; } +inline float* GetEnvColorfv() { return gRDP.fvEnvColor; } + +inline void SetAmbientLight(uint32 color) +{ + gRSP.ambientLightColor = color; + gRSP.fAmbientLightR = (float)RGBA_GETRED(gRSP.ambientLightColor); + gRSP.fAmbientLightG = (float)RGBA_GETGREEN(gRSP.ambientLightColor); + gRSP.fAmbientLightB = (float)RGBA_GETBLUE(gRSP.ambientLightColor); + LIGHT_DUMP(TRACE1("Set Ambient Light: %08X", color)); +} + +inline void SetLighting(bool bLighting) { gRSP.bLightingEnable = bLighting; } + +// Generate texture coords? +inline void SetTextureGen(bool bTextureGen) { gRSP.bTextureGen = bTextureGen; } +inline void SetNumLights(uint32 dwNumLights) +{ + gRSPnumLights = dwNumLights; + DEBUGGER_PAUSE_AND_DUMP(NEXT_SET_LIGHT,TRACE1("Set Num Of Light: %d", dwNumLights)); +} +inline uint32 GetNumLights() { return gRSPnumLights; } +inline COLOR GetVertexDiffuseColor(uint32 ver) { return g_dwVtxDifColor[ver]; } +inline void SetScreenMult(float fMultX, float fMultY) { windowSetting.fMultX = fMultX; windowSetting.fMultY = fMultY; } +inline COLOR GetLightCol(uint32 dwLight) { return gRSPlights[dwLight].col; } + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/RenderExt.cpp b/libmupen64plus/mupen64plus-video-rice/src/RenderExt.cpp new file mode 100644 index 0000000000..564f49ae8e --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/RenderExt.cpp @@ -0,0 +1,927 @@ +/* +Copyright (C) 2002 Rice1964 + +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. + +*/ + +#include "osal_opengl.h" +#include "OGLDebug.h" +#include "FrameBuffer.h" +#include "Render.h" + +extern uObjMtxReal gObjMtxReal; +extern Matrix g_MtxReal; + +//======================================================================== + +void CRender::LoadFrameBuffer(bool useVIreg, uint32 left, uint32 top, uint32 width, uint32 height) +{ + uint32 VIwidth = *g_GraphicsInfo.VI_WIDTH_REG; + + TxtrInfo gti; + + gti.clampS = gti.clampT = 0; + gti.maskS = gti.maskT = gti.mirrorS = gti.mirrorT = 0; + gti.TLutFmt = TLUT_FMT_RGBA16; //RGBA16 + gti.bSwapped = FALSE; + gti.Palette = 0; + + if( useVIreg && *g_GraphicsInfo.VI_ORIGIN_REG > VIwidth*2 ) + { + gti.Format = 0; + gti.Size = 2; + + gti.Address = (*g_GraphicsInfo.VI_ORIGIN_REG & (g_dwRamSize-1) ) - VIwidth*2; + gti.LeftToLoad = 0; + gti.TopToLoad = 0; + + gti.PalAddress = (uchar *) &g_wRDPTlut[0]; + + gti.WidthToCreate = windowSetting.uViWidth;; + gti.HeightToCreate = windowSetting.uViHeight; + + if( gti.WidthToCreate == 0 || gti.HeightToCreate == 0 ) + { + TRACE0("Loading frame buffer: size = 0 x 0"); + return; + } + + gti.Pitch = VIwidth << gti.Size >> 1; + } + else + { + gti.Format = g_CI.dwFormat; + gti.Size = g_CI.dwSize; + gti.PalAddress = (uchar *) &g_wRDPTlut[0]; + + gti.Address = RSPSegmentAddr(g_CI.dwAddr); + + if( width == 0 || height == 0 ) + { + gti.LeftToLoad = 0; + gti.TopToLoad = 0; + + gti.WidthToCreate = g_CI.dwWidth; + gti.HeightToCreate = g_CI.dwWidth*3/4; + } + else + { + gti.LeftToLoad = left; + gti.TopToLoad = top; + + gti.WidthToCreate = width; + gti.HeightToCreate = height; + } + + if( gti.Size == TXT_SIZE_4b ) + { + gti.Pitch = g_CI.dwWidth >> 1; + } + else + { + gti.Pitch = g_CI.dwWidth << (gti.Size-1); + } + } + + + if( gti.Address + gti.Pitch*gti.HeightToCreate > g_dwRamSize ) + { + TRACE0("Skip frame buffer loading, memory out of bound"); + return; + } + +#ifdef DEBUGGER + if( pauseAtNext ) + { + DebuggerAppendMsg("Load Frame Buffer Imag at: %08X, (%d, %d) - (%d, %d)", gti.Address, + gti.LeftToLoad, gti.TopToLoad, gti.WidthToCreate, gti.HeightToCreate ); + } +#endif + + + gti.HeightToLoad = gti.HeightToCreate; + gti.WidthToLoad = gti.WidthToCreate; + + gti.pPhysicalAddress = ((uint8*)g_pRDRAMu32)+gti.Address; + gti.tileNo = -1; + TxtrCacheEntry *pEntry = gTextureManager.GetTexture(>i, false, true, false); + if( pEntry ) SetCurrentTexture( 0, pEntry->pTexture, pEntry->ti.WidthToCreate, pEntry->ti.HeightToCreate, pEntry); +} + +void CRender::LoadTextureFromMemory(void *buf, uint32 left, uint32 top, uint32 width, uint32 height, uint32 pitch, uint32 format) +{ + TxtrInfo gti; + gti.Format = g_CI.dwFormat; + gti.Size = g_CI.dwSize; + gti.Palette = 0; + gti.TLutFmt = TLUT_FMT_RGBA16; //RGBA16 + gti.PalAddress = 0; + gti.bSwapped = FALSE; + gti.Address = 0; + gti.LeftToLoad = 0; + gti.TopToLoad = 0; + gti.WidthToCreate = width; + gti.HeightToCreate = height; + + gti.Pitch = pitch; + + gti.HeightToLoad = height; + gti.WidthToLoad = width; + gti.pPhysicalAddress = (uint8*)buf; + + gti.tileNo = -1; + TxtrCacheEntry *pEntry = gTextureManager.GetTexture(>i, false); + //Upto here, the texture is loaded wrong because the format is wrong + + DrawInfo info; + if( pEntry->pTexture->StartUpdate(&info) ) + { + for( uint32 i=0; ipTexture->EndUpdate(&info); + } + SetCurrentTexture( 0, pEntry->pTexture, width, height, pEntry); +} + +void CRender::LoadObjBGCopy(uObjBg &info) +{ + TxtrInfo gti; + gti.Format = info.imageFmt; + gti.Size = info.imageSiz; + gti.Address = RSPSegmentAddr(info.imagePtr); + gti.LeftToLoad = 0; + gti.TopToLoad = 0; + gti.Palette = info.imagePal; + + gti.PalAddress = (uchar *) &g_wRDPTlut[0]; + gti.bSwapped = FALSE; + gti.TLutFmt = TLUT_FMT_RGBA16; //RGBA16 + + gti.WidthToCreate = info.imageW/4; + gti.HeightToCreate = info.imageH/4; + + if( options.bEnableHacks ) + { + if( g_CI.dwWidth == 0x200 && gti.Format == g_CI.dwFormat && gti.Size == g_CI.dwSize && + gti.WidthToCreate == 0x200 ) + { + // Hack for RE2 + uint32 w = *g_GraphicsInfo.VI_WIDTH_REG & 0xFFF; + gti.HeightToCreate = (gti.WidthToCreate*gti.HeightToCreate)/w; + gti.WidthToCreate = w; + } + } + + gti.Pitch = gti.WidthToCreate << gti.Size >> 1; + gti.Pitch = (gti.Pitch>>3)<<3; // Align to 8 bytes + + if( gti.Address + gti.Pitch*gti.HeightToCreate > g_dwRamSize ) + { + TRACE0("Skip BG copy loading, memory out of bound"); + return; + } + + gti.HeightToLoad = gti.HeightToCreate; + gti.WidthToLoad = gti.WidthToCreate; + gti.pPhysicalAddress = ((uint8*)g_pRDRAMu32)+gti.Address; + gti.tileNo = -1; + TxtrCacheEntry *pEntry = gTextureManager.GetTexture(>i, false); + SetCurrentTexture(0,pEntry); + + DEBUGGER_IF_DUMP((pauseAtNext && (eventToPause == NEXT_OBJ_TXT_CMD||eventToPause == NEXT_FLUSH_TRI||eventToPause == NEXT_OBJ_BG)), + { + TRACE0("Load Obj BG Copy:\n"); + DebuggerAppendMsg("Addr=0x%08X, W=%d, H=%d, Left=%d, Top=%d\n", + gti.Address, gti.WidthToCreate, gti.HeightToCreate, gti.LeftToLoad, gti.TopToLoad); + DebuggerAppendMsg("Fmt=%s-%db, Pal=%d\n", + pszImgFormat[gti.Format], pnImgSize[gti.Size], gti.Palette); + } + ); +} + +void CRender::LoadTxtrBufIntoTexture(void) +{ + TxtrInfo gti; + + gti.Format = g_pRenderTextureInfo->CI_Info.dwFormat; + gti.Size = g_pRenderTextureInfo->CI_Info.dwSize; + + gti.Address = RSPSegmentAddr(g_pRenderTextureInfo->CI_Info.dwAddr); + gti.LeftToLoad = 0; + gti.TopToLoad = 0; + gti.Palette = 0; + + gti.PalAddress = (uchar *) &g_wRDPTlut[0]; + gti.bSwapped = FALSE; + + gti.WidthToCreate = g_pRenderTextureInfo->N64Width; + gti.HeightToCreate = g_pRenderTextureInfo->N64Height; + gti.TLutFmt = TLUT_FMT_RGBA16; //RGBA16 + + gti.Pitch = gti.WidthToCreate << (gti.Size-1); + + gti.HeightToLoad = gti.HeightToCreate; + gti.WidthToLoad = gti.WidthToCreate; + gti.pPhysicalAddress = ((uint8*)g_pRDRAMu32)+gti.Address; + gti.tileNo = -1; + TxtrCacheEntry *pEntry = gTextureManager.GetTexture(>i, false); + SetCurrentTexture(0,pEntry); +} + +void CRender::LoadSprite2D(Sprite2DInfo &info, uint32 ucode) +{ + TxtrInfo gti; + + gti.Format = info.spritePtr->SourceImageType; + gti.Size = info.spritePtr->SourceImageBitSize; + + gti.Address = RSPSegmentAddr(info.spritePtr->SourceImagePointer); + gti.Palette = 0; + gti.PalAddress = (uchar *) (g_pRDRAMu8 + RSPSegmentAddr(info.spritePtr->TlutPointer)); + + if( options.enableHackForGames == HACK_FOR_NITRO ) + { + gti.WidthToCreate = (uint32)(info.spritePtr->SubImageWidth/info.scaleX); + gti.HeightToCreate = (uint32)(info.spritePtr->SubImageHeight/info.scaleY); + gti.LeftToLoad = (uint32)(info.spritePtr->SourceImageOffsetS/info.scaleX); + gti.TopToLoad = (uint32)(info.spritePtr->SourceImageOffsetT/info.scaleY); + gti.Pitch = info.spritePtr->Stride << gti.Size >> 1; + gti.Pitch = (uint32)(gti.Pitch*info.scaleY); + } + else + { + gti.WidthToCreate = info.spritePtr->SubImageWidth; + gti.HeightToCreate = info.spritePtr->SubImageHeight; + gti.LeftToLoad = info.spritePtr->SourceImageOffsetS; + gti.TopToLoad = info.spritePtr->SourceImageOffsetT; + gti.Pitch = info.spritePtr->Stride << gti.Size >> 1; + } + + if( gti.Address + gti.Pitch*gti.HeightToCreate > g_dwRamSize ) + { + TRACE0("Skip Sprite image decompress, memory out of bound"); + return; + } + + gti.HeightToLoad = gti.HeightToCreate; + gti.WidthToLoad = gti.WidthToCreate; + + gti.TLutFmt = TLUT_FMT_RGBA16; //RGBA16 + gti.bSwapped = FALSE; + + gti.pPhysicalAddress = ((uint8*)g_pRDRAMu32)+gti.Address; + gti.tileNo = -1; + TxtrCacheEntry *pEntry = gTextureManager.GetTexture(>i, false); + SetCurrentTexture(0,pEntry); + + DEBUGGER_IF_DUMP((pauseAtNext && (eventToPause == NEXT_OBJ_TXT_CMD||eventToPause == NEXT_FLUSH_TRI||eventToPause == NEXT_SPRITE_2D)), + { + TRACE0("Load Sprite 2D\n"); + DebuggerAppendMsg("Addr=0x%08X, W=%d, H=%d, Left=%d, Top=%d\n", + gti.Address, gti.WidthToCreate, gti.HeightToCreate, gti.LeftToLoad, gti.TopToLoad); + DebuggerAppendMsg("Fmt=%s-%db, Pal=%d, Pitch=%d\n", + pszImgFormat[gti.Format], pnImgSize[gti.Size], gti.Palette, gti.Pitch); + } + ); +} + + +void CRender::DrawSprite2D(Sprite2DInfo &info, uint32 ucode) +{ + if( !status.bCIBufferIsRendered ) g_pFrameBufferManager->ActiveTextureBuffer(); + + if( status.bHandleN64RenderTexture ) + { + g_pRenderTextureInfo->maxUsedHeight = g_pRenderTextureInfo->N64Height; + if( !status.bDirectWriteIntoRDRAM ) + { + status.bFrameBufferIsDrawn = true; + status.bFrameBufferDrawnByTriangles = true; + } + } + LoadSprite2D(info, ucode); + + info.scaleX = 1/info.scaleX; + info.scaleY = 1/info.scaleY; + + int x0, y0, x1, y1; + float t0, s0, t1, s1; + + if( info.flipX ) + { + //x0 = info.px*info.scaleX + info.spritePtr->SubImageWidth*info.scaleX; + //x1 = info.px*info.scaleX; + x0 = info.px + int(info.spritePtr->SubImageWidth*info.scaleX); + x1 = info.px; + } + else + { + //x0 = info.px*info.scaleX; + //x1 = info.px*info.scaleX + info.spritePtr->SubImageWidth*info.scaleX; + x0 = info.px; + x1 = info.px + int(info.spritePtr->SubImageWidth*info.scaleX); + } + + if( info.flipY ) + { + //y0 = info.py*info.scaleY + info.spritePtr->SubImageHeight*info.scaleY; + //y1 = info.py*info.scaleY; + y0 = info.py + int(info.spritePtr->SubImageHeight*info.scaleY); + y1 = info.py; + } + else + { + //y0 = info.py*info.scaleY; + //y1 = info.py*info.scaleY + info.spritePtr->SubImageHeight*info.scaleY; + y0 = info.py; + y1 = info.py + int(info.spritePtr->SubImageHeight*info.scaleY); + } + + t0 = s0 = 0; + if( options.enableHackForGames == HACK_FOR_NITRO ) + { + t1 = info.spritePtr->SubImageWidth*info.scaleX/g_textures[0].m_fTexWidth; + s1 = info.spritePtr->SubImageHeight*info.scaleY/g_textures[0].m_fTexHeight; + } + else + { + t1 = info.spritePtr->SubImageWidth/g_textures[0].m_fTexWidth; + s1 = info.spritePtr->SubImageHeight/g_textures[0].m_fTexHeight; + } + + //InitCombinerBlenderForSimpleTextureDraw(); + SetCombinerAndBlender(); + SetAddressUAllStages( 0, TEXTURE_UV_FLAG_CLAMP ); + SetAddressVAllStages( 0, TEXTURE_UV_FLAG_CLAMP ); + + COLOR speColor = PostProcessSpecularColor(); + COLOR difColor = PostProcessDiffuseColor(0xffffffff); + + float depth = ( gRDP.otherMode.depth_source == 1 ) ? gRDP.fPrimitiveDepth : 0; + DrawSimple2DTexture((float)x0, (float)y0, (float)x1, (float)y1, t0, s0, t1, s1, speColor, difColor, depth, 1.0f); +} + + +void CRender::DrawSpriteR(uObjTxSprite &sprite, bool initCombiner, uint32 tile, uint32 left, uint32 top, uint32 width, uint32 height) // With Rotation +{ + if( !status.bCIBufferIsRendered ) g_pFrameBufferManager->ActiveTextureBuffer(); + + if( status.bHandleN64RenderTexture ) + { + g_pRenderTextureInfo->maxUsedHeight = g_pRenderTextureInfo->N64Height; + if( !status.bDirectWriteIntoRDRAM ) + { + status.bFrameBufferIsDrawn = true; + status.bFrameBufferDrawnByTriangles = true; + } + } + SetCombinerAndBlender(); + + float scaleX = sprite.sprite.scaleW/1024.0f; + float scaleY = sprite.sprite.scaleH/1024.0f; + + if( width == 0 || height == 0 ) + { + width = g_textures[tile].m_dwTileWidth; + height = g_textures[tile].m_dwTileHeight; + } + + //RECT src = {left,top,width, height}; + float depth = 0.0; + if (gRDP.otherMode.depth_source==1) + depth = gRDP.fPrimitiveDepth; + + float x0 = sprite.sprite.objX/4.0f; + float y0 = sprite.sprite.objY/4.0f; + float x1 = sprite.sprite.imageW / 32.0f / scaleX + x0; + float y1 = sprite.sprite.imageH / 32.0f / scaleY + y0; + + if( sprite.sprite.imageFlags&1 ) { float temp = x0; x0 = x1; x1 = temp; } // flip X + if( sprite.sprite.imageFlags&0x10 ) { float temp = y0; y0 = y1; y1 = temp; } // flip Y + + g_texRectTVtx[0].x = (gObjMtxReal.A*x0 + gObjMtxReal.B*y0 + gObjMtxReal.X)*windowSetting.fMultX; + g_texRectTVtx[0].y = (gObjMtxReal.C*x0 + gObjMtxReal.D*y0 + gObjMtxReal.Y)*windowSetting.fMultY; + g_texRectTVtx[0].z = depth; + g_texRectTVtx[0].rhw = 1; + g_texRectTVtx[1].x = (gObjMtxReal.A*x1 + gObjMtxReal.B*y0 + gObjMtxReal.X)*windowSetting.fMultX; + g_texRectTVtx[1].y = (gObjMtxReal.C*x1 + gObjMtxReal.D*y0 + gObjMtxReal.Y)*windowSetting.fMultY; + g_texRectTVtx[1].z = depth; + g_texRectTVtx[1].rhw = 1; + g_texRectTVtx[2].x = (gObjMtxReal.A*x1 + gObjMtxReal.B*y1 + gObjMtxReal.X)*windowSetting.fMultX; + g_texRectTVtx[2].y = (gObjMtxReal.C*x1 + gObjMtxReal.D*y1 + gObjMtxReal.Y)*windowSetting.fMultY; + g_texRectTVtx[2].z = depth; + g_texRectTVtx[2].rhw = 1; + g_texRectTVtx[3].x = (gObjMtxReal.A*x0 + gObjMtxReal.B*y1 + gObjMtxReal.X)*windowSetting.fMultX; + g_texRectTVtx[3].y = (gObjMtxReal.C*x0 + gObjMtxReal.D*y1 + gObjMtxReal.Y)*windowSetting.fMultY; + g_texRectTVtx[3].z = depth; + g_texRectTVtx[3].rhw = 1; + + g_texRectTVtx[0].tcord[0].u = left/g_textures[tile].m_fTexWidth; + g_texRectTVtx[0].tcord[0].v = top/g_textures[tile].m_fTexHeight; + g_texRectTVtx[1].tcord[0].u = (left+width)/g_textures[tile].m_fTexWidth; + g_texRectTVtx[1].tcord[0].v = top/g_textures[tile].m_fTexHeight; + g_texRectTVtx[2].tcord[0].u = (left+width)/g_textures[tile].m_fTexWidth; + g_texRectTVtx[2].tcord[0].v = (top+height)/g_textures[tile].m_fTexHeight; + g_texRectTVtx[3].tcord[0].u = left/g_textures[tile].m_fTexWidth; + g_texRectTVtx[3].tcord[0].v = (top+height)/g_textures[tile].m_fTexHeight; + + //COLOR speColor = PostProcessSpecularColor(); + COLOR difColor = PostProcessDiffuseColor(0xffffffff); + + g_texRectTVtx[0].dcDiffuse = g_texRectTVtx[1].dcDiffuse + = g_texRectTVtx[2].dcDiffuse = g_texRectTVtx[3].dcDiffuse = difColor; + g_texRectTVtx[0].dcSpecular = g_texRectTVtx[1].dcSpecular + = g_texRectTVtx[2].dcSpecular = g_texRectTVtx[3].dcSpecular = difColor; + + DrawSpriteR_Render(); +} + +void CRender::DrawFrameBuffer(bool useVIreg, uint32 left, uint32 top, uint32 width, uint32 height) +{ + BeginRendering(); + + LoadFrameBuffer(useVIreg, left, top, width, height); + + m_pColorCombiner->InitCombinerBlenderForSimpleTextureDraw(0); + + ZBufferEnable(FALSE); + SetZUpdate(FALSE); + if( left == 0 ) + SetAlphaTestEnable(FALSE); + else + SetAlphaTestEnable(TRUE); // use Alpha Test for partial frame buffer draw, for Dr. Mario 64 + + m_pAlphaBlender->Disable(); + + CTexture *pTexture = g_textures[0].m_pCTexture; + if( pTexture ) + { + if( useVIreg ) + { + // Draw the whole frame buffer + DrawSimple2DTexture(0, 0, windowSetting.uViWidth, windowSetting.uViHeight, + 0, 0, 1/pTexture->m_fXScale, 1/pTexture->m_fYScale, 0xFFFFFFFF, 0xFFFFFFFF, 0, 1); + } + else + { + // Draw a small texture in frame buffer + DrawSimple2DTexture((float)left, (float)top, (float)(left+width), (float)(top+height), + 0, 0, 1/pTexture->m_fXScale, 1/pTexture->m_fYScale, 0xFFFFFFFF, 0xFFFFFFFF, 0, 1); + } + } + + TXTRBUF_OR_CI_DUMP(TRACE0("Draw Frame Buffer Img")); +#ifdef DEBUGGER + if( pauseAtNext && ( eventToPause == NEXT_FRAME || eventToPause == NEXT_FLUSH_TRI ) ) + { + TRACE0("Draw Frame Buffer Img"); + debuggerPause = true; + DebuggerPause(); + } +#endif + + EndRendering(); +} + +void CRender::DrawObjBGCopy(uObjBg &info) +{ + if( !status.bCIBufferIsRendered ) g_pFrameBufferManager->ActiveTextureBuffer(); + + if( status.bHandleN64RenderTexture ) + { + g_pRenderTextureInfo->maxUsedHeight = g_pRenderTextureInfo->N64Height; + if( !status.bDirectWriteIntoRDRAM ) + { + status.bFrameBufferIsDrawn = true; + status.bFrameBufferDrawnByTriangles = true; + } + } + SetCombinerAndBlender(); + + uint32 frameH = info.frameH; + uint32 frameW = info.frameW; + uint32 imageH = info.imageH; + uint32 imageW = info.imageW; + + if( options.bEnableHacks ) + { + if( g_CI.dwWidth == 0x200 && info.imageFmt == g_CI.dwFormat && info.imageSiz == g_CI.dwSize && + frameW == 0x800 ) + { + // Hack for RE2 + uint32 width = *g_GraphicsInfo.VI_WIDTH_REG & 0xFFF; + imageH = frameH = (frameW/4*frameH/4)/width*4; + imageW = frameW = width*4; + } + } + + float x0 = info.frameX / 4.0f; + float y0 = info.frameY / 4.0f; + float x1 = frameW / 4.0f + x0; + float y1 = frameH / 4.0f + y0; + + float s0 = info.imageX / 32.0f; + float t0 = info.imageY / 32.0f; + + float texwidth = imageW/4.0f; + float texheight = imageH/4.0f; + + float u0 = s0/g_textures[0].m_fTexWidth; + float v0 = t0/g_textures[0].m_fTexHeight; + float maxu = texwidth/g_textures[0].m_fTexWidth; + float maxv = texheight/g_textures[0].m_fTexHeight; + + float x2 = x0 + (texwidth-s0); + float y2 = y0 + (texheight-t0); + float u1 = (x1-x2)/g_textures[0].m_fTexWidth; + float v1 = (y1-y2)/g_textures[0].m_fTexHeight; + + float depth = (gRDP.otherMode.depth_source == 1 ? gRDP.fPrimitiveDepth : 0.0f); + + COLOR speColor = PostProcessSpecularColor(); + COLOR difColor = PostProcessDiffuseColor(0xffffffff); + + if( options.enableHackForGames == HACK_FOR_COMMANDCONQUER ) + { + float s1 = (x1-x0) + s0; + float t1 = (y1-y0) + t0; + DrawSimple2DTexture(x0, y0, x1, y1, u0, v0, + s1/g_textures[0].m_fTexWidth, t1/g_textures[0].m_fTexHeight, difColor, speColor, depth, 1); + } + else if( x2 >= x1 ) + { + float s1 = (x1-x0) + s0; + if( y2 >= y1 ) + { + float t1 = (y1-y0) + t0; + DrawSimple2DTexture(x0, y0, x1, y1, u0, v0, + s1/g_textures[0].m_fTexWidth, t1/g_textures[0].m_fTexHeight, difColor, speColor, depth, 1); + } + else + { + DrawSimple2DTexture(x0, y0, x1, y2, u0, v0, + s1/g_textures[0].m_fTexWidth, maxv, difColor, speColor, depth, 1); + DrawSimple2DTexture(x0, y2, x1, y1, u0, 0, + s1/g_textures[0].m_fTexWidth, v1, difColor, speColor, depth, 1); + } + } + else + { + if( y2 >= y1 ) + { + float t1 = (y1-y0) + t0; + DrawSimple2DTexture(x0, y0, x2, y1, u0, v0, + maxu, t1/g_textures[0].m_fTexHeight, difColor, speColor, depth, 1); + DrawSimple2DTexture(x2, y0, x1, y1, 0, v0, + u1, t1/g_textures[0].m_fTexHeight, difColor, speColor, depth, 1); + } + else + { + DrawSimple2DTexture(x0, y0, x2, y2, u0, v0, maxu, maxv, difColor, speColor, depth, 1); + DrawSimple2DTexture(x2, y0, x1, y2, 0, v0, u1, maxv, difColor, speColor, depth, 1); + DrawSimple2DTexture(x0, y2, x2, y1, u0, 0, maxu, v1, difColor, speColor, depth, 1); + DrawSimple2DTexture(x2, y2, x1, y1, 0, 0, u1, v1, difColor, speColor, depth, 1); + } + } + + DEBUGGER_PAUSE_AT_COND_AND_DUMP_COUNT_N( + (pauseAtNext&&(eventToPause==NEXT_OBJ_BG||eventToPause==NEXT_FLUSH_TRI||eventToPause==NEXT_OBJ_TXT_CMD)), + { + TRACE0("Pause ObjBG Copy"); + } + ); +} + +void CRender::DrawObjBG1CYC(uObjScaleBg &bg, bool scaled) //Without Ratation +{ + if( !status.bCIBufferIsRendered ) g_pFrameBufferManager->ActiveTextureBuffer(); + + if( g_curRomInfo.bDisableObjBG ) + return; + + if( status.bHandleN64RenderTexture ) + { + g_pRenderTextureInfo->maxUsedHeight = g_pRenderTextureInfo->N64Height; + if( !status.bDirectWriteIntoRDRAM ) + { + status.bFrameBufferIsDrawn = true; + status.bFrameBufferDrawnByTriangles = true; + } + } + + SetCombinerAndBlender(); + + float depth = (gRDP.otherMode.depth_source == 1 ? gRDP.fPrimitiveDepth : 0.0f); + + float x0 = bg.frameX / 4.0f; + float y0 = bg.frameY / 4.0f; + float x1 = bg.frameW / 4.0f + x0; + float y1 = bg.frameH / 4.0f + y0; + + float s0 = bg.imageX / 32.0f; + float t0 = bg.imageY / 32.0f; + + float scaleX = bg.scaleW/1024.0f; + float scaleY = bg.scaleH/1024.0f; + + float texwidth = bg.imageW/4.0f; + float texheight = bg.imageH/4.0f; + + float u0 = s0/g_textures[0].m_fTexWidth; + float v0 = t0/g_textures[0].m_fTexHeight; + float maxu = texwidth/g_textures[0].m_fTexWidth; + float maxv = texheight/g_textures[0].m_fTexHeight; + + float x2 = x0 + (texwidth-s0)/scaleX; + float y2 = y0 + (texheight-t0)/scaleY; + float u1 = (x1-x2)*scaleX/g_textures[0].m_fTexWidth; + float v1 = (y1-y2)*scaleY/g_textures[0].m_fTexHeight; + + COLOR speColor = PostProcessSpecularColor(); + COLOR difColor = PostProcessDiffuseColor(0xffffffff); + + SetAlphaTestEnable(FALSE); + + if( options.enableHackForGames != HACK_FOR_YOSHI ) + { + float s1 = (x1-x0)*scaleX + s0; + float t1 = (y1-y0)*scaleY + t0; + DrawSimple2DTexture(x0, y0, x1, y1, u0, v0, + s1/g_textures[0].m_fTexWidth, t1/g_textures[0].m_fTexHeight, difColor, speColor, depth, 1); + } + else if( x2 >= x1 ) + { + float s1 = (x1-x0)*scaleX + s0; + if( y2 >= y1 ) + { + float t1 = (y1-y0)*scaleY + t0; + DrawSimple2DTexture(x0, y0, x1, y1, u0, v0, + s1/g_textures[0].m_fTexWidth, t1/g_textures[0].m_fTexHeight, difColor, speColor, depth, 1); + } + else + { + DrawSimple2DTexture(x0, y0, x1, y2, u0, v0, + s1/g_textures[0].m_fTexWidth, maxv, difColor, speColor, depth, 1); + DrawSimple2DTexture(x0, y2, x1, y1, u0, 0, + s1/g_textures[0].m_fTexWidth, v1, difColor, speColor, depth, 1); + } + } + else + { + if( y2 >= y1 ) + { + float t1 = (y1-y0)*scaleY + t0; + DrawSimple2DTexture(x0, y0, x2, y1, u0, v0, + maxu, t1/g_textures[0].m_fTexHeight, difColor, speColor, depth, 1); + DrawSimple2DTexture(x2, y0, x1, y1, 0, v0, + u1, t1/g_textures[0].m_fTexHeight, difColor, speColor, depth, 1); + } + else + { + DrawSimple2DTexture(x0, y0, x2, y2, u0, v0, maxu, maxv, difColor, speColor, depth, 1); + DrawSimple2DTexture(x2, y0, x1, y2, 0, v0, u1, maxv, difColor, speColor, depth, 1); + DrawSimple2DTexture(x0, y2, x2, y1, u0, 0, maxu, v1, difColor, speColor, depth, 1); + DrawSimple2DTexture(x2, y2, x1, y1, 0, 0, u1, v1, difColor, speColor, depth, 1); + } + } + + DEBUGGER_PAUSE_AT_COND_AND_DUMP_COUNT_N( + (pauseAtNext&&(eventToPause==NEXT_OBJ_BG||eventToPause==NEXT_FLUSH_TRI||eventToPause==NEXT_OBJ_TXT_CMD)), + { + DebuggerAppendMsg("Pause BG 1CYC: (%.0f,%.0f - %.0f,%.0f), \ntex (%.2f,%.2f), scale (%.2f,%.2f)",x0,y0,x1,y1,s0,t0,scaleX,scaleY); + } + ); +} + + +void CRender::DrawSprite(uObjTxSprite &sprite, bool rectR) //Without Ratation +{ + if( !status.bCIBufferIsRendered ) g_pFrameBufferManager->ActiveTextureBuffer(); + + if( status.bHandleN64RenderTexture ) + { + g_pRenderTextureInfo->maxUsedHeight = g_pRenderTextureInfo->N64Height; + if( !status.bDirectWriteIntoRDRAM ) + { + status.bFrameBufferIsDrawn = true; + status.bFrameBufferDrawnByTriangles = true; + } + } + SetCombinerAndBlender(); + COLOR speColor = PostProcessSpecularColor(); + COLOR difColor = PostProcessDiffuseColor(0xffffffff); + + + float objX = sprite.sprite.objX/4.0f; + float objY = sprite.sprite.objY/4.0f; + float width = sprite.sprite.imageW / 32.0f; + float high = sprite.sprite.imageH / 32.0f; + float scaleW = sprite.sprite.scaleW/1024.0f; + float scaleH = sprite.sprite.scaleH/1024.0f; + + if( g_curRomInfo.bIncTexRectEdge ) + { + width++; + high++; + } + + float x0, y0, x1, y1; + if( rectR ) + { + // Upper-left coordinate + // ( X + objX / BaseScaleX, Y+objY/BaseScaleY ) + // Lower-right coordinate + // ( X + (objX + imageW / scaleW) / BaseScaleX - 1, Y + (objY + imageH / scaleH) / BaseScaleY - 1 ) + + x0 = gObjMtxReal.X + objX/gObjMtxReal.BaseScaleX; + y0 = gObjMtxReal.Y + objY/gObjMtxReal.BaseScaleY; + x1 = gObjMtxReal.X + (objX + width / scaleW) / gObjMtxReal.BaseScaleX; + y1 = gObjMtxReal.Y + (objY + high / scaleH) / gObjMtxReal.BaseScaleY; + } + else + { + // (objX, objY) - ( objX+imageW/scaleW-1, objY+imageH/scaleH-1) + x0 = objX; + y0 = objY; + x1 = objX + width / scaleW; + y1 = objY + high / scaleH; + + if( (sprite.sprite.imageFlags&1) ) // flipX + { + float temp = x0; + x0 = x1; + x1 = temp; + } + + if( (sprite.sprite.imageFlags&0x10) ) // flipY + { + float temp = y0; + y0 = y1; + y1 = temp; + } + } + + // save the current clamp type + GLint iClampS, iClampT; + glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, &iClampS); + OPENGL_CHECK_ERRORS; + glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, &iClampT); + OPENGL_CHECK_ERRORS; + // force clamp type to CLAMP_EDGE (experiments show sometimes this is set to hex 0x2901 - invalid value) + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + OPENGL_CHECK_ERRORS; + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + OPENGL_CHECK_ERRORS; + // draw the 2D sprite as 2 triangles + float depth = (gRDP.otherMode.depth_source == 1 ? gRDP.fPrimitiveDepth : 0.0f); + CTexture *pTexture = g_textures[0].m_pCTexture; + DrawSimple2DTexture(x0, y0, x1, y1, 0, 0, 1/pTexture->m_fXScale, 1/pTexture->m_fYScale, + difColor, speColor, depth, 1); + // return clamp type to original setting + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, iClampS); + OPENGL_CHECK_ERRORS; + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, iClampT); + OPENGL_CHECK_ERRORS; +} + + +void CRender::LoadObjBG1CYC(uObjScaleBg &bg) +{ + uint32 imageWidth = bg.imageW/4; + uint32 imageHeight = bg.imageH/4; + + TxtrInfo gti; + gti.Format = bg.imageFmt; + gti.Size = bg.imageSiz; + + //uint8* img = (uint8*)(g_pRDRAMu8+RSPSegmentAddr(bg.imagePtr)); + + uchar *palAddr = (uchar *) &g_wRDPTlut[0]; + gti.Address = RSPSegmentAddr(bg.imagePtr); + + gti.LeftToLoad = 0; + gti.TopToLoad = 0; + + gti.WidthToCreate = imageWidth; + gti.HeightToCreate = imageHeight; + + gti.clampS = gti.clampT = 1; + gti.maskS = gti.maskT = 0; + + gti.Palette = bg.imagePal; + gti.PalAddress = palAddr; + + gti.Pitch = imageWidth << gti.Size >> 1; + gti.Pitch = (gti.Pitch>>3)<<3; // Align to 8 bytes + + if( gti.Address + gti.Pitch*gti.HeightToCreate > g_dwRamSize ) + { + TRACE0("Skip BG 1CYC loading, memory out of bound"); + return; + } + + gti.TLutFmt = TLUT_FMT_RGBA16; //RGBA16 + gti.bSwapped = FALSE; + + gti.HeightToLoad = gti.HeightToCreate; + gti.WidthToLoad = gti.WidthToCreate; + gti.pPhysicalAddress = ((uint8*)g_pRDRAMu32)+gti.Address; + gti.tileNo = -1; + TxtrCacheEntry *pEntry = gTextureManager.GetTexture(>i, false,true,false); + SetCurrentTexture(0,pEntry); + + DEBUGGER_IF_DUMP((pauseAtNext && (eventToPause == NEXT_OBJ_TXT_CMD||eventToPause == NEXT_FLUSH_TRI||eventToPause == NEXT_OBJ_BG)), + { + TRACE0("Load Obj BG 1CYC:\n"); + DebuggerAppendMsg("Addr=0x%08X, W=%d, H=%d, Left=%d, Top=%d\n", + gti.Address, gti.WidthToCreate, gti.HeightToCreate, gti.LeftToLoad, gti.TopToLoad); + DebuggerAppendMsg("Fmt=%s-%db, Pal=%d\n", + pszImgFormat[gti.Format], pnImgSize[gti.Size], gti.Palette); + } + ); +} + +void CRender::LoadObjSprite(uObjTxSprite &sprite, bool useTIAddr) +{ + TxtrInfo gti; + gti.Format = sprite.sprite.imageFmt; + gti.Size = sprite.sprite.imageSiz; + + uchar *palAddr = (uchar *) &g_wRDPTlut[0]; + + gti.Address = RSPSegmentAddr(sprite.txtr.block.image); + gti.Address += sprite.sprite.imageAdrs<<3; + gti.LeftToLoad = 0; + gti.TopToLoad = 0; + gti.Palette = sprite.sprite.imagePal; + gti.PalAddress = palAddr; + + if( sprite.txtr.block.type == S2DEX_OBJLT_TXTRBLOCK ) + { + gti.WidthToCreate = sprite.sprite.imageW/32; + if( sprite.sprite.imageW >= 0x8000 ) + { + gti.WidthToCreate = (0x10000-sprite.sprite.imageW)/32; + } + gti.HeightToCreate = sprite.sprite.imageH/32; + if( sprite.sprite.imageH >= 0x8000 ) + { + gti.HeightToCreate = (0x10000-sprite.sprite.imageH)/32; + } + gti.Pitch = (2047/(sprite.txtr.block.tline-1)) << 3; + } + else if( sprite.txtr.block.type == S2DEX_OBJLT_TXTRTILE ) + { +//#define GS_PIX2TMEM(pix, siz) ((pix)>>(4-(siz))) +//#define GS_TT_TWIDTH(pix,siz) ((GS_PIX2TMEM((pix), (siz))<<2)-1) +//#define GS_TT_THEIGHT(pix,siz) (((pix)<<2)-1) + + gti.WidthToCreate = ((sprite.txtr.tile.twidth+1)>>2)<<(4-gti.Size); + gti.HeightToCreate = (sprite.txtr.tile.theight+1)>>2; + + if( gti.Size == TXT_SIZE_4b ) + { + gti.Pitch = gti.WidthToCreate >> 1; + } + else + //gti.Pitch = (sprite.txtr.tile.twidth+1) << 3; + gti.Pitch = gti.WidthToCreate << (gti.Size-1); + } + + if( gti.Address + gti.Pitch*gti.HeightToCreate > g_dwRamSize ) + { + TRACE0("Skip Obj sprite loading, memory out of bound"); + return; + } + + gti.TLutFmt = TLUT_FMT_RGBA16; //RGBA16 + gti.bSwapped = FALSE; + + gti.HeightToLoad = gti.HeightToCreate; + gti.WidthToLoad = gti.WidthToCreate; + gti.pPhysicalAddress = ((uint8*)g_pRDRAMu32)+gti.Address; + gti.tileNo = -1; + TxtrCacheEntry *pEntry = gTextureManager.GetTexture(>i, false); + SetCurrentTexture(0,pEntry); +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/RenderTexture.cpp b/libmupen64plus/mupen64plus-video-rice/src/RenderTexture.cpp new file mode 100644 index 0000000000..adaeca5963 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/RenderTexture.cpp @@ -0,0 +1,80 @@ +/* +Copyright (C) 2005 Rice1964 + +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. +*/ + +#include "osal_opengl.h" + +#include "Debugger.h" +#include "FrameBuffer.h" +#include "OGLTexture.h" + +// =========================================================================== +COGLRenderTexture::COGLRenderTexture(int width, int height, RenderTextureInfo* pInfo, TextureUsage usage) + : CRenderTexture(width, height, pInfo, usage), + m_pOGLTexture(NULL) +{ + if( usage == AS_BACK_BUFFER_SAVE ) + { + m_pTexture = m_pOGLTexture = new COGLTexture(width, height, usage); + if( !m_pTexture ) + { + TRACE0("Error to create OGL render_texture"); + SAFE_DELETE(m_pTexture); + } + } + + m_width = width; + m_height = height; + m_beingRendered = false; +} + +COGLRenderTexture::~COGLRenderTexture() +{ + if( m_beingRendered ) + { + g_pFrameBufferManager->CloseRenderTexture(false); + SetAsRenderTarget(false); + } + + ShutdownPBuffer(); + SAFE_DELETE(m_pTexture); + m_pOGLTexture = NULL; + m_beingRendered = false; +} + +bool COGLRenderTexture::InitPBuffer( void ) +{ + return true; +} + +void COGLRenderTexture::ShutdownPBuffer(void) +{ +} + +bool COGLRenderTexture::SetAsRenderTarget(bool enable) +{ + return true; +} + +void COGLRenderTexture::LoadTexture(TxtrCacheEntry* pEntry) +{ +} + +void COGLRenderTexture::StoreToRDRAM(int infoIdx) +{ +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/RenderTexture.h b/libmupen64plus/mupen64plus-video-rice/src/RenderTexture.h new file mode 100644 index 0000000000..34fa75e555 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/RenderTexture.h @@ -0,0 +1,125 @@ +/* +Copyright (C) 2002 Rice1964 + +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. + +*/ + +#ifndef _TEXTURE_BUFFER_H_ +#define _TEXTURE_BUFFER_H_ + +#include "typedefs.h" +#include "TextureManager.h" + +class CRenderTexture; +typedef struct { + CRenderTexture *pRenderTexture; + SetImgInfo CI_Info; + + uint32 bufferWidth; + uint32 bufferHeight; + uint32 N64Width; + uint32 N64Height; + float scaleX; + float scaleY; + + int maxUsedHeight; + uint32 updateAtFrame; + uint32 updateAtUcodeCount; + + bool isUsed; + uint32 knownHeight; + + uint32 crcInRDRAM; + uint32 crcCheckedAtFrame; + + TxtrCacheEntry txtEntry; +} RenderTextureInfo; + + +class CRenderTexture +{ +public: + friend class CGraphicsContext; + friend class CDXGraphicsContext; + friend class FrameBufferManager; + friend class DXFrameBufferManager; + friend class OGLFrameBufferManager; + CRenderTexture(int width, int height, RenderTextureInfo* pInfo, TextureUsage usage) + { + m_beingRendered = false; + m_width = m_height = 0; + m_pTexture = NULL; + m_pInfo = pInfo; + m_usage = usage; + } + virtual ~CRenderTexture() {} + + virtual bool SetAsRenderTarget(bool enable)=0; + virtual void LoadTexture(TxtrCacheEntry* pEntry)=0; + + virtual void StoreToRDRAM(int infoIdx) {}; + + void GetDimension(int &width, int &height) + { + width = m_width; + height = m_height; + } + + bool IsBeingRendered() + { + return m_beingRendered; + } + + TextureUsage GetUsage() {return m_usage;} + + +protected: + int m_width; + int m_height; + bool m_beingRendered; + TextureUsage m_usage; + + CTexture* m_pTexture; + RenderTextureInfo* m_pInfo; +}; + + +class COGLRenderTexture : public CRenderTexture +{ + // Haven't implemented yet +public: + COGLRenderTexture(int width, int height, RenderTextureInfo* pInfo, TextureUsage usage); + ~COGLRenderTexture(); + + bool SetAsRenderTarget(bool enable); + void LoadTexture(TxtrCacheEntry* pEntry); + void StoreToRDRAM(int infoIdx); + +protected: + bool InitPBuffer(void); + void ShutdownPBuffer(void); + + int m_widthCreated; + int m_heightCreated; + + + COGLTexture *m_pOGLTexture; +}; + +#endif + + + diff --git a/libmupen64plus/mupen64plus-video-rice/src/Texture.cpp b/libmupen64plus/mupen64plus-video-rice/src/Texture.cpp new file mode 100644 index 0000000000..9eb82f4a07 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/Texture.cpp @@ -0,0 +1,275 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + +#include "TextureManager.h" + + +////////////////////////////////////////// +// Constructors / Deconstructors + +// Probably shouldn't need more than 4096 * 4096 + +CTexture::CTexture(uint32 dwWidth, uint32 dwHeight, TextureUsage usage) : + m_dwWidth(dwWidth), + m_dwHeight(dwHeight), + m_dwCreatedTextureWidth(dwWidth), + m_dwCreatedTextureHeight(dwHeight), + m_fXScale(1.0f), + m_fYScale(1.0f), + m_bScaledS(false), + m_bScaledT(false), + m_bClampedS(false), + m_bClampedT(false), + m_bIsEnhancedTexture(false), + m_Usage(usage), + m_pTexture(NULL), + m_dwTextureFmt(TEXTURE_FMT_A8R8G8B8) +{ + // fix me, do something here +} + + +CTexture::~CTexture(void) +{ +} + +TextureFmt CTexture::GetSurfaceFormat(void) +{ + if (m_pTexture == NULL) + return TEXTURE_FMT_UNKNOWN; + else + return m_dwTextureFmt; +} + +uint32 CTexture::GetPixelSize() +{ + if( m_dwTextureFmt == TEXTURE_FMT_A8R8G8B8 ) + return 4; + else + return 2; +} + + +// There are reasons to create this function. D3D and OGL will only create surface of width and height +// as 2's pow, for example, N64's 20x14 image, D3D and OGL will create a 32x16 surface. +// When we using such a surface as D3D texture, and the U and V address is for the D3D and OGL surface +// width and height. It is still OK if the U and V addr value is less than the real image within +// the D3D surface. But we will have problems if the U and V addr value is larger than it, or even +// large then 1.0. +// In such a case, we need to scale the image to the D3D surface dimension, to ease the U/V addr +// limition +void CTexture::ScaleImageToSurface(bool scaleS, bool scaleT) +{ + uint8 g_ucTempBuffer[1024*1024*4]; + + if( scaleS==false && scaleT==false) return; + + // If the image is not scaled, call this function to scale the real image to + // the D3D given dimension + + uint32 width = scaleS ? m_dwWidth : m_dwCreatedTextureWidth; + uint32 height = scaleT ? m_dwHeight : m_dwCreatedTextureHeight; + + uint32 xDst, yDst; + uint32 xSrc, ySrc; + + DrawInfo di; + + if (!StartUpdate(&di)) + { + return; + } + + int pixSize = GetPixelSize(); + + // Copy across from the temp buffer to the surface + switch (pixSize) + { + case 4: + { + memcpy((uint8*)g_ucTempBuffer, (uint8*)(di.lpSurface), m_dwHeight*m_dwCreatedTextureWidth*4); + + uint32 * pDst; + uint32 * pSrc; + + for (yDst = 0; yDst < m_dwCreatedTextureHeight; yDst++) + { + // ySrc ranges from 0..m_dwHeight + // I'd rather do this but sometimes very narrow (i.e. 1 pixel) + // surfaces are created which results in /0... + //ySrc = (yDst * (m_dwHeight-1)) / (d3dTextureHeight-1); + ySrc = (uint32)((yDst * height) / m_dwCreatedTextureHeight+0.49f); + + pSrc = (uint32*)((uint8*)g_ucTempBuffer + (ySrc * m_dwCreatedTextureWidth * 4)); + pDst = (uint32*)((uint8*)di.lpSurface + (yDst * di.lPitch)); + + for (xDst = 0; xDst < m_dwCreatedTextureWidth; xDst++) + { + xSrc = (uint32)((xDst * width) / m_dwCreatedTextureWidth+0.49f); + pDst[xDst] = pSrc[xSrc]; + } + } + } + + break; + case 2: + { + memcpy((uint8*)g_ucTempBuffer, (uint8*)(di.lpSurface), m_dwHeight*m_dwCreatedTextureWidth*2); + + uint16 * pDst; + uint16 * pSrc; + + for (yDst = 0; yDst < m_dwCreatedTextureHeight; yDst++) + { + // ySrc ranges from 0..m_dwHeight + ySrc = (yDst * height) / m_dwCreatedTextureHeight; + + pSrc = (uint16*)((uint8*)g_ucTempBuffer + (ySrc * m_dwCreatedTextureWidth * 2)); + pDst = (uint16*)((uint8*)di.lpSurface + (yDst * di.lPitch)); + + for (xDst = 0; xDst < m_dwCreatedTextureWidth; xDst++) + { + xSrc = (xDst * width) / m_dwCreatedTextureWidth; + pDst[xDst] = pSrc[xSrc]; + } + } + } + break; + + } + + EndUpdate(&di); + + if( scaleS ) m_bScaledS = true; + if( scaleT ) m_bScaledT = true; +} + +void CTexture::ClampImageToSurfaceS() +{ + if( !m_bClampedS && m_dwWidth < m_dwCreatedTextureWidth ) + { + DrawInfo di; + if( StartUpdate(&di) ) + { + if( m_dwTextureFmt == TEXTURE_FMT_A8R8G8B8 ) + { + for( uint32 y = 0; y>16); + uint32 dwGreen = (uint8)((dw & 0x0000FF00)>>8 ); + uint32 dwBlue = (uint8)((dw & 0x000000FF) ); + uint32 dwAlpha = (dwRed+dwGreen+dwBlue)/3; + dw &= 0x00FFFFFF; + dw |= (dwAlpha<<24); + + /* + uint32 dw = dwSrc[x]; + if( (dw&0x00FFFFFF) > 0 ) + dw |= 0xFF000000; + else + dw &= 0x00FFFFFF; + */ + } + } + EndUpdate(&di); + } + else + { + //TRACE0("Cannot lock texture"); + } +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/Texture.h b/libmupen64plus/mupen64plus-video-rice/src/Texture.h new file mode 100644 index 0000000000..49df8c0c8b --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/Texture.h @@ -0,0 +1,104 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + + +#ifndef __SURFACEHANDLER_H__ +#define __SURFACEHANDLER_H__ + +#include "typedefs.h" + +/////////////// Define a struct to use as +/////////////// storage for all the surfaces +/////////////// created so far. +class CTexture; + +typedef struct { + unsigned short int dwWidth; // Describes the width of the real texture area. Use lPitch to move between successive lines + unsigned short int dwHeight; // Describes the height of the real texture area + unsigned short int dwCreatedWidth; // Describes the width of the created texture area. Use lPitch to move between successive lines + unsigned short int dwCreatedHeight; // Describes the height of the created texture area + int lPitch; // Specifies the number of bytes on each row (not necessarily bitdepth*width/8) + void *lpSurface; // Pointer to the top left pixel of the image +} DrawInfo; + + +enum TextureFmt { + TEXTURE_FMT_A8R8G8B8, + TEXTURE_FMT_A4R4G4B4, + TEXTURE_FMT_UNKNOWN, +}; + +enum TextureUsage { + AS_NORMAL, + AS_RENDER_TARGET, + AS_BACK_BUFFER_SAVE, +}; + +class CTexture +{ +public: + virtual ~CTexture(); + + uint32 m_dwWidth; // The requested Texture w/h + uint32 m_dwHeight; + + unsigned int m_dwCreatedTextureWidth; // What was actually created + unsigned int m_dwCreatedTextureHeight; + + float m_fXScale; // = m_dwCorrectedWidth/m_dwWidth + float m_fYScale; // = m_dwCorrectedHeight/m_dwWidth + + bool m_bScaledS; + bool m_bScaledT; + + bool m_bClampedS; + bool m_bClampedT; + + bool m_bIsEnhancedTexture; + + TextureUsage m_Usage; + + virtual void ScaleImageToSurface(bool scaleS=true, bool scaleT=true); + virtual void ClampImageToSurfaceS(); + virtual void ClampImageToSurfaceT(); + + virtual LPRICETEXTURE GetTexture() { return m_pTexture; } + + uint32 GetPixelSize(); + TextureFmt GetSurfaceFormat(void); // Surface pixel format... + inline void SetOthersVariables(void) + { + m_bClampedS = m_bScaledS = (m_dwWidth == m_dwCreatedTextureWidth); + m_bClampedT = m_bScaledT = (m_dwHeight == m_dwCreatedTextureHeight); + } + + // Provides access to "surface" + virtual bool StartUpdate(DrawInfo *di)=0; + virtual void EndUpdate(DrawInfo *di)=0; + + virtual void RestoreAlphaChannel(void); // Restore Alpha channel from RGB channel + +protected: + CTexture(uint32 dwWidth, uint32 dwHeight, TextureUsage usage = AS_NORMAL); + LPRICETEXTURE m_pTexture; + TextureFmt m_dwTextureFmt; +}; + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/TextureFilters.cpp b/libmupen64plus/mupen64plus-video-rice/src/TextureFilters.cpp new file mode 100644 index 0000000000..a6cbc13687 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/TextureFilters.cpp @@ -0,0 +1,2233 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + +#include "osal_files.h" + +#define M64P_PLUGIN_PROTOTYPES 1 +#include "m64p_plugin.h" +#include "typedefs.h" +#include "ConvertImage.h" +#include "DeviceBuilder.h" +#include "TextureFilters.h" +#include "Render.h" +#include "Video.h" + +#include "liblinux/BMGLibPNG.h" +#include "liblinux/BMGDLL.h" +#include +#include + +#ifdef min +#undef min +#endif + +/************************************************************************/ +/* 2X filters */ +/************************************************************************/ +// Basic 2x R8G8B8A8 filter with interpolation + +void Texture2x_32( DrawInfo &srcInfo, DrawInfo &destInfo) +{ + uint32 *pDst1, *pDst2; + uint32 *pSrc, *pSrc2; + uint32 nWidth = srcInfo.dwWidth; + uint32 nHeight = srcInfo.dwHeight; + + uint32 b1; + uint32 g1; + uint32 r1; + uint32 a1; + uint32 b2 = 0; + uint32 g2 = 0; + uint32 r2 = 0; + uint32 a2 = 0; + uint32 b3 = 0; + uint32 g3 = 0; + uint32 r3 = 0; + uint32 a3 = 0; + uint32 b4 = 0; + uint32 g4 = 0; + uint32 r4 = 0; + uint32 a4 = 0; + + + for (uint32 ySrc = 0; ySrc < nHeight; ySrc++) + { + pSrc = (uint32*)(((uint8*)srcInfo.lpSurface)+ySrc*srcInfo.lPitch); + pSrc2 = (uint32*)(((uint8*)srcInfo.lpSurface)+(ySrc+1)*srcInfo.lPitch); + pDst1 = (uint32*)(((uint8*)destInfo.lpSurface)+(ySrc*2)*destInfo.lPitch); + pDst2 = (uint32*)(((uint8*)destInfo.lpSurface)+(ySrc*2+1)*destInfo.lPitch); + + for (uint32 xSrc = 0; xSrc < nWidth; xSrc++) + { + b1 = (pSrc[xSrc]>>0)&0xFF; + g1 = (pSrc[xSrc]>>8)&0xFF; + r1 = (pSrc[xSrc]>>16)&0xFF; + a1 = (pSrc[xSrc]>>24)&0xFF; + + if( xSrc>0)&0xFF; + g2 = (pSrc[xSrc+1]>>8)&0xFF; + r2 = (pSrc[xSrc+1]>>16)&0xFF; + a2 = (pSrc[xSrc+1]>>24)&0xFF; + } + + if( ySrc>0)&0xFF; + g3 = (pSrc2[xSrc]>>8)&0xFF; + r3 = (pSrc2[xSrc]>>16)&0xFF; + a3 = (pSrc2[xSrc]>>24)&0xFF; + if( xSrc>0)&0xFF; + g4 = (pSrc2[xSrc+1]>>8)&0xFF; + r4 = (pSrc2[xSrc+1]>>16)&0xFF; + a4 = (pSrc2[xSrc+1]>>24)&0xFF; + } + } + + + // Pixel 1 + pDst1[xSrc*2] = pSrc[xSrc]; + + // Pixel 2 + if( xSrc> 0)&0xF; + g1 = (pSrc[xSrc]>> 4)&0xF; + r1 = (pSrc[xSrc]>> 8)&0xF; + a1 = (pSrc[xSrc]>>12)&0xF; + + if( xSrc> 0)&0xF; + g2 = (pSrc[xSrc+1]>> 4)&0xF; + r2 = (pSrc[xSrc+1]>> 8)&0xF; + a2 = (pSrc[xSrc+1]>>12)&0xF; + } + + if( ySrc> 0)&0xF; + g3 = (pSrc2[xSrc]>> 4)&0xF; + r3 = (pSrc2[xSrc]>> 8)&0xF; + a3 = (pSrc2[xSrc]>>12)&0xF; + if( xSrc> 0)&0xF; + g4 = (pSrc2[xSrc+1]>> 4)&0xF; + r4 = (pSrc2[xSrc+1]>> 8)&0xF; + a4 = (pSrc2[xSrc+1]>>12)&0xF; + } + } + + // Pixel 1 + pDst1[xSrc*2] = pSrc[xSrc]; + + // Pixel 2 + if( xSrc (t1+t3+t7+t9+t2+t4+t6+t8)*mul1 ) + { + val[z]= std::min((((t5*mul3) - (t1+t3+t7+t9+t2+t4+t6+t8)*mul1)>>shift4),0xFFU); + } + } + dest[x] = val[0]|(val[1]<<8)|(val[2]<<16)|(val[3]<<24); + } + } + delete [] pcopy; +} + +void SharpenFilter_16(uint16 *pdata, uint32 width, uint32 height, uint32 pitch, uint32 filter) +{ + //return; // Sharpen does not make sense for 16 bits + + uint32 len=height*pitch; + uint16 *pcopy = new uint16[len]; + + if( !pcopy ) return; + + memcpy(pcopy, pdata, len<<1); + + uint16 mul1, mul2, mul3, shift4; + switch( filter ) + { + case TEXTURE_SHARPEN_MORE_ENHANCEMENT: + mul1=1; + mul2=8; + mul3=12; + shift4=2; + break; + case TEXTURE_SHARPEN_ENHANCEMENT: + default: + mul1=1; + mul2=8; + mul3=16; + shift4=3; + break; + } + + uint32 x,y,z; + uint16 *src1, *src2, *src3, *dest; + uint16 val[4]; + uint16 t1,t2,t3,t4,t5,t6,t7,t8,t9; + + for( y=1; y>1)))>>shift; + t2 = (*((uint8*)(src1+x )+(z>>1)))>>shift; + t3 = (*((uint8*)(src1+x+1)+(z>>1)))>>shift; + t4 = (*((uint8*)(src2+x-1)+(z>>1)))>>shift; + t5 = (*((uint8*)(src2+x )+(z>>1)))>>shift; + t6 = (*((uint8*)(src2+x+1)+(z>>1)))>>shift; + t7 = (*((uint8*)(src3+x-1)+(z>>1)))>>shift; + t8 = (*((uint8*)(src3+x )+(z>>1)))>>shift; + t9 = (*((uint8*)(src3+x+1)+(z>>1)))>>shift; + val[z]=t5; + if( (t5*mul2) > (t1+t3+t7+t9+t2+t4+t6+t8)*mul1 ) + { + val[z] = (((t5*mul3) - (t1+t3+t7+t9+t2+t4+t6+t8)*mul1)>>shift4); + val[z]= std::min(val[z],(unsigned short)0xFU); + } + } + dest[x] = val[0]|(val[1]<<4)|(val[2]<<8)|(val[3]<<12); + } + } + delete [] pcopy; +} + +/************************************************************************/ +/* Smooth filters */ +/************************************************************************/ +void SmoothFilter_32(uint32 *pdata, uint32 width, uint32 height, uint32 pitch, uint32 filter) +{ + uint32 len=height*pitch; + uint32 *pcopy = new uint32[len]; + + if( !pcopy ) return; + + memcpy(pcopy, pdata, len<<2); + + uint32 mul1, mul2, mul3, shift4; + switch( filter ) + { + case TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_1: + mul1=1; + mul2=2; + mul3=4; + shift4=4; + break; + case TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_2: + mul1=1; + mul2=1; + mul3=8; + shift4=4; + break; + case TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_3: + mul1=1; + mul2=1; + mul3=2; + shift4=2; + break; + case TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_4: + default: + mul1=1; + mul2=1; + mul3=6; + shift4=3; + break; + } + + uint32 x,y,z; + uint32 *src1, *src2, *src3, *dest; + uint32 val[4]; + uint32 t1,t2,t3,t4,t5,t6,t7,t8,t9; + + if( filter == TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_3 || filter == TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_4 ) + { + for( y=1; y>shift4; + } + dest[x] = val[0]|(val[1]<<8)|(val[2]<<16)|(val[3]<<24); + } + } + } + else + { + for( y=0; y0 ) + { + src1 = pcopy+(y-1)*pitch; + src2 = src1 + pitch; + } + else + { + src1 = src2 = pcopy; + } + + src3 = src2; + if( y>shift4; + } + dest[x] = val[0]|(val[1]<<8)|(val[2]<<16)|(val[3]<<24); + } + } + } + delete [] pcopy; +} + +void SmoothFilter_16(uint16 *pdata, uint32 width, uint32 height, uint32 pitch, uint32 filter) +{ + uint32 len=height*pitch; + uint16 *pcopy = new uint16[len]; + + if( !pcopy ) + return; + + memcpy(pcopy, pdata, len<<1); + + uint16 mul1, mul2, mul3, shift4; + switch( filter ) + { + case TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_1: + mul1=1; + mul2=2; + mul3=4; + shift4=4; + break; + case TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_2: + mul1=1; + mul2=1; + mul3=8; + shift4=4; + break; + case TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_3: + mul1=1; + mul2=1; + mul3=2; + shift4=2; + break; + case TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_4: + default: + mul1=1; + mul2=1; + mul3=6; + shift4=3; + break; + } + + uint32 x,y,z; + uint16 *src1, *src2, *src3, *dest; + uint16 val[4]; + uint16 t1,t2,t3,t4,t5,t6,t7,t8,t9; + + if( filter == TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_3 || filter == TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_4 ) + { + for( y=1; y>1)))>>shift; + t5 = (*((uint8*)(src2+x )+(z>>1)))>>shift; + t8 = (*((uint8*)(src3+x )+(z>>1)))>>shift; + val[z] = ((t2+t8)*mul2+(t5*mul3))>>shift4; + } + dest[x] = val[0]|(val[1]<<4)|(val[2]<<8)|(val[3]<<12); + } + } + } + else + { + for( y=0; y0 ) + { + src1 = pcopy+(y-1)*pitch; + src2 = src1 + pitch; + } + else + { + src1 = src2 = pcopy; + } + + src3 = src2; + if( y>1)))>>shift; + t2 = (*((uint8*)(src1+x )+(z>>1)))>>shift; + t3 = (*((uint8*)(src1+x+1)+(z>>1)))>>shift; + t4 = (*((uint8*)(src2+x-1)+(z>>1)))>>shift; + t5 = (*((uint8*)(src2+x )+(z>>1)))>>shift; + t6 = (*((uint8*)(src2+x+1)+(z>>1)))>>shift; + t7 = (*((uint8*)(src3+x-1)+(z>>1)))>>shift; + t8 = (*((uint8*)(src3+x )+(z>>1)))>>shift; + t9 = (*((uint8*)(src3+x+1)+(z>>1)))>>shift; + val[z] = ((t1+t3+t7+t9)*mul1+((t2+t4+t6+t8)*mul2)+(t5*mul3))>>shift4; + } + dest[x] = val[0]|(val[1]<<4)|(val[2]<<8)|(val[3]<<12); + } + } + } + delete [] pcopy; +} + + +void EnhanceTexture(TxtrCacheEntry *pEntry) +{ + if( pEntry->dwEnhancementFlag == options.textureEnhancement ) + { + // The texture has already been enhanced + return; + } + else if( options.textureEnhancement == TEXTURE_NO_ENHANCEMENT ) + { + //Texture enhancement has being turned off + //Delete any allocated memory for the enhanced texture + SAFE_DELETE(pEntry->pEnhancedTexture); + //Set the enhancement flag so the texture wont be processed again + pEntry->dwEnhancementFlag = TEXTURE_NO_ENHANCEMENT; + return; + } + + if( status.primitiveType != PRIM_TEXTRECT && options.bTexRectOnly ) + { + return; + } + + DrawInfo srcInfo; + //Start the draw update + if( pEntry->pTexture->StartUpdate(&srcInfo) == false ) + { + //If we get here we were unable to start the draw update + //Delete any allocated memory for the enhanced texture + SAFE_DELETE(pEntry->pEnhancedTexture); + return; + } + + uint32 realwidth = srcInfo.dwWidth; + uint32 realheight = srcInfo.dwHeight; + uint32 nWidth = srcInfo.dwCreatedWidth; + uint32 nHeight = srcInfo.dwCreatedHeight; + + //Sharpen option is enabled, sharpen the texture + if( options.textureEnhancement == TEXTURE_SHARPEN_ENHANCEMENT || options.textureEnhancement == TEXTURE_SHARPEN_MORE_ENHANCEMENT ) + { + if( pEntry->pTexture->GetPixelSize() == 4 ) + SharpenFilter_32((uint32*)srcInfo.lpSurface, nWidth, nHeight, nWidth, options.textureEnhancement); + else + SharpenFilter_16((uint16*)srcInfo.lpSurface, nWidth, nHeight, nWidth, options.textureEnhancement); + pEntry->dwEnhancementFlag = options.textureEnhancement; + //End the draw update + pEntry->pTexture->EndUpdate(&srcInfo); + //Delete any allocated memory for the enhanced texture + SAFE_DELETE(pEntry->pEnhancedTexture); + return; + } + + pEntry->dwEnhancementFlag = options.textureEnhancement; + if( options.bSmallTextureOnly ) + { + if( nWidth + nHeight > 256 ) + { + //End the draw update + pEntry->pTexture->EndUpdate(&srcInfo); + //Delete any data allocated for the enhanced texture + SAFE_DELETE(pEntry->pEnhancedTexture); + //Set the enhancement flag so the texture wont be processed again + pEntry->dwEnhancementFlag = TEXTURE_NO_ENHANCEMENT; + return; + } + } + + + CTexture* pSurfaceHandler = NULL; + if( options.textureEnhancement == TEXTURE_HQ4X_ENHANCEMENT ) + { + if( nWidth + nHeight > 1024/4 ) + { + // Don't enhance for large textures + pEntry->pTexture->EndUpdate(&srcInfo); + SAFE_DELETE(pEntry->pEnhancedTexture); + pEntry->dwEnhancementFlag = TEXTURE_NO_ENHANCEMENT; + return; + } + pSurfaceHandler = CDeviceBuilder::GetBuilder()->CreateTexture(nWidth*4, nHeight*4); + } + else + { + if( nWidth + nHeight > 1024/2 ) + { + // Don't enhance for large textures + pEntry->pTexture->EndUpdate(&srcInfo); + SAFE_DELETE(pEntry->pEnhancedTexture); + pEntry->dwEnhancementFlag = TEXTURE_NO_ENHANCEMENT; + return; + } + pSurfaceHandler = CDeviceBuilder::GetBuilder()->CreateTexture(nWidth*2, nHeight*2); + } + DrawInfo destInfo; + if(pSurfaceHandler) + { + if(pSurfaceHandler->StartUpdate(&destInfo)) + { + if( options.textureEnhancement == TEXTURE_2XSAI_ENHANCEMENT ) + { + if( pEntry->pTexture->GetPixelSize() == 4 ) + Super2xSaI_32((uint32*)(srcInfo.lpSurface),(uint32*)(destInfo.lpSurface), nWidth, realheight, nWidth); + else + Super2xSaI_16((uint16*)(srcInfo.lpSurface),(uint16*)(destInfo.lpSurface), nWidth, realheight, nWidth); + } + else if( options.textureEnhancement == TEXTURE_HQ2X_ENHANCEMENT ) + { + if( pEntry->pTexture->GetPixelSize() == 4 ) + { + hq2x_init(32); + hq2x_32((uint8*)(srcInfo.lpSurface), srcInfo.lPitch, (uint8*)(destInfo.lpSurface), destInfo.lPitch, nWidth, realheight); + } + else + { + hq2x_init(16); + hq2x_16((uint8*)(srcInfo.lpSurface), srcInfo.lPitch, (uint8*)(destInfo.lpSurface), destInfo.lPitch, nWidth, realheight); + } + } + else if( options.textureEnhancement == TEXTURE_LQ2X_ENHANCEMENT ) + { + if( pEntry->pTexture->GetPixelSize() == 4 ) + { + hq2x_init(32); + lq2x_32((uint8*)(srcInfo.lpSurface), srcInfo.lPitch, (uint8*)(destInfo.lpSurface), destInfo.lPitch, nWidth, realheight); + } + else + { + hq2x_init(16); + lq2x_16((uint8*)(srcInfo.lpSurface), srcInfo.lPitch, (uint8*)(destInfo.lpSurface), destInfo.lPitch, nWidth, realheight); + } + } + else if( options.textureEnhancement == TEXTURE_HQ4X_ENHANCEMENT ) + { + if( pEntry->pTexture->GetPixelSize() == 4 ) + { + hq4x_InitLUTs(); + hq4x_32((uint8*)(srcInfo.lpSurface), (uint8*)(destInfo.lpSurface), realwidth, realheight, nWidth, destInfo.lPitch); + } + else + { + hq4x_InitLUTs(); + hq4x_16((uint8*)(srcInfo.lpSurface), (uint8*)(destInfo.lpSurface), realwidth, realheight, nWidth, destInfo.lPitch); + } + } + else + { + if( pEntry->pTexture->GetPixelSize() == 4 ) + Texture2x_32( srcInfo, destInfo); + else + Texture2x_16( srcInfo, destInfo); + } + + if( options.textureEnhancementControl >= TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_1 ) + { + if( options.textureEnhancement != TEXTURE_HQ4X_ENHANCEMENT ) + { + if( pEntry->pTexture->GetPixelSize() == 4 ) + SmoothFilter_32((uint32*)destInfo.lpSurface, realwidth<<1, realheight<<1, nWidth<<1, options.textureEnhancementControl); + else + SmoothFilter_16((uint16*)destInfo.lpSurface, realwidth<<1, realheight<<1, nWidth<<1, options.textureEnhancementControl); + } + else + { + if( pEntry->pTexture->GetPixelSize() == 4 ) + SmoothFilter_32((uint32*)destInfo.lpSurface, realwidth<<2, realheight<<2, nWidth<<2, options.textureEnhancementControl); + else + SmoothFilter_16((uint16*)destInfo.lpSurface, realwidth<<2, realheight<<2, nWidth<<2, options.textureEnhancementControl); + } + } + + pSurfaceHandler->EndUpdate(&destInfo); + } + + pSurfaceHandler->SetOthersVariables(); + pSurfaceHandler->m_bIsEnhancedTexture = true; + } + + pEntry->pTexture->EndUpdate(&srcInfo); + + pEntry->pEnhancedTexture = pSurfaceHandler; +} + + +/************************************************************************/ +/* */ +/************************************************************************/ +void MirrorEmulator_DrawLine(DrawInfo& destInfo, DrawInfo& srcInfo, uint32 *pSource, uint32 *pDest, uint32 nWidth, BOOL bFlipLeftRight) +{ + if(!bFlipLeftRight) + { + memcpy(pDest, pSource, nWidth * 4); + } + else + { + uint32 *pMaxDest = pDest + nWidth; + pSource += nWidth - 1; + for(; pDest < pMaxDest; pDest++, pSource--) + { + *pDest = *pSource; + } + } +} + + +void MirrorEmulator_Draw(DrawInfo& destInfo, DrawInfo& srcInfo, uint32 nDestX, uint32 nDestY, BOOL bFlipLeftRight, BOOL bFlipUpDown) +{ + uint8 *pDest = (uint8 *) destInfo.lpSurface + (destInfo.lPitch * nDestY) + (4 * nDestX); + uint8 *pMaxDest = pDest + (destInfo.lPitch * srcInfo.dwHeight); + uint8 *pSource = (uint8 *)(srcInfo.lpSurface); + if(!bFlipUpDown) + { + for(; pDest < pMaxDest; pDest += destInfo.lPitch, pSource += srcInfo.lPitch) + { + MirrorEmulator_DrawLine(destInfo, srcInfo, (uint32*)pSource, (uint32*)pDest, srcInfo.dwWidth, bFlipLeftRight); + } + } + else + { + pSource += (srcInfo.lPitch * (srcInfo.dwHeight - 1)); + for(; pDest < pMaxDest; pDest += destInfo.lPitch, pSource -= srcInfo.lPitch) + { + MirrorEmulator_DrawLine(destInfo, srcInfo, (uint32*)pSource, (uint32*)pDest, srcInfo.dwWidth, bFlipLeftRight); + } + } +} + +void MirrorTexture(uint32 dwTile, TxtrCacheEntry *pEntry) +{ + if( ((gRDP.tiles[dwTile].bMirrorS) || (gRDP.tiles[dwTile].bMirrorT)) && CGraphicsContext::Get()->m_supportTextureMirror == false ) + { + if(pEntry->pEnhancedTexture) + { + return; + } + else + { + CTexture* pSurfaceHandler = NULL; + + // FIXME: Compute the correct values. 2/2 seems to always work correctly in Mario64 + uint32 nXTimes = gRDP.tiles[dwTile].bMirrorS ? 2 : 1; + uint32 nYTimes = gRDP.tiles[dwTile].bMirrorT ? 2 : 1; + + // For any texture need to use mirror, we should not need to rescale it + // because texture need to be mirrored must with MaskS and MaskT + + // But again, check me + + //if( pEntry->pTexture->m_bScaledS == false || pEntry->pTexture->m_bScaledT == false) + //{ + // pEntry->pTexture->ScaleImageToSurface(); + //} + + DrawInfo srcInfo; + if( pEntry->pTexture->StartUpdate(&srcInfo) ) + { + uint32 nWidth = srcInfo.dwWidth; + uint32 nHeight = srcInfo.dwHeight; + + pSurfaceHandler = CDeviceBuilder::GetBuilder()->CreateTexture(nWidth * nXTimes, nHeight * nYTimes); + if( pSurfaceHandler ) + { + DrawInfo destInfo; + if( pSurfaceHandler->StartUpdate(&destInfo) ) + { + for(uint32 nY = 0; nY < nYTimes; nY++) + { + for(uint32 nX = 0; nX < nXTimes; nX++) + { + MirrorEmulator_Draw(destInfo, srcInfo, nWidth * nX, nHeight * nY, nX & 0x1, nY & 0x1); + } + } + + pSurfaceHandler->EndUpdate(&destInfo); + } + + // FIXME: There should be a flag to tell that it is a mirrored texture handler + // not the original texture handlers, so all texture coordinate should be divided by 2 + pSurfaceHandler->SetOthersVariables(); + } + + pEntry->pTexture->EndUpdate(&srcInfo); + pEntry->dwEnhancementFlag = TEXTURE_MIRRORED; + } + + + pEntry->pEnhancedTexture = pSurfaceHandler; + } + } +} +/**** + All code bellow, CLEAN ME +****/ + +enum TextureType +{ + NO_TEXTURE, + RGB_PNG, + COLOR_INDEXED_BMP, + RGB_WITH_ALPHA_TOGETHER_PNG, + RGBA_PNG_FOR_CI, + RGBA_PNG_FOR_ALL_CI, +}; +typedef struct { + unsigned int width; + unsigned int height; + int fmt; + int siz; + int crc32; + int pal_crc32; + char *foldername; + char *filename; + char *filename_a; + //char name[40]; + TextureType type; + bool bSeparatedAlpha; +} ExtTxtrInfo; + +CSortedList gTxtrDumpInfos; +CSortedList gHiresTxtrInfos; + +extern char * right(const char * src, int nchars); + +#define SURFFMT_P8 41 + +int GetImageInfoFromFile(char* pSrcFile, IMAGE_INFO *pSrcInfo) +{ + unsigned char sig[8]; + FILE *f; + + f = fopen(pSrcFile, "rb"); + if (f == NULL) + { + DebugMessage(M64MSG_ERROR, "GetImageInfoFromFile() error: couldn't open file '%s'", pSrcFile); + return 1; + } + if (fread(sig, 1, 8, f) != 8) + { + DebugMessage(M64MSG_ERROR, "GetImageInfoFromFile() error: couldn't read first 8 bytes of file '%s'", pSrcFile); + fclose(f); + return 1; + } + fclose(f); + + if(sig[0] == 'B' && sig[1] == 'M') // BMP + { + struct BMGImageStruct img; + memset(&img, 0, sizeof(BMGImageStruct)); + BMG_Error code = ReadBMP(pSrcFile, &img); + if( code == BMG_OK ) + { + pSrcInfo->Width = img.width; + pSrcInfo->Height = img.height; + pSrcInfo->Depth = img.bits_per_pixel; + pSrcInfo->MipLevels = 1; + if(img.bits_per_pixel == 32) + pSrcInfo->Format = SURFFMT_A8R8G8B8; + else if(img.bits_per_pixel == 8) + pSrcInfo->Format = SURFFMT_P8; + // Resource and File Format ignored + FreeBMGImage(&img); + return 0; + } + DebugMessage(M64MSG_ERROR, "Couldn't read BMP file '%s'; error = %i", pSrcFile, code); + return 1; + } + else if(sig[0] == 137 && sig[1] == 'P' && sig[2] == 'N' && sig[3] == 'G' && sig[4] == '\r' && sig[5] == '\n' && + sig[6] == 26 && sig[7] == '\n') // PNG + { + struct BMGImageStruct img; + memset(&img, 0, sizeof(BMGImageStruct)); + BMG_Error code = ReadPNGInfo(pSrcFile, &img); + if( code == BMG_OK ) + { + pSrcInfo->Width = img.width; + pSrcInfo->Height = img.height; + pSrcInfo->Depth = img.bits_per_pixel; + pSrcInfo->MipLevels = 1; + if(img.bits_per_pixel == 32) + pSrcInfo->Format = SURFFMT_A8R8G8B8; + else if(img.bits_per_pixel == 8) + pSrcInfo->Format = SURFFMT_P8; + // Resource and File Format ignored + FreeBMGImage(&img); + return 0; + } + DebugMessage(M64MSG_ERROR, "Couldn't read PNG file '%s'; error = %i", pSrcFile, code); + return 1; + } + + DebugMessage(M64MSG_ERROR, "GetImageInfoFromFile : unknown file format (%s)", pSrcFile); + return 1; +} + +BOOL PathFileExists(char* pszPath) +{ + FILE *f; + f = fopen(pszPath, "rb"); + if(f != NULL) + { + fclose(f); + return TRUE; + } + return FALSE; +} + +/******************************************************************************************************************** + * Truncates the current list with information about hires textures and scans the hires folder for hires textures and + * creates a list with records of properties of the hires textures. + * parameter: + * foldername: the folder that should be scaned for valid hires textures. + * infos: a pointer that will point to the list containing the records with the infos about the found hires textures. + * In case of enabled caching, these records will also contain the actual textures. + * extraCheck: ? + * bRecursive: flag that indicates if also subfolders should be scanned for hires textures + * bCacheTextures: flag that indicates if the identified hires textures should also be cached + * bMainFolder: indicates if the folder is the main folder that will be scanned. That way, texture counting does not + * start at 1 each time a subfolder is accessed. (microdev: I know that is not important but it really + * bugged me ;-)) + * return: + * infos: the list with the records of the identified hires textures. Be aware that these records also contains the + * actual textures if caching is enabled. + ********************************************************************************************************************/ +void FindAllTexturesFromFolder(char *foldername, CSortedList &infos, bool extraCheck, bool bRecursive) +{ + // check if folder actually exists + if (!osal_is_directory(foldername)) + return; + + // the path of the texture + char texturefilename[PATH_MAX]; + // + IMAGE_INFO imgInfo; + // + IMAGE_INFO imgInfo2; + + void *dir; + dir = osal_search_dir_open(foldername); + const char *foundfilename; + + int crc, palcrc32; + unsigned int fmt, siz; + char crcstr[16], crcstr2[16]; + + do + { + foundfilename = osal_search_dir_read_next(dir); + + // The array is empty, break the current operation + if (foundfilename == NULL) + break; + // The current file is a hidden one + if (foundfilename[0] == '.' ) + // These files we don't need + continue; + + // Get the folder name + strcpy(texturefilename, foldername); + // And append the file name + strcat(texturefilename, foundfilename); + + // Check if the current file is a directory and if recursive scanning is enabled + if (osal_is_directory(texturefilename) && bRecursive ) + { + // Add file-separator + strcat(texturefilename, OSAL_DIR_SEPARATOR_STR); + // Scan detected folder for hires textures (recursive call) + FindAllTexturesFromFolder(texturefilename, infos, extraCheck, bRecursive); + continue; + } + // well, the current file is actually no file (probably a directory & recursive scanning is not enabled) + if( strstr(foundfilename,(const char*)g_curRomInfo.szGameName) == 0 ) + // go on with the next one + continue; + + TextureType type = NO_TEXTURE; + bool bSeparatedAlpha = false; + + // Detect the texture type by it's extention + // microdev: this is not the smartest way. Should be done by header analysis if possible + if( strcasecmp(right(foundfilename,7), "_ci.bmp") == 0 ) + { + // Identify type + if( GetImageInfoFromFile(texturefilename, &imgInfo) != 0) + { + DebugMessage(M64MSG_WARNING, "Cannot get image info for file: %s", foundfilename); + continue; + } + + if( imgInfo.Format == SURFFMT_P8 ) + // and store it to the record + type = COLOR_INDEXED_BMP; + else + // Type is not supported, go on with the next one + continue; + } + // Detect the texture type by its extention + else if( strcasecmp(right(foundfilename,13), "_ciByRGBA.png") == 0 ) + { + // Identify type + if( GetImageInfoFromFile(texturefilename, &imgInfo) != 0 ) + { + DebugMessage(M64MSG_WARNING, "Cannot get image info for file: %s", foundfilename); + continue; + } + + if( imgInfo.Format == SURFFMT_A8R8G8B8 ) + // and store it to the record + type = RGBA_PNG_FOR_CI; + else + // Type is not supported, go on with the next one + continue; + } + // Detect the texture type by its extention + else if( strcasecmp(right(foundfilename,16), "_allciByRGBA.png") == 0 ) + { + // Identify type + if( GetImageInfoFromFile(texturefilename, &imgInfo) != 0 ) + { + DebugMessage(M64MSG_WARNING, "Cannot get image info for file: %s", foundfilename); + continue; + } + if( imgInfo.Format == SURFFMT_A8R8G8B8 ) + // and store it to the record + type = RGBA_PNG_FOR_ALL_CI; + else + // Type not supported, go on with next one + continue; + } + // Detect the texture type by its extention + else if( strcasecmp(right(foundfilename,8), "_rgb.png") == 0 ) + { + // Identify type + if( GetImageInfoFromFile(texturefilename, &imgInfo) != 0 ) + { + DebugMessage(M64MSG_WARNING, "Cannot get image info for file: %s", foundfilename); + continue; + } + + // Store type to the record + type = RGB_PNG; + + char filename2[PATH_MAX]; + // Assemble the file name for the separate alpha channel file + strcpy(filename2,texturefilename); + strcpy(filename2+strlen(filename2)-8,"_a.png"); + // Check if the file actually exists + if( PathFileExists(filename2) ) + { + // Check if the file with this name is actually a texture (well an alpha channel one) + if( GetImageInfoFromFile(filename2, &imgInfo2) != 0 ) + { + // Nope, it isn't. => Go on with the next file + DebugMessage(M64MSG_WARNING, "Cannot get image info for file: %s", filename2); + continue; + } + + // Yes it is a texture file. Check if the size of the alpha channel is the same as the one of the texture + if( extraCheck && (imgInfo2.Width != imgInfo.Width || imgInfo2.Height != imgInfo.Height) ) + { + // Nope, it isn't => go on with next file + DebugMessage(M64MSG_WARNING, "RGB and alpha texture size mismatch: %s", filename2); + continue; + } + + bSeparatedAlpha = true; + } + } + // Detect the texture type by its extention + else if( strcasecmp(right(foundfilename,8), "_all.png") == 0 ) + { + // Check if texture is of expected type + if( GetImageInfoFromFile(texturefilename, &imgInfo) != 0 ) + { + DebugMessage(M64MSG_WARNING, "Cannot get image info for file: %s", foundfilename); + // Nope, continue with next file + continue; + } + + // Indicate file type + type = RGB_WITH_ALPHA_TOGETHER_PNG; + } + + // If a known texture format has been detected... + if( type != NO_TEXTURE ) + { + /* + Try to read image information here. + + (CASTLEVANIA2)#(58E2333F)#(2)#(0)#(D7A5C6D9)_ciByRGBA.png + (------1-----)#(---2----)#(3)#(4)#(---5----)_ciByRGBA.png + + 1. Internal ROM name + 2. The DRAM CRC + 3. The image pixel size (8b=0, 16b=1, 24b=2, 32b=3) + 4. The texture format (RGBA=0, YUV=1, CI=2, IA=3, I=4) + 5. The palette CRC + + ##<24bit>##_ciByRGBA.png + */ + + // Get the actual file name + strcpy(texturefilename, foundfilename); + // Place the pointer before the DRAM-CRC (first occurrence of '#') + char *ptr = strchr(texturefilename,'#'); + // Terminate the string ('0' means end of string - or in this case begin of string) + *ptr++ = 0; + if( type == RGBA_PNG_FOR_CI ) + { + // Extract the information from the file name; information is: + // + sscanf(ptr,"%8c#%d#%d#%8c", crcstr, &fmt, &siz,crcstr2); + // Terminate the ascii represntation of the palette crc + crcstr2[8] = 0; + // Transform the ascii presentation of the hex value to an unsigned integer + palcrc32 = strtoul(crcstr2,NULL,16); + } + else + { + // Extract the information from the file name - this file does not have a palette crc; information is: + // + // o gosh, commenting source code is really boring - but necessary!! Thus do it! (and don't use drugs ;-)) + sscanf(ptr,"%8c#%d#%d", crcstr, &fmt, &siz); + // Use dummy for palette crc - that way each texture can be handled in a heterogeneous way + palcrc32 = 0xFFFFFFFF; + } + // Terminate the ascii represntation of the texture crc + crcstr[8]=0; + // Transform the ascii presentation of the hex value to an unsigned integer + crc = strtoul(crcstr,NULL,16); + // For the detection of an existing item + + int foundIdx = -1; + for( int k=0; k + uint64 crc64 = newinfo.crc32; + crc64 <<= 32; + if (options.bLoadHiResCRCOnly) + crc64 |= newinfo.pal_crc32&0xFFFFFFFF; + else + crc64 |= (newinfo.pal_crc32&0xFFFFFF00)|(newinfo.fmt<<4)|newinfo.siz; + // Add the new record to the list + infos.add(crc64,newinfo); + } + } + } while(foundfilename != NULL); + + osal_search_dir_close(dir); +} +/******************************************************************************************************************** + * Checks if a folder is actually existant. If not, it tries to create this folder + * parameter: + * pathname: the name of the folder that should be checked or created if not existant + * return: + * return value: flag that indicates true if the folder is existant or could be created. If none was the case, + * false will be returned + ********************************************************************************************************************/ + +bool CheckAndCreateFolder(const char* pathname) +{ + // Check if provided folder already exists + if( !PathFileExists((char*)pathname) ) + { + // It didn't. Try creating it. + if (osal_mkdirp(pathname, 0700) != 0) + { + // It didn't work (probably insufficient permissions or read-only media) ==> return false + DebugMessage(M64MSG_WARNING, "Can not create new folder: %s", pathname); + return false; + } + } + // success + + return true; +} +// microdev: THIS HAS TO BE CLEANED UP... + + +// Texture dumping filenaming +// GameName_FrameCount_CRC_Fmt_Siz.bmp +// File format: BMP +// GameName: N64 game internal name +// CRC: 32 bit, 8 hex digits +// Fmt: 0 - 4 +// Siz: 0 - 3 + +const char *subfolders[] = { + "png_all", + "png_by_rgb_a", + "ci_bmp", + "ci_bmp_with_pal_crc", + "ci_by_png", +}; + +void FindAllDumpedTextures(void) +{ + char foldername[PATH_MAX + 64]; + strncpy(foldername, ConfigGetUserDataPath(), PATH_MAX); + foldername[PATH_MAX] = 0; + + if (foldername[strlen(foldername) - 1] != OSAL_DIR_SEPARATOR_CHAR) + strcat(foldername, OSAL_DIR_SEPARATOR_STR); + strcat(foldername,"texture_dump" OSAL_DIR_SEPARATOR_STR); + + CheckAndCreateFolder(foldername); + + strcat(foldername,(const char*)g_curRomInfo.szGameName); + strcat(foldername, OSAL_DIR_SEPARATOR_STR); + + gTxtrDumpInfos.clear(); + if( !PathFileExists(foldername) ) + { + CheckAndCreateFolder(foldername); + char foldername2[PATH_MAX]; + for( int i=0; i<5; i++) + { + strcpy(foldername2,foldername); + strcat(foldername2,subfolders[i]); + CheckAndCreateFolder(foldername2); + } + return; + } + else + { + gTxtrDumpInfos.clear(); + FindAllTexturesFromFolder(foldername,gTxtrDumpInfos, false, true); + + char foldername2[PATH_MAX]; + for( int i=0; i<5; i++) + { + strcpy(foldername2,foldername); + strcat(foldername2,subfolders[i]); + CheckAndCreateFolder(foldername2); + } + } +} + +/******************************************************************************************************************** + * Truncates the current list with information about hires textures and scans the hires folder for hires textures and + * creates a list with records of properties of the hires textures. + * parameter: + * none + * return: + * none + ********************************************************************************************************************/ +void FindAllHiResTextures(void) +{ + char foldername[PATH_MAX + 64]; + strncpy(foldername, ConfigGetUserDataPath(), PATH_MAX); + foldername[PATH_MAX] = 0; + + // Assure that a backslash exists at the end (should be handled by GetPluginDir()) + if(foldername[strlen(foldername) - 1] != OSAL_DIR_SEPARATOR_CHAR) + strcat(foldername, OSAL_DIR_SEPARATOR_STR); + // Add the relative path to the hires folder + strcat(foldername,"hires_texture" OSAL_DIR_SEPARATOR_STR); + // It does not exist? => Create it + CheckAndCreateFolder(foldername); + + // Add the path to a sub-folder corresponding to the rom name + // HOOK IN: PACK SELECT + strcat(foldername,(const char*)g_curRomInfo.szGameName); + strcat(foldername, OSAL_DIR_SEPARATOR_STR); + // Truncate the current list with the hires texture info + gHiresTxtrInfos.clear(); + if (!osal_is_directory(foldername)) + { + DebugMessage(M64MSG_WARNING, "Couldn't open hi-res texture directory: %s", foldername); + return; + } + else + { + // Find all hires textures and also cache them if configured to do so + FindAllTexturesFromFolder(foldername,gHiresTxtrInfos, true, true); + } +} + +void CloseHiresTextures(void) +{ + for( int i=0; i= entry.ti.HeightToLoad*(1<= entry.ti.WidthToLoad*(1< &infos, TxtrCacheEntry &entry, int &indexa, int &scaleShift, bool bForDump = false) +{ + if ((entry.ti.WidthToLoad != 0 && entry.ti.WidthToCreate / entry.ti.WidthToLoad > 2) || + (entry.ti.HeightToLoad != 0 && entry.ti.HeightToCreate / entry.ti.HeightToLoad > 2 )) + { + //DebugMessage(M64MSG_WARNING, "Hires texture does not support extreme texture replication"); + return -1; + } + // determine if texture is a color-indexed (CI) texture + + bool bCI = (gRDP.otherMode.text_tlut>=2 || entry.ti.Format == TXT_FMT_CI || entry.ti.Format == TXT_FMT_RGBA) && entry.ti.Size <= TXT_SIZE_8b; + // generate two alternative ids + + uint64 crc64a = entry.dwCRC; + crc64a <<= 32; + uint64 crc64b = crc64a; + if (options.bLoadHiResCRCOnly) { + crc64a |= (0xFFFFFFFF); + crc64b |= (entry.dwPalCRC&0xFFFFFFFF); + } else { + crc64a |= (0xFFFFFF00|(entry.ti.Format<<4)|entry.ti.Size); + crc64b |= ((entry.dwPalCRC&0xFFFFFF00)|(entry.ti.Format<<4)|entry.ti.Size); + } + + // infos is the list containing the references to the detected external textures + // get the number of items contained in this list + int infosize = infos.size(); + int indexb=-1; + // try to identify the external texture that + // corresponds to the original texture + indexa = infos.find(crc64a); // For CI without pal CRC, and for RGBA_PNG_FOR_ALL_CI + if( bCI ) + // and also for textures with separate alpha channel + indexb = infos.find(crc64b); // For CI or PNG with pal CRC + + // did not found the ext. text. + if( indexa >= infosize ) + indexa = -1; + // did not found the ext. text. w/ sep. alpha channel + if( indexb >= infosize ) + indexb = -1; + + scaleShift = -1; + + // found texture with sep. alpha channel + + if( indexb >= 0 ) + { + // determine the factor for scaling + scaleShift = FindScaleFactor(infos[indexb], entry); + // ok. the scale factor is supported. A valid replacement has been found + if( scaleShift >= 0 ) + return indexb; + } + // if texture is 4bit, should be dumped and there is no match in the list of external textures + + if( bForDump && bCI && indexb < 0) + // than return that there is no replacement & therefore texture can be dumped (microdev: not sure about that...) + return -1; + + // texture has no separate alpha channel, try to find it in the ext. text. list + if( indexa >= 0 ) + scaleShift = FindScaleFactor(infos[indexa], entry); + // ok. the scale factor is supported. A valid replacement has been found + // this is a texture without ext. alpha channel + + if( scaleShift >= 0 ) + return indexa; + // no luck at all. there is no valid replacement + else + return -1; +} + +bool SaveCITextureToFile(TxtrCacheEntry &entry, char *filename, bool bShow, bool bWhole); + +void DumpCachedTexture( TxtrCacheEntry &entry ) +{ + char cSep = '/'; + + CTexture *pSrcTexture = entry.pTexture; + if( pSrcTexture ) + { + // Check the vector table + int ciidx, scaleShift; + if( CheckTextureInfos(gTxtrDumpInfos,entry,ciidx,scaleShift,true) >= 0 ) + return; // This texture has been dumpped + + char filename1[PATH_MAX + 64]; + char filename2[PATH_MAX + 64]; + char filename3[PATH_MAX + 64]; + char gamefolder[PATH_MAX + 64]; + strncpy(gamefolder, ConfigGetUserDataPath(), PATH_MAX); + gamefolder[PATH_MAX] = 0; + + strcat(gamefolder,"texture_dump" OSAL_DIR_SEPARATOR_STR); + strcat(gamefolder,(const char*)g_curRomInfo.szGameName); + strcat(gamefolder, OSAL_DIR_SEPARATOR_STR); + + //sprintf(filename1+strlen(filename1), "%08X#%d#%d", entry.dwCRC, entry.ti.Format, entry.ti.Size); + sprintf(filename1, "%s%s#%08X#%d#%d", gamefolder, g_curRomInfo.szGameName, entry.dwCRC, entry.ti.Format, entry.ti.Size); + + if( (gRDP.otherMode.text_tlut>=2 || entry.ti.Format == TXT_FMT_CI || entry.ti.Format == TXT_FMT_RGBA) && entry.ti.Size <= TXT_SIZE_8b ) + { + if( ciidx < 0 ) + { + sprintf(filename1, "%sci_bmp%c%s#%08X#%d#%d_ci", gamefolder, cSep, g_curRomInfo.szGameName, entry.dwCRC, entry.ti.Format, entry.ti.Size); + SaveCITextureToFile(entry, filename1, false, false); + } + + sprintf(filename1, "%sci_bmp_with_pal_crc%c%s#%08X#%d#%d#%08X_ci", gamefolder, cSep, g_curRomInfo.szGameName, entry.dwCRC, entry.ti.Format, entry.ti.Size,entry.dwPalCRC); + SaveCITextureToFile(entry, filename1, false, false); + + sprintf(filename1, "%sci_by_png%c%s#%08X#%d#%d#%08X_ciByRGBA", gamefolder, cSep, g_curRomInfo.szGameName, entry.dwCRC, entry.ti.Format, entry.ti.Size,entry.dwPalCRC); + CRender::g_pRender->SaveTextureToFile(*pSrcTexture, filename1, TXT_RGBA, false, false, entry.ti.WidthToLoad, entry.ti.HeightToLoad); + } + else + { + sprintf(filename1, "%spng_by_rgb_a%c%s#%08X#%d#%d_rgb", gamefolder, cSep, g_curRomInfo.szGameName, entry.dwCRC, entry.ti.Format, entry.ti.Size); + sprintf(filename2, "%spng_by_rgb_a%c%s#%08X#%d#%d_a", gamefolder, cSep, g_curRomInfo.szGameName, entry.dwCRC, entry.ti.Format, entry.ti.Size); + sprintf(filename3, "%spng_all%c%s#%08X#%d#%d_all", gamefolder, cSep, g_curRomInfo.szGameName, entry.dwCRC, entry.ti.Format, entry.ti.Size); + + + CRender::g_pRender->SaveTextureToFile(*pSrcTexture, filename1, TXT_RGB, false, false, entry.ti.WidthToLoad, entry.ti.HeightToLoad); + CRender::g_pRender->SaveTextureToFile(*pSrcTexture, filename3, TXT_RGBA, false, false, entry.ti.WidthToLoad, entry.ti.HeightToLoad); + if( entry.ti.Format != TXT_FMT_I ) + { + DrawInfo srcInfo; + uint32 aFF = 0xFF; + if( pSrcTexture->StartUpdate(&srcInfo) ) + { + // Copy RGB to buffer + for( int i=entry.ti.HeightToLoad-1; i>=0; i--) + { + unsigned char *pSrc = (unsigned char*)srcInfo.lpSurface+srcInfo.lPitch * i; + for( uint32 j=0; jEndUpdate(&srcInfo); + } + + if( aFF != 0xFF) + CRender::g_pRender->SaveTextureToFile(*pSrcTexture, filename2, TXT_ALPHA, false, false); + } + } + + ExtTxtrInfo newinfo; + newinfo.width = entry.ti.WidthToLoad; + newinfo.height = entry.ti.HeightToLoad; + //strcpy(newinfo.name,g_curRomInfo.szGameName); + newinfo.fmt = entry.ti.Format; + newinfo.siz = entry.ti.Size; + newinfo.crc32 = entry.dwCRC; + + newinfo.pal_crc32 = entry.dwPalCRC; + newinfo.foldername = NULL; + newinfo.filename = NULL; + newinfo.filename_a = NULL; + + uint64 crc64 = newinfo.crc32; + crc64 <<= 32; + if (options.bLoadHiResCRCOnly) + crc64 |= newinfo.pal_crc32&0xFFFFFFFF; + else + crc64 |= (newinfo.pal_crc32&0xFFFFFF00)|(newinfo.fmt<<4)|newinfo.siz; + gTxtrDumpInfos.add(crc64,newinfo); + + } +} + +bool LoadRGBBufferFromPNGFile(char *filename, unsigned char **pbuf, int &width, int &height, int bits_per_pixel = 24 ) +{ + struct BMGImageStruct img; + memset(&img, 0, sizeof(BMGImageStruct)); + if (!PathFileExists(filename)) + { + DebugMessage(M64MSG_ERROR, "File at '%s' doesn't exist in LoadRGBBufferFromPNGFile!", filename); + return false; + } + + BMG_Error code = ReadPNG( filename, &img ); + if( code == BMG_OK ) + { + *pbuf = NULL; + + *pbuf = new unsigned char[img.width*img.height*bits_per_pixel/8]; + if (*pbuf == NULL) + { + DebugMessage(M64MSG_ERROR, "new[] returned NULL for image width=%i height=%i bpp=%i", img.width, img.height, bits_per_pixel); + return false; + } + if (img.bits_per_pixel == bits_per_pixel) + { + memcpy(*pbuf, img.bits, img.width*img.height*bits_per_pixel/8); + } + else if (img.bits_per_pixel == 24 && bits_per_pixel == 32) + { + unsigned char *pSrc = img.bits; + unsigned char *pDst = *pbuf; + for (int i = 0; i < (int)(img.width*img.height); i++) + { + *pDst++ = *pSrc++; + *pDst++ = *pSrc++; + *pDst++ = *pSrc++; + *pDst++ = 0; + } + } + // loaded image has alpha, needed image has to be without alpha channel + else if (img.bits_per_pixel == 32 && bits_per_pixel == 24) + { + // pointer to source image data + unsigned char *pSrc = img.bits; + // buffer for destination image + unsigned char *pDst = *pbuf; + // copy data of the loaded image to the buffer by skipping the alpha byte + for (int i = 0; i < (int)(img.width*img.height); i++) + { + // copy R + *pDst++ = *pSrc++; + // copy G + *pDst++ = *pSrc++; + // copy B + *pDst++ = *pSrc++; + // skip the alpha byte of the loaded image + pSrc++; + } + } + else if (img.bits_per_pixel == 8 && (bits_per_pixel == 24 || bits_per_pixel == 32)) + { + // do palette lookup and convert 8bpp to 24/32bpp + int destBytePP = bits_per_pixel / 8; + int paletteBytePP = img.bytes_per_palette_entry; + unsigned char *pSrc = img.bits; + unsigned char *pDst = *pbuf; + // clear the destination image data (just to clear alpha if bpp=32) + memset(*pbuf, 0, img.width*img.height*destBytePP); + for (int i = 0; i < (int)(img.width*img.height); i++) + { + unsigned char clridx = *pSrc++; + unsigned char *palcolor = img.palette + clridx * paletteBytePP; + pDst[0] = palcolor[2]; // red + pDst[1] = palcolor[1]; // green + pDst[2] = palcolor[0]; // blue + pDst += destBytePP; + } + } + else + { + DebugMessage(M64MSG_ERROR, "PNG file '%s' is %i bpp but texture is %i bpp.", filename, img.bits_per_pixel, bits_per_pixel); + delete [] *pbuf; + *pbuf = NULL; + } + + width = img.width; + height = img.height; + FreeBMGImage(&img); + + return true; + } + else + { + DebugMessage(M64MSG_ERROR, "ReadPNG() returned error for '%s' in LoadRGBBufferFromPNGFile!", filename); + *pbuf = NULL; + return false; + } +} + +bool LoadRGBABufferFromColorIndexedFile(char *filename, TxtrCacheEntry &entry, unsigned char **pbuf, int &width, int &height) +{ + BITMAPFILEHEADER fileHeader; + BITMAPINFOHEADER infoHeader; + + FILE *f; + f = fopen(filename, "rb"); + if(f != NULL) + { + if (fread(&fileHeader, sizeof(BITMAPFILEHEADER), 1, f) != 1 || + fread(&infoHeader, sizeof(BITMAPINFOHEADER), 1, f) != 1) + { + DebugMessage(M64MSG_ERROR, "Couldn't read BMP headers in file '%s'", filename); + return false; + } + + if( infoHeader.biBitCount != 4 && infoHeader.biBitCount != 8 ) + { + fclose(f); + DebugMessage(M64MSG_ERROR, "Unsupported BMP file format: %s", filename); + *pbuf = NULL; + return false; + } + + int tablesize = infoHeader.biBitCount == 4 ? 16 : 256; + uint32 *pTable = new uint32[tablesize]; + if (fread(pTable, tablesize*4, 1, f) != 1) + { + DebugMessage(M64MSG_ERROR, "Couldn't read BMP palette in file '%s'", filename); + delete [] pTable; + return false; + } + + // Create the pallette table + uint16 * pPal = (uint16 *)entry.ti.PalAddress; + if( entry.ti.Size == TXT_SIZE_4b ) + { + // 4-bit table + for( int i=0; i<16; i++ ) + { + pTable[i] = entry.ti.TLutFmt == TLUT_FMT_RGBA16 ? Convert555ToRGBA(pPal[i^1]) : ConvertIA16ToRGBA(pPal[i^1]); + } + } + else + { + // 8-bit table + for( int i=0; i<256; i++ ) + { + pTable[i] = entry.ti.TLutFmt == TLUT_FMT_RGBA16 ? Convert555ToRGBA(pPal[i^1]) : ConvertIA16ToRGBA(pPal[i^1]); + } + } + + *pbuf = new unsigned char[infoHeader.biWidth*infoHeader.biHeight*4]; + if( *pbuf ) + { + unsigned char *colorIdxBuf = new unsigned char[infoHeader.biSizeImage]; + if( colorIdxBuf ) + { + if (fread(colorIdxBuf, infoHeader.biSizeImage, 1, f) != 1) + { + DebugMessage(M64MSG_ERROR, "Couldn't read BMP image data in file '%s'", filename); + } + + width = infoHeader.biWidth; + height = infoHeader.biHeight; + + // Converting pallette texture to RGBA texture + int idx = 0; + uint32 *pbuf2 = (uint32*) *pbuf; + + for( int i=height-1; i>=0; i--) + { + for( int j=0; j>1]&0xF]; + } + else + { + // 0 + *pbuf2++ = pTable[(colorIdxBuf[(idx++)>>1]>>4)&0xF]; + } + } + else + { + // 8 bits + *pbuf2++ = pTable[colorIdxBuf[idx++]]; + } + } + if( entry.ti.Size == TXT_SIZE_4b ) + { + if( idx%8 ) idx = (idx/8+1)*8; + } + else + { + if( idx%4 ) idx = (idx/4+1)*4; + } + } + + delete [] colorIdxBuf; + } + else + { + TRACE0("Out of memory"); + } + + delete [] pTable; + return true; + } + else + { + fclose(f); + delete [] pTable; + return false; + } + } + else + { + // Do something + TRACE1("Fail to open file %s", filename); + *pbuf = NULL; + return false; + } +} + +bool LoadRGBBufferFromBMPFile(char *filename, unsigned char **pbuf, int &width, int &height) +{ + BITMAPFILEHEADER fileHeader; + BITMAPINFOHEADER infoHeader; + + FILE *f; + f = fopen(filename, "rb"); + if(f != NULL) + { + if (fread(&fileHeader, sizeof(BITMAPFILEHEADER), 1, f) != 1 || + fread(&infoHeader, sizeof(BITMAPINFOHEADER), 1, f) != 1) + { + DebugMessage(M64MSG_ERROR, "Couldn't read BMP headers in file '%s'", filename); + return false; + } + + if( infoHeader.biBitCount != 24 ) + { + fclose(f); + DebugMessage(M64MSG_ERROR, "Unsupported BMP file 16 bits format: %s", filename); + *pbuf = NULL; + return false; + } + + *pbuf = new unsigned char[infoHeader.biWidth*infoHeader.biHeight*3]; + if( *pbuf ) + { + if (fread(*pbuf, infoHeader.biWidth*infoHeader.biHeight*3, 1, f) != 1) + DebugMessage(M64MSG_ERROR, "Couldn't read RGB BMP image data in file '%s'", filename); + fclose(f); + width = infoHeader.biWidth; + height = infoHeader.biHeight; + return true; + } + else + { + fclose(f); + return false; + } + } + else + { + // Do something + DebugMessage(M64MSG_WARNING, "Fail to open file %s", filename); + *pbuf = NULL; + return false; + } +} + +/******************************************************* + * Loads the hires equivaltent of a texture + * parameter: + * TxtrCacheEntry: The original texture in the texture cache + * return: + * none + *******************************************************/ +void LoadHiresTexture( TxtrCacheEntry &entry ) +{ + // check if the external texture has already been loaded + if( entry.bExternalTxtrChecked ) + return; + // there is already an enhanced texture (e.g. a filtered one) + + if( entry.pEnhancedTexture ) + { + // delete it from memory before loading the external one + SAFE_DELETE(entry.pEnhancedTexture); + } + + int ciidx, scaleShift; + // search the index of the appropriate hires replacement texture + // in the list containing the infos of the external textures + // ciidx is not needed here (just needed for dumping) + int idx = CheckTextureInfos(gHiresTxtrInfos,entry,ciidx,scaleShift,false); + if( idx < 0 ) + { + // there is no hires replacement => indicate that + entry.bExternalTxtrChecked = true; + return; + } + + // Load the bitmap file + char filename_rgb[PATH_MAX]; + char filename_a[PATH_MAX]; + + strcpy(filename_rgb, gHiresTxtrInfos[idx].foldername); + strcat(filename_rgb, gHiresTxtrInfos[idx].filename); + + if (gHiresTxtrInfos[idx].filename_a) { + strcpy(filename_a, gHiresTxtrInfos[idx].foldername); + strcat(filename_a, gHiresTxtrInfos[idx].filename_a); + } else { + strcpy(filename_a, ""); + } + + // Load BMP image to buffer_rbg + unsigned char *buf_rgba = NULL; + unsigned char *buf_a = NULL; + int width, height; + + bool bResRGBA=false, bResA=false; + bool bCI = ((gRDP.otherMode.text_tlut>=2 || entry.ti.Format == TXT_FMT_CI || entry.ti.Format == TXT_FMT_RGBA) && entry.ti.Size <= TXT_SIZE_8b ); + + switch( gHiresTxtrInfos[idx].type ) + { + case RGB_PNG: + if( bCI ) + return; + else + { + bResRGBA = LoadRGBBufferFromPNGFile(filename_rgb, &buf_rgba, width, height); + if( bResRGBA && gHiresTxtrInfos[idx].bSeparatedAlpha ) + bResA = LoadRGBBufferFromPNGFile(filename_a, &buf_a, width, height); + } + break; + case COLOR_INDEXED_BMP: + if( bCI ) + bResRGBA = LoadRGBABufferFromColorIndexedFile(filename_rgb, entry, &buf_rgba, width, height); + else + return; + break; + case RGBA_PNG_FOR_CI: + case RGBA_PNG_FOR_ALL_CI: + if( bCI ) + bResRGBA = LoadRGBBufferFromPNGFile(filename_rgb, &buf_rgba, width, height, 32); + else + return; + break; + case RGB_WITH_ALPHA_TOGETHER_PNG: + if( bCI ) + return; + else + bResRGBA = LoadRGBBufferFromPNGFile(filename_rgb, &buf_rgba, width, height, 32); + break; + default: + return; + } + + if( !bResRGBA || !buf_rgba ) + { + DebugMessage(M64MSG_ERROR, "RGBBuffer creation failed for file '%s'.", filename_rgb); + return; + } + // check if the alpha channel has been loaded if the texture has a separate alpha channel + else if( gHiresTxtrInfos[idx].bSeparatedAlpha && !bResA ) + { + DebugMessage(M64MSG_ERROR, "Alpha buffer creation failed for file '%s'.", filename_a); + delete [] buf_rgba; + return; + } + + // calculate the texture size magnification by comparing the N64 texture size and the hi-res texture size + int scale = 1 << scaleShift; + int mirrorx = 1; + int mirrory = 1; + int input_height_shift = height - entry.ti.HeightToLoad * scale; + int input_pitch_a = width; + int input_pitch_rgb = width; + width = entry.ti.WidthToLoad * scale; + height = entry.ti.HeightToLoad * scale; + if (entry.ti.WidthToCreate/entry.ti.WidthToLoad == 2) mirrorx = 2; + if (entry.ti.HeightToCreate/entry.ti.HeightToLoad == 2) mirrory = 2; + entry.pEnhancedTexture = CDeviceBuilder::GetBuilder()->CreateTexture(entry.ti.WidthToCreate*scale, entry.ti.HeightToCreate*scale); + DrawInfo info; + + if( entry.pEnhancedTexture && entry.pEnhancedTexture->StartUpdate(&info) ) + { + + if( gHiresTxtrInfos[idx].type == RGB_PNG ) + { + input_pitch_rgb *= 3; + input_pitch_a *= 3; + + if (info.lPitch < width * 4) + DebugMessage(M64MSG_ERROR, "Texture pitch %i less than width %i times 4", info.lPitch, width); + if (height > info.dwHeight) + DebugMessage(M64MSG_ERROR, "Texture source height %i greater than destination height %i", height, info.dwHeight); + + // Update the texture by using the buffer + for( int i=0; i=0; i--) + { + uint32 *pRGB = (uint32*)(buf_rgba + (input_height_shift + i) * input_pitch_rgb); + uint32 *pdst = (uint32*)((unsigned char*)info.lpSurface + (height - i - 1)*info.lPitch); + for( int j=0; jm_dwCreatedTextureWidth, height, T_FLAG, 4 ); + } + + if( entry.ti.WidthToCreate*scale < entry.pEnhancedTexture->m_dwCreatedTextureWidth ) + { + // Clamp + gTextureManager.Clamp(info.lpSurface, width, entry.pEnhancedTexture->m_dwCreatedTextureWidth, entry.pEnhancedTexture->m_dwCreatedTextureWidth, height, S_FLAG, 4 ); + } + if( entry.ti.HeightToCreate*scale < entry.pEnhancedTexture->m_dwCreatedTextureHeight ) + { + // Clamp + gTextureManager.Clamp(info.lpSurface, height, entry.pEnhancedTexture->m_dwCreatedTextureHeight, entry.pEnhancedTexture->m_dwCreatedTextureWidth, height, T_FLAG, 4 ); + } + + entry.pEnhancedTexture->EndUpdate(&info); + entry.pEnhancedTexture->SetOthersVariables(); + entry.pEnhancedTexture->m_bIsEnhancedTexture = true; + entry.dwEnhancementFlag = TEXTURE_EXTERNAL; + + DebugMessage(M64MSG_VERBOSE, "Loaded hi-res texture: %s", filename_rgb); + } + else + { + DebugMessage(M64MSG_ERROR, "New texture creation failed."); + TRACE0("Cannot create a new texture"); + } + + if( buf_rgba ) + { + delete [] buf_rgba; + } + + if( buf_a ) + { + delete [] buf_a; + } +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/TextureFilters.h b/libmupen64plus/mupen64plus-video-rice/src/TextureFilters.h new file mode 100644 index 0000000000..093d2acf65 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/TextureFilters.h @@ -0,0 +1,84 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + + +#ifndef __FILTERS_H__ +#define __FILTERS_H__ + +#include "Config.h" +#include "TextureManager.h" + +#define DWORD_MAKE(r, g, b, a) ((uint32) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))) +#define WORD_MAKE(r, g, b, a) ((uint16) (((a) << 12) | ((r) << 8) | ((g) << 4) | (b))) + +extern void InitExternalTextures(void); +extern void CloseExternalTextures(void); + +void Texture2x_32( DrawInfo &srcInfo, DrawInfo &destInfo); +void Texture2x_16( DrawInfo &srcInfo, DrawInfo &destInfo); + +void Texture2x_Interp_32( DrawInfo &srcInfo, DrawInfo &destInfo); +void Texture2x_Interp_16( DrawInfo &srcInfo, DrawInfo &destInfo); + +void Super2xSaI_32( uint32 *srcPtr, uint32 *destPtr, uint32 width, uint32 height, uint32 pitch); +void Super2xSaI_16( uint16 *srcPtr, uint16 *destPtr, uint32 width, uint32 height, uint32 pitch); + +void hq4x_16( unsigned char * pIn, unsigned char * pOut, int Xres, int Yres, int SrcPPL, int BpL ); +void hq4x_32( unsigned char * pIn, unsigned char * pOut, int Xres, int Yres, int SrcPPL, int BpL ); +void hq4x_InitLUTs(void); + +void SmoothFilter_32(uint32 *pdata, uint32 width, uint32 height, uint32 pitch, uint32 filter=TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_1); +void SmoothFilter_16(uint16 *pdata, uint32 width, uint32 height, uint32 pitch, uint32 filter=TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_1); + +void SharpenFilter_32(uint32 *pdata, uint32 width, uint32 height, uint32 pitch, uint32 filter=TEXTURE_SHARPEN_ENHANCEMENT); +void SharpenFilter_16(uint16 *pdata, uint32 width, uint32 height, uint32 pitch, uint32 filter=TEXTURE_SHARPEN_ENHANCEMENT); + +void hq2x_init(unsigned bits_per_pixel); +void hq2x_16(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height); +void hq2x_32(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height); + +void lq2x_16(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height); +void lq2x_32(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height); + +typedef enum _IMAGE_FILEFORMAT +{ + XIFF_BMP = 0, + XIFF_JPG = 1, + XIFF_TGA = 2, + XIFF_PNG = 3, + XIFF_DDS = 4, + XIFF_PPM = 5, + XIFF_DIB = 6, + XIFF_HDR = 7, + XIFF_PFM = 8, + XIFF_FORCE_DWORD = 0x7fffffff +} IMAGE_FILEFORMAT; + +typedef struct _IMAGE_INFO +{ + unsigned int Width; + unsigned int Height; + unsigned int Depth; + unsigned int MipLevels; + int Format; /* SURFFORMAT */ + IMAGE_FILEFORMAT ImageFileFormat; +} IMAGE_INFO; + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/TextureFilters_2xsai.cpp b/libmupen64plus/mupen64plus-video-rice/src/TextureFilters_2xsai.cpp new file mode 100644 index 0000000000..72d6fa92e6 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/TextureFilters_2xsai.cpp @@ -0,0 +1,474 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + +#include "TextureFilters.h" + + +/************************************************************************/ +/* 2xSAI filters */ +/************************************************************************/ +static __inline int SAI_GetResult1_32( uint32 A, uint32 B, uint32 C, uint32 D, uint32 E ) +{ + int x = 0; + int y = 0; + int r = 0; + + if (A == C) x += 1; else if (B == C) y += 1; + if (A == D) x += 1; else if (B == D) y += 1; + if (x <= 1) r += 1; + if (y <= 1) r -= 1; + + return r; +} + +static __inline uint16 SAI_GetResult1_16( uint16 A, uint16 B, uint16 C, uint16 D, uint16 E ) +{ + uint16 x = 0; + uint16 y = 0; + uint16 r = 0; + + if (A == C) x += 1; else if (B == C) y += 1; + if (A == D) x += 1; else if (B == D) y += 1; + if (x <= 1) r += 1; + if (y <= 1 && r>0) r -= 1; + + return r; +} + +static __inline int SAI_GetResult2_32( uint32 A, uint32 B, uint32 C, uint32 D, uint32 E) +{ + int x = 0; + int y = 0; + int r = 0; + + if (A == C) x += 1; else if (B == C) y += 1; + if (A == D) x += 1; else if (B == D) y += 1; + if (x <= 1) r -= 1; + if (y <= 1) r += 1; + + return r; +} + +static __inline uint16 SAI_GetResult2_16( uint16 A, uint16 B, uint16 C, uint16 D, uint16 E) +{ + uint16 x = 0; + uint16 y = 0; + uint16 r = 0; + + if (A == C) x += 1; else if (B == C) y += 1; + if (A == D) x += 1; else if (B == D) y += 1; + if (x <= 1 && r>0 ) r -= 1; + if (y <= 1) r += 1; + + return r; +} + + +static __inline int SAI_GetResult_32( uint32 A, uint32 B, uint32 C, uint32 D ) +{ + int x = 0; + int y = 0; + int r = 0; + + if (A == C) x += 1; else if (B == C) y += 1; + if (A == D) x += 1; else if (B == D) y += 1; + if (x <= 1) r += 1; + if (y <= 1) r -= 1; + + return r; +} + +static __inline uint16 SAI_GetResult_16( uint16 A, uint16 B, uint16 C, uint16 D ) +{ + uint16 x = 0; + uint16 y = 0; + uint16 r = 0; + + if (A == C) x += 1; else if (B == C) y += 1; + if (A == D) x += 1; else if (B == D) y += 1; + if (x <= 1) r += 1; + if (y <= 1 && r>0 ) r -= 1; + + return r; +} + + +static __inline uint32 SAI_INTERPOLATE_32( uint32 A, uint32 B) +{ + if (A != B) + return ((A & 0xFEFEFEFE) >> 1) + + (((B & 0xFEFEFEFE) >> 1) | + (A & B & 0x01010101)); + else + return A; +} + +static __inline uint16 SAI_INTERPOLATE_16( uint16 A, uint16 B) +{ + if (A != B) + return ((A & 0xFEFE) >> 1) + + (((B & 0xFEFE) >> 1) | + (A & B & 0x0101)); + else + return A; +} + + +static __inline uint32 SAI_Q_INTERPOLATE_32( uint32 A, uint32 B, uint32 C, uint32 D) +{ + uint32 x = ((A & 0xFCFCFCFC) >> 2) + + ((B & 0xFCFCFCFC) >> 2) + + ((C & 0xFCFCFCFC) >> 2) + + ((D & 0xFCFCFCFC) >> 2); + uint32 y = (((A & 0x03030303) + + (B & 0x03030303) + + (C & 0x03030303) + + (D & 0x03030303)) >> 2) & 0x03030303; + return x | y; +} + +static __inline uint16 SAI_Q_INTERPOLATE_16( uint16 A, uint16 B, uint16 C, uint16 D) +{ + uint16 x = ((A & 0xFCFC) >> 2) + + ((B & 0xFCFC) >> 2) + + ((C & 0xFCFC) >> 2) + + ((D & 0xFCFC) >> 2); + uint16 y = (((A & 0x0303) + + (B & 0x0303) + + (C & 0x0303) + + (D & 0x0303)) >> 2) & 0x0303; + return x | y; +} + + +void Super2xSaI_32( uint32 *srcPtr, uint32 *destPtr, uint32 width, uint32 height, uint32 pitch) +{ + uint32 destWidth = width << 1; + //uint32 destHeight = height << 1; + + uint32 color4, color5, color6; + uint32 color1, color2, color3; + uint32 colorA0, colorA1, colorA2, colorA3; + uint32 colorB0, colorB1, colorB2, colorB3; + uint32 colorS1, colorS2; + uint32 product1a, product1b, product2a, product2b; + + int row0, row1, row2, row3; + int col0, col1, col2, col3; + + for (uint16 y = 0; y < height; y++) + { + if (y > 0) + { + row0 = width; + row0 = -row0; + } + else + row0 = 0; + + row1 = 0; + + if (y < height - 1) + { + row2 = width; + + if (y < height - 2) + row3 = width << 1; + else + row3 = width; + } + else + { + row2 = 0; + row3 = 0; + } + + for (uint16 x = 0; x < width; x++) + { + //--------------------------------------- B0 B1 B2 B3 + // 4 5 6 S2 + // 1 2 3 S1 + // A0 A1 A2 A3 + if (x > 0) + col0 = -1; + else + col0 = 0; + + col1 = 0; + + if (x < width - 1) + { + col2 = 1; + + if (x < width - 2) + col3 = 2; + else + col3 = 1; + } + else + { + col2 = 0; + col3 = 0; + } + + colorB0 = *(srcPtr + col0 + row0); + colorB1 = *(srcPtr + col1 + row0); + colorB2 = *(srcPtr + col2 + row0); + colorB3 = *(srcPtr + col3 + row0); + + color4 = *(srcPtr + col0 + row1); + color5 = *(srcPtr + col1 + row1); + color6 = *(srcPtr + col2 + row1); + colorS2 = *(srcPtr + col3 + row1); + + color1 = *(srcPtr + col0 + row2); + color2 = *(srcPtr + col1 + row2); + color3 = *(srcPtr + col2 + row2); + colorS1 = *(srcPtr + col3 + row2); + + colorA0 = *(srcPtr + col0 + row3); + colorA1 = *(srcPtr + col1 + row3); + colorA2 = *(srcPtr + col2 + row3); + colorA3 = *(srcPtr + col3 + row3); + + //-------------------------------------- + if (color2 == color6 && color5 != color3) + product2b = product1b = color2; + else if (color5 == color3 && color2 != color6) + product2b = product1b = color5; + else if (color5 == color3 && color2 == color6) + { + int r = 0; + + r += SAI_GetResult_32 (color6, color5, color1, colorA1); + r += SAI_GetResult_32 (color6, color5, color4, colorB1); + r += SAI_GetResult_32 (color6, color5, colorA2, colorS1); + r += SAI_GetResult_32 (color6, color5, colorB2, colorS2); + + if (r > 0) + product2b = product1b = color6; + else if (r < 0) + product2b = product1b = color5; + else + product2b = product1b = SAI_INTERPOLATE_32 (color5, color6); + } + else + { + + if (color6 == color3 && color3 == colorA1 && color2 != colorA2 && color3 != colorA0) + product2b = SAI_Q_INTERPOLATE_32 (color3, color3, color3, color2); + else if (color5 == color2 && color2 == colorA2 && colorA1 != color3 && color2 != colorA3) + product2b = SAI_Q_INTERPOLATE_32 (color2, color2, color2, color3); + else + product2b = SAI_INTERPOLATE_32 (color2, color3); + + if (color6 == color3 && color6 == colorB1 && color5 != colorB2 && color6 != colorB0) + product1b = SAI_Q_INTERPOLATE_32 (color6, color6, color6, color5); + else if (color5 == color2 && color5 == colorB2 && colorB1 != color6 && color5 != colorB3) + product1b = SAI_Q_INTERPOLATE_32 (color6, color5, color5, color5); + else + product1b = SAI_INTERPOLATE_32 (color5, color6); + } + + if (color5 == color3 && color2 != color6 && color4 == color5 && color5 != colorA2) + product2a = SAI_INTERPOLATE_32 (color2, color5); + else if (color5 == color1 && color6 == color5 && color4 != color2 && color5 != colorA0) + product2a = SAI_INTERPOLATE_32(color2, color5); + else + product2a = color2; + + if (color2 == color6 && color5 != color3 && color1 == color2 && color2 != colorB2) + product1a = SAI_INTERPOLATE_32 (color2, color5); + else if (color4 == color2 && color3 == color2 && color1 != color5 && color2 != colorB0) + product1a = SAI_INTERPOLATE_32(color2, color5); + else + product1a = color5; + + + destPtr[0] = product1a; + destPtr[1] = product1b; + destPtr[destWidth] = product2a; + destPtr[destWidth + 1] = product2b; + + srcPtr++; + destPtr += 2; + } + srcPtr += (pitch-width); + destPtr += (((pitch-width)<<1)+(pitch<<1)); + } +} + + +void Super2xSaI_16( uint16 *srcPtr, uint16 *destPtr, uint32 width, uint32 height, uint32 pitch) +{ + uint32 destWidth = width << 1; + //uint32 destHeight = height << 1; + + uint16 color4, color5, color6; + uint16 color1, color2, color3; + uint16 colorA0, colorA1, colorA2, colorA3; + uint16 colorB0, colorB1, colorB2, colorB3; + uint16 colorS1, colorS2; + uint16 product1a, product1b, product2a, product2b; + + int row0, row1, row2, row3; + int col0, col1, col2, col3; + + for (uint16 y = 0; y < height; y++) + { + if (y > 0) + { + row0 = width; + row0 = -row0; + } + else + row0 = 0; + + row1 = 0; + + if (y < height - 1) + { + row2 = width; + + if (y < height - 2) + row3 = width << 1; + else + row3 = width; + } + else + { + row2 = 0; + row3 = 0; + } + + for (uint16 x = 0; x < width; x++) + { + //--------------------------------------- B0 B1 B2 B3 + // 4 5 6 S2 + // 1 2 3 S1 + // A0 A1 A2 A3 + if (x > 0) + col0 = -1; + else + col0 = 0; + + col1 = 0; + + if (x < width - 1) + { + col2 = 1; + + if (x < width - 2) + col3 = 2; + else + col3 = 1; + } + else + { + col2 = 0; + col3 = 0; + } + + colorB0 = *(srcPtr + col0 + row0); + colorB1 = *(srcPtr + col1 + row0); + colorB2 = *(srcPtr + col2 + row0); + colorB3 = *(srcPtr + col3 + row0); + + color4 = *(srcPtr + col0 + row1); + color5 = *(srcPtr + col1 + row1); + color6 = *(srcPtr + col2 + row1); + colorS2 = *(srcPtr + col3 + row1); + + color1 = *(srcPtr + col0 + row2); + color2 = *(srcPtr + col1 + row2); + color3 = *(srcPtr + col2 + row2); + colorS1 = *(srcPtr + col3 + row2); + + colorA0 = *(srcPtr + col0 + row3); + colorA1 = *(srcPtr + col1 + row3); + colorA2 = *(srcPtr + col2 + row3); + colorA3 = *(srcPtr + col3 + row3); + + //-------------------------------------- + if (color2 == color6 && color5 != color3) + product2b = product1b = color2; + else if (color5 == color3 && color2 != color6) + product2b = product1b = color5; + else if (color5 == color3 && color2 == color6) + { + int r = 0; + + r += SAI_GetResult_16 (color6, color5, color1, colorA1); + r += SAI_GetResult_16 (color6, color5, color4, colorB1); + r += SAI_GetResult_16 (color6, color5, colorA2, colorS1); + r += SAI_GetResult_16 (color6, color5, colorB2, colorS2); + + if (r > 0) + product2b = product1b = color6; + else if (r < 0) + product2b = product1b = color5; + else + product2b = product1b = SAI_INTERPOLATE_16 (color5, color6); + } + else + { + + if (color6 == color3 && color3 == colorA1 && color2 != colorA2 && color3 != colorA0) + product2b = SAI_Q_INTERPOLATE_16 (color3, color3, color3, color2); + else if (color5 == color2 && color2 == colorA2 && colorA1 != color3 && color2 != colorA3) + product2b = SAI_Q_INTERPOLATE_16 (color2, color2, color2, color3); + else + product2b = SAI_INTERPOLATE_16 (color2, color3); + + if (color6 == color3 && color6 == colorB1 && color5 != colorB2 && color6 != colorB0) + product1b = SAI_Q_INTERPOLATE_16 (color6, color6, color6, color5); + else if (color5 == color2 && color5 == colorB2 && colorB1 != color6 && color5 != colorB3) + product1b = SAI_Q_INTERPOLATE_16 (color6, color5, color5, color5); + else + product1b = SAI_INTERPOLATE_16 (color5, color6); + } + + if (color5 == color3 && color2 != color6 && color4 == color5 && color5 != colorA2) + product2a = SAI_INTERPOLATE_16 (color2, color5); + else if (color5 == color1 && color6 == color5 && color4 != color2 && color5 != colorA0) + product2a = SAI_INTERPOLATE_16(color2, color5); + else + product2a = color2; + + if (color2 == color6 && color5 != color3 && color1 == color2 && color2 != colorB2) + product1a = SAI_INTERPOLATE_16 (color2, color5); + else if (color4 == color2 && color3 == color2 && color1 != color5 && color2 != colorB0) + product1a = SAI_INTERPOLATE_16(color2, color5); + else + product1a = color5; + + + destPtr[0] = product1a; + destPtr[1] = product1b; + destPtr[destWidth] = product2a; + destPtr[destWidth + 1] = product2b; + + srcPtr++; + destPtr += 2; + } + srcPtr += (pitch-width); + destPtr += (((pitch-width)<<1)+(pitch<<1)); + } +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/TextureFilters_hq2x.cpp b/libmupen64plus/mupen64plus-video-rice/src/TextureFilters_hq2x.cpp new file mode 100644 index 0000000000..6774f04df8 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/TextureFilters_hq2x.cpp @@ -0,0 +1,846 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - TextureFilters_hq2x.cpp * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2003 MaxSt ( maxst@hiend3d.com ) * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "typedefs.h" + +/************************************************************************/ +/* hq2x filters */ +/************************************************************************/ + +/***************************************************************************/ +/* Basic types */ + +/***************************************************************************/ +/* interpolation */ + +static unsigned interp_bits_per_pixel; + +#define INTERP_16_MASK_1_3(v) ((v)&0x0F0F) +#define INTERP_16_MASK_SHIFT_2_4(v) (((v)&0xF0F0)>>4) +#define INTERP_16_MASK_SHIFTBACK_2_4(v) ((INTERP_16_MASK_1_3(v))<<4) + +static inline uint16 hq2x_interp_16_521(uint16 p1, uint16 p2, uint16 p3) +{ + return INTERP_16_MASK_1_3((INTERP_16_MASK_1_3(p1)*5 + INTERP_16_MASK_1_3(p2)*2 + INTERP_16_MASK_1_3(p3)*1) / 8) + | INTERP_16_MASK_SHIFTBACK_2_4((INTERP_16_MASK_SHIFT_2_4(p1)*5 + INTERP_16_MASK_SHIFT_2_4(p2)*2 + INTERP_16_MASK_SHIFT_2_4(p3)*1) / 8); +} + +static inline uint16 hq2x_interp_16_332(uint16 p1, uint16 p2, uint16 p3) +{ + return INTERP_16_MASK_1_3((INTERP_16_MASK_1_3(p1)*3 + INTERP_16_MASK_1_3(p2)*3 + INTERP_16_MASK_1_3(p3)*2) / 8) + | INTERP_16_MASK_SHIFTBACK_2_4((INTERP_16_MASK_SHIFT_2_4(p1)*3 + INTERP_16_MASK_SHIFT_2_4(p2)*3 + INTERP_16_MASK_SHIFT_2_4(p3)*2) / 8); +} + +static inline uint16 hq2x_interp_16_611(uint16 p1, uint16 p2, uint16 p3) +{ + return INTERP_16_MASK_1_3((INTERP_16_MASK_1_3(p1)*6 + INTERP_16_MASK_1_3(p2) + INTERP_16_MASK_1_3(p3)) / 8) + | INTERP_16_MASK_SHIFTBACK_2_4((INTERP_16_MASK_SHIFT_2_4(p1)*6 + INTERP_16_MASK_SHIFT_2_4(p2) + INTERP_16_MASK_SHIFT_2_4(p3)) / 8); +} + +static inline uint16 hq2x_interp_16_71(uint16 p1, uint16 p2) +{ + return INTERP_16_MASK_1_3((INTERP_16_MASK_1_3(p1)*7 + INTERP_16_MASK_1_3(p2)) / 8) + | INTERP_16_MASK_SHIFTBACK_2_4((INTERP_16_MASK_SHIFT_2_4(p1)*7 + INTERP_16_MASK_SHIFT_2_4(p2)) / 8); +} + +static inline uint16 hq2x_interp_16_211(uint16 p1, uint16 p2, uint16 p3) +{ + return INTERP_16_MASK_1_3((INTERP_16_MASK_1_3(p1)*2 + INTERP_16_MASK_1_3(p2) + INTERP_16_MASK_1_3(p3)) / 4) + | INTERP_16_MASK_SHIFTBACK_2_4((INTERP_16_MASK_SHIFT_2_4(p1)*2 + INTERP_16_MASK_SHIFT_2_4(p2) + INTERP_16_MASK_SHIFT_2_4(p3)) / 4); +} + +static inline uint16 hq2x_interp_16_772(uint16 p1, uint16 p2, uint16 p3) +{ + return INTERP_16_MASK_1_3(((INTERP_16_MASK_1_3(p1) + INTERP_16_MASK_1_3(p2))*7 + INTERP_16_MASK_1_3(p3)*2) / 16) + | INTERP_16_MASK_SHIFTBACK_2_4(((INTERP_16_MASK_SHIFT_2_4(p1) + INTERP_16_MASK_SHIFT_2_4(p2))*7 + INTERP_16_MASK_SHIFT_2_4(p3)*2) / 16); +} + +static inline uint16 hq2x_interp_16_11(uint16 p1, uint16 p2) +{ + return INTERP_16_MASK_1_3((INTERP_16_MASK_1_3(p1) + INTERP_16_MASK_1_3(p2)) / 2) + | INTERP_16_MASK_SHIFTBACK_2_4((INTERP_16_MASK_SHIFT_2_4(p1) + INTERP_16_MASK_SHIFT_2_4(p2)) / 2); +} + +static inline uint16 hq2x_interp_16_31(uint16 p1, uint16 p2) +{ + return INTERP_16_MASK_1_3((INTERP_16_MASK_1_3(p1)*3 + INTERP_16_MASK_1_3(p2)) / 4) + | INTERP_16_MASK_SHIFTBACK_2_4((INTERP_16_MASK_SHIFT_2_4(p1)*3 + INTERP_16_MASK_SHIFT_2_4(p2)) / 4); +} + +static inline uint16 hq2x_interp_16_1411(uint16 p1, uint16 p2, uint16 p3) +{ + return INTERP_16_MASK_1_3((INTERP_16_MASK_1_3(p1)*14 + INTERP_16_MASK_1_3(p2) + INTERP_16_MASK_1_3(p3)) / 16) + | INTERP_16_MASK_SHIFTBACK_2_4((INTERP_16_MASK_SHIFT_2_4(p1)*14 + INTERP_16_MASK_SHIFT_2_4(p2) + INTERP_16_MASK_SHIFT_2_4(p3)) / 16); +} + +static inline uint16 hq2x_interp_16_431(uint16 p1, uint16 p2, uint16 p3) +{ + return INTERP_16_MASK_1_3((INTERP_16_MASK_1_3(p1)*4 + INTERP_16_MASK_1_3(p2)*3 + INTERP_16_MASK_1_3(p3)) / 8) + | INTERP_16_MASK_SHIFTBACK_2_4((INTERP_16_MASK_SHIFT_2_4(p1)*4 + INTERP_16_MASK_SHIFT_2_4(p2)*3 + INTERP_16_MASK_SHIFT_2_4(p3)) / 8); +} + +static inline uint16 hq2x_interp_16_53(uint16 p1, uint16 p2) +{ + return INTERP_16_MASK_1_3((INTERP_16_MASK_1_3(p1)*5 + INTERP_16_MASK_1_3(p2)*3) / 8) + | INTERP_16_MASK_SHIFTBACK_2_4((INTERP_16_MASK_SHIFT_2_4(p1)*5 + INTERP_16_MASK_SHIFT_2_4(p2)*3) / 8); +} + +static inline uint16 hq2x_interp_16_151(uint16 p1, uint16 p2) +{ + return INTERP_16_MASK_1_3((INTERP_16_MASK_1_3(p1)*15 + INTERP_16_MASK_1_3(p2)) / 16) + | INTERP_16_MASK_SHIFTBACK_2_4((INTERP_16_MASK_SHIFT_2_4(p1)*15 + INTERP_16_MASK_SHIFT_2_4(p2)) / 16); +} + +static inline uint16 hq2x_interp_16_97(uint16 p1, uint16 p2) +{ + return INTERP_16_MASK_1_3((INTERP_16_MASK_1_3(p1)*9 + INTERP_16_MASK_1_3(p2)*7) / 16) + | INTERP_16_MASK_SHIFTBACK_2_4((INTERP_16_MASK_SHIFT_2_4(p1)*9 + INTERP_16_MASK_SHIFT_2_4(p2)*7) / 16); +} + +#define INTERP_32_MASK_1_3(v) ((v)&0x00FF00FF) +#define INTERP_32_MASK_SHIFT_2_4(v) (((v)&0xFF00FF00)>>8) +#define INTERP_32_MASK_SHIFTBACK_2_4(v) (((INTERP_32_MASK_1_3(v))<<8)) + +static inline uint32 hq2x_interp_32_521(uint32 p1, uint32 p2, uint32 p3) +{ + return INTERP_32_MASK_1_3((INTERP_32_MASK_1_3(p1)*5 + INTERP_32_MASK_1_3(p2)*2 + INTERP_32_MASK_1_3(p3)*1) / 8) + | INTERP_32_MASK_SHIFTBACK_2_4((INTERP_32_MASK_SHIFT_2_4(p1)*5 + INTERP_32_MASK_SHIFT_2_4(p2)*2 + INTERP_32_MASK_SHIFT_2_4(p3)*1) / 8); +} + +static inline uint32 hq2x_interp_32_332(uint32 p1, uint32 p2, uint32 p3) +{ + return INTERP_32_MASK_1_3((INTERP_32_MASK_1_3(p1)*3 + INTERP_32_MASK_1_3(p2)*3 + INTERP_32_MASK_1_3(p3)*2) / 8) + | INTERP_32_MASK_SHIFTBACK_2_4((INTERP_32_MASK_SHIFT_2_4(p1)*3 + INTERP_32_MASK_SHIFT_2_4(p2)*3 + INTERP_32_MASK_SHIFT_2_4(p3)*2) / 8); +} + +static inline uint32 hq2x_interp_32_211(uint32 p1, uint32 p2, uint32 p3) +{ + return INTERP_32_MASK_1_3((INTERP_32_MASK_1_3(p1)*2 + INTERP_32_MASK_1_3(p2) + INTERP_32_MASK_1_3(p3)) / 4) + | INTERP_32_MASK_SHIFTBACK_2_4((INTERP_32_MASK_SHIFT_2_4(p1)*2 + INTERP_32_MASK_SHIFT_2_4(p2) + INTERP_32_MASK_SHIFT_2_4(p3)) / 4); +} + +static inline uint32 hq2x_interp_32_611(uint32 p1, uint32 p2, uint32 p3) +{ + return INTERP_32_MASK_1_3((INTERP_32_MASK_1_3(p1)*6 + INTERP_32_MASK_1_3(p2) + INTERP_32_MASK_1_3(p3)) / 8) + | INTERP_32_MASK_SHIFTBACK_2_4((INTERP_32_MASK_SHIFT_2_4(p1)*6 + INTERP_32_MASK_SHIFT_2_4(p2) + INTERP_32_MASK_SHIFT_2_4(p3)) / 8); +} + +static inline uint32 hq2x_interp_32_71(uint32 p1, uint32 p2) +{ + return INTERP_32_MASK_1_3((INTERP_32_MASK_1_3(p1)*7 + INTERP_32_MASK_1_3(p2)) / 8) + | INTERP_32_MASK_SHIFTBACK_2_4((INTERP_32_MASK_SHIFT_2_4(p1)*7 + INTERP_32_MASK_SHIFT_2_4(p2)) / 8); +} + +static inline uint32 hq2x_interp_32_772(uint32 p1, uint32 p2, uint32 p3) +{ + return INTERP_32_MASK_1_3(((INTERP_32_MASK_1_3(p1) + INTERP_32_MASK_1_3(p2))*7 + INTERP_32_MASK_1_3(p3)*2) / 16) + | INTERP_32_MASK_SHIFTBACK_2_4(((INTERP_32_MASK_SHIFT_2_4(p1) + INTERP_32_MASK_SHIFT_2_4(p2))*7 + INTERP_32_MASK_SHIFT_2_4(p3)*2) / 16); +} + +static inline uint32 hq2x_interp_32_11(uint32 p1, uint32 p2) +{ + return INTERP_32_MASK_1_3((INTERP_32_MASK_1_3(p1) + INTERP_32_MASK_1_3(p2)) / 2) + | INTERP_32_MASK_SHIFTBACK_2_4((INTERP_32_MASK_SHIFT_2_4(p1) + INTERP_32_MASK_SHIFT_2_4(p2)) / 2); +} + +static inline uint32 hq2x_interp_32_31(uint32 p1, uint32 p2) +{ + return INTERP_32_MASK_1_3((INTERP_32_MASK_1_3(p1)*3 + INTERP_32_MASK_1_3(p2)) / 4) + | INTERP_32_MASK_SHIFTBACK_2_4((INTERP_32_MASK_SHIFT_2_4(p1)*3 + INTERP_32_MASK_SHIFT_2_4(p2)) / 4); +} + +static inline uint32 hq2x_interp_32_1411(uint32 p1, uint32 p2, uint32 p3) +{ + return INTERP_32_MASK_1_3((INTERP_32_MASK_1_3(p1)*14 + INTERP_32_MASK_1_3(p2) + INTERP_32_MASK_1_3(p3)) / 16) + | INTERP_32_MASK_SHIFTBACK_2_4((INTERP_32_MASK_SHIFT_2_4(p1)*14 + INTERP_32_MASK_SHIFT_2_4(p2) + INTERP_32_MASK_SHIFT_2_4(p3)) / 16); +} + +static inline uint32 hq2x_interp_32_431(uint32 p1, uint32 p2, uint32 p3) +{ + return INTERP_32_MASK_1_3((INTERP_32_MASK_1_3(p1)*4 + INTERP_32_MASK_1_3(p2)*3 + INTERP_32_MASK_1_3(p3)) / 8) + | INTERP_32_MASK_SHIFTBACK_2_4((INTERP_32_MASK_SHIFT_2_4(p1)*4 + INTERP_32_MASK_SHIFT_2_4(p2)*3 + INTERP_32_MASK_SHIFT_2_4(p3)) / 8); +} + +static inline uint32 hq2x_interp_32_53(uint32 p1, uint32 p2) +{ + return INTERP_32_MASK_1_3((INTERP_32_MASK_1_3(p1)*5 + INTERP_32_MASK_1_3(p2)*3) / 8) + | INTERP_32_MASK_SHIFTBACK_2_4((INTERP_32_MASK_SHIFT_2_4(p1)*5 + INTERP_32_MASK_SHIFT_2_4(p2)*3) / 8); +} + +static inline uint32 hq2x_interp_32_151(uint32 p1, uint32 p2) +{ + return INTERP_32_MASK_1_3((INTERP_32_MASK_1_3(p1)*15 + INTERP_32_MASK_1_3(p2)) / 16) + | INTERP_32_MASK_SHIFTBACK_2_4((INTERP_32_MASK_SHIFT_2_4(p1)*15 + INTERP_32_MASK_SHIFT_2_4(p2)) / 16); +} + +static inline uint32 hq2x_interp_32_97(uint32 p1, uint32 p2) +{ + return INTERP_32_MASK_1_3((INTERP_32_MASK_1_3(p1)*9 + INTERP_32_MASK_1_3(p2)*7) / 16) + | INTERP_32_MASK_SHIFTBACK_2_4((INTERP_32_MASK_SHIFT_2_4(p1)*9 + INTERP_32_MASK_SHIFT_2_4(p2)*7) / 16); +} + +/***************************************************************************/ +/* diff */ + +#define INTERP_Y_LIMIT (0x30*4) +#define INTERP_U_LIMIT (0x07*4) +#define INTERP_V_LIMIT (0x06*8) + +static int hq2x_interp_16_diff(uint16 p1, uint16 p2) +{ + int r, g, b; + int y, u, v; + + if (p1 == p2) + return 0; + + b = (int)((p1 & 0x000F) - (p2 & 0x000F)); + g = (int)((p1 & 0x00F0) - (p2 & 0x00F0)) >> 4; + r = (int)((p1 & 0x0F00) - (p2 & 0x0F00)) >> 8; + + y = r + g + b; + u = r - b; + v = -r + 2*g - b; + + if (y < -INTERP_Y_LIMIT || y > INTERP_Y_LIMIT) + return 1; + + if (u < -INTERP_U_LIMIT || u > INTERP_U_LIMIT) + return 1; + + if (v < -INTERP_V_LIMIT || v > INTERP_V_LIMIT) + return 1; + + return 0; +} + +static int hq2x_interp_32_diff(uint32 p1, uint32 p2) +{ + int r, g, b; + int y, u, v; + + if ((p1 & 0xF8F8F8) == (p2 & 0xF8F8F8)) + return 0; + + b = (int)((p1 & 0xFF) - (p2 & 0xFF)); + g = (int)((p1 & 0xFF00) - (p2 & 0xFF00)) >> 8; + r = (int)((p1 & 0xFF0000) - (p2 & 0xFF0000)) >> 16; + + y = r + g + b; + u = r - b; + v = -r + 2*g - b; + + if (y < -INTERP_Y_LIMIT || y > INTERP_Y_LIMIT) + return 1; + + if (u < -INTERP_U_LIMIT || u > INTERP_U_LIMIT) + return 1; + + if (v < -INTERP_V_LIMIT || v > INTERP_V_LIMIT) + return 1; + + return 0; +} + +static void interp_set(unsigned bits_per_pixel) +{ + interp_bits_per_pixel = bits_per_pixel; +} + + +static void hq2x_16_def(uint16* dst0, uint16* dst1, const uint16* src0, const uint16* src1, const uint16* src2, unsigned count) +{ + unsigned i; + + for(i=0;i0) { + c[0] = src0[-1]; + c[3] = src1[-1]; + c[6] = src2[-1]; + } else { + c[0] = c[1]; + c[3] = c[4]; + c[6] = c[7]; + } + + if (i0) { + c[0] = src0[-1]; + c[3] = src1[-1]; + c[6] = src2[-1]; + } else { + c[0] = src0[0]; + c[3] = src1[0]; + c[6] = src2[0]; + } + + if (i0) { + c[0] = src0[-1]; + c[3] = src1[-1]; + c[6] = src2[-1]; + } else { + c[0] = c[1]; + c[3] = c[4]; + c[6] = c[7]; + } + + if (i0) { + c[0] = src0[-1]; + c[3] = src1[-1]; + c[6] = src2[-1]; + } else { + c[0] = c[1]; + c[3] = c[4]; + c[6] = c[7]; + } + + if (i> 1); + + uint16 *src0 = (uint16 *)srcPtr; + uint16 *src1 = src0 + (srcPitch >> 1); + uint16 *src2 = src1 + (srcPitch >> 1); + + hq2x_16_def(dst0, dst1, src0, src0, src1, width); + if( height == 1 ) return; + + int count = height; + + count -= 2; + while(count>0) { + dst0 += dstPitch; + dst1 += dstPitch; + hq2x_16_def(dst0, dst1, src0, src1, src2, width); + src0 = src1; + src1 = src2; + src2 += srcPitch >> 1; + --count; + } + dst0 += dstPitch; + dst1 += dstPitch; + hq2x_16_def(dst0, dst1, src0, src1, src1, width); +} + +void hq2x_32(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) +{ + uint32 *dst0 = (uint32 *)dstPtr; + uint32 *dst1 = dst0 + (dstPitch >> 2); + + uint32 *src0 = (uint32 *)srcPtr; + uint32 *src1 = src0 + (srcPitch >> 2); + uint32 *src2 = src1 + (srcPitch >> 2); + hq2x_32_def(dst0, dst1, src0, src0, src1, width); + if( height == 1 ) return; + + int count = height; + + count -= 2; + while(count>0) { + dst0 += dstPitch >> 1; + dst1 += dstPitch >> 1; + hq2x_32_def(dst0, dst1, src0, src1, src2, width); + src0 = src1; + src1 = src2; + src2 += srcPitch >> 2; + --count; + } + dst0 += dstPitch >> 1; + dst1 += dstPitch >> 1; + hq2x_32_def(dst0, dst1, src0, src1, src1, width); +} + +void lq2x_16(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) +{ + uint16 *dst0 = (uint16 *)dstPtr; + uint16 *dst1 = dst0 + (dstPitch >> 1); + + uint16 *src0 = (uint16 *)srcPtr; + uint16 *src1 = src0 + (srcPitch >> 1); + uint16 *src2 = src1 + (srcPitch >> 1); + + lq2x_16_def(dst0, dst1, src0, src0, src1, width); + if( height == 1 ) return; + + int count = height; + + count -= 2; + while(count>0) { + dst0 += dstPitch; + dst1 += dstPitch; + hq2x_16_def(dst0, dst1, src0, src1, src2, width); + src0 = src1; + src1 = src2; + src2 += srcPitch >> 1; + --count; + } + dst0 += dstPitch; + dst1 += dstPitch; + lq2x_16_def(dst0, dst1, src0, src1, src1, width); +} + +void lq2x_32(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) +{ + uint32 *dst0 = (uint32 *)dstPtr; + uint32 *dst1 = dst0 + (dstPitch >> 2); + + uint32 *src0 = (uint32 *)srcPtr; + uint32 *src1 = src0 + (srcPitch >> 2); + uint32 *src2 = src1 + (srcPitch >> 2); + lq2x_32_def(dst0, dst1, src0, src0, src1, width); + if( height == 1 ) return; + + int count = height; + + count -= 2; + while(count>0) { + dst0 += dstPitch >> 1; + dst1 += dstPitch >> 1; + hq2x_32_def(dst0, dst1, src0, src1, src2, width); + src0 = src1; + src1 = src2; + src2 += srcPitch >> 2; + --count; + } + dst0 += dstPitch >> 1; + dst1 += dstPitch >> 1; + lq2x_32_def(dst0, dst1, src0, src1, src1, width); +} + +void hq2x_init(unsigned bits_per_pixel) +{ + interp_set(bits_per_pixel); +} + +/************************************************************************/ +/* hq3x filters */ +/************************************************************************/ + +/************************************************************************/ +/* scale2x filters */ +/************************************************************************/ + +/************************************************************************/ +/* scale3x filters */ +/************************************************************************/ + diff --git a/libmupen64plus/mupen64plus-video-rice/src/TextureFilters_hq2x.h b/libmupen64plus/mupen64plus-video-rice/src/TextureFilters_hq2x.h new file mode 100644 index 0000000000..bf81408c31 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/TextureFilters_hq2x.h @@ -0,0 +1,1846 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - TextureFilters_hq2x.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2003 Rice1964 * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +case 0 : +case 1 : +case 4 : +case 5 : +case 32 : +case 33 : +case 36 : +case 37 : +case 128 : +case 129 : +case 132 : +case 133 : +case 160 : +case 161 : +case 164 : +case 165 : +{ + P0 = I211(4, 1, 3); + P1 = I211(4, 1, 5); + P2 = I211(4, 3, 7); + P3 = I211(4, 5, 7); +} break; +case 2 : +case 34 : +case 130 : +case 162 : +{ + P0 = I31(4, 0); + P1 = I31(4, 2); + P2 = I211(4, 3, 7); + P3 = I211(4, 5, 7); +} break; +case 3 : +case 35 : +case 131 : +case 163 : +{ + P0 = I31(4, 3); + P1 = I31(4, 2); + P2 = I211(4, 3, 7); + P3 = I211(4, 5, 7); +} break; +case 6 : +case 38 : +case 134 : +case 166 : +{ + P0 = I31(4, 0); + P1 = I31(4, 5); + P2 = I211(4, 3, 7); + P3 = I211(4, 5, 7); +} break; +case 7 : +case 39 : +case 135 : +case 167 : +{ + P0 = I31(4, 3); + P1 = I31(4, 5); + P2 = I211(4, 3, 7); + P3 = I211(4, 5, 7); +} break; +case 8 : +case 12 : +case 136 : +case 140 : +{ + P0 = I31(4, 0); + P1 = I211(4, 1, 5); + P2 = I31(4, 6); + P3 = I211(4, 5, 7); +} break; +case 9 : +case 13 : +case 137 : +case 141 : +{ + P0 = I31(4, 1); + P1 = I211(4, 1, 5); + P2 = I31(4, 6); + P3 = I211(4, 5, 7); +} break; +case 10 : +case 138 : +{ + P1 = I31(4, 2); + P2 = I31(4, 6); + P3 = I211(4, 5, 7); + if (HQ2X_MUL) { + P0 = I31(4, 0); + } else { + P0 = I211(4, 1, 3); + } +} break; +case 11 : +case 139 : +{ + P1 = I31(4, 2); + P2 = I31(4, 6); + P3 = I211(4, 5, 7); + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I211(4, 1, 3); + } +} break; +case 14 : +case 142 : +{ + P2 = I31(4, 6); + P3 = I211(4, 5, 7); + if (HQ2X_MUL) { + P0 = I31(4, 0); + P1 = I31(4, 5); + } else { + P0 = I332(1, 3, 4); + P1 = I521(4, 1, 5); + } +} break; +case 15 : +case 143 : +{ + P2 = I31(4, 6); + P3 = I211(4, 5, 7); + if (HQ2X_MUL) { + P0 = IC(4); + P1 = I31(4, 5); + } else { + P0 = I332(1, 3, 4); + P1 = I521(4, 1, 5); + } +} break; +case 16 : +case 17 : +case 48 : +case 49 : +{ + P0 = I211(4, 1, 3); + P1 = I31(4, 2); + P2 = I211(4, 3, 7); + P3 = I31(4, 8); +} break; +case 18 : +case 50 : +{ + P0 = I31(4, 0); + P2 = I211(4, 3, 7); + P3 = I31(4, 8); + if (HQ2X_MUR) { + P1 = I31(4, 2); + } else { + P1 = I211(4, 1, 5); + } +} break; +case 19 : +case 51 : +{ + P2 = I211(4, 3, 7); + P3 = I31(4, 8); + if (HQ2X_MUR) { + P0 = I31(4, 3); + P1 = I31(4, 2); + } else { + P0 = I521(4, 1, 3); + P1 = I332(1, 5, 4); + } +} break; +case 20 : +case 21 : +case 52 : +case 53 : +{ + P0 = I211(4, 1, 3); + P1 = I31(4, 1); + P2 = I211(4, 3, 7); + P3 = I31(4, 8); +} break; +case 22 : +case 54 : +{ + P0 = I31(4, 0); + P2 = I211(4, 3, 7); + P3 = I31(4, 8); + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I211(4, 1, 5); + } +} break; +case 23 : +case 55 : +{ + P2 = I211(4, 3, 7); + P3 = I31(4, 8); + if (HQ2X_MUR) { + P0 = I31(4, 3); + P1 = IC(4); + } else { + P0 = I521(4, 1, 3); + P1 = I332(1, 5, 4); + } +} break; +case 24 : +case 66 : +{ + P0 = I31(4, 0); + P1 = I31(4, 2); + P2 = I31(4, 6); + P3 = I31(4, 8); +} break; +case 25 : +{ + P0 = I31(4, 1); + P1 = I31(4, 2); + P2 = I31(4, 6); + P3 = I31(4, 8); +} break; +case 26 : +case 31 : +case 95 : +{ + P2 = I31(4, 6); + P3 = I31(4, 8); + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I211(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I211(4, 1, 5); + } +} break; +case 27 : +case 75 : +{ + P1 = I31(4, 2); + P2 = I31(4, 6); + P3 = I31(4, 8); + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I211(4, 1, 3); + } +} break; +case 28 : +{ + P0 = I31(4, 0); + P1 = I31(4, 1); + P2 = I31(4, 6); + P3 = I31(4, 8); +} break; +case 29 : +{ + P0 = I31(4, 1); + P1 = I31(4, 1); + P2 = I31(4, 6); + P3 = I31(4, 8); +} break; +case 30 : +case 86 : +{ + P0 = I31(4, 0); + P2 = I31(4, 6); + P3 = I31(4, 8); + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I211(4, 1, 5); + } +} break; +case 40 : +case 44 : +case 168 : +case 172 : +{ + P0 = I31(4, 0); + P1 = I211(4, 1, 5); + P2 = I31(4, 7); + P3 = I211(4, 5, 7); +} break; +case 41 : +case 45 : +case 169 : +case 173 : +{ + P0 = I31(4, 1); + P1 = I211(4, 1, 5); + P2 = I31(4, 7); + P3 = I211(4, 5, 7); +} break; +case 42 : +case 170 : +{ + P1 = I31(4, 2); + P3 = I211(4, 5, 7); + if (HQ2X_MUL) { + P0 = I31(4, 0); + P2 = I31(4, 7); + } else { + P0 = I332(1, 3, 4); + P2 = I521(4, 3, 7); + } +} break; +case 43 : +case 171 : +{ + P1 = I31(4, 2); + P3 = I211(4, 5, 7); + if (HQ2X_MUL) { + P0 = IC(4); + P2 = I31(4, 7); + } else { + P0 = I332(1, 3, 4); + P2 = I521(4, 3, 7); + } +} break; +case 46 : +case 174 : +{ + P1 = I31(4, 5); + P2 = I31(4, 7); + P3 = I211(4, 5, 7); + if (HQ2X_MUL) { + P0 = I31(4, 0); + } else { + P0 = I611(4, 1, 3); + } +} break; +case 47 : +case 175 : +{ + P1 = I31(4, 5); + P2 = I31(4, 7); + P3 = I211(4, 5, 7); + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I1411(4, 1, 3); + } +} break; +case 56 : +{ + P0 = I31(4, 0); + P1 = I31(4, 2); + P2 = I31(4, 7); + P3 = I31(4, 8); +} break; +case 57 : +{ + P0 = I31(4, 1); + P1 = I31(4, 2); + P2 = I31(4, 7); + P3 = I31(4, 8); +} break; +case 58 : +{ + P2 = I31(4, 7); + P3 = I31(4, 8); + if (HQ2X_MUL) { + P0 = I31(4, 0); + } else { + P0 = I611(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = I31(4, 2); + } else { + P1 = I611(4, 1, 5); + } +} break; +case 59 : +{ + P2 = I31(4, 7); + P3 = I31(4, 8); + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I211(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = I31(4, 2); + } else { + P1 = I611(4, 1, 5); + } +} break; +case 60 : +{ + P0 = I31(4, 0); + P1 = I31(4, 1); + P2 = I31(4, 7); + P3 = I31(4, 8); +} break; +case 61 : +{ + P0 = I31(4, 1); + P1 = I31(4, 1); + P2 = I31(4, 7); + P3 = I31(4, 8); +} break; +case 62 : +{ + P0 = I31(4, 0); + P2 = I31(4, 7); + P3 = I31(4, 8); + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I211(4, 1, 5); + } +} break; +case 63 : +{ + P2 = I31(4, 7); + P3 = I31(4, 8); + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I1411(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I211(4, 1, 5); + } +} break; +case 64 : +case 65 : +case 68 : +case 69 : +{ + P0 = I211(4, 1, 3); + P1 = I211(4, 1, 5); + P2 = I31(4, 6); + P3 = I31(4, 8); +} break; +case 67 : +{ + P0 = I31(4, 3); + P1 = I31(4, 2); + P2 = I31(4, 6); + P3 = I31(4, 8); +} break; +case 70 : +{ + P0 = I31(4, 0); + P1 = I31(4, 5); + P2 = I31(4, 6); + P3 = I31(4, 8); +} break; +case 71 : +{ + P0 = I31(4, 3); + P1 = I31(4, 5); + P2 = I31(4, 6); + P3 = I31(4, 8); +} break; +case 72 : +case 76 : +{ + P0 = I31(4, 0); + P1 = I211(4, 1, 5); + P3 = I31(4, 8); + if (HQ2X_MDL) { + P2 = I31(4, 6); + } else { + P2 = I211(4, 3, 7); + } +} break; +case 73 : +case 77 : +{ + P1 = I211(4, 1, 5); + P3 = I31(4, 8); + if (HQ2X_MDL) { + P0 = I31(4, 1); + P2 = I31(4, 6); + } else { + P0 = I521(4, 3, 1); + P2 = I332(3, 7, 4); + } +} break; +case 74 : +case 107 : +case 123 : +{ + P1 = I31(4, 2); + P3 = I31(4, 8); + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I211(4, 3, 7); + } + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I211(4, 1, 3); + } +} break; +case 78 : +{ + P1 = I31(4, 5); + P3 = I31(4, 8); + if (HQ2X_MDL) { + P2 = I31(4, 6); + } else { + P2 = I611(4, 3, 7); + } + if (HQ2X_MUL) { + P0 = I31(4, 0); + } else { + P0 = I611(4, 1, 3); + } +} break; +case 79 : +{ + P1 = I31(4, 5); + P3 = I31(4, 8); + if (HQ2X_MDL) { + P2 = I31(4, 6); + } else { + P2 = I611(4, 3, 7); + } + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I211(4, 1, 3); + } +} break; +case 80 : +case 81 : +{ + P0 = I211(4, 1, 3); + P1 = I31(4, 2); + P2 = I31(4, 6); + if (HQ2X_MDR) { + P3 = I31(4, 8); + } else { + P3 = I211(4, 5, 7); + } +} break; +case 82 : +case 214 : +case 222 : +{ + P0 = I31(4, 0); + P2 = I31(4, 6); + if (HQ2X_MDR) { + P3 = IC(4); + } else { + P3 = I211(4, 5, 7); + } + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I211(4, 1, 5); + } +} break; +case 83 : +{ + P0 = I31(4, 3); + P2 = I31(4, 6); + if (HQ2X_MDR) { + P3 = I31(4, 8); + } else { + P3 = I611(4, 5, 7); + } + if (HQ2X_MUR) { + P1 = I31(4, 2); + } else { + P1 = I611(4, 1, 5); + } +} break; +case 84 : +case 85 : +{ + P0 = I211(4, 1, 3); + P2 = I31(4, 6); + if (HQ2X_MDR) { + P1 = I31(4, 1); + P3 = I31(4, 8); + } else { + P1 = I521(4, 5, 1); + P3 = I332(5, 7, 4); + } +} break; +case 87 : +{ + P0 = I31(4, 3); + P2 = I31(4, 6); + if (HQ2X_MDR) { + P3 = I31(4, 8); + } else { + P3 = I611(4, 5, 7); + } + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I211(4, 1, 5); + } +} break; +case 88 : +case 248 : +case 250 : +{ + P0 = I31(4, 0); + P1 = I31(4, 2); + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I211(4, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(4); + } else { + P3 = I211(4, 5, 7); + } +} break; +case 89 : +{ + P0 = I31(4, 1); + P1 = I31(4, 2); + if (HQ2X_MDL) { + P2 = I31(4, 6); + } else { + P2 = I611(4, 3, 7); + } + if (HQ2X_MDR) { + P3 = I31(4, 8); + } else { + P3 = I611(4, 5, 7); + } +} break; +case 90 : +{ + if (HQ2X_MDL) { + P2 = I31(4, 6); + } else { + P2 = I611(4, 3, 7); + } + if (HQ2X_MDR) { + P3 = I31(4, 8); + } else { + P3 = I611(4, 5, 7); + } + if (HQ2X_MUL) { + P0 = I31(4, 0); + } else { + P0 = I611(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = I31(4, 2); + } else { + P1 = I611(4, 1, 5); + } +} break; +case 91 : +{ + if (HQ2X_MDL) { + P2 = I31(4, 6); + } else { + P2 = I611(4, 3, 7); + } + if (HQ2X_MDR) { + P3 = I31(4, 8); + } else { + P3 = I611(4, 5, 7); + } + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I211(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = I31(4, 2); + } else { + P1 = I611(4, 1, 5); + } +} break; +case 92 : +{ + P0 = I31(4, 0); + P1 = I31(4, 1); + if (HQ2X_MDL) { + P2 = I31(4, 6); + } else { + P2 = I611(4, 3, 7); + } + if (HQ2X_MDR) { + P3 = I31(4, 8); + } else { + P3 = I611(4, 5, 7); + } +} break; +case 93 : +{ + P0 = I31(4, 1); + P1 = I31(4, 1); + if (HQ2X_MDL) { + P2 = I31(4, 6); + } else { + P2 = I611(4, 3, 7); + } + if (HQ2X_MDR) { + P3 = I31(4, 8); + } else { + P3 = I611(4, 5, 7); + } +} break; +case 94 : +{ + if (HQ2X_MDL) { + P2 = I31(4, 6); + } else { + P2 = I611(4, 3, 7); + } + if (HQ2X_MDR) { + P3 = I31(4, 8); + } else { + P3 = I611(4, 5, 7); + } + if (HQ2X_MUL) { + P0 = I31(4, 0); + } else { + P0 = I611(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I211(4, 1, 5); + } +} break; +case 96 : +case 97 : +case 100 : +case 101 : +{ + P0 = I211(4, 1, 3); + P1 = I211(4, 1, 5); + P2 = I31(4, 3); + P3 = I31(4, 8); +} break; +case 98 : +{ + P0 = I31(4, 0); + P1 = I31(4, 2); + P2 = I31(4, 3); + P3 = I31(4, 8); +} break; +case 99 : +{ + P0 = I31(4, 3); + P1 = I31(4, 2); + P2 = I31(4, 3); + P3 = I31(4, 8); +} break; +case 102 : +{ + P0 = I31(4, 0); + P1 = I31(4, 5); + P2 = I31(4, 3); + P3 = I31(4, 8); +} break; +case 103 : +{ + P0 = I31(4, 3); + P1 = I31(4, 5); + P2 = I31(4, 3); + P3 = I31(4, 8); +} break; +case 104 : +case 108 : +{ + P0 = I31(4, 0); + P1 = I211(4, 1, 5); + P3 = I31(4, 8); + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I211(4, 3, 7); + } +} break; +case 105 : +case 109 : +{ + P1 = I211(4, 1, 5); + P3 = I31(4, 8); + if (HQ2X_MDL) { + P0 = I31(4, 1); + P2 = IC(4); + } else { + P0 = I521(4, 3, 1); + P2 = I332(3, 7, 4); + } +} break; +case 106 : +case 120 : +{ + P0 = I31(4, 0); + P1 = I31(4, 2); + P3 = I31(4, 8); + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I211(4, 3, 7); + } +} break; +case 110 : +{ + P0 = I31(4, 0); + P1 = I31(4, 5); + P3 = I31(4, 8); + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I211(4, 3, 7); + } +} break; +case 111 : +{ + P1 = I31(4, 5); + P3 = I31(4, 8); + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I211(4, 3, 7); + } + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I1411(4, 1, 3); + } +} break; +case 112 : +case 113 : +{ + P0 = I211(4, 1, 3); + P1 = I31(4, 2); + if (HQ2X_MDR) { + P2 = I31(4, 3); + P3 = I31(4, 8); + } else { + P2 = I521(4, 7, 3); + P3 = I332(5, 7, 4); + } +} break; +case 114 : +{ + P0 = I31(4, 0); + P2 = I31(4, 3); + if (HQ2X_MDR) { + P3 = I31(4, 8); + } else { + P3 = I611(4, 5, 7); + } + if (HQ2X_MUR) { + P1 = I31(4, 2); + } else { + P1 = I611(4, 1, 5); + } +} break; +case 115 : +{ + P0 = I31(4, 3); + P2 = I31(4, 3); + if (HQ2X_MDR) { + P3 = I31(4, 8); + } else { + P3 = I611(4, 5, 7); + } + if (HQ2X_MUR) { + P1 = I31(4, 2); + } else { + P1 = I611(4, 1, 5); + } +} break; +case 116 : +case 117 : +{ + P0 = I211(4, 1, 3); + P1 = I31(4, 1); + P2 = I31(4, 3); + if (HQ2X_MDR) { + P3 = I31(4, 8); + } else { + P3 = I611(4, 5, 7); + } +} break; +case 118 : +{ + P0 = I31(4, 0); + P2 = I31(4, 3); + P3 = I31(4, 8); + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I211(4, 1, 5); + } +} break; +case 119 : +{ + P2 = I31(4, 3); + P3 = I31(4, 8); + if (HQ2X_MUR) { + P0 = I31(4, 3); + P1 = IC(4); + } else { + P0 = I521(4, 1, 3); + P1 = I332(1, 5, 4); + } +} break; +case 121 : +{ + P0 = I31(4, 1); + P1 = I31(4, 2); + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I211(4, 3, 7); + } + if (HQ2X_MDR) { + P3 = I31(4, 8); + } else { + P3 = I611(4, 5, 7); + } +} break; +case 122 : +{ + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I211(4, 3, 7); + } + if (HQ2X_MDR) { + P3 = I31(4, 8); + } else { + P3 = I611(4, 5, 7); + } + if (HQ2X_MUL) { + P0 = I31(4, 0); + } else { + P0 = I611(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = I31(4, 2); + } else { + P1 = I611(4, 1, 5); + } +} break; +case 124 : +{ + P0 = I31(4, 0); + P1 = I31(4, 1); + P3 = I31(4, 8); + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I211(4, 3, 7); + } +} break; +case 125 : +{ + P1 = I31(4, 1); + P3 = I31(4, 8); + if (HQ2X_MDL) { + P0 = I31(4, 1); + P2 = IC(4); + } else { + P0 = I521(4, 3, 1); + P2 = I332(3, 7, 4); + } +} break; +case 126 : +{ + P0 = I31(4, 0); + P3 = I31(4, 8); + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I211(4, 3, 7); + } + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I211(4, 1, 5); + } +} break; +case 127 : +{ + P3 = I31(4, 8); + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I211(4, 3, 7); + } + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I1411(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I211(4, 1, 5); + } +} break; +case 144 : +case 145 : +case 176 : +case 177 : +{ + P0 = I211(4, 1, 3); + P1 = I31(4, 2); + P2 = I211(4, 3, 7); + P3 = I31(4, 7); +} break; +case 146 : +case 178 : +{ + P0 = I31(4, 0); + P2 = I211(4, 3, 7); + if (HQ2X_MUR) { + P1 = I31(4, 2); + P3 = I31(4, 7); + } else { + P1 = I332(1, 5, 4); + P3 = I521(4, 5, 7); + } +} break; +case 147 : +case 179 : +{ + P0 = I31(4, 3); + P2 = I211(4, 3, 7); + P3 = I31(4, 7); + if (HQ2X_MUR) { + P1 = I31(4, 2); + } else { + P1 = I611(4, 1, 5); + } +} break; +case 148 : +case 149 : +case 180 : +case 181 : +{ + P0 = I211(4, 1, 3); + P1 = I31(4, 1); + P2 = I211(4, 3, 7); + P3 = I31(4, 7); +} break; +case 150 : +case 182 : +{ + P0 = I31(4, 0); + P2 = I211(4, 3, 7); + if (HQ2X_MUR) { + P1 = IC(4); + P3 = I31(4, 7); + } else { + P1 = I332(1, 5, 4); + P3 = I521(4, 5, 7); + } +} break; +case 151 : +case 183 : +{ + P0 = I31(4, 3); + P2 = I211(4, 3, 7); + P3 = I31(4, 7); + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I1411(4, 1, 5); + } +} break; +case 152 : +{ + P0 = I31(4, 0); + P1 = I31(4, 2); + P2 = I31(4, 6); + P3 = I31(4, 7); +} break; +case 153 : +{ + P0 = I31(4, 1); + P1 = I31(4, 2); + P2 = I31(4, 6); + P3 = I31(4, 7); +} break; +case 154 : +{ + P2 = I31(4, 6); + P3 = I31(4, 7); + if (HQ2X_MUL) { + P0 = I31(4, 0); + } else { + P0 = I611(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = I31(4, 2); + } else { + P1 = I611(4, 1, 5); + } +} break; +case 155 : +{ + P1 = I31(4, 2); + P2 = I31(4, 6); + P3 = I31(4, 7); + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I211(4, 1, 3); + } +} break; +case 156 : +{ + P0 = I31(4, 0); + P1 = I31(4, 1); + P2 = I31(4, 6); + P3 = I31(4, 7); +} break; +case 157 : +{ + P0 = I31(4, 1); + P1 = I31(4, 1); + P2 = I31(4, 6); + P3 = I31(4, 7); +} break; +case 158 : +{ + P2 = I31(4, 6); + P3 = I31(4, 7); + if (HQ2X_MUL) { + P0 = I31(4, 0); + } else { + P0 = I611(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I211(4, 1, 5); + } +} break; +case 159 : +{ + P2 = I31(4, 6); + P3 = I31(4, 7); + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I211(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I1411(4, 1, 5); + } +} break; +case 184 : +{ + P0 = I31(4, 0); + P1 = I31(4, 2); + P2 = I31(4, 7); + P3 = I31(4, 7); +} break; +case 185 : +{ + P0 = I31(4, 1); + P1 = I31(4, 2); + P2 = I31(4, 7); + P3 = I31(4, 7); +} break; +case 186 : +{ + P2 = I31(4, 7); + P3 = I31(4, 7); + if (HQ2X_MUL) { + P0 = I31(4, 0); + } else { + P0 = I611(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = I31(4, 2); + } else { + P1 = I611(4, 1, 5); + } +} break; +case 187 : +{ + P1 = I31(4, 2); + P3 = I31(4, 7); + if (HQ2X_MUL) { + P0 = IC(4); + P2 = I31(4, 7); + } else { + P0 = I332(1, 3, 4); + P2 = I521(4, 3, 7); + } +} break; +case 188 : +{ + P0 = I31(4, 0); + P1 = I31(4, 1); + P2 = I31(4, 7); + P3 = I31(4, 7); +} break; +case 189 : +{ + P0 = I31(4, 1); + P1 = I31(4, 1); + P2 = I31(4, 7); + P3 = I31(4, 7); +} break; +case 190 : +{ + P0 = I31(4, 0); + P2 = I31(4, 7); + if (HQ2X_MUR) { + P1 = IC(4); + P3 = I31(4, 7); + } else { + P1 = I332(1, 5, 4); + P3 = I521(4, 5, 7); + } +} break; +case 191 : +{ + P2 = I31(4, 7); + P3 = I31(4, 7); + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I1411(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I1411(4, 1, 5); + } +} break; +case 192 : +case 193 : +case 196 : +case 197 : +{ + P0 = I211(4, 1, 3); + P1 = I211(4, 1, 5); + P2 = I31(4, 6); + P3 = I31(4, 5); +} break; +case 194 : +{ + P0 = I31(4, 0); + P1 = I31(4, 2); + P2 = I31(4, 6); + P3 = I31(4, 5); +} break; +case 195 : +{ + P0 = I31(4, 3); + P1 = I31(4, 2); + P2 = I31(4, 6); + P3 = I31(4, 5); +} break; +case 198 : +{ + P0 = I31(4, 0); + P1 = I31(4, 5); + P2 = I31(4, 6); + P3 = I31(4, 5); +} break; +case 199 : +{ + P0 = I31(4, 3); + P1 = I31(4, 5); + P2 = I31(4, 6); + P3 = I31(4, 5); +} break; +case 200 : +case 204 : +{ + P0 = I31(4, 0); + P1 = I211(4, 1, 5); + if (HQ2X_MDL) { + P2 = I31(4, 6); + P3 = I31(4, 5); + } else { + P2 = I332(3, 7, 4); + P3 = I521(4, 7, 5); + } +} break; +case 201 : +case 205 : +{ + P0 = I31(4, 1); + P1 = I211(4, 1, 5); + P3 = I31(4, 5); + if (HQ2X_MDL) { + P2 = I31(4, 6); + } else { + P2 = I611(4, 3, 7); + } +} break; +case 202 : +{ + P1 = I31(4, 2); + P3 = I31(4, 5); + if (HQ2X_MDL) { + P2 = I31(4, 6); + } else { + P2 = I611(4, 3, 7); + } + if (HQ2X_MUL) { + P0 = I31(4, 0); + } else { + P0 = I611(4, 1, 3); + } +} break; +case 203 : +{ + P1 = I31(4, 2); + P2 = I31(4, 6); + P3 = I31(4, 5); + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I211(4, 1, 3); + } +} break; +case 206 : +{ + P1 = I31(4, 5); + P3 = I31(4, 5); + if (HQ2X_MDL) { + P2 = I31(4, 6); + } else { + P2 = I611(4, 3, 7); + } + if (HQ2X_MUL) { + P0 = I31(4, 0); + } else { + P0 = I611(4, 1, 3); + } +} break; +case 207 : +{ + P2 = I31(4, 6); + P3 = I31(4, 5); + if (HQ2X_MUL) { + P0 = IC(4); + P1 = I31(4, 5); + } else { + P0 = I332(1, 3, 4); + P1 = I521(4, 1, 5); + } +} break; +case 208 : +case 209 : +{ + P0 = I211(4, 1, 3); + P1 = I31(4, 2); + P2 = I31(4, 6); + if (HQ2X_MDR) { + P3 = IC(4); + } else { + P3 = I211(4, 5, 7); + } +} break; +case 210 : +case 216 : +{ + P0 = I31(4, 0); + P1 = I31(4, 2); + P2 = I31(4, 6); + if (HQ2X_MDR) { + P3 = IC(4); + } else { + P3 = I211(4, 5, 7); + } +} break; +case 211 : +{ + P0 = I31(4, 3); + P1 = I31(4, 2); + P2 = I31(4, 6); + if (HQ2X_MDR) { + P3 = IC(4); + } else { + P3 = I211(4, 5, 7); + } +} break; +case 212 : +case 213 : +{ + P0 = I211(4, 1, 3); + P2 = I31(4, 6); + if (HQ2X_MDR) { + P1 = I31(4, 1); + P3 = IC(4); + } else { + P1 = I521(4, 5, 1); + P3 = I332(5, 7, 4); + } +} break; +case 215 : +{ + P0 = I31(4, 3); + P2 = I31(4, 6); + if (HQ2X_MDR) { + P3 = IC(4); + } else { + P3 = I211(4, 5, 7); + } + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I1411(4, 1, 5); + } +} break; +case 217 : +{ + P0 = I31(4, 1); + P1 = I31(4, 2); + P2 = I31(4, 6); + if (HQ2X_MDR) { + P3 = IC(4); + } else { + P3 = I211(4, 5, 7); + } +} break; +case 218 : +{ + if (HQ2X_MDL) { + P2 = I31(4, 6); + } else { + P2 = I611(4, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(4); + } else { + P3 = I211(4, 5, 7); + } + if (HQ2X_MUL) { + P0 = I31(4, 0); + } else { + P0 = I611(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = I31(4, 2); + } else { + P1 = I611(4, 1, 5); + } +} break; +case 219 : +{ + P1 = I31(4, 2); + P2 = I31(4, 6); + if (HQ2X_MDR) { + P3 = IC(4); + } else { + P3 = I211(4, 5, 7); + } + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I211(4, 1, 3); + } +} break; +case 220 : +{ + P0 = I31(4, 0); + P1 = I31(4, 1); + if (HQ2X_MDL) { + P2 = I31(4, 6); + } else { + P2 = I611(4, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(4); + } else { + P3 = I211(4, 5, 7); + } +} break; +case 221 : +{ + P0 = I31(4, 1); + P2 = I31(4, 6); + if (HQ2X_MDR) { + P1 = I31(4, 1); + P3 = IC(4); + } else { + P1 = I521(4, 5, 1); + P3 = I332(5, 7, 4); + } +} break; +case 223 : +{ + P2 = I31(4, 6); + if (HQ2X_MDR) { + P3 = IC(4); + } else { + P3 = I211(4, 5, 7); + } + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I211(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I1411(4, 1, 5); + } +} break; +case 224 : +case 225 : +case 228 : +case 229 : +{ + P0 = I211(4, 1, 3); + P1 = I211(4, 1, 5); + P2 = I31(4, 3); + P3 = I31(4, 5); +} break; +case 226 : +{ + P0 = I31(4, 0); + P1 = I31(4, 2); + P2 = I31(4, 3); + P3 = I31(4, 5); +} break; +case 227 : +{ + P0 = I31(4, 3); + P1 = I31(4, 2); + P2 = I31(4, 3); + P3 = I31(4, 5); +} break; +case 230 : +{ + P0 = I31(4, 0); + P1 = I31(4, 5); + P2 = I31(4, 3); + P3 = I31(4, 5); +} break; +case 231 : +{ + P0 = I31(4, 3); + P1 = I31(4, 5); + P2 = I31(4, 3); + P3 = I31(4, 5); +} break; +case 232 : +case 236 : +{ + P0 = I31(4, 0); + P1 = I211(4, 1, 5); + if (HQ2X_MDL) { + P2 = IC(4); + P3 = I31(4, 5); + } else { + P2 = I332(3, 7, 4); + P3 = I521(4, 7, 5); + } +} break; +case 233 : +case 237 : +{ + P0 = I31(4, 1); + P1 = I211(4, 1, 5); + P3 = I31(4, 5); + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I1411(4, 3, 7); + } +} break; +case 234 : +{ + P1 = I31(4, 2); + P3 = I31(4, 5); + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I211(4, 3, 7); + } + if (HQ2X_MUL) { + P0 = I31(4, 0); + } else { + P0 = I611(4, 1, 3); + } +} break; +case 235 : +{ + P1 = I31(4, 2); + P3 = I31(4, 5); + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I1411(4, 3, 7); + } + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I211(4, 1, 3); + } +} break; +case 238 : +{ + P0 = I31(4, 0); + P1 = I31(4, 5); + if (HQ2X_MDL) { + P2 = IC(4); + P3 = I31(4, 5); + } else { + P2 = I332(3, 7, 4); + P3 = I521(4, 7, 5); + } +} break; +case 239 : +{ + P1 = I31(4, 5); + P3 = I31(4, 5); + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I1411(4, 3, 7); + } + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I1411(4, 1, 3); + } +} break; +case 240 : +case 241 : +{ + P0 = I211(4, 1, 3); + P1 = I31(4, 2); + if (HQ2X_MDR) { + P2 = I31(4, 3); + P3 = IC(4); + } else { + P2 = I521(4, 7, 3); + P3 = I332(5, 7, 4); + } +} break; +case 242 : +{ + P0 = I31(4, 0); + P2 = I31(4, 3); + if (HQ2X_MDR) { + P3 = IC(4); + } else { + P3 = I211(4, 5, 7); + } + if (HQ2X_MUR) { + P1 = I31(4, 2); + } else { + P1 = I611(4, 1, 5); + } +} break; +case 243 : +{ + P0 = I31(4, 3); + P1 = I31(4, 2); + if (HQ2X_MDR) { + P2 = I31(4, 3); + P3 = IC(4); + } else { + P2 = I521(4, 7, 3); + P3 = I332(5, 7, 4); + } +} break; +case 244 : +case 245 : +{ + P0 = I211(4, 1, 3); + P1 = I31(4, 1); + P2 = I31(4, 3); + if (HQ2X_MDR) { + P3 = IC(4); + } else { + P3 = I1411(4, 5, 7); + } +} break; +case 246 : +{ + P0 = I31(4, 0); + P2 = I31(4, 3); + if (HQ2X_MDR) { + P3 = IC(4); + } else { + P3 = I1411(4, 5, 7); + } + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I211(4, 1, 5); + } +} break; +case 247 : +{ + P0 = I31(4, 3); + P2 = I31(4, 3); + if (HQ2X_MDR) { + P3 = IC(4); + } else { + P3 = I1411(4, 5, 7); + } + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I1411(4, 1, 5); + } +} break; +case 249 : +{ + P0 = I31(4, 1); + P1 = I31(4, 2); + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I1411(4, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(4); + } else { + P3 = I211(4, 5, 7); + } +} break; +case 251 : +{ + P1 = I31(4, 2); + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I1411(4, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(4); + } else { + P3 = I211(4, 5, 7); + } + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I211(4, 1, 3); + } +} break; +case 252 : +{ + P0 = I31(4, 0); + P1 = I31(4, 1); + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I211(4, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(4); + } else { + P3 = I1411(4, 5, 7); + } +} break; +case 253 : +{ + P0 = I31(4, 1); + P1 = I31(4, 1); + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I1411(4, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(4); + } else { + P3 = I1411(4, 5, 7); + } +} break; +case 254 : +{ + P0 = I31(4, 0); + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I211(4, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(4); + } else { + P3 = I1411(4, 5, 7); + } + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I211(4, 1, 5); + } +} break; +case 255 : +{ + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I1411(4, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(4); + } else { + P3 = I1411(4, 5, 7); + } + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I1411(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I1411(4, 1, 5); + } +} break; + diff --git a/libmupen64plus/mupen64plus-video-rice/src/TextureFilters_hq4x.cpp b/libmupen64plus/mupen64plus-video-rice/src/TextureFilters_hq4x.cpp new file mode 100644 index 0000000000..4045d77190 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/TextureFilters_hq4x.cpp @@ -0,0 +1,578 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - TextureFilters_hq4x.cpp * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2003 MaxSt ( maxst@hiend3d.com ) * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "typedefs.h" + +static int RGBtoYUV[4096]; +//#define RGB32toYUV(val) (RGBtoYUV[((val&0x00FF0000)>>20)+((val&0x0000FF00)>>12)+((val&0x000000FF)>>4)]) +inline int RGB32toYUV(uint32 val) +{ + int a,r,g,b,Y,u,v; + //r = (val&0x00FF0000)>>16; + //g = (val&0x0000FF00)>>8; + //b = (val&0x000000FF); + a = (val&0xFF000000); + r = (val&0x00FF0000)>>16; + g = (val&0x0000FF00)>>8; + b = (val&0x000000FF); + //r = (val&0x00F80000)>>16; + //g = (val&0x0000FC00)>>8; + //b = (val&0x000000F8); + Y = (r + g + b) >> 2; + u = 128 + ((r - b) >> 2); + v = 128 + ((-r + 2*g -b)>>3); + return a + (Y<<16) + (u<<8) + v; +} +#define RGB16toYUV(val) (RGBtoYUV[(val&0x0FFF)]) +static int YUV1, YUV2; +const int Amask = 0xFF000000; +const int Ymask = 0x00FF0000; +const int Umask = 0x0000FF00; +const int Vmask = 0x000000FF; +const int trA = 0x20000000; +const int trY = 0x00300000; +const int trU = 0x00000700; +const int trV = 0x00000006; +//const int trU = 0x00001800; +//const int trV = 0x00000018; + +#define INTERP_16_MASK_1_3(v) ((v)&0x0F0F) +#define INTERP_16_MASK_SHIFT_2_4(v) (((v)&0xF0F0)>>4) +#define INTERP_16_MASK_SHIFTBACK_2_4(v) ((INTERP_16_MASK_1_3(v))<<4) + +inline void hq4x_Interp1_16(unsigned char * pc, uint16 p1, uint16 p2) +{ + *((uint16*)pc) = INTERP_16_MASK_1_3((INTERP_16_MASK_1_3(p1)*3 + INTERP_16_MASK_1_3(p2)) / 4) + | INTERP_16_MASK_SHIFTBACK_2_4((INTERP_16_MASK_SHIFT_2_4(p1)*3 + INTERP_16_MASK_SHIFT_2_4(p2)) / 4 ); +} + +inline void hq4x_Interp2_16(unsigned char * pc, uint16 p1, uint16 p2, uint16 p3) +{ + *((uint16*)pc) = INTERP_16_MASK_1_3((INTERP_16_MASK_1_3(p1)*2 + INTERP_16_MASK_1_3(p2) + INTERP_16_MASK_1_3(p3)) / 4) + | INTERP_16_MASK_SHIFTBACK_2_4((INTERP_16_MASK_SHIFT_2_4(p1)*2 + INTERP_16_MASK_SHIFT_2_4(p2) + INTERP_16_MASK_SHIFT_2_4(p3)) / 4); +} + +inline void hq4x_Interp3_16(unsigned char * pc, uint16 p1, uint16 p2) +{ + *((uint16*)pc) = INTERP_16_MASK_1_3((INTERP_16_MASK_1_3(p1)*7 + INTERP_16_MASK_1_3(p2)) / 8) + | INTERP_16_MASK_SHIFTBACK_2_4((INTERP_16_MASK_SHIFT_2_4(p1)*7 + INTERP_16_MASK_SHIFT_2_4(p2)) / 8); +} + +inline void hq4x_Interp5_16(unsigned char * pc, uint16 p1, uint16 p2) +{ + *((uint16*)pc) = INTERP_16_MASK_1_3((INTERP_16_MASK_1_3(p1) + INTERP_16_MASK_1_3(p2)) / 2) + | INTERP_16_MASK_SHIFTBACK_2_4((INTERP_16_MASK_SHIFT_2_4(p1) + INTERP_16_MASK_SHIFT_2_4(p2)) / 2); +} + +inline void hq4x_Interp6_16(unsigned char * pc, uint16 p1, uint16 p2, uint16 p3) +{ + *((uint16*)pc) = INTERP_16_MASK_1_3((INTERP_16_MASK_1_3(p1)*5 + INTERP_16_MASK_1_3(p2)*2 + INTERP_16_MASK_1_3(p3)*1) / 8) + | INTERP_16_MASK_SHIFTBACK_2_4((INTERP_16_MASK_SHIFT_2_4(p1)*5 + INTERP_16_MASK_SHIFT_2_4(p2)*2 + INTERP_16_MASK_SHIFT_2_4(p3)*1) / 8); +} + +inline void hq4x_Interp7_16(unsigned char * pc, uint16 p1, uint16 p2, uint16 p3) +{ + *((uint16*)pc) = INTERP_16_MASK_1_3((INTERP_16_MASK_1_3(p1)*6 + INTERP_16_MASK_1_3(p2) + INTERP_16_MASK_1_3(p3)) / 8) + | INTERP_16_MASK_SHIFTBACK_2_4((INTERP_16_MASK_SHIFT_2_4(p1)*6 + INTERP_16_MASK_SHIFT_2_4(p2) + INTERP_16_MASK_SHIFT_2_4(p3)) / 8); +} + +inline void hq4x_Interp8_16(unsigned char * pc, uint16 p1, uint16 p2) +{ + //*((int*)pc) = (c1*5+c2*3)/8; + *((uint16*)pc) = INTERP_16_MASK_1_3((INTERP_16_MASK_1_3(p1)*5 + INTERP_16_MASK_1_3(p2)*3) / 8) + | INTERP_16_MASK_SHIFTBACK_2_4((INTERP_16_MASK_SHIFT_2_4(p1)*5 + INTERP_16_MASK_SHIFT_2_4(p2)*3) / 8); +} + +#define INTERP_32_MASK_1_3(v) ((v)&0x00FF00FF) +#define INTERP_32_MASK_SHIFT_2_4(v) (((v)&0xFF00FF00)>>8) +#define INTERP_32_MASK_SHIFTBACK_2_4(v) (((INTERP_32_MASK_1_3(v))<<8)) + +inline void hq4x_Interp1_32(unsigned char * pc, uint32 p1, uint32 p2) +{ + *((uint32*)pc) = INTERP_32_MASK_1_3((INTERP_32_MASK_1_3(p1)*3 + INTERP_32_MASK_1_3(p2)) / 4) + | INTERP_32_MASK_SHIFTBACK_2_4((INTERP_32_MASK_SHIFT_2_4(p1)*3 + INTERP_32_MASK_SHIFT_2_4(p2)) / 4 ); +} + +inline void hq4x_Interp2_32(unsigned char * pc, uint32 p1, uint32 p2, uint32 p3) +{ + *((uint32*)pc) = INTERP_32_MASK_1_3((INTERP_32_MASK_1_3(p1)*2 + INTERP_32_MASK_1_3(p2) + INTERP_32_MASK_1_3(p3)) / 4) + | INTERP_32_MASK_SHIFTBACK_2_4((INTERP_32_MASK_SHIFT_2_4(p1)*2 + INTERP_32_MASK_SHIFT_2_4(p2) + INTERP_32_MASK_SHIFT_2_4(p3)) / 4); +} + +inline void hq4x_Interp3_32(unsigned char * pc, uint32 p1, uint32 p2) +{ + *((uint32*)pc) = INTERP_32_MASK_1_3((INTERP_32_MASK_1_3(p1)*7 + INTERP_32_MASK_1_3(p2)) / 8) + | INTERP_32_MASK_SHIFTBACK_2_4((INTERP_32_MASK_SHIFT_2_4(p1)*7 + INTERP_32_MASK_SHIFT_2_4(p2)) / 8); +} + +inline void hq4x_Interp5_32(unsigned char * pc, uint32 p1, uint32 p2) +{ + *((uint32*)pc) = INTERP_32_MASK_1_3((INTERP_32_MASK_1_3(p1) + INTERP_32_MASK_1_3(p2)) / 2) + | INTERP_32_MASK_SHIFTBACK_2_4((INTERP_32_MASK_SHIFT_2_4(p1) + INTERP_32_MASK_SHIFT_2_4(p2)) / 2); +} + +inline void hq4x_Interp6_32(unsigned char * pc, uint32 p1, uint32 p2, uint32 p3) +{ + *((uint32*)pc) = INTERP_32_MASK_1_3((INTERP_32_MASK_1_3(p1)*5 + INTERP_32_MASK_1_3(p2)*2 + INTERP_32_MASK_1_3(p3)*1) / 8) + | INTERP_32_MASK_SHIFTBACK_2_4((INTERP_32_MASK_SHIFT_2_4(p1)*5 + INTERP_32_MASK_SHIFT_2_4(p2)*2 + INTERP_32_MASK_SHIFT_2_4(p3)*1) / 8); +} + +inline void hq4x_Interp7_32(unsigned char * pc, uint32 p1, uint32 p2, uint32 p3) +{ + *((uint32*)pc) = INTERP_32_MASK_1_3((INTERP_32_MASK_1_3(p1)*6 + INTERP_32_MASK_1_3(p2) + INTERP_32_MASK_1_3(p3)) / 8) + | INTERP_32_MASK_SHIFTBACK_2_4((INTERP_32_MASK_SHIFT_2_4(p1)*6 + INTERP_32_MASK_SHIFT_2_4(p2) + INTERP_32_MASK_SHIFT_2_4(p3)) / 8); +} + +inline void hq4x_Interp8_32(unsigned char * pc, uint32 p1, uint32 p2) +{ + //*((int*)pc) = (c1*5+c2*3)/8; + *((uint32*)pc) = INTERP_32_MASK_1_3((INTERP_32_MASK_1_3(p1)*5 + INTERP_32_MASK_1_3(p2)*3) / 8) + | INTERP_32_MASK_SHIFTBACK_2_4((INTERP_32_MASK_SHIFT_2_4(p1)*5 + INTERP_32_MASK_SHIFT_2_4(p2)*3) / 8); +} + +#define PIXEL00_0 *((int*)(pOut)) = c[5]; +#define PIXEL00_11 hq4x_Interp1(pOut, c[5], c[4]); +#define PIXEL00_12 hq4x_Interp1(pOut, c[5], c[2]); +#define PIXEL00_20 hq4x_Interp2(pOut, c[5], c[2], c[4]); +#define PIXEL00_50 hq4x_Interp5(pOut, c[2], c[4]); +#define PIXEL00_80 hq4x_Interp8(pOut, c[5], c[1]); +#define PIXEL00_81 hq4x_Interp8(pOut, c[5], c[4]); +#define PIXEL00_82 hq4x_Interp8(pOut, c[5], c[2]); +#define PIXEL01_0 *((int*)(pOut+BPP)) = c[5]; +#define PIXEL01_10 hq4x_Interp1(pOut+BPP, c[5], c[1]); +#define PIXEL01_12 hq4x_Interp1(pOut+BPP, c[5], c[2]); +#define PIXEL01_14 hq4x_Interp1(pOut+BPP, c[2], c[5]); +#define PIXEL01_21 hq4x_Interp2(pOut+BPP, c[2], c[5], c[4]); +#define PIXEL01_31 hq4x_Interp3(pOut+BPP, c[5], c[4]); +#define PIXEL01_50 hq4x_Interp5(pOut+BPP, c[2], c[5]); +#define PIXEL01_60 hq4x_Interp6(pOut+BPP, c[5], c[2], c[4]); +#define PIXEL01_61 hq4x_Interp6(pOut+BPP, c[5], c[2], c[1]); +#define PIXEL01_82 hq4x_Interp8(pOut+BPP, c[5], c[2]); +#define PIXEL01_83 hq4x_Interp8(pOut+BPP, c[2], c[4]); +#define PIXEL02_0 *((int*)(pOut+BPP2)) = c[5]; +#define PIXEL02_10 hq4x_Interp1(pOut+BPP2, c[5], c[3]); +#define PIXEL02_11 hq4x_Interp1(pOut+BPP2, c[5], c[2]); +#define PIXEL02_13 hq4x_Interp1(pOut+BPP2, c[2], c[5]); +#define PIXEL02_21 hq4x_Interp2(pOut+BPP2, c[2], c[5], c[6]); +#define PIXEL02_32 hq4x_Interp3(pOut+BPP2, c[5], c[6]); +#define PIXEL02_50 hq4x_Interp5(pOut+BPP2, c[2], c[5]); +#define PIXEL02_60 hq4x_Interp6(pOut+BPP2, c[5], c[2], c[6]); +#define PIXEL02_61 hq4x_Interp6(pOut+BPP2, c[5], c[2], c[3]); +#define PIXEL02_81 hq4x_Interp8(pOut+BPP2, c[5], c[2]); +#define PIXEL02_83 hq4x_Interp8(pOut+BPP2, c[2], c[6]); +#define PIXEL03_0 *((int*)(pOut+BPP3)) = c[5]; +#define PIXEL03_11 hq4x_Interp1(pOut+BPP3, c[5], c[2]); +#define PIXEL03_12 hq4x_Interp1(pOut+BPP3, c[5], c[6]); +#define PIXEL03_20 hq4x_Interp2(pOut+BPP3, c[5], c[2], c[6]); +#define PIXEL03_50 hq4x_Interp5(pOut+BPP3, c[2], c[6]); +#define PIXEL03_80 hq4x_Interp8(pOut+BPP3, c[5], c[3]); +#define PIXEL03_81 hq4x_Interp8(pOut+BPP3, c[5], c[2]); +#define PIXEL03_82 hq4x_Interp8(pOut+BPP3, c[5], c[6]); +#define PIXEL10_0 *((int*)(pOut+BpL)) = c[5]; +#define PIXEL10_10 hq4x_Interp1(pOut+BpL, c[5], c[1]); +#define PIXEL10_11 hq4x_Interp1(pOut+BpL, c[5], c[4]); +#define PIXEL10_13 hq4x_Interp1(pOut+BpL, c[4], c[5]); +#define PIXEL10_21 hq4x_Interp2(pOut+BpL, c[4], c[5], c[2]); +#define PIXEL10_32 hq4x_Interp3(pOut+BpL, c[5], c[2]); +#define PIXEL10_50 hq4x_Interp5(pOut+BpL, c[4], c[5]); +#define PIXEL10_60 hq4x_Interp6(pOut+BpL, c[5], c[4], c[2]); +#define PIXEL10_61 hq4x_Interp6(pOut+BpL, c[5], c[4], c[1]); +#define PIXEL10_81 hq4x_Interp8(pOut+BpL, c[5], c[4]); +#define PIXEL10_83 hq4x_Interp8(pOut+BpL, c[4], c[2]); +#define PIXEL11_0 *((int*)(pOut+BpL+BPP)) = c[5]; +#define PIXEL11_30 hq4x_Interp3(pOut+BpL+BPP, c[5], c[1]); +#define PIXEL11_31 hq4x_Interp3(pOut+BpL+BPP, c[5], c[4]); +#define PIXEL11_32 hq4x_Interp3(pOut+BpL+BPP, c[5], c[2]); +#define PIXEL11_70 hq4x_Interp7(pOut+BpL+BPP, c[5], c[4], c[2]); +#define PIXEL12_0 *((int*)(pOut+BpL+BPP2)) = c[5]; +#define PIXEL12_30 hq4x_Interp3(pOut+BpL+BPP2, c[5], c[3]); +#define PIXEL12_31 hq4x_Interp3(pOut+BpL+BPP2, c[5], c[2]); +#define PIXEL12_32 hq4x_Interp3(pOut+BpL+BPP2, c[5], c[6]); +#define PIXEL12_70 hq4x_Interp7(pOut+BpL+BPP2, c[5], c[6], c[2]); +#define PIXEL13_0 *((int*)(pOut+BpL+BPP3)) = c[5]; +#define PIXEL13_10 hq4x_Interp1(pOut+BpL+BPP3, c[5], c[3]); +#define PIXEL13_12 hq4x_Interp1(pOut+BpL+BPP3, c[5], c[6]); +#define PIXEL13_14 hq4x_Interp1(pOut+BpL+BPP3, c[6], c[5]); +#define PIXEL13_21 hq4x_Interp2(pOut+BpL+BPP3, c[6], c[5], c[2]); +#define PIXEL13_31 hq4x_Interp3(pOut+BpL+BPP3, c[5], c[2]); +#define PIXEL13_50 hq4x_Interp5(pOut+BpL+BPP3, c[6], c[5]); +#define PIXEL13_60 hq4x_Interp6(pOut+BpL+BPP3, c[5], c[6], c[2]); +#define PIXEL13_61 hq4x_Interp6(pOut+BpL+BPP3, c[5], c[6], c[3]); +#define PIXEL13_82 hq4x_Interp8(pOut+BpL+BPP3, c[5], c[6]); +#define PIXEL13_83 hq4x_Interp8(pOut+BpL+BPP3, c[6], c[2]); +#define PIXEL20_0 *((int*)(pOut+BpL+BpL)) = c[5]; +#define PIXEL20_10 hq4x_Interp1(pOut+BpL+BpL, c[5], c[7]); +#define PIXEL20_12 hq4x_Interp1(pOut+BpL+BpL, c[5], c[4]); +#define PIXEL20_14 hq4x_Interp1(pOut+BpL+BpL, c[4], c[5]); +#define PIXEL20_21 hq4x_Interp2(pOut+BpL+BpL, c[4], c[5], c[8]); +#define PIXEL20_31 hq4x_Interp3(pOut+BpL+BpL, c[5], c[8]); +#define PIXEL20_50 hq4x_Interp5(pOut+BpL+BpL, c[4], c[5]); +#define PIXEL20_60 hq4x_Interp6(pOut+BpL+BpL, c[5], c[4], c[8]); +#define PIXEL20_61 hq4x_Interp6(pOut+BpL+BpL, c[5], c[4], c[7]); +#define PIXEL20_82 hq4x_Interp8(pOut+BpL+BpL, c[5], c[4]); +#define PIXEL20_83 hq4x_Interp8(pOut+BpL+BpL, c[4], c[8]); +#define PIXEL21_0 *((int*)(pOut+BpL+BpL+BPP)) = c[5]; +#define PIXEL21_30 hq4x_Interp3(pOut+BpL+BpL+BPP, c[5], c[7]); +#define PIXEL21_31 hq4x_Interp3(pOut+BpL+BpL+BPP, c[5], c[8]); +#define PIXEL21_32 hq4x_Interp3(pOut+BpL+BpL+BPP, c[5], c[4]); +#define PIXEL21_70 hq4x_Interp7(pOut+BpL+BpL+BPP, c[5], c[4], c[8]); +#define PIXEL22_0 *((int*)(pOut+BpL+BpL+BPP2)) = c[5]; +#define PIXEL22_30 hq4x_Interp3(pOut+BpL+BpL+BPP2, c[5], c[9]); +#define PIXEL22_31 hq4x_Interp3(pOut+BpL+BpL+BPP2, c[5], c[6]); +#define PIXEL22_32 hq4x_Interp3(pOut+BpL+BpL+BPP2, c[5], c[8]); +#define PIXEL22_70 hq4x_Interp7(pOut+BpL+BpL+BPP2, c[5], c[6], c[8]); +#define PIXEL23_0 *((int*)(pOut+BpL+BpL+BPP3)) = c[5]; +#define PIXEL23_10 hq4x_Interp1(pOut+BpL+BpL+BPP3, c[5], c[9]); +#define PIXEL23_11 hq4x_Interp1(pOut+BpL+BpL+BPP3, c[5], c[6]); +#define PIXEL23_13 hq4x_Interp1(pOut+BpL+BpL+BPP3, c[6], c[5]); +#define PIXEL23_21 hq4x_Interp2(pOut+BpL+BpL+BPP3, c[6], c[5], c[8]); +#define PIXEL23_32 hq4x_Interp3(pOut+BpL+BpL+BPP3, c[5], c[8]); +#define PIXEL23_50 hq4x_Interp5(pOut+BpL+BpL+BPP3, c[6], c[5]); +#define PIXEL23_60 hq4x_Interp6(pOut+BpL+BpL+BPP3, c[5], c[6], c[8]); +#define PIXEL23_61 hq4x_Interp6(pOut+BpL+BpL+BPP3, c[5], c[6], c[9]); +#define PIXEL23_81 hq4x_Interp8(pOut+BpL+BpL+BPP3, c[5], c[6]); +#define PIXEL23_83 hq4x_Interp8(pOut+BpL+BpL+BPP3, c[6], c[8]); +#define PIXEL30_0 *((int*)(pOut+BpL+BpL+BpL)) = c[5]; +#define PIXEL30_11 hq4x_Interp1(pOut+BpL+BpL+BpL, c[5], c[8]); +#define PIXEL30_12 hq4x_Interp1(pOut+BpL+BpL+BpL, c[5], c[4]); +#define PIXEL30_20 hq4x_Interp2(pOut+BpL+BpL+BpL, c[5], c[8], c[4]); +#define PIXEL30_50 hq4x_Interp5(pOut+BpL+BpL+BpL, c[8], c[4]); +#define PIXEL30_80 hq4x_Interp8(pOut+BpL+BpL+BpL, c[5], c[7]); +#define PIXEL30_81 hq4x_Interp8(pOut+BpL+BpL+BpL, c[5], c[8]); +#define PIXEL30_82 hq4x_Interp8(pOut+BpL+BpL+BpL, c[5], c[4]); +#define PIXEL31_0 *((int*)(pOut+BpL+BpL+BpL+BPP)) = c[5]; +#define PIXEL31_10 hq4x_Interp1(pOut+BpL+BpL+BpL+BPP, c[5], c[7]); +#define PIXEL31_11 hq4x_Interp1(pOut+BpL+BpL+BpL+BPP, c[5], c[8]); +#define PIXEL31_13 hq4x_Interp1(pOut+BpL+BpL+BpL+BPP, c[8], c[5]); +#define PIXEL31_21 hq4x_Interp2(pOut+BpL+BpL+BpL+BPP, c[8], c[5], c[4]); +#define PIXEL31_32 hq4x_Interp3(pOut+BpL+BpL+BpL+BPP, c[5], c[4]); +#define PIXEL31_50 hq4x_Interp5(pOut+BpL+BpL+BpL+BPP, c[8], c[5]); +#define PIXEL31_60 hq4x_Interp6(pOut+BpL+BpL+BpL+BPP, c[5], c[8], c[4]); +#define PIXEL31_61 hq4x_Interp6(pOut+BpL+BpL+BpL+BPP, c[5], c[8], c[7]); +#define PIXEL31_81 hq4x_Interp8(pOut+BpL+BpL+BpL+BPP, c[5], c[8]); +#define PIXEL31_83 hq4x_Interp8(pOut+BpL+BpL+BpL+BPP, c[8], c[4]); +#define PIXEL32_0 *((int*)(pOut+BpL+BpL+BpL+BPP2)) = c[5]; +#define PIXEL32_10 hq4x_Interp1(pOut+BpL+BpL+BpL+BPP2, c[5], c[9]); +#define PIXEL32_12 hq4x_Interp1(pOut+BpL+BpL+BpL+BPP2, c[5], c[8]); +#define PIXEL32_14 hq4x_Interp1(pOut+BpL+BpL+BpL+BPP2, c[8], c[5]); +#define PIXEL32_21 hq4x_Interp2(pOut+BpL+BpL+BpL+BPP2, c[8], c[5], c[6]); +#define PIXEL32_31 hq4x_Interp3(pOut+BpL+BpL+BpL+BPP2, c[5], c[6]); +#define PIXEL32_50 hq4x_Interp5(pOut+BpL+BpL+BpL+BPP2, c[8], c[5]); +#define PIXEL32_60 hq4x_Interp6(pOut+BpL+BpL+BpL+BPP2, c[5], c[8], c[6]); +#define PIXEL32_61 hq4x_Interp6(pOut+BpL+BpL+BpL+BPP2, c[5], c[8], c[9]); +#define PIXEL32_82 hq4x_Interp8(pOut+BpL+BpL+BpL+BPP2, c[5], c[8]); +#define PIXEL32_83 hq4x_Interp8(pOut+BpL+BpL+BpL+BPP2, c[8], c[6]); +#define PIXEL33_0 *((int*)(pOut+BpL+BpL+BpL+BPP3)) = c[5]; +#define PIXEL33_11 hq4x_Interp1(pOut+BpL+BpL+BpL+BPP3, c[5], c[6]); +#define PIXEL33_12 hq4x_Interp1(pOut+BpL+BpL+BpL+BPP3, c[5], c[8]); +#define PIXEL33_20 hq4x_Interp2(pOut+BpL+BpL+BpL+BPP3, c[5], c[8], c[6]); +#define PIXEL33_50 hq4x_Interp5(pOut+BpL+BpL+BpL+BPP3, c[8], c[6]); +#define PIXEL33_80 hq4x_Interp8(pOut+BpL+BpL+BpL+BPP3, c[5], c[9]); +#define PIXEL33_81 hq4x_Interp8(pOut+BpL+BpL+BpL+BPP3, c[5], c[6]); +#define PIXEL33_82 hq4x_Interp8(pOut+BpL+BpL+BpL+BPP3, c[5], c[8]); + + + +inline bool Diff_16(uint16 w1, uint16 w2) +{ + YUV1 = RGB16toYUV(w1); + YUV2 = RGB16toYUV(w2); + return ( ( abs((YUV1 & Amask) - (YUV2 & Amask)) > trA ) || + ( abs((YUV1 & Ymask) - (YUV2 & Ymask)) > trY ) || + ( abs((YUV1 & Umask) - (YUV2 & Umask)) > trU ) || + ( abs((YUV1 & Vmask) - (YUV2 & Vmask)) > trV ) ); +} +inline bool Diff_32(uint32 w1, uint32 w2) +{ + YUV1 = RGB32toYUV(w1); + YUV2 = RGB32toYUV(w2); + return ( ( abs((YUV1 & Amask) - (YUV2 & Amask)) > trA ) || + ( abs((YUV1 & Ymask) - (YUV2 & Ymask)) > trY ) || + ( abs((YUV1 & Umask) - (YUV2 & Umask)) > trU ) || + ( abs((YUV1 & Vmask) - (YUV2 & Vmask)) > trV ) ); +} + +void hq4x_16( unsigned char * pIn, unsigned char * pOut, int Xres, int Yres, int SrcPPL, int BpL ) +{ +#define hq4x_Interp1 hq4x_Interp1_16 +#define hq4x_Interp2 hq4x_Interp2_16 +#define hq4x_Interp3 hq4x_Interp3_16 +#define hq4x_Interp4 hq4x_Interp4_16 +#define hq4x_Interp5 hq4x_Interp5_16 +#define hq4x_Interp6 hq4x_Interp6_16 +#define hq4x_Interp7 hq4x_Interp7_16 +#define hq4x_Interp8 hq4x_Interp8_16 +#define Diff Diff_16 +#define BPP 2 +#define BPP2 4 +#define BPP3 6 + + int i, j, k; + int prevline, nextline; + uint16 w[10]; + uint16 c[10]; + + // +----+----+----+ + // | | | | + // | w1 | w2 | w3 | + // +----+----+----+ + // | | | | + // | w4 | w5 | w6 | + // +----+----+----+ + // | | | | + // | w7 | w8 | w9 | + // +----+----+----+ + + for (j=0; j0) prevline = -SrcPPL*2; else prevline = 0; + if (j0) + { + w[1] = *((uint16*)(pIn + prevline - 2)); + w[4] = *((uint16*)(pIn - 2)); + w[7] = *((uint16*)(pIn + nextline - 2)); + } + else + { + w[1] = w[2]; + w[4] = w[5]; + w[7] = w[8]; + } + + if (i trA ) || + ( abs((YUV1 & Ymask) - (YUV2 & Ymask)) > trY ) || + ( abs((YUV1 & Umask) - (YUV2 & Umask)) > trU ) || + ( abs((YUV1 & Vmask) - (YUV2 & Vmask)) > trV ) ) + pattern |= flag; + } + flag <<= 1; + } + + for (k=1; k<=9; k++) + c[k] = w[k]; + +#include "TextureFilters_hq4x.h" + + pIn+=2; + pOut+=8; + } + pIn += 2*(SrcPPL-Xres); + pOut+= 8*(SrcPPL-Xres); + pOut+=BpL; + pOut+=BpL; + pOut+=BpL; + } + +#undef BPP +#undef BPP2 +#undef BPP3 +#undef Diff +#undef hq4x_Interp1 +#undef hq4x_Interp2 +#undef hq4x_Interp3 +#undef hq4x_Interp4 +#undef hq4x_Interp5 +#undef hq4x_Interp6 +#undef hq4x_Interp7 +#undef hq4x_Interp8 +} + +void hq4x_32( unsigned char * pIn, unsigned char * pOut, int Xres, int Yres, int SrcPPL, int BpL ) +{ +#define hq4x_Interp1 hq4x_Interp1_32 +#define hq4x_Interp2 hq4x_Interp2_32 +#define hq4x_Interp3 hq4x_Interp3_32 +#define hq4x_Interp4 hq4x_Interp4_32 +#define hq4x_Interp5 hq4x_Interp5_32 +#define hq4x_Interp6 hq4x_Interp6_32 +#define hq4x_Interp7 hq4x_Interp7_32 +#define hq4x_Interp8 hq4x_Interp8_32 +#define Diff Diff_32 +#define BPP 4 +#define BPP2 8 +#define BPP3 12 + + int i, j, k; + int prevline, nextline; + uint32 w[10]; + uint32 c[10]; + + // +----+----+----+ + // | | | | + // | w1 | w2 | w3 | + // +----+----+----+ + // | | | | + // | w4 | w5 | w6 | + // +----+----+----+ + // | | | | + // | w7 | w8 | w9 | + // +----+----+----+ + + for (j=0; j0) prevline = -SrcPPL*4; else prevline = 0; + if (j0) + { + w[1] = *((uint32*)(pIn + prevline - 4)); + w[4] = *((uint32*)(pIn - 4)); + w[7] = *((uint32*)(pIn + nextline - 4)); + } + else + { + w[1] = w[2]; + w[4] = w[5]; + w[7] = w[8]; + } + + if (i trA ) || + ( abs((YUV1 & Ymask) - (YUV2 & Ymask)) > trY ) || + ( abs((YUV1 & Umask) - (YUV2 & Umask)) > trU ) || + ( abs((YUV1 & Vmask) - (YUV2 & Vmask)) > trV ) ) + pattern |= flag; + } + flag <<= 1; + } + + for (k=1; k<=9; k++) + c[k] = w[k]; + +#include "TextureFilters_hq4x.h" + + pIn+=4; + pOut+=16; + } + + pIn += 4*(SrcPPL-Xres); + pOut+= 16*(SrcPPL-Xres); + pOut+=BpL; + pOut+=BpL; + pOut+=BpL; + } + +#undef BPP +#undef BPP2 +#undef BPP3 +#undef Diff +#undef hq4x_Interp1 +#undef hq4x_Interp2 +#undef hq4x_Interp3 +#undef hq4x_Interp4 +#undef hq4x_Interp5 +#undef hq4x_Interp6 +#undef hq4x_Interp7 +#undef hq4x_Interp8 +} + +void hq4x_InitLUTs(void) +{ + static bool done = false; + int i, j, k, r, g, b, Y, u, v; + + if( !done ) + { + for (i=0; i<16; i++) + { + for (j=0; j<16; j++) + { + for (k=0; k<16; k++) + { + r = i << 4; + g = j << 4; + b = k << 4; + Y = (r + g + b) >> 2; + u = 128 + ((r - b) >> 2); + v = 128 + ((-r + 2*g -b)>>3); + RGBtoYUV[ (i << 8) + (j << 4) + k ] = (Y<<16) + (u<<8) + v; + } + } + } + done = true; + } +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/TextureFilters_hq4x.h b/libmupen64plus/mupen64plus-video-rice/src/TextureFilters_hq4x.h new file mode 100644 index 0000000000..5283420c44 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/TextureFilters_hq4x.h @@ -0,0 +1,4996 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - TextureFilters_hq4x.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2003 MaxSt ( maxst@hiend3d.com ) * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +switch (pattern) +{ +case 0: +case 1: +case 4: +case 32: +case 128: +case 5: +case 132: +case 160: +case 33: +case 129: +case 36: +case 133: +case 164: +case 161: +case 37: +case 165: + { + PIXEL00_20 + PIXEL01_60 + PIXEL02_60 + PIXEL03_20 + PIXEL10_60 + PIXEL11_70 + PIXEL12_70 + PIXEL13_60 + PIXEL20_60 + PIXEL21_70 + PIXEL22_70 + PIXEL23_60 + PIXEL30_20 + PIXEL31_60 + PIXEL32_60 + PIXEL33_20 + break; + } +case 2: +case 34: +case 130: +case 162: + { + PIXEL00_80 + PIXEL01_10 + PIXEL02_10 + PIXEL03_80 + PIXEL10_61 + PIXEL11_30 + PIXEL12_30 + PIXEL13_61 + PIXEL20_60 + PIXEL21_70 + PIXEL22_70 + PIXEL23_60 + PIXEL30_20 + PIXEL31_60 + PIXEL32_60 + PIXEL33_20 + break; + } +case 16: +case 17: +case 48: +case 49: + { + PIXEL00_20 + PIXEL01_60 + PIXEL02_61 + PIXEL03_80 + PIXEL10_60 + PIXEL11_70 + PIXEL12_30 + PIXEL13_10 + PIXEL20_60 + PIXEL21_70 + PIXEL22_30 + PIXEL23_10 + PIXEL30_20 + PIXEL31_60 + PIXEL32_61 + PIXEL33_80 + break; + } +case 64: +case 65: +case 68: +case 69: + { + PIXEL00_20 + PIXEL01_60 + PIXEL02_60 + PIXEL03_20 + PIXEL10_60 + PIXEL11_70 + PIXEL12_70 + PIXEL13_60 + PIXEL20_61 + PIXEL21_30 + PIXEL22_30 + PIXEL23_61 + PIXEL30_80 + PIXEL31_10 + PIXEL32_10 + PIXEL33_80 + break; + } +case 8: +case 12: +case 136: +case 140: + { + PIXEL00_80 + PIXEL01_61 + PIXEL02_60 + PIXEL03_20 + PIXEL10_10 + PIXEL11_30 + PIXEL12_70 + PIXEL13_60 + PIXEL20_10 + PIXEL21_30 + PIXEL22_70 + PIXEL23_60 + PIXEL30_80 + PIXEL31_61 + PIXEL32_60 + PIXEL33_20 + break; + } +case 3: +case 35: +case 131: +case 163: + { + PIXEL00_81 + PIXEL01_31 + PIXEL02_10 + PIXEL03_80 + PIXEL10_81 + PIXEL11_31 + PIXEL12_30 + PIXEL13_61 + PIXEL20_60 + PIXEL21_70 + PIXEL22_70 + PIXEL23_60 + PIXEL30_20 + PIXEL31_60 + PIXEL32_60 + PIXEL33_20 + break; + } +case 6: +case 38: +case 134: +case 166: + { + PIXEL00_80 + PIXEL01_10 + PIXEL02_32 + PIXEL03_82 + PIXEL10_61 + PIXEL11_30 + PIXEL12_32 + PIXEL13_82 + PIXEL20_60 + PIXEL21_70 + PIXEL22_70 + PIXEL23_60 + PIXEL30_20 + PIXEL31_60 + PIXEL32_60 + PIXEL33_20 + break; + } +case 20: +case 21: +case 52: +case 53: + { + PIXEL00_20 + PIXEL01_60 + PIXEL02_81 + PIXEL03_81 + PIXEL10_60 + PIXEL11_70 + PIXEL12_31 + PIXEL13_31 + PIXEL20_60 + PIXEL21_70 + PIXEL22_30 + PIXEL23_10 + PIXEL30_20 + PIXEL31_60 + PIXEL32_61 + PIXEL33_80 + break; + } +case 144: +case 145: +case 176: +case 177: + { + PIXEL00_20 + PIXEL01_60 + PIXEL02_61 + PIXEL03_80 + PIXEL10_60 + PIXEL11_70 + PIXEL12_30 + PIXEL13_10 + PIXEL20_60 + PIXEL21_70 + PIXEL22_32 + PIXEL23_32 + PIXEL30_20 + PIXEL31_60 + PIXEL32_82 + PIXEL33_82 + break; + } +case 192: +case 193: +case 196: +case 197: + { + PIXEL00_20 + PIXEL01_60 + PIXEL02_60 + PIXEL03_20 + PIXEL10_60 + PIXEL11_70 + PIXEL12_70 + PIXEL13_60 + PIXEL20_61 + PIXEL21_30 + PIXEL22_31 + PIXEL23_81 + PIXEL30_80 + PIXEL31_10 + PIXEL32_31 + PIXEL33_81 + break; + } +case 96: +case 97: +case 100: +case 101: + { + PIXEL00_20 + PIXEL01_60 + PIXEL02_60 + PIXEL03_20 + PIXEL10_60 + PIXEL11_70 + PIXEL12_70 + PIXEL13_60 + PIXEL20_82 + PIXEL21_32 + PIXEL22_30 + PIXEL23_61 + PIXEL30_82 + PIXEL31_32 + PIXEL32_10 + PIXEL33_80 + break; + } +case 40: +case 44: +case 168: +case 172: + { + PIXEL00_80 + PIXEL01_61 + PIXEL02_60 + PIXEL03_20 + PIXEL10_10 + PIXEL11_30 + PIXEL12_70 + PIXEL13_60 + PIXEL20_31 + PIXEL21_31 + PIXEL22_70 + PIXEL23_60 + PIXEL30_81 + PIXEL31_81 + PIXEL32_60 + PIXEL33_20 + break; + } +case 9: +case 13: +case 137: +case 141: + { + PIXEL00_82 + PIXEL01_82 + PIXEL02_60 + PIXEL03_20 + PIXEL10_32 + PIXEL11_32 + PIXEL12_70 + PIXEL13_60 + PIXEL20_10 + PIXEL21_30 + PIXEL22_70 + PIXEL23_60 + PIXEL30_80 + PIXEL31_61 + PIXEL32_60 + PIXEL33_20 + break; + } +case 18: +case 50: + { + PIXEL00_80 + PIXEL01_10 + if (Diff(w[2], w[6])) + { + PIXEL02_10 + PIXEL03_80 + PIXEL12_30 + PIXEL13_10 + } + else + { + PIXEL02_50 + PIXEL03_50 + PIXEL12_0 + PIXEL13_50 + } + PIXEL10_61 + PIXEL11_30 + PIXEL20_60 + PIXEL21_70 + PIXEL22_30 + PIXEL23_10 + PIXEL30_20 + PIXEL31_60 + PIXEL32_61 + PIXEL33_80 + break; + } +case 80: +case 81: + { + PIXEL00_20 + PIXEL01_60 + PIXEL02_61 + PIXEL03_80 + PIXEL10_60 + PIXEL11_70 + PIXEL12_30 + PIXEL13_10 + PIXEL20_61 + PIXEL21_30 + if (Diff(w[6], w[8])) + { + PIXEL22_30 + PIXEL23_10 + PIXEL32_10 + PIXEL33_80 + } + else + { + PIXEL22_0 + PIXEL23_50 + PIXEL32_50 + PIXEL33_50 + } + PIXEL30_80 + PIXEL31_10 + break; + } +case 72: +case 76: + { + PIXEL00_80 + PIXEL01_61 + PIXEL02_60 + PIXEL03_20 + PIXEL10_10 + PIXEL11_30 + PIXEL12_70 + PIXEL13_60 + if (Diff(w[8], w[4])) + { + PIXEL20_10 + PIXEL21_30 + PIXEL30_80 + PIXEL31_10 + } + else + { + PIXEL20_50 + PIXEL21_0 + PIXEL30_50 + PIXEL31_50 + } + PIXEL22_30 + PIXEL23_61 + PIXEL32_10 + PIXEL33_80 + break; + } +case 10: +case 138: + { + if (Diff(w[4], w[2])) + { + PIXEL00_80 + PIXEL01_10 + PIXEL10_10 + PIXEL11_30 + } + else + { + PIXEL00_50 + PIXEL01_50 + PIXEL10_50 + PIXEL11_0 + } + PIXEL02_10 + PIXEL03_80 + PIXEL12_30 + PIXEL13_61 + PIXEL20_10 + PIXEL21_30 + PIXEL22_70 + PIXEL23_60 + PIXEL30_80 + PIXEL31_61 + PIXEL32_60 + PIXEL33_20 + break; + } +case 66: + { + PIXEL00_80 + PIXEL01_10 + PIXEL02_10 + PIXEL03_80 + PIXEL10_61 + PIXEL11_30 + PIXEL12_30 + PIXEL13_61 + PIXEL20_61 + PIXEL21_30 + PIXEL22_30 + PIXEL23_61 + PIXEL30_80 + PIXEL31_10 + PIXEL32_10 + PIXEL33_80 + break; + } +case 24: + { + PIXEL00_80 + PIXEL01_61 + PIXEL02_61 + PIXEL03_80 + PIXEL10_10 + PIXEL11_30 + PIXEL12_30 + PIXEL13_10 + PIXEL20_10 + PIXEL21_30 + PIXEL22_30 + PIXEL23_10 + PIXEL30_80 + PIXEL31_61 + PIXEL32_61 + PIXEL33_80 + break; + } +case 7: +case 39: +case 135: + { + PIXEL00_81 + PIXEL01_31 + PIXEL02_32 + PIXEL03_82 + PIXEL10_81 + PIXEL11_31 + PIXEL12_32 + PIXEL13_82 + PIXEL20_60 + PIXEL21_70 + PIXEL22_70 + PIXEL23_60 + PIXEL30_20 + PIXEL31_60 + PIXEL32_60 + PIXEL33_20 + break; + } +case 148: +case 149: +case 180: + { + PIXEL00_20 + PIXEL01_60 + PIXEL02_81 + PIXEL03_81 + PIXEL10_60 + PIXEL11_70 + PIXEL12_31 + PIXEL13_31 + PIXEL20_60 + PIXEL21_70 + PIXEL22_32 + PIXEL23_32 + PIXEL30_20 + PIXEL31_60 + PIXEL32_82 + PIXEL33_82 + break; + } +case 224: +case 228: +case 225: + { + PIXEL00_20 + PIXEL01_60 + PIXEL02_60 + PIXEL03_20 + PIXEL10_60 + PIXEL11_70 + PIXEL12_70 + PIXEL13_60 + PIXEL20_82 + PIXEL21_32 + PIXEL22_31 + PIXEL23_81 + PIXEL30_82 + PIXEL31_32 + PIXEL32_31 + PIXEL33_81 + break; + } +case 41: +case 169: +case 45: + { + PIXEL00_82 + PIXEL01_82 + PIXEL02_60 + PIXEL03_20 + PIXEL10_32 + PIXEL11_32 + PIXEL12_70 + PIXEL13_60 + PIXEL20_31 + PIXEL21_31 + PIXEL22_70 + PIXEL23_60 + PIXEL30_81 + PIXEL31_81 + PIXEL32_60 + PIXEL33_20 + break; + } +case 22: +case 54: + { + PIXEL00_80 + PIXEL01_10 + if (Diff(w[2], w[6])) + { + PIXEL02_0 + PIXEL03_0 + PIXEL13_0 + } + else + { + PIXEL02_50 + PIXEL03_50 + PIXEL13_50 + } + PIXEL10_61 + PIXEL11_30 + PIXEL12_0 + PIXEL20_60 + PIXEL21_70 + PIXEL22_30 + PIXEL23_10 + PIXEL30_20 + PIXEL31_60 + PIXEL32_61 + PIXEL33_80 + break; + } +case 208: +case 209: + { + PIXEL00_20 + PIXEL01_60 + PIXEL02_61 + PIXEL03_80 + PIXEL10_60 + PIXEL11_70 + PIXEL12_30 + PIXEL13_10 + PIXEL20_61 + PIXEL21_30 + PIXEL22_0 + if (Diff(w[6], w[8])) + { + PIXEL23_0 + PIXEL32_0 + PIXEL33_0 + } + else + { + PIXEL23_50 + PIXEL32_50 + PIXEL33_50 + } + PIXEL30_80 + PIXEL31_10 + break; + } +case 104: +case 108: + { + PIXEL00_80 + PIXEL01_61 + PIXEL02_60 + PIXEL03_20 + PIXEL10_10 + PIXEL11_30 + PIXEL12_70 + PIXEL13_60 + if (Diff(w[8], w[4])) + { + PIXEL20_0 + PIXEL30_0 + PIXEL31_0 + } + else + { + PIXEL20_50 + PIXEL30_50 + PIXEL31_50 + } + PIXEL21_0 + PIXEL22_30 + PIXEL23_61 + PIXEL32_10 + PIXEL33_80 + break; + } +case 11: +case 139: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL01_0 + PIXEL10_0 + } + else + { + PIXEL00_50 + PIXEL01_50 + PIXEL10_50 + } + PIXEL02_10 + PIXEL03_80 + PIXEL11_0 + PIXEL12_30 + PIXEL13_61 + PIXEL20_10 + PIXEL21_30 + PIXEL22_70 + PIXEL23_60 + PIXEL30_80 + PIXEL31_61 + PIXEL32_60 + PIXEL33_20 + break; + } +case 19: +case 51: + { + if (Diff(w[2], w[6])) + { + PIXEL00_81 + PIXEL01_31 + PIXEL02_10 + PIXEL03_80 + PIXEL12_30 + PIXEL13_10 + } + else + { + PIXEL00_12 + PIXEL01_14 + PIXEL02_83 + PIXEL03_50 + PIXEL12_70 + PIXEL13_21 + } + PIXEL10_81 + PIXEL11_31 + PIXEL20_60 + PIXEL21_70 + PIXEL22_30 + PIXEL23_10 + PIXEL30_20 + PIXEL31_60 + PIXEL32_61 + PIXEL33_80 + break; + } +case 146: +case 178: + { + PIXEL00_80 + PIXEL01_10 + if (Diff(w[2], w[6])) + { + PIXEL02_10 + PIXEL03_80 + PIXEL12_30 + PIXEL13_10 + PIXEL23_32 + PIXEL33_82 + } + else + { + PIXEL02_21 + PIXEL03_50 + PIXEL12_70 + PIXEL13_83 + PIXEL23_13 + PIXEL33_11 + } + PIXEL10_61 + PIXEL11_30 + PIXEL20_60 + PIXEL21_70 + PIXEL22_32 + PIXEL30_20 + PIXEL31_60 + PIXEL32_82 + break; + } +case 84: +case 85: + { + PIXEL00_20 + PIXEL01_60 + PIXEL02_81 + if (Diff(w[6], w[8])) + { + PIXEL03_81 + PIXEL13_31 + PIXEL22_30 + PIXEL23_10 + PIXEL32_10 + PIXEL33_80 + } + else + { + PIXEL03_12 + PIXEL13_14 + PIXEL22_70 + PIXEL23_83 + PIXEL32_21 + PIXEL33_50 + } + PIXEL10_60 + PIXEL11_70 + PIXEL12_31 + PIXEL20_61 + PIXEL21_30 + PIXEL30_80 + PIXEL31_10 + break; + } +case 112: +case 113: + { + PIXEL00_20 + PIXEL01_60 + PIXEL02_61 + PIXEL03_80 + PIXEL10_60 + PIXEL11_70 + PIXEL12_30 + PIXEL13_10 + PIXEL20_82 + PIXEL21_32 + if (Diff(w[6], w[8])) + { + PIXEL22_30 + PIXEL23_10 + PIXEL30_82 + PIXEL31_32 + PIXEL32_10 + PIXEL33_80 + } + else + { + PIXEL22_70 + PIXEL23_21 + PIXEL30_11 + PIXEL31_13 + PIXEL32_83 + PIXEL33_50 + } + break; + } +case 200: +case 204: + { + PIXEL00_80 + PIXEL01_61 + PIXEL02_60 + PIXEL03_20 + PIXEL10_10 + PIXEL11_30 + PIXEL12_70 + PIXEL13_60 + if (Diff(w[8], w[4])) + { + PIXEL20_10 + PIXEL21_30 + PIXEL30_80 + PIXEL31_10 + PIXEL32_31 + PIXEL33_81 + } + else + { + PIXEL20_21 + PIXEL21_70 + PIXEL30_50 + PIXEL31_83 + PIXEL32_14 + PIXEL33_12 + } + PIXEL22_31 + PIXEL23_81 + break; + } +case 73: +case 77: + { + if (Diff(w[8], w[4])) + { + PIXEL00_82 + PIXEL10_32 + PIXEL20_10 + PIXEL21_30 + PIXEL30_80 + PIXEL31_10 + } + else + { + PIXEL00_11 + PIXEL10_13 + PIXEL20_83 + PIXEL21_70 + PIXEL30_50 + PIXEL31_21 + } + PIXEL01_82 + PIXEL02_60 + PIXEL03_20 + PIXEL11_32 + PIXEL12_70 + PIXEL13_60 + PIXEL22_30 + PIXEL23_61 + PIXEL32_10 + PIXEL33_80 + break; + } +case 42: +case 170: + { + if (Diff(w[4], w[2])) + { + PIXEL00_80 + PIXEL01_10 + PIXEL10_10 + PIXEL11_30 + PIXEL20_31 + PIXEL30_81 + } + else + { + PIXEL00_50 + PIXEL01_21 + PIXEL10_83 + PIXEL11_70 + PIXEL20_14 + PIXEL30_12 + } + PIXEL02_10 + PIXEL03_80 + PIXEL12_30 + PIXEL13_61 + PIXEL21_31 + PIXEL22_70 + PIXEL23_60 + PIXEL31_81 + PIXEL32_60 + PIXEL33_20 + break; + } +case 14: +case 142: + { + if (Diff(w[4], w[2])) + { + PIXEL00_80 + PIXEL01_10 + PIXEL02_32 + PIXEL03_82 + PIXEL10_10 + PIXEL11_30 + } + else + { + PIXEL00_50 + PIXEL01_83 + PIXEL02_13 + PIXEL03_11 + PIXEL10_21 + PIXEL11_70 + } + PIXEL12_32 + PIXEL13_82 + PIXEL20_10 + PIXEL21_30 + PIXEL22_70 + PIXEL23_60 + PIXEL30_80 + PIXEL31_61 + PIXEL32_60 + PIXEL33_20 + break; + } +case 67: + { + PIXEL00_81 + PIXEL01_31 + PIXEL02_10 + PIXEL03_80 + PIXEL10_81 + PIXEL11_31 + PIXEL12_30 + PIXEL13_61 + PIXEL20_61 + PIXEL21_30 + PIXEL22_30 + PIXEL23_61 + PIXEL30_80 + PIXEL31_10 + PIXEL32_10 + PIXEL33_80 + break; + } +case 70: + { + PIXEL00_80 + PIXEL01_10 + PIXEL02_32 + PIXEL03_82 + PIXEL10_61 + PIXEL11_30 + PIXEL12_32 + PIXEL13_82 + PIXEL20_61 + PIXEL21_30 + PIXEL22_30 + PIXEL23_61 + PIXEL30_80 + PIXEL31_10 + PIXEL32_10 + PIXEL33_80 + break; + } +case 28: + { + PIXEL00_80 + PIXEL01_61 + PIXEL02_81 + PIXEL03_81 + PIXEL10_10 + PIXEL11_30 + PIXEL12_31 + PIXEL13_31 + PIXEL20_10 + PIXEL21_30 + PIXEL22_30 + PIXEL23_10 + PIXEL30_80 + PIXEL31_61 + PIXEL32_61 + PIXEL33_80 + break; + } +case 152: + { + PIXEL00_80 + PIXEL01_61 + PIXEL02_61 + PIXEL03_80 + PIXEL10_10 + PIXEL11_30 + PIXEL12_30 + PIXEL13_10 + PIXEL20_10 + PIXEL21_30 + PIXEL22_32 + PIXEL23_32 + PIXEL30_80 + PIXEL31_61 + PIXEL32_82 + PIXEL33_82 + break; + } +case 194: + { + PIXEL00_80 + PIXEL01_10 + PIXEL02_10 + PIXEL03_80 + PIXEL10_61 + PIXEL11_30 + PIXEL12_30 + PIXEL13_61 + PIXEL20_61 + PIXEL21_30 + PIXEL22_31 + PIXEL23_81 + PIXEL30_80 + PIXEL31_10 + PIXEL32_31 + PIXEL33_81 + break; + } +case 98: + { + PIXEL00_80 + PIXEL01_10 + PIXEL02_10 + PIXEL03_80 + PIXEL10_61 + PIXEL11_30 + PIXEL12_30 + PIXEL13_61 + PIXEL20_82 + PIXEL21_32 + PIXEL22_30 + PIXEL23_61 + PIXEL30_82 + PIXEL31_32 + PIXEL32_10 + PIXEL33_80 + break; + } +case 56: + { + PIXEL00_80 + PIXEL01_61 + PIXEL02_61 + PIXEL03_80 + PIXEL10_10 + PIXEL11_30 + PIXEL12_30 + PIXEL13_10 + PIXEL20_31 + PIXEL21_31 + PIXEL22_30 + PIXEL23_10 + PIXEL30_81 + PIXEL31_81 + PIXEL32_61 + PIXEL33_80 + break; + } +case 25: + { + PIXEL00_82 + PIXEL01_82 + PIXEL02_61 + PIXEL03_80 + PIXEL10_32 + PIXEL11_32 + PIXEL12_30 + PIXEL13_10 + PIXEL20_10 + PIXEL21_30 + PIXEL22_30 + PIXEL23_10 + PIXEL30_80 + PIXEL31_61 + PIXEL32_61 + PIXEL33_80 + break; + } +case 26: +case 31: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL01_0 + PIXEL10_0 + } + else + { + PIXEL00_50 + PIXEL01_50 + PIXEL10_50 + } + if (Diff(w[2], w[6])) + { + PIXEL02_0 + PIXEL03_0 + PIXEL13_0 + } + else + { + PIXEL02_50 + PIXEL03_50 + PIXEL13_50 + } + PIXEL11_0 + PIXEL12_0 + PIXEL20_10 + PIXEL21_30 + PIXEL22_30 + PIXEL23_10 + PIXEL30_80 + PIXEL31_61 + PIXEL32_61 + PIXEL33_80 + break; + } +case 82: +case 214: + { + PIXEL00_80 + PIXEL01_10 + if (Diff(w[2], w[6])) + { + PIXEL02_0 + PIXEL03_0 + PIXEL13_0 + } + else + { + PIXEL02_50 + PIXEL03_50 + PIXEL13_50 + } + PIXEL10_61 + PIXEL11_30 + PIXEL12_0 + PIXEL20_61 + PIXEL21_30 + PIXEL22_0 + if (Diff(w[6], w[8])) + { + PIXEL23_0 + PIXEL32_0 + PIXEL33_0 + } + else + { + PIXEL23_50 + PIXEL32_50 + PIXEL33_50 + } + PIXEL30_80 + PIXEL31_10 + break; + } +case 88: +case 248: + { + PIXEL00_80 + PIXEL01_61 + PIXEL02_61 + PIXEL03_80 + PIXEL10_10 + PIXEL11_30 + PIXEL12_30 + PIXEL13_10 + if (Diff(w[8], w[4])) + { + PIXEL20_0 + PIXEL30_0 + PIXEL31_0 + } + else + { + PIXEL20_50 + PIXEL30_50 + PIXEL31_50 + } + PIXEL21_0 + PIXEL22_0 + if (Diff(w[6], w[8])) + { + PIXEL23_0 + PIXEL32_0 + PIXEL33_0 + } + else + { + PIXEL23_50 + PIXEL32_50 + PIXEL33_50 + } + break; + } +case 74: +case 107: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL01_0 + PIXEL10_0 + } + else + { + PIXEL00_50 + PIXEL01_50 + PIXEL10_50 + } + PIXEL02_10 + PIXEL03_80 + PIXEL11_0 + PIXEL12_30 + PIXEL13_61 + if (Diff(w[8], w[4])) + { + PIXEL20_0 + PIXEL30_0 + PIXEL31_0 + } + else + { + PIXEL20_50 + PIXEL30_50 + PIXEL31_50 + } + PIXEL21_0 + PIXEL22_30 + PIXEL23_61 + PIXEL32_10 + PIXEL33_80 + break; + } +case 27: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL01_0 + PIXEL10_0 + } + else + { + PIXEL00_50 + PIXEL01_50 + PIXEL10_50 + } + PIXEL02_10 + PIXEL03_80 + PIXEL11_0 + PIXEL12_30 + PIXEL13_10 + PIXEL20_10 + PIXEL21_30 + PIXEL22_30 + PIXEL23_10 + PIXEL30_80 + PIXEL31_61 + PIXEL32_61 + PIXEL33_80 + break; + } +case 86: + { + PIXEL00_80 + PIXEL01_10 + if (Diff(w[2], w[6])) + { + PIXEL02_0 + PIXEL03_0 + PIXEL13_0 + } + else + { + PIXEL02_50 + PIXEL03_50 + PIXEL13_50 + } + PIXEL10_61 + PIXEL11_30 + PIXEL12_0 + PIXEL20_61 + PIXEL21_30 + PIXEL22_30 + PIXEL23_10 + PIXEL30_80 + PIXEL31_10 + PIXEL32_10 + PIXEL33_80 + break; + } +case 216: + { + PIXEL00_80 + PIXEL01_61 + PIXEL02_61 + PIXEL03_80 + PIXEL10_10 + PIXEL11_30 + PIXEL12_30 + PIXEL13_10 + PIXEL20_10 + PIXEL21_30 + PIXEL22_0 + if (Diff(w[6], w[8])) + { + PIXEL23_0 + PIXEL32_0 + PIXEL33_0 + } + else + { + PIXEL23_50 + PIXEL32_50 + PIXEL33_50 + } + PIXEL30_80 + PIXEL31_10 + break; + } +case 106: + { + PIXEL00_80 + PIXEL01_10 + PIXEL02_10 + PIXEL03_80 + PIXEL10_10 + PIXEL11_30 + PIXEL12_30 + PIXEL13_61 + if (Diff(w[8], w[4])) + { + PIXEL20_0 + PIXEL30_0 + PIXEL31_0 + } + else + { + PIXEL20_50 + PIXEL30_50 + PIXEL31_50 + } + PIXEL21_0 + PIXEL22_30 + PIXEL23_61 + PIXEL32_10 + PIXEL33_80 + break; + } +case 30: + { + PIXEL00_80 + PIXEL01_10 + if (Diff(w[2], w[6])) + { + PIXEL02_0 + PIXEL03_0 + PIXEL13_0 + } + else + { + PIXEL02_50 + PIXEL03_50 + PIXEL13_50 + } + PIXEL10_10 + PIXEL11_30 + PIXEL12_0 + PIXEL20_10 + PIXEL21_30 + PIXEL22_30 + PIXEL23_10 + PIXEL30_80 + PIXEL31_61 + PIXEL32_61 + PIXEL33_80 + break; + } +case 210: + { + PIXEL00_80 + PIXEL01_10 + PIXEL02_10 + PIXEL03_80 + PIXEL10_61 + PIXEL11_30 + PIXEL12_30 + PIXEL13_10 + PIXEL20_61 + PIXEL21_30 + PIXEL22_0 + if (Diff(w[6], w[8])) + { + PIXEL23_0 + PIXEL32_0 + PIXEL33_0 + } + else + { + PIXEL23_50 + PIXEL32_50 + PIXEL33_50 + } + PIXEL30_80 + PIXEL31_10 + break; + } +case 120: + { + PIXEL00_80 + PIXEL01_61 + PIXEL02_61 + PIXEL03_80 + PIXEL10_10 + PIXEL11_30 + PIXEL12_30 + PIXEL13_10 + if (Diff(w[8], w[4])) + { + PIXEL20_0 + PIXEL30_0 + PIXEL31_0 + } + else + { + PIXEL20_50 + PIXEL30_50 + PIXEL31_50 + } + PIXEL21_0 + PIXEL22_30 + PIXEL23_10 + PIXEL32_10 + PIXEL33_80 + break; + } +case 75: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL01_0 + PIXEL10_0 + } + else + { + PIXEL00_50 + PIXEL01_50 + PIXEL10_50 + } + PIXEL02_10 + PIXEL03_80 + PIXEL11_0 + PIXEL12_30 + PIXEL13_61 + PIXEL20_10 + PIXEL21_30 + PIXEL22_30 + PIXEL23_61 + PIXEL30_80 + PIXEL31_10 + PIXEL32_10 + PIXEL33_80 + break; + } +case 29: + { + PIXEL00_82 + PIXEL01_82 + PIXEL02_81 + PIXEL03_81 + PIXEL10_32 + PIXEL11_32 + PIXEL12_31 + PIXEL13_31 + PIXEL20_10 + PIXEL21_30 + PIXEL22_30 + PIXEL23_10 + PIXEL30_80 + PIXEL31_61 + PIXEL32_61 + PIXEL33_80 + break; + } +case 198: + { + PIXEL00_80 + PIXEL01_10 + PIXEL02_32 + PIXEL03_82 + PIXEL10_61 + PIXEL11_30 + PIXEL12_32 + PIXEL13_82 + PIXEL20_61 + PIXEL21_30 + PIXEL22_31 + PIXEL23_81 + PIXEL30_80 + PIXEL31_10 + PIXEL32_31 + PIXEL33_81 + break; + } +case 184: + { + PIXEL00_80 + PIXEL01_61 + PIXEL02_61 + PIXEL03_80 + PIXEL10_10 + PIXEL11_30 + PIXEL12_30 + PIXEL13_10 + PIXEL20_31 + PIXEL21_31 + PIXEL22_32 + PIXEL23_32 + PIXEL30_81 + PIXEL31_81 + PIXEL32_82 + PIXEL33_82 + break; + } +case 99: + { + PIXEL00_81 + PIXEL01_31 + PIXEL02_10 + PIXEL03_80 + PIXEL10_81 + PIXEL11_31 + PIXEL12_30 + PIXEL13_61 + PIXEL20_82 + PIXEL21_32 + PIXEL22_30 + PIXEL23_61 + PIXEL30_82 + PIXEL31_32 + PIXEL32_10 + PIXEL33_80 + break; + } +case 57: + { + PIXEL00_82 + PIXEL01_82 + PIXEL02_61 + PIXEL03_80 + PIXEL10_32 + PIXEL11_32 + PIXEL12_30 + PIXEL13_10 + PIXEL20_31 + PIXEL21_31 + PIXEL22_30 + PIXEL23_10 + PIXEL30_81 + PIXEL31_81 + PIXEL32_61 + PIXEL33_80 + break; + } +case 71: + { + PIXEL00_81 + PIXEL01_31 + PIXEL02_32 + PIXEL03_82 + PIXEL10_81 + PIXEL11_31 + PIXEL12_32 + PIXEL13_82 + PIXEL20_61 + PIXEL21_30 + PIXEL22_30 + PIXEL23_61 + PIXEL30_80 + PIXEL31_10 + PIXEL32_10 + PIXEL33_80 + break; + } +case 156: + { + PIXEL00_80 + PIXEL01_61 + PIXEL02_81 + PIXEL03_81 + PIXEL10_10 + PIXEL11_30 + PIXEL12_31 + PIXEL13_31 + PIXEL20_10 + PIXEL21_30 + PIXEL22_32 + PIXEL23_32 + PIXEL30_80 + PIXEL31_61 + PIXEL32_82 + PIXEL33_82 + break; + } +case 226: + { + PIXEL00_80 + PIXEL01_10 + PIXEL02_10 + PIXEL03_80 + PIXEL10_61 + PIXEL11_30 + PIXEL12_30 + PIXEL13_61 + PIXEL20_82 + PIXEL21_32 + PIXEL22_31 + PIXEL23_81 + PIXEL30_82 + PIXEL31_32 + PIXEL32_31 + PIXEL33_81 + break; + } +case 60: + { + PIXEL00_80 + PIXEL01_61 + PIXEL02_81 + PIXEL03_81 + PIXEL10_10 + PIXEL11_30 + PIXEL12_31 + PIXEL13_31 + PIXEL20_31 + PIXEL21_31 + PIXEL22_30 + PIXEL23_10 + PIXEL30_81 + PIXEL31_81 + PIXEL32_61 + PIXEL33_80 + break; + } +case 195: + { + PIXEL00_81 + PIXEL01_31 + PIXEL02_10 + PIXEL03_80 + PIXEL10_81 + PIXEL11_31 + PIXEL12_30 + PIXEL13_61 + PIXEL20_61 + PIXEL21_30 + PIXEL22_31 + PIXEL23_81 + PIXEL30_80 + PIXEL31_10 + PIXEL32_31 + PIXEL33_81 + break; + } +case 102: + { + PIXEL00_80 + PIXEL01_10 + PIXEL02_32 + PIXEL03_82 + PIXEL10_61 + PIXEL11_30 + PIXEL12_32 + PIXEL13_82 + PIXEL20_82 + PIXEL21_32 + PIXEL22_30 + PIXEL23_61 + PIXEL30_82 + PIXEL31_32 + PIXEL32_10 + PIXEL33_80 + break; + } +case 153: + { + PIXEL00_82 + PIXEL01_82 + PIXEL02_61 + PIXEL03_80 + PIXEL10_32 + PIXEL11_32 + PIXEL12_30 + PIXEL13_10 + PIXEL20_10 + PIXEL21_30 + PIXEL22_32 + PIXEL23_32 + PIXEL30_80 + PIXEL31_61 + PIXEL32_82 + PIXEL33_82 + break; + } +case 58: + { + if (Diff(w[4], w[2])) + { + PIXEL00_80 + PIXEL01_10 + PIXEL10_10 + PIXEL11_30 + } + else + { + PIXEL00_20 + PIXEL01_12 + PIXEL10_11 + PIXEL11_0 + } + if (Diff(w[2], w[6])) + { + PIXEL02_10 + PIXEL03_80 + PIXEL12_30 + PIXEL13_10 + } + else + { + PIXEL02_11 + PIXEL03_20 + PIXEL12_0 + PIXEL13_12 + } + PIXEL20_31 + PIXEL21_31 + PIXEL22_30 + PIXEL23_10 + PIXEL30_81 + PIXEL31_81 + PIXEL32_61 + PIXEL33_80 + break; + } +case 83: + { + PIXEL00_81 + PIXEL01_31 + if (Diff(w[2], w[6])) + { + PIXEL02_10 + PIXEL03_80 + PIXEL12_30 + PIXEL13_10 + } + else + { + PIXEL02_11 + PIXEL03_20 + PIXEL12_0 + PIXEL13_12 + } + PIXEL10_81 + PIXEL11_31 + PIXEL20_61 + PIXEL21_30 + if (Diff(w[6], w[8])) + { + PIXEL22_30 + PIXEL23_10 + PIXEL32_10 + PIXEL33_80 + } + else + { + PIXEL22_0 + PIXEL23_11 + PIXEL32_12 + PIXEL33_20 + } + PIXEL30_80 + PIXEL31_10 + break; + } +case 92: + { + PIXEL00_80 + PIXEL01_61 + PIXEL02_81 + PIXEL03_81 + PIXEL10_10 + PIXEL11_30 + PIXEL12_31 + PIXEL13_31 + if (Diff(w[8], w[4])) + { + PIXEL20_10 + PIXEL21_30 + PIXEL30_80 + PIXEL31_10 + } + else + { + PIXEL20_12 + PIXEL21_0 + PIXEL30_20 + PIXEL31_11 + } + if (Diff(w[6], w[8])) + { + PIXEL22_30 + PIXEL23_10 + PIXEL32_10 + PIXEL33_80 + } + else + { + PIXEL22_0 + PIXEL23_11 + PIXEL32_12 + PIXEL33_20 + } + break; + } +case 202: + { + if (Diff(w[4], w[2])) + { + PIXEL00_80 + PIXEL01_10 + PIXEL10_10 + PIXEL11_30 + } + else + { + PIXEL00_20 + PIXEL01_12 + PIXEL10_11 + PIXEL11_0 + } + PIXEL02_10 + PIXEL03_80 + PIXEL12_30 + PIXEL13_61 + if (Diff(w[8], w[4])) + { + PIXEL20_10 + PIXEL21_30 + PIXEL30_80 + PIXEL31_10 + } + else + { + PIXEL20_12 + PIXEL21_0 + PIXEL30_20 + PIXEL31_11 + } + PIXEL22_31 + PIXEL23_81 + PIXEL32_31 + PIXEL33_81 + break; + } +case 78: + { + if (Diff(w[4], w[2])) + { + PIXEL00_80 + PIXEL01_10 + PIXEL10_10 + PIXEL11_30 + } + else + { + PIXEL00_20 + PIXEL01_12 + PIXEL10_11 + PIXEL11_0 + } + PIXEL02_32 + PIXEL03_82 + PIXEL12_32 + PIXEL13_82 + if (Diff(w[8], w[4])) + { + PIXEL20_10 + PIXEL21_30 + PIXEL30_80 + PIXEL31_10 + } + else + { + PIXEL20_12 + PIXEL21_0 + PIXEL30_20 + PIXEL31_11 + } + PIXEL22_30 + PIXEL23_61 + PIXEL32_10 + PIXEL33_80 + break; + } +case 154: + { + if (Diff(w[4], w[2])) + { + PIXEL00_80 + PIXEL01_10 + PIXEL10_10 + PIXEL11_30 + } + else + { + PIXEL00_20 + PIXEL01_12 + PIXEL10_11 + PIXEL11_0 + } + if (Diff(w[2], w[6])) + { + PIXEL02_10 + PIXEL03_80 + PIXEL12_30 + PIXEL13_10 + } + else + { + PIXEL02_11 + PIXEL03_20 + PIXEL12_0 + PIXEL13_12 + } + PIXEL20_10 + PIXEL21_30 + PIXEL22_32 + PIXEL23_32 + PIXEL30_80 + PIXEL31_61 + PIXEL32_82 + PIXEL33_82 + break; + } +case 114: + { + PIXEL00_80 + PIXEL01_10 + if (Diff(w[2], w[6])) + { + PIXEL02_10 + PIXEL03_80 + PIXEL12_30 + PIXEL13_10 + } + else + { + PIXEL02_11 + PIXEL03_20 + PIXEL12_0 + PIXEL13_12 + } + PIXEL10_61 + PIXEL11_30 + PIXEL20_82 + PIXEL21_32 + if (Diff(w[6], w[8])) + { + PIXEL22_30 + PIXEL23_10 + PIXEL32_10 + PIXEL33_80 + } + else + { + PIXEL22_0 + PIXEL23_11 + PIXEL32_12 + PIXEL33_20 + } + PIXEL30_82 + PIXEL31_32 + break; + } +case 89: + { + PIXEL00_82 + PIXEL01_82 + PIXEL02_61 + PIXEL03_80 + PIXEL10_32 + PIXEL11_32 + PIXEL12_30 + PIXEL13_10 + if (Diff(w[8], w[4])) + { + PIXEL20_10 + PIXEL21_30 + PIXEL30_80 + PIXEL31_10 + } + else + { + PIXEL20_12 + PIXEL21_0 + PIXEL30_20 + PIXEL31_11 + } + if (Diff(w[6], w[8])) + { + PIXEL22_30 + PIXEL23_10 + PIXEL32_10 + PIXEL33_80 + } + else + { + PIXEL22_0 + PIXEL23_11 + PIXEL32_12 + PIXEL33_20 + } + break; + } +case 90: + { + if (Diff(w[4], w[2])) + { + PIXEL00_80 + PIXEL01_10 + PIXEL10_10 + PIXEL11_30 + } + else + { + PIXEL00_20 + PIXEL01_12 + PIXEL10_11 + PIXEL11_0 + } + if (Diff(w[2], w[6])) + { + PIXEL02_10 + PIXEL03_80 + PIXEL12_30 + PIXEL13_10 + } + else + { + PIXEL02_11 + PIXEL03_20 + PIXEL12_0 + PIXEL13_12 + } + if (Diff(w[8], w[4])) + { + PIXEL20_10 + PIXEL21_30 + PIXEL30_80 + PIXEL31_10 + } + else + { + PIXEL20_12 + PIXEL21_0 + PIXEL30_20 + PIXEL31_11 + } + if (Diff(w[6], w[8])) + { + PIXEL22_30 + PIXEL23_10 + PIXEL32_10 + PIXEL33_80 + } + else + { + PIXEL22_0 + PIXEL23_11 + PIXEL32_12 + PIXEL33_20 + } + break; + } +case 55: +case 23: + { + if (Diff(w[2], w[6])) + { + PIXEL00_81 + PIXEL01_31 + PIXEL02_0 + PIXEL03_0 + PIXEL12_0 + PIXEL13_0 + } + else + { + PIXEL00_12 + PIXEL01_14 + PIXEL02_83 + PIXEL03_50 + PIXEL12_70 + PIXEL13_21 + } + PIXEL10_81 + PIXEL11_31 + PIXEL20_60 + PIXEL21_70 + PIXEL22_30 + PIXEL23_10 + PIXEL30_20 + PIXEL31_60 + PIXEL32_61 + PIXEL33_80 + break; + } +case 182: +case 150: + { + PIXEL00_80 + PIXEL01_10 + if (Diff(w[2], w[6])) + { + PIXEL02_0 + PIXEL03_0 + PIXEL12_0 + PIXEL13_0 + PIXEL23_32 + PIXEL33_82 + } + else + { + PIXEL02_21 + PIXEL03_50 + PIXEL12_70 + PIXEL13_83 + PIXEL23_13 + PIXEL33_11 + } + PIXEL10_61 + PIXEL11_30 + PIXEL20_60 + PIXEL21_70 + PIXEL22_32 + PIXEL30_20 + PIXEL31_60 + PIXEL32_82 + break; + } +case 213: +case 212: + { + PIXEL00_20 + PIXEL01_60 + PIXEL02_81 + if (Diff(w[6], w[8])) + { + PIXEL03_81 + PIXEL13_31 + PIXEL22_0 + PIXEL23_0 + PIXEL32_0 + PIXEL33_0 + } + else + { + PIXEL03_12 + PIXEL13_14 + PIXEL22_70 + PIXEL23_83 + PIXEL32_21 + PIXEL33_50 + } + PIXEL10_60 + PIXEL11_70 + PIXEL12_31 + PIXEL20_61 + PIXEL21_30 + PIXEL30_80 + PIXEL31_10 + break; + } +case 241: +case 240: + { + PIXEL00_20 + PIXEL01_60 + PIXEL02_61 + PIXEL03_80 + PIXEL10_60 + PIXEL11_70 + PIXEL12_30 + PIXEL13_10 + PIXEL20_82 + PIXEL21_32 + if (Diff(w[6], w[8])) + { + PIXEL22_0 + PIXEL23_0 + PIXEL30_82 + PIXEL31_32 + PIXEL32_0 + PIXEL33_0 + } + else + { + PIXEL22_70 + PIXEL23_21 + PIXEL30_11 + PIXEL31_13 + PIXEL32_83 + PIXEL33_50 + } + break; + } +case 236: +case 232: + { + PIXEL00_80 + PIXEL01_61 + PIXEL02_60 + PIXEL03_20 + PIXEL10_10 + PIXEL11_30 + PIXEL12_70 + PIXEL13_60 + if (Diff(w[8], w[4])) + { + PIXEL20_0 + PIXEL21_0 + PIXEL30_0 + PIXEL31_0 + PIXEL32_31 + PIXEL33_81 + } + else + { + PIXEL20_21 + PIXEL21_70 + PIXEL30_50 + PIXEL31_83 + PIXEL32_14 + PIXEL33_12 + } + PIXEL22_31 + PIXEL23_81 + break; + } +case 109: +case 105: + { + if (Diff(w[8], w[4])) + { + PIXEL00_82 + PIXEL10_32 + PIXEL20_0 + PIXEL21_0 + PIXEL30_0 + PIXEL31_0 + } + else + { + PIXEL00_11 + PIXEL10_13 + PIXEL20_83 + PIXEL21_70 + PIXEL30_50 + PIXEL31_21 + } + PIXEL01_82 + PIXEL02_60 + PIXEL03_20 + PIXEL11_32 + PIXEL12_70 + PIXEL13_60 + PIXEL22_30 + PIXEL23_61 + PIXEL32_10 + PIXEL33_80 + break; + } +case 171: +case 43: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL01_0 + PIXEL10_0 + PIXEL11_0 + PIXEL20_31 + PIXEL30_81 + } + else + { + PIXEL00_50 + PIXEL01_21 + PIXEL10_83 + PIXEL11_70 + PIXEL20_14 + PIXEL30_12 + } + PIXEL02_10 + PIXEL03_80 + PIXEL12_30 + PIXEL13_61 + PIXEL21_31 + PIXEL22_70 + PIXEL23_60 + PIXEL31_81 + PIXEL32_60 + PIXEL33_20 + break; + } +case 143: +case 15: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL01_0 + PIXEL02_32 + PIXEL03_82 + PIXEL10_0 + PIXEL11_0 + } + else + { + PIXEL00_50 + PIXEL01_83 + PIXEL02_13 + PIXEL03_11 + PIXEL10_21 + PIXEL11_70 + } + PIXEL12_32 + PIXEL13_82 + PIXEL20_10 + PIXEL21_30 + PIXEL22_70 + PIXEL23_60 + PIXEL30_80 + PIXEL31_61 + PIXEL32_60 + PIXEL33_20 + break; + } +case 124: + { + PIXEL00_80 + PIXEL01_61 + PIXEL02_81 + PIXEL03_81 + PIXEL10_10 + PIXEL11_30 + PIXEL12_31 + PIXEL13_31 + if (Diff(w[8], w[4])) + { + PIXEL20_0 + PIXEL30_0 + PIXEL31_0 + } + else + { + PIXEL20_50 + PIXEL30_50 + PIXEL31_50 + } + PIXEL21_0 + PIXEL22_30 + PIXEL23_10 + PIXEL32_10 + PIXEL33_80 + break; + } +case 203: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL01_0 + PIXEL10_0 + } + else + { + PIXEL00_50 + PIXEL01_50 + PIXEL10_50 + } + PIXEL02_10 + PIXEL03_80 + PIXEL11_0 + PIXEL12_30 + PIXEL13_61 + PIXEL20_10 + PIXEL21_30 + PIXEL22_31 + PIXEL23_81 + PIXEL30_80 + PIXEL31_10 + PIXEL32_31 + PIXEL33_81 + break; + } +case 62: + { + PIXEL00_80 + PIXEL01_10 + if (Diff(w[2], w[6])) + { + PIXEL02_0 + PIXEL03_0 + PIXEL13_0 + } + else + { + PIXEL02_50 + PIXEL03_50 + PIXEL13_50 + } + PIXEL10_10 + PIXEL11_30 + PIXEL12_0 + PIXEL20_31 + PIXEL21_31 + PIXEL22_30 + PIXEL23_10 + PIXEL30_81 + PIXEL31_81 + PIXEL32_61 + PIXEL33_80 + break; + } +case 211: + { + PIXEL00_81 + PIXEL01_31 + PIXEL02_10 + PIXEL03_80 + PIXEL10_81 + PIXEL11_31 + PIXEL12_30 + PIXEL13_10 + PIXEL20_61 + PIXEL21_30 + PIXEL22_0 + if (Diff(w[6], w[8])) + { + PIXEL23_0 + PIXEL32_0 + PIXEL33_0 + } + else + { + PIXEL23_50 + PIXEL32_50 + PIXEL33_50 + } + PIXEL30_80 + PIXEL31_10 + break; + } +case 118: + { + PIXEL00_80 + PIXEL01_10 + if (Diff(w[2], w[6])) + { + PIXEL02_0 + PIXEL03_0 + PIXEL13_0 + } + else + { + PIXEL02_50 + PIXEL03_50 + PIXEL13_50 + } + PIXEL10_61 + PIXEL11_30 + PIXEL12_0 + PIXEL20_82 + PIXEL21_32 + PIXEL22_30 + PIXEL23_10 + PIXEL30_82 + PIXEL31_32 + PIXEL32_10 + PIXEL33_80 + break; + } +case 217: + { + PIXEL00_82 + PIXEL01_82 + PIXEL02_61 + PIXEL03_80 + PIXEL10_32 + PIXEL11_32 + PIXEL12_30 + PIXEL13_10 + PIXEL20_10 + PIXEL21_30 + PIXEL22_0 + if (Diff(w[6], w[8])) + { + PIXEL23_0 + PIXEL32_0 + PIXEL33_0 + } + else + { + PIXEL23_50 + PIXEL32_50 + PIXEL33_50 + } + PIXEL30_80 + PIXEL31_10 + break; + } +case 110: + { + PIXEL00_80 + PIXEL01_10 + PIXEL02_32 + PIXEL03_82 + PIXEL10_10 + PIXEL11_30 + PIXEL12_32 + PIXEL13_82 + if (Diff(w[8], w[4])) + { + PIXEL20_0 + PIXEL30_0 + PIXEL31_0 + } + else + { + PIXEL20_50 + PIXEL30_50 + PIXEL31_50 + } + PIXEL21_0 + PIXEL22_30 + PIXEL23_61 + PIXEL32_10 + PIXEL33_80 + break; + } +case 155: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL01_0 + PIXEL10_0 + } + else + { + PIXEL00_50 + PIXEL01_50 + PIXEL10_50 + } + PIXEL02_10 + PIXEL03_80 + PIXEL11_0 + PIXEL12_30 + PIXEL13_10 + PIXEL20_10 + PIXEL21_30 + PIXEL22_32 + PIXEL23_32 + PIXEL30_80 + PIXEL31_61 + PIXEL32_82 + PIXEL33_82 + break; + } +case 188: + { + PIXEL00_80 + PIXEL01_61 + PIXEL02_81 + PIXEL03_81 + PIXEL10_10 + PIXEL11_30 + PIXEL12_31 + PIXEL13_31 + PIXEL20_31 + PIXEL21_31 + PIXEL22_32 + PIXEL23_32 + PIXEL30_81 + PIXEL31_81 + PIXEL32_82 + PIXEL33_82 + break; + } +case 185: + { + PIXEL00_82 + PIXEL01_82 + PIXEL02_61 + PIXEL03_80 + PIXEL10_32 + PIXEL11_32 + PIXEL12_30 + PIXEL13_10 + PIXEL20_31 + PIXEL21_31 + PIXEL22_32 + PIXEL23_32 + PIXEL30_81 + PIXEL31_81 + PIXEL32_82 + PIXEL33_82 + break; + } +case 61: + { + PIXEL00_82 + PIXEL01_82 + PIXEL02_81 + PIXEL03_81 + PIXEL10_32 + PIXEL11_32 + PIXEL12_31 + PIXEL13_31 + PIXEL20_31 + PIXEL21_31 + PIXEL22_30 + PIXEL23_10 + PIXEL30_81 + PIXEL31_81 + PIXEL32_61 + PIXEL33_80 + break; + } +case 157: + { + PIXEL00_82 + PIXEL01_82 + PIXEL02_81 + PIXEL03_81 + PIXEL10_32 + PIXEL11_32 + PIXEL12_31 + PIXEL13_31 + PIXEL20_10 + PIXEL21_30 + PIXEL22_32 + PIXEL23_32 + PIXEL30_80 + PIXEL31_61 + PIXEL32_82 + PIXEL33_82 + break; + } +case 103: + { + PIXEL00_81 + PIXEL01_31 + PIXEL02_32 + PIXEL03_82 + PIXEL10_81 + PIXEL11_31 + PIXEL12_32 + PIXEL13_82 + PIXEL20_82 + PIXEL21_32 + PIXEL22_30 + PIXEL23_61 + PIXEL30_82 + PIXEL31_32 + PIXEL32_10 + PIXEL33_80 + break; + } +case 227: + { + PIXEL00_81 + PIXEL01_31 + PIXEL02_10 + PIXEL03_80 + PIXEL10_81 + PIXEL11_31 + PIXEL12_30 + PIXEL13_61 + PIXEL20_82 + PIXEL21_32 + PIXEL22_31 + PIXEL23_81 + PIXEL30_82 + PIXEL31_32 + PIXEL32_31 + PIXEL33_81 + break; + } +case 230: + { + PIXEL00_80 + PIXEL01_10 + PIXEL02_32 + PIXEL03_82 + PIXEL10_61 + PIXEL11_30 + PIXEL12_32 + PIXEL13_82 + PIXEL20_82 + PIXEL21_32 + PIXEL22_31 + PIXEL23_81 + PIXEL30_82 + PIXEL31_32 + PIXEL32_31 + PIXEL33_81 + break; + } +case 199: + { + PIXEL00_81 + PIXEL01_31 + PIXEL02_32 + PIXEL03_82 + PIXEL10_81 + PIXEL11_31 + PIXEL12_32 + PIXEL13_82 + PIXEL20_61 + PIXEL21_30 + PIXEL22_31 + PIXEL23_81 + PIXEL30_80 + PIXEL31_10 + PIXEL32_31 + PIXEL33_81 + break; + } +case 220: + { + PIXEL00_80 + PIXEL01_61 + PIXEL02_81 + PIXEL03_81 + PIXEL10_10 + PIXEL11_30 + PIXEL12_31 + PIXEL13_31 + if (Diff(w[8], w[4])) + { + PIXEL20_10 + PIXEL21_30 + PIXEL30_80 + PIXEL31_10 + } + else + { + PIXEL20_12 + PIXEL21_0 + PIXEL30_20 + PIXEL31_11 + } + PIXEL22_0 + if (Diff(w[6], w[8])) + { + PIXEL23_0 + PIXEL32_0 + PIXEL33_0 + } + else + { + PIXEL23_50 + PIXEL32_50 + PIXEL33_50 + } + break; + } +case 158: + { + if (Diff(w[4], w[2])) + { + PIXEL00_80 + PIXEL01_10 + PIXEL10_10 + PIXEL11_30 + } + else + { + PIXEL00_20 + PIXEL01_12 + PIXEL10_11 + PIXEL11_0 + } + if (Diff(w[2], w[6])) + { + PIXEL02_0 + PIXEL03_0 + PIXEL13_0 + } + else + { + PIXEL02_50 + PIXEL03_50 + PIXEL13_50 + } + PIXEL12_0 + PIXEL20_10 + PIXEL21_30 + PIXEL22_32 + PIXEL23_32 + PIXEL30_80 + PIXEL31_61 + PIXEL32_82 + PIXEL33_82 + break; + } +case 234: + { + if (Diff(w[4], w[2])) + { + PIXEL00_80 + PIXEL01_10 + PIXEL10_10 + PIXEL11_30 + } + else + { + PIXEL00_20 + PIXEL01_12 + PIXEL10_11 + PIXEL11_0 + } + PIXEL02_10 + PIXEL03_80 + PIXEL12_30 + PIXEL13_61 + if (Diff(w[8], w[4])) + { + PIXEL20_0 + PIXEL30_0 + PIXEL31_0 + } + else + { + PIXEL20_50 + PIXEL30_50 + PIXEL31_50 + } + PIXEL21_0 + PIXEL22_31 + PIXEL23_81 + PIXEL32_31 + PIXEL33_81 + break; + } +case 242: + { + PIXEL00_80 + PIXEL01_10 + if (Diff(w[2], w[6])) + { + PIXEL02_10 + PIXEL03_80 + PIXEL12_30 + PIXEL13_10 + } + else + { + PIXEL02_11 + PIXEL03_20 + PIXEL12_0 + PIXEL13_12 + } + PIXEL10_61 + PIXEL11_30 + PIXEL20_82 + PIXEL21_32 + PIXEL22_0 + if (Diff(w[6], w[8])) + { + PIXEL23_0 + PIXEL32_0 + PIXEL33_0 + } + else + { + PIXEL23_50 + PIXEL32_50 + PIXEL33_50 + } + PIXEL30_82 + PIXEL31_32 + break; + } +case 59: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL01_0 + PIXEL10_0 + } + else + { + PIXEL00_50 + PIXEL01_50 + PIXEL10_50 + } + if (Diff(w[2], w[6])) + { + PIXEL02_10 + PIXEL03_80 + PIXEL12_30 + PIXEL13_10 + } + else + { + PIXEL02_11 + PIXEL03_20 + PIXEL12_0 + PIXEL13_12 + } + PIXEL11_0 + PIXEL20_31 + PIXEL21_31 + PIXEL22_30 + PIXEL23_10 + PIXEL30_81 + PIXEL31_81 + PIXEL32_61 + PIXEL33_80 + break; + } +case 121: + { + PIXEL00_82 + PIXEL01_82 + PIXEL02_61 + PIXEL03_80 + PIXEL10_32 + PIXEL11_32 + PIXEL12_30 + PIXEL13_10 + if (Diff(w[8], w[4])) + { + PIXEL20_0 + PIXEL30_0 + PIXEL31_0 + } + else + { + PIXEL20_50 + PIXEL30_50 + PIXEL31_50 + } + PIXEL21_0 + if (Diff(w[6], w[8])) + { + PIXEL22_30 + PIXEL23_10 + PIXEL32_10 + PIXEL33_80 + } + else + { + PIXEL22_0 + PIXEL23_11 + PIXEL32_12 + PIXEL33_20 + } + break; + } +case 87: + { + PIXEL00_81 + PIXEL01_31 + if (Diff(w[2], w[6])) + { + PIXEL02_0 + PIXEL03_0 + PIXEL13_0 + } + else + { + PIXEL02_50 + PIXEL03_50 + PIXEL13_50 + } + PIXEL10_81 + PIXEL11_31 + PIXEL12_0 + PIXEL20_61 + PIXEL21_30 + if (Diff(w[6], w[8])) + { + PIXEL22_30 + PIXEL23_10 + PIXEL32_10 + PIXEL33_80 + } + else + { + PIXEL22_0 + PIXEL23_11 + PIXEL32_12 + PIXEL33_20 + } + PIXEL30_80 + PIXEL31_10 + break; + } +case 79: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL01_0 + PIXEL10_0 + } + else + { + PIXEL00_50 + PIXEL01_50 + PIXEL10_50 + } + PIXEL02_32 + PIXEL03_82 + PIXEL11_0 + PIXEL12_32 + PIXEL13_82 + if (Diff(w[8], w[4])) + { + PIXEL20_10 + PIXEL21_30 + PIXEL30_80 + PIXEL31_10 + } + else + { + PIXEL20_12 + PIXEL21_0 + PIXEL30_20 + PIXEL31_11 + } + PIXEL22_30 + PIXEL23_61 + PIXEL32_10 + PIXEL33_80 + break; + } +case 122: + { + if (Diff(w[4], w[2])) + { + PIXEL00_80 + PIXEL01_10 + PIXEL10_10 + PIXEL11_30 + } + else + { + PIXEL00_20 + PIXEL01_12 + PIXEL10_11 + PIXEL11_0 + } + if (Diff(w[2], w[6])) + { + PIXEL02_10 + PIXEL03_80 + PIXEL12_30 + PIXEL13_10 + } + else + { + PIXEL02_11 + PIXEL03_20 + PIXEL12_0 + PIXEL13_12 + } + if (Diff(w[8], w[4])) + { + PIXEL20_0 + PIXEL30_0 + PIXEL31_0 + } + else + { + PIXEL20_50 + PIXEL30_50 + PIXEL31_50 + } + PIXEL21_0 + if (Diff(w[6], w[8])) + { + PIXEL22_30 + PIXEL23_10 + PIXEL32_10 + PIXEL33_80 + } + else + { + PIXEL22_0 + PIXEL23_11 + PIXEL32_12 + PIXEL33_20 + } + break; + } +case 94: + { + if (Diff(w[4], w[2])) + { + PIXEL00_80 + PIXEL01_10 + PIXEL10_10 + PIXEL11_30 + } + else + { + PIXEL00_20 + PIXEL01_12 + PIXEL10_11 + PIXEL11_0 + } + if (Diff(w[2], w[6])) + { + PIXEL02_0 + PIXEL03_0 + PIXEL13_0 + } + else + { + PIXEL02_50 + PIXEL03_50 + PIXEL13_50 + } + PIXEL12_0 + if (Diff(w[8], w[4])) + { + PIXEL20_10 + PIXEL21_30 + PIXEL30_80 + PIXEL31_10 + } + else + { + PIXEL20_12 + PIXEL21_0 + PIXEL30_20 + PIXEL31_11 + } + if (Diff(w[6], w[8])) + { + PIXEL22_30 + PIXEL23_10 + PIXEL32_10 + PIXEL33_80 + } + else + { + PIXEL22_0 + PIXEL23_11 + PIXEL32_12 + PIXEL33_20 + } + break; + } +case 218: + { + if (Diff(w[4], w[2])) + { + PIXEL00_80 + PIXEL01_10 + PIXEL10_10 + PIXEL11_30 + } + else + { + PIXEL00_20 + PIXEL01_12 + PIXEL10_11 + PIXEL11_0 + } + if (Diff(w[2], w[6])) + { + PIXEL02_10 + PIXEL03_80 + PIXEL12_30 + PIXEL13_10 + } + else + { + PIXEL02_11 + PIXEL03_20 + PIXEL12_0 + PIXEL13_12 + } + if (Diff(w[8], w[4])) + { + PIXEL20_10 + PIXEL21_30 + PIXEL30_80 + PIXEL31_10 + } + else + { + PIXEL20_12 + PIXEL21_0 + PIXEL30_20 + PIXEL31_11 + } + PIXEL22_0 + if (Diff(w[6], w[8])) + { + PIXEL23_0 + PIXEL32_0 + PIXEL33_0 + } + else + { + PIXEL23_50 + PIXEL32_50 + PIXEL33_50 + } + break; + } +case 91: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL01_0 + PIXEL10_0 + } + else + { + PIXEL00_50 + PIXEL01_50 + PIXEL10_50 + } + if (Diff(w[2], w[6])) + { + PIXEL02_10 + PIXEL03_80 + PIXEL12_30 + PIXEL13_10 + } + else + { + PIXEL02_11 + PIXEL03_20 + PIXEL12_0 + PIXEL13_12 + } + PIXEL11_0 + if (Diff(w[8], w[4])) + { + PIXEL20_10 + PIXEL21_30 + PIXEL30_80 + PIXEL31_10 + } + else + { + PIXEL20_12 + PIXEL21_0 + PIXEL30_20 + PIXEL31_11 + } + if (Diff(w[6], w[8])) + { + PIXEL22_30 + PIXEL23_10 + PIXEL32_10 + PIXEL33_80 + } + else + { + PIXEL22_0 + PIXEL23_11 + PIXEL32_12 + PIXEL33_20 + } + break; + } +case 229: + { + PIXEL00_20 + PIXEL01_60 + PIXEL02_60 + PIXEL03_20 + PIXEL10_60 + PIXEL11_70 + PIXEL12_70 + PIXEL13_60 + PIXEL20_82 + PIXEL21_32 + PIXEL22_31 + PIXEL23_81 + PIXEL30_82 + PIXEL31_32 + PIXEL32_31 + PIXEL33_81 + break; + } +case 167: + { + PIXEL00_81 + PIXEL01_31 + PIXEL02_32 + PIXEL03_82 + PIXEL10_81 + PIXEL11_31 + PIXEL12_32 + PIXEL13_82 + PIXEL20_60 + PIXEL21_70 + PIXEL22_70 + PIXEL23_60 + PIXEL30_20 + PIXEL31_60 + PIXEL32_60 + PIXEL33_20 + break; + } +case 173: + { + PIXEL00_82 + PIXEL01_82 + PIXEL02_60 + PIXEL03_20 + PIXEL10_32 + PIXEL11_32 + PIXEL12_70 + PIXEL13_60 + PIXEL20_31 + PIXEL21_31 + PIXEL22_70 + PIXEL23_60 + PIXEL30_81 + PIXEL31_81 + PIXEL32_60 + PIXEL33_20 + break; + } +case 181: + { + PIXEL00_20 + PIXEL01_60 + PIXEL02_81 + PIXEL03_81 + PIXEL10_60 + PIXEL11_70 + PIXEL12_31 + PIXEL13_31 + PIXEL20_60 + PIXEL21_70 + PIXEL22_32 + PIXEL23_32 + PIXEL30_20 + PIXEL31_60 + PIXEL32_82 + PIXEL33_82 + break; + } +case 186: + { + if (Diff(w[4], w[2])) + { + PIXEL00_80 + PIXEL01_10 + PIXEL10_10 + PIXEL11_30 + } + else + { + PIXEL00_20 + PIXEL01_12 + PIXEL10_11 + PIXEL11_0 + } + if (Diff(w[2], w[6])) + { + PIXEL02_10 + PIXEL03_80 + PIXEL12_30 + PIXEL13_10 + } + else + { + PIXEL02_11 + PIXEL03_20 + PIXEL12_0 + PIXEL13_12 + } + PIXEL20_31 + PIXEL21_31 + PIXEL22_32 + PIXEL23_32 + PIXEL30_81 + PIXEL31_81 + PIXEL32_82 + PIXEL33_82 + break; + } +case 115: + { + PIXEL00_81 + PIXEL01_31 + if (Diff(w[2], w[6])) + { + PIXEL02_10 + PIXEL03_80 + PIXEL12_30 + PIXEL13_10 + } + else + { + PIXEL02_11 + PIXEL03_20 + PIXEL12_0 + PIXEL13_12 + } + PIXEL10_81 + PIXEL11_31 + PIXEL20_82 + PIXEL21_32 + if (Diff(w[6], w[8])) + { + PIXEL22_30 + PIXEL23_10 + PIXEL32_10 + PIXEL33_80 + } + else + { + PIXEL22_0 + PIXEL23_11 + PIXEL32_12 + PIXEL33_20 + } + PIXEL30_82 + PIXEL31_32 + break; + } +case 93: + { + PIXEL00_82 + PIXEL01_82 + PIXEL02_81 + PIXEL03_81 + PIXEL10_32 + PIXEL11_32 + PIXEL12_31 + PIXEL13_31 + if (Diff(w[8], w[4])) + { + PIXEL20_10 + PIXEL21_30 + PIXEL30_80 + PIXEL31_10 + } + else + { + PIXEL20_12 + PIXEL21_0 + PIXEL30_20 + PIXEL31_11 + } + if (Diff(w[6], w[8])) + { + PIXEL22_30 + PIXEL23_10 + PIXEL32_10 + PIXEL33_80 + } + else + { + PIXEL22_0 + PIXEL23_11 + PIXEL32_12 + PIXEL33_20 + } + break; + } +case 206: + { + if (Diff(w[4], w[2])) + { + PIXEL00_80 + PIXEL01_10 + PIXEL10_10 + PIXEL11_30 + } + else + { + PIXEL00_20 + PIXEL01_12 + PIXEL10_11 + PIXEL11_0 + } + PIXEL02_32 + PIXEL03_82 + PIXEL12_32 + PIXEL13_82 + if (Diff(w[8], w[4])) + { + PIXEL20_10 + PIXEL21_30 + PIXEL30_80 + PIXEL31_10 + } + else + { + PIXEL20_12 + PIXEL21_0 + PIXEL30_20 + PIXEL31_11 + } + PIXEL22_31 + PIXEL23_81 + PIXEL32_31 + PIXEL33_81 + break; + } +case 205: +case 201: + { + PIXEL00_82 + PIXEL01_82 + PIXEL02_60 + PIXEL03_20 + PIXEL10_32 + PIXEL11_32 + PIXEL12_70 + PIXEL13_60 + if (Diff(w[8], w[4])) + { + PIXEL20_10 + PIXEL21_30 + PIXEL30_80 + PIXEL31_10 + } + else + { + PIXEL20_12 + PIXEL21_0 + PIXEL30_20 + PIXEL31_11 + } + PIXEL22_31 + PIXEL23_81 + PIXEL32_31 + PIXEL33_81 + break; + } +case 174: +case 46: + { + if (Diff(w[4], w[2])) + { + PIXEL00_80 + PIXEL01_10 + PIXEL10_10 + PIXEL11_30 + } + else + { + PIXEL00_20 + PIXEL01_12 + PIXEL10_11 + PIXEL11_0 + } + PIXEL02_32 + PIXEL03_82 + PIXEL12_32 + PIXEL13_82 + PIXEL20_31 + PIXEL21_31 + PIXEL22_70 + PIXEL23_60 + PIXEL30_81 + PIXEL31_81 + PIXEL32_60 + PIXEL33_20 + break; + } +case 179: +case 147: + { + PIXEL00_81 + PIXEL01_31 + if (Diff(w[2], w[6])) + { + PIXEL02_10 + PIXEL03_80 + PIXEL12_30 + PIXEL13_10 + } + else + { + PIXEL02_11 + PIXEL03_20 + PIXEL12_0 + PIXEL13_12 + } + PIXEL10_81 + PIXEL11_31 + PIXEL20_60 + PIXEL21_70 + PIXEL22_32 + PIXEL23_32 + PIXEL30_20 + PIXEL31_60 + PIXEL32_82 + PIXEL33_82 + break; + } +case 117: +case 116: + { + PIXEL00_20 + PIXEL01_60 + PIXEL02_81 + PIXEL03_81 + PIXEL10_60 + PIXEL11_70 + PIXEL12_31 + PIXEL13_31 + PIXEL20_82 + PIXEL21_32 + if (Diff(w[6], w[8])) + { + PIXEL22_30 + PIXEL23_10 + PIXEL32_10 + PIXEL33_80 + } + else + { + PIXEL22_0 + PIXEL23_11 + PIXEL32_12 + PIXEL33_20 + } + PIXEL30_82 + PIXEL31_32 + break; + } +case 189: + { + PIXEL00_82 + PIXEL01_82 + PIXEL02_81 + PIXEL03_81 + PIXEL10_32 + PIXEL11_32 + PIXEL12_31 + PIXEL13_31 + PIXEL20_31 + PIXEL21_31 + PIXEL22_32 + PIXEL23_32 + PIXEL30_81 + PIXEL31_81 + PIXEL32_82 + PIXEL33_82 + break; + } +case 231: + { + PIXEL00_81 + PIXEL01_31 + PIXEL02_32 + PIXEL03_82 + PIXEL10_81 + PIXEL11_31 + PIXEL12_32 + PIXEL13_82 + PIXEL20_82 + PIXEL21_32 + PIXEL22_31 + PIXEL23_81 + PIXEL30_82 + PIXEL31_32 + PIXEL32_31 + PIXEL33_81 + break; + } +case 126: + { + PIXEL00_80 + PIXEL01_10 + if (Diff(w[2], w[6])) + { + PIXEL02_0 + PIXEL03_0 + PIXEL13_0 + } + else + { + PIXEL02_50 + PIXEL03_50 + PIXEL13_50 + } + PIXEL10_10 + PIXEL11_30 + PIXEL12_0 + if (Diff(w[8], w[4])) + { + PIXEL20_0 + PIXEL30_0 + PIXEL31_0 + } + else + { + PIXEL20_50 + PIXEL30_50 + PIXEL31_50 + } + PIXEL21_0 + PIXEL22_30 + PIXEL23_10 + PIXEL32_10 + PIXEL33_80 + break; + } +case 219: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL01_0 + PIXEL10_0 + } + else + { + PIXEL00_50 + PIXEL01_50 + PIXEL10_50 + } + PIXEL02_10 + PIXEL03_80 + PIXEL11_0 + PIXEL12_30 + PIXEL13_10 + PIXEL20_10 + PIXEL21_30 + PIXEL22_0 + if (Diff(w[6], w[8])) + { + PIXEL23_0 + PIXEL32_0 + PIXEL33_0 + } + else + { + PIXEL23_50 + PIXEL32_50 + PIXEL33_50 + } + PIXEL30_80 + PIXEL31_10 + break; + } +case 125: + { + if (Diff(w[8], w[4])) + { + PIXEL00_82 + PIXEL10_32 + PIXEL20_0 + PIXEL21_0 + PIXEL30_0 + PIXEL31_0 + } + else + { + PIXEL00_11 + PIXEL10_13 + PIXEL20_83 + PIXEL21_70 + PIXEL30_50 + PIXEL31_21 + } + PIXEL01_82 + PIXEL02_81 + PIXEL03_81 + PIXEL11_32 + PIXEL12_31 + PIXEL13_31 + PIXEL22_30 + PIXEL23_10 + PIXEL32_10 + PIXEL33_80 + break; + } +case 221: + { + PIXEL00_82 + PIXEL01_82 + PIXEL02_81 + if (Diff(w[6], w[8])) + { + PIXEL03_81 + PIXEL13_31 + PIXEL22_0 + PIXEL23_0 + PIXEL32_0 + PIXEL33_0 + } + else + { + PIXEL03_12 + PIXEL13_14 + PIXEL22_70 + PIXEL23_83 + PIXEL32_21 + PIXEL33_50 + } + PIXEL10_32 + PIXEL11_32 + PIXEL12_31 + PIXEL20_10 + PIXEL21_30 + PIXEL30_80 + PIXEL31_10 + break; + } +case 207: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL01_0 + PIXEL02_32 + PIXEL03_82 + PIXEL10_0 + PIXEL11_0 + } + else + { + PIXEL00_50 + PIXEL01_83 + PIXEL02_13 + PIXEL03_11 + PIXEL10_21 + PIXEL11_70 + } + PIXEL12_32 + PIXEL13_82 + PIXEL20_10 + PIXEL21_30 + PIXEL22_31 + PIXEL23_81 + PIXEL30_80 + PIXEL31_10 + PIXEL32_31 + PIXEL33_81 + break; + } +case 238: + { + PIXEL00_80 + PIXEL01_10 + PIXEL02_32 + PIXEL03_82 + PIXEL10_10 + PIXEL11_30 + PIXEL12_32 + PIXEL13_82 + if (Diff(w[8], w[4])) + { + PIXEL20_0 + PIXEL21_0 + PIXEL30_0 + PIXEL31_0 + PIXEL32_31 + PIXEL33_81 + } + else + { + PIXEL20_21 + PIXEL21_70 + PIXEL30_50 + PIXEL31_83 + PIXEL32_14 + PIXEL33_12 + } + PIXEL22_31 + PIXEL23_81 + break; + } +case 190: + { + PIXEL00_80 + PIXEL01_10 + if (Diff(w[2], w[6])) + { + PIXEL02_0 + PIXEL03_0 + PIXEL12_0 + PIXEL13_0 + PIXEL23_32 + PIXEL33_82 + } + else + { + PIXEL02_21 + PIXEL03_50 + PIXEL12_70 + PIXEL13_83 + PIXEL23_13 + PIXEL33_11 + } + PIXEL10_10 + PIXEL11_30 + PIXEL20_31 + PIXEL21_31 + PIXEL22_32 + PIXEL30_81 + PIXEL31_81 + PIXEL32_82 + break; + } +case 187: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL01_0 + PIXEL10_0 + PIXEL11_0 + PIXEL20_31 + PIXEL30_81 + } + else + { + PIXEL00_50 + PIXEL01_21 + PIXEL10_83 + PIXEL11_70 + PIXEL20_14 + PIXEL30_12 + } + PIXEL02_10 + PIXEL03_80 + PIXEL12_30 + PIXEL13_10 + PIXEL21_31 + PIXEL22_32 + PIXEL23_32 + PIXEL31_81 + PIXEL32_82 + PIXEL33_82 + break; + } +case 243: + { + PIXEL00_81 + PIXEL01_31 + PIXEL02_10 + PIXEL03_80 + PIXEL10_81 + PIXEL11_31 + PIXEL12_30 + PIXEL13_10 + PIXEL20_82 + PIXEL21_32 + if (Diff(w[6], w[8])) + { + PIXEL22_0 + PIXEL23_0 + PIXEL30_82 + PIXEL31_32 + PIXEL32_0 + PIXEL33_0 + } + else + { + PIXEL22_70 + PIXEL23_21 + PIXEL30_11 + PIXEL31_13 + PIXEL32_83 + PIXEL33_50 + } + break; + } +case 119: + { + if (Diff(w[2], w[6])) + { + PIXEL00_81 + PIXEL01_31 + PIXEL02_0 + PIXEL03_0 + PIXEL12_0 + PIXEL13_0 + } + else + { + PIXEL00_12 + PIXEL01_14 + PIXEL02_83 + PIXEL03_50 + PIXEL12_70 + PIXEL13_21 + } + PIXEL10_81 + PIXEL11_31 + PIXEL20_82 + PIXEL21_32 + PIXEL22_30 + PIXEL23_10 + PIXEL30_82 + PIXEL31_32 + PIXEL32_10 + PIXEL33_80 + break; + } +case 237: +case 233: + { + PIXEL00_82 + PIXEL01_82 + PIXEL02_60 + PIXEL03_20 + PIXEL10_32 + PIXEL11_32 + PIXEL12_70 + PIXEL13_60 + PIXEL20_0 + PIXEL21_0 + PIXEL22_31 + PIXEL23_81 + if (Diff(w[8], w[4])) + { + PIXEL30_0 + } + else + { + PIXEL30_20 + } + PIXEL31_0 + PIXEL32_31 + PIXEL33_81 + break; + } +case 175: +case 47: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_0 + PIXEL02_32 + PIXEL03_82 + PIXEL10_0 + PIXEL11_0 + PIXEL12_32 + PIXEL13_82 + PIXEL20_31 + PIXEL21_31 + PIXEL22_70 + PIXEL23_60 + PIXEL30_81 + PIXEL31_81 + PIXEL32_60 + PIXEL33_20 + break; + } +case 183: +case 151: + { + PIXEL00_81 + PIXEL01_31 + PIXEL02_0 + if (Diff(w[2], w[6])) + { + PIXEL03_0 + } + else + { + PIXEL03_20 + } + PIXEL10_81 + PIXEL11_31 + PIXEL12_0 + PIXEL13_0 + PIXEL20_60 + PIXEL21_70 + PIXEL22_32 + PIXEL23_32 + PIXEL30_20 + PIXEL31_60 + PIXEL32_82 + PIXEL33_82 + break; + } +case 245: +case 244: + { + PIXEL00_20 + PIXEL01_60 + PIXEL02_81 + PIXEL03_81 + PIXEL10_60 + PIXEL11_70 + PIXEL12_31 + PIXEL13_31 + PIXEL20_82 + PIXEL21_32 + PIXEL22_0 + PIXEL23_0 + PIXEL30_82 + PIXEL31_32 + PIXEL32_0 + if (Diff(w[6], w[8])) + { + PIXEL33_0 + } + else + { + PIXEL33_20 + } + break; + } +case 250: + { + PIXEL00_80 + PIXEL01_10 + PIXEL02_10 + PIXEL03_80 + PIXEL10_10 + PIXEL11_30 + PIXEL12_30 + PIXEL13_10 + if (Diff(w[8], w[4])) + { + PIXEL20_0 + PIXEL30_0 + PIXEL31_0 + } + else + { + PIXEL20_50 + PIXEL30_50 + PIXEL31_50 + } + PIXEL21_0 + PIXEL22_0 + if (Diff(w[6], w[8])) + { + PIXEL23_0 + PIXEL32_0 + PIXEL33_0 + } + else + { + PIXEL23_50 + PIXEL32_50 + PIXEL33_50 + } + break; + } +case 123: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL01_0 + PIXEL10_0 + } + else + { + PIXEL00_50 + PIXEL01_50 + PIXEL10_50 + } + PIXEL02_10 + PIXEL03_80 + PIXEL11_0 + PIXEL12_30 + PIXEL13_10 + if (Diff(w[8], w[4])) + { + PIXEL20_0 + PIXEL30_0 + PIXEL31_0 + } + else + { + PIXEL20_50 + PIXEL30_50 + PIXEL31_50 + } + PIXEL21_0 + PIXEL22_30 + PIXEL23_10 + PIXEL32_10 + PIXEL33_80 + break; + } +case 95: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL01_0 + PIXEL10_0 + } + else + { + PIXEL00_50 + PIXEL01_50 + PIXEL10_50 + } + if (Diff(w[2], w[6])) + { + PIXEL02_0 + PIXEL03_0 + PIXEL13_0 + } + else + { + PIXEL02_50 + PIXEL03_50 + PIXEL13_50 + } + PIXEL11_0 + PIXEL12_0 + PIXEL20_10 + PIXEL21_30 + PIXEL22_30 + PIXEL23_10 + PIXEL30_80 + PIXEL31_10 + PIXEL32_10 + PIXEL33_80 + break; + } +case 222: + { + PIXEL00_80 + PIXEL01_10 + if (Diff(w[2], w[6])) + { + PIXEL02_0 + PIXEL03_0 + PIXEL13_0 + } + else + { + PIXEL02_50 + PIXEL03_50 + PIXEL13_50 + } + PIXEL10_10 + PIXEL11_30 + PIXEL12_0 + PIXEL20_10 + PIXEL21_30 + PIXEL22_0 + if (Diff(w[6], w[8])) + { + PIXEL23_0 + PIXEL32_0 + PIXEL33_0 + } + else + { + PIXEL23_50 + PIXEL32_50 + PIXEL33_50 + } + PIXEL30_80 + PIXEL31_10 + break; + } +case 252: + { + PIXEL00_80 + PIXEL01_61 + PIXEL02_81 + PIXEL03_81 + PIXEL10_10 + PIXEL11_30 + PIXEL12_31 + PIXEL13_31 + if (Diff(w[8], w[4])) + { + PIXEL20_0 + PIXEL30_0 + PIXEL31_0 + } + else + { + PIXEL20_50 + PIXEL30_50 + PIXEL31_50 + } + PIXEL21_0 + PIXEL22_0 + PIXEL23_0 + PIXEL32_0 + if (Diff(w[6], w[8])) + { + PIXEL33_0 + } + else + { + PIXEL33_20 + } + break; + } +case 249: + { + PIXEL00_82 + PIXEL01_82 + PIXEL02_61 + PIXEL03_80 + PIXEL10_32 + PIXEL11_32 + PIXEL12_30 + PIXEL13_10 + PIXEL20_0 + PIXEL21_0 + PIXEL22_0 + if (Diff(w[6], w[8])) + { + PIXEL23_0 + PIXEL32_0 + PIXEL33_0 + } + else + { + PIXEL23_50 + PIXEL32_50 + PIXEL33_50 + } + if (Diff(w[8], w[4])) + { + PIXEL30_0 + } + else + { + PIXEL30_20 + } + PIXEL31_0 + break; + } +case 235: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL01_0 + PIXEL10_0 + } + else + { + PIXEL00_50 + PIXEL01_50 + PIXEL10_50 + } + PIXEL02_10 + PIXEL03_80 + PIXEL11_0 + PIXEL12_30 + PIXEL13_61 + PIXEL20_0 + PIXEL21_0 + PIXEL22_31 + PIXEL23_81 + if (Diff(w[8], w[4])) + { + PIXEL30_0 + } + else + { + PIXEL30_20 + } + PIXEL31_0 + PIXEL32_31 + PIXEL33_81 + break; + } +case 111: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_0 + PIXEL02_32 + PIXEL03_82 + PIXEL10_0 + PIXEL11_0 + PIXEL12_32 + PIXEL13_82 + if (Diff(w[8], w[4])) + { + PIXEL20_0 + PIXEL30_0 + PIXEL31_0 + } + else + { + PIXEL20_50 + PIXEL30_50 + PIXEL31_50 + } + PIXEL21_0 + PIXEL22_30 + PIXEL23_61 + PIXEL32_10 + PIXEL33_80 + break; + } +case 63: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_0 + if (Diff(w[2], w[6])) + { + PIXEL02_0 + PIXEL03_0 + PIXEL13_0 + } + else + { + PIXEL02_50 + PIXEL03_50 + PIXEL13_50 + } + PIXEL10_0 + PIXEL11_0 + PIXEL12_0 + PIXEL20_31 + PIXEL21_31 + PIXEL22_30 + PIXEL23_10 + PIXEL30_81 + PIXEL31_81 + PIXEL32_61 + PIXEL33_80 + break; + } +case 159: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL01_0 + PIXEL10_0 + } + else + { + PIXEL00_50 + PIXEL01_50 + PIXEL10_50 + } + PIXEL02_0 + if (Diff(w[2], w[6])) + { + PIXEL03_0 + } + else + { + PIXEL03_20 + } + PIXEL11_0 + PIXEL12_0 + PIXEL13_0 + PIXEL20_10 + PIXEL21_30 + PIXEL22_32 + PIXEL23_32 + PIXEL30_80 + PIXEL31_61 + PIXEL32_82 + PIXEL33_82 + break; + } +case 215: + { + PIXEL00_81 + PIXEL01_31 + PIXEL02_0 + if (Diff(w[2], w[6])) + { + PIXEL03_0 + } + else + { + PIXEL03_20 + } + PIXEL10_81 + PIXEL11_31 + PIXEL12_0 + PIXEL13_0 + PIXEL20_61 + PIXEL21_30 + PIXEL22_0 + if (Diff(w[6], w[8])) + { + PIXEL23_0 + PIXEL32_0 + PIXEL33_0 + } + else + { + PIXEL23_50 + PIXEL32_50 + PIXEL33_50 + } + PIXEL30_80 + PIXEL31_10 + break; + } +case 246: + { + PIXEL00_80 + PIXEL01_10 + if (Diff(w[2], w[6])) + { + PIXEL02_0 + PIXEL03_0 + PIXEL13_0 + } + else + { + PIXEL02_50 + PIXEL03_50 + PIXEL13_50 + } + PIXEL10_61 + PIXEL11_30 + PIXEL12_0 + PIXEL20_82 + PIXEL21_32 + PIXEL22_0 + PIXEL23_0 + PIXEL30_82 + PIXEL31_32 + PIXEL32_0 + if (Diff(w[6], w[8])) + { + PIXEL33_0 + } + else + { + PIXEL33_20 + } + break; + } +case 254: + { + PIXEL00_80 + PIXEL01_10 + if (Diff(w[2], w[6])) + { + PIXEL02_0 + PIXEL03_0 + PIXEL13_0 + } + else + { + PIXEL02_50 + PIXEL03_50 + PIXEL13_50 + } + PIXEL10_10 + PIXEL11_30 + PIXEL12_0 + if (Diff(w[8], w[4])) + { + PIXEL20_0 + PIXEL30_0 + PIXEL31_0 + } + else + { + PIXEL20_50 + PIXEL30_50 + PIXEL31_50 + } + PIXEL21_0 + PIXEL22_0 + PIXEL23_0 + PIXEL32_0 + if (Diff(w[6], w[8])) + { + PIXEL33_0 + } + else + { + PIXEL33_20 + } + break; + } +case 253: + { + PIXEL00_82 + PIXEL01_82 + PIXEL02_81 + PIXEL03_81 + PIXEL10_32 + PIXEL11_32 + PIXEL12_31 + PIXEL13_31 + PIXEL20_0 + PIXEL21_0 + PIXEL22_0 + PIXEL23_0 + if (Diff(w[8], w[4])) + { + PIXEL30_0 + } + else + { + PIXEL30_20 + } + PIXEL31_0 + PIXEL32_0 + if (Diff(w[6], w[8])) + { + PIXEL33_0 + } + else + { + PIXEL33_20 + } + break; + } +case 251: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL01_0 + PIXEL10_0 + } + else + { + PIXEL00_50 + PIXEL01_50 + PIXEL10_50 + } + PIXEL02_10 + PIXEL03_80 + PIXEL11_0 + PIXEL12_30 + PIXEL13_10 + PIXEL20_0 + PIXEL21_0 + PIXEL22_0 + if (Diff(w[6], w[8])) + { + PIXEL23_0 + PIXEL32_0 + PIXEL33_0 + } + else + { + PIXEL23_50 + PIXEL32_50 + PIXEL33_50 + } + if (Diff(w[8], w[4])) + { + PIXEL30_0 + } + else + { + PIXEL30_20 + } + PIXEL31_0 + break; + } +case 239: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_0 + PIXEL02_32 + PIXEL03_82 + PIXEL10_0 + PIXEL11_0 + PIXEL12_32 + PIXEL13_82 + PIXEL20_0 + PIXEL21_0 + PIXEL22_31 + PIXEL23_81 + if (Diff(w[8], w[4])) + { + PIXEL30_0 + } + else + { + PIXEL30_20 + } + PIXEL31_0 + PIXEL32_31 + PIXEL33_81 + break; + } +case 127: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_0 + if (Diff(w[2], w[6])) + { + PIXEL02_0 + PIXEL03_0 + PIXEL13_0 + } + else + { + PIXEL02_50 + PIXEL03_50 + PIXEL13_50 + } + PIXEL10_0 + PIXEL11_0 + PIXEL12_0 + if (Diff(w[8], w[4])) + { + PIXEL20_0 + PIXEL30_0 + PIXEL31_0 + } + else + { + PIXEL20_50 + PIXEL30_50 + PIXEL31_50 + } + PIXEL21_0 + PIXEL22_30 + PIXEL23_10 + PIXEL32_10 + PIXEL33_80 + break; + } +case 191: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_0 + PIXEL02_0 + if (Diff(w[2], w[6])) + { + PIXEL03_0 + } + else + { + PIXEL03_20 + } + PIXEL10_0 + PIXEL11_0 + PIXEL12_0 + PIXEL13_0 + PIXEL20_31 + PIXEL21_31 + PIXEL22_32 + PIXEL23_32 + PIXEL30_81 + PIXEL31_81 + PIXEL32_82 + PIXEL33_82 + break; + } +case 223: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL01_0 + PIXEL10_0 + } + else + { + PIXEL00_50 + PIXEL01_50 + PIXEL10_50 + } + PIXEL02_0 + if (Diff(w[2], w[6])) + { + PIXEL03_0 + } + else + { + PIXEL03_20 + } + PIXEL11_0 + PIXEL12_0 + PIXEL13_0 + PIXEL20_10 + PIXEL21_30 + PIXEL22_0 + if (Diff(w[6], w[8])) + { + PIXEL23_0 + PIXEL32_0 + PIXEL33_0 + } + else + { + PIXEL23_50 + PIXEL32_50 + PIXEL33_50 + } + PIXEL30_80 + PIXEL31_10 + break; + } +case 247: + { + PIXEL00_81 + PIXEL01_31 + PIXEL02_0 + if (Diff(w[2], w[6])) + { + PIXEL03_0 + } + else + { + PIXEL03_20 + } + PIXEL10_81 + PIXEL11_31 + PIXEL12_0 + PIXEL13_0 + PIXEL20_82 + PIXEL21_32 + PIXEL22_0 + PIXEL23_0 + PIXEL30_82 + PIXEL31_32 + PIXEL32_0 + if (Diff(w[6], w[8])) + { + PIXEL33_0 + } + else + { + PIXEL33_20 + } + break; + } +case 255: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_0 + PIXEL02_0 + if (Diff(w[2], w[6])) + { + PIXEL03_0 + } + else + { + PIXEL03_20 + } + PIXEL10_0 + PIXEL11_0 + PIXEL12_0 + PIXEL13_0 + PIXEL20_0 + PIXEL21_0 + PIXEL22_0 + PIXEL23_0 + if (Diff(w[8], w[4])) + { + PIXEL30_0 + } + else + { + PIXEL30_20 + } + PIXEL31_0 + PIXEL32_0 + if (Diff(w[6], w[8])) + { + PIXEL33_0 + } + else + { + PIXEL33_20 + } + break; + } +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/TextureFilters_lq2x.h b/libmupen64plus/mupen64plus-video-rice/src/TextureFilters_lq2x.h new file mode 100644 index 0000000000..a261fc4367 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/TextureFilters_lq2x.h @@ -0,0 +1,1306 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - TextureFilters_lq2x.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2003 MaxSt ( maxst@hiend3d.com ) * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +case 0 : +case 2 : +case 4 : +case 6 : +case 8 : +case 12 : +case 16 : +case 20 : +case 24 : +case 28 : +case 32 : +case 34 : +case 36 : +case 38 : +case 40 : +case 44 : +case 48 : +case 52 : +case 56 : +case 60 : +case 64 : +case 66 : +case 68 : +case 70 : +case 96 : +case 98 : +case 100 : +case 102 : +case 128 : +case 130 : +case 132 : +case 134 : +case 136 : +case 140 : +case 144 : +case 148 : +case 152 : +case 156 : +case 160 : +case 162 : +case 164 : +case 166 : +case 168 : +case 172 : +case 176 : +case 180 : +case 184 : +case 188 : +case 192 : +case 194 : +case 196 : +case 198 : +case 224 : +case 226 : +case 228 : +case 230 : +{ + P0 = IC(0); + P1 = IC(0); + P2 = IC(0); + P3 = IC(0); +} break; +case 1 : +case 5 : +case 9 : +case 13 : +case 17 : +case 21 : +case 25 : +case 29 : +case 33 : +case 37 : +case 41 : +case 45 : +case 49 : +case 53 : +case 57 : +case 61 : +case 65 : +case 69 : +case 97 : +case 101 : +case 129 : +case 133 : +case 137 : +case 141 : +case 145 : +case 149 : +case 153 : +case 157 : +case 161 : +case 165 : +case 169 : +case 173 : +case 177 : +case 181 : +case 185 : +case 189 : +case 193 : +case 197 : +case 225 : +case 229 : +{ + P0 = IC(1); + P1 = IC(1); + P2 = IC(1); + P3 = IC(1); +} break; +case 3 : +case 35 : +case 67 : +case 99 : +case 131 : +case 163 : +case 195 : +case 227 : +{ + P0 = IC(2); + P1 = IC(2); + P2 = IC(2); + P3 = IC(2); +} break; +case 7 : +case 39 : +case 71 : +case 103 : +case 135 : +case 167 : +case 199 : +case 231 : +{ + P0 = IC(3); + P1 = IC(3); + P2 = IC(3); + P3 = IC(3); +} break; +case 10 : +case 138 : +{ + P1 = IC(0); + P2 = IC(0); + P3 = IC(0); + if (HQ2X_MUL) { + P0 = IC(0); + } else { + P0 = I211(0, 1, 3); + } +} break; +case 11 : +case 27 : +case 75 : +case 139 : +case 155 : +case 203 : +{ + P1 = IC(2); + P2 = IC(2); + P3 = IC(2); + if (HQ2X_MUL) { + P0 = IC(2); + } else { + P0 = I211(2, 1, 3); + } +} break; +case 14 : +case 142 : +{ + P2 = IC(0); + P3 = IC(0); + if (HQ2X_MUL) { + P0 = IC(0); + P1 = IC(0); + } else { + P0 = I332(1, 3, 0); + P1 = I31(0, 1); + } +} break; +case 15 : +case 143 : +case 207 : +{ + P2 = IC(4); + P3 = IC(4); + if (HQ2X_MUL) { + P0 = IC(4); + P1 = IC(4); + } else { + P0 = I332(1, 3, 4); + P1 = I31(4, 1); + } +} break; +case 18 : +case 22 : +case 30 : +case 50 : +case 54 : +case 62 : +case 86 : +case 118 : +{ + P0 = IC(0); + P2 = IC(0); + P3 = IC(0); + if (HQ2X_MUR) { + P1 = IC(0); + } else { + P1 = I211(0, 1, 5); + } +} break; +case 19 : +case 51 : +{ + P2 = IC(2); + P3 = IC(2); + if (HQ2X_MUR) { + P0 = IC(2); + P1 = IC(2); + } else { + P0 = I31(2, 1); + P1 = I332(1, 5, 2); + } +} break; +case 23 : +case 55 : +case 119 : +{ + P2 = IC(3); + P3 = IC(3); + if (HQ2X_MUR) { + P0 = IC(3); + P1 = IC(3); + } else { + P0 = I31(3, 1); + P1 = I332(1, 5, 3); + } +} break; +case 26 : +{ + P2 = IC(0); + P3 = IC(0); + if (HQ2X_MUL) { + P0 = IC(0); + } else { + P0 = I211(0, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(0); + } else { + P1 = I211(0, 1, 5); + } +} break; +case 31 : +case 95 : +{ + P2 = IC(4); + P3 = IC(4); + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I211(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I211(4, 1, 5); + } +} break; +case 42 : +case 170 : +{ + P1 = IC(0); + P3 = IC(0); + if (HQ2X_MUL) { + P0 = IC(0); + P2 = IC(0); + } else { + P0 = I332(1, 3, 0); + P2 = I31(0, 3); + } +} break; +case 43 : +case 171 : +case 187 : +{ + P1 = IC(2); + P3 = IC(2); + if (HQ2X_MUL) { + P0 = IC(2); + P2 = IC(2); + } else { + P0 = I332(1, 3, 2); + P2 = I31(2, 3); + } +} break; +case 46 : +case 174 : +{ + P1 = IC(0); + P2 = IC(0); + P3 = IC(0); + if (HQ2X_MUL) { + P0 = IC(0); + } else { + P0 = I611(0, 1, 3); + } +} break; +case 47 : +case 175 : +{ + P1 = IC(4); + P2 = IC(4); + P3 = IC(4); + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I1411(4, 1, 3); + } +} break; +case 58 : +case 154 : +case 186 : +{ + P2 = IC(0); + P3 = IC(0); + if (HQ2X_MUL) { + P0 = IC(0); + } else { + P0 = I611(0, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(0); + } else { + P1 = I611(0, 1, 5); + } +} break; +case 59 : +{ + P2 = IC(2); + P3 = IC(2); + if (HQ2X_MUL) { + P0 = IC(2); + } else { + P0 = I211(2, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(2); + } else { + P1 = I611(2, 1, 5); + } +} break; +case 63 : +{ + P2 = IC(4); + P3 = IC(4); + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I1411(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I211(4, 1, 5); + } +} break; +case 72 : +case 76 : +case 104 : +case 106 : +case 108 : +case 110 : +case 120 : +case 124 : +{ + P0 = IC(0); + P1 = IC(0); + P3 = IC(0); + if (HQ2X_MDL) { + P2 = IC(0); + } else { + P2 = I211(0, 3, 7); + } +} break; +case 73 : +case 77 : +case 105 : +case 109 : +case 125 : +{ + P1 = IC(1); + P3 = IC(1); + if (HQ2X_MDL) { + P0 = IC(1); + P2 = IC(1); + } else { + P0 = I31(1, 3); + P2 = I332(3, 7, 1); + } +} break; +case 74 : +{ + P1 = IC(0); + P3 = IC(0); + if (HQ2X_MDL) { + P2 = IC(0); + } else { + P2 = I211(0, 3, 7); + } + if (HQ2X_MUL) { + P0 = IC(0); + } else { + P0 = I211(0, 1, 3); + } +} break; +case 78 : +case 202 : +case 206 : +{ + P1 = IC(0); + P3 = IC(0); + if (HQ2X_MDL) { + P2 = IC(0); + } else { + P2 = I611(0, 3, 7); + } + if (HQ2X_MUL) { + P0 = IC(0); + } else { + P0 = I611(0, 1, 3); + } +} break; +case 79 : +{ + P1 = IC(4); + P3 = IC(4); + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I611(4, 3, 7); + } + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I211(4, 1, 3); + } +} break; +case 80 : +case 208 : +case 210 : +case 216 : +{ + P0 = IC(0); + P1 = IC(0); + P2 = IC(0); + if (HQ2X_MDR) { + P3 = IC(0); + } else { + P3 = I211(0, 5, 7); + } +} break; +case 81 : +case 209 : +case 217 : +{ + P0 = IC(1); + P1 = IC(1); + P2 = IC(1); + if (HQ2X_MDR) { + P3 = IC(1); + } else { + P3 = I211(1, 5, 7); + } +} break; +case 82 : +case 214 : +case 222 : +{ + P0 = IC(0); + P2 = IC(0); + if (HQ2X_MDR) { + P3 = IC(0); + } else { + P3 = I211(0, 5, 7); + } + if (HQ2X_MUR) { + P1 = IC(0); + } else { + P1 = I211(0, 1, 5); + } +} break; +case 83 : +case 115 : +{ + P0 = IC(2); + P2 = IC(2); + if (HQ2X_MDR) { + P3 = IC(2); + } else { + P3 = I611(2, 5, 7); + } + if (HQ2X_MUR) { + P1 = IC(2); + } else { + P1 = I611(2, 1, 5); + } +} break; +case 84 : +case 212 : +{ + P0 = IC(0); + P2 = IC(0); + if (HQ2X_MDR) { + P1 = IC(0); + P3 = IC(0); + } else { + P1 = I31(0, 5); + P3 = I332(5, 7, 0); + } +} break; +case 85 : +case 213 : +case 221 : +{ + P0 = IC(1); + P2 = IC(1); + if (HQ2X_MDR) { + P1 = IC(1); + P3 = IC(1); + } else { + P1 = I31(1, 5); + P3 = I332(5, 7, 1); + } +} break; +case 87 : +{ + P0 = IC(3); + P2 = IC(3); + if (HQ2X_MDR) { + P3 = IC(3); + } else { + P3 = I611(3, 5, 7); + } + if (HQ2X_MUR) { + P1 = IC(3); + } else { + P1 = I211(3, 1, 5); + } +} break; +case 88 : +case 248 : +case 250 : +{ + P0 = IC(0); + P1 = IC(0); + if (HQ2X_MDL) { + P2 = IC(0); + } else { + P2 = I211(0, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(0); + } else { + P3 = I211(0, 5, 7); + } +} break; +case 89 : +case 93 : +{ + P0 = IC(1); + P1 = IC(1); + if (HQ2X_MDL) { + P2 = IC(1); + } else { + P2 = I611(1, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(1); + } else { + P3 = I611(1, 5, 7); + } +} break; +case 90 : +{ + if (HQ2X_MDL) { + P2 = IC(0); + } else { + P2 = I611(0, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(0); + } else { + P3 = I611(0, 5, 7); + } + if (HQ2X_MUL) { + P0 = IC(0); + } else { + P0 = I611(0, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(0); + } else { + P1 = I611(0, 1, 5); + } +} break; +case 91 : +{ + if (HQ2X_MDL) { + P2 = IC(2); + } else { + P2 = I611(2, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(2); + } else { + P3 = I611(2, 5, 7); + } + if (HQ2X_MUL) { + P0 = IC(2); + } else { + P0 = I211(2, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(2); + } else { + P1 = I611(2, 1, 5); + } +} break; +case 92 : +{ + P0 = IC(0); + P1 = IC(0); + if (HQ2X_MDL) { + P2 = IC(0); + } else { + P2 = I611(0, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(0); + } else { + P3 = I611(0, 5, 7); + } +} break; +case 94 : +{ + if (HQ2X_MDL) { + P2 = IC(0); + } else { + P2 = I611(0, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(0); + } else { + P3 = I611(0, 5, 7); + } + if (HQ2X_MUL) { + P0 = IC(0); + } else { + P0 = I611(0, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(0); + } else { + P1 = I211(0, 1, 5); + } +} break; +case 107 : +case 123 : +{ + P1 = IC(2); + P3 = IC(2); + if (HQ2X_MDL) { + P2 = IC(2); + } else { + P2 = I211(2, 3, 7); + } + if (HQ2X_MUL) { + P0 = IC(2); + } else { + P0 = I211(2, 1, 3); + } +} break; +case 111 : +{ + P1 = IC(4); + P3 = IC(4); + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I211(4, 3, 7); + } + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I1411(4, 1, 3); + } +} break; +case 112 : +case 240 : +{ + P0 = IC(0); + P1 = IC(0); + if (HQ2X_MDR) { + P2 = IC(0); + P3 = IC(0); + } else { + P2 = I31(0, 7); + P3 = I332(5, 7, 0); + } +} break; +case 113 : +case 241 : +{ + P0 = IC(1); + P1 = IC(1); + if (HQ2X_MDR) { + P2 = IC(1); + P3 = IC(1); + } else { + P2 = I31(1, 7); + P3 = I332(5, 7, 1); + } +} break; +case 114 : +{ + P0 = IC(0); + P2 = IC(0); + if (HQ2X_MDR) { + P3 = IC(0); + } else { + P3 = I611(0, 5, 7); + } + if (HQ2X_MUR) { + P1 = IC(0); + } else { + P1 = I611(0, 1, 5); + } +} break; +case 116 : +{ + P0 = IC(0); + P1 = IC(0); + P2 = IC(0); + if (HQ2X_MDR) { + P3 = IC(0); + } else { + P3 = I611(0, 5, 7); + } +} break; +case 117 : +{ + P0 = IC(1); + P1 = IC(1); + P2 = IC(1); + if (HQ2X_MDR) { + P3 = IC(1); + } else { + P3 = I611(1, 5, 7); + } +} break; +case 121 : +{ + P0 = IC(1); + P1 = IC(1); + if (HQ2X_MDL) { + P2 = IC(1); + } else { + P2 = I211(1, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(1); + } else { + P3 = I611(1, 5, 7); + } +} break; +case 122 : +{ + if (HQ2X_MDL) { + P2 = IC(0); + } else { + P2 = I211(0, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(0); + } else { + P3 = I611(0, 5, 7); + } + if (HQ2X_MUL) { + P0 = IC(0); + } else { + P0 = I611(0, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(0); + } else { + P1 = I611(0, 1, 5); + } +} break; +case 126 : +{ + P0 = IC(0); + P3 = IC(0); + if (HQ2X_MDL) { + P2 = IC(0); + } else { + P2 = I211(0, 3, 7); + } + if (HQ2X_MUR) { + P1 = IC(0); + } else { + P1 = I211(0, 1, 5); + } +} break; +case 127 : +{ + P3 = IC(4); + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I211(4, 3, 7); + } + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I1411(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I211(4, 1, 5); + } +} break; +case 146 : +case 150 : +case 178 : +case 182 : +case 190 : +{ + P0 = IC(0); + P2 = IC(0); + if (HQ2X_MUR) { + P1 = IC(0); + P3 = IC(0); + } else { + P1 = I332(1, 5, 0); + P3 = I31(0, 5); + } +} break; +case 147 : +case 179 : +{ + P0 = IC(2); + P2 = IC(2); + P3 = IC(2); + if (HQ2X_MUR) { + P1 = IC(2); + } else { + P1 = I611(2, 1, 5); + } +} break; +case 151 : +case 183 : +{ + P0 = IC(3); + P2 = IC(3); + P3 = IC(3); + if (HQ2X_MUR) { + P1 = IC(3); + } else { + P1 = I1411(3, 1, 5); + } +} break; +case 158 : +{ + P2 = IC(0); + P3 = IC(0); + if (HQ2X_MUL) { + P0 = IC(0); + } else { + P0 = I611(0, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(0); + } else { + P1 = I211(0, 1, 5); + } +} break; +case 159 : +{ + P2 = IC(4); + P3 = IC(4); + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I211(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I1411(4, 1, 5); + } +} break; +case 191 : +{ + P2 = IC(4); + P3 = IC(4); + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I1411(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I1411(4, 1, 5); + } +} break; +case 200 : +case 204 : +case 232 : +case 236 : +case 238 : +{ + P0 = IC(0); + P1 = IC(0); + if (HQ2X_MDL) { + P2 = IC(0); + P3 = IC(0); + } else { + P2 = I332(3, 7, 0); + P3 = I31(0, 7); + } +} break; +case 201 : +case 205 : +{ + P0 = IC(1); + P1 = IC(1); + P3 = IC(1); + if (HQ2X_MDL) { + P2 = IC(1); + } else { + P2 = I611(1, 3, 7); + } +} break; +case 211 : +{ + P0 = IC(2); + P1 = IC(2); + P2 = IC(2); + if (HQ2X_MDR) { + P3 = IC(2); + } else { + P3 = I211(2, 5, 7); + } +} break; +case 215 : +{ + P0 = IC(3); + P2 = IC(3); + if (HQ2X_MDR) { + P3 = IC(3); + } else { + P3 = I211(3, 5, 7); + } + if (HQ2X_MUR) { + P1 = IC(3); + } else { + P1 = I1411(3, 1, 5); + } +} break; +case 218 : +{ + if (HQ2X_MDL) { + P2 = IC(0); + } else { + P2 = I611(0, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(0); + } else { + P3 = I211(0, 5, 7); + } + if (HQ2X_MUL) { + P0 = IC(0); + } else { + P0 = I611(0, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(0); + } else { + P1 = I611(0, 1, 5); + } +} break; +case 219 : +{ + P1 = IC(2); + P2 = IC(2); + if (HQ2X_MDR) { + P3 = IC(2); + } else { + P3 = I211(2, 5, 7); + } + if (HQ2X_MUL) { + P0 = IC(2); + } else { + P0 = I211(2, 1, 3); + } +} break; +case 220 : +{ + P0 = IC(0); + P1 = IC(0); + if (HQ2X_MDL) { + P2 = IC(0); + } else { + P2 = I611(0, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(0); + } else { + P3 = I211(0, 5, 7); + } +} break; +case 223 : +{ + P2 = IC(4); + if (HQ2X_MDR) { + P3 = IC(4); + } else { + P3 = I211(4, 5, 7); + } + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I211(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I1411(4, 1, 5); + } +} break; +case 233 : +case 237 : +{ + P0 = IC(1); + P1 = IC(1); + P3 = IC(1); + if (HQ2X_MDL) { + P2 = IC(1); + } else { + P2 = I1411(1, 3, 7); + } +} break; +case 234 : +{ + P1 = IC(0); + P3 = IC(0); + if (HQ2X_MDL) { + P2 = IC(0); + } else { + P2 = I211(0, 3, 7); + } + if (HQ2X_MUL) { + P0 = IC(0); + } else { + P0 = I611(0, 1, 3); + } +} break; +case 235 : +{ + P1 = IC(2); + P3 = IC(2); + if (HQ2X_MDL) { + P2 = IC(2); + } else { + P2 = I1411(2, 3, 7); + } + if (HQ2X_MUL) { + P0 = IC(2); + } else { + P0 = I211(2, 1, 3); + } +} break; +case 239 : +{ + P1 = IC(4); + P3 = IC(4); + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I1411(4, 3, 7); + } + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I1411(4, 1, 3); + } +} break; +case 242 : +{ + P0 = IC(0); + P2 = IC(0); + if (HQ2X_MDR) { + P3 = IC(0); + } else { + P3 = I211(0, 5, 7); + } + if (HQ2X_MUR) { + P1 = IC(0); + } else { + P1 = I611(0, 1, 5); + } +} break; +case 243 : +{ + P0 = IC(2); + P1 = IC(2); + if (HQ2X_MDR) { + P2 = IC(2); + P3 = IC(2); + } else { + P2 = I31(2, 7); + P3 = I332(5, 7, 2); + } +} break; +case 244 : +{ + P0 = IC(0); + P1 = IC(0); + P2 = IC(0); + if (HQ2X_MDR) { + P3 = IC(0); + } else { + P3 = I1411(0, 5, 7); + } +} break; +case 245 : +{ + P0 = IC(1); + P1 = IC(1); + P2 = IC(1); + if (HQ2X_MDR) { + P3 = IC(1); + } else { + P3 = I1411(1, 5, 7); + } +} break; +case 246 : +{ + P0 = IC(0); + P2 = IC(0); + if (HQ2X_MDR) { + P3 = IC(0); + } else { + P3 = I1411(0, 5, 7); + } + if (HQ2X_MUR) { + P1 = IC(0); + } else { + P1 = I211(0, 1, 5); + } +} break; +case 247 : +{ + P0 = IC(3); + P2 = IC(3); + if (HQ2X_MDR) { + P3 = IC(3); + } else { + P3 = I1411(3, 5, 7); + } + if (HQ2X_MUR) { + P1 = IC(3); + } else { + P1 = I1411(3, 1, 5); + } +} break; +case 249 : +{ + P0 = IC(1); + P1 = IC(1); + if (HQ2X_MDL) { + P2 = IC(1); + } else { + P2 = I1411(1, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(1); + } else { + P3 = I211(1, 5, 7); + } +} break; +case 251 : +{ + P1 = IC(2); + if (HQ2X_MDL) { + P2 = IC(2); + } else { + P2 = I1411(2, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(2); + } else { + P3 = I211(2, 5, 7); + } + if (HQ2X_MUL) { + P0 = IC(2); + } else { + P0 = I211(2, 1, 3); + } +} break; +case 252 : +{ + P0 = IC(0); + P1 = IC(0); + if (HQ2X_MDL) { + P2 = IC(0); + } else { + P2 = I211(0, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(0); + } else { + P3 = I1411(0, 5, 7); + } +} break; +case 253 : +{ + P0 = IC(1); + P1 = IC(1); + if (HQ2X_MDL) { + P2 = IC(1); + } else { + P2 = I1411(1, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(1); + } else { + P3 = I1411(1, 5, 7); + } +} break; +case 254 : +{ + P0 = IC(0); + if (HQ2X_MDL) { + P2 = IC(0); + } else { + P2 = I211(0, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(0); + } else { + P3 = I1411(0, 5, 7); + } + if (HQ2X_MUR) { + P1 = IC(0); + } else { + P1 = I211(0, 1, 5); + } +} break; +case 255 : +{ + if (HQ2X_MDL) { + P2 = IC(4); + } else { + P2 = I1411(4, 3, 7); + } + if (HQ2X_MDR) { + P3 = IC(4); + } else { + P3 = I1411(4, 5, 7); + } + if (HQ2X_MUL) { + P0 = IC(4); + } else { + P0 = I1411(4, 1, 3); + } + if (HQ2X_MUR) { + P1 = IC(4); + } else { + P1 = I1411(4, 1, 5); + } +} break; + diff --git a/libmupen64plus/mupen64plus-video-rice/src/TextureManager.cpp b/libmupen64plus/mupen64plus-video-rice/src/TextureManager.cpp new file mode 100644 index 0000000000..fb868e26ae --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/TextureManager.cpp @@ -0,0 +1,1546 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + +#include +#include + +#include "ConvertImage.h" +#include "DeviceBuilder.h" +#include "FrameBuffer.h" +#include "RenderBase.h" +#include "TextureManager.h" + +CTextureManager gTextureManager; + +unsigned int g_maxTextureMemUsage = (5*1024*1024); +unsigned int g_amountToFree = (512*1024); +bool g_bUseSetTextureMem = false; + +// Returns the first prime greater than or equal to nFirst +inline int GetNextPrime(int nFirst) +{ + int nCurrent; + + nCurrent = nFirst; + + // Just make sure it's odd + if ((nCurrent % 2) == 0) + nCurrent++; + + for (;;) + { + int nSqrtCurrent; + BOOL bIsComposite; + + // nSqrtCurrent = nCurrent^0.5 + 1 (round up) + nSqrtCurrent = (int)sqrt((double)nCurrent) + 1; + + bIsComposite = FALSE; + + // Test all odd numbers from 3..nSqrtCurrent + for (int i = 3; i <= nSqrtCurrent; i+=2) + { + if ((nCurrent % i) == 0) + { + bIsComposite = TRUE; + break; + } + } + + if (!bIsComposite) + { + return nCurrent; + } + + // Select next odd candidate... + nCurrent += 2; + } +} + + + +/////////////////////////////////////////////////////////////////////// +// +/////////////////////////////////////////////////////////////////////// +CTextureManager::CTextureManager() : + m_pHead(NULL), + m_pCacheTxtrList(NULL), + m_numOfCachedTxtrList(809) +{ + m_numOfCachedTxtrList = GetNextPrime(800); + + m_currentTextureMemUsage = 0; + m_pYoungestTexture = NULL; + m_pOldestTexture = NULL; + + m_pCacheTxtrList = new TxtrCacheEntry *[m_numOfCachedTxtrList]; + SAFE_CHECK(m_pCacheTxtrList); + + for (uint32 i = 0; i < m_numOfCachedTxtrList; i++) + m_pCacheTxtrList[i] = NULL; + + memset(&m_blackTextureEntry, 0, sizeof(TxtrCacheEntry)); + memset(&m_PrimColorTextureEntry, 0, sizeof(TxtrCacheEntry)); + memset(&m_EnvColorTextureEntry, 0, sizeof(TxtrCacheEntry)); + memset(&m_LODFracTextureEntry, 0, sizeof(TxtrCacheEntry)); + memset(&m_PrimLODFracTextureEntry, 0, sizeof(TxtrCacheEntry)); +} + +CTextureManager::~CTextureManager() +{ + CleanUp(); + + delete []m_pCacheTxtrList; + m_pCacheTxtrList = NULL; +} + + +// +// Delete all textures. +// +bool CTextureManager::CleanUp() +{ + RecycleAllTextures(); + + if (!g_bUseSetTextureMem) + { + while (m_pHead) + { + TxtrCacheEntry * pVictim = m_pHead; + m_pHead = pVictim->pNext; + + delete pVictim; + } + } + + if( m_blackTextureEntry.pTexture ) delete m_blackTextureEntry.pTexture; + if( m_PrimColorTextureEntry.pTexture ) delete m_PrimColorTextureEntry.pTexture; + if( m_EnvColorTextureEntry.pTexture ) delete m_EnvColorTextureEntry.pTexture; + if( m_LODFracTextureEntry.pTexture ) delete m_LODFracTextureEntry.pTexture; + if( m_PrimLODFracTextureEntry.pTexture ) delete m_PrimLODFracTextureEntry.pTexture; + memset(&m_blackTextureEntry, 0, sizeof(TxtrCacheEntry)); + memset(&m_PrimColorTextureEntry, 0, sizeof(TxtrCacheEntry)); + memset(&m_EnvColorTextureEntry, 0, sizeof(TxtrCacheEntry)); + memset(&m_LODFracTextureEntry, 0, sizeof(TxtrCacheEntry)); + memset(&m_PrimLODFracTextureEntry, 0, sizeof(TxtrCacheEntry)); + + return true; +} + +bool CTextureManager::TCacheEntryIsLoaded(TxtrCacheEntry *pEntry) +{ + for (int i = 0; i < MAX_TEXTURES; i++) + { + if (g_textures[i].pTextureEntry == pEntry) + return true; + } + + return false; +} + +// Purge any textures whos last usage was over 5 seconds ago +void CTextureManager::PurgeOldTextures() +{ + if (m_pCacheTxtrList == NULL) + return; + + if (g_bUseSetTextureMem) + return; + + static const uint32 dwFramesToKill = 5*30; // 5 secs at 30 fps + static const uint32 dwFramesToDelete = 30*30; // 30 secs at 30 fps + + for ( uint32 i = 0; i < m_numOfCachedTxtrList; i++ ) + { + TxtrCacheEntry * pEntry; + TxtrCacheEntry * pNext; + + pEntry = m_pCacheTxtrList[i]; + while (pEntry) + { + pNext = pEntry->pNext; + + if ( status.gDlistCount - pEntry->FrameLastUsed > dwFramesToKill && !TCacheEntryIsLoaded(pEntry)) + { + RemoveTexture(pEntry); + } + pEntry = pNext; + } + } + + + // Remove any old textures that haven't been recycled in 1 minute or so + // Normally these would be reused + TxtrCacheEntry * pPrev; + TxtrCacheEntry * pCurr; + TxtrCacheEntry * pNext; + + + pPrev = NULL; + pCurr = m_pHead; + + while (pCurr) + { + pNext = pCurr->pNext; + + if ( status.gDlistCount - pCurr->FrameLastUsed > dwFramesToDelete && !TCacheEntryIsLoaded(pCurr) ) + { + if (pPrev != NULL) pPrev->pNext = pCurr->pNext; + else m_pHead = pCurr->pNext; + + delete pCurr; + pCurr = pNext; + } + else + { + pPrev = pCurr; + pCurr = pNext; + } + } +} + +void CTextureManager::RecycleAllTextures() +{ + if (m_pCacheTxtrList == NULL) + return; + + uint32 dwCount = 0; + uint32 dwTotalUses = 0; + + m_pYoungestTexture = NULL; + m_pOldestTexture = NULL; + + for (uint32 i = 0; i < m_numOfCachedTxtrList; i++) + { + while (m_pCacheTxtrList[i]) + { + TxtrCacheEntry *pTVictim = m_pCacheTxtrList[i]; + m_pCacheTxtrList[i] = pTVictim->pNext; + + dwTotalUses += pTVictim->dwUses; + dwCount++; + if (g_bUseSetTextureMem) + delete pTVictim; + else + RecycleTexture(pTVictim); + } + } +} + +void CTextureManager::RecheckHiresForAllTextures() +{ + if (m_pCacheTxtrList == NULL) + return; + + for (uint32 i = 0; i < m_numOfCachedTxtrList; i++) + { + while (m_pCacheTxtrList[i]) + { + TxtrCacheEntry *pTVictim = m_pCacheTxtrList[i]; + m_pCacheTxtrList[i] = pTVictim->pNext; + pTVictim->bExternalTxtrChecked = false; + + } + } +} + + +// Add to the recycle list +void CTextureManager::RecycleTexture(TxtrCacheEntry *pEntry) +{ + if (g_bUseSetTextureMem) + return; + + if( CDeviceBuilder::GetGeneralDeviceType() == OGL_DEVICE ) + { + // Fix me, why I can not reuse the texture in OpenGL, + // how can I unload texture from video card memory for OpenGL + delete pEntry; + return; + } + + if (pEntry->pTexture == NULL) + { + // No point in saving! + delete pEntry; + } + else + { + // Add to the list + pEntry->pNext = m_pHead; + SAFE_DELETE(pEntry->pEnhancedTexture); + m_pHead = pEntry; + } +} + +// Search for a texture of the specified dimensions to recycle +TxtrCacheEntry * CTextureManager::ReviveTexture( uint32 width, uint32 height ) +{ + if (g_bUseSetTextureMem) + return NULL; + + TxtrCacheEntry * pPrev; + TxtrCacheEntry * pCurr; + + pPrev = NULL; + pCurr = m_pHead; + + while (pCurr) + { + if (pCurr->ti.WidthToCreate == width && + pCurr->ti.HeightToCreate == height) + { + // Remove from list + if (pPrev != NULL) pPrev->pNext = pCurr->pNext; + else m_pHead = pCurr->pNext; + + return pCurr; + } + + pPrev = pCurr; + pCurr = pCurr->pNext; + } + + return NULL; +} + + +uint32 CTextureManager::Hash(uint32 dwValue) +{ + // Divide by four, because most textures will be on a 4 byte boundry, so bottom four + // bits are null + return (dwValue>>2) % m_numOfCachedTxtrList; +} + +void CTextureManager::MakeTextureYoungest(TxtrCacheEntry *pEntry) +{ + if (!g_bUseSetTextureMem) + return; + + if (pEntry == m_pYoungestTexture) + return; + + // if its the oldest, then change the oldest pointer + if (pEntry == m_pOldestTexture) + { + m_pOldestTexture = pEntry->pNextYoungest; + } + + // if its a not a new texture, close the gap in the age list + // where pEntry use to reside + if (pEntry->pNextYoungest != NULL || pEntry->pLastYoungest != NULL) + { + if (pEntry->pNextYoungest != NULL) + { + pEntry->pNextYoungest->pLastYoungest = pEntry->pLastYoungest; + } + if (pEntry->pLastYoungest != NULL) + { + pEntry->pLastYoungest->pNextYoungest = pEntry->pNextYoungest; + } + } + + // this texture is now the youngest, so place it on the end of the list + if (m_pYoungestTexture != NULL) + { + m_pYoungestTexture->pNextYoungest = pEntry; + } + + pEntry->pNextYoungest = NULL; + pEntry->pLastYoungest = m_pYoungestTexture; + m_pYoungestTexture = pEntry; + + // if this is the first texture in memory then its also the oldest + if (m_pOldestTexture == NULL) + { + m_pOldestTexture = pEntry; + } +} + +void CTextureManager::AddTexture(TxtrCacheEntry *pEntry) +{ + uint32 dwKey = Hash(pEntry->ti.Address); + + if (m_pCacheTxtrList == NULL) + return; + + //TxtrCacheEntry **p = &m_pCacheTxtrList[dwKey]; + + // Add to head (not tail, for speed - new textures are more likely to be accessed next) + pEntry->pNext = m_pCacheTxtrList[dwKey]; + m_pCacheTxtrList[dwKey] = pEntry; + + // Move the texture to the top of the age list + MakeTextureYoungest(pEntry); +} + + + +TxtrCacheEntry * CTextureManager::GetTxtrCacheEntry(TxtrInfo * pti) +{ + TxtrCacheEntry *pEntry; + + if (m_pCacheTxtrList == NULL) + return NULL; + + // See if it is already in the hash table + uint32 dwKey = Hash(pti->Address); + + for (pEntry = m_pCacheTxtrList[dwKey]; pEntry; pEntry = pEntry->pNext) + { + if ( pEntry->ti == *pti ) + { + MakeTextureYoungest(pEntry); + return pEntry; + } + } + + return NULL; +} + + + +void CTextureManager::RemoveTexture(TxtrCacheEntry * pEntry) +{ + TxtrCacheEntry * pPrev; + TxtrCacheEntry * pCurr; + + if (m_pCacheTxtrList == NULL) + return; + + // See if it is already in the hash table + uint32 dwKey = Hash(pEntry->ti.Address); + + pPrev = NULL; + pCurr = m_pCacheTxtrList[dwKey]; + + while (pCurr) + { + // Check that the attributes match + if ( pCurr->ti == pEntry->ti ) + { + if (pPrev != NULL) + pPrev->pNext = pCurr->pNext; + else + m_pCacheTxtrList[dwKey] = pCurr->pNext; + + if (g_bUseSetTextureMem) + { + // remove the texture from the age list + if (pEntry->pNextYoungest != NULL) + { + pEntry->pNextYoungest->pLastYoungest = pEntry->pLastYoungest; + } + if (pEntry->pLastYoungest != NULL) + { + pEntry->pLastYoungest->pNextYoungest = pEntry->pNextYoungest; + } + + // decrease the mem usage counter + m_currentTextureMemUsage -= (pEntry->pTexture->m_dwWidth * pEntry->pTexture->m_dwHeight * 4); + + delete pEntry; + } + else + { + RecycleTexture(pEntry); + } + + break; + } + + pPrev = pCurr; + pCurr = pCurr->pNext; + } + +} + +TxtrCacheEntry * CTextureManager::CreateNewCacheEntry(uint32 dwAddr, uint32 dwWidth, uint32 dwHeight) +{ + TxtrCacheEntry * pEntry = NULL; + + if (g_bUseSetTextureMem) + { + uint32 widthToCreate = dwWidth; + uint32 heightToCreate = dwHeight; + unsigned int freeUpSize = (widthToCreate * heightToCreate * 4) + g_amountToFree; + + // make sure there is enough room for the new texture by deleting old textures + while ((m_currentTextureMemUsage + freeUpSize) > g_maxTextureMemUsage && m_pOldestTexture != NULL) + { + TxtrCacheEntry *nextYoungest = m_pOldestTexture->pNextYoungest; + + RemoveTexture(m_pOldestTexture); + + m_pOldestTexture = nextYoungest; + + //printf("Freeing Texture\n"); + } + + m_currentTextureMemUsage += widthToCreate * heightToCreate * 4; + } + else + { + // Find a used texture + pEntry = ReviveTexture(dwWidth, dwHeight); + } + + if (pEntry == NULL || g_bUseSetTextureMem) + { + // Couldn't find on - recreate! + pEntry = new TxtrCacheEntry; + if (pEntry == NULL) + { + _VIDEO_DisplayTemporaryMessage("Error to create an texture entry"); + return NULL; + } + + pEntry->pTexture = CDeviceBuilder::GetBuilder()->CreateTexture(dwWidth, dwHeight); + if (pEntry->pTexture == NULL || pEntry->pTexture->GetTexture() == NULL) + { + _VIDEO_DisplayTemporaryMessage("Error to create an texture"); + TRACE2("Warning, unable to create %d x %d texture!", dwWidth, dwHeight); + } + else + { + pEntry->pTexture->m_bScaledS = false; + pEntry->pTexture->m_bScaledT = false; + } + } + + // Initialize + pEntry->ti.Address = dwAddr; + pEntry->pNext = NULL; + pEntry->pNextYoungest = NULL; + pEntry->pLastYoungest = NULL; + pEntry->dwUses = 0; + pEntry->dwTimeLastUsed = status.gRDPTime; + pEntry->dwCRC = 0; + pEntry->FrameLastUsed = status.gDlistCount; + pEntry->FrameLastUpdated = 0; + pEntry->lastEntry = NULL; + pEntry->bExternalTxtrChecked = false; + pEntry->maxCI = -1; + + // Add to the hash table + AddTexture(pEntry); + return pEntry; +} + +// If already in table, return +// Otherwise, create surfaces, and load texture into memory +uint32 dwAsmHeight; +uint32 dwAsmPitch; +uint32 dwAsmdwBytesPerLine; +uint32 dwAsmCRC; +uint32 dwAsmCRC2; +uint8* pAsmStart; + +TxtrCacheEntry *g_lastTextureEntry=NULL; +bool lastEntryModified = false; + + +TxtrCacheEntry * CTextureManager::GetTexture(TxtrInfo * pgti, bool fromTMEM, bool doCRCCheck, bool AutoExtendTexture) +{ + TxtrCacheEntry *pEntry; + + if( g_curRomInfo.bDisableTextureCRC ) + doCRCCheck = false; + + gRDP.texturesAreReloaded = true; + + dwAsmCRC = 0; + uint32 dwPalCRC = 0; + + pEntry = GetTxtrCacheEntry(pgti); + bool loadFromTextureBuffer=false; + int txtBufIdxToLoadFrom = -1; + if( (frameBufferOptions.bCheckRenderTextures&&!frameBufferOptions.bWriteBackBufToRDRAM) || (frameBufferOptions.bCheckBackBufs&&!frameBufferOptions.bWriteBackBufToRDRAM) ) + { + txtBufIdxToLoadFrom = g_pFrameBufferManager->CheckAddrInRenderTextures(pgti->Address); + if( txtBufIdxToLoadFrom >= 0 ) + { + loadFromTextureBuffer = true; + // Check if it is the same size, + RenderTextureInfo &info = gRenderTextureInfos[txtBufIdxToLoadFrom]; + //if( info.pRenderTexture && info.CI_Info.dwAddr == pgti->Address && info.CI_Info.dwFormat == pgti->Format + if( info.pRenderTexture && info.CI_Info.dwFormat == pgti->Format + && info.CI_Info.dwSize == pgti->Size ) + { + info.txtEntry.ti = *pgti; + return &info.txtEntry; + } + } + } + + if( frameBufferOptions.bCheckBackBufs && g_pFrameBufferManager->CheckAddrInBackBuffers(pgti->Address, pgti->HeightToLoad*pgti->Pitch) >= 0 ) + { + if( !frameBufferOptions.bWriteBackBufToRDRAM ) + { + // Load the texture from recent back buffer + txtBufIdxToLoadFrom = g_pFrameBufferManager->CheckAddrInRenderTextures(pgti->Address); + if( txtBufIdxToLoadFrom >= 0 ) + { + loadFromTextureBuffer = true; + // Check if it is the same size, + RenderTextureInfo &info = gRenderTextureInfos[txtBufIdxToLoadFrom]; + //if( info.pRenderTexture && info.CI_Info.dwAddr == pgti->Address && info.CI_Info.dwFormat == pgti->Format + if( info.pRenderTexture && info.CI_Info.dwFormat == pgti->Format + && info.CI_Info.dwSize == pgti->Size ) + { + info.txtEntry.ti = *pgti; + return &info.txtEntry; + } + } + } + } + + if (pEntry && pEntry->dwTimeLastUsed == status.gRDPTime && status.gDlistCount != 0 && !status.bN64FrameBufferIsUsed ) // This is not good, Palatte may changes + { + // We've already calculated a CRC this frame! + dwAsmCRC = pEntry->dwCRC; + } + else + { + if ( doCRCCheck ) + { + if( loadFromTextureBuffer ) + dwAsmCRC = gRenderTextureInfos[txtBufIdxToLoadFrom].crcInRDRAM; + else + CalculateRDRAMCRC(pgti->pPhysicalAddress, pgti->LeftToLoad, pgti->TopToLoad, pgti->WidthToLoad, pgti->HeightToLoad, pgti->Size, pgti->Pitch); + } + } + + int maxCI = 0; + if ( doCRCCheck && (pgti->Format == TXT_FMT_CI || (pgti->Format == TXT_FMT_RGBA && pgti->Size <= TXT_SIZE_8b ))) + { + //maxCI = pgti->Size == TXT_SIZE_8b ? 255 : 15; + extern unsigned char CalculateMaxCI(void *pPhysicalAddress, uint32 left, uint32 top, uint32 width, uint32 height, uint32 size, uint32 pitchInBytes ); + + if( !pEntry || pEntry->dwCRC != dwAsmCRC || pEntry->maxCI < 0 ) + { + maxCI = CalculateMaxCI(pgti->pPhysicalAddress, pgti->LeftToLoad, pgti->TopToLoad, pgti->WidthToLoad, pgti->HeightToLoad, pgti->Size, pgti->Pitch); + } + else + { + maxCI = pEntry->maxCI; + } + + //Check PAL CRC + uint8 * pStart; + uint32 dwPalSize = 16; + uint32 dwOffset; + + if( pgti->Size == TXT_SIZE_8b ) + { + dwPalSize = 256; + dwOffset = 0; + } + else + { + dwOffset = pgti->Palette << 4; + } + + pStart = (uint8*)pgti->PalAddress+dwOffset*2; + //uint32 y; + //for (y = 0; y < dwPalSize*2; y+=4) + //{ + // dwPalCRC = (dwPalCRC + *(uint32*)&pStart[y]); + //} + + uint32 dwAsmCRCSave = dwAsmCRC; + //dwPalCRC = CalculateRDRAMCRC(pStart, 0, 0, dwPalSize, 1, TXT_SIZE_16b, dwPalSize*2); + dwPalCRC = CalculateRDRAMCRC(pStart, 0, 0, maxCI+1, 1, TXT_SIZE_16b, dwPalSize*2); + dwAsmCRC = dwAsmCRCSave; + } + + if (pEntry && doCRCCheck ) + { + if(pEntry->dwCRC == dwAsmCRC && pEntry->dwPalCRC == dwPalCRC && + (!loadFromTextureBuffer || gRenderTextureInfos[txtBufIdxToLoadFrom].updateAtFrame < pEntry->FrameLastUsed ) ) + { + // Tile is ok, return + pEntry->dwUses++; + pEntry->dwTimeLastUsed = status.gRDPTime; + pEntry->FrameLastUsed = status.gDlistCount; + LOG_TEXTURE(TRACE0(" Use current texture:\n")); + pEntry->lastEntry = g_lastTextureEntry; + g_lastTextureEntry = pEntry; + lastEntryModified = false; + + DEBUGGER_IF_DUMP((pauseAtNext && loadFromTextureBuffer) , + {DebuggerAppendMsg("Load cached texture from render_texture");} + ); + + return pEntry; + } + else + { + //Do something + } + } + + if (pEntry == NULL) + { + // We need to create a new entry, and add it + // to the hash table. + pEntry = CreateNewCacheEntry(pgti->Address, pgti->WidthToCreate, pgti->HeightToCreate); + + if (pEntry == NULL) + { + g_lastTextureEntry = pEntry; + _VIDEO_DisplayTemporaryMessage("Fail to create new texture entry"); + return NULL; + } + } + + pEntry->ti = *pgti; + pEntry->dwCRC = dwAsmCRC; + pEntry->dwPalCRC = dwPalCRC; + pEntry->bExternalTxtrChecked = false; + pEntry->maxCI = maxCI; + + try + { + if (pEntry->pTexture != NULL) + { + if( pEntry->pTexture->m_dwCreatedTextureWidth < pgti->WidthToCreate ) + { + pEntry->ti.WidthToLoad = pEntry->pTexture->m_dwCreatedTextureWidth; + pEntry->pTexture->m_bScaledS = false; + pEntry->pTexture->m_bScaledT = false; + } + if( pEntry->pTexture->m_dwCreatedTextureHeight < pgti->HeightToCreate ) + { + pEntry->ti.HeightToLoad = pEntry->pTexture->m_dwCreatedTextureHeight; + pEntry->pTexture->m_bScaledT = false; + pEntry->pTexture->m_bScaledS = false; + } + + TextureFmt dwType = pEntry->pTexture->GetSurfaceFormat(); + SAFE_DELETE(pEntry->pEnhancedTexture); + pEntry->dwEnhancementFlag = TEXTURE_NO_ENHANCEMENT; + + if (dwType != TEXTURE_FMT_UNKNOWN) + { + if( loadFromTextureBuffer ) + { + g_pFrameBufferManager->LoadTextureFromRenderTexture(pEntry, txtBufIdxToLoadFrom); + DEBUGGER_IF_DUMP((pauseAtNext && loadFromTextureBuffer) , + {DebuggerAppendMsg("Load texture from render_texture %d", txtBufIdxToLoadFrom);} + ); + + extern void ConvertTextureRGBAtoI(TxtrCacheEntry* pEntry, bool alpha); + if( g_pRenderTextureInfo->CI_Info.dwFormat == TXT_FMT_I ) + { + // Convert texture from RGBA to I + ConvertTextureRGBAtoI(pEntry,false); + } + else if( g_pRenderTextureInfo->CI_Info.dwFormat == TXT_FMT_IA ) + { + // Convert texture from RGBA to IA + ConvertTextureRGBAtoI(pEntry,true); + } + } + else + { + LOG_TEXTURE(TRACE0(" Load new texture from RDRAM:\n")); + if (dwType == TEXTURE_FMT_A8R8G8B8) + { + ConvertTexture(pEntry, fromTMEM); + } + else + ConvertTexture_16(pEntry, fromTMEM); + pEntry->FrameLastUpdated = status.gDlistCount; + SAFE_DELETE(pEntry->pEnhancedTexture); + pEntry->dwEnhancementFlag = TEXTURE_NO_ENHANCEMENT; + } + } + + pEntry->ti.WidthToLoad = pgti->WidthToLoad; + pEntry->ti.HeightToLoad = pgti->HeightToLoad; + + if( AutoExtendTexture ) + { + ExpandTextureS(pEntry); + ExpandTextureT(pEntry); + } + + if( options.bDumpTexturesToFiles && !loadFromTextureBuffer ) + { + DumpCachedTexture(*pEntry); + } + +#ifdef DEBUGGER + if( pauseAtNext && eventToPause == NEXT_NEW_TEXTURE ) + { + CRender::g_pRender->SetCurrentTexture( 0, pEntry->pTexture, pEntry->ti.WidthToCreate, pEntry->ti.HeightToCreate, pEntry); + CRender::g_pRender->DrawTexture(0); + debuggerPause = true; + TRACE0("Pause after loading a new texture"); + if( pEntry->ti.Format == TXT_FMT_YUV ) + { + TRACE0("This is YUV texture"); + } + DebuggerAppendMsg("W:%d, H:%d, RealW:%d, RealH:%d, D3DW:%d, D3DH: %d", pEntry->ti.WidthToCreate, pEntry->ti.HeightToCreate, + pEntry->ti.WidthToLoad, pEntry->ti.HeightToLoad, pEntry->pTexture->m_dwCreatedTextureWidth, pEntry->pTexture->m_dwCreatedTextureHeight); + DebuggerAppendMsg("ScaledS:%s, ScaledT:%s, CRC=%08X", pEntry->pTexture->m_bScaledS?"T":"F", pEntry->pTexture->m_bScaledT?"T":"F", pEntry->dwCRC); + DebuggerPause(); + CRender::g_pRender->SetCurrentTexture( 0, NULL, 64, 64, NULL); + } +#endif + } + } + catch (...) + { + TRACE0("Exception in texture decompression"); + g_lastTextureEntry = NULL; + return NULL; + } + + pEntry->lastEntry = g_lastTextureEntry; + g_lastTextureEntry = pEntry; + lastEntryModified = true; + return pEntry; +} + + + + +const char *pszImgFormat[8] = {"RGBA", "YUV", "CI", "IA", "I", "?1", "?2", "?3"}; +uint8 pnImgSize[4] = {4, 8, 16, 32}; +const char *textlutname[4] = {"RGB16", "I16?", "RGBA16", "IA16"}; + +extern uint16 g_wRDPTlut[]; +extern ConvertFunction gConvertFunctions_FullTMEM[ 8 ][ 4 ]; +extern ConvertFunction gConvertFunctions[ 8 ][ 4 ]; +extern ConvertFunction gConvertTlutFunctions[ 8 ][ 4 ]; +extern ConvertFunction gConvertFunctions_16[ 8 ][ 4 ]; +extern ConvertFunction gConvertFunctions_16_FullTMEM[ 8 ][ 4 ]; +extern ConvertFunction gConvertTlutFunctions_16[ 8 ][ 4 ]; +void CTextureManager::ConvertTexture(TxtrCacheEntry * pEntry, bool fromTMEM) +{ + static uint32 dwCount = 0; + + ConvertFunction pF; + if( options.bUseFullTMEM && fromTMEM && status.bAllowLoadFromTMEM ) + { + pF = gConvertFunctions_FullTMEM[ pEntry->ti.Format ][ pEntry->ti.Size ]; + } + else + { + if( gRDP.tiles[7].dwFormat == TXT_FMT_YUV ) + { + if( gRDP.otherMode.text_tlut>=2 ) + pF = gConvertTlutFunctions[ TXT_FMT_YUV ][ pEntry->ti.Size ]; + else + pF = gConvertFunctions[ TXT_FMT_YUV ][ pEntry->ti.Size ]; + } + else + { + if( gRDP.otherMode.text_tlut>=2 ) + pF = gConvertTlutFunctions[ pEntry->ti.Format ][ pEntry->ti.Size ]; + else + pF = gConvertFunctions[ pEntry->ti.Format ][ pEntry->ti.Size ]; + } + } + + if( pF ) + { + pF( pEntry->pTexture, pEntry->ti ); + + LOG_TEXTURE( + { + DebuggerAppendMsg("Decompress 32bit Texture:\n\tFormat: %s\n\tImage Size:%d\n", + pszImgFormat[pEntry->ti.Format], pnImgSize[pEntry->ti.Size]); + DebuggerAppendMsg("Palette Format: %s (%d)\n", textlutname[pEntry->ti.TLutFmt>>RSP_SETOTHERMODE_SHIFT_TEXTLUT], pEntry->ti.TLutFmt>>RSP_SETOTHERMODE_SHIFT_TEXTLUT); + }); + } + else + { + TRACE2("ConvertTexture: Unable to decompress %s/%dbpp", pszImgFormat[pEntry->ti.Format], pnImgSize[pEntry->ti.Size]); + } + + dwCount++; +} + +void CTextureManager::ConvertTexture_16(TxtrCacheEntry * pEntry, bool fromTMEM) +{ + static uint32 dwCount = 0; + + ConvertFunction pF; + + if( options.bUseFullTMEM && fromTMEM && status.bAllowLoadFromTMEM ) + { + pF = gConvertFunctions_16_FullTMEM[ pEntry->ti.Format ][ pEntry->ti.Size ]; + } + else + { + if( gRDP.otherMode.text_tlut>=2 ) + pF = gConvertTlutFunctions_16[ pEntry->ti.Format ][ pEntry->ti.Size ]; + else + pF = gConvertFunctions_16[ pEntry->ti.Format ][ pEntry->ti.Size ]; + } + + if( pF ) + { + pF( pEntry->pTexture, pEntry->ti ); + + LOG_TEXTURE(TRACE2("Decompress 16bit Texture:\n\tFormat: %s\n\tImage Size:%d\n", + pszImgFormat[pEntry->ti.Format], pnImgSize[pEntry->ti.Size])); + } + else + { + TRACE2("ConvertTexture: Unable to decompress %s/%dbpp", pszImgFormat[pEntry->ti.Format], pnImgSize[pEntry->ti.Size]); + } + + dwCount++; +} + +void CTextureManager::ExpandTexture(TxtrCacheEntry * pEntry, uint32 sizeToLoad, uint32 sizeToCreate, uint32 sizeCreated, + int arrayWidth, int flag, int mask, int mirror, int clamp, uint32 otherSize) +{ + if( sizeToLoad >= sizeCreated ) return; + + uint32 maskWidth = (1<pTexture->GetPixelSize(); + +#ifdef DEBUGGER + // Some checks + if( sizeToLoad > sizeToCreate || sizeToCreate > sizeCreated ) + TRACE0("Something is wrong, check me here in ExpandTextureS"); +#endif + + // Doing Mirror And/Or Wrap in S direction + // Image has been loaded with width=WidthToLoad, we need to enlarge the image + // to width = pEntry->ti.WidthToCreate by doing mirroring or wrapping + + DrawInfo di; + if( !(pEntry->pTexture->StartUpdate(&di)) ) + { + TRACE0("Cann't update the texture"); + return; + } + + + if( mask == 0 ) + { + // Clamp + Clamp(di.lpSurface, sizeToLoad, sizeCreated, arrayWidth, otherSize, + flag, size); + pEntry->pTexture->EndUpdate(&di); + return; + } + +#ifdef DEBUGGER + if( sizeToLoad > maskWidth ) + { + TRACE0("Something is wrong, check me here in ExpandTextureS"); + pEntry->pTexture->EndUpdate(&di); + return; + } + if( sizeToLoad == maskWidth && maskWidth == sizeToCreate && sizeToCreate != sizeCreated ) + { + TRACE0("Something is wrong, check me here in ExpandTextureS"); + pEntry->pTexture->EndUpdate(&di); + return; + } +#endif + + if( sizeToLoad == maskWidth ) + { + uint32 tempwidth = clamp ? sizeToCreate : sizeCreated; + if( mirror ) + { + Mirror(di.lpSurface, sizeToLoad, mask, tempwidth, + arrayWidth, otherSize, flag, size ); + } + else + { + Wrap(di.lpSurface, sizeToLoad, mask, tempwidth, + arrayWidth, otherSize, flag, size ); + } + + if( tempwidth < sizeCreated ) + { + Clamp(di.lpSurface, tempwidth, sizeCreated, arrayWidth, otherSize, + flag, size ); + } + + pEntry->pTexture->EndUpdate(&di); + return; + } + + + if( sizeToLoad < sizeToCreate && sizeToCreate == maskWidth && maskWidth == sizeCreated ) + { + // widthToLoad < widthToCreate = maskWidth + Wrap(di.lpSurface, sizeToLoad, mask, sizeCreated, arrayWidth, otherSize, flag, size ); + + pEntry->pTexture->EndUpdate(&di); + return; + } + + if( sizeToLoad == sizeToCreate && sizeToCreate < maskWidth ) + { +#ifdef DEBUGGER + if( maskWidth < sizeToCreate ) TRACE0("Incorrect condition, check me"); +#endif + Clamp(di.lpSurface, sizeToLoad, sizeCreated, arrayWidth, otherSize, flag, size ); + + pEntry->pTexture->EndUpdate(&di); + return; + } + + if( sizeToLoad < sizeToCreate && sizeToCreate < maskWidth ) + { +#ifdef DEBUGGER + if( clamp ) TRACE0("Incorrect condition, check me"); + if( maskWidth < sizeCreated ) TRACE0("Incorrect condition, check me"); +#endif + Clamp(di.lpSurface, sizeToLoad, sizeCreated, arrayWidth, otherSize, flag, size ); + pEntry->pTexture->EndUpdate(&di); + return; + } + + TRACE0("Check me, should not get here"); + pEntry->pTexture->EndUpdate(&di); +} + +void CTextureManager::ExpandTextureS(TxtrCacheEntry * pEntry) +{ + TxtrInfo &ti = pEntry->ti; + uint32 textureWidth = pEntry->pTexture->m_dwCreatedTextureWidth; + ExpandTexture(pEntry, ti.WidthToLoad, ti.WidthToCreate, textureWidth, + textureWidth, S_FLAG, ti.maskS, ti.mirrorS, ti.clampS, ti.HeightToLoad); +} + +void CTextureManager::ExpandTextureT(TxtrCacheEntry * pEntry) +{ + TxtrInfo &ti = pEntry->ti; + uint32 textureHeight = pEntry->pTexture->m_dwCreatedTextureHeight; + uint32 textureWidth = pEntry->pTexture->m_dwCreatedTextureWidth; + ExpandTexture(pEntry, ti.HeightToLoad, ti.HeightToCreate, textureHeight, + textureWidth, T_FLAG, ti.maskT, ti.mirrorT, ti.clampT, ti.WidthToLoad); +} + + +void CTextureManager::ClampS32(uint32 *array, uint32 width, uint32 towidth, uint32 arrayWidth, uint32 rows) +{ + if ((int) width <= 0 || (int) towidth < 0) + return; + + for( uint32 y = 0; ymaskval?y&maskval:y-height); + uint32* linedst = array+arrayWidth*y;; + for( uint32 x=0; xmaskval?y&maskval:y-height); + uint16* linedst = array+arrayWidth*y;; + for( uint32 x=0; xpNext) + { + if( size == tex ) + return pEntry; + else + size++; + } + } + } + return NULL; +} +uint32 CTextureManager::GetNumOfCachedTexture() +{ + uint32 size = 0; + for( uint32 i=0; ipNext) + { + size++; + } + } + } + TRACE1("Totally %d texture cached", size); + return size; +} +#endif + + +TxtrCacheEntry * CTextureManager::GetBlackTexture(void) +{ + if( m_blackTextureEntry.pTexture == NULL ) + { + m_blackTextureEntry.pTexture = CDeviceBuilder::GetBuilder()->CreateTexture(4, 4); + m_blackTextureEntry.ti.WidthToCreate = 4; + m_blackTextureEntry.ti.HeightToCreate = 4; + updateColorTexture(m_blackTextureEntry.pTexture,0x00000000); + } + return &m_blackTextureEntry; +} +TxtrCacheEntry * CTextureManager::GetPrimColorTexture(uint32 color) +{ + static uint32 mcolor = 0; + if( m_PrimColorTextureEntry.pTexture == NULL ) + { + m_PrimColorTextureEntry.pTexture = CDeviceBuilder::GetBuilder()->CreateTexture(4, 4); + m_PrimColorTextureEntry.ti.WidthToCreate = 4; + m_PrimColorTextureEntry.ti.HeightToCreate = 4; + updateColorTexture(m_PrimColorTextureEntry.pTexture,color); + gRDP.texturesAreReloaded = true; + } + else if( mcolor != color ) + { + updateColorTexture(m_PrimColorTextureEntry.pTexture,color); + gRDP.texturesAreReloaded = true; + } + + mcolor = color; + return &m_PrimColorTextureEntry; +} +TxtrCacheEntry * CTextureManager::GetEnvColorTexture(uint32 color) +{ + static uint32 mcolor = 0; + if( m_EnvColorTextureEntry.pTexture == NULL ) + { + m_EnvColorTextureEntry.pTexture = CDeviceBuilder::GetBuilder()->CreateTexture(4, 4); + m_EnvColorTextureEntry.ti.WidthToCreate = 4; + m_EnvColorTextureEntry.ti.HeightToCreate = 4; + gRDP.texturesAreReloaded = true; + + updateColorTexture(m_EnvColorTextureEntry.pTexture,color); + } + else if( mcolor != color ) + { + updateColorTexture(m_EnvColorTextureEntry.pTexture,color); + gRDP.texturesAreReloaded = true; + } + + mcolor = color; + return &m_EnvColorTextureEntry; +} +TxtrCacheEntry * CTextureManager::GetLODFracTexture(uint8 fac) +{ + static uint8 mfac = 0; + if( m_LODFracTextureEntry.pTexture == NULL ) + { + m_LODFracTextureEntry.pTexture = CDeviceBuilder::GetBuilder()->CreateTexture(4, 4); + m_LODFracTextureEntry.ti.WidthToCreate = 4; + m_LODFracTextureEntry.ti.HeightToCreate = 4; + uint32 factor = fac; + uint32 color = fac; + color |= factor << 8; + color |= color << 16; + updateColorTexture(m_LODFracTextureEntry.pTexture,color); + gRDP.texturesAreReloaded = true; + } + else if( mfac != fac ) + { + uint32 factor = fac; + uint32 color = fac; + color |= factor << 8; + color |= color << 16; + updateColorTexture(m_LODFracTextureEntry.pTexture,color); + gRDP.texturesAreReloaded = true; + } + + mfac = fac; + return &m_LODFracTextureEntry; +} + +TxtrCacheEntry * CTextureManager::GetPrimLODFracTexture(uint8 fac) +{ + static uint8 mfac = 0; + if( m_PrimLODFracTextureEntry.pTexture == NULL ) + { + m_PrimLODFracTextureEntry.pTexture = CDeviceBuilder::GetBuilder()->CreateTexture(4, 4); + m_PrimLODFracTextureEntry.ti.WidthToCreate = 4; + m_PrimLODFracTextureEntry.ti.HeightToCreate = 4; + uint32 factor = fac; + uint32 color = fac; + color |= factor << 8; + color |= color << 16; + updateColorTexture(m_PrimLODFracTextureEntry.pTexture,color); + gRDP.texturesAreReloaded = true; + } + else if( mfac != fac ) + { + uint32 factor = fac; + uint32 color = fac; + color |= factor << 8; + color |= color << 16; + updateColorTexture(m_PrimLODFracTextureEntry.pTexture,color); + gRDP.texturesAreReloaded = true; + } + + mfac = fac; + return &m_PrimLODFracTextureEntry; +} + +TxtrCacheEntry * CTextureManager::GetConstantColorTexture(uint32 constant) +{ + switch( constant ) + { + case MUX_PRIM: + return GetPrimColorTexture(gRDP.primitiveColor); + break; + case MUX_ENV: + return GetEnvColorTexture(gRDP.envColor); + break; + case MUX_LODFRAC: + return GetLODFracTexture((uint8)gRDP.LODFrac); + break; + default: // MUX_PRIMLODFRAC + return GetPrimLODFracTexture((uint8)gRDP.primLODFrac); + break; + } +} + +void CTextureManager::updateColorTexture(CTexture *ptexture, uint32 color) +{ + DrawInfo di; + if( !(ptexture->StartUpdate(&di)) ) + { + TRACE0("Cann't update the texture"); + return; + } + + int size = ptexture->GetPixelSize(); + switch( size ) + { + case 2: // 16 bits + { + uint16 *buf = (uint16*)di.lpSurface; + uint16 color16= (uint16)((color>>4)&0xF); + color16 |= ((color>>12)&0xF)<<4; + color16 |= ((color>>20)&0xF)<<8; + color16 |= ((color>>28)&0xF)<<12; + for( int i=0; i<16; i++ ) + { + buf[i] = color16; + } + } + break; + case 4: // 32 bits + { + uint32 *buf = (uint32*)di.lpSurface; + for( int i=0; i<16; i++ ) + { + buf[i] = color; + } + } + break; + } + + ptexture->EndUpdate(&di); +} + +void ConvertTextureRGBAtoI(TxtrCacheEntry* pEntry, bool alpha) +{ + DrawInfo srcInfo; + if( pEntry->pTexture->StartUpdate(&srcInfo) ) + { + uint32 *buf; + uint32 val; + uint32 r,g,b,a,i; + + for(int nY = 0; nY < srcInfo.dwCreatedHeight; nY++) + { + buf = (uint32*)((uint8*)srcInfo.lpSurface+nY*srcInfo.lPitch); + for(int nX = 0; nX < srcInfo.dwCreatedWidth; nX++) + { + val = buf[nX]; + b = (val>>0)&0xFF; + g = (val>>8)&0xFF; + r = (val>>16)&0xFF; + i = (r+g+b)/3; + a = alpha?(val&0xFF000000):(i<<24); + buf[nX] = (a|(i<<16)|(i<<8)|i); + } + } + pEntry->pTexture->EndUpdate(&srcInfo); + } +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/TextureManager.h b/libmupen64plus/mupen64plus-video-rice/src/TextureManager.h new file mode 100644 index 0000000000..78efe8eeac --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/TextureManager.h @@ -0,0 +1,256 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + +#ifndef __TEXTUREHANDLER_H__ +#define __TEXTUREHANDLER_H__ + +#ifndef SAFE_DELETE +#define SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } } +#endif + +#ifndef SAFE_CHECK +# define SAFE_CHECK(a) if( (a) == NULL ) {DebugMessage(M64MSG_ERROR, "Creater out of memory"); throw new std::exception();} +#endif + +#include + +#include "typedefs.h" +#include "Texture.h" +#define absi(x) ((x)>=0?(x):(-x)) +#define S_FLAG 0 +#define T_FLAG 1 + +class TxtrInfo +{ +public: + uint32 WidthToCreate; + uint32 HeightToCreate; + + uint32 Address; + void *pPhysicalAddress; + + uint32 Format; + uint32 Size; + + int LeftToLoad; + int TopToLoad; + uint32 WidthToLoad; + uint32 HeightToLoad; + uint32 Pitch; + + uchar *PalAddress; + uint32 TLutFmt; + uint32 Palette; + + BOOL bSwapped; + + uint32 maskS; + uint32 maskT; + + BOOL clampS; + BOOL clampT; + BOOL mirrorS; + BOOL mirrorT; + + int tileNo; + + inline TxtrInfo& operator = (const TxtrInfo& src) + { + memcpy(this, &src, sizeof( TxtrInfo )); + return *this; + } + + inline TxtrInfo& operator = (const Tile& tile) + { + Format = tile.dwFormat; + Size = tile.dwSize; + Palette = tile.dwPalette; + + maskS = tile.dwMaskS; + maskT = tile.dwMaskT; + mirrorS = tile.bMirrorS; + mirrorT = tile.bMirrorT; + clampS = tile.bClampS; + clampT = tile.bClampT; + + return *this; + } + + inline bool operator == ( const TxtrInfo& sec) + { + return ( + Address == sec.Address && + WidthToLoad == sec.WidthToLoad && + HeightToLoad == sec.HeightToLoad && + WidthToCreate == sec.WidthToCreate && + HeightToCreate == sec.HeightToCreate && + maskS == sec.maskS && + maskT == sec.maskT && + TLutFmt == sec.TLutFmt && + PalAddress == sec.PalAddress && + Palette == sec.Palette && + LeftToLoad == sec.LeftToLoad && + TopToLoad == sec.TopToLoad && + Format == sec.Format && + Size == sec.Size && + Pitch == sec.Pitch && + bSwapped == sec.bSwapped && + mirrorS == sec.mirrorS && + mirrorT == sec.mirrorT && + clampS == sec.clampS && + clampT == sec.clampT + ); + } + + inline bool isEqual(const TxtrInfo& sec) + { + return (*this == sec); + } + +} ; + + + +typedef struct TxtrCacheEntry +{ + TxtrCacheEntry(): + pTexture(NULL),pEnhancedTexture(NULL),txtrBufIdx(0) {} + + ~TxtrCacheEntry() + { + SAFE_DELETE(pTexture); + SAFE_DELETE(pEnhancedTexture); + } + + struct TxtrCacheEntry *pNext; // Must be first element! + + struct TxtrCacheEntry *pNextYoungest; + struct TxtrCacheEntry *pLastYoungest; + + TxtrInfo ti; + uint32 dwCRC; + uint32 dwPalCRC; + int maxCI; + + uint32 dwUses; // Total times used (for stats) + uint32 dwTimeLastUsed; // timeGetTime of time of last usage + uint32 FrameLastUsed; // Frame # that this was last used + uint32 FrameLastUpdated; + + CTexture *pTexture; + CTexture *pEnhancedTexture; + + uint32 dwEnhancementFlag; + int txtrBufIdx; + bool bExternalTxtrChecked; + + TxtrCacheEntry *lastEntry; +} TxtrCacheEntry; + + +//***************************************************************************** +// Texture cache implementation +//***************************************************************************** +class CTextureManager +{ +protected: + TxtrCacheEntry * CreateNewCacheEntry(uint32 dwAddr, uint32 dwWidth, uint32 dwHeight); + void AddTexture(TxtrCacheEntry *pEntry); + void RemoveTexture(TxtrCacheEntry * pEntry); + void RecycleTexture(TxtrCacheEntry *pEntry); + TxtrCacheEntry * ReviveTexture( uint32 width, uint32 height ); + TxtrCacheEntry * GetTxtrCacheEntry(TxtrInfo * pti); + + void ConvertTexture(TxtrCacheEntry * pEntry, bool fromTMEM); + void ConvertTexture_16(TxtrCacheEntry * pEntry, bool fromTMEM); + + void ClampS32(uint32 *array, uint32 width, uint32 towidth, uint32 arrayWidth, uint32 rows); + void ClampS16(uint16 *array, uint32 width, uint32 towidth, uint32 arrayWidth, uint32 rows); + void ClampT32(uint32 *array, uint32 height, uint32 toheight, uint32 arrayWidth, uint32 cols); + void ClampT16(uint16 *array, uint32 height, uint32 toheight, uint32 arrayWidth, uint32 cols); + + void MirrorS32(uint32 *array, uint32 width, uint32 mask, uint32 towidth, uint32 arrayWidth, uint32 rows); + void MirrorS16(uint16 *array, uint32 width, uint32 mask, uint32 towidth, uint32 arrayWidth, uint32 rows); + void MirrorT32(uint32 *array, uint32 height, uint32 mask, uint32 toheight, uint32 arrayWidth, uint32 cols); + void MirrorT16(uint16 *array, uint32 height, uint32 mask, uint32 toheight, uint32 arrayWidth, uint32 cols); + + void WrapS32(uint32 *array, uint32 width, uint32 mask, uint32 towidth, uint32 arrayWidth, uint32 rows); + void WrapS16(uint16 *array, uint32 width, uint32 mask, uint32 towidth, uint32 arrayWidth, uint32 rows); + void WrapT32(uint32 *array, uint32 height, uint32 mask, uint32 toheight, uint32 arrayWidth, uint32 cols); + void WrapT16(uint16 *array, uint32 height, uint32 mask, uint32 toheight, uint32 arrayWidth, uint32 cols); + + void ExpandTextureS(TxtrCacheEntry * pEntry); + void ExpandTextureT(TxtrCacheEntry * pEntry); + void ExpandTexture(TxtrCacheEntry * pEntry, uint32 sizeOfLoad, uint32 sizeToCreate, uint32 sizeCreated, + int arrayWidth, int flag, int mask, int mirror, int clamp, uint32 otherSize); + + uint32 Hash(uint32 dwValue); + bool TCacheEntryIsLoaded(TxtrCacheEntry *pEntry); + + void updateColorTexture(CTexture *ptexture, uint32 color); + +public: + void Wrap(void *array, uint32 width, uint32 mask, uint32 towidth, uint32 arrayWidth, uint32 rows, int flag, int size ); + void Clamp(void *array, uint32 width, uint32 towidth, uint32 arrayWidth, uint32 rows, int flag, int size ); + void Mirror(void *array, uint32 width, uint32 mask, uint32 towidth, uint32 arrayWidth, uint32 rows, int flag, int size ); + +protected: + TxtrCacheEntry * m_pHead; + TxtrCacheEntry ** m_pCacheTxtrList; + uint32 m_numOfCachedTxtrList; + + TxtrCacheEntry m_blackTextureEntry; + TxtrCacheEntry m_PrimColorTextureEntry; + TxtrCacheEntry m_EnvColorTextureEntry; + TxtrCacheEntry m_LODFracTextureEntry; + TxtrCacheEntry m_PrimLODFracTextureEntry; + TxtrCacheEntry * GetPrimColorTexture(uint32 color); + TxtrCacheEntry * GetEnvColorTexture(uint32 color); + TxtrCacheEntry * GetLODFracTexture(uint8 fac); + TxtrCacheEntry * GetPrimLODFracTexture(uint8 fac); + + void MakeTextureYoungest(TxtrCacheEntry *pEntry); + unsigned int m_currentTextureMemUsage; + TxtrCacheEntry *m_pYoungestTexture; + TxtrCacheEntry *m_pOldestTexture; + +public: + CTextureManager(); + ~CTextureManager(); + + TxtrCacheEntry * GetBlackTexture(void); + TxtrCacheEntry * GetConstantColorTexture(uint32 constant); + TxtrCacheEntry * GetTexture(TxtrInfo * pgti, bool fromTMEM, bool doCRCCheck=true, bool AutoExtendTexture = false); + + void PurgeOldTextures(); + void RecycleAllTextures(); + void RecheckHiresForAllTextures(); + bool CleanUp(); + +#ifdef DEBUGGER + TxtrCacheEntry * GetCachedTexture(uint32 tex); + uint32 GetNumOfCachedTexture(); +#endif +}; + +extern CTextureManager gTextureManager; // The global instance of CTextureManager class +extern void DumpCachedTexture(TxtrCacheEntry &entry); + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/Timing.h b/libmupen64plus/mupen64plus-video-rice/src/Timing.h new file mode 100644 index 0000000000..8c0b275c79 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/Timing.h @@ -0,0 +1,117 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + +#ifndef _RSP_RDP_TIMING_H_ +#define _RSP_RDP_TIMING_H_ + +enum +{ + Timing_SP_Minimal = 10, + Timing_SP_Minimal2 = 20, + Timing_SP_Minimal4 = 40, + Timing_SP_Minimal8 = 80, + Timing_SP_Each_Triangle = 80, + Timing_SP_Each_2_Triangle2 = 160, + + Timing_RSP_GBI1_SpNoop = Timing_SP_Minimal, + Timing_RSP_GBI0_Mtx = Timing_SP_Minimal8, + Timing_RSP_GBI1_Reserved = Timing_SP_Minimal2, + Timing_RSP_GBI1_MoveMem = Timing_SP_Minimal2, // Fix me + Timing_RSP_GBI1_Vtx = Timing_SP_Minimal4, // for each vertex + Timing_RSP_GBI0_Vtx = Timing_SP_Minimal4, // for each vertex + Timing_RSP_GBI0_DL = Timing_SP_Minimal*2, + Timing_RSP_GBI1_Sprite2DBase = Timing_SP_Minimal8, + Timing_RSP_GBI1_LoadUCode = 800, + + Timing_RSP_GBI1_BranchZ = Timing_SP_Minimal2, + Timing_RSP_GBI1_Tri2 = Timing_SP_Each_2_Triangle2, + Timing_RSP_GBI1_ModifyVtx = Timing_SP_Minimal4, + Timing_RSP_GBI1_RDPHalf_2 = Timing_SP_Minimal, + Timing_RSP_GBI1_RDPHalf_1 = Timing_SP_Minimal, + Timing_RSP_GBI1_RDPHalf_Cont = Timing_SP_Minimal, + Timing_RSP_GBI1_Line3D = Timing_SP_Each_Triangle, + Timing_RSP_GBI1_ClearGeometryMode = Timing_SP_Minimal, + Timing_RSP_GBI1_SetGeometryMode = Timing_SP_Minimal, + Timing_RSP_GBI2_GeometryMode = Timing_SP_Minimal, + Timing_RSP_GBI1_EndDL = Timing_SP_Minimal, + Timing_RSP_GBI1_SetOtherModeL = Timing_SP_Minimal, + Timing_RSP_GBI1_SetOtherModeH = Timing_SP_Minimal, + Timing_RSP_GBI1_Texture = Timing_SP_Minimal2, + Timing_RSP_GBI1_MoveWord = Timing_SP_Minimal2, + Timing_RSP_GBI2_SubModule = Timing_SP_Minimal2, + + Timing_RSP_GBI1_PopMtx = Timing_SP_Minimal8, + Timing_RSP_GBI1_CullDL = Timing_SP_Minimal2, + Timing_RSP_GBI1_Tri1 = Timing_SP_Each_Triangle, + + Timing_RSP_GBI1_Noop = Timing_SP_Minimal, + Timing_RSP_S2DEX_SPObjLoadTxtr_Ucode1 = Timing_SP_Minimal8, + + Timing_DP_Minimal = 10, + Timing_DP_Minimal2 = 20, + Timing_DP_Minimal4 = 40, + Timing_DP_Minimal8 = 80, + Timing_DP_Minimal16 = 160, + Timing_DP_Each_Point = 1, + + Timing_RDP_TriFill = Timing_DP_Minimal8, + Timing_RDP_TriFillZ = Timing_DP_Minimal8, + Timing_RDP_TriTxtr = Timing_DP_Minimal8, + Timing_RDP_TriTxtrZ = Timing_DP_Minimal8, + Timing_RDP_TriShade = Timing_DP_Minimal8, + Timing_RDP_TriShadeZ = Timing_DP_Minimal8, + Timing_RDP_TriShadeTxtr = Timing_DP_Minimal8, + Timing_RDP_TriShadeTxtrZ = Timing_DP_Minimal8, + + Timing_DLParser_TexRect = Timing_DP_Minimal8, + Timing_DLParser_TexRectFlip = Timing_DP_Minimal8, + Timing_DLParser_RDPLoadSync = Timing_DP_Minimal, + Timing_DLParser_RDPPipeSync = Timing_DP_Minimal, + Timing_DLParser_RDPTileSync = Timing_DP_Minimal, + Timing_DLParser_RDPFullSync = Timing_DP_Minimal8, + Timing_DLParser_SetKeyGB = Timing_DP_Minimal, + Timing_DLParser_SetKeyR = Timing_DP_Minimal, + Timing_DLParser_SetConvert = Timing_DP_Minimal2, + Timing_DLParser_SetScissor = Timing_DP_Minimal2, + Timing_DLParser_SetPrimDepth = Timing_DP_Minimal2, + Timing_DLParser_RDPSetOtherMode = Timing_DP_Minimal, + + Timing_DLParser_LoadTLut = Timing_DP_Minimal16, + Timing_RSP_RDP_Nothing = Timing_DP_Minimal, + Timing_DLParser_SetTileSize = Timing_DP_Minimal4, + Timing_DLParser_LoadBlock = Timing_DP_Minimal16, + Timing_DLParser_LoadTile = Timing_DP_Minimal16, + Timing_DLParser_SetTile = Timing_DP_Minimal8, + Timing_DLParser_FillRect = Timing_DP_Minimal16, + Timing_DLParser_SetFillColor = Timing_DP_Minimal, + Timing_DLParser_SetFogColor = Timing_DP_Minimal, + Timing_DLParser_SetBlendColor = Timing_DP_Minimal, + Timing_DLParser_SetPrimColor = Timing_DP_Minimal, + Timing_DLParser_SetEnvColor = Timing_DP_Minimal, + Timing_DLParser_SetCombine = Timing_DP_Minimal, + Timing_DLParser_SetTImg = Timing_DP_Minimal, + Timing_DLParser_SetZImg = Timing_DP_Minimal, + Timing_DLParser_SetCImg = Timing_DP_Minimal, +}; + +#define DP_Timing(t) {status.DPCycleCount+=Timing_##t;} +#define SP_Timing(t) {status.SPCycleCount+=Timing_##t;} + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/UcodeDefs.h b/libmupen64plus/mupen64plus-video-rice/src/UcodeDefs.h new file mode 100644 index 0000000000..4ed9c73abc --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/UcodeDefs.h @@ -0,0 +1,322 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + +#ifndef _UCODE_DEFS_H_ +#define _UCODE_DEFS_H_ + +typedef struct { + union { + unsigned int w0; + struct { + unsigned int arg0:24; + unsigned int cmd:8; + }; + }; + unsigned int w1; +} Gwords; + +typedef struct { + unsigned int w0; + unsigned int v2:8; + unsigned int v1:8; + unsigned int v0:8; + unsigned int flag:8; +} GGBI0_Tri1; + +typedef struct { + unsigned int v0:8; + unsigned int v1:8; + unsigned int v2:8; + unsigned int cmd:8; + unsigned int pad:24; + unsigned int flag:8; +} GGBI2_Tri1; + +typedef struct { + unsigned int :1; + unsigned int v3:7; + unsigned int :1; + unsigned int v4:7; + unsigned int :1; + unsigned int v5:7; + unsigned int cmd:8; + unsigned int :1; + unsigned int v0:7; + unsigned int :1; + unsigned int v1:7; + unsigned int :1; + unsigned int v2:7; + unsigned int flag:8; +} GGBI2_Tri2; + +typedef struct { + unsigned int w0; + unsigned int v2:8; + unsigned int v1:8; + unsigned int v0:8; + unsigned int v3:8; +} GGBI0_Ln3DTri2; + +typedef struct { + unsigned int v5:8; + unsigned int v4:8; + unsigned int v3:8; + unsigned int cmd:8; + + unsigned int v2:8; + unsigned int v1:8; + unsigned int v0:8; + unsigned int flag:8; +} GGBI1_Tri2; + +typedef struct { + unsigned int v3:8; + unsigned int v4:8; + unsigned int v5:8; + unsigned int cmd:8; + + unsigned int v0:8; + unsigned int v1:8; + unsigned int v2:8; + unsigned int flag:8; +} GGBI2_Line3D; + +typedef struct { + unsigned int len:16; + unsigned int v0:4; + unsigned int n:4; + unsigned int cmd:8; + unsigned int addr; +} GGBI0_Vtx; + +typedef struct { + unsigned int len:10; + unsigned int n:6; + unsigned int :1; + unsigned int v0:7; + unsigned int cmd:8; + unsigned int addr; +} GGBI1_Vtx; + +typedef struct { + unsigned int vend:8; + unsigned int :4; + unsigned int n:8; + unsigned int :4; + unsigned int cmd:8; + unsigned int addr; +} GGBI2_Vtx; + +typedef struct { + unsigned int width:12; + unsigned int :7; + unsigned int siz:2; + unsigned int fmt:3; + unsigned int cmd:8; + unsigned int addr; +} GSetImg; + +typedef struct { + unsigned int prim_level:8; + unsigned int prim_min_level:8; + unsigned int pad:8; + unsigned int cmd:8; + + union { + unsigned int color; + struct { + unsigned int fillcolor:16; + unsigned int fillcolor2:16; + }; + struct { + unsigned int a:8; + unsigned int b:8; + unsigned int g:8; + unsigned int r:8; + }; + }; +} GSetColor; + +typedef struct { + unsigned int :16; + unsigned int param:8; + unsigned int cmd:8; + unsigned int addr; +} GGBI0_Dlist; + +typedef struct { + unsigned int len:16; + unsigned int projection:1; + unsigned int load:1; + unsigned int push:1; + unsigned int :5; + unsigned int cmd:8; + unsigned int addr; +} GGBI0_Matrix; + +typedef struct { + unsigned int :24; + unsigned int cmd:8; + unsigned int projection:1; + unsigned int :31; +} GGBI0_PopMatrix; + +typedef struct { + union { + struct { + unsigned int param:8; + unsigned int len:16; + unsigned int cmd:8; + }; + struct { + unsigned int nopush:1; + unsigned int load:1; + unsigned int projection:1; + unsigned int :5; + unsigned int len2:16; + unsigned int cmd2:8; + }; + }; + unsigned int addr; +} GGBI2_Matrix; + +typedef struct { + unsigned int type:8; + unsigned int offset:16; + unsigned int cmd:8; + unsigned int value; +} GGBI0_MoveWord; + +typedef struct { + unsigned int offset:16; + unsigned int type:8; + unsigned int cmd:8; + unsigned int value; +} GGBI2_MoveWord; + +typedef struct { + unsigned int enable_gbi0:1; + unsigned int enable_gbi2:1; + unsigned int :6; + unsigned int tile:3; + unsigned int level:3; + unsigned int :10; + unsigned int cmd:8; + unsigned int scaleT:16; + unsigned int scaleS:16; +} GTexture; + +typedef struct { + unsigned int tl:12; + unsigned int sl:12; + unsigned int cmd:8; + + unsigned int th:12; + unsigned int sh:12; + unsigned int tile:3; + unsigned int pad:5; +} Gloadtile; + +typedef struct { + unsigned int tmem:9; + unsigned int line:9; + unsigned int pad0:1; + unsigned int siz:2; + unsigned int fmt:3; + unsigned int cmd:8; + + unsigned int shifts:4; + unsigned int masks:4; + unsigned int ms:1; + unsigned int cs:1; + unsigned int shiftt:4; + unsigned int maskt:4; + unsigned int mt:1; + unsigned int ct:1; + unsigned int palette:4; + unsigned int tile:3; + unsigned int pad1:5; +} Gsettile; + +typedef union { + Gwords words; + GGBI0_Tri1 tri1; + GGBI0_Ln3DTri2 ln3dtri2; + GGBI1_Tri2 gbi1tri2; + GGBI2_Tri1 gbi2tri1; + GGBI2_Tri2 gbi2tri2; + GGBI2_Line3D gbi2line3d; + GGBI0_Vtx gbi0vtx; + GGBI1_Vtx gbi1vtx; + GGBI2_Vtx gbi2vtx; + GSetImg setimg; + GSetColor setcolor; + GGBI0_Dlist gbi0dlist; + GGBI0_Matrix gbi0matrix; + GGBI0_PopMatrix gbi0popmatrix; + GGBI2_Matrix gbi2matrix; + GGBI0_MoveWord gbi0moveword; + GGBI2_MoveWord gbi2moveword; + GTexture texture; + Gloadtile loadtile; + Gsettile settile; + /* + Gdma dma; + Gsegment segment; + GsetothermodeH setothermodeH; + GsetothermodeL setothermodeL; + Gtexture texture; + Gperspnorm perspnorm; + Gsetcombine setcombine; + Gfillrect fillrect; + Gsettile settile; + Gloadtile loadtile; + Gsettilesize settilesize; + Gloadtlut loadtlut; + */ + long long int force_structure_alignment; +} Gfx; + +typedef union { + struct { + unsigned int w0; + unsigned int w1; + unsigned int w2; + unsigned int w3; + }; + struct { + unsigned int yl:12; /* Y coordinate of upper left */ + unsigned int xl:12; /* X coordinate of upper left */ + unsigned int cmd:8; /* command */ + + unsigned int yh:12; /* Y coordinate of lower right */ + unsigned int xh:12; /* X coordinate of lower right */ + unsigned int tile:3; /* Tile descriptor index */ + unsigned int pad1:5; /* Padding */ + + unsigned int t:16; /* T texture coord at top left */ + unsigned int s:16; /* S texture coord at top left */ + + unsigned int dtdy:16;/* Change in T per change in Y */ + unsigned int dsdx:16;/* Change in S per change in X */ + }; +} Gtexrect; + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/VectorMath.cpp b/libmupen64plus/mupen64plus-video-rice/src/VectorMath.cpp new file mode 100644 index 0000000000..e7292754a1 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/VectorMath.cpp @@ -0,0 +1,316 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - VectorMath.cpp * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Rice1964 * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include "VectorMath.h" + +//---------- XMATRIX + +XMATRIX::XMATRIX() +{ +} + +XMATRIX::XMATRIX( const float *pIn ) +{ + memcpy(m, pIn, 16*4); +} + +XMATRIX::XMATRIX( const MATRIX &pIn ) +{ + memcpy(m, pIn.m, 16*4); +} + +XMATRIX::XMATRIX( float _11, float _12, float _13, float _14, + float _21, float _22, float _23, float _24, + float _31, float _32, float _33, float _34, + float _41, float _42, float _43, float _44 ) +{ + this->_11 = _11; + this->_12 = _12; + this->_13 = _13; + this->_14 = _14; + this->_21 = _21; + this->_22 = _22; + this->_23 = _23; + this->_24 = _24; + this->_31 = _31; + this->_32 = _32; + this->_33 = _33; + this->_34 = _34; + this->_41 = _41; + this->_42 = _42; + this->_43 = _43; + this->_44 = _44; +} + +float& XMATRIX::operator () ( unsigned int Row, unsigned int Col ) +{ + return m[Row][Col]; +} + +float XMATRIX::operator () ( unsigned int Row, unsigned int Col ) const +{ + return m[Row][Col]; +} + +XMATRIX::operator float* () +{ + return (float*)m; +} + +XMATRIX::operator const float* () const +{ + return (float*)m; +} + +XMATRIX& XMATRIX::operator *= ( const XMATRIX &pIn ) +{ + XMATRIX mTemp(*this); + *this = mTemp*pIn; + return *this; +} + +XMATRIX& XMATRIX::operator += ( const XMATRIX &pIn ) +{ + XMATRIX mTemp(*this); + *this = mTemp+pIn; + return *this; +} + +XMATRIX& XMATRIX::operator -= ( const XMATRIX &pIn ) +{ + XMATRIX mTemp(*this); + *this = mTemp-pIn; + return *this; +} + +XMATRIX& XMATRIX::operator *= ( float f) +{ + for (int i=0; i<16; i++) + { + ((float*)m)[i] *= f; + } + + return *this; +} + +XMATRIX& XMATRIX::operator /= ( float f) +{ + for (int i=0; i<16; i++) + { + ((float*)m)[i] /= f; + } + + return *this; +} + +XMATRIX XMATRIX::operator + () const +{ + return *this; +} + +XMATRIX XMATRIX::operator - () const +{ + XMATRIX mTemp; + + for (int i=0; i<16; i++) + { + ((float*)mTemp.m)[i] = -((float*)m)[i]; + } + + return mTemp; +} + +XMATRIX XMATRIX::operator * ( const XMATRIX &pIn ) const +{ + XMATRIX mTemp; + + for (int i=0; i<4; i++) + { + for (int j=0; j<4; j++) + { + mTemp.m[i][j] = m[i][0]*pIn.m[0][j] + + m[i][1]*pIn.m[1][j] + + m[i][2]*pIn.m[2][j] + + m[i][3]*pIn.m[3][j]; + } + } + + return mTemp; +} + +XMATRIX XMATRIX::operator + ( const XMATRIX &pIn ) const +{ + XMATRIX mTemp; + + for (int i=0; i<16; i++) + { + ((float*)mTemp.m)[i] = ((float*)m)[i] + ((float*)pIn.m)[i]; + } + + return mTemp; +} + +XMATRIX XMATRIX::operator - ( const XMATRIX &pIn ) const +{ + XMATRIX mTemp; + + for (int i=0; i<16; i++) + { + ((float*)mTemp.m)[i] = ((float*)m)[i] - ((float*)pIn.m)[i]; + } + + return mTemp; +} + +/* + XMATRIX operator * ( float ) const; + XMATRIX operator / ( float ) const; + friend XMATRIX operator * ( float, const XMATRIX & ); + bool operator == ( const XMATRIX & ) const; + bool operator != ( const XMATRIX & ) const; +*/ + +//---------- VECTOR3 + +XVECTOR3::XVECTOR3() +{ +} + +XVECTOR3::XVECTOR3( const float *f ) +{ + x = f[0]; + y = f[1]; + z = f[2]; +} + +XVECTOR3::XVECTOR3( const VECTOR3 &v ) +{ + x = v.x; + y = v.y; + z = v.z; +} + +XVECTOR3::XVECTOR3( float _x, float _y, float _z ) +{ + x = _x; + y = _y; + z = _z; +} + +/* + // casting + inline operator float* (); + inline operator const float* () const; + + // assignment operators + inline XVECTOR3& operator += ( const XVECTOR3 &op ); + inline XVECTOR3& operator -= ( const XVECTOR3 &op ); + inline XVECTOR3& operator *= ( float op ); + inline XVECTOR3& operator /= ( float op ); + + // unary operators + inline XVECTOR3 operator + () const; + inline XVECTOR3 operator - () const; + + // binary operators + inline XVECTOR3 operator + ( const XVECTOR3 &op ) const; + inline XVECTOR3 operator - ( const XVECTOR3 &op ) const; + inline XVECTOR3 operator * ( float op ) const; + inline XVECTOR3 operator / ( float op ) const; + + + friend XVECTOR3 operator * ( float, const XVECTOR3& ); + + inline bool operator == ( const XVECTOR3 &op ) const; + inline bool operator != ( const XVECTOR3 &op ) const; +*/ + +//---------- XVECTOR4 + +XVECTOR4::XVECTOR4() +{ +} + +/* + XVECTOR4( const float *f ); + XVECTOR4( const VECTOR4 &v ); + XVECTOR4( float _x, float _y, float _z, float _w ); + + // casting + inline operator float* (); + inline operator const float* () const; + + // assignment operators + inline XVECTOR4& operator += ( const XVECTOR4 &op ); + inline XVECTOR4& operator -= ( const XVECTOR4 &op ); + inline XVECTOR4& operator *= ( float op ); + inline XVECTOR4& operator /= ( float op ); + + // unary operators + inline XVECTOR4 operator + () const; + inline XVECTOR4 operator - () const; + + // binary operators + inline XVECTOR4 operator + ( const XVECTOR4 &op ) const; + inline XVECTOR4 operator - ( const XVECTOR4 &op ) const; + inline XVECTOR4 operator * ( float op ) const; + inline XVECTOR4 operator / ( float op ) const; + + friend XVECTOR4 operator * ( float, const XVECTOR4& ); + + inline bool operator == ( const XVECTOR4 &op ) const; + inline bool operator != ( const XVECTOR4 &op ) const; +*/ + +//---------- OTHER + +XMATRIX* MatrixTranspose( XMATRIX* pOut, const XMATRIX* pM ) +{ + pOut->_11 = pM->_11; + pOut->_12 = pM->_21; + pOut->_13 = pM->_31; + pOut->_14 = pM->_41; + pOut->_21 = pM->_12; + pOut->_22 = pM->_22; + pOut->_23 = pM->_32; + pOut->_24 = pM->_42; + pOut->_31 = pM->_13; + pOut->_32 = pM->_23; + pOut->_33 = pM->_33; + pOut->_34 = pM->_43; + pOut->_41 = pM->_14; + pOut->_42 = pM->_24; + pOut->_43 = pM->_34; + pOut->_44 = pM->_44; + return pOut; +} + +XVECTOR4 Vec3Transform( XVECTOR4 *pOut, const XVECTOR3 *pV, const XMATRIX *pM ) +{ + pOut->x = pV->x*pM->_11 + pV->y*pM->_21 + pV->z*pM->_31 + pM->_41; + pOut->y = pV->x*pM->_12 + pV->y*pM->_22 + pV->z*pM->_32 + pM->_42; + pOut->z = pV->x*pM->_13 + pV->y*pM->_23 + pV->z*pM->_33 + pM->_43; + pOut->w = pV->x*pM->_14 + pV->y*pM->_24 + pV->z*pM->_34 + pM->_44; + return *pOut; +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/VectorMath.h b/libmupen64plus/mupen64plus-video-rice/src/VectorMath.h new file mode 100644 index 0000000000..790fdae7eb --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/VectorMath.h @@ -0,0 +1,176 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - VectorMath.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2002 Rice1964 * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef VECTORMATH_H +#define VECTORMATH_H + +/****************************************************************************** + * 4x4 matrix + ******************************************************************************/ + +typedef struct _MATRIX { + union { + struct { + float _11, _12, _13, _14; + float _21, _22, _23, _24; + float _31, _32, _33, _34; + float _41, _42, _43, _44; + }; + float m[4][4]; + }; +} MATRIX; + +typedef struct XMATRIX : public MATRIX { +public: + XMATRIX(); + XMATRIX( const float * ); + XMATRIX( const MATRIX & ); + XMATRIX( float _11, float _12, float _13, float _14, + float _21, float _22, float _23, float _24, + float _31, float _32, float _33, float _34, + float _41, float _42, float _43, float _44 ); + + float& operator () ( unsigned int Row, unsigned int Col ); + float operator () ( unsigned int Row, unsigned int Col ) const; + + operator float* (); + operator const float* () const; + + // assignment operators + XMATRIX& operator *= ( const XMATRIX & ); + XMATRIX& operator += ( const XMATRIX & ); + XMATRIX& operator -= ( const XMATRIX & ); + XMATRIX& operator *= ( float ); + XMATRIX& operator /= ( float ); + + // unary operators + XMATRIX operator + () const; + XMATRIX operator - () const; + + // binary operators + XMATRIX operator * ( const XMATRIX & ) const; + XMATRIX operator + ( const XMATRIX & ) const; + XMATRIX operator - ( const XMATRIX & ) const; + XMATRIX operator * ( float ) const; + XMATRIX operator / ( float ) const; + friend XMATRIX operator * ( float, const XMATRIX & ); + bool operator == ( const XMATRIX & ) const; + bool operator != ( const XMATRIX & ) const; +} XMATRIX, *LPXMATRIX; + +/****************************************************************************** + * 3d vector + ******************************************************************************/ + +typedef struct _VECTOR3 +{ + float x; + float y; + float z; +} VECTOR3; + +class XVECTOR3 : public VECTOR3 +{ +public: + XVECTOR3(); + XVECTOR3( const float *f ); + XVECTOR3( const VECTOR3 &v ); + XVECTOR3( float _x, float _y, float _z ); + + // casting + inline operator float* (); + inline operator const float* () const; + + // assignment operators + inline XVECTOR3& operator += ( const XVECTOR3 &op ); + inline XVECTOR3& operator -= ( const XVECTOR3 &op ); + inline XVECTOR3& operator *= ( float op ); + inline XVECTOR3& operator /= ( float op ); + + // unary operators + inline XVECTOR3 operator + () const; + inline XVECTOR3 operator - () const; + + // binary operators + inline XVECTOR3 operator + ( const XVECTOR3 &op ) const; + inline XVECTOR3 operator - ( const XVECTOR3 &op ) const; + inline XVECTOR3 operator * ( float op ) const; + inline XVECTOR3 operator / ( float op ) const; + + + friend XVECTOR3 operator * ( float, const XVECTOR3& ); + + inline bool operator == ( const XVECTOR3 &op ) const; + inline bool operator != ( const XVECTOR3 &op ) const; +}; + +/****************************************************************************** + * 4d vector + ******************************************************************************/ + +typedef struct _VECTOR4 +{ + float x; + float y; + float z; + float w; +} VECTOR4; + +class XVECTOR4 : public VECTOR4 +{ +public: + XVECTOR4(); + XVECTOR4( const float *f ); + XVECTOR4( const VECTOR4 &v ); + XVECTOR4( float _x, float _y, float _z, float _w ); + + // casting + inline operator float* (); + inline operator const float* () const; + + // assignment operators + inline XVECTOR4& operator += ( const XVECTOR4 &op ); + inline XVECTOR4& operator -= ( const XVECTOR4 &op ); + inline XVECTOR4& operator *= ( float op ); + inline XVECTOR4& operator /= ( float op ); + + // unary operators + inline XVECTOR4 operator + () const; + inline XVECTOR4 operator - () const; + + // binary operators + inline XVECTOR4 operator + ( const XVECTOR4 &op ) const; + inline XVECTOR4 operator - ( const XVECTOR4 &op ) const; + inline XVECTOR4 operator * ( float op ) const; + inline XVECTOR4 operator / ( float op ) const; + + friend XVECTOR4 operator * ( float, const XVECTOR4& ); + + inline bool operator == ( const XVECTOR4 &op ) const; + inline bool operator != ( const XVECTOR4 &op ) const; +}; + +XVECTOR4 Vec3Transform(XVECTOR4 *pOut, const XVECTOR3 *pV, const XMATRIX *pM); + +XMATRIX* MatrixTranspose(XMATRIX* pOut, const XMATRIX* pM); + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/VertexShaderConstantDef.h b/libmupen64plus/mupen64plus-video-rice/src/VertexShaderConstantDef.h new file mode 100644 index 0000000000..788ca225f0 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/VertexShaderConstantDef.h @@ -0,0 +1,91 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - VertexShaderConstantDef.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2003 Rice1964 * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#define iPos v0 +#define iNormal v1 +#define iColor v2 +#define iT0 v3 + +#define R_NORMAL r1 +#define R_DIFFUSE r2 +#define R_TEMP1 r3 +#define R_TEMP2 r4 +#define R_TEMP3 r5 +#define R_SPECULAR r6 +#define R_POS r7 + +#define CV_ZERO 0 +#define CV_ONE 1 +#define CV_HALF 2 +#define CV_TENTH 3 +#define CV_NINE_TENTH 4 +#define CV_200 5 + +#define CV_WORLDVIEWPROJ_0 10 +#define CV_WORLDVIEWPROJ_1 11 +#define CV_WORLDVIEWPROJ_2 12 +#define CV_WORLDVIEWPROJ_3 13 + +#define CV_WORLDVIEW_0 14 +#define CV_WORLDVIEW_1 15 +#define CV_WORLDVIEW_2 16 +#define CV_WORLDVIEW_3 17 + +#define CV_LIGHT1_DIRECTION 30 +#define CV_LIGHT2_DIRECTION 31 +#define CV_LIGHT3_DIRECTION 32 +#define CV_LIGHT4_DIRECTION 33 +#define CV_LIGHT5_DIRECTION 34 +#define CV_LIGHT6_DIRECTION 35 +#define CV_LIGHT7_DIRECTION 36 + +#define CV_LIGHT0_AMBIENT 20 +#define CV_LIGHT1_DIFFUSE 21 +#define CV_LIGHT2_DIFFUSE 22 +#define CV_LIGHT3_DIFFUSE 23 +#define CV_LIGHT4_DIFFUSE 24 +#define CV_LIGHT5_DIFFUSE 25 +#define CV_LIGHT6_DIFFUSE 26 +#define CV_LIGHT7_DIFFUSE 27 + +#define USE_PRIMARY_DEPTH 40 +#define PRIMARY_DEPTH 41 + +#define FOG_IS_ENABLED 42 + +#define USE_PRIMARY_COLOR 43 +#define PRIMARY_COLOR 44 + +#define LIGHTING_ENABLED 45 + +#define FORCE_VTX_ALPHA 46 +#define VTX_ALPHA 47 + +#define Z_HACK_ENABLE 49 + +#define T0_SCALE_X_Y 50 +#define T1_SCALE_X_Y 51 +#define T0_OFFSET_X_Y 52 +#define T1_OFFSET_X_Y 53 + +#define FOG_MUL 60 +#define FOG_ADD 61 + diff --git a/libmupen64plus/mupen64plus-video-rice/src/Video.cpp b/libmupen64plus/mupen64plus-video-rice/src/Video.cpp new file mode 100644 index 0000000000..0ba70237de --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/Video.cpp @@ -0,0 +1,953 @@ +/* +Copyright (C) 2002 Rice1964 +Copyright (C) 2009-2011 Richard Goedeken + +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. + +*/ + +#include + +#include + +#include "osal_opengl.h" + +#define M64P_PLUGIN_PROTOTYPES 1 +#include "m64p_types.h" +#include "m64p_common.h" +#include "m64p_plugin.h" +#include "osal_dynamiclib.h" + +#include "Config.h" +#include "Debugger.h" +#include "DeviceBuilder.h" +#include "FrameBuffer.h" +#include "GraphicsContext.h" +#include "Render.h" +#include "RSP_Parser.h" +#include "TextureFilters.h" +#include "TextureManager.h" +#include "Video.h" +#include "version.h" + +//======================================================= +// local variables + +static void (*l_DebugCallback)(void *, int, const char *) = NULL; +static void *l_DebugCallContext = NULL; +static int l_PluginInit = 0; + +//======================================================= +// global variables + +PluginStatus status; +GFX_INFO g_GraphicsInfo; +CCritSect g_CritialSection; + +unsigned int g_dwRamSize = 0x400000; +unsigned int *g_pRDRAMu32 = NULL; +signed char *g_pRDRAMs8 = NULL; +unsigned char *g_pRDRAMu8 = NULL; + +RECT frameWriteByCPURect; +std::vector frameWriteByCPURects; +RECT frameWriteByCPURectArray[20][20]; +bool frameWriteByCPURectFlag[20][20]; +std::vector frameWriteRecord; + +void (*renderCallback)(int) = NULL; + +/* definitions of pointers to Core config functions */ +ptr_ConfigOpenSection ConfigOpenSection = NULL; +ptr_ConfigSetParameter ConfigSetParameter = NULL; +ptr_ConfigGetParameter ConfigGetParameter = NULL; +ptr_ConfigGetParameterHelp ConfigGetParameterHelp = NULL; +ptr_ConfigSetDefaultInt ConfigSetDefaultInt = NULL; +ptr_ConfigSetDefaultFloat ConfigSetDefaultFloat = NULL; +ptr_ConfigSetDefaultBool ConfigSetDefaultBool = NULL; +ptr_ConfigSetDefaultString ConfigSetDefaultString = NULL; +ptr_ConfigGetParamInt ConfigGetParamInt = NULL; +ptr_ConfigGetParamFloat ConfigGetParamFloat = NULL; +ptr_ConfigGetParamBool ConfigGetParamBool = NULL; +ptr_ConfigGetParamString ConfigGetParamString = NULL; + +ptr_ConfigGetSharedDataFilepath ConfigGetSharedDataFilepath = NULL; +ptr_ConfigGetUserConfigPath ConfigGetUserConfigPath = NULL; +ptr_ConfigGetUserDataPath ConfigGetUserDataPath = NULL; +ptr_ConfigGetUserCachePath ConfigGetUserCachePath = NULL; + +/* definitions of pointers to Core video extension functions */ +ptr_VidExt_Init CoreVideo_Init = NULL; +ptr_VidExt_Quit CoreVideo_Quit = NULL; +ptr_VidExt_ListFullscreenModes CoreVideo_ListFullscreenModes = NULL; +ptr_VidExt_SetVideoMode CoreVideo_SetVideoMode = NULL; +ptr_VidExt_SetCaption CoreVideo_SetCaption = NULL; +ptr_VidExt_ToggleFullScreen CoreVideo_ToggleFullScreen = NULL; +ptr_VidExt_GL_GetProcAddress CoreVideo_GL_GetProcAddress = NULL; +ptr_VidExt_GL_SetAttribute CoreVideo_GL_SetAttribute = NULL; +ptr_VidExt_GL_GetAttribute CoreVideo_GL_GetAttribute = NULL; +ptr_VidExt_GL_SwapBuffers CoreVideo_GL_SwapBuffers = NULL; + +//--------------------------------------------------------------------------------------- +// Forward function declarations + +extern "C" EXPORT void CALL RomClosed(void); + +//--------------------------------------------------------------------------------------- +// Static (local) functions +static void ChangeWindowStep2() +{ + status.bDisableFPS = true; + windowSetting.bDisplayFullscreen = !windowSetting.bDisplayFullscreen; + g_CritialSection.Lock(); + windowSetting.bDisplayFullscreen = CGraphicsContext::Get()->ToggleFullscreen(); + + CGraphicsContext::Get()->Clear(CLEAR_COLOR_AND_DEPTH_BUFFER); + CGraphicsContext::Get()->UpdateFrame(); + CGraphicsContext::Get()->Clear(CLEAR_COLOR_AND_DEPTH_BUFFER); + CGraphicsContext::Get()->UpdateFrame(); + CGraphicsContext::Get()->Clear(CLEAR_COLOR_AND_DEPTH_BUFFER); + CGraphicsContext::Get()->UpdateFrame(); + g_CritialSection.Unlock(); + status.bDisableFPS = false; + status.ToToggleFullScreen = FALSE; +} + +static void UpdateScreenStep2 (void) +{ + status.bVIOriginIsUpdated = false; + + if( status.ToToggleFullScreen && status.gDlistCount > 0 ) + { + ChangeWindowStep2(); + return; + } + + g_CritialSection.Lock(); + if( status.bHandleN64RenderTexture ) + g_pFrameBufferManager->CloseRenderTexture(true); + + g_pFrameBufferManager->SetAddrBeDisplayed(*g_GraphicsInfo.VI_ORIGIN_REG); + + if( status.gDlistCount == 0 ) + { + // CPU frame buffer update + uint32 width = *g_GraphicsInfo.VI_WIDTH_REG; + if( (*g_GraphicsInfo.VI_ORIGIN_REG & (g_dwRamSize-1) ) > width*2 && *g_GraphicsInfo.VI_H_START_REG != 0 && width != 0 ) + { + SetVIScales(); + CRender::GetRender()->DrawFrameBuffer(true); + CGraphicsContext::Get()->UpdateFrame(); + } + g_CritialSection.Unlock(); + return; + } + + TXTRBUF_DETAIL_DUMP(TRACE1("VI ORIG is updated to %08X", *g_GraphicsInfo.VI_ORIGIN_REG)); + + if( currentRomOptions.screenUpdateSetting == SCREEN_UPDATE_AT_VI_UPDATE ) + { + CGraphicsContext::Get()->UpdateFrame(); + + DEBUGGER_IF_DUMP( pauseAtNext, TRACE1("Update Screen: VIORIG=%08X", *g_GraphicsInfo.VI_ORIGIN_REG)); + DEBUGGER_PAUSE_COUNT_N_WITHOUT_UPDATE(NEXT_FRAME); + DEBUGGER_PAUSE_COUNT_N_WITHOUT_UPDATE(NEXT_SET_CIMG); + g_CritialSection.Unlock(); + return; + } + + TXTRBUF_DETAIL_DUMP(TRACE1("VI ORIG is updated to %08X", *g_GraphicsInfo.VI_ORIGIN_REG)); + + if( currentRomOptions.screenUpdateSetting == SCREEN_UPDATE_AT_VI_UPDATE_AND_DRAWN ) + { + if( status.bScreenIsDrawn ) + { + CGraphicsContext::Get()->UpdateFrame(); + DEBUGGER_IF_DUMP( pauseAtNext, TRACE1("Update Screen: VIORIG=%08X", *g_GraphicsInfo.VI_ORIGIN_REG)); + } + else + { + DEBUGGER_IF_DUMP( pauseAtNext, TRACE1("Skip Screen Update: VIORIG=%08X", *g_GraphicsInfo.VI_ORIGIN_REG)); + } + + DEBUGGER_PAUSE_COUNT_N_WITHOUT_UPDATE(NEXT_FRAME); + DEBUGGER_PAUSE_COUNT_N_WITHOUT_UPDATE(NEXT_SET_CIMG); + g_CritialSection.Unlock(); + return; + } + + if( currentRomOptions.screenUpdateSetting==SCREEN_UPDATE_AT_VI_CHANGE ) + { + + if( *g_GraphicsInfo.VI_ORIGIN_REG != status.curVIOriginReg ) + { + if( *g_GraphicsInfo.VI_ORIGIN_REG < status.curDisplayBuffer || *g_GraphicsInfo.VI_ORIGIN_REG > status.curDisplayBuffer+0x2000 ) + { + status.curDisplayBuffer = *g_GraphicsInfo.VI_ORIGIN_REG; + status.curVIOriginReg = status.curDisplayBuffer; + //status.curRenderBuffer = NULL; + + CGraphicsContext::Get()->UpdateFrame(); + DEBUGGER_IF_DUMP( pauseAtNext, TRACE1("Update Screen: VIORIG=%08X", *g_GraphicsInfo.VI_ORIGIN_REG)); + DEBUGGER_PAUSE_COUNT_N_WITHOUT_UPDATE(NEXT_FRAME); + DEBUGGER_PAUSE_COUNT_N_WITHOUT_UPDATE(NEXT_SET_CIMG); + } + else + { + status.curDisplayBuffer = *g_GraphicsInfo.VI_ORIGIN_REG; + status.curVIOriginReg = status.curDisplayBuffer; + DEBUGGER_PAUSE_AND_DUMP_NO_UPDATE(NEXT_FRAME, {DebuggerAppendMsg("Skip Screen Update, closed to the display buffer, VIORIG=%08X", *g_GraphicsInfo.VI_ORIGIN_REG);}); + } + } + else + { + DEBUGGER_PAUSE_AND_DUMP_NO_UPDATE(NEXT_FRAME, {DebuggerAppendMsg("Skip Screen Update, the same VIORIG=%08X", *g_GraphicsInfo.VI_ORIGIN_REG);}); + } + + g_CritialSection.Unlock(); + return; + } + + if( currentRomOptions.screenUpdateSetting >= SCREEN_UPDATE_AT_1ST_CI_CHANGE ) + { + status.bVIOriginIsUpdated=true; + DEBUGGER_PAUSE_AND_DUMP_NO_UPDATE(NEXT_FRAME, {DebuggerAppendMsg("VI ORIG is updated to %08X", *g_GraphicsInfo.VI_ORIGIN_REG);}); + g_CritialSection.Unlock(); + return; + } + + DEBUGGER_IF_DUMP( pauseAtNext, TRACE1("VI is updated, No screen update: VIORIG=%08X", *g_GraphicsInfo.VI_ORIGIN_REG)); + DEBUGGER_PAUSE_COUNT_N_WITHOUT_UPDATE(NEXT_FRAME); + DEBUGGER_PAUSE_COUNT_N_WITHOUT_UPDATE(NEXT_SET_CIMG); + + g_CritialSection.Unlock(); +} + +static void ProcessDListStep2(void) +{ + g_CritialSection.Lock(); + if( status.toShowCFB ) + { + CRender::GetRender()->DrawFrameBuffer(true); + status.toShowCFB = false; + } + + try + { + DLParser_Process((OSTask *)(g_GraphicsInfo.DMEM + 0x0FC0)); + } + catch (...) + { + TRACE0("Unknown Error in ProcessDList"); + TriggerDPInterrupt(); + TriggerSPInterrupt(); + } + + g_CritialSection.Unlock(); +} + +static bool StartVideo(void) +{ + windowSetting.dps = windowSetting.fps = -1; + windowSetting.lastSecDlistCount = windowSetting.lastSecFrameCount = 0xFFFFFFFF; + + g_CritialSection.Lock(); + + memcpy(&g_curRomInfo.romheader, g_GraphicsInfo.HEADER, sizeof(ROMHeader)); + unsigned char *puc = (unsigned char *) &g_curRomInfo.romheader; + unsigned int i; + unsigned char temp; + for (i = 0; i < sizeof(ROMHeader); i += 4) /* byte-swap the ROM header */ + { + temp = puc[i]; + puc[i] = puc[i+3]; + puc[i+3] = temp; + temp = puc[i+1]; + puc[i+1] = puc[i+2]; + puc[i+2] = temp; + } + + ROM_GetRomNameFromHeader(g_curRomInfo.szGameName, &g_curRomInfo.romheader); + Ini_GetRomOptions(&g_curRomInfo); + char *p = (char *) g_curRomInfo.szGameName + (strlen((char *) g_curRomInfo.szGameName) -1); // -1 to skip null + while (p >= (char *) g_curRomInfo.szGameName) + { + if( *p == ':' || *p == '\\' || *p == '/' ) + *p = '-'; + p--; + } + + GenerateCurrentRomOptions(); + status.dwTvSystem = CountryCodeToTVSystem(g_curRomInfo.romheader.nCountryID); + if( status.dwTvSystem == TV_SYSTEM_NTSC ) + status.fRatio = 0.75f; + else + status.fRatio = 9/11.0f;; + + InitExternalTextures(); + + try { + CDeviceBuilder::GetBuilder()->CreateGraphicsContext(); + CGraphicsContext::InitWindowInfo(); + + bool res = CGraphicsContext::Get()->Initialize(640, 480, !windowSetting.bDisplayFullscreen); + if (!res) + { + g_CritialSection.Unlock(); + return false; + } + CDeviceBuilder::GetBuilder()->CreateRender(); + CRender::GetRender()->Initialize(); + DLParser_Init(); + status.bGameIsRunning = true; + } + catch(...) + { + DebugMessage(M64MSG_ERROR, "Exception caught while starting video renderer"); + throw 0; + } + + g_CritialSection.Unlock(); + return true; +} + +static void StopVideo() +{ + g_CritialSection.Lock(); + status.bGameIsRunning = false; + + try { + CloseExternalTextures(); + + // Kill all textures? + gTextureManager.RecycleAllTextures(); + gTextureManager.CleanUp(); + RDP_Cleanup(); + + CDeviceBuilder::GetBuilder()->DeleteRender(); + CGraphicsContext::Get()->CleanUp(); + CDeviceBuilder::GetBuilder()->DeleteGraphicsContext(); + } + catch(...) + { + TRACE0("Some exceptions during RomClosed"); + } + + g_CritialSection.Unlock(); + windowSetting.dps = windowSetting.fps = -1; + windowSetting.lastSecDlistCount = windowSetting.lastSecFrameCount = 0xFFFFFFFF; + status.gDlistCount = status.gFrameCount = 0; + +} + +//--------------------------------------------------------------------------------------- +// Global functions, for use by other source files in this plugin + +void SetVIScales() +{ + if( g_curRomInfo.VIHeight>0 && g_curRomInfo.VIWidth>0 ) + { + windowSetting.fViWidth = windowSetting.uViWidth = g_curRomInfo.VIWidth; + windowSetting.fViHeight = windowSetting.uViHeight = g_curRomInfo.VIHeight; + } + else if( g_curRomInfo.UseCIWidthAndRatio && g_CI.dwWidth ) + { + windowSetting.fViWidth = windowSetting.uViWidth = g_CI.dwWidth; + windowSetting.fViHeight = windowSetting.uViHeight = + g_curRomInfo.UseCIWidthAndRatio == USE_CI_WIDTH_AND_RATIO_FOR_NTSC ? g_CI.dwWidth/4*3 : g_CI.dwWidth/11*9; + } + else + { + float xscale, yscale; + uint32 val = *g_GraphicsInfo.VI_X_SCALE_REG & 0xFFF; + xscale = (float)val / (1<<10); + uint32 start = *g_GraphicsInfo.VI_H_START_REG >> 16; + uint32 end = *g_GraphicsInfo.VI_H_START_REG&0xFFFF; + uint32 width = *g_GraphicsInfo.VI_WIDTH_REG; + windowSetting.fViWidth = (end-start)*xscale; + if( abs((int)(windowSetting.fViWidth - width) ) < 8 ) + { + windowSetting.fViWidth = (float)width; + } + else + { + DebuggerAppendMsg("fViWidth = %f, Width Reg=%d", windowSetting.fViWidth, width); + } + + val = (*g_GraphicsInfo.VI_Y_SCALE_REG & 0xFFF);// - ((*g_GraphicsInfo.VI_Y_SCALE_REG>>16) & 0xFFF); + if( val == 0x3FF ) val = 0x400; + yscale = (float)val / (1<<10); + start = *g_GraphicsInfo.VI_V_START_REG >> 16; + end = *g_GraphicsInfo.VI_V_START_REG&0xFFFF; + windowSetting.fViHeight = (end-start)/2*yscale; + + if( yscale == 0 ) + { + windowSetting.fViHeight = windowSetting.fViWidth*status.fRatio; + } + else + { + if( *g_GraphicsInfo.VI_WIDTH_REG > 0x300 ) + windowSetting.fViHeight *= 2; + + if( windowSetting.fViWidth*status.fRatio > windowSetting.fViHeight && (*g_GraphicsInfo.VI_X_SCALE_REG & 0xFF) != 0 ) + { + if( abs(int(windowSetting.fViWidth*status.fRatio - windowSetting.fViHeight)) < 8 ) + { + windowSetting.fViHeight = windowSetting.fViWidth*status.fRatio; + } + /* + else + { + if( abs(windowSetting.fViWidth*status.fRatio-windowSetting.fViHeight) > windowSetting.fViWidth*0.1f ) + { + if( status.fRatio > 0.8 ) + windowSetting.fViHeight = windowSetting.fViWidth*3/4; + //windowSetting.fViHeight = (*g_GraphicsInfo.VI_V_SYNC_REG - 0x2C)/2; + } + } + */ + } + + if( windowSetting.fViHeight<100 || windowSetting.fViWidth<100 ) + { + //At sometime, value in VI_H_START_REG or VI_V_START_REG are 0 + windowSetting.fViWidth = (float)*g_GraphicsInfo.VI_WIDTH_REG; + windowSetting.fViHeight = windowSetting.fViWidth*status.fRatio; + } + } + + windowSetting.uViWidth = (unsigned short)(windowSetting.fViWidth/4); + windowSetting.fViWidth = windowSetting.uViWidth *= 4; + + windowSetting.uViHeight = (unsigned short)(windowSetting.fViHeight/4); + windowSetting.fViHeight = windowSetting.uViHeight *= 4; + uint16 optimizeHeight = (uint16)(windowSetting.uViWidth*status.fRatio); + optimizeHeight &= ~3; + + uint16 optimizeHeight2 = (uint16)(windowSetting.uViWidth*3/4); + optimizeHeight2 &= ~3; + + if( windowSetting.uViHeight != optimizeHeight && windowSetting.uViHeight != optimizeHeight2 ) + { + if( abs(windowSetting.uViHeight-optimizeHeight) <= 8 ) + windowSetting.fViHeight = windowSetting.uViHeight = optimizeHeight; + else if( abs(windowSetting.uViHeight-optimizeHeight2) <= 8 ) + windowSetting.fViHeight = windowSetting.uViHeight = optimizeHeight2; + } + + + if( gRDP.scissor.left == 0 && gRDP.scissor.top == 0 && gRDP.scissor.right != 0 ) + { + if( (*g_GraphicsInfo.VI_X_SCALE_REG & 0xFF) != 0x0 && gRDP.scissor.right == windowSetting.uViWidth ) + { + // Mario Tennis + if( abs(int( windowSetting.fViHeight - gRDP.scissor.bottom )) < 8 ) + { + windowSetting.fViHeight = windowSetting.uViHeight = gRDP.scissor.bottom; + } + else if( windowSetting.fViHeight < gRDP.scissor.bottom ) + { + windowSetting.fViHeight = windowSetting.uViHeight = gRDP.scissor.bottom; + } + windowSetting.fViHeight = windowSetting.uViHeight = gRDP.scissor.bottom; + } + else if( gRDP.scissor.right == windowSetting.uViWidth - 1 && gRDP.scissor.bottom != 0 ) + { + if( windowSetting.uViHeight != optimizeHeight && windowSetting.uViHeight != optimizeHeight2 ) + { + if( status.fRatio != 0.75 && windowSetting.fViHeight > optimizeHeight/2 ) + { + windowSetting.fViHeight = windowSetting.uViHeight = gRDP.scissor.bottom + gRDP.scissor.top + 1; + } + } + } + else if( gRDP.scissor.right == windowSetting.uViWidth && gRDP.scissor.bottom != 0 && status.fRatio != 0.75 ) + { + if( windowSetting.uViHeight != optimizeHeight && windowSetting.uViHeight != optimizeHeight2 ) + { + if( status.fRatio != 0.75 && windowSetting.fViHeight > optimizeHeight/2 ) + { + windowSetting.fViHeight = windowSetting.uViHeight = gRDP.scissor.bottom + gRDP.scissor.top + 1; + } + } + } + } + } + SetScreenMult(windowSetting.uDisplayWidth/windowSetting.fViWidth, windowSetting.uDisplayHeight/windowSetting.fViHeight); +} + +void TriggerDPInterrupt(void) +{ + *(g_GraphicsInfo.MI_INTR_REG) |= MI_INTR_DP; + g_GraphicsInfo.CheckInterrupts(); +} + +void TriggerSPInterrupt(void) +{ + *(g_GraphicsInfo.MI_INTR_REG) |= MI_INTR_SP; + g_GraphicsInfo.CheckInterrupts(); +} + +void _VIDEO_DisplayTemporaryMessage(const char *Message) +{ +} + +void DebugMessage(int level, const char *message, ...) +{ + char msgbuf[1024]; + va_list args; + + if (l_DebugCallback == NULL) + return; + + va_start(args, message); + vsprintf(msgbuf, message, args); + + (*l_DebugCallback)(l_DebugCallContext, level, msgbuf); + + va_end(args); +} + +//--------------------------------------------------------------------------------------- +// Global functions, exported for use by the core library + +// since these functions are exported, they need to have C-style names +#ifdef __cplusplus +extern "C" { +#endif + +/* Mupen64Plus plugin functions */ +EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle CoreLibHandle, void *Context, + void (*DebugCallback)(void *, int, const char *)) +{ + if (l_PluginInit) + return M64ERR_ALREADY_INIT; + + /* first thing is to set the callback function for debug info */ + l_DebugCallback = DebugCallback; + l_DebugCallContext = Context; + + /* attach and call the CoreGetAPIVersions function, check Config and Video Extension API versions for compatibility */ + ptr_CoreGetAPIVersions CoreAPIVersionFunc; + CoreAPIVersionFunc = (ptr_CoreGetAPIVersions) osal_dynlib_getproc(CoreLibHandle, "CoreGetAPIVersions"); + if (CoreAPIVersionFunc == NULL) + { + DebugMessage(M64MSG_ERROR, "Core emulator broken; no CoreAPIVersionFunc() function found."); + return M64ERR_INCOMPATIBLE; + } + int ConfigAPIVersion, DebugAPIVersion, VidextAPIVersion; + (*CoreAPIVersionFunc)(&ConfigAPIVersion, &DebugAPIVersion, &VidextAPIVersion, NULL); + if ((ConfigAPIVersion & 0xffff0000) != (CONFIG_API_VERSION & 0xffff0000)) + { + DebugMessage(M64MSG_ERROR, "Emulator core Config API (v%i.%i.%i) incompatible with plugin (v%i.%i.%i)", + VERSION_PRINTF_SPLIT(ConfigAPIVersion), VERSION_PRINTF_SPLIT(CONFIG_API_VERSION)); + return M64ERR_INCOMPATIBLE; + } + if ((VidextAPIVersion & 0xffff0000) != (VIDEXT_API_VERSION & 0xffff0000)) + { + DebugMessage(M64MSG_ERROR, "Emulator core Video Extension API (v%i.%i.%i) incompatible with plugin (v%i.%i.%i)", + VERSION_PRINTF_SPLIT(VidextAPIVersion), VERSION_PRINTF_SPLIT(VIDEXT_API_VERSION)); + return M64ERR_INCOMPATIBLE; + } + + /* Get the core config function pointers from the library handle */ + ConfigOpenSection = (ptr_ConfigOpenSection) osal_dynlib_getproc(CoreLibHandle, "ConfigOpenSection"); + ConfigSetParameter = (ptr_ConfigSetParameter) osal_dynlib_getproc(CoreLibHandle, "ConfigSetParameter"); + ConfigGetParameter = (ptr_ConfigGetParameter) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParameter"); + ConfigSetDefaultInt = (ptr_ConfigSetDefaultInt) osal_dynlib_getproc(CoreLibHandle, "ConfigSetDefaultInt"); + ConfigSetDefaultFloat = (ptr_ConfigSetDefaultFloat) osal_dynlib_getproc(CoreLibHandle, "ConfigSetDefaultFloat"); + ConfigSetDefaultBool = (ptr_ConfigSetDefaultBool) osal_dynlib_getproc(CoreLibHandle, "ConfigSetDefaultBool"); + ConfigSetDefaultString = (ptr_ConfigSetDefaultString) osal_dynlib_getproc(CoreLibHandle, "ConfigSetDefaultString"); + ConfigGetParamInt = (ptr_ConfigGetParamInt) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParamInt"); + ConfigGetParamFloat = (ptr_ConfigGetParamFloat) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParamFloat"); + ConfigGetParamBool = (ptr_ConfigGetParamBool) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParamBool"); + ConfigGetParamString = (ptr_ConfigGetParamString) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParamString"); + + ConfigGetSharedDataFilepath = (ptr_ConfigGetSharedDataFilepath) osal_dynlib_getproc(CoreLibHandle, "ConfigGetSharedDataFilepath"); + ConfigGetUserConfigPath = (ptr_ConfigGetUserConfigPath) osal_dynlib_getproc(CoreLibHandle, "ConfigGetUserConfigPath"); + ConfigGetUserDataPath = (ptr_ConfigGetUserDataPath) osal_dynlib_getproc(CoreLibHandle, "ConfigGetUserDataPath"); + ConfigGetUserCachePath = (ptr_ConfigGetUserCachePath) osal_dynlib_getproc(CoreLibHandle, "ConfigGetUserCachePath"); + + if (!ConfigOpenSection || !ConfigSetParameter || !ConfigGetParameter || + !ConfigSetDefaultInt || !ConfigSetDefaultFloat || !ConfigSetDefaultBool || !ConfigSetDefaultString || + !ConfigGetParamInt || !ConfigGetParamFloat || !ConfigGetParamBool || !ConfigGetParamString || + !ConfigGetSharedDataFilepath || !ConfigGetUserConfigPath || !ConfigGetUserDataPath || !ConfigGetUserCachePath) + { + DebugMessage(M64MSG_ERROR, "Couldn't connect to Core configuration functions"); + return M64ERR_INCOMPATIBLE; + } + + /* Get the core Video Extension function pointers from the library handle */ + CoreVideo_Init = (ptr_VidExt_Init) osal_dynlib_getproc(CoreLibHandle, "VidExt_Init"); + CoreVideo_Quit = (ptr_VidExt_Quit) osal_dynlib_getproc(CoreLibHandle, "VidExt_Quit"); + CoreVideo_ListFullscreenModes = (ptr_VidExt_ListFullscreenModes) osal_dynlib_getproc(CoreLibHandle, "VidExt_ListFullscreenModes"); + CoreVideo_SetVideoMode = (ptr_VidExt_SetVideoMode) osal_dynlib_getproc(CoreLibHandle, "VidExt_SetVideoMode"); + CoreVideo_SetCaption = (ptr_VidExt_SetCaption) osal_dynlib_getproc(CoreLibHandle, "VidExt_SetCaption"); + CoreVideo_ToggleFullScreen = (ptr_VidExt_ToggleFullScreen) osal_dynlib_getproc(CoreLibHandle, "VidExt_ToggleFullScreen"); + CoreVideo_GL_GetProcAddress = (ptr_VidExt_GL_GetProcAddress) osal_dynlib_getproc(CoreLibHandle, "VidExt_GL_GetProcAddress"); + CoreVideo_GL_SetAttribute = (ptr_VidExt_GL_SetAttribute) osal_dynlib_getproc(CoreLibHandle, "VidExt_GL_SetAttribute"); + CoreVideo_GL_GetAttribute = (ptr_VidExt_GL_GetAttribute) osal_dynlib_getproc(CoreLibHandle, "VidExt_GL_GetAttribute"); + CoreVideo_GL_SwapBuffers = (ptr_VidExt_GL_SwapBuffers) osal_dynlib_getproc(CoreLibHandle, "VidExt_GL_SwapBuffers"); + + if (!CoreVideo_Init || !CoreVideo_Quit || !CoreVideo_ListFullscreenModes || !CoreVideo_SetVideoMode || + !CoreVideo_SetCaption || !CoreVideo_ToggleFullScreen || !CoreVideo_GL_GetProcAddress || + !CoreVideo_GL_SetAttribute || !CoreVideo_GL_GetAttribute || !CoreVideo_GL_SwapBuffers) + { + DebugMessage(M64MSG_ERROR, "Couldn't connect to Core video extension functions"); + return M64ERR_INCOMPATIBLE; + } + + /* open config section handles and set parameter default values */ + if (!InitConfiguration()) + return M64ERR_INTERNAL; + + l_PluginInit = 1; + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL PluginShutdown(void) +{ + if (!l_PluginInit) + return M64ERR_NOT_INIT; + + if( status.bGameIsRunning ) + { + RomClosed(); + } + if (bIniIsChanged) + { + WriteIniFile(); + TRACE0("Write back INI file"); + } + + /* reset some local variables */ + l_DebugCallback = NULL; + l_DebugCallContext = NULL; + + l_PluginInit = 0; + return M64ERR_SUCCESS; +} + +EXPORT m64p_error CALL PluginGetVersion(m64p_plugin_type *PluginType, int *PluginVersion, int *APIVersion, const char **PluginNamePtr, int *Capabilities) +{ + /* set version info */ + if (PluginType != NULL) + *PluginType = M64PLUGIN_GFX; + + if (PluginVersion != NULL) + *PluginVersion = PLUGIN_VERSION; + + if (APIVersion != NULL) + *APIVersion = VIDEO_PLUGIN_API_VERSION; + + if (PluginNamePtr != NULL) + *PluginNamePtr = PLUGIN_NAME; + + if (Capabilities != NULL) + { + *Capabilities = 0; + } + + return M64ERR_SUCCESS; +} + +//------------------------------------------------------------------------------------- + + +EXPORT void CALL ChangeWindow (void) +{ + if( status.ToToggleFullScreen ) + status.ToToggleFullScreen = FALSE; + else + status.ToToggleFullScreen = TRUE; +} + +//--------------------------------------------------------------------------------------- + +EXPORT void CALL MoveScreen (int xpos, int ypos) +{ +} + +//--------------------------------------------------------------------------------------- +EXPORT void CALL RomClosed(void) +{ + TRACE0("To stop video"); + Ini_StoreRomOptions(&g_curRomInfo); + StopVideo(); + TRACE0("Video is stopped"); +} + +EXPORT int CALL RomOpen(void) +{ + /* Read RiceVideoLinux.ini file, set up internal variables by reading values from core configuration API */ + LoadConfiguration(); + + if( g_CritialSection.IsLocked() ) + { + g_CritialSection.Unlock(); + TRACE0("g_CritialSection is locked when game is starting, unlock it now."); + } + status.bDisableFPS=false; + + g_dwRamSize = 0x800000; + +#ifdef DEBUGGER + if( debuggerPause ) + { + debuggerPause = FALSE; + usleep(100 * 1000); + } +#endif + + if (!StartVideo()) + return 0; + + return 1; +} + + +//--------------------------------------------------------------------------------------- +EXPORT void CALL UpdateScreen(void) +{ + if(options.bShowFPS) + { + static unsigned int lastTick=0; + static int frames=0; + unsigned int nowTick = SDL_GetTicks(); + frames++; + if(lastTick + 5000 <= nowTick) + { + char caption[200]; + sprintf(caption, "%s v%i.%i.%i - %.3f VI/S", PLUGIN_NAME, VERSION_PRINTF_SPLIT(PLUGIN_VERSION), frames/5.0); + CoreVideo_SetCaption(caption); + frames = 0; + lastTick = nowTick; + } + } + UpdateScreenStep2(); +} + +//--------------------------------------------------------------------------------------- + +EXPORT void CALL ViStatusChanged(void) +{ + g_CritialSection.Lock(); + SetVIScales(); + CRender::g_pRender->UpdateClipRectangle(); + g_CritialSection.Unlock(); +} + +//--------------------------------------------------------------------------------------- +EXPORT void CALL ViWidthChanged(void) +{ + g_CritialSection.Lock(); + SetVIScales(); + CRender::g_pRender->UpdateClipRectangle(); + g_CritialSection.Unlock(); +} + +EXPORT int CALL InitiateGFX(GFX_INFO Gfx_Info) +{ + memset(&status, 0, sizeof(status)); + memcpy(&g_GraphicsInfo, &Gfx_Info, sizeof(GFX_INFO)); + + g_pRDRAMu8 = Gfx_Info.RDRAM; + g_pRDRAMu32 = (uint32*)Gfx_Info.RDRAM; + g_pRDRAMs8 = (signed char *)Gfx_Info.RDRAM; + + windowSetting.fViWidth = 320; + windowSetting.fViHeight = 240; + status.ToToggleFullScreen = FALSE; + status.bDisableFPS=false; + + if (!InitConfiguration()) + { + DebugMessage(M64MSG_ERROR, "Failed to read configuration data"); + return FALSE; + } + + CGraphicsContext::InitWindowInfo(); + CGraphicsContext::InitDeviceParameters(); + + return(TRUE); +} + +//--------------------------------------------------------------------------------------- + +EXPORT void CALL ProcessRDPList(void) +{ + try + { + RDP_DLParser_Process(); + } + catch (...) + { + TRACE0("Unknown Error in ProcessRDPList"); + TriggerDPInterrupt(); + TriggerSPInterrupt(); + } +} + +EXPORT void CALL ProcessDList(void) +{ + ProcessDListStep2(); +} + +//--------------------------------------------------------------------------------------- + +/****************************************************************** + Function: FrameBufferRead + Purpose: This function is called to notify the dll that the + frame buffer memory is beening read at the given address. + DLL should copy content from its render buffer to the frame buffer + in N64 RDRAM + DLL is responsible to maintain its own frame buffer memory addr list + DLL should copy 4KB block content back to RDRAM frame buffer. + Emulator should not call this function again if other memory + is read within the same 4KB range + + Since depth buffer is also being watched, the reported addr + may belong to depth buffer + input: addr rdram address + val val + size 1 = uint8, 2 = uint16, 4 = uint32 + output: none +*******************************************************************/ + +EXPORT void CALL FBRead(uint32 addr) +{ + g_pFrameBufferManager->FrameBufferReadByCPU(addr); +} + + +/****************************************************************** + Function: FrameBufferWrite + Purpose: This function is called to notify the dll that the + frame buffer has been modified by CPU at the given address. + + Since depth buffer is also being watched, the reported addr + may belong to depth buffer + + input: addr rdram address + val val + size 1 = uint8, 2 = uint16, 4 = uint32 + output: none +*******************************************************************/ + +EXPORT void CALL FBWrite(uint32 addr, uint32 size) +{ + g_pFrameBufferManager->FrameBufferWriteByCPU(addr, size); +} + +/************************************************************************ +Function: FBGetFrameBufferInfo +Purpose: This function is called by the emulator core to retrieve frame + buffer information from the video plugin in order to be able + to notify the video plugin about CPU frame buffer read/write + operations + + size: + = 1 byte + = 2 word (16 bit) <-- this is N64 default depth buffer format + = 4 dword (32 bit) + + when frame buffer information is not available yet, set all values + in the FrameBufferInfo structure to 0 + +input: FrameBufferInfo pinfo[6] + pinfo is pointed to a FrameBufferInfo structure which to be + filled in by this function +output: Values are return in the FrameBufferInfo structure + Plugin can return up to 6 frame buffer info + ************************************************************************/ + +EXPORT void CALL FBGetFrameBufferInfo(void *p) +{ + FrameBufferInfo * pinfo = (FrameBufferInfo *)p; + memset(pinfo,0,sizeof(FrameBufferInfo)*6); + + //if( g_ZI.dwAddr == 0 ) + //{ + // memset(pinfo,0,sizeof(FrameBufferInfo)*6); + //} + //else + { + for (int i=0; i<5; i++ ) + { + if( status.gDlistCount-g_RecentCIInfo[i].lastUsedFrame > 30 || g_RecentCIInfo[i].lastUsedFrame == 0 ) + { + //memset(&pinfo[i],0,sizeof(FrameBufferInfo)); + } + else + { + pinfo[i].addr = g_RecentCIInfo[i].dwAddr; + pinfo[i].size = 2; + pinfo[i].width = g_RecentCIInfo[i].dwWidth; + pinfo[i].height = g_RecentCIInfo[i].dwHeight; + TXTRBUF_DETAIL_DUMP(TRACE3("Protect 0x%08X (%d,%d)", g_RecentCIInfo[i].dwAddr, g_RecentCIInfo[i].dwWidth, g_RecentCIInfo[i].dwHeight)); + pinfo[5].width = g_RecentCIInfo[i].dwWidth; + pinfo[5].height = g_RecentCIInfo[i].dwHeight; + } + } + + pinfo[5].addr = g_ZI.dwAddr; + //pinfo->size = g_RecentCIInfo[5].dwSize; + pinfo[5].size = 2; + TXTRBUF_DETAIL_DUMP(TRACE3("Protect 0x%08X (%d,%d)", pinfo[5].addr, pinfo[5].width, pinfo[5].height)); + } +} + +// Plugin spec 1.3 functions +EXPORT void CALL ShowCFB(void) +{ + status.toShowCFB = true; +} + +//void ReadScreen2( void *dest, int *width, int *height, int bFront ) +EXPORT void CALL ReadScreen2(void *dest, int *width, int *height, int bFront) +{ + if (width == NULL || height == NULL) + return; + + *width = windowSetting.uDisplayWidth; + *height = windowSetting.uDisplayHeight; + + if (dest == NULL) + return; + +#if SDL_VIDEO_OPENGL + GLint oldMode; + glGetIntegerv( GL_READ_BUFFER, &oldMode ); + if (bFront) + glReadBuffer( GL_FRONT ); + else + glReadBuffer( GL_BACK ); + glReadPixels( 0, 0, windowSetting.uDisplayWidth, windowSetting.uDisplayHeight, + GL_RGB, GL_UNSIGNED_BYTE, dest ); + glReadBuffer( oldMode ); +#endif +} + + +EXPORT void CALL SetRenderingCallback(void (*callback)(int)) +{ + renderCallback = callback; +} + +#ifdef __cplusplus +} +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/Video.h b/libmupen64plus/mupen64plus-video-rice/src/Video.h new file mode 100644 index 0000000000..85b6500d93 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/Video.h @@ -0,0 +1,208 @@ +/* +Copyright (C) 2002 Rice1964 + +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. + +*/ + +#ifndef _DLLINTERFACE_H_ +#define _DLLINTERFACE_H_ + +#define M64P_PLUGIN_PROTOTYPES 1 +#include "typedefs.h" +#include "m64p_config.h" +#include "m64p_plugin.h" +#include "m64p_vidext.h" + +typedef struct { + float fViWidth, fViHeight; + unsigned short uViWidth, uViHeight; + unsigned short uDisplayWidth, uDisplayHeight; + + BOOL bDisplayFullscreen; + BOOL bVerticalSync; + + float fMultX, fMultY; + int vpLeftW, vpTopW, vpRightW, vpBottomW, vpWidthW, vpHeightW; + + int statusBarHeight, statusBarHeightToUse, toolbarHeight, toolbarHeightToUse; + BOOL screenSaverStatus; + + struct { + uint32 left; + uint32 top; + uint32 right; + uint32 bottom; + uint32 width; + uint32 height; + bool needToClip; + } clipping; + + int timer; + float fps; // frame per second + float dps; // dlist per second + uint32 lastSecFrameCount; + uint32 lastSecDlistCount; +}WindowSettingStruct; + +typedef enum +{ + PRIM_TRI1, + PRIM_TRI2, + PRIM_TRI3, + PRIM_DMA_TRI, + PRIM_LINE3D, + PRIM_TEXTRECT, + PRIM_TEXTRECTFLIP, + PRIM_FILLRECT, +} PrimitiveType; + +typedef enum +{ + RSP_SCISSOR, + RDP_SCISSOR, + UNKNOWN_SCISSOR, +} CurScissorType; + +typedef struct { + bool bGameIsRunning; + uint32 dwTvSystem; + float fRatio; + + BOOL frameReadByCPU; + BOOL frameWriteByCPU; + + uint32 SPCycleCount; // Count how many CPU cycles SP used in this DLIST + uint32 DPCycleCount; // Count how many CPU cycles DP used in this DLIST + + uint32 dwNumTrisRendered; + uint32 dwNumDListsCulled; + uint32 dwNumTrisClipped; + uint32 dwNumVertices; + uint32 dwBiggestVertexIndex; + + uint32 gDlistCount; + uint32 gFrameCount; + uint32 gUcodeCount; + uint32 gRDPTime; + BOOL ToToggleFullScreen; + bool bDisableFPS; + + bool bUseModifiedUcodeMap; + bool ucodeHasBeenSet; + bool bUcodeIsKnown; + + uint32 curRenderBuffer; + uint32 curDisplayBuffer; + uint32 curVIOriginReg; + CurScissorType curScissor; + + PrimitiveType primitiveType; + + uint32 lastPurgeTimeTime; // Time textures were last purged + + bool UseLargerTile[2]; // This is a speed up for large tile loading, + uint32 LargerTileRealLeft[2]; // works only for TexRect, LoadTile, large width, large pitch + + bool bVIOriginIsUpdated; + bool bCIBufferIsRendered; + int leftRendered,topRendered,rightRendered,bottomRendered; + + bool isMMXSupported; + bool isSSESupported; + bool isVertexShaderSupported; + + bool isMMXEnabled; + bool isSSEEnabled; + bool isVertexShaderEnabled; + bool bUseHW_T_L; // Use hardware T&L, for debug purpose only + + bool toShowCFB; + + bool bAllowLoadFromTMEM; + + // Frame buffer simulation related status variables + bool bN64FrameBufferIsUsed; // Frame buffer is used in the frame + bool bN64IsDrawingTextureBuffer; // The current N64 game is rendering into render_texture, to create self-rendering texture + bool bHandleN64RenderTexture; // Do we need to handle of the N64 render_texture stuff? + bool bDirectWriteIntoRDRAM; // When drawing into render_texture, this value = + // = true don't render, but write real N64 graphic value into RDRAM + // = false rendering into render_texture of DX or OGL, the render_texture + // will be copied into RDRAM at the end + bool bFrameBufferIsDrawn; // flag to mark if the frame buffer is ever drawn + bool bFrameBufferDrawnByTriangles; // flag to tell if the buffer is even drawn by Triangle cmds + + bool bScreenIsDrawn; + +} PluginStatus; + +#define MI_INTR_DP 0x00000020 +#define MI_INTR_SP 0x00000001 + +extern PluginStatus status; +extern GFX_INFO g_GraphicsInfo; +extern WindowSettingStruct windowSetting; + +extern unsigned int g_dwRamSize; +extern unsigned int *g_pRDRAMu32; +extern signed char *g_pRDRAMs8; +extern unsigned char *g_pRDRAMu8; + +/* declarations of pointers to Core config functions */ +extern ptr_ConfigListSections ConfigListSections; +extern ptr_ConfigOpenSection ConfigOpenSection; +extern ptr_ConfigListParameters ConfigListParameters; +extern ptr_ConfigSaveFile ConfigSaveFile; +extern ptr_ConfigSetParameter ConfigSetParameter; +extern ptr_ConfigGetParameter ConfigGetParameter; +extern ptr_ConfigGetParameterHelp ConfigGetParameterHelp; +extern ptr_ConfigSetDefaultInt ConfigSetDefaultInt; +extern ptr_ConfigSetDefaultFloat ConfigSetDefaultFloat; +extern ptr_ConfigSetDefaultBool ConfigSetDefaultBool; +extern ptr_ConfigSetDefaultString ConfigSetDefaultString; +extern ptr_ConfigGetParamInt ConfigGetParamInt; +extern ptr_ConfigGetParamFloat ConfigGetParamFloat; +extern ptr_ConfigGetParamBool ConfigGetParamBool; +extern ptr_ConfigGetParamString ConfigGetParamString; + +extern ptr_ConfigGetSharedDataFilepath ConfigGetSharedDataFilepath; +extern ptr_ConfigGetUserConfigPath ConfigGetUserConfigPath; +extern ptr_ConfigGetUserDataPath ConfigGetUserDataPath; +extern ptr_ConfigGetUserCachePath ConfigGetUserCachePath; + +/* declarations of pointers to Core video extension functions */ +extern ptr_VidExt_Init CoreVideo_Init; +extern ptr_VidExt_Quit CoreVideo_Quit; +extern ptr_VidExt_ListFullscreenModes CoreVideo_ListFullscreenModes; +extern ptr_VidExt_SetVideoMode CoreVideo_SetVideoMode; +extern ptr_VidExt_SetCaption CoreVideo_SetCaption; +extern ptr_VidExt_ToggleFullScreen CoreVideo_ToggleFullScreen; +extern ptr_VidExt_GL_GetProcAddress CoreVideo_GL_GetProcAddress; +extern ptr_VidExt_GL_SetAttribute CoreVideo_GL_SetAttribute; +extern ptr_VidExt_GL_GetAttribute CoreVideo_GL_GetAttribute; +extern ptr_VidExt_GL_SwapBuffers CoreVideo_GL_SwapBuffers; + +/* global functions provided by Video.cpp */ +extern char generalText[]; +extern void (*renderCallback)(int); +void DebugMessage(int level, const char *message, ...); + +void SetVIScales(); +extern void _VIDEO_DisplayTemporaryMessage2(const char *msg, ...); +extern void _VIDEO_DisplayTemporaryMessage(const char *msg); +extern void XBOX_Debugger_Log(const char *Message, ...); + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/liblinux/BMGDLL.h b/libmupen64plus/mupen64plus-video-rice/src/liblinux/BMGDLL.h new file mode 100644 index 0000000000..90cc2db590 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/liblinux/BMGDLL.h @@ -0,0 +1,155 @@ +#ifndef _BMG_LIB_ +#define _BMG_LIB_ +/* +// header file for the BMGLib DLL +// This DLL encapsulates the libTIFF library, libJPEG library, +// libPNG library, and the GeoTIFF library. +// +// Copyright 2000, 2001 M. Scott Heiman +// All Rights Reserved +// libTIFF is Copyright Sam Leffler and SGI +// libJPEG is Copyright (C) 1991-1998, Thomas G. Lane and is part of the +// Independent JPEG Group's software. +// libPNG is Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. +// (libpng versions 0.5, May 1995, through 0.89c, May 1996) +// Copyright (c) 1996, 1997 Andreas Dilger +// (libpng versions 0.90, December 1996, through 0.96, May 1997) +// Copyright (c) 1998, 1999 Glenn Randers-Pehrson +// (libpng versions 0.97, January 1998, through 1.0.5, October 15, 1999) +// zLib Copyright (C) 1995-1998 Jean-loup Gailly. +// GeoTIFF is Copyright (c) 1999, Frank Warmerdam +// libPROJ (used by GeoTIFF) is Copytight (c) 2000, Frank Warmerdam +// libUnGif is Copyright (c) 1997, Eric S. Raymond +// +// You may use the software for any purpose you see fit. You may modify +// it, incorporate it in a commercial application, use it for school, +// even turn it in as homework. You must keep the Copyright in the +// header and source files. This software is not in the "Public Domain". +// You may use this software at your own risk. I have made a reasonable +// effort to verify that this software works in the manner I expect it to; +// however,... +// +// THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" AND +// WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, INCLUDING +// WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A +// PARTICULAR PURPOSE. IN NO EVENT SHALL MICHAEL S. HEIMAN BE LIABLE TO +// YOU OR ANYONE ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR +// CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING +// WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, +// OR THE CLAIMS OF THIRD PARTIES, WHETHER OR NOT MICHAEL S. HEIMAN HAS +// BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE +// POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +#include "BMGImage.h" +#include "tiffrw.h" +#include "pngrw.h" +#include "jpegrw.h" + +#if defined(__cplusplus) +extern "C" { +#endif + +/* returns a BITMAPINFO structure with the given height, width, + bit count, and compression scheme. This structure DOES NOT contain any + palette information (bmiColors = NULL) */ +extern +BITMAPINFO CreateBMI( unsigned int dwWidth, /* width in pixels */ + unsigned int dwHeight, /* height in pixels */ + unsigned short wBitCount, /* 1, 4, 8, 16, 24, & 32 */ + int compression ); /* biCompression value */ + +/* returns an array of RGBA or BGRA values for all supported graphics file + formats. The RGBA pixel format is supported by all versions of OpenGL. + The BGRA format is an extension supported by may OpenGL vendors. */ +extern +BMGError GetUnpackedArray( const char *filename, + unsigned int *width, + unsigned int *height, + unsigned char **bits, + int bgra ); + +/* Saves an array of RGB, RGBA, BGR, and BGRA values to a file. The RGB and RGBA + pixel formats are supported by OpenGL. The BGR and BGRA extensions are + supported by many OpenGL vendors */ +extern +BMGError SaveUnpackedArray( const char *filename, + unsigned char bytes_per_pixel, + unsigned int width, + unsigned int height, + unsigned char *bits, + int bgra ); + +/* saves the contents of an HBITMAP to a file. The extension of the file name +// determines the file type. returns 1 if successfull, 0 otherwise */ +extern +BMGError SaveBitmapToFile( HBITMAP hBitmap, /* bitmap to be saved */ + const char *filename, /* name of output file */ + void *parameters ); + +/* Creates an HBITMAP to an image file. The extension of the file name +// determines the file type. returns an HBITMAP if successfull, NULL +// otherwise */ +extern +HBITMAP CreateBitmapFromFile( const char *filename, + void *parameters, + int blend ); + +/* extracts a BMGImageStruct from any one of the supported image files */ +extern +BMGError GetDataFromFile( const char *filename, + struct BMGImageStruct *img, + void *parameters ); + +/* the following functions will read/write image files using raw data */ +extern +BMGError ReadRGB( const char *filename, + struct BMGImageStruct *img ); + +extern +BMGError WriteRGB( const char *filename, + struct BMGImageStruct img ); + +extern +BMGError ReadTGA( const char *filename, + struct BMGImageStruct *img ); + +extern +BMGError WriteTGA( const char *filename, + struct BMGImageStruct img ); + +extern +BMGError ReadBMP( const char *filename, + struct BMGImageStruct *img ); + +extern +BMGError WriteBMP( const char *filename, + struct BMGImageStruct img ); + +extern +BMGError ReadCEL( const char *filename, + struct BMGImageStruct *img ); + +extern +BMGError ReadGIF( const char *filename, + struct BMGImageStruct *img ); + +extern +BMGError ReadPSD( const char *filename, + struct BMGImageStruct *img ); + +extern +BMGError ReadIFF( const char *filename, + struct BMGImageStruct *img ); + +extern +BMGError ReadPCX( const char *filename, + struct BMGImageStruct *img ); + +#if defined(__cplusplus) + } +#endif + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/liblinux/BMGImage.c b/libmupen64plus/mupen64plus-video-rice/src/liblinux/BMGImage.c new file mode 100644 index 0000000000..1d4dd6ed83 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/liblinux/BMGImage.c @@ -0,0 +1,1053 @@ +/* +// source code for the BMGImage functions +// +// Copyright (C) 2001 Michael S. Heiman +// +// You may use the software for any purpose you see fit. You may modify +// it, incorporate it in a commercial application, use it for school, +// even turn it in as homework. You must keep the Copyright in the +// header and source files. This software is not in the "Public Domain". +// You may use this software at your own risk. I have made a reasonable +// effort to verify that this software works in the manner I expect it to; +// however,... +// +// THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" AND +// WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, INCLUDING +// WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A +// PARTICULAR PURPOSE. IN NO EVENT SHALL MICHAEL S. HEIMAN BE LIABLE TO +// YOU OR ANYONE ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR +// CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING +// WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, +// OR THE CLAIMS OF THIRD PARTIES, WHETHER OR NOT MICHAEL S. HEIMAN HAS +// BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE +// POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +#include +#include +#include + +#include "BMGUtils.h" + +/* initializes a BMGImage to default values */ +void InitBMGImage( struct BMGImageStruct *img ) +{ + img->width = img->height = 0; + img->bits_per_pixel = 0; + img->palette_size = 0; + img->bytes_per_palette_entry = 0; + img->bits = NULL; + img->palette = NULL; + img->opt_for_bmp = 0; + img->scan_width = 0; + img->transparency_index = -1; +} + +/* frees memory allocated to a BMGImage */ +void FreeBMGImage( struct BMGImageStruct *img ) +{ + if ( img->bits != NULL ) + { + free( img->bits ); + img->bits = NULL; + } + if ( img->palette != NULL ) + { + free( img->palette ); + img->palette = NULL; + } + img->bits_per_pixel = 0; + img->palette_size = 0; + img->bytes_per_palette_entry = 0; + img->width = img->height = 0; + img->opt_for_bmp = 0; + img->scan_width = 0; + img->transparency_index = -1; +} + +/* allocates memory for the bits & palette. Assigned values to scan_line + & bits_per_palette_entry as well. Assumes opt_for_bmp has been set before + this function is called. Assumes that all images with bits_per_pixel <= 8 + require a palette. + */ +BMGError AllocateBMGImage( struct BMGImageStruct *img ) +{ + unsigned int mempal; + + SetLastBMGError( BMG_OK ); + + /* make sure that all REQUIRED parameters are valid */ + if ( img->width * img->height <= 0 ) + { + SetLastBMGError(errInvalidSize); + return errInvalidSize; + } + + switch( img->bits_per_pixel ) + { + case 1: + case 4: + case 8: + case 16: + case 24: + case 32: + break; + default: + SetLastBMGError( errInvalidPixelFormat ); + return errInvalidPixelFormat; + } + + /* delete old memory */ + if ( img->bits != NULL ) + { + free( img->bits ); + img->bits = NULL; + } + if ( img->palette != NULL ) + { + free( img->palette ); + img->palette = NULL; + } + + /* allocate memory for the palette */ + if ( img->bits_per_pixel <= 8 ) + { + if ( img->opt_for_bmp > 0 ) + img->bytes_per_palette_entry = 4U; + else + { + /* we only support 3-byte and 4-byte palettes */ + if ( img->bytes_per_palette_entry <= 3U ) + img->bytes_per_palette_entry = 3U; + else + img->bytes_per_palette_entry = 4U; + } + /* + use bits_per_pixel to determine palette_size if none was + specified + */ + if ( img->palette_size == 0 ) + img->palette_size = (unsigned short)(1 << img->bits_per_pixel); + + mempal = img->bytes_per_palette_entry * img->palette_size; + img->palette = (unsigned char *)calloc( mempal, sizeof(unsigned char) ); + if ( img->palette == NULL ) + { + SetLastBMGError(errMemoryAllocation); + return errMemoryAllocation; + } + } + else + { + img->bytes_per_palette_entry = 0; + img->palette_size = 0; + } + + /* + set the scan width. Bitmaps optimized for windows have scan widths that + are evenly divisible by 4. + */ + img->scan_width = ( img->bits_per_pixel * img->width + 7 ) / 8; + if ( img->opt_for_bmp && img->scan_width % 4 ) + img->scan_width += 4 - img->scan_width % 4; + + /* allocate memory for the bits */ + mempal = img->scan_width * img->height; + if ( mempal > 0 ) + { + img->bits = (unsigned char *)calloc( mempal, sizeof( unsigned char) ); + if ( img->bits == NULL ) + { + if ( img->palette != NULL ) + { + free( img->palette ); + img->palette = NULL; + } + SetLastBMGError(errMemoryAllocation); + return errMemoryAllocation; + } + } + else + { + SetLastBMGError(errInvalidSize); + return errInvalidSize; + } + + return BMG_OK; +} + +/******************************************************************************* + A utility function for compressing paletted images. Will automatically + convert 8-bit paletted images to 1-bit or 4-bit paletted images based + upon palette_size. Assumes that indices in img->bits are valid. That is, + 0 <= img->bits[i] <= 1 for all i if 1-bit compression is desired, and + 0 <= img->bits[i] <= 15 for all i if 4-bit compression is desired Returns + BMG_OK if successful, or an error code otherwise. +*******************************************************************************/ +BMGError CompressBMGImage( struct BMGImageStruct *img ) +{ + unsigned char new_bits_per_pixel; + unsigned int new_scan_width; + unsigned char *new_bits = NULL; + unsigned int new_bit_size; + unsigned char *new_row, *old_row, *p, *q; + unsigned char *end; + unsigned short scale; + + SetLastBMGError( BMG_OK ); + + /* if we cannot compress it then do no harm and return "true" */ + if ( img->palette == NULL || + img->palette_size > 16 || + img->bits_per_pixel != 8 ) + { + return BMG_OK; + } + + /* calculate new dimensions */ + new_bits_per_pixel = img->palette_size <= 2 ? 1U : 4U; + new_scan_width = ( new_bits_per_pixel * img->width + 7 ) / 8; + if ( img->opt_for_bmp > 0 && new_scan_width % 4 ) + new_scan_width += 4 - new_scan_width % 4; + new_bit_size = new_scan_width * img->height; + + /* allocate & test memory */ + new_bits = (unsigned char *)calloc( new_bit_size, sizeof(unsigned char) ); + if ( new_bits == NULL ) + { + SetLastBMGError( errMemoryAllocation ); + return errMemoryAllocation; + } + + old_row = img->bits; + for ( new_row = new_bits; new_row < new_bits + new_bit_size; + new_row += new_scan_width, old_row += img->scan_width ) + { + scale = 8 / new_bits_per_pixel; + end = new_row + img->width / scale; + p = old_row; + if ( new_bits_per_pixel == 1 ) + { + for ( q = new_row; q < end; q++, p += scale ) + { + *q = (unsigned char)( (p[0] << 7) | (p[1] << 6) | + (p[2] << 5) | (p[3] << 4) | + (p[4] << 3) | (p[5] << 2) | + (p[6] << 1) | p[7] ); + } + scale = img->width % scale; + if ( scale-- > 0 ) + { + *q = (unsigned char)(p[0] << 7); + if ( scale-- ) + { + *q |= (unsigned char)(p[1] << 6); + if ( scale-- ) + { + *q |= (unsigned char)(p[2] << 5); + if ( scale-- ) + { + *q |= (unsigned char)(p[3] << 4); + if ( scale-- ) + { + *q |= (unsigned char)(p[4] << 3); + if ( scale-- ) + { + *q |= (unsigned char)(p[5] << 2); + if ( scale-- ) + *q |= (unsigned char)(p[6] << 1); + } + } + } + } + } + } + } + else /* new_bits_per_pixel == 4 */ + { + for ( q = new_row; q < end; q++, p += scale ) + { + *q = (unsigned char)( (p[0] << 4) | (p[1] & 0x0F) ); + } + if ( img->width % scale ) + *q = (unsigned char)(p[0] << 4); + } + } + + /* replace old values with new values */ + free( img->bits ); + img->bits = new_bits; + img->scan_width = new_scan_width; + img->bits_per_pixel = new_bits_per_pixel; + + return BMG_OK; +} + +/* this function simply frees memory that was allocated by any function + in the BMGLib. This was required because acces violations occurred + when I tried to delete memory created by CreateRGBAArray in the demo + applications */ +void FreeBMGMemory( unsigned char *mem ) +{ + if ( mem != NULL ) + free( mem ); +} + +/* converts a BGR to a gray scale +// color[0] = blue, color[1] = green, color[2] = red */ +static unsigned char CreateGrayScale( unsigned char *color ) +{ + return (unsigned char)( 0.299f * color[2] + 0.587f * color[1] + + 0.114f * color[0] + 0.5f ); +} + +/* +// converts a color image to a gray scale image. If img is a 16 or +// 24-BPP image then it is converted to a 256 color grayscale bitmap. +// If img is a 1, 4, or 8 BPP image, then it will have the same number +// of grayscales as it has palette entries. If it is a 32-BPP bitmap then +// it will remain a 32-BPP bitmap to preserve the alpha channel. +// +// This function returns BMG_OK if successfull, or an error state +// otherwise. +*/ +BMGError ConvertToGrayScale( struct BMGImageStruct *img ) +{ + unsigned char *p, *q, *r, *end, gray; + + SetLastBMGError( BMG_OK ); + + /* if this is a paletted image then we simply need to convert the + // palette entries */ + switch ( img->bits_per_pixel ) + { + default: + end = img->palette + img->palette_size * img->bytes_per_palette_entry; + for ( p = img->palette; p < end; p += img->bytes_per_palette_entry ) + { + gray = CreateGrayScale( p ); + memset( (void *)p, gray, 3 ); + } + break; + /* 16 BPP image are converted to 24 BPP images */ + case 16: + { + BMGError tmp = Convert16to24( img ); + if ( tmp != BMG_OK ) + { + SetLastBMGError( tmp ); + return tmp; + } + } + case 24: + { + unsigned char *new_bits; + unsigned char *s, *s_end; + unsigned short i; + + /* calculate the new scan width */ + unsigned int new_scan_width = img->width; + if ( new_scan_width % 4 && img->opt_for_bmp ) + new_scan_width += 4 - new_scan_width % 4; + + /* allocate memory for the new pixel values */ + new_bits = (unsigned char *)calloc( new_scan_width * img->height, + sizeof(unsigned char) ); + if ( new_bits == NULL ) + { + SetLastBMGError( errMemoryAllocation ); + return errMemoryAllocation; + } + + /* allocate memory for a 256 gray scale palette */ + img->bytes_per_palette_entry = img->opt_for_bmp == 1 ? 4 : 3; + img->palette_size = 256; + img->palette = + (unsigned char *)calloc(img->bytes_per_palette_entry * + img->palette_size, + sizeof(unsigned char) ); + if ( img->palette == NULL ) + { + free( new_bits ); + img->bytes_per_palette_entry = 0; + img->palette_size = 0; + SetLastBMGError( errMemoryAllocation ); + return errMemoryAllocation; + } + + /* assign values to the gray scale palette */ + for ( i = 0; i < 256; i++ ) + { + p = img->palette + i * img->bytes_per_palette_entry; + memset( (void *)p, i, 3 ); + if ( img->bytes_per_palette_entry == 4 ) + p[3] = 0; + } + + /* cycle through the pixels and convert them to gray scale values */ + q = new_bits; + end = img->bits + img->scan_width * img->height; + + for ( p = img->bits; p < end; p += img->scan_width, q += new_scan_width ) + { + s_end = p + 3 * img->width; + r = q; + for ( s = p; s < s_end; s += 3, r++ ) + *r = CreateGrayScale( s ); + } + + free( img->bits ); + img->bits = new_bits; + img->scan_width = new_scan_width; + img->bits_per_pixel = 8; + + break; + } + case 32: + end = img->bits + img->scan_width * img->height; + for ( p = img->bits; p < end; p += img->scan_width ) + { + r = p + img->scan_width; + for ( q = p; q < r; q += 4 ) + { + gray = CreateGrayScale( q ); + memset( (void *)q, gray, 3 ); + } + } + break; + } + + return BMG_OK; +} + +/* +// converts a color image to a pseudo-gray scale image. This is a implementation +// is based upon the code published by Rich Franzen +// . I have "simplified" the 2 functions +// he published into a single function. This implementation creates 1786 gray +// scales from a 24-bit image. 16-BPP images are converted to 24-BPP images. 24 +// and 32-BPP images will keep the same bitdepth. Paletted images and 16-BPP images +// are not supported. +// +// This function returns BMK_OK if successfull, +// errInvalidPixelFormat otherwise +*/ +BMGError ConvertToPseudoGrayScale( struct BMGImageStruct *img ) +{ + unsigned char *p, *p_end; + unsigned char *q, *q_end; + unsigned char gray; + unsigned int bytes_per_pixel; + + SetLastBMGError( errMemoryAllocation ); + + if ( img->bits_per_pixel <= 16 ) + { + SetLastBMGError( errInvalidPixelFormat ); + return errInvalidPixelFormat; + } + + bytes_per_pixel = img->bits_per_pixel / 8; + p_end = img->bits + img->scan_width * img->height; + + for ( p = img->bits; p < p_end; p += img->scan_width ) + { + q_end = p + bytes_per_pixel * img->width; + for ( q = p; q < q_end; q += bytes_per_pixel ) + { + /* Rich's code has 1 function that converts an RGB triplet to a float + // bounded by 0 and 1. He has a second function that converts a + // float to a pseudo gray value. Pseudo gray values are RGB triplets + // whose red, green and blue values differ by no more than 1. I have + // combined these two functions into a single function that simply + // looks for pseudo gray RGB triplets. If an RGB triplet meets this + // criteria, I leave it unchanged; otherwise, I use the common intensity + // conversion to create a grayscale value */ + unsigned char cmin, cmax; + + cmin = q[0]; + if ( q[1] < cmin ) + cmin = q[1]; + if ( q[2] < cmin ) + cmin = q[2]; + + cmax = q[0]; + if ( q[1] > cmax ) + cmax = q[1]; + if ( q[2] > cmax ) + cmax = q[2]; + + if ( cmax - cmin > 2 ) + { + gray = CreateGrayScale( q ); + memset( (void *)q, gray, 3 ); + } + } + } + + return BMG_OK; +} + +#ifdef _WIN32 +/******************************************************************************* +// extracts the dimensional information, pixel array, and color table from an +// HBITMAP. +// hBitmap can be a handle to a DIB or a DDB. This function assumes that DDBs +// will not have a palette. If you create a DDB on a 256-color graphics card, +// then the DDB will have a palette and this function will fail. +// +// returns BMK_OK if successfull, and error state otherwise. +********************************************************************************/ +BMGError GetDataFromBitmap( HBITMAP hBitmap, + struct BMGImageStruct *img, + int remove_alpha ) +{ + unsigned int DIBScanWidth; + DIBSECTION DS; + HWND hWnd = GetForegroundWindow(); + HDC hDC = NULL; + HDC hMemDC = NULL; + unsigned char red, green, blue; + int FreelpBits = 0; + unsigned int numBytes; + size_t soDIBSECTION = sizeof(DIBSECTION); + size_t soBITMAP = sizeof(BITMAP); + + unsigned char *p, *q, *lpBits, alpha; + + jmp_buf err_jmp; + int error; + BMGError bmgerr; + + /* error handler */ + error = setjmp( err_jmp ); + if ( error != 0 ) + { + if ( hMemDC != NULL ) + DeleteDC( hMemDC ); + if ( hDC != NULL ) + ReleaseDC( hWnd, hDC ); + if ( FreelpBits ) + free( lpBits ); + FreeBMGImage( img ); + SetLastBMGError( (BMGError)error ); + return (BMGError)error; + } + + SetLastBMGError( BMG_OK ); + /* check for valid bitmap*/ + if ( !hBitmap ) + longjmp( err_jmp, (int)errInvalidBitmapHandle ); + + /* Extract DIBSECTION info from the HBITMAP. numBytes will equal + // soDIBSECTION (84) if hBitmap is a handle to a DIBSECTION (DIB). + // numBytes will equal soBITMAP (24) if hBitmap is a handle to a + // BITMAP (DDB). */ + numBytes = GetObject( hBitmap, sizeof(DIBSECTION), &DS ); + if ( numBytes == 0 ) + longjmp( err_jmp, (int)errWindowsAPI ); + + img->opt_for_bmp = 1; + if ( numBytes == soDIBSECTION ) + { + img->width = DS.dsBmih.biWidth; + img->height = DS.dsBmih.biHeight; + img->bits_per_pixel = (unsigned char)DS.dsBmih.biBitCount; + if ( img->bits_per_pixel <= 8 && DS.dsBmih.biClrUsed > 0 ) + img->palette_size = (unsigned short)DS.dsBmih.biClrUsed; + lpBits = (unsigned char *)DS.dsBm.bmBits; + } + /* this may be a DDB which must be handled differently */ + else if ( numBytes == soBITMAP ) + { + BITMAP bm; + BITMAPINFO bmi; + + if ( GetObject( hBitmap, sizeof(BITMAP), &bm ) == 0 ) + longjmp( err_jmp, (int)errWindowsAPI ); + + /* DDB with a palette */ + if ( bm.bmBitsPixel <= 8 ) + longjmp( err_jmp, (int)errInvalidPixelFormat ); + + img->width = bm.bmWidth; + img->height = bm.bmHeight; + img->bits_per_pixel = (unsigned char)bm.bmBitsPixel; + bmi = InternalCreateBMI( bm.bmWidth, bm.bmHeight, bm.bmBitsPixel, + BI_RGB ); + + lpBits = (unsigned char *)calloc( bm.bmHeight * bm.bmWidthBytes, + sizeof(unsigned char) ); + if ( lpBits == 0 ) + longjmp( err_jmp, (int)errMemoryAllocation ); + FreelpBits = 1; + hDC = GetDC( hWnd ); + if ( GetDIBits(hDC, hBitmap, 0, bm.bmHeight, (void *)lpBits, &bmi, + DIB_RGB_COLORS ) == 0 ) + longjmp( err_jmp, (int)errWindowsAPI ); + ReleaseDC( hWnd, hDC ); + hDC = NULL; + } + else /* I have no idea what this is */ + longjmp( err_jmp, (int)errInvalidBitmapHandle ); + + /* allocate memory */ + bmgerr = AllocateBMGImage( img ); + if ( bmgerr != BMG_OK ) + longjmp( err_jmp, (int)bmgerr ); + + /* dimensions */ + DIBScanWidth = ( img->width * img->bits_per_pixel + 7 )/8; + if ( DIBScanWidth % 4 ) + DIBScanWidth += 4 - DIBScanWidth % 4; + + p = img->bits; + for ( q = lpBits; q < lpBits + DIBScanWidth * img->height; + p += img->scan_width, q += DIBScanWidth ) + { + memcpy( (void *)p, (void *)q, DIBScanWidth ); + } + + /* "un-blend" the image if requested. NOTE: unblending only works with + // bland backgrounds */ + if ( remove_alpha > 0 && + img->bits_per_pixel == 32 && + numBytes == soDIBSECTION ) + { + unsigned char *color = GetBackgroundColor(); + red = color[2]; + green = color[1]; + blue = color[0]; + + for ( p = img->bits; p < img->bits + img->scan_width * img->height; + p += 4 ) + { + alpha = p[3]; + p[2] = InverseAlphaComp( p[2], alpha, blue); + p[1] = InverseAlphaComp( p[1], alpha, green); + p[0] = InverseAlphaComp( p[0], alpha, red); + } + } + + /* 32-bit DDBs must have the alpha channel set to 0xFF before they are + // saved to a file. This may not be true for all devices that generate + // 32-bit DDBs. I have only created 32-bit DDBs using an Intense3D Wildcat + // 4110 card. The alpha channel was always 0. */ + if (img->bits_per_pixel == 32 && numBytes == soBITMAP ) + { + for ( p = img->bits + 3; p < img->bits + img->scan_width * img->height; + p += 4 ) + { + *p = 0xFF; + } + } + + /* create palette if necessary */ + if ( img->bits_per_pixel <= 8 ) + { + hDC = GetDC( hWnd ); + hMemDC = CreateCompatibleDC( hDC ); + SelectObject( hMemDC, hBitmap ); + if ( !GetDIBColorTable( hMemDC, 0, img->palette_size, + (RGBQUAD *)img->palette ) ) + { + longjmp( err_jmp, (int)errWindowsAPI ); + } + DeleteDC( hMemDC ); + ReleaseDC( hWnd, hDC ); + } + + if ( FreelpBits ) + free( lpBits ); + + return BMG_OK; +} + +/******************************************************************************* +// this function creates a bitmap from raw data. Returns an HBITMAP if it +// succeeds, otherwise NULL */ +HBITMAP CreateBitmapFromData( struct BMGImageStruct img, + int alpha_blend ) +{ + HBITMAP hBitmap = NULL; + HDC hMemDC = NULL; + HWND hWnd = GetForegroundWindow(); + HDC hDC = NULL; + RGBQUAD *pColor = NULL; + BITMAPINFO bmi; + unsigned char *rbits; + unsigned char *bits; + unsigned char *lpBits; + unsigned char alpha; + unsigned int DIBScanWidth; + int i; + + jmp_buf err_jmp; + int error; + + /* error handler */ + error = setjmp( err_jmp ); + if ( error != 0 ) + { + if ( hMemDC != NULL ) + DeleteDC( hMemDC ); + if ( hDC != NULL ) + ReleaseDC( hWnd, hDC ); + if ( pColor != NULL && img.bytes_per_palette_entry == 3U ) + free( pColor ); + SetLastBMGError( (BMGError)error ); + return 0; + } + + SetLastBMGError( BMG_OK ); + + /* create the DIB section that will hold this bitmap */ + bmi = InternalCreateBMI( (unsigned int)img.width, (unsigned int)img.height, + (unsigned short)img.bits_per_pixel, BI_RGB ); + bmi.bmiHeader.biClrUsed = bmi.bmiHeader.biClrImportant = + img.palette_size; + hDC = GetDC( hWnd ); + hBitmap = CreateDIBSection( hDC, &bmi, DIB_RGB_COLORS, + (void **)&lpBits, NULL, 0 ); + + if ( !hBitmap || !lpBits ) + longjmp( err_jmp, (int)errWindowsAPI ); + + /* create a palette if needed */ + if ( img.palette != NULL ) + { + /* copy pixel data to pColor */ + if ( img.bytes_per_palette_entry == 4U ) + pColor = (RGBQUAD *)img.palette; + else /* bytes_per_palette_entry === 3 */ + { + pColor = (RGBQUAD *)calloc(img.palette_size, sizeof(RGBQUAD) ); + if ( pColor == NULL ) + longjmp( err_jmp, (int)errMemoryAllocation ); + + bits = img.palette; + for ( i = 0; i < (int)bmi.bmiHeader.biClrUsed; i++, bits += 3 ) + { + pColor[i].rgbRed = bits[0]; + pColor[i].rgbGreen = bits[1]; + pColor[i].rgbBlue = bits[2]; + } + } + + if ( img.transparency_index > -1 ) + { + unsigned char *color = GetBackgroundColor(); + rbits = img.palette + img.bytes_per_palette_entry * + img.transparency_index; + rbits[0] = color[2]; + rbits[1] = color[1]; + rbits[2] = color[0]; + } + /* save color table in bitmap */ + hMemDC = CreateCompatibleDC( hDC ); + SelectObject( hMemDC, hBitmap ); + if ( !SetDIBColorTable( hMemDC, 0, img.palette_size, pColor ) ) + longjmp( err_jmp, (int)errWindowsAPI ); + + DeleteDC( hMemDC ); + hMemDC = NULL; + if ( img.bytes_per_palette_entry == 3U ) + free( pColor ); + pColor = NULL; + } + + /* calculate the scan line width */ + DIBScanWidth = img.scan_width; + if ( DIBScanWidth % 4 ) + DIBScanWidth += 4 - DIBScanWidth % 4; + + if ( img.opt_for_bmp == 0 ) + { + /* store bits into hBitmap */ + rbits = img.bits; + for ( bits = lpBits; + bits < lpBits + img.height * DIBScanWidth; + bits += DIBScanWidth, rbits += img.scan_width ) + { + memcpy( (void *)bits, (void *)rbits, img.scan_width ); + } + } + else + memcpy( (void *)lpBits, (void *)img.bits, img.scan_width * img.height ); + + /* blend the image with the window background if alpha pixels + // are present */ + if ( img.bits_per_pixel == 32 ) + { + /* blend with a bland background */ + if ( alpha_blend == 1 ) + { + unsigned char *color = GetBackgroundColor(); + unsigned char red = color[2]; + unsigned char green = color[1]; + unsigned char blue = color[0]; + + for ( rbits = lpBits; + rbits < lpBits + img.height*DIBScanWidth; + rbits += DIBScanWidth ) + { + for ( bits = rbits; bits < rbits + DIBScanWidth; bits += 4 ) + { + alpha = bits[3]; + bits[2] = AlphaComp( bits[2], alpha, blue ); + bits[1] = AlphaComp( bits[1], alpha, green ); + bits[0] = AlphaComp( bits[0], alpha, red ); + } + } + } + /* blend with a background image */ + else if ( alpha_blend == 2 ) + { + unsigned char *bg_bits; + unsigned char *bg_bits_2; + unsigned int bg_bytes_per_pixel; + struct BMGImageStruct *bg = GetBackgroundImage(); + + /* make sure we can blend with a background image + // I assume that the background image is invalid if it does not + // have a valid width */ + if ( bg->width <= 0 || bg->height <= 0 ) + longjmp( err_jmp, (int)errUndefinedBGImage ); + + /* I cannot blend a foreground image with a background image that + // is smaller than it */ + if ( bg->width < img.width || bg->height < img.height ) + longjmp( err_jmp, (int)errBGImageTooSmall ); + + /* the background image was forced to be a 24 or 32-BPP image; + // therefore, we can safely divide by 8 to determined the + // bytes per pixel*/ + bg_bytes_per_pixel = bg->bits_per_pixel / 8; + + /* I will assume that the upper left corner of the input image + // must be aligned with the upper left corner of the background + // image. This allows me to have background images that are bigger + // than the input image. */ + bg_bits = bg->bits; + for ( rbits = lpBits; + rbits < lpBits + img.height*DIBScanWidth; + rbits += DIBScanWidth, bg_bits += bg->scan_width ) + { + bg_bits_2 = bg_bits; + for ( bits = rbits; bits < rbits + DIBScanWidth; + bits += 4, bg_bits_2 += bg_bytes_per_pixel ) + { + alpha = bits[3]; + bits[2] = AlphaComp( bits[2], alpha, bg_bits_2[2] ); + bits[1] = AlphaComp( bits[1], alpha, bg_bits_2[1] ); + bits[0] = AlphaComp( bits[0], alpha, bg_bits_2[0] ); + } + } + + } + } + + ReleaseDC( hWnd, hDC ); + + return hBitmap; +} +#endif // _WIN32 +/****************************************************************************** +// ConvertPaletteToRGB converts paletted and 16-BPP images that do not have +// transparent pixels to 24-BPP images. Paletted images with transparent pixels +// are converted to 32-BPP images. 24-BPP and 32-BPP images are simply copied +// to the output structure +// +// INPUTS: +// img_in +// OUTPUTS: +// img_out +// +// returns BMG_OK if no errors occur, an error code otherwise +******************************************************************************/ +BMGError ConvertPaletteToRGB( struct BMGImageStruct img_in, + struct BMGImageStruct *img_out ) +{ + jmp_buf err_jmp; + int error; + + /* error handler */ + error = setjmp( err_jmp ); + if ( error != 0 ) + { + FreeBMGImage( img_out ); + SetLastBMGError( (BMGError)error ); + return (BMGError)error; + } + + SetLastBMGError( BMG_OK ); + + if ( img_in.height == 0 || img_in.width == 0 ) + longjmp( err_jmp, (int)errInvalidSize ); + + InitBMGImage( img_out ); + + // copy 16, 24, and 32-BPP images into the output image + if ( img_in.bits_per_pixel > 8 ) + { + BMGError out; + img_out->bits_per_pixel = img_in.bits_per_pixel; + out = CopyBMGImage( img_in, img_out ); + if ( out != BMG_OK ) + longjmp( err_jmp, (int)out ); + + // 16-BPP are converted to 24-BPP images + if ( img_out->bits_per_pixel == 16 ) + { + out = Convert16to24( img_out ); + if ( out != BMG_OK ) + longjmp( err_jmp, (int)out ); + } + } + else // convert paletted images to 24-BPP BGR or 32-BPP BGRA images + { + BMGError out; + unsigned char *buf; + unsigned int scan_width; + int dealloc; + unsigned char *q0, *q1, *p0, *p1; + unsigned int bpp; + + // allocate memory for the 24-BPP output image + img_out->width = img_in.width; + img_out->height = img_in.height; + img_out->opt_for_bmp = img_in.opt_for_bmp; + img_out->bits_per_pixel = img_in.transparency_index > -1 ? 32 : 24; + + out = AllocateBMGImage( img_out ); + if ( out != BMG_OK ) + longjmp( err_jmp, (int)out ); + + // 1-BPP and 4-BPP images are packed, so we need to unpack them + if ( img_in.bits_per_pixel < 8 ) + { + dealloc = 1; + scan_width = img_in.width; + buf = (unsigned char *)malloc(scan_width * img_in.height); + if ( buf == NULL ) + longjmp( err_jmp, (int)errMemoryAllocation ); + + if ( img_in.bits_per_pixel == 1 ) + Convert1to8( img_in, buf ); + else + Convert4to8( img_in, buf ); + } + else // simply point to the bits array if we have a 8-BPP image + { + dealloc = 0; + buf = img_in.bits; + scan_width = img_in.scan_width; + } + + // convert palette indices to BGR pixels + bpp = img_out->bits_per_pixel / 8; + q0 = img_out->bits; + for ( p0 = buf; p0 < buf + scan_width * img_in.height; + p0 += scan_width, q0 += img_out->scan_width ) + { + q1 = q0; + for ( p1 = p0; p1 < p0 + img_in.width; p1++, q1 += bpp ) + { + memcpy( (void *)q1, + (void *)(img_in.palette + *p1 * img_in.bytes_per_palette_entry), 3 ); + if ( bpp == 4 ) + { + q1[3] = *p1 == img_in.transparency_index ? 0 : 0xFF; + } + } + } + + if ( dealloc == 1 ) + free( buf ); + } + + return BMG_OK; +} + +/****************************************************************************** +// CopyBMG copies the contents of img_in into img_out. +// +// CopyBMG returns BMG_OK if successful, otherwise, it returns an error code +******************************************************************************/ +BMGError CopyBMGImage( struct BMGImageStruct img_in, + struct BMGImageStruct *img_out ) +{ + BMGError out = BMG_OK; + SetLastBMGError( out ); + + FreeBMGImage( img_out ); + + img_out->height = img_in.height; + img_out->width = img_in.width; + img_out->bits_per_pixel = img_in.bits_per_pixel; + img_out->palette_size = img_in.palette_size; + img_out->opt_for_bmp = img_in.opt_for_bmp; + + if ( img_in.width > 0 && img_in.height > 0 ) + { + out = AllocateBMGImage( img_out ); + if ( out == BMG_OK ) + { + memcpy( (void *)img_out->bits, (void *)img_in.bits, + img_in.scan_width * img_in.height ); + if ( img_in.palette_size > 0 ) + memcpy( (void *)img_out->palette, (void *)img_in.palette, + img_in.palette_size * img_in.bytes_per_palette_entry ); + } + } + + return out; +} + +/* sets the background color for alpha blending + color points to an array of 4 unsigned chars + color[0] = blue, color[1] = green, color[2] = red, color[3] = unused */ +void SetBMGBackgroundColor( unsigned char *color ) +{ + memcpy( (void *)GetBackgroundColor(), (void *)color, + 4*sizeof(unsigned char) ); +} + +#ifdef _WIN32 +/* defines the background bitmap that is used for alpha blending & transparent + pixels */ +BMGError SetBMGBackgroundBitmap( HBITMAP hBitmap ) +{ + BMGError out; + struct BMGImageStruct tmp; + InitBMGImage( &tmp ); + + /* first we extract the data from the HBITMAP */ + out = GetDataFromBitmap( hBitmap, &tmp, 0 ); + if ( out == BMG_OK ) + { + /* clean up the old background image */ + FreeBMGImage( GetBackgroundImage() ); + + /* next, we convert paletted & 16-BPP images to 24 or 32-BPP images. + // this will simplify the alpha blending. */ + out = ConvertPaletteToRGB( tmp, GetBackgroundImage() ); + } + + return out; +} +#endif // _WIN32 + +/* defines the background image that is used for alpha blending & transparent + pixels */ +BMGError SetBMGBackgroundImage( struct BMGImageStruct img ) +{ + /* clean up the old background image */ + FreeBMGImage( GetBackgroundImage() ); + + /* convert paletted and 16-BPP images to 24-BPP or 32-BPP images. This + // will simplify the alpha blending logic*/ + return ConvertPaletteToRGB( img, GetBackgroundImage() ); +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/liblinux/BMGImage.h b/libmupen64plus/mupen64plus-video-rice/src/liblinux/BMGImage.h new file mode 100644 index 0000000000..0776a5d542 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/liblinux/BMGImage.h @@ -0,0 +1,169 @@ +#ifndef _BMG_IMAGE_H_ +#define _BMG_IMAGE_H_ +/* +// header file for the BMGImage functions +// +// Copyright 2000, 2001 M. Scott Heiman +// +// You may use the software for any purpose you see fit. You may modify +// it, incorporate it in a commercial application, use it for school, +// even turn it in as homework. You must keep the Copyright in the +// header and source files. This software is not in the "Public Domain". +// You may use this software at your own risk. I have made a reasonable +// effort to verify that this software works in the manner I expect it to; +// however,... +// +// THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" AND +// WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, INCLUDING +// WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A +// PARTICULAR PURPOSE. IN NO EVENT SHALL MICHAEL S. HEIMAN BE LIABLE TO +// YOU OR ANYONE ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR +// CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING +// WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, +// OR THE CLAIMS OF THIRD PARTIES, WHETHER OR NOT MICHAEL S. HEIMAN HAS +// BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE +// POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +#include "../osal_preproc.h" + +#if !defined(WIN32) + typedef struct tagRGBQUAD + { + unsigned char rgbBlue; + unsigned char rgbGreen; + unsigned char rgbRed; + unsigned char rgbReserved; + } RGBQUAD; +#endif + +enum BMG_Error +{ + BMG_OK = 0, + errLib = 1, + errInvalidPixelFormat = 2, + errMemoryAllocation = 3, + errInvalidSize = 4, + errInvalidBitmapHandle = 5, + errWindowsAPI = 6, + errFileOpen = 7, + errUnsupportedFileFormat = 8, + errInvalidBMGImage = 9, + errInvalidFileExtension = 10, + errFileRead = 11, + errFileWrite = 12, + errInvalidGeoTIFFPointer = 13, + errUndefinedBGImage = 14, + errBGImageTooSmall = 15, + errCorruptFile = 16 +}; + +typedef enum BMG_Error BMGError; + +#pragma pack(push,1) +struct BMGImageStruct +{ + unsigned int width; + unsigned int height; + unsigned char bits_per_pixel; + unsigned char *bits; + unsigned short palette_size; + unsigned char bytes_per_palette_entry; + unsigned char *palette; + unsigned int scan_width; + int opt_for_bmp; /*= 1 if memory has been sized for HBITMAP, 0 otherwise*/ + short transparency_index; +}; +#pragma pack(pop) + +#if defined(__cplusplus) +extern "C" { +#endif + +/* initializes a BMGImage to default values */ +extern +void InitBMGImage(struct BMGImageStruct *img ); + +/* frees memory allocated to a BMGImage */ +extern +void FreeBMGImage( struct BMGImageStruct *img ); + +/* allocates memory (bits & palette) for a BMGImage. + returns 1 if successfull, 0 otherwise. + width, height, bits_per_pixel, palette_size, & opt_for_bmp must have valid + values before this function is called. + Assumes that all images with bits_per_pixel <= 8 requires a palette. + will set bits_per_palette_entry, scan_width, bits, & palette */ +extern +BMGError AllocateBMGImage( struct BMGImageStruct *img ); + +/* compresses 8 BPP paletted images to 1 BPP or 4 BPP paletted images if + possible */ +extern +BMGError CompressBMGImage( struct BMGImageStruct *img ); + + +/* a utility function for freeing memory created in BMGLib */ +extern +void FreeBMGMemory( unsigned char *mem ); + +/* converts a color image to a gray scale image */ +extern +BMGError ConvertToGrayScale( struct BMGImageStruct *img ); + +/* converts a color image to a pseudo-gray scale image */ +extern +BMGError ConvertToPseudoGrayScale( struct BMGImageStruct *img ); + +/* stores the contents of a bitmap into a BMGImageStruct */ +extern +BMGError GetDataFromBitmap( HBITMAP hBitmap, + struct BMGImageStruct *img, + int remove_alpha ); + +/* creates an HBITMAP from a BMGImageStruct */ +extern +HBITMAP CreateBitmapFromData( struct BMGImageStruct img, + int alpha_blend ); + +/* sets the background color for alpha blending + color points to an array of 4 unsigned chars + color[0] = blue, color[1] = green, color[2] = red, color[3] = unused */ +extern +void SetBMGBackgroundColor( unsigned char *color ); + +/* defines the background bitmap that is used for alpha blending & transparent + pixels */ +extern +BMGError SetBMGBackgroundBitmap( HBITMAP hBitmap ); + +/* defines the background image that is used for alpha blending & transparent + pixels */ +extern +BMGError SetBMGBackgroundImage( struct BMGImageStruct img ); + +/* Converts paletted images and 16-BPP images to 24-BPP images */ +extern +BMGError ConvertPaletteToRGB( struct BMGImageStruct img_in, + struct BMGImageStruct *img_out ); + +/* copies the contents of the input image into the output image */ +extern +BMGError CopyBMGImage( struct BMGImageStruct img_in, + struct BMGImageStruct *img_out ); + +/* returns the last error state */ +extern +BMGError GetLastBMGError(); + +/* gets the error message */ +extern +void GetLastBMGErrorMessage( const char **msg ); + +#if defined(__cplusplus) + } +#endif + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/liblinux/BMGLibPNG.h b/libmupen64plus/mupen64plus-video-rice/src/liblinux/BMGLibPNG.h new file mode 100644 index 0000000000..b74382a20f --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/liblinux/BMGLibPNG.h @@ -0,0 +1,61 @@ +#ifndef _BMG_LIBPNG_H_ +#define _BMG_LIBPNG_H_ +/* +// header file for the BMGLibPNG functions +// +// Copyright 2000, 2001 M. Scott Heiman +// All Rights Reserved +// libPNG is Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. +// (libpng versions 0.5, May 1995, through 0.89c, May 1996) +// Copyright (c) 1996, 1997 Andreas Dilger +// (libpng versions 0.90, December 1996, through 0.96, May 1997) +// Copyright (c) 1998, 1999 Glenn Randers-Pehrson +// (libpng versions 0.97, January 1998, through 1.0.5, October 15, 1999) +// +// You may use the software for any purpose you see fit. You may modify +// it, incorporate it in a commercial application, use it for school, +// even turn it in as homework. You must keep the Copyright in the +// header and source files. This software is not in the "Public Domain". +// You may use this software at your own risk. I have made a reasonable +// effort to verify that this software works in the manner I expect it to; +// however,... +// +// THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" AND +// WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, INCLUDING +// WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A +// PARTICULAR PURPOSE. IN NO EVENT SHALL MICHAEL S. HEIMAN BE LIABLE TO +// YOU OR ANYONE ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR +// CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING +// WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, +// OR THE CLAIMS OF THIRD PARTIES, WHETHER OR NOT MICHAEL S. HEIMAN HAS +// BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE +// POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +#include "pngrw.h" + +#if defined(__cplusplus) +extern "C" { +#endif + +//#pragma message ("Exporting BMGLibPNG functions") +/* saves the contents of an HBITMAP to a file. The extension of the file name +// determines the file type. returns 1 if successfull, 0 otherwise */ +extern +BMGError SaveBitmapToPNGFile( HBITMAP hBitmap, /* bitmap to be saved */ + const char *filename); /* name of output file */ + +/* Creates an HBITMAP to an image file. The extension of the file name +// determines the file type. returns an HBITMAP if successfull, NULL +// otherwise */ +extern +HBITMAP CreateBitmapFromPNGFile( const char *filename, + int blend ); + +#if defined(__cplusplus) + } +#endif + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/liblinux/BMGUtils.c b/libmupen64plus/mupen64plus-video-rice/src/liblinux/BMGUtils.c new file mode 100644 index 0000000000..f341b047ea --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/liblinux/BMGUtils.c @@ -0,0 +1,394 @@ +/* +// source code for the BMGLib Utility functions +// +// Copyright (C) 2001 M. Scott Heiman +// All Rights Reserved +// +// You may use the software for any purpose you see fit. You may modify +// it, incorporate it in a commercial application, use it for school, +// even turn it in as homework. You must keep the Copyright in the +// header and source files. This software is not in the "Public Domain". +// You may use this software at your own risk. I have made a reasonable +// effort to verify that this software works in the manner I expect it to; +// however,... +// +// THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" AND +// WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, INCLUDING +// WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A +// PARTICULAR PURPOSE. IN NO EVENT SHALL MICHAEL S. HEIMAN BE LIABLE TO +// YOU OR ANYONE ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR +// CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING +// WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, +// OR THE CLAIMS OF THIRD PARTIES, WHETHER OR NOT MICHAEL S. HEIMAN HAS +// BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE +// POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +#include +#include "BMGUtils.h" + +#ifndef _WIN32 +#include +#endif // _WIN32 + +/* error strings for all BMG errors */ +static char BMGErrorStrings[17][128] = { +"No Error", +"Corrupted file or invalid file format", +"Invalid bits per pixel for this file format", +"Memory allocation error", +"Invalid requested image size", +"Invalid bitmap handle", +"Windows API Error", /* this will be overwritten */ +"Unable to open file", +"Unsupported file format option", +"Invalid pointer to a BMG image", +"Unsupported file extension", +"Error reading file", +"Error writing to the output file", +"Invalid pointer to a GeoTIFF structure", +"The background image is undefined", +"The background image is too small", +"Corrupt File" +}; + +/* stores last BMG error */ +static BMGError LastBMGError; + +/* sets the last BMG error */ +void SetLastBMGError( BMGError err ) +{ + LastBMGError = err; +} + +/* returns the last error state */ +BMGError GetLastBMGError(void) +{ + return LastBMGError; +} +/* gets the error message */ +void GetLastBMGErrorMessage( const char **msg ) +{ + if ( LastBMGError == errWindowsAPI ) + { + char* lpMsgBuf = "Erreur BMG\n"; + + /* copy the string. */ + strcpy( BMGErrorStrings[(int)LastBMGError], (char *)lpMsgBuf ); + } + + *msg = BMGErrorStrings[(int)LastBMGError]; +} + +/* Global background color variables */ +static unsigned char BackgroundColor[4]; +static struct BMGImageStruct BackgroundImage; + +/* this function simply initializes the background info. It is called from + the DllEntryPoint function */ +void InitBackground(void) +{ + memset( (void *)BackgroundColor, 0xFF, 3 ); /* white */ + BackgroundColor[3] = 0; /* ignored */ + InitBMGImage( &BackgroundImage ); +} + +unsigned char *GetBackgroundColor(void) +{ + return &BackgroundColor[0]; +} + +struct BMGImageStruct *GetBackgroundImage(void) +{ + return &BackgroundImage; +} + +/* converts an array of 1-bit scanlines to 8-bit scanlines */ +void Convert1to8( struct BMGImageStruct img, + unsigned char *out ) +{ + unsigned char *p, *q, *r, *s, *end; + int i; + + q = out; + + for ( s = img.bits; s < img.bits + img.scan_width * img.height; + s += img.scan_width, q += img.width ) + { + i = img.width % 8; + end = q + img.width - i; + p = s; + for ( r = q; r < end; p++ ) + { + *r++ = (unsigned char)((*p & 0x80) ? 1 : 0); + *r++ = (unsigned char)((*p & 0x40) ? 1 : 0); + *r++ = (unsigned char)((*p & 0x20) ? 1 : 0); + *r++ = (unsigned char)((*p & 0x10) ? 1 : 0); + *r++ = (unsigned char)((*p & 0x08) ? 1 : 0); + *r++ = (unsigned char)((*p & 0x04) ? 1 : 0); + *r++ = (unsigned char)((*p & 0x02) ? 1 : 0); + *r++ = (unsigned char)(*p & 0x01); + } + + if ( i-- ) + { + *r++ = (unsigned char)((*p & 0x80) ? 1 : 0); + if ( i-- ) + { + *r++ = (unsigned char)((*p & 0x40) ? 1 : 0); + if ( i-- ) + { + *r++ = (unsigned char)((*p & 0x20) ? 1 : 0); + if ( i-- ) + { + *r++ = (unsigned char)((*p & 0x10) ? 1 : 0); + if ( i-- ) + { + *r++ = (unsigned char)((*p & 0x08) ? 1 : 0); + if ( i-- ) + { + *r++ = (unsigned char)((*p & 0x04) ? 1 : 0); + if ( i ) + *r = (unsigned char)((*p & 0x02) ? 1:0); + } + } + } + } + } + } + } +} + +/* converts an array of 4-bit scanlines to 8-bit scanlines */ +void Convert4to8( struct BMGImageStruct img, + unsigned char *out ) +{ + unsigned char *p, *q, *r, *s, *end; + int i; + + q = out; + + for ( s = img.bits; s < img.bits + img.scan_width * img.height; + s += img.scan_width, q += img.width ) + { + i = img.width % 2; + end = q + img.width - i; + p = s; + for ( r = q; r < end; p++ ) + { + *r++ = (unsigned char)((*p >> 4) & 0x0F); + *r++ = (unsigned char)(*p & 0x0F); + } + + if ( i ) + *r = (unsigned char)((*p >> 4) & 0x0F); + } +} + +/****************************************************************************/ +/* this function performs alpha blending. It is a variation of a function + that I found in the PNG example code */ +unsigned char AlphaComp( unsigned char fg, + unsigned char alpha, + unsigned char bg ) +{ + unsigned char out; + unsigned short temp; + + switch ( alpha ) + { + case 0: + out = bg; + break; + case 255: + out = fg; + break; + default: + temp = ((unsigned short)(fg)*(unsigned short)(alpha) + + (unsigned short)(bg)*(unsigned short)(255 - + (unsigned short)(alpha)) + (unsigned short)128); + out = (unsigned char)((temp + (temp >> 8)) >> 8); + break; + } + return out; +} + +/**************************************************************************** +// Converts a 16 BPP image to a 24 BPP image +// returns 1 if successfull, 0 otherwise */ +BMGError Convert16to24( struct BMGImageStruct *img ) +{ + unsigned int i; + unsigned int new_scan_width; + unsigned char *new_bits; + + /* this function will only work with 16 BBP images */ + if ( img->bits_per_pixel != 16 ) + return errInvalidPixelFormat; + + /* calculate the new scan width */ + new_scan_width = 3 * img->width; + if ( new_scan_width % 4 && img->opt_for_bmp ) + new_scan_width += 4 - new_scan_width % 4; + + /* allocate memory for the new pixel values */ + new_bits = (unsigned char *)calloc( new_scan_width * img->height, sizeof(unsigned char) ); + if ( new_bits == NULL ) + return errMemoryAllocation; + + /* convert the 16 BPP pixel values to the equivalent 24 BPP values */ + for ( i = 0; i < img->height; i++ ) + { + unsigned char *p24; + unsigned short *p16 = (unsigned short *)(img->bits + i * img->scan_width); + unsigned char *start = new_bits + i * new_scan_width; + unsigned char *end = start + new_scan_width; + for ( p24 = start; p24 < end; p24 += 3, p16++ ) + { + p24[0] = (unsigned char)( (*p16 & 0x001F) << 3 ); + p24[1] = (unsigned char)( (*p16 & 0x03E0) >> 2 ); + p24[2] = (unsigned char)( (*p16 & 0x7C00) >> 7 ); + } + } + + free( img->bits ); + img->bits = new_bits; + img->scan_width = new_scan_width; + img->bits_per_pixel = 24; + + return BMG_OK; +} + +/****************************************************************************/ +/* this function undoes alpha blending - kind-a-sort-of ;-) */ +unsigned char InverseAlphaComp( unsigned char fg, unsigned char alpha, + unsigned char bg ) +{ + unsigned char out; + short temp; + + switch ( alpha ) + { + case 0: + out = bg; + break; + case 255: + out = fg; + break; + default: + temp = (255*fg - bg*(255-alpha))/alpha; + if ( temp < 0 ) + temp = 0; + out = (unsigned char)temp; + break; + } + return out; +} + +/****************************************************************************/ +/* +// Creates a BITMAPINFOHEADER for the given width, height, bit count, and +// compression. Compression must = BI_RGB, BI_BITFIELDS, BI_RLE4, or BI_RLE8. +*/ +BITMAPINFO InternalCreateBMI( unsigned int dwWidth, /* width */ + unsigned int dwHeight, /* height */ + unsigned short wBitCount, /* bit count */ + int compression ) /* compression type */ +{ + BITMAPINFO bi; /* bitmap header */ + unsigned int dwBytesPerLine; /* Number of bytes per scanline */ + + /* clear the bitmapinfo structure */ + memset(&bi, 0, sizeof(BITMAPINFO)); + + /* Make sure bits per pixel is valid */ + if (wBitCount <= 1) + wBitCount = 1; + else if (wBitCount <= 4) + wBitCount = 4; + else if (wBitCount <= 8) + wBitCount = 8; + else if (wBitCount <= 16) + wBitCount = 16; + else if (wBitCount <= 24) + wBitCount = 24; + else if (wBitCount <= 32) + wBitCount = 32; + else + wBitCount = 8; /* set default value to 8 if parameter is bogus */ + + dwBytesPerLine = (((wBitCount * dwWidth) + 31) / 32 * 4); + + /* initialize BITMAPINFO */ + bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bi.bmiHeader.biWidth = dwWidth; + bi.bmiHeader.biHeight = dwHeight; + bi.bmiHeader.biPlanes = 1; /* must be 1 */ + bi.bmiHeader.biBitCount = wBitCount; + bi.bmiHeader.biCompression = compression; + bi.bmiHeader.biSizeImage = dwBytesPerLine*dwHeight; + bi.bmiHeader.biXPelsPerMeter = 0; + bi.bmiHeader.biYPelsPerMeter = 0; + bi.bmiHeader.biClrUsed = wBitCount <= 8 ? 1U << wBitCount : 0; + bi.bmiHeader.biClrImportant = bi.bmiHeader.biClrUsed; + + return bi; +} + +short SwapShort( short in ) +{ + char sin[2]; + char sout[2]; + + memcpy( (char *)sin, (char *)&in, 2 ); + + sout[0] = sin[1]; + sout[1] = sin[0]; + + return *((short *)sout); +} + +unsigned short SwapUShort( unsigned short in ) +{ + char sin[2]; + char sout[2]; + + memcpy( (char *)sin, (char *)&in, 2 ); + + sout[0] = sin[1]; + sout[1] = sin[0]; + + return *((unsigned short *)sout); +} + +int SwapLong( int in ) +{ + char sin[4]; + char sout[4]; + + memcpy( (char *)sin, (char *)&in, 4 ); + + sout[0] = sin[3]; + sout[1] = sin[2]; + sout[2] = sin[1]; + sout[3] = sin[0]; + + return *((int *)sout); +} + +unsigned int SwapULong( unsigned int in ) +{ + char sin[4]; + char sout[4]; + + memcpy( (char *)sin, (char *)&in, 4 ); + + sout[0] = sin[3]; + sout[1] = sin[2]; + sout[2] = sin[1]; + sout[3] = sin[0]; + + return *((unsigned int *)sout); +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/liblinux/BMGUtils.h b/libmupen64plus/mupen64plus-video-rice/src/liblinux/BMGUtils.h new file mode 100644 index 0000000000..7578508d20 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/liblinux/BMGUtils.h @@ -0,0 +1,56 @@ +#ifndef _BMG_UTILS_H_ +#define _BMG_UTILS_H_ +/* + some handy utilities used in several units + + Copyright 2001 + M. Scott Heiman + All Rights Reserved +*/ + +#include "BMGImage.h" +#include "../osal_preproc.h" + +/* the following 3 functions are used to access the background color +// and the background image */ +void InitBackground(void); + +unsigned char *GetBackgroundColor(void); + +struct BMGImageStruct *GetBackgroundImage(void); + +/* creates a 24 bpp image from a 16 bpp image */ +BMGError Convert16to24( struct BMGImageStruct *img ); + +/* converts an array of 1-bit scanlines to 8-bit scanlines */ +void Convert1to8( struct BMGImageStruct img, + unsigned char *out ); + +/* converts an array of 4-bit scanlines to 8-bit scanlines */ +void Convert4to8( struct BMGImageStruct img, + unsigned char *out ); + +unsigned char AlphaComp( unsigned char fg, + unsigned char alpha, + unsigned char bg ); + +unsigned char InverseAlphaComp( unsigned char fg, + unsigned char alpha, + unsigned char bg ); + +BITMAPINFO InternalCreateBMI( unsigned int dwWidth, /* width */ + unsigned int dwHeight, /* height */ + unsigned short wBitCount, /* bit count */ + int compression ); /* compression type */ + +void SetLastBMGError( BMGError err ); + +/* the following 4 functions are for dealing with file formats + that store data in big endian format */ +short SwapShort( short in ); +unsigned short SwapUShort( unsigned short in ); +int SwapLong( int in ); +unsigned int SwapULong( unsigned int in ); + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/liblinux/bmp.c b/libmupen64plus/mupen64plus-video-rice/src/liblinux/bmp.c new file mode 100644 index 0000000000..9055563e72 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/liblinux/bmp.c @@ -0,0 +1,527 @@ +/* +// source code for the ImageLib BMP functions +// +// Copyright (C) 2001 M. Scott Heiman +// All Rights Reserved +// +// You may use the software for any purpose you see fit. You may modify +// it, incorporate it in a commercial application, use it for school, +// even turn it in as homework. You must keep the Copyright in the +// header and source files. This software is not in the "Public Domain". +// You may use this software at your own risk. I have made a reasonable +// effort to verify that this software works in the manner I expect it to; +// however,... +// +// THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" AND +// WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, INCLUDING +// WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A +// PARTICULAR PURPOSE. IN NO EVENT SHALL MICHAEL S. HEIMAN BE LIABLE TO +// YOU OR ANYONE ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR +// CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING +// WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, +// OR THE CLAIMS OF THIRD PARTIES, WHETHER OR NOT MICHAEL S. HEIMAN HAS +// BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE +// POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +#include "BMGDLL.h" +#include "BMGUtils.h" +#include +#include +#include + +#ifndef _WIN32 +#include +#endif // _WIN32 + +static const unsigned short BMP_ID = 0x4D42; + +/* + ReadBMP - reads the image data from a BMP files and stores it in a + BMGImageStruct. + + Inputs: + filename - the name of the file to be opened + + Outputs: + img - the BMGImageStruct containing the image data + + Returns: + BMGError - if the file could not be read or a resource error occurred + BMG_OK - if the file was read and the data was stored in img + + Limitations: + will not read BMP files using BI_RLE8, BI_RLE4, or BI_BITFIELDS +*/ +BMGError ReadBMP( const char *filename, + struct BMGImageStruct *img ) +{ + FILE *file = NULL; + int error; + BMGError tmp; + unsigned char *p, *q; /*, *q_end; */ +/* unsigned int cnt; */ + int i; +/* int EOBMP; */ + + BITMAPFILEHEADER bmfh; + BITMAPINFOHEADER bmih; +/* + unsigned int mask[3]; +*/ + + unsigned int DIBScanWidth; + unsigned int bit_size, rawbit_size; + unsigned char *rawbits = NULL; + + SetLastBMGError( BMG_OK ); + + if ( img == NULL ) + { error = (int) errInvalidBMGImage; goto err_jmp; } + + + file = fopen( filename, "rb" ); + if ( file == NULL ) + { error = (int) errFileOpen; goto err_jmp; } + + /* read the file header */ + if ( fread( (void *)&bmfh, sizeof(BITMAPFILEHEADER), 1, file ) != 1 ) + { error = (int) errFileRead; goto err_jmp; } + + /* confirm that this is a BMP file */ + if ( bmfh.bfType != BMP_ID ) + { error = (int) errUnsupportedFileFormat; goto err_jmp; } + + /* read the bitmap info header */ + if ( fread( (void *)&bmih, sizeof(BITMAPINFOHEADER), 1, file ) != 1 ) + { error = (int) errFileRead; goto err_jmp; } + + /* abort if this is an unsupported format */ + if ( bmih.biCompression != BI_RGB ) + { printf("planes: %i bits: %i type: %i ", bmih.biPlanes, bmih.biBitCount, bmih.biCompression); error = (int) errUnsupportedFileFormat; goto err_jmp; } + + img->bits_per_pixel = (unsigned char)bmih.biBitCount; + img->width = bmih.biWidth; + img->height = bmih.biHeight; + if ( img->bits_per_pixel <= 8 ) + { + img->palette_size = (unsigned short)bmih.biClrUsed; + img->bytes_per_palette_entry = 4U; + } + + tmp = AllocateBMGImage( img ); + if ( tmp != BMG_OK ) + { error = (int) tmp; goto err_jmp; } + + /* read palette if necessary */ + if ( img->bits_per_pixel <= 8 ) + { + if ( fread( (void *)img->palette, sizeof(RGBQUAD), img->palette_size, + file ) != (unsigned int)img->palette_size ) + { + error = (int) errFileRead; + goto err_jmp; + } + } + + /* dimensions */ + DIBScanWidth = ( img->bits_per_pixel * img->width + 7 ) / 8; + if ( DIBScanWidth %4 ) + DIBScanWidth += 4 - DIBScanWidth % 4; + + bit_size = img->scan_width * img->height; + + /* allocate memory for the raw bits */ + if ( bmih.biCompression != BI_RGB ) + rawbit_size = bmfh.bfSize - bmfh.bfOffBits; + else + rawbit_size = DIBScanWidth * img->height; + + rawbits = (unsigned char *)calloc( rawbit_size, 1 ); + if ( rawbits == NULL ) + { error = (int) errMemoryAllocation; goto err_jmp; } + + if ( fread( (void *)rawbits, sizeof(unsigned char), rawbit_size, file ) + != rawbit_size ) + { + error = (int) errFileRead; + goto err_jmp; + } + + if ( bmih.biCompression == BI_RGB ) + { + p = rawbits; + for ( q = img->bits; q < img->bits + bit_size; + q += img->scan_width, p += DIBScanWidth ) + { + memcpy( (void *)q, (void *)p, img->scan_width ); + } + } + + /* swap rows if necessary */ + if ( bmih.biHeight < 0 ) + { + for ( i = 0; i < (int)(img->height) / 2; i++ ) + { + p = img->bits + i * img->scan_width; + q = img->bits + ((img->height) - i - 1 ) * img->scan_width; + memcpy( (void *)rawbits, (void *)p, img->scan_width ); + memcpy( (void *)p, (void *)q, img->scan_width ); + memcpy( (void *)q, (void *)rawbits, img->scan_width ); + } + } + + fclose( file ); + free( rawbits ); + return BMG_OK; + + /* error handler */ +err_jmp: + if ( file != NULL ) + fclose( file ); + if ( rawbits != NULL ) + free( rawbits ); + FreeBMGImage( img ); + SetLastBMGError( (BMGError)error ); + return (BMGError)error; + +} + +/* + WriteBMP - writes the contents of an BMGImageStruct to a bmp file. + + Inputs: + filename - the name of the file to be opened + img - the BMGImageStruct containing the image data + + Returns: + BMGError - if a write error or a resource error occurred + BMG_OK - if the data was successfilly stored in filename + + Limitations: + will not write BMP files using BI_RLE8, BI_RLE4, or BI_BITFIELDS +*/ +BMGError WriteBMP( const char *filename, + struct BMGImageStruct img ) +{ + FILE * volatile file = NULL; + jmp_buf err_jmp; + int error; + + unsigned char * volatile bits = NULL; + unsigned int DIBScanWidth; + unsigned int BitsPerPixel; + unsigned int bit_size; /*, new_bit_size; */ +/* unsigned int rawbit_size; */ + unsigned char *p, *q, *r, *t; +/* unsigned int cnt; */ + unsigned char * volatile pColor = NULL; + + BITMAPFILEHEADER bmfh; + BITMAPINFOHEADER bmih; + + SetLastBMGError( BMG_OK ); + + /* error handler */ + error = setjmp(err_jmp); + if (error != 0) + { + if (file != NULL) + fclose(file); + if (bits != NULL) + free(bits); + if (pColor != NULL) + free(pColor); + SetLastBMGError((BMGError)error); + return (BMGError) error; + } + + if ( img.bits == NULL ) + longjmp( err_jmp, (int)errInvalidBMGImage ); + + file = fopen( filename, "wb" ); + if ( file == NULL ) + longjmp( err_jmp, (int)errFileOpen ); + + /* abort if we do not support the data */ + if ( img.palette != NULL && img.bytes_per_palette_entry < 3 ) + longjmp( err_jmp, (int)errInvalidBMGImage ); + + /* calculate dimensions */ + BitsPerPixel = img.bits_per_pixel < 32 ? img.bits_per_pixel : 24U; + DIBScanWidth = ( BitsPerPixel * img.width + 7 ) / 8; + if ( DIBScanWidth % 4 ) + DIBScanWidth += 4 - DIBScanWidth % 4; + bit_size = DIBScanWidth * img.height; +/* rawbit_size = BITScanWidth * img.height; */ + + /* allocate memory for bit array - assume that compression will + // actually compress the bitmap */ + bits = (unsigned char *)calloc( bit_size, 1 ); + if ( bits == NULL ) + longjmp( err_jmp, (int)errMemoryAllocation ); + + /* some initialization */ + memset( (void *)&bmih, 0, sizeof(BITMAPINFOHEADER) ); + bmih.biSize = sizeof(BITMAPINFOHEADER); + bmih.biWidth = img.width; + bmih.biHeight = img.height; + bmih.biPlanes = 1; + /* 32-bit images will be stored as 24-bit images to save space. The BMP + format does not use the high word and I do not want to store alpha + components in an image format that does not recognize it */ + bmih.biBitCount = BitsPerPixel; + bmih.biCompression = BI_RGB; // assumed + bmih.biSizeImage = bit_size; // assumed + bmih.biClrUsed = img.palette == NULL ? 0 : img.palette_size; + bmih.biClrImportant = img.palette == NULL ? 0 : img.palette_size; + + /* if we are not compressed then copy the raw bits to bits */ + if ( bmih.biCompression == BI_RGB ) + { + p = img.bits; + /* simple memcpy's for images containing < 32-bits per pixel */ + if ( img.bits_per_pixel < 32 ) + { + for ( q = bits; q < bits + bit_size; q += DIBScanWidth, + p += img.scan_width ) + { + memcpy( (void *)q, (void *)p, img.scan_width ); + } + } + /* store 32-bit images as 24-bit images to save space. alpha terms + are lost */ + else + { + DIBScanWidth = 3 * img.width; + if ( DIBScanWidth % 4 ) + DIBScanWidth += 4 - DIBScanWidth % 4; + + for ( q = bits; q < bits + bit_size; q += DIBScanWidth, + p += img.scan_width ) + { + t = p; + for ( r = q; r < q + DIBScanWidth; r += 3, t += 4 ) + memcpy( (void *)r, (void *)t, 3 ); + } + } + } + + /* create the palette if necessary */ + if ( img.palette != NULL ) + { + pColor = (unsigned char *)calloc( img.palette_size, sizeof(RGBQUAD) ); + if ( pColor == NULL ) + longjmp( err_jmp, (int)errMemoryAllocation ); + + if ( img.bytes_per_palette_entry == 3 ) + { + p = img.palette; + for ( q = pColor + 1; q < pColor +img.palette_size*sizeof(RGBQUAD); + q += sizeof(RGBQUAD), p += 3 ) + { + memcpy( (void *)pColor, (void *)p, 3 ); + } + } + else /* img.bytes_per_palette_entry == 4 */ + { + memcpy( (void *)pColor, (void *)img.palette, + img.palette_size * sizeof(RGBQUAD) ); + } + } + + /* now that we know how big everything is let's write the file */ + memset( (void *)&bmfh, 0, sizeof(BITMAPFILEHEADER) ); + bmfh.bfType = BMP_ID; + bmfh.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + + img.palette_size * sizeof(RGBQUAD); + bmfh.bfSize = bmfh.bfOffBits + bit_size; + + if ( fwrite( (void *)&bmfh, sizeof(BITMAPFILEHEADER), 1, file ) != 1 ) + longjmp( err_jmp, (int)errFileWrite ); + + if ( fwrite( (void *)&bmih, sizeof(BITMAPINFOHEADER), 1, file ) != 1 ) + longjmp( err_jmp, (int)errFileWrite ); + + if ( pColor != NULL ) + { + if ( fwrite( (void *)pColor, sizeof(RGBQUAD), img.palette_size, file ) + != (unsigned int)img.palette_size ) + { + longjmp( err_jmp, (int)errFileWrite ); + } + } + + if ( fwrite( (void *)bits, sizeof(unsigned char), bit_size, file ) + != bit_size ) + { + longjmp( err_jmp, (int)errFileWrite ); + } + + fclose( file ); + free( bits ); + if ( pColor != NULL ) + free( pColor ); + return BMG_OK; +} + +#ifdef _NEVER_DEFINE_THIS_DEF_ +/* following code is not tested. I keep it here in case I ever find a BMP + file that is compressed and I want to test it */ + else if ( bmih.biCompression == BI_RLE8 ) + { + bmih.biCompression = BI_RGB; + bmih.biSizeImage = DIBScanWidth * img.height; + p = rawbits; + q = img.bits; + EOBMP = 1; + while ( q < img.bits + bit_size && p < rawbits + rawbit_size && EOBMP ) + { + cnt = (unsigned int)*p; + p++; + + /* encoded mode */ + if ( cnt == 0 ) + { + cnt = (unsigned int)*p; + if ( cnt < 3U ) + { + p++; + /* EOL */ + if ( *p == 0 ) + p++; + /* end of bitmap */ + else if ( *p == 1 ) + EOBMP = 0; + /* delta */ + else if ( *p == 2 ) + { + p++; + q += *p; /* columns */ + p++; + q += (*p)*BITScanWidth; /* rows */ + p++; + } + } + /* copy *p duplicates of *(p++) into the bit array */ + else + { + cnt = (unsigned int)*p; + p++; + q_end = q + cnt; + while ( q < q_end ) + *q++ = *p; + p++; + } + } + /* absolute mode */ + else + { + q_end = q + cnt; + while ( q < q_end ) + *q++ = *p++; + } + } + } + + /* if compression is desired && possible then attempt compression. The + // following logic will try to compress the data. If the compressed data + // requires more space than the uncompressed data then the bits will be + // stored in an uncompressed format */ + if ( try_compression != 0 && img.bits_per_pixel == 8 ) + { + p = rawbits; + r = bits; + new_bit_size = 0; + cnt = 0; + while ( p < rawbits + rawbit_size && new_bit_size < bit_size ) + { + q = p; + while ( q < p + BITScanWidth ) + { + t = q; + while ( t < q + 255 && t < p + BITScanWidth ) + { + /* look for non-repeats - absolute mode */ + if ( *t != *(t+1) ) + { + while ( *t != *(t+1) && + cnt < 255 && + t < p + BITScanWidth ) + { + t++; + cnt++; + } + cnt++; + *r++ = (unsigned char)cnt; + memcpy( (void *)r, (void *)q, cnt ); + r += cnt; + q += cnt; + new_bit_size += 1 + cnt; + cnt = 0; + } + /* else look for repeats */ + else + { + while ( *t == *(t+1) && + cnt < 255 && + t < p + BITScanWidth ) + { + t++; + cnt++; + } + cnt++; + if ( cnt > 2 ) + { + *r++ = 0; + *r++ = (unsigned char)cnt; + *r++ = *(t-1); + new_bit_size += 3; + q = t; + cnt = 0; + } + /* use absolute mode if we have reached the EOL && + // cnt <= 2 */ + else if ( t >= p + BITScanWidth ) + { + *r++ = (unsigned char)cnt; + memcpy( (void *)r, (void *)q, cnt ); + r += cnt; + q += cnt; + new_bit_size += 1 + cnt; + cnt = 0; + } + } + } + + /* put an EOL marker here */ + *r++ = 0; + *r++ = 0; + new_bit_size += 2; + cnt = 0; + } + + p += BITScanWidth; + } + + /* put the EOB marker here */ + if ( new_bit_size < bit_size - 2 ) + { + *r++ = 0; + *r = 1; + new_bit_size += 2; + } + else + new_bit_size = bit_size + 1; + + /* if the compressed image will take less space then use it */ + if ( new_bit_size < bit_size ) + { + bmih.biCompression = BI_RLE8; + bmih.biSizeImage = bit_size = new_bit_size; + } + } + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/liblinux/jpegrw.h b/libmupen64plus/mupen64plus-video-rice/src/liblinux/jpegrw.h new file mode 100644 index 0000000000..8745c0b5a3 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/liblinux/jpegrw.h @@ -0,0 +1,36 @@ +#ifndef _JPEG_RW_H_ +#define _JPEG_RW_H_ +/* +// header file for the BMGLib JPEG functions +// +// Copyright 2000, 2001 M. Scott Heiman +// All Rights Reserved +// libJPEG is Copyright (C) 1991-1998, Thomas G. Lane and is part of the +// Independent JPEG Group's software. +// +// We are releasing this software for both noncommercial and commercial use. +// Companies are welcome to use it as the basis for JPEG-related products. +// We do not ask a royalty, although we do ask for an acknowledgement in +// product literature (see the README file in the distribution for details). +// We hope to make this software industrial-quality --- although, as with +// anything that's free, we offer no warranty and accept no liability. +*/ +#include "BMGImage.h" + +#if defined(__cplusplus) +extern "C" { +#endif + +extern BMGError ReadJPEG( const char *filename, + struct BMGImageStruct *img ); + +extern BMGError WriteJPEG( const char *filename, + struct BMGImageStruct img, + int quality ); + +#if defined(__cplusplus) + } +#endif + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/liblinux/pngrw.c b/libmupen64plus/mupen64plus-video-rice/src/liblinux/pngrw.c new file mode 100644 index 0000000000..42c2ac9ffe --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/liblinux/pngrw.c @@ -0,0 +1,701 @@ +/* +// source code for the ImageLib PNG functions +// +// Copyright (C) 2001 M. Scott Heiman +// All Rights Reserved +// +// You may use the software for any purpose you see fit. You may modify +// it, incorporate it in a commercial application, use it for school, +// even turn it in as homework. You must keep the Copyright in the +// header and source files. This software is not in the "Public Domain". +// You may use this software at your own risk. I have made a reasonable +// effort to verify that this software works in the manner I expect it to; +// however,... +// +// THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" AND +// WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, INCLUDING +// WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A +// PARTICULAR PURPOSE. IN NO EVENT SHALL MICHAEL S. HEIMAN BE LIABLE TO +// YOU OR ANYONE ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR +// CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING +// WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, +// OR THE CLAIMS OF THIRD PARTIES, WHETHER OR NOT MICHAEL S. HEIMAN HAS +// BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE +// POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +#include "BMGUtils.h" +#include +#include +#include +#ifdef _BMG_LIBPNG_STANDALONE +#include "BMGLibPNG.h" +#else +#include "pngrw.h" +#endif +#include + +#ifndef png_jmpbuf +# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) +#endif + + +/* this stuff is necessary because the normal png_init_io() method crashes in Win32 */ +static void user_read_data(png_structp png_read, png_bytep data, png_size_t length) +{ + FILE *fPtr = (FILE *) png_get_io_ptr(png_read); + if (fread(data, 1, length, fPtr) != length) + fprintf(stderr, "Failed to read %i bytes from PNG file.\n", (int) length); +} + +static void user_write_data(png_structp png_write, png_bytep data, png_size_t length) +{ + FILE *fPtr = (FILE *) png_get_io_ptr(png_write); + if (fwrite(data, 1, length, fPtr) != length) + fprintf(stderr, "Failed to write %i bytes to PNG file.\n", (int) length); +} + +static void user_flush_data(png_structp png_read) +{ + FILE *fPtr = (FILE *) png_get_io_ptr(png_read); + fflush(fPtr); +} + +/* +ReadPNG - Reads the contents of a PNG file and stores the contents into + BMGImageStruct + +Inputs: + filename - the name of the file to be opened + +Outputs: + img - the BMGImageStruct containing the image data + +Returns: + BMGError - if the file could not be read or a resource error occurred + BMG_OK - if the file was read and the data was stored in img + +Limitations: + None. + +Comments: + 2-bit images are converted to 4-bit images. + 16-bit images are converted to 8-bit images. + gray scale images with alpha components are converted to 32-bit images +*/ +BMGError ReadPNG( const char *filename, + struct BMGImageStruct * volatile img ) +{ + jmp_buf err_jmp; + int error; + + FILE * volatile file = NULL; + int BitDepth; + int ColorType; + int InterlaceType; + unsigned char signature[8]; + png_structp volatile png_ptr = NULL; + png_infop volatile info_ptr = NULL; + png_infop volatile end_info = NULL; + png_color_16 *ImageBackground = NULL; + png_bytep trns = NULL; + int NumTrans = 0; + int i, k; + png_color_16p TransColors = NULL; + png_uint_32 Width, Height; + + unsigned char *bits; + unsigned char** volatile rows = NULL; + + BMGError tmp; + + /* error handler */ + error = setjmp( err_jmp ); + if (error != 0) + { + if (end_info != NULL) + png_destroy_read_struct((png_structp *) &png_ptr, (png_infop *) &info_ptr, (png_infop *) &end_info); + else if (info_ptr != NULL) + png_destroy_read_struct((png_structp *) &png_ptr, (png_infop *) &info_ptr, NULL); + else if (png_ptr != NULL) + png_destroy_read_struct((png_structp *) &png_ptr, NULL, NULL); + if (rows) + { + if (rows[0]) + free(rows[0]); + free(rows); + } + if (img) + FreeBMGImage(img); + if (file) + fclose(file); + SetLastBMGError((BMGError) error); + return (BMGError) error; + } + + if ( img == NULL ) + longjmp ( err_jmp, (int)errInvalidBMGImage ); + + file = fopen( filename, "rb" ); + if ( !file || fread( signature, 1, 8, file ) != 8) + longjmp ( err_jmp, (int)errFileOpen ); + + /* check the signature */ + if ( png_sig_cmp( signature, 0, 8 ) != 0 ) + longjmp( err_jmp, (int)errUnsupportedFileFormat ); + + /* create a pointer to the png read structure */ + png_ptr = png_create_read_struct( PNG_LIBPNG_VER_STRING, NULL, NULL, NULL ); + if ( !png_ptr ) + longjmp( err_jmp, (int)errMemoryAllocation ); + + /* create a pointer to the png info structure */ + info_ptr = png_create_info_struct( png_ptr ); + if ( !info_ptr ) + longjmp( err_jmp, (int)errMemoryAllocation ); + + /* create a pointer to the png end-info structure */ + end_info = png_create_info_struct(png_ptr); + if (!end_info) + longjmp( err_jmp, (int)errMemoryAllocation ); + + /* bamboozle the PNG longjmp buffer */ + /*generic PNG error handler*/ + /* error will always == 1 which == errLib */ +// error = png_setjmp(png_ptr); + error = setjmp( png_jmpbuf( png_ptr ) ); + if ( error > 0 ) + longjmp( err_jmp, error ); + + /* set function pointers in the PNG library, for read callbacks */ + png_set_read_fn(png_ptr, (png_voidp) file, user_read_data); + + /*let the read functions know that we have already read the 1st 8 bytes */ + png_set_sig_bytes( png_ptr, 8 ); + + /* read all PNG data up to the image data */ + png_read_info( png_ptr, info_ptr ); + + /* extract the data we need to form the HBITMAP from the PNG header */ + png_get_IHDR( png_ptr, info_ptr, &Width, &Height, &BitDepth, &ColorType, + &InterlaceType, NULL, NULL); + + img->width = (unsigned int) Width; + img->height = (unsigned int) Height; + + img->bits_per_pixel = (unsigned char)32; + img->scan_width = Width * 4; + + /* convert 16-bit images to 8-bit images */ + if (BitDepth == 16) + png_set_strip_16(png_ptr); + + /* These are not really required per Rice format spec, + * but is done just in case someone uses them. + */ + /* convert palette color to rgb color */ + if (ColorType == PNG_COLOR_TYPE_PALETTE) { + png_set_palette_to_rgb(png_ptr); + ColorType = PNG_COLOR_TYPE_RGB; + } + + /* expand 1,2,4 bit gray scale to 8 bit gray scale */ + if (ColorType == PNG_COLOR_TYPE_GRAY && BitDepth < 8) + png_set_expand_gray_1_2_4_to_8(png_ptr); + + /* convert gray scale or gray scale + alpha to rgb color */ + if (ColorType == PNG_COLOR_TYPE_GRAY || + ColorType == PNG_COLOR_TYPE_GRAY_ALPHA) { + png_set_gray_to_rgb(png_ptr); + ColorType = PNG_COLOR_TYPE_RGB; + } + + /* add alpha channel if any */ + if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { + png_set_tRNS_to_alpha(png_ptr); + ColorType = PNG_COLOR_TYPE_RGB_ALPHA; + } + + /* convert rgb to rgba */ + if (ColorType == PNG_COLOR_TYPE_RGB) { + png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER); + ColorType = PNG_COLOR_TYPE_RGB_ALPHA; + } + + png_set_bgr(png_ptr); + + /* set the background color if one is found */ + if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_bKGD) ) + png_get_bKGD(png_ptr, info_ptr, &ImageBackground); + + /* get the transparent color if one is there */ + if ( png_get_valid( png_ptr, info_ptr, PNG_INFO_tRNS ) ) + png_get_tRNS( png_ptr, info_ptr, &trns, &NumTrans, &TransColors ); + + img->palette_size = (unsigned short)0; + img->bytes_per_palette_entry = 4U; + + tmp = AllocateBMGImage( img ); + if ( tmp != BMG_OK ) + longjmp( err_jmp, (int)tmp ); + + png_read_update_info( png_ptr, info_ptr ); + + /* create buffer to read data to */ + rows = (unsigned char **)malloc(Height*sizeof(unsigned char *)); + if ( !rows ) + longjmp( err_jmp, (int)errMemoryAllocation ); + + k = png_get_rowbytes( png_ptr, info_ptr ); + rows[0] = (unsigned char *)malloc( Height*k*sizeof(char)); + if ( !rows[0] ) + longjmp( err_jmp, (int)errMemoryAllocation ); + + for ( i = 1; i < (int)Height; i++ ) + rows[i] = rows[i-1] + k; + + /* read the entire image into rows */ + png_read_image( png_ptr, rows ); + + bits = img->bits + (Height - 1) * img->scan_width; + for ( i = 0; i < (int)Height; i++ ) + { + memcpy(bits, rows[i], 4*Width); + bits -= img->scan_width; + } + + free( rows[0] ); + free( rows ); + png_read_end( png_ptr, info_ptr ); + png_destroy_read_struct((png_structp *) &png_ptr, (png_infop *) &info_ptr, (png_infop *) &end_info); + fclose( file ); + + return BMG_OK; +} + +BMGError ReadPNGInfo( const char *filename, + struct BMGImageStruct * volatile img ) +{ + jmp_buf err_jmp; + int error; + + FILE * volatile file = NULL; + int BitDepth; + int ColorType; + int InterlaceType; + unsigned char signature[8]; + png_structp volatile png_ptr = NULL; + png_infop volatile info_ptr = NULL; + png_infop volatile end_info = NULL; + png_uint_32 Width, Height; + + /* error handler */ + error = setjmp( err_jmp ); + if (error != 0) + { + if (end_info != NULL) + png_destroy_read_struct((png_structp *) &png_ptr, (png_infop *) &info_ptr, (png_infop *) &end_info); + else if (info_ptr != NULL) + png_destroy_read_struct((png_structp *) &png_ptr, (png_infop *) &info_ptr, NULL); + else if (png_ptr != NULL) + png_destroy_read_struct((png_structp *) &png_ptr, NULL, NULL); + if (img) + FreeBMGImage(img); + if (file) + fclose(file); + SetLastBMGError((BMGError) error); + return (BMGError) error; + } + + if ( img == NULL ) + longjmp ( err_jmp, (int)errInvalidBMGImage ); + + file = fopen( filename, "rb" ); + if ( !file || fread( signature, 1, 8, file ) != 8) + longjmp ( err_jmp, (int)errFileOpen ); + + /* check the signature */ + if ( png_sig_cmp( signature, 0, 8 ) != 0 ) + longjmp( err_jmp, (int)errUnsupportedFileFormat ); + + /* create a pointer to the png read structure */ + png_ptr = png_create_read_struct( PNG_LIBPNG_VER_STRING, NULL, NULL, NULL ); + if ( !png_ptr ) + longjmp( err_jmp, (int)errMemoryAllocation ); + + /* create a pointer to the png info structure */ + info_ptr = png_create_info_struct( png_ptr ); + if ( !info_ptr ) + longjmp( err_jmp, (int)errMemoryAllocation ); + + /* create a pointer to the png end-info structure */ + end_info = png_create_info_struct(png_ptr); + if (!end_info) + longjmp( err_jmp, (int)errMemoryAllocation ); + + /* bamboozle the PNG longjmp buffer */ + /*generic PNG error handler*/ + /* error will always == 1 which == errLib */ +// error = png_setjmp(png_ptr); + error = setjmp( png_jmpbuf( png_ptr ) ); + if ( error > 0 ) + longjmp( err_jmp, error ); + + /* set function pointers in the PNG library, for read callbacks */ + png_set_read_fn(png_ptr, (png_voidp) file, user_read_data); + + /*let the read functions know that we have already read the 1st 8 bytes */ + png_set_sig_bytes( png_ptr, 8 ); + + /* read all PNG data up to the image data */ + png_read_info( png_ptr, info_ptr ); + + /* extract the data we need to form the HBITMAP from the PNG header */ + png_get_IHDR( png_ptr, info_ptr, &Width, &Height, &BitDepth, &ColorType, + &InterlaceType, NULL, NULL); + + img->width = (unsigned int) Width; + img->height = (unsigned int) Height; + + img->bits_per_pixel = (unsigned char)32; + img->scan_width = Width * 4; + + img->palette_size = (unsigned short)0; + img->bytes_per_palette_entry = 4U; + img->bits = NULL; + + png_destroy_read_struct((png_structp *) &png_ptr, (png_infop *) &info_ptr, (png_infop *) &end_info); + fclose( file ); + + return BMG_OK; +} + +/* +WritePNG - writes the contents of a BMGImageStruct to a PNG file. + +Inputs: + filename - the name of the file to be opened + img - the BMGImageStruct containing the image data + +Returns: + 0 - if the file could not be written or a resource error occurred + 1 - if the file was written + +Comments: + 16-BPP BMG Images are converted to 24-BPP images + +Limitations: + Color Type is limited to PNG_COLOR_TYPE_GRAY, PNG_COLOR_TYPE_RGB_ALPHA, + PNG_COLOR_TYPE_RGB, & PNG_COLOR_TYPE_PALETTE; +*/ +BMGError WritePNG( const char *filename, struct BMGImageStruct img ) +{ + jmp_buf err_jmp; + int error = 0; + int BitDepth = 0; + int ColorType = 0; + png_structp png_ptr = NULL; + png_infop info_ptr = NULL; + png_colorp PNGPalette = NULL; + int GrayScale; + + unsigned char *bits, *p, *q; + unsigned char **rows = NULL; + int NumColors = 0; + + int DIBScanWidth; + int HasPalette; + FILE *outfile = NULL; + int i; + BMGError tmp; + + /* error handler */ + error = setjmp( err_jmp ); + fprintf(stderr,"Writing PNG file %s.\n", filename); + if ( error != 0 ) + { + if ( png_ptr != NULL ) + png_destroy_write_struct( &png_ptr, NULL ); + if ( rows ) + { + if ( rows[0] ) + { + free( rows[0] ); + } + free( rows ); + } + if ( PNGPalette ) + free( PNGPalette ); + if (outfile) + { + fclose( outfile ); + } + SetLastBMGError( (BMGError)error ); + return (BMGError)error; + } + + SetLastBMGError( BMG_OK ); + /* open the file */ + if ((outfile = fopen(filename, "wb")) == NULL) + { + fprintf(stderr, "Error opening %s for reading.\n", filename); + longjmp( err_jmp, (int)errFileOpen ); + } + + /* 16 BPP DIBS do not have palettes. libPNG expects 16 BPP images to have + a palette. To correct this situation we must convert 16 BPP images to + 24 BPP images before saving the data to the file */ + if ( img.bits_per_pixel == 16 ) + { + tmp = Convert16to24( &img ); + if ( tmp != BMG_OK ) + longjmp( err_jmp, (int)tmp ); + } + + HasPalette = img.bits_per_pixel <= 8; + if ( HasPalette ) + { + NumColors = img.palette_size; + /* if this is a grayscale image then set the flag and delete the palette*/ + i = 0; + bits = img.palette; + while ( i < NumColors && bits[0] == bits[1] && bits[0] == bits[2] ) + { + i++; + bits += img.bytes_per_palette_entry; + } + GrayScale = i == NumColors; + } + else + GrayScale = 0; + + /* dimensions */ + DIBScanWidth = ( img.width * img.bits_per_pixel + 7 ) / 8; + + /* create the png pointer */ + png_ptr = png_create_write_struct( PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + if ( !png_ptr ) + longjmp( err_jmp, (int)errMemoryAllocation ); + + /* create the info pointer */ + info_ptr = png_create_info_struct( png_ptr ); + if ( !info_ptr ) + longjmp( err_jmp, (int)errMemoryAllocation ); + + /* bamboozle the png error handler */ + /* error will always == 1 which equals errLib */ +// error = png_setjmp(png_ptr); + error = setjmp( png_jmpbuf( png_ptr ) ); + if ( error > 0 ) + longjmp( err_jmp, error ); + + /* set function pointers in the PNG library, for write callbacks */ + png_set_write_fn(png_ptr, (png_voidp) outfile, user_write_data, user_flush_data); + + /* prepare variables needed to create PNG header */ + BitDepth = img.bits_per_pixel < 8 ? img.bits_per_pixel : 8; + + /* determine color type */ + if ( GrayScale ) + ColorType = PNG_COLOR_TYPE_GRAY; + else if ( img.bits_per_pixel == 32 ) + ColorType = PNG_COLOR_TYPE_RGB_ALPHA; + else if ( img.bits_per_pixel == 24 ) + ColorType = PNG_COLOR_TYPE_RGB; + else + ColorType = PNG_COLOR_TYPE_PALETTE; + + /* create the PNG header */ + png_set_IHDR( png_ptr, info_ptr, img.width, img.height, BitDepth, ColorType, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE ); + + /* store the palette information if there is any */ + if ( img.palette != NULL && !GrayScale ) + { + PNGPalette = (png_colorp)png_malloc( png_ptr, + NumColors*sizeof(png_color)); + if ( PNGPalette ) + { + bits = img.palette; + for ( i = 0; i < NumColors; i++, bits += img.bytes_per_palette_entry ) + { + PNGPalette[i].red = bits[2]; + PNGPalette[i].green = bits[1]; + PNGPalette[i].blue = bits[0]; + } + png_set_PLTE( png_ptr, info_ptr, PNGPalette, NumColors ); + } + else + longjmp( err_jmp, (int)errMemoryAllocation ); + } + + /* write the file header information */ + png_write_info( png_ptr, info_ptr ); + + /* create array to store data in */ + rows = (unsigned char **)malloc(sizeof(unsigned char*)); + if ( !rows ) + longjmp( err_jmp, (int)errMemoryAllocation ); + rows[0] = (unsigned char *)malloc( DIBScanWidth * sizeof(unsigned char)); + if ( !rows[0] ) + longjmp( err_jmp, (int)errMemoryAllocation ); + +/* point to the bottom row of the DIB data. DIBs are stored bottom-to-top, + PNGs are stored top-to-bottom. */ + bits = img.bits + (img.height - 1) * img.scan_width; + + /* store bits */ + for ( i = 0; i < (int)img.height; i++ ) + { + switch ( img.bits_per_pixel ) + { + case 1: + case 4: + case 8: + memcpy( (void *)rows[0], (void *)bits, DIBScanWidth ); + break; + case 24: + q = bits; + for ( p = rows[0]; p < rows[0] + DIBScanWidth; p += 3, q += 3 ) + { + p[0] = q[2]; + p[1] = q[1]; + p[2] = q[0]; + } + break; + case 32: + q = bits; + for ( p = rows[0]; p < rows[0] + DIBScanWidth; p += 4, q += 4 ) + { + p[3] = q[3]; + p[0] = q[2]; + p[1] = q[1]; + p[2] = q[0]; + } + break; + } + + png_write_rows( png_ptr, rows, 1 ); + bits -= img.scan_width; + } + + /* finish writing the rest of the file */ + png_write_end( png_ptr, info_ptr ); + + /* clean up and exit */ + if ( PNGPalette ) + free( PNGPalette ); + free( rows[0] ); + free( rows ); + png_destroy_write_struct( &png_ptr, NULL ); + fclose( outfile ); + + return BMG_OK; +} + +#ifdef _BMG_LIBPNG_STANDALONE +#pragma message ("Creating BMGLibPNG functions") + +#ifdef _WIN32 +/* saves the contents of an HBITMAP to a file. returns 1 if successfull, + // 0 otherwise */ + BMGError SaveBitmapToPNGFile( HBITMAP hBitmap, /* bitmap to be saved */ + const char *filename) /* name of output file */ +{ + struct BMGImageStruct img; + char msg[256], ext[4], *period; + BMGError out = BMG_OK; + + InitBMGImage( &img ); + + /* determine the file type by using the extension */ + strcpy( msg, filename ); + period = strrchr( msg, '.' ); + if ( period != NULL ) + { + period++; + strcpy( ext, period ); + ext[0] = toupper( ext[0] ); + ext[1] = toupper( ext[1] ); + ext[2] = toupper( ext[2] ); + ext[3] = 0; + } + else + { + strcat( msg, ".PNG" ); + strcpy( ext, "PNG" ); + } + + if ( strcmp( ext, "PNG" ) == 0 ) + { +/* extract data from the bitmap. We assume that 32 bit images have been +// blended with the background (unless this is a DDB - see GetDataFromBitmap + // for more details) */ + out = GetDataFromBitmap( hBitmap, &img, 1 ); + if ( out == BMG_OK ) + { + out = WritePNG( msg, img ); + } + FreeBMGImage( &img ); + } + else + { + out = errInvalidFileExtension; + } + + SetLastBMGError( out ); + return out; +} +#endif // _WIN32 + +/* Creates an HBITMAP to an image file. returns an HBITMAP if successfull, +// NULL otherwise */ +HBITMAP CreateBitmapFromPNGFile( const char *filename, + int blend ) +{ + char ext[4], msg[256]; + char *period; + BMGError out = BMG_OK; + struct BMGImageStruct img; + HBITMAP hBitmap = NULL; + + InitBMGImage( &img ); + img.opt_for_bmp = 1; + + strcpy( msg, filename ); + period = strrchr( msg, '.' ); + if ( period != NULL ) + { + period++; + strncpy( ext, period, 3 ); + ext[0] = toupper( ext[0] ); + ext[1] = toupper( ext[1] ); + ext[2] = toupper( ext[2] ); + ext[3] = 0; + } + else + { + strcat( msg, ".PNG" ); + strcpy( ext, "PNG" ); + } + + if ( strcmp( ext, "PNG" ) == 0 ) + { + out = ReadPNG( msg, &img ); + if ( out == BMG_OK ) + { + hBitmap = CreateBitmapFromData( img, blend ); + } + FreeBMGImage( &img ); + } + else + { + out = errInvalidFileExtension; + } + + SetLastBMGError( out ); + return hBitmap; +} + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/liblinux/pngrw.h b/libmupen64plus/mupen64plus-video-rice/src/liblinux/pngrw.h new file mode 100644 index 0000000000..077b134ffe --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/liblinux/pngrw.h @@ -0,0 +1,55 @@ +#ifndef _PNG_RW_H_ +#define _PNG_RW_H_ +/* +// header file for the BMGLib PNG functions +// +// Copyright 2000, 2001 M. Scott Heiman +// All Rights Reserved +// libPNG is Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. +// (libpng versions 0.5, May 1995, through 0.89c, May 1996) +// Copyright (c) 1996, 1997 Andreas Dilger +// (libpng versions 0.90, December 1996, through 0.96, May 1997) +// Copyright (c) 1998, 1999 Glenn Randers-Pehrson +// (libpng versions 0.97, January 1998, through 1.0.5, October 15, 1999) +// +// You may use the software for any purpose you see fit. You may modify +// it, incorporate it in a commercial application, use it for school, +// even turn it in as homework. You must keep the Copyright in the +// header and source files. This software is not in the "Public Domain". +// You may use this software at your own risk. I have made a reasonable +// effort to verify that this software works in the manner I expect it to; +// however,... +// +// THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" AND +// WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, INCLUDING +// WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A +// PARTICULAR PURPOSE. IN NO EVENT SHALL MICHAEL S. HEIMAN BE LIABLE TO +// YOU OR ANYONE ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR +// CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING +// WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, +// OR THE CLAIMS OF THIRD PARTIES, WHETHER OR NOT MICHAEL S. HEIMAN HAS +// BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE +// POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +#include "BMGImage.h" + +#if defined(__cplusplus) +extern "C" { +#endif + +extern +BMGError ReadPNG( const char *filename, struct BMGImageStruct * volatile img ); +extern +BMGError ReadPNGInfo( const char *filename, struct BMGImageStruct * volatile img ); + +extern +BMGError WritePNG( const char *filename, + struct BMGImageStruct img ); + +#if defined(__cplusplus) + } +#endif + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/liblinux/tiffrw.h b/libmupen64plus/mupen64plus-video-rice/src/liblinux/tiffrw.h new file mode 100644 index 0000000000..863d05d325 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/liblinux/tiffrw.h @@ -0,0 +1,75 @@ +#ifndef _TIFF_RW_H_ +#define _TIFF_RW_H_ +/* +// header file defining BMGLib libTIFF structures and functions +// +// Copyright 2000, 2001 Scott Heiman +// libTIFF is Copyright Sam Leffler and SGI +// zLib Copyright (C) 1995-1998 Jean-loup Gailly. +// +// Permission to use, copy, modify, distribute, and sell this software and +// its documentation for any purpose is hereby granted without fee, provided +// that (i) the above copyright notices and this permission notice appear in +// all copies of the software and related documentation, and (ii) the names of +// Sam Leffler and Silicon Graphics may not be used in any advertising or +// publicity relating to the software without the specific, prior written +// permission of Sam Leffler and Silicon Graphics. +// +// THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +// EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +// WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +// +// IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +// ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +// OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +// WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +// LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +// OF THIS SOFTWARE. +*/ + +#include "BMGImage.h" + +/* enumeration types that support libTIFF */ +enum TiffCompressionEnum { NONE, CCITTRLE, CCITTFAX3, CCITTFAX4, LZW, JPEG6, + JPEG_DCT, NeXT, CCITTRLEW, MACINTOSH, THUNDERSCAN, + PIXARFILM, PIXARLOG, ZIP, KODAK, JBIG }; +enum TiffPhotometricEnum { MINISWHITE, MINISBLACK, RGB, PALETTE, MASK, + SEPARATED, YCBCR, CIELAB, CIE_LOGL, CIE_LOGLUV }; +enum TiffOrientationEnum { TOPLEFT, BOTTOMLEFT }; + +typedef enum TiffCompressionEnum TiffCompression; +typedef enum TiffPhotometricEnum TiffPhotometric; +typedef enum TiffOrientationEnum TiffOrientation; + +#pragma pack(push,1) +struct TIFFInfoStruct +{ + TiffCompression compression; + TiffPhotometric photometric; + TiffOrientation orientation; + unsigned short predictor; +}; +#pragma pack(pop) + +#if defined(__cplusplus) +extern "C" { +#endif + +extern +BMGError ReadTIFF( const char *filename, + struct BMGImageStruct *img, + struct TIFFInfoStruct *info ); + +extern +BMGError WriteTIFF( const char *filename, + struct BMGImageStruct img, + struct TIFFInfoStruct *info ); + + +#if defined(__cplusplus) + } +#endif + + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/osal_dynamiclib.h b/libmupen64plus/mupen64plus-video-rice/src/osal_dynamiclib.h new file mode 100644 index 0000000000..c24377b178 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/osal_dynamiclib.h @@ -0,0 +1,38 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - osal/dynamiclib.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#if !defined(OSAL_DYNAMICLIB_H) +#define OSAL_DYNAMICLIB_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "m64p_types.h" + +void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName); + +#ifdef __cplusplus +} +#endif + +#endif /* #define OSAL_DYNAMICLIB_H */ + diff --git a/libmupen64plus/mupen64plus-video-rice/src/osal_dynamiclib_unix.c b/libmupen64plus/mupen64plus-video-rice/src/osal_dynamiclib_unix.c new file mode 100644 index 0000000000..b3b7ba52dc --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/osal_dynamiclib_unix.c @@ -0,0 +1,37 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - osal/dynamiclib_unix.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include + +#include "m64p_types.h" +#include "osal_dynamiclib.h" + +void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName) +{ + if (pccProcedureName == NULL) + return NULL; + + return dlsym(LibHandle, pccProcedureName); +} + + diff --git a/libmupen64plus/mupen64plus-video-rice/src/osal_dynamiclib_win32.c b/libmupen64plus/mupen64plus-video-rice/src/osal_dynamiclib_win32.c new file mode 100644 index 0000000000..4455cee52b --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/osal_dynamiclib_win32.c @@ -0,0 +1,74 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-ui-console - osal_dynamiclib_win32.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include + +#include "m64p_types.h" +#include "osal_dynamiclib.h" + +m64p_error osal_dynlib_open(m64p_dynlib_handle *pLibHandle, const char *pccLibraryPath) +{ + if (pLibHandle == NULL || pccLibraryPath == NULL) + return M64ERR_INPUT_ASSERT; + + *pLibHandle = LoadLibrary(pccLibraryPath); + + if (*pLibHandle == NULL) + { + char *pchErrMsg; + DWORD dwErr = GetLastError(); + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pchErrMsg, 0, NULL); + fprintf(stderr, "LoadLibrary('%s') error: %s\n", pccLibraryPath, pchErrMsg); + LocalFree(pchErrMsg); + return M64ERR_INPUT_NOT_FOUND; + } + + return M64ERR_SUCCESS; +} + +void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName) +{ + if (pccProcedureName == NULL) + return NULL; + + return GetProcAddress(LibHandle, pccProcedureName); +} + +m64p_error osal_dynlib_close(m64p_dynlib_handle LibHandle) +{ + int rval = FreeLibrary(LibHandle); + + if (rval == 0) + { + char *pchErrMsg; + DWORD dwErr = GetLastError(); + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pchErrMsg, 0, NULL); + fprintf(stderr, "FreeLibrary() error: %s\n", pchErrMsg); + LocalFree(pchErrMsg); + return M64ERR_INTERNAL; + } + + return M64ERR_SUCCESS; +} diff --git a/libmupen64plus/mupen64plus-video-rice/src/osal_files.h b/libmupen64plus/mupen64plus-video-rice/src/osal_files.h new file mode 100644 index 0000000000..9b464499a5 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/osal_files.h @@ -0,0 +1,62 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-ui-console - osal_files.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This header file is for all kinds of system-dependent file handling + * + */ + +#if !defined(OSAL_FILES_H) +#define OSAL_FILES_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "m64p_types.h" + +#if defined(WIN32) + #define PATH_MAX _MAX_PATH + #define OSAL_DIR_SEPARATOR_STR "\\" + #define OSAL_DIR_SEPARATOR_CHAR '\\' +#else /* Not WIN32 */ + #include // for PATH_MAX + #define OSAL_DIR_SEPARATOR_STR "/" + #define OSAL_DIR_SEPARATOR_CHAR '/' + + /* PATH_MAX only may be defined by limits.h */ + #ifndef PATH_MAX + #define PATH_MAX 4096 + #endif +#endif + +int osal_is_directory(const char* name); +int osal_mkdirp(const char *dirpath, int mode); + +void * osal_search_dir_open(const char *pathname); +const char *osal_search_dir_read_next(void * dir_handle); +void osal_search_dir_close(void * dir_handle); + +#ifdef __cplusplus +} +#endif + +#endif /* #define OSAL_FILES_H */ + diff --git a/libmupen64plus/mupen64plus-video-rice/src/osal_files_unix.c b/libmupen64plus/mupen64plus-video-rice/src/osal_files_unix.c new file mode 100644 index 0000000000..c586f9796d --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/osal_files_unix.c @@ -0,0 +1,116 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - osal_files_unix.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This file contains the definitions for the unix-specific file handling + * functions + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "osal_files.h" + +/* global functions */ + +int osal_is_directory(const char* name) +{ + DIR* dir; + dir = opendir(name); + if(dir != NULL) + { + closedir(dir); + return 1; + } + return 0; +} + +int osal_mkdirp(const char *dirpath, int mode) +{ + struct stat fileinfo; + int dirpathlen = strlen(dirpath); + char *currpath = strdup(dirpath); + + /* first, break the path into pieces by replacing all of the slashes wil NULL chars */ + while (strlen(currpath) > 1) + { + char *lastslash = strrchr(currpath, '/'); + if (lastslash == NULL) + break; + *lastslash = 0; + } + + /* then re-assemble the path from left to right until we get to a directory that doesn't exist */ + while (strlen(currpath) < dirpathlen) + { + if (strlen(currpath) > 0 && stat(currpath, &fileinfo) != 0) + break; + currpath[strlen(currpath)] = '/'; + } + + /* then walk up the path chain, creating directories along the way */ + do + { + if (stat(currpath, &fileinfo) != 0) + { + if (mkdir(currpath, mode) != 0) + { + free(currpath); + return 1; /* mkdir failed */ + } + } + if (strlen(currpath) == dirpathlen) + break; + else + currpath[strlen(currpath)] = '/'; + } while (1); + + free(currpath); + return 0; +} + +void * osal_search_dir_open(const char *pathname) +{ + DIR *dir; + dir = opendir(pathname); + return dir; +} + +const char *osal_search_dir_read_next(void * dir_handle) +{ + DIR *dir = (DIR *) dir_handle; + struct dirent *entry; + + entry = readdir(dir); + if (entry == NULL) + return NULL; + return entry->d_name; +} + +void osal_search_dir_close(void * dir_handle) +{ + closedir((DIR *) dir_handle); +} + diff --git a/libmupen64plus/mupen64plus-video-rice/src/osal_files_win32.c b/libmupen64plus/mupen64plus-video-rice/src/osal_files_win32.c new file mode 100644 index 0000000000..cfddd212b0 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/osal_files_win32.c @@ -0,0 +1,145 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - osal_files_win32.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This file contains the definitions for the unix-specific file handling + * functions + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "osal_files.h" + +/* global functions */ + +int osal_is_directory(const char* name) +{ + char DirName[MAX_PATH + 1]; + int namelen = 0; + + /* we must remove any trailing backslash on the end of the pathname, or this will fail */ + strncpy(DirName, name, MAX_PATH); + DirName[MAX_PATH] = 0; + namelen = strlen(DirName); + if (namelen > 0 && DirName[namelen-1] == '\\') + DirName[namelen-1] = 0; + return (GetFileAttributes(DirName) & FILE_ATTRIBUTE_DIRECTORY); +} + +int osal_mkdirp(const char *dirpath, int mode) +{ + struct _stat fileinfo; + size_t dirpathlen = strlen(dirpath); + char *currpath = _strdup(dirpath); + + /* first, remove sub-dirs on the end (by replacing slashes with NULL chars) until we find an existing directory */ + while (strlen(currpath) > 1 && _stat(currpath, &fileinfo) != 0) + { + char *lastslash = strrchr(currpath, '\\'); + if (lastslash == NULL) + { + free(currpath); + return 1; /* error: we never found an existing directory, this path is bad */ + } + *lastslash = 0; + } + + /* then walk up the path chain, creating directories along the way */ + do + { + if (currpath[strlen(currpath)-1] != '\\' && _stat(currpath, &fileinfo) != 0) + { + if (_mkdir(currpath) != 0) + { + free(currpath); + return 2; /* mkdir failed */ + } + } + if (strlen(currpath) == dirpathlen) + break; + else + currpath[strlen(currpath)] = '\\'; + } while (1); + + free(currpath); + return 0; +} + +typedef struct { + HANDLE hFind; + WIN32_FIND_DATA find_data; +} dir_search_info; + +void * osal_search_dir_open(const char *pathname) +{ + char SearchString[MAX_PATH + 1]; + dir_search_info *pInfo = malloc(sizeof(dir_search_info)); + + if (pInfo == NULL) + return NULL; + + pInfo->hFind = INVALID_HANDLE_VALUE; + pInfo->find_data.cFileName[0] = 0; + + if (pathname[strlen(pathname)-1] == '\\') + _snprintf(SearchString, MAX_PATH, "%s*", pathname); + else + _snprintf(SearchString, MAX_PATH, "%s\\*", pathname); + SearchString[MAX_PATH] = 0; + + pInfo->hFind = FindFirstFile(SearchString, &pInfo->find_data); + return (void *) pInfo; +} + +const char *osal_search_dir_read_next(void * search_info) +{ + static char last_filename[_MAX_PATH]; + dir_search_info *pInfo = (dir_search_info *) search_info; + + if (pInfo == NULL || pInfo->hFind == INVALID_HANDLE_VALUE || pInfo->find_data.cFileName[0] == 0) + return NULL; + + strcpy(last_filename, pInfo->find_data.cFileName); + + if (FindNextFile(pInfo->hFind, &pInfo->find_data) == 0) + { + pInfo->find_data.cFileName[0] = 0; + } + + return last_filename; +} + +void osal_search_dir_close(void * search_info) +{ + dir_search_info *pInfo = (dir_search_info *) search_info; + + if (pInfo != NULL) + { + if (pInfo->hFind != INVALID_HANDLE_VALUE) + FindClose(pInfo->hFind); + free(pInfo); + } +} diff --git a/libmupen64plus/mupen64plus-video-rice/src/osal_opengl.h b/libmupen64plus/mupen64plus-video-rice/src/osal_opengl.h new file mode 100644 index 0000000000..df0dbada59 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/osal_opengl.h @@ -0,0 +1,86 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - osal_opengl.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2013 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#if !defined(OSAL_OPENGL_H) +#define OSAL_OPENGL_H + +#include + +#if SDL_VIDEO_OPENGL +#include +#define GLSL_VERSION "120" + +// Extension names +#define OSAL_GL_ARB_MULTITEXTURE "GL_ARB_multitexture" +#define OSAL_GL_ARB_TEXTURE_ENV_ADD "GL_ARB_texture_env_add" + + + +#elif SDL_VIDEO_OPENGL_ES2 +#include +#define GLSL_VERSION "100" + +// Extension names +#define OSAL_GL_ARB_MULTITEXTURE "GL_multitexture" +#define OSAL_GL_ARB_TEXTURE_ENV_ADD "GL_texture_env_add" + +// Vertex shader params +#define VS_POSITION 0 +#define VS_COLOR 1 +#define VS_TEXCOORD0 2 +#define VS_TEXCOORD1 3 + +// Constant substitutions +#define GL_CLAMP GL_CLAMP_TO_EDGE +#define GL_MAX_TEXTURE_UNITS_ARB GL_MAX_TEXTURE_IMAGE_UNITS +#define GL_MIRRORED_REPEAT_ARB GL_MIRRORED_REPEAT +#define GL_TEXTURE0_ARB GL_TEXTURE0 +#define GL_TEXTURE1_ARB GL_TEXTURE1 +#define GL_TEXTURE2_ARB GL_TEXTURE2 +#define GL_TEXTURE3_ARB GL_TEXTURE3 +#define GL_TEXTURE4_ARB GL_TEXTURE4 +#define GL_TEXTURE5_ARB GL_TEXTURE5 +#define GL_TEXTURE6_ARB GL_TEXTURE6 +#define GL_TEXTURE7_ARB GL_TEXTURE7 + +#define GL_ADD 0x0104 +#define GL_MODULATE 0x2100 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PREVIOUS_ARB 0x8578 + +// Function substitutions +#define glClearDepth glClearDepthf +#define pglActiveTexture glActiveTexture +#define pglActiveTextureARB glActiveTexture + +// No-op substitutions (unavailable in GLES2) +#define glLoadIdentity() +#define glMatrixMode(x) +#define glOrtho(a,b,c,d,e,f) +#define glReadBuffer(x) +#define glTexEnvi(x,y,z) +#define glTexEnvfv(x,y,z) +#define glTexCoord2f(u,v) + +#endif // SDL_VIDEO_OPENGL* + +#endif // OSAL_OPENGL_H diff --git a/libmupen64plus/mupen64plus-video-rice/src/osal_preproc.h b/libmupen64plus/mupen64plus-video-rice/src/osal_preproc.h new file mode 100644 index 0000000000..50cefd7a89 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/osal_preproc.h @@ -0,0 +1,96 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - osal_preproc.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * Copyright (C) 2002 Hacktarux * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* this header file is for system-dependent #defines, #includes, and typedefs */ + +#if !defined(OSAL_PREPROC_H) +#define OSAL_PREPROC_H + +#if defined(WIN32) + #include + #if defined(__MINGW32__) + #define ALIGN(BYTES,DATA) DATA __attribute__((aligned(BYTES))); + #else + #define ALIGN(BYTES,DATA) __declspec(align(BYTES)) DATA; + #define strncasecmp _strnicmp + #define strcasecmp _stricmp + #endif +#else + + #define ALIGN(BYTES,DATA) DATA __attribute__((aligned(BYTES))); + +typedef unsigned int BOOL; +typedef void* HBITMAP; + +typedef struct +{ + int top; + int bottom; + int right; + int left; +} RECT; + +#define __cdecl + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef TRUE +#define TRUE 1 +#endif + +typedef struct tagBITMAPINFOHEADER +{ + unsigned int biSize; + int biWidth; + int biHeight; + unsigned short biPlanes; + unsigned short biBitCount; + unsigned int biCompression; + unsigned int biSizeImage; + int biXPelsPerMeter; + int biYPelsPerMeter; + unsigned int biClrUsed; + unsigned int biClrImportant; +} __attribute__ ((packed)) BITMAPINFOHEADER; + +typedef struct tagBITMAPINFO +{ + BITMAPINFOHEADER bmiHeader; + unsigned int unused; +} BITMAPINFO; + +typedef struct tagBITMAPFILEHEADER +{ + unsigned short bfType; + unsigned int bfSize; + unsigned short bfReserved1; + unsigned short bfReserved2; + unsigned int bfOffBits; +} __attribute__ ((packed)) BITMAPFILEHEADER; + +#define BI_RGB 0 + +#endif // WIN32 + +#endif // OSAL_PREPROC_H diff --git a/libmupen64plus/mupen64plus-video-rice/src/typedefs.h b/libmupen64plus/mupen64plus-video-rice/src/typedefs.h new file mode 100644 index 0000000000..89164c248f --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/typedefs.h @@ -0,0 +1,459 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + +#ifndef _TYPEDEFS_H_ +#define _TYPEDEFS_H_ + +#include "osal_preproc.h" +#include "VectorMath.h" + +#define uchar unsigned char +#define uint16 unsigned short +#define uint32 unsigned int +#define uint64 unsigned long long + +typedef unsigned char uint8; + +typedef signed char s8; +typedef int s32; +typedef unsigned int u32; +typedef unsigned char u8; + +typedef unsigned int COLOR; +typedef struct _COORDRECT +{ + int x1,y1; + int x2,y2; +} COORDRECT; +#define COLOR_RGBA(r,g,b,a) (((r&0xFF)<<16) | ((g&0xFF)<<8) | ((b&0xFF)<<0) | ((a&0xFF)<<24)) +#define SURFFMT_A8R8G8B8 21 + +#define RGBA_GETALPHA(rgb) ((rgb) >> 24) +#define RGBA_GETRED(rgb) (((rgb) >> 16) & 0xff) +#define RGBA_GETGREEN(rgb) (((rgb) >> 8) & 0xff) +#define RGBA_GETBLUE(rgb) ((rgb) & 0xff) + +typedef XMATRIX Matrix; +typedef void* LPRICETEXTURE ; + +typedef struct +{ + uint32 dwRGBA, dwRGBACopy; + char x,y,z; // Direction + uint8 pad; +} N64Light; + + +typedef struct +{ + unsigned int dwFormat:3; + unsigned int dwSize:2; + unsigned int dwWidth:10; + uint32 dwAddr; + uint32 bpl; +} SetImgInfo; + +typedef struct +{ + // Set by RDP_SetTile + unsigned int dwFormat :3; // e.g. RGBA, YUV etc + unsigned int dwSize :2; // e.g 4/8/16/32bpp + unsigned int dwLine :9; // Ummm... + unsigned int dwPalette :4; // 0..15 - a palette index? + uint32 dwTMem; // Texture memory location + + unsigned int bClampS :1; + unsigned int bClampT :1; + unsigned int bMirrorS :1; + unsigned int bMirrorT :1; + + unsigned int dwMaskS :4; + unsigned int dwMaskT :4; + unsigned int dwShiftS :4; + unsigned int dwShiftT :4; + + // Set by RDP_SetTileSize + int sl; // Upper left S - 8:3 + int tl; // Upper Left T - 8:3 + int sh; // Lower Right S + int th; // Lower Right T + + int hilite_sl; + int hilite_tl; + int hilite_sh; + int hilite_th; + + float fsl; // Upper left S - 8:3 + float ftl; // Upper Left T - 8:3 + float fsh; // Lower Right S + float fth; // Lower Right T + + float fhilite_sl; + float fhilite_tl; + float fhilite_sh; + float fhilite_th; + + uint32 dwDXT; + + uint32 dwPitch; + + uint32 dwWidth; + uint32 dwHeight; + + float fShiftScaleS; + float fShiftScaleT; + + uint32 lastTileCmd; + bool bSizeIsValid; + + bool bForceWrapS; + bool bForceWrapT; + bool bForceClampS; + bool bForceClampT; + +} Tile; + + +typedef struct +{ + float u; + float v; +} TexCord; + +typedef struct VECTOR2 +{ + float x; + float y; + VECTOR2( float newx, float newy ) {x=newx; y=newy;} + VECTOR2() {x=0; y=0;} +} VECTOR2; + +typedef struct +{ + short x; + short y; +} IVector2; + +typedef struct +{ + short x; + short y; + short z; +} IVector3; + +typedef struct { + float x,y,z; + float rhw; + union { + COLOR dcDiffuse; + struct { + uint8 b; + uint8 g; + uint8 r; + uint8 a; + }; + }; + COLOR dcSpecular; + TexCord tcord[2]; +} TLITVERTEX, *LPTLITVERTEX; + +typedef struct { + float x,y,z; + union { + COLOR dcDiffuse; + struct { + uint8 b; + uint8 g; + uint8 r; + uint8 a; + }; + }; + COLOR dcSpecular; + TexCord tcord[2]; +} UTLITVERTEX, *LPUTLITVERTEX; + +typedef struct { + float x,y,z; + float rhw; + union { + COLOR dcDiffuse; + struct { + uint8 b; + uint8 g; + uint8 r; + uint8 a; + }; + }; + COLOR dcSpecular; +} LITVERTEX, *LPLITVERTEX; + + + +typedef struct { + float x,y,z; + float rhw; + COLOR dcDiffuse; +} FILLRECTVERTEX, *LPFILLRECTVERTEX; + +#include "COLOR.h" +#include "IColor.h" + +typedef struct +{ + float x,y,z; + float nx,ny,nz; + union { + COLOR dcDiffuse; + struct { + uint8 b; + uint8 g; + uint8 r; + uint8 a; + }; + }; + float u,v; +}EXTERNAL_VERTEX, *LPSHADERVERTEX; + + +typedef struct +{ + union { + struct { + float x; + float y; + float z; + float range; // Range == 0 for directional light + // Range != 0 for point light, Zelda MM + }; + }; + + union { + struct { + uint8 r; + uint8 g; + uint8 b; + uint8 a; + }; + uint32 col; + }; + + union { + struct { + float fr; + float fg; + float fb; + float fa; + }; + float fcolors[4]; + }; + + union { + struct { + float tx; + float ty; + float tz; + float tdummy; + }; + }; + + union { + struct { + float ox; + float oy; + float oz; + float odummy; + }; + }; +} Light; + +typedef struct +{ + char na; + char nz; // b + char ny; //g + char nx; //r +}NormalStruct; + +typedef struct +{ + short y; + short x; + + short flag; + short z; + + short tv; + short tu; + + union { + struct { + uint8 a; + uint8 b; + uint8 g; + uint8 r; + } rgba; + NormalStruct norma; + }; +} FiddledVtx; + +typedef struct +{ + short y; + short x; + + uint8 a; + uint8 b; + short z; + + uint8 g; + uint8 r; + +} FiddledVtxDKR; + +typedef struct +{ + short y; + short x; + uint16 cidx; + short z; + short t; + short s; +} N64VtxPD; + +class CTexture; +class COGLTexture; +class CDirectXTexture; +struct TxtrCacheEntry; + +typedef struct { + LPRICETEXTURE m_lpsTexturePtr; + union { + CTexture * m_pCTexture; + CDirectXTexture * m_pCDirectXTexture; + COGLTexture * m_pCOGLTexture; + }; + + uint32 m_dwTileWidth; + uint32 m_dwTileHeight; + float m_fTexWidth; + float m_fTexHeight; // Float to avoid converts when processing verts + TxtrCacheEntry *pTextureEntry; +} RenderTexture; + + +typedef struct +{ + unsigned int dwFormat; + unsigned int dwSize; + unsigned int dwWidth; + unsigned int dwAddr; + + unsigned int dwLastWidth; + unsigned int dwLastHeight; + + unsigned int dwHeight; + unsigned int dwMemSize; + + bool bCopied; + unsigned int dwCopiedAtFrame; + + unsigned int dwCRC; + unsigned int lastUsedFrame; + unsigned int bUsedByVIAtFrame; + unsigned int lastSetAtUcode; +} RecentCIInfo; + +typedef struct +{ + uint32 addr; + uint32 FrameCount; +} RecentViOriginInfo; + +typedef enum { + SHADE_DISABLED, + SHADE_FLAT, + SHADE_SMOOTH, +} RenderShadeMode; + +typedef enum { + TEXTURE_UV_FLAG_WRAP, + TEXTURE_UV_FLAG_MIRROR, + TEXTURE_UV_FLAG_CLAMP, +} TextureUVFlag; + +typedef struct +{ + TextureUVFlag N64flag; + uint32 realFlag; +} UVFlagMap; + + +typedef enum { + FILTER_POINT, + FILTER_LINEAR, +} TextureFilter; + +typedef struct +{ + TextureFilter N64filter; + uint32 realFilter; +} TextureFilterMap; + +typedef struct { + const char* description; + int number; + uint32 setting; +} BufferSettingInfo; + +typedef struct { + const char* description; + uint32 setting; +} SettingInfo; + +typedef union { + uint8 g_Tmem8bit[0x1000]; + short g_Tmem16bit[0x800]; + uint32 g_Tmem32bit[0x300]; + uint64 g_Tmem64bit[0x200]; +} TmemType; + + +typedef struct { + uint32 dwFormat; + uint32 dwSize; + BOOL bSetBy; + + uint32 dwLoadAddress; + uint32 dwTotalWords; + uint32 dxt; + BOOL bSwapped; + + uint32 dwWidth; + uint32 dwLine; + + int sl; + int sh; + int tl; + int th; + + uint32 dwTmem; +} TMEMLoadMapInfo; + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/ucode.h b/libmupen64plus/mupen64plus-video-rice/src/ucode.h new file mode 100644 index 0000000000..0cd7ff1db9 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/ucode.h @@ -0,0 +1,784 @@ +/* +Copyright (C) 2003 Rice1964 + +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. + +*/ + +#include "UcodeDefs.h" + +#ifndef _UCODE_H_ +#define _UCODE_H_ + +//typedef void (*RDPInstruction)(Gfx *gfx); +typedef void (*RDPInstruction)(Gfx*); +extern RDPInstruction *currentUcodeMap; + +typedef RDPInstruction UcodeMap[256] ; + + +//#define UcodeFunc(name) void name(uint32, uint32) +#define UcodeFunc(name) void name(Gfx*) + +UcodeFunc(RSP_RDP_Nothing); + +UcodeFunc(RSP_GBI0_Mtx); +UcodeFunc(RSP_Mtx_DKR); +UcodeFunc(RSP_GBI0_DL); +UcodeFunc(RSP_DL_In_MEM_DKR); + +UcodeFunc(RSP_GBI0_Vtx); +UcodeFunc(RSP_Vtx_DKR); +UcodeFunc(RSP_Vtx_WRUS); +UcodeFunc(RSP_Vtx_ShadowOfEmpire); + +UcodeFunc(RSP_GBI0_Tri4); +UcodeFunc(RSP_DMA_Tri_DKR); +UcodeFunc(DLParser_Set_Addr_Ucode6); +UcodeFunc(RSP_MoveWord_DKR); + +UcodeFunc(RSP_Vtx_PD); +UcodeFunc(RSP_Set_Vtx_CI_PD); +UcodeFunc(RSP_Tri4_PD); + +UcodeFunc(RSP_GBI0_Sprite2DBase); +UcodeFunc(RSP_GBI0_Sprite2DDraw); +UcodeFunc(RSP_GBI1_Sprite2DBase); +UcodeFunc(RSP_GBI1_Sprite2DScaleFlip); +UcodeFunc(RSP_GBI1_Sprite2DDraw); +UcodeFunc(RSP_GBI_Sprite2DBase); +UcodeFunc(RSP_GBI_Sprite2D_PuzzleMaster64); + +UcodeFunc(RSP_GBI1_SpNoop); +UcodeFunc(RSP_GBI1_Reserved); +UcodeFunc(RSP_GBI1_Vtx); +UcodeFunc(RSP_GBI1_MoveMem); +UcodeFunc(RSP_GBI1_RDPHalf_Cont); +UcodeFunc(RSP_GBI1_RDPHalf_2); +UcodeFunc(RSP_GBI1_RDPHalf_1); +UcodeFunc(RSP_GBI1_Line3D); +UcodeFunc(RSP_GBI1_ClearGeometryMode); +UcodeFunc(RSP_GBI1_SetGeometryMode); +UcodeFunc(RSP_GBI1_EndDL); +UcodeFunc(RSP_GBI1_SetOtherModeL); +UcodeFunc(RSP_GBI1_SetOtherModeH); +UcodeFunc(RSP_GBI1_Texture); +UcodeFunc(RSP_GBI1_MoveWord); +UcodeFunc(RSP_GBI1_PopMtx); +UcodeFunc(RSP_GBI1_CullDL); +UcodeFunc(RSP_GBI1_Tri1); +UcodeFunc(RSP_GBI1_Tri2); +UcodeFunc(RSP_GBI1_Noop); +UcodeFunc(RSP_GBI1_ModifyVtx); +UcodeFunc(RSP_GBI1_BranchZ); +UcodeFunc(RSP_GBI1_LoadUCode); + +UcodeFunc(DLParser_TexRect); +UcodeFunc(DLParser_TexRectFlip); +UcodeFunc(DLParser_RDPLoadSync); +UcodeFunc(DLParser_RDPPipeSync); +UcodeFunc(DLParser_RDPTileSync); +UcodeFunc(DLParser_RDPFullSync); +UcodeFunc(DLParser_SetKeyGB); +UcodeFunc(DLParser_SetKeyR); +UcodeFunc(DLParser_SetConvert); +UcodeFunc(DLParser_SetScissor); +UcodeFunc(DLParser_SetPrimDepth); +UcodeFunc(DLParser_RDPSetOtherMode); +UcodeFunc(DLParser_LoadTLut); +UcodeFunc(DLParser_SetTileSize); +UcodeFunc(DLParser_LoadBlock); +UcodeFunc(DLParser_LoadTile); +UcodeFunc(DLParser_SetTile); +UcodeFunc(DLParser_FillRect); +UcodeFunc(DLParser_SetFillColor); +UcodeFunc(DLParser_SetFogColor); +UcodeFunc(DLParser_SetBlendColor); +UcodeFunc(DLParser_SetPrimColor); +UcodeFunc(DLParser_SetEnvColor); +UcodeFunc(DLParser_SetCombine); +UcodeFunc(DLParser_SetTImg); +UcodeFunc(DLParser_SetZImg); +UcodeFunc(DLParser_SetCImg); + +UcodeFunc(RSP_GBI2_DL); +UcodeFunc(RSP_GBI2_CullDL); +UcodeFunc(RSP_GBI2_EndDL); +UcodeFunc(RSP_GBI2_MoveWord); +UcodeFunc(RSP_GBI2_Texture); +UcodeFunc(RSP_GBI2_GeometryMode); +UcodeFunc(RSP_GBI2_SetOtherModeL); +UcodeFunc(RSP_GBI2_SetOtherModeH); +UcodeFunc(RSP_GBI2_MoveMem); +UcodeFunc(RSP_GBI2_Mtx); +UcodeFunc(RSP_GBI2_PopMtx); +UcodeFunc(RSP_GBI2_Vtx); +UcodeFunc(RSP_GBI2_Tri1); +UcodeFunc(RSP_GBI2_Tri2); +UcodeFunc(RSP_GBI2_Line3D); + +UcodeFunc(RSP_GBI2_DL_Count); +UcodeFunc(RSP_GBI2_SubModule); +UcodeFunc(RSP_GBI2_0x8); +UcodeFunc(DLParser_Bomberman2TextRect); + +UcodeFunc(RSP_S2DEX_BG_1CYC_2); +UcodeFunc(RSP_S2DEX_OBJ_RENDERMODE_2); + +UcodeFunc(RSP_S2DEX_SPObjLoadTxtr_Ucode1); + +UcodeFunc( RSP_S2DEX_BG_1CYC); +UcodeFunc( RSP_S2DEX_BG_COPY); +UcodeFunc( RSP_S2DEX_OBJ_RECTANGLE); +UcodeFunc( RSP_S2DEX_OBJ_SPRITE); +UcodeFunc( RSP_S2DEX_OBJ_MOVEMEM); +UcodeFunc( RSP_S2DEX_SELECT_DL); +UcodeFunc( RSP_S2DEX_OBJ_RENDERMODE); +UcodeFunc( RSP_S2DEX_OBJ_RECTANGLE_R); +UcodeFunc( RSP_S2DEX_SPObjLoadTxtr); +UcodeFunc( RSP_S2DEX_SPObjLoadTxSprite); +UcodeFunc( RSP_S2DEX_SPObjLoadTxRect); +UcodeFunc( RSP_S2DEX_SPObjLoadTxRectR); +UcodeFunc( RSP_S2DEX_RDPHALF_0); +UcodeFunc( RSP_S2DEX_Yoshi_Unknown); + +UcodeFunc( RSP_RDP_InsertMatrix ); +UcodeFunc( RSP_S2DEX_SPObjLoadTxtr ); + + + +UcodeFunc(RDP_TriFill); +UcodeFunc(RDP_TriFillZ); +UcodeFunc(RDP_TriTxtr); +UcodeFunc(RDP_TriTxtrZ); +UcodeFunc(RDP_TriShade); +UcodeFunc(RDP_TriShadeZ); +UcodeFunc(RDP_TriShadeTxtr); +UcodeFunc(RDP_TriShadeTxtrZ); + +#ifdef DEBUGGER +const char* ucodeNames_GBI1[256] = +{ + "RSP_SPNOOP", "RSP_MTX", "Reserved0", "RSP_MOVEMEM", + "RSP_VTX", "Reserved1", "RSP_DL", "Reserved2", + "RSP_RESERVED3", "RSP_SPRITE2D", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + //10 + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + //20 + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + //30 + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + //40 + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + //50 + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + //60 + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + //70 + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + +//80 + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", +//90 + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", +//A0 + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "RSP_LOAD_UCODE", +//B0 + "RSP_BRANCH_Z", "RSP_TRI2", "G_MODIFY_VERTEX", "RSP_RDPHALF_2", + "RSP_RDPHALF_1", "RSP_LINE3D", "RSP_CLEARGEOMETRYMODE", "RSP_SETGEOMETRYMODE", + "RSP_ENDDL", "RSP_SETOTHERMODE_L", "RSP_SETOTHERMODE_H", "RSP_TEXTURE", + "RSP_MOVEWORD", "RSP_POPMTX", "RSP_CULLDL", "RSP_TRI1", + +//C0 + "RDP_NOOP", "G_NOTHING", "G_YS_UNK1", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "RDP_TriFill", "RDP_TriFillZ", "RDP_TriTxtr", "RDP_TriTxtrZ", + "RDP_TriShade", "RDP_TriShadeZ", "RDP_TriShadeTxtr", "RDP_TriShadeTxtrZ", +//D0 + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", +//E0 + "G_NOTHING", "G_NOTHING", "G_NOTHING", "G_NOTHING", + "RDP_TEXRECT", "RDP_TEXRECT_FLIP", "RDP_LOADSYNC", "RDP_PIPESYNC", + "RDP_TILESYNC", "RDP_FULLSYNC", "RDP_SETKEYGB", "RDP_SETKEYR", + "RDP_SETCONVERT", "RDP_SETSCISSOR", "RDP_SETPRIMDEPTH", "RDP_RDPSETOTHERMODE", +//F0 + "RDP_LOADTLUT", "G_NOTHING", "RDP_SETTILESIZE", "RDP_LOADBLOCK", + "RDP_LOADTILE", "RDP_SETTILE", "RDP_FILLRECT", "RDP_SETFILLCOLOR", + "RDP_SETFOGCOLOR", "RDP_SETBLENDCOLOR", "RDP_SETPRIMCOLOR", "RDP_SETENVCOLOR", + "RDP_SETCOMBINE", "RDP_SETTIMG", "RDP_SETZIMG", "RDP_SETCIMG" + + +}; + + +const char* ucodeNames_GBI2[256] = +{ + "NOOP", "GBI2_Vtx", "ModifyVtx", "GBI2_CullDL", + "BranchZ", "GBI2_Tri1", "GBI2_Tri2","GBI2_Line3D", + "Nothing", "ObjBG1CYC", "ObjBGCopy", "OBJ_RenderMode", + "Nothing", "Nothing", "Nothing", "Nothing", +//10 + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", +//20 + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", +//30 + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", +//40 + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", +//50 + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", +//60 + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", +//70 + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", + +//80 + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", +//90 + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", +//a0 + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Load_Ucode", +//b0 + "BranchZ", "Tri2_Goldeneye", "ModifyVtx", "RDPHalf_2", + "RDPHalf_1", "Line3D", "ClearGeometryMode", "SetGeometryMode", + "EndDL", "SetOtherMode_L", "SetOtherMode_H", "Texture", + "MoveWord", "PopMtx", "CullDL", "Tri1", + +//c0 + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "Nothing", "Nothing", "Nothing", + "RDP_TriFill", "RDP_TriFillZ", "RDP_TriTxtr", "RDP_TriTxtrZ", + "RDP_TriShade", "RDP_TriShadeZ", "RDP_TriShadeTxtr", "RDP_TriShadeTxtrZ", +//d0 + "Nothing", "Nothing", "Nothing", "Nothing", + "Nothing", "GBI2_DL_N", "GBI2_SubModule", "GBI2_Texture", + "GBI2_PopMtx", "GBI2_SetGeometryMode", "GBI2_Mtx", "GBI2_MoveWord", + "GBI2_MoveMem", "Load_Ucode", "GBI2_DL", "GBI2_EndDL", +//e0 + "SPNOOP", "RDPHalf_1", "GBI2_SetOtherMode_L", "GBI2_SetOtherMode_H", + "TexRect", "TexRectFlip", "RDPLoadSync", "RDPPipeSync", + "RDPTileSync", "RDPFullSync", "SetKeyGB", "SetKeyR", + "SetConvert", "SetScissor", "SetPrimDepth", "RDPSetOtherMode", +//f0 + "LoadTLut", "Nothing", "SetTileSize", "LoadBlock", + "LoadTile", "SetTile", "FillRect", "SetFillColor", + "SetFogColor", "SetBlendColor", "SetPrimColor", "SetEnvColor", + "SetCombine", "SetTImg", "SetZImg", "SetCImg", +}; +#endif + + +typedef RDPInstruction UcodeMap[256] ; + +// Ucode: F3DEX, for most games +UcodeMap ucodeMap1 = +{ + RSP_GBI1_SpNoop, RSP_GBI0_Mtx, RSP_GBI1_Reserved, RSP_GBI1_MoveMem, + RSP_GBI1_Vtx, RSP_GBI1_Reserved, RSP_GBI0_DL, RSP_GBI1_Reserved, + RSP_GBI1_Reserved, RSP_GBI1_Sprite2DBase, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//10 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//20 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//30 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//40 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//50 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//60 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//70 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + +//80 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//90 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//a0 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_GBI1_LoadUCode, +//b0 + RSP_GBI1_BranchZ, RSP_GBI1_Tri2, RSP_GBI1_ModifyVtx, RSP_GBI1_RDPHalf_2, + RSP_GBI1_RDPHalf_1, RSP_GBI1_Line3D, RSP_GBI1_ClearGeometryMode, RSP_GBI1_SetGeometryMode, + RSP_GBI1_EndDL, RSP_GBI1_SetOtherModeL, RSP_GBI1_SetOtherModeH, RSP_GBI1_Texture, + RSP_GBI1_MoveWord, RSP_GBI1_PopMtx, RSP_GBI1_CullDL, RSP_GBI1_Tri1, + +//c0 + RSP_GBI1_Noop, RSP_S2DEX_SPObjLoadTxtr_Ucode1, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RDP_TriFill, RDP_TriFillZ, RDP_TriTxtr, RDP_TriTxtrZ, + RDP_TriShade, RDP_TriShadeZ, RDP_TriShadeTxtr, RDP_TriShadeTxtrZ, +//d0 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//e0 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + DLParser_TexRect, DLParser_TexRectFlip, DLParser_RDPLoadSync, DLParser_RDPPipeSync, + DLParser_RDPTileSync, DLParser_RDPFullSync, DLParser_SetKeyGB, DLParser_SetKeyR, + DLParser_SetConvert, DLParser_SetScissor, DLParser_SetPrimDepth, DLParser_RDPSetOtherMode, +//f0 + DLParser_LoadTLut, RSP_RDP_Nothing, DLParser_SetTileSize, DLParser_LoadBlock, + DLParser_LoadTile, DLParser_SetTile, DLParser_FillRect, DLParser_SetFillColor, + DLParser_SetFogColor, DLParser_SetBlendColor, DLParser_SetPrimColor, DLParser_SetEnvColor, + DLParser_SetCombine, DLParser_SetTImg, DLParser_SetZImg, DLParser_SetCImg +}; + + +UcodeMap ucodeMap0= +{ + RSP_GBI1_SpNoop, RSP_GBI0_Mtx, RSP_GBI1_Reserved, RSP_GBI1_MoveMem, + RSP_GBI0_Vtx, RSP_GBI1_Reserved, RSP_GBI0_DL, RSP_GBI1_Reserved, + RSP_GBI1_Reserved, RSP_GBI0_Sprite2DBase, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//10 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//20 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//30 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//40 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//50 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//60 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//70 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + +//80 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//90 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//a0 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//b0 + RSP_RDP_Nothing, RSP_GBI0_Tri4, RSP_GBI1_RDPHalf_Cont, RSP_GBI1_RDPHalf_2, + RSP_GBI1_RDPHalf_1, RSP_GBI1_Line3D, RSP_GBI1_ClearGeometryMode, RSP_GBI1_SetGeometryMode, + RSP_GBI1_EndDL, RSP_GBI1_SetOtherModeL, RSP_GBI1_SetOtherModeH, RSP_GBI1_Texture, + RSP_GBI1_MoveWord, RSP_GBI1_PopMtx, RSP_GBI1_CullDL, RSP_GBI1_Tri1, + +//c0 + RSP_GBI1_Noop, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RDP_TriFill, RDP_TriFillZ, RDP_TriTxtr, RDP_TriTxtrZ, + RDP_TriShade, RDP_TriShadeZ, RDP_TriShadeTxtr, RDP_TriShadeTxtrZ, +//d0 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//e0 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + DLParser_TexRect, DLParser_TexRectFlip, DLParser_RDPLoadSync, DLParser_RDPPipeSync, + DLParser_RDPTileSync, DLParser_RDPFullSync, DLParser_SetKeyGB, DLParser_SetKeyR, + DLParser_SetConvert, DLParser_SetScissor, DLParser_SetPrimDepth, DLParser_RDPSetOtherMode, +//f0 + DLParser_LoadTLut, RSP_RDP_Nothing, DLParser_SetTileSize, DLParser_LoadBlock, + DLParser_LoadTile, DLParser_SetTile, DLParser_FillRect, DLParser_SetFillColor, + DLParser_SetFogColor, DLParser_SetBlendColor, DLParser_SetPrimColor, DLParser_SetEnvColor, + DLParser_SetCombine, DLParser_SetTImg, DLParser_SetZImg, DLParser_SetCImg +}; + +// Zelda and new games, F3DEX_GBI_2 +UcodeMap ucodeMap5= +{ + RSP_GBI1_Noop, RSP_GBI2_Vtx, RSP_GBI1_ModifyVtx, RSP_GBI2_CullDL, + RSP_GBI1_BranchZ, RSP_GBI2_Tri1, RSP_GBI2_Tri2, RSP_GBI2_Line3D, + RSP_GBI2_0x8, RSP_S2DEX_BG_1CYC, RSP_S2DEX_BG_COPY, RSP_S2DEX_OBJ_RENDERMODE, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//10 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//20 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//30 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//40 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//50 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//60 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//70 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + +//80 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//90 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//a0 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_GBI1_LoadUCode, +//b0 + RSP_GBI1_BranchZ, RSP_GBI0_Tri4, RSP_GBI1_ModifyVtx, RSP_GBI1_RDPHalf_2, + RSP_GBI1_RDPHalf_1, RSP_GBI1_Line3D, RSP_GBI1_ClearGeometryMode, RSP_GBI1_SetGeometryMode, + RSP_GBI1_EndDL, RSP_GBI1_SetOtherModeL, RSP_GBI1_SetOtherModeH, RSP_GBI1_Texture, + RSP_GBI1_MoveWord, RSP_GBI1_PopMtx, RSP_GBI1_CullDL, RSP_GBI1_Tri1, + +//c0 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RDP_TriFill, RDP_TriFillZ, RDP_TriTxtr, RDP_TriTxtrZ, + RDP_TriShade, RDP_TriShadeZ, RDP_TriShadeTxtr, RDP_TriShadeTxtrZ, +//d0 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_GBI2_DL_Count, RSP_GBI2_SubModule, RSP_GBI2_Texture, + RSP_GBI2_PopMtx, RSP_GBI2_GeometryMode, RSP_GBI2_Mtx, RSP_GBI2_MoveWord, + RSP_GBI2_MoveMem, RSP_GBI1_LoadUCode, RSP_GBI2_DL, RSP_GBI2_EndDL, +//e0 + RSP_GBI1_SpNoop, RSP_GBI1_RDPHalf_1, RSP_GBI2_SetOtherModeL, RSP_GBI2_SetOtherModeH, + DLParser_TexRect, DLParser_TexRectFlip, DLParser_RDPLoadSync, DLParser_RDPPipeSync, + DLParser_RDPTileSync, DLParser_RDPFullSync, DLParser_SetKeyGB, DLParser_SetKeyR, + DLParser_SetConvert, DLParser_SetScissor, DLParser_SetPrimDepth, DLParser_RDPSetOtherMode, +//f0 + DLParser_LoadTLut, RSP_RDP_Nothing, DLParser_SetTileSize, DLParser_LoadBlock, + DLParser_LoadTile, DLParser_SetTile, DLParser_FillRect, DLParser_SetFillColor, + DLParser_SetFogColor, DLParser_SetBlendColor, DLParser_SetPrimColor, DLParser_SetEnvColor, + DLParser_SetCombine, DLParser_SetTImg, DLParser_SetZImg, DLParser_SetCImg +}; + + +// S2DEX 1.-- +UcodeMap ucodeMap7= +{ + RSP_GBI1_SpNoop, RSP_S2DEX_BG_1CYC_2, RSP_S2DEX_BG_COPY, RSP_S2DEX_OBJ_RECTANGLE, + RSP_S2DEX_OBJ_SPRITE, RSP_S2DEX_OBJ_MOVEMEM, RSP_GBI0_DL, RSP_GBI1_Reserved, + RSP_GBI1_Reserved, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + +//10 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//20 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//30 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//40 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//50 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//60 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//70 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + +//80 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//90 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//a0 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_GBI1_LoadUCode, +//b0 + RSP_S2DEX_SELECT_DL, RSP_S2DEX_OBJ_RENDERMODE_2, RSP_S2DEX_OBJ_RECTANGLE_R, RSP_GBI1_RDPHalf_2, + RSP_GBI1_RDPHalf_1, RSP_GBI1_Line3D, RSP_GBI1_ClearGeometryMode, RSP_GBI1_SetGeometryMode, + RSP_GBI1_EndDL, RSP_GBI1_SetOtherModeL, RSP_GBI1_SetOtherModeH, RSP_GBI1_Texture, + RSP_GBI1_MoveWord, RSP_GBI1_PopMtx, RSP_GBI1_CullDL, RSP_GBI1_Tri1, + +//c0 + RSP_GBI1_Noop, RSP_S2DEX_SPObjLoadTxtr, RSP_S2DEX_SPObjLoadTxSprite, RSP_S2DEX_SPObjLoadTxRect, + RSP_S2DEX_SPObjLoadTxRectR, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RDP_TriFill, RDP_TriFillZ, RDP_TriTxtr, RDP_TriTxtrZ, + RDP_TriShade, RDP_TriShadeZ, RDP_TriShadeTxtr, RDP_TriShadeTxtrZ, +//d0 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, +//e0 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_S2DEX_RDPHALF_0, DLParser_TexRectFlip, DLParser_RDPLoadSync, DLParser_RDPPipeSync, + DLParser_RDPTileSync, DLParser_RDPFullSync, DLParser_SetKeyGB, DLParser_SetKeyR, + DLParser_SetConvert, DLParser_SetScissor, DLParser_SetPrimDepth, DLParser_RDPSetOtherMode, +//f0 + DLParser_LoadTLut, RSP_RDP_Nothing, DLParser_SetTileSize, DLParser_LoadBlock, + DLParser_LoadTile, DLParser_SetTile, DLParser_FillRect, DLParser_SetFillColor, + DLParser_SetFogColor, DLParser_SetBlendColor, DLParser_SetPrimColor, DLParser_SetEnvColor, + DLParser_SetCombine, DLParser_SetTImg, DLParser_SetZImg, DLParser_SetCImg +}; + +// Ucode 3 - S2DEX GBI2 +UcodeMap ucodeMap3= +{ + RSP_GBI1_Noop, RSP_S2DEX_OBJ_RECTANGLE, RSP_S2DEX_OBJ_SPRITE, RSP_GBI2_CullDL, + RSP_S2DEX_SELECT_DL, RSP_S2DEX_SPObjLoadTxtr, RSP_S2DEX_SPObjLoadTxSprite, RSP_S2DEX_SPObjLoadTxRect, + RSP_S2DEX_SPObjLoadTxRectR, RSP_S2DEX_BG_1CYC, RSP_S2DEX_BG_COPY, RSP_S2DEX_OBJ_RENDERMODE, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + //10 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + //20 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + //30 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + //40 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + //50 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + //60 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + //70 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + + //80 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + //90 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + //a0 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_GBI1_LoadUCode, + //b0 + RSP_GBI1_BranchZ, RSP_GBI0_Tri4, RSP_GBI1_ModifyVtx, RSP_GBI1_RDPHalf_2, + RSP_GBI1_RDPHalf_1, RSP_GBI1_Line3D, RSP_GBI1_ClearGeometryMode, RSP_GBI1_SetGeometryMode, + RSP_GBI1_EndDL, RSP_GBI1_SetOtherModeL, RSP_GBI1_SetOtherModeH, RSP_GBI1_Texture, + RSP_GBI1_MoveWord, RSP_GBI1_PopMtx, RSP_GBI1_CullDL, RSP_GBI1_Tri1, + + //c0 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RDP_TriFill, RDP_TriFillZ, RDP_TriTxtr, RDP_TriTxtrZ, + RDP_TriShade, RDP_TriShadeZ, RDP_TriShadeTxtr, RDP_TriShadeTxtrZ, + //d0 + RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, RSP_RDP_Nothing, + RSP_RDP_Nothing, RSP_GBI2_DL_Count, RSP_GBI2_SubModule, RSP_GBI2_Texture, + RSP_GBI2_PopMtx, RSP_GBI2_GeometryMode, RSP_GBI2_Mtx, RSP_GBI2_MoveWord, + RSP_GBI2_MoveMem, RSP_GBI1_LoadUCode, RSP_GBI2_DL, RSP_GBI2_EndDL, + //e0 + RSP_GBI1_SpNoop, RSP_GBI1_RDPHalf_1, RSP_GBI2_SetOtherModeL, RSP_GBI2_SetOtherModeH, + DLParser_TexRect, DLParser_TexRectFlip, DLParser_RDPLoadSync, DLParser_RDPPipeSync, + DLParser_RDPTileSync, DLParser_RDPFullSync, DLParser_SetKeyGB, DLParser_SetKeyR, + DLParser_SetConvert, DLParser_SetScissor, DLParser_SetPrimDepth, DLParser_RDPSetOtherMode, + //f0 + DLParser_LoadTLut, RSP_RDP_Nothing, DLParser_SetTileSize, DLParser_LoadBlock, + DLParser_LoadTile, DLParser_SetTile, DLParser_FillRect, DLParser_SetFillColor, + DLParser_SetFogColor, DLParser_SetBlendColor, DLParser_SetPrimColor, DLParser_SetEnvColor, + DLParser_SetCombine, DLParser_SetTImg, DLParser_SetZImg, DLParser_SetCImg +}; + +RDPInstruction *currentUcodeMap = ucodeMap1; + +#endif + diff --git a/libmupen64plus/mupen64plus-video-rice/src/version.h b/libmupen64plus/mupen64plus-video-rice/src/version.h new file mode 100644 index 0000000000..b53b8c8635 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/version.h @@ -0,0 +1,38 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-video-rice - version.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009-2011 Richard Goedeken * + * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This header file is for versioning information + * + */ + +#if !defined(VERSION_H) +#define VERSION_H + +#define PLUGIN_NAME "Mupen64Plus OpenGL Video Plugin by Rice" +#define PLUGIN_VERSION 0x016305 +#define VIDEO_PLUGIN_API_VERSION 0x020100 +#define CONFIG_API_VERSION 0x020000 +#define VIDEXT_API_VERSION 0x020000 + +#define VERSION_PRINTF_SPLIT(x) (((x) >> 16) & 0xffff), (((x) >> 8) & 0xff), ((x) & 0xff) + +#endif /* #define VERSION_H */ + diff --git a/libmupen64plus/mupen64plus-video-rice/src/video_api_export.ver b/libmupen64plus/mupen64plus-video-rice/src/video_api_export.ver new file mode 100644 index 0000000000..557b0092f9 --- /dev/null +++ b/libmupen64plus/mupen64plus-video-rice/src/video_api_export.ver @@ -0,0 +1,21 @@ +{ global: +PluginStartup; +PluginShutdown; +PluginGetVersion; +ChangeWindow; +InitiateGFX; +MoveScreen; +ProcessDList; +ProcessRDPList; +RomClosed; +RomOpen; +ShowCFB; +UpdateScreen; +ViStatusChanged; +ViWidthChanged; +ReadScreen2; +SetRenderingCallback; +FBRead; +FBWrite; +FBGetFrameBufferInfo; +local: *; }; diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/BUGS b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/BUGS new file mode 100644 index 0000000000..d7058f6209 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/BUGS @@ -0,0 +1,18 @@ + +Bugs are now managed in the SDL bug tracker, here: + + http://bugzilla.libsdl.org/ + +You may report bugs there, and search to see if a given issue has already + been reported, discussed, and maybe even fixed. + + + +You may also find help at the SDL mailing list. Subscription information: + + http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org + +Bug reports are welcome here, but we really appreciate if you use Bugzilla, as + bugs discussed on the mailing list may be forgotten or missed. + + diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/COPYING b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/COPYING new file mode 100644 index 0000000000..8904ea404e --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/COPYING @@ -0,0 +1,458 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin St, 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. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +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 and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, 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 library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete 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 distribute a copy of this License along with the +Library. + + 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 Library or any portion +of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +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 Library, 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 Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you 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. + + If distribution of 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 satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be 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. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library 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. + + 9. 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 Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +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 with +this License. + + 11. 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 Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library 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 Library. + +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. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library 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. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser 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 Library +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 Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +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 + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "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 +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. 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 LIBRARY 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 +LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/README b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/README new file mode 100644 index 0000000000..e9e1d1a983 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/README @@ -0,0 +1,49 @@ + + Simple DirectMedia Layer + + (SDL) + + Version 1.2 + +--- +http://www.libsdl.org/ + +This is the Simple DirectMedia Layer, a general API that provides low +level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, +and 2D framebuffer across multiple platforms. + +The current version supports Linux, Windows CE/95/98/ME/XP/Vista, BeOS, +MacOS Classic, Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, +and QNX. The code contains support for Dreamcast, Atari, AIX, OSF/Tru64, +RISC OS, SymbianOS, Nintendo DS, and OS/2, but these are not officially +supported. + +SDL is written in C, but works with C++ natively, and has bindings to +several other languages, including Ada, C#, Eiffel, Erlang, Euphoria, +Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP, +Pike, Pliant, Python, Ruby, and Smalltalk. + +This library is distributed under GNU LGPL version 2, which can be +found in the file "COPYING". This license allows you to use SDL +freely in commercial programs as long as you link with the dynamic +library. + +The best way to learn how to use SDL is to check out the header files in +the "include" subdirectory and the programs in the "test" subdirectory. +The header files and test programs are well commented and always up to date. +More documentation is available in HTML format in "docs/index.html", and +a documentation wiki is available online at: + http://www.libsdl.org/cgi/docwiki.cgi + +The test programs in the "test" subdirectory are in the public domain. + +Frequently asked questions are answered online: + http://www.libsdl.org/faq.php + +If you need help with the library, or just want to discuss SDL related +issues, you can join the developers mailing list: + http://www.libsdl.org/mailing-list.php + +Enjoy! + Sam Lantinga (slouken@libsdl.org) + diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/README-SDL.txt b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/README-SDL.txt new file mode 100644 index 0000000000..1669736cb5 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/README-SDL.txt @@ -0,0 +1,13 @@ + +Please distribute this file with the SDL runtime environment: + +The Simple DirectMedia Layer (SDL for short) is a cross-platfrom library +designed to make it easy to write multi-media software, such as games and +emulators. + +The Simple DirectMedia Layer library source code is available from: +http://www.libsdl.org/ + +This library is distributed under the terms of the GNU LGPL license: +http://www.gnu.org/copyleft/lesser.html + diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/VisualC.html b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/VisualC.html new file mode 100644 index 0000000000..ad2ed97a60 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/VisualC.html @@ -0,0 +1,171 @@ + + + Using SDL with Microsoft Visual C++ + + +

+ Using SDL with Microsoft Visual C++ 5,6 and 7 +

+

+ by Lion Kimbro and additions by + James Turk +

+

+ You can either use the precompiled libraries from + the SDL Download web site , or you can build SDL yourself. +

+

+ Building SDL +

+

+ Unzip the VisualC.zip file into the directory that contains this + file (VisualC.html). +

+

+ Be certain that you unzip the zip file for your compiler into this + directory and not any other directory. If you are using WinZip, be careful to + make sure that it extracts to this folder, because it's + convenient feature of unzipping to a folder with the name of the file currently + being unzipped will get you in trouble if you use it right now. And that's all + I have to say about that. +

+

+ Now that it's unzipped, go into the VisualC + directory that is created, and double-click on the VC++ file "SDL.dsw" + ("SDL.sln"). This should open up the IDE. +

+

+ You may be prompted at this point to upgrade the workspace, should you be using + a more recent version of Visual C++. If so, allow the workspace to be upgraded. +

+

+ Build the .dll and .lib files. +

+

+ This is done by right clicking on each project in turn (Projects are listed in + the Workspace panel in the FileView tab), and selecting "Build". +

+

+ If you get an error about SDL_config.h being missing, you should + copy include/SDL_config.h.default to include/SDL_config.h and try again. +

+

+ You may get a few warnings, but you should not get any errors. You do have to + have at least the DirectX 5 SDK installed, however. The latest + version of DirectX can be downloaded or purchased on a cheap CD (my + recommendation) from Microsoft . +

+

+ Later, we will refer to the following .lib and .dll files that have just been + generated: +

+
    +
  • SDL.dll
  • +
  • SDL.lib
  • +
  • SDLmain.lib
  • +
+

+ Search for these using the Windows Find (Windows-F) utility, if you don't + already know where they should be. For those of you with a clue, look inside + the Debug or Release directories of the subdirectories of the Project folder. + (It might be easier to just use Windows Find if this sounds confusing. And + don't worry about needing a clue; we all need visits from the clue fairy + frequently.) +

+

+ Creating a Project with SDL +

+

+ Create a project as a Win32 Application. +

+

+ Create a C++ file for your project. +

+

+ Set the C runtime to "Multi-threaded DLL" in the menu: Project|Settings|C/C++ + tab|Code Generation|Runtime Library . +

+

+ Add the SDL include directory to your list of includes in the + menu: Project|Settings|C/C++ tab|Preprocessor|Additional include directories + . +
+ VC7 Specific: Instead of doing this I find it easier to + add the include and library directories to the list that VC7 keeps. Do this by + selecting Tools|Options|Projects|VC++ Directories and under the "Show + Directories For:" dropbox select "Include Files", and click the "New Directory + Icon" and add the [SDLROOT]\include directory (ex. If you installed to + c:\SDL-1.2.5\ add c:\SDL-1.2.5\include). Proceed to change the + dropbox selection to "Library Files" and add [SDLROOT]\lib. +

+

+ The "include directory" I am referring to is the include folder + within the main SDL directory (the one that this HTML file located within). +

+

+ Now we're going to use the files that we had created earlier in the Build SDL + step. +

+

+ Copy the following files into your Project directory: +

+
    +
  • SDL.dll
  • +
+

+ Add the following files to your project (It is not necessary to copy them to + your project directory): +

+
    +
  • SDL.lib
  • +
  • SDLmain.lib
  • +
+

+ (To add them to your project, right click on your project, and select "Add + files to project") +

+

Instead of adding the files to your project it is more + desireable to add them to the linker options: Project|Properties|Linker|Command + Line and type the names of the libraries to link with in the "Additional + Options:" box.  Note: This must be done for each build + configuration (eg. Release,Debug).

+

+ SDL 101, First Day of Class +

+

+ Now create the basic body of your project. The body of your program should take + the following form: +

+#include "SDL.h"
+
+int main( int argc, char* argv[] )
+{
+  // Body of the program goes here.
+  return 0;
+}
+
+ +

+

+ That's it! +

+

+ I hope that this document has helped you get through the most difficult part of + using the SDL: installing it. Suggestions for improvements to this document + should be sent to the writers of this document. +

+

+ Thanks to Paulus Esterhazy (pesterhazy@gmx.net), for the work on VC++ port. +

+

+ This document was originally called "VisualC.txt", and was written by + Sam Lantinga. +

+

+ Later, it was converted to HTML and expanded into the document that you see + today by Lion Kimbro. +

+

Minor Fixes and Visual C++ 7 Information (In Green) was added by James Turk +

+ + diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/WhatsNew b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/WhatsNew new file mode 100644 index 0000000000..7fae760f7c --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/WhatsNew @@ -0,0 +1,727 @@ + +This is a list of API changes in SDL's version history. + +Version 1.0: + +1.2.14: + Added cast macros for correct usage with C++: + SDL_reinterpret_cast(type, expression) + SDL_static_cast(type, expression) + + Added SDL_VIDEO_FULLSCREEN_DISPLAY as a preferred synonym for + SDL_VIDEO_FULLSCREEN_HEAD on X11. + + Added SDL_DISABLE_LOCK_KEYS environment variable to enable normal + up/down events for Caps-Lock and Num-Lock keys. + +1.2.13: + Added SDL_BUTTON_X1 and SDL_BUTTON_X2 constants. + +1.2.12: + Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling + of the screensaver on Mac OS X and X11. + +1.2.10: + If SDL_OpenAudio() is passed zero for the desired format + fields, the following environment variables will be used + to fill them in: + SDL_AUDIO_FREQUENCY + SDL_AUDIO_FORMAT + SDL_AUDIO_CHANNELS + SDL_AUDIO_SAMPLES + If an environment variable is not specified, it will be set + to a reasonable default value. + + Added support for the SDL_VIDEO_FULLSCREEN_HEAD environment + variable, currently supported on X11 Xinerama configurations. + + Added SDL_GL_SWAP_CONTROL to wait for vsync in OpenGL applications. + + Added SDL_GL_ACCELERATED_VISUAL to guarantee hardware acceleration. + + Added current_w and current_h to the SDL_VideoInfo structure, + which is set to the desktop resolution during video intialization, + and then set to the current resolution when a video mode is set. + + SDL_SetVideoMode() now accepts 0 for width or height and will use + the current video mode (or the desktop mode if no mode has been set.) + + Added SDL_GetKeyRepeat() + + Added SDL_config.h, with defaults for various build environments. + +1.2.7: + Added CPU feature detection functions to SDL_cpuinfo.h: + SDL_HasRDTSC(), SDL_HasMMX(), SDL_Has3DNow(), SDL_HasSSE(), + SDL_HasAltiVec() + Added function to create RWops from const memory: SDL_RWFromConstMem() + +1.2.6: + Added SDL_LoadObject(), SDL_LoadFunction(), and SDL_UnloadObject() + + Added SDL_GL_MULTISAMPLEBUFFERS and SDL_GL_MULTISAMPLESAMPLES for FSAA + +1.2.5: + Added SDL_BUTTON_WHEELUP (4) and SDL_BUTTON_WHEELDOWN (5) + + Added SDL_GL_STEREO for stereoscopic OpenGL contexts + +1.2.0: + Added SDL_VIDEOEXPOSE event to signal that the screen needs to + be redrawn. This is currently only delivered to OpenGL windows + on X11, though it may be delivered in the future when the video + memory is lost under DirectX. + +1.1.8: + You can pass SDL_NOFRAME to SDL_VideoMode() to create a window + that has no title bar or frame decoration. Fullscreen video + modes automatically have this flag set. + + Added a function to query the clipping rectangle for a surface: + void SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect) + + Added a function to query the current event filter: + SDL_EventFilter SDL_GetEventFilter(void) + + If you pass -1 to SDL_ShowCursor(), it won't change the current + cursor visibility state, but will still return it. + + SDL_LockSurface() and SDL_UnlockSurface() are recursive, meaning + you can nest them as deep as you want, as long as each lock call + has a matching unlock call. The surface remains locked until the + last matching unlock call. + + Note that you may not blit to or from a locked surface. + +1.1.7: + The SDL_SetGammaRamp() and SDL_GetGammaRamp() functions now take + arrays of Uint16 values instead of Uint8 values. For the most part, + you can just take your old values and shift them up 8 bits to get + new correct values for your gamma ramps. + + You can pass SDL_RLEACCEL in flags passed to SDL_ConvertSurface() + and SDL will try to RLE accelerate colorkey and alpha blits in the + resulting surface. + +1.1.6: + Added a function to return the thread ID of a specific thread: + Uint32 SDL_GetThreadID(SDL_Thread *thread) + If 'thread' is NULL, this function returns the id for this thread. + +1.1.5: + The YUV overlay structure has been changed to use an array of + pitches and pixels representing the planes of a YUV image, to + better enable hardware acceleration. The YV12 and IYUV formats + each have three planes, corresponding to the Y, U, and V portions + of the image, while packed pixel YUV formats just have one plane. + + For palettized mode (8bpp), the screen colormap is now split in + a physical and a logical palette. The physical palette determines + what colours the screen pixels will get when displayed, and the + logical palette controls the mapping from blits to/from the screen. + A new function, SDL_SetPalette() has been added to change + logical and physical palettes separately. SDL_SetColors() works + just as before, and is equivalent to calling SDL_SetPalette() with + a flag argument of (SDL_LOGPAL|SDL_PHYSPAL). + + SDL_BlitSurface() no longer modifies the source rectangle, only the + destination rectangle. The width/height members of the destination + rectangle are ignored, only the position is used. + + The old source clipping function SDL_SetClipping() has been replaced + with a more useful function to set the destination clipping rectangle: + SDL_bool SDL_SetClipRect(SDL_Surface *surface, SDL_Rect *rect) + + Added a function to see what subsystems have been initialized: + Uint32 SDL_WasInit(Uint32 flags) + + The Big Alpha Flip: SDL now treats alpha as opacity like everybody + else, and not as transparency: + + A new cpp symbol: SDL_ALPHA_OPAQUE is defined as 255 + A new cpp symbol: SDL_ALPHA_TRANSPARENT is defined as 0 + Values between 0 and 255 vary from fully transparent to fully opaque. + + New functions: + SDL_DisplayFormatAlpha() + Returns a surface converted to a format with alpha-channel + that can be blit efficiently to the screen. (In other words, + like SDL_DisplayFormat() but the resulting surface has + an alpha channel.) This is useful for surfaces with alpha. + SDL_MapRGBA() + Works as SDL_MapRGB() but takes an additional alpha parameter. + SDL_GetRGBA() + Works as SDL_GetRGB() but also returns the alpha value + (SDL_ALPHA_OPAQUE for formats without an alpha channel) + + Both SDL_GetRGB() and SDL_GetRGBA() now always return values in + the [0..255] interval. Previously, SDL_GetRGB() would return + (0xf8, 0xfc, 0xf8) for a completely white pixel in RGB565 format. + (N.B.: This is broken for bit fields < 3 bits.) + + SDL_MapRGB() returns pixels in which the alpha channel is set opaque. + + SDL_SetAlpha() can now be used for both setting the per-surface + alpha, using the new way of thinking of alpha, and also to enable + and disable per-pixel alpha blending for surfaces with an alpha + channel: + To disable alpha blending: + SDL_SetAlpha(surface, 0, 0); + To re-enable alpha blending: + SDL_SetAlpha(surface, SDL_SRCALPHA, 0); + Surfaces with an alpha channel have blending enabled by default. + + SDL_SetAlpha() now accepts SDL_RLEACCEL as a flag, which requests + RLE acceleration of blits, just as like with SDL_SetColorKey(). + This flag can be set for both surfaces with an alpha channel + and surfaces with an alpha value set by SDL_SetAlpha(). + As always, RLE surfaces must be locked before pixel access is + allowed, and unlocked before any other SDL operations are done + on it. + + The blit semantics for surfaces with and without alpha and colorkey + have now been defined: + + RGBA->RGB: + SDL_SRCALPHA set: + alpha-blend (using alpha-channel). + SDL_SRCCOLORKEY ignored. + SDL_SRCALPHA not set: + copy RGB. + if SDL_SRCCOLORKEY set, only copy the pixels matching the + RGB values of the source colour key, ignoring alpha in the + comparison. + + RGB->RGBA: + SDL_SRCALPHA set: + alpha-blend (using the source per-surface alpha value); + set destination alpha to opaque. + SDL_SRCALPHA not set: + copy RGB, set destination alpha to opaque. + both: + if SDL_SRCCOLORKEY set, only copy the pixels matching the + source colour key. + + RGBA->RGBA: + SDL_SRCALPHA set: + alpha-blend (using the source alpha channel) the RGB values; + leave destination alpha untouched. [Note: is this correct?] + SDL_SRCCOLORKEY ignored. + SDL_SRCALPHA not set: + copy all of RGBA to the destination. + if SDL_SRCCOLORKEY set, only copy the pixels matching the + RGB values of the source colour key, ignoring alpha in the + comparison. + + RGB->RGB: + SDL_SRCALPHA set: + alpha-blend (using the source per-surface alpha value). + SDL_SRCALPHA not set: + copy RGB. + both: + if SDL_SRCCOLORKEY set, only copy the pixels matching the + source colour key. + + As a special case, blits from surfaces with per-surface alpha + value of 128 (50% transparency) are optimised and much faster + than other alpha values. This does not apply to surfaces with + alpha channels (per-pixel alpha). + + New functions for manipulating the gamma of the display have + been added: + int SDL_SetGamma(float red, float green, float blue); + int SDL_SetGammaRamp(Uint8 *red, Uint8 *green, Uint8 *blue); + int SDL_GetGammaRamp(Uint8 *red, Uint8 *green, Uint8 *blue); + Gamma ramps are tables with 256 entries which map the screen color + components into actually displayed colors. For an example of + implementing gamma correction and gamma fades, see test/testgamma.c + Gamma control is not supported on all hardware. + +1.1.4: + The size of the SDL_CDtrack structure changed from 8 to 12 bytes + as the size of the length member was extended to 32 bits. + + You can now use SDL for 2D blitting with a GL mode by passing the + SDL_OPENGLBLIT flag to SDL_SetVideoMode(). You can specify 16 or + 32 bpp, and the data in the framebuffer is put into the GL scene + when you call SDL_UpdateRects(), and the scene will be visible + when you call SDL_GL_SwapBuffers(). + + Run the "testgl" test program with the -logo command line option + to see an example of this blending of 2D and 3D in SDL. + +1.1.3: + Added SDL_FreeRW() to the API, to complement SDL_AllocRW() + + Added resizable window support - just add SDL_RESIZABLE to the + SDL_SetVideoMode() flags, and then wait for SDL_VIDEORESIZE events. + See SDL_events.h for details on the new SDL_ResizeEvent structure. + + Added condition variable support, based on mutexes and semaphores. + SDL_CreateCond() + SDL_DestroyCond() + SDL_CondSignal() + SDL_CondBroadcast() + SDL_CondWait() + SDL_CondTimedWait() + The new function prototypes are in SDL_mutex.h + + Added counting semaphore support, based on the mutex primitive. + SDL_CreateSemaphore() + SDL_DestroySemaphore() + SDL_SemWait() + SDL_SemTryWait() + SDL_SemWaitTimeout() + SDL_SemPost() + SDL_SemValue() + The new function prototypes are in SDL_mutex.h + + Added support for asynchronous blitting. To take advantage of this, + you must set the SDL_ASYNCBLIT flag when setting the video mode and + creating surfaces that you want accelerated in this way. You must + lock surfaces that have this flag set, and the lock will block until + any queued blits have completed. + + Added YUV video overlay support. + The supported YUV formats are: YV12, IYUV, YUY2, UYVY, and YVYU. + This function creates an overlay surface: + SDL_CreateYUVOverlay() + You must lock and unlock the overlay to get access to the data: + SDL_LockYUVOverlay() SDL_UnlockYUVOverlay() + You can then display the overlay: + SDL_DisplayYUVOverlay() + You must free the overlay when you are done using it: + SDL_FreeYUVOverlay() + See SDL_video.h for the full function prototypes. + + The joystick hat position constants have been changed: + Old constant New constant + ------------ ------------ + 0 SDL_HAT_CENTERED + 1 SDL_HAT_UP + 2 SDL_HAT_RIGHTUP + 3 SDL_HAT_RIGHT + 4 SDL_HAT_RIGHTDOWN + 5 SDL_HAT_DOWN + 6 SDL_HAT_LEFTDOWN + 7 SDL_HAT_LEFT + 8 SDL_HAT_LEFTUP + The new constants are bitmasks, so you can check for the + individual axes like this: + if ( hat_position & SDL_HAT_UP ) { + } + and you'll catch left-up, up, and right-up. + +1.1.2: + Added multiple timer support: + SDL_AddTimer() and SDL_RemoveTimer() + + SDL_WM_SetIcon() now respects the icon colorkey if mask is NULL. + +1.1.0: + Added initial OpenGL support. + First set GL attributes (such as RGB depth, alpha depth, etc.) + SDL_GL_SetAttribute() + Then call SDL_SetVideoMode() with the SDL_OPENGL flag. + Perform all of your normal GL drawing. + Finally swap the buffers with the new SDL function: + SDL_GL_SwapBuffers() + See the new 'testgl' test program for an example of using GL with SDL. + + You can load GL extension functions by using the function: + SDL_GL_LoadProcAddress() + + Added functions to initialize and cleanup specific SDL subsystems: + SDL_InitSubSystem() and SDL_QuitSubSystem() + + Added user-defined event type: + typedef struct { + Uint8 type; + int code; + void *data1; + void *data2; + } SDL_UserEvent; + This structure is in the "user" member of an SDL_Event. + + Added a function to push events into the event queue: + SDL_PushEvent() + + Example of using the new SDL user-defined events: + { + SDL_Event event; + + event.type = SDL_USEREVENT; + event.user.code = my_event_code; + event.user.data1 = significant_data; + event.user.data2 = 0; + SDL_PushEvent(&event); + } + + Added a function to get mouse deltas since last query: + SDL_GetRelativeMouseState() + + Added a boolean datatype to SDL_types.h: + SDL_bool = { SDL_TRUE, SDL_FALSE } + + Added a function to get the current audio status: + SDL_GetAudioState(); + It returns one of: + SDL_AUDIO_STOPPED, + SDL_AUDIO_PLAYING, + SDL_AUDIO_PAUSED + + Added an AAlib driver (ASCII Art) - by Stephane Peter. + +1.0.6: + The input grab state is reset after each call to SDL_SetVideoMode(). + The input is grabbed by default in fullscreen mode, and ungrabbed in + windowed mode. If you want to set input grab to a particular value, + you should set it after each call to SDL_SetVideoMode(). + +1.0.5: + Exposed SDL_AudioInit(), SDL_VideoInit() + Added SDL_AudioDriverName() and SDL_VideoDriverName() + + Added new window manager function: + SDL_WM_ToggleFullScreen() + This is currently implemented only on Linux + + The ALT-ENTER code has been removed - it's not appropriate for a + lib to bind keys when they aren't even emergency escape sequences. + + ALT-ENTER functionality can be implemented with the following code: + + int Handle_AltEnter(const SDL_Event *event) + { + if ( event->type == SDL_KEYDOWN ) { + if ( (event->key.keysym.sym == SDLK_RETURN) && + (event->key.keysym.mod & KMOD_ALT) ) { + SDL_WM_ToggleFullScreen(SDL_GetVideoSurface()); + return(0); + } + } + return(1); + } + SDL_SetEventFilter(Handle_AltEnter); + +1.0.3: + Under X11, if you grab the input and hide the mouse cursor, + the mouse will go into a "relative motion" mode where you + will always get relative motion events no matter how far in + each direction you move the mouse - relative motion is not + bounded by the edges of the window (though the absolute values + of the mouse positions are clamped by the size of the window). + The SVGAlib, framebuffer console, and DirectInput drivers all + have this behavior naturally, and the GDI and BWindow drivers + never go into "relative motion" mode. + +1.0.2: + Added a function to enable keyboard repeat: + SDL_EnableKeyRepeat() + + Added a function to grab the mouse and keyboard input + SDL_WM_GrabInput() + + Added a function to iconify the window. + SDL_WM_IconifyWindow() + If this function succeeds, the application will receive an event + signaling SDL_APPACTIVE event + +1.0.1: + Added constants to SDL_audio.h for 16-bit native byte ordering: + AUDIO_U16SYS, AUDIO_S16SYS + +1.0.0: + New public release + +Version 0.11: + +0.11.5: + A new function SDL_GetVideoSurface() has been added, and returns + a pointer to the current display surface. + + SDL_AllocSurface() has been renamed SDL_CreateRGBSurface(), and + a new function SDL_CreateRGBSurfaceFrom() has been added to allow + creating an SDL surface from an existing pixel data buffer. + + Added SDL_GetRGB() to the headers and documentation. + +0.11.4: + SDL_SetLibraryPath() is no longer meaningful, and has been removed. + +0.11.3: + A new flag for SDL_Init(), SDL_INIT_NOPARACHUTE, prevents SDL from + installing fatal signal handlers on operating systems that support + them. + +Version 0.9: + +0.9.15: + SDL_CreateColorCursor() has been removed. Color cursors should + be implemented as sprites, blitted by the application when the + cursor moves. To get smooth color cursor updates when the app + is busy, pass the SDL_INIT_EVENTTHREAD flag to SDL_Init(). This + allows you to handle the mouse motion in another thread from an + event filter function, but is currently only supported by Linux + and BeOS. Note that you'll have to protect the display surface + from multi-threaded access by using mutexes if you do this. + + Thread-safe surface support has been removed from SDL. + This makes blitting somewhat faster, by removing SDL_MiddleBlit(). + Code that used SDL_MiddleBlit() should use SDL_LowerBlit() instead. + You can make your surfaces thread-safe by allocating your own + mutex and making lock/unlock calls around accesses to your surface. + +0.9.14: + SDL_GetMouseState() now takes pointers to int rather than Uint16. + + If you set the SDL_WINDOWID environment variable under UNIX X11, + SDL will use that as the main window instead of creating it's own. + This is an unsupported extension to SDL, and not portable at all. + +0.9.13: + Added a function SDL_SetLibraryPath() which can be used to specify + the directory containing the SDL dynamic libraries. This is useful + for commercial applications which ship with particular versions + of the libraries, and for security on multi-user systems. + If this function is not used, the default system directories are + searched using the native dynamic object loading mechanism. + + In order to support C linkage under Visual C++, you must declare + main() without any return type: + main(int argc, char *argv[]) { + /* Do the program... */ + return(0); + } + C++ programs should also return a value if compiled under VC++. + + The blit_endian member of the SDL_VideoInfo struct has been removed. + + SDL_SymToASCII() has been replaced with SDL_GetKeyName(), so there + is now no longer any function to translate a keysym to a character. + + The SDL_keysym structure has been extended with a 'scancode' and + 'unicode' member. The 'scancode' is a hardware specific scancode + for the key that was pressed, and may be 0. The 'unicode' member + is a 16-bit UNICODE translation of the key that was pressed along + with any modifiers or compose keys that have been pressed. + If no UNICODE translation exists for the key, 'unicode' will be 0. + + Added a function SDL_EnableUNICODE() to enable/disable UNICODE + translation of character keypresses. Translation defaults off. + + To convert existing code to use the new API, change code which + uses SDL_SymToASCII() to get the keyname to use SDL_GetKeyName(), + and change code which uses it to get the ASCII value of a sym to + use the 'unicode' member of the event keysym. + +0.9.12: + There is partial support for 64-bit datatypes. I don't recommend + you use this if you have a choice, because 64-bit datatypes are not + supported on many platforms. On platforms for which it is supported, + the SDL_HAS_64BIT_TYPE C preprocessor define will be enabled, and + you can use the Uint64 and Sint64 datatypes. + + Added functions to SDL_endian.h to support 64-bit datatypes: + SDL_SwapLE64(), SDL_SwapBE64(), + SDL_ReadLE64(), SDL_ReadBE64(), SDL_WriteLE64(), SDL_WriteBE64() + + A new member "len_ratio" has been added to the SDL_AudioCVT structure, + and allows you to determine either the original buffer length or the + converted buffer length, given the other. + + A new function SDL_FreeWAV() has been added to the API to free data + allocated by SDL_LoadWAV_RW(). This is necessary under Win32 since + the gcc compiled DLL uses a different heap than VC++ compiled apps. + + SDL now has initial support for international keyboards using the + Latin character set. + If a particular mapping is desired, you can set the DEFAULT_KEYBOARD + compile-time variable, or you can set the environment variable + "SDL_KEYBOARD" to a string identifying the keyboard mapping you desire. + The valid values for these variables can be found in SDL_keyboard.c + + Full support for German and French keyboards under X11 is implemented. + +0.9.11: + The THREADED_EVENTS compile-time define has been replaced with the + SDL_INIT_EVENTTHREAD flag. If this flag is passed to SDL_Init(), + SDL will create a separate thread to perform input event handling. + If this flag is passed to SDL_Init(), and the OS doesn't support + event handling in a separate thread, SDL_Init() will fail. + Be sure to add calls to SDL_Delay() in your main thread to allow + the OS to schedule your event thread, or it may starve, leading + to slow event delivery and/or dropped events. + Currently MacOS and Win32 do not support this flag, while BeOS + and Linux do support it. I recommend that your application only + use this flag if absolutely necessary. + + The SDL thread function passed to SDL_CreateThread() now returns a + status. This status can be retrieved by passing a non-NULL pointer + as the 'status' argument to SDL_WaitThread(). + + The volume parameter to SDL_MixAudio() has been increased in range + from (0-8) to (0-128) + + SDL now has a data source abstraction which can encompass a file, + an area of memory, or any custom object you can envision. It uses + these abstractions, SDL_RWops, in the endian read/write functions, + and the built-in WAV and BMP file loaders. This means you can load + WAV chunks from memory mapped files, compressed archives, network + pipes, or anything else that has a data read abstraction. + + There are three built-in data source abstractions: + SDL_RWFromFile(), SDL_RWFromFP(), SDL_RWFromMem() + along with a generic data source allocation function: + SDL_AllocRW() + These data sources can be used like stdio file pointers with the + following convenience functions: + SDL_RWseek(), SDL_RWread(), SDL_RWwrite(), SDL_RWclose() + These functions are defined in the new header file "SDL_rwops.h" + + The endian swapping functions have been turned into macros for speed + and SDL_CalculateEndian() has been removed. SDL_endian.h now defines + SDL_BYTEORDER as either SDL_BIG_ENDIAN or SDL_LIL_ENDIAN depending on + the endianness of the host system. + + The endian read/write functions now take an SDL_RWops pointer + instead of a stdio FILE pointer, to support the new data source + abstraction. + + The SDL_*LoadWAV() functions have been replaced with a single + SDL_LoadWAV_RW() function that takes a SDL_RWops pointer as it's + first parameter, and a flag whether or not to automatically + free it as the second parameter. SDL_LoadWAV() is a macro for + backward compatibility and convenience: + SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); + + The SDL_*LoadBMP()/SDL_*SaveBMP() functions have each been replaced + with a single function that takes a SDL_RWops pointer as it's + first parameter, and a flag whether or not to automatically + free it as the second parameter. SDL_LoadBMP() and SDL_SaveBMP() + are macros for backward compatibility and convenience: + SDL_LoadBMP_RW(SDL_RWFromFile("sample.bmp", "rb"), 1, ...); + SDL_SaveBMP_RW(SDL_RWFromFile("sample.bmp", "wb"), 1, ...); + Note that these functions use SDL_RWseek() extensively, and should + not be used on pipes or other non-seekable data sources. + +0.9.10: + The Linux SDL_SysWMInfo and SDL_SysWMMsg structures have been + extended to support multiple types of display drivers, as well as + safe access to the X11 display when THREADED_EVENTS is enabled. + The new structures are documented in the SDL_syswm.h header file. + + Thanks to John Elliott , the UK keyboard + should now work properly, as well as the "Windows" keys on US + keyboards. + + The Linux CD-ROM code now reads the CD-ROM devices from /etc/fstab + instead of trying to open each block device on the system. + The CD must be listed in /etc/fstab as using the iso9660 filesystem. + + On Linux, if you define THREADED_EVENTS at compile time, a separate + thread will be spawned to gather X events asynchronously from the + graphics updates. This hasn't been extensively tested, but it does + provide a means of handling keyboard and mouse input in a separate + thread from the graphics thread. (This is now enabled by default.) + + A special access function SDL_PeepEvents() allows you to manipulate + the event queue in a thread-safe manner, including peeking at events, + removing events of a specified type, and adding new events of arbitrary + type to the queue (use the new 'user' member of the SDL_Event type). + + If you use SDL_PeepEvents() to gather events, then the main graphics + thread needs to call SDL_PumpEvents() periodically to drive the event + loop and generate input events. This is not necessary if SDL has been + compiled with THREADED_EVENTS defined, but doesn't hurt. + + A new function SDL_ThreadID() returns the identifier associated with + the current thread. + +0.9.9: + The AUDIO_STEREO format flag has been replaced with a new 'channels' + member of the SDL_AudioSpec structure. The channels are 1 for mono + audio, and 2 for stereo audio. In the future more channels may be + supported for 3D surround sound. + + The SDL_MixAudio() function now takes an additional volume parameter, + which should be set to SDL_MIX_MAXVOLUME for compatibility with the + original function. + + The CD-ROM functions which take a 'cdrom' parameter can now be + passed NULL, and will act on the last successfully opened CD-ROM. + +0.9.8: + No changes, bugfixes only. + +0.9.7: + No changes, bugfixes only. + +0.9.6: + Added a fast rectangle fill function: SDL_FillRect() + + Addition of a useful function for getting info on the video hardware: + const SDL_VideoInfo *SDL_GetVideoInfo(void) + This function replaces SDL_GetDisplayFormat(). + + Initial support for double-buffering: + Use the SDL_DOUBLEBUF flag in SDL_SetVideoMode() + Update the screen with a new function: SDL_Flip() + + SDL_AllocSurface() takes two new flags: + SDL_SRCCOLORKEY means that the surface will be used for colorkey blits + and if the hardware supports hardware acceleration of colorkey blits + between two surfaces in video memory, to place the surface in video + memory if possible, otherwise it will be placed in system memory. + SDL_SRCALPHA means that the surface will be used for alpha blits and + if the hardware supports hardware acceleration of alpha blits between + two surfaces in video memory, to place the surface in video memory + if possible, otherwise it will be placed in system memory. + SDL_HWSURFACE now means that the surface will be created with the + same format as the display surface, since having surfaces in video + memory is only useful for fast blitting to the screen, and you can't + blit surfaces with different surface formats in video memory. + +0.9.5: + You can now pass a NULL mask to SDL_WM_SetIcon(), and it will assume + that the icon consists of the entire image. + + SDL_LowerBlit() is back -- but don't use it on the display surface. + It is exactly the same as SDL_MiddleBlit(), but doesn't check for + thread safety. + + Added SDL_FPLoadBMP(), SDL_FPSaveBMP(), SDL_FPLoadWAV(), which take + a FILE pointer instead of a file name. + + Added CD-ROM audio control API: + SDL_CDNumDrives() + SDL_CDName() + SDL_CDOpen() + SDL_CDStatus() + SDL_CDPlayTracks() + SDL_CDPlay() + SDL_CDPause() + SDL_CDResume() + SDL_CDStop() + SDL_CDEject() + SDL_CDClose() + +0.9.4: + No changes, bugfixes only. + +0.9.3: + Mouse motion event now includes relative motion information: + Sint16 event->motion.xrel, Sint16 event->motion.yrel + + X11 keyrepeat handling can be disabled by defining IGNORE_X_KEYREPEAT + (Add -DIGNORE_X_KEYREPEAT to CFLAGS line in obj/x11Makefile) + +0.9.2: + No changes, bugfixes only. + +0.9.1: + Removed SDL_MapSurface() and SDL_UnmapSurface() -- surfaces are now + automatically mapped on blit. + +0.8.0: + SDL stable release diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL.h new file mode 100644 index 0000000000..119ed7ff14 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL.h @@ -0,0 +1,101 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL.h + * Main include header for the SDL library + */ + +#ifndef _SDL_H +#define _SDL_H + +#include "SDL_main.h" +#include "SDL_stdinc.h" +#include "SDL_audio.h" +#include "SDL_cdrom.h" +#include "SDL_cpuinfo.h" +#include "SDL_endian.h" +#include "SDL_error.h" +#include "SDL_events.h" +#include "SDL_loadso.h" +#include "SDL_mutex.h" +#include "SDL_rwops.h" +#include "SDL_thread.h" +#include "SDL_timer.h" +#include "SDL_video.h" +#include "SDL_version.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @file SDL.h + * @note As of version 0.5, SDL is loaded dynamically into the application + */ + +/** @name SDL_INIT Flags + * These are the flags which may be passed to SDL_Init() -- you should + * specify the subsystems which you will be using in your application. + */ +/*@{*/ +#define SDL_INIT_TIMER 0x00000001 +#define SDL_INIT_AUDIO 0x00000010 +#define SDL_INIT_VIDEO 0x00000020 +#define SDL_INIT_CDROM 0x00000100 +#define SDL_INIT_JOYSTICK 0x00000200 +#define SDL_INIT_NOPARACHUTE 0x00100000 /**< Don't catch fatal signals */ +#define SDL_INIT_EVENTTHREAD 0x01000000 /**< Not supported on all OS's */ +#define SDL_INIT_EVERYTHING 0x0000FFFF +/*@}*/ + +/** This function loads the SDL dynamically linked library and initializes + * the subsystems specified by 'flags' (and those satisfying dependencies) + * Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup + * signal handlers for some commonly ignored fatal signals (like SIGSEGV) + */ +extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); + +/** This function initializes specific SDL subsystems */ +extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); + +/** This function cleans up specific SDL subsystems */ +extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); + +/** This function returns mask of the specified subsystems which have + * been initialized. + * If 'flags' is 0, it returns a mask of all initialized subsystems. + */ +extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); + +/** This function cleans up all initialized subsystems and unloads the + * dynamically linked library. You should call it upon all exit conditions. + */ +extern DECLSPEC void SDLCALL SDL_Quit(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_H */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_active.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_active.h new file mode 100644 index 0000000000..0ae92f2d56 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_active.h @@ -0,0 +1,63 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_active.h + * Include file for SDL application focus event handling + */ + +#ifndef _SDL_active_h +#define _SDL_active_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @name The available application states */ +/*@{*/ +#define SDL_APPMOUSEFOCUS 0x01 /**< The app has mouse coverage */ +#define SDL_APPINPUTFOCUS 0x02 /**< The app has input focus */ +#define SDL_APPACTIVE 0x04 /**< The application is active */ +/*@}*/ + +/* Function prototypes */ +/** + * This function returns the current state of the application, which is a + * bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and + * SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to + * see your application, otherwise it has been iconified or disabled. + */ +extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_active_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_audio.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_audio.h new file mode 100644 index 0000000000..3a8e7fa8b8 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_audio.h @@ -0,0 +1,284 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_audio.h + * Access to the raw audio mixing buffer for the SDL library + */ + +#ifndef _SDL_audio_h +#define _SDL_audio_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_endian.h" +#include "SDL_mutex.h" +#include "SDL_thread.h" +#include "SDL_rwops.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * When filling in the desired audio spec structure, + * - 'desired->freq' should be the desired audio frequency in samples-per-second. + * - 'desired->format' should be the desired audio format. + * - 'desired->samples' is the desired size of the audio buffer, in samples. + * This number should be a power of two, and may be adjusted by the audio + * driver to a value more suitable for the hardware. Good values seem to + * range between 512 and 8096 inclusive, depending on the application and + * CPU speed. Smaller values yield faster response time, but can lead + * to underflow if the application is doing heavy processing and cannot + * fill the audio buffer in time. A stereo sample consists of both right + * and left channels in LR ordering. + * Note that the number of samples is directly related to time by the + * following formula: ms = (samples*1000)/freq + * - 'desired->size' is the size in bytes of the audio buffer, and is + * calculated by SDL_OpenAudio(). + * - 'desired->silence' is the value used to set the buffer to silence, + * and is calculated by SDL_OpenAudio(). + * - 'desired->callback' should be set to a function that will be called + * when the audio device is ready for more data. It is passed a pointer + * to the audio buffer, and the length in bytes of the audio buffer. + * This function usually runs in a separate thread, and so you should + * protect data structures that it accesses by calling SDL_LockAudio() + * and SDL_UnlockAudio() in your code. + * - 'desired->userdata' is passed as the first parameter to your callback + * function. + * + * @note The calculated values in this structure are calculated by SDL_OpenAudio() + * + */ +typedef struct SDL_AudioSpec { + int freq; /**< DSP frequency -- samples per second */ + Uint16 format; /**< Audio data format */ + Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */ + Uint8 silence; /**< Audio buffer silence value (calculated) */ + Uint16 samples; /**< Audio buffer size in samples (power of 2) */ + Uint16 padding; /**< Necessary for some compile environments */ + Uint32 size; /**< Audio buffer size in bytes (calculated) */ + /** + * This function is called when the audio device needs more data. + * + * @param[out] stream A pointer to the audio data buffer + * @param[in] len The length of the audio buffer in bytes. + * + * Once the callback returns, the buffer will no longer be valid. + * Stereo samples are stored in a LRLRLR ordering. + */ + void (SDLCALL *callback)(void *userdata, Uint8 *stream, int len); + void *userdata; +} SDL_AudioSpec; + +/** + * @name Audio format flags + * defaults to LSB byte order + */ +/*@{*/ +#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */ +#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */ +#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */ +#define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */ +#define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */ +#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */ +#define AUDIO_U16 AUDIO_U16LSB +#define AUDIO_S16 AUDIO_S16LSB + +/** + * @name Native audio byte ordering + */ +/*@{*/ +#if SDL_BYTEORDER == SDL_LIL_ENDIAN +#define AUDIO_U16SYS AUDIO_U16LSB +#define AUDIO_S16SYS AUDIO_S16LSB +#else +#define AUDIO_U16SYS AUDIO_U16MSB +#define AUDIO_S16SYS AUDIO_S16MSB +#endif +/*@}*/ + +/*@}*/ + + +/** A structure to hold a set of audio conversion filters and buffers */ +typedef struct SDL_AudioCVT { + int needed; /**< Set to 1 if conversion possible */ + Uint16 src_format; /**< Source audio format */ + Uint16 dst_format; /**< Target audio format */ + double rate_incr; /**< Rate conversion increment */ + Uint8 *buf; /**< Buffer to hold entire audio data */ + int len; /**< Length of original audio buffer */ + int len_cvt; /**< Length of converted audio buffer */ + int len_mult; /**< buffer must be len*len_mult big */ + double len_ratio; /**< Given len, final size is len*len_ratio */ + void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format); + int filter_index; /**< Current audio conversion function */ +} SDL_AudioCVT; + + +/* Function prototypes */ + +/** + * @name Audio Init and Quit + * These functions are used internally, and should not be used unless you + * have a specific need to specify the audio driver you want to use. + * You should normally use SDL_Init() or SDL_InitSubSystem(). + */ +/*@{*/ +extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name); +extern DECLSPEC void SDLCALL SDL_AudioQuit(void); +/*@}*/ + +/** + * This function fills the given character buffer with the name of the + * current audio driver, and returns a pointer to it if the audio driver has + * been initialized. It returns NULL if no driver has been initialized. + */ +extern DECLSPEC char * SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen); + +/** + * This function opens the audio device with the desired parameters, and + * returns 0 if successful, placing the actual hardware parameters in the + * structure pointed to by 'obtained'. If 'obtained' is NULL, the audio + * data passed to the callback function will be guaranteed to be in the + * requested format, and will be automatically converted to the hardware + * audio format if necessary. This function returns -1 if it failed + * to open the audio device, or couldn't set up the audio thread. + * + * The audio device starts out playing silence when it's opened, and should + * be enabled for playing by calling SDL_PauseAudio(0) when you are ready + * for your audio callback function to be called. Since the audio driver + * may modify the requested size of the audio buffer, you should allocate + * any local mixing buffers after you open the audio device. + * + * @sa SDL_AudioSpec + */ +extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained); + +typedef enum { + SDL_AUDIO_STOPPED = 0, + SDL_AUDIO_PLAYING, + SDL_AUDIO_PAUSED +} SDL_audiostatus; + +/** Get the current audio state */ +extern DECLSPEC SDL_audiostatus SDLCALL SDL_GetAudioStatus(void); + +/** + * This function pauses and unpauses the audio callback processing. + * It should be called with a parameter of 0 after opening the audio + * device to start playing sound. This is so you can safely initialize + * data for your callback function after opening the audio device. + * Silence will be written to the audio device during the pause. + */ +extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on); + +/** + * This function loads a WAVE from the data source, automatically freeing + * that source if 'freesrc' is non-zero. For example, to load a WAVE file, + * you could do: + * @code SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); @endcode + * + * If this function succeeds, it returns the given SDL_AudioSpec, + * filled with the audio data format of the wave data, and sets + * 'audio_buf' to a malloc()'d buffer containing the audio data, + * and sets 'audio_len' to the length of that audio buffer, in bytes. + * You need to free the audio buffer with SDL_FreeWAV() when you are + * done with it. + * + * This function returns NULL and sets the SDL error message if the + * wave file cannot be opened, uses an unknown data format, or is + * corrupt. Currently raw and MS-ADPCM WAVE files are supported. + */ +extern DECLSPEC SDL_AudioSpec * SDLCALL SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); + +/** Compatibility convenience function -- loads a WAV from a file */ +#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \ + SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len) + +/** + * This function frees data previously allocated with SDL_LoadWAV_RW() + */ +extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 *audio_buf); + +/** + * This function takes a source format and rate and a destination format + * and rate, and initializes the 'cvt' structure with information needed + * by SDL_ConvertAudio() to convert a buffer of audio data from one format + * to the other. + * + * @return This function returns 0, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT *cvt, + Uint16 src_format, Uint8 src_channels, int src_rate, + Uint16 dst_format, Uint8 dst_channels, int dst_rate); + +/** + * Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(), + * created an audio buffer cvt->buf, and filled it with cvt->len bytes of + * audio data in the source format, this function will convert it in-place + * to the desired format. + * The data conversion may expand the size of the audio data, so the buffer + * cvt->buf should be allocated after the cvt structure is initialized by + * SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long. + */ +extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT *cvt); + + +#define SDL_MIX_MAXVOLUME 128 +/** + * This takes two audio buffers of the playing audio format and mixes + * them, performing addition, volume adjustment, and overflow clipping. + * The volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME + * for full audio volume. Note this does not change hardware volume. + * This is provided for convenience -- you can mix your own audio data. + */ +extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume); + +/** + * @name Audio Locks + * The lock manipulated by these functions protects the callback function. + * During a LockAudio/UnlockAudio pair, you can be guaranteed that the + * callback function is not running. Do not call these from the callback + * function or you will cause deadlock. + */ +/*@{*/ +extern DECLSPEC void SDLCALL SDL_LockAudio(void); +extern DECLSPEC void SDLCALL SDL_UnlockAudio(void); +/*@}*/ + +/** + * This function shuts down audio processing and closes the audio device. + */ +extern DECLSPEC void SDLCALL SDL_CloseAudio(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_audio_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_byteorder.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_byteorder.h new file mode 100644 index 0000000000..9b93cd69a3 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_byteorder.h @@ -0,0 +1,29 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_byteorder.h + * @deprecated Use SDL_endian.h instead + */ + +/* DEPRECATED */ +#include "SDL_endian.h" diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_cdrom.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_cdrom.h new file mode 100644 index 0000000000..fff5cfa158 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_cdrom.h @@ -0,0 +1,202 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_cdrom.h + * This is the CD-audio control API for Simple DirectMedia Layer + */ + +#ifndef _SDL_cdrom_h +#define _SDL_cdrom_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file SDL_cdrom.h + * In order to use these functions, SDL_Init() must have been called + * with the SDL_INIT_CDROM flag. This causes SDL to scan the system + * for CD-ROM drives, and load appropriate drivers. + */ + +/** The maximum number of CD-ROM tracks on a disk */ +#define SDL_MAX_TRACKS 99 + +/** @name Track Types + * The types of CD-ROM track possible + */ +/*@{*/ +#define SDL_AUDIO_TRACK 0x00 +#define SDL_DATA_TRACK 0x04 +/*@}*/ + +/** The possible states which a CD-ROM drive can be in. */ +typedef enum { + CD_TRAYEMPTY, + CD_STOPPED, + CD_PLAYING, + CD_PAUSED, + CD_ERROR = -1 +} CDstatus; + +/** Given a status, returns true if there's a disk in the drive */ +#define CD_INDRIVE(status) ((int)(status) > 0) + +typedef struct SDL_CDtrack { + Uint8 id; /**< Track number */ + Uint8 type; /**< Data or audio track */ + Uint16 unused; + Uint32 length; /**< Length, in frames, of this track */ + Uint32 offset; /**< Offset, in frames, from start of disk */ +} SDL_CDtrack; + +/** This structure is only current as of the last call to SDL_CDStatus() */ +typedef struct SDL_CD { + int id; /**< Private drive identifier */ + CDstatus status; /**< Current drive status */ + + /** The rest of this structure is only valid if there's a CD in drive */ + /*@{*/ + int numtracks; /**< Number of tracks on disk */ + int cur_track; /**< Current track position */ + int cur_frame; /**< Current frame offset within current track */ + SDL_CDtrack track[SDL_MAX_TRACKS+1]; + /*@}*/ +} SDL_CD; + +/** @name Frames / MSF Conversion Functions + * Conversion functions from frames to Minute/Second/Frames and vice versa + */ +/*@{*/ +#define CD_FPS 75 +#define FRAMES_TO_MSF(f, M,S,F) { \ + int value = f; \ + *(F) = value%CD_FPS; \ + value /= CD_FPS; \ + *(S) = value%60; \ + value /= 60; \ + *(M) = value; \ +} +#define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F)) +/*@}*/ + +/* CD-audio API functions: */ + +/** + * Returns the number of CD-ROM drives on the system, or -1 if + * SDL_Init() has not been called with the SDL_INIT_CDROM flag. + */ +extern DECLSPEC int SDLCALL SDL_CDNumDrives(void); + +/** + * Returns a human-readable, system-dependent identifier for the CD-ROM. + * Example: + * - "/dev/cdrom" + * - "E:" + * - "/dev/disk/ide/1/master" + */ +extern DECLSPEC const char * SDLCALL SDL_CDName(int drive); + +/** + * Opens a CD-ROM drive for access. It returns a drive handle on success, + * or NULL if the drive was invalid or busy. This newly opened CD-ROM + * becomes the default CD used when other CD functions are passed a NULL + * CD-ROM handle. + * Drives are numbered starting with 0. Drive 0 is the system default CD-ROM. + */ +extern DECLSPEC SDL_CD * SDLCALL SDL_CDOpen(int drive); + +/** + * This function returns the current status of the given drive. + * If the drive has a CD in it, the table of contents of the CD and current + * play position of the CD will be stored in the SDL_CD structure. + */ +extern DECLSPEC CDstatus SDLCALL SDL_CDStatus(SDL_CD *cdrom); + +/** + * Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks' + * tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play + * until the end of the CD. This function will skip data tracks. + * This function should only be called after calling SDL_CDStatus() to + * get track information about the CD. + * For example: + * @code + * // Play entire CD: + * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) + * SDL_CDPlayTracks(cdrom, 0, 0, 0, 0); + * // Play last track: + * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) { + * SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0); + * } + * // Play first and second track and 10 seconds of third track: + * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) + * SDL_CDPlayTracks(cdrom, 0, 0, 2, 10); + * @endcode + * + * @return This function returns 0, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_CDPlayTracks(SDL_CD *cdrom, + int start_track, int start_frame, int ntracks, int nframes); + +/** + * Play the given CD starting at 'start' frame for 'length' frames. + * @return It returns 0, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_CDPlay(SDL_CD *cdrom, int start, int length); + +/** Pause play + * @return returns 0, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_CDPause(SDL_CD *cdrom); + +/** Resume play + * @return returns 0, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_CDResume(SDL_CD *cdrom); + +/** Stop play + * @return returns 0, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_CDStop(SDL_CD *cdrom); + +/** Eject CD-ROM + * @return returns 0, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_CDEject(SDL_CD *cdrom); + +/** Closes the handle for the CD-ROM drive */ +extern DECLSPEC void SDLCALL SDL_CDClose(SDL_CD *cdrom); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_video_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config.h new file mode 100644 index 0000000000..a50810169c --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config.h @@ -0,0 +1,45 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_h +#define _SDL_config_h + +#include "SDL_platform.h" + +/* Add any platform that doesn't build using the configure system */ +#if defined(__DREAMCAST__) +#include "SDL_config_dreamcast.h" +#elif defined(__MACOS__) +#include "SDL_config_macos.h" +#elif defined(__MACOSX__) +#include "SDL_config_macosx.h" +#elif defined(__SYMBIAN32__) +#include "SDL_config_symbian.h" /* must be before win32! */ +#elif defined(__WIN32__) +#include "SDL_config_win32.h" +#elif defined(__OS2__) +#include "SDL_config_os2.h" +#else +#include "SDL_config_minimal.h" +#endif /* platform config */ + +#endif /* _SDL_config_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_amiga.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_amiga.h new file mode 100644 index 0000000000..23e0861928 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_amiga.h @@ -0,0 +1,80 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2006 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_amiga_h +#define _SDL_config_amiga_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +#define SDL_HAS_64BIT_TYPE 1 + +/* Useful headers */ +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_AHI 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various cdrom drivers */ +#define SDL_CDROM_DUMMY 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_AMIGA 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_DUMMY 1 + +/* Enable various threading systems */ +#define SDL_THREAD_AMIGA 1 + +/* Enable various timer systems */ +#define SDL_TIMER_AMIGA 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_CYBERGRAPHICS 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 + +/* Enable OpenGL support */ +#define SDL_VIDEO_OPENGL 1 + +#endif /* _SDL_config_amiga_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_dreamcast.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_dreamcast.h new file mode 100644 index 0000000000..07c2f08155 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_dreamcast.h @@ -0,0 +1,106 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_dreamcast_h +#define _SDL_config_dreamcast_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +typedef unsigned long uintptr_t; +#define SDL_HAS_64BIT_TYPE 1 + +/* Useful headers */ +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_CTYPE_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRDUP 1 +#define HAVE_INDEX 1 +#define HAVE_RINDEX 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRICMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_DC 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various cdrom drivers */ +#define SDL_CDROM_DC 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_DC 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_DUMMY 1 + +/* Enable various threading systems */ +#define SDL_THREAD_DC 1 + +/* Enable various timer systems */ +#define SDL_TIMER_DC 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DC 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 + +#endif /* _SDL_config_dreamcast_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_macos.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_macos.h new file mode 100644 index 0000000000..4ba5c22c34 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_macos.h @@ -0,0 +1,112 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_macos_h +#define _SDL_config_macos_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +#include + +typedef SInt8 int8_t; +typedef UInt8 uint8_t; +typedef SInt16 int16_t; +typedef UInt16 uint16_t; +typedef SInt32 int32_t; +typedef UInt32 uint32_t; +typedef SInt64 int64_t; +typedef UInt64 uint64_t; +typedef unsigned long uintptr_t; + +#define SDL_HAS_64BIT_TYPE 1 + +/* Useful headers */ +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_ABS 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_ITOA 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_SSCANF 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_SNDMGR 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various cdrom drivers */ +#if TARGET_API_MAC_CARBON +#define SDL_CDROM_DUMMY 1 +#else +#define SDL_CDROM_MACOS 1 +#endif + +/* Enable various input drivers */ +#if TARGET_API_MAC_CARBON +#define SDL_JOYSTICK_DUMMY 1 +#else +#define SDL_JOYSTICK_MACOS 1 +#endif + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_MACOS 1 + +/* Enable various threading systems */ +#define SDL_THREADS_DISABLED 1 + +/* Enable various timer systems */ +#define SDL_TIMER_MACOS 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_DRAWSPROCKET 1 +#define SDL_VIDEO_DRIVER_TOOLBOX 1 + +/* Enable OpenGL support */ +#define SDL_VIDEO_OPENGL 1 + +#endif /* _SDL_config_macos_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_macosx.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_macosx.h new file mode 100644 index 0000000000..295b87245e --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_macosx.h @@ -0,0 +1,150 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_macosx_h +#define _SDL_config_macosx_h + +#include "SDL_platform.h" + +/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */ +#include + +/* This is a set of defines to configure the SDL features */ + +#define SDL_HAS_64BIT_TYPE 1 + +/* Useful headers */ +/* If we specified an SDK or have a post-PowerPC chip, then alloca.h exists. */ +#if ( (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (!defined(__POWERPC__)) ) +#define HAVE_ALLOCA_H 1 +#endif +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRDUP 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_COREAUDIO 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various cdrom drivers */ +#define SDL_CDROM_MACOSX 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_IOKIT 1 + +/* Enable various shared object loading systems */ +#ifdef __ppc__ +/* For Mac OS X 10.2 compatibility */ +#define SDL_LOADSO_DLCOMPAT 1 +#else +#define SDL_LOADSO_DLOPEN 1 +#endif + +/* Enable various threading systems */ +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 + +/* Enable various timer systems */ +#define SDL_TIMER_UNIX 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DUMMY 1 +#if ((defined TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON)) +#define SDL_VIDEO_DRIVER_TOOLBOX 1 +#else +#define SDL_VIDEO_DRIVER_QUARTZ 1 +#endif +#define SDL_VIDEO_DRIVER_DGA 1 +#define SDL_VIDEO_DRIVER_X11 1 +#define SDL_VIDEO_DRIVER_X11_DGAMOUSE 1 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER "/usr/X11R6/lib/libXrender.1.dylib" +#define SDL_VIDEO_DRIVER_X11_VIDMODE 1 +#define SDL_VIDEO_DRIVER_X11_XINERAMA 1 +#define SDL_VIDEO_DRIVER_X11_XME 1 +#define SDL_VIDEO_DRIVER_X11_XRANDR 1 +#define SDL_VIDEO_DRIVER_X11_XV 1 + +/* Enable OpenGL support */ +#define SDL_VIDEO_OPENGL 1 +#define SDL_VIDEO_OPENGL_GLX 1 + +/* Disable screensaver */ +#define SDL_VIDEO_DISABLE_SCREENSAVER 1 + +/* Enable assembly routines */ +#define SDL_ASSEMBLY_ROUTINES 1 +#ifdef __ppc__ +#define SDL_ALTIVEC_BLITTERS 1 +#endif + +#endif /* _SDL_config_macosx_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_minimal.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_minimal.h new file mode 100644 index 0000000000..002c56eadb --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_minimal.h @@ -0,0 +1,62 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_minimal_h +#define _SDL_config_minimal_h + +#include "SDL_platform.h" + +/* This is the minimal configuration that can be used to build SDL */ + +#include + +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef unsigned int size_t; +typedef unsigned long uintptr_t; + +/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ +#define SDL_CDROM_DISABLED 1 + +/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ +#define SDL_JOYSTICK_DISABLED 1 + +/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ +#define SDL_LOADSO_DISABLED 1 + +/* Enable the stub thread support (src/thread/generic/\*.c) */ +#define SDL_THREADS_DISABLED 1 + +/* Enable the stub timer support (src/timer/dummy/\*.c) */ +#define SDL_TIMERS_DISABLED 1 + +/* Enable the dummy video driver (src/video/dummy/\*.c) */ +#define SDL_VIDEO_DRIVER_DUMMY 1 + +#endif /* _SDL_config_minimal_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_nds.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_nds.h new file mode 100644 index 0000000000..4ac60a5045 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_nds.h @@ -0,0 +1,115 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_nds_h +#define _SDL_config_nds_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +/* General platform specific identifiers */ +#include "SDL_platform.h" + +/* C datatypes */ +#define SDL_HAS_64BIT_TYPE 1 + +/* Endianness */ +#define SDL_BYTEORDER 1234 + +/* Useful headers */ +#define HAVE_ALLOCA_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_STRING_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_ICONV_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRDUP 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_SETJMP 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_NDS 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ +#define SDL_CDROM_DISABLED 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_NDS 1 + +/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ +#define SDL_LOADSO_DISABLED 1 + +/* Enable the stub thread support (src/thread/generic/\*.c) */ +#define SDL_THREADS_DISABLED 1 + +/* Enable various timer systems */ +#define SDL_TIMER_NDS 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_NDS 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 + +#endif /* _SDL_config_nds_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_os2.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_os2.h new file mode 100644 index 0000000000..bb40df0018 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_os2.h @@ -0,0 +1,141 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_os2_h +#define _SDL_config_os2_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef unsigned int size_t; +typedef unsigned long uintptr_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; + +#define SDL_HAS_64BIT_TYPE 1 + +/* Use Watcom's LIBC */ +#define HAVE_LIBC 1 + +/* Useful headers */ +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_STRING_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRDUP 1 +#define HAVE__STRREV 1 +#define HAVE__STRUPR 1 +#define HAVE__STRLWR 1 +#define HAVE_INDEX 1 +#define HAVE_RINDEX 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_ITOA 1 +#define HAVE__LTOA 1 +#define HAVE__UITOA 1 +#define HAVE__ULTOA 1 +#define HAVE_STRTOL 1 +#define HAVE__I64TOA 1 +#define HAVE__UI64TOA 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRICMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_SETJMP 1 +#define HAVE_CLOCK_GETTIME 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_DART 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various cdrom drivers */ +#define SDL_CDROM_OS2 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_OS2 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_OS2 1 + +/* Enable various threading systems */ +#define SDL_THREAD_OS2 1 + +/* Enable various timer systems */ +#define SDL_TIMER_OS2 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_OS2FS 1 + +/* Enable OpenGL support */ +/* Nothing here yet for OS/2... :( */ + +/* Enable assembly routines where available */ +#define SDL_ASSEMBLY_ROUTINES 1 + +#endif /* _SDL_config_os2_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_symbian.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_symbian.h new file mode 100644 index 0000000000..53527b2324 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_symbian.h @@ -0,0 +1,146 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/* + +Symbian version Markus Mertama + +*/ + + +#ifndef _SDL_CONFIG_SYMBIAN_H +#define _SDL_CONFIG_SYMBIAN_H + +#include "SDL_platform.h" + +/* This is the minimal configuration that can be used to build SDL */ + + +#include +#include + + +#ifdef __GCCE__ +#define SYMBIAN32_GCCE +#endif + +#ifndef _SIZE_T_DEFINED +typedef unsigned int size_t; +#endif + +#ifndef _INTPTR_T_DECLARED +typedef unsigned int uintptr_t; +#endif + +#ifndef _INT8_T_DECLARED +typedef signed char int8_t; +#endif + +#ifndef _UINT8_T_DECLARED +typedef unsigned char uint8_t; +#endif + +#ifndef _INT16_T_DECLARED +typedef signed short int16_t; +#endif + +#ifndef _UINT16_T_DECLARED +typedef unsigned short uint16_t; +#endif + +#ifndef _INT32_T_DECLARED +typedef signed int int32_t; +#endif + +#ifndef _UINT32_T_DECLARED +typedef unsigned int uint32_t; +#endif + +#ifndef _INT64_T_DECLARED +typedef signed long long int64_t; +#endif + +#ifndef _UINT64_T_DECLARED +typedef unsigned long long uint64_t; +#endif + +#define SDL_AUDIO_DRIVER_EPOCAUDIO 1 + + +/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ +#define SDL_CDROM_DISABLED 1 + +/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ +#define SDL_JOYSTICK_DISABLED 1 + +/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ +#define SDL_LOADSO_DISABLED 1 + +#define SDL_THREAD_SYMBIAN 1 + +#define SDL_VIDEO_DRIVER_EPOC 1 + +#define SDL_VIDEO_OPENGL 0 + +#define SDL_HAS_64BIT_TYPE 1 + +#define HAVE_LIBC 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 + +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +/*#define HAVE_ALLOCA 1*/ +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE__STRUPR 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_ITOA 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +/*#define HAVE__STRICMP 1*/ +#define HAVE__STRNICMP 1 +#define HAVE_SSCANF 1 +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 + + + +#endif /* _SDL_CONFIG_SYMBIAN_H */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_win32.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_win32.h new file mode 100644 index 0000000000..6d019a8d9c --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_config_win32.h @@ -0,0 +1,183 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_win32_h +#define _SDL_config_win32_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +#if defined(__GNUC__) || defined(__DMC__) +#define HAVE_STDINT_H 1 +#elif defined(_MSC_VER) +typedef signed __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef signed __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef signed __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +#else +typedef unsigned int uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif +/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ +#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) +#define DWORD_PTR DWORD +#endif +#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) +#define LONG_PTR LONG +#endif +#else /* !__GNUC__ && !_MSC_VER */ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef unsigned int size_t; +#endif +typedef unsigned int uintptr_t; +#endif /* __GNUC__ || _MSC_VER */ +#define SDL_HAS_64BIT_TYPE 1 + +/* Enabled for SDL 1.2 (binary compatibility) */ +#define HAVE_LIBC 1 +#ifdef HAVE_LIBC +/* Useful headers */ +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#ifndef _WIN32_WCE +#define HAVE_SIGNAL_H 1 +#endif + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE__STRREV 1 +#define HAVE__STRUPR 1 +#define HAVE__STRLWR 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_ITOA 1 +#define HAVE__LTOA 1 +#define HAVE__ULTOA 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE__STRICMP 1 +#define HAVE__STRNICMP 1 +#define HAVE_SSCANF 1 +#else +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 +#endif + +/* Enable various audio drivers */ +#ifndef _WIN32_WCE +#define SDL_AUDIO_DRIVER_DSOUND 1 +#endif +#define SDL_AUDIO_DRIVER_WAVEOUT 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various cdrom drivers */ +#ifdef _WIN32_WCE +#define SDL_CDROM_DISABLED 1 +#else +#define SDL_CDROM_WIN32 1 +#endif + +/* Enable various input drivers */ +#ifdef _WIN32_WCE +#define SDL_JOYSTICK_DISABLED 1 +#else +#define SDL_JOYSTICK_WINMM 1 +#endif + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_WIN32 1 + +/* Enable various threading systems */ +#define SDL_THREAD_WIN32 1 + +/* Enable various timer systems */ +#ifdef _WIN32_WCE +#define SDL_TIMER_WINCE 1 +#else +#define SDL_TIMER_WIN32 1 +#endif + +/* Enable various video drivers */ +#ifdef _WIN32_WCE +#define SDL_VIDEO_DRIVER_GAPI 1 +#endif +#ifndef _WIN32_WCE +#define SDL_VIDEO_DRIVER_DDRAW 1 +#endif +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_WINDIB 1 + +/* Enable OpenGL support */ +#ifndef _WIN32_WCE +#define SDL_VIDEO_OPENGL 1 +#define SDL_VIDEO_OPENGL_WGL 1 +#endif + +/* Disable screensaver */ +#define SDL_VIDEO_DISABLE_SCREENSAVER 1 + +/* Enable assembly routines (Win64 doesn't have inline asm) */ +#ifndef _WIN64 +#define SDL_ASSEMBLY_ROUTINES 1 +#endif + +#endif /* _SDL_config_win32_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_copying.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_copying.h new file mode 100644 index 0000000000..1bd6b84cd8 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_copying.h @@ -0,0 +1,22 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_cpuinfo.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_cpuinfo.h new file mode 100644 index 0000000000..f4be8e0323 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_cpuinfo.h @@ -0,0 +1,69 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_cpuinfo.h + * CPU feature detection for SDL + */ + +#ifndef _SDL_cpuinfo_h +#define _SDL_cpuinfo_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** This function returns true if the CPU has the RDTSC instruction */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void); + +/** This function returns true if the CPU has MMX features */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void); + +/** This function returns true if the CPU has MMX Ext. features */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void); + +/** This function returns true if the CPU has 3DNow features */ +extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void); + +/** This function returns true if the CPU has 3DNow! Ext. features */ +extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void); + +/** This function returns true if the CPU has SSE features */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void); + +/** This function returns true if the CPU has SSE2 features */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); + +/** This function returns true if the CPU has AltiVec features */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_cpuinfo_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_endian.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_endian.h new file mode 100644 index 0000000000..f7a2e2f8c0 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_endian.h @@ -0,0 +1,209 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_endian.h + * Functions for reading and writing endian-specific values + */ + +#ifndef _SDL_endian_h +#define _SDL_endian_h + +#include "SDL_stdinc.h" + +/** @name SDL_ENDIANs + * The two types of endianness + */ +/*@{*/ +#define SDL_LIL_ENDIAN 1234 +#define SDL_BIG_ENDIAN 4321 +/*@}*/ + +#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */ +#if defined(__hppa__) || \ + defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ + (defined(__MIPS__) && defined(__MISPEB__)) || \ + defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \ + defined(__sparc__) +#define SDL_BYTEORDER SDL_BIG_ENDIAN +#else +#define SDL_BYTEORDER SDL_LIL_ENDIAN +#endif +#endif /* !SDL_BYTEORDER */ + + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @name SDL_Swap Functions + * Use inline functions for compilers that support them, and static + * functions for those that do not. Because these functions become + * static for compilers that do not support inline functions, this + * header should only be included in files that actually use them. + */ +/*@{*/ +#if defined(__GNUC__) && defined(__i386__) && \ + !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) +static __inline__ Uint16 SDL_Swap16(Uint16 x) +{ + __asm__("xchgb %b0,%h0" : "=q" (x) : "0" (x)); + return x; +} +#elif defined(__GNUC__) && defined(__x86_64__) +static __inline__ Uint16 SDL_Swap16(Uint16 x) +{ + __asm__("xchgb %b0,%h0" : "=Q" (x) : "0" (x)); + return x; +} +#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) +static __inline__ Uint16 SDL_Swap16(Uint16 x) +{ + Uint16 result; + + __asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x)); + return result; +} +#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) +static __inline__ Uint16 SDL_Swap16(Uint16 x) +{ + __asm__("rorw #8,%0" : "=d" (x) : "0" (x) : "cc"); + return x; +} +#else +static __inline__ Uint16 SDL_Swap16(Uint16 x) { + return((x<<8)|(x>>8)); +} +#endif + +#if defined(__GNUC__) && defined(__i386__) && \ + !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) +static __inline__ Uint32 SDL_Swap32(Uint32 x) +{ + __asm__("bswap %0" : "=r" (x) : "0" (x)); + return x; +} +#elif defined(__GNUC__) && defined(__x86_64__) +static __inline__ Uint32 SDL_Swap32(Uint32 x) +{ + __asm__("bswapl %0" : "=r" (x) : "0" (x)); + return x; +} +#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) +static __inline__ Uint32 SDL_Swap32(Uint32 x) +{ + Uint32 result; + + __asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x)); + __asm__("rlwimi %0,%2,8,8,15" : "=&r" (result) : "0" (result), "r" (x)); + __asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x)); + return result; +} +#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) +static __inline__ Uint32 SDL_Swap32(Uint32 x) +{ + __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) : "0" (x) : "cc"); + return x; +} +#else +static __inline__ Uint32 SDL_Swap32(Uint32 x) { + return((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24)); +} +#endif + +#ifdef SDL_HAS_64BIT_TYPE +#if defined(__GNUC__) && defined(__i386__) && \ + !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) +static __inline__ Uint64 SDL_Swap64(Uint64 x) +{ + union { + struct { Uint32 a,b; } s; + Uint64 u; + } v; + v.u = x; + __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1" + : "=r" (v.s.a), "=r" (v.s.b) + : "0" (v.s.a), "1" (v.s.b)); + return v.u; +} +#elif defined(__GNUC__) && defined(__x86_64__) +static __inline__ Uint64 SDL_Swap64(Uint64 x) +{ + __asm__("bswapq %0" : "=r" (x) : "0" (x)); + return x; +} +#else +static __inline__ Uint64 SDL_Swap64(Uint64 x) +{ + Uint32 hi, lo; + + /* Separate into high and low 32-bit values and swap them */ + lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF); + x >>= 32; + hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF); + x = SDL_Swap32(lo); + x <<= 32; + x |= SDL_Swap32(hi); + return(x); +} +#endif +#else +/* This is mainly to keep compilers from complaining in SDL code. + * If there is no real 64-bit datatype, then compilers will complain about + * the fake 64-bit datatype that SDL provides when it compiles user code. + */ +#define SDL_Swap64(X) (X) +#endif /* SDL_HAS_64BIT_TYPE */ +/*@}*/ + +/** + * @name SDL_SwapLE and SDL_SwapBE Functions + * Byteswap item from the specified endianness to the native endianness + */ +/*@{*/ +#if SDL_BYTEORDER == SDL_LIL_ENDIAN +#define SDL_SwapLE16(X) (X) +#define SDL_SwapLE32(X) (X) +#define SDL_SwapLE64(X) (X) +#define SDL_SwapBE16(X) SDL_Swap16(X) +#define SDL_SwapBE32(X) SDL_Swap32(X) +#define SDL_SwapBE64(X) SDL_Swap64(X) +#else +#define SDL_SwapLE16(X) SDL_Swap16(X) +#define SDL_SwapLE32(X) SDL_Swap32(X) +#define SDL_SwapLE64(X) SDL_Swap64(X) +#define SDL_SwapBE16(X) (X) +#define SDL_SwapBE32(X) (X) +#define SDL_SwapBE64(X) (X) +#endif +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_endian_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_error.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_error.h new file mode 100644 index 0000000000..b103703a5b --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_error.h @@ -0,0 +1,72 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_error.h + * Simple error message routines for SDL + */ + +#ifndef _SDL_error_h +#define _SDL_error_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @name Public functions + */ +/*@{*/ +extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...); +extern DECLSPEC char * SDLCALL SDL_GetError(void); +extern DECLSPEC void SDLCALL SDL_ClearError(void); +/*@}*/ + +/** + * @name Private functions + * @internal Private error message function - used internally + */ +/*@{*/ +#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) +#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) +typedef enum { + SDL_ENOMEM, + SDL_EFREAD, + SDL_EFWRITE, + SDL_EFSEEK, + SDL_UNSUPPORTED, + SDL_LASTERROR +} SDL_errorcode; +extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code); +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_error_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_events.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_events.h new file mode 100644 index 0000000000..c94a30c9c9 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_events.h @@ -0,0 +1,356 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_events.h + * Include file for SDL event handling + */ + +#ifndef _SDL_events_h +#define _SDL_events_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_active.h" +#include "SDL_keyboard.h" +#include "SDL_mouse.h" +#include "SDL_joystick.h" +#include "SDL_quit.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @name General keyboard/mouse state definitions */ +/*@{*/ +#define SDL_RELEASED 0 +#define SDL_PRESSED 1 +/*@}*/ + +/** Event enumerations */ +typedef enum { + SDL_NOEVENT = 0, /**< Unused (do not remove) */ + SDL_ACTIVEEVENT, /**< Application loses/gains visibility */ + SDL_KEYDOWN, /**< Keys pressed */ + SDL_KEYUP, /**< Keys released */ + SDL_MOUSEMOTION, /**< Mouse moved */ + SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */ + SDL_MOUSEBUTTONUP, /**< Mouse button released */ + SDL_JOYAXISMOTION, /**< Joystick axis motion */ + SDL_JOYBALLMOTION, /**< Joystick trackball motion */ + SDL_JOYHATMOTION, /**< Joystick hat position change */ + SDL_JOYBUTTONDOWN, /**< Joystick button pressed */ + SDL_JOYBUTTONUP, /**< Joystick button released */ + SDL_QUIT, /**< User-requested quit */ + SDL_SYSWMEVENT, /**< System specific event */ + SDL_EVENT_RESERVEDA, /**< Reserved for future use.. */ + SDL_EVENT_RESERVEDB, /**< Reserved for future use.. */ + SDL_VIDEORESIZE, /**< User resized video mode */ + SDL_VIDEOEXPOSE, /**< Screen needs to be redrawn */ + SDL_EVENT_RESERVED2, /**< Reserved for future use.. */ + SDL_EVENT_RESERVED3, /**< Reserved for future use.. */ + SDL_EVENT_RESERVED4, /**< Reserved for future use.. */ + SDL_EVENT_RESERVED5, /**< Reserved for future use.. */ + SDL_EVENT_RESERVED6, /**< Reserved for future use.. */ + SDL_EVENT_RESERVED7, /**< Reserved for future use.. */ + /** Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */ + SDL_USEREVENT = 24, + /** This last event is only for bounding internal arrays + * It is the number of bits in the event mask datatype -- Uint32 + */ + SDL_NUMEVENTS = 32 +} SDL_EventType; + +/** @name Predefined event masks */ +/*@{*/ +#define SDL_EVENTMASK(X) (1<<(X)) +typedef enum { + SDL_ACTIVEEVENTMASK = SDL_EVENTMASK(SDL_ACTIVEEVENT), + SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN), + SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP), + SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN)| + SDL_EVENTMASK(SDL_KEYUP), + SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION), + SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN), + SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP), + SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION)| + SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN)| + SDL_EVENTMASK(SDL_MOUSEBUTTONUP), + SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION), + SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION), + SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION), + SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN), + SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP), + SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION)| + SDL_EVENTMASK(SDL_JOYBALLMOTION)| + SDL_EVENTMASK(SDL_JOYHATMOTION)| + SDL_EVENTMASK(SDL_JOYBUTTONDOWN)| + SDL_EVENTMASK(SDL_JOYBUTTONUP), + SDL_VIDEORESIZEMASK = SDL_EVENTMASK(SDL_VIDEORESIZE), + SDL_VIDEOEXPOSEMASK = SDL_EVENTMASK(SDL_VIDEOEXPOSE), + SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT), + SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT) +} SDL_EventMask ; +#define SDL_ALLEVENTS 0xFFFFFFFF +/*@}*/ + +/** Application visibility event structure */ +typedef struct SDL_ActiveEvent { + Uint8 type; /**< SDL_ACTIVEEVENT */ + Uint8 gain; /**< Whether given states were gained or lost (1/0) */ + Uint8 state; /**< A mask of the focus states */ +} SDL_ActiveEvent; + +/** Keyboard event structure */ +typedef struct SDL_KeyboardEvent { + Uint8 type; /**< SDL_KEYDOWN or SDL_KEYUP */ + Uint8 which; /**< The keyboard device index */ + Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ + SDL_keysym keysym; +} SDL_KeyboardEvent; + +/** Mouse motion event structure */ +typedef struct SDL_MouseMotionEvent { + Uint8 type; /**< SDL_MOUSEMOTION */ + Uint8 which; /**< The mouse device index */ + Uint8 state; /**< The current button state */ + Uint16 x, y; /**< The X/Y coordinates of the mouse */ + Sint16 xrel; /**< The relative motion in the X direction */ + Sint16 yrel; /**< The relative motion in the Y direction */ +} SDL_MouseMotionEvent; + +/** Mouse button event structure */ +typedef struct SDL_MouseButtonEvent { + Uint8 type; /**< SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */ + Uint8 which; /**< The mouse device index */ + Uint8 button; /**< The mouse button index */ + Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ + Uint16 x, y; /**< The X/Y coordinates of the mouse at press time */ +} SDL_MouseButtonEvent; + +/** Joystick axis motion event structure */ +typedef struct SDL_JoyAxisEvent { + Uint8 type; /**< SDL_JOYAXISMOTION */ + Uint8 which; /**< The joystick device index */ + Uint8 axis; /**< The joystick axis index */ + Sint16 value; /**< The axis value (range: -32768 to 32767) */ +} SDL_JoyAxisEvent; + +/** Joystick trackball motion event structure */ +typedef struct SDL_JoyBallEvent { + Uint8 type; /**< SDL_JOYBALLMOTION */ + Uint8 which; /**< The joystick device index */ + Uint8 ball; /**< The joystick trackball index */ + Sint16 xrel; /**< The relative motion in the X direction */ + Sint16 yrel; /**< The relative motion in the Y direction */ +} SDL_JoyBallEvent; + +/** Joystick hat position change event structure */ +typedef struct SDL_JoyHatEvent { + Uint8 type; /**< SDL_JOYHATMOTION */ + Uint8 which; /**< The joystick device index */ + Uint8 hat; /**< The joystick hat index */ + Uint8 value; /**< The hat position value: + * SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP + * SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT + * SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN + * Note that zero means the POV is centered. + */ +} SDL_JoyHatEvent; + +/** Joystick button event structure */ +typedef struct SDL_JoyButtonEvent { + Uint8 type; /**< SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */ + Uint8 which; /**< The joystick device index */ + Uint8 button; /**< The joystick button index */ + Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ +} SDL_JoyButtonEvent; + +/** The "window resized" event + * When you get this event, you are responsible for setting a new video + * mode with the new width and height. + */ +typedef struct SDL_ResizeEvent { + Uint8 type; /**< SDL_VIDEORESIZE */ + int w; /**< New width */ + int h; /**< New height */ +} SDL_ResizeEvent; + +/** The "screen redraw" event */ +typedef struct SDL_ExposeEvent { + Uint8 type; /**< SDL_VIDEOEXPOSE */ +} SDL_ExposeEvent; + +/** The "quit requested" event */ +typedef struct SDL_QuitEvent { + Uint8 type; /**< SDL_QUIT */ +} SDL_QuitEvent; + +/** A user-defined event type */ +typedef struct SDL_UserEvent { + Uint8 type; /**< SDL_USEREVENT through SDL_NUMEVENTS-1 */ + int code; /**< User defined event code */ + void *data1; /**< User defined data pointer */ + void *data2; /**< User defined data pointer */ +} SDL_UserEvent; + +/** If you want to use this event, you should include SDL_syswm.h */ +struct SDL_SysWMmsg; +typedef struct SDL_SysWMmsg SDL_SysWMmsg; +typedef struct SDL_SysWMEvent { + Uint8 type; + SDL_SysWMmsg *msg; +} SDL_SysWMEvent; + +/** General event structure */ +typedef union SDL_Event { + Uint8 type; + SDL_ActiveEvent active; + SDL_KeyboardEvent key; + SDL_MouseMotionEvent motion; + SDL_MouseButtonEvent button; + SDL_JoyAxisEvent jaxis; + SDL_JoyBallEvent jball; + SDL_JoyHatEvent jhat; + SDL_JoyButtonEvent jbutton; + SDL_ResizeEvent resize; + SDL_ExposeEvent expose; + SDL_QuitEvent quit; + SDL_UserEvent user; + SDL_SysWMEvent syswm; +} SDL_Event; + + +/* Function prototypes */ + +/** Pumps the event loop, gathering events from the input devices. + * This function updates the event queue and internal input device state. + * This should only be run in the thread that sets the video mode. + */ +extern DECLSPEC void SDLCALL SDL_PumpEvents(void); + +typedef enum { + SDL_ADDEVENT, + SDL_PEEKEVENT, + SDL_GETEVENT +} SDL_eventaction; + +/** + * Checks the event queue for messages and optionally returns them. + * + * If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to + * the back of the event queue. + * If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front + * of the event queue, matching 'mask', will be returned and will not + * be removed from the queue. + * If 'action' is SDL_GETEVENT, up to 'numevents' events at the front + * of the event queue, matching 'mask', will be returned and will be + * removed from the queue. + * + * @return + * This function returns the number of events actually stored, or -1 + * if there was an error. + * + * This function is thread-safe. + */ +extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents, + SDL_eventaction action, Uint32 mask); + +/** Polls for currently pending events, and returns 1 if there are any pending + * events, or 0 if there are none available. If 'event' is not NULL, the next + * event is removed from the queue and stored in that area. + */ +extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event *event); + +/** Waits indefinitely for the next available event, returning 1, or 0 if there + * was an error while waiting for events. If 'event' is not NULL, the next + * event is removed from the queue and stored in that area. + */ +extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event *event); + +/** Add an event to the event queue. + * This function returns 0 on success, or -1 if the event queue was full + * or there was some other error. + */ +extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event); + +/** @name Event Filtering */ +/*@{*/ +typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event); +/** + * This function sets up a filter to process all events before they + * change internal state and are posted to the internal event queue. + * + * The filter is protypted as: + * @code typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event); @endcode + * + * If the filter returns 1, then the event will be added to the internal queue. + * If it returns 0, then the event will be dropped from the queue, but the + * internal state will still be updated. This allows selective filtering of + * dynamically arriving events. + * + * @warning Be very careful of what you do in the event filter function, as + * it may run in a different thread! + * + * There is one caveat when dealing with the SDL_QUITEVENT event type. The + * event filter is only called when the window manager desires to close the + * application window. If the event filter returns 1, then the window will + * be closed, otherwise the window will remain open if possible. + * If the quit event is generated by an interrupt signal, it will bypass the + * internal queue and be delivered to the application at the next event poll. + */ +extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter); + +/** + * Return the current event filter - can be used to "chain" filters. + * If there is no event filter set, this function returns NULL. + */ +extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter(void); +/*@}*/ + +/** @name Event State */ +/*@{*/ +#define SDL_QUERY -1 +#define SDL_IGNORE 0 +#define SDL_DISABLE 0 +#define SDL_ENABLE 1 +/*@}*/ + +/** +* This function allows you to set the state of processing certain events. +* If 'state' is set to SDL_IGNORE, that event will be automatically dropped +* from the event queue and will not event be filtered. +* If 'state' is set to SDL_ENABLE, that event will be processed normally. +* If 'state' is set to SDL_QUERY, SDL_EventState() will return the +* current processing state of the specified event. +*/ +extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_events_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_getenv.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_getenv.h new file mode 100644 index 0000000000..253ad88cc5 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_getenv.h @@ -0,0 +1,28 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_getenv.h + * @deprecated Use SDL_stdinc.h instead + */ + +/* DEPRECATED */ +#include "SDL_stdinc.h" diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_joystick.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_joystick.h new file mode 100644 index 0000000000..d5135c3d53 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_joystick.h @@ -0,0 +1,187 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_joystick.h + * Include file for SDL joystick event handling + */ + +#ifndef _SDL_joystick_h +#define _SDL_joystick_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @file SDL_joystick.h + * @note In order to use these functions, SDL_Init() must have been called + * with the SDL_INIT_JOYSTICK flag. This causes SDL to scan the system + * for joysticks, and load appropriate drivers. + */ + +/** The joystick structure used to identify an SDL joystick */ +struct _SDL_Joystick; +typedef struct _SDL_Joystick SDL_Joystick; + +/* Function prototypes */ +/** + * Count the number of joysticks attached to the system + */ +extern DECLSPEC int SDLCALL SDL_NumJoysticks(void); + +/** + * Get the implementation dependent name of a joystick. + * + * This can be called before any joysticks are opened. + * If no name can be found, this function returns NULL. + */ +extern DECLSPEC const char * SDLCALL SDL_JoystickName(int device_index); + +/** + * Open a joystick for use. + * + * @param[in] device_index + * The index passed as an argument refers to + * the N'th joystick on the system. This index is the value which will + * identify this joystick in future joystick events. + * + * @return This function returns a joystick identifier, or NULL if an error occurred. + */ +extern DECLSPEC SDL_Joystick * SDLCALL SDL_JoystickOpen(int device_index); + +/** + * Returns 1 if the joystick has been opened, or 0 if it has not. + */ +extern DECLSPEC int SDLCALL SDL_JoystickOpened(int device_index); + +/** + * Get the device index of an opened joystick. + */ +extern DECLSPEC int SDLCALL SDL_JoystickIndex(SDL_Joystick *joystick); + +/** + * Get the number of general axis controls on a joystick + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick); + +/** + * Get the number of trackballs on a joystick + * + * Joystick trackballs have only relative motion events associated + * with them and their state cannot be polled. + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick); + +/** + * Get the number of POV hats on a joystick + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick); + +/** + * Get the number of buttons on a joystick + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick); + +/** + * Update the current state of the open joysticks. + * + * This is called automatically by the event loop if any joystick + * events are enabled. + */ +extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); + +/** + * Enable/disable joystick event polling. + * + * If joystick events are disabled, you must call SDL_JoystickUpdate() + * yourself and check the state of the joystick when you want joystick + * information. + * + * @param[in] state The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE. + */ +extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); + +/** + * Get the current state of an axis control on a joystick + * + * @param[in] axis The axis indices start at index 0. + * + * @return The state is a value ranging from -32768 to 32767. + */ +extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis); + +/** + * @name Hat Positions + * The return value of SDL_JoystickGetHat() is one of the following positions: + */ +/*@{*/ +#define SDL_HAT_CENTERED 0x00 +#define SDL_HAT_UP 0x01 +#define SDL_HAT_RIGHT 0x02 +#define SDL_HAT_DOWN 0x04 +#define SDL_HAT_LEFT 0x08 +#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP) +#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN) +#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) +#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) +/*@}*/ + +/** + * Get the current state of a POV hat on a joystick + * + * @param[in] hat The hat indices start at index 0. + */ +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, int hat); + +/** + * Get the ball axis change since the last poll + * + * @param[in] ball The ball indices start at index 0. + * + * @return This returns 0, or -1 if you passed it invalid parameters. + */ +extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy); + +/** + * Get the current state of a button on a joystick + * + * @param[in] button The button indices start at index 0. + */ +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, int button); + +/** + * Close a joystick previously opened with SDL_JoystickOpen() + */ +extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_joystick_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_keyboard.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_keyboard.h new file mode 100644 index 0000000000..7b59d24e55 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_keyboard.h @@ -0,0 +1,135 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_keyboard.h + * Include file for SDL keyboard event handling + */ + +#ifndef _SDL_keyboard_h +#define _SDL_keyboard_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_keysym.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** Keysym structure + * + * - The scancode is hardware dependent, and should not be used by general + * applications. If no hardware scancode is available, it will be 0. + * + * - The 'unicode' translated character is only available when character + * translation is enabled by the SDL_EnableUNICODE() API. If non-zero, + * this is a UNICODE character corresponding to the keypress. If the + * high 9 bits of the character are 0, then this maps to the equivalent + * ASCII character: + * @code + * char ch; + * if ( (keysym.unicode & 0xFF80) == 0 ) { + * ch = keysym.unicode & 0x7F; + * } else { + * An international character.. + * } + * @endcode + */ +typedef struct SDL_keysym { + Uint8 scancode; /**< hardware specific scancode */ + SDLKey sym; /**< SDL virtual keysym */ + SDLMod mod; /**< current key modifiers */ + Uint16 unicode; /**< translated character */ +} SDL_keysym; + +/** This is the mask which refers to all hotkey bindings */ +#define SDL_ALL_HOTKEYS 0xFFFFFFFF + +/* Function prototypes */ +/** + * Enable/Disable UNICODE translation of keyboard input. + * + * This translation has some overhead, so translation defaults off. + * + * @param[in] enable + * If 'enable' is 1, translation is enabled. + * If 'enable' is 0, translation is disabled. + * If 'enable' is -1, the translation state is not changed. + * + * @return It returns the previous state of keyboard translation. + */ +extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable); + +#define SDL_DEFAULT_REPEAT_DELAY 500 +#define SDL_DEFAULT_REPEAT_INTERVAL 30 +/** + * Enable/Disable keyboard repeat. Keyboard repeat defaults to off. + * + * @param[in] delay + * 'delay' is the initial delay in ms between the time when a key is + * pressed, and keyboard repeat begins. + * + * @param[in] interval + * 'interval' is the time in ms between keyboard repeat events. + * + * If 'delay' is set to 0, keyboard repeat is disabled. + */ +extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval); +extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval); + +/** + * Get a snapshot of the current state of the keyboard. + * Returns an array of keystates, indexed by the SDLK_* syms. + * Usage: + * @code + * Uint8 *keystate = SDL_GetKeyState(NULL); + * if ( keystate[SDLK_RETURN] ) //... \ is pressed. + * @endcode + */ +extern DECLSPEC Uint8 * SDLCALL SDL_GetKeyState(int *numkeys); + +/** + * Get the current key modifier state + */ +extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void); + +/** + * Set the current key modifier state. + * This does not change the keyboard state, only the key modifier flags. + */ +extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate); + +/** + * Get the name of an SDL virtual keysym + */ +extern DECLSPEC char * SDLCALL SDL_GetKeyName(SDLKey key); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_keyboard_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_keysym.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_keysym.h new file mode 100644 index 0000000000..90101286e3 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_keysym.h @@ -0,0 +1,326 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_keysym_h +#define _SDL_keysym_h + +/** What we really want is a mapping of every raw key on the keyboard. + * To support international keyboards, we use the range 0xA1 - 0xFF + * as international virtual keycodes. We'll follow in the footsteps of X11... + * @brief The names of the keys + */ +typedef enum { + /** @name ASCII mapped keysyms + * The keyboard syms have been cleverly chosen to map to ASCII + */ + /*@{*/ + SDLK_UNKNOWN = 0, + SDLK_FIRST = 0, + SDLK_BACKSPACE = 8, + SDLK_TAB = 9, + SDLK_CLEAR = 12, + SDLK_RETURN = 13, + SDLK_PAUSE = 19, + SDLK_ESCAPE = 27, + SDLK_SPACE = 32, + SDLK_EXCLAIM = 33, + SDLK_QUOTEDBL = 34, + SDLK_HASH = 35, + SDLK_DOLLAR = 36, + SDLK_AMPERSAND = 38, + SDLK_QUOTE = 39, + SDLK_LEFTPAREN = 40, + SDLK_RIGHTPAREN = 41, + SDLK_ASTERISK = 42, + SDLK_PLUS = 43, + SDLK_COMMA = 44, + SDLK_MINUS = 45, + SDLK_PERIOD = 46, + SDLK_SLASH = 47, + SDLK_0 = 48, + SDLK_1 = 49, + SDLK_2 = 50, + SDLK_3 = 51, + SDLK_4 = 52, + SDLK_5 = 53, + SDLK_6 = 54, + SDLK_7 = 55, + SDLK_8 = 56, + SDLK_9 = 57, + SDLK_COLON = 58, + SDLK_SEMICOLON = 59, + SDLK_LESS = 60, + SDLK_EQUALS = 61, + SDLK_GREATER = 62, + SDLK_QUESTION = 63, + SDLK_AT = 64, + /* + Skip uppercase letters + */ + SDLK_LEFTBRACKET = 91, + SDLK_BACKSLASH = 92, + SDLK_RIGHTBRACKET = 93, + SDLK_CARET = 94, + SDLK_UNDERSCORE = 95, + SDLK_BACKQUOTE = 96, + SDLK_a = 97, + SDLK_b = 98, + SDLK_c = 99, + SDLK_d = 100, + SDLK_e = 101, + SDLK_f = 102, + SDLK_g = 103, + SDLK_h = 104, + SDLK_i = 105, + SDLK_j = 106, + SDLK_k = 107, + SDLK_l = 108, + SDLK_m = 109, + SDLK_n = 110, + SDLK_o = 111, + SDLK_p = 112, + SDLK_q = 113, + SDLK_r = 114, + SDLK_s = 115, + SDLK_t = 116, + SDLK_u = 117, + SDLK_v = 118, + SDLK_w = 119, + SDLK_x = 120, + SDLK_y = 121, + SDLK_z = 122, + SDLK_DELETE = 127, + /* End of ASCII mapped keysyms */ + /*@}*/ + + /** @name International keyboard syms */ + /*@{*/ + SDLK_WORLD_0 = 160, /* 0xA0 */ + SDLK_WORLD_1 = 161, + SDLK_WORLD_2 = 162, + SDLK_WORLD_3 = 163, + SDLK_WORLD_4 = 164, + SDLK_WORLD_5 = 165, + SDLK_WORLD_6 = 166, + SDLK_WORLD_7 = 167, + SDLK_WORLD_8 = 168, + SDLK_WORLD_9 = 169, + SDLK_WORLD_10 = 170, + SDLK_WORLD_11 = 171, + SDLK_WORLD_12 = 172, + SDLK_WORLD_13 = 173, + SDLK_WORLD_14 = 174, + SDLK_WORLD_15 = 175, + SDLK_WORLD_16 = 176, + SDLK_WORLD_17 = 177, + SDLK_WORLD_18 = 178, + SDLK_WORLD_19 = 179, + SDLK_WORLD_20 = 180, + SDLK_WORLD_21 = 181, + SDLK_WORLD_22 = 182, + SDLK_WORLD_23 = 183, + SDLK_WORLD_24 = 184, + SDLK_WORLD_25 = 185, + SDLK_WORLD_26 = 186, + SDLK_WORLD_27 = 187, + SDLK_WORLD_28 = 188, + SDLK_WORLD_29 = 189, + SDLK_WORLD_30 = 190, + SDLK_WORLD_31 = 191, + SDLK_WORLD_32 = 192, + SDLK_WORLD_33 = 193, + SDLK_WORLD_34 = 194, + SDLK_WORLD_35 = 195, + SDLK_WORLD_36 = 196, + SDLK_WORLD_37 = 197, + SDLK_WORLD_38 = 198, + SDLK_WORLD_39 = 199, + SDLK_WORLD_40 = 200, + SDLK_WORLD_41 = 201, + SDLK_WORLD_42 = 202, + SDLK_WORLD_43 = 203, + SDLK_WORLD_44 = 204, + SDLK_WORLD_45 = 205, + SDLK_WORLD_46 = 206, + SDLK_WORLD_47 = 207, + SDLK_WORLD_48 = 208, + SDLK_WORLD_49 = 209, + SDLK_WORLD_50 = 210, + SDLK_WORLD_51 = 211, + SDLK_WORLD_52 = 212, + SDLK_WORLD_53 = 213, + SDLK_WORLD_54 = 214, + SDLK_WORLD_55 = 215, + SDLK_WORLD_56 = 216, + SDLK_WORLD_57 = 217, + SDLK_WORLD_58 = 218, + SDLK_WORLD_59 = 219, + SDLK_WORLD_60 = 220, + SDLK_WORLD_61 = 221, + SDLK_WORLD_62 = 222, + SDLK_WORLD_63 = 223, + SDLK_WORLD_64 = 224, + SDLK_WORLD_65 = 225, + SDLK_WORLD_66 = 226, + SDLK_WORLD_67 = 227, + SDLK_WORLD_68 = 228, + SDLK_WORLD_69 = 229, + SDLK_WORLD_70 = 230, + SDLK_WORLD_71 = 231, + SDLK_WORLD_72 = 232, + SDLK_WORLD_73 = 233, + SDLK_WORLD_74 = 234, + SDLK_WORLD_75 = 235, + SDLK_WORLD_76 = 236, + SDLK_WORLD_77 = 237, + SDLK_WORLD_78 = 238, + SDLK_WORLD_79 = 239, + SDLK_WORLD_80 = 240, + SDLK_WORLD_81 = 241, + SDLK_WORLD_82 = 242, + SDLK_WORLD_83 = 243, + SDLK_WORLD_84 = 244, + SDLK_WORLD_85 = 245, + SDLK_WORLD_86 = 246, + SDLK_WORLD_87 = 247, + SDLK_WORLD_88 = 248, + SDLK_WORLD_89 = 249, + SDLK_WORLD_90 = 250, + SDLK_WORLD_91 = 251, + SDLK_WORLD_92 = 252, + SDLK_WORLD_93 = 253, + SDLK_WORLD_94 = 254, + SDLK_WORLD_95 = 255, /* 0xFF */ + /*@}*/ + + /** @name Numeric keypad */ + /*@{*/ + SDLK_KP0 = 256, + SDLK_KP1 = 257, + SDLK_KP2 = 258, + SDLK_KP3 = 259, + SDLK_KP4 = 260, + SDLK_KP5 = 261, + SDLK_KP6 = 262, + SDLK_KP7 = 263, + SDLK_KP8 = 264, + SDLK_KP9 = 265, + SDLK_KP_PERIOD = 266, + SDLK_KP_DIVIDE = 267, + SDLK_KP_MULTIPLY = 268, + SDLK_KP_MINUS = 269, + SDLK_KP_PLUS = 270, + SDLK_KP_ENTER = 271, + SDLK_KP_EQUALS = 272, + /*@}*/ + + /** @name Arrows + Home/End pad */ + /*@{*/ + SDLK_UP = 273, + SDLK_DOWN = 274, + SDLK_RIGHT = 275, + SDLK_LEFT = 276, + SDLK_INSERT = 277, + SDLK_HOME = 278, + SDLK_END = 279, + SDLK_PAGEUP = 280, + SDLK_PAGEDOWN = 281, + /*@}*/ + + /** @name Function keys */ + /*@{*/ + SDLK_F1 = 282, + SDLK_F2 = 283, + SDLK_F3 = 284, + SDLK_F4 = 285, + SDLK_F5 = 286, + SDLK_F6 = 287, + SDLK_F7 = 288, + SDLK_F8 = 289, + SDLK_F9 = 290, + SDLK_F10 = 291, + SDLK_F11 = 292, + SDLK_F12 = 293, + SDLK_F13 = 294, + SDLK_F14 = 295, + SDLK_F15 = 296, + /*@}*/ + + /** @name Key state modifier keys */ + /*@{*/ + SDLK_NUMLOCK = 300, + SDLK_CAPSLOCK = 301, + SDLK_SCROLLOCK = 302, + SDLK_RSHIFT = 303, + SDLK_LSHIFT = 304, + SDLK_RCTRL = 305, + SDLK_LCTRL = 306, + SDLK_RALT = 307, + SDLK_LALT = 308, + SDLK_RMETA = 309, + SDLK_LMETA = 310, + SDLK_LSUPER = 311, /**< Left "Windows" key */ + SDLK_RSUPER = 312, /**< Right "Windows" key */ + SDLK_MODE = 313, /**< "Alt Gr" key */ + SDLK_COMPOSE = 314, /**< Multi-key compose key */ + /*@}*/ + + /** @name Miscellaneous function keys */ + /*@{*/ + SDLK_HELP = 315, + SDLK_PRINT = 316, + SDLK_SYSREQ = 317, + SDLK_BREAK = 318, + SDLK_MENU = 319, + SDLK_POWER = 320, /**< Power Macintosh power key */ + SDLK_EURO = 321, /**< Some european keyboards */ + SDLK_UNDO = 322, /**< Atari keyboard has Undo */ + /*@}*/ + + /* Add any other keys here */ + + SDLK_LAST +} SDLKey; + +/** Enumeration of valid key mods (possibly OR'd together) */ +typedef enum { + KMOD_NONE = 0x0000, + KMOD_LSHIFT= 0x0001, + KMOD_RSHIFT= 0x0002, + KMOD_LCTRL = 0x0040, + KMOD_RCTRL = 0x0080, + KMOD_LALT = 0x0100, + KMOD_RALT = 0x0200, + KMOD_LMETA = 0x0400, + KMOD_RMETA = 0x0800, + KMOD_NUM = 0x1000, + KMOD_CAPS = 0x2000, + KMOD_MODE = 0x4000, + KMOD_RESERVED = 0x8000 +} SDLMod; + +#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) +#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) +#define KMOD_ALT (KMOD_LALT|KMOD_RALT) +#define KMOD_META (KMOD_LMETA|KMOD_RMETA) + +#endif /* _SDL_keysym_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_loadso.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_loadso.h new file mode 100644 index 0000000000..45a17f9f41 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_loadso.h @@ -0,0 +1,78 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_loadso.h + * System dependent library loading routines + */ + +/** @file SDL_loadso.h + * Some things to keep in mind: + * - These functions only work on C function names. Other languages may + * have name mangling and intrinsic language support that varies from + * compiler to compiler. + * - Make sure you declare your function pointers with the same calling + * convention as the actual library function. Your code will crash + * mysteriously if you do not do this. + * - Avoid namespace collisions. If you load a symbol from the library, + * it is not defined whether or not it goes into the global symbol + * namespace for the application. If it does and it conflicts with + * symbols in your code or other shared libraries, you will not get + * the results you expect. :) + */ + + +#ifndef _SDL_loadso_h +#define _SDL_loadso_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This function dynamically loads a shared object and returns a pointer + * to the object handle (or NULL if there was an error). + * The 'sofile' parameter is a system dependent name of the object file. + */ +extern DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile); + +/** + * Given an object handle, this function looks up the address of the + * named function in the shared object and returns it. This address + * is no longer valid after calling SDL_UnloadObject(). + */ +extern DECLSPEC void * SDLCALL SDL_LoadFunction(void *handle, const char *name); + +/** Unload a shared object from memory */ +extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_loadso_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_main.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_main.h new file mode 100644 index 0000000000..b7f6b2c823 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_main.h @@ -0,0 +1,106 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_main_h +#define _SDL_main_h + +#include "SDL_stdinc.h" + +/** @file SDL_main.h + * Redefine main() on Win32 and MacOS so that it is called by winmain.c + */ + +#if defined(__WIN32__) || \ + (defined(__MWERKS__) && !defined(__BEOS__)) || \ + defined(__MACOS__) || defined(__MACOSX__) || \ + defined(__SYMBIAN32__) || defined(QWS) + +#ifdef __cplusplus +#define C_LINKAGE "C" +#else +#define C_LINKAGE +#endif /* __cplusplus */ + +/** The application's main() function must be called with C linkage, + * and should be declared like this: + * @code + * #ifdef __cplusplus + * extern "C" + * #endif + * int main(int argc, char *argv[]) + * { + * } + * @endcode + */ +#define main SDL_main + +/** The prototype for the application's main() function */ +extern C_LINKAGE int SDL_main(int argc, char *argv[]); + + +/** @name From the SDL library code -- needed for registering the app on Win32 */ +/*@{*/ +#ifdef __WIN32__ + +#include "begin_code.h" +#ifdef __cplusplus +extern "C" { +#endif + +/** This should be called from your WinMain() function, if any */ +extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst); +/** This can also be called, but is no longer necessary */ +extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst); +/** This can also be called, but is no longer necessary (SDL_Quit calls it) */ +extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); +#ifdef __cplusplus +} +#endif +#include "close_code.h" +#endif +/*@}*/ + +/** @name From the SDL library code -- needed for registering QuickDraw on MacOS */ +/*@{*/ +#if defined(__MACOS__) + +#include "begin_code.h" +#ifdef __cplusplus +extern "C" { +#endif + +/** Forward declaration so we don't need to include QuickDraw.h */ +struct QDGlobals; + +/** This should be called from your main() function, if any */ +extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd); + +#ifdef __cplusplus +} +#endif +#include "close_code.h" +#endif +/*@}*/ + +#endif /* Need to redefine main()? */ + +#endif /* _SDL_main_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_mouse.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_mouse.h new file mode 100644 index 0000000000..a573f04ee0 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_mouse.h @@ -0,0 +1,143 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_mouse.h + * Include file for SDL mouse event handling + */ + +#ifndef _SDL_mouse_h +#define _SDL_mouse_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct WMcursor WMcursor; /**< Implementation dependent */ +typedef struct SDL_Cursor { + SDL_Rect area; /**< The area of the mouse cursor */ + Sint16 hot_x, hot_y; /**< The "tip" of the cursor */ + Uint8 *data; /**< B/W cursor data */ + Uint8 *mask; /**< B/W cursor mask */ + Uint8 *save[2]; /**< Place to save cursor area */ + WMcursor *wm_cursor; /**< Window-manager cursor */ +} SDL_Cursor; + +/* Function prototypes */ +/** + * Retrieve the current state of the mouse. + * The current button state is returned as a button bitmask, which can + * be tested using the SDL_BUTTON(X) macros, and x and y are set to the + * current mouse cursor position. You can pass NULL for either x or y. + */ +extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y); + +/** + * Retrieve the current state of the mouse. + * The current button state is returned as a button bitmask, which can + * be tested using the SDL_BUTTON(X) macros, and x and y are set to the + * mouse deltas since the last call to SDL_GetRelativeMouseState(). + */ +extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); + +/** + * Set the position of the mouse cursor (generates a mouse motion event) + */ +extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y); + +/** + * Create a cursor using the specified data and mask (in MSB format). + * The cursor width must be a multiple of 8 bits. + * + * The cursor is created in black and white according to the following: + * data mask resulting pixel on screen + * 0 1 White + * 1 1 Black + * 0 0 Transparent + * 1 0 Inverted color if possible, black if not. + * + * Cursors created with this function must be freed with SDL_FreeCursor(). + */ +extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor + (Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y); + +/** + * Set the currently active cursor to the specified one. + * If the cursor is currently visible, the change will be immediately + * represented on the display. + */ +extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor); + +/** + * Returns the currently active cursor. + */ +extern DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void); + +/** + * Deallocates a cursor created with SDL_CreateCursor(). + */ +extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor *cursor); + +/** + * Toggle whether or not the cursor is shown on the screen. + * The cursor start off displayed, but can be turned off. + * SDL_ShowCursor() returns 1 if the cursor was being displayed + * before the call, or 0 if it was not. You can query the current + * state by passing a 'toggle' value of -1. + */ +extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); + +/*@{*/ +/** Used as a mask when testing buttons in buttonstate + * Button 1: Left mouse button + * Button 2: Middle mouse button + * Button 3: Right mouse button + * Button 4: Mouse wheel up (may also be a real button) + * Button 5: Mouse wheel down (may also be a real button) + */ +#define SDL_BUTTON(X) (1 << ((X)-1)) +#define SDL_BUTTON_LEFT 1 +#define SDL_BUTTON_MIDDLE 2 +#define SDL_BUTTON_RIGHT 3 +#define SDL_BUTTON_WHEELUP 4 +#define SDL_BUTTON_WHEELDOWN 5 +#define SDL_BUTTON_X1 6 +#define SDL_BUTTON_X2 7 +#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) +#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) +#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) +#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1) +#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2) +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_mouse_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_mutex.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_mutex.h new file mode 100644 index 0000000000..920971dfa7 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_mutex.h @@ -0,0 +1,177 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_mutex_h +#define _SDL_mutex_h + +/** @file SDL_mutex.h + * Functions to provide thread synchronization primitives + * + * @note These are independent of the other SDL routines. + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** Synchronization functions which can time out return this value + * if they time out. + */ +#define SDL_MUTEX_TIMEDOUT 1 + +/** This is the timeout value which corresponds to never time out */ +#define SDL_MUTEX_MAXWAIT (~(Uint32)0) + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name Mutex functions */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** The SDL mutex structure, defined in SDL_mutex.c */ +struct SDL_mutex; +typedef struct SDL_mutex SDL_mutex; + +/** Create a mutex, initialized unlocked */ +extern DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void); + +#define SDL_LockMutex(m) SDL_mutexP(m) +/** Lock the mutex + * @return 0, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex *mutex); + +#define SDL_UnlockMutex(m) SDL_mutexV(m) +/** Unlock the mutex + * @return 0, or -1 on error + * + * It is an error to unlock a mutex that has not been locked by + * the current thread, and doing so results in undefined behavior. + */ +extern DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex *mutex); + +/** Destroy a mutex */ +extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex *mutex); + +/*@}*/ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name Semaphore functions */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** The SDL semaphore structure, defined in SDL_sem.c */ +struct SDL_semaphore; +typedef struct SDL_semaphore SDL_sem; + +/** Create a semaphore, initialized with value, returns NULL on failure. */ +extern DECLSPEC SDL_sem * SDLCALL SDL_CreateSemaphore(Uint32 initial_value); + +/** Destroy a semaphore */ +extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem); + +/** + * This function suspends the calling thread until the semaphore pointed + * to by sem has a positive count. It then atomically decreases the semaphore + * count. + */ +extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem *sem); + +/** Non-blocking variant of SDL_SemWait(). + * @return 0 if the wait succeeds, + * SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem *sem); + +/** Variant of SDL_SemWait() with a timeout in milliseconds, returns 0 if + * the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in + * the allotted time, and -1 on error. + * + * On some platforms this function is implemented by looping with a delay + * of 1 ms, and so should be avoided if possible. + */ +extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms); + +/** Atomically increases the semaphore's count (not blocking). + * @return 0, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem *sem); + +/** Returns the current count of the semaphore */ +extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem *sem); + +/*@}*/ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name Condition_variable_functions */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*@{*/ +/** The SDL condition variable structure, defined in SDL_cond.c */ +struct SDL_cond; +typedef struct SDL_cond SDL_cond; +/*@}*/ + +/** Create a condition variable */ +extern DECLSPEC SDL_cond * SDLCALL SDL_CreateCond(void); + +/** Destroy a condition variable */ +extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond *cond); + +/** Restart one of the threads that are waiting on the condition variable, + * @return 0 or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond *cond); + +/** Restart all threads that are waiting on the condition variable, + * @return 0 or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond *cond); + +/** Wait on the condition variable, unlocking the provided mutex. + * The mutex must be locked before entering this function! + * The mutex is re-locked once the condition variable is signaled. + * @return 0 when it is signaled, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond *cond, SDL_mutex *mut); + +/** Waits for at most 'ms' milliseconds, and returns 0 if the condition + * variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not + * signaled in the allotted time, and -1 on error. + * On some platforms this function is implemented by looping with a delay + * of 1 ms, and so should be avoided if possible. + */ +extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms); + +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_mutex_h */ + diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_name.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_name.h new file mode 100644 index 0000000000..511619af56 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_name.h @@ -0,0 +1,11 @@ + +#ifndef _SDLname_h_ +#define _SDLname_h_ + +#if defined(__STDC__) || defined(__cplusplus) +#define NeedFunctionPrototypes 1 +#endif + +#define SDL_NAME(X) SDL_##X + +#endif /* _SDLname_h_ */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_opengl.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_opengl.h new file mode 100644 index 0000000000..c479a3a4e4 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_opengl.h @@ -0,0 +1,6556 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_opengl.h + * This is a simple file to encapsulate the OpenGL API headers + */ + +#include "SDL_config.h" + +#ifdef __WIN32__ +#define WIN32_LEAN_AND_MEAN +#ifndef NOMINMAX +#define NOMINMAX /* Don't defined min() and max() */ +#endif +#include +#endif +#ifndef NO_SDL_GLEXT +#define __glext_h_ /* Don't let gl.h include glext.h */ +#endif +#if defined(__MACOSX__) +#include /* Header File For The OpenGL Library */ +#include /* Header File For The GLU Library */ +#elif defined(__MACOS__) +#include /* Header File For The OpenGL Library */ +#include /* Header File For The GLU Library */ +#else +#include /* Header File For The OpenGL Library */ +#include /* Header File For The GLU Library */ +#endif +#ifndef NO_SDL_GLEXT +#undef __glext_h_ +#endif + +/** @name GLext.h + * This file taken from "GLext.h" from the Jeff Molofee OpenGL tutorials. + * It is included here because glext.h is not available on some systems. + * If you don't want this version included, simply define "NO_SDL_GLEXT" + */ +/*@{*/ +#ifndef NO_SDL_GLEXT +#if !defined(__glext_h_) && !defined(GL_GLEXT_LEGACY) +#define __glext_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.1 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: This software was created using the +** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has +** not been independently verified as being compliant with the OpenGL(R) +** version 1.2.1 Specification. +*/ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#define WIN32_LEAN_AND_MEAN 1 +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif +#ifndef GLAPI +#define GLAPI extern +#endif + +/*************************************************************/ + +/* Header file version number, required by OpenGL ABI for Linux */ +/* glext.h last updated 2005/06/20 */ +/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ +#define GL_GLEXT_VERSION 29 + +#ifndef GL_VERSION_1_2 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_RESCALE_NORMAL 0x803A +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#endif + +#ifndef GL_ARB_imaging +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_CONSTANT_BORDER 0x8151 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +#endif + +#ifndef GL_VERSION_1_3 +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_MULTISAMPLE_BIT 0x20000000 +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#endif + +#ifndef GL_VERSION_1_4 +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_COMPARE_R_TO_TEXTURE 0x884E +#endif + +#ifndef GL_VERSION_1_5 +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 +#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE +#define GL_FOG_COORD GL_FOG_COORDINATE +#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE +#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE +#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER +#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING +#define GL_SRC0_RGB GL_SOURCE0_RGB +#define GL_SRC1_RGB GL_SOURCE1_RGB +#define GL_SRC2_RGB GL_SOURCE2_RGB +#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA +#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA +#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA +#endif + +#ifndef GL_VERSION_2_0 +#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_COORDS 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 +#endif + +#ifndef GL_ARB_multitexture +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 +#endif + +#ifndef GL_ARB_multisample +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 +#endif + +#ifndef GL_ARB_texture_env_add +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C +#endif + +#ifndef GL_ARB_texture_compression +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_CLAMP_TO_BORDER_ARB 0x812D +#endif + +#ifndef GL_ARB_point_parameters +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 +#endif + +#ifndef GL_ARB_vertex_blend +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F +#endif + +#ifndef GL_ARB_matrix_palette +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#endif + +#ifndef GL_ARB_texture_env_crossbar +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF +#endif + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_ARB 0x8370 +#endif + +#ifndef GL_ARB_depth_texture +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B +#endif + +#ifndef GL_ARB_shadow +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E +#endif + +#ifndef GL_ARB_shadow_ambient +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF +#endif + +#ifndef GL_ARB_window_pos +#endif + +#ifndef GL_ARB_vertex_program +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF +#endif + +#ifndef GL_ARB_fragment_program +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 +#endif + +#ifndef GL_ARB_vertex_buffer_object +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA +#endif + +#ifndef GL_ARB_occlusion_query +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 +#endif + +#ifndef GL_ARB_shader_objects +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 +#endif + +#ifndef GL_ARB_vertex_shader +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A +#endif + +#ifndef GL_ARB_fragment_shader +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B +#endif + +#ifndef GL_ARB_shading_language_100 +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C +#endif + +#ifndef GL_ARB_texture_non_power_of_two +#endif + +#ifndef GL_ARB_point_sprite +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 +#endif + +#ifndef GL_ARB_fragment_program_shadow +#endif + +#ifndef GL_ARB_draw_buffers +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 +#endif + +#ifndef GL_ARB_texture_rectangle +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#endif + +#ifndef GL_ARB_color_buffer_float +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D +#endif + +#ifndef GL_ARB_half_float_pixel +#define GL_HALF_FLOAT_ARB 0x140B +#endif + +#ifndef GL_ARB_texture_float +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#endif + +#ifndef GL_ARB_pixel_buffer_object +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF +#endif + +#ifndef GL_EXT_abgr +#define GL_ABGR_EXT 0x8000 +#endif + +#ifndef GL_EXT_blend_color +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 +#endif + +#ifndef GL_EXT_texture +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 +#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 +#endif + +#ifndef GL_EXT_texture3D +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_FILTER4_SGIS 0x8146 +#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 +#endif + +#ifndef GL_EXT_subtexture +#endif + +#ifndef GL_EXT_copy_texture +#endif + +#ifndef GL_EXT_histogram +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 +#define GL_TABLE_TOO_LARGE_EXT 0x8031 +#endif + +#ifndef GL_EXT_convolution +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 +#endif + +#ifndef GL_SGI_color_matrix +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB +#endif + +#ifndef GL_SGI_color_table +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF +#endif + +#ifndef GL_SGIS_pixel_texture +#define GL_PIXEL_TEXTURE_SGIS 0x8353 +#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 +#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 +#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 +#endif + +#ifndef GL_SGIX_pixel_texture +#define GL_PIXEL_TEX_GEN_SGIX 0x8139 +#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B +#endif + +#ifndef GL_SGIS_texture4D +#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 +#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 +#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 +#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 +#define GL_TEXTURE_4D_SGIS 0x8134 +#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 +#define GL_TEXTURE_4DSIZE_SGIS 0x8136 +#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 +#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 +#define GL_TEXTURE_4D_BINDING_SGIS 0x814F +#endif + +#ifndef GL_SGI_texture_color_table +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD +#endif + +#ifndef GL_EXT_cmyka +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F +#endif + +#ifndef GL_EXT_texture_object +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 +#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 +#define GL_LINEAR_DETAIL_SGIS 0x8097 +#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 +#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 +#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A +#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B +#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_LINEAR_SHARPEN_SGIS 0x80AD +#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE +#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF +#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D +#endif + +#ifndef GL_SGIS_multisample +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_RESCALE_NORMAL_EXT 0x803A +#endif + +#ifndef GL_EXT_vertex_array +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 +#endif + +#ifndef GL_EXT_misc_attribute +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 +#endif + +#ifndef GL_SGIX_clipmap +#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 +#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 +#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 +#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 +#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 +#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 +#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 +#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 +#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 +#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D +#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E +#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F +#endif + +#ifndef GL_SGIX_shadow +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D +#endif + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_CLAMP_TO_EDGE_SGIS 0x812F +#endif + +#ifndef GL_SGIS_texture_border_clamp +#define GL_CLAMP_TO_BORDER_SGIS 0x812D +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B +#endif + +#ifndef GL_EXT_blend_logic_op +#endif + +#ifndef GL_SGIX_interlace +#define GL_INTERLACE_SGIX 0x8094 +#endif + +#ifndef GL_SGIX_pixel_tiles +#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E +#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F +#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 +#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 +#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 +#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 +#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 +#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 +#endif + +#ifndef GL_SGIS_texture_select +#define GL_DUAL_ALPHA4_SGIS 0x8110 +#define GL_DUAL_ALPHA8_SGIS 0x8111 +#define GL_DUAL_ALPHA12_SGIS 0x8112 +#define GL_DUAL_ALPHA16_SGIS 0x8113 +#define GL_DUAL_LUMINANCE4_SGIS 0x8114 +#define GL_DUAL_LUMINANCE8_SGIS 0x8115 +#define GL_DUAL_LUMINANCE12_SGIS 0x8116 +#define GL_DUAL_LUMINANCE16_SGIS 0x8117 +#define GL_DUAL_INTENSITY4_SGIS 0x8118 +#define GL_DUAL_INTENSITY8_SGIS 0x8119 +#define GL_DUAL_INTENSITY12_SGIS 0x811A +#define GL_DUAL_INTENSITY16_SGIS 0x811B +#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C +#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D +#define GL_QUAD_ALPHA4_SGIS 0x811E +#define GL_QUAD_ALPHA8_SGIS 0x811F +#define GL_QUAD_LUMINANCE4_SGIS 0x8120 +#define GL_QUAD_LUMINANCE8_SGIS 0x8121 +#define GL_QUAD_INTENSITY4_SGIS 0x8122 +#define GL_QUAD_INTENSITY8_SGIS 0x8123 +#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 +#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 +#endif + +#ifndef GL_SGIX_sprite +#define GL_SPRITE_SGIX 0x8148 +#define GL_SPRITE_MODE_SGIX 0x8149 +#define GL_SPRITE_AXIS_SGIX 0x814A +#define GL_SPRITE_TRANSLATION_SGIX 0x814B +#define GL_SPRITE_AXIAL_SGIX 0x814C +#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D +#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E +#endif + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E +#endif + +#ifndef GL_EXT_point_parameters +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 +#endif + +#ifndef GL_SGIS_point_parameters +#define GL_POINT_SIZE_MIN_SGIS 0x8126 +#define GL_POINT_SIZE_MAX_SGIS 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 +#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 +#endif + +#ifndef GL_SGIX_instruments +#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 +#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 +#endif + +#ifndef GL_SGIX_texture_scale_bias +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C +#endif + +#ifndef GL_SGIX_framezoom +#define GL_FRAMEZOOM_SGIX 0x818B +#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C +#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D +#endif + +#ifndef GL_SGIX_tag_sample_buffer +#endif + +#ifndef GL_FfdMaskSGIX +#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 +#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 +#endif + +#ifndef GL_SGIX_polynomial_ffd +#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 +#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 +#define GL_DEFORMATIONS_MASK_SGIX 0x8196 +#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 +#endif + +#ifndef GL_SGIX_reference_plane +#define GL_REFERENCE_PLANE_SGIX 0x817D +#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E +#endif + +#ifndef GL_SGIX_flush_raster +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 +#endif + +#ifndef GL_SGIS_fog_function +#define GL_FOG_FUNC_SGIS 0x812A +#define GL_FOG_FUNC_POINTS_SGIS 0x812B +#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C +#endif + +#ifndef GL_SGIX_fog_offset +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 +#endif + +#ifndef GL_HP_image_transform +#define GL_IMAGE_SCALE_X_HP 0x8155 +#define GL_IMAGE_SCALE_Y_HP 0x8156 +#define GL_IMAGE_TRANSLATE_X_HP 0x8157 +#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 +#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 +#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A +#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B +#define GL_IMAGE_MAG_FILTER_HP 0x815C +#define GL_IMAGE_MIN_FILTER_HP 0x815D +#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E +#define GL_CUBIC_HP 0x815F +#define GL_AVERAGE_HP 0x8160 +#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 +#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 +#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 +#endif + +#ifndef GL_HP_convolution_border_modes +#define GL_IGNORE_BORDER_HP 0x8150 +#define GL_CONSTANT_BORDER_HP 0x8151 +#define GL_REPLICATE_BORDER_HP 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 +#endif + +#ifndef GL_INGR_palette_buffer +#endif + +#ifndef GL_SGIX_texture_add_env +#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE +#endif + +#ifndef GL_EXT_color_subtable +#endif + +#ifndef GL_PGI_vertex_hints +#define GL_VERTEX_DATA_HINT_PGI 0x1A22A +#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B +#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C +#define GL_MAX_VERTEX_HINT_PGI 0x1A22D +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#endif + +#ifndef GL_PGI_misc_hints +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 +#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD +#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 +#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C +#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E +#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F +#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 +#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 +#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 +#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 +#define GL_CLIP_NEAR_HINT_PGI 0x1A220 +#define GL_CLIP_FAR_HINT_PGI 0x1A221 +#define GL_WIDE_LINE_HINT_PGI 0x1A222 +#define GL_BACK_NORMALS_HINT_PGI 0x1A223 +#endif + +#ifndef GL_EXT_paletted_texture +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#endif + +#ifndef GL_EXT_clip_volume_hint +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 +#endif + +#ifndef GL_SGIX_list_priority +#define GL_LIST_PRIORITY_SGIX 0x8182 +#endif + +#ifndef GL_SGIX_ir_instrument1 +#define GL_IR_INSTRUMENT1_SGIX 0x817F +#endif + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 +#endif + +#ifndef GL_SGIX_texture_lod_bias +#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E +#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F +#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 +#endif + +#ifndef GL_SGIX_shadow_ambient +#define GL_SHADOW_AMBIENT_SGIX 0x80BF +#endif + +#ifndef GL_EXT_index_texture +#endif + +#ifndef GL_EXT_index_material +#define GL_INDEX_MATERIAL_EXT 0x81B8 +#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 +#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA +#endif + +#ifndef GL_EXT_index_func +#define GL_INDEX_TEST_EXT 0x81B5 +#define GL_INDEX_TEST_FUNC_EXT 0x81B6 +#define GL_INDEX_TEST_REF_EXT 0x81B7 +#endif + +#ifndef GL_EXT_index_array_formats +#define GL_IUI_V2F_EXT 0x81AD +#define GL_IUI_V3F_EXT 0x81AE +#define GL_IUI_N3F_V2F_EXT 0x81AF +#define GL_IUI_N3F_V3F_EXT 0x81B0 +#define GL_T2F_IUI_V2F_EXT 0x81B1 +#define GL_T2F_IUI_V3F_EXT 0x81B2 +#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 +#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC +#endif + +#ifndef GL_SGIX_ycrcb +#define GL_YCRCB_422_SGIX 0x81BB +#define GL_YCRCB_444_SGIX 0x81BC +#endif + +#ifndef GL_SGIX_fragment_lighting +#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 +#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 +#define GL_LIGHT_ENV_MODE_SGIX 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B +#define GL_FRAGMENT_LIGHT0_SGIX 0x840C +#define GL_FRAGMENT_LIGHT1_SGIX 0x840D +#define GL_FRAGMENT_LIGHT2_SGIX 0x840E +#define GL_FRAGMENT_LIGHT3_SGIX 0x840F +#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 +#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 +#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 +#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 +#endif + +#ifndef GL_IBM_rasterpos_clip +#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 +#endif + +#ifndef GL_HP_texture_lighting +#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 +#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 +#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 +#endif + +#ifndef GL_WIN_phong_shading +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB +#endif + +#ifndef GL_WIN_specular_fog +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC +#endif + +#ifndef GL_EXT_light_texture +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 +/* reuse GL_FRAGMENT_DEPTH_EXT */ +#endif + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 +#endif + +#ifndef GL_SGIX_impact_pixel_texture +#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184 +#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185 +#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186 +#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187 +#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188 +#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189 +#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A +#endif + +#ifndef GL_EXT_bgra +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 +#endif + +#ifndef GL_SGIX_async +#define GL_ASYNC_MARKER_SGIX 0x8329 +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D +#endif + +#ifndef GL_INTEL_texture_scissor +#endif + +#ifndef GL_INTEL_parallel_arrays +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 +#endif + +#ifndef GL_HP_occlusion_test +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 +#endif + +#ifndef GL_EXT_pixel_transform +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA +#endif + +#ifndef GL_EXT_secondary_color +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E +#endif + +#ifndef GL_EXT_texture_perturb_normal +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF +#endif + +#ifndef GL_EXT_multi_draw_arrays +#endif + +#ifndef GL_EXT_fog_coord +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 +#endif + +#ifndef GL_REND_screen_coordinates +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 +#endif + +#ifndef GL_EXT_coordinate_frame +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 +#endif + +#ifndef GL_EXT_texture_env_combine +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A +#endif + +#ifndef GL_APPLE_specular_vector +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 +#endif + +#ifndef GL_APPLE_transform_hint +#define GL_TRANSFORM_HINT_APPLE 0x85B1 +#endif + +#ifndef GL_SGIX_fog_scale +#define GL_FOG_SCALE_SGIX 0x81FC +#define GL_FOG_SCALE_VALUE_SGIX 0x81FD +#endif + +#ifndef GL_SUNX_constant_data +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 +#endif + +#ifndef GL_SUN_global_alpha +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA +#endif + +#ifndef GL_SUN_triangle_list +#define GL_RESTART_SUN 0x0001 +#define GL_REPLACE_MIDDLE_SUN 0x0002 +#define GL_REPLACE_OLDEST_SUN 0x0003 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB +#endif + +#ifndef GL_SUN_vertex +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB +#endif + +#ifndef GL_INGR_color_clamp +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 +#endif + +#ifndef GL_INGR_interlace_read +#define GL_INTERLACE_READ_INGR 0x8568 +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 +#endif + +#ifndef GL_EXT_422_pixels +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 +#endif + +#ifndef GL_EXT_texture_cube_map +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C +#endif + +#ifndef GL_SUN_convolution_border_modes +#define GL_WRAP_BORDER_SUN 0x81D4 +#endif + +#ifndef GL_EXT_texture_env_add +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW0_EXT GL_MODELVIEW +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 +#endif + +#ifndef GL_NV_vertex_array_range +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 +#endif + +#ifndef GL_NV_register_combiners +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 +/* reuse GL_TEXTURE0_ARB */ +/* reuse GL_TEXTURE1_ARB */ +/* reuse GL_ZERO */ +/* reuse GL_NONE */ +/* reuse GL_FOG */ +#endif + +#ifndef GL_NV_fog_distance +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C +/* reuse GL_EYE_PLANE */ +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F +#endif + +#ifndef GL_NV_blend_square +#endif + +#ifndef GL_NV_texture_env_combine4 +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B +#endif + +#ifndef GL_MESA_resize_buffers +#endif + +#ifndef GL_MESA_window_pos +#endif + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#endif + +#ifndef GL_IBM_cull_vertex +#define GL_CULL_VERTEX_IBM 103050 +#endif + +#ifndef GL_IBM_multimode_draw_arrays +#endif + +#ifndef GL_IBM_vertex_array_lists +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 +#endif + +#ifndef GL_SGIX_subsample +#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 +#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 +#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 +#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 +#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 +#endif + +#ifndef GL_SGIX_ycrcb_subsample +#endif + +#ifndef GL_SGIX_ycrcba +#define GL_YCRCB_SGIX 0x8318 +#define GL_YCRCBA_SGIX 0x8319 +#endif + +#ifndef GL_SGI_depth_pass_instrument +#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 +#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 +#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 +#endif + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 +#endif + +#ifndef GL_3DFX_multisample +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 +#endif + +#ifndef GL_3DFX_tbuffer +#endif + +#ifndef GL_EXT_multisample +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 +#endif + +#ifndef GL_SGIX_vertex_preclip +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF +#endif + +#ifndef GL_SGIX_convolution_accuracy +#define GL_CONVOLUTION_HINT_SGIX 0x8316 +#endif + +#ifndef GL_SGIX_resample +#define GL_PACK_RESAMPLE_SGIX 0x842C +#define GL_UNPACK_RESAMPLE_SGIX 0x842D +#define GL_RESAMPLE_REPLICATE_SGIX 0x842E +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#endif + +#ifndef GL_SGIS_point_line_texgen +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 +#endif + +#ifndef GL_SGIS_texture_color_mask +#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF +#endif + +#ifndef GL_EXT_texture_env_dot3 +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 +#endif + +#ifndef GL_ATI_texture_mirror_once +#define GL_MIRROR_CLAMP_ATI 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 +#endif + +#ifndef GL_NV_fence +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 +#endif + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_IBM 0x8370 +#endif + +#ifndef GL_NV_evaluators +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 +#endif + +#ifndef GL_NV_packed_depth_stencil +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA +#endif + +#ifndef GL_NV_register_combiners2 +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 +#endif + +#ifndef GL_NV_texture_compression_vtc +#endif + +#ifndef GL_NV_texture_rectangle +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 +#endif + +#ifndef GL_NV_texture_shader +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV +#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV +#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F +#endif + +#ifndef GL_NV_texture_shader2 +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#endif + +#ifndef GL_NV_vertex_array_range2 +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 +#endif + +#ifndef GL_NV_vertex_program +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F +#endif + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B +#endif + +#ifndef GL_SGIX_scalebias_hint +#define GL_SCALEBIAS_HINT_SGIX 0x8322 +#endif + +#ifndef GL_OML_interlace +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 +#endif + +#ifndef GL_OML_subsample +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 +#endif + +#ifndef GL_OML_resample +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 +#endif + +#ifndef GL_NV_copy_depth_to_color +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F +#endif + +#ifndef GL_ATI_envmap_bumpmap +#define GL_BUMP_ROT_MATRIX_ATI 0x8775 +#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 +#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C +#endif + +#ifndef GL_ATI_fragment_shader +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_REG_6_ATI 0x8927 +#define GL_REG_7_ATI 0x8928 +#define GL_REG_8_ATI 0x8929 +#define GL_REG_9_ATI 0x892A +#define GL_REG_10_ATI 0x892B +#define GL_REG_11_ATI 0x892C +#define GL_REG_12_ATI 0x892D +#define GL_REG_13_ATI 0x892E +#define GL_REG_14_ATI 0x892F +#define GL_REG_15_ATI 0x8930 +#define GL_REG_16_ATI 0x8931 +#define GL_REG_17_ATI 0x8932 +#define GL_REG_18_ATI 0x8933 +#define GL_REG_19_ATI 0x8934 +#define GL_REG_20_ATI 0x8935 +#define GL_REG_21_ATI 0x8936 +#define GL_REG_22_ATI 0x8937 +#define GL_REG_23_ATI 0x8938 +#define GL_REG_24_ATI 0x8939 +#define GL_REG_25_ATI 0x893A +#define GL_REG_26_ATI 0x893B +#define GL_REG_27_ATI 0x893C +#define GL_REG_28_ATI 0x893D +#define GL_REG_29_ATI 0x893E +#define GL_REG_30_ATI 0x893F +#define GL_REG_31_ATI 0x8940 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_CON_8_ATI 0x8949 +#define GL_CON_9_ATI 0x894A +#define GL_CON_10_ATI 0x894B +#define GL_CON_11_ATI 0x894C +#define GL_CON_12_ATI 0x894D +#define GL_CON_13_ATI 0x894E +#define GL_CON_14_ATI 0x894F +#define GL_CON_15_ATI 0x8950 +#define GL_CON_16_ATI 0x8951 +#define GL_CON_17_ATI 0x8952 +#define GL_CON_18_ATI 0x8953 +#define GL_CON_19_ATI 0x8954 +#define GL_CON_20_ATI 0x8955 +#define GL_CON_21_ATI 0x8956 +#define GL_CON_22_ATI 0x8957 +#define GL_CON_23_ATI 0x8958 +#define GL_CON_24_ATI 0x8959 +#define GL_CON_25_ATI 0x895A +#define GL_CON_26_ATI 0x895B +#define GL_CON_27_ATI 0x895C +#define GL_CON_28_ATI 0x895D +#define GL_CON_29_ATI 0x895E +#define GL_CON_30_ATI 0x895F +#define GL_CON_31_ATI 0x8960 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B +#define GL_RED_BIT_ATI 0x00000001 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_2X_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +#endif + +#ifndef GL_ATI_pn_triangles +#define GL_PN_TRIANGLES_ATI 0x87F0 +#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 +#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 +#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 +#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 +#endif + +#ifndef GL_ATI_vertex_array_object +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 +#endif + +#ifndef GL_EXT_vertex_shader +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED +#endif + +#ifndef GL_ATI_vertex_streams +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_STREAM0_ATI 0x876C +#define GL_VERTEX_STREAM1_ATI 0x876D +#define GL_VERTEX_STREAM2_ATI 0x876E +#define GL_VERTEX_STREAM3_ATI 0x876F +#define GL_VERTEX_STREAM4_ATI 0x8770 +#define GL_VERTEX_STREAM5_ATI 0x8771 +#define GL_VERTEX_STREAM6_ATI 0x8772 +#define GL_VERTEX_STREAM7_ATI 0x8773 +#define GL_VERTEX_SOURCE_ATI 0x8774 +#endif + +#ifndef GL_ATI_element_array +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A +#endif + +#ifndef GL_SUN_mesh_array +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 +#endif + +#ifndef GL_SUN_slice_accum +#define GL_SLICE_ACCUM_SUN 0x85CC +#endif + +#ifndef GL_NV_multisample_filter_hint +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 +#endif + +#ifndef GL_NV_depth_clamp +#define GL_DEPTH_CLAMP_NV 0x864F +#endif + +#ifndef GL_NV_occlusion_query +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 +#endif + +#ifndef GL_NV_point_sprite +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 +#endif + +#ifndef GL_NV_texture_shader3 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 +#endif + +#ifndef GL_NV_vertex_program1_1 +#endif + +#ifndef GL_EXT_shadow_funcs +#endif + +#ifndef GL_EXT_stencil_two_side +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 +#endif + +#ifndef GL_ATI_text_fragment_shader +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 +#endif + +#ifndef GL_APPLE_client_storage +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 +#endif + +#ifndef GL_APPLE_element_array +#define GL_ELEMENT_ARRAY_APPLE 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A +#endif + +#ifndef GL_APPLE_fence +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B +#endif + +#ifndef GL_APPLE_vertex_array_object +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 +#endif + +#ifndef GL_APPLE_vertex_array_range +#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E +#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F +#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF +#endif + +#ifndef GL_APPLE_ycbcr_422 +#define GL_YCBCR_422_APPLE 0x85B9 +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#endif + +#ifndef GL_S3_s3tc +#define GL_RGB_S3TC 0x83A0 +#define GL_RGB4_S3TC 0x83A1 +#define GL_RGBA_S3TC 0x83A2 +#define GL_RGBA4_S3TC 0x83A3 +#endif + +#ifndef GL_ATI_draw_buffers +#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 +#define GL_DRAW_BUFFER0_ATI 0x8825 +#define GL_DRAW_BUFFER1_ATI 0x8826 +#define GL_DRAW_BUFFER2_ATI 0x8827 +#define GL_DRAW_BUFFER3_ATI 0x8828 +#define GL_DRAW_BUFFER4_ATI 0x8829 +#define GL_DRAW_BUFFER5_ATI 0x882A +#define GL_DRAW_BUFFER6_ATI 0x882B +#define GL_DRAW_BUFFER7_ATI 0x882C +#define GL_DRAW_BUFFER8_ATI 0x882D +#define GL_DRAW_BUFFER9_ATI 0x882E +#define GL_DRAW_BUFFER10_ATI 0x882F +#define GL_DRAW_BUFFER11_ATI 0x8830 +#define GL_DRAW_BUFFER12_ATI 0x8831 +#define GL_DRAW_BUFFER13_ATI 0x8832 +#define GL_DRAW_BUFFER14_ATI 0x8833 +#define GL_DRAW_BUFFER15_ATI 0x8834 +#endif + +#ifndef GL_ATI_pixel_format_float +#define GL_TYPE_RGBA_FLOAT_ATI 0x8820 +#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 +#endif + +#ifndef GL_ATI_texture_env_combine3 +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 +#endif + +#ifndef GL_ATI_texture_float +#define GL_RGBA_FLOAT32_ATI 0x8814 +#define GL_RGB_FLOAT32_ATI 0x8815 +#define GL_ALPHA_FLOAT32_ATI 0x8816 +#define GL_INTENSITY_FLOAT32_ATI 0x8817 +#define GL_LUMINANCE_FLOAT32_ATI 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 +#define GL_RGBA_FLOAT16_ATI 0x881A +#define GL_RGB_FLOAT16_ATI 0x881B +#define GL_ALPHA_FLOAT16_ATI 0x881C +#define GL_INTENSITY_FLOAT16_ATI 0x881D +#define GL_LUMINANCE_FLOAT16_ATI 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F +#endif + +#ifndef GL_NV_float_buffer +#define GL_FLOAT_R_NV 0x8880 +#define GL_FLOAT_RG_NV 0x8881 +#define GL_FLOAT_RGB_NV 0x8882 +#define GL_FLOAT_RGBA_NV 0x8883 +#define GL_FLOAT_R16_NV 0x8884 +#define GL_FLOAT_R32_NV 0x8885 +#define GL_FLOAT_RG16_NV 0x8886 +#define GL_FLOAT_RG32_NV 0x8887 +#define GL_FLOAT_RGB16_NV 0x8888 +#define GL_FLOAT_RGB32_NV 0x8889 +#define GL_FLOAT_RGBA16_NV 0x888A +#define GL_FLOAT_RGBA32_NV 0x888B +#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C +#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D +#define GL_FLOAT_RGBA_MODE_NV 0x888E +#endif + +#ifndef GL_NV_fragment_program +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 +#define GL_FRAGMENT_PROGRAM_NV 0x8870 +#define GL_MAX_TEXTURE_COORDS_NV 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 +#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 +#define GL_PROGRAM_ERROR_STRING_NV 0x8874 +#endif + +#ifndef GL_NV_half_float +#define GL_HALF_FLOAT_NV 0x140B +#endif + +#ifndef GL_NV_pixel_data_range +#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 +#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 +#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A +#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B +#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C +#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D +#endif + +#ifndef GL_NV_primitive_restart +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 +#endif + +#ifndef GL_NV_texture_expand_normal +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F +#endif + +#ifndef GL_NV_vertex_program2 +#endif + +#ifndef GL_ATI_map_object_buffer +#endif + +#ifndef GL_ATI_separate_stencil +#define GL_STENCIL_BACK_FUNC_ATI 0x8800 +#define GL_STENCIL_BACK_FAIL_ATI 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 +#endif + +#ifndef GL_ATI_vertex_attrib_array_object +#endif + +#ifndef GL_OES_read_format +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B +#endif + +#ifndef GL_EXT_depth_bounds_test +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 +#endif + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 +#endif + +#ifndef GL_EXT_blend_equation_separate +#define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D +#endif + +#ifndef GL_MESA_pack_invert +#define GL_PACK_INVERT_MESA 0x8758 +#endif + +#ifndef GL_MESA_ycbcr_texture +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB +#define GL_YCBCR_MESA 0x8757 +#endif + +#ifndef GL_EXT_pixel_buffer_object +#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF +#endif + +#ifndef GL_NV_fragment_program_option +#endif + +#ifndef GL_NV_fragment_program2 +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 +#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 +#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 +#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 +#endif + +#ifndef GL_NV_vertex_program2_option +/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ +/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */ +#endif + +#ifndef GL_NV_vertex_program3 +/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ +#endif + +#ifndef GL_EXT_framebuffer_object +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 +#endif + +#ifndef GL_GREMEDY_string_marker +#endif + + +/*************************************************************/ + +#include +#ifndef GL_VERSION_2_0 +/* GL type for program/shader text */ +typedef char GLchar; /* native character */ +#endif + +#ifndef GL_VERSION_1_5 +/* GL types for handling large vertex buffer objects */ +typedef ptrdiff_t GLintptr; +typedef ptrdiff_t GLsizeiptr; +#endif + +#ifndef GL_ARB_vertex_buffer_object +/* GL types for handling large vertex buffer objects */ +typedef ptrdiff_t GLintptrARB; +typedef ptrdiff_t GLsizeiptrARB; +#endif + +#ifndef GL_ARB_shader_objects +/* GL types for handling shader object handles and program/shader text */ +typedef char GLcharARB; /* native character */ +typedef unsigned int GLhandleARB; /* shader object handle */ +#endif + +/* GL types for "half" precision (s10e5) float data in host memory */ +#ifndef GL_ARB_half_float_pixel +typedef unsigned short GLhalfARB; +#endif + +#ifndef GL_NV_half_float +typedef unsigned short GLhalfNV; +#endif + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf); +GLAPI void APIENTRY glBlendEquation (GLenum); +GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei); +GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint); +GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); +GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); +GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean); +GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean); +GLAPI void APIENTRY glResetHistogram (GLenum); +GLAPI void APIENTRY glResetMinmax (GLenum); +GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTexture (GLenum); +GLAPI void APIENTRY glClientActiveTexture (GLenum); +GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble); +GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat); +GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint); +GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort); +GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *); +GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *); +GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *); +GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *); +GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *); +GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean); +GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); +#endif + +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glFogCoordf (GLfloat); +GLAPI void APIENTRY glFogCoordfv (const GLfloat *); +GLAPI void APIENTRY glFogCoordd (GLdouble); +GLAPI void APIENTRY glFogCoorddv (const GLdouble *); +GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei); +GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); +GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *); +GLAPI void APIENTRY glPointParameteri (GLenum, GLint); +GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *); +GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *); +GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *); +GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *); +GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint); +GLAPI void APIENTRY glSecondaryColor3iv (const GLint *); +GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *); +GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *); +GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *); +GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort); +GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *); +GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dv (const GLdouble *); +GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fv (const GLfloat *); +GLAPI void APIENTRY glWindowPos2i (GLint, GLint); +GLAPI void APIENTRY glWindowPos2iv (const GLint *); +GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2sv (const GLshort *); +GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dv (const GLdouble *); +GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fv (const GLfloat *); +GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3iv (const GLint *); +GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3sv (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); +#endif + +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsQuery (GLuint); +GLAPI void APIENTRY glBeginQuery (GLenum, GLuint); +GLAPI void APIENTRY glEndQuery (GLenum); +GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *); +GLAPI void APIENTRY glBindBuffer (GLenum, GLuint); +GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsBuffer (GLuint); +GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum); +GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *); +GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *); +GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum); +GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum); +GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params); +#endif + +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum); +GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *); +GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint); +GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint); +GLAPI void APIENTRY glAttachShader (GLuint, GLuint); +GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *); +GLAPI void APIENTRY glCompileShader (GLuint); +GLAPI GLuint APIENTRY glCreateProgram (void); +GLAPI GLuint APIENTRY glCreateShader (GLenum); +GLAPI void APIENTRY glDeleteProgram (GLuint); +GLAPI void APIENTRY glDeleteShader (GLuint); +GLAPI void APIENTRY glDetachShader (GLuint, GLuint); +GLAPI void APIENTRY glDisableVertexAttribArray (GLuint); +GLAPI void APIENTRY glEnableVertexAttribArray (GLuint); +GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); +GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); +GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *); +GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *); +GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *); +GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *); +GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *); +GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *); +GLAPI GLboolean APIENTRY glIsProgram (GLuint); +GLAPI GLboolean APIENTRY glIsShader (GLuint); +GLAPI void APIENTRY glLinkProgram (GLuint); +GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *); +GLAPI void APIENTRY glUseProgram (GLuint); +GLAPI void APIENTRY glUniform1f (GLint, GLfloat); +GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform1i (GLint, GLint); +GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint); +GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glValidateProgram (GLuint); +GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble); +GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat); +GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort); +GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); +typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); +typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); +typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length); +typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTextureARB (GLenum); +GLAPI void APIENTRY glClientActiveTextureARB (GLenum); +GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble); +GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat); +GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint); +GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort); +GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *); +GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *); +GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *); +GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +#endif + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); +#endif + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 +#endif + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img); +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 +#endif + +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *); +GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *); +GLAPI void APIENTRY glWeightivARB (GLint, const GLint *); +GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *); +GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *); +GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *); +GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *); +GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *); +GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexBlendARB (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); +typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); +typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); +typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); +typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); +typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); +typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); +#endif + +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint); +GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *); +GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *); +GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *); +GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 +#endif + +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 +#endif + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 +#endif + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 +#endif + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 +#endif + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 +#endif + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *); +GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *); +GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint); +GLAPI void APIENTRY glWindowPos2ivARB (const GLint *); +GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2svARB (const GLshort *); +GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *); +GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *); +GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3ivARB (const GLint *); +GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3svARB (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); +#endif + +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble); +GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat); +GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort); +GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); +GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint); +GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint); +GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint); +GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *); +GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *); +GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *); +GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *); +GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *); +GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *); +GLAPI GLboolean APIENTRY glIsProgramARB (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); +#endif + +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 +/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */ +#endif + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint); +GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsBufferARB (GLuint); +GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum); +GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *); +GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *); +GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum); +GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum); +GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params); +#endif + +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsQueryARB (GLuint); +GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint); +GLAPI void APIENTRY glEndQueryARB (GLenum); +GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params); +#endif + +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB); +GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum); +GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB); +GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum); +GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *); +GLAPI void APIENTRY glCompileShaderARB (GLhandleARB); +GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void); +GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB); +GLAPI void APIENTRY glLinkProgramARB (GLhandleARB); +GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB); +GLAPI void APIENTRY glValidateProgramARB (GLhandleARB); +GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat); +GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform1iARB (GLint, GLint); +GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint); +GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *); +GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *); +GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); +GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *); +GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *); +GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); +GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *); +GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *); +GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); +typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); +typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length); +typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void); +typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); +typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); +typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); +#endif + +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *); +GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); +GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +#endif + +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 +#endif + +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 +#endif + +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 +#endif + +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 +#endif + +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 +#endif + +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); +#endif + +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 +#endif + +#ifndef GL_ARB_color_buffer_float +#define GL_ARB_color_buffer_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClampColorARB (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); +#endif + +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 +#endif + +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 +#endif + +#ifndef GL_ARB_pixel_buffer_object +#define GL_ARB_pixel_buffer_object 1 +#endif + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 +#endif + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); +#endif + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 +#endif + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); +typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +#endif + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); +GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); +GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean); +GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean); +GLAPI void APIENTRY glResetHistogramEXT (GLenum); +GLAPI void APIENTRY glResetMinmaxEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); +#endif + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint); +GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); +GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +#endif + +#ifndef GL_EXT_color_matrix +#define GL_EXT_color_matrix 1 +#endif + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); +#endif + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenSGIX (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); +#endif + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint); +GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *); +GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat); +GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *); +GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *); +GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); +#endif + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 +#endif + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 +#endif + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *); +GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint); +GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint); +GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); +typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); +typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 +#endif + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean); +GLAPI void APIENTRY glSamplePatternSGIS (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 +#endif + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glArrayElementEXT (GLint); +GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei); +GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *); +GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *); +GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); +typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); +typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 +#endif + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 +#endif + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 +#endif + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 +#endif + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 +#endif + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 +#endif + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 +#endif + +#ifndef GL_SGIX_pixel_tiles +#define GL_SGIX_pixel_tiles 1 +#endif + +#ifndef GL_SGIX_texture_select +#define GL_SGIX_texture_select 1 +#endif + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat); +GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *); +GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint); +GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 +#endif + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_SGIS_point_parameters +#define GL_SGIS_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_SGIX_instruments +#define GL_SGIX_instruments 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); +GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *); +GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *); +GLAPI void APIENTRY glReadInstrumentsSGIX (GLint); +GLAPI void APIENTRY glStartInstrumentsSGIX (void); +GLAPI void APIENTRY glStopInstrumentsSGIX (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); +typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); +typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); +typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); +#endif + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 +#endif + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameZoomSGIX (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); +#endif + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTagSampleBufferSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); +#endif + +#ifndef GL_SGIX_polynomial_ffd +#define GL_SGIX_polynomial_ffd 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); +GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); +GLAPI void APIENTRY glDeformSGIX (GLbitfield); +GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); +typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); +#endif + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); +#endif + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushRasterSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void); +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 +#endif + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); +#endif + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 +#endif + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint); +GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 +#endif + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 +#endif + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +#endif + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 +#endif + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glHintPGI (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); +#endif + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 +#endif + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat); +GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *); +GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint); +GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); +#endif + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 +#endif + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_SGIX_calligraphic_fragment 1 +#endif + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 +#endif + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 +#endif + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 +#endif + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); +#endif + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei); +GLAPI void APIENTRY glUnlockArraysEXT (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void); +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *); +GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); +#endif + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 +#endif + +#ifndef GL_SGIX_fragment_lighting +#define GL_SGIX_fragment_lighting 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum); +GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint); +GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat); +GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint); +GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *); +GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint); +GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); +#endif + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 +#endif + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +#endif + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 +#endif + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 +#endif + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glApplyTextureEXT (GLenum); +GLAPI void APIENTRY glTextureLightEXT (GLenum); +GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 +#endif + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 +#endif + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint); +GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *); +GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *); +GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei); +GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei); +GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); +typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); +typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 +#endif + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *); +GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *); +GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *); +GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +#endif + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 +#endif + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint); +GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 +#endif + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *); +GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *); +GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *); +GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *); +GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *); +GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *); +GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *); +GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort); +GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *); +GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureNormalEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei); +GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +#endif + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogCoordfEXT (GLfloat); +GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *); +GLAPI void APIENTRY glFogCoorddEXT (GLdouble); +GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *); +GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 +#endif + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *); +GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *); +GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *); +GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glTangent3ivEXT (const GLint *); +GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glTangent3svEXT (const GLshort *); +GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *); +GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *); +GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *); +GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glBinormal3ivEXT (const GLint *); +GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glBinormal3svEXT (const GLshort *); +GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); +typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); +typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); +typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); +typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); +typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); +typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); +typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); +typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); +typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); +typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 +#endif + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 +#endif + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 +#endif + +#ifndef GL_SGIX_fog_scale +#define GL_SGIX_fog_scale 1 +#endif + +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFinishTextureSUNX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void); +#endif + +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte); +GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort); +GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint); +GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat); +GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble); +GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte); +GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort); +GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +#endif + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint); +GLAPI void APIENTRY glReplacementCodeusSUN (GLushort); +GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte); +GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *); +GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *); +GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *); +GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer); +#endif + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif + +#ifndef GL_INGR_blend_func_separate +#define GL_INGR_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 +#endif + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 +#endif + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 +#endif + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 +#endif + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexWeightfEXT (GLfloat); +GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *); +GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 +#endif + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); +GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer); +#endif + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *); +GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat); +GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *); +GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint); +GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean); +GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); +#endif + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 +#endif + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 +#endif + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 +#endif + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glResizeBuffersMESA (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void); +#endif + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint); +GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *); +GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *); +GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); +#endif + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 +#endif + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint); +GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride); +#endif + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint); +GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +#endif + +#ifndef GL_SGIX_subsample +#define GL_SGIX_subsample 1 +#endif + +#ifndef GL_SGIX_ycrcba +#define GL_SGIX_ycrcba 1 +#endif + +#ifndef GL_SGIX_ycrcb_subsample +#define GL_SGIX_ycrcb_subsample 1 +#endif + +#ifndef GL_SGIX_depth_pass_instrument +#define GL_SGIX_depth_pass_instrument 1 +#endif + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 +#endif + +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 +#endif + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTbufferMask3DFX (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); +#endif + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean); +GLAPI void APIENTRY glSamplePatternEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); +#endif + +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 +#endif + +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 +#endif + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 +#endif + +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 +#endif + +#ifndef GL_SGIS_texture_color_mask +#define GL_SGIS_texture_color_mask 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +#endif + +#ifndef GL_SGIX_igloo_interface +#define GL_SGIX_igloo_interface 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); +#endif + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 +#endif + +#ifndef GL_ATI_texture_mirror_once +#define GL_ATI_texture_mirror_once 1 +#endif + +#ifndef GL_NV_fence +#define GL_NV_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsFenceNV (GLuint); +GLAPI GLboolean APIENTRY glTestFenceNV (GLuint); +GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glFinishFenceNV (GLuint); +GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); +typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +#endif + +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *); +GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *); +GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); +typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +#endif + +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 +#endif + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 +#endif + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 +#endif + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 +#endif + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 +#endif + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 +#endif + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *); +GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint); +GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *); +GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *); +GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *); +GLAPI GLboolean APIENTRY glIsProgramNV (GLuint); +GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *); +GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *); +GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum); +GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble); +GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat); +GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort); +GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); +typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); +typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v); +typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); +#endif + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 +#endif + +#ifndef GL_SGIX_scalebias_hint +#define GL_SGIX_scalebias_hint 1 +#endif + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 +#endif + +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 +#endif + +#ifndef GL_OML_resample +#define GL_OML_resample 1 +#endif + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 +#endif + +#ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *); +GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *); +GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +#endif + +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint); +GLAPI void APIENTRY glBindFragmentShaderATI (GLuint); +GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint); +GLAPI void APIENTRY glBeginFragmentShaderATI (void); +GLAPI void APIENTRY glEndFragmentShaderATI (void); +GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum); +GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum); +GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); +#endif + +#ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint); +GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +#endif + +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum); +GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint); +GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum); +GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glFreeObjectBufferATI (GLuint); +GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint); +GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint); +GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); +typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); +#endif + +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginVertexShaderEXT (void); +GLAPI void APIENTRY glEndVertexShaderEXT (void); +GLAPI void APIENTRY glBindVertexShaderEXT (GLuint); +GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint); +GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint); +GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint); +GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint); +GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint); +GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *); +GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *); +GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *); +GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *); +GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *); +GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *); +GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *); +GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *); +GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *); +GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint); +GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint); +GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum); +GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindParameterEXT (GLenum); +GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum); +GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *); +GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); +typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); +typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); +typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); +typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); +typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); +typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); +typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); +typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); +typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); +typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); +typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data); +typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +#endif + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort); +GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint); +GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat); +GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble); +GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint); +GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *); +GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum); +GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint); +GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +#endif + +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *); +GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei); +GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +#endif + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); +#endif + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 +#endif + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 +#endif + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 +#endif + +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint); +GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint); +GLAPI void APIENTRY glEndOcclusionQueryNV (void); +GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); +#endif + +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint); +GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 +#endif + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 +#endif + +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 +#endif + +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); +#endif + +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 +#endif + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 +#endif + +#ifndef GL_APPLE_element_array +#define GL_APPLE_element_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *); +GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei); +GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei); +GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei); +GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); +#endif + +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *); +GLAPI void APIENTRY glSetFenceAPPLE (GLuint); +GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint); +GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint); +GLAPI void APIENTRY glFinishFenceAPPLE (GLuint); +GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint); +GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); +typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); +typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +#endif + +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint); +GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); +#endif + +#ifndef GL_APPLE_vertex_array_range +#define GL_APPLE_vertex_array_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *); +GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *); +GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +#endif + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 +#endif + +#ifndef GL_S3_s3tc +#define GL_S3_s3tc 1 +#endif + +#ifndef GL_ATI_draw_buffers +#define GL_ATI_draw_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); +#endif + +#ifndef GL_ATI_pixel_format_float +#define GL_ATI_pixel_format_float 1 +/* This is really a WGL extension, but defines some associated GL enums. + * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string. + */ +#endif + +#ifndef GL_ATI_texture_env_combine3 +#define GL_ATI_texture_env_combine3 1 +#endif + +#ifndef GL_ATI_texture_float +#define GL_ATI_texture_float 1 +#endif + +#ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 +#endif + +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 +/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *); +GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *); +GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); +#endif + +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *); +GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV); +GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glFogCoordhNV (GLhalfNV); +GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *); +GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV); +GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); +typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); +typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); +typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); +typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +#endif + +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *); +GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +#endif + +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPrimitiveRestartNV (void); +GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void); +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +#endif + +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 +#endif + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 +#endif + +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint); +GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); +#endif + +#ifndef GL_ATI_separate_stencil +#define GL_ATI_separate_stencil 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +#endif + +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint); +GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); +#endif + +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 +#endif + +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); +#endif + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 +#endif + +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); +#endif + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 +#endif + +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 +#endif + +#ifndef GL_EXT_pixel_buffer_object +#define GL_EXT_pixel_buffer_object 1 +#endif + +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 +#endif + +#ifndef GL_NV_fragment_program2 +#define GL_NV_fragment_program2 1 +#endif + +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 +#endif + +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 +#endif + +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint); +GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint); +GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *); +GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei); +GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *); +GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint); +GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint); +GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *); +GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum); +GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint); +GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint); +GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGenerateMipmapEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers); +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers); +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); +#endif + +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); +#endif + + +#ifdef __cplusplus +} +#endif + +#endif +#endif /* NO_SDL_GLEXT */ +/*@}*/ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_platform.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_platform.h new file mode 100644 index 0000000000..11d8673667 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_platform.h @@ -0,0 +1,110 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_platform.h + * Try to get a standard set of platform defines + */ + +#ifndef _SDL_platform_h +#define _SDL_platform_h + +#if defined(_AIX) +#undef __AIX__ +#define __AIX__ 1 +#endif +#if defined(__BEOS__) +#undef __BEOS__ +#define __BEOS__ 1 +#endif +#if defined(__HAIKU__) +#undef __HAIKU__ +#define __HAIKU__ 1 +#endif +#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) +#undef __BSDI__ +#define __BSDI__ 1 +#endif +#if defined(_arch_dreamcast) +#undef __DREAMCAST__ +#define __DREAMCAST__ 1 +#endif +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) +#undef __FREEBSD__ +#define __FREEBSD__ 1 +#endif +#if defined(__HAIKU__) +#undef __HAIKU__ +#define __HAIKU__ 1 +#endif +#if defined(hpux) || defined(__hpux) || defined(__hpux__) +#undef __HPUX__ +#define __HPUX__ 1 +#endif +#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE) +#undef __IRIX__ +#define __IRIX__ 1 +#endif +#if defined(linux) || defined(__linux) || defined(__linux__) +#undef __LINUX__ +#define __LINUX__ 1 +#endif +#if defined(__APPLE__) +#undef __MACOSX__ +#define __MACOSX__ 1 +#elif defined(macintosh) +#undef __MACOS__ +#define __MACOS__ 1 +#endif +#if defined(__NetBSD__) +#undef __NETBSD__ +#define __NETBSD__ 1 +#endif +#if defined(__OpenBSD__) +#undef __OPENBSD__ +#define __OPENBSD__ 1 +#endif +#if defined(__OS2__) +#undef __OS2__ +#define __OS2__ 1 +#endif +#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) +#undef __OSF__ +#define __OSF__ 1 +#endif +#if defined(__QNXNTO__) +#undef __QNXNTO__ +#define __QNXNTO__ 1 +#endif +#if defined(riscos) || defined(__riscos) || defined(__riscos__) +#undef __RISCOS__ +#define __RISCOS__ 1 +#endif +#if defined(__SVR4) +#undef __SOLARIS__ +#define __SOLARIS__ 1 +#endif +#if defined(WIN32) || defined(_WIN32) +#undef __WIN32__ +#define __WIN32__ 1 +#endif + +#endif /* _SDL_platform_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_quit.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_quit.h new file mode 100644 index 0000000000..6d82e7e061 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_quit.h @@ -0,0 +1,55 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_quit.h + * Include file for SDL quit event handling + */ + +#ifndef _SDL_quit_h +#define _SDL_quit_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +/** @file SDL_quit.h + * An SDL_QUITEVENT is generated when the user tries to close the application + * window. If it is ignored or filtered out, the window will remain open. + * If it is not ignored or filtered, it is queued normally and the window + * is allowed to close. When the window is closed, screen updates will + * complete, but have no effect. + * + * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) + * and SIGTERM (system termination request), if handlers do not already + * exist, that generate SDL_QUITEVENT events as well. There is no way + * to determine the cause of an SDL_QUITEVENT, but setting a signal + * handler in your application will override the default generation of + * quit events for that signal. + */ + +/** @file SDL_quit.h + * There are no functions directly affecting the quit event + */ + +#define SDL_QuitRequested() \ + (SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK)) + +#endif /* _SDL_quit_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_rwops.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_rwops.h new file mode 100644 index 0000000000..a450119f1c --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_rwops.h @@ -0,0 +1,155 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_rwops.h + * This file provides a general interface for SDL to read and write + * data sources. It can easily be extended to files, memory, etc. + */ + +#ifndef _SDL_rwops_h +#define _SDL_rwops_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** This is the read/write operation structure -- very basic */ + +typedef struct SDL_RWops { + /** Seek to 'offset' relative to whence, one of stdio's whence values: + * SEEK_SET, SEEK_CUR, SEEK_END + * Returns the final offset in the data source. + */ + int (SDLCALL *seek)(struct SDL_RWops *context, int offset, int whence); + + /** Read up to 'maxnum' objects each of size 'size' from the data + * source to the area pointed at by 'ptr'. + * Returns the number of objects read, or -1 if the read failed. + */ + int (SDLCALL *read)(struct SDL_RWops *context, void *ptr, int size, int maxnum); + + /** Write exactly 'num' objects each of size 'objsize' from the area + * pointed at by 'ptr' to data source. + * Returns 'num', or -1 if the write failed. + */ + int (SDLCALL *write)(struct SDL_RWops *context, const void *ptr, int size, int num); + + /** Close and free an allocated SDL_FSops structure */ + int (SDLCALL *close)(struct SDL_RWops *context); + + Uint32 type; + union { +#if defined(__WIN32__) && !defined(__SYMBIAN32__) + struct { + int append; + void *h; + struct { + void *data; + int size; + int left; + } buffer; + } win32io; +#endif +#ifdef HAVE_STDIO_H + struct { + int autoclose; + FILE *fp; + } stdio; +#endif + struct { + Uint8 *base; + Uint8 *here; + Uint8 *stop; + } mem; + struct { + void *data1; + } unknown; + } hidden; + +} SDL_RWops; + + +/** @name Functions to create SDL_RWops structures from various data sources */ +/*@{*/ + +extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFile(const char *file, const char *mode); + +#ifdef HAVE_STDIO_H +extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFP(FILE *fp, int autoclose); +#endif + +extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromMem(void *mem, int size); +extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromConstMem(const void *mem, int size); + +extern DECLSPEC SDL_RWops * SDLCALL SDL_AllocRW(void); +extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops *area); + +/*@}*/ + +/** @name Seek Reference Points */ +/*@{*/ +#define RW_SEEK_SET 0 /**< Seek from the beginning of data */ +#define RW_SEEK_CUR 1 /**< Seek relative to current read point */ +#define RW_SEEK_END 2 /**< Seek relative to the end of data */ +/*@}*/ + +/** @name Macros to easily read and write from an SDL_RWops structure */ +/*@{*/ +#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence) +#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR) +#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n) +#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n) +#define SDL_RWclose(ctx) (ctx)->close(ctx) +/*@}*/ + +/** @name Read an item of the specified endianness and return in native format */ +/*@{*/ +extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops *src); +extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops *src); +extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops *src); +extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops *src); +extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops *src); +extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops *src); +/*@}*/ + +/** @name Write an item of native format to the specified endianness */ +/*@{*/ +extern DECLSPEC int SDLCALL SDL_WriteLE16(SDL_RWops *dst, Uint16 value); +extern DECLSPEC int SDLCALL SDL_WriteBE16(SDL_RWops *dst, Uint16 value); +extern DECLSPEC int SDLCALL SDL_WriteLE32(SDL_RWops *dst, Uint32 value); +extern DECLSPEC int SDLCALL SDL_WriteBE32(SDL_RWops *dst, Uint32 value); +extern DECLSPEC int SDLCALL SDL_WriteLE64(SDL_RWops *dst, Uint64 value); +extern DECLSPEC int SDLCALL SDL_WriteBE64(SDL_RWops *dst, Uint64 value); +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_rwops_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_stdinc.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_stdinc.h new file mode 100644 index 0000000000..e1f85fb75a --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_stdinc.h @@ -0,0 +1,620 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_stdinc.h + * This is a general header that includes C language support + */ + +#ifndef _SDL_stdinc_h +#define _SDL_stdinc_h + +#include "SDL_config.h" + + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_STDIO_H +#include +#endif +#if defined(STDC_HEADERS) +# include +# include +# include +#else +# if defined(HAVE_STDLIB_H) +# include +# elif defined(HAVE_MALLOC_H) +# include +# endif +# if defined(HAVE_STDDEF_H) +# include +# endif +# if defined(HAVE_STDARG_H) +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#if defined(HAVE_INTTYPES_H) +# include +#elif defined(HAVE_STDINT_H) +# include +#endif +#ifdef HAVE_CTYPE_H +# include +#endif +#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) +# include +#endif + +/** The number of elements in an array */ +#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) +#define SDL_TABLESIZE(table) SDL_arraysize(table) + +/* Use proper C++ casts when compiled as C++ to be compatible with the option + -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above. */ +#ifdef __cplusplus +#define SDL_reinterpret_cast(type, expression) reinterpret_cast(expression) +#define SDL_static_cast(type, expression) static_cast(expression) +#else +#define SDL_reinterpret_cast(type, expression) ((type)(expression)) +#define SDL_static_cast(type, expression) ((type)(expression)) +#endif + +/** @name Basic data types */ +/*@{*/ +typedef enum { + SDL_FALSE = 0, + SDL_TRUE = 1 +} SDL_bool; + +typedef int8_t Sint8; +typedef uint8_t Uint8; +typedef int16_t Sint16; +typedef uint16_t Uint16; +typedef int32_t Sint32; +typedef uint32_t Uint32; + +#ifdef SDL_HAS_64BIT_TYPE +typedef int64_t Sint64; +#ifndef SYMBIAN32_GCCE +typedef uint64_t Uint64; +#endif +#else +/* This is really just a hack to prevent the compiler from complaining */ +typedef struct { + Uint32 hi; + Uint32 lo; +} Uint64, Sint64; +#endif + +/*@}*/ + +/** @name Make sure the types really have the right sizes */ +/*@{*/ +#define SDL_COMPILE_TIME_ASSERT(name, x) \ + typedef int SDL_dummy_ ## name[(x) * 2 - 1] + +SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); +SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1); +SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); +SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2); +SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4); +SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4); +SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8); +SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8); +/*@}*/ + +/** @name Enum Size Check + * Check to make sure enums are the size of ints, for structure packing. + * For both Watcom C/C++ and Borland C/C++ the compiler option that makes + * enums having the size of an int must be enabled. + * This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11). + */ +/* Enable enums always int in CodeWarrior (for MPW use "-enum int") */ +#ifdef __MWERKS__ +#pragma enumsalwaysint on +#endif + +typedef enum { + DUMMY_ENUM_VALUE +} SDL_DUMMY_ENUM; + +#ifndef __NDS__ +SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int)); +#endif +/*@}*/ + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef HAVE_MALLOC +#define SDL_malloc malloc +#else +extern DECLSPEC void * SDLCALL SDL_malloc(size_t size); +#endif + +#ifdef HAVE_CALLOC +#define SDL_calloc calloc +#else +extern DECLSPEC void * SDLCALL SDL_calloc(size_t nmemb, size_t size); +#endif + +#ifdef HAVE_REALLOC +#define SDL_realloc realloc +#else +extern DECLSPEC void * SDLCALL SDL_realloc(void *mem, size_t size); +#endif + +#ifdef HAVE_FREE +#define SDL_free free +#else +extern DECLSPEC void SDLCALL SDL_free(void *mem); +#endif + +#if defined(HAVE_ALLOCA) && !defined(alloca) +# if defined(HAVE_ALLOCA_H) +# include +# elif defined(__GNUC__) +# define alloca __builtin_alloca +# elif defined(_MSC_VER) +# include +# define alloca _alloca +# elif defined(__WATCOMC__) +# include +# elif defined(__BORLANDC__) +# include +# elif defined(__DMC__) +# include +# elif defined(__AIX__) + #pragma alloca +# elif defined(__MRC__) + void *alloca (unsigned); +# else + char *alloca (); +# endif +#endif +#ifdef HAVE_ALLOCA +#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count)) +#define SDL_stack_free(data) +#else +#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count)) +#define SDL_stack_free(data) SDL_free(data) +#endif + +#ifdef HAVE_GETENV +#define SDL_getenv getenv +#else +extern DECLSPEC char * SDLCALL SDL_getenv(const char *name); +#endif + +#ifdef HAVE_PUTENV +#define SDL_putenv putenv +#else +extern DECLSPEC int SDLCALL SDL_putenv(const char *variable); +#endif + +#ifdef HAVE_QSORT +#define SDL_qsort qsort +#else +extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, + int (*compare)(const void *, const void *)); +#endif + +#ifdef HAVE_ABS +#define SDL_abs abs +#else +#define SDL_abs(X) ((X) < 0 ? -(X) : (X)) +#endif + +#define SDL_min(x, y) (((x) < (y)) ? (x) : (y)) +#define SDL_max(x, y) (((x) > (y)) ? (x) : (y)) + +#ifdef HAVE_CTYPE_H +#define SDL_isdigit(X) isdigit(X) +#define SDL_isspace(X) isspace(X) +#define SDL_toupper(X) toupper(X) +#define SDL_tolower(X) tolower(X) +#else +#define SDL_isdigit(X) (((X) >= '0') && ((X) <= '9')) +#define SDL_isspace(X) (((X) == ' ') || ((X) == '\t') || ((X) == '\r') || ((X) == '\n')) +#define SDL_toupper(X) (((X) >= 'a') && ((X) <= 'z') ? ('A'+((X)-'a')) : (X)) +#define SDL_tolower(X) (((X) >= 'A') && ((X) <= 'Z') ? ('a'+((X)-'A')) : (X)) +#endif + +#ifdef HAVE_MEMSET +#define SDL_memset memset +#else +extern DECLSPEC void * SDLCALL SDL_memset(void *dst, int c, size_t len); +#endif + +#if defined(__GNUC__) && defined(i386) +#define SDL_memset4(dst, val, len) \ +do { \ + int u0, u1, u2; \ + __asm__ __volatile__ ( \ + "cld\n\t" \ + "rep ; stosl\n\t" \ + : "=&D" (u0), "=&a" (u1), "=&c" (u2) \ + : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, len)) \ + : "memory" ); \ +} while(0) +#endif +#ifndef SDL_memset4 +#define SDL_memset4(dst, val, len) \ +do { \ + unsigned _count = (len); \ + unsigned _n = (_count + 3) / 4; \ + Uint32 *_p = SDL_static_cast(Uint32 *, dst); \ + Uint32 _val = (val); \ + if (len == 0) break; \ + switch (_count % 4) { \ + case 0: do { *_p++ = _val; \ + case 3: *_p++ = _val; \ + case 2: *_p++ = _val; \ + case 1: *_p++ = _val; \ + } while ( --_n ); \ + } \ +} while(0) +#endif + +/* We can count on memcpy existing on Mac OS X and being well-tuned. */ +#if defined(__MACH__) && defined(__APPLE__) +#define SDL_memcpy(dst, src, len) memcpy(dst, src, len) +#elif defined(__GNUC__) && defined(i386) +#define SDL_memcpy(dst, src, len) \ +do { \ + int u0, u1, u2; \ + __asm__ __volatile__ ( \ + "cld\n\t" \ + "rep ; movsl\n\t" \ + "testb $2,%b4\n\t" \ + "je 1f\n\t" \ + "movsw\n" \ + "1:\ttestb $1,%b4\n\t" \ + "je 2f\n\t" \ + "movsb\n" \ + "2:" \ + : "=&c" (u0), "=&D" (u1), "=&S" (u2) \ + : "0" (SDL_static_cast(unsigned, len)/4), "q" (len), "1" (dst),"2" (src) \ + : "memory" ); \ +} while(0) +#endif +#ifndef SDL_memcpy +#ifdef HAVE_MEMCPY +#define SDL_memcpy memcpy +#elif defined(HAVE_BCOPY) +#define SDL_memcpy(d, s, n) bcopy((s), (d), (n)) +#else +extern DECLSPEC void * SDLCALL SDL_memcpy(void *dst, const void *src, size_t len); +#endif +#endif + +/* We can count on memcpy existing on Mac OS X and being well-tuned. */ +#if defined(__MACH__) && defined(__APPLE__) +#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4) +#elif defined(__GNUC__) && defined(i386) +#define SDL_memcpy4(dst, src, len) \ +do { \ + int ecx, edi, esi; \ + __asm__ __volatile__ ( \ + "cld\n\t" \ + "rep ; movsl" \ + : "=&c" (ecx), "=&D" (edi), "=&S" (esi) \ + : "0" (SDL_static_cast(unsigned, len)), "1" (dst), "2" (src) \ + : "memory" ); \ +} while(0) +#endif +#ifndef SDL_memcpy4 +#define SDL_memcpy4(dst, src, len) SDL_memcpy(dst, src, (len) << 2) +#endif + +#if defined(__GNUC__) && defined(i386) +#define SDL_revcpy(dst, src, len) \ +do { \ + int u0, u1, u2; \ + char *dstp = SDL_static_cast(char *, dst); \ + char *srcp = SDL_static_cast(char *, src); \ + int n = (len); \ + if ( n >= 4 ) { \ + __asm__ __volatile__ ( \ + "std\n\t" \ + "rep ; movsl\n\t" \ + "cld\n\t" \ + : "=&c" (u0), "=&D" (u1), "=&S" (u2) \ + : "0" (n >> 2), \ + "1" (dstp+(n-4)), "2" (srcp+(n-4)) \ + : "memory" ); \ + } \ + switch (n & 3) { \ + case 3: dstp[2] = srcp[2]; \ + case 2: dstp[1] = srcp[1]; \ + case 1: dstp[0] = srcp[0]; \ + break; \ + default: \ + break; \ + } \ +} while(0) +#endif +#ifndef SDL_revcpy +extern DECLSPEC void * SDLCALL SDL_revcpy(void *dst, const void *src, size_t len); +#endif + +#ifdef HAVE_MEMMOVE +#define SDL_memmove memmove +#elif defined(HAVE_BCOPY) +#define SDL_memmove(d, s, n) bcopy((s), (d), (n)) +#else +#define SDL_memmove(dst, src, len) \ +do { \ + if ( dst < src ) { \ + SDL_memcpy(dst, src, len); \ + } else { \ + SDL_revcpy(dst, src, len); \ + } \ +} while(0) +#endif + +#ifdef HAVE_MEMCMP +#define SDL_memcmp memcmp +#else +extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len); +#endif + +#ifdef HAVE_STRLEN +#define SDL_strlen strlen +#else +extern DECLSPEC size_t SDLCALL SDL_strlen(const char *string); +#endif + +#ifdef HAVE_STRLCPY +#define SDL_strlcpy strlcpy +#else +extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, size_t maxlen); +#endif + +#ifdef HAVE_STRLCAT +#define SDL_strlcat strlcat +#else +extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src, size_t maxlen); +#endif + +#ifdef HAVE_STRDUP +#define SDL_strdup strdup +#else +extern DECLSPEC char * SDLCALL SDL_strdup(const char *string); +#endif + +#ifdef HAVE__STRREV +#define SDL_strrev _strrev +#else +extern DECLSPEC char * SDLCALL SDL_strrev(char *string); +#endif + +#ifdef HAVE__STRUPR +#define SDL_strupr _strupr +#else +extern DECLSPEC char * SDLCALL SDL_strupr(char *string); +#endif + +#ifdef HAVE__STRLWR +#define SDL_strlwr _strlwr +#else +extern DECLSPEC char * SDLCALL SDL_strlwr(char *string); +#endif + +#ifdef HAVE_STRCHR +#define SDL_strchr strchr +#elif defined(HAVE_INDEX) +#define SDL_strchr index +#else +extern DECLSPEC char * SDLCALL SDL_strchr(const char *string, int c); +#endif + +#ifdef HAVE_STRRCHR +#define SDL_strrchr strrchr +#elif defined(HAVE_RINDEX) +#define SDL_strrchr rindex +#else +extern DECLSPEC char * SDLCALL SDL_strrchr(const char *string, int c); +#endif + +#ifdef HAVE_STRSTR +#define SDL_strstr strstr +#else +extern DECLSPEC char * SDLCALL SDL_strstr(const char *haystack, const char *needle); +#endif + +#ifdef HAVE_ITOA +#define SDL_itoa itoa +#else +#define SDL_itoa(value, string, radix) SDL_ltoa((long)value, string, radix) +#endif + +#ifdef HAVE__LTOA +#define SDL_ltoa _ltoa +#else +extern DECLSPEC char * SDLCALL SDL_ltoa(long value, char *string, int radix); +#endif + +#ifdef HAVE__UITOA +#define SDL_uitoa _uitoa +#else +#define SDL_uitoa(value, string, radix) SDL_ultoa((long)value, string, radix) +#endif + +#ifdef HAVE__ULTOA +#define SDL_ultoa _ultoa +#else +extern DECLSPEC char * SDLCALL SDL_ultoa(unsigned long value, char *string, int radix); +#endif + +#ifdef HAVE_STRTOL +#define SDL_strtol strtol +#else +extern DECLSPEC long SDLCALL SDL_strtol(const char *string, char **endp, int base); +#endif + +#ifdef HAVE_STRTOUL +#define SDL_strtoul strtoul +#else +extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *string, char **endp, int base); +#endif + +#ifdef SDL_HAS_64BIT_TYPE + +#ifdef HAVE__I64TOA +#define SDL_lltoa _i64toa +#else +extern DECLSPEC char* SDLCALL SDL_lltoa(Sint64 value, char *string, int radix); +#endif + +#ifdef HAVE__UI64TOA +#define SDL_ulltoa _ui64toa +#else +extern DECLSPEC char* SDLCALL SDL_ulltoa(Uint64 value, char *string, int radix); +#endif + +#ifdef HAVE_STRTOLL +#define SDL_strtoll strtoll +#else +extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *string, char **endp, int base); +#endif + +#ifdef HAVE_STRTOULL +#define SDL_strtoull strtoull +#else +extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *string, char **endp, int base); +#endif + +#endif /* SDL_HAS_64BIT_TYPE */ + +#ifdef HAVE_STRTOD +#define SDL_strtod strtod +#else +extern DECLSPEC double SDLCALL SDL_strtod(const char *string, char **endp); +#endif + +#ifdef HAVE_ATOI +#define SDL_atoi atoi +#else +#define SDL_atoi(X) SDL_strtol(X, NULL, 0) +#endif + +#ifdef HAVE_ATOF +#define SDL_atof atof +#else +#define SDL_atof(X) SDL_strtod(X, NULL) +#endif + +#ifdef HAVE_STRCMP +#define SDL_strcmp strcmp +#else +extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2); +#endif + +#ifdef HAVE_STRNCMP +#define SDL_strncmp strncmp +#else +extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen); +#endif + +#ifdef HAVE_STRCASECMP +#define SDL_strcasecmp strcasecmp +#elif defined(HAVE__STRICMP) +#define SDL_strcasecmp _stricmp +#else +extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2); +#endif + +#ifdef HAVE_STRNCASECMP +#define SDL_strncasecmp strncasecmp +#elif defined(HAVE__STRNICMP) +#define SDL_strncasecmp _strnicmp +#else +extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen); +#endif + +#ifdef HAVE_SSCANF +#define SDL_sscanf sscanf +#else +extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, ...); +#endif + +#ifdef HAVE_SNPRINTF +#define SDL_snprintf snprintf +#else +extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...); +#endif + +#ifdef HAVE_VSNPRINTF +#define SDL_vsnprintf vsnprintf +#else +extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap); +#endif + +/** @name SDL_ICONV Error Codes + * The SDL implementation of iconv() returns these error codes + */ +/*@{*/ +#define SDL_ICONV_ERROR (size_t)-1 +#define SDL_ICONV_E2BIG (size_t)-2 +#define SDL_ICONV_EILSEQ (size_t)-3 +#define SDL_ICONV_EINVAL (size_t)-4 +/*@}*/ + +#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) +#define SDL_iconv_t iconv_t +#define SDL_iconv_open iconv_open +#define SDL_iconv_close iconv_close +#else +typedef struct _SDL_iconv_t *SDL_iconv_t; +extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, const char *fromcode); +extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); +#endif +extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); +/** This function converts a string between encodings in one pass, returning a + * string that must be freed with SDL_free() or NULL on error. + */ +extern DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft); +#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1) + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_stdinc_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_syswm.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_syswm.h new file mode 100644 index 0000000000..716dddcb73 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_syswm.h @@ -0,0 +1,225 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_syswm.h + * Include file for SDL custom system window manager hooks + */ + +#ifndef _SDL_syswm_h +#define _SDL_syswm_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_version.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @file SDL_syswm.h + * Your application has access to a special type of event 'SDL_SYSWMEVENT', + * which contains window-manager specific information and arrives whenever + * an unhandled window event occurs. This event is ignored by default, but + * you can enable it with SDL_EventState() + */ +#ifdef SDL_PROTOTYPES_ONLY +struct SDL_SysWMinfo; +typedef struct SDL_SysWMinfo SDL_SysWMinfo; +#else + +/* This is the structure for custom window manager events */ +#if defined(SDL_VIDEO_DRIVER_X11) +#if defined(__APPLE__) && defined(__MACH__) +/* conflicts with Quickdraw.h */ +#define Cursor X11Cursor +#endif + +#include +#include + +#if defined(__APPLE__) && defined(__MACH__) +/* matches the re-define above */ +#undef Cursor +#endif + +/** These are the various supported subsystems under UNIX */ +typedef enum { + SDL_SYSWM_X11 +} SDL_SYSWM_TYPE; + +/** The UNIX custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + SDL_SYSWM_TYPE subsystem; + union { + XEvent xevent; + } event; +}; + +/** The UNIX custom window manager information structure. + * When this structure is returned, it holds information about which + * low level system it is using, and will be one of SDL_SYSWM_TYPE. + */ +typedef struct SDL_SysWMinfo { + SDL_version version; + SDL_SYSWM_TYPE subsystem; + union { + struct { + Display *display; /**< The X11 display */ + Window window; /**< The X11 display window */ + /** These locking functions should be called around + * any X11 functions using the display variable, + * but not the gfxdisplay variable. + * They lock the event thread, so should not be + * called around event functions or from event filters. + */ + /*@{*/ + void (*lock_func)(void); + void (*unlock_func)(void); + /*@}*/ + + /** @name Introduced in SDL 1.0.2 */ + /*@{*/ + Window fswindow; /**< The X11 fullscreen window */ + Window wmwindow; /**< The X11 managed input window */ + /*@}*/ + + /** @name Introduced in SDL 1.2.12 */ + /*@{*/ + Display *gfxdisplay; /**< The X11 display to which rendering is done */ + /*@}*/ + } x11; + } info; +} SDL_SysWMinfo; + +#elif defined(SDL_VIDEO_DRIVER_NANOX) +#include + +/** The generic custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + int data; +}; + +/** The windows custom window manager information structure */ +typedef struct SDL_SysWMinfo { + SDL_version version ; + GR_WINDOW_ID window ; /* The display window */ +} SDL_SysWMinfo; + +#elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI) +#define WIN32_LEAN_AND_MEAN +#include + +/** The windows custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + HWND hwnd; /**< The window for the message */ + UINT msg; /**< The type of message */ + WPARAM wParam; /**< WORD message parameter */ + LPARAM lParam; /**< LONG message parameter */ +}; + +/** The windows custom window manager information structure */ +typedef struct SDL_SysWMinfo { + SDL_version version; + HWND window; /**< The Win32 display window */ + HGLRC hglrc; /**< The OpenGL context, if any */ +} SDL_SysWMinfo; + +#elif defined(SDL_VIDEO_DRIVER_RISCOS) + +/** RISC OS custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + int eventCode; /**< The window for the message */ + int pollBlock[64]; +}; + +/** The RISC OS custom window manager information structure */ +typedef struct SDL_SysWMinfo { + SDL_version version; + int wimpVersion; /**< Wimp version running under */ + int taskHandle; /**< The RISC OS task handle */ + int window; /**< The RISC OS display window */ +} SDL_SysWMinfo; + +#elif defined(SDL_VIDEO_DRIVER_PHOTON) +#include +#include + +/** The QNX custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + int data; +}; + +/** The QNX custom window manager information structure */ +typedef struct SDL_SysWMinfo { + SDL_version version; + int data; +} SDL_SysWMinfo; + +#else + +/** The generic custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + int data; +}; + +/** The generic custom window manager information structure */ +typedef struct SDL_SysWMinfo { + SDL_version version; + int data; +} SDL_SysWMinfo; + +#endif /* video driver type */ + +#endif /* SDL_PROTOTYPES_ONLY */ + +/* Function prototypes */ +/** + * This function gives you custom hooks into the window manager information. + * It fills the structure pointed to by 'info' with custom information and + * returns 1 if the function is implemented. If it's not implemented, or + * the version member of the 'info' structure is invalid, it returns 0. + * + * You typically use this function like this: + * @code + * SDL_SysWMInfo info; + * SDL_VERSION(&info.version); + * if ( SDL_GetWMInfo(&info) ) { ... } + * @endcode + */ +extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_syswm_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_thread.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_thread.h new file mode 100644 index 0000000000..1ca9a1bc42 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_thread.h @@ -0,0 +1,120 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_thread_h +#define _SDL_thread_h + +/** @file SDL_thread.h + * Header for the SDL thread management routines + * + * @note These are independent of the other SDL routines. + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +/* Thread synchronization primitives */ +#include "SDL_mutex.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** The SDL thread structure, defined in SDL_thread.c */ +struct SDL_Thread; +typedef struct SDL_Thread SDL_Thread; + +/** Create a thread */ +#if ((defined(__WIN32__) && !defined(HAVE_LIBC)) || defined(__OS2__)) && !defined(__SYMBIAN32__) +/** + * We compile SDL into a DLL on OS/2. This means, that it's the DLL which + * creates a new thread for the calling process with the SDL_CreateThread() + * API. There is a problem with this, that only the RTL of the SDL.DLL will + * be initialized for those threads, and not the RTL of the calling application! + * To solve this, we make a little hack here. + * We'll always use the caller's _beginthread() and _endthread() APIs to + * start a new thread. This way, if it's the SDL.DLL which uses this API, + * then the RTL of SDL.DLL will be used to create the new thread, and if it's + * the application, then the RTL of the application will be used. + * So, in short: + * Always use the _beginthread() and _endthread() of the calling runtime library! + */ +#define SDL_PASSED_BEGINTHREAD_ENDTHREAD +#ifndef _WIN32_WCE +#include /* This has _beginthread() and _endthread() defined! */ +#endif + +#ifdef __OS2__ +typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg); +typedef void (*pfnSDL_CurrentEndThread)(void); +#elif __GNUC__ +typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, + unsigned (__stdcall *func)(void *), void *arg, + unsigned, unsigned *threadID); +typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); +#else +typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, + unsigned (__stdcall *func)(void *), void *arg, + unsigned, unsigned *threadID); +typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); +#endif + +extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread); + +#ifdef __OS2__ +#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthread, _endthread) +#elif defined(_WIN32_WCE) +#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, NULL, NULL) +#else +#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthreadex, _endthreadex) +#endif +#else +extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data); +#endif + +/** Get the 32-bit thread identifier for the current thread */ +extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void); + +/** Get the 32-bit thread identifier for the specified thread, + * equivalent to SDL_ThreadID() if the specified thread is NULL. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread *thread); + +/** Wait for a thread to finish. + * The return code for the thread function is placed in the area + * pointed to by 'status', if 'status' is not NULL. + */ +extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status); + +/** Forcefully kill a thread without worrying about its state */ +extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_thread_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_timer.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_timer.h new file mode 100644 index 0000000000..d7cd024601 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_timer.h @@ -0,0 +1,125 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_timer_h +#define _SDL_timer_h + +/** @file SDL_timer.h + * Header for the SDL time management routines + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** This is the OS scheduler timeslice, in milliseconds */ +#define SDL_TIMESLICE 10 + +/** This is the maximum resolution of the SDL timer on all platforms */ +#define TIMER_RESOLUTION 10 /**< Experimentally determined */ + +/** + * Get the number of milliseconds since the SDL library initialization. + * Note that this value wraps if the program runs for more than ~49 days. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); + +/** Wait a specified number of milliseconds before returning */ +extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); + +/** Function prototype for the timer callback function */ +typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval); + +/** + * Set a callback to run after the specified number of milliseconds has + * elapsed. The callback function is passed the current timer interval + * and returns the next timer interval. If the returned value is the + * same as the one passed in, the periodic alarm continues, otherwise a + * new alarm is scheduled. If the callback returns 0, the periodic alarm + * is cancelled. + * + * To cancel a currently running timer, call SDL_SetTimer(0, NULL); + * + * The timer callback function may run in a different thread than your + * main code, and so shouldn't call any functions from within itself. + * + * The maximum resolution of this timer is 10 ms, which means that if + * you request a 16 ms timer, your callback will run approximately 20 ms + * later on an unloaded system. If you wanted to set a flag signaling + * a frame update at 30 frames per second (every 33 ms), you might set a + * timer for 30 ms: + * @code SDL_SetTimer((33/10)*10, flag_update); @endcode + * + * If you use this function, you need to pass SDL_INIT_TIMER to SDL_Init(). + * + * Under UNIX, you should not use raise or use SIGALRM and this function + * in the same program, as it is implemented using setitimer(). You also + * should not use this function in multi-threaded applications as signals + * to multi-threaded apps have undefined behavior in some implementations. + * + * This function returns 0 if successful, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback); + +/** @name New timer API + * New timer API, supports multiple timers + * Written by Stephane Peter + */ +/*@{*/ + +/** + * Function prototype for the new timer callback function. + * The callback function is passed the current timer interval and returns + * the next timer interval. If the returned value is the same as the one + * passed in, the periodic alarm continues, otherwise a new alarm is + * scheduled. If the callback returns 0, the periodic alarm is cancelled. + */ +typedef Uint32 (SDLCALL *SDL_NewTimerCallback)(Uint32 interval, void *param); + +/** Definition of the timer ID type */ +typedef struct _SDL_TimerID *SDL_TimerID; + +/** Add a new timer to the pool of timers already running. + * Returns a timer ID, or NULL when an error occurs. + */ +extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param); + +/** + * Remove one of the multiple timers knowing its ID. + * Returns a boolean value indicating success. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t); + +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_timer_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_types.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_types.h new file mode 100644 index 0000000000..cfa35236a4 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_types.h @@ -0,0 +1,28 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_types.h + * @deprecated Use SDL_stdinc.h instead. + */ + +/* DEPRECATED */ +#include "SDL_stdinc.h" diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_version.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_version.h new file mode 100644 index 0000000000..fa02c3f6da --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_version.h @@ -0,0 +1,91 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_version.h + * This header defines the current SDL version + */ + +#ifndef _SDL_version_h +#define _SDL_version_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @name Version Number + * Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL + */ +/*@{*/ +#define SDL_MAJOR_VERSION 1 +#define SDL_MINOR_VERSION 2 +#define SDL_PATCHLEVEL 14 +/*@}*/ + +typedef struct SDL_version { + Uint8 major; + Uint8 minor; + Uint8 patch; +} SDL_version; + +/** + * This macro can be used to fill a version structure with the compile-time + * version of the SDL library. + */ +#define SDL_VERSION(X) \ +{ \ + (X)->major = SDL_MAJOR_VERSION; \ + (X)->minor = SDL_MINOR_VERSION; \ + (X)->patch = SDL_PATCHLEVEL; \ +} + +/** This macro turns the version numbers into a numeric value: + * (1,2,3) -> (1203) + * This assumes that there will never be more than 100 patchlevels + */ +#define SDL_VERSIONNUM(X, Y, Z) \ + ((X)*1000 + (Y)*100 + (Z)) + +/** This is the version number macro for the current SDL version */ +#define SDL_COMPILEDVERSION \ + SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) + +/** This macro will evaluate to true if compiled with SDL at least X.Y.Z */ +#define SDL_VERSION_ATLEAST(X, Y, Z) \ + (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) + +/** This function gets the version of the dynamically linked SDL library. + * it should NOT be used to fill a version structure, instead you should + * use the SDL_Version() macro. + */ +extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_version_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_video.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_video.h new file mode 100644 index 0000000000..8f7f305203 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/SDL_video.h @@ -0,0 +1,951 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_video.h + * Header file for access to the SDL raw framebuffer window + */ + +#ifndef _SDL_video_h +#define _SDL_video_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_rwops.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @name Transparency definitions + * These define alpha as the opacity of a surface + */ +/*@{*/ +#define SDL_ALPHA_OPAQUE 255 +#define SDL_ALPHA_TRANSPARENT 0 +/*@}*/ + +/** @name Useful data types */ +/*@{*/ +typedef struct SDL_Rect { + Sint16 x, y; + Uint16 w, h; +} SDL_Rect; + +typedef struct SDL_Color { + Uint8 r; + Uint8 g; + Uint8 b; + Uint8 unused; +} SDL_Color; +#define SDL_Colour SDL_Color + +typedef struct SDL_Palette { + int ncolors; + SDL_Color *colors; +} SDL_Palette; +/*@}*/ + +/** Everything in the pixel format structure is read-only */ +typedef struct SDL_PixelFormat { + SDL_Palette *palette; + Uint8 BitsPerPixel; + Uint8 BytesPerPixel; + Uint8 Rloss; + Uint8 Gloss; + Uint8 Bloss; + Uint8 Aloss; + Uint8 Rshift; + Uint8 Gshift; + Uint8 Bshift; + Uint8 Ashift; + Uint32 Rmask; + Uint32 Gmask; + Uint32 Bmask; + Uint32 Amask; + + /** RGB color key information */ + Uint32 colorkey; + /** Alpha value information (per-surface alpha) */ + Uint8 alpha; +} SDL_PixelFormat; + +/** This structure should be treated as read-only, except for 'pixels', + * which, if not NULL, contains the raw pixel data for the surface. + */ +typedef struct SDL_Surface { + Uint32 flags; /**< Read-only */ + SDL_PixelFormat *format; /**< Read-only */ + int w, h; /**< Read-only */ + Uint16 pitch; /**< Read-only */ + void *pixels; /**< Read-write */ + int offset; /**< Private */ + + /** Hardware-specific surface info */ + struct private_hwdata *hwdata; + + /** clipping information */ + SDL_Rect clip_rect; /**< Read-only */ + Uint32 unused1; /**< for binary compatibility */ + + /** Allow recursive locks */ + Uint32 locked; /**< Private */ + + /** info for fast blit mapping to other surfaces */ + struct SDL_BlitMap *map; /**< Private */ + + /** format version, bumped at every change to invalidate blit maps */ + unsigned int format_version; /**< Private */ + + /** Reference count -- used when freeing surface */ + int refcount; /**< Read-mostly */ +} SDL_Surface; + +/** @name SDL_Surface Flags + * These are the currently supported flags for the SDL_surface + */ +/*@{*/ + +/** Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */ +/*@{*/ +#define SDL_SWSURFACE 0x00000000 /**< Surface is in system memory */ +#define SDL_HWSURFACE 0x00000001 /**< Surface is in video memory */ +#define SDL_ASYNCBLIT 0x00000004 /**< Use asynchronous blits if possible */ +/*@}*/ + +/** Available for SDL_SetVideoMode() */ +/*@{*/ +#define SDL_ANYFORMAT 0x10000000 /**< Allow any video depth/pixel-format */ +#define SDL_HWPALETTE 0x20000000 /**< Surface has exclusive palette */ +#define SDL_DOUBLEBUF 0x40000000 /**< Set up double-buffered video mode */ +#define SDL_FULLSCREEN 0x80000000 /**< Surface is a full screen display */ +#define SDL_OPENGL 0x00000002 /**< Create an OpenGL rendering context */ +#define SDL_OPENGLBLIT 0x0000000A /**< Create an OpenGL rendering context and use it for blitting */ +#define SDL_RESIZABLE 0x00000010 /**< This video mode may be resized */ +#define SDL_NOFRAME 0x00000020 /**< No window caption or edge frame */ +/*@}*/ + +/** Used internally (read-only) */ +/*@{*/ +#define SDL_HWACCEL 0x00000100 /**< Blit uses hardware acceleration */ +#define SDL_SRCCOLORKEY 0x00001000 /**< Blit uses a source color key */ +#define SDL_RLEACCELOK 0x00002000 /**< Private flag */ +#define SDL_RLEACCEL 0x00004000 /**< Surface is RLE encoded */ +#define SDL_SRCALPHA 0x00010000 /**< Blit uses source alpha blending */ +#define SDL_PREALLOC 0x01000000 /**< Surface uses preallocated memory */ +/*@}*/ + +/*@}*/ + +/** Evaluates to true if the surface needs to be locked before access */ +#define SDL_MUSTLOCK(surface) \ + (surface->offset || \ + ((surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL)) != 0)) + +/** typedef for private surface blitting functions */ +typedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect, + struct SDL_Surface *dst, SDL_Rect *dstrect); + + +/** Useful for determining the video hardware capabilities */ +typedef struct SDL_VideoInfo { + Uint32 hw_available :1; /**< Flag: Can you create hardware surfaces? */ + Uint32 wm_available :1; /**< Flag: Can you talk to a window manager? */ + Uint32 UnusedBits1 :6; + Uint32 UnusedBits2 :1; + Uint32 blit_hw :1; /**< Flag: Accelerated blits HW --> HW */ + Uint32 blit_hw_CC :1; /**< Flag: Accelerated blits with Colorkey */ + Uint32 blit_hw_A :1; /**< Flag: Accelerated blits with Alpha */ + Uint32 blit_sw :1; /**< Flag: Accelerated blits SW --> HW */ + Uint32 blit_sw_CC :1; /**< Flag: Accelerated blits with Colorkey */ + Uint32 blit_sw_A :1; /**< Flag: Accelerated blits with Alpha */ + Uint32 blit_fill :1; /**< Flag: Accelerated color fill */ + Uint32 UnusedBits3 :16; + Uint32 video_mem; /**< The total amount of video memory (in K) */ + SDL_PixelFormat *vfmt; /**< Value: The format of the video surface */ + int current_w; /**< Value: The current video mode width */ + int current_h; /**< Value: The current video mode height */ +} SDL_VideoInfo; + + +/** @name Overlay Formats + * The most common video overlay formats. + * For an explanation of these pixel formats, see: + * http://www.webartz.com/fourcc/indexyuv.htm + * + * For information on the relationship between color spaces, see: + * http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html + */ +/*@{*/ +#define SDL_YV12_OVERLAY 0x32315659 /**< Planar mode: Y + V + U (3 planes) */ +#define SDL_IYUV_OVERLAY 0x56555949 /**< Planar mode: Y + U + V (3 planes) */ +#define SDL_YUY2_OVERLAY 0x32595559 /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */ +#define SDL_UYVY_OVERLAY 0x59565955 /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */ +#define SDL_YVYU_OVERLAY 0x55595659 /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */ +/*@}*/ + +/** The YUV hardware video overlay */ +typedef struct SDL_Overlay { + Uint32 format; /**< Read-only */ + int w, h; /**< Read-only */ + int planes; /**< Read-only */ + Uint16 *pitches; /**< Read-only */ + Uint8 **pixels; /**< Read-write */ + + /** @name Hardware-specific surface info */ + /*@{*/ + struct private_yuvhwfuncs *hwfuncs; + struct private_yuvhwdata *hwdata; + /*@{*/ + + /** @name Special flags */ + /*@{*/ + Uint32 hw_overlay :1; /**< Flag: This overlay hardware accelerated? */ + Uint32 UnusedBits :31; + /*@}*/ +} SDL_Overlay; + + +/** Public enumeration for setting the OpenGL window attributes. */ +typedef enum { + SDL_GL_RED_SIZE, + SDL_GL_GREEN_SIZE, + SDL_GL_BLUE_SIZE, + SDL_GL_ALPHA_SIZE, + SDL_GL_BUFFER_SIZE, + SDL_GL_DOUBLEBUFFER, + SDL_GL_DEPTH_SIZE, + SDL_GL_STENCIL_SIZE, + SDL_GL_ACCUM_RED_SIZE, + SDL_GL_ACCUM_GREEN_SIZE, + SDL_GL_ACCUM_BLUE_SIZE, + SDL_GL_ACCUM_ALPHA_SIZE, + SDL_GL_STEREO, + SDL_GL_MULTISAMPLEBUFFERS, + SDL_GL_MULTISAMPLESAMPLES, + SDL_GL_ACCELERATED_VISUAL, + SDL_GL_SWAP_CONTROL +} SDL_GLattr; + +/** @name flags for SDL_SetPalette() */ +/*@{*/ +#define SDL_LOGPAL 0x01 +#define SDL_PHYSPAL 0x02 +/*@}*/ + +/* Function prototypes */ + +/** + * @name Video Init and Quit + * These functions are used internally, and should not be used unless you + * have a specific need to specify the video driver you want to use. + * You should normally use SDL_Init() or SDL_InitSubSystem(). + */ +/*@{*/ +/** + * Initializes the video subsystem. Sets up a connection + * to the window manager, etc, and determines the current video mode and + * pixel format, but does not initialize a window or graphics mode. + * Note that event handling is activated by this routine. + * + * If you use both sound and video in your application, you need to call + * SDL_Init() before opening the sound device, otherwise under Win32 DirectX, + * you won't be able to set full-screen display modes. + */ +extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name, Uint32 flags); +extern DECLSPEC void SDLCALL SDL_VideoQuit(void); +/*@}*/ + +/** + * This function fills the given character buffer with the name of the + * video driver, and returns a pointer to it if the video driver has + * been initialized. It returns NULL if no driver has been initialized. + */ +extern DECLSPEC char * SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen); + +/** + * This function returns a pointer to the current display surface. + * If SDL is doing format conversion on the display surface, this + * function returns the publicly visible surface, not the real video + * surface. + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_GetVideoSurface(void); + +/** + * This function returns a read-only pointer to information about the + * video hardware. If this is called before SDL_SetVideoMode(), the 'vfmt' + * member of the returned structure will contain the pixel format of the + * "best" video mode. + */ +extern DECLSPEC const SDL_VideoInfo * SDLCALL SDL_GetVideoInfo(void); + +/** + * Check to see if a particular video mode is supported. + * It returns 0 if the requested mode is not supported under any bit depth, + * or returns the bits-per-pixel of the closest available mode with the + * given width and height. If this bits-per-pixel is different from the + * one used when setting the video mode, SDL_SetVideoMode() will succeed, + * but will emulate the requested bits-per-pixel with a shadow surface. + * + * The arguments to SDL_VideoModeOK() are the same ones you would pass to + * SDL_SetVideoMode() + */ +extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags); + +/** + * Return a pointer to an array of available screen dimensions for the + * given format and video flags, sorted largest to smallest. Returns + * NULL if there are no dimensions available for a particular format, + * or (SDL_Rect **)-1 if any dimension is okay for the given format. + * + * If 'format' is NULL, the mode list will be for the format given + * by SDL_GetVideoInfo()->vfmt + */ +extern DECLSPEC SDL_Rect ** SDLCALL SDL_ListModes(SDL_PixelFormat *format, Uint32 flags); + +/** + * Set up a video mode with the specified width, height and bits-per-pixel. + * + * If 'bpp' is 0, it is treated as the current display bits per pixel. + * + * If SDL_ANYFORMAT is set in 'flags', the SDL library will try to set the + * requested bits-per-pixel, but will return whatever video pixel format is + * available. The default is to emulate the requested pixel format if it + * is not natively available. + * + * If SDL_HWSURFACE is set in 'flags', the video surface will be placed in + * video memory, if possible, and you may have to call SDL_LockSurface() + * in order to access the raw framebuffer. Otherwise, the video surface + * will be created in system memory. + * + * If SDL_ASYNCBLIT is set in 'flags', SDL will try to perform rectangle + * updates asynchronously, but you must always lock before accessing pixels. + * SDL will wait for updates to complete before returning from the lock. + * + * If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee + * that the colors set by SDL_SetColors() will be the colors you get. + * Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all + * of the colors exactly the way they are requested, and you should look + * at the video surface structure to determine the actual palette. + * If SDL cannot guarantee that the colors you request can be set, + * i.e. if the colormap is shared, then the video surface may be created + * under emulation in system memory, overriding the SDL_HWSURFACE flag. + * + * If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set + * a fullscreen video mode. The default is to create a windowed mode + * if the current graphics system has a window manager. + * If the SDL library is able to set a fullscreen video mode, this flag + * will be set in the surface that is returned. + * + * If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up + * two surfaces in video memory and swap between them when you call + * SDL_Flip(). This is usually slower than the normal single-buffering + * scheme, but prevents "tearing" artifacts caused by modifying video + * memory while the monitor is refreshing. It should only be used by + * applications that redraw the entire screen on every update. + * + * If SDL_RESIZABLE is set in 'flags', the SDL library will allow the + * window manager, if any, to resize the window at runtime. When this + * occurs, SDL will send a SDL_VIDEORESIZE event to you application, + * and you must respond to the event by re-calling SDL_SetVideoMode() + * with the requested size (or another size that suits the application). + * + * If SDL_NOFRAME is set in 'flags', the SDL library will create a window + * without any title bar or frame decoration. Fullscreen video modes have + * this flag set automatically. + * + * This function returns the video framebuffer surface, or NULL if it fails. + * + * If you rely on functionality provided by certain video flags, check the + * flags of the returned surface to make sure that functionality is available. + * SDL will fall back to reduced functionality if the exact flags you wanted + * are not available. + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_SetVideoMode + (int width, int height, int bpp, Uint32 flags); + +/** @name SDL_Update Functions + * These functions should not be called while 'screen' is locked. + */ +/*@{*/ +/** + * Makes sure the given list of rectangles is updated on the given screen. + */ +extern DECLSPEC void SDLCALL SDL_UpdateRects + (SDL_Surface *screen, int numrects, SDL_Rect *rects); +/** + * If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire + * screen. + */ +extern DECLSPEC void SDLCALL SDL_UpdateRect + (SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h); +/*@}*/ + +/** + * On hardware that supports double-buffering, this function sets up a flip + * and returns. The hardware will wait for vertical retrace, and then swap + * video buffers before the next video surface blit or lock will return. + * On hardware that doesn not support double-buffering, this is equivalent + * to calling SDL_UpdateRect(screen, 0, 0, 0, 0); + * The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when + * setting the video mode for this function to perform hardware flipping. + * This function returns 0 if successful, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_Flip(SDL_Surface *screen); + +/** + * Set the gamma correction for each of the color channels. + * The gamma values range (approximately) between 0.1 and 10.0 + * + * If this function isn't supported directly by the hardware, it will + * be emulated using gamma ramps, if available. If successful, this + * function returns 0, otherwise it returns -1. + */ +extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue); + +/** + * Set the gamma translation table for the red, green, and blue channels + * of the video hardware. Each table is an array of 256 16-bit quantities, + * representing a mapping between the input and output for that channel. + * The input is the index into the array, and the output is the 16-bit + * gamma value at that index, scaled to the output color precision. + * + * You may pass NULL for any of the channels to leave it unchanged. + * If the call succeeds, it will return 0. If the display driver or + * hardware does not support gamma translation, or otherwise fails, + * this function will return -1. + */ +extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue); + +/** + * Retrieve the current values of the gamma translation tables. + * + * You must pass in valid pointers to arrays of 256 16-bit quantities. + * Any of the pointers may be NULL to ignore that channel. + * If the call succeeds, it will return 0. If the display driver or + * hardware does not support gamma translation, or otherwise fails, + * this function will return -1. + */ +extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue); + +/** + * Sets a portion of the colormap for the given 8-bit surface. If 'surface' + * is not a palettized surface, this function does nothing, returning 0. + * If all of the colors were set as passed to SDL_SetColors(), it will + * return 1. If not all the color entries were set exactly as given, + * it will return 0, and you should look at the surface palette to + * determine the actual color palette. + * + * When 'surface' is the surface associated with the current display, the + * display colormap will be updated with the requested colors. If + * SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors() + * will always return 1, and the palette is guaranteed to be set the way + * you desire, even if the window colormap has to be warped or run under + * emulation. + */ +extern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface *surface, + SDL_Color *colors, int firstcolor, int ncolors); + +/** + * Sets a portion of the colormap for a given 8-bit surface. + * 'flags' is one or both of: + * SDL_LOGPAL -- set logical palette, which controls how blits are mapped + * to/from the surface, + * SDL_PHYSPAL -- set physical palette, which controls how pixels look on + * the screen + * Only screens have physical palettes. Separate change of physical/logical + * palettes is only possible if the screen has SDL_HWPALETTE set. + * + * The return value is 1 if all colours could be set as requested, and 0 + * otherwise. + * + * SDL_SetColors() is equivalent to calling this function with + * flags = (SDL_LOGPAL|SDL_PHYSPAL). + */ +extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface *surface, int flags, + SDL_Color *colors, int firstcolor, + int ncolors); + +/** + * Maps an RGB triple to an opaque pixel value for a given pixel format + */ +extern DECLSPEC Uint32 SDLCALL SDL_MapRGB +(const SDL_PixelFormat * const format, + const Uint8 r, const Uint8 g, const Uint8 b); + +/** + * Maps an RGBA quadruple to a pixel value for a given pixel format + */ +extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA +(const SDL_PixelFormat * const format, + const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a); + +/** + * Maps a pixel value into the RGB components for a given pixel format + */ +extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, + const SDL_PixelFormat * const fmt, + Uint8 *r, Uint8 *g, Uint8 *b); + +/** + * Maps a pixel value into the RGBA components for a given pixel format + */ +extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, + const SDL_PixelFormat * const fmt, + Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); + +/** @sa SDL_CreateRGBSurface */ +#define SDL_AllocSurface SDL_CreateRGBSurface +/** + * Allocate and free an RGB surface (must be called after SDL_SetVideoMode) + * If the depth is 4 or 8 bits, an empty palette is allocated for the surface. + * If the depth is greater than 8 bits, the pixel format is set using the + * flags '[RGB]mask'. + * If the function runs out of memory, it will return NULL. + * + * The 'flags' tell what kind of surface to create. + * SDL_SWSURFACE means that the surface should be created in system memory. + * SDL_HWSURFACE means that the surface should be created in video memory, + * with the same format as the display surface. This is useful for surfaces + * that will not change much, to take advantage of hardware acceleration + * when being blitted to the display surface. + * SDL_ASYNCBLIT means that SDL will try to perform asynchronous blits with + * this surface, but you must always lock it before accessing the pixels. + * SDL will wait for current blits to finish before returning from the lock. + * SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits. + * If the hardware supports acceleration of colorkey blits between + * two surfaces in video memory, SDL will try to place the surface in + * video memory. If this isn't possible or if there is no hardware + * acceleration available, the surface will be placed in system memory. + * SDL_SRCALPHA means that the surface will be used for alpha blits and + * if the hardware supports hardware acceleration of alpha blits between + * two surfaces in video memory, to place the surface in video memory + * if possible, otherwise it will be placed in system memory. + * If the surface is created in video memory, blits will be _much_ faster, + * but the surface format must be identical to the video surface format, + * and the only way to access the pixels member of the surface is to use + * the SDL_LockSurface() and SDL_UnlockSurface() calls. + * If the requested surface actually resides in video memory, SDL_HWSURFACE + * will be set in the flags member of the returned surface. If for some + * reason the surface could not be placed in video memory, it will not have + * the SDL_HWSURFACE flag set, and will be created in system memory instead. + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurface + (Uint32 flags, int width, int height, int depth, + Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); +/** @sa SDL_CreateRGBSurface */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels, + int width, int height, int depth, int pitch, + Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); +extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface *surface); + +/** + * SDL_LockSurface() sets up a surface for directly accessing the pixels. + * Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write + * to and read from 'surface->pixels', using the pixel format stored in + * 'surface->format'. Once you are done accessing the surface, you should + * use SDL_UnlockSurface() to release it. + * + * Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates + * to 0, then you can read and write to the surface at any time, and the + * pixel format of the surface will not change. In particular, if the + * SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you + * will not need to lock the display surface before accessing it. + * + * No operating system or library calls should be made between lock/unlock + * pairs, as critical system locks may be held during this time. + * + * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked. + */ +extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface); +extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface); + +/** + * Load a surface from a seekable SDL data source (memory or file.) + * If 'freesrc' is non-zero, the source will be closed after being read. + * Returns the new surface, or NULL if there was an error. + * The new surface should be freed with SDL_FreeSurface(). + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, int freesrc); + +/** Convenience macro -- load a surface from a file */ +#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1) + +/** + * Save a surface to a seekable SDL data source (memory or file.) + * If 'freedst' is non-zero, the source will be closed after being written. + * Returns 0 if successful or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_SaveBMP_RW + (SDL_Surface *surface, SDL_RWops *dst, int freedst); + +/** Convenience macro -- save a surface to a file */ +#define SDL_SaveBMP(surface, file) \ + SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1) + +/** + * Sets the color key (transparent pixel) in a blittable surface. + * If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL), + * 'key' will be the transparent pixel in the source image of a blit. + * SDL_RLEACCEL requests RLE acceleration for the surface if present, + * and removes RLE acceleration if absent. + * If 'flag' is 0, this function clears any current color key. + * This function returns 0, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_SetColorKey + (SDL_Surface *surface, Uint32 flag, Uint32 key); + +/** + * This function sets the alpha value for the entire surface, as opposed to + * using the alpha component of each pixel. This value measures the range + * of transparency of the surface, 0 being completely transparent to 255 + * being completely opaque. An 'alpha' value of 255 causes blits to be + * opaque, the source pixels copied to the destination (the default). Note + * that per-surface alpha can be combined with colorkey transparency. + * + * If 'flag' is 0, alpha blending is disabled for the surface. + * If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface. + * OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the + * surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed. + * + * The 'alpha' parameter is ignored for surfaces that have an alpha channel. + */ +extern DECLSPEC int SDLCALL SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha); + +/** + * Sets the clipping rectangle for the destination surface in a blit. + * + * If the clip rectangle is NULL, clipping will be disabled. + * If the clip rectangle doesn't intersect the surface, the function will + * return SDL_FALSE and blits will be completely clipped. Otherwise the + * function returns SDL_TRUE and blits to the surface will be clipped to + * the intersection of the surface area and the clipping rectangle. + * + * Note that blits are automatically clipped to the edges of the source + * and destination surfaces. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect); + +/** + * Gets the clipping rectangle for the destination surface in a blit. + * 'rect' must be a pointer to a valid rectangle which will be filled + * with the correct values. + */ +extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect); + +/** + * Creates a new surface of the specified format, and then copies and maps + * the given surface to it so the blit of the converted surface will be as + * fast as possible. If this function fails, it returns NULL. + * + * The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those + * semantics. You can also pass SDL_RLEACCEL in the flags parameter and + * SDL will try to RLE accelerate colorkey and alpha blits in the resulting + * surface. + * + * This function is used internally by SDL_DisplayFormat(). + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurface + (SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags); + +/** + * This performs a fast blit from the source surface to the destination + * surface. It assumes that the source and destination rectangles are + * the same size. If either 'srcrect' or 'dstrect' are NULL, the entire + * surface (src or dst) is copied. The final blit rectangles are saved + * in 'srcrect' and 'dstrect' after all clipping is performed. + * If the blit is successful, it returns 0, otherwise it returns -1. + * + * The blit function should not be called on a locked surface. + * + * The blit semantics for surfaces with and without alpha and colorkey + * are defined as follows: + * + * RGBA->RGB: + * SDL_SRCALPHA set: + * alpha-blend (using alpha-channel). + * SDL_SRCCOLORKEY ignored. + * SDL_SRCALPHA not set: + * copy RGB. + * if SDL_SRCCOLORKEY set, only copy the pixels matching the + * RGB values of the source colour key, ignoring alpha in the + * comparison. + * + * RGB->RGBA: + * SDL_SRCALPHA set: + * alpha-blend (using the source per-surface alpha value); + * set destination alpha to opaque. + * SDL_SRCALPHA not set: + * copy RGB, set destination alpha to source per-surface alpha value. + * both: + * if SDL_SRCCOLORKEY set, only copy the pixels matching the + * source colour key. + * + * RGBA->RGBA: + * SDL_SRCALPHA set: + * alpha-blend (using the source alpha channel) the RGB values; + * leave destination alpha untouched. [Note: is this correct?] + * SDL_SRCCOLORKEY ignored. + * SDL_SRCALPHA not set: + * copy all of RGBA to the destination. + * if SDL_SRCCOLORKEY set, only copy the pixels matching the + * RGB values of the source colour key, ignoring alpha in the + * comparison. + * + * RGB->RGB: + * SDL_SRCALPHA set: + * alpha-blend (using the source per-surface alpha value). + * SDL_SRCALPHA not set: + * copy RGB. + * both: + * if SDL_SRCCOLORKEY set, only copy the pixels matching the + * source colour key. + * + * If either of the surfaces were in video memory, and the blit returns -2, + * the video memory was lost, so it should be reloaded with artwork and + * re-blitted: + * @code + * while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) { + * while ( SDL_LockSurface(image) < 0 ) + * Sleep(10); + * -- Write image pixels to image->pixels -- + * SDL_UnlockSurface(image); + * } + * @endcode + * + * This happens under DirectX 5.0 when the system switches away from your + * fullscreen application. The lock will also fail until you have access + * to the video memory again. + * + * You should call SDL_BlitSurface() unless you know exactly how SDL + * blitting works internally and how to use the other blit functions. + */ +#define SDL_BlitSurface SDL_UpperBlit + +/** This is the public blit function, SDL_BlitSurface(), and it performs + * rectangle validation and clipping before passing it to SDL_LowerBlit() + */ +extern DECLSPEC int SDLCALL SDL_UpperBlit + (SDL_Surface *src, SDL_Rect *srcrect, + SDL_Surface *dst, SDL_Rect *dstrect); +/** This is a semi-private blit function and it performs low-level surface + * blitting only. + */ +extern DECLSPEC int SDLCALL SDL_LowerBlit + (SDL_Surface *src, SDL_Rect *srcrect, + SDL_Surface *dst, SDL_Rect *dstrect); + +/** + * This function performs a fast fill of the given rectangle with 'color' + * The given rectangle is clipped to the destination surface clip area + * and the final fill rectangle is saved in the passed in pointer. + * If 'dstrect' is NULL, the whole surface will be filled with 'color' + * The color should be a pixel of the format used by the surface, and + * can be generated by the SDL_MapRGB() function. + * This function returns 0 on success, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_FillRect + (SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color); + +/** + * This function takes a surface and copies it to a new surface of the + * pixel format and colors of the video framebuffer, suitable for fast + * blitting onto the display surface. It calls SDL_ConvertSurface() + * + * If you want to take advantage of hardware colorkey or alpha blit + * acceleration, you should set the colorkey and alpha value before + * calling this function. + * + * If the conversion fails or runs out of memory, it returns NULL + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormat(SDL_Surface *surface); + +/** + * This function takes a surface and copies it to a new surface of the + * pixel format and colors of the video framebuffer (if possible), + * suitable for fast alpha blitting onto the display surface. + * The new surface will always have an alpha channel. + * + * If you want to take advantage of hardware colorkey or alpha blit + * acceleration, you should set the colorkey and alpha value before + * calling this function. + * + * If the conversion fails or runs out of memory, it returns NULL + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *surface); + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name YUV video surface overlay functions */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** This function creates a video output overlay + * Calling the returned surface an overlay is something of a misnomer because + * the contents of the display surface underneath the area where the overlay + * is shown is undefined - it may be overwritten with the converted YUV data. + */ +extern DECLSPEC SDL_Overlay * SDLCALL SDL_CreateYUVOverlay(int width, int height, + Uint32 format, SDL_Surface *display); + +/** Lock an overlay for direct access, and unlock it when you are done */ +extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay *overlay); +extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay *overlay); + +/** Blit a video overlay to the display surface. + * The contents of the video surface underneath the blit destination are + * not defined. + * The width and height of the destination rectangle may be different from + * that of the overlay, but currently only 2x scaling is supported. + */ +extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect); + +/** Free a video overlay */ +extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay *overlay); + +/*@}*/ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name OpenGL support functions. */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** + * Dynamically load an OpenGL library, or the default one if path is NULL + * + * If you do this, you need to retrieve all of the GL functions used in + * your program from the dynamic library using SDL_GL_GetProcAddress(). + */ +extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); + +/** + * Get the address of a GL function + */ +extern DECLSPEC void * SDLCALL SDL_GL_GetProcAddress(const char* proc); + +/** + * Set an attribute of the OpenGL subsystem before intialization. + */ +extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); + +/** + * Get an attribute of the OpenGL subsystem from the windowing + * interface, such as glX. This is of course different from getting + * the values from SDL's internal OpenGL subsystem, which only + * stores the values you request before initialization. + * + * Developers should track the values they pass into SDL_GL_SetAttribute + * themselves if they want to retrieve these values. + */ +extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int* value); + +/** + * Swap the OpenGL buffers, if double-buffering is supported. + */ +extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void); + +/** @name OpenGL Internal Functions + * Internal functions that should not be called unless you have read + * and understood the source code for these functions. + */ +/*@{*/ +extern DECLSPEC void SDLCALL SDL_GL_UpdateRects(int numrects, SDL_Rect* rects); +extern DECLSPEC void SDLCALL SDL_GL_Lock(void); +extern DECLSPEC void SDLCALL SDL_GL_Unlock(void); +/*@}*/ + +/*@}*/ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name Window Manager Functions */ +/** These functions allow interaction with the window manager, if any. */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** + * Sets the title and icon text of the display window (UTF-8 encoded) + */ +extern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title, const char *icon); +/** + * Gets the title and icon text of the display window (UTF-8 encoded) + */ +extern DECLSPEC void SDLCALL SDL_WM_GetCaption(char **title, char **icon); + +/** + * Sets the icon for the display window. + * This function must be called before the first call to SDL_SetVideoMode(). + * It takes an icon surface, and a mask in MSB format. + * If 'mask' is NULL, the entire icon surface will be used as the icon. + */ +extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask); + +/** + * This function iconifies the window, and returns 1 if it succeeded. + * If the function succeeds, it generates an SDL_APPACTIVE loss event. + * This function is a noop and returns 0 in non-windowed environments. + */ +extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void); + +/** + * Toggle fullscreen mode without changing the contents of the screen. + * If the display surface does not require locking before accessing + * the pixel information, then the memory pointers will not change. + * + * If this function was able to toggle fullscreen mode (change from + * running in a window to fullscreen, or vice-versa), it will return 1. + * If it is not implemented, or fails, it returns 0. + * + * The next call to SDL_SetVideoMode() will set the mode fullscreen + * attribute based on the flags parameter - if SDL_FULLSCREEN is not + * set, then the display will be windowed by default where supported. + * + * This is currently only implemented in the X11 video driver. + */ +extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface *surface); + +typedef enum { + SDL_GRAB_QUERY = -1, + SDL_GRAB_OFF = 0, + SDL_GRAB_ON = 1, + SDL_GRAB_FULLSCREEN /**< Used internally */ +} SDL_GrabMode; +/** + * This function allows you to set and query the input grab state of + * the application. It returns the new input grab state. + * + * Grabbing means that the mouse is confined to the application window, + * and nearly all keyboard input is passed directly to the application, + * and not interpreted by a window manager, if any. + */ +extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode); + +/*@}*/ + +/** @internal Not in public API at the moment - do not use! */ +extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect, + SDL_Surface *dst, SDL_Rect *dstrect); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_video_h */ diff --git a/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/begin_code.h b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/begin_code.h new file mode 100644 index 0000000000..22748090c5 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/include/begin_code.h @@ -0,0 +1,191 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file begin_code.h + * This file sets things up for C dynamic library function definitions, + * static inlined functions, and structures aligned at 4-byte alignment. + * If you don't like ugly C preprocessor code, don't look at this file. :) + */ + +/** + * @file begin_code.h + * This shouldn't be nested -- included it around code only. + */ +#ifdef _begin_code_h +#error Nested inclusion of begin_code.h +#endif +#define _begin_code_h + +/** + * @def DECLSPEC + * Some compilers use a special export keyword + */ +#ifndef DECLSPEC +# if defined(__BEOS__) || defined(__HAIKU__) +# if defined(__GNUC__) +# define DECLSPEC __declspec(dllexport) +# else +# define DECLSPEC __declspec(export) +# endif +# elif defined(__WIN32__) +# ifdef __BORLANDC__ +# ifdef BUILD_SDL +# define DECLSPEC +# else +# define DECLSPEC __declspec(dllimport) +# endif +# else +# define DECLSPEC __declspec(dllexport) +# endif +# elif defined(__OS2__) +# ifdef __WATCOMC__ +# ifdef BUILD_SDL +# define DECLSPEC __declspec(dllexport) +# else +# define DECLSPEC +# endif +# elif defined (__GNUC__) && __GNUC__ < 4 +# /* Added support for GCC-EMX = 4 +# define DECLSPEC __attribute__ ((visibility("default"))) +# else +# define DECLSPEC +# endif +# endif +#endif + +/** + * @def SDLCALL + * By default SDL uses the C calling convention + */ +#ifndef SDLCALL +# if defined(__WIN32__) && !defined(__GNUC__) +# define SDLCALL __cdecl +# elif defined(__OS2__) +# if defined (__GNUC__) && __GNUC__ < 4 +# /* Added support for GCC-EMX &2 +fi + +while test $# -gt 0 ; do + case "$1" in + -*=*) + optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` + ;; + *) + optarg= + ;; + esac + + case $1 in + --prefix=*) + prefix=$optarg + local_prefix=yes + ;; + --prefix) + echo_prefix=yes + ;; + --exec-prefix=*) + exec_prefix=$optarg + exec_prefix_set=yes + local_prefix=yes + ;; + --exec-prefix) + echo_exec_prefix=yes + ;; + --version) + echo 9.16.3 + exit 0 + ;; + --ftversion) + major=`grep define c:/progra~1/FreeType/include/freetype2/freetype/freetype.h \ + | grep FREETYPE_MAJOR \ + | sed 's/.*[ ]\([0-9][0-9]*\).*/\1/'` + minor=`grep define c:/progra~1/FreeType/include/freetype2/freetype/freetype.h \ + | grep FREETYPE_MINOR \ + | sed 's/.*[ ]\([0-9][0-9]*\).*/\1/'` + patch=`grep define c:/progra~1/FreeType/include/freetype2/freetype/freetype.h \ + | grep FREETYPE_PATCH \ + | sed 's/.*[ ]\([0-9][0-9]*\).*/\1/'` + echo $major.$minor.$patch + exit 0 + ;; + --cflags) + echo_cflags=yes + ;; + --libs) + echo_libs=yes + ;; + --libtool) + echo_libtool=yes + ;; + *) + usage 1 1>&2 + ;; + esac + shift +done + +if test "$local_prefix" = "yes" ; then + if test "$exec_prefix_set" != "yes" ; then + exec_prefix=$prefix + fi +fi + +if test "$echo_prefix" = "yes" ; then + echo $prefix +fi + +if test "$echo_exec_prefix" = "yes" ; then + echo $exec_prefix +fi + +if test "$exec_prefix_set" = "yes" ; then + libdir=$exec_prefix/lib +else + if test "$local_prefix" = "yes" ; then + includedir=$prefix/include + libdir=$prefix/lib + fi +fi + +if test "$echo_cflags" = "yes" ; then + cflags="-I$includedir/freetype2" + if test "$includedir" != "/usr/include" ; then + echo $cflags -I$includedir + else + echo $cflags + fi +fi + +if test "$echo_libs" = "yes" ; then + rpath= + if test "$enable_shared" = "yes" ; then + eval "rpath=\"$hardcode_libdir_flag_spec\"" + fi + libs="-lfreetype -lz -Wl,-s -LD:/Progra~1/GnuWin32/lib -lintl -lwsock32 -lole32 -luuid -lmsvcp60 " + if test "$libdir" != "/usr/lib" && test "$libdir" != "/usr/lib64"; then + echo -L$libdir $rpath $libs + else + echo $libs + fi +fi + +if test "$echo_libtool" = "yes" ; then + convlib="libfreetype.la" + echo $libdir/$convlib +fi + +# EOF diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/freetype6.dll b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/freetype6.dll new file mode 100644 index 0000000000..e35edc6bb0 Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/freetype6.dll differ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftbench.exe b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftbench.exe new file mode 100644 index 0000000000..6ce0484476 Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftbench.exe differ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftchkwd.exe b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftchkwd.exe new file mode 100644 index 0000000000..6d98d33a43 Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftchkwd.exe differ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftdiff.exe b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftdiff.exe new file mode 100644 index 0000000000..7ef5af3c04 Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftdiff.exe differ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftdump.exe b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftdump.exe new file mode 100644 index 0000000000..6a0e4ef766 Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftdump.exe differ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftgamma.exe b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftgamma.exe new file mode 100644 index 0000000000..1cadbbcd5d Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftgamma.exe differ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftgrid.exe b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftgrid.exe new file mode 100644 index 0000000000..58af9be5bd Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftgrid.exe differ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftlint.exe b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftlint.exe new file mode 100644 index 0000000000..2c783d938f Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftlint.exe differ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftmemchk.exe b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftmemchk.exe new file mode 100644 index 0000000000..ead01059d7 Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftmemchk.exe differ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftmulti.exe b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftmulti.exe new file mode 100644 index 0000000000..44685283f0 Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftmulti.exe differ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftpatchk.exe b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftpatchk.exe new file mode 100644 index 0000000000..3e04441eb9 Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftpatchk.exe differ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftstring.exe b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftstring.exe new file mode 100644 index 0000000000..8edb92c5ff Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftstring.exe differ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/fttimer.exe b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/fttimer.exe new file mode 100644 index 0000000000..a87e06d7a2 Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/fttimer.exe differ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftvalid.exe b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftvalid.exe new file mode 100644 index 0000000000..2a1287c20e Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftvalid.exe differ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftview.exe b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftview.exe new file mode 100644 index 0000000000..7fe982f5bd Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/bin/ftview.exe differ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/config/ftconfig.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/config/ftconfig.h new file mode 100644 index 0000000000..3b447508c5 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/config/ftconfig.h @@ -0,0 +1,350 @@ +/* ftconfig.h. Generated from ftconfig.in by configure. */ +/***************************************************************************/ +/* */ +/* ftconfig.in */ +/* */ +/* UNIX-specific configuration file (specification only). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This header file contains a number of macro definitions that are used */ + /* by the rest of the engine. Most of the macros here are automatically */ + /* determined at compile time, and you should not need to change it to */ + /* port FreeType, except to compile the library with a non-ANSI */ + /* compiler. */ + /* */ + /* Note however that if some specific modifications are needed, we */ + /* advise you to place a modified copy in your build directory. */ + /* */ + /* The build directory is usually `freetype/builds/', and */ + /* contains system-specific files that are always included first when */ + /* building the library. */ + /* */ + /*************************************************************************/ + + +#ifndef __FTCONFIG_H__ +#define __FTCONFIG_H__ + +#include +#include FT_CONFIG_OPTIONS_H +#include FT_CONFIG_STANDARD_LIBRARY_H + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* PLATFORM-SPECIFIC CONFIGURATION MACROS */ + /* */ + /* These macros can be toggled to suit a specific system. The current */ + /* ones are defaults used to compile FreeType in an ANSI C environment */ + /* (16bit compilers are also supported). Copy this file to your own */ + /* `freetype/builds/' directory, and edit it to port the engine. */ + /* */ + /*************************************************************************/ + + +#define HAVE_UNISTD_H 1 +#define HAVE_FCNTL_H 1 + +#define SIZEOF_INT 4 +#define SIZEOF_LONG 4 + + +#define FT_SIZEOF_INT SIZEOF_INT +#define FT_SIZEOF_LONG SIZEOF_LONG + +#define FT_CHAR_BIT CHAR_BIT + + /* Preferred alignment of data */ +#define FT_ALIGNMENT 8 + + + /* FT_UNUSED is a macro used to indicate that a given parameter is not */ + /* used -- this is only used to get rid of unpleasant compiler warnings */ +#ifndef FT_UNUSED +#define FT_UNUSED( arg ) ( (arg) = (arg) ) +#endif + + + /*************************************************************************/ + /* */ + /* AUTOMATIC CONFIGURATION MACROS */ + /* */ + /* These macros are computed from the ones defined above. Don't touch */ + /* their definition, unless you know precisely what you are doing. No */ + /* porter should need to mess with them. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* Mac support */ + /* */ + /* This is the only necessary change, so it is defined here instead */ + /* providing a new configuration file. */ + /* */ +#if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \ + ( defined( __MWERKS__ ) && defined( macintosh ) ) + /* no Carbon frameworks for 64bit 10.4.x */ +#include "AvailabilityMacros.h" +#if defined( __LP64__ ) && \ + ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 ) +#define DARWIN_NO_CARBON 1 +#else +#define FT_MACINTOSH 1 +#endif +#endif + + + /* Fix compiler warning with sgi compiler */ +#if defined( __sgi ) && !defined( __GNUC__ ) +#if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 ) +#pragma set woff 3505 +#endif +#endif + + + /*************************************************************************/ + /* */ + /* IntN types */ + /* */ + /* Used to guarantee the size of some specific integers. */ + /* */ + typedef signed short FT_Int16; + typedef unsigned short FT_UInt16; + +#if FT_SIZEOF_INT == 4 + + typedef signed int FT_Int32; + typedef unsigned int FT_UInt32; + +#elif FT_SIZEOF_LONG == 4 + + typedef signed long FT_Int32; + typedef unsigned long FT_UInt32; + +#else +#error "no 32bit type found -- please check your configuration files" +#endif + + + /* look up an integer type that is at least 32 bits */ +#if FT_SIZEOF_INT >= 4 + + typedef int FT_Fast; + typedef unsigned int FT_UFast; + +#elif FT_SIZEOF_LONG >= 4 + + typedef long FT_Fast; + typedef unsigned long FT_UFast; + +#endif + + + /* determine whether we have a 64-bit int type for platforms without */ + /* Autoconf */ +#if FT_SIZEOF_LONG == 8 + + /* FT_LONG64 must be defined if a 64-bit type is available */ +#define FT_LONG64 +#define FT_INT64 long + +#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */ + + /* this compiler provides the __int64 type */ +#define FT_LONG64 +#define FT_INT64 __int64 + +#elif defined( __BORLANDC__ ) /* Borland C++ */ + + /* XXXX: We should probably check the value of __BORLANDC__ in order */ + /* to test the compiler version. */ + + /* this compiler provides the __int64 type */ +#define FT_LONG64 +#define FT_INT64 __int64 + +#elif defined( __WATCOMC__ ) /* Watcom C++ */ + + /* Watcom doesn't provide 64-bit data types */ + +#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */ + +#define FT_LONG64 +#define FT_INT64 long long int + +#elif defined( __GNUC__ ) + + /* GCC provides the `long long' type */ +#define FT_LONG64 +#define FT_INT64 long long int + +#endif /* FT_SIZEOF_LONG == 8 */ + + +#define FT_BEGIN_STMNT do { +#define FT_END_STMNT } while ( 0 ) +#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT + + + /*************************************************************************/ + /* */ + /* A 64-bit data type will create compilation problems if you compile */ + /* in strict ANSI mode. To avoid them, we disable their use if */ + /* __STDC__ is defined. You can however ignore this rule by */ + /* defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */ + /* */ +#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 ) + +#ifdef __STDC__ + + /* Undefine the 64-bit macros in strict ANSI compilation mode. */ + /* Since `#undef' doesn't survive in configuration header files */ + /* we use the postprocessing facility of AC_CONFIG_HEADERS to */ + /* replace the leading `/' with `#'. */ +#undef FT_LONG64 +#undef FT_INT64 + +#endif /* __STDC__ */ + +#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */ + + +#ifdef FT_MAKE_OPTION_SINGLE_OBJECT + +#define FT_LOCAL( x ) static x +#define FT_LOCAL_DEF( x ) static x + +#else + +#ifdef __cplusplus +#define FT_LOCAL( x ) extern "C" x +#define FT_LOCAL_DEF( x ) extern "C" x +#else +#define FT_LOCAL( x ) extern x +#define FT_LOCAL_DEF( x ) x +#endif + +#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */ + + +#ifndef FT_BASE + +#ifdef __cplusplus +#define FT_BASE( x ) extern "C" x +#else +#define FT_BASE( x ) extern x +#endif + +#endif /* !FT_BASE */ + + +#ifndef FT_BASE_DEF + +#ifdef __cplusplus +#define FT_BASE_DEF( x ) x +#else +#define FT_BASE_DEF( x ) x +#endif + +#endif /* !FT_BASE_DEF */ + + +#ifndef FT_EXPORT + +#ifdef __cplusplus +#define FT_EXPORT( x ) extern "C" x +#else +#define FT_EXPORT( x ) extern x +#endif + +#endif /* !FT_EXPORT */ + + +#ifndef FT_EXPORT_DEF + +#ifdef __cplusplus +#define FT_EXPORT_DEF( x ) extern "C" x +#else +#define FT_EXPORT_DEF( x ) extern x +#endif + +#endif /* !FT_EXPORT_DEF */ + + +#ifndef FT_EXPORT_VAR + +#ifdef __cplusplus +#define FT_EXPORT_VAR( x ) extern "C" x +#else +#define FT_EXPORT_VAR( x ) extern x +#endif + +#endif /* !FT_EXPORT_VAR */ + + /* The following macros are needed to compile the library with a */ + /* C++ compiler and with 16bit compilers. */ + /* */ + + /* This is special. Within C++, you must specify `extern "C"' for */ + /* functions which are used via function pointers, and you also */ + /* must do that for structures which contain function pointers to */ + /* assure C linkage -- it's not possible to have (local) anonymous */ + /* functions which are accessed by (global) function pointers. */ + /* */ + /* */ + /* FT_CALLBACK_DEF is used to _define_ a callback function. */ + /* */ + /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */ + /* contains pointers to callback functions. */ + /* */ + /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */ + /* that contains pointers to callback functions. */ + /* */ + /* */ + /* Some 16bit compilers have to redefine these macros to insert */ + /* the infamous `_cdecl' or `__fastcall' declarations. */ + /* */ +#ifndef FT_CALLBACK_DEF +#ifdef __cplusplus +#define FT_CALLBACK_DEF( x ) extern "C" x +#else +#define FT_CALLBACK_DEF( x ) static x +#endif +#endif /* FT_CALLBACK_DEF */ + +#ifndef FT_CALLBACK_TABLE +#ifdef __cplusplus +#define FT_CALLBACK_TABLE extern "C" +#define FT_CALLBACK_TABLE_DEF extern "C" +#else +#define FT_CALLBACK_TABLE extern +#define FT_CALLBACK_TABLE_DEF /* nothing */ +#endif +#endif /* FT_CALLBACK_TABLE */ + + +FT_END_HEADER + + +#endif /* __FTCONFIG_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/config/ftheader.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/config/ftheader.h new file mode 100644 index 0000000000..b957d05bed --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/config/ftheader.h @@ -0,0 +1,729 @@ +/***************************************************************************/ +/* */ +/* ftheader.h */ +/* */ +/* Build macros of the FreeType 2 library. */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +#ifndef __FT_HEADER_H__ +#define __FT_HEADER_H__ + + + /*@***********************************************************************/ + /* */ + /* */ + /* FT_BEGIN_HEADER */ + /* */ + /* */ + /* This macro is used in association with @FT_END_HEADER in header */ + /* files to ensure that the declarations within are properly */ + /* encapsulated in an `extern "C" { .. }' block when included from a */ + /* C++ compiler. */ + /* */ +#ifdef __cplusplus +#define FT_BEGIN_HEADER extern "C" { +#else +#define FT_BEGIN_HEADER /* nothing */ +#endif + + + /*@***********************************************************************/ + /* */ + /* */ + /* FT_END_HEADER */ + /* */ + /* */ + /* This macro is used in association with @FT_BEGIN_HEADER in header */ + /* files to ensure that the declarations within are properly */ + /* encapsulated in an `extern "C" { .. }' block when included from a */ + /* C++ compiler. */ + /* */ +#ifdef __cplusplus +#define FT_END_HEADER } +#else +#define FT_END_HEADER /* nothing */ +#endif + + + /*************************************************************************/ + /* */ + /* Aliases for the FreeType 2 public and configuration files. */ + /* */ + /*************************************************************************/ + + /*************************************************************************/ + /* */ + /*
*/ + /* header_file_macros */ + /* */ + /* */ + /* Header File Macros */ + /* */ + /* <Abstract> */ + /* Macro definitions used to #include specific header files. */ + /* */ + /* <Description> */ + /* The following macros are defined to the name of specific */ + /* FreeType 2 header files. They can be used directly in #include */ + /* statements as in: */ + /* */ + /* { */ + /* #include FT_FREETYPE_H */ + /* #include FT_MULTIPLE_MASTERS_H */ + /* #include FT_GLYPH_H */ + /* } */ + /* */ + /* There are several reasons why we are now using macros to name */ + /* public header files. The first one is that such macros are not */ + /* limited to the infamous 8.3 naming rule required by DOS (and */ + /* `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h'). */ + /* */ + /* The second reason is that it allows for more flexibility in the */ + /* way FreeType 2 is installed on a given system. */ + /* */ + /*************************************************************************/ + + + /* configuration files */ + + /************************************************************************* + * + * @macro: + * FT_CONFIG_CONFIG_H + * + * @description: + * A macro used in #include statements to name the file containing + * FreeType 2 configuration data. + * + */ +#ifndef FT_CONFIG_CONFIG_H +#define FT_CONFIG_CONFIG_H <freetype/config/ftconfig.h> +#endif + + + /************************************************************************* + * + * @macro: + * FT_CONFIG_STANDARD_LIBRARY_H + * + * @description: + * A macro used in #include statements to name the file containing + * FreeType 2 interface to the standard C library functions. + * + */ +#ifndef FT_CONFIG_STANDARD_LIBRARY_H +#define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.h> +#endif + + + /************************************************************************* + * + * @macro: + * FT_CONFIG_OPTIONS_H + * + * @description: + * A macro used in #include statements to name the file containing + * FreeType 2 project-specific configuration options. + * + */ +#ifndef FT_CONFIG_OPTIONS_H +#define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h> +#endif + + + /************************************************************************* + * + * @macro: + * FT_CONFIG_MODULES_H + * + * @description: + * A macro used in #include statements to name the file containing the + * list of FreeType 2 modules that are statically linked to new library + * instances in @FT_Init_FreeType. + * + */ +#ifndef FT_CONFIG_MODULES_H +#define FT_CONFIG_MODULES_H <freetype/config/ftmodule.h> +#endif + + + /* public headers */ + + /************************************************************************* + * + * @macro: + * FT_FREETYPE_H + * + * @description: + * A macro used in #include statements to name the file containing the + * base FreeType 2 API. + * + */ +#define FT_FREETYPE_H <freetype/freetype.h> + + + /************************************************************************* + * + * @macro: + * FT_ERRORS_H + * + * @description: + * A macro used in #include statements to name the file containing the + * list of FreeType 2 error codes (and messages). + * + * It is included by @FT_FREETYPE_H. + * + */ +#define FT_ERRORS_H <freetype/fterrors.h> + + + /************************************************************************* + * + * @macro: + * FT_MODULE_ERRORS_H + * + * @description: + * A macro used in #include statements to name the file containing the + * list of FreeType 2 module error offsets (and messages). + * + */ +#define FT_MODULE_ERRORS_H <freetype/ftmoderr.h> + + + /************************************************************************* + * + * @macro: + * FT_SYSTEM_H + * + * @description: + * A macro used in #include statements to name the file containing the + * FreeType 2 interface to low-level operations (i.e., memory management + * and stream i/o). + * + * It is included by @FT_FREETYPE_H. + * + */ +#define FT_SYSTEM_H <freetype/ftsystem.h> + + + /************************************************************************* + * + * @macro: + * FT_IMAGE_H + * + * @description: + * A macro used in #include statements to name the file containing type + * definitions related to glyph images (i.e., bitmaps, outlines, + * scan-converter parameters). + * + * It is included by @FT_FREETYPE_H. + * + */ +#define FT_IMAGE_H <freetype/ftimage.h> + + + /************************************************************************* + * + * @macro: + * FT_TYPES_H + * + * @description: + * A macro used in #include statements to name the file containing the + * basic data types defined by FreeType 2. + * + * It is included by @FT_FREETYPE_H. + * + */ +#define FT_TYPES_H <freetype/fttypes.h> + + + /************************************************************************* + * + * @macro: + * FT_LIST_H + * + * @description: + * A macro used in #include statements to name the file containing the + * list management API of FreeType 2. + * + * (Most applications will never need to include this file.) + * + */ +#define FT_LIST_H <freetype/ftlist.h> + + + /************************************************************************* + * + * @macro: + * FT_OUTLINE_H + * + * @description: + * A macro used in #include statements to name the file containing the + * scalable outline management API of FreeType 2. + * + */ +#define FT_OUTLINE_H <freetype/ftoutln.h> + + + /************************************************************************* + * + * @macro: + * FT_SIZES_H + * + * @description: + * A macro used in #include statements to name the file containing the + * API which manages multiple @FT_Size objects per face. + * + */ +#define FT_SIZES_H <freetype/ftsizes.h> + + + /************************************************************************* + * + * @macro: + * FT_MODULE_H + * + * @description: + * A macro used in #include statements to name the file containing the + * module management API of FreeType 2. + * + */ +#define FT_MODULE_H <freetype/ftmodapi.h> + + + /************************************************************************* + * + * @macro: + * FT_RENDER_H + * + * @description: + * A macro used in #include statements to name the file containing the + * renderer module management API of FreeType 2. + * + */ +#define FT_RENDER_H <freetype/ftrender.h> + + + /************************************************************************* + * + * @macro: + * FT_TYPE1_TABLES_H + * + * @description: + * A macro used in #include statements to name the file containing the + * types and API specific to the Type 1 format. + * + */ +#define FT_TYPE1_TABLES_H <freetype/t1tables.h> + + + /************************************************************************* + * + * @macro: + * FT_TRUETYPE_IDS_H + * + * @description: + * A macro used in #include statements to name the file containing the + * enumeration values which identify name strings, languages, encodings, + * etc. This file really contains a _large_ set of constant macro + * definitions, taken from the TrueType and OpenType specifications. + * + */ +#define FT_TRUETYPE_IDS_H <freetype/ttnameid.h> + + + /************************************************************************* + * + * @macro: + * FT_TRUETYPE_TABLES_H + * + * @description: + * A macro used in #include statements to name the file containing the + * types and API specific to the TrueType (as well as OpenType) format. + * + */ +#define FT_TRUETYPE_TABLES_H <freetype/tttables.h> + + + /************************************************************************* + * + * @macro: + * FT_TRUETYPE_TAGS_H + * + * @description: + * A macro used in #include statements to name the file containing the + * definitions of TrueType four-byte `tags' which identify blocks in + * SFNT-based font formats (i.e., TrueType and OpenType). + * + */ +#define FT_TRUETYPE_TAGS_H <freetype/tttags.h> + + + /************************************************************************* + * + * @macro: + * FT_BDF_H + * + * @description: + * A macro used in #include statements to name the file containing the + * definitions of an API which accesses BDF-specific strings from a + * face. + * + */ +#define FT_BDF_H <freetype/ftbdf.h> + + + /************************************************************************* + * + * @macro: + * FT_GZIP_H + * + * @description: + * A macro used in #include statements to name the file containing the + * definitions of an API which supports gzip-compressed files. + * + */ +#define FT_GZIP_H <freetype/ftgzip.h> + + + /************************************************************************* + * + * @macro: + * FT_LZW_H + * + * @description: + * A macro used in #include statements to name the file containing the + * definitions of an API which supports LZW-compressed files. + * + */ +#define FT_LZW_H <freetype/ftlzw.h> + + + /************************************************************************* + * + * @macro: + * FT_WINFONTS_H + * + * @description: + * A macro used in #include statements to name the file containing the + * definitions of an API which supports Windows FNT files. + * + */ +#define FT_WINFONTS_H <freetype/ftwinfnt.h> + + + /************************************************************************* + * + * @macro: + * FT_GLYPH_H + * + * @description: + * A macro used in #include statements to name the file containing the + * API of the optional glyph management component. + * + */ +#define FT_GLYPH_H <freetype/ftglyph.h> + + + /************************************************************************* + * + * @macro: + * FT_BITMAP_H + * + * @description: + * A macro used in #include statements to name the file containing the + * API of the optional bitmap conversion component. + * + */ +#define FT_BITMAP_H <freetype/ftbitmap.h> + + + /************************************************************************* + * + * @macro: + * FT_BBOX_H + * + * @description: + * A macro used in #include statements to name the file containing the + * API of the optional exact bounding box computation routines. + * + */ +#define FT_BBOX_H <freetype/ftbbox.h> + + + /************************************************************************* + * + * @macro: + * FT_CACHE_H + * + * @description: + * A macro used in #include statements to name the file containing the + * API of the optional FreeType 2 cache sub-system. + * + */ +#define FT_CACHE_H <freetype/ftcache.h> + + + /************************************************************************* + * + * @macro: + * FT_CACHE_IMAGE_H + * + * @description: + * A macro used in #include statements to name the file containing the + * `glyph image' API of the FreeType 2 cache sub-system. + * + * It is used to define a cache for @FT_Glyph elements. You can also + * use the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to + * store small glyph bitmaps, as it will use less memory. + * + * This macro is deprecated. Simply include @FT_CACHE_H to have all + * glyph image-related cache declarations. + * + */ +#define FT_CACHE_IMAGE_H FT_CACHE_H + + + /************************************************************************* + * + * @macro: + * FT_CACHE_SMALL_BITMAPS_H + * + * @description: + * A macro used in #include statements to name the file containing the + * `small bitmaps' API of the FreeType 2 cache sub-system. + * + * It is used to define a cache for small glyph bitmaps in a relatively + * memory-efficient way. You can also use the API defined in + * @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images, + * including scalable outlines. + * + * This macro is deprecated. Simply include @FT_CACHE_H to have all + * small bitmaps-related cache declarations. + * + */ +#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H + + + /************************************************************************* + * + * @macro: + * FT_CACHE_CHARMAP_H + * + * @description: + * A macro used in #include statements to name the file containing the + * `charmap' API of the FreeType 2 cache sub-system. + * + * This macro is deprecated. Simply include @FT_CACHE_H to have all + * charmap-based cache declarations. + * + */ +#define FT_CACHE_CHARMAP_H FT_CACHE_H + + + /************************************************************************* + * + * @macro: + * FT_MAC_H + * + * @description: + * A macro used in #include statements to name the file containing the + * Macintosh-specific FreeType 2 API. The latter is used to access + * fonts embedded in resource forks. + * + * This header file must be explicitly included by client applications + * compiled on the Mac (note that the base API still works though). + * + */ +#define FT_MAC_H <freetype/ftmac.h> + + + /************************************************************************* + * + * @macro: + * FT_MULTIPLE_MASTERS_H + * + * @description: + * A macro used in #include statements to name the file containing the + * optional multiple-masters management API of FreeType 2. + * + */ +#define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h> + + + /************************************************************************* + * + * @macro: + * FT_SFNT_NAMES_H + * + * @description: + * A macro used in #include statements to name the file containing the + * optional FreeType 2 API which accesses embedded `name' strings in + * SFNT-based font formats (i.e., TrueType and OpenType). + * + */ +#define FT_SFNT_NAMES_H <freetype/ftsnames.h> + + + /************************************************************************* + * + * @macro: + * FT_OPENTYPE_VALIDATE_H + * + * @description: + * A macro used in #include statements to name the file containing the + * optional FreeType 2 API which validates OpenType tables (BASE, GDEF, + * GPOS, GSUB, JSTF). + * + */ +#define FT_OPENTYPE_VALIDATE_H <freetype/ftotval.h> + + + /************************************************************************* + * + * @macro: + * FT_GX_VALIDATE_H + * + * @description: + * A macro used in #include statements to name the file containing the + * optional FreeType 2 API which validates TrueTypeGX/AAT tables (feat, + * mort, morx, bsln, just, kern, opbd, trak, prop). + * + */ +#define FT_GX_VALIDATE_H <freetype/ftgxval.h> + + + /************************************************************************* + * + * @macro: + * FT_PFR_H + * + * @description: + * A macro used in #include statements to name the file containing the + * FreeType 2 API which accesses PFR-specific data. + * + */ +#define FT_PFR_H <freetype/ftpfr.h> + + + /************************************************************************* + * + * @macro: + * FT_STROKER_H + * + * @description: + * A macro used in #include statements to name the file containing the + * FreeType 2 API which provides functions to stroke outline paths. + */ +#define FT_STROKER_H <freetype/ftstroke.h> + + + /************************************************************************* + * + * @macro: + * FT_SYNTHESIS_H + * + * @description: + * A macro used in #include statements to name the file containing the + * FreeType 2 API which performs artificial obliquing and emboldening. + */ +#define FT_SYNTHESIS_H <freetype/ftsynth.h> + + + /************************************************************************* + * + * @macro: + * FT_XFREE86_H + * + * @description: + * A macro used in #include statements to name the file containing the + * FreeType 2 API which provides functions specific to the XFree86 and + * X.Org X11 servers. + */ +#define FT_XFREE86_H <freetype/ftxf86.h> + + + /************************************************************************* + * + * @macro: + * FT_TRIGONOMETRY_H + * + * @description: + * A macro used in #include statements to name the file containing the + * FreeType 2 API which performs trigonometric computations (e.g., + * cosines and arc tangents). + */ +#define FT_TRIGONOMETRY_H <freetype/fttrigon.h> + + + /************************************************************************* + * + * @macro: + * FT_LCD_FILTER_H + * + * @description: + * A macro used in #include statements to name the file containing the + * FreeType 2 API which performs color filtering for subpixel rendering. + */ +#define FT_LCD_FILTER_H <freetype/ftlcdfil.h> + + + /************************************************************************* + * + * @macro: + * FT_GASP_H + * + * @description: + * A macro used in #include statements to name the file containing the + * FreeType 2 API which returns entries from the TrueType GASP table. + */ +#define FT_GASP_H <freetype/ftgasp.h> + + + /* */ + +#define FT_ERROR_DEFINITIONS_H <freetype/fterrdef.h> + + + /* The internals of the cache sub-system are no longer exposed. We */ + /* default to FT_CACHE_H at the moment just in case, but we know of */ + /* no rogue client that uses them. */ + /* */ +#define FT_CACHE_MANAGER_H <freetype/ftcache.h> +#define FT_CACHE_INTERNAL_MRU_H <freetype/ftcache.h> +#define FT_CACHE_INTERNAL_MANAGER_H <freetype/ftcache.h> +#define FT_CACHE_INTERNAL_CACHE_H <freetype/ftcache.h> +#define FT_CACHE_INTERNAL_GLYPH_H <freetype/ftcache.h> +#define FT_CACHE_INTERNAL_IMAGE_H <freetype/ftcache.h> +#define FT_CACHE_INTERNAL_SBITS_H <freetype/ftcache.h> + + +#define FT_INCREMENTAL_H <freetype/ftincrem.h> + +#define FT_TRUETYPE_UNPATENTED_H <freetype/ttunpat.h> + + + /* + * Include internal headers definitions from <freetype/internal/...> + * only when building the library. + */ +#ifdef FT2_BUILD_LIBRARY +#define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h> +#include FT_INTERNAL_INTERNAL_H +#endif /* FT2_BUILD_LIBRARY */ + + +#endif /* __FT2_BUILD_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/config/ftmodule.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/config/ftmodule.h new file mode 100644 index 0000000000..c28052b7f3 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/config/ftmodule.h @@ -0,0 +1,22 @@ +/* This is a generated file. */ +FT_USE_MODULE(tt_driver_class) +FT_USE_MODULE(t1_driver_class) +FT_USE_MODULE(cff_driver_class) +FT_USE_MODULE(t1cid_driver_class) +FT_USE_MODULE(pfr_driver_class) +FT_USE_MODULE(t42_driver_class) +FT_USE_MODULE(winfnt_driver_class) +FT_USE_MODULE(pcf_driver_class) +FT_USE_MODULE(bdf_driver_class) +FT_USE_MODULE(sfnt_module_class) +FT_USE_MODULE(autofit_module_class) +FT_USE_MODULE(pshinter_module_class) +FT_USE_MODULE(ft_raster1_renderer_class) +FT_USE_MODULE(ft_smooth_renderer_class) +FT_USE_MODULE(ft_smooth_lcd_renderer_class) +FT_USE_MODULE(ft_smooth_lcdv_renderer_class) +FT_USE_MODULE(gxv_module_class) +FT_USE_MODULE(otv_module_class) +FT_USE_MODULE(psaux_module_class) +FT_USE_MODULE(psnames_module_class) +/* EOF */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/config/ftoption.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/config/ftoption.h new file mode 100644 index 0000000000..0b5c66d406 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/config/ftoption.h @@ -0,0 +1,695 @@ +/***************************************************************************/ +/* */ +/* ftoption.h */ +/* */ +/* User-selectable configuration macros (specification only). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTOPTION_H__ +#define __FTOPTION_H__ + + +#include <ft2build.h> + + +FT_BEGIN_HEADER + + /*************************************************************************/ + /* */ + /* USER-SELECTABLE CONFIGURATION MACROS */ + /* */ + /* This file contains the default configuration macro definitions for */ + /* a standard build of the FreeType library. There are three ways to */ + /* use this file to build project-specific versions of the library: */ + /* */ + /* - You can modify this file by hand, but this is not recommended in */ + /* cases where you would like to build several versions of the */ + /* library from a single source directory. */ + /* */ + /* - You can put a copy of this file in your build directory, more */ + /* precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD' */ + /* is the name of a directory that is included _before_ the FreeType */ + /* include path during compilation. */ + /* */ + /* The default FreeType Makefiles and Jamfiles use the build */ + /* directory `builds/<system>' by default, but you can easily change */ + /* that for your own projects. */ + /* */ + /* - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it */ + /* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */ + /* locate this file during the build. For example, */ + /* */ + /* #define FT_CONFIG_OPTIONS_H <myftoptions.h> */ + /* #include <freetype/config/ftheader.h> */ + /* */ + /* will use `$BUILD/myftoptions.h' instead of this file for macro */ + /* definitions. */ + /* */ + /* Note also that you can similarly pre-define the macro */ + /* FT_CONFIG_MODULES_H used to locate the file listing of the modules */ + /* that are statically linked to the library at compile time. By */ + /* default, this file is <freetype/config/ftmodule.h>. */ + /* */ + /* We highly recommend using the third method whenever possible. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* Uncomment the line below if you want to activate sub-pixel rendering */ + /* (a.k.a. LCD rendering, or ClearType) in this build of the library. */ + /* */ + /* Note that this feature is covered by several Microsoft patents */ + /* and should not be activated in any default build of the library. */ + /* */ + /* This macro has no impact on the FreeType API, only on its */ + /* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */ + /* FT_Render_Glyph still generates a bitmap that is 3 times larger than */ + /* the original size; the difference will be that each triplet of */ + /* subpixels has R=G=B. */ + /* */ + /* This is done to allow FreeType clients to run unmodified, forcing */ + /* them to display normal gray-level anti-aliased glyphs. */ + /* */ +#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING + + + /*************************************************************************/ + /* */ + /* Many compilers provide a non-ANSI 64-bit data type that can be used */ + /* by FreeType to speed up some computations. However, this will create */ + /* some problems when compiling the library in strict ANSI mode. */ + /* */ + /* For this reason, the use of 64-bit integers is normally disabled when */ + /* the __STDC__ macro is defined. You can however disable this by */ + /* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here. */ + /* */ + /* For most compilers, this will only create compilation warnings when */ + /* building the library. */ + /* */ + /* ObNote: The compiler-specific 64-bit integers are detected in the */ + /* file `ftconfig.h' either statically or through the */ + /* `configure' script on supported platforms. */ + /* */ +#undef FT_CONFIG_OPTION_FORCE_INT64 + + + /*************************************************************************/ + /* */ + /* LZW-compressed file support. */ + /* */ + /* FreeType now handles font files that have been compressed with the */ + /* `compress' program. This is mostly used to parse many of the PCF */ + /* files that come with various X11 distributions. The implementation */ + /* uses NetBSD's `zopen' to partially uncompress the file on the fly */ + /* (see src/lzw/ftgzip.c). */ + /* */ + /* Define this macro if you want to enable this `feature'. */ + /* */ +#define FT_CONFIG_OPTION_USE_LZW + + + /*************************************************************************/ + /* */ + /* Gzip-compressed file support. */ + /* */ + /* FreeType now handles font files that have been compressed with the */ + /* `gzip' program. This is mostly used to parse many of the PCF files */ + /* that come with XFree86. The implementation uses `zlib' to */ + /* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */ + /* */ + /* Define this macro if you want to enable this `feature'. See also */ + /* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */ + /* */ +#define FT_CONFIG_OPTION_USE_ZLIB + + + /*************************************************************************/ + /* */ + /* ZLib library selection */ + /* */ + /* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */ + /* It allows FreeType's `ftgzip' component to link to the system's */ + /* installation of the ZLib library. This is useful on systems like */ + /* Unix or VMS where it generally is already available. */ + /* */ + /* If you let it undefined, the component will use its own copy */ + /* of the zlib sources instead. These have been modified to be */ + /* included directly within the component and *not* export external */ + /* function names. This allows you to link any program with FreeType */ + /* _and_ ZLib without linking conflicts. */ + /* */ + /* Do not #undef this macro here since the build system might define */ + /* it for certain configurations only. */ + /* */ +/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */ + + + /*************************************************************************/ + /* */ + /* DLL export compilation */ + /* */ + /* When compiling FreeType as a DLL, some systems/compilers need a */ + /* special keyword in front OR after the return type of function */ + /* declarations. */ + /* */ + /* Two macros are used within the FreeType source code to define */ + /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */ + /* */ + /* FT_EXPORT( return_type ) */ + /* */ + /* is used in a function declaration, as in */ + /* */ + /* FT_EXPORT( FT_Error ) */ + /* FT_Init_FreeType( FT_Library* alibrary ); */ + /* */ + /* */ + /* FT_EXPORT_DEF( return_type ) */ + /* */ + /* is used in a function definition, as in */ + /* */ + /* FT_EXPORT_DEF( FT_Error ) */ + /* FT_Init_FreeType( FT_Library* alibrary ) */ + /* { */ + /* ... some code ... */ + /* return FT_Err_Ok; */ + /* } */ + /* */ + /* You can provide your own implementation of FT_EXPORT and */ + /* FT_EXPORT_DEF here if you want. If you leave them undefined, they */ + /* will be later automatically defined as `extern return_type' to */ + /* allow normal compilation. */ + /* */ + /* Do not #undef these macros here since the build system might define */ + /* them for certain configurations only. */ + /* */ +/* #define FT_EXPORT(x) extern x */ +/* #define FT_EXPORT_DEF(x) x */ +#ifndef __GNUC__ +# define __DLL_IMPORT__ __declspec(dllimport) +# define __DLL_EXPORT__ __declspec(dllexport) +#else +# define __DLL_IMPORT__ __attribute__((dllimport)) extern +# define __DLL_EXPORT__ __attribute__((dllexport)) extern +#endif + +#if (defined __WIN32__) || (defined _WIN32) +# ifdef BUILD_FREETYPE2_DLL +# define FREETYPE2_DLL_IMPEXP __DLL_EXPORT__ +# elif defined(FREETYPE2_STATIC) +# define FREETYPE2_DLL_IMPEXP +# elif defined (USE_FREETYPE2_DLL) +# define FREETYPE2_DLL_IMPEXP __DLL_IMPORT__ +# elif defined (USE_FREETYPE2_STATIC) +# define FREETYPE2_DLL_IMPEXP +# else /* assume USE_FREETYPE2_DLL */ +# define FREETYPE2_DLL_IMPEXP __DLL_IMPORT__ +# endif +#else /* __WIN32__ */ +# define FREETYPE2_DLL_IMPEXP +#endif + +#define FT_EXPORT(x) FREETYPE2_DLL_IMPEXP x +#define FT_BASE(x) FREETYPE2_DLL_IMPEXP x + + + /*************************************************************************/ + /* */ + /* Glyph Postscript Names handling */ + /* */ + /* By default, FreeType 2 is compiled with the `PSNames' module. This */ + /* module is in charge of converting a glyph name string into a */ + /* Unicode value, or return a Macintosh standard glyph name for the */ + /* use with the TrueType `post' table. */ + /* */ + /* Undefine this macro if you do not want `PSNames' compiled in your */ + /* build of FreeType. This has the following effects: */ + /* */ + /* - The TrueType driver will provide its own set of glyph names, */ + /* if you build it to support postscript names in the TrueType */ + /* `post' table. */ + /* */ + /* - The Type 1 driver will not be able to synthetize a Unicode */ + /* charmap out of the glyphs found in the fonts. */ + /* */ + /* You would normally undefine this configuration macro when building */ + /* a version of FreeType that doesn't contain a Type 1 or CFF driver. */ + /* */ +#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES + + + /*************************************************************************/ + /* */ + /* Postscript Names to Unicode Values support */ + /* */ + /* By default, FreeType 2 is built with the `PSNames' module compiled */ + /* in. Among other things, the module is used to convert a glyph name */ + /* into a Unicode value. This is especially useful in order to */ + /* synthetize on the fly a Unicode charmap from the CFF/Type 1 driver */ + /* through a big table named the `Adobe Glyph List' (AGL). */ + /* */ + /* Undefine this macro if you do not want the Adobe Glyph List */ + /* compiled in your `PSNames' module. The Type 1 driver will not be */ + /* able to synthetize a Unicode charmap out of the glyphs found in the */ + /* fonts. */ + /* */ +#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST + + + /*************************************************************************/ + /* */ + /* Support for Mac fonts */ + /* */ + /* Define this macro if you want support for outline fonts in Mac */ + /* format (mac dfont, mac resource, macbinary containing a mac */ + /* resource) on non-Mac platforms. */ + /* */ + /* Note that the `FOND' resource isn't checked. */ + /* */ +#define FT_CONFIG_OPTION_MAC_FONTS + + + /*************************************************************************/ + /* */ + /* Guessing methods to access embedded resource forks */ + /* */ + /* Enable extra Mac fonts support on non-Mac platforms (e.g. */ + /* GNU/Linux). */ + /* */ + /* Resource forks which include fonts data are stored sometimes in */ + /* locations which users or developers don't expected. In some cases, */ + /* resource forks start with some offset from the head of a file. In */ + /* other cases, the actual resource fork is stored in file different */ + /* from what the user specifies. If this option is activated, */ + /* FreeType tries to guess whether such offsets or different file */ + /* names must be used. */ + /* */ + /* Note that normal, direct access of resource forks is controlled via */ + /* the FT_CONFIG_OPTION_MAC_FONTS option. */ + /* */ +#ifdef FT_CONFIG_OPTION_MAC_FONTS +#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK +#endif + + + /*************************************************************************/ + /* */ + /* Allow the use of FT_Incremental_Interface to load typefaces that */ + /* contain no glyph data, but supply it via a callback function. */ + /* This allows FreeType to be used with the PostScript language, using */ + /* the GhostScript interpreter. */ + /* */ +/* #define FT_CONFIG_OPTION_INCREMENTAL */ + + + /*************************************************************************/ + /* */ + /* The size in bytes of the render pool used by the scan-line converter */ + /* to do all of its work. */ + /* */ + /* This must be greater than 4KByte if you use FreeType to rasterize */ + /* glyphs; otherwise, you may set it to zero to avoid unnecessary */ + /* allocation of the render pool. */ + /* */ +#define FT_RENDER_POOL_SIZE 16384L + + + /*************************************************************************/ + /* */ + /* FT_MAX_MODULES */ + /* */ + /* The maximum number of modules that can be registered in a single */ + /* FreeType library object. 32 is the default. */ + /* */ +#define FT_MAX_MODULES 32 + + + /*************************************************************************/ + /* */ + /* Debug level */ + /* */ + /* FreeType can be compiled in debug or trace mode. In debug mode, */ + /* errors are reported through the `ftdebug' component. In trace */ + /* mode, additional messages are sent to the standard output during */ + /* execution. */ + /* */ + /* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */ + /* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */ + /* */ + /* Don't define any of these macros to compile in `release' mode! */ + /* */ + /* Do not #undef these macros here since the build system might define */ + /* them for certain configurations only. */ + /* */ +/* #define FT_DEBUG_LEVEL_ERROR */ +/* #define FT_DEBUG_LEVEL_TRACE */ + + + /*************************************************************************/ + /* */ + /* Memory Debugging */ + /* */ + /* FreeType now comes with an integrated memory debugger that is */ + /* capable of detecting simple errors like memory leaks or double */ + /* deletes. To compile it within your build of the library, you */ + /* should define FT_DEBUG_MEMORY here. */ + /* */ + /* Note that the memory debugger is only activated at runtime when */ + /* when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */ + /* */ + /* Do not #undef this macro here since the build system might define */ + /* it for certain configurations only. */ + /* */ +/* #define FT_DEBUG_MEMORY */ + + + /*************************************************************************/ + /* */ + /* Module errors */ + /* */ + /* If this macro is set (which is _not_ the default), the higher byte */ + /* of an error code gives the module in which the error has occurred, */ + /* while the lower byte is the real error code. */ + /* */ + /* Setting this macro makes sense for debugging purposes only, since */ + /* it would break source compatibility of certain programs that use */ + /* FreeType 2. */ + /* */ + /* More details can be found in the files ftmoderr.h and fterrors.h. */ + /* */ +#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS + + + + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** S F N T D R I V E R C O N F I G U R A T I O N ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */ + /* embedded bitmaps in all formats using the SFNT module (namely */ + /* TrueType & OpenType). */ + /* */ +#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS + + + /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */ + /* load and enumerate the glyph Postscript names in a TrueType or */ + /* OpenType file. */ + /* */ + /* Note that when you do not compile the `PSNames' module by undefining */ + /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */ + /* contain additional code used to read the PS Names table from a font. */ + /* */ + /* (By default, the module uses `PSNames' to extract glyph names.) */ + /* */ +#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES + + + /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */ + /* access the internal name table in a SFNT-based format like TrueType */ + /* or OpenType. The name table contains various strings used to */ + /* describe the font, like family name, copyright, version, etc. It */ + /* does not contain any glyph name though. */ + /* */ + /* Accessing SFNT names is done through the functions declared in */ + /* `freetype/ftnames.h'. */ + /* */ +#define TT_CONFIG_OPTION_SFNT_NAMES + + + /*************************************************************************/ + /* */ + /* TrueType CMap support */ + /* */ + /* Here you can fine-tune which TrueType CMap table format shall be */ + /* supported. */ +#define TT_CONFIG_CMAP_FORMAT_0 +#define TT_CONFIG_CMAP_FORMAT_2 +#define TT_CONFIG_CMAP_FORMAT_4 +#define TT_CONFIG_CMAP_FORMAT_6 +#define TT_CONFIG_CMAP_FORMAT_8 +#define TT_CONFIG_CMAP_FORMAT_10 +#define TT_CONFIG_CMAP_FORMAT_12 + + + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + + /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */ + /* a bytecode interpreter in the TrueType driver. Note that there are */ + /* important patent issues related to the use of the interpreter. */ + /* */ + /* By undefining this, you will only compile the code necessary to load */ + /* TrueType glyphs without hinting. */ + /* */ + /* Do not #undef this macro here, since the build system might */ + /* define it for certain configurations only. */ + /* */ +/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ + + + /*************************************************************************/ + /* */ + /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */ + /* of the TrueType bytecode interpreter is used that doesn't implement */ + /* any of the patented opcodes and algorithms. Note that the */ + /* the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* if you */ + /* define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; with other words, */ + /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */ + /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */ + /* */ + /* This macro is only useful for a small number of font files (mostly */ + /* for Asian scripts) that require bytecode interpretation to properly */ + /* load glyphs. For all other fonts, this produces unpleasant results, */ + /* thus the unpatented interpreter is never used to load glyphs from */ + /* TrueType fonts unless one of the following two options is used. */ + /* */ + /* - The unpatented interpreter is explicitly activated by the user */ + /* through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */ + /* when opening the FT_Face. */ + /* */ + /* - FreeType detects that the FT_Face corresponds to one of the */ + /* `trick' fonts (e.g., `Mingliu') it knows about. The font engine */ + /* contains a hard-coded list of font names and other matching */ + /* parameters (see function `tt_face_init' in file */ + /* `src/truetype/ttobjs.c'). */ + /* */ + /* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */ + /* */ + /* { */ + /* FT_Parameter parameter; */ + /* FT_Open_Args open_args; */ + /* */ + /* */ + /* parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING; */ + /* */ + /* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; */ + /* open_args.pathname = my_font_pathname; */ + /* open_args.num_params = 1; */ + /* open_args.params = ¶meter; */ + /* */ + /* error = FT_Open_Face( library, &open_args, index, &face ); */ + /* ... */ + /* } */ + /* */ +#define TT_CONFIG_OPTION_UNPATENTED_HINTING + + + /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */ + /* bytecode interpreter with a huge switch statement, rather than a call */ + /* table. This results in smaller and faster code for a number of */ + /* architectures. */ + /* */ + /* Note however that on some compiler/processor combinations, undefining */ + /* this macro will generate faster, though larger, code. */ + /* */ +#define TT_CONFIG_OPTION_INTERPRETER_SWITCH + + + /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */ + /* TrueType glyph loader to use Apple's definition of how to handle */ + /* component offsets in composite glyphs. */ + /* */ + /* Apple and MS disagree on the default behavior of component offsets */ + /* in composites. Apple says that they should be scaled by the scaling */ + /* factors in the transformation matrix (roughly, it's more complex) */ + /* while MS says they should not. OpenType defines two bits in the */ + /* composite flags array which can be used to disambiguate, but old */ + /* fonts will not have them. */ + /* */ + /* http://partners.adobe.com/asn/developer/opentype/glyf.html */ + /* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */ + /* */ +#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED + + + /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include */ + /* support for Apple's distortable font technology (fvar, gvar, cvar, */ + /* and avar tables). This has many similarities to Type 1 Multiple */ + /* Masters support. */ + /* */ +#define TT_CONFIG_OPTION_GX_VAR_SUPPORT + + + /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_BDF if you want to include support for */ + /* an embedded `BDF ' table within SFNT-based bitmap formats. */ + /* */ +#define TT_CONFIG_OPTION_BDF + + + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* T1_MAX_DICT_DEPTH is the maximal depth of nest dictionaries and */ + /* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */ + /* required. */ + /* */ +#define T1_MAX_DICT_DEPTH 5 + + + /*************************************************************************/ + /* */ + /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */ + /* calls during glyph loading. */ + /* */ +#define T1_MAX_SUBRS_CALLS 16 + + + /*************************************************************************/ + /* */ + /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */ + /* minimum of 16 is required. */ + /* */ + /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */ + /* */ +#define T1_MAX_CHARSTRINGS_OPERANDS 256 + + + /*************************************************************************/ + /* */ + /* Define this configuration macro if you want to prevent the */ + /* compilation of `t1afm', which is in charge of reading Type 1 AFM */ + /* files into an existing face. Note that if set, the T1 driver will be */ + /* unable to produce kerning distances. */ + /* */ +#undef T1_CONFIG_OPTION_NO_AFM + + + /*************************************************************************/ + /* */ + /* Define this configuration macro if you want to prevent the */ + /* compilation of the Multiple Masters font support in the Type 1 */ + /* driver. */ + /* */ +#undef T1_CONFIG_OPTION_NO_MM_SUPPORT + + + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* Compile autofit module with CJK script support. */ + /* */ +#define AF_CONFIG_OPTION_CJK + + /*************************************************************************/ + /* */ + /* Compile autofit module with Indic script support. */ + /* */ +#define AF_CONFIG_OPTION_INDIC + + /* */ + + + /* + * Define this variable if you want to keep the layout of internal + * structures that was used prior to FreeType 2.2. This also compiles in + * a few obsolete functions to avoid linking problems on typical Unix + * distributions. + * + * For embedded systems or building a new distribution from scratch, it + * is recommended to disable the macro since it reduces the library's code + * size and activates a few memory-saving optimizations as well. + */ +/* #define FT_CONFIG_OPTION_OLD_INTERNALS */ + + + /* + * This variable is defined if either unpatented or native TrueType + * hinting is requested by the definitions above. + */ +#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER +#define TT_USE_BYTECODE_INTERPRETER +#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING +#define TT_USE_BYTECODE_INTERPRETER +#endif + +FT_END_HEADER + + +#endif /* __FTOPTION_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/config/ftstdlib.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/config/ftstdlib.h new file mode 100644 index 0000000000..f923f3e4cf --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/config/ftstdlib.h @@ -0,0 +1,180 @@ +/***************************************************************************/ +/* */ +/* ftstdlib.h */ +/* */ +/* ANSI-specific library and header configuration file (specification */ +/* only). */ +/* */ +/* Copyright 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This file is used to group all #includes to the ANSI C library that */ + /* FreeType normally requires. It also defines macros to rename the */ + /* standard functions within the FreeType source code. */ + /* */ + /* Load a file which defines __FTSTDLIB_H__ before this one to override */ + /* it. */ + /* */ + /*************************************************************************/ + + +#ifndef __FTSTDLIB_H__ +#define __FTSTDLIB_H__ + + +#include <stddef.h> + +#define ft_ptrdiff_t ptrdiff_t + + + /**********************************************************************/ + /* */ + /* integer limits */ + /* */ + /* UINT_MAX and ULONG_MAX are used to automatically compute the size */ + /* of `int' and `long' in bytes at compile-time. So far, this works */ + /* for all platforms the library has been tested on. */ + /* */ + /* Note that on the extremely rare platforms that do not provide */ + /* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */ + /* old Crays where `int' is 36 bits), we do not make any guarantee */ + /* about the correct behaviour of FT2 with all fonts. */ + /* */ + /* In these case, `ftconfig.h' will refuse to compile anyway with a */ + /* message like `couldn't find 32-bit type' or something similar. */ + /* */ + /* IMPORTANT NOTE: We do not define aliases for heap management and */ + /* i/o routines (i.e. malloc/free/fopen/fread/...) */ + /* since these functions should all be encapsulated */ + /* by platform-specific implementations of */ + /* `ftsystem.c'. */ + /* */ + /**********************************************************************/ + + +#include <limits.h> + +#define FT_CHAR_BIT CHAR_BIT +#define FT_INT_MAX INT_MAX +#define FT_UINT_MAX UINT_MAX +#define FT_ULONG_MAX ULONG_MAX + + + /**********************************************************************/ + /* */ + /* character and string processing */ + /* */ + /**********************************************************************/ + + +#include <string.h> + +#define ft_memchr memchr +#define ft_memcmp memcmp +#define ft_memcpy memcpy +#define ft_memmove memmove +#define ft_memset memset +#define ft_strcat strcat +#define ft_strcmp strcmp +#define ft_strcpy strcpy +#define ft_strlen strlen +#define ft_strncmp strncmp +#define ft_strncpy strncpy +#define ft_strrchr strrchr +#define ft_strstr strstr + + + /**********************************************************************/ + /* */ + /* file handling */ + /* */ + /**********************************************************************/ + + +#include <stdio.h> + +#define FT_FILE FILE +#define ft_fclose fclose +#define ft_fopen fopen +#define ft_fread fread +#define ft_fseek fseek +#define ft_ftell ftell +#define ft_sprintf sprintf + + + /**********************************************************************/ + /* */ + /* sorting */ + /* */ + /**********************************************************************/ + + +#include <stdlib.h> + +#define ft_qsort qsort + +#define ft_exit exit /* only used to exit from unhandled exceptions */ + + + /**********************************************************************/ + /* */ + /* memory allocation */ + /* */ + /**********************************************************************/ + + +#define ft_scalloc calloc +#define ft_sfree free +#define ft_smalloc malloc +#define ft_srealloc realloc + + + /**********************************************************************/ + /* */ + /* miscellaneous */ + /* */ + /**********************************************************************/ + + +#define ft_atol atol +#define ft_labs labs + + + /**********************************************************************/ + /* */ + /* execution control */ + /* */ + /**********************************************************************/ + + +#include <setjmp.h> + +#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */ + /* jmp_buf is defined as a macro */ + /* on certain platforms */ + +#define ft_longjmp longjmp +#define ft_setjmp( b ) setjmp( *(jmp_buf*) &(b) ) /* same thing here */ + + + /* the following is only used for debugging purposes, i.e., if */ + /* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */ + +#include <stdarg.h> + + +#endif /* __FTSTDLIB_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/freetype.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/freetype.h new file mode 100644 index 0000000000..dbca087e5f --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/freetype.h @@ -0,0 +1,3434 @@ +/***************************************************************************/ +/* */ +/* freetype.h */ +/* */ +/* FreeType high-level API and common types (specification only). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef FT_FREETYPE_H +#error "`ft2build.h' hasn't been included yet!" +#error "Please always use macros to include FreeType header files." +#error "Example:" +#error " #include <ft2build.h>" +#error " #include FT_FREETYPE_H" +#endif + + + /*************************************************************************/ + /* */ + /* The `raster' component duplicates some of the declarations in */ + /* freetype.h for stand-alone use if _FREETYPE_ isn't defined. */ + /* */ + /*************************************************************************/ + + +#ifndef __FREETYPE_H__ +#define __FREETYPE_H__ + + +#include <ft2build.h> +#include FT_CONFIG_CONFIG_H +#include FT_ERRORS_H +#include FT_TYPES_H + + +FT_BEGIN_HEADER + + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* user_allocation */ + /* */ + /* <Title> */ + /* User allocation */ + /* */ + /* <Abstract> */ + /* How client applications should allocate FreeType data structures. */ + /* */ + /* <Description> */ + /* FreeType assumes that structures allocated by the user and passed */ + /* as arguments are zeroed out except for the actual data. With */ + /* other words, it is recommended to use `calloc' (or variants of it) */ + /* instead of `malloc' for allocation. */ + /* */ + /*************************************************************************/ + + + + /*************************************************************************/ + /*************************************************************************/ + /* */ + /* B A S I C T Y P E S */ + /* */ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* base_interface */ + /* */ + /* <Title> */ + /* Base Interface */ + /* */ + /* <Abstract> */ + /* The FreeType 2 base font interface. */ + /* */ + /* <Description> */ + /* This section describes the public high-level API of FreeType 2. */ + /* */ + /* <Order> */ + /* FT_Library */ + /* FT_Face */ + /* FT_Size */ + /* FT_GlyphSlot */ + /* FT_CharMap */ + /* FT_Encoding */ + /* */ + /* FT_FaceRec */ + /* */ + /* FT_FACE_FLAG_SCALABLE */ + /* FT_FACE_FLAG_FIXED_SIZES */ + /* FT_FACE_FLAG_FIXED_WIDTH */ + /* FT_FACE_FLAG_HORIZONTAL */ + /* FT_FACE_FLAG_VERTICAL */ + /* FT_FACE_FLAG_SFNT */ + /* FT_FACE_FLAG_KERNING */ + /* FT_FACE_FLAG_MULTIPLE_MASTERS */ + /* FT_FACE_FLAG_GLYPH_NAMES */ + /* FT_FACE_FLAG_EXTERNAL_STREAM */ + /* FT_FACE_FLAG_FAST_GLYPHS */ + /* FT_FACE_FLAG_HINTER */ + /* */ + /* FT_STYLE_FLAG_BOLD */ + /* FT_STYLE_FLAG_ITALIC */ + /* */ + /* FT_SizeRec */ + /* FT_Size_Metrics */ + /* */ + /* FT_GlyphSlotRec */ + /* FT_Glyph_Metrics */ + /* FT_SubGlyph */ + /* */ + /* FT_Bitmap_Size */ + /* */ + /* FT_Init_FreeType */ + /* FT_Done_FreeType */ + /* */ + /* FT_New_Face */ + /* FT_Done_Face */ + /* FT_New_Memory_Face */ + /* FT_Open_Face */ + /* FT_Open_Args */ + /* FT_Parameter */ + /* FT_Attach_File */ + /* FT_Attach_Stream */ + /* */ + /* FT_Set_Char_Size */ + /* FT_Set_Pixel_Sizes */ + /* FT_Request_Size */ + /* FT_Select_Size */ + /* FT_Size_Request_Type */ + /* FT_Size_Request */ + /* FT_Set_Transform */ + /* FT_Load_Glyph */ + /* FT_Get_Char_Index */ + /* FT_Get_Name_Index */ + /* FT_Load_Char */ + /* */ + /* FT_OPEN_MEMORY */ + /* FT_OPEN_STREAM */ + /* FT_OPEN_PATHNAME */ + /* FT_OPEN_DRIVER */ + /* FT_OPEN_PARAMS */ + /* */ + /* FT_LOAD_DEFAULT */ + /* FT_LOAD_RENDER */ + /* FT_LOAD_MONOCHROME */ + /* FT_LOAD_LINEAR_DESIGN */ + /* FT_LOAD_NO_SCALE */ + /* FT_LOAD_NO_HINTING */ + /* FT_LOAD_NO_BITMAP */ + /* FT_LOAD_CROP_BITMAP */ + /* */ + /* FT_LOAD_VERTICAL_LAYOUT */ + /* FT_LOAD_IGNORE_TRANSFORM */ + /* FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */ + /* FT_LOAD_FORCE_AUTOHINT */ + /* FT_LOAD_NO_RECURSE */ + /* FT_LOAD_PEDANTIC */ + /* */ + /* FT_LOAD_TARGET_NORMAL */ + /* FT_LOAD_TARGET_LIGHT */ + /* FT_LOAD_TARGET_MONO */ + /* FT_LOAD_TARGET_LCD */ + /* FT_LOAD_TARGET_LCD_V */ + /* */ + /* FT_Render_Glyph */ + /* FT_Render_Mode */ + /* FT_Get_Kerning */ + /* FT_Kerning_Mode */ + /* FT_Get_Track_Kerning */ + /* FT_Get_Glyph_Name */ + /* FT_Get_Postscript_Name */ + /* */ + /* FT_CharMapRec */ + /* FT_Select_Charmap */ + /* FT_Set_Charmap */ + /* FT_Get_Charmap_Index */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_Glyph_Metrics */ + /* */ + /* <Description> */ + /* A structure used to model the metrics of a single glyph. The */ + /* values are expressed in 26.6 fractional pixel format; if the flag */ + /* @FT_LOAD_NO_SCALE has been used while loading the glyph, values */ + /* are expressed in font units instead. */ + /* */ + /* <Fields> */ + /* width :: */ + /* The glyph's width. */ + /* */ + /* height :: */ + /* The glyph's height. */ + /* */ + /* horiBearingX :: */ + /* Left side bearing for horizontal layout. */ + /* */ + /* horiBearingY :: */ + /* Top side bearing for horizontal layout. */ + /* */ + /* horiAdvance :: */ + /* Advance width for horizontal layout. */ + /* */ + /* vertBearingX :: */ + /* Left side bearing for vertical layout. */ + /* */ + /* vertBearingY :: */ + /* Top side bearing for vertical layout. */ + /* */ + /* vertAdvance :: */ + /* Advance height for vertical layout. */ + /* */ + typedef struct FT_Glyph_Metrics_ + { + FT_Pos width; + FT_Pos height; + + FT_Pos horiBearingX; + FT_Pos horiBearingY; + FT_Pos horiAdvance; + + FT_Pos vertBearingX; + FT_Pos vertBearingY; + FT_Pos vertAdvance; + + } FT_Glyph_Metrics; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_Bitmap_Size */ + /* */ + /* <Description> */ + /* This structure models the metrics of a bitmap strike (i.e., a set */ + /* of glyphs for a given point size and resolution) in a bitmap font. */ + /* It is used for the `available_sizes' field of @FT_Face. */ + /* */ + /* <Fields> */ + /* height :: The vertical distance, in pixels, between two */ + /* consecutive baselines. It is always positive. */ + /* */ + /* width :: The average width, in pixels, of all glyphs in the */ + /* strike. */ + /* */ + /* size :: The nominal size of the strike in 26.6 fractional */ + /* points. This field is not very useful. */ + /* */ + /* x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional */ + /* pixels. */ + /* */ + /* y_ppem :: The vertical ppem (nominal height) in 26.6 fractional */ + /* pixels. */ + /* */ + /* <Note> */ + /* Windows FNT: */ + /* The nominal size given in a FNT font is not reliable. Thus when */ + /* the driver finds it incorrect, it sets `size' to some calculated */ + /* values and sets `x_ppem' and `y_ppem' to the pixel width and */ + /* height given in the font, respectively. */ + /* */ + /* TrueType embedded bitmaps: */ + /* `size', `width', and `height' values are not contained in the */ + /* bitmap strike itself. They are computed from the global font */ + /* parameters. */ + /* */ + typedef struct FT_Bitmap_Size_ + { + FT_Short height; + FT_Short width; + + FT_Pos size; + + FT_Pos x_ppem; + FT_Pos y_ppem; + + } FT_Bitmap_Size; + + + /*************************************************************************/ + /*************************************************************************/ + /* */ + /* O B J E C T C L A S S E S */ + /* */ + /*************************************************************************/ + /*************************************************************************/ + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Library */ + /* */ + /* <Description> */ + /* A handle to a FreeType library instance. Each `library' is */ + /* completely independent from the others; it is the `root' of a set */ + /* of objects like fonts, faces, sizes, etc. */ + /* */ + /* It also embeds a memory manager (see @FT_Memory), as well as a */ + /* scan-line converter object (see @FT_Raster). */ + /* */ + /* For multi-threading applications each thread should have its own */ + /* FT_Library object. */ + /* */ + /* <Note> */ + /* Library objects are normally created by @FT_Init_FreeType, and */ + /* destroyed with @FT_Done_FreeType. */ + /* */ + typedef struct FT_LibraryRec_ *FT_Library; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Module */ + /* */ + /* <Description> */ + /* A handle to a given FreeType module object. Each module can be a */ + /* font driver, a renderer, or anything else that provides services */ + /* to the formers. */ + /* */ + typedef struct FT_ModuleRec_* FT_Module; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Driver */ + /* */ + /* <Description> */ + /* A handle to a given FreeType font driver object. Each font driver */ + /* is a special module capable of creating faces from font files. */ + /* */ + typedef struct FT_DriverRec_* FT_Driver; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Renderer */ + /* */ + /* <Description> */ + /* A handle to a given FreeType renderer. A renderer is a special */ + /* module in charge of converting a glyph image to a bitmap, when */ + /* necessary. Each renderer supports a given glyph image format, and */ + /* one or more target surface depths. */ + /* */ + typedef struct FT_RendererRec_* FT_Renderer; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Face */ + /* */ + /* <Description> */ + /* A handle to a given typographic face object. A face object models */ + /* a given typeface, in a given style. */ + /* */ + /* <Note> */ + /* Each face object also owns a single @FT_GlyphSlot object, as well */ + /* as one or more @FT_Size objects. */ + /* */ + /* Use @FT_New_Face or @FT_Open_Face to create a new face object from */ + /* a given filepathname or a custom input stream. */ + /* */ + /* Use @FT_Done_Face to destroy it (along with its slot and sizes). */ + /* */ + /* <Also> */ + /* The @FT_FaceRec details the publicly accessible fields of a given */ + /* face object. */ + /* */ + typedef struct FT_FaceRec_* FT_Face; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Size */ + /* */ + /* <Description> */ + /* A handle to an object used to model a face scaled to a given */ + /* character size. */ + /* */ + /* <Note> */ + /* Each @FT_Face has an _active_ @FT_Size object that is used by */ + /* functions like @FT_Load_Glyph to determine the scaling */ + /* transformation which is used to load and hint glyphs and metrics. */ + /* */ + /* You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, */ + /* @FT_Request_Size or even @FT_Select_Size to change the content */ + /* (i.e., the scaling values) of the active @FT_Size. */ + /* */ + /* You can use @FT_New_Size to create additional size objects for a */ + /* given @FT_Face, but they won't be used by other functions until */ + /* you activate it through @FT_Activate_Size. Only one size can be */ + /* activated at any given time per face. */ + /* */ + /* <Also> */ + /* The @FT_SizeRec structure details the publicly accessible fields */ + /* of a given size object. */ + /* */ + typedef struct FT_SizeRec_* FT_Size; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_GlyphSlot */ + /* */ + /* <Description> */ + /* A handle to a given `glyph slot'. A slot is a container where it */ + /* is possible to load any one of the glyphs contained in its parent */ + /* face. */ + /* */ + /* In other words, each time you call @FT_Load_Glyph or */ + /* @FT_Load_Char, the slot's content is erased by the new glyph data, */ + /* i.e., the glyph's metrics, its image (bitmap or outline), and */ + /* other control information. */ + /* */ + /* <Also> */ + /* @FT_GlyphSlotRec details the publicly accessible glyph fields. */ + /* */ + typedef struct FT_GlyphSlotRec_* FT_GlyphSlot; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_CharMap */ + /* */ + /* <Description> */ + /* A handle to a given character map. A charmap is used to translate */ + /* character codes in a given encoding into glyph indexes for its */ + /* parent's face. Some font formats may provide several charmaps per */ + /* font. */ + /* */ + /* Each face object owns zero or more charmaps, but only one of them */ + /* can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char. */ + /* */ + /* The list of available charmaps in a face is available through the */ + /* `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec. */ + /* */ + /* The currently active charmap is available as `face->charmap'. */ + /* You should call @FT_Set_Charmap to change it. */ + /* */ + /* <Note> */ + /* When a new face is created (either through @FT_New_Face or */ + /* @FT_Open_Face), the library looks for a Unicode charmap within */ + /* the list and automatically activates it. */ + /* */ + /* <Also> */ + /* The @FT_CharMapRec details the publicly accessible fields of a */ + /* given character map. */ + /* */ + typedef struct FT_CharMapRec_* FT_CharMap; + + + /*************************************************************************/ + /* */ + /* <Macro> */ + /* FT_ENC_TAG */ + /* */ + /* <Description> */ + /* This macro converts four-letter tags into an unsigned long. It is */ + /* used to define `encoding' identifiers (see @FT_Encoding). */ + /* */ + /* <Note> */ + /* Since many 16bit compilers don't like 32bit enumerations, you */ + /* should redefine this macro in case of problems to something like */ + /* this: */ + /* */ + /* { */ + /* #define FT_ENC_TAG( value, a, b, c, d ) value */ + /* } */ + /* */ + /* to get a simple enumeration without assigning special numbers. */ + /* */ + +#ifndef FT_ENC_TAG +#define FT_ENC_TAG( value, a, b, c, d ) \ + value = ( ( (FT_UInt32)(a) << 24 ) | \ + ( (FT_UInt32)(b) << 16 ) | \ + ( (FT_UInt32)(c) << 8 ) | \ + (FT_UInt32)(d) ) + +#endif /* FT_ENC_TAG */ + + + /*************************************************************************/ + /* */ + /* <Enum> */ + /* FT_Encoding */ + /* */ + /* <Description> */ + /* An enumeration used to specify character sets supported by */ + /* charmaps. Used in the @FT_Select_Charmap API function. */ + /* */ + /* <Note> */ + /* Despite the name, this enumeration lists specific character */ + /* repertories (i.e., charsets), and not text encoding methods (e.g., */ + /* UTF-8, UTF-16, GB2312_EUC, etc.). */ + /* */ + /* Because of 32-bit charcodes defined in Unicode (i.e., surrogates), */ + /* all character codes must be expressed as FT_Longs. */ + /* */ + /* Other encodings might be defined in the future. */ + /* */ + /* <Values> */ + /* FT_ENCODING_NONE :: */ + /* The encoding value 0 is reserved. */ + /* */ + /* FT_ENCODING_UNICODE :: */ + /* Corresponds to the Unicode character set. This value covers */ + /* all versions of the Unicode repertoire, including ASCII and */ + /* Latin-1. Most fonts include a Unicode charmap, but not all */ + /* of them. */ + /* */ + /* FT_ENCODING_MS_SYMBOL :: */ + /* Corresponds to the Microsoft Symbol encoding, used to encode */ + /* mathematical symbols in the 32..255 character code range. For */ + /* more information, see `http://www.ceviz.net/symbol.htm'. */ + /* */ + /* FT_ENCODING_SJIS :: */ + /* Corresponds to Japanese SJIS encoding. More info at */ + /* at `http://langsupport.japanreference.com/encoding.shtml'. */ + /* See note on multi-byte encodings below. */ + /* */ + /* FT_ENCODING_GB2312 :: */ + /* Corresponds to an encoding system for Simplified Chinese as used */ + /* used in mainland China. */ + /* */ + /* FT_ENCODING_BIG5 :: */ + /* Corresponds to an encoding system for Traditional Chinese as used */ + /* in Taiwan and Hong Kong. */ + /* */ + /* FT_ENCODING_WANSUNG :: */ + /* Corresponds to the Korean encoding system known as Wansung. */ + /* For more information see */ + /* `http://www.microsoft.com/typography/unicode/949.txt'. */ + /* */ + /* FT_ENCODING_JOHAB :: */ + /* The Korean standard character set (KS C-5601-1992), which */ + /* corresponds to MS Windows code page 1361. This character set */ + /* includes all possible Hangeul character combinations. */ + /* */ + /* FT_ENCODING_ADOBE_LATIN_1 :: */ + /* Corresponds to a Latin-1 encoding as defined in a Type 1 */ + /* Postscript font. It is limited to 256 character codes. */ + /* */ + /* FT_ENCODING_ADOBE_STANDARD :: */ + /* Corresponds to the Adobe Standard encoding, as found in Type 1, */ + /* CFF, and OpenType/CFF fonts. It is limited to 256 character */ + /* codes. */ + /* */ + /* FT_ENCODING_ADOBE_EXPERT :: */ + /* Corresponds to the Adobe Expert encoding, as found in Type 1, */ + /* CFF, and OpenType/CFF fonts. It is limited to 256 character */ + /* codes. */ + /* */ + /* FT_ENCODING_ADOBE_CUSTOM :: */ + /* Corresponds to a custom encoding, as found in Type 1, CFF, and */ + /* OpenType/CFF fonts. It is limited to 256 character codes. */ + /* */ + /* FT_ENCODING_APPLE_ROMAN :: */ + /* Corresponds to the 8-bit Apple roman encoding. Many TrueType and */ + /* OpenType fonts contain a charmap for this encoding, since older */ + /* versions of Mac OS are able to use it. */ + /* */ + /* FT_ENCODING_OLD_LATIN_2 :: */ + /* This value is deprecated and was never used nor reported by */ + /* FreeType. Don't use or test for it. */ + /* */ + /* FT_ENCODING_MS_SJIS :: */ + /* Same as FT_ENCODING_SJIS. Deprecated. */ + /* */ + /* FT_ENCODING_MS_GB2312 :: */ + /* Same as FT_ENCODING_GB2312. Deprecated. */ + /* */ + /* FT_ENCODING_MS_BIG5 :: */ + /* Same as FT_ENCODING_BIG5. Deprecated. */ + /* */ + /* FT_ENCODING_MS_WANSUNG :: */ + /* Same as FT_ENCODING_WANSUNG. Deprecated. */ + /* */ + /* FT_ENCODING_MS_JOHAB :: */ + /* Same as FT_ENCODING_JOHAB. Deprecated. */ + /* */ + /* <Note> */ + /* By default, FreeType automatically synthetizes a Unicode charmap */ + /* for Postscript fonts, using their glyph names dictionaries. */ + /* However, it also reports the encodings defined explicitly in the */ + /* font file, for the cases when they are needed, with the Adobe */ + /* values as well. */ + /* */ + /* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */ + /* is neither Unicode nor ISO-8859-1 (otherwise it is set to */ + /* FT_ENCODING_UNICODE). Use @FT_Get_BDF_Charset_ID to find out which */ + /* encoding is really present. If, for example, the `cs_registry' */ + /* field is `KOI8' and the `cs_encoding' field is `R', the font is */ + /* encoded in KOI8-R. */ + /* */ + /* FT_ENCODING_NONE is always set (with a single exception) by the */ + /* winfonts driver. Use @FT_Get_WinFNT_Header and examine the */ + /* `charset' field of the @FT_WinFNT_HeaderRec structure to find out */ + /* which encoding is really present. For example, */ + /* @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for */ + /* Russian). */ + /* */ + /* FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */ + /* and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to */ + /* FT_ENCODING_APPLE_ROMAN). */ + /* */ + /* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function c */ + /* @FT_Get_CMap_Language_ID to query the Mac language ID which may be */ + /* needed to be able to distinguish Apple encoding variants. See */ + /* */ + /* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT */ + /* */ + /* to get an idea how to do that. Basically, if the language ID is 0, */ + /* don't use it, otherwise subtract 1 from the language ID. Then */ + /* examine `encoding_id'. If, for example, `encoding_id' is */ + /* @TT_MAC_ID_ROMAN and the language ID (minus 1) is */ + /* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */ + /* @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi */ + /* variant the Arabic encoding. */ + /* */ + typedef enum FT_Encoding_ + { + FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ), + + FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ), + FT_ENC_TAG( FT_ENCODING_UNICODE, 'u', 'n', 'i', 'c' ), + + FT_ENC_TAG( FT_ENCODING_SJIS, 's', 'j', 'i', 's' ), + FT_ENC_TAG( FT_ENCODING_GB2312, 'g', 'b', ' ', ' ' ), + FT_ENC_TAG( FT_ENCODING_BIG5, 'b', 'i', 'g', '5' ), + FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ), + FT_ENC_TAG( FT_ENCODING_JOHAB, 'j', 'o', 'h', 'a' ), + + /* for backwards compatibility */ + FT_ENCODING_MS_SJIS = FT_ENCODING_SJIS, + FT_ENCODING_MS_GB2312 = FT_ENCODING_GB2312, + FT_ENCODING_MS_BIG5 = FT_ENCODING_BIG5, + FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG, + FT_ENCODING_MS_JOHAB = FT_ENCODING_JOHAB, + + FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ), + FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT, 'A', 'D', 'B', 'E' ), + FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM, 'A', 'D', 'B', 'C' ), + FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1, 'l', 'a', 't', '1' ), + + FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ), + + FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' ) + + } FT_Encoding; + + + /*************************************************************************/ + /* */ + /* <Enum> */ + /* ft_encoding_xxx */ + /* */ + /* <Description> */ + /* These constants are deprecated; use the corresponding @FT_Encoding */ + /* values instead. */ + /* */ +#define ft_encoding_none FT_ENCODING_NONE +#define ft_encoding_unicode FT_ENCODING_UNICODE +#define ft_encoding_symbol FT_ENCODING_MS_SYMBOL +#define ft_encoding_latin_1 FT_ENCODING_ADOBE_LATIN_1 +#define ft_encoding_latin_2 FT_ENCODING_OLD_LATIN_2 +#define ft_encoding_sjis FT_ENCODING_SJIS +#define ft_encoding_gb2312 FT_ENCODING_GB2312 +#define ft_encoding_big5 FT_ENCODING_BIG5 +#define ft_encoding_wansung FT_ENCODING_WANSUNG +#define ft_encoding_johab FT_ENCODING_JOHAB + +#define ft_encoding_adobe_standard FT_ENCODING_ADOBE_STANDARD +#define ft_encoding_adobe_expert FT_ENCODING_ADOBE_EXPERT +#define ft_encoding_adobe_custom FT_ENCODING_ADOBE_CUSTOM +#define ft_encoding_apple_roman FT_ENCODING_APPLE_ROMAN + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_CharMapRec */ + /* */ + /* <Description> */ + /* The base charmap structure. */ + /* */ + /* <Fields> */ + /* face :: A handle to the parent face object. */ + /* */ + /* encoding :: An @FT_Encoding tag identifying the charmap. Use */ + /* this with @FT_Select_Charmap. */ + /* */ + /* platform_id :: An ID number describing the platform for the */ + /* following encoding ID. This comes directly from */ + /* the TrueType specification and should be emulated */ + /* for other formats. */ + /* */ + /* encoding_id :: A platform specific encoding number. This also */ + /* comes from the TrueType specification and should be */ + /* emulated similarly. */ + /* */ + typedef struct FT_CharMapRec_ + { + FT_Face face; + FT_Encoding encoding; + FT_UShort platform_id; + FT_UShort encoding_id; + + } FT_CharMapRec; + + + /*************************************************************************/ + /*************************************************************************/ + /* */ + /* B A S E O B J E C T C L A S S E S */ + /* */ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Face_Internal */ + /* */ + /* <Description> */ + /* An opaque handle to an `FT_Face_InternalRec' structure, used to */ + /* model private data of a given @FT_Face object. */ + /* */ + /* This structure might change between releases of FreeType 2 and is */ + /* not generally available to client applications. */ + /* */ + typedef struct FT_Face_InternalRec_* FT_Face_Internal; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_FaceRec */ + /* */ + /* <Description> */ + /* FreeType root face class structure. A face object models a */ + /* typeface in a font file. */ + /* */ + /* <Fields> */ + /* num_faces :: The number of faces in the font file. Some */ + /* font formats can have multiple faces in */ + /* a font file. */ + /* */ + /* face_index :: The index of the face in the font file. It */ + /* is set to 0 if there is only one face in */ + /* the font file. */ + /* */ + /* face_flags :: A set of bit flags that give important */ + /* information about the face; see */ + /* @FT_FACE_FLAG_XXX for the details. */ + /* */ + /* style_flags :: A set of bit flags indicating the style of */ + /* the face; see @FT_STYLE_FLAG_XXX for the */ + /* details. */ + /* */ + /* num_glyphs :: The number of glyphs in the face. If the */ + /* face is scalable and has sbits (see */ + /* `num_fixed_sizes'), it is set to the number */ + /* of outline glyphs. */ + /* */ + /* family_name :: The face's family name. This is an ASCII */ + /* string, usually in English, which describes */ + /* the typeface's family (like `Times New */ + /* Roman', `Bodoni', `Garamond', etc). This */ + /* is a least common denominator used to list */ + /* fonts. Some formats (TrueType & OpenType) */ + /* provide localized and Unicode versions of */ + /* this string. Applications should use the */ + /* format specific interface to access them. */ + /* */ + /* style_name :: The face's style name. This is an ASCII */ + /* string, usually in English, which describes */ + /* the typeface's style (like `Italic', */ + /* `Bold', `Condensed', etc). Not all font */ + /* formats provide a style name, so this field */ + /* is optional, and can be set to NULL. As */ + /* for `family_name', some formats provide */ + /* localized and Unicode versions of this */ + /* string. Applications should use the format */ + /* specific interface to access them. */ + /* */ + /* num_fixed_sizes :: The number of bitmap strikes in the face. */ + /* Even if the face is scalable, there might */ + /* still be bitmap strikes, which are called */ + /* `sbits' in that case. */ + /* */ + /* available_sizes :: An array of @FT_Bitmap_Size for all bitmap */ + /* strikes in the face. It is set to NULL if */ + /* there is no bitmap strike. */ + /* */ + /* num_charmaps :: The number of charmaps in the face. */ + /* */ + /* charmaps :: An array of the charmaps of the face. */ + /* */ + /* generic :: A field reserved for client uses. See the */ + /* @FT_Generic type description. */ + /* */ + /* bbox :: The font bounding box. Coordinates are */ + /* expressed in font units (see */ + /* `units_per_EM'). The box is large enough */ + /* to contain any glyph from the font. Thus, */ + /* `bbox.yMax' can be seen as the `maximal */ + /* ascender', and `bbox.yMin' as the `minimal */ + /* descender'. Only relevant for scalable */ + /* formats. */ + /* */ + /* units_per_EM :: The number of font units per EM square for */ + /* this face. This is typically 2048 for */ + /* TrueType fonts, and 1000 for Type 1 fonts. */ + /* Only relevant for scalable formats. */ + /* */ + /* ascender :: The typographic ascender of the face, */ + /* expressed in font units. For font formats */ + /* not having this information, it is set to */ + /* `bbox.yMax'. Only relevant for scalable */ + /* formats. */ + /* */ + /* descender :: The typographic descender of the face, */ + /* expressed in font units. For font formats */ + /* not having this information, it is set to */ + /* `bbox.yMin'. Note that this field is */ + /* usually negative. Only relevant for */ + /* scalable formats. */ + /* */ + /* height :: The height is the vertical distance */ + /* between two consecutive baselines, */ + /* expressed in font units. It is always */ + /* positive. Only relevant for scalable */ + /* formats. */ + /* */ + /* max_advance_width :: The maximal advance width, in font units, */ + /* for all glyphs in this face. This can be */ + /* used to make word wrapping computations */ + /* faster. Only relevant for scalable */ + /* formats. */ + /* */ + /* max_advance_height :: The maximal advance height, in font units, */ + /* for all glyphs in this face. This is only */ + /* relevant for vertical layouts, and is set */ + /* to `height' for fonts that do not provide */ + /* vertical metrics. Only relevant for */ + /* scalable formats. */ + /* */ + /* underline_position :: The position, in font units, of the */ + /* underline line for this face. It's the */ + /* center of the underlining stem. Only */ + /* relevant for scalable formats. */ + /* */ + /* underline_thickness :: The thickness, in font units, of the */ + /* underline for this face. Only relevant for */ + /* scalable formats. */ + /* */ + /* glyph :: The face's associated glyph slot(s). */ + /* */ + /* size :: The current active size for this face. */ + /* */ + /* charmap :: The current active charmap for this face. */ + /* */ + /* <Note> */ + /* Fields may be changed after a call to @FT_Attach_File or */ + /* @FT_Attach_Stream. */ + /* */ + typedef struct FT_FaceRec_ + { + FT_Long num_faces; + FT_Long face_index; + + FT_Long face_flags; + FT_Long style_flags; + + FT_Long num_glyphs; + + FT_String* family_name; + FT_String* style_name; + + FT_Int num_fixed_sizes; + FT_Bitmap_Size* available_sizes; + + FT_Int num_charmaps; + FT_CharMap* charmaps; + + FT_Generic generic; + + /*# The following member variables (down to `underline_thickness') */ + /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size */ + /*# for bitmap fonts. */ + FT_BBox bbox; + + FT_UShort units_per_EM; + FT_Short ascender; + FT_Short descender; + FT_Short height; + + FT_Short max_advance_width; + FT_Short max_advance_height; + + FT_Short underline_position; + FT_Short underline_thickness; + + FT_GlyphSlot glyph; + FT_Size size; + FT_CharMap charmap; + + /*@private begin */ + + FT_Driver driver; + FT_Memory memory; + FT_Stream stream; + + FT_ListRec sizes_list; + + FT_Generic autohint; + void* extensions; + + FT_Face_Internal internal; + + /*@private end */ + + } FT_FaceRec; + + + /*************************************************************************/ + /* */ + /* <Enum> */ + /* FT_FACE_FLAG_XXX */ + /* */ + /* <Description> */ + /* A list of bit flags used in the `face_flags' field of the */ + /* @FT_FaceRec structure. They inform client applications of */ + /* properties of the corresponding face. */ + /* */ + /* <Values> */ + /* FT_FACE_FLAG_SCALABLE :: */ + /* Indicates that the face contains outline glyphs. This doesn't */ + /* prevent bitmap strikes, i.e., a face can have both this and */ + /* and @FT_FACE_FLAG_FIXED_SIZES set. */ + /* */ + /* FT_FACE_FLAG_FIXED_SIZES :: */ + /* Indicates that the face contains bitmap strikes. See also the */ + /* `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec. */ + /* */ + /* FT_FACE_FLAG_FIXED_WIDTH :: */ + /* Indicates that the face contains fixed-width characters (like */ + /* Courier, Lucido, MonoType, etc.). */ + /* */ + /* FT_FACE_FLAG_SFNT :: */ + /* Indicates that the face uses the `sfnt' storage scheme. For */ + /* now, this means TrueType and OpenType. */ + /* */ + /* FT_FACE_FLAG_HORIZONTAL :: */ + /* Indicates that the face contains horizontal glyph metrics. This */ + /* should be set for all common formats. */ + /* */ + /* FT_FACE_FLAG_VERTICAL :: */ + /* Indicates that the face contains vertical glyph metrics. This */ + /* is only available in some formats, not all of them. */ + /* */ + /* FT_FACE_FLAG_KERNING :: */ + /* Indicates that the face contains kerning information. If set, */ + /* the kerning distance can be retrieved through the function */ + /* @FT_Get_Kerning. Otherwise the function always return the */ + /* vector (0,0). Note that FreeType doesn't handle kerning data */ + /* from the `GPOS' table (as present in some OpenType fonts). */ + /* */ + /* FT_FACE_FLAG_FAST_GLYPHS :: */ + /* THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. */ + /* */ + /* FT_FACE_FLAG_MULTIPLE_MASTERS :: */ + /* Indicates that the font contains multiple masters and is capable */ + /* of interpolating between them. See the multiple-masters */ + /* specific API for details. */ + /* */ + /* FT_FACE_FLAG_GLYPH_NAMES :: */ + /* Indicates that the font contains glyph names that can be */ + /* retrieved through @FT_Get_Glyph_Name. Note that some TrueType */ + /* fonts contain broken glyph name tables. Use the function */ + /* @FT_Has_PS_Glyph_Names when needed. */ + /* */ + /* FT_FACE_FLAG_EXTERNAL_STREAM :: */ + /* Used internally by FreeType to indicate that a face's stream was */ + /* provided by the client application and should not be destroyed */ + /* when @FT_Done_Face is called. Don't read or test this flag. */ + /* */ + /* FT_FACE_FLAG_HINTER :: */ + /* Set if the font driver has a hinting machine of its own. For */ + /* example, with TrueType fonts, it makes sense to use data from */ + /* the SFNT `gasp' table only if the native TrueType hinting engine */ + /* (with the bytecode interpreter) is available and active. */ + /* */ +#define FT_FACE_FLAG_SCALABLE ( 1L << 0 ) +#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 ) +#define FT_FACE_FLAG_FIXED_WIDTH ( 1L << 2 ) +#define FT_FACE_FLAG_SFNT ( 1L << 3 ) +#define FT_FACE_FLAG_HORIZONTAL ( 1L << 4 ) +#define FT_FACE_FLAG_VERTICAL ( 1L << 5 ) +#define FT_FACE_FLAG_KERNING ( 1L << 6 ) +#define FT_FACE_FLAG_FAST_GLYPHS ( 1L << 7 ) +#define FT_FACE_FLAG_MULTIPLE_MASTERS ( 1L << 8 ) +#define FT_FACE_FLAG_GLYPH_NAMES ( 1L << 9 ) +#define FT_FACE_FLAG_EXTERNAL_STREAM ( 1L << 10 ) +#define FT_FACE_FLAG_HINTER ( 1L << 11 ) + + /* */ + + + /************************************************************************* + * + * @macro: + * FT_HAS_HORIZONTAL( face ) + * + * @description: + * A macro that returns true whenever a face object contains + * horizontal metrics (this is true for all font formats though). + * + * @also: + * @FT_HAS_VERTICAL can be used to check for vertical metrics. + * + */ +#define FT_HAS_HORIZONTAL( face ) \ + ( face->face_flags & FT_FACE_FLAG_HORIZONTAL ) + + + /************************************************************************* + * + * @macro: + * FT_HAS_VERTICAL( face ) + * + * @description: + * A macro that returns true whenever a face object contains vertical + * metrics. + * + */ +#define FT_HAS_VERTICAL( face ) \ + ( face->face_flags & FT_FACE_FLAG_VERTICAL ) + + + /************************************************************************* + * + * @macro: + * FT_HAS_KERNING( face ) + * + * @description: + * A macro that returns true whenever a face object contains kerning + * data that can be accessed with @FT_Get_Kerning. + * + */ +#define FT_HAS_KERNING( face ) \ + ( face->face_flags & FT_FACE_FLAG_KERNING ) + + + /************************************************************************* + * + * @macro: + * FT_IS_SCALABLE( face ) + * + * @description: + * A macro that returns true whenever a face object contains a scalable + * font face (true for TrueType, Type 1, Type 42, CID, OpenType/CFF, + * and PFR font formats. + * + */ +#define FT_IS_SCALABLE( face ) \ + ( face->face_flags & FT_FACE_FLAG_SCALABLE ) + + + /************************************************************************* + * + * @macro: + * FT_IS_SFNT( face ) + * + * @description: + * A macro that returns true whenever a face object contains a font + * whose format is based on the SFNT storage scheme. This usually + * means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded + * bitmap fonts. + * + * If this macro is true, all functions defined in @FT_SFNT_NAMES_H and + * @FT_TRUETYPE_TABLES_H are available. + * + */ +#define FT_IS_SFNT( face ) \ + ( face->face_flags & FT_FACE_FLAG_SFNT ) + + + /************************************************************************* + * + * @macro: + * FT_IS_FIXED_WIDTH( face ) + * + * @description: + * A macro that returns true whenever a face object contains a font face + * that contains fixed-width (or `monospace', `fixed-pitch', etc.) + * glyphs. + * + */ +#define FT_IS_FIXED_WIDTH( face ) \ + ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH ) + + + /************************************************************************* + * + * @macro: + * FT_HAS_FIXED_SIZES( face ) + * + * @description: + * A macro that returns true whenever a face object contains some + * embedded bitmaps. See the `available_sizes' field of the + * @FT_FaceRec structure. + * + */ +#define FT_HAS_FIXED_SIZES( face ) \ + ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES ) + + /* */ + + + /************************************************************************* + * + * @macro: + * FT_HAS_FAST_GLYPHS( face ) + * + * @description: + * Deprecated. + * + */ +#define FT_HAS_FAST_GLYPHS( face ) 0 + + + /************************************************************************* + * + * @macro: + * FT_HAS_GLYPH_NAMES( face ) + * + * @description: + * A macro that returns true whenever a face object contains some glyph + * names that can be accessed through @FT_Get_Glyph_Name. + * + */ +#define FT_HAS_GLYPH_NAMES( face ) \ + ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES ) + + + /************************************************************************* + * + * @macro: + * FT_HAS_MULTIPLE_MASTERS( face ) + * + * @description: + * A macro that returns true whenever a face object contains some + * multiple masters. The functions provided by @FT_MULTIPLE_MASTERS_H + * are then available to choose the exact design you want. + * + */ +#define FT_HAS_MULTIPLE_MASTERS( face ) \ + ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS ) + + + /*************************************************************************/ + /* */ + /* <Constant> */ + /* FT_STYLE_FLAG_XXX */ + /* */ + /* <Description> */ + /* A list of bit-flags used to indicate the style of a given face. */ + /* These are used in the `style_flags' field of @FT_FaceRec. */ + /* */ + /* <Values> */ + /* FT_STYLE_FLAG_ITALIC :: */ + /* Indicates that a given face is italicized. */ + /* */ + /* FT_STYLE_FLAG_BOLD :: */ + /* Indicates that a given face is bold. */ + /* */ +#define FT_STYLE_FLAG_ITALIC ( 1 << 0 ) +#define FT_STYLE_FLAG_BOLD ( 1 << 1 ) + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Size_Internal */ + /* */ + /* <Description> */ + /* An opaque handle to an `FT_Size_InternalRec' structure, used to */ + /* model private data of a given FT_Size object. */ + /* */ + typedef struct FT_Size_InternalRec_* FT_Size_Internal; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_Size_Metrics */ + /* */ + /* <Description> */ + /* The size metrics structure gives the metrics of a size object. */ + /* */ + /* <Fields> */ + /* x_ppem :: The width of the scaled EM square in pixels, hence */ + /* the term `ppem' (pixels per EM). It is also */ + /* referred to as `nominal width'. */ + /* */ + /* y_ppem :: The height of the scaled EM square in pixels, */ + /* hence the term `ppem' (pixels per EM). It is also */ + /* referred to as `nominal height'. */ + /* */ + /* x_scale :: A 16.16 fractional scaling value used to convert */ + /* horizontal metrics from font units to 26.6 */ + /* fractional pixels. Only relevant for scalable */ + /* font formats. */ + /* */ + /* y_scale :: A 16.16 fractional scaling value used to convert */ + /* vertical metrics from font units to 26.6 */ + /* fractional pixels. Only relevant for scalable */ + /* font formats. */ + /* */ + /* ascender :: The ascender in 26.6 fractional pixels. See */ + /* @FT_FaceRec for the details. */ + /* */ + /* descender :: The descender in 26.6 fractional pixels. See */ + /* @FT_FaceRec for the details. */ + /* */ + /* height :: The height in 26.6 fractional pixels. See */ + /* @FT_FaceRec for the details. */ + /* */ + /* max_advance :: The maximal advance width in 26.6 fractional */ + /* pixels. See @FT_FaceRec for the details. */ + /* */ + /* <Note> */ + /* The scaling values, if relevant, are determined first during a */ + /* size changing operation. The remaining fields are then set by the */ + /* driver. For scalable formats, they are usually set to scaled */ + /* values of the corresponding fields in @FT_FaceRec. */ + /* */ + /* Note that due to glyph hinting, these values might not be exact */ + /* for certain fonts. Thus they must be treated as unreliable */ + /* with an error margin of at least one pixel! */ + /* */ + /* Indeed, the only way to get the exact metrics is to render _all_ */ + /* glyphs. As this would be a definite performance hit, it is up to */ + /* client applications to perform such computations. */ + /* */ + /* The FT_Size_Metrics structure is valid for bitmap fonts also. */ + /* */ + typedef struct FT_Size_Metrics_ + { + FT_UShort x_ppem; /* horizontal pixels per EM */ + FT_UShort y_ppem; /* vertical pixels per EM */ + + FT_Fixed x_scale; /* scaling values used to convert font */ + FT_Fixed y_scale; /* units to 26.6 fractional pixels */ + + FT_Pos ascender; /* ascender in 26.6 frac. pixels */ + FT_Pos descender; /* descender in 26.6 frac. pixels */ + FT_Pos height; /* text height in 26.6 frac. pixels */ + FT_Pos max_advance; /* max horizontal advance, in 26.6 pixels */ + + } FT_Size_Metrics; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_SizeRec */ + /* */ + /* <Description> */ + /* FreeType root size class structure. A size object models a face */ + /* object at a given size. */ + /* */ + /* <Fields> */ + /* face :: Handle to the parent face object. */ + /* */ + /* generic :: A typeless pointer, which is unused by the FreeType */ + /* library or any of its drivers. It can be used by */ + /* client applications to link their own data to each size */ + /* object. */ + /* */ + /* metrics :: Metrics for this size object. This field is read-only. */ + /* */ + typedef struct FT_SizeRec_ + { + FT_Face face; /* parent face object */ + FT_Generic generic; /* generic pointer for client uses */ + FT_Size_Metrics metrics; /* size metrics */ + FT_Size_Internal internal; + + } FT_SizeRec; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_SubGlyph */ + /* */ + /* <Description> */ + /* The subglyph structure is an internal object used to describe */ + /* subglyphs (for example, in the case of composites). */ + /* */ + /* <Note> */ + /* The subglyph implementation is not part of the high-level API, */ + /* hence the forward structure declaration. */ + /* */ + /* You can however retrieve subglyph information with */ + /* @FT_Get_SubGlyph_Info. */ + /* */ + typedef struct FT_SubGlyphRec_* FT_SubGlyph; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Slot_Internal */ + /* */ + /* <Description> */ + /* An opaque handle to an `FT_Slot_InternalRec' structure, used to */ + /* model private data of a given FT_GlyphSlot object. */ + /* */ + typedef struct FT_Slot_InternalRec_* FT_Slot_Internal; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_GlyphSlotRec */ + /* */ + /* <Description> */ + /* FreeType root glyph slot class structure. A glyph slot is a */ + /* container where individual glyphs can be loaded, be they in */ + /* outline or bitmap format. */ + /* */ + /* <Fields> */ + /* library :: A handle to the FreeType library instance */ + /* this slot belongs to. */ + /* */ + /* face :: A handle to the parent face object. */ + /* */ + /* next :: In some cases (like some font tools), several */ + /* glyph slots per face object can be a good */ + /* thing. As this is rare, the glyph slots are */ + /* listed through a direct, single-linked list */ + /* using its `next' field. */ + /* */ + /* generic :: A typeless pointer which is unused by the */ + /* FreeType library or any of its drivers. It */ + /* can be used by client applications to link */ + /* their own data to each glyph slot object. */ + /* */ + /* metrics :: The metrics of the last loaded glyph in the */ + /* slot. The returned values depend on the last */ + /* load flags (see the @FT_Load_Glyph API */ + /* function) and can be expressed either in 26.6 */ + /* fractional pixels or font units. */ + /* */ + /* Note that even when the glyph image is */ + /* transformed, the metrics are not. */ + /* */ + /* linearHoriAdvance :: The advance width of the unhinted glyph. */ + /* Its value is expressed in 16.16 fractional */ + /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */ + /* when loading the glyph. This field can be */ + /* important to perform correct WYSIWYG layout. */ + /* Only relevant for outline glyphs. */ + /* */ + /* linearVertAdvance :: The advance height of the unhinted glyph. */ + /* Its value is expressed in 16.16 fractional */ + /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */ + /* when loading the glyph. This field can be */ + /* important to perform correct WYSIWYG layout. */ + /* Only relevant for outline glyphs. */ + /* */ + /* advance :: This is the transformed advance width for the */ + /* glyph. */ + /* */ + /* format :: This field indicates the format of the image */ + /* contained in the glyph slot. Typically */ + /* @FT_GLYPH_FORMAT_BITMAP, */ + /* @FT_GLYPH_FORMAT_OUTLINE, or */ + /* @FT_GLYPH_FORMAT_COMPOSITE, but others are */ + /* possible. */ + /* */ + /* bitmap :: This field is used as a bitmap descriptor */ + /* when the slot format is */ + /* @FT_GLYPH_FORMAT_BITMAP. Note that the */ + /* address and content of the bitmap buffer can */ + /* change between calls of @FT_Load_Glyph and a */ + /* few other functions. */ + /* */ + /* bitmap_left :: This is the bitmap's left bearing expressed */ + /* in integer pixels. Of course, this is only */ + /* valid if the format is */ + /* @FT_GLYPH_FORMAT_BITMAP. */ + /* */ + /* bitmap_top :: This is the bitmap's top bearing expressed in */ + /* integer pixels. Remember that this is the */ + /* distance from the baseline to the top-most */ + /* glyph scanline, upwards y-coordinates being */ + /* *positive*. */ + /* */ + /* outline :: The outline descriptor for the current glyph */ + /* image if its format is */ + /* @FT_GLYPH_FORMAT_OUTLINE. Once a glyph is */ + /* loaded, `outline' can be transformed, */ + /* distorted, embolded, etc. However, it must */ + /* not be freed. */ + /* */ + /* num_subglyphs :: The number of subglyphs in a composite glyph. */ + /* This field is only valid for the composite */ + /* glyph format that should normally only be */ + /* loaded with the @FT_LOAD_NO_RECURSE flag. */ + /* For now this is internal to FreeType. */ + /* */ + /* subglyphs :: An array of subglyph descriptors for */ + /* composite glyphs. There are `num_subglyphs' */ + /* elements in there. Currently internal to */ + /* FreeType. */ + /* */ + /* control_data :: Certain font drivers can also return the */ + /* control data for a given glyph image (e.g. */ + /* TrueType bytecode, Type 1 charstrings, etc.). */ + /* This field is a pointer to such data. */ + /* */ + /* control_len :: This is the length in bytes of the control */ + /* data. */ + /* */ + /* other :: Really wicked formats can use this pointer to */ + /* present their own glyph image to client */ + /* applications. Note that the application */ + /* needs to know about the image format. */ + /* */ + /* lsb_delta :: The difference between hinted and unhinted */ + /* left side bearing while autohinting is */ + /* active. Zero otherwise. */ + /* */ + /* rsb_delta :: The difference between hinted and unhinted */ + /* right side bearing while autohinting is */ + /* active. Zero otherwise. */ + /* */ + /* <Note> */ + /* If @FT_Load_Glyph is called with default flags (see */ + /* @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in */ + /* its native format (e.g., an outline glyph for TrueType and Type 1 */ + /* formats). */ + /* */ + /* This image can later be converted into a bitmap by calling */ + /* @FT_Render_Glyph. This function finds the current renderer for */ + /* the native image's format then invokes it. */ + /* */ + /* The renderer is in charge of transforming the native image through */ + /* the slot's face transformation fields, then convert it into a */ + /* bitmap that is returned in `slot->bitmap'. */ + /* */ + /* Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */ + /* to specify the position of the bitmap relative to the current pen */ + /* position (e.g., coordinates (0,0) on the baseline). Of course, */ + /* `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP. */ + /* */ + /* <Note> */ + /* Here a small pseudo code fragment which shows how to use */ + /* `lsb_delta' and `rsb_delta': */ + /* */ + /* { */ + /* FT_Pos origin_x = 0; */ + /* FT_Pos prev_rsb_delta = 0; */ + /* */ + /* */ + /* for all glyphs do */ + /* <compute kern between current and previous glyph and add it to */ + /* `origin_x'> */ + /* */ + /* <load glyph with `FT_Load_Glyph'> */ + /* */ + /* if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 ) */ + /* origin_x -= 64; */ + /* else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 ) */ + /* origin_x += 64; */ + /* */ + /* prev_rsb_delta = face->glyph->rsb_delta; */ + /* */ + /* <save glyph image, or render glyph, or ...> */ + /* */ + /* origin_x += face->glyph->advance.x; */ + /* endfor */ + /* } */ + /* */ + typedef struct FT_GlyphSlotRec_ + { + FT_Library library; + FT_Face face; + FT_GlyphSlot next; + FT_UInt reserved; /* retained for binary compatibility */ + FT_Generic generic; + + FT_Glyph_Metrics metrics; + FT_Fixed linearHoriAdvance; + FT_Fixed linearVertAdvance; + FT_Vector advance; + + FT_Glyph_Format format; + + FT_Bitmap bitmap; + FT_Int bitmap_left; + FT_Int bitmap_top; + + FT_Outline outline; + + FT_UInt num_subglyphs; + FT_SubGlyph subglyphs; + + void* control_data; + long control_len; + + FT_Pos lsb_delta; + FT_Pos rsb_delta; + + void* other; + + FT_Slot_Internal internal; + + } FT_GlyphSlotRec; + + + /*************************************************************************/ + /*************************************************************************/ + /* */ + /* F U N C T I O N S */ + /* */ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Init_FreeType */ + /* */ + /* <Description> */ + /* Initialize a new FreeType library object. The set of modules */ + /* that are registered by this function is determined at build time. */ + /* */ + /* <Output> */ + /* alibrary :: A handle to a new library object. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Init_FreeType( FT_Library *alibrary ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Done_FreeType */ + /* */ + /* <Description> */ + /* Destroy a given FreeType library object and all of its children, */ + /* including resources, drivers, faces, sizes, etc. */ + /* */ + /* <Input> */ + /* library :: A handle to the target library object. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Done_FreeType( FT_Library library ); + + + /*************************************************************************/ + /* */ + /* <Enum> */ + /* FT_OPEN_XXX */ + /* */ + /* <Description> */ + /* A list of bit-field constants used within the `flags' field of the */ + /* @FT_Open_Args structure. */ + /* */ + /* <Values> */ + /* FT_OPEN_MEMORY :: This is a memory-based stream. */ + /* */ + /* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */ + /* */ + /* FT_OPEN_PATHNAME :: Create a new input stream from a C */ + /* path name. */ + /* */ + /* FT_OPEN_DRIVER :: Use the `driver' field. */ + /* */ + /* FT_OPEN_PARAMS :: Use the `num_params' and `params' fields. */ + /* */ + /* ft_open_memory :: Deprecated; use @FT_OPEN_MEMORY instead. */ + /* */ + /* ft_open_stream :: Deprecated; use @FT_OPEN_STREAM instead. */ + /* */ + /* ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead. */ + /* */ + /* ft_open_driver :: Deprecated; use @FT_OPEN_DRIVER instead. */ + /* */ + /* ft_open_params :: Deprecated; use @FT_OPEN_PARAMS instead. */ + /* */ + /* <Note> */ + /* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */ + /* flags are mutually exclusive. */ + /* */ +#define FT_OPEN_MEMORY 0x1 +#define FT_OPEN_STREAM 0x2 +#define FT_OPEN_PATHNAME 0x4 +#define FT_OPEN_DRIVER 0x8 +#define FT_OPEN_PARAMS 0x10 + +#define ft_open_memory FT_OPEN_MEMORY /* deprecated */ +#define ft_open_stream FT_OPEN_STREAM /* deprecated */ +#define ft_open_pathname FT_OPEN_PATHNAME /* deprecated */ +#define ft_open_driver FT_OPEN_DRIVER /* deprecated */ +#define ft_open_params FT_OPEN_PARAMS /* deprecated */ + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_Parameter */ + /* */ + /* <Description> */ + /* A simple structure used to pass more or less generic parameters */ + /* to @FT_Open_Face. */ + /* */ + /* <Fields> */ + /* tag :: A four-byte identification tag. */ + /* */ + /* data :: A pointer to the parameter data. */ + /* */ + /* <Note> */ + /* The ID and function of parameters are driver-specific. */ + /* */ + typedef struct FT_Parameter_ + { + FT_ULong tag; + FT_Pointer data; + + } FT_Parameter; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_Open_Args */ + /* */ + /* <Description> */ + /* A structure used to indicate how to open a new font file or */ + /* stream. A pointer to such a structure can be used as a parameter */ + /* for the functions @FT_Open_Face and @FT_Attach_Stream. */ + /* */ + /* <Fields> */ + /* flags :: A set of bit flags indicating how to use the */ + /* structure. */ + /* */ + /* memory_base :: The first byte of the file in memory. */ + /* */ + /* memory_size :: The size in bytes of the file in memory. */ + /* */ + /* pathname :: A pointer to an 8-bit file pathname. */ + /* */ + /* stream :: A handle to a source stream object. */ + /* */ + /* driver :: This field is exclusively used by @FT_Open_Face; */ + /* it simply specifies the font driver to use to open */ + /* the face. If set to 0, FreeType tries to load the */ + /* face with each one of the drivers in its list. */ + /* */ + /* num_params :: The number of extra parameters. */ + /* */ + /* params :: Extra parameters passed to the font driver when */ + /* opening a new face. */ + /* */ + /* <Note> */ + /* The stream type is determined by the contents of `flags' which */ + /* are tested in the following order by @FT_Open_Face: */ + /* */ + /* If the `FT_OPEN_MEMORY' bit is set, assume that this is a */ + /* memory file of `memory_size' bytes, located at `memory_address'. */ + /* The data are are not copied, and the client is responsible for */ + /* releasing and destroying them _after_ the corresponding call to */ + /* @FT_Done_Face. */ + /* */ + /* Otherwise, if the `FT_OPEN_STREAM' bit is set, assume that a */ + /* custom input stream `stream' is used. */ + /* */ + /* Otherwise, if the `FT_OPEN_PATHNAME' bit is set, assume that this */ + /* is a normal file and use `pathname' to open it. */ + /* */ + /* If the `FT_OPEN_DRIVER' bit is set, @FT_Open_Face only tries to */ + /* open the file with the driver whose handler is in `driver'. */ + /* */ + /* If the `FT_OPEN_PARAMS' bit is set, the parameters given by */ + /* `num_params' and `params' is used. They are ignored otherwise. */ + /* */ + /* Ideally, both the `pathname' and `params' fields should be tagged */ + /* as `const'; this is missing for API backwards compatibility. With */ + /* other words, applications should treat them as read-only. */ + /* */ + typedef struct FT_Open_Args_ + { + FT_UInt flags; + const FT_Byte* memory_base; + FT_Long memory_size; + FT_String* pathname; + FT_Stream stream; + FT_Module driver; + FT_Int num_params; + FT_Parameter* params; + + } FT_Open_Args; + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_New_Face */ + /* */ + /* <Description> */ + /* This function calls @FT_Open_Face to open a font by its pathname. */ + /* */ + /* <InOut> */ + /* library :: A handle to the library resource. */ + /* */ + /* <Input> */ + /* pathname :: A path to the font file. */ + /* */ + /* face_index :: The index of the face within the font. The first */ + /* face has index 0. */ + /* */ + /* <Output> */ + /* aface :: A handle to a new face object. If `face_index' is */ + /* greater than or equal to zero, it must be non-NULL. */ + /* See @FT_Open_Face for more details. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_New_Face( FT_Library library, + const char* filepathname, + FT_Long face_index, + FT_Face *aface ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_New_Memory_Face */ + /* */ + /* <Description> */ + /* This function calls @FT_Open_Face to open a font which has been */ + /* loaded into memory. */ + /* */ + /* <InOut> */ + /* library :: A handle to the library resource. */ + /* */ + /* <Input> */ + /* file_base :: A pointer to the beginning of the font data. */ + /* */ + /* file_size :: The size of the memory chunk used by the font data. */ + /* */ + /* face_index :: The index of the face within the font. The first */ + /* face has index 0. */ + /* */ + /* <Output> */ + /* aface :: A handle to a new face object. If `face_index' is */ + /* greater than or equal to zero, it must be non-NULL. */ + /* See @FT_Open_Face for more details. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* You must not deallocate the memory before calling @FT_Done_Face. */ + /* */ + FT_EXPORT( FT_Error ) + FT_New_Memory_Face( FT_Library library, + const FT_Byte* file_base, + FT_Long file_size, + FT_Long face_index, + FT_Face *aface ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Open_Face */ + /* */ + /* <Description> */ + /* Create a face object from a given resource described by */ + /* @FT_Open_Args. */ + /* */ + /* <InOut> */ + /* library :: A handle to the library resource. */ + /* */ + /* <Input> */ + /* args :: A pointer to an `FT_Open_Args' structure which must */ + /* be filled by the caller. */ + /* */ + /* face_index :: The index of the face within the font. The first */ + /* face has index 0. */ + /* */ + /* <Output> */ + /* aface :: A handle to a new face object. If `face_index' is */ + /* greater than or equal to zero, it must be non-NULL. */ + /* See note below. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* Unlike FreeType 1.x, this function automatically creates a glyph */ + /* slot for the face object which can be accessed directly through */ + /* `face->glyph'. */ + /* */ + /* FT_Open_Face can be used to quickly check whether the font */ + /* format of a given font resource is supported by FreeType. If the */ + /* `face_index' field is negative, the function's return value is 0 */ + /* if the font format is recognized, or non-zero otherwise; */ + /* the function returns a more or less empty face handle in `*aface' */ + /* (if `aface' isn't NULL). The only useful field in this special */ + /* case is `face->num_faces' which gives the number of faces within */ + /* the font file. After examination, the returned @FT_Face structure */ + /* should be deallocated with a call to @FT_Done_Face. */ + /* */ + /* Each new face object created with this function also owns a */ + /* default @FT_Size object, accessible as `face->size'. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Open_Face( FT_Library library, + const FT_Open_Args* args, + FT_Long face_index, + FT_Face *aface ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Attach_File */ + /* */ + /* <Description> */ + /* This function calls @FT_Attach_Stream to attach a file. */ + /* */ + /* <InOut> */ + /* face :: The target face object. */ + /* */ + /* <Input> */ + /* filepathname :: The pathname. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Attach_File( FT_Face face, + const char* filepathname ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Attach_Stream */ + /* */ + /* <Description> */ + /* `Attach' data to a face object. Normally, this is used to read */ + /* additional information for the face object. For example, you can */ + /* attach an AFM file that comes with a Type 1 font to get the */ + /* kerning values and other metrics. */ + /* */ + /* <InOut> */ + /* face :: The target face object. */ + /* */ + /* <Input> */ + /* parameters :: A pointer to @FT_Open_Args which must be filled by */ + /* the caller. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* The meaning of the `attach' (i.e., what really happens when the */ + /* new file is read) is not fixed by FreeType itself. It really */ + /* depends on the font format (and thus the font driver). */ + /* */ + /* Client applications are expected to know what they are doing */ + /* when invoking this function. Most drivers simply do not implement */ + /* file attachments. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Attach_Stream( FT_Face face, + FT_Open_Args* parameters ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Done_Face */ + /* */ + /* <Description> */ + /* Discard a given face object, as well as all of its child slots and */ + /* sizes. */ + /* */ + /* <Input> */ + /* face :: A handle to a target face object. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Done_Face( FT_Face face ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Select_Size */ + /* */ + /* <Description> */ + /* Select a bitmap strike. */ + /* */ + /* <InOut> */ + /* face :: A handle to a target face object. */ + /* */ + /* <Input> */ + /* strike_index :: The index of the bitmap strike in the */ + /* `available_sizes' field of @FT_FaceRec structure. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Select_Size( FT_Face face, + FT_Int strike_index ); + + + /*************************************************************************/ + /* */ + /* <Enum> */ + /* FT_Size_Request_Type */ + /* */ + /* <Description> */ + /* An enumeration type that lists the supported size request types. */ + /* */ + /* <Values> */ + /* FT_SIZE_REQUEST_TYPE_NOMINAL :: */ + /* The nominal size. The `units_per_EM' field of @FT_FaceRec is */ + /* used to determine both scaling values. */ + /* */ + /* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */ + /* The real dimension. The sum of the the `Ascender' and (minus */ + /* of) the `Descender' fields of @FT_FaceRec are used to determine */ + /* both scaling values. */ + /* */ + /* FT_SIZE_REQUEST_TYPE_BBOX :: */ + /* The font bounding box. The width and height of the `bbox' field */ + /* of @FT_FaceRec are used to determine the horizontal and vertical */ + /* scaling value, respectively. */ + /* */ + /* FT_SIZE_REQUEST_TYPE_CELL :: */ + /* The `max_advance_width' field of @FT_FaceRec is used to */ + /* determine the horizontal scaling value; the vertical scaling */ + /* value is determined the same way as */ + /* @FT_SIZE_REQUEST_TYPE_REAL_DIM does. Finally, both scaling */ + /* values are set to the smaller one. This type is useful if you */ + /* want to specify the font size for, say, a window of a given */ + /* dimension and 80x24 cells. */ + /* */ + /* FT_SIZE_REQUEST_TYPE_SCALES :: */ + /* Specify the scaling values directly. */ + /* */ + /* <Note> */ + /* The above descriptions only apply to scalable formats. For bitmap */ + /* formats, the behaviour is up to the driver. */ + /* */ + /* See the note section of @FT_Size_Metrics if you wonder how size */ + /* requesting relates to scaling values. */ + /* */ + typedef enum FT_Size_Request_Type_ + { + FT_SIZE_REQUEST_TYPE_NOMINAL, + FT_SIZE_REQUEST_TYPE_REAL_DIM, + FT_SIZE_REQUEST_TYPE_BBOX, + FT_SIZE_REQUEST_TYPE_CELL, + FT_SIZE_REQUEST_TYPE_SCALES, + + FT_SIZE_REQUEST_TYPE_MAX + + } FT_Size_Request_Type; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_Size_RequestRec */ + /* */ + /* <Description> */ + /* A structure used to model a size request. */ + /* */ + /* <Fields> */ + /* type :: See @FT_Size_Request_Type. */ + /* */ + /* width :: The desired width. */ + /* */ + /* height :: The desired height. */ + /* */ + /* horiResolution :: The horizontal resolution. If set to zero, */ + /* `width' is treated as a 26.6 fractional pixel */ + /* value. */ + /* */ + /* vertResolution :: The vertical resolution. If set to zero, */ + /* `height' is treated as a 26.6 fractional pixel */ + /* value. */ + /* */ + /* <Note> */ + /* If `width' is zero, then the horizontal scaling value is set */ + /* equal to the vertical scaling value, and vice versa. */ + /* */ + typedef struct FT_Size_RequestRec_ + { + FT_Size_Request_Type type; + FT_Long width; + FT_Long height; + FT_UInt horiResolution; + FT_UInt vertResolution; + + } FT_Size_RequestRec, *FT_Size_Request; + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Request_Size */ + /* */ + /* <Description> */ + /* Resize the scale of the active @FT_Size object in a face. */ + /* */ + /* <InOut> */ + /* face :: A handle to a target face object. */ + /* */ + /* <Input> */ + /* req :: A pointer to a @FT_Size_RequestRec. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* Although drivers may select the bitmap strike matching the */ + /* request, you should not rely on this if you intend to select a */ + /* particular bitmap strike. Use @FT_Select_Size instead in that */ + /* case. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Request_Size( FT_Face face, + FT_Size_Request req ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Set_Char_Size */ + /* */ + /* <Description> */ + /* This function calls @FT_Request_Size to request the nominal size */ + /* (in points). */ + /* */ + /* <InOut> */ + /* face :: A handle to a target face object. */ + /* */ + /* <Input> */ + /* char_width :: The nominal width, in 26.6 fractional points. */ + /* */ + /* char_height :: The nominal height, in 26.6 fractional points. */ + /* */ + /* horz_resolution :: The horizontal resolution in dpi. */ + /* */ + /* vert_resolution :: The vertical resolution in dpi. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* If either the character width or height is zero, it is set equal */ + /* to the other value. */ + /* */ + /* If either the horizontal or vertical resolution is zero, it is set */ + /* equal to the other value. */ + /* */ + /* A character width or height smaller than 1pt is set to 1pt; if */ + /* both resolution values are zero, they are set to 72dpi. */ + /* */ + + FT_EXPORT( FT_Error ) + FT_Set_Char_Size( FT_Face face, + FT_F26Dot6 char_width, + FT_F26Dot6 char_height, + FT_UInt horz_resolution, + FT_UInt vert_resolution ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Set_Pixel_Sizes */ + /* */ + /* <Description> */ + /* This function calls @FT_Request_Size to request the nominal size */ + /* (in pixels). */ + /* */ + /* <InOut> */ + /* face :: A handle to the target face object. */ + /* */ + /* <Input> */ + /* pixel_width :: The nominal width, in pixels. */ + /* */ + /* pixel_height :: The nominal height, in pixels. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Set_Pixel_Sizes( FT_Face face, + FT_UInt pixel_width, + FT_UInt pixel_height ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Load_Glyph */ + /* */ + /* <Description> */ + /* A function used to load a single glyph into the glyph slot of a */ + /* face object. */ + /* */ + /* <InOut> */ + /* face :: A handle to the target face object where the glyph */ + /* is loaded. */ + /* */ + /* <Input> */ + /* glyph_index :: The index of the glyph in the font file. For */ + /* CID-keyed fonts (either in PS or in CFF format) */ + /* this argument specifies the CID value. */ + /* */ + /* load_flags :: A flag indicating what to load for this glyph. The */ + /* @FT_LOAD_XXX constants can be used to control the */ + /* glyph loading process (e.g., whether the outline */ + /* should be scaled, whether to load bitmaps or not, */ + /* whether to hint the outline, etc). */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* The loaded glyph may be transformed. See @FT_Set_Transform for */ + /* the details. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Load_Glyph( FT_Face face, + FT_UInt glyph_index, + FT_Int32 load_flags ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Load_Char */ + /* */ + /* <Description> */ + /* A function used to load a single glyph into the glyph slot of a */ + /* face object, according to its character code. */ + /* */ + /* <InOut> */ + /* face :: A handle to a target face object where the glyph */ + /* is loaded. */ + /* */ + /* <Input> */ + /* char_code :: The glyph's character code, according to the */ + /* current charmap used in the face. */ + /* */ + /* load_flags :: A flag indicating what to load for this glyph. The */ + /* @FT_LOAD_XXX constants can be used to control the */ + /* glyph loading process (e.g., whether the outline */ + /* should be scaled, whether to load bitmaps or not, */ + /* whether to hint the outline, etc). */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Load_Char( FT_Face face, + FT_ULong char_code, + FT_Int32 load_flags ); + + + /************************************************************************* + * + * @enum: + * FT_LOAD_XXX + * + * @description: + * A list of bit-field constants used with @FT_Load_Glyph to indicate + * what kind of operations to perform during glyph loading. + * + * @values: + * FT_LOAD_DEFAULT :: + * Corresponding to 0, this value is used as the default glyph load + * operation. In this case, the following happens: + * + * 1. FreeType looks for a bitmap for the glyph corresponding to the + * face's current size. If one is found, the function returns. + * The bitmap data can be accessed from the glyph slot (see note + * below). + * + * 2. If no embedded bitmap is searched or found, FreeType looks for a + * scalable outline. If one is found, it is loaded from the font + * file, scaled to device pixels, then `hinted' to the pixel grid + * in order to optimize it. The outline data can be accessed from + * the glyph slot (see note below). + * + * Note that by default, the glyph loader doesn't render outlines into + * bitmaps. The following flags are used to modify this default + * behaviour to more specific and useful cases. + * + * FT_LOAD_NO_SCALE :: + * Don't scale the outline glyph loaded, but keep it in font units. + * + * This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and + * unsets @FT_LOAD_RENDER. + * + * FT_LOAD_NO_HINTING :: + * Disable hinting. This generally generates `blurrier' bitmap glyph + * when the glyph is rendered in any of the anti-aliased modes. See + * also the note below. + * + * This flag is implied by @FT_LOAD_NO_SCALE. + * + * FT_LOAD_RENDER :: + * Call @FT_Render_Glyph after the glyph is loaded. By default, the + * glyph is rendered in @FT_RENDER_MODE_NORMAL mode. This can be + * overridden by @FT_LOAD_TARGET_XXX or @FT_LOAD_MONOCHROME. + * + * This flag is unset by @FT_LOAD_NO_SCALE. + * + * FT_LOAD_NO_BITMAP :: + * Ignore bitmap strikes when loading. Bitmap-only fonts ignore this + * flag. + * + * @FT_LOAD_NO_SCALE always sets this flag. + * + * FT_LOAD_VERTICAL_LAYOUT :: + * Load the glyph for vertical text layout. _Don't_ use it as it is + * problematic currently. + * + * FT_LOAD_FORCE_AUTOHINT :: + * Indicates that the auto-hinter is preferred over the font's native + * hinter. See also the note below. + * + * FT_LOAD_CROP_BITMAP :: + * Indicates that the font driver should crop the loaded bitmap glyph + * (i.e., remove all space around its black bits). Not all drivers + * implement this. + * + * FT_LOAD_PEDANTIC :: + * Indicates that the font driver should perform pedantic verifications + * during glyph loading. This is mostly used to detect broken glyphs + * in fonts. By default, FreeType tries to handle broken fonts also. + * + * FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH :: + * Indicates that the font driver should ignore the global advance + * width defined in the font. By default, that value is used as the + * advance width for all glyphs when the face has + * @FT_FACE_FLAG_FIXED_WIDTH set. + * + * This flag exists for historical reasons (to support buggy CJK + * fonts). + * + * FT_LOAD_NO_RECURSE :: + * This flag is only used internally. It merely indicates that the + * font driver should not load composite glyphs recursively. Instead, + * it should set the `num_subglyph' and `subglyphs' values of the + * glyph slot accordingly, and set `glyph->format' to + * @FT_GLYPH_FORMAT_COMPOSITE. + * + * The description of sub-glyphs is not available to client + * applications for now. + * + * This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM. + * + * FT_LOAD_IGNORE_TRANSFORM :: + * Indicates that the transform matrix set by @FT_Set_Transform should + * be ignored. + * + * FT_LOAD_MONOCHROME :: + * This flag is used with @FT_LOAD_RENDER to indicate that you want to + * render an outline glyph to a 1-bit monochrome bitmap glyph, with + * 8 pixels packed into each byte of the bitmap data. + * + * Note that this has no effect on the hinting algorithm used. You + * should use @FT_LOAD_TARGET_MONO instead so that the + * monochrome-optimized hinting algorithm is used. + * + * FT_LOAD_LINEAR_DESIGN :: + * Indicates that the `linearHoriAdvance' and `linearVertAdvance' + * fields of @FT_GlyphSlotRec should be kept in font units. See + * @FT_GlyphSlotRec for details. + * + * FT_LOAD_NO_AUTOHINT :: + * Disable auto-hinter. See also the note below. + * + * @note: + * By default, hinting is enabled and the font's native hinter (see + * @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter. You can + * disable hinting by setting @FT_LOAD_NO_HINTING or change the + * precedence by setting @FT_LOAD_FORCE_AUTOHINT. You can also set + * @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be + * used at all. + * + * Besides deciding which hinter to use, you can also decide which + * hinting algorithm to use. See @FT_LOAD_TARGET_XXX for details. + */ +#define FT_LOAD_DEFAULT 0x0 +#define FT_LOAD_NO_SCALE 0x1 +#define FT_LOAD_NO_HINTING 0x2 +#define FT_LOAD_RENDER 0x4 +#define FT_LOAD_NO_BITMAP 0x8 +#define FT_LOAD_VERTICAL_LAYOUT 0x10 +#define FT_LOAD_FORCE_AUTOHINT 0x20 +#define FT_LOAD_CROP_BITMAP 0x40 +#define FT_LOAD_PEDANTIC 0x80 +#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH 0x200 +#define FT_LOAD_NO_RECURSE 0x400 +#define FT_LOAD_IGNORE_TRANSFORM 0x800 +#define FT_LOAD_MONOCHROME 0x1000 +#define FT_LOAD_LINEAR_DESIGN 0x2000 + + /* temporary hack! */ +#define FT_LOAD_SBITS_ONLY 0x4000 +#define FT_LOAD_NO_AUTOHINT 0x8000U + + /* */ + + + /************************************************************************** + * + * @enum: + * FT_LOAD_TARGET_XXX + * + * @description: + * A list of values that are used to select a specific hinting algorithm + * to use by the hinter. You should OR one of these values to your + * `load_flags' when calling @FT_Load_Glyph. + * + * Note that font's native hinters may ignore the hinting algorithm you + * have specified (e.g., the TrueType bytecode interpreter). You can set + * @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used. + * + * Also note that @FT_LOAD_TARGET_LIGHT is an exception, in that it + * always implies @FT_LOAD_FORCE_AUTOHINT. + * + * @values: + * FT_LOAD_TARGET_NORMAL :: + * This corresponds to the default hinting algorithm, optimized for + * standard gray-level rendering. For monochrome output, use + * @FT_LOAD_TARGET_MONO instead. + * + * FT_LOAD_TARGET_LIGHT :: + * A lighter hinting algorithm for non-monochrome modes. Many + * generated glyphs are more fuzzy but better resemble its original + * shape. A bit like rendering on Mac OS X. + * + * As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT. + * + * FT_LOAD_TARGET_MONO :: + * Strong hinting algorithm that should only be used for monochrome + * output. The result is probably unpleasant if the glyph is rendered + * in non-monochrome modes. + * + * FT_LOAD_TARGET_LCD :: + * A variant of @FT_LOAD_TARGET_NORMAL optimized for horizontally + * decimated LCD displays. + * + * FT_LOAD_TARGET_LCD_V :: + * A variant of @FT_LOAD_TARGET_NORMAL optimized for vertically + * decimated LCD displays. + * + * @note: + * You should use only _one_ of the FT_LOAD_TARGET_XXX values in your + * `load_flags'. They can't be ORed. + * + * If @FT_LOAD_RENDER is also set, the glyph is rendered in the + * corresponding mode (i.e., the mode which matches the used algorithm + * best) unless @FT_LOAD_MONOCHROME is set. + * + * You can use a hinting algorithm that doesn't correspond to the same + * rendering mode. As an example, it is possible to use the `light' + * hinting algorithm and have the results rendered in horizontal LCD + * pixel mode, with code like + * + * { + * FT_Load_Glyph( face, glyph_index, + * load_flags | FT_LOAD_TARGET_LIGHT ); + * + * FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD ); + * } + */ + +#define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 ) + +#define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL ) +#define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT ) +#define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO ) +#define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD ) +#define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V ) + + + /* + * @macro: + * FT_LOAD_TARGET_MODE + * + * @description: + * Return the @FT_Render_Mode corresponding to a given + * @FT_LOAD_TARGET_XXX value. + */ + +#define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) ) + + /* */ + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Set_Transform */ + /* */ + /* <Description> */ + /* A function used to set the transformation that is applied to glyph */ + /* images when they are loaded into a glyph slot through */ + /* @FT_Load_Glyph. */ + /* */ + /* <InOut> */ + /* face :: A handle to the source face object. */ + /* */ + /* <Input> */ + /* matrix :: A pointer to the transformation's 2x2 matrix. Use 0 for */ + /* the identity matrix. */ + /* delta :: A pointer to the translation vector. Use 0 for the null */ + /* vector. */ + /* */ + /* <Note> */ + /* The transformation is only applied to scalable image formats after */ + /* the glyph has been loaded. It means that hinting is unaltered by */ + /* the transformation and is performed on the character size given in */ + /* the last call to @FT_Set_Char_Size or @FT_Set_Pixel_Sizes. */ + /* */ + /* Note that this also transforms the `face.glyph.advance' field, but */ + /* *not* the values in `face.glyph.metrics'. */ + /* */ + FT_EXPORT( void ) + FT_Set_Transform( FT_Face face, + FT_Matrix* matrix, + FT_Vector* delta ); + + + /*************************************************************************/ + /* */ + /* <Enum> */ + /* FT_Render_Mode */ + /* */ + /* <Description> */ + /* An enumeration type that lists the render modes supported by */ + /* FreeType 2. Each mode corresponds to a specific type of scanline */ + /* conversion performed on the outline. */ + /* */ + /* For bitmap fonts the `bitmap->pixel_mode' field in the */ + /* @FT_GlyphSlotRec structure gives the format of the returned */ + /* bitmap. */ + /* */ + /* <Values> */ + /* FT_RENDER_MODE_NORMAL :: */ + /* This is the default render mode; it corresponds to 8-bit */ + /* anti-aliased bitmaps, using 256 levels of opacity. */ + /* */ + /* FT_RENDER_MODE_LIGHT :: */ + /* This is equivalent to @FT_RENDER_MODE_NORMAL. It is only */ + /* defined as a separate value because render modes are also used */ + /* indirectly to define hinting algorithm selectors. See */ + /* @FT_LOAD_TARGET_XXX for details. */ + /* */ + /* FT_RENDER_MODE_MONO :: */ + /* This mode corresponds to 1-bit bitmaps. */ + /* */ + /* FT_RENDER_MODE_LCD :: */ + /* This mode corresponds to horizontal RGB and BGR sub-pixel */ + /* displays, like LCD-screens. It produces 8-bit bitmaps that are */ + /* 3 times the width of the original glyph outline in pixels, and */ + /* which use the @FT_PIXEL_MODE_LCD mode. */ + /* */ + /* FT_RENDER_MODE_LCD_V :: */ + /* This mode corresponds to vertical RGB and BGR sub-pixel displays */ + /* (like PDA screens, rotated LCD displays, etc.). It produces */ + /* 8-bit bitmaps that are 3 times the height of the original */ + /* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */ + /* */ + /* <Note> */ + /* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph are */ + /* _not_ _filtered_ to reduce color-fringes. It is up to the caller */ + /* to perform this pass. */ + /* */ + typedef enum FT_Render_Mode_ + { + FT_RENDER_MODE_NORMAL = 0, + FT_RENDER_MODE_LIGHT, + FT_RENDER_MODE_MONO, + FT_RENDER_MODE_LCD, + FT_RENDER_MODE_LCD_V, + + FT_RENDER_MODE_MAX + + } FT_Render_Mode; + + + /*************************************************************************/ + /* */ + /* <Enum> */ + /* ft_render_mode_xxx */ + /* */ + /* <Description> */ + /* These constants are deprecated. Use the corresponding */ + /* @FT_Render_Mode values instead. */ + /* */ + /* <Values> */ + /* ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL */ + /* ft_render_mode_mono :: see @FT_RENDER_MODE_MONO */ + /* */ +#define ft_render_mode_normal FT_RENDER_MODE_NORMAL +#define ft_render_mode_mono FT_RENDER_MODE_MONO + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Render_Glyph */ + /* */ + /* <Description> */ + /* Convert a given glyph image to a bitmap. It does so by inspecting */ + /* the glyph image format, finding the relevant renderer, and */ + /* invoking it. */ + /* */ + /* <InOut> */ + /* slot :: A handle to the glyph slot containing the image to */ + /* convert. */ + /* */ + /* <Input> */ + /* render_mode :: This is the render mode used to render the glyph */ + /* image into a bitmap. See @FT_Render_Mode for a */ + /* list of possible values. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Render_Glyph( FT_GlyphSlot slot, + FT_Render_Mode render_mode ); + + + /*************************************************************************/ + /* */ + /* <Enum> */ + /* FT_Kerning_Mode */ + /* */ + /* <Description> */ + /* An enumeration used to specify which kerning values to return in */ + /* @FT_Get_Kerning. */ + /* */ + /* <Values> */ + /* FT_KERNING_DEFAULT :: Return scaled and grid-fitted kerning */ + /* distances (value is 0). */ + /* */ + /* FT_KERNING_UNFITTED :: Return scaled but un-grid-fitted kerning */ + /* distances. */ + /* */ + /* FT_KERNING_UNSCALED :: Return the kerning vector in original font */ + /* units. */ + /* */ + typedef enum FT_Kerning_Mode_ + { + FT_KERNING_DEFAULT = 0, + FT_KERNING_UNFITTED, + FT_KERNING_UNSCALED + + } FT_Kerning_Mode; + + + /*************************************************************************/ + /* */ + /* <Const> */ + /* ft_kerning_default */ + /* */ + /* <Description> */ + /* This constant is deprecated. Please use @FT_KERNING_DEFAULT */ + /* instead. */ + /* */ +#define ft_kerning_default FT_KERNING_DEFAULT + + + /*************************************************************************/ + /* */ + /* <Const> */ + /* ft_kerning_unfitted */ + /* */ + /* <Description> */ + /* This constant is deprecated. Please use @FT_KERNING_UNFITTED */ + /* instead. */ + /* */ +#define ft_kerning_unfitted FT_KERNING_UNFITTED + + + /*************************************************************************/ + /* */ + /* <Const> */ + /* ft_kerning_unscaled */ + /* */ + /* <Description> */ + /* This constant is deprecated. Please use @FT_KERNING_UNSCALED */ + /* instead. */ + /* */ +#define ft_kerning_unscaled FT_KERNING_UNSCALED + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Get_Kerning */ + /* */ + /* <Description> */ + /* Return the kerning vector between two glyphs of a same face. */ + /* */ + /* <Input> */ + /* face :: A handle to a source face object. */ + /* */ + /* left_glyph :: The index of the left glyph in the kern pair. */ + /* */ + /* right_glyph :: The index of the right glyph in the kern pair. */ + /* */ + /* kern_mode :: See @FT_Kerning_Mode for more information. */ + /* Determines the scale and dimension of the returned */ + /* kerning vector. */ + /* */ + /* <Output> */ + /* akerning :: The kerning vector. This is either in font units */ + /* or in pixels (26.6 format) for scalable formats, */ + /* and in pixels for fixed-sizes formats. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* Only horizontal layouts (left-to-right & right-to-left) are */ + /* supported by this method. Other layouts, or more sophisticated */ + /* kernings, are out of the scope of this API function -- they can be */ + /* implemented through format-specific interfaces. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Get_Kerning( FT_Face face, + FT_UInt left_glyph, + FT_UInt right_glyph, + FT_UInt kern_mode, + FT_Vector *akerning ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Get_Track_Kerning */ + /* */ + /* <Description> */ + /* Return the track kerning for a given face object at a given size. */ + /* */ + /* <Input> */ + /* face :: A handle to a source face object. */ + /* */ + /* point_size :: The point size in 16.16 fractional points. */ + /* */ + /* degree :: The degree of tightness. */ + /* */ + /* <Output> */ + /* akerning :: The kerning in 16.16 fractional points. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Get_Track_Kerning( FT_Face face, + FT_Fixed point_size, + FT_Int degree, + FT_Fixed* akerning ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Get_Glyph_Name */ + /* */ + /* <Description> */ + /* Retrieve the ASCII name of a given glyph in a face. This only */ + /* works for those faces where @FT_HAS_GLYPH_NAMES(face) returns 1. */ + /* */ + /* <Input> */ + /* face :: A handle to a source face object. */ + /* */ + /* glyph_index :: The glyph index. */ + /* */ + /* buffer_max :: The maximal number of bytes available in the */ + /* buffer. */ + /* */ + /* <Output> */ + /* buffer :: A pointer to a target buffer where the name is */ + /* copied to. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* An error is returned if the face doesn't provide glyph names or if */ + /* the glyph index is invalid. In all cases of failure, the first */ + /* byte of `buffer' is set to 0 to indicate an empty name. */ + /* */ + /* The glyph name is truncated to fit within the buffer if it is too */ + /* long. The returned string is always zero-terminated. */ + /* */ + /* This function is not compiled within the library if the config */ + /* macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in */ + /* `include/freetype/config/ftoptions.h'. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Get_Glyph_Name( FT_Face face, + FT_UInt glyph_index, + FT_Pointer buffer, + FT_UInt buffer_max ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Get_Postscript_Name */ + /* */ + /* <Description> */ + /* Retrieve the ASCII Postscript name of a given face, if available. */ + /* This only works with Postscript and TrueType fonts. */ + /* */ + /* <Input> */ + /* face :: A handle to the source face object. */ + /* */ + /* <Return> */ + /* A pointer to the face's Postscript name. NULL if unavailable. */ + /* */ + /* <Note> */ + /* The returned pointer is owned by the face and is destroyed with */ + /* it. */ + /* */ + FT_EXPORT( const char* ) + FT_Get_Postscript_Name( FT_Face face ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Select_Charmap */ + /* */ + /* <Description> */ + /* Select a given charmap by its encoding tag (as listed in */ + /* `freetype.h'). */ + /* */ + /* <InOut> */ + /* face :: A handle to the source face object. */ + /* */ + /* <Input> */ + /* encoding :: A handle to the selected encoding. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* This function returns an error if no charmap in the face */ + /* corresponds to the encoding queried here. */ + /* */ + /* Because many fonts contain more than a single cmap for Unicode */ + /* encoding, this function has some special code to select the one */ + /* which covers Unicode best. It is thus preferable to */ + /* @FT_Set_Charmap in this case. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Select_Charmap( FT_Face face, + FT_Encoding encoding ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Set_Charmap */ + /* */ + /* <Description> */ + /* Select a given charmap for character code to glyph index mapping. */ + /* */ + /* <InOut> */ + /* face :: A handle to the source face object. */ + /* */ + /* <Input> */ + /* charmap :: A handle to the selected charmap. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* This function returns an error if the charmap is not part of */ + /* the face (i.e., if it is not listed in the `face->charmaps' */ + /* table). */ + /* */ + FT_EXPORT( FT_Error ) + FT_Set_Charmap( FT_Face face, + FT_CharMap charmap ); + + + /************************************************************************* + * + * @function: + * FT_Get_Charmap_Index + * + * @description: + * Retrieve index of a given charmap. + * + * @input: + * charmap :: + * A handle to a charmap. + * + * @return: + * The index into the array of character maps within the face to which + * `charmap' belongs. + * + */ + FT_EXPORT( FT_Int ) + FT_Get_Charmap_Index( FT_CharMap charmap ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Get_Char_Index */ + /* */ + /* <Description> */ + /* Return the glyph index of a given character code. This function */ + /* uses a charmap object to do the mapping. */ + /* */ + /* <Input> */ + /* face :: A handle to the source face object. */ + /* */ + /* charcode :: The character code. */ + /* */ + /* <Return> */ + /* The glyph index. 0 means `undefined character code'. */ + /* */ + /* <Note> */ + /* If you use FreeType to manipulate the contents of font files */ + /* directly, be aware that the glyph index returned by this function */ + /* doesn't always correspond to the internal indices used within */ + /* the file. This is done to ensure that value 0 always corresponds */ + /* to the `missing glyph'. */ + /* */ + FT_EXPORT( FT_UInt ) + FT_Get_Char_Index( FT_Face face, + FT_ULong charcode ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Get_First_Char */ + /* */ + /* <Description> */ + /* This function is used to return the first character code in the */ + /* current charmap of a given face. It also returns the */ + /* corresponding glyph index. */ + /* */ + /* <Input> */ + /* face :: A handle to the source face object. */ + /* */ + /* <Output> */ + /* agindex :: Glyph index of first character code. 0 if charmap is */ + /* empty. */ + /* */ + /* <Return> */ + /* The charmap's first character code. */ + /* */ + /* <Note> */ + /* You should use this function with @FT_Get_Next_Char to be able to */ + /* parse all character codes available in a given charmap. The code */ + /* should look like this: */ + /* */ + /* { */ + /* FT_ULong charcode; */ + /* FT_UInt gindex; */ + /* */ + /* */ + /* charcode = FT_Get_First_Char( face, &gindex ); */ + /* while ( gindex != 0 ) */ + /* { */ + /* ... do something with (charcode,gindex) pair ... */ + /* */ + /* charcode = FT_Get_Next_Char( face, charcode, &gindex ); */ + /* } */ + /* } */ + /* */ + /* Note that `*agindex' is set to 0 if the charmap is empty. The */ + /* result itself can be 0 in two cases: if the charmap is empty or */ + /* when the value 0 is the first valid character code. */ + /* */ + FT_EXPORT( FT_ULong ) + FT_Get_First_Char( FT_Face face, + FT_UInt *agindex ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Get_Next_Char */ + /* */ + /* <Description> */ + /* This function is used to return the next character code in the */ + /* current charmap of a given face following the value `char_code', */ + /* as well as the corresponding glyph index. */ + /* */ + /* <Input> */ + /* face :: A handle to the source face object. */ + /* char_code :: The starting character code. */ + /* */ + /* <Output> */ + /* agindex :: Glyph index of first character code. 0 if charmap */ + /* is empty. */ + /* */ + /* <Return> */ + /* The charmap's next character code. */ + /* */ + /* <Note> */ + /* You should use this function with @FT_Get_First_Char to walk */ + /* over all character codes available in a given charmap. See the */ + /* note for this function for a simple code example. */ + /* */ + /* Note that `*agindex' is set to 0 when there are no more codes in */ + /* the charmap. */ + /* */ + FT_EXPORT( FT_ULong ) + FT_Get_Next_Char( FT_Face face, + FT_ULong char_code, + FT_UInt *agindex ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Get_Name_Index */ + /* */ + /* <Description> */ + /* Return the glyph index of a given glyph name. This function uses */ + /* driver specific objects to do the translation. */ + /* */ + /* <Input> */ + /* face :: A handle to the source face object. */ + /* */ + /* glyph_name :: The glyph name. */ + /* */ + /* <Return> */ + /* The glyph index. 0 means `undefined character code'. */ + /* */ + FT_EXPORT( FT_UInt ) + FT_Get_Name_Index( FT_Face face, + FT_String* glyph_name ); + + + /************************************************************************* + * + * @macro: + * FT_SUBGLYPH_FLAG_XXX + * + * @description: + * A list of constants used to describe subglyphs. Please refer to the + * TrueType specification for the meaning of the various flags. + * + * @values: + * FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS :: + * FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES :: + * FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID :: + * FT_SUBGLYPH_FLAG_SCALE :: + * FT_SUBGLYPH_FLAG_XY_SCALE :: + * FT_SUBGLYPH_FLAG_2X2 :: + * FT_SUBGLYPH_FLAG_USE_MY_METRICS :: + * + */ +#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1 +#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2 +#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4 +#define FT_SUBGLYPH_FLAG_SCALE 8 +#define FT_SUBGLYPH_FLAG_XY_SCALE 0x40 +#define FT_SUBGLYPH_FLAG_2X2 0x80 +#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200 + + + /************************************************************************* + * + * @func: + * FT_Get_SubGlyph_Info + * + * @description: + * Retrieve a description of a given subglyph. Only use it if + * `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE, or an error is + * returned. + * + * @input: + * glyph :: + * The source glyph slot. + * + * sub_index :: + * The index of subglyph. Must be less than `glyph->num_subglyphs'. + * + * @output: + * p_index :: + * The glyph index of the subglyph. + * + * p_flags :: + * The subglyph flags, see @FT_SUBGLYPH_FLAG_XXX. + * + * p_arg1 :: + * The subglyph's first argument (if any). + * + * p_arg2 :: + * The subglyph's second argument (if any). + * + * p_transform :: + * The subglyph transformation (if any). + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * The values of `*p_arg1', `*p_arg2', and `*p_transform' must be + * interpreted depending on the flags returned in `*p_flags'. See the + * TrueType specification for details. + * + */ + FT_EXPORT( FT_Error ) + FT_Get_SubGlyph_Info( FT_GlyphSlot glyph, + FT_UInt sub_index, + FT_Int *p_index, + FT_UInt *p_flags, + FT_Int *p_arg1, + FT_Int *p_arg2, + FT_Matrix *p_transform ); + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* computations */ + /* */ + /* <Title> */ + /* Computations */ + /* */ + /* <Abstract> */ + /* Crunching fixed numbers and vectors. */ + /* */ + /* <Description> */ + /* This section contains various functions used to perform */ + /* computations on 16.16 fixed-float numbers or 2d vectors. */ + /* */ + /* <Order> */ + /* FT_MulDiv */ + /* FT_MulFix */ + /* FT_DivFix */ + /* FT_RoundFix */ + /* FT_CeilFix */ + /* FT_FloorFix */ + /* FT_Vector_Transform */ + /* FT_Matrix_Multiply */ + /* FT_Matrix_Invert */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_MulDiv */ + /* */ + /* <Description> */ + /* A very simple function used to perform the computation `(a*b)/c' */ + /* with maximal accuracy (it uses a 64-bit intermediate integer */ + /* whenever necessary). */ + /* */ + /* This function isn't necessarily as fast as some processor specific */ + /* operations, but is at least completely portable. */ + /* */ + /* <Input> */ + /* a :: The first multiplier. */ + /* b :: The second multiplier. */ + /* c :: The divisor. */ + /* */ + /* <Return> */ + /* The result of `(a*b)/c'. This function never traps when trying to */ + /* divide by zero; it simply returns `MaxInt' or `MinInt' depending */ + /* on the signs of `a' and `b'. */ + /* */ + FT_EXPORT( FT_Long ) + FT_MulDiv( FT_Long a, + FT_Long b, + FT_Long c ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_MulFix */ + /* */ + /* <Description> */ + /* A very simple function used to perform the computation */ + /* `(a*b)/0x10000' with maximal accuracy. Most of the time this is */ + /* used to multiply a given value by a 16.16 fixed float factor. */ + /* */ + /* <Input> */ + /* a :: The first multiplier. */ + /* b :: The second multiplier. Use a 16.16 factor here whenever */ + /* possible (see note below). */ + /* */ + /* <Return> */ + /* The result of `(a*b)/0x10000'. */ + /* */ + /* <Note> */ + /* This function has been optimized for the case where the absolute */ + /* value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */ + /* As this happens mainly when scaling from notional units to */ + /* fractional pixels in FreeType, it resulted in noticeable speed */ + /* improvements between versions 2.x and 1.x. */ + /* */ + /* As a conclusion, always try to place a 16.16 factor as the */ + /* _second_ argument of this function; this can make a great */ + /* difference. */ + /* */ + FT_EXPORT( FT_Long ) + FT_MulFix( FT_Long a, + FT_Long b ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_DivFix */ + /* */ + /* <Description> */ + /* A very simple function used to perform the computation */ + /* `(a*0x10000)/b' with maximal accuracy. Most of the time, this is */ + /* used to divide a given value by a 16.16 fixed float factor. */ + /* */ + /* <Input> */ + /* a :: The first multiplier. */ + /* b :: The second multiplier. Use a 16.16 factor here whenever */ + /* possible (see note below). */ + /* */ + /* <Return> */ + /* The result of `(a*0x10000)/b'. */ + /* */ + /* <Note> */ + /* The optimization for FT_DivFix() is simple: If (a << 16) fits in */ + /* 32 bits, then the division is computed directly. Otherwise, we */ + /* use a specialized version of @FT_MulDiv. */ + /* */ + FT_EXPORT( FT_Long ) + FT_DivFix( FT_Long a, + FT_Long b ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_RoundFix */ + /* */ + /* <Description> */ + /* A very simple function used to round a 16.16 fixed number. */ + /* */ + /* <Input> */ + /* a :: The number to be rounded. */ + /* */ + /* <Return> */ + /* The result of `(a + 0x8000) & -0x10000'. */ + /* */ + FT_EXPORT( FT_Fixed ) + FT_RoundFix( FT_Fixed a ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_CeilFix */ + /* */ + /* <Description> */ + /* A very simple function used to compute the ceiling function of a */ + /* 16.16 fixed number. */ + /* */ + /* <Input> */ + /* a :: The number for which the ceiling function is to be computed. */ + /* */ + /* <Return> */ + /* The result of `(a + 0x10000 - 1) & -0x10000'. */ + /* */ + FT_EXPORT( FT_Fixed ) + FT_CeilFix( FT_Fixed a ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_FloorFix */ + /* */ + /* <Description> */ + /* A very simple function used to compute the floor function of a */ + /* 16.16 fixed number. */ + /* */ + /* <Input> */ + /* a :: The number for which the floor function is to be computed. */ + /* */ + /* <Return> */ + /* The result of `a & -0x10000'. */ + /* */ + FT_EXPORT( FT_Fixed ) + FT_FloorFix( FT_Fixed a ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Vector_Transform */ + /* */ + /* <Description> */ + /* Transform a single vector through a 2x2 matrix. */ + /* */ + /* <InOut> */ + /* vector :: The target vector to transform. */ + /* */ + /* <Input> */ + /* matrix :: A pointer to the source 2x2 matrix. */ + /* */ + /* <Note> */ + /* The result is undefined if either `vector' or `matrix' is invalid. */ + /* */ + FT_EXPORT( void ) + FT_Vector_Transform( FT_Vector* vec, + const FT_Matrix* matrix ); + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* version */ + /* */ + /* <Title> */ + /* FreeType Version */ + /* */ + /* <Abstract> */ + /* Functions and macros related to FreeType versions. */ + /* */ + /* <Description> */ + /* Note that those functions and macros are of limited use because */ + /* even a new release of FreeType with only documentation changes */ + /* increases the version number. */ + /* */ + /*************************************************************************/ + + + /************************************************************************* + * + * @enum: + * FREETYPE_XXX + * + * @description: + * These three macros identify the FreeType source code version. + * Use @FT_Library_Version to access them at runtime. + * + * @values: + * FREETYPE_MAJOR :: The major version number. + * FREETYPE_MINOR :: The minor version number. + * FREETYPE_PATCH :: The patch level. + * + * @note: + * The version number of FreeType if built as a dynamic link library + * with the `libtool' package is _not_ controlled by these three + * macros. + */ +#define FREETYPE_MAJOR 2 +#define FREETYPE_MINOR 3 +#define FREETYPE_PATCH 5 + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Library_Version */ + /* */ + /* <Description> */ + /* Return the version of the FreeType library being used. This is */ + /* useful when dynamically linking to the library, since one cannot */ + /* use the macros @FREETYPE_MAJOR, @FREETYPE_MINOR, and */ + /* @FREETYPE_PATCH. */ + /* */ + /* <Input> */ + /* library :: A source library handle. */ + /* */ + /* <Output> */ + /* amajor :: The major version number. */ + /* */ + /* aminor :: The minor version number. */ + /* */ + /* apatch :: The patch version number. */ + /* */ + /* <Note> */ + /* The reason why this function takes a `library' argument is because */ + /* certain programs implement library initialization in a custom way */ + /* that doesn't use @FT_Init_FreeType. */ + /* */ + /* In such cases, the library version might not be available before */ + /* the library object has been created. */ + /* */ + FT_EXPORT( void ) + FT_Library_Version( FT_Library library, + FT_Int *amajor, + FT_Int *aminor, + FT_Int *apatch ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Face_CheckTrueTypePatents */ + /* */ + /* <Description> */ + /* Parse all bytecode instructions of a TrueType font file to check */ + /* whether any of the patented opcodes are used. This is only useful */ + /* if you want to be able to use the unpatented hinter with */ + /* fonts that do *not* use these opcodes. */ + /* */ + /* Note that this function parses *all* glyph instructions in the */ + /* font file, which may be slow. */ + /* */ + /* <Input> */ + /* face :: A face handle. */ + /* */ + /* <Return> */ + /* 1 if this is a TrueType font that uses one of the patented */ + /* opcodes, 0 otherwise. */ + /* */ + /* <Since> */ + /* 2.3.5 */ + /* */ + FT_EXPORT( FT_Bool ) + FT_Face_CheckTrueTypePatents( FT_Face face ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Face_SetUnpatentedHinting */ + /* */ + /* <Description> */ + /* Enable or disable the unpatented hinter for a given face. */ + /* Only enable it if you have determined that the face doesn't */ + /* use any patented opcodes (see @FT_Face_CheckTrueTypePatents). */ + /* */ + /* <Input> */ + /* face :: A face handle. */ + /* */ + /* value :: New boolean setting. */ + /* */ + /* <Return> */ + /* The old setting value. This will always be false if this is not */ + /* a SFNT font, or if the unpatented hinter is not compiled in this */ + /* instance of the library. */ + /* */ + /* <Since> */ + /* 2.3.5 */ + /* */ + FT_EXPORT( FT_Bool ) + FT_Face_SetUnpatentedHinting( FT_Face face, + FT_Bool value ); + + /* */ + + +FT_END_HEADER + +#endif /* __FREETYPE_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftbbox.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftbbox.h new file mode 100644 index 0000000000..5f79c32740 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftbbox.h @@ -0,0 +1,94 @@ +/***************************************************************************/ +/* */ +/* ftbbox.h */ +/* */ +/* FreeType exact bbox computation (specification). */ +/* */ +/* Copyright 1996-2001, 2003 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This component has a _single_ role: to compute exact outline bounding */ + /* boxes. */ + /* */ + /* It is separated from the rest of the engine for various technical */ + /* reasons. It may well be integrated in `ftoutln' later. */ + /* */ + /*************************************************************************/ + + +#ifndef __FTBBOX_H__ +#define __FTBBOX_H__ + + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* outline_processing */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Outline_Get_BBox */ + /* */ + /* <Description> */ + /* Computes the exact bounding box of an outline. This is slower */ + /* than computing the control box. However, it uses an advanced */ + /* algorithm which returns _very_ quickly when the two boxes */ + /* coincide. Otherwise, the outline Bézier arcs are walked over to */ + /* extract their extrema. */ + /* */ + /* <Input> */ + /* outline :: A pointer to the source outline. */ + /* */ + /* <Output> */ + /* abbox :: The outline's exact bounding box. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Outline_Get_BBox( FT_Outline* outline, + FT_BBox *abbox ); + + + /* */ + + +FT_END_HEADER + +#endif /* __FTBBOX_H__ */ + + +/* END */ + + +/* Local Variables: */ +/* coding: utf-8 */ +/* End: */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftbdf.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftbdf.h new file mode 100644 index 0000000000..9555694811 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftbdf.h @@ -0,0 +1,200 @@ +/***************************************************************************/ +/* */ +/* ftbdf.h */ +/* */ +/* FreeType API for accessing BDF-specific strings (specification). */ +/* */ +/* Copyright 2002, 2003, 2004, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTBDF_H__ +#define __FTBDF_H__ + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* bdf_fonts */ + /* */ + /* <Title> */ + /* BDF Files */ + /* */ + /* <Abstract> */ + /* BDF specific API. */ + /* */ + /* <Description> */ + /* This section contains the declaration of BDF specific functions. */ + /* */ + /*************************************************************************/ + + + /********************************************************************** + * + * @enum: + * FT_PropertyType + * + * @description: + * A list of BDF property types. + * + * @values: + * BDF_PROPERTY_TYPE_NONE :: + * Value 0 is used to indicate a missing property. + * + * BDF_PROPERTY_TYPE_ATOM :: + * Property is a string atom. + * + * BDF_PROPERTY_TYPE_INTEGER :: + * Property is a 32-bit signed integer. + * + * BDF_PROPERTY_TYPE_CARDINAL :: + * Property is a 32-bit unsigned integer. + */ + typedef enum BDF_PropertyType_ + { + BDF_PROPERTY_TYPE_NONE = 0, + BDF_PROPERTY_TYPE_ATOM = 1, + BDF_PROPERTY_TYPE_INTEGER = 2, + BDF_PROPERTY_TYPE_CARDINAL = 3 + + } BDF_PropertyType; + + + /********************************************************************** + * + * @type: + * BDF_Property + * + * @description: + * A handle to a @BDF_PropertyRec structure to model a given + * BDF/PCF property. + */ + typedef struct BDF_PropertyRec_* BDF_Property; + + + /********************************************************************** + * + * @struct: + * BDF_PropertyRec + * + * @description: + * This structure models a given BDF/PCF property. + * + * @fields: + * type :: + * The property type. + * + * u.atom :: + * The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. + * + * u.integer :: + * A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER. + * + * u.cardinal :: + * An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL. + */ + typedef struct BDF_PropertyRec_ + { + BDF_PropertyType type; + union { + const char* atom; + FT_Int32 integer; + FT_UInt32 cardinal; + + } u; + + } BDF_PropertyRec; + + + /********************************************************************** + * + * @function: + * FT_Get_BDF_Charset_ID + * + * @description: + * Retrieves a BDF font character set identity, according to + * the BDF specification. + * + * @input: + * face :: + * A handle to the input face. + * + * @output: + * acharset_encoding :: + * Charset encoding, as a C string, owned by the face. + * + * acharset_registry :: + * Charset registry, as a C string, owned by the face. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * This function only works with BDF faces, returning an error otherwise. + */ + FT_EXPORT( FT_Error ) + FT_Get_BDF_Charset_ID( FT_Face face, + const char* *acharset_encoding, + const char* *acharset_registry ); + + + /********************************************************************** + * + * @function: + * FT_Get_BDF_Property + * + * @description: + * Retrieves a BDF property from a BDF or PCF font file. + * + * @input: + * face :: A handle to the input face. + * + * name :: The property name. + * + * @output: + * aproperty :: The property. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * This function works with BDF _and_ PCF fonts. It returns an error + * otherwise. It also returns an error if the property is not in the + * font. + * + * In case of error, `aproperty->type' is always set to + * @BDF_PROPERTY_TYPE_NONE. + */ + FT_EXPORT( FT_Error ) + FT_Get_BDF_Property( FT_Face face, + const char* prop_name, + BDF_PropertyRec *aproperty ); + + /* */ + +FT_END_HEADER + +#endif /* __FTBDF_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftbitmap.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftbitmap.h new file mode 100644 index 0000000000..337d888eaf --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftbitmap.h @@ -0,0 +1,206 @@ +/***************************************************************************/ +/* */ +/* ftbitmap.h */ +/* */ +/* FreeType utility functions for converting 1bpp, 2bpp, 4bpp, and 8bpp */ +/* bitmaps into 8bpp format (specification). */ +/* */ +/* Copyright 2004, 2005, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTBITMAP_H__ +#define __FTBITMAP_H__ + + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* bitmap_handling */ + /* */ + /* <Title> */ + /* Bitmap Handling */ + /* */ + /* <Abstract> */ + /* Handling FT_Bitmap objects. */ + /* */ + /* <Description> */ + /* This section contains functions for converting FT_Bitmap objects. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Bitmap_New */ + /* */ + /* <Description> */ + /* Initialize a pointer to an @FT_Bitmap structure. */ + /* */ + /* <InOut> */ + /* abitmap :: A pointer to the bitmap structure. */ + /* */ + FT_EXPORT( void ) + FT_Bitmap_New( FT_Bitmap *abitmap ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Bitmap_Copy */ + /* */ + /* <Description> */ + /* Copies an bitmap into another one. */ + /* */ + /* <Input> */ + /* library :: A handle to a library object. */ + /* */ + /* source :: A handle to the source bitmap. */ + /* */ + /* <Output> */ + /* target :: A handle to the target bitmap. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Bitmap_Copy( FT_Library library, + const FT_Bitmap *source, + FT_Bitmap *target); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Bitmap_Embolden */ + /* */ + /* <Description> */ + /* Embolden a bitmap. The new bitmap will be about `xStrength' */ + /* pixels wider and `yStrength' pixels higher. The left and bottom */ + /* borders are kept unchanged. */ + /* */ + /* <Input> */ + /* library :: A handle to a library object. */ + /* */ + /* xStrength :: How strong the glyph is emboldened horizontally. */ + /* Expressed in 26.6 pixel format. */ + /* */ + /* yStrength :: How strong the glyph is emboldened vertically. */ + /* Expressed in 26.6 pixel format. */ + /* */ + /* <InOut> */ + /* bitmap :: A handle to the target bitmap. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* The current implementation restricts `xStrength' to be less than */ + /* or equal to 8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */ + /* */ + /* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */ + /* you should call `FT_GlyphSlot_Own_Bitmap' on the slot first. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Bitmap_Embolden( FT_Library library, + FT_Bitmap* bitmap, + FT_Pos xStrength, + FT_Pos yStrength ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Bitmap_Convert */ + /* */ + /* <Description> */ + /* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, or 8bpp to a */ + /* bitmap object with depth 8bpp, making the number of used bytes per */ + /* line (a.k.a. the `pitch') a multiple of `alignment'. */ + /* */ + /* <Input> */ + /* library :: A handle to a library object. */ + /* */ + /* source :: The source bitmap. */ + /* */ + /* alignment :: The pitch of the bitmap is a multiple of this */ + /* parameter. Common values are 1, 2, or 4. */ + /* */ + /* <Output> */ + /* target :: The target bitmap. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* It is possible to call @FT_Bitmap_Convert multiple times without */ + /* calling @FT_Bitmap_Done (the memory is simply reallocated). */ + /* */ + /* Use @FT_Bitmap_Done to finally remove the bitmap object. */ + /* */ + /* The `library' argument is taken to have access to FreeType's */ + /* memory handling functions. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Bitmap_Convert( FT_Library library, + const FT_Bitmap *source, + FT_Bitmap *target, + FT_Int alignment ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Bitmap_Done */ + /* */ + /* <Description> */ + /* Destroy a bitmap object created with @FT_Bitmap_New. */ + /* */ + /* <Input> */ + /* library :: A handle to a library object. */ + /* */ + /* bitmap :: The bitmap object to be freed. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* The `library' argument is taken to have access to FreeType's */ + /* memory handling functions. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Bitmap_Done( FT_Library library, + FT_Bitmap *bitmap ); + + + /* */ + + +FT_END_HEADER + +#endif /* __FTBITMAP_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftcache.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftcache.h new file mode 100644 index 0000000000..721aa16f32 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftcache.h @@ -0,0 +1,1110 @@ +/***************************************************************************/ +/* */ +/* ftcache.h */ +/* */ +/* FreeType Cache subsystem (specification). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTCACHE_H__ +#define __FTCACHE_H__ + + +#include <ft2build.h> +#include FT_GLYPH_H + + +FT_BEGIN_HEADER + + + /************************************************************************* + * + * <Section> + * cache_subsystem + * + * <Title> + * Cache Sub-System + * + * <Abstract> + * How to cache face, size, and glyph data with FreeType 2. + * + * <Description> + * This section describes the FreeType 2 cache sub-system, which is used + * to limit the number of concurrently opened @FT_Face and @FT_Size + * objects, as well as caching information like character maps and glyph + * images while limiting their maximum memory usage. + * + * Note that all types and functions begin with the `FTC_' prefix. + * + * The cache is highly portable and thus doesn't know anything about the + * fonts installed on your system, or how to access them. This implies + * the following scheme: + * + * First, available or installed font faces are uniquely identified by + * @FTC_FaceID values, provided to the cache by the client. Note that + * the cache only stores and compares these values, and doesn't try to + * interpret them in any way. + * + * Second, the cache calls, only when needed, a client-provided function + * to convert a @FTC_FaceID into a new @FT_Face object. The latter is + * then completely managed by the cache, including its termination + * through @FT_Done_Face. + * + * Clients are free to map face IDs to anything else. The most simple + * usage is to associate them to a (pathname,face_index) pair that is + * used to call @FT_New_Face. However, more complex schemes are also + * possible. + * + * Note that for the cache to work correctly, the face ID values must be + * *persistent*, which means that the contents they point to should not + * change at runtime, or that their value should not become invalid. + * + * If this is unavoidable (e.g., when a font is uninstalled at runtime), + * you should call @FTC_Manager_RemoveFaceID as soon as possible, to let + * the cache get rid of any references to the old @FTC_FaceID it may + * keep internally. Failure to do so will lead to incorrect behaviour + * or even crashes. + * + * To use the cache, start with calling @FTC_Manager_New to create a new + * @FTC_Manager object, which models a single cache instance. You can + * then look up @FT_Face and @FT_Size objects with + * @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively. + * + * If you want to use the charmap caching, call @FTC_CMapCache_New, then + * later use @FTC_CMapCache_Lookup to perform the equivalent of + * @FT_Get_Char_Index, only much faster. + * + * If you want to use the @FT_Glyph caching, call @FTC_ImageCache, then + * later use @FTC_ImageCache_Lookup to retrieve the corresponding + * @FT_Glyph objects from the cache. + * + * If you need lots of small bitmaps, it is much more memory efficient + * to call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup. This + * returns @FTC_SBitRec structures, which are used to store small + * bitmaps directly. (A small bitmap is one whose metrics and + * dimensions all fit into 8-bit integers). + * + * We hope to also provide a kerning cache in the near future. + * + * + * <Order> + * FTC_Manager + * FTC_FaceID + * FTC_Face_Requester + * + * FTC_Manager_New + * FTC_Manager_Reset + * FTC_Manager_Done + * FTC_Manager_LookupFace + * FTC_Manager_LookupSize + * FTC_Manager_RemoveFaceID + * + * FTC_Node + * FTC_Node_Unref + * + * FTC_ImageCache + * FTC_ImageCache_New + * FTC_ImageCache_Lookup + * + * FTC_SBit + * FTC_SBitCache + * FTC_SBitCache_New + * FTC_SBitCache_Lookup + * + * FTC_CMapCache + * FTC_CMapCache_New + * FTC_CMapCache_Lookup + * + *************************************************************************/ + + + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** BASIC TYPE DEFINITIONS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + + + /************************************************************************* + * + * @type: FTC_FaceID + * + * @description: + * An opaque pointer type that is used to identity face objects. The + * contents of such objects is application-dependent. + * + * These pointers are typically used to point to a user-defined + * structure containing a font file path, and face index. + * + * @note: + * Never use NULL as a valid @FTC_FaceID. + * + * Face IDs are passed by the client to the cache manager, which calls, + * when needed, the @FTC_Face_Requester to translate them into new + * @FT_Face objects. + * + * If the content of a given face ID changes at runtime, or if the value + * becomes invalid (e.g., when uninstalling a font), you should + * immediately call @FTC_Manager_RemoveFaceID before any other cache + * function. + * + * Failure to do so will result in incorrect behaviour or even + * memory leaks and crashes. + */ + typedef struct FTC_FaceIDRec_* FTC_FaceID; + + + /************************************************************************ + * + * @functype: + * FTC_Face_Requester + * + * @description: + * A callback function provided by client applications. It is used by + * the cache manager to translate a given @FTC_FaceID into a new valid + * @FT_Face object, on demand. + * + * <Input> + * face_id :: + * The face ID to resolve. + * + * library :: + * A handle to a FreeType library object. + * + * req_data :: + * Application-provided request data (see note below). + * + * <Output> + * aface :: + * A new @FT_Face handle. + * + * <Return> + * FreeType error code. 0 means success. + * + * <Note> + * The third parameter `req_data' is the same as the one passed by the + * client when @FTC_Manager_New is called. + * + * The face requester should not perform funny things on the returned + * face object, like creating a new @FT_Size for it, or setting a + * transformation through @FT_Set_Transform! + */ + typedef FT_Error + (*FTC_Face_Requester)( FTC_FaceID face_id, + FT_Library library, + FT_Pointer request_data, + FT_Face* aface ); + + /* */ + +#define FT_POINTER_TO_ULONG( p ) ( (FT_ULong)(FT_Pointer)(p) ) + +#define FTC_FACE_ID_HASH( i ) \ + ((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^ \ + ( FT_POINTER_TO_ULONG( i ) << 7 ) ) ) + + + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** CACHE MANAGER OBJECT *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FTC_Manager */ + /* */ + /* <Description> */ + /* This object corresponds to one instance of the cache-subsystem. */ + /* It is used to cache one or more @FT_Face objects, along with */ + /* corresponding @FT_Size objects. */ + /* */ + /* The manager intentionally limits the total number of opened */ + /* @FT_Face and @FT_Size objects to control memory usage. See the */ + /* `max_faces' and `max_sizes' parameters of @FTC_Manager_New. */ + /* */ + /* The manager is also used to cache `nodes' of various types while */ + /* limiting their total memory usage. */ + /* */ + /* All limitations are enforced by keeping lists of managed objects */ + /* in most-recently-used order, and flushing old nodes to make room */ + /* for new ones. */ + /* */ + typedef struct FTC_ManagerRec_* FTC_Manager; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FTC_Node */ + /* */ + /* <Description> */ + /* An opaque handle to a cache node object. Each cache node is */ + /* reference-counted. A node with a count of 0 might be flushed */ + /* out of a full cache whenever a lookup request is performed. */ + /* */ + /* If you lookup nodes, you have the ability to `acquire' them, i.e., */ + /* to increment their reference count. This will prevent the node */ + /* from being flushed out of the cache until you explicitly `release' */ + /* it (see @FTC_Node_Unref). */ + /* */ + /* See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup. */ + /* */ + typedef struct FTC_NodeRec_* FTC_Node; + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FTC_Manager_New */ + /* */ + /* <Description> */ + /* Creates a new cache manager. */ + /* */ + /* <Input> */ + /* library :: The parent FreeType library handle to use. */ + /* */ + /* max_faces :: Maximum number of opened @FT_Face objects managed by */ + /* this cache instance. Use 0 for defaults. */ + /* */ + /* max_sizes :: Maximum number of opened @FT_Size objects managed by */ + /* this cache instance. Use 0 for defaults. */ + /* */ + /* max_bytes :: Maximum number of bytes to use for cached data nodes. */ + /* Use 0 for defaults. Note that this value does not */ + /* account for managed @FT_Face and @FT_Size objects. */ + /* */ + /* requester :: An application-provided callback used to translate */ + /* face IDs into real @FT_Face objects. */ + /* */ + /* req_data :: A generic pointer that is passed to the requester */ + /* each time it is called (see @FTC_Face_Requester). */ + /* */ + /* <Output> */ + /* amanager :: A handle to a new manager object. 0 in case of */ + /* failure. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FTC_Manager_New( FT_Library library, + FT_UInt max_faces, + FT_UInt max_sizes, + FT_ULong max_bytes, + FTC_Face_Requester requester, + FT_Pointer req_data, + FTC_Manager *amanager ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FTC_Manager_Reset */ + /* */ + /* <Description> */ + /* Empties a given cache manager. This simply gets rid of all the */ + /* currently cached @FT_Face and @FT_Size objects within the manager. */ + /* */ + /* <InOut> */ + /* manager :: A handle to the manager. */ + /* */ + FT_EXPORT( void ) + FTC_Manager_Reset( FTC_Manager manager ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FTC_Manager_Done */ + /* */ + /* <Description> */ + /* Destroys a given manager after emptying it. */ + /* */ + /* <Input> */ + /* manager :: A handle to the target cache manager object. */ + /* */ + FT_EXPORT( void ) + FTC_Manager_Done( FTC_Manager manager ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FTC_Manager_LookupFace */ + /* */ + /* <Description> */ + /* Retrieves the @FT_Face object that corresponds to a given face ID */ + /* through a cache manager. */ + /* */ + /* <Input> */ + /* manager :: A handle to the cache manager. */ + /* */ + /* face_id :: The ID of the face object. */ + /* */ + /* <Output> */ + /* aface :: A handle to the face object. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* The returned @FT_Face object is always owned by the manager. You */ + /* should never try to discard it yourself. */ + /* */ + /* The @FT_Face object doesn't necessarily have a current size object */ + /* (i.e., face->size can be 0). If you need a specific `font size', */ + /* use @FTC_Manager_LookupSize instead. */ + /* */ + /* Never change the face's transformation matrix (i.e., never call */ + /* the @FT_Set_Transform function) on a returned face! If you need */ + /* to transform glyphs, do it yourself after glyph loading. */ + /* */ + /* When you perform a lookup, out-of-memory errors are detected */ + /* _within_ the lookup and force incremental flushes of the cache */ + /* until enough memory is released for the lookup to succeed. */ + /* */ + /* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */ + /* already been completely flushed, and still no memory was available */ + /* for the operation. */ + /* */ + FT_EXPORT( FT_Error ) + FTC_Manager_LookupFace( FTC_Manager manager, + FTC_FaceID face_id, + FT_Face *aface ); + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FTC_ScalerRec */ + /* */ + /* <Description> */ + /* A structure used to describe a given character size in either */ + /* pixels or points to the cache manager. See */ + /* @FTC_Manager_LookupSize. */ + /* */ + /* <Fields> */ + /* face_id :: The source face ID. */ + /* */ + /* width :: The character width. */ + /* */ + /* height :: The character height. */ + /* */ + /* pixel :: A Boolean. If 1, the `width' and `height' fields are */ + /* interpreted as integer pixel character sizes. */ + /* Otherwise, they are expressed as 1/64th of points. */ + /* */ + /* x_res :: Only used when `pixel' is value 0 to indicate the */ + /* horizontal resolution in dpi. */ + /* */ + /* y_res :: Only used when `pixel' is value 0 to indicate the */ + /* vertical resolution in dpi. */ + /* */ + /* <Note> */ + /* This type is mainly used to retrieve @FT_Size objects through the */ + /* cache manager. */ + /* */ + typedef struct FTC_ScalerRec_ + { + FTC_FaceID face_id; + FT_UInt width; + FT_UInt height; + FT_Int pixel; + FT_UInt x_res; + FT_UInt y_res; + + } FTC_ScalerRec, *FTC_Scaler; + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FTC_Manager_LookupSize */ + /* */ + /* <Description> */ + /* Retrieve the @FT_Size object that corresponds to a given */ + /* @FTC_ScalerRec pointer through a cache manager. */ + /* */ + /* <Input> */ + /* manager :: A handle to the cache manager. */ + /* */ + /* scaler :: A scaler handle. */ + /* */ + /* <Output> */ + /* asize :: A handle to the size object. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* The returned @FT_Size object is always owned by the manager. You */ + /* should never try to discard it by yourself. */ + /* */ + /* You can access the parent @FT_Face object simply as `size->face' */ + /* if you need it. Note that this object is also owned by the */ + /* manager. */ + /* */ + /* <Note> */ + /* When you perform a lookup, out-of-memory errors are detected */ + /* _within_ the lookup and force incremental flushes of the cache */ + /* until enough memory is released for the lookup to succeed. */ + /* */ + /* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */ + /* already been completely flushed, and still no memory is available */ + /* for the operation. */ + /* */ + FT_EXPORT( FT_Error ) + FTC_Manager_LookupSize( FTC_Manager manager, + FTC_Scaler scaler, + FT_Size *asize ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FTC_Node_Unref */ + /* */ + /* <Description> */ + /* Decrement a cache node's internal reference count. When the count */ + /* reaches 0, it is not destroyed but becomes eligible for subsequent */ + /* cache flushes. */ + /* */ + /* <Input> */ + /* node :: The cache node handle. */ + /* */ + /* manager :: The cache manager handle. */ + /* */ + FT_EXPORT( void ) + FTC_Node_Unref( FTC_Node node, + FTC_Manager manager ); + + + /************************************************************************* + * + * @function: + * FTC_Manager_RemoveFaceID + * + * @description: + * A special function used to indicate to the cache manager that + * a given @FTC_FaceID is no longer valid, either because its + * content changed, or because it was deallocated or uninstalled. + * + * @input: + * manager :: + * The cache manager handle. + * + * face_id :: + * The @FTC_FaceID to be removed. + * + * @note: + * This function flushes all nodes from the cache corresponding to this + * `face_id', with the exception of nodes with a non-null reference + * count. + * + * Such nodes are however modified internally so as to never appear + * in later lookups with the same `face_id' value, and to be immediately + * destroyed when released by all their users. + * + */ + FT_EXPORT( void ) + FTC_Manager_RemoveFaceID( FTC_Manager manager, + FTC_FaceID face_id ); + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* cache_subsystem */ + /* */ + /*************************************************************************/ + + /************************************************************************* + * + * @type: + * FTC_CMapCache + * + * @description: + * An opaque handle used to model a charmap cache. This cache is to + * hold character codes -> glyph indices mappings. + * + */ + typedef struct FTC_CMapCacheRec_* FTC_CMapCache; + + + /************************************************************************* + * + * @function: + * FTC_CMapCache_New + * + * @description: + * Create a new charmap cache. + * + * @input: + * manager :: + * A handle to the cache manager. + * + * @output: + * acache :: + * A new cache handle. NULL in case of error. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * Like all other caches, this one will be destroyed with the cache + * manager. + * + */ + FT_EXPORT( FT_Error ) + FTC_CMapCache_New( FTC_Manager manager, + FTC_CMapCache *acache ); + + + /************************************************************************ + * + * @function: + * FTC_CMapCache_Lookup + * + * @description: + * Translate a character code into a glyph index, using the charmap + * cache. + * + * @input: + * cache :: + * A charmap cache handle. + * + * face_id :: + * The source face ID. + * + * cmap_index :: + * The index of the charmap in the source face. + * + * char_code :: + * The character code (in the corresponding charmap). + * + * @return: + * Glyph index. 0 means `no glyph'. + * + */ + FT_EXPORT( FT_UInt ) + FTC_CMapCache_Lookup( FTC_CMapCache cache, + FTC_FaceID face_id, + FT_Int cmap_index, + FT_UInt32 char_code ); + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* cache_subsystem */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** IMAGE CACHE OBJECT *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + + + /************************************************************************* + * + * @struct: + * FTC_ImageTypeRec + * + * @description: + * A structure used to model the type of images in a glyph cache. + * + * @fields: + * face_id :: + * The face ID. + * + * width :: + * The width in pixels. + * + * height :: + * The height in pixels. + * + * flags :: + * The load flags, as in @FT_Load_Glyph. + * + */ + typedef struct FTC_ImageTypeRec_ + { + FTC_FaceID face_id; + FT_Int width; + FT_Int height; + FT_Int32 flags; + + } FTC_ImageTypeRec; + + + /************************************************************************* + * + * @type: + * FTC_ImageType + * + * @description: + * A handle to an @FTC_ImageTypeRec structure. + * + */ + typedef struct FTC_ImageTypeRec_* FTC_ImageType; + + + /* */ + + +#define FTC_IMAGE_TYPE_COMPARE( d1, d2 ) \ + ( (d1)->face_id == (d2)->face_id && \ + (d1)->width == (d2)->width && \ + (d1)->flags == (d2)->flags ) + +#define FTC_IMAGE_TYPE_HASH( d ) \ + (FT_UFast)( FTC_FACE_ID_HASH( (d)->face_id ) ^ \ + ( (d)->width << 8 ) ^ (d)->height ^ \ + ( (d)->flags << 4 ) ) + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FTC_ImageCache */ + /* */ + /* <Description> */ + /* A handle to an glyph image cache object. They are designed to */ + /* hold many distinct glyph images while not exceeding a certain */ + /* memory threshold. */ + /* */ + typedef struct FTC_ImageCacheRec_* FTC_ImageCache; + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FTC_ImageCache_New */ + /* */ + /* <Description> */ + /* Creates a new glyph image cache. */ + /* */ + /* <Input> */ + /* manager :: The parent manager for the image cache. */ + /* */ + /* <Output> */ + /* acache :: A handle to the new glyph image cache object. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FTC_ImageCache_New( FTC_Manager manager, + FTC_ImageCache *acache ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FTC_ImageCache_Lookup */ + /* */ + /* <Description> */ + /* Retrieves a given glyph image from a glyph image cache. */ + /* */ + /* <Input> */ + /* cache :: A handle to the source glyph image cache. */ + /* */ + /* type :: A pointer to a glyph image type descriptor. */ + /* */ + /* gindex :: The glyph index to retrieve. */ + /* */ + /* <Output> */ + /* aglyph :: The corresponding @FT_Glyph object. 0 in case of */ + /* failure. */ + /* */ + /* anode :: Used to return the address of of the corresponding cache */ + /* node after incrementing its reference count (see note */ + /* below). */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* The returned glyph is owned and managed by the glyph image cache. */ + /* Never try to transform or discard it manually! You can however */ + /* create a copy with @FT_Glyph_Copy and modify the new one. */ + /* */ + /* If `anode' is _not_ NULL, it receives the address of the cache */ + /* node containing the glyph image, after increasing its reference */ + /* count. This ensures that the node (as well as the @FT_Glyph) will */ + /* always be kept in the cache until you call @FTC_Node_Unref to */ + /* `release' it. */ + /* */ + /* If `anode' is NULL, the cache node is left unchanged, which means */ + /* that the @FT_Glyph could be flushed out of the cache on the next */ + /* call to one of the caching sub-system APIs. Don't assume that it */ + /* is persistent! */ + /* */ + FT_EXPORT( FT_Error ) + FTC_ImageCache_Lookup( FTC_ImageCache cache, + FTC_ImageType type, + FT_UInt gindex, + FT_Glyph *aglyph, + FTC_Node *anode ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FTC_ImageCache_LookupScaler */ + /* */ + /* <Description> */ + /* A variant of @FTC_ImageCache_Lookup that uses an @FTC_ScalerRec */ + /* to specify the face ID and its size. */ + /* */ + /* <Input> */ + /* cache :: A handle to the source glyph image cache. */ + /* */ + /* scaler :: A pointer to a scaler descriptor. */ + /* */ + /* load_flags :: The corresponding load flags. */ + /* */ + /* gindex :: The glyph index to retrieve. */ + /* */ + /* <Output> */ + /* aglyph :: The corresponding @FT_Glyph object. 0 in case of */ + /* failure. */ + /* */ + /* anode :: Used to return the address of of the corresponding */ + /* cache node after incrementing its reference count */ + /* (see note below). */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* The returned glyph is owned and managed by the glyph image cache. */ + /* Never try to transform or discard it manually! You can however */ + /* create a copy with @FT_Glyph_Copy and modify the new one. */ + /* */ + /* If `anode' is _not_ NULL, it receives the address of the cache */ + /* node containing the glyph image, after increasing its reference */ + /* count. This ensures that the node (as well as the @FT_Glyph) will */ + /* always be kept in the cache until you call @FTC_Node_Unref to */ + /* `release' it. */ + /* */ + /* If `anode' is NULL, the cache node is left unchanged, which means */ + /* that the @FT_Glyph could be flushed out of the cache on the next */ + /* call to one of the caching sub-system APIs. Don't assume that it */ + /* is persistent! */ + /* */ + FT_EXPORT( FT_Error ) + FTC_ImageCache_LookupScaler( FTC_ImageCache cache, + FTC_Scaler scaler, + FT_ULong load_flags, + FT_UInt gindex, + FT_Glyph *aglyph, + FTC_Node *anode ); + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FTC_SBit */ + /* */ + /* <Description> */ + /* A handle to a small bitmap descriptor. See the @FTC_SBitRec */ + /* structure for details. */ + /* */ + typedef struct FTC_SBitRec_* FTC_SBit; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FTC_SBitRec */ + /* */ + /* <Description> */ + /* A very compact structure used to describe a small glyph bitmap. */ + /* */ + /* <Fields> */ + /* width :: The bitmap width in pixels. */ + /* */ + /* height :: The bitmap height in pixels. */ + /* */ + /* left :: The horizontal distance from the pen position to the */ + /* left bitmap border (a.k.a. `left side bearing', or */ + /* `lsb'). */ + /* */ + /* top :: The vertical distance from the pen position (on the */ + /* baseline) to the upper bitmap border (a.k.a. `top */ + /* side bearing'). The distance is positive for upwards */ + /* Y coordinates. */ + /* */ + /* format :: The format of the glyph bitmap (monochrome or gray). */ + /* */ + /* max_grays :: Maximum gray level value (in the range 1 to 255). */ + /* */ + /* pitch :: The number of bytes per bitmap line. May be positive */ + /* or negative. */ + /* */ + /* xadvance :: The horizontal advance width in pixels. */ + /* */ + /* yadvance :: The vertical advance height in pixels. */ + /* */ + /* buffer :: A pointer to the bitmap pixels. */ + /* */ + typedef struct FTC_SBitRec_ + { + FT_Byte width; + FT_Byte height; + FT_Char left; + FT_Char top; + + FT_Byte format; + FT_Byte max_grays; + FT_Short pitch; + FT_Char xadvance; + FT_Char yadvance; + + FT_Byte* buffer; + + } FTC_SBitRec; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FTC_SBitCache */ + /* */ + /* <Description> */ + /* A handle to a small bitmap cache. These are special cache objects */ + /* used to store small glyph bitmaps (and anti-aliased pixmaps) in a */ + /* much more efficient way than the traditional glyph image cache */ + /* implemented by @FTC_ImageCache. */ + /* */ + typedef struct FTC_SBitCacheRec_* FTC_SBitCache; + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FTC_SBitCache_New */ + /* */ + /* <Description> */ + /* Creates a new cache to store small glyph bitmaps. */ + /* */ + /* <Input> */ + /* manager :: A handle to the source cache manager. */ + /* */ + /* <Output> */ + /* acache :: A handle to the new sbit cache. NULL in case of error. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FTC_SBitCache_New( FTC_Manager manager, + FTC_SBitCache *acache ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FTC_SBitCache_Lookup */ + /* */ + /* <Description> */ + /* Looks up a given small glyph bitmap in a given sbit cache and */ + /* `lock' it to prevent its flushing from the cache until needed. */ + /* */ + /* <Input> */ + /* cache :: A handle to the source sbit cache. */ + /* */ + /* type :: A pointer to the glyph image type descriptor. */ + /* */ + /* gindex :: The glyph index. */ + /* */ + /* <Output> */ + /* sbit :: A handle to a small bitmap descriptor. */ + /* */ + /* anode :: Used to return the address of of the corresponding cache */ + /* node after incrementing its reference count (see note */ + /* below). */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* The small bitmap descriptor and its bit buffer are owned by the */ + /* cache and should never be freed by the application. They might */ + /* as well disappear from memory on the next cache lookup, so don't */ + /* treat them as persistent data. */ + /* */ + /* The descriptor's `buffer' field is set to 0 to indicate a missing */ + /* glyph bitmap. */ + /* */ + /* If `anode' is _not_ NULL, it receives the address of the cache */ + /* node containing the bitmap, after increasing its reference count. */ + /* This ensures that the node (as well as the image) will always be */ + /* kept in the cache until you call @FTC_Node_Unref to `release' it. */ + /* */ + /* If `anode' is NULL, the cache node is left unchanged, which means */ + /* that the bitmap could be flushed out of the cache on the next */ + /* call to one of the caching sub-system APIs. Don't assume that it */ + /* is persistent! */ + /* */ + FT_EXPORT( FT_Error ) + FTC_SBitCache_Lookup( FTC_SBitCache cache, + FTC_ImageType type, + FT_UInt gindex, + FTC_SBit *sbit, + FTC_Node *anode ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FTC_SBitCache_LookupScaler */ + /* */ + /* <Description> */ + /* A variant of @FTC_SBitCache_Lookup that uses an @FTC_ScalerRec */ + /* to specify the face ID and its size. */ + /* */ + /* <Input> */ + /* cache :: A handle to the source sbit cache. */ + /* */ + /* scaler :: A pointer to the scaler descriptor. */ + /* */ + /* load_flags :: The corresponding load flags. */ + /* */ + /* gindex :: The glyph index. */ + /* */ + /* <Output> */ + /* sbit :: A handle to a small bitmap descriptor. */ + /* */ + /* anode :: Used to return the address of of the corresponding */ + /* cache node after incrementing its reference count */ + /* (see note below). */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* The small bitmap descriptor and its bit buffer are owned by the */ + /* cache and should never be freed by the application. They might */ + /* as well disappear from memory on the next cache lookup, so don't */ + /* treat them as persistent data. */ + /* */ + /* The descriptor's `buffer' field is set to 0 to indicate a missing */ + /* glyph bitmap. */ + /* */ + /* If `anode' is _not_ NULL, it receives the address of the cache */ + /* node containing the bitmap, after increasing its reference count. */ + /* This ensures that the node (as well as the image) will always be */ + /* kept in the cache until you call @FTC_Node_Unref to `release' it. */ + /* */ + /* If `anode' is NULL, the cache node is left unchanged, which means */ + /* that the bitmap could be flushed out of the cache on the next */ + /* call to one of the caching sub-system APIs. Don't assume that it */ + /* is persistent! */ + /* */ + FT_EXPORT( FT_Error ) + FTC_SBitCache_LookupScaler( FTC_SBitCache cache, + FTC_Scaler scaler, + FT_ULong load_flags, + FT_UInt gindex, + FTC_SBit *sbit, + FTC_Node *anode ); + + + /* */ + +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS + + /*@***********************************************************************/ + /* */ + /* <Struct> */ + /* FTC_FontRec */ + /* */ + /* <Description> */ + /* A simple structure used to describe a given `font' to the cache */ + /* manager. Note that a `font' is the combination of a given face */ + /* with a given character size. */ + /* */ + /* <Fields> */ + /* face_id :: The ID of the face to use. */ + /* */ + /* pix_width :: The character width in integer pixels. */ + /* */ + /* pix_height :: The character height in integer pixels. */ + /* */ + typedef struct FTC_FontRec_ + { + FTC_FaceID face_id; + FT_UShort pix_width; + FT_UShort pix_height; + + } FTC_FontRec; + + + /* */ + + +#define FTC_FONT_COMPARE( f1, f2 ) \ + ( (f1)->face_id == (f2)->face_id && \ + (f1)->pix_width == (f2)->pix_width && \ + (f1)->pix_height == (f2)->pix_height ) + +#define FTC_FONT_HASH( f ) \ + (FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \ + ((f)->pix_width << 8) ^ \ + ((f)->pix_height) ) + + typedef FTC_FontRec* FTC_Font; + + + FT_EXPORT( FT_Error ) + FTC_Manager_Lookup_Face( FTC_Manager manager, + FTC_FaceID face_id, + FT_Face *aface ); + + FT_EXPORT( FT_Error ) + FTC_Manager_Lookup_Size( FTC_Manager manager, + FTC_Font font, + FT_Face *aface, + FT_Size *asize ); + +#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ + + + /* */ + +FT_END_HEADER + +#endif /* __FTCACHE_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftchapters.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftchapters.h new file mode 100644 index 0000000000..bd812c8e65 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftchapters.h @@ -0,0 +1,100 @@ +/***************************************************************************/ +/* */ +/* This file defines the structure of the FreeType reference. */ +/* It is used by the python script which generates the HTML files. */ +/* */ +/***************************************************************************/ + + +/***************************************************************************/ +/* */ +/* <Chapter> */ +/* general_remarks */ +/* */ +/* <Title> */ +/* General Remarks */ +/* */ +/* <Sections> */ +/* user_allocation */ +/* */ +/***************************************************************************/ + + +/***************************************************************************/ +/* */ +/* <Chapter> */ +/* core_api */ +/* */ +/* <Title> */ +/* Core API */ +/* */ +/* <Sections> */ +/* version */ +/* basic_types */ +/* base_interface */ +/* glyph_management */ +/* mac_specific */ +/* sizes_management */ +/* header_file_macros */ +/* */ +/***************************************************************************/ + + +/***************************************************************************/ +/* */ +/* <Chapter> */ +/* format_specific */ +/* */ +/* <Title> */ +/* Format-Specific API */ +/* */ +/* <Sections> */ +/* multiple_masters */ +/* truetype_tables */ +/* type1_tables */ +/* sfnt_names */ +/* bdf_fonts */ +/* pfr_fonts */ +/* winfnt_fonts */ +/* font_formats */ +/* gasp_table */ +/* */ +/***************************************************************************/ + + +/***************************************************************************/ +/* */ +/* <Chapter> */ +/* cache_subsystem */ +/* */ +/* <Title> */ +/* Cache Sub-System */ +/* */ +/* <Sections> */ +/* cache_subsystem */ +/* */ +/***************************************************************************/ + + +/***************************************************************************/ +/* */ +/* <Chapter> */ +/* support_api */ +/* */ +/* <Title> */ +/* Support API */ +/* */ +/* <Sections> */ +/* computations */ +/* list_processing */ +/* outline_processing */ +/* bitmap_handling */ +/* raster */ +/* glyph_stroker */ +/* system_interface */ +/* module_management */ +/* gzip */ +/* lzw */ +/* lcd_filtering */ +/* */ +/***************************************************************************/ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/fterrdef.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/fterrdef.h new file mode 100644 index 0000000000..d7ad256bdb --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/fterrdef.h @@ -0,0 +1,239 @@ +/***************************************************************************/ +/* */ +/* fterrdef.h */ +/* */ +/* FreeType error codes (specification). */ +/* */ +/* Copyright 2002, 2004, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*******************************************************************/ + /*******************************************************************/ + /***** *****/ + /***** LIST OF ERROR CODES/MESSAGES *****/ + /***** *****/ + /*******************************************************************/ + /*******************************************************************/ + + + /* You need to define both FT_ERRORDEF_ and FT_NOERRORDEF_ before */ + /* including this file. */ + + + /* generic errors */ + + FT_NOERRORDEF_( Ok, 0x00, \ + "no error" ) + + FT_ERRORDEF_( Cannot_Open_Resource, 0x01, \ + "cannot open resource" ) + FT_ERRORDEF_( Unknown_File_Format, 0x02, \ + "unknown file format" ) + FT_ERRORDEF_( Invalid_File_Format, 0x03, \ + "broken file" ) + FT_ERRORDEF_( Invalid_Version, 0x04, \ + "invalid FreeType version" ) + FT_ERRORDEF_( Lower_Module_Version, 0x05, \ + "module version is too low" ) + FT_ERRORDEF_( Invalid_Argument, 0x06, \ + "invalid argument" ) + FT_ERRORDEF_( Unimplemented_Feature, 0x07, \ + "unimplemented feature" ) + FT_ERRORDEF_( Invalid_Table, 0x08, \ + "broken table" ) + FT_ERRORDEF_( Invalid_Offset, 0x09, \ + "broken offset within table" ) + FT_ERRORDEF_( Array_Too_Large, 0x0A, \ + "array allocation size too large" ) + + /* glyph/character errors */ + + FT_ERRORDEF_( Invalid_Glyph_Index, 0x10, \ + "invalid glyph index" ) + FT_ERRORDEF_( Invalid_Character_Code, 0x11, \ + "invalid character code" ) + FT_ERRORDEF_( Invalid_Glyph_Format, 0x12, \ + "unsupported glyph image format" ) + FT_ERRORDEF_( Cannot_Render_Glyph, 0x13, \ + "cannot render this glyph format" ) + FT_ERRORDEF_( Invalid_Outline, 0x14, \ + "invalid outline" ) + FT_ERRORDEF_( Invalid_Composite, 0x15, \ + "invalid composite glyph" ) + FT_ERRORDEF_( Too_Many_Hints, 0x16, \ + "too many hints" ) + FT_ERRORDEF_( Invalid_Pixel_Size, 0x17, \ + "invalid pixel size" ) + + /* handle errors */ + + FT_ERRORDEF_( Invalid_Handle, 0x20, \ + "invalid object handle" ) + FT_ERRORDEF_( Invalid_Library_Handle, 0x21, \ + "invalid library handle" ) + FT_ERRORDEF_( Invalid_Driver_Handle, 0x22, \ + "invalid module handle" ) + FT_ERRORDEF_( Invalid_Face_Handle, 0x23, \ + "invalid face handle" ) + FT_ERRORDEF_( Invalid_Size_Handle, 0x24, \ + "invalid size handle" ) + FT_ERRORDEF_( Invalid_Slot_Handle, 0x25, \ + "invalid glyph slot handle" ) + FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26, \ + "invalid charmap handle" ) + FT_ERRORDEF_( Invalid_Cache_Handle, 0x27, \ + "invalid cache manager handle" ) + FT_ERRORDEF_( Invalid_Stream_Handle, 0x28, \ + "invalid stream handle" ) + + /* driver errors */ + + FT_ERRORDEF_( Too_Many_Drivers, 0x30, \ + "too many modules" ) + FT_ERRORDEF_( Too_Many_Extensions, 0x31, \ + "too many extensions" ) + + /* memory errors */ + + FT_ERRORDEF_( Out_Of_Memory, 0x40, \ + "out of memory" ) + FT_ERRORDEF_( Unlisted_Object, 0x41, \ + "unlisted object" ) + + /* stream errors */ + + FT_ERRORDEF_( Cannot_Open_Stream, 0x51, \ + "cannot open stream" ) + FT_ERRORDEF_( Invalid_Stream_Seek, 0x52, \ + "invalid stream seek" ) + FT_ERRORDEF_( Invalid_Stream_Skip, 0x53, \ + "invalid stream skip" ) + FT_ERRORDEF_( Invalid_Stream_Read, 0x54, \ + "invalid stream read" ) + FT_ERRORDEF_( Invalid_Stream_Operation, 0x55, \ + "invalid stream operation" ) + FT_ERRORDEF_( Invalid_Frame_Operation, 0x56, \ + "invalid frame operation" ) + FT_ERRORDEF_( Nested_Frame_Access, 0x57, \ + "nested frame access" ) + FT_ERRORDEF_( Invalid_Frame_Read, 0x58, \ + "invalid frame read" ) + + /* raster errors */ + + FT_ERRORDEF_( Raster_Uninitialized, 0x60, \ + "raster uninitialized" ) + FT_ERRORDEF_( Raster_Corrupted, 0x61, \ + "raster corrupted" ) + FT_ERRORDEF_( Raster_Overflow, 0x62, \ + "raster overflow" ) + FT_ERRORDEF_( Raster_Negative_Height, 0x63, \ + "negative height while rastering" ) + + /* cache errors */ + + FT_ERRORDEF_( Too_Many_Caches, 0x70, \ + "too many registered caches" ) + + /* TrueType and SFNT errors */ + + FT_ERRORDEF_( Invalid_Opcode, 0x80, \ + "invalid opcode" ) + FT_ERRORDEF_( Too_Few_Arguments, 0x81, \ + "too few arguments" ) + FT_ERRORDEF_( Stack_Overflow, 0x82, \ + "stack overflow" ) + FT_ERRORDEF_( Code_Overflow, 0x83, \ + "code overflow" ) + FT_ERRORDEF_( Bad_Argument, 0x84, \ + "bad argument" ) + FT_ERRORDEF_( Divide_By_Zero, 0x85, \ + "division by zero" ) + FT_ERRORDEF_( Invalid_Reference, 0x86, \ + "invalid reference" ) + FT_ERRORDEF_( Debug_OpCode, 0x87, \ + "found debug opcode" ) + FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88, \ + "found ENDF opcode in execution stream" ) + FT_ERRORDEF_( Nested_DEFS, 0x89, \ + "nested DEFS" ) + FT_ERRORDEF_( Invalid_CodeRange, 0x8A, \ + "invalid code range" ) + FT_ERRORDEF_( Execution_Too_Long, 0x8B, \ + "execution context too long" ) + FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C, \ + "too many function definitions" ) + FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D, \ + "too many instruction definitions" ) + FT_ERRORDEF_( Table_Missing, 0x8E, \ + "SFNT font table missing" ) + FT_ERRORDEF_( Horiz_Header_Missing, 0x8F, \ + "horizontal header (hhea) table missing" ) + FT_ERRORDEF_( Locations_Missing, 0x90, \ + "locations (loca) table missing" ) + FT_ERRORDEF_( Name_Table_Missing, 0x91, \ + "name table missing" ) + FT_ERRORDEF_( CMap_Table_Missing, 0x92, \ + "character map (cmap) table missing" ) + FT_ERRORDEF_( Hmtx_Table_Missing, 0x93, \ + "horizontal metrics (hmtx) table missing" ) + FT_ERRORDEF_( Post_Table_Missing, 0x94, \ + "PostScript (post) table missing" ) + FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95, \ + "invalid horizontal metrics" ) + FT_ERRORDEF_( Invalid_CharMap_Format, 0x96, \ + "invalid character map (cmap) format" ) + FT_ERRORDEF_( Invalid_PPem, 0x97, \ + "invalid ppem value" ) + FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98, \ + "invalid vertical metrics" ) + FT_ERRORDEF_( Could_Not_Find_Context, 0x99, \ + "could not find context" ) + FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A, \ + "invalid PostScript (post) table format" ) + FT_ERRORDEF_( Invalid_Post_Table, 0x9B, \ + "invalid PostScript (post) table" ) + + /* CFF, CID, and Type 1 errors */ + + FT_ERRORDEF_( Syntax_Error, 0xA0, \ + "opcode syntax error" ) + FT_ERRORDEF_( Stack_Underflow, 0xA1, \ + "argument stack underflow" ) + FT_ERRORDEF_( Ignore, 0xA2, \ + "ignore" ) + + /* BDF errors */ + + FT_ERRORDEF_( Missing_Startfont_Field, 0xB0, \ + "`STARTFONT' field missing" ) + FT_ERRORDEF_( Missing_Font_Field, 0xB1, \ + "`FONT' field missing" ) + FT_ERRORDEF_( Missing_Size_Field, 0xB2, \ + "`SIZE' field missing" ) + FT_ERRORDEF_( Missing_Chars_Field, 0xB3, \ + "`CHARS' field missing" ) + FT_ERRORDEF_( Missing_Startchar_Field, 0xB4, \ + "`STARTCHAR' field missing" ) + FT_ERRORDEF_( Missing_Encoding_Field, 0xB5, \ + "`ENCODING' field missing" ) + FT_ERRORDEF_( Missing_Bbx_Field, 0xB6, \ + "`BBX' field missing" ) + FT_ERRORDEF_( Bbx_Too_Big, 0xB7, \ + "`BBX' too big" ) + FT_ERRORDEF_( Corrupted_Font_Header, 0xB8, \ + "Font header corrupted or missing fields" ) + FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xB9, \ + "Font glyphs corrupted or missing fields" ) + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/fterrors.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/fterrors.h new file mode 100644 index 0000000000..6600dadd0d --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/fterrors.h @@ -0,0 +1,206 @@ +/***************************************************************************/ +/* */ +/* fterrors.h */ +/* */ +/* FreeType error code handling (specification). */ +/* */ +/* Copyright 1996-2001, 2002, 2004, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This special header file is used to define the handling of FT2 */ + /* enumeration constants. It can also be used to generate error message */ + /* strings with a small macro trick explained below. */ + /* */ + /* I - Error Formats */ + /* ----------------- */ + /* */ + /* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */ + /* defined in ftoption.h in order to make the higher byte indicate */ + /* the module where the error has happened (this is not compatible */ + /* with standard builds of FreeType 2). You can then use the macro */ + /* FT_ERROR_BASE macro to extract the generic error code from an */ + /* FT_Error value. */ + /* */ + /* */ + /* II - Error Message strings */ + /* -------------------------- */ + /* */ + /* The error definitions below are made through special macros that */ + /* allow client applications to build a table of error message strings */ + /* if they need it. The strings are not included in a normal build of */ + /* FreeType 2 to save space (most client applications do not use */ + /* them). */ + /* */ + /* To do so, you have to define the following macros before including */ + /* this file: */ + /* */ + /* FT_ERROR_START_LIST :: */ + /* This macro is called before anything else to define the start of */ + /* the error list. It is followed by several FT_ERROR_DEF calls */ + /* (see below). */ + /* */ + /* FT_ERROR_DEF( e, v, s ) :: */ + /* This macro is called to define one single error. */ + /* `e' is the error code identifier (e.g. FT_Err_Invalid_Argument). */ + /* `v' is the error numerical value. */ + /* `s' is the corresponding error string. */ + /* */ + /* FT_ERROR_END_LIST :: */ + /* This macro ends the list. */ + /* */ + /* Additionally, you have to undefine __FTERRORS_H__ before #including */ + /* this file. */ + /* */ + /* Here is a simple example: */ + /* */ + /* { */ + /* #undef __FTERRORS_H__ */ + /* #define FT_ERRORDEF( e, v, s ) { e, s }, */ + /* #define FT_ERROR_START_LIST { */ + /* #define FT_ERROR_END_LIST { 0, 0 } }; */ + /* */ + /* const struct */ + /* { */ + /* int err_code; */ + /* const char* err_msg; */ + /* } ft_errors[] = */ + /* */ + /* #include FT_ERRORS_H */ + /* } */ + /* */ + /*************************************************************************/ + + +#ifndef __FTERRORS_H__ +#define __FTERRORS_H__ + + + /* include module base error codes */ +#include FT_MODULE_ERRORS_H + + + /*******************************************************************/ + /*******************************************************************/ + /***** *****/ + /***** SETUP MACROS *****/ + /***** *****/ + /*******************************************************************/ + /*******************************************************************/ + + +#undef FT_NEED_EXTERN_C + +#undef FT_ERR_XCAT +#undef FT_ERR_CAT + +#define FT_ERR_XCAT( x, y ) x ## y +#define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y ) + + + /* FT_ERR_PREFIX is used as a prefix for error identifiers. */ + /* By default, we use `FT_Err_'. */ + /* */ +#ifndef FT_ERR_PREFIX +#define FT_ERR_PREFIX FT_Err_ +#endif + + + /* FT_ERR_BASE is used as the base for module-specific errors. */ + /* */ +#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS + +#ifndef FT_ERR_BASE +#define FT_ERR_BASE FT_Mod_Err_Base +#endif + +#else + +#undef FT_ERR_BASE +#define FT_ERR_BASE 0 + +#endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */ + + + /* If FT_ERRORDEF is not defined, we need to define a simple */ + /* enumeration type. */ + /* */ +#ifndef FT_ERRORDEF + +#define FT_ERRORDEF( e, v, s ) e = v, +#define FT_ERROR_START_LIST enum { +#define FT_ERROR_END_LIST FT_ERR_CAT( FT_ERR_PREFIX, Max ) }; + +#ifdef __cplusplus +#define FT_NEED_EXTERN_C + extern "C" { +#endif + +#endif /* !FT_ERRORDEF */ + + + /* this macro is used to define an error */ +#define FT_ERRORDEF_( e, v, s ) \ + FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s ) + + /* this is only used for <module>_Err_Ok, which must be 0! */ +#define FT_NOERRORDEF_( e, v, s ) \ + FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s ) + + +#ifdef FT_ERROR_START_LIST + FT_ERROR_START_LIST +#endif + + + /* now include the error codes */ +#include FT_ERROR_DEFINITIONS_H + + +#ifdef FT_ERROR_END_LIST + FT_ERROR_END_LIST +#endif + + + /*******************************************************************/ + /*******************************************************************/ + /***** *****/ + /***** SIMPLE CLEANUP *****/ + /***** *****/ + /*******************************************************************/ + /*******************************************************************/ + +#ifdef FT_NEED_EXTERN_C + } +#endif + +#undef FT_ERROR_START_LIST +#undef FT_ERROR_END_LIST + +#undef FT_ERRORDEF +#undef FT_ERRORDEF_ +#undef FT_NOERRORDEF_ + +#undef FT_NEED_EXTERN_C +#undef FT_ERR_CONCAT +#undef FT_ERR_BASE + + /* FT_KEEP_ERR_PREFIX is needed for ftvalid.h */ +#ifndef FT_KEEP_ERR_PREFIX +#undef FT_ERR_PREFIX +#endif + +#endif /* __FTERRORS_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftgasp.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftgasp.h new file mode 100644 index 0000000000..97cd330145 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftgasp.h @@ -0,0 +1,113 @@ +/***************************************************************************/ +/* */ +/* ftgasp.h */ +/* */ +/* Access of TrueType's `gasp' table (specification). */ +/* */ +/* Copyright 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef _FT_GASP_H_ +#define _FT_GASP_H_ + +#include <ft2build.h> +#include FT_FREETYPE_H + + /*************************************************************************** + * + * @section: + * gasp_table + * + * @title: + * Gasp Table + * + * @abstract: + * Retrieving TrueType `gasp' table entries + * + * @description: + * The function @FT_Get_Gasp can be used to query a TrueType or OpenType + * font for specific entries in their `gasp' table, if any. This is + * mainly useful when implementing native TrueType hinting with the + * bytecode interpreter to duplicate the Windows text rendering results. + */ + + /************************************************************************* + * + * @enum: + * FT_GASP_XXX + * + * @description: + * A list of values and/or bit-flags returned by the @FT_Get_Gasp + * function. + * + * @values: + * FT_GASP_NO_TABLE :: + * This special value means that there is no GASP table in this face. + * It is up to the client to decide what to do. + * + * FT_GASP_DO_GRIDFIT :: + * Grid-fitting and hinting should be performed at the specified ppem. + * This *really* means TrueType bytecode interpretation. + * + * FT_GASP_DO_GRAY :: + * Anti-aliased rendering should be performed at the specified ppem. + * + * FT_GASP_SYMMETRIC_SMOOTHING :: + * Smoothing along multiple axes must be used with ClearType. + * + * FT_GASP_SYMMETRIC_GRIDFIT :: + * Grid-fitting must be used with ClearType's symmetric smoothing. + * + * @note: + * `ClearType' is Microsoft's implementation of LCD rendering, partly + * protected by patents. + * + * @since: + * 2.3.0 + */ +#define FT_GASP_NO_TABLE -1 +#define FT_GASP_DO_GRIDFIT 0x01 +#define FT_GASP_DO_GRAY 0x02 +#define FT_GASP_SYMMETRIC_SMOOTHING 0x08 +#define FT_GASP_SYMMETRIC_GRIDFIT 0x10 + + + /************************************************************************* + * + * @func: + * FT_Get_Gasp + * + * @description: + * Read the `gasp' table from a TrueType or OpenType font file and + * return the entry corresponding to a given character pixel size. + * + * @input: + * face :: The source face handle. + * ppem :: The vertical character pixel size. + * + * @return: + * Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE is there is no + * `gasp' table in the face. + * + * @since: + * 2.3.0 + */ + FT_EXPORT( FT_Int ) + FT_Get_Gasp( FT_Face face, + FT_UInt ppem ); + +/* */ + +#endif /* _FT_GASP_H_ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftglyph.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftglyph.h new file mode 100644 index 0000000000..08058dadd1 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftglyph.h @@ -0,0 +1,575 @@ +/***************************************************************************/ +/* */ +/* ftglyph.h */ +/* */ +/* FreeType convenience functions to handle glyphs (specification). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This file contains the definition of several convenience functions */ + /* that can be used by client applications to easily retrieve glyph */ + /* bitmaps and outlines from a given face. */ + /* */ + /* These functions should be optional if you are writing a font server */ + /* or text layout engine on top of FreeType. However, they are pretty */ + /* handy for many other simple uses of the library. */ + /* */ + /*************************************************************************/ + + +#ifndef __FTGLYPH_H__ +#define __FTGLYPH_H__ + + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* glyph_management */ + /* */ + /* <Title> */ + /* Glyph Management */ + /* */ + /* <Abstract> */ + /* Generic interface to manage individual glyph data. */ + /* */ + /* <Description> */ + /* This section contains definitions used to manage glyph data */ + /* through generic FT_Glyph objects. Each of them can contain a */ + /* bitmap, a vector outline, or even images in other formats. */ + /* */ + /*************************************************************************/ + + + /* forward declaration to a private type */ + typedef struct FT_Glyph_Class_ FT_Glyph_Class; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Glyph */ + /* */ + /* <Description> */ + /* Handle to an object used to model generic glyph images. It is a */ + /* pointer to the @FT_GlyphRec structure and can contain a glyph */ + /* bitmap or pointer. */ + /* */ + /* <Note> */ + /* Glyph objects are not owned by the library. You must thus release */ + /* them manually (through @FT_Done_Glyph) _before_ calling */ + /* @FT_Done_FreeType. */ + /* */ + typedef struct FT_GlyphRec_* FT_Glyph; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_GlyphRec */ + /* */ + /* <Description> */ + /* The root glyph structure contains a given glyph image plus its */ + /* advance width in 16.16 fixed float format. */ + /* */ + /* <Fields> */ + /* library :: A handle to the FreeType library object. */ + /* */ + /* clazz :: A pointer to the glyph's class. Private. */ + /* */ + /* format :: The format of the glyph's image. */ + /* */ + /* advance :: A 16.16 vector that gives the glyph's advance width. */ + /* */ + typedef struct FT_GlyphRec_ + { + FT_Library library; + const FT_Glyph_Class* clazz; + FT_Glyph_Format format; + FT_Vector advance; + + } FT_GlyphRec; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_BitmapGlyph */ + /* */ + /* <Description> */ + /* A handle to an object used to model a bitmap glyph image. This is */ + /* a sub-class of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec. */ + /* */ + typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_BitmapGlyphRec */ + /* */ + /* <Description> */ + /* A structure used for bitmap glyph images. This really is a */ + /* `sub-class' of @FT_GlyphRec. */ + /* */ + /* <Fields> */ + /* root :: The root @FT_Glyph fields. */ + /* */ + /* left :: The left-side bearing, i.e., the horizontal distance */ + /* from the current pen position to the left border of the */ + /* glyph bitmap. */ + /* */ + /* top :: The top-side bearing, i.e., the vertical distance from */ + /* the current pen position to the top border of the glyph */ + /* bitmap. This distance is positive for upwards-y! */ + /* */ + /* bitmap :: A descriptor for the bitmap. */ + /* */ + /* <Note> */ + /* You can typecast an @FT_Glyph to @FT_BitmapGlyph if you have */ + /* `glyph->format == FT_GLYPH_FORMAT_BITMAP'. This lets you access */ + /* the bitmap's contents easily. */ + /* */ + /* The corresponding pixel buffer is always owned by @FT_BitmapGlyph */ + /* and is thus created and destroyed with it. */ + /* */ + typedef struct FT_BitmapGlyphRec_ + { + FT_GlyphRec root; + FT_Int left; + FT_Int top; + FT_Bitmap bitmap; + + } FT_BitmapGlyphRec; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_OutlineGlyph */ + /* */ + /* <Description> */ + /* A handle to an object used to model an outline glyph image. This */ + /* is a sub-class of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec. */ + /* */ + typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_OutlineGlyphRec */ + /* */ + /* <Description> */ + /* A structure used for outline (vectorial) glyph images. This */ + /* really is a `sub-class' of @FT_GlyphRec. */ + /* */ + /* <Fields> */ + /* root :: The root @FT_Glyph fields. */ + /* */ + /* outline :: A descriptor for the outline. */ + /* */ + /* <Note> */ + /* You can typecast a @FT_Glyph to @FT_OutlineGlyph if you have */ + /* `glyph->format == FT_GLYPH_FORMAT_OUTLINE'. This lets you access */ + /* the outline's content easily. */ + /* */ + /* As the outline is extracted from a glyph slot, its coordinates are */ + /* expressed normally in 26.6 pixels, unless the flag */ + /* @FT_LOAD_NO_SCALE was used in @FT_Load_Glyph() or @FT_Load_Char(). */ + /* */ + /* The outline's tables are always owned by the object and are */ + /* destroyed with it. */ + /* */ + typedef struct FT_OutlineGlyphRec_ + { + FT_GlyphRec root; + FT_Outline outline; + + } FT_OutlineGlyphRec; + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Get_Glyph */ + /* */ + /* <Description> */ + /* A function used to extract a glyph image from a slot. */ + /* */ + /* <Input> */ + /* slot :: A handle to the source glyph slot. */ + /* */ + /* <Output> */ + /* aglyph :: A handle to the glyph object. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Get_Glyph( FT_GlyphSlot slot, + FT_Glyph *aglyph ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Glyph_Copy */ + /* */ + /* <Description> */ + /* A function used to copy a glyph image. Note that the created */ + /* @FT_Glyph object must be released with @FT_Done_Glyph. */ + /* */ + /* <Input> */ + /* source :: A handle to the source glyph object. */ + /* */ + /* <Output> */ + /* target :: A handle to the target glyph object. 0 in case of */ + /* error. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Glyph_Copy( FT_Glyph source, + FT_Glyph *target ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Glyph_Transform */ + /* */ + /* <Description> */ + /* Transforms a glyph image if its format is scalable. */ + /* */ + /* <InOut> */ + /* glyph :: A handle to the target glyph object. */ + /* */ + /* <Input> */ + /* matrix :: A pointer to a 2x2 matrix to apply. */ + /* */ + /* delta :: A pointer to a 2d vector to apply. Coordinates are */ + /* expressed in 1/64th of a pixel. */ + /* */ + /* <Return> */ + /* FreeType error code (if not 0, the glyph format is not scalable). */ + /* */ + /* <Note> */ + /* The 2x2 transformation matrix is also applied to the glyph's */ + /* advance vector. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Glyph_Transform( FT_Glyph glyph, + FT_Matrix* matrix, + FT_Vector* delta ); + + + /*************************************************************************/ + /* */ + /* <Enum> */ + /* FT_Glyph_BBox_Mode */ + /* */ + /* <Description> */ + /* The mode how the values of @FT_Glyph_Get_CBox are returned. */ + /* */ + /* <Values> */ + /* FT_GLYPH_BBOX_UNSCALED :: */ + /* Return unscaled font units. */ + /* */ + /* FT_GLYPH_BBOX_SUBPIXELS :: */ + /* Return unfitted 26.6 coordinates. */ + /* */ + /* FT_GLYPH_BBOX_GRIDFIT :: */ + /* Return grid-fitted 26.6 coordinates. */ + /* */ + /* FT_GLYPH_BBOX_TRUNCATE :: */ + /* Return coordinates in integer pixels. */ + /* */ + /* FT_GLYPH_BBOX_PIXELS :: */ + /* Return grid-fitted pixel coordinates. */ + /* */ + typedef enum FT_Glyph_BBox_Mode_ + { + FT_GLYPH_BBOX_UNSCALED = 0, + FT_GLYPH_BBOX_SUBPIXELS = 0, + FT_GLYPH_BBOX_GRIDFIT = 1, + FT_GLYPH_BBOX_TRUNCATE = 2, + FT_GLYPH_BBOX_PIXELS = 3 + + } FT_Glyph_BBox_Mode; + + + /*************************************************************************/ + /* */ + /* <Enum> */ + /* ft_glyph_bbox_xxx */ + /* */ + /* <Description> */ + /* These constants are deprecated. Use the corresponding */ + /* @FT_Glyph_BBox_Mode values instead. */ + /* */ + /* <Values> */ + /* ft_glyph_bbox_unscaled :: See @FT_GLYPH_BBOX_UNSCALED. */ + /* ft_glyph_bbox_subpixels :: See @FT_GLYPH_BBOX_SUBPIXELS. */ + /* ft_glyph_bbox_gridfit :: See @FT_GLYPH_BBOX_GRIDFIT. */ + /* ft_glyph_bbox_truncate :: See @FT_GLYPH_BBOX_TRUNCATE. */ + /* ft_glyph_bbox_pixels :: See @FT_GLYPH_BBOX_PIXELS. */ + /* */ +#define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED +#define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS +#define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT +#define ft_glyph_bbox_truncate FT_GLYPH_BBOX_TRUNCATE +#define ft_glyph_bbox_pixels FT_GLYPH_BBOX_PIXELS + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Glyph_Get_CBox */ + /* */ + /* <Description> */ + /* Return a glyph's `control box'. The control box encloses all the */ + /* outline's points, including Bézier control points. Though it */ + /* coincides with the exact bounding box for most glyphs, it can be */ + /* slightly larger in some situations (like when rotating an outline */ + /* which contains Bézier outside arcs). */ + /* */ + /* Computing the control box is very fast, while getting the bounding */ + /* box can take much more time as it needs to walk over all segments */ + /* and arcs in the outline. To get the latter, you can use the */ + /* `ftbbox' component which is dedicated to this single task. */ + /* */ + /* <Input> */ + /* glyph :: A handle to the source glyph object. */ + /* */ + /* mode :: The mode which indicates how to interpret the returned */ + /* bounding box values. */ + /* */ + /* <Output> */ + /* acbox :: The glyph coordinate bounding box. Coordinates are */ + /* expressed in 1/64th of pixels if it is grid-fitted. */ + /* */ + /* <Note> */ + /* Coordinates are relative to the glyph origin, using the Y-upwards */ + /* convention. */ + /* */ + /* If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode' */ + /* must be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font */ + /* units in 26.6 pixel format. The value @FT_GLYPH_BBOX_SUBPIXELS */ + /* is another name for this constant. */ + /* */ + /* Note that the maximum coordinates are exclusive, which means that */ + /* one can compute the width and height of the glyph image (be it in */ + /* integer or 26.6 pixels) as: */ + /* */ + /* { */ + /* width = bbox.xMax - bbox.xMin; */ + /* height = bbox.yMax - bbox.yMin; */ + /* } */ + /* */ + /* Note also that for 26.6 coordinates, if `bbox_mode' is set to */ + /* @FT_GLYPH_BBOX_GRIDFIT, the coordinates will also be grid-fitted, */ + /* which corresponds to: */ + /* */ + /* { */ + /* bbox.xMin = FLOOR(bbox.xMin); */ + /* bbox.yMin = FLOOR(bbox.yMin); */ + /* bbox.xMax = CEILING(bbox.xMax); */ + /* bbox.yMax = CEILING(bbox.yMax); */ + /* } */ + /* */ + /* To get the bbox in pixel coordinates, set `bbox_mode' to */ + /* @FT_GLYPH_BBOX_TRUNCATE. */ + /* */ + /* To get the bbox in grid-fitted pixel coordinates, set `bbox_mode' */ + /* to @FT_GLYPH_BBOX_PIXELS. */ + /* */ + FT_EXPORT( void ) + FT_Glyph_Get_CBox( FT_Glyph glyph, + FT_UInt bbox_mode, + FT_BBox *acbox ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Glyph_To_Bitmap */ + /* */ + /* <Description> */ + /* Converts a given glyph object to a bitmap glyph object. */ + /* */ + /* <InOut> */ + /* the_glyph :: A pointer to a handle to the target glyph. */ + /* */ + /* <Input> */ + /* render_mode :: An enumeration that describe how the data is */ + /* rendered. */ + /* */ + /* origin :: A pointer to a vector used to translate the glyph */ + /* image before rendering. Can be 0 (if no */ + /* translation). The origin is expressed in */ + /* 26.6 pixels. */ + /* */ + /* destroy :: A boolean that indicates that the original glyph */ + /* image should be destroyed by this function. It is */ + /* never destroyed in case of error. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* The glyph image is translated with the `origin' vector before */ + /* rendering. */ + /* */ + /* The first parameter is a pointer to an @FT_Glyph handle, that will */ + /* be replaced by this function. Typically, you would use (omitting */ + /* error handling): */ + /* */ + /* */ + /* { */ + /* FT_Glyph glyph; */ + /* FT_BitmapGlyph glyph_bitmap; */ + /* */ + /* */ + /* // load glyph */ + /* error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT ); */ + /* */ + /* // extract glyph image */ + /* error = FT_Get_Glyph( face->glyph, &glyph ); */ + /* */ + /* // convert to a bitmap (default render mode + destroy old) */ + /* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) */ + /* { */ + /* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_DEFAULT, */ + /* 0, 1 ); */ + /* if ( error ) // glyph unchanged */ + /* ... */ + /* } */ + /* */ + /* // access bitmap content by typecasting */ + /* glyph_bitmap = (FT_BitmapGlyph)glyph; */ + /* */ + /* // do funny stuff with it, like blitting/drawing */ + /* ... */ + /* */ + /* // discard glyph image (bitmap or not) */ + /* FT_Done_Glyph( glyph ); */ + /* } */ + /* */ + /* */ + /* This function does nothing if the glyph format isn't scalable. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Glyph_To_Bitmap( FT_Glyph* the_glyph, + FT_Render_Mode render_mode, + FT_Vector* origin, + FT_Bool destroy ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Done_Glyph */ + /* */ + /* <Description> */ + /* Destroys a given glyph. */ + /* */ + /* <Input> */ + /* glyph :: A handle to the target glyph object. */ + /* */ + FT_EXPORT( void ) + FT_Done_Glyph( FT_Glyph glyph ); + + /* */ + + + /* other helpful functions */ + + /*************************************************************************/ + /* */ + /* <Section> */ + /* computations */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Matrix_Multiply */ + /* */ + /* <Description> */ + /* Performs the matrix operation `b = a*b'. */ + /* */ + /* <Input> */ + /* a :: A pointer to matrix `a'. */ + /* */ + /* <InOut> */ + /* b :: A pointer to matrix `b'. */ + /* */ + /* <Note> */ + /* The result is undefined if either `a' or `b' is zero. */ + /* */ + FT_EXPORT( void ) + FT_Matrix_Multiply( const FT_Matrix* a, + FT_Matrix* b ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Matrix_Invert */ + /* */ + /* <Description> */ + /* Inverts a 2x2 matrix. Returns an error if it can't be inverted. */ + /* */ + /* <InOut> */ + /* matrix :: A pointer to the target matrix. Remains untouched in */ + /* case of error. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Matrix_Invert( FT_Matrix* matrix ); + + + /* */ + + +FT_END_HEADER + +#endif /* __FTGLYPH_H__ */ + + +/* END */ + + +/* Local Variables: */ +/* coding: utf-8 */ +/* End: */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftgxval.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftgxval.h new file mode 100644 index 0000000000..c7ea861a0d --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftgxval.h @@ -0,0 +1,358 @@ +/***************************************************************************/ +/* */ +/* ftgxval.h */ +/* */ +/* FreeType API for validating TrueTypeGX/AAT tables (specification). */ +/* */ +/* Copyright 2004, 2005, 2006 by */ +/* Masatake YAMATO, Redhat K.K, */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +/***************************************************************************/ +/* */ +/* gxvalid is derived from both gxlayout module and otvalid module. */ +/* Development of gxlayout is supported by the Information-technology */ +/* Promotion Agency(IPA), Japan. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTGXVAL_H__ +#define __FTGXVAL_H__ + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* gx_validation */ + /* */ + /* <Title> */ + /* TrueTypeGX/AAT Validation */ + /* */ + /* <Abstract> */ + /* An API to validate TrueTypeGX/AAT tables. */ + /* */ + /* <Description> */ + /* This section contains the declaration of functions to validate */ + /* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */ + /* trak, prop, lcar). */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* */ + /* Warning: Use FT_VALIDATE_XXX to validate a table. */ + /* Following definitions are for gxvalid developers. */ + /* */ + /* */ + /*************************************************************************/ + +#define FT_VALIDATE_feat_INDEX 0 +#define FT_VALIDATE_mort_INDEX 1 +#define FT_VALIDATE_morx_INDEX 2 +#define FT_VALIDATE_bsln_INDEX 3 +#define FT_VALIDATE_just_INDEX 4 +#define FT_VALIDATE_kern_INDEX 5 +#define FT_VALIDATE_opbd_INDEX 6 +#define FT_VALIDATE_trak_INDEX 7 +#define FT_VALIDATE_prop_INDEX 8 +#define FT_VALIDATE_lcar_INDEX 9 +#define FT_VALIDATE_GX_LAST_INDEX FT_VALIDATE_lcar_INDEX + + + /************************************************************************* + * + * @macro: + * FT_VALIDATE_GX_LENGTH + * + * @description: + * The number of tables checked in this module. Use it as a parameter + * for the `table-length' argument of function @FT_TrueTypeGX_Validate. + */ +#define FT_VALIDATE_GX_LENGTH (FT_VALIDATE_GX_LAST_INDEX + 1) + + /* */ + + /* Up to 0x1000 is used by otvalid. + Ox2xxx is reserved for feature OT extension. */ +#define FT_VALIDATE_GX_START 0x4000 +#define FT_VALIDATE_GX_BITFIELD( tag ) \ + ( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX ) + + + /********************************************************************** + * + * @enum: + * FT_VALIDATE_GXXXX + * + * @description: + * A list of bit-field constants used with @FT_TrueTypeGX_Validate to + * indicate which TrueTypeGX/AAT Type tables should be validated. + * + * @values: + * FT_VALIDATE_feat :: + * Validate `feat' table. + * + * FT_VALIDATE_mort :: + * Validate `mort' table. + * + * FT_VALIDATE_morx :: + * Validate `morx' table. + * + * FT_VALIDATE_bsln :: + * Validate `bsln' table. + * + * FT_VALIDATE_just :: + * Validate `just' table. + * + * FT_VALIDATE_kern :: + * Validate `kern' table. + * + * FT_VALIDATE_opbd :: + * Validate `opbd' table. + * + * FT_VALIDATE_trak :: + * Validate `trak' table. + * + * FT_VALIDATE_prop :: + * Validate `prop' table. + * + * FT_VALIDATE_lcar :: + * Validate `lcar' table. + * + * FT_VALIDATE_GX :: + * Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern, + * opbd, trak, prop and lcar). + * + */ + +#define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat ) +#define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort ) +#define FT_VALIDATE_morx FT_VALIDATE_GX_BITFIELD( morx ) +#define FT_VALIDATE_bsln FT_VALIDATE_GX_BITFIELD( bsln ) +#define FT_VALIDATE_just FT_VALIDATE_GX_BITFIELD( just ) +#define FT_VALIDATE_kern FT_VALIDATE_GX_BITFIELD( kern ) +#define FT_VALIDATE_opbd FT_VALIDATE_GX_BITFIELD( opbd ) +#define FT_VALIDATE_trak FT_VALIDATE_GX_BITFIELD( trak ) +#define FT_VALIDATE_prop FT_VALIDATE_GX_BITFIELD( prop ) +#define FT_VALIDATE_lcar FT_VALIDATE_GX_BITFIELD( lcar ) + +#define FT_VALIDATE_GX ( FT_VALIDATE_feat | \ + FT_VALIDATE_mort | \ + FT_VALIDATE_morx | \ + FT_VALIDATE_bsln | \ + FT_VALIDATE_just | \ + FT_VALIDATE_kern | \ + FT_VALIDATE_opbd | \ + FT_VALIDATE_trak | \ + FT_VALIDATE_prop | \ + FT_VALIDATE_lcar ) + + + /* */ + + /********************************************************************** + * + * @function: + * FT_TrueTypeGX_Validate + * + * @description: + * Validate various TrueTypeGX tables to assure that all offsets and + * indices are valid. The idea is that a higher-level library which + * actually does the text layout can access those tables without + * error checking (which can be quite time consuming). + * + * @input: + * face :: + * A handle to the input face. + * + * validation_flags :: + * A bit field which specifies the tables to be validated. See + * @FT_VALIDATE_GXXXX for possible values. + * + * table_length :: + * The size of the `tables' array. Normally, @FT_VALIDATE_GX_LENGTH + * should be passed. + * + * @output: + * tables :: + * The array where all validated sfnt tables are stored. + * The array itself must be allocated by a client. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * This function only works with TrueTypeGX fonts, returning an error + * otherwise. + * + * After use, the application should deallocate the buffers pointed to by + * each `tables' element, by calling @FT_TrueTypeGX_Free. A NULL value + * indicates that the table either doesn't exist in the font, the + * application hasn't asked for validation, or the validator doesn't have + * the ability to validate the sfnt table. + */ + FT_EXPORT( FT_Error ) + FT_TrueTypeGX_Validate( FT_Face face, + FT_UInt validation_flags, + FT_Bytes tables[FT_VALIDATE_GX_LENGTH], + FT_UInt table_length ); + + + /* */ + + /********************************************************************** + * + * @function: + * FT_TrueTypeGX_Free + * + * @description: + * Free the buffer allocated by TrueTypeGX validator. + * + * @input: + * face :: + * A handle to the input face. + * + * table :: + * The pointer to the buffer allocated by + * @FT_TrueTypeGX_Validate. + * + * @note: + * This function must be used to free the buffer allocated by + * @FT_TrueTypeGX_Validate only. + */ + FT_EXPORT( void ) + FT_TrueTypeGX_Free( FT_Face face, + FT_Bytes table ); + + + /* */ + + /********************************************************************** + * + * @enum: + * FT_VALIDATE_CKERNXXX + * + * @description: + * A list of bit-field constants used with @FT_ClassicKern_Validate + * to indicate the classic kern dialect or dialects. If the selected + * type doesn't fit, @FT_ClassicKern_Validate regards the table as + * invalid. + * + * @values: + * FT_VALIDATE_MS :: + * Handle the `kern' table as a classic Microsoft kern table. + * + * FT_VALIDATE_APPLE :: + * Handle the `kern' table as a classic Apple kern table. + * + * FT_VALIDATE_CKERN :: + * Handle the `kern' as either classic Apple or Microsoft kern table. + */ +#define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 ) +#define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 ) + +#define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE ) + + + /* */ + + /********************************************************************** + * + * @function: + * FT_ClassicKern_Validate + * + * @description: + * Validate classic (16bit format) kern table to assure that the offsets + * and indices are valid. The idea is that a higher-level library which + * actually does the text layout can access those tables without error + * checking (which can be quite time consuming). + * + * The `kern' table validator in @FT_TrueTypeGX_Validate deals with both + * the new 32bit format and the classic 16bit format, while + * FT_ClassicKern_Validate only supports the classic 16bit format. + * + * @input: + * face :: + * A handle to the input face. + * + * validation_flags :: + * A bit field which specifies the dialect to be validated. See + * @FT_VALIDATE_CKERNXXX for possible values. + * + * @output: + * ckern_table :: + * A pointer to the kern table. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * After use, the application should deallocate the buffers pointed to by + * `ckern_table', by calling @FT_ClassicKern_Free. A NULL value + * indicates that the table doesn't exist in the font. + */ + FT_EXPORT( FT_Error ) + FT_ClassicKern_Validate( FT_Face face, + FT_UInt validation_flags, + FT_Bytes *ckern_table ); + + + /* */ + + /********************************************************************** + * + * @function: + * FT_ClassicKern_Free + * + * @description: + * Free the buffer allocated by classic Kern validator. + * + * @input: + * face :: + * A handle to the input face. + * + * table :: + * The pointer to the buffer that is allocated by + * @FT_ClassicKern_Validate. + * + * @note: + * This function must be used to free the buffer allocated by + * @FT_ClassicKern_Validate only. + */ + FT_EXPORT( void ) + FT_ClassicKern_Free( FT_Face face, + FT_Bytes table ); + + + /* */ + + +FT_END_HEADER + +#endif /* __FTGXVAL_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftgzip.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftgzip.h new file mode 100644 index 0000000000..9893437bfa --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftgzip.h @@ -0,0 +1,102 @@ +/***************************************************************************/ +/* */ +/* ftgzip.h */ +/* */ +/* Gzip-compressed stream support. */ +/* */ +/* Copyright 2002, 2003, 2004, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTGZIP_H__ +#define __FTGZIP_H__ + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + /*************************************************************************/ + /* */ + /* <Section> */ + /* gzip */ + /* */ + /* <Title> */ + /* GZIP Streams */ + /* */ + /* <Abstract> */ + /* Using gzip-compressed font files. */ + /* */ + /* <Description> */ + /* This section contains the declaration of Gzip-specific functions. */ + /* */ + /*************************************************************************/ + + + /************************************************************************ + * + * @function: + * FT_Stream_OpenGzip + * + * @description: + * Open a new stream to parse gzip-compressed font files. This is + * mainly used to support the compressed `*.pcf.gz' fonts that come + * with XFree86. + * + * @input: + * stream :: + * The target embedding stream. + * + * source :: + * The source stream. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * The source stream must be opened _before_ calling this function. + * + * Calling the internal function `FT_Stream_Close' on the new stream will + * *not* call `FT_Stream_Close' on the source stream. None of the stream + * objects will be released to the heap. + * + * The stream implementation is very basic and resets the decompression + * process each time seeking backwards is needed within the stream. + * + * In certain builds of the library, gzip compression recognition is + * automatically handled when calling @FT_New_Face or @FT_Open_Face. + * This means that if no font driver is capable of handling the raw + * compressed file, the library will try to open a gzipped stream from + * it and re-open the face with it. + * + * This function may return `FT_Err_Unimplemented_Feature' if your build + * of FreeType was not compiled with zlib support. + */ + FT_EXPORT( FT_Error ) + FT_Stream_OpenGzip( FT_Stream stream, + FT_Stream source ); + + /* */ + + +FT_END_HEADER + +#endif /* __FTGZIP_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftimage.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftimage.h new file mode 100644 index 0000000000..1c428f117d --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftimage.h @@ -0,0 +1,1237 @@ +/***************************************************************************/ +/* */ +/* ftimage.h */ +/* */ +/* FreeType glyph image formats and default raster interface */ +/* (specification). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + /*************************************************************************/ + /* */ + /* Note: A `raster' is simply a scan-line converter, used to render */ + /* FT_Outlines into FT_Bitmaps. */ + /* */ + /*************************************************************************/ + + +#ifndef __FTIMAGE_H__ +#define __FTIMAGE_H__ + + +/* _STANDALONE_ is from ftgrays.c */ +#ifndef _STANDALONE_ +#include <ft2build.h> +#endif + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* basic_types */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Pos */ + /* */ + /* <Description> */ + /* The type FT_Pos is a 32-bit integer used to store vectorial */ + /* coordinates. Depending on the context, these can represent */ + /* distances in integer font units, or 16,16, or 26.6 fixed float */ + /* pixel coordinates. */ + /* */ + typedef signed long FT_Pos; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_Vector */ + /* */ + /* <Description> */ + /* A simple structure used to store a 2D vector; coordinates are of */ + /* the FT_Pos type. */ + /* */ + /* <Fields> */ + /* x :: The horizontal coordinate. */ + /* y :: The vertical coordinate. */ + /* */ + typedef struct FT_Vector_ + { + FT_Pos x; + FT_Pos y; + + } FT_Vector; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_BBox */ + /* */ + /* <Description> */ + /* A structure used to hold an outline's bounding box, i.e., the */ + /* coordinates of its extrema in the horizontal and vertical */ + /* directions. */ + /* */ + /* <Fields> */ + /* xMin :: The horizontal minimum (left-most). */ + /* */ + /* yMin :: The vertical minimum (bottom-most). */ + /* */ + /* xMax :: The horizontal maximum (right-most). */ + /* */ + /* yMax :: The vertical maximum (top-most). */ + /* */ + typedef struct FT_BBox_ + { + FT_Pos xMin, yMin; + FT_Pos xMax, yMax; + + } FT_BBox; + + + /*************************************************************************/ + /* */ + /* <Enum> */ + /* FT_Pixel_Mode */ + /* */ + /* <Description> */ + /* An enumeration type used to describe the format of pixels in a */ + /* given bitmap. Note that additional formats may be added in the */ + /* future. */ + /* */ + /* <Values> */ + /* FT_PIXEL_MODE_NONE :: */ + /* Value 0 is reserved. */ + /* */ + /* FT_PIXEL_MODE_MONO :: */ + /* A monochrome bitmap, using 1 bit per pixel. Note that pixels */ + /* are stored in most-significant order (MSB), which means that */ + /* the left-most pixel in a byte has value 128. */ + /* */ + /* FT_PIXEL_MODE_GRAY :: */ + /* An 8-bit bitmap, generally used to represent anti-aliased glyph */ + /* images. Each pixel is stored in one byte. Note that the number */ + /* of value `gray' levels is stored in the `num_bytes' field of */ + /* the @FT_Bitmap structure (it generally is 256). */ + /* */ + /* FT_PIXEL_MODE_GRAY2 :: */ + /* A 2-bit/pixel bitmap, used to represent embedded anti-aliased */ + /* bitmaps in font files according to the OpenType specification. */ + /* We haven't found a single font using this format, however. */ + /* */ + /* FT_PIXEL_MODE_GRAY4 :: */ + /* A 4-bit/pixel bitmap, used to represent embedded anti-aliased */ + /* bitmaps in font files according to the OpenType specification. */ + /* We haven't found a single font using this format, however. */ + /* */ + /* FT_PIXEL_MODE_LCD :: */ + /* An 8-bit bitmap, used to represent RGB or BGR decimated glyph */ + /* images used for display on LCD displays; the bitmap is three */ + /* times wider than the original glyph image. See also */ + /* @FT_RENDER_MODE_LCD. */ + /* */ + /* FT_PIXEL_MODE_LCD_V :: */ + /* An 8-bit bitmap, used to represent RGB or BGR decimated glyph */ + /* images used for display on rotated LCD displays; the bitmap */ + /* is three times taller than the original glyph image. See also */ + /* @FT_RENDER_MODE_LCD_V. */ + /* */ + typedef enum FT_Pixel_Mode_ + { + FT_PIXEL_MODE_NONE = 0, + FT_PIXEL_MODE_MONO, + FT_PIXEL_MODE_GRAY, + FT_PIXEL_MODE_GRAY2, + FT_PIXEL_MODE_GRAY4, + FT_PIXEL_MODE_LCD, + FT_PIXEL_MODE_LCD_V, + + FT_PIXEL_MODE_MAX /* do not remove */ + + } FT_Pixel_Mode; + + + /*************************************************************************/ + /* */ + /* <Enum> */ + /* ft_pixel_mode_xxx */ + /* */ + /* <Description> */ + /* A list of deprecated constants. Use the corresponding */ + /* @FT_Pixel_Mode values instead. */ + /* */ + /* <Values> */ + /* ft_pixel_mode_none :: See @FT_PIXEL_MODE_NONE. */ + /* ft_pixel_mode_mono :: See @FT_PIXEL_MODE_MONO. */ + /* ft_pixel_mode_grays :: See @FT_PIXEL_MODE_GRAY. */ + /* ft_pixel_mode_pal2 :: See @FT_PIXEL_MODE_GRAY2. */ + /* ft_pixel_mode_pal4 :: See @FT_PIXEL_MODE_GRAY4. */ + /* */ +#define ft_pixel_mode_none FT_PIXEL_MODE_NONE +#define ft_pixel_mode_mono FT_PIXEL_MODE_MONO +#define ft_pixel_mode_grays FT_PIXEL_MODE_GRAY +#define ft_pixel_mode_pal2 FT_PIXEL_MODE_GRAY2 +#define ft_pixel_mode_pal4 FT_PIXEL_MODE_GRAY4 + + /* */ + +#if 0 + + /*************************************************************************/ + /* */ + /* <Enum> */ + /* FT_Palette_Mode */ + /* */ + /* <Description> */ + /* THIS TYPE IS DEPRECATED. DO NOT USE IT! */ + /* */ + /* An enumeration type to describe the format of a bitmap palette, */ + /* used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8. */ + /* */ + /* <Fields> */ + /* ft_palette_mode_rgb :: The palette is an array of 3-bytes RGB */ + /* records. */ + /* */ + /* ft_palette_mode_rgba :: The palette is an array of 4-bytes RGBA */ + /* records. */ + /* */ + /* <Note> */ + /* As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by */ + /* FreeType, these types are not handled by the library itself. */ + /* */ + typedef enum FT_Palette_Mode_ + { + ft_palette_mode_rgb = 0, + ft_palette_mode_rgba, + + ft_palettte_mode_max /* do not remove */ + + } FT_Palette_Mode; + + /* */ + +#endif + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_Bitmap */ + /* */ + /* <Description> */ + /* A structure used to describe a bitmap or pixmap to the raster. */ + /* Note that we now manage pixmaps of various depths through the */ + /* `pixel_mode' field. */ + /* */ + /* <Fields> */ + /* rows :: The number of bitmap rows. */ + /* */ + /* width :: The number of pixels in bitmap row. */ + /* */ + /* pitch :: The pitch's absolute value is the number of bytes */ + /* taken by one bitmap row, including padding. */ + /* However, the pitch is positive when the bitmap has */ + /* a `down' flow, and negative when it has an `up' */ + /* flow. In all cases, the pitch is an offset to add */ + /* to a bitmap pointer in order to go down one row. */ + /* */ + /* buffer :: A typeless pointer to the bitmap buffer. This */ + /* value should be aligned on 32-bit boundaries in */ + /* most cases. */ + /* */ + /* num_grays :: This field is only used with */ + /* @FT_PIXEL_MODE_GRAY; it gives the number of gray */ + /* levels used in the bitmap. */ + /* */ + /* pixel_mode :: The pixel mode, i.e., how pixel bits are stored. */ + /* See @FT_Pixel_Mode for possible values. */ + /* */ + /* palette_mode :: This field is intended for paletted pixel modes; */ + /* it indicates how the palette is stored. Not */ + /* used currently. */ + /* */ + /* palette :: A typeless pointer to the bitmap palette; this */ + /* field is intended for paletted pixel modes. Not */ + /* used currently. */ + /* */ + /* <Note> */ + /* For now, the only pixel modes supported by FreeType are mono and */ + /* grays. However, drivers might be added in the future to support */ + /* more `colorful' options. */ + /* */ + typedef struct FT_Bitmap_ + { + int rows; + int width; + int pitch; + unsigned char* buffer; + short num_grays; + char pixel_mode; + char palette_mode; + void* palette; + + } FT_Bitmap; + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* outline_processing */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_Outline */ + /* */ + /* <Description> */ + /* This structure is used to describe an outline to the scan-line */ + /* converter. */ + /* */ + /* <Fields> */ + /* n_contours :: The number of contours in the outline. */ + /* */ + /* n_points :: The number of points in the outline. */ + /* */ + /* points :: A pointer to an array of `n_points' @FT_Vector */ + /* elements, giving the outline's point coordinates. */ + /* */ + /* tags :: A pointer to an array of `n_points' chars, giving */ + /* each outline point's type. If bit 0 is unset, the */ + /* point is `off' the curve, i.e., a Bézier control */ + /* point, while it is `on' when set. */ + /* */ + /* Bit 1 is meaningful for `off' points only. If set, */ + /* it indicates a third-order Bézier arc control point; */ + /* and a second-order control point if unset. */ + /* */ + /* contours :: An array of `n_contours' shorts, giving the end */ + /* point of each contour within the outline. For */ + /* example, the first contour is defined by the points */ + /* `0' to `contours[0]', the second one is defined by */ + /* the points `contours[0]+1' to `contours[1]', etc. */ + /* */ + /* flags :: A set of bit flags used to characterize the outline */ + /* and give hints to the scan-converter and hinter on */ + /* how to convert/grid-fit it. See @FT_OUTLINE_FLAGS. */ + /* */ + typedef struct FT_Outline_ + { + short n_contours; /* number of contours in glyph */ + short n_points; /* number of points in the glyph */ + + FT_Vector* points; /* the outline's points */ + char* tags; /* the points flags */ + short* contours; /* the contour end points */ + + int flags; /* outline masks */ + + } FT_Outline; + + + /*************************************************************************/ + /* */ + /* <Enum> */ + /* FT_OUTLINE_FLAGS */ + /* */ + /* <Description> */ + /* A list of bit-field constants use for the flags in an outline's */ + /* `flags' field. */ + /* */ + /* <Values> */ + /* FT_OUTLINE_NONE :: Value 0 is reserved. */ + /* */ + /* FT_OUTLINE_OWNER :: If set, this flag indicates that the */ + /* outline's field arrays (i.e., */ + /* `points', `flags' & `contours') are */ + /* `owned' by the outline object, and */ + /* should thus be freed when it is */ + /* destroyed. */ + /* */ + /* FT_OUTLINE_EVEN_ODD_FILL :: By default, outlines are filled using */ + /* the non-zero winding rule. If set to */ + /* 1, the outline will be filled using */ + /* the even-odd fill rule (only works */ + /* with the smooth raster). */ + /* */ + /* FT_OUTLINE_REVERSE_FILL :: By default, outside contours of an */ + /* outline are oriented in clock-wise */ + /* direction, as defined in the TrueType */ + /* specification. This flag is set if */ + /* the outline uses the opposite */ + /* direction (typically for Type 1 */ + /* fonts). This flag is ignored by the */ + /* scan-converter. */ + /* */ + /* FT_OUTLINE_IGNORE_DROPOUTS :: By default, the scan converter will */ + /* try to detect drop-outs in an outline */ + /* and correct the glyph bitmap to */ + /* ensure consistent shape continuity. */ + /* If set, this flag hints the scan-line */ + /* converter to ignore such cases. */ + /* */ + /* FT_OUTLINE_HIGH_PRECISION :: This flag indicates that the */ + /* scan-line converter should try to */ + /* convert this outline to bitmaps with */ + /* the highest possible quality. It is */ + /* typically set for small character */ + /* sizes. Note that this is only a */ + /* hint, that might be completely */ + /* ignored by a given scan-converter. */ + /* */ + /* FT_OUTLINE_SINGLE_PASS :: This flag is set to force a given */ + /* scan-converter to only use a single */ + /* pass over the outline to render a */ + /* bitmap glyph image. Normally, it is */ + /* set for very large character sizes. */ + /* It is only a hint, that might be */ + /* completely ignored by a given */ + /* scan-converter. */ + /* */ +#define FT_OUTLINE_NONE 0x0 +#define FT_OUTLINE_OWNER 0x1 +#define FT_OUTLINE_EVEN_ODD_FILL 0x2 +#define FT_OUTLINE_REVERSE_FILL 0x4 +#define FT_OUTLINE_IGNORE_DROPOUTS 0x8 + +#define FT_OUTLINE_HIGH_PRECISION 0x100 +#define FT_OUTLINE_SINGLE_PASS 0x200 + + + /************************************************************************* + * + * @enum: + * ft_outline_flags + * + * @description: + * These constants are deprecated. Please use the corresponding + * @FT_OUTLINE_FLAGS values. + * + * @values: + * ft_outline_none :: See @FT_OUTLINE_NONE. + * ft_outline_owner :: See @FT_OUTLINE_OWNER. + * ft_outline_even_odd_fill :: See @FT_OUTLINE_EVEN_ODD_FILL. + * ft_outline_reverse_fill :: See @FT_OUTLINE_REVERSE_FILL. + * ft_outline_ignore_dropouts :: See @FT_OUTLINE_IGNORE_DROPOUTS. + * ft_outline_high_precision :: See @FT_OUTLINE_HIGH_PRECISION. + * ft_outline_single_pass :: See @FT_OUTLINE_SINGLE_PASS. + */ +#define ft_outline_none FT_OUTLINE_NONE +#define ft_outline_owner FT_OUTLINE_OWNER +#define ft_outline_even_odd_fill FT_OUTLINE_EVEN_ODD_FILL +#define ft_outline_reverse_fill FT_OUTLINE_REVERSE_FILL +#define ft_outline_ignore_dropouts FT_OUTLINE_IGNORE_DROPOUTS +#define ft_outline_high_precision FT_OUTLINE_HIGH_PRECISION +#define ft_outline_single_pass FT_OUTLINE_SINGLE_PASS + + /* */ + +#define FT_CURVE_TAG( flag ) ( flag & 3 ) + +#define FT_CURVE_TAG_ON 1 +#define FT_CURVE_TAG_CONIC 0 +#define FT_CURVE_TAG_CUBIC 2 + +#define FT_CURVE_TAG_TOUCH_X 8 /* reserved for the TrueType hinter */ +#define FT_CURVE_TAG_TOUCH_Y 16 /* reserved for the TrueType hinter */ + +#define FT_CURVE_TAG_TOUCH_BOTH ( FT_CURVE_TAG_TOUCH_X | \ + FT_CURVE_TAG_TOUCH_Y ) + +#define FT_Curve_Tag_On FT_CURVE_TAG_ON +#define FT_Curve_Tag_Conic FT_CURVE_TAG_CONIC +#define FT_Curve_Tag_Cubic FT_CURVE_TAG_CUBIC +#define FT_Curve_Tag_Touch_X FT_CURVE_TAG_TOUCH_X +#define FT_Curve_Tag_Touch_Y FT_CURVE_TAG_TOUCH_Y + + /*************************************************************************/ + /* */ + /* <FuncType> */ + /* FT_Outline_MoveToFunc */ + /* */ + /* <Description> */ + /* A function pointer type used to describe the signature of a `move */ + /* to' function during outline walking/decomposition. */ + /* */ + /* A `move to' is emitted to start a new contour in an outline. */ + /* */ + /* <Input> */ + /* to :: A pointer to the target point of the `move to'. */ + /* */ + /* user :: A typeless pointer which is passed from the caller of the */ + /* decomposition function. */ + /* */ + /* <Return> */ + /* Error code. 0 means success. */ + /* */ + typedef int + (*FT_Outline_MoveToFunc)( const FT_Vector* to, + void* user ); + +#define FT_Outline_MoveTo_Func FT_Outline_MoveToFunc + + /*************************************************************************/ + /* */ + /* <FuncType> */ + /* FT_Outline_LineToFunc */ + /* */ + /* <Description> */ + /* A function pointer type used to describe the signature of a `line */ + /* to' function during outline walking/decomposition. */ + /* */ + /* A `line to' is emitted to indicate a segment in the outline. */ + /* */ + /* <Input> */ + /* to :: A pointer to the target point of the `line to'. */ + /* */ + /* user :: A typeless pointer which is passed from the caller of the */ + /* decomposition function. */ + /* */ + /* <Return> */ + /* Error code. 0 means success. */ + /* */ + typedef int + (*FT_Outline_LineToFunc)( const FT_Vector* to, + void* user ); + +#define FT_Outline_LineTo_Func FT_Outline_LineToFunc + + /*************************************************************************/ + /* */ + /* <FuncType> */ + /* FT_Outline_ConicToFunc */ + /* */ + /* <Description> */ + /* A function pointer type use to describe the signature of a `conic */ + /* to' function during outline walking/decomposition. */ + /* */ + /* A `conic to' is emitted to indicate a second-order Bézier arc in */ + /* the outline. */ + /* */ + /* <Input> */ + /* control :: An intermediate control point between the last position */ + /* and the new target in `to'. */ + /* */ + /* to :: A pointer to the target end point of the conic arc. */ + /* */ + /* user :: A typeless pointer which is passed from the caller of */ + /* the decomposition function. */ + /* */ + /* <Return> */ + /* Error code. 0 means success. */ + /* */ + typedef int + (*FT_Outline_ConicToFunc)( const FT_Vector* control, + const FT_Vector* to, + void* user ); + +#define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc + + /*************************************************************************/ + /* */ + /* <FuncType> */ + /* FT_Outline_CubicToFunc */ + /* */ + /* <Description> */ + /* A function pointer type used to describe the signature of a `cubic */ + /* to' function during outline walking/decomposition. */ + /* */ + /* A `cubic to' is emitted to indicate a third-order Bézier arc. */ + /* */ + /* <Input> */ + /* control1 :: A pointer to the first Bézier control point. */ + /* */ + /* control2 :: A pointer to the second Bézier control point. */ + /* */ + /* to :: A pointer to the target end point. */ + /* */ + /* user :: A typeless pointer which is passed from the caller of */ + /* the decomposition function. */ + /* */ + /* <Return> */ + /* Error code. 0 means success. */ + /* */ + typedef int + (*FT_Outline_CubicToFunc)( const FT_Vector* control1, + const FT_Vector* control2, + const FT_Vector* to, + void* user ); + +#define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_Outline_Funcs */ + /* */ + /* <Description> */ + /* A structure to hold various function pointers used during outline */ + /* decomposition in order to emit segments, conic, and cubic Béziers, */ + /* as well as `move to' and `close to' operations. */ + /* */ + /* <Fields> */ + /* move_to :: The `move to' emitter. */ + /* */ + /* line_to :: The segment emitter. */ + /* */ + /* conic_to :: The second-order Bézier arc emitter. */ + /* */ + /* cubic_to :: The third-order Bézier arc emitter. */ + /* */ + /* shift :: The shift that is applied to coordinates before they */ + /* are sent to the emitter. */ + /* */ + /* delta :: The delta that is applied to coordinates before they */ + /* are sent to the emitter, but after the shift. */ + /* */ + /* <Note> */ + /* The point coordinates sent to the emitters are the transformed */ + /* version of the original coordinates (this is important for high */ + /* accuracy during scan-conversion). The transformation is simple: */ + /* */ + /* { */ + /* x' = (x << shift) - delta */ + /* y' = (x << shift) - delta */ + /* } */ + /* */ + /* Set the value of `shift' and `delta' to 0 to get the original */ + /* point coordinates. */ + /* */ + typedef struct FT_Outline_Funcs_ + { + FT_Outline_MoveToFunc move_to; + FT_Outline_LineToFunc line_to; + FT_Outline_ConicToFunc conic_to; + FT_Outline_CubicToFunc cubic_to; + + int shift; + FT_Pos delta; + + } FT_Outline_Funcs; + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* basic_types */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Macro> */ + /* FT_IMAGE_TAG */ + /* */ + /* <Description> */ + /* This macro converts four-letter tags to an unsigned long type. */ + /* */ + /* <Note> */ + /* Since many 16bit compilers don't like 32bit enumerations, you */ + /* should redefine this macro in case of problems to something like */ + /* this: */ + /* */ + /* { */ + /* #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) value */ + /* } */ + /* */ + /* to get a simple enumeration without assigning special numbers. */ + /* */ +#ifndef FT_IMAGE_TAG +#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) \ + value = ( ( (unsigned long)_x1 << 24 ) | \ + ( (unsigned long)_x2 << 16 ) | \ + ( (unsigned long)_x3 << 8 ) | \ + (unsigned long)_x4 ) +#endif /* FT_IMAGE_TAG */ + + + /*************************************************************************/ + /* */ + /* <Enum> */ + /* FT_Glyph_Format */ + /* */ + /* <Description> */ + /* An enumeration type used to describe the format of a given glyph */ + /* image. Note that this version of FreeType only supports two image */ + /* formats, even though future font drivers will be able to register */ + /* their own format. */ + /* */ + /* <Values> */ + /* FT_GLYPH_FORMAT_NONE :: */ + /* The value 0 is reserved. */ + /* */ + /* FT_GLYPH_FORMAT_COMPOSITE :: */ + /* The glyph image is a composite of several other images. This */ + /* format is _only_ used with @FT_LOAD_NO_RECURSE, and is used to */ + /* report compound glyphs (like accented characters). */ + /* */ + /* FT_GLYPH_FORMAT_BITMAP :: */ + /* The glyph image is a bitmap, and can be described as an */ + /* @FT_Bitmap. You generally need to access the `bitmap' field of */ + /* the @FT_GlyphSlotRec structure to read it. */ + /* */ + /* FT_GLYPH_FORMAT_OUTLINE :: */ + /* The glyph image is a vectorial outline made of line segments */ + /* and Bézier arcs; it can be described as an @FT_Outline; you */ + /* generally want to access the `outline' field of the */ + /* @FT_GlyphSlotRec structure to read it. */ + /* */ + /* FT_GLYPH_FORMAT_PLOTTER :: */ + /* The glyph image is a vectorial path with no inside and outside */ + /* contours. Some Type 1 fonts, like those in the Hershey family, */ + /* contain glyphs in this format. These are described as */ + /* @FT_Outline, but FreeType isn't currently capable of rendering */ + /* them correctly. */ + /* */ + typedef enum FT_Glyph_Format_ + { + FT_IMAGE_TAG( FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0 ), + + FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ), + FT_IMAGE_TAG( FT_GLYPH_FORMAT_BITMAP, 'b', 'i', 't', 's' ), + FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE, 'o', 'u', 't', 'l' ), + FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER, 'p', 'l', 'o', 't' ) + + } FT_Glyph_Format; + + + /*************************************************************************/ + /* */ + /* <Enum> */ + /* ft_glyph_format_xxx */ + /* */ + /* <Description> */ + /* A list of deprecated constants. Use the corresponding */ + /* @FT_Glyph_Format values instead. */ + /* */ + /* <Values> */ + /* ft_glyph_format_none :: See @FT_GLYPH_FORMAT_NONE. */ + /* ft_glyph_format_composite :: See @FT_GLYPH_FORMAT_COMPOSITE. */ + /* ft_glyph_format_bitmap :: See @FT_GLYPH_FORMAT_BITMAP. */ + /* ft_glyph_format_outline :: See @FT_GLYPH_FORMAT_OUTLINE. */ + /* ft_glyph_format_plotter :: See @FT_GLYPH_FORMAT_PLOTTER. */ + /* */ +#define ft_glyph_format_none FT_GLYPH_FORMAT_NONE +#define ft_glyph_format_composite FT_GLYPH_FORMAT_COMPOSITE +#define ft_glyph_format_bitmap FT_GLYPH_FORMAT_BITMAP +#define ft_glyph_format_outline FT_GLYPH_FORMAT_OUTLINE +#define ft_glyph_format_plotter FT_GLYPH_FORMAT_PLOTTER + + + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** R A S T E R D E F I N I T I O N S *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* A raster is a scan converter, in charge of rendering an outline into */ + /* a a bitmap. This section contains the public API for rasters. */ + /* */ + /* Note that in FreeType 2, all rasters are now encapsulated within */ + /* specific modules called `renderers'. See `freetype/ftrender.h' for */ + /* more details on renderers. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* raster */ + /* */ + /* <Title> */ + /* Scanline Converter */ + /* */ + /* <Abstract> */ + /* How vectorial outlines are converted into bitmaps and pixmaps. */ + /* */ + /* <Description> */ + /* This section contains technical definitions. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Raster */ + /* */ + /* <Description> */ + /* A handle (pointer) to a raster object. Each object can be used */ + /* independently to convert an outline into a bitmap or pixmap. */ + /* */ + typedef struct FT_RasterRec_* FT_Raster; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_Span */ + /* */ + /* <Description> */ + /* A structure used to model a single span of gray (or black) pixels */ + /* when rendering a monochrome or anti-aliased bitmap. */ + /* */ + /* <Fields> */ + /* x :: The span's horizontal start position. */ + /* */ + /* len :: The span's length in pixels. */ + /* */ + /* coverage :: The span color/coverage, ranging from 0 (background) */ + /* to 255 (foreground). Only used for anti-aliased */ + /* rendering. */ + /* */ + /* <Note> */ + /* This structure is used by the span drawing callback type named */ + /* @FT_SpanFunc which takes the y-coordinate of the span as a */ + /* a parameter. */ + /* */ + /* The coverage value is always between 0 and 255. */ + /* */ + typedef struct FT_Span_ + { + short x; + unsigned short len; + unsigned char coverage; + + } FT_Span; + + + /*************************************************************************/ + /* */ + /* <FuncType> */ + /* FT_SpanFunc */ + /* */ + /* <Description> */ + /* A function used as a call-back by the anti-aliased renderer in */ + /* order to let client applications draw themselves the gray pixel */ + /* spans on each scan line. */ + /* */ + /* <Input> */ + /* y :: The scanline's y-coordinate. */ + /* */ + /* count :: The number of spans to draw on this scanline. */ + /* */ + /* spans :: A table of `count' spans to draw on the scanline. */ + /* */ + /* user :: User-supplied data that is passed to the callback. */ + /* */ + /* <Note> */ + /* This callback allows client applications to directly render the */ + /* gray spans of the anti-aliased bitmap to any kind of surfaces. */ + /* */ + /* This can be used to write anti-aliased outlines directly to a */ + /* given background bitmap, and even perform translucency. */ + /* */ + /* Note that the `count' field cannot be greater than a fixed value */ + /* defined by the `FT_MAX_GRAY_SPANS' configuration macro in */ + /* `ftoption.h'. By default, this value is set to 32, which means */ + /* that if there are more than 32 spans on a given scanline, the */ + /* callback is called several times with the same `y' parameter in */ + /* order to draw all callbacks. */ + /* */ + /* Otherwise, the callback is only called once per scan-line, and */ + /* only for those scanlines that do have `gray' pixels on them. */ + /* */ + typedef void + (*FT_SpanFunc)( int y, + int count, + const FT_Span* spans, + void* user ); + +#define FT_Raster_Span_Func FT_SpanFunc + + + /*************************************************************************/ + /* */ + /* <FuncType> */ + /* FT_Raster_BitTest_Func */ + /* */ + /* <Description> */ + /* THIS TYPE IS DEPRECATED. DO NOT USE IT. */ + /* */ + /* A function used as a call-back by the monochrome scan-converter */ + /* to test whether a given target pixel is already set to the drawing */ + /* `color'. These tests are crucial to implement drop-out control */ + /* per-se the TrueType spec. */ + /* */ + /* <Input> */ + /* y :: The pixel's y-coordinate. */ + /* */ + /* x :: The pixel's x-coordinate. */ + /* */ + /* user :: User-supplied data that is passed to the callback. */ + /* */ + /* <Return> */ + /* 1 if the pixel is `set', 0 otherwise. */ + /* */ + typedef int + (*FT_Raster_BitTest_Func)( int y, + int x, + void* user ); + + + /*************************************************************************/ + /* */ + /* <FuncType> */ + /* FT_Raster_BitSet_Func */ + /* */ + /* <Description> */ + /* THIS TYPE IS DEPRECATED. DO NOT USE IT. */ + /* */ + /* A function used as a call-back by the monochrome scan-converter */ + /* to set an individual target pixel. This is crucial to implement */ + /* drop-out control according to the TrueType specification. */ + /* */ + /* <Input> */ + /* y :: The pixel's y-coordinate. */ + /* */ + /* x :: The pixel's x-coordinate. */ + /* */ + /* user :: User-supplied data that is passed to the callback. */ + /* */ + /* <Return> */ + /* 1 if the pixel is `set', 0 otherwise. */ + /* */ + typedef void + (*FT_Raster_BitSet_Func)( int y, + int x, + void* user ); + + + /*************************************************************************/ + /* */ + /* <Enum> */ + /* FT_RASTER_FLAG_XXX */ + /* */ + /* <Description> */ + /* A list of bit flag constants as used in the `flags' field of a */ + /* @FT_Raster_Params structure. */ + /* */ + /* <Values> */ + /* FT_RASTER_FLAG_DEFAULT :: This value is 0. */ + /* */ + /* FT_RASTER_FLAG_AA :: This flag is set to indicate that an */ + /* anti-aliased glyph image should be */ + /* generated. Otherwise, it will be */ + /* monochrome (1-bit). */ + /* */ + /* FT_RASTER_FLAG_DIRECT :: This flag is set to indicate direct */ + /* rendering. In this mode, client */ + /* applications must provide their own span */ + /* callback. This lets them directly */ + /* draw or compose over an existing bitmap. */ + /* If this bit is not set, the target */ + /* pixmap's buffer _must_ be zeroed before */ + /* rendering. */ + /* */ + /* Note that for now, direct rendering is */ + /* only possible with anti-aliased glyphs. */ + /* */ + /* FT_RASTER_FLAG_CLIP :: This flag is only used in direct */ + /* rendering mode. If set, the output will */ + /* be clipped to a box specified in the */ + /* `clip_box' field of the */ + /* @FT_Raster_Params structure. */ + /* */ + /* Note that by default, the glyph bitmap */ + /* is clipped to the target pixmap, except */ + /* in direct rendering mode where all spans */ + /* are generated if no clipping box is set. */ + /* */ +#define FT_RASTER_FLAG_DEFAULT 0x0 +#define FT_RASTER_FLAG_AA 0x1 +#define FT_RASTER_FLAG_DIRECT 0x2 +#define FT_RASTER_FLAG_CLIP 0x4 + + /* deprecated */ +#define ft_raster_flag_default FT_RASTER_FLAG_DEFAULT +#define ft_raster_flag_aa FT_RASTER_FLAG_AA +#define ft_raster_flag_direct FT_RASTER_FLAG_DIRECT +#define ft_raster_flag_clip FT_RASTER_FLAG_CLIP + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_Raster_Params */ + /* */ + /* <Description> */ + /* A structure to hold the arguments used by a raster's render */ + /* function. */ + /* */ + /* <Fields> */ + /* target :: The target bitmap. */ + /* */ + /* source :: A pointer to the source glyph image (e.g., an */ + /* @FT_Outline). */ + /* */ + /* flags :: The rendering flags. */ + /* */ + /* gray_spans :: The gray span drawing callback. */ + /* */ + /* black_spans :: The black span drawing callback. */ + /* */ + /* bit_test :: The bit test callback. UNIMPLEMENTED! */ + /* */ + /* bit_set :: The bit set callback. UNIMPLEMENTED! */ + /* */ + /* user :: User-supplied data that is passed to each drawing */ + /* callback. */ + /* */ + /* clip_box :: An optional clipping box. It is only used in */ + /* direct rendering mode. Note that coordinates here */ + /* should be expressed in _integer_ pixels (and not in */ + /* 26.6 fixed-point units). */ + /* */ + /* <Note> */ + /* An anti-aliased glyph bitmap is drawn if the @FT_RASTER_FLAG_AA */ + /* bit flag is set in the `flags' field, otherwise a monochrome */ + /* bitmap is generated. */ + /* */ + /* If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the */ + /* raster will call the `gray_spans' callback to draw gray pixel */ + /* spans, in the case of an aa glyph bitmap, it will call */ + /* `black_spans', and `bit_test' and `bit_set' in the case of a */ + /* monochrome bitmap. This allows direct composition over a */ + /* pre-existing bitmap through user-provided callbacks to perform the */ + /* span drawing/composition. */ + /* */ + /* Note that the `bit_test' and `bit_set' callbacks are required when */ + /* rendering a monochrome bitmap, as they are crucial to implement */ + /* correct drop-out control as defined in the TrueType specification. */ + /* */ + typedef struct FT_Raster_Params_ + { + const FT_Bitmap* target; + const void* source; + int flags; + FT_SpanFunc gray_spans; + FT_SpanFunc black_spans; + FT_Raster_BitTest_Func bit_test; /* doesn't work! */ + FT_Raster_BitSet_Func bit_set; /* doesn't work! */ + void* user; + FT_BBox clip_box; + + } FT_Raster_Params; + + + /*************************************************************************/ + /* */ + /* <FuncType> */ + /* FT_Raster_NewFunc */ + /* */ + /* <Description> */ + /* A function used to create a new raster object. */ + /* */ + /* <Input> */ + /* memory :: A handle to the memory allocator. */ + /* */ + /* <Output> */ + /* raster :: A handle to the new raster object. */ + /* */ + /* <Return> */ + /* Error code. 0 means success. */ + /* */ + /* <Note> */ + /* The `memory' parameter is a typeless pointer in order to avoid */ + /* un-wanted dependencies on the rest of the FreeType code. In */ + /* practice, it is an @FT_Memory object, i.e., a handle to the */ + /* standard FreeType memory allocator. However, this field can be */ + /* completely ignored by a given raster implementation. */ + /* */ + typedef int + (*FT_Raster_NewFunc)( void* memory, + FT_Raster* raster ); + +#define FT_Raster_New_Func FT_Raster_NewFunc + + /*************************************************************************/ + /* */ + /* <FuncType> */ + /* FT_Raster_DoneFunc */ + /* */ + /* <Description> */ + /* A function used to destroy a given raster object. */ + /* */ + /* <Input> */ + /* raster :: A handle to the raster object. */ + /* */ + typedef void + (*FT_Raster_DoneFunc)( FT_Raster raster ); + +#define FT_Raster_Done_Func FT_Raster_DoneFunc + + /*************************************************************************/ + /* */ + /* <FuncType> */ + /* FT_Raster_ResetFunc */ + /* */ + /* <Description> */ + /* FreeType provides an area of memory called the `render pool', */ + /* available to all registered rasters. This pool can be freely used */ + /* during a given scan-conversion but is shared by all rasters. Its */ + /* content is thus transient. */ + /* */ + /* This function is called each time the render pool changes, or just */ + /* after a new raster object is created. */ + /* */ + /* <Input> */ + /* raster :: A handle to the new raster object. */ + /* */ + /* pool_base :: The address in memory of the render pool. */ + /* */ + /* pool_size :: The size in bytes of the render pool. */ + /* */ + /* <Note> */ + /* Rasters can ignore the render pool and rely on dynamic memory */ + /* allocation if they want to (a handle to the memory allocator is */ + /* passed to the raster constructor). However, this is not */ + /* recommended for efficiency purposes. */ + /* */ + typedef void + (*FT_Raster_ResetFunc)( FT_Raster raster, + unsigned char* pool_base, + unsigned long pool_size ); + +#define FT_Raster_Reset_Func FT_Raster_ResetFunc + + /*************************************************************************/ + /* */ + /* <FuncType> */ + /* FT_Raster_SetModeFunc */ + /* */ + /* <Description> */ + /* This function is a generic facility to change modes or attributes */ + /* in a given raster. This can be used for debugging purposes, or */ + /* simply to allow implementation-specific `features' in a given */ + /* raster module. */ + /* */ + /* <Input> */ + /* raster :: A handle to the new raster object. */ + /* */ + /* mode :: A 4-byte tag used to name the mode or property. */ + /* */ + /* args :: A pointer to the new mode/property to use. */ + /* */ + typedef int + (*FT_Raster_SetModeFunc)( FT_Raster raster, + unsigned long mode, + void* args ); + +#define FT_Raster_Set_Mode_Func FT_Raster_SetModeFunc + + /*************************************************************************/ + /* */ + /* <FuncType> */ + /* FT_Raster_RenderFunc */ + /* */ + /* <Description> */ + /* Invokes a given raster to scan-convert a given glyph image into a */ + /* target bitmap. */ + /* */ + /* <Input> */ + /* raster :: A handle to the raster object. */ + /* */ + /* params :: A pointer to an @FT_Raster_Params structure used to */ + /* store the rendering parameters. */ + /* */ + /* <Return> */ + /* Error code. 0 means success. */ + /* */ + /* <Note> */ + /* The exact format of the source image depends on the raster's glyph */ + /* format defined in its @FT_Raster_Funcs structure. It can be an */ + /* @FT_Outline or anything else in order to support a large array of */ + /* glyph formats. */ + /* */ + /* Note also that the render function can fail and return a */ + /* `FT_Err_Unimplemented_Feature' error code if the raster used does */ + /* not support direct composition. */ + /* */ + /* XXX: For now, the standard raster doesn't support direct */ + /* composition but this should change for the final release (see */ + /* the files `demos/src/ftgrays.c' and `demos/src/ftgrays2.c' */ + /* for examples of distinct implementations which support direct */ + /* composition). */ + /* */ + typedef int + (*FT_Raster_RenderFunc)( FT_Raster raster, + const FT_Raster_Params* params ); + +#define FT_Raster_Render_Func FT_Raster_RenderFunc + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_Raster_Funcs */ + /* */ + /* <Description> */ + /* A structure used to describe a given raster class to the library. */ + /* */ + /* <Fields> */ + /* glyph_format :: The supported glyph format for this raster. */ + /* */ + /* raster_new :: The raster constructor. */ + /* */ + /* raster_reset :: Used to reset the render pool within the raster. */ + /* */ + /* raster_render :: A function to render a glyph into a given bitmap. */ + /* */ + /* raster_done :: The raster destructor. */ + /* */ + typedef struct FT_Raster_Funcs_ + { + FT_Glyph_Format glyph_format; + FT_Raster_NewFunc raster_new; + FT_Raster_ResetFunc raster_reset; + FT_Raster_SetModeFunc raster_set_mode; + FT_Raster_RenderFunc raster_render; + FT_Raster_DoneFunc raster_done; + + } FT_Raster_Funcs; + + + /* */ + + +FT_END_HEADER + +#endif /* __FTIMAGE_H__ */ + + +/* END */ + + +/* Local Variables: */ +/* coding: utf-8 */ +/* End: */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftincrem.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftincrem.h new file mode 100644 index 0000000000..46bc8bdd37 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftincrem.h @@ -0,0 +1,331 @@ +/***************************************************************************/ +/* */ +/* ftincrem.h */ +/* */ +/* FreeType incremental loading (specification). */ +/* */ +/* Copyright 2002, 2003, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTINCREM_H__ +#define __FTINCREM_H__ + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + /*************************************************************************** + * + * @section: + * incremental + * + * @title: + * Incremental Loading + * + * @abstract: + * Custom Glyph Loading. + * + * @description: + * This section contains various functions used to perform so-called + * `incremental' glyph loading. This is a mode where all glyphs loaded + * from a given @FT_Face are provided by the client application, + * + * Apart from that, all other tables are loaded normally from the font + * file. This mode is useful when FreeType is used within another + * engine, e.g., a Postscript Imaging Processor. + * + * To enable this mode, you must use @FT_Open_Face, passing an + * @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an + * @FT_Incremental_Interface value. See the comments for + * @FT_Incremental_InterfaceRec for an example. + * + */ + + + /*************************************************************************** + * + * @type: + * FT_Incremental + * + * @description: + * An opaque type describing a user-provided object used to implement + * `incremental' glyph loading within FreeType. This is used to support + * embedded fonts in certain environments (e.g., Postscript interpreters), + * where the glyph data isn't in the font file, or must be overridden by + * different values. + * + * @note: + * It is up to client applications to create and implement @FT_Incremental + * objects, as long as they provide implementations for the methods + * @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc + * and @FT_Incremental_GetGlyphMetricsFunc. + * + * See the description of @FT_Incremental_InterfaceRec to understand how + * to use incremental objects with FreeType. + */ + typedef struct FT_IncrementalRec_* FT_Incremental; + + + /*************************************************************************** + * + * @struct: + * FT_Incremental_Metrics + * + * @description: + * A small structure used to contain the basic glyph metrics returned + * by the @FT_Incremental_GetGlyphMetricsFunc method. + * + * @fields: + * bearing_x :: + * Left bearing, in font units. + * + * bearing_y :: + * Top bearing, in font units. + * + * advance :: + * Glyph advance, in font units. + * + * @note: + * These correspond to horizontal or vertical metrics depending on the + * value of the `vertical' argument to the function + * @FT_Incremental_GetGlyphMetricsFunc. + */ + typedef struct FT_Incremental_MetricsRec_ + { + FT_Long bearing_x; + FT_Long bearing_y; + FT_Long advance; + + } FT_Incremental_MetricsRec, *FT_Incremental_Metrics; + + + /*************************************************************************** + * + * @type: + * FT_Incremental_GetGlyphDataFunc + * + * @description: + * A function called by FreeType to access a given glyph's data bytes + * during @FT_Load_Glyph or @FT_Load_Char if incremental loading is + * enabled. + * + * Note that the format of the glyph's data bytes depends on the font + * file format. For TrueType, it must correspond to the raw bytes within + * the `glyf' table. For Postscript formats, it must correspond to the + * *unencrypted* charstring bytes, without any `lenIV' header. It is + * undefined for any other format. + * + * @input: + * incremental :: + * Handle to an opaque @FT_Incremental handle provided by the client + * application. + * + * glyph_index :: + * Index of relevant glyph. + * + * @output: + * adata :: + * A structure describing the returned glyph data bytes (which will be + * accessed as a read-only byte block). + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * If this function returns successfully the method + * @FT_Incremental_FreeGlyphDataFunc will be called later to release + * the data bytes. + * + * Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for + * compound glyphs. + */ + typedef FT_Error + (*FT_Incremental_GetGlyphDataFunc)( FT_Incremental incremental, + FT_UInt glyph_index, + FT_Data* adata ); + + + /*************************************************************************** + * + * @type: + * FT_Incremental_FreeGlyphDataFunc + * + * @description: + * A function used to release the glyph data bytes returned by a + * successful call to @FT_Incremental_GetGlyphDataFunc. + * + * @input: + * incremental :: + * A handle to an opaque @FT_Incremental handle provided by the client + * application. + * + * data :: + * A structure describing the glyph data bytes (which will be accessed + * as a read-only byte block). + */ + typedef void + (*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental incremental, + FT_Data* data ); + + + /*************************************************************************** + * + * @type: + * FT_Incremental_GetGlyphMetricsFunc + * + * @description: + * A function used to retrieve the basic metrics of a given glyph index + * before accessing its data. This is necessary because, in certain + * formats like TrueType, the metrics are stored in a different place from + * the glyph images proper. + * + * @input: + * incremental :: + * A handle to an opaque @FT_Incremental handle provided by the client + * application. + * + * glyph_index :: + * Index of relevant glyph. + * + * vertical :: + * If true, return vertical metrics. + * + * ametrics :: + * This parameter is used for both input and output. + * The original glyph metrics, if any, in font units. If metrics are + * not available all the values must be set to zero. + * + * @output: + * ametrics :: + * The replacement glyph metrics in font units. + * + */ + typedef FT_Error + (*FT_Incremental_GetGlyphMetricsFunc) + ( FT_Incremental incremental, + FT_UInt glyph_index, + FT_Bool vertical, + FT_Incremental_MetricsRec *ametrics ); + + + /************************************************************************** + * + * @struct: + * FT_Incremental_FuncsRec + * + * @description: + * A table of functions for accessing fonts that load data + * incrementally. Used in @FT_Incremental_InterfaceRec. + * + * @fields: + * get_glyph_data :: + * The function to get glyph data. Must not be null. + * + * free_glyph_data :: + * The function to release glyph data. Must not be null. + * + * get_glyph_metrics :: + * The function to get glyph metrics. May be null if the font does + * not provide overriding glyph metrics. + */ + typedef struct FT_Incremental_FuncsRec_ + { + FT_Incremental_GetGlyphDataFunc get_glyph_data; + FT_Incremental_FreeGlyphDataFunc free_glyph_data; + FT_Incremental_GetGlyphMetricsFunc get_glyph_metrics; + + } FT_Incremental_FuncsRec; + + + /*************************************************************************** + * + * @struct: + * FT_Incremental_InterfaceRec + * + * @description: + * A structure to be used with @FT_Open_Face to indicate that the user + * wants to support incremental glyph loading. You should use it with + * @FT_PARAM_TAG_INCREMENTAL as in the following example: + * + * { + * FT_Incremental_InterfaceRec inc_int; + * FT_Parameter parameter; + * FT_Open_Args open_args; + * + * + * // set up incremental descriptor + * inc_int.funcs = my_funcs; + * inc_int.object = my_object; + * + * // set up optional parameter + * parameter.tag = FT_PARAM_TAG_INCREMENTAL; + * parameter.data = &inc_int; + * + * // set up FT_Open_Args structure + * open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; + * open_args.pathname = my_font_pathname; + * open_args.num_params = 1; + * open_args.params = ¶meter; // we use one optional argument + * + * // open the font + * error = FT_Open_Face( library, &open_args, index, &face ); + * ... + * } + */ + typedef struct FT_Incremental_InterfaceRec_ + { + const FT_Incremental_FuncsRec* funcs; + FT_Incremental object; + + } FT_Incremental_InterfaceRec; + + + /*************************************************************************** + * + * @type: + * FT_Incremental_Interface + * + * @description: + * A pointer to an @FT_Incremental_InterfaceRec structure. + * + */ + typedef FT_Incremental_InterfaceRec* FT_Incremental_Interface; + + + /*************************************************************************** + * + * @constant: + * FT_PARAM_TAG_INCREMENTAL + * + * @description: + * A constant used as the tag of @FT_Parameter structures to indicate + * an incremental loading object to be used by FreeType. + * + */ +#define FT_PARAM_TAG_INCREMENTAL FT_MAKE_TAG( 'i', 'n', 'c', 'r' ) + + /* */ + +FT_END_HEADER + +#endif /* __FTINCREM_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftlcdfil.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftlcdfil.h new file mode 100644 index 0000000000..9a61377a39 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftlcdfil.h @@ -0,0 +1,166 @@ +/***************************************************************************/ +/* */ +/* ftlcdfil.h */ +/* */ +/* FreeType API for color filtering of subpixel bitmap glyphs */ +/* (specification). */ +/* */ +/* Copyright 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FT_LCD_FILTER_H__ +#define __FT_LCD_FILTER_H__ + +#include <ft2build.h> +#include FT_FREETYPE_H + + +FT_BEGIN_HEADER + + /*************************************************************************** + * + * @section: + * lcd_filtering + * + * @title: + * LCD Filtering + * + * @abstract: + * Reduce color fringes of LCD-optimized bitmaps. + * + * @description: + * The @FT_Library_SetLcdFilter API can be used to specify a low-pass + * filter which is then applied to LCD-optimized bitmaps generated + * through @FT_Render_Glyph. This is useful to reduce color fringes + * which would occur with unfiltered rendering. + * + * Note that no filter is active by default, and that this function is + * *not* implemented in default builds of the library. You need to + * #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file + * in order to activate it. + */ + + + /**************************************************************************** + * + * @func: + * FT_LcdFilter + * + * @description: + * A list of values to identify various types of LCD filters. + * + * @values: + * FT_LCD_FILTER_NONE :: + * Do not perform filtering. When used with subpixel rendering, this + * results in sometimes severe color fringes. + * + * FT_LCD_FILTER_DEFAULT :: + * The default filter reduces color fringes considerably, at the cost + * of a slight blurriness in the output. + * + * FT_LCD_FILTER_LIGHT :: + * The light filter is a variant that produces less blurriness at the + * cost of slightly more color fringes than the default one. It might + * be better, depending on taste, your monitor, or your personal vision. + * + * FT_LCD_FILTER_LEGACY :: + * This filter corresponds to the original libXft color filter. It + * provides high contrast output but can exhibit really bad color + * fringes if glyphs are not extremely well hinted to the pixel grid. + * In other words, it only works well if the TrueType bytecode + * interpreter is enabled *and* high-quality hinted fonts are used. + * + * This filter is only provided for comparison purposes, and might be + * disabled or stay unsupported in the future. + * + * @since: + * 2.3.0 + */ + typedef enum + { + FT_LCD_FILTER_NONE = 0, + FT_LCD_FILTER_DEFAULT = 1, + FT_LCD_FILTER_LIGHT = 2, + FT_LCD_FILTER_LEGACY = 16, + + FT_LCD_FILTER_MAX /* do not remove */ + + } FT_LcdFilter; + + + /************************************************************************** + * + * @func: + * FT_Library_SetLcdFilter + * + * @description: + * This function is used to apply color filtering to LCD decimated + * bitmaps, like the ones used when calling @FT_Render_Glyph with + * @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V. + * + * @input: + * library :: + * A handle to the target library instance. + * + * filter :: + * The filter type. + * + * You can use @FT_LCD_FILTER_NONE here to disable this feature, or + * @FT_LCD_FILTER_DEFAULT to use a default filter that should work + * well on most LCD screens. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * This feature is always disabled by default. Clients must make an + * explicit call to this function with a `filter' value other than + * @FT_LCD_FILTER_NONE in order to enable it. + * + * Due to *PATENTS* covering subpixel rendering, this function doesn't + * do anything except returning `FT_Err_Unimplemented_Feature' if the + * configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not + * defined in your build of the library, which should correspond to all + * default builds of FreeType. + * + * The filter affects glyph bitmaps rendered through @FT_Render_Glyph, + * @FT_Outline_Get_Bitmap, @FT_Load_Glyph, and @FT_Load_Char. + * + * It does _not_ affect the output of @FT_Outline_Render and + * @FT_Outline_Get_Bitmap. + * + * If this feature is activated, the dimensions of LCD glyph bitmaps are + * either larger or taller than the dimensions of the corresponding + * outline with regards to the pixel grid. For example, for + * @FT_RENDER_MODE_LCD, the filter adds up to 3 pixels to the left, and + * up to 3 pixels to the right. + * + * The bitmap offset values are adjusted correctly, so clients shouldn't + * need to modify their layout and glyph positioning code when enabling + * the filter. + * + * @since: + * 2.3.0 + */ + FT_EXPORT( FT_Error ) + FT_Library_SetLcdFilter( FT_Library library, + FT_LcdFilter filter ); + + /* */ + + +FT_END_HEADER + +#endif /* __FT_LCD_FILTER_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftlist.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftlist.h new file mode 100644 index 0000000000..f3223ee8fd --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftlist.h @@ -0,0 +1,273 @@ +/***************************************************************************/ +/* */ +/* ftlist.h */ +/* */ +/* Generic list support for FreeType (specification). */ +/* */ +/* Copyright 1996-2001, 2003, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This file implements functions relative to list processing. Its */ + /* data structures are defined in `freetype.h'. */ + /* */ + /*************************************************************************/ + + +#ifndef __FTLIST_H__ +#define __FTLIST_H__ + + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* list_processing */ + /* */ + /* <Title> */ + /* List Processing */ + /* */ + /* <Abstract> */ + /* Simple management of lists. */ + /* */ + /* <Description> */ + /* This section contains various definitions related to list */ + /* processing using doubly-linked nodes. */ + /* */ + /* <Order> */ + /* FT_List */ + /* FT_ListNode */ + /* FT_ListRec */ + /* FT_ListNodeRec */ + /* */ + /* FT_List_Add */ + /* FT_List_Insert */ + /* FT_List_Find */ + /* FT_List_Remove */ + /* FT_List_Up */ + /* FT_List_Iterate */ + /* FT_List_Iterator */ + /* FT_List_Finalize */ + /* FT_List_Destructor */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_List_Find */ + /* */ + /* <Description> */ + /* Finds the list node for a given listed object. */ + /* */ + /* <Input> */ + /* list :: A pointer to the parent list. */ + /* data :: The address of the listed object. */ + /* */ + /* <Return> */ + /* List node. NULL if it wasn't found. */ + /* */ + FT_EXPORT( FT_ListNode ) + FT_List_Find( FT_List list, + void* data ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_List_Add */ + /* */ + /* <Description> */ + /* Appends an element to the end of a list. */ + /* */ + /* <InOut> */ + /* list :: A pointer to the parent list. */ + /* node :: The node to append. */ + /* */ + FT_EXPORT( void ) + FT_List_Add( FT_List list, + FT_ListNode node ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_List_Insert */ + /* */ + /* <Description> */ + /* Inserts an element at the head of a list. */ + /* */ + /* <InOut> */ + /* list :: A pointer to parent list. */ + /* node :: The node to insert. */ + /* */ + FT_EXPORT( void ) + FT_List_Insert( FT_List list, + FT_ListNode node ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_List_Remove */ + /* */ + /* <Description> */ + /* Removes a node from a list. This function doesn't check whether */ + /* the node is in the list! */ + /* */ + /* <Input> */ + /* node :: The node to remove. */ + /* */ + /* <InOut> */ + /* list :: A pointer to the parent list. */ + /* */ + FT_EXPORT( void ) + FT_List_Remove( FT_List list, + FT_ListNode node ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_List_Up */ + /* */ + /* <Description> */ + /* Moves a node to the head/top of a list. Used to maintain LRU */ + /* lists. */ + /* */ + /* <InOut> */ + /* list :: A pointer to the parent list. */ + /* node :: The node to move. */ + /* */ + FT_EXPORT( void ) + FT_List_Up( FT_List list, + FT_ListNode node ); + + + /*************************************************************************/ + /* */ + /* <FuncType> */ + /* FT_List_Iterator */ + /* */ + /* <Description> */ + /* An FT_List iterator function which is called during a list parse */ + /* by @FT_List_Iterate. */ + /* */ + /* <Input> */ + /* node :: The current iteration list node. */ + /* */ + /* user :: A typeless pointer passed to @FT_List_Iterate. */ + /* Can be used to point to the iteration's state. */ + /* */ + typedef FT_Error + (*FT_List_Iterator)( FT_ListNode node, + void* user ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_List_Iterate */ + /* */ + /* <Description> */ + /* Parses a list and calls a given iterator function on each element. */ + /* Note that parsing is stopped as soon as one of the iterator calls */ + /* returns a non-zero value. */ + /* */ + /* <Input> */ + /* list :: A handle to the list. */ + /* iterator :: An iterator function, called on each node of the list. */ + /* user :: A user-supplied field which is passed as the second */ + /* argument to the iterator. */ + /* */ + /* <Return> */ + /* The result (a FreeType error code) of the last iterator call. */ + /* */ + FT_EXPORT( FT_Error ) + FT_List_Iterate( FT_List list, + FT_List_Iterator iterator, + void* user ); + + + /*************************************************************************/ + /* */ + /* <FuncType> */ + /* FT_List_Destructor */ + /* */ + /* <Description> */ + /* An @FT_List iterator function which is called during a list */ + /* finalization by @FT_List_Finalize to destroy all elements in a */ + /* given list. */ + /* */ + /* <Input> */ + /* system :: The current system object. */ + /* */ + /* data :: The current object to destroy. */ + /* */ + /* user :: A typeless pointer passed to @FT_List_Iterate. It can */ + /* be used to point to the iteration's state. */ + /* */ + typedef void + (*FT_List_Destructor)( FT_Memory memory, + void* data, + void* user ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_List_Finalize */ + /* */ + /* <Description> */ + /* Destroys all elements in the list as well as the list itself. */ + /* */ + /* <Input> */ + /* list :: A handle to the list. */ + /* */ + /* destroy :: A list destructor that will be applied to each element */ + /* of the list. */ + /* */ + /* memory :: The current memory object which handles deallocation. */ + /* */ + /* user :: A user-supplied field which is passed as the last */ + /* argument to the destructor. */ + /* */ + FT_EXPORT( void ) + FT_List_Finalize( FT_List list, + FT_List_Destructor destroy, + FT_Memory memory, + void* user ); + + + /* */ + + +FT_END_HEADER + +#endif /* __FTLIST_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftlzw.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftlzw.h new file mode 100644 index 0000000000..d950653ebf --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftlzw.h @@ -0,0 +1,99 @@ +/***************************************************************************/ +/* */ +/* ftlzw.h */ +/* */ +/* LZW-compressed stream support. */ +/* */ +/* Copyright 2004, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTLZW_H__ +#define __FTLZW_H__ + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + /*************************************************************************/ + /* */ + /* <Section> */ + /* lzw */ + /* */ + /* <Title> */ + /* LZW Streams */ + /* */ + /* <Abstract> */ + /* Using LZW-compressed font files. */ + /* */ + /* <Description> */ + /* This section contains the declaration of LZW-specific functions. */ + /* */ + /*************************************************************************/ + + /************************************************************************ + * + * @function: + * FT_Stream_OpenLZW + * + * @description: + * Open a new stream to parse LZW-compressed font files. This is + * mainly used to support the compressed `*.pcf.Z' fonts that come + * with XFree86. + * + * @input: + * stream :: The target embedding stream. + * + * source :: The source stream. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * The source stream must be opened _before_ calling this function. + * + * Calling the internal function `FT_Stream_Close' on the new stream will + * *not* call `FT_Stream_Close' on the source stream. None of the stream + * objects will be released to the heap. + * + * The stream implementation is very basic and resets the decompression + * process each time seeking backwards is needed within the stream + * + * In certain builds of the library, LZW compression recognition is + * automatically handled when calling @FT_New_Face or @FT_Open_Face. + * This means that if no font driver is capable of handling the raw + * compressed file, the library will try to open a LZW stream from it + * and re-open the face with it. + * + * This function may return `FT_Err_Unimplemented_Feature' if your build + * of FreeType was not compiled with LZW support. + */ + FT_EXPORT( FT_Error ) + FT_Stream_OpenLZW( FT_Stream stream, + FT_Stream source ); + + /* */ + + +FT_END_HEADER + +#endif /* __FTLZW_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftmac.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftmac.h new file mode 100644 index 0000000000..3c6fafe550 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftmac.h @@ -0,0 +1,272 @@ +/***************************************************************************/ +/* */ +/* ftmac.h */ +/* */ +/* Additional Mac-specific API. */ +/* */ +/* Copyright 1996-2001, 2004, 2006, 2007 by */ +/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +/***************************************************************************/ +/* */ +/* NOTE: Include this file after <freetype/freetype.h> and after the */ +/* Mac-specific <Types.h> header (or any other Mac header that */ +/* includes <Types.h>); we use Handle type. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTMAC_H__ +#define __FTMAC_H__ + + +#include <ft2build.h> + + +FT_BEGIN_HEADER + + +/* gcc-3.4.1 and later can warn about functions tagged as deprecated */ +#ifndef FT_DEPRECATED_ATTRIBUTE +#if defined(__GNUC__) && \ + ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) +#define FT_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) +#else +#define FT_DEPRECATED_ATTRIBUTE +#endif +#endif + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* mac_specific */ + /* */ + /* <Title> */ + /* Mac Specific Interface */ + /* */ + /* <Abstract> */ + /* Only available on the Macintosh. */ + /* */ + /* <Description> */ + /* The following definitions are only available if FreeType is */ + /* compiled on a Macintosh. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_New_Face_From_FOND */ + /* */ + /* <Description> */ + /* Create a new face object from a FOND resource. */ + /* */ + /* <InOut> */ + /* library :: A handle to the library resource. */ + /* */ + /* <Input> */ + /* fond :: A FOND resource. */ + /* */ + /* face_index :: Only supported for the -1 `sanity check' special */ + /* case. */ + /* */ + /* <Output> */ + /* aface :: A handle to a new face object. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Notes> */ + /* This function can be used to create @FT_Face objects from fonts */ + /* that are installed in the system as follows. */ + /* */ + /* { */ + /* fond = GetResource( 'FOND', fontName ); */ + /* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */ + /* } */ + /* */ + FT_EXPORT( FT_Error ) + FT_New_Face_From_FOND( FT_Library library, + Handle fond, + FT_Long face_index, + FT_Face *aface ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_GetFile_From_Mac_Name */ + /* */ + /* <Description> */ + /* Return an FSSpec for the disk file containing the named font. */ + /* */ + /* <Input> */ + /* fontName :: Mac OS name of the font (e.g., Times New Roman */ + /* Bold). */ + /* */ + /* <Output> */ + /* pathSpec :: FSSpec to the file. For passing to */ + /* @FT_New_Face_From_FSSpec. */ + /* */ + /* face_index :: Index of the face. For passing to */ + /* @FT_New_Face_From_FSSpec. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_GetFile_From_Mac_Name( const char* fontName, + FSSpec* pathSpec, + FT_Long* face_index ) + FT_DEPRECATED_ATTRIBUTE; + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_GetFile_From_Mac_ATS_Name */ + /* */ + /* <Description> */ + /* Return an FSSpec for the disk file containing the named font. */ + /* */ + /* <Input> */ + /* fontName :: Mac OS name of the font in ATS framework. */ + /* */ + /* <Output> */ + /* pathSpec :: FSSpec to the file. For passing to */ + /* @FT_New_Face_From_FSSpec. */ + /* */ + /* face_index :: Index of the face. For passing to */ + /* @FT_New_Face_From_FSSpec. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_GetFile_From_Mac_ATS_Name( const char* fontName, + FSSpec* pathSpec, + FT_Long* face_index ) + FT_DEPRECATED_ATTRIBUTE; + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_GetFilePath_From_Mac_ATS_Name */ + /* */ + /* <Description> */ + /* Return a pathname of the disk file and face index for given font */ + /* name which is handled by ATS framework. */ + /* */ + /* <Input> */ + /* fontName :: Mac OS name of the font in ATS framework. */ + /* */ + /* <Output> */ + /* path :: Buffer to store pathname of the file. For passing */ + /* to @FT_New_Face. The client must allocate this */ + /* buffer before calling this function. */ + /* */ + /* maxPathSize :: Lengths of the buffer `path' that client allocated. */ + /* */ + /* face_index :: Index of the face. For passing to @FT_New_Face. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_GetFilePath_From_Mac_ATS_Name( const char* fontName, + UInt8* path, + UInt32 maxPathSize, + FT_Long* face_index ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_New_Face_From_FSSpec */ + /* */ + /* <Description> */ + /* Create a new face object from a given resource and typeface index */ + /* using an FSSpec to the font file. */ + /* */ + /* <InOut> */ + /* library :: A handle to the library resource. */ + /* */ + /* <Input> */ + /* spec :: FSSpec to the font file. */ + /* */ + /* face_index :: The index of the face within the resource. The */ + /* first face has index 0. */ + /* <Output> */ + /* aface :: A handle to a new face object. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except */ + /* it accepts an FSSpec instead of a path. */ + /* */ + FT_EXPORT( FT_Error ) + FT_New_Face_From_FSSpec( FT_Library library, + const FSSpec *spec, + FT_Long face_index, + FT_Face *aface ) + FT_DEPRECATED_ATTRIBUTE; + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_New_Face_From_FSRef */ + /* */ + /* <Description> */ + /* Create a new face object from a given resource and typeface index */ + /* using an FSRef to the font file. */ + /* */ + /* <InOut> */ + /* library :: A handle to the library resource. */ + /* */ + /* <Input> */ + /* spec :: FSRef to the font file. */ + /* */ + /* face_index :: The index of the face within the resource. The */ + /* first face has index 0. */ + /* <Output> */ + /* aface :: A handle to a new face object. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* @FT_New_Face_From_FSRef is identical to @FT_New_Face except */ + /* it accepts an FSRef instead of a path. */ + /* */ + FT_EXPORT( FT_Error ) + FT_New_Face_From_FSRef( FT_Library library, + const FSRef *ref, + FT_Long face_index, + FT_Face *aface ) + FT_DEPRECATED_ATTRIBUTE; + + /* */ + + +FT_END_HEADER + + +#endif /* __FTMAC_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftmm.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftmm.h new file mode 100644 index 0000000000..a9ccfe7138 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftmm.h @@ -0,0 +1,378 @@ +/***************************************************************************/ +/* */ +/* ftmm.h */ +/* */ +/* FreeType Multiple Master font interface (specification). */ +/* */ +/* Copyright 1996-2001, 2003, 2004, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTMM_H__ +#define __FTMM_H__ + + +#include <ft2build.h> +#include FT_TYPE1_TABLES_H + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* multiple_masters */ + /* */ + /* <Title> */ + /* Multiple Masters */ + /* */ + /* <Abstract> */ + /* How to manage Multiple Masters fonts. */ + /* */ + /* <Description> */ + /* The following types and functions are used to manage Multiple */ + /* Master fonts, i.e., the selection of specific design instances by */ + /* setting design axis coordinates. */ + /* */ + /* George Williams has extended this interface to make it work with */ + /* both Type 1 Multiple Masters fonts and GX distortable (var) */ + /* fonts. Some of these routines only work with MM fonts, others */ + /* will work with both types. They are similar enough that a */ + /* consistent interface makes sense. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_MM_Axis */ + /* */ + /* <Description> */ + /* A simple structure used to model a given axis in design space for */ + /* Multiple Masters fonts. */ + /* */ + /* This structure can't be used for GX var fonts. */ + /* */ + /* <Fields> */ + /* name :: The axis's name. */ + /* */ + /* minimum :: The axis's minimum design coordinate. */ + /* */ + /* maximum :: The axis's maximum design coordinate. */ + /* */ + typedef struct FT_MM_Axis_ + { + FT_String* name; + FT_Long minimum; + FT_Long maximum; + + } FT_MM_Axis; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_Multi_Master */ + /* */ + /* <Description> */ + /* A structure used to model the axes and space of a Multiple Masters */ + /* font. */ + /* */ + /* This structure can't be used for GX var fonts. */ + /* */ + /* <Fields> */ + /* num_axis :: Number of axes. Cannot exceed 4. */ + /* */ + /* num_designs :: Number of designs; should be normally 2^num_axis */ + /* even though the Type 1 specification strangely */ + /* allows for intermediate designs to be present. This */ + /* number cannot exceed 16. */ + /* */ + /* axis :: A table of axis descriptors. */ + /* */ + typedef struct FT_Multi_Master_ + { + FT_UInt num_axis; + FT_UInt num_designs; + FT_MM_Axis axis[T1_MAX_MM_AXIS]; + + } FT_Multi_Master; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_Var_Axis */ + /* */ + /* <Description> */ + /* A simple structure used to model a given axis in design space for */ + /* Multiple Masters and GX var fonts. */ + /* */ + /* <Fields> */ + /* name :: The axis's name. */ + /* Not always meaningful for GX. */ + /* */ + /* minimum :: The axis's minimum design coordinate. */ + /* */ + /* def :: The axis's default design coordinate. */ + /* FreeType computes meaningful default values for MM; it */ + /* is then an integer value, not in 16.16 format. */ + /* */ + /* maximum :: The axis's maximum design coordinate. */ + /* */ + /* tag :: The axis's tag (the GX equivalent to `name'). */ + /* FreeType provides default values for MM if possible. */ + /* */ + /* strid :: The entry in `name' table (another GX version of */ + /* `name'). */ + /* Not meaningful for MM. */ + /* */ + typedef struct FT_Var_Axis_ + { + FT_String* name; + + FT_Fixed minimum; + FT_Fixed def; + FT_Fixed maximum; + + FT_ULong tag; + FT_UInt strid; + + } FT_Var_Axis; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_Var_Named_Style */ + /* */ + /* <Description> */ + /* A simple structure used to model a named style in a GX var font. */ + /* */ + /* This structure can't be used for MM fonts. */ + /* */ + /* <Fields> */ + /* coords :: The design coordinates for this style. */ + /* This is an array with one entry for each axis. */ + /* */ + /* strid :: The entry in `name' table identifying this style. */ + /* */ + typedef struct FT_Var_Named_Style_ + { + FT_Fixed* coords; + FT_UInt strid; + + } FT_Var_Named_Style; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_MM_Var */ + /* */ + /* <Description> */ + /* A structure used to model the axes and space of a Multiple Masters */ + /* or GX var distortable font. */ + /* */ + /* Some fields are specific to one format and not to the other. */ + /* */ + /* <Fields> */ + /* num_axis :: The number of axes. The maximum value is 4 for */ + /* MM; no limit in GX. */ + /* */ + /* num_designs :: The number of designs; should be normally */ + /* 2^num_axis for MM fonts. Not meaningful for GX */ + /* (where every glyph could have a different */ + /* number of designs). */ + /* */ + /* num_namedstyles :: The number of named styles; only meaningful for */ + /* GX which allows certain design coordinates to */ + /* have a string ID (in the `name' table) */ + /* associated with them. The font can tell the */ + /* user that, for example, Weight=1.5 is `Bold'. */ + /* */ + /* axis :: A table of axis descriptors. */ + /* GX fonts contain slightly more data than MM. */ + /* */ + /* namedstyles :: A table of named styles. */ + /* Only meaningful with GX. */ + /* */ + typedef struct FT_MM_Var_ + { + FT_UInt num_axis; + FT_UInt num_designs; + FT_UInt num_namedstyles; + FT_Var_Axis* axis; + FT_Var_Named_Style* namedstyle; + + } FT_MM_Var; + + + /* */ + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Get_Multi_Master */ + /* */ + /* <Description> */ + /* Retrieves the Multiple Master descriptor of a given font. */ + /* */ + /* This function can't be used with GX fonts. */ + /* */ + /* <Input> */ + /* face :: A handle to the source face. */ + /* */ + /* <Output> */ + /* amaster :: The Multiple Masters descriptor. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Get_Multi_Master( FT_Face face, + FT_Multi_Master *amaster ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Get_MM_Var */ + /* */ + /* <Description> */ + /* Retrieves the Multiple Master/GX var descriptor of a given font. */ + /* */ + /* <Input> */ + /* face :: A handle to the source face. */ + /* */ + /* <Output> */ + /* amaster :: The Multiple Masters descriptor. */ + /* Allocates a data structure, which the user must free */ + /* (a single call to FT_FREE will do it). */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Get_MM_Var( FT_Face face, + FT_MM_Var* *amaster ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Set_MM_Design_Coordinates */ + /* */ + /* <Description> */ + /* For Multiple Masters fonts, choose an interpolated font design */ + /* through design coordinates. */ + /* */ + /* This function can't be used with GX fonts. */ + /* */ + /* <InOut> */ + /* face :: A handle to the source face. */ + /* */ + /* <Input> */ + /* num_coords :: The number of design coordinates (must be equal to */ + /* the number of axes in the font). */ + /* */ + /* coords :: An array of design coordinates. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Set_MM_Design_Coordinates( FT_Face face, + FT_UInt num_coords, + FT_Long* coords ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Set_Var_Design_Coordinates */ + /* */ + /* <Description> */ + /* For Multiple Master or GX Var fonts, choose an interpolated font */ + /* design through design coordinates. */ + /* */ + /* <InOut> */ + /* face :: A handle to the source face. */ + /* */ + /* <Input> */ + /* num_coords :: The number of design coordinates (must be equal to */ + /* the number of axes in the font). */ + /* */ + /* coords :: An array of design coordinates. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Set_Var_Design_Coordinates( FT_Face face, + FT_UInt num_coords, + FT_Fixed* coords ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Set_MM_Blend_Coordinates */ + /* */ + /* <Description> */ + /* For Multiple Masters and GX var fonts, choose an interpolated font */ + /* design through normalized blend coordinates. */ + /* */ + /* <InOut> */ + /* face :: A handle to the source face. */ + /* */ + /* <Input> */ + /* num_coords :: The number of design coordinates (must be equal to */ + /* the number of axes in the font). */ + /* */ + /* coords :: The design coordinates array (each element must be */ + /* between 0 and 1.0). */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Set_MM_Blend_Coordinates( FT_Face face, + FT_UInt num_coords, + FT_Fixed* coords ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Set_Var_Blend_Coordinates */ + /* */ + /* <Description> */ + /* This is another name of @FT_Set_MM_Blend_Coordinates. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Set_Var_Blend_Coordinates( FT_Face face, + FT_UInt num_coords, + FT_Fixed* coords ); + + + /* */ + + +FT_END_HEADER + +#endif /* __FTMM_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftmodapi.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftmodapi.h new file mode 100644 index 0000000000..9cc32aff4e --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftmodapi.h @@ -0,0 +1,406 @@ +/***************************************************************************/ +/* */ +/* ftmodapi.h */ +/* */ +/* FreeType modules public interface (specification). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTMODAPI_H__ +#define __FTMODAPI_H__ + + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* module_management */ + /* */ + /* <Title> */ + /* Module Management */ + /* */ + /* <Abstract> */ + /* How to add, upgrade, and remove modules from FreeType. */ + /* */ + /* <Description> */ + /* The definitions below are used to manage modules within FreeType. */ + /* Modules can be added, upgraded, and removed at runtime. */ + /* */ + /*************************************************************************/ + + + /* module bit flags */ +#define FT_MODULE_FONT_DRIVER 1 /* this module is a font driver */ +#define FT_MODULE_RENDERER 2 /* this module is a renderer */ +#define FT_MODULE_HINTER 4 /* this module is a glyph hinter */ +#define FT_MODULE_STYLER 8 /* this module is a styler */ + +#define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */ + /* scalable fonts */ +#define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */ + /* support vector outlines */ +#define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */ + /* own hinter */ + + + /* deprecated values */ +#define ft_module_font_driver FT_MODULE_FONT_DRIVER +#define ft_module_renderer FT_MODULE_RENDERER +#define ft_module_hinter FT_MODULE_HINTER +#define ft_module_styler FT_MODULE_STYLER + +#define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE +#define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES +#define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER + + + typedef FT_Pointer FT_Module_Interface; + + typedef FT_Error + (*FT_Module_Constructor)( FT_Module module ); + + typedef void + (*FT_Module_Destructor)( FT_Module module ); + + typedef FT_Module_Interface + (*FT_Module_Requester)( FT_Module module, + const char* name ); + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_Module_Class */ + /* */ + /* <Description> */ + /* The module class descriptor. */ + /* */ + /* <Fields> */ + /* module_flags :: Bit flags describing the module. */ + /* */ + /* module_size :: The size of one module object/instance in */ + /* bytes. */ + /* */ + /* module_name :: The name of the module. */ + /* */ + /* module_version :: The version, as a 16.16 fixed number */ + /* (major.minor). */ + /* */ + /* module_requires :: The version of FreeType this module requires, */ + /* as a 16.16 fixed number (major.minor). Starts */ + /* at version 2.0, i.e., 0x20000. */ + /* */ + /* module_init :: A function used to initialize (not create) a */ + /* new module object. */ + /* */ + /* module_done :: A function used to finalize (not destroy) a */ + /* given module object */ + /* */ + /* get_interface :: Queries a given module for a specific */ + /* interface by name. */ + /* */ + typedef struct FT_Module_Class_ + { + FT_ULong module_flags; + FT_Long module_size; + const FT_String* module_name; + FT_Fixed module_version; + FT_Fixed module_requires; + + const void* module_interface; + + FT_Module_Constructor module_init; + FT_Module_Destructor module_done; + FT_Module_Requester get_interface; + + } FT_Module_Class; + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Add_Module */ + /* */ + /* <Description> */ + /* Adds a new module to a given library instance. */ + /* */ + /* <InOut> */ + /* library :: A handle to the library object. */ + /* */ + /* <Input> */ + /* clazz :: A pointer to class descriptor for the module. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* An error will be returned if a module already exists by that name, */ + /* or if the module requires a version of FreeType that is too great. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Add_Module( FT_Library library, + const FT_Module_Class* clazz ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Get_Module */ + /* */ + /* <Description> */ + /* Finds a module by its name. */ + /* */ + /* <Input> */ + /* library :: A handle to the library object. */ + /* */ + /* module_name :: The module's name (as an ASCII string). */ + /* */ + /* <Return> */ + /* A module handle. 0 if none was found. */ + /* */ + /* <Note> */ + /* FreeType's internal modules aren't documented very well, and you */ + /* should look up the source code for details. */ + /* */ + FT_EXPORT( FT_Module ) + FT_Get_Module( FT_Library library, + const char* module_name ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Remove_Module */ + /* */ + /* <Description> */ + /* Removes a given module from a library instance. */ + /* */ + /* <InOut> */ + /* library :: A handle to a library object. */ + /* */ + /* <Input> */ + /* module :: A handle to a module object. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* The module object is destroyed by the function in case of success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Remove_Module( FT_Library library, + FT_Module module ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_New_Library */ + /* */ + /* <Description> */ + /* This function is used to create a new FreeType library instance */ + /* from a given memory object. It is thus possible to use libraries */ + /* with distinct memory allocators within the same program. */ + /* */ + /* <Input> */ + /* memory :: A handle to the original memory object. */ + /* */ + /* <Output> */ + /* alibrary :: A pointer to handle of a new library object. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_New_Library( FT_Memory memory, + FT_Library *alibrary ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Done_Library */ + /* */ + /* <Description> */ + /* Discards a given library object. This closes all drivers and */ + /* discards all resource objects. */ + /* */ + /* <Input> */ + /* library :: A handle to the target library. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Done_Library( FT_Library library ); + +/* */ + + typedef void + (*FT_DebugHook_Func)( void* arg ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Set_Debug_Hook */ + /* */ + /* <Description> */ + /* Sets a debug hook function for debugging the interpreter of a font */ + /* format. */ + /* */ + /* <InOut> */ + /* library :: A handle to the library object. */ + /* */ + /* <Input> */ + /* hook_index :: The index of the debug hook. You should use the */ + /* values defined in `ftobjs.h', e.g., */ + /* `FT_DEBUG_HOOK_TRUETYPE'. */ + /* */ + /* debug_hook :: The function used to debug the interpreter. */ + /* */ + /* <Note> */ + /* Currently, four debug hook slots are available, but only two (for */ + /* the TrueType and the Type 1 interpreter) are defined. */ + /* */ + /* Since the internal headers of FreeType are no longer installed, */ + /* the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly. */ + /* This is a bug and will be fixed in a forthcoming release. */ + /* */ + FT_EXPORT( void ) + FT_Set_Debug_Hook( FT_Library library, + FT_UInt hook_index, + FT_DebugHook_Func debug_hook ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Add_Default_Modules */ + /* */ + /* <Description> */ + /* Adds the set of default drivers to a given library object. */ + /* This is only useful when you create a library object with */ + /* @FT_New_Library (usually to plug a custom memory manager). */ + /* */ + /* <InOut> */ + /* library :: A handle to a new library object. */ + /* */ + FT_EXPORT( void ) + FT_Add_Default_Modules( FT_Library library ); + + + + /************************************************************************** + * + * @section: + * truetype_engine + * + * @title: + * The TrueType Engine + * + * @abstract: + * TrueType bytecode support. + * + * @description: + * This section contains a function used to query the level of TrueType + * bytecode support compiled in this version of the library. + * + */ + + + /************************************************************************** + * + * @enum: + * FT_TrueTypeEngineType + * + * @description: + * A list of values describing which kind of TrueType bytecode + * engine is implemented in a given FT_Library instance. It is used + * by the @FT_Get_TrueType_Engine_Type function. + * + * @values: + * FT_TRUETYPE_ENGINE_TYPE_NONE :: + * The library doesn't implement any kind of bytecode interpreter. + * + * FT_TRUETYPE_ENGINE_TYPE_UNPATENTED :: + * The library implements a bytecode interpreter that doesn't + * support the patented operations of the TrueType virtual machine. + * + * Its main use is to load certain Asian fonts which position and + * scale glyph components with bytecode instructions. It produces + * bad output for most other fonts. + * + * FT_TRUETYPE_ENGINE_TYPE_PATENTED :: + * The library implements a bytecode interpreter that covers + * the full instruction set of the TrueType virtual machine. + * See the file `docs/PATENTS' for legal aspects. + * + * @since: + * 2.2 + * + */ + typedef enum + { + FT_TRUETYPE_ENGINE_TYPE_NONE = 0, + FT_TRUETYPE_ENGINE_TYPE_UNPATENTED, + FT_TRUETYPE_ENGINE_TYPE_PATENTED + + } FT_TrueTypeEngineType; + + + /************************************************************************** + * + * @func: + * FT_Get_TrueType_Engine_Type + * + * @description: + * Return a @FT_TrueTypeEngineType value to indicate which level of + * the TrueType virtual machine a given library instance supports. + * + * @input: + * library :: + * A library instance. + * + * @return: + * A value indicating which level is supported. + * + * @since: + * 2.2 + * + */ + FT_EXPORT( FT_TrueTypeEngineType ) + FT_Get_TrueType_Engine_Type( FT_Library library ); + + + /* */ + + +FT_END_HEADER + +#endif /* __FTMODAPI_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftmoderr.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftmoderr.h new file mode 100644 index 0000000000..b0115dd0dd --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftmoderr.h @@ -0,0 +1,155 @@ +/***************************************************************************/ +/* */ +/* ftmoderr.h */ +/* */ +/* FreeType module error offsets (specification). */ +/* */ +/* Copyright 2001, 2002, 2003, 2004, 2005 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This file is used to define the FreeType module error offsets. */ + /* */ + /* The lower byte gives the error code, the higher byte gives the */ + /* module. The base module has error offset 0. For example, the error */ + /* `FT_Err_Invalid_File_Format' has value 0x003, the error */ + /* `TT_Err_Invalid_File_Format' has value 0x1103, the error */ + /* `T1_Err_Invalid_File_Format' has value 0x1203, etc. */ + /* */ + /* Undefine the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in ftoption.h */ + /* to make the higher byte always zero (disabling the module error */ + /* mechanism). */ + /* */ + /* It can also be used to create a module error message table easily */ + /* with something like */ + /* */ + /* { */ + /* #undef __FTMODERR_H__ */ + /* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, */ + /* #define FT_MODERR_START_LIST { */ + /* #define FT_MODERR_END_LIST { 0, 0 } }; */ + /* */ + /* const struct */ + /* { */ + /* int mod_err_offset; */ + /* const char* mod_err_msg */ + /* } ft_mod_errors[] = */ + /* */ + /* #include FT_MODULE_ERRORS_H */ + /* } */ + /* */ + /* To use such a table, all errors must be ANDed with 0xFF00 to remove */ + /* the error code. */ + /* */ + /*************************************************************************/ + + +#ifndef __FTMODERR_H__ +#define __FTMODERR_H__ + + + /*******************************************************************/ + /*******************************************************************/ + /***** *****/ + /***** SETUP MACROS *****/ + /***** *****/ + /*******************************************************************/ + /*******************************************************************/ + + +#undef FT_NEED_EXTERN_C + +#ifndef FT_MODERRDEF + +#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS +#define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = v, +#else +#define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = 0, +#endif + +#define FT_MODERR_START_LIST enum { +#define FT_MODERR_END_LIST FT_Mod_Err_Max }; + +#ifdef __cplusplus +#define FT_NEED_EXTERN_C + extern "C" { +#endif + +#endif /* !FT_MODERRDEF */ + + + /*******************************************************************/ + /*******************************************************************/ + /***** *****/ + /***** LIST MODULE ERROR BASES *****/ + /***** *****/ + /*******************************************************************/ + /*******************************************************************/ + + +#ifdef FT_MODERR_START_LIST + FT_MODERR_START_LIST +#endif + + + FT_MODERRDEF( Base, 0x000, "base module" ) + FT_MODERRDEF( Autofit, 0x100, "autofitter module" ) + FT_MODERRDEF( BDF, 0x200, "BDF module" ) + FT_MODERRDEF( Cache, 0x300, "cache module" ) + FT_MODERRDEF( CFF, 0x400, "CFF module" ) + FT_MODERRDEF( CID, 0x500, "CID module" ) + FT_MODERRDEF( Gzip, 0x600, "Gzip module" ) + FT_MODERRDEF( LZW, 0x700, "LZW module" ) + FT_MODERRDEF( OTvalid, 0x800, "OpenType validation module" ) + FT_MODERRDEF( PCF, 0x900, "PCF module" ) + FT_MODERRDEF( PFR, 0xA00, "PFR module" ) + FT_MODERRDEF( PSaux, 0xB00, "PS auxiliary module" ) + FT_MODERRDEF( PShinter, 0xC00, "PS hinter module" ) + FT_MODERRDEF( PSnames, 0xD00, "PS names module" ) + FT_MODERRDEF( Raster, 0xE00, "raster module" ) + FT_MODERRDEF( SFNT, 0xF00, "SFNT module" ) + FT_MODERRDEF( Smooth, 0x1000, "smooth raster module" ) + FT_MODERRDEF( TrueType, 0x1100, "TrueType module" ) + FT_MODERRDEF( Type1, 0x1200, "Type 1 module" ) + FT_MODERRDEF( Type42, 0x1300, "Type 42 module" ) + FT_MODERRDEF( Winfonts, 0x1400, "Windows FON/FNT module" ) + + +#ifdef FT_MODERR_END_LIST + FT_MODERR_END_LIST +#endif + + + /*******************************************************************/ + /*******************************************************************/ + /***** *****/ + /***** CLEANUP *****/ + /***** *****/ + /*******************************************************************/ + /*******************************************************************/ + + +#ifdef FT_NEED_EXTERN_C + } +#endif + +#undef FT_MODERR_START_LIST +#undef FT_MODERR_END_LIST +#undef FT_MODERRDEF +#undef FT_NEED_EXTERN_C + + +#endif /* __FTMODERR_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftotval.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftotval.h new file mode 100644 index 0000000000..7c488fdf46 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftotval.h @@ -0,0 +1,198 @@ +/***************************************************************************/ +/* */ +/* ftotval.h */ +/* */ +/* FreeType API for validating OpenType tables (specification). */ +/* */ +/* Copyright 2004, 2005, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +/***************************************************************************/ +/* */ +/* */ +/* Warning: This module might be moved to a different library in the */ +/* future to avoid a tight dependency between FreeType and the */ +/* OpenType specification. */ +/* */ +/* */ +/***************************************************************************/ + + +#ifndef __FTOTVAL_H__ +#define __FTOTVAL_H__ + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* ot_validation */ + /* */ + /* <Title> */ + /* OpenType Validation */ + /* */ + /* <Abstract> */ + /* An API to validate OpenType tables. */ + /* */ + /* <Description> */ + /* This section contains the declaration of functions to validate */ + /* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF). */ + /* */ + /*************************************************************************/ + + + /********************************************************************** + * + * @enum: + * FT_VALIDATE_OTXXX + * + * @description: + * A list of bit-field constants used with @FT_OpenType_Validate to + * indicate which OpenType tables should be validated. + * + * @values: + * FT_VALIDATE_BASE :: + * Validate BASE table. + * + * FT_VALIDATE_GDEF :: + * Validate GDEF table. + * + * FT_VALIDATE_GPOS :: + * Validate GPOS table. + * + * FT_VALIDATE_GSUB :: + * Validate GSUB table. + * + * FT_VALIDATE_JSTF :: + * Validate JSTF table. + * + * FT_VALIDATE_OT :: + * Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF). + * + */ +#define FT_VALIDATE_BASE 0x0100 +#define FT_VALIDATE_GDEF 0x0200 +#define FT_VALIDATE_GPOS 0x0400 +#define FT_VALIDATE_GSUB 0x0800 +#define FT_VALIDATE_JSTF 0x1000 + +#define FT_VALIDATE_OT FT_VALIDATE_BASE | \ + FT_VALIDATE_GDEF | \ + FT_VALIDATE_GPOS | \ + FT_VALIDATE_GSUB | \ + FT_VALIDATE_JSTF + + /* */ + + /********************************************************************** + * + * @function: + * FT_OpenType_Validate + * + * @description: + * Validate various OpenType tables to assure that all offsets and + * indices are valid. The idea is that a higher-level library which + * actually does the text layout can access those tables without + * error checking (which can be quite time consuming). + * + * @input: + * face :: + * A handle to the input face. + * + * validation_flags :: + * A bit field which specifies the tables to be validated. See + * @FT_VALIDATE_OTXXX for possible values. + * + * @output: + * BASE_table :: + * A pointer to the BASE table. + * + * GDEF_table :: + * A pointer to the GDEF table. + * + * GPOS_table :: + * A pointer to the GPOS table. + * + * GSUB_table :: + * A pointer to the GSUB table. + * + * JSTF_table :: + * A pointer to the JSTF table. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * This function only works with OpenType fonts, returning an error + * otherwise. + * + * After use, the application should deallocate the five tables with + * @FT_OpenType_Free. A NULL value indicates that the table either + * doesn't exist in the font, or the application hasn't asked for + * validation. + */ + FT_EXPORT( FT_Error ) + FT_OpenType_Validate( FT_Face face, + FT_UInt validation_flags, + FT_Bytes *BASE_table, + FT_Bytes *GDEF_table, + FT_Bytes *GPOS_table, + FT_Bytes *GSUB_table, + FT_Bytes *JSTF_table ); + + /* */ + + /********************************************************************** + * + * @function: + * FT_OpenType_Free + * + * @description: + * Free the buffer allocated by OpenType validator. + * + * @input: + * face :: + * A handle to the input face. + * + * table :: + * The pointer to the buffer that is allocated by + * @FT_OpenType_Validate. + * + * @note: + * This function must be used to free the buffer allocated by + * @FT_OpenType_Validate only. + */ + FT_EXPORT( void ) + FT_OpenType_Free( FT_Face face, + FT_Bytes table ); + + + /* */ + + +FT_END_HEADER + +#endif /* __FTOTVAL_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftoutln.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftoutln.h new file mode 100644 index 0000000000..786ae13ed8 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftoutln.h @@ -0,0 +1,526 @@ +/***************************************************************************/ +/* */ +/* ftoutln.h */ +/* */ +/* Support for the FT_Outline type used to store glyph shapes of */ +/* most scalable font formats (specification). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTOUTLN_H__ +#define __FTOUTLN_H__ + + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* outline_processing */ + /* */ + /* <Title> */ + /* Outline Processing */ + /* */ + /* <Abstract> */ + /* Functions to create, transform, and render vectorial glyph images. */ + /* */ + /* <Description> */ + /* This section contains routines used to create and destroy scalable */ + /* glyph images known as `outlines'. These can also be measured, */ + /* transformed, and converted into bitmaps and pixmaps. */ + /* */ + /* <Order> */ + /* FT_Outline */ + /* FT_OUTLINE_FLAGS */ + /* FT_Outline_New */ + /* FT_Outline_Done */ + /* FT_Outline_Copy */ + /* FT_Outline_Translate */ + /* FT_Outline_Transform */ + /* FT_Outline_Embolden */ + /* FT_Outline_Reverse */ + /* FT_Outline_Check */ + /* */ + /* FT_Outline_Get_CBox */ + /* FT_Outline_Get_BBox */ + /* */ + /* FT_Outline_Get_Bitmap */ + /* FT_Outline_Render */ + /* */ + /* FT_Outline_Decompose */ + /* FT_Outline_Funcs */ + /* FT_Outline_MoveTo_Func */ + /* FT_Outline_LineTo_Func */ + /* FT_Outline_ConicTo_Func */ + /* FT_Outline_CubicTo_Func */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Outline_Decompose */ + /* */ + /* <Description> */ + /* Walks over an outline's structure to decompose it into individual */ + /* segments and Bézier arcs. This function is also able to emit */ + /* `move to' and `close to' operations to indicate the start and end */ + /* of new contours in the outline. */ + /* */ + /* <Input> */ + /* outline :: A pointer to the source target. */ + /* */ + /* func_interface :: A table of `emitters', i.e,. function pointers */ + /* called during decomposition to indicate path */ + /* operations. */ + /* */ + /* <InOut> */ + /* user :: A typeless pointer which is passed to each */ + /* emitter during the decomposition. It can be */ + /* used to store the state during the */ + /* decomposition. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Outline_Decompose( FT_Outline* outline, + const FT_Outline_Funcs* func_interface, + void* user ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Outline_New */ + /* */ + /* <Description> */ + /* Creates a new outline of a given size. */ + /* */ + /* <Input> */ + /* library :: A handle to the library object from where the */ + /* outline is allocated. Note however that the new */ + /* outline will *not* necessarily be *freed*, when */ + /* destroying the library, by @FT_Done_FreeType. */ + /* */ + /* numPoints :: The maximal number of points within the outline. */ + /* */ + /* numContours :: The maximal number of contours within the outline. */ + /* */ + /* <Output> */ + /* anoutline :: A handle to the new outline. NULL in case of */ + /* error. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* The reason why this function takes a `library' parameter is simply */ + /* to use the library's memory allocator. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Outline_New( FT_Library library, + FT_UInt numPoints, + FT_Int numContours, + FT_Outline *anoutline ); + + + FT_EXPORT( FT_Error ) + FT_Outline_New_Internal( FT_Memory memory, + FT_UInt numPoints, + FT_Int numContours, + FT_Outline *anoutline ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Outline_Done */ + /* */ + /* <Description> */ + /* Destroys an outline created with @FT_Outline_New. */ + /* */ + /* <Input> */ + /* library :: A handle of the library object used to allocate the */ + /* outline. */ + /* */ + /* outline :: A pointer to the outline object to be discarded. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* If the outline's `owner' field is not set, only the outline */ + /* descriptor will be released. */ + /* */ + /* The reason why this function takes an `library' parameter is */ + /* simply to use ft_mem_free(). */ + /* */ + FT_EXPORT( FT_Error ) + FT_Outline_Done( FT_Library library, + FT_Outline* outline ); + + + FT_EXPORT( FT_Error ) + FT_Outline_Done_Internal( FT_Memory memory, + FT_Outline* outline ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Outline_Check */ + /* */ + /* <Description> */ + /* Check the contents of an outline descriptor. */ + /* */ + /* <Input> */ + /* outline :: A handle to a source outline. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Outline_Check( FT_Outline* outline ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Outline_Get_CBox */ + /* */ + /* <Description> */ + /* Returns an outline's `control box'. The control box encloses all */ + /* the outline's points, including Bézier control points. Though it */ + /* coincides with the exact bounding box for most glyphs, it can be */ + /* slightly larger in some situations (like when rotating an outline */ + /* which contains Bézier outside arcs). */ + /* */ + /* Computing the control box is very fast, while getting the bounding */ + /* box can take much more time as it needs to walk over all segments */ + /* and arcs in the outline. To get the latter, you can use the */ + /* `ftbbox' component which is dedicated to this single task. */ + /* */ + /* <Input> */ + /* outline :: A pointer to the source outline descriptor. */ + /* */ + /* <Output> */ + /* acbox :: The outline's control box. */ + /* */ + FT_EXPORT( void ) + FT_Outline_Get_CBox( const FT_Outline* outline, + FT_BBox *acbox ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Outline_Translate */ + /* */ + /* <Description> */ + /* Applies a simple translation to the points of an outline. */ + /* */ + /* <InOut> */ + /* outline :: A pointer to the target outline descriptor. */ + /* */ + /* <Input> */ + /* xOffset :: The horizontal offset. */ + /* */ + /* yOffset :: The vertical offset. */ + /* */ + FT_EXPORT( void ) + FT_Outline_Translate( const FT_Outline* outline, + FT_Pos xOffset, + FT_Pos yOffset ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Outline_Copy */ + /* */ + /* <Description> */ + /* Copies an outline into another one. Both objects must have the */ + /* same sizes (number of points & number of contours) when this */ + /* function is called. */ + /* */ + /* <Input> */ + /* source :: A handle to the source outline. */ + /* */ + /* <Output> */ + /* target :: A handle to the target outline. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Outline_Copy( const FT_Outline* source, + FT_Outline *target ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Outline_Transform */ + /* */ + /* <Description> */ + /* Applies a simple 2x2 matrix to all of an outline's points. Useful */ + /* for applying rotations, slanting, flipping, etc. */ + /* */ + /* <InOut> */ + /* outline :: A pointer to the target outline descriptor. */ + /* */ + /* <Input> */ + /* matrix :: A pointer to the transformation matrix. */ + /* */ + /* <Note> */ + /* You can use @FT_Outline_Translate if you need to translate the */ + /* outline's points. */ + /* */ + FT_EXPORT( void ) + FT_Outline_Transform( const FT_Outline* outline, + const FT_Matrix* matrix ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Outline_Embolden */ + /* */ + /* <Description> */ + /* Emboldens an outline. The new outline will be at most 4 times */ + /* `strength' pixels wider and higher. You may think of the left and */ + /* bottom borders as unchanged. */ + /* */ + /* Negative `strength' values to reduce the outline thickness are */ + /* possible also. */ + /* */ + /* <InOut> */ + /* outline :: A handle to the target outline. */ + /* */ + /* <Input> */ + /* strength :: How strong the glyph is emboldened. Expressed in */ + /* 26.6 pixel format. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* The used algorithm to increase or decrease the thickness of the */ + /* glyph doesn't change the number of points; this means that certain */ + /* situations like acute angles or intersections are sometimes */ + /* handled incorrectly. */ + /* */ + /* Example call: */ + /* */ + /* { */ + /* FT_Load_Glyph( face, index, FT_LOAD_DEFAULT ); */ + /* if ( face->slot->format == FT_GLYPH_FORMAT_OUTLINE ) */ + /* FT_Outline_Embolden( &face->slot->outline, strength ); */ + /* } */ + /* */ + FT_EXPORT( FT_Error ) + FT_Outline_Embolden( FT_Outline* outline, + FT_Pos strength ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Outline_Reverse */ + /* */ + /* <Description> */ + /* Reverses the drawing direction of an outline. This is used to */ + /* ensure consistent fill conventions for mirrored glyphs. */ + /* */ + /* <InOut> */ + /* outline :: A pointer to the target outline descriptor. */ + /* */ + /* <Note> */ + /* This functions toggles the bit flag @FT_OUTLINE_REVERSE_FILL in */ + /* the outline's `flags' field. */ + /* */ + /* It shouldn't be used by a normal client application, unless it */ + /* knows what it is doing. */ + /* */ + FT_EXPORT( void ) + FT_Outline_Reverse( FT_Outline* outline ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Outline_Get_Bitmap */ + /* */ + /* <Description> */ + /* Renders an outline within a bitmap. The outline's image is simply */ + /* OR-ed to the target bitmap. */ + /* */ + /* <Input> */ + /* library :: A handle to a FreeType library object. */ + /* */ + /* outline :: A pointer to the source outline descriptor. */ + /* */ + /* <InOut> */ + /* abitmap :: A pointer to the target bitmap descriptor. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* This function does NOT CREATE the bitmap, it only renders an */ + /* outline image within the one you pass to it! */ + /* */ + /* It will use the raster corresponding to the default glyph format. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Outline_Get_Bitmap( FT_Library library, + FT_Outline* outline, + const FT_Bitmap *abitmap ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Outline_Render */ + /* */ + /* <Description> */ + /* Renders an outline within a bitmap using the current scan-convert. */ + /* This functions uses an @FT_Raster_Params structure as an argument, */ + /* allowing advanced features like direct composition, translucency, */ + /* etc. */ + /* */ + /* <Input> */ + /* library :: A handle to a FreeType library object. */ + /* */ + /* outline :: A pointer to the source outline descriptor. */ + /* */ + /* <InOut> */ + /* params :: A pointer to an @FT_Raster_Params structure used to */ + /* describe the rendering operation. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* You should know what you are doing and how @FT_Raster_Params works */ + /* to use this function. */ + /* */ + /* The field `params.source' will be set to `outline' before the scan */ + /* converter is called, which means that the value you give to it is */ + /* actually ignored. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Outline_Render( FT_Library library, + FT_Outline* outline, + FT_Raster_Params* params ); + + + /************************************************************************** + * + * @enum: + * FT_Orientation + * + * @description: + * A list of values used to describe an outline's contour orientation. + * + * The TrueType and Postscript specifications use different conventions + * to determine whether outline contours should be filled or unfilled. + * + * @values: + * FT_ORIENTATION_TRUETYPE :: + * According to the TrueType specification, clockwise contours must + * be filled, and counter-clockwise ones must be unfilled. + * + * FT_ORIENTATION_POSTSCRIPT :: + * According to the Postscript specification, counter-clockwise contours + * must be filled, and clockwise ones must be unfilled. + * + * FT_ORIENTATION_FILL_RIGHT :: + * This is identical to @FT_ORIENTATION_TRUETYPE, but is used to + * remember that in TrueType, everything that is to the right of + * the drawing direction of a contour must be filled. + * + * FT_ORIENTATION_FILL_LEFT :: + * This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to + * remember that in Postscript, everything that is to the left of + * the drawing direction of a contour must be filled. + * + * FT_ORIENTATION_NONE :: + * The orientation cannot be determined. That is, different parts of + * the glyph have different orientation. + * + */ + typedef enum + { + FT_ORIENTATION_TRUETYPE = 0, + FT_ORIENTATION_POSTSCRIPT = 1, + FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE, + FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT, + FT_ORIENTATION_NONE + + } FT_Orientation; + + + /************************************************************************** + * + * @function: + * FT_Outline_Get_Orientation + * + * @description: + * This function analyzes a glyph outline and tries to compute its + * fill orientation (see @FT_Orientation). This is done by computing + * the direction of each global horizontal and/or vertical extrema + * within the outline. + * + * Note that this will return @FT_ORIENTATION_TRUETYPE for empty + * outlines. + * + * @input: + * outline :: + * A handle to the source outline. + * + * @return: + * The orientation. + * + */ + FT_EXPORT( FT_Orientation ) + FT_Outline_Get_Orientation( FT_Outline* outline ); + + + /* */ + + +FT_END_HEADER + +#endif /* __FTOUTLN_H__ */ + + +/* END */ + + +/* Local Variables: */ +/* coding: utf-8 */ +/* End: */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftpfr.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftpfr.h new file mode 100644 index 0000000000..e2801fd0f9 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftpfr.h @@ -0,0 +1,172 @@ +/***************************************************************************/ +/* */ +/* ftpfr.h */ +/* */ +/* FreeType API for accessing PFR-specific data (specification only). */ +/* */ +/* Copyright 2002, 2003, 2004, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTPFR_H__ +#define __FTPFR_H__ + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* pfr_fonts */ + /* */ + /* <Title> */ + /* PFR Fonts */ + /* */ + /* <Abstract> */ + /* PFR/TrueDoc specific API. */ + /* */ + /* <Description> */ + /* This section contains the declaration of PFR-specific functions. */ + /* */ + /*************************************************************************/ + + + /********************************************************************** + * + * @function: + * FT_Get_PFR_Metrics + * + * @description: + * Return the outline and metrics resolutions of a given PFR face. + * + * @input: + * face :: Handle to the input face. It can be a non-PFR face. + * + * @output: + * aoutline_resolution :: + * Outline resolution. This is equivalent to `face->units_per_EM'. + * Optional (parameter can be NULL). + * + * ametrics_resolution :: + * Metrics resolution. This is equivalent to `outline_resolution' + * for non-PFR fonts. Optional (parameter can be NULL). + * + * ametrics_x_scale :: + * A 16.16 fixed-point number used to scale distance expressed + * in metrics units to device sub-pixels. This is equivalent to + * `face->size->x_scale', but for metrics only. Optional (parameter + * can be NULL) + * + * ametrics_y_scale :: + * Same as `ametrics_x_scale' but for the vertical direction. + * optional (parameter can be NULL) + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * If the input face is not a PFR, this function will return an error. + * However, in all cases, it will return valid values. + */ + FT_EXPORT( FT_Error ) + FT_Get_PFR_Metrics( FT_Face face, + FT_UInt *aoutline_resolution, + FT_UInt *ametrics_resolution, + FT_Fixed *ametrics_x_scale, + FT_Fixed *ametrics_y_scale ); + + + /********************************************************************** + * + * @function: + * FT_Get_PFR_Kerning + * + * @description: + * Return the kerning pair corresponding to two glyphs in a PFR face. + * The distance is expressed in metrics units, unlike the result of + * @FT_Get_Kerning. + * + * @input: + * face :: A handle to the input face. + * + * left :: Index of the left glyph. + * + * right :: Index of the right glyph. + * + * @output: + * avector :: A kerning vector. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * This function always return distances in original PFR metrics + * units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED + * mode, which always returns distances converted to outline units. + * + * You can use the value of the `x_scale' and `y_scale' parameters + * returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels. + */ + FT_EXPORT( FT_Error ) + FT_Get_PFR_Kerning( FT_Face face, + FT_UInt left, + FT_UInt right, + FT_Vector *avector ); + + + /********************************************************************** + * + * @function: + * FT_Get_PFR_Advance + * + * @description: + * Return a given glyph advance, expressed in original metrics units, + * from a PFR font. + * + * @input: + * face :: A handle to the input face. + * + * gindex :: The glyph index. + * + * @output: + * aadvance :: The glyph advance in metrics units. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics + * to convert the advance to device sub-pixels (i.e., 1/64th of pixels). + */ + FT_EXPORT( FT_Error ) + FT_Get_PFR_Advance( FT_Face face, + FT_UInt gindex, + FT_Pos *aadvance ); + + /* */ + + +FT_END_HEADER + +#endif /* __FTPFR_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftrender.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftrender.h new file mode 100644 index 0000000000..5b07f08c2d --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftrender.h @@ -0,0 +1,229 @@ +/***************************************************************************/ +/* */ +/* ftrender.h */ +/* */ +/* FreeType renderer modules public interface (specification). */ +/* */ +/* Copyright 1996-2001, 2005, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTRENDER_H__ +#define __FTRENDER_H__ + + +#include <ft2build.h> +#include FT_MODULE_H +#include FT_GLYPH_H + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* module_management */ + /* */ + /*************************************************************************/ + + + /* create a new glyph object */ + typedef FT_Error + (*FT_Glyph_InitFunc)( FT_Glyph glyph, + FT_GlyphSlot slot ); + + /* destroys a given glyph object */ + typedef void + (*FT_Glyph_DoneFunc)( FT_Glyph glyph ); + + typedef void + (*FT_Glyph_TransformFunc)( FT_Glyph glyph, + const FT_Matrix* matrix, + const FT_Vector* delta ); + + typedef void + (*FT_Glyph_GetBBoxFunc)( FT_Glyph glyph, + FT_BBox* abbox ); + + typedef FT_Error + (*FT_Glyph_CopyFunc)( FT_Glyph source, + FT_Glyph target ); + + typedef FT_Error + (*FT_Glyph_PrepareFunc)( FT_Glyph glyph, + FT_GlyphSlot slot ); + +/* deprecated */ +#define FT_Glyph_Init_Func FT_Glyph_InitFunc +#define FT_Glyph_Done_Func FT_Glyph_DoneFunc +#define FT_Glyph_Transform_Func FT_Glyph_TransformFunc +#define FT_Glyph_BBox_Func FT_Glyph_GetBBoxFunc +#define FT_Glyph_Copy_Func FT_Glyph_CopyFunc +#define FT_Glyph_Prepare_Func FT_Glyph_PrepareFunc + + + struct FT_Glyph_Class_ + { + FT_Long glyph_size; + FT_Glyph_Format glyph_format; + FT_Glyph_InitFunc glyph_init; + FT_Glyph_DoneFunc glyph_done; + FT_Glyph_CopyFunc glyph_copy; + FT_Glyph_TransformFunc glyph_transform; + FT_Glyph_GetBBoxFunc glyph_bbox; + FT_Glyph_PrepareFunc glyph_prepare; + }; + + + typedef FT_Error + (*FT_Renderer_RenderFunc)( FT_Renderer renderer, + FT_GlyphSlot slot, + FT_UInt mode, + const FT_Vector* origin ); + + typedef FT_Error + (*FT_Renderer_TransformFunc)( FT_Renderer renderer, + FT_GlyphSlot slot, + const FT_Matrix* matrix, + const FT_Vector* delta ); + + + typedef void + (*FT_Renderer_GetCBoxFunc)( FT_Renderer renderer, + FT_GlyphSlot slot, + FT_BBox* cbox ); + + + typedef FT_Error + (*FT_Renderer_SetModeFunc)( FT_Renderer renderer, + FT_ULong mode_tag, + FT_Pointer mode_ptr ); + +/* deprecated identifiers */ +#define FTRenderer_render FT_Renderer_RenderFunc +#define FTRenderer_transform FT_Renderer_TransformFunc +#define FTRenderer_getCBox FT_Renderer_GetCBoxFunc +#define FTRenderer_setMode FT_Renderer_SetModeFunc + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_Renderer_Class */ + /* */ + /* <Description> */ + /* The renderer module class descriptor. */ + /* */ + /* <Fields> */ + /* root :: The root @FT_Module_Class fields. */ + /* */ + /* glyph_format :: The glyph image format this renderer handles. */ + /* */ + /* render_glyph :: A method used to render the image that is in a */ + /* given glyph slot into a bitmap. */ + /* */ + /* set_mode :: A method used to pass additional parameters. */ + /* */ + /* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. This */ + /* is a pointer to its raster's class. */ + /* */ + /* raster :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. This */ + /* is a pointer to the corresponding raster object, */ + /* if any. */ + /* */ + typedef struct FT_Renderer_Class_ + { + FT_Module_Class root; + + FT_Glyph_Format glyph_format; + + FT_Renderer_RenderFunc render_glyph; + FT_Renderer_TransformFunc transform_glyph; + FT_Renderer_GetCBoxFunc get_glyph_cbox; + FT_Renderer_SetModeFunc set_mode; + + FT_Raster_Funcs* raster_class; + + } FT_Renderer_Class; + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Get_Renderer */ + /* */ + /* <Description> */ + /* Retrieves the current renderer for a given glyph format. */ + /* */ + /* <Input> */ + /* library :: A handle to the library object. */ + /* */ + /* format :: The glyph format. */ + /* */ + /* <Return> */ + /* A renderer handle. 0 if none found. */ + /* */ + /* <Note> */ + /* An error will be returned if a module already exists by that name, */ + /* or if the module requires a version of FreeType that is too great. */ + /* */ + /* To add a new renderer, simply use @FT_Add_Module. To retrieve a */ + /* renderer by its name, use @FT_Get_Module. */ + /* */ + FT_EXPORT( FT_Renderer ) + FT_Get_Renderer( FT_Library library, + FT_Glyph_Format format ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Set_Renderer */ + /* */ + /* <Description> */ + /* Sets the current renderer to use, and set additional mode. */ + /* */ + /* <InOut> */ + /* library :: A handle to the library object. */ + /* */ + /* <Input> */ + /* renderer :: A handle to the renderer object. */ + /* */ + /* num_params :: The number of additional parameters. */ + /* */ + /* parameters :: Additional parameters. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* In case of success, the renderer will be used to convert glyph */ + /* images in the renderer's known format into bitmaps. */ + /* */ + /* This doesn't change the current renderer for other formats. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Set_Renderer( FT_Library library, + FT_Renderer renderer, + FT_UInt num_params, + FT_Parameter* parameters ); + + + /* */ + + +FT_END_HEADER + +#endif /* __FTRENDER_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftsizes.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftsizes.h new file mode 100644 index 0000000000..622df162d2 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftsizes.h @@ -0,0 +1,159 @@ +/***************************************************************************/ +/* */ +/* ftsizes.h */ +/* */ +/* FreeType size objects management (specification). */ +/* */ +/* Copyright 1996-2001, 2003, 2004, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* Typical application would normally not need to use these functions. */ + /* However, they have been placed in a public API for the rare cases */ + /* where they are needed. */ + /* */ + /*************************************************************************/ + + +#ifndef __FTSIZES_H__ +#define __FTSIZES_H__ + + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* sizes_management */ + /* */ + /* <Title> */ + /* Size Management */ + /* */ + /* <Abstract> */ + /* Managing multiple sizes per face. */ + /* */ + /* <Description> */ + /* When creating a new face object (e.g., with @FT_New_Face), an */ + /* @FT_Size object is automatically created and used to store all */ + /* pixel-size dependent information, available in the `face->size' */ + /* field. */ + /* */ + /* It is however possible to create more sizes for a given face, */ + /* mostly in order to manage several character pixel sizes of the */ + /* same font family and style. See @FT_New_Size and @FT_Done_Size. */ + /* */ + /* Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only */ + /* modify the contents of the current `active' size; you thus need */ + /* to use @FT_Activate_Size to change it. */ + /* */ + /* 99% of applications won't need the functions provided here, */ + /* especially if they use the caching sub-system, so be cautious */ + /* when using these. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_New_Size */ + /* */ + /* <Description> */ + /* Create a new size object from a given face object. */ + /* */ + /* <Input> */ + /* face :: A handle to a parent face object. */ + /* */ + /* <Output> */ + /* asize :: A handle to a new size object. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* You need to call @FT_Activate_Size in order to select the new size */ + /* for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size, */ + /* @FT_Load_Glyph, @FT_Load_Char, etc. */ + /* */ + FT_EXPORT( FT_Error ) + FT_New_Size( FT_Face face, + FT_Size* size ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Done_Size */ + /* */ + /* <Description> */ + /* Discard a given size object. Note that @FT_Done_Face */ + /* automatically discards all size objects allocated with */ + /* @FT_New_Size. */ + /* */ + /* <Input> */ + /* size :: A handle to a target size object. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Done_Size( FT_Size size ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Activate_Size */ + /* */ + /* <Description> */ + /* Even though it is possible to create several size objects for a */ + /* given face (see @FT_New_Size for details), functions like */ + /* @FT_Load_Glyph or @FT_Load_Char only use the last-created one to */ + /* determine the `current character pixel size'. */ + /* */ + /* This function can be used to `activate' a previously created size */ + /* object. */ + /* */ + /* <Input> */ + /* size :: A handle to a target size object. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* If `face' is the size's parent face object, this function changes */ + /* the value of `face->size' to the input size handle. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Activate_Size( FT_Size size ); + + /* */ + + +FT_END_HEADER + +#endif /* __FTSIZES_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftsnames.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftsnames.h new file mode 100644 index 0000000000..003cbcd129 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftsnames.h @@ -0,0 +1,170 @@ +/***************************************************************************/ +/* */ +/* ftsnames.h */ +/* */ +/* Simple interface to access SFNT name tables (which are used */ +/* to hold font names, copyright info, notices, etc.) (specification). */ +/* */ +/* This is _not_ used to retrieve glyph names! */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FT_SFNT_NAMES_H__ +#define __FT_SFNT_NAMES_H__ + + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* sfnt_names */ + /* */ + /* <Title> */ + /* SFNT Names */ + /* */ + /* <Abstract> */ + /* Access the names embedded in TrueType and OpenType files. */ + /* */ + /* <Description> */ + /* The TrueType and OpenType specification allow the inclusion of */ + /* a special `names table' in font files. This table contains */ + /* textual (and internationalized) information regarding the font, */ + /* like family name, copyright, version, etc. */ + /* */ + /* The definitions below are used to access them if available. */ + /* */ + /* Note that this has nothing to do with glyph names! */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_SfntName */ + /* */ + /* <Description> */ + /* A structure used to model an SFNT `name' table entry. */ + /* */ + /* <Fields> */ + /* platform_id :: The platform ID for `string'. */ + /* */ + /* encoding_id :: The encoding ID for `string'. */ + /* */ + /* language_id :: The language ID for `string'. */ + /* */ + /* name_id :: An identifier for `string'. */ + /* */ + /* string :: The `name' string. Note that its format differs */ + /* depending on the (platform,encoding) pair. It can */ + /* be a Pascal String, a UTF-16 one, etc. */ + /* */ + /* Generally speaking, the string is not */ + /* zero-terminated. Please refer to the TrueType */ + /* specification for details. */ + /* */ + /* string_len :: The length of `string' in bytes. */ + /* */ + /* <Note> */ + /* Possible values for `platform_id', `encoding_id', `language_id', */ + /* and `name_id' are given in the file `ttnameid.h'. For details */ + /* please refer to the TrueType or OpenType specification. */ + /* */ + /* See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */ + /* @TT_ISO_ID_XXX, and @TT_MS_ID_XXX. */ + /* */ + typedef struct FT_SfntName_ + { + FT_UShort platform_id; + FT_UShort encoding_id; + FT_UShort language_id; + FT_UShort name_id; + + FT_Byte* string; /* this string is *not* null-terminated! */ + FT_UInt string_len; /* in bytes */ + + } FT_SfntName; + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Get_Sfnt_Name_Count */ + /* */ + /* <Description> */ + /* Retrieves the number of name strings in the SFNT `name' table. */ + /* */ + /* <Input> */ + /* face :: A handle to the source face. */ + /* */ + /* <Return> */ + /* The number of strings in the `name' table. */ + /* */ + FT_EXPORT( FT_UInt ) + FT_Get_Sfnt_Name_Count( FT_Face face ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Get_Sfnt_Name */ + /* */ + /* <Description> */ + /* Retrieves a string of the SFNT `name' table for a given index. */ + /* */ + /* <Input> */ + /* face :: A handle to the source face. */ + /* */ + /* idx :: The index of the `name' string. */ + /* */ + /* <Output> */ + /* aname :: The indexed @FT_SfntName structure. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* The `string' array returned in the `aname' structure is not */ + /* null-terminated. */ + /* */ + /* Use @FT_Get_Sfnt_Name_Count to get the total number of available */ + /* `name' table entries, then do a loop until you get the right */ + /* platform, encoding, and name ID. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Get_Sfnt_Name( FT_Face face, + FT_UInt idx, + FT_SfntName *aname ); + + + /* */ + + +FT_END_HEADER + +#endif /* __FT_SFNT_NAMES_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftstroke.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftstroke.h new file mode 100644 index 0000000000..738b43c1ac --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftstroke.h @@ -0,0 +1,716 @@ +/***************************************************************************/ +/* */ +/* ftstroke.h */ +/* */ +/* FreeType path stroker (specification). */ +/* */ +/* Copyright 2002, 2003, 2004, 2005, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FT_STROKE_H__ +#define __FT_STROKE_H__ + +#include <ft2build.h> +#include FT_OUTLINE_H +#include FT_GLYPH_H + + +FT_BEGIN_HEADER + + + /************************************************************************ + * + * @section: + * glyph_stroker + * + * @title: + * Glyph Stroker + * + * @abstract: + * Generating bordered and stroked glyphs. + * + * @description: + * This component generates stroked outlines of a given vectorial + * glyph. It also allows you to retrieve the `outside' and/or the + * `inside' borders of the stroke. + * + * This can be useful to generate `bordered' glyph, i.e., glyphs + * displayed with a coloured (and anti-aliased) border around their + * shape. + */ + + + /************************************************************** + * + * @type: + * FT_Stroker + * + * @description: + * Opaque handler to a path stroker object. + */ + typedef struct FT_StrokerRec_* FT_Stroker; + + + /************************************************************** + * + * @enum: + * FT_Stroker_LineJoin + * + * @description: + * These values determine how two joining lines are rendered + * in a stroker. + * + * @values: + * FT_STROKER_LINEJOIN_ROUND :: + * Used to render rounded line joins. Circular arcs are used + * to join two lines smoothly. + * + * FT_STROKER_LINEJOIN_BEVEL :: + * Used to render beveled line joins; i.e., the two joining lines + * are extended until they intersect. + * + * FT_STROKER_LINEJOIN_MITER :: + * Same as beveled rendering, except that an additional line + * break is added if the angle between the two joining lines + * is too closed (this is useful to avoid unpleasant spikes + * in beveled rendering). + */ + typedef enum + { + FT_STROKER_LINEJOIN_ROUND = 0, + FT_STROKER_LINEJOIN_BEVEL, + FT_STROKER_LINEJOIN_MITER + + } FT_Stroker_LineJoin; + + + /************************************************************** + * + * @enum: + * FT_Stroker_LineCap + * + * @description: + * These values determine how the end of opened sub-paths are + * rendered in a stroke. + * + * @values: + * FT_STROKER_LINECAP_BUTT :: + * The end of lines is rendered as a full stop on the last + * point itself. + * + * FT_STROKER_LINECAP_ROUND :: + * The end of lines is rendered as a half-circle around the + * last point. + * + * FT_STROKER_LINECAP_SQUARE :: + * The end of lines is rendered as a square around the + * last point. + */ + typedef enum + { + FT_STROKER_LINECAP_BUTT = 0, + FT_STROKER_LINECAP_ROUND, + FT_STROKER_LINECAP_SQUARE + + } FT_Stroker_LineCap; + + + /************************************************************** + * + * @enum: + * FT_StrokerBorder + * + * @description: + * These values are used to select a given stroke border + * in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder. + * + * @values: + * FT_STROKER_BORDER_LEFT :: + * Select the left border, relative to the drawing direction. + * + * FT_STROKER_BORDER_RIGHT :: + * Select the right border, relative to the drawing direction. + * + * @note: + * Applications are generally interested in the `inside' and `outside' + * borders. However, there is no direct mapping between these and the + * `left' and `right' ones, since this really depends on the glyph's + * drawing orientation, which varies between font formats. + * + * You can however use @FT_Outline_GetInsideBorder and + * @FT_Outline_GetOutsideBorder to get these. + */ + typedef enum + { + FT_STROKER_BORDER_LEFT = 0, + FT_STROKER_BORDER_RIGHT + + } FT_StrokerBorder; + + + /************************************************************** + * + * @function: + * FT_Outline_GetInsideBorder + * + * @description: + * Retrieve the @FT_StrokerBorder value corresponding to the + * `inside' borders of a given outline. + * + * @input: + * outline :: + * The source outline handle. + * + * @return: + * The border index. @FT_STROKER_BORDER_LEFT for empty or invalid + * outlines. + */ + FT_EXPORT( FT_StrokerBorder ) + FT_Outline_GetInsideBorder( FT_Outline* outline ); + + + /************************************************************** + * + * @function: + * FT_Outline_GetOutsideBorder + * + * @description: + * Retrieve the @FT_StrokerBorder value corresponding to the + * `outside' borders of a given outline. + * + * @input: + * outline :: + * The source outline handle. + * + * @return: + * The border index. @FT_STROKER_BORDER_LEFT for empty or invalid + * outlines. + */ + FT_EXPORT( FT_StrokerBorder ) + FT_Outline_GetOutsideBorder( FT_Outline* outline ); + + + /************************************************************** + * + * @function: + * FT_Stroker_New + * + * @description: + * Create a new stroker object. + * + * @input: + * library :: + * FreeType library handle. + * + * @output: + * astroker :: + * A new stroker object handle. NULL in case of error. + * + * @return: + * FreeType error code. 0 means success. + */ + FT_EXPORT( FT_Error ) + FT_Stroker_New( FT_Library library, + FT_Stroker *astroker ); + + + /************************************************************** + * + * @function: + * FT_Stroker_Set + * + * @description: + * Reset a stroker object's attributes. + * + * @input: + * stroker :: + * The target stroker handle. + * + * radius :: + * The border radius. + * + * line_cap :: + * The line cap style. + * + * line_join :: + * The line join style. + * + * miter_limit :: + * The miter limit for the FT_STROKER_LINEJOIN_MITER style, + * expressed as 16.16 fixed point value. + * + * @note: + * The radius is expressed in the same units that the outline + * coordinates. + */ + FT_EXPORT( void ) + FT_Stroker_Set( FT_Stroker stroker, + FT_Fixed radius, + FT_Stroker_LineCap line_cap, + FT_Stroker_LineJoin line_join, + FT_Fixed miter_limit ); + + + /************************************************************** + * + * @function: + * FT_Stroker_Rewind + * + * @description: + * Reset a stroker object without changing its attributes. + * You should call this function before beginning a new + * series of calls to @FT_Stroker_BeginSubPath or + * @FT_Stroker_EndSubPath. + * + * @input: + * stroker :: + * The target stroker handle. + */ + FT_EXPORT( void ) + FT_Stroker_Rewind( FT_Stroker stroker ); + + + /************************************************************** + * + * @function: + * FT_Stroker_ParseOutline + * + * @description: + * A convenience function used to parse a whole outline with + * the stroker. The resulting outline(s) can be retrieved + * later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export. + * + * @input: + * stroker :: + * The target stroker handle. + * + * outline :: + * The source outline. + * + * opened :: + * A boolean. If 1, the outline is treated as an open path instead + * of a closed one. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * If `opened' is 0 (the default), the outline is treated as a closed + * path, and the stroker will generate two distinct `border' outlines. + * + * If `opened' is 1, the outline is processed as an open path, and the + * stroker will generate a single `stroke' outline. + * + * This function calls @FT_Stroker_Rewind automatically. + */ + FT_EXPORT( FT_Error ) + FT_Stroker_ParseOutline( FT_Stroker stroker, + FT_Outline* outline, + FT_Bool opened ); + + + /************************************************************** + * + * @function: + * FT_Stroker_BeginSubPath + * + * @description: + * Start a new sub-path in the stroker. + * + * @input: + * stroker :: + * The target stroker handle. + * + * to :: + * A pointer to the start vector. + * + * open :: + * A boolean. If 1, the sub-path is treated as an open one. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * This function is useful when you need to stroke a path that is + * not stored as an @FT_Outline object. + */ + FT_EXPORT( FT_Error ) + FT_Stroker_BeginSubPath( FT_Stroker stroker, + FT_Vector* to, + FT_Bool open ); + + + /************************************************************** + * + * @function: + * FT_Stroker_EndSubPath + * + * @description: + * Close the current sub-path in the stroker. + * + * @input: + * stroker :: + * The target stroker handle. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * You should call this function after @FT_Stroker_BeginSubPath. + * If the subpath was not `opened', this function will `draw' a + * single line segment to the start position when needed. + */ + FT_EXPORT( FT_Error ) + FT_Stroker_EndSubPath( FT_Stroker stroker ); + + + /************************************************************** + * + * @function: + * FT_Stroker_LineTo + * + * @description: + * `Draw' a single line segment in the stroker's current sub-path, + * from the last position. + * + * @input: + * stroker :: + * The target stroker handle. + * + * to :: + * A pointer to the destination point. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * You should call this function between @FT_Stroker_BeginSubPath and + * @FT_Stroker_EndSubPath. + */ + FT_EXPORT( FT_Error ) + FT_Stroker_LineTo( FT_Stroker stroker, + FT_Vector* to ); + + + /************************************************************** + * + * @function: + * FT_Stroker_ConicTo + * + * @description: + * `Draw' a single quadratic Bézier in the stroker's current sub-path, + * from the last position. + * + * @input: + * stroker :: + * The target stroker handle. + * + * control :: + * A pointer to a Bézier control point. + * + * to :: + * A pointer to the destination point. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * You should call this function between @FT_Stroker_BeginSubPath and + * @FT_Stroker_EndSubPath. + */ + FT_EXPORT( FT_Error ) + FT_Stroker_ConicTo( FT_Stroker stroker, + FT_Vector* control, + FT_Vector* to ); + + + /************************************************************** + * + * @function: + * FT_Stroker_CubicTo + * + * @description: + * `Draw' a single cubic Bézier in the stroker's current sub-path, + * from the last position. + * + * @input: + * stroker :: + * The target stroker handle. + * + * control1 :: + * A pointer to the first Bézier control point. + * + * control2 :: + * A pointer to second Bézier control point. + * + * to :: + * A pointer to the destination point. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * You should call this function between @FT_Stroker_BeginSubPath and + * @FT_Stroker_EndSubPath. + */ + FT_EXPORT( FT_Error ) + FT_Stroker_CubicTo( FT_Stroker stroker, + FT_Vector* control1, + FT_Vector* control2, + FT_Vector* to ); + + + /************************************************************** + * + * @function: + * FT_Stroker_GetBorderCounts + * + * @description: + * Call this function once you have finished parsing your paths + * with the stroker. It will return the number of points and + * contours necessary to export one of the `border' or `stroke' + * outlines generated by the stroker. + * + * @input: + * stroker :: + * The target stroker handle. + * + * border :: + * The border index. + * + * @output: + * anum_points :: + * The number of points. + * + * anum_contours :: + * The number of contours. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * When an outline, or a sub-path, is `closed', the stroker generates + * two independent `border' outlines, named `left' and `right'. + * + * When the outline, or a sub-path, is `opened', the stroker merges + * the `border' outlines with caps. The `left' border receives all + * points, while the `right' border becomes empty. + * + * Use the function @FT_Stroker_GetCounts instead if you want to + * retrieve the counts associated to both borders. + */ + FT_EXPORT( FT_Error ) + FT_Stroker_GetBorderCounts( FT_Stroker stroker, + FT_StrokerBorder border, + FT_UInt *anum_points, + FT_UInt *anum_contours ); + + + /************************************************************** + * + * @function: + * FT_Stroker_ExportBorder + * + * @description: + * Call this function after @FT_Stroker_GetBorderCounts to + * export the corresponding border to your own @FT_Outline + * structure. + * + * Note that this function will append the border points and + * contours to your outline, but will not try to resize its + * arrays. + * + * @input: + * stroker :: + * The target stroker handle. + * + * border :: + * The border index. + * + * outline :: + * The target outline handle. + * + * @note: + * Always call this function after @FT_Stroker_GetBorderCounts to + * get sure that there is enough room in your @FT_Outline object to + * receive all new data. + * + * When an outline, or a sub-path, is `closed', the stroker generates + * two independent `border' outlines, named `left' and `right' + * + * When the outline, or a sub-path, is `opened', the stroker merges + * the `border' outlines with caps. The `left' border receives all + * points, while the `right' border becomes empty. + * + * Use the function @FT_Stroker_Export instead if you want to + * retrieve all borders at once. + */ + FT_EXPORT( void ) + FT_Stroker_ExportBorder( FT_Stroker stroker, + FT_StrokerBorder border, + FT_Outline* outline ); + + + /************************************************************** + * + * @function: + * FT_Stroker_GetCounts + * + * @description: + * Call this function once you have finished parsing your paths + * with the stroker. It returns the number of points and + * contours necessary to export all points/borders from the stroked + * outline/path. + * + * @input: + * stroker :: + * The target stroker handle. + * + * @output: + * anum_points :: + * The number of points. + * + * anum_contours :: + * The number of contours. + * + * @return: + * FreeType error code. 0 means success. + */ + FT_EXPORT( FT_Error ) + FT_Stroker_GetCounts( FT_Stroker stroker, + FT_UInt *anum_points, + FT_UInt *anum_contours ); + + + /************************************************************** + * + * @function: + * FT_Stroker_Export + * + * @description: + * Call this function after @FT_Stroker_GetBorderCounts to + * export the all borders to your own @FT_Outline structure. + * + * Note that this function will append the border points and + * contours to your outline, but will not try to resize its + * arrays. + * + * @input: + * stroker :: + * The target stroker handle. + * + * outline :: + * The target outline handle. + */ + FT_EXPORT( void ) + FT_Stroker_Export( FT_Stroker stroker, + FT_Outline* outline ); + + + /************************************************************** + * + * @function: + * FT_Stroker_Done + * + * @description: + * Destroy a stroker object. + * + * @input: + * stroker :: + * A stroker handle. Can be NULL. + */ + FT_EXPORT( void ) + FT_Stroker_Done( FT_Stroker stroker ); + + + /************************************************************** + * + * @function: + * FT_Glyph_Stroke + * + * @description: + * Stroke a given outline glyph object with a given stroker. + * + * @inout: + * pglyph :: + * Source glyph handle on input, new glyph handle on output. + * + * @input: + * stroker :: + * A stroker handle. + * + * destroy :: + * A Boolean. If 1, the source glyph object is destroyed + * on success. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * The source glyph is untouched in case of error. + */ + FT_EXPORT( FT_Error ) + FT_Glyph_Stroke( FT_Glyph *pglyph, + FT_Stroker stroker, + FT_Bool destroy ); + + + /************************************************************** + * + * @function: + * FT_Glyph_StrokeBorder + * + * @description: + * Stroke a given outline glyph object with a given stroker, but + * only return either its inside or outside border. + * + * @inout: + * pglyph :: + * Source glyph handle on input, new glyph handle on output. + * + * @input: + * stroker :: + * A stroker handle. + * + * inside :: + * A Boolean. If 1, return the inside border, otherwise + * the outside border. + * + * destroy :: + * A Boolean. If 1, the source glyph object is destroyed + * on success. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * The source glyph is untouched in case of error. + */ + FT_EXPORT( FT_Error ) + FT_Glyph_StrokeBorder( FT_Glyph *pglyph, + FT_Stroker stroker, + FT_Bool inside, + FT_Bool destroy ); + + /* */ + +FT_END_HEADER + +#endif /* __FT_STROKE_H__ */ + + +/* END */ + + +/* Local Variables: */ +/* coding: utf-8 */ +/* End: */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftsynth.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftsynth.h new file mode 100644 index 0000000000..36984bf1a7 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftsynth.h @@ -0,0 +1,73 @@ +/***************************************************************************/ +/* */ +/* ftsynth.h */ +/* */ +/* FreeType synthesizing code for emboldening and slanting */ +/* (specification). */ +/* */ +/* Copyright 2000-2001, 2003, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /********* *********/ + /********* WARNING, THIS IS ALPHA CODE, THIS API *********/ + /********* IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE *********/ + /********* FREETYPE DEVELOPMENT TEAM *********/ + /********* *********/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + + +#ifndef __FTSYNTH_H__ +#define __FTSYNTH_H__ + + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + /* Make sure slot owns slot->bitmap. */ + FT_EXPORT( FT_Error ) + FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot ); + + /* Do not use this function directly! Copy the code to */ + /* your application and modify it to suit your need. */ + FT_EXPORT( void ) + FT_GlyphSlot_Embolden( FT_GlyphSlot slot ); + + + FT_EXPORT( void ) + FT_GlyphSlot_Oblique( FT_GlyphSlot slot ); + + /* */ + +FT_END_HEADER + +#endif /* __FTSYNTH_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftsystem.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftsystem.h new file mode 100644 index 0000000000..59cd019822 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftsystem.h @@ -0,0 +1,346 @@ +/***************************************************************************/ +/* */ +/* ftsystem.h */ +/* */ +/* FreeType low-level system interface definition (specification). */ +/* */ +/* Copyright 1996-2001, 2002, 2005 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTSYSTEM_H__ +#define __FTSYSTEM_H__ + + +#include <ft2build.h> + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* system_interface */ + /* */ + /* <Title> */ + /* System Interface */ + /* */ + /* <Abstract> */ + /* How FreeType manages memory and i/o. */ + /* */ + /* <Description> */ + /* This section contains various definitions related to memory */ + /* management and i/o access. You need to understand this */ + /* information if you want to use a custom memory manager or you own */ + /* i/o streams. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* M E M O R Y M A N A G E M E N T */ + /* */ + /*************************************************************************/ + + + /************************************************************************* + * + * @type: + * FT_Memory + * + * @description: + * A handle to a given memory manager object, defined with an + * @FT_MemoryRec structure. + * + */ + typedef struct FT_MemoryRec_* FT_Memory; + + + /************************************************************************* + * + * @functype: + * FT_Alloc_Func + * + * @description: + * A function used to allocate `size' bytes from `memory'. + * + * @input: + * memory :: + * A handle to the source memory manager. + * + * size :: + * The size in bytes to allocate. + * + * @return: + * Address of new memory block. 0 in case of failure. + * + */ + typedef void* + (*FT_Alloc_Func)( FT_Memory memory, + long size ); + + + /************************************************************************* + * + * @functype: + * FT_Free_Func + * + * @description: + * A function used to release a given block of memory. + * + * @input: + * memory :: + * A handle to the source memory manager. + * + * block :: + * The address of the target memory block. + * + */ + typedef void + (*FT_Free_Func)( FT_Memory memory, + void* block ); + + + /************************************************************************* + * + * @functype: + * FT_Realloc_Func + * + * @description: + * A function used to re-allocate a given block of memory. + * + * @input: + * memory :: + * A handle to the source memory manager. + * + * cur_size :: + * The block's current size in bytes. + * + * new_size :: + * The block's requested new size. + * + * block :: + * The block's current address. + * + * @return: + * New block address. 0 in case of memory shortage. + * + * @note: + * In case of error, the old block must still be available. + * + */ + typedef void* + (*FT_Realloc_Func)( FT_Memory memory, + long cur_size, + long new_size, + void* block ); + + + /************************************************************************* + * + * @struct: + * FT_MemoryRec + * + * @description: + * A structure used to describe a given memory manager to FreeType 2. + * + * @fields: + * user :: + * A generic typeless pointer for user data. + * + * alloc :: + * A pointer type to an allocation function. + * + * free :: + * A pointer type to an memory freeing function. + * + * realloc :: + * A pointer type to a reallocation function. + * + */ + struct FT_MemoryRec_ + { + void* user; + FT_Alloc_Func alloc; + FT_Free_Func free; + FT_Realloc_Func realloc; + }; + + + /*************************************************************************/ + /* */ + /* I / O M A N A G E M E N T */ + /* */ + /*************************************************************************/ + + + /************************************************************************* + * + * @type: + * FT_Stream + * + * @description: + * A handle to an input stream. + * + */ + typedef struct FT_StreamRec_* FT_Stream; + + + /************************************************************************* + * + * @struct: + * FT_StreamDesc + * + * @description: + * A union type used to store either a long or a pointer. This is used + * to store a file descriptor or a `FILE*' in an input stream. + * + */ + typedef union FT_StreamDesc_ + { + long value; + void* pointer; + + } FT_StreamDesc; + + + /************************************************************************* + * + * @functype: + * FT_Stream_IoFunc + * + * @description: + * A function used to seek and read data from a given input stream. + * + * @input: + * stream :: + * A handle to the source stream. + * + * offset :: + * The offset of read in stream (always from start). + * + * buffer :: + * The address of the read buffer. + * + * count :: + * The number of bytes to read from the stream. + * + * @return: + * The number of bytes effectively read by the stream. + * + * @note: + * This function might be called to perform a seek or skip operation + * with a `count' of 0. + * + */ + typedef unsigned long + (*FT_Stream_IoFunc)( FT_Stream stream, + unsigned long offset, + unsigned char* buffer, + unsigned long count ); + + + /************************************************************************* + * + * @functype: + * FT_Stream_CloseFunc + * + * @description: + * A function used to close a given input stream. + * + * @input: + * stream :: + * A handle to the target stream. + * + */ + typedef void + (*FT_Stream_CloseFunc)( FT_Stream stream ); + + + /************************************************************************* + * + * @struct: + * FT_StreamRec + * + * @description: + * A structure used to describe an input stream. + * + * @input: + * base :: + * For memory-based streams, this is the address of the first stream + * byte in memory. This field should always be set to NULL for + * disk-based streams. + * + * size :: + * The stream size in bytes. + * + * pos :: + * The current position within the stream. + * + * descriptor :: + * This field is a union that can hold an integer or a pointer. It is + * used by stream implementations to store file descriptors or `FILE*' + * pointers. + * + * pathname :: + * This field is completely ignored by FreeType. However, it is often + * useful during debugging to use it to store the stream's filename + * (where available). + * + * read :: + * The stream's input function. + * + * close :: + * The stream;s close function. + * + * memory :: + * The memory manager to use to preload frames. This is set + * internally by FreeType and shouldn't be touched by stream + * implementations. + * + * cursor :: + * This field is set and used internally by FreeType when parsing + * frames. + * + * limit :: + * This field is set and used internally by FreeType when parsing + * frames. + * + */ + typedef struct FT_StreamRec_ + { + unsigned char* base; + unsigned long size; + unsigned long pos; + + FT_StreamDesc descriptor; + FT_StreamDesc pathname; + FT_Stream_IoFunc read; + FT_Stream_CloseFunc close; + + FT_Memory memory; + unsigned char* cursor; + unsigned char* limit; + + } FT_StreamRec; + + + /* */ + + +FT_END_HEADER + +#endif /* __FTSYSTEM_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/fttrigon.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/fttrigon.h new file mode 100644 index 0000000000..6b77d2ee54 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/fttrigon.h @@ -0,0 +1,350 @@ +/***************************************************************************/ +/* */ +/* fttrigon.h */ +/* */ +/* FreeType trigonometric functions (specification). */ +/* */ +/* Copyright 2001, 2003, 2005, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTTRIGON_H__ +#define __FTTRIGON_H__ + +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* computations */ + /* */ + /*************************************************************************/ + + + /************************************************************************* + * + * @type: + * FT_Angle + * + * @description: + * This type is used to model angle values in FreeType. Note that the + * angle is a 16.16 fixed float value expressed in degrees. + * + */ + typedef FT_Fixed FT_Angle; + + + /************************************************************************* + * + * @macro: + * FT_ANGLE_PI + * + * @description: + * The angle pi expressed in @FT_Angle units. + * + */ +#define FT_ANGLE_PI ( 180L << 16 ) + + + /************************************************************************* + * + * @macro: + * FT_ANGLE_2PI + * + * @description: + * The angle 2*pi expressed in @FT_Angle units. + * + */ +#define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 ) + + + /************************************************************************* + * + * @macro: + * FT_ANGLE_PI2 + * + * @description: + * The angle pi/2 expressed in @FT_Angle units. + * + */ +#define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 ) + + + /************************************************************************* + * + * @macro: + * FT_ANGLE_PI4 + * + * @description: + * The angle pi/4 expressed in @FT_Angle units. + * + */ +#define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 ) + + + /************************************************************************* + * + * @function: + * FT_Sin + * + * @description: + * Return the sinus of a given angle in fixed point format. + * + * @input: + * angle :: + * The input angle. + * + * @return: + * The sinus value. + * + * @note: + * If you need both the sinus and cosinus for a given angle, use the + * function @FT_Vector_Unit. + * + */ + FT_EXPORT( FT_Fixed ) + FT_Sin( FT_Angle angle ); + + + /************************************************************************* + * + * @function: + * FT_Cos + * + * @description: + * Return the cosinus of a given angle in fixed point format. + * + * @input: + * angle :: + * The input angle. + * + * @return: + * The cosinus value. + * + * @note: + * If you need both the sinus and cosinus for a given angle, use the + * function @FT_Vector_Unit. + * + */ + FT_EXPORT( FT_Fixed ) + FT_Cos( FT_Angle angle ); + + + /************************************************************************* + * + * @function: + * FT_Tan + * + * @description: + * Return the tangent of a given angle in fixed point format. + * + * @input: + * angle :: + * The input angle. + * + * @return: + * The tangent value. + * + */ + FT_EXPORT( FT_Fixed ) + FT_Tan( FT_Angle angle ); + + + /************************************************************************* + * + * @function: + * FT_Atan2 + * + * @description: + * Return the arc-tangent corresponding to a given vector (x,y) in + * the 2d plane. + * + * @input: + * x :: + * The horizontal vector coordinate. + * + * y :: + * The vertical vector coordinate. + * + * @return: + * The arc-tangent value (i.e. angle). + * + */ + FT_EXPORT( FT_Angle ) + FT_Atan2( FT_Fixed x, + FT_Fixed y ); + + + /************************************************************************* + * + * @function: + * FT_Angle_Diff + * + * @description: + * Return the difference between two angles. The result is always + * constrained to the ]-PI..PI] interval. + * + * @input: + * angle1 :: + * First angle. + * + * angle2 :: + * Second angle. + * + * @return: + * Constrained value of `value2-value1'. + * + */ + FT_EXPORT( FT_Angle ) + FT_Angle_Diff( FT_Angle angle1, + FT_Angle angle2 ); + + + /************************************************************************* + * + * @function: + * FT_Vector_Unit + * + * @description: + * Return the unit vector corresponding to a given angle. After the + * call, the value of `vec.x' will be `sin(angle)', and the value of + * `vec.y' will be `cos(angle)'. + * + * This function is useful to retrieve both the sinus and cosinus of a + * given angle quickly. + * + * @output: + * vec :: + * The address of target vector. + * + * @input: + * angle :: + * The address of angle. + * + */ + FT_EXPORT( void ) + FT_Vector_Unit( FT_Vector* vec, + FT_Angle angle ); + + + /************************************************************************* + * + * @function: + * FT_Vector_Rotate + * + * @description: + * Rotate a vector by a given angle. + * + * @inout: + * vec :: + * The address of target vector. + * + * @input: + * angle :: + * The address of angle. + * + */ + FT_EXPORT( void ) + FT_Vector_Rotate( FT_Vector* vec, + FT_Angle angle ); + + + /************************************************************************* + * + * @function: + * FT_Vector_Length + * + * @description: + * Return the length of a given vector. + * + * @input: + * vec :: + * The address of target vector. + * + * @return: + * The vector length, expressed in the same units that the original + * vector coordinates. + * + */ + FT_EXPORT( FT_Fixed ) + FT_Vector_Length( FT_Vector* vec ); + + + /************************************************************************* + * + * @function: + * FT_Vector_Polarize + * + * @description: + * Compute both the length and angle of a given vector. + * + * @input: + * vec :: + * The address of source vector. + * + * @output: + * length :: + * The vector length. + * + * angle :: + * The vector angle. + * + */ + FT_EXPORT( void ) + FT_Vector_Polarize( FT_Vector* vec, + FT_Fixed *length, + FT_Angle *angle ); + + + /************************************************************************* + * + * @function: + * FT_Vector_From_Polar + * + * @description: + * Compute vector coordinates from a length and angle. + * + * @output: + * vec :: + * The address of source vector. + * + * @input: + * length :: + * The vector length. + * + * angle :: + * The vector angle. + * + */ + FT_EXPORT( void ) + FT_Vector_From_Polar( FT_Vector* vec, + FT_Fixed length, + FT_Angle angle ); + + /* */ + + +FT_END_HEADER + +#endif /* __FTTRIGON_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/fttypes.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/fttypes.h new file mode 100644 index 0000000000..2340bacd31 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/fttypes.h @@ -0,0 +1,583 @@ +/***************************************************************************/ +/* */ +/* fttypes.h */ +/* */ +/* FreeType simple types definitions (specification only). */ +/* */ +/* Copyright 1996-2001, 2002, 2004, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTTYPES_H__ +#define __FTTYPES_H__ + + +#include <ft2build.h> +#include FT_CONFIG_CONFIG_H +#include FT_SYSTEM_H +#include FT_IMAGE_H + +#include <stddef.h> + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* basic_types */ + /* */ + /* <Title> */ + /* Basic Data Types */ + /* */ + /* <Abstract> */ + /* The basic data types defined by the library. */ + /* */ + /* <Description> */ + /* This section contains the basic data types defined by FreeType 2, */ + /* ranging from simple scalar types to bitmap descriptors. More */ + /* font-specific structures are defined in a different section. */ + /* */ + /* <Order> */ + /* FT_Byte */ + /* FT_Bytes */ + /* FT_Char */ + /* FT_Int */ + /* FT_UInt */ + /* FT_Short */ + /* FT_UShort */ + /* FT_Long */ + /* FT_ULong */ + /* FT_Bool */ + /* FT_Offset */ + /* FT_PtrDist */ + /* FT_String */ + /* FT_Tag */ + /* FT_Error */ + /* FT_Fixed */ + /* FT_Pointer */ + /* FT_Pos */ + /* FT_Vector */ + /* FT_BBox */ + /* FT_Matrix */ + /* FT_FWord */ + /* FT_UFWord */ + /* FT_F2Dot14 */ + /* FT_UnitVector */ + /* FT_F26Dot6 */ + /* */ + /* */ + /* FT_Generic */ + /* FT_Generic_Finalizer */ + /* */ + /* FT_Bitmap */ + /* FT_Pixel_Mode */ + /* FT_Palette_Mode */ + /* FT_Glyph_Format */ + /* FT_IMAGE_TAG */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Bool */ + /* */ + /* <Description> */ + /* A typedef of unsigned char, used for simple booleans. As usual, */ + /* values 1 and 0 represent true and false, respectively. */ + /* */ + typedef unsigned char FT_Bool; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_FWord */ + /* */ + /* <Description> */ + /* A signed 16-bit integer used to store a distance in original font */ + /* units. */ + /* */ + typedef signed short FT_FWord; /* distance in FUnits */ + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_UFWord */ + /* */ + /* <Description> */ + /* An unsigned 16-bit integer used to store a distance in original */ + /* font units. */ + /* */ + typedef unsigned short FT_UFWord; /* unsigned distance */ + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Char */ + /* */ + /* <Description> */ + /* A simple typedef for the _signed_ char type. */ + /* */ + typedef signed char FT_Char; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Byte */ + /* */ + /* <Description> */ + /* A simple typedef for the _unsigned_ char type. */ + /* */ + typedef unsigned char FT_Byte; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Bytes */ + /* */ + /* <Description> */ + /* A typedef for constant memory areas. */ + /* */ + typedef const FT_Byte* FT_Bytes; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Tag */ + /* */ + /* <Description> */ + /* A typedef for 32bit tags (as used in the SFNT format). */ + /* */ + typedef FT_UInt32 FT_Tag; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_String */ + /* */ + /* <Description> */ + /* A simple typedef for the char type, usually used for strings. */ + /* */ + typedef char FT_String; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Short */ + /* */ + /* <Description> */ + /* A typedef for signed short. */ + /* */ + typedef signed short FT_Short; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_UShort */ + /* */ + /* <Description> */ + /* A typedef for unsigned short. */ + /* */ + typedef unsigned short FT_UShort; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Int */ + /* */ + /* <Description> */ + /* A typedef for the int type. */ + /* */ + typedef signed int FT_Int; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_UInt */ + /* */ + /* <Description> */ + /* A typedef for the unsigned int type. */ + /* */ + typedef unsigned int FT_UInt; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Long */ + /* */ + /* <Description> */ + /* A typedef for signed long. */ + /* */ + typedef signed long FT_Long; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_ULong */ + /* */ + /* <Description> */ + /* A typedef for unsigned long. */ + /* */ + typedef unsigned long FT_ULong; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_F2Dot14 */ + /* */ + /* <Description> */ + /* A signed 2.14 fixed float type used for unit vectors. */ + /* */ + typedef signed short FT_F2Dot14; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_F26Dot6 */ + /* */ + /* <Description> */ + /* A signed 26.6 fixed float type used for vectorial pixel */ + /* coordinates. */ + /* */ + typedef signed long FT_F26Dot6; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Fixed */ + /* */ + /* <Description> */ + /* This type is used to store 16.16 fixed float values, like scaling */ + /* values or matrix coefficients. */ + /* */ + typedef signed long FT_Fixed; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Error */ + /* */ + /* <Description> */ + /* The FreeType error code type. A value of 0 is always interpreted */ + /* as a successful operation. */ + /* */ + typedef int FT_Error; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Pointer */ + /* */ + /* <Description> */ + /* A simple typedef for a typeless pointer. */ + /* */ + typedef void* FT_Pointer; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_Offset */ + /* */ + /* <Description> */ + /* This is equivalent to the ANSI C `size_t' type, i.e., the largest */ + /* _unsigned_ integer type used to express a file size or position, */ + /* or a memory block size. */ + /* */ + typedef size_t FT_Offset; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_PtrDist */ + /* */ + /* <Description> */ + /* This is equivalent to the ANSI C `ptrdiff_t' type, i.e., the */ + /* largest _signed_ integer type used to express the distance */ + /* between two pointers. */ + /* */ + typedef ft_ptrdiff_t FT_PtrDist; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_UnitVector */ + /* */ + /* <Description> */ + /* A simple structure used to store a 2D vector unit vector. Uses */ + /* FT_F2Dot14 types. */ + /* */ + /* <Fields> */ + /* x :: Horizontal coordinate. */ + /* */ + /* y :: Vertical coordinate. */ + /* */ + typedef struct FT_UnitVector_ + { + FT_F2Dot14 x; + FT_F2Dot14 y; + + } FT_UnitVector; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_Matrix */ + /* */ + /* <Description> */ + /* A simple structure used to store a 2x2 matrix. Coefficients are */ + /* in 16.16 fixed float format. The computation performed is: */ + /* */ + /* { */ + /* x' = x*xx + y*xy */ + /* y' = x*yx + y*yy */ + /* } */ + /* */ + /* <Fields> */ + /* xx :: Matrix coefficient. */ + /* */ + /* xy :: Matrix coefficient. */ + /* */ + /* yx :: Matrix coefficient. */ + /* */ + /* yy :: Matrix coefficient. */ + /* */ + typedef struct FT_Matrix_ + { + FT_Fixed xx, xy; + FT_Fixed yx, yy; + + } FT_Matrix; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_Data */ + /* */ + /* <Description> */ + /* Read-only binary data represented as a pointer and a length. */ + /* */ + /* <Fields> */ + /* pointer :: The data. */ + /* */ + /* length :: The length of the data in bytes. */ + /* */ + typedef struct FT_Data_ + { + const FT_Byte* pointer; + FT_Int length; + + } FT_Data; + + + /*************************************************************************/ + /* */ + /* <FuncType> */ + /* FT_Generic_Finalizer */ + /* */ + /* <Description> */ + /* Describes a function used to destroy the `client' data of any */ + /* FreeType object. See the description of the @FT_Generic type for */ + /* details of usage. */ + /* */ + /* <Input> */ + /* The address of the FreeType object which is under finalization. */ + /* Its client data is accessed through its `generic' field. */ + /* */ + typedef void (*FT_Generic_Finalizer)(void* object); + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_Generic */ + /* */ + /* <Description> */ + /* Client applications often need to associate their own data to a */ + /* variety of FreeType core objects. For example, a text layout API */ + /* might want to associate a glyph cache to a given size object. */ + /* */ + /* Most FreeType object contains a `generic' field, of type */ + /* FT_Generic, which usage is left to client applications and font */ + /* servers. */ + /* */ + /* It can be used to store a pointer to client-specific data, as well */ + /* as the address of a `finalizer' function, which will be called by */ + /* FreeType when the object is destroyed (for example, the previous */ + /* client example would put the address of the glyph cache destructor */ + /* in the `finalizer' field). */ + /* */ + /* <Fields> */ + /* data :: A typeless pointer to any client-specified data. This */ + /* field is completely ignored by the FreeType library. */ + /* */ + /* finalizer :: A pointer to a `generic finalizer' function, which */ + /* will be called when the object is destroyed. If this */ + /* field is set to NULL, no code will be called. */ + /* */ + typedef struct FT_Generic_ + { + void* data; + FT_Generic_Finalizer finalizer; + + } FT_Generic; + + + /*************************************************************************/ + /* */ + /* <Macro> */ + /* FT_MAKE_TAG */ + /* */ + /* <Description> */ + /* This macro converts four-letter tags which are used to label */ + /* TrueType tables into an unsigned long to be used within FreeType. */ + /* */ + /* <Note> */ + /* The produced values *must* be 32bit integers. Don't redefine this */ + /* macro. */ + /* */ +#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \ + ( ( (FT_ULong)_x1 << 24 ) | \ + ( (FT_ULong)_x2 << 16 ) | \ + ( (FT_ULong)_x3 << 8 ) | \ + (FT_ULong)_x4 ) + + + /*************************************************************************/ + /*************************************************************************/ + /* */ + /* L I S T M A N A G E M E N T */ + /* */ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* list_processing */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_ListNode */ + /* */ + /* <Description> */ + /* Many elements and objects in FreeType are listed through an */ + /* @FT_List record (see @FT_ListRec). As its name suggests, an */ + /* FT_ListNode is a handle to a single list element. */ + /* */ + typedef struct FT_ListNodeRec_* FT_ListNode; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_List */ + /* */ + /* <Description> */ + /* A handle to a list record (see @FT_ListRec). */ + /* */ + typedef struct FT_ListRec_* FT_List; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_ListNodeRec */ + /* */ + /* <Description> */ + /* A structure used to hold a single list element. */ + /* */ + /* <Fields> */ + /* prev :: The previous element in the list. NULL if first. */ + /* */ + /* next :: The next element in the list. NULL if last. */ + /* */ + /* data :: A typeless pointer to the listed object. */ + /* */ + typedef struct FT_ListNodeRec_ + { + FT_ListNode prev; + FT_ListNode next; + void* data; + + } FT_ListNodeRec; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_ListRec */ + /* */ + /* <Description> */ + /* A structure used to hold a simple doubly-linked list. These are */ + /* used in many parts of FreeType. */ + /* */ + /* <Fields> */ + /* head :: The head (first element) of doubly-linked list. */ + /* */ + /* tail :: The tail (last element) of doubly-linked list. */ + /* */ + typedef struct FT_ListRec_ + { + FT_ListNode head; + FT_ListNode tail; + + } FT_ListRec; + + + /* */ + +#define FT_IS_EMPTY( list ) ( (list).head == 0 ) + + /* return base error code (without module-specific prefix) */ +#define FT_ERROR_BASE( x ) ( (x) & 0xFF ) + + /* return module error code */ +#define FT_ERROR_MODULE( x ) ( (x) & 0xFF00U ) + +#define FT_BOOL( x ) ( (FT_Bool)( x ) ) + +FT_END_HEADER + +#endif /* __FTTYPES_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftwinfnt.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftwinfnt.h new file mode 100644 index 0000000000..a0063cc735 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftwinfnt.h @@ -0,0 +1,263 @@ +/***************************************************************************/ +/* */ +/* ftwinfnt.h */ +/* */ +/* FreeType API for accessing Windows fnt-specific data. */ +/* */ +/* Copyright 2003, 2004 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTWINFNT_H__ +#define __FTWINFNT_H__ + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* winfnt_fonts */ + /* */ + /* <Title> */ + /* Window FNT Files */ + /* */ + /* <Abstract> */ + /* Windows FNT specific API. */ + /* */ + /* <Description> */ + /* This section contains the declaration of Windows FNT specific */ + /* functions. */ + /* */ + /*************************************************************************/ + + + /************************************************************************* + * + * @enum: + * FT_WinFNT_ID_XXX + * + * @description: + * A list of valid values for the `charset' byte in + * @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX + * encodings (except for cp1361) can be found at ftp://ftp.unicode.org + * in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory. cp1361 is + * roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT. + * + * @values: + * FT_WinFNT_ID_DEFAULT :: + * This is used for font enumeration and font creation as a + * `don't care' value. Valid font files don't contain this value. + * When querying for information about the character set of the font + * that is currently selected into a specified device context, this + * return value (of the related Windows API) simply denotes failure. + * + * FT_WinFNT_ID_SYMBOL :: + * There is no known mapping table available. + * + * FT_WinFNT_ID_MAC :: + * Mac Roman encoding. + * + * FT_WinFNT_ID_OEM :: + * From Michael Pöttgen <michael@poettgen.de>: + * + * The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM + * is used for the charset of vector fonts, like `modern.fon', + * `roman.fon', and `script.fon' on Windows. + * + * The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value + * specifies a character set that is operating-system dependent. + * + * The `IFIMETRICS' documentation from the `Windows Driver + * Development Kit' says: This font supports an OEM-specific + * character set. The OEM character set is system dependent. + * + * In general OEM, as opposed to ANSI (i.e., cp1252), denotes the + * second default codepage that most international versions of + * Windows have. It is one of the OEM codepages from + * + * http://www.microsoft.com/globaldev/reference/cphome.mspx, + * + * and is used for the `DOS boxes', to support legacy applications. + * A German Windows version for example usually uses ANSI codepage + * 1252 and OEM codepage 850. + * + * FT_WinFNT_ID_CP874 :: + * A superset of Thai TIS 620 and ISO 8859-11. + * + * FT_WinFNT_ID_CP932 :: + * A superset of Japanese Shift-JIS (with minor deviations). + * + * FT_WinFNT_ID_CP936 :: + * A superset of simplified Chinese GB 2312-1980 (with different + * ordering and minor deviations). + * + * FT_WinFNT_ID_CP949 :: + * A superset of Korean Hangul KS C 5601-1987 (with different + * ordering and minor deviations). + * + * FT_WinFNT_ID_CP950 :: + * A superset of traditional Chinese Big 5 ETen (with different + * ordering and minor deviations). + * + * FT_WinFNT_ID_CP1250 :: + * A superset of East European ISO 8859-2 (with slightly different + * ordering). + * + * FT_WinFNT_ID_CP1251 :: + * A superset of Russian ISO 8859-5 (with different ordering). + * + * FT_WinFNT_ID_CP1252 :: + * ANSI encoding. A superset of ISO 8859-1. + * + * FT_WinFNT_ID_CP1253 :: + * A superset of Greek ISO 8859-7 (with minor modifications). + * + * FT_WinFNT_ID_CP1254 :: + * A superset of Turkish ISO 8859-9. + * + * FT_WinFNT_ID_CP1255 :: + * A superset of Hebrew ISO 8859-8 (with some modifications). + * + * FT_WinFNT_ID_CP1256 :: + * A superset of Arabic ISO 8859-6 (with different ordering). + * + * FT_WinFNT_ID_CP1257 :: + * A superset of Baltic ISO 8859-13 (with some deviations). + * + * FT_WinFNT_ID_CP1258 :: + * For Vietnamese. This encoding doesn't cover all necessary + * characters. + * + * FT_WinFNT_ID_CP1361 :: + * Korean (Johab). + */ + +#define FT_WinFNT_ID_CP1252 0 +#define FT_WinFNT_ID_DEFAULT 1 +#define FT_WinFNT_ID_SYMBOL 2 +#define FT_WinFNT_ID_MAC 77 +#define FT_WinFNT_ID_CP932 128 +#define FT_WinFNT_ID_CP949 129 +#define FT_WinFNT_ID_CP1361 130 +#define FT_WinFNT_ID_CP936 134 +#define FT_WinFNT_ID_CP950 136 +#define FT_WinFNT_ID_CP1253 161 +#define FT_WinFNT_ID_CP1254 162 +#define FT_WinFNT_ID_CP1258 163 +#define FT_WinFNT_ID_CP1255 177 +#define FT_WinFNT_ID_CP1256 178 +#define FT_WinFNT_ID_CP1257 186 +#define FT_WinFNT_ID_CP1251 204 +#define FT_WinFNT_ID_CP874 222 +#define FT_WinFNT_ID_CP1250 238 +#define FT_WinFNT_ID_OEM 255 + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_WinFNT_HeaderRec */ + /* */ + /* <Description> */ + /* Windows FNT Header info. */ + /* */ + typedef struct FT_WinFNT_HeaderRec_ + { + FT_UShort version; + FT_ULong file_size; + FT_Byte copyright[60]; + FT_UShort file_type; + FT_UShort nominal_point_size; + FT_UShort vertical_resolution; + FT_UShort horizontal_resolution; + FT_UShort ascent; + FT_UShort internal_leading; + FT_UShort external_leading; + FT_Byte italic; + FT_Byte underline; + FT_Byte strike_out; + FT_UShort weight; + FT_Byte charset; + FT_UShort pixel_width; + FT_UShort pixel_height; + FT_Byte pitch_and_family; + FT_UShort avg_width; + FT_UShort max_width; + FT_Byte first_char; + FT_Byte last_char; + FT_Byte default_char; + FT_Byte break_char; + FT_UShort bytes_per_row; + FT_ULong device_offset; + FT_ULong face_name_offset; + FT_ULong bits_pointer; + FT_ULong bits_offset; + FT_Byte reserved; + FT_ULong flags; + FT_UShort A_space; + FT_UShort B_space; + FT_UShort C_space; + FT_UShort color_table_offset; + FT_ULong reserved1[4]; + + } FT_WinFNT_HeaderRec, *FT_WinFNT_Header; + + + /********************************************************************** + * + * @function: + * FT_Get_WinFNT_Header + * + * @description: + * Retrieve a Windows FNT font info header. + * + * @input: + * face :: A handle to the input face. + * + * @output: + * aheader :: The WinFNT header. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * This function only works with Windows FNT faces, returning an error + * otherwise. + */ + FT_EXPORT( FT_Error ) + FT_Get_WinFNT_Header( FT_Face face, + FT_WinFNT_HeaderRec *aheader ); + + + /* */ + +FT_END_HEADER + +#endif /* __FTWINFNT_H__ */ + + +/* END */ + + +/* Local Variables: */ +/* coding: utf-8 */ +/* End: */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftxf86.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftxf86.h new file mode 100644 index 0000000000..ea82abb084 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ftxf86.h @@ -0,0 +1,80 @@ +/***************************************************************************/ +/* */ +/* ftxf86.h */ +/* */ +/* Support functions for X11. */ +/* */ +/* Copyright 2002, 2003, 2004, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTXF86_H__ +#define __FTXF86_H__ + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* font_formats */ + /* */ + /* <Title> */ + /* Font Formats */ + /* */ + /* <Abstract> */ + /* Getting the font format. */ + /* */ + /* <Description> */ + /* The single function in this section can be used to get the font */ + /* format. Note that this information is not needed normally; */ + /* however, there are special cases (like in PDF devices) where it is */ + /* important to differentiate, in spite of FreeType's uniform API. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Get_X11_Font_Format */ + /* */ + /* <Description> */ + /* Return a string describing the format of a given face, using values */ + /* which can be used as an X11 FONT_PROPERTY. Possible values are */ + /* `TrueType', `Type 1', `BDF', `PCF', `Type 42', `CID Type 1', `CFF', */ + /* `PFR', and `Windows FNT'. */ + /* */ + /* <Input> */ + /* face :: */ + /* Input face handle. */ + /* */ + /* <Return> */ + /* Font format string. NULL in case of error. */ + /* */ + FT_EXPORT( const char* ) + FT_Get_X11_Font_Format( FT_Face face ); + + /* */ + +FT_END_HEADER + +#endif /* __FTXF86_H__ */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/t1tables.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/t1tables.h new file mode 100644 index 0000000000..250629d252 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/t1tables.h @@ -0,0 +1,450 @@ +/***************************************************************************/ +/* */ +/* t1tables.h */ +/* */ +/* Basic Type 1/Type 2 tables definitions and interface (specification */ +/* only). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __T1TABLES_H__ +#define __T1TABLES_H__ + + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* type1_tables */ + /* */ + /* <Title> */ + /* Type 1 Tables */ + /* */ + /* <Abstract> */ + /* Type 1 (PostScript) specific font tables. */ + /* */ + /* <Description> */ + /* This section contains the definition of Type 1-specific tables, */ + /* including structures related to other PostScript font formats. */ + /* */ + /*************************************************************************/ + + + /* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */ + /* structures in order to support Multiple Master fonts. */ + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* PS_FontInfoRec */ + /* */ + /* <Description> */ + /* A structure used to model a Type1/Type2 FontInfo dictionary. Note */ + /* that for Multiple Master fonts, each instance has its own */ + /* FontInfo dictionary. */ + /* */ + typedef struct PS_FontInfoRec + { + FT_String* version; + FT_String* notice; + FT_String* full_name; + FT_String* family_name; + FT_String* weight; + FT_Long italic_angle; + FT_Bool is_fixed_pitch; + FT_Short underline_position; + FT_UShort underline_thickness; + + } PS_FontInfoRec, *PS_FontInfo; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* T1_FontInfo */ + /* */ + /* <Description> */ + /* This type is equivalent to @PS_FontInfoRec. It is deprecated but */ + /* kept to maintain source compatibility between various versions of */ + /* FreeType. */ + /* */ + typedef PS_FontInfoRec T1_FontInfo; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* PS_PrivateRec */ + /* */ + /* <Description> */ + /* A structure used to model a Type1/Type2 private dictionary. Note */ + /* that for Multiple Master fonts, each instance has its own Private */ + /* dictionary. */ + /* */ + typedef struct PS_PrivateRec_ + { + FT_Int unique_id; + FT_Int lenIV; + + FT_Byte num_blue_values; + FT_Byte num_other_blues; + FT_Byte num_family_blues; + FT_Byte num_family_other_blues; + + FT_Short blue_values[14]; + FT_Short other_blues[10]; + + FT_Short family_blues [14]; + FT_Short family_other_blues[10]; + + FT_Fixed blue_scale; + FT_Int blue_shift; + FT_Int blue_fuzz; + + FT_UShort standard_width[1]; + FT_UShort standard_height[1]; + + FT_Byte num_snap_widths; + FT_Byte num_snap_heights; + FT_Bool force_bold; + FT_Bool round_stem_up; + + FT_Short snap_widths [13]; /* including std width */ + FT_Short snap_heights[13]; /* including std height */ + + FT_Fixed expansion_factor; + + FT_Long language_group; + FT_Long password; + + FT_Short min_feature[2]; + + } PS_PrivateRec, *PS_Private; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* T1_Private */ + /* */ + /* <Description> */ + /* This type is equivalent to @PS_PrivateRec. It is deprecated but */ + /* kept to maintain source compatibility between various versions of */ + /* FreeType. */ + /* */ + typedef PS_PrivateRec T1_Private; + + + /*************************************************************************/ + /* */ + /* <Enum> */ + /* T1_Blend_Flags */ + /* */ + /* <Description> */ + /* A set of flags used to indicate which fields are present in a */ + /* given blend dictionary (font info or private). Used to support */ + /* Multiple Masters fonts. */ + /* */ + typedef enum + { + /*# required fields in a FontInfo blend dictionary */ + T1_BLEND_UNDERLINE_POSITION = 0, + T1_BLEND_UNDERLINE_THICKNESS, + T1_BLEND_ITALIC_ANGLE, + + /*# required fields in a Private blend dictionary */ + T1_BLEND_BLUE_VALUES, + T1_BLEND_OTHER_BLUES, + T1_BLEND_STANDARD_WIDTH, + T1_BLEND_STANDARD_HEIGHT, + T1_BLEND_STEM_SNAP_WIDTHS, + T1_BLEND_STEM_SNAP_HEIGHTS, + T1_BLEND_BLUE_SCALE, + T1_BLEND_BLUE_SHIFT, + T1_BLEND_FAMILY_BLUES, + T1_BLEND_FAMILY_OTHER_BLUES, + T1_BLEND_FORCE_BOLD, + + /*# never remove */ + T1_BLEND_MAX + + } T1_Blend_Flags; + + /* */ + + + /*# backwards compatible definitions */ +#define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION +#define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS +#define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE +#define t1_blend_blue_values T1_BLEND_BLUE_VALUES +#define t1_blend_other_blues T1_BLEND_OTHER_BLUES +#define t1_blend_standard_widths T1_BLEND_STANDARD_WIDTH +#define t1_blend_standard_height T1_BLEND_STANDARD_HEIGHT +#define t1_blend_stem_snap_widths T1_BLEND_STEM_SNAP_WIDTHS +#define t1_blend_stem_snap_heights T1_BLEND_STEM_SNAP_HEIGHTS +#define t1_blend_blue_scale T1_BLEND_BLUE_SCALE +#define t1_blend_blue_shift T1_BLEND_BLUE_SHIFT +#define t1_blend_family_blues T1_BLEND_FAMILY_BLUES +#define t1_blend_family_other_blues T1_BLEND_FAMILY_OTHER_BLUES +#define t1_blend_force_bold T1_BLEND_FORCE_BOLD +#define t1_blend_max T1_BLEND_MAX + + + /* maximum number of Multiple Masters designs, as defined in the spec */ +#define T1_MAX_MM_DESIGNS 16 + + /* maximum number of Multiple Masters axes, as defined in the spec */ +#define T1_MAX_MM_AXIS 4 + + /* maximum number of elements in a design map */ +#define T1_MAX_MM_MAP_POINTS 20 + + + /* this structure is used to store the BlendDesignMap entry for an axis */ + typedef struct PS_DesignMap_ + { + FT_Byte num_points; + FT_Long* design_points; + FT_Fixed* blend_points; + + } PS_DesignMapRec, *PS_DesignMap; + + /* backwards-compatible definition */ + typedef PS_DesignMapRec T1_DesignMap; + + + typedef struct PS_BlendRec_ + { + FT_UInt num_designs; + FT_UInt num_axis; + + FT_String* axis_names[T1_MAX_MM_AXIS]; + FT_Fixed* design_pos[T1_MAX_MM_DESIGNS]; + PS_DesignMapRec design_map[T1_MAX_MM_AXIS]; + + FT_Fixed* weight_vector; + FT_Fixed* default_weight_vector; + + PS_FontInfo font_infos[T1_MAX_MM_DESIGNS + 1]; + PS_Private privates [T1_MAX_MM_DESIGNS + 1]; + + FT_ULong blend_bitflags; + + FT_BBox* bboxes [T1_MAX_MM_DESIGNS + 1]; + + /* since 2.3.0 */ + + /* undocumented, optional: the default design instance; */ + /* corresponds to default_weight_vector -- */ + /* num_default_design_vector == 0 means it is not present */ + /* in the font and associated metrics files */ + FT_UInt default_design_vector[T1_MAX_MM_DESIGNS]; + FT_UInt num_default_design_vector; + + } PS_BlendRec, *PS_Blend; + + + /* backwards-compatible definition */ + typedef PS_BlendRec T1_Blend; + + + typedef struct CID_FaceDictRec_ + { + PS_PrivateRec private_dict; + + FT_UInt len_buildchar; + FT_Fixed forcebold_threshold; + FT_Pos stroke_width; + FT_Fixed expansion_factor; + + FT_Byte paint_type; + FT_Byte font_type; + FT_Matrix font_matrix; + FT_Vector font_offset; + + FT_UInt num_subrs; + FT_ULong subrmap_offset; + FT_Int sd_bytes; + + } CID_FaceDictRec, *CID_FaceDict; + + + /* backwards-compatible definition */ + typedef CID_FaceDictRec CID_FontDict; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* CID_FaceInfoRec */ + /* */ + /* <Description> */ + /* A structure used to represent CID Face information. */ + /* */ + typedef struct CID_FaceInfoRec_ + { + FT_String* cid_font_name; + FT_Fixed cid_version; + FT_Int cid_font_type; + + FT_String* registry; + FT_String* ordering; + FT_Int supplement; + + PS_FontInfoRec font_info; + FT_BBox font_bbox; + FT_ULong uid_base; + + FT_Int num_xuid; + FT_ULong xuid[16]; + + FT_ULong cidmap_offset; + FT_Int fd_bytes; + FT_Int gd_bytes; + FT_ULong cid_count; + + FT_Int num_dicts; + CID_FaceDict font_dicts; + + FT_ULong data_offset; + + } CID_FaceInfoRec, *CID_FaceInfo; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* CID_Info */ + /* */ + /* <Description> */ + /* This type is equivalent to @CID_FaceInfoRec. It is deprecated but */ + /* kept to maintain source compatibility between various versions of */ + /* FreeType. */ + /* */ + typedef CID_FaceInfoRec CID_Info; + + /* */ + + + /************************************************************************ + * + * @function: + * FT_Has_PS_Glyph_Names + * + * @description: + * Return true if a given face provides reliable Postscript glyph + * names. This is similar to using the @FT_HAS_GLYPH_NAMES macro, + * except that certain fonts (mostly TrueType) contain incorrect + * glyph name tables. + * + * When this function returns true, the caller is sure that the glyph + * names returned by @FT_Get_Glyph_Name are reliable. + * + * @input: + * face :: + * face handle + * + * @return: + * Boolean. True if glyph names are reliable. + */ + FT_EXPORT( FT_Int ) + FT_Has_PS_Glyph_Names( FT_Face face ); + + + /************************************************************************ + * + * @function: + * FT_Get_PS_Font_Info + * + * @description: + * Retrieve the @PS_FontInfoRec structure corresponding to a given + * Postscript font. + * + * @input: + * face :: + * Postscript face handle. + * + * @output: + * afont_info :: + * Output font info structure pointer. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * The string pointers within the font info structure are owned by + * the face and don't need to be freed by the caller. + * + * If the font's format is not Postscript-based, this function will + * return the `FT_Err_Invalid_Argument' error code. + */ + FT_EXPORT( FT_Error ) + FT_Get_PS_Font_Info( FT_Face face, + PS_FontInfoRec *afont_info ); + + + /************************************************************************ + * + * @function: + * FT_Get_PS_Font_Private + * + * @description: + * Retrieve the @PS_PrivateRec structure corresponding to a given + * Postscript font. + * + * @input: + * face :: + * Postscript face handle. + * + * @output: + * afont_private :: + * Output private dictionary structure pointer. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * The string pointers within the font info structure are owned by + * the face and don't need to be freed by the caller. + * + * If the font's format is not Postscript-based, this function will + * return the `FT_Err_Invalid_Argument' error code. + */ + FT_EXPORT( FT_Error ) + FT_Get_PS_Font_Private( FT_Face face, + PS_PrivateRec *afont_private ); + + /* */ + + + +FT_END_HEADER + +#endif /* __T1TABLES_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ttnameid.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ttnameid.h new file mode 100644 index 0000000000..b9acbdad11 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ttnameid.h @@ -0,0 +1,1132 @@ +/***************************************************************************/ +/* */ +/* ttnameid.h */ +/* */ +/* TrueType name ID definitions (specification only). */ +/* */ +/* Copyright 1996-2002, 2003, 2004, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __TTNAMEID_H__ +#define __TTNAMEID_H__ + + +#include <ft2build.h> + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* Possible values for the `platform' identifier code in the name */ + /* records of the TTF `name' table. */ + /* */ + /*************************************************************************/ + + + /*********************************************************************** + * + * @enum: + * TT_PLATFORM_XXX + * + * @description: + * A list of valid values for the `platform_id' identifier code in + * @FT_CharMapRec and @FT_SfntName structures. + * + * @values: + * TT_PLATFORM_APPLE_UNICODE :: + * Used by Apple to indicate a Unicode character map and/or name entry. + * See @TT_APPLE_ID_XXX for corresponding `encoding_id' values. Note + * that name entries in this format are coded as big-endian UCS-2 + * character codes _only_. + * + * TT_PLATFORM_MACINTOSH :: + * Used by Apple to indicate a MacOS-specific charmap and/or name entry. + * See @TT_MAC_ID_XXX for corresponding `encoding_id' values. Note that + * most TrueType fonts contain an Apple roman charmap to be usable on + * MacOS systems (even if they contain a Microsoft charmap as well). + * + * TT_PLATFORM_ISO :: + * This value was used to specify Unicode charmaps. It is however + * now deprecated. See @TT_ISO_ID_XXX for a list of corresponding + * `encoding_id' values. + * + * TT_PLATFORM_MICROSOFT :: + * Used by Microsoft to indicate Windows-specific charmaps. See + * @TT_MS_ID_XXX for a list of corresponding `encoding_id' values. + * Note that most fonts contain a Unicode charmap using + * (TT_PLATFORM_MICROSOFT, @TT_MS_ID_UNICODE_CS). + * + * TT_PLATFORM_CUSTOM :: + * Used to indicate application-specific charmaps. + * + * TT_PLATFORM_ADOBE :: + * This value isn't part of any font format specification, but is used + * by FreeType to report Adobe-specific charmaps in an @FT_CharMapRec + * structure. See @TT_ADOBE_ID_XXX. + */ + +#define TT_PLATFORM_APPLE_UNICODE 0 +#define TT_PLATFORM_MACINTOSH 1 +#define TT_PLATFORM_ISO 2 /* deprecated */ +#define TT_PLATFORM_MICROSOFT 3 +#define TT_PLATFORM_CUSTOM 4 +#define TT_PLATFORM_ADOBE 7 /* artificial */ + + + /*********************************************************************** + * + * @enum: + * TT_APPLE_ID_XXX + * + * @description: + * A list of valid values for the `encoding_id' for + * @TT_PLATFORM_APPLE_UNICODE charmaps and name entries. + * + * @values: + * TT_APPLE_ID_DEFAULT :: + * Unicode version 1.0. + * + * TT_APPLE_ID_UNICODE_1_1 :: + * Unicode 1.1; specifies Hangul characters starting at U+34xx. + * + * TT_APPLE_ID_ISO_10646 :: + * Deprecated (identical to preceding). + * + * TT_APPLE_ID_UNICODE_2_0 :: + * Unicode 2.0 and beyond (UTF-16 BMP only). + * + * TT_APPLE_ID_UNICODE_32 :: + * Unicode 3.1 and beyond, using UTF-32. + */ + +#define TT_APPLE_ID_DEFAULT 0 /* Unicode 1.0 */ +#define TT_APPLE_ID_UNICODE_1_1 1 /* specify Hangul at U+34xx */ +#define TT_APPLE_ID_ISO_10646 2 /* deprecated */ +#define TT_APPLE_ID_UNICODE_2_0 3 /* or later */ +#define TT_APPLE_ID_UNICODE_32 4 /* 2.0 or later, full repertoire */ + + + /*********************************************************************** + * + * @enum: + * TT_MAC_ID_XXX + * + * @description: + * A list of valid values for the `encoding_id' for + * @TT_PLATFORM_MACINTOSH charmaps and name entries. + * + * @values: + * TT_MAC_ID_ROMAN :: + * TT_MAC_ID_JAPANESE :: + * TT_MAC_ID_TRADITIONAL_CHINESE :: + * TT_MAC_ID_KOREAN :: + * TT_MAC_ID_ARABIC :: + * TT_MAC_ID_HEBREW :: + * TT_MAC_ID_GREEK :: + * TT_MAC_ID_RUSSIAN :: + * TT_MAC_ID_RSYMBOL :: + * TT_MAC_ID_DEVANAGARI :: + * TT_MAC_ID_GURMUKHI :: + * TT_MAC_ID_GUJARATI :: + * TT_MAC_ID_ORIYA :: + * TT_MAC_ID_BENGALI :: + * TT_MAC_ID_TAMIL :: + * TT_MAC_ID_TELUGU :: + * TT_MAC_ID_KANNADA :: + * TT_MAC_ID_MALAYALAM :: + * TT_MAC_ID_SINHALESE :: + * TT_MAC_ID_BURMESE :: + * TT_MAC_ID_KHMER :: + * TT_MAC_ID_THAI :: + * TT_MAC_ID_LAOTIAN :: + * TT_MAC_ID_GEORGIAN :: + * TT_MAC_ID_ARMENIAN :: + * TT_MAC_ID_MALDIVIAN :: + * TT_MAC_ID_SIMPLIFIED_CHINESE :: + * TT_MAC_ID_TIBETAN :: + * TT_MAC_ID_MONGOLIAN :: + * TT_MAC_ID_GEEZ :: + * TT_MAC_ID_SLAVIC :: + * TT_MAC_ID_VIETNAMESE :: + * TT_MAC_ID_SINDHI :: + * TT_MAC_ID_UNINTERP :: + */ + +#define TT_MAC_ID_ROMAN 0 +#define TT_MAC_ID_JAPANESE 1 +#define TT_MAC_ID_TRADITIONAL_CHINESE 2 +#define TT_MAC_ID_KOREAN 3 +#define TT_MAC_ID_ARABIC 4 +#define TT_MAC_ID_HEBREW 5 +#define TT_MAC_ID_GREEK 6 +#define TT_MAC_ID_RUSSIAN 7 +#define TT_MAC_ID_RSYMBOL 8 +#define TT_MAC_ID_DEVANAGARI 9 +#define TT_MAC_ID_GURMUKHI 10 +#define TT_MAC_ID_GUJARATI 11 +#define TT_MAC_ID_ORIYA 12 +#define TT_MAC_ID_BENGALI 13 +#define TT_MAC_ID_TAMIL 14 +#define TT_MAC_ID_TELUGU 15 +#define TT_MAC_ID_KANNADA 16 +#define TT_MAC_ID_MALAYALAM 17 +#define TT_MAC_ID_SINHALESE 18 +#define TT_MAC_ID_BURMESE 19 +#define TT_MAC_ID_KHMER 20 +#define TT_MAC_ID_THAI 21 +#define TT_MAC_ID_LAOTIAN 22 +#define TT_MAC_ID_GEORGIAN 23 +#define TT_MAC_ID_ARMENIAN 24 +#define TT_MAC_ID_MALDIVIAN 25 +#define TT_MAC_ID_SIMPLIFIED_CHINESE 25 +#define TT_MAC_ID_TIBETAN 26 +#define TT_MAC_ID_MONGOLIAN 27 +#define TT_MAC_ID_GEEZ 28 +#define TT_MAC_ID_SLAVIC 29 +#define TT_MAC_ID_VIETNAMESE 30 +#define TT_MAC_ID_SINDHI 31 +#define TT_MAC_ID_UNINTERP 32 + + + /*********************************************************************** + * + * @enum: + * TT_ISO_ID_XXX + * + * @description: + * A list of valid values for the `encoding_id' for + * @TT_PLATFORM_ISO charmaps and name entries. + * + * Their use is now deprecated. + * + * @values: + * TT_ISO_ID_7BIT_ASCII :: + * ASCII. + * TT_ISO_ID_10646 :: + * ISO/10646. + * TT_ISO_ID_8859_1 :: + * Also known as Latin-1. + */ + +#define TT_ISO_ID_7BIT_ASCII 0 +#define TT_ISO_ID_10646 1 +#define TT_ISO_ID_8859_1 2 + + + /*********************************************************************** + * + * @enum: + * TT_MS_ID_XXX + * + * @description: + * A list of valid values for the `encoding_id' for + * @TT_PLATFORM_MICROSOFT charmaps and name entries. + * + * @values: + * TT_MS_ID_SYMBOL_CS :: + * Corresponds to Microsoft symbol encoding. See + * @FT_ENCODING_MS_SYMBOL. + * + * TT_MS_ID_UNICODE_CS :: + * Corresponds to a Microsoft WGL4 charmap, matching Unicode. See + * @FT_ENCODING_UNICODE. + * + * TT_MS_ID_SJIS :: + * Corresponds to SJIS Japanese encoding. See @FT_ENCODING_SJIS. + * + * TT_MS_ID_GB2312 :: + * Corresponds to Simplified Chinese as used in Mainland China. See + * @FT_ENCODING_GB2312. + * + * TT_MS_ID_BIG_5 :: + * Corresponds to Traditional Chinese as used in Taiwan and Hong Kong. + * See @FT_ENCODING_BIG5. + * + * TT_MS_ID_WANSUNG :: + * Corresponds to Korean Wansung encoding. See @FT_ENCODING_WANSUNG. + * + * TT_MS_ID_JOHAB :: + * Corresponds to Johab encoding. See @FT_ENCODING_JOHAB. + * + * TT_MS_ID_UCS_4 :: + * Corresponds to UCS-4 or UTF-32 charmaps. This has been added to + * the OpenType specification version 1.4 (mid-2001.) + */ + +#define TT_MS_ID_SYMBOL_CS 0 +#define TT_MS_ID_UNICODE_CS 1 +#define TT_MS_ID_SJIS 2 +#define TT_MS_ID_GB2312 3 +#define TT_MS_ID_BIG_5 4 +#define TT_MS_ID_WANSUNG 5 +#define TT_MS_ID_JOHAB 6 +#define TT_MS_ID_UCS_4 10 + + + /*********************************************************************** + * + * @enum: + * TT_ADOBE_ID_XXX + * + * @description: + * A list of valid values for the `encoding_id' for + * @TT_PLATFORM_ADOBE charmaps. This is a FreeType-specific extension! + * + * @values: + * TT_ADOBE_ID_STANDARD :: + * Adobe standard encoding. + * TT_ADOBE_ID_EXPERT :: + * Adobe expert encoding. + * TT_ADOBE_ID_CUSTOM :: + * Adobe custom encoding. + */ + +#define TT_ADOBE_ID_STANDARD 0 +#define TT_ADOBE_ID_EXPERT 1 +#define TT_ADOBE_ID_CUSTOM 2 +#define TT_ADOBE_ID_LATIN_1 3 + + + /*************************************************************************/ + /* */ + /* Possible values of the language identifier field in the name records */ + /* of the TTF `name' table if the `platform' identifier code is */ + /* TT_PLATFORM_MACINTOSH. */ + /* */ + /* The canonical source for the Apple assigned Language ID's is at */ + /* */ + /* http://fonts.apple.com/TTRefMan/RM06/Chap6name.html */ + /* */ +#define TT_MAC_LANGID_ENGLISH 0 +#define TT_MAC_LANGID_FRENCH 1 +#define TT_MAC_LANGID_GERMAN 2 +#define TT_MAC_LANGID_ITALIAN 3 +#define TT_MAC_LANGID_DUTCH 4 +#define TT_MAC_LANGID_SWEDISH 5 +#define TT_MAC_LANGID_SPANISH 6 +#define TT_MAC_LANGID_DANISH 7 +#define TT_MAC_LANGID_PORTUGUESE 8 +#define TT_MAC_LANGID_NORWEGIAN 9 +#define TT_MAC_LANGID_HEBREW 10 +#define TT_MAC_LANGID_JAPANESE 11 +#define TT_MAC_LANGID_ARABIC 12 +#define TT_MAC_LANGID_FINNISH 13 +#define TT_MAC_LANGID_GREEK 14 +#define TT_MAC_LANGID_ICELANDIC 15 +#define TT_MAC_LANGID_MALTESE 16 +#define TT_MAC_LANGID_TURKISH 17 +#define TT_MAC_LANGID_CROATIAN 18 +#define TT_MAC_LANGID_CHINESE_TRADITIONAL 19 +#define TT_MAC_LANGID_URDU 20 +#define TT_MAC_LANGID_HINDI 21 +#define TT_MAC_LANGID_THAI 22 +#define TT_MAC_LANGID_KOREAN 23 +#define TT_MAC_LANGID_LITHUANIAN 24 +#define TT_MAC_LANGID_POLISH 25 +#define TT_MAC_LANGID_HUNGARIAN 26 +#define TT_MAC_LANGID_ESTONIAN 27 +#define TT_MAC_LANGID_LETTISH 28 +#define TT_MAC_LANGID_SAAMISK 29 +#define TT_MAC_LANGID_FAEROESE 30 +#define TT_MAC_LANGID_FARSI 31 +#define TT_MAC_LANGID_RUSSIAN 32 +#define TT_MAC_LANGID_CHINESE_SIMPLIFIED 33 +#define TT_MAC_LANGID_FLEMISH 34 +#define TT_MAC_LANGID_IRISH 35 +#define TT_MAC_LANGID_ALBANIAN 36 +#define TT_MAC_LANGID_ROMANIAN 37 +#define TT_MAC_LANGID_CZECH 38 +#define TT_MAC_LANGID_SLOVAK 39 +#define TT_MAC_LANGID_SLOVENIAN 40 +#define TT_MAC_LANGID_YIDDISH 41 +#define TT_MAC_LANGID_SERBIAN 42 +#define TT_MAC_LANGID_MACEDONIAN 43 +#define TT_MAC_LANGID_BULGARIAN 44 +#define TT_MAC_LANGID_UKRAINIAN 45 +#define TT_MAC_LANGID_BYELORUSSIAN 46 +#define TT_MAC_LANGID_UZBEK 47 +#define TT_MAC_LANGID_KAZAKH 48 +#define TT_MAC_LANGID_AZERBAIJANI 49 +#define TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT 49 +#define TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT 50 +#define TT_MAC_LANGID_ARMENIAN 51 +#define TT_MAC_LANGID_GEORGIAN 52 +#define TT_MAC_LANGID_MOLDAVIAN 53 +#define TT_MAC_LANGID_KIRGHIZ 54 +#define TT_MAC_LANGID_TAJIKI 55 +#define TT_MAC_LANGID_TURKMEN 56 +#define TT_MAC_LANGID_MONGOLIAN 57 +#define TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT 57 +#define TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT 58 +#define TT_MAC_LANGID_PASHTO 59 +#define TT_MAC_LANGID_KURDISH 60 +#define TT_MAC_LANGID_KASHMIRI 61 +#define TT_MAC_LANGID_SINDHI 62 +#define TT_MAC_LANGID_TIBETAN 63 +#define TT_MAC_LANGID_NEPALI 64 +#define TT_MAC_LANGID_SANSKRIT 65 +#define TT_MAC_LANGID_MARATHI 66 +#define TT_MAC_LANGID_BENGALI 67 +#define TT_MAC_LANGID_ASSAMESE 68 +#define TT_MAC_LANGID_GUJARATI 69 +#define TT_MAC_LANGID_PUNJABI 70 +#define TT_MAC_LANGID_ORIYA 71 +#define TT_MAC_LANGID_MALAYALAM 72 +#define TT_MAC_LANGID_KANNADA 73 +#define TT_MAC_LANGID_TAMIL 74 +#define TT_MAC_LANGID_TELUGU 75 +#define TT_MAC_LANGID_SINHALESE 76 +#define TT_MAC_LANGID_BURMESE 77 +#define TT_MAC_LANGID_KHMER 78 +#define TT_MAC_LANGID_LAO 79 +#define TT_MAC_LANGID_VIETNAMESE 80 +#define TT_MAC_LANGID_INDONESIAN 81 +#define TT_MAC_LANGID_TAGALOG 82 +#define TT_MAC_LANGID_MALAY_ROMAN_SCRIPT 83 +#define TT_MAC_LANGID_MALAY_ARABIC_SCRIPT 84 +#define TT_MAC_LANGID_AMHARIC 85 +#define TT_MAC_LANGID_TIGRINYA 86 +#define TT_MAC_LANGID_GALLA 87 +#define TT_MAC_LANGID_SOMALI 88 +#define TT_MAC_LANGID_SWAHILI 89 +#define TT_MAC_LANGID_RUANDA 90 +#define TT_MAC_LANGID_RUNDI 91 +#define TT_MAC_LANGID_CHEWA 92 +#define TT_MAC_LANGID_MALAGASY 93 +#define TT_MAC_LANGID_ESPERANTO 94 +#define TT_MAC_LANGID_WELSH 128 +#define TT_MAC_LANGID_BASQUE 129 +#define TT_MAC_LANGID_CATALAN 130 +#define TT_MAC_LANGID_LATIN 131 +#define TT_MAC_LANGID_QUECHUA 132 +#define TT_MAC_LANGID_GUARANI 133 +#define TT_MAC_LANGID_AYMARA 134 +#define TT_MAC_LANGID_TATAR 135 +#define TT_MAC_LANGID_UIGHUR 136 +#define TT_MAC_LANGID_DZONGKHA 137 +#define TT_MAC_LANGID_JAVANESE 138 +#define TT_MAC_LANGID_SUNDANESE 139 + + +#if 0 /* these seem to be errors that have been dropped */ + +#define TT_MAC_LANGID_SCOTTISH_GAELIC 140 +#define TT_MAC_LANGID_IRISH_GAELIC 141 + +#endif + + + /* The following codes are new as of 2000-03-10 */ +#define TT_MAC_LANGID_GALICIAN 140 +#define TT_MAC_LANGID_AFRIKAANS 141 +#define TT_MAC_LANGID_BRETON 142 +#define TT_MAC_LANGID_INUKTITUT 143 +#define TT_MAC_LANGID_SCOTTISH_GAELIC 144 +#define TT_MAC_LANGID_MANX_GAELIC 145 +#define TT_MAC_LANGID_IRISH_GAELIC 146 +#define TT_MAC_LANGID_TONGAN 147 +#define TT_MAC_LANGID_GREEK_POLYTONIC 148 +#define TT_MAC_LANGID_GREELANDIC 149 +#define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT 150 + + + /*************************************************************************/ + /* */ + /* Possible values of the language identifier field in the name records */ + /* of the TTF `name' table if the `platform' identifier code is */ + /* TT_PLATFORM_MICROSOFT. */ + /* */ + /* The canonical source for the MS assigned LCID's (seems to) be at */ + /* */ + /* http://www.microsoft.com/globaldev/reference/lcid-all.mspx */ + /* */ + /* It used to be at various places, among them */ + /* */ + /* http://www.microsoft.com/typography/OTSPEC/lcid-cp.txt */ + /* http://www.microsoft.com/globaldev/reference/loclanghome.asp */ + /* http://support.microsoft.com/support/kb/articles/Q224/8/04.ASP */ + /* http://msdn.microsoft.com/library/en-us/passport25/ */ + /* NET_Passport_VBScript_Documentation/Single_Sign_In/ */ + /* Advanced_Single_Sign_In/Localization_and_LCIDs.asp */ + /* */ + /* Hopefully, it seems now that the Globaldev site prevails... */ + /* (updated by Antoine, 2004-02-17) */ + +#define TT_MS_LANGID_ARABIC_GENERAL 0x0001 +#define TT_MS_LANGID_ARABIC_SAUDI_ARABIA 0x0401 +#define TT_MS_LANGID_ARABIC_IRAQ 0x0801 +#define TT_MS_LANGID_ARABIC_EGYPT 0x0c01 +#define TT_MS_LANGID_ARABIC_LIBYA 0x1001 +#define TT_MS_LANGID_ARABIC_ALGERIA 0x1401 +#define TT_MS_LANGID_ARABIC_MOROCCO 0x1801 +#define TT_MS_LANGID_ARABIC_TUNISIA 0x1c01 +#define TT_MS_LANGID_ARABIC_OMAN 0x2001 +#define TT_MS_LANGID_ARABIC_YEMEN 0x2401 +#define TT_MS_LANGID_ARABIC_SYRIA 0x2801 +#define TT_MS_LANGID_ARABIC_JORDAN 0x2c01 +#define TT_MS_LANGID_ARABIC_LEBANON 0x3001 +#define TT_MS_LANGID_ARABIC_KUWAIT 0x3401 +#define TT_MS_LANGID_ARABIC_UAE 0x3801 +#define TT_MS_LANGID_ARABIC_BAHRAIN 0x3c01 +#define TT_MS_LANGID_ARABIC_QATAR 0x4001 +#define TT_MS_LANGID_BULGARIAN_BULGARIA 0x0402 +#define TT_MS_LANGID_CATALAN_SPAIN 0x0403 +#define TT_MS_LANGID_CHINESE_GENERAL 0x0004 +#define TT_MS_LANGID_CHINESE_TAIWAN 0x0404 +#define TT_MS_LANGID_CHINESE_PRC 0x0804 +#define TT_MS_LANGID_CHINESE_HONG_KONG 0x0c04 +#define TT_MS_LANGID_CHINESE_SINGAPORE 0x1004 + +#if 1 /* this looks like the correct value */ +#define TT_MS_LANGID_CHINESE_MACAU 0x1404 +#else /* but beware, Microsoft may change its mind... + the most recent Word reference has the following: */ +#define TT_MS_LANGID_CHINESE_MACAU TT_MS_LANGID_CHINESE_HONG_KONG +#endif + +#if 0 /* used only with .NET `cultures'; commented out */ +#define TT_MS_LANGID_CHINESE_TRADITIONAL 0x7C04 +#endif + +#define TT_MS_LANGID_CZECH_CZECH_REPUBLIC 0x0405 +#define TT_MS_LANGID_DANISH_DENMARK 0x0406 +#define TT_MS_LANGID_GERMAN_GERMANY 0x0407 +#define TT_MS_LANGID_GERMAN_SWITZERLAND 0x0807 +#define TT_MS_LANGID_GERMAN_AUSTRIA 0x0c07 +#define TT_MS_LANGID_GERMAN_LUXEMBOURG 0x1007 +#define TT_MS_LANGID_GERMAN_LIECHTENSTEI 0x1407 +#define TT_MS_LANGID_GREEK_GREECE 0x0408 + + /* don't ask what this one means... It is commented out currently. */ +#if 0 +#define TT_MS_LANGID_GREEK_GREECE2 0x2008 +#endif + +#define TT_MS_LANGID_ENGLISH_GENERAL 0x0009 +#define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409 +#define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM 0x0809 +#define TT_MS_LANGID_ENGLISH_AUSTRALIA 0x0c09 +#define TT_MS_LANGID_ENGLISH_CANADA 0x1009 +#define TT_MS_LANGID_ENGLISH_NEW_ZEALAND 0x1409 +#define TT_MS_LANGID_ENGLISH_IRELAND 0x1809 +#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA 0x1c09 +#define TT_MS_LANGID_ENGLISH_JAMAICA 0x2009 +#define TT_MS_LANGID_ENGLISH_CARIBBEAN 0x2409 +#define TT_MS_LANGID_ENGLISH_BELIZE 0x2809 +#define TT_MS_LANGID_ENGLISH_TRINIDAD 0x2c09 +#define TT_MS_LANGID_ENGLISH_ZIMBABWE 0x3009 +#define TT_MS_LANGID_ENGLISH_PHILIPPINES 0x3409 +#define TT_MS_LANGID_ENGLISH_INDONESIA 0x3809 +#define TT_MS_LANGID_ENGLISH_HONG_KONG 0x3c09 +#define TT_MS_LANGID_ENGLISH_INDIA 0x4009 +#define TT_MS_LANGID_ENGLISH_MALAYSIA 0x4409 +#define TT_MS_LANGID_ENGLISH_SINGAPORE 0x4809 +#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT 0x040a +#define TT_MS_LANGID_SPANISH_MEXICO 0x080a +#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT 0x0c0a +#define TT_MS_LANGID_SPANISH_GUATEMALA 0x100a +#define TT_MS_LANGID_SPANISH_COSTA_RICA 0x140a +#define TT_MS_LANGID_SPANISH_PANAMA 0x180a +#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC 0x1c0a +#define TT_MS_LANGID_SPANISH_VENEZUELA 0x200a +#define TT_MS_LANGID_SPANISH_COLOMBIA 0x240a +#define TT_MS_LANGID_SPANISH_PERU 0x280a +#define TT_MS_LANGID_SPANISH_ARGENTINA 0x2c0a +#define TT_MS_LANGID_SPANISH_ECUADOR 0x300a +#define TT_MS_LANGID_SPANISH_CHILE 0x340a +#define TT_MS_LANGID_SPANISH_URUGUAY 0x380a +#define TT_MS_LANGID_SPANISH_PARAGUAY 0x3c0a +#define TT_MS_LANGID_SPANISH_BOLIVIA 0x400a +#define TT_MS_LANGID_SPANISH_EL_SALVADOR 0x440a +#define TT_MS_LANGID_SPANISH_HONDURAS 0x480a +#define TT_MS_LANGID_SPANISH_NICARAGUA 0x4c0a +#define TT_MS_LANGID_SPANISH_PUERTO_RICO 0x500a +#define TT_MS_LANGID_SPANISH_UNITED_STATES 0x540a + /* The following ID blatantly violate MS specs by using a */ + /* sublanguage > 0x1F. */ +#define TT_MS_LANGID_SPANISH_LATIN_AMERICA 0xE40aU +#define TT_MS_LANGID_FINNISH_FINLAND 0x040b +#define TT_MS_LANGID_FRENCH_FRANCE 0x040c +#define TT_MS_LANGID_FRENCH_BELGIUM 0x080c +#define TT_MS_LANGID_FRENCH_CANADA 0x0c0c +#define TT_MS_LANGID_FRENCH_SWITZERLAND 0x100c +#define TT_MS_LANGID_FRENCH_LUXEMBOURG 0x140c +#define TT_MS_LANGID_FRENCH_MONACO 0x180c +#define TT_MS_LANGID_FRENCH_WEST_INDIES 0x1c0c +#define TT_MS_LANGID_FRENCH_REUNION 0x200c +#define TT_MS_LANGID_FRENCH_CONGO 0x240c + /* which was formerly: */ +#define TT_MS_LANGID_FRENCH_ZAIRE TT_MS_LANGID_FRENCH_CONGO +#define TT_MS_LANGID_FRENCH_SENEGAL 0x280c +#define TT_MS_LANGID_FRENCH_CAMEROON 0x2c0c +#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE 0x300c +#define TT_MS_LANGID_FRENCH_MALI 0x340c +#define TT_MS_LANGID_FRENCH_MOROCCO 0x380c +#define TT_MS_LANGID_FRENCH_HAITI 0x3c0c + /* and another violation of the spec (see 0xE40aU) */ +#define TT_MS_LANGID_FRENCH_NORTH_AFRICA 0xE40cU +#define TT_MS_LANGID_HEBREW_ISRAEL 0x040d +#define TT_MS_LANGID_HUNGARIAN_HUNGARY 0x040e +#define TT_MS_LANGID_ICELANDIC_ICELAND 0x040f +#define TT_MS_LANGID_ITALIAN_ITALY 0x0410 +#define TT_MS_LANGID_ITALIAN_SWITZERLAND 0x0810 +#define TT_MS_LANGID_JAPANESE_JAPAN 0x0411 +#define TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA 0x0412 +#define TT_MS_LANGID_KOREAN_JOHAB_KOREA 0x0812 +#define TT_MS_LANGID_DUTCH_NETHERLANDS 0x0413 +#define TT_MS_LANGID_DUTCH_BELGIUM 0x0813 +#define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL 0x0414 +#define TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK 0x0814 +#define TT_MS_LANGID_POLISH_POLAND 0x0415 +#define TT_MS_LANGID_PORTUGUESE_BRAZIL 0x0416 +#define TT_MS_LANGID_PORTUGUESE_PORTUGAL 0x0816 +#define TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND 0x0417 +#define TT_MS_LANGID_ROMANIAN_ROMANIA 0x0418 +#define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA 0x0818 +#define TT_MS_LANGID_RUSSIAN_RUSSIA 0x0419 +#define TT_MS_LANGID_RUSSIAN_MOLDAVIA 0x0819 +#define TT_MS_LANGID_CROATIAN_CROATIA 0x041a +#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN 0x081a +#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC 0x0c1a + +#if 0 /* this used to be this value, but it looks like we were wrong */ +#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x101a +#else /* current sources say */ +#define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA 0x101a +#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x141a + /* and XPsp2 Platform SDK added (2004-07-26) */ + /* Names are shortened to be significant within 40 chars. */ +#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN 0x181a +#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC 0x181a +#endif + +#define TT_MS_LANGID_SLOVAK_SLOVAKIA 0x041b +#define TT_MS_LANGID_ALBANIAN_ALBANIA 0x041c +#define TT_MS_LANGID_SWEDISH_SWEDEN 0x041d +#define TT_MS_LANGID_SWEDISH_FINLAND 0x081d +#define TT_MS_LANGID_THAI_THAILAND 0x041e +#define TT_MS_LANGID_TURKISH_TURKEY 0x041f +#define TT_MS_LANGID_URDU_PAKISTAN 0x0420 +#define TT_MS_LANGID_URDU_INDIA 0x0820 +#define TT_MS_LANGID_INDONESIAN_INDONESIA 0x0421 +#define TT_MS_LANGID_UKRAINIAN_UKRAINE 0x0422 +#define TT_MS_LANGID_BELARUSIAN_BELARUS 0x0423 +#define TT_MS_LANGID_SLOVENE_SLOVENIA 0x0424 +#define TT_MS_LANGID_ESTONIAN_ESTONIA 0x0425 +#define TT_MS_LANGID_LATVIAN_LATVIA 0x0426 +#define TT_MS_LANGID_LITHUANIAN_LITHUANIA 0x0427 +#define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA 0x0827 +#define TT_MS_LANGID_TAJIK_TAJIKISTAN 0x0428 +#define TT_MS_LANGID_FARSI_IRAN 0x0429 +#define TT_MS_LANGID_VIETNAMESE_VIET_NAM 0x042a +#define TT_MS_LANGID_ARMENIAN_ARMENIA 0x042b +#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN 0x042c +#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC 0x082c +#define TT_MS_LANGID_BASQUE_SPAIN 0x042d +#define TT_MS_LANGID_SORBIAN_GERMANY 0x042e +#define TT_MS_LANGID_MACEDONIAN_MACEDONIA 0x042f +#define TT_MS_LANGID_SUTU_SOUTH_AFRICA 0x0430 +#define TT_MS_LANGID_TSONGA_SOUTH_AFRICA 0x0431 +#define TT_MS_LANGID_TSWANA_SOUTH_AFRICA 0x0432 +#define TT_MS_LANGID_VENDA_SOUTH_AFRICA 0x0433 +#define TT_MS_LANGID_XHOSA_SOUTH_AFRICA 0x0434 +#define TT_MS_LANGID_ZULU_SOUTH_AFRICA 0x0435 +#define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA 0x0436 +#define TT_MS_LANGID_GEORGIAN_GEORGIA 0x0437 +#define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS 0x0438 +#define TT_MS_LANGID_HINDI_INDIA 0x0439 +#define TT_MS_LANGID_MALTESE_MALTA 0x043a + /* Added by XPsp2 Platform SDK (2004-07-26) */ +#define TT_MS_LANGID_SAMI_NORTHERN_NORWAY 0x043b +#define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN 0x083b +#define TT_MS_LANGID_SAMI_NORTHERN_FINLAND 0x0C3b +#define TT_MS_LANGID_SAMI_LULE_NORWAY 0x103b +#define TT_MS_LANGID_SAMI_LULE_SWEDEN 0x143b +#define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY 0x183b +#define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN 0x1C3b +#define TT_MS_LANGID_SAMI_SKOLT_FINLAND 0x203b +#define TT_MS_LANGID_SAMI_INARI_FINLAND 0x243b + /* ... and we also keep our old identifier... */ +#define TT_MS_LANGID_SAAMI_LAPONIA 0x043b + +#if 0 /* this seems to be a previous inversion */ +#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043c +#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083c +#else +#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083c +#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043c +#endif + +#define TT_MS_LANGID_YIDDISH_GERMANY 0x043d +#define TT_MS_LANGID_MALAY_MALAYSIA 0x043e +#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083e +#define TT_MS_LANGID_KAZAK_KAZAKSTAN 0x043f +#define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN /* Cyrillic*/ 0x0440 + /* alias declared in Windows 2000 */ +#define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \ + TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN + +#define TT_MS_LANGID_SWAHILI_KENYA 0x0441 +#define TT_MS_LANGID_TURKMEN_TURKMENISTAN 0x0442 +#define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN 0x0443 +#define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC 0x0843 +#define TT_MS_LANGID_TATAR_TATARSTAN 0x0444 +#define TT_MS_LANGID_BENGALI_INDIA 0x0445 +#define TT_MS_LANGID_BENGALI_BANGLADESH 0x0845 +#define TT_MS_LANGID_PUNJABI_INDIA 0x0446 +#define TT_MS_LANGID_PUNJABI_ARABIC_PAKISTAN 0x0846 +#define TT_MS_LANGID_GUJARATI_INDIA 0x0447 +#define TT_MS_LANGID_ORIYA_INDIA 0x0448 +#define TT_MS_LANGID_TAMIL_INDIA 0x0449 +#define TT_MS_LANGID_TELUGU_INDIA 0x044a +#define TT_MS_LANGID_KANNADA_INDIA 0x044b +#define TT_MS_LANGID_MALAYALAM_INDIA 0x044c +#define TT_MS_LANGID_ASSAMESE_INDIA 0x044d +#define TT_MS_LANGID_MARATHI_INDIA 0x044e +#define TT_MS_LANGID_SANSKRIT_INDIA 0x044f +#define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450 +#define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN 0x0850 +#define TT_MS_LANGID_TIBETAN_CHINA 0x0451 + /* Don't use the next constant! It has */ + /* (1) the wrong spelling (Dzonghka) */ + /* (2) Microsoft doesn't officially define it -- */ + /* at least it is not in the List of Local */ + /* ID Values. */ + /* (3) Dzongkha is not the same language as */ + /* Tibetan, so merging it is wrong anyway. */ + /* */ + /* TT_MS_LANGID_TIBETAN_BHUTAN is correct, BTW. */ +#define TT_MS_LANGID_DZONGHKA_BHUTAN 0x0851 + +#if 0 + /* the following used to be defined */ +#define TT_MS_LANGID_TIBETAN_BHUTAN 0x0451 + /* ... but it was changed; */ +#else + /* So we will continue to #define it, but with the correct value */ +#define TT_MS_LANGID_TIBETAN_BHUTAN TT_MS_LANGID_DZONGHKA_BHUTAN +#endif + +#define TT_MS_LANGID_WELSH_WALES 0x0452 +#define TT_MS_LANGID_KHMER_CAMBODIA 0x0453 +#define TT_MS_LANGID_LAO_LAOS 0x0454 +#define TT_MS_LANGID_BURMESE_MYANMAR 0x0455 +#define TT_MS_LANGID_GALICIAN_SPAIN 0x0456 +#define TT_MS_LANGID_KONKANI_INDIA 0x0457 +#define TT_MS_LANGID_MANIPURI_INDIA /* Bengali */ 0x0458 +#define TT_MS_LANGID_SINDHI_INDIA /* Arabic */ 0x0459 +#define TT_MS_LANGID_SINDHI_PAKISTAN 0x0859 + /* Missing a LCID for Sindhi in Devanagari script */ +#define TT_MS_LANGID_SYRIAC_SYRIA 0x045a +#define TT_MS_LANGID_SINHALESE_SRI_LANKA 0x045b +#define TT_MS_LANGID_CHEROKEE_UNITED_STATES 0x045c +#define TT_MS_LANGID_INUKTITUT_CANADA 0x045d +#define TT_MS_LANGID_AMHARIC_ETHIOPIA 0x045e +#define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */ 0x045f +#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN 0x085f + /* Missing a LCID for Tifinagh script */ +#define TT_MS_LANGID_KASHMIRI_PAKISTAN /* Arabic */ 0x0460 + /* Spelled this way by XPsp2 Platform SDK (2004-07-26) */ + /* script is yet unclear... might be Arabic, Nagari or Sharada */ +#define TT_MS_LANGID_KASHMIRI_SASIA 0x0860 + /* ... and aliased (by MS) for compatibility reasons. */ +#define TT_MS_LANGID_KASHMIRI_INDIA TT_MS_LANGID_KASHMIRI_SASIA +#define TT_MS_LANGID_NEPALI_NEPAL 0x0461 +#define TT_MS_LANGID_NEPALI_INDIA 0x0861 +#define TT_MS_LANGID_FRISIAN_NETHERLANDS 0x0462 +#define TT_MS_LANGID_PASHTO_AFGHANISTAN 0x0463 +#define TT_MS_LANGID_FILIPINO_PHILIPPINES 0x0464 +#define TT_MS_LANGID_DHIVEHI_MALDIVES 0x0465 + /* alias declared in Windows 2000 */ +#define TT_MS_LANGID_DIVEHI_MALDIVES TT_MS_LANGID_DHIVEHI_MALDIVES +#define TT_MS_LANGID_EDO_NIGERIA 0x0466 +#define TT_MS_LANGID_FULFULDE_NIGERIA 0x0467 +#define TT_MS_LANGID_HAUSA_NIGERIA 0x0468 +#define TT_MS_LANGID_IBIBIO_NIGERIA 0x0469 +#define TT_MS_LANGID_YORUBA_NIGERIA 0x046a +#define TT_MS_LANGID_QUECHUA_BOLIVIA 0x046b +#define TT_MS_LANGID_QUECHUA_ECUADOR 0x086b +#define TT_MS_LANGID_QUECHUA_PERU 0x0c6b +#define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA 0x046c + /* Also spelled by XPsp2 Platform SDK (2004-07-26) */ +#define TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA \ + TT_MS_LANGID_SEPEDI_SOUTH_AFRICA + /* language codes 0x046d, 0x046e and 0x046f are (still) unknown. */ +#define TT_MS_LANGID_IGBO_NIGERIA 0x0470 +#define TT_MS_LANGID_KANURI_NIGERIA 0x0471 +#define TT_MS_LANGID_OROMO_ETHIOPIA 0x0472 +#define TT_MS_LANGID_TIGRIGNA_ETHIOPIA 0x0473 +#define TT_MS_LANGID_TIGRIGNA_ERYTHREA 0x0873 + /* also spelled in the `Passport SDK' list as: */ +#define TT_MS_LANGID_TIGRIGNA_ERYTREA TT_MS_LANGID_TIGRIGNA_ERYTHREA +#define TT_MS_LANGID_GUARANI_PARAGUAY 0x0474 +#define TT_MS_LANGID_HAWAIIAN_UNITED_STATES 0x0475 +#define TT_MS_LANGID_LATIN 0x0476 +#define TT_MS_LANGID_SOMALI_SOMALIA 0x0477 + /* Note: Yi does not have a (proper) ISO 639-2 code, since it is mostly */ + /* not written (but OTOH the peculiar writing system is worth */ + /* studying). */ +#define TT_MS_LANGID_YI_CHINA 0x0478 +#define TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES 0x0479 + /* language codes from 0x047a to 0x047f are (still) unknown. */ +#define TT_MS_LANGID_UIGHUR_CHINA 0x0480 +#define TT_MS_LANGID_MAORI_NEW_ZEALAND 0x0481 + +#if 0 /* not deemed useful for fonts */ +#define TT_MS_LANGID_HUMAN_INTERFACE_DEVICE 0x04ff +#endif + + + /*************************************************************************/ + /* */ + /* Possible values of the `name' identifier field in the name records of */ + /* the TTF `name' table. These values are platform independent. */ + /* */ +#define TT_NAME_ID_COPYRIGHT 0 +#define TT_NAME_ID_FONT_FAMILY 1 +#define TT_NAME_ID_FONT_SUBFAMILY 2 +#define TT_NAME_ID_UNIQUE_ID 3 +#define TT_NAME_ID_FULL_NAME 4 +#define TT_NAME_ID_VERSION_STRING 5 +#define TT_NAME_ID_PS_NAME 6 +#define TT_NAME_ID_TRADEMARK 7 + + /* the following values are from the OpenType spec */ +#define TT_NAME_ID_MANUFACTURER 8 +#define TT_NAME_ID_DESIGNER 9 +#define TT_NAME_ID_DESCRIPTION 10 +#define TT_NAME_ID_VENDOR_URL 11 +#define TT_NAME_ID_DESIGNER_URL 12 +#define TT_NAME_ID_LICENSE 13 +#define TT_NAME_ID_LICENSE_URL 14 + /* number 15 is reserved */ +#define TT_NAME_ID_PREFERRED_FAMILY 16 +#define TT_NAME_ID_PREFERRED_SUBFAMILY 17 +#define TT_NAME_ID_MAC_FULL_NAME 18 + + /* The following code is new as of 2000-01-21 */ +#define TT_NAME_ID_SAMPLE_TEXT 19 + + /* This is new in OpenType 1.3 */ +#define TT_NAME_ID_CID_FINDFONT_NAME 20 + + + /*************************************************************************/ + /* */ + /* Bit mask values for the Unicode Ranges from the TTF `OS2 ' table. */ + /* */ + /* Updated 02-Jul-2000. */ + /* */ + + /* General Scripts Area */ + + /* Bit 0 Basic Latin */ +#define TT_UCR_BASIC_LATIN (1L << 0) /* U+0020-U+007E */ + /* Bit 1 C1 Controls and Latin-1 Supplement */ +#define TT_UCR_LATIN1_SUPPLEMENT (1L << 1) /* U+0080-U+00FF */ + /* Bit 2 Latin Extended-A */ +#define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */ + /* Bit 3 Latin Extended-B */ +#define TT_UCR_LATIN_EXTENDED_B (1L << 3) /* U+0180-U+024F */ + /* Bit 4 IPA Extensions */ +#define TT_UCR_IPA_EXTENSIONS (1L << 4) /* U+0250-U+02AF */ + /* Bit 5 Spacing Modifier Letters */ +#define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */ + /* Bit 6 Combining Diacritical Marks */ +#define TT_UCR_COMBINING_DIACRITICS (1L << 6) /* U+0300-U+036F */ + /* Bit 7 Greek and Coptic */ +#define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */ + /* Bit 8 is reserved (was: Greek Symbols and Coptic) */ + /* Bit 9 Cyrillic + */ + /* Cyrillic Supplementary */ +#define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */ + /* U+0500-U+052F */ + /* Bit 10 Armenian */ +#define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */ + /* Bit 11 Hebrew */ +#define TT_UCR_HEBREW (1L << 11) /* U+0590-U+05FF */ + /* Bit 12 is reserved (was: Hebrew Extended) */ + /* Bit 13 Arabic */ +#define TT_UCR_ARABIC (1L << 13) /* U+0600-U+06FF */ + /* Bit 14 is reserved (was: Arabic Extended) */ + /* Bit 15 Devanagari */ +#define TT_UCR_DEVANAGARI (1L << 15) /* U+0900-U+097F */ + /* Bit 16 Bengali */ +#define TT_UCR_BENGALI (1L << 16) /* U+0980-U+09FF */ + /* Bit 17 Gurmukhi */ +#define TT_UCR_GURMUKHI (1L << 17) /* U+0A00-U+0A7F */ + /* Bit 18 Gujarati */ +#define TT_UCR_GUJARATI (1L << 18) /* U+0A80-U+0AFF */ + /* Bit 19 Oriya */ +#define TT_UCR_ORIYA (1L << 19) /* U+0B00-U+0B7F */ + /* Bit 20 Tamil */ +#define TT_UCR_TAMIL (1L << 20) /* U+0B80-U+0BFF */ + /* Bit 21 Telugu */ +#define TT_UCR_TELUGU (1L << 21) /* U+0C00-U+0C7F */ + /* Bit 22 Kannada */ +#define TT_UCR_KANNADA (1L << 22) /* U+0C80-U+0CFF */ + /* Bit 23 Malayalam */ +#define TT_UCR_MALAYALAM (1L << 23) /* U+0D00-U+0D7F */ + /* Bit 24 Thai */ +#define TT_UCR_THAI (1L << 24) /* U+0E00-U+0E7F */ + /* Bit 25 Lao */ +#define TT_UCR_LAO (1L << 25) /* U+0E80-U+0EFF */ + /* Bit 26 Georgian */ +#define TT_UCR_GEORGIAN (1L << 26) /* U+10A0-U+10FF */ + /* Bit 27 is reserved (was Georgian Extended) */ + /* Bit 28 Hangul Jamo */ +#define TT_UCR_HANGUL_JAMO (1L << 28) /* U+1100-U+11FF */ + /* Bit 29 Latin Extended Additional */ +#define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1L << 29) /* U+1E00-U+1EFF */ + /* Bit 30 Greek Extended */ +#define TT_UCR_GREEK_EXTENDED (1L << 30) /* U+1F00-U+1FFF */ + + /* Symbols Area */ + + /* Bit 31 General Punctuation */ +#define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */ + /* Bit 32 Superscripts And Subscripts */ +#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */ + /* Bit 33 Currency Symbols */ +#define TT_UCR_CURRENCY_SYMBOLS (1L << 1) /* U+20A0-U+20CF */ + /* Bit 34 Combining Diacritical Marks For Symbols */ +#define TT_UCR_COMBINING_DIACRITICS_SYMB (1L << 2) /* U+20D0-U+20FF */ + /* Bit 35 Letterlike Symbols */ +#define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */ + /* Bit 36 Number Forms */ +#define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */ + /* Bit 37 Arrows + */ + /* Supplemental Arrows-A + */ + /* Supplemental Arrows-B */ +#define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */ + /* U+27F0-U+27FF */ + /* U+2900-U+297F */ + /* Bit 38 Mathematical Operators + */ + /* Supplemental Mathematical Operators + */ + /* Miscellaneous Mathematical Symbols-A + */ + /* Miscellaneous Mathematical Symbols-B */ +#define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */ + /* U+2A00-U+2AFF */ + /* U+27C0-U+27EF */ + /* U+2980-U+29FF */ + /* Bit 39 Miscellaneous Technical */ +#define TT_UCR_MISCELLANEOUS_TECHNICAL (1L << 7) /* U+2300-U+23FF */ + /* Bit 40 Control Pictures */ +#define TT_UCR_CONTROL_PICTURES (1L << 8) /* U+2400-U+243F */ + /* Bit 41 Optical Character Recognition */ +#define TT_UCR_OCR (1L << 9) /* U+2440-U+245F */ + /* Bit 42 Enclosed Alphanumerics */ +#define TT_UCR_ENCLOSED_ALPHANUMERICS (1L << 10) /* U+2460-U+24FF */ + /* Bit 43 Box Drawing */ +#define TT_UCR_BOX_DRAWING (1L << 11) /* U+2500-U+257F */ + /* Bit 44 Block Elements */ +#define TT_UCR_BLOCK_ELEMENTS (1L << 12) /* U+2580-U+259F */ + /* Bit 45 Geometric Shapes */ +#define TT_UCR_GEOMETRIC_SHAPES (1L << 13) /* U+25A0-U+25FF */ + /* Bit 46 Miscellaneous Symbols */ +#define TT_UCR_MISCELLANEOUS_SYMBOLS (1L << 14) /* U+2600-U+26FF */ + /* Bit 47 Dingbats */ +#define TT_UCR_DINGBATS (1L << 15) /* U+2700-U+27BF */ + + /* CJK Phonetics and Symbols Area */ + + /* Bit 48 CJK Symbols and Punctuation */ +#define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */ + /* Bit 49 Hiragana */ +#define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */ + /* Bit 50 Katakana + */ + /* Katakana Phonetic Extensions */ +#define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */ + /* U+31F0-U+31FF */ + /* Bit 51 Bopomofo + */ + /* Bopomofo Extended */ +#define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */ + /* U+31A0-U+31BF */ + /* Bit 52 Hangul Compatibility Jamo */ +#define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */ + /* Bit 53 Kanbun */ +#define TT_UCR_CJK_MISC (1L << 21) /* U+3190-U+319F */ +#define TT_UCR_KANBUN TT_UCR_CJK_MISC + /* Bit 54 Enclosed CJK Letters and Months */ +#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */ + /* Bit 55 CJK Compatibility */ +#define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */ + + /* Hangul Syllables Area */ + + /* Bit 56 Hangul */ +#define TT_UCR_HANGUL (1L << 24) /* U+AC00-U+D7A3 */ + + /* Surrogates Area */ + + /* Bit 57 High Surrogates + */ + /* High Private Use Surrogates + */ + /* Low Surrogates */ +#define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DB7F */ + /* U+DB80-U+DBFF */ + /* U+DC00-U+DFFF */ + /* According to OpenType specs v.1.3+, setting bit 57 implies that there */ + /* is at least one codepoint beyond the Basic Multilingual Plane that is */ + /* supported by this font. So it really means: >= U+10000 */ + + /* Bit 58 is reserved for Unicode SubRanges */ + + /* CJK Ideographs Area */ + + /* Bit 59 CJK Unified Ideographs + */ + /* CJK Radicals Supplement + */ + /* Kangxi Radicals + */ + /* Ideographic Description Characters + */ + /* CJK Unified Ideographs Extension A */ + /* CJK Unified Ideographs Extension A + */ + /* CJK Unified Ideographs Extension B + */ + /* Kanbun */ +#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */ + /* U+2E80-U+2EFF */ + /* U+2F00-U+2FDF */ + /* U+2FF0-U+2FFF */ + /* U+3400-U+4DB5 */ + /*U+20000-U+2A6DF*/ + /* U+3190-U+319F */ + + /* Private Use Area */ + + /* Bit 60 Private Use */ +#define TT_UCR_PRIVATE_USE (1L << 28) /* U+E000-U+F8FF */ + + /* Compatibility Area and Specials */ + + /* Bit 61 CJK Compatibility Ideographs + */ + /* CJK Compatibility Ideographs Supplement */ +#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+F900-U+FAFF */ + /*U+2F800-U+2FA1F*/ + /* Bit 62 Alphabetic Presentation Forms */ +#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */ + /* Bit 63 Arabic Presentation Forms-A */ +#define TT_UCR_ARABIC_PRESENTATIONS_A (1L << 31) /* U+FB50-U+FDFF */ + /* Bit 64 Combining Half Marks */ +#define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */ + /* Bit 65 CJK Compatibility Forms */ +#define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE30-U+FE4F */ + /* Bit 66 Small Form Variants */ +#define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */ + /* Bit 67 Arabic Presentation Forms-B */ +#define TT_UCR_ARABIC_PRESENTATIONS_B (1L << 3) /* U+FE70-U+FEFE */ + /* Bit 68 Halfwidth and Fullwidth Forms */ +#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1L << 4) /* U+FF00-U+FFEF */ + /* Bit 69 Specials */ +#define TT_UCR_SPECIALS (1L << 5) /* U+FFF0-U+FFFD */ + /* Bit 70 Tibetan */ +#define TT_UCR_TIBETAN (1L << 6) /* U+0F00-U+0FFF */ + /* Bit 71 Syriac */ +#define TT_UCR_SYRIAC (1L << 7) /* U+0700-U+074F */ + /* Bit 72 Thaana */ +#define TT_UCR_THAANA (1L << 8) /* U+0780-U+07BF */ + /* Bit 73 Sinhala */ +#define TT_UCR_SINHALA (1L << 9) /* U+0D80-U+0DFF */ + /* Bit 74 Myanmar */ +#define TT_UCR_MYANMAR (1L << 10) /* U+1000-U+109F */ + /* Bit 75 Ethiopic */ +#define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+137F */ + /* Bit 76 Cherokee */ +#define TT_UCR_CHEROKEE (1L << 12) /* U+13A0-U+13FF */ + /* Bit 77 Unified Canadian Aboriginal Syllabics */ +#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS (1L << 13) /* U+1400-U+167F */ + /* Bit 78 Ogham */ +#define TT_UCR_OGHAM (1L << 14) /* U+1680-U+169F */ + /* Bit 79 Runic */ +#define TT_UCR_RUNIC (1L << 15) /* U+16A0-U+16FF */ + /* Bit 80 Khmer */ +#define TT_UCR_KHMER (1L << 16) /* U+1780-U+17FF */ + /* Bit 81 Mongolian */ +#define TT_UCR_MONGOLIAN (1L << 17) /* U+1800-U+18AF */ + /* Bit 82 Braille Patterns */ +#define TT_UCR_BRAILLE (1L << 18) /* U+2800-U+28FF */ + /* Bit 83 Yi Syllables + */ + /* Yi Radicals */ +#define TT_UCR_YI (1L << 19) /* U+A000-U+A48F */ + /* U+A490-U+A4CF */ + /* Bit 84 Tagalog + */ + /* Hanunoo + */ + /* Buhid + */ + /* Tagbanwa */ +#define TT_UCR_PHILIPPINE (1L << 20) /* U+1700-U+171F */ + /* U+1720-U+173F */ + /* U+1740-U+175F */ + /* U+1760-U+177F */ + /* Bit 85 Old Italic */ +#define TT_UCR_OLD_ITALIC (1L << 21) /*U+10300-U+1032F*/ + /* Bit 86 Gothic */ +#define TT_UCR_GOTHIC (1L << 22) /*U+10330-U+1034F*/ + /* Bit 87 Deseret */ +#define TT_UCR_DESERET (1L << 23) /*U+10400-U+1044F*/ + /* Bit 88 Byzantine Musical Symbols + */ + /* Musical Symbols */ +#define TT_UCR_MUSICAL_SYMBOLS (1L << 24) /*U+1D000-U+1D0FF*/ + /*U+1D100-U+1D1FF*/ + /* Bit 89 Mathematical Alphanumeric Symbols */ +#define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS (1L << 25) /*U+1D400-U+1D7FF*/ + /* Bit 90 Private Use (plane 15) + */ + /* Private Use (plane 16) */ +#define TT_UCR_PRIVATE_USE_SUPPLEMENTARY (1L << 26) /*U+F0000-U+FFFFD*/ + /*U+100000-U+10FFFD*/ + /* Bit 91 Variation Selectors */ +#define TT_UCR_VARIATION_SELECTORS (1L << 27) /* U+FE00-U+FE0F */ + /* Bit 92 Tags */ +#define TT_UCR_TAGS (1L << 28) /*U+E0000-U+E007F*/ + + + /*************************************************************************/ + /* */ + /* Some compilers have a very limited length of identifiers. */ + /* */ +#if defined( __TURBOC__ ) && __TURBOC__ < 0x0410 || defined( __PACIFIC__ ) +#define HAVE_LIMIT_ON_IDENTS +#endif + + +#ifndef HAVE_LIMIT_ON_IDENTS + + + /*************************************************************************/ + /* */ + /* Here some alias #defines in order to be clearer. */ + /* */ + /* These are not always #defined to stay within the 31 character limit */ + /* which some compilers have. */ + /* */ + /* Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern */ + /* Borland compilers (read: from BC++ 3.1 on) can increase this limit. */ + /* If you get a warning with such a compiler, use the -i40 switch. */ + /* */ +#define TT_UCR_ARABIC_PRESENTATION_FORMS_A \ + TT_UCR_ARABIC_PRESENTATIONS_A +#define TT_UCR_ARABIC_PRESENTATION_FORMS_B \ + TT_UCR_ARABIC_PRESENTATIONS_B + +#define TT_UCR_COMBINING_DIACRITICAL_MARKS \ + TT_UCR_COMBINING_DIACRITICS +#define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \ + TT_UCR_COMBINING_DIACRITICS_SYMB + + +#endif /* !HAVE_LIMIT_ON_IDENTS */ + + +FT_END_HEADER + +#endif /* __TTNAMEID_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/tttables.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/tttables.h new file mode 100644 index 0000000000..43eca2e258 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/tttables.h @@ -0,0 +1,756 @@ +/***************************************************************************/ +/* */ +/* tttables.h */ +/* */ +/* Basic SFNT/TrueType tables definitions and interface */ +/* (specification only). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __TTTABLES_H__ +#define __TTTABLES_H__ + + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + /*************************************************************************/ + /* */ + /* <Section> */ + /* truetype_tables */ + /* */ + /* <Title> */ + /* TrueType Tables */ + /* */ + /* <Abstract> */ + /* TrueType specific table types and functions. */ + /* */ + /* <Description> */ + /* This section contains the definition of TrueType-specific tables */ + /* as well as some routines used to access and process them. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* TT_Header */ + /* */ + /* <Description> */ + /* A structure used to model a TrueType font header table. All */ + /* fields follow the TrueType specification. */ + /* */ + typedef struct TT_Header_ + { + FT_Fixed Table_Version; + FT_Fixed Font_Revision; + + FT_Long CheckSum_Adjust; + FT_Long Magic_Number; + + FT_UShort Flags; + FT_UShort Units_Per_EM; + + FT_Long Created [2]; + FT_Long Modified[2]; + + FT_Short xMin; + FT_Short yMin; + FT_Short xMax; + FT_Short yMax; + + FT_UShort Mac_Style; + FT_UShort Lowest_Rec_PPEM; + + FT_Short Font_Direction; + FT_Short Index_To_Loc_Format; + FT_Short Glyph_Data_Format; + + } TT_Header; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* TT_HoriHeader */ + /* */ + /* <Description> */ + /* A structure used to model a TrueType horizontal header, the `hhea' */ + /* table, as well as the corresponding horizontal metrics table, */ + /* i.e., the `hmtx' table. */ + /* */ + /* <Fields> */ + /* Version :: The table version. */ + /* */ + /* Ascender :: The font's ascender, i.e., the distance */ + /* from the baseline to the top-most of all */ + /* glyph points found in the font. */ + /* */ + /* This value is invalid in many fonts, as */ + /* it is usually set by the font designer, */ + /* and often reflects only a portion of the */ + /* glyphs found in the font (maybe ASCII). */ + /* */ + /* You should use the `sTypoAscender' field */ + /* of the OS/2 table instead if you want */ + /* the correct one. */ + /* */ + /* Descender :: The font's descender, i.e., the distance */ + /* from the baseline to the bottom-most of */ + /* all glyph points found in the font. It */ + /* is negative. */ + /* */ + /* This value is invalid in many fonts, as */ + /* it is usually set by the font designer, */ + /* and often reflects only a portion of the */ + /* glyphs found in the font (maybe ASCII). */ + /* */ + /* You should use the `sTypoDescender' */ + /* field of the OS/2 table instead if you */ + /* want the correct one. */ + /* */ + /* Line_Gap :: The font's line gap, i.e., the distance */ + /* to add to the ascender and descender to */ + /* get the BTB, i.e., the */ + /* baseline-to-baseline distance for the */ + /* font. */ + /* */ + /* advance_Width_Max :: This field is the maximum of all advance */ + /* widths found in the font. It can be */ + /* used to compute the maximum width of an */ + /* arbitrary string of text. */ + /* */ + /* min_Left_Side_Bearing :: The minimum left side bearing of all */ + /* glyphs within the font. */ + /* */ + /* min_Right_Side_Bearing :: The minimum right side bearing of all */ + /* glyphs within the font. */ + /* */ + /* xMax_Extent :: The maximum horizontal extent (i.e., the */ + /* `width' of a glyph's bounding box) for */ + /* all glyphs in the font. */ + /* */ + /* caret_Slope_Rise :: The rise coefficient of the cursor's */ + /* slope of the cursor (slope=rise/run). */ + /* */ + /* caret_Slope_Run :: The run coefficient of the cursor's */ + /* slope. */ + /* */ + /* Reserved :: 10 reserved bytes. */ + /* */ + /* metric_Data_Format :: Always 0. */ + /* */ + /* number_Of_HMetrics :: Number of HMetrics entries in the `hmtx' */ + /* table -- this value can be smaller than */ + /* the total number of glyphs in the font. */ + /* */ + /* long_metrics :: A pointer into the `hmtx' table. */ + /* */ + /* short_metrics :: A pointer into the `hmtx' table. */ + /* */ + /* <Note> */ + /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */ + /* be identical except for the names of their fields which */ + /* are different. */ + /* */ + /* This ensures that a single function in the `ttload' */ + /* module is able to read both the horizontal and vertical */ + /* headers. */ + /* */ + typedef struct TT_HoriHeader_ + { + FT_Fixed Version; + FT_Short Ascender; + FT_Short Descender; + FT_Short Line_Gap; + + FT_UShort advance_Width_Max; /* advance width maximum */ + + FT_Short min_Left_Side_Bearing; /* minimum left-sb */ + FT_Short min_Right_Side_Bearing; /* minimum right-sb */ + FT_Short xMax_Extent; /* xmax extents */ + FT_Short caret_Slope_Rise; + FT_Short caret_Slope_Run; + FT_Short caret_Offset; + + FT_Short Reserved[4]; + + FT_Short metric_Data_Format; + FT_UShort number_Of_HMetrics; + + /* The following fields are not defined by the TrueType specification */ + /* but they are used to connect the metrics header to the relevant */ + /* `HMTX' table. */ + + void* long_metrics; + void* short_metrics; + + } TT_HoriHeader; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* TT_VertHeader */ + /* */ + /* <Description> */ + /* A structure used to model a TrueType vertical header, the `vhea' */ + /* table, as well as the corresponding vertical metrics table, i.e., */ + /* the `vmtx' table. */ + /* */ + /* <Fields> */ + /* Version :: The table version. */ + /* */ + /* Ascender :: The font's ascender, i.e., the distance */ + /* from the baseline to the top-most of */ + /* all glyph points found in the font. */ + /* */ + /* This value is invalid in many fonts, as */ + /* it is usually set by the font designer, */ + /* and often reflects only a portion of */ + /* the glyphs found in the font (maybe */ + /* ASCII). */ + /* */ + /* You should use the `sTypoAscender' */ + /* field of the OS/2 table instead if you */ + /* want the correct one. */ + /* */ + /* Descender :: The font's descender, i.e., the */ + /* distance from the baseline to the */ + /* bottom-most of all glyph points found */ + /* in the font. It is negative. */ + /* */ + /* This value is invalid in many fonts, as */ + /* it is usually set by the font designer, */ + /* and often reflects only a portion of */ + /* the glyphs found in the font (maybe */ + /* ASCII). */ + /* */ + /* You should use the `sTypoDescender' */ + /* field of the OS/2 table instead if you */ + /* want the correct one. */ + /* */ + /* Line_Gap :: The font's line gap, i.e., the distance */ + /* to add to the ascender and descender to */ + /* get the BTB, i.e., the */ + /* baseline-to-baseline distance for the */ + /* font. */ + /* */ + /* advance_Height_Max :: This field is the maximum of all */ + /* advance heights found in the font. It */ + /* can be used to compute the maximum */ + /* height of an arbitrary string of text. */ + /* */ + /* min_Top_Side_Bearing :: The minimum top side bearing of all */ + /* glyphs within the font. */ + /* */ + /* min_Bottom_Side_Bearing :: The minimum bottom side bearing of all */ + /* glyphs within the font. */ + /* */ + /* yMax_Extent :: The maximum vertical extent (i.e., the */ + /* `height' of a glyph's bounding box) for */ + /* all glyphs in the font. */ + /* */ + /* caret_Slope_Rise :: The rise coefficient of the cursor's */ + /* slope of the cursor (slope=rise/run). */ + /* */ + /* caret_Slope_Run :: The run coefficient of the cursor's */ + /* slope. */ + /* */ + /* caret_Offset :: The cursor's offset for slanted fonts. */ + /* This value is `reserved' in vmtx */ + /* version 1.0. */ + /* */ + /* Reserved :: 8 reserved bytes. */ + /* */ + /* metric_Data_Format :: Always 0. */ + /* */ + /* number_Of_HMetrics :: Number of VMetrics entries in the */ + /* `vmtx' table -- this value can be */ + /* smaller than the total number of glyphs */ + /* in the font. */ + /* */ + /* long_metrics :: A pointer into the `vmtx' table. */ + /* */ + /* short_metrics :: A pointer into the `vmtx' table. */ + /* */ + /* <Note> */ + /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */ + /* be identical except for the names of their fields which */ + /* are different. */ + /* */ + /* This ensures that a single function in the `ttload' */ + /* module is able to read both the horizontal and vertical */ + /* headers. */ + /* */ + typedef struct TT_VertHeader_ + { + FT_Fixed Version; + FT_Short Ascender; + FT_Short Descender; + FT_Short Line_Gap; + + FT_UShort advance_Height_Max; /* advance height maximum */ + + FT_Short min_Top_Side_Bearing; /* minimum left-sb or top-sb */ + FT_Short min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb */ + FT_Short yMax_Extent; /* xmax or ymax extents */ + FT_Short caret_Slope_Rise; + FT_Short caret_Slope_Run; + FT_Short caret_Offset; + + FT_Short Reserved[4]; + + FT_Short metric_Data_Format; + FT_UShort number_Of_VMetrics; + + /* The following fields are not defined by the TrueType specification */ + /* but they're used to connect the metrics header to the relevant */ + /* `HMTX' or `VMTX' table. */ + + void* long_metrics; + void* short_metrics; + + } TT_VertHeader; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* TT_OS2 */ + /* */ + /* <Description> */ + /* A structure used to model a TrueType OS/2 table. This is the long */ + /* table version. All fields comply to the TrueType specification. */ + /* */ + /* Note that we now support old Mac fonts which do not include an */ + /* OS/2 table. In this case, the `version' field is always set to */ + /* 0xFFFF. */ + /* */ + typedef struct TT_OS2_ + { + FT_UShort version; /* 0x0001 - more or 0xFFFF */ + FT_Short xAvgCharWidth; + FT_UShort usWeightClass; + FT_UShort usWidthClass; + FT_Short fsType; + FT_Short ySubscriptXSize; + FT_Short ySubscriptYSize; + FT_Short ySubscriptXOffset; + FT_Short ySubscriptYOffset; + FT_Short ySuperscriptXSize; + FT_Short ySuperscriptYSize; + FT_Short ySuperscriptXOffset; + FT_Short ySuperscriptYOffset; + FT_Short yStrikeoutSize; + FT_Short yStrikeoutPosition; + FT_Short sFamilyClass; + + FT_Byte panose[10]; + + FT_ULong ulUnicodeRange1; /* Bits 0-31 */ + FT_ULong ulUnicodeRange2; /* Bits 32-63 */ + FT_ULong ulUnicodeRange3; /* Bits 64-95 */ + FT_ULong ulUnicodeRange4; /* Bits 96-127 */ + + FT_Char achVendID[4]; + + FT_UShort fsSelection; + FT_UShort usFirstCharIndex; + FT_UShort usLastCharIndex; + FT_Short sTypoAscender; + FT_Short sTypoDescender; + FT_Short sTypoLineGap; + FT_UShort usWinAscent; + FT_UShort usWinDescent; + + /* only version 1 tables: */ + + FT_ULong ulCodePageRange1; /* Bits 0-31 */ + FT_ULong ulCodePageRange2; /* Bits 32-63 */ + + /* only version 2 tables: */ + + FT_Short sxHeight; + FT_Short sCapHeight; + FT_UShort usDefaultChar; + FT_UShort usBreakChar; + FT_UShort usMaxContext; + + } TT_OS2; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* TT_Postscript */ + /* */ + /* <Description> */ + /* A structure used to model a TrueType Postscript table. All fields */ + /* comply to the TrueType specification. This structure does not */ + /* reference the Postscript glyph names, which can be nevertheless */ + /* accessed with the `ttpost' module. */ + /* */ + typedef struct TT_Postscript_ + { + FT_Fixed FormatType; + FT_Fixed italicAngle; + FT_Short underlinePosition; + FT_Short underlineThickness; + FT_ULong isFixedPitch; + FT_ULong minMemType42; + FT_ULong maxMemType42; + FT_ULong minMemType1; + FT_ULong maxMemType1; + + /* Glyph names follow in the file, but we don't */ + /* load them by default. See the ttpost.c file. */ + + } TT_Postscript; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* TT_PCLT */ + /* */ + /* <Description> */ + /* A structure used to model a TrueType PCLT table. All fields */ + /* comply to the TrueType specification. */ + /* */ + typedef struct TT_PCLT_ + { + FT_Fixed Version; + FT_ULong FontNumber; + FT_UShort Pitch; + FT_UShort xHeight; + FT_UShort Style; + FT_UShort TypeFamily; + FT_UShort CapHeight; + FT_UShort SymbolSet; + FT_Char TypeFace[16]; + FT_Char CharacterComplement[8]; + FT_Char FileName[6]; + FT_Char StrokeWeight; + FT_Char WidthType; + FT_Byte SerifStyle; + FT_Byte Reserved; + + } TT_PCLT; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* TT_MaxProfile */ + /* */ + /* <Description> */ + /* The maximum profile is a table containing many max values which */ + /* can be used to pre-allocate arrays. This ensures that no memory */ + /* allocation occurs during a glyph load. */ + /* */ + /* <Fields> */ + /* version :: The version number. */ + /* */ + /* numGlyphs :: The number of glyphs in this TrueType */ + /* font. */ + /* */ + /* maxPoints :: The maximum number of points in a */ + /* non-composite TrueType glyph. See also */ + /* the structure element */ + /* `maxCompositePoints'. */ + /* */ + /* maxContours :: The maximum number of contours in a */ + /* non-composite TrueType glyph. See also */ + /* the structure element */ + /* `maxCompositeContours'. */ + /* */ + /* maxCompositePoints :: The maximum number of points in a */ + /* composite TrueType glyph. See also the */ + /* structure element `maxPoints'. */ + /* */ + /* maxCompositeContours :: The maximum number of contours in a */ + /* composite TrueType glyph. See also the */ + /* structure element `maxContours'. */ + /* */ + /* maxZones :: The maximum number of zones used for */ + /* glyph hinting. */ + /* */ + /* maxTwilightPoints :: The maximum number of points in the */ + /* twilight zone used for glyph hinting. */ + /* */ + /* maxStorage :: The maximum number of elements in the */ + /* storage area used for glyph hinting. */ + /* */ + /* maxFunctionDefs :: The maximum number of function */ + /* definitions in the TrueType bytecode for */ + /* this font. */ + /* */ + /* maxInstructionDefs :: The maximum number of instruction */ + /* definitions in the TrueType bytecode for */ + /* this font. */ + /* */ + /* maxStackElements :: The maximum number of stack elements used */ + /* during bytecode interpretation. */ + /* */ + /* maxSizeOfInstructions :: The maximum number of TrueType opcodes */ + /* used for glyph hinting. */ + /* */ + /* maxComponentElements :: The maximum number of simple (i.e., non- */ + /* composite) glyphs in a composite glyph. */ + /* */ + /* maxComponentDepth :: The maximum nesting depth of composite */ + /* glyphs. */ + /* */ + /* <Note> */ + /* This structure is only used during font loading. */ + /* */ + typedef struct TT_MaxProfile_ + { + FT_Fixed version; + FT_UShort numGlyphs; + FT_UShort maxPoints; + FT_UShort maxContours; + FT_UShort maxCompositePoints; + FT_UShort maxCompositeContours; + FT_UShort maxZones; + FT_UShort maxTwilightPoints; + FT_UShort maxStorage; + FT_UShort maxFunctionDefs; + FT_UShort maxInstructionDefs; + FT_UShort maxStackElements; + FT_UShort maxSizeOfInstructions; + FT_UShort maxComponentElements; + FT_UShort maxComponentDepth; + + } TT_MaxProfile; + + + /*************************************************************************/ + /* */ + /* <Enum> */ + /* FT_Sfnt_Tag */ + /* */ + /* <Description> */ + /* An enumeration used to specify the index of an SFNT table. */ + /* Used in the @FT_Get_Sfnt_Table API function. */ + /* */ + typedef enum + { + ft_sfnt_head = 0, + ft_sfnt_maxp = 1, + ft_sfnt_os2 = 2, + ft_sfnt_hhea = 3, + ft_sfnt_vhea = 4, + ft_sfnt_post = 5, + ft_sfnt_pclt = 6, + + sfnt_max /* internal end mark */ + + } FT_Sfnt_Tag; + + /* */ + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Get_Sfnt_Table */ + /* */ + /* <Description> */ + /* Returns a pointer to a given SFNT table within a face. */ + /* */ + /* <Input> */ + /* face :: A handle to the source. */ + /* */ + /* tag :: The index of the SFNT table. */ + /* */ + /* <Return> */ + /* A type-less pointer to the table. This will be 0 in case of */ + /* error, or if the corresponding table was not found *OR* loaded */ + /* from the file. */ + /* */ + /* <Note> */ + /* The table is owned by the face object and disappears with it. */ + /* */ + /* This function is only useful to access SFNT tables that are loaded */ + /* by the sfnt, truetype, and opentype drivers. See @FT_Sfnt_Tag for */ + /* a list. */ + /* */ + FT_EXPORT( void* ) + FT_Get_Sfnt_Table( FT_Face face, + FT_Sfnt_Tag tag ); + + + /************************************************************************** + * + * @function: + * FT_Load_Sfnt_Table + * + * @description: + * Loads any font table into client memory. + * + * @input: + * face :: + * A handle to the source face. + * + * tag :: + * The four-byte tag of the table to load. Use the value 0 if you want + * to access the whole font file. Otherwise, you can use one of the + * definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new + * one with @FT_MAKE_TAG. + * + * offset :: + * The starting offset in the table (or file if tag == 0). + * + * @output: + * buffer :: + * The target buffer address. The client must ensure that the memory + * array is big enough to hold the data. + * + * @inout: + * length :: + * If the `length' parameter is NULL, then try to load the whole table. + * Return an error code if it fails. + * + * Else, if `*length' is 0, exit immediately while returning the + * table's (or file) full size in it. + * + * Else the number of bytes to read from the table or file, from the + * starting offset. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * If you need to determine the table's length you should first call this + * function with `*length' set to 0, as in the following example: + * + * { + * FT_ULong length = 0; + * + * + * error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length ); + * if ( error ) { ... table does not exist ... } + * + * buffer = malloc( length ); + * if ( buffer == NULL ) { ... not enough memory ... } + * + * error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length ); + * if ( error ) { ... could not load table ... } + * } + */ + FT_EXPORT( FT_Error ) + FT_Load_Sfnt_Table( FT_Face face, + FT_ULong tag, + FT_Long offset, + FT_Byte* buffer, + FT_ULong* length ); + + + /************************************************************************** + * + * @function: + * FT_Sfnt_Table_Info + * + * @description: + * Returns information on an SFNT table. + * + * @input: + * face :: + * A handle to the source face. + * + * table_index :: + * The index of an SFNT table. The function returns + * FT_Err_Table_Missing for an invalid value. + * + * @output: + * tag :: + * The name tag of the SFNT table. + * + * length :: + * The length of the SFNT table. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * SFNT tables with length zero are treated as missing by Windows. + * + */ + FT_EXPORT( FT_Error ) + FT_Sfnt_Table_Info( FT_Face face, + FT_UInt table_index, + FT_ULong *tag, + FT_ULong *length ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Get_CMap_Language_ID */ + /* */ + /* <Description> */ + /* Return TrueType/sfnt specific cmap language ID. Definitions of */ + /* language ID values are in `freetype/ttnameid.h'. */ + /* */ + /* <Input> */ + /* charmap :: */ + /* The target charmap. */ + /* */ + /* <Return> */ + /* The language ID of `charmap'. If `charmap' doesn't belong to a */ + /* TrueType/sfnt face, just return 0 as the default value. */ + /* */ + FT_EXPORT( FT_ULong ) + FT_Get_CMap_Language_ID( FT_CharMap charmap ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Get_CMap_Format */ + /* */ + /* <Description> */ + /* Return TrueType/sfnt specific cmap format. */ + /* */ + /* <Input> */ + /* charmap :: */ + /* The target charmap. */ + /* */ + /* <Return> */ + /* The format of `charmap'. If `charmap' doesn't belong to a */ + /* TrueType/sfnt face, return -1. */ + /* */ + FT_EXPORT( FT_Long ) + FT_Get_CMap_Format( FT_CharMap charmap ); + + /* */ + + +FT_END_HEADER + +#endif /* __TTTABLES_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/tttags.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/tttags.h new file mode 100644 index 0000000000..e10244ca7c --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/tttags.h @@ -0,0 +1,99 @@ +/***************************************************************************/ +/* */ +/* tttags.h */ +/* */ +/* Tags for TrueType and OpenType tables (specification only). */ +/* */ +/* Copyright 1996-2001, 2004, 2005 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __TTAGS_H__ +#define __TTAGS_H__ + + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + +#define TTAG_avar FT_MAKE_TAG( 'a', 'v', 'a', 'r' ) +#define TTAG_BASE FT_MAKE_TAG( 'B', 'A', 'S', 'E' ) +#define TTAG_bdat FT_MAKE_TAG( 'b', 'd', 'a', 't' ) +#define TTAG_BDF FT_MAKE_TAG( 'B', 'D', 'F', ' ' ) +#define TTAG_bhed FT_MAKE_TAG( 'b', 'h', 'e', 'd' ) +#define TTAG_bloc FT_MAKE_TAG( 'b', 'l', 'o', 'c' ) +#define TTAG_bsln FT_MAKE_TAG( 'b', 's', 'l', 'n' ) +#define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' ) +#define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' ) +#define TTAG_cvar FT_MAKE_TAG( 'c', 'v', 'a', 'r' ) +#define TTAG_cvt FT_MAKE_TAG( 'c', 'v', 't', ' ' ) +#define TTAG_DSIG FT_MAKE_TAG( 'D', 'S', 'I', 'G' ) +#define TTAG_EBDT FT_MAKE_TAG( 'E', 'B', 'D', 'T' ) +#define TTAG_EBLC FT_MAKE_TAG( 'E', 'B', 'L', 'C' ) +#define TTAG_EBSC FT_MAKE_TAG( 'E', 'B', 'S', 'C' ) +#define TTAG_feat FT_MAKE_TAG( 'f', 'e', 'a', 't' ) +#define TTAG_fpgm FT_MAKE_TAG( 'f', 'p', 'g', 'm' ) +#define TTAG_fvar FT_MAKE_TAG( 'f', 'v', 'a', 'r' ) +#define TTAG_gasp FT_MAKE_TAG( 'g', 'a', 's', 'p' ) +#define TTAG_GDEF FT_MAKE_TAG( 'G', 'D', 'E', 'F' ) +#define TTAG_glyf FT_MAKE_TAG( 'g', 'l', 'y', 'f' ) +#define TTAG_GPOS FT_MAKE_TAG( 'G', 'P', 'O', 'S' ) +#define TTAG_GSUB FT_MAKE_TAG( 'G', 'S', 'U', 'B' ) +#define TTAG_gvar FT_MAKE_TAG( 'g', 'v', 'a', 'r' ) +#define TTAG_hdmx FT_MAKE_TAG( 'h', 'd', 'm', 'x' ) +#define TTAG_head FT_MAKE_TAG( 'h', 'e', 'a', 'd' ) +#define TTAG_hhea FT_MAKE_TAG( 'h', 'h', 'e', 'a' ) +#define TTAG_hmtx FT_MAKE_TAG( 'h', 'm', 't', 'x' ) +#define TTAG_JSTF FT_MAKE_TAG( 'J', 'S', 'T', 'F' ) +#define TTAG_just FT_MAKE_TAG( 'j', 'u', 's', 't' ) +#define TTAG_kern FT_MAKE_TAG( 'k', 'e', 'r', 'n' ) +#define TTAG_lcar FT_MAKE_TAG( 'l', 'c', 'a', 'r' ) +#define TTAG_loca FT_MAKE_TAG( 'l', 'o', 'c', 'a' ) +#define TTAG_LTSH FT_MAKE_TAG( 'L', 'T', 'S', 'H' ) +#define TTAG_maxp FT_MAKE_TAG( 'm', 'a', 'x', 'p' ) +#define TTAG_META FT_MAKE_TAG( 'M', 'E', 'T', 'A' ) +#define TTAG_MMFX FT_MAKE_TAG( 'M', 'M', 'F', 'X' ) +#define TTAG_MMSD FT_MAKE_TAG( 'M', 'M', 'S', 'D' ) +#define TTAG_mort FT_MAKE_TAG( 'm', 'o', 'r', 't' ) +#define TTAG_morx FT_MAKE_TAG( 'm', 'o', 'r', 'x' ) +#define TTAG_name FT_MAKE_TAG( 'n', 'a', 'm', 'e' ) +#define TTAG_opbd FT_MAKE_TAG( 'o', 'p', 'b', 'd' ) +#define TTAG_OS2 FT_MAKE_TAG( 'O', 'S', '/', '2' ) +#define TTAG_OTTO FT_MAKE_TAG( 'O', 'T', 'T', 'O' ) +#define TTAG_PCLT FT_MAKE_TAG( 'P', 'C', 'L', 'T' ) +#define TTAG_post FT_MAKE_TAG( 'p', 'o', 's', 't' ) +#define TTAG_prep FT_MAKE_TAG( 'p', 'r', 'e', 'p' ) +#define TTAG_prop FT_MAKE_TAG( 'p', 'r', 'o', 'p' ) +#define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' ) +#define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' ) +#define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' ) +#define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' ) +#define TTAG_ttcf FT_MAKE_TAG( 't', 't', 'c', 'f' ) +#define TTAG_VDMX FT_MAKE_TAG( 'V', 'D', 'M', 'X' ) +#define TTAG_vhea FT_MAKE_TAG( 'v', 'h', 'e', 'a' ) +#define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' ) + + +FT_END_HEADER + +#endif /* __TTAGS_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ttunpat.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ttunpat.h new file mode 100644 index 0000000000..a0162759b7 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/freetype/ttunpat.h @@ -0,0 +1,59 @@ +/***************************************************************************/ +/* */ +/* ttunpat.h */ +/* */ +/* Definitions for the unpatented TrueType hinting system */ +/* */ +/* Copyright 2003, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* Written by Graham Asher <graham.asher@btinternet.com> */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __TTUNPAT_H__ +#define __TTUNPAT_H__ + + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + + /*************************************************************************** + * + * @constant: + * FT_PARAM_TAG_UNPATENTED_HINTING + * + * @description: + * A constant used as the tag of an @FT_Parameter structure to indicate + * that unpatented methods only should be used by the TrueType bytecode + * interpreter for a typeface opened by @FT_Open_Face. + * + */ +#define FT_PARAM_TAG_UNPATENTED_HINTING FT_MAKE_TAG( 'u', 'n', 'p', 'a' ) + + /* */ + +FT_END_HEADER + + +#endif /* __TTUNPAT_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/ft2build.h b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/ft2build.h new file mode 100644 index 0000000000..6a3b8d90e9 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/include/ft2build.h @@ -0,0 +1,61 @@ +/***************************************************************************/ +/* */ +/* ft2build.h */ +/* */ +/* Build macros of the FreeType 2 library. */ +/* */ +/* Copyright 1996-2001, 2003, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This is a Unix-specific version of <ft2build.h> that should be used */ + /* exclusively *after* installation of the library. */ + /* */ + /* It assumes that `/usr/local/include/freetype2' (or whatever is */ + /* returned by the `freetype-config --cflags' or `pkg-config --cflags' */ + /* command) is in your compilation include path. */ + /* */ + /* We don't need to do anything special in this release. However, for */ + /* a future FreeType 2 release, the following installation changes will */ + /* be performed: */ + /* */ + /* - The contents of `freetype-2.x/include/freetype' will be installed */ + /* to `/usr/local/include/freetype2' instead of */ + /* `/usr/local/include/freetype2/freetype'. */ + /* */ + /* - This file will #include <freetype2/config/ftheader.h>, instead */ + /* of <freetype/config/ftheader.h>. */ + /* */ + /* - The contents of `ftheader.h' will be processed with `sed' to */ + /* replace all `<freetype/xxx>' with `<freetype2/xxx>'. */ + /* */ + /* - Adding `/usr/local/include/freetype2' to your compilation include */ + /* path will not be necessary anymore. */ + /* */ + /* These changes will be transparent to client applications which use */ + /* freetype-config (or pkg-config). No modifications will be necessary */ + /* to compile with the new scheme. */ + /* */ + /*************************************************************************/ + + +#ifndef __FT2_BUILD_UNIX_H__ +#define __FT2_BUILD_UNIX_H__ + + /* `<prefix>/include/freetype2' must be in your current inclusion path */ +#include <freetype/config/ftheader.h> + +#endif /* __FT2_BUILD_UNIX_H__ */ + + +/* END */ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/lib/freetype-bcc.lib b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/lib/freetype-bcc.lib new file mode 100644 index 0000000000..f2ae65ed8d Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/lib/freetype-bcc.lib differ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/lib/freetype.lib b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/lib/freetype.lib new file mode 100644 index 0000000000..983d4ddd74 Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/lib/freetype.lib differ diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/lib/freetype6.def b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/lib/freetype6.def new file mode 100644 index 0000000000..4f1a0789f7 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/lib/freetype6.def @@ -0,0 +1,249 @@ +LIBRARY freetype6.dll +EXPORTS +DllGetVersion +FTC_CMapCache_Lookup +FTC_CMapCache_New +FTC_ImageCache_Lookup +FTC_ImageCache_LookupScaler +FTC_ImageCache_New +FTC_Manager_Done +FTC_Manager_LookupFace +FTC_Manager_LookupSize +FTC_Manager_New +FTC_Manager_RemoveFaceID +FTC_Manager_Reset +FTC_Node_Unref +FTC_SBitCache_Lookup +FTC_SBitCache_LookupScaler +FTC_SBitCache_New +FT_Activate_Size +FT_Add_Default_Modules +FT_Add_Module +FT_Angle_Diff +FT_Atan2 +FT_Attach_File +FT_Attach_Stream +FT_Bitmap_Convert +FT_Bitmap_Copy +FT_Bitmap_Done +FT_Bitmap_Embolden +FT_Bitmap_New +FT_CMap_Done +FT_CMap_New +FT_CeilFix +FT_ClassicKern_Free +FT_ClassicKern_Validate +FT_Cos +FT_DivFix +FT_Done_Face +FT_Done_FreeType +FT_Done_Glyph +FT_Done_GlyphSlot +FT_Done_Library +FT_Done_Memory +FT_Done_Size +FT_Face_CheckTrueTypePatents +FT_Face_SetUnpatentedHinting +FT_FloorFix +FT_Get_BDF_Charset_ID +FT_Get_BDF_Property +FT_Get_CMap_Format +FT_Get_CMap_Language_ID +FT_Get_Char_Index +FT_Get_Charmap_Index +FT_Get_First_Char +FT_Get_Gasp +FT_Get_Glyph +FT_Get_Glyph_Name +FT_Get_Kerning +FT_Get_MM_Var +FT_Get_Module +FT_Get_Module_Interface +FT_Get_Multi_Master +FT_Get_Name_Index +FT_Get_Next_Char +FT_Get_PFR_Advance +FT_Get_PFR_Kerning +FT_Get_PFR_Metrics +FT_Get_PS_Font_Info +FT_Get_PS_Font_Private +FT_Get_Postscript_Name +FT_Get_Renderer +FT_Get_Sfnt_Name +FT_Get_Sfnt_Name_Count +FT_Get_Sfnt_Table +FT_Get_SubGlyph_Info +FT_Get_Track_Kerning +FT_Get_TrueType_Engine_Type +FT_Get_WinFNT_Header +FT_Get_X11_Font_Format +FT_GlyphLoader_Add +FT_GlyphLoader_CheckPoints +FT_GlyphLoader_CheckSubGlyphs +FT_GlyphLoader_CopyPoints +FT_GlyphLoader_CreateExtra +FT_GlyphLoader_Done +FT_GlyphLoader_New +FT_GlyphLoader_Prepare +FT_GlyphLoader_Reset +FT_GlyphLoader_Rewind +FT_GlyphSlot_Embolden +FT_GlyphSlot_Oblique +FT_GlyphSlot_Own_Bitmap +FT_Glyph_Copy +FT_Glyph_Get_CBox +FT_Glyph_Stroke +FT_Glyph_StrokeBorder +FT_Glyph_To_Bitmap +FT_Glyph_Transform +FT_Has_PS_Glyph_Names +FT_Init_FreeType +FT_Library_SetLcdFilter +FT_Library_Version +FT_List_Add +FT_List_Finalize +FT_List_Find +FT_List_Insert +FT_List_Iterate +FT_List_Remove +FT_List_Up +FT_Load_Char +FT_Load_Glyph +FT_Load_Sfnt_Table +FT_Lookup_Renderer +FT_Match_Size +FT_Matrix_Invert +FT_Matrix_Multiply +FT_MulDiv +FT_MulDiv_No_Round +FT_MulFix +FT_New_Face +FT_New_GlyphSlot +FT_New_Library +FT_New_Memory +FT_New_Memory_Face +FT_New_Size +FT_OpenType_Free +FT_OpenType_Validate +FT_Open_Face +FT_Outline_Check +FT_Outline_Copy +FT_Outline_Decompose +FT_Outline_Done +FT_Outline_Done_Internal +FT_Outline_Embolden +FT_Outline_GetInsideBorder +FT_Outline_GetOutsideBorder +FT_Outline_Get_BBox +FT_Outline_Get_Bitmap +FT_Outline_Get_CBox +FT_Outline_Get_Orientation +FT_Outline_New +FT_Outline_New_Internal +FT_Outline_Render +FT_Outline_Reverse +FT_Outline_Transform +FT_Outline_Translate +FT_Raccess_Get_DataOffsets +FT_Raccess_Get_HeaderInfo +FT_Raccess_Guess +FT_Remove_Module +FT_Render_Glyph +FT_Render_Glyph_Internal +FT_Request_Metrics +FT_Request_Size +FT_RoundFix +FT_Select_Charmap +FT_Select_Metrics +FT_Select_Size +FT_Set_Char_Size +FT_Set_Charmap +FT_Set_Debug_Hook +FT_Set_MM_Blend_Coordinates +FT_Set_MM_Design_Coordinates +FT_Set_Pixel_Sizes +FT_Set_Renderer +FT_Set_Transform +FT_Set_Var_Blend_Coordinates +FT_Set_Var_Design_Coordinates +FT_Sfnt_Table_Info +FT_Sin +FT_SqrtFixed +FT_Stream_Close +FT_Stream_EnterFrame +FT_Stream_ExitFrame +FT_Stream_ExtractFrame +FT_Stream_Free +FT_Stream_GetChar +FT_Stream_GetLong +FT_Stream_GetLongLE +FT_Stream_GetOffset +FT_Stream_GetShort +FT_Stream_GetShortLE +FT_Stream_New +FT_Stream_Open +FT_Stream_OpenGzip +FT_Stream_OpenLZW +FT_Stream_OpenMemory +FT_Stream_Pos +FT_Stream_Read +FT_Stream_ReadAt +FT_Stream_ReadChar +FT_Stream_ReadFields +FT_Stream_ReadLong +FT_Stream_ReadLongLE +FT_Stream_ReadOffset +FT_Stream_ReadShort +FT_Stream_ReadShortLE +FT_Stream_ReleaseFrame +FT_Stream_Seek +FT_Stream_Skip +FT_Stream_TryRead +FT_Stroker_BeginSubPath +FT_Stroker_ConicTo +FT_Stroker_CubicTo +FT_Stroker_Done +FT_Stroker_EndSubPath +FT_Stroker_Export +FT_Stroker_ExportBorder +FT_Stroker_GetBorderCounts +FT_Stroker_GetCounts +FT_Stroker_LineTo +FT_Stroker_New +FT_Stroker_ParseOutline +FT_Stroker_Rewind +FT_Stroker_Set +FT_Tan +FT_Trace_Get_Count +FT_Trace_Get_Name +FT_TrueTypeGX_Free +FT_TrueTypeGX_Validate +FT_Vector_From_Polar +FT_Vector_Length +FT_Vector_Polarize +FT_Vector_Rotate +FT_Vector_Transform +FT_Vector_Unit +TT_New_Context +TT_RunIns +ft_corner_is_flat +ft_corner_orientation +ft_debug_init +ft_glyphslot_alloc_bitmap +ft_glyphslot_free_bitmap +ft_glyphslot_set_bitmap +ft_highpow2 +ft_mem_alloc +ft_mem_dup +ft_mem_free +ft_mem_qalloc +ft_mem_qrealloc +ft_mem_realloc +ft_mem_strcpyn +ft_mem_strdup +ft_module_get_service +ft_service_list_lookup +ft_synthesize_vertical_metrics +ft_validator_error +ft_validator_init +ft_validator_run diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/lib/pkgconfig/freetype2.pc b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/lib/pkgconfig/freetype2.pc new file mode 100644 index 0000000000..8f83614915 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/lib/pkgconfig/freetype2.pc @@ -0,0 +1,11 @@ +prefix=c:/progra~1/FreeType +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: FreeType 2 +Description: A free, high-quality, and portable font engine. +Version: 9.16.3 +Requires: +Libs: -L${libdir} -lfreetype -lz +Cflags: -I${includedir}/freetype2 -I${includedir} diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/manifest/freetype-2.3.5-1-lib.mft b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/manifest/freetype-2.3.5-1-lib.mft new file mode 100644 index 0000000000..8b7493dbbf --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/manifest/freetype-2.3.5-1-lib.mft @@ -0,0 +1,52 @@ +include/freetype2/freetype/config/ftconfig.h 3ce7a8efabd699612faec89955795e3c +include/freetype2/freetype/config/ftheader.h 6ce690c7c63734ab6a5836c42b177b2e +include/freetype2/freetype/config/ftmodule.h b7150134e91ba6678ad00dac902b5c13 +include/freetype2/freetype/config/ftoption.h ff69502049084dea99baa19d09509e98 +include/freetype2/freetype/config/ftstdlib.h 550d16d552e853b703a0918e0f554cda +include/freetype2/freetype/freetype.h 39c788c15f84d4644ffe6748f2250ebc +include/freetype2/freetype/ftbbox.h 52af19197041bd8822475ce38f6a4ef6 +include/freetype2/freetype/ftbdf.h aa5f50be1d6f5ebf935ebd8a26dfb501 +include/freetype2/freetype/ftbitmap.h 50773b667c338a6cf8f14747cc9c14ea +include/freetype2/freetype/ftcache.h a2c39fa62a57f3f84551e17076f5e13e +include/freetype2/freetype/ftchapters.h 561596f7a114385257011882a5f55fb1 +include/freetype2/freetype/fterrdef.h 5a3d286ba7d11623bdf1a4c447664f21 +include/freetype2/freetype/fterrors.h 1ab702bcd64b97d7ae63b0c92d9e9777 +include/freetype2/freetype/ftgasp.h edbc403d27631244f162516c45ea265f +include/freetype2/freetype/ftglyph.h 4feb0626279582737d5c447345780862 +include/freetype2/freetype/ftgxval.h 1f2c5d28a8f76a48a77c95a5fa8fd6ce +include/freetype2/freetype/ftgzip.h 46b61871ce42e6c98e54295bffde38c6 +include/freetype2/freetype/ftimage.h d101d656e099e08678aaf821d98df18a +include/freetype2/freetype/ftincrem.h dadd2dbb4c077389339a668a4cd07653 +include/freetype2/freetype/ftlcdfil.h 7b1f37094b785271f0995d67d815d911 +include/freetype2/freetype/ftlist.h 351fc9009b04204aa254b35332a79ea4 +include/freetype2/freetype/ftlzw.h aa04c7514dda80c0f32574e56be6e7ad +include/freetype2/freetype/ftmac.h 7ebb9138e4814aa910b8f64062ab4f20 +include/freetype2/freetype/ftmm.h 4a77badfe70f3a259d0c398f7da9363b +include/freetype2/freetype/ftmodapi.h d073f664c8160f82fb31a35b417b4ec9 +include/freetype2/freetype/ftmoderr.h 75207cedd1cf30390efd6f05bfdd4c88 +include/freetype2/freetype/ftotval.h dca0b109c0e866d02a0b79fcb0f4e608 +include/freetype2/freetype/ftoutln.h 38f19261b140e7e93e72aea45421249d +include/freetype2/freetype/ftpfr.h 8d6dc3473132762658e693ec2ffaa1cb +include/freetype2/freetype/ftrender.h 525fa0c9b1ac515eaca23331bdade14c +include/freetype2/freetype/ftsizes.h 6d78139a2e5fd9011b49382804a9dd7f +include/freetype2/freetype/ftsnames.h ff5840bf6535587ecb1983108b5b96dc +include/freetype2/freetype/ftstroke.h 62bd845c3bb9c41c8cf6e2d198564c38 +include/freetype2/freetype/ftsynth.h a6c452e9e980b25bbb9b0b4171f15a93 +include/freetype2/freetype/ftsystem.h a5502d20cbc546e8536f385a0b8a83a0 +include/freetype2/freetype/fttrigon.h 5477d1913ded727d29770d097d520b0e +include/freetype2/freetype/fttypes.h f8ebc33939fa7063c02a4d89b1d56e79 +include/freetype2/freetype/ftwinfnt.h d2b7504e8a5acb39f6fce9fb5ca9c688 +include/freetype2/freetype/ftxf86.h 3778ca890ef579a14ef0234ee0f15cc6 +include/freetype2/freetype/t1tables.h 91e5e4214cd1b45ac9bd542fa1a5e792 +include/freetype2/freetype/ttnameid.h 795ae10946b5148487f9c6e5c29f16ab +include/freetype2/freetype/tttables.h e6f7e0a1408a0101a3a970c084e29afc +include/freetype2/freetype/tttags.h 89cf88621708e37e92e6936c1cb77128 +include/freetype2/freetype/ttunpat.h e1dbf916c043ea70a5a2f045b9b4d951 +include/ft2build.h 4d5898dd06dd01e43d2932b9765f0e76 +lib/freetype-bcc.lib 479e6cae5751c47af3d6ffea3b560524 +lib/freetype.lib 0750bf4d5c6967ab08b89f11c8aaeb4f +lib/freetype6.def da9782d2d68b8253319af765f18c15fc +lib/libfreetype.dll.a 3da7dba0bf9cbc225320cf396be0bef8 +lib/pkgconfig/freetype2.pc 581cd391604dcb52eaa40ba902936e29 +manifest/freetype-2.3.5-1-lib.mft +manifest/freetype-2.3.5-1-lib.ver b580848149ea3fd77d90d5cda8f4403a diff --git a/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/manifest/freetype-2.3.5-1-lib.ver b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/manifest/freetype-2.3.5-1-lib.ver new file mode 100644 index 0000000000..efe5a3f1a0 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/freetype-2.3.5-1/manifest/freetype-2.3.5-1-lib.ver @@ -0,0 +1 @@ +FreeType-2.3.5 (font engine and rasterizer): Developer files diff --git a/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/bin/libpng-config b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/bin/libpng-config new file mode 100644 index 0000000000..3c39bc9975 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/bin/libpng-config @@ -0,0 +1,124 @@ +#! /bin/sh + +# libpng-config +# provides configuration info for libpng. + +# Copyright (C) 2002, 2004, 2006, 2007 Glenn Randers-Pehrson +# For conditions of distribution and use, see copyright notice in png.h + +# Modeled after libxml-config. + +version="1.2.37" +prefix="c:/progra~1/libpng" +exec_prefix="${prefix}" +libdir="${exec_prefix}/lib" +includedir="${prefix}/include/libpng12" +libs="-lpng12" +all_libs="-lpng12 -lz +I_opts="-I${includedir}" +L_opts="-L${libdir}" +R_opts="" +cppflags="" +ccopts="" +ldopts="" + +usage() +{ + cat <<EOF +Usage: $0 [OPTION] ... + +Known values for OPTION are: + + --prefix print libpng prefix + --libdir print path to directory containing library + --libs print library linking information + --ccopts print compiler options + --cppflags print pre-processor flags + --cflags print preprocessor flags, I_opts, and compiler options + --I_opts print "-I" include options + --L_opts print linker "-L" flags for dynamic linking + --R_opts print dynamic linker "-R" or "-rpath" flags + --ldopts print linker options + --ldflags print linker flags (ldopts, L_opts, R_opts, and libs) + --static revise subsequent outputs for static linking + --help print this help and exit + --version print version information +EOF + + exit $1 +} + +if test $# -eq 0; then + usage 1 +fi + +while test $# -gt 0; do + case "$1" in + + --prefix) + echo ${prefix} + ;; + + --version) + echo ${version} + exit 0 + ;; + + --help) + usage 0 + ;; + + --ccopts) + echo ${ccopts} + ;; + + --cppflags) + echo ${cppflags} + ;; + + --cflags) + echo ${I_opts} ${cppflags} ${ccopts} + ;; + + --libdir) + echo ${libdir} + ;; + + --libs) + echo ${libs} + ;; + + --I_opts) + echo ${I_opts} + ;; + + --L_opts) + echo ${L_opts} + ;; + + --R_opts) + echo ${R_opts} + ;; + + --ldopts) + echo ${ldopts} + ;; + + --ldflags) + echo ${ldopts} ${L_opts} ${R_opts} ${libs} + ;; + + --static) + R_opts="" + libs=${all_libs} + ;; + + *) + usage + exit 1 + ;; + esac + shift +done + +exit 0 diff --git a/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/bin/libpng12-config b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/bin/libpng12-config new file mode 100644 index 0000000000..3c39bc9975 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/bin/libpng12-config @@ -0,0 +1,124 @@ +#! /bin/sh + +# libpng-config +# provides configuration info for libpng. + +# Copyright (C) 2002, 2004, 2006, 2007 Glenn Randers-Pehrson +# For conditions of distribution and use, see copyright notice in png.h + +# Modeled after libxml-config. + +version="1.2.37" +prefix="c:/progra~1/libpng" +exec_prefix="${prefix}" +libdir="${exec_prefix}/lib" +includedir="${prefix}/include/libpng12" +libs="-lpng12" +all_libs="-lpng12 -lz +I_opts="-I${includedir}" +L_opts="-L${libdir}" +R_opts="" +cppflags="" +ccopts="" +ldopts="" + +usage() +{ + cat <<EOF +Usage: $0 [OPTION] ... + +Known values for OPTION are: + + --prefix print libpng prefix + --libdir print path to directory containing library + --libs print library linking information + --ccopts print compiler options + --cppflags print pre-processor flags + --cflags print preprocessor flags, I_opts, and compiler options + --I_opts print "-I" include options + --L_opts print linker "-L" flags for dynamic linking + --R_opts print dynamic linker "-R" or "-rpath" flags + --ldopts print linker options + --ldflags print linker flags (ldopts, L_opts, R_opts, and libs) + --static revise subsequent outputs for static linking + --help print this help and exit + --version print version information +EOF + + exit $1 +} + +if test $# -eq 0; then + usage 1 +fi + +while test $# -gt 0; do + case "$1" in + + --prefix) + echo ${prefix} + ;; + + --version) + echo ${version} + exit 0 + ;; + + --help) + usage 0 + ;; + + --ccopts) + echo ${ccopts} + ;; + + --cppflags) + echo ${cppflags} + ;; + + --cflags) + echo ${I_opts} ${cppflags} ${ccopts} + ;; + + --libdir) + echo ${libdir} + ;; + + --libs) + echo ${libs} + ;; + + --I_opts) + echo ${I_opts} + ;; + + --L_opts) + echo ${L_opts} + ;; + + --R_opts) + echo ${R_opts} + ;; + + --ldopts) + echo ${ldopts} + ;; + + --ldflags) + echo ${ldopts} ${L_opts} ${R_opts} ${libs} + ;; + + --static) + R_opts="" + libs=${all_libs} + ;; + + *) + usage + exit 1 + ;; + esac + shift +done + +exit 0 diff --git a/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/bin/libpng12.dll b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/bin/libpng12.dll new file mode 100644 index 0000000000..25c0a7c8ee Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/bin/libpng12.dll differ diff --git a/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/bin/libpng3.dll b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/bin/libpng3.dll new file mode 100644 index 0000000000..649ec64897 Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/bin/libpng3.dll differ diff --git a/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/include/libpng12/png.h b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/include/libpng12/png.h new file mode 100644 index 0000000000..9fc8cefdcc --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/include/libpng12/png.h @@ -0,0 +1,3687 @@ +/* png.h - header file for PNG reference library + * + * libpng version 1.2.37 - June 4, 2009 + * Copyright (c) 1998-2009 Glenn Randers-Pehrson + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * + * Authors and maintainers: + * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat + * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger + * libpng versions 0.97, January 1998, through 1.2.37 - June 4, 2009: Glenn + * See also "Contributing Authors", below. + * + * Note about libpng version numbers: + * + * Due to various miscommunications, unforeseen code incompatibilities + * and occasional factors outside the authors' control, version numbering + * on the library has not always been consistent and straightforward. + * The following table summarizes matters since version 0.89c, which was + * the first widely used release: + * + * source png.h png.h shared-lib + * version string int version + * ------- ------ ----- ---------- + * 0.89c "1.0 beta 3" 0.89 89 1.0.89 + * 0.90 "1.0 beta 4" 0.90 90 0.90 [should have been 2.0.90] + * 0.95 "1.0 beta 5" 0.95 95 0.95 [should have been 2.0.95] + * 0.96 "1.0 beta 6" 0.96 96 0.96 [should have been 2.0.96] + * 0.97b "1.00.97 beta 7" 1.00.97 97 1.0.1 [should have been 2.0.97] + * 0.97c 0.97 97 2.0.97 + * 0.98 0.98 98 2.0.98 + * 0.99 0.99 98 2.0.99 + * 0.99a-m 0.99 99 2.0.99 + * 1.00 1.00 100 2.1.0 [100 should be 10000] + * 1.0.0 (from here on, the 100 2.1.0 [100 should be 10000] + * 1.0.1 png.h string is 10001 2.1.0 + * 1.0.1a-e identical to the 10002 from here on, the shared library + * 1.0.2 source version) 10002 is 2.V where V is the source code + * 1.0.2a-b 10003 version, except as noted. + * 1.0.3 10003 + * 1.0.3a-d 10004 + * 1.0.4 10004 + * 1.0.4a-f 10005 + * 1.0.5 (+ 2 patches) 10005 + * 1.0.5a-d 10006 + * 1.0.5e-r 10100 (not source compatible) + * 1.0.5s-v 10006 (not binary compatible) + * 1.0.6 (+ 3 patches) 10006 (still binary incompatible) + * 1.0.6d-f 10007 (still binary incompatible) + * 1.0.6g 10007 + * 1.0.6h 10007 10.6h (testing xy.z so-numbering) + * 1.0.6i 10007 10.6i + * 1.0.6j 10007 2.1.0.6j (incompatible with 1.0.0) + * 1.0.7beta11-14 DLLNUM 10007 2.1.0.7beta11-14 (binary compatible) + * 1.0.7beta15-18 1 10007 2.1.0.7beta15-18 (binary compatible) + * 1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible) + * 1.0.7 1 10007 (still compatible) + * 1.0.8beta1-4 1 10008 2.1.0.8beta1-4 + * 1.0.8rc1 1 10008 2.1.0.8rc1 + * 1.0.8 1 10008 2.1.0.8 + * 1.0.9beta1-6 1 10009 2.1.0.9beta1-6 + * 1.0.9rc1 1 10009 2.1.0.9rc1 + * 1.0.9beta7-10 1 10009 2.1.0.9beta7-10 + * 1.0.9rc2 1 10009 2.1.0.9rc2 + * 1.0.9 1 10009 2.1.0.9 + * 1.0.10beta1 1 10010 2.1.0.10beta1 + * 1.0.10rc1 1 10010 2.1.0.10rc1 + * 1.0.10 1 10010 2.1.0.10 + * 1.0.11beta1-3 1 10011 2.1.0.11beta1-3 + * 1.0.11rc1 1 10011 2.1.0.11rc1 + * 1.0.11 1 10011 2.1.0.11 + * 1.0.12beta1-2 2 10012 2.1.0.12beta1-2 + * 1.0.12rc1 2 10012 2.1.0.12rc1 + * 1.0.12 2 10012 2.1.0.12 + * 1.1.0a-f - 10100 2.1.1.0a-f (branch abandoned) + * 1.2.0beta1-2 2 10200 2.1.2.0beta1-2 + * 1.2.0beta3-5 3 10200 3.1.2.0beta3-5 + * 1.2.0rc1 3 10200 3.1.2.0rc1 + * 1.2.0 3 10200 3.1.2.0 + * 1.2.1beta1-4 3 10201 3.1.2.1beta1-4 + * 1.2.1rc1-2 3 10201 3.1.2.1rc1-2 + * 1.2.1 3 10201 3.1.2.1 + * 1.2.2beta1-6 12 10202 12.so.0.1.2.2beta1-6 + * 1.0.13beta1 10 10013 10.so.0.1.0.13beta1 + * 1.0.13rc1 10 10013 10.so.0.1.0.13rc1 + * 1.2.2rc1 12 10202 12.so.0.1.2.2rc1 + * 1.0.13 10 10013 10.so.0.1.0.13 + * 1.2.2 12 10202 12.so.0.1.2.2 + * 1.2.3rc1-6 12 10203 12.so.0.1.2.3rc1-6 + * 1.2.3 12 10203 12.so.0.1.2.3 + * 1.2.4beta1-3 13 10204 12.so.0.1.2.4beta1-3 + * 1.0.14rc1 13 10014 10.so.0.1.0.14rc1 + * 1.2.4rc1 13 10204 12.so.0.1.2.4rc1 + * 1.0.14 10 10014 10.so.0.1.0.14 + * 1.2.4 13 10204 12.so.0.1.2.4 + * 1.2.5beta1-2 13 10205 12.so.0.1.2.5beta1-2 + * 1.0.15rc1-3 10 10015 10.so.0.1.0.15rc1-3 + * 1.2.5rc1-3 13 10205 12.so.0.1.2.5rc1-3 + * 1.0.15 10 10015 10.so.0.1.0.15 + * 1.2.5 13 10205 12.so.0.1.2.5 + * 1.2.6beta1-4 13 10206 12.so.0.1.2.6beta1-4 + * 1.0.16 10 10016 10.so.0.1.0.16 + * 1.2.6 13 10206 12.so.0.1.2.6 + * 1.2.7beta1-2 13 10207 12.so.0.1.2.7beta1-2 + * 1.0.17rc1 10 10017 10.so.0.1.0.17rc1 + * 1.2.7rc1 13 10207 12.so.0.1.2.7rc1 + * 1.0.17 10 10017 10.so.0.1.0.17 + * 1.2.7 13 10207 12.so.0.1.2.7 + * 1.2.8beta1-5 13 10208 12.so.0.1.2.8beta1-5 + * 1.0.18rc1-5 10 10018 10.so.0.1.0.18rc1-5 + * 1.2.8rc1-5 13 10208 12.so.0.1.2.8rc1-5 + * 1.0.18 10 10018 10.so.0.1.0.18 + * 1.2.8 13 10208 12.so.0.1.2.8 + * 1.2.9beta1-3 13 10209 12.so.0.1.2.9beta1-3 + * 1.2.9beta4-11 13 10209 12.so.0.9[.0] + * 1.2.9rc1 13 10209 12.so.0.9[.0] + * 1.2.9 13 10209 12.so.0.9[.0] + * 1.2.10beta1-8 13 10210 12.so.0.10[.0] + * 1.2.10rc1-3 13 10210 12.so.0.10[.0] + * 1.2.10 13 10210 12.so.0.10[.0] + * 1.2.11beta1-4 13 10211 12.so.0.11[.0] + * 1.0.19rc1-5 10 10019 10.so.0.19[.0] + * 1.2.11rc1-5 13 10211 12.so.0.11[.0] + * 1.0.19 10 10019 10.so.0.19[.0] + * 1.2.11 13 10211 12.so.0.11[.0] + * 1.0.20 10 10020 10.so.0.20[.0] + * 1.2.12 13 10212 12.so.0.12[.0] + * 1.2.13beta1 13 10213 12.so.0.13[.0] + * 1.0.21 10 10021 10.so.0.21[.0] + * 1.2.13 13 10213 12.so.0.13[.0] + * 1.2.14beta1-2 13 10214 12.so.0.14[.0] + * 1.0.22rc1 10 10022 10.so.0.22[.0] + * 1.2.14rc1 13 10214 12.so.0.14[.0] + * 1.0.22 10 10022 10.so.0.22[.0] + * 1.2.14 13 10214 12.so.0.14[.0] + * 1.2.15beta1-6 13 10215 12.so.0.15[.0] + * 1.0.23rc1-5 10 10023 10.so.0.23[.0] + * 1.2.15rc1-5 13 10215 12.so.0.15[.0] + * 1.0.23 10 10023 10.so.0.23[.0] + * 1.2.15 13 10215 12.so.0.15[.0] + * 1.2.16beta1-2 13 10216 12.so.0.16[.0] + * 1.2.16rc1 13 10216 12.so.0.16[.0] + * 1.0.24 10 10024 10.so.0.24[.0] + * 1.2.16 13 10216 12.so.0.16[.0] + * 1.2.17beta1-2 13 10217 12.so.0.17[.0] + * 1.0.25rc1 10 10025 10.so.0.25[.0] + * 1.2.17rc1-3 13 10217 12.so.0.17[.0] + * 1.0.25 10 10025 10.so.0.25[.0] + * 1.2.17 13 10217 12.so.0.17[.0] + * 1.0.26 10 10026 10.so.0.26[.0] + * 1.2.18 13 10218 12.so.0.18[.0] + * 1.2.19beta1-31 13 10219 12.so.0.19[.0] + * 1.0.27rc1-6 10 10027 10.so.0.27[.0] + * 1.2.19rc1-6 13 10219 12.so.0.19[.0] + * 1.0.27 10 10027 10.so.0.27[.0] + * 1.2.19 13 10219 12.so.0.19[.0] + * 1.2.20beta01-04 13 10220 12.so.0.20[.0] + * 1.0.28rc1-6 10 10028 10.so.0.28[.0] + * 1.2.20rc1-6 13 10220 12.so.0.20[.0] + * 1.0.28 10 10028 10.so.0.28[.0] + * 1.2.20 13 10220 12.so.0.20[.0] + * 1.2.21beta1-2 13 10221 12.so.0.21[.0] + * 1.2.21rc1-3 13 10221 12.so.0.21[.0] + * 1.0.29 10 10029 10.so.0.29[.0] + * 1.2.21 13 10221 12.so.0.21[.0] + * 1.2.22beta1-4 13 10222 12.so.0.22[.0] + * 1.0.30rc1 10 10030 10.so.0.30[.0] + * 1.2.22rc1 13 10222 12.so.0.22[.0] + * 1.0.30 10 10030 10.so.0.30[.0] + * 1.2.22 13 10222 12.so.0.22[.0] + * 1.2.23beta01-05 13 10223 12.so.0.23[.0] + * 1.2.23rc01 13 10223 12.so.0.23[.0] + * 1.2.23 13 10223 12.so.0.23[.0] + * 1.2.24beta01-02 13 10224 12.so.0.24[.0] + * 1.2.24rc01 13 10224 12.so.0.24[.0] + * 1.2.24 13 10224 12.so.0.24[.0] + * 1.2.25beta01-06 13 10225 12.so.0.25[.0] + * 1.2.25rc01-02 13 10225 12.so.0.25[.0] + * 1.0.31 10 10031 10.so.0.31[.0] + * 1.2.25 13 10225 12.so.0.25[.0] + * 1.2.26beta01-06 13 10226 12.so.0.26[.0] + * 1.2.26rc01 13 10226 12.so.0.26[.0] + * 1.2.26 13 10226 12.so.0.26[.0] + * 1.0.32 10 10032 10.so.0.32[.0] + * 1.2.27beta01-06 13 10227 12.so.0.27[.0] + * 1.2.27rc01 13 10227 12.so.0.27[.0] + * 1.0.33 10 10033 10.so.0.33[.0] + * 1.2.27 13 10227 12.so.0.27[.0] + * 1.0.34 10 10034 10.so.0.34[.0] + * 1.2.28 13 10228 12.so.0.28[.0] + * 1.2.29beta01-03 13 10229 12.so.0.29[.0] + * 1.2.29rc01 13 10229 12.so.0.29[.0] + * 1.0.35 10 10035 10.so.0.35[.0] + * 1.2.29 13 10229 12.so.0.29[.0] + * 1.0.37 10 10037 10.so.0.37[.0] + * 1.2.30beta01-04 13 10230 12.so.0.30[.0] + * 1.0.38rc01-08 10 10038 10.so.0.38[.0] + * 1.2.30rc01-08 13 10230 12.so.0.30[.0] + * 1.0.38 10 10038 10.so.0.38[.0] + * 1.2.30 13 10230 12.so.0.30[.0] + * 1.0.39rc01-03 10 10039 10.so.0.39[.0] + * 1.2.31rc01-03 13 10231 12.so.0.31[.0] + * 1.0.39 10 10039 10.so.0.39[.0] + * 1.2.31 13 10231 12.so.0.31[.0] + * 1.2.32beta01-02 13 10232 12.so.0.32[.0] + * 1.0.40rc01 10 10040 10.so.0.40[.0] + * 1.2.32rc01 13 10232 12.so.0.32[.0] + * 1.0.40 10 10040 10.so.0.40[.0] + * 1.2.32 13 10232 12.so.0.32[.0] + * 1.2.33beta01-02 13 10233 12.so.0.33[.0] + * 1.2.33rc01-02 13 10233 12.so.0.33[.0] + * 1.0.41rc01 10 10041 10.so.0.41[.0] + * 1.2.33 13 10233 12.so.0.33[.0] + * 1.0.41 10 10041 10.so.0.41[.0] + * 1.2.34beta01-07 13 10234 12.so.0.34[.0] + * 1.0.42rc01 10 10042 10.so.0.42[.0] + * 1.2.34rc01 13 10234 12.so.0.34[.0] + * 1.0.42 10 10042 10.so.0.42[.0] + * 1.2.34 13 10234 12.so.0.34[.0] + * 1.2.35beta01-03 13 10235 12.so.0.35[.0] + * 1.0.43rc01-02 10 10043 10.so.0.43[.0] + * 1.2.35rc01-02 13 10235 12.so.0.35[.0] + * 1.0.43 10 10043 10.so.0.43[.0] + * 1.2.35 13 10235 12.so.0.35[.0] + * 1.2.36beta01-05 13 10236 12.so.0.36[.0] + * 1.2.36rc01 13 10236 12.so.0.36[.0] + * 1.0.44 10 10044 10.so.0.44[.0] + * 1.2.36 13 10236 12.so.0.36[.0] + * 1.2.37beta01-03 13 10237 12.so.0.37[.0] + * 1.2.37rc01 13 10237 12.so.0.37[.0] + * 1.2.37 13 10237 12.so.0.37[.0] + * + * Henceforth the source version will match the shared-library major + * and minor numbers; the shared-library major version number will be + * used for changes in backward compatibility, as it is intended. The + * PNG_LIBPNG_VER macro, which is not used within libpng but is available + * for applications, is an unsigned integer of the form xyyzz corresponding + * to the source version x.y.z (leading zeros in y and z). Beta versions + * were given the previous public release number plus a letter, until + * version 1.0.6j; from then on they were given the upcoming public + * release number plus "betaNN" or "rcNN". + * + * Binary incompatibility exists only when applications make direct access + * to the info_ptr or png_ptr members through png.h, and the compiled + * application is loaded with a different version of the library. + * + * DLLNUM will change each time there are forward or backward changes + * in binary compatibility (e.g., when a new feature is added). + * + * See libpng.txt or libpng.3 for more information. The PNG specification + * is available as a W3C Recommendation and as an ISO Specification, + * <http://www.w3.org/TR/2003/REC-PNG-20031110/ + */ + +/* + * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: + * + * If you modify libpng you may insert additional notices immediately following + * this sentence. + * + * libpng versions 1.2.6, August 15, 2004, through 1.2.37, June 4, 2009, are + * Copyright (c) 2004, 2006-2009 Glenn Randers-Pehrson, and are + * distributed according to the same disclaimer and license as libpng-1.2.5 + * with the following individual added to the list of Contributing Authors: + * + * Cosmin Truta + * + * libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are + * Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are + * distributed according to the same disclaimer and license as libpng-1.0.6 + * with the following individuals added to the list of Contributing Authors: + * + * Simon-Pierre Cadieux + * Eric S. Raymond + * Gilles Vollant + * + * and with the following additions to the disclaimer: + * + * There is no warranty against interference with your enjoyment of the + * library or against infringement. There is no warranty that our + * efforts or the library will fulfill any of your particular purposes + * or needs. This library is provided with all faults, and the entire + * risk of satisfactory quality, performance, accuracy, and effort is with + * the user. + * + * libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are + * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson, and are + * distributed according to the same disclaimer and license as libpng-0.96, + * with the following individuals added to the list of Contributing Authors: + * + * Tom Lane + * Glenn Randers-Pehrson + * Willem van Schaik + * + * libpng versions 0.89, June 1996, through 0.96, May 1997, are + * Copyright (c) 1996, 1997 Andreas Dilger + * Distributed according to the same disclaimer and license as libpng-0.88, + * with the following individuals added to the list of Contributing Authors: + * + * John Bowler + * Kevin Bracey + * Sam Bushell + * Magnus Holmgren + * Greg Roelofs + * Tom Tanner + * + * libpng versions 0.5, May 1995, through 0.88, January 1996, are + * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. + * + * For the purposes of this copyright and license, "Contributing Authors" + * is defined as the following set of individuals: + * + * Andreas Dilger + * Dave Martindale + * Guy Eric Schalnat + * Paul Schmidt + * Tim Wegner + * + * The PNG Reference Library is supplied "AS IS". The Contributing Authors + * and Group 42, Inc. disclaim all warranties, expressed or implied, + * including, without limitation, the warranties of merchantability and of + * fitness for any purpose. The Contributing Authors and Group 42, Inc. + * assume no liability for direct, indirect, incidental, special, exemplary, + * or consequential damages, which may result from the use of the PNG + * Reference Library, even if advised of the possibility of such damage. + * + * Permission is hereby granted to use, copy, modify, and distribute this + * source code, or portions hereof, for any purpose, without fee, subject + * to the following restrictions: + * + * 1. The origin of this source code must not be misrepresented. + * + * 2. Altered versions must be plainly marked as such and + * must not be misrepresented as being the original source. + * + * 3. This Copyright notice may not be removed or altered from + * any source or altered source distribution. + * + * The Contributing Authors and Group 42, Inc. specifically permit, without + * fee, and encourage the use of this source code as a component to + * supporting the PNG file format in commercial products. If you use this + * source code in a product, acknowledgment is not required but would be + * appreciated. + */ + +/* + * A "png_get_copyright" function is available, for convenient use in "about" + * boxes and the like: + * + * printf("%s",png_get_copyright(NULL)); + * + * Also, the PNG logo (in PNG format, of course) is supplied in the + * files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). + */ + +/* + * Libpng is OSI Certified Open Source Software. OSI Certified is a + * certification mark of the Open Source Initiative. + */ + +/* + * The contributing authors would like to thank all those who helped + * with testing, bug fixes, and patience. This wouldn't have been + * possible without all of you. + * + * Thanks to Frank J. T. Wojcik for helping with the documentation. + */ + +/* + * Y2K compliance in libpng: + * ========================= + * + * June 4, 2009 + * + * Since the PNG Development group is an ad-hoc body, we can't make + * an official declaration. + * + * This is your unofficial assurance that libpng from version 0.71 and + * upward through 1.2.37 are Y2K compliant. It is my belief that earlier + * versions were also Y2K compliant. + * + * Libpng only has three year fields. One is a 2-byte unsigned integer + * that will hold years up to 65535. The other two hold the date in text + * format, and will hold years up to 9999. + * + * The integer is + * "png_uint_16 year" in png_time_struct. + * + * The strings are + * "png_charp time_buffer" in png_struct and + * "near_time_buffer", which is a local character string in png.c. + * + * There are seven time-related functions: + * png.c: png_convert_to_rfc_1123() in png.c + * (formerly png_convert_to_rfc_1152() in error) + * png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c + * png_convert_from_time_t() in pngwrite.c + * png_get_tIME() in pngget.c + * png_handle_tIME() in pngrutil.c, called in pngread.c + * png_set_tIME() in pngset.c + * png_write_tIME() in pngwutil.c, called in pngwrite.c + * + * All handle dates properly in a Y2K environment. The + * png_convert_from_time_t() function calls gmtime() to convert from system + * clock time, which returns (year - 1900), which we properly convert to + * the full 4-digit year. There is a possibility that applications using + * libpng are not passing 4-digit years into the png_convert_to_rfc_1123() + * function, or that they are incorrectly passing only a 2-digit year + * instead of "year - 1900" into the png_convert_from_struct_tm() function, + * but this is not under our control. The libpng documentation has always + * stated that it works with 4-digit years, and the APIs have been + * documented as such. + * + * The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned + * integer to hold the year, and can hold years as large as 65535. + * + * zlib, upon which libpng depends, is also Y2K compliant. It contains + * no date-related code. + * + * Glenn Randers-Pehrson + * libpng maintainer + * PNG Development Group + */ + +#ifndef PNG_H +#define PNG_H + +/* This is not the place to learn how to use libpng. The file libpng.txt + * describes how to use libpng, and the file example.c summarizes it + * with some code on which to build. This file is useful for looking + * at the actual function definitions and structure components. + */ + +/* Version information for png.h - this should match the version in png.c */ +#define PNG_LIBPNG_VER_STRING "1.2.37" +#define PNG_HEADER_VERSION_STRING \ + " libpng version 1.2.37 - June 4, 2009\n" + +#define PNG_LIBPNG_VER_SONUM 0 +#define PNG_LIBPNG_VER_DLLNUM 13 + +/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ +#define PNG_LIBPNG_VER_MAJOR 1 +#define PNG_LIBPNG_VER_MINOR 2 +#define PNG_LIBPNG_VER_RELEASE 37 +/* This should match the numeric part of the final component of + * PNG_LIBPNG_VER_STRING, omitting any leading zero: */ + +#define PNG_LIBPNG_VER_BUILD 0 + +/* Release Status */ +#define PNG_LIBPNG_BUILD_ALPHA 1 +#define PNG_LIBPNG_BUILD_BETA 2 +#define PNG_LIBPNG_BUILD_RC 3 +#define PNG_LIBPNG_BUILD_STABLE 4 +#define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7 + +/* Release-Specific Flags */ +#define PNG_LIBPNG_BUILD_PATCH 8 /* Can be OR'ed with + PNG_LIBPNG_BUILD_STABLE only */ +#define PNG_LIBPNG_BUILD_PRIVATE 16 /* Cannot be OR'ed with + PNG_LIBPNG_BUILD_SPECIAL */ +#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with + PNG_LIBPNG_BUILD_PRIVATE */ + +#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE + +/* Careful here. At one time, Guy wanted to use 082, but that would be octal. + * We must not include leading zeros. + * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only + * version 1.0.0 was mis-numbered 100 instead of 10000). From + * version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */ +#define PNG_LIBPNG_VER 10237 /* 1.2.37 */ + +#ifndef PNG_VERSION_INFO_ONLY +/* include the compression library's header */ +#include "zlib.h" +#endif + +/* include all user configurable info, including optional assembler routines */ +#include "pngconf.h" + +/* + * Added at libpng-1.2.8 */ +/* Ref MSDN: Private as priority over Special + * VS_FF_PRIVATEBUILD File *was not* built using standard release + * procedures. If this value is given, the StringFileInfo block must + * contain a PrivateBuild string. + * + * VS_FF_SPECIALBUILD File *was* built by the original company using + * standard release procedures but is a variation of the standard + * file of the same version number. If this value is given, the + * StringFileInfo block must contain a SpecialBuild string. + */ + +#if defined(PNG_USER_PRIVATEBUILD) +# define PNG_LIBPNG_BUILD_TYPE \ + (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_PRIVATE) +#else +# if defined(PNG_LIBPNG_SPECIALBUILD) +# define PNG_LIBPNG_BUILD_TYPE \ + (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_SPECIAL) +# else +# define PNG_LIBPNG_BUILD_TYPE (PNG_LIBPNG_BUILD_BASE_TYPE) +# endif +#endif + +#ifndef PNG_VERSION_INFO_ONLY + +/* Inhibit C++ name-mangling for libpng functions but not for system calls. */ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* This file is arranged in several sections. The first section contains + * structure and type definitions. The second section contains the external + * library functions, while the third has the internal library functions, + * which applications aren't expected to use directly. + */ + +#ifndef PNG_NO_TYPECAST_NULL +#define int_p_NULL (int *)NULL +#define png_bytep_NULL (png_bytep)NULL +#define png_bytepp_NULL (png_bytepp)NULL +#define png_doublep_NULL (png_doublep)NULL +#define png_error_ptr_NULL (png_error_ptr)NULL +#define png_flush_ptr_NULL (png_flush_ptr)NULL +#define png_free_ptr_NULL (png_free_ptr)NULL +#define png_infopp_NULL (png_infopp)NULL +#define png_malloc_ptr_NULL (png_malloc_ptr)NULL +#define png_read_status_ptr_NULL (png_read_status_ptr)NULL +#define png_rw_ptr_NULL (png_rw_ptr)NULL +#define png_structp_NULL (png_structp)NULL +#define png_uint_16p_NULL (png_uint_16p)NULL +#define png_voidp_NULL (png_voidp)NULL +#define png_write_status_ptr_NULL (png_write_status_ptr)NULL +#else +#define int_p_NULL NULL +#define png_bytep_NULL NULL +#define png_bytepp_NULL NULL +#define png_doublep_NULL NULL +#define png_error_ptr_NULL NULL +#define png_flush_ptr_NULL NULL +#define png_free_ptr_NULL NULL +#define png_infopp_NULL NULL +#define png_malloc_ptr_NULL NULL +#define png_read_status_ptr_NULL NULL +#define png_rw_ptr_NULL NULL +#define png_structp_NULL NULL +#define png_uint_16p_NULL NULL +#define png_voidp_NULL NULL +#define png_write_status_ptr_NULL NULL +#endif + +/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */ +#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN) +/* Version information for C files, stored in png.c. This had better match + * the version above. + */ +#ifdef PNG_USE_GLOBAL_ARRAYS +PNG_EXPORT_VAR (PNG_CONST char) png_libpng_ver[18]; + /* need room for 99.99.99beta99z */ +#else +#define png_libpng_ver png_get_header_ver(NULL) +#endif + +#ifdef PNG_USE_GLOBAL_ARRAYS +/* This was removed in version 1.0.5c */ +/* Structures to facilitate easy interlacing. See png.c for more details */ +PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_start[7]; +PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_inc[7]; +PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_ystart[7]; +PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_yinc[7]; +PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_mask[7]; +PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_dsp_mask[7]; +/* This isn't currently used. If you need it, see png.c for more details. +PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_height[7]; +*/ +#endif + +#endif /* PNG_NO_EXTERN */ + +/* Three color definitions. The order of the red, green, and blue, (and the + * exact size) is not important, although the size of the fields need to + * be png_byte or png_uint_16 (as defined below). + */ +typedef struct png_color_struct +{ + png_byte red; + png_byte green; + png_byte blue; +} png_color; +typedef png_color FAR * png_colorp; +typedef png_color FAR * FAR * png_colorpp; + +typedef struct png_color_16_struct +{ + png_byte index; /* used for palette files */ + png_uint_16 red; /* for use in red green blue files */ + png_uint_16 green; + png_uint_16 blue; + png_uint_16 gray; /* for use in grayscale files */ +} png_color_16; +typedef png_color_16 FAR * png_color_16p; +typedef png_color_16 FAR * FAR * png_color_16pp; + +typedef struct png_color_8_struct +{ + png_byte red; /* for use in red green blue files */ + png_byte green; + png_byte blue; + png_byte gray; /* for use in grayscale files */ + png_byte alpha; /* for alpha channel files */ +} png_color_8; +typedef png_color_8 FAR * png_color_8p; +typedef png_color_8 FAR * FAR * png_color_8pp; + +/* + * The following two structures are used for the in-core representation + * of sPLT chunks. + */ +typedef struct png_sPLT_entry_struct +{ + png_uint_16 red; + png_uint_16 green; + png_uint_16 blue; + png_uint_16 alpha; + png_uint_16 frequency; +} png_sPLT_entry; +typedef png_sPLT_entry FAR * png_sPLT_entryp; +typedef png_sPLT_entry FAR * FAR * png_sPLT_entrypp; + +/* When the depth of the sPLT palette is 8 bits, the color and alpha samples + * occupy the LSB of their respective members, and the MSB of each member + * is zero-filled. The frequency member always occupies the full 16 bits. + */ + +typedef struct png_sPLT_struct +{ + png_charp name; /* palette name */ + png_byte depth; /* depth of palette samples */ + png_sPLT_entryp entries; /* palette entries */ + png_int_32 nentries; /* number of palette entries */ +} png_sPLT_t; +typedef png_sPLT_t FAR * png_sPLT_tp; +typedef png_sPLT_t FAR * FAR * png_sPLT_tpp; + +#ifdef PNG_TEXT_SUPPORTED +/* png_text holds the contents of a text/ztxt/itxt chunk in a PNG file, + * and whether that contents is compressed or not. The "key" field + * points to a regular zero-terminated C string. The "text", "lang", and + * "lang_key" fields can be regular C strings, empty strings, or NULL pointers. + * However, the * structure returned by png_get_text() will always contain + * regular zero-terminated C strings (possibly empty), never NULL pointers, + * so they can be safely used in printf() and other string-handling functions. + */ +typedef struct png_text_struct +{ + int compression; /* compression value: + -1: tEXt, none + 0: zTXt, deflate + 1: iTXt, none + 2: iTXt, deflate */ + png_charp key; /* keyword, 1-79 character description of "text" */ + png_charp text; /* comment, may be an empty string (ie "") + or a NULL pointer */ + png_size_t text_length; /* length of the text string */ +#ifdef PNG_iTXt_SUPPORTED + png_size_t itxt_length; /* length of the itxt string */ + png_charp lang; /* language code, 0-79 characters + or a NULL pointer */ + png_charp lang_key; /* keyword translated UTF-8 string, 0 or more + chars or a NULL pointer */ +#endif +} png_text; +typedef png_text FAR * png_textp; +typedef png_text FAR * FAR * png_textpp; +#endif + +/* Supported compression types for text in PNG files (tEXt, and zTXt). + * The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed. */ +#define PNG_TEXT_COMPRESSION_NONE_WR -3 +#define PNG_TEXT_COMPRESSION_zTXt_WR -2 +#define PNG_TEXT_COMPRESSION_NONE -1 +#define PNG_TEXT_COMPRESSION_zTXt 0 +#define PNG_ITXT_COMPRESSION_NONE 1 +#define PNG_ITXT_COMPRESSION_zTXt 2 +#define PNG_TEXT_COMPRESSION_LAST 3 /* Not a valid value */ + +/* png_time is a way to hold the time in an machine independent way. + * Two conversions are provided, both from time_t and struct tm. There + * is no portable way to convert to either of these structures, as far + * as I know. If you know of a portable way, send it to me. As a side + * note - PNG has always been Year 2000 compliant! + */ +typedef struct png_time_struct +{ + png_uint_16 year; /* full year, as in, 1995 */ + png_byte month; /* month of year, 1 - 12 */ + png_byte day; /* day of month, 1 - 31 */ + png_byte hour; /* hour of day, 0 - 23 */ + png_byte minute; /* minute of hour, 0 - 59 */ + png_byte second; /* second of minute, 0 - 60 (for leap seconds) */ +} png_time; +typedef png_time FAR * png_timep; +typedef png_time FAR * FAR * png_timepp; + +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) +/* png_unknown_chunk is a structure to hold queued chunks for which there is + * no specific support. The idea is that we can use this to queue + * up private chunks for output even though the library doesn't actually + * know about their semantics. + */ +#define PNG_CHUNK_NAME_LENGTH 5 +typedef struct png_unknown_chunk_t +{ + png_byte name[PNG_CHUNK_NAME_LENGTH]; + png_byte *data; + png_size_t size; + + /* libpng-using applications should NOT directly modify this byte. */ + png_byte location; /* mode of operation at read time */ +} +png_unknown_chunk; +typedef png_unknown_chunk FAR * png_unknown_chunkp; +typedef png_unknown_chunk FAR * FAR * png_unknown_chunkpp; +#endif + +/* png_info is a structure that holds the information in a PNG file so + * that the application can find out the characteristics of the image. + * If you are reading the file, this structure will tell you what is + * in the PNG file. If you are writing the file, fill in the information + * you want to put into the PNG file, then call png_write_info(). + * The names chosen should be very close to the PNG specification, so + * consult that document for information about the meaning of each field. + * + * With libpng < 0.95, it was only possible to directly set and read the + * the values in the png_info_struct, which meant that the contents and + * order of the values had to remain fixed. With libpng 0.95 and later, + * however, there are now functions that abstract the contents of + * png_info_struct from the application, so this makes it easier to use + * libpng with dynamic libraries, and even makes it possible to use + * libraries that don't have all of the libpng ancillary chunk-handing + * functionality. + * + * In any case, the order of the parameters in png_info_struct should NOT + * be changed for as long as possible to keep compatibility with applications + * that use the old direct-access method with png_info_struct. + * + * The following members may have allocated storage attached that should be + * cleaned up before the structure is discarded: palette, trans, text, + * pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile, + * splt_palettes, scal_unit, row_pointers, and unknowns. By default, these + * are automatically freed when the info structure is deallocated, if they were + * allocated internally by libpng. This behavior can be changed by means + * of the png_data_freer() function. + * + * More allocation details: all the chunk-reading functions that + * change these members go through the corresponding png_set_* + * functions. A function to clear these members is available: see + * png_free_data(). The png_set_* functions do not depend on being + * able to point info structure members to any of the storage they are + * passed (they make their own copies), EXCEPT that the png_set_text + * functions use the same storage passed to them in the text_ptr or + * itxt_ptr structure argument, and the png_set_rows and png_set_unknowns + * functions do not make their own copies. + */ +typedef struct png_info_struct +{ + /* the following are necessary for every PNG file */ + png_uint_32 width; /* width of image in pixels (from IHDR) */ + png_uint_32 height; /* height of image in pixels (from IHDR) */ + png_uint_32 valid; /* valid chunk data (see PNG_INFO_ below) */ + png_uint_32 rowbytes; /* bytes needed to hold an untransformed row */ + png_colorp palette; /* array of color values (valid & PNG_INFO_PLTE) */ + png_uint_16 num_palette; /* number of color entries in "palette" (PLTE) */ + png_uint_16 num_trans; /* number of transparent palette color (tRNS) */ + png_byte bit_depth; /* 1, 2, 4, 8, or 16 bits/channel (from IHDR) */ + png_byte color_type; /* see PNG_COLOR_TYPE_ below (from IHDR) */ + /* The following three should have been named *_method not *_type */ + png_byte compression_type; /* must be PNG_COMPRESSION_TYPE_BASE (IHDR) */ + png_byte filter_type; /* must be PNG_FILTER_TYPE_BASE (from IHDR) */ + png_byte interlace_type; /* One of PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ + + /* The following is informational only on read, and not used on writes. */ + png_byte channels; /* number of data channels per pixel (1, 2, 3, 4) */ + png_byte pixel_depth; /* number of bits per pixel */ + png_byte spare_byte; /* to align the data, and for future use */ + png_byte signature[8]; /* magic bytes read by libpng from start of file */ + + /* The rest of the data is optional. If you are reading, check the + * valid field to see if the information in these are valid. If you + * are writing, set the valid field to those chunks you want written, + * and initialize the appropriate fields below. + */ + +#if defined(PNG_gAMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED) + /* The gAMA chunk describes the gamma characteristics of the system + * on which the image was created, normally in the range [1.0, 2.5]. + * Data is valid if (valid & PNG_INFO_gAMA) is non-zero. + */ + float gamma; /* gamma value of image, if (valid & PNG_INFO_gAMA) */ +#endif + +#if defined(PNG_sRGB_SUPPORTED) + /* GR-P, 0.96a */ + /* Data valid if (valid & PNG_INFO_sRGB) non-zero. */ + png_byte srgb_intent; /* sRGB rendering intent [0, 1, 2, or 3] */ +#endif + +#if defined(PNG_TEXT_SUPPORTED) + /* The tEXt, and zTXt chunks contain human-readable textual data in + * uncompressed, compressed, and optionally compressed forms, respectively. + * The data in "text" is an array of pointers to uncompressed, + * null-terminated C strings. Each chunk has a keyword that describes the + * textual data contained in that chunk. Keywords are not required to be + * unique, and the text string may be empty. Any number of text chunks may + * be in an image. + */ + int num_text; /* number of comments read/to write */ + int max_text; /* current size of text array */ + png_textp text; /* array of comments read/to write */ +#endif /* PNG_TEXT_SUPPORTED */ + +#if defined(PNG_tIME_SUPPORTED) + /* The tIME chunk holds the last time the displayed image data was + * modified. See the png_time struct for the contents of this struct. + */ + png_time mod_time; +#endif + +#if defined(PNG_sBIT_SUPPORTED) + /* The sBIT chunk specifies the number of significant high-order bits + * in the pixel data. Values are in the range [1, bit_depth], and are + * only specified for the channels in the pixel data. The contents of + * the low-order bits is not specified. Data is valid if + * (valid & PNG_INFO_sBIT) is non-zero. + */ + png_color_8 sig_bit; /* significant bits in color channels */ +#endif + +#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_EXPAND_SUPPORTED) || \ +defined(PNG_READ_BACKGROUND_SUPPORTED) + /* The tRNS chunk supplies transparency data for paletted images and + * other image types that don't need a full alpha channel. There are + * "num_trans" transparency values for a paletted image, stored in the + * same order as the palette colors, starting from index 0. Values + * for the data are in the range [0, 255], ranging from fully transparent + * to fully opaque, respectively. For non-paletted images, there is a + * single color specified that should be treated as fully transparent. + * Data is valid if (valid & PNG_INFO_tRNS) is non-zero. + */ + png_bytep trans; /* transparent values for paletted image */ + png_color_16 trans_values; /* transparent color for non-palette image */ +#endif + +#if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + /* The bKGD chunk gives the suggested image background color if the + * display program does not have its own background color and the image + * is needs to composited onto a background before display. The colors + * in "background" are normally in the same color space/depth as the + * pixel data. Data is valid if (valid & PNG_INFO_bKGD) is non-zero. + */ + png_color_16 background; +#endif + +#if defined(PNG_oFFs_SUPPORTED) + /* The oFFs chunk gives the offset in "offset_unit_type" units rightwards + * and downwards from the top-left corner of the display, page, or other + * application-specific co-ordinate space. See the PNG_OFFSET_ defines + * below for the unit types. Valid if (valid & PNG_INFO_oFFs) non-zero. + */ + png_int_32 x_offset; /* x offset on page */ + png_int_32 y_offset; /* y offset on page */ + png_byte offset_unit_type; /* offset units type */ +#endif + +#if defined(PNG_pHYs_SUPPORTED) + /* The pHYs chunk gives the physical pixel density of the image for + * display or printing in "phys_unit_type" units (see PNG_RESOLUTION_ + * defines below). Data is valid if (valid & PNG_INFO_pHYs) is non-zero. + */ + png_uint_32 x_pixels_per_unit; /* horizontal pixel density */ + png_uint_32 y_pixels_per_unit; /* vertical pixel density */ + png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */ +#endif + +#if defined(PNG_hIST_SUPPORTED) + /* The hIST chunk contains the relative frequency or importance of the + * various palette entries, so that a viewer can intelligently select a + * reduced-color palette, if required. Data is an array of "num_palette" + * values in the range [0,65535]. Data valid if (valid & PNG_INFO_hIST) + * is non-zero. + */ + png_uint_16p hist; +#endif + +#ifdef PNG_cHRM_SUPPORTED + /* The cHRM chunk describes the CIE color characteristics of the monitor + * on which the PNG was created. This data allows the viewer to do gamut + * mapping of the input image to ensure that the viewer sees the same + * colors in the image as the creator. Values are in the range + * [0.0, 0.8]. Data valid if (valid & PNG_INFO_cHRM) non-zero. + */ +#ifdef PNG_FLOATING_POINT_SUPPORTED + float x_white; + float y_white; + float x_red; + float y_red; + float x_green; + float y_green; + float x_blue; + float y_blue; +#endif +#endif + +#if defined(PNG_pCAL_SUPPORTED) + /* The pCAL chunk describes a transformation between the stored pixel + * values and original physical data values used to create the image. + * The integer range [0, 2^bit_depth - 1] maps to the floating-point + * range given by [pcal_X0, pcal_X1], and are further transformed by a + * (possibly non-linear) transformation function given by "pcal_type" + * and "pcal_params" into "pcal_units". Please see the PNG_EQUATION_ + * defines below, and the PNG-Group's PNG extensions document for a + * complete description of the transformations and how they should be + * implemented, and for a description of the ASCII parameter strings. + * Data values are valid if (valid & PNG_INFO_pCAL) non-zero. + */ + png_charp pcal_purpose; /* pCAL chunk description string */ + png_int_32 pcal_X0; /* minimum value */ + png_int_32 pcal_X1; /* maximum value */ + png_charp pcal_units; /* Latin-1 string giving physical units */ + png_charpp pcal_params; /* ASCII strings containing parameter values */ + png_byte pcal_type; /* equation type (see PNG_EQUATION_ below) */ + png_byte pcal_nparams; /* number of parameters given in pcal_params */ +#endif + +/* New members added in libpng-1.0.6 */ +#ifdef PNG_FREE_ME_SUPPORTED + png_uint_32 free_me; /* flags items libpng is responsible for freeing */ +#endif + +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) + /* storage for unknown chunks that the library doesn't recognize. */ + png_unknown_chunkp unknown_chunks; + png_size_t unknown_chunks_num; +#endif + +#if defined(PNG_iCCP_SUPPORTED) + /* iCCP chunk data. */ + png_charp iccp_name; /* profile name */ + png_charp iccp_profile; /* International Color Consortium profile data */ + /* Note to maintainer: should be png_bytep */ + png_uint_32 iccp_proflen; /* ICC profile data length */ + png_byte iccp_compression; /* Always zero */ +#endif + +#if defined(PNG_sPLT_SUPPORTED) + /* data on sPLT chunks (there may be more than one). */ + png_sPLT_tp splt_palettes; + png_uint_32 splt_palettes_num; +#endif + +#if defined(PNG_sCAL_SUPPORTED) + /* The sCAL chunk describes the actual physical dimensions of the + * subject matter of the graphic. The chunk contains a unit specification + * a byte value, and two ASCII strings representing floating-point + * values. The values are width and height corresponsing to one pixel + * in the image. This external representation is converted to double + * here. Data values are valid if (valid & PNG_INFO_sCAL) is non-zero. + */ + png_byte scal_unit; /* unit of physical scale */ +#ifdef PNG_FLOATING_POINT_SUPPORTED + double scal_pixel_width; /* width of one pixel */ + double scal_pixel_height; /* height of one pixel */ +#endif +#ifdef PNG_FIXED_POINT_SUPPORTED + png_charp scal_s_width; /* string containing height */ + png_charp scal_s_height; /* string containing width */ +#endif +#endif + +#if defined(PNG_INFO_IMAGE_SUPPORTED) + /* Memory has been allocated if (valid & PNG_ALLOCATED_INFO_ROWS) non-zero */ + /* Data valid if (valid & PNG_INFO_IDAT) non-zero */ + png_bytepp row_pointers; /* the image bits */ +#endif + +#if defined(PNG_FIXED_POINT_SUPPORTED) && defined(PNG_gAMA_SUPPORTED) + png_fixed_point int_gamma; /* gamma of image, if (valid & PNG_INFO_gAMA) */ +#endif + +#if defined(PNG_cHRM_SUPPORTED) && defined(PNG_FIXED_POINT_SUPPORTED) + png_fixed_point int_x_white; + png_fixed_point int_y_white; + png_fixed_point int_x_red; + png_fixed_point int_y_red; + png_fixed_point int_x_green; + png_fixed_point int_y_green; + png_fixed_point int_x_blue; + png_fixed_point int_y_blue; +#endif + +} png_info; + +typedef png_info FAR * png_infop; +typedef png_info FAR * FAR * png_infopp; + +/* Maximum positive integer used in PNG is (2^31)-1 */ +#define PNG_UINT_31_MAX ((png_uint_32)0x7fffffffL) +#define PNG_UINT_32_MAX ((png_uint_32)(-1)) +#define PNG_SIZE_MAX ((png_size_t)(-1)) +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +/* PNG_MAX_UINT is deprecated; use PNG_UINT_31_MAX instead. */ +#define PNG_MAX_UINT PNG_UINT_31_MAX +#endif + +/* These describe the color_type field in png_info. */ +/* color type masks */ +#define PNG_COLOR_MASK_PALETTE 1 +#define PNG_COLOR_MASK_COLOR 2 +#define PNG_COLOR_MASK_ALPHA 4 + +/* color types. Note that not all combinations are legal */ +#define PNG_COLOR_TYPE_GRAY 0 +#define PNG_COLOR_TYPE_PALETTE (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE) +#define PNG_COLOR_TYPE_RGB (PNG_COLOR_MASK_COLOR) +#define PNG_COLOR_TYPE_RGB_ALPHA (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA) +#define PNG_COLOR_TYPE_GRAY_ALPHA (PNG_COLOR_MASK_ALPHA) +/* aliases */ +#define PNG_COLOR_TYPE_RGBA PNG_COLOR_TYPE_RGB_ALPHA +#define PNG_COLOR_TYPE_GA PNG_COLOR_TYPE_GRAY_ALPHA + +/* This is for compression type. PNG 1.0-1.2 only define the single type. */ +#define PNG_COMPRESSION_TYPE_BASE 0 /* Deflate method 8, 32K window */ +#define PNG_COMPRESSION_TYPE_DEFAULT PNG_COMPRESSION_TYPE_BASE + +/* This is for filter type. PNG 1.0-1.2 only define the single type. */ +#define PNG_FILTER_TYPE_BASE 0 /* Single row per-byte filtering */ +#define PNG_INTRAPIXEL_DIFFERENCING 64 /* Used only in MNG datastreams */ +#define PNG_FILTER_TYPE_DEFAULT PNG_FILTER_TYPE_BASE + +/* These are for the interlacing type. These values should NOT be changed. */ +#define PNG_INTERLACE_NONE 0 /* Non-interlaced image */ +#define PNG_INTERLACE_ADAM7 1 /* Adam7 interlacing */ +#define PNG_INTERLACE_LAST 2 /* Not a valid value */ + +/* These are for the oFFs chunk. These values should NOT be changed. */ +#define PNG_OFFSET_PIXEL 0 /* Offset in pixels */ +#define PNG_OFFSET_MICROMETER 1 /* Offset in micrometers (1/10^6 meter) */ +#define PNG_OFFSET_LAST 2 /* Not a valid value */ + +/* These are for the pCAL chunk. These values should NOT be changed. */ +#define PNG_EQUATION_LINEAR 0 /* Linear transformation */ +#define PNG_EQUATION_BASE_E 1 /* Exponential base e transform */ +#define PNG_EQUATION_ARBITRARY 2 /* Arbitrary base exponential transform */ +#define PNG_EQUATION_HYPERBOLIC 3 /* Hyperbolic sine transformation */ +#define PNG_EQUATION_LAST 4 /* Not a valid value */ + +/* These are for the sCAL chunk. These values should NOT be changed. */ +#define PNG_SCALE_UNKNOWN 0 /* unknown unit (image scale) */ +#define PNG_SCALE_METER 1 /* meters per pixel */ +#define PNG_SCALE_RADIAN 2 /* radians per pixel */ +#define PNG_SCALE_LAST 3 /* Not a valid value */ + +/* These are for the pHYs chunk. These values should NOT be changed. */ +#define PNG_RESOLUTION_UNKNOWN 0 /* pixels/unknown unit (aspect ratio) */ +#define PNG_RESOLUTION_METER 1 /* pixels/meter */ +#define PNG_RESOLUTION_LAST 2 /* Not a valid value */ + +/* These are for the sRGB chunk. These values should NOT be changed. */ +#define PNG_sRGB_INTENT_PERCEPTUAL 0 +#define PNG_sRGB_INTENT_RELATIVE 1 +#define PNG_sRGB_INTENT_SATURATION 2 +#define PNG_sRGB_INTENT_ABSOLUTE 3 +#define PNG_sRGB_INTENT_LAST 4 /* Not a valid value */ + +/* This is for text chunks */ +#define PNG_KEYWORD_MAX_LENGTH 79 + +/* Maximum number of entries in PLTE/sPLT/tRNS arrays */ +#define PNG_MAX_PALETTE_LENGTH 256 + +/* These determine if an ancillary chunk's data has been successfully read + * from the PNG header, or if the application has filled in the corresponding + * data in the info_struct to be written into the output file. The values + * of the PNG_INFO_<chunk> defines should NOT be changed. + */ +#define PNG_INFO_gAMA 0x0001 +#define PNG_INFO_sBIT 0x0002 +#define PNG_INFO_cHRM 0x0004 +#define PNG_INFO_PLTE 0x0008 +#define PNG_INFO_tRNS 0x0010 +#define PNG_INFO_bKGD 0x0020 +#define PNG_INFO_hIST 0x0040 +#define PNG_INFO_pHYs 0x0080 +#define PNG_INFO_oFFs 0x0100 +#define PNG_INFO_tIME 0x0200 +#define PNG_INFO_pCAL 0x0400 +#define PNG_INFO_sRGB 0x0800 /* GR-P, 0.96a */ +#define PNG_INFO_iCCP 0x1000 /* ESR, 1.0.6 */ +#define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */ +#define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */ +#define PNG_INFO_IDAT 0x8000L /* ESR, 1.0.6 */ + +/* This is used for the transformation routines, as some of them + * change these values for the row. It also should enable using + * the routines for other purposes. + */ +typedef struct png_row_info_struct +{ + png_uint_32 width; /* width of row */ + png_uint_32 rowbytes; /* number of bytes in row */ + png_byte color_type; /* color type of row */ + png_byte bit_depth; /* bit depth of row */ + png_byte channels; /* number of channels (1, 2, 3, or 4) */ + png_byte pixel_depth; /* bits per pixel (depth * channels) */ +} png_row_info; + +typedef png_row_info FAR * png_row_infop; +typedef png_row_info FAR * FAR * png_row_infopp; + +/* These are the function types for the I/O functions and for the functions + * that allow the user to override the default I/O functions with his or her + * own. The png_error_ptr type should match that of user-supplied warning + * and error functions, while the png_rw_ptr type should match that of the + * user read/write data functions. + */ +typedef struct png_struct_def png_struct; +typedef png_struct FAR * png_structp; + +typedef void (PNGAPI *png_error_ptr) PNGARG((png_structp, png_const_charp)); +typedef void (PNGAPI *png_rw_ptr) PNGARG((png_structp, png_bytep, png_size_t)); +typedef void (PNGAPI *png_flush_ptr) PNGARG((png_structp)); +typedef void (PNGAPI *png_read_status_ptr) PNGARG((png_structp, png_uint_32, + int)); +typedef void (PNGAPI *png_write_status_ptr) PNGARG((png_structp, png_uint_32, + int)); + +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +typedef void (PNGAPI *png_progressive_info_ptr) PNGARG((png_structp, png_infop)); +typedef void (PNGAPI *png_progressive_end_ptr) PNGARG((png_structp, png_infop)); +typedef void (PNGAPI *png_progressive_row_ptr) PNGARG((png_structp, png_bytep, + png_uint_32, int)); +#endif + +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_LEGACY_SUPPORTED) +typedef void (PNGAPI *png_user_transform_ptr) PNGARG((png_structp, + png_row_infop, png_bytep)); +#endif + +#if defined(PNG_USER_CHUNKS_SUPPORTED) +typedef int (PNGAPI *png_user_chunk_ptr) PNGARG((png_structp, png_unknown_chunkp)); +#endif +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) +typedef void (PNGAPI *png_unknown_chunk_ptr) PNGARG((png_structp)); +#endif + +/* Transform masks for the high-level interface */ +#define PNG_TRANSFORM_IDENTITY 0x0000 /* read and write */ +#define PNG_TRANSFORM_STRIP_16 0x0001 /* read only */ +#define PNG_TRANSFORM_STRIP_ALPHA 0x0002 /* read only */ +#define PNG_TRANSFORM_PACKING 0x0004 /* read and write */ +#define PNG_TRANSFORM_PACKSWAP 0x0008 /* read and write */ +#define PNG_TRANSFORM_EXPAND 0x0010 /* read only */ +#define PNG_TRANSFORM_INVERT_MONO 0x0020 /* read and write */ +#define PNG_TRANSFORM_SHIFT 0x0040 /* read and write */ +#define PNG_TRANSFORM_BGR 0x0080 /* read and write */ +#define PNG_TRANSFORM_SWAP_ALPHA 0x0100 /* read and write */ +#define PNG_TRANSFORM_SWAP_ENDIAN 0x0200 /* read and write */ +#define PNG_TRANSFORM_INVERT_ALPHA 0x0400 /* read and write */ +#define PNG_TRANSFORM_STRIP_FILLER 0x0800 /* WRITE only, deprecated */ +/* Added to libpng-1.2.34 */ +#define PNG_TRANSFORM_STRIP_FILLER_BEFORE 0x0800 /* WRITE only */ +#define PNG_TRANSFORM_STRIP_FILLER_AFTER 0x1000 /* WRITE only */ + +/* Flags for MNG supported features */ +#define PNG_FLAG_MNG_EMPTY_PLTE 0x01 +#define PNG_FLAG_MNG_FILTER_64 0x04 +#define PNG_ALL_MNG_FEATURES 0x05 + +typedef png_voidp (*png_malloc_ptr) PNGARG((png_structp, png_size_t)); +typedef void (*png_free_ptr) PNGARG((png_structp, png_voidp)); + +/* The structure that holds the information to read and write PNG files. + * The only people who need to care about what is inside of this are the + * people who will be modifying the library for their own special needs. + * It should NOT be accessed directly by an application, except to store + * the jmp_buf. + */ + +struct png_struct_def +{ +#ifdef PNG_SETJMP_SUPPORTED + jmp_buf jmpbuf; /* used in png_error */ +#endif + png_error_ptr error_fn; /* function for printing errors and aborting */ + png_error_ptr warning_fn; /* function for printing warnings */ + png_voidp error_ptr; /* user supplied struct for error functions */ + png_rw_ptr write_data_fn; /* function for writing output data */ + png_rw_ptr read_data_fn; /* function for reading input data */ + png_voidp io_ptr; /* ptr to application struct for I/O functions */ + +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) + png_user_transform_ptr read_user_transform_fn; /* user read transform */ +#endif + +#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) + png_user_transform_ptr write_user_transform_fn; /* user write transform */ +#endif + +/* These were added in libpng-1.0.2 */ +#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) + png_voidp user_transform_ptr; /* user supplied struct for user transform */ + png_byte user_transform_depth; /* bit depth of user transformed pixels */ + png_byte user_transform_channels; /* channels in user transformed pixels */ +#endif +#endif + + png_uint_32 mode; /* tells us where we are in the PNG file */ + png_uint_32 flags; /* flags indicating various things to libpng */ + png_uint_32 transformations; /* which transformations to perform */ + + z_stream zstream; /* pointer to decompression structure (below) */ + png_bytep zbuf; /* buffer for zlib */ + png_size_t zbuf_size; /* size of zbuf */ + int zlib_level; /* holds zlib compression level */ + int zlib_method; /* holds zlib compression method */ + int zlib_window_bits; /* holds zlib compression window bits */ + int zlib_mem_level; /* holds zlib compression memory level */ + int zlib_strategy; /* holds zlib compression strategy */ + + png_uint_32 width; /* width of image in pixels */ + png_uint_32 height; /* height of image in pixels */ + png_uint_32 num_rows; /* number of rows in current pass */ + png_uint_32 usr_width; /* width of row at start of write */ + png_uint_32 rowbytes; /* size of row in bytes */ + png_uint_32 irowbytes; /* size of current interlaced row in bytes */ + png_uint_32 iwidth; /* width of current interlaced row in pixels */ + png_uint_32 row_number; /* current row in interlace pass */ + png_bytep prev_row; /* buffer to save previous (unfiltered) row */ + png_bytep row_buf; /* buffer to save current (unfiltered) row */ +#ifndef PNG_NO_WRITE_FILTER + png_bytep sub_row; /* buffer to save "sub" row when filtering */ + png_bytep up_row; /* buffer to save "up" row when filtering */ + png_bytep avg_row; /* buffer to save "avg" row when filtering */ + png_bytep paeth_row; /* buffer to save "Paeth" row when filtering */ +#endif + png_row_info row_info; /* used for transformation routines */ + + png_uint_32 idat_size; /* current IDAT size for read */ + png_uint_32 crc; /* current chunk CRC value */ + png_colorp palette; /* palette from the input file */ + png_uint_16 num_palette; /* number of color entries in palette */ + png_uint_16 num_trans; /* number of transparency values */ + png_byte chunk_name[5]; /* null-terminated name of current chunk */ + png_byte compression; /* file compression type (always 0) */ + png_byte filter; /* file filter type (always 0) */ + png_byte interlaced; /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ + png_byte pass; /* current interlace pass (0 - 6) */ + png_byte do_filter; /* row filter flags (see PNG_FILTER_ below ) */ + png_byte color_type; /* color type of file */ + png_byte bit_depth; /* bit depth of file */ + png_byte usr_bit_depth; /* bit depth of users row */ + png_byte pixel_depth; /* number of bits per pixel */ + png_byte channels; /* number of channels in file */ + png_byte usr_channels; /* channels at start of write */ + png_byte sig_bytes; /* magic bytes read/written from start of file */ + +#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) +#ifdef PNG_LEGACY_SUPPORTED + png_byte filler; /* filler byte for pixel expansion */ +#else + png_uint_16 filler; /* filler bytes for pixel expansion */ +#endif +#endif + +#if defined(PNG_bKGD_SUPPORTED) + png_byte background_gamma_type; +# ifdef PNG_FLOATING_POINT_SUPPORTED + float background_gamma; +# endif + png_color_16 background; /* background color in screen gamma space */ +#if defined(PNG_READ_GAMMA_SUPPORTED) + png_color_16 background_1; /* background normalized to gamma 1.0 */ +#endif +#endif /* PNG_bKGD_SUPPORTED */ + +#if defined(PNG_WRITE_FLUSH_SUPPORTED) + png_flush_ptr output_flush_fn;/* Function for flushing output */ + png_uint_32 flush_dist; /* how many rows apart to flush, 0 - no flush */ + png_uint_32 flush_rows; /* number of rows written since last flush */ +#endif + +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + int gamma_shift; /* number of "insignificant" bits 16-bit gamma */ +#ifdef PNG_FLOATING_POINT_SUPPORTED + float gamma; /* file gamma value */ + float screen_gamma; /* screen gamma value (display_exponent) */ +#endif +#endif + +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + png_bytep gamma_table; /* gamma table for 8-bit depth files */ + png_bytep gamma_from_1; /* converts from 1.0 to screen */ + png_bytep gamma_to_1; /* converts from file to 1.0 */ + png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */ + png_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */ + png_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */ +#endif + +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED) + png_color_8 sig_bit; /* significant bits in each available channel */ +#endif + +#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) + png_color_8 shift; /* shift for significant bit tranformation */ +#endif + +#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \ + || defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + png_bytep trans; /* transparency values for paletted files */ + png_color_16 trans_values; /* transparency values for non-paletted files */ +#endif + + png_read_status_ptr read_row_fn; /* called after each row is decoded */ + png_write_status_ptr write_row_fn; /* called after each row is encoded */ +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED + png_progressive_info_ptr info_fn; /* called after header data fully read */ + png_progressive_row_ptr row_fn; /* called after each prog. row is decoded */ + png_progressive_end_ptr end_fn; /* called after image is complete */ + png_bytep save_buffer_ptr; /* current location in save_buffer */ + png_bytep save_buffer; /* buffer for previously read data */ + png_bytep current_buffer_ptr; /* current location in current_buffer */ + png_bytep current_buffer; /* buffer for recently used data */ + png_uint_32 push_length; /* size of current input chunk */ + png_uint_32 skip_length; /* bytes to skip in input data */ + png_size_t save_buffer_size; /* amount of data now in save_buffer */ + png_size_t save_buffer_max; /* total size of save_buffer */ + png_size_t buffer_size; /* total amount of available input data */ + png_size_t current_buffer_size; /* amount of data now in current_buffer */ + int process_mode; /* what push library is currently doing */ + int cur_palette; /* current push library palette index */ + +# if defined(PNG_TEXT_SUPPORTED) + png_size_t current_text_size; /* current size of text input data */ + png_size_t current_text_left; /* how much text left to read in input */ + png_charp current_text; /* current text chunk buffer */ + png_charp current_text_ptr; /* current location in current_text */ +# endif /* PNG_TEXT_SUPPORTED */ +#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ + +#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__) +/* for the Borland special 64K segment handler */ + png_bytepp offset_table_ptr; + png_bytep offset_table; + png_uint_16 offset_table_number; + png_uint_16 offset_table_count; + png_uint_16 offset_table_count_free; +#endif + +#if defined(PNG_READ_DITHER_SUPPORTED) + png_bytep palette_lookup; /* lookup table for dithering */ + png_bytep dither_index; /* index translation for palette files */ +#endif + +#if defined(PNG_READ_DITHER_SUPPORTED) || defined(PNG_hIST_SUPPORTED) + png_uint_16p hist; /* histogram */ +#endif + +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) + png_byte heuristic_method; /* heuristic for row filter selection */ + png_byte num_prev_filters; /* number of weights for previous rows */ + png_bytep prev_filters; /* filter type(s) of previous row(s) */ + png_uint_16p filter_weights; /* weight(s) for previous line(s) */ + png_uint_16p inv_filter_weights; /* 1/weight(s) for previous line(s) */ + png_uint_16p filter_costs; /* relative filter calculation cost */ + png_uint_16p inv_filter_costs; /* 1/relative filter calculation cost */ +#endif + +#if defined(PNG_TIME_RFC1123_SUPPORTED) + png_charp time_buffer; /* String to hold RFC 1123 time text */ +#endif + +/* New members added in libpng-1.0.6 */ + +#ifdef PNG_FREE_ME_SUPPORTED + png_uint_32 free_me; /* flags items libpng is responsible for freeing */ +#endif + +#if defined(PNG_USER_CHUNKS_SUPPORTED) + png_voidp user_chunk_ptr; + png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */ +#endif + +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) + int num_chunk_list; + png_bytep chunk_list; +#endif + +/* New members added in libpng-1.0.3 */ +#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) + png_byte rgb_to_gray_status; + /* These were changed from png_byte in libpng-1.0.6 */ + png_uint_16 rgb_to_gray_red_coeff; + png_uint_16 rgb_to_gray_green_coeff; + png_uint_16 rgb_to_gray_blue_coeff; +#endif + +/* New member added in libpng-1.0.4 (renamed in 1.0.9) */ +#if defined(PNG_MNG_FEATURES_SUPPORTED) || \ + defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ + defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED) +/* changed from png_byte to png_uint_32 at version 1.2.0 */ +#ifdef PNG_1_0_X + png_byte mng_features_permitted; +#else + png_uint_32 mng_features_permitted; +#endif /* PNG_1_0_X */ +#endif + +/* New member added in libpng-1.0.7 */ +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + png_fixed_point int_gamma; +#endif + +/* New member added in libpng-1.0.9, ifdef'ed out in 1.0.12, enabled in 1.2.0 */ +#if defined(PNG_MNG_FEATURES_SUPPORTED) + png_byte filter_type; +#endif + +#if defined(PNG_1_0_X) +/* New member added in libpng-1.0.10, ifdef'ed out in 1.2.0 */ + png_uint_32 row_buf_size; +#endif + +/* New members added in libpng-1.2.0 */ +#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) +# if !defined(PNG_1_0_X) +# if defined(PNG_MMX_CODE_SUPPORTED) + png_byte mmx_bitdepth_threshold; + png_uint_32 mmx_rowbytes_threshold; +# endif + png_uint_32 asm_flags; +# endif +#endif + +/* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */ +#ifdef PNG_USER_MEM_SUPPORTED + png_voidp mem_ptr; /* user supplied struct for mem functions */ + png_malloc_ptr malloc_fn; /* function for allocating memory */ + png_free_ptr free_fn; /* function for freeing memory */ +#endif + +/* New member added in libpng-1.0.13 and 1.2.0 */ + png_bytep big_row_buf; /* buffer to save current (unfiltered) row */ + +#if defined(PNG_READ_DITHER_SUPPORTED) +/* The following three members were added at version 1.0.14 and 1.2.4 */ + png_bytep dither_sort; /* working sort array */ + png_bytep index_to_palette; /* where the original index currently is */ + /* in the palette */ + png_bytep palette_to_index; /* which original index points to this */ + /* palette color */ +#endif + +/* New members added in libpng-1.0.16 and 1.2.6 */ + png_byte compression_type; + +#ifdef PNG_SET_USER_LIMITS_SUPPORTED + png_uint_32 user_width_max; + png_uint_32 user_height_max; +#endif + +/* New member added in libpng-1.0.25 and 1.2.17 */ +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) + /* storage for unknown chunk that the library doesn't recognize. */ + png_unknown_chunk unknown_chunk; +#endif + +/* New members added in libpng-1.2.26 */ + png_uint_32 old_big_row_buf_size, old_prev_row_size; + +/* New member added in libpng-1.2.30 */ + png_charp chunkdata; /* buffer for reading chunk data */ + +}; + + +/* This triggers a compiler error in png.c, if png.c and png.h + * do not agree upon the version number. + */ +typedef png_structp version_1_2_37; + +typedef png_struct FAR * FAR * png_structpp; + +/* Here are the function definitions most commonly used. This is not + * the place to find out how to use libpng. See libpng.txt for the + * full explanation, see example.c for the summary. This just provides + * a simple one line description of the use of each function. + */ + +/* Returns the version number of the library */ +extern PNG_EXPORT(png_uint_32,png_access_version_number) PNGARG((void)); + +/* Tell lib we have already handled the first <num_bytes> magic bytes. + * Handling more than 8 bytes from the beginning of the file is an error. + */ +extern PNG_EXPORT(void,png_set_sig_bytes) PNGARG((png_structp png_ptr, + int num_bytes)); + +/* Check sig[start] through sig[start + num_to_check - 1] to see if it's a + * PNG file. Returns zero if the supplied bytes match the 8-byte PNG + * signature, and non-zero otherwise. Having num_to_check == 0 or + * start > 7 will always fail (ie return non-zero). + */ +extern PNG_EXPORT(int,png_sig_cmp) PNGARG((png_bytep sig, png_size_t start, + png_size_t num_to_check)); + +/* Simple signature checking function. This is the same as calling + * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n). + */ +extern PNG_EXPORT(int,png_check_sig) PNGARG((png_bytep sig, int num)); + +/* Allocate and initialize png_ptr struct for reading, and any other memory. */ +extern PNG_EXPORT(png_structp,png_create_read_struct) + PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, + png_error_ptr error_fn, png_error_ptr warn_fn)); + +/* Allocate and initialize png_ptr struct for writing, and any other memory */ +extern PNG_EXPORT(png_structp,png_create_write_struct) + PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, + png_error_ptr error_fn, png_error_ptr warn_fn)); + +#ifdef PNG_WRITE_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_compression_buffer_size) + PNGARG((png_structp png_ptr)); +#endif + +#ifdef PNG_WRITE_SUPPORTED +extern PNG_EXPORT(void,png_set_compression_buffer_size) + PNGARG((png_structp png_ptr, png_uint_32 size)); +#endif + +/* Reset the compression stream */ +extern PNG_EXPORT(int,png_reset_zstream) PNGARG((png_structp png_ptr)); + +/* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */ +#ifdef PNG_USER_MEM_SUPPORTED +extern PNG_EXPORT(png_structp,png_create_read_struct_2) + PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, + png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, + png_malloc_ptr malloc_fn, png_free_ptr free_fn)); +extern PNG_EXPORT(png_structp,png_create_write_struct_2) + PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, + png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, + png_malloc_ptr malloc_fn, png_free_ptr free_fn)); +#endif + +/* Write a PNG chunk - size, type, (optional) data, CRC. */ +extern PNG_EXPORT(void,png_write_chunk) PNGARG((png_structp png_ptr, + png_bytep chunk_name, png_bytep data, png_size_t length)); + +/* Write the start of a PNG chunk - length and chunk name. */ +extern PNG_EXPORT(void,png_write_chunk_start) PNGARG((png_structp png_ptr, + png_bytep chunk_name, png_uint_32 length)); + +/* Write the data of a PNG chunk started with png_write_chunk_start(). */ +extern PNG_EXPORT(void,png_write_chunk_data) PNGARG((png_structp png_ptr, + png_bytep data, png_size_t length)); + +/* Finish a chunk started with png_write_chunk_start() (includes CRC). */ +extern PNG_EXPORT(void,png_write_chunk_end) PNGARG((png_structp png_ptr)); + +/* Allocate and initialize the info structure */ +extern PNG_EXPORT(png_infop,png_create_info_struct) + PNGARG((png_structp png_ptr)); + +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +/* Initialize the info structure (old interface - DEPRECATED) */ +extern PNG_EXPORT(void,png_info_init) PNGARG((png_infop info_ptr)); +#undef png_info_init +#define png_info_init(info_ptr) png_info_init_3(&info_ptr,\ + png_sizeof(png_info)); +#endif + +extern PNG_EXPORT(void,png_info_init_3) PNGARG((png_infopp info_ptr, + png_size_t png_info_struct_size)); + +/* Writes all the PNG information before the image. */ +extern PNG_EXPORT(void,png_write_info_before_PLTE) PNGARG((png_structp png_ptr, + png_infop info_ptr)); +extern PNG_EXPORT(void,png_write_info) PNGARG((png_structp png_ptr, + png_infop info_ptr)); + +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED +/* read the information before the actual image data. */ +extern PNG_EXPORT(void,png_read_info) PNGARG((png_structp png_ptr, + png_infop info_ptr)); +#endif + +#if defined(PNG_TIME_RFC1123_SUPPORTED) +extern PNG_EXPORT(png_charp,png_convert_to_rfc1123) + PNGARG((png_structp png_ptr, png_timep ptime)); +#endif + +#if !defined(_WIN32_WCE) +/* "time.h" functions are not supported on WindowsCE */ +#if defined(PNG_WRITE_tIME_SUPPORTED) +/* convert from a struct tm to png_time */ +extern PNG_EXPORT(void,png_convert_from_struct_tm) PNGARG((png_timep ptime, + struct tm FAR * ttime)); + +/* convert from time_t to png_time. Uses gmtime() */ +extern PNG_EXPORT(void,png_convert_from_time_t) PNGARG((png_timep ptime, + time_t ttime)); +#endif /* PNG_WRITE_tIME_SUPPORTED */ +#endif /* _WIN32_WCE */ + +#if defined(PNG_READ_EXPAND_SUPPORTED) +/* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */ +extern PNG_EXPORT(void,png_set_expand) PNGARG((png_structp png_ptr)); +#if !defined(PNG_1_0_X) +extern PNG_EXPORT(void,png_set_expand_gray_1_2_4_to_8) PNGARG((png_structp + png_ptr)); +#endif +extern PNG_EXPORT(void,png_set_palette_to_rgb) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(void,png_set_tRNS_to_alpha) PNGARG((png_structp png_ptr)); +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +/* Deprecated */ +extern PNG_EXPORT(void,png_set_gray_1_2_4_to_8) PNGARG((png_structp png_ptr)); +#endif +#endif + +#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) +/* Use blue, green, red order for pixels. */ +extern PNG_EXPORT(void,png_set_bgr) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) +/* Expand the grayscale to 24-bit RGB if necessary. */ +extern PNG_EXPORT(void,png_set_gray_to_rgb) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) +/* Reduce RGB to grayscale. */ +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_rgb_to_gray) PNGARG((png_structp png_ptr, + int error_action, double red, double green )); +#endif +extern PNG_EXPORT(void,png_set_rgb_to_gray_fixed) PNGARG((png_structp png_ptr, + int error_action, png_fixed_point red, png_fixed_point green )); +extern PNG_EXPORT(png_byte,png_get_rgb_to_gray_status) PNGARG((png_structp + png_ptr)); +#endif + +extern PNG_EXPORT(void,png_build_grayscale_palette) PNGARG((int bit_depth, + png_colorp palette)); + +#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED) +extern PNG_EXPORT(void,png_set_strip_alpha) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \ + defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) +extern PNG_EXPORT(void,png_set_swap_alpha) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \ + defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) +extern PNG_EXPORT(void,png_set_invert_alpha) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) +/* Add a filler byte to 8-bit Gray or 24-bit RGB images. */ +extern PNG_EXPORT(void,png_set_filler) PNGARG((png_structp png_ptr, + png_uint_32 filler, int flags)); +/* The values of the PNG_FILLER_ defines should NOT be changed */ +#define PNG_FILLER_BEFORE 0 +#define PNG_FILLER_AFTER 1 +/* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */ +#if !defined(PNG_1_0_X) +extern PNG_EXPORT(void,png_set_add_alpha) PNGARG((png_structp png_ptr, + png_uint_32 filler, int flags)); +#endif +#endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */ + +#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) +/* Swap bytes in 16-bit depth files. */ +extern PNG_EXPORT(void,png_set_swap) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) +/* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */ +extern PNG_EXPORT(void,png_set_packing) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_PACKSWAP_SUPPORTED) || defined(PNG_WRITE_PACKSWAP_SUPPORTED) +/* Swap packing order of pixels in bytes. */ +extern PNG_EXPORT(void,png_set_packswap) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) +/* Converts files to legal bit depths. */ +extern PNG_EXPORT(void,png_set_shift) PNGARG((png_structp png_ptr, + png_color_8p true_bits)); +#endif + +#if defined(PNG_READ_INTERLACING_SUPPORTED) || \ + defined(PNG_WRITE_INTERLACING_SUPPORTED) +/* Have the code handle the interlacing. Returns the number of passes. */ +extern PNG_EXPORT(int,png_set_interlace_handling) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) +/* Invert monochrome files */ +extern PNG_EXPORT(void,png_set_invert_mono) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_BACKGROUND_SUPPORTED) +/* Handle alpha and tRNS by replacing with a background color. */ +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_background) PNGARG((png_structp png_ptr, + png_color_16p background_color, int background_gamma_code, + int need_expand, double background_gamma)); +#endif +#define PNG_BACKGROUND_GAMMA_UNKNOWN 0 +#define PNG_BACKGROUND_GAMMA_SCREEN 1 +#define PNG_BACKGROUND_GAMMA_FILE 2 +#define PNG_BACKGROUND_GAMMA_UNIQUE 3 +#endif + +#if defined(PNG_READ_16_TO_8_SUPPORTED) +/* strip the second byte of information from a 16-bit depth file. */ +extern PNG_EXPORT(void,png_set_strip_16) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_DITHER_SUPPORTED) +/* Turn on dithering, and reduce the palette to the number of colors available. */ +extern PNG_EXPORT(void,png_set_dither) PNGARG((png_structp png_ptr, + png_colorp palette, int num_palette, int maximum_colors, + png_uint_16p histogram, int full_dither)); +#endif + +#if defined(PNG_READ_GAMMA_SUPPORTED) +/* Handle gamma correction. Screen_gamma=(display_exponent) */ +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_gamma) PNGARG((png_structp png_ptr, + double screen_gamma, double default_file_gamma)); +#endif +#endif + +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +#if defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ + defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED) +/* Permit or disallow empty PLTE (0: not permitted, 1: permitted) */ +/* Deprecated and will be removed. Use png_permit_mng_features() instead. */ +extern PNG_EXPORT(void,png_permit_empty_plte) PNGARG((png_structp png_ptr, + int empty_plte_permitted)); +#endif +#endif + +#if defined(PNG_WRITE_FLUSH_SUPPORTED) +/* Set how many lines between output flushes - 0 for no flushing */ +extern PNG_EXPORT(void,png_set_flush) PNGARG((png_structp png_ptr, int nrows)); +/* Flush the current PNG output buffer */ +extern PNG_EXPORT(void,png_write_flush) PNGARG((png_structp png_ptr)); +#endif + +/* optional update palette with requested transformations */ +extern PNG_EXPORT(void,png_start_read_image) PNGARG((png_structp png_ptr)); + +/* optional call to update the users info structure */ +extern PNG_EXPORT(void,png_read_update_info) PNGARG((png_structp png_ptr, + png_infop info_ptr)); + +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED +/* read one or more rows of image data. */ +extern PNG_EXPORT(void,png_read_rows) PNGARG((png_structp png_ptr, + png_bytepp row, png_bytepp display_row, png_uint_32 num_rows)); +#endif + +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED +/* read a row of data. */ +extern PNG_EXPORT(void,png_read_row) PNGARG((png_structp png_ptr, + png_bytep row, + png_bytep display_row)); +#endif + +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED +/* read the whole image into memory at once. */ +extern PNG_EXPORT(void,png_read_image) PNGARG((png_structp png_ptr, + png_bytepp image)); +#endif + +/* write a row of image data */ +extern PNG_EXPORT(void,png_write_row) PNGARG((png_structp png_ptr, + png_bytep row)); + +/* write a few rows of image data */ +extern PNG_EXPORT(void,png_write_rows) PNGARG((png_structp png_ptr, + png_bytepp row, png_uint_32 num_rows)); + +/* write the image data */ +extern PNG_EXPORT(void,png_write_image) PNGARG((png_structp png_ptr, + png_bytepp image)); + +/* writes the end of the PNG file. */ +extern PNG_EXPORT(void,png_write_end) PNGARG((png_structp png_ptr, + png_infop info_ptr)); + +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED +/* read the end of the PNG file. */ +extern PNG_EXPORT(void,png_read_end) PNGARG((png_structp png_ptr, + png_infop info_ptr)); +#endif + +/* free any memory associated with the png_info_struct */ +extern PNG_EXPORT(void,png_destroy_info_struct) PNGARG((png_structp png_ptr, + png_infopp info_ptr_ptr)); + +/* free any memory associated with the png_struct and the png_info_structs */ +extern PNG_EXPORT(void,png_destroy_read_struct) PNGARG((png_structpp + png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr)); + +/* free all memory used by the read (old method - NOT DLL EXPORTED) */ +/* Debian note: exporting as it is required by legacy applications */ +extern PNG_EXPORT(void,png_read_destroy) PNGARG((png_structp png_ptr, png_infop info_ptr, + png_infop end_info_ptr)); + +/* free any memory associated with the png_struct and the png_info_structs */ +extern PNG_EXPORT(void,png_destroy_write_struct) + PNGARG((png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)); + +/* free any memory used in png_ptr struct (old method - NOT DLL EXPORTED) */ +/* Debian note: exporting as it is required by legacy applications */ +extern PNG_EXPORT(void,png_write_destroy) PNGARG((png_structp png_ptr)); + +/* set the libpng method of handling chunk CRC errors */ +extern PNG_EXPORT(void,png_set_crc_action) PNGARG((png_structp png_ptr, + int crit_action, int ancil_action)); + +/* Values for png_set_crc_action() to say how to handle CRC errors in + * ancillary and critical chunks, and whether to use the data contained + * therein. Note that it is impossible to "discard" data in a critical + * chunk. For versions prior to 0.90, the action was always error/quit, + * whereas in version 0.90 and later, the action for CRC errors in ancillary + * chunks is warn/discard. These values should NOT be changed. + * + * value action:critical action:ancillary + */ +#define PNG_CRC_DEFAULT 0 /* error/quit warn/discard data */ +#define PNG_CRC_ERROR_QUIT 1 /* error/quit error/quit */ +#define PNG_CRC_WARN_DISCARD 2 /* (INVALID) warn/discard data */ +#define PNG_CRC_WARN_USE 3 /* warn/use data warn/use data */ +#define PNG_CRC_QUIET_USE 4 /* quiet/use data quiet/use data */ +#define PNG_CRC_NO_CHANGE 5 /* use current value use current value */ + +/* These functions give the user control over the scan-line filtering in + * libpng and the compression methods used by zlib. These functions are + * mainly useful for testing, as the defaults should work with most users. + * Those users who are tight on memory or want faster performance at the + * expense of compression can modify them. See the compression library + * header file (zlib.h) for an explination of the compression functions. + */ + +/* set the filtering method(s) used by libpng. Currently, the only valid + * value for "method" is 0. + */ +extern PNG_EXPORT(void,png_set_filter) PNGARG((png_structp png_ptr, int method, + int filters)); + +/* Flags for png_set_filter() to say which filters to use. The flags + * are chosen so that they don't conflict with real filter types + * below, in case they are supplied instead of the #defined constants. + * These values should NOT be changed. + */ +#define PNG_NO_FILTERS 0x00 +#define PNG_FILTER_NONE 0x08 +#define PNG_FILTER_SUB 0x10 +#define PNG_FILTER_UP 0x20 +#define PNG_FILTER_AVG 0x40 +#define PNG_FILTER_PAETH 0x80 +#define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \ + PNG_FILTER_AVG | PNG_FILTER_PAETH) + +/* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now. + * These defines should NOT be changed. + */ +#define PNG_FILTER_VALUE_NONE 0 +#define PNG_FILTER_VALUE_SUB 1 +#define PNG_FILTER_VALUE_UP 2 +#define PNG_FILTER_VALUE_AVG 3 +#define PNG_FILTER_VALUE_PAETH 4 +#define PNG_FILTER_VALUE_LAST 5 + +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) /* EXPERIMENTAL */ +/* The "heuristic_method" is given by one of the PNG_FILTER_HEURISTIC_ + * defines, either the default (minimum-sum-of-absolute-differences), or + * the experimental method (weighted-minimum-sum-of-absolute-differences). + * + * Weights are factors >= 1.0, indicating how important it is to keep the + * filter type consistent between rows. Larger numbers mean the current + * filter is that many times as likely to be the same as the "num_weights" + * previous filters. This is cumulative for each previous row with a weight. + * There needs to be "num_weights" values in "filter_weights", or it can be + * NULL if the weights aren't being specified. Weights have no influence on + * the selection of the first row filter. Well chosen weights can (in theory) + * improve the compression for a given image. + * + * Costs are factors >= 1.0 indicating the relative decoding costs of a + * filter type. Higher costs indicate more decoding expense, and are + * therefore less likely to be selected over a filter with lower computational + * costs. There needs to be a value in "filter_costs" for each valid filter + * type (given by PNG_FILTER_VALUE_LAST), or it can be NULL if you aren't + * setting the costs. Costs try to improve the speed of decompression without + * unduly increasing the compressed image size. + * + * A negative weight or cost indicates the default value is to be used, and + * values in the range [0.0, 1.0) indicate the value is to remain unchanged. + * The default values for both weights and costs are currently 1.0, but may + * change if good general weighting/cost heuristics can be found. If both + * the weights and costs are set to 1.0, this degenerates the WEIGHTED method + * to the UNWEIGHTED method, but with added encoding time/computation. + */ +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_filter_heuristics) PNGARG((png_structp png_ptr, + int heuristic_method, int num_weights, png_doublep filter_weights, + png_doublep filter_costs)); +#endif +#endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */ + +/* Heuristic used for row filter selection. These defines should NOT be + * changed. + */ +#define PNG_FILTER_HEURISTIC_DEFAULT 0 /* Currently "UNWEIGHTED" */ +#define PNG_FILTER_HEURISTIC_UNWEIGHTED 1 /* Used by libpng < 0.95 */ +#define PNG_FILTER_HEURISTIC_WEIGHTED 2 /* Experimental feature */ +#define PNG_FILTER_HEURISTIC_LAST 3 /* Not a valid value */ + +/* Set the library compression level. Currently, valid values range from + * 0 - 9, corresponding directly to the zlib compression levels 0 - 9 + * (0 - no compression, 9 - "maximal" compression). Note that tests have + * shown that zlib compression levels 3-6 usually perform as well as level 9 + * for PNG images, and do considerably fewer caclulations. In the future, + * these values may not correspond directly to the zlib compression levels. + */ +extern PNG_EXPORT(void,png_set_compression_level) PNGARG((png_structp png_ptr, + int level)); + +extern PNG_EXPORT(void,png_set_compression_mem_level) + PNGARG((png_structp png_ptr, int mem_level)); + +extern PNG_EXPORT(void,png_set_compression_strategy) + PNGARG((png_structp png_ptr, int strategy)); + +extern PNG_EXPORT(void,png_set_compression_window_bits) + PNGARG((png_structp png_ptr, int window_bits)); + +extern PNG_EXPORT(void,png_set_compression_method) PNGARG((png_structp png_ptr, + int method)); + +/* These next functions are called for input/output, memory, and error + * handling. They are in the file pngrio.c, pngwio.c, and pngerror.c, + * and call standard C I/O routines such as fread(), fwrite(), and + * fprintf(). These functions can be made to use other I/O routines + * at run time for those applications that need to handle I/O in a + * different manner by calling png_set_???_fn(). See libpng.txt for + * more information. + */ + +#if !defined(PNG_NO_STDIO) +/* Initialize the input/output for the PNG file to the default functions. */ +extern PNG_EXPORT(void,png_init_io) PNGARG((png_structp png_ptr, png_FILE_p fp)); +#endif + +/* Replace the (error and abort), and warning functions with user + * supplied functions. If no messages are to be printed you must still + * write and use replacement functions. The replacement error_fn should + * still do a longjmp to the last setjmp location if you are using this + * method of error handling. If error_fn or warning_fn is NULL, the + * default function will be used. + */ + +extern PNG_EXPORT(void,png_set_error_fn) PNGARG((png_structp png_ptr, + png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn)); + +/* Return the user pointer associated with the error functions */ +extern PNG_EXPORT(png_voidp,png_get_error_ptr) PNGARG((png_structp png_ptr)); + +/* Replace the default data output functions with a user supplied one(s). + * If buffered output is not used, then output_flush_fn can be set to NULL. + * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time + * output_flush_fn will be ignored (and thus can be NULL). + * It is probably a mistake to use NULL for output_flush_fn if + * write_data_fn is not also NULL unless you have built libpng with + * PNG_WRITE_FLUSH_SUPPORTED undefined, because in this case libpng's + * default flush function, which uses the standard *FILE structure, will + * be used. + */ +extern PNG_EXPORT(void,png_set_write_fn) PNGARG((png_structp png_ptr, + png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)); + +/* Replace the default data input function with a user supplied one. */ +extern PNG_EXPORT(void,png_set_read_fn) PNGARG((png_structp png_ptr, + png_voidp io_ptr, png_rw_ptr read_data_fn)); + +/* Return the user pointer associated with the I/O functions */ +extern PNG_EXPORT(png_voidp,png_get_io_ptr) PNGARG((png_structp png_ptr)); + +extern PNG_EXPORT(void,png_set_read_status_fn) PNGARG((png_structp png_ptr, + png_read_status_ptr read_row_fn)); + +extern PNG_EXPORT(void,png_set_write_status_fn) PNGARG((png_structp png_ptr, + png_write_status_ptr write_row_fn)); + +#ifdef PNG_USER_MEM_SUPPORTED +/* Replace the default memory allocation functions with user supplied one(s). */ +extern PNG_EXPORT(void,png_set_mem_fn) PNGARG((png_structp png_ptr, + png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn)); +/* Return the user pointer associated with the memory functions */ +extern PNG_EXPORT(png_voidp,png_get_mem_ptr) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_LEGACY_SUPPORTED) +extern PNG_EXPORT(void,png_set_read_user_transform_fn) PNGARG((png_structp + png_ptr, png_user_transform_ptr read_user_transform_fn)); +#endif + +#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_LEGACY_SUPPORTED) +extern PNG_EXPORT(void,png_set_write_user_transform_fn) PNGARG((png_structp + png_ptr, png_user_transform_ptr write_user_transform_fn)); +#endif + +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_LEGACY_SUPPORTED) +extern PNG_EXPORT(void,png_set_user_transform_info) PNGARG((png_structp + png_ptr, png_voidp user_transform_ptr, int user_transform_depth, + int user_transform_channels)); +/* Return the user pointer associated with the user transform functions */ +extern PNG_EXPORT(png_voidp,png_get_user_transform_ptr) + PNGARG((png_structp png_ptr)); +#endif + +#ifdef PNG_USER_CHUNKS_SUPPORTED +extern PNG_EXPORT(void,png_set_read_user_chunk_fn) PNGARG((png_structp png_ptr, + png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn)); +extern PNG_EXPORT(png_voidp,png_get_user_chunk_ptr) PNGARG((png_structp + png_ptr)); +#endif + +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +/* Sets the function callbacks for the push reader, and a pointer to a + * user-defined structure available to the callback functions. + */ +extern PNG_EXPORT(void,png_set_progressive_read_fn) PNGARG((png_structp png_ptr, + png_voidp progressive_ptr, + png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn, + png_progressive_end_ptr end_fn)); + +/* returns the user pointer associated with the push read functions */ +extern PNG_EXPORT(png_voidp,png_get_progressive_ptr) + PNGARG((png_structp png_ptr)); + +/* function to be called when data becomes available */ +extern PNG_EXPORT(void,png_process_data) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_bytep buffer, png_size_t buffer_size)); + +/* function that combines rows. Not very much different than the + * png_combine_row() call. Is this even used????? + */ +extern PNG_EXPORT(void,png_progressive_combine_row) PNGARG((png_structp png_ptr, + png_bytep old_row, png_bytep new_row)); +#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ + +extern PNG_EXPORT(png_voidp,png_malloc) PNGARG((png_structp png_ptr, + png_uint_32 size)); + +#if defined(PNG_1_0_X) +# define png_malloc_warn png_malloc +#else +/* Added at libpng version 1.2.4 */ +extern PNG_EXPORT(png_voidp,png_malloc_warn) PNGARG((png_structp png_ptr, + png_uint_32 size)); +#endif + +/* frees a pointer allocated by png_malloc() */ +extern PNG_EXPORT(void,png_free) PNGARG((png_structp png_ptr, png_voidp ptr)); + +#if defined(PNG_1_0_X) +/* Function to allocate memory for zlib. */ +extern PNG_EXPORT(voidpf,png_zalloc) PNGARG((voidpf png_ptr, uInt items, + uInt size)); + +/* Function to free memory for zlib */ +extern PNG_EXPORT(void,png_zfree) PNGARG((voidpf png_ptr, voidpf ptr)); +#endif + +/* Free data that was allocated internally */ +extern PNG_EXPORT(void,png_free_data) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 free_me, int num)); +#ifdef PNG_FREE_ME_SUPPORTED +/* Reassign responsibility for freeing existing data, whether allocated + * by libpng or by the application */ +extern PNG_EXPORT(void,png_data_freer) PNGARG((png_structp png_ptr, + png_infop info_ptr, int freer, png_uint_32 mask)); +#endif +/* assignments for png_data_freer */ +#define PNG_DESTROY_WILL_FREE_DATA 1 +#define PNG_SET_WILL_FREE_DATA 1 +#define PNG_USER_WILL_FREE_DATA 2 +/* Flags for png_ptr->free_me and info_ptr->free_me */ +#define PNG_FREE_HIST 0x0008 +#define PNG_FREE_ICCP 0x0010 +#define PNG_FREE_SPLT 0x0020 +#define PNG_FREE_ROWS 0x0040 +#define PNG_FREE_PCAL 0x0080 +#define PNG_FREE_SCAL 0x0100 +#define PNG_FREE_UNKN 0x0200 +#define PNG_FREE_LIST 0x0400 +#define PNG_FREE_PLTE 0x1000 +#define PNG_FREE_TRNS 0x2000 +#define PNG_FREE_TEXT 0x4000 +#define PNG_FREE_ALL 0x7fff +#define PNG_FREE_MUL 0x4220 /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */ + +#ifdef PNG_USER_MEM_SUPPORTED +extern PNG_EXPORT(png_voidp,png_malloc_default) PNGARG((png_structp png_ptr, + png_uint_32 size)); +extern PNG_EXPORT(void,png_free_default) PNGARG((png_structp png_ptr, + png_voidp ptr)); +#endif + +extern PNG_EXPORT(png_voidp,png_memcpy_check) PNGARG((png_structp png_ptr, + png_voidp s1, png_voidp s2, png_uint_32 size)); + +extern PNG_EXPORT(png_voidp,png_memset_check) PNGARG((png_structp png_ptr, + png_voidp s1, int value, png_uint_32 size)); + +#if defined(USE_FAR_KEYWORD) /* memory model conversion function */ +extern void *png_far_to_near PNGARG((png_structp png_ptr,png_voidp ptr, + int check)); +#endif /* USE_FAR_KEYWORD */ + +#ifndef PNG_NO_ERROR_TEXT +/* Fatal error in PNG image of libpng - can't continue */ +extern PNG_EXPORT(void,png_error) PNGARG((png_structp png_ptr, + png_const_charp error_message)); + +/* The same, but the chunk name is prepended to the error string. */ +extern PNG_EXPORT(void,png_chunk_error) PNGARG((png_structp png_ptr, + png_const_charp error_message)); +#else +/* Fatal error in PNG image of libpng - can't continue */ +extern PNG_EXPORT(void,png_err) PNGARG((png_structp png_ptr)); +#endif + +#ifndef PNG_NO_WARNINGS +/* Non-fatal error in libpng. Can continue, but may have a problem. */ +extern PNG_EXPORT(void,png_warning) PNGARG((png_structp png_ptr, + png_const_charp warning_message)); + +#ifdef PNG_READ_SUPPORTED +/* Non-fatal error in libpng, chunk name is prepended to message. */ +extern PNG_EXPORT(void,png_chunk_warning) PNGARG((png_structp png_ptr, + png_const_charp warning_message)); +#endif /* PNG_READ_SUPPORTED */ +#endif /* PNG_NO_WARNINGS */ + +/* The png_set_<chunk> functions are for storing values in the png_info_struct. + * Similarly, the png_get_<chunk> calls are used to read values from the + * png_info_struct, either storing the parameters in the passed variables, or + * setting pointers into the png_info_struct where the data is stored. The + * png_get_<chunk> functions return a non-zero value if the data was available + * in info_ptr, or return zero and do not change any of the parameters if the + * data was not available. + * + * These functions should be used instead of directly accessing png_info + * to avoid problems with future changes in the size and internal layout of + * png_info_struct. + */ +/* Returns "flag" if chunk data is valid in info_ptr. */ +extern PNG_EXPORT(png_uint_32,png_get_valid) PNGARG((png_structp png_ptr, +png_infop info_ptr, png_uint_32 flag)); + +/* Returns number of bytes needed to hold a transformed row. */ +extern PNG_EXPORT(png_uint_32,png_get_rowbytes) PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +#if defined(PNG_INFO_IMAGE_SUPPORTED) +/* Returns row_pointers, which is an array of pointers to scanlines that was +returned from png_read_png(). */ +extern PNG_EXPORT(png_bytepp,png_get_rows) PNGARG((png_structp png_ptr, +png_infop info_ptr)); +/* Set row_pointers, which is an array of pointers to scanlines for use +by png_write_png(). */ +extern PNG_EXPORT(void,png_set_rows) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_bytepp row_pointers)); +#endif + +/* Returns number of color channels in image. */ +extern PNG_EXPORT(png_byte,png_get_channels) PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +#ifdef PNG_EASY_ACCESS_SUPPORTED +/* Returns image width in pixels. */ +extern PNG_EXPORT(png_uint_32, png_get_image_width) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image height in pixels. */ +extern PNG_EXPORT(png_uint_32, png_get_image_height) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image bit_depth. */ +extern PNG_EXPORT(png_byte, png_get_bit_depth) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image color_type. */ +extern PNG_EXPORT(png_byte, png_get_color_type) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image filter_type. */ +extern PNG_EXPORT(png_byte, png_get_filter_type) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image interlace_type. */ +extern PNG_EXPORT(png_byte, png_get_interlace_type) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image compression_type. */ +extern PNG_EXPORT(png_byte, png_get_compression_type) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image resolution in pixels per meter, from pHYs chunk data. */ +extern PNG_EXPORT(png_uint_32, png_get_pixels_per_meter) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_uint_32, png_get_x_pixels_per_meter) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_uint_32, png_get_y_pixels_per_meter) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns pixel aspect ratio, computed from pHYs chunk data. */ +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(float, png_get_pixel_aspect_ratio) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +#endif + +/* Returns image x, y offset in pixels or microns, from oFFs chunk data. */ +extern PNG_EXPORT(png_int_32, png_get_x_offset_pixels) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_int_32, png_get_y_offset_pixels) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_int_32, png_get_x_offset_microns) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_int_32, png_get_y_offset_microns) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +#endif /* PNG_EASY_ACCESS_SUPPORTED */ + +/* Returns pointer to signature string read from PNG header */ +extern PNG_EXPORT(png_bytep,png_get_signature) PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +#if defined(PNG_bKGD_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_bKGD) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_color_16p *background)); +#endif + +#if defined(PNG_bKGD_SUPPORTED) +extern PNG_EXPORT(void,png_set_bKGD) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_color_16p background)); +#endif + +#if defined(PNG_cHRM_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_cHRM) PNGARG((png_structp png_ptr, + png_infop info_ptr, double *white_x, double *white_y, double *red_x, + double *red_y, double *green_x, double *green_y, double *blue_x, + double *blue_y)); +#endif +#ifdef PNG_FIXED_POINT_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_cHRM_fixed) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_fixed_point *int_white_x, png_fixed_point + *int_white_y, png_fixed_point *int_red_x, png_fixed_point *int_red_y, + png_fixed_point *int_green_x, png_fixed_point *int_green_y, png_fixed_point + *int_blue_x, png_fixed_point *int_blue_y)); +#endif +#endif + +#if defined(PNG_cHRM_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_cHRM) PNGARG((png_structp png_ptr, + png_infop info_ptr, double white_x, double white_y, double red_x, + double red_y, double green_x, double green_y, double blue_x, double blue_y)); +#endif +#ifdef PNG_FIXED_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_cHRM_fixed) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_fixed_point int_white_x, png_fixed_point int_white_y, + png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point + int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, + png_fixed_point int_blue_y)); +#endif +#endif + +#if defined(PNG_gAMA_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_gAMA) PNGARG((png_structp png_ptr, + png_infop info_ptr, double *file_gamma)); +#endif +extern PNG_EXPORT(png_uint_32,png_get_gAMA_fixed) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_fixed_point *int_file_gamma)); +#endif + +#if defined(PNG_gAMA_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_gAMA) PNGARG((png_structp png_ptr, + png_infop info_ptr, double file_gamma)); +#endif +extern PNG_EXPORT(void,png_set_gAMA_fixed) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_fixed_point int_file_gamma)); +#endif + +#if defined(PNG_hIST_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_hIST) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_16p *hist)); +#endif + +#if defined(PNG_hIST_SUPPORTED) +extern PNG_EXPORT(void,png_set_hIST) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_16p hist)); +#endif + +extern PNG_EXPORT(png_uint_32,png_get_IHDR) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 *width, png_uint_32 *height, + int *bit_depth, int *color_type, int *interlace_method, + int *compression_method, int *filter_method)); + +extern PNG_EXPORT(void,png_set_IHDR) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, + int color_type, int interlace_method, int compression_method, + int filter_method)); + +#if defined(PNG_oFFs_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_oFFs) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_int_32 *offset_x, png_int_32 *offset_y, + int *unit_type)); +#endif + +#if defined(PNG_oFFs_SUPPORTED) +extern PNG_EXPORT(void,png_set_oFFs) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_int_32 offset_x, png_int_32 offset_y, + int unit_type)); +#endif + +#if defined(PNG_pCAL_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_pCAL) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1, + int *type, int *nparams, png_charp *units, png_charpp *params)); +#endif + +#if defined(PNG_pCAL_SUPPORTED) +extern PNG_EXPORT(void,png_set_pCAL) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_charp purpose, png_int_32 X0, png_int_32 X1, + int type, int nparams, png_charp units, png_charpp params)); +#endif + +#if defined(PNG_pHYs_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_pHYs) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); +#endif + +#if defined(PNG_pHYs_SUPPORTED) +extern PNG_EXPORT(void,png_set_pHYs) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type)); +#endif + +extern PNG_EXPORT(png_uint_32,png_get_PLTE) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_colorp *palette, int *num_palette)); + +extern PNG_EXPORT(void,png_set_PLTE) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_colorp palette, int num_palette)); + +#if defined(PNG_sBIT_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_sBIT) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_color_8p *sig_bit)); +#endif + +#if defined(PNG_sBIT_SUPPORTED) +extern PNG_EXPORT(void,png_set_sBIT) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_color_8p sig_bit)); +#endif + +#if defined(PNG_sRGB_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_sRGB) PNGARG((png_structp png_ptr, + png_infop info_ptr, int *intent)); +#endif + +#if defined(PNG_sRGB_SUPPORTED) +extern PNG_EXPORT(void,png_set_sRGB) PNGARG((png_structp png_ptr, + png_infop info_ptr, int intent)); +extern PNG_EXPORT(void,png_set_sRGB_gAMA_and_cHRM) PNGARG((png_structp png_ptr, + png_infop info_ptr, int intent)); +#endif + +#if defined(PNG_iCCP_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_iCCP) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_charpp name, int *compression_type, + png_charpp profile, png_uint_32 *proflen)); + /* Note to maintainer: profile should be png_bytepp */ +#endif + +#if defined(PNG_iCCP_SUPPORTED) +extern PNG_EXPORT(void,png_set_iCCP) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_charp name, int compression_type, + png_charp profile, png_uint_32 proflen)); + /* Note to maintainer: profile should be png_bytep */ +#endif + +#if defined(PNG_sPLT_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_sPLT) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_sPLT_tpp entries)); +#endif + +#if defined(PNG_sPLT_SUPPORTED) +extern PNG_EXPORT(void,png_set_sPLT) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_sPLT_tp entries, int nentries)); +#endif + +#if defined(PNG_TEXT_SUPPORTED) +/* png_get_text also returns the number of text chunks in *num_text */ +extern PNG_EXPORT(png_uint_32,png_get_text) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_textp *text_ptr, int *num_text)); +#endif + +/* + * Note while png_set_text() will accept a structure whose text, + * language, and translated keywords are NULL pointers, the structure + * returned by png_get_text will always contain regular + * zero-terminated C strings. They might be empty strings but + * they will never be NULL pointers. + */ + +#if defined(PNG_TEXT_SUPPORTED) +extern PNG_EXPORT(void,png_set_text) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_textp text_ptr, int num_text)); +#endif + +#if defined(PNG_tIME_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_tIME) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_timep *mod_time)); +#endif + +#if defined(PNG_tIME_SUPPORTED) +extern PNG_EXPORT(void,png_set_tIME) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_timep mod_time)); +#endif + +#if defined(PNG_tRNS_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_tRNS) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_bytep *trans, int *num_trans, + png_color_16p *trans_values)); +#endif + +#if defined(PNG_tRNS_SUPPORTED) +extern PNG_EXPORT(void,png_set_tRNS) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_bytep trans, int num_trans, + png_color_16p trans_values)); +#endif + +#if defined(PNG_tRNS_SUPPORTED) +#endif + +#if defined(PNG_sCAL_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_sCAL) PNGARG((png_structp png_ptr, + png_infop info_ptr, int *unit, double *width, double *height)); +#else +#ifdef PNG_FIXED_POINT_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_sCAL_s) PNGARG((png_structp png_ptr, + png_infop info_ptr, int *unit, png_charpp swidth, png_charpp sheight)); +#endif +#endif +#endif /* PNG_sCAL_SUPPORTED */ + +#if defined(PNG_sCAL_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_sCAL) PNGARG((png_structp png_ptr, + png_infop info_ptr, int unit, double width, double height)); +#else +#ifdef PNG_FIXED_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_sCAL_s) PNGARG((png_structp png_ptr, + png_infop info_ptr, int unit, png_charp swidth, png_charp sheight)); +#endif +#endif +#endif /* PNG_sCAL_SUPPORTED || PNG_WRITE_sCAL_SUPPORTED */ + +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) +/* provide a list of chunks and how they are to be handled, if the built-in + handling or default unknown chunk handling is not desired. Any chunks not + listed will be handled in the default manner. The IHDR and IEND chunks + must not be listed. + keep = 0: follow default behaviour + = 1: do not keep + = 2: keep only if safe-to-copy + = 3: keep even if unsafe-to-copy +*/ +extern PNG_EXPORT(void, png_set_keep_unknown_chunks) PNGARG((png_structp + png_ptr, int keep, png_bytep chunk_list, int num_chunks)); +extern PNG_EXPORT(void, png_set_unknown_chunks) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns)); +extern PNG_EXPORT(void, png_set_unknown_chunk_location) + PNGARG((png_structp png_ptr, png_infop info_ptr, int chunk, int location)); +extern PNG_EXPORT(png_uint_32,png_get_unknown_chunks) PNGARG((png_structp + png_ptr, png_infop info_ptr, png_unknown_chunkpp entries)); +#endif +#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED +PNG_EXPORT(int,png_handle_as_unknown) PNGARG((png_structp png_ptr, png_bytep + chunk_name)); +#endif + +/* Png_free_data() will turn off the "valid" flag for anything it frees. + If you need to turn it off for a chunk that your application has freed, + you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK); */ +extern PNG_EXPORT(void, png_set_invalid) PNGARG((png_structp png_ptr, + png_infop info_ptr, int mask)); + +#if defined(PNG_INFO_IMAGE_SUPPORTED) +/* The "params" pointer is currently not used and is for future expansion. */ +extern PNG_EXPORT(void, png_read_png) PNGARG((png_structp png_ptr, + png_infop info_ptr, + int transforms, + png_voidp params)); +extern PNG_EXPORT(void, png_write_png) PNGARG((png_structp png_ptr, + png_infop info_ptr, + int transforms, + png_voidp params)); +#endif + +/* Define PNG_DEBUG at compile time for debugging information. Higher + * numbers for PNG_DEBUG mean more debugging information. This has + * only been added since version 0.95 so it is not implemented throughout + * libpng yet, but more support will be added as needed. + */ +#ifdef PNG_DEBUG +#if (PNG_DEBUG > 0) +#if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER) +#include <crtdbg.h> +#if (PNG_DEBUG > 1) +#ifndef _DEBUG +# define _DEBUG +#endif +#ifndef png_debug +#define png_debug(l,m) _RPT0(_CRT_WARN,m PNG_STRING_NEWLINE) +#endif +#ifndef png_debug1 +#define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m PNG_STRING_NEWLINE,p1) +#endif +#ifndef png_debug2 +#define png_debug2(l,m,p1,p2) _RPT2(_CRT_WARN,m PNG_STRING_NEWLINE,p1,p2) +#endif +#endif +#else /* PNG_DEBUG_FILE || !_MSC_VER */ +#ifndef PNG_DEBUG_FILE +#define PNG_DEBUG_FILE stderr +#endif /* PNG_DEBUG_FILE */ + +#if (PNG_DEBUG > 1) +/* Note: ["%s"m PNG_STRING_NEWLINE] probably does not work on + * non-ISO compilers */ +# ifdef __STDC__ +# ifndef png_debug +# define png_debug(l,m) \ + { \ + int num_tabs=l; \ + fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \ + } +# endif +# ifndef png_debug1 +# define png_debug1(l,m,p1) \ + { \ + int num_tabs=l; \ + fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \ + } +# endif +# ifndef png_debug2 +# define png_debug2(l,m,p1,p2) \ + { \ + int num_tabs=l; \ + fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \ + } +# endif +# else /* __STDC __ */ +# ifndef png_debug +# define png_debug(l,m) \ + { \ + int num_tabs=l; \ + char format[256]; \ + snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ + m,PNG_STRING_NEWLINE); \ + fprintf(PNG_DEBUG_FILE,format); \ + } +# endif +# ifndef png_debug1 +# define png_debug1(l,m,p1) \ + { \ + int num_tabs=l; \ + char format[256]; \ + snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ + m,PNG_STRING_NEWLINE); \ + fprintf(PNG_DEBUG_FILE,format,p1); \ + } +# endif +# ifndef png_debug2 +# define png_debug2(l,m,p1,p2) \ + { \ + int num_tabs=l; \ + char format[256]; \ + snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ + m,PNG_STRING_NEWLINE); \ + fprintf(PNG_DEBUG_FILE,format,p1,p2); \ + } +# endif +# endif /* __STDC __ */ +#endif /* (PNG_DEBUG > 1) */ + +#endif /* _MSC_VER */ +#endif /* (PNG_DEBUG > 0) */ +#endif /* PNG_DEBUG */ +#ifndef png_debug +#define png_debug(l, m) +#endif +#ifndef png_debug1 +#define png_debug1(l, m, p1) +#endif +#ifndef png_debug2 +#define png_debug2(l, m, p1, p2) +#endif + +extern PNG_EXPORT(png_charp,png_get_copyright) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(png_charp,png_get_header_ver) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(png_charp,png_get_header_version) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((png_structp png_ptr)); + +#ifdef PNG_MNG_FEATURES_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_permit_mng_features) PNGARG((png_structp + png_ptr, png_uint_32 mng_features_permitted)); +#endif + +/* For use in png_set_keep_unknown, added to version 1.2.6 */ +#define PNG_HANDLE_CHUNK_AS_DEFAULT 0 +#define PNG_HANDLE_CHUNK_NEVER 1 +#define PNG_HANDLE_CHUNK_IF_SAFE 2 +#define PNG_HANDLE_CHUNK_ALWAYS 3 + +/* Added to version 1.2.0 */ +#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) +#if defined(PNG_MMX_CODE_SUPPORTED) +#define PNG_ASM_FLAG_MMX_SUPPORT_COMPILED 0x01 /* not user-settable */ +#define PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU 0x02 /* not user-settable */ +#define PNG_ASM_FLAG_MMX_READ_COMBINE_ROW 0x04 +#define PNG_ASM_FLAG_MMX_READ_INTERLACE 0x08 +#define PNG_ASM_FLAG_MMX_READ_FILTER_SUB 0x10 +#define PNG_ASM_FLAG_MMX_READ_FILTER_UP 0x20 +#define PNG_ASM_FLAG_MMX_READ_FILTER_AVG 0x40 +#define PNG_ASM_FLAG_MMX_READ_FILTER_PAETH 0x80 +#define PNG_ASM_FLAGS_INITIALIZED 0x80000000 /* not user-settable */ + +#define PNG_MMX_READ_FLAGS ( PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \ + | PNG_ASM_FLAG_MMX_READ_INTERLACE \ + | PNG_ASM_FLAG_MMX_READ_FILTER_SUB \ + | PNG_ASM_FLAG_MMX_READ_FILTER_UP \ + | PNG_ASM_FLAG_MMX_READ_FILTER_AVG \ + | PNG_ASM_FLAG_MMX_READ_FILTER_PAETH ) +#define PNG_MMX_WRITE_FLAGS ( 0 ) + +#define PNG_MMX_FLAGS ( PNG_ASM_FLAG_MMX_SUPPORT_COMPILED \ + | PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU \ + | PNG_MMX_READ_FLAGS \ + | PNG_MMX_WRITE_FLAGS ) + +#define PNG_SELECT_READ 1 +#define PNG_SELECT_WRITE 2 +#endif /* PNG_MMX_CODE_SUPPORTED */ + +#if !defined(PNG_1_0_X) +/* pngget.c */ +extern PNG_EXPORT(png_uint_32,png_get_mmx_flagmask) + PNGARG((int flag_select, int *compilerID)); + +/* pngget.c */ +extern PNG_EXPORT(png_uint_32,png_get_asm_flagmask) + PNGARG((int flag_select)); + +/* pngget.c */ +extern PNG_EXPORT(png_uint_32,png_get_asm_flags) + PNGARG((png_structp png_ptr)); + +/* pngget.c */ +extern PNG_EXPORT(png_byte,png_get_mmx_bitdepth_threshold) + PNGARG((png_structp png_ptr)); + +/* pngget.c */ +extern PNG_EXPORT(png_uint_32,png_get_mmx_rowbytes_threshold) + PNGARG((png_structp png_ptr)); + +/* pngset.c */ +extern PNG_EXPORT(void,png_set_asm_flags) + PNGARG((png_structp png_ptr, png_uint_32 asm_flags)); + +/* pngset.c */ +extern PNG_EXPORT(void,png_set_mmx_thresholds) + PNGARG((png_structp png_ptr, png_byte mmx_bitdepth_threshold, + png_uint_32 mmx_rowbytes_threshold)); + +#endif /* PNG_1_0_X */ + +#if !defined(PNG_1_0_X) +/* png.c, pnggccrd.c, or pngvcrd.c */ +extern PNG_EXPORT(int,png_mmx_support) PNGARG((void)); +#endif /* PNG_1_0_X */ +#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ + +/* Strip the prepended error numbers ("#nnn ") from error and warning + * messages before passing them to the error or warning handler. */ +#ifdef PNG_ERROR_NUMBERS_SUPPORTED +extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp + png_ptr, png_uint_32 strip_mode)); +#endif + +/* Added at libpng-1.2.6 */ +#ifdef PNG_SET_USER_LIMITS_SUPPORTED +extern PNG_EXPORT(void,png_set_user_limits) PNGARG((png_structp + png_ptr, png_uint_32 user_width_max, png_uint_32 user_height_max)); +extern PNG_EXPORT(png_uint_32,png_get_user_width_max) PNGARG((png_structp + png_ptr)); +extern PNG_EXPORT(png_uint_32,png_get_user_height_max) PNGARG((png_structp + png_ptr)); +#endif + + +/* Maintainer: Put new public prototypes here ^, in libpng.3, and project defs */ + +#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED +/* With these routines we avoid an integer divide, which will be slower on + * most machines. However, it does take more operations than the corresponding + * divide method, so it may be slower on a few RISC systems. There are two + * shifts (by 8 or 16 bits) and an addition, versus a single integer divide. + * + * Note that the rounding factors are NOT supposed to be the same! 128 and + * 32768 are correct for the NODIV code; 127 and 32767 are correct for the + * standard method. + * + * [Optimized code by Greg Roelofs and Mark Adler...blame us for bugs. :-) ] + */ + + /* fg and bg should be in `gamma 1.0' space; alpha is the opacity */ + +# define png_composite(composite, fg, alpha, bg) \ + { png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) * (png_uint_16)(alpha) \ + + (png_uint_16)(bg)*(png_uint_16)(255 - \ + (png_uint_16)(alpha)) + (png_uint_16)128); \ + (composite) = (png_byte)((temp + (temp >> 8)) >> 8); } + +# define png_composite_16(composite, fg, alpha, bg) \ + { png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) * (png_uint_32)(alpha) \ + + (png_uint_32)(bg)*(png_uint_32)(65535L - \ + (png_uint_32)(alpha)) + (png_uint_32)32768L); \ + (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); } + +#else /* standard method using integer division */ + +# define png_composite(composite, fg, alpha, bg) \ + (composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) + \ + (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \ + (png_uint_16)127) / 255) + +# define png_composite_16(composite, fg, alpha, bg) \ + (composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \ + (png_uint_32)(bg)*(png_uint_32)(65535L - (png_uint_32)(alpha)) + \ + (png_uint_32)32767) / (png_uint_32)65535L) + +#endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */ + +/* Inline macros to do direct reads of bytes from the input buffer. These + * require that you are using an architecture that uses PNG byte ordering + * (MSB first) and supports unaligned data storage. I think that PowerPC + * in big-endian mode and 680x0 are the only ones that will support this. + * The x86 line of processors definitely do not. The png_get_int_32() + * routine also assumes we are using two's complement format for negative + * values, which is almost certainly true. + */ +#if defined(PNG_READ_BIG_ENDIAN_SUPPORTED) +# define png_get_uint_32(buf) ( *((png_uint_32p) (buf))) +# define png_get_uint_16(buf) ( *((png_uint_16p) (buf))) +# define png_get_int_32(buf) ( *((png_int_32p) (buf))) +#else +extern PNG_EXPORT(png_uint_32,png_get_uint_32) PNGARG((png_bytep buf)); +extern PNG_EXPORT(png_uint_16,png_get_uint_16) PNGARG((png_bytep buf)); +extern PNG_EXPORT(png_int_32,png_get_int_32) PNGARG((png_bytep buf)); +#endif /* !PNG_READ_BIG_ENDIAN_SUPPORTED */ +extern PNG_EXPORT(png_uint_32,png_get_uint_31) + PNGARG((png_structp png_ptr, png_bytep buf)); +/* No png_get_int_16 -- may be added if there's a real need for it. */ + +/* Place a 32-bit number into a buffer in PNG byte order (big-endian). + */ +extern PNG_EXPORT(void,png_save_uint_32) + PNGARG((png_bytep buf, png_uint_32 i)); +extern PNG_EXPORT(void,png_save_int_32) + PNGARG((png_bytep buf, png_int_32 i)); + +/* Place a 16-bit number into a buffer in PNG byte order. + * The parameter is declared unsigned int, not png_uint_16, + * just to avoid potential problems on pre-ANSI C compilers. + */ +extern PNG_EXPORT(void,png_save_uint_16) + PNGARG((png_bytep buf, unsigned int i)); +/* No png_save_int_16 -- may be added if there's a real need for it. */ + +/* ************************************************************************* */ + +/* These next functions are used internally in the code. They generally + * shouldn't be used unless you are writing code to add or replace some + * functionality in libpng. More information about most functions can + * be found in the files where the functions are located. + */ + + +/* Various modes of operation, that are visible to applications because + * they are used for unknown chunk location. + */ +#define PNG_HAVE_IHDR 0x01 +#define PNG_HAVE_PLTE 0x02 +#define PNG_HAVE_IDAT 0x04 +#define PNG_AFTER_IDAT 0x08 /* Have complete zlib datastream */ +#define PNG_HAVE_IEND 0x10 + +#if defined(PNG_INTERNAL) + +/* More modes of operation. Note that after an init, mode is set to + * zero automatically when the structure is created. + */ +#define PNG_HAVE_gAMA 0x20 +#define PNG_HAVE_cHRM 0x40 +#define PNG_HAVE_sRGB 0x80 +#define PNG_HAVE_CHUNK_HEADER 0x100 +#define PNG_WROTE_tIME 0x200 +#define PNG_WROTE_INFO_BEFORE_PLTE 0x400 +#define PNG_BACKGROUND_IS_GRAY 0x800 +#define PNG_HAVE_PNG_SIGNATURE 0x1000 +#define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */ + +/* flags for the transformations the PNG library does on the image data */ +#define PNG_BGR 0x0001 +#define PNG_INTERLACE 0x0002 +#define PNG_PACK 0x0004 +#define PNG_SHIFT 0x0008 +#define PNG_SWAP_BYTES 0x0010 +#define PNG_INVERT_MONO 0x0020 +#define PNG_DITHER 0x0040 +#define PNG_BACKGROUND 0x0080 +#define PNG_BACKGROUND_EXPAND 0x0100 + /* 0x0200 unused */ +#define PNG_16_TO_8 0x0400 +#define PNG_RGBA 0x0800 +#define PNG_EXPAND 0x1000 +#define PNG_GAMMA 0x2000 +#define PNG_GRAY_TO_RGB 0x4000 +#define PNG_FILLER 0x8000L +#define PNG_PACKSWAP 0x10000L +#define PNG_SWAP_ALPHA 0x20000L +#define PNG_STRIP_ALPHA 0x40000L +#define PNG_INVERT_ALPHA 0x80000L +#define PNG_USER_TRANSFORM 0x100000L +#define PNG_RGB_TO_GRAY_ERR 0x200000L +#define PNG_RGB_TO_GRAY_WARN 0x400000L +#define PNG_RGB_TO_GRAY 0x600000L /* two bits, RGB_TO_GRAY_ERR|WARN */ + /* 0x800000L Unused */ +#define PNG_ADD_ALPHA 0x1000000L /* Added to libpng-1.2.7 */ +#define PNG_EXPAND_tRNS 0x2000000L /* Added to libpng-1.2.9 */ + /* 0x4000000L unused */ + /* 0x8000000L unused */ + /* 0x10000000L unused */ + /* 0x20000000L unused */ + /* 0x40000000L unused */ + +/* flags for png_create_struct */ +#define PNG_STRUCT_PNG 0x0001 +#define PNG_STRUCT_INFO 0x0002 + +/* Scaling factor for filter heuristic weighting calculations */ +#define PNG_WEIGHT_SHIFT 8 +#define PNG_WEIGHT_FACTOR (1<<(PNG_WEIGHT_SHIFT)) +#define PNG_COST_SHIFT 3 +#define PNG_COST_FACTOR (1<<(PNG_COST_SHIFT)) + +/* flags for the png_ptr->flags rather than declaring a byte for each one */ +#define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001 +#define PNG_FLAG_ZLIB_CUSTOM_LEVEL 0x0002 +#define PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL 0x0004 +#define PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS 0x0008 +#define PNG_FLAG_ZLIB_CUSTOM_METHOD 0x0010 +#define PNG_FLAG_ZLIB_FINISHED 0x0020 +#define PNG_FLAG_ROW_INIT 0x0040 +#define PNG_FLAG_FILLER_AFTER 0x0080 +#define PNG_FLAG_CRC_ANCILLARY_USE 0x0100 +#define PNG_FLAG_CRC_ANCILLARY_NOWARN 0x0200 +#define PNG_FLAG_CRC_CRITICAL_USE 0x0400 +#define PNG_FLAG_CRC_CRITICAL_IGNORE 0x0800 +#define PNG_FLAG_FREE_PLTE 0x1000 +#define PNG_FLAG_FREE_TRNS 0x2000 +#define PNG_FLAG_FREE_HIST 0x4000 +#define PNG_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000L +#define PNG_FLAG_KEEP_UNSAFE_CHUNKS 0x10000L +#define PNG_FLAG_LIBRARY_MISMATCH 0x20000L +#define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000L +#define PNG_FLAG_STRIP_ERROR_TEXT 0x80000L +#define PNG_FLAG_MALLOC_NULL_MEM_OK 0x100000L +#define PNG_FLAG_ADD_ALPHA 0x200000L /* Added to libpng-1.2.8 */ +#define PNG_FLAG_STRIP_ALPHA 0x400000L /* Added to libpng-1.2.8 */ + /* 0x800000L unused */ + /* 0x1000000L unused */ + /* 0x2000000L unused */ + /* 0x4000000L unused */ + /* 0x8000000L unused */ + /* 0x10000000L unused */ + /* 0x20000000L unused */ + /* 0x40000000L unused */ + +#define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \ + PNG_FLAG_CRC_ANCILLARY_NOWARN) + +#define PNG_FLAG_CRC_CRITICAL_MASK (PNG_FLAG_CRC_CRITICAL_USE | \ + PNG_FLAG_CRC_CRITICAL_IGNORE) + +#define PNG_FLAG_CRC_MASK (PNG_FLAG_CRC_ANCILLARY_MASK | \ + PNG_FLAG_CRC_CRITICAL_MASK) + +/* save typing and make code easier to understand */ + +#define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \ + abs((int)((c1).green) - (int)((c2).green)) + \ + abs((int)((c1).blue) - (int)((c2).blue))) + +/* Added to libpng-1.2.6 JB */ +#define PNG_ROWBYTES(pixel_bits, width) \ + ((pixel_bits) >= 8 ? \ + ((width) * (((png_uint_32)(pixel_bits)) >> 3)) : \ + (( ((width) * ((png_uint_32)(pixel_bits))) + 7) >> 3) ) + +/* PNG_OUT_OF_RANGE returns true if value is outside the range + ideal-delta..ideal+delta. Each argument is evaluated twice. + "ideal" and "delta" should be constants, normally simple + integers, "value" a variable. Added to libpng-1.2.6 JB */ +#define PNG_OUT_OF_RANGE(value, ideal, delta) \ + ( (value) < (ideal)-(delta) || (value) > (ideal)+(delta) ) + +/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */ +#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN) +/* place to hold the signature string for a PNG file. */ +#ifdef PNG_USE_GLOBAL_ARRAYS + PNG_EXPORT_VAR (PNG_CONST png_byte FARDATA) png_sig[8]; +#else +#endif +#endif /* PNG_NO_EXTERN */ + +/* Constant strings for known chunk types. If you need to add a chunk, + * define the name here, and add an invocation of the macro in png.c and + * wherever it's needed. + */ +#define PNG_IHDR png_byte png_IHDR[5] = { 73, 72, 68, 82, '\0'} +#define PNG_IDAT png_byte png_IDAT[5] = { 73, 68, 65, 84, '\0'} +#define PNG_IEND png_byte png_IEND[5] = { 73, 69, 78, 68, '\0'} +#define PNG_PLTE png_byte png_PLTE[5] = { 80, 76, 84, 69, '\0'} +#define PNG_bKGD png_byte png_bKGD[5] = { 98, 75, 71, 68, '\0'} +#define PNG_cHRM png_byte png_cHRM[5] = { 99, 72, 82, 77, '\0'} +#define PNG_gAMA png_byte png_gAMA[5] = {103, 65, 77, 65, '\0'} +#define PNG_hIST png_byte png_hIST[5] = {104, 73, 83, 84, '\0'} +#define PNG_iCCP png_byte png_iCCP[5] = {105, 67, 67, 80, '\0'} +#define PNG_iTXt png_byte png_iTXt[5] = {105, 84, 88, 116, '\0'} +#define PNG_oFFs png_byte png_oFFs[5] = {111, 70, 70, 115, '\0'} +#define PNG_pCAL png_byte png_pCAL[5] = {112, 67, 65, 76, '\0'} +#define PNG_sCAL png_byte png_sCAL[5] = {115, 67, 65, 76, '\0'} +#define PNG_pHYs png_byte png_pHYs[5] = {112, 72, 89, 115, '\0'} +#define PNG_sBIT png_byte png_sBIT[5] = {115, 66, 73, 84, '\0'} +#define PNG_sPLT png_byte png_sPLT[5] = {115, 80, 76, 84, '\0'} +#define PNG_sRGB png_byte png_sRGB[5] = {115, 82, 71, 66, '\0'} +#define PNG_tEXt png_byte png_tEXt[5] = {116, 69, 88, 116, '\0'} +#define PNG_tIME png_byte png_tIME[5] = {116, 73, 77, 69, '\0'} +#define PNG_tRNS png_byte png_tRNS[5] = {116, 82, 78, 83, '\0'} +#define PNG_zTXt png_byte png_zTXt[5] = {122, 84, 88, 116, '\0'} + +#ifdef PNG_USE_GLOBAL_ARRAYS +PNG_EXPORT_VAR (png_byte FARDATA) png_IHDR[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_IDAT[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_IEND[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_PLTE[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_bKGD[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_cHRM[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_gAMA[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_hIST[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_iCCP[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_iTXt[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_oFFs[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_pCAL[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_sCAL[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_pHYs[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_sBIT[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_sPLT[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_sRGB[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_tEXt[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_tIME[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_tRNS[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_zTXt[5]; +#endif /* PNG_USE_GLOBAL_ARRAYS */ + +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +/* Initialize png_ptr struct for reading, and allocate any other memory. + * (old interface - DEPRECATED - use png_create_read_struct instead). + */ +extern PNG_EXPORT(void,png_read_init) PNGARG((png_structp png_ptr)); +#undef png_read_init +#define png_read_init(png_ptr) png_read_init_3(&png_ptr, \ + PNG_LIBPNG_VER_STRING, png_sizeof(png_struct)); +#endif + +extern PNG_EXPORT(void,png_read_init_3) PNGARG((png_structpp ptr_ptr, + png_const_charp user_png_ver, png_size_t png_struct_size)); +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +extern PNG_EXPORT(void,png_read_init_2) PNGARG((png_structp png_ptr, + png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t + png_info_size)); +#endif + +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +/* Initialize png_ptr struct for writing, and allocate any other memory. + * (old interface - DEPRECATED - use png_create_write_struct instead). + */ +extern PNG_EXPORT(void,png_write_init) PNGARG((png_structp png_ptr)); +#undef png_write_init +#define png_write_init(png_ptr) png_write_init_3(&png_ptr, \ + PNG_LIBPNG_VER_STRING, png_sizeof(png_struct)); +#endif + +extern PNG_EXPORT(void,png_write_init_3) PNGARG((png_structpp ptr_ptr, + png_const_charp user_png_ver, png_size_t png_struct_size)); +extern PNG_EXPORT(void,png_write_init_2) PNGARG((png_structp png_ptr, + png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t + png_info_size)); + +/* Allocate memory for an internal libpng struct */ +PNG_EXTERN png_voidp png_create_struct PNGARG((int type)); + +/* Free memory from internal libpng struct */ +PNG_EXTERN void png_destroy_struct PNGARG((png_voidp struct_ptr)); + +PNG_EXTERN png_voidp png_create_struct_2 PNGARG((int type, png_malloc_ptr + malloc_fn, png_voidp mem_ptr)); +PNG_EXTERN void png_destroy_struct_2 PNGARG((png_voidp struct_ptr, + png_free_ptr free_fn, png_voidp mem_ptr)); + +/* Free any memory that info_ptr points to and reset struct. */ +PNG_EXTERN void png_info_destroy PNGARG((png_structp png_ptr, + png_infop info_ptr)); + +#ifndef PNG_1_0_X +/* Function to allocate memory for zlib. */ +PNG_EXTERN voidpf png_zalloc PNGARG((voidpf png_ptr, uInt items, uInt size)); + +/* Function to free memory for zlib */ +PNG_EXTERN void png_zfree PNGARG((voidpf png_ptr, voidpf ptr)); + +#ifdef PNG_SIZE_T +/* Function to convert a sizeof an item to png_sizeof item */ + PNG_EXTERN png_size_t PNGAPI png_convert_size PNGARG((size_t size)); +#endif + +/* Next four functions are used internally as callbacks. PNGAPI is required + * but not PNG_EXPORT. PNGAPI added at libpng version 1.2.3. */ + +PNG_EXTERN void PNGAPI png_default_read_data PNGARG((png_structp png_ptr, + png_bytep data, png_size_t length)); + +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +PNG_EXTERN void PNGAPI png_push_fill_buffer PNGARG((png_structp png_ptr, + png_bytep buffer, png_size_t length)); +#endif + +PNG_EXTERN void PNGAPI png_default_write_data PNGARG((png_structp png_ptr, + png_bytep data, png_size_t length)); + +#if defined(PNG_WRITE_FLUSH_SUPPORTED) +#if !defined(PNG_NO_STDIO) +PNG_EXTERN void PNGAPI png_default_flush PNGARG((png_structp png_ptr)); +#endif +#endif +#else /* PNG_1_0_X */ +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +PNG_EXTERN void png_push_fill_buffer PNGARG((png_structp png_ptr, + png_bytep buffer, png_size_t length)); +#endif +#endif /* PNG_1_0_X */ + +/* Reset the CRC variable */ +PNG_EXTERN void png_reset_crc PNGARG((png_structp png_ptr)); + +/* Write the "data" buffer to whatever output you are using. */ +PNG_EXTERN void png_write_data PNGARG((png_structp png_ptr, png_bytep data, + png_size_t length)); + +/* Read data from whatever input you are using into the "data" buffer */ +PNG_EXTERN void png_read_data PNGARG((png_structp png_ptr, png_bytep data, + png_size_t length)); + +/* Read bytes into buf, and update png_ptr->crc */ +PNG_EXTERN void png_crc_read PNGARG((png_structp png_ptr, png_bytep buf, + png_size_t length)); + +/* Decompress data in a chunk that uses compression */ +#if defined(PNG_zTXt_SUPPORTED) || defined(PNG_iTXt_SUPPORTED) || \ + defined(PNG_iCCP_SUPPORTED) || defined(PNG_sPLT_SUPPORTED) +PNG_EXTERN void png_decompress_chunk PNGARG((png_structp png_ptr, + int comp_type, png_size_t chunklength, + png_size_t prefix_length, png_size_t *data_length)); +#endif + +/* Read "skip" bytes, read the file crc, and (optionally) verify png_ptr->crc */ +PNG_EXTERN int png_crc_finish PNGARG((png_structp png_ptr, png_uint_32 skip)); + +/* Read the CRC from the file and compare it to the libpng calculated CRC */ +PNG_EXTERN int png_crc_error PNGARG((png_structp png_ptr)); + +/* Calculate the CRC over a section of data. Note that we are only + * passing a maximum of 64K on systems that have this as a memory limit, + * since this is the maximum buffer size we can specify. + */ +PNG_EXTERN void png_calculate_crc PNGARG((png_structp png_ptr, png_bytep ptr, + png_size_t length)); + +#if defined(PNG_WRITE_FLUSH_SUPPORTED) +PNG_EXTERN void png_flush PNGARG((png_structp png_ptr)); +#endif + +/* simple function to write the signature */ +PNG_EXTERN void png_write_sig PNGARG((png_structp png_ptr)); + +/* write various chunks */ + +/* Write the IHDR chunk, and update the png_struct with the necessary + * information. + */ +PNG_EXTERN void png_write_IHDR PNGARG((png_structp png_ptr, png_uint_32 width, + png_uint_32 height, + int bit_depth, int color_type, int compression_method, int filter_method, + int interlace_method)); + +PNG_EXTERN void png_write_PLTE PNGARG((png_structp png_ptr, png_colorp palette, + png_uint_32 num_pal)); + +PNG_EXTERN void png_write_IDAT PNGARG((png_structp png_ptr, png_bytep data, + png_size_t length)); + +PNG_EXTERN void png_write_IEND PNGARG((png_structp png_ptr)); + +#if defined(PNG_WRITE_gAMA_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +PNG_EXTERN void png_write_gAMA PNGARG((png_structp png_ptr, double file_gamma)); +#endif +#ifdef PNG_FIXED_POINT_SUPPORTED +PNG_EXTERN void png_write_gAMA_fixed PNGARG((png_structp png_ptr, png_fixed_point + file_gamma)); +#endif +#endif + +#if defined(PNG_WRITE_sBIT_SUPPORTED) +PNG_EXTERN void png_write_sBIT PNGARG((png_structp png_ptr, png_color_8p sbit, + int color_type)); +#endif + +#if defined(PNG_WRITE_cHRM_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +PNG_EXTERN void png_write_cHRM PNGARG((png_structp png_ptr, + double white_x, double white_y, + double red_x, double red_y, double green_x, double green_y, + double blue_x, double blue_y)); +#endif +#ifdef PNG_FIXED_POINT_SUPPORTED +PNG_EXTERN void png_write_cHRM_fixed PNGARG((png_structp png_ptr, + png_fixed_point int_white_x, png_fixed_point int_white_y, + png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point + int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, + png_fixed_point int_blue_y)); +#endif +#endif + +#if defined(PNG_WRITE_sRGB_SUPPORTED) +PNG_EXTERN void png_write_sRGB PNGARG((png_structp png_ptr, + int intent)); +#endif + +#if defined(PNG_WRITE_iCCP_SUPPORTED) +PNG_EXTERN void png_write_iCCP PNGARG((png_structp png_ptr, + png_charp name, int compression_type, + png_charp profile, int proflen)); + /* Note to maintainer: profile should be png_bytep */ +#endif + +#if defined(PNG_WRITE_sPLT_SUPPORTED) +PNG_EXTERN void png_write_sPLT PNGARG((png_structp png_ptr, + png_sPLT_tp palette)); +#endif + +#if defined(PNG_WRITE_tRNS_SUPPORTED) +PNG_EXTERN void png_write_tRNS PNGARG((png_structp png_ptr, png_bytep trans, + png_color_16p values, int number, int color_type)); +#endif + +#if defined(PNG_WRITE_bKGD_SUPPORTED) +PNG_EXTERN void png_write_bKGD PNGARG((png_structp png_ptr, + png_color_16p values, int color_type)); +#endif + +#if defined(PNG_WRITE_hIST_SUPPORTED) +PNG_EXTERN void png_write_hIST PNGARG((png_structp png_ptr, png_uint_16p hist, + int num_hist)); +#endif + +#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \ + defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED) +PNG_EXTERN png_size_t png_check_keyword PNGARG((png_structp png_ptr, + png_charp key, png_charpp new_key)); +#endif + +#if defined(PNG_WRITE_tEXt_SUPPORTED) +PNG_EXTERN void png_write_tEXt PNGARG((png_structp png_ptr, png_charp key, + png_charp text, png_size_t text_len)); +#endif + +#if defined(PNG_WRITE_zTXt_SUPPORTED) +PNG_EXTERN void png_write_zTXt PNGARG((png_structp png_ptr, png_charp key, + png_charp text, png_size_t text_len, int compression)); +#endif + +#if defined(PNG_WRITE_iTXt_SUPPORTED) +PNG_EXTERN void png_write_iTXt PNGARG((png_structp png_ptr, + int compression, png_charp key, png_charp lang, png_charp lang_key, + png_charp text)); +#endif + +#if defined(PNG_TEXT_SUPPORTED) /* Added at version 1.0.14 and 1.2.4 */ +PNG_EXTERN int png_set_text_2 PNGARG((png_structp png_ptr, + png_infop info_ptr, png_textp text_ptr, int num_text)); +#endif + +#if defined(PNG_WRITE_oFFs_SUPPORTED) +PNG_EXTERN void png_write_oFFs PNGARG((png_structp png_ptr, + png_int_32 x_offset, png_int_32 y_offset, int unit_type)); +#endif + +#if defined(PNG_WRITE_pCAL_SUPPORTED) +PNG_EXTERN void png_write_pCAL PNGARG((png_structp png_ptr, png_charp purpose, + png_int_32 X0, png_int_32 X1, int type, int nparams, + png_charp units, png_charpp params)); +#endif + +#if defined(PNG_WRITE_pHYs_SUPPORTED) +PNG_EXTERN void png_write_pHYs PNGARG((png_structp png_ptr, + png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit, + int unit_type)); +#endif + +#if defined(PNG_WRITE_tIME_SUPPORTED) +PNG_EXTERN void png_write_tIME PNGARG((png_structp png_ptr, + png_timep mod_time)); +#endif + +#if defined(PNG_WRITE_sCAL_SUPPORTED) +#if defined(PNG_FLOATING_POINT_SUPPORTED) && !defined(PNG_NO_STDIO) +PNG_EXTERN void png_write_sCAL PNGARG((png_structp png_ptr, + int unit, double width, double height)); +#else +#ifdef PNG_FIXED_POINT_SUPPORTED +PNG_EXTERN void png_write_sCAL_s PNGARG((png_structp png_ptr, + int unit, png_charp width, png_charp height)); +#endif +#endif +#endif + +/* Called when finished processing a row of data */ +PNG_EXTERN void png_write_finish_row PNGARG((png_structp png_ptr)); + +/* Internal use only. Called before first row of data */ +PNG_EXTERN void png_write_start_row PNGARG((png_structp png_ptr)); + +#if defined(PNG_READ_GAMMA_SUPPORTED) +PNG_EXTERN void png_build_gamma_table PNGARG((png_structp png_ptr)); +#endif + +/* combine a row of data, dealing with alpha, etc. if requested */ +PNG_EXTERN void png_combine_row PNGARG((png_structp png_ptr, png_bytep row, + int mask)); + +#if defined(PNG_READ_INTERLACING_SUPPORTED) +/* expand an interlaced row */ +/* OLD pre-1.0.9 interface: +PNG_EXTERN void png_do_read_interlace PNGARG((png_row_infop row_info, + png_bytep row, int pass, png_uint_32 transformations)); + */ +PNG_EXTERN void png_do_read_interlace PNGARG((png_structp png_ptr)); +#endif + +/* GRR TO DO (2.0 or whenever): simplify other internal calling interfaces */ + +#if defined(PNG_WRITE_INTERLACING_SUPPORTED) +/* grab pixels out of a row for an interlaced pass */ +PNG_EXTERN void png_do_write_interlace PNGARG((png_row_infop row_info, + png_bytep row, int pass)); +#endif + +/* unfilter a row */ +PNG_EXTERN void png_read_filter_row PNGARG((png_structp png_ptr, + png_row_infop row_info, png_bytep row, png_bytep prev_row, int filter)); + +/* Choose the best filter to use and filter the row data */ +PNG_EXTERN void png_write_find_filter PNGARG((png_structp png_ptr, + png_row_infop row_info)); + +/* Write out the filtered row. */ +PNG_EXTERN void png_write_filtered_row PNGARG((png_structp png_ptr, + png_bytep filtered_row)); +/* finish a row while reading, dealing with interlacing passes, etc. */ +PNG_EXTERN void png_read_finish_row PNGARG((png_structp png_ptr)); + +/* initialize the row buffers, etc. */ +PNG_EXTERN void png_read_start_row PNGARG((png_structp png_ptr)); +/* optional call to update the users info structure */ +PNG_EXTERN void png_read_transform_info PNGARG((png_structp png_ptr, + png_infop info_ptr)); + +/* these are the functions that do the transformations */ +#if defined(PNG_READ_FILLER_SUPPORTED) +PNG_EXTERN void png_do_read_filler PNGARG((png_row_infop row_info, + png_bytep row, png_uint_32 filler, png_uint_32 flags)); +#endif + +#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) +PNG_EXTERN void png_do_read_swap_alpha PNGARG((png_row_infop row_info, + png_bytep row)); +#endif + +#if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) +PNG_EXTERN void png_do_write_swap_alpha PNGARG((png_row_infop row_info, + png_bytep row)); +#endif + +#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) +PNG_EXTERN void png_do_read_invert_alpha PNGARG((png_row_infop row_info, + png_bytep row)); +#endif + +#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) +PNG_EXTERN void png_do_write_invert_alpha PNGARG((png_row_infop row_info, + png_bytep row)); +#endif + +#if defined(PNG_WRITE_FILLER_SUPPORTED) || \ + defined(PNG_READ_STRIP_ALPHA_SUPPORTED) +PNG_EXTERN void png_do_strip_filler PNGARG((png_row_infop row_info, + png_bytep row, png_uint_32 flags)); +#endif + +#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) +PNG_EXTERN void png_do_swap PNGARG((png_row_infop row_info, png_bytep row)); +#endif + +#if defined(PNG_READ_PACKSWAP_SUPPORTED) || defined(PNG_WRITE_PACKSWAP_SUPPORTED) +PNG_EXTERN void png_do_packswap PNGARG((png_row_infop row_info, png_bytep row)); +#endif + +#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) +PNG_EXTERN int png_do_rgb_to_gray PNGARG((png_structp png_ptr, png_row_infop + row_info, png_bytep row)); +#endif + +#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) +PNG_EXTERN void png_do_gray_to_rgb PNGARG((png_row_infop row_info, + png_bytep row)); +#endif + +#if defined(PNG_READ_PACK_SUPPORTED) +PNG_EXTERN void png_do_unpack PNGARG((png_row_infop row_info, png_bytep row)); +#endif + +#if defined(PNG_READ_SHIFT_SUPPORTED) +PNG_EXTERN void png_do_unshift PNGARG((png_row_infop row_info, png_bytep row, + png_color_8p sig_bits)); +#endif + +#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) +PNG_EXTERN void png_do_invert PNGARG((png_row_infop row_info, png_bytep row)); +#endif + +#if defined(PNG_READ_16_TO_8_SUPPORTED) +PNG_EXTERN void png_do_chop PNGARG((png_row_infop row_info, png_bytep row)); +#endif + +#if defined(PNG_READ_DITHER_SUPPORTED) +PNG_EXTERN void png_do_dither PNGARG((png_row_infop row_info, + png_bytep row, png_bytep palette_lookup, png_bytep dither_lookup)); + +# if defined(PNG_CORRECT_PALETTE_SUPPORTED) +PNG_EXTERN void png_correct_palette PNGARG((png_structp png_ptr, + png_colorp palette, int num_palette)); +# endif +#endif + +#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) +PNG_EXTERN void png_do_bgr PNGARG((png_row_infop row_info, png_bytep row)); +#endif + +#if defined(PNG_WRITE_PACK_SUPPORTED) +PNG_EXTERN void png_do_pack PNGARG((png_row_infop row_info, + png_bytep row, png_uint_32 bit_depth)); +#endif + +#if defined(PNG_WRITE_SHIFT_SUPPORTED) +PNG_EXTERN void png_do_shift PNGARG((png_row_infop row_info, png_bytep row, + png_color_8p bit_depth)); +#endif + +#if defined(PNG_READ_BACKGROUND_SUPPORTED) +#if defined(PNG_READ_GAMMA_SUPPORTED) +PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row, + png_color_16p trans_values, png_color_16p background, + png_color_16p background_1, + png_bytep gamma_table, png_bytep gamma_from_1, png_bytep gamma_to_1, + png_uint_16pp gamma_16, png_uint_16pp gamma_16_from_1, + png_uint_16pp gamma_16_to_1, int gamma_shift)); +#else +PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row, + png_color_16p trans_values, png_color_16p background)); +#endif +#endif + +#if defined(PNG_READ_GAMMA_SUPPORTED) +PNG_EXTERN void png_do_gamma PNGARG((png_row_infop row_info, png_bytep row, + png_bytep gamma_table, png_uint_16pp gamma_16_table, + int gamma_shift)); +#endif + +#if defined(PNG_READ_EXPAND_SUPPORTED) +PNG_EXTERN void png_do_expand_palette PNGARG((png_row_infop row_info, + png_bytep row, png_colorp palette, png_bytep trans, int num_trans)); +PNG_EXTERN void png_do_expand PNGARG((png_row_infop row_info, + png_bytep row, png_color_16p trans_value)); +#endif + +/* The following decodes the appropriate chunks, and does error correction, + * then calls the appropriate callback for the chunk if it is valid. + */ + +/* decode the IHDR chunk */ +PNG_EXTERN void png_handle_IHDR PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +PNG_EXTERN void png_handle_PLTE PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +PNG_EXTERN void png_handle_IEND PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); + +#if defined(PNG_READ_bKGD_SUPPORTED) +PNG_EXTERN void png_handle_bKGD PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_cHRM_SUPPORTED) +PNG_EXTERN void png_handle_cHRM PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_gAMA_SUPPORTED) +PNG_EXTERN void png_handle_gAMA PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_hIST_SUPPORTED) +PNG_EXTERN void png_handle_hIST PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_iCCP_SUPPORTED) +extern void png_handle_iCCP PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif /* PNG_READ_iCCP_SUPPORTED */ + +#if defined(PNG_READ_iTXt_SUPPORTED) +PNG_EXTERN void png_handle_iTXt PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_oFFs_SUPPORTED) +PNG_EXTERN void png_handle_oFFs PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_pCAL_SUPPORTED) +PNG_EXTERN void png_handle_pCAL PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_pHYs_SUPPORTED) +PNG_EXTERN void png_handle_pHYs PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_sBIT_SUPPORTED) +PNG_EXTERN void png_handle_sBIT PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_sCAL_SUPPORTED) +PNG_EXTERN void png_handle_sCAL PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_sPLT_SUPPORTED) +extern void png_handle_sPLT PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif /* PNG_READ_sPLT_SUPPORTED */ + +#if defined(PNG_READ_sRGB_SUPPORTED) +PNG_EXTERN void png_handle_sRGB PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_tEXt_SUPPORTED) +PNG_EXTERN void png_handle_tEXt PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_tIME_SUPPORTED) +PNG_EXTERN void png_handle_tIME PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_tRNS_SUPPORTED) +PNG_EXTERN void png_handle_tRNS PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_zTXt_SUPPORTED) +PNG_EXTERN void png_handle_zTXt PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 length)); + +PNG_EXTERN void png_check_chunk_name PNGARG((png_structp png_ptr, + png_bytep chunk_name)); + +/* handle the transformations for reading and writing */ +PNG_EXTERN void png_do_read_transformations PNGARG((png_structp png_ptr)); +PNG_EXTERN void png_do_write_transformations PNGARG((png_structp png_ptr)); + +PNG_EXTERN void png_init_read_transformations PNGARG((png_structp png_ptr)); + +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +PNG_EXTERN void png_push_read_chunk PNGARG((png_structp png_ptr, + png_infop info_ptr)); +PNG_EXTERN void png_push_read_sig PNGARG((png_structp png_ptr, + png_infop info_ptr)); +PNG_EXTERN void png_push_check_crc PNGARG((png_structp png_ptr)); +PNG_EXTERN void png_push_crc_skip PNGARG((png_structp png_ptr, + png_uint_32 length)); +PNG_EXTERN void png_push_crc_finish PNGARG((png_structp png_ptr)); +PNG_EXTERN void png_push_save_buffer PNGARG((png_structp png_ptr)); +PNG_EXTERN void png_push_restore_buffer PNGARG((png_structp png_ptr, + png_bytep buffer, png_size_t buffer_length)); +PNG_EXTERN void png_push_read_IDAT PNGARG((png_structp png_ptr)); +PNG_EXTERN void png_process_IDAT_data PNGARG((png_structp png_ptr, + png_bytep buffer, png_size_t buffer_length)); +PNG_EXTERN void png_push_process_row PNGARG((png_structp png_ptr)); +PNG_EXTERN void png_push_handle_unknown PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 length)); +PNG_EXTERN void png_push_have_info PNGARG((png_structp png_ptr, + png_infop info_ptr)); +PNG_EXTERN void png_push_have_end PNGARG((png_structp png_ptr, + png_infop info_ptr)); +PNG_EXTERN void png_push_have_row PNGARG((png_structp png_ptr, png_bytep row)); +PNG_EXTERN void png_push_read_end PNGARG((png_structp png_ptr, + png_infop info_ptr)); +PNG_EXTERN void png_process_some_data PNGARG((png_structp png_ptr, + png_infop info_ptr)); +PNG_EXTERN void png_read_push_finish_row PNGARG((png_structp png_ptr)); +#if defined(PNG_READ_tEXt_SUPPORTED) +PNG_EXTERN void png_push_handle_tEXt PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 length)); +PNG_EXTERN void png_push_read_tEXt PNGARG((png_structp png_ptr, + png_infop info_ptr)); +#endif +#if defined(PNG_READ_zTXt_SUPPORTED) +PNG_EXTERN void png_push_handle_zTXt PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 length)); +PNG_EXTERN void png_push_read_zTXt PNGARG((png_structp png_ptr, + png_infop info_ptr)); +#endif +#if defined(PNG_READ_iTXt_SUPPORTED) +PNG_EXTERN void png_push_handle_iTXt PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 length)); +PNG_EXTERN void png_push_read_iTXt PNGARG((png_structp png_ptr, + png_infop info_ptr)); +#endif + +#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ + +#ifdef PNG_MNG_FEATURES_SUPPORTED +PNG_EXTERN void png_do_read_intrapixel PNGARG((png_row_infop row_info, + png_bytep row)); +PNG_EXTERN void png_do_write_intrapixel PNGARG((png_row_infop row_info, + png_bytep row)); +#endif + +#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) +#if defined(PNG_MMX_CODE_SUPPORTED) +/* png.c */ /* PRIVATE */ +PNG_EXTERN void png_init_mmx_flags PNGARG((png_structp png_ptr)); +#endif +#endif + +#if defined(PNG_INCH_CONVERSIONS) && defined(PNG_FLOATING_POINT_SUPPORTED) +PNG_EXTERN png_uint_32 png_get_pixels_per_inch PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +PNG_EXTERN png_uint_32 png_get_x_pixels_per_inch PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +PNG_EXTERN png_uint_32 png_get_y_pixels_per_inch PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +PNG_EXTERN float png_get_x_offset_inches PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +PNG_EXTERN float png_get_y_offset_inches PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +#if defined(PNG_pHYs_SUPPORTED) +PNG_EXTERN png_uint_32 png_get_pHYs_dpi PNGARG((png_structp png_ptr, +png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); +#endif /* PNG_pHYs_SUPPORTED */ +#endif /* PNG_INCH_CONVERSIONS && PNG_FLOATING_POINT_SUPPORTED */ + +/* Read the chunk header (length + type name) */ +PNG_EXTERN png_uint_32 png_read_chunk_header PNGARG((png_structp png_ptr)); + +/* Added at libpng version 1.2.34 */ +#if defined(PNG_cHRM_SUPPORTED) +PNG_EXTERN int png_check_cHRM_fixed PNGARG((png_structp png_ptr, + png_fixed_point int_white_x, png_fixed_point int_white_y, + png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point + int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, + png_fixed_point int_blue_y)); +#endif + +/* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */ + +#endif /* PNG_INTERNAL */ + +#ifdef __cplusplus +} +#endif + +#endif /* PNG_VERSION_INFO_ONLY */ +/* do not put anything past this line */ +#endif /* PNG_H */ diff --git a/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/include/libpng12/pngconf.h b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/include/libpng12/pngconf.h new file mode 100644 index 0000000000..025368db67 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/include/libpng12/pngconf.h @@ -0,0 +1,1496 @@ + +/* pngconf.h - machine configurable file for libpng + * + * libpng version 1.2.37 - June 4, 2009 + * For conditions of distribution and use, see copyright notice in png.h + * Copyright (c) 1998-2009 Glenn Randers-Pehrson + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + */ + +/* Any machine specific code is near the front of this file, so if you + * are configuring libpng for a machine, you may want to read the section + * starting here down to where it starts to typedef png_color, png_text, + * and png_info. + */ + +#ifndef PNGCONF_H +#define PNGCONF_H + +#define PNG_1_2_X + +/* + * PNG_USER_CONFIG has to be defined on the compiler command line. This + * includes the resource compiler for Windows DLL configurations. + */ +#ifdef PNG_USER_CONFIG +# ifndef PNG_USER_PRIVATEBUILD +# define PNG_USER_PRIVATEBUILD +# endif +#include "pngusr.h" +#endif + +/* PNG_CONFIGURE_LIBPNG is set by the "configure" script. */ +#ifdef PNG_CONFIGURE_LIBPNG +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#endif + +/* + * Added at libpng-1.2.8 + * + * If you create a private DLL you need to define in "pngusr.h" the followings: + * #define PNG_USER_PRIVATEBUILD <Describes by whom and why this version of + * the DLL was built> + * e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons." + * #define PNG_USER_DLLFNAME_POSTFIX <two-letter postfix that serve to + * distinguish your DLL from those of the official release. These + * correspond to the trailing letters that come after the version + * number and must match your private DLL name> + * e.g. // private DLL "libpng13gx.dll" + * #define PNG_USER_DLLFNAME_POSTFIX "gx" + * + * The following macros are also at your disposal if you want to complete the + * DLL VERSIONINFO structure. + * - PNG_USER_VERSIONINFO_COMMENTS + * - PNG_USER_VERSIONINFO_COMPANYNAME + * - PNG_USER_VERSIONINFO_LEGALTRADEMARKS + */ + +#ifdef __STDC__ +#ifdef SPECIALBUILD +# pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\ + are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.") +#endif + +#ifdef PRIVATEBUILD +# pragma message("PRIVATEBUILD is deprecated.\ + Use PNG_USER_PRIVATEBUILD instead.") +# define PNG_USER_PRIVATEBUILD PRIVATEBUILD +#endif +#endif /* __STDC__ */ + +#ifndef PNG_VERSION_INFO_ONLY + +/* End of material added to libpng-1.2.8 */ + +/* Added at libpng-1.2.19, removed at libpng-1.2.20 because it caused trouble + Restored at libpng-1.2.21 */ +#if !defined(PNG_NO_WARN_UNINITIALIZED_ROW) && \ + !defined(PNG_WARN_UNINITIALIZED_ROW) +# define PNG_WARN_UNINITIALIZED_ROW 1 +#endif +/* End of material added at libpng-1.2.19/1.2.21 */ + +/* This is the size of the compression buffer, and thus the size of + * an IDAT chunk. Make this whatever size you feel is best for your + * machine. One of these will be allocated per png_struct. When this + * is full, it writes the data to the disk, and does some other + * calculations. Making this an extremely small size will slow + * the library down, but you may want to experiment to determine + * where it becomes significant, if you are concerned with memory + * usage. Note that zlib allocates at least 32Kb also. For readers, + * this describes the size of the buffer available to read the data in. + * Unless this gets smaller than the size of a row (compressed), + * it should not make much difference how big this is. + */ + +#ifndef PNG_ZBUF_SIZE +# define PNG_ZBUF_SIZE 8192 +#endif + +/* Enable if you want a write-only libpng */ + +#ifndef PNG_NO_READ_SUPPORTED +# define PNG_READ_SUPPORTED +#endif + +/* Enable if you want a read-only libpng */ + +#ifndef PNG_NO_WRITE_SUPPORTED +# define PNG_WRITE_SUPPORTED +#endif + +/* Enabled by default in 1.2.0. You can disable this if you don't need to + support PNGs that are embedded in MNG datastreams */ +#if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES) +# ifndef PNG_MNG_FEATURES_SUPPORTED +# define PNG_MNG_FEATURES_SUPPORTED +# endif +#endif + +#ifndef PNG_NO_FLOATING_POINT_SUPPORTED +# ifndef PNG_FLOATING_POINT_SUPPORTED +# define PNG_FLOATING_POINT_SUPPORTED +# endif +#endif + +/* If you are running on a machine where you cannot allocate more + * than 64K of memory at once, uncomment this. While libpng will not + * normally need that much memory in a chunk (unless you load up a very + * large file), zlib needs to know how big of a chunk it can use, and + * libpng thus makes sure to check any memory allocation to verify it + * will fit into memory. +#define PNG_MAX_MALLOC_64K + */ +#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) +# define PNG_MAX_MALLOC_64K +#endif + +/* Special munging to support doing things the 'cygwin' way: + * 'Normal' png-on-win32 defines/defaults: + * PNG_BUILD_DLL -- building dll + * PNG_USE_DLL -- building an application, linking to dll + * (no define) -- building static library, or building an + * application and linking to the static lib + * 'Cygwin' defines/defaults: + * PNG_BUILD_DLL -- (ignored) building the dll + * (no define) -- (ignored) building an application, linking to the dll + * PNG_STATIC -- (ignored) building the static lib, or building an + * application that links to the static lib. + * ALL_STATIC -- (ignored) building various static libs, or building an + * application that links to the static libs. + * Thus, + * a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and + * this bit of #ifdefs will define the 'correct' config variables based on + * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but + * unnecessary. + * + * Also, the precedence order is: + * ALL_STATIC (since we can't #undef something outside our namespace) + * PNG_BUILD_DLL + * PNG_STATIC + * (nothing) == PNG_USE_DLL + * + * CYGWIN (2002-01-20): The preceding is now obsolete. With the advent + * of auto-import in binutils, we no longer need to worry about + * __declspec(dllexport) / __declspec(dllimport) and friends. Therefore, + * we don't need to worry about PNG_STATIC or ALL_STATIC when it comes + * to __declspec() stuff. However, we DO need to worry about + * PNG_BUILD_DLL and PNG_STATIC because those change some defaults + * such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed. + */ +#if defined(__CYGWIN__) +# if defined(ALL_STATIC) +# if defined(PNG_BUILD_DLL) +# undef PNG_BUILD_DLL +# endif +# if defined(PNG_USE_DLL) +# undef PNG_USE_DLL +# endif +# if defined(PNG_DLL) +# undef PNG_DLL +# endif +# if !defined(PNG_STATIC) +# define PNG_STATIC +# endif +# else +# if defined (PNG_BUILD_DLL) +# if defined(PNG_STATIC) +# undef PNG_STATIC +# endif +# if defined(PNG_USE_DLL) +# undef PNG_USE_DLL +# endif +# if !defined(PNG_DLL) +# define PNG_DLL +# endif +# else +# if defined(PNG_STATIC) +# if defined(PNG_USE_DLL) +# undef PNG_USE_DLL +# endif +# if defined(PNG_DLL) +# undef PNG_DLL +# endif +# else +# if !defined(PNG_USE_DLL) +# define PNG_USE_DLL +# endif +# if !defined(PNG_DLL) +# define PNG_DLL +# endif +# endif +# endif +# endif +#endif + +/* This protects us against compilers that run on a windowing system + * and thus don't have or would rather us not use the stdio types: + * stdin, stdout, and stderr. The only one currently used is stderr + * in png_error() and png_warning(). #defining PNG_NO_CONSOLE_IO will + * prevent these from being compiled and used. #defining PNG_NO_STDIO + * will also prevent these, plus will prevent the entire set of stdio + * macros and functions (FILE *, printf, etc.) from being compiled and used, + * unless (PNG_DEBUG > 0) has been #defined. + * + * #define PNG_NO_CONSOLE_IO + * #define PNG_NO_STDIO + */ + +#if defined(_WIN32_WCE) +# include <windows.h> + /* Console I/O functions are not supported on WindowsCE */ +# define PNG_NO_CONSOLE_IO + /* abort() may not be supported on some/all Windows CE platforms */ +# define PNG_ABORT() exit(-1) +# ifdef PNG_DEBUG +# undef PNG_DEBUG +# endif +#endif + +#ifdef PNG_BUILD_DLL +# ifndef PNG_CONSOLE_IO_SUPPORTED +# ifndef PNG_NO_CONSOLE_IO +# define PNG_NO_CONSOLE_IO +# endif +# endif +#endif + +# ifdef PNG_NO_STDIO +# ifndef PNG_NO_CONSOLE_IO +# define PNG_NO_CONSOLE_IO +# endif +# ifdef PNG_DEBUG +# if (PNG_DEBUG > 0) +# include <stdio.h> +# endif +# endif +# else +# if !defined(_WIN32_WCE) +/* "stdio.h" functions are not supported on WindowsCE */ +# include <stdio.h> +# endif +# endif + +/* This macro protects us against machines that don't have function + * prototypes (ie K&R style headers). If your compiler does not handle + * function prototypes, define this macro and use the included ansi2knr. + * I've always been able to use _NO_PROTO as the indicator, but you may + * need to drag the empty declaration out in front of here, or change the + * ifdef to suit your own needs. + */ +#ifndef PNGARG + +#ifdef OF /* zlib prototype munger */ +# define PNGARG(arglist) OF(arglist) +#else + +#ifdef _NO_PROTO +# define PNGARG(arglist) () +# ifndef PNG_TYPECAST_NULL +# define PNG_TYPECAST_NULL +# endif +#else +# define PNGARG(arglist) arglist +#endif /* _NO_PROTO */ + + +#endif /* OF */ + +#endif /* PNGARG */ + +/* Try to determine if we are compiling on a Mac. Note that testing for + * just __MWERKS__ is not good enough, because the Codewarrior is now used + * on non-Mac platforms. + */ +#ifndef MACOS +# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ + defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) +# define MACOS +# endif +#endif + +/* enough people need this for various reasons to include it here */ +#if !defined(MACOS) && !defined(RISCOS) && !defined(_WIN32_WCE) +# include <sys/types.h> +#endif + +#if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED) +# define PNG_SETJMP_SUPPORTED +#endif + +#ifdef PNG_SETJMP_SUPPORTED +/* This is an attempt to force a single setjmp behaviour on Linux. If + * the X config stuff didn't define _BSD_SOURCE we wouldn't need this. + * + * You can bypass this test if you know that your application uses exactly + * the same setjmp.h that was included when libpng was built. Only define + * PNG_SKIP_SETJMP_CHECK while building your application, prior to the + * application's '#include "png.h"'. Don't define PNG_SKIP_SETJMP_CHECK + * while building a separate libpng library for general use. + */ + +# ifndef PNG_SKIP_SETJMP_CHECK +# ifdef __linux__ +# ifdef _BSD_SOURCE +# define PNG_SAVE_BSD_SOURCE +# undef _BSD_SOURCE +# endif +# ifdef _SETJMP_H + /* If you encounter a compiler error here, see the explanation + * near the end of INSTALL. + */ + __pngconf.h__ in libpng already includes setjmp.h; + __dont__ include it again.; +# endif +# endif /* __linux__ */ +# endif /* PNG_SKIP_SETJMP_CHECK */ + + /* include setjmp.h for error handling */ +# include <setjmp.h> + +# ifdef __linux__ +# ifdef PNG_SAVE_BSD_SOURCE +# ifndef _BSD_SOURCE +# define _BSD_SOURCE +# endif +# undef PNG_SAVE_BSD_SOURCE +# endif +# endif /* __linux__ */ +#endif /* PNG_SETJMP_SUPPORTED */ + +#ifdef BSD +# include <strings.h> +#else +# include <string.h> +#endif + +/* Other defines for things like memory and the like can go here. */ +#ifdef PNG_INTERNAL + +#include <stdlib.h> + +/* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which + * aren't usually used outside the library (as far as I know), so it is + * debatable if they should be exported at all. In the future, when it is + * possible to have run-time registry of chunk-handling functions, some of + * these will be made available again. +#define PNG_EXTERN extern + */ +#define PNG_EXTERN + +/* Other defines specific to compilers can go here. Try to keep + * them inside an appropriate ifdef/endif pair for portability. + */ + +#if defined(PNG_FLOATING_POINT_SUPPORTED) +# if defined(MACOS) + /* We need to check that <math.h> hasn't already been included earlier + * as it seems it doesn't agree with <fp.h>, yet we should really use + * <fp.h> if possible. + */ +# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__) +# include <fp.h> +# endif +# else +# include <math.h> +# endif +# if defined(_AMIGA) && defined(__SASC) && defined(_M68881) + /* Amiga SAS/C: We must include builtin FPU functions when compiling using + * MATH=68881 + */ +# include <m68881.h> +# endif +#endif + +/* Codewarrior on NT has linking problems without this. */ +#if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__) +# define PNG_ALWAYS_EXTERN +#endif + +/* This provides the non-ANSI (far) memory allocation routines. */ +#if defined(__TURBOC__) && defined(__MSDOS__) +# include <mem.h> +# include <alloc.h> +#endif + +/* I have no idea why is this necessary... */ +#if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \ + defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__)) +# include <malloc.h> +#endif + +/* This controls how fine the dithering gets. As this allocates + * a largish chunk of memory (32K), those who are not as concerned + * with dithering quality can decrease some or all of these. + */ +#ifndef PNG_DITHER_RED_BITS +# define PNG_DITHER_RED_BITS 5 +#endif +#ifndef PNG_DITHER_GREEN_BITS +# define PNG_DITHER_GREEN_BITS 5 +#endif +#ifndef PNG_DITHER_BLUE_BITS +# define PNG_DITHER_BLUE_BITS 5 +#endif + +/* This controls how fine the gamma correction becomes when you + * are only interested in 8 bits anyway. Increasing this value + * results in more memory being used, and more pow() functions + * being called to fill in the gamma tables. Don't set this value + * less then 8, and even that may not work (I haven't tested it). + */ + +#ifndef PNG_MAX_GAMMA_8 +# define PNG_MAX_GAMMA_8 11 +#endif + +/* This controls how much a difference in gamma we can tolerate before + * we actually start doing gamma conversion. + */ +#ifndef PNG_GAMMA_THRESHOLD +# define PNG_GAMMA_THRESHOLD 0.05 +#endif + +#endif /* PNG_INTERNAL */ + +/* The following uses const char * instead of char * for error + * and warning message functions, so some compilers won't complain. + * If you do not want to use const, define PNG_NO_CONST here. + */ + +#ifndef PNG_NO_CONST +# define PNG_CONST const +#else +# define PNG_CONST +#endif + +/* The following defines give you the ability to remove code from the + * library that you will not be using. I wish I could figure out how to + * automate this, but I can't do that without making it seriously hard + * on the users. So if you are not using an ability, change the #define + * to and #undef, and that part of the library will not be compiled. If + * your linker can't find a function, you may want to make sure the + * ability is defined here. Some of these depend upon some others being + * defined. I haven't figured out all the interactions here, so you may + * have to experiment awhile to get everything to compile. If you are + * creating or using a shared library, you probably shouldn't touch this, + * as it will affect the size of the structures, and this will cause bad + * things to happen if the library and/or application ever change. + */ + +/* Any features you will not be using can be undef'ed here */ + +/* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user + * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS + * on the compile line, then pick and choose which ones to define without + * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED + * if you only want to have a png-compliant reader/writer but don't need + * any of the extra transformations. This saves about 80 kbytes in a + * typical installation of the library. (PNG_NO_* form added in version + * 1.0.1c, for consistency) + */ + +/* The size of the png_text structure changed in libpng-1.0.6 when + * iTXt support was added. iTXt support was turned off by default through + * libpng-1.2.x, to support old apps that malloc the png_text structure + * instead of calling png_set_text() and letting libpng malloc it. It + * was turned on by default in libpng-1.3.0. + */ + +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +# ifndef PNG_NO_iTXt_SUPPORTED +# define PNG_NO_iTXt_SUPPORTED +# endif +# ifndef PNG_NO_READ_iTXt +# define PNG_NO_READ_iTXt +# endif +# ifndef PNG_NO_WRITE_iTXt +# define PNG_NO_WRITE_iTXt +# endif +#endif + +#if !defined(PNG_NO_iTXt_SUPPORTED) +# if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt) +# define PNG_READ_iTXt +# endif +# if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt) +# define PNG_WRITE_iTXt +# endif +#endif + +/* The following support, added after version 1.0.0, can be turned off here en + * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility + * with old applications that require the length of png_struct and png_info + * to remain unchanged. + */ + +#ifdef PNG_LEGACY_SUPPORTED +# define PNG_NO_FREE_ME +# define PNG_NO_READ_UNKNOWN_CHUNKS +# define PNG_NO_WRITE_UNKNOWN_CHUNKS +# define PNG_NO_READ_USER_CHUNKS +# define PNG_NO_READ_iCCP +# define PNG_NO_WRITE_iCCP +# define PNG_NO_READ_iTXt +# define PNG_NO_WRITE_iTXt +# define PNG_NO_READ_sCAL +# define PNG_NO_WRITE_sCAL +# define PNG_NO_READ_sPLT +# define PNG_NO_WRITE_sPLT +# define PNG_NO_INFO_IMAGE +# define PNG_NO_READ_RGB_TO_GRAY +# define PNG_NO_READ_USER_TRANSFORM +# define PNG_NO_WRITE_USER_TRANSFORM +# define PNG_NO_USER_MEM +# define PNG_NO_READ_EMPTY_PLTE +# define PNG_NO_MNG_FEATURES +# define PNG_NO_FIXED_POINT_SUPPORTED +#endif + +/* Ignore attempt to turn off both floating and fixed point support */ +#if !defined(PNG_FLOATING_POINT_SUPPORTED) || \ + !defined(PNG_NO_FIXED_POINT_SUPPORTED) +# define PNG_FIXED_POINT_SUPPORTED +#endif + +#ifndef PNG_NO_FREE_ME +# define PNG_FREE_ME_SUPPORTED +#endif + +#if defined(PNG_READ_SUPPORTED) + +#if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \ + !defined(PNG_NO_READ_TRANSFORMS) +# define PNG_READ_TRANSFORMS_SUPPORTED +#endif + +#ifdef PNG_READ_TRANSFORMS_SUPPORTED +# ifndef PNG_NO_READ_EXPAND +# define PNG_READ_EXPAND_SUPPORTED +# endif +# ifndef PNG_NO_READ_SHIFT +# define PNG_READ_SHIFT_SUPPORTED +# endif +# ifndef PNG_NO_READ_PACK +# define PNG_READ_PACK_SUPPORTED +# endif +# ifndef PNG_NO_READ_BGR +# define PNG_READ_BGR_SUPPORTED +# endif +# ifndef PNG_NO_READ_SWAP +# define PNG_READ_SWAP_SUPPORTED +# endif +# ifndef PNG_NO_READ_PACKSWAP +# define PNG_READ_PACKSWAP_SUPPORTED +# endif +# ifndef PNG_NO_READ_INVERT +# define PNG_READ_INVERT_SUPPORTED +# endif +# ifndef PNG_NO_READ_DITHER +# define PNG_READ_DITHER_SUPPORTED +# endif +# ifndef PNG_NO_READ_BACKGROUND +# define PNG_READ_BACKGROUND_SUPPORTED +# endif +# ifndef PNG_NO_READ_16_TO_8 +# define PNG_READ_16_TO_8_SUPPORTED +# endif +# ifndef PNG_NO_READ_FILLER +# define PNG_READ_FILLER_SUPPORTED +# endif +# ifndef PNG_NO_READ_GAMMA +# define PNG_READ_GAMMA_SUPPORTED +# endif +# ifndef PNG_NO_READ_GRAY_TO_RGB +# define PNG_READ_GRAY_TO_RGB_SUPPORTED +# endif +# ifndef PNG_NO_READ_SWAP_ALPHA +# define PNG_READ_SWAP_ALPHA_SUPPORTED +# endif +# ifndef PNG_NO_READ_INVERT_ALPHA +# define PNG_READ_INVERT_ALPHA_SUPPORTED +# endif +# ifndef PNG_NO_READ_STRIP_ALPHA +# define PNG_READ_STRIP_ALPHA_SUPPORTED +# endif +# ifndef PNG_NO_READ_USER_TRANSFORM +# define PNG_READ_USER_TRANSFORM_SUPPORTED +# endif +# ifndef PNG_NO_READ_RGB_TO_GRAY +# define PNG_READ_RGB_TO_GRAY_SUPPORTED +# endif +#endif /* PNG_READ_TRANSFORMS_SUPPORTED */ + +#if !defined(PNG_NO_PROGRESSIVE_READ) && \ + !defined(PNG_PROGRESSIVE_READ_SUPPORTED) /* if you don't do progressive */ +# define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */ +#endif /* about interlacing capability! You'll */ + /* still have interlacing unless you change the following line: */ + +#define PNG_READ_INTERLACING_SUPPORTED /* required in PNG-compliant decoders */ + +#ifndef PNG_NO_READ_COMPOSITE_NODIV +# ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */ +# define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */ +# endif +#endif + +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +/* Deprecated, will be removed from version 2.0.0. + Use PNG_MNG_FEATURES_SUPPORTED instead. */ +#ifndef PNG_NO_READ_EMPTY_PLTE +# define PNG_READ_EMPTY_PLTE_SUPPORTED +#endif +#endif + +#endif /* PNG_READ_SUPPORTED */ + +#if defined(PNG_WRITE_SUPPORTED) + +# if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \ + !defined(PNG_NO_WRITE_TRANSFORMS) +# define PNG_WRITE_TRANSFORMS_SUPPORTED +#endif + +#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED +# ifndef PNG_NO_WRITE_SHIFT +# define PNG_WRITE_SHIFT_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_PACK +# define PNG_WRITE_PACK_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_BGR +# define PNG_WRITE_BGR_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_SWAP +# define PNG_WRITE_SWAP_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_PACKSWAP +# define PNG_WRITE_PACKSWAP_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_INVERT +# define PNG_WRITE_INVERT_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_FILLER +# define PNG_WRITE_FILLER_SUPPORTED /* same as WRITE_STRIP_ALPHA */ +# endif +# ifndef PNG_NO_WRITE_SWAP_ALPHA +# define PNG_WRITE_SWAP_ALPHA_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_INVERT_ALPHA +# define PNG_WRITE_INVERT_ALPHA_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_USER_TRANSFORM +# define PNG_WRITE_USER_TRANSFORM_SUPPORTED +# endif +#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */ + +#if !defined(PNG_NO_WRITE_INTERLACING_SUPPORTED) && \ + !defined(PNG_WRITE_INTERLACING_SUPPORTED) +#define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant + encoders, but can cause trouble + if left undefined */ +#endif + +#if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \ + !defined(PNG_WRITE_WEIGHTED_FILTER) && \ + defined(PNG_FLOATING_POINT_SUPPORTED) +# define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED +#endif + +#ifndef PNG_NO_WRITE_FLUSH +# define PNG_WRITE_FLUSH_SUPPORTED +#endif + +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +/* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */ +#ifndef PNG_NO_WRITE_EMPTY_PLTE +# define PNG_WRITE_EMPTY_PLTE_SUPPORTED +#endif +#endif + +#endif /* PNG_WRITE_SUPPORTED */ + +#ifndef PNG_1_0_X +# ifndef PNG_NO_ERROR_NUMBERS +# define PNG_ERROR_NUMBERS_SUPPORTED +# endif +#endif /* PNG_1_0_X */ + +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) +# ifndef PNG_NO_USER_TRANSFORM_PTR +# define PNG_USER_TRANSFORM_PTR_SUPPORTED +# endif +#endif + +#ifndef PNG_NO_STDIO +# define PNG_TIME_RFC1123_SUPPORTED +#endif + +/* This adds extra functions in pngget.c for accessing data from the + * info pointer (added in version 0.99) + * png_get_image_width() + * png_get_image_height() + * png_get_bit_depth() + * png_get_color_type() + * png_get_compression_type() + * png_get_filter_type() + * png_get_interlace_type() + * png_get_pixel_aspect_ratio() + * png_get_pixels_per_meter() + * png_get_x_offset_pixels() + * png_get_y_offset_pixels() + * png_get_x_offset_microns() + * png_get_y_offset_microns() + */ +#if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED) +# define PNG_EASY_ACCESS_SUPPORTED +#endif + +/* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0 + * and removed from version 1.2.20. The following will be removed + * from libpng-1.4.0 +*/ + +#if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_OPTIMIZED_CODE) +# ifndef PNG_OPTIMIZED_CODE_SUPPORTED +# define PNG_OPTIMIZED_CODE_SUPPORTED +# endif +#endif + +#if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE) && defined(__i386__) +# ifndef PNG_ASSEMBLER_CODE_SUPPORTED +# define PNG_ASSEMBLER_CODE_SUPPORTED +# endif + +# if defined(__GNUC__) && defined(__x86_64__) && (__GNUC__ < 4) + /* work around 64-bit gcc compiler bugs in gcc-3.x */ +# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) +# define PNG_NO_MMX_CODE +# endif +# endif + +# if defined(__APPLE__) +# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) +# define PNG_NO_MMX_CODE +# endif +# endif + +# if (defined(__MWERKS__) && ((__MWERKS__ < 0x0900) || macintosh)) +# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) +# define PNG_NO_MMX_CODE +# endif +# endif + +# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) +# define PNG_MMX_CODE_SUPPORTED +# endif + +#endif +/* end of obsolete code to be removed from libpng-1.4.0 */ + +#if !defined(PNG_1_0_X) +#if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED) +# define PNG_USER_MEM_SUPPORTED +#endif +#endif /* PNG_1_0_X */ + +/* Added at libpng-1.2.6 */ +#if !defined(PNG_1_0_X) +#ifndef PNG_SET_USER_LIMITS_SUPPORTED +#if !defined(PNG_NO_SET_USER_LIMITS) && !defined(PNG_SET_USER_LIMITS_SUPPORTED) +# define PNG_SET_USER_LIMITS_SUPPORTED +#endif +#endif +#endif /* PNG_1_0_X */ + +/* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGS no matter + * how large, set these limits to 0x7fffffffL + */ +#ifndef PNG_USER_WIDTH_MAX +# define PNG_USER_WIDTH_MAX 1000000L +#endif +#ifndef PNG_USER_HEIGHT_MAX +# define PNG_USER_HEIGHT_MAX 1000000L +#endif + +/* Added at libpng-1.2.34 and 1.4.0 */ +#ifndef PNG_STRING_NEWLINE +#define PNG_STRING_NEWLINE "\n" +#endif + +/* These are currently experimental features, define them if you want */ + +/* very little testing */ +/* +#ifdef PNG_READ_SUPPORTED +# ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED +# define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED +# endif +#endif +*/ + +/* This is only for PowerPC big-endian and 680x0 systems */ +/* some testing */ +/* +#ifndef PNG_READ_BIG_ENDIAN_SUPPORTED +# define PNG_READ_BIG_ENDIAN_SUPPORTED +#endif +*/ + +/* Buggy compilers (e.g., gcc 2.7.2.2) need this */ +/* +#define PNG_NO_POINTER_INDEXING +*/ + +/* These functions are turned off by default, as they will be phased out. */ +/* +#define PNG_USELESS_TESTS_SUPPORTED +#define PNG_CORRECT_PALETTE_SUPPORTED +*/ + +/* Any chunks you are not interested in, you can undef here. The + * ones that allocate memory may be expecially important (hIST, + * tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info + * a bit smaller. + */ + +#if defined(PNG_READ_SUPPORTED) && \ + !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ + !defined(PNG_NO_READ_ANCILLARY_CHUNKS) +# define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED +#endif + +#if defined(PNG_WRITE_SUPPORTED) && \ + !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ + !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS) +# define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED +#endif + +#ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED + +#ifdef PNG_NO_READ_TEXT +# define PNG_NO_READ_iTXt +# define PNG_NO_READ_tEXt +# define PNG_NO_READ_zTXt +#endif +#ifndef PNG_NO_READ_bKGD +# define PNG_READ_bKGD_SUPPORTED +# define PNG_bKGD_SUPPORTED +#endif +#ifndef PNG_NO_READ_cHRM +# define PNG_READ_cHRM_SUPPORTED +# define PNG_cHRM_SUPPORTED +#endif +#ifndef PNG_NO_READ_gAMA +# define PNG_READ_gAMA_SUPPORTED +# define PNG_gAMA_SUPPORTED +#endif +#ifndef PNG_NO_READ_hIST +# define PNG_READ_hIST_SUPPORTED +# define PNG_hIST_SUPPORTED +#endif +#ifndef PNG_NO_READ_iCCP +# define PNG_READ_iCCP_SUPPORTED +# define PNG_iCCP_SUPPORTED +#endif +#ifndef PNG_NO_READ_iTXt +# ifndef PNG_READ_iTXt_SUPPORTED +# define PNG_READ_iTXt_SUPPORTED +# endif +# ifndef PNG_iTXt_SUPPORTED +# define PNG_iTXt_SUPPORTED +# endif +#endif +#ifndef PNG_NO_READ_oFFs +# define PNG_READ_oFFs_SUPPORTED +# define PNG_oFFs_SUPPORTED +#endif +#ifndef PNG_NO_READ_pCAL +# define PNG_READ_pCAL_SUPPORTED +# define PNG_pCAL_SUPPORTED +#endif +#ifndef PNG_NO_READ_sCAL +# define PNG_READ_sCAL_SUPPORTED +# define PNG_sCAL_SUPPORTED +#endif +#ifndef PNG_NO_READ_pHYs +# define PNG_READ_pHYs_SUPPORTED +# define PNG_pHYs_SUPPORTED +#endif +#ifndef PNG_NO_READ_sBIT +# define PNG_READ_sBIT_SUPPORTED +# define PNG_sBIT_SUPPORTED +#endif +#ifndef PNG_NO_READ_sPLT +# define PNG_READ_sPLT_SUPPORTED +# define PNG_sPLT_SUPPORTED +#endif +#ifndef PNG_NO_READ_sRGB +# define PNG_READ_sRGB_SUPPORTED +# define PNG_sRGB_SUPPORTED +#endif +#ifndef PNG_NO_READ_tEXt +# define PNG_READ_tEXt_SUPPORTED +# define PNG_tEXt_SUPPORTED +#endif +#ifndef PNG_NO_READ_tIME +# define PNG_READ_tIME_SUPPORTED +# define PNG_tIME_SUPPORTED +#endif +#ifndef PNG_NO_READ_tRNS +# define PNG_READ_tRNS_SUPPORTED +# define PNG_tRNS_SUPPORTED +#endif +#ifndef PNG_NO_READ_zTXt +# define PNG_READ_zTXt_SUPPORTED +# define PNG_zTXt_SUPPORTED +#endif +#ifndef PNG_NO_READ_UNKNOWN_CHUNKS +# define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED +# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED +# define PNG_UNKNOWN_CHUNKS_SUPPORTED +# endif +# ifndef PNG_NO_HANDLE_AS_UNKNOWN +# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED +# endif +#endif +#if !defined(PNG_NO_READ_USER_CHUNKS) && \ + defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) +# define PNG_READ_USER_CHUNKS_SUPPORTED +# define PNG_USER_CHUNKS_SUPPORTED +# ifdef PNG_NO_READ_UNKNOWN_CHUNKS +# undef PNG_NO_READ_UNKNOWN_CHUNKS +# endif +# ifdef PNG_NO_HANDLE_AS_UNKNOWN +# undef PNG_NO_HANDLE_AS_UNKNOWN +# endif +#endif +#ifndef PNG_NO_READ_OPT_PLTE +# define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */ +#endif /* optional PLTE chunk in RGB and RGBA images */ +#if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \ + defined(PNG_READ_zTXt_SUPPORTED) +# define PNG_READ_TEXT_SUPPORTED +# define PNG_TEXT_SUPPORTED +#endif + +#endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */ + +#ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED + +#ifdef PNG_NO_WRITE_TEXT +# define PNG_NO_WRITE_iTXt +# define PNG_NO_WRITE_tEXt +# define PNG_NO_WRITE_zTXt +#endif +#ifndef PNG_NO_WRITE_bKGD +# define PNG_WRITE_bKGD_SUPPORTED +# ifndef PNG_bKGD_SUPPORTED +# define PNG_bKGD_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_cHRM +# define PNG_WRITE_cHRM_SUPPORTED +# ifndef PNG_cHRM_SUPPORTED +# define PNG_cHRM_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_gAMA +# define PNG_WRITE_gAMA_SUPPORTED +# ifndef PNG_gAMA_SUPPORTED +# define PNG_gAMA_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_hIST +# define PNG_WRITE_hIST_SUPPORTED +# ifndef PNG_hIST_SUPPORTED +# define PNG_hIST_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_iCCP +# define PNG_WRITE_iCCP_SUPPORTED +# ifndef PNG_iCCP_SUPPORTED +# define PNG_iCCP_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_iTXt +# ifndef PNG_WRITE_iTXt_SUPPORTED +# define PNG_WRITE_iTXt_SUPPORTED +# endif +# ifndef PNG_iTXt_SUPPORTED +# define PNG_iTXt_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_oFFs +# define PNG_WRITE_oFFs_SUPPORTED +# ifndef PNG_oFFs_SUPPORTED +# define PNG_oFFs_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_pCAL +# define PNG_WRITE_pCAL_SUPPORTED +# ifndef PNG_pCAL_SUPPORTED +# define PNG_pCAL_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_sCAL +# define PNG_WRITE_sCAL_SUPPORTED +# ifndef PNG_sCAL_SUPPORTED +# define PNG_sCAL_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_pHYs +# define PNG_WRITE_pHYs_SUPPORTED +# ifndef PNG_pHYs_SUPPORTED +# define PNG_pHYs_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_sBIT +# define PNG_WRITE_sBIT_SUPPORTED +# ifndef PNG_sBIT_SUPPORTED +# define PNG_sBIT_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_sPLT +# define PNG_WRITE_sPLT_SUPPORTED +# ifndef PNG_sPLT_SUPPORTED +# define PNG_sPLT_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_sRGB +# define PNG_WRITE_sRGB_SUPPORTED +# ifndef PNG_sRGB_SUPPORTED +# define PNG_sRGB_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_tEXt +# define PNG_WRITE_tEXt_SUPPORTED +# ifndef PNG_tEXt_SUPPORTED +# define PNG_tEXt_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_tIME +# define PNG_WRITE_tIME_SUPPORTED +# ifndef PNG_tIME_SUPPORTED +# define PNG_tIME_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_tRNS +# define PNG_WRITE_tRNS_SUPPORTED +# ifndef PNG_tRNS_SUPPORTED +# define PNG_tRNS_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_zTXt +# define PNG_WRITE_zTXt_SUPPORTED +# ifndef PNG_zTXt_SUPPORTED +# define PNG_zTXt_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS +# define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED +# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED +# define PNG_UNKNOWN_CHUNKS_SUPPORTED +# endif +# ifndef PNG_NO_HANDLE_AS_UNKNOWN +# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED +# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED +# endif +# endif +#endif +#if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \ + defined(PNG_WRITE_zTXt_SUPPORTED) +# define PNG_WRITE_TEXT_SUPPORTED +# ifndef PNG_TEXT_SUPPORTED +# define PNG_TEXT_SUPPORTED +# endif +#endif + +#endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */ + +/* Turn this off to disable png_read_png() and + * png_write_png() and leave the row_pointers member + * out of the info structure. + */ +#ifndef PNG_NO_INFO_IMAGE +# define PNG_INFO_IMAGE_SUPPORTED +#endif + +/* need the time information for reading tIME chunks */ +#if defined(PNG_tIME_SUPPORTED) +# if !defined(_WIN32_WCE) + /* "time.h" functions are not supported on WindowsCE */ +# include <time.h> +# endif +#endif + +/* Some typedefs to get us started. These should be safe on most of the + * common platforms. The typedefs should be at least as large as the + * numbers suggest (a png_uint_32 must be at least 32 bits long), but they + * don't have to be exactly that size. Some compilers dislike passing + * unsigned shorts as function parameters, so you may be better off using + * unsigned int for png_uint_16. Likewise, for 64-bit systems, you may + * want to have unsigned int for png_uint_32 instead of unsigned long. + */ + +typedef unsigned long png_uint_32; +typedef long png_int_32; +typedef unsigned short png_uint_16; +typedef short png_int_16; +typedef unsigned char png_byte; + +/* This is usually size_t. It is typedef'ed just in case you need it to + change (I'm not sure if you will or not, so I thought I'd be safe) */ +#ifdef PNG_SIZE_T + typedef PNG_SIZE_T png_size_t; +# define png_sizeof(x) png_convert_size(sizeof(x)) +#else + typedef size_t png_size_t; +# define png_sizeof(x) sizeof(x) +#endif + +/* The following is needed for medium model support. It cannot be in the + * PNG_INTERNAL section. Needs modification for other compilers besides + * MSC. Model independent support declares all arrays and pointers to be + * large using the far keyword. The zlib version used must also support + * model independent data. As of version zlib 1.0.4, the necessary changes + * have been made in zlib. The USE_FAR_KEYWORD define triggers other + * changes that are needed. (Tim Wegner) + */ + +/* Separate compiler dependencies (problem here is that zlib.h always + defines FAR. (SJT) */ +#ifdef __BORLANDC__ +# if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__) +# define LDATA 1 +# else +# define LDATA 0 +# endif + /* GRR: why is Cygwin in here? Cygwin is not Borland C... */ +# if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__) +# define PNG_MAX_MALLOC_64K +# if (LDATA != 1) +# ifndef FAR +# define FAR __far +# endif +# define USE_FAR_KEYWORD +# endif /* LDATA != 1 */ + /* Possibly useful for moving data out of default segment. + * Uncomment it if you want. Could also define FARDATA as + * const if your compiler supports it. (SJT) +# define FARDATA FAR + */ +# endif /* __WIN32__, __FLAT__, __CYGWIN__ */ +#endif /* __BORLANDC__ */ + + +/* Suggest testing for specific compiler first before testing for + * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM, + * making reliance oncertain keywords suspect. (SJT) + */ + +/* MSC Medium model */ +#if defined(FAR) +# if defined(M_I86MM) +# define USE_FAR_KEYWORD +# define FARDATA FAR +# include <dos.h> +# endif +#endif + +/* SJT: default case */ +#ifndef FAR +# define FAR +#endif + +/* At this point FAR is always defined */ +#ifndef FARDATA +# define FARDATA +#endif + +/* Typedef for floating-point numbers that are converted + to fixed-point with a multiple of 100,000, e.g., int_gamma */ +typedef png_int_32 png_fixed_point; + +/* Add typedefs for pointers */ +typedef void FAR * png_voidp; +typedef png_byte FAR * png_bytep; +typedef png_uint_32 FAR * png_uint_32p; +typedef png_int_32 FAR * png_int_32p; +typedef png_uint_16 FAR * png_uint_16p; +typedef png_int_16 FAR * png_int_16p; +typedef PNG_CONST char FAR * png_const_charp; +typedef char FAR * png_charp; +typedef png_fixed_point FAR * png_fixed_point_p; + +#ifndef PNG_NO_STDIO +#if defined(_WIN32_WCE) +typedef HANDLE png_FILE_p; +#else +typedef FILE * png_FILE_p; +#endif +#endif + +#ifdef PNG_FLOATING_POINT_SUPPORTED +typedef double FAR * png_doublep; +#endif + +/* Pointers to pointers; i.e. arrays */ +typedef png_byte FAR * FAR * png_bytepp; +typedef png_uint_32 FAR * FAR * png_uint_32pp; +typedef png_int_32 FAR * FAR * png_int_32pp; +typedef png_uint_16 FAR * FAR * png_uint_16pp; +typedef png_int_16 FAR * FAR * png_int_16pp; +typedef PNG_CONST char FAR * FAR * png_const_charpp; +typedef char FAR * FAR * png_charpp; +typedef png_fixed_point FAR * FAR * png_fixed_point_pp; +#ifdef PNG_FLOATING_POINT_SUPPORTED +typedef double FAR * FAR * png_doublepp; +#endif + +/* Pointers to pointers to pointers; i.e., pointer to array */ +typedef char FAR * FAR * FAR * png_charppp; + +#if defined(PNG_1_0_X) || defined(PNG_1_2_X) +/* SPC - Is this stuff deprecated? */ +/* It'll be removed as of libpng-1.3.0 - GR-P */ +/* libpng typedefs for types in zlib. If zlib changes + * or another compression library is used, then change these. + * Eliminates need to change all the source files. + */ +typedef charf * png_zcharp; +typedef charf * FAR * png_zcharpp; +typedef z_stream FAR * png_zstreamp; +#endif /* (PNG_1_0_X) || defined(PNG_1_2_X) */ + +/* + * Define PNG_BUILD_DLL if the module being built is a Windows + * LIBPNG DLL. + * + * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL. + * It is equivalent to Microsoft predefined macro _DLL that is + * automatically defined when you compile using the share + * version of the CRT (C Run-Time library) + * + * The cygwin mods make this behavior a little different: + * Define PNG_BUILD_DLL if you are building a dll for use with cygwin + * Define PNG_STATIC if you are building a static library for use with cygwin, + * -or- if you are building an application that you want to link to the + * static library. + * PNG_USE_DLL is defined by default (no user action needed) unless one of + * the other flags is defined. + */ + +#if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL)) +# define PNG_DLL +#endif +/* If CYGWIN, then disallow GLOBAL ARRAYS unless building a static lib. + * When building a static lib, default to no GLOBAL ARRAYS, but allow + * command-line override + */ +#if defined(__CYGWIN__) +# if !defined(PNG_STATIC) +# if defined(PNG_USE_GLOBAL_ARRAYS) +# undef PNG_USE_GLOBAL_ARRAYS +# endif +# if !defined(PNG_USE_LOCAL_ARRAYS) +# define PNG_USE_LOCAL_ARRAYS +# endif +# else +# if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS) +# if defined(PNG_USE_GLOBAL_ARRAYS) +# undef PNG_USE_GLOBAL_ARRAYS +# endif +# endif +# endif +# if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) +# define PNG_USE_LOCAL_ARRAYS +# endif +#endif + +/* Do not use global arrays (helps with building DLL's) + * They are no longer used in libpng itself, since version 1.0.5c, + * but might be required for some pre-1.0.5c applications. + */ +#if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) +# if defined(PNG_NO_GLOBAL_ARRAYS) || \ + (defined(__GNUC__) && defined(PNG_DLL)) || defined(_MSC_VER) +# define PNG_USE_LOCAL_ARRAYS +# else +# define PNG_USE_GLOBAL_ARRAYS +# endif +#endif + +#if defined(__CYGWIN__) +# undef PNGAPI +# define PNGAPI __cdecl +# undef PNG_IMPEXP +# define PNG_IMPEXP +#endif + +/* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall", + * you may get warnings regarding the linkage of png_zalloc and png_zfree. + * Don't ignore those warnings; you must also reset the default calling + * convention in your compiler to match your PNGAPI, and you must build + * zlib and your applications the same way you build libpng. + */ + +#if defined(__MINGW32__) && !defined(PNG_MODULEDEF) +# ifndef PNG_NO_MODULEDEF +# define PNG_NO_MODULEDEF +# endif +#endif + +#if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF) +# define PNG_IMPEXP +#endif + +#if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \ + (( defined(_Windows) || defined(_WINDOWS) || \ + defined(WIN32) || defined(_WIN32) || defined(__WIN32__) )) + +# ifndef PNGAPI +# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800)) +# define PNGAPI __cdecl +# else +# define PNGAPI _cdecl +# endif +# endif + +# if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \ + 0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */) +# define PNG_IMPEXP +# endif + +# if !defined(PNG_IMPEXP) + +# define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol +# define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol + + /* Borland/Microsoft */ +# if defined(_MSC_VER) || defined(__BORLANDC__) +# if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500) +# define PNG_EXPORT PNG_EXPORT_TYPE1 +# else +# define PNG_EXPORT PNG_EXPORT_TYPE2 +# if defined(PNG_BUILD_DLL) +# define PNG_IMPEXP __export +# else +# define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in + VC++ */ +# endif /* Exists in Borland C++ for + C++ classes (== huge) */ +# endif +# endif + +# if !defined(PNG_IMPEXP) +# if defined(PNG_BUILD_DLL) +# define PNG_IMPEXP __declspec(dllexport) +# else +# define PNG_IMPEXP __declspec(dllimport) +# endif +# endif +# endif /* PNG_IMPEXP */ +#else /* !(DLL || non-cygwin WINDOWS) */ +# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) +# ifndef PNGAPI +# define PNGAPI _System +# endif +# else +# if 0 /* ... other platforms, with other meanings */ +# endif +# endif +#endif + +#ifndef PNGAPI +# define PNGAPI +#endif +#ifndef PNG_IMPEXP +# define PNG_IMPEXP +#endif + +#ifdef PNG_BUILDSYMS +# ifndef PNG_EXPORT +# define PNG_EXPORT(type,symbol) PNG_FUNCTION_EXPORT symbol END +# endif +# ifdef PNG_USE_GLOBAL_ARRAYS +# ifndef PNG_EXPORT_VAR +# define PNG_EXPORT_VAR(type) PNG_DATA_EXPORT +# endif +# endif +#endif + +#ifndef PNG_EXPORT +# define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol +#endif + +#ifdef PNG_USE_GLOBAL_ARRAYS +# ifndef PNG_EXPORT_VAR +# define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type +# endif +#endif + +/* User may want to use these so they are not in PNG_INTERNAL. Any library + * functions that are passed far data must be model independent. + */ + +#ifndef PNG_ABORT +# define PNG_ABORT() abort() +#endif + +#ifdef PNG_SETJMP_SUPPORTED +# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) +#else +# define png_jmpbuf(png_ptr) \ + (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED) +#endif + +#if defined(USE_FAR_KEYWORD) /* memory model independent fns */ +/* use this to make far-to-near assignments */ +# define CHECK 1 +# define NOCHECK 0 +# define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK)) +# define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK)) +# define png_snprintf _fsnprintf /* Added to v 1.2.19 */ +# define png_strlen _fstrlen +# define png_memcmp _fmemcmp /* SJT: added */ +# define png_memcpy _fmemcpy +# define png_memset _fmemset +#else /* use the usual functions */ +# define CVT_PTR(ptr) (ptr) +# define CVT_PTR_NOCHECK(ptr) (ptr) +# ifndef PNG_NO_SNPRINTF +# ifdef _MSC_VER +# define png_snprintf _snprintf /* Added to v 1.2.19 */ +# define png_snprintf2 _snprintf +# define png_snprintf6 _snprintf +# else +# define png_snprintf snprintf /* Added to v 1.2.19 */ +# define png_snprintf2 snprintf +# define png_snprintf6 snprintf +# endif +# else + /* You don't have or don't want to use snprintf(). Caution: Using + * sprintf instead of snprintf exposes your application to accidental + * or malevolent buffer overflows. If you don't have snprintf() + * as a general rule you should provide one (you can get one from + * Portable OpenSSH). */ +# define png_snprintf(s1,n,fmt,x1) sprintf(s1,fmt,x1) +# define png_snprintf2(s1,n,fmt,x1,x2) sprintf(s1,fmt,x1,x2) +# define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \ + sprintf(s1,fmt,x1,x2,x3,x4,x5,x6) +# endif +# define png_strlen strlen +# define png_memcmp memcmp /* SJT: added */ +# define png_memcpy memcpy +# define png_memset memset +#endif +/* End of memory model independent support */ + +/* Just a little check that someone hasn't tried to define something + * contradictory. + */ +#if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K) +# undef PNG_ZBUF_SIZE +# define PNG_ZBUF_SIZE 65536L +#endif + +/* Added at libpng-1.2.8 */ +#endif /* PNG_VERSION_INFO_ONLY */ + +#endif /* PNGCONF_H */ diff --git a/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/include/png.h b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/include/png.h new file mode 100644 index 0000000000..9fc8cefdcc --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/include/png.h @@ -0,0 +1,3687 @@ +/* png.h - header file for PNG reference library + * + * libpng version 1.2.37 - June 4, 2009 + * Copyright (c) 1998-2009 Glenn Randers-Pehrson + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * + * Authors and maintainers: + * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat + * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger + * libpng versions 0.97, January 1998, through 1.2.37 - June 4, 2009: Glenn + * See also "Contributing Authors", below. + * + * Note about libpng version numbers: + * + * Due to various miscommunications, unforeseen code incompatibilities + * and occasional factors outside the authors' control, version numbering + * on the library has not always been consistent and straightforward. + * The following table summarizes matters since version 0.89c, which was + * the first widely used release: + * + * source png.h png.h shared-lib + * version string int version + * ------- ------ ----- ---------- + * 0.89c "1.0 beta 3" 0.89 89 1.0.89 + * 0.90 "1.0 beta 4" 0.90 90 0.90 [should have been 2.0.90] + * 0.95 "1.0 beta 5" 0.95 95 0.95 [should have been 2.0.95] + * 0.96 "1.0 beta 6" 0.96 96 0.96 [should have been 2.0.96] + * 0.97b "1.00.97 beta 7" 1.00.97 97 1.0.1 [should have been 2.0.97] + * 0.97c 0.97 97 2.0.97 + * 0.98 0.98 98 2.0.98 + * 0.99 0.99 98 2.0.99 + * 0.99a-m 0.99 99 2.0.99 + * 1.00 1.00 100 2.1.0 [100 should be 10000] + * 1.0.0 (from here on, the 100 2.1.0 [100 should be 10000] + * 1.0.1 png.h string is 10001 2.1.0 + * 1.0.1a-e identical to the 10002 from here on, the shared library + * 1.0.2 source version) 10002 is 2.V where V is the source code + * 1.0.2a-b 10003 version, except as noted. + * 1.0.3 10003 + * 1.0.3a-d 10004 + * 1.0.4 10004 + * 1.0.4a-f 10005 + * 1.0.5 (+ 2 patches) 10005 + * 1.0.5a-d 10006 + * 1.0.5e-r 10100 (not source compatible) + * 1.0.5s-v 10006 (not binary compatible) + * 1.0.6 (+ 3 patches) 10006 (still binary incompatible) + * 1.0.6d-f 10007 (still binary incompatible) + * 1.0.6g 10007 + * 1.0.6h 10007 10.6h (testing xy.z so-numbering) + * 1.0.6i 10007 10.6i + * 1.0.6j 10007 2.1.0.6j (incompatible with 1.0.0) + * 1.0.7beta11-14 DLLNUM 10007 2.1.0.7beta11-14 (binary compatible) + * 1.0.7beta15-18 1 10007 2.1.0.7beta15-18 (binary compatible) + * 1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible) + * 1.0.7 1 10007 (still compatible) + * 1.0.8beta1-4 1 10008 2.1.0.8beta1-4 + * 1.0.8rc1 1 10008 2.1.0.8rc1 + * 1.0.8 1 10008 2.1.0.8 + * 1.0.9beta1-6 1 10009 2.1.0.9beta1-6 + * 1.0.9rc1 1 10009 2.1.0.9rc1 + * 1.0.9beta7-10 1 10009 2.1.0.9beta7-10 + * 1.0.9rc2 1 10009 2.1.0.9rc2 + * 1.0.9 1 10009 2.1.0.9 + * 1.0.10beta1 1 10010 2.1.0.10beta1 + * 1.0.10rc1 1 10010 2.1.0.10rc1 + * 1.0.10 1 10010 2.1.0.10 + * 1.0.11beta1-3 1 10011 2.1.0.11beta1-3 + * 1.0.11rc1 1 10011 2.1.0.11rc1 + * 1.0.11 1 10011 2.1.0.11 + * 1.0.12beta1-2 2 10012 2.1.0.12beta1-2 + * 1.0.12rc1 2 10012 2.1.0.12rc1 + * 1.0.12 2 10012 2.1.0.12 + * 1.1.0a-f - 10100 2.1.1.0a-f (branch abandoned) + * 1.2.0beta1-2 2 10200 2.1.2.0beta1-2 + * 1.2.0beta3-5 3 10200 3.1.2.0beta3-5 + * 1.2.0rc1 3 10200 3.1.2.0rc1 + * 1.2.0 3 10200 3.1.2.0 + * 1.2.1beta1-4 3 10201 3.1.2.1beta1-4 + * 1.2.1rc1-2 3 10201 3.1.2.1rc1-2 + * 1.2.1 3 10201 3.1.2.1 + * 1.2.2beta1-6 12 10202 12.so.0.1.2.2beta1-6 + * 1.0.13beta1 10 10013 10.so.0.1.0.13beta1 + * 1.0.13rc1 10 10013 10.so.0.1.0.13rc1 + * 1.2.2rc1 12 10202 12.so.0.1.2.2rc1 + * 1.0.13 10 10013 10.so.0.1.0.13 + * 1.2.2 12 10202 12.so.0.1.2.2 + * 1.2.3rc1-6 12 10203 12.so.0.1.2.3rc1-6 + * 1.2.3 12 10203 12.so.0.1.2.3 + * 1.2.4beta1-3 13 10204 12.so.0.1.2.4beta1-3 + * 1.0.14rc1 13 10014 10.so.0.1.0.14rc1 + * 1.2.4rc1 13 10204 12.so.0.1.2.4rc1 + * 1.0.14 10 10014 10.so.0.1.0.14 + * 1.2.4 13 10204 12.so.0.1.2.4 + * 1.2.5beta1-2 13 10205 12.so.0.1.2.5beta1-2 + * 1.0.15rc1-3 10 10015 10.so.0.1.0.15rc1-3 + * 1.2.5rc1-3 13 10205 12.so.0.1.2.5rc1-3 + * 1.0.15 10 10015 10.so.0.1.0.15 + * 1.2.5 13 10205 12.so.0.1.2.5 + * 1.2.6beta1-4 13 10206 12.so.0.1.2.6beta1-4 + * 1.0.16 10 10016 10.so.0.1.0.16 + * 1.2.6 13 10206 12.so.0.1.2.6 + * 1.2.7beta1-2 13 10207 12.so.0.1.2.7beta1-2 + * 1.0.17rc1 10 10017 10.so.0.1.0.17rc1 + * 1.2.7rc1 13 10207 12.so.0.1.2.7rc1 + * 1.0.17 10 10017 10.so.0.1.0.17 + * 1.2.7 13 10207 12.so.0.1.2.7 + * 1.2.8beta1-5 13 10208 12.so.0.1.2.8beta1-5 + * 1.0.18rc1-5 10 10018 10.so.0.1.0.18rc1-5 + * 1.2.8rc1-5 13 10208 12.so.0.1.2.8rc1-5 + * 1.0.18 10 10018 10.so.0.1.0.18 + * 1.2.8 13 10208 12.so.0.1.2.8 + * 1.2.9beta1-3 13 10209 12.so.0.1.2.9beta1-3 + * 1.2.9beta4-11 13 10209 12.so.0.9[.0] + * 1.2.9rc1 13 10209 12.so.0.9[.0] + * 1.2.9 13 10209 12.so.0.9[.0] + * 1.2.10beta1-8 13 10210 12.so.0.10[.0] + * 1.2.10rc1-3 13 10210 12.so.0.10[.0] + * 1.2.10 13 10210 12.so.0.10[.0] + * 1.2.11beta1-4 13 10211 12.so.0.11[.0] + * 1.0.19rc1-5 10 10019 10.so.0.19[.0] + * 1.2.11rc1-5 13 10211 12.so.0.11[.0] + * 1.0.19 10 10019 10.so.0.19[.0] + * 1.2.11 13 10211 12.so.0.11[.0] + * 1.0.20 10 10020 10.so.0.20[.0] + * 1.2.12 13 10212 12.so.0.12[.0] + * 1.2.13beta1 13 10213 12.so.0.13[.0] + * 1.0.21 10 10021 10.so.0.21[.0] + * 1.2.13 13 10213 12.so.0.13[.0] + * 1.2.14beta1-2 13 10214 12.so.0.14[.0] + * 1.0.22rc1 10 10022 10.so.0.22[.0] + * 1.2.14rc1 13 10214 12.so.0.14[.0] + * 1.0.22 10 10022 10.so.0.22[.0] + * 1.2.14 13 10214 12.so.0.14[.0] + * 1.2.15beta1-6 13 10215 12.so.0.15[.0] + * 1.0.23rc1-5 10 10023 10.so.0.23[.0] + * 1.2.15rc1-5 13 10215 12.so.0.15[.0] + * 1.0.23 10 10023 10.so.0.23[.0] + * 1.2.15 13 10215 12.so.0.15[.0] + * 1.2.16beta1-2 13 10216 12.so.0.16[.0] + * 1.2.16rc1 13 10216 12.so.0.16[.0] + * 1.0.24 10 10024 10.so.0.24[.0] + * 1.2.16 13 10216 12.so.0.16[.0] + * 1.2.17beta1-2 13 10217 12.so.0.17[.0] + * 1.0.25rc1 10 10025 10.so.0.25[.0] + * 1.2.17rc1-3 13 10217 12.so.0.17[.0] + * 1.0.25 10 10025 10.so.0.25[.0] + * 1.2.17 13 10217 12.so.0.17[.0] + * 1.0.26 10 10026 10.so.0.26[.0] + * 1.2.18 13 10218 12.so.0.18[.0] + * 1.2.19beta1-31 13 10219 12.so.0.19[.0] + * 1.0.27rc1-6 10 10027 10.so.0.27[.0] + * 1.2.19rc1-6 13 10219 12.so.0.19[.0] + * 1.0.27 10 10027 10.so.0.27[.0] + * 1.2.19 13 10219 12.so.0.19[.0] + * 1.2.20beta01-04 13 10220 12.so.0.20[.0] + * 1.0.28rc1-6 10 10028 10.so.0.28[.0] + * 1.2.20rc1-6 13 10220 12.so.0.20[.0] + * 1.0.28 10 10028 10.so.0.28[.0] + * 1.2.20 13 10220 12.so.0.20[.0] + * 1.2.21beta1-2 13 10221 12.so.0.21[.0] + * 1.2.21rc1-3 13 10221 12.so.0.21[.0] + * 1.0.29 10 10029 10.so.0.29[.0] + * 1.2.21 13 10221 12.so.0.21[.0] + * 1.2.22beta1-4 13 10222 12.so.0.22[.0] + * 1.0.30rc1 10 10030 10.so.0.30[.0] + * 1.2.22rc1 13 10222 12.so.0.22[.0] + * 1.0.30 10 10030 10.so.0.30[.0] + * 1.2.22 13 10222 12.so.0.22[.0] + * 1.2.23beta01-05 13 10223 12.so.0.23[.0] + * 1.2.23rc01 13 10223 12.so.0.23[.0] + * 1.2.23 13 10223 12.so.0.23[.0] + * 1.2.24beta01-02 13 10224 12.so.0.24[.0] + * 1.2.24rc01 13 10224 12.so.0.24[.0] + * 1.2.24 13 10224 12.so.0.24[.0] + * 1.2.25beta01-06 13 10225 12.so.0.25[.0] + * 1.2.25rc01-02 13 10225 12.so.0.25[.0] + * 1.0.31 10 10031 10.so.0.31[.0] + * 1.2.25 13 10225 12.so.0.25[.0] + * 1.2.26beta01-06 13 10226 12.so.0.26[.0] + * 1.2.26rc01 13 10226 12.so.0.26[.0] + * 1.2.26 13 10226 12.so.0.26[.0] + * 1.0.32 10 10032 10.so.0.32[.0] + * 1.2.27beta01-06 13 10227 12.so.0.27[.0] + * 1.2.27rc01 13 10227 12.so.0.27[.0] + * 1.0.33 10 10033 10.so.0.33[.0] + * 1.2.27 13 10227 12.so.0.27[.0] + * 1.0.34 10 10034 10.so.0.34[.0] + * 1.2.28 13 10228 12.so.0.28[.0] + * 1.2.29beta01-03 13 10229 12.so.0.29[.0] + * 1.2.29rc01 13 10229 12.so.0.29[.0] + * 1.0.35 10 10035 10.so.0.35[.0] + * 1.2.29 13 10229 12.so.0.29[.0] + * 1.0.37 10 10037 10.so.0.37[.0] + * 1.2.30beta01-04 13 10230 12.so.0.30[.0] + * 1.0.38rc01-08 10 10038 10.so.0.38[.0] + * 1.2.30rc01-08 13 10230 12.so.0.30[.0] + * 1.0.38 10 10038 10.so.0.38[.0] + * 1.2.30 13 10230 12.so.0.30[.0] + * 1.0.39rc01-03 10 10039 10.so.0.39[.0] + * 1.2.31rc01-03 13 10231 12.so.0.31[.0] + * 1.0.39 10 10039 10.so.0.39[.0] + * 1.2.31 13 10231 12.so.0.31[.0] + * 1.2.32beta01-02 13 10232 12.so.0.32[.0] + * 1.0.40rc01 10 10040 10.so.0.40[.0] + * 1.2.32rc01 13 10232 12.so.0.32[.0] + * 1.0.40 10 10040 10.so.0.40[.0] + * 1.2.32 13 10232 12.so.0.32[.0] + * 1.2.33beta01-02 13 10233 12.so.0.33[.0] + * 1.2.33rc01-02 13 10233 12.so.0.33[.0] + * 1.0.41rc01 10 10041 10.so.0.41[.0] + * 1.2.33 13 10233 12.so.0.33[.0] + * 1.0.41 10 10041 10.so.0.41[.0] + * 1.2.34beta01-07 13 10234 12.so.0.34[.0] + * 1.0.42rc01 10 10042 10.so.0.42[.0] + * 1.2.34rc01 13 10234 12.so.0.34[.0] + * 1.0.42 10 10042 10.so.0.42[.0] + * 1.2.34 13 10234 12.so.0.34[.0] + * 1.2.35beta01-03 13 10235 12.so.0.35[.0] + * 1.0.43rc01-02 10 10043 10.so.0.43[.0] + * 1.2.35rc01-02 13 10235 12.so.0.35[.0] + * 1.0.43 10 10043 10.so.0.43[.0] + * 1.2.35 13 10235 12.so.0.35[.0] + * 1.2.36beta01-05 13 10236 12.so.0.36[.0] + * 1.2.36rc01 13 10236 12.so.0.36[.0] + * 1.0.44 10 10044 10.so.0.44[.0] + * 1.2.36 13 10236 12.so.0.36[.0] + * 1.2.37beta01-03 13 10237 12.so.0.37[.0] + * 1.2.37rc01 13 10237 12.so.0.37[.0] + * 1.2.37 13 10237 12.so.0.37[.0] + * + * Henceforth the source version will match the shared-library major + * and minor numbers; the shared-library major version number will be + * used for changes in backward compatibility, as it is intended. The + * PNG_LIBPNG_VER macro, which is not used within libpng but is available + * for applications, is an unsigned integer of the form xyyzz corresponding + * to the source version x.y.z (leading zeros in y and z). Beta versions + * were given the previous public release number plus a letter, until + * version 1.0.6j; from then on they were given the upcoming public + * release number plus "betaNN" or "rcNN". + * + * Binary incompatibility exists only when applications make direct access + * to the info_ptr or png_ptr members through png.h, and the compiled + * application is loaded with a different version of the library. + * + * DLLNUM will change each time there are forward or backward changes + * in binary compatibility (e.g., when a new feature is added). + * + * See libpng.txt or libpng.3 for more information. The PNG specification + * is available as a W3C Recommendation and as an ISO Specification, + * <http://www.w3.org/TR/2003/REC-PNG-20031110/ + */ + +/* + * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: + * + * If you modify libpng you may insert additional notices immediately following + * this sentence. + * + * libpng versions 1.2.6, August 15, 2004, through 1.2.37, June 4, 2009, are + * Copyright (c) 2004, 2006-2009 Glenn Randers-Pehrson, and are + * distributed according to the same disclaimer and license as libpng-1.2.5 + * with the following individual added to the list of Contributing Authors: + * + * Cosmin Truta + * + * libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are + * Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are + * distributed according to the same disclaimer and license as libpng-1.0.6 + * with the following individuals added to the list of Contributing Authors: + * + * Simon-Pierre Cadieux + * Eric S. Raymond + * Gilles Vollant + * + * and with the following additions to the disclaimer: + * + * There is no warranty against interference with your enjoyment of the + * library or against infringement. There is no warranty that our + * efforts or the library will fulfill any of your particular purposes + * or needs. This library is provided with all faults, and the entire + * risk of satisfactory quality, performance, accuracy, and effort is with + * the user. + * + * libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are + * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson, and are + * distributed according to the same disclaimer and license as libpng-0.96, + * with the following individuals added to the list of Contributing Authors: + * + * Tom Lane + * Glenn Randers-Pehrson + * Willem van Schaik + * + * libpng versions 0.89, June 1996, through 0.96, May 1997, are + * Copyright (c) 1996, 1997 Andreas Dilger + * Distributed according to the same disclaimer and license as libpng-0.88, + * with the following individuals added to the list of Contributing Authors: + * + * John Bowler + * Kevin Bracey + * Sam Bushell + * Magnus Holmgren + * Greg Roelofs + * Tom Tanner + * + * libpng versions 0.5, May 1995, through 0.88, January 1996, are + * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. + * + * For the purposes of this copyright and license, "Contributing Authors" + * is defined as the following set of individuals: + * + * Andreas Dilger + * Dave Martindale + * Guy Eric Schalnat + * Paul Schmidt + * Tim Wegner + * + * The PNG Reference Library is supplied "AS IS". The Contributing Authors + * and Group 42, Inc. disclaim all warranties, expressed or implied, + * including, without limitation, the warranties of merchantability and of + * fitness for any purpose. The Contributing Authors and Group 42, Inc. + * assume no liability for direct, indirect, incidental, special, exemplary, + * or consequential damages, which may result from the use of the PNG + * Reference Library, even if advised of the possibility of such damage. + * + * Permission is hereby granted to use, copy, modify, and distribute this + * source code, or portions hereof, for any purpose, without fee, subject + * to the following restrictions: + * + * 1. The origin of this source code must not be misrepresented. + * + * 2. Altered versions must be plainly marked as such and + * must not be misrepresented as being the original source. + * + * 3. This Copyright notice may not be removed or altered from + * any source or altered source distribution. + * + * The Contributing Authors and Group 42, Inc. specifically permit, without + * fee, and encourage the use of this source code as a component to + * supporting the PNG file format in commercial products. If you use this + * source code in a product, acknowledgment is not required but would be + * appreciated. + */ + +/* + * A "png_get_copyright" function is available, for convenient use in "about" + * boxes and the like: + * + * printf("%s",png_get_copyright(NULL)); + * + * Also, the PNG logo (in PNG format, of course) is supplied in the + * files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). + */ + +/* + * Libpng is OSI Certified Open Source Software. OSI Certified is a + * certification mark of the Open Source Initiative. + */ + +/* + * The contributing authors would like to thank all those who helped + * with testing, bug fixes, and patience. This wouldn't have been + * possible without all of you. + * + * Thanks to Frank J. T. Wojcik for helping with the documentation. + */ + +/* + * Y2K compliance in libpng: + * ========================= + * + * June 4, 2009 + * + * Since the PNG Development group is an ad-hoc body, we can't make + * an official declaration. + * + * This is your unofficial assurance that libpng from version 0.71 and + * upward through 1.2.37 are Y2K compliant. It is my belief that earlier + * versions were also Y2K compliant. + * + * Libpng only has three year fields. One is a 2-byte unsigned integer + * that will hold years up to 65535. The other two hold the date in text + * format, and will hold years up to 9999. + * + * The integer is + * "png_uint_16 year" in png_time_struct. + * + * The strings are + * "png_charp time_buffer" in png_struct and + * "near_time_buffer", which is a local character string in png.c. + * + * There are seven time-related functions: + * png.c: png_convert_to_rfc_1123() in png.c + * (formerly png_convert_to_rfc_1152() in error) + * png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c + * png_convert_from_time_t() in pngwrite.c + * png_get_tIME() in pngget.c + * png_handle_tIME() in pngrutil.c, called in pngread.c + * png_set_tIME() in pngset.c + * png_write_tIME() in pngwutil.c, called in pngwrite.c + * + * All handle dates properly in a Y2K environment. The + * png_convert_from_time_t() function calls gmtime() to convert from system + * clock time, which returns (year - 1900), which we properly convert to + * the full 4-digit year. There is a possibility that applications using + * libpng are not passing 4-digit years into the png_convert_to_rfc_1123() + * function, or that they are incorrectly passing only a 2-digit year + * instead of "year - 1900" into the png_convert_from_struct_tm() function, + * but this is not under our control. The libpng documentation has always + * stated that it works with 4-digit years, and the APIs have been + * documented as such. + * + * The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned + * integer to hold the year, and can hold years as large as 65535. + * + * zlib, upon which libpng depends, is also Y2K compliant. It contains + * no date-related code. + * + * Glenn Randers-Pehrson + * libpng maintainer + * PNG Development Group + */ + +#ifndef PNG_H +#define PNG_H + +/* This is not the place to learn how to use libpng. The file libpng.txt + * describes how to use libpng, and the file example.c summarizes it + * with some code on which to build. This file is useful for looking + * at the actual function definitions and structure components. + */ + +/* Version information for png.h - this should match the version in png.c */ +#define PNG_LIBPNG_VER_STRING "1.2.37" +#define PNG_HEADER_VERSION_STRING \ + " libpng version 1.2.37 - June 4, 2009\n" + +#define PNG_LIBPNG_VER_SONUM 0 +#define PNG_LIBPNG_VER_DLLNUM 13 + +/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ +#define PNG_LIBPNG_VER_MAJOR 1 +#define PNG_LIBPNG_VER_MINOR 2 +#define PNG_LIBPNG_VER_RELEASE 37 +/* This should match the numeric part of the final component of + * PNG_LIBPNG_VER_STRING, omitting any leading zero: */ + +#define PNG_LIBPNG_VER_BUILD 0 + +/* Release Status */ +#define PNG_LIBPNG_BUILD_ALPHA 1 +#define PNG_LIBPNG_BUILD_BETA 2 +#define PNG_LIBPNG_BUILD_RC 3 +#define PNG_LIBPNG_BUILD_STABLE 4 +#define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7 + +/* Release-Specific Flags */ +#define PNG_LIBPNG_BUILD_PATCH 8 /* Can be OR'ed with + PNG_LIBPNG_BUILD_STABLE only */ +#define PNG_LIBPNG_BUILD_PRIVATE 16 /* Cannot be OR'ed with + PNG_LIBPNG_BUILD_SPECIAL */ +#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with + PNG_LIBPNG_BUILD_PRIVATE */ + +#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE + +/* Careful here. At one time, Guy wanted to use 082, but that would be octal. + * We must not include leading zeros. + * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only + * version 1.0.0 was mis-numbered 100 instead of 10000). From + * version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */ +#define PNG_LIBPNG_VER 10237 /* 1.2.37 */ + +#ifndef PNG_VERSION_INFO_ONLY +/* include the compression library's header */ +#include "zlib.h" +#endif + +/* include all user configurable info, including optional assembler routines */ +#include "pngconf.h" + +/* + * Added at libpng-1.2.8 */ +/* Ref MSDN: Private as priority over Special + * VS_FF_PRIVATEBUILD File *was not* built using standard release + * procedures. If this value is given, the StringFileInfo block must + * contain a PrivateBuild string. + * + * VS_FF_SPECIALBUILD File *was* built by the original company using + * standard release procedures but is a variation of the standard + * file of the same version number. If this value is given, the + * StringFileInfo block must contain a SpecialBuild string. + */ + +#if defined(PNG_USER_PRIVATEBUILD) +# define PNG_LIBPNG_BUILD_TYPE \ + (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_PRIVATE) +#else +# if defined(PNG_LIBPNG_SPECIALBUILD) +# define PNG_LIBPNG_BUILD_TYPE \ + (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_SPECIAL) +# else +# define PNG_LIBPNG_BUILD_TYPE (PNG_LIBPNG_BUILD_BASE_TYPE) +# endif +#endif + +#ifndef PNG_VERSION_INFO_ONLY + +/* Inhibit C++ name-mangling for libpng functions but not for system calls. */ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* This file is arranged in several sections. The first section contains + * structure and type definitions. The second section contains the external + * library functions, while the third has the internal library functions, + * which applications aren't expected to use directly. + */ + +#ifndef PNG_NO_TYPECAST_NULL +#define int_p_NULL (int *)NULL +#define png_bytep_NULL (png_bytep)NULL +#define png_bytepp_NULL (png_bytepp)NULL +#define png_doublep_NULL (png_doublep)NULL +#define png_error_ptr_NULL (png_error_ptr)NULL +#define png_flush_ptr_NULL (png_flush_ptr)NULL +#define png_free_ptr_NULL (png_free_ptr)NULL +#define png_infopp_NULL (png_infopp)NULL +#define png_malloc_ptr_NULL (png_malloc_ptr)NULL +#define png_read_status_ptr_NULL (png_read_status_ptr)NULL +#define png_rw_ptr_NULL (png_rw_ptr)NULL +#define png_structp_NULL (png_structp)NULL +#define png_uint_16p_NULL (png_uint_16p)NULL +#define png_voidp_NULL (png_voidp)NULL +#define png_write_status_ptr_NULL (png_write_status_ptr)NULL +#else +#define int_p_NULL NULL +#define png_bytep_NULL NULL +#define png_bytepp_NULL NULL +#define png_doublep_NULL NULL +#define png_error_ptr_NULL NULL +#define png_flush_ptr_NULL NULL +#define png_free_ptr_NULL NULL +#define png_infopp_NULL NULL +#define png_malloc_ptr_NULL NULL +#define png_read_status_ptr_NULL NULL +#define png_rw_ptr_NULL NULL +#define png_structp_NULL NULL +#define png_uint_16p_NULL NULL +#define png_voidp_NULL NULL +#define png_write_status_ptr_NULL NULL +#endif + +/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */ +#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN) +/* Version information for C files, stored in png.c. This had better match + * the version above. + */ +#ifdef PNG_USE_GLOBAL_ARRAYS +PNG_EXPORT_VAR (PNG_CONST char) png_libpng_ver[18]; + /* need room for 99.99.99beta99z */ +#else +#define png_libpng_ver png_get_header_ver(NULL) +#endif + +#ifdef PNG_USE_GLOBAL_ARRAYS +/* This was removed in version 1.0.5c */ +/* Structures to facilitate easy interlacing. See png.c for more details */ +PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_start[7]; +PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_inc[7]; +PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_ystart[7]; +PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_yinc[7]; +PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_mask[7]; +PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_dsp_mask[7]; +/* This isn't currently used. If you need it, see png.c for more details. +PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_height[7]; +*/ +#endif + +#endif /* PNG_NO_EXTERN */ + +/* Three color definitions. The order of the red, green, and blue, (and the + * exact size) is not important, although the size of the fields need to + * be png_byte or png_uint_16 (as defined below). + */ +typedef struct png_color_struct +{ + png_byte red; + png_byte green; + png_byte blue; +} png_color; +typedef png_color FAR * png_colorp; +typedef png_color FAR * FAR * png_colorpp; + +typedef struct png_color_16_struct +{ + png_byte index; /* used for palette files */ + png_uint_16 red; /* for use in red green blue files */ + png_uint_16 green; + png_uint_16 blue; + png_uint_16 gray; /* for use in grayscale files */ +} png_color_16; +typedef png_color_16 FAR * png_color_16p; +typedef png_color_16 FAR * FAR * png_color_16pp; + +typedef struct png_color_8_struct +{ + png_byte red; /* for use in red green blue files */ + png_byte green; + png_byte blue; + png_byte gray; /* for use in grayscale files */ + png_byte alpha; /* for alpha channel files */ +} png_color_8; +typedef png_color_8 FAR * png_color_8p; +typedef png_color_8 FAR * FAR * png_color_8pp; + +/* + * The following two structures are used for the in-core representation + * of sPLT chunks. + */ +typedef struct png_sPLT_entry_struct +{ + png_uint_16 red; + png_uint_16 green; + png_uint_16 blue; + png_uint_16 alpha; + png_uint_16 frequency; +} png_sPLT_entry; +typedef png_sPLT_entry FAR * png_sPLT_entryp; +typedef png_sPLT_entry FAR * FAR * png_sPLT_entrypp; + +/* When the depth of the sPLT palette is 8 bits, the color and alpha samples + * occupy the LSB of their respective members, and the MSB of each member + * is zero-filled. The frequency member always occupies the full 16 bits. + */ + +typedef struct png_sPLT_struct +{ + png_charp name; /* palette name */ + png_byte depth; /* depth of palette samples */ + png_sPLT_entryp entries; /* palette entries */ + png_int_32 nentries; /* number of palette entries */ +} png_sPLT_t; +typedef png_sPLT_t FAR * png_sPLT_tp; +typedef png_sPLT_t FAR * FAR * png_sPLT_tpp; + +#ifdef PNG_TEXT_SUPPORTED +/* png_text holds the contents of a text/ztxt/itxt chunk in a PNG file, + * and whether that contents is compressed or not. The "key" field + * points to a regular zero-terminated C string. The "text", "lang", and + * "lang_key" fields can be regular C strings, empty strings, or NULL pointers. + * However, the * structure returned by png_get_text() will always contain + * regular zero-terminated C strings (possibly empty), never NULL pointers, + * so they can be safely used in printf() and other string-handling functions. + */ +typedef struct png_text_struct +{ + int compression; /* compression value: + -1: tEXt, none + 0: zTXt, deflate + 1: iTXt, none + 2: iTXt, deflate */ + png_charp key; /* keyword, 1-79 character description of "text" */ + png_charp text; /* comment, may be an empty string (ie "") + or a NULL pointer */ + png_size_t text_length; /* length of the text string */ +#ifdef PNG_iTXt_SUPPORTED + png_size_t itxt_length; /* length of the itxt string */ + png_charp lang; /* language code, 0-79 characters + or a NULL pointer */ + png_charp lang_key; /* keyword translated UTF-8 string, 0 or more + chars or a NULL pointer */ +#endif +} png_text; +typedef png_text FAR * png_textp; +typedef png_text FAR * FAR * png_textpp; +#endif + +/* Supported compression types for text in PNG files (tEXt, and zTXt). + * The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed. */ +#define PNG_TEXT_COMPRESSION_NONE_WR -3 +#define PNG_TEXT_COMPRESSION_zTXt_WR -2 +#define PNG_TEXT_COMPRESSION_NONE -1 +#define PNG_TEXT_COMPRESSION_zTXt 0 +#define PNG_ITXT_COMPRESSION_NONE 1 +#define PNG_ITXT_COMPRESSION_zTXt 2 +#define PNG_TEXT_COMPRESSION_LAST 3 /* Not a valid value */ + +/* png_time is a way to hold the time in an machine independent way. + * Two conversions are provided, both from time_t and struct tm. There + * is no portable way to convert to either of these structures, as far + * as I know. If you know of a portable way, send it to me. As a side + * note - PNG has always been Year 2000 compliant! + */ +typedef struct png_time_struct +{ + png_uint_16 year; /* full year, as in, 1995 */ + png_byte month; /* month of year, 1 - 12 */ + png_byte day; /* day of month, 1 - 31 */ + png_byte hour; /* hour of day, 0 - 23 */ + png_byte minute; /* minute of hour, 0 - 59 */ + png_byte second; /* second of minute, 0 - 60 (for leap seconds) */ +} png_time; +typedef png_time FAR * png_timep; +typedef png_time FAR * FAR * png_timepp; + +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) +/* png_unknown_chunk is a structure to hold queued chunks for which there is + * no specific support. The idea is that we can use this to queue + * up private chunks for output even though the library doesn't actually + * know about their semantics. + */ +#define PNG_CHUNK_NAME_LENGTH 5 +typedef struct png_unknown_chunk_t +{ + png_byte name[PNG_CHUNK_NAME_LENGTH]; + png_byte *data; + png_size_t size; + + /* libpng-using applications should NOT directly modify this byte. */ + png_byte location; /* mode of operation at read time */ +} +png_unknown_chunk; +typedef png_unknown_chunk FAR * png_unknown_chunkp; +typedef png_unknown_chunk FAR * FAR * png_unknown_chunkpp; +#endif + +/* png_info is a structure that holds the information in a PNG file so + * that the application can find out the characteristics of the image. + * If you are reading the file, this structure will tell you what is + * in the PNG file. If you are writing the file, fill in the information + * you want to put into the PNG file, then call png_write_info(). + * The names chosen should be very close to the PNG specification, so + * consult that document for information about the meaning of each field. + * + * With libpng < 0.95, it was only possible to directly set and read the + * the values in the png_info_struct, which meant that the contents and + * order of the values had to remain fixed. With libpng 0.95 and later, + * however, there are now functions that abstract the contents of + * png_info_struct from the application, so this makes it easier to use + * libpng with dynamic libraries, and even makes it possible to use + * libraries that don't have all of the libpng ancillary chunk-handing + * functionality. + * + * In any case, the order of the parameters in png_info_struct should NOT + * be changed for as long as possible to keep compatibility with applications + * that use the old direct-access method with png_info_struct. + * + * The following members may have allocated storage attached that should be + * cleaned up before the structure is discarded: palette, trans, text, + * pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile, + * splt_palettes, scal_unit, row_pointers, and unknowns. By default, these + * are automatically freed when the info structure is deallocated, if they were + * allocated internally by libpng. This behavior can be changed by means + * of the png_data_freer() function. + * + * More allocation details: all the chunk-reading functions that + * change these members go through the corresponding png_set_* + * functions. A function to clear these members is available: see + * png_free_data(). The png_set_* functions do not depend on being + * able to point info structure members to any of the storage they are + * passed (they make their own copies), EXCEPT that the png_set_text + * functions use the same storage passed to them in the text_ptr or + * itxt_ptr structure argument, and the png_set_rows and png_set_unknowns + * functions do not make their own copies. + */ +typedef struct png_info_struct +{ + /* the following are necessary for every PNG file */ + png_uint_32 width; /* width of image in pixels (from IHDR) */ + png_uint_32 height; /* height of image in pixels (from IHDR) */ + png_uint_32 valid; /* valid chunk data (see PNG_INFO_ below) */ + png_uint_32 rowbytes; /* bytes needed to hold an untransformed row */ + png_colorp palette; /* array of color values (valid & PNG_INFO_PLTE) */ + png_uint_16 num_palette; /* number of color entries in "palette" (PLTE) */ + png_uint_16 num_trans; /* number of transparent palette color (tRNS) */ + png_byte bit_depth; /* 1, 2, 4, 8, or 16 bits/channel (from IHDR) */ + png_byte color_type; /* see PNG_COLOR_TYPE_ below (from IHDR) */ + /* The following three should have been named *_method not *_type */ + png_byte compression_type; /* must be PNG_COMPRESSION_TYPE_BASE (IHDR) */ + png_byte filter_type; /* must be PNG_FILTER_TYPE_BASE (from IHDR) */ + png_byte interlace_type; /* One of PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ + + /* The following is informational only on read, and not used on writes. */ + png_byte channels; /* number of data channels per pixel (1, 2, 3, 4) */ + png_byte pixel_depth; /* number of bits per pixel */ + png_byte spare_byte; /* to align the data, and for future use */ + png_byte signature[8]; /* magic bytes read by libpng from start of file */ + + /* The rest of the data is optional. If you are reading, check the + * valid field to see if the information in these are valid. If you + * are writing, set the valid field to those chunks you want written, + * and initialize the appropriate fields below. + */ + +#if defined(PNG_gAMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED) + /* The gAMA chunk describes the gamma characteristics of the system + * on which the image was created, normally in the range [1.0, 2.5]. + * Data is valid if (valid & PNG_INFO_gAMA) is non-zero. + */ + float gamma; /* gamma value of image, if (valid & PNG_INFO_gAMA) */ +#endif + +#if defined(PNG_sRGB_SUPPORTED) + /* GR-P, 0.96a */ + /* Data valid if (valid & PNG_INFO_sRGB) non-zero. */ + png_byte srgb_intent; /* sRGB rendering intent [0, 1, 2, or 3] */ +#endif + +#if defined(PNG_TEXT_SUPPORTED) + /* The tEXt, and zTXt chunks contain human-readable textual data in + * uncompressed, compressed, and optionally compressed forms, respectively. + * The data in "text" is an array of pointers to uncompressed, + * null-terminated C strings. Each chunk has a keyword that describes the + * textual data contained in that chunk. Keywords are not required to be + * unique, and the text string may be empty. Any number of text chunks may + * be in an image. + */ + int num_text; /* number of comments read/to write */ + int max_text; /* current size of text array */ + png_textp text; /* array of comments read/to write */ +#endif /* PNG_TEXT_SUPPORTED */ + +#if defined(PNG_tIME_SUPPORTED) + /* The tIME chunk holds the last time the displayed image data was + * modified. See the png_time struct for the contents of this struct. + */ + png_time mod_time; +#endif + +#if defined(PNG_sBIT_SUPPORTED) + /* The sBIT chunk specifies the number of significant high-order bits + * in the pixel data. Values are in the range [1, bit_depth], and are + * only specified for the channels in the pixel data. The contents of + * the low-order bits is not specified. Data is valid if + * (valid & PNG_INFO_sBIT) is non-zero. + */ + png_color_8 sig_bit; /* significant bits in color channels */ +#endif + +#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_EXPAND_SUPPORTED) || \ +defined(PNG_READ_BACKGROUND_SUPPORTED) + /* The tRNS chunk supplies transparency data for paletted images and + * other image types that don't need a full alpha channel. There are + * "num_trans" transparency values for a paletted image, stored in the + * same order as the palette colors, starting from index 0. Values + * for the data are in the range [0, 255], ranging from fully transparent + * to fully opaque, respectively. For non-paletted images, there is a + * single color specified that should be treated as fully transparent. + * Data is valid if (valid & PNG_INFO_tRNS) is non-zero. + */ + png_bytep trans; /* transparent values for paletted image */ + png_color_16 trans_values; /* transparent color for non-palette image */ +#endif + +#if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + /* The bKGD chunk gives the suggested image background color if the + * display program does not have its own background color and the image + * is needs to composited onto a background before display. The colors + * in "background" are normally in the same color space/depth as the + * pixel data. Data is valid if (valid & PNG_INFO_bKGD) is non-zero. + */ + png_color_16 background; +#endif + +#if defined(PNG_oFFs_SUPPORTED) + /* The oFFs chunk gives the offset in "offset_unit_type" units rightwards + * and downwards from the top-left corner of the display, page, or other + * application-specific co-ordinate space. See the PNG_OFFSET_ defines + * below for the unit types. Valid if (valid & PNG_INFO_oFFs) non-zero. + */ + png_int_32 x_offset; /* x offset on page */ + png_int_32 y_offset; /* y offset on page */ + png_byte offset_unit_type; /* offset units type */ +#endif + +#if defined(PNG_pHYs_SUPPORTED) + /* The pHYs chunk gives the physical pixel density of the image for + * display or printing in "phys_unit_type" units (see PNG_RESOLUTION_ + * defines below). Data is valid if (valid & PNG_INFO_pHYs) is non-zero. + */ + png_uint_32 x_pixels_per_unit; /* horizontal pixel density */ + png_uint_32 y_pixels_per_unit; /* vertical pixel density */ + png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */ +#endif + +#if defined(PNG_hIST_SUPPORTED) + /* The hIST chunk contains the relative frequency or importance of the + * various palette entries, so that a viewer can intelligently select a + * reduced-color palette, if required. Data is an array of "num_palette" + * values in the range [0,65535]. Data valid if (valid & PNG_INFO_hIST) + * is non-zero. + */ + png_uint_16p hist; +#endif + +#ifdef PNG_cHRM_SUPPORTED + /* The cHRM chunk describes the CIE color characteristics of the monitor + * on which the PNG was created. This data allows the viewer to do gamut + * mapping of the input image to ensure that the viewer sees the same + * colors in the image as the creator. Values are in the range + * [0.0, 0.8]. Data valid if (valid & PNG_INFO_cHRM) non-zero. + */ +#ifdef PNG_FLOATING_POINT_SUPPORTED + float x_white; + float y_white; + float x_red; + float y_red; + float x_green; + float y_green; + float x_blue; + float y_blue; +#endif +#endif + +#if defined(PNG_pCAL_SUPPORTED) + /* The pCAL chunk describes a transformation between the stored pixel + * values and original physical data values used to create the image. + * The integer range [0, 2^bit_depth - 1] maps to the floating-point + * range given by [pcal_X0, pcal_X1], and are further transformed by a + * (possibly non-linear) transformation function given by "pcal_type" + * and "pcal_params" into "pcal_units". Please see the PNG_EQUATION_ + * defines below, and the PNG-Group's PNG extensions document for a + * complete description of the transformations and how they should be + * implemented, and for a description of the ASCII parameter strings. + * Data values are valid if (valid & PNG_INFO_pCAL) non-zero. + */ + png_charp pcal_purpose; /* pCAL chunk description string */ + png_int_32 pcal_X0; /* minimum value */ + png_int_32 pcal_X1; /* maximum value */ + png_charp pcal_units; /* Latin-1 string giving physical units */ + png_charpp pcal_params; /* ASCII strings containing parameter values */ + png_byte pcal_type; /* equation type (see PNG_EQUATION_ below) */ + png_byte pcal_nparams; /* number of parameters given in pcal_params */ +#endif + +/* New members added in libpng-1.0.6 */ +#ifdef PNG_FREE_ME_SUPPORTED + png_uint_32 free_me; /* flags items libpng is responsible for freeing */ +#endif + +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) + /* storage for unknown chunks that the library doesn't recognize. */ + png_unknown_chunkp unknown_chunks; + png_size_t unknown_chunks_num; +#endif + +#if defined(PNG_iCCP_SUPPORTED) + /* iCCP chunk data. */ + png_charp iccp_name; /* profile name */ + png_charp iccp_profile; /* International Color Consortium profile data */ + /* Note to maintainer: should be png_bytep */ + png_uint_32 iccp_proflen; /* ICC profile data length */ + png_byte iccp_compression; /* Always zero */ +#endif + +#if defined(PNG_sPLT_SUPPORTED) + /* data on sPLT chunks (there may be more than one). */ + png_sPLT_tp splt_palettes; + png_uint_32 splt_palettes_num; +#endif + +#if defined(PNG_sCAL_SUPPORTED) + /* The sCAL chunk describes the actual physical dimensions of the + * subject matter of the graphic. The chunk contains a unit specification + * a byte value, and two ASCII strings representing floating-point + * values. The values are width and height corresponsing to one pixel + * in the image. This external representation is converted to double + * here. Data values are valid if (valid & PNG_INFO_sCAL) is non-zero. + */ + png_byte scal_unit; /* unit of physical scale */ +#ifdef PNG_FLOATING_POINT_SUPPORTED + double scal_pixel_width; /* width of one pixel */ + double scal_pixel_height; /* height of one pixel */ +#endif +#ifdef PNG_FIXED_POINT_SUPPORTED + png_charp scal_s_width; /* string containing height */ + png_charp scal_s_height; /* string containing width */ +#endif +#endif + +#if defined(PNG_INFO_IMAGE_SUPPORTED) + /* Memory has been allocated if (valid & PNG_ALLOCATED_INFO_ROWS) non-zero */ + /* Data valid if (valid & PNG_INFO_IDAT) non-zero */ + png_bytepp row_pointers; /* the image bits */ +#endif + +#if defined(PNG_FIXED_POINT_SUPPORTED) && defined(PNG_gAMA_SUPPORTED) + png_fixed_point int_gamma; /* gamma of image, if (valid & PNG_INFO_gAMA) */ +#endif + +#if defined(PNG_cHRM_SUPPORTED) && defined(PNG_FIXED_POINT_SUPPORTED) + png_fixed_point int_x_white; + png_fixed_point int_y_white; + png_fixed_point int_x_red; + png_fixed_point int_y_red; + png_fixed_point int_x_green; + png_fixed_point int_y_green; + png_fixed_point int_x_blue; + png_fixed_point int_y_blue; +#endif + +} png_info; + +typedef png_info FAR * png_infop; +typedef png_info FAR * FAR * png_infopp; + +/* Maximum positive integer used in PNG is (2^31)-1 */ +#define PNG_UINT_31_MAX ((png_uint_32)0x7fffffffL) +#define PNG_UINT_32_MAX ((png_uint_32)(-1)) +#define PNG_SIZE_MAX ((png_size_t)(-1)) +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +/* PNG_MAX_UINT is deprecated; use PNG_UINT_31_MAX instead. */ +#define PNG_MAX_UINT PNG_UINT_31_MAX +#endif + +/* These describe the color_type field in png_info. */ +/* color type masks */ +#define PNG_COLOR_MASK_PALETTE 1 +#define PNG_COLOR_MASK_COLOR 2 +#define PNG_COLOR_MASK_ALPHA 4 + +/* color types. Note that not all combinations are legal */ +#define PNG_COLOR_TYPE_GRAY 0 +#define PNG_COLOR_TYPE_PALETTE (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE) +#define PNG_COLOR_TYPE_RGB (PNG_COLOR_MASK_COLOR) +#define PNG_COLOR_TYPE_RGB_ALPHA (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA) +#define PNG_COLOR_TYPE_GRAY_ALPHA (PNG_COLOR_MASK_ALPHA) +/* aliases */ +#define PNG_COLOR_TYPE_RGBA PNG_COLOR_TYPE_RGB_ALPHA +#define PNG_COLOR_TYPE_GA PNG_COLOR_TYPE_GRAY_ALPHA + +/* This is for compression type. PNG 1.0-1.2 only define the single type. */ +#define PNG_COMPRESSION_TYPE_BASE 0 /* Deflate method 8, 32K window */ +#define PNG_COMPRESSION_TYPE_DEFAULT PNG_COMPRESSION_TYPE_BASE + +/* This is for filter type. PNG 1.0-1.2 only define the single type. */ +#define PNG_FILTER_TYPE_BASE 0 /* Single row per-byte filtering */ +#define PNG_INTRAPIXEL_DIFFERENCING 64 /* Used only in MNG datastreams */ +#define PNG_FILTER_TYPE_DEFAULT PNG_FILTER_TYPE_BASE + +/* These are for the interlacing type. These values should NOT be changed. */ +#define PNG_INTERLACE_NONE 0 /* Non-interlaced image */ +#define PNG_INTERLACE_ADAM7 1 /* Adam7 interlacing */ +#define PNG_INTERLACE_LAST 2 /* Not a valid value */ + +/* These are for the oFFs chunk. These values should NOT be changed. */ +#define PNG_OFFSET_PIXEL 0 /* Offset in pixels */ +#define PNG_OFFSET_MICROMETER 1 /* Offset in micrometers (1/10^6 meter) */ +#define PNG_OFFSET_LAST 2 /* Not a valid value */ + +/* These are for the pCAL chunk. These values should NOT be changed. */ +#define PNG_EQUATION_LINEAR 0 /* Linear transformation */ +#define PNG_EQUATION_BASE_E 1 /* Exponential base e transform */ +#define PNG_EQUATION_ARBITRARY 2 /* Arbitrary base exponential transform */ +#define PNG_EQUATION_HYPERBOLIC 3 /* Hyperbolic sine transformation */ +#define PNG_EQUATION_LAST 4 /* Not a valid value */ + +/* These are for the sCAL chunk. These values should NOT be changed. */ +#define PNG_SCALE_UNKNOWN 0 /* unknown unit (image scale) */ +#define PNG_SCALE_METER 1 /* meters per pixel */ +#define PNG_SCALE_RADIAN 2 /* radians per pixel */ +#define PNG_SCALE_LAST 3 /* Not a valid value */ + +/* These are for the pHYs chunk. These values should NOT be changed. */ +#define PNG_RESOLUTION_UNKNOWN 0 /* pixels/unknown unit (aspect ratio) */ +#define PNG_RESOLUTION_METER 1 /* pixels/meter */ +#define PNG_RESOLUTION_LAST 2 /* Not a valid value */ + +/* These are for the sRGB chunk. These values should NOT be changed. */ +#define PNG_sRGB_INTENT_PERCEPTUAL 0 +#define PNG_sRGB_INTENT_RELATIVE 1 +#define PNG_sRGB_INTENT_SATURATION 2 +#define PNG_sRGB_INTENT_ABSOLUTE 3 +#define PNG_sRGB_INTENT_LAST 4 /* Not a valid value */ + +/* This is for text chunks */ +#define PNG_KEYWORD_MAX_LENGTH 79 + +/* Maximum number of entries in PLTE/sPLT/tRNS arrays */ +#define PNG_MAX_PALETTE_LENGTH 256 + +/* These determine if an ancillary chunk's data has been successfully read + * from the PNG header, or if the application has filled in the corresponding + * data in the info_struct to be written into the output file. The values + * of the PNG_INFO_<chunk> defines should NOT be changed. + */ +#define PNG_INFO_gAMA 0x0001 +#define PNG_INFO_sBIT 0x0002 +#define PNG_INFO_cHRM 0x0004 +#define PNG_INFO_PLTE 0x0008 +#define PNG_INFO_tRNS 0x0010 +#define PNG_INFO_bKGD 0x0020 +#define PNG_INFO_hIST 0x0040 +#define PNG_INFO_pHYs 0x0080 +#define PNG_INFO_oFFs 0x0100 +#define PNG_INFO_tIME 0x0200 +#define PNG_INFO_pCAL 0x0400 +#define PNG_INFO_sRGB 0x0800 /* GR-P, 0.96a */ +#define PNG_INFO_iCCP 0x1000 /* ESR, 1.0.6 */ +#define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */ +#define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */ +#define PNG_INFO_IDAT 0x8000L /* ESR, 1.0.6 */ + +/* This is used for the transformation routines, as some of them + * change these values for the row. It also should enable using + * the routines for other purposes. + */ +typedef struct png_row_info_struct +{ + png_uint_32 width; /* width of row */ + png_uint_32 rowbytes; /* number of bytes in row */ + png_byte color_type; /* color type of row */ + png_byte bit_depth; /* bit depth of row */ + png_byte channels; /* number of channels (1, 2, 3, or 4) */ + png_byte pixel_depth; /* bits per pixel (depth * channels) */ +} png_row_info; + +typedef png_row_info FAR * png_row_infop; +typedef png_row_info FAR * FAR * png_row_infopp; + +/* These are the function types for the I/O functions and for the functions + * that allow the user to override the default I/O functions with his or her + * own. The png_error_ptr type should match that of user-supplied warning + * and error functions, while the png_rw_ptr type should match that of the + * user read/write data functions. + */ +typedef struct png_struct_def png_struct; +typedef png_struct FAR * png_structp; + +typedef void (PNGAPI *png_error_ptr) PNGARG((png_structp, png_const_charp)); +typedef void (PNGAPI *png_rw_ptr) PNGARG((png_structp, png_bytep, png_size_t)); +typedef void (PNGAPI *png_flush_ptr) PNGARG((png_structp)); +typedef void (PNGAPI *png_read_status_ptr) PNGARG((png_structp, png_uint_32, + int)); +typedef void (PNGAPI *png_write_status_ptr) PNGARG((png_structp, png_uint_32, + int)); + +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +typedef void (PNGAPI *png_progressive_info_ptr) PNGARG((png_structp, png_infop)); +typedef void (PNGAPI *png_progressive_end_ptr) PNGARG((png_structp, png_infop)); +typedef void (PNGAPI *png_progressive_row_ptr) PNGARG((png_structp, png_bytep, + png_uint_32, int)); +#endif + +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_LEGACY_SUPPORTED) +typedef void (PNGAPI *png_user_transform_ptr) PNGARG((png_structp, + png_row_infop, png_bytep)); +#endif + +#if defined(PNG_USER_CHUNKS_SUPPORTED) +typedef int (PNGAPI *png_user_chunk_ptr) PNGARG((png_structp, png_unknown_chunkp)); +#endif +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) +typedef void (PNGAPI *png_unknown_chunk_ptr) PNGARG((png_structp)); +#endif + +/* Transform masks for the high-level interface */ +#define PNG_TRANSFORM_IDENTITY 0x0000 /* read and write */ +#define PNG_TRANSFORM_STRIP_16 0x0001 /* read only */ +#define PNG_TRANSFORM_STRIP_ALPHA 0x0002 /* read only */ +#define PNG_TRANSFORM_PACKING 0x0004 /* read and write */ +#define PNG_TRANSFORM_PACKSWAP 0x0008 /* read and write */ +#define PNG_TRANSFORM_EXPAND 0x0010 /* read only */ +#define PNG_TRANSFORM_INVERT_MONO 0x0020 /* read and write */ +#define PNG_TRANSFORM_SHIFT 0x0040 /* read and write */ +#define PNG_TRANSFORM_BGR 0x0080 /* read and write */ +#define PNG_TRANSFORM_SWAP_ALPHA 0x0100 /* read and write */ +#define PNG_TRANSFORM_SWAP_ENDIAN 0x0200 /* read and write */ +#define PNG_TRANSFORM_INVERT_ALPHA 0x0400 /* read and write */ +#define PNG_TRANSFORM_STRIP_FILLER 0x0800 /* WRITE only, deprecated */ +/* Added to libpng-1.2.34 */ +#define PNG_TRANSFORM_STRIP_FILLER_BEFORE 0x0800 /* WRITE only */ +#define PNG_TRANSFORM_STRIP_FILLER_AFTER 0x1000 /* WRITE only */ + +/* Flags for MNG supported features */ +#define PNG_FLAG_MNG_EMPTY_PLTE 0x01 +#define PNG_FLAG_MNG_FILTER_64 0x04 +#define PNG_ALL_MNG_FEATURES 0x05 + +typedef png_voidp (*png_malloc_ptr) PNGARG((png_structp, png_size_t)); +typedef void (*png_free_ptr) PNGARG((png_structp, png_voidp)); + +/* The structure that holds the information to read and write PNG files. + * The only people who need to care about what is inside of this are the + * people who will be modifying the library for their own special needs. + * It should NOT be accessed directly by an application, except to store + * the jmp_buf. + */ + +struct png_struct_def +{ +#ifdef PNG_SETJMP_SUPPORTED + jmp_buf jmpbuf; /* used in png_error */ +#endif + png_error_ptr error_fn; /* function for printing errors and aborting */ + png_error_ptr warning_fn; /* function for printing warnings */ + png_voidp error_ptr; /* user supplied struct for error functions */ + png_rw_ptr write_data_fn; /* function for writing output data */ + png_rw_ptr read_data_fn; /* function for reading input data */ + png_voidp io_ptr; /* ptr to application struct for I/O functions */ + +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) + png_user_transform_ptr read_user_transform_fn; /* user read transform */ +#endif + +#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) + png_user_transform_ptr write_user_transform_fn; /* user write transform */ +#endif + +/* These were added in libpng-1.0.2 */ +#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) + png_voidp user_transform_ptr; /* user supplied struct for user transform */ + png_byte user_transform_depth; /* bit depth of user transformed pixels */ + png_byte user_transform_channels; /* channels in user transformed pixels */ +#endif +#endif + + png_uint_32 mode; /* tells us where we are in the PNG file */ + png_uint_32 flags; /* flags indicating various things to libpng */ + png_uint_32 transformations; /* which transformations to perform */ + + z_stream zstream; /* pointer to decompression structure (below) */ + png_bytep zbuf; /* buffer for zlib */ + png_size_t zbuf_size; /* size of zbuf */ + int zlib_level; /* holds zlib compression level */ + int zlib_method; /* holds zlib compression method */ + int zlib_window_bits; /* holds zlib compression window bits */ + int zlib_mem_level; /* holds zlib compression memory level */ + int zlib_strategy; /* holds zlib compression strategy */ + + png_uint_32 width; /* width of image in pixels */ + png_uint_32 height; /* height of image in pixels */ + png_uint_32 num_rows; /* number of rows in current pass */ + png_uint_32 usr_width; /* width of row at start of write */ + png_uint_32 rowbytes; /* size of row in bytes */ + png_uint_32 irowbytes; /* size of current interlaced row in bytes */ + png_uint_32 iwidth; /* width of current interlaced row in pixels */ + png_uint_32 row_number; /* current row in interlace pass */ + png_bytep prev_row; /* buffer to save previous (unfiltered) row */ + png_bytep row_buf; /* buffer to save current (unfiltered) row */ +#ifndef PNG_NO_WRITE_FILTER + png_bytep sub_row; /* buffer to save "sub" row when filtering */ + png_bytep up_row; /* buffer to save "up" row when filtering */ + png_bytep avg_row; /* buffer to save "avg" row when filtering */ + png_bytep paeth_row; /* buffer to save "Paeth" row when filtering */ +#endif + png_row_info row_info; /* used for transformation routines */ + + png_uint_32 idat_size; /* current IDAT size for read */ + png_uint_32 crc; /* current chunk CRC value */ + png_colorp palette; /* palette from the input file */ + png_uint_16 num_palette; /* number of color entries in palette */ + png_uint_16 num_trans; /* number of transparency values */ + png_byte chunk_name[5]; /* null-terminated name of current chunk */ + png_byte compression; /* file compression type (always 0) */ + png_byte filter; /* file filter type (always 0) */ + png_byte interlaced; /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ + png_byte pass; /* current interlace pass (0 - 6) */ + png_byte do_filter; /* row filter flags (see PNG_FILTER_ below ) */ + png_byte color_type; /* color type of file */ + png_byte bit_depth; /* bit depth of file */ + png_byte usr_bit_depth; /* bit depth of users row */ + png_byte pixel_depth; /* number of bits per pixel */ + png_byte channels; /* number of channels in file */ + png_byte usr_channels; /* channels at start of write */ + png_byte sig_bytes; /* magic bytes read/written from start of file */ + +#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) +#ifdef PNG_LEGACY_SUPPORTED + png_byte filler; /* filler byte for pixel expansion */ +#else + png_uint_16 filler; /* filler bytes for pixel expansion */ +#endif +#endif + +#if defined(PNG_bKGD_SUPPORTED) + png_byte background_gamma_type; +# ifdef PNG_FLOATING_POINT_SUPPORTED + float background_gamma; +# endif + png_color_16 background; /* background color in screen gamma space */ +#if defined(PNG_READ_GAMMA_SUPPORTED) + png_color_16 background_1; /* background normalized to gamma 1.0 */ +#endif +#endif /* PNG_bKGD_SUPPORTED */ + +#if defined(PNG_WRITE_FLUSH_SUPPORTED) + png_flush_ptr output_flush_fn;/* Function for flushing output */ + png_uint_32 flush_dist; /* how many rows apart to flush, 0 - no flush */ + png_uint_32 flush_rows; /* number of rows written since last flush */ +#endif + +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + int gamma_shift; /* number of "insignificant" bits 16-bit gamma */ +#ifdef PNG_FLOATING_POINT_SUPPORTED + float gamma; /* file gamma value */ + float screen_gamma; /* screen gamma value (display_exponent) */ +#endif +#endif + +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + png_bytep gamma_table; /* gamma table for 8-bit depth files */ + png_bytep gamma_from_1; /* converts from 1.0 to screen */ + png_bytep gamma_to_1; /* converts from file to 1.0 */ + png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */ + png_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */ + png_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */ +#endif + +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED) + png_color_8 sig_bit; /* significant bits in each available channel */ +#endif + +#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) + png_color_8 shift; /* shift for significant bit tranformation */ +#endif + +#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \ + || defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + png_bytep trans; /* transparency values for paletted files */ + png_color_16 trans_values; /* transparency values for non-paletted files */ +#endif + + png_read_status_ptr read_row_fn; /* called after each row is decoded */ + png_write_status_ptr write_row_fn; /* called after each row is encoded */ +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED + png_progressive_info_ptr info_fn; /* called after header data fully read */ + png_progressive_row_ptr row_fn; /* called after each prog. row is decoded */ + png_progressive_end_ptr end_fn; /* called after image is complete */ + png_bytep save_buffer_ptr; /* current location in save_buffer */ + png_bytep save_buffer; /* buffer for previously read data */ + png_bytep current_buffer_ptr; /* current location in current_buffer */ + png_bytep current_buffer; /* buffer for recently used data */ + png_uint_32 push_length; /* size of current input chunk */ + png_uint_32 skip_length; /* bytes to skip in input data */ + png_size_t save_buffer_size; /* amount of data now in save_buffer */ + png_size_t save_buffer_max; /* total size of save_buffer */ + png_size_t buffer_size; /* total amount of available input data */ + png_size_t current_buffer_size; /* amount of data now in current_buffer */ + int process_mode; /* what push library is currently doing */ + int cur_palette; /* current push library palette index */ + +# if defined(PNG_TEXT_SUPPORTED) + png_size_t current_text_size; /* current size of text input data */ + png_size_t current_text_left; /* how much text left to read in input */ + png_charp current_text; /* current text chunk buffer */ + png_charp current_text_ptr; /* current location in current_text */ +# endif /* PNG_TEXT_SUPPORTED */ +#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ + +#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__) +/* for the Borland special 64K segment handler */ + png_bytepp offset_table_ptr; + png_bytep offset_table; + png_uint_16 offset_table_number; + png_uint_16 offset_table_count; + png_uint_16 offset_table_count_free; +#endif + +#if defined(PNG_READ_DITHER_SUPPORTED) + png_bytep palette_lookup; /* lookup table for dithering */ + png_bytep dither_index; /* index translation for palette files */ +#endif + +#if defined(PNG_READ_DITHER_SUPPORTED) || defined(PNG_hIST_SUPPORTED) + png_uint_16p hist; /* histogram */ +#endif + +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) + png_byte heuristic_method; /* heuristic for row filter selection */ + png_byte num_prev_filters; /* number of weights for previous rows */ + png_bytep prev_filters; /* filter type(s) of previous row(s) */ + png_uint_16p filter_weights; /* weight(s) for previous line(s) */ + png_uint_16p inv_filter_weights; /* 1/weight(s) for previous line(s) */ + png_uint_16p filter_costs; /* relative filter calculation cost */ + png_uint_16p inv_filter_costs; /* 1/relative filter calculation cost */ +#endif + +#if defined(PNG_TIME_RFC1123_SUPPORTED) + png_charp time_buffer; /* String to hold RFC 1123 time text */ +#endif + +/* New members added in libpng-1.0.6 */ + +#ifdef PNG_FREE_ME_SUPPORTED + png_uint_32 free_me; /* flags items libpng is responsible for freeing */ +#endif + +#if defined(PNG_USER_CHUNKS_SUPPORTED) + png_voidp user_chunk_ptr; + png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */ +#endif + +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) + int num_chunk_list; + png_bytep chunk_list; +#endif + +/* New members added in libpng-1.0.3 */ +#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) + png_byte rgb_to_gray_status; + /* These were changed from png_byte in libpng-1.0.6 */ + png_uint_16 rgb_to_gray_red_coeff; + png_uint_16 rgb_to_gray_green_coeff; + png_uint_16 rgb_to_gray_blue_coeff; +#endif + +/* New member added in libpng-1.0.4 (renamed in 1.0.9) */ +#if defined(PNG_MNG_FEATURES_SUPPORTED) || \ + defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ + defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED) +/* changed from png_byte to png_uint_32 at version 1.2.0 */ +#ifdef PNG_1_0_X + png_byte mng_features_permitted; +#else + png_uint_32 mng_features_permitted; +#endif /* PNG_1_0_X */ +#endif + +/* New member added in libpng-1.0.7 */ +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + png_fixed_point int_gamma; +#endif + +/* New member added in libpng-1.0.9, ifdef'ed out in 1.0.12, enabled in 1.2.0 */ +#if defined(PNG_MNG_FEATURES_SUPPORTED) + png_byte filter_type; +#endif + +#if defined(PNG_1_0_X) +/* New member added in libpng-1.0.10, ifdef'ed out in 1.2.0 */ + png_uint_32 row_buf_size; +#endif + +/* New members added in libpng-1.2.0 */ +#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) +# if !defined(PNG_1_0_X) +# if defined(PNG_MMX_CODE_SUPPORTED) + png_byte mmx_bitdepth_threshold; + png_uint_32 mmx_rowbytes_threshold; +# endif + png_uint_32 asm_flags; +# endif +#endif + +/* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */ +#ifdef PNG_USER_MEM_SUPPORTED + png_voidp mem_ptr; /* user supplied struct for mem functions */ + png_malloc_ptr malloc_fn; /* function for allocating memory */ + png_free_ptr free_fn; /* function for freeing memory */ +#endif + +/* New member added in libpng-1.0.13 and 1.2.0 */ + png_bytep big_row_buf; /* buffer to save current (unfiltered) row */ + +#if defined(PNG_READ_DITHER_SUPPORTED) +/* The following three members were added at version 1.0.14 and 1.2.4 */ + png_bytep dither_sort; /* working sort array */ + png_bytep index_to_palette; /* where the original index currently is */ + /* in the palette */ + png_bytep palette_to_index; /* which original index points to this */ + /* palette color */ +#endif + +/* New members added in libpng-1.0.16 and 1.2.6 */ + png_byte compression_type; + +#ifdef PNG_SET_USER_LIMITS_SUPPORTED + png_uint_32 user_width_max; + png_uint_32 user_height_max; +#endif + +/* New member added in libpng-1.0.25 and 1.2.17 */ +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) + /* storage for unknown chunk that the library doesn't recognize. */ + png_unknown_chunk unknown_chunk; +#endif + +/* New members added in libpng-1.2.26 */ + png_uint_32 old_big_row_buf_size, old_prev_row_size; + +/* New member added in libpng-1.2.30 */ + png_charp chunkdata; /* buffer for reading chunk data */ + +}; + + +/* This triggers a compiler error in png.c, if png.c and png.h + * do not agree upon the version number. + */ +typedef png_structp version_1_2_37; + +typedef png_struct FAR * FAR * png_structpp; + +/* Here are the function definitions most commonly used. This is not + * the place to find out how to use libpng. See libpng.txt for the + * full explanation, see example.c for the summary. This just provides + * a simple one line description of the use of each function. + */ + +/* Returns the version number of the library */ +extern PNG_EXPORT(png_uint_32,png_access_version_number) PNGARG((void)); + +/* Tell lib we have already handled the first <num_bytes> magic bytes. + * Handling more than 8 bytes from the beginning of the file is an error. + */ +extern PNG_EXPORT(void,png_set_sig_bytes) PNGARG((png_structp png_ptr, + int num_bytes)); + +/* Check sig[start] through sig[start + num_to_check - 1] to see if it's a + * PNG file. Returns zero if the supplied bytes match the 8-byte PNG + * signature, and non-zero otherwise. Having num_to_check == 0 or + * start > 7 will always fail (ie return non-zero). + */ +extern PNG_EXPORT(int,png_sig_cmp) PNGARG((png_bytep sig, png_size_t start, + png_size_t num_to_check)); + +/* Simple signature checking function. This is the same as calling + * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n). + */ +extern PNG_EXPORT(int,png_check_sig) PNGARG((png_bytep sig, int num)); + +/* Allocate and initialize png_ptr struct for reading, and any other memory. */ +extern PNG_EXPORT(png_structp,png_create_read_struct) + PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, + png_error_ptr error_fn, png_error_ptr warn_fn)); + +/* Allocate and initialize png_ptr struct for writing, and any other memory */ +extern PNG_EXPORT(png_structp,png_create_write_struct) + PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, + png_error_ptr error_fn, png_error_ptr warn_fn)); + +#ifdef PNG_WRITE_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_compression_buffer_size) + PNGARG((png_structp png_ptr)); +#endif + +#ifdef PNG_WRITE_SUPPORTED +extern PNG_EXPORT(void,png_set_compression_buffer_size) + PNGARG((png_structp png_ptr, png_uint_32 size)); +#endif + +/* Reset the compression stream */ +extern PNG_EXPORT(int,png_reset_zstream) PNGARG((png_structp png_ptr)); + +/* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */ +#ifdef PNG_USER_MEM_SUPPORTED +extern PNG_EXPORT(png_structp,png_create_read_struct_2) + PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, + png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, + png_malloc_ptr malloc_fn, png_free_ptr free_fn)); +extern PNG_EXPORT(png_structp,png_create_write_struct_2) + PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, + png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, + png_malloc_ptr malloc_fn, png_free_ptr free_fn)); +#endif + +/* Write a PNG chunk - size, type, (optional) data, CRC. */ +extern PNG_EXPORT(void,png_write_chunk) PNGARG((png_structp png_ptr, + png_bytep chunk_name, png_bytep data, png_size_t length)); + +/* Write the start of a PNG chunk - length and chunk name. */ +extern PNG_EXPORT(void,png_write_chunk_start) PNGARG((png_structp png_ptr, + png_bytep chunk_name, png_uint_32 length)); + +/* Write the data of a PNG chunk started with png_write_chunk_start(). */ +extern PNG_EXPORT(void,png_write_chunk_data) PNGARG((png_structp png_ptr, + png_bytep data, png_size_t length)); + +/* Finish a chunk started with png_write_chunk_start() (includes CRC). */ +extern PNG_EXPORT(void,png_write_chunk_end) PNGARG((png_structp png_ptr)); + +/* Allocate and initialize the info structure */ +extern PNG_EXPORT(png_infop,png_create_info_struct) + PNGARG((png_structp png_ptr)); + +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +/* Initialize the info structure (old interface - DEPRECATED) */ +extern PNG_EXPORT(void,png_info_init) PNGARG((png_infop info_ptr)); +#undef png_info_init +#define png_info_init(info_ptr) png_info_init_3(&info_ptr,\ + png_sizeof(png_info)); +#endif + +extern PNG_EXPORT(void,png_info_init_3) PNGARG((png_infopp info_ptr, + png_size_t png_info_struct_size)); + +/* Writes all the PNG information before the image. */ +extern PNG_EXPORT(void,png_write_info_before_PLTE) PNGARG((png_structp png_ptr, + png_infop info_ptr)); +extern PNG_EXPORT(void,png_write_info) PNGARG((png_structp png_ptr, + png_infop info_ptr)); + +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED +/* read the information before the actual image data. */ +extern PNG_EXPORT(void,png_read_info) PNGARG((png_structp png_ptr, + png_infop info_ptr)); +#endif + +#if defined(PNG_TIME_RFC1123_SUPPORTED) +extern PNG_EXPORT(png_charp,png_convert_to_rfc1123) + PNGARG((png_structp png_ptr, png_timep ptime)); +#endif + +#if !defined(_WIN32_WCE) +/* "time.h" functions are not supported on WindowsCE */ +#if defined(PNG_WRITE_tIME_SUPPORTED) +/* convert from a struct tm to png_time */ +extern PNG_EXPORT(void,png_convert_from_struct_tm) PNGARG((png_timep ptime, + struct tm FAR * ttime)); + +/* convert from time_t to png_time. Uses gmtime() */ +extern PNG_EXPORT(void,png_convert_from_time_t) PNGARG((png_timep ptime, + time_t ttime)); +#endif /* PNG_WRITE_tIME_SUPPORTED */ +#endif /* _WIN32_WCE */ + +#if defined(PNG_READ_EXPAND_SUPPORTED) +/* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */ +extern PNG_EXPORT(void,png_set_expand) PNGARG((png_structp png_ptr)); +#if !defined(PNG_1_0_X) +extern PNG_EXPORT(void,png_set_expand_gray_1_2_4_to_8) PNGARG((png_structp + png_ptr)); +#endif +extern PNG_EXPORT(void,png_set_palette_to_rgb) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(void,png_set_tRNS_to_alpha) PNGARG((png_structp png_ptr)); +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +/* Deprecated */ +extern PNG_EXPORT(void,png_set_gray_1_2_4_to_8) PNGARG((png_structp png_ptr)); +#endif +#endif + +#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) +/* Use blue, green, red order for pixels. */ +extern PNG_EXPORT(void,png_set_bgr) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) +/* Expand the grayscale to 24-bit RGB if necessary. */ +extern PNG_EXPORT(void,png_set_gray_to_rgb) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) +/* Reduce RGB to grayscale. */ +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_rgb_to_gray) PNGARG((png_structp png_ptr, + int error_action, double red, double green )); +#endif +extern PNG_EXPORT(void,png_set_rgb_to_gray_fixed) PNGARG((png_structp png_ptr, + int error_action, png_fixed_point red, png_fixed_point green )); +extern PNG_EXPORT(png_byte,png_get_rgb_to_gray_status) PNGARG((png_structp + png_ptr)); +#endif + +extern PNG_EXPORT(void,png_build_grayscale_palette) PNGARG((int bit_depth, + png_colorp palette)); + +#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED) +extern PNG_EXPORT(void,png_set_strip_alpha) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \ + defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) +extern PNG_EXPORT(void,png_set_swap_alpha) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \ + defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) +extern PNG_EXPORT(void,png_set_invert_alpha) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) +/* Add a filler byte to 8-bit Gray or 24-bit RGB images. */ +extern PNG_EXPORT(void,png_set_filler) PNGARG((png_structp png_ptr, + png_uint_32 filler, int flags)); +/* The values of the PNG_FILLER_ defines should NOT be changed */ +#define PNG_FILLER_BEFORE 0 +#define PNG_FILLER_AFTER 1 +/* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */ +#if !defined(PNG_1_0_X) +extern PNG_EXPORT(void,png_set_add_alpha) PNGARG((png_structp png_ptr, + png_uint_32 filler, int flags)); +#endif +#endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */ + +#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) +/* Swap bytes in 16-bit depth files. */ +extern PNG_EXPORT(void,png_set_swap) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) +/* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */ +extern PNG_EXPORT(void,png_set_packing) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_PACKSWAP_SUPPORTED) || defined(PNG_WRITE_PACKSWAP_SUPPORTED) +/* Swap packing order of pixels in bytes. */ +extern PNG_EXPORT(void,png_set_packswap) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) +/* Converts files to legal bit depths. */ +extern PNG_EXPORT(void,png_set_shift) PNGARG((png_structp png_ptr, + png_color_8p true_bits)); +#endif + +#if defined(PNG_READ_INTERLACING_SUPPORTED) || \ + defined(PNG_WRITE_INTERLACING_SUPPORTED) +/* Have the code handle the interlacing. Returns the number of passes. */ +extern PNG_EXPORT(int,png_set_interlace_handling) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) +/* Invert monochrome files */ +extern PNG_EXPORT(void,png_set_invert_mono) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_BACKGROUND_SUPPORTED) +/* Handle alpha and tRNS by replacing with a background color. */ +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_background) PNGARG((png_structp png_ptr, + png_color_16p background_color, int background_gamma_code, + int need_expand, double background_gamma)); +#endif +#define PNG_BACKGROUND_GAMMA_UNKNOWN 0 +#define PNG_BACKGROUND_GAMMA_SCREEN 1 +#define PNG_BACKGROUND_GAMMA_FILE 2 +#define PNG_BACKGROUND_GAMMA_UNIQUE 3 +#endif + +#if defined(PNG_READ_16_TO_8_SUPPORTED) +/* strip the second byte of information from a 16-bit depth file. */ +extern PNG_EXPORT(void,png_set_strip_16) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_DITHER_SUPPORTED) +/* Turn on dithering, and reduce the palette to the number of colors available. */ +extern PNG_EXPORT(void,png_set_dither) PNGARG((png_structp png_ptr, + png_colorp palette, int num_palette, int maximum_colors, + png_uint_16p histogram, int full_dither)); +#endif + +#if defined(PNG_READ_GAMMA_SUPPORTED) +/* Handle gamma correction. Screen_gamma=(display_exponent) */ +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_gamma) PNGARG((png_structp png_ptr, + double screen_gamma, double default_file_gamma)); +#endif +#endif + +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +#if defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ + defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED) +/* Permit or disallow empty PLTE (0: not permitted, 1: permitted) */ +/* Deprecated and will be removed. Use png_permit_mng_features() instead. */ +extern PNG_EXPORT(void,png_permit_empty_plte) PNGARG((png_structp png_ptr, + int empty_plte_permitted)); +#endif +#endif + +#if defined(PNG_WRITE_FLUSH_SUPPORTED) +/* Set how many lines between output flushes - 0 for no flushing */ +extern PNG_EXPORT(void,png_set_flush) PNGARG((png_structp png_ptr, int nrows)); +/* Flush the current PNG output buffer */ +extern PNG_EXPORT(void,png_write_flush) PNGARG((png_structp png_ptr)); +#endif + +/* optional update palette with requested transformations */ +extern PNG_EXPORT(void,png_start_read_image) PNGARG((png_structp png_ptr)); + +/* optional call to update the users info structure */ +extern PNG_EXPORT(void,png_read_update_info) PNGARG((png_structp png_ptr, + png_infop info_ptr)); + +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED +/* read one or more rows of image data. */ +extern PNG_EXPORT(void,png_read_rows) PNGARG((png_structp png_ptr, + png_bytepp row, png_bytepp display_row, png_uint_32 num_rows)); +#endif + +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED +/* read a row of data. */ +extern PNG_EXPORT(void,png_read_row) PNGARG((png_structp png_ptr, + png_bytep row, + png_bytep display_row)); +#endif + +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED +/* read the whole image into memory at once. */ +extern PNG_EXPORT(void,png_read_image) PNGARG((png_structp png_ptr, + png_bytepp image)); +#endif + +/* write a row of image data */ +extern PNG_EXPORT(void,png_write_row) PNGARG((png_structp png_ptr, + png_bytep row)); + +/* write a few rows of image data */ +extern PNG_EXPORT(void,png_write_rows) PNGARG((png_structp png_ptr, + png_bytepp row, png_uint_32 num_rows)); + +/* write the image data */ +extern PNG_EXPORT(void,png_write_image) PNGARG((png_structp png_ptr, + png_bytepp image)); + +/* writes the end of the PNG file. */ +extern PNG_EXPORT(void,png_write_end) PNGARG((png_structp png_ptr, + png_infop info_ptr)); + +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED +/* read the end of the PNG file. */ +extern PNG_EXPORT(void,png_read_end) PNGARG((png_structp png_ptr, + png_infop info_ptr)); +#endif + +/* free any memory associated with the png_info_struct */ +extern PNG_EXPORT(void,png_destroy_info_struct) PNGARG((png_structp png_ptr, + png_infopp info_ptr_ptr)); + +/* free any memory associated with the png_struct and the png_info_structs */ +extern PNG_EXPORT(void,png_destroy_read_struct) PNGARG((png_structpp + png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr)); + +/* free all memory used by the read (old method - NOT DLL EXPORTED) */ +/* Debian note: exporting as it is required by legacy applications */ +extern PNG_EXPORT(void,png_read_destroy) PNGARG((png_structp png_ptr, png_infop info_ptr, + png_infop end_info_ptr)); + +/* free any memory associated with the png_struct and the png_info_structs */ +extern PNG_EXPORT(void,png_destroy_write_struct) + PNGARG((png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)); + +/* free any memory used in png_ptr struct (old method - NOT DLL EXPORTED) */ +/* Debian note: exporting as it is required by legacy applications */ +extern PNG_EXPORT(void,png_write_destroy) PNGARG((png_structp png_ptr)); + +/* set the libpng method of handling chunk CRC errors */ +extern PNG_EXPORT(void,png_set_crc_action) PNGARG((png_structp png_ptr, + int crit_action, int ancil_action)); + +/* Values for png_set_crc_action() to say how to handle CRC errors in + * ancillary and critical chunks, and whether to use the data contained + * therein. Note that it is impossible to "discard" data in a critical + * chunk. For versions prior to 0.90, the action was always error/quit, + * whereas in version 0.90 and later, the action for CRC errors in ancillary + * chunks is warn/discard. These values should NOT be changed. + * + * value action:critical action:ancillary + */ +#define PNG_CRC_DEFAULT 0 /* error/quit warn/discard data */ +#define PNG_CRC_ERROR_QUIT 1 /* error/quit error/quit */ +#define PNG_CRC_WARN_DISCARD 2 /* (INVALID) warn/discard data */ +#define PNG_CRC_WARN_USE 3 /* warn/use data warn/use data */ +#define PNG_CRC_QUIET_USE 4 /* quiet/use data quiet/use data */ +#define PNG_CRC_NO_CHANGE 5 /* use current value use current value */ + +/* These functions give the user control over the scan-line filtering in + * libpng and the compression methods used by zlib. These functions are + * mainly useful for testing, as the defaults should work with most users. + * Those users who are tight on memory or want faster performance at the + * expense of compression can modify them. See the compression library + * header file (zlib.h) for an explination of the compression functions. + */ + +/* set the filtering method(s) used by libpng. Currently, the only valid + * value for "method" is 0. + */ +extern PNG_EXPORT(void,png_set_filter) PNGARG((png_structp png_ptr, int method, + int filters)); + +/* Flags for png_set_filter() to say which filters to use. The flags + * are chosen so that they don't conflict with real filter types + * below, in case they are supplied instead of the #defined constants. + * These values should NOT be changed. + */ +#define PNG_NO_FILTERS 0x00 +#define PNG_FILTER_NONE 0x08 +#define PNG_FILTER_SUB 0x10 +#define PNG_FILTER_UP 0x20 +#define PNG_FILTER_AVG 0x40 +#define PNG_FILTER_PAETH 0x80 +#define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \ + PNG_FILTER_AVG | PNG_FILTER_PAETH) + +/* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now. + * These defines should NOT be changed. + */ +#define PNG_FILTER_VALUE_NONE 0 +#define PNG_FILTER_VALUE_SUB 1 +#define PNG_FILTER_VALUE_UP 2 +#define PNG_FILTER_VALUE_AVG 3 +#define PNG_FILTER_VALUE_PAETH 4 +#define PNG_FILTER_VALUE_LAST 5 + +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) /* EXPERIMENTAL */ +/* The "heuristic_method" is given by one of the PNG_FILTER_HEURISTIC_ + * defines, either the default (minimum-sum-of-absolute-differences), or + * the experimental method (weighted-minimum-sum-of-absolute-differences). + * + * Weights are factors >= 1.0, indicating how important it is to keep the + * filter type consistent between rows. Larger numbers mean the current + * filter is that many times as likely to be the same as the "num_weights" + * previous filters. This is cumulative for each previous row with a weight. + * There needs to be "num_weights" values in "filter_weights", or it can be + * NULL if the weights aren't being specified. Weights have no influence on + * the selection of the first row filter. Well chosen weights can (in theory) + * improve the compression for a given image. + * + * Costs are factors >= 1.0 indicating the relative decoding costs of a + * filter type. Higher costs indicate more decoding expense, and are + * therefore less likely to be selected over a filter with lower computational + * costs. There needs to be a value in "filter_costs" for each valid filter + * type (given by PNG_FILTER_VALUE_LAST), or it can be NULL if you aren't + * setting the costs. Costs try to improve the speed of decompression without + * unduly increasing the compressed image size. + * + * A negative weight or cost indicates the default value is to be used, and + * values in the range [0.0, 1.0) indicate the value is to remain unchanged. + * The default values for both weights and costs are currently 1.0, but may + * change if good general weighting/cost heuristics can be found. If both + * the weights and costs are set to 1.0, this degenerates the WEIGHTED method + * to the UNWEIGHTED method, but with added encoding time/computation. + */ +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_filter_heuristics) PNGARG((png_structp png_ptr, + int heuristic_method, int num_weights, png_doublep filter_weights, + png_doublep filter_costs)); +#endif +#endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */ + +/* Heuristic used for row filter selection. These defines should NOT be + * changed. + */ +#define PNG_FILTER_HEURISTIC_DEFAULT 0 /* Currently "UNWEIGHTED" */ +#define PNG_FILTER_HEURISTIC_UNWEIGHTED 1 /* Used by libpng < 0.95 */ +#define PNG_FILTER_HEURISTIC_WEIGHTED 2 /* Experimental feature */ +#define PNG_FILTER_HEURISTIC_LAST 3 /* Not a valid value */ + +/* Set the library compression level. Currently, valid values range from + * 0 - 9, corresponding directly to the zlib compression levels 0 - 9 + * (0 - no compression, 9 - "maximal" compression). Note that tests have + * shown that zlib compression levels 3-6 usually perform as well as level 9 + * for PNG images, and do considerably fewer caclulations. In the future, + * these values may not correspond directly to the zlib compression levels. + */ +extern PNG_EXPORT(void,png_set_compression_level) PNGARG((png_structp png_ptr, + int level)); + +extern PNG_EXPORT(void,png_set_compression_mem_level) + PNGARG((png_structp png_ptr, int mem_level)); + +extern PNG_EXPORT(void,png_set_compression_strategy) + PNGARG((png_structp png_ptr, int strategy)); + +extern PNG_EXPORT(void,png_set_compression_window_bits) + PNGARG((png_structp png_ptr, int window_bits)); + +extern PNG_EXPORT(void,png_set_compression_method) PNGARG((png_structp png_ptr, + int method)); + +/* These next functions are called for input/output, memory, and error + * handling. They are in the file pngrio.c, pngwio.c, and pngerror.c, + * and call standard C I/O routines such as fread(), fwrite(), and + * fprintf(). These functions can be made to use other I/O routines + * at run time for those applications that need to handle I/O in a + * different manner by calling png_set_???_fn(). See libpng.txt for + * more information. + */ + +#if !defined(PNG_NO_STDIO) +/* Initialize the input/output for the PNG file to the default functions. */ +extern PNG_EXPORT(void,png_init_io) PNGARG((png_structp png_ptr, png_FILE_p fp)); +#endif + +/* Replace the (error and abort), and warning functions with user + * supplied functions. If no messages are to be printed you must still + * write and use replacement functions. The replacement error_fn should + * still do a longjmp to the last setjmp location if you are using this + * method of error handling. If error_fn or warning_fn is NULL, the + * default function will be used. + */ + +extern PNG_EXPORT(void,png_set_error_fn) PNGARG((png_structp png_ptr, + png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn)); + +/* Return the user pointer associated with the error functions */ +extern PNG_EXPORT(png_voidp,png_get_error_ptr) PNGARG((png_structp png_ptr)); + +/* Replace the default data output functions with a user supplied one(s). + * If buffered output is not used, then output_flush_fn can be set to NULL. + * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time + * output_flush_fn will be ignored (and thus can be NULL). + * It is probably a mistake to use NULL for output_flush_fn if + * write_data_fn is not also NULL unless you have built libpng with + * PNG_WRITE_FLUSH_SUPPORTED undefined, because in this case libpng's + * default flush function, which uses the standard *FILE structure, will + * be used. + */ +extern PNG_EXPORT(void,png_set_write_fn) PNGARG((png_structp png_ptr, + png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)); + +/* Replace the default data input function with a user supplied one. */ +extern PNG_EXPORT(void,png_set_read_fn) PNGARG((png_structp png_ptr, + png_voidp io_ptr, png_rw_ptr read_data_fn)); + +/* Return the user pointer associated with the I/O functions */ +extern PNG_EXPORT(png_voidp,png_get_io_ptr) PNGARG((png_structp png_ptr)); + +extern PNG_EXPORT(void,png_set_read_status_fn) PNGARG((png_structp png_ptr, + png_read_status_ptr read_row_fn)); + +extern PNG_EXPORT(void,png_set_write_status_fn) PNGARG((png_structp png_ptr, + png_write_status_ptr write_row_fn)); + +#ifdef PNG_USER_MEM_SUPPORTED +/* Replace the default memory allocation functions with user supplied one(s). */ +extern PNG_EXPORT(void,png_set_mem_fn) PNGARG((png_structp png_ptr, + png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn)); +/* Return the user pointer associated with the memory functions */ +extern PNG_EXPORT(png_voidp,png_get_mem_ptr) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_LEGACY_SUPPORTED) +extern PNG_EXPORT(void,png_set_read_user_transform_fn) PNGARG((png_structp + png_ptr, png_user_transform_ptr read_user_transform_fn)); +#endif + +#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_LEGACY_SUPPORTED) +extern PNG_EXPORT(void,png_set_write_user_transform_fn) PNGARG((png_structp + png_ptr, png_user_transform_ptr write_user_transform_fn)); +#endif + +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_LEGACY_SUPPORTED) +extern PNG_EXPORT(void,png_set_user_transform_info) PNGARG((png_structp + png_ptr, png_voidp user_transform_ptr, int user_transform_depth, + int user_transform_channels)); +/* Return the user pointer associated with the user transform functions */ +extern PNG_EXPORT(png_voidp,png_get_user_transform_ptr) + PNGARG((png_structp png_ptr)); +#endif + +#ifdef PNG_USER_CHUNKS_SUPPORTED +extern PNG_EXPORT(void,png_set_read_user_chunk_fn) PNGARG((png_structp png_ptr, + png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn)); +extern PNG_EXPORT(png_voidp,png_get_user_chunk_ptr) PNGARG((png_structp + png_ptr)); +#endif + +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +/* Sets the function callbacks for the push reader, and a pointer to a + * user-defined structure available to the callback functions. + */ +extern PNG_EXPORT(void,png_set_progressive_read_fn) PNGARG((png_structp png_ptr, + png_voidp progressive_ptr, + png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn, + png_progressive_end_ptr end_fn)); + +/* returns the user pointer associated with the push read functions */ +extern PNG_EXPORT(png_voidp,png_get_progressive_ptr) + PNGARG((png_structp png_ptr)); + +/* function to be called when data becomes available */ +extern PNG_EXPORT(void,png_process_data) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_bytep buffer, png_size_t buffer_size)); + +/* function that combines rows. Not very much different than the + * png_combine_row() call. Is this even used????? + */ +extern PNG_EXPORT(void,png_progressive_combine_row) PNGARG((png_structp png_ptr, + png_bytep old_row, png_bytep new_row)); +#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ + +extern PNG_EXPORT(png_voidp,png_malloc) PNGARG((png_structp png_ptr, + png_uint_32 size)); + +#if defined(PNG_1_0_X) +# define png_malloc_warn png_malloc +#else +/* Added at libpng version 1.2.4 */ +extern PNG_EXPORT(png_voidp,png_malloc_warn) PNGARG((png_structp png_ptr, + png_uint_32 size)); +#endif + +/* frees a pointer allocated by png_malloc() */ +extern PNG_EXPORT(void,png_free) PNGARG((png_structp png_ptr, png_voidp ptr)); + +#if defined(PNG_1_0_X) +/* Function to allocate memory for zlib. */ +extern PNG_EXPORT(voidpf,png_zalloc) PNGARG((voidpf png_ptr, uInt items, + uInt size)); + +/* Function to free memory for zlib */ +extern PNG_EXPORT(void,png_zfree) PNGARG((voidpf png_ptr, voidpf ptr)); +#endif + +/* Free data that was allocated internally */ +extern PNG_EXPORT(void,png_free_data) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 free_me, int num)); +#ifdef PNG_FREE_ME_SUPPORTED +/* Reassign responsibility for freeing existing data, whether allocated + * by libpng or by the application */ +extern PNG_EXPORT(void,png_data_freer) PNGARG((png_structp png_ptr, + png_infop info_ptr, int freer, png_uint_32 mask)); +#endif +/* assignments for png_data_freer */ +#define PNG_DESTROY_WILL_FREE_DATA 1 +#define PNG_SET_WILL_FREE_DATA 1 +#define PNG_USER_WILL_FREE_DATA 2 +/* Flags for png_ptr->free_me and info_ptr->free_me */ +#define PNG_FREE_HIST 0x0008 +#define PNG_FREE_ICCP 0x0010 +#define PNG_FREE_SPLT 0x0020 +#define PNG_FREE_ROWS 0x0040 +#define PNG_FREE_PCAL 0x0080 +#define PNG_FREE_SCAL 0x0100 +#define PNG_FREE_UNKN 0x0200 +#define PNG_FREE_LIST 0x0400 +#define PNG_FREE_PLTE 0x1000 +#define PNG_FREE_TRNS 0x2000 +#define PNG_FREE_TEXT 0x4000 +#define PNG_FREE_ALL 0x7fff +#define PNG_FREE_MUL 0x4220 /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */ + +#ifdef PNG_USER_MEM_SUPPORTED +extern PNG_EXPORT(png_voidp,png_malloc_default) PNGARG((png_structp png_ptr, + png_uint_32 size)); +extern PNG_EXPORT(void,png_free_default) PNGARG((png_structp png_ptr, + png_voidp ptr)); +#endif + +extern PNG_EXPORT(png_voidp,png_memcpy_check) PNGARG((png_structp png_ptr, + png_voidp s1, png_voidp s2, png_uint_32 size)); + +extern PNG_EXPORT(png_voidp,png_memset_check) PNGARG((png_structp png_ptr, + png_voidp s1, int value, png_uint_32 size)); + +#if defined(USE_FAR_KEYWORD) /* memory model conversion function */ +extern void *png_far_to_near PNGARG((png_structp png_ptr,png_voidp ptr, + int check)); +#endif /* USE_FAR_KEYWORD */ + +#ifndef PNG_NO_ERROR_TEXT +/* Fatal error in PNG image of libpng - can't continue */ +extern PNG_EXPORT(void,png_error) PNGARG((png_structp png_ptr, + png_const_charp error_message)); + +/* The same, but the chunk name is prepended to the error string. */ +extern PNG_EXPORT(void,png_chunk_error) PNGARG((png_structp png_ptr, + png_const_charp error_message)); +#else +/* Fatal error in PNG image of libpng - can't continue */ +extern PNG_EXPORT(void,png_err) PNGARG((png_structp png_ptr)); +#endif + +#ifndef PNG_NO_WARNINGS +/* Non-fatal error in libpng. Can continue, but may have a problem. */ +extern PNG_EXPORT(void,png_warning) PNGARG((png_structp png_ptr, + png_const_charp warning_message)); + +#ifdef PNG_READ_SUPPORTED +/* Non-fatal error in libpng, chunk name is prepended to message. */ +extern PNG_EXPORT(void,png_chunk_warning) PNGARG((png_structp png_ptr, + png_const_charp warning_message)); +#endif /* PNG_READ_SUPPORTED */ +#endif /* PNG_NO_WARNINGS */ + +/* The png_set_<chunk> functions are for storing values in the png_info_struct. + * Similarly, the png_get_<chunk> calls are used to read values from the + * png_info_struct, either storing the parameters in the passed variables, or + * setting pointers into the png_info_struct where the data is stored. The + * png_get_<chunk> functions return a non-zero value if the data was available + * in info_ptr, or return zero and do not change any of the parameters if the + * data was not available. + * + * These functions should be used instead of directly accessing png_info + * to avoid problems with future changes in the size and internal layout of + * png_info_struct. + */ +/* Returns "flag" if chunk data is valid in info_ptr. */ +extern PNG_EXPORT(png_uint_32,png_get_valid) PNGARG((png_structp png_ptr, +png_infop info_ptr, png_uint_32 flag)); + +/* Returns number of bytes needed to hold a transformed row. */ +extern PNG_EXPORT(png_uint_32,png_get_rowbytes) PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +#if defined(PNG_INFO_IMAGE_SUPPORTED) +/* Returns row_pointers, which is an array of pointers to scanlines that was +returned from png_read_png(). */ +extern PNG_EXPORT(png_bytepp,png_get_rows) PNGARG((png_structp png_ptr, +png_infop info_ptr)); +/* Set row_pointers, which is an array of pointers to scanlines for use +by png_write_png(). */ +extern PNG_EXPORT(void,png_set_rows) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_bytepp row_pointers)); +#endif + +/* Returns number of color channels in image. */ +extern PNG_EXPORT(png_byte,png_get_channels) PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +#ifdef PNG_EASY_ACCESS_SUPPORTED +/* Returns image width in pixels. */ +extern PNG_EXPORT(png_uint_32, png_get_image_width) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image height in pixels. */ +extern PNG_EXPORT(png_uint_32, png_get_image_height) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image bit_depth. */ +extern PNG_EXPORT(png_byte, png_get_bit_depth) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image color_type. */ +extern PNG_EXPORT(png_byte, png_get_color_type) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image filter_type. */ +extern PNG_EXPORT(png_byte, png_get_filter_type) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image interlace_type. */ +extern PNG_EXPORT(png_byte, png_get_interlace_type) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image compression_type. */ +extern PNG_EXPORT(png_byte, png_get_compression_type) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image resolution in pixels per meter, from pHYs chunk data. */ +extern PNG_EXPORT(png_uint_32, png_get_pixels_per_meter) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_uint_32, png_get_x_pixels_per_meter) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_uint_32, png_get_y_pixels_per_meter) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns pixel aspect ratio, computed from pHYs chunk data. */ +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(float, png_get_pixel_aspect_ratio) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +#endif + +/* Returns image x, y offset in pixels or microns, from oFFs chunk data. */ +extern PNG_EXPORT(png_int_32, png_get_x_offset_pixels) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_int_32, png_get_y_offset_pixels) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_int_32, png_get_x_offset_microns) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_int_32, png_get_y_offset_microns) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +#endif /* PNG_EASY_ACCESS_SUPPORTED */ + +/* Returns pointer to signature string read from PNG header */ +extern PNG_EXPORT(png_bytep,png_get_signature) PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +#if defined(PNG_bKGD_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_bKGD) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_color_16p *background)); +#endif + +#if defined(PNG_bKGD_SUPPORTED) +extern PNG_EXPORT(void,png_set_bKGD) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_color_16p background)); +#endif + +#if defined(PNG_cHRM_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_cHRM) PNGARG((png_structp png_ptr, + png_infop info_ptr, double *white_x, double *white_y, double *red_x, + double *red_y, double *green_x, double *green_y, double *blue_x, + double *blue_y)); +#endif +#ifdef PNG_FIXED_POINT_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_cHRM_fixed) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_fixed_point *int_white_x, png_fixed_point + *int_white_y, png_fixed_point *int_red_x, png_fixed_point *int_red_y, + png_fixed_point *int_green_x, png_fixed_point *int_green_y, png_fixed_point + *int_blue_x, png_fixed_point *int_blue_y)); +#endif +#endif + +#if defined(PNG_cHRM_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_cHRM) PNGARG((png_structp png_ptr, + png_infop info_ptr, double white_x, double white_y, double red_x, + double red_y, double green_x, double green_y, double blue_x, double blue_y)); +#endif +#ifdef PNG_FIXED_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_cHRM_fixed) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_fixed_point int_white_x, png_fixed_point int_white_y, + png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point + int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, + png_fixed_point int_blue_y)); +#endif +#endif + +#if defined(PNG_gAMA_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_gAMA) PNGARG((png_structp png_ptr, + png_infop info_ptr, double *file_gamma)); +#endif +extern PNG_EXPORT(png_uint_32,png_get_gAMA_fixed) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_fixed_point *int_file_gamma)); +#endif + +#if defined(PNG_gAMA_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_gAMA) PNGARG((png_structp png_ptr, + png_infop info_ptr, double file_gamma)); +#endif +extern PNG_EXPORT(void,png_set_gAMA_fixed) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_fixed_point int_file_gamma)); +#endif + +#if defined(PNG_hIST_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_hIST) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_16p *hist)); +#endif + +#if defined(PNG_hIST_SUPPORTED) +extern PNG_EXPORT(void,png_set_hIST) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_16p hist)); +#endif + +extern PNG_EXPORT(png_uint_32,png_get_IHDR) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 *width, png_uint_32 *height, + int *bit_depth, int *color_type, int *interlace_method, + int *compression_method, int *filter_method)); + +extern PNG_EXPORT(void,png_set_IHDR) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, + int color_type, int interlace_method, int compression_method, + int filter_method)); + +#if defined(PNG_oFFs_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_oFFs) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_int_32 *offset_x, png_int_32 *offset_y, + int *unit_type)); +#endif + +#if defined(PNG_oFFs_SUPPORTED) +extern PNG_EXPORT(void,png_set_oFFs) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_int_32 offset_x, png_int_32 offset_y, + int unit_type)); +#endif + +#if defined(PNG_pCAL_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_pCAL) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1, + int *type, int *nparams, png_charp *units, png_charpp *params)); +#endif + +#if defined(PNG_pCAL_SUPPORTED) +extern PNG_EXPORT(void,png_set_pCAL) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_charp purpose, png_int_32 X0, png_int_32 X1, + int type, int nparams, png_charp units, png_charpp params)); +#endif + +#if defined(PNG_pHYs_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_pHYs) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); +#endif + +#if defined(PNG_pHYs_SUPPORTED) +extern PNG_EXPORT(void,png_set_pHYs) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type)); +#endif + +extern PNG_EXPORT(png_uint_32,png_get_PLTE) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_colorp *palette, int *num_palette)); + +extern PNG_EXPORT(void,png_set_PLTE) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_colorp palette, int num_palette)); + +#if defined(PNG_sBIT_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_sBIT) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_color_8p *sig_bit)); +#endif + +#if defined(PNG_sBIT_SUPPORTED) +extern PNG_EXPORT(void,png_set_sBIT) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_color_8p sig_bit)); +#endif + +#if defined(PNG_sRGB_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_sRGB) PNGARG((png_structp png_ptr, + png_infop info_ptr, int *intent)); +#endif + +#if defined(PNG_sRGB_SUPPORTED) +extern PNG_EXPORT(void,png_set_sRGB) PNGARG((png_structp png_ptr, + png_infop info_ptr, int intent)); +extern PNG_EXPORT(void,png_set_sRGB_gAMA_and_cHRM) PNGARG((png_structp png_ptr, + png_infop info_ptr, int intent)); +#endif + +#if defined(PNG_iCCP_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_iCCP) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_charpp name, int *compression_type, + png_charpp profile, png_uint_32 *proflen)); + /* Note to maintainer: profile should be png_bytepp */ +#endif + +#if defined(PNG_iCCP_SUPPORTED) +extern PNG_EXPORT(void,png_set_iCCP) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_charp name, int compression_type, + png_charp profile, png_uint_32 proflen)); + /* Note to maintainer: profile should be png_bytep */ +#endif + +#if defined(PNG_sPLT_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_sPLT) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_sPLT_tpp entries)); +#endif + +#if defined(PNG_sPLT_SUPPORTED) +extern PNG_EXPORT(void,png_set_sPLT) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_sPLT_tp entries, int nentries)); +#endif + +#if defined(PNG_TEXT_SUPPORTED) +/* png_get_text also returns the number of text chunks in *num_text */ +extern PNG_EXPORT(png_uint_32,png_get_text) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_textp *text_ptr, int *num_text)); +#endif + +/* + * Note while png_set_text() will accept a structure whose text, + * language, and translated keywords are NULL pointers, the structure + * returned by png_get_text will always contain regular + * zero-terminated C strings. They might be empty strings but + * they will never be NULL pointers. + */ + +#if defined(PNG_TEXT_SUPPORTED) +extern PNG_EXPORT(void,png_set_text) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_textp text_ptr, int num_text)); +#endif + +#if defined(PNG_tIME_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_tIME) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_timep *mod_time)); +#endif + +#if defined(PNG_tIME_SUPPORTED) +extern PNG_EXPORT(void,png_set_tIME) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_timep mod_time)); +#endif + +#if defined(PNG_tRNS_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_tRNS) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_bytep *trans, int *num_trans, + png_color_16p *trans_values)); +#endif + +#if defined(PNG_tRNS_SUPPORTED) +extern PNG_EXPORT(void,png_set_tRNS) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_bytep trans, int num_trans, + png_color_16p trans_values)); +#endif + +#if defined(PNG_tRNS_SUPPORTED) +#endif + +#if defined(PNG_sCAL_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_sCAL) PNGARG((png_structp png_ptr, + png_infop info_ptr, int *unit, double *width, double *height)); +#else +#ifdef PNG_FIXED_POINT_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_sCAL_s) PNGARG((png_structp png_ptr, + png_infop info_ptr, int *unit, png_charpp swidth, png_charpp sheight)); +#endif +#endif +#endif /* PNG_sCAL_SUPPORTED */ + +#if defined(PNG_sCAL_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_sCAL) PNGARG((png_structp png_ptr, + png_infop info_ptr, int unit, double width, double height)); +#else +#ifdef PNG_FIXED_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_sCAL_s) PNGARG((png_structp png_ptr, + png_infop info_ptr, int unit, png_charp swidth, png_charp sheight)); +#endif +#endif +#endif /* PNG_sCAL_SUPPORTED || PNG_WRITE_sCAL_SUPPORTED */ + +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) +/* provide a list of chunks and how they are to be handled, if the built-in + handling or default unknown chunk handling is not desired. Any chunks not + listed will be handled in the default manner. The IHDR and IEND chunks + must not be listed. + keep = 0: follow default behaviour + = 1: do not keep + = 2: keep only if safe-to-copy + = 3: keep even if unsafe-to-copy +*/ +extern PNG_EXPORT(void, png_set_keep_unknown_chunks) PNGARG((png_structp + png_ptr, int keep, png_bytep chunk_list, int num_chunks)); +extern PNG_EXPORT(void, png_set_unknown_chunks) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns)); +extern PNG_EXPORT(void, png_set_unknown_chunk_location) + PNGARG((png_structp png_ptr, png_infop info_ptr, int chunk, int location)); +extern PNG_EXPORT(png_uint_32,png_get_unknown_chunks) PNGARG((png_structp + png_ptr, png_infop info_ptr, png_unknown_chunkpp entries)); +#endif +#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED +PNG_EXPORT(int,png_handle_as_unknown) PNGARG((png_structp png_ptr, png_bytep + chunk_name)); +#endif + +/* Png_free_data() will turn off the "valid" flag for anything it frees. + If you need to turn it off for a chunk that your application has freed, + you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK); */ +extern PNG_EXPORT(void, png_set_invalid) PNGARG((png_structp png_ptr, + png_infop info_ptr, int mask)); + +#if defined(PNG_INFO_IMAGE_SUPPORTED) +/* The "params" pointer is currently not used and is for future expansion. */ +extern PNG_EXPORT(void, png_read_png) PNGARG((png_structp png_ptr, + png_infop info_ptr, + int transforms, + png_voidp params)); +extern PNG_EXPORT(void, png_write_png) PNGARG((png_structp png_ptr, + png_infop info_ptr, + int transforms, + png_voidp params)); +#endif + +/* Define PNG_DEBUG at compile time for debugging information. Higher + * numbers for PNG_DEBUG mean more debugging information. This has + * only been added since version 0.95 so it is not implemented throughout + * libpng yet, but more support will be added as needed. + */ +#ifdef PNG_DEBUG +#if (PNG_DEBUG > 0) +#if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER) +#include <crtdbg.h> +#if (PNG_DEBUG > 1) +#ifndef _DEBUG +# define _DEBUG +#endif +#ifndef png_debug +#define png_debug(l,m) _RPT0(_CRT_WARN,m PNG_STRING_NEWLINE) +#endif +#ifndef png_debug1 +#define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m PNG_STRING_NEWLINE,p1) +#endif +#ifndef png_debug2 +#define png_debug2(l,m,p1,p2) _RPT2(_CRT_WARN,m PNG_STRING_NEWLINE,p1,p2) +#endif +#endif +#else /* PNG_DEBUG_FILE || !_MSC_VER */ +#ifndef PNG_DEBUG_FILE +#define PNG_DEBUG_FILE stderr +#endif /* PNG_DEBUG_FILE */ + +#if (PNG_DEBUG > 1) +/* Note: ["%s"m PNG_STRING_NEWLINE] probably does not work on + * non-ISO compilers */ +# ifdef __STDC__ +# ifndef png_debug +# define png_debug(l,m) \ + { \ + int num_tabs=l; \ + fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \ + } +# endif +# ifndef png_debug1 +# define png_debug1(l,m,p1) \ + { \ + int num_tabs=l; \ + fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \ + } +# endif +# ifndef png_debug2 +# define png_debug2(l,m,p1,p2) \ + { \ + int num_tabs=l; \ + fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \ + } +# endif +# else /* __STDC __ */ +# ifndef png_debug +# define png_debug(l,m) \ + { \ + int num_tabs=l; \ + char format[256]; \ + snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ + m,PNG_STRING_NEWLINE); \ + fprintf(PNG_DEBUG_FILE,format); \ + } +# endif +# ifndef png_debug1 +# define png_debug1(l,m,p1) \ + { \ + int num_tabs=l; \ + char format[256]; \ + snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ + m,PNG_STRING_NEWLINE); \ + fprintf(PNG_DEBUG_FILE,format,p1); \ + } +# endif +# ifndef png_debug2 +# define png_debug2(l,m,p1,p2) \ + { \ + int num_tabs=l; \ + char format[256]; \ + snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ + m,PNG_STRING_NEWLINE); \ + fprintf(PNG_DEBUG_FILE,format,p1,p2); \ + } +# endif +# endif /* __STDC __ */ +#endif /* (PNG_DEBUG > 1) */ + +#endif /* _MSC_VER */ +#endif /* (PNG_DEBUG > 0) */ +#endif /* PNG_DEBUG */ +#ifndef png_debug +#define png_debug(l, m) +#endif +#ifndef png_debug1 +#define png_debug1(l, m, p1) +#endif +#ifndef png_debug2 +#define png_debug2(l, m, p1, p2) +#endif + +extern PNG_EXPORT(png_charp,png_get_copyright) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(png_charp,png_get_header_ver) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(png_charp,png_get_header_version) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((png_structp png_ptr)); + +#ifdef PNG_MNG_FEATURES_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_permit_mng_features) PNGARG((png_structp + png_ptr, png_uint_32 mng_features_permitted)); +#endif + +/* For use in png_set_keep_unknown, added to version 1.2.6 */ +#define PNG_HANDLE_CHUNK_AS_DEFAULT 0 +#define PNG_HANDLE_CHUNK_NEVER 1 +#define PNG_HANDLE_CHUNK_IF_SAFE 2 +#define PNG_HANDLE_CHUNK_ALWAYS 3 + +/* Added to version 1.2.0 */ +#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) +#if defined(PNG_MMX_CODE_SUPPORTED) +#define PNG_ASM_FLAG_MMX_SUPPORT_COMPILED 0x01 /* not user-settable */ +#define PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU 0x02 /* not user-settable */ +#define PNG_ASM_FLAG_MMX_READ_COMBINE_ROW 0x04 +#define PNG_ASM_FLAG_MMX_READ_INTERLACE 0x08 +#define PNG_ASM_FLAG_MMX_READ_FILTER_SUB 0x10 +#define PNG_ASM_FLAG_MMX_READ_FILTER_UP 0x20 +#define PNG_ASM_FLAG_MMX_READ_FILTER_AVG 0x40 +#define PNG_ASM_FLAG_MMX_READ_FILTER_PAETH 0x80 +#define PNG_ASM_FLAGS_INITIALIZED 0x80000000 /* not user-settable */ + +#define PNG_MMX_READ_FLAGS ( PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \ + | PNG_ASM_FLAG_MMX_READ_INTERLACE \ + | PNG_ASM_FLAG_MMX_READ_FILTER_SUB \ + | PNG_ASM_FLAG_MMX_READ_FILTER_UP \ + | PNG_ASM_FLAG_MMX_READ_FILTER_AVG \ + | PNG_ASM_FLAG_MMX_READ_FILTER_PAETH ) +#define PNG_MMX_WRITE_FLAGS ( 0 ) + +#define PNG_MMX_FLAGS ( PNG_ASM_FLAG_MMX_SUPPORT_COMPILED \ + | PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU \ + | PNG_MMX_READ_FLAGS \ + | PNG_MMX_WRITE_FLAGS ) + +#define PNG_SELECT_READ 1 +#define PNG_SELECT_WRITE 2 +#endif /* PNG_MMX_CODE_SUPPORTED */ + +#if !defined(PNG_1_0_X) +/* pngget.c */ +extern PNG_EXPORT(png_uint_32,png_get_mmx_flagmask) + PNGARG((int flag_select, int *compilerID)); + +/* pngget.c */ +extern PNG_EXPORT(png_uint_32,png_get_asm_flagmask) + PNGARG((int flag_select)); + +/* pngget.c */ +extern PNG_EXPORT(png_uint_32,png_get_asm_flags) + PNGARG((png_structp png_ptr)); + +/* pngget.c */ +extern PNG_EXPORT(png_byte,png_get_mmx_bitdepth_threshold) + PNGARG((png_structp png_ptr)); + +/* pngget.c */ +extern PNG_EXPORT(png_uint_32,png_get_mmx_rowbytes_threshold) + PNGARG((png_structp png_ptr)); + +/* pngset.c */ +extern PNG_EXPORT(void,png_set_asm_flags) + PNGARG((png_structp png_ptr, png_uint_32 asm_flags)); + +/* pngset.c */ +extern PNG_EXPORT(void,png_set_mmx_thresholds) + PNGARG((png_structp png_ptr, png_byte mmx_bitdepth_threshold, + png_uint_32 mmx_rowbytes_threshold)); + +#endif /* PNG_1_0_X */ + +#if !defined(PNG_1_0_X) +/* png.c, pnggccrd.c, or pngvcrd.c */ +extern PNG_EXPORT(int,png_mmx_support) PNGARG((void)); +#endif /* PNG_1_0_X */ +#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ + +/* Strip the prepended error numbers ("#nnn ") from error and warning + * messages before passing them to the error or warning handler. */ +#ifdef PNG_ERROR_NUMBERS_SUPPORTED +extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp + png_ptr, png_uint_32 strip_mode)); +#endif + +/* Added at libpng-1.2.6 */ +#ifdef PNG_SET_USER_LIMITS_SUPPORTED +extern PNG_EXPORT(void,png_set_user_limits) PNGARG((png_structp + png_ptr, png_uint_32 user_width_max, png_uint_32 user_height_max)); +extern PNG_EXPORT(png_uint_32,png_get_user_width_max) PNGARG((png_structp + png_ptr)); +extern PNG_EXPORT(png_uint_32,png_get_user_height_max) PNGARG((png_structp + png_ptr)); +#endif + + +/* Maintainer: Put new public prototypes here ^, in libpng.3, and project defs */ + +#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED +/* With these routines we avoid an integer divide, which will be slower on + * most machines. However, it does take more operations than the corresponding + * divide method, so it may be slower on a few RISC systems. There are two + * shifts (by 8 or 16 bits) and an addition, versus a single integer divide. + * + * Note that the rounding factors are NOT supposed to be the same! 128 and + * 32768 are correct for the NODIV code; 127 and 32767 are correct for the + * standard method. + * + * [Optimized code by Greg Roelofs and Mark Adler...blame us for bugs. :-) ] + */ + + /* fg and bg should be in `gamma 1.0' space; alpha is the opacity */ + +# define png_composite(composite, fg, alpha, bg) \ + { png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) * (png_uint_16)(alpha) \ + + (png_uint_16)(bg)*(png_uint_16)(255 - \ + (png_uint_16)(alpha)) + (png_uint_16)128); \ + (composite) = (png_byte)((temp + (temp >> 8)) >> 8); } + +# define png_composite_16(composite, fg, alpha, bg) \ + { png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) * (png_uint_32)(alpha) \ + + (png_uint_32)(bg)*(png_uint_32)(65535L - \ + (png_uint_32)(alpha)) + (png_uint_32)32768L); \ + (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); } + +#else /* standard method using integer division */ + +# define png_composite(composite, fg, alpha, bg) \ + (composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) + \ + (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \ + (png_uint_16)127) / 255) + +# define png_composite_16(composite, fg, alpha, bg) \ + (composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \ + (png_uint_32)(bg)*(png_uint_32)(65535L - (png_uint_32)(alpha)) + \ + (png_uint_32)32767) / (png_uint_32)65535L) + +#endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */ + +/* Inline macros to do direct reads of bytes from the input buffer. These + * require that you are using an architecture that uses PNG byte ordering + * (MSB first) and supports unaligned data storage. I think that PowerPC + * in big-endian mode and 680x0 are the only ones that will support this. + * The x86 line of processors definitely do not. The png_get_int_32() + * routine also assumes we are using two's complement format for negative + * values, which is almost certainly true. + */ +#if defined(PNG_READ_BIG_ENDIAN_SUPPORTED) +# define png_get_uint_32(buf) ( *((png_uint_32p) (buf))) +# define png_get_uint_16(buf) ( *((png_uint_16p) (buf))) +# define png_get_int_32(buf) ( *((png_int_32p) (buf))) +#else +extern PNG_EXPORT(png_uint_32,png_get_uint_32) PNGARG((png_bytep buf)); +extern PNG_EXPORT(png_uint_16,png_get_uint_16) PNGARG((png_bytep buf)); +extern PNG_EXPORT(png_int_32,png_get_int_32) PNGARG((png_bytep buf)); +#endif /* !PNG_READ_BIG_ENDIAN_SUPPORTED */ +extern PNG_EXPORT(png_uint_32,png_get_uint_31) + PNGARG((png_structp png_ptr, png_bytep buf)); +/* No png_get_int_16 -- may be added if there's a real need for it. */ + +/* Place a 32-bit number into a buffer in PNG byte order (big-endian). + */ +extern PNG_EXPORT(void,png_save_uint_32) + PNGARG((png_bytep buf, png_uint_32 i)); +extern PNG_EXPORT(void,png_save_int_32) + PNGARG((png_bytep buf, png_int_32 i)); + +/* Place a 16-bit number into a buffer in PNG byte order. + * The parameter is declared unsigned int, not png_uint_16, + * just to avoid potential problems on pre-ANSI C compilers. + */ +extern PNG_EXPORT(void,png_save_uint_16) + PNGARG((png_bytep buf, unsigned int i)); +/* No png_save_int_16 -- may be added if there's a real need for it. */ + +/* ************************************************************************* */ + +/* These next functions are used internally in the code. They generally + * shouldn't be used unless you are writing code to add or replace some + * functionality in libpng. More information about most functions can + * be found in the files where the functions are located. + */ + + +/* Various modes of operation, that are visible to applications because + * they are used for unknown chunk location. + */ +#define PNG_HAVE_IHDR 0x01 +#define PNG_HAVE_PLTE 0x02 +#define PNG_HAVE_IDAT 0x04 +#define PNG_AFTER_IDAT 0x08 /* Have complete zlib datastream */ +#define PNG_HAVE_IEND 0x10 + +#if defined(PNG_INTERNAL) + +/* More modes of operation. Note that after an init, mode is set to + * zero automatically when the structure is created. + */ +#define PNG_HAVE_gAMA 0x20 +#define PNG_HAVE_cHRM 0x40 +#define PNG_HAVE_sRGB 0x80 +#define PNG_HAVE_CHUNK_HEADER 0x100 +#define PNG_WROTE_tIME 0x200 +#define PNG_WROTE_INFO_BEFORE_PLTE 0x400 +#define PNG_BACKGROUND_IS_GRAY 0x800 +#define PNG_HAVE_PNG_SIGNATURE 0x1000 +#define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */ + +/* flags for the transformations the PNG library does on the image data */ +#define PNG_BGR 0x0001 +#define PNG_INTERLACE 0x0002 +#define PNG_PACK 0x0004 +#define PNG_SHIFT 0x0008 +#define PNG_SWAP_BYTES 0x0010 +#define PNG_INVERT_MONO 0x0020 +#define PNG_DITHER 0x0040 +#define PNG_BACKGROUND 0x0080 +#define PNG_BACKGROUND_EXPAND 0x0100 + /* 0x0200 unused */ +#define PNG_16_TO_8 0x0400 +#define PNG_RGBA 0x0800 +#define PNG_EXPAND 0x1000 +#define PNG_GAMMA 0x2000 +#define PNG_GRAY_TO_RGB 0x4000 +#define PNG_FILLER 0x8000L +#define PNG_PACKSWAP 0x10000L +#define PNG_SWAP_ALPHA 0x20000L +#define PNG_STRIP_ALPHA 0x40000L +#define PNG_INVERT_ALPHA 0x80000L +#define PNG_USER_TRANSFORM 0x100000L +#define PNG_RGB_TO_GRAY_ERR 0x200000L +#define PNG_RGB_TO_GRAY_WARN 0x400000L +#define PNG_RGB_TO_GRAY 0x600000L /* two bits, RGB_TO_GRAY_ERR|WARN */ + /* 0x800000L Unused */ +#define PNG_ADD_ALPHA 0x1000000L /* Added to libpng-1.2.7 */ +#define PNG_EXPAND_tRNS 0x2000000L /* Added to libpng-1.2.9 */ + /* 0x4000000L unused */ + /* 0x8000000L unused */ + /* 0x10000000L unused */ + /* 0x20000000L unused */ + /* 0x40000000L unused */ + +/* flags for png_create_struct */ +#define PNG_STRUCT_PNG 0x0001 +#define PNG_STRUCT_INFO 0x0002 + +/* Scaling factor for filter heuristic weighting calculations */ +#define PNG_WEIGHT_SHIFT 8 +#define PNG_WEIGHT_FACTOR (1<<(PNG_WEIGHT_SHIFT)) +#define PNG_COST_SHIFT 3 +#define PNG_COST_FACTOR (1<<(PNG_COST_SHIFT)) + +/* flags for the png_ptr->flags rather than declaring a byte for each one */ +#define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001 +#define PNG_FLAG_ZLIB_CUSTOM_LEVEL 0x0002 +#define PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL 0x0004 +#define PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS 0x0008 +#define PNG_FLAG_ZLIB_CUSTOM_METHOD 0x0010 +#define PNG_FLAG_ZLIB_FINISHED 0x0020 +#define PNG_FLAG_ROW_INIT 0x0040 +#define PNG_FLAG_FILLER_AFTER 0x0080 +#define PNG_FLAG_CRC_ANCILLARY_USE 0x0100 +#define PNG_FLAG_CRC_ANCILLARY_NOWARN 0x0200 +#define PNG_FLAG_CRC_CRITICAL_USE 0x0400 +#define PNG_FLAG_CRC_CRITICAL_IGNORE 0x0800 +#define PNG_FLAG_FREE_PLTE 0x1000 +#define PNG_FLAG_FREE_TRNS 0x2000 +#define PNG_FLAG_FREE_HIST 0x4000 +#define PNG_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000L +#define PNG_FLAG_KEEP_UNSAFE_CHUNKS 0x10000L +#define PNG_FLAG_LIBRARY_MISMATCH 0x20000L +#define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000L +#define PNG_FLAG_STRIP_ERROR_TEXT 0x80000L +#define PNG_FLAG_MALLOC_NULL_MEM_OK 0x100000L +#define PNG_FLAG_ADD_ALPHA 0x200000L /* Added to libpng-1.2.8 */ +#define PNG_FLAG_STRIP_ALPHA 0x400000L /* Added to libpng-1.2.8 */ + /* 0x800000L unused */ + /* 0x1000000L unused */ + /* 0x2000000L unused */ + /* 0x4000000L unused */ + /* 0x8000000L unused */ + /* 0x10000000L unused */ + /* 0x20000000L unused */ + /* 0x40000000L unused */ + +#define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \ + PNG_FLAG_CRC_ANCILLARY_NOWARN) + +#define PNG_FLAG_CRC_CRITICAL_MASK (PNG_FLAG_CRC_CRITICAL_USE | \ + PNG_FLAG_CRC_CRITICAL_IGNORE) + +#define PNG_FLAG_CRC_MASK (PNG_FLAG_CRC_ANCILLARY_MASK | \ + PNG_FLAG_CRC_CRITICAL_MASK) + +/* save typing and make code easier to understand */ + +#define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \ + abs((int)((c1).green) - (int)((c2).green)) + \ + abs((int)((c1).blue) - (int)((c2).blue))) + +/* Added to libpng-1.2.6 JB */ +#define PNG_ROWBYTES(pixel_bits, width) \ + ((pixel_bits) >= 8 ? \ + ((width) * (((png_uint_32)(pixel_bits)) >> 3)) : \ + (( ((width) * ((png_uint_32)(pixel_bits))) + 7) >> 3) ) + +/* PNG_OUT_OF_RANGE returns true if value is outside the range + ideal-delta..ideal+delta. Each argument is evaluated twice. + "ideal" and "delta" should be constants, normally simple + integers, "value" a variable. Added to libpng-1.2.6 JB */ +#define PNG_OUT_OF_RANGE(value, ideal, delta) \ + ( (value) < (ideal)-(delta) || (value) > (ideal)+(delta) ) + +/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */ +#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN) +/* place to hold the signature string for a PNG file. */ +#ifdef PNG_USE_GLOBAL_ARRAYS + PNG_EXPORT_VAR (PNG_CONST png_byte FARDATA) png_sig[8]; +#else +#endif +#endif /* PNG_NO_EXTERN */ + +/* Constant strings for known chunk types. If you need to add a chunk, + * define the name here, and add an invocation of the macro in png.c and + * wherever it's needed. + */ +#define PNG_IHDR png_byte png_IHDR[5] = { 73, 72, 68, 82, '\0'} +#define PNG_IDAT png_byte png_IDAT[5] = { 73, 68, 65, 84, '\0'} +#define PNG_IEND png_byte png_IEND[5] = { 73, 69, 78, 68, '\0'} +#define PNG_PLTE png_byte png_PLTE[5] = { 80, 76, 84, 69, '\0'} +#define PNG_bKGD png_byte png_bKGD[5] = { 98, 75, 71, 68, '\0'} +#define PNG_cHRM png_byte png_cHRM[5] = { 99, 72, 82, 77, '\0'} +#define PNG_gAMA png_byte png_gAMA[5] = {103, 65, 77, 65, '\0'} +#define PNG_hIST png_byte png_hIST[5] = {104, 73, 83, 84, '\0'} +#define PNG_iCCP png_byte png_iCCP[5] = {105, 67, 67, 80, '\0'} +#define PNG_iTXt png_byte png_iTXt[5] = {105, 84, 88, 116, '\0'} +#define PNG_oFFs png_byte png_oFFs[5] = {111, 70, 70, 115, '\0'} +#define PNG_pCAL png_byte png_pCAL[5] = {112, 67, 65, 76, '\0'} +#define PNG_sCAL png_byte png_sCAL[5] = {115, 67, 65, 76, '\0'} +#define PNG_pHYs png_byte png_pHYs[5] = {112, 72, 89, 115, '\0'} +#define PNG_sBIT png_byte png_sBIT[5] = {115, 66, 73, 84, '\0'} +#define PNG_sPLT png_byte png_sPLT[5] = {115, 80, 76, 84, '\0'} +#define PNG_sRGB png_byte png_sRGB[5] = {115, 82, 71, 66, '\0'} +#define PNG_tEXt png_byte png_tEXt[5] = {116, 69, 88, 116, '\0'} +#define PNG_tIME png_byte png_tIME[5] = {116, 73, 77, 69, '\0'} +#define PNG_tRNS png_byte png_tRNS[5] = {116, 82, 78, 83, '\0'} +#define PNG_zTXt png_byte png_zTXt[5] = {122, 84, 88, 116, '\0'} + +#ifdef PNG_USE_GLOBAL_ARRAYS +PNG_EXPORT_VAR (png_byte FARDATA) png_IHDR[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_IDAT[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_IEND[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_PLTE[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_bKGD[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_cHRM[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_gAMA[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_hIST[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_iCCP[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_iTXt[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_oFFs[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_pCAL[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_sCAL[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_pHYs[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_sBIT[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_sPLT[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_sRGB[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_tEXt[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_tIME[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_tRNS[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_zTXt[5]; +#endif /* PNG_USE_GLOBAL_ARRAYS */ + +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +/* Initialize png_ptr struct for reading, and allocate any other memory. + * (old interface - DEPRECATED - use png_create_read_struct instead). + */ +extern PNG_EXPORT(void,png_read_init) PNGARG((png_structp png_ptr)); +#undef png_read_init +#define png_read_init(png_ptr) png_read_init_3(&png_ptr, \ + PNG_LIBPNG_VER_STRING, png_sizeof(png_struct)); +#endif + +extern PNG_EXPORT(void,png_read_init_3) PNGARG((png_structpp ptr_ptr, + png_const_charp user_png_ver, png_size_t png_struct_size)); +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +extern PNG_EXPORT(void,png_read_init_2) PNGARG((png_structp png_ptr, + png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t + png_info_size)); +#endif + +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +/* Initialize png_ptr struct for writing, and allocate any other memory. + * (old interface - DEPRECATED - use png_create_write_struct instead). + */ +extern PNG_EXPORT(void,png_write_init) PNGARG((png_structp png_ptr)); +#undef png_write_init +#define png_write_init(png_ptr) png_write_init_3(&png_ptr, \ + PNG_LIBPNG_VER_STRING, png_sizeof(png_struct)); +#endif + +extern PNG_EXPORT(void,png_write_init_3) PNGARG((png_structpp ptr_ptr, + png_const_charp user_png_ver, png_size_t png_struct_size)); +extern PNG_EXPORT(void,png_write_init_2) PNGARG((png_structp png_ptr, + png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t + png_info_size)); + +/* Allocate memory for an internal libpng struct */ +PNG_EXTERN png_voidp png_create_struct PNGARG((int type)); + +/* Free memory from internal libpng struct */ +PNG_EXTERN void png_destroy_struct PNGARG((png_voidp struct_ptr)); + +PNG_EXTERN png_voidp png_create_struct_2 PNGARG((int type, png_malloc_ptr + malloc_fn, png_voidp mem_ptr)); +PNG_EXTERN void png_destroy_struct_2 PNGARG((png_voidp struct_ptr, + png_free_ptr free_fn, png_voidp mem_ptr)); + +/* Free any memory that info_ptr points to and reset struct. */ +PNG_EXTERN void png_info_destroy PNGARG((png_structp png_ptr, + png_infop info_ptr)); + +#ifndef PNG_1_0_X +/* Function to allocate memory for zlib. */ +PNG_EXTERN voidpf png_zalloc PNGARG((voidpf png_ptr, uInt items, uInt size)); + +/* Function to free memory for zlib */ +PNG_EXTERN void png_zfree PNGARG((voidpf png_ptr, voidpf ptr)); + +#ifdef PNG_SIZE_T +/* Function to convert a sizeof an item to png_sizeof item */ + PNG_EXTERN png_size_t PNGAPI png_convert_size PNGARG((size_t size)); +#endif + +/* Next four functions are used internally as callbacks. PNGAPI is required + * but not PNG_EXPORT. PNGAPI added at libpng version 1.2.3. */ + +PNG_EXTERN void PNGAPI png_default_read_data PNGARG((png_structp png_ptr, + png_bytep data, png_size_t length)); + +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +PNG_EXTERN void PNGAPI png_push_fill_buffer PNGARG((png_structp png_ptr, + png_bytep buffer, png_size_t length)); +#endif + +PNG_EXTERN void PNGAPI png_default_write_data PNGARG((png_structp png_ptr, + png_bytep data, png_size_t length)); + +#if defined(PNG_WRITE_FLUSH_SUPPORTED) +#if !defined(PNG_NO_STDIO) +PNG_EXTERN void PNGAPI png_default_flush PNGARG((png_structp png_ptr)); +#endif +#endif +#else /* PNG_1_0_X */ +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +PNG_EXTERN void png_push_fill_buffer PNGARG((png_structp png_ptr, + png_bytep buffer, png_size_t length)); +#endif +#endif /* PNG_1_0_X */ + +/* Reset the CRC variable */ +PNG_EXTERN void png_reset_crc PNGARG((png_structp png_ptr)); + +/* Write the "data" buffer to whatever output you are using. */ +PNG_EXTERN void png_write_data PNGARG((png_structp png_ptr, png_bytep data, + png_size_t length)); + +/* Read data from whatever input you are using into the "data" buffer */ +PNG_EXTERN void png_read_data PNGARG((png_structp png_ptr, png_bytep data, + png_size_t length)); + +/* Read bytes into buf, and update png_ptr->crc */ +PNG_EXTERN void png_crc_read PNGARG((png_structp png_ptr, png_bytep buf, + png_size_t length)); + +/* Decompress data in a chunk that uses compression */ +#if defined(PNG_zTXt_SUPPORTED) || defined(PNG_iTXt_SUPPORTED) || \ + defined(PNG_iCCP_SUPPORTED) || defined(PNG_sPLT_SUPPORTED) +PNG_EXTERN void png_decompress_chunk PNGARG((png_structp png_ptr, + int comp_type, png_size_t chunklength, + png_size_t prefix_length, png_size_t *data_length)); +#endif + +/* Read "skip" bytes, read the file crc, and (optionally) verify png_ptr->crc */ +PNG_EXTERN int png_crc_finish PNGARG((png_structp png_ptr, png_uint_32 skip)); + +/* Read the CRC from the file and compare it to the libpng calculated CRC */ +PNG_EXTERN int png_crc_error PNGARG((png_structp png_ptr)); + +/* Calculate the CRC over a section of data. Note that we are only + * passing a maximum of 64K on systems that have this as a memory limit, + * since this is the maximum buffer size we can specify. + */ +PNG_EXTERN void png_calculate_crc PNGARG((png_structp png_ptr, png_bytep ptr, + png_size_t length)); + +#if defined(PNG_WRITE_FLUSH_SUPPORTED) +PNG_EXTERN void png_flush PNGARG((png_structp png_ptr)); +#endif + +/* simple function to write the signature */ +PNG_EXTERN void png_write_sig PNGARG((png_structp png_ptr)); + +/* write various chunks */ + +/* Write the IHDR chunk, and update the png_struct with the necessary + * information. + */ +PNG_EXTERN void png_write_IHDR PNGARG((png_structp png_ptr, png_uint_32 width, + png_uint_32 height, + int bit_depth, int color_type, int compression_method, int filter_method, + int interlace_method)); + +PNG_EXTERN void png_write_PLTE PNGARG((png_structp png_ptr, png_colorp palette, + png_uint_32 num_pal)); + +PNG_EXTERN void png_write_IDAT PNGARG((png_structp png_ptr, png_bytep data, + png_size_t length)); + +PNG_EXTERN void png_write_IEND PNGARG((png_structp png_ptr)); + +#if defined(PNG_WRITE_gAMA_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +PNG_EXTERN void png_write_gAMA PNGARG((png_structp png_ptr, double file_gamma)); +#endif +#ifdef PNG_FIXED_POINT_SUPPORTED +PNG_EXTERN void png_write_gAMA_fixed PNGARG((png_structp png_ptr, png_fixed_point + file_gamma)); +#endif +#endif + +#if defined(PNG_WRITE_sBIT_SUPPORTED) +PNG_EXTERN void png_write_sBIT PNGARG((png_structp png_ptr, png_color_8p sbit, + int color_type)); +#endif + +#if defined(PNG_WRITE_cHRM_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +PNG_EXTERN void png_write_cHRM PNGARG((png_structp png_ptr, + double white_x, double white_y, + double red_x, double red_y, double green_x, double green_y, + double blue_x, double blue_y)); +#endif +#ifdef PNG_FIXED_POINT_SUPPORTED +PNG_EXTERN void png_write_cHRM_fixed PNGARG((png_structp png_ptr, + png_fixed_point int_white_x, png_fixed_point int_white_y, + png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point + int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, + png_fixed_point int_blue_y)); +#endif +#endif + +#if defined(PNG_WRITE_sRGB_SUPPORTED) +PNG_EXTERN void png_write_sRGB PNGARG((png_structp png_ptr, + int intent)); +#endif + +#if defined(PNG_WRITE_iCCP_SUPPORTED) +PNG_EXTERN void png_write_iCCP PNGARG((png_structp png_ptr, + png_charp name, int compression_type, + png_charp profile, int proflen)); + /* Note to maintainer: profile should be png_bytep */ +#endif + +#if defined(PNG_WRITE_sPLT_SUPPORTED) +PNG_EXTERN void png_write_sPLT PNGARG((png_structp png_ptr, + png_sPLT_tp palette)); +#endif + +#if defined(PNG_WRITE_tRNS_SUPPORTED) +PNG_EXTERN void png_write_tRNS PNGARG((png_structp png_ptr, png_bytep trans, + png_color_16p values, int number, int color_type)); +#endif + +#if defined(PNG_WRITE_bKGD_SUPPORTED) +PNG_EXTERN void png_write_bKGD PNGARG((png_structp png_ptr, + png_color_16p values, int color_type)); +#endif + +#if defined(PNG_WRITE_hIST_SUPPORTED) +PNG_EXTERN void png_write_hIST PNGARG((png_structp png_ptr, png_uint_16p hist, + int num_hist)); +#endif + +#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \ + defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED) +PNG_EXTERN png_size_t png_check_keyword PNGARG((png_structp png_ptr, + png_charp key, png_charpp new_key)); +#endif + +#if defined(PNG_WRITE_tEXt_SUPPORTED) +PNG_EXTERN void png_write_tEXt PNGARG((png_structp png_ptr, png_charp key, + png_charp text, png_size_t text_len)); +#endif + +#if defined(PNG_WRITE_zTXt_SUPPORTED) +PNG_EXTERN void png_write_zTXt PNGARG((png_structp png_ptr, png_charp key, + png_charp text, png_size_t text_len, int compression)); +#endif + +#if defined(PNG_WRITE_iTXt_SUPPORTED) +PNG_EXTERN void png_write_iTXt PNGARG((png_structp png_ptr, + int compression, png_charp key, png_charp lang, png_charp lang_key, + png_charp text)); +#endif + +#if defined(PNG_TEXT_SUPPORTED) /* Added at version 1.0.14 and 1.2.4 */ +PNG_EXTERN int png_set_text_2 PNGARG((png_structp png_ptr, + png_infop info_ptr, png_textp text_ptr, int num_text)); +#endif + +#if defined(PNG_WRITE_oFFs_SUPPORTED) +PNG_EXTERN void png_write_oFFs PNGARG((png_structp png_ptr, + png_int_32 x_offset, png_int_32 y_offset, int unit_type)); +#endif + +#if defined(PNG_WRITE_pCAL_SUPPORTED) +PNG_EXTERN void png_write_pCAL PNGARG((png_structp png_ptr, png_charp purpose, + png_int_32 X0, png_int_32 X1, int type, int nparams, + png_charp units, png_charpp params)); +#endif + +#if defined(PNG_WRITE_pHYs_SUPPORTED) +PNG_EXTERN void png_write_pHYs PNGARG((png_structp png_ptr, + png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit, + int unit_type)); +#endif + +#if defined(PNG_WRITE_tIME_SUPPORTED) +PNG_EXTERN void png_write_tIME PNGARG((png_structp png_ptr, + png_timep mod_time)); +#endif + +#if defined(PNG_WRITE_sCAL_SUPPORTED) +#if defined(PNG_FLOATING_POINT_SUPPORTED) && !defined(PNG_NO_STDIO) +PNG_EXTERN void png_write_sCAL PNGARG((png_structp png_ptr, + int unit, double width, double height)); +#else +#ifdef PNG_FIXED_POINT_SUPPORTED +PNG_EXTERN void png_write_sCAL_s PNGARG((png_structp png_ptr, + int unit, png_charp width, png_charp height)); +#endif +#endif +#endif + +/* Called when finished processing a row of data */ +PNG_EXTERN void png_write_finish_row PNGARG((png_structp png_ptr)); + +/* Internal use only. Called before first row of data */ +PNG_EXTERN void png_write_start_row PNGARG((png_structp png_ptr)); + +#if defined(PNG_READ_GAMMA_SUPPORTED) +PNG_EXTERN void png_build_gamma_table PNGARG((png_structp png_ptr)); +#endif + +/* combine a row of data, dealing with alpha, etc. if requested */ +PNG_EXTERN void png_combine_row PNGARG((png_structp png_ptr, png_bytep row, + int mask)); + +#if defined(PNG_READ_INTERLACING_SUPPORTED) +/* expand an interlaced row */ +/* OLD pre-1.0.9 interface: +PNG_EXTERN void png_do_read_interlace PNGARG((png_row_infop row_info, + png_bytep row, int pass, png_uint_32 transformations)); + */ +PNG_EXTERN void png_do_read_interlace PNGARG((png_structp png_ptr)); +#endif + +/* GRR TO DO (2.0 or whenever): simplify other internal calling interfaces */ + +#if defined(PNG_WRITE_INTERLACING_SUPPORTED) +/* grab pixels out of a row for an interlaced pass */ +PNG_EXTERN void png_do_write_interlace PNGARG((png_row_infop row_info, + png_bytep row, int pass)); +#endif + +/* unfilter a row */ +PNG_EXTERN void png_read_filter_row PNGARG((png_structp png_ptr, + png_row_infop row_info, png_bytep row, png_bytep prev_row, int filter)); + +/* Choose the best filter to use and filter the row data */ +PNG_EXTERN void png_write_find_filter PNGARG((png_structp png_ptr, + png_row_infop row_info)); + +/* Write out the filtered row. */ +PNG_EXTERN void png_write_filtered_row PNGARG((png_structp png_ptr, + png_bytep filtered_row)); +/* finish a row while reading, dealing with interlacing passes, etc. */ +PNG_EXTERN void png_read_finish_row PNGARG((png_structp png_ptr)); + +/* initialize the row buffers, etc. */ +PNG_EXTERN void png_read_start_row PNGARG((png_structp png_ptr)); +/* optional call to update the users info structure */ +PNG_EXTERN void png_read_transform_info PNGARG((png_structp png_ptr, + png_infop info_ptr)); + +/* these are the functions that do the transformations */ +#if defined(PNG_READ_FILLER_SUPPORTED) +PNG_EXTERN void png_do_read_filler PNGARG((png_row_infop row_info, + png_bytep row, png_uint_32 filler, png_uint_32 flags)); +#endif + +#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) +PNG_EXTERN void png_do_read_swap_alpha PNGARG((png_row_infop row_info, + png_bytep row)); +#endif + +#if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) +PNG_EXTERN void png_do_write_swap_alpha PNGARG((png_row_infop row_info, + png_bytep row)); +#endif + +#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) +PNG_EXTERN void png_do_read_invert_alpha PNGARG((png_row_infop row_info, + png_bytep row)); +#endif + +#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) +PNG_EXTERN void png_do_write_invert_alpha PNGARG((png_row_infop row_info, + png_bytep row)); +#endif + +#if defined(PNG_WRITE_FILLER_SUPPORTED) || \ + defined(PNG_READ_STRIP_ALPHA_SUPPORTED) +PNG_EXTERN void png_do_strip_filler PNGARG((png_row_infop row_info, + png_bytep row, png_uint_32 flags)); +#endif + +#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) +PNG_EXTERN void png_do_swap PNGARG((png_row_infop row_info, png_bytep row)); +#endif + +#if defined(PNG_READ_PACKSWAP_SUPPORTED) || defined(PNG_WRITE_PACKSWAP_SUPPORTED) +PNG_EXTERN void png_do_packswap PNGARG((png_row_infop row_info, png_bytep row)); +#endif + +#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) +PNG_EXTERN int png_do_rgb_to_gray PNGARG((png_structp png_ptr, png_row_infop + row_info, png_bytep row)); +#endif + +#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) +PNG_EXTERN void png_do_gray_to_rgb PNGARG((png_row_infop row_info, + png_bytep row)); +#endif + +#if defined(PNG_READ_PACK_SUPPORTED) +PNG_EXTERN void png_do_unpack PNGARG((png_row_infop row_info, png_bytep row)); +#endif + +#if defined(PNG_READ_SHIFT_SUPPORTED) +PNG_EXTERN void png_do_unshift PNGARG((png_row_infop row_info, png_bytep row, + png_color_8p sig_bits)); +#endif + +#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) +PNG_EXTERN void png_do_invert PNGARG((png_row_infop row_info, png_bytep row)); +#endif + +#if defined(PNG_READ_16_TO_8_SUPPORTED) +PNG_EXTERN void png_do_chop PNGARG((png_row_infop row_info, png_bytep row)); +#endif + +#if defined(PNG_READ_DITHER_SUPPORTED) +PNG_EXTERN void png_do_dither PNGARG((png_row_infop row_info, + png_bytep row, png_bytep palette_lookup, png_bytep dither_lookup)); + +# if defined(PNG_CORRECT_PALETTE_SUPPORTED) +PNG_EXTERN void png_correct_palette PNGARG((png_structp png_ptr, + png_colorp palette, int num_palette)); +# endif +#endif + +#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) +PNG_EXTERN void png_do_bgr PNGARG((png_row_infop row_info, png_bytep row)); +#endif + +#if defined(PNG_WRITE_PACK_SUPPORTED) +PNG_EXTERN void png_do_pack PNGARG((png_row_infop row_info, + png_bytep row, png_uint_32 bit_depth)); +#endif + +#if defined(PNG_WRITE_SHIFT_SUPPORTED) +PNG_EXTERN void png_do_shift PNGARG((png_row_infop row_info, png_bytep row, + png_color_8p bit_depth)); +#endif + +#if defined(PNG_READ_BACKGROUND_SUPPORTED) +#if defined(PNG_READ_GAMMA_SUPPORTED) +PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row, + png_color_16p trans_values, png_color_16p background, + png_color_16p background_1, + png_bytep gamma_table, png_bytep gamma_from_1, png_bytep gamma_to_1, + png_uint_16pp gamma_16, png_uint_16pp gamma_16_from_1, + png_uint_16pp gamma_16_to_1, int gamma_shift)); +#else +PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row, + png_color_16p trans_values, png_color_16p background)); +#endif +#endif + +#if defined(PNG_READ_GAMMA_SUPPORTED) +PNG_EXTERN void png_do_gamma PNGARG((png_row_infop row_info, png_bytep row, + png_bytep gamma_table, png_uint_16pp gamma_16_table, + int gamma_shift)); +#endif + +#if defined(PNG_READ_EXPAND_SUPPORTED) +PNG_EXTERN void png_do_expand_palette PNGARG((png_row_infop row_info, + png_bytep row, png_colorp palette, png_bytep trans, int num_trans)); +PNG_EXTERN void png_do_expand PNGARG((png_row_infop row_info, + png_bytep row, png_color_16p trans_value)); +#endif + +/* The following decodes the appropriate chunks, and does error correction, + * then calls the appropriate callback for the chunk if it is valid. + */ + +/* decode the IHDR chunk */ +PNG_EXTERN void png_handle_IHDR PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +PNG_EXTERN void png_handle_PLTE PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +PNG_EXTERN void png_handle_IEND PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); + +#if defined(PNG_READ_bKGD_SUPPORTED) +PNG_EXTERN void png_handle_bKGD PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_cHRM_SUPPORTED) +PNG_EXTERN void png_handle_cHRM PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_gAMA_SUPPORTED) +PNG_EXTERN void png_handle_gAMA PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_hIST_SUPPORTED) +PNG_EXTERN void png_handle_hIST PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_iCCP_SUPPORTED) +extern void png_handle_iCCP PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif /* PNG_READ_iCCP_SUPPORTED */ + +#if defined(PNG_READ_iTXt_SUPPORTED) +PNG_EXTERN void png_handle_iTXt PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_oFFs_SUPPORTED) +PNG_EXTERN void png_handle_oFFs PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_pCAL_SUPPORTED) +PNG_EXTERN void png_handle_pCAL PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_pHYs_SUPPORTED) +PNG_EXTERN void png_handle_pHYs PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_sBIT_SUPPORTED) +PNG_EXTERN void png_handle_sBIT PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_sCAL_SUPPORTED) +PNG_EXTERN void png_handle_sCAL PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_sPLT_SUPPORTED) +extern void png_handle_sPLT PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif /* PNG_READ_sPLT_SUPPORTED */ + +#if defined(PNG_READ_sRGB_SUPPORTED) +PNG_EXTERN void png_handle_sRGB PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_tEXt_SUPPORTED) +PNG_EXTERN void png_handle_tEXt PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_tIME_SUPPORTED) +PNG_EXTERN void png_handle_tIME PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_tRNS_SUPPORTED) +PNG_EXTERN void png_handle_tRNS PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_zTXt_SUPPORTED) +PNG_EXTERN void png_handle_zTXt PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 length)); + +PNG_EXTERN void png_check_chunk_name PNGARG((png_structp png_ptr, + png_bytep chunk_name)); + +/* handle the transformations for reading and writing */ +PNG_EXTERN void png_do_read_transformations PNGARG((png_structp png_ptr)); +PNG_EXTERN void png_do_write_transformations PNGARG((png_structp png_ptr)); + +PNG_EXTERN void png_init_read_transformations PNGARG((png_structp png_ptr)); + +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +PNG_EXTERN void png_push_read_chunk PNGARG((png_structp png_ptr, + png_infop info_ptr)); +PNG_EXTERN void png_push_read_sig PNGARG((png_structp png_ptr, + png_infop info_ptr)); +PNG_EXTERN void png_push_check_crc PNGARG((png_structp png_ptr)); +PNG_EXTERN void png_push_crc_skip PNGARG((png_structp png_ptr, + png_uint_32 length)); +PNG_EXTERN void png_push_crc_finish PNGARG((png_structp png_ptr)); +PNG_EXTERN void png_push_save_buffer PNGARG((png_structp png_ptr)); +PNG_EXTERN void png_push_restore_buffer PNGARG((png_structp png_ptr, + png_bytep buffer, png_size_t buffer_length)); +PNG_EXTERN void png_push_read_IDAT PNGARG((png_structp png_ptr)); +PNG_EXTERN void png_process_IDAT_data PNGARG((png_structp png_ptr, + png_bytep buffer, png_size_t buffer_length)); +PNG_EXTERN void png_push_process_row PNGARG((png_structp png_ptr)); +PNG_EXTERN void png_push_handle_unknown PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 length)); +PNG_EXTERN void png_push_have_info PNGARG((png_structp png_ptr, + png_infop info_ptr)); +PNG_EXTERN void png_push_have_end PNGARG((png_structp png_ptr, + png_infop info_ptr)); +PNG_EXTERN void png_push_have_row PNGARG((png_structp png_ptr, png_bytep row)); +PNG_EXTERN void png_push_read_end PNGARG((png_structp png_ptr, + png_infop info_ptr)); +PNG_EXTERN void png_process_some_data PNGARG((png_structp png_ptr, + png_infop info_ptr)); +PNG_EXTERN void png_read_push_finish_row PNGARG((png_structp png_ptr)); +#if defined(PNG_READ_tEXt_SUPPORTED) +PNG_EXTERN void png_push_handle_tEXt PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 length)); +PNG_EXTERN void png_push_read_tEXt PNGARG((png_structp png_ptr, + png_infop info_ptr)); +#endif +#if defined(PNG_READ_zTXt_SUPPORTED) +PNG_EXTERN void png_push_handle_zTXt PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 length)); +PNG_EXTERN void png_push_read_zTXt PNGARG((png_structp png_ptr, + png_infop info_ptr)); +#endif +#if defined(PNG_READ_iTXt_SUPPORTED) +PNG_EXTERN void png_push_handle_iTXt PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 length)); +PNG_EXTERN void png_push_read_iTXt PNGARG((png_structp png_ptr, + png_infop info_ptr)); +#endif + +#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ + +#ifdef PNG_MNG_FEATURES_SUPPORTED +PNG_EXTERN void png_do_read_intrapixel PNGARG((png_row_infop row_info, + png_bytep row)); +PNG_EXTERN void png_do_write_intrapixel PNGARG((png_row_infop row_info, + png_bytep row)); +#endif + +#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) +#if defined(PNG_MMX_CODE_SUPPORTED) +/* png.c */ /* PRIVATE */ +PNG_EXTERN void png_init_mmx_flags PNGARG((png_structp png_ptr)); +#endif +#endif + +#if defined(PNG_INCH_CONVERSIONS) && defined(PNG_FLOATING_POINT_SUPPORTED) +PNG_EXTERN png_uint_32 png_get_pixels_per_inch PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +PNG_EXTERN png_uint_32 png_get_x_pixels_per_inch PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +PNG_EXTERN png_uint_32 png_get_y_pixels_per_inch PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +PNG_EXTERN float png_get_x_offset_inches PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +PNG_EXTERN float png_get_y_offset_inches PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +#if defined(PNG_pHYs_SUPPORTED) +PNG_EXTERN png_uint_32 png_get_pHYs_dpi PNGARG((png_structp png_ptr, +png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); +#endif /* PNG_pHYs_SUPPORTED */ +#endif /* PNG_INCH_CONVERSIONS && PNG_FLOATING_POINT_SUPPORTED */ + +/* Read the chunk header (length + type name) */ +PNG_EXTERN png_uint_32 png_read_chunk_header PNGARG((png_structp png_ptr)); + +/* Added at libpng version 1.2.34 */ +#if defined(PNG_cHRM_SUPPORTED) +PNG_EXTERN int png_check_cHRM_fixed PNGARG((png_structp png_ptr, + png_fixed_point int_white_x, png_fixed_point int_white_y, + png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point + int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, + png_fixed_point int_blue_y)); +#endif + +/* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */ + +#endif /* PNG_INTERNAL */ + +#ifdef __cplusplus +} +#endif + +#endif /* PNG_VERSION_INFO_ONLY */ +/* do not put anything past this line */ +#endif /* PNG_H */ diff --git a/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/include/pngconf.h b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/include/pngconf.h new file mode 100644 index 0000000000..025368db67 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/include/pngconf.h @@ -0,0 +1,1496 @@ + +/* pngconf.h - machine configurable file for libpng + * + * libpng version 1.2.37 - June 4, 2009 + * For conditions of distribution and use, see copyright notice in png.h + * Copyright (c) 1998-2009 Glenn Randers-Pehrson + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + */ + +/* Any machine specific code is near the front of this file, so if you + * are configuring libpng for a machine, you may want to read the section + * starting here down to where it starts to typedef png_color, png_text, + * and png_info. + */ + +#ifndef PNGCONF_H +#define PNGCONF_H + +#define PNG_1_2_X + +/* + * PNG_USER_CONFIG has to be defined on the compiler command line. This + * includes the resource compiler for Windows DLL configurations. + */ +#ifdef PNG_USER_CONFIG +# ifndef PNG_USER_PRIVATEBUILD +# define PNG_USER_PRIVATEBUILD +# endif +#include "pngusr.h" +#endif + +/* PNG_CONFIGURE_LIBPNG is set by the "configure" script. */ +#ifdef PNG_CONFIGURE_LIBPNG +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#endif + +/* + * Added at libpng-1.2.8 + * + * If you create a private DLL you need to define in "pngusr.h" the followings: + * #define PNG_USER_PRIVATEBUILD <Describes by whom and why this version of + * the DLL was built> + * e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons." + * #define PNG_USER_DLLFNAME_POSTFIX <two-letter postfix that serve to + * distinguish your DLL from those of the official release. These + * correspond to the trailing letters that come after the version + * number and must match your private DLL name> + * e.g. // private DLL "libpng13gx.dll" + * #define PNG_USER_DLLFNAME_POSTFIX "gx" + * + * The following macros are also at your disposal if you want to complete the + * DLL VERSIONINFO structure. + * - PNG_USER_VERSIONINFO_COMMENTS + * - PNG_USER_VERSIONINFO_COMPANYNAME + * - PNG_USER_VERSIONINFO_LEGALTRADEMARKS + */ + +#ifdef __STDC__ +#ifdef SPECIALBUILD +# pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\ + are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.") +#endif + +#ifdef PRIVATEBUILD +# pragma message("PRIVATEBUILD is deprecated.\ + Use PNG_USER_PRIVATEBUILD instead.") +# define PNG_USER_PRIVATEBUILD PRIVATEBUILD +#endif +#endif /* __STDC__ */ + +#ifndef PNG_VERSION_INFO_ONLY + +/* End of material added to libpng-1.2.8 */ + +/* Added at libpng-1.2.19, removed at libpng-1.2.20 because it caused trouble + Restored at libpng-1.2.21 */ +#if !defined(PNG_NO_WARN_UNINITIALIZED_ROW) && \ + !defined(PNG_WARN_UNINITIALIZED_ROW) +# define PNG_WARN_UNINITIALIZED_ROW 1 +#endif +/* End of material added at libpng-1.2.19/1.2.21 */ + +/* This is the size of the compression buffer, and thus the size of + * an IDAT chunk. Make this whatever size you feel is best for your + * machine. One of these will be allocated per png_struct. When this + * is full, it writes the data to the disk, and does some other + * calculations. Making this an extremely small size will slow + * the library down, but you may want to experiment to determine + * where it becomes significant, if you are concerned with memory + * usage. Note that zlib allocates at least 32Kb also. For readers, + * this describes the size of the buffer available to read the data in. + * Unless this gets smaller than the size of a row (compressed), + * it should not make much difference how big this is. + */ + +#ifndef PNG_ZBUF_SIZE +# define PNG_ZBUF_SIZE 8192 +#endif + +/* Enable if you want a write-only libpng */ + +#ifndef PNG_NO_READ_SUPPORTED +# define PNG_READ_SUPPORTED +#endif + +/* Enable if you want a read-only libpng */ + +#ifndef PNG_NO_WRITE_SUPPORTED +# define PNG_WRITE_SUPPORTED +#endif + +/* Enabled by default in 1.2.0. You can disable this if you don't need to + support PNGs that are embedded in MNG datastreams */ +#if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES) +# ifndef PNG_MNG_FEATURES_SUPPORTED +# define PNG_MNG_FEATURES_SUPPORTED +# endif +#endif + +#ifndef PNG_NO_FLOATING_POINT_SUPPORTED +# ifndef PNG_FLOATING_POINT_SUPPORTED +# define PNG_FLOATING_POINT_SUPPORTED +# endif +#endif + +/* If you are running on a machine where you cannot allocate more + * than 64K of memory at once, uncomment this. While libpng will not + * normally need that much memory in a chunk (unless you load up a very + * large file), zlib needs to know how big of a chunk it can use, and + * libpng thus makes sure to check any memory allocation to verify it + * will fit into memory. +#define PNG_MAX_MALLOC_64K + */ +#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) +# define PNG_MAX_MALLOC_64K +#endif + +/* Special munging to support doing things the 'cygwin' way: + * 'Normal' png-on-win32 defines/defaults: + * PNG_BUILD_DLL -- building dll + * PNG_USE_DLL -- building an application, linking to dll + * (no define) -- building static library, or building an + * application and linking to the static lib + * 'Cygwin' defines/defaults: + * PNG_BUILD_DLL -- (ignored) building the dll + * (no define) -- (ignored) building an application, linking to the dll + * PNG_STATIC -- (ignored) building the static lib, or building an + * application that links to the static lib. + * ALL_STATIC -- (ignored) building various static libs, or building an + * application that links to the static libs. + * Thus, + * a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and + * this bit of #ifdefs will define the 'correct' config variables based on + * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but + * unnecessary. + * + * Also, the precedence order is: + * ALL_STATIC (since we can't #undef something outside our namespace) + * PNG_BUILD_DLL + * PNG_STATIC + * (nothing) == PNG_USE_DLL + * + * CYGWIN (2002-01-20): The preceding is now obsolete. With the advent + * of auto-import in binutils, we no longer need to worry about + * __declspec(dllexport) / __declspec(dllimport) and friends. Therefore, + * we don't need to worry about PNG_STATIC or ALL_STATIC when it comes + * to __declspec() stuff. However, we DO need to worry about + * PNG_BUILD_DLL and PNG_STATIC because those change some defaults + * such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed. + */ +#if defined(__CYGWIN__) +# if defined(ALL_STATIC) +# if defined(PNG_BUILD_DLL) +# undef PNG_BUILD_DLL +# endif +# if defined(PNG_USE_DLL) +# undef PNG_USE_DLL +# endif +# if defined(PNG_DLL) +# undef PNG_DLL +# endif +# if !defined(PNG_STATIC) +# define PNG_STATIC +# endif +# else +# if defined (PNG_BUILD_DLL) +# if defined(PNG_STATIC) +# undef PNG_STATIC +# endif +# if defined(PNG_USE_DLL) +# undef PNG_USE_DLL +# endif +# if !defined(PNG_DLL) +# define PNG_DLL +# endif +# else +# if defined(PNG_STATIC) +# if defined(PNG_USE_DLL) +# undef PNG_USE_DLL +# endif +# if defined(PNG_DLL) +# undef PNG_DLL +# endif +# else +# if !defined(PNG_USE_DLL) +# define PNG_USE_DLL +# endif +# if !defined(PNG_DLL) +# define PNG_DLL +# endif +# endif +# endif +# endif +#endif + +/* This protects us against compilers that run on a windowing system + * and thus don't have or would rather us not use the stdio types: + * stdin, stdout, and stderr. The only one currently used is stderr + * in png_error() and png_warning(). #defining PNG_NO_CONSOLE_IO will + * prevent these from being compiled and used. #defining PNG_NO_STDIO + * will also prevent these, plus will prevent the entire set of stdio + * macros and functions (FILE *, printf, etc.) from being compiled and used, + * unless (PNG_DEBUG > 0) has been #defined. + * + * #define PNG_NO_CONSOLE_IO + * #define PNG_NO_STDIO + */ + +#if defined(_WIN32_WCE) +# include <windows.h> + /* Console I/O functions are not supported on WindowsCE */ +# define PNG_NO_CONSOLE_IO + /* abort() may not be supported on some/all Windows CE platforms */ +# define PNG_ABORT() exit(-1) +# ifdef PNG_DEBUG +# undef PNG_DEBUG +# endif +#endif + +#ifdef PNG_BUILD_DLL +# ifndef PNG_CONSOLE_IO_SUPPORTED +# ifndef PNG_NO_CONSOLE_IO +# define PNG_NO_CONSOLE_IO +# endif +# endif +#endif + +# ifdef PNG_NO_STDIO +# ifndef PNG_NO_CONSOLE_IO +# define PNG_NO_CONSOLE_IO +# endif +# ifdef PNG_DEBUG +# if (PNG_DEBUG > 0) +# include <stdio.h> +# endif +# endif +# else +# if !defined(_WIN32_WCE) +/* "stdio.h" functions are not supported on WindowsCE */ +# include <stdio.h> +# endif +# endif + +/* This macro protects us against machines that don't have function + * prototypes (ie K&R style headers). If your compiler does not handle + * function prototypes, define this macro and use the included ansi2knr. + * I've always been able to use _NO_PROTO as the indicator, but you may + * need to drag the empty declaration out in front of here, or change the + * ifdef to suit your own needs. + */ +#ifndef PNGARG + +#ifdef OF /* zlib prototype munger */ +# define PNGARG(arglist) OF(arglist) +#else + +#ifdef _NO_PROTO +# define PNGARG(arglist) () +# ifndef PNG_TYPECAST_NULL +# define PNG_TYPECAST_NULL +# endif +#else +# define PNGARG(arglist) arglist +#endif /* _NO_PROTO */ + + +#endif /* OF */ + +#endif /* PNGARG */ + +/* Try to determine if we are compiling on a Mac. Note that testing for + * just __MWERKS__ is not good enough, because the Codewarrior is now used + * on non-Mac platforms. + */ +#ifndef MACOS +# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ + defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) +# define MACOS +# endif +#endif + +/* enough people need this for various reasons to include it here */ +#if !defined(MACOS) && !defined(RISCOS) && !defined(_WIN32_WCE) +# include <sys/types.h> +#endif + +#if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED) +# define PNG_SETJMP_SUPPORTED +#endif + +#ifdef PNG_SETJMP_SUPPORTED +/* This is an attempt to force a single setjmp behaviour on Linux. If + * the X config stuff didn't define _BSD_SOURCE we wouldn't need this. + * + * You can bypass this test if you know that your application uses exactly + * the same setjmp.h that was included when libpng was built. Only define + * PNG_SKIP_SETJMP_CHECK while building your application, prior to the + * application's '#include "png.h"'. Don't define PNG_SKIP_SETJMP_CHECK + * while building a separate libpng library for general use. + */ + +# ifndef PNG_SKIP_SETJMP_CHECK +# ifdef __linux__ +# ifdef _BSD_SOURCE +# define PNG_SAVE_BSD_SOURCE +# undef _BSD_SOURCE +# endif +# ifdef _SETJMP_H + /* If you encounter a compiler error here, see the explanation + * near the end of INSTALL. + */ + __pngconf.h__ in libpng already includes setjmp.h; + __dont__ include it again.; +# endif +# endif /* __linux__ */ +# endif /* PNG_SKIP_SETJMP_CHECK */ + + /* include setjmp.h for error handling */ +# include <setjmp.h> + +# ifdef __linux__ +# ifdef PNG_SAVE_BSD_SOURCE +# ifndef _BSD_SOURCE +# define _BSD_SOURCE +# endif +# undef PNG_SAVE_BSD_SOURCE +# endif +# endif /* __linux__ */ +#endif /* PNG_SETJMP_SUPPORTED */ + +#ifdef BSD +# include <strings.h> +#else +# include <string.h> +#endif + +/* Other defines for things like memory and the like can go here. */ +#ifdef PNG_INTERNAL + +#include <stdlib.h> + +/* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which + * aren't usually used outside the library (as far as I know), so it is + * debatable if they should be exported at all. In the future, when it is + * possible to have run-time registry of chunk-handling functions, some of + * these will be made available again. +#define PNG_EXTERN extern + */ +#define PNG_EXTERN + +/* Other defines specific to compilers can go here. Try to keep + * them inside an appropriate ifdef/endif pair for portability. + */ + +#if defined(PNG_FLOATING_POINT_SUPPORTED) +# if defined(MACOS) + /* We need to check that <math.h> hasn't already been included earlier + * as it seems it doesn't agree with <fp.h>, yet we should really use + * <fp.h> if possible. + */ +# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__) +# include <fp.h> +# endif +# else +# include <math.h> +# endif +# if defined(_AMIGA) && defined(__SASC) && defined(_M68881) + /* Amiga SAS/C: We must include builtin FPU functions when compiling using + * MATH=68881 + */ +# include <m68881.h> +# endif +#endif + +/* Codewarrior on NT has linking problems without this. */ +#if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__) +# define PNG_ALWAYS_EXTERN +#endif + +/* This provides the non-ANSI (far) memory allocation routines. */ +#if defined(__TURBOC__) && defined(__MSDOS__) +# include <mem.h> +# include <alloc.h> +#endif + +/* I have no idea why is this necessary... */ +#if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \ + defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__)) +# include <malloc.h> +#endif + +/* This controls how fine the dithering gets. As this allocates + * a largish chunk of memory (32K), those who are not as concerned + * with dithering quality can decrease some or all of these. + */ +#ifndef PNG_DITHER_RED_BITS +# define PNG_DITHER_RED_BITS 5 +#endif +#ifndef PNG_DITHER_GREEN_BITS +# define PNG_DITHER_GREEN_BITS 5 +#endif +#ifndef PNG_DITHER_BLUE_BITS +# define PNG_DITHER_BLUE_BITS 5 +#endif + +/* This controls how fine the gamma correction becomes when you + * are only interested in 8 bits anyway. Increasing this value + * results in more memory being used, and more pow() functions + * being called to fill in the gamma tables. Don't set this value + * less then 8, and even that may not work (I haven't tested it). + */ + +#ifndef PNG_MAX_GAMMA_8 +# define PNG_MAX_GAMMA_8 11 +#endif + +/* This controls how much a difference in gamma we can tolerate before + * we actually start doing gamma conversion. + */ +#ifndef PNG_GAMMA_THRESHOLD +# define PNG_GAMMA_THRESHOLD 0.05 +#endif + +#endif /* PNG_INTERNAL */ + +/* The following uses const char * instead of char * for error + * and warning message functions, so some compilers won't complain. + * If you do not want to use const, define PNG_NO_CONST here. + */ + +#ifndef PNG_NO_CONST +# define PNG_CONST const +#else +# define PNG_CONST +#endif + +/* The following defines give you the ability to remove code from the + * library that you will not be using. I wish I could figure out how to + * automate this, but I can't do that without making it seriously hard + * on the users. So if you are not using an ability, change the #define + * to and #undef, and that part of the library will not be compiled. If + * your linker can't find a function, you may want to make sure the + * ability is defined here. Some of these depend upon some others being + * defined. I haven't figured out all the interactions here, so you may + * have to experiment awhile to get everything to compile. If you are + * creating or using a shared library, you probably shouldn't touch this, + * as it will affect the size of the structures, and this will cause bad + * things to happen if the library and/or application ever change. + */ + +/* Any features you will not be using can be undef'ed here */ + +/* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user + * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS + * on the compile line, then pick and choose which ones to define without + * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED + * if you only want to have a png-compliant reader/writer but don't need + * any of the extra transformations. This saves about 80 kbytes in a + * typical installation of the library. (PNG_NO_* form added in version + * 1.0.1c, for consistency) + */ + +/* The size of the png_text structure changed in libpng-1.0.6 when + * iTXt support was added. iTXt support was turned off by default through + * libpng-1.2.x, to support old apps that malloc the png_text structure + * instead of calling png_set_text() and letting libpng malloc it. It + * was turned on by default in libpng-1.3.0. + */ + +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +# ifndef PNG_NO_iTXt_SUPPORTED +# define PNG_NO_iTXt_SUPPORTED +# endif +# ifndef PNG_NO_READ_iTXt +# define PNG_NO_READ_iTXt +# endif +# ifndef PNG_NO_WRITE_iTXt +# define PNG_NO_WRITE_iTXt +# endif +#endif + +#if !defined(PNG_NO_iTXt_SUPPORTED) +# if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt) +# define PNG_READ_iTXt +# endif +# if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt) +# define PNG_WRITE_iTXt +# endif +#endif + +/* The following support, added after version 1.0.0, can be turned off here en + * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility + * with old applications that require the length of png_struct and png_info + * to remain unchanged. + */ + +#ifdef PNG_LEGACY_SUPPORTED +# define PNG_NO_FREE_ME +# define PNG_NO_READ_UNKNOWN_CHUNKS +# define PNG_NO_WRITE_UNKNOWN_CHUNKS +# define PNG_NO_READ_USER_CHUNKS +# define PNG_NO_READ_iCCP +# define PNG_NO_WRITE_iCCP +# define PNG_NO_READ_iTXt +# define PNG_NO_WRITE_iTXt +# define PNG_NO_READ_sCAL +# define PNG_NO_WRITE_sCAL +# define PNG_NO_READ_sPLT +# define PNG_NO_WRITE_sPLT +# define PNG_NO_INFO_IMAGE +# define PNG_NO_READ_RGB_TO_GRAY +# define PNG_NO_READ_USER_TRANSFORM +# define PNG_NO_WRITE_USER_TRANSFORM +# define PNG_NO_USER_MEM +# define PNG_NO_READ_EMPTY_PLTE +# define PNG_NO_MNG_FEATURES +# define PNG_NO_FIXED_POINT_SUPPORTED +#endif + +/* Ignore attempt to turn off both floating and fixed point support */ +#if !defined(PNG_FLOATING_POINT_SUPPORTED) || \ + !defined(PNG_NO_FIXED_POINT_SUPPORTED) +# define PNG_FIXED_POINT_SUPPORTED +#endif + +#ifndef PNG_NO_FREE_ME +# define PNG_FREE_ME_SUPPORTED +#endif + +#if defined(PNG_READ_SUPPORTED) + +#if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \ + !defined(PNG_NO_READ_TRANSFORMS) +# define PNG_READ_TRANSFORMS_SUPPORTED +#endif + +#ifdef PNG_READ_TRANSFORMS_SUPPORTED +# ifndef PNG_NO_READ_EXPAND +# define PNG_READ_EXPAND_SUPPORTED +# endif +# ifndef PNG_NO_READ_SHIFT +# define PNG_READ_SHIFT_SUPPORTED +# endif +# ifndef PNG_NO_READ_PACK +# define PNG_READ_PACK_SUPPORTED +# endif +# ifndef PNG_NO_READ_BGR +# define PNG_READ_BGR_SUPPORTED +# endif +# ifndef PNG_NO_READ_SWAP +# define PNG_READ_SWAP_SUPPORTED +# endif +# ifndef PNG_NO_READ_PACKSWAP +# define PNG_READ_PACKSWAP_SUPPORTED +# endif +# ifndef PNG_NO_READ_INVERT +# define PNG_READ_INVERT_SUPPORTED +# endif +# ifndef PNG_NO_READ_DITHER +# define PNG_READ_DITHER_SUPPORTED +# endif +# ifndef PNG_NO_READ_BACKGROUND +# define PNG_READ_BACKGROUND_SUPPORTED +# endif +# ifndef PNG_NO_READ_16_TO_8 +# define PNG_READ_16_TO_8_SUPPORTED +# endif +# ifndef PNG_NO_READ_FILLER +# define PNG_READ_FILLER_SUPPORTED +# endif +# ifndef PNG_NO_READ_GAMMA +# define PNG_READ_GAMMA_SUPPORTED +# endif +# ifndef PNG_NO_READ_GRAY_TO_RGB +# define PNG_READ_GRAY_TO_RGB_SUPPORTED +# endif +# ifndef PNG_NO_READ_SWAP_ALPHA +# define PNG_READ_SWAP_ALPHA_SUPPORTED +# endif +# ifndef PNG_NO_READ_INVERT_ALPHA +# define PNG_READ_INVERT_ALPHA_SUPPORTED +# endif +# ifndef PNG_NO_READ_STRIP_ALPHA +# define PNG_READ_STRIP_ALPHA_SUPPORTED +# endif +# ifndef PNG_NO_READ_USER_TRANSFORM +# define PNG_READ_USER_TRANSFORM_SUPPORTED +# endif +# ifndef PNG_NO_READ_RGB_TO_GRAY +# define PNG_READ_RGB_TO_GRAY_SUPPORTED +# endif +#endif /* PNG_READ_TRANSFORMS_SUPPORTED */ + +#if !defined(PNG_NO_PROGRESSIVE_READ) && \ + !defined(PNG_PROGRESSIVE_READ_SUPPORTED) /* if you don't do progressive */ +# define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */ +#endif /* about interlacing capability! You'll */ + /* still have interlacing unless you change the following line: */ + +#define PNG_READ_INTERLACING_SUPPORTED /* required in PNG-compliant decoders */ + +#ifndef PNG_NO_READ_COMPOSITE_NODIV +# ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */ +# define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */ +# endif +#endif + +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +/* Deprecated, will be removed from version 2.0.0. + Use PNG_MNG_FEATURES_SUPPORTED instead. */ +#ifndef PNG_NO_READ_EMPTY_PLTE +# define PNG_READ_EMPTY_PLTE_SUPPORTED +#endif +#endif + +#endif /* PNG_READ_SUPPORTED */ + +#if defined(PNG_WRITE_SUPPORTED) + +# if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \ + !defined(PNG_NO_WRITE_TRANSFORMS) +# define PNG_WRITE_TRANSFORMS_SUPPORTED +#endif + +#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED +# ifndef PNG_NO_WRITE_SHIFT +# define PNG_WRITE_SHIFT_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_PACK +# define PNG_WRITE_PACK_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_BGR +# define PNG_WRITE_BGR_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_SWAP +# define PNG_WRITE_SWAP_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_PACKSWAP +# define PNG_WRITE_PACKSWAP_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_INVERT +# define PNG_WRITE_INVERT_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_FILLER +# define PNG_WRITE_FILLER_SUPPORTED /* same as WRITE_STRIP_ALPHA */ +# endif +# ifndef PNG_NO_WRITE_SWAP_ALPHA +# define PNG_WRITE_SWAP_ALPHA_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_INVERT_ALPHA +# define PNG_WRITE_INVERT_ALPHA_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_USER_TRANSFORM +# define PNG_WRITE_USER_TRANSFORM_SUPPORTED +# endif +#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */ + +#if !defined(PNG_NO_WRITE_INTERLACING_SUPPORTED) && \ + !defined(PNG_WRITE_INTERLACING_SUPPORTED) +#define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant + encoders, but can cause trouble + if left undefined */ +#endif + +#if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \ + !defined(PNG_WRITE_WEIGHTED_FILTER) && \ + defined(PNG_FLOATING_POINT_SUPPORTED) +# define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED +#endif + +#ifndef PNG_NO_WRITE_FLUSH +# define PNG_WRITE_FLUSH_SUPPORTED +#endif + +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +/* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */ +#ifndef PNG_NO_WRITE_EMPTY_PLTE +# define PNG_WRITE_EMPTY_PLTE_SUPPORTED +#endif +#endif + +#endif /* PNG_WRITE_SUPPORTED */ + +#ifndef PNG_1_0_X +# ifndef PNG_NO_ERROR_NUMBERS +# define PNG_ERROR_NUMBERS_SUPPORTED +# endif +#endif /* PNG_1_0_X */ + +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) +# ifndef PNG_NO_USER_TRANSFORM_PTR +# define PNG_USER_TRANSFORM_PTR_SUPPORTED +# endif +#endif + +#ifndef PNG_NO_STDIO +# define PNG_TIME_RFC1123_SUPPORTED +#endif + +/* This adds extra functions in pngget.c for accessing data from the + * info pointer (added in version 0.99) + * png_get_image_width() + * png_get_image_height() + * png_get_bit_depth() + * png_get_color_type() + * png_get_compression_type() + * png_get_filter_type() + * png_get_interlace_type() + * png_get_pixel_aspect_ratio() + * png_get_pixels_per_meter() + * png_get_x_offset_pixels() + * png_get_y_offset_pixels() + * png_get_x_offset_microns() + * png_get_y_offset_microns() + */ +#if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED) +# define PNG_EASY_ACCESS_SUPPORTED +#endif + +/* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0 + * and removed from version 1.2.20. The following will be removed + * from libpng-1.4.0 +*/ + +#if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_OPTIMIZED_CODE) +# ifndef PNG_OPTIMIZED_CODE_SUPPORTED +# define PNG_OPTIMIZED_CODE_SUPPORTED +# endif +#endif + +#if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE) && defined(__i386__) +# ifndef PNG_ASSEMBLER_CODE_SUPPORTED +# define PNG_ASSEMBLER_CODE_SUPPORTED +# endif + +# if defined(__GNUC__) && defined(__x86_64__) && (__GNUC__ < 4) + /* work around 64-bit gcc compiler bugs in gcc-3.x */ +# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) +# define PNG_NO_MMX_CODE +# endif +# endif + +# if defined(__APPLE__) +# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) +# define PNG_NO_MMX_CODE +# endif +# endif + +# if (defined(__MWERKS__) && ((__MWERKS__ < 0x0900) || macintosh)) +# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) +# define PNG_NO_MMX_CODE +# endif +# endif + +# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) +# define PNG_MMX_CODE_SUPPORTED +# endif + +#endif +/* end of obsolete code to be removed from libpng-1.4.0 */ + +#if !defined(PNG_1_0_X) +#if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED) +# define PNG_USER_MEM_SUPPORTED +#endif +#endif /* PNG_1_0_X */ + +/* Added at libpng-1.2.6 */ +#if !defined(PNG_1_0_X) +#ifndef PNG_SET_USER_LIMITS_SUPPORTED +#if !defined(PNG_NO_SET_USER_LIMITS) && !defined(PNG_SET_USER_LIMITS_SUPPORTED) +# define PNG_SET_USER_LIMITS_SUPPORTED +#endif +#endif +#endif /* PNG_1_0_X */ + +/* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGS no matter + * how large, set these limits to 0x7fffffffL + */ +#ifndef PNG_USER_WIDTH_MAX +# define PNG_USER_WIDTH_MAX 1000000L +#endif +#ifndef PNG_USER_HEIGHT_MAX +# define PNG_USER_HEIGHT_MAX 1000000L +#endif + +/* Added at libpng-1.2.34 and 1.4.0 */ +#ifndef PNG_STRING_NEWLINE +#define PNG_STRING_NEWLINE "\n" +#endif + +/* These are currently experimental features, define them if you want */ + +/* very little testing */ +/* +#ifdef PNG_READ_SUPPORTED +# ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED +# define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED +# endif +#endif +*/ + +/* This is only for PowerPC big-endian and 680x0 systems */ +/* some testing */ +/* +#ifndef PNG_READ_BIG_ENDIAN_SUPPORTED +# define PNG_READ_BIG_ENDIAN_SUPPORTED +#endif +*/ + +/* Buggy compilers (e.g., gcc 2.7.2.2) need this */ +/* +#define PNG_NO_POINTER_INDEXING +*/ + +/* These functions are turned off by default, as they will be phased out. */ +/* +#define PNG_USELESS_TESTS_SUPPORTED +#define PNG_CORRECT_PALETTE_SUPPORTED +*/ + +/* Any chunks you are not interested in, you can undef here. The + * ones that allocate memory may be expecially important (hIST, + * tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info + * a bit smaller. + */ + +#if defined(PNG_READ_SUPPORTED) && \ + !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ + !defined(PNG_NO_READ_ANCILLARY_CHUNKS) +# define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED +#endif + +#if defined(PNG_WRITE_SUPPORTED) && \ + !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ + !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS) +# define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED +#endif + +#ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED + +#ifdef PNG_NO_READ_TEXT +# define PNG_NO_READ_iTXt +# define PNG_NO_READ_tEXt +# define PNG_NO_READ_zTXt +#endif +#ifndef PNG_NO_READ_bKGD +# define PNG_READ_bKGD_SUPPORTED +# define PNG_bKGD_SUPPORTED +#endif +#ifndef PNG_NO_READ_cHRM +# define PNG_READ_cHRM_SUPPORTED +# define PNG_cHRM_SUPPORTED +#endif +#ifndef PNG_NO_READ_gAMA +# define PNG_READ_gAMA_SUPPORTED +# define PNG_gAMA_SUPPORTED +#endif +#ifndef PNG_NO_READ_hIST +# define PNG_READ_hIST_SUPPORTED +# define PNG_hIST_SUPPORTED +#endif +#ifndef PNG_NO_READ_iCCP +# define PNG_READ_iCCP_SUPPORTED +# define PNG_iCCP_SUPPORTED +#endif +#ifndef PNG_NO_READ_iTXt +# ifndef PNG_READ_iTXt_SUPPORTED +# define PNG_READ_iTXt_SUPPORTED +# endif +# ifndef PNG_iTXt_SUPPORTED +# define PNG_iTXt_SUPPORTED +# endif +#endif +#ifndef PNG_NO_READ_oFFs +# define PNG_READ_oFFs_SUPPORTED +# define PNG_oFFs_SUPPORTED +#endif +#ifndef PNG_NO_READ_pCAL +# define PNG_READ_pCAL_SUPPORTED +# define PNG_pCAL_SUPPORTED +#endif +#ifndef PNG_NO_READ_sCAL +# define PNG_READ_sCAL_SUPPORTED +# define PNG_sCAL_SUPPORTED +#endif +#ifndef PNG_NO_READ_pHYs +# define PNG_READ_pHYs_SUPPORTED +# define PNG_pHYs_SUPPORTED +#endif +#ifndef PNG_NO_READ_sBIT +# define PNG_READ_sBIT_SUPPORTED +# define PNG_sBIT_SUPPORTED +#endif +#ifndef PNG_NO_READ_sPLT +# define PNG_READ_sPLT_SUPPORTED +# define PNG_sPLT_SUPPORTED +#endif +#ifndef PNG_NO_READ_sRGB +# define PNG_READ_sRGB_SUPPORTED +# define PNG_sRGB_SUPPORTED +#endif +#ifndef PNG_NO_READ_tEXt +# define PNG_READ_tEXt_SUPPORTED +# define PNG_tEXt_SUPPORTED +#endif +#ifndef PNG_NO_READ_tIME +# define PNG_READ_tIME_SUPPORTED +# define PNG_tIME_SUPPORTED +#endif +#ifndef PNG_NO_READ_tRNS +# define PNG_READ_tRNS_SUPPORTED +# define PNG_tRNS_SUPPORTED +#endif +#ifndef PNG_NO_READ_zTXt +# define PNG_READ_zTXt_SUPPORTED +# define PNG_zTXt_SUPPORTED +#endif +#ifndef PNG_NO_READ_UNKNOWN_CHUNKS +# define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED +# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED +# define PNG_UNKNOWN_CHUNKS_SUPPORTED +# endif +# ifndef PNG_NO_HANDLE_AS_UNKNOWN +# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED +# endif +#endif +#if !defined(PNG_NO_READ_USER_CHUNKS) && \ + defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) +# define PNG_READ_USER_CHUNKS_SUPPORTED +# define PNG_USER_CHUNKS_SUPPORTED +# ifdef PNG_NO_READ_UNKNOWN_CHUNKS +# undef PNG_NO_READ_UNKNOWN_CHUNKS +# endif +# ifdef PNG_NO_HANDLE_AS_UNKNOWN +# undef PNG_NO_HANDLE_AS_UNKNOWN +# endif +#endif +#ifndef PNG_NO_READ_OPT_PLTE +# define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */ +#endif /* optional PLTE chunk in RGB and RGBA images */ +#if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \ + defined(PNG_READ_zTXt_SUPPORTED) +# define PNG_READ_TEXT_SUPPORTED +# define PNG_TEXT_SUPPORTED +#endif + +#endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */ + +#ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED + +#ifdef PNG_NO_WRITE_TEXT +# define PNG_NO_WRITE_iTXt +# define PNG_NO_WRITE_tEXt +# define PNG_NO_WRITE_zTXt +#endif +#ifndef PNG_NO_WRITE_bKGD +# define PNG_WRITE_bKGD_SUPPORTED +# ifndef PNG_bKGD_SUPPORTED +# define PNG_bKGD_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_cHRM +# define PNG_WRITE_cHRM_SUPPORTED +# ifndef PNG_cHRM_SUPPORTED +# define PNG_cHRM_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_gAMA +# define PNG_WRITE_gAMA_SUPPORTED +# ifndef PNG_gAMA_SUPPORTED +# define PNG_gAMA_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_hIST +# define PNG_WRITE_hIST_SUPPORTED +# ifndef PNG_hIST_SUPPORTED +# define PNG_hIST_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_iCCP +# define PNG_WRITE_iCCP_SUPPORTED +# ifndef PNG_iCCP_SUPPORTED +# define PNG_iCCP_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_iTXt +# ifndef PNG_WRITE_iTXt_SUPPORTED +# define PNG_WRITE_iTXt_SUPPORTED +# endif +# ifndef PNG_iTXt_SUPPORTED +# define PNG_iTXt_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_oFFs +# define PNG_WRITE_oFFs_SUPPORTED +# ifndef PNG_oFFs_SUPPORTED +# define PNG_oFFs_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_pCAL +# define PNG_WRITE_pCAL_SUPPORTED +# ifndef PNG_pCAL_SUPPORTED +# define PNG_pCAL_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_sCAL +# define PNG_WRITE_sCAL_SUPPORTED +# ifndef PNG_sCAL_SUPPORTED +# define PNG_sCAL_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_pHYs +# define PNG_WRITE_pHYs_SUPPORTED +# ifndef PNG_pHYs_SUPPORTED +# define PNG_pHYs_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_sBIT +# define PNG_WRITE_sBIT_SUPPORTED +# ifndef PNG_sBIT_SUPPORTED +# define PNG_sBIT_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_sPLT +# define PNG_WRITE_sPLT_SUPPORTED +# ifndef PNG_sPLT_SUPPORTED +# define PNG_sPLT_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_sRGB +# define PNG_WRITE_sRGB_SUPPORTED +# ifndef PNG_sRGB_SUPPORTED +# define PNG_sRGB_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_tEXt +# define PNG_WRITE_tEXt_SUPPORTED +# ifndef PNG_tEXt_SUPPORTED +# define PNG_tEXt_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_tIME +# define PNG_WRITE_tIME_SUPPORTED +# ifndef PNG_tIME_SUPPORTED +# define PNG_tIME_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_tRNS +# define PNG_WRITE_tRNS_SUPPORTED +# ifndef PNG_tRNS_SUPPORTED +# define PNG_tRNS_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_zTXt +# define PNG_WRITE_zTXt_SUPPORTED +# ifndef PNG_zTXt_SUPPORTED +# define PNG_zTXt_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS +# define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED +# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED +# define PNG_UNKNOWN_CHUNKS_SUPPORTED +# endif +# ifndef PNG_NO_HANDLE_AS_UNKNOWN +# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED +# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED +# endif +# endif +#endif +#if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \ + defined(PNG_WRITE_zTXt_SUPPORTED) +# define PNG_WRITE_TEXT_SUPPORTED +# ifndef PNG_TEXT_SUPPORTED +# define PNG_TEXT_SUPPORTED +# endif +#endif + +#endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */ + +/* Turn this off to disable png_read_png() and + * png_write_png() and leave the row_pointers member + * out of the info structure. + */ +#ifndef PNG_NO_INFO_IMAGE +# define PNG_INFO_IMAGE_SUPPORTED +#endif + +/* need the time information for reading tIME chunks */ +#if defined(PNG_tIME_SUPPORTED) +# if !defined(_WIN32_WCE) + /* "time.h" functions are not supported on WindowsCE */ +# include <time.h> +# endif +#endif + +/* Some typedefs to get us started. These should be safe on most of the + * common platforms. The typedefs should be at least as large as the + * numbers suggest (a png_uint_32 must be at least 32 bits long), but they + * don't have to be exactly that size. Some compilers dislike passing + * unsigned shorts as function parameters, so you may be better off using + * unsigned int for png_uint_16. Likewise, for 64-bit systems, you may + * want to have unsigned int for png_uint_32 instead of unsigned long. + */ + +typedef unsigned long png_uint_32; +typedef long png_int_32; +typedef unsigned short png_uint_16; +typedef short png_int_16; +typedef unsigned char png_byte; + +/* This is usually size_t. It is typedef'ed just in case you need it to + change (I'm not sure if you will or not, so I thought I'd be safe) */ +#ifdef PNG_SIZE_T + typedef PNG_SIZE_T png_size_t; +# define png_sizeof(x) png_convert_size(sizeof(x)) +#else + typedef size_t png_size_t; +# define png_sizeof(x) sizeof(x) +#endif + +/* The following is needed for medium model support. It cannot be in the + * PNG_INTERNAL section. Needs modification for other compilers besides + * MSC. Model independent support declares all arrays and pointers to be + * large using the far keyword. The zlib version used must also support + * model independent data. As of version zlib 1.0.4, the necessary changes + * have been made in zlib. The USE_FAR_KEYWORD define triggers other + * changes that are needed. (Tim Wegner) + */ + +/* Separate compiler dependencies (problem here is that zlib.h always + defines FAR. (SJT) */ +#ifdef __BORLANDC__ +# if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__) +# define LDATA 1 +# else +# define LDATA 0 +# endif + /* GRR: why is Cygwin in here? Cygwin is not Borland C... */ +# if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__) +# define PNG_MAX_MALLOC_64K +# if (LDATA != 1) +# ifndef FAR +# define FAR __far +# endif +# define USE_FAR_KEYWORD +# endif /* LDATA != 1 */ + /* Possibly useful for moving data out of default segment. + * Uncomment it if you want. Could also define FARDATA as + * const if your compiler supports it. (SJT) +# define FARDATA FAR + */ +# endif /* __WIN32__, __FLAT__, __CYGWIN__ */ +#endif /* __BORLANDC__ */ + + +/* Suggest testing for specific compiler first before testing for + * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM, + * making reliance oncertain keywords suspect. (SJT) + */ + +/* MSC Medium model */ +#if defined(FAR) +# if defined(M_I86MM) +# define USE_FAR_KEYWORD +# define FARDATA FAR +# include <dos.h> +# endif +#endif + +/* SJT: default case */ +#ifndef FAR +# define FAR +#endif + +/* At this point FAR is always defined */ +#ifndef FARDATA +# define FARDATA +#endif + +/* Typedef for floating-point numbers that are converted + to fixed-point with a multiple of 100,000, e.g., int_gamma */ +typedef png_int_32 png_fixed_point; + +/* Add typedefs for pointers */ +typedef void FAR * png_voidp; +typedef png_byte FAR * png_bytep; +typedef png_uint_32 FAR * png_uint_32p; +typedef png_int_32 FAR * png_int_32p; +typedef png_uint_16 FAR * png_uint_16p; +typedef png_int_16 FAR * png_int_16p; +typedef PNG_CONST char FAR * png_const_charp; +typedef char FAR * png_charp; +typedef png_fixed_point FAR * png_fixed_point_p; + +#ifndef PNG_NO_STDIO +#if defined(_WIN32_WCE) +typedef HANDLE png_FILE_p; +#else +typedef FILE * png_FILE_p; +#endif +#endif + +#ifdef PNG_FLOATING_POINT_SUPPORTED +typedef double FAR * png_doublep; +#endif + +/* Pointers to pointers; i.e. arrays */ +typedef png_byte FAR * FAR * png_bytepp; +typedef png_uint_32 FAR * FAR * png_uint_32pp; +typedef png_int_32 FAR * FAR * png_int_32pp; +typedef png_uint_16 FAR * FAR * png_uint_16pp; +typedef png_int_16 FAR * FAR * png_int_16pp; +typedef PNG_CONST char FAR * FAR * png_const_charpp; +typedef char FAR * FAR * png_charpp; +typedef png_fixed_point FAR * FAR * png_fixed_point_pp; +#ifdef PNG_FLOATING_POINT_SUPPORTED +typedef double FAR * FAR * png_doublepp; +#endif + +/* Pointers to pointers to pointers; i.e., pointer to array */ +typedef char FAR * FAR * FAR * png_charppp; + +#if defined(PNG_1_0_X) || defined(PNG_1_2_X) +/* SPC - Is this stuff deprecated? */ +/* It'll be removed as of libpng-1.3.0 - GR-P */ +/* libpng typedefs for types in zlib. If zlib changes + * or another compression library is used, then change these. + * Eliminates need to change all the source files. + */ +typedef charf * png_zcharp; +typedef charf * FAR * png_zcharpp; +typedef z_stream FAR * png_zstreamp; +#endif /* (PNG_1_0_X) || defined(PNG_1_2_X) */ + +/* + * Define PNG_BUILD_DLL if the module being built is a Windows + * LIBPNG DLL. + * + * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL. + * It is equivalent to Microsoft predefined macro _DLL that is + * automatically defined when you compile using the share + * version of the CRT (C Run-Time library) + * + * The cygwin mods make this behavior a little different: + * Define PNG_BUILD_DLL if you are building a dll for use with cygwin + * Define PNG_STATIC if you are building a static library for use with cygwin, + * -or- if you are building an application that you want to link to the + * static library. + * PNG_USE_DLL is defined by default (no user action needed) unless one of + * the other flags is defined. + */ + +#if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL)) +# define PNG_DLL +#endif +/* If CYGWIN, then disallow GLOBAL ARRAYS unless building a static lib. + * When building a static lib, default to no GLOBAL ARRAYS, but allow + * command-line override + */ +#if defined(__CYGWIN__) +# if !defined(PNG_STATIC) +# if defined(PNG_USE_GLOBAL_ARRAYS) +# undef PNG_USE_GLOBAL_ARRAYS +# endif +# if !defined(PNG_USE_LOCAL_ARRAYS) +# define PNG_USE_LOCAL_ARRAYS +# endif +# else +# if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS) +# if defined(PNG_USE_GLOBAL_ARRAYS) +# undef PNG_USE_GLOBAL_ARRAYS +# endif +# endif +# endif +# if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) +# define PNG_USE_LOCAL_ARRAYS +# endif +#endif + +/* Do not use global arrays (helps with building DLL's) + * They are no longer used in libpng itself, since version 1.0.5c, + * but might be required for some pre-1.0.5c applications. + */ +#if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) +# if defined(PNG_NO_GLOBAL_ARRAYS) || \ + (defined(__GNUC__) && defined(PNG_DLL)) || defined(_MSC_VER) +# define PNG_USE_LOCAL_ARRAYS +# else +# define PNG_USE_GLOBAL_ARRAYS +# endif +#endif + +#if defined(__CYGWIN__) +# undef PNGAPI +# define PNGAPI __cdecl +# undef PNG_IMPEXP +# define PNG_IMPEXP +#endif + +/* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall", + * you may get warnings regarding the linkage of png_zalloc and png_zfree. + * Don't ignore those warnings; you must also reset the default calling + * convention in your compiler to match your PNGAPI, and you must build + * zlib and your applications the same way you build libpng. + */ + +#if defined(__MINGW32__) && !defined(PNG_MODULEDEF) +# ifndef PNG_NO_MODULEDEF +# define PNG_NO_MODULEDEF +# endif +#endif + +#if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF) +# define PNG_IMPEXP +#endif + +#if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \ + (( defined(_Windows) || defined(_WINDOWS) || \ + defined(WIN32) || defined(_WIN32) || defined(__WIN32__) )) + +# ifndef PNGAPI +# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800)) +# define PNGAPI __cdecl +# else +# define PNGAPI _cdecl +# endif +# endif + +# if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \ + 0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */) +# define PNG_IMPEXP +# endif + +# if !defined(PNG_IMPEXP) + +# define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol +# define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol + + /* Borland/Microsoft */ +# if defined(_MSC_VER) || defined(__BORLANDC__) +# if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500) +# define PNG_EXPORT PNG_EXPORT_TYPE1 +# else +# define PNG_EXPORT PNG_EXPORT_TYPE2 +# if defined(PNG_BUILD_DLL) +# define PNG_IMPEXP __export +# else +# define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in + VC++ */ +# endif /* Exists in Borland C++ for + C++ classes (== huge) */ +# endif +# endif + +# if !defined(PNG_IMPEXP) +# if defined(PNG_BUILD_DLL) +# define PNG_IMPEXP __declspec(dllexport) +# else +# define PNG_IMPEXP __declspec(dllimport) +# endif +# endif +# endif /* PNG_IMPEXP */ +#else /* !(DLL || non-cygwin WINDOWS) */ +# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) +# ifndef PNGAPI +# define PNGAPI _System +# endif +# else +# if 0 /* ... other platforms, with other meanings */ +# endif +# endif +#endif + +#ifndef PNGAPI +# define PNGAPI +#endif +#ifndef PNG_IMPEXP +# define PNG_IMPEXP +#endif + +#ifdef PNG_BUILDSYMS +# ifndef PNG_EXPORT +# define PNG_EXPORT(type,symbol) PNG_FUNCTION_EXPORT symbol END +# endif +# ifdef PNG_USE_GLOBAL_ARRAYS +# ifndef PNG_EXPORT_VAR +# define PNG_EXPORT_VAR(type) PNG_DATA_EXPORT +# endif +# endif +#endif + +#ifndef PNG_EXPORT +# define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol +#endif + +#ifdef PNG_USE_GLOBAL_ARRAYS +# ifndef PNG_EXPORT_VAR +# define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type +# endif +#endif + +/* User may want to use these so they are not in PNG_INTERNAL. Any library + * functions that are passed far data must be model independent. + */ + +#ifndef PNG_ABORT +# define PNG_ABORT() abort() +#endif + +#ifdef PNG_SETJMP_SUPPORTED +# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) +#else +# define png_jmpbuf(png_ptr) \ + (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED) +#endif + +#if defined(USE_FAR_KEYWORD) /* memory model independent fns */ +/* use this to make far-to-near assignments */ +# define CHECK 1 +# define NOCHECK 0 +# define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK)) +# define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK)) +# define png_snprintf _fsnprintf /* Added to v 1.2.19 */ +# define png_strlen _fstrlen +# define png_memcmp _fmemcmp /* SJT: added */ +# define png_memcpy _fmemcpy +# define png_memset _fmemset +#else /* use the usual functions */ +# define CVT_PTR(ptr) (ptr) +# define CVT_PTR_NOCHECK(ptr) (ptr) +# ifndef PNG_NO_SNPRINTF +# ifdef _MSC_VER +# define png_snprintf _snprintf /* Added to v 1.2.19 */ +# define png_snprintf2 _snprintf +# define png_snprintf6 _snprintf +# else +# define png_snprintf snprintf /* Added to v 1.2.19 */ +# define png_snprintf2 snprintf +# define png_snprintf6 snprintf +# endif +# else + /* You don't have or don't want to use snprintf(). Caution: Using + * sprintf instead of snprintf exposes your application to accidental + * or malevolent buffer overflows. If you don't have snprintf() + * as a general rule you should provide one (you can get one from + * Portable OpenSSH). */ +# define png_snprintf(s1,n,fmt,x1) sprintf(s1,fmt,x1) +# define png_snprintf2(s1,n,fmt,x1,x2) sprintf(s1,fmt,x1,x2) +# define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \ + sprintf(s1,fmt,x1,x2,x3,x4,x5,x6) +# endif +# define png_strlen strlen +# define png_memcmp memcmp /* SJT: added */ +# define png_memcpy memcpy +# define png_memset memset +#endif +/* End of memory model independent support */ + +/* Just a little check that someone hasn't tried to define something + * contradictory. + */ +#if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K) +# undef PNG_ZBUF_SIZE +# define PNG_ZBUF_SIZE 65536L +#endif + +/* Added at libpng-1.2.8 */ +#endif /* PNG_VERSION_INFO_ONLY */ + +#endif /* PNGCONF_H */ diff --git a/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/lib/libpng-bcc.lib b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/lib/libpng-bcc.lib new file mode 100644 index 0000000000..ebcbf6b4be Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/lib/libpng-bcc.lib differ diff --git a/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/lib/libpng.lib b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/lib/libpng.lib new file mode 100644 index 0000000000..b693724755 Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/lib/libpng.lib differ diff --git a/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/lib/libpng12.def b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/lib/libpng12.def new file mode 100644 index 0000000000..8045a8f833 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/lib/libpng12.def @@ -0,0 +1,239 @@ +LIBRARY libpng12.dll +EXPORTS +DllGetVersion +png_IDAT DATA +png_IEND DATA +png_IHDR DATA +png_PLTE DATA +png_access_version_number +png_bKGD DATA +png_build_grayscale_palette +png_cHRM DATA +png_check_sig +png_chunk_error +png_chunk_warning +png_convert_from_struct_tm +png_convert_from_time_t +png_convert_to_rfc1123 +png_create_info_struct +png_create_read_struct +png_create_read_struct_2 +png_create_write_struct +png_create_write_struct_2 +png_data_freer +png_destroy_info_struct +png_destroy_read_struct +png_destroy_write_struct +png_error +png_free +png_free_data +png_free_default +png_gAMA DATA +png_get_IHDR +png_get_PLTE +png_get_asm_flagmask +png_get_asm_flags +png_get_bKGD +png_get_bit_depth +png_get_cHRM +png_get_cHRM_fixed +png_get_channels +png_get_color_type +png_get_compression_buffer_size +png_get_compression_type +png_get_copyright +png_get_error_ptr +png_get_filter_type +png_get_gAMA +png_get_gAMA_fixed +png_get_hIST +png_get_header_ver +png_get_header_version +png_get_iCCP +png_get_image_height +png_get_image_width +png_get_int_32 +png_get_interlace_type +png_get_io_ptr +png_get_libpng_ver +png_get_mem_ptr +png_get_mmx_bitdepth_threshold +png_get_mmx_flagmask +png_get_mmx_rowbytes_threshold +png_get_oFFs +png_get_pCAL +png_get_pHYs +png_get_pixel_aspect_ratio +png_get_pixels_per_meter +png_get_progressive_ptr +png_get_rgb_to_gray_status +png_get_rowbytes +png_get_rows +png_get_sBIT +png_get_sCAL +png_get_sPLT +png_get_sRGB +png_get_signature +png_get_tIME +png_get_tRNS +png_get_text +png_get_uint_16 +png_get_uint_31 +png_get_uint_32 +png_get_unknown_chunks +png_get_user_chunk_ptr +png_get_user_height_max +png_get_user_transform_ptr +png_get_user_width_max +png_get_valid +png_get_x_offset_microns +png_get_x_offset_pixels +png_get_x_pixels_per_meter +png_get_y_offset_microns +png_get_y_offset_pixels +png_get_y_pixels_per_meter +png_hIST DATA +png_handle_as_unknown +png_iCCP DATA +png_iTXt DATA +png_info_init +png_info_init_3 +png_init_io +png_libpng_ver DATA +png_malloc +png_malloc_default +png_malloc_warn +png_memcpy_check +png_memset_check +png_mmx_support +png_oFFs DATA +png_pCAL DATA +png_pHYs DATA +png_pass_dsp_mask DATA +png_pass_inc DATA +png_pass_mask DATA +png_pass_start DATA +png_pass_yinc DATA +png_pass_ystart DATA +png_permit_empty_plte +png_permit_mng_features +png_process_data +png_progressive_combine_row +png_read_destroy +png_read_end +png_read_image +png_read_info +png_read_init +png_read_init_2 +png_read_init_3 +png_read_png +png_read_row +png_read_rows +png_read_update_info +png_reset_zstream +png_sBIT DATA +png_sCAL DATA +png_sPLT DATA +png_sRGB DATA +png_save_int_32 +png_save_uint_16 +png_save_uint_32 +png_set_IHDR +png_set_PLTE +png_set_add_alpha +png_set_asm_flags +png_set_bKGD +png_set_background +png_set_bgr +png_set_cHRM +png_set_cHRM_fixed +png_set_compression_buffer_size +png_set_compression_level +png_set_compression_mem_level +png_set_compression_method +png_set_compression_strategy +png_set_compression_window_bits +png_set_crc_action +png_set_dither +png_set_error_fn +png_set_expand +png_set_expand_gray_1_2_4_to_8 +png_set_filler +png_set_filter +png_set_filter_heuristics +png_set_flush +png_set_gAMA +png_set_gAMA_fixed +png_set_gamma +png_set_gray_1_2_4_to_8 +png_set_gray_to_rgb +png_set_hIST +png_set_iCCP +png_set_interlace_handling +png_set_invalid +png_set_invert_alpha +png_set_invert_mono +png_set_keep_unknown_chunks +png_set_mem_fn +png_set_mmx_thresholds +png_set_oFFs +png_set_pCAL +png_set_pHYs +png_set_packing +png_set_packswap +png_set_palette_to_rgb +png_set_progressive_read_fn +png_set_read_fn +png_set_read_status_fn +png_set_read_user_chunk_fn +png_set_read_user_transform_fn +png_set_rgb_to_gray +png_set_rgb_to_gray_fixed +png_set_rows +png_set_sBIT +png_set_sCAL +png_set_sPLT +png_set_sRGB +png_set_sRGB_gAMA_and_cHRM +png_set_shift +png_set_sig_bytes +png_set_strip_16 +png_set_strip_alpha +png_set_strip_error_numbers +png_set_swap +png_set_swap_alpha +png_set_tIME +png_set_tRNS +png_set_tRNS_to_alpha +png_set_text +png_set_unknown_chunk_location +png_set_unknown_chunks +png_set_user_limits +png_set_user_transform_info +png_set_write_fn +png_set_write_status_fn +png_set_write_user_transform_fn +png_sig DATA +png_sig_cmp +png_start_read_image +png_tEXt DATA +png_tIME DATA +png_tRNS DATA +png_warning +png_write_chunk +png_write_chunk_data +png_write_chunk_end +png_write_chunk_start +png_write_destroy +png_write_end +png_write_flush +png_write_image +png_write_info +png_write_info_before_PLTE +png_write_init +png_write_init_2 +png_write_init_3 +png_write_png +png_write_row +png_write_rows +png_zTXt DATA diff --git a/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/lib/pkgconfig/libpng.pc b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/lib/pkgconfig/libpng.pc new file mode 100644 index 0000000000..31f749c773 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/lib/pkgconfig/libpng.pc @@ -0,0 +1,11 @@ +prefix=c:/progra~1/libpng +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include/libpng12 + +Name: libpng +Description: Loads and saves PNG files +Version: 1.2.37 +Libs: -L${libdir} -lpng12 +Libs.private: -lz -Wl,-s -lz -LD:/Progra~1/GnuWin32/lib -lintl -lwsock32 -lole32 -luuid -lmsvcp60 +Cflags: -I${includedir} diff --git a/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/lib/pkgconfig/libpng12.pc b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/lib/pkgconfig/libpng12.pc new file mode 100644 index 0000000000..31f749c773 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/lib/pkgconfig/libpng12.pc @@ -0,0 +1,11 @@ +prefix=c:/progra~1/libpng +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include/libpng12 + +Name: libpng +Description: Loads and saves PNG files +Version: 1.2.37 +Libs: -L${libdir} -lpng12 +Libs.private: -lz -Wl,-s -lz -LD:/Progra~1/GnuWin32/lib -lintl -lwsock32 -lole32 -luuid -lmsvcp60 +Cflags: -I${includedir} diff --git a/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/manifest/libpng-1.2.37-lib.mft b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/manifest/libpng-1.2.37-lib.mft new file mode 100644 index 0000000000..4120785c73 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/manifest/libpng-1.2.37-lib.mft @@ -0,0 +1,15 @@ +include/libpng12/png.h 0012b21e9399580812a06fb373e0e38c +include/libpng12/pngconf.h 23fba458f9d6870e8cd6c78335f0b3e6 +include/png.h 0012b21e9399580812a06fb373e0e38c +include/pngconf.h 23fba458f9d6870e8cd6c78335f0b3e6 +lib/libpng-bcc.lib 450a624ca0653f076352b2e25dd9bedc +lib/libpng.dll.a 9c21b9429fac4df257697fb57cbbc597 +lib/libpng.la c9f4ed5c78c7db0469d3f3aeafcb1523 +lib/libpng.lib 96901afb391d853e3a8062a6ac35ace3 +lib/libpng12.def 64278e9647e55359f4feb9ce67880fba +lib/libpng12.dll.a aa7313235b1cbb786dac4a82a23def74 +lib/libpng12.la c9f4ed5c78c7db0469d3f3aeafcb1523 +lib/pkgconfig/libpng.pc 81afd5c19d8231d3afbbb6346de8021a +lib/pkgconfig/libpng12.pc 81afd5c19d8231d3afbbb6346de8021a +manifest/libpng-1.2.37-lib.mft +manifest/libpng-1.2.37-lib.ver cef5343d495ca89f9c2466e04ac9d321 diff --git a/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/manifest/libpng-1.2.37-lib.ver b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/manifest/libpng-1.2.37-lib.ver new file mode 100644 index 0000000000..f5aaa84359 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/libpng-1.2.37/manifest/libpng-1.2.37-lib.ver @@ -0,0 +1 @@ +LibPng-1.2.37 (PNG image compression library): Developer files diff --git a/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/bin/zlib1.dll b/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/bin/zlib1.dll new file mode 100644 index 0000000000..31996cd3e2 Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/bin/zlib1.dll differ diff --git a/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/include/zconf.h b/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/include/zconf.h new file mode 100644 index 0000000000..03a9431c8b --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/include/zconf.h @@ -0,0 +1,332 @@ +/* zconf.h -- configuration of the zlib compression library + * Copyright (C) 1995-2005 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#ifndef ZCONF_H +#define ZCONF_H + +/* + * If you *really* need a unique prefix for all types and library functions, + * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. + */ +#ifdef Z_PREFIX +# define deflateInit_ z_deflateInit_ +# define deflate z_deflate +# define deflateEnd z_deflateEnd +# define inflateInit_ z_inflateInit_ +# define inflate z_inflate +# define inflateEnd z_inflateEnd +# define deflateInit2_ z_deflateInit2_ +# define deflateSetDictionary z_deflateSetDictionary +# define deflateCopy z_deflateCopy +# define deflateReset z_deflateReset +# define deflateParams z_deflateParams +# define deflateBound z_deflateBound +# define deflatePrime z_deflatePrime +# define inflateInit2_ z_inflateInit2_ +# define inflateSetDictionary z_inflateSetDictionary +# define inflateSync z_inflateSync +# define inflateSyncPoint z_inflateSyncPoint +# define inflateCopy z_inflateCopy +# define inflateReset z_inflateReset +# define inflateBack z_inflateBack +# define inflateBackEnd z_inflateBackEnd +# define compress z_compress +# define compress2 z_compress2 +# define compressBound z_compressBound +# define uncompress z_uncompress +# define adler32 z_adler32 +# define crc32 z_crc32 +# define get_crc_table z_get_crc_table +# define zError z_zError + +# define alloc_func z_alloc_func +# define free_func z_free_func +# define in_func z_in_func +# define out_func z_out_func +# define Byte z_Byte +# define uInt z_uInt +# define uLong z_uLong +# define Bytef z_Bytef +# define charf z_charf +# define intf z_intf +# define uIntf z_uIntf +# define uLongf z_uLongf +# define voidpf z_voidpf +# define voidp z_voidp +#endif + +#if defined(__MSDOS__) && !defined(MSDOS) +# define MSDOS +#endif +#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) +# define OS2 +#endif +#if defined(_WINDOWS) && !defined(WINDOWS) +# define WINDOWS +#endif +#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) +# ifndef WIN32 +# define WIN32 +# endif +#endif +#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) +# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) +# ifndef SYS16BIT +# define SYS16BIT +# endif +# endif +#endif + +/* + * Compile with -DMAXSEG_64K if the alloc function cannot allocate more + * than 64k bytes at a time (needed on systems with 16-bit int). + */ +#ifdef SYS16BIT +# define MAXSEG_64K +#endif +#ifdef MSDOS +# define UNALIGNED_OK +#endif + +#ifdef __STDC_VERSION__ +# ifndef STDC +# define STDC +# endif +# if __STDC_VERSION__ >= 199901L +# ifndef STDC99 +# define STDC99 +# endif +# endif +#endif +#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) +# define STDC +#endif +#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) +# define STDC +#endif +#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) +# define STDC +#endif +#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) +# define STDC +#endif + +#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ +# define STDC +#endif + +#ifndef STDC +# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ +# define const /* note: need a more gentle solution here */ +# endif +#endif + +/* Some Mac compilers merge all .h files incorrectly: */ +#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) +# define NO_DUMMY_DECL +#endif + +/* Maximum value for memLevel in deflateInit2 */ +#ifndef MAX_MEM_LEVEL +# ifdef MAXSEG_64K +# define MAX_MEM_LEVEL 8 +# else +# define MAX_MEM_LEVEL 9 +# endif +#endif + +/* Maximum value for windowBits in deflateInit2 and inflateInit2. + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files + * created by gzip. (Files created by minigzip can still be extracted by + * gzip.) + */ +#ifndef MAX_WBITS +# define MAX_WBITS 15 /* 32K LZ77 window */ +#endif + +/* The memory requirements for deflate are (in bytes): + (1 << (windowBits+2)) + (1 << (memLevel+9)) + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) + plus a few kilobytes for small objects. For example, if you want to reduce + the default memory requirements from 256K to 128K, compile with + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" + Of course this will generally degrade compression (there's no free lunch). + + The memory requirements for inflate are (in bytes) 1 << windowBits + that is, 32K for windowBits=15 (default value) plus a few kilobytes + for small objects. +*/ + + /* Type declarations */ + +#ifndef OF /* function prototypes */ +# ifdef STDC +# define OF(args) args +# else +# define OF(args) () +# endif +#endif + +/* The following definitions for FAR are needed only for MSDOS mixed + * model programming (small or medium model with some far allocations). + * This was tested only with MSC; for other MSDOS compilers you may have + * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, + * just define FAR to be empty. + */ +#ifdef SYS16BIT +# if defined(M_I86SM) || defined(M_I86MM) + /* MSC small or medium model */ +# define SMALL_MEDIUM +# ifdef _MSC_VER +# define FAR _far +# else +# define FAR far +# endif +# endif +# if (defined(__SMALL__) || defined(__MEDIUM__)) + /* Turbo C small or medium model */ +# define SMALL_MEDIUM +# ifdef __BORLANDC__ +# define FAR _far +# else +# define FAR far +# endif +# endif +#endif + +#if defined(WINDOWS) || defined(WIN32) + /* If building or using zlib as a DLL, define ZLIB_DLL. + * This is not mandatory, but it offers a little performance increase. + */ +# ifdef ZLIB_DLL +# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) +# ifdef ZLIB_INTERNAL +# define ZEXTERN extern __declspec(dllexport) +# else +# define ZEXTERN extern __declspec(dllimport) +# endif +# endif +# endif /* ZLIB_DLL */ + /* If building or using zlib with the WINAPI/WINAPIV calling convention, + * define ZLIB_WINAPI. + * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. + */ +# ifdef ZLIB_WINAPI +# ifdef FAR +# undef FAR +# endif +# include <windows.h> + /* No need for _export, use ZLIB.DEF instead. */ + /* For complete Windows compatibility, use WINAPI, not __stdcall. */ +# define ZEXPORT WINAPI +# ifdef WIN32 +# define ZEXPORTVA WINAPIV +# else +# define ZEXPORTVA FAR CDECL +# endif +# endif +#endif + +#if defined (__BEOS__) +# ifdef ZLIB_DLL +# ifdef ZLIB_INTERNAL +# define ZEXPORT __declspec(dllexport) +# define ZEXPORTVA __declspec(dllexport) +# else +# define ZEXPORT __declspec(dllimport) +# define ZEXPORTVA __declspec(dllimport) +# endif +# endif +#endif + +#ifndef ZEXTERN +# define ZEXTERN extern +#endif +#ifndef ZEXPORT +# define ZEXPORT +#endif +#ifndef ZEXPORTVA +# define ZEXPORTVA +#endif + +#ifndef FAR +# define FAR +#endif + +#if !defined(__MACTYPES__) +typedef unsigned char Byte; /* 8 bits */ +#endif +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ + +#ifdef SMALL_MEDIUM + /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ +# define Bytef Byte FAR +#else + typedef Byte FAR Bytef; +#endif +typedef char FAR charf; +typedef int FAR intf; +typedef uInt FAR uIntf; +typedef uLong FAR uLongf; + +#ifdef STDC + typedef void const *voidpc; + typedef void FAR *voidpf; + typedef void *voidp; +#else + typedef Byte const *voidpc; + typedef Byte FAR *voidpf; + typedef Byte *voidp; +#endif + +#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */ +# include <sys/types.h> /* for off_t */ +# include <unistd.h> /* for SEEK_* and off_t */ +# ifdef VMS +# include <unixio.h> /* for off_t */ +# endif +# define z_off_t off_t +#endif +#ifndef SEEK_SET +# define SEEK_SET 0 /* Seek from beginning of file. */ +# define SEEK_CUR 1 /* Seek from current position. */ +# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ +#endif +#ifndef z_off_t +# define z_off_t long +#endif + +#if defined(__OS400__) +# define NO_vsnprintf +#endif + +#if defined(__MVS__) +# define NO_vsnprintf +# ifdef FAR +# undef FAR +# endif +#endif + +/* MVS linker does not support external names larger than 8 bytes */ +#if defined(__MVS__) +# pragma map(deflateInit_,"DEIN") +# pragma map(deflateInit2_,"DEIN2") +# pragma map(deflateEnd,"DEEND") +# pragma map(deflateBound,"DEBND") +# pragma map(inflateInit_,"ININ") +# pragma map(inflateInit2_,"ININ2") +# pragma map(inflateEnd,"INEND") +# pragma map(inflateSync,"INSY") +# pragma map(inflateSetDictionary,"INSEDI") +# pragma map(compressBound,"CMBND") +# pragma map(inflate_table,"INTABL") +# pragma map(inflate_fast,"INFA") +# pragma map(inflate_copyright,"INCOPY") +#endif + +#endif /* ZCONF_H */ diff --git a/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/include/zlib.h b/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/include/zlib.h new file mode 100644 index 0000000000..022817927c --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/include/zlib.h @@ -0,0 +1,1357 @@ +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.2.3, July 18th, 2005 + + Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + + The data format used by the zlib library is described by RFCs (Request for + Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt + (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). +*/ + +#ifndef ZLIB_H +#define ZLIB_H + +#include "zconf.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define ZLIB_VERSION "1.2.3" +#define ZLIB_VERNUM 0x1230 + +/* + The 'zlib' compression library provides in-memory compression and + decompression functions, including integrity checks of the uncompressed + data. This version of the library supports only one compression method + (deflation) but other algorithms will be added later and will have the same + stream interface. + + Compression can be done in a single step if the buffers are large + enough (for example if an input file is mmap'ed), or can be done by + repeated calls of the compression function. In the latter case, the + application must provide more input and/or consume the output + (providing more output space) before each call. + + The compressed data format used by default by the in-memory functions is + the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped + around a deflate stream, which is itself documented in RFC 1951. + + The library also supports reading and writing files in gzip (.gz) format + with an interface similar to that of stdio using the functions that start + with "gz". The gzip format is different from the zlib format. gzip is a + gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. + + This library can optionally read and write gzip streams in memory as well. + + The zlib format was designed to be compact and fast for use in memory + and on communications channels. The gzip format was designed for single- + file compression on file systems, has a larger header than zlib to maintain + directory information, and uses a different, slower check method than zlib. + + The library does not install any signal handler. The decoder checks + the consistency of the compressed data, so the library should never + crash even in case of corrupted input. +*/ + +typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); +typedef void (*free_func) OF((voidpf opaque, voidpf address)); + +struct internal_state; + +typedef struct z_stream_s { + Bytef *next_in; /* next input byte */ + uInt avail_in; /* number of bytes available at next_in */ + uLong total_in; /* total nb of input bytes read so far */ + + Bytef *next_out; /* next output byte should be put there */ + uInt avail_out; /* remaining free space at next_out */ + uLong total_out; /* total nb of bytes output so far */ + + char *msg; /* last error message, NULL if no error */ + struct internal_state FAR *state; /* not visible by applications */ + + alloc_func zalloc; /* used to allocate the internal state */ + free_func zfree; /* used to free the internal state */ + voidpf opaque; /* private data object passed to zalloc and zfree */ + + int data_type; /* best guess about the data type: binary or text */ + uLong adler; /* adler32 value of the uncompressed data */ + uLong reserved; /* reserved for future use */ +} z_stream; + +typedef z_stream FAR *z_streamp; + +/* + gzip header information passed to and from zlib routines. See RFC 1952 + for more details on the meanings of these fields. +*/ +typedef struct gz_header_s { + int text; /* true if compressed data believed to be text */ + uLong time; /* modification time */ + int xflags; /* extra flags (not used when writing a gzip file) */ + int os; /* operating system */ + Bytef *extra; /* pointer to extra field or Z_NULL if none */ + uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ + uInt extra_max; /* space at extra (only when reading header) */ + Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ + uInt name_max; /* space at name (only when reading header) */ + Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ + uInt comm_max; /* space at comment (only when reading header) */ + int hcrc; /* true if there was or will be a header crc */ + int done; /* true when done reading gzip header (not used + when writing a gzip file) */ +} gz_header; + +typedef gz_header FAR *gz_headerp; + +/* + The application must update next_in and avail_in when avail_in has + dropped to zero. It must update next_out and avail_out when avail_out + has dropped to zero. The application must initialize zalloc, zfree and + opaque before calling the init function. All other fields are set by the + compression library and must not be updated by the application. + + The opaque value provided by the application will be passed as the first + parameter for calls of zalloc and zfree. This can be useful for custom + memory management. The compression library attaches no meaning to the + opaque value. + + zalloc must return Z_NULL if there is not enough memory for the object. + If zlib is used in a multi-threaded application, zalloc and zfree must be + thread safe. + + On 16-bit systems, the functions zalloc and zfree must be able to allocate + exactly 65536 bytes, but will not be required to allocate more than this + if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, + pointers returned by zalloc for objects of exactly 65536 bytes *must* + have their offset normalized to zero. The default allocation function + provided by this library ensures this (see zutil.c). To reduce memory + requirements and avoid any allocation of 64K objects, at the expense of + compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). + + The fields total_in and total_out can be used for statistics or + progress reports. After compression, total_in holds the total size of + the uncompressed data and may be saved for use in the decompressor + (particularly if the decompressor wants to decompress everything in + a single step). +*/ + + /* constants */ + +#define Z_NO_FLUSH 0 +#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ +#define Z_SYNC_FLUSH 2 +#define Z_FULL_FLUSH 3 +#define Z_FINISH 4 +#define Z_BLOCK 5 +/* Allowed flush values; see deflate() and inflate() below for details */ + +#define Z_OK 0 +#define Z_STREAM_END 1 +#define Z_NEED_DICT 2 +#define Z_ERRNO (-1) +#define Z_STREAM_ERROR (-2) +#define Z_DATA_ERROR (-3) +#define Z_MEM_ERROR (-4) +#define Z_BUF_ERROR (-5) +#define Z_VERSION_ERROR (-6) +/* Return codes for the compression/decompression functions. Negative + * values are errors, positive values are used for special but normal events. + */ + +#define Z_NO_COMPRESSION 0 +#define Z_BEST_SPEED 1 +#define Z_BEST_COMPRESSION 9 +#define Z_DEFAULT_COMPRESSION (-1) +/* compression levels */ + +#define Z_FILTERED 1 +#define Z_HUFFMAN_ONLY 2 +#define Z_RLE 3 +#define Z_FIXED 4 +#define Z_DEFAULT_STRATEGY 0 +/* compression strategy; see deflateInit2() below for details */ + +#define Z_BINARY 0 +#define Z_TEXT 1 +#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ +#define Z_UNKNOWN 2 +/* Possible values of the data_type field (though see inflate()) */ + +#define Z_DEFLATED 8 +/* The deflate compression method (the only one supported in this version) */ + +#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ + +#define zlib_version zlibVersion() +/* for compatibility with versions < 1.0.2 */ + + /* basic functions */ + +ZEXTERN const char * ZEXPORT zlibVersion OF((void)); +/* The application can compare zlibVersion and ZLIB_VERSION for consistency. + If the first character differs, the library code actually used is + not compatible with the zlib.h header file used by the application. + This check is automatically made by deflateInit and inflateInit. + */ + +/* +ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); + + Initializes the internal stream state for compression. The fields + zalloc, zfree and opaque must be initialized before by the caller. + If zalloc and zfree are set to Z_NULL, deflateInit updates them to + use default allocation functions. + + The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: + 1 gives best speed, 9 gives best compression, 0 gives no compression at + all (the input data is simply copied a block at a time). + Z_DEFAULT_COMPRESSION requests a default compromise between speed and + compression (currently equivalent to level 6). + + deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if level is not a valid compression level, + Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible + with the version assumed by the caller (ZLIB_VERSION). + msg is set to null if there is no error message. deflateInit does not + perform any compression: this will be done by deflate(). +*/ + + +ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); +/* + deflate compresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce some + output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. deflate performs one or both of the + following actions: + + - Compress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in and avail_in are updated and + processing will resume at this point for the next call of deflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. This action is forced if the parameter flush is non zero. + Forcing flush frequently degrades the compression ratio, so this parameter + should be set only when necessary (in interactive applications). + Some output may be provided even if flush is not set. + + Before the call of deflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating avail_in or avail_out accordingly; avail_out + should never be zero before the call. The application can consume the + compressed output when it wants, for example when the output buffer is full + (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK + and with zero avail_out, it must be called again after making room in the + output buffer because there might be more output pending. + + Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to + decide how much data to accumualte before producing output, in order to + maximize compression. + + If the parameter flush is set to Z_SYNC_FLUSH, all pending output is + flushed to the output buffer and the output is aligned on a byte boundary, so + that the decompressor can get all input data available so far. (In particular + avail_in is zero after the call if enough output space has been provided + before the call.) Flushing may degrade compression for some compression + algorithms and so it should be used only when necessary. + + If flush is set to Z_FULL_FLUSH, all output is flushed as with + Z_SYNC_FLUSH, and the compression state is reset so that decompression can + restart from this point if previous compressed data has been damaged or if + random access is desired. Using Z_FULL_FLUSH too often can seriously degrade + compression. + + If deflate returns with avail_out == 0, this function must be called again + with the same value of the flush parameter and more output space (updated + avail_out), until the flush is complete (deflate returns with non-zero + avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that + avail_out is greater than six to avoid repeated flush markers due to + avail_out == 0 on return. + + If the parameter flush is set to Z_FINISH, pending input is processed, + pending output is flushed and deflate returns with Z_STREAM_END if there + was enough output space; if deflate returns with Z_OK, this function must be + called again with Z_FINISH and more output space (updated avail_out) but no + more input data, until it returns with Z_STREAM_END or an error. After + deflate has returned Z_STREAM_END, the only possible operations on the + stream are deflateReset or deflateEnd. + + Z_FINISH can be used immediately after deflateInit if all the compression + is to be done in a single step. In this case, avail_out must be at least + the value returned by deflateBound (see below). If deflate does not return + Z_STREAM_END, then it must be called again as described above. + + deflate() sets strm->adler to the adler32 checksum of all input read + so far (that is, total_in bytes). + + deflate() may update strm->data_type if it can make a good guess about + the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered + binary. This field is only for information purposes and does not affect + the compression algorithm in any manner. + + deflate() returns Z_OK if some progress has been made (more input + processed or more output produced), Z_STREAM_END if all input has been + consumed and all output has been produced (only when flush is set to + Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example + if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible + (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not + fatal, and deflate() can be called again with more input and more output + space to continue compressing. +*/ + + +ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. + + deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the + stream state was inconsistent, Z_DATA_ERROR if the stream was freed + prematurely (some input or output was discarded). In the error case, + msg may be set but then points to a static string (which must not be + deallocated). +*/ + + +/* +ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); + + Initializes the internal stream state for decompression. The fields + next_in, avail_in, zalloc, zfree and opaque must be initialized before by + the caller. If next_in is not Z_NULL and avail_in is large enough (the exact + value depends on the compression method), inflateInit determines the + compression method from the zlib header and allocates all data structures + accordingly; otherwise the allocation will be deferred to the first call of + inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to + use default allocation functions. + + inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller. msg is set to null if there is no error + message. inflateInit does not perform any decompression apart from reading + the zlib header if present: this will be done by inflate(). (So next_in and + avail_in may be modified, but next_out and avail_out are unchanged.) +*/ + + +ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); +/* + inflate decompresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce + some output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. inflate performs one or both of the + following actions: + + - Decompress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in is updated and processing + will resume at this point for the next call of inflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. inflate() provides as much output as possible, until there + is no more input data or no more space in the output buffer (see below + about the flush parameter). + + Before the call of inflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating the next_* and avail_* values accordingly. + The application can consume the uncompressed output when it wants, for + example when the output buffer is full (avail_out == 0), or after each + call of inflate(). If inflate returns Z_OK and with zero avail_out, it + must be called again after making room in the output buffer because there + might be more output pending. + + The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, + Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much + output as possible to the output buffer. Z_BLOCK requests that inflate() stop + if and when it gets to the next deflate block boundary. When decoding the + zlib or gzip format, this will cause inflate() to return immediately after + the header and before the first block. When doing a raw inflate, inflate() + will go ahead and process the first block, and will return when it gets to + the end of that block, or when it runs out of data. + + The Z_BLOCK option assists in appending to or combining deflate streams. + Also to assist in this, on return inflate() will set strm->data_type to the + number of unused bits in the last byte taken from strm->next_in, plus 64 + if inflate() is currently decoding the last block in the deflate stream, + plus 128 if inflate() returned immediately after decoding an end-of-block + code or decoding the complete header up to just before the first byte of the + deflate stream. The end-of-block will not be indicated until all of the + uncompressed data from that block has been written to strm->next_out. The + number of unused bits may in general be greater than seven, except when + bit 7 of data_type is set, in which case the number of unused bits will be + less than eight. + + inflate() should normally be called until it returns Z_STREAM_END or an + error. However if all decompression is to be performed in a single step + (a single call of inflate), the parameter flush should be set to + Z_FINISH. In this case all pending input is processed and all pending + output is flushed; avail_out must be large enough to hold all the + uncompressed data. (The size of the uncompressed data may have been saved + by the compressor for this purpose.) The next operation on this stream must + be inflateEnd to deallocate the decompression state. The use of Z_FINISH + is never required, but can be used to inform inflate that a faster approach + may be used for the single inflate() call. + + In this implementation, inflate() always flushes as much output as + possible to the output buffer, and always uses the faster approach on the + first call. So the only effect of the flush parameter in this implementation + is on the return value of inflate(), as noted below, or when it returns early + because Z_BLOCK is used. + + If a preset dictionary is needed after this call (see inflateSetDictionary + below), inflate sets strm->adler to the adler32 checksum of the dictionary + chosen by the compressor and returns Z_NEED_DICT; otherwise it sets + strm->adler to the adler32 checksum of all output produced so far (that is, + total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described + below. At the end of the stream, inflate() checks that its computed adler32 + checksum is equal to that saved by the compressor and returns Z_STREAM_END + only if the checksum is correct. + + inflate() will decompress and check either zlib-wrapped or gzip-wrapped + deflate data. The header type is detected automatically. Any information + contained in the gzip header is not retained, so applications that need that + information should instead use raw inflate, see inflateInit2() below, or + inflateBack() and perform their own processing of the gzip header and + trailer. + + inflate() returns Z_OK if some progress has been made (more input processed + or more output produced), Z_STREAM_END if the end of the compressed data has + been reached and all uncompressed output has been produced, Z_NEED_DICT if a + preset dictionary is needed at this point, Z_DATA_ERROR if the input data was + corrupted (input stream not conforming to the zlib format or incorrect check + value), Z_STREAM_ERROR if the stream structure was inconsistent (for example + if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory, + Z_BUF_ERROR if no progress is possible or if there was not enough room in the + output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and + inflate() can be called again with more input and more output space to + continue decompressing. If Z_DATA_ERROR is returned, the application may then + call inflateSync() to look for a good compression block if a partial recovery + of the data is desired. +*/ + + +ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. + + inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state + was inconsistent. In the error case, msg may be set but then points to a + static string (which must not be deallocated). +*/ + + /* Advanced functions */ + +/* + The following functions are needed only in some special applications. +*/ + +/* +ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, + int level, + int method, + int windowBits, + int memLevel, + int strategy)); + + This is another version of deflateInit with more compression options. The + fields next_in, zalloc, zfree and opaque must be initialized before by + the caller. + + The method parameter is the compression method. It must be Z_DEFLATED in + this version of the library. + + The windowBits parameter is the base two logarithm of the window size + (the size of the history buffer). It should be in the range 8..15 for this + version of the library. Larger values of this parameter result in better + compression at the expense of memory usage. The default value is 15 if + deflateInit is used instead. + + windowBits can also be -8..-15 for raw deflate. In this case, -windowBits + determines the window size. deflate() will then generate raw deflate data + with no zlib header or trailer, and will not compute an adler32 check value. + + windowBits can also be greater than 15 for optional gzip encoding. Add + 16 to windowBits to write a simple gzip header and trailer around the + compressed data instead of a zlib wrapper. The gzip header will have no + file name, no extra data, no comment, no modification time (set to zero), + no header crc, and the operating system will be set to 255 (unknown). If a + gzip stream is being written, strm->adler is a crc32 instead of an adler32. + + The memLevel parameter specifies how much memory should be allocated + for the internal compression state. memLevel=1 uses minimum memory but + is slow and reduces compression ratio; memLevel=9 uses maximum memory + for optimal speed. The default value is 8. See zconf.h for total memory + usage as a function of windowBits and memLevel. + + The strategy parameter is used to tune the compression algorithm. Use the + value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a + filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no + string match), or Z_RLE to limit match distances to one (run-length + encoding). Filtered data consists mostly of small values with a somewhat + random distribution. In this case, the compression algorithm is tuned to + compress them better. The effect of Z_FILTERED is to force more Huffman + coding and less string matching; it is somewhat intermediate between + Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as + Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy + parameter only affects the compression ratio but not the correctness of the + compressed output even if it is not set appropriately. Z_FIXED prevents the + use of dynamic Huffman codes, allowing for a simpler decoder for special + applications. + + deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid + method). msg is set to null if there is no error message. deflateInit2 does + not perform any compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the compression dictionary from the given byte sequence + without producing any compressed output. This function must be called + immediately after deflateInit, deflateInit2 or deflateReset, before any + call of deflate. The compressor and decompressor must use exactly the same + dictionary (see inflateSetDictionary). + + The dictionary should consist of strings (byte sequences) that are likely + to be encountered later in the data to be compressed, with the most commonly + used strings preferably put towards the end of the dictionary. Using a + dictionary is most useful when the data to be compressed is short and can be + predicted with good accuracy; the data can then be compressed better than + with the default empty dictionary. + + Depending on the size of the compression data structures selected by + deflateInit or deflateInit2, a part of the dictionary may in effect be + discarded, for example if the dictionary is larger than the window size in + deflate or deflate2. Thus the strings most likely to be useful should be + put at the end of the dictionary, not at the front. In addition, the + current implementation of deflate will use at most the window size minus + 262 bytes of the provided dictionary. + + Upon return of this function, strm->adler is set to the adler32 value + of the dictionary; the decompressor may later use this value to determine + which dictionary has been used by the compressor. (The adler32 value + applies to the whole dictionary even if only a subset of the dictionary is + actually used by the compressor.) If a raw deflate was requested, then the + adler32 value is not computed and strm->adler is not set. + + deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent (for example if deflate has already been called for this stream + or if the compression method is bsort). deflateSetDictionary does not + perform any compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, + z_streamp source)); +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when several compression strategies will be + tried, for example when there are several ways of pre-processing the input + data with a filter. The streams that will be discarded should then be freed + by calling deflateEnd. Note that deflateCopy duplicates the internal + compression state which can be quite large, so this strategy is slow and + can consume lots of memory. + + deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being NULL). msg is left unchanged in both source and + destination. +*/ + +ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); +/* + This function is equivalent to deflateEnd followed by deflateInit, + but does not free and reallocate all the internal compression state. + The stream will keep the same compression level and any other attributes + that may have been set by deflateInit2. + + deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL). +*/ + +ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, + int level, + int strategy)); +/* + Dynamically update the compression level and compression strategy. The + interpretation of level and strategy is as in deflateInit2. This can be + used to switch between compression and straight copy of the input data, or + to switch to a different kind of input data requiring a different + strategy. If the compression level is changed, the input available so far + is compressed with the old level (and may be flushed); the new level will + take effect only at the next call of deflate(). + + Before the call of deflateParams, the stream state must be set as for + a call of deflate(), since the currently available input may have to + be compressed and flushed. In particular, strm->avail_out must be non-zero. + + deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source + stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR + if strm->avail_out was zero. +*/ + +ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, + int good_length, + int max_lazy, + int nice_length, + int max_chain)); +/* + Fine tune deflate's internal compression parameters. This should only be + used by someone who understands the algorithm used by zlib's deflate for + searching for the best matching string, and even then only by the most + fanatic optimizer trying to squeeze out the last compressed bit for their + specific input data. Read the deflate.c source code for the meaning of the + max_lazy, good_length, nice_length, and max_chain parameters. + + deflateTune() can be called after deflateInit() or deflateInit2(), and + returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. + */ + +ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, + uLong sourceLen)); +/* + deflateBound() returns an upper bound on the compressed size after + deflation of sourceLen bytes. It must be called after deflateInit() + or deflateInit2(). This would be used to allocate an output buffer + for deflation in a single pass, and so would be called before deflate(). +*/ + +ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, + int bits, + int value)); +/* + deflatePrime() inserts bits in the deflate output stream. The intent + is that this function is used to start off the deflate output with the + bits leftover from a previous deflate stream when appending to it. As such, + this function can only be used for raw deflate, and must be used before the + first deflate() call after a deflateInit2() or deflateReset(). bits must be + less than or equal to 16, and that many of the least significant bits of + value will be inserted in the output. + + deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, + gz_headerp head)); +/* + deflateSetHeader() provides gzip header information for when a gzip + stream is requested by deflateInit2(). deflateSetHeader() may be called + after deflateInit2() or deflateReset() and before the first call of + deflate(). The text, time, os, extra field, name, and comment information + in the provided gz_header structure are written to the gzip header (xflag is + ignored -- the extra flags are set according to the compression level). The + caller must assure that, if not Z_NULL, name and comment are terminated with + a zero byte, and that if extra is not Z_NULL, that extra_len bytes are + available there. If hcrc is true, a gzip header crc is included. Note that + the current versions of the command-line version of gzip (up through version + 1.3.x) do not support header crc's, and will report that it is a "multi-part + gzip file" and give up. + + If deflateSetHeader is not used, the default gzip header has text false, + the time set to zero, and os set to 255, with no extra, name, or comment + fields. The gzip header is returned to the default state by deflateReset(). + + deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +/* +ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, + int windowBits)); + + This is another version of inflateInit with an extra parameter. The + fields next_in, avail_in, zalloc, zfree and opaque must be initialized + before by the caller. + + The windowBits parameter is the base two logarithm of the maximum window + size (the size of the history buffer). It should be in the range 8..15 for + this version of the library. The default value is 15 if inflateInit is used + instead. windowBits must be greater than or equal to the windowBits value + provided to deflateInit2() while compressing, or it must be equal to 15 if + deflateInit2() was not used. If a compressed stream with a larger window + size is given as input, inflate() will return with the error code + Z_DATA_ERROR instead of trying to allocate a larger window. + + windowBits can also be -8..-15 for raw inflate. In this case, -windowBits + determines the window size. inflate() will then process raw deflate data, + not looking for a zlib or gzip header, not generating a check value, and not + looking for any check values for comparison at the end of the stream. This + is for use with other formats that use the deflate compressed data format + such as zip. Those formats provide their own check values. If a custom + format is developed using the raw deflate format for compressed data, it is + recommended that a check value such as an adler32 or a crc32 be applied to + the uncompressed data as is done in the zlib, gzip, and zip formats. For + most applications, the zlib format should be used as is. Note that comments + above on the use in deflateInit2() applies to the magnitude of windowBits. + + windowBits can also be greater than 15 for optional gzip decoding. Add + 32 to windowBits to enable zlib and gzip decoding with automatic header + detection, or add 16 to decode only the gzip format (the zlib format will + return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is + a crc32 instead of an adler32. + + inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg + is set to null if there is no error message. inflateInit2 does not perform + any decompression apart from reading the zlib header if present: this will + be done by inflate(). (So next_in and avail_in may be modified, but next_out + and avail_out are unchanged.) +*/ + +ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the decompression dictionary from the given uncompressed byte + sequence. This function must be called immediately after a call of inflate, + if that call returned Z_NEED_DICT. The dictionary chosen by the compressor + can be determined from the adler32 value returned by that call of inflate. + The compressor and decompressor must use exactly the same dictionary (see + deflateSetDictionary). For raw inflate, this function can be called + immediately after inflateInit2() or inflateReset() and before any call of + inflate() to set the dictionary. The application must insure that the + dictionary that was used for compression is provided. + + inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the + expected one (incorrect adler32 value). inflateSetDictionary does not + perform any decompression: this will be done by subsequent calls of + inflate(). +*/ + +ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); +/* + Skips invalid compressed data until a full flush point (see above the + description of deflate with Z_FULL_FLUSH) can be found, or until all + available input is skipped. No output is provided. + + inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR + if no more input was provided, Z_DATA_ERROR if no flush point has been found, + or Z_STREAM_ERROR if the stream structure was inconsistent. In the success + case, the application may save the current current value of total_in which + indicates where valid compressed data was found. In the error case, the + application may repeatedly call inflateSync, providing more input each time, + until success or end of the input data. +*/ + +ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, + z_streamp source)); +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when randomly accessing a large stream. The + first pass through the stream can periodically record the inflate state, + allowing restarting inflate at those points when randomly accessing the + stream. + + inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being NULL). msg is left unchanged in both source and + destination. +*/ + +ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); +/* + This function is equivalent to inflateEnd followed by inflateInit, + but does not free and reallocate all the internal decompression state. + The stream will keep attributes that may have been set by inflateInit2. + + inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL). +*/ + +ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, + int bits, + int value)); +/* + This function inserts bits in the inflate input stream. The intent is + that this function is used to start inflating at a bit position in the + middle of a byte. The provided bits will be used before any bytes are used + from next_in. This function should only be used with raw inflate, and + should be used before the first inflate() call after inflateInit2() or + inflateReset(). bits must be less than or equal to 16, and that many of the + least significant bits of value will be inserted in the input. + + inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, + gz_headerp head)); +/* + inflateGetHeader() requests that gzip header information be stored in the + provided gz_header structure. inflateGetHeader() may be called after + inflateInit2() or inflateReset(), and before the first call of inflate(). + As inflate() processes the gzip stream, head->done is zero until the header + is completed, at which time head->done is set to one. If a zlib stream is + being decoded, then head->done is set to -1 to indicate that there will be + no gzip header information forthcoming. Note that Z_BLOCK can be used to + force inflate() to return immediately after header processing is complete + and before any actual data is decompressed. + + The text, time, xflags, and os fields are filled in with the gzip header + contents. hcrc is set to true if there is a header CRC. (The header CRC + was valid if done is set to one.) If extra is not Z_NULL, then extra_max + contains the maximum number of bytes to write to extra. Once done is true, + extra_len contains the actual extra field length, and extra contains the + extra field, or that field truncated if extra_max is less than extra_len. + If name is not Z_NULL, then up to name_max characters are written there, + terminated with a zero unless the length is greater than name_max. If + comment is not Z_NULL, then up to comm_max characters are written there, + terminated with a zero unless the length is greater than comm_max. When + any of extra, name, or comment are not Z_NULL and the respective field is + not present in the header, then that field is set to Z_NULL to signal its + absence. This allows the use of deflateSetHeader() with the returned + structure to duplicate the header. However if those fields are set to + allocated memory, then the application will need to save those pointers + elsewhere so that they can be eventually freed. + + If inflateGetHeader is not used, then the header information is simply + discarded. The header is always checked for validity, including the header + CRC if present. inflateReset() will reset the process to discard the header + information. The application would need to call inflateGetHeader() again to + retrieve the header from the next gzip stream. + + inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +/* +ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, + unsigned char FAR *window)); + + Initialize the internal stream state for decompression using inflateBack() + calls. The fields zalloc, zfree and opaque in strm must be initialized + before the call. If zalloc and zfree are Z_NULL, then the default library- + derived memory allocation routines are used. windowBits is the base two + logarithm of the window size, in the range 8..15. window is a caller + supplied buffer of that size. Except for special applications where it is + assured that deflate was used with small window sizes, windowBits must be 15 + and a 32K byte window must be supplied to be able to decompress general + deflate streams. + + See inflateBack() for the usage of these routines. + + inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of + the paramaters are invalid, Z_MEM_ERROR if the internal state could not + be allocated, or Z_VERSION_ERROR if the version of the library does not + match the version of the header file. +*/ + +typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *)); +typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); + +ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, + in_func in, void FAR *in_desc, + out_func out, void FAR *out_desc)); +/* + inflateBack() does a raw inflate with a single call using a call-back + interface for input and output. This is more efficient than inflate() for + file i/o applications in that it avoids copying between the output and the + sliding window by simply making the window itself the output buffer. This + function trusts the application to not change the output buffer passed by + the output function, at least until inflateBack() returns. + + inflateBackInit() must be called first to allocate the internal state + and to initialize the state with the user-provided window buffer. + inflateBack() may then be used multiple times to inflate a complete, raw + deflate stream with each call. inflateBackEnd() is then called to free + the allocated state. + + A raw deflate stream is one with no zlib or gzip header or trailer. + This routine would normally be used in a utility that reads zip or gzip + files and writes out uncompressed files. The utility would decode the + header and process the trailer on its own, hence this routine expects + only the raw deflate stream to decompress. This is different from the + normal behavior of inflate(), which expects either a zlib or gzip header and + trailer around the deflate stream. + + inflateBack() uses two subroutines supplied by the caller that are then + called by inflateBack() for input and output. inflateBack() calls those + routines until it reads a complete deflate stream and writes out all of the + uncompressed data, or until it encounters an error. The function's + parameters and return types are defined above in the in_func and out_func + typedefs. inflateBack() will call in(in_desc, &buf) which should return the + number of bytes of provided input, and a pointer to that input in buf. If + there is no input available, in() must return zero--buf is ignored in that + case--and inflateBack() will return a buffer error. inflateBack() will call + out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() + should return zero on success, or non-zero on failure. If out() returns + non-zero, inflateBack() will return with an error. Neither in() nor out() + are permitted to change the contents of the window provided to + inflateBackInit(), which is also the buffer that out() uses to write from. + The length written by out() will be at most the window size. Any non-zero + amount of input may be provided by in(). + + For convenience, inflateBack() can be provided input on the first call by + setting strm->next_in and strm->avail_in. If that input is exhausted, then + in() will be called. Therefore strm->next_in must be initialized before + calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called + immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in + must also be initialized, and then if strm->avail_in is not zero, input will + initially be taken from strm->next_in[0 .. strm->avail_in - 1]. + + The in_desc and out_desc parameters of inflateBack() is passed as the + first parameter of in() and out() respectively when they are called. These + descriptors can be optionally used to pass any information that the caller- + supplied in() and out() functions need to do their job. + + On return, inflateBack() will set strm->next_in and strm->avail_in to + pass back any unused input that was provided by the last in() call. The + return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR + if in() or out() returned an error, Z_DATA_ERROR if there was a format + error in the deflate stream (in which case strm->msg is set to indicate the + nature of the error), or Z_STREAM_ERROR if the stream was not properly + initialized. In the case of Z_BUF_ERROR, an input or output error can be + distinguished using strm->next_in which will be Z_NULL only if in() returned + an error. If strm->next is not Z_NULL, then the Z_BUF_ERROR was due to + out() returning non-zero. (in() will always be called before out(), so + strm->next_in is assured to be defined if out() returns non-zero.) Note + that inflateBack() cannot return Z_OK. +*/ + +ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); +/* + All memory allocated by inflateBackInit() is freed. + + inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream + state was inconsistent. +*/ + +ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); +/* Return flags indicating compile-time options. + + Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: + 1.0: size of uInt + 3.2: size of uLong + 5.4: size of voidpf (pointer) + 7.6: size of z_off_t + + Compiler, assembler, and debug options: + 8: DEBUG + 9: ASMV or ASMINF -- use ASM code + 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention + 11: 0 (reserved) + + One-time table building (smaller code, but not thread-safe if true): + 12: BUILDFIXED -- build static block decoding tables when needed + 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed + 14,15: 0 (reserved) + + Library content (indicates missing functionality): + 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking + deflate code when not needed) + 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect + and decode gzip streams (to avoid linking crc code) + 18-19: 0 (reserved) + + Operation variations (changes in library functionality): + 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate + 21: FASTEST -- deflate algorithm with only one, lowest compression level + 22,23: 0 (reserved) + + The sprintf variant used by gzprintf (zero is best): + 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format + 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! + 26: 0 = returns value, 1 = void -- 1 means inferred string length returned + + Remainder: + 27-31: 0 (reserved) + */ + + + /* utility functions */ + +/* + The following utility functions are implemented on top of the + basic stream-oriented functions. To simplify the interface, some + default options are assumed (compression level and memory usage, + standard memory allocation functions). The source code of these + utility functions can easily be modified if you need special options. +*/ + +ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Compresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be at least the value returned + by compressBound(sourceLen). Upon exit, destLen is the actual size of the + compressed buffer. + This function can be used to compress a whole file at once if the + input file is mmap'ed. + compress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer. +*/ + +ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int level)); +/* + Compresses the source buffer into the destination buffer. The level + parameter has the same meaning as in deflateInit. sourceLen is the byte + length of the source buffer. Upon entry, destLen is the total size of the + destination buffer, which must be at least the value returned by + compressBound(sourceLen). Upon exit, destLen is the actual size of the + compressed buffer. + + compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_BUF_ERROR if there was not enough room in the output buffer, + Z_STREAM_ERROR if the level parameter is invalid. +*/ + +ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); +/* + compressBound() returns an upper bound on the compressed size after + compress() or compress2() on sourceLen bytes. It would be used before + a compress() or compress2() call to allocate the destination buffer. +*/ + +ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Decompresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be large enough to hold the + entire uncompressed data. (The size of the uncompressed data must have + been saved previously by the compressor and transmitted to the decompressor + by some mechanism outside the scope of this compression library.) + Upon exit, destLen is the actual size of the compressed buffer. + This function can be used to decompress a whole file at once if the + input file is mmap'ed. + + uncompress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. +*/ + + +typedef voidp gzFile; + +ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); +/* + Opens a gzip (.gz) file for reading or writing. The mode parameter + is as in fopen ("rb" or "wb") but can also include a compression level + ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for + Huffman only compression as in "wb1h", or 'R' for run-length encoding + as in "wb1R". (See the description of deflateInit2 for more information + about the strategy parameter.) + + gzopen can be used to read a file which is not in gzip format; in this + case gzread will directly read from the file without decompression. + + gzopen returns NULL if the file could not be opened or if there was + insufficient memory to allocate the (de)compression state; errno + can be checked to distinguish the two cases (if errno is zero, the + zlib error is Z_MEM_ERROR). */ + +ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); +/* + gzdopen() associates a gzFile with the file descriptor fd. File + descriptors are obtained from calls like open, dup, creat, pipe or + fileno (in the file has been previously opened with fopen). + The mode parameter is as in gzopen. + The next call of gzclose on the returned gzFile will also close the + file descriptor fd, just like fclose(fdopen(fd), mode) closes the file + descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). + gzdopen returns NULL if there was insufficient memory to allocate + the (de)compression state. +*/ + +ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); +/* + Dynamically update the compression level or strategy. See the description + of deflateInit2 for the meaning of these parameters. + gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not + opened for writing. +*/ + +ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); +/* + Reads the given number of uncompressed bytes from the compressed file. + If the input file was not in gzip format, gzread copies the given number + of bytes into the buffer. + gzread returns the number of uncompressed bytes actually read (0 for + end of file, -1 for error). */ + +ZEXTERN int ZEXPORT gzwrite OF((gzFile file, + voidpc buf, unsigned len)); +/* + Writes the given number of uncompressed bytes into the compressed file. + gzwrite returns the number of uncompressed bytes actually written + (0 in case of error). +*/ + +ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); +/* + Converts, formats, and writes the args to the compressed file under + control of the format string, as in fprintf. gzprintf returns the number of + uncompressed bytes actually written (0 in case of error). The number of + uncompressed bytes written is limited to 4095. The caller should assure that + this limit is not exceeded. If it is exceeded, then gzprintf() will return + return an error (0) with nothing written. In this case, there may also be a + buffer overflow with unpredictable consequences, which is possible only if + zlib was compiled with the insecure functions sprintf() or vsprintf() + because the secure snprintf() or vsnprintf() functions were not available. +*/ + +ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); +/* + Writes the given null-terminated string to the compressed file, excluding + the terminating null character. + gzputs returns the number of characters written, or -1 in case of error. +*/ + +ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); +/* + Reads bytes from the compressed file until len-1 characters are read, or + a newline character is read and transferred to buf, or an end-of-file + condition is encountered. The string is then terminated with a null + character. + gzgets returns buf, or Z_NULL in case of error. +*/ + +ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); +/* + Writes c, converted to an unsigned char, into the compressed file. + gzputc returns the value that was written, or -1 in case of error. +*/ + +ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); +/* + Reads one byte from the compressed file. gzgetc returns this byte + or -1 in case of end of file or error. +*/ + +ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); +/* + Push one character back onto the stream to be read again later. + Only one character of push-back is allowed. gzungetc() returns the + character pushed, or -1 on failure. gzungetc() will fail if a + character has been pushed but not read yet, or if c is -1. The pushed + character will be discarded if the stream is repositioned with gzseek() + or gzrewind(). +*/ + +ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); +/* + Flushes all pending output into the compressed file. The parameter + flush is as in the deflate() function. The return value is the zlib + error number (see function gzerror below). gzflush returns Z_OK if + the flush parameter is Z_FINISH and all output could be flushed. + gzflush should be called only when strictly necessary because it can + degrade compression. +*/ + +ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, + z_off_t offset, int whence)); +/* + Sets the starting position for the next gzread or gzwrite on the + given compressed file. The offset represents a number of bytes in the + uncompressed data stream. The whence parameter is defined as in lseek(2); + the value SEEK_END is not supported. + If the file is opened for reading, this function is emulated but can be + extremely slow. If the file is opened for writing, only forward seeks are + supported; gzseek then compresses a sequence of zeroes up to the new + starting position. + + gzseek returns the resulting offset location as measured in bytes from + the beginning of the uncompressed stream, or -1 in case of error, in + particular if the file is opened for writing and the new starting position + would be before the current position. +*/ + +ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); +/* + Rewinds the given file. This function is supported only for reading. + + gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) +*/ + +ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); +/* + Returns the starting position for the next gzread or gzwrite on the + given compressed file. This position represents a number of bytes in the + uncompressed data stream. + + gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) +*/ + +ZEXTERN int ZEXPORT gzeof OF((gzFile file)); +/* + Returns 1 when EOF has previously been detected reading the given + input stream, otherwise zero. +*/ + +ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); +/* + Returns 1 if file is being read directly without decompression, otherwise + zero. +*/ + +ZEXTERN int ZEXPORT gzclose OF((gzFile file)); +/* + Flushes all pending output if necessary, closes the compressed file + and deallocates all the (de)compression state. The return value is the zlib + error number (see function gzerror below). +*/ + +ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); +/* + Returns the error message for the last error which occurred on the + given compressed file. errnum is set to zlib error number. If an + error occurred in the file system and not in the compression library, + errnum is set to Z_ERRNO and the application may consult errno + to get the exact error code. +*/ + +ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); +/* + Clears the error and end-of-file flags for file. This is analogous to the + clearerr() function in stdio. This is useful for continuing to read a gzip + file that is being written concurrently. +*/ + + /* checksum functions */ + +/* + These functions are not related to compression but are exported + anyway because they might be useful in applications using the + compression library. +*/ + +ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); +/* + Update a running Adler-32 checksum with the bytes buf[0..len-1] and + return the updated checksum. If buf is NULL, this function returns + the required initial value for the checksum. + An Adler-32 checksum is almost as reliable as a CRC32 but can be computed + much faster. Usage example: + + uLong adler = adler32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + adler = adler32(adler, buffer, length); + } + if (adler != original_adler) error(); +*/ + +ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, + z_off_t len2)); +/* + Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 + and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for + each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of + seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. +*/ + +ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); +/* + Update a running CRC-32 with the bytes buf[0..len-1] and return the + updated CRC-32. If buf is NULL, this function returns the required initial + value for the for the crc. Pre- and post-conditioning (one's complement) is + performed within this function so it shouldn't be done by the application. + Usage example: + + uLong crc = crc32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + crc = crc32(crc, buffer, length); + } + if (crc != original_crc) error(); +*/ + +ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); + +/* + Combine two CRC-32 check values into one. For two sequences of bytes, + seq1 and seq2 with lengths len1 and len2, CRC-32 check values were + calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 + check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and + len2. +*/ + + + /* various hacks, don't look :) */ + +/* deflateInit and inflateInit are macros to allow checking the zlib version + * and the compiler's view of z_stream: + */ +ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, + int windowBits, int memLevel, + int strategy, const char *version, + int stream_size)); +ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, + unsigned char FAR *window, + const char *version, + int stream_size)); +#define deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) +#define inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) +#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, sizeof(z_stream)) +#define inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) +#define inflateBackInit(strm, windowBits, window) \ + inflateBackInit_((strm), (windowBits), (window), \ + ZLIB_VERSION, sizeof(z_stream)) + + +#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) + struct internal_state {int dummy;}; /* hack for buggy compilers */ +#endif + +ZEXTERN const char * ZEXPORT zError OF((int)); +ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z)); +ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); + +#ifdef __cplusplus +} +#endif + +#endif /* ZLIB_H */ diff --git a/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/lib/zlib-bcc.lib b/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/lib/zlib-bcc.lib new file mode 100644 index 0000000000..f23e2b12a0 Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/lib/zlib-bcc.lib differ diff --git a/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/lib/zlib.def b/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/lib/zlib.def new file mode 100644 index 0000000000..af59b0e6e4 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/lib/zlib.def @@ -0,0 +1,75 @@ +; h:\mingw\3.3.1\bin\dlltool.exe --export-all-symbols --output-def=zlib.def adler32.pic.o compress.pic.o crc32.pic.o gzio.pic.o uncompr.pic.o deflate.pic.o trees.pic.o zutil.pic.o inflate.pic.o infback.pic.o inftrees.pic.o inffast.pic.o zlib-dllversion.o zlib-dll-res.o +EXPORTS + DllGetVersion @ 1 ; + _dist_code @ 2 DATA ; + _length_code @ 3 DATA ; + _tr_align @ 4 ; + _tr_flush_block @ 5 ; + _tr_init @ 6 ; + _tr_stored_block @ 7 ; + _tr_tally @ 8 ; + adler32 @ 9 ; + adler32_combine @ 10 ; + compress @ 11 ; + compress2 @ 12 ; + compressBound @ 13 ; + crc32 @ 14 ; + crc32_combine @ 15 ; + deflate @ 16 ; + deflateBound @ 17 ; + deflateCopy @ 18 ; + deflateEnd @ 19 ; + deflateInit2_ @ 20 ; + deflateInit_ @ 21 ; + deflateParams @ 22 ; + deflatePrime @ 23 ; + deflateReset @ 24 ; + deflateSetDictionary @ 25 ; + deflateSetHeader @ 26 ; + deflateTune @ 27 ; + deflate_copyright @ 28 DATA ; + get_crc_table @ 29 ; + gzclearerr @ 30 ; + gzclose @ 31 ; + gzdirect @ 32 ; + gzdopen @ 33 ; + gzeof @ 34 ; + gzerror @ 35 ; + gzflush @ 36 ; + gzgetc @ 37 ; + gzgets @ 38 ; + gzopen @ 39 ; + gzprintf @ 40 ; + gzputc @ 41 ; + gzputs @ 42 ; + gzread @ 43 ; + gzrewind @ 44 ; + gzseek @ 45 ; + gzsetparams @ 46 ; + gztell @ 47 ; + gzungetc @ 48 ; + gzwrite @ 49 ; + inflate @ 50 ; + inflateBack @ 51 ; + inflateBackEnd @ 52 ; + inflateBackInit_ @ 53 ; + inflateCopy @ 54 ; + inflateEnd @ 55 ; + inflateGetHeader @ 56 ; + inflateInit2_ @ 57 ; + inflateInit_ @ 58 ; + inflatePrime @ 59 ; + inflateReset @ 60 ; + inflateSetDictionary @ 61 ; + inflateSync @ 62 ; + inflateSyncPoint @ 63 ; + inflate_copyright @ 64 DATA ; + inflate_fast @ 65 ; + inflate_table @ 66 ; + uncompress @ 67 ; + zError @ 68 ; + z_errmsg @ 69 DATA ; + zcalloc @ 70 ; + zcfree @ 71 ; + zlibCompileFlags @ 72 ; + zlibVersion @ 73 ; diff --git a/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/lib/zlib.lib b/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/lib/zlib.lib new file mode 100644 index 0000000000..d43be7f029 Binary files /dev/null and b/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/lib/zlib.lib differ diff --git a/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/manifest/zlib-1.2.3-lib.mft b/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/manifest/zlib-1.2.3-lib.mft new file mode 100644 index 0000000000..8bff65fb36 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/manifest/zlib-1.2.3-lib.mft @@ -0,0 +1,9 @@ +include/zconf.h +include/zlib.h +lib/libz.a +lib/libz.dll.a +lib/zlib-bcc.lib +lib/zlib.def +lib/zlib.lib +manifest/zlib-1.2.3-lib.mft +manifest/zlib-1.2.3-lib.ver diff --git a/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/manifest/zlib-1.2.3-lib.ver b/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/manifest/zlib-1.2.3-lib.ver new file mode 100644 index 0000000000..fff2b17ab9 --- /dev/null +++ b/libmupen64plus/mupen64plus-win32-deps/zlib-1.2.3/manifest/zlib-1.2.3-lib.ver @@ -0,0 +1,2 @@ +Zlib-1.2.3: Developer files +Zlib: general purpose data compression / decompression library \ No newline at end of file